diff options
author | Jiri Kosina <jkosina@suse.cz> | 2011-07-11 08:15:48 -0400 |
---|---|---|
committer | Jiri Kosina <jkosina@suse.cz> | 2011-07-11 08:15:55 -0400 |
commit | b7e9c223be8ce335e30f2cf6ba588e6a4092275c (patch) | |
tree | 2d1e3b75606abc18df7ad65e51ac3f90cd68b38d /drivers/net | |
parent | c172d82500a6cf3c32d1e650722a1055d72ce858 (diff) | |
parent | e3bbfa78bab125f58b831b5f7f45b5a305091d72 (diff) |
Merge branch 'master' into for-next
Sync with Linus' tree to be able to apply pending patches that
are based on newer code already present upstream.
Diffstat (limited to 'drivers/net')
73 files changed, 1017 insertions, 535 deletions
diff --git a/drivers/net/3c503.c b/drivers/net/3c503.c index d84f6e8903a5..5b732988d493 100644 --- a/drivers/net/3c503.c +++ b/drivers/net/3c503.c | |||
@@ -412,7 +412,7 @@ el2_open(struct net_device *dev) | |||
412 | outb_p(0x04 << ((*irqp == 9) ? 2 : *irqp), E33G_IDCFR); | 412 | outb_p(0x04 << ((*irqp == 9) ? 2 : *irqp), E33G_IDCFR); |
413 | outb_p(0x00, E33G_IDCFR); | 413 | outb_p(0x00, E33G_IDCFR); |
414 | msleep(1); | 414 | msleep(1); |
415 | free_irq(*irqp, el2_probe_interrupt); | 415 | free_irq(*irqp, &seen); |
416 | if (!seen) | 416 | if (!seen) |
417 | continue; | 417 | continue; |
418 | 418 | ||
@@ -422,6 +422,7 @@ el2_open(struct net_device *dev) | |||
422 | continue; | 422 | continue; |
423 | if (retval < 0) | 423 | if (retval < 0) |
424 | goto err_disable; | 424 | goto err_disable; |
425 | break; | ||
425 | } while (*++irqp); | 426 | } while (*++irqp); |
426 | 427 | ||
427 | if (*irqp == 0) { | 428 | if (*irqp == 0) { |
diff --git a/drivers/net/8139too.c b/drivers/net/8139too.c index 98517a373473..e3bad8247fd1 100644 --- a/drivers/net/8139too.c +++ b/drivers/net/8139too.c | |||
@@ -992,6 +992,7 @@ static int __devinit rtl8139_init_one (struct pci_dev *pdev, | |||
992 | * features | 992 | * features |
993 | */ | 993 | */ |
994 | dev->features |= NETIF_F_SG | NETIF_F_HW_CSUM | NETIF_F_HIGHDMA; | 994 | dev->features |= NETIF_F_SG | NETIF_F_HW_CSUM | NETIF_F_HIGHDMA; |
995 | dev->vlan_features = dev->features; | ||
995 | 996 | ||
996 | dev->irq = pdev->irq; | 997 | dev->irq = pdev->irq; |
997 | 998 | ||
diff --git a/drivers/net/Kconfig b/drivers/net/Kconfig index 19f04a34783a..93359fab240e 100644 --- a/drivers/net/Kconfig +++ b/drivers/net/Kconfig | |||
@@ -3416,7 +3416,8 @@ config NETCONSOLE | |||
3416 | 3416 | ||
3417 | config NETCONSOLE_DYNAMIC | 3417 | config NETCONSOLE_DYNAMIC |
3418 | bool "Dynamic reconfiguration of logging targets" | 3418 | bool "Dynamic reconfiguration of logging targets" |
3419 | depends on NETCONSOLE && SYSFS && CONFIGFS_FS | 3419 | depends on NETCONSOLE && SYSFS && CONFIGFS_FS && \ |
3420 | !(NETCONSOLE=y && CONFIGFS_FS=m) | ||
3420 | help | 3421 | help |
3421 | This option enables the ability to dynamically reconfigure target | 3422 | This option enables the ability to dynamically reconfigure target |
3422 | parameters (interface, IP addresses, port numbers, MAC addresses) | 3423 | parameters (interface, IP addresses, port numbers, MAC addresses) |
diff --git a/drivers/net/arm/am79c961a.c b/drivers/net/arm/am79c961a.c index 0c9217f48b72..7b3e23f38913 100644 --- a/drivers/net/arm/am79c961a.c +++ b/drivers/net/arm/am79c961a.c | |||
@@ -50,7 +50,7 @@ static const char version[] = | |||
50 | #ifdef __arm__ | 50 | #ifdef __arm__ |
51 | static void write_rreg(u_long base, u_int reg, u_int val) | 51 | static void write_rreg(u_long base, u_int reg, u_int val) |
52 | { | 52 | { |
53 | __asm__( | 53 | asm volatile( |
54 | "str%?h %1, [%2] @ NET_RAP\n\t" | 54 | "str%?h %1, [%2] @ NET_RAP\n\t" |
55 | "str%?h %0, [%2, #-4] @ NET_RDP" | 55 | "str%?h %0, [%2, #-4] @ NET_RDP" |
56 | : | 56 | : |
@@ -60,7 +60,7 @@ static void write_rreg(u_long base, u_int reg, u_int val) | |||
60 | static inline unsigned short read_rreg(u_long base_addr, u_int reg) | 60 | static inline unsigned short read_rreg(u_long base_addr, u_int reg) |
61 | { | 61 | { |
62 | unsigned short v; | 62 | unsigned short v; |
63 | __asm__( | 63 | asm volatile( |
64 | "str%?h %1, [%2] @ NET_RAP\n\t" | 64 | "str%?h %1, [%2] @ NET_RAP\n\t" |
65 | "ldr%?h %0, [%2, #-4] @ NET_RDP" | 65 | "ldr%?h %0, [%2, #-4] @ NET_RDP" |
66 | : "=r" (v) | 66 | : "=r" (v) |
@@ -70,7 +70,7 @@ static inline unsigned short read_rreg(u_long base_addr, u_int reg) | |||
70 | 70 | ||
71 | static inline void write_ireg(u_long base, u_int reg, u_int val) | 71 | static inline void write_ireg(u_long base, u_int reg, u_int val) |
72 | { | 72 | { |
73 | __asm__( | 73 | asm volatile( |
74 | "str%?h %1, [%2] @ NET_RAP\n\t" | 74 | "str%?h %1, [%2] @ NET_RAP\n\t" |
75 | "str%?h %0, [%2, #8] @ NET_IDP" | 75 | "str%?h %0, [%2, #8] @ NET_IDP" |
76 | : | 76 | : |
@@ -80,7 +80,7 @@ static inline void write_ireg(u_long base, u_int reg, u_int val) | |||
80 | static inline unsigned short read_ireg(u_long base_addr, u_int reg) | 80 | static inline unsigned short read_ireg(u_long base_addr, u_int reg) |
81 | { | 81 | { |
82 | u_short v; | 82 | u_short v; |
83 | __asm__( | 83 | asm volatile( |
84 | "str%?h %1, [%2] @ NAT_RAP\n\t" | 84 | "str%?h %1, [%2] @ NAT_RAP\n\t" |
85 | "ldr%?h %0, [%2, #8] @ NET_IDP\n\t" | 85 | "ldr%?h %0, [%2, #8] @ NET_IDP\n\t" |
86 | : "=r" (v) | 86 | : "=r" (v) |
@@ -91,47 +91,48 @@ static inline unsigned short read_ireg(u_long base_addr, u_int reg) | |||
91 | #define am_writeword(dev,off,val) __raw_writew(val, ISAMEM_BASE + ((off) << 1)) | 91 | #define am_writeword(dev,off,val) __raw_writew(val, ISAMEM_BASE + ((off) << 1)) |
92 | #define am_readword(dev,off) __raw_readw(ISAMEM_BASE + ((off) << 1)) | 92 | #define am_readword(dev,off) __raw_readw(ISAMEM_BASE + ((off) << 1)) |
93 | 93 | ||
94 | static inline void | 94 | static void |
95 | am_writebuffer(struct net_device *dev, u_int offset, unsigned char *buf, unsigned int length) | 95 | am_writebuffer(struct net_device *dev, u_int offset, unsigned char *buf, unsigned int length) |
96 | { | 96 | { |
97 | offset = ISAMEM_BASE + (offset << 1); | 97 | offset = ISAMEM_BASE + (offset << 1); |
98 | length = (length + 1) & ~1; | 98 | length = (length + 1) & ~1; |
99 | if ((int)buf & 2) { | 99 | if ((int)buf & 2) { |
100 | __asm__ __volatile__("str%?h %2, [%0], #4" | 100 | asm volatile("str%?h %2, [%0], #4" |
101 | : "=&r" (offset) : "0" (offset), "r" (buf[0] | (buf[1] << 8))); | 101 | : "=&r" (offset) : "0" (offset), "r" (buf[0] | (buf[1] << 8))); |
102 | buf += 2; | 102 | buf += 2; |
103 | length -= 2; | 103 | length -= 2; |
104 | } | 104 | } |
105 | while (length > 8) { | 105 | while (length > 8) { |
106 | unsigned int tmp, tmp2; | 106 | register unsigned int tmp asm("r2"), tmp2 asm("r3"); |
107 | __asm__ __volatile__( | 107 | asm volatile( |
108 | "ldm%?ia %1!, {%2, %3}\n\t" | 108 | "ldm%?ia %0!, {%1, %2}" |
109 | : "+r" (buf), "=&r" (tmp), "=&r" (tmp2)); | ||
110 | length -= 8; | ||
111 | asm volatile( | ||
112 | "str%?h %1, [%0], #4\n\t" | ||
113 | "mov%? %1, %1, lsr #16\n\t" | ||
114 | "str%?h %1, [%0], #4\n\t" | ||
109 | "str%?h %2, [%0], #4\n\t" | 115 | "str%?h %2, [%0], #4\n\t" |
110 | "mov%? %2, %2, lsr #16\n\t" | 116 | "mov%? %2, %2, lsr #16\n\t" |
111 | "str%?h %2, [%0], #4\n\t" | 117 | "str%?h %2, [%0], #4" |
112 | "str%?h %3, [%0], #4\n\t" | 118 | : "+r" (offset), "=&r" (tmp), "=&r" (tmp2)); |
113 | "mov%? %3, %3, lsr #16\n\t" | ||
114 | "str%?h %3, [%0], #4" | ||
115 | : "=&r" (offset), "=&r" (buf), "=r" (tmp), "=r" (tmp2) | ||
116 | : "0" (offset), "1" (buf)); | ||
117 | length -= 8; | ||
118 | } | 119 | } |
119 | while (length > 0) { | 120 | while (length > 0) { |
120 | __asm__ __volatile__("str%?h %2, [%0], #4" | 121 | asm volatile("str%?h %2, [%0], #4" |
121 | : "=&r" (offset) : "0" (offset), "r" (buf[0] | (buf[1] << 8))); | 122 | : "=&r" (offset) : "0" (offset), "r" (buf[0] | (buf[1] << 8))); |
122 | buf += 2; | 123 | buf += 2; |
123 | length -= 2; | 124 | length -= 2; |
124 | } | 125 | } |
125 | } | 126 | } |
126 | 127 | ||
127 | static inline void | 128 | static void |
128 | am_readbuffer(struct net_device *dev, u_int offset, unsigned char *buf, unsigned int length) | 129 | am_readbuffer(struct net_device *dev, u_int offset, unsigned char *buf, unsigned int length) |
129 | { | 130 | { |
130 | offset = ISAMEM_BASE + (offset << 1); | 131 | offset = ISAMEM_BASE + (offset << 1); |
131 | length = (length + 1) & ~1; | 132 | length = (length + 1) & ~1; |
132 | if ((int)buf & 2) { | 133 | if ((int)buf & 2) { |
133 | unsigned int tmp; | 134 | unsigned int tmp; |
134 | __asm__ __volatile__( | 135 | asm volatile( |
135 | "ldr%?h %2, [%0], #4\n\t" | 136 | "ldr%?h %2, [%0], #4\n\t" |
136 | "str%?b %2, [%1], #1\n\t" | 137 | "str%?b %2, [%1], #1\n\t" |
137 | "mov%? %2, %2, lsr #8\n\t" | 138 | "mov%? %2, %2, lsr #8\n\t" |
@@ -140,12 +141,12 @@ am_readbuffer(struct net_device *dev, u_int offset, unsigned char *buf, unsigned | |||
140 | length -= 2; | 141 | length -= 2; |
141 | } | 142 | } |
142 | while (length > 8) { | 143 | while (length > 8) { |
143 | unsigned int tmp, tmp2, tmp3; | 144 | register unsigned int tmp asm("r2"), tmp2 asm("r3"), tmp3; |
144 | __asm__ __volatile__( | 145 | asm volatile( |
145 | "ldr%?h %2, [%0], #4\n\t" | 146 | "ldr%?h %2, [%0], #4\n\t" |
147 | "ldr%?h %4, [%0], #4\n\t" | ||
146 | "ldr%?h %3, [%0], #4\n\t" | 148 | "ldr%?h %3, [%0], #4\n\t" |
147 | "orr%? %2, %2, %3, lsl #16\n\t" | 149 | "orr%? %2, %2, %4, lsl #16\n\t" |
148 | "ldr%?h %3, [%0], #4\n\t" | ||
149 | "ldr%?h %4, [%0], #4\n\t" | 150 | "ldr%?h %4, [%0], #4\n\t" |
150 | "orr%? %3, %3, %4, lsl #16\n\t" | 151 | "orr%? %3, %3, %4, lsl #16\n\t" |
151 | "stm%?ia %1!, {%2, %3}" | 152 | "stm%?ia %1!, {%2, %3}" |
@@ -155,7 +156,7 @@ am_readbuffer(struct net_device *dev, u_int offset, unsigned char *buf, unsigned | |||
155 | } | 156 | } |
156 | while (length > 0) { | 157 | while (length > 0) { |
157 | unsigned int tmp; | 158 | unsigned int tmp; |
158 | __asm__ __volatile__( | 159 | asm volatile( |
159 | "ldr%?h %2, [%0], #4\n\t" | 160 | "ldr%?h %2, [%0], #4\n\t" |
160 | "str%?b %2, [%1], #1\n\t" | 161 | "str%?b %2, [%1], #1\n\t" |
161 | "mov%? %2, %2, lsr #8\n\t" | 162 | "mov%? %2, %2, lsr #8\n\t" |
@@ -196,6 +197,42 @@ am79c961_ramtest(struct net_device *dev, unsigned int val) | |||
196 | return errorcount; | 197 | return errorcount; |
197 | } | 198 | } |
198 | 199 | ||
200 | static void am79c961_mc_hash(char *addr, u16 *hash) | ||
201 | { | ||
202 | if (addr[0] & 0x01) { | ||
203 | int idx, bit; | ||
204 | u32 crc; | ||
205 | |||
206 | crc = ether_crc_le(ETH_ALEN, addr); | ||
207 | |||
208 | idx = crc >> 30; | ||
209 | bit = (crc >> 26) & 15; | ||
210 | |||
211 | hash[idx] |= 1 << bit; | ||
212 | } | ||
213 | } | ||
214 | |||
215 | static unsigned int am79c961_get_rx_mode(struct net_device *dev, u16 *hash) | ||
216 | { | ||
217 | unsigned int mode = MODE_PORT_10BT; | ||
218 | |||
219 | if (dev->flags & IFF_PROMISC) { | ||
220 | mode |= MODE_PROMISC; | ||
221 | memset(hash, 0xff, 4 * sizeof(*hash)); | ||
222 | } else if (dev->flags & IFF_ALLMULTI) { | ||
223 | memset(hash, 0xff, 4 * sizeof(*hash)); | ||
224 | } else { | ||
225 | struct netdev_hw_addr *ha; | ||
226 | |||
227 | memset(hash, 0, 4 * sizeof(*hash)); | ||
228 | |||
229 | netdev_for_each_mc_addr(ha, dev) | ||
230 | am79c961_mc_hash(ha->addr, hash); | ||
231 | } | ||
232 | |||
233 | return mode; | ||
234 | } | ||
235 | |||
199 | static void | 236 | static void |
200 | am79c961_init_for_open(struct net_device *dev) | 237 | am79c961_init_for_open(struct net_device *dev) |
201 | { | 238 | { |
@@ -203,6 +240,7 @@ am79c961_init_for_open(struct net_device *dev) | |||
203 | unsigned long flags; | 240 | unsigned long flags; |
204 | unsigned char *p; | 241 | unsigned char *p; |
205 | u_int hdr_addr, first_free_addr; | 242 | u_int hdr_addr, first_free_addr; |
243 | u16 multi_hash[4], mode = am79c961_get_rx_mode(dev, multi_hash); | ||
206 | int i; | 244 | int i; |
207 | 245 | ||
208 | /* | 246 | /* |
@@ -218,16 +256,12 @@ am79c961_init_for_open(struct net_device *dev) | |||
218 | write_ireg (dev->base_addr, 2, 0x0000); /* MODE register selects media */ | 256 | write_ireg (dev->base_addr, 2, 0x0000); /* MODE register selects media */ |
219 | 257 | ||
220 | for (i = LADRL; i <= LADRH; i++) | 258 | for (i = LADRL; i <= LADRH; i++) |
221 | write_rreg (dev->base_addr, i, 0); | 259 | write_rreg (dev->base_addr, i, multi_hash[i - LADRL]); |
222 | 260 | ||
223 | for (i = PADRL, p = dev->dev_addr; i <= PADRH; i++, p += 2) | 261 | for (i = PADRL, p = dev->dev_addr; i <= PADRH; i++, p += 2) |
224 | write_rreg (dev->base_addr, i, p[0] | (p[1] << 8)); | 262 | write_rreg (dev->base_addr, i, p[0] | (p[1] << 8)); |
225 | 263 | ||
226 | i = MODE_PORT_10BT; | 264 | write_rreg (dev->base_addr, MODE, mode); |
227 | if (dev->flags & IFF_PROMISC) | ||
228 | i |= MODE_PROMISC; | ||
229 | |||
230 | write_rreg (dev->base_addr, MODE, i); | ||
231 | write_rreg (dev->base_addr, POLLINT, 0); | 265 | write_rreg (dev->base_addr, POLLINT, 0); |
232 | write_rreg (dev->base_addr, SIZERXR, -RX_BUFFERS); | 266 | write_rreg (dev->base_addr, SIZERXR, -RX_BUFFERS); |
233 | write_rreg (dev->base_addr, SIZETXR, -TX_BUFFERS); | 267 | write_rreg (dev->base_addr, SIZETXR, -TX_BUFFERS); |
@@ -340,21 +374,6 @@ am79c961_close(struct net_device *dev) | |||
340 | return 0; | 374 | return 0; |
341 | } | 375 | } |
342 | 376 | ||
343 | static void am79c961_mc_hash(char *addr, unsigned short *hash) | ||
344 | { | ||
345 | if (addr[0] & 0x01) { | ||
346 | int idx, bit; | ||
347 | u32 crc; | ||
348 | |||
349 | crc = ether_crc_le(ETH_ALEN, addr); | ||
350 | |||
351 | idx = crc >> 30; | ||
352 | bit = (crc >> 26) & 15; | ||
353 | |||
354 | hash[idx] |= 1 << bit; | ||
355 | } | ||
356 | } | ||
357 | |||
358 | /* | 377 | /* |
359 | * Set or clear promiscuous/multicast mode filter for this adapter. | 378 | * Set or clear promiscuous/multicast mode filter for this adapter. |
360 | */ | 379 | */ |
@@ -362,24 +381,9 @@ static void am79c961_setmulticastlist (struct net_device *dev) | |||
362 | { | 381 | { |
363 | struct dev_priv *priv = netdev_priv(dev); | 382 | struct dev_priv *priv = netdev_priv(dev); |
364 | unsigned long flags; | 383 | unsigned long flags; |
365 | unsigned short multi_hash[4], mode; | 384 | u16 multi_hash[4], mode = am79c961_get_rx_mode(dev, multi_hash); |
366 | int i, stopped; | 385 | int i, stopped; |
367 | 386 | ||
368 | mode = MODE_PORT_10BT; | ||
369 | |||
370 | if (dev->flags & IFF_PROMISC) { | ||
371 | mode |= MODE_PROMISC; | ||
372 | } else if (dev->flags & IFF_ALLMULTI) { | ||
373 | memset(multi_hash, 0xff, sizeof(multi_hash)); | ||
374 | } else { | ||
375 | struct netdev_hw_addr *ha; | ||
376 | |||
377 | memset(multi_hash, 0x00, sizeof(multi_hash)); | ||
378 | |||
379 | netdev_for_each_mc_addr(ha, dev) | ||
380 | am79c961_mc_hash(ha->addr, multi_hash); | ||
381 | } | ||
382 | |||
383 | spin_lock_irqsave(&priv->chip_lock, flags); | 387 | spin_lock_irqsave(&priv->chip_lock, flags); |
384 | 388 | ||
385 | stopped = read_rreg(dev->base_addr, CSR0) & CSR0_STOP; | 389 | stopped = read_rreg(dev->base_addr, CSR0) & CSR0_STOP; |
diff --git a/drivers/net/arm/ep93xx_eth.c b/drivers/net/arm/ep93xx_eth.c index 5a77001b6d10..0b46b8ea0e80 100644 --- a/drivers/net/arm/ep93xx_eth.c +++ b/drivers/net/arm/ep93xx_eth.c | |||
@@ -283,10 +283,14 @@ static int ep93xx_rx(struct net_device *dev, int processed, int budget) | |||
283 | 283 | ||
284 | skb = dev_alloc_skb(length + 2); | 284 | skb = dev_alloc_skb(length + 2); |
285 | if (likely(skb != NULL)) { | 285 | if (likely(skb != NULL)) { |
286 | struct ep93xx_rdesc *rxd = &ep->descs->rdesc[entry]; | ||
286 | skb_reserve(skb, 2); | 287 | skb_reserve(skb, 2); |
287 | dma_sync_single_for_cpu(NULL, ep->descs->rdesc[entry].buf_addr, | 288 | dma_sync_single_for_cpu(dev->dev.parent, rxd->buf_addr, |
288 | length, DMA_FROM_DEVICE); | 289 | length, DMA_FROM_DEVICE); |
289 | skb_copy_to_linear_data(skb, ep->rx_buf[entry], length); | 290 | skb_copy_to_linear_data(skb, ep->rx_buf[entry], length); |
291 | dma_sync_single_for_device(dev->dev.parent, | ||
292 | rxd->buf_addr, length, | ||
293 | DMA_FROM_DEVICE); | ||
290 | skb_put(skb, length); | 294 | skb_put(skb, length); |
291 | skb->protocol = eth_type_trans(skb, dev); | 295 | skb->protocol = eth_type_trans(skb, dev); |
292 | 296 | ||
@@ -348,6 +352,7 @@ poll_some_more: | |||
348 | static int ep93xx_xmit(struct sk_buff *skb, struct net_device *dev) | 352 | static int ep93xx_xmit(struct sk_buff *skb, struct net_device *dev) |
349 | { | 353 | { |
350 | struct ep93xx_priv *ep = netdev_priv(dev); | 354 | struct ep93xx_priv *ep = netdev_priv(dev); |
355 | struct ep93xx_tdesc *txd; | ||
351 | int entry; | 356 | int entry; |
352 | 357 | ||
353 | if (unlikely(skb->len > MAX_PKT_SIZE)) { | 358 | if (unlikely(skb->len > MAX_PKT_SIZE)) { |
@@ -359,11 +364,14 @@ static int ep93xx_xmit(struct sk_buff *skb, struct net_device *dev) | |||
359 | entry = ep->tx_pointer; | 364 | entry = ep->tx_pointer; |
360 | ep->tx_pointer = (ep->tx_pointer + 1) & (TX_QUEUE_ENTRIES - 1); | 365 | ep->tx_pointer = (ep->tx_pointer + 1) & (TX_QUEUE_ENTRIES - 1); |
361 | 366 | ||
362 | ep->descs->tdesc[entry].tdesc1 = | 367 | txd = &ep->descs->tdesc[entry]; |
363 | TDESC1_EOF | (entry << 16) | (skb->len & 0xfff); | 368 | |
369 | txd->tdesc1 = TDESC1_EOF | (entry << 16) | (skb->len & 0xfff); | ||
370 | dma_sync_single_for_cpu(dev->dev.parent, txd->buf_addr, skb->len, | ||
371 | DMA_TO_DEVICE); | ||
364 | skb_copy_and_csum_dev(skb, ep->tx_buf[entry]); | 372 | skb_copy_and_csum_dev(skb, ep->tx_buf[entry]); |
365 | dma_sync_single_for_cpu(NULL, ep->descs->tdesc[entry].buf_addr, | 373 | dma_sync_single_for_device(dev->dev.parent, txd->buf_addr, skb->len, |
366 | skb->len, DMA_TO_DEVICE); | 374 | DMA_TO_DEVICE); |
367 | dev_kfree_skb(skb); | 375 | dev_kfree_skb(skb); |
368 | 376 | ||
369 | spin_lock_irq(&ep->tx_pending_lock); | 377 | spin_lock_irq(&ep->tx_pending_lock); |
@@ -457,89 +465,80 @@ static irqreturn_t ep93xx_irq(int irq, void *dev_id) | |||
457 | 465 | ||
458 | static void ep93xx_free_buffers(struct ep93xx_priv *ep) | 466 | static void ep93xx_free_buffers(struct ep93xx_priv *ep) |
459 | { | 467 | { |
468 | struct device *dev = ep->dev->dev.parent; | ||
460 | int i; | 469 | int i; |
461 | 470 | ||
462 | for (i = 0; i < RX_QUEUE_ENTRIES; i += 2) { | 471 | for (i = 0; i < RX_QUEUE_ENTRIES; i++) { |
463 | dma_addr_t d; | 472 | dma_addr_t d; |
464 | 473 | ||
465 | d = ep->descs->rdesc[i].buf_addr; | 474 | d = ep->descs->rdesc[i].buf_addr; |
466 | if (d) | 475 | if (d) |
467 | dma_unmap_single(NULL, d, PAGE_SIZE, DMA_FROM_DEVICE); | 476 | dma_unmap_single(dev, d, PKT_BUF_SIZE, DMA_FROM_DEVICE); |
468 | 477 | ||
469 | if (ep->rx_buf[i] != NULL) | 478 | if (ep->rx_buf[i] != NULL) |
470 | free_page((unsigned long)ep->rx_buf[i]); | 479 | kfree(ep->rx_buf[i]); |
471 | } | 480 | } |
472 | 481 | ||
473 | for (i = 0; i < TX_QUEUE_ENTRIES; i += 2) { | 482 | for (i = 0; i < TX_QUEUE_ENTRIES; i++) { |
474 | dma_addr_t d; | 483 | dma_addr_t d; |
475 | 484 | ||
476 | d = ep->descs->tdesc[i].buf_addr; | 485 | d = ep->descs->tdesc[i].buf_addr; |
477 | if (d) | 486 | if (d) |
478 | dma_unmap_single(NULL, d, PAGE_SIZE, DMA_TO_DEVICE); | 487 | dma_unmap_single(dev, d, PKT_BUF_SIZE, DMA_TO_DEVICE); |
479 | 488 | ||
480 | if (ep->tx_buf[i] != NULL) | 489 | if (ep->tx_buf[i] != NULL) |
481 | free_page((unsigned long)ep->tx_buf[i]); | 490 | kfree(ep->tx_buf[i]); |
482 | } | 491 | } |
483 | 492 | ||
484 | dma_free_coherent(NULL, sizeof(struct ep93xx_descs), ep->descs, | 493 | dma_free_coherent(dev, sizeof(struct ep93xx_descs), ep->descs, |
485 | ep->descs_dma_addr); | 494 | ep->descs_dma_addr); |
486 | } | 495 | } |
487 | 496 | ||
488 | /* | ||
489 | * The hardware enforces a sub-2K maximum packet size, so we put | ||
490 | * two buffers on every hardware page. | ||
491 | */ | ||
492 | static int ep93xx_alloc_buffers(struct ep93xx_priv *ep) | 497 | static int ep93xx_alloc_buffers(struct ep93xx_priv *ep) |
493 | { | 498 | { |
499 | struct device *dev = ep->dev->dev.parent; | ||
494 | int i; | 500 | int i; |
495 | 501 | ||
496 | ep->descs = dma_alloc_coherent(NULL, sizeof(struct ep93xx_descs), | 502 | ep->descs = dma_alloc_coherent(dev, sizeof(struct ep93xx_descs), |
497 | &ep->descs_dma_addr, GFP_KERNEL | GFP_DMA); | 503 | &ep->descs_dma_addr, GFP_KERNEL); |
498 | if (ep->descs == NULL) | 504 | if (ep->descs == NULL) |
499 | return 1; | 505 | return 1; |
500 | 506 | ||
501 | for (i = 0; i < RX_QUEUE_ENTRIES; i += 2) { | 507 | for (i = 0; i < RX_QUEUE_ENTRIES; i++) { |
502 | void *page; | 508 | void *buf; |
503 | dma_addr_t d; | 509 | dma_addr_t d; |
504 | 510 | ||
505 | page = (void *)__get_free_page(GFP_KERNEL | GFP_DMA); | 511 | buf = kmalloc(PKT_BUF_SIZE, GFP_KERNEL); |
506 | if (page == NULL) | 512 | if (buf == NULL) |
507 | goto err; | 513 | goto err; |
508 | 514 | ||
509 | d = dma_map_single(NULL, page, PAGE_SIZE, DMA_FROM_DEVICE); | 515 | d = dma_map_single(dev, buf, PKT_BUF_SIZE, DMA_FROM_DEVICE); |
510 | if (dma_mapping_error(NULL, d)) { | 516 | if (dma_mapping_error(dev, d)) { |
511 | free_page((unsigned long)page); | 517 | kfree(buf); |
512 | goto err; | 518 | goto err; |
513 | } | 519 | } |
514 | 520 | ||
515 | ep->rx_buf[i] = page; | 521 | ep->rx_buf[i] = buf; |
516 | ep->descs->rdesc[i].buf_addr = d; | 522 | ep->descs->rdesc[i].buf_addr = d; |
517 | ep->descs->rdesc[i].rdesc1 = (i << 16) | PKT_BUF_SIZE; | 523 | ep->descs->rdesc[i].rdesc1 = (i << 16) | PKT_BUF_SIZE; |
518 | |||
519 | ep->rx_buf[i + 1] = page + PKT_BUF_SIZE; | ||
520 | ep->descs->rdesc[i + 1].buf_addr = d + PKT_BUF_SIZE; | ||
521 | ep->descs->rdesc[i + 1].rdesc1 = ((i + 1) << 16) | PKT_BUF_SIZE; | ||
522 | } | 524 | } |
523 | 525 | ||
524 | for (i = 0; i < TX_QUEUE_ENTRIES; i += 2) { | 526 | for (i = 0; i < TX_QUEUE_ENTRIES; i++) { |
525 | void *page; | 527 | void *buf; |
526 | dma_addr_t d; | 528 | dma_addr_t d; |
527 | 529 | ||
528 | page = (void *)__get_free_page(GFP_KERNEL | GFP_DMA); | 530 | buf = kmalloc(PKT_BUF_SIZE, GFP_KERNEL); |
529 | if (page == NULL) | 531 | if (buf == NULL) |
530 | goto err; | 532 | goto err; |
531 | 533 | ||
532 | d = dma_map_single(NULL, page, PAGE_SIZE, DMA_TO_DEVICE); | 534 | d = dma_map_single(dev, buf, PKT_BUF_SIZE, DMA_TO_DEVICE); |
533 | if (dma_mapping_error(NULL, d)) { | 535 | if (dma_mapping_error(dev, d)) { |
534 | free_page((unsigned long)page); | 536 | kfree(buf); |
535 | goto err; | 537 | goto err; |
536 | } | 538 | } |
537 | 539 | ||
538 | ep->tx_buf[i] = page; | 540 | ep->tx_buf[i] = buf; |
539 | ep->descs->tdesc[i].buf_addr = d; | 541 | ep->descs->tdesc[i].buf_addr = d; |
540 | |||
541 | ep->tx_buf[i + 1] = page + PKT_BUF_SIZE; | ||
542 | ep->descs->tdesc[i + 1].buf_addr = d + PKT_BUF_SIZE; | ||
543 | } | 542 | } |
544 | 543 | ||
545 | return 0; | 544 | return 0; |
@@ -829,6 +828,7 @@ static int ep93xx_eth_probe(struct platform_device *pdev) | |||
829 | } | 828 | } |
830 | ep = netdev_priv(dev); | 829 | ep = netdev_priv(dev); |
831 | ep->dev = dev; | 830 | ep->dev = dev; |
831 | SET_NETDEV_DEV(dev, &pdev->dev); | ||
832 | netif_napi_add(dev, &ep->napi, ep93xx_poll, 64); | 832 | netif_napi_add(dev, &ep->napi, ep93xx_poll, 64); |
833 | 833 | ||
834 | platform_set_drvdata(pdev, dev); | 834 | platform_set_drvdata(pdev, dev); |
diff --git a/drivers/net/bfin_mac.c b/drivers/net/bfin_mac.c index 68d45ba2d9b9..6c019e148546 100644 --- a/drivers/net/bfin_mac.c +++ b/drivers/net/bfin_mac.c | |||
@@ -52,13 +52,13 @@ MODULE_DESCRIPTION(DRV_DESC); | |||
52 | MODULE_ALIAS("platform:bfin_mac"); | 52 | MODULE_ALIAS("platform:bfin_mac"); |
53 | 53 | ||
54 | #if defined(CONFIG_BFIN_MAC_USE_L1) | 54 | #if defined(CONFIG_BFIN_MAC_USE_L1) |
55 | # define bfin_mac_alloc(dma_handle, size) l1_data_sram_zalloc(size) | 55 | # define bfin_mac_alloc(dma_handle, size, num) l1_data_sram_zalloc(size*num) |
56 | # define bfin_mac_free(dma_handle, ptr) l1_data_sram_free(ptr) | 56 | # define bfin_mac_free(dma_handle, ptr, num) l1_data_sram_free(ptr) |
57 | #else | 57 | #else |
58 | # define bfin_mac_alloc(dma_handle, size) \ | 58 | # define bfin_mac_alloc(dma_handle, size, num) \ |
59 | dma_alloc_coherent(NULL, size, dma_handle, GFP_KERNEL) | 59 | dma_alloc_coherent(NULL, size*num, dma_handle, GFP_KERNEL) |
60 | # define bfin_mac_free(dma_handle, ptr) \ | 60 | # define bfin_mac_free(dma_handle, ptr, num) \ |
61 | dma_free_coherent(NULL, sizeof(*ptr), ptr, dma_handle) | 61 | dma_free_coherent(NULL, sizeof(*ptr)*num, ptr, dma_handle) |
62 | #endif | 62 | #endif |
63 | 63 | ||
64 | #define PKT_BUF_SZ 1580 | 64 | #define PKT_BUF_SZ 1580 |
@@ -95,7 +95,7 @@ static void desc_list_free(void) | |||
95 | t = t->next; | 95 | t = t->next; |
96 | } | 96 | } |
97 | } | 97 | } |
98 | bfin_mac_free(dma_handle, tx_desc); | 98 | bfin_mac_free(dma_handle, tx_desc, CONFIG_BFIN_TX_DESC_NUM); |
99 | } | 99 | } |
100 | 100 | ||
101 | if (rx_desc) { | 101 | if (rx_desc) { |
@@ -109,7 +109,7 @@ static void desc_list_free(void) | |||
109 | r = r->next; | 109 | r = r->next; |
110 | } | 110 | } |
111 | } | 111 | } |
112 | bfin_mac_free(dma_handle, rx_desc); | 112 | bfin_mac_free(dma_handle, rx_desc, CONFIG_BFIN_RX_DESC_NUM); |
113 | } | 113 | } |
114 | } | 114 | } |
115 | 115 | ||
@@ -126,13 +126,13 @@ static int desc_list_init(void) | |||
126 | #endif | 126 | #endif |
127 | 127 | ||
128 | tx_desc = bfin_mac_alloc(&dma_handle, | 128 | tx_desc = bfin_mac_alloc(&dma_handle, |
129 | sizeof(struct net_dma_desc_tx) * | 129 | sizeof(struct net_dma_desc_tx), |
130 | CONFIG_BFIN_TX_DESC_NUM); | 130 | CONFIG_BFIN_TX_DESC_NUM); |
131 | if (tx_desc == NULL) | 131 | if (tx_desc == NULL) |
132 | goto init_error; | 132 | goto init_error; |
133 | 133 | ||
134 | rx_desc = bfin_mac_alloc(&dma_handle, | 134 | rx_desc = bfin_mac_alloc(&dma_handle, |
135 | sizeof(struct net_dma_desc_rx) * | 135 | sizeof(struct net_dma_desc_rx), |
136 | CONFIG_BFIN_RX_DESC_NUM); | 136 | CONFIG_BFIN_RX_DESC_NUM); |
137 | if (rx_desc == NULL) | 137 | if (rx_desc == NULL) |
138 | goto init_error; | 138 | goto init_error; |
diff --git a/drivers/net/bna/bnad.c b/drivers/net/bna/bnad.c index 7d25a97d33f6..44e219c910da 100644 --- a/drivers/net/bna/bnad.c +++ b/drivers/net/bna/bnad.c | |||
@@ -1111,7 +1111,7 @@ bnad_mbox_irq_alloc(struct bnad *bnad, | |||
1111 | struct bna_intr_info *intr_info) | 1111 | struct bna_intr_info *intr_info) |
1112 | { | 1112 | { |
1113 | int err = 0; | 1113 | int err = 0; |
1114 | unsigned long flags; | 1114 | unsigned long irq_flags = 0, flags; |
1115 | u32 irq; | 1115 | u32 irq; |
1116 | irq_handler_t irq_handler; | 1116 | irq_handler_t irq_handler; |
1117 | 1117 | ||
@@ -1125,18 +1125,17 @@ bnad_mbox_irq_alloc(struct bnad *bnad, | |||
1125 | if (bnad->cfg_flags & BNAD_CF_MSIX) { | 1125 | if (bnad->cfg_flags & BNAD_CF_MSIX) { |
1126 | irq_handler = (irq_handler_t)bnad_msix_mbox_handler; | 1126 | irq_handler = (irq_handler_t)bnad_msix_mbox_handler; |
1127 | irq = bnad->msix_table[bnad->msix_num - 1].vector; | 1127 | irq = bnad->msix_table[bnad->msix_num - 1].vector; |
1128 | flags = 0; | ||
1129 | intr_info->intr_type = BNA_INTR_T_MSIX; | 1128 | intr_info->intr_type = BNA_INTR_T_MSIX; |
1130 | intr_info->idl[0].vector = bnad->msix_num - 1; | 1129 | intr_info->idl[0].vector = bnad->msix_num - 1; |
1131 | } else { | 1130 | } else { |
1132 | irq_handler = (irq_handler_t)bnad_isr; | 1131 | irq_handler = (irq_handler_t)bnad_isr; |
1133 | irq = bnad->pcidev->irq; | 1132 | irq = bnad->pcidev->irq; |
1134 | flags = IRQF_SHARED; | 1133 | irq_flags = IRQF_SHARED; |
1135 | intr_info->intr_type = BNA_INTR_T_INTX; | 1134 | intr_info->intr_type = BNA_INTR_T_INTX; |
1136 | /* intr_info->idl.vector = 0 ? */ | 1135 | /* intr_info->idl.vector = 0 ? */ |
1137 | } | 1136 | } |
1138 | spin_unlock_irqrestore(&bnad->bna_lock, flags); | 1137 | spin_unlock_irqrestore(&bnad->bna_lock, flags); |
1139 | 1138 | flags = irq_flags; | |
1140 | sprintf(bnad->mbox_irq_name, "%s", BNAD_NAME); | 1139 | sprintf(bnad->mbox_irq_name, "%s", BNAD_NAME); |
1141 | 1140 | ||
1142 | /* | 1141 | /* |
diff --git a/drivers/net/bnx2x/bnx2x_main.c b/drivers/net/bnx2x/bnx2x_main.c index 4b70311a11ef..74be989f51c5 100644 --- a/drivers/net/bnx2x/bnx2x_main.c +++ b/drivers/net/bnx2x/bnx2x_main.c | |||
@@ -49,6 +49,7 @@ | |||
49 | #include <linux/zlib.h> | 49 | #include <linux/zlib.h> |
50 | #include <linux/io.h> | 50 | #include <linux/io.h> |
51 | #include <linux/stringify.h> | 51 | #include <linux/stringify.h> |
52 | #include <linux/vmalloc.h> | ||
52 | 53 | ||
53 | #define BNX2X_MAIN | 54 | #define BNX2X_MAIN |
54 | #include "bnx2x.h" | 55 | #include "bnx2x.h" |
@@ -4537,8 +4538,7 @@ static int bnx2x_gunzip_init(struct bnx2x *bp) | |||
4537 | if (bp->strm == NULL) | 4538 | if (bp->strm == NULL) |
4538 | goto gunzip_nomem2; | 4539 | goto gunzip_nomem2; |
4539 | 4540 | ||
4540 | bp->strm->workspace = kmalloc(zlib_inflate_workspacesize(), | 4541 | bp->strm->workspace = vmalloc(zlib_inflate_workspacesize()); |
4541 | GFP_KERNEL); | ||
4542 | if (bp->strm->workspace == NULL) | 4542 | if (bp->strm->workspace == NULL) |
4543 | goto gunzip_nomem3; | 4543 | goto gunzip_nomem3; |
4544 | 4544 | ||
@@ -4562,7 +4562,7 @@ gunzip_nomem1: | |||
4562 | static void bnx2x_gunzip_end(struct bnx2x *bp) | 4562 | static void bnx2x_gunzip_end(struct bnx2x *bp) |
4563 | { | 4563 | { |
4564 | if (bp->strm) { | 4564 | if (bp->strm) { |
4565 | kfree(bp->strm->workspace); | 4565 | vfree(bp->strm->workspace); |
4566 | kfree(bp->strm); | 4566 | kfree(bp->strm); |
4567 | bp->strm = NULL; | 4567 | bp->strm = NULL; |
4568 | } | 4568 | } |
diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c index 17b4dd94da90..eafe44a528ac 100644 --- a/drivers/net/bonding/bond_main.c +++ b/drivers/net/bonding/bond_main.c | |||
@@ -388,6 +388,8 @@ struct vlan_entry *bond_next_vlan(struct bonding *bond, struct vlan_entry *curr) | |||
388 | return next; | 388 | return next; |
389 | } | 389 | } |
390 | 390 | ||
391 | #define bond_queue_mapping(skb) (*(u16 *)((skb)->cb)) | ||
392 | |||
391 | /** | 393 | /** |
392 | * bond_dev_queue_xmit - Prepare skb for xmit. | 394 | * bond_dev_queue_xmit - Prepare skb for xmit. |
393 | * | 395 | * |
@@ -400,6 +402,9 @@ int bond_dev_queue_xmit(struct bonding *bond, struct sk_buff *skb, | |||
400 | { | 402 | { |
401 | skb->dev = slave_dev; | 403 | skb->dev = slave_dev; |
402 | skb->priority = 1; | 404 | skb->priority = 1; |
405 | |||
406 | skb->queue_mapping = bond_queue_mapping(skb); | ||
407 | |||
403 | if (unlikely(netpoll_tx_running(slave_dev))) | 408 | if (unlikely(netpoll_tx_running(slave_dev))) |
404 | bond_netpoll_send_skb(bond_get_slave_by_dev(bond, slave_dev), skb); | 409 | bond_netpoll_send_skb(bond_get_slave_by_dev(bond, slave_dev), skb); |
405 | else | 410 | else |
@@ -1292,6 +1297,7 @@ static inline int slave_enable_netpoll(struct slave *slave) | |||
1292 | goto out; | 1297 | goto out; |
1293 | 1298 | ||
1294 | np->dev = slave->dev; | 1299 | np->dev = slave->dev; |
1300 | strlcpy(np->dev_name, slave->dev->name, IFNAMSIZ); | ||
1295 | err = __netpoll_setup(np); | 1301 | err = __netpoll_setup(np); |
1296 | if (err) { | 1302 | if (err) { |
1297 | kfree(np); | 1303 | kfree(np); |
@@ -4206,6 +4212,7 @@ static inline int bond_slave_override(struct bonding *bond, | |||
4206 | return res; | 4212 | return res; |
4207 | } | 4213 | } |
4208 | 4214 | ||
4215 | |||
4209 | static u16 bond_select_queue(struct net_device *dev, struct sk_buff *skb) | 4216 | static u16 bond_select_queue(struct net_device *dev, struct sk_buff *skb) |
4210 | { | 4217 | { |
4211 | /* | 4218 | /* |
@@ -4216,6 +4223,11 @@ static u16 bond_select_queue(struct net_device *dev, struct sk_buff *skb) | |||
4216 | */ | 4223 | */ |
4217 | u16 txq = skb_rx_queue_recorded(skb) ? skb_get_rx_queue(skb) : 0; | 4224 | u16 txq = skb_rx_queue_recorded(skb) ? skb_get_rx_queue(skb) : 0; |
4218 | 4225 | ||
4226 | /* | ||
4227 | * Save the original txq to restore before passing to the driver | ||
4228 | */ | ||
4229 | bond_queue_mapping(skb) = skb->queue_mapping; | ||
4230 | |||
4219 | if (unlikely(txq >= dev->real_num_tx_queues)) { | 4231 | if (unlikely(txq >= dev->real_num_tx_queues)) { |
4220 | do { | 4232 | do { |
4221 | txq -= dev->real_num_tx_queues; | 4233 | txq -= dev->real_num_tx_queues; |
diff --git a/drivers/net/can/Kconfig b/drivers/net/can/Kconfig index 1d699e3df547..754df5ef1729 100644 --- a/drivers/net/can/Kconfig +++ b/drivers/net/can/Kconfig | |||
@@ -36,7 +36,7 @@ config CAN_SLCAN | |||
36 | config CAN_DEV | 36 | config CAN_DEV |
37 | tristate "Platform CAN drivers with Netlink support" | 37 | tristate "Platform CAN drivers with Netlink support" |
38 | depends on CAN | 38 | depends on CAN |
39 | default Y | 39 | default y |
40 | ---help--- | 40 | ---help--- |
41 | Enables the common framework for platform CAN drivers with Netlink | 41 | Enables the common framework for platform CAN drivers with Netlink |
42 | support. This is the standard library for CAN drivers. | 42 | support. This is the standard library for CAN drivers. |
@@ -45,7 +45,7 @@ config CAN_DEV | |||
45 | config CAN_CALC_BITTIMING | 45 | config CAN_CALC_BITTIMING |
46 | bool "CAN bit-timing calculation" | 46 | bool "CAN bit-timing calculation" |
47 | depends on CAN_DEV | 47 | depends on CAN_DEV |
48 | default Y | 48 | default y |
49 | ---help--- | 49 | ---help--- |
50 | If enabled, CAN bit-timing parameters will be calculated for the | 50 | If enabled, CAN bit-timing parameters will be calculated for the |
51 | bit-rate specified via Netlink argument "bitrate" when the device | 51 | bit-rate specified via Netlink argument "bitrate" when the device |
diff --git a/drivers/net/cxgb3/sge.c b/drivers/net/cxgb3/sge.c index 3f562ba2f0c9..76bf5892b962 100644 --- a/drivers/net/cxgb3/sge.c +++ b/drivers/net/cxgb3/sge.c | |||
@@ -2026,7 +2026,7 @@ static void rx_eth(struct adapter *adap, struct sge_rspq *rq, | |||
2026 | skb->ip_summed = CHECKSUM_UNNECESSARY; | 2026 | skb->ip_summed = CHECKSUM_UNNECESSARY; |
2027 | } else | 2027 | } else |
2028 | skb_checksum_none_assert(skb); | 2028 | skb_checksum_none_assert(skb); |
2029 | skb_record_rx_queue(skb, qs - &adap->sge.qs[0]); | 2029 | skb_record_rx_queue(skb, qs - &adap->sge.qs[pi->first_qset]); |
2030 | 2030 | ||
2031 | if (unlikely(p->vlan_valid)) { | 2031 | if (unlikely(p->vlan_valid)) { |
2032 | struct vlan_group *grp = pi->vlan_grp; | 2032 | struct vlan_group *grp = pi->vlan_grp; |
@@ -2145,7 +2145,7 @@ static void lro_add_page(struct adapter *adap, struct sge_qset *qs, | |||
2145 | if (!complete) | 2145 | if (!complete) |
2146 | return; | 2146 | return; |
2147 | 2147 | ||
2148 | skb_record_rx_queue(skb, qs - &adap->sge.qs[0]); | 2148 | skb_record_rx_queue(skb, qs - &adap->sge.qs[pi->first_qset]); |
2149 | 2149 | ||
2150 | if (unlikely(cpl->vlan_valid)) { | 2150 | if (unlikely(cpl->vlan_valid)) { |
2151 | struct vlan_group *grp = pi->vlan_grp; | 2151 | struct vlan_group *grp = pi->vlan_grp; |
diff --git a/drivers/net/dl2k.c b/drivers/net/dl2k.c index c445457b66d5..23179dbcedd2 100644 --- a/drivers/net/dl2k.c +++ b/drivers/net/dl2k.c | |||
@@ -346,7 +346,7 @@ parse_eeprom (struct net_device *dev) | |||
346 | if (np->pdev->vendor == PCI_VENDOR_ID_DLINK) { /* D-Link Only */ | 346 | if (np->pdev->vendor == PCI_VENDOR_ID_DLINK) { /* D-Link Only */ |
347 | /* Check CRC */ | 347 | /* Check CRC */ |
348 | crc = ~ether_crc_le (256 - 4, sromdata); | 348 | crc = ~ether_crc_le (256 - 4, sromdata); |
349 | if (psrom->crc != crc) { | 349 | if (psrom->crc != cpu_to_le32(crc)) { |
350 | printk (KERN_ERR "%s: EEPROM data CRC error.\n", | 350 | printk (KERN_ERR "%s: EEPROM data CRC error.\n", |
351 | dev->name); | 351 | dev->name); |
352 | return -1; | 352 | return -1; |
diff --git a/drivers/net/fs_enet/mac-fcc.c b/drivers/net/fs_enet/mac-fcc.c index 7a84e45487e8..7583a9572bcc 100644 --- a/drivers/net/fs_enet/mac-fcc.c +++ b/drivers/net/fs_enet/mac-fcc.c | |||
@@ -105,7 +105,7 @@ static int do_pd_setup(struct fs_enet_private *fep) | |||
105 | goto out_ep; | 105 | goto out_ep; |
106 | 106 | ||
107 | fep->fcc.mem = (void __iomem *)cpm2_immr; | 107 | fep->fcc.mem = (void __iomem *)cpm2_immr; |
108 | fpi->dpram_offset = cpm_dpalloc(128, 8); | 108 | fpi->dpram_offset = cpm_dpalloc(128, 32); |
109 | if (IS_ERR_VALUE(fpi->dpram_offset)) { | 109 | if (IS_ERR_VALUE(fpi->dpram_offset)) { |
110 | ret = fpi->dpram_offset; | 110 | ret = fpi->dpram_offset; |
111 | goto out_fcccp; | 111 | goto out_fcccp; |
diff --git a/drivers/net/gianfar.c b/drivers/net/gianfar.c index ff60b23a5b74..2dfcc8047847 100644 --- a/drivers/net/gianfar.c +++ b/drivers/net/gianfar.c | |||
@@ -10,7 +10,7 @@ | |||
10 | * Maintainer: Kumar Gala | 10 | * Maintainer: Kumar Gala |
11 | * Modifier: Sandeep Gopalpet <sandeep.kumar@freescale.com> | 11 | * Modifier: Sandeep Gopalpet <sandeep.kumar@freescale.com> |
12 | * | 12 | * |
13 | * Copyright 2002-2009 Freescale Semiconductor, Inc. | 13 | * Copyright 2002-2009, 2011 Freescale Semiconductor, Inc. |
14 | * Copyright 2007 MontaVista Software, Inc. | 14 | * Copyright 2007 MontaVista Software, Inc. |
15 | * | 15 | * |
16 | * This program is free software; you can redistribute it and/or modify it | 16 | * This program is free software; you can redistribute it and/or modify it |
@@ -476,9 +476,6 @@ static const struct net_device_ops gfar_netdev_ops = { | |||
476 | #endif | 476 | #endif |
477 | }; | 477 | }; |
478 | 478 | ||
479 | unsigned int ftp_rqfpr[MAX_FILER_IDX + 1]; | ||
480 | unsigned int ftp_rqfcr[MAX_FILER_IDX + 1]; | ||
481 | |||
482 | void lock_rx_qs(struct gfar_private *priv) | 479 | void lock_rx_qs(struct gfar_private *priv) |
483 | { | 480 | { |
484 | int i = 0x0; | 481 | int i = 0x0; |
@@ -868,28 +865,28 @@ static u32 cluster_entry_per_class(struct gfar_private *priv, u32 rqfar, | |||
868 | 865 | ||
869 | rqfar--; | 866 | rqfar--; |
870 | rqfcr = RQFCR_CLE | RQFCR_PID_MASK | RQFCR_CMP_EXACT; | 867 | rqfcr = RQFCR_CLE | RQFCR_PID_MASK | RQFCR_CMP_EXACT; |
871 | ftp_rqfpr[rqfar] = rqfpr; | 868 | priv->ftp_rqfpr[rqfar] = rqfpr; |
872 | ftp_rqfcr[rqfar] = rqfcr; | 869 | priv->ftp_rqfcr[rqfar] = rqfcr; |
873 | gfar_write_filer(priv, rqfar, rqfcr, rqfpr); | 870 | gfar_write_filer(priv, rqfar, rqfcr, rqfpr); |
874 | 871 | ||
875 | rqfar--; | 872 | rqfar--; |
876 | rqfcr = RQFCR_CMP_NOMATCH; | 873 | rqfcr = RQFCR_CMP_NOMATCH; |
877 | ftp_rqfpr[rqfar] = rqfpr; | 874 | priv->ftp_rqfpr[rqfar] = rqfpr; |
878 | ftp_rqfcr[rqfar] = rqfcr; | 875 | priv->ftp_rqfcr[rqfar] = rqfcr; |
879 | gfar_write_filer(priv, rqfar, rqfcr, rqfpr); | 876 | gfar_write_filer(priv, rqfar, rqfcr, rqfpr); |
880 | 877 | ||
881 | rqfar--; | 878 | rqfar--; |
882 | rqfcr = RQFCR_CMP_EXACT | RQFCR_PID_PARSE | RQFCR_CLE | RQFCR_AND; | 879 | rqfcr = RQFCR_CMP_EXACT | RQFCR_PID_PARSE | RQFCR_CLE | RQFCR_AND; |
883 | rqfpr = class; | 880 | rqfpr = class; |
884 | ftp_rqfcr[rqfar] = rqfcr; | 881 | priv->ftp_rqfcr[rqfar] = rqfcr; |
885 | ftp_rqfpr[rqfar] = rqfpr; | 882 | priv->ftp_rqfpr[rqfar] = rqfpr; |
886 | gfar_write_filer(priv, rqfar, rqfcr, rqfpr); | 883 | gfar_write_filer(priv, rqfar, rqfcr, rqfpr); |
887 | 884 | ||
888 | rqfar--; | 885 | rqfar--; |
889 | rqfcr = RQFCR_CMP_EXACT | RQFCR_PID_MASK | RQFCR_AND; | 886 | rqfcr = RQFCR_CMP_EXACT | RQFCR_PID_MASK | RQFCR_AND; |
890 | rqfpr = class; | 887 | rqfpr = class; |
891 | ftp_rqfcr[rqfar] = rqfcr; | 888 | priv->ftp_rqfcr[rqfar] = rqfcr; |
892 | ftp_rqfpr[rqfar] = rqfpr; | 889 | priv->ftp_rqfpr[rqfar] = rqfpr; |
893 | gfar_write_filer(priv, rqfar, rqfcr, rqfpr); | 890 | gfar_write_filer(priv, rqfar, rqfcr, rqfpr); |
894 | 891 | ||
895 | return rqfar; | 892 | return rqfar; |
@@ -904,8 +901,8 @@ static void gfar_init_filer_table(struct gfar_private *priv) | |||
904 | 901 | ||
905 | /* Default rule */ | 902 | /* Default rule */ |
906 | rqfcr = RQFCR_CMP_MATCH; | 903 | rqfcr = RQFCR_CMP_MATCH; |
907 | ftp_rqfcr[rqfar] = rqfcr; | 904 | priv->ftp_rqfcr[rqfar] = rqfcr; |
908 | ftp_rqfpr[rqfar] = rqfpr; | 905 | priv->ftp_rqfpr[rqfar] = rqfpr; |
909 | gfar_write_filer(priv, rqfar, rqfcr, rqfpr); | 906 | gfar_write_filer(priv, rqfar, rqfcr, rqfpr); |
910 | 907 | ||
911 | rqfar = cluster_entry_per_class(priv, rqfar, RQFPR_IPV6); | 908 | rqfar = cluster_entry_per_class(priv, rqfar, RQFPR_IPV6); |
@@ -921,8 +918,8 @@ static void gfar_init_filer_table(struct gfar_private *priv) | |||
921 | /* Rest are masked rules */ | 918 | /* Rest are masked rules */ |
922 | rqfcr = RQFCR_CMP_NOMATCH; | 919 | rqfcr = RQFCR_CMP_NOMATCH; |
923 | for (i = 0; i < rqfar; i++) { | 920 | for (i = 0; i < rqfar; i++) { |
924 | ftp_rqfcr[i] = rqfcr; | 921 | priv->ftp_rqfcr[i] = rqfcr; |
925 | ftp_rqfpr[i] = rqfpr; | 922 | priv->ftp_rqfpr[i] = rqfpr; |
926 | gfar_write_filer(priv, i, rqfcr, rqfpr); | 923 | gfar_write_filer(priv, i, rqfcr, rqfpr); |
927 | } | 924 | } |
928 | } | 925 | } |
diff --git a/drivers/net/gianfar.h b/drivers/net/gianfar.h index fc86f5195445..ba36dc7a3435 100644 --- a/drivers/net/gianfar.h +++ b/drivers/net/gianfar.h | |||
@@ -9,7 +9,7 @@ | |||
9 | * Maintainer: Kumar Gala | 9 | * Maintainer: Kumar Gala |
10 | * Modifier: Sandeep Gopalpet <sandeep.kumar@freescale.com> | 10 | * Modifier: Sandeep Gopalpet <sandeep.kumar@freescale.com> |
11 | * | 11 | * |
12 | * Copyright 2002-2009 Freescale Semiconductor, Inc. | 12 | * Copyright 2002-2009, 2011 Freescale Semiconductor, Inc. |
13 | * | 13 | * |
14 | * This program is free software; you can redistribute it and/or modify it | 14 | * This program is free software; you can redistribute it and/or modify it |
15 | * under the terms of the GNU General Public License as published by the | 15 | * under the terms of the GNU General Public License as published by the |
@@ -1107,10 +1107,12 @@ struct gfar_private { | |||
1107 | /* HW time stamping enabled flag */ | 1107 | /* HW time stamping enabled flag */ |
1108 | int hwts_rx_en; | 1108 | int hwts_rx_en; |
1109 | int hwts_tx_en; | 1109 | int hwts_tx_en; |
1110 | |||
1111 | /*Filer table*/ | ||
1112 | unsigned int ftp_rqfpr[MAX_FILER_IDX + 1]; | ||
1113 | unsigned int ftp_rqfcr[MAX_FILER_IDX + 1]; | ||
1110 | }; | 1114 | }; |
1111 | 1115 | ||
1112 | extern unsigned int ftp_rqfpr[MAX_FILER_IDX + 1]; | ||
1113 | extern unsigned int ftp_rqfcr[MAX_FILER_IDX + 1]; | ||
1114 | 1116 | ||
1115 | static inline int gfar_has_errata(struct gfar_private *priv, | 1117 | static inline int gfar_has_errata(struct gfar_private *priv, |
1116 | enum gfar_errata err) | 1118 | enum gfar_errata err) |
diff --git a/drivers/net/gianfar_ethtool.c b/drivers/net/gianfar_ethtool.c index 493d743839d9..239e3330495f 100644 --- a/drivers/net/gianfar_ethtool.c +++ b/drivers/net/gianfar_ethtool.c | |||
@@ -9,7 +9,7 @@ | |||
9 | * Maintainer: Kumar Gala | 9 | * Maintainer: Kumar Gala |
10 | * Modifier: Sandeep Gopalpet <sandeep.kumar@freescale.com> | 10 | * Modifier: Sandeep Gopalpet <sandeep.kumar@freescale.com> |
11 | * | 11 | * |
12 | * Copyright 2003-2006, 2008-2009 Freescale Semiconductor, Inc. | 12 | * Copyright 2003-2006, 2008-2009, 2011 Freescale Semiconductor, Inc. |
13 | * | 13 | * |
14 | * This software may be used and distributed according to | 14 | * This software may be used and distributed according to |
15 | * the terms of the GNU Public License, Version 2, incorporated herein | 15 | * the terms of the GNU Public License, Version 2, incorporated herein |
@@ -609,15 +609,15 @@ static void ethflow_to_filer_rules (struct gfar_private *priv, u64 ethflow) | |||
609 | if (ethflow & RXH_L2DA) { | 609 | if (ethflow & RXH_L2DA) { |
610 | fcr = RQFCR_PID_DAH |RQFCR_CMP_NOMATCH | | 610 | fcr = RQFCR_PID_DAH |RQFCR_CMP_NOMATCH | |
611 | RQFCR_HASH | RQFCR_AND | RQFCR_HASHTBL_0; | 611 | RQFCR_HASH | RQFCR_AND | RQFCR_HASHTBL_0; |
612 | ftp_rqfpr[priv->cur_filer_idx] = fpr; | 612 | priv->ftp_rqfpr[priv->cur_filer_idx] = fpr; |
613 | ftp_rqfcr[priv->cur_filer_idx] = fcr; | 613 | priv->ftp_rqfcr[priv->cur_filer_idx] = fcr; |
614 | gfar_write_filer(priv, priv->cur_filer_idx, fcr, fpr); | 614 | gfar_write_filer(priv, priv->cur_filer_idx, fcr, fpr); |
615 | priv->cur_filer_idx = priv->cur_filer_idx - 1; | 615 | priv->cur_filer_idx = priv->cur_filer_idx - 1; |
616 | 616 | ||
617 | fcr = RQFCR_PID_DAL | RQFCR_AND | RQFCR_CMP_NOMATCH | | 617 | fcr = RQFCR_PID_DAL | RQFCR_AND | RQFCR_CMP_NOMATCH | |
618 | RQFCR_HASH | RQFCR_AND | RQFCR_HASHTBL_0; | 618 | RQFCR_HASH | RQFCR_AND | RQFCR_HASHTBL_0; |
619 | ftp_rqfpr[priv->cur_filer_idx] = fpr; | 619 | priv->ftp_rqfpr[priv->cur_filer_idx] = fpr; |
620 | ftp_rqfcr[priv->cur_filer_idx] = fcr; | 620 | priv->ftp_rqfcr[priv->cur_filer_idx] = fcr; |
621 | gfar_write_filer(priv, priv->cur_filer_idx, fcr, fpr); | 621 | gfar_write_filer(priv, priv->cur_filer_idx, fcr, fpr); |
622 | priv->cur_filer_idx = priv->cur_filer_idx - 1; | 622 | priv->cur_filer_idx = priv->cur_filer_idx - 1; |
623 | } | 623 | } |
@@ -626,16 +626,16 @@ static void ethflow_to_filer_rules (struct gfar_private *priv, u64 ethflow) | |||
626 | fcr = RQFCR_PID_VID | RQFCR_CMP_NOMATCH | RQFCR_HASH | | 626 | fcr = RQFCR_PID_VID | RQFCR_CMP_NOMATCH | RQFCR_HASH | |
627 | RQFCR_AND | RQFCR_HASHTBL_0; | 627 | RQFCR_AND | RQFCR_HASHTBL_0; |
628 | gfar_write_filer(priv, priv->cur_filer_idx, fcr, fpr); | 628 | gfar_write_filer(priv, priv->cur_filer_idx, fcr, fpr); |
629 | ftp_rqfpr[priv->cur_filer_idx] = fpr; | 629 | priv->ftp_rqfpr[priv->cur_filer_idx] = fpr; |
630 | ftp_rqfcr[priv->cur_filer_idx] = fcr; | 630 | priv->ftp_rqfcr[priv->cur_filer_idx] = fcr; |
631 | priv->cur_filer_idx = priv->cur_filer_idx - 1; | 631 | priv->cur_filer_idx = priv->cur_filer_idx - 1; |
632 | } | 632 | } |
633 | 633 | ||
634 | if (ethflow & RXH_IP_SRC) { | 634 | if (ethflow & RXH_IP_SRC) { |
635 | fcr = RQFCR_PID_SIA | RQFCR_CMP_NOMATCH | RQFCR_HASH | | 635 | fcr = RQFCR_PID_SIA | RQFCR_CMP_NOMATCH | RQFCR_HASH | |
636 | RQFCR_AND | RQFCR_HASHTBL_0; | 636 | RQFCR_AND | RQFCR_HASHTBL_0; |
637 | ftp_rqfpr[priv->cur_filer_idx] = fpr; | 637 | priv->ftp_rqfpr[priv->cur_filer_idx] = fpr; |
638 | ftp_rqfcr[priv->cur_filer_idx] = fcr; | 638 | priv->ftp_rqfcr[priv->cur_filer_idx] = fcr; |
639 | gfar_write_filer(priv, priv->cur_filer_idx, fcr, fpr); | 639 | gfar_write_filer(priv, priv->cur_filer_idx, fcr, fpr); |
640 | priv->cur_filer_idx = priv->cur_filer_idx - 1; | 640 | priv->cur_filer_idx = priv->cur_filer_idx - 1; |
641 | } | 641 | } |
@@ -643,8 +643,8 @@ static void ethflow_to_filer_rules (struct gfar_private *priv, u64 ethflow) | |||
643 | if (ethflow & (RXH_IP_DST)) { | 643 | if (ethflow & (RXH_IP_DST)) { |
644 | fcr = RQFCR_PID_DIA | RQFCR_CMP_NOMATCH | RQFCR_HASH | | 644 | fcr = RQFCR_PID_DIA | RQFCR_CMP_NOMATCH | RQFCR_HASH | |
645 | RQFCR_AND | RQFCR_HASHTBL_0; | 645 | RQFCR_AND | RQFCR_HASHTBL_0; |
646 | ftp_rqfpr[priv->cur_filer_idx] = fpr; | 646 | priv->ftp_rqfpr[priv->cur_filer_idx] = fpr; |
647 | ftp_rqfcr[priv->cur_filer_idx] = fcr; | 647 | priv->ftp_rqfcr[priv->cur_filer_idx] = fcr; |
648 | gfar_write_filer(priv, priv->cur_filer_idx, fcr, fpr); | 648 | gfar_write_filer(priv, priv->cur_filer_idx, fcr, fpr); |
649 | priv->cur_filer_idx = priv->cur_filer_idx - 1; | 649 | priv->cur_filer_idx = priv->cur_filer_idx - 1; |
650 | } | 650 | } |
@@ -652,8 +652,8 @@ static void ethflow_to_filer_rules (struct gfar_private *priv, u64 ethflow) | |||
652 | if (ethflow & RXH_L3_PROTO) { | 652 | if (ethflow & RXH_L3_PROTO) { |
653 | fcr = RQFCR_PID_L4P | RQFCR_CMP_NOMATCH | RQFCR_HASH | | 653 | fcr = RQFCR_PID_L4P | RQFCR_CMP_NOMATCH | RQFCR_HASH | |
654 | RQFCR_AND | RQFCR_HASHTBL_0; | 654 | RQFCR_AND | RQFCR_HASHTBL_0; |
655 | ftp_rqfpr[priv->cur_filer_idx] = fpr; | 655 | priv->ftp_rqfpr[priv->cur_filer_idx] = fpr; |
656 | ftp_rqfcr[priv->cur_filer_idx] = fcr; | 656 | priv->ftp_rqfcr[priv->cur_filer_idx] = fcr; |
657 | gfar_write_filer(priv, priv->cur_filer_idx, fcr, fpr); | 657 | gfar_write_filer(priv, priv->cur_filer_idx, fcr, fpr); |
658 | priv->cur_filer_idx = priv->cur_filer_idx - 1; | 658 | priv->cur_filer_idx = priv->cur_filer_idx - 1; |
659 | } | 659 | } |
@@ -661,8 +661,8 @@ static void ethflow_to_filer_rules (struct gfar_private *priv, u64 ethflow) | |||
661 | if (ethflow & RXH_L4_B_0_1) { | 661 | if (ethflow & RXH_L4_B_0_1) { |
662 | fcr = RQFCR_PID_SPT | RQFCR_CMP_NOMATCH | RQFCR_HASH | | 662 | fcr = RQFCR_PID_SPT | RQFCR_CMP_NOMATCH | RQFCR_HASH | |
663 | RQFCR_AND | RQFCR_HASHTBL_0; | 663 | RQFCR_AND | RQFCR_HASHTBL_0; |
664 | ftp_rqfpr[priv->cur_filer_idx] = fpr; | 664 | priv->ftp_rqfpr[priv->cur_filer_idx] = fpr; |
665 | ftp_rqfcr[priv->cur_filer_idx] = fcr; | 665 | priv->ftp_rqfcr[priv->cur_filer_idx] = fcr; |
666 | gfar_write_filer(priv, priv->cur_filer_idx, fcr, fpr); | 666 | gfar_write_filer(priv, priv->cur_filer_idx, fcr, fpr); |
667 | priv->cur_filer_idx = priv->cur_filer_idx - 1; | 667 | priv->cur_filer_idx = priv->cur_filer_idx - 1; |
668 | } | 668 | } |
@@ -670,8 +670,8 @@ static void ethflow_to_filer_rules (struct gfar_private *priv, u64 ethflow) | |||
670 | if (ethflow & RXH_L4_B_2_3) { | 670 | if (ethflow & RXH_L4_B_2_3) { |
671 | fcr = RQFCR_PID_DPT | RQFCR_CMP_NOMATCH | RQFCR_HASH | | 671 | fcr = RQFCR_PID_DPT | RQFCR_CMP_NOMATCH | RQFCR_HASH | |
672 | RQFCR_AND | RQFCR_HASHTBL_0; | 672 | RQFCR_AND | RQFCR_HASHTBL_0; |
673 | ftp_rqfpr[priv->cur_filer_idx] = fpr; | 673 | priv->ftp_rqfpr[priv->cur_filer_idx] = fpr; |
674 | ftp_rqfcr[priv->cur_filer_idx] = fcr; | 674 | priv->ftp_rqfcr[priv->cur_filer_idx] = fcr; |
675 | gfar_write_filer(priv, priv->cur_filer_idx, fcr, fpr); | 675 | gfar_write_filer(priv, priv->cur_filer_idx, fcr, fpr); |
676 | priv->cur_filer_idx = priv->cur_filer_idx - 1; | 676 | priv->cur_filer_idx = priv->cur_filer_idx - 1; |
677 | } | 677 | } |
@@ -705,12 +705,12 @@ static int gfar_ethflow_to_filer_table(struct gfar_private *priv, u64 ethflow, u | |||
705 | } | 705 | } |
706 | 706 | ||
707 | for (i = 0; i < MAX_FILER_IDX + 1; i++) { | 707 | for (i = 0; i < MAX_FILER_IDX + 1; i++) { |
708 | local_rqfpr[j] = ftp_rqfpr[i]; | 708 | local_rqfpr[j] = priv->ftp_rqfpr[i]; |
709 | local_rqfcr[j] = ftp_rqfcr[i]; | 709 | local_rqfcr[j] = priv->ftp_rqfcr[i]; |
710 | j--; | 710 | j--; |
711 | if ((ftp_rqfcr[i] == (RQFCR_PID_PARSE | | 711 | if ((priv->ftp_rqfcr[i] == (RQFCR_PID_PARSE | |
712 | RQFCR_CLE |RQFCR_AND)) && | 712 | RQFCR_CLE |RQFCR_AND)) && |
713 | (ftp_rqfpr[i] == cmp_rqfpr)) | 713 | (priv->ftp_rqfpr[i] == cmp_rqfpr)) |
714 | break; | 714 | break; |
715 | } | 715 | } |
716 | 716 | ||
@@ -724,20 +724,22 @@ static int gfar_ethflow_to_filer_table(struct gfar_private *priv, u64 ethflow, u | |||
724 | * if it was already programmed, we need to overwrite these rules | 724 | * if it was already programmed, we need to overwrite these rules |
725 | */ | 725 | */ |
726 | for (l = i+1; l < MAX_FILER_IDX; l++) { | 726 | for (l = i+1; l < MAX_FILER_IDX; l++) { |
727 | if ((ftp_rqfcr[l] & RQFCR_CLE) && | 727 | if ((priv->ftp_rqfcr[l] & RQFCR_CLE) && |
728 | !(ftp_rqfcr[l] & RQFCR_AND)) { | 728 | !(priv->ftp_rqfcr[l] & RQFCR_AND)) { |
729 | ftp_rqfcr[l] = RQFCR_CLE | RQFCR_CMP_EXACT | | 729 | priv->ftp_rqfcr[l] = RQFCR_CLE | RQFCR_CMP_EXACT | |
730 | RQFCR_HASHTBL_0 | RQFCR_PID_MASK; | 730 | RQFCR_HASHTBL_0 | RQFCR_PID_MASK; |
731 | ftp_rqfpr[l] = FPR_FILER_MASK; | 731 | priv->ftp_rqfpr[l] = FPR_FILER_MASK; |
732 | gfar_write_filer(priv, l, ftp_rqfcr[l], ftp_rqfpr[l]); | 732 | gfar_write_filer(priv, l, priv->ftp_rqfcr[l], |
733 | priv->ftp_rqfpr[l]); | ||
733 | break; | 734 | break; |
734 | } | 735 | } |
735 | 736 | ||
736 | if (!(ftp_rqfcr[l] & RQFCR_CLE) && (ftp_rqfcr[l] & RQFCR_AND)) | 737 | if (!(priv->ftp_rqfcr[l] & RQFCR_CLE) && |
738 | (priv->ftp_rqfcr[l] & RQFCR_AND)) | ||
737 | continue; | 739 | continue; |
738 | else { | 740 | else { |
739 | local_rqfpr[j] = ftp_rqfpr[l]; | 741 | local_rqfpr[j] = priv->ftp_rqfpr[l]; |
740 | local_rqfcr[j] = ftp_rqfcr[l]; | 742 | local_rqfcr[j] = priv->ftp_rqfcr[l]; |
741 | j--; | 743 | j--; |
742 | } | 744 | } |
743 | } | 745 | } |
@@ -750,8 +752,8 @@ static int gfar_ethflow_to_filer_table(struct gfar_private *priv, u64 ethflow, u | |||
750 | 752 | ||
751 | /* Write back the popped out rules again */ | 753 | /* Write back the popped out rules again */ |
752 | for (k = j+1; k < MAX_FILER_IDX; k++) { | 754 | for (k = j+1; k < MAX_FILER_IDX; k++) { |
753 | ftp_rqfpr[priv->cur_filer_idx] = local_rqfpr[k]; | 755 | priv->ftp_rqfpr[priv->cur_filer_idx] = local_rqfpr[k]; |
754 | ftp_rqfcr[priv->cur_filer_idx] = local_rqfcr[k]; | 756 | priv->ftp_rqfcr[priv->cur_filer_idx] = local_rqfcr[k]; |
755 | gfar_write_filer(priv, priv->cur_filer_idx, | 757 | gfar_write_filer(priv, priv->cur_filer_idx, |
756 | local_rqfcr[k], local_rqfpr[k]); | 758 | local_rqfcr[k], local_rqfpr[k]); |
757 | if (!priv->cur_filer_idx) | 759 | if (!priv->cur_filer_idx) |
diff --git a/drivers/net/greth.c b/drivers/net/greth.c index f181304a7ab6..672f096fe090 100644 --- a/drivers/net/greth.c +++ b/drivers/net/greth.c | |||
@@ -1015,11 +1015,10 @@ static int greth_set_mac_add(struct net_device *dev, void *p) | |||
1015 | return -EINVAL; | 1015 | return -EINVAL; |
1016 | 1016 | ||
1017 | memcpy(dev->dev_addr, addr->sa_data, dev->addr_len); | 1017 | memcpy(dev->dev_addr, addr->sa_data, dev->addr_len); |
1018 | GRETH_REGSAVE(regs->esa_msb, dev->dev_addr[0] << 8 | dev->dev_addr[1]); | ||
1019 | GRETH_REGSAVE(regs->esa_lsb, dev->dev_addr[2] << 24 | dev->dev_addr[3] << 16 | | ||
1020 | dev->dev_addr[4] << 8 | dev->dev_addr[5]); | ||
1018 | 1021 | ||
1019 | GRETH_REGSAVE(regs->esa_msb, addr->sa_data[0] << 8 | addr->sa_data[1]); | ||
1020 | GRETH_REGSAVE(regs->esa_lsb, | ||
1021 | addr->sa_data[2] << 24 | addr-> | ||
1022 | sa_data[3] << 16 | addr->sa_data[4] << 8 | addr->sa_data[5]); | ||
1023 | return 0; | 1022 | return 0; |
1024 | } | 1023 | } |
1025 | 1024 | ||
diff --git a/drivers/net/hamradio/6pack.c b/drivers/net/hamradio/6pack.c index 3e5d0b6b6516..0d283781bc5e 100644 --- a/drivers/net/hamradio/6pack.c +++ b/drivers/net/hamradio/6pack.c | |||
@@ -692,10 +692,10 @@ static void sixpack_close(struct tty_struct *tty) | |||
692 | { | 692 | { |
693 | struct sixpack *sp; | 693 | struct sixpack *sp; |
694 | 694 | ||
695 | write_lock(&disc_data_lock); | 695 | write_lock_bh(&disc_data_lock); |
696 | sp = tty->disc_data; | 696 | sp = tty->disc_data; |
697 | tty->disc_data = NULL; | 697 | tty->disc_data = NULL; |
698 | write_unlock(&disc_data_lock); | 698 | write_unlock_bh(&disc_data_lock); |
699 | if (!sp) | 699 | if (!sp) |
700 | return; | 700 | return; |
701 | 701 | ||
diff --git a/drivers/net/hamradio/mkiss.c b/drivers/net/hamradio/mkiss.c index 4c628393c8b1..bc02968cee16 100644 --- a/drivers/net/hamradio/mkiss.c +++ b/drivers/net/hamradio/mkiss.c | |||
@@ -813,10 +813,10 @@ static void mkiss_close(struct tty_struct *tty) | |||
813 | { | 813 | { |
814 | struct mkiss *ax; | 814 | struct mkiss *ax; |
815 | 815 | ||
816 | write_lock(&disc_data_lock); | 816 | write_lock_bh(&disc_data_lock); |
817 | ax = tty->disc_data; | 817 | ax = tty->disc_data; |
818 | tty->disc_data = NULL; | 818 | tty->disc_data = NULL; |
819 | write_unlock(&disc_data_lock); | 819 | write_unlock_bh(&disc_data_lock); |
820 | 820 | ||
821 | if (!ax) | 821 | if (!ax) |
822 | return; | 822 | return; |
diff --git a/drivers/net/hp100.c b/drivers/net/hp100.c index 8e10d2f6a5ad..c3ecb118c1df 100644 --- a/drivers/net/hp100.c +++ b/drivers/net/hp100.c | |||
@@ -1580,12 +1580,12 @@ static netdev_tx_t hp100_start_xmit_bm(struct sk_buff *skb, | |||
1580 | hp100_outl(ringptr->pdl_paddr, TX_PDA_L); /* Low Prio. Queue */ | 1580 | hp100_outl(ringptr->pdl_paddr, TX_PDA_L); /* Low Prio. Queue */ |
1581 | 1581 | ||
1582 | lp->txrcommit++; | 1582 | lp->txrcommit++; |
1583 | spin_unlock_irqrestore(&lp->lock, flags); | ||
1584 | 1583 | ||
1585 | /* Update statistics */ | ||
1586 | dev->stats.tx_packets++; | 1584 | dev->stats.tx_packets++; |
1587 | dev->stats.tx_bytes += skb->len; | 1585 | dev->stats.tx_bytes += skb->len; |
1588 | 1586 | ||
1587 | spin_unlock_irqrestore(&lp->lock, flags); | ||
1588 | |||
1589 | return NETDEV_TX_OK; | 1589 | return NETDEV_TX_OK; |
1590 | 1590 | ||
1591 | drop: | 1591 | drop: |
diff --git a/drivers/net/hplance.c b/drivers/net/hplance.c index b6060f7538df..a900d5bf2948 100644 --- a/drivers/net/hplance.c +++ b/drivers/net/hplance.c | |||
@@ -135,7 +135,7 @@ static void __devexit hplance_remove_one(struct dio_dev *d) | |||
135 | } | 135 | } |
136 | 136 | ||
137 | /* Initialise a single lance board at the given DIO device */ | 137 | /* Initialise a single lance board at the given DIO device */ |
138 | static void __init hplance_init(struct net_device *dev, struct dio_dev *d) | 138 | static void __devinit hplance_init(struct net_device *dev, struct dio_dev *d) |
139 | { | 139 | { |
140 | unsigned long va = (d->resource.start + DIO_VIRADDRBASE); | 140 | unsigned long va = (d->resource.start + DIO_VIRADDRBASE); |
141 | struct hplance_private *lp; | 141 | struct hplance_private *lp; |
diff --git a/drivers/net/igb/igb_main.c b/drivers/net/igb/igb_main.c index 18fccf913635..2c28621eb30b 100644 --- a/drivers/net/igb/igb_main.c +++ b/drivers/net/igb/igb_main.c | |||
@@ -2373,6 +2373,9 @@ static int __devinit igb_sw_init(struct igb_adapter *adapter) | |||
2373 | } | 2373 | } |
2374 | #endif /* CONFIG_PCI_IOV */ | 2374 | #endif /* CONFIG_PCI_IOV */ |
2375 | adapter->rss_queues = min_t(u32, IGB_MAX_RX_QUEUES, num_online_cpus()); | 2375 | adapter->rss_queues = min_t(u32, IGB_MAX_RX_QUEUES, num_online_cpus()); |
2376 | /* i350 cannot do RSS and SR-IOV at the same time */ | ||
2377 | if (hw->mac.type == e1000_i350 && adapter->vfs_allocated_count) | ||
2378 | adapter->rss_queues = 1; | ||
2376 | 2379 | ||
2377 | /* | 2380 | /* |
2378 | * if rss_queues > 4 or vfs are going to be allocated with rss_queues | 2381 | * if rss_queues > 4 or vfs are going to be allocated with rss_queues |
diff --git a/drivers/net/natsemi.c b/drivers/net/natsemi.c index ab2862990a5b..68e6b0224edd 100644 --- a/drivers/net/natsemi.c +++ b/drivers/net/natsemi.c | |||
@@ -2360,7 +2360,8 @@ static void netdev_rx(struct net_device *dev, int *work_done, int work_to_do) | |||
2360 | PCI_DMA_FROMDEVICE); | 2360 | PCI_DMA_FROMDEVICE); |
2361 | } else { | 2361 | } else { |
2362 | pci_unmap_single(np->pci_dev, np->rx_dma[entry], | 2362 | pci_unmap_single(np->pci_dev, np->rx_dma[entry], |
2363 | buflen, PCI_DMA_FROMDEVICE); | 2363 | buflen + NATSEMI_PADDING, |
2364 | PCI_DMA_FROMDEVICE); | ||
2364 | skb_put(skb = np->rx_skbuff[entry], pkt_len); | 2365 | skb_put(skb = np->rx_skbuff[entry], pkt_len); |
2365 | np->rx_skbuff[entry] = NULL; | 2366 | np->rx_skbuff[entry] = NULL; |
2366 | } | 2367 | } |
diff --git a/drivers/net/netxen/netxen_nic_main.c b/drivers/net/netxen/netxen_nic_main.c index b644383017f9..c0788a31ff0f 100644 --- a/drivers/net/netxen/netxen_nic_main.c +++ b/drivers/net/netxen/netxen_nic_main.c | |||
@@ -1965,11 +1965,11 @@ netxen_nic_xmit_frame(struct sk_buff *skb, struct net_device *netdev) | |||
1965 | 1965 | ||
1966 | netxen_tso_check(netdev, tx_ring, first_desc, skb); | 1966 | netxen_tso_check(netdev, tx_ring, first_desc, skb); |
1967 | 1967 | ||
1968 | netxen_nic_update_cmd_producer(adapter, tx_ring); | ||
1969 | |||
1970 | adapter->stats.txbytes += skb->len; | 1968 | adapter->stats.txbytes += skb->len; |
1971 | adapter->stats.xmitcalled++; | 1969 | adapter->stats.xmitcalled++; |
1972 | 1970 | ||
1971 | netxen_nic_update_cmd_producer(adapter, tx_ring); | ||
1972 | |||
1973 | return NETDEV_TX_OK; | 1973 | return NETDEV_TX_OK; |
1974 | 1974 | ||
1975 | drop_packet: | 1975 | drop_packet: |
diff --git a/drivers/net/phy/Kconfig b/drivers/net/phy/Kconfig index 392a6c4b72e5..a70244306c94 100644 --- a/drivers/net/phy/Kconfig +++ b/drivers/net/phy/Kconfig | |||
@@ -58,6 +58,7 @@ config BROADCOM_PHY | |||
58 | 58 | ||
59 | config BCM63XX_PHY | 59 | config BCM63XX_PHY |
60 | tristate "Drivers for Broadcom 63xx SOCs internal PHY" | 60 | tristate "Drivers for Broadcom 63xx SOCs internal PHY" |
61 | depends on BCM63XX | ||
61 | ---help--- | 62 | ---help--- |
62 | Currently supports the 6348 and 6358 PHYs. | 63 | Currently supports the 6348 and 6358 PHYs. |
63 | 64 | ||
diff --git a/drivers/net/phy/dp83640.c b/drivers/net/phy/dp83640.c index b0c9522bb535..2cd8dc5847b4 100644 --- a/drivers/net/phy/dp83640.c +++ b/drivers/net/phy/dp83640.c | |||
@@ -543,11 +543,20 @@ static void recalibrate(struct dp83640_clock *clock) | |||
543 | 543 | ||
544 | /* time stamping methods */ | 544 | /* time stamping methods */ |
545 | 545 | ||
546 | static void decode_evnt(struct dp83640_private *dp83640, | 546 | static int decode_evnt(struct dp83640_private *dp83640, |
547 | struct phy_txts *phy_txts, u16 ests) | 547 | void *data, u16 ests) |
548 | { | 548 | { |
549 | struct phy_txts *phy_txts; | ||
549 | struct ptp_clock_event event; | 550 | struct ptp_clock_event event; |
550 | int words = (ests >> EVNT_TS_LEN_SHIFT) & EVNT_TS_LEN_MASK; | 551 | int words = (ests >> EVNT_TS_LEN_SHIFT) & EVNT_TS_LEN_MASK; |
552 | u16 ext_status = 0; | ||
553 | |||
554 | if (ests & MULT_EVNT) { | ||
555 | ext_status = *(u16 *) data; | ||
556 | data += sizeof(ext_status); | ||
557 | } | ||
558 | |||
559 | phy_txts = data; | ||
551 | 560 | ||
552 | switch (words) { /* fall through in every case */ | 561 | switch (words) { /* fall through in every case */ |
553 | case 3: | 562 | case 3: |
@@ -565,6 +574,9 @@ static void decode_evnt(struct dp83640_private *dp83640, | |||
565 | event.timestamp = phy2txts(&dp83640->edata); | 574 | event.timestamp = phy2txts(&dp83640->edata); |
566 | 575 | ||
567 | ptp_clock_event(dp83640->clock->ptp_clock, &event); | 576 | ptp_clock_event(dp83640->clock->ptp_clock, &event); |
577 | |||
578 | words = ext_status ? words + 2 : words + 1; | ||
579 | return words * sizeof(u16); | ||
568 | } | 580 | } |
569 | 581 | ||
570 | static void decode_rxts(struct dp83640_private *dp83640, | 582 | static void decode_rxts(struct dp83640_private *dp83640, |
@@ -643,9 +655,7 @@ static void decode_status_frame(struct dp83640_private *dp83640, | |||
643 | 655 | ||
644 | } else if (PSF_EVNT == type && len >= sizeof(*phy_txts)) { | 656 | } else if (PSF_EVNT == type && len >= sizeof(*phy_txts)) { |
645 | 657 | ||
646 | phy_txts = (struct phy_txts *) ptr; | 658 | size = decode_evnt(dp83640, ptr, ests); |
647 | decode_evnt(dp83640, phy_txts, ests); | ||
648 | size = sizeof(*phy_txts); | ||
649 | 659 | ||
650 | } else { | 660 | } else { |
651 | size = 0; | 661 | size = 0; |
@@ -1034,8 +1044,8 @@ static bool dp83640_rxtstamp(struct phy_device *phydev, | |||
1034 | 1044 | ||
1035 | if (is_status_frame(skb, type)) { | 1045 | if (is_status_frame(skb, type)) { |
1036 | decode_status_frame(dp83640, skb); | 1046 | decode_status_frame(dp83640, skb); |
1037 | /* Let the stack drop this frame. */ | 1047 | kfree_skb(skb); |
1038 | return false; | 1048 | return true; |
1039 | } | 1049 | } |
1040 | 1050 | ||
1041 | SKB_PTP_TYPE(skb) = type; | 1051 | SKB_PTP_TYPE(skb) = type; |
diff --git a/drivers/net/ppp_async.c b/drivers/net/ppp_async.c index a1b82c9c67d2..c554a397e558 100644 --- a/drivers/net/ppp_async.c +++ b/drivers/net/ppp_async.c | |||
@@ -523,7 +523,7 @@ static void ppp_async_process(unsigned long arg) | |||
523 | #define PUT_BYTE(ap, buf, c, islcp) do { \ | 523 | #define PUT_BYTE(ap, buf, c, islcp) do { \ |
524 | if ((islcp && c < 0x20) || (ap->xaccm[c >> 5] & (1 << (c & 0x1f)))) {\ | 524 | if ((islcp && c < 0x20) || (ap->xaccm[c >> 5] & (1 << (c & 0x1f)))) {\ |
525 | *buf++ = PPP_ESCAPE; \ | 525 | *buf++ = PPP_ESCAPE; \ |
526 | *buf++ = c ^ 0x20; \ | 526 | *buf++ = c ^ PPP_TRANS; \ |
527 | } else \ | 527 | } else \ |
528 | *buf++ = c; \ | 528 | *buf++ = c; \ |
529 | } while (0) | 529 | } while (0) |
@@ -896,7 +896,7 @@ ppp_async_input(struct asyncppp *ap, const unsigned char *buf, | |||
896 | sp = skb_put(skb, n); | 896 | sp = skb_put(skb, n); |
897 | memcpy(sp, buf, n); | 897 | memcpy(sp, buf, n); |
898 | if (ap->state & SC_ESCAPE) { | 898 | if (ap->state & SC_ESCAPE) { |
899 | sp[0] ^= 0x20; | 899 | sp[0] ^= PPP_TRANS; |
900 | ap->state &= ~SC_ESCAPE; | 900 | ap->state &= ~SC_ESCAPE; |
901 | } | 901 | } |
902 | } | 902 | } |
diff --git a/drivers/net/ppp_deflate.c b/drivers/net/ppp_deflate.c index 31e9407a0739..1dbdf82a6dfd 100644 --- a/drivers/net/ppp_deflate.c +++ b/drivers/net/ppp_deflate.c | |||
@@ -305,7 +305,7 @@ static void z_decomp_free(void *arg) | |||
305 | 305 | ||
306 | if (state) { | 306 | if (state) { |
307 | zlib_inflateEnd(&state->strm); | 307 | zlib_inflateEnd(&state->strm); |
308 | kfree(state->strm.workspace); | 308 | vfree(state->strm.workspace); |
309 | kfree(state); | 309 | kfree(state); |
310 | } | 310 | } |
311 | } | 311 | } |
@@ -345,8 +345,7 @@ static void *z_decomp_alloc(unsigned char *options, int opt_len) | |||
345 | 345 | ||
346 | state->w_size = w_size; | 346 | state->w_size = w_size; |
347 | state->strm.next_out = NULL; | 347 | state->strm.next_out = NULL; |
348 | state->strm.workspace = kmalloc(zlib_inflate_workspacesize(), | 348 | state->strm.workspace = vmalloc(zlib_inflate_workspacesize()); |
349 | GFP_KERNEL|__GFP_REPEAT); | ||
350 | if (state->strm.workspace == NULL) | 349 | if (state->strm.workspace == NULL) |
351 | goto out_free; | 350 | goto out_free; |
352 | 351 | ||
diff --git a/drivers/net/pxa168_eth.c b/drivers/net/pxa168_eth.c index df1292eb9c2e..9018a2989e09 100644 --- a/drivers/net/pxa168_eth.c +++ b/drivers/net/pxa168_eth.c | |||
@@ -1273,7 +1273,7 @@ static int pxa168_eth_start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
1273 | wmb(); | 1273 | wmb(); |
1274 | wrl(pep, SDMA_CMD, SDMA_CMD_TXDH | SDMA_CMD_ERD); | 1274 | wrl(pep, SDMA_CMD, SDMA_CMD_TXDH | SDMA_CMD_ERD); |
1275 | 1275 | ||
1276 | stats->tx_bytes += skb->len; | 1276 | stats->tx_bytes += length; |
1277 | stats->tx_packets++; | 1277 | stats->tx_packets++; |
1278 | dev->trans_start = jiffies; | 1278 | dev->trans_start = jiffies; |
1279 | if (pep->tx_ring_size - pep->tx_desc_count <= 1) { | 1279 | if (pep->tx_ring_size - pep->tx_desc_count <= 1) { |
diff --git a/drivers/net/qlcnic/qlcnic_hw.c b/drivers/net/qlcnic/qlcnic_hw.c index e9656616f2a2..a5d9fbf9d816 100644 --- a/drivers/net/qlcnic/qlcnic_hw.c +++ b/drivers/net/qlcnic/qlcnic_hw.c | |||
@@ -1406,6 +1406,7 @@ qlcnic_dump_que(struct qlcnic_adapter *adapter, struct qlcnic_dump_entry *entry, | |||
1406 | 1406 | ||
1407 | for (loop = 0; loop < que->no_ops; loop++) { | 1407 | for (loop = 0; loop < que->no_ops; loop++) { |
1408 | QLCNIC_WR_DUMP_REG(que->sel_addr, base, que_id); | 1408 | QLCNIC_WR_DUMP_REG(que->sel_addr, base, que_id); |
1409 | addr = que->read_addr; | ||
1409 | for (i = 0; i < cnt; i++) { | 1410 | for (i = 0; i < cnt; i++) { |
1410 | QLCNIC_RD_DUMP_REG(addr, base, &data); | 1411 | QLCNIC_RD_DUMP_REG(addr, base, &data); |
1411 | *buffer++ = cpu_to_le32(data); | 1412 | *buffer++ = cpu_to_le32(data); |
diff --git a/drivers/net/qlcnic/qlcnic_main.c b/drivers/net/qlcnic/qlcnic_main.c index 3ab7d2c7baf2..0f6af5c61a7c 100644 --- a/drivers/net/qlcnic/qlcnic_main.c +++ b/drivers/net/qlcnic/qlcnic_main.c | |||
@@ -2159,6 +2159,7 @@ qlcnic_unmap_buffers(struct pci_dev *pdev, struct sk_buff *skb, | |||
2159 | 2159 | ||
2160 | nf = &pbuf->frag_array[0]; | 2160 | nf = &pbuf->frag_array[0]; |
2161 | pci_unmap_single(pdev, nf->dma, skb_headlen(skb), PCI_DMA_TODEVICE); | 2161 | pci_unmap_single(pdev, nf->dma, skb_headlen(skb), PCI_DMA_TODEVICE); |
2162 | pbuf->skb = NULL; | ||
2162 | } | 2163 | } |
2163 | 2164 | ||
2164 | static inline void | 2165 | static inline void |
diff --git a/drivers/net/qlge/qlge.h b/drivers/net/qlge/qlge.h index d32850715f5c..ca306fd5f588 100644 --- a/drivers/net/qlge/qlge.h +++ b/drivers/net/qlge/qlge.h | |||
@@ -16,7 +16,7 @@ | |||
16 | */ | 16 | */ |
17 | #define DRV_NAME "qlge" | 17 | #define DRV_NAME "qlge" |
18 | #define DRV_STRING "QLogic 10 Gigabit PCI-E Ethernet Driver " | 18 | #define DRV_STRING "QLogic 10 Gigabit PCI-E Ethernet Driver " |
19 | #define DRV_VERSION "v1.00.00.27.00.00-01" | 19 | #define DRV_VERSION "v1.00.00.29.00.00-01" |
20 | 20 | ||
21 | #define WQ_ADDR_ALIGN 0x3 /* 4 byte alignment */ | 21 | #define WQ_ADDR_ALIGN 0x3 /* 4 byte alignment */ |
22 | 22 | ||
@@ -1996,6 +1996,7 @@ enum { | |||
1996 | QL_LB_LINK_UP = 10, | 1996 | QL_LB_LINK_UP = 10, |
1997 | QL_FRC_COREDUMP = 11, | 1997 | QL_FRC_COREDUMP = 11, |
1998 | QL_EEH_FATAL = 12, | 1998 | QL_EEH_FATAL = 12, |
1999 | QL_ASIC_RECOVERY = 14, /* We are in ascic recovery. */ | ||
1999 | }; | 2000 | }; |
2000 | 2001 | ||
2001 | /* link_status bit definitions */ | 2002 | /* link_status bit definitions */ |
diff --git a/drivers/net/qlge/qlge_main.c b/drivers/net/qlge/qlge_main.c index 930ae45457bb..6b4ff970972b 100644 --- a/drivers/net/qlge/qlge_main.c +++ b/drivers/net/qlge/qlge_main.c | |||
@@ -2152,6 +2152,10 @@ void ql_queue_asic_error(struct ql_adapter *qdev) | |||
2152 | * thread | 2152 | * thread |
2153 | */ | 2153 | */ |
2154 | clear_bit(QL_ADAPTER_UP, &qdev->flags); | 2154 | clear_bit(QL_ADAPTER_UP, &qdev->flags); |
2155 | /* Set asic recovery bit to indicate reset process that we are | ||
2156 | * in fatal error recovery process rather than normal close | ||
2157 | */ | ||
2158 | set_bit(QL_ASIC_RECOVERY, &qdev->flags); | ||
2155 | queue_delayed_work(qdev->workqueue, &qdev->asic_reset_work, 0); | 2159 | queue_delayed_work(qdev->workqueue, &qdev->asic_reset_work, 0); |
2156 | } | 2160 | } |
2157 | 2161 | ||
@@ -2166,23 +2170,20 @@ static void ql_process_chip_ae_intr(struct ql_adapter *qdev, | |||
2166 | return; | 2170 | return; |
2167 | 2171 | ||
2168 | case CAM_LOOKUP_ERR_EVENT: | 2172 | case CAM_LOOKUP_ERR_EVENT: |
2169 | netif_err(qdev, link, qdev->ndev, | 2173 | netdev_err(qdev->ndev, "Multiple CAM hits lookup occurred.\n"); |
2170 | "Multiple CAM hits lookup occurred.\n"); | 2174 | netdev_err(qdev->ndev, "This event shouldn't occur.\n"); |
2171 | netif_err(qdev, drv, qdev->ndev, | ||
2172 | "This event shouldn't occur.\n"); | ||
2173 | ql_queue_asic_error(qdev); | 2175 | ql_queue_asic_error(qdev); |
2174 | return; | 2176 | return; |
2175 | 2177 | ||
2176 | case SOFT_ECC_ERROR_EVENT: | 2178 | case SOFT_ECC_ERROR_EVENT: |
2177 | netif_err(qdev, rx_err, qdev->ndev, | 2179 | netdev_err(qdev->ndev, "Soft ECC error detected.\n"); |
2178 | "Soft ECC error detected.\n"); | ||
2179 | ql_queue_asic_error(qdev); | 2180 | ql_queue_asic_error(qdev); |
2180 | break; | 2181 | break; |
2181 | 2182 | ||
2182 | case PCI_ERR_ANON_BUF_RD: | 2183 | case PCI_ERR_ANON_BUF_RD: |
2183 | netif_err(qdev, rx_err, qdev->ndev, | 2184 | netdev_err(qdev->ndev, "PCI error occurred when reading " |
2184 | "PCI error occurred when reading anonymous buffers from rx_ring %d.\n", | 2185 | "anonymous buffers from rx_ring %d.\n", |
2185 | ib_ae_rsp->q_id); | 2186 | ib_ae_rsp->q_id); |
2186 | ql_queue_asic_error(qdev); | 2187 | ql_queue_asic_error(qdev); |
2187 | break; | 2188 | break; |
2188 | 2189 | ||
@@ -2437,11 +2438,10 @@ static irqreturn_t qlge_isr(int irq, void *dev_id) | |||
2437 | */ | 2438 | */ |
2438 | if (var & STS_FE) { | 2439 | if (var & STS_FE) { |
2439 | ql_queue_asic_error(qdev); | 2440 | ql_queue_asic_error(qdev); |
2440 | netif_err(qdev, intr, qdev->ndev, | 2441 | netdev_err(qdev->ndev, "Got fatal error, STS = %x.\n", var); |
2441 | "Got fatal error, STS = %x.\n", var); | ||
2442 | var = ql_read32(qdev, ERR_STS); | 2442 | var = ql_read32(qdev, ERR_STS); |
2443 | netif_err(qdev, intr, qdev->ndev, | 2443 | netdev_err(qdev->ndev, "Resetting chip. " |
2444 | "Resetting chip. Error Status Register = 0x%x\n", var); | 2444 | "Error Status Register = 0x%x\n", var); |
2445 | return IRQ_HANDLED; | 2445 | return IRQ_HANDLED; |
2446 | } | 2446 | } |
2447 | 2447 | ||
@@ -3818,11 +3818,17 @@ static int ql_adapter_reset(struct ql_adapter *qdev) | |||
3818 | end_jiffies = jiffies + | 3818 | end_jiffies = jiffies + |
3819 | max((unsigned long)1, usecs_to_jiffies(30)); | 3819 | max((unsigned long)1, usecs_to_jiffies(30)); |
3820 | 3820 | ||
3821 | /* Stop management traffic. */ | 3821 | /* Check if bit is set then skip the mailbox command and |
3822 | ql_mb_set_mgmnt_traffic_ctl(qdev, MB_SET_MPI_TFK_STOP); | 3822 | * clear the bit, else we are in normal reset process. |
3823 | */ | ||
3824 | if (!test_bit(QL_ASIC_RECOVERY, &qdev->flags)) { | ||
3825 | /* Stop management traffic. */ | ||
3826 | ql_mb_set_mgmnt_traffic_ctl(qdev, MB_SET_MPI_TFK_STOP); | ||
3823 | 3827 | ||
3824 | /* Wait for the NIC and MGMNT FIFOs to empty. */ | 3828 | /* Wait for the NIC and MGMNT FIFOs to empty. */ |
3825 | ql_wait_fifo_empty(qdev); | 3829 | ql_wait_fifo_empty(qdev); |
3830 | } else | ||
3831 | clear_bit(QL_ASIC_RECOVERY, &qdev->flags); | ||
3826 | 3832 | ||
3827 | ql_write32(qdev, RST_FO, (RST_FO_FR << 16) | RST_FO_FR); | 3833 | ql_write32(qdev, RST_FO, (RST_FO_FR << 16) | RST_FO_FR); |
3828 | 3834 | ||
diff --git a/drivers/net/r8169.c b/drivers/net/r8169.c index ef1ce2ebeb4a..5990621fb5cd 100644 --- a/drivers/net/r8169.c +++ b/drivers/net/r8169.c | |||
@@ -742,7 +742,7 @@ static void rtl8168_oob_notify(struct rtl8169_private *tp, u8 cmd) | |||
742 | msleep(2); | 742 | msleep(2); |
743 | for (i = 0; i < 5; i++) { | 743 | for (i = 0; i < 5; i++) { |
744 | udelay(100); | 744 | udelay(100); |
745 | if (!(RTL_R32(ERIDR) & ERIAR_FLAG)) | 745 | if (!(RTL_R32(ERIAR) & ERIAR_FLAG)) |
746 | break; | 746 | break; |
747 | } | 747 | } |
748 | 748 | ||
@@ -1621,7 +1621,7 @@ static void rtl8169_get_mac_version(struct rtl8169_private *tp, | |||
1621 | * | 1621 | * |
1622 | * (RTL_R32(TxConfig) & 0x700000) == 0x200000 ? 8101Eb : 8101Ec | 1622 | * (RTL_R32(TxConfig) & 0x700000) == 0x200000 ? 8101Eb : 8101Ec |
1623 | */ | 1623 | */ |
1624 | static const struct { | 1624 | static const struct rtl_mac_info { |
1625 | u32 mask; | 1625 | u32 mask; |
1626 | u32 val; | 1626 | u32 val; |
1627 | int mac_version; | 1627 | int mac_version; |
@@ -1689,7 +1689,8 @@ static void rtl8169_get_mac_version(struct rtl8169_private *tp, | |||
1689 | 1689 | ||
1690 | /* Catch-all */ | 1690 | /* Catch-all */ |
1691 | { 0x00000000, 0x00000000, RTL_GIGA_MAC_NONE } | 1691 | { 0x00000000, 0x00000000, RTL_GIGA_MAC_NONE } |
1692 | }, *p = mac_info; | 1692 | }; |
1693 | const struct rtl_mac_info *p = mac_info; | ||
1693 | u32 reg; | 1694 | u32 reg; |
1694 | 1695 | ||
1695 | reg = RTL_R32(TxConfig); | 1696 | reg = RTL_R32(TxConfig); |
@@ -3681,7 +3682,7 @@ static void rtl_set_rx_max_size(void __iomem *ioaddr, unsigned int rx_buf_sz) | |||
3681 | 3682 | ||
3682 | static void rtl8169_set_magic_reg(void __iomem *ioaddr, unsigned mac_version) | 3683 | static void rtl8169_set_magic_reg(void __iomem *ioaddr, unsigned mac_version) |
3683 | { | 3684 | { |
3684 | static const struct { | 3685 | static const struct rtl_cfg2_info { |
3685 | u32 mac_version; | 3686 | u32 mac_version; |
3686 | u32 clk; | 3687 | u32 clk; |
3687 | u32 val; | 3688 | u32 val; |
@@ -3690,7 +3691,8 @@ static void rtl8169_set_magic_reg(void __iomem *ioaddr, unsigned mac_version) | |||
3690 | { RTL_GIGA_MAC_VER_05, PCI_Clock_66MHz, 0x000fffff }, | 3691 | { RTL_GIGA_MAC_VER_05, PCI_Clock_66MHz, 0x000fffff }, |
3691 | { RTL_GIGA_MAC_VER_06, PCI_Clock_33MHz, 0x00ffff00 }, // 8110SCe | 3692 | { RTL_GIGA_MAC_VER_06, PCI_Clock_33MHz, 0x00ffff00 }, // 8110SCe |
3692 | { RTL_GIGA_MAC_VER_06, PCI_Clock_66MHz, 0x00ffffff } | 3693 | { RTL_GIGA_MAC_VER_06, PCI_Clock_66MHz, 0x00ffffff } |
3693 | }, *p = cfg2_info; | 3694 | }; |
3695 | const struct rtl_cfg2_info *p = cfg2_info; | ||
3694 | unsigned int i; | 3696 | unsigned int i; |
3695 | u32 clk; | 3697 | u32 clk; |
3696 | 3698 | ||
diff --git a/drivers/net/rionet.c b/drivers/net/rionet.c index 77c5092a6a40..5d3436d47edd 100644 --- a/drivers/net/rionet.c +++ b/drivers/net/rionet.c | |||
@@ -378,7 +378,7 @@ static int rionet_close(struct net_device *ndev) | |||
378 | 378 | ||
379 | static void rionet_remove(struct rio_dev *rdev) | 379 | static void rionet_remove(struct rio_dev *rdev) |
380 | { | 380 | { |
381 | struct net_device *ndev = NULL; | 381 | struct net_device *ndev = rio_get_drvdata(rdev); |
382 | struct rionet_peer *peer, *tmp; | 382 | struct rionet_peer *peer, *tmp; |
383 | 383 | ||
384 | free_pages((unsigned long)rionet_active, rdev->net->hport->sys_size ? | 384 | free_pages((unsigned long)rionet_active, rdev->net->hport->sys_size ? |
@@ -433,22 +433,12 @@ static const struct net_device_ops rionet_netdev_ops = { | |||
433 | .ndo_set_mac_address = eth_mac_addr, | 433 | .ndo_set_mac_address = eth_mac_addr, |
434 | }; | 434 | }; |
435 | 435 | ||
436 | static int rionet_setup_netdev(struct rio_mport *mport) | 436 | static int rionet_setup_netdev(struct rio_mport *mport, struct net_device *ndev) |
437 | { | 437 | { |
438 | int rc = 0; | 438 | int rc = 0; |
439 | struct net_device *ndev = NULL; | ||
440 | struct rionet_private *rnet; | 439 | struct rionet_private *rnet; |
441 | u16 device_id; | 440 | u16 device_id; |
442 | 441 | ||
443 | /* Allocate our net_device structure */ | ||
444 | ndev = alloc_etherdev(sizeof(struct rionet_private)); | ||
445 | if (ndev == NULL) { | ||
446 | printk(KERN_INFO "%s: could not allocate ethernet device.\n", | ||
447 | DRV_NAME); | ||
448 | rc = -ENOMEM; | ||
449 | goto out; | ||
450 | } | ||
451 | |||
452 | rionet_active = (struct rio_dev **)__get_free_pages(GFP_KERNEL, | 442 | rionet_active = (struct rio_dev **)__get_free_pages(GFP_KERNEL, |
453 | mport->sys_size ? __fls(sizeof(void *)) + 4 : 0); | 443 | mport->sys_size ? __fls(sizeof(void *)) + 4 : 0); |
454 | if (!rionet_active) { | 444 | if (!rionet_active) { |
@@ -504,11 +494,21 @@ static int rionet_probe(struct rio_dev *rdev, const struct rio_device_id *id) | |||
504 | int rc = -ENODEV; | 494 | int rc = -ENODEV; |
505 | u32 lpef, lsrc_ops, ldst_ops; | 495 | u32 lpef, lsrc_ops, ldst_ops; |
506 | struct rionet_peer *peer; | 496 | struct rionet_peer *peer; |
497 | struct net_device *ndev = NULL; | ||
507 | 498 | ||
508 | /* If local device is not rionet capable, give up quickly */ | 499 | /* If local device is not rionet capable, give up quickly */ |
509 | if (!rionet_capable) | 500 | if (!rionet_capable) |
510 | goto out; | 501 | goto out; |
511 | 502 | ||
503 | /* Allocate our net_device structure */ | ||
504 | ndev = alloc_etherdev(sizeof(struct rionet_private)); | ||
505 | if (ndev == NULL) { | ||
506 | printk(KERN_INFO "%s: could not allocate ethernet device.\n", | ||
507 | DRV_NAME); | ||
508 | rc = -ENOMEM; | ||
509 | goto out; | ||
510 | } | ||
511 | |||
512 | /* | 512 | /* |
513 | * First time through, make sure local device is rionet | 513 | * First time through, make sure local device is rionet |
514 | * capable, setup netdev, and set flags so this is skipped | 514 | * capable, setup netdev, and set flags so this is skipped |
@@ -529,7 +529,7 @@ static int rionet_probe(struct rio_dev *rdev, const struct rio_device_id *id) | |||
529 | goto out; | 529 | goto out; |
530 | } | 530 | } |
531 | 531 | ||
532 | rc = rionet_setup_netdev(rdev->net->hport); | 532 | rc = rionet_setup_netdev(rdev->net->hport, ndev); |
533 | rionet_check = 1; | 533 | rionet_check = 1; |
534 | } | 534 | } |
535 | 535 | ||
@@ -546,6 +546,8 @@ static int rionet_probe(struct rio_dev *rdev, const struct rio_device_id *id) | |||
546 | list_add_tail(&peer->node, &rionet_peers); | 546 | list_add_tail(&peer->node, &rionet_peers); |
547 | } | 547 | } |
548 | 548 | ||
549 | rio_set_drvdata(rdev, ndev); | ||
550 | |||
549 | out: | 551 | out: |
550 | return rc; | 552 | return rc; |
551 | } | 553 | } |
diff --git a/drivers/net/sh_eth.c b/drivers/net/sh_eth.c index 8a72a979ee71..1f3f7b4dd638 100644 --- a/drivers/net/sh_eth.c +++ b/drivers/net/sh_eth.c | |||
@@ -140,6 +140,8 @@ static struct sh_eth_cpu_data sh_eth_my_cpu_data = { | |||
140 | .tpauser = 1, | 140 | .tpauser = 1, |
141 | .hw_swap = 1, | 141 | .hw_swap = 1, |
142 | .no_ade = 1, | 142 | .no_ade = 1, |
143 | .rpadir = 1, | ||
144 | .rpadir_value = 2 << 16, | ||
143 | }; | 145 | }; |
144 | 146 | ||
145 | #define SH_GIGA_ETH_BASE 0xfee00000 | 147 | #define SH_GIGA_ETH_BASE 0xfee00000 |
@@ -1184,8 +1186,8 @@ static void sh_eth_adjust_link(struct net_device *ndev) | |||
1184 | mdp->cd->set_rate(ndev); | 1186 | mdp->cd->set_rate(ndev); |
1185 | } | 1187 | } |
1186 | if (mdp->link == PHY_DOWN) { | 1188 | if (mdp->link == PHY_DOWN) { |
1187 | sh_eth_write(ndev, (sh_eth_read(ndev, ECMR) & ~ECMR_TXF) | 1189 | sh_eth_write(ndev, |
1188 | | ECMR_DM, ECMR); | 1190 | (sh_eth_read(ndev, ECMR) & ~ECMR_TXF), ECMR); |
1189 | new_state = 1; | 1191 | new_state = 1; |
1190 | mdp->link = phydev->link; | 1192 | mdp->link = phydev->link; |
1191 | } | 1193 | } |
diff --git a/drivers/net/smc91x.c b/drivers/net/smc91x.c index dc4805f473e3..f6285748bd3c 100644 --- a/drivers/net/smc91x.c +++ b/drivers/net/smc91x.c | |||
@@ -2400,8 +2400,10 @@ static const struct of_device_id smc91x_match[] = { | |||
2400 | { .compatible = "smsc,lan91c94", }, | 2400 | { .compatible = "smsc,lan91c94", }, |
2401 | { .compatible = "smsc,lan91c111", }, | 2401 | { .compatible = "smsc,lan91c111", }, |
2402 | {}, | 2402 | {}, |
2403 | } | 2403 | }; |
2404 | MODULE_DEVICE_TABLE(of, smc91x_match); | 2404 | MODULE_DEVICE_TABLE(of, smc91x_match); |
2405 | #else | ||
2406 | #define smc91x_match NULL | ||
2405 | #endif | 2407 | #endif |
2406 | 2408 | ||
2407 | static struct dev_pm_ops smc_drv_pm_ops = { | 2409 | static struct dev_pm_ops smc_drv_pm_ops = { |
@@ -2416,9 +2418,7 @@ static struct platform_driver smc_driver = { | |||
2416 | .name = CARDNAME, | 2418 | .name = CARDNAME, |
2417 | .owner = THIS_MODULE, | 2419 | .owner = THIS_MODULE, |
2418 | .pm = &smc_drv_pm_ops, | 2420 | .pm = &smc_drv_pm_ops, |
2419 | #ifdef CONFIG_OF | ||
2420 | .of_match_table = smc91x_match, | 2421 | .of_match_table = smc91x_match, |
2421 | #endif | ||
2422 | }, | 2422 | }, |
2423 | }; | 2423 | }; |
2424 | 2424 | ||
diff --git a/drivers/net/tun.c b/drivers/net/tun.c index 74e94054ab1a..5235f48be1be 100644 --- a/drivers/net/tun.c +++ b/drivers/net/tun.c | |||
@@ -460,7 +460,23 @@ static u32 tun_net_fix_features(struct net_device *dev, u32 features) | |||
460 | 460 | ||
461 | return (features & tun->set_features) | (features & ~TUN_USER_FEATURES); | 461 | return (features & tun->set_features) | (features & ~TUN_USER_FEATURES); |
462 | } | 462 | } |
463 | 463 | #ifdef CONFIG_NET_POLL_CONTROLLER | |
464 | static void tun_poll_controller(struct net_device *dev) | ||
465 | { | ||
466 | /* | ||
467 | * Tun only receives frames when: | ||
468 | * 1) the char device endpoint gets data from user space | ||
469 | * 2) the tun socket gets a sendmsg call from user space | ||
470 | * Since both of those are syncronous operations, we are guaranteed | ||
471 | * never to have pending data when we poll for it | ||
472 | * so theres nothing to do here but return. | ||
473 | * We need this though so netpoll recognizes us as an interface that | ||
474 | * supports polling, which enables bridge devices in virt setups to | ||
475 | * still use netconsole | ||
476 | */ | ||
477 | return; | ||
478 | } | ||
479 | #endif | ||
464 | static const struct net_device_ops tun_netdev_ops = { | 480 | static const struct net_device_ops tun_netdev_ops = { |
465 | .ndo_uninit = tun_net_uninit, | 481 | .ndo_uninit = tun_net_uninit, |
466 | .ndo_open = tun_net_open, | 482 | .ndo_open = tun_net_open, |
@@ -468,6 +484,9 @@ static const struct net_device_ops tun_netdev_ops = { | |||
468 | .ndo_start_xmit = tun_net_xmit, | 484 | .ndo_start_xmit = tun_net_xmit, |
469 | .ndo_change_mtu = tun_net_change_mtu, | 485 | .ndo_change_mtu = tun_net_change_mtu, |
470 | .ndo_fix_features = tun_net_fix_features, | 486 | .ndo_fix_features = tun_net_fix_features, |
487 | #ifdef CONFIG_NET_POLL_CONTROLLER | ||
488 | .ndo_poll_controller = tun_poll_controller, | ||
489 | #endif | ||
471 | }; | 490 | }; |
472 | 491 | ||
473 | static const struct net_device_ops tap_netdev_ops = { | 492 | static const struct net_device_ops tap_netdev_ops = { |
@@ -480,6 +499,9 @@ static const struct net_device_ops tap_netdev_ops = { | |||
480 | .ndo_set_multicast_list = tun_net_mclist, | 499 | .ndo_set_multicast_list = tun_net_mclist, |
481 | .ndo_set_mac_address = eth_mac_addr, | 500 | .ndo_set_mac_address = eth_mac_addr, |
482 | .ndo_validate_addr = eth_validate_addr, | 501 | .ndo_validate_addr = eth_validate_addr, |
502 | #ifdef CONFIG_NET_POLL_CONTROLLER | ||
503 | .ndo_poll_controller = tun_poll_controller, | ||
504 | #endif | ||
483 | }; | 505 | }; |
484 | 506 | ||
485 | /* Initialize net device. */ | 507 | /* Initialize net device. */ |
diff --git a/drivers/net/usb/Kconfig b/drivers/net/usb/Kconfig index 9d4f9117260f..84d4608153c9 100644 --- a/drivers/net/usb/Kconfig +++ b/drivers/net/usb/Kconfig | |||
@@ -385,6 +385,16 @@ config USB_NET_CX82310_ETH | |||
385 | router with USB ethernet port. This driver is for routers only, | 385 | router with USB ethernet port. This driver is for routers only, |
386 | it will not work with ADSL modems (use cxacru driver instead). | 386 | it will not work with ADSL modems (use cxacru driver instead). |
387 | 387 | ||
388 | config USB_NET_KALMIA | ||
389 | tristate "Samsung Kalmia based LTE USB modem" | ||
390 | depends on USB_USBNET | ||
391 | help | ||
392 | Choose this option if you have a Samsung Kalmia based USB modem | ||
393 | as Samsung GT-B3730. | ||
394 | |||
395 | To compile this driver as a module, choose M here: the | ||
396 | module will be called kalmia. | ||
397 | |||
388 | config USB_HSO | 398 | config USB_HSO |
389 | tristate "Option USB High Speed Mobile Devices" | 399 | tristate "Option USB High Speed Mobile Devices" |
390 | depends on USB && RFKILL | 400 | depends on USB && RFKILL |
diff --git a/drivers/net/usb/Makefile b/drivers/net/usb/Makefile index c7ec8a5f0a90..c203fa21f6b1 100644 --- a/drivers/net/usb/Makefile +++ b/drivers/net/usb/Makefile | |||
@@ -23,6 +23,7 @@ obj-$(CONFIG_USB_NET_MCS7830) += mcs7830.o | |||
23 | obj-$(CONFIG_USB_USBNET) += usbnet.o | 23 | obj-$(CONFIG_USB_USBNET) += usbnet.o |
24 | obj-$(CONFIG_USB_NET_INT51X1) += int51x1.o | 24 | obj-$(CONFIG_USB_NET_INT51X1) += int51x1.o |
25 | obj-$(CONFIG_USB_CDC_PHONET) += cdc-phonet.o | 25 | obj-$(CONFIG_USB_CDC_PHONET) += cdc-phonet.o |
26 | obj-$(CONFIG_USB_NET_KALMIA) += kalmia.o | ||
26 | obj-$(CONFIG_USB_IPHETH) += ipheth.o | 27 | obj-$(CONFIG_USB_IPHETH) += ipheth.o |
27 | obj-$(CONFIG_USB_SIERRA_NET) += sierra_net.o | 28 | obj-$(CONFIG_USB_SIERRA_NET) += sierra_net.o |
28 | obj-$(CONFIG_USB_NET_CX82310_ETH) += cx82310_eth.o | 29 | obj-$(CONFIG_USB_NET_CX82310_ETH) += cx82310_eth.o |
diff --git a/drivers/net/usb/kalmia.c b/drivers/net/usb/kalmia.c new file mode 100644 index 000000000000..a9b6c63d54e4 --- /dev/null +++ b/drivers/net/usb/kalmia.c | |||
@@ -0,0 +1,392 @@ | |||
1 | /* | ||
2 | * USB network interface driver for Samsung Kalmia based LTE USB modem like the | ||
3 | * Samsung GT-B3730 and GT-B3710. | ||
4 | * | ||
5 | * Copyright (C) 2011 Marius Bjoernstad Kotsbak <marius@kotsbak.com> | ||
6 | * | ||
7 | * Sponsored by Quicklink Video Distribution Services Ltd. | ||
8 | * | ||
9 | * Based on the cdc_eem module. | ||
10 | * | ||
11 | * This program is free software; you can redistribute it and/or modify | ||
12 | * it under the terms of the GNU General Public License as published by | ||
13 | * the Free Software Foundation; either version 2 of the License, or | ||
14 | * (at your option) any later version. | ||
15 | */ | ||
16 | |||
17 | #include <linux/module.h> | ||
18 | #include <linux/init.h> | ||
19 | #include <linux/netdevice.h> | ||
20 | #include <linux/etherdevice.h> | ||
21 | #include <linux/ctype.h> | ||
22 | #include <linux/ethtool.h> | ||
23 | #include <linux/workqueue.h> | ||
24 | #include <linux/mii.h> | ||
25 | #include <linux/usb.h> | ||
26 | #include <linux/crc32.h> | ||
27 | #include <linux/usb/cdc.h> | ||
28 | #include <linux/usb/usbnet.h> | ||
29 | #include <linux/gfp.h> | ||
30 | |||
31 | /* | ||
32 | * The Samsung Kalmia based LTE USB modems have a CDC ACM port for modem control | ||
33 | * handled by the "option" module and an ethernet data port handled by this | ||
34 | * module. | ||
35 | * | ||
36 | * The stick must first be switched into modem mode by usb_modeswitch | ||
37 | * or similar tool. Then the modem gets sent two initialization packets by | ||
38 | * this module, which gives the MAC address of the device. User space can then | ||
39 | * connect the modem using AT commands through the ACM port and then use | ||
40 | * DHCP on the network interface exposed by this module. Network packets are | ||
41 | * sent to and from the modem in a proprietary format discovered after watching | ||
42 | * the behavior of the windows driver for the modem. | ||
43 | * | ||
44 | * More information about the use of the modem is available in usb_modeswitch | ||
45 | * forum and the project page: | ||
46 | * | ||
47 | * http://www.draisberghof.de/usb_modeswitch/bb/viewtopic.php?t=465 | ||
48 | * https://github.com/mkotsbak/Samsung-GT-B3730-linux-driver | ||
49 | */ | ||
50 | |||
51 | /* #define DEBUG */ | ||
52 | /* #define VERBOSE */ | ||
53 | |||
54 | #define KALMIA_HEADER_LENGTH 6 | ||
55 | #define KALMIA_ALIGN_SIZE 4 | ||
56 | #define KALMIA_USB_TIMEOUT 10000 | ||
57 | |||
58 | /*-------------------------------------------------------------------------*/ | ||
59 | |||
60 | static int | ||
61 | kalmia_send_init_packet(struct usbnet *dev, u8 *init_msg, u8 init_msg_len, | ||
62 | u8 *buffer, u8 expected_len) | ||
63 | { | ||
64 | int act_len; | ||
65 | int status; | ||
66 | |||
67 | netdev_dbg(dev->net, "Sending init packet"); | ||
68 | |||
69 | status = usb_bulk_msg(dev->udev, usb_sndbulkpipe(dev->udev, 0x02), | ||
70 | init_msg, init_msg_len, &act_len, KALMIA_USB_TIMEOUT); | ||
71 | if (status != 0) { | ||
72 | netdev_err(dev->net, | ||
73 | "Error sending init packet. Status %i, length %i\n", | ||
74 | status, act_len); | ||
75 | return status; | ||
76 | } | ||
77 | else if (act_len != init_msg_len) { | ||
78 | netdev_err(dev->net, | ||
79 | "Did not send all of init packet. Bytes sent: %i", | ||
80 | act_len); | ||
81 | } | ||
82 | else { | ||
83 | netdev_dbg(dev->net, "Successfully sent init packet."); | ||
84 | } | ||
85 | |||
86 | status = usb_bulk_msg(dev->udev, usb_rcvbulkpipe(dev->udev, 0x81), | ||
87 | buffer, expected_len, &act_len, KALMIA_USB_TIMEOUT); | ||
88 | |||
89 | if (status != 0) | ||
90 | netdev_err(dev->net, | ||
91 | "Error receiving init result. Status %i, length %i\n", | ||
92 | status, act_len); | ||
93 | else if (act_len != expected_len) | ||
94 | netdev_err(dev->net, "Unexpected init result length: %i\n", | ||
95 | act_len); | ||
96 | |||
97 | return status; | ||
98 | } | ||
99 | |||
100 | static int | ||
101 | kalmia_init_and_get_ethernet_addr(struct usbnet *dev, u8 *ethernet_addr) | ||
102 | { | ||
103 | const static char init_msg_1[] = | ||
104 | { 0x57, 0x50, 0x04, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, | ||
105 | 0x00, 0x00 }; | ||
106 | const static char init_msg_2[] = | ||
107 | { 0x57, 0x50, 0x04, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0xf4, | ||
108 | 0x00, 0x00 }; | ||
109 | const static int buflen = 28; | ||
110 | char *usb_buf; | ||
111 | int status; | ||
112 | |||
113 | usb_buf = kmalloc(buflen, GFP_DMA | GFP_KERNEL); | ||
114 | if (!usb_buf) | ||
115 | return -ENOMEM; | ||
116 | |||
117 | memcpy(usb_buf, init_msg_1, 12); | ||
118 | status = kalmia_send_init_packet(dev, usb_buf, sizeof(init_msg_1) | ||
119 | / sizeof(init_msg_1[0]), usb_buf, 24); | ||
120 | if (status != 0) | ||
121 | return status; | ||
122 | |||
123 | memcpy(usb_buf, init_msg_2, 12); | ||
124 | status = kalmia_send_init_packet(dev, usb_buf, sizeof(init_msg_2) | ||
125 | / sizeof(init_msg_2[0]), usb_buf, 28); | ||
126 | if (status != 0) | ||
127 | return status; | ||
128 | |||
129 | memcpy(ethernet_addr, usb_buf + 10, ETH_ALEN); | ||
130 | |||
131 | kfree(usb_buf); | ||
132 | return status; | ||
133 | } | ||
134 | |||
135 | static int | ||
136 | kalmia_bind(struct usbnet *dev, struct usb_interface *intf) | ||
137 | { | ||
138 | int status; | ||
139 | u8 ethernet_addr[ETH_ALEN]; | ||
140 | |||
141 | /* Don't bind to AT command interface */ | ||
142 | if (intf->cur_altsetting->desc.bInterfaceClass != USB_CLASS_VENDOR_SPEC) | ||
143 | return -EINVAL; | ||
144 | |||
145 | dev->in = usb_rcvbulkpipe(dev->udev, 0x81 & USB_ENDPOINT_NUMBER_MASK); | ||
146 | dev->out = usb_sndbulkpipe(dev->udev, 0x02 & USB_ENDPOINT_NUMBER_MASK); | ||
147 | dev->status = NULL; | ||
148 | |||
149 | dev->net->hard_header_len += KALMIA_HEADER_LENGTH; | ||
150 | dev->hard_mtu = 1400; | ||
151 | dev->rx_urb_size = dev->hard_mtu * 10; // Found as optimal after testing | ||
152 | |||
153 | status = kalmia_init_and_get_ethernet_addr(dev, ethernet_addr); | ||
154 | |||
155 | if (status < 0) { | ||
156 | usb_set_intfdata(intf, NULL); | ||
157 | usb_driver_release_interface(driver_of(intf), intf); | ||
158 | return status; | ||
159 | } | ||
160 | |||
161 | memcpy(dev->net->dev_addr, ethernet_addr, ETH_ALEN); | ||
162 | memcpy(dev->net->perm_addr, ethernet_addr, ETH_ALEN); | ||
163 | |||
164 | return status; | ||
165 | } | ||
166 | |||
167 | static struct sk_buff * | ||
168 | kalmia_tx_fixup(struct usbnet *dev, struct sk_buff *skb, gfp_t flags) | ||
169 | { | ||
170 | struct sk_buff *skb2 = NULL; | ||
171 | u16 content_len; | ||
172 | unsigned char *header_start; | ||
173 | unsigned char ether_type_1, ether_type_2; | ||
174 | u8 remainder, padlen = 0; | ||
175 | |||
176 | if (!skb_cloned(skb)) { | ||
177 | int headroom = skb_headroom(skb); | ||
178 | int tailroom = skb_tailroom(skb); | ||
179 | |||
180 | if ((tailroom >= KALMIA_ALIGN_SIZE) && (headroom | ||
181 | >= KALMIA_HEADER_LENGTH)) | ||
182 | goto done; | ||
183 | |||
184 | if ((headroom + tailroom) > (KALMIA_HEADER_LENGTH | ||
185 | + KALMIA_ALIGN_SIZE)) { | ||
186 | skb->data = memmove(skb->head + KALMIA_HEADER_LENGTH, | ||
187 | skb->data, skb->len); | ||
188 | skb_set_tail_pointer(skb, skb->len); | ||
189 | goto done; | ||
190 | } | ||
191 | } | ||
192 | |||
193 | skb2 = skb_copy_expand(skb, KALMIA_HEADER_LENGTH, | ||
194 | KALMIA_ALIGN_SIZE, flags); | ||
195 | if (!skb2) | ||
196 | return NULL; | ||
197 | |||
198 | dev_kfree_skb_any(skb); | ||
199 | skb = skb2; | ||
200 | |||
201 | done: | ||
202 | header_start = skb_push(skb, KALMIA_HEADER_LENGTH); | ||
203 | ether_type_1 = header_start[KALMIA_HEADER_LENGTH + 12]; | ||
204 | ether_type_2 = header_start[KALMIA_HEADER_LENGTH + 13]; | ||
205 | |||
206 | netdev_dbg(dev->net, "Sending etherType: %02x%02x", ether_type_1, | ||
207 | ether_type_2); | ||
208 | |||
209 | /* According to empiric data for data packages */ | ||
210 | header_start[0] = 0x57; | ||
211 | header_start[1] = 0x44; | ||
212 | content_len = skb->len - KALMIA_HEADER_LENGTH; | ||
213 | |||
214 | put_unaligned_le16(content_len, &header_start[2]); | ||
215 | header_start[4] = ether_type_1; | ||
216 | header_start[5] = ether_type_2; | ||
217 | |||
218 | /* Align to 4 bytes by padding with zeros */ | ||
219 | remainder = skb->len % KALMIA_ALIGN_SIZE; | ||
220 | if (remainder > 0) { | ||
221 | padlen = KALMIA_ALIGN_SIZE - remainder; | ||
222 | memset(skb_put(skb, padlen), 0, padlen); | ||
223 | } | ||
224 | |||
225 | netdev_dbg( | ||
226 | dev->net, | ||
227 | "Sending package with length %i and padding %i. Header: %02x:%02x:%02x:%02x:%02x:%02x.", | ||
228 | content_len, padlen, header_start[0], header_start[1], | ||
229 | header_start[2], header_start[3], header_start[4], | ||
230 | header_start[5]); | ||
231 | |||
232 | return skb; | ||
233 | } | ||
234 | |||
235 | static int | ||
236 | kalmia_rx_fixup(struct usbnet *dev, struct sk_buff *skb) | ||
237 | { | ||
238 | /* | ||
239 | * Our task here is to strip off framing, leaving skb with one | ||
240 | * data frame for the usbnet framework code to process. | ||
241 | */ | ||
242 | const static u8 HEADER_END_OF_USB_PACKET[] = | ||
243 | { 0x57, 0x5a, 0x00, 0x00, 0x08, 0x00 }; | ||
244 | const static u8 EXPECTED_UNKNOWN_HEADER_1[] = | ||
245 | { 0x57, 0x43, 0x1e, 0x00, 0x15, 0x02 }; | ||
246 | const static u8 EXPECTED_UNKNOWN_HEADER_2[] = | ||
247 | { 0x57, 0x50, 0x0e, 0x00, 0x00, 0x00 }; | ||
248 | int i = 0; | ||
249 | |||
250 | /* incomplete header? */ | ||
251 | if (skb->len < KALMIA_HEADER_LENGTH) | ||
252 | return 0; | ||
253 | |||
254 | do { | ||
255 | struct sk_buff *skb2 = NULL; | ||
256 | u8 *header_start; | ||
257 | u16 usb_packet_length, ether_packet_length; | ||
258 | int is_last; | ||
259 | |||
260 | header_start = skb->data; | ||
261 | |||
262 | if (unlikely(header_start[0] != 0x57 || header_start[1] != 0x44)) { | ||
263 | if (!memcmp(header_start, EXPECTED_UNKNOWN_HEADER_1, | ||
264 | sizeof(EXPECTED_UNKNOWN_HEADER_1)) || !memcmp( | ||
265 | header_start, EXPECTED_UNKNOWN_HEADER_2, | ||
266 | sizeof(EXPECTED_UNKNOWN_HEADER_2))) { | ||
267 | netdev_dbg( | ||
268 | dev->net, | ||
269 | "Received expected unknown frame header: %02x:%02x:%02x:%02x:%02x:%02x. Package length: %i\n", | ||
270 | header_start[0], header_start[1], | ||
271 | header_start[2], header_start[3], | ||
272 | header_start[4], header_start[5], | ||
273 | skb->len - KALMIA_HEADER_LENGTH); | ||
274 | } | ||
275 | else { | ||
276 | netdev_err( | ||
277 | dev->net, | ||
278 | "Received unknown frame header: %02x:%02x:%02x:%02x:%02x:%02x. Package length: %i\n", | ||
279 | header_start[0], header_start[1], | ||
280 | header_start[2], header_start[3], | ||
281 | header_start[4], header_start[5], | ||
282 | skb->len - KALMIA_HEADER_LENGTH); | ||
283 | return 0; | ||
284 | } | ||
285 | } | ||
286 | else | ||
287 | netdev_dbg( | ||
288 | dev->net, | ||
289 | "Received header: %02x:%02x:%02x:%02x:%02x:%02x. Package length: %i\n", | ||
290 | header_start[0], header_start[1], header_start[2], | ||
291 | header_start[3], header_start[4], header_start[5], | ||
292 | skb->len - KALMIA_HEADER_LENGTH); | ||
293 | |||
294 | /* subtract start header and end header */ | ||
295 | usb_packet_length = skb->len - (2 * KALMIA_HEADER_LENGTH); | ||
296 | ether_packet_length = get_unaligned_le16(&header_start[2]); | ||
297 | skb_pull(skb, KALMIA_HEADER_LENGTH); | ||
298 | |||
299 | /* Some small packets misses end marker */ | ||
300 | if (usb_packet_length < ether_packet_length) { | ||
301 | ether_packet_length = usb_packet_length | ||
302 | + KALMIA_HEADER_LENGTH; | ||
303 | is_last = true; | ||
304 | } | ||
305 | else { | ||
306 | netdev_dbg(dev->net, "Correct package length #%i", i | ||
307 | + 1); | ||
308 | |||
309 | is_last = (memcmp(skb->data + ether_packet_length, | ||
310 | HEADER_END_OF_USB_PACKET, | ||
311 | sizeof(HEADER_END_OF_USB_PACKET)) == 0); | ||
312 | if (!is_last) { | ||
313 | header_start = skb->data + ether_packet_length; | ||
314 | netdev_dbg( | ||
315 | dev->net, | ||
316 | "End header: %02x:%02x:%02x:%02x:%02x:%02x. Package length: %i\n", | ||
317 | header_start[0], header_start[1], | ||
318 | header_start[2], header_start[3], | ||
319 | header_start[4], header_start[5], | ||
320 | skb->len - KALMIA_HEADER_LENGTH); | ||
321 | } | ||
322 | } | ||
323 | |||
324 | if (is_last) { | ||
325 | skb2 = skb; | ||
326 | } | ||
327 | else { | ||
328 | skb2 = skb_clone(skb, GFP_ATOMIC); | ||
329 | if (unlikely(!skb2)) | ||
330 | return 0; | ||
331 | } | ||
332 | |||
333 | skb_trim(skb2, ether_packet_length); | ||
334 | |||
335 | if (is_last) { | ||
336 | return 1; | ||
337 | } | ||
338 | else { | ||
339 | usbnet_skb_return(dev, skb2); | ||
340 | skb_pull(skb, ether_packet_length); | ||
341 | } | ||
342 | |||
343 | i++; | ||
344 | } | ||
345 | while (skb->len); | ||
346 | |||
347 | return 1; | ||
348 | } | ||
349 | |||
350 | static const struct driver_info kalmia_info = { | ||
351 | .description = "Samsung Kalmia LTE USB dongle", | ||
352 | .flags = FLAG_WWAN, | ||
353 | .bind = kalmia_bind, | ||
354 | .rx_fixup = kalmia_rx_fixup, | ||
355 | .tx_fixup = kalmia_tx_fixup | ||
356 | }; | ||
357 | |||
358 | /*-------------------------------------------------------------------------*/ | ||
359 | |||
360 | static const struct usb_device_id products[] = { | ||
361 | /* The unswitched USB ID, to get the module auto loaded: */ | ||
362 | { USB_DEVICE(0x04e8, 0x689a) }, | ||
363 | /* The stick swithed into modem (by e.g. usb_modeswitch): */ | ||
364 | { USB_DEVICE(0x04e8, 0x6889), | ||
365 | .driver_info = (unsigned long) &kalmia_info, }, | ||
366 | { /* EMPTY == end of list */} }; | ||
367 | MODULE_DEVICE_TABLE( usb, products); | ||
368 | |||
369 | static struct usb_driver kalmia_driver = { | ||
370 | .name = "kalmia", | ||
371 | .id_table = products, | ||
372 | .probe = usbnet_probe, | ||
373 | .disconnect = usbnet_disconnect, | ||
374 | .suspend = usbnet_suspend, | ||
375 | .resume = usbnet_resume | ||
376 | }; | ||
377 | |||
378 | static int __init kalmia_init(void) | ||
379 | { | ||
380 | return usb_register(&kalmia_driver); | ||
381 | } | ||
382 | module_init( kalmia_init); | ||
383 | |||
384 | static void __exit kalmia_exit(void) | ||
385 | { | ||
386 | usb_deregister(&kalmia_driver); | ||
387 | } | ||
388 | module_exit( kalmia_exit); | ||
389 | |||
390 | MODULE_AUTHOR("Marius Bjoernstad Kotsbak <marius@kotsbak.com>"); | ||
391 | MODULE_DESCRIPTION("Samsung Kalmia USB network driver"); | ||
392 | MODULE_LICENSE("GPL"); | ||
diff --git a/drivers/net/usb/zaurus.c b/drivers/net/usb/zaurus.c index 241756e0e86f..1a2234c20514 100644 --- a/drivers/net/usb/zaurus.c +++ b/drivers/net/usb/zaurus.c | |||
@@ -331,17 +331,7 @@ static const struct usb_device_id products [] = { | |||
331 | ZAURUS_MASTER_INTERFACE, | 331 | ZAURUS_MASTER_INTERFACE, |
332 | .driver_info = ZAURUS_PXA_INFO, | 332 | .driver_info = ZAURUS_PXA_INFO, |
333 | }, | 333 | }, |
334 | |||
335 | |||
336 | /* At least some of the newest PXA units have very different lies about | ||
337 | * their standards support: they claim to be cell phones offering | ||
338 | * direct access to their radios! (No, they don't conform to CDC MDLM.) | ||
339 | */ | ||
340 | { | 334 | { |
341 | USB_INTERFACE_INFO(USB_CLASS_COMM, USB_CDC_SUBCLASS_MDLM, | ||
342 | USB_CDC_PROTO_NONE), | ||
343 | .driver_info = (unsigned long) &bogus_mdlm_info, | ||
344 | }, { | ||
345 | /* Motorola MOTOMAGX phones */ | 335 | /* Motorola MOTOMAGX phones */ |
346 | USB_DEVICE_AND_INTERFACE_INFO(0x22b8, 0x6425, USB_CLASS_COMM, | 336 | USB_DEVICE_AND_INTERFACE_INFO(0x22b8, 0x6425, USB_CLASS_COMM, |
347 | USB_CDC_SUBCLASS_MDLM, USB_CDC_PROTO_NONE), | 337 | USB_CDC_SUBCLASS_MDLM, USB_CDC_PROTO_NONE), |
diff --git a/drivers/net/vmxnet3/vmxnet3_drv.c b/drivers/net/vmxnet3/vmxnet3_drv.c index fa6e2ac7475a..67402350d0df 100644 --- a/drivers/net/vmxnet3/vmxnet3_drv.c +++ b/drivers/net/vmxnet3/vmxnet3_drv.c | |||
@@ -575,7 +575,7 @@ vmxnet3_rq_alloc_rx_buf(struct vmxnet3_rx_queue *rq, u32 ring_idx, | |||
575 | struct vmxnet3_cmd_ring *ring = &rq->rx_ring[ring_idx]; | 575 | struct vmxnet3_cmd_ring *ring = &rq->rx_ring[ring_idx]; |
576 | u32 val; | 576 | u32 val; |
577 | 577 | ||
578 | while (num_allocated < num_to_alloc) { | 578 | while (num_allocated <= num_to_alloc) { |
579 | struct vmxnet3_rx_buf_info *rbi; | 579 | struct vmxnet3_rx_buf_info *rbi; |
580 | union Vmxnet3_GenericDesc *gd; | 580 | union Vmxnet3_GenericDesc *gd; |
581 | 581 | ||
@@ -621,9 +621,15 @@ vmxnet3_rq_alloc_rx_buf(struct vmxnet3_rx_queue *rq, u32 ring_idx, | |||
621 | 621 | ||
622 | BUG_ON(rbi->dma_addr == 0); | 622 | BUG_ON(rbi->dma_addr == 0); |
623 | gd->rxd.addr = cpu_to_le64(rbi->dma_addr); | 623 | gd->rxd.addr = cpu_to_le64(rbi->dma_addr); |
624 | gd->dword[2] = cpu_to_le32((ring->gen << VMXNET3_RXD_GEN_SHIFT) | 624 | gd->dword[2] = cpu_to_le32((!ring->gen << VMXNET3_RXD_GEN_SHIFT) |
625 | | val | rbi->len); | 625 | | val | rbi->len); |
626 | 626 | ||
627 | /* Fill the last buffer but dont mark it ready, or else the | ||
628 | * device will think that the queue is full */ | ||
629 | if (num_allocated == num_to_alloc) | ||
630 | break; | ||
631 | |||
632 | gd->dword[2] |= cpu_to_le32(ring->gen << VMXNET3_RXD_GEN_SHIFT); | ||
627 | num_allocated++; | 633 | num_allocated++; |
628 | vmxnet3_cmd_ring_adv_next2fill(ring); | 634 | vmxnet3_cmd_ring_adv_next2fill(ring); |
629 | } | 635 | } |
@@ -1140,6 +1146,7 @@ vmxnet3_rq_rx_complete(struct vmxnet3_rx_queue *rq, | |||
1140 | VMXNET3_REG_RXPROD, VMXNET3_REG_RXPROD2 | 1146 | VMXNET3_REG_RXPROD, VMXNET3_REG_RXPROD2 |
1141 | }; | 1147 | }; |
1142 | u32 num_rxd = 0; | 1148 | u32 num_rxd = 0; |
1149 | bool skip_page_frags = false; | ||
1143 | struct Vmxnet3_RxCompDesc *rcd; | 1150 | struct Vmxnet3_RxCompDesc *rcd; |
1144 | struct vmxnet3_rx_ctx *ctx = &rq->rx_ctx; | 1151 | struct vmxnet3_rx_ctx *ctx = &rq->rx_ctx; |
1145 | #ifdef __BIG_ENDIAN_BITFIELD | 1152 | #ifdef __BIG_ENDIAN_BITFIELD |
@@ -1150,11 +1157,12 @@ vmxnet3_rq_rx_complete(struct vmxnet3_rx_queue *rq, | |||
1150 | &rxComp); | 1157 | &rxComp); |
1151 | while (rcd->gen == rq->comp_ring.gen) { | 1158 | while (rcd->gen == rq->comp_ring.gen) { |
1152 | struct vmxnet3_rx_buf_info *rbi; | 1159 | struct vmxnet3_rx_buf_info *rbi; |
1153 | struct sk_buff *skb; | 1160 | struct sk_buff *skb, *new_skb = NULL; |
1161 | struct page *new_page = NULL; | ||
1154 | int num_to_alloc; | 1162 | int num_to_alloc; |
1155 | struct Vmxnet3_RxDesc *rxd; | 1163 | struct Vmxnet3_RxDesc *rxd; |
1156 | u32 idx, ring_idx; | 1164 | u32 idx, ring_idx; |
1157 | 1165 | struct vmxnet3_cmd_ring *ring = NULL; | |
1158 | if (num_rxd >= quota) { | 1166 | if (num_rxd >= quota) { |
1159 | /* we may stop even before we see the EOP desc of | 1167 | /* we may stop even before we see the EOP desc of |
1160 | * the current pkt | 1168 | * the current pkt |
@@ -1165,6 +1173,7 @@ vmxnet3_rq_rx_complete(struct vmxnet3_rx_queue *rq, | |||
1165 | BUG_ON(rcd->rqID != rq->qid && rcd->rqID != rq->qid2); | 1173 | BUG_ON(rcd->rqID != rq->qid && rcd->rqID != rq->qid2); |
1166 | idx = rcd->rxdIdx; | 1174 | idx = rcd->rxdIdx; |
1167 | ring_idx = rcd->rqID < adapter->num_rx_queues ? 0 : 1; | 1175 | ring_idx = rcd->rqID < adapter->num_rx_queues ? 0 : 1; |
1176 | ring = rq->rx_ring + ring_idx; | ||
1168 | vmxnet3_getRxDesc(rxd, &rq->rx_ring[ring_idx].base[idx].rxd, | 1177 | vmxnet3_getRxDesc(rxd, &rq->rx_ring[ring_idx].base[idx].rxd, |
1169 | &rxCmdDesc); | 1178 | &rxCmdDesc); |
1170 | rbi = rq->buf_info[ring_idx] + idx; | 1179 | rbi = rq->buf_info[ring_idx] + idx; |
@@ -1193,37 +1202,80 @@ vmxnet3_rq_rx_complete(struct vmxnet3_rx_queue *rq, | |||
1193 | goto rcd_done; | 1202 | goto rcd_done; |
1194 | } | 1203 | } |
1195 | 1204 | ||
1205 | skip_page_frags = false; | ||
1196 | ctx->skb = rbi->skb; | 1206 | ctx->skb = rbi->skb; |
1197 | rbi->skb = NULL; | 1207 | new_skb = dev_alloc_skb(rbi->len + NET_IP_ALIGN); |
1208 | if (new_skb == NULL) { | ||
1209 | /* Skb allocation failed, do not handover this | ||
1210 | * skb to stack. Reuse it. Drop the existing pkt | ||
1211 | */ | ||
1212 | rq->stats.rx_buf_alloc_failure++; | ||
1213 | ctx->skb = NULL; | ||
1214 | rq->stats.drop_total++; | ||
1215 | skip_page_frags = true; | ||
1216 | goto rcd_done; | ||
1217 | } | ||
1198 | 1218 | ||
1199 | pci_unmap_single(adapter->pdev, rbi->dma_addr, rbi->len, | 1219 | pci_unmap_single(adapter->pdev, rbi->dma_addr, rbi->len, |
1200 | PCI_DMA_FROMDEVICE); | 1220 | PCI_DMA_FROMDEVICE); |
1201 | 1221 | ||
1202 | skb_put(ctx->skb, rcd->len); | 1222 | skb_put(ctx->skb, rcd->len); |
1223 | |||
1224 | /* Immediate refill */ | ||
1225 | new_skb->dev = adapter->netdev; | ||
1226 | skb_reserve(new_skb, NET_IP_ALIGN); | ||
1227 | rbi->skb = new_skb; | ||
1228 | rbi->dma_addr = pci_map_single(adapter->pdev, | ||
1229 | rbi->skb->data, rbi->len, | ||
1230 | PCI_DMA_FROMDEVICE); | ||
1231 | rxd->addr = cpu_to_le64(rbi->dma_addr); | ||
1232 | rxd->len = rbi->len; | ||
1233 | |||
1203 | } else { | 1234 | } else { |
1204 | BUG_ON(ctx->skb == NULL); | 1235 | BUG_ON(ctx->skb == NULL && !skip_page_frags); |
1236 | |||
1205 | /* non SOP buffer must be type 1 in most cases */ | 1237 | /* non SOP buffer must be type 1 in most cases */ |
1206 | if (rbi->buf_type == VMXNET3_RX_BUF_PAGE) { | 1238 | BUG_ON(rbi->buf_type != VMXNET3_RX_BUF_PAGE); |
1207 | BUG_ON(rxd->btype != VMXNET3_RXD_BTYPE_BODY); | 1239 | BUG_ON(rxd->btype != VMXNET3_RXD_BTYPE_BODY); |
1208 | 1240 | ||
1209 | if (rcd->len) { | 1241 | /* If an sop buffer was dropped, skip all |
1210 | pci_unmap_page(adapter->pdev, | 1242 | * following non-sop fragments. They will be reused. |
1211 | rbi->dma_addr, rbi->len, | 1243 | */ |
1212 | PCI_DMA_FROMDEVICE); | 1244 | if (skip_page_frags) |
1245 | goto rcd_done; | ||
1213 | 1246 | ||
1214 | vmxnet3_append_frag(ctx->skb, rcd, rbi); | 1247 | new_page = alloc_page(GFP_ATOMIC); |
1215 | rbi->page = NULL; | 1248 | if (unlikely(new_page == NULL)) { |
1216 | } | 1249 | /* Replacement page frag could not be allocated. |
1217 | } else { | 1250 | * Reuse this page. Drop the pkt and free the |
1218 | /* | 1251 | * skb which contained this page as a frag. Skip |
1219 | * The only time a non-SOP buffer is type 0 is | 1252 | * processing all the following non-sop frags. |
1220 | * when it's EOP and error flag is raised, which | ||
1221 | * has already been handled. | ||
1222 | */ | 1253 | */ |
1223 | BUG_ON(true); | 1254 | rq->stats.rx_buf_alloc_failure++; |
1255 | dev_kfree_skb(ctx->skb); | ||
1256 | ctx->skb = NULL; | ||
1257 | skip_page_frags = true; | ||
1258 | goto rcd_done; | ||
1259 | } | ||
1260 | |||
1261 | if (rcd->len) { | ||
1262 | pci_unmap_page(adapter->pdev, | ||
1263 | rbi->dma_addr, rbi->len, | ||
1264 | PCI_DMA_FROMDEVICE); | ||
1265 | |||
1266 | vmxnet3_append_frag(ctx->skb, rcd, rbi); | ||
1224 | } | 1267 | } |
1268 | |||
1269 | /* Immediate refill */ | ||
1270 | rbi->page = new_page; | ||
1271 | rbi->dma_addr = pci_map_page(adapter->pdev, rbi->page, | ||
1272 | 0, PAGE_SIZE, | ||
1273 | PCI_DMA_FROMDEVICE); | ||
1274 | rxd->addr = cpu_to_le64(rbi->dma_addr); | ||
1275 | rxd->len = rbi->len; | ||
1225 | } | 1276 | } |
1226 | 1277 | ||
1278 | |||
1227 | skb = ctx->skb; | 1279 | skb = ctx->skb; |
1228 | if (rcd->eop) { | 1280 | if (rcd->eop) { |
1229 | skb->len += skb->data_len; | 1281 | skb->len += skb->data_len; |
@@ -1244,26 +1296,27 @@ vmxnet3_rq_rx_complete(struct vmxnet3_rx_queue *rq, | |||
1244 | } | 1296 | } |
1245 | 1297 | ||
1246 | rcd_done: | 1298 | rcd_done: |
1247 | /* device may skip some rx descs */ | 1299 | /* device may have skipped some rx descs */ |
1248 | rq->rx_ring[ring_idx].next2comp = idx; | 1300 | ring->next2comp = idx; |
1249 | VMXNET3_INC_RING_IDX_ONLY(rq->rx_ring[ring_idx].next2comp, | 1301 | num_to_alloc = vmxnet3_cmd_ring_desc_avail(ring); |
1250 | rq->rx_ring[ring_idx].size); | 1302 | ring = rq->rx_ring + ring_idx; |
1251 | 1303 | while (num_to_alloc) { | |
1252 | /* refill rx buffers frequently to avoid starving the h/w */ | 1304 | vmxnet3_getRxDesc(rxd, &ring->base[ring->next2fill].rxd, |
1253 | num_to_alloc = vmxnet3_cmd_ring_desc_avail(rq->rx_ring + | 1305 | &rxCmdDesc); |
1254 | ring_idx); | 1306 | BUG_ON(!rxd->addr); |
1255 | if (unlikely(num_to_alloc > VMXNET3_RX_ALLOC_THRESHOLD(rq, | 1307 | |
1256 | ring_idx, adapter))) { | 1308 | /* Recv desc is ready to be used by the device */ |
1257 | vmxnet3_rq_alloc_rx_buf(rq, ring_idx, num_to_alloc, | 1309 | rxd->gen = ring->gen; |
1258 | adapter); | 1310 | vmxnet3_cmd_ring_adv_next2fill(ring); |
1259 | 1311 | num_to_alloc--; | |
1260 | /* if needed, update the register */ | 1312 | } |
1261 | if (unlikely(rq->shared->updateRxProd)) { | 1313 | |
1262 | VMXNET3_WRITE_BAR0_REG(adapter, | 1314 | /* if needed, update the register */ |
1263 | rxprod_reg[ring_idx] + rq->qid * 8, | 1315 | if (unlikely(rq->shared->updateRxProd)) { |
1264 | rq->rx_ring[ring_idx].next2fill); | 1316 | VMXNET3_WRITE_BAR0_REG(adapter, |
1265 | rq->uncommitted[ring_idx] = 0; | 1317 | rxprod_reg[ring_idx] + rq->qid * 8, |
1266 | } | 1318 | ring->next2fill); |
1319 | rq->uncommitted[ring_idx] = 0; | ||
1267 | } | 1320 | } |
1268 | 1321 | ||
1269 | vmxnet3_comp_ring_adv_next2proc(&rq->comp_ring); | 1322 | vmxnet3_comp_ring_adv_next2proc(&rq->comp_ring); |
@@ -2894,6 +2947,7 @@ vmxnet3_probe_device(struct pci_dev *pdev, | |||
2894 | else | 2947 | else |
2895 | #endif | 2948 | #endif |
2896 | num_rx_queues = 1; | 2949 | num_rx_queues = 1; |
2950 | num_rx_queues = rounddown_pow_of_two(num_rx_queues); | ||
2897 | 2951 | ||
2898 | if (enable_mq) | 2952 | if (enable_mq) |
2899 | num_tx_queues = min(VMXNET3_DEVICE_MAX_TX_QUEUES, | 2953 | num_tx_queues = min(VMXNET3_DEVICE_MAX_TX_QUEUES, |
@@ -2901,6 +2955,7 @@ vmxnet3_probe_device(struct pci_dev *pdev, | |||
2901 | else | 2955 | else |
2902 | num_tx_queues = 1; | 2956 | num_tx_queues = 1; |
2903 | 2957 | ||
2958 | num_tx_queues = rounddown_pow_of_two(num_tx_queues); | ||
2904 | netdev = alloc_etherdev_mq(sizeof(struct vmxnet3_adapter), | 2959 | netdev = alloc_etherdev_mq(sizeof(struct vmxnet3_adapter), |
2905 | max(num_tx_queues, num_rx_queues)); | 2960 | max(num_tx_queues, num_rx_queues)); |
2906 | printk(KERN_INFO "# of Tx queues : %d, # of Rx queues : %d\n", | 2961 | printk(KERN_INFO "# of Tx queues : %d, # of Rx queues : %d\n", |
@@ -3085,6 +3140,7 @@ vmxnet3_remove_device(struct pci_dev *pdev) | |||
3085 | else | 3140 | else |
3086 | #endif | 3141 | #endif |
3087 | num_rx_queues = 1; | 3142 | num_rx_queues = 1; |
3143 | num_rx_queues = rounddown_pow_of_two(num_rx_queues); | ||
3088 | 3144 | ||
3089 | cancel_work_sync(&adapter->work); | 3145 | cancel_work_sync(&adapter->work); |
3090 | 3146 | ||
diff --git a/drivers/net/vmxnet3/vmxnet3_int.h b/drivers/net/vmxnet3/vmxnet3_int.h index f50d36fdf405..e08d75e3f170 100644 --- a/drivers/net/vmxnet3/vmxnet3_int.h +++ b/drivers/net/vmxnet3/vmxnet3_int.h | |||
@@ -55,6 +55,7 @@ | |||
55 | #include <linux/if_vlan.h> | 55 | #include <linux/if_vlan.h> |
56 | #include <linux/if_arp.h> | 56 | #include <linux/if_arp.h> |
57 | #include <linux/inetdevice.h> | 57 | #include <linux/inetdevice.h> |
58 | #include <linux/log2.h> | ||
58 | 59 | ||
59 | #include "vmxnet3_defs.h" | 60 | #include "vmxnet3_defs.h" |
60 | 61 | ||
@@ -68,10 +69,10 @@ | |||
68 | /* | 69 | /* |
69 | * Version numbers | 70 | * Version numbers |
70 | */ | 71 | */ |
71 | #define VMXNET3_DRIVER_VERSION_STRING "1.1.9.0-k" | 72 | #define VMXNET3_DRIVER_VERSION_STRING "1.1.18.0-k" |
72 | 73 | ||
73 | /* a 32-bit int, each byte encode a verion number in VMXNET3_DRIVER_VERSION */ | 74 | /* a 32-bit int, each byte encode a verion number in VMXNET3_DRIVER_VERSION */ |
74 | #define VMXNET3_DRIVER_VERSION_NUM 0x01010900 | 75 | #define VMXNET3_DRIVER_VERSION_NUM 0x01011200 |
75 | 76 | ||
76 | #if defined(CONFIG_PCI_MSI) | 77 | #if defined(CONFIG_PCI_MSI) |
77 | /* RSS only makes sense if MSI-X is supported. */ | 78 | /* RSS only makes sense if MSI-X is supported. */ |
diff --git a/drivers/net/wan/farsync.c b/drivers/net/wan/farsync.c index e050bd65e037..777d1a4e81b2 100644 --- a/drivers/net/wan/farsync.c +++ b/drivers/net/wan/farsync.c | |||
@@ -2203,8 +2203,10 @@ fst_open(struct net_device *dev) | |||
2203 | 2203 | ||
2204 | if (port->mode != FST_RAW) { | 2204 | if (port->mode != FST_RAW) { |
2205 | err = hdlc_open(dev); | 2205 | err = hdlc_open(dev); |
2206 | if (err) | 2206 | if (err) { |
2207 | module_put(THIS_MODULE); | ||
2207 | return err; | 2208 | return err; |
2209 | } | ||
2208 | } | 2210 | } |
2209 | 2211 | ||
2210 | fst_openport(port); | 2212 | fst_openport(port); |
diff --git a/drivers/net/wireless/ath/ath5k/base.c b/drivers/net/wireless/ath/ath5k/base.c index 22047628ccfa..b6c5d3715b96 100644 --- a/drivers/net/wireless/ath/ath5k/base.c +++ b/drivers/net/wireless/ath/ath5k/base.c | |||
@@ -72,6 +72,11 @@ static int modparam_all_channels; | |||
72 | module_param_named(all_channels, modparam_all_channels, bool, S_IRUGO); | 72 | module_param_named(all_channels, modparam_all_channels, bool, S_IRUGO); |
73 | MODULE_PARM_DESC(all_channels, "Expose all channels the device can use."); | 73 | MODULE_PARM_DESC(all_channels, "Expose all channels the device can use."); |
74 | 74 | ||
75 | static int modparam_fastchanswitch; | ||
76 | module_param_named(fastchanswitch, modparam_fastchanswitch, bool, S_IRUGO); | ||
77 | MODULE_PARM_DESC(fastchanswitch, "Enable fast channel switching for AR2413/AR5413 radios."); | ||
78 | |||
79 | |||
75 | /* Module info */ | 80 | /* Module info */ |
76 | MODULE_AUTHOR("Jiri Slaby"); | 81 | MODULE_AUTHOR("Jiri Slaby"); |
77 | MODULE_AUTHOR("Nick Kossifidis"); | 82 | MODULE_AUTHOR("Nick Kossifidis"); |
@@ -2686,6 +2691,7 @@ ath5k_reset(struct ath5k_softc *sc, struct ieee80211_channel *chan, | |||
2686 | struct ath5k_hw *ah = sc->ah; | 2691 | struct ath5k_hw *ah = sc->ah; |
2687 | struct ath_common *common = ath5k_hw_common(ah); | 2692 | struct ath_common *common = ath5k_hw_common(ah); |
2688 | int ret, ani_mode; | 2693 | int ret, ani_mode; |
2694 | bool fast; | ||
2689 | 2695 | ||
2690 | ATH5K_DBG(sc, ATH5K_DEBUG_RESET, "resetting\n"); | 2696 | ATH5K_DBG(sc, ATH5K_DEBUG_RESET, "resetting\n"); |
2691 | 2697 | ||
@@ -2705,7 +2711,10 @@ ath5k_reset(struct ath5k_softc *sc, struct ieee80211_channel *chan, | |||
2705 | ath5k_drain_tx_buffs(sc); | 2711 | ath5k_drain_tx_buffs(sc); |
2706 | if (chan) | 2712 | if (chan) |
2707 | sc->curchan = chan; | 2713 | sc->curchan = chan; |
2708 | ret = ath5k_hw_reset(ah, sc->opmode, sc->curchan, chan != NULL, | 2714 | |
2715 | fast = ((chan != NULL) && modparam_fastchanswitch) ? 1 : 0; | ||
2716 | |||
2717 | ret = ath5k_hw_reset(ah, sc->opmode, sc->curchan, fast, | ||
2709 | skip_pcu); | 2718 | skip_pcu); |
2710 | if (ret) { | 2719 | if (ret) { |
2711 | ATH5K_ERR(sc, "can't reset hardware (%d)\n", ret); | 2720 | ATH5K_ERR(sc, "can't reset hardware (%d)\n", ret); |
diff --git a/drivers/net/wireless/ath/ath5k/eeprom.c b/drivers/net/wireless/ath/ath5k/eeprom.c index 1fef84f87c78..392771f93759 100644 --- a/drivers/net/wireless/ath/ath5k/eeprom.c +++ b/drivers/net/wireless/ath/ath5k/eeprom.c | |||
@@ -691,14 +691,12 @@ ath5k_eeprom_free_pcal_info(struct ath5k_hw *ah, int mode) | |||
691 | if (!chinfo[pier].pd_curves) | 691 | if (!chinfo[pier].pd_curves) |
692 | continue; | 692 | continue; |
693 | 693 | ||
694 | for (pdg = 0; pdg < ee->ee_pd_gains[mode]; pdg++) { | 694 | for (pdg = 0; pdg < AR5K_EEPROM_N_PD_CURVES; pdg++) { |
695 | struct ath5k_pdgain_info *pd = | 695 | struct ath5k_pdgain_info *pd = |
696 | &chinfo[pier].pd_curves[pdg]; | 696 | &chinfo[pier].pd_curves[pdg]; |
697 | 697 | ||
698 | if (pd != NULL) { | 698 | kfree(pd->pd_step); |
699 | kfree(pd->pd_step); | 699 | kfree(pd->pd_pwr); |
700 | kfree(pd->pd_pwr); | ||
701 | } | ||
702 | } | 700 | } |
703 | 701 | ||
704 | kfree(chinfo[pier].pd_curves); | 702 | kfree(chinfo[pier].pd_curves); |
diff --git a/drivers/net/wireless/ath/ath5k/reset.c b/drivers/net/wireless/ath/ath5k/reset.c index 3510de2cf622..126a4eab35f3 100644 --- a/drivers/net/wireless/ath/ath5k/reset.c +++ b/drivers/net/wireless/ath/ath5k/reset.c | |||
@@ -1124,8 +1124,11 @@ int ath5k_hw_reset(struct ath5k_hw *ah, enum nl80211_iftype op_mode, | |||
1124 | /* Non fatal, can happen eg. | 1124 | /* Non fatal, can happen eg. |
1125 | * on mode change */ | 1125 | * on mode change */ |
1126 | ret = 0; | 1126 | ret = 0; |
1127 | } else | 1127 | } else { |
1128 | ATH5K_DBG(ah->ah_sc, ATH5K_DEBUG_RESET, | ||
1129 | "fast chan change successful\n"); | ||
1128 | return 0; | 1130 | return 0; |
1131 | } | ||
1129 | } | 1132 | } |
1130 | 1133 | ||
1131 | /* | 1134 | /* |
diff --git a/drivers/net/wireless/ath/ath9k/pci.c b/drivers/net/wireless/ath/ath9k/pci.c index b8cbfc707213..3bad0b2cf9a3 100644 --- a/drivers/net/wireless/ath/ath9k/pci.c +++ b/drivers/net/wireless/ath/ath9k/pci.c | |||
@@ -278,6 +278,12 @@ static int ath_pci_suspend(struct device *device) | |||
278 | 278 | ||
279 | ath9k_hw_set_gpio(sc->sc_ah, sc->sc_ah->led_pin, 1); | 279 | ath9k_hw_set_gpio(sc->sc_ah, sc->sc_ah->led_pin, 1); |
280 | 280 | ||
281 | /* The device has to be moved to FULLSLEEP forcibly. | ||
282 | * Otherwise the chip never moved to full sleep, | ||
283 | * when no interface is up. | ||
284 | */ | ||
285 | ath9k_hw_setpower(sc->sc_ah, ATH9K_PM_FULL_SLEEP); | ||
286 | |||
281 | return 0; | 287 | return 0; |
282 | } | 288 | } |
283 | 289 | ||
diff --git a/drivers/net/wireless/iwlegacy/iwl-4965.c b/drivers/net/wireless/iwlegacy/iwl-4965.c index f9db25bb35c3..facc94e74b07 100644 --- a/drivers/net/wireless/iwlegacy/iwl-4965.c +++ b/drivers/net/wireless/iwlegacy/iwl-4965.c | |||
@@ -1218,10 +1218,10 @@ static int iwl4965_commit_rxon(struct iwl_priv *priv, struct iwl_rxon_context *c | |||
1218 | * receive commit_rxon request | 1218 | * receive commit_rxon request |
1219 | * abort any previous channel switch if still in process | 1219 | * abort any previous channel switch if still in process |
1220 | */ | 1220 | */ |
1221 | if (priv->switch_rxon.switch_in_progress && | 1221 | if (test_bit(STATUS_CHANNEL_SWITCH_PENDING, &priv->status) && |
1222 | (priv->switch_rxon.channel != ctx->staging.channel)) { | 1222 | (priv->switch_channel != ctx->staging.channel)) { |
1223 | IWL_DEBUG_11H(priv, "abort channel switch on %d\n", | 1223 | IWL_DEBUG_11H(priv, "abort channel switch on %d\n", |
1224 | le16_to_cpu(priv->switch_rxon.channel)); | 1224 | le16_to_cpu(priv->switch_channel)); |
1225 | iwl_legacy_chswitch_done(priv, false); | 1225 | iwl_legacy_chswitch_done(priv, false); |
1226 | } | 1226 | } |
1227 | 1227 | ||
@@ -1237,7 +1237,7 @@ static int iwl4965_commit_rxon(struct iwl_priv *priv, struct iwl_rxon_context *c | |||
1237 | 1237 | ||
1238 | memcpy(active_rxon, &ctx->staging, sizeof(*active_rxon)); | 1238 | memcpy(active_rxon, &ctx->staging, sizeof(*active_rxon)); |
1239 | iwl_legacy_print_rx_config_cmd(priv, ctx); | 1239 | iwl_legacy_print_rx_config_cmd(priv, ctx); |
1240 | return 0; | 1240 | goto set_tx_power; |
1241 | } | 1241 | } |
1242 | 1242 | ||
1243 | /* If we are currently associated and the new config requires | 1243 | /* If we are currently associated and the new config requires |
@@ -1317,6 +1317,7 @@ static int iwl4965_commit_rxon(struct iwl_priv *priv, struct iwl_rxon_context *c | |||
1317 | 1317 | ||
1318 | iwl4965_init_sensitivity(priv); | 1318 | iwl4965_init_sensitivity(priv); |
1319 | 1319 | ||
1320 | set_tx_power: | ||
1320 | /* If we issue a new RXON command which required a tune then we must | 1321 | /* If we issue a new RXON command which required a tune then we must |
1321 | * send a new TXPOWER command or we won't be able to Tx any frames */ | 1322 | * send a new TXPOWER command or we won't be able to Tx any frames */ |
1322 | ret = iwl_legacy_set_tx_power(priv, priv->tx_power_next, true); | 1323 | ret = iwl_legacy_set_tx_power(priv, priv->tx_power_next, true); |
@@ -1403,9 +1404,6 @@ static int iwl4965_hw_channel_switch(struct iwl_priv *priv, | |||
1403 | return rc; | 1404 | return rc; |
1404 | } | 1405 | } |
1405 | 1406 | ||
1406 | priv->switch_rxon.channel = cmd.channel; | ||
1407 | priv->switch_rxon.switch_in_progress = true; | ||
1408 | |||
1409 | return iwl_legacy_send_cmd_pdu(priv, | 1407 | return iwl_legacy_send_cmd_pdu(priv, |
1410 | REPLY_CHANNEL_SWITCH, sizeof(cmd), &cmd); | 1408 | REPLY_CHANNEL_SWITCH, sizeof(cmd), &cmd); |
1411 | } | 1409 | } |
diff --git a/drivers/net/wireless/iwlegacy/iwl-core.c b/drivers/net/wireless/iwlegacy/iwl-core.c index 42df8321dae8..3be76bd5499a 100644 --- a/drivers/net/wireless/iwlegacy/iwl-core.c +++ b/drivers/net/wireless/iwlegacy/iwl-core.c | |||
@@ -859,12 +859,8 @@ void iwl_legacy_chswitch_done(struct iwl_priv *priv, bool is_success) | |||
859 | if (test_bit(STATUS_EXIT_PENDING, &priv->status)) | 859 | if (test_bit(STATUS_EXIT_PENDING, &priv->status)) |
860 | return; | 860 | return; |
861 | 861 | ||
862 | if (priv->switch_rxon.switch_in_progress) { | 862 | if (test_and_clear_bit(STATUS_CHANNEL_SWITCH_PENDING, &priv->status)) |
863 | ieee80211_chswitch_done(ctx->vif, is_success); | 863 | ieee80211_chswitch_done(ctx->vif, is_success); |
864 | mutex_lock(&priv->mutex); | ||
865 | priv->switch_rxon.switch_in_progress = false; | ||
866 | mutex_unlock(&priv->mutex); | ||
867 | } | ||
868 | } | 864 | } |
869 | EXPORT_SYMBOL(iwl_legacy_chswitch_done); | 865 | EXPORT_SYMBOL(iwl_legacy_chswitch_done); |
870 | 866 | ||
@@ -876,19 +872,19 @@ void iwl_legacy_rx_csa(struct iwl_priv *priv, struct iwl_rx_mem_buffer *rxb) | |||
876 | struct iwl_rxon_context *ctx = &priv->contexts[IWL_RXON_CTX_BSS]; | 872 | struct iwl_rxon_context *ctx = &priv->contexts[IWL_RXON_CTX_BSS]; |
877 | struct iwl_legacy_rxon_cmd *rxon = (void *)&ctx->active; | 873 | struct iwl_legacy_rxon_cmd *rxon = (void *)&ctx->active; |
878 | 874 | ||
879 | if (priv->switch_rxon.switch_in_progress) { | 875 | if (!test_bit(STATUS_CHANNEL_SWITCH_PENDING, &priv->status)) |
880 | if (!le32_to_cpu(csa->status) && | 876 | return; |
881 | (csa->channel == priv->switch_rxon.channel)) { | 877 | |
882 | rxon->channel = csa->channel; | 878 | if (!le32_to_cpu(csa->status) && csa->channel == priv->switch_channel) { |
883 | ctx->staging.channel = csa->channel; | 879 | rxon->channel = csa->channel; |
884 | IWL_DEBUG_11H(priv, "CSA notif: channel %d\n", | 880 | ctx->staging.channel = csa->channel; |
885 | le16_to_cpu(csa->channel)); | 881 | IWL_DEBUG_11H(priv, "CSA notif: channel %d\n", |
886 | iwl_legacy_chswitch_done(priv, true); | ||
887 | } else { | ||
888 | IWL_ERR(priv, "CSA notif (fail) : channel %d\n", | ||
889 | le16_to_cpu(csa->channel)); | 882 | le16_to_cpu(csa->channel)); |
890 | iwl_legacy_chswitch_done(priv, false); | 883 | iwl_legacy_chswitch_done(priv, true); |
891 | } | 884 | } else { |
885 | IWL_ERR(priv, "CSA notif (fail) : channel %d\n", | ||
886 | le16_to_cpu(csa->channel)); | ||
887 | iwl_legacy_chswitch_done(priv, false); | ||
892 | } | 888 | } |
893 | } | 889 | } |
894 | EXPORT_SYMBOL(iwl_legacy_rx_csa); | 890 | EXPORT_SYMBOL(iwl_legacy_rx_csa); |
diff --git a/drivers/net/wireless/iwlegacy/iwl-core.h b/drivers/net/wireless/iwlegacy/iwl-core.h index bc66c604106c..c5fbda0760de 100644 --- a/drivers/net/wireless/iwlegacy/iwl-core.h +++ b/drivers/net/wireless/iwlegacy/iwl-core.h | |||
@@ -560,7 +560,7 @@ void iwl_legacy_free_geos(struct iwl_priv *priv); | |||
560 | #define STATUS_SCAN_HW 15 | 560 | #define STATUS_SCAN_HW 15 |
561 | #define STATUS_POWER_PMI 16 | 561 | #define STATUS_POWER_PMI 16 |
562 | #define STATUS_FW_ERROR 17 | 562 | #define STATUS_FW_ERROR 17 |
563 | 563 | #define STATUS_CHANNEL_SWITCH_PENDING 18 | |
564 | 564 | ||
565 | static inline int iwl_legacy_is_ready(struct iwl_priv *priv) | 565 | static inline int iwl_legacy_is_ready(struct iwl_priv *priv) |
566 | { | 566 | { |
diff --git a/drivers/net/wireless/iwlegacy/iwl-dev.h b/drivers/net/wireless/iwlegacy/iwl-dev.h index be0106c6a2da..ea30122669ee 100644 --- a/drivers/net/wireless/iwlegacy/iwl-dev.h +++ b/drivers/net/wireless/iwlegacy/iwl-dev.h | |||
@@ -855,17 +855,6 @@ struct traffic_stats { | |||
855 | }; | 855 | }; |
856 | 856 | ||
857 | /* | 857 | /* |
858 | * iwl_switch_rxon: "channel switch" structure | ||
859 | * | ||
860 | * @ switch_in_progress: channel switch in progress | ||
861 | * @ channel: new channel | ||
862 | */ | ||
863 | struct iwl_switch_rxon { | ||
864 | bool switch_in_progress; | ||
865 | __le16 channel; | ||
866 | }; | ||
867 | |||
868 | /* | ||
869 | * schedule the timer to wake up every UCODE_TRACE_PERIOD milliseconds | 858 | * schedule the timer to wake up every UCODE_TRACE_PERIOD milliseconds |
870 | * to perform continuous uCode event logging operation if enabled | 859 | * to perform continuous uCode event logging operation if enabled |
871 | */ | 860 | */ |
@@ -1115,7 +1104,7 @@ struct iwl_priv { | |||
1115 | 1104 | ||
1116 | struct iwl_rxon_context contexts[NUM_IWL_RXON_CTX]; | 1105 | struct iwl_rxon_context contexts[NUM_IWL_RXON_CTX]; |
1117 | 1106 | ||
1118 | struct iwl_switch_rxon switch_rxon; | 1107 | __le16 switch_channel; |
1119 | 1108 | ||
1120 | /* 1st responses from initialize and runtime uCode images. | 1109 | /* 1st responses from initialize and runtime uCode images. |
1121 | * _4965's initialize alive response contains some calibration data. */ | 1110 | * _4965's initialize alive response contains some calibration data. */ |
diff --git a/drivers/net/wireless/iwlegacy/iwl4965-base.c b/drivers/net/wireless/iwlegacy/iwl4965-base.c index af2ae22fcfd3..7157ba529680 100644 --- a/drivers/net/wireless/iwlegacy/iwl4965-base.c +++ b/drivers/net/wireless/iwlegacy/iwl4965-base.c | |||
@@ -2861,16 +2861,13 @@ void iwl4965_mac_channel_switch(struct ieee80211_hw *hw, | |||
2861 | goto out; | 2861 | goto out; |
2862 | 2862 | ||
2863 | if (test_bit(STATUS_EXIT_PENDING, &priv->status) || | 2863 | if (test_bit(STATUS_EXIT_PENDING, &priv->status) || |
2864 | test_bit(STATUS_SCANNING, &priv->status)) | 2864 | test_bit(STATUS_SCANNING, &priv->status) || |
2865 | test_bit(STATUS_CHANNEL_SWITCH_PENDING, &priv->status)) | ||
2865 | goto out; | 2866 | goto out; |
2866 | 2867 | ||
2867 | if (!iwl_legacy_is_associated_ctx(ctx)) | 2868 | if (!iwl_legacy_is_associated_ctx(ctx)) |
2868 | goto out; | 2869 | goto out; |
2869 | 2870 | ||
2870 | /* channel switch in progress */ | ||
2871 | if (priv->switch_rxon.switch_in_progress == true) | ||
2872 | goto out; | ||
2873 | |||
2874 | if (priv->cfg->ops->lib->set_channel_switch) { | 2871 | if (priv->cfg->ops->lib->set_channel_switch) { |
2875 | 2872 | ||
2876 | ch = channel->hw_value; | 2873 | ch = channel->hw_value; |
@@ -2919,15 +2916,18 @@ void iwl4965_mac_channel_switch(struct ieee80211_hw *hw, | |||
2919 | * at this point, staging_rxon has the | 2916 | * at this point, staging_rxon has the |
2920 | * configuration for channel switch | 2917 | * configuration for channel switch |
2921 | */ | 2918 | */ |
2922 | if (priv->cfg->ops->lib->set_channel_switch(priv, | 2919 | set_bit(STATUS_CHANNEL_SWITCH_PENDING, &priv->status); |
2923 | ch_switch)) | 2920 | priv->switch_channel = cpu_to_le16(ch); |
2924 | priv->switch_rxon.switch_in_progress = false; | 2921 | if (priv->cfg->ops->lib->set_channel_switch(priv, ch_switch)) { |
2922 | clear_bit(STATUS_CHANNEL_SWITCH_PENDING, | ||
2923 | &priv->status); | ||
2924 | priv->switch_channel = 0; | ||
2925 | ieee80211_chswitch_done(ctx->vif, false); | ||
2926 | } | ||
2925 | } | 2927 | } |
2926 | } | 2928 | } |
2927 | out: | 2929 | out: |
2928 | mutex_unlock(&priv->mutex); | 2930 | mutex_unlock(&priv->mutex); |
2929 | if (!priv->switch_rxon.switch_in_progress) | ||
2930 | ieee80211_chswitch_done(ctx->vif, false); | ||
2931 | IWL_DEBUG_MAC80211(priv, "leave\n"); | 2931 | IWL_DEBUG_MAC80211(priv, "leave\n"); |
2932 | } | 2932 | } |
2933 | 2933 | ||
diff --git a/drivers/net/wireless/iwlwifi/iwl-1000.c b/drivers/net/wireless/iwlwifi/iwl-1000.c index 61d4a11f566b..2a88e73bb39c 100644 --- a/drivers/net/wireless/iwlwifi/iwl-1000.c +++ b/drivers/net/wireless/iwlwifi/iwl-1000.c | |||
@@ -36,6 +36,7 @@ | |||
36 | #include <net/mac80211.h> | 36 | #include <net/mac80211.h> |
37 | #include <linux/etherdevice.h> | 37 | #include <linux/etherdevice.h> |
38 | #include <asm/unaligned.h> | 38 | #include <asm/unaligned.h> |
39 | #include <linux/stringify.h> | ||
39 | 40 | ||
40 | #include "iwl-eeprom.h" | 41 | #include "iwl-eeprom.h" |
41 | #include "iwl-dev.h" | 42 | #include "iwl-dev.h" |
@@ -55,10 +56,10 @@ | |||
55 | #define IWL100_UCODE_API_MIN 5 | 56 | #define IWL100_UCODE_API_MIN 5 |
56 | 57 | ||
57 | #define IWL1000_FW_PRE "iwlwifi-1000-" | 58 | #define IWL1000_FW_PRE "iwlwifi-1000-" |
58 | #define IWL1000_MODULE_FIRMWARE(api) IWL1000_FW_PRE #api ".ucode" | 59 | #define IWL1000_MODULE_FIRMWARE(api) IWL1000_FW_PRE __stringify(api) ".ucode" |
59 | 60 | ||
60 | #define IWL100_FW_PRE "iwlwifi-100-" | 61 | #define IWL100_FW_PRE "iwlwifi-100-" |
61 | #define IWL100_MODULE_FIRMWARE(api) IWL100_FW_PRE #api ".ucode" | 62 | #define IWL100_MODULE_FIRMWARE(api) IWL100_FW_PRE __stringify(api) ".ucode" |
62 | 63 | ||
63 | 64 | ||
64 | /* | 65 | /* |
diff --git a/drivers/net/wireless/iwlwifi/iwl-2000.c b/drivers/net/wireless/iwlwifi/iwl-2000.c index 86feec86d130..3df76f53a41b 100644 --- a/drivers/net/wireless/iwlwifi/iwl-2000.c +++ b/drivers/net/wireless/iwlwifi/iwl-2000.c | |||
@@ -36,6 +36,7 @@ | |||
36 | #include <net/mac80211.h> | 36 | #include <net/mac80211.h> |
37 | #include <linux/etherdevice.h> | 37 | #include <linux/etherdevice.h> |
38 | #include <asm/unaligned.h> | 38 | #include <asm/unaligned.h> |
39 | #include <linux/stringify.h> | ||
39 | 40 | ||
40 | #include "iwl-eeprom.h" | 41 | #include "iwl-eeprom.h" |
41 | #include "iwl-dev.h" | 42 | #include "iwl-dev.h" |
@@ -58,13 +59,13 @@ | |||
58 | #define IWL105_UCODE_API_MIN 5 | 59 | #define IWL105_UCODE_API_MIN 5 |
59 | 60 | ||
60 | #define IWL2030_FW_PRE "iwlwifi-2030-" | 61 | #define IWL2030_FW_PRE "iwlwifi-2030-" |
61 | #define IWL2030_MODULE_FIRMWARE(api) IWL2030_FW_PRE #api ".ucode" | 62 | #define IWL2030_MODULE_FIRMWARE(api) IWL2030_FW_PRE __stringify(api) ".ucode" |
62 | 63 | ||
63 | #define IWL2000_FW_PRE "iwlwifi-2000-" | 64 | #define IWL2000_FW_PRE "iwlwifi-2000-" |
64 | #define IWL2000_MODULE_FIRMWARE(api) IWL2000_FW_PRE #api ".ucode" | 65 | #define IWL2000_MODULE_FIRMWARE(api) IWL2000_FW_PRE __stringify(api) ".ucode" |
65 | 66 | ||
66 | #define IWL105_FW_PRE "iwlwifi-105-" | 67 | #define IWL105_FW_PRE "iwlwifi-105-" |
67 | #define IWL105_MODULE_FIRMWARE(api) IWL105_FW_PRE #api ".ucode" | 68 | #define IWL105_MODULE_FIRMWARE(api) IWL105_FW_PRE __stringify(api) ".ucode" |
68 | 69 | ||
69 | static void iwl2000_set_ct_threshold(struct iwl_priv *priv) | 70 | static void iwl2000_set_ct_threshold(struct iwl_priv *priv) |
70 | { | 71 | { |
@@ -177,79 +178,6 @@ static int iwl2000_hw_set_hw_params(struct iwl_priv *priv) | |||
177 | return 0; | 178 | return 0; |
178 | } | 179 | } |
179 | 180 | ||
180 | static int iwl2030_hw_channel_switch(struct iwl_priv *priv, | ||
181 | struct ieee80211_channel_switch *ch_switch) | ||
182 | { | ||
183 | /* | ||
184 | * MULTI-FIXME | ||
185 | * See iwl_mac_channel_switch. | ||
186 | */ | ||
187 | struct iwl_rxon_context *ctx = &priv->contexts[IWL_RXON_CTX_BSS]; | ||
188 | struct iwl6000_channel_switch_cmd cmd; | ||
189 | const struct iwl_channel_info *ch_info; | ||
190 | u32 switch_time_in_usec, ucode_switch_time; | ||
191 | u16 ch; | ||
192 | u32 tsf_low; | ||
193 | u8 switch_count; | ||
194 | u16 beacon_interval = le16_to_cpu(ctx->timing.beacon_interval); | ||
195 | struct ieee80211_vif *vif = ctx->vif; | ||
196 | struct iwl_host_cmd hcmd = { | ||
197 | .id = REPLY_CHANNEL_SWITCH, | ||
198 | .len = { sizeof(cmd), }, | ||
199 | .flags = CMD_SYNC, | ||
200 | .data = { &cmd, }, | ||
201 | }; | ||
202 | |||
203 | cmd.band = priv->band == IEEE80211_BAND_2GHZ; | ||
204 | ch = ch_switch->channel->hw_value; | ||
205 | IWL_DEBUG_11H(priv, "channel switch from %u to %u\n", | ||
206 | ctx->active.channel, ch); | ||
207 | cmd.channel = cpu_to_le16(ch); | ||
208 | cmd.rxon_flags = ctx->staging.flags; | ||
209 | cmd.rxon_filter_flags = ctx->staging.filter_flags; | ||
210 | switch_count = ch_switch->count; | ||
211 | tsf_low = ch_switch->timestamp & 0x0ffffffff; | ||
212 | /* | ||
213 | * calculate the ucode channel switch time | ||
214 | * adding TSF as one of the factor for when to switch | ||
215 | */ | ||
216 | if ((priv->ucode_beacon_time > tsf_low) && beacon_interval) { | ||
217 | if (switch_count > ((priv->ucode_beacon_time - tsf_low) / | ||
218 | beacon_interval)) { | ||
219 | switch_count -= (priv->ucode_beacon_time - | ||
220 | tsf_low) / beacon_interval; | ||
221 | } else | ||
222 | switch_count = 0; | ||
223 | } | ||
224 | if (switch_count <= 1) | ||
225 | cmd.switch_time = cpu_to_le32(priv->ucode_beacon_time); | ||
226 | else { | ||
227 | switch_time_in_usec = | ||
228 | vif->bss_conf.beacon_int * switch_count * TIME_UNIT; | ||
229 | ucode_switch_time = iwl_usecs_to_beacons(priv, | ||
230 | switch_time_in_usec, | ||
231 | beacon_interval); | ||
232 | cmd.switch_time = iwl_add_beacon_time(priv, | ||
233 | priv->ucode_beacon_time, | ||
234 | ucode_switch_time, | ||
235 | beacon_interval); | ||
236 | } | ||
237 | IWL_DEBUG_11H(priv, "uCode time for the switch is 0x%x\n", | ||
238 | cmd.switch_time); | ||
239 | ch_info = iwl_get_channel_info(priv, priv->band, ch); | ||
240 | if (ch_info) | ||
241 | cmd.expect_beacon = is_channel_radar(ch_info); | ||
242 | else { | ||
243 | IWL_ERR(priv, "invalid channel switch from %u to %u\n", | ||
244 | ctx->active.channel, ch); | ||
245 | return -EFAULT; | ||
246 | } | ||
247 | priv->switch_rxon.channel = cmd.channel; | ||
248 | priv->switch_rxon.switch_in_progress = true; | ||
249 | |||
250 | return iwl_send_cmd_sync(priv, &hcmd); | ||
251 | } | ||
252 | |||
253 | static struct iwl_lib_ops iwl2000_lib = { | 181 | static struct iwl_lib_ops iwl2000_lib = { |
254 | .set_hw_params = iwl2000_hw_set_hw_params, | 182 | .set_hw_params = iwl2000_hw_set_hw_params, |
255 | .rx_handler_setup = iwlagn_rx_handler_setup, | 183 | .rx_handler_setup = iwlagn_rx_handler_setup, |
@@ -258,7 +186,6 @@ static struct iwl_lib_ops iwl2000_lib = { | |||
258 | .is_valid_rtc_data_addr = iwlagn_hw_valid_rtc_data_addr, | 186 | .is_valid_rtc_data_addr = iwlagn_hw_valid_rtc_data_addr, |
259 | .send_tx_power = iwlagn_send_tx_power, | 187 | .send_tx_power = iwlagn_send_tx_power, |
260 | .update_chain_flags = iwl_update_chain_flags, | 188 | .update_chain_flags = iwl_update_chain_flags, |
261 | .set_channel_switch = iwl2030_hw_channel_switch, | ||
262 | .apm_ops = { | 189 | .apm_ops = { |
263 | .init = iwl_apm_init, | 190 | .init = iwl_apm_init, |
264 | .config = iwl2000_nic_config, | 191 | .config = iwl2000_nic_config, |
diff --git a/drivers/net/wireless/iwlwifi/iwl-5000.c b/drivers/net/wireless/iwlwifi/iwl-5000.c index a70b8cfafda1..e816c27db794 100644 --- a/drivers/net/wireless/iwlwifi/iwl-5000.c +++ b/drivers/net/wireless/iwlwifi/iwl-5000.c | |||
@@ -37,6 +37,7 @@ | |||
37 | #include <net/mac80211.h> | 37 | #include <net/mac80211.h> |
38 | #include <linux/etherdevice.h> | 38 | #include <linux/etherdevice.h> |
39 | #include <asm/unaligned.h> | 39 | #include <asm/unaligned.h> |
40 | #include <linux/stringify.h> | ||
40 | 41 | ||
41 | #include "iwl-eeprom.h" | 42 | #include "iwl-eeprom.h" |
42 | #include "iwl-dev.h" | 43 | #include "iwl-dev.h" |
@@ -57,10 +58,10 @@ | |||
57 | #define IWL5150_UCODE_API_MIN 1 | 58 | #define IWL5150_UCODE_API_MIN 1 |
58 | 59 | ||
59 | #define IWL5000_FW_PRE "iwlwifi-5000-" | 60 | #define IWL5000_FW_PRE "iwlwifi-5000-" |
60 | #define IWL5000_MODULE_FIRMWARE(api) IWL5000_FW_PRE #api ".ucode" | 61 | #define IWL5000_MODULE_FIRMWARE(api) IWL5000_FW_PRE __stringify(api) ".ucode" |
61 | 62 | ||
62 | #define IWL5150_FW_PRE "iwlwifi-5150-" | 63 | #define IWL5150_FW_PRE "iwlwifi-5150-" |
63 | #define IWL5150_MODULE_FIRMWARE(api) IWL5150_FW_PRE #api ".ucode" | 64 | #define IWL5150_MODULE_FIRMWARE(api) IWL5150_FW_PRE __stringify(api) ".ucode" |
64 | 65 | ||
65 | /* NIC configuration for 5000 series */ | 66 | /* NIC configuration for 5000 series */ |
66 | static void iwl5000_nic_config(struct iwl_priv *priv) | 67 | static void iwl5000_nic_config(struct iwl_priv *priv) |
@@ -331,8 +332,6 @@ static int iwl5000_hw_channel_switch(struct iwl_priv *priv, | |||
331 | ctx->active.channel, ch); | 332 | ctx->active.channel, ch); |
332 | return -EFAULT; | 333 | return -EFAULT; |
333 | } | 334 | } |
334 | priv->switch_rxon.channel = cmd.channel; | ||
335 | priv->switch_rxon.switch_in_progress = true; | ||
336 | 335 | ||
337 | return iwl_send_cmd_sync(priv, &hcmd); | 336 | return iwl_send_cmd_sync(priv, &hcmd); |
338 | } | 337 | } |
@@ -425,7 +424,6 @@ static struct iwl_base_params iwl5000_base_params = { | |||
425 | }; | 424 | }; |
426 | static struct iwl_ht_params iwl5000_ht_params = { | 425 | static struct iwl_ht_params iwl5000_ht_params = { |
427 | .ht_greenfield_support = true, | 426 | .ht_greenfield_support = true, |
428 | .use_rts_for_aggregation = true, /* use rts/cts protection */ | ||
429 | }; | 427 | }; |
430 | 428 | ||
431 | #define IWL_DEVICE_5000 \ | 429 | #define IWL_DEVICE_5000 \ |
diff --git a/drivers/net/wireless/iwlwifi/iwl-6000.c b/drivers/net/wireless/iwlwifi/iwl-6000.c index fda6fe08cf91..5b150bc70b06 100644 --- a/drivers/net/wireless/iwlwifi/iwl-6000.c +++ b/drivers/net/wireless/iwlwifi/iwl-6000.c | |||
@@ -36,6 +36,7 @@ | |||
36 | #include <net/mac80211.h> | 36 | #include <net/mac80211.h> |
37 | #include <linux/etherdevice.h> | 37 | #include <linux/etherdevice.h> |
38 | #include <asm/unaligned.h> | 38 | #include <asm/unaligned.h> |
39 | #include <linux/stringify.h> | ||
39 | 40 | ||
40 | #include "iwl-eeprom.h" | 41 | #include "iwl-eeprom.h" |
41 | #include "iwl-dev.h" | 42 | #include "iwl-dev.h" |
@@ -58,16 +59,16 @@ | |||
58 | #define IWL6000G2_UCODE_API_MIN 4 | 59 | #define IWL6000G2_UCODE_API_MIN 4 |
59 | 60 | ||
60 | #define IWL6000_FW_PRE "iwlwifi-6000-" | 61 | #define IWL6000_FW_PRE "iwlwifi-6000-" |
61 | #define IWL6000_MODULE_FIRMWARE(api) IWL6000_FW_PRE #api ".ucode" | 62 | #define IWL6000_MODULE_FIRMWARE(api) IWL6000_FW_PRE __stringify(api) ".ucode" |
62 | 63 | ||
63 | #define IWL6050_FW_PRE "iwlwifi-6050-" | 64 | #define IWL6050_FW_PRE "iwlwifi-6050-" |
64 | #define IWL6050_MODULE_FIRMWARE(api) IWL6050_FW_PRE #api ".ucode" | 65 | #define IWL6050_MODULE_FIRMWARE(api) IWL6050_FW_PRE __stringify(api) ".ucode" |
65 | 66 | ||
66 | #define IWL6005_FW_PRE "iwlwifi-6000g2a-" | 67 | #define IWL6005_FW_PRE "iwlwifi-6000g2a-" |
67 | #define IWL6005_MODULE_FIRMWARE(api) IWL6005_FW_PRE #api ".ucode" | 68 | #define IWL6005_MODULE_FIRMWARE(api) IWL6005_FW_PRE __stringify(api) ".ucode" |
68 | 69 | ||
69 | #define IWL6030_FW_PRE "iwlwifi-6000g2b-" | 70 | #define IWL6030_FW_PRE "iwlwifi-6000g2b-" |
70 | #define IWL6030_MODULE_FIRMWARE(api) IWL6030_FW_PRE #api ".ucode" | 71 | #define IWL6030_MODULE_FIRMWARE(api) IWL6030_FW_PRE __stringify(api) ".ucode" |
71 | 72 | ||
72 | static void iwl6000_set_ct_threshold(struct iwl_priv *priv) | 73 | static void iwl6000_set_ct_threshold(struct iwl_priv *priv) |
73 | { | 74 | { |
@@ -270,8 +271,6 @@ static int iwl6000_hw_channel_switch(struct iwl_priv *priv, | |||
270 | ctx->active.channel, ch); | 271 | ctx->active.channel, ch); |
271 | return -EFAULT; | 272 | return -EFAULT; |
272 | } | 273 | } |
273 | priv->switch_rxon.channel = cmd.channel; | ||
274 | priv->switch_rxon.switch_in_progress = true; | ||
275 | 274 | ||
276 | return iwl_send_cmd_sync(priv, &hcmd); | 275 | return iwl_send_cmd_sync(priv, &hcmd); |
277 | } | 276 | } |
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn-hcmd.c b/drivers/net/wireless/iwlwifi/iwl-agn-hcmd.c index b12c72d63ccb..23fa93deae96 100644 --- a/drivers/net/wireless/iwlwifi/iwl-agn-hcmd.c +++ b/drivers/net/wireless/iwlwifi/iwl-agn-hcmd.c | |||
@@ -163,17 +163,9 @@ static void iwlagn_tx_cmd_protection(struct iwl_priv *priv, | |||
163 | __le16 fc, __le32 *tx_flags) | 163 | __le16 fc, __le32 *tx_flags) |
164 | { | 164 | { |
165 | if (info->control.rates[0].flags & IEEE80211_TX_RC_USE_RTS_CTS || | 165 | if (info->control.rates[0].flags & IEEE80211_TX_RC_USE_RTS_CTS || |
166 | info->control.rates[0].flags & IEEE80211_TX_RC_USE_CTS_PROTECT) { | 166 | info->control.rates[0].flags & IEEE80211_TX_RC_USE_CTS_PROTECT || |
167 | info->flags & IEEE80211_TX_CTL_AMPDU) | ||
167 | *tx_flags |= TX_CMD_FLG_PROT_REQUIRE_MSK; | 168 | *tx_flags |= TX_CMD_FLG_PROT_REQUIRE_MSK; |
168 | return; | ||
169 | } | ||
170 | |||
171 | if (priv->cfg->ht_params && | ||
172 | priv->cfg->ht_params->use_rts_for_aggregation && | ||
173 | info->flags & IEEE80211_TX_CTL_AMPDU) { | ||
174 | *tx_flags |= TX_CMD_FLG_PROT_REQUIRE_MSK; | ||
175 | return; | ||
176 | } | ||
177 | } | 169 | } |
178 | 170 | ||
179 | /* Calc max signal level (dBm) among 3 possible receivers */ | 171 | /* Calc max signal level (dBm) among 3 possible receivers */ |
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn-rxon.c b/drivers/net/wireless/iwlwifi/iwl-agn-rxon.c index a95ad84c5377..09f679d6046f 100644 --- a/drivers/net/wireless/iwlwifi/iwl-agn-rxon.c +++ b/drivers/net/wireless/iwlwifi/iwl-agn-rxon.c | |||
@@ -325,6 +325,14 @@ int iwlagn_commit_rxon(struct iwl_priv *priv, struct iwl_rxon_context *ctx) | |||
325 | return 0; | 325 | return 0; |
326 | } | 326 | } |
327 | 327 | ||
328 | /* | ||
329 | * force CTS-to-self frames protection if RTS-CTS is not preferred | ||
330 | * one aggregation protection method | ||
331 | */ | ||
332 | if (!(priv->cfg->ht_params && | ||
333 | priv->cfg->ht_params->use_rts_for_aggregation)) | ||
334 | ctx->staging.flags |= RXON_FLG_SELF_CTS_EN; | ||
335 | |||
328 | if ((ctx->vif && ctx->vif->bss_conf.use_short_slot) || | 336 | if ((ctx->vif && ctx->vif->bss_conf.use_short_slot) || |
329 | !(ctx->staging.flags & RXON_FLG_BAND_24G_MSK)) | 337 | !(ctx->staging.flags & RXON_FLG_BAND_24G_MSK)) |
330 | ctx->staging.flags |= RXON_FLG_SHORT_SLOT_MSK; | 338 | ctx->staging.flags |= RXON_FLG_SHORT_SLOT_MSK; |
@@ -342,10 +350,10 @@ int iwlagn_commit_rxon(struct iwl_priv *priv, struct iwl_rxon_context *ctx) | |||
342 | * receive commit_rxon request | 350 | * receive commit_rxon request |
343 | * abort any previous channel switch if still in process | 351 | * abort any previous channel switch if still in process |
344 | */ | 352 | */ |
345 | if (priv->switch_rxon.switch_in_progress && | 353 | if (test_bit(STATUS_CHANNEL_SWITCH_PENDING, &priv->status) && |
346 | (priv->switch_rxon.channel != ctx->staging.channel)) { | 354 | (priv->switch_channel != ctx->staging.channel)) { |
347 | IWL_DEBUG_11H(priv, "abort channel switch on %d\n", | 355 | IWL_DEBUG_11H(priv, "abort channel switch on %d\n", |
348 | le16_to_cpu(priv->switch_rxon.channel)); | 356 | le16_to_cpu(priv->switch_channel)); |
349 | iwl_chswitch_done(priv, false); | 357 | iwl_chswitch_done(priv, false); |
350 | } | 358 | } |
351 | 359 | ||
@@ -362,6 +370,11 @@ int iwlagn_commit_rxon(struct iwl_priv *priv, struct iwl_rxon_context *ctx) | |||
362 | } | 370 | } |
363 | 371 | ||
364 | memcpy(active, &ctx->staging, sizeof(*active)); | 372 | memcpy(active, &ctx->staging, sizeof(*active)); |
373 | /* | ||
374 | * We do not commit tx power settings while channel changing, | ||
375 | * do it now if after settings changed. | ||
376 | */ | ||
377 | iwl_set_tx_power(priv, priv->tx_power_next, false); | ||
365 | return 0; | 378 | return 0; |
366 | } | 379 | } |
367 | 380 | ||
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn.c b/drivers/net/wireless/iwlwifi/iwl-agn.c index a662adcb2adb..8e1942ebd9a0 100644 --- a/drivers/net/wireless/iwlwifi/iwl-agn.c +++ b/drivers/net/wireless/iwlwifi/iwl-agn.c | |||
@@ -2843,16 +2843,13 @@ static void iwlagn_mac_channel_switch(struct ieee80211_hw *hw, | |||
2843 | goto out; | 2843 | goto out; |
2844 | 2844 | ||
2845 | if (test_bit(STATUS_EXIT_PENDING, &priv->status) || | 2845 | if (test_bit(STATUS_EXIT_PENDING, &priv->status) || |
2846 | test_bit(STATUS_SCANNING, &priv->status)) | 2846 | test_bit(STATUS_SCANNING, &priv->status) || |
2847 | test_bit(STATUS_CHANNEL_SWITCH_PENDING, &priv->status)) | ||
2847 | goto out; | 2848 | goto out; |
2848 | 2849 | ||
2849 | if (!iwl_is_associated_ctx(ctx)) | 2850 | if (!iwl_is_associated_ctx(ctx)) |
2850 | goto out; | 2851 | goto out; |
2851 | 2852 | ||
2852 | /* channel switch in progress */ | ||
2853 | if (priv->switch_rxon.switch_in_progress == true) | ||
2854 | goto out; | ||
2855 | |||
2856 | if (priv->cfg->ops->lib->set_channel_switch) { | 2853 | if (priv->cfg->ops->lib->set_channel_switch) { |
2857 | 2854 | ||
2858 | ch = channel->hw_value; | 2855 | ch = channel->hw_value; |
@@ -2901,15 +2898,19 @@ static void iwlagn_mac_channel_switch(struct ieee80211_hw *hw, | |||
2901 | * at this point, staging_rxon has the | 2898 | * at this point, staging_rxon has the |
2902 | * configuration for channel switch | 2899 | * configuration for channel switch |
2903 | */ | 2900 | */ |
2901 | set_bit(STATUS_CHANNEL_SWITCH_PENDING, &priv->status); | ||
2902 | priv->switch_channel = cpu_to_le16(ch); | ||
2904 | if (priv->cfg->ops->lib->set_channel_switch(priv, | 2903 | if (priv->cfg->ops->lib->set_channel_switch(priv, |
2905 | ch_switch)) | 2904 | ch_switch)) { |
2906 | priv->switch_rxon.switch_in_progress = false; | 2905 | clear_bit(STATUS_CHANNEL_SWITCH_PENDING, |
2906 | &priv->status); | ||
2907 | priv->switch_channel = 0; | ||
2908 | ieee80211_chswitch_done(ctx->vif, false); | ||
2909 | } | ||
2907 | } | 2910 | } |
2908 | } | 2911 | } |
2909 | out: | 2912 | out: |
2910 | mutex_unlock(&priv->mutex); | 2913 | mutex_unlock(&priv->mutex); |
2911 | if (!priv->switch_rxon.switch_in_progress) | ||
2912 | ieee80211_chswitch_done(ctx->vif, false); | ||
2913 | IWL_DEBUG_MAC80211(priv, "leave\n"); | 2914 | IWL_DEBUG_MAC80211(priv, "leave\n"); |
2914 | } | 2915 | } |
2915 | 2916 | ||
diff --git a/drivers/net/wireless/iwlwifi/iwl-core.c b/drivers/net/wireless/iwlwifi/iwl-core.c index 4653deada05b..45cc51c9c93e 100644 --- a/drivers/net/wireless/iwlwifi/iwl-core.c +++ b/drivers/net/wireless/iwlwifi/iwl-core.c | |||
@@ -843,12 +843,8 @@ void iwl_chswitch_done(struct iwl_priv *priv, bool is_success) | |||
843 | if (test_bit(STATUS_EXIT_PENDING, &priv->status)) | 843 | if (test_bit(STATUS_EXIT_PENDING, &priv->status)) |
844 | return; | 844 | return; |
845 | 845 | ||
846 | if (priv->switch_rxon.switch_in_progress) { | 846 | if (test_and_clear_bit(STATUS_CHANNEL_SWITCH_PENDING, &priv->status)) |
847 | ieee80211_chswitch_done(ctx->vif, is_success); | 847 | ieee80211_chswitch_done(ctx->vif, is_success); |
848 | mutex_lock(&priv->mutex); | ||
849 | priv->switch_rxon.switch_in_progress = false; | ||
850 | mutex_unlock(&priv->mutex); | ||
851 | } | ||
852 | } | 848 | } |
853 | 849 | ||
854 | #ifdef CONFIG_IWLWIFI_DEBUG | 850 | #ifdef CONFIG_IWLWIFI_DEBUG |
@@ -1767,6 +1763,7 @@ int iwl_mac_change_interface(struct ieee80211_hw *hw, struct ieee80211_vif *vif, | |||
1767 | struct iwl_rxon_context *ctx = iwl_rxon_ctx_from_vif(vif); | 1763 | struct iwl_rxon_context *ctx = iwl_rxon_ctx_from_vif(vif); |
1768 | struct iwl_rxon_context *bss_ctx = &priv->contexts[IWL_RXON_CTX_BSS]; | 1764 | struct iwl_rxon_context *bss_ctx = &priv->contexts[IWL_RXON_CTX_BSS]; |
1769 | struct iwl_rxon_context *tmp; | 1765 | struct iwl_rxon_context *tmp; |
1766 | enum nl80211_iftype newviftype = newtype; | ||
1770 | u32 interface_modes; | 1767 | u32 interface_modes; |
1771 | int err; | 1768 | int err; |
1772 | 1769 | ||
@@ -1822,7 +1819,7 @@ int iwl_mac_change_interface(struct ieee80211_hw *hw, struct ieee80211_vif *vif, | |||
1822 | 1819 | ||
1823 | /* success */ | 1820 | /* success */ |
1824 | iwl_teardown_interface(priv, vif, true); | 1821 | iwl_teardown_interface(priv, vif, true); |
1825 | vif->type = newtype; | 1822 | vif->type = newviftype; |
1826 | vif->p2p = newp2p; | 1823 | vif->p2p = newp2p; |
1827 | err = iwl_setup_interface(priv, ctx); | 1824 | err = iwl_setup_interface(priv, ctx); |
1828 | WARN_ON(err); | 1825 | WARN_ON(err); |
diff --git a/drivers/net/wireless/iwlwifi/iwl-core.h b/drivers/net/wireless/iwlwifi/iwl-core.h index 3bb76f6ea410..a54d416ec345 100644 --- a/drivers/net/wireless/iwlwifi/iwl-core.h +++ b/drivers/net/wireless/iwlwifi/iwl-core.h | |||
@@ -560,6 +560,7 @@ void iwlcore_free_geos(struct iwl_priv *priv); | |||
560 | #define STATUS_POWER_PMI 16 | 560 | #define STATUS_POWER_PMI 16 |
561 | #define STATUS_FW_ERROR 17 | 561 | #define STATUS_FW_ERROR 17 |
562 | #define STATUS_DEVICE_ENABLED 18 | 562 | #define STATUS_DEVICE_ENABLED 18 |
563 | #define STATUS_CHANNEL_SWITCH_PENDING 19 | ||
563 | 564 | ||
564 | 565 | ||
565 | static inline int iwl_is_ready(struct iwl_priv *priv) | 566 | static inline int iwl_is_ready(struct iwl_priv *priv) |
diff --git a/drivers/net/wireless/iwlwifi/iwl-dev.h b/drivers/net/wireless/iwlwifi/iwl-dev.h index 22a6e3ec7094..c8de236c141b 100644 --- a/drivers/net/wireless/iwlwifi/iwl-dev.h +++ b/drivers/net/wireless/iwlwifi/iwl-dev.h | |||
@@ -982,17 +982,6 @@ struct traffic_stats { | |||
982 | }; | 982 | }; |
983 | 983 | ||
984 | /* | 984 | /* |
985 | * iwl_switch_rxon: "channel switch" structure | ||
986 | * | ||
987 | * @ switch_in_progress: channel switch in progress | ||
988 | * @ channel: new channel | ||
989 | */ | ||
990 | struct iwl_switch_rxon { | ||
991 | bool switch_in_progress; | ||
992 | __le16 channel; | ||
993 | }; | ||
994 | |||
995 | /* | ||
996 | * schedule the timer to wake up every UCODE_TRACE_PERIOD milliseconds | 985 | * schedule the timer to wake up every UCODE_TRACE_PERIOD milliseconds |
997 | * to perform continuous uCode event logging operation if enabled | 986 | * to perform continuous uCode event logging operation if enabled |
998 | */ | 987 | */ |
@@ -1287,7 +1276,7 @@ struct iwl_priv { | |||
1287 | 1276 | ||
1288 | struct iwl_rxon_context contexts[NUM_IWL_RXON_CTX]; | 1277 | struct iwl_rxon_context contexts[NUM_IWL_RXON_CTX]; |
1289 | 1278 | ||
1290 | struct iwl_switch_rxon switch_rxon; | 1279 | __le16 switch_channel; |
1291 | 1280 | ||
1292 | struct { | 1281 | struct { |
1293 | u32 error_event_table; | 1282 | u32 error_event_table; |
diff --git a/drivers/net/wireless/iwlwifi/iwl-rx.c b/drivers/net/wireless/iwlwifi/iwl-rx.c index 0053e9ea9021..b774517aa9fa 100644 --- a/drivers/net/wireless/iwlwifi/iwl-rx.c +++ b/drivers/net/wireless/iwlwifi/iwl-rx.c | |||
@@ -250,19 +250,19 @@ static void iwl_rx_csa(struct iwl_priv *priv, struct iwl_rx_mem_buffer *rxb) | |||
250 | struct iwl_rxon_context *ctx = &priv->contexts[IWL_RXON_CTX_BSS]; | 250 | struct iwl_rxon_context *ctx = &priv->contexts[IWL_RXON_CTX_BSS]; |
251 | struct iwl_rxon_cmd *rxon = (void *)&ctx->active; | 251 | struct iwl_rxon_cmd *rxon = (void *)&ctx->active; |
252 | 252 | ||
253 | if (priv->switch_rxon.switch_in_progress) { | 253 | if (!test_bit(STATUS_CHANNEL_SWITCH_PENDING, &priv->status)) |
254 | if (!le32_to_cpu(csa->status) && | 254 | return; |
255 | (csa->channel == priv->switch_rxon.channel)) { | 255 | |
256 | rxon->channel = csa->channel; | 256 | if (!le32_to_cpu(csa->status) && csa->channel == priv->switch_channel) { |
257 | ctx->staging.channel = csa->channel; | 257 | rxon->channel = csa->channel; |
258 | IWL_DEBUG_11H(priv, "CSA notif: channel %d\n", | 258 | ctx->staging.channel = csa->channel; |
259 | le16_to_cpu(csa->channel)); | 259 | IWL_DEBUG_11H(priv, "CSA notif: channel %d\n", |
260 | iwl_chswitch_done(priv, true); | ||
261 | } else { | ||
262 | IWL_ERR(priv, "CSA notif (fail) : channel %d\n", | ||
263 | le16_to_cpu(csa->channel)); | 260 | le16_to_cpu(csa->channel)); |
264 | iwl_chswitch_done(priv, false); | 261 | iwl_chswitch_done(priv, true); |
265 | } | 262 | } else { |
263 | IWL_ERR(priv, "CSA notif (fail) : channel %d\n", | ||
264 | le16_to_cpu(csa->channel)); | ||
265 | iwl_chswitch_done(priv, false); | ||
266 | } | 266 | } |
267 | } | 267 | } |
268 | 268 | ||
diff --git a/drivers/net/wireless/iwlwifi/iwl-tx.c b/drivers/net/wireless/iwlwifi/iwl-tx.c index 686e176b5ebd..137dba95b1ad 100644 --- a/drivers/net/wireless/iwlwifi/iwl-tx.c +++ b/drivers/net/wireless/iwlwifi/iwl-tx.c | |||
@@ -126,7 +126,7 @@ static inline u8 iwl_tfd_get_num_tbs(struct iwl_tfd *tfd) | |||
126 | } | 126 | } |
127 | 127 | ||
128 | static void iwlagn_unmap_tfd(struct iwl_priv *priv, struct iwl_cmd_meta *meta, | 128 | static void iwlagn_unmap_tfd(struct iwl_priv *priv, struct iwl_cmd_meta *meta, |
129 | struct iwl_tfd *tfd) | 129 | struct iwl_tfd *tfd, int dma_dir) |
130 | { | 130 | { |
131 | struct pci_dev *dev = priv->pci_dev; | 131 | struct pci_dev *dev = priv->pci_dev; |
132 | int i; | 132 | int i; |
@@ -151,7 +151,7 @@ static void iwlagn_unmap_tfd(struct iwl_priv *priv, struct iwl_cmd_meta *meta, | |||
151 | /* Unmap chunks, if any. */ | 151 | /* Unmap chunks, if any. */ |
152 | for (i = 1; i < num_tbs; i++) | 152 | for (i = 1; i < num_tbs; i++) |
153 | pci_unmap_single(dev, iwl_tfd_tb_get_addr(tfd, i), | 153 | pci_unmap_single(dev, iwl_tfd_tb_get_addr(tfd, i), |
154 | iwl_tfd_tb_get_len(tfd, i), PCI_DMA_TODEVICE); | 154 | iwl_tfd_tb_get_len(tfd, i), dma_dir); |
155 | } | 155 | } |
156 | 156 | ||
157 | /** | 157 | /** |
@@ -167,7 +167,8 @@ void iwlagn_txq_free_tfd(struct iwl_priv *priv, struct iwl_tx_queue *txq) | |||
167 | struct iwl_tfd *tfd_tmp = txq->tfds; | 167 | struct iwl_tfd *tfd_tmp = txq->tfds; |
168 | int index = txq->q.read_ptr; | 168 | int index = txq->q.read_ptr; |
169 | 169 | ||
170 | iwlagn_unmap_tfd(priv, &txq->meta[index], &tfd_tmp[index]); | 170 | iwlagn_unmap_tfd(priv, &txq->meta[index], &tfd_tmp[index], |
171 | PCI_DMA_TODEVICE); | ||
171 | 172 | ||
172 | /* free SKB */ | 173 | /* free SKB */ |
173 | if (txq->txb) { | 174 | if (txq->txb) { |
@@ -310,9 +311,7 @@ void iwl_cmd_queue_unmap(struct iwl_priv *priv) | |||
310 | i = get_cmd_index(q, q->read_ptr); | 311 | i = get_cmd_index(q, q->read_ptr); |
311 | 312 | ||
312 | if (txq->meta[i].flags & CMD_MAPPED) { | 313 | if (txq->meta[i].flags & CMD_MAPPED) { |
313 | pci_unmap_single(priv->pci_dev, | 314 | iwlagn_unmap_tfd(priv, &txq->meta[i], &txq->tfds[i], |
314 | dma_unmap_addr(&txq->meta[i], mapping), | ||
315 | dma_unmap_len(&txq->meta[i], len), | ||
316 | PCI_DMA_BIDIRECTIONAL); | 315 | PCI_DMA_BIDIRECTIONAL); |
317 | txq->meta[i].flags = 0; | 316 | txq->meta[i].flags = 0; |
318 | } | 317 | } |
@@ -535,12 +534,7 @@ out_free_arrays: | |||
535 | void iwl_tx_queue_reset(struct iwl_priv *priv, struct iwl_tx_queue *txq, | 534 | void iwl_tx_queue_reset(struct iwl_priv *priv, struct iwl_tx_queue *txq, |
536 | int slots_num, u32 txq_id) | 535 | int slots_num, u32 txq_id) |
537 | { | 536 | { |
538 | int actual_slots = slots_num; | 537 | memset(txq->meta, 0, sizeof(struct iwl_cmd_meta) * slots_num); |
539 | |||
540 | if (txq_id == priv->cmd_queue) | ||
541 | actual_slots++; | ||
542 | |||
543 | memset(txq->meta, 0, sizeof(struct iwl_cmd_meta) * actual_slots); | ||
544 | 538 | ||
545 | txq->need_update = 0; | 539 | txq->need_update = 0; |
546 | 540 | ||
@@ -700,10 +694,11 @@ int iwl_enqueue_hcmd(struct iwl_priv *priv, struct iwl_host_cmd *cmd) | |||
700 | if (!(cmd->dataflags[i] & IWL_HCMD_DFL_NOCOPY)) | 694 | if (!(cmd->dataflags[i] & IWL_HCMD_DFL_NOCOPY)) |
701 | continue; | 695 | continue; |
702 | phys_addr = pci_map_single(priv->pci_dev, (void *)cmd->data[i], | 696 | phys_addr = pci_map_single(priv->pci_dev, (void *)cmd->data[i], |
703 | cmd->len[i], PCI_DMA_TODEVICE); | 697 | cmd->len[i], PCI_DMA_BIDIRECTIONAL); |
704 | if (pci_dma_mapping_error(priv->pci_dev, phys_addr)) { | 698 | if (pci_dma_mapping_error(priv->pci_dev, phys_addr)) { |
705 | iwlagn_unmap_tfd(priv, out_meta, | 699 | iwlagn_unmap_tfd(priv, out_meta, |
706 | &txq->tfds[q->write_ptr]); | 700 | &txq->tfds[q->write_ptr], |
701 | PCI_DMA_BIDIRECTIONAL); | ||
707 | idx = -ENOMEM; | 702 | idx = -ENOMEM; |
708 | goto out; | 703 | goto out; |
709 | } | 704 | } |
@@ -807,7 +802,7 @@ void iwl_tx_cmd_complete(struct iwl_priv *priv, struct iwl_rx_mem_buffer *rxb) | |||
807 | cmd = txq->cmd[cmd_index]; | 802 | cmd = txq->cmd[cmd_index]; |
808 | meta = &txq->meta[cmd_index]; | 803 | meta = &txq->meta[cmd_index]; |
809 | 804 | ||
810 | iwlagn_unmap_tfd(priv, meta, &txq->tfds[index]); | 805 | iwlagn_unmap_tfd(priv, meta, &txq->tfds[index], PCI_DMA_BIDIRECTIONAL); |
811 | 806 | ||
812 | /* Input error checking is done when commands are added to queue. */ | 807 | /* Input error checking is done when commands are added to queue. */ |
813 | if (meta->flags & CMD_WANT_SKB) { | 808 | if (meta->flags & CMD_WANT_SKB) { |
diff --git a/drivers/net/wireless/libertas/if_sdio.c b/drivers/net/wireless/libertas/if_sdio.c index a7b5cb0c2753..224e9853c480 100644 --- a/drivers/net/wireless/libertas/if_sdio.c +++ b/drivers/net/wireless/libertas/if_sdio.c | |||
@@ -907,7 +907,7 @@ static void if_sdio_interrupt(struct sdio_func *func) | |||
907 | card = sdio_get_drvdata(func); | 907 | card = sdio_get_drvdata(func); |
908 | 908 | ||
909 | cause = sdio_readb(card->func, IF_SDIO_H_INT_STATUS, &ret); | 909 | cause = sdio_readb(card->func, IF_SDIO_H_INT_STATUS, &ret); |
910 | if (ret) | 910 | if (ret || !cause) |
911 | goto out; | 911 | goto out; |
912 | 912 | ||
913 | lbs_deb_sdio("interrupt: 0x%X\n", (unsigned)cause); | 913 | lbs_deb_sdio("interrupt: 0x%X\n", (unsigned)cause); |
@@ -1008,10 +1008,6 @@ static int if_sdio_probe(struct sdio_func *func, | |||
1008 | if (ret) | 1008 | if (ret) |
1009 | goto release; | 1009 | goto release; |
1010 | 1010 | ||
1011 | ret = sdio_claim_irq(func, if_sdio_interrupt); | ||
1012 | if (ret) | ||
1013 | goto disable; | ||
1014 | |||
1015 | /* For 1-bit transfers to the 8686 model, we need to enable the | 1011 | /* For 1-bit transfers to the 8686 model, we need to enable the |
1016 | * interrupt flag in the CCCR register. Set the MMC_QUIRK_LENIENT_FN0 | 1012 | * interrupt flag in the CCCR register. Set the MMC_QUIRK_LENIENT_FN0 |
1017 | * bit to allow access to non-vendor registers. */ | 1013 | * bit to allow access to non-vendor registers. */ |
@@ -1083,6 +1079,21 @@ static int if_sdio_probe(struct sdio_func *func, | |||
1083 | card->rx_unit = 0; | 1079 | card->rx_unit = 0; |
1084 | 1080 | ||
1085 | /* | 1081 | /* |
1082 | * Set up the interrupt handler late. | ||
1083 | * | ||
1084 | * If we set it up earlier, the (buggy) hardware generates a spurious | ||
1085 | * interrupt, even before the interrupt has been enabled, with | ||
1086 | * CCCR_INTx = 0. | ||
1087 | * | ||
1088 | * We register the interrupt handler late so that we can handle any | ||
1089 | * spurious interrupts, and also to avoid generation of that known | ||
1090 | * spurious interrupt in the first place. | ||
1091 | */ | ||
1092 | ret = sdio_claim_irq(func, if_sdio_interrupt); | ||
1093 | if (ret) | ||
1094 | goto disable; | ||
1095 | |||
1096 | /* | ||
1086 | * Enable interrupts now that everything is set up | 1097 | * Enable interrupts now that everything is set up |
1087 | */ | 1098 | */ |
1088 | sdio_writeb(func, 0x0f, IF_SDIO_H_INT_MASK, &ret); | 1099 | sdio_writeb(func, 0x0f, IF_SDIO_H_INT_MASK, &ret); |
diff --git a/drivers/net/wireless/mwifiex/cfg80211.c b/drivers/net/wireless/mwifiex/cfg80211.c index 660831ce293c..687c1f223497 100644 --- a/drivers/net/wireless/mwifiex/cfg80211.c +++ b/drivers/net/wireless/mwifiex/cfg80211.c | |||
@@ -1288,6 +1288,8 @@ int mwifiex_register_cfg80211(struct net_device *dev, u8 *mac, | |||
1288 | 1288 | ||
1289 | *(unsigned long *) wdev_priv = (unsigned long) priv; | 1289 | *(unsigned long *) wdev_priv = (unsigned long) priv; |
1290 | 1290 | ||
1291 | set_wiphy_dev(wdev->wiphy, (struct device *) priv->adapter->dev); | ||
1292 | |||
1291 | ret = wiphy_register(wdev->wiphy); | 1293 | ret = wiphy_register(wdev->wiphy); |
1292 | if (ret < 0) { | 1294 | if (ret < 0) { |
1293 | dev_err(priv->adapter->dev, "%s: registering cfg80211 device\n", | 1295 | dev_err(priv->adapter->dev, "%s: registering cfg80211 device\n", |
diff --git a/drivers/net/wireless/mwl8k.c b/drivers/net/wireless/mwl8k.c index 32261189bcef..aeac3cc4dbe4 100644 --- a/drivers/net/wireless/mwl8k.c +++ b/drivers/net/wireless/mwl8k.c | |||
@@ -2474,6 +2474,7 @@ struct mwl8k_cmd_set_hw_spec { | |||
2474 | * faster client. | 2474 | * faster client. |
2475 | */ | 2475 | */ |
2476 | #define MWL8K_SET_HW_SPEC_FLAG_ENABLE_LIFE_TIME_EXPIRY 0x00000400 | 2476 | #define MWL8K_SET_HW_SPEC_FLAG_ENABLE_LIFE_TIME_EXPIRY 0x00000400 |
2477 | #define MWL8K_SET_HW_SPEC_FLAG_GENERATE_CCMP_HDR 0x00000200 | ||
2477 | #define MWL8K_SET_HW_SPEC_FLAG_HOST_DECR_MGMT 0x00000080 | 2478 | #define MWL8K_SET_HW_SPEC_FLAG_HOST_DECR_MGMT 0x00000080 |
2478 | #define MWL8K_SET_HW_SPEC_FLAG_HOSTFORM_PROBERESP 0x00000020 | 2479 | #define MWL8K_SET_HW_SPEC_FLAG_HOSTFORM_PROBERESP 0x00000020 |
2479 | #define MWL8K_SET_HW_SPEC_FLAG_HOSTFORM_BEACON 0x00000010 | 2480 | #define MWL8K_SET_HW_SPEC_FLAG_HOSTFORM_BEACON 0x00000010 |
@@ -2510,7 +2511,8 @@ static int mwl8k_cmd_set_hw_spec(struct ieee80211_hw *hw) | |||
2510 | cmd->flags = cpu_to_le32(MWL8K_SET_HW_SPEC_FLAG_HOST_DECR_MGMT | | 2511 | cmd->flags = cpu_to_le32(MWL8K_SET_HW_SPEC_FLAG_HOST_DECR_MGMT | |
2511 | MWL8K_SET_HW_SPEC_FLAG_HOSTFORM_PROBERESP | | 2512 | MWL8K_SET_HW_SPEC_FLAG_HOSTFORM_PROBERESP | |
2512 | MWL8K_SET_HW_SPEC_FLAG_HOSTFORM_BEACON | | 2513 | MWL8K_SET_HW_SPEC_FLAG_HOSTFORM_BEACON | |
2513 | MWL8K_SET_HW_SPEC_FLAG_ENABLE_LIFE_TIME_EXPIRY); | 2514 | MWL8K_SET_HW_SPEC_FLAG_ENABLE_LIFE_TIME_EXPIRY | |
2515 | MWL8K_SET_HW_SPEC_FLAG_GENERATE_CCMP_HDR); | ||
2514 | cmd->num_tx_desc_per_queue = cpu_to_le32(MWL8K_TX_DESCS); | 2516 | cmd->num_tx_desc_per_queue = cpu_to_le32(MWL8K_TX_DESCS); |
2515 | cmd->total_rxd = cpu_to_le32(MWL8K_RX_DESCS); | 2517 | cmd->total_rxd = cpu_to_le32(MWL8K_RX_DESCS); |
2516 | 2518 | ||
diff --git a/drivers/net/wireless/rt2x00/rt2x00config.c b/drivers/net/wireless/rt2x00/rt2x00config.c index 555180d8f4aa..b704e5b183d0 100644 --- a/drivers/net/wireless/rt2x00/rt2x00config.c +++ b/drivers/net/wireless/rt2x00/rt2x00config.c | |||
@@ -250,7 +250,8 @@ void rt2x00lib_config(struct rt2x00_dev *rt2x00dev, | |||
250 | if (ieee80211_flags & IEEE80211_CONF_CHANGE_CHANNEL) | 250 | if (ieee80211_flags & IEEE80211_CONF_CHANGE_CHANNEL) |
251 | rt2x00link_reset_tuner(rt2x00dev, false); | 251 | rt2x00link_reset_tuner(rt2x00dev, false); |
252 | 252 | ||
253 | if (test_bit(REQUIRE_PS_AUTOWAKE, &rt2x00dev->cap_flags) && | 253 | if (test_bit(DEVICE_STATE_PRESENT, &rt2x00dev->flags) && |
254 | test_bit(REQUIRE_PS_AUTOWAKE, &rt2x00dev->cap_flags) && | ||
254 | (ieee80211_flags & IEEE80211_CONF_CHANGE_PS) && | 255 | (ieee80211_flags & IEEE80211_CONF_CHANGE_PS) && |
255 | (conf->flags & IEEE80211_CONF_PS)) { | 256 | (conf->flags & IEEE80211_CONF_PS)) { |
256 | beacon_diff = (long)jiffies - (long)rt2x00dev->last_beacon; | 257 | beacon_diff = (long)jiffies - (long)rt2x00dev->last_beacon; |
diff --git a/drivers/net/wireless/rt2x00/rt2x00dev.c b/drivers/net/wireless/rt2x00/rt2x00dev.c index c018d67aab8e..939821b4af2f 100644 --- a/drivers/net/wireless/rt2x00/rt2x00dev.c +++ b/drivers/net/wireless/rt2x00/rt2x00dev.c | |||
@@ -146,6 +146,9 @@ static void rt2x00lib_autowakeup(struct work_struct *work) | |||
146 | struct rt2x00_dev *rt2x00dev = | 146 | struct rt2x00_dev *rt2x00dev = |
147 | container_of(work, struct rt2x00_dev, autowakeup_work.work); | 147 | container_of(work, struct rt2x00_dev, autowakeup_work.work); |
148 | 148 | ||
149 | if (!test_bit(DEVICE_STATE_PRESENT, &rt2x00dev->flags)) | ||
150 | return; | ||
151 | |||
149 | if (rt2x00dev->ops->lib->set_device_state(rt2x00dev, STATE_AWAKE)) | 152 | if (rt2x00dev->ops->lib->set_device_state(rt2x00dev, STATE_AWAKE)) |
150 | ERROR(rt2x00dev, "Device failed to wakeup.\n"); | 153 | ERROR(rt2x00dev, "Device failed to wakeup.\n"); |
151 | clear_bit(CONFIG_POWERSAVING, &rt2x00dev->flags); | 154 | clear_bit(CONFIG_POWERSAVING, &rt2x00dev->flags); |
@@ -1160,6 +1163,7 @@ void rt2x00lib_remove_dev(struct rt2x00_dev *rt2x00dev) | |||
1160 | * Stop all work. | 1163 | * Stop all work. |
1161 | */ | 1164 | */ |
1162 | cancel_work_sync(&rt2x00dev->intf_work); | 1165 | cancel_work_sync(&rt2x00dev->intf_work); |
1166 | cancel_delayed_work_sync(&rt2x00dev->autowakeup_work); | ||
1163 | if (rt2x00_is_usb(rt2x00dev)) { | 1167 | if (rt2x00_is_usb(rt2x00dev)) { |
1164 | del_timer_sync(&rt2x00dev->txstatus_timer); | 1168 | del_timer_sync(&rt2x00dev->txstatus_timer); |
1165 | cancel_work_sync(&rt2x00dev->rxdone_work); | 1169 | cancel_work_sync(&rt2x00dev->rxdone_work); |
diff --git a/drivers/net/wireless/rtlwifi/pci.c b/drivers/net/wireless/rtlwifi/pci.c index 89100e7c553b..254b64ba4bf6 100644 --- a/drivers/net/wireless/rtlwifi/pci.c +++ b/drivers/net/wireless/rtlwifi/pci.c | |||
@@ -669,6 +669,19 @@ static void _rtl_pci_rx_interrupt(struct ieee80211_hw *hw) | |||
669 | &rx_status, | 669 | &rx_status, |
670 | (u8 *) pdesc, skb); | 670 | (u8 *) pdesc, skb); |
671 | 671 | ||
672 | new_skb = dev_alloc_skb(rtlpci->rxbuffersize); | ||
673 | if (unlikely(!new_skb)) { | ||
674 | RT_TRACE(rtlpriv, (COMP_INTR | COMP_RECV), | ||
675 | DBG_DMESG, | ||
676 | ("can't alloc skb for rx\n")); | ||
677 | goto done; | ||
678 | } | ||
679 | |||
680 | pci_unmap_single(rtlpci->pdev, | ||
681 | *((dma_addr_t *) skb->cb), | ||
682 | rtlpci->rxbuffersize, | ||
683 | PCI_DMA_FROMDEVICE); | ||
684 | |||
672 | skb_put(skb, rtlpriv->cfg->ops->get_desc((u8 *) pdesc, | 685 | skb_put(skb, rtlpriv->cfg->ops->get_desc((u8 *) pdesc, |
673 | false, | 686 | false, |
674 | HW_DESC_RXPKT_LEN)); | 687 | HW_DESC_RXPKT_LEN)); |
@@ -685,22 +698,7 @@ static void _rtl_pci_rx_interrupt(struct ieee80211_hw *hw) | |||
685 | hdr = rtl_get_hdr(skb); | 698 | hdr = rtl_get_hdr(skb); |
686 | fc = rtl_get_fc(skb); | 699 | fc = rtl_get_fc(skb); |
687 | 700 | ||
688 | /* try for new buffer - if allocation fails, drop | 701 | if (!stats.crc && !stats.hwerror) { |
689 | * frame and reuse old buffer | ||
690 | */ | ||
691 | new_skb = dev_alloc_skb(rtlpci->rxbuffersize); | ||
692 | if (unlikely(!new_skb)) { | ||
693 | RT_TRACE(rtlpriv, (COMP_INTR | COMP_RECV), | ||
694 | DBG_DMESG, | ||
695 | ("can't alloc skb for rx\n")); | ||
696 | goto done; | ||
697 | } | ||
698 | pci_unmap_single(rtlpci->pdev, | ||
699 | *((dma_addr_t *) skb->cb), | ||
700 | rtlpci->rxbuffersize, | ||
701 | PCI_DMA_FROMDEVICE); | ||
702 | |||
703 | if (!stats.crc || !stats.hwerror) { | ||
704 | memcpy(IEEE80211_SKB_RXCB(skb), &rx_status, | 702 | memcpy(IEEE80211_SKB_RXCB(skb), &rx_status, |
705 | sizeof(rx_status)); | 703 | sizeof(rx_status)); |
706 | 704 | ||
@@ -1626,6 +1624,16 @@ static bool _rtl_pci_find_adapter(struct pci_dev *pdev, | |||
1626 | pci_read_config_byte(pdev, 0x8, &revisionid); | 1624 | pci_read_config_byte(pdev, 0x8, &revisionid); |
1627 | pci_read_config_word(pdev, 0x3C, &irqline); | 1625 | pci_read_config_word(pdev, 0x3C, &irqline); |
1628 | 1626 | ||
1627 | /* PCI ID 0x10ec:0x8192 occurs for both RTL8192E, which uses | ||
1628 | * r8192e_pci, and RTL8192SE, which uses this driver. If the | ||
1629 | * revision ID is RTL_PCI_REVISION_ID_8192PCIE (0x01), then | ||
1630 | * the correct driver is r8192e_pci, thus this routine should | ||
1631 | * return false. | ||
1632 | */ | ||
1633 | if (deviceid == RTL_PCI_8192SE_DID && | ||
1634 | revisionid == RTL_PCI_REVISION_ID_8192PCIE) | ||
1635 | return false; | ||
1636 | |||
1629 | if (deviceid == RTL_PCI_8192_DID || | 1637 | if (deviceid == RTL_PCI_8192_DID || |
1630 | deviceid == RTL_PCI_0044_DID || | 1638 | deviceid == RTL_PCI_0044_DID || |
1631 | deviceid == RTL_PCI_0047_DID || | 1639 | deviceid == RTL_PCI_0047_DID || |
@@ -1858,7 +1866,8 @@ int __devinit rtl_pci_probe(struct pci_dev *pdev, | |||
1858 | pci_write_config_byte(pdev, 0x04, 0x07); | 1866 | pci_write_config_byte(pdev, 0x04, 0x07); |
1859 | 1867 | ||
1860 | /* find adapter */ | 1868 | /* find adapter */ |
1861 | _rtl_pci_find_adapter(pdev, hw); | 1869 | if (!_rtl_pci_find_adapter(pdev, hw)) |
1870 | goto fail3; | ||
1862 | 1871 | ||
1863 | /* Init IO handler */ | 1872 | /* Init IO handler */ |
1864 | _rtl_pci_io_handler_init(&pdev->dev, hw); | 1873 | _rtl_pci_io_handler_init(&pdev->dev, hw); |
diff --git a/drivers/net/wireless/rtlwifi/rtl8192cu/sw.c b/drivers/net/wireless/rtlwifi/rtl8192cu/sw.c index bee7c1480f63..092e342c19df 100644 --- a/drivers/net/wireless/rtlwifi/rtl8192cu/sw.c +++ b/drivers/net/wireless/rtlwifi/rtl8192cu/sw.c | |||
@@ -53,6 +53,8 @@ MODULE_FIRMWARE("rtlwifi/rtl8192cufw.bin"); | |||
53 | static int rtl92cu_init_sw_vars(struct ieee80211_hw *hw) | 53 | static int rtl92cu_init_sw_vars(struct ieee80211_hw *hw) |
54 | { | 54 | { |
55 | struct rtl_priv *rtlpriv = rtl_priv(hw); | 55 | struct rtl_priv *rtlpriv = rtl_priv(hw); |
56 | const struct firmware *firmware; | ||
57 | int err; | ||
56 | 58 | ||
57 | rtlpriv->dm.dm_initialgain_enable = 1; | 59 | rtlpriv->dm.dm_initialgain_enable = 1; |
58 | rtlpriv->dm.dm_flag = 0; | 60 | rtlpriv->dm.dm_flag = 0; |
@@ -64,6 +66,24 @@ static int rtl92cu_init_sw_vars(struct ieee80211_hw *hw) | |||
64 | ("Can't alloc buffer for fw.\n")); | 66 | ("Can't alloc buffer for fw.\n")); |
65 | return 1; | 67 | return 1; |
66 | } | 68 | } |
69 | /* request fw */ | ||
70 | err = request_firmware(&firmware, rtlpriv->cfg->fw_name, | ||
71 | rtlpriv->io.dev); | ||
72 | if (err) { | ||
73 | RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, | ||
74 | ("Failed to request firmware!\n")); | ||
75 | return 1; | ||
76 | } | ||
77 | if (firmware->size > 0x4000) { | ||
78 | RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, | ||
79 | ("Firmware is too big!\n")); | ||
80 | release_firmware(firmware); | ||
81 | return 1; | ||
82 | } | ||
83 | memcpy(rtlpriv->rtlhal.pfirmware, firmware->data, firmware->size); | ||
84 | rtlpriv->rtlhal.fwsize = firmware->size; | ||
85 | release_firmware(firmware); | ||
86 | |||
67 | return 0; | 87 | return 0; |
68 | } | 88 | } |
69 | 89 | ||