@@ -971,10 +971,10 @@ int usbnet_get_link_ksettings_internal(struct net_device *net,
* For wireless stuff it is not true.
* We assume that rxspeed matters more.
*/
- if (dev->rxspeed != SPEED_UNKNOWN)
- cmd->base.speed = dev->rxspeed / 1000000;
- else if (dev->txspeed != SPEED_UNKNOWN)
- cmd->base.speed = dev->txspeed / 1000000;
+ if (dev->rx_speed != SPEED_UNSET)
+ cmd->base.speed = dev->rx_speed / 1000000;
+ else if (dev->tx_speed != SPEED_UNSET)
+ cmd->base.speed = dev->tx_speed / 1000000;
else
cmd->base.speed = SPEED_UNKNOWN;
@@ -1685,6 +1685,9 @@ usbnet_probe (struct usb_interface *udev, const struct usb_device_id *prod)
dev->intf = udev;
dev->driver_info = info;
dev->driver_name = name;
+ /* cannot use 0, as simplex devices may exist */
+ dev->rx_speed = SPEED_UNSET; /* unknown or handled by MII */
+ dev->tx_speed = SPEED_UNSET;
net->tstats = netdev_alloc_pcpu_stats(struct pcpu_sw_netstats);
if (!net->tstats)
@@ -53,6 +53,10 @@ struct usbnet {
u32 hard_mtu; /* count any extra framing */
size_t rx_urb_size; /* size for rx urbs */
struct mii_if_info mii;
+ /* These are bits per second unlike what ethernet uses */
+ long rx_speed; /* if MII is not used */
+ long tx_speed; /* if MII is not used */
+# define SPEED_UNSET -1
/* various kinds of pending driver work */
struct sk_buff_head rxq;
@@ -81,8 +85,6 @@ struct usbnet {
# define EVENT_LINK_CHANGE 11
# define EVENT_SET_RX_MODE 12
# define EVENT_NO_IP_ALIGN 13
- u32 rx_speed; /* in bps - NOT Mbps */
- u32 tx_speed; /* in bps - NOT Mbps */
};
static inline struct usb_driver *driver_of(struct usb_interface *intf)