Commit a475f603 authored by Joe Perches's avatar Joe Perches Committed by David S. Miller

drivers/net/usb: Use netif_<level> logging facilities

Convert from:
	if (netif_msg_<foo>(priv))
		dev_<level>(dev...
to
	netif_<level>(priv, foo, dev...

Also convert a few:

	if (i < REG_TIMEOUT) {
		etc...
		return ret;
       }
to
	if (i >= REG_TIMEOUT)
		goto fail;
	etc...
	return ret;
Signed-off-by: default avatarJoe Perches <joe@perches.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 60b86755
...@@ -339,10 +339,10 @@ EXPORT_SYMBOL_GPL(usbnet_cdc_unbind); ...@@ -339,10 +339,10 @@ EXPORT_SYMBOL_GPL(usbnet_cdc_unbind);
static void dumpspeed(struct usbnet *dev, __le32 *speeds) static void dumpspeed(struct usbnet *dev, __le32 *speeds)
{ {
if (netif_msg_timer(dev)) netif_info(dev, timer, dev->net,
netdev_info(dev->net, "link speeds: %u kbps up, %u kbps down\n", "link speeds: %u kbps up, %u kbps down\n",
__le32_to_cpu(speeds[0]) / 1000, __le32_to_cpu(speeds[0]) / 1000,
__le32_to_cpu(speeds[1]) / 1000); __le32_to_cpu(speeds[1]) / 1000);
} }
static void cdc_status(struct usbnet *dev, struct urb *urb) static void cdc_status(struct usbnet *dev, struct urb *urb)
...@@ -361,18 +361,16 @@ static void cdc_status(struct usbnet *dev, struct urb *urb) ...@@ -361,18 +361,16 @@ static void cdc_status(struct usbnet *dev, struct urb *urb)
event = urb->transfer_buffer; event = urb->transfer_buffer;
switch (event->bNotificationType) { switch (event->bNotificationType) {
case USB_CDC_NOTIFY_NETWORK_CONNECTION: case USB_CDC_NOTIFY_NETWORK_CONNECTION:
if (netif_msg_timer(dev)) netif_dbg(dev, timer, dev->net, "CDC: carrier %s\n",
netdev_dbg(dev->net, "CDC: carrier %s\n", event->wValue ? "on" : "off");
event->wValue ? "on" : "off");
if (event->wValue) if (event->wValue)
netif_carrier_on(dev->net); netif_carrier_on(dev->net);
else else
netif_carrier_off(dev->net); netif_carrier_off(dev->net);
break; break;
case USB_CDC_NOTIFY_SPEED_CHANGE: /* tx/rx rates */ case USB_CDC_NOTIFY_SPEED_CHANGE: /* tx/rx rates */
if (netif_msg_timer(dev)) netif_dbg(dev, timer, dev->net, "CDC: speed change (len %d)\n",
netdev_dbg(dev->net, "CDC: speed change (len %d)\n", urb->actual_length);
urb->actual_length);
if (urb->actual_length != (sizeof *event + 8)) if (urb->actual_length != (sizeof *event + 8))
set_bit(EVENT_STS_SPLIT, &dev->flags); set_bit(EVENT_STS_SPLIT, &dev->flags);
else else
......
...@@ -203,26 +203,23 @@ static void nc_dump_registers(struct usbnet *dev) ...@@ -203,26 +203,23 @@ static void nc_dump_registers(struct usbnet *dev)
static inline void nc_dump_usbctl(struct usbnet *dev, u16 usbctl) static inline void nc_dump_usbctl(struct usbnet *dev, u16 usbctl)
{ {
if (!netif_msg_link(dev)) netif_dbg(dev, link, dev->net,
return; "net1080 %s-%s usbctl 0x%x:%s%s%s%s%s; this%s%s; other%s%s; r/o 0x%x\n",
netdev_dbg(dev->net, "net1080 %s-%s usbctl 0x%x:%s%s%s%s%s;" dev->udev->bus->bus_name, dev->udev->devpath,
" this%s%s;" usbctl,
" other%s%s; r/o 0x%x\n", (usbctl & USBCTL_ENABLE_LANG) ? " lang" : "",
dev->udev->bus->bus_name, dev->udev->devpath, (usbctl & USBCTL_ENABLE_MFGR) ? " mfgr" : "",
usbctl, (usbctl & USBCTL_ENABLE_PROD) ? " prod" : "",
(usbctl & USBCTL_ENABLE_LANG) ? " lang" : "", (usbctl & USBCTL_ENABLE_SERIAL) ? " serial" : "",
(usbctl & USBCTL_ENABLE_MFGR) ? " mfgr" : "", (usbctl & USBCTL_ENABLE_DEFAULTS) ? " defaults" : "",
(usbctl & USBCTL_ENABLE_PROD) ? " prod" : "",
(usbctl & USBCTL_ENABLE_SERIAL) ? " serial" : "", (usbctl & USBCTL_FLUSH_THIS) ? " FLUSH" : "",
(usbctl & USBCTL_ENABLE_DEFAULTS) ? " defaults" : "", (usbctl & USBCTL_DISCONN_THIS) ? " DIS" : "",
(usbctl & USBCTL_FLUSH_THIS) ? " FLUSH" : "", (usbctl & USBCTL_FLUSH_OTHER) ? " FLUSH" : "",
(usbctl & USBCTL_DISCONN_THIS) ? " DIS" : "", (usbctl & USBCTL_DISCONN_OTHER) ? " DIS" : "",
(usbctl & USBCTL_FLUSH_OTHER) ? " FLUSH" : "", usbctl & ~USBCTL_WRITABLE_MASK);
(usbctl & USBCTL_DISCONN_OTHER) ? " DIS" : "",
usbctl & ~USBCTL_WRITABLE_MASK);
} }
/*-------------------------------------------------------------------------*/ /*-------------------------------------------------------------------------*/
...@@ -249,27 +246,26 @@ static inline void nc_dump_usbctl(struct usbnet *dev, u16 usbctl) ...@@ -249,27 +246,26 @@ static inline void nc_dump_usbctl(struct usbnet *dev, u16 usbctl)
static inline void nc_dump_status(struct usbnet *dev, u16 status) static inline void nc_dump_status(struct usbnet *dev, u16 status)
{ {
if (!netif_msg_link(dev)) netif_dbg(dev, link, dev->net,
return; "net1080 %s-%s status 0x%x: this (%c) PKT=%d%s%s%s; other PKT=%d%s%s%s; unspec 0x%x\n",
netdev_dbg(dev->net, "net1080 %s-%s status 0x%x: this (%c) PKT=%d%s%s%s; other PKT=%d%s%s%s; unspec 0x%x\n", dev->udev->bus->bus_name, dev->udev->devpath,
dev->udev->bus->bus_name, dev->udev->devpath, status,
status,
// XXX the packet counts don't seem right
// XXX the packet counts don't seem right // (1 at reset, not 0); maybe UNSPEC too
// (1 at reset, not 0); maybe UNSPEC too
(status & STATUS_PORT_A) ? 'A' : 'B',
(status & STATUS_PORT_A) ? 'A' : 'B', STATUS_PACKETS_THIS(status),
STATUS_PACKETS_THIS(status), (status & STATUS_CONN_THIS) ? " CON" : "",
(status & STATUS_CONN_THIS) ? " CON" : "", (status & STATUS_SUSPEND_THIS) ? " SUS" : "",
(status & STATUS_SUSPEND_THIS) ? " SUS" : "", (status & STATUS_MAILBOX_THIS) ? " MBOX" : "",
(status & STATUS_MAILBOX_THIS) ? " MBOX" : "",
STATUS_PACKETS_OTHER(status),
STATUS_PACKETS_OTHER(status), (status & STATUS_CONN_OTHER) ? " CON" : "",
(status & STATUS_CONN_OTHER) ? " CON" : "", (status & STATUS_SUSPEND_OTHER) ? " SUS" : "",
(status & STATUS_SUSPEND_OTHER) ? " SUS" : "", (status & STATUS_MAILBOX_OTHER) ? " MBOX" : "",
(status & STATUS_MAILBOX_OTHER) ? " MBOX" : "",
status & STATUS_UNSPEC_MASK);
status & STATUS_UNSPEC_MASK);
} }
/*-------------------------------------------------------------------------*/ /*-------------------------------------------------------------------------*/
...@@ -284,10 +280,9 @@ static inline void nc_dump_status(struct usbnet *dev, u16 status) ...@@ -284,10 +280,9 @@ static inline void nc_dump_status(struct usbnet *dev, u16 status)
static inline void nc_dump_ttl(struct usbnet *dev, u16 ttl) static inline void nc_dump_ttl(struct usbnet *dev, u16 ttl)
{ {
if (netif_msg_link(dev)) netif_dbg(dev, link, dev->net, "net1080 %s-%s ttl 0x%x this = %d, other = %d\n",
netdev_dbg(dev->net, "net1080 %s-%s ttl 0x%x this = %d, other = %d\n", dev->udev->bus->bus_name, dev->udev->devpath,
dev->udev->bus->bus_name, dev->udev->devpath, ttl, TTL_THIS(ttl), TTL_OTHER(ttl));
ttl, TTL_THIS(ttl), TTL_OTHER(ttl));
} }
/*-------------------------------------------------------------------------*/ /*-------------------------------------------------------------------------*/
...@@ -332,10 +327,9 @@ static int net1080_reset(struct usbnet *dev) ...@@ -332,10 +327,9 @@ static int net1080_reset(struct usbnet *dev)
MK_TTL(NC_READ_TTL_MS, TTL_OTHER(ttl)) ); MK_TTL(NC_READ_TTL_MS, TTL_OTHER(ttl)) );
dbg("%s: assigned TTL, %d ms", dev->net->name, NC_READ_TTL_MS); dbg("%s: assigned TTL, %d ms", dev->net->name, NC_READ_TTL_MS);
if (netif_msg_link(dev)) netif_info(dev, link, dev->net, "port %c, peer %sconnected\n",
netdev_info(dev->net, "port %c, peer %sconnected\n", (status & STATUS_PORT_A) ? 'A' : 'B',
(status & STATUS_PORT_A) ? 'A' : 'B', (status & STATUS_CONN_OTHER) ? "" : "dis");
(status & STATUS_CONN_OTHER) ? "" : "dis");
retval = 0; retval = 0;
done: done:
...@@ -412,8 +406,8 @@ static void nc_ensure_sync(struct usbnet *dev) ...@@ -412,8 +406,8 @@ static void nc_ensure_sync(struct usbnet *dev)
return; return;
} }
if (netif_msg_rx_err(dev)) netif_dbg(dev, rx_err, dev->net,
netdev_dbg(dev->net, "flush net1080; too many framing errors\n"); "flush net1080; too many framing errors\n");
dev->frame_errors = 0; dev->frame_errors = 0;
} }
} }
......
This diff is collapsed.
...@@ -335,8 +335,8 @@ generic_rndis_bind(struct usbnet *dev, struct usb_interface *intf, int flags) ...@@ -335,8 +335,8 @@ generic_rndis_bind(struct usbnet *dev, struct usb_interface *intf, int flags)
dev->maxpacket = usb_maxpacket(dev->udev, dev->out, 1); dev->maxpacket = usb_maxpacket(dev->udev, dev->out, 1);
if (dev->maxpacket == 0) { if (dev->maxpacket == 0) {
if (netif_msg_probe(dev)) netif_dbg(dev, probe, dev->net,
dev_dbg(&intf->dev, "dev->maxpacket can't be 0\n"); "dev->maxpacket can't be 0\n");
retval = -EINVAL; retval = -EINVAL;
goto fail_and_release; goto fail_and_release;
} }
...@@ -394,17 +394,15 @@ generic_rndis_bind(struct usbnet *dev, struct usb_interface *intf, int flags) ...@@ -394,17 +394,15 @@ generic_rndis_bind(struct usbnet *dev, struct usb_interface *intf, int flags)
} }
if ((flags & FLAG_RNDIS_PHYM_WIRELESS) && if ((flags & FLAG_RNDIS_PHYM_WIRELESS) &&
*phym != RNDIS_PHYSICAL_MEDIUM_WIRELESS_LAN) { *phym != RNDIS_PHYSICAL_MEDIUM_WIRELESS_LAN) {
if (netif_msg_probe(dev)) netif_dbg(dev, probe, dev->net,
dev_dbg(&intf->dev, "driver requires wireless " "driver requires wireless physical medium, but device is not\n");
"physical medium, but device is not.\n");
retval = -ENODEV; retval = -ENODEV;
goto halt_fail_and_release; goto halt_fail_and_release;
} }
if ((flags & FLAG_RNDIS_PHYM_NOT_WIRELESS) && if ((flags & FLAG_RNDIS_PHYM_NOT_WIRELESS) &&
*phym == RNDIS_PHYSICAL_MEDIUM_WIRELESS_LAN) { *phym == RNDIS_PHYSICAL_MEDIUM_WIRELESS_LAN) {
if (netif_msg_probe(dev)) netif_dbg(dev, probe, dev->net,
dev_dbg(&intf->dev, "driver requires non-wireless " "driver requires non-wireless physical medium, but device is wireless.\n");
"physical medium, but device is wireless.\n");
retval = -ENODEV; retval = -ENODEV;
goto halt_fail_and_release; goto halt_fail_and_release;
} }
......
...@@ -376,13 +376,11 @@ static void smsc95xx_set_multicast(struct net_device *netdev) ...@@ -376,13 +376,11 @@ static void smsc95xx_set_multicast(struct net_device *netdev)
spin_lock_irqsave(&pdata->mac_cr_lock, flags); spin_lock_irqsave(&pdata->mac_cr_lock, flags);
if (dev->net->flags & IFF_PROMISC) { if (dev->net->flags & IFF_PROMISC) {
if (netif_msg_drv(dev)) netif_dbg(dev, drv, dev->net, "promiscuous mode enabled\n");
netdev_dbg(dev->net, "promiscuous mode enabled\n");
pdata->mac_cr |= MAC_CR_PRMS_; pdata->mac_cr |= MAC_CR_PRMS_;
pdata->mac_cr &= ~(MAC_CR_MCPAS_ | MAC_CR_HPFILT_); pdata->mac_cr &= ~(MAC_CR_MCPAS_ | MAC_CR_HPFILT_);
} else if (dev->net->flags & IFF_ALLMULTI) { } else if (dev->net->flags & IFF_ALLMULTI) {
if (netif_msg_drv(dev)) netif_dbg(dev, drv, dev->net, "receive all multicast enabled\n");
netdev_dbg(dev->net, "receive all multicast enabled\n");
pdata->mac_cr |= MAC_CR_MCPAS_; pdata->mac_cr |= MAC_CR_MCPAS_;
pdata->mac_cr &= ~(MAC_CR_PRMS_ | MAC_CR_HPFILT_); pdata->mac_cr &= ~(MAC_CR_PRMS_ | MAC_CR_HPFILT_);
} else if (!netdev_mc_empty(dev->net)) { } else if (!netdev_mc_empty(dev->net)) {
...@@ -410,12 +408,10 @@ static void smsc95xx_set_multicast(struct net_device *netdev) ...@@ -410,12 +408,10 @@ static void smsc95xx_set_multicast(struct net_device *netdev)
if (count != ((u32) netdev_mc_count(dev->net))) if (count != ((u32) netdev_mc_count(dev->net)))
netdev_warn(dev->net, "mc_count != dev->mc_count\n"); netdev_warn(dev->net, "mc_count != dev->mc_count\n");
if (netif_msg_drv(dev)) netif_dbg(dev, drv, dev->net, "HASHH=0x%08X, HASHL=0x%08X\n",
netdev_dbg(dev->net, "HASHH=0x%08X, HASHL=0x%08X\n",
hash_hi, hash_lo); hash_hi, hash_lo);
} else { } else {
if (netif_msg_drv(dev)) netif_dbg(dev, drv, dev->net, "receive own packets only\n");
netdev_dbg(dev->net, "receive own packets only\n");
pdata->mac_cr &= pdata->mac_cr &=
~(MAC_CR_PRMS_ | MAC_CR_MCPAS_ | MAC_CR_HPFILT_); ~(MAC_CR_PRMS_ | MAC_CR_MCPAS_ | MAC_CR_HPFILT_);
} }
...@@ -452,13 +448,11 @@ static void smsc95xx_phy_update_flowcontrol(struct usbnet *dev, u8 duplex, ...@@ -452,13 +448,11 @@ static void smsc95xx_phy_update_flowcontrol(struct usbnet *dev, u8 duplex,
else else
afc_cfg &= ~0xF; afc_cfg &= ~0xF;
if (netif_msg_link(dev)) netif_dbg(dev, link, dev->net, "rx pause %s, tx pause %s\n",
netdev_dbg(dev->net, "rx pause %s, tx pause %s\n",
cap & FLOW_CTRL_RX ? "enabled" : "disabled", cap & FLOW_CTRL_RX ? "enabled" : "disabled",
cap & FLOW_CTRL_TX ? "enabled" : "disabled"); cap & FLOW_CTRL_TX ? "enabled" : "disabled");
} else { } else {
if (netif_msg_link(dev)) netif_dbg(dev, link, dev->net, "half duplex\n");
netdev_dbg(dev->net, "half duplex\n");
flow = 0; flow = 0;
afc_cfg |= 0xF; afc_cfg |= 0xF;
} }
...@@ -486,9 +480,8 @@ static int smsc95xx_link_reset(struct usbnet *dev) ...@@ -486,9 +480,8 @@ static int smsc95xx_link_reset(struct usbnet *dev)
lcladv = smsc95xx_mdio_read(dev->net, mii->phy_id, MII_ADVERTISE); lcladv = smsc95xx_mdio_read(dev->net, mii->phy_id, MII_ADVERTISE);
rmtadv = smsc95xx_mdio_read(dev->net, mii->phy_id, MII_LPA); rmtadv = smsc95xx_mdio_read(dev->net, mii->phy_id, MII_LPA);
if (netif_msg_link(dev)) netif_dbg(dev, link, dev->net, "speed: %d duplex: %d lcladv: %04x rmtadv: %04x\n",
netdev_dbg(dev->net, "speed: %d duplex: %d lcladv: %04x rmtadv: %04x\n", ecmd.speed, ecmd.duplex, lcladv, rmtadv);
ecmd.speed, ecmd.duplex, lcladv, rmtadv);
spin_lock_irqsave(&pdata->mac_cr_lock, flags); spin_lock_irqsave(&pdata->mac_cr_lock, flags);
if (ecmd.duplex != DUPLEX_FULL) { if (ecmd.duplex != DUPLEX_FULL) {
...@@ -520,8 +513,7 @@ static void smsc95xx_status(struct usbnet *dev, struct urb *urb) ...@@ -520,8 +513,7 @@ static void smsc95xx_status(struct usbnet *dev, struct urb *urb)
memcpy(&intdata, urb->transfer_buffer, 4); memcpy(&intdata, urb->transfer_buffer, 4);
le32_to_cpus(&intdata); le32_to_cpus(&intdata);
if (netif_msg_link(dev)) netif_dbg(dev, link, dev->net, "intdata: 0x%08X\n", intdata);
netdev_dbg(dev->net, "intdata: 0x%08X\n", intdata);
if (intdata & INT_ENP_PHY_INT_) if (intdata & INT_ENP_PHY_INT_)
usbnet_defer_kevent(dev, EVENT_LINK_RESET); usbnet_defer_kevent(dev, EVENT_LINK_RESET);
...@@ -557,8 +549,7 @@ static int smsc95xx_set_csums(struct usbnet *dev) ...@@ -557,8 +549,7 @@ static int smsc95xx_set_csums(struct usbnet *dev)
return ret; return ret;
} }
if (netif_msg_hw(dev)) netif_dbg(dev, hw, dev->net, "COE_CR = 0x%08x\n", read_buf);
netdev_dbg(dev->net, "COE_CR = 0x%08x\n", read_buf);
return 0; return 0;
} }
...@@ -662,16 +653,14 @@ static void smsc95xx_init_mac_address(struct usbnet *dev) ...@@ -662,16 +653,14 @@ static void smsc95xx_init_mac_address(struct usbnet *dev)
dev->net->dev_addr) == 0) { dev->net->dev_addr) == 0) {
if (is_valid_ether_addr(dev->net->dev_addr)) { if (is_valid_ether_addr(dev->net->dev_addr)) {
/* eeprom values are valid so use them */ /* eeprom values are valid so use them */
if (netif_msg_ifup(dev)) netif_dbg(dev, ifup, dev->net, "MAC address read from EEPROM\n");
netdev_dbg(dev->net, "MAC address read from EEPROM\n");
return; return;
} }
} }
/* no eeprom, or eeprom values are invalid. generate random MAC */ /* no eeprom, or eeprom values are invalid. generate random MAC */
random_ether_addr(dev->net->dev_addr); random_ether_addr(dev->net->dev_addr);
if (netif_msg_ifup(dev)) netif_dbg(dev, ifup, dev->net, "MAC address set to random_ether_addr\n");
netdev_dbg(dev->net, "MAC address set to random_ether_addr\n");
} }
static int smsc95xx_set_mac_address(struct usbnet *dev) static int smsc95xx_set_mac_address(struct usbnet *dev)
...@@ -750,8 +739,7 @@ static int smsc95xx_phy_initialize(struct usbnet *dev) ...@@ -750,8 +739,7 @@ static int smsc95xx_phy_initialize(struct usbnet *dev)
PHY_INT_MASK_DEFAULT_); PHY_INT_MASK_DEFAULT_);
mii_nway_restart(&dev->mii); mii_nway_restart(&dev->mii);
if (netif_msg_ifup(dev)) netif_dbg(dev, ifup, dev->net, "phy initialised successfully\n");
netdev_dbg(dev->net, "phy initialised successfully\n");
return 0; return 0;
} }
...@@ -762,8 +750,7 @@ static int smsc95xx_reset(struct usbnet *dev) ...@@ -762,8 +750,7 @@ static int smsc95xx_reset(struct usbnet *dev)
u32 read_buf, write_buf, burst_cap; u32 read_buf, write_buf, burst_cap;
int ret = 0, timeout; int ret = 0, timeout;
if (netif_msg_ifup(dev)) netif_dbg(dev, ifup, dev->net, "entering smsc95xx_reset\n");
netdev_dbg(dev->net, "entering smsc95xx_reset\n");
write_buf = HW_CFG_LRST_; write_buf = HW_CFG_LRST_;
ret = smsc95xx_write_reg(dev, HW_CFG, write_buf); ret = smsc95xx_write_reg(dev, HW_CFG, write_buf);
...@@ -818,8 +805,8 @@ static int smsc95xx_reset(struct usbnet *dev) ...@@ -818,8 +805,8 @@ static int smsc95xx_reset(struct usbnet *dev)
if (ret < 0) if (ret < 0)
return ret; return ret;
if (netif_msg_ifup(dev)) netif_dbg(dev, ifup, dev->net,
netdev_dbg(dev->net, "MAC Address: %pM\n", dev->net->dev_addr); "MAC Address: %pM\n", dev->net->dev_addr);
ret = smsc95xx_read_reg(dev, HW_CFG, &read_buf); ret = smsc95xx_read_reg(dev, HW_CFG, &read_buf);
if (ret < 0) { if (ret < 0) {
...@@ -827,8 +814,8 @@ static int smsc95xx_reset(struct usbnet *dev) ...@@ -827,8 +814,8 @@ static int smsc95xx_reset(struct usbnet *dev)
return ret; return ret;
} }
if (netif_msg_ifup(dev)) netif_dbg(dev, ifup, dev->net,
netdev_dbg(dev->net, "Read Value from HW_CFG : 0x%08x\n", read_buf); "Read Value from HW_CFG : 0x%08x\n", read_buf);
read_buf |= HW_CFG_BIR_; read_buf |= HW_CFG_BIR_;
...@@ -844,9 +831,9 @@ static int smsc95xx_reset(struct usbnet *dev) ...@@ -844,9 +831,9 @@ static int smsc95xx_reset(struct usbnet *dev)
netdev_warn(dev->net, "Failed to read HW_CFG: %d\n", ret); netdev_warn(dev->net, "Failed to read HW_CFG: %d\n", ret);
return ret; return ret;
} }
if (netif_msg_ifup(dev)) netif_dbg(dev, ifup, dev->net,
netdev_dbg(dev->net, "Read Value from HW_CFG after writing HW_CFG_BIR_: 0x%08x\n", "Read Value from HW_CFG after writing HW_CFG_BIR_: 0x%08x\n",
read_buf); read_buf);
if (!turbo_mode) { if (!turbo_mode) {
burst_cap = 0; burst_cap = 0;
...@@ -859,8 +846,8 @@ static int smsc95xx_reset(struct usbnet *dev) ...@@ -859,8 +846,8 @@ static int smsc95xx_reset(struct usbnet *dev)
dev->rx_urb_size = DEFAULT_FS_BURST_CAP_SIZE; dev->rx_urb_size = DEFAULT_FS_BURST_CAP_SIZE;
} }
if (netif_msg_ifup(dev)) netif_dbg(dev, ifup, dev->net,
netdev_dbg(dev->net, "rx_urb_size=%ld\n", (ulong)dev->rx_urb_size); "rx_urb_size=%ld\n", (ulong)dev->rx_urb_size);
ret = smsc95xx_write_reg(dev, BURST_CAP, burst_cap); ret = smsc95xx_write_reg(dev, BURST_CAP, burst_cap);
if (ret < 0) { if (ret < 0) {
...@@ -873,9 +860,9 @@ static int smsc95xx_reset(struct usbnet *dev) ...@@ -873,9 +860,9 @@ static int smsc95xx_reset(struct usbnet *dev)
netdev_warn(dev->net, "Failed to read BURST_CAP: %d\n", ret); netdev_warn(dev->net, "Failed to read BURST_CAP: %d\n", ret);
return ret; return ret;
} }
if (netif_msg_ifup(dev)) netif_dbg(dev, ifup, dev->net,
netdev_dbg(dev->net, "Read Value from BURST_CAP after writing: 0x%08x\n", "Read Value from BURST_CAP after writing: 0x%08x\n",
read_buf); read_buf);
read_buf = DEFAULT_BULK_IN_DELAY; read_buf = DEFAULT_BULK_IN_DELAY;
ret = smsc95xx_write_reg(dev, BULK_IN_DLY, read_buf); ret = smsc95xx_write_reg(dev, BULK_IN_DLY, read_buf);
...@@ -889,17 +876,17 @@ static int smsc95xx_reset(struct usbnet *dev) ...@@ -889,17 +876,17 @@ static int smsc95xx_reset(struct usbnet *dev)
netdev_warn(dev->net, "Failed to read BULK_IN_DLY: %d\n", ret); netdev_warn(dev->net, "Failed to read BULK_IN_DLY: %d\n", ret);
return ret; return ret;
} }
if (netif_msg_ifup(dev)) netif_dbg(dev, ifup, dev->net,
netdev_dbg(dev->net, "Read Value from BULK_IN_DLY after writing: 0x%08x\n", "Read Value from BULK_IN_DLY after writing: 0x%08x\n",
read_buf); read_buf);
ret = smsc95xx_read_reg(dev, HW_CFG, &read_buf); ret = smsc95xx_read_reg(dev, HW_CFG, &read_buf);
if (ret < 0) { if (ret < 0) {
netdev_warn(dev->net, "Failed to read HW_CFG: %d\n", ret); netdev_warn(dev->net, "Failed to read HW_CFG: %d\n", ret);
return ret; return ret;
} }
if (netif_msg_ifup(dev)) netif_dbg(dev, ifup, dev->net,
netdev_dbg(dev->net, "Read Value from HW_CFG: 0x%08x\n", read_buf); "Read Value from HW_CFG: 0x%08x\n", read_buf);
if (turbo_mode) if (turbo_mode)
read_buf |= (HW_CFG_MEF_ | HW_CFG_BCE_); read_buf |= (HW_CFG_MEF_ | HW_CFG_BCE_);
...@@ -921,9 +908,8 @@ static int smsc95xx_reset(struct usbnet *dev) ...@@ -921,9 +908,8 @@ static int smsc95xx_reset(struct usbnet *dev)
netdev_warn(dev->net, "Failed to read HW_CFG: %d\n", ret); netdev_warn(dev->net, "Failed to read HW_CFG: %d\n", ret);
return ret; return ret;
} }
if (netif_msg_ifup(dev)) netif_dbg(dev, ifup, dev->net,
netdev_dbg(dev->net, "Read Value from HW_CFG after writing: 0x%08x\n", "Read Value from HW_CFG after writing: 0x%08x\n", read_buf);
read_buf);
write_buf = 0xFFFFFFFF; write_buf = 0xFFFFFFFF;
ret = smsc95xx_write_reg(dev, INT_STS, write_buf); ret = smsc95xx_write_reg(dev, INT_STS, write_buf);
...@@ -938,8 +924,7 @@ static int smsc95xx_reset(struct usbnet *dev) ...@@ -938,8 +924,7 @@ static int smsc95xx_reset(struct usbnet *dev)
netdev_warn(dev->net, "Failed to read ID_REV: %d\n", ret); netdev_warn(dev->net, "Failed to read ID_REV: %d\n", ret);
return ret; return ret;
} }
if (netif_msg_ifup(dev)) netif_dbg(dev, ifup, dev->net, "ID_REV = 0x%08x\n", read_buf);
netdev_dbg(dev->net, "ID_REV = 0x%08x\n", read_buf);
/* Configure GPIO pins as LED outputs */ /* Configure GPIO pins as LED outputs */
write_buf = LED_GPIO_CFG_SPD_LED | LED_GPIO_CFG_LNK_LED | write_buf = LED_GPIO_CFG_SPD_LED | LED_GPIO_CFG_LNK_LED |
...@@ -1013,8 +998,7 @@ static int smsc95xx_reset(struct usbnet *dev) ...@@ -1013,8 +998,7 @@ static int smsc95xx_reset(struct usbnet *dev)
smsc95xx_start_tx_path(dev); smsc95xx_start_tx_path(dev);
smsc95xx_start_rx_path(dev); smsc95xx_start_rx_path(dev);
if (netif_msg_ifup(dev)) netif_dbg(dev, ifup, dev->net, "smsc95xx_reset, return 0\n");
netdev_dbg(dev->net, "smsc95xx_reset, return 0\n");
return 0; return 0;
} }
...@@ -1071,8 +1055,7 @@ static void smsc95xx_unbind(struct usbnet *dev, struct usb_interface *intf) ...@@ -1071,8 +1055,7 @@ static void smsc95xx_unbind(struct usbnet *dev, struct usb_interface *intf)
{ {
struct smsc95xx_priv *pdata = (struct smsc95xx_priv *)(dev->data[0]); struct smsc95xx_priv *pdata = (struct smsc95xx_priv *)(dev->data[0]);
if (pdata) { if (pdata) {
if (netif_msg_ifdown(dev)) netif_dbg(dev, ifdown, dev->net, "free pdata\n");
netdev_dbg(dev->net, "free pdata\n");
kfree(pdata); kfree(pdata);
pdata = NULL; pdata = NULL;
dev->data[0] = 0; dev->data[0] = 0;
...@@ -1106,9 +1089,8 @@ static int smsc95xx_rx_fixup(struct usbnet *dev, struct sk_buff *skb) ...@@ -1106,9 +1089,8 @@ static int smsc95xx_rx_fixup(struct usbnet *dev, struct sk_buff *skb)
align_count = (4 - ((size + NET_IP_ALIGN) % 4)) % 4; align_count = (4 - ((size + NET_IP_ALIGN) % 4)) % 4;
if (unlikely(header & RX_STS_ES_)) { if (unlikely(header & RX_STS_ES_)) {
if (netif_msg_rx_err(dev)) netif_dbg(dev, rx_err, dev->net,
netdev_dbg(dev->net, "Error header=0x%08x\n", "Error header=0x%08x\n", header);
header);
dev->net->stats.rx_errors++; dev->net->stats.rx_errors++;
dev->net->stats.rx_dropped++; dev->net->stats.rx_dropped++;
...@@ -1125,9 +1107,8 @@ static int smsc95xx_rx_fixup(struct usbnet *dev, struct sk_buff *skb) ...@@ -1125,9 +1107,8 @@ static int smsc95xx_rx_fixup(struct usbnet *dev, struct sk_buff *skb)
} else { } else {
/* ETH_FRAME_LEN + 4(CRC) + 2(COE) + 4(Vlan) */ /* ETH_FRAME_LEN + 4(CRC) + 2(COE) + 4(Vlan) */
if (unlikely(size > (ETH_FRAME_LEN + 12))) { if (unlikely(size > (ETH_FRAME_LEN + 12))) {
if (netif_msg_rx_err(dev)) netif_dbg(dev, rx_err, dev->net,
netdev_dbg(dev->net, "size err header=0x%08x\n", "size err header=0x%08x\n", header);
header);
return 0; return 0;
} }
......
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment