Commit 18ab458f authored by David Brownell's avatar David Brownell Committed by Jeff Garzik

usbnet whitespace fixes

Whitespace updates for usbnet core, mostly switching to tab-only indents.
Signed-off-by: default avatarDavid Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: default avatarJeff Garzik <jeff@garzik.org>
parent 2501f843
...@@ -192,7 +192,7 @@ static int init_status (struct usbnet *dev, struct usb_interface *intf) ...@@ -192,7 +192,7 @@ static int init_status (struct usbnet *dev, struct usb_interface *intf)
usb_pipeendpoint(pipe), maxp, period); usb_pipeendpoint(pipe), maxp, period);
} }
} }
return 0; return 0;
} }
/* Passes this packet up the stack, updating its accounting. /* Passes this packet up the stack, updating its accounting.
...@@ -326,7 +326,7 @@ static void rx_submit (struct usbnet *dev, struct urb *urb, gfp_t flags) ...@@ -326,7 +326,7 @@ static void rx_submit (struct usbnet *dev, struct urb *urb, gfp_t flags)
if (netif_running (dev->net) if (netif_running (dev->net)
&& netif_device_present (dev->net) && netif_device_present (dev->net)
&& !test_bit (EVENT_RX_HALT, &dev->flags)) { && !test_bit (EVENT_RX_HALT, &dev->flags)) {
switch (retval = usb_submit_urb (urb, GFP_ATOMIC)){ switch (retval = usb_submit_urb (urb, GFP_ATOMIC)) {
case -EPIPE: case -EPIPE:
usbnet_defer_kevent (dev, EVENT_RX_HALT); usbnet_defer_kevent (dev, EVENT_RX_HALT);
break; break;
...@@ -393,8 +393,8 @@ static void rx_complete (struct urb *urb) ...@@ -393,8 +393,8 @@ static void rx_complete (struct urb *urb)
entry->urb = NULL; entry->urb = NULL;
switch (urb_status) { switch (urb_status) {
// success /* success */
case 0: case 0:
if (skb->len < dev->net->hard_header_len) { if (skb->len < dev->net->hard_header_len) {
entry->state = rx_cleanup; entry->state = rx_cleanup;
dev->stats.rx_errors++; dev->stats.rx_errors++;
...@@ -404,28 +404,30 @@ static void rx_complete (struct urb *urb) ...@@ -404,28 +404,30 @@ static void rx_complete (struct urb *urb)
} }
break; break;
// stalls need manual reset. this is rare ... except that /* stalls need manual reset. this is rare ... except that
// when going through USB 2.0 TTs, unplug appears this way. * when going through USB 2.0 TTs, unplug appears this way.
// we avoid the highspeed version of the ETIMEOUT/EILSEQ * we avoid the highspeed version of the ETIMEOUT/EILSEQ
// storm, recovering as needed. * storm, recovering as needed.
case -EPIPE: */
case -EPIPE:
dev->stats.rx_errors++; dev->stats.rx_errors++;
usbnet_defer_kevent (dev, EVENT_RX_HALT); usbnet_defer_kevent (dev, EVENT_RX_HALT);
// FALLTHROUGH // FALLTHROUGH
// software-driven interface shutdown /* software-driven interface shutdown */
case -ECONNRESET: // async unlink case -ECONNRESET: /* async unlink */
case -ESHUTDOWN: // hardware gone case -ESHUTDOWN: /* hardware gone */
if (netif_msg_ifdown (dev)) if (netif_msg_ifdown (dev))
devdbg (dev, "rx shutdown, code %d", urb_status); devdbg (dev, "rx shutdown, code %d", urb_status);
goto block; goto block;
// we get controller i/o faults during khubd disconnect() delays. /* we get controller i/o faults during khubd disconnect() delays.
// throttle down resubmits, to avoid log floods; just temporarily, * throttle down resubmits, to avoid log floods; just temporarily,
// so we still recover when the fault isn't a khubd delay. * so we still recover when the fault isn't a khubd delay.
case -EPROTO: */
case -ETIME: case -EPROTO:
case -EILSEQ: case -ETIME:
case -EILSEQ:
dev->stats.rx_errors++; dev->stats.rx_errors++;
if (!timer_pending (&dev->delay)) { if (!timer_pending (&dev->delay)) {
mod_timer (&dev->delay, jiffies + THROTTLE_JIFFIES); mod_timer (&dev->delay, jiffies + THROTTLE_JIFFIES);
...@@ -438,12 +440,12 @@ static void rx_complete (struct urb *urb) ...@@ -438,12 +440,12 @@ static void rx_complete (struct urb *urb)
urb = NULL; urb = NULL;
break; break;
// data overrun ... flush fifo? /* data overrun ... flush fifo? */
case -EOVERFLOW: case -EOVERFLOW:
dev->stats.rx_over_errors++; dev->stats.rx_over_errors++;
// FALLTHROUGH // FALLTHROUGH
default: default:
entry->state = rx_cleanup; entry->state = rx_cleanup;
dev->stats.rx_errors++; dev->stats.rx_errors++;
if (netif_msg_rx_err (dev)) if (netif_msg_rx_err (dev))
...@@ -471,22 +473,22 @@ static void intr_complete (struct urb *urb) ...@@ -471,22 +473,22 @@ static void intr_complete (struct urb *urb)
int status = urb->status; int status = urb->status;
switch (status) { switch (status) {
/* success */ /* success */
case 0: case 0:
dev->driver_info->status(dev, urb); dev->driver_info->status(dev, urb);
break; break;
/* software-driven interface shutdown */ /* software-driven interface shutdown */
case -ENOENT: // urb killed case -ENOENT: /* urb killed */
case -ESHUTDOWN: // hardware gone case -ESHUTDOWN: /* hardware gone */
if (netif_msg_ifdown (dev)) if (netif_msg_ifdown (dev))
devdbg (dev, "intr shutdown, code %d", status); devdbg (dev, "intr shutdown, code %d", status);
return; return;
/* NOTE: not throttling like RX/TX, since this endpoint /* NOTE: not throttling like RX/TX, since this endpoint
* already polls infrequently * already polls infrequently
*/ */
default: default:
devdbg (dev, "intr status %d", status); devdbg (dev, "intr status %d", status);
break; break;
} }
...@@ -569,9 +571,9 @@ static int usbnet_stop (struct net_device *net) ...@@ -569,9 +571,9 @@ static int usbnet_stop (struct net_device *net)
temp = unlink_urbs (dev, &dev->txq) + unlink_urbs (dev, &dev->rxq); temp = unlink_urbs (dev, &dev->txq) + unlink_urbs (dev, &dev->rxq);
// maybe wait for deletions to finish. // maybe wait for deletions to finish.
while (!skb_queue_empty(&dev->rxq) && while (!skb_queue_empty(&dev->rxq)
!skb_queue_empty(&dev->txq) && && !skb_queue_empty(&dev->txq)
!skb_queue_empty(&dev->done)) { && !skb_queue_empty(&dev->done)) {
msleep(UNLINK_TIMEOUT_MS); msleep(UNLINK_TIMEOUT_MS);
if (netif_msg_ifdown (dev)) if (netif_msg_ifdown (dev))
devdbg (dev, "waited for %d urb completions", temp); devdbg (dev, "waited for %d urb completions", temp);
...@@ -1011,16 +1013,16 @@ static void usbnet_bh (unsigned long param) ...@@ -1011,16 +1013,16 @@ static void usbnet_bh (unsigned long param)
while ((skb = skb_dequeue (&dev->done))) { while ((skb = skb_dequeue (&dev->done))) {
entry = (struct skb_data *) skb->cb; entry = (struct skb_data *) skb->cb;
switch (entry->state) { switch (entry->state) {
case rx_done: case rx_done:
entry->state = rx_cleanup; entry->state = rx_cleanup;
rx_process (dev, skb); rx_process (dev, skb);
continue; continue;
case tx_done: case tx_done:
case rx_cleanup: case rx_cleanup:
usb_free_urb (entry->urb); usb_free_urb (entry->urb);
dev_kfree_skb (skb); dev_kfree_skb (skb);
continue; continue;
default: default:
devdbg (dev, "bogus skb state %d", entry->state); devdbg (dev, "bogus skb state %d", entry->state);
} }
} }
......
...@@ -47,7 +47,7 @@ struct usbnet { ...@@ -47,7 +47,7 @@ struct usbnet {
unsigned long data [5]; unsigned long data [5];
u32 xid; u32 xid;
u32 hard_mtu; /* count any extra framing */ u32 hard_mtu; /* count any extra framing */
size_t rx_urb_size; /* size for rx urbs */ size_t rx_urb_size; /* size for rx urbs */
struct mii_if_info mii; struct mii_if_info mii;
/* various kinds of pending driver work */ /* various kinds of pending driver work */
...@@ -85,7 +85,7 @@ struct driver_info { ...@@ -85,7 +85,7 @@ struct driver_info {
#define FLAG_NO_SETINT 0x0010 /* device can't set_interface() */ #define FLAG_NO_SETINT 0x0010 /* device can't set_interface() */
#define FLAG_ETHER 0x0020 /* maybe use "eth%d" names */ #define FLAG_ETHER 0x0020 /* maybe use "eth%d" names */
#define FLAG_FRAMING_AX 0x0040 /* AX88772/178 packets */ #define FLAG_FRAMING_AX 0x0040 /* AX88772/178 packets */
/* init device ... can sleep, or cause probe() failure */ /* init device ... can sleep, or cause probe() failure */
int (*bind)(struct usbnet *, struct usb_interface *); int (*bind)(struct usbnet *, struct usb_interface *);
...@@ -146,9 +146,9 @@ extern void usbnet_cdc_unbind (struct usbnet *, struct usb_interface *); ...@@ -146,9 +146,9 @@ extern void usbnet_cdc_unbind (struct usbnet *, struct usb_interface *);
/* CDC and RNDIS support the same host-chosen packet filters for IN transfers */ /* CDC and RNDIS support the same host-chosen packet filters for IN transfers */
#define DEFAULT_FILTER (USB_CDC_PACKET_TYPE_BROADCAST \ #define DEFAULT_FILTER (USB_CDC_PACKET_TYPE_BROADCAST \
|USB_CDC_PACKET_TYPE_ALL_MULTICAST \ |USB_CDC_PACKET_TYPE_ALL_MULTICAST \
|USB_CDC_PACKET_TYPE_PROMISCUOUS \ |USB_CDC_PACKET_TYPE_PROMISCUOUS \
|USB_CDC_PACKET_TYPE_DIRECTED) |USB_CDC_PACKET_TYPE_DIRECTED)
/* we record the state for each of our queued skbs */ /* we record the state for each of our queued skbs */
......
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