diff options
author | Joe Perches <joe@perches.com> | 2009-12-03 02:58:21 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-12-03 16:18:01 -0500 |
commit | 8e95a2026f3b43f7c3d676adaccd2de9532e8dcc (patch) | |
tree | 3733318168cd512480b6db58c5c16d1c8847f0b7 /drivers | |
parent | 3454f835837609d60b29a266e3bd9d701073b060 (diff) |
drivers/net: Move && and || to end of previous line
Only files where David Miller is the primary git-signer.
wireless, wimax, ixgbe, etc are not modified.
Compile tested x86 allyesconfig only
Not all files compiled (not x86 compatible)
Added a few > 80 column lines, which I ignored.
Existing checkpatch complaints ignored.
Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers')
132 files changed, 799 insertions, 805 deletions
diff --git a/drivers/net/3c501.c b/drivers/net/3c501.c index 62ceb2b4820c..4d4cad393dce 100644 --- a/drivers/net/3c501.c +++ b/drivers/net/3c501.c | |||
@@ -249,11 +249,11 @@ static int __init el1_probe1(struct net_device *dev, int ioaddr) | |||
249 | * for the Sager NP943 prefix. | 249 | * for the Sager NP943 prefix. |
250 | */ | 250 | */ |
251 | 251 | ||
252 | if (station_addr[0] == 0x02 && station_addr[1] == 0x60 | 252 | if (station_addr[0] == 0x02 && station_addr[1] == 0x60 && |
253 | && station_addr[2] == 0x8c) | 253 | station_addr[2] == 0x8c) |
254 | mname = "3c501"; | 254 | mname = "3c501"; |
255 | else if (station_addr[0] == 0x00 && station_addr[1] == 0x80 | 255 | else if (station_addr[0] == 0x00 && station_addr[1] == 0x80 && |
256 | && station_addr[2] == 0xC8) | 256 | station_addr[2] == 0xC8) |
257 | mname = "NP943"; | 257 | mname = "NP943"; |
258 | else { | 258 | else { |
259 | release_region(ioaddr, EL1_IO_EXTENT); | 259 | release_region(ioaddr, EL1_IO_EXTENT); |
diff --git a/drivers/net/3c503.c b/drivers/net/3c503.c index c71e12d05f6e..66e0323c1839 100644 --- a/drivers/net/3c503.c +++ b/drivers/net/3c503.c | |||
@@ -214,8 +214,8 @@ el2_probe1(struct net_device *dev, int ioaddr) | |||
214 | iobase_reg = inb(ioaddr+0x403); | 214 | iobase_reg = inb(ioaddr+0x403); |
215 | membase_reg = inb(ioaddr+0x404); | 215 | membase_reg = inb(ioaddr+0x404); |
216 | /* ASIC location registers should be 0 or have only a single bit set. */ | 216 | /* ASIC location registers should be 0 or have only a single bit set. */ |
217 | if ( (iobase_reg & (iobase_reg - 1)) | 217 | if ((iobase_reg & (iobase_reg - 1)) || |
218 | || (membase_reg & (membase_reg - 1))) { | 218 | (membase_reg & (membase_reg - 1))) { |
219 | retval = -ENODEV; | 219 | retval = -ENODEV; |
220 | goto out1; | 220 | goto out1; |
221 | } | 221 | } |
@@ -291,8 +291,8 @@ el2_probe1(struct net_device *dev, int ioaddr) | |||
291 | writel(0xba5eba5e, mem_base); | 291 | writel(0xba5eba5e, mem_base); |
292 | for (i = sizeof(test_val); i < EL2_MEMSIZE; i+=sizeof(test_val)) { | 292 | for (i = sizeof(test_val); i < EL2_MEMSIZE; i+=sizeof(test_val)) { |
293 | writel(test_val, mem_base + i); | 293 | writel(test_val, mem_base + i); |
294 | if (readl(mem_base) != 0xba5eba5e | 294 | if (readl(mem_base) != 0xba5eba5e || |
295 | || readl(mem_base + i) != test_val) { | 295 | readl(mem_base + i) != test_val) { |
296 | pr_warning("3c503: memory failure or memory address conflict.\n"); | 296 | pr_warning("3c503: memory failure or memory address conflict.\n"); |
297 | dev->mem_start = 0; | 297 | dev->mem_start = 0; |
298 | ei_status.name = "3c503-PIO"; | 298 | ei_status.name = "3c503-PIO"; |
@@ -397,9 +397,10 @@ el2_open(struct net_device *dev) | |||
397 | unsigned long cookie = probe_irq_on(); | 397 | unsigned long cookie = probe_irq_on(); |
398 | outb_p(0x04 << ((*irqp == 9) ? 2 : *irqp), E33G_IDCFR); | 398 | outb_p(0x04 << ((*irqp == 9) ? 2 : *irqp), E33G_IDCFR); |
399 | outb_p(0x00, E33G_IDCFR); | 399 | outb_p(0x00, E33G_IDCFR); |
400 | if (*irqp == probe_irq_off(cookie) /* It's a good IRQ line! */ | 400 | if (*irqp == probe_irq_off(cookie) && /* It's a good IRQ line! */ |
401 | && ((retval = request_irq(dev->irq = *irqp, | 401 | ((retval = request_irq(dev->irq = *irqp, |
402 | eip_interrupt, 0, dev->name, dev)) == 0)) | 402 | eip_interrupt, 0, |
403 | dev->name, dev)) == 0)) | ||
403 | break; | 404 | break; |
404 | } else { | 405 | } else { |
405 | if (retval != -EBUSY) | 406 | if (retval != -EBUSY) |
diff --git a/drivers/net/3c507.c b/drivers/net/3c507.c index 605f1d17a8f3..fbc231153e55 100644 --- a/drivers/net/3c507.c +++ b/drivers/net/3c507.c | |||
@@ -836,8 +836,8 @@ static void el16_rx(struct net_device *dev) | |||
836 | void __iomem *data_frame = lp->base + data_buffer_addr; | 836 | void __iomem *data_frame = lp->base + data_buffer_addr; |
837 | ushort pkt_len = readw(data_frame); | 837 | ushort pkt_len = readw(data_frame); |
838 | 838 | ||
839 | if (rfd_cmd != 0 || data_buffer_addr != rx_head + 22 | 839 | if (rfd_cmd != 0 || data_buffer_addr != rx_head + 22 || |
840 | || (pkt_len & 0xC000) != 0xC000) { | 840 | (pkt_len & 0xC000) != 0xC000) { |
841 | pr_err("%s: Rx frame at %#x corrupted, " | 841 | pr_err("%s: Rx frame at %#x corrupted, " |
842 | "status %04x cmd %04x next %04x " | 842 | "status %04x cmd %04x next %04x " |
843 | "data-buf @%04x %04x.\n", | 843 | "data-buf @%04x %04x.\n", |
diff --git a/drivers/net/3c509.c b/drivers/net/3c509.c index 8d4ce0964073..9d85efce5916 100644 --- a/drivers/net/3c509.c +++ b/drivers/net/3c509.c | |||
@@ -253,9 +253,9 @@ static int el3_isa_id_sequence(__be16 *phys_addr) | |||
253 | This check is needed in order not to register them twice. */ | 253 | This check is needed in order not to register them twice. */ |
254 | for (i = 0; i < el3_cards; i++) { | 254 | for (i = 0; i < el3_cards; i++) { |
255 | struct el3_private *lp = netdev_priv(el3_devs[i]); | 255 | struct el3_private *lp = netdev_priv(el3_devs[i]); |
256 | if (lp->type == EL3_PNP | 256 | if (lp->type == EL3_PNP && |
257 | && !memcmp(phys_addr, el3_devs[i]->dev_addr, | 257 | !memcmp(phys_addr, el3_devs[i]->dev_addr, |
258 | ETH_ALEN)) { | 258 | ETH_ALEN)) { |
259 | if (el3_debug > 3) | 259 | if (el3_debug > 3) |
260 | pr_debug("3c509 with address %02x %02x %02x %02x %02x %02x was found by ISAPnP\n", | 260 | pr_debug("3c509 with address %02x %02x %02x %02x %02x %02x was found by ISAPnP\n", |
261 | phys_addr[0] & 0xff, phys_addr[0] >> 8, | 261 | phys_addr[0] & 0xff, phys_addr[0] >> 8, |
@@ -835,8 +835,8 @@ el3_start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
835 | #ifndef final_version | 835 | #ifndef final_version |
836 | { /* Error-checking code, delete someday. */ | 836 | { /* Error-checking code, delete someday. */ |
837 | ushort status = inw(ioaddr + EL3_STATUS); | 837 | ushort status = inw(ioaddr + EL3_STATUS); |
838 | if (status & 0x0001 /* IRQ line active, missed one. */ | 838 | if (status & 0x0001 && /* IRQ line active, missed one. */ |
839 | && inw(ioaddr + EL3_STATUS) & 1) { /* Make sure. */ | 839 | inw(ioaddr + EL3_STATUS) & 1) { /* Make sure. */ |
840 | pr_debug("%s: Missed interrupt, status then %04x now %04x" | 840 | pr_debug("%s: Missed interrupt, status then %04x now %04x" |
841 | " Tx %2.2x Rx %4.4x.\n", dev->name, status, | 841 | " Tx %2.2x Rx %4.4x.\n", dev->name, status, |
842 | inw(ioaddr + EL3_STATUS), inb(ioaddr + TX_STATUS), | 842 | inw(ioaddr + EL3_STATUS), inb(ioaddr + TX_STATUS), |
diff --git a/drivers/net/3c515.c b/drivers/net/3c515.c index 37faf36e2457..063b049ffe55 100644 --- a/drivers/net/3c515.c +++ b/drivers/net/3c515.c | |||
@@ -764,10 +764,11 @@ static int corkscrew_open(struct net_device *dev) | |||
764 | /* Use the now-standard shared IRQ implementation. */ | 764 | /* Use the now-standard shared IRQ implementation. */ |
765 | if (vp->capabilities == 0x11c7) { | 765 | if (vp->capabilities == 0x11c7) { |
766 | /* Corkscrew: Cannot share ISA resources. */ | 766 | /* Corkscrew: Cannot share ISA resources. */ |
767 | if (dev->irq == 0 | 767 | if (dev->irq == 0 || |
768 | || dev->dma == 0 | 768 | dev->dma == 0 || |
769 | || request_irq(dev->irq, corkscrew_interrupt, 0, | 769 | request_irq(dev->irq, corkscrew_interrupt, 0, |
770 | vp->product_name, dev)) return -EAGAIN; | 770 | vp->product_name, dev)) |
771 | return -EAGAIN; | ||
771 | enable_dma(dev->dma); | 772 | enable_dma(dev->dma); |
772 | set_dma_mode(dev->dma, DMA_MODE_CASCADE); | 773 | set_dma_mode(dev->dma, DMA_MODE_CASCADE); |
773 | } else if (request_irq(dev->irq, corkscrew_interrupt, IRQF_SHARED, | 774 | } else if (request_irq(dev->irq, corkscrew_interrupt, IRQF_SHARED, |
@@ -1368,8 +1369,8 @@ static int boomerang_rx(struct net_device *dev) | |||
1368 | 1369 | ||
1369 | /* Check if the packet is long enough to just accept without | 1370 | /* Check if the packet is long enough to just accept without |
1370 | copying to a properly sized skbuff. */ | 1371 | copying to a properly sized skbuff. */ |
1371 | if (pkt_len < rx_copybreak | 1372 | if (pkt_len < rx_copybreak && |
1372 | && (skb = dev_alloc_skb(pkt_len + 4)) != NULL) { | 1373 | (skb = dev_alloc_skb(pkt_len + 4)) != NULL) { |
1373 | skb_reserve(skb, 2); /* Align IP on 16 byte boundaries */ | 1374 | skb_reserve(skb, 2); /* Align IP on 16 byte boundaries */ |
1374 | /* 'skb_put()' points to the start of sk_buff data area. */ | 1375 | /* 'skb_put()' points to the start of sk_buff data area. */ |
1375 | memcpy(skb_put(skb, pkt_len), | 1376 | memcpy(skb_put(skb, pkt_len), |
diff --git a/drivers/net/3c527.c b/drivers/net/3c527.c index d91c3464fe72..36c4191e7bca 100644 --- a/drivers/net/3c527.c +++ b/drivers/net/3c527.c | |||
@@ -1168,8 +1168,8 @@ static void mc32_rx_ring(struct net_device *dev) | |||
1168 | 1168 | ||
1169 | /* Try to save time by avoiding a copy on big frames */ | 1169 | /* Try to save time by avoiding a copy on big frames */ |
1170 | 1170 | ||
1171 | if ((length > RX_COPYBREAK) | 1171 | if ((length > RX_COPYBREAK) && |
1172 | && ((newskb=dev_alloc_skb(1532)) != NULL)) | 1172 | ((newskb=dev_alloc_skb(1532)) != NULL)) |
1173 | { | 1173 | { |
1174 | skb=lp->rx_ring[rx_ring_tail].skb; | 1174 | skb=lp->rx_ring[rx_ring_tail].skb; |
1175 | skb_put(skb, length); | 1175 | skb_put(skb, length); |
diff --git a/drivers/net/3c59x.c b/drivers/net/3c59x.c index 32031eaf4910..78b7167a8ce3 100644 --- a/drivers/net/3c59x.c +++ b/drivers/net/3c59x.c | |||
@@ -1942,8 +1942,8 @@ vortex_error(struct net_device *dev, int status) | |||
1942 | if (status & TxComplete) { /* Really "TxError" for us. */ | 1942 | if (status & TxComplete) { /* Really "TxError" for us. */ |
1943 | tx_status = ioread8(ioaddr + TxStatus); | 1943 | tx_status = ioread8(ioaddr + TxStatus); |
1944 | /* Presumably a tx-timeout. We must merely re-enable. */ | 1944 | /* Presumably a tx-timeout. We must merely re-enable. */ |
1945 | if (vortex_debug > 2 | 1945 | if (vortex_debug > 2 || |
1946 | || (tx_status != 0x88 && vortex_debug > 0)) { | 1946 | (tx_status != 0x88 && vortex_debug > 0)) { |
1947 | pr_err("%s: Transmit error, Tx status register %2.2x.\n", | 1947 | pr_err("%s: Transmit error, Tx status register %2.2x.\n", |
1948 | dev->name, tx_status); | 1948 | dev->name, tx_status); |
1949 | if (tx_status == 0x82) { | 1949 | if (tx_status == 0x82) { |
diff --git a/drivers/net/8139cp.c b/drivers/net/8139cp.c index ab451bb8995a..3f452bcbfb9e 100644 --- a/drivers/net/8139cp.c +++ b/drivers/net/8139cp.c | |||
@@ -909,8 +909,8 @@ static void __cp_set_rx_mode (struct net_device *dev) | |||
909 | AcceptBroadcast | AcceptMulticast | AcceptMyPhys | | 909 | AcceptBroadcast | AcceptMulticast | AcceptMyPhys | |
910 | AcceptAllPhys; | 910 | AcceptAllPhys; |
911 | mc_filter[1] = mc_filter[0] = 0xffffffff; | 911 | mc_filter[1] = mc_filter[0] = 0xffffffff; |
912 | } else if ((dev->mc_count > multicast_filter_limit) | 912 | } else if ((dev->mc_count > multicast_filter_limit) || |
913 | || (dev->flags & IFF_ALLMULTI)) { | 913 | (dev->flags & IFF_ALLMULTI)) { |
914 | /* Too many to filter perfectly -- accept all multicasts. */ | 914 | /* Too many to filter perfectly -- accept all multicasts. */ |
915 | rx_mode = AcceptBroadcast | AcceptMulticast | AcceptMyPhys; | 915 | rx_mode = AcceptBroadcast | AcceptMulticast | AcceptMyPhys; |
916 | mc_filter[1] = mc_filter[0] = 0xffffffff; | 916 | mc_filter[1] = mc_filter[0] = 0xffffffff; |
diff --git a/drivers/net/8139too.c b/drivers/net/8139too.c index 7e333f73b228..25f7339daabd 100644 --- a/drivers/net/8139too.c +++ b/drivers/net/8139too.c | |||
@@ -1549,8 +1549,8 @@ static inline void rtl8139_thread_iter (struct net_device *dev, | |||
1549 | mii_lpa = mdio_read (dev, tp->phys[0], MII_LPA); | 1549 | mii_lpa = mdio_read (dev, tp->phys[0], MII_LPA); |
1550 | 1550 | ||
1551 | if (!tp->mii.force_media && mii_lpa != 0xffff) { | 1551 | if (!tp->mii.force_media && mii_lpa != 0xffff) { |
1552 | int duplex = (mii_lpa & LPA_100FULL) | 1552 | int duplex = ((mii_lpa & LPA_100FULL) || |
1553 | || (mii_lpa & 0x01C0) == 0x0040; | 1553 | (mii_lpa & 0x01C0) == 0x0040); |
1554 | if (tp->mii.full_duplex != duplex) { | 1554 | if (tp->mii.full_duplex != duplex) { |
1555 | tp->mii.full_duplex = duplex; | 1555 | tp->mii.full_duplex = duplex; |
1556 | 1556 | ||
@@ -1936,8 +1936,8 @@ static int rtl8139_rx(struct net_device *dev, struct rtl8139_private *tp, | |||
1936 | RTL_R16 (RxBufAddr), | 1936 | RTL_R16 (RxBufAddr), |
1937 | RTL_R16 (RxBufPtr), RTL_R8 (ChipCmd)); | 1937 | RTL_R16 (RxBufPtr), RTL_R8 (ChipCmd)); |
1938 | 1938 | ||
1939 | while (netif_running(dev) && received < budget | 1939 | while (netif_running(dev) && received < budget && |
1940 | && (RTL_R8 (ChipCmd) & RxBufEmpty) == 0) { | 1940 | (RTL_R8 (ChipCmd) & RxBufEmpty) == 0) { |
1941 | u32 ring_offset = cur_rx % RX_BUF_LEN; | 1941 | u32 ring_offset = cur_rx % RX_BUF_LEN; |
1942 | u32 rx_status; | 1942 | u32 rx_status; |
1943 | unsigned int pkt_size; | 1943 | unsigned int pkt_size; |
@@ -2521,8 +2521,8 @@ static void __set_rx_mode (struct net_device *dev) | |||
2521 | AcceptBroadcast | AcceptMulticast | AcceptMyPhys | | 2521 | AcceptBroadcast | AcceptMulticast | AcceptMyPhys | |
2522 | AcceptAllPhys; | 2522 | AcceptAllPhys; |
2523 | mc_filter[1] = mc_filter[0] = 0xffffffff; | 2523 | mc_filter[1] = mc_filter[0] = 0xffffffff; |
2524 | } else if ((dev->mc_count > multicast_filter_limit) | 2524 | } else if ((dev->mc_count > multicast_filter_limit) || |
2525 | || (dev->flags & IFF_ALLMULTI)) { | 2525 | (dev->flags & IFF_ALLMULTI)) { |
2526 | /* Too many to filter perfectly -- accept all multicasts. */ | 2526 | /* Too many to filter perfectly -- accept all multicasts. */ |
2527 | rx_mode = AcceptBroadcast | AcceptMulticast | AcceptMyPhys; | 2527 | rx_mode = AcceptBroadcast | AcceptMulticast | AcceptMyPhys; |
2528 | mc_filter[1] = mc_filter[0] = 0xffffffff; | 2528 | mc_filter[1] = mc_filter[0] = 0xffffffff; |
diff --git a/drivers/net/appletalk/ipddp.c b/drivers/net/appletalk/ipddp.c index aaf14d306a4a..eb0448b03f41 100644 --- a/drivers/net/appletalk/ipddp.c +++ b/drivers/net/appletalk/ipddp.c | |||
@@ -230,9 +230,9 @@ static int ipddp_delete(struct ipddp_route *rt) | |||
230 | spin_lock_bh(&ipddp_route_lock); | 230 | spin_lock_bh(&ipddp_route_lock); |
231 | while((tmp = *r) != NULL) | 231 | while((tmp = *r) != NULL) |
232 | { | 232 | { |
233 | if(tmp->ip == rt->ip | 233 | if(tmp->ip == rt->ip && |
234 | && tmp->at.s_net == rt->at.s_net | 234 | tmp->at.s_net == rt->at.s_net && |
235 | && tmp->at.s_node == rt->at.s_node) | 235 | tmp->at.s_node == rt->at.s_node) |
236 | { | 236 | { |
237 | *r = tmp->next; | 237 | *r = tmp->next; |
238 | spin_unlock_bh(&ipddp_route_lock); | 238 | spin_unlock_bh(&ipddp_route_lock); |
@@ -255,9 +255,9 @@ static struct ipddp_route* __ipddp_find_route(struct ipddp_route *rt) | |||
255 | 255 | ||
256 | for(f = ipddp_route_list; f != NULL; f = f->next) | 256 | for(f = ipddp_route_list; f != NULL; f = f->next) |
257 | { | 257 | { |
258 | if(f->ip == rt->ip | 258 | if(f->ip == rt->ip && |
259 | && f->at.s_net == rt->at.s_net | 259 | f->at.s_net == rt->at.s_net && |
260 | && f->at.s_node == rt->at.s_node) | 260 | f->at.s_node == rt->at.s_node) |
261 | return (f); | 261 | return (f); |
262 | } | 262 | } |
263 | 263 | ||
diff --git a/drivers/net/arcnet/arc-rimi.c b/drivers/net/arcnet/arc-rimi.c index c5b988140a91..e6afab2455b1 100644 --- a/drivers/net/arcnet/arc-rimi.c +++ b/drivers/net/arcnet/arc-rimi.c | |||
@@ -174,9 +174,9 @@ static int __init arcrimi_found(struct net_device *dev) | |||
174 | * 2k (or there are no mirrors at all) but on some, it's 4k. | 174 | * 2k (or there are no mirrors at all) but on some, it's 4k. |
175 | */ | 175 | */ |
176 | mirror_size = MIRROR_SIZE; | 176 | mirror_size = MIRROR_SIZE; |
177 | if (readb(p) == TESTvalue | 177 | if (readb(p) == TESTvalue && |
178 | && check_mirror(shmem - MIRROR_SIZE, MIRROR_SIZE) == 0 | 178 | check_mirror(shmem - MIRROR_SIZE, MIRROR_SIZE) == 0 && |
179 | && check_mirror(shmem - 2 * MIRROR_SIZE, MIRROR_SIZE) == 1) | 179 | check_mirror(shmem - 2 * MIRROR_SIZE, MIRROR_SIZE) == 1) |
180 | mirror_size = 2 * MIRROR_SIZE; | 180 | mirror_size = 2 * MIRROR_SIZE; |
181 | 181 | ||
182 | first_mirror = shmem - mirror_size; | 182 | first_mirror = shmem - mirror_size; |
diff --git a/drivers/net/arcnet/arcnet.c b/drivers/net/arcnet/arcnet.c index 75a572560909..d8f029303754 100644 --- a/drivers/net/arcnet/arcnet.c +++ b/drivers/net/arcnet/arcnet.c | |||
@@ -301,8 +301,8 @@ static int choose_mtu(void) | |||
301 | 301 | ||
302 | /* choose the smallest MTU of all available encaps */ | 302 | /* choose the smallest MTU of all available encaps */ |
303 | for (count = 0; count < 256; count++) { | 303 | for (count = 0; count < 256; count++) { |
304 | if (arc_proto_map[count] != &arc_proto_null | 304 | if (arc_proto_map[count] != &arc_proto_null && |
305 | && arc_proto_map[count]->mtu < mtu) { | 305 | arc_proto_map[count]->mtu < mtu) { |
306 | mtu = arc_proto_map[count]->mtu; | 306 | mtu = arc_proto_map[count]->mtu; |
307 | } | 307 | } |
308 | } | 308 | } |
@@ -953,13 +953,13 @@ irqreturn_t arcnet_interrupt(int irq, void *dev_id) | |||
953 | * > RECON_THRESHOLD/min; | 953 | * > RECON_THRESHOLD/min; |
954 | * then print a warning message. | 954 | * then print a warning message. |
955 | */ | 955 | */ |
956 | if (!lp->network_down | 956 | if (!lp->network_down && |
957 | && (lp->last_recon - lp->first_recon) <= HZ * 60 | 957 | (lp->last_recon - lp->first_recon) <= HZ * 60 && |
958 | && lp->num_recons >= RECON_THRESHOLD) { | 958 | lp->num_recons >= RECON_THRESHOLD) { |
959 | lp->network_down = 1; | 959 | lp->network_down = 1; |
960 | BUGMSG(D_NORMAL, "many reconfigurations detected: cabling problem?\n"); | 960 | BUGMSG(D_NORMAL, "many reconfigurations detected: cabling problem?\n"); |
961 | } else if (!lp->network_down | 961 | } else if (!lp->network_down && |
962 | && lp->last_recon - lp->first_recon > HZ * 60) { | 962 | lp->last_recon - lp->first_recon > HZ * 60) { |
963 | /* reset counters if we've gone for over a minute. */ | 963 | /* reset counters if we've gone for over a minute. */ |
964 | lp->first_recon = lp->last_recon; | 964 | lp->first_recon = lp->last_recon; |
965 | lp->num_recons = 1; | 965 | lp->num_recons = 1; |
diff --git a/drivers/net/at1700.c b/drivers/net/at1700.c index d4ab69f032be..b14f4799d5d1 100644 --- a/drivers/net/at1700.c +++ b/drivers/net/at1700.c | |||
@@ -350,13 +350,13 @@ static int __init at1700_probe1(struct net_device *dev, int ioaddr) | |||
350 | slot = -1; | 350 | slot = -1; |
351 | /* We must check for the EEPROM-config boards first, else accessing | 351 | /* We must check for the EEPROM-config boards first, else accessing |
352 | IOCONFIG0 will move the board! */ | 352 | IOCONFIG0 will move the board! */ |
353 | if (at1700_probe_list[inb(ioaddr + IOCONFIG1) & 0x07] == ioaddr | 353 | if (at1700_probe_list[inb(ioaddr + IOCONFIG1) & 0x07] == ioaddr && |
354 | && read_eeprom(ioaddr, 4) == 0x0000 | 354 | read_eeprom(ioaddr, 4) == 0x0000 && |
355 | && (read_eeprom(ioaddr, 5) & 0xff00) == 0xF400) | 355 | (read_eeprom(ioaddr, 5) & 0xff00) == 0xF400) |
356 | is_at1700 = 1; | 356 | is_at1700 = 1; |
357 | else if (inb(ioaddr + SAPROM ) == 0x00 | 357 | else if (inb(ioaddr + SAPROM ) == 0x00 && |
358 | && inb(ioaddr + SAPROM + 1) == 0x00 | 358 | inb(ioaddr + SAPROM + 1) == 0x00 && |
359 | && inb(ioaddr + SAPROM + 2) == 0x0e) | 359 | inb(ioaddr + SAPROM + 2) == 0x0e) |
360 | is_fmv18x = 1; | 360 | is_fmv18x = 1; |
361 | else { | 361 | else { |
362 | goto err_out; | 362 | goto err_out; |
@@ -839,8 +839,8 @@ set_rx_mode(struct net_device *dev) | |||
839 | if (dev->flags & IFF_PROMISC) { | 839 | if (dev->flags & IFF_PROMISC) { |
840 | memset(mc_filter, 0xff, sizeof(mc_filter)); | 840 | memset(mc_filter, 0xff, sizeof(mc_filter)); |
841 | outb(3, ioaddr + RX_MODE); /* Enable promiscuous mode */ | 841 | outb(3, ioaddr + RX_MODE); /* Enable promiscuous mode */ |
842 | } else if (dev->mc_count > MC_FILTERBREAK | 842 | } else if (dev->mc_count > MC_FILTERBREAK || |
843 | || (dev->flags & IFF_ALLMULTI)) { | 843 | (dev->flags & IFF_ALLMULTI)) { |
844 | /* Too many to filter perfectly -- accept all multicasts. */ | 844 | /* Too many to filter perfectly -- accept all multicasts. */ |
845 | memset(mc_filter, 0xff, sizeof(mc_filter)); | 845 | memset(mc_filter, 0xff, sizeof(mc_filter)); |
846 | outb(2, ioaddr + RX_MODE); /* Use normal mode. */ | 846 | outb(2, ioaddr + RX_MODE); /* Use normal mode. */ |
diff --git a/drivers/net/atarilance.c b/drivers/net/atarilance.c index 0c0deceb6938..c5721cb38265 100644 --- a/drivers/net/atarilance.c +++ b/drivers/net/atarilance.c | |||
@@ -930,8 +930,8 @@ static irqreturn_t lance_interrupt( int irq, void *dev_id ) | |||
930 | } | 930 | } |
931 | #endif | 931 | #endif |
932 | 932 | ||
933 | if (lp->tx_full && (netif_queue_stopped(dev)) | 933 | if (lp->tx_full && (netif_queue_stopped(dev)) && |
934 | && dirty_tx > lp->cur_tx - TX_RING_SIZE + 2) { | 934 | dirty_tx > lp->cur_tx - TX_RING_SIZE + 2) { |
935 | /* The ring is no longer full, clear tbusy. */ | 935 | /* The ring is no longer full, clear tbusy. */ |
936 | lp->tx_full = 0; | 936 | lp->tx_full = 0; |
937 | netif_wake_queue (dev); | 937 | netif_wake_queue (dev); |
diff --git a/drivers/net/atlx/atl1.c b/drivers/net/atlx/atl1.c index e547f788a266..b6cf3263127c 100644 --- a/drivers/net/atlx/atl1.c +++ b/drivers/net/atlx/atl1.c | |||
@@ -1344,8 +1344,8 @@ static u32 atl1_check_link(struct atl1_adapter *adapter) | |||
1344 | 1344 | ||
1345 | /* link result is our setting */ | 1345 | /* link result is our setting */ |
1346 | if (!reconfig) { | 1346 | if (!reconfig) { |
1347 | if (adapter->link_speed != speed | 1347 | if (adapter->link_speed != speed || |
1348 | || adapter->link_duplex != duplex) { | 1348 | adapter->link_duplex != duplex) { |
1349 | adapter->link_speed = speed; | 1349 | adapter->link_speed = speed; |
1350 | adapter->link_duplex = duplex; | 1350 | adapter->link_duplex = duplex; |
1351 | atl1_setup_mac_ctrl(adapter); | 1351 | atl1_setup_mac_ctrl(adapter); |
@@ -2087,8 +2087,8 @@ static void atl1_intr_tx(struct atl1_adapter *adapter) | |||
2087 | } | 2087 | } |
2088 | atomic_set(&tpd_ring->next_to_clean, sw_tpd_next_to_clean); | 2088 | atomic_set(&tpd_ring->next_to_clean, sw_tpd_next_to_clean); |
2089 | 2089 | ||
2090 | if (netif_queue_stopped(adapter->netdev) | 2090 | if (netif_queue_stopped(adapter->netdev) && |
2091 | && netif_carrier_ok(adapter->netdev)) | 2091 | netif_carrier_ok(adapter->netdev)) |
2092 | netif_wake_queue(adapter->netdev); | 2092 | netif_wake_queue(adapter->netdev); |
2093 | } | 2093 | } |
2094 | 2094 | ||
diff --git a/drivers/net/atp.c b/drivers/net/atp.c index 001791775be3..2f8261c9614a 100644 --- a/drivers/net/atp.c +++ b/drivers/net/atp.c | |||
@@ -673,8 +673,8 @@ static irqreturn_t atp_interrupt(int irq, void *dev_instance) | |||
673 | netif_wake_queue(dev); /* Inform upper layers. */ | 673 | netif_wake_queue(dev); /* Inform upper layers. */ |
674 | } | 674 | } |
675 | num_tx_since_rx++; | 675 | num_tx_since_rx++; |
676 | } else if (num_tx_since_rx > 8 | 676 | } else if (num_tx_since_rx > 8 && |
677 | && time_after(jiffies, dev->last_rx + HZ)) { | 677 | time_after(jiffies, dev->last_rx + HZ)) { |
678 | if (net_debug > 2) | 678 | if (net_debug > 2) |
679 | printk(KERN_DEBUG "%s: Missed packet? No Rx after %d Tx and " | 679 | printk(KERN_DEBUG "%s: Missed packet? No Rx after %d Tx and " |
680 | "%ld jiffies status %02x CMR1 %02x.\n", dev->name, | 680 | "%ld jiffies status %02x CMR1 %02x.\n", dev->name, |
diff --git a/drivers/net/benet/be_main.c b/drivers/net/benet/be_main.c index 84f686f41b53..957a0f7f2764 100644 --- a/drivers/net/benet/be_main.c +++ b/drivers/net/benet/be_main.c | |||
@@ -2382,8 +2382,8 @@ static struct pci_driver be_driver = { | |||
2382 | 2382 | ||
2383 | static int __init be_init_module(void) | 2383 | static int __init be_init_module(void) |
2384 | { | 2384 | { |
2385 | if (rx_frag_size != 8192 && rx_frag_size != 4096 | 2385 | if (rx_frag_size != 8192 && rx_frag_size != 4096 && |
2386 | && rx_frag_size != 2048) { | 2386 | rx_frag_size != 2048) { |
2387 | printk(KERN_WARNING DRV_NAME | 2387 | printk(KERN_WARNING DRV_NAME |
2388 | " : Module param rx_frag_size must be 2048/4096/8192." | 2388 | " : Module param rx_frag_size must be 2048/4096/8192." |
2389 | " Using 2048\n"); | 2389 | " Using 2048\n"); |
diff --git a/drivers/net/bfin_mac.c b/drivers/net/bfin_mac.c index 14bd3801f7d3..8ffea3990d07 100644 --- a/drivers/net/bfin_mac.c +++ b/drivers/net/bfin_mac.c | |||
@@ -554,8 +554,8 @@ static void adjust_tx_list(void) | |||
554 | { | 554 | { |
555 | int timeout_cnt = MAX_TIMEOUT_CNT; | 555 | int timeout_cnt = MAX_TIMEOUT_CNT; |
556 | 556 | ||
557 | if (tx_list_head->status.status_word != 0 | 557 | if (tx_list_head->status.status_word != 0 && |
558 | && current_tx_ptr != tx_list_head) { | 558 | current_tx_ptr != tx_list_head) { |
559 | goto adjust_head; /* released something, just return; */ | 559 | goto adjust_head; /* released something, just return; */ |
560 | } | 560 | } |
561 | 561 | ||
@@ -567,8 +567,8 @@ static void adjust_tx_list(void) | |||
567 | if (current_tx_ptr->next->next == tx_list_head) { | 567 | if (current_tx_ptr->next->next == tx_list_head) { |
568 | while (tx_list_head->status.status_word == 0) { | 568 | while (tx_list_head->status.status_word == 0) { |
569 | udelay(10); | 569 | udelay(10); |
570 | if (tx_list_head->status.status_word != 0 | 570 | if (tx_list_head->status.status_word != 0 || |
571 | || !(bfin_read_DMA2_IRQ_STATUS() & DMA_RUN)) { | 571 | !(bfin_read_DMA2_IRQ_STATUS() & DMA_RUN)) { |
572 | goto adjust_head; | 572 | goto adjust_head; |
573 | } | 573 | } |
574 | if (timeout_cnt-- < 0) { | 574 | if (timeout_cnt-- < 0) { |
@@ -596,8 +596,8 @@ adjust_head: | |||
596 | ": no sk_buff in a transmitted frame!\n"); | 596 | ": no sk_buff in a transmitted frame!\n"); |
597 | } | 597 | } |
598 | tx_list_head = tx_list_head->next; | 598 | tx_list_head = tx_list_head->next; |
599 | } while (tx_list_head->status.status_word != 0 | 599 | } while (tx_list_head->status.status_word != 0 && |
600 | && current_tx_ptr != tx_list_head); | 600 | current_tx_ptr != tx_list_head); |
601 | return; | 601 | return; |
602 | 602 | ||
603 | } | 603 | } |
diff --git a/drivers/net/bmac.c b/drivers/net/bmac.c index 406f06424251..9b587c344194 100644 --- a/drivers/net/bmac.c +++ b/drivers/net/bmac.c | |||
@@ -438,8 +438,8 @@ bmac_init_phy(struct net_device *dev) | |||
438 | 438 | ||
439 | ctrl = bmac_mif_read(dev, 0); | 439 | ctrl = bmac_mif_read(dev, 0); |
440 | capable = ((bmac_mif_read(dev, 1) & 0xf800) >> 6) | 1; | 440 | capable = ((bmac_mif_read(dev, 1) & 0xf800) >> 6) | 1; |
441 | if (bmac_mif_read(dev, 4) != capable | 441 | if (bmac_mif_read(dev, 4) != capable || |
442 | || (ctrl & 0x1000) == 0) { | 442 | (ctrl & 0x1000) == 0) { |
443 | bmac_mif_write(dev, 4, capable); | 443 | bmac_mif_write(dev, 4, capable); |
444 | bmac_mif_write(dev, 0, 0x1200); | 444 | bmac_mif_write(dev, 0, 0x1200); |
445 | } else | 445 | } else |
diff --git a/drivers/net/bnx2x_link.c b/drivers/net/bnx2x_link.c index 41b9b7bd3d8e..cf5778919b4b 100644 --- a/drivers/net/bnx2x_link.c +++ b/drivers/net/bnx2x_link.c | |||
@@ -4717,8 +4717,8 @@ static u8 bnx2x_ext_phy_is_link_up(struct link_params *params, | |||
4717 | 0xc809, &val1); | 4717 | 0xc809, &val1); |
4718 | 4718 | ||
4719 | DP(NETIF_MSG_LINK, "8705 1.c809 val=0x%x\n", val1); | 4719 | DP(NETIF_MSG_LINK, "8705 1.c809 val=0x%x\n", val1); |
4720 | ext_phy_link_up = ((rx_sd & 0x1) && (val1 & (1<<9)) | 4720 | ext_phy_link_up = ((rx_sd & 0x1) && (val1 & (1<<9)) && |
4721 | && ((val1 & (1<<8)) == 0)); | 4721 | ((val1 & (1<<8)) == 0)); |
4722 | if (ext_phy_link_up) | 4722 | if (ext_phy_link_up) |
4723 | vars->line_speed = SPEED_10000; | 4723 | vars->line_speed = SPEED_10000; |
4724 | break; | 4724 | break; |
diff --git a/drivers/net/bonding/bond_3ad.c b/drivers/net/bonding/bond_3ad.c index 88c3fe80b355..d69e6838f21e 100644 --- a/drivers/net/bonding/bond_3ad.c +++ b/drivers/net/bonding/bond_3ad.c | |||
@@ -561,12 +561,12 @@ static void __update_selected(struct lacpdu *lacpdu, struct port *port) | |||
561 | const struct port_params *partner = &port->partner_oper; | 561 | const struct port_params *partner = &port->partner_oper; |
562 | 562 | ||
563 | // check if any parameter is different | 563 | // check if any parameter is different |
564 | if (ntohs(lacpdu->actor_port) != partner->port_number | 564 | if (ntohs(lacpdu->actor_port) != partner->port_number || |
565 | || ntohs(lacpdu->actor_port_priority) != partner->port_priority | 565 | ntohs(lacpdu->actor_port_priority) != partner->port_priority || |
566 | || MAC_ADDRESS_COMPARE(&lacpdu->actor_system, &partner->system) | 566 | MAC_ADDRESS_COMPARE(&lacpdu->actor_system, &partner->system) || |
567 | || ntohs(lacpdu->actor_system_priority) != partner->system_priority | 567 | ntohs(lacpdu->actor_system_priority) != partner->system_priority || |
568 | || ntohs(lacpdu->actor_key) != partner->key | 568 | ntohs(lacpdu->actor_key) != partner->key || |
569 | || (lacpdu->actor_state & AD_STATE_AGGREGATION) != (partner->port_state & AD_STATE_AGGREGATION)) { | 569 | (lacpdu->actor_state & AD_STATE_AGGREGATION) != (partner->port_state & AD_STATE_AGGREGATION)) { |
570 | // update the state machine Selected variable | 570 | // update the state machine Selected variable |
571 | port->sm_vars &= ~AD_PORT_SELECTED; | 571 | port->sm_vars &= ~AD_PORT_SELECTED; |
572 | } | 572 | } |
@@ -592,12 +592,12 @@ static void __update_default_selected(struct port *port) | |||
592 | const struct port_params *oper = &port->partner_oper; | 592 | const struct port_params *oper = &port->partner_oper; |
593 | 593 | ||
594 | // check if any parameter is different | 594 | // check if any parameter is different |
595 | if (admin->port_number != oper->port_number | 595 | if (admin->port_number != oper->port_number || |
596 | || admin->port_priority != oper->port_priority | 596 | admin->port_priority != oper->port_priority || |
597 | || MAC_ADDRESS_COMPARE(&admin->system, &oper->system) | 597 | MAC_ADDRESS_COMPARE(&admin->system, &oper->system) || |
598 | || admin->system_priority != oper->system_priority | 598 | admin->system_priority != oper->system_priority || |
599 | || admin->key != oper->key | 599 | admin->key != oper->key || |
600 | || (admin->port_state & AD_STATE_AGGREGATION) | 600 | (admin->port_state & AD_STATE_AGGREGATION) |
601 | != (oper->port_state & AD_STATE_AGGREGATION)) { | 601 | != (oper->port_state & AD_STATE_AGGREGATION)) { |
602 | // update the state machine Selected variable | 602 | // update the state machine Selected variable |
603 | port->sm_vars &= ~AD_PORT_SELECTED; | 603 | port->sm_vars &= ~AD_PORT_SELECTED; |
diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c index ac3fe20abf8f..af9b9c4eb496 100644 --- a/drivers/net/bonding/bond_main.c +++ b/drivers/net/bonding/bond_main.c | |||
@@ -1852,8 +1852,8 @@ int bond_release(struct net_device *bond_dev, struct net_device *slave_dev) | |||
1852 | } | 1852 | } |
1853 | 1853 | ||
1854 | if (!bond->params.fail_over_mac) { | 1854 | if (!bond->params.fail_over_mac) { |
1855 | if (!compare_ether_addr(bond_dev->dev_addr, slave->perm_hwaddr) | 1855 | if (!compare_ether_addr(bond_dev->dev_addr, slave->perm_hwaddr) && |
1856 | && bond->slave_cnt > 1) | 1856 | bond->slave_cnt > 1) |
1857 | pr_warning(DRV_NAME | 1857 | pr_warning(DRV_NAME |
1858 | ": %s: Warning: the permanent HWaddr of %s - " | 1858 | ": %s: Warning: the permanent HWaddr of %s - " |
1859 | "%pM - is still in use by %s. " | 1859 | "%pM - is still in use by %s. " |
diff --git a/drivers/net/bonding/bonding.h b/drivers/net/bonding/bonding.h index a51ae7dc8d51..558ec1352527 100644 --- a/drivers/net/bonding/bonding.h +++ b/drivers/net/bonding/bonding.h | |||
@@ -254,8 +254,8 @@ static inline struct bonding *bond_get_bond_by_slave(struct slave *slave) | |||
254 | 254 | ||
255 | static inline bool bond_is_lb(const struct bonding *bond) | 255 | static inline bool bond_is_lb(const struct bonding *bond) |
256 | { | 256 | { |
257 | return bond->params.mode == BOND_MODE_TLB | 257 | return (bond->params.mode == BOND_MODE_TLB || |
258 | || bond->params.mode == BOND_MODE_ALB; | 258 | bond->params.mode == BOND_MODE_ALB); |
259 | } | 259 | } |
260 | 260 | ||
261 | #define BOND_PRI_RESELECT_ALWAYS 0 | 261 | #define BOND_PRI_RESELECT_ALWAYS 0 |
diff --git a/drivers/net/can/usb/ems_usb.c b/drivers/net/can/usb/ems_usb.c index 3e4419054c81..591eb0eb1c2b 100644 --- a/drivers/net/can/usb/ems_usb.c +++ b/drivers/net/can/usb/ems_usb.c | |||
@@ -318,12 +318,12 @@ static void ems_usb_rx_can_msg(struct ems_usb *dev, struct ems_cpc_msg *msg) | |||
318 | cf->can_id = le32_to_cpu(msg->msg.can_msg.id); | 318 | cf->can_id = le32_to_cpu(msg->msg.can_msg.id); |
319 | cf->can_dlc = min_t(u8, msg->msg.can_msg.length, 8); | 319 | cf->can_dlc = min_t(u8, msg->msg.can_msg.length, 8); |
320 | 320 | ||
321 | if (msg->type == CPC_MSG_TYPE_EXT_CAN_FRAME | 321 | if (msg->type == CPC_MSG_TYPE_EXT_CAN_FRAME || |
322 | || msg->type == CPC_MSG_TYPE_EXT_RTR_FRAME) | 322 | msg->type == CPC_MSG_TYPE_EXT_RTR_FRAME) |
323 | cf->can_id |= CAN_EFF_FLAG; | 323 | cf->can_id |= CAN_EFF_FLAG; |
324 | 324 | ||
325 | if (msg->type == CPC_MSG_TYPE_RTR_FRAME | 325 | if (msg->type == CPC_MSG_TYPE_RTR_FRAME || |
326 | || msg->type == CPC_MSG_TYPE_EXT_RTR_FRAME) { | 326 | msg->type == CPC_MSG_TYPE_EXT_RTR_FRAME) { |
327 | cf->can_id |= CAN_RTR_FLAG; | 327 | cf->can_id |= CAN_RTR_FLAG; |
328 | } else { | 328 | } else { |
329 | for (i = 0; i < cf->can_dlc; i++) | 329 | for (i = 0; i < cf->can_dlc; i++) |
diff --git a/drivers/net/cxgb3/cxgb3_main.c b/drivers/net/cxgb3/cxgb3_main.c index b1a5a00a78cd..cef3f882e2b6 100644 --- a/drivers/net/cxgb3/cxgb3_main.c +++ b/drivers/net/cxgb3/cxgb3_main.c | |||
@@ -2117,19 +2117,19 @@ static int cxgb_extension_ioctl(struct net_device *dev, void __user *useraddr) | |||
2117 | if (t.qset_idx >= SGE_QSETS) | 2117 | if (t.qset_idx >= SGE_QSETS) |
2118 | return -EINVAL; | 2118 | return -EINVAL; |
2119 | if (!in_range(t.intr_lat, 0, M_NEWTIMER) || | 2119 | if (!in_range(t.intr_lat, 0, M_NEWTIMER) || |
2120 | !in_range(t.cong_thres, 0, 255) || | 2120 | !in_range(t.cong_thres, 0, 255) || |
2121 | !in_range(t.txq_size[0], MIN_TXQ_ENTRIES, | 2121 | !in_range(t.txq_size[0], MIN_TXQ_ENTRIES, |
2122 | MAX_TXQ_ENTRIES) || | 2122 | MAX_TXQ_ENTRIES) || |
2123 | !in_range(t.txq_size[1], MIN_TXQ_ENTRIES, | 2123 | !in_range(t.txq_size[1], MIN_TXQ_ENTRIES, |
2124 | MAX_TXQ_ENTRIES) || | 2124 | MAX_TXQ_ENTRIES) || |
2125 | !in_range(t.txq_size[2], MIN_CTRL_TXQ_ENTRIES, | 2125 | !in_range(t.txq_size[2], MIN_CTRL_TXQ_ENTRIES, |
2126 | MAX_CTRL_TXQ_ENTRIES) || | 2126 | MAX_CTRL_TXQ_ENTRIES) || |
2127 | !in_range(t.fl_size[0], MIN_FL_ENTRIES, | 2127 | !in_range(t.fl_size[0], MIN_FL_ENTRIES, |
2128 | MAX_RX_BUFFERS) | 2128 | MAX_RX_BUFFERS) || |
2129 | || !in_range(t.fl_size[1], MIN_FL_ENTRIES, | 2129 | !in_range(t.fl_size[1], MIN_FL_ENTRIES, |
2130 | MAX_RX_JUMBO_BUFFERS) | 2130 | MAX_RX_JUMBO_BUFFERS) || |
2131 | || !in_range(t.rspq_size, MIN_RSPQ_ENTRIES, | 2131 | !in_range(t.rspq_size, MIN_RSPQ_ENTRIES, |
2132 | MAX_RSPQ_ENTRIES)) | 2132 | MAX_RSPQ_ENTRIES)) |
2133 | return -EINVAL; | 2133 | return -EINVAL; |
2134 | 2134 | ||
2135 | if ((adapter->flags & FULL_INIT_DONE) && t.lro > 0) | 2135 | if ((adapter->flags & FULL_INIT_DONE) && t.lro > 0) |
diff --git a/drivers/net/dl2k.c b/drivers/net/dl2k.c index a2f1860fdd16..2a8b6a7c0b87 100644 --- a/drivers/net/dl2k.c +++ b/drivers/net/dl2k.c | |||
@@ -163,8 +163,8 @@ rio_probe1 (struct pci_dev *pdev, const struct pci_device_id *ent) | |||
163 | strcmp (media[card_idx], "4") == 0) { | 163 | strcmp (media[card_idx], "4") == 0) { |
164 | np->speed = 100; | 164 | np->speed = 100; |
165 | np->full_duplex = 1; | 165 | np->full_duplex = 1; |
166 | } else if (strcmp (media[card_idx], "100mbps_hd") == 0 | 166 | } else if (strcmp (media[card_idx], "100mbps_hd") == 0 || |
167 | || strcmp (media[card_idx], "3") == 0) { | 167 | strcmp (media[card_idx], "3") == 0) { |
168 | np->speed = 100; | 168 | np->speed = 100; |
169 | np->full_duplex = 0; | 169 | np->full_duplex = 0; |
170 | } else if (strcmp (media[card_idx], "10mbps_fd") == 0 || | 170 | } else if (strcmp (media[card_idx], "10mbps_fd") == 0 || |
diff --git a/drivers/net/dm9000.c b/drivers/net/dm9000.c index 81590fbb9943..0cbe3c0e7c06 100644 --- a/drivers/net/dm9000.c +++ b/drivers/net/dm9000.c | |||
@@ -1024,8 +1024,8 @@ dm9000_rx(struct net_device *dev) | |||
1024 | } | 1024 | } |
1025 | 1025 | ||
1026 | /* Move data from DM9000 */ | 1026 | /* Move data from DM9000 */ |
1027 | if (GoodPacket | 1027 | if (GoodPacket && |
1028 | && ((skb = dev_alloc_skb(RxLen + 4)) != NULL)) { | 1028 | ((skb = dev_alloc_skb(RxLen + 4)) != NULL)) { |
1029 | skb_reserve(skb, 2); | 1029 | skb_reserve(skb, 2); |
1030 | rdptr = (u8 *) skb_put(skb, RxLen - 4); | 1030 | rdptr = (u8 *) skb_put(skb, RxLen - 4); |
1031 | 1031 | ||
diff --git a/drivers/net/e1000/e1000_main.c b/drivers/net/e1000/e1000_main.c index b9d86f8b3fdb..7e855f9bbd97 100644 --- a/drivers/net/e1000/e1000_main.c +++ b/drivers/net/e1000/e1000_main.c | |||
@@ -3507,8 +3507,8 @@ static bool e1000_clean_tx_irq(struct e1000_adapter *adapter, | |||
3507 | adapter->detect_tx_hung = false; | 3507 | adapter->detect_tx_hung = false; |
3508 | if (tx_ring->buffer_info[eop].time_stamp && | 3508 | if (tx_ring->buffer_info[eop].time_stamp && |
3509 | time_after(jiffies, tx_ring->buffer_info[eop].time_stamp + | 3509 | time_after(jiffies, tx_ring->buffer_info[eop].time_stamp + |
3510 | (adapter->tx_timeout_factor * HZ)) | 3510 | (adapter->tx_timeout_factor * HZ)) && |
3511 | && !(er32(STATUS) & E1000_STATUS_TXOFF)) { | 3511 | !(er32(STATUS) & E1000_STATUS_TXOFF)) { |
3512 | 3512 | ||
3513 | /* detected Tx unit hang */ | 3513 | /* detected Tx unit hang */ |
3514 | DPRINTK(DRV, ERR, "Detected Tx Unit Hang\n" | 3514 | DPRINTK(DRV, ERR, "Detected Tx Unit Hang\n" |
diff --git a/drivers/net/e1000e/netdev.c b/drivers/net/e1000e/netdev.c index 941c5f9d0dd9..c3105c5087e0 100644 --- a/drivers/net/e1000e/netdev.c +++ b/drivers/net/e1000e/netdev.c | |||
@@ -679,8 +679,8 @@ static bool e1000_clean_tx_irq(struct e1000_adapter *adapter) | |||
679 | adapter->detect_tx_hung = 0; | 679 | adapter->detect_tx_hung = 0; |
680 | if (tx_ring->buffer_info[i].time_stamp && | 680 | if (tx_ring->buffer_info[i].time_stamp && |
681 | time_after(jiffies, tx_ring->buffer_info[i].time_stamp | 681 | time_after(jiffies, tx_ring->buffer_info[i].time_stamp |
682 | + (adapter->tx_timeout_factor * HZ)) | 682 | + (adapter->tx_timeout_factor * HZ)) && |
683 | && !(er32(STATUS) & E1000_STATUS_TXOFF)) { | 683 | !(er32(STATUS) & E1000_STATUS_TXOFF)) { |
684 | schedule_work(&adapter->print_hang_task); | 684 | schedule_work(&adapter->print_hang_task); |
685 | netif_stop_queue(netdev); | 685 | netif_stop_queue(netdev); |
686 | } | 686 | } |
@@ -4046,8 +4046,8 @@ static int e1000_transfer_dhcp_info(struct e1000_adapter *adapter, | |||
4046 | u16 length, offset; | 4046 | u16 length, offset; |
4047 | 4047 | ||
4048 | if (vlan_tx_tag_present(skb)) { | 4048 | if (vlan_tx_tag_present(skb)) { |
4049 | if (!((vlan_tx_tag_get(skb) == adapter->hw.mng_cookie.vlan_id) | 4049 | if (!((vlan_tx_tag_get(skb) == adapter->hw.mng_cookie.vlan_id) && |
4050 | && (adapter->hw.mng_cookie.status & | 4050 | (adapter->hw.mng_cookie.status & |
4051 | E1000_MNG_DHCP_COOKIE_STATUS_VLAN))) | 4051 | E1000_MNG_DHCP_COOKIE_STATUS_VLAN))) |
4052 | return 0; | 4052 | return 0; |
4053 | } | 4053 | } |
diff --git a/drivers/net/e2100.c b/drivers/net/e2100.c index d2f6ee1a6290..ca93c9a9d372 100644 --- a/drivers/net/e2100.c +++ b/drivers/net/e2100.c | |||
@@ -186,9 +186,9 @@ static int __init e21_probe1(struct net_device *dev, int ioaddr) | |||
186 | return -EBUSY; | 186 | return -EBUSY; |
187 | 187 | ||
188 | /* First check the station address for the Ctron prefix. */ | 188 | /* First check the station address for the Ctron prefix. */ |
189 | if (inb(ioaddr + E21_SAPROM + 0) != 0x00 | 189 | if (inb(ioaddr + E21_SAPROM + 0) != 0x00 || |
190 | || inb(ioaddr + E21_SAPROM + 1) != 0x00 | 190 | inb(ioaddr + E21_SAPROM + 1) != 0x00 || |
191 | || inb(ioaddr + E21_SAPROM + 2) != 0x1d) { | 191 | inb(ioaddr + E21_SAPROM + 2) != 0x1d) { |
192 | retval = -ENODEV; | 192 | retval = -ENODEV; |
193 | goto out; | 193 | goto out; |
194 | } | 194 | } |
diff --git a/drivers/net/ehea/ehea_main.c b/drivers/net/ehea/ehea_main.c index 7f8fcc2fa748..7b62336e6736 100644 --- a/drivers/net/ehea/ehea_main.c +++ b/drivers/net/ehea/ehea_main.c | |||
@@ -189,8 +189,8 @@ static void ehea_update_firmware_handles(void) | |||
189 | for (k = 0; k < EHEA_MAX_PORTS; k++) { | 189 | for (k = 0; k < EHEA_MAX_PORTS; k++) { |
190 | struct ehea_port *port = adapter->port[k]; | 190 | struct ehea_port *port = adapter->port[k]; |
191 | 191 | ||
192 | if (!port || (port->state != EHEA_PORT_UP) | 192 | if (!port || (port->state != EHEA_PORT_UP) || |
193 | || (num_ports == 0)) | 193 | (num_ports == 0)) |
194 | continue; | 194 | continue; |
195 | 195 | ||
196 | for (l = 0; | 196 | for (l = 0; |
@@ -657,8 +657,8 @@ static int get_skb_hdr(struct sk_buff *skb, void **iphdr, | |||
657 | static void ehea_proc_skb(struct ehea_port_res *pr, struct ehea_cqe *cqe, | 657 | static void ehea_proc_skb(struct ehea_port_res *pr, struct ehea_cqe *cqe, |
658 | struct sk_buff *skb) | 658 | struct sk_buff *skb) |
659 | { | 659 | { |
660 | int vlan_extracted = (cqe->status & EHEA_CQE_VLAN_TAG_XTRACT) | 660 | int vlan_extracted = ((cqe->status & EHEA_CQE_VLAN_TAG_XTRACT) && |
661 | && pr->port->vgrp; | 661 | pr->port->vgrp); |
662 | 662 | ||
663 | if (use_lro) { | 663 | if (use_lro) { |
664 | if (vlan_extracted) | 664 | if (vlan_extracted) |
@@ -1389,8 +1389,8 @@ out: | |||
1389 | 1389 | ||
1390 | int ehea_rem_smrs(struct ehea_port_res *pr) | 1390 | int ehea_rem_smrs(struct ehea_port_res *pr) |
1391 | { | 1391 | { |
1392 | if ((ehea_rem_mr(&pr->send_mr)) | 1392 | if ((ehea_rem_mr(&pr->send_mr)) || |
1393 | || (ehea_rem_mr(&pr->recv_mr))) | 1393 | (ehea_rem_mr(&pr->recv_mr))) |
1394 | return -EIO; | 1394 | return -EIO; |
1395 | else | 1395 | else |
1396 | return 0; | 1396 | return 0; |
@@ -2031,8 +2031,8 @@ static void ehea_xmit2(struct sk_buff *skb, struct net_device *dev, | |||
2031 | write_ip_start_end(swqe, skb); | 2031 | write_ip_start_end(swqe, skb); |
2032 | 2032 | ||
2033 | if (iph->protocol == IPPROTO_UDP) { | 2033 | if (iph->protocol == IPPROTO_UDP) { |
2034 | if ((iph->frag_off & IP_MF) | 2034 | if ((iph->frag_off & IP_MF) || |
2035 | || (iph->frag_off & IP_OFFSET)) | 2035 | (iph->frag_off & IP_OFFSET)) |
2036 | /* IP fragment, so don't change cs */ | 2036 | /* IP fragment, so don't change cs */ |
2037 | swqe->tx_control &= ~EHEA_SWQE_TCP_CHECKSUM; | 2037 | swqe->tx_control &= ~EHEA_SWQE_TCP_CHECKSUM; |
2038 | else | 2038 | else |
@@ -2077,8 +2077,8 @@ static void ehea_xmit3(struct sk_buff *skb, struct net_device *dev, | |||
2077 | write_tcp_offset_end(swqe, skb); | 2077 | write_tcp_offset_end(swqe, skb); |
2078 | 2078 | ||
2079 | } else if (iph->protocol == IPPROTO_UDP) { | 2079 | } else if (iph->protocol == IPPROTO_UDP) { |
2080 | if ((iph->frag_off & IP_MF) | 2080 | if ((iph->frag_off & IP_MF) || |
2081 | || (iph->frag_off & IP_OFFSET)) | 2081 | (iph->frag_off & IP_OFFSET)) |
2082 | /* IP fragment, so don't change cs */ | 2082 | /* IP fragment, so don't change cs */ |
2083 | swqe->tx_control |= EHEA_SWQE_CRC | 2083 | swqe->tx_control |= EHEA_SWQE_CRC |
2084 | | EHEA_SWQE_IMM_DATA_PRESENT; | 2084 | | EHEA_SWQE_IMM_DATA_PRESENT; |
diff --git a/drivers/net/ehea/ehea_qmr.c b/drivers/net/ehea/ehea_qmr.c index bc7c5b7abb88..18d405f78c0f 100644 --- a/drivers/net/ehea/ehea_qmr.c +++ b/drivers/net/ehea/ehea_qmr.c | |||
@@ -837,8 +837,8 @@ static u64 ehea_reg_mr_section(int top, int dir, int idx, u64 *pt, | |||
837 | hret = ehea_h_register_rpage_mr(adapter->handle, mr->handle, 0, | 837 | hret = ehea_h_register_rpage_mr(adapter->handle, mr->handle, 0, |
838 | 0, pt_abs, EHEA_MAX_RPAGE); | 838 | 0, pt_abs, EHEA_MAX_RPAGE); |
839 | 839 | ||
840 | if ((hret != H_SUCCESS) | 840 | if ((hret != H_SUCCESS) && |
841 | && (hret != H_PAGE_REGISTERED)) { | 841 | (hret != H_PAGE_REGISTERED)) { |
842 | ehea_h_free_resource(adapter->handle, mr->handle, | 842 | ehea_h_free_resource(adapter->handle, mr->handle, |
843 | FORCE_FREE); | 843 | FORCE_FREE); |
844 | ehea_error("register_rpage_mr failed"); | 844 | ehea_error("register_rpage_mr failed"); |
diff --git a/drivers/net/epic100.c b/drivers/net/epic100.c index 703b4c8e9b4d..41494f7b2ec8 100644 --- a/drivers/net/epic100.c +++ b/drivers/net/epic100.c | |||
@@ -630,8 +630,8 @@ static int mdio_read(struct net_device *dev, int phy_id, int location) | |||
630 | barrier(); | 630 | barrier(); |
631 | if ((inl(ioaddr + MIICtrl) & MII_READOP) == 0) { | 631 | if ((inl(ioaddr + MIICtrl) & MII_READOP) == 0) { |
632 | /* Work around read failure bug. */ | 632 | /* Work around read failure bug. */ |
633 | if (phy_id == 1 && location < 6 | 633 | if (phy_id == 1 && location < 6 && |
634 | && inw(ioaddr + MIIData) == 0xffff) { | 634 | inw(ioaddr + MIIData) == 0xffff) { |
635 | outl(read_cmd, ioaddr + MIICtrl); | 635 | outl(read_cmd, ioaddr + MIICtrl); |
636 | continue; | 636 | continue; |
637 | } | 637 | } |
@@ -1205,8 +1205,8 @@ static int epic_rx(struct net_device *dev, int budget) | |||
1205 | } | 1205 | } |
1206 | /* Check if the packet is long enough to accept without copying | 1206 | /* Check if the packet is long enough to accept without copying |
1207 | to a minimally-sized skbuff. */ | 1207 | to a minimally-sized skbuff. */ |
1208 | if (pkt_len < rx_copybreak | 1208 | if (pkt_len < rx_copybreak && |
1209 | && (skb = dev_alloc_skb(pkt_len + 2)) != NULL) { | 1209 | (skb = dev_alloc_skb(pkt_len + 2)) != NULL) { |
1210 | skb_reserve(skb, 2); /* 16 byte align the IP header */ | 1210 | skb_reserve(skb, 2); /* 16 byte align the IP header */ |
1211 | pci_dma_sync_single_for_cpu(ep->pci_dev, | 1211 | pci_dma_sync_single_for_cpu(ep->pci_dev, |
1212 | ep->rx_ring[entry].bufaddr, | 1212 | ep->rx_ring[entry].bufaddr, |
diff --git a/drivers/net/fealnx.c b/drivers/net/fealnx.c index e173515790c0..dac4e595589e 100644 --- a/drivers/net/fealnx.c +++ b/drivers/net/fealnx.c | |||
@@ -1629,8 +1629,8 @@ static int netdev_rx(struct net_device *dev) | |||
1629 | if (debug) | 1629 | if (debug) |
1630 | printk(KERN_DEBUG " netdev_rx() status was %8.8x.\n", rx_status); | 1630 | printk(KERN_DEBUG " netdev_rx() status was %8.8x.\n", rx_status); |
1631 | 1631 | ||
1632 | if ((!((rx_status & RXFSD) && (rx_status & RXLSD))) | 1632 | if ((!((rx_status & RXFSD) && (rx_status & RXLSD))) || |
1633 | || (rx_status & ErrorSummary)) { | 1633 | (rx_status & ErrorSummary)) { |
1634 | if (rx_status & ErrorSummary) { /* there was a fatal error */ | 1634 | if (rx_status & ErrorSummary) { /* there was a fatal error */ |
1635 | if (debug) | 1635 | if (debug) |
1636 | printk(KERN_DEBUG | 1636 | printk(KERN_DEBUG |
@@ -1655,8 +1655,8 @@ static int netdev_rx(struct net_device *dev) | |||
1655 | cur = np->cur_rx; | 1655 | cur = np->cur_rx; |
1656 | while (desno <= np->really_rx_count) { | 1656 | while (desno <= np->really_rx_count) { |
1657 | ++desno; | 1657 | ++desno; |
1658 | if ((!(cur->status & RXOWN)) | 1658 | if ((!(cur->status & RXOWN)) && |
1659 | && (cur->status & RXLSD)) | 1659 | (cur->status & RXLSD)) |
1660 | break; | 1660 | break; |
1661 | /* goto next rx descriptor */ | 1661 | /* goto next rx descriptor */ |
1662 | cur = cur->next_desc_logical; | 1662 | cur = cur->next_desc_logical; |
@@ -1786,8 +1786,8 @@ static void __set_rx_mode(struct net_device *dev) | |||
1786 | if (dev->flags & IFF_PROMISC) { /* Set promiscuous. */ | 1786 | if (dev->flags & IFF_PROMISC) { /* Set promiscuous. */ |
1787 | memset(mc_filter, 0xff, sizeof(mc_filter)); | 1787 | memset(mc_filter, 0xff, sizeof(mc_filter)); |
1788 | rx_mode = CR_W_PROM | CR_W_AB | CR_W_AM; | 1788 | rx_mode = CR_W_PROM | CR_W_AB | CR_W_AM; |
1789 | } else if ((dev->mc_count > multicast_filter_limit) | 1789 | } else if ((dev->mc_count > multicast_filter_limit) || |
1790 | || (dev->flags & IFF_ALLMULTI)) { | 1790 | (dev->flags & IFF_ALLMULTI)) { |
1791 | /* Too many to match, or accept all multicasts. */ | 1791 | /* Too many to match, or accept all multicasts. */ |
1792 | memset(mc_filter, 0xff, sizeof(mc_filter)); | 1792 | memset(mc_filter, 0xff, sizeof(mc_filter)); |
1793 | rx_mode = CR_W_AB | CR_W_AM; | 1793 | rx_mode = CR_W_AB | CR_W_AM; |
diff --git a/drivers/net/gianfar_sysfs.c b/drivers/net/gianfar_sysfs.c index b31c9c8876e6..b98c6c512299 100644 --- a/drivers/net/gianfar_sysfs.c +++ b/drivers/net/gianfar_sysfs.c | |||
@@ -62,8 +62,8 @@ static ssize_t gfar_set_bd_stash(struct device *dev, | |||
62 | /* Find out the new setting */ | 62 | /* Find out the new setting */ |
63 | if (!strncmp("on", buf, count - 1) || !strncmp("1", buf, count - 1)) | 63 | if (!strncmp("on", buf, count - 1) || !strncmp("1", buf, count - 1)) |
64 | new_setting = 1; | 64 | new_setting = 1; |
65 | else if (!strncmp("off", buf, count - 1) | 65 | else if (!strncmp("off", buf, count - 1) || |
66 | || !strncmp("0", buf, count - 1)) | 66 | !strncmp("0", buf, count - 1)) |
67 | new_setting = 0; | 67 | new_setting = 0; |
68 | else | 68 | else |
69 | return count; | 69 | return count; |
diff --git a/drivers/net/hamachi.c b/drivers/net/hamachi.c index 5d8c6333070e..ea85075a89a2 100644 --- a/drivers/net/hamachi.c +++ b/drivers/net/hamachi.c | |||
@@ -1566,8 +1566,8 @@ static int hamachi_rx(struct net_device *dev) | |||
1566 | #endif | 1566 | #endif |
1567 | /* Check if the packet is long enough to accept without copying | 1567 | /* Check if the packet is long enough to accept without copying |
1568 | to a minimally-sized skbuff. */ | 1568 | to a minimally-sized skbuff. */ |
1569 | if (pkt_len < rx_copybreak | 1569 | if (pkt_len < rx_copybreak && |
1570 | && (skb = dev_alloc_skb(pkt_len + 2)) != NULL) { | 1570 | (skb = dev_alloc_skb(pkt_len + 2)) != NULL) { |
1571 | #ifdef RX_CHECKSUM | 1571 | #ifdef RX_CHECKSUM |
1572 | printk(KERN_ERR "%s: rx_copybreak non-zero " | 1572 | printk(KERN_ERR "%s: rx_copybreak non-zero " |
1573 | "not good with RX_CHECKSUM\n", dev->name); | 1573 | "not good with RX_CHECKSUM\n", dev->name); |
@@ -1722,10 +1722,10 @@ static void hamachi_error(struct net_device *dev, int intr_status) | |||
1722 | readl(ioaddr + 0x370); | 1722 | readl(ioaddr + 0x370); |
1723 | readl(ioaddr + 0x3F0); | 1723 | readl(ioaddr + 0x3F0); |
1724 | } | 1724 | } |
1725 | if ((intr_status & ~(LinkChange|StatsMax|NegotiationChange|IntrRxDone|IntrTxDone)) | 1725 | if ((intr_status & ~(LinkChange|StatsMax|NegotiationChange|IntrRxDone|IntrTxDone)) && |
1726 | && hamachi_debug) | 1726 | hamachi_debug) |
1727 | printk(KERN_ERR "%s: Something Wicked happened! %4.4x.\n", | 1727 | printk(KERN_ERR "%s: Something Wicked happened! %4.4x.\n", |
1728 | dev->name, intr_status); | 1728 | dev->name, intr_status); |
1729 | /* Hmmmmm, it's not clear how to recover from PCI faults. */ | 1729 | /* Hmmmmm, it's not clear how to recover from PCI faults. */ |
1730 | if (intr_status & (IntrTxPCIErr | IntrTxPCIFault)) | 1730 | if (intr_status & (IntrTxPCIErr | IntrTxPCIFault)) |
1731 | hmp->stats.tx_fifo_errors++; | 1731 | hmp->stats.tx_fifo_errors++; |
diff --git a/drivers/net/hamradio/bpqether.c b/drivers/net/hamradio/bpqether.c index 76abed9a70b1..ae5f11c8fc13 100644 --- a/drivers/net/hamradio/bpqether.c +++ b/drivers/net/hamradio/bpqether.c | |||
@@ -167,10 +167,7 @@ static inline struct net_device *bpq_get_ax25_dev(struct net_device *dev) | |||
167 | 167 | ||
168 | static inline int dev_is_ethdev(struct net_device *dev) | 168 | static inline int dev_is_ethdev(struct net_device *dev) |
169 | { | 169 | { |
170 | return ( | 170 | return (dev->type == ARPHRD_ETHER && strncmp(dev->name, "dummy", 5)); |
171 | dev->type == ARPHRD_ETHER | ||
172 | && strncmp(dev->name, "dummy", 5) | ||
173 | ); | ||
174 | } | 171 | } |
175 | 172 | ||
176 | /* ------------------------------------------------------------------------ */ | 173 | /* ------------------------------------------------------------------------ */ |
diff --git a/drivers/net/hamradio/dmascc.c b/drivers/net/hamradio/dmascc.c index 950f3bb21f9d..9ee76b42668f 100644 --- a/drivers/net/hamradio/dmascc.c +++ b/drivers/net/hamradio/dmascc.c | |||
@@ -331,8 +331,8 @@ static int __init dmascc_init(void) | |||
331 | for (i = 0; i < MAX_NUM_DEVS && io[i]; i++) { | 331 | for (i = 0; i < MAX_NUM_DEVS && io[i]; i++) { |
332 | j = (io[i] - | 332 | j = (io[i] - |
333 | hw[h].io_region) / hw[h].io_delta; | 333 | hw[h].io_region) / hw[h].io_delta; |
334 | if (j >= 0 && j < hw[h].num_devs | 334 | if (j >= 0 && j < hw[h].num_devs && |
335 | && hw[h].io_region + | 335 | hw[h].io_region + |
336 | j * hw[h].io_delta == io[i]) { | 336 | j * hw[h].io_delta == io[i]) { |
337 | base[j] = io[i]; | 337 | base[j] = io[i]; |
338 | } | 338 | } |
@@ -396,8 +396,8 @@ static int __init dmascc_init(void) | |||
396 | t_val = | 396 | t_val = |
397 | inb(t1[i]) + (inb(t1[i]) << 8); | 397 | inb(t1[i]) + (inb(t1[i]) << 8); |
398 | /* Also check whether counter did wrap */ | 398 | /* Also check whether counter did wrap */ |
399 | if (t_val == 0 | 399 | if (t_val == 0 || |
400 | || t_val > TMR_0_HZ / HZ * 10) | 400 | t_val > TMR_0_HZ / HZ * 10) |
401 | counting[i] = 0; | 401 | counting[i] = 0; |
402 | delay[i] = jiffies - start[i]; | 402 | delay[i] = jiffies - start[i]; |
403 | } | 403 | } |
diff --git a/drivers/net/hp-plus.c b/drivers/net/hp-plus.c index 0486cbe01adb..efdbcad63c67 100644 --- a/drivers/net/hp-plus.c +++ b/drivers/net/hp-plus.c | |||
@@ -187,8 +187,8 @@ static int __init hpp_probe1(struct net_device *dev, int ioaddr) | |||
187 | return -EBUSY; | 187 | return -EBUSY; |
188 | 188 | ||
189 | /* Check for the HP+ signature, 50 48 0x 53. */ | 189 | /* Check for the HP+ signature, 50 48 0x 53. */ |
190 | if (inw(ioaddr + HP_ID) != 0x4850 | 190 | if (inw(ioaddr + HP_ID) != 0x4850 || |
191 | || (inw(ioaddr + HP_PAGING) & 0xfff0) != 0x5300) { | 191 | (inw(ioaddr + HP_PAGING) & 0xfff0) != 0x5300) { |
192 | retval = -ENODEV; | 192 | retval = -ENODEV; |
193 | goto out; | 193 | goto out; |
194 | } | 194 | } |
diff --git a/drivers/net/hp100.c b/drivers/net/hp100.c index dd8665138062..90f890e7c5e1 100644 --- a/drivers/net/hp100.c +++ b/drivers/net/hp100.c | |||
@@ -993,8 +993,8 @@ static void hp100_mmuinit(struct net_device *dev) | |||
993 | if (lp->mode == 1) { /* only needed for Busmaster */ | 993 | if (lp->mode == 1) { /* only needed for Busmaster */ |
994 | int xmit_stop, recv_stop; | 994 | int xmit_stop, recv_stop; |
995 | 995 | ||
996 | if ((lp->chip == HP100_CHIPID_RAINIER) | 996 | if ((lp->chip == HP100_CHIPID_RAINIER) || |
997 | || (lp->chip == HP100_CHIPID_SHASTA)) { | 997 | (lp->chip == HP100_CHIPID_SHASTA)) { |
998 | int pdl_stop; | 998 | int pdl_stop; |
999 | 999 | ||
1000 | /* | 1000 | /* |
diff --git a/drivers/net/ibm_newemac/core.c b/drivers/net/ibm_newemac/core.c index af117c626e73..fb5e019169ee 100644 --- a/drivers/net/ibm_newemac/core.c +++ b/drivers/net/ibm_newemac/core.c | |||
@@ -1976,27 +1976,27 @@ static int emac_ethtool_set_settings(struct net_device *ndev, | |||
1976 | if (cmd->autoneg == AUTONEG_DISABLE) { | 1976 | if (cmd->autoneg == AUTONEG_DISABLE) { |
1977 | switch (cmd->speed) { | 1977 | switch (cmd->speed) { |
1978 | case SPEED_10: | 1978 | case SPEED_10: |
1979 | if (cmd->duplex == DUPLEX_HALF | 1979 | if (cmd->duplex == DUPLEX_HALF && |
1980 | && !(f & SUPPORTED_10baseT_Half)) | 1980 | !(f & SUPPORTED_10baseT_Half)) |
1981 | return -EINVAL; | 1981 | return -EINVAL; |
1982 | if (cmd->duplex == DUPLEX_FULL | 1982 | if (cmd->duplex == DUPLEX_FULL && |
1983 | && !(f & SUPPORTED_10baseT_Full)) | 1983 | !(f & SUPPORTED_10baseT_Full)) |
1984 | return -EINVAL; | 1984 | return -EINVAL; |
1985 | break; | 1985 | break; |
1986 | case SPEED_100: | 1986 | case SPEED_100: |
1987 | if (cmd->duplex == DUPLEX_HALF | 1987 | if (cmd->duplex == DUPLEX_HALF && |
1988 | && !(f & SUPPORTED_100baseT_Half)) | 1988 | !(f & SUPPORTED_100baseT_Half)) |
1989 | return -EINVAL; | 1989 | return -EINVAL; |
1990 | if (cmd->duplex == DUPLEX_FULL | 1990 | if (cmd->duplex == DUPLEX_FULL && |
1991 | && !(f & SUPPORTED_100baseT_Full)) | 1991 | !(f & SUPPORTED_100baseT_Full)) |
1992 | return -EINVAL; | 1992 | return -EINVAL; |
1993 | break; | 1993 | break; |
1994 | case SPEED_1000: | 1994 | case SPEED_1000: |
1995 | if (cmd->duplex == DUPLEX_HALF | 1995 | if (cmd->duplex == DUPLEX_HALF && |
1996 | && !(f & SUPPORTED_1000baseT_Half)) | 1996 | !(f & SUPPORTED_1000baseT_Half)) |
1997 | return -EINVAL; | 1997 | return -EINVAL; |
1998 | if (cmd->duplex == DUPLEX_FULL | 1998 | if (cmd->duplex == DUPLEX_FULL && |
1999 | && !(f & SUPPORTED_1000baseT_Full)) | 1999 | !(f & SUPPORTED_1000baseT_Full)) |
2000 | return -EINVAL; | 2000 | return -EINVAL; |
2001 | break; | 2001 | break; |
2002 | default: | 2002 | default: |
diff --git a/drivers/net/igb/igb_main.c b/drivers/net/igb/igb_main.c index e57b32d3fde4..16349ba68736 100644 --- a/drivers/net/igb/igb_main.c +++ b/drivers/net/igb/igb_main.c | |||
@@ -4974,9 +4974,8 @@ static bool igb_clean_tx_irq(struct igb_q_vector *q_vector) | |||
4974 | tx_ring->detect_tx_hung = false; | 4974 | tx_ring->detect_tx_hung = false; |
4975 | if (tx_ring->buffer_info[i].time_stamp && | 4975 | if (tx_ring->buffer_info[i].time_stamp && |
4976 | time_after(jiffies, tx_ring->buffer_info[i].time_stamp + | 4976 | time_after(jiffies, tx_ring->buffer_info[i].time_stamp + |
4977 | (adapter->tx_timeout_factor * HZ)) | 4977 | (adapter->tx_timeout_factor * HZ)) && |
4978 | && !(rd32(E1000_STATUS) & | 4978 | !(rd32(E1000_STATUS) & E1000_STATUS_TXOFF)) { |
4979 | E1000_STATUS_TXOFF)) { | ||
4980 | 4979 | ||
4981 | /* detected Tx unit hang */ | 4980 | /* detected Tx unit hang */ |
4982 | dev_err(&tx_ring->pdev->dev, | 4981 | dev_err(&tx_ring->pdev->dev, |
diff --git a/drivers/net/igbvf/netdev.c b/drivers/net/igbvf/netdev.c index cf26f92e3235..a127620dc653 100644 --- a/drivers/net/igbvf/netdev.c +++ b/drivers/net/igbvf/netdev.c | |||
@@ -827,8 +827,8 @@ static bool igbvf_clean_tx_irq(struct igbvf_ring *tx_ring) | |||
827 | adapter->detect_tx_hung = false; | 827 | adapter->detect_tx_hung = false; |
828 | if (tx_ring->buffer_info[i].time_stamp && | 828 | if (tx_ring->buffer_info[i].time_stamp && |
829 | time_after(jiffies, tx_ring->buffer_info[i].time_stamp + | 829 | time_after(jiffies, tx_ring->buffer_info[i].time_stamp + |
830 | (adapter->tx_timeout_factor * HZ)) | 830 | (adapter->tx_timeout_factor * HZ)) && |
831 | && !(er32(STATUS) & E1000_STATUS_TXOFF)) { | 831 | !(er32(STATUS) & E1000_STATUS_TXOFF)) { |
832 | 832 | ||
833 | tx_desc = IGBVF_TX_DESC_ADV(*tx_ring, i); | 833 | tx_desc = IGBVF_TX_DESC_ADV(*tx_ring, i); |
834 | /* detected Tx unit hang */ | 834 | /* detected Tx unit hang */ |
diff --git a/drivers/net/irda/irda-usb.c b/drivers/net/irda/irda-usb.c index ae6eab3e5eed..e8e33bb9d876 100644 --- a/drivers/net/irda/irda-usb.c +++ b/drivers/net/irda/irda-usb.c | |||
@@ -1124,11 +1124,11 @@ static int stir421x_patch_device(struct irda_usb_cb *self) | |||
1124 | * The actual image starts after the "STMP" keyword | 1124 | * The actual image starts after the "STMP" keyword |
1125 | * so forward to the firmware header tag | 1125 | * so forward to the firmware header tag |
1126 | */ | 1126 | */ |
1127 | for (i = 0; (fw->data[i] != STIR421X_PATCH_END_OF_HDR_TAG) | 1127 | for (i = 0; (fw->data[i] != STIR421X_PATCH_END_OF_HDR_TAG) && |
1128 | && (i < fw->size); i++) ; | 1128 | (i < fw->size); i++) ; |
1129 | /* here we check for the out of buffer case */ | 1129 | /* here we check for the out of buffer case */ |
1130 | if ((STIR421X_PATCH_END_OF_HDR_TAG == fw->data[i]) | 1130 | if ((STIR421X_PATCH_END_OF_HDR_TAG == fw->data[i]) && |
1131 | && (i < STIR421X_PATCH_CODE_OFFSET)) { | 1131 | (i < STIR421X_PATCH_CODE_OFFSET)) { |
1132 | if (!memcmp(fw->data + i + 1, STIR421X_PATCH_STMP_TAG, | 1132 | if (!memcmp(fw->data + i + 1, STIR421X_PATCH_STMP_TAG, |
1133 | sizeof(STIR421X_PATCH_STMP_TAG) - 1)) { | 1133 | sizeof(STIR421X_PATCH_STMP_TAG) - 1)) { |
1134 | 1134 | ||
diff --git a/drivers/net/irda/stir4200.c b/drivers/net/irda/stir4200.c index 528767dec9d7..e5698fa30a4f 100644 --- a/drivers/net/irda/stir4200.c +++ b/drivers/net/irda/stir4200.c | |||
@@ -612,16 +612,16 @@ static int fifo_txwait(struct stir_cb *stir, int space) | |||
612 | pr_debug("fifo status 0x%lx count %lu\n", status, count); | 612 | pr_debug("fifo status 0x%lx count %lu\n", status, count); |
613 | 613 | ||
614 | /* is fifo receiving already, or empty */ | 614 | /* is fifo receiving already, or empty */ |
615 | if (!(status & FIFOCTL_DIR) | 615 | if (!(status & FIFOCTL_DIR) || |
616 | || (status & FIFOCTL_EMPTY)) | 616 | (status & FIFOCTL_EMPTY)) |
617 | return 0; | 617 | return 0; |
618 | 618 | ||
619 | if (signal_pending(current)) | 619 | if (signal_pending(current)) |
620 | return -EINTR; | 620 | return -EINTR; |
621 | 621 | ||
622 | /* shutting down? */ | 622 | /* shutting down? */ |
623 | if (!netif_running(stir->netdev) | 623 | if (!netif_running(stir->netdev) || |
624 | || !netif_device_present(stir->netdev)) | 624 | !netif_device_present(stir->netdev)) |
625 | return -ESHUTDOWN; | 625 | return -ESHUTDOWN; |
626 | 626 | ||
627 | /* only waiting for some space */ | 627 | /* only waiting for some space */ |
@@ -776,8 +776,8 @@ static int stir_transmit_thread(void *arg) | |||
776 | } | 776 | } |
777 | 777 | ||
778 | /* nothing to send? start receiving */ | 778 | /* nothing to send? start receiving */ |
779 | if (!stir->receiving | 779 | if (!stir->receiving && |
780 | && irda_device_txqueue_empty(dev)) { | 780 | irda_device_txqueue_empty(dev)) { |
781 | /* Wait otherwise chip gets confused. */ | 781 | /* Wait otherwise chip gets confused. */ |
782 | if (fifo_txwait(stir, -1)) | 782 | if (fifo_txwait(stir, -1)) |
783 | break; | 783 | break; |
diff --git a/drivers/net/irda/via-ircc.c b/drivers/net/irda/via-ircc.c index a5ca71cec028..fddb4efd5453 100644 --- a/drivers/net/irda/via-ircc.c +++ b/drivers/net/irda/via-ircc.c | |||
@@ -1185,8 +1185,8 @@ F01_E */ | |||
1185 | * if frame size,data ptr,or skb ptr are wrong ,the get next | 1185 | * if frame size,data ptr,or skb ptr are wrong ,the get next |
1186 | * entry. | 1186 | * entry. |
1187 | */ | 1187 | */ |
1188 | if ((skb == NULL) || (skb->data == NULL) | 1188 | if ((skb == NULL) || (skb->data == NULL) || |
1189 | || (self->rx_buff.data == NULL) || (len < 6)) { | 1189 | (self->rx_buff.data == NULL) || (len < 6)) { |
1190 | self->netdev->stats.rx_dropped++; | 1190 | self->netdev->stats.rx_dropped++; |
1191 | return TRUE; | 1191 | return TRUE; |
1192 | } | 1192 | } |
@@ -1284,8 +1284,8 @@ static int RxTimerHandler(struct via_ircc_cb *self, int iobase) | |||
1284 | self->RetryCount++; | 1284 | self->RetryCount++; |
1285 | 1285 | ||
1286 | if ((self->RetryCount >= 1) || | 1286 | if ((self->RetryCount >= 1) || |
1287 | ((st_fifo->pending_bytes + 2048) > self->rx_buff.truesize) | 1287 | ((st_fifo->pending_bytes + 2048) > self->rx_buff.truesize) || |
1288 | || (st_fifo->len >= (MAX_RX_WINDOW))) { | 1288 | (st_fifo->len >= (MAX_RX_WINDOW))) { |
1289 | while (st_fifo->len > 0) { //upload frame | 1289 | while (st_fifo->len > 0) { //upload frame |
1290 | // Put this entry back in fifo | 1290 | // Put this entry back in fifo |
1291 | if (st_fifo->head > MAX_RX_WINDOW) | 1291 | if (st_fifo->head > MAX_RX_WINDOW) |
@@ -1300,8 +1300,8 @@ static int RxTimerHandler(struct via_ircc_cb *self, int iobase) | |||
1300 | * if frame size, data ptr, or skb ptr are wrong, | 1300 | * if frame size, data ptr, or skb ptr are wrong, |
1301 | * then get next entry. | 1301 | * then get next entry. |
1302 | */ | 1302 | */ |
1303 | if ((skb == NULL) || (skb->data == NULL) | 1303 | if ((skb == NULL) || (skb->data == NULL) || |
1304 | || (self->rx_buff.data == NULL) || (len < 6)) { | 1304 | (self->rx_buff.data == NULL) || (len < 6)) { |
1305 | self->netdev->stats.rx_dropped++; | 1305 | self->netdev->stats.rx_dropped++; |
1306 | continue; | 1306 | continue; |
1307 | } | 1307 | } |
@@ -1332,8 +1332,8 @@ static int RxTimerHandler(struct via_ircc_cb *self, int iobase) | |||
1332 | * if frame is receive complete at this routine ,then upload | 1332 | * if frame is receive complete at this routine ,then upload |
1333 | * frame. | 1333 | * frame. |
1334 | */ | 1334 | */ |
1335 | if ((GetRXStatus(iobase) & 0x10) | 1335 | if ((GetRXStatus(iobase) & 0x10) && |
1336 | && (RxCurCount(iobase, self) != self->RxLastCount)) { | 1336 | (RxCurCount(iobase, self) != self->RxLastCount)) { |
1337 | upload_rxdata(self, iobase); | 1337 | upload_rxdata(self, iobase); |
1338 | if (irda_device_txqueue_empty(self->netdev)) | 1338 | if (irda_device_txqueue_empty(self->netdev)) |
1339 | via_ircc_dma_receive(self); | 1339 | via_ircc_dma_receive(self); |
diff --git a/drivers/net/irda/vlsi_ir.c b/drivers/net/irda/vlsi_ir.c index 7cfb8b6593c6..bd3c6b5ee76a 100644 --- a/drivers/net/irda/vlsi_ir.c +++ b/drivers/net/irda/vlsi_ir.c | |||
@@ -431,8 +431,8 @@ static struct vlsi_ring *vlsi_alloc_ring(struct pci_dev *pdev, struct ring_descr | |||
431 | memset(rd, 0, sizeof(*rd)); | 431 | memset(rd, 0, sizeof(*rd)); |
432 | rd->hw = hwmap + i; | 432 | rd->hw = hwmap + i; |
433 | rd->buf = kmalloc(len, GFP_KERNEL|GFP_DMA); | 433 | rd->buf = kmalloc(len, GFP_KERNEL|GFP_DMA); |
434 | if (rd->buf == NULL | 434 | if (rd->buf == NULL || |
435 | || !(busaddr = pci_map_single(pdev, rd->buf, len, dir))) { | 435 | !(busaddr = pci_map_single(pdev, rd->buf, len, dir))) { |
436 | if (rd->buf) { | 436 | if (rd->buf) { |
437 | IRDA_ERROR("%s: failed to create PCI-MAP for %p", | 437 | IRDA_ERROR("%s: failed to create PCI-MAP for %p", |
438 | __func__, rd->buf); | 438 | __func__, rd->buf); |
@@ -955,8 +955,8 @@ static netdev_tx_t vlsi_hard_start_xmit(struct sk_buff *skb, | |||
955 | } | 955 | } |
956 | for(;;) { | 956 | for(;;) { |
957 | do_gettimeofday(&now); | 957 | do_gettimeofday(&now); |
958 | if (now.tv_sec > ready.tv_sec | 958 | if (now.tv_sec > ready.tv_sec || |
959 | || (now.tv_sec==ready.tv_sec && now.tv_usec>=ready.tv_usec)) | 959 | (now.tv_sec==ready.tv_sec && now.tv_usec>=ready.tv_usec)) |
960 | break; | 960 | break; |
961 | udelay(100); | 961 | udelay(100); |
962 | /* must not sleep here - called under netif_tx_lock! */ | 962 | /* must not sleep here - called under netif_tx_lock! */ |
@@ -1594,8 +1594,8 @@ static int vlsi_irda_init(struct net_device *ndev) | |||
1594 | * see include file for details why we need these 2 masks, in this order! | 1594 | * see include file for details why we need these 2 masks, in this order! |
1595 | */ | 1595 | */ |
1596 | 1596 | ||
1597 | if (pci_set_dma_mask(pdev,DMA_MASK_USED_BY_HW) | 1597 | if (pci_set_dma_mask(pdev,DMA_MASK_USED_BY_HW) || |
1598 | || pci_set_dma_mask(pdev,DMA_MASK_MSTRPAGE)) { | 1598 | pci_set_dma_mask(pdev,DMA_MASK_MSTRPAGE)) { |
1599 | IRDA_ERROR("%s: aborting due to PCI BM-DMA address limitations\n", __func__); | 1599 | IRDA_ERROR("%s: aborting due to PCI BM-DMA address limitations\n", __func__); |
1600 | return -1; | 1600 | return -1; |
1601 | } | 1601 | } |
@@ -1641,8 +1641,8 @@ vlsi_irda_probe(struct pci_dev *pdev, const struct pci_device_id *id) | |||
1641 | IRDA_MESSAGE("%s: IrDA PCI controller %s detected\n", | 1641 | IRDA_MESSAGE("%s: IrDA PCI controller %s detected\n", |
1642 | drivername, pci_name(pdev)); | 1642 | drivername, pci_name(pdev)); |
1643 | 1643 | ||
1644 | if ( !pci_resource_start(pdev,0) | 1644 | if ( !pci_resource_start(pdev,0) || |
1645 | || !(pci_resource_flags(pdev,0) & IORESOURCE_IO) ) { | 1645 | !(pci_resource_flags(pdev,0) & IORESOURCE_IO) ) { |
1646 | IRDA_ERROR("%s: bar 0 invalid", __func__); | 1646 | IRDA_ERROR("%s: bar 0 invalid", __func__); |
1647 | goto out_disable; | 1647 | goto out_disable; |
1648 | } | 1648 | } |
diff --git a/drivers/net/isa-skeleton.c b/drivers/net/isa-skeleton.c index 0e71e2a93160..04d0502726c0 100644 --- a/drivers/net/isa-skeleton.c +++ b/drivers/net/isa-skeleton.c | |||
@@ -214,9 +214,9 @@ static int __init netcard_probe1(struct net_device *dev, int ioaddr) | |||
214 | * contains the manufacturer's unique code. That might be a good probe | 214 | * contains the manufacturer's unique code. That might be a good probe |
215 | * method. Ideally you would add additional checks. | 215 | * method. Ideally you would add additional checks. |
216 | */ | 216 | */ |
217 | if (inb(ioaddr + 0) != SA_ADDR0 | 217 | if (inb(ioaddr + 0) != SA_ADDR0 || |
218 | || inb(ioaddr + 1) != SA_ADDR1 | 218 | inb(ioaddr + 1) != SA_ADDR1 || |
219 | || inb(ioaddr + 2) != SA_ADDR2) | 219 | inb(ioaddr + 2) != SA_ADDR2) |
220 | goto out; | 220 | goto out; |
221 | 221 | ||
222 | if (net_debug && version_printed++ == 0) | 222 | if (net_debug && version_printed++ == 0) |
diff --git a/drivers/net/iseries_veth.c b/drivers/net/iseries_veth.c index aa7286bc4364..49997194bdd0 100644 --- a/drivers/net/iseries_veth.c +++ b/drivers/net/iseries_veth.c | |||
@@ -604,10 +604,10 @@ static int veth_process_caps(struct veth_lpar_connection *cnx) | |||
604 | /* Convert timer to jiffies */ | 604 | /* Convert timer to jiffies */ |
605 | cnx->ack_timeout = remote_caps->ack_timeout * HZ / 1000000; | 605 | cnx->ack_timeout = remote_caps->ack_timeout * HZ / 1000000; |
606 | 606 | ||
607 | if ( (remote_caps->num_buffers == 0) | 607 | if ( (remote_caps->num_buffers == 0) || |
608 | || (remote_caps->ack_threshold > VETH_MAX_ACKS_PER_MSG) | 608 | (remote_caps->ack_threshold > VETH_MAX_ACKS_PER_MSG) || |
609 | || (remote_caps->ack_threshold == 0) | 609 | (remote_caps->ack_threshold == 0) || |
610 | || (cnx->ack_timeout == 0) ) { | 610 | (cnx->ack_timeout == 0) ) { |
611 | veth_error("Received incompatible capabilities from LPAR %d.\n", | 611 | veth_error("Received incompatible capabilities from LPAR %d.\n", |
612 | cnx->remote_lp); | 612 | cnx->remote_lp); |
613 | return HvLpEvent_Rc_InvalidSubtypeData; | 613 | return HvLpEvent_Rc_InvalidSubtypeData; |
@@ -714,8 +714,8 @@ static void veth_statemachine(struct work_struct *work) | |||
714 | cnx->state |= VETH_STATE_OPEN; | 714 | cnx->state |= VETH_STATE_OPEN; |
715 | } | 715 | } |
716 | 716 | ||
717 | if ( (cnx->state & VETH_STATE_OPEN) | 717 | if ( (cnx->state & VETH_STATE_OPEN) && |
718 | && !(cnx->state & VETH_STATE_SENTMON) ) { | 718 | !(cnx->state & VETH_STATE_SENTMON) ) { |
719 | rc = veth_signalevent(cnx, VETH_EVENT_MONITOR, | 719 | rc = veth_signalevent(cnx, VETH_EVENT_MONITOR, |
720 | HvLpEvent_AckInd_DoAck, | 720 | HvLpEvent_AckInd_DoAck, |
721 | HvLpEvent_AckType_DeferredAck, | 721 | HvLpEvent_AckType_DeferredAck, |
@@ -724,8 +724,8 @@ static void veth_statemachine(struct work_struct *work) | |||
724 | if (rc == HvLpEvent_Rc_Good) { | 724 | if (rc == HvLpEvent_Rc_Good) { |
725 | cnx->state |= VETH_STATE_SENTMON; | 725 | cnx->state |= VETH_STATE_SENTMON; |
726 | } else { | 726 | } else { |
727 | if ( (rc != HvLpEvent_Rc_PartitionDead) | 727 | if ( (rc != HvLpEvent_Rc_PartitionDead) && |
728 | && (rc != HvLpEvent_Rc_PathClosed) ) | 728 | (rc != HvLpEvent_Rc_PathClosed) ) |
729 | veth_error("Error sending monitor to LPAR %d, " | 729 | veth_error("Error sending monitor to LPAR %d, " |
730 | "rc = %d\n", rlp, rc); | 730 | "rc = %d\n", rlp, rc); |
731 | 731 | ||
@@ -735,8 +735,8 @@ static void veth_statemachine(struct work_struct *work) | |||
735 | } | 735 | } |
736 | } | 736 | } |
737 | 737 | ||
738 | if ( (cnx->state & VETH_STATE_OPEN) | 738 | if ( (cnx->state & VETH_STATE_OPEN) && |
739 | && !(cnx->state & VETH_STATE_SENTCAPS)) { | 739 | !(cnx->state & VETH_STATE_SENTCAPS)) { |
740 | u64 *rawcap = (u64 *)&cnx->local_caps; | 740 | u64 *rawcap = (u64 *)&cnx->local_caps; |
741 | 741 | ||
742 | rc = veth_signalevent(cnx, VETH_EVENT_CAP, | 742 | rc = veth_signalevent(cnx, VETH_EVENT_CAP, |
@@ -748,8 +748,8 @@ static void veth_statemachine(struct work_struct *work) | |||
748 | if (rc == HvLpEvent_Rc_Good) { | 748 | if (rc == HvLpEvent_Rc_Good) { |
749 | cnx->state |= VETH_STATE_SENTCAPS; | 749 | cnx->state |= VETH_STATE_SENTCAPS; |
750 | } else { | 750 | } else { |
751 | if ( (rc != HvLpEvent_Rc_PartitionDead) | 751 | if ( (rc != HvLpEvent_Rc_PartitionDead) && |
752 | && (rc != HvLpEvent_Rc_PathClosed) ) | 752 | (rc != HvLpEvent_Rc_PathClosed) ) |
753 | veth_error("Error sending caps to LPAR %d, " | 753 | veth_error("Error sending caps to LPAR %d, " |
754 | "rc = %d\n", rlp, rc); | 754 | "rc = %d\n", rlp, rc); |
755 | 755 | ||
@@ -759,8 +759,8 @@ static void veth_statemachine(struct work_struct *work) | |||
759 | } | 759 | } |
760 | } | 760 | } |
761 | 761 | ||
762 | if ((cnx->state & VETH_STATE_GOTCAPS) | 762 | if ((cnx->state & VETH_STATE_GOTCAPS) && |
763 | && !(cnx->state & VETH_STATE_SENTCAPACK)) { | 763 | !(cnx->state & VETH_STATE_SENTCAPACK)) { |
764 | struct veth_cap_data *remote_caps = &cnx->remote_caps; | 764 | struct veth_cap_data *remote_caps = &cnx->remote_caps; |
765 | 765 | ||
766 | memcpy(remote_caps, &cnx->cap_event.u.caps_data, | 766 | memcpy(remote_caps, &cnx->cap_event.u.caps_data, |
@@ -783,9 +783,9 @@ static void veth_statemachine(struct work_struct *work) | |||
783 | goto cant_cope; | 783 | goto cant_cope; |
784 | } | 784 | } |
785 | 785 | ||
786 | if ((cnx->state & VETH_STATE_GOTCAPACK) | 786 | if ((cnx->state & VETH_STATE_GOTCAPACK) && |
787 | && (cnx->state & VETH_STATE_GOTCAPS) | 787 | (cnx->state & VETH_STATE_GOTCAPS) && |
788 | && !(cnx->state & VETH_STATE_READY)) { | 788 | !(cnx->state & VETH_STATE_READY)) { |
789 | if (cnx->cap_ack_event.base_event.xRc == HvLpEvent_Rc_Good) { | 789 | if (cnx->cap_ack_event.base_event.xRc == HvLpEvent_Rc_Good) { |
790 | /* Start the ACK timer */ | 790 | /* Start the ACK timer */ |
791 | cnx->ack_timer.expires = jiffies + cnx->ack_timeout; | 791 | cnx->ack_timer.expires = jiffies + cnx->ack_timeout; |
@@ -818,8 +818,8 @@ static int veth_init_connection(u8 rlp) | |||
818 | struct veth_msg *msgs; | 818 | struct veth_msg *msgs; |
819 | int i; | 819 | int i; |
820 | 820 | ||
821 | if ( (rlp == this_lp) | 821 | if ( (rlp == this_lp) || |
822 | || ! HvLpConfig_doLpsCommunicateOnVirtualLan(this_lp, rlp) ) | 822 | ! HvLpConfig_doLpsCommunicateOnVirtualLan(this_lp, rlp) ) |
823 | return 0; | 823 | return 0; |
824 | 824 | ||
825 | cnx = kzalloc(sizeof(*cnx), GFP_KERNEL); | 825 | cnx = kzalloc(sizeof(*cnx), GFP_KERNEL); |
@@ -1538,8 +1538,8 @@ static void veth_receive(struct veth_lpar_connection *cnx, | |||
1538 | cnx->pending_acks[cnx->num_pending_acks++] = | 1538 | cnx->pending_acks[cnx->num_pending_acks++] = |
1539 | event->base_event.xCorrelationToken; | 1539 | event->base_event.xCorrelationToken; |
1540 | 1540 | ||
1541 | if ( (cnx->num_pending_acks >= cnx->remote_caps.ack_threshold) | 1541 | if ( (cnx->num_pending_acks >= cnx->remote_caps.ack_threshold) || |
1542 | || (cnx->num_pending_acks >= VETH_MAX_ACKS_PER_MSG) ) | 1542 | (cnx->num_pending_acks >= VETH_MAX_ACKS_PER_MSG) ) |
1543 | veth_flush_acks(cnx); | 1543 | veth_flush_acks(cnx); |
1544 | 1544 | ||
1545 | spin_unlock_irqrestore(&cnx->lock, flags); | 1545 | spin_unlock_irqrestore(&cnx->lock, flags); |
diff --git a/drivers/net/jazzsonic.c b/drivers/net/jazzsonic.c index 35d5bed450da..f47d4d663b19 100644 --- a/drivers/net/jazzsonic.c +++ b/drivers/net/jazzsonic.c | |||
@@ -130,8 +130,8 @@ static int __devinit sonic_probe1(struct net_device *dev) | |||
130 | printk("SONIC Silicon Revision = 0x%04x\n",silicon_revision); | 130 | printk("SONIC Silicon Revision = 0x%04x\n",silicon_revision); |
131 | 131 | ||
132 | i = 0; | 132 | i = 0; |
133 | while (known_revisions[i] != 0xffff | 133 | while (known_revisions[i] != 0xffff && |
134 | && known_revisions[i] != silicon_revision) | 134 | known_revisions[i] != silicon_revision) |
135 | i++; | 135 | i++; |
136 | 136 | ||
137 | if (known_revisions[i] == 0xffff) { | 137 | if (known_revisions[i] == 0xffff) { |
diff --git a/drivers/net/jme.c b/drivers/net/jme.c index 6c1b92fa0b0c..792b88fc3574 100644 --- a/drivers/net/jme.c +++ b/drivers/net/jme.c | |||
@@ -1050,8 +1050,8 @@ jme_dynamic_pcc(struct jme_adapter *jme) | |||
1050 | 1050 | ||
1051 | if ((NET_STAT(jme).rx_bytes - dpi->last_bytes) > PCC_P3_THRESHOLD) | 1051 | if ((NET_STAT(jme).rx_bytes - dpi->last_bytes) > PCC_P3_THRESHOLD) |
1052 | jme_attempt_pcc(dpi, PCC_P3); | 1052 | jme_attempt_pcc(dpi, PCC_P3); |
1053 | else if ((NET_STAT(jme).rx_packets - dpi->last_pkts) > PCC_P2_THRESHOLD | 1053 | else if ((NET_STAT(jme).rx_packets - dpi->last_pkts) > PCC_P2_THRESHOLD || |
1054 | || dpi->intr_cnt > PCC_INTR_THRESHOLD) | 1054 | dpi->intr_cnt > PCC_INTR_THRESHOLD) |
1055 | jme_attempt_pcc(dpi, PCC_P2); | 1055 | jme_attempt_pcc(dpi, PCC_P2); |
1056 | else | 1056 | else |
1057 | jme_attempt_pcc(dpi, PCC_P1); | 1057 | jme_attempt_pcc(dpi, PCC_P1); |
@@ -2199,8 +2199,8 @@ jme_set_coalesce(struct net_device *netdev, struct ethtool_coalesce *ecmd) | |||
2199 | if (netif_running(netdev)) | 2199 | if (netif_running(netdev)) |
2200 | return -EBUSY; | 2200 | return -EBUSY; |
2201 | 2201 | ||
2202 | if (ecmd->use_adaptive_rx_coalesce | 2202 | if (ecmd->use_adaptive_rx_coalesce && |
2203 | && test_bit(JME_FLAG_POLL, &jme->flags)) { | 2203 | test_bit(JME_FLAG_POLL, &jme->flags)) { |
2204 | clear_bit(JME_FLAG_POLL, &jme->flags); | 2204 | clear_bit(JME_FLAG_POLL, &jme->flags); |
2205 | jme->jme_rx = netif_rx; | 2205 | jme->jme_rx = netif_rx; |
2206 | jme->jme_vlan_rx = vlan_hwaccel_rx; | 2206 | jme->jme_vlan_rx = vlan_hwaccel_rx; |
@@ -2209,8 +2209,8 @@ jme_set_coalesce(struct net_device *netdev, struct ethtool_coalesce *ecmd) | |||
2209 | dpi->cnt = 0; | 2209 | dpi->cnt = 0; |
2210 | jme_set_rx_pcc(jme, PCC_P1); | 2210 | jme_set_rx_pcc(jme, PCC_P1); |
2211 | jme_interrupt_mode(jme); | 2211 | jme_interrupt_mode(jme); |
2212 | } else if (!(ecmd->use_adaptive_rx_coalesce) | 2212 | } else if (!(ecmd->use_adaptive_rx_coalesce) && |
2213 | && !(test_bit(JME_FLAG_POLL, &jme->flags))) { | 2213 | !(test_bit(JME_FLAG_POLL, &jme->flags))) { |
2214 | set_bit(JME_FLAG_POLL, &jme->flags); | 2214 | set_bit(JME_FLAG_POLL, &jme->flags); |
2215 | jme->jme_rx = netif_receive_skb; | 2215 | jme->jme_rx = netif_receive_skb; |
2216 | jme->jme_vlan_rx = vlan_hwaccel_receive_skb; | 2216 | jme->jme_vlan_rx = vlan_hwaccel_receive_skb; |
diff --git a/drivers/net/lance.c b/drivers/net/lance.c index 7b2c42992c35..8d7d3d4625f6 100644 --- a/drivers/net/lance.c +++ b/drivers/net/lance.c | |||
@@ -493,14 +493,14 @@ static int __init lance_probe1(struct net_device *dev, int ioaddr, int irq, int | |||
493 | static const short ioaddr_table[] = { 0x300, 0x320, 0x340, 0x360}; | 493 | static const short ioaddr_table[] = { 0x300, 0x320, 0x340, 0x360}; |
494 | int hp_port = (readl(bios + 1) & 1) ? 0x499 : 0x99; | 494 | int hp_port = (readl(bios + 1) & 1) ? 0x499 : 0x99; |
495 | /* We can have boards other than the built-in! Verify this is on-board. */ | 495 | /* We can have boards other than the built-in! Verify this is on-board. */ |
496 | if ((inb(hp_port) & 0xc0) == 0x80 | 496 | if ((inb(hp_port) & 0xc0) == 0x80 && |
497 | && ioaddr_table[inb(hp_port) & 3] == ioaddr) | 497 | ioaddr_table[inb(hp_port) & 3] == ioaddr) |
498 | hp_builtin = hp_port; | 498 | hp_builtin = hp_port; |
499 | } | 499 | } |
500 | iounmap(bios); | 500 | iounmap(bios); |
501 | /* We also recognize the HP Vectra on-board here, but check below. */ | 501 | /* We also recognize the HP Vectra on-board here, but check below. */ |
502 | hpJ2405A = (inb(ioaddr) == 0x08 && inb(ioaddr+1) == 0x00 | 502 | hpJ2405A = (inb(ioaddr) == 0x08 && inb(ioaddr+1) == 0x00 && |
503 | && inb(ioaddr+2) == 0x09); | 503 | inb(ioaddr+2) == 0x09); |
504 | 504 | ||
505 | /* Reset the LANCE. */ | 505 | /* Reset the LANCE. */ |
506 | reset_val = inw(ioaddr+LANCE_RESET); /* Reset the LANCE */ | 506 | reset_val = inw(ioaddr+LANCE_RESET); /* Reset the LANCE */ |
@@ -1035,8 +1035,8 @@ static irqreturn_t lance_interrupt(int irq, void *dev_id) | |||
1035 | spin_lock (&lp->devlock); | 1035 | spin_lock (&lp->devlock); |
1036 | 1036 | ||
1037 | outw(0x00, dev->base_addr + LANCE_ADDR); | 1037 | outw(0x00, dev->base_addr + LANCE_ADDR); |
1038 | while ((csr0 = inw(dev->base_addr + LANCE_DATA)) & 0x8600 | 1038 | while ((csr0 = inw(dev->base_addr + LANCE_DATA)) & 0x8600 && |
1039 | && --boguscnt >= 0) { | 1039 | --boguscnt >= 0) { |
1040 | /* Acknowledge all of the current interrupt sources ASAP. */ | 1040 | /* Acknowledge all of the current interrupt sources ASAP. */ |
1041 | outw(csr0 & ~0x004f, dev->base_addr + LANCE_DATA); | 1041 | outw(csr0 & ~0x004f, dev->base_addr + LANCE_DATA); |
1042 | 1042 | ||
diff --git a/drivers/net/lib8390.c b/drivers/net/lib8390.c index 256119882b1e..57f25848fe80 100644 --- a/drivers/net/lib8390.c +++ b/drivers/net/lib8390.c | |||
@@ -464,8 +464,8 @@ static irqreturn_t __ei_interrupt(int irq, void *dev_id) | |||
464 | ei_inb_p(e8390_base + EN0_ISR)); | 464 | ei_inb_p(e8390_base + EN0_ISR)); |
465 | 465 | ||
466 | /* !!Assumption!! -- we stay in page 0. Don't break this. */ | 466 | /* !!Assumption!! -- we stay in page 0. Don't break this. */ |
467 | while ((interrupts = ei_inb_p(e8390_base + EN0_ISR)) != 0 | 467 | while ((interrupts = ei_inb_p(e8390_base + EN0_ISR)) != 0 && |
468 | && ++nr_serviced < MAX_SERVICE) | 468 | ++nr_serviced < MAX_SERVICE) |
469 | { | 469 | { |
470 | if (!netif_running(dev)) { | 470 | if (!netif_running(dev)) { |
471 | printk(KERN_WARNING "%s: interrupt from stopped card\n", dev->name); | 471 | printk(KERN_WARNING "%s: interrupt from stopped card\n", dev->name); |
@@ -721,10 +721,10 @@ static void ei_receive(struct net_device *dev) | |||
721 | /* Check for bogosity warned by 3c503 book: the status byte is never | 721 | /* Check for bogosity warned by 3c503 book: the status byte is never |
722 | written. This happened a lot during testing! This code should be | 722 | written. This happened a lot during testing! This code should be |
723 | cleaned up someday. */ | 723 | cleaned up someday. */ |
724 | if (rx_frame.next != next_frame | 724 | if (rx_frame.next != next_frame && |
725 | && rx_frame.next != next_frame + 1 | 725 | rx_frame.next != next_frame + 1 && |
726 | && rx_frame.next != next_frame - num_rx_pages | 726 | rx_frame.next != next_frame - num_rx_pages && |
727 | && rx_frame.next != next_frame + 1 - num_rx_pages) { | 727 | rx_frame.next != next_frame + 1 - num_rx_pages) { |
728 | ei_local->current_page = rxing_page; | 728 | ei_local->current_page = rxing_page; |
729 | ei_outb(ei_local->current_page-1, e8390_base+EN0_BOUNDARY); | 729 | ei_outb(ei_local->current_page-1, e8390_base+EN0_BOUNDARY); |
730 | dev->stats.rx_errors++; | 730 | dev->stats.rx_errors++; |
diff --git a/drivers/net/ll_temac_main.c b/drivers/net/ll_temac_main.c index f2a197fd47a5..336e7c7a9275 100644 --- a/drivers/net/ll_temac_main.c +++ b/drivers/net/ll_temac_main.c | |||
@@ -231,8 +231,8 @@ static void temac_set_multicast_list(struct net_device *ndev) | |||
231 | int i; | 231 | int i; |
232 | 232 | ||
233 | mutex_lock(&lp->indirect_mutex); | 233 | mutex_lock(&lp->indirect_mutex); |
234 | if (ndev->flags & (IFF_ALLMULTI | IFF_PROMISC) | 234 | if (ndev->flags & (IFF_ALLMULTI | IFF_PROMISC) || |
235 | || ndev->mc_count > MULTICAST_CAM_TABLE_NUM) { | 235 | ndev->mc_count > MULTICAST_CAM_TABLE_NUM) { |
236 | /* | 236 | /* |
237 | * We must make the kernel realise we had to move | 237 | * We must make the kernel realise we had to move |
238 | * into promisc mode or we start all out war on | 238 | * into promisc mode or we start all out war on |
diff --git a/drivers/net/mac89x0.c b/drivers/net/mac89x0.c index c244ec34fc43..23b633e2ac42 100644 --- a/drivers/net/mac89x0.c +++ b/drivers/net/mac89x0.c | |||
@@ -222,8 +222,8 @@ struct net_device * __init mac89x0_probe(int unit) | |||
222 | int card_present; | 222 | int card_present; |
223 | 223 | ||
224 | local_irq_save(flags); | 224 | local_irq_save(flags); |
225 | card_present = hwreg_present((void*) ioaddr+4) | 225 | card_present = (hwreg_present((void*) ioaddr+4) && |
226 | && hwreg_present((void*) ioaddr + DATA_PORT); | 226 | hwreg_present((void*) ioaddr + DATA_PORT)); |
227 | local_irq_restore(flags); | 227 | local_irq_restore(flags); |
228 | 228 | ||
229 | if (!card_present) | 229 | if (!card_present) |
diff --git a/drivers/net/mace.c b/drivers/net/mace.c index 7d7577b598ea..d9fbad386389 100644 --- a/drivers/net/mace.c +++ b/drivers/net/mace.c | |||
@@ -897,8 +897,8 @@ static irqreturn_t mace_rxdma_intr(int irq, void *dev_id) | |||
897 | if (next >= N_RX_RING) | 897 | if (next >= N_RX_RING) |
898 | next = 0; | 898 | next = 0; |
899 | np = mp->rx_cmds + next; | 899 | np = mp->rx_cmds + next; |
900 | if (next != mp->rx_fill | 900 | if (next != mp->rx_fill && |
901 | && (ld_le16(&np->xfer_status) & ACTIVE) != 0) { | 901 | (ld_le16(&np->xfer_status) & ACTIVE) != 0) { |
902 | printk(KERN_DEBUG "mace: lost a status word\n"); | 902 | printk(KERN_DEBUG "mace: lost a status word\n"); |
903 | ++mace_lost_status; | 903 | ++mace_lost_status; |
904 | } else | 904 | } else |
diff --git a/drivers/net/myri10ge/myri10ge.c b/drivers/net/myri10ge/myri10ge.c index 85e1b6a3ac1b..d38921906bb7 100644 --- a/drivers/net/myri10ge/myri10ge.c +++ b/drivers/net/myri10ge/myri10ge.c | |||
@@ -410,8 +410,8 @@ myri10ge_send_cmd(struct myri10ge_priv *mgp, u32 cmd, | |||
410 | * and try to get the completion quickly | 410 | * and try to get the completion quickly |
411 | * (1ms will be enough for those commands) */ | 411 | * (1ms will be enough for those commands) */ |
412 | for (sleep_total = 0; | 412 | for (sleep_total = 0; |
413 | sleep_total < 1000 | 413 | sleep_total < 1000 && |
414 | && response->result == htonl(MYRI10GE_NO_RESPONSE_RESULT); | 414 | response->result == htonl(MYRI10GE_NO_RESPONSE_RESULT); |
415 | sleep_total += 10) { | 415 | sleep_total += 10) { |
416 | udelay(10); | 416 | udelay(10); |
417 | mb(); | 417 | mb(); |
@@ -419,8 +419,8 @@ myri10ge_send_cmd(struct myri10ge_priv *mgp, u32 cmd, | |||
419 | } else { | 419 | } else { |
420 | /* use msleep for most command */ | 420 | /* use msleep for most command */ |
421 | for (sleep_total = 0; | 421 | for (sleep_total = 0; |
422 | sleep_total < 15 | 422 | sleep_total < 15 && |
423 | && response->result == htonl(MYRI10GE_NO_RESPONSE_RESULT); | 423 | response->result == htonl(MYRI10GE_NO_RESPONSE_RESULT); |
424 | sleep_total++) | 424 | sleep_total++) |
425 | msleep(1); | 425 | msleep(1); |
426 | } | 426 | } |
@@ -557,8 +557,8 @@ myri10ge_validate_firmware(struct myri10ge_priv *mgp, | |||
557 | sscanf(mgp->fw_version, "%d.%d.%d", &mgp->fw_ver_major, | 557 | sscanf(mgp->fw_version, "%d.%d.%d", &mgp->fw_ver_major, |
558 | &mgp->fw_ver_minor, &mgp->fw_ver_tiny); | 558 | &mgp->fw_ver_minor, &mgp->fw_ver_tiny); |
559 | 559 | ||
560 | if (!(mgp->fw_ver_major == MXGEFW_VERSION_MAJOR | 560 | if (!(mgp->fw_ver_major == MXGEFW_VERSION_MAJOR && |
561 | && mgp->fw_ver_minor == MXGEFW_VERSION_MINOR)) { | 561 | mgp->fw_ver_minor == MXGEFW_VERSION_MINOR)) { |
562 | dev_err(dev, "Found firmware version %s\n", mgp->fw_version); | 562 | dev_err(dev, "Found firmware version %s\n", mgp->fw_version); |
563 | dev_err(dev, "Driver needs %d.%d\n", MXGEFW_VERSION_MAJOR, | 563 | dev_err(dev, "Driver needs %d.%d\n", MXGEFW_VERSION_MAJOR, |
564 | MXGEFW_VERSION_MINOR); | 564 | MXGEFW_VERSION_MINOR); |
@@ -1412,8 +1412,8 @@ myri10ge_tx_done(struct myri10ge_slice_state *ss, int mcp_index) | |||
1412 | } | 1412 | } |
1413 | 1413 | ||
1414 | /* start the queue if we've stopped it */ | 1414 | /* start the queue if we've stopped it */ |
1415 | if (netif_tx_queue_stopped(dev_queue) | 1415 | if (netif_tx_queue_stopped(dev_queue) && |
1416 | && tx->req - tx->done < (tx->mask >> 1)) { | 1416 | tx->req - tx->done < (tx->mask >> 1)) { |
1417 | tx->wake_queue++; | 1417 | tx->wake_queue++; |
1418 | netif_tx_wake_queue(dev_queue); | 1418 | netif_tx_wake_queue(dev_queue); |
1419 | } | 1419 | } |
diff --git a/drivers/net/natsemi.c b/drivers/net/natsemi.c index 9a8d3ab4709b..797fe164ce27 100644 --- a/drivers/net/natsemi.c +++ b/drivers/net/natsemi.c | |||
@@ -683,8 +683,8 @@ static ssize_t natsemi_set_dspcfg_workaround(struct device *dev, | |||
683 | /* Find out the new setting */ | 683 | /* Find out the new setting */ |
684 | if (!strncmp("on", buf, count - 1) || !strncmp("1", buf, count - 1)) | 684 | if (!strncmp("on", buf, count - 1) || !strncmp("1", buf, count - 1)) |
685 | new_setting = 1; | 685 | new_setting = 1; |
686 | else if (!strncmp("off", buf, count - 1) | 686 | else if (!strncmp("off", buf, count - 1) || |
687 | || !strncmp("0", buf, count - 1)) | 687 | !strncmp("0", buf, count - 1)) |
688 | new_setting = 0; | 688 | new_setting = 0; |
689 | else | 689 | else |
690 | return count; | 690 | return count; |
@@ -757,8 +757,8 @@ static void __devinit natsemi_init_media (struct net_device *dev) | |||
757 | np->autoneg = (tmp & BMCR_ANENABLE)? AUTONEG_ENABLE: AUTONEG_DISABLE; | 757 | np->autoneg = (tmp & BMCR_ANENABLE)? AUTONEG_ENABLE: AUTONEG_DISABLE; |
758 | np->advertising= mdio_read(dev, MII_ADVERTISE); | 758 | np->advertising= mdio_read(dev, MII_ADVERTISE); |
759 | 759 | ||
760 | if ((np->advertising & ADVERTISE_ALL) != ADVERTISE_ALL | 760 | if ((np->advertising & ADVERTISE_ALL) != ADVERTISE_ALL && |
761 | && netif_msg_probe(np)) { | 761 | netif_msg_probe(np)) { |
762 | printk(KERN_INFO "natsemi %s: Transceiver default autonegotiation %s " | 762 | printk(KERN_INFO "natsemi %s: Transceiver default autonegotiation %s " |
763 | "10%s %s duplex.\n", | 763 | "10%s %s duplex.\n", |
764 | pci_name(np->pci_dev), | 764 | pci_name(np->pci_dev), |
@@ -1153,8 +1153,8 @@ static void init_phy_fixup(struct net_device *dev) | |||
1153 | tmp = mdio_read(dev, MII_BMCR); | 1153 | tmp = mdio_read(dev, MII_BMCR); |
1154 | if (np->autoneg == AUTONEG_ENABLE) { | 1154 | if (np->autoneg == AUTONEG_ENABLE) { |
1155 | /* renegotiate if something changed */ | 1155 | /* renegotiate if something changed */ |
1156 | if ((tmp & BMCR_ANENABLE) == 0 | 1156 | if ((tmp & BMCR_ANENABLE) == 0 || |
1157 | || np->advertising != mdio_read(dev, MII_ADVERTISE)) | 1157 | np->advertising != mdio_read(dev, MII_ADVERTISE)) |
1158 | { | 1158 | { |
1159 | /* turn on autonegotiation and force negotiation */ | 1159 | /* turn on autonegotiation and force negotiation */ |
1160 | tmp |= (BMCR_ANENABLE | BMCR_ANRESTART); | 1160 | tmp |= (BMCR_ANENABLE | BMCR_ANRESTART); |
@@ -2164,8 +2164,8 @@ static void netdev_tx_done(struct net_device *dev) | |||
2164 | dev_kfree_skb_irq(np->tx_skbuff[entry]); | 2164 | dev_kfree_skb_irq(np->tx_skbuff[entry]); |
2165 | np->tx_skbuff[entry] = NULL; | 2165 | np->tx_skbuff[entry] = NULL; |
2166 | } | 2166 | } |
2167 | if (netif_queue_stopped(dev) | 2167 | if (netif_queue_stopped(dev) && |
2168 | && np->cur_tx - np->dirty_tx < TX_QUEUE_LEN - 4) { | 2168 | np->cur_tx - np->dirty_tx < TX_QUEUE_LEN - 4) { |
2169 | /* The ring is no longer full, wake queue. */ | 2169 | /* The ring is no longer full, wake queue. */ |
2170 | netif_wake_queue(dev); | 2170 | netif_wake_queue(dev); |
2171 | } | 2171 | } |
@@ -2343,8 +2343,8 @@ static void netdev_rx(struct net_device *dev, int *work_done, int work_to_do) | |||
2343 | /* Omit CRC size. */ | 2343 | /* Omit CRC size. */ |
2344 | /* Check if the packet is long enough to accept | 2344 | /* Check if the packet is long enough to accept |
2345 | * without copying to a minimally-sized skbuff. */ | 2345 | * without copying to a minimally-sized skbuff. */ |
2346 | if (pkt_len < rx_copybreak | 2346 | if (pkt_len < rx_copybreak && |
2347 | && (skb = dev_alloc_skb(pkt_len + RX_OFFSET)) != NULL) { | 2347 | (skb = dev_alloc_skb(pkt_len + RX_OFFSET)) != NULL) { |
2348 | /* 16 byte align the IP header */ | 2348 | /* 16 byte align the IP header */ |
2349 | skb_reserve(skb, RX_OFFSET); | 2349 | skb_reserve(skb, RX_OFFSET); |
2350 | pci_dma_sync_single_for_cpu(np->pci_dev, | 2350 | pci_dma_sync_single_for_cpu(np->pci_dev, |
@@ -2390,8 +2390,8 @@ static void netdev_error(struct net_device *dev, int intr_status) | |||
2390 | spin_lock(&np->lock); | 2390 | spin_lock(&np->lock); |
2391 | if (intr_status & LinkChange) { | 2391 | if (intr_status & LinkChange) { |
2392 | u16 lpa = mdio_read(dev, MII_LPA); | 2392 | u16 lpa = mdio_read(dev, MII_LPA); |
2393 | if (mdio_read(dev, MII_BMCR) & BMCR_ANENABLE | 2393 | if (mdio_read(dev, MII_BMCR) & BMCR_ANENABLE && |
2394 | && netif_msg_link(np)) { | 2394 | netif_msg_link(np)) { |
2395 | printk(KERN_INFO | 2395 | printk(KERN_INFO |
2396 | "%s: Autonegotiation advertising" | 2396 | "%s: Autonegotiation advertising" |
2397 | " %#04x partner %#04x.\n", dev->name, | 2397 | " %#04x partner %#04x.\n", dev->name, |
@@ -2488,8 +2488,8 @@ static void __set_rx_mode(struct net_device *dev) | |||
2488 | if (dev->flags & IFF_PROMISC) { /* Set promiscuous. */ | 2488 | if (dev->flags & IFF_PROMISC) { /* Set promiscuous. */ |
2489 | rx_mode = RxFilterEnable | AcceptBroadcast | 2489 | rx_mode = RxFilterEnable | AcceptBroadcast |
2490 | | AcceptAllMulticast | AcceptAllPhys | AcceptMyPhys; | 2490 | | AcceptAllMulticast | AcceptAllPhys | AcceptMyPhys; |
2491 | } else if ((dev->mc_count > multicast_filter_limit) | 2491 | } else if ((dev->mc_count > multicast_filter_limit) || |
2492 | || (dev->flags & IFF_ALLMULTI)) { | 2492 | (dev->flags & IFF_ALLMULTI)) { |
2493 | rx_mode = RxFilterEnable | AcceptBroadcast | 2493 | rx_mode = RxFilterEnable | AcceptBroadcast |
2494 | | AcceptAllMulticast | AcceptMyPhys; | 2494 | | AcceptAllMulticast | AcceptMyPhys; |
2495 | } else { | 2495 | } else { |
diff --git a/drivers/net/netxen/netxen_nic_ethtool.c b/drivers/net/netxen/netxen_nic_ethtool.c index c86095eb5d9e..ddd704ae0188 100644 --- a/drivers/net/netxen/netxen_nic_ethtool.c +++ b/drivers/net/netxen/netxen_nic_ethtool.c | |||
@@ -257,18 +257,18 @@ netxen_nic_set_settings(struct net_device *dev, struct ethtool_cmd *ecmd) | |||
257 | /* read which mode */ | 257 | /* read which mode */ |
258 | if (adapter->ahw.port_type == NETXEN_NIC_GBE) { | 258 | if (adapter->ahw.port_type == NETXEN_NIC_GBE) { |
259 | /* autonegotiation */ | 259 | /* autonegotiation */ |
260 | if (adapter->phy_write | 260 | if (adapter->phy_write && |
261 | && adapter->phy_write(adapter, | 261 | adapter->phy_write(adapter, |
262 | NETXEN_NIU_GB_MII_MGMT_ADDR_AUTONEG, | 262 | NETXEN_NIU_GB_MII_MGMT_ADDR_AUTONEG, |
263 | ecmd->autoneg) != 0) | 263 | ecmd->autoneg) != 0) |
264 | return -EIO; | 264 | return -EIO; |
265 | else | 265 | else |
266 | adapter->link_autoneg = ecmd->autoneg; | 266 | adapter->link_autoneg = ecmd->autoneg; |
267 | 267 | ||
268 | if (adapter->phy_read | 268 | if (adapter->phy_read && |
269 | && adapter->phy_read(adapter, | 269 | adapter->phy_read(adapter, |
270 | NETXEN_NIU_GB_MII_MGMT_ADDR_PHY_STATUS, | 270 | NETXEN_NIU_GB_MII_MGMT_ADDR_PHY_STATUS, |
271 | &status) != 0) | 271 | &status) != 0) |
272 | return -EIO; | 272 | return -EIO; |
273 | 273 | ||
274 | /* speed */ | 274 | /* speed */ |
@@ -288,10 +288,10 @@ netxen_nic_set_settings(struct net_device *dev, struct ethtool_cmd *ecmd) | |||
288 | netxen_clear_phy_duplex(status); | 288 | netxen_clear_phy_duplex(status); |
289 | if (ecmd->duplex == DUPLEX_FULL) | 289 | if (ecmd->duplex == DUPLEX_FULL) |
290 | netxen_set_phy_duplex(status); | 290 | netxen_set_phy_duplex(status); |
291 | if (adapter->phy_write | 291 | if (adapter->phy_write && |
292 | && adapter->phy_write(adapter, | 292 | adapter->phy_write(adapter, |
293 | NETXEN_NIU_GB_MII_MGMT_ADDR_PHY_STATUS, | 293 | NETXEN_NIU_GB_MII_MGMT_ADDR_PHY_STATUS, |
294 | *((int *)&status)) != 0) | 294 | *((int *)&status)) != 0) |
295 | return -EIO; | 295 | return -EIO; |
296 | else { | 296 | else { |
297 | adapter->link_speed = ecmd->speed; | 297 | adapter->link_speed = ecmd->speed; |
@@ -442,10 +442,10 @@ static u32 netxen_nic_test_link(struct net_device *dev) | |||
442 | 442 | ||
443 | /* read which mode */ | 443 | /* read which mode */ |
444 | if (adapter->ahw.port_type == NETXEN_NIC_GBE) { | 444 | if (adapter->ahw.port_type == NETXEN_NIC_GBE) { |
445 | if (adapter->phy_read | 445 | if (adapter->phy_read && |
446 | && adapter->phy_read(adapter, | 446 | adapter->phy_read(adapter, |
447 | NETXEN_NIU_GB_MII_MGMT_ADDR_PHY_STATUS, | 447 | NETXEN_NIU_GB_MII_MGMT_ADDR_PHY_STATUS, |
448 | &status) != 0) | 448 | &status) != 0) |
449 | return -EIO; | 449 | return -EIO; |
450 | else { | 450 | else { |
451 | val = netxen_get_phy_link(status); | 451 | val = netxen_get_phy_link(status); |
diff --git a/drivers/net/netxen/netxen_nic_hw.c b/drivers/net/netxen/netxen_nic_hw.c index 89bd5194e37a..2e364fee3cbb 100644 --- a/drivers/net/netxen/netxen_nic_hw.c +++ b/drivers/net/netxen/netxen_nic_hw.c | |||
@@ -1936,10 +1936,10 @@ void netxen_nic_set_link_parameters(struct netxen_adapter *adapter) | |||
1936 | return; | 1936 | return; |
1937 | } | 1937 | } |
1938 | 1938 | ||
1939 | if (adapter->phy_read | 1939 | if (adapter->phy_read && |
1940 | && adapter->phy_read(adapter, | 1940 | adapter->phy_read(adapter, |
1941 | NETXEN_NIU_GB_MII_MGMT_ADDR_PHY_STATUS, | 1941 | NETXEN_NIU_GB_MII_MGMT_ADDR_PHY_STATUS, |
1942 | &status) == 0) { | 1942 | &status) == 0) { |
1943 | if (netxen_get_phy_link(status)) { | 1943 | if (netxen_get_phy_link(status)) { |
1944 | switch (netxen_get_phy_speed(status)) { | 1944 | switch (netxen_get_phy_speed(status)) { |
1945 | case 0: | 1945 | case 0: |
@@ -1966,10 +1966,10 @@ void netxen_nic_set_link_parameters(struct netxen_adapter *adapter) | |||
1966 | adapter->link_duplex = -1; | 1966 | adapter->link_duplex = -1; |
1967 | break; | 1967 | break; |
1968 | } | 1968 | } |
1969 | if (adapter->phy_read | 1969 | if (adapter->phy_read && |
1970 | && adapter->phy_read(adapter, | 1970 | adapter->phy_read(adapter, |
1971 | NETXEN_NIU_GB_MII_MGMT_ADDR_AUTONEG, | 1971 | NETXEN_NIU_GB_MII_MGMT_ADDR_AUTONEG, |
1972 | &autoneg) != 0) | 1972 | &autoneg) != 0) |
1973 | adapter->link_autoneg = autoneg; | 1973 | adapter->link_autoneg = autoneg; |
1974 | } else | 1974 | } else |
1975 | goto link_down; | 1975 | goto link_down; |
diff --git a/drivers/net/ni52.c b/drivers/net/ni52.c index 305f4ba36999..b42f5e522f90 100644 --- a/drivers/net/ni52.c +++ b/drivers/net/ni52.c | |||
@@ -477,8 +477,8 @@ static int __init ni52_probe1(struct net_device *dev, int ioaddr) | |||
477 | for (i = 0; i < ETH_ALEN; i++) | 477 | for (i = 0; i < ETH_ALEN; i++) |
478 | dev->dev_addr[i] = inb(dev->base_addr+i); | 478 | dev->dev_addr[i] = inb(dev->base_addr+i); |
479 | 479 | ||
480 | if (dev->dev_addr[0] != NI52_ADDR0 || dev->dev_addr[1] != NI52_ADDR1 | 480 | if (dev->dev_addr[0] != NI52_ADDR0 || dev->dev_addr[1] != NI52_ADDR1 || |
481 | || dev->dev_addr[2] != NI52_ADDR2) { | 481 | dev->dev_addr[2] != NI52_ADDR2) { |
482 | retval = -ENODEV; | 482 | retval = -ENODEV; |
483 | goto out; | 483 | goto out; |
484 | } | 484 | } |
diff --git a/drivers/net/ns83820.c b/drivers/net/ns83820.c index 57fd483dbb1f..1f6327d41536 100644 --- a/drivers/net/ns83820.c +++ b/drivers/net/ns83820.c | |||
@@ -648,8 +648,8 @@ static void phy_intr(struct net_device *ndev) | |||
648 | dprintk("phy_intr: tbisr=%08x, tanar=%08x, tanlpar=%08x\n", | 648 | dprintk("phy_intr: tbisr=%08x, tanar=%08x, tanlpar=%08x\n", |
649 | tbisr, tanar, tanlpar); | 649 | tbisr, tanar, tanlpar); |
650 | 650 | ||
651 | if ( (fullduplex = (tanlpar & TANAR_FULL_DUP) | 651 | if ( (fullduplex = (tanlpar & TANAR_FULL_DUP) && |
652 | && (tanar & TANAR_FULL_DUP)) ) { | 652 | (tanar & TANAR_FULL_DUP)) ) { |
653 | 653 | ||
654 | /* both of us are full duplex */ | 654 | /* both of us are full duplex */ |
655 | writel(readl(dev->base + TXCFG) | 655 | writel(readl(dev->base + TXCFG) |
@@ -661,12 +661,12 @@ static void phy_intr(struct net_device *ndev) | |||
661 | writel(readl(dev->base + GPIOR) | GPIOR_GP1_OUT, | 661 | writel(readl(dev->base + GPIOR) | GPIOR_GP1_OUT, |
662 | dev->base + GPIOR); | 662 | dev->base + GPIOR); |
663 | 663 | ||
664 | } else if(((tanlpar & TANAR_HALF_DUP) | 664 | } else if (((tanlpar & TANAR_HALF_DUP) && |
665 | && (tanar & TANAR_HALF_DUP)) | 665 | (tanar & TANAR_HALF_DUP)) || |
666 | || ((tanlpar & TANAR_FULL_DUP) | 666 | ((tanlpar & TANAR_FULL_DUP) && |
667 | && (tanar & TANAR_HALF_DUP)) | 667 | (tanar & TANAR_HALF_DUP)) || |
668 | || ((tanlpar & TANAR_HALF_DUP) | 668 | ((tanlpar & TANAR_HALF_DUP) && |
669 | && (tanar & TANAR_FULL_DUP))) { | 669 | (tanar & TANAR_FULL_DUP))) { |
670 | 670 | ||
671 | /* one or both of us are half duplex */ | 671 | /* one or both of us are half duplex */ |
672 | writel((readl(dev->base + TXCFG) | 672 | writel((readl(dev->base + TXCFG) |
@@ -720,16 +720,16 @@ static void phy_intr(struct net_device *ndev) | |||
720 | 720 | ||
721 | newlinkstate = (cfg & CFG_LNKSTS) ? LINK_UP : LINK_DOWN; | 721 | newlinkstate = (cfg & CFG_LNKSTS) ? LINK_UP : LINK_DOWN; |
722 | 722 | ||
723 | if (newlinkstate & LINK_UP | 723 | if (newlinkstate & LINK_UP && |
724 | && dev->linkstate != newlinkstate) { | 724 | dev->linkstate != newlinkstate) { |
725 | netif_start_queue(ndev); | 725 | netif_start_queue(ndev); |
726 | netif_wake_queue(ndev); | 726 | netif_wake_queue(ndev); |
727 | printk(KERN_INFO "%s: link now %s mbps, %s duplex and up.\n", | 727 | printk(KERN_INFO "%s: link now %s mbps, %s duplex and up.\n", |
728 | ndev->name, | 728 | ndev->name, |
729 | speeds[speed], | 729 | speeds[speed], |
730 | fullduplex ? "full" : "half"); | 730 | fullduplex ? "full" : "half"); |
731 | } else if (newlinkstate & LINK_DOWN | 731 | } else if (newlinkstate & LINK_DOWN && |
732 | && dev->linkstate != newlinkstate) { | 732 | dev->linkstate != newlinkstate) { |
733 | netif_stop_queue(ndev); | 733 | netif_stop_queue(ndev); |
734 | printk(KERN_INFO "%s: link now down.\n", ndev->name); | 734 | printk(KERN_INFO "%s: link now down.\n", ndev->name); |
735 | } | 735 | } |
diff --git a/drivers/net/pci-skeleton.c b/drivers/net/pci-skeleton.c index 0c44b48f1384..480af402affd 100644 --- a/drivers/net/pci-skeleton.c +++ b/drivers/net/pci-skeleton.c | |||
@@ -1225,8 +1225,8 @@ static void netdrv_timer (unsigned long data) | |||
1225 | mii_lpa = mdio_read (dev, tp->phys[0], MII_LPA); | 1225 | mii_lpa = mdio_read (dev, tp->phys[0], MII_LPA); |
1226 | 1226 | ||
1227 | if (!tp->duplex_lock && mii_lpa != 0xffff) { | 1227 | if (!tp->duplex_lock && mii_lpa != 0xffff) { |
1228 | int duplex = (mii_lpa & LPA_100FULL) | 1228 | int duplex = ((mii_lpa & LPA_100FULL) || |
1229 | || (mii_lpa & 0x01C0) == 0x0040; | 1229 | (mii_lpa & 0x01C0) == 0x0040); |
1230 | if (tp->full_duplex != duplex) { | 1230 | if (tp->full_duplex != duplex) { |
1231 | tp->full_duplex = duplex; | 1231 | tp->full_duplex = duplex; |
1232 | printk (KERN_INFO | 1232 | printk (KERN_INFO |
@@ -1612,8 +1612,8 @@ static void netdrv_weird_interrupt (struct net_device *dev, | |||
1612 | (tp->drv_flags & HAS_LNK_CHNG)) { | 1612 | (tp->drv_flags & HAS_LNK_CHNG)) { |
1613 | /* Really link-change on new chips. */ | 1613 | /* Really link-change on new chips. */ |
1614 | int lpar = NETDRV_R16 (NWayLPAR); | 1614 | int lpar = NETDRV_R16 (NWayLPAR); |
1615 | int duplex = (lpar & 0x0100) || (lpar & 0x01C0) == 0x0040 | 1615 | int duplex = ((lpar & 0x0100) || (lpar & 0x01C0) == 0x0040 || |
1616 | || tp->duplex_lock; | 1616 | tp->duplex_lock); |
1617 | if (tp->full_duplex != duplex) { | 1617 | if (tp->full_duplex != duplex) { |
1618 | tp->full_duplex = duplex; | 1618 | tp->full_duplex = duplex; |
1619 | NETDRV_W8 (Cfg9346, Cfg9346_Unlock); | 1619 | NETDRV_W8 (Cfg9346, Cfg9346_Unlock); |
@@ -1820,8 +1820,8 @@ static void netdrv_set_rx_mode (struct net_device *dev) | |||
1820 | AcceptBroadcast | AcceptMulticast | AcceptMyPhys | | 1820 | AcceptBroadcast | AcceptMulticast | AcceptMyPhys | |
1821 | AcceptAllPhys; | 1821 | AcceptAllPhys; |
1822 | mc_filter[1] = mc_filter[0] = 0xffffffff; | 1822 | mc_filter[1] = mc_filter[0] = 0xffffffff; |
1823 | } else if ((dev->mc_count > multicast_filter_limit) | 1823 | } else if ((dev->mc_count > multicast_filter_limit) || |
1824 | || (dev->flags & IFF_ALLMULTI)) { | 1824 | (dev->flags & IFF_ALLMULTI)) { |
1825 | /* Too many to filter perfectly -- accept all multicasts. */ | 1825 | /* Too many to filter perfectly -- accept all multicasts. */ |
1826 | rx_mode = AcceptBroadcast | AcceptMulticast | AcceptMyPhys; | 1826 | rx_mode = AcceptBroadcast | AcceptMulticast | AcceptMyPhys; |
1827 | mc_filter[1] = mc_filter[0] = 0xffffffff; | 1827 | mc_filter[1] = mc_filter[0] = 0xffffffff; |
diff --git a/drivers/net/pcmcia/axnet_cs.c b/drivers/net/pcmcia/axnet_cs.c index 3131a59a8d32..ca711f46814e 100644 --- a/drivers/net/pcmcia/axnet_cs.c +++ b/drivers/net/pcmcia/axnet_cs.c | |||
@@ -1232,8 +1232,8 @@ static irqreturn_t ax_interrupt(int irq, void *dev_id) | |||
1232 | ei_local->irqlock = 1; | 1232 | ei_local->irqlock = 1; |
1233 | 1233 | ||
1234 | /* !!Assumption!! -- we stay in page 0. Don't break this. */ | 1234 | /* !!Assumption!! -- we stay in page 0. Don't break this. */ |
1235 | while ((interrupts = inb_p(e8390_base + EN0_ISR)) != 0 | 1235 | while ((interrupts = inb_p(e8390_base + EN0_ISR)) != 0 && |
1236 | && ++nr_serviced < MAX_SERVICE) | 1236 | ++nr_serviced < MAX_SERVICE) |
1237 | { | 1237 | { |
1238 | if (!netif_running(dev) || (interrupts == 0xff)) { | 1238 | if (!netif_running(dev) || (interrupts == 0xff)) { |
1239 | if (ei_debug > 1) | 1239 | if (ei_debug > 1) |
diff --git a/drivers/net/pcmcia/fmvj18x_cs.c b/drivers/net/pcmcia/fmvj18x_cs.c index 57e09616330a..a6961215cd56 100644 --- a/drivers/net/pcmcia/fmvj18x_cs.c +++ b/drivers/net/pcmcia/fmvj18x_cs.c | |||
@@ -371,9 +371,9 @@ static int fmvj18x_config(struct pcmcia_device *link) | |||
371 | switch (link->manf_id) { | 371 | switch (link->manf_id) { |
372 | case MANFID_TDK: | 372 | case MANFID_TDK: |
373 | cardtype = TDK; | 373 | cardtype = TDK; |
374 | if (link->card_id == PRODID_TDK_GN3410 | 374 | if (link->card_id == PRODID_TDK_GN3410 || |
375 | || link->card_id == PRODID_TDK_NP9610 | 375 | link->card_id == PRODID_TDK_NP9610 || |
376 | || link->card_id == PRODID_TDK_MN3200) { | 376 | link->card_id == PRODID_TDK_MN3200) { |
377 | /* MultiFunction Card */ | 377 | /* MultiFunction Card */ |
378 | link->conf.ConfigBase = 0x800; | 378 | link->conf.ConfigBase = 0x800; |
379 | link->conf.ConfigIndex = 0x47; | 379 | link->conf.ConfigIndex = 0x47; |
@@ -590,11 +590,11 @@ static int fmvj18x_get_hwinfo(struct pcmcia_device *link, u_char *node_id) | |||
590 | */ | 590 | */ |
591 | for (i = 0; i < 0x200; i++) { | 591 | for (i = 0; i < 0x200; i++) { |
592 | if (readb(base+i*2) == 0x22) { | 592 | if (readb(base+i*2) == 0x22) { |
593 | if (readb(base+(i-1)*2) == 0xff | 593 | if (readb(base+(i-1)*2) == 0xff && |
594 | && readb(base+(i+5)*2) == 0x04 | 594 | readb(base+(i+5)*2) == 0x04 && |
595 | && readb(base+(i+6)*2) == 0x06 | 595 | readb(base+(i+6)*2) == 0x06 && |
596 | && readb(base+(i+13)*2) == 0xff) | 596 | readb(base+(i+13)*2) == 0xff) |
597 | break; | 597 | break; |
598 | } | 598 | } |
599 | } | 599 | } |
600 | 600 | ||
@@ -1219,8 +1219,8 @@ static void set_rx_mode(struct net_device *dev) | |||
1219 | if (dev->flags & IFF_PROMISC) { | 1219 | if (dev->flags & IFF_PROMISC) { |
1220 | memset(mc_filter, 0xff, sizeof(mc_filter)); | 1220 | memset(mc_filter, 0xff, sizeof(mc_filter)); |
1221 | outb(3, ioaddr + RX_MODE); /* Enable promiscuous mode */ | 1221 | outb(3, ioaddr + RX_MODE); /* Enable promiscuous mode */ |
1222 | } else if (dev->mc_count > MC_FILTERBREAK | 1222 | } else if (dev->mc_count > MC_FILTERBREAK || |
1223 | || (dev->flags & IFF_ALLMULTI)) { | 1223 | (dev->flags & IFF_ALLMULTI)) { |
1224 | /* Too many to filter perfectly -- accept all multicasts. */ | 1224 | /* Too many to filter perfectly -- accept all multicasts. */ |
1225 | memset(mc_filter, 0xff, sizeof(mc_filter)); | 1225 | memset(mc_filter, 0xff, sizeof(mc_filter)); |
1226 | outb(2, ioaddr + RX_MODE); /* Use normal mode. */ | 1226 | outb(2, ioaddr + RX_MODE); /* Use normal mode. */ |
diff --git a/drivers/net/pcmcia/pcnet_cs.c b/drivers/net/pcmcia/pcnet_cs.c index 469684474b72..347eaee855c0 100644 --- a/drivers/net/pcmcia/pcnet_cs.c +++ b/drivers/net/pcmcia/pcnet_cs.c | |||
@@ -601,8 +601,8 @@ static int pcnet_config(struct pcmcia_device *link) | |||
601 | dev->if_port = 0; | 601 | dev->if_port = 0; |
602 | } | 602 | } |
603 | 603 | ||
604 | if ((link->conf.ConfigBase == 0x03c0) | 604 | if ((link->conf.ConfigBase == 0x03c0) && |
605 | && (link->manf_id == 0x149) && (link->card_id == 0xc1ab)) { | 605 | (link->manf_id == 0x149) && (link->card_id == 0xc1ab)) { |
606 | printk(KERN_INFO "pcnet_cs: this is an AX88190 card!\n"); | 606 | printk(KERN_INFO "pcnet_cs: this is an AX88190 card!\n"); |
607 | printk(KERN_INFO "pcnet_cs: use axnet_cs instead.\n"); | 607 | printk(KERN_INFO "pcnet_cs: use axnet_cs instead.\n"); |
608 | goto failed; | 608 | goto failed; |
diff --git a/drivers/net/pcmcia/smc91c92_cs.c b/drivers/net/pcmcia/smc91c92_cs.c index 7bde2cd34c7e..117b083a10cb 100644 --- a/drivers/net/pcmcia/smc91c92_cs.c +++ b/drivers/net/pcmcia/smc91c92_cs.c | |||
@@ -526,10 +526,10 @@ static int mhz_mfc_config(struct pcmcia_device *link) | |||
526 | mem.CardOffset = link->conf.ConfigBase; | 526 | mem.CardOffset = link->conf.ConfigBase; |
527 | i = pcmcia_map_mem_page(link->win, &mem); | 527 | i = pcmcia_map_mem_page(link->win, &mem); |
528 | 528 | ||
529 | if ((i == 0) | 529 | if ((i == 0) && |
530 | && (smc->manfid == MANFID_MEGAHERTZ) | 530 | (smc->manfid == MANFID_MEGAHERTZ) && |
531 | && (smc->cardid == PRODID_MEGAHERTZ_EM3288)) | 531 | (smc->cardid == PRODID_MEGAHERTZ_EM3288)) |
532 | mhz_3288_power(link); | 532 | mhz_3288_power(link); |
533 | 533 | ||
534 | free_cfg_mem: | 534 | free_cfg_mem: |
535 | kfree(cfg_mem); | 535 | kfree(cfg_mem); |
diff --git a/drivers/net/pcmcia/xirc2ps_cs.c b/drivers/net/pcmcia/xirc2ps_cs.c index cf8423102538..187da21f720b 100644 --- a/drivers/net/pcmcia/xirc2ps_cs.c +++ b/drivers/net/pcmcia/xirc2ps_cs.c | |||
@@ -421,9 +421,9 @@ PrintRegisters(struct net_device *dev) | |||
421 | printk("\n"); | 421 | printk("\n"); |
422 | } | 422 | } |
423 | for (page=0x40 ; page <= 0x5f; page++) { | 423 | for (page=0x40 ; page <= 0x5f; page++) { |
424 | if (page == 0x43 || (page >= 0x46 && page <= 0x4f) | 424 | if (page == 0x43 || (page >= 0x46 && page <= 0x4f) || |
425 | || (page >= 0x51 && page <=0x5e)) | 425 | (page >= 0x51 && page <=0x5e)) |
426 | continue; | 426 | continue; |
427 | printk(KDBG_XIRC "Register page %2x: ", page); | 427 | printk(KDBG_XIRC "Register page %2x: ", page); |
428 | SelectPage(page); | 428 | SelectPage(page); |
429 | for (i = 8; i < 16; i++) | 429 | for (i = 8; i < 16; i++) |
@@ -834,9 +834,9 @@ xirc2ps_config(struct pcmcia_device * link) | |||
834 | /* Once I saw two CISTPL_FUNCE_LAN_NODE_ID entries: | 834 | /* Once I saw two CISTPL_FUNCE_LAN_NODE_ID entries: |
835 | * the first one with a length of zero the second correct - | 835 | * the first one with a length of zero the second correct - |
836 | * so I skip all entries with length 0 */ | 836 | * so I skip all entries with length 0 */ |
837 | if (parse.funce.type == CISTPL_FUNCE_LAN_NODE_ID | 837 | if (parse.funce.type == CISTPL_FUNCE_LAN_NODE_ID && |
838 | && ((cistpl_lan_node_id_t *)parse.funce.data)->nb) | 838 | ((cistpl_lan_node_id_t *)parse.funce.data)->nb) |
839 | break; | 839 | break; |
840 | } | 840 | } |
841 | if (err) { /* not found: try to get the node-id from tuple 0x89 */ | 841 | if (err) { /* not found: try to get the node-id from tuple 0x89 */ |
842 | tuple.DesiredTuple = 0x89; /* data layout looks like tuple 0x22 */ | 842 | tuple.DesiredTuple = 0x89; /* data layout looks like tuple 0x22 */ |
@@ -852,8 +852,8 @@ xirc2ps_config(struct pcmcia_device * link) | |||
852 | tuple.DesiredTuple = CISTPL_FUNCE; | 852 | tuple.DesiredTuple = CISTPL_FUNCE; |
853 | for (err = first_tuple(link, &tuple, &parse); !err; | 853 | for (err = first_tuple(link, &tuple, &parse); !err; |
854 | err = next_tuple(link, &tuple, &parse)) { | 854 | err = next_tuple(link, &tuple, &parse)) { |
855 | if (parse.funce.type == 0x02 && parse.funce.data[0] == 1 | 855 | if (parse.funce.type == 0x02 && parse.funce.data[0] == 1 && |
856 | && parse.funce.data[1] == 6 && tuple.TupleDataLen == 13) { | 856 | parse.funce.data[1] == 6 && tuple.TupleDataLen == 13) { |
857 | buf[1] = 4; | 857 | buf[1] = 4; |
858 | memcpy(&parse, buf+1, 8); | 858 | memcpy(&parse, buf+1, 8); |
859 | break; | 859 | break; |
diff --git a/drivers/net/pcnet32.c b/drivers/net/pcnet32.c index 076f23a10517..dcc67a35e8f2 100644 --- a/drivers/net/pcnet32.c +++ b/drivers/net/pcnet32.c | |||
@@ -1515,8 +1515,8 @@ static void __devinit pcnet32_probe_vlbus(unsigned int *pcnet32_portlist) | |||
1515 | if (request_region | 1515 | if (request_region |
1516 | (ioaddr, PCNET32_TOTAL_SIZE, "pcnet32_probe_vlbus")) { | 1516 | (ioaddr, PCNET32_TOTAL_SIZE, "pcnet32_probe_vlbus")) { |
1517 | /* check if there is really a pcnet chip on that ioaddr */ | 1517 | /* check if there is really a pcnet chip on that ioaddr */ |
1518 | if ((inb(ioaddr + 14) == 0x57) | 1518 | if ((inb(ioaddr + 14) == 0x57) && |
1519 | && (inb(ioaddr + 15) == 0x57)) { | 1519 | (inb(ioaddr + 15) == 0x57)) { |
1520 | pcnet32_probe1(ioaddr, 0, NULL); | 1520 | pcnet32_probe1(ioaddr, 0, NULL); |
1521 | } else { | 1521 | } else { |
1522 | release_region(ioaddr, PCNET32_TOTAL_SIZE); | 1522 | release_region(ioaddr, PCNET32_TOTAL_SIZE); |
@@ -1610,8 +1610,8 @@ pcnet32_probe1(unsigned long ioaddr, int shared, struct pci_dev *pdev) | |||
1610 | a = &pcnet32_wio; | 1610 | a = &pcnet32_wio; |
1611 | } else { | 1611 | } else { |
1612 | pcnet32_dwio_reset(ioaddr); | 1612 | pcnet32_dwio_reset(ioaddr); |
1613 | if (pcnet32_dwio_read_csr(ioaddr, 0) == 4 | 1613 | if (pcnet32_dwio_read_csr(ioaddr, 0) == 4 && |
1614 | && pcnet32_dwio_check(ioaddr)) { | 1614 | pcnet32_dwio_check(ioaddr)) { |
1615 | a = &pcnet32_dwio; | 1615 | a = &pcnet32_dwio; |
1616 | } else { | 1616 | } else { |
1617 | if (pcnet32_debug & NETIF_MSG_PROBE) | 1617 | if (pcnet32_debug & NETIF_MSG_PROBE) |
@@ -1750,8 +1750,8 @@ pcnet32_probe1(unsigned long ioaddr, int shared, struct pci_dev *pdev) | |||
1750 | for (i = 0; i < 6; i++) | 1750 | for (i = 0; i < 6; i++) |
1751 | promaddr[i] = inb(ioaddr + i); | 1751 | promaddr[i] = inb(ioaddr + i); |
1752 | 1752 | ||
1753 | if (memcmp(promaddr, dev->dev_addr, 6) | 1753 | if (memcmp(promaddr, dev->dev_addr, 6) || |
1754 | || !is_valid_ether_addr(dev->dev_addr)) { | 1754 | !is_valid_ether_addr(dev->dev_addr)) { |
1755 | if (is_valid_ether_addr(promaddr)) { | 1755 | if (is_valid_ether_addr(promaddr)) { |
1756 | if (pcnet32_debug & NETIF_MSG_PROBE) { | 1756 | if (pcnet32_debug & NETIF_MSG_PROBE) { |
1757 | printk(" warning: CSR address invalid,\n"); | 1757 | printk(" warning: CSR address invalid,\n"); |
@@ -1840,8 +1840,8 @@ pcnet32_probe1(unsigned long ioaddr, int shared, struct pci_dev *pdev) | |||
1840 | lp->mii = mii; | 1840 | lp->mii = mii; |
1841 | lp->chip_version = chip_version; | 1841 | lp->chip_version = chip_version; |
1842 | lp->msg_enable = pcnet32_debug; | 1842 | lp->msg_enable = pcnet32_debug; |
1843 | if ((cards_found >= MAX_UNITS) | 1843 | if ((cards_found >= MAX_UNITS) || |
1844 | || (options[cards_found] >= sizeof(options_mapping))) | 1844 | (options[cards_found] >= sizeof(options_mapping))) |
1845 | lp->options = PCNET32_PORT_ASEL; | 1845 | lp->options = PCNET32_PORT_ASEL; |
1846 | else | 1846 | else |
1847 | lp->options = options_mapping[options[cards_found]]; | 1847 | lp->options = options_mapping[options[cards_found]]; |
@@ -1866,8 +1866,8 @@ pcnet32_probe1(unsigned long ioaddr, int shared, struct pci_dev *pdev) | |||
1866 | goto err_free_ring; | 1866 | goto err_free_ring; |
1867 | } | 1867 | } |
1868 | /* detect special T1/E1 WAN card by checking for MAC address */ | 1868 | /* detect special T1/E1 WAN card by checking for MAC address */ |
1869 | if (dev->dev_addr[0] == 0x00 && dev->dev_addr[1] == 0xe0 | 1869 | if (dev->dev_addr[0] == 0x00 && dev->dev_addr[1] == 0xe0 && |
1870 | && dev->dev_addr[2] == 0x75) | 1870 | dev->dev_addr[2] == 0x75) |
1871 | lp->options = PCNET32_PORT_FD | PCNET32_PORT_GPSI; | 1871 | lp->options = PCNET32_PORT_FD | PCNET32_PORT_GPSI; |
1872 | 1872 | ||
1873 | lp->init_block->mode = cpu_to_le16(0x0003); /* Disable Rx and Tx. */ | 1873 | lp->init_block->mode = cpu_to_le16(0x0003); /* Disable Rx and Tx. */ |
diff --git a/drivers/net/phy/phy.c b/drivers/net/phy/phy.c index 6b71b0034060..b0e9f9c51721 100644 --- a/drivers/net/phy/phy.c +++ b/drivers/net/phy/phy.c | |||
@@ -254,12 +254,12 @@ int phy_ethtool_sset(struct phy_device *phydev, struct ethtool_cmd *cmd) | |||
254 | if (cmd->autoneg == AUTONEG_ENABLE && cmd->advertising == 0) | 254 | if (cmd->autoneg == AUTONEG_ENABLE && cmd->advertising == 0) |
255 | return -EINVAL; | 255 | return -EINVAL; |
256 | 256 | ||
257 | if (cmd->autoneg == AUTONEG_DISABLE | 257 | if (cmd->autoneg == AUTONEG_DISABLE && |
258 | && ((cmd->speed != SPEED_1000 | 258 | ((cmd->speed != SPEED_1000 && |
259 | && cmd->speed != SPEED_100 | 259 | cmd->speed != SPEED_100 && |
260 | && cmd->speed != SPEED_10) | 260 | cmd->speed != SPEED_10) || |
261 | || (cmd->duplex != DUPLEX_HALF | 261 | (cmd->duplex != DUPLEX_HALF && |
262 | && cmd->duplex != DUPLEX_FULL))) | 262 | cmd->duplex != DUPLEX_FULL))) |
263 | return -EINVAL; | 263 | return -EINVAL; |
264 | 264 | ||
265 | phydev->autoneg = cmd->autoneg; | 265 | phydev->autoneg = cmd->autoneg; |
@@ -353,9 +353,9 @@ int phy_mii_ioctl(struct phy_device *phydev, | |||
353 | 353 | ||
354 | phy_write(phydev, mii_data->reg_num, val); | 354 | phy_write(phydev, mii_data->reg_num, val); |
355 | 355 | ||
356 | if (mii_data->reg_num == MII_BMCR | 356 | if (mii_data->reg_num == MII_BMCR && |
357 | && val & BMCR_RESET | 357 | val & BMCR_RESET && |
358 | && phydev->drv->config_init) { | 358 | phydev->drv->config_init) { |
359 | phy_scan_fixups(phydev); | 359 | phy_scan_fixups(phydev); |
360 | phydev->drv->config_init(phydev); | 360 | phydev->drv->config_init(phydev); |
361 | } | 361 | } |
diff --git a/drivers/net/plip.c b/drivers/net/plip.c index 00487f569cfd..3327e9fc7b51 100644 --- a/drivers/net/plip.c +++ b/drivers/net/plip.c | |||
@@ -372,8 +372,8 @@ plip_bh(struct work_struct *work) | |||
372 | 372 | ||
373 | nl->is_deferred = 0; | 373 | nl->is_deferred = 0; |
374 | f = connection_state_table[nl->connection]; | 374 | f = connection_state_table[nl->connection]; |
375 | if ((r = (*f)(nl->dev, nl, snd, rcv)) != OK | 375 | if ((r = (*f)(nl->dev, nl, snd, rcv)) != OK && |
376 | && (r = plip_bh_timeout_error(nl->dev, nl, snd, rcv, r)) != OK) { | 376 | (r = plip_bh_timeout_error(nl->dev, nl, snd, rcv, r)) != OK) { |
377 | nl->is_deferred = 1; | 377 | nl->is_deferred = 1; |
378 | schedule_delayed_work(&nl->deferred, 1); | 378 | schedule_delayed_work(&nl->deferred, 1); |
379 | } | 379 | } |
@@ -416,9 +416,8 @@ plip_bh_timeout_error(struct net_device *dev, struct net_local *nl, | |||
416 | 416 | ||
417 | if (error != ERROR) { /* Timeout */ | 417 | if (error != ERROR) { /* Timeout */ |
418 | nl->timeout_count++; | 418 | nl->timeout_count++; |
419 | if ((error == HS_TIMEOUT | 419 | if ((error == HS_TIMEOUT && nl->timeout_count <= 10) || |
420 | && nl->timeout_count <= 10) | 420 | nl->timeout_count <= 3) { |
421 | || nl->timeout_count <= 3) { | ||
422 | spin_unlock_irq(&nl->lock); | 421 | spin_unlock_irq(&nl->lock); |
423 | /* Try again later */ | 422 | /* Try again later */ |
424 | return TIMEOUT; | 423 | return TIMEOUT; |
@@ -624,8 +623,8 @@ plip_receive_packet(struct net_device *dev, struct net_local *nl, | |||
624 | if (plip_receive(nibble_timeout, dev, | 623 | if (plip_receive(nibble_timeout, dev, |
625 | &rcv->nibble, &rcv->length.b.msb)) | 624 | &rcv->nibble, &rcv->length.b.msb)) |
626 | return TIMEOUT; | 625 | return TIMEOUT; |
627 | if (rcv->length.h > dev->mtu + dev->hard_header_len | 626 | if (rcv->length.h > dev->mtu + dev->hard_header_len || |
628 | || rcv->length.h < 8) { | 627 | rcv->length.h < 8) { |
629 | printk(KERN_WARNING "%s: bogus packet size %d.\n", dev->name, rcv->length.h); | 628 | printk(KERN_WARNING "%s: bogus packet size %d.\n", dev->name, rcv->length.h); |
630 | return ERROR; | 629 | return ERROR; |
631 | } | 630 | } |
diff --git a/drivers/net/ppp_async.c b/drivers/net/ppp_async.c index c311fa6597f5..6a375ea4947d 100644 --- a/drivers/net/ppp_async.c +++ b/drivers/net/ppp_async.c | |||
@@ -558,8 +558,8 @@ ppp_async_encode(struct asyncppp *ap) | |||
558 | * Start of a new packet - insert the leading FLAG | 558 | * Start of a new packet - insert the leading FLAG |
559 | * character if necessary. | 559 | * character if necessary. |
560 | */ | 560 | */ |
561 | if (islcp || flag_time == 0 | 561 | if (islcp || flag_time == 0 || |
562 | || time_after_eq(jiffies, ap->last_xmit + flag_time)) | 562 | time_after_eq(jiffies, ap->last_xmit + flag_time)) |
563 | *buf++ = PPP_FLAG; | 563 | *buf++ = PPP_FLAG; |
564 | ap->last_xmit = jiffies; | 564 | ap->last_xmit = jiffies; |
565 | fcs = PPP_INITFCS; | 565 | fcs = PPP_INITFCS; |
@@ -696,8 +696,8 @@ ppp_async_push(struct asyncppp *ap) | |||
696 | */ | 696 | */ |
697 | clear_bit(XMIT_BUSY, &ap->xmit_flags); | 697 | clear_bit(XMIT_BUSY, &ap->xmit_flags); |
698 | /* any more work to do? if not, exit the loop */ | 698 | /* any more work to do? if not, exit the loop */ |
699 | if (!(test_bit(XMIT_WAKEUP, &ap->xmit_flags) | 699 | if (!(test_bit(XMIT_WAKEUP, &ap->xmit_flags) || |
700 | || (!tty_stuffed && ap->tpkt))) | 700 | (!tty_stuffed && ap->tpkt))) |
701 | break; | 701 | break; |
702 | /* more work to do, see if we can do it now */ | 702 | /* more work to do, see if we can do it now */ |
703 | if (test_and_set_bit(XMIT_BUSY, &ap->xmit_flags)) | 703 | if (test_and_set_bit(XMIT_BUSY, &ap->xmit_flags)) |
@@ -754,8 +754,8 @@ scan_ordinary(struct asyncppp *ap, const unsigned char *buf, int count) | |||
754 | 754 | ||
755 | for (i = 0; i < count; ++i) { | 755 | for (i = 0; i < count; ++i) { |
756 | c = buf[i]; | 756 | c = buf[i]; |
757 | if (c == PPP_ESCAPE || c == PPP_FLAG | 757 | if (c == PPP_ESCAPE || c == PPP_FLAG || |
758 | || (c < 0x20 && (ap->raccm & (1 << c)) != 0)) | 758 | (c < 0x20 && (ap->raccm & (1 << c)) != 0)) |
759 | break; | 759 | break; |
760 | } | 760 | } |
761 | return i; | 761 | return i; |
diff --git a/drivers/net/ppp_deflate.c b/drivers/net/ppp_deflate.c index 034c1c650bcb..695bc83e0cfd 100644 --- a/drivers/net/ppp_deflate.c +++ b/drivers/net/ppp_deflate.c | |||
@@ -111,11 +111,11 @@ static void *z_comp_alloc(unsigned char *options, int opt_len) | |||
111 | struct ppp_deflate_state *state; | 111 | struct ppp_deflate_state *state; |
112 | int w_size; | 112 | int w_size; |
113 | 113 | ||
114 | if (opt_len != CILEN_DEFLATE | 114 | if (opt_len != CILEN_DEFLATE || |
115 | || (options[0] != CI_DEFLATE && options[0] != CI_DEFLATE_DRAFT) | 115 | (options[0] != CI_DEFLATE && options[0] != CI_DEFLATE_DRAFT) || |
116 | || options[1] != CILEN_DEFLATE | 116 | options[1] != CILEN_DEFLATE || |
117 | || DEFLATE_METHOD(options[2]) != DEFLATE_METHOD_VAL | 117 | DEFLATE_METHOD(options[2]) != DEFLATE_METHOD_VAL || |
118 | || options[3] != DEFLATE_CHK_SEQUENCE) | 118 | options[3] != DEFLATE_CHK_SEQUENCE) |
119 | return NULL; | 119 | return NULL; |
120 | w_size = DEFLATE_SIZE(options[2]); | 120 | w_size = DEFLATE_SIZE(options[2]); |
121 | if (w_size < DEFLATE_MIN_SIZE || w_size > DEFLATE_MAX_SIZE) | 121 | if (w_size < DEFLATE_MIN_SIZE || w_size > DEFLATE_MAX_SIZE) |
@@ -163,12 +163,12 @@ static int z_comp_init(void *arg, unsigned char *options, int opt_len, | |||
163 | { | 163 | { |
164 | struct ppp_deflate_state *state = (struct ppp_deflate_state *) arg; | 164 | struct ppp_deflate_state *state = (struct ppp_deflate_state *) arg; |
165 | 165 | ||
166 | if (opt_len < CILEN_DEFLATE | 166 | if (opt_len < CILEN_DEFLATE || |
167 | || (options[0] != CI_DEFLATE && options[0] != CI_DEFLATE_DRAFT) | 167 | (options[0] != CI_DEFLATE && options[0] != CI_DEFLATE_DRAFT) || |
168 | || options[1] != CILEN_DEFLATE | 168 | options[1] != CILEN_DEFLATE || |
169 | || DEFLATE_METHOD(options[2]) != DEFLATE_METHOD_VAL | 169 | DEFLATE_METHOD(options[2]) != DEFLATE_METHOD_VAL || |
170 | || DEFLATE_SIZE(options[2]) != state->w_size | 170 | DEFLATE_SIZE(options[2]) != state->w_size || |
171 | || options[3] != DEFLATE_CHK_SEQUENCE) | 171 | options[3] != DEFLATE_CHK_SEQUENCE) |
172 | return 0; | 172 | return 0; |
173 | 173 | ||
174 | state->seqno = 0; | 174 | state->seqno = 0; |
@@ -330,11 +330,11 @@ static void *z_decomp_alloc(unsigned char *options, int opt_len) | |||
330 | struct ppp_deflate_state *state; | 330 | struct ppp_deflate_state *state; |
331 | int w_size; | 331 | int w_size; |
332 | 332 | ||
333 | if (opt_len != CILEN_DEFLATE | 333 | if (opt_len != CILEN_DEFLATE || |
334 | || (options[0] != CI_DEFLATE && options[0] != CI_DEFLATE_DRAFT) | 334 | (options[0] != CI_DEFLATE && options[0] != CI_DEFLATE_DRAFT) || |
335 | || options[1] != CILEN_DEFLATE | 335 | options[1] != CILEN_DEFLATE || |
336 | || DEFLATE_METHOD(options[2]) != DEFLATE_METHOD_VAL | 336 | DEFLATE_METHOD(options[2]) != DEFLATE_METHOD_VAL || |
337 | || options[3] != DEFLATE_CHK_SEQUENCE) | 337 | options[3] != DEFLATE_CHK_SEQUENCE) |
338 | return NULL; | 338 | return NULL; |
339 | w_size = DEFLATE_SIZE(options[2]); | 339 | w_size = DEFLATE_SIZE(options[2]); |
340 | if (w_size < DEFLATE_MIN_SIZE || w_size > DEFLATE_MAX_SIZE) | 340 | if (w_size < DEFLATE_MIN_SIZE || w_size > DEFLATE_MAX_SIZE) |
@@ -381,12 +381,12 @@ static int z_decomp_init(void *arg, unsigned char *options, int opt_len, | |||
381 | { | 381 | { |
382 | struct ppp_deflate_state *state = (struct ppp_deflate_state *) arg; | 382 | struct ppp_deflate_state *state = (struct ppp_deflate_state *) arg; |
383 | 383 | ||
384 | if (opt_len < CILEN_DEFLATE | 384 | if (opt_len < CILEN_DEFLATE || |
385 | || (options[0] != CI_DEFLATE && options[0] != CI_DEFLATE_DRAFT) | 385 | (options[0] != CI_DEFLATE && options[0] != CI_DEFLATE_DRAFT) || |
386 | || options[1] != CILEN_DEFLATE | 386 | options[1] != CILEN_DEFLATE || |
387 | || DEFLATE_METHOD(options[2]) != DEFLATE_METHOD_VAL | 387 | DEFLATE_METHOD(options[2]) != DEFLATE_METHOD_VAL || |
388 | || DEFLATE_SIZE(options[2]) != state->w_size | 388 | DEFLATE_SIZE(options[2]) != state->w_size || |
389 | || options[3] != DEFLATE_CHK_SEQUENCE) | 389 | options[3] != DEFLATE_CHK_SEQUENCE) |
390 | return 0; | 390 | return 0; |
391 | 391 | ||
392 | state->seqno = 0; | 392 | state->seqno = 0; |
diff --git a/drivers/net/ppp_generic.c b/drivers/net/ppp_generic.c index f671bb810047..2282e729edbe 100644 --- a/drivers/net/ppp_generic.c +++ b/drivers/net/ppp_generic.c | |||
@@ -425,8 +425,8 @@ static ssize_t ppp_read(struct file *file, char __user *buf, | |||
425 | * network traffic (demand mode). | 425 | * network traffic (demand mode). |
426 | */ | 426 | */ |
427 | struct ppp *ppp = PF_TO_PPP(pf); | 427 | struct ppp *ppp = PF_TO_PPP(pf); |
428 | if (ppp->n_channels == 0 | 428 | if (ppp->n_channels == 0 && |
429 | && (ppp->flags & SC_LOOP_TRAFFIC) == 0) | 429 | (ppp->flags & SC_LOOP_TRAFFIC) == 0) |
430 | break; | 430 | break; |
431 | } | 431 | } |
432 | ret = -EAGAIN; | 432 | ret = -EAGAIN; |
@@ -511,8 +511,8 @@ static unsigned int ppp_poll(struct file *file, poll_table *wait) | |||
511 | else if (pf->kind == INTERFACE) { | 511 | else if (pf->kind == INTERFACE) { |
512 | /* see comment in ppp_read */ | 512 | /* see comment in ppp_read */ |
513 | struct ppp *ppp = PF_TO_PPP(pf); | 513 | struct ppp *ppp = PF_TO_PPP(pf); |
514 | if (ppp->n_channels == 0 | 514 | if (ppp->n_channels == 0 && |
515 | && (ppp->flags & SC_LOOP_TRAFFIC) == 0) | 515 | (ppp->flags & SC_LOOP_TRAFFIC) == 0) |
516 | mask |= POLLIN | POLLRDNORM; | 516 | mask |= POLLIN | POLLRDNORM; |
517 | } | 517 | } |
518 | 518 | ||
@@ -1057,8 +1057,8 @@ ppp_xmit_process(struct ppp *ppp) | |||
1057 | ppp_xmit_lock(ppp); | 1057 | ppp_xmit_lock(ppp); |
1058 | if (!ppp->closing) { | 1058 | if (!ppp->closing) { |
1059 | ppp_push(ppp); | 1059 | ppp_push(ppp); |
1060 | while (!ppp->xmit_pending | 1060 | while (!ppp->xmit_pending && |
1061 | && (skb = skb_dequeue(&ppp->file.xq))) | 1061 | (skb = skb_dequeue(&ppp->file.xq))) |
1062 | ppp_send_frame(ppp, skb); | 1062 | ppp_send_frame(ppp, skb); |
1063 | /* If there's no work left to do, tell the core net | 1063 | /* If there's no work left to do, tell the core net |
1064 | code that we can accept some more. */ | 1064 | code that we can accept some more. */ |
@@ -1137,18 +1137,18 @@ ppp_send_frame(struct ppp *ppp, struct sk_buff *skb) | |||
1137 | /* the filter instructions are constructed assuming | 1137 | /* the filter instructions are constructed assuming |
1138 | a four-byte PPP header on each packet */ | 1138 | a four-byte PPP header on each packet */ |
1139 | *skb_push(skb, 2) = 1; | 1139 | *skb_push(skb, 2) = 1; |
1140 | if (ppp->pass_filter | 1140 | if (ppp->pass_filter && |
1141 | && sk_run_filter(skb, ppp->pass_filter, | 1141 | sk_run_filter(skb, ppp->pass_filter, |
1142 | ppp->pass_len) == 0) { | 1142 | ppp->pass_len) == 0) { |
1143 | if (ppp->debug & 1) | 1143 | if (ppp->debug & 1) |
1144 | printk(KERN_DEBUG "PPP: outbound frame not passed\n"); | 1144 | printk(KERN_DEBUG "PPP: outbound frame not passed\n"); |
1145 | kfree_skb(skb); | 1145 | kfree_skb(skb); |
1146 | return; | 1146 | return; |
1147 | } | 1147 | } |
1148 | /* if this packet passes the active filter, record the time */ | 1148 | /* if this packet passes the active filter, record the time */ |
1149 | if (!(ppp->active_filter | 1149 | if (!(ppp->active_filter && |
1150 | && sk_run_filter(skb, ppp->active_filter, | 1150 | sk_run_filter(skb, ppp->active_filter, |
1151 | ppp->active_len) == 0)) | 1151 | ppp->active_len) == 0)) |
1152 | ppp->last_xmit = jiffies; | 1152 | ppp->last_xmit = jiffies; |
1153 | skb_pull(skb, 2); | 1153 | skb_pull(skb, 2); |
1154 | #else | 1154 | #else |
@@ -1202,8 +1202,8 @@ ppp_send_frame(struct ppp *ppp, struct sk_buff *skb) | |||
1202 | } | 1202 | } |
1203 | 1203 | ||
1204 | /* try to do packet compression */ | 1204 | /* try to do packet compression */ |
1205 | if ((ppp->xstate & SC_COMP_RUN) && ppp->xc_state | 1205 | if ((ppp->xstate & SC_COMP_RUN) && ppp->xc_state && |
1206 | && proto != PPP_LCP && proto != PPP_CCP) { | 1206 | proto != PPP_LCP && proto != PPP_CCP) { |
1207 | if (!(ppp->flags & SC_CCP_UP) && (ppp->flags & SC_MUST_COMP)) { | 1207 | if (!(ppp->flags & SC_CCP_UP) && (ppp->flags & SC_MUST_COMP)) { |
1208 | if (net_ratelimit()) | 1208 | if (net_ratelimit()) |
1209 | printk(KERN_ERR "ppp: compression required but down - pkt dropped.\n"); | 1209 | printk(KERN_ERR "ppp: compression required but down - pkt dropped.\n"); |
@@ -1577,8 +1577,8 @@ ppp_input(struct ppp_channel *chan, struct sk_buff *skb) | |||
1577 | /* put it on the channel queue */ | 1577 | /* put it on the channel queue */ |
1578 | skb_queue_tail(&pch->file.rq, skb); | 1578 | skb_queue_tail(&pch->file.rq, skb); |
1579 | /* drop old frames if queue too long */ | 1579 | /* drop old frames if queue too long */ |
1580 | while (pch->file.rq.qlen > PPP_MAX_RQLEN | 1580 | while (pch->file.rq.qlen > PPP_MAX_RQLEN && |
1581 | && (skb = skb_dequeue(&pch->file.rq))) | 1581 | (skb = skb_dequeue(&pch->file.rq))) |
1582 | kfree_skb(skb); | 1582 | kfree_skb(skb); |
1583 | wake_up_interruptible(&pch->file.rwait); | 1583 | wake_up_interruptible(&pch->file.rwait); |
1584 | } else { | 1584 | } else { |
@@ -1654,8 +1654,8 @@ ppp_receive_nonmp_frame(struct ppp *ppp, struct sk_buff *skb) | |||
1654 | * Note that some decompressors need to see uncompressed frames | 1654 | * Note that some decompressors need to see uncompressed frames |
1655 | * that come in as well as compressed frames. | 1655 | * that come in as well as compressed frames. |
1656 | */ | 1656 | */ |
1657 | if (ppp->rc_state && (ppp->rstate & SC_DECOMP_RUN) | 1657 | if (ppp->rc_state && (ppp->rstate & SC_DECOMP_RUN) && |
1658 | && (ppp->rstate & (SC_DC_FERROR | SC_DC_ERROR)) == 0) | 1658 | (ppp->rstate & (SC_DC_FERROR | SC_DC_ERROR)) == 0) |
1659 | skb = ppp_decompress_frame(ppp, skb); | 1659 | skb = ppp_decompress_frame(ppp, skb); |
1660 | 1660 | ||
1661 | if (ppp->flags & SC_MUST_COMP && ppp->rstate & SC_DC_FERROR) | 1661 | if (ppp->flags & SC_MUST_COMP && ppp->rstate & SC_DC_FERROR) |
@@ -1726,8 +1726,8 @@ ppp_receive_nonmp_frame(struct ppp *ppp, struct sk_buff *skb) | |||
1726 | /* control or unknown frame - pass it to pppd */ | 1726 | /* control or unknown frame - pass it to pppd */ |
1727 | skb_queue_tail(&ppp->file.rq, skb); | 1727 | skb_queue_tail(&ppp->file.rq, skb); |
1728 | /* limit queue length by dropping old frames */ | 1728 | /* limit queue length by dropping old frames */ |
1729 | while (ppp->file.rq.qlen > PPP_MAX_RQLEN | 1729 | while (ppp->file.rq.qlen > PPP_MAX_RQLEN && |
1730 | && (skb = skb_dequeue(&ppp->file.rq))) | 1730 | (skb = skb_dequeue(&ppp->file.rq))) |
1731 | kfree_skb(skb); | 1731 | kfree_skb(skb); |
1732 | /* wake up any process polling or blocking on read */ | 1732 | /* wake up any process polling or blocking on read */ |
1733 | wake_up_interruptible(&ppp->file.rwait); | 1733 | wake_up_interruptible(&ppp->file.rwait); |
@@ -1745,26 +1745,26 @@ ppp_receive_nonmp_frame(struct ppp *ppp, struct sk_buff *skb) | |||
1745 | goto err; | 1745 | goto err; |
1746 | 1746 | ||
1747 | *skb_push(skb, 2) = 0; | 1747 | *skb_push(skb, 2) = 0; |
1748 | if (ppp->pass_filter | 1748 | if (ppp->pass_filter && |
1749 | && sk_run_filter(skb, ppp->pass_filter, | 1749 | sk_run_filter(skb, ppp->pass_filter, |
1750 | ppp->pass_len) == 0) { | 1750 | ppp->pass_len) == 0) { |
1751 | if (ppp->debug & 1) | 1751 | if (ppp->debug & 1) |
1752 | printk(KERN_DEBUG "PPP: inbound frame " | 1752 | printk(KERN_DEBUG "PPP: inbound frame " |
1753 | "not passed\n"); | 1753 | "not passed\n"); |
1754 | kfree_skb(skb); | 1754 | kfree_skb(skb); |
1755 | return; | 1755 | return; |
1756 | } | 1756 | } |
1757 | if (!(ppp->active_filter | 1757 | if (!(ppp->active_filter && |
1758 | && sk_run_filter(skb, ppp->active_filter, | 1758 | sk_run_filter(skb, ppp->active_filter, |
1759 | ppp->active_len) == 0)) | 1759 | ppp->active_len) == 0)) |
1760 | ppp->last_recv = jiffies; | 1760 | ppp->last_recv = jiffies; |
1761 | __skb_pull(skb, 2); | 1761 | __skb_pull(skb, 2); |
1762 | } else | 1762 | } else |
1763 | #endif /* CONFIG_PPP_FILTER */ | 1763 | #endif /* CONFIG_PPP_FILTER */ |
1764 | ppp->last_recv = jiffies; | 1764 | ppp->last_recv = jiffies; |
1765 | 1765 | ||
1766 | if ((ppp->dev->flags & IFF_UP) == 0 | 1766 | if ((ppp->dev->flags & IFF_UP) == 0 || |
1767 | || ppp->npmode[npi] != NPMODE_PASS) { | 1767 | ppp->npmode[npi] != NPMODE_PASS) { |
1768 | kfree_skb(skb); | 1768 | kfree_skb(skb); |
1769 | } else { | 1769 | } else { |
1770 | /* chop off protocol */ | 1770 | /* chop off protocol */ |
@@ -2228,13 +2228,13 @@ ppp_set_compress(struct ppp *ppp, unsigned long arg) | |||
2228 | unsigned char ccp_option[CCP_MAX_OPTION_LENGTH]; | 2228 | unsigned char ccp_option[CCP_MAX_OPTION_LENGTH]; |
2229 | 2229 | ||
2230 | err = -EFAULT; | 2230 | err = -EFAULT; |
2231 | if (copy_from_user(&data, (void __user *) arg, sizeof(data)) | 2231 | if (copy_from_user(&data, (void __user *) arg, sizeof(data)) || |
2232 | || (data.length <= CCP_MAX_OPTION_LENGTH | 2232 | (data.length <= CCP_MAX_OPTION_LENGTH && |
2233 | && copy_from_user(ccp_option, (void __user *) data.ptr, data.length))) | 2233 | copy_from_user(ccp_option, (void __user *) data.ptr, data.length))) |
2234 | goto out; | 2234 | goto out; |
2235 | err = -EINVAL; | 2235 | err = -EINVAL; |
2236 | if (data.length > CCP_MAX_OPTION_LENGTH | 2236 | if (data.length > CCP_MAX_OPTION_LENGTH || |
2237 | || ccp_option[1] < 2 || ccp_option[1] > data.length) | 2237 | ccp_option[1] < 2 || ccp_option[1] > data.length) |
2238 | goto out; | 2238 | goto out; |
2239 | 2239 | ||
2240 | cp = try_then_request_module( | 2240 | cp = try_then_request_module( |
diff --git a/drivers/net/ppp_mppe.c b/drivers/net/ppp_mppe.c index 88f03c9e9403..6d1a1b80cc3e 100644 --- a/drivers/net/ppp_mppe.c +++ b/drivers/net/ppp_mppe.c | |||
@@ -195,8 +195,8 @@ static void *mppe_alloc(unsigned char *options, int optlen) | |||
195 | struct ppp_mppe_state *state; | 195 | struct ppp_mppe_state *state; |
196 | unsigned int digestsize; | 196 | unsigned int digestsize; |
197 | 197 | ||
198 | if (optlen != CILEN_MPPE + sizeof(state->master_key) | 198 | if (optlen != CILEN_MPPE + sizeof(state->master_key) || |
199 | || options[0] != CI_MPPE || options[1] != CILEN_MPPE) | 199 | options[0] != CI_MPPE || options[1] != CILEN_MPPE) |
200 | goto out; | 200 | goto out; |
201 | 201 | ||
202 | state = kzalloc(sizeof(*state), GFP_KERNEL); | 202 | state = kzalloc(sizeof(*state), GFP_KERNEL); |
@@ -276,8 +276,8 @@ mppe_init(void *arg, unsigned char *options, int optlen, int unit, int debug, | |||
276 | struct ppp_mppe_state *state = (struct ppp_mppe_state *) arg; | 276 | struct ppp_mppe_state *state = (struct ppp_mppe_state *) arg; |
277 | unsigned char mppe_opts; | 277 | unsigned char mppe_opts; |
278 | 278 | ||
279 | if (optlen != CILEN_MPPE | 279 | if (optlen != CILEN_MPPE || |
280 | || options[0] != CI_MPPE || options[1] != CILEN_MPPE) | 280 | options[0] != CI_MPPE || options[1] != CILEN_MPPE) |
281 | return 0; | 281 | return 0; |
282 | 282 | ||
283 | MPPE_CI_TO_OPTS(&options[2], mppe_opts); | 283 | MPPE_CI_TO_OPTS(&options[2], mppe_opts); |
diff --git a/drivers/net/ppp_synctty.c b/drivers/net/ppp_synctty.c index c908b08dc981..3a13cecae3e2 100644 --- a/drivers/net/ppp_synctty.c +++ b/drivers/net/ppp_synctty.c | |||
@@ -662,8 +662,8 @@ ppp_sync_push(struct syncppp *ap) | |||
662 | } | 662 | } |
663 | /* haven't made any progress */ | 663 | /* haven't made any progress */ |
664 | spin_unlock_bh(&ap->xmit_lock); | 664 | spin_unlock_bh(&ap->xmit_lock); |
665 | if (!(test_bit(XMIT_WAKEUP, &ap->xmit_flags) | 665 | if (!(test_bit(XMIT_WAKEUP, &ap->xmit_flags) || |
666 | || (!tty_stuffed && ap->tpkt))) | 666 | (!tty_stuffed && ap->tpkt))) |
667 | break; | 667 | break; |
668 | if (!spin_trylock_bh(&ap->xmit_lock)) | 668 | if (!spin_trylock_bh(&ap->xmit_lock)) |
669 | break; | 669 | break; |
diff --git a/drivers/net/pppoe.c b/drivers/net/pppoe.c index a4ed776d823b..cdd11ba100ea 100644 --- a/drivers/net/pppoe.c +++ b/drivers/net/pppoe.c | |||
@@ -323,8 +323,8 @@ static void pppoe_flush_dev(struct net_device *dev) | |||
323 | write_unlock_bh(&pn->hash_lock); | 323 | write_unlock_bh(&pn->hash_lock); |
324 | lock_sock(sk); | 324 | lock_sock(sk); |
325 | 325 | ||
326 | if (po->pppoe_dev == dev | 326 | if (po->pppoe_dev == dev && |
327 | && sk->sk_state & (PPPOX_CONNECTED | PPPOX_BOUND)) { | 327 | sk->sk_state & (PPPOX_CONNECTED | PPPOX_BOUND)) { |
328 | pppox_unbind_sock(sk); | 328 | pppox_unbind_sock(sk); |
329 | sk->sk_state = PPPOX_ZOMBIE; | 329 | sk->sk_state = PPPOX_ZOMBIE; |
330 | sk->sk_state_change(sk); | 330 | sk->sk_state_change(sk); |
diff --git a/drivers/net/qla3xxx.c b/drivers/net/qla3xxx.c index 4c610511eb40..e3e6bc917c87 100644 --- a/drivers/net/qla3xxx.c +++ b/drivers/net/qla3xxx.c | |||
@@ -1969,8 +1969,8 @@ static void ql_update_lrg_bufq_prod_index(struct ql3_adapter *qdev) | |||
1969 | struct ql_rcv_buf_cb *lrg_buf_cb; | 1969 | struct ql_rcv_buf_cb *lrg_buf_cb; |
1970 | struct ql3xxx_port_registers __iomem *port_regs = qdev->mem_map_registers; | 1970 | struct ql3xxx_port_registers __iomem *port_regs = qdev->mem_map_registers; |
1971 | 1971 | ||
1972 | if ((qdev->lrg_buf_free_count >= 8) | 1972 | if ((qdev->lrg_buf_free_count >= 8) && |
1973 | && (qdev->lrg_buf_release_cnt >= 16)) { | 1973 | (qdev->lrg_buf_release_cnt >= 16)) { |
1974 | 1974 | ||
1975 | if (qdev->lrg_buf_skb_check) | 1975 | if (qdev->lrg_buf_skb_check) |
1976 | if (!ql_populate_free_queue(qdev)) | 1976 | if (!ql_populate_free_queue(qdev)) |
@@ -1978,8 +1978,8 @@ static void ql_update_lrg_bufq_prod_index(struct ql3_adapter *qdev) | |||
1978 | 1978 | ||
1979 | lrg_buf_q_ele = qdev->lrg_buf_next_free; | 1979 | lrg_buf_q_ele = qdev->lrg_buf_next_free; |
1980 | 1980 | ||
1981 | while ((qdev->lrg_buf_release_cnt >= 16) | 1981 | while ((qdev->lrg_buf_release_cnt >= 16) && |
1982 | && (qdev->lrg_buf_free_count >= 8)) { | 1982 | (qdev->lrg_buf_free_count >= 8)) { |
1983 | 1983 | ||
1984 | for (i = 0; i < 8; i++) { | 1984 | for (i = 0; i < 8; i++) { |
1985 | lrg_buf_cb = | 1985 | lrg_buf_cb = |
diff --git a/drivers/net/qlge/qlge_main.c b/drivers/net/qlge/qlge_main.c index 7692299e7826..707b391afa02 100644 --- a/drivers/net/qlge/qlge_main.c +++ b/drivers/net/qlge/qlge_main.c | |||
@@ -2347,8 +2347,8 @@ static int ql_alloc_tx_resources(struct ql_adapter *qdev, | |||
2347 | pci_alloc_consistent(qdev->pdev, tx_ring->wq_size, | 2347 | pci_alloc_consistent(qdev->pdev, tx_ring->wq_size, |
2348 | &tx_ring->wq_base_dma); | 2348 | &tx_ring->wq_base_dma); |
2349 | 2349 | ||
2350 | if ((tx_ring->wq_base == NULL) | 2350 | if ((tx_ring->wq_base == NULL) || |
2351 | || tx_ring->wq_base_dma & WQ_ADDR_ALIGN) { | 2351 | tx_ring->wq_base_dma & WQ_ADDR_ALIGN) { |
2352 | QPRINTK(qdev, IFUP, ERR, "tx_ring alloc failed.\n"); | 2352 | QPRINTK(qdev, IFUP, ERR, "tx_ring alloc failed.\n"); |
2353 | return -ENOMEM; | 2353 | return -ENOMEM; |
2354 | } | 2354 | } |
diff --git a/drivers/net/r6040.c b/drivers/net/r6040.c index 0f30ea4e97ec..f03e2e4a15a8 100644 --- a/drivers/net/r6040.c +++ b/drivers/net/r6040.c | |||
@@ -958,8 +958,7 @@ static void r6040_multicast_list(struct net_device *dev) | |||
958 | } | 958 | } |
959 | /* Too many multicast addresses | 959 | /* Too many multicast addresses |
960 | * accept all traffic */ | 960 | * accept all traffic */ |
961 | else if ((dev->mc_count > MCAST_MAX) | 961 | else if ((dev->mc_count > MCAST_MAX) || (dev->flags & IFF_ALLMULTI)) |
962 | || (dev->flags & IFF_ALLMULTI)) | ||
963 | reg |= 0x0020; | 962 | reg |= 0x0020; |
964 | 963 | ||
965 | iowrite16(reg, ioaddr); | 964 | iowrite16(reg, ioaddr); |
diff --git a/drivers/net/r8169.c b/drivers/net/r8169.c index f6899c3500b5..acfc5a3aa490 100644 --- a/drivers/net/r8169.c +++ b/drivers/net/r8169.c | |||
@@ -4763,8 +4763,8 @@ static void rtl_set_rx_mode(struct net_device *dev) | |||
4763 | AcceptBroadcast | AcceptMulticast | AcceptMyPhys | | 4763 | AcceptBroadcast | AcceptMulticast | AcceptMyPhys | |
4764 | AcceptAllPhys; | 4764 | AcceptAllPhys; |
4765 | mc_filter[1] = mc_filter[0] = 0xffffffff; | 4765 | mc_filter[1] = mc_filter[0] = 0xffffffff; |
4766 | } else if ((dev->mc_count > multicast_filter_limit) | 4766 | } else if ((dev->mc_count > multicast_filter_limit) || |
4767 | || (dev->flags & IFF_ALLMULTI)) { | 4767 | (dev->flags & IFF_ALLMULTI)) { |
4768 | /* Too many to filter perfectly -- accept all multicasts. */ | 4768 | /* Too many to filter perfectly -- accept all multicasts. */ |
4769 | rx_mode = AcceptBroadcast | AcceptMulticast | AcceptMyPhys; | 4769 | rx_mode = AcceptBroadcast | AcceptMulticast | AcceptMyPhys; |
4770 | mc_filter[1] = mc_filter[0] = 0xffffffff; | 4770 | mc_filter[1] = mc_filter[0] = 0xffffffff; |
diff --git a/drivers/net/s6gmac.c b/drivers/net/s6gmac.c index d81706e91aa7..45f26344b368 100644 --- a/drivers/net/s6gmac.c +++ b/drivers/net/s6gmac.c | |||
@@ -373,9 +373,9 @@ struct s6gmac { | |||
373 | static void s6gmac_rx_fillfifo(struct s6gmac *pd) | 373 | static void s6gmac_rx_fillfifo(struct s6gmac *pd) |
374 | { | 374 | { |
375 | struct sk_buff *skb; | 375 | struct sk_buff *skb; |
376 | while ((((u8)(pd->rx_skb_i - pd->rx_skb_o)) < S6_NUM_RX_SKB) | 376 | while ((((u8)(pd->rx_skb_i - pd->rx_skb_o)) < S6_NUM_RX_SKB) && |
377 | && (!s6dmac_fifo_full(pd->rx_dma, pd->rx_chan)) | 377 | (!s6dmac_fifo_full(pd->rx_dma, pd->rx_chan)) && |
378 | && (skb = dev_alloc_skb(S6_MAX_FRLEN + 2))) { | 378 | (skb = dev_alloc_skb(S6_MAX_FRLEN + 2))) { |
379 | pd->rx_skb[(pd->rx_skb_i++) % S6_NUM_RX_SKB] = skb; | 379 | pd->rx_skb[(pd->rx_skb_i++) % S6_NUM_RX_SKB] = skb; |
380 | s6dmac_put_fifo_cache(pd->rx_dma, pd->rx_chan, | 380 | s6dmac_put_fifo_cache(pd->rx_dma, pd->rx_chan, |
381 | pd->io, (u32)skb->data, S6_MAX_FRLEN); | 381 | pd->io, (u32)skb->data, S6_MAX_FRLEN); |
diff --git a/drivers/net/sc92031.c b/drivers/net/sc92031.c index b7e0eb40a8bd..e35050322f97 100644 --- a/drivers/net/sc92031.c +++ b/drivers/net/sc92031.c | |||
@@ -428,9 +428,9 @@ static void _sc92031_set_mar(struct net_device *dev) | |||
428 | void __iomem *port_base = priv->port_base; | 428 | void __iomem *port_base = priv->port_base; |
429 | u32 mar0 = 0, mar1 = 0; | 429 | u32 mar0 = 0, mar1 = 0; |
430 | 430 | ||
431 | if ((dev->flags & IFF_PROMISC) | 431 | if ((dev->flags & IFF_PROMISC) || |
432 | || dev->mc_count > multicast_filter_limit | 432 | dev->mc_count > multicast_filter_limit || |
433 | || (dev->flags & IFF_ALLMULTI)) | 433 | (dev->flags & IFF_ALLMULTI)) |
434 | mar0 = mar1 = 0xffffffff; | 434 | mar0 = mar1 = 0xffffffff; |
435 | else if (dev->flags & IFF_MULTICAST) { | 435 | else if (dev->flags & IFF_MULTICAST) { |
436 | struct dev_mc_list *mc_list; | 436 | struct dev_mc_list *mc_list; |
@@ -777,10 +777,10 @@ static void _sc92031_rx_tasklet(struct net_device *dev) | |||
777 | 777 | ||
778 | rx_ring_offset = (rx_ring_offset + 4) % RX_BUF_LEN; | 778 | rx_ring_offset = (rx_ring_offset + 4) % RX_BUF_LEN; |
779 | 779 | ||
780 | if (unlikely(rx_status == 0 | 780 | if (unlikely(rx_status == 0 || |
781 | || rx_size > (MAX_ETH_FRAME_SIZE + 4) | 781 | rx_size > (MAX_ETH_FRAME_SIZE + 4) || |
782 | || rx_size < 16 | 782 | rx_size < 16 || |
783 | || !(rx_status & RxStatesOK))) { | 783 | !(rx_status & RxStatesOK))) { |
784 | _sc92031_rx_tasklet_error(dev, rx_status, rx_size); | 784 | _sc92031_rx_tasklet_error(dev, rx_status, rx_size); |
785 | break; | 785 | break; |
786 | } | 786 | } |
diff --git a/drivers/net/skge.c b/drivers/net/skge.c index 34b4e7d500da..379a3dc00163 100644 --- a/drivers/net/skge.c +++ b/drivers/net/skge.c | |||
@@ -238,8 +238,8 @@ static int skge_set_wol(struct net_device *dev, struct ethtool_wolinfo *wol) | |||
238 | struct skge_port *skge = netdev_priv(dev); | 238 | struct skge_port *skge = netdev_priv(dev); |
239 | struct skge_hw *hw = skge->hw; | 239 | struct skge_hw *hw = skge->hw; |
240 | 240 | ||
241 | if ((wol->wolopts & ~wol_supported(hw)) | 241 | if ((wol->wolopts & ~wol_supported(hw)) || |
242 | || !device_can_wakeup(&hw->pdev->dev)) | 242 | !device_can_wakeup(&hw->pdev->dev)) |
243 | return -EOPNOTSUPP; | 243 | return -EOPNOTSUPP; |
244 | 244 | ||
245 | skge->wol = wol->wolopts; | 245 | skge->wol = wol->wolopts; |
@@ -576,9 +576,10 @@ static void skge_get_pauseparam(struct net_device *dev, | |||
576 | { | 576 | { |
577 | struct skge_port *skge = netdev_priv(dev); | 577 | struct skge_port *skge = netdev_priv(dev); |
578 | 578 | ||
579 | ecmd->rx_pause = (skge->flow_control == FLOW_MODE_SYMMETRIC) | 579 | ecmd->rx_pause = ((skge->flow_control == FLOW_MODE_SYMMETRIC) || |
580 | || (skge->flow_control == FLOW_MODE_SYM_OR_REM); | 580 | (skge->flow_control == FLOW_MODE_SYM_OR_REM)); |
581 | ecmd->tx_pause = ecmd->rx_pause || (skge->flow_control == FLOW_MODE_LOC_SEND); | 581 | ecmd->tx_pause = (ecmd->rx_pause || |
582 | (skge->flow_control == FLOW_MODE_LOC_SEND)); | ||
582 | 583 | ||
583 | ecmd->autoneg = ecmd->rx_pause || ecmd->tx_pause; | 584 | ecmd->autoneg = ecmd->rx_pause || ecmd->tx_pause; |
584 | } | 585 | } |
@@ -2779,8 +2780,8 @@ static netdev_tx_t skge_xmit_frame(struct sk_buff *skb, | |||
2779 | /* This seems backwards, but it is what the sk98lin | 2780 | /* This seems backwards, but it is what the sk98lin |
2780 | * does. Looks like hardware is wrong? | 2781 | * does. Looks like hardware is wrong? |
2781 | */ | 2782 | */ |
2782 | if (ipip_hdr(skb)->protocol == IPPROTO_UDP | 2783 | if (ipip_hdr(skb)->protocol == IPPROTO_UDP && |
2783 | && hw->chip_rev == 0 && hw->chip_id == CHIP_ID_YUKON) | 2784 | hw->chip_rev == 0 && hw->chip_id == CHIP_ID_YUKON) |
2784 | control = BMU_TCP_CHECK; | 2785 | control = BMU_TCP_CHECK; |
2785 | else | 2786 | else |
2786 | control = BMU_UDP_CHECK; | 2787 | control = BMU_UDP_CHECK; |
@@ -2948,8 +2949,8 @@ static void genesis_set_multicast(struct net_device *dev) | |||
2948 | else { | 2949 | else { |
2949 | memset(filter, 0, sizeof(filter)); | 2950 | memset(filter, 0, sizeof(filter)); |
2950 | 2951 | ||
2951 | if (skge->flow_status == FLOW_STAT_REM_SEND | 2952 | if (skge->flow_status == FLOW_STAT_REM_SEND || |
2952 | || skge->flow_status == FLOW_STAT_SYMMETRIC) | 2953 | skge->flow_status == FLOW_STAT_SYMMETRIC) |
2953 | genesis_add_filter(filter, pause_mc_addr); | 2954 | genesis_add_filter(filter, pause_mc_addr); |
2954 | 2955 | ||
2955 | for (i = 0; list && i < count; i++, list = list->next) | 2956 | for (i = 0; list && i < count; i++, list = list->next) |
@@ -2972,8 +2973,8 @@ static void yukon_set_multicast(struct net_device *dev) | |||
2972 | struct skge_hw *hw = skge->hw; | 2973 | struct skge_hw *hw = skge->hw; |
2973 | int port = skge->port; | 2974 | int port = skge->port; |
2974 | struct dev_mc_list *list = dev->mc_list; | 2975 | struct dev_mc_list *list = dev->mc_list; |
2975 | int rx_pause = (skge->flow_status == FLOW_STAT_REM_SEND | 2976 | int rx_pause = (skge->flow_status == FLOW_STAT_REM_SEND || |
2976 | || skge->flow_status == FLOW_STAT_SYMMETRIC); | 2977 | skge->flow_status == FLOW_STAT_SYMMETRIC); |
2977 | u16 reg; | 2978 | u16 reg; |
2978 | u8 filter[8]; | 2979 | u8 filter[8]; |
2979 | 2980 | ||
diff --git a/drivers/net/sky2.c b/drivers/net/sky2.c index a3d99913f184..3943d89afb2b 100644 --- a/drivers/net/sky2.c +++ b/drivers/net/sky2.c | |||
@@ -374,8 +374,8 @@ static void sky2_phy_init(struct sky2_hw *hw, unsigned port) | |||
374 | ctrl |= PHY_M_PC_MDI_XMODE(PHY_M_PC_ENA_AUTO); | 374 | ctrl |= PHY_M_PC_MDI_XMODE(PHY_M_PC_ENA_AUTO); |
375 | 375 | ||
376 | /* downshift on PHY 88E1112 and 88E1149 is changed */ | 376 | /* downshift on PHY 88E1112 and 88E1149 is changed */ |
377 | if ( (sky2->flags & SKY2_FLAG_AUTO_SPEED) | 377 | if ( (sky2->flags & SKY2_FLAG_AUTO_SPEED) && |
378 | && (hw->flags & SKY2_HW_NEWER_PHY)) { | 378 | (hw->flags & SKY2_HW_NEWER_PHY)) { |
379 | /* set downshift counter to 3x and enable downshift */ | 379 | /* set downshift counter to 3x and enable downshift */ |
380 | ctrl &= ~PHY_M_PC_DSC_MSK; | 380 | ctrl &= ~PHY_M_PC_DSC_MSK; |
381 | ctrl |= PHY_M_PC_DSC(2) | PHY_M_PC_DOWN_S_ENA; | 381 | ctrl |= PHY_M_PC_DSC(2) | PHY_M_PC_DOWN_S_ENA; |
@@ -619,8 +619,8 @@ static void sky2_phy_init(struct sky2_hw *hw, unsigned port) | |||
619 | /* no effect on Yukon-XL */ | 619 | /* no effect on Yukon-XL */ |
620 | gm_phy_write(hw, port, PHY_MARV_LED_CTRL, ledctrl); | 620 | gm_phy_write(hw, port, PHY_MARV_LED_CTRL, ledctrl); |
621 | 621 | ||
622 | if ( !(sky2->flags & SKY2_FLAG_AUTO_SPEED) | 622 | if (!(sky2->flags & SKY2_FLAG_AUTO_SPEED) || |
623 | || sky2->speed == SPEED_100) { | 623 | sky2->speed == SPEED_100) { |
624 | /* turn on 100 Mbps LED (LED_LINK100) */ | 624 | /* turn on 100 Mbps LED (LED_LINK100) */ |
625 | ledover |= PHY_M_LED_MO_100(MO_LED_ON); | 625 | ledover |= PHY_M_LED_MO_100(MO_LED_ON); |
626 | } | 626 | } |
@@ -937,8 +937,8 @@ static void sky2_mac_init(struct sky2_hw *hw, unsigned port) | |||
937 | /* On chips without ram buffer, pause is controled by MAC level */ | 937 | /* On chips without ram buffer, pause is controled by MAC level */ |
938 | if (!(hw->flags & SKY2_HW_RAM_BUFFER)) { | 938 | if (!(hw->flags & SKY2_HW_RAM_BUFFER)) { |
939 | /* Pause threshold is scaled by 8 in bytes */ | 939 | /* Pause threshold is scaled by 8 in bytes */ |
940 | if (hw->chip_id == CHIP_ID_YUKON_FE_P | 940 | if (hw->chip_id == CHIP_ID_YUKON_FE_P && |
941 | && hw->chip_rev == CHIP_REV_YU_FE2_A0) | 941 | hw->chip_rev == CHIP_REV_YU_FE2_A0) |
942 | reg = 1568 / 8; | 942 | reg = 1568 / 8; |
943 | else | 943 | else |
944 | reg = 1024 / 8; | 944 | reg = 1024 / 8; |
@@ -1353,8 +1353,8 @@ static int sky2_rx_start(struct sky2_port *sky2) | |||
1353 | /* These chips have no ram buffer? | 1353 | /* These chips have no ram buffer? |
1354 | * MAC Rx RAM Read is controlled by hardware */ | 1354 | * MAC Rx RAM Read is controlled by hardware */ |
1355 | if (hw->chip_id == CHIP_ID_YUKON_EC_U && | 1355 | if (hw->chip_id == CHIP_ID_YUKON_EC_U && |
1356 | (hw->chip_rev == CHIP_REV_YU_EC_U_A1 | 1356 | (hw->chip_rev == CHIP_REV_YU_EC_U_A1 || |
1357 | || hw->chip_rev == CHIP_REV_YU_EC_U_B0)) | 1357 | hw->chip_rev == CHIP_REV_YU_EC_U_B0)) |
1358 | sky2_write32(hw, Q_ADDR(rxq, Q_TEST), F_M_RX_RAM_DIS); | 1358 | sky2_write32(hw, Q_ADDR(rxq, Q_TEST), F_M_RX_RAM_DIS); |
1359 | 1359 | ||
1360 | sky2_prefetch_init(hw, rxq, sky2->rx_le_map, RX_LE_SIZE - 1); | 1360 | sky2_prefetch_init(hw, rxq, sky2->rx_le_map, RX_LE_SIZE - 1); |
@@ -1560,8 +1560,8 @@ static int sky2_up(struct net_device *dev) | |||
1560 | sky2_write32(hw, Q_ADDR(txqaddr[port], Q_TEST), F_TX_CHK_AUTO_OFF); | 1560 | sky2_write32(hw, Q_ADDR(txqaddr[port], Q_TEST), F_TX_CHK_AUTO_OFF); |
1561 | 1561 | ||
1562 | /* Set almost empty threshold */ | 1562 | /* Set almost empty threshold */ |
1563 | if (hw->chip_id == CHIP_ID_YUKON_EC_U | 1563 | if (hw->chip_id == CHIP_ID_YUKON_EC_U && |
1564 | && hw->chip_rev == CHIP_REV_YU_EC_U_A0) | 1564 | hw->chip_rev == CHIP_REV_YU_EC_U_A0) |
1565 | sky2_write16(hw, Q_ADDR(txqaddr[port], Q_AL), ECU_TXFF_LEV); | 1565 | sky2_write16(hw, Q_ADDR(txqaddr[port], Q_AL), ECU_TXFF_LEV); |
1566 | 1566 | ||
1567 | sky2_prefetch_init(hw, txqaddr[port], sky2->tx_le_map, | 1567 | sky2_prefetch_init(hw, txqaddr[port], sky2->tx_le_map, |
@@ -1907,8 +1907,8 @@ static int sky2_down(struct net_device *dev) | |||
1907 | sky2_write8(hw, SK_REG(port, GPHY_CTRL), GPC_RST_SET); | 1907 | sky2_write8(hw, SK_REG(port, GPHY_CTRL), GPC_RST_SET); |
1908 | 1908 | ||
1909 | /* Workaround shared GMAC reset */ | 1909 | /* Workaround shared GMAC reset */ |
1910 | if (!(hw->chip_id == CHIP_ID_YUKON_XL && hw->chip_rev == 0 | 1910 | if (!(hw->chip_id == CHIP_ID_YUKON_XL && hw->chip_rev == 0 && |
1911 | && port == 0 && hw->dev[1] && netif_running(hw->dev[1]))) | 1911 | port == 0 && hw->dev[1] && netif_running(hw->dev[1]))) |
1912 | sky2_write8(hw, SK_REG(port, GMAC_CTRL), GMC_RST_SET); | 1912 | sky2_write8(hw, SK_REG(port, GMAC_CTRL), GMC_RST_SET); |
1913 | 1913 | ||
1914 | sky2_write8(hw, SK_REG(port, RX_GMF_CTRL_T), GMF_RST_SET); | 1914 | sky2_write8(hw, SK_REG(port, RX_GMF_CTRL_T), GMF_RST_SET); |
@@ -2085,8 +2085,8 @@ static int sky2_autoneg_done(struct sky2_port *sky2, u16 aux) | |||
2085 | sky2->flow_status = FC_TX; | 2085 | sky2->flow_status = FC_TX; |
2086 | } | 2086 | } |
2087 | 2087 | ||
2088 | if (sky2->duplex == DUPLEX_HALF && sky2->speed < SPEED_1000 | 2088 | if (sky2->duplex == DUPLEX_HALF && sky2->speed < SPEED_1000 && |
2089 | && !(hw->chip_id == CHIP_ID_YUKON_EC_U || hw->chip_id == CHIP_ID_YUKON_EX)) | 2089 | !(hw->chip_id == CHIP_ID_YUKON_EC_U || hw->chip_id == CHIP_ID_YUKON_EX)) |
2090 | sky2->flow_status = FC_NONE; | 2090 | sky2->flow_status = FC_NONE; |
2091 | 2091 | ||
2092 | if (sky2->flow_status & FC_TX) | 2092 | if (sky2->flow_status & FC_TX) |
@@ -3244,8 +3244,8 @@ static int sky2_set_wol(struct net_device *dev, struct ethtool_wolinfo *wol) | |||
3244 | struct sky2_port *sky2 = netdev_priv(dev); | 3244 | struct sky2_port *sky2 = netdev_priv(dev); |
3245 | struct sky2_hw *hw = sky2->hw; | 3245 | struct sky2_hw *hw = sky2->hw; |
3246 | 3246 | ||
3247 | if ((wol->wolopts & ~sky2_wol_supported(sky2->hw)) | 3247 | if ((wol->wolopts & ~sky2_wol_supported(sky2->hw)) || |
3248 | || !device_can_wakeup(&hw->pdev->dev)) | 3248 | !device_can_wakeup(&hw->pdev->dev)) |
3249 | return -EOPNOTSUPP; | 3249 | return -EOPNOTSUPP; |
3250 | 3250 | ||
3251 | sky2->wol = wol->wolopts; | 3251 | sky2->wol = wol->wolopts; |
diff --git a/drivers/net/slip.c b/drivers/net/slip.c index 6640469b5d3b..ba5bbc503446 100644 --- a/drivers/net/slip.c +++ b/drivers/net/slip.c | |||
@@ -956,8 +956,8 @@ static void slip_unesc(struct slip *sl, unsigned char s) | |||
956 | clear_bit(SLF_KEEPTEST, &sl->flags); | 956 | clear_bit(SLF_KEEPTEST, &sl->flags); |
957 | #endif | 957 | #endif |
958 | 958 | ||
959 | if (!test_and_clear_bit(SLF_ERROR, &sl->flags) | 959 | if (!test_and_clear_bit(SLF_ERROR, &sl->flags) && |
960 | && (sl->rcount > 2)) | 960 | (sl->rcount > 2)) |
961 | sl_bump(sl); | 961 | sl_bump(sl); |
962 | clear_bit(SLF_ESCAPE, &sl->flags); | 962 | clear_bit(SLF_ESCAPE, &sl->flags); |
963 | sl->rcount = 0; | 963 | sl->rcount = 0; |
@@ -1039,8 +1039,8 @@ static void slip_unesc6(struct slip *sl, unsigned char s) | |||
1039 | clear_bit(SLF_KEEPTEST, &sl->flags); | 1039 | clear_bit(SLF_KEEPTEST, &sl->flags); |
1040 | #endif | 1040 | #endif |
1041 | 1041 | ||
1042 | if (!test_and_clear_bit(SLF_ERROR, &sl->flags) | 1042 | if (!test_and_clear_bit(SLF_ERROR, &sl->flags) && |
1043 | && (sl->rcount > 2)) | 1043 | (sl->rcount > 2)) |
1044 | sl_bump(sl); | 1044 | sl_bump(sl); |
1045 | sl->rcount = 0; | 1045 | sl->rcount = 0; |
1046 | sl->xbits = 0; | 1046 | sl->xbits = 0; |
diff --git a/drivers/net/smc-mca.c b/drivers/net/smc-mca.c index c791ef76c1d6..a93f122e9a96 100644 --- a/drivers/net/smc-mca.c +++ b/drivers/net/smc-mca.c | |||
@@ -268,9 +268,9 @@ static int __init ultramca_probe(struct device *gen_dev) | |||
268 | } | 268 | } |
269 | } | 269 | } |
270 | 270 | ||
271 | if(!tirq || !tbase | 271 | if(!tirq || !tbase || |
272 | || (irq && irq != tirq) | 272 | (irq && irq != tirq) || |
273 | || (base_addr && tbase != base_addr)) | 273 | (base_addr && tbase != base_addr)) |
274 | /* FIXME: we're trying to force the ordering of the | 274 | /* FIXME: we're trying to force the ordering of the |
275 | * devices here, there should be a way of getting this | 275 | * devices here, there should be a way of getting this |
276 | * to happen */ | 276 | * to happen */ |
diff --git a/drivers/net/smc91x.h b/drivers/net/smc91x.h index 3911be7c0cba..7815bfc300f5 100644 --- a/drivers/net/smc91x.h +++ b/drivers/net/smc91x.h | |||
@@ -158,8 +158,8 @@ static inline void SMC_outw(u16 val, void __iomem *ioaddr, int reg) | |||
158 | #define SMC_outsb(a, r, p, l) writesb((a) + (r), p, (l)) | 158 | #define SMC_outsb(a, r, p, l) writesb((a) + (r), p, (l)) |
159 | #define SMC_IRQ_FLAGS (-1) /* from resource */ | 159 | #define SMC_IRQ_FLAGS (-1) /* from resource */ |
160 | 160 | ||
161 | #elif defined(CONFIG_MACH_LOGICPD_PXA270) \ | 161 | #elif defined(CONFIG_MACH_LOGICPD_PXA270) || \ |
162 | || defined(CONFIG_MACH_NOMADIK_8815NHK) | 162 | defined(CONFIG_MACH_NOMADIK_8815NHK) |
163 | 163 | ||
164 | #define SMC_CAN_USE_8BIT 0 | 164 | #define SMC_CAN_USE_8BIT 0 |
165 | #define SMC_CAN_USE_16BIT 1 | 165 | #define SMC_CAN_USE_16BIT 1 |
@@ -258,9 +258,9 @@ SMC_outw(u16 val, void __iomem *ioaddr, int reg) | |||
258 | #define RPC_LSA_DEFAULT RPC_LED_TX_RX | 258 | #define RPC_LSA_DEFAULT RPC_LED_TX_RX |
259 | #define RPC_LSB_DEFAULT RPC_LED_100_10 | 259 | #define RPC_LSB_DEFAULT RPC_LED_100_10 |
260 | 260 | ||
261 | #elif defined(CONFIG_MACH_LPD79520) \ | 261 | #elif defined(CONFIG_MACH_LPD79520) || \ |
262 | || defined(CONFIG_MACH_LPD7A400) \ | 262 | defined(CONFIG_MACH_LPD7A400) || \ |
263 | || defined(CONFIG_MACH_LPD7A404) | 263 | defined(CONFIG_MACH_LPD7A404) |
264 | 264 | ||
265 | /* The LPD7X_IOBARRIER is necessary to overcome a mismatch between the | 265 | /* The LPD7X_IOBARRIER is necessary to overcome a mismatch between the |
266 | * way that the CPU handles chip selects and the way that the SMC chip | 266 | * way that the CPU handles chip selects and the way that the SMC chip |
diff --git a/drivers/net/smsc911x.c b/drivers/net/smsc911x.c index 7f01e60d5172..4d0d5c56bed8 100644 --- a/drivers/net/smsc911x.c +++ b/drivers/net/smsc911x.c | |||
@@ -748,8 +748,8 @@ static void smsc911x_phy_adjust_link(struct net_device *dev) | |||
748 | * usage is 10/100 indicator */ | 748 | * usage is 10/100 indicator */ |
749 | pdata->gpio_setting = smsc911x_reg_read(pdata, | 749 | pdata->gpio_setting = smsc911x_reg_read(pdata, |
750 | GPIO_CFG); | 750 | GPIO_CFG); |
751 | if ((pdata->gpio_setting & GPIO_CFG_LED1_EN_) | 751 | if ((pdata->gpio_setting & GPIO_CFG_LED1_EN_) && |
752 | && (!pdata->using_extphy)) { | 752 | (!pdata->using_extphy)) { |
753 | /* Force 10/100 LED off, after saving | 753 | /* Force 10/100 LED off, after saving |
754 | * orginal GPIO configuration */ | 754 | * orginal GPIO configuration */ |
755 | pdata->gpio_orig_setting = pdata->gpio_setting; | 755 | pdata->gpio_orig_setting = pdata->gpio_setting; |
diff --git a/drivers/net/starfire.c b/drivers/net/starfire.c index aa10158adb9e..95db60adde41 100644 --- a/drivers/net/starfire.c +++ b/drivers/net/starfire.c | |||
@@ -1482,8 +1482,8 @@ static int __netdev_rx(struct net_device *dev, int *quota) | |||
1482 | printk(KERN_DEBUG " netdev_rx() normal Rx pkt length %d, quota %d.\n", pkt_len, *quota); | 1482 | printk(KERN_DEBUG " netdev_rx() normal Rx pkt length %d, quota %d.\n", pkt_len, *quota); |
1483 | /* Check if the packet is long enough to accept without copying | 1483 | /* Check if the packet is long enough to accept without copying |
1484 | to a minimally-sized skbuff. */ | 1484 | to a minimally-sized skbuff. */ |
1485 | if (pkt_len < rx_copybreak | 1485 | if (pkt_len < rx_copybreak && |
1486 | && (skb = dev_alloc_skb(pkt_len + 2)) != NULL) { | 1486 | (skb = dev_alloc_skb(pkt_len + 2)) != NULL) { |
1487 | skb_reserve(skb, 2); /* 16 byte align the IP header */ | 1487 | skb_reserve(skb, 2); /* 16 byte align the IP header */ |
1488 | pci_dma_sync_single_for_cpu(np->pci_dev, | 1488 | pci_dma_sync_single_for_cpu(np->pci_dev, |
1489 | np->rx_info[entry].mapping, | 1489 | np->rx_info[entry].mapping, |
@@ -1793,8 +1793,8 @@ static void set_rx_mode(struct net_device *dev) | |||
1793 | 1793 | ||
1794 | if (dev->flags & IFF_PROMISC) { /* Set promiscuous. */ | 1794 | if (dev->flags & IFF_PROMISC) { /* Set promiscuous. */ |
1795 | rx_mode |= AcceptAll; | 1795 | rx_mode |= AcceptAll; |
1796 | } else if ((dev->mc_count > multicast_filter_limit) | 1796 | } else if ((dev->mc_count > multicast_filter_limit) || |
1797 | || (dev->flags & IFF_ALLMULTI)) { | 1797 | (dev->flags & IFF_ALLMULTI)) { |
1798 | /* Too many to match, or accept all multicasts. */ | 1798 | /* Too many to match, or accept all multicasts. */ |
1799 | rx_mode |= AcceptBroadcast|AcceptAllMulticast|PerfectFilter; | 1799 | rx_mode |= AcceptBroadcast|AcceptAllMulticast|PerfectFilter; |
1800 | } else if (dev->mc_count <= 14) { | 1800 | } else if (dev->mc_count <= 14) { |
diff --git a/drivers/net/stmmac/stmmac_main.c b/drivers/net/stmmac/stmmac_main.c index 40813f0b5339..508fba8fa07f 100644 --- a/drivers/net/stmmac/stmmac_main.c +++ b/drivers/net/stmmac/stmmac_main.c | |||
@@ -922,8 +922,7 @@ static void stmmac_dma_interrupt(struct net_device *dev) | |||
922 | DBG(intr, INFO, "CSR5[15] DMA ABNORMAL IRQ: "); | 922 | DBG(intr, INFO, "CSR5[15] DMA ABNORMAL IRQ: "); |
923 | if (unlikely(intr_status & DMA_STATUS_UNF)) { | 923 | if (unlikely(intr_status & DMA_STATUS_UNF)) { |
924 | DBG(intr, INFO, "transmit underflow\n"); | 924 | DBG(intr, INFO, "transmit underflow\n"); |
925 | if (unlikely(tc != SF_DMA_MODE) | 925 | if (unlikely(tc != SF_DMA_MODE) && (tc <= 256)) { |
926 | && (tc <= 256)) { | ||
927 | /* Try to bump up the threshold */ | 926 | /* Try to bump up the threshold */ |
928 | tc += 64; | 927 | tc += 64; |
929 | priv->mac_type->ops->dma_mode(ioaddr, tc, | 928 | priv->mac_type->ops->dma_mode(ioaddr, tc, |
diff --git a/drivers/net/sundance.c b/drivers/net/sundance.c index 5c396c2e6e76..d58e1891ca60 100644 --- a/drivers/net/sundance.c +++ b/drivers/net/sundance.c | |||
@@ -603,8 +603,8 @@ static int __devinit sundance_probe1 (struct pci_dev *pdev, | |||
603 | strcmp (media[card_idx], "4") == 0) { | 603 | strcmp (media[card_idx], "4") == 0) { |
604 | np->speed = 100; | 604 | np->speed = 100; |
605 | np->mii_if.full_duplex = 1; | 605 | np->mii_if.full_duplex = 1; |
606 | } else if (strcmp (media[card_idx], "100mbps_hd") == 0 | 606 | } else if (strcmp (media[card_idx], "100mbps_hd") == 0 || |
607 | || strcmp (media[card_idx], "3") == 0) { | 607 | strcmp (media[card_idx], "3") == 0) { |
608 | np->speed = 100; | 608 | np->speed = 100; |
609 | np->mii_if.full_duplex = 0; | 609 | np->mii_if.full_duplex = 0; |
610 | } else if (strcmp (media[card_idx], "10mbps_fd") == 0 || | 610 | } else if (strcmp (media[card_idx], "10mbps_fd") == 0 || |
@@ -1079,8 +1079,8 @@ start_tx (struct sk_buff *skb, struct net_device *dev) | |||
1079 | tasklet_schedule(&np->tx_tasklet); | 1079 | tasklet_schedule(&np->tx_tasklet); |
1080 | 1080 | ||
1081 | /* On some architectures: explicitly flush cache lines here. */ | 1081 | /* On some architectures: explicitly flush cache lines here. */ |
1082 | if (np->cur_tx - np->dirty_tx < TX_QUEUE_LEN - 1 | 1082 | if (np->cur_tx - np->dirty_tx < TX_QUEUE_LEN - 1 && |
1083 | && !netif_queue_stopped(dev)) { | 1083 | !netif_queue_stopped(dev)) { |
1084 | /* do nothing */ | 1084 | /* do nothing */ |
1085 | } else { | 1085 | } else { |
1086 | netif_stop_queue (dev); | 1086 | netif_stop_queue (dev); |
@@ -1336,8 +1336,8 @@ static void rx_poll(unsigned long data) | |||
1336 | #endif | 1336 | #endif |
1337 | /* Check if the packet is long enough to accept without copying | 1337 | /* Check if the packet is long enough to accept without copying |
1338 | to a minimally-sized skbuff. */ | 1338 | to a minimally-sized skbuff. */ |
1339 | if (pkt_len < rx_copybreak | 1339 | if (pkt_len < rx_copybreak && |
1340 | && (skb = dev_alloc_skb(pkt_len + 2)) != NULL) { | 1340 | (skb = dev_alloc_skb(pkt_len + 2)) != NULL) { |
1341 | skb_reserve(skb, 2); /* 16 byte align the IP header */ | 1341 | skb_reserve(skb, 2); /* 16 byte align the IP header */ |
1342 | pci_dma_sync_single_for_cpu(np->pci_dev, | 1342 | pci_dma_sync_single_for_cpu(np->pci_dev, |
1343 | le32_to_cpu(desc->frag[0].addr), | 1343 | le32_to_cpu(desc->frag[0].addr), |
@@ -1517,8 +1517,8 @@ static void set_rx_mode(struct net_device *dev) | |||
1517 | if (dev->flags & IFF_PROMISC) { /* Set promiscuous. */ | 1517 | if (dev->flags & IFF_PROMISC) { /* Set promiscuous. */ |
1518 | memset(mc_filter, 0xff, sizeof(mc_filter)); | 1518 | memset(mc_filter, 0xff, sizeof(mc_filter)); |
1519 | rx_mode = AcceptBroadcast | AcceptMulticast | AcceptAll | AcceptMyPhys; | 1519 | rx_mode = AcceptBroadcast | AcceptMulticast | AcceptAll | AcceptMyPhys; |
1520 | } else if ((dev->mc_count > multicast_filter_limit) | 1520 | } else if ((dev->mc_count > multicast_filter_limit) || |
1521 | || (dev->flags & IFF_ALLMULTI)) { | 1521 | (dev->flags & IFF_ALLMULTI)) { |
1522 | /* Too many to match, or accept all multicasts. */ | 1522 | /* Too many to match, or accept all multicasts. */ |
1523 | memset(mc_filter, 0xff, sizeof(mc_filter)); | 1523 | memset(mc_filter, 0xff, sizeof(mc_filter)); |
1524 | rx_mode = AcceptBroadcast | AcceptMulticast | AcceptMyPhys; | 1524 | rx_mode = AcceptBroadcast | AcceptMulticast | AcceptMyPhys; |
diff --git a/drivers/net/sungem.h b/drivers/net/sungem.h index f7a02917ce5e..19905460def6 100644 --- a/drivers/net/sungem.h +++ b/drivers/net/sungem.h | |||
@@ -1031,8 +1031,8 @@ struct gem { | |||
1031 | #endif | 1031 | #endif |
1032 | }; | 1032 | }; |
1033 | 1033 | ||
1034 | #define found_mii_phy(gp) ((gp->phy_type == phy_mii_mdio0 || gp->phy_type == phy_mii_mdio1) \ | 1034 | #define found_mii_phy(gp) ((gp->phy_type == phy_mii_mdio0 || gp->phy_type == phy_mii_mdio1) && \ |
1035 | && gp->phy_mii.def && gp->phy_mii.def->ops) | 1035 | gp->phy_mii.def && gp->phy_mii.def->ops) |
1036 | 1036 | ||
1037 | #define ALIGNED_RX_SKB_ADDR(addr) \ | 1037 | #define ALIGNED_RX_SKB_ADDR(addr) \ |
1038 | ((((unsigned long)(addr) + (64UL - 1UL)) & ~(64UL - 1UL)) - (unsigned long)(addr)) | 1038 | ((((unsigned long)(addr) + (64UL - 1UL)) & ~(64UL - 1UL)) - (unsigned long)(addr)) |
diff --git a/drivers/net/sunhme.c b/drivers/net/sunhme.c index 0970e1774d13..6762f1c6ec8a 100644 --- a/drivers/net/sunhme.c +++ b/drivers/net/sunhme.c | |||
@@ -3056,9 +3056,9 @@ static int __devinit happy_meal_pci_probe(struct pci_dev *pdev, | |||
3056 | int len; | 3056 | int len; |
3057 | 3057 | ||
3058 | if (qfe_slot != -1 && | 3058 | if (qfe_slot != -1 && |
3059 | (addr = of_get_property(dp, | 3059 | (addr = of_get_property(dp, "local-mac-address", &len)) |
3060 | "local-mac-address", &len)) != NULL | 3060 | != NULL && |
3061 | && len == 6) { | 3061 | len == 6) { |
3062 | memcpy(dev->dev_addr, addr, 6); | 3062 | memcpy(dev->dev_addr, addr, 6); |
3063 | } else { | 3063 | } else { |
3064 | memcpy(dev->dev_addr, idprom->id_ethaddr, 6); | 3064 | memcpy(dev->dev_addr, idprom->id_ethaddr, 6); |
diff --git a/drivers/net/tehuti.c b/drivers/net/tehuti.c index 2fbac31767fa..80b404f2b938 100644 --- a/drivers/net/tehuti.c +++ b/drivers/net/tehuti.c | |||
@@ -1784,9 +1784,9 @@ static void bdx_tx_cleanup(struct bdx_priv *priv) | |||
1784 | } | 1784 | } |
1785 | #endif | 1785 | #endif |
1786 | 1786 | ||
1787 | if (unlikely(netif_queue_stopped(priv->ndev) | 1787 | if (unlikely(netif_queue_stopped(priv->ndev) && |
1788 | && netif_carrier_ok(priv->ndev) | 1788 | netif_carrier_ok(priv->ndev) && |
1789 | && (priv->tx_level >= BDX_MIN_TX_LEVEL))) { | 1789 | (priv->tx_level >= BDX_MIN_TX_LEVEL))) { |
1790 | DBG("%s: %s: TX Q WAKE level %d\n", | 1790 | DBG("%s: %s: TX Q WAKE level %d\n", |
1791 | BDX_DRV_NAME, priv->ndev->name, priv->tx_level); | 1791 | BDX_DRV_NAME, priv->ndev->name, priv->tx_level); |
1792 | netif_wake_queue(priv->ndev); | 1792 | netif_wake_queue(priv->ndev); |
@@ -2273,8 +2273,8 @@ bdx_set_coalesce(struct net_device *netdev, struct ethtool_coalesce *ecoal) | |||
2273 | (((tx_max_coal * BDX_TXF_DESC_SZ) + PCK_TH_MULT - 1) | 2273 | (((tx_max_coal * BDX_TXF_DESC_SZ) + PCK_TH_MULT - 1) |
2274 | / PCK_TH_MULT); | 2274 | / PCK_TH_MULT); |
2275 | 2275 | ||
2276 | if ((rx_coal > 0x7FFF) || (tx_coal > 0x7FFF) | 2276 | if ((rx_coal > 0x7FFF) || (tx_coal > 0x7FFF) || |
2277 | || (rx_max_coal > 0xF) || (tx_max_coal > 0xF)) | 2277 | (rx_max_coal > 0xF) || (tx_max_coal > 0xF)) |
2278 | return -EINVAL; | 2278 | return -EINVAL; |
2279 | 2279 | ||
2280 | rdintcm = INT_REG_VAL(rx_coal, GET_INT_COAL_RC(priv->rdintcm), | 2280 | rdintcm = INT_REG_VAL(rx_coal, GET_INT_COAL_RC(priv->rdintcm), |
@@ -2347,8 +2347,8 @@ bdx_set_ringparam(struct net_device *netdev, struct ethtool_ringparam *ring) | |||
2347 | tx_size = 3; | 2347 | tx_size = 3; |
2348 | 2348 | ||
2349 | /*Is there anything to do? */ | 2349 | /*Is there anything to do? */ |
2350 | if ((rx_size == priv->rxf_size) | 2350 | if ((rx_size == priv->rxf_size) && |
2351 | && (tx_size == priv->txd_size)) | 2351 | (tx_size == priv->txd_size)) |
2352 | return 0; | 2352 | return 0; |
2353 | 2353 | ||
2354 | priv->rxf_size = rx_size; | 2354 | priv->rxf_size = rx_size; |
diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c index 302ea0b7b235..f845837e4aa5 100644 --- a/drivers/net/tg3.c +++ b/drivers/net/tg3.c | |||
@@ -4621,13 +4621,12 @@ static int tg3_rx(struct tg3_napi *tnapi, int budget) | |||
4621 | len = ((desc->idx_len & RXD_LEN_MASK) >> RXD_LEN_SHIFT) - | 4621 | len = ((desc->idx_len & RXD_LEN_MASK) >> RXD_LEN_SHIFT) - |
4622 | ETH_FCS_LEN; | 4622 | ETH_FCS_LEN; |
4623 | 4623 | ||
4624 | if (len > RX_COPY_THRESHOLD | 4624 | if (len > RX_COPY_THRESHOLD && |
4625 | && tp->rx_offset == NET_IP_ALIGN | 4625 | tp->rx_offset == NET_IP_ALIGN) { |
4626 | /* rx_offset will likely not equal NET_IP_ALIGN | 4626 | /* rx_offset will likely not equal NET_IP_ALIGN |
4627 | * if this is a 5701 card running in PCI-X mode | 4627 | * if this is a 5701 card running in PCI-X mode |
4628 | * [see tg3_get_invariants()] | 4628 | * [see tg3_get_invariants()] |
4629 | */ | 4629 | */ |
4630 | ) { | ||
4631 | int skb_size; | 4630 | int skb_size; |
4632 | 4631 | ||
4633 | skb_size = tg3_alloc_rx_skb(tp, tpr, opaque_key, | 4632 | skb_size = tg3_alloc_rx_skb(tp, tpr, opaque_key, |
diff --git a/drivers/net/tlan.c b/drivers/net/tlan.c index 16f23f84920b..fabaeffb3155 100644 --- a/drivers/net/tlan.c +++ b/drivers/net/tlan.c | |||
@@ -1755,8 +1755,8 @@ static u32 TLan_HandleStatusCheck( struct net_device *dev, u16 host_int ) | |||
1755 | ! ( tlphy_ctl & TLAN_TC_SWAPOL ) ) { | 1755 | ! ( tlphy_ctl & TLAN_TC_SWAPOL ) ) { |
1756 | tlphy_ctl |= TLAN_TC_SWAPOL; | 1756 | tlphy_ctl |= TLAN_TC_SWAPOL; |
1757 | TLan_MiiWriteReg( dev, phy, TLAN_TLPHY_CTL, tlphy_ctl); | 1757 | TLan_MiiWriteReg( dev, phy, TLAN_TLPHY_CTL, tlphy_ctl); |
1758 | } else if ( ( tlphy_sts & TLAN_TS_POLOK ) | 1758 | } else if ( ( tlphy_sts & TLAN_TS_POLOK ) && |
1759 | && ( tlphy_ctl & TLAN_TC_SWAPOL ) ) { | 1759 | ( tlphy_ctl & TLAN_TC_SWAPOL ) ) { |
1760 | tlphy_ctl &= ~TLAN_TC_SWAPOL; | 1760 | tlphy_ctl &= ~TLAN_TC_SWAPOL; |
1761 | TLan_MiiWriteReg( dev, phy, TLAN_TLPHY_CTL, tlphy_ctl); | 1761 | TLan_MiiWriteReg( dev, phy, TLAN_TLPHY_CTL, tlphy_ctl); |
1762 | } | 1762 | } |
diff --git a/drivers/net/tokenring/lanstreamer.c b/drivers/net/tokenring/lanstreamer.c index 7b1fe9412b6f..d6ccd59c7d07 100644 --- a/drivers/net/tokenring/lanstreamer.c +++ b/drivers/net/tokenring/lanstreamer.c | |||
@@ -712,8 +712,8 @@ static int streamer_open(struct net_device *dev) | |||
712 | strcat(open_error, " - "); | 712 | strcat(open_error, " - "); |
713 | strcat(open_error, open_min_error[(error_code & 0x0f)]); | 713 | strcat(open_error, open_min_error[(error_code & 0x0f)]); |
714 | 714 | ||
715 | if (!streamer_priv->streamer_ring_speed | 715 | if (!streamer_priv->streamer_ring_speed && |
716 | && ((error_code & 0x0f) == 0x0d)) | 716 | ((error_code & 0x0f) == 0x0d)) |
717 | { | 717 | { |
718 | printk(KERN_WARNING "%s: Tried to autosense ring speed with no monitors present\n", dev->name); | 718 | printk(KERN_WARNING "%s: Tried to autosense ring speed with no monitors present\n", dev->name); |
719 | printk(KERN_WARNING "%s: Please try again with a specified ring speed \n", dev->name); | 719 | printk(KERN_WARNING "%s: Please try again with a specified ring speed \n", dev->name); |
@@ -1032,8 +1032,8 @@ static irqreturn_t streamer_interrupt(int irq, void *dev_id) | |||
1032 | sisr = readw(streamer_mmio + SISR); | 1032 | sisr = readw(streamer_mmio + SISR); |
1033 | 1033 | ||
1034 | while((sisr & (SISR_MI | SISR_SRB_REPLY | SISR_ADAPTER_CHECK | SISR_ASB_FREE | | 1034 | while((sisr & (SISR_MI | SISR_SRB_REPLY | SISR_ADAPTER_CHECK | SISR_ASB_FREE | |
1035 | SISR_ARB_CMD | SISR_TRB_REPLY | SISR_PAR_ERR | SISR_SERR_ERR)) | 1035 | SISR_ARB_CMD | SISR_TRB_REPLY | SISR_PAR_ERR | SISR_SERR_ERR)) && |
1036 | && (max_intr > 0)) { | 1036 | (max_intr > 0)) { |
1037 | 1037 | ||
1038 | if(sisr & SISR_PAR_ERR) { | 1038 | if(sisr & SISR_PAR_ERR) { |
1039 | writew(~SISR_PAR_ERR, streamer_mmio + SISR_RUM); | 1039 | writew(~SISR_PAR_ERR, streamer_mmio + SISR_RUM); |
diff --git a/drivers/net/tokenring/smctr.c b/drivers/net/tokenring/smctr.c index ebda61bc4c2f..427a8970b6fe 100644 --- a/drivers/net/tokenring/smctr.c +++ b/drivers/net/tokenring/smctr.c | |||
@@ -2309,9 +2309,9 @@ static irqreturn_t smctr_interrupt(int irq, void *dev_id) | |||
2309 | else | 2309 | else |
2310 | { | 2310 | { |
2311 | if((tp->acb_head->cmd | 2311 | if((tp->acb_head->cmd |
2312 | == ACB_CMD_READ_TRC_STATUS) | 2312 | == ACB_CMD_READ_TRC_STATUS) && |
2313 | && (tp->acb_head->subcmd | 2313 | (tp->acb_head->subcmd |
2314 | == RW_TRC_STATUS_BLOCK)) | 2314 | == RW_TRC_STATUS_BLOCK)) |
2315 | { | 2315 | { |
2316 | if(tp->ptr_bcn_type) | 2316 | if(tp->ptr_bcn_type) |
2317 | { | 2317 | { |
@@ -2331,8 +2331,8 @@ static irqreturn_t smctr_interrupt(int irq, void *dev_id) | |||
2331 | smctr_disable_16bit(dev); | 2331 | smctr_disable_16bit(dev); |
2332 | err = smctr_ring_status_chg(dev); | 2332 | err = smctr_ring_status_chg(dev); |
2333 | smctr_enable_16bit(dev); | 2333 | smctr_enable_16bit(dev); |
2334 | if((tp->ring_status & REMOVE_RECEIVED) | 2334 | if((tp->ring_status & REMOVE_RECEIVED) && |
2335 | && (tp->config_word0 & NO_AUTOREMOVE)) | 2335 | (tp->config_word0 & NO_AUTOREMOVE)) |
2336 | { | 2336 | { |
2337 | smctr_issue_remove_cmd(dev); | 2337 | smctr_issue_remove_cmd(dev); |
2338 | } | 2338 | } |
@@ -2511,9 +2511,9 @@ static int smctr_issue_init_timers_cmd(struct net_device *dev) | |||
2511 | tp->config_word0 = THDREN | DMA_TRIGGER | USETPT | NO_AUTOREMOVE; | 2511 | tp->config_word0 = THDREN | DMA_TRIGGER | USETPT | NO_AUTOREMOVE; |
2512 | tp->config_word1 = 0; | 2512 | tp->config_word1 = 0; |
2513 | 2513 | ||
2514 | if((tp->media_type == MEDIA_STP_16) | 2514 | if((tp->media_type == MEDIA_STP_16) || |
2515 | || (tp->media_type == MEDIA_UTP_16) | 2515 | (tp->media_type == MEDIA_UTP_16) || |
2516 | || (tp->media_type == MEDIA_STP_16_UTP_16)) | 2516 | (tp->media_type == MEDIA_STP_16_UTP_16)) |
2517 | { | 2517 | { |
2518 | tp->config_word0 |= FREQ_16MB_BIT; | 2518 | tp->config_word0 |= FREQ_16MB_BIT; |
2519 | } | 2519 | } |
@@ -2556,9 +2556,9 @@ static int smctr_issue_init_timers_cmd(struct net_device *dev) | |||
2556 | tp->config_word1 &= ~SOURCE_ROUTING_SPANNING_BITS; | 2556 | tp->config_word1 &= ~SOURCE_ROUTING_SPANNING_BITS; |
2557 | } | 2557 | } |
2558 | 2558 | ||
2559 | if((tp->media_type == MEDIA_STP_16) | 2559 | if((tp->media_type == MEDIA_STP_16) || |
2560 | || (tp->media_type == MEDIA_UTP_16) | 2560 | (tp->media_type == MEDIA_UTP_16) || |
2561 | || (tp->media_type == MEDIA_STP_16_UTP_16)) | 2561 | (tp->media_type == MEDIA_STP_16_UTP_16)) |
2562 | { | 2562 | { |
2563 | tp->config_word1 |= INTERFRAME_SPACING_16; | 2563 | tp->config_word1 |= INTERFRAME_SPACING_16; |
2564 | } | 2564 | } |
@@ -2568,9 +2568,9 @@ static int smctr_issue_init_timers_cmd(struct net_device *dev) | |||
2568 | *pTimer_Struc++ = tp->config_word0; | 2568 | *pTimer_Struc++ = tp->config_word0; |
2569 | *pTimer_Struc++ = tp->config_word1; | 2569 | *pTimer_Struc++ = tp->config_word1; |
2570 | 2570 | ||
2571 | if((tp->media_type == MEDIA_STP_4) | 2571 | if((tp->media_type == MEDIA_STP_4) || |
2572 | || (tp->media_type == MEDIA_UTP_4) | 2572 | (tp->media_type == MEDIA_UTP_4) || |
2573 | || (tp->media_type == MEDIA_STP_4_UTP_4)) | 2573 | (tp->media_type == MEDIA_STP_4_UTP_4)) |
2574 | { | 2574 | { |
2575 | *pTimer_Struc++ = 0x00FA; /* prescale */ | 2575 | *pTimer_Struc++ = 0x00FA; /* prescale */ |
2576 | *pTimer_Struc++ = 0x2710; /* TPT_limit */ | 2576 | *pTimer_Struc++ = 0x2710; /* TPT_limit */ |
@@ -2990,8 +2990,8 @@ static int smctr_load_firmware(struct net_device *dev) | |||
2990 | } | 2990 | } |
2991 | 2991 | ||
2992 | /* Verify the firmware exists and is there in the right amount. */ | 2992 | /* Verify the firmware exists and is there in the right amount. */ |
2993 | if (!fw->data | 2993 | if (!fw->data || |
2994 | || (*(fw->data + UCODE_VERSION_OFFSET) < UCODE_VERSION)) | 2994 | (*(fw->data + UCODE_VERSION_OFFSET) < UCODE_VERSION)) |
2995 | { | 2995 | { |
2996 | err = (UCODE_NOT_PRESENT); | 2996 | err = (UCODE_NOT_PRESENT); |
2997 | goto out; | 2997 | goto out; |
@@ -3010,9 +3010,8 @@ static int smctr_load_firmware(struct net_device *dev) | |||
3010 | smctr_enable_16bit(dev); | 3010 | smctr_enable_16bit(dev); |
3011 | smctr_set_page(dev, (__u8 *)tp->ram_access); | 3011 | smctr_set_page(dev, (__u8 *)tp->ram_access); |
3012 | 3012 | ||
3013 | if((smctr_checksum_firmware(dev)) | 3013 | if((smctr_checksum_firmware(dev)) || |
3014 | || (*(fw->data + UCODE_VERSION_OFFSET) | 3014 | (*(fw->data + UCODE_VERSION_OFFSET) > tp->microcode_version)) |
3015 | > tp->microcode_version)) | ||
3016 | { | 3015 | { |
3017 | smctr_enable_adapter_ctrl_store(dev); | 3016 | smctr_enable_adapter_ctrl_store(dev); |
3018 | 3017 | ||
@@ -3117,9 +3116,9 @@ static int smctr_lobe_media_test(struct net_device *dev) | |||
3117 | } | 3116 | } |
3118 | 3117 | ||
3119 | /* Check if any frames received during test. */ | 3118 | /* Check if any frames received during test. */ |
3120 | if((tp->rx_fcb_curr[MAC_QUEUE]->frame_status) | 3119 | if((tp->rx_fcb_curr[MAC_QUEUE]->frame_status) || |
3121 | || (tp->rx_fcb_curr[NON_MAC_QUEUE]->frame_status)) | 3120 | (tp->rx_fcb_curr[NON_MAC_QUEUE]->frame_status)) |
3122 | goto err; | 3121 | goto err; |
3123 | 3122 | ||
3124 | /* Set receive mask to "Promisc" mode. */ | 3123 | /* Set receive mask to "Promisc" mode. */ |
3125 | tp->receive_mask = saved_rcv_mask; | 3124 | tp->receive_mask = saved_rcv_mask; |
@@ -3303,8 +3302,8 @@ static int smctr_make_group_addr(struct net_device *dev, MAC_SUB_VECTOR *tsv) | |||
3303 | /* Set Group Address Sub-vector to all zeros if only the | 3302 | /* Set Group Address Sub-vector to all zeros if only the |
3304 | * Group Address/Functional Address Indicator is set. | 3303 | * Group Address/Functional Address Indicator is set. |
3305 | */ | 3304 | */ |
3306 | if(tsv->svv[0] == 0x80 && tsv->svv[1] == 0x00 | 3305 | if(tsv->svv[0] == 0x80 && tsv->svv[1] == 0x00 && |
3307 | && tsv->svv[2] == 0x00 && tsv->svv[3] == 0x00) | 3306 | tsv->svv[2] == 0x00 && tsv->svv[3] == 0x00) |
3308 | tsv->svv[0] = 0x00; | 3307 | tsv->svv[0] = 0x00; |
3309 | 3308 | ||
3310 | return (0); | 3309 | return (0); |
@@ -3876,10 +3875,10 @@ static int smctr_process_rx_packet(MAC_HEADER *rmf, __u16 size, | |||
3876 | /* NOTE: UNKNOWN MAC frames will NOT be passed up unless | 3875 | /* NOTE: UNKNOWN MAC frames will NOT be passed up unless |
3877 | * ACCEPT_ATT_MAC_FRAMES is set. | 3876 | * ACCEPT_ATT_MAC_FRAMES is set. |
3878 | */ | 3877 | */ |
3879 | if(((tp->receive_mask & ACCEPT_ATT_MAC_FRAMES) | 3878 | if(((tp->receive_mask & ACCEPT_ATT_MAC_FRAMES) && |
3880 | && (xframe == (__u8)0)) | 3879 | (xframe == (__u8)0)) || |
3881 | || ((tp->receive_mask & ACCEPT_EXT_MAC_FRAMES) | 3880 | ((tp->receive_mask & ACCEPT_EXT_MAC_FRAMES) && |
3882 | && (xframe == (__u8)1))) | 3881 | (xframe == (__u8)1))) |
3883 | { | 3882 | { |
3884 | rmf->vl = SWAP_BYTES(rmf->vl); | 3883 | rmf->vl = SWAP_BYTES(rmf->vl); |
3885 | 3884 | ||
@@ -3934,8 +3933,8 @@ static int smctr_ram_memory_test(struct net_device *dev) | |||
3934 | 3933 | ||
3935 | word_pattern = start_pattern; | 3934 | word_pattern = start_pattern; |
3936 | 3935 | ||
3937 | for(j = 1; j < (__u32)(tp->ram_usable * 1024) - 1 | 3936 | for(j = 1; j < (__u32)(tp->ram_usable * 1024) - 1 && (~err); |
3938 | && (~err); j += 2, word_pattern++) | 3937 | j += 2, word_pattern++) |
3939 | { | 3938 | { |
3940 | word_read = *(__u16 *)(pword + j); | 3939 | word_read = *(__u16 *)(pword + j); |
3941 | if(word_read != word_pattern) | 3940 | if(word_read != word_pattern) |
@@ -3959,8 +3958,7 @@ static int smctr_ram_memory_test(struct net_device *dev) | |||
3959 | for(j = 0; j < (__u32)tp->ram_usable * 1024; j +=2) | 3958 | for(j = 0; j < (__u32)tp->ram_usable * 1024; j +=2) |
3960 | *(__u16 *)(pword + j) = word_pattern; | 3959 | *(__u16 *)(pword + j) = word_pattern; |
3961 | 3960 | ||
3962 | for(j =0; j < (__u32)tp->ram_usable * 1024 | 3961 | for(j =0; j < (__u32)tp->ram_usable * 1024 && (~err); j += 2) |
3963 | && (~err); j += 2) | ||
3964 | { | 3962 | { |
3965 | word_read = *(__u16 *)(pword + j); | 3963 | word_read = *(__u16 *)(pword + j); |
3966 | if(word_read != word_pattern) | 3964 | if(word_read != word_pattern) |
@@ -4325,8 +4323,8 @@ static int smctr_restart_tx_chain(struct net_device *dev, short queue) | |||
4325 | if(smctr_debug > 10) | 4323 | if(smctr_debug > 10) |
4326 | printk(KERN_DEBUG "%s: smctr_restart_tx_chain\n", dev->name); | 4324 | printk(KERN_DEBUG "%s: smctr_restart_tx_chain\n", dev->name); |
4327 | 4325 | ||
4328 | if(tp->num_tx_fcbs_used[queue] != 0 | 4326 | if(tp->num_tx_fcbs_used[queue] != 0 && |
4329 | && tp->tx_queue_status[queue] == NOT_TRANSMITING) | 4327 | tp->tx_queue_status[queue] == NOT_TRANSMITING) |
4330 | { | 4328 | { |
4331 | tp->tx_queue_status[queue] = TRANSMITING; | 4329 | tp->tx_queue_status[queue] = TRANSMITING; |
4332 | err = smctr_issue_resume_tx_fcb_cmd(dev, queue); | 4330 | err = smctr_issue_resume_tx_fcb_cmd(dev, queue); |
@@ -4349,8 +4347,8 @@ static int smctr_ring_status_chg(struct net_device *dev) | |||
4349 | */ | 4347 | */ |
4350 | if(tp->ring_status_flags == MONITOR_STATE_CHANGED) | 4348 | if(tp->ring_status_flags == MONITOR_STATE_CHANGED) |
4351 | { | 4349 | { |
4352 | if((tp->monitor_state == MS_ACTIVE_MONITOR_STATE) | 4350 | if((tp->monitor_state == MS_ACTIVE_MONITOR_STATE) || |
4353 | || (tp->monitor_state == MS_STANDBY_MONITOR_STATE)) | 4351 | (tp->monitor_state == MS_STANDBY_MONITOR_STATE)) |
4354 | { | 4352 | { |
4355 | tp->monitor_state_ready = 1; | 4353 | tp->monitor_state_ready = 1; |
4356 | } | 4354 | } |
@@ -4363,8 +4361,8 @@ static int smctr_ring_status_chg(struct net_device *dev) | |||
4363 | tp->monitor_state_ready = 0; | 4361 | tp->monitor_state_ready = 0; |
4364 | 4362 | ||
4365 | /* Ring speed problem, switching to auto mode. */ | 4363 | /* Ring speed problem, switching to auto mode. */ |
4366 | if(tp->monitor_state == MS_MONITOR_FSM_INACTIVE | 4364 | if(tp->monitor_state == MS_MONITOR_FSM_INACTIVE && |
4367 | && !tp->cleanup) | 4365 | !tp->cleanup) |
4368 | { | 4366 | { |
4369 | printk(KERN_INFO "%s: Incorrect ring speed switching.\n", | 4367 | printk(KERN_INFO "%s: Incorrect ring speed switching.\n", |
4370 | dev->name); | 4368 | dev->name); |
@@ -4442,8 +4440,8 @@ static int smctr_rx_frame(struct net_device *dev) | |||
4442 | { | 4440 | { |
4443 | err = HARDWARE_FAILED; | 4441 | err = HARDWARE_FAILED; |
4444 | 4442 | ||
4445 | if(((status & 0x007f) == 0) | 4443 | if(((status & 0x007f) == 0) || |
4446 | || ((tp->receive_mask & ACCEPT_ERR_PACKETS) != 0)) | 4444 | ((tp->receive_mask & ACCEPT_ERR_PACKETS) != 0)) |
4447 | { | 4445 | { |
4448 | /* frame length less the CRC (4 bytes) + FS (1 byte) */ | 4446 | /* frame length less the CRC (4 bytes) + FS (1 byte) */ |
4449 | rx_size = tp->rx_fcb_curr[queue]->frame_length - 5; | 4447 | rx_size = tp->rx_fcb_curr[queue]->frame_length - 5; |
@@ -4538,8 +4536,8 @@ static int smctr_send_dat(struct net_device *dev) | |||
4538 | } | 4536 | } |
4539 | 4537 | ||
4540 | /* Check if GOOD frame Tx'ed. */ | 4538 | /* Check if GOOD frame Tx'ed. */ |
4541 | if(!(fcb->frame_status & FCB_COMMAND_DONE) | 4539 | if(!(fcb->frame_status & FCB_COMMAND_DONE) || |
4542 | || fcb->frame_status & (FCB_TX_STATUS_E | FCB_TX_AC_BITS)) | 4540 | fcb->frame_status & (FCB_TX_STATUS_E | FCB_TX_AC_BITS)) |
4543 | { | 4541 | { |
4544 | return (INITIALIZE_FAILED); | 4542 | return (INITIALIZE_FAILED); |
4545 | } | 4543 | } |
@@ -4653,8 +4651,8 @@ static int smctr_send_lobe_media_test(struct net_device *dev) | |||
4653 | } | 4651 | } |
4654 | 4652 | ||
4655 | /* Check if GOOD frame Tx'ed */ | 4653 | /* Check if GOOD frame Tx'ed */ |
4656 | if(!(fcb->frame_status & FCB_COMMAND_DONE) | 4654 | if(!(fcb->frame_status & FCB_COMMAND_DONE) || |
4657 | || fcb->frame_status & (FCB_TX_STATUS_E | FCB_TX_AC_BITS)) | 4655 | fcb->frame_status & (FCB_TX_STATUS_E | FCB_TX_AC_BITS)) |
4658 | { | 4656 | { |
4659 | return (LOBE_MEDIA_TEST_FAILED); | 4657 | return (LOBE_MEDIA_TEST_FAILED); |
4660 | } | 4658 | } |
diff --git a/drivers/net/tokenring/tms380tr.c b/drivers/net/tokenring/tms380tr.c index fa152144aacf..e3c42f5ac4a9 100644 --- a/drivers/net/tokenring/tms380tr.c +++ b/drivers/net/tokenring/tms380tr.c | |||
@@ -729,8 +729,8 @@ static void tms380tr_timer_chk(unsigned long data) | |||
729 | return; | 729 | return; |
730 | 730 | ||
731 | tms380tr_chk_outstanding_cmds(dev); | 731 | tms380tr_chk_outstanding_cmds(dev); |
732 | if(time_before(tp->LastSendTime + SEND_TIMEOUT, jiffies) | 732 | if(time_before(tp->LastSendTime + SEND_TIMEOUT, jiffies) && |
733 | && (tp->TplFree != tp->TplBusy)) | 733 | (tp->TplFree != tp->TplBusy)) |
734 | { | 734 | { |
735 | /* Anything to send, but stalled too long */ | 735 | /* Anything to send, but stalled too long */ |
736 | tp->LastSendTime = jiffies; | 736 | tp->LastSendTime = jiffies; |
@@ -830,8 +830,8 @@ irqreturn_t tms380tr_interrupt(int irq, void *dev_id) | |||
830 | } | 830 | } |
831 | 831 | ||
832 | /* Reset system interrupt if not already done. */ | 832 | /* Reset system interrupt if not already done. */ |
833 | if(irq_type != STS_IRQ_TRANSMIT_STATUS | 833 | if(irq_type != STS_IRQ_TRANSMIT_STATUS && |
834 | && irq_type != STS_IRQ_RECEIVE_STATUS) { | 834 | irq_type != STS_IRQ_RECEIVE_STATUS) { |
835 | tms380tr_reset_interrupt(dev); | 835 | tms380tr_reset_interrupt(dev); |
836 | } | 836 | } |
837 | 837 | ||
@@ -895,10 +895,10 @@ static unsigned char tms380tr_chk_ssb(struct net_local *tp, unsigned short IrqTy | |||
895 | 895 | ||
896 | /* Check if this interrupt does use the SSB. */ | 896 | /* Check if this interrupt does use the SSB. */ |
897 | 897 | ||
898 | if(IrqType != STS_IRQ_TRANSMIT_STATUS | 898 | if(IrqType != STS_IRQ_TRANSMIT_STATUS && |
899 | && IrqType != STS_IRQ_RECEIVE_STATUS | 899 | IrqType != STS_IRQ_RECEIVE_STATUS && |
900 | && IrqType != STS_IRQ_COMMAND_STATUS | 900 | IrqType != STS_IRQ_COMMAND_STATUS && |
901 | && IrqType != STS_IRQ_RING_STATUS) | 901 | IrqType != STS_IRQ_RING_STATUS) |
902 | { | 902 | { |
903 | return (1); /* SSB not involved. */ | 903 | return (1); /* SSB not involved. */ |
904 | } | 904 | } |
@@ -1485,8 +1485,8 @@ static int tms380tr_init_adapter(struct net_device *dev) | |||
1485 | /* Mask interesting status bits */ | 1485 | /* Mask interesting status bits */ |
1486 | Status = SIFREADW(SIFSTS); | 1486 | Status = SIFREADW(SIFSTS); |
1487 | Status &= STS_MASK; | 1487 | Status &= STS_MASK; |
1488 | } while(((Status &(STS_INITIALIZE | STS_ERROR | STS_TEST)) != 0) | 1488 | } while(((Status &(STS_INITIALIZE | STS_ERROR | STS_TEST)) != 0) && |
1489 | && ((Status & STS_ERROR) == 0) && (loop_cnt != 0)); | 1489 | ((Status & STS_ERROR) == 0) && (loop_cnt != 0)); |
1490 | 1490 | ||
1491 | if((Status & (STS_INITIALIZE | STS_ERROR | STS_TEST)) == 0) | 1491 | if((Status & (STS_INITIALIZE | STS_ERROR | STS_TEST)) == 0) |
1492 | { | 1492 | { |
@@ -2183,8 +2183,8 @@ static void tms380tr_rcv_status_irq(struct net_device *dev) | |||
2183 | } | 2183 | } |
2184 | } | 2184 | } |
2185 | 2185 | ||
2186 | if(skb && (rpl->SkbStat == SKB_DATA_COPY | 2186 | if(skb && (rpl->SkbStat == SKB_DATA_COPY || |
2187 | || rpl->SkbStat == SKB_DMA_DIRECT)) | 2187 | rpl->SkbStat == SKB_DMA_DIRECT)) |
2188 | { | 2188 | { |
2189 | if(rpl->SkbStat == SKB_DATA_COPY) | 2189 | if(rpl->SkbStat == SKB_DATA_COPY) |
2190 | skb_copy_to_linear_data(skb, ReceiveDataPtr, | 2190 | skb_copy_to_linear_data(skb, ReceiveDataPtr, |
diff --git a/drivers/net/tulip/21142.c b/drivers/net/tulip/21142.c index db7d5e11855d..9f6742fad6ca 100644 --- a/drivers/net/tulip/21142.c +++ b/drivers/net/tulip/21142.c | |||
@@ -209,10 +209,10 @@ void t21142_lnk_change(struct net_device *dev, int csr5) | |||
209 | printk(KERN_DEBUG "%s: Setting CSR6 %8.8x/%x CSR12 %8.8x.\n", | 209 | printk(KERN_DEBUG "%s: Setting CSR6 %8.8x/%x CSR12 %8.8x.\n", |
210 | dev->name, tp->csr6, ioread32(ioaddr + CSR6), | 210 | dev->name, tp->csr6, ioread32(ioaddr + CSR6), |
211 | ioread32(ioaddr + CSR12)); | 211 | ioread32(ioaddr + CSR12)); |
212 | } else if ((tp->nwayset && (csr5 & 0x08000000) | 212 | } else if ((tp->nwayset && (csr5 & 0x08000000) && |
213 | && (dev->if_port == 3 || dev->if_port == 5) | 213 | (dev->if_port == 3 || dev->if_port == 5) && |
214 | && (csr12 & 2) == 2) || | 214 | (csr12 & 2) == 2) || |
215 | (tp->nway && (csr5 & (TPLnkFail)))) { | 215 | (tp->nway && (csr5 & (TPLnkFail)))) { |
216 | /* Link blew? Maybe restart NWay. */ | 216 | /* Link blew? Maybe restart NWay. */ |
217 | del_timer_sync(&tp->timer); | 217 | del_timer_sync(&tp->timer); |
218 | t21142_start_nway(dev); | 218 | t21142_start_nway(dev); |
diff --git a/drivers/net/tulip/de2104x.c b/drivers/net/tulip/de2104x.c index 74e5ba42d38d..d4255d44cb75 100644 --- a/drivers/net/tulip/de2104x.c +++ b/drivers/net/tulip/de2104x.c | |||
@@ -62,9 +62,9 @@ module_param (debug, int, 0); | |||
62 | MODULE_PARM_DESC (debug, "de2104x bitmapped message enable number"); | 62 | MODULE_PARM_DESC (debug, "de2104x bitmapped message enable number"); |
63 | 63 | ||
64 | /* Set the copy breakpoint for the copy-only-tiny-buffer Rx structure. */ | 64 | /* Set the copy breakpoint for the copy-only-tiny-buffer Rx structure. */ |
65 | #if defined(__alpha__) || defined(__arm__) || defined(__hppa__) \ | 65 | #if defined(__alpha__) || defined(__arm__) || defined(__hppa__) || \ |
66 | || defined(CONFIG_SPARC) || defined(__ia64__) \ | 66 | defined(CONFIG_SPARC) || defined(__ia64__) || \ |
67 | || defined(__sh__) || defined(__mips__) | 67 | defined(__sh__) || defined(__mips__) |
68 | static int rx_copybreak = 1518; | 68 | static int rx_copybreak = 1518; |
69 | #else | 69 | #else |
70 | static int rx_copybreak = 100; | 70 | static int rx_copybreak = 100; |
diff --git a/drivers/net/tulip/eeprom.c b/drivers/net/tulip/eeprom.c index 391acd32a6a5..889f57aae89b 100644 --- a/drivers/net/tulip/eeprom.c +++ b/drivers/net/tulip/eeprom.c | |||
@@ -174,10 +174,10 @@ void __devinit tulip_parse_eeprom(struct net_device *dev) | |||
174 | } | 174 | } |
175 | /* Do a fix-up based on the vendor half of the station address prefix. */ | 175 | /* Do a fix-up based on the vendor half of the station address prefix. */ |
176 | for (i = 0; eeprom_fixups[i].name; i++) { | 176 | for (i = 0; eeprom_fixups[i].name; i++) { |
177 | if (dev->dev_addr[0] == eeprom_fixups[i].addr0 | 177 | if (dev->dev_addr[0] == eeprom_fixups[i].addr0 && |
178 | && dev->dev_addr[1] == eeprom_fixups[i].addr1 | 178 | dev->dev_addr[1] == eeprom_fixups[i].addr1 && |
179 | && dev->dev_addr[2] == eeprom_fixups[i].addr2) { | 179 | dev->dev_addr[2] == eeprom_fixups[i].addr2) { |
180 | if (dev->dev_addr[2] == 0xE8 && ee_data[0x1a] == 0x55) | 180 | if (dev->dev_addr[2] == 0xE8 && ee_data[0x1a] == 0x55) |
181 | i++; /* An Accton EN1207, not an outlaw Maxtech. */ | 181 | i++; /* An Accton EN1207, not an outlaw Maxtech. */ |
182 | memcpy(ee_data + 26, eeprom_fixups[i].newtable, | 182 | memcpy(ee_data + 26, eeprom_fixups[i].newtable, |
183 | sizeof(eeprom_fixups[i].newtable)); | 183 | sizeof(eeprom_fixups[i].newtable)); |
diff --git a/drivers/net/tulip/interrupt.c b/drivers/net/tulip/interrupt.c index c8d220cf2cce..2e8e8ee893c7 100644 --- a/drivers/net/tulip/interrupt.c +++ b/drivers/net/tulip/interrupt.c | |||
@@ -170,8 +170,8 @@ int tulip_poll(struct napi_struct *napi, int budget) | |||
170 | RxDescCollisionSeen | | 170 | RxDescCollisionSeen | |
171 | RxDescRunt | | 171 | RxDescRunt | |
172 | RxDescDescErr | | 172 | RxDescDescErr | |
173 | RxWholePkt)) != RxWholePkt | 173 | RxWholePkt)) != RxWholePkt || |
174 | || pkt_len > 1518) { | 174 | pkt_len > 1518) { |
175 | if ((status & (RxLengthOver2047 | | 175 | if ((status & (RxLengthOver2047 | |
176 | RxWholePkt)) != RxWholePkt) { | 176 | RxWholePkt)) != RxWholePkt) { |
177 | /* Ingore earlier buffers. */ | 177 | /* Ingore earlier buffers. */ |
@@ -201,8 +201,8 @@ int tulip_poll(struct napi_struct *napi, int budget) | |||
201 | 201 | ||
202 | /* Check if the packet is long enough to accept without copying | 202 | /* Check if the packet is long enough to accept without copying |
203 | to a minimally-sized skbuff. */ | 203 | to a minimally-sized skbuff. */ |
204 | if (pkt_len < tulip_rx_copybreak | 204 | if (pkt_len < tulip_rx_copybreak && |
205 | && (skb = dev_alloc_skb(pkt_len + 2)) != NULL) { | 205 | (skb = dev_alloc_skb(pkt_len + 2)) != NULL) { |
206 | skb_reserve(skb, 2); /* 16 byte align the IP header */ | 206 | skb_reserve(skb, 2); /* 16 byte align the IP header */ |
207 | pci_dma_sync_single_for_cpu(tp->pdev, | 207 | pci_dma_sync_single_for_cpu(tp->pdev, |
208 | tp->rx_buffers[entry].mapping, | 208 | tp->rx_buffers[entry].mapping, |
@@ -395,8 +395,8 @@ static int tulip_rx(struct net_device *dev) | |||
395 | RxDescCollisionSeen | | 395 | RxDescCollisionSeen | |
396 | RxDescRunt | | 396 | RxDescRunt | |
397 | RxDescDescErr | | 397 | RxDescDescErr | |
398 | RxWholePkt)) != RxWholePkt | 398 | RxWholePkt)) != RxWholePkt || |
399 | || pkt_len > 1518) { | 399 | pkt_len > 1518) { |
400 | if ((status & (RxLengthOver2047 | | 400 | if ((status & (RxLengthOver2047 | |
401 | RxWholePkt)) != RxWholePkt) { | 401 | RxWholePkt)) != RxWholePkt) { |
402 | /* Ingore earlier buffers. */ | 402 | /* Ingore earlier buffers. */ |
@@ -425,8 +425,8 @@ static int tulip_rx(struct net_device *dev) | |||
425 | 425 | ||
426 | /* Check if the packet is long enough to accept without copying | 426 | /* Check if the packet is long enough to accept without copying |
427 | to a minimally-sized skbuff. */ | 427 | to a minimally-sized skbuff. */ |
428 | if (pkt_len < tulip_rx_copybreak | 428 | if (pkt_len < tulip_rx_copybreak && |
429 | && (skb = dev_alloc_skb(pkt_len + 2)) != NULL) { | 429 | (skb = dev_alloc_skb(pkt_len + 2)) != NULL) { |
430 | skb_reserve(skb, 2); /* 16 byte align the IP header */ | 430 | skb_reserve(skb, 2); /* 16 byte align the IP header */ |
431 | pci_dma_sync_single_for_cpu(tp->pdev, | 431 | pci_dma_sync_single_for_cpu(tp->pdev, |
432 | tp->rx_buffers[entry].mapping, | 432 | tp->rx_buffers[entry].mapping, |
diff --git a/drivers/net/tulip/media.c b/drivers/net/tulip/media.c index daddfa51853e..d8fda83705bf 100644 --- a/drivers/net/tulip/media.c +++ b/drivers/net/tulip/media.c | |||
@@ -468,8 +468,8 @@ void __devinit tulip_find_mii (struct net_device *dev, int board_idx) | |||
468 | int phy = phyn & 0x1f; | 468 | int phy = phyn & 0x1f; |
469 | int mii_status = tulip_mdio_read (dev, phy, MII_BMSR); | 469 | int mii_status = tulip_mdio_read (dev, phy, MII_BMSR); |
470 | if ((mii_status & 0x8301) == 0x8001 || | 470 | if ((mii_status & 0x8301) == 0x8001 || |
471 | ((mii_status & BMSR_100BASE4) == 0 | 471 | ((mii_status & BMSR_100BASE4) == 0 && |
472 | && (mii_status & 0x7800) != 0)) { | 472 | (mii_status & 0x7800) != 0)) { |
473 | /* preserve Becker logic, gain indentation level */ | 473 | /* preserve Becker logic, gain indentation level */ |
474 | } else { | 474 | } else { |
475 | continue; | 475 | continue; |
diff --git a/drivers/net/tulip/pnic2.c b/drivers/net/tulip/pnic2.c index f49579128fb5..d8418694bf46 100644 --- a/drivers/net/tulip/pnic2.c +++ b/drivers/net/tulip/pnic2.c | |||
@@ -316,9 +316,9 @@ void pnic2_lnk_change(struct net_device *dev, int csr5) | |||
316 | } | 316 | } |
317 | } | 317 | } |
318 | 318 | ||
319 | if ((tp->nwayset && (csr5 & 0x08000000) | 319 | if ((tp->nwayset && (csr5 & 0x08000000) && |
320 | && (dev->if_port == 3 || dev->if_port == 5) | 320 | (dev->if_port == 3 || dev->if_port == 5) && |
321 | && (csr12 & 2) == 2) || (tp->nway && (csr5 & (TPLnkFail)))) { | 321 | (csr12 & 2) == 2) || (tp->nway && (csr5 & (TPLnkFail)))) { |
322 | 322 | ||
323 | /* Link blew? Maybe restart NWay. */ | 323 | /* Link blew? Maybe restart NWay. */ |
324 | 324 | ||
diff --git a/drivers/net/tulip/tulip_core.c b/drivers/net/tulip/tulip_core.c index 0df983bc03a6..0fa3140d65bf 100644 --- a/drivers/net/tulip/tulip_core.c +++ b/drivers/net/tulip/tulip_core.c | |||
@@ -64,9 +64,9 @@ const char * const medianame[32] = { | |||
64 | }; | 64 | }; |
65 | 65 | ||
66 | /* Set the copy breakpoint for the copy-only-tiny-buffer Rx structure. */ | 66 | /* Set the copy breakpoint for the copy-only-tiny-buffer Rx structure. */ |
67 | #if defined(__alpha__) || defined(__arm__) || defined(__hppa__) \ | 67 | #if defined(__alpha__) || defined(__arm__) || defined(__hppa__) || \ |
68 | || defined(CONFIG_SPARC) || defined(__ia64__) \ | 68 | defined(CONFIG_SPARC) || defined(__ia64__) || \ |
69 | || defined(__sh__) || defined(__mips__) | 69 | defined(__sh__) || defined(__mips__) |
70 | static int rx_copybreak = 1518; | 70 | static int rx_copybreak = 1518; |
71 | #else | 71 | #else |
72 | static int rx_copybreak = 100; | 72 | static int rx_copybreak = 100; |
@@ -449,8 +449,8 @@ media_picked: | |||
449 | iowrite32(0x0201B078, ioaddr + 0xB8); | 449 | iowrite32(0x0201B078, ioaddr + 0xB8); |
450 | next_tick = 1*HZ; | 450 | next_tick = 1*HZ; |
451 | } | 451 | } |
452 | } else if ((tp->chip_id == MX98713 || tp->chip_id == COMPEX9881) | 452 | } else if ((tp->chip_id == MX98713 || tp->chip_id == COMPEX9881) && |
453 | && ! tp->medialock) { | 453 | ! tp->medialock) { |
454 | dev->if_port = 0; | 454 | dev->if_port = 0; |
455 | tp->csr6 = 0x01880000 | (tp->full_duplex ? 0x0200 : 0); | 455 | tp->csr6 = 0x01880000 | (tp->full_duplex ? 0x0200 : 0); |
456 | iowrite32(0x0f370000 | ioread16(ioaddr + 0x80), ioaddr + 0x80); | 456 | iowrite32(0x0f370000 | ioread16(ioaddr + 0x80), ioaddr + 0x80); |
@@ -535,9 +535,9 @@ static void tulip_tx_timeout(struct net_device *dev) | |||
535 | if (tulip_debug > 1) | 535 | if (tulip_debug > 1) |
536 | printk(KERN_WARNING "%s: Transmit timeout using MII device.\n", | 536 | printk(KERN_WARNING "%s: Transmit timeout using MII device.\n", |
537 | dev->name); | 537 | dev->name); |
538 | } else if (tp->chip_id == DC21140 || tp->chip_id == DC21142 | 538 | } else if (tp->chip_id == DC21140 || tp->chip_id == DC21142 || |
539 | || tp->chip_id == MX98713 || tp->chip_id == COMPEX9881 | 539 | tp->chip_id == MX98713 || tp->chip_id == COMPEX9881 || |
540 | || tp->chip_id == DM910X) { | 540 | tp->chip_id == DM910X) { |
541 | printk(KERN_WARNING "%s: 21140 transmit timed out, status %8.8x, " | 541 | printk(KERN_WARNING "%s: 21140 transmit timed out, status %8.8x, " |
542 | "SIA %8.8x %8.8x %8.8x %8.8x, resetting...\n", | 542 | "SIA %8.8x %8.8x %8.8x %8.8x, resetting...\n", |
543 | dev->name, ioread32(ioaddr + CSR5), ioread32(ioaddr + CSR12), | 543 | dev->name, ioread32(ioaddr + CSR5), ioread32(ioaddr + CSR12), |
@@ -1538,8 +1538,10 @@ static int __devinit tulip_init_one (struct pci_dev *pdev, | |||
1538 | } | 1538 | } |
1539 | } | 1539 | } |
1540 | /* Lite-On boards have the address byte-swapped. */ | 1540 | /* Lite-On boards have the address byte-swapped. */ |
1541 | if ((dev->dev_addr[0] == 0xA0 || dev->dev_addr[0] == 0xC0 || dev->dev_addr[0] == 0x02) | 1541 | if ((dev->dev_addr[0] == 0xA0 || |
1542 | && dev->dev_addr[1] == 0x00) | 1542 | dev->dev_addr[0] == 0xC0 || |
1543 | dev->dev_addr[0] == 0x02) && | ||
1544 | dev->dev_addr[1] == 0x00) | ||
1543 | for (i = 0; i < 6; i+=2) { | 1545 | for (i = 0; i < 6; i+=2) { |
1544 | char tmp = dev->dev_addr[i]; | 1546 | char tmp = dev->dev_addr[i]; |
1545 | dev->dev_addr[i] = dev->dev_addr[i+1]; | 1547 | dev->dev_addr[i] = dev->dev_addr[i+1]; |
diff --git a/drivers/net/tulip/winbond-840.c b/drivers/net/tulip/winbond-840.c index 1a52729c9466..869a7a0005f9 100644 --- a/drivers/net/tulip/winbond-840.c +++ b/drivers/net/tulip/winbond-840.c | |||
@@ -1230,8 +1230,8 @@ static int netdev_rx(struct net_device *dev) | |||
1230 | #endif | 1230 | #endif |
1231 | /* Check if the packet is long enough to accept without copying | 1231 | /* Check if the packet is long enough to accept without copying |
1232 | to a minimally-sized skbuff. */ | 1232 | to a minimally-sized skbuff. */ |
1233 | if (pkt_len < rx_copybreak | 1233 | if (pkt_len < rx_copybreak && |
1234 | && (skb = dev_alloc_skb(pkt_len + 2)) != NULL) { | 1234 | (skb = dev_alloc_skb(pkt_len + 2)) != NULL) { |
1235 | skb_reserve(skb, 2); /* 16 byte align the IP header */ | 1235 | skb_reserve(skb, 2); /* 16 byte align the IP header */ |
1236 | pci_dma_sync_single_for_cpu(np->pci_dev,np->rx_addr[entry], | 1236 | pci_dma_sync_single_for_cpu(np->pci_dev,np->rx_addr[entry], |
1237 | np->rx_skbuff[entry]->len, | 1237 | np->rx_skbuff[entry]->len, |
@@ -1357,8 +1357,8 @@ static u32 __set_rx_mode(struct net_device *dev) | |||
1357 | memset(mc_filter, 0xff, sizeof(mc_filter)); | 1357 | memset(mc_filter, 0xff, sizeof(mc_filter)); |
1358 | rx_mode = RxAcceptBroadcast | AcceptMulticast | RxAcceptAllPhys | 1358 | rx_mode = RxAcceptBroadcast | AcceptMulticast | RxAcceptAllPhys |
1359 | | AcceptMyPhys; | 1359 | | AcceptMyPhys; |
1360 | } else if ((dev->mc_count > multicast_filter_limit) | 1360 | } else if ((dev->mc_count > multicast_filter_limit) || |
1361 | || (dev->flags & IFF_ALLMULTI)) { | 1361 | (dev->flags & IFF_ALLMULTI)) { |
1362 | /* Too many to match, or accept all multicasts. */ | 1362 | /* Too many to match, or accept all multicasts. */ |
1363 | memset(mc_filter, 0xff, sizeof(mc_filter)); | 1363 | memset(mc_filter, 0xff, sizeof(mc_filter)); |
1364 | rx_mode = RxAcceptBroadcast | AcceptMulticast | AcceptMyPhys; | 1364 | rx_mode = RxAcceptBroadcast | AcceptMulticast | AcceptMyPhys; |
diff --git a/drivers/net/typhoon.c b/drivers/net/typhoon.c index 079a97000e5b..39f1fc650be6 100644 --- a/drivers/net/typhoon.c +++ b/drivers/net/typhoon.c | |||
@@ -1769,8 +1769,8 @@ typhoon_rx(struct typhoon *tp, struct basic_ring *rxRing, volatile __le32 * read | |||
1769 | csum_bits = rx->rxStatus & (TYPHOON_RX_IP_CHK_GOOD | | 1769 | csum_bits = rx->rxStatus & (TYPHOON_RX_IP_CHK_GOOD | |
1770 | TYPHOON_RX_UDP_CHK_GOOD | TYPHOON_RX_TCP_CHK_GOOD); | 1770 | TYPHOON_RX_UDP_CHK_GOOD | TYPHOON_RX_TCP_CHK_GOOD); |
1771 | if(csum_bits == | 1771 | if(csum_bits == |
1772 | (TYPHOON_RX_IP_CHK_GOOD | TYPHOON_RX_TCP_CHK_GOOD) | 1772 | (TYPHOON_RX_IP_CHK_GOOD | TYPHOON_RX_TCP_CHK_GOOD) || |
1773 | || csum_bits == | 1773 | csum_bits == |
1774 | (TYPHOON_RX_IP_CHK_GOOD | TYPHOON_RX_UDP_CHK_GOOD)) { | 1774 | (TYPHOON_RX_IP_CHK_GOOD | TYPHOON_RX_UDP_CHK_GOOD)) { |
1775 | new_skb->ip_summed = CHECKSUM_UNNECESSARY; | 1775 | new_skb->ip_summed = CHECKSUM_UNNECESSARY; |
1776 | } else | 1776 | } else |
diff --git a/drivers/net/ucc_geth.c b/drivers/net/ucc_geth.c index 4469f2451a6f..9f44c99777a8 100644 --- a/drivers/net/ucc_geth.c +++ b/drivers/net/ucc_geth.c | |||
@@ -1306,8 +1306,8 @@ static int init_max_rx_buff_len(u16 max_rx_buf_len, | |||
1306 | u16 __iomem *mrblr_register) | 1306 | u16 __iomem *mrblr_register) |
1307 | { | 1307 | { |
1308 | /* max_rx_buf_len value must be a multiple of 128 */ | 1308 | /* max_rx_buf_len value must be a multiple of 128 */ |
1309 | if ((max_rx_buf_len == 0) | 1309 | if ((max_rx_buf_len == 0) || |
1310 | || (max_rx_buf_len % UCC_GETH_MRBLR_ALIGNMENT)) | 1310 | (max_rx_buf_len % UCC_GETH_MRBLR_ALIGNMENT)) |
1311 | return -EINVAL; | 1311 | return -EINVAL; |
1312 | 1312 | ||
1313 | out_be16(mrblr_register, max_rx_buf_len); | 1313 | out_be16(mrblr_register, max_rx_buf_len); |
@@ -2159,8 +2159,8 @@ static int ucc_struct_init(struct ucc_geth_private *ugeth) | |||
2159 | } | 2159 | } |
2160 | 2160 | ||
2161 | if ((ug_info->numStationAddresses != | 2161 | if ((ug_info->numStationAddresses != |
2162 | UCC_GETH_NUM_OF_STATION_ADDRESSES_1) | 2162 | UCC_GETH_NUM_OF_STATION_ADDRESSES_1) && |
2163 | && ug_info->rxExtendedFiltering) { | 2163 | ug_info->rxExtendedFiltering) { |
2164 | if (netif_msg_probe(ugeth)) | 2164 | if (netif_msg_probe(ugeth)) |
2165 | ugeth_err("%s: Number of station addresses greater than 1 " | 2165 | ugeth_err("%s: Number of station addresses greater than 1 " |
2166 | "not allowed in extended parsing mode.", | 2166 | "not allowed in extended parsing mode.", |
@@ -2284,9 +2284,9 @@ static int ucc_geth_startup(struct ucc_geth_private *ugeth) | |||
2284 | UCC_GETH_NUM_OF_STATION_ADDRESSES_1); | 2284 | UCC_GETH_NUM_OF_STATION_ADDRESSES_1); |
2285 | 2285 | ||
2286 | ugeth->rx_extended_features = ugeth->rx_non_dynamic_extended_features || | 2286 | ugeth->rx_extended_features = ugeth->rx_non_dynamic_extended_features || |
2287 | (ug_info->vlanOperationTagged != UCC_GETH_VLAN_OPERATION_TAGGED_NOP) | 2287 | (ug_info->vlanOperationTagged != UCC_GETH_VLAN_OPERATION_TAGGED_NOP) || |
2288 | || (ug_info->vlanOperationNonTagged != | 2288 | (ug_info->vlanOperationNonTagged != |
2289 | UCC_GETH_VLAN_OPERATION_NON_TAGGED_NOP); | 2289 | UCC_GETH_VLAN_OPERATION_NON_TAGGED_NOP); |
2290 | 2290 | ||
2291 | init_default_reg_vals(&uf_regs->upsmr, | 2291 | init_default_reg_vals(&uf_regs->upsmr, |
2292 | &ug_regs->maccfg1, &ug_regs->maccfg2); | 2292 | &ug_regs->maccfg1, &ug_regs->maccfg2); |
@@ -2987,11 +2987,11 @@ static int ucc_geth_startup(struct ucc_geth_private *ugeth) | |||
2987 | ugeth->p_init_enet_param_shadow->rgftgfrxglobal |= | 2987 | ugeth->p_init_enet_param_shadow->rgftgfrxglobal |= |
2988 | ugeth->rx_glbl_pram_offset | ug_info->riscRx; | 2988 | ugeth->rx_glbl_pram_offset | ug_info->riscRx; |
2989 | if ((ug_info->largestexternallookupkeysize != | 2989 | if ((ug_info->largestexternallookupkeysize != |
2990 | QE_FLTR_LARGEST_EXTERNAL_TABLE_LOOKUP_KEY_SIZE_NONE) | 2990 | QE_FLTR_LARGEST_EXTERNAL_TABLE_LOOKUP_KEY_SIZE_NONE) && |
2991 | && (ug_info->largestexternallookupkeysize != | 2991 | (ug_info->largestexternallookupkeysize != |
2992 | QE_FLTR_LARGEST_EXTERNAL_TABLE_LOOKUP_KEY_SIZE_8_BYTES) | 2992 | QE_FLTR_LARGEST_EXTERNAL_TABLE_LOOKUP_KEY_SIZE_8_BYTES) && |
2993 | && (ug_info->largestexternallookupkeysize != | 2993 | (ug_info->largestexternallookupkeysize != |
2994 | QE_FLTR_LARGEST_EXTERNAL_TABLE_LOOKUP_KEY_SIZE_16_BYTES)) { | 2994 | QE_FLTR_LARGEST_EXTERNAL_TABLE_LOOKUP_KEY_SIZE_16_BYTES)) { |
2995 | if (netif_msg_ifup(ugeth)) | 2995 | if (netif_msg_ifup(ugeth)) |
2996 | ugeth_err("%s: Invalid largest External Lookup Key Size.", | 2996 | ugeth_err("%s: Invalid largest External Lookup Key Size.", |
2997 | __func__); | 2997 | __func__); |
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; |
diff --git a/drivers/net/via-rhine.c b/drivers/net/via-rhine.c index ec94ddf01f56..593e01f64e9b 100644 --- a/drivers/net/via-rhine.c +++ b/drivers/net/via-rhine.c | |||
@@ -42,9 +42,9 @@ static int max_interrupt_work = 20; | |||
42 | 42 | ||
43 | /* Set the copy breakpoint for the copy-only-tiny-frames scheme. | 43 | /* Set the copy breakpoint for the copy-only-tiny-frames scheme. |
44 | Setting to > 1518 effectively disables this feature. */ | 44 | Setting to > 1518 effectively disables this feature. */ |
45 | #if defined(__alpha__) || defined(__arm__) || defined(__hppa__) \ | 45 | #if defined(__alpha__) || defined(__arm__) || defined(__hppa__) || \ |
46 | || defined(CONFIG_SPARC) || defined(__ia64__) \ | 46 | defined(CONFIG_SPARC) || defined(__ia64__) || \ |
47 | || defined(__sh__) || defined(__mips__) | 47 | defined(__sh__) || defined(__mips__) |
48 | static int rx_copybreak = 1518; | 48 | static int rx_copybreak = 1518; |
49 | #else | 49 | #else |
50 | static int rx_copybreak; | 50 | static int rx_copybreak; |
@@ -1683,8 +1683,8 @@ static void rhine_set_rx_mode(struct net_device *dev) | |||
1683 | rx_mode = 0x1C; | 1683 | rx_mode = 0x1C; |
1684 | iowrite32(0xffffffff, ioaddr + MulticastFilter0); | 1684 | iowrite32(0xffffffff, ioaddr + MulticastFilter0); |
1685 | iowrite32(0xffffffff, ioaddr + MulticastFilter1); | 1685 | iowrite32(0xffffffff, ioaddr + MulticastFilter1); |
1686 | } else if ((dev->mc_count > multicast_filter_limit) | 1686 | } else if ((dev->mc_count > multicast_filter_limit) || |
1687 | || (dev->flags & IFF_ALLMULTI)) { | 1687 | (dev->flags & IFF_ALLMULTI)) { |
1688 | /* Too many to match, or accept all multicasts. */ | 1688 | /* Too many to match, or accept all multicasts. */ |
1689 | iowrite32(0xffffffff, ioaddr + MulticastFilter0); | 1689 | iowrite32(0xffffffff, ioaddr + MulticastFilter0); |
1690 | iowrite32(0xffffffff, ioaddr + MulticastFilter1); | 1690 | iowrite32(0xffffffff, ioaddr + MulticastFilter1); |
diff --git a/drivers/net/via-velocity.c b/drivers/net/via-velocity.c index d4eac2a14427..4ceb441f2687 100644 --- a/drivers/net/via-velocity.c +++ b/drivers/net/via-velocity.c | |||
@@ -895,8 +895,8 @@ static int velocity_set_media_mode(struct velocity_info *vptr, u32 mii_status) | |||
895 | 895 | ||
896 | /* | 896 | /* |
897 | Check if new status is consisent with current status | 897 | Check if new status is consisent with current status |
898 | if (((mii_status & curr_status) & VELOCITY_AUTONEG_ENABLE) | 898 | if (((mii_status & curr_status) & VELOCITY_AUTONEG_ENABLE) || |
899 | || (mii_status==curr_status)) { | 899 | (mii_status==curr_status)) { |
900 | vptr->mii_status=mii_check_media_mode(vptr->mac_regs); | 900 | vptr->mii_status=mii_check_media_mode(vptr->mac_regs); |
901 | vptr->mii_status=check_connection_type(vptr->mac_regs); | 901 | vptr->mii_status=check_connection_type(vptr->mac_regs); |
902 | VELOCITY_PRT(MSG_LEVEL_INFO, "Velocity link no change\n"); | 902 | VELOCITY_PRT(MSG_LEVEL_INFO, "Velocity link no change\n"); |
@@ -1132,8 +1132,8 @@ static void velocity_set_multi(struct net_device *dev) | |||
1132 | writel(0xffffffff, ®s->MARCAM[0]); | 1132 | writel(0xffffffff, ®s->MARCAM[0]); |
1133 | writel(0xffffffff, ®s->MARCAM[4]); | 1133 | writel(0xffffffff, ®s->MARCAM[4]); |
1134 | rx_mode = (RCR_AM | RCR_AB | RCR_PROM); | 1134 | rx_mode = (RCR_AM | RCR_AB | RCR_PROM); |
1135 | } else if ((dev->mc_count > vptr->multicast_limit) | 1135 | } else if ((dev->mc_count > vptr->multicast_limit) || |
1136 | || (dev->flags & IFF_ALLMULTI)) { | 1136 | (dev->flags & IFF_ALLMULTI)) { |
1137 | writel(0xffffffff, ®s->MARCAM[0]); | 1137 | writel(0xffffffff, ®s->MARCAM[0]); |
1138 | writel(0xffffffff, ®s->MARCAM[4]); | 1138 | writel(0xffffffff, ®s->MARCAM[4]); |
1139 | rx_mode = (RCR_AM | RCR_AB); | 1139 | rx_mode = (RCR_AM | RCR_AB); |
@@ -1936,8 +1936,8 @@ static int velocity_tx_srv(struct velocity_info *vptr, u32 status) | |||
1936 | * Look to see if we should kick the transmit network | 1936 | * Look to see if we should kick the transmit network |
1937 | * layer for more work. | 1937 | * layer for more work. |
1938 | */ | 1938 | */ |
1939 | if (netif_queue_stopped(vptr->dev) && (full == 0) | 1939 | if (netif_queue_stopped(vptr->dev) && (full == 0) && |
1940 | && (!(vptr->mii_status & VELOCITY_LINK_FAIL))) { | 1940 | (!(vptr->mii_status & VELOCITY_LINK_FAIL))) { |
1941 | netif_wake_queue(vptr->dev); | 1941 | netif_wake_queue(vptr->dev); |
1942 | } | 1942 | } |
1943 | return works; | 1943 | return works; |
@@ -2584,8 +2584,8 @@ static netdev_tx_t velocity_xmit(struct sk_buff *skb, | |||
2584 | /* | 2584 | /* |
2585 | * Handle hardware checksum | 2585 | * Handle hardware checksum |
2586 | */ | 2586 | */ |
2587 | if ( (dev->features & NETIF_F_IP_CSUM) | 2587 | if ((dev->features & NETIF_F_IP_CSUM) && |
2588 | && (skb->ip_summed == CHECKSUM_PARTIAL)) { | 2588 | (skb->ip_summed == CHECKSUM_PARTIAL)) { |
2589 | const struct iphdr *ip = ip_hdr(skb); | 2589 | const struct iphdr *ip = ip_hdr(skb); |
2590 | if (ip->protocol == IPPROTO_TCP) | 2590 | if (ip->protocol == IPPROTO_TCP) |
2591 | td_ptr->tdesc1.TCR |= TCR0_TCPCK; | 2591 | td_ptr->tdesc1.TCR |= TCR0_TCPCK; |
diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c index 74636c5c41f0..c708ecc3cb2e 100644 --- a/drivers/net/virtio_net.c +++ b/drivers/net/virtio_net.c | |||
@@ -428,8 +428,8 @@ again: | |||
428 | /* Out of packets? */ | 428 | /* Out of packets? */ |
429 | if (received < budget) { | 429 | if (received < budget) { |
430 | napi_complete(napi); | 430 | napi_complete(napi); |
431 | if (unlikely(!vi->rvq->vq_ops->enable_cb(vi->rvq)) | 431 | if (unlikely(!vi->rvq->vq_ops->enable_cb(vi->rvq)) && |
432 | && napi_schedule_prep(napi)) { | 432 | napi_schedule_prep(napi)) { |
433 | vi->rvq->vq_ops->disable_cb(vi->rvq); | 433 | vi->rvq->vq_ops->disable_cb(vi->rvq); |
434 | __napi_schedule(napi); | 434 | __napi_schedule(napi); |
435 | goto again; | 435 | goto again; |
@@ -890,9 +890,9 @@ static int virtnet_probe(struct virtio_device *vdev) | |||
890 | INIT_DELAYED_WORK(&vi->refill, refill_work); | 890 | INIT_DELAYED_WORK(&vi->refill, refill_work); |
891 | 891 | ||
892 | /* If we can receive ANY GSO packets, we must allocate large ones. */ | 892 | /* If we can receive ANY GSO packets, we must allocate large ones. */ |
893 | if (virtio_has_feature(vdev, VIRTIO_NET_F_GUEST_TSO4) | 893 | if (virtio_has_feature(vdev, VIRTIO_NET_F_GUEST_TSO4) || |
894 | || virtio_has_feature(vdev, VIRTIO_NET_F_GUEST_TSO6) | 894 | virtio_has_feature(vdev, VIRTIO_NET_F_GUEST_TSO6) || |
895 | || virtio_has_feature(vdev, VIRTIO_NET_F_GUEST_ECN)) | 895 | virtio_has_feature(vdev, VIRTIO_NET_F_GUEST_ECN)) |
896 | vi->big_packets = true; | 896 | vi->big_packets = true; |
897 | 897 | ||
898 | if (virtio_has_feature(vdev, VIRTIO_NET_F_MRG_RXBUF)) | 898 | if (virtio_has_feature(vdev, VIRTIO_NET_F_MRG_RXBUF)) |
diff --git a/drivers/net/vmxnet3/vmxnet3_drv.c b/drivers/net/vmxnet3/vmxnet3_drv.c index a4c97e786ee5..1ceb9d0f8b97 100644 --- a/drivers/net/vmxnet3/vmxnet3_drv.c +++ b/drivers/net/vmxnet3/vmxnet3_drv.c | |||
@@ -1780,8 +1780,8 @@ vmxnet3_setup_driver_shared(struct vmxnet3_adapter *adapter) | |||
1780 | set_flag_le64(&devRead->misc.uptFeatures, UPT1_F_LRO); | 1780 | set_flag_le64(&devRead->misc.uptFeatures, UPT1_F_LRO); |
1781 | devRead->misc.maxNumRxSG = cpu_to_le16(1 + MAX_SKB_FRAGS); | 1781 | devRead->misc.maxNumRxSG = cpu_to_le16(1 + MAX_SKB_FRAGS); |
1782 | } | 1782 | } |
1783 | if ((adapter->netdev->features & NETIF_F_HW_VLAN_RX) | 1783 | if ((adapter->netdev->features & NETIF_F_HW_VLAN_RX) && |
1784 | && adapter->vlan_grp) { | 1784 | adapter->vlan_grp) { |
1785 | set_flag_le64(&devRead->misc.uptFeatures, UPT1_F_RXVLAN); | 1785 | set_flag_le64(&devRead->misc.uptFeatures, UPT1_F_RXVLAN); |
1786 | } | 1786 | } |
1787 | 1787 | ||
diff --git a/drivers/net/vxge/vxge-main.c b/drivers/net/vxge/vxge-main.c index e21358e82c74..f1c4b2a1e867 100644 --- a/drivers/net/vxge/vxge-main.c +++ b/drivers/net/vxge/vxge-main.c | |||
@@ -2510,9 +2510,9 @@ static int vxge_add_isr(struct vxgedev *vdev) | |||
2510 | } | 2510 | } |
2511 | 2511 | ||
2512 | /* Point to next vpath handler */ | 2512 | /* Point to next vpath handler */ |
2513 | if (((intr_idx + 1) % VXGE_HW_VPATH_MSIX_ACTIVE == 0) | 2513 | if (((intr_idx + 1) % VXGE_HW_VPATH_MSIX_ACTIVE == 0) && |
2514 | && (vp_idx < (vdev->no_of_vpath - 1))) | 2514 | (vp_idx < (vdev->no_of_vpath - 1))) |
2515 | vp_idx++; | 2515 | vp_idx++; |
2516 | } | 2516 | } |
2517 | 2517 | ||
2518 | intr_cnt = vdev->max_vpath_supported * 2; | 2518 | intr_cnt = vdev->max_vpath_supported * 2; |
diff --git a/drivers/net/vxge/vxge-traffic.c b/drivers/net/vxge/vxge-traffic.c index 61ce754fa9d0..2c012f4ce465 100644 --- a/drivers/net/vxge/vxge-traffic.c +++ b/drivers/net/vxge/vxge-traffic.c | |||
@@ -1963,14 +1963,14 @@ enum vxge_hw_status __vxge_hw_vpath_alarm_process( | |||
1963 | val64 = readq(&vp_reg->asic_ntwk_vp_err_reg); | 1963 | val64 = readq(&vp_reg->asic_ntwk_vp_err_reg); |
1964 | 1964 | ||
1965 | if (((val64 & | 1965 | if (((val64 & |
1966 | VXGE_HW_ASIC_NW_VP_ERR_REG_XMACJ_STN_FLT) && | 1966 | VXGE_HW_ASIC_NW_VP_ERR_REG_XMACJ_STN_FLT) && |
1967 | (!(val64 & | 1967 | (!(val64 & |
1968 | VXGE_HW_ASIC_NW_VP_ERR_REG_XMACJ_STN_OK))) || | 1968 | VXGE_HW_ASIC_NW_VP_ERR_REG_XMACJ_STN_OK))) || |
1969 | ((val64 & | 1969 | ((val64 & |
1970 | VXGE_HW_ASIC_NW_VP_ERR_REG_XMACJ_STN_FLT_OCCURR) | 1970 | VXGE_HW_ASIC_NW_VP_ERR_REG_XMACJ_STN_FLT_OCCURR) && |
1971 | && (!(val64 & | 1971 | (!(val64 & |
1972 | VXGE_HW_ASIC_NW_VP_ERR_REG_XMACJ_STN_OK_OCCURR) | 1972 | VXGE_HW_ASIC_NW_VP_ERR_REG_XMACJ_STN_OK_OCCURR) |
1973 | ))) { | 1973 | ))) { |
1974 | sw_stats->error_stats.network_sustained_fault++; | 1974 | sw_stats->error_stats.network_sustained_fault++; |
1975 | 1975 | ||
1976 | writeq( | 1976 | writeq( |
@@ -1983,14 +1983,14 @@ enum vxge_hw_status __vxge_hw_vpath_alarm_process( | |||
1983 | } | 1983 | } |
1984 | 1984 | ||
1985 | if (((val64 & | 1985 | if (((val64 & |
1986 | VXGE_HW_ASIC_NW_VP_ERR_REG_XMACJ_STN_OK) && | 1986 | VXGE_HW_ASIC_NW_VP_ERR_REG_XMACJ_STN_OK) && |
1987 | (!(val64 & | 1987 | (!(val64 & |
1988 | VXGE_HW_ASIC_NW_VP_ERR_REG_XMACJ_STN_FLT))) || | 1988 | VXGE_HW_ASIC_NW_VP_ERR_REG_XMACJ_STN_FLT))) || |
1989 | ((val64 & | 1989 | ((val64 & |
1990 | VXGE_HW_ASIC_NW_VP_ERR_REG_XMACJ_STN_OK_OCCURR) | 1990 | VXGE_HW_ASIC_NW_VP_ERR_REG_XMACJ_STN_OK_OCCURR) && |
1991 | && (!(val64 & | 1991 | (!(val64 & |
1992 | VXGE_HW_ASIC_NW_VP_ERR_REG_XMACJ_STN_FLT_OCCURR) | 1992 | VXGE_HW_ASIC_NW_VP_ERR_REG_XMACJ_STN_FLT_OCCURR) |
1993 | ))) { | 1993 | ))) { |
1994 | 1994 | ||
1995 | sw_stats->error_stats.network_sustained_ok++; | 1995 | sw_stats->error_stats.network_sustained_ok++; |
1996 | 1996 | ||
diff --git a/drivers/net/wan/farsync.c b/drivers/net/wan/farsync.c index beda387f2fc7..9bc2e3649157 100644 --- a/drivers/net/wan/farsync.c +++ b/drivers/net/wan/farsync.c | |||
@@ -1346,8 +1346,8 @@ do_bottom_half_tx(struct fst_card_info *card) | |||
1346 | 1346 | ||
1347 | dev = port_to_dev(port); | 1347 | dev = port_to_dev(port); |
1348 | while (!(FST_RDB(card, txDescrRing[pi][port->txpos].bits) & | 1348 | while (!(FST_RDB(card, txDescrRing[pi][port->txpos].bits) & |
1349 | DMA_OWN) | 1349 | DMA_OWN) && |
1350 | && !(card->dmatx_in_progress)) { | 1350 | !(card->dmatx_in_progress)) { |
1351 | /* | 1351 | /* |
1352 | * There doesn't seem to be a txdone event per-se | 1352 | * There doesn't seem to be a txdone event per-se |
1353 | * We seem to have to deduce it, by checking the DMA_OWN | 1353 | * We seem to have to deduce it, by checking the DMA_OWN |
@@ -1379,8 +1379,8 @@ do_bottom_half_tx(struct fst_card_info *card) | |||
1379 | */ | 1379 | */ |
1380 | FST_WRW(card, txDescrRing[pi][port->txpos].bcnt, | 1380 | FST_WRW(card, txDescrRing[pi][port->txpos].bcnt, |
1381 | cnv_bcnt(skb->len)); | 1381 | cnv_bcnt(skb->len)); |
1382 | if ((skb->len < FST_MIN_DMA_LEN) | 1382 | if ((skb->len < FST_MIN_DMA_LEN) || |
1383 | || (card->family == FST_FAMILY_TXP)) { | 1383 | (card->family == FST_FAMILY_TXP)) { |
1384 | /* Enqueue the packet with normal io */ | 1384 | /* Enqueue the packet with normal io */ |
1385 | memcpy_toio(card->mem + | 1385 | memcpy_toio(card->mem + |
1386 | BUF_OFFSET(txBuffer[pi] | 1386 | BUF_OFFSET(txBuffer[pi] |
@@ -2030,8 +2030,8 @@ fst_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd) | |||
2030 | /* Sanity check the parameters. We don't support partial writes | 2030 | /* Sanity check the parameters. We don't support partial writes |
2031 | * when going over the top | 2031 | * when going over the top |
2032 | */ | 2032 | */ |
2033 | if (wrthdr.size > FST_MEMSIZE || wrthdr.offset > FST_MEMSIZE | 2033 | if (wrthdr.size > FST_MEMSIZE || wrthdr.offset > FST_MEMSIZE || |
2034 | || wrthdr.size + wrthdr.offset > FST_MEMSIZE) { | 2034 | wrthdr.size + wrthdr.offset > FST_MEMSIZE) { |
2035 | return -ENXIO; | 2035 | return -ENXIO; |
2036 | } | 2036 | } |
2037 | 2037 | ||
diff --git a/drivers/net/wan/pc300_drv.c b/drivers/net/wan/pc300_drv.c index 79dabc557bd3..aec4d3955420 100644 --- a/drivers/net/wan/pc300_drv.c +++ b/drivers/net/wan/pc300_drv.c | |||
@@ -514,8 +514,8 @@ static int dma_buf_read(pc300_t * card, int ch, struct sk_buff *skb) | |||
514 | RX_BD_ADDR(ch, chan->rx_first_bd)); | 514 | RX_BD_ADDR(ch, chan->rx_first_bd)); |
515 | while ((status = cpc_readb(&ptdescr->status)) & DST_OSB) { | 515 | while ((status = cpc_readb(&ptdescr->status)) & DST_OSB) { |
516 | nchar = cpc_readw(&ptdescr->len); | 516 | nchar = cpc_readw(&ptdescr->len); |
517 | if ((status & (DST_OVR | DST_CRC | DST_RBIT | DST_SHRT | DST_ABT)) | 517 | if ((status & (DST_OVR | DST_CRC | DST_RBIT | DST_SHRT | DST_ABT)) || |
518 | || (nchar > BD_DEF_LEN)) { | 518 | (nchar > BD_DEF_LEN)) { |
519 | 519 | ||
520 | if (nchar > BD_DEF_LEN) | 520 | if (nchar > BD_DEF_LEN) |
521 | status |= DST_RBIT; | 521 | status |= DST_RBIT; |
@@ -1428,8 +1428,7 @@ static void falc_update_stats(pc300_t * card, int ch) | |||
1428 | 1428 | ||
1429 | if (((conf->media == IF_IFACE_T1) && | 1429 | if (((conf->media == IF_IFACE_T1) && |
1430 | (cpc_readb(falcbase + F_REG(FRS1, ch)) & FRS1_LLBAD) && | 1430 | (cpc_readb(falcbase + F_REG(FRS1, ch)) & FRS1_LLBAD) && |
1431 | (!(cpc_readb(falcbase + F_REG(FRS1, ch)) & FRS1_PDEN))) | 1431 | (!(cpc_readb(falcbase + F_REG(FRS1, ch)) & FRS1_PDEN))) || |
1432 | || | ||
1433 | ((conf->media == IF_IFACE_E1) && | 1432 | ((conf->media == IF_IFACE_E1) && |
1434 | (cpc_readb(falcbase + F_REG(RSP, ch)) & RSP_LLBAD))) { | 1433 | (cpc_readb(falcbase + F_REG(RSP, ch)) & RSP_LLBAD))) { |
1435 | pfalc->prbs = 2; | 1434 | pfalc->prbs = 2; |
@@ -2285,8 +2284,8 @@ static void falc_e1_intr(pc300_t * card, int ch) | |||
2285 | if (gis & GIS_ISR1) { | 2284 | if (gis & GIS_ISR1) { |
2286 | isr1 = cpc_readb(falcbase + F_REG(FISR1, ch)); | 2285 | isr1 = cpc_readb(falcbase + F_REG(FISR1, ch)); |
2287 | if (isr1 & FISR1_XMB) { | 2286 | if (isr1 & FISR1_XMB) { |
2288 | if ((pfalc->xmb_cause & 2) | 2287 | if ((pfalc->xmb_cause & 2) && |
2289 | && pfalc->multiframe_mode) { | 2288 | pfalc->multiframe_mode) { |
2290 | if (cpc_readb (falcbase + F_REG(FRS0, ch)) & | 2289 | if (cpc_readb (falcbase + F_REG(FRS0, ch)) & |
2291 | (FRS0_LOS | FRS0_AIS | FRS0_LFA)) { | 2290 | (FRS0_LOS | FRS0_AIS | FRS0_LFA)) { |
2292 | cpc_writeb(falcbase + F_REG(XSP, ch), | 2291 | cpc_writeb(falcbase + F_REG(XSP, ch), |
@@ -2639,9 +2638,9 @@ static int cpc_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd) | |||
2639 | !(cpc_readb (scabase + M_REG(CTL, ch)) & CTL_DTR); | 2638 | !(cpc_readb (scabase + M_REG(CTL, ch)) & CTL_DTR); |
2640 | /* There is no DSR in HD64572 */ | 2639 | /* There is no DSR in HD64572 */ |
2641 | } | 2640 | } |
2642 | if (!arg | 2641 | if (!arg || |
2643 | || copy_to_user(arg, &pc300status, sizeof(pc300status_t))) | 2642 | copy_to_user(arg, &pc300status, sizeof(pc300status_t))) |
2644 | return -EINVAL; | 2643 | return -EINVAL; |
2645 | return 0; | 2644 | return 0; |
2646 | } | 2645 | } |
2647 | 2646 | ||
diff --git a/drivers/net/wan/sbni.c b/drivers/net/wan/sbni.c index 1cc24a45f003..25477b5cde47 100644 --- a/drivers/net/wan/sbni.c +++ b/drivers/net/wan/sbni.c | |||
@@ -195,9 +195,9 @@ static unsigned int netcard_portlist[ ] __initdata = { | |||
195 | static inline int __init | 195 | static inline int __init |
196 | sbni_isa_probe( struct net_device *dev ) | 196 | sbni_isa_probe( struct net_device *dev ) |
197 | { | 197 | { |
198 | if( dev->base_addr > 0x1ff | 198 | if( dev->base_addr > 0x1ff && |
199 | && request_region( dev->base_addr, SBNI_IO_EXTENT, dev->name ) | 199 | request_region( dev->base_addr, SBNI_IO_EXTENT, dev->name ) && |
200 | && sbni_probe1( dev, dev->base_addr, dev->irq ) ) | 200 | sbni_probe1( dev, dev->base_addr, dev->irq ) ) |
201 | 201 | ||
202 | return 0; | 202 | return 0; |
203 | else { | 203 | else { |
@@ -286,8 +286,8 @@ static int __init sbni_init(struct net_device *dev) | |||
286 | 286 | ||
287 | for( i = 0; netcard_portlist[ i ]; ++i ) { | 287 | for( i = 0; netcard_portlist[ i ]; ++i ) { |
288 | int ioaddr = netcard_portlist[ i ]; | 288 | int ioaddr = netcard_portlist[ i ]; |
289 | if( request_region( ioaddr, SBNI_IO_EXTENT, dev->name ) | 289 | if( request_region( ioaddr, SBNI_IO_EXTENT, dev->name ) && |
290 | && sbni_probe1( dev, ioaddr, 0 )) | 290 | sbni_probe1( dev, ioaddr, 0 )) |
291 | return 0; | 291 | return 0; |
292 | } | 292 | } |
293 | 293 | ||
@@ -306,9 +306,9 @@ sbni_pci_probe( struct net_device *dev ) | |||
306 | unsigned long pci_ioaddr; | 306 | unsigned long pci_ioaddr; |
307 | u16 subsys; | 307 | u16 subsys; |
308 | 308 | ||
309 | if( pdev->vendor != SBNI_PCI_VENDOR | 309 | if( pdev->vendor != SBNI_PCI_VENDOR && |
310 | && pdev->device != SBNI_PCI_DEVICE ) | 310 | pdev->device != SBNI_PCI_DEVICE ) |
311 | continue; | 311 | continue; |
312 | 312 | ||
313 | pci_ioaddr = pci_resource_start( pdev, 0 ); | 313 | pci_ioaddr = pci_resource_start( pdev, 0 ); |
314 | pci_irq_line = pdev->irq; | 314 | pci_irq_line = pdev->irq; |
@@ -977,8 +977,8 @@ check_fhdr( u32 ioaddr, u32 *framelen, u32 *frameno, u32 *ack, | |||
977 | *ack = *framelen & FRAME_ACK_MASK; | 977 | *ack = *framelen & FRAME_ACK_MASK; |
978 | *is_first = (*framelen & FRAME_FIRST) != 0; | 978 | *is_first = (*framelen & FRAME_FIRST) != 0; |
979 | 979 | ||
980 | if( (*framelen &= FRAME_LEN_MASK) < 6 | 980 | if( (*framelen &= FRAME_LEN_MASK) < 6 || |
981 | || *framelen > SBNI_MAX_FRAME - 3 ) | 981 | *framelen > SBNI_MAX_FRAME - 3 ) |
982 | return 0; | 982 | return 0; |
983 | 983 | ||
984 | value = inb( ioaddr + DAT ); | 984 | value = inb( ioaddr + DAT ); |
@@ -1173,10 +1173,10 @@ sbni_open( struct net_device *dev ) | |||
1173 | if( dev->base_addr < 0x400 ) { /* ISA only */ | 1173 | if( dev->base_addr < 0x400 ) { /* ISA only */ |
1174 | struct net_device **p = sbni_cards; | 1174 | struct net_device **p = sbni_cards; |
1175 | for( ; *p && p < sbni_cards + SBNI_MAX_NUM_CARDS; ++p ) | 1175 | for( ; *p && p < sbni_cards + SBNI_MAX_NUM_CARDS; ++p ) |
1176 | if( (*p)->irq == dev->irq | 1176 | if( (*p)->irq == dev->irq && |
1177 | && ((*p)->base_addr == dev->base_addr + 4 | 1177 | ((*p)->base_addr == dev->base_addr + 4 || |
1178 | || (*p)->base_addr == dev->base_addr - 4) | 1178 | (*p)->base_addr == dev->base_addr - 4) && |
1179 | && (*p)->flags & IFF_UP ) { | 1179 | (*p)->flags & IFF_UP ) { |
1180 | 1180 | ||
1181 | ((struct net_local *) (netdev_priv(*p))) | 1181 | ((struct net_local *) (netdev_priv(*p))) |
1182 | ->second = dev; | 1182 | ->second = dev; |
diff --git a/drivers/net/wan/x25_asy.c b/drivers/net/wan/x25_asy.c index 3c325d77939b..b9f520b7db6a 100644 --- a/drivers/net/wan/x25_asy.c +++ b/drivers/net/wan/x25_asy.c | |||
@@ -657,8 +657,8 @@ static void x25_asy_unesc(struct x25_asy *sl, unsigned char s) | |||
657 | 657 | ||
658 | switch (s) { | 658 | switch (s) { |
659 | case X25_END: | 659 | case X25_END: |
660 | if (!test_and_clear_bit(SLF_ERROR, &sl->flags) | 660 | if (!test_and_clear_bit(SLF_ERROR, &sl->flags) && |
661 | && sl->rcount > 2) | 661 | sl->rcount > 2) |
662 | x25_asy_bump(sl); | 662 | x25_asy_bump(sl); |
663 | clear_bit(SLF_ESCAPE, &sl->flags); | 663 | clear_bit(SLF_ESCAPE, &sl->flags); |
664 | sl->rcount = 0; | 664 | sl->rcount = 0; |
diff --git a/drivers/net/yellowfin.c b/drivers/net/yellowfin.c index d831dfca0976..0f773a9a3ff2 100644 --- a/drivers/net/yellowfin.c +++ b/drivers/net/yellowfin.c | |||
@@ -944,8 +944,8 @@ static irqreturn_t yellowfin_interrupt(int irq, void *dev_instance) | |||
944 | dev_kfree_skb_irq(skb); | 944 | dev_kfree_skb_irq(skb); |
945 | yp->tx_skbuff[entry] = NULL; | 945 | yp->tx_skbuff[entry] = NULL; |
946 | } | 946 | } |
947 | if (yp->tx_full | 947 | if (yp->tx_full && |
948 | && yp->cur_tx - yp->dirty_tx < TX_QUEUE_SIZE - 4) { | 948 | yp->cur_tx - yp->dirty_tx < TX_QUEUE_SIZE - 4) { |
949 | /* The ring is no longer full, clear tbusy. */ | 949 | /* The ring is no longer full, clear tbusy. */ |
950 | yp->tx_full = 0; | 950 | yp->tx_full = 0; |
951 | netif_wake_queue(dev); | 951 | netif_wake_queue(dev); |
@@ -1014,8 +1014,8 @@ static irqreturn_t yellowfin_interrupt(int irq, void *dev_instance) | |||
1014 | } | 1014 | } |
1015 | #endif | 1015 | #endif |
1016 | 1016 | ||
1017 | if (yp->tx_full | 1017 | if (yp->tx_full && |
1018 | && yp->cur_tx - dirty_tx < TX_QUEUE_SIZE - 2) { | 1018 | yp->cur_tx - dirty_tx < TX_QUEUE_SIZE - 2) { |
1019 | /* The ring is no longer full, clear tbusy. */ | 1019 | /* The ring is no longer full, clear tbusy. */ |
1020 | yp->tx_full = 0; | 1020 | yp->tx_full = 0; |
1021 | netif_wake_queue(dev); | 1021 | netif_wake_queue(dev); |
diff --git a/drivers/net/znet.c b/drivers/net/znet.c index a97d894d26fb..bc5ae0f6e934 100644 --- a/drivers/net/znet.c +++ b/drivers/net/znet.c | |||
@@ -697,8 +697,8 @@ static void znet_rx(struct net_device *dev) | |||
697 | the same area of the backwards links we now have. This allows us to | 697 | the same area of the backwards links we now have. This allows us to |
698 | pass packets to the upper layers in the order they were received -- | 698 | pass packets to the upper layers in the order they were received -- |
699 | important for fast-path sequential operations. */ | 699 | important for fast-path sequential operations. */ |
700 | while (znet->rx_start + cur_frame_end_offset != znet->rx_cur | 700 | while (znet->rx_start + cur_frame_end_offset != znet->rx_cur && |
701 | && ++boguscount < 5) { | 701 | ++boguscount < 5) { |
702 | unsigned short hi_cnt, lo_cnt, hi_status, lo_status; | 702 | unsigned short hi_cnt, lo_cnt, hi_status, lo_status; |
703 | int count, status; | 703 | int count, status; |
704 | 704 | ||