diff options
Diffstat (limited to 'drivers/net/usb')
-rw-r--r-- | drivers/net/usb/asix.c | 12 | ||||
-rw-r--r-- | drivers/net/usb/catc.c | 4 | ||||
-rw-r--r-- | drivers/net/usb/cdc-phonet.c | 8 | ||||
-rw-r--r-- | drivers/net/usb/cdc_eem.c | 4 | ||||
-rw-r--r-- | drivers/net/usb/cdc_ether.c | 32 | ||||
-rw-r--r-- | drivers/net/usb/hso.c | 34 | ||||
-rw-r--r-- | drivers/net/usb/mcs7830.c | 4 | ||||
-rw-r--r-- | drivers/net/usb/rndis_host.c | 10 | ||||
-rw-r--r-- | drivers/net/usb/usbnet.c | 48 | ||||
-rw-r--r-- | drivers/net/usb/zaurus.c | 4 |
10 files changed, 80 insertions, 80 deletions
diff --git a/drivers/net/usb/asix.c b/drivers/net/usb/asix.c index 1bef39a60a62..a516185cbc9f 100644 --- a/drivers/net/usb/asix.c +++ b/drivers/net/usb/asix.c | |||
@@ -365,8 +365,8 @@ static struct sk_buff *asix_tx_fixup(struct usbnet *dev, struct sk_buff *skb, | |||
365 | 365 | ||
366 | padlen = ((skb->len + 4) % 512) ? 0 : 4; | 366 | padlen = ((skb->len + 4) % 512) ? 0 : 4; |
367 | 367 | ||
368 | if ((!skb_cloned(skb)) | 368 | if ((!skb_cloned(skb)) && |
369 | && ((headroom + tailroom) >= (4 + padlen))) { | 369 | ((headroom + tailroom) >= (4 + padlen))) { |
370 | if ((headroom < 4) || (tailroom < padlen)) { | 370 | if ((headroom < 4) || (tailroom < padlen)) { |
371 | skb->data = memmove(skb->head + 4, skb->data, skb->len); | 371 | skb->data = memmove(skb->head + 4, skb->data, skb->len); |
372 | skb_set_tail_pointer(skb, skb->len); | 372 | skb_set_tail_pointer(skb, skb->len); |
@@ -541,8 +541,8 @@ static void asix_set_multicast(struct net_device *net) | |||
541 | 541 | ||
542 | if (net->flags & IFF_PROMISC) { | 542 | if (net->flags & IFF_PROMISC) { |
543 | rx_ctl |= AX_RX_CTL_PRO; | 543 | rx_ctl |= AX_RX_CTL_PRO; |
544 | } else if (net->flags & IFF_ALLMULTI | 544 | } else if (net->flags & IFF_ALLMULTI || |
545 | || net->mc_count > AX_MAX_MCAST) { | 545 | net->mc_count > AX_MAX_MCAST) { |
546 | rx_ctl |= AX_RX_CTL_AMALL; | 546 | rx_ctl |= AX_RX_CTL_AMALL; |
547 | } else if (net->mc_count == 0) { | 547 | } else if (net->mc_count == 0) { |
548 | /* just broadcast and directed */ | 548 | /* just broadcast and directed */ |
@@ -753,8 +753,8 @@ static void ax88172_set_multicast(struct net_device *net) | |||
753 | 753 | ||
754 | if (net->flags & IFF_PROMISC) { | 754 | if (net->flags & IFF_PROMISC) { |
755 | rx_ctl |= 0x01; | 755 | rx_ctl |= 0x01; |
756 | } else if (net->flags & IFF_ALLMULTI | 756 | } else if (net->flags & IFF_ALLMULTI || |
757 | || net->mc_count > AX_MAX_MCAST) { | 757 | net->mc_count > AX_MAX_MCAST) { |
758 | rx_ctl |= 0x02; | 758 | rx_ctl |= 0x02; |
759 | } else if (net->mc_count == 0) { | 759 | } else if (net->mc_count == 0) { |
760 | /* just broadcast and directed */ | 760 | /* just broadcast and directed */ |
diff --git a/drivers/net/usb/catc.c b/drivers/net/usb/catc.c index 2bed6b087d16..22b87e64a810 100644 --- a/drivers/net/usb/catc.c +++ b/drivers/net/usb/catc.c | |||
@@ -436,8 +436,8 @@ static netdev_tx_t catc_start_xmit(struct sk_buff *skb, | |||
436 | clear_bit(TX_RUNNING, &catc->flags); | 436 | clear_bit(TX_RUNNING, &catc->flags); |
437 | } | 437 | } |
438 | 438 | ||
439 | if ((catc->is_f5u011 && catc->tx_ptr) | 439 | if ((catc->is_f5u011 && catc->tx_ptr) || |
440 | || (catc->tx_ptr >= ((TX_MAX_BURST - 1) * (PKT_SZ + 2)))) | 440 | (catc->tx_ptr >= ((TX_MAX_BURST - 1) * (PKT_SZ + 2)))) |
441 | netif_stop_queue(netdev); | 441 | netif_stop_queue(netdev); |
442 | 442 | ||
443 | spin_unlock_irqrestore(&catc->tx_lock, flags); | 443 | spin_unlock_irqrestore(&catc->tx_lock, flags); |
diff --git a/drivers/net/usb/cdc-phonet.c b/drivers/net/usb/cdc-phonet.c index 33d5c579c5ad..6491c9c00c83 100644 --- a/drivers/net/usb/cdc-phonet.c +++ b/drivers/net/usb/cdc-phonet.c | |||
@@ -372,12 +372,12 @@ int usbpn_probe(struct usb_interface *intf, const struct usb_device_id *id) | |||
372 | /* Data interface has one inactive and one active setting */ | 372 | /* Data interface has one inactive and one active setting */ |
373 | if (data_intf->num_altsetting != 2) | 373 | if (data_intf->num_altsetting != 2) |
374 | return -EINVAL; | 374 | return -EINVAL; |
375 | if (data_intf->altsetting[0].desc.bNumEndpoints == 0 | 375 | if (data_intf->altsetting[0].desc.bNumEndpoints == 0 && |
376 | && data_intf->altsetting[1].desc.bNumEndpoints == 2) | 376 | data_intf->altsetting[1].desc.bNumEndpoints == 2) |
377 | data_desc = data_intf->altsetting + 1; | 377 | data_desc = data_intf->altsetting + 1; |
378 | else | 378 | else |
379 | if (data_intf->altsetting[0].desc.bNumEndpoints == 2 | 379 | if (data_intf->altsetting[0].desc.bNumEndpoints == 2 && |
380 | && data_intf->altsetting[1].desc.bNumEndpoints == 0) | 380 | data_intf->altsetting[1].desc.bNumEndpoints == 0) |
381 | data_desc = data_intf->altsetting; | 381 | data_desc = data_intf->altsetting; |
382 | else | 382 | else |
383 | return -EINVAL; | 383 | return -EINVAL; |
diff --git a/drivers/net/usb/cdc_eem.c b/drivers/net/usb/cdc_eem.c index 23300656c266..c337ffc3304a 100644 --- a/drivers/net/usb/cdc_eem.c +++ b/drivers/net/usb/cdc_eem.c | |||
@@ -121,8 +121,8 @@ static struct sk_buff *eem_tx_fixup(struct usbnet *dev, struct sk_buff *skb, | |||
121 | int headroom = skb_headroom(skb); | 121 | int headroom = skb_headroom(skb); |
122 | int tailroom = skb_tailroom(skb); | 122 | int tailroom = skb_tailroom(skb); |
123 | 123 | ||
124 | if ((tailroom >= ETH_FCS_LEN + padlen) | 124 | if ((tailroom >= ETH_FCS_LEN + padlen) && |
125 | && (headroom >= EEM_HEAD)) | 125 | (headroom >= EEM_HEAD)) |
126 | goto done; | 126 | goto done; |
127 | 127 | ||
128 | if ((headroom + tailroom) | 128 | if ((headroom + tailroom) |
diff --git a/drivers/net/usb/cdc_ether.c b/drivers/net/usb/cdc_ether.c index 7ec24c9b2535..de3e36596779 100644 --- a/drivers/net/usb/cdc_ether.c +++ b/drivers/net/usb/cdc_ether.c | |||
@@ -37,23 +37,23 @@ | |||
37 | 37 | ||
38 | static int is_rndis(struct usb_interface_descriptor *desc) | 38 | static int is_rndis(struct usb_interface_descriptor *desc) |
39 | { | 39 | { |
40 | return desc->bInterfaceClass == USB_CLASS_COMM | 40 | return (desc->bInterfaceClass == USB_CLASS_COMM && |
41 | && desc->bInterfaceSubClass == 2 | 41 | desc->bInterfaceSubClass == 2 && |
42 | && desc->bInterfaceProtocol == 0xff; | 42 | desc->bInterfaceProtocol == 0xff); |
43 | } | 43 | } |
44 | 44 | ||
45 | static int is_activesync(struct usb_interface_descriptor *desc) | 45 | static int is_activesync(struct usb_interface_descriptor *desc) |
46 | { | 46 | { |
47 | return desc->bInterfaceClass == USB_CLASS_MISC | 47 | return (desc->bInterfaceClass == USB_CLASS_MISC && |
48 | && desc->bInterfaceSubClass == 1 | 48 | desc->bInterfaceSubClass == 1 && |
49 | && desc->bInterfaceProtocol == 1; | 49 | desc->bInterfaceProtocol == 1); |
50 | } | 50 | } |
51 | 51 | ||
52 | static int is_wireless_rndis(struct usb_interface_descriptor *desc) | 52 | static int is_wireless_rndis(struct usb_interface_descriptor *desc) |
53 | { | 53 | { |
54 | return desc->bInterfaceClass == USB_CLASS_WIRELESS_CONTROLLER | 54 | return (desc->bInterfaceClass == USB_CLASS_WIRELESS_CONTROLLER && |
55 | && desc->bInterfaceSubClass == 1 | 55 | desc->bInterfaceSubClass == 1 && |
56 | && desc->bInterfaceProtocol == 3; | 56 | desc->bInterfaceProtocol == 3); |
57 | } | 57 | } |
58 | 58 | ||
59 | #else | 59 | #else |
@@ -116,9 +116,9 @@ int usbnet_generic_cdc_bind(struct usbnet *dev, struct usb_interface *intf) | |||
116 | /* this assumes that if there's a non-RNDIS vendor variant | 116 | /* this assumes that if there's a non-RNDIS vendor variant |
117 | * of cdc-acm, it'll fail RNDIS requests cleanly. | 117 | * of cdc-acm, it'll fail RNDIS requests cleanly. |
118 | */ | 118 | */ |
119 | rndis = is_rndis(&intf->cur_altsetting->desc) | 119 | rndis = (is_rndis(&intf->cur_altsetting->desc) || |
120 | || is_activesync(&intf->cur_altsetting->desc) | 120 | is_activesync(&intf->cur_altsetting->desc) || |
121 | || is_wireless_rndis(&intf->cur_altsetting->desc); | 121 | is_wireless_rndis(&intf->cur_altsetting->desc)); |
122 | 122 | ||
123 | memset(info, 0, sizeof *info); | 123 | memset(info, 0, sizeof *info); |
124 | info->control = intf; | 124 | info->control = intf; |
@@ -279,10 +279,10 @@ next_desc: | |||
279 | 279 | ||
280 | dev->status = &info->control->cur_altsetting->endpoint [0]; | 280 | dev->status = &info->control->cur_altsetting->endpoint [0]; |
281 | desc = &dev->status->desc; | 281 | desc = &dev->status->desc; |
282 | if (!usb_endpoint_is_int_in(desc) | 282 | if (!usb_endpoint_is_int_in(desc) || |
283 | || (le16_to_cpu(desc->wMaxPacketSize) | 283 | (le16_to_cpu(desc->wMaxPacketSize) |
284 | < sizeof(struct usb_cdc_notification)) | 284 | < sizeof(struct usb_cdc_notification)) || |
285 | || !desc->bInterval) { | 285 | !desc->bInterval) { |
286 | dev_dbg(&intf->dev, "bad notification endpoint\n"); | 286 | dev_dbg(&intf->dev, "bad notification endpoint\n"); |
287 | dev->status = NULL; | 287 | dev->status = NULL; |
288 | } | 288 | } |
diff --git a/drivers/net/usb/hso.c b/drivers/net/usb/hso.c index 43bc3fcc0d85..f78f0903b073 100644 --- a/drivers/net/usb/hso.c +++ b/drivers/net/usb/hso.c | |||
@@ -602,9 +602,9 @@ static struct hso_serial *get_serial_by_shared_int_and_type( | |||
602 | port = hso_mux_to_port(mux); | 602 | port = hso_mux_to_port(mux); |
603 | 603 | ||
604 | for (i = 0; i < HSO_SERIAL_TTY_MINORS; i++) { | 604 | for (i = 0; i < HSO_SERIAL_TTY_MINORS; i++) { |
605 | if (serial_table[i] | 605 | if (serial_table[i] && |
606 | && (dev2ser(serial_table[i])->shared_int == shared_int) | 606 | (dev2ser(serial_table[i])->shared_int == shared_int) && |
607 | && ((serial_table[i]->port_spec & HSO_PORT_MASK) == port)) { | 607 | ((serial_table[i]->port_spec & HSO_PORT_MASK) == port)) { |
608 | return dev2ser(serial_table[i]); | 608 | return dev2ser(serial_table[i]); |
609 | } | 609 | } |
610 | } | 610 | } |
@@ -846,8 +846,8 @@ static void hso_net_tx_timeout(struct net_device *net) | |||
846 | dev_warn(&net->dev, "Tx timed out.\n"); | 846 | dev_warn(&net->dev, "Tx timed out.\n"); |
847 | 847 | ||
848 | /* Tear the waiting frame off the list */ | 848 | /* Tear the waiting frame off the list */ |
849 | if (odev->mux_bulk_tx_urb | 849 | if (odev->mux_bulk_tx_urb && |
850 | && (odev->mux_bulk_tx_urb->status == -EINPROGRESS)) | 850 | (odev->mux_bulk_tx_urb->status == -EINPROGRESS)) |
851 | usb_unlink_urb(odev->mux_bulk_tx_urb); | 851 | usb_unlink_urb(odev->mux_bulk_tx_urb); |
852 | 852 | ||
853 | /* Update statistics */ | 853 | /* Update statistics */ |
@@ -1020,9 +1020,9 @@ static void read_bulk_callback(struct urb *urb) | |||
1020 | u32 rest; | 1020 | u32 rest; |
1021 | u8 crc_check[4] = { 0xDE, 0xAD, 0xBE, 0xEF }; | 1021 | u8 crc_check[4] = { 0xDE, 0xAD, 0xBE, 0xEF }; |
1022 | rest = urb->actual_length % odev->in_endp->wMaxPacketSize; | 1022 | rest = urb->actual_length % odev->in_endp->wMaxPacketSize; |
1023 | if (((rest == 5) || (rest == 6)) | 1023 | if (((rest == 5) || (rest == 6)) && |
1024 | && !memcmp(((u8 *) urb->transfer_buffer) + | 1024 | !memcmp(((u8 *) urb->transfer_buffer) + |
1025 | urb->actual_length - 4, crc_check, 4)) { | 1025 | urb->actual_length - 4, crc_check, 4)) { |
1026 | urb->actual_length -= 4; | 1026 | urb->actual_length -= 4; |
1027 | } | 1027 | } |
1028 | } | 1028 | } |
@@ -1226,9 +1226,9 @@ static void hso_std_serial_read_bulk_callback(struct urb *urb) | |||
1226 | rest = | 1226 | rest = |
1227 | urb->actual_length % | 1227 | urb->actual_length % |
1228 | serial->in_endp->wMaxPacketSize; | 1228 | serial->in_endp->wMaxPacketSize; |
1229 | if (((rest == 5) || (rest == 6)) | 1229 | if (((rest == 5) || (rest == 6)) && |
1230 | && !memcmp(((u8 *) urb->transfer_buffer) + | 1230 | !memcmp(((u8 *) urb->transfer_buffer) + |
1231 | urb->actual_length - 4, crc_check, 4)) { | 1231 | urb->actual_length - 4, crc_check, 4)) { |
1232 | urb->actual_length -= 4; | 1232 | urb->actual_length -= 4; |
1233 | } | 1233 | } |
1234 | } | 1234 | } |
@@ -2982,8 +2982,8 @@ static int hso_probe(struct usb_interface *interface, | |||
2982 | 2982 | ||
2983 | case HSO_INTF_BULK: | 2983 | case HSO_INTF_BULK: |
2984 | /* It's a regular bulk interface */ | 2984 | /* It's a regular bulk interface */ |
2985 | if (((port_spec & HSO_PORT_MASK) == HSO_PORT_NETWORK) | 2985 | if (((port_spec & HSO_PORT_MASK) == HSO_PORT_NETWORK) && |
2986 | && !disable_net) | 2986 | !disable_net) |
2987 | hso_dev = hso_create_net_device(interface, port_spec); | 2987 | hso_dev = hso_create_net_device(interface, port_spec); |
2988 | else | 2988 | else |
2989 | hso_dev = | 2989 | hso_dev = |
@@ -3146,8 +3146,8 @@ static void hso_free_interface(struct usb_interface *interface) | |||
3146 | int i; | 3146 | int i; |
3147 | 3147 | ||
3148 | for (i = 0; i < HSO_SERIAL_TTY_MINORS; i++) { | 3148 | for (i = 0; i < HSO_SERIAL_TTY_MINORS; i++) { |
3149 | if (serial_table[i] | 3149 | if (serial_table[i] && |
3150 | && (serial_table[i]->interface == interface)) { | 3150 | (serial_table[i]->interface == interface)) { |
3151 | hso_dev = dev2ser(serial_table[i]); | 3151 | hso_dev = dev2ser(serial_table[i]); |
3152 | spin_lock_irq(&hso_dev->serial_lock); | 3152 | spin_lock_irq(&hso_dev->serial_lock); |
3153 | tty = tty_kref_get(hso_dev->tty); | 3153 | tty = tty_kref_get(hso_dev->tty); |
@@ -3163,8 +3163,8 @@ static void hso_free_interface(struct usb_interface *interface) | |||
3163 | } | 3163 | } |
3164 | 3164 | ||
3165 | for (i = 0; i < HSO_MAX_NET_DEVICES; i++) { | 3165 | for (i = 0; i < HSO_MAX_NET_DEVICES; i++) { |
3166 | if (network_table[i] | 3166 | if (network_table[i] && |
3167 | && (network_table[i]->interface == interface)) { | 3167 | (network_table[i]->interface == interface)) { |
3168 | struct rfkill *rfk = dev2net(network_table[i])->rfkill; | 3168 | struct rfkill *rfk = dev2net(network_table[i])->rfkill; |
3169 | /* hso_stop_net_device doesn't stop the net queue since | 3169 | /* hso_stop_net_device doesn't stop the net queue since |
3170 | * traffic needs to start it again when suspended */ | 3170 | * traffic needs to start it again when suspended */ |
diff --git a/drivers/net/usb/mcs7830.c b/drivers/net/usb/mcs7830.c index 10873d96b2da..87374317f480 100644 --- a/drivers/net/usb/mcs7830.c +++ b/drivers/net/usb/mcs7830.c | |||
@@ -391,8 +391,8 @@ static void mcs7830_set_multicast(struct net_device *net) | |||
391 | 391 | ||
392 | if (net->flags & IFF_PROMISC) { | 392 | if (net->flags & IFF_PROMISC) { |
393 | data->config |= HIF_REG_CONFIG_PROMISCIOUS; | 393 | data->config |= HIF_REG_CONFIG_PROMISCIOUS; |
394 | } else if (net->flags & IFF_ALLMULTI | 394 | } else if (net->flags & IFF_ALLMULTI || |
395 | || net->mc_count > MCS7830_MAX_MCAST) { | 395 | net->mc_count > MCS7830_MAX_MCAST) { |
396 | data->config |= HIF_REG_CONFIG_ALLMULTICAST; | 396 | data->config |= HIF_REG_CONFIG_ALLMULTICAST; |
397 | } else if (net->mc_count == 0) { | 397 | } else if (net->mc_count == 0) { |
398 | /* just broadcast and directed */ | 398 | /* just broadcast and directed */ |
diff --git a/drivers/net/usb/rndis_host.c b/drivers/net/usb/rndis_host.c index f56dec6119c3..490fa8f55424 100644 --- a/drivers/net/usb/rndis_host.c +++ b/drivers/net/usb/rndis_host.c | |||
@@ -114,8 +114,8 @@ int rndis_command(struct usbnet *dev, struct rndis_msg_hdr *buf, int buflen) | |||
114 | */ | 114 | */ |
115 | 115 | ||
116 | /* Issue the request; xid is unique, don't bother byteswapping it */ | 116 | /* Issue the request; xid is unique, don't bother byteswapping it */ |
117 | if (likely(buf->msg_type != RNDIS_MSG_HALT | 117 | if (likely(buf->msg_type != RNDIS_MSG_HALT && |
118 | && buf->msg_type != RNDIS_MSG_RESET)) { | 118 | buf->msg_type != RNDIS_MSG_RESET)) { |
119 | xid = dev->xid++; | 119 | xid = dev->xid++; |
120 | if (!xid) | 120 | if (!xid) |
121 | xid = dev->xid++; | 121 | xid = dev->xid++; |
@@ -493,9 +493,9 @@ int rndis_rx_fixup(struct usbnet *dev, struct sk_buff *skb) | |||
493 | data_len = le32_to_cpu(hdr->data_len); | 493 | data_len = le32_to_cpu(hdr->data_len); |
494 | 494 | ||
495 | /* don't choke if we see oob, per-packet data, etc */ | 495 | /* don't choke if we see oob, per-packet data, etc */ |
496 | if (unlikely(hdr->msg_type != RNDIS_MSG_PACKET | 496 | if (unlikely(hdr->msg_type != RNDIS_MSG_PACKET || |
497 | || skb->len < msg_len | 497 | skb->len < msg_len || |
498 | || (data_offset + data_len + 8) > msg_len)) { | 498 | (data_offset + data_len + 8) > msg_len)) { |
499 | dev->net->stats.rx_frame_errors++; | 499 | dev->net->stats.rx_frame_errors++; |
500 | devdbg(dev, "bad rndis message %d/%d/%d/%d, len %d", | 500 | devdbg(dev, "bad rndis message %d/%d/%d/%d, len %d", |
501 | le32_to_cpu(hdr->msg_type), | 501 | le32_to_cpu(hdr->msg_type), |
diff --git a/drivers/net/usb/usbnet.c b/drivers/net/usb/usbnet.c index 04f3f289e87c..511e7bdc4573 100644 --- a/drivers/net/usb/usbnet.c +++ b/drivers/net/usb/usbnet.c | |||
@@ -140,8 +140,8 @@ int usbnet_get_endpoints(struct usbnet *dev, struct usb_interface *intf) | |||
140 | if (!alt || !in || !out) | 140 | if (!alt || !in || !out) |
141 | return -EINVAL; | 141 | return -EINVAL; |
142 | 142 | ||
143 | if (alt->desc.bAlternateSetting != 0 | 143 | if (alt->desc.bAlternateSetting != 0 || |
144 | || !(dev->driver_info->flags & FLAG_NO_SETINT)) { | 144 | !(dev->driver_info->flags & FLAG_NO_SETINT)) { |
145 | tmp = usb_set_interface (dev->udev, alt->desc.bInterfaceNumber, | 145 | tmp = usb_set_interface (dev->udev, alt->desc.bInterfaceNumber, |
146 | alt->desc.bAlternateSetting); | 146 | alt->desc.bAlternateSetting); |
147 | if (tmp < 0) | 147 | if (tmp < 0) |
@@ -351,9 +351,9 @@ static void rx_submit (struct usbnet *dev, struct urb *urb, gfp_t flags) | |||
351 | 351 | ||
352 | spin_lock_irqsave (&dev->rxq.lock, lockflags); | 352 | spin_lock_irqsave (&dev->rxq.lock, lockflags); |
353 | 353 | ||
354 | if (netif_running (dev->net) | 354 | if (netif_running (dev->net) && |
355 | && netif_device_present (dev->net) | 355 | netif_device_present (dev->net) && |
356 | && !test_bit (EVENT_RX_HALT, &dev->flags)) { | 356 | !test_bit (EVENT_RX_HALT, &dev->flags)) { |
357 | switch (retval = usb_submit_urb (urb, GFP_ATOMIC)) { | 357 | switch (retval = usb_submit_urb (urb, GFP_ATOMIC)) { |
358 | case -EPIPE: | 358 | case -EPIPE: |
359 | usbnet_defer_kevent (dev, EVENT_RX_HALT); | 359 | usbnet_defer_kevent (dev, EVENT_RX_HALT); |
@@ -391,8 +391,8 @@ static void rx_submit (struct usbnet *dev, struct urb *urb, gfp_t flags) | |||
391 | 391 | ||
392 | static inline void rx_process (struct usbnet *dev, struct sk_buff *skb) | 392 | static inline void rx_process (struct usbnet *dev, struct sk_buff *skb) |
393 | { | 393 | { |
394 | if (dev->driver_info->rx_fixup | 394 | if (dev->driver_info->rx_fixup && |
395 | && !dev->driver_info->rx_fixup (dev, skb)) | 395 | !dev->driver_info->rx_fixup (dev, skb)) |
396 | goto error; | 396 | goto error; |
397 | // else network stack removes extra byte if we forced a short packet | 397 | // else network stack removes extra byte if we forced a short packet |
398 | 398 | ||
@@ -484,8 +484,8 @@ block: | |||
484 | defer_bh(dev, skb, &dev->rxq); | 484 | defer_bh(dev, skb, &dev->rxq); |
485 | 485 | ||
486 | if (urb) { | 486 | if (urb) { |
487 | if (netif_running (dev->net) | 487 | if (netif_running (dev->net) && |
488 | && !test_bit (EVENT_RX_HALT, &dev->flags)) { | 488 | !test_bit (EVENT_RX_HALT, &dev->flags)) { |
489 | rx_submit (dev, urb, GFP_ATOMIC); | 489 | rx_submit (dev, urb, GFP_ATOMIC); |
490 | return; | 490 | return; |
491 | } | 491 | } |
@@ -649,9 +649,9 @@ int usbnet_stop (struct net_device *net) | |||
649 | unlink_urbs(dev, &dev->rxq); | 649 | unlink_urbs(dev, &dev->rxq); |
650 | 650 | ||
651 | /* maybe wait for deletions to finish. */ | 651 | /* maybe wait for deletions to finish. */ |
652 | while (!skb_queue_empty(&dev->rxq) | 652 | while (!skb_queue_empty(&dev->rxq) && |
653 | && !skb_queue_empty(&dev->txq) | 653 | !skb_queue_empty(&dev->txq) && |
654 | && !skb_queue_empty(&dev->done)) { | 654 | !skb_queue_empty(&dev->done)) { |
655 | msleep(UNLINK_TIMEOUT_MS); | 655 | msleep(UNLINK_TIMEOUT_MS); |
656 | if (netif_msg_ifdown(dev)) | 656 | if (netif_msg_ifdown(dev)) |
657 | devdbg(dev, "waited for %d urb completions", | 657 | devdbg(dev, "waited for %d urb completions", |
@@ -882,9 +882,9 @@ kevent (struct work_struct *work) | |||
882 | if (test_bit (EVENT_TX_HALT, &dev->flags)) { | 882 | if (test_bit (EVENT_TX_HALT, &dev->flags)) { |
883 | unlink_urbs (dev, &dev->txq); | 883 | unlink_urbs (dev, &dev->txq); |
884 | status = usb_clear_halt (dev->udev, dev->out); | 884 | status = usb_clear_halt (dev->udev, dev->out); |
885 | if (status < 0 | 885 | if (status < 0 && |
886 | && status != -EPIPE | 886 | status != -EPIPE && |
887 | && status != -ESHUTDOWN) { | 887 | status != -ESHUTDOWN) { |
888 | if (netif_msg_tx_err (dev)) | 888 | if (netif_msg_tx_err (dev)) |
889 | deverr (dev, "can't clear tx halt, status %d", | 889 | deverr (dev, "can't clear tx halt, status %d", |
890 | status); | 890 | status); |
@@ -897,9 +897,9 @@ kevent (struct work_struct *work) | |||
897 | if (test_bit (EVENT_RX_HALT, &dev->flags)) { | 897 | if (test_bit (EVENT_RX_HALT, &dev->flags)) { |
898 | unlink_urbs (dev, &dev->rxq); | 898 | unlink_urbs (dev, &dev->rxq); |
899 | status = usb_clear_halt (dev->udev, dev->in); | 899 | status = usb_clear_halt (dev->udev, dev->in); |
900 | if (status < 0 | 900 | if (status < 0 && |
901 | && status != -EPIPE | 901 | status != -EPIPE && |
902 | && status != -ESHUTDOWN) { | 902 | status != -ESHUTDOWN) { |
903 | if (netif_msg_rx_err (dev)) | 903 | if (netif_msg_rx_err (dev)) |
904 | deverr (dev, "can't clear rx halt, status %d", | 904 | deverr (dev, "can't clear rx halt, status %d", |
905 | status); | 905 | status); |
@@ -1126,10 +1126,10 @@ static void usbnet_bh (unsigned long param) | |||
1126 | } | 1126 | } |
1127 | 1127 | ||
1128 | // or are we maybe short a few urbs? | 1128 | // or are we maybe short a few urbs? |
1129 | } else if (netif_running (dev->net) | 1129 | } else if (netif_running (dev->net) && |
1130 | && netif_device_present (dev->net) | 1130 | netif_device_present (dev->net) && |
1131 | && !timer_pending (&dev->delay) | 1131 | !timer_pending (&dev->delay) && |
1132 | && !test_bit (EVENT_RX_HALT, &dev->flags)) { | 1132 | !test_bit (EVENT_RX_HALT, &dev->flags)) { |
1133 | int temp = dev->rxq.qlen; | 1133 | int temp = dev->rxq.qlen; |
1134 | int qlen = RX_QLEN (dev); | 1134 | int qlen = RX_QLEN (dev); |
1135 | 1135 | ||
@@ -1297,8 +1297,8 @@ usbnet_probe (struct usb_interface *udev, const struct usb_device_id *prod) | |||
1297 | // heuristic: "usb%d" for links we know are two-host, | 1297 | // heuristic: "usb%d" for links we know are two-host, |
1298 | // else "eth%d" when there's reasonable doubt. userspace | 1298 | // else "eth%d" when there's reasonable doubt. userspace |
1299 | // can rename the link if it knows better. | 1299 | // can rename the link if it knows better. |
1300 | if ((dev->driver_info->flags & FLAG_ETHER) != 0 | 1300 | if ((dev->driver_info->flags & FLAG_ETHER) != 0 && |
1301 | && (net->dev_addr [0] & 0x02) == 0) | 1301 | (net->dev_addr [0] & 0x02) == 0) |
1302 | strcpy (net->name, "eth%d"); | 1302 | strcpy (net->name, "eth%d"); |
1303 | /* WLAN devices should always be named "wlan%d" */ | 1303 | /* WLAN devices should always be named "wlan%d" */ |
1304 | if ((dev->driver_info->flags & FLAG_WLAN) != 0) | 1304 | if ((dev->driver_info->flags & FLAG_WLAN) != 0) |
diff --git a/drivers/net/usb/zaurus.c b/drivers/net/usb/zaurus.c index 04882c8f9bf1..3eb0b167b5b4 100644 --- a/drivers/net/usb/zaurus.c +++ b/drivers/net/usb/zaurus.c | |||
@@ -174,8 +174,8 @@ static int blan_mdlm_bind(struct usbnet *dev, struct usb_interface *intf) | |||
174 | goto bad_desc; | 174 | goto bad_desc; |
175 | } | 175 | } |
176 | /* expect bcdVersion 1.0, ignore */ | 176 | /* expect bcdVersion 1.0, ignore */ |
177 | if (memcmp(&desc->bGUID, blan_guid, 16) | 177 | if (memcmp(&desc->bGUID, blan_guid, 16) && |
178 | && memcmp(&desc->bGUID, safe_guid, 16) ) { | 178 | memcmp(&desc->bGUID, safe_guid, 16)) { |
179 | /* hey, this one might _really_ be MDLM! */ | 179 | /* hey, this one might _really_ be MDLM! */ |
180 | dev_dbg(&intf->dev, "MDLM guid\n"); | 180 | dev_dbg(&intf->dev, "MDLM guid\n"); |
181 | goto bad_desc; | 181 | goto bad_desc; |