Skip to contentSkip to conversation

usb: eth: add print of device name on usb_ether registration

PATCH New Tim Harvey 3 participants 6 messages Mar 25, 2021 – Mar 26, 2021 USB

lore
Share & tools
lore

Tim Harvey

author
#0 lore raw

PATCH 1/1 usb: eth: add print of device name on usb_ether registration

When a USB Ethernet device is detected and registered there is no way to know the device-name in order to use it with the ethact env variable.

Add a print to display the device name that is registered.

Example using an AX88x72A USB Ethernet device:

GW6404-B> usb start
starting USB...
Bus xhci_pci: Register 2000140 NbrPorts 2
Starting the controller
USB XHCI 1.00
Bus xhci_pci: Register 2000140 NbrPorts 2
Starting the controller
USB XHCI 1.00
scanning bus xhci_pci for devices...
? ? ? ?found ethernet device: asix_eth

GW6404-B> setenv ethact asix_eth # select usb ethernet

---
 drivers/usb/eth/usb_ether.c | 1 +
 1 file changed, 1 insertion(+)
drivers/usb/eth/usb_ether.c +1 -0
index e368ecda0d..916c4e1c85 100644
@@ -86,6 +86,7 @@ int usb_ether_register(struct udevice *dev, struct ueth_data *ueth, int rxsize)
 		return ret;
 	}
 	ueth->pusb_dev = udev;
+	printf("\n? ? ? ?found ethernet device: %s\n", dev->name);
 
 	return 0;
 }
Signature · 1 line
2.17.1
#1 lore raw

PATCH 1/1 usb: eth: add print of device name on usb_ether registration

Quoted 31 lines · Tim Harvey

When a USB Ethernet device is detected and registered there is no way to know the device-name in order to use it with the ethact env variable.

Add a print to display the device name that is registered.

Example using an AX88x72A USB Ethernet device:

GW6404-B> usb start
starting USB...
Bus xhci_pci: Register 2000140 NbrPorts 2
Starting the controller
USB XHCI 1.00
Bus xhci_pci: Register 2000140 NbrPorts 2
Starting the controller
USB XHCI 1.00
scanning bus xhci_pci for devices...
? ? ? ?found ethernet device: asix_eth

GW6404-B> setenv ethact asix_eth # select usb ethernet

---
  drivers/usb/eth/usb_ether.c | 1 +
  1 file changed, 1 insertion(+)
drivers/usb/eth/usb_ether.c +0 -0
index e368ecda0d..916c4e1c85 100644

drivers/usb/eth/usb_ether.c int usb_ether_register(struct udevice *dev, struct ueth_data *ueth, int rxsize) · line 89

Quoted 4 lines
drivers/usb/eth/usb_ether.c +1 -0
@@ -86,6 +86,7 @@ int usb_ether_register(struct udevice *dev, struct ueth_data *ueth, int rxsize)
  		return ret;
  	}
  	ueth->pusb_dev = udev;
+	printf("\n? ? ? ?found ethernet device: %s\n", dev->name);

What if I have 2 asix_eth plugged in ? Do I get two identical prints ?

btw. it might be useful to have some "net list" command, like "mmc list" which would list all ethernet devices in the system.

author
#2 lore raw

PATCH 1/1 usb: eth: add print of device name on usb_ether registration

Quoted 28 lines · Marek Vasut
Quoted 26 lines · Tim Harvey

When a USB Ethernet device is detected and registered there is no way to know the device-name in order to use it with the ethact env variable.

Add a print to display the device name that is registered.

Example using an AX88x72A USB Ethernet device:

GW6404-B> usb start
starting USB...
Bus xhci_pci: Register 2000140 NbrPorts 2
Starting the controller
USB XHCI 1.00
Bus xhci_pci: Register 2000140 NbrPorts 2
Starting the controller
USB XHCI 1.00
scanning bus xhci_pci for devices...
found ethernet device: asix_eth

GW6404-B> setenv ethact asix_eth # select usb ethernet

---
  drivers/usb/eth/usb_ether.c | 1 +
  1 file changed, 1 insertion(+)
Quoted 11 lines

drivers/usb/eth/usb_ether.c int usb_ether_register(struct udevice *dev, struct ueth_data *ueth, int rxsize) · line 89

Quoted 9 lines
drivers/usb/eth/usb_ether.c +1 -0
index e368ecda0d..916c4e1c85 100644
@@ -86,6 +86,7 @@ int usb_ether_register(struct udevice *dev, struct ueth_data *ueth, int rxsize)
              return ret;
      }
      ueth->pusb_dev = udev;
+     printf("\n       found ethernet device: %s\n", dev->name);

What if I have 2 asix_eth plugged in ? Do I get two identical prints ?

Marek,

Yes, two identical prints in this case which is not good.

Which makes me wonder why 'setenv asix_eth' even works here as drivers/usb/eth/asix.c's get_info function creates a unique instance name.

Quoted 3 lines

btw. it might be useful to have some "net list" command, like "mmc list" which would list all ethernet devices in the system.

That's what I was wondering as well. There are the following subcommands in the usb cmd:
usb storage - show details of USB storage devices usb dev [dev] - show or set current USB storage device
usb part [dev] - print partition table of one or all USB storage devices

So I was wondering if we should add a:
usb net - show details of USB network devices

by the way, here are a few other devices I have on hand showing the vid:pid, ethact name, driver Kconfig, and device:
// vid:pid ethact uboot-driver device-name
0bda:8153 r8152_eth USB_ETHER_RTL8152 CableCreation CD0026: USB3 GbE 0b95:1790 ax88179_eth USB_ETHER_ASIX88179 plugable USB3-E1000: USB 3.0 10/100/1000mbps
0b95:7720 asix_eth USB_ETHER_ASIX plugable USB2-E100: USB2.0 10/100 ASIX AX88772A

Best regards,

Tim

#3 lore raw

PATCH 1/1 usb: eth: add print of device name on usb_ether registration

Quoted 41 lines · Tim Harvey
Quoted 28 lines · Marek Vasut
Quoted 26 lines · Tim Harvey

When a USB Ethernet device is detected and registered there is no way to know the device-name in order to use it with the ethact env variable.

Add a print to display the device name that is registered.

Example using an AX88x72A USB Ethernet device:

GW6404-B> usb start
starting USB...
Bus xhci_pci: Register 2000140 NbrPorts 2
Starting the controller
USB XHCI 1.00
Bus xhci_pci: Register 2000140 NbrPorts 2
Starting the controller
USB XHCI 1.00
scanning bus xhci_pci for devices...
found ethernet device: asix_eth

GW6404-B> setenv ethact asix_eth # select usb ethernet

---
   drivers/usb/eth/usb_ether.c | 1 +
   1 file changed, 1 insertion(+)
Quoted 11 lines

drivers/usb/eth/usb_ether.c int usb_ether_register(struct udevice *dev, struct ueth_data *ueth, int rxsize) · line 89

Quoted 9 lines
drivers/usb/eth/usb_ether.c +1 -0
index e368ecda0d..916c4e1c85 100644
@@ -86,6 +86,7 @@ int usb_ether_register(struct udevice *dev, struct ueth_data *ueth, int rxsize)
               return ret;
       }
       ueth->pusb_dev = udev;
+     printf("\n       found ethernet device: %s\n", dev->name);

What if I have 2 asix_eth plugged in ? Do I get two identical prints ?

Quoted 7 lines

Marek,

Yes, two identical prints in this case which is not good.

Which makes me wonder why 'setenv asix_eth' even works here as drivers/usb/eth/asix.c's get_info function creates a unique instance name.

Seems a bit further investigation into this might be necessary.

Quoted 11 lines
Quoted 2 lines

btw. it might be useful to have some "net list" command, like "mmc list" which would list all ethernet devices in the system.

That's what I was wondering as well. There are the following subcommands in the usb cmd:
usb storage - show details of USB storage devices usb dev [dev] - show or set current USB storage device
usb part [dev] - print partition table of one or all USB storage devices

So I was wondering if we should add a:
usb net - show details of USB network devices

I don't think such a command should be limited to USB network devices, it should be something applicable to all network devices.

Quoted 8 lines

by the way, here are a few other devices I have on hand showing the vid:pid, ethact name, driver Kconfig, and device:
// vid:pid ethact uboot-driver device-name
0bda:8153 r8152_eth USB_ETHER_RTL8152 CableCreation CD0026: USB3 GbE 0b95:1790 ax88179_eth USB_ETHER_ASIX88179 plugable USB3-E1000: USB 3.0 10/100/1000mbps
0b95:7720 asix_eth USB_ETHER_ASIX plugable USB2-E100: USB2.0 10/100 ASIX AX88772A

author
#4 lore raw

PATCH 1/1 usb: eth: add print of device name on usb_ether registration

Quoted 45 lines · Marek Vasut
Quoted 43 lines · Tim Harvey
Quoted 28 lines · Marek Vasut
Quoted 26 lines · Tim Harvey

When a USB Ethernet device is detected and registered there is no way to know the device-name in order to use it with the ethact env variable.

Add a print to display the device name that is registered.

Example using an AX88x72A USB Ethernet device:

GW6404-B> usb start
starting USB...
Bus xhci_pci: Register 2000140 NbrPorts 2
Starting the controller
USB XHCI 1.00
Bus xhci_pci: Register 2000140 NbrPorts 2
Starting the controller
USB XHCI 1.00
scanning bus xhci_pci for devices...
found ethernet device: asix_eth

GW6404-B> setenv ethact asix_eth # select usb ethernet

---
   drivers/usb/eth/usb_ether.c | 1 +
   1 file changed, 1 insertion(+)
Quoted 11 lines

drivers/usb/eth/usb_ether.c int usb_ether_register(struct udevice *dev, struct ueth_data *ueth, int rxsize) · line 89

Quoted 9 lines
drivers/usb/eth/usb_ether.c +1 -0
index e368ecda0d..916c4e1c85 100644
@@ -86,6 +86,7 @@ int usb_ether_register(struct udevice *dev, struct ueth_data *ueth, int rxsize)
               return ret;
       }
       ueth->pusb_dev = udev;
+     printf("\n       found ethernet device: %s\n", dev->name);

What if I have 2 asix_eth plugged in ? Do I get two identical prints ?

Marek,

Quoted 7 lines
Quoted 5 lines

Yes, two identical prints in this case which is not good.

Which makes me wonder why 'setenv asix_eth' even works here as drivers/usb/eth/asix.c's get_info function creates a unique instance name.

Seems a bit further investigation into this might be necessary.

It looks to me like the eth dev names are uniquely indexed for the non DM_ETH case where each driver has a 'get_info' function that returns an indexed name but for the DM_ETH case the eth_dev name is simply the udevice name which is not unique.

Quoted 10 lines
Quoted 10 lines
Quoted 3 lines

btw. it might be useful to have some "net list" command, like "mmc list" which would list all ethernet devices in the system.

That's what I was wondering as well. There are the following subcommands in the usb cmd:
usb storage - show details of USB storage devices usb dev [dev] - show or set current USB storage device
usb part [dev] - print partition table of one or all USB storage devices

Quoted 6 lines
Quoted 2 lines

So I was wondering if we should add a:
usb net - show details of USB network devices

I don't think such a command should be limited to USB network devices, it should be something applicable to all network devices.

Yes, I agree.

I'll look into adding this in the near future.

Thanks,

Tim

#5 lore raw

PATCH 1/1 usb: eth: add print of device name on usb_ether registration

In reply to Tim Harvey
Quoted 5 lines · Tim Harvey

When a USB Ethernet device is detected and registered there is no way to know the device-name in order to use it with the ethact env variable.

Add a print to display the device name that is registered.

Nice. I've also stumbled upon this problem a few times but always failed to implement such a small "fix".

Quoted 13 lines

Example using an AX88x72A USB Ethernet device:

GW6404-B> usb start
starting USB...
Bus xhci_pci: Register 2000140 NbrPorts 2
Starting the controller
USB XHCI 1.00
Bus xhci_pci: Register 2000140 NbrPorts 2
Starting the controller
USB XHCI 1.00
scanning bus xhci_pci for devices...
? ? ? ?found ethernet device: asix_eth

Quoted 3 lines

GW6404-B> setenv ethact asix_eth # select usb ethernet

Thanks,
Stefan

Quoted 10 lines
---
  drivers/usb/eth/usb_ether.c | 1 +
  1 file changed, 1 insertion(+)
drivers/usb/eth/usb_ether.c +0 -0
index e368ecda0d..916c4e1c85 100644

drivers/usb/eth/usb_ether.c int usb_ether_register(struct udevice *dev, struct ueth_data *ueth, int rxsize) · line 92

Quoted 7 lines
drivers/usb/eth/usb_ether.c +1 -0
@@ -86,6 +86,7 @@ int usb_ether_register(struct udevice *dev, struct ueth_data *ueth, int rxsize)
  		return ret;
  	}
  	ueth->pusb_dev = udev;
+	printf("\n? ? ? ?found ethernet device: %s\n", dev->name);
 
  	return 0;
  }

Viele Gr??e,
Stefan

Signature · 3 lines
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-51 Fax: (+49)-8142-66989-80 Email: sr at denx.de