diff options
Diffstat (limited to 'drivers/net')
78 files changed, 578 insertions, 546 deletions
diff --git a/drivers/net/3c509.c b/drivers/net/3c509.c index 5f25889e27ef..44b28b2d7003 100644 --- a/drivers/net/3c509.c +++ b/drivers/net/3c509.c | |||
@@ -185,7 +185,7 @@ static int max_interrupt_work = 10; | |||
185 | static int nopnp; | 185 | static int nopnp; |
186 | #endif | 186 | #endif |
187 | 187 | ||
188 | static int el3_common_init(struct net_device *dev); | 188 | static int __devinit el3_common_init(struct net_device *dev); |
189 | static void el3_common_remove(struct net_device *dev); | 189 | static void el3_common_remove(struct net_device *dev); |
190 | static ushort id_read_eeprom(int index); | 190 | static ushort id_read_eeprom(int index); |
191 | static ushort read_eeprom(int ioaddr, int index); | 191 | static ushort read_eeprom(int ioaddr, int index); |
@@ -395,7 +395,7 @@ static struct isa_driver el3_isa_driver = { | |||
395 | static int isa_registered; | 395 | static int isa_registered; |
396 | 396 | ||
397 | #ifdef CONFIG_PNP | 397 | #ifdef CONFIG_PNP |
398 | static const struct pnp_device_id el3_pnp_ids[] __devinitconst = { | 398 | static struct pnp_device_id el3_pnp_ids[] = { |
399 | { .id = "TCM5090" }, /* 3Com Etherlink III (TP) */ | 399 | { .id = "TCM5090" }, /* 3Com Etherlink III (TP) */ |
400 | { .id = "TCM5091" }, /* 3Com Etherlink III */ | 400 | { .id = "TCM5091" }, /* 3Com Etherlink III */ |
401 | { .id = "TCM5094" }, /* 3Com Etherlink III (combo) */ | 401 | { .id = "TCM5094" }, /* 3Com Etherlink III (combo) */ |
@@ -478,7 +478,7 @@ static int pnp_registered; | |||
478 | #endif /* CONFIG_PNP */ | 478 | #endif /* CONFIG_PNP */ |
479 | 479 | ||
480 | #ifdef CONFIG_EISA | 480 | #ifdef CONFIG_EISA |
481 | static const struct eisa_device_id el3_eisa_ids[] __devinitconst = { | 481 | static struct eisa_device_id el3_eisa_ids[] = { |
482 | { "TCM5090" }, | 482 | { "TCM5090" }, |
483 | { "TCM5091" }, | 483 | { "TCM5091" }, |
484 | { "TCM5092" }, | 484 | { "TCM5092" }, |
@@ -508,7 +508,7 @@ static int eisa_registered; | |||
508 | #ifdef CONFIG_MCA | 508 | #ifdef CONFIG_MCA |
509 | static int el3_mca_probe(struct device *dev); | 509 | static int el3_mca_probe(struct device *dev); |
510 | 510 | ||
511 | static const short el3_mca_adapter_ids[] __devinitconst = { | 511 | static short el3_mca_adapter_ids[] __initdata = { |
512 | 0x627c, | 512 | 0x627c, |
513 | 0x627d, | 513 | 0x627d, |
514 | 0x62db, | 514 | 0x62db, |
@@ -517,7 +517,7 @@ static const short el3_mca_adapter_ids[] __devinitconst = { | |||
517 | 0x0000 | 517 | 0x0000 |
518 | }; | 518 | }; |
519 | 519 | ||
520 | static const char *const el3_mca_adapter_names[] __devinitconst = { | 520 | static char *el3_mca_adapter_names[] __initdata = { |
521 | "3Com 3c529 EtherLink III (10base2)", | 521 | "3Com 3c529 EtherLink III (10base2)", |
522 | "3Com 3c529 EtherLink III (10baseT)", | 522 | "3Com 3c529 EtherLink III (10baseT)", |
523 | "3Com 3c529 EtherLink III (test mode)", | 523 | "3Com 3c529 EtherLink III (test mode)", |
@@ -601,7 +601,7 @@ static void el3_common_remove (struct net_device *dev) | |||
601 | } | 601 | } |
602 | 602 | ||
603 | #ifdef CONFIG_MCA | 603 | #ifdef CONFIG_MCA |
604 | static int __devinit el3_mca_probe(struct device *device) | 604 | static int __init el3_mca_probe(struct device *device) |
605 | { | 605 | { |
606 | /* Based on Erik Nygren's (nygren@mit.edu) 3c529 patch, | 606 | /* Based on Erik Nygren's (nygren@mit.edu) 3c529 patch, |
607 | * heavily modified by Chris Beauregard | 607 | * heavily modified by Chris Beauregard |
@@ -671,7 +671,7 @@ static int __devinit el3_mca_probe(struct device *device) | |||
671 | #endif /* CONFIG_MCA */ | 671 | #endif /* CONFIG_MCA */ |
672 | 672 | ||
673 | #ifdef CONFIG_EISA | 673 | #ifdef CONFIG_EISA |
674 | static int __devinit el3_eisa_probe (struct device *device) | 674 | static int __init el3_eisa_probe (struct device *device) |
675 | { | 675 | { |
676 | short i; | 676 | short i; |
677 | int ioaddr, irq, if_port; | 677 | int ioaddr, irq, if_port; |
diff --git a/drivers/net/3c59x.c b/drivers/net/3c59x.c index 99f43d275442..8cc22568ebd3 100644 --- a/drivers/net/3c59x.c +++ b/drivers/net/3c59x.c | |||
@@ -901,14 +901,14 @@ static const struct dev_pm_ops vortex_pm_ops = { | |||
901 | #endif /* !CONFIG_PM */ | 901 | #endif /* !CONFIG_PM */ |
902 | 902 | ||
903 | #ifdef CONFIG_EISA | 903 | #ifdef CONFIG_EISA |
904 | static const struct eisa_device_id vortex_eisa_ids[] __devinitconst = { | 904 | static struct eisa_device_id vortex_eisa_ids[] = { |
905 | { "TCM5920", CH_3C592 }, | 905 | { "TCM5920", CH_3C592 }, |
906 | { "TCM5970", CH_3C597 }, | 906 | { "TCM5970", CH_3C597 }, |
907 | { "" } | 907 | { "" } |
908 | }; | 908 | }; |
909 | MODULE_DEVICE_TABLE(eisa, vortex_eisa_ids); | 909 | MODULE_DEVICE_TABLE(eisa, vortex_eisa_ids); |
910 | 910 | ||
911 | static int __devinit vortex_eisa_probe(struct device *device) | 911 | static int __init vortex_eisa_probe(struct device *device) |
912 | { | 912 | { |
913 | void __iomem *ioaddr; | 913 | void __iomem *ioaddr; |
914 | struct eisa_device *edev; | 914 | struct eisa_device *edev; |
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/bonding/bond_main.c b/drivers/net/bonding/bond_main.c index 17b4dd94da90..652b30e525d0 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 |
@@ -4206,6 +4211,7 @@ static inline int bond_slave_override(struct bonding *bond, | |||
4206 | return res; | 4211 | return res; |
4207 | } | 4212 | } |
4208 | 4213 | ||
4214 | |||
4209 | static u16 bond_select_queue(struct net_device *dev, struct sk_buff *skb) | 4215 | static u16 bond_select_queue(struct net_device *dev, struct sk_buff *skb) |
4210 | { | 4216 | { |
4211 | /* | 4217 | /* |
@@ -4216,6 +4222,11 @@ static u16 bond_select_queue(struct net_device *dev, struct sk_buff *skb) | |||
4216 | */ | 4222 | */ |
4217 | u16 txq = skb_rx_queue_recorded(skb) ? skb_get_rx_queue(skb) : 0; | 4223 | u16 txq = skb_rx_queue_recorded(skb) ? skb_get_rx_queue(skb) : 0; |
4218 | 4224 | ||
4225 | /* | ||
4226 | * Save the original txq to restore before passing to the driver | ||
4227 | */ | ||
4228 | bond_queue_mapping(skb) = skb->queue_mapping; | ||
4229 | |||
4219 | if (unlikely(txq >= dev->real_num_tx_queues)) { | 4230 | if (unlikely(txq >= dev->real_num_tx_queues)) { |
4220 | do { | 4231 | do { |
4221 | txq -= dev->real_num_tx_queues; | 4232 | txq -= dev->real_num_tx_queues; |
diff --git a/drivers/net/caif/caif_serial.c b/drivers/net/caif/caif_serial.c index 73c7e03617ec..3df0c0f8b8bf 100644 --- a/drivers/net/caif/caif_serial.c +++ b/drivers/net/caif/caif_serial.c | |||
@@ -167,8 +167,8 @@ static inline void debugfs_tx(struct ser_device *ser, const u8 *data, int size) | |||
167 | 167 | ||
168 | #endif | 168 | #endif |
169 | 169 | ||
170 | static unsigned int ldisc_receive(struct tty_struct *tty, | 170 | static void ldisc_receive(struct tty_struct *tty, const u8 *data, |
171 | const u8 *data, char *flags, int count) | 171 | char *flags, int count) |
172 | { | 172 | { |
173 | struct sk_buff *skb = NULL; | 173 | struct sk_buff *skb = NULL; |
174 | struct ser_device *ser; | 174 | struct ser_device *ser; |
@@ -215,8 +215,6 @@ static unsigned int ldisc_receive(struct tty_struct *tty, | |||
215 | } else | 215 | } else |
216 | ++ser->dev->stats.rx_dropped; | 216 | ++ser->dev->stats.rx_dropped; |
217 | update_tty_status(ser); | 217 | update_tty_status(ser); |
218 | |||
219 | return count; | ||
220 | } | 218 | } |
221 | 219 | ||
222 | static int handle_tx(struct ser_device *ser) | 220 | static int handle_tx(struct ser_device *ser) |
diff --git a/drivers/net/can/flexcan.c b/drivers/net/can/flexcan.c index d4990568baee..17678117ed69 100644 --- a/drivers/net/can/flexcan.c +++ b/drivers/net/can/flexcan.c | |||
@@ -923,7 +923,7 @@ static int __devinit flexcan_probe(struct platform_device *pdev) | |||
923 | mem_size = resource_size(mem); | 923 | mem_size = resource_size(mem); |
924 | if (!request_mem_region(mem->start, mem_size, pdev->name)) { | 924 | if (!request_mem_region(mem->start, mem_size, pdev->name)) { |
925 | err = -EBUSY; | 925 | err = -EBUSY; |
926 | goto failed_req; | 926 | goto failed_get; |
927 | } | 927 | } |
928 | 928 | ||
929 | base = ioremap(mem->start, mem_size); | 929 | base = ioremap(mem->start, mem_size); |
@@ -977,9 +977,8 @@ static int __devinit flexcan_probe(struct platform_device *pdev) | |||
977 | iounmap(base); | 977 | iounmap(base); |
978 | failed_map: | 978 | failed_map: |
979 | release_mem_region(mem->start, mem_size); | 979 | release_mem_region(mem->start, mem_size); |
980 | failed_req: | ||
981 | clk_put(clk); | ||
982 | failed_get: | 980 | failed_get: |
981 | clk_put(clk); | ||
983 | failed_clock: | 982 | failed_clock: |
984 | return err; | 983 | return err; |
985 | } | 984 | } |
diff --git a/drivers/net/can/slcan.c b/drivers/net/can/slcan.c index 75622d54581f..1b49df6b2470 100644 --- a/drivers/net/can/slcan.c +++ b/drivers/net/can/slcan.c | |||
@@ -425,17 +425,16 @@ static void slc_setup(struct net_device *dev) | |||
425 | * in parallel | 425 | * in parallel |
426 | */ | 426 | */ |
427 | 427 | ||
428 | static unsigned int slcan_receive_buf(struct tty_struct *tty, | 428 | static void slcan_receive_buf(struct tty_struct *tty, |
429 | const unsigned char *cp, char *fp, int count) | 429 | const unsigned char *cp, char *fp, int count) |
430 | { | 430 | { |
431 | struct slcan *sl = (struct slcan *) tty->disc_data; | 431 | struct slcan *sl = (struct slcan *) tty->disc_data; |
432 | int bytes = count; | ||
433 | 432 | ||
434 | if (!sl || sl->magic != SLCAN_MAGIC || !netif_running(sl->dev)) | 433 | if (!sl || sl->magic != SLCAN_MAGIC || !netif_running(sl->dev)) |
435 | return -ENODEV; | 434 | return; |
436 | 435 | ||
437 | /* Read the characters out of the buffer */ | 436 | /* Read the characters out of the buffer */ |
438 | while (bytes--) { | 437 | while (count--) { |
439 | if (fp && *fp++) { | 438 | if (fp && *fp++) { |
440 | if (!test_and_set_bit(SLF_ERROR, &sl->flags)) | 439 | if (!test_and_set_bit(SLF_ERROR, &sl->flags)) |
441 | sl->dev->stats.rx_errors++; | 440 | sl->dev->stats.rx_errors++; |
@@ -444,8 +443,6 @@ static unsigned int slcan_receive_buf(struct tty_struct *tty, | |||
444 | } | 443 | } |
445 | slcan_unesc(sl, *cp++); | 444 | slcan_unesc(sl, *cp++); |
446 | } | 445 | } |
447 | |||
448 | return count; | ||
449 | } | 446 | } |
450 | 447 | ||
451 | /************************************ | 448 | /************************************ |
diff --git a/drivers/net/davinci_emac.c b/drivers/net/davinci_emac.c index 29a4f06fbfcf..dcc4a170b0f3 100644 --- a/drivers/net/davinci_emac.c +++ b/drivers/net/davinci_emac.c | |||
@@ -1781,8 +1781,8 @@ static int __devinit davinci_emac_probe(struct platform_device *pdev) | |||
1781 | ndev = alloc_etherdev(sizeof(struct emac_priv)); | 1781 | ndev = alloc_etherdev(sizeof(struct emac_priv)); |
1782 | if (!ndev) { | 1782 | if (!ndev) { |
1783 | dev_err(&pdev->dev, "error allocating net_device\n"); | 1783 | dev_err(&pdev->dev, "error allocating net_device\n"); |
1784 | clk_put(emac_clk); | 1784 | rc = -ENOMEM; |
1785 | return -ENOMEM; | 1785 | goto free_clk; |
1786 | } | 1786 | } |
1787 | 1787 | ||
1788 | platform_set_drvdata(pdev, ndev); | 1788 | platform_set_drvdata(pdev, ndev); |
@@ -1796,7 +1796,8 @@ static int __devinit davinci_emac_probe(struct platform_device *pdev) | |||
1796 | pdata = pdev->dev.platform_data; | 1796 | pdata = pdev->dev.platform_data; |
1797 | if (!pdata) { | 1797 | if (!pdata) { |
1798 | dev_err(&pdev->dev, "no platform data\n"); | 1798 | dev_err(&pdev->dev, "no platform data\n"); |
1799 | return -ENODEV; | 1799 | rc = -ENODEV; |
1800 | goto probe_quit; | ||
1800 | } | 1801 | } |
1801 | 1802 | ||
1802 | /* MAC addr and PHY mask , RMII enable info from platform_data */ | 1803 | /* MAC addr and PHY mask , RMII enable info from platform_data */ |
@@ -1929,8 +1930,9 @@ no_dma: | |||
1929 | iounmap(priv->remap_addr); | 1930 | iounmap(priv->remap_addr); |
1930 | 1931 | ||
1931 | probe_quit: | 1932 | probe_quit: |
1932 | clk_put(emac_clk); | ||
1933 | free_netdev(ndev); | 1933 | free_netdev(ndev); |
1934 | free_clk: | ||
1935 | clk_put(emac_clk); | ||
1934 | return rc; | 1936 | return rc; |
1935 | } | 1937 | } |
1936 | 1938 | ||
diff --git a/drivers/net/depca.c b/drivers/net/depca.c index 17654059922d..8b0084d17c8c 100644 --- a/drivers/net/depca.c +++ b/drivers/net/depca.c | |||
@@ -331,18 +331,18 @@ static struct { | |||
331 | "DE422",\ | 331 | "DE422",\ |
332 | ""} | 332 | ""} |
333 | 333 | ||
334 | static const char* const depca_signature[] __devinitconst = DEPCA_SIGNATURE; | 334 | static char* __initdata depca_signature[] = DEPCA_SIGNATURE; |
335 | 335 | ||
336 | enum depca_type { | 336 | enum depca_type { |
337 | DEPCA, de100, de101, de200, de201, de202, de210, de212, de422, unknown | 337 | DEPCA, de100, de101, de200, de201, de202, de210, de212, de422, unknown |
338 | }; | 338 | }; |
339 | 339 | ||
340 | static const char depca_string[] = "depca"; | 340 | static char depca_string[] = "depca"; |
341 | 341 | ||
342 | static int depca_device_remove (struct device *device); | 342 | static int depca_device_remove (struct device *device); |
343 | 343 | ||
344 | #ifdef CONFIG_EISA | 344 | #ifdef CONFIG_EISA |
345 | static const struct eisa_device_id depca_eisa_ids[] __devinitconst = { | 345 | static struct eisa_device_id depca_eisa_ids[] = { |
346 | { "DEC4220", de422 }, | 346 | { "DEC4220", de422 }, |
347 | { "" } | 347 | { "" } |
348 | }; | 348 | }; |
@@ -367,19 +367,19 @@ static struct eisa_driver depca_eisa_driver = { | |||
367 | #define DE210_ID 0x628d | 367 | #define DE210_ID 0x628d |
368 | #define DE212_ID 0x6def | 368 | #define DE212_ID 0x6def |
369 | 369 | ||
370 | static const short depca_mca_adapter_ids[] __devinitconst = { | 370 | static short depca_mca_adapter_ids[] = { |
371 | DE210_ID, | 371 | DE210_ID, |
372 | DE212_ID, | 372 | DE212_ID, |
373 | 0x0000 | 373 | 0x0000 |
374 | }; | 374 | }; |
375 | 375 | ||
376 | static const char *depca_mca_adapter_name[] = { | 376 | static char *depca_mca_adapter_name[] = { |
377 | "DEC EtherWORKS MC Adapter (DE210)", | 377 | "DEC EtherWORKS MC Adapter (DE210)", |
378 | "DEC EtherWORKS MC Adapter (DE212)", | 378 | "DEC EtherWORKS MC Adapter (DE212)", |
379 | NULL | 379 | NULL |
380 | }; | 380 | }; |
381 | 381 | ||
382 | static const enum depca_type depca_mca_adapter_type[] = { | 382 | static enum depca_type depca_mca_adapter_type[] = { |
383 | de210, | 383 | de210, |
384 | de212, | 384 | de212, |
385 | 0 | 385 | 0 |
@@ -541,9 +541,10 @@ static void SetMulticastFilter(struct net_device *dev); | |||
541 | static int load_packet(struct net_device *dev, struct sk_buff *skb); | 541 | static int load_packet(struct net_device *dev, struct sk_buff *skb); |
542 | static void depca_dbg_open(struct net_device *dev); | 542 | static void depca_dbg_open(struct net_device *dev); |
543 | 543 | ||
544 | static const u_char de1xx_irq[] __devinitconst = { 2, 3, 4, 5, 7, 9, 0 }; | 544 | static u_char de1xx_irq[] __initdata = { 2, 3, 4, 5, 7, 9, 0 }; |
545 | static const u_char de2xx_irq[] __devinitconst = { 5, 9, 10, 11, 15, 0 }; | 545 | static u_char de2xx_irq[] __initdata = { 5, 9, 10, 11, 15, 0 }; |
546 | static const u_char de422_irq[] __devinitconst = { 5, 9, 10, 11, 0 }; | 546 | static u_char de422_irq[] __initdata = { 5, 9, 10, 11, 0 }; |
547 | static u_char *depca_irq; | ||
547 | 548 | ||
548 | static int irq; | 549 | static int irq; |
549 | static int io; | 550 | static int io; |
@@ -579,7 +580,7 @@ static const struct net_device_ops depca_netdev_ops = { | |||
579 | .ndo_validate_addr = eth_validate_addr, | 580 | .ndo_validate_addr = eth_validate_addr, |
580 | }; | 581 | }; |
581 | 582 | ||
582 | static int __devinit depca_hw_init (struct net_device *dev, struct device *device) | 583 | static int __init depca_hw_init (struct net_device *dev, struct device *device) |
583 | { | 584 | { |
584 | struct depca_private *lp; | 585 | struct depca_private *lp; |
585 | int i, j, offset, netRAM, mem_len, status = 0; | 586 | int i, j, offset, netRAM, mem_len, status = 0; |
@@ -747,7 +748,6 @@ static int __devinit depca_hw_init (struct net_device *dev, struct device *devic | |||
747 | if (dev->irq < 2) { | 748 | if (dev->irq < 2) { |
748 | unsigned char irqnum; | 749 | unsigned char irqnum; |
749 | unsigned long irq_mask, delay; | 750 | unsigned long irq_mask, delay; |
750 | const u_char *depca_irq; | ||
751 | 751 | ||
752 | irq_mask = probe_irq_on(); | 752 | irq_mask = probe_irq_on(); |
753 | 753 | ||
@@ -770,7 +770,6 @@ static int __devinit depca_hw_init (struct net_device *dev, struct device *devic | |||
770 | break; | 770 | break; |
771 | 771 | ||
772 | default: | 772 | default: |
773 | depca_irq = NULL; | ||
774 | break; /* Not reached */ | 773 | break; /* Not reached */ |
775 | } | 774 | } |
776 | 775 | ||
@@ -1303,7 +1302,7 @@ static void SetMulticastFilter(struct net_device *dev) | |||
1303 | } | 1302 | } |
1304 | } | 1303 | } |
1305 | 1304 | ||
1306 | static int __devinit depca_common_init (u_long ioaddr, struct net_device **devp) | 1305 | static int __init depca_common_init (u_long ioaddr, struct net_device **devp) |
1307 | { | 1306 | { |
1308 | int status = 0; | 1307 | int status = 0; |
1309 | 1308 | ||
@@ -1334,7 +1333,7 @@ static int __devinit depca_common_init (u_long ioaddr, struct net_device **devp) | |||
1334 | /* | 1333 | /* |
1335 | ** Microchannel bus I/O device probe | 1334 | ** Microchannel bus I/O device probe |
1336 | */ | 1335 | */ |
1337 | static int __devinit depca_mca_probe(struct device *device) | 1336 | static int __init depca_mca_probe(struct device *device) |
1338 | { | 1337 | { |
1339 | unsigned char pos[2]; | 1338 | unsigned char pos[2]; |
1340 | unsigned char where; | 1339 | unsigned char where; |
@@ -1458,7 +1457,7 @@ static int __devinit depca_mca_probe(struct device *device) | |||
1458 | ** ISA bus I/O device probe | 1457 | ** ISA bus I/O device probe |
1459 | */ | 1458 | */ |
1460 | 1459 | ||
1461 | static void __devinit depca_platform_probe (void) | 1460 | static void __init depca_platform_probe (void) |
1462 | { | 1461 | { |
1463 | int i; | 1462 | int i; |
1464 | struct platform_device *pldev; | 1463 | struct platform_device *pldev; |
@@ -1498,7 +1497,7 @@ static void __devinit depca_platform_probe (void) | |||
1498 | } | 1497 | } |
1499 | } | 1498 | } |
1500 | 1499 | ||
1501 | static enum depca_type __devinit depca_shmem_probe (ulong *mem_start) | 1500 | static enum depca_type __init depca_shmem_probe (ulong *mem_start) |
1502 | { | 1501 | { |
1503 | u_long mem_base[] = DEPCA_RAM_BASE_ADDRESSES; | 1502 | u_long mem_base[] = DEPCA_RAM_BASE_ADDRESSES; |
1504 | enum depca_type adapter = unknown; | 1503 | enum depca_type adapter = unknown; |
@@ -1559,7 +1558,7 @@ static int __devinit depca_isa_probe (struct platform_device *device) | |||
1559 | */ | 1558 | */ |
1560 | 1559 | ||
1561 | #ifdef CONFIG_EISA | 1560 | #ifdef CONFIG_EISA |
1562 | static int __devinit depca_eisa_probe (struct device *device) | 1561 | static int __init depca_eisa_probe (struct device *device) |
1563 | { | 1562 | { |
1564 | enum depca_type adapter = unknown; | 1563 | enum depca_type adapter = unknown; |
1565 | struct eisa_device *edev; | 1564 | struct eisa_device *edev; |
@@ -1630,7 +1629,7 @@ static int __devexit depca_device_remove (struct device *device) | |||
1630 | ** and Boot (readb) ROM. This will also give us a clue to the network RAM | 1629 | ** and Boot (readb) ROM. This will also give us a clue to the network RAM |
1631 | ** base address. | 1630 | ** base address. |
1632 | */ | 1631 | */ |
1633 | static int __devinit DepcaSignature(char *name, u_long base_addr) | 1632 | static int __init DepcaSignature(char *name, u_long base_addr) |
1634 | { | 1633 | { |
1635 | u_int i, j, k; | 1634 | u_int i, j, k; |
1636 | void __iomem *ptr; | 1635 | void __iomem *ptr; |
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/dm9000.c b/drivers/net/dm9000.c index fbaff3584bd4..ee597e676ee5 100644 --- a/drivers/net/dm9000.c +++ b/drivers/net/dm9000.c | |||
@@ -1157,9 +1157,6 @@ dm9000_open(struct net_device *dev) | |||
1157 | 1157 | ||
1158 | irqflags |= IRQF_SHARED; | 1158 | irqflags |= IRQF_SHARED; |
1159 | 1159 | ||
1160 | if (request_irq(dev->irq, dm9000_interrupt, irqflags, dev->name, dev)) | ||
1161 | return -EAGAIN; | ||
1162 | |||
1163 | /* GPIO0 on pre-activate PHY, Reg 1F is not set by reset */ | 1160 | /* GPIO0 on pre-activate PHY, Reg 1F is not set by reset */ |
1164 | iow(db, DM9000_GPR, 0); /* REG_1F bit0 activate phyxcer */ | 1161 | iow(db, DM9000_GPR, 0); /* REG_1F bit0 activate phyxcer */ |
1165 | mdelay(1); /* delay needs by DM9000B */ | 1162 | mdelay(1); /* delay needs by DM9000B */ |
@@ -1168,6 +1165,9 @@ dm9000_open(struct net_device *dev) | |||
1168 | dm9000_reset(db); | 1165 | dm9000_reset(db); |
1169 | dm9000_init_dm9000(dev); | 1166 | dm9000_init_dm9000(dev); |
1170 | 1167 | ||
1168 | if (request_irq(dev->irq, dm9000_interrupt, irqflags, dev->name, dev)) | ||
1169 | return -EAGAIN; | ||
1170 | |||
1171 | /* Init driver variable */ | 1171 | /* Init driver variable */ |
1172 | db->dbug_cnt = 0; | 1172 | db->dbug_cnt = 0; |
1173 | 1173 | ||
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/hamradio/6pack.c b/drivers/net/hamradio/6pack.c index 992089639ea4..3e5d0b6b6516 100644 --- a/drivers/net/hamradio/6pack.c +++ b/drivers/net/hamradio/6pack.c | |||
@@ -456,7 +456,7 @@ out: | |||
456 | * a block of 6pack data has been received, which can now be decapsulated | 456 | * a block of 6pack data has been received, which can now be decapsulated |
457 | * and sent on to some IP layer for further processing. | 457 | * and sent on to some IP layer for further processing. |
458 | */ | 458 | */ |
459 | static unsigned int sixpack_receive_buf(struct tty_struct *tty, | 459 | static void sixpack_receive_buf(struct tty_struct *tty, |
460 | const unsigned char *cp, char *fp, int count) | 460 | const unsigned char *cp, char *fp, int count) |
461 | { | 461 | { |
462 | struct sixpack *sp; | 462 | struct sixpack *sp; |
@@ -464,11 +464,11 @@ static unsigned int sixpack_receive_buf(struct tty_struct *tty, | |||
464 | int count1; | 464 | int count1; |
465 | 465 | ||
466 | if (!count) | 466 | if (!count) |
467 | return 0; | 467 | return; |
468 | 468 | ||
469 | sp = sp_get(tty); | 469 | sp = sp_get(tty); |
470 | if (!sp) | 470 | if (!sp) |
471 | return -ENODEV; | 471 | return; |
472 | 472 | ||
473 | memcpy(buf, cp, count < sizeof(buf) ? count : sizeof(buf)); | 473 | memcpy(buf, cp, count < sizeof(buf) ? count : sizeof(buf)); |
474 | 474 | ||
@@ -487,8 +487,6 @@ static unsigned int sixpack_receive_buf(struct tty_struct *tty, | |||
487 | 487 | ||
488 | sp_put(sp); | 488 | sp_put(sp); |
489 | tty_unthrottle(tty); | 489 | tty_unthrottle(tty); |
490 | |||
491 | return count1; | ||
492 | } | 490 | } |
493 | 491 | ||
494 | /* | 492 | /* |
diff --git a/drivers/net/hamradio/mkiss.c b/drivers/net/hamradio/mkiss.c index 0e4f23531140..4c628393c8b1 100644 --- a/drivers/net/hamradio/mkiss.c +++ b/drivers/net/hamradio/mkiss.c | |||
@@ -923,14 +923,13 @@ static long mkiss_compat_ioctl(struct tty_struct *tty, struct file *file, | |||
923 | * a block of data has been received, which can now be decapsulated | 923 | * a block of data has been received, which can now be decapsulated |
924 | * and sent on to the AX.25 layer for further processing. | 924 | * and sent on to the AX.25 layer for further processing. |
925 | */ | 925 | */ |
926 | static unsigned int mkiss_receive_buf(struct tty_struct *tty, | 926 | static void mkiss_receive_buf(struct tty_struct *tty, const unsigned char *cp, |
927 | const unsigned char *cp, char *fp, int count) | 927 | char *fp, int count) |
928 | { | 928 | { |
929 | struct mkiss *ax = mkiss_get(tty); | 929 | struct mkiss *ax = mkiss_get(tty); |
930 | int bytes = count; | ||
931 | 930 | ||
932 | if (!ax) | 931 | if (!ax) |
933 | return -ENODEV; | 932 | return; |
934 | 933 | ||
935 | /* | 934 | /* |
936 | * Argh! mtu change time! - costs us the packet part received | 935 | * Argh! mtu change time! - costs us the packet part received |
@@ -940,7 +939,7 @@ static unsigned int mkiss_receive_buf(struct tty_struct *tty, | |||
940 | ax_changedmtu(ax); | 939 | ax_changedmtu(ax); |
941 | 940 | ||
942 | /* Read the characters out of the buffer */ | 941 | /* Read the characters out of the buffer */ |
943 | while (bytes--) { | 942 | while (count--) { |
944 | if (fp != NULL && *fp++) { | 943 | if (fp != NULL && *fp++) { |
945 | if (!test_and_set_bit(AXF_ERROR, &ax->flags)) | 944 | if (!test_and_set_bit(AXF_ERROR, &ax->flags)) |
946 | ax->dev->stats.rx_errors++; | 945 | ax->dev->stats.rx_errors++; |
@@ -953,8 +952,6 @@ static unsigned int mkiss_receive_buf(struct tty_struct *tty, | |||
953 | 952 | ||
954 | mkiss_put(ax); | 953 | mkiss_put(ax); |
955 | tty_unthrottle(tty); | 954 | tty_unthrottle(tty); |
956 | |||
957 | return count; | ||
958 | } | 955 | } |
959 | 956 | ||
960 | /* | 957 | /* |
diff --git a/drivers/net/hp100.c b/drivers/net/hp100.c index c52a1df5d922..8e10d2f6a5ad 100644 --- a/drivers/net/hp100.c +++ b/drivers/net/hp100.c | |||
@@ -188,14 +188,14 @@ struct hp100_private { | |||
188 | * variables | 188 | * variables |
189 | */ | 189 | */ |
190 | #ifdef CONFIG_ISA | 190 | #ifdef CONFIG_ISA |
191 | static const char *const hp100_isa_tbl[] __devinitconst = { | 191 | static const char *hp100_isa_tbl[] = { |
192 | "HWPF150", /* HP J2573 rev A */ | 192 | "HWPF150", /* HP J2573 rev A */ |
193 | "HWP1950", /* HP J2573 */ | 193 | "HWP1950", /* HP J2573 */ |
194 | }; | 194 | }; |
195 | #endif | 195 | #endif |
196 | 196 | ||
197 | #ifdef CONFIG_EISA | 197 | #ifdef CONFIG_EISA |
198 | static const struct eisa_device_id hp100_eisa_tbl[] __devinitconst = { | 198 | static struct eisa_device_id hp100_eisa_tbl[] = { |
199 | { "HWPF180" }, /* HP J2577 rev A */ | 199 | { "HWPF180" }, /* HP J2577 rev A */ |
200 | { "HWP1920" }, /* HP 27248B */ | 200 | { "HWP1920" }, /* HP 27248B */ |
201 | { "HWP1940" }, /* HP J2577 */ | 201 | { "HWP1940" }, /* HP J2577 */ |
@@ -336,7 +336,7 @@ static __devinit const char *hp100_read_id(int ioaddr) | |||
336 | } | 336 | } |
337 | 337 | ||
338 | #ifdef CONFIG_ISA | 338 | #ifdef CONFIG_ISA |
339 | static __devinit int hp100_isa_probe1(struct net_device *dev, int ioaddr) | 339 | static __init int hp100_isa_probe1(struct net_device *dev, int ioaddr) |
340 | { | 340 | { |
341 | const char *sig; | 341 | const char *sig; |
342 | int i; | 342 | int i; |
@@ -372,7 +372,7 @@ static __devinit int hp100_isa_probe1(struct net_device *dev, int ioaddr) | |||
372 | * EISA and PCI are handled by device infrastructure. | 372 | * EISA and PCI are handled by device infrastructure. |
373 | */ | 373 | */ |
374 | 374 | ||
375 | static int __devinit hp100_isa_probe(struct net_device *dev, int addr) | 375 | static int __init hp100_isa_probe(struct net_device *dev, int addr) |
376 | { | 376 | { |
377 | int err = -ENODEV; | 377 | int err = -ENODEV; |
378 | 378 | ||
@@ -396,7 +396,7 @@ static int __devinit hp100_isa_probe(struct net_device *dev, int addr) | |||
396 | #endif /* CONFIG_ISA */ | 396 | #endif /* CONFIG_ISA */ |
397 | 397 | ||
398 | #if !defined(MODULE) && defined(CONFIG_ISA) | 398 | #if !defined(MODULE) && defined(CONFIG_ISA) |
399 | struct net_device * __devinit hp100_probe(int unit) | 399 | struct net_device * __init hp100_probe(int unit) |
400 | { | 400 | { |
401 | struct net_device *dev = alloc_etherdev(sizeof(struct hp100_private)); | 401 | struct net_device *dev = alloc_etherdev(sizeof(struct hp100_private)); |
402 | int err; | 402 | int err; |
@@ -2843,7 +2843,7 @@ static void cleanup_dev(struct net_device *d) | |||
2843 | } | 2843 | } |
2844 | 2844 | ||
2845 | #ifdef CONFIG_EISA | 2845 | #ifdef CONFIG_EISA |
2846 | static int __devinit hp100_eisa_probe (struct device *gendev) | 2846 | static int __init hp100_eisa_probe (struct device *gendev) |
2847 | { | 2847 | { |
2848 | struct net_device *dev = alloc_etherdev(sizeof(struct hp100_private)); | 2848 | struct net_device *dev = alloc_etherdev(sizeof(struct hp100_private)); |
2849 | struct eisa_device *edev = to_eisa_device(gendev); | 2849 | struct eisa_device *edev = to_eisa_device(gendev); |
diff --git a/drivers/net/ibmlana.c b/drivers/net/ibmlana.c index 136d7544cc33..a7d6cad32953 100644 --- a/drivers/net/ibmlana.c +++ b/drivers/net/ibmlana.c | |||
@@ -895,12 +895,12 @@ static int ibmlana_irq; | |||
895 | static int ibmlana_io; | 895 | static int ibmlana_io; |
896 | static int startslot; /* counts through slots when probing multiple devices */ | 896 | static int startslot; /* counts through slots when probing multiple devices */ |
897 | 897 | ||
898 | static const short ibmlana_adapter_ids[] __devinitconst = { | 898 | static short ibmlana_adapter_ids[] __initdata = { |
899 | IBM_LANA_ID, | 899 | IBM_LANA_ID, |
900 | 0x0000 | 900 | 0x0000 |
901 | }; | 901 | }; |
902 | 902 | ||
903 | static const char *const ibmlana_adapter_names[] __devinitconst = { | 903 | static char *ibmlana_adapter_names[] __devinitdata = { |
904 | "IBM LAN Adapter/A", | 904 | "IBM LAN Adapter/A", |
905 | NULL | 905 | NULL |
906 | }; | 906 | }; |
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/irda/irtty-sir.c b/drivers/net/irda/irtty-sir.c index 035861d8acb1..3352b2443e58 100644 --- a/drivers/net/irda/irtty-sir.c +++ b/drivers/net/irda/irtty-sir.c | |||
@@ -216,23 +216,23 @@ static int irtty_do_write(struct sir_dev *dev, const unsigned char *ptr, size_t | |||
216 | * usbserial: urb-complete-interrupt / softint | 216 | * usbserial: urb-complete-interrupt / softint |
217 | */ | 217 | */ |
218 | 218 | ||
219 | static unsigned int irtty_receive_buf(struct tty_struct *tty, | 219 | static void irtty_receive_buf(struct tty_struct *tty, const unsigned char *cp, |
220 | const unsigned char *cp, char *fp, int count) | 220 | char *fp, int count) |
221 | { | 221 | { |
222 | struct sir_dev *dev; | 222 | struct sir_dev *dev; |
223 | struct sirtty_cb *priv = tty->disc_data; | 223 | struct sirtty_cb *priv = tty->disc_data; |
224 | int i; | 224 | int i; |
225 | 225 | ||
226 | IRDA_ASSERT(priv != NULL, return -ENODEV;); | 226 | IRDA_ASSERT(priv != NULL, return;); |
227 | IRDA_ASSERT(priv->magic == IRTTY_MAGIC, return -EINVAL;); | 227 | IRDA_ASSERT(priv->magic == IRTTY_MAGIC, return;); |
228 | 228 | ||
229 | if (unlikely(count==0)) /* yes, this happens */ | 229 | if (unlikely(count==0)) /* yes, this happens */ |
230 | return 0; | 230 | return; |
231 | 231 | ||
232 | dev = priv->dev; | 232 | dev = priv->dev; |
233 | if (!dev) { | 233 | if (!dev) { |
234 | IRDA_WARNING("%s(), not ready yet!\n", __func__); | 234 | IRDA_WARNING("%s(), not ready yet!\n", __func__); |
235 | return -ENODEV; | 235 | return; |
236 | } | 236 | } |
237 | 237 | ||
238 | for (i = 0; i < count; i++) { | 238 | for (i = 0; i < count; i++) { |
@@ -242,13 +242,11 @@ static unsigned int irtty_receive_buf(struct tty_struct *tty, | |||
242 | if (fp && *fp++) { | 242 | if (fp && *fp++) { |
243 | IRDA_DEBUG(0, "Framing or parity error!\n"); | 243 | IRDA_DEBUG(0, "Framing or parity error!\n"); |
244 | sirdev_receive(dev, NULL, 0); /* notify sir_dev (updating stats) */ | 244 | sirdev_receive(dev, NULL, 0); /* notify sir_dev (updating stats) */ |
245 | return -EINVAL; | 245 | return; |
246 | } | 246 | } |
247 | } | 247 | } |
248 | 248 | ||
249 | sirdev_receive(dev, cp, count); | 249 | sirdev_receive(dev, cp, count); |
250 | |||
251 | return count; | ||
252 | } | 250 | } |
253 | 251 | ||
254 | /* | 252 | /* |
diff --git a/drivers/net/irda/smsc-ircc2.c b/drivers/net/irda/smsc-ircc2.c index 69b5707db369..8800e1fe4129 100644 --- a/drivers/net/irda/smsc-ircc2.c +++ b/drivers/net/irda/smsc-ircc2.c | |||
@@ -222,19 +222,19 @@ static void smsc_ircc_set_transceiver_for_speed(struct smsc_ircc_cb *self, u32 s | |||
222 | static void smsc_ircc_sir_wait_hw_transmitter_finish(struct smsc_ircc_cb *self); | 222 | static void smsc_ircc_sir_wait_hw_transmitter_finish(struct smsc_ircc_cb *self); |
223 | 223 | ||
224 | /* Probing */ | 224 | /* Probing */ |
225 | static int smsc_ircc_look_for_chips(void); | 225 | static int __init smsc_ircc_look_for_chips(void); |
226 | static const struct smsc_chip * smsc_ircc_probe(unsigned short cfg_base, u8 reg, const struct smsc_chip *chip, char *type); | 226 | static const struct smsc_chip * __init smsc_ircc_probe(unsigned short cfg_base, u8 reg, const struct smsc_chip *chip, char *type); |
227 | static int smsc_superio_flat(const struct smsc_chip *chips, unsigned short cfg_base, char *type); | 227 | static int __init smsc_superio_flat(const struct smsc_chip *chips, unsigned short cfg_base, char *type); |
228 | static int smsc_superio_paged(const struct smsc_chip *chips, unsigned short cfg_base, char *type); | 228 | static int __init smsc_superio_paged(const struct smsc_chip *chips, unsigned short cfg_base, char *type); |
229 | static int smsc_superio_fdc(unsigned short cfg_base); | 229 | static int __init smsc_superio_fdc(unsigned short cfg_base); |
230 | static int smsc_superio_lpc(unsigned short cfg_base); | 230 | static int __init smsc_superio_lpc(unsigned short cfg_base); |
231 | #ifdef CONFIG_PCI | 231 | #ifdef CONFIG_PCI |
232 | static int preconfigure_smsc_chip(struct smsc_ircc_subsystem_configuration *conf); | 232 | static int __init preconfigure_smsc_chip(struct smsc_ircc_subsystem_configuration *conf); |
233 | static int preconfigure_through_82801(struct pci_dev *dev, struct smsc_ircc_subsystem_configuration *conf); | 233 | static int __init preconfigure_through_82801(struct pci_dev *dev, struct smsc_ircc_subsystem_configuration *conf); |
234 | static void preconfigure_ali_port(struct pci_dev *dev, | 234 | static void __init preconfigure_ali_port(struct pci_dev *dev, |
235 | unsigned short port); | 235 | unsigned short port); |
236 | static int preconfigure_through_ali(struct pci_dev *dev, struct smsc_ircc_subsystem_configuration *conf); | 236 | static int __init preconfigure_through_ali(struct pci_dev *dev, struct smsc_ircc_subsystem_configuration *conf); |
237 | static int smsc_ircc_preconfigure_subsystems(unsigned short ircc_cfg, | 237 | static int __init smsc_ircc_preconfigure_subsystems(unsigned short ircc_cfg, |
238 | unsigned short ircc_fir, | 238 | unsigned short ircc_fir, |
239 | unsigned short ircc_sir, | 239 | unsigned short ircc_sir, |
240 | unsigned char ircc_dma, | 240 | unsigned char ircc_dma, |
@@ -366,7 +366,7 @@ static inline void register_bank(int iobase, int bank) | |||
366 | } | 366 | } |
367 | 367 | ||
368 | /* PNP hotplug support */ | 368 | /* PNP hotplug support */ |
369 | static const struct pnp_device_id smsc_ircc_pnp_table[] __devinitconst = { | 369 | static const struct pnp_device_id smsc_ircc_pnp_table[] = { |
370 | { .id = "SMCf010", .driver_data = 0 }, | 370 | { .id = "SMCf010", .driver_data = 0 }, |
371 | /* and presumably others */ | 371 | /* and presumably others */ |
372 | { } | 372 | { } |
@@ -515,7 +515,7 @@ static const struct net_device_ops smsc_ircc_netdev_ops = { | |||
515 | * Try to open driver instance | 515 | * Try to open driver instance |
516 | * | 516 | * |
517 | */ | 517 | */ |
518 | static int __devinit smsc_ircc_open(unsigned int fir_base, unsigned int sir_base, u8 dma, u8 irq) | 518 | static int __init smsc_ircc_open(unsigned int fir_base, unsigned int sir_base, u8 dma, u8 irq) |
519 | { | 519 | { |
520 | struct smsc_ircc_cb *self; | 520 | struct smsc_ircc_cb *self; |
521 | struct net_device *dev; | 521 | struct net_device *dev; |
@@ -2273,7 +2273,7 @@ static int __init smsc_superio_paged(const struct smsc_chip *chips, unsigned sho | |||
2273 | } | 2273 | } |
2274 | 2274 | ||
2275 | 2275 | ||
2276 | static int __devinit smsc_access(unsigned short cfg_base, unsigned char reg) | 2276 | static int __init smsc_access(unsigned short cfg_base, unsigned char reg) |
2277 | { | 2277 | { |
2278 | IRDA_DEBUG(1, "%s\n", __func__); | 2278 | IRDA_DEBUG(1, "%s\n", __func__); |
2279 | 2279 | ||
@@ -2281,7 +2281,7 @@ static int __devinit smsc_access(unsigned short cfg_base, unsigned char reg) | |||
2281 | return inb(cfg_base) != reg ? -1 : 0; | 2281 | return inb(cfg_base) != reg ? -1 : 0; |
2282 | } | 2282 | } |
2283 | 2283 | ||
2284 | static const struct smsc_chip * __devinit smsc_ircc_probe(unsigned short cfg_base, u8 reg, const struct smsc_chip *chip, char *type) | 2284 | static const struct smsc_chip * __init smsc_ircc_probe(unsigned short cfg_base, u8 reg, const struct smsc_chip *chip, char *type) |
2285 | { | 2285 | { |
2286 | u8 devid, xdevid, rev; | 2286 | u8 devid, xdevid, rev; |
2287 | 2287 | ||
@@ -2406,7 +2406,7 @@ static int __init smsc_superio_lpc(unsigned short cfg_base) | |||
2406 | #ifdef CONFIG_PCI | 2406 | #ifdef CONFIG_PCI |
2407 | #define PCIID_VENDOR_INTEL 0x8086 | 2407 | #define PCIID_VENDOR_INTEL 0x8086 |
2408 | #define PCIID_VENDOR_ALI 0x10b9 | 2408 | #define PCIID_VENDOR_ALI 0x10b9 |
2409 | static const struct smsc_ircc_subsystem_configuration subsystem_configurations[] __devinitconst = { | 2409 | static struct smsc_ircc_subsystem_configuration subsystem_configurations[] __initdata = { |
2410 | /* | 2410 | /* |
2411 | * Subsystems needing entries: | 2411 | * Subsystems needing entries: |
2412 | * 0x10b9:0x1533 0x103c:0x0850 HP nx9010 family | 2412 | * 0x10b9:0x1533 0x103c:0x0850 HP nx9010 family |
@@ -2532,7 +2532,7 @@ static const struct smsc_ircc_subsystem_configuration subsystem_configurations[] | |||
2532 | * (FIR port, SIR port, FIR DMA, FIR IRQ) | 2532 | * (FIR port, SIR port, FIR DMA, FIR IRQ) |
2533 | * through the chip configuration port. | 2533 | * through the chip configuration port. |
2534 | */ | 2534 | */ |
2535 | static int __devinit preconfigure_smsc_chip(struct | 2535 | static int __init preconfigure_smsc_chip(struct |
2536 | smsc_ircc_subsystem_configuration | 2536 | smsc_ircc_subsystem_configuration |
2537 | *conf) | 2537 | *conf) |
2538 | { | 2538 | { |
@@ -2633,7 +2633,7 @@ static int __devinit preconfigure_smsc_chip(struct | |||
2633 | * or Intel 82801DB/DBL (ICH4/ICH4-L) LPC Interface Bridge. | 2633 | * or Intel 82801DB/DBL (ICH4/ICH4-L) LPC Interface Bridge. |
2634 | * They all work the same way! | 2634 | * They all work the same way! |
2635 | */ | 2635 | */ |
2636 | static int __devinit preconfigure_through_82801(struct pci_dev *dev, | 2636 | static int __init preconfigure_through_82801(struct pci_dev *dev, |
2637 | struct | 2637 | struct |
2638 | smsc_ircc_subsystem_configuration | 2638 | smsc_ircc_subsystem_configuration |
2639 | *conf) | 2639 | *conf) |
@@ -2786,7 +2786,7 @@ static int __devinit preconfigure_through_82801(struct pci_dev *dev, | |||
2786 | * This is based on reverse-engineering since ALi does not | 2786 | * This is based on reverse-engineering since ALi does not |
2787 | * provide any data sheet for the 1533 chip. | 2787 | * provide any data sheet for the 1533 chip. |
2788 | */ | 2788 | */ |
2789 | static void __devinit preconfigure_ali_port(struct pci_dev *dev, | 2789 | static void __init preconfigure_ali_port(struct pci_dev *dev, |
2790 | unsigned short port) | 2790 | unsigned short port) |
2791 | { | 2791 | { |
2792 | unsigned char reg; | 2792 | unsigned char reg; |
@@ -2824,7 +2824,7 @@ static void __devinit preconfigure_ali_port(struct pci_dev *dev, | |||
2824 | IRDA_MESSAGE("Activated ALi 1533 ISA bridge port 0x%04x.\n", port); | 2824 | IRDA_MESSAGE("Activated ALi 1533 ISA bridge port 0x%04x.\n", port); |
2825 | } | 2825 | } |
2826 | 2826 | ||
2827 | static int __devinit preconfigure_through_ali(struct pci_dev *dev, | 2827 | static int __init preconfigure_through_ali(struct pci_dev *dev, |
2828 | struct | 2828 | struct |
2829 | smsc_ircc_subsystem_configuration | 2829 | smsc_ircc_subsystem_configuration |
2830 | *conf) | 2830 | *conf) |
@@ -2837,7 +2837,7 @@ static int __devinit preconfigure_through_ali(struct pci_dev *dev, | |||
2837 | return preconfigure_smsc_chip(conf); | 2837 | return preconfigure_smsc_chip(conf); |
2838 | } | 2838 | } |
2839 | 2839 | ||
2840 | static int __devinit smsc_ircc_preconfigure_subsystems(unsigned short ircc_cfg, | 2840 | static int __init smsc_ircc_preconfigure_subsystems(unsigned short ircc_cfg, |
2841 | unsigned short ircc_fir, | 2841 | unsigned short ircc_fir, |
2842 | unsigned short ircc_sir, | 2842 | unsigned short ircc_sir, |
2843 | unsigned char ircc_dma, | 2843 | unsigned char ircc_dma, |
@@ -2849,7 +2849,7 @@ static int __devinit smsc_ircc_preconfigure_subsystems(unsigned short ircc_cfg, | |||
2849 | int ret = 0; | 2849 | int ret = 0; |
2850 | 2850 | ||
2851 | for_each_pci_dev(dev) { | 2851 | for_each_pci_dev(dev) { |
2852 | const struct smsc_ircc_subsystem_configuration *conf; | 2852 | struct smsc_ircc_subsystem_configuration *conf; |
2853 | 2853 | ||
2854 | /* | 2854 | /* |
2855 | * Cache the subsystem vendor/device: | 2855 | * Cache the subsystem vendor/device: |
diff --git a/drivers/net/ks8842.c b/drivers/net/ks8842.c index 4d40626b3bfa..fc12ac0d9f2e 100644 --- a/drivers/net/ks8842.c +++ b/drivers/net/ks8842.c | |||
@@ -661,7 +661,7 @@ static void ks8842_rx_frame(struct net_device *netdev, | |||
661 | 661 | ||
662 | /* check the status */ | 662 | /* check the status */ |
663 | if ((status & RXSR_VALID) && !(status & RXSR_ERROR)) { | 663 | if ((status & RXSR_VALID) && !(status & RXSR_ERROR)) { |
664 | struct sk_buff *skb = netdev_alloc_skb_ip_align(netdev, len); | 664 | struct sk_buff *skb = netdev_alloc_skb_ip_align(netdev, len + 3); |
665 | 665 | ||
666 | if (skb) { | 666 | if (skb) { |
667 | 667 | ||
diff --git a/drivers/net/ne3210.c b/drivers/net/ne3210.c index e8984b0ca521..243ed2aee88e 100644 --- a/drivers/net/ne3210.c +++ b/drivers/net/ne3210.c | |||
@@ -80,20 +80,17 @@ static void ne3210_block_output(struct net_device *dev, int count, const unsigne | |||
80 | 80 | ||
81 | #define NE3210_DEBUG 0x0 | 81 | #define NE3210_DEBUG 0x0 |
82 | 82 | ||
83 | static const unsigned char irq_map[] __devinitconst = | 83 | static unsigned char irq_map[] __initdata = {15, 12, 11, 10, 9, 7, 5, 3}; |
84 | { 15, 12, 11, 10, 9, 7, 5, 3 }; | 84 | static unsigned int shmem_map[] __initdata = {0xff0, 0xfe0, 0xfff0, 0xd8, 0xffe0, 0xffc0, 0xd0, 0x0}; |
85 | static const unsigned int shmem_map[] __devinitconst = | 85 | static const char *ifmap[] __initdata = {"UTP", "?", "BNC", "AUI"}; |
86 | { 0xff0, 0xfe0, 0xfff0, 0xd8, 0xffe0, 0xffc0, 0xd0, 0x0 }; | 86 | static int ifmap_val[] __initdata = { |
87 | static const char *const ifmap[] __devinitconst = | ||
88 | { "UTP", "?", "BNC", "AUI" }; | ||
89 | static const int ifmap_val[] __devinitconst = { | ||
90 | IF_PORT_10BASET, | 87 | IF_PORT_10BASET, |
91 | IF_PORT_UNKNOWN, | 88 | IF_PORT_UNKNOWN, |
92 | IF_PORT_10BASE2, | 89 | IF_PORT_10BASE2, |
93 | IF_PORT_AUI, | 90 | IF_PORT_AUI, |
94 | }; | 91 | }; |
95 | 92 | ||
96 | static int __devinit ne3210_eisa_probe (struct device *device) | 93 | static int __init ne3210_eisa_probe (struct device *device) |
97 | { | 94 | { |
98 | unsigned long ioaddr, phys_mem; | 95 | unsigned long ioaddr, phys_mem; |
99 | int i, retval, port_index; | 96 | int i, retval, port_index; |
@@ -316,7 +313,7 @@ static void ne3210_block_output(struct net_device *dev, int count, | |||
316 | memcpy_toio(shmem, buf, count); | 313 | memcpy_toio(shmem, buf, count); |
317 | } | 314 | } |
318 | 315 | ||
319 | static const struct eisa_device_id ne3210_ids[] __devinitconst = { | 316 | static struct eisa_device_id ne3210_ids[] = { |
320 | { "EGL0101" }, | 317 | { "EGL0101" }, |
321 | { "NVL1801" }, | 318 | { "NVL1801" }, |
322 | { "" }, | 319 | { "" }, |
diff --git a/drivers/net/ppp_async.c b/drivers/net/ppp_async.c index 53872d7d7382..a1b82c9c67d2 100644 --- a/drivers/net/ppp_async.c +++ b/drivers/net/ppp_async.c | |||
@@ -340,7 +340,7 @@ ppp_asynctty_poll(struct tty_struct *tty, struct file *file, poll_table *wait) | |||
340 | } | 340 | } |
341 | 341 | ||
342 | /* May sleep, don't call from interrupt level or with interrupts disabled */ | 342 | /* May sleep, don't call from interrupt level or with interrupts disabled */ |
343 | static unsigned int | 343 | static void |
344 | ppp_asynctty_receive(struct tty_struct *tty, const unsigned char *buf, | 344 | ppp_asynctty_receive(struct tty_struct *tty, const unsigned char *buf, |
345 | char *cflags, int count) | 345 | char *cflags, int count) |
346 | { | 346 | { |
@@ -348,7 +348,7 @@ ppp_asynctty_receive(struct tty_struct *tty, const unsigned char *buf, | |||
348 | unsigned long flags; | 348 | unsigned long flags; |
349 | 349 | ||
350 | if (!ap) | 350 | if (!ap) |
351 | return -ENODEV; | 351 | return; |
352 | spin_lock_irqsave(&ap->recv_lock, flags); | 352 | spin_lock_irqsave(&ap->recv_lock, flags); |
353 | ppp_async_input(ap, buf, cflags, count); | 353 | ppp_async_input(ap, buf, cflags, count); |
354 | spin_unlock_irqrestore(&ap->recv_lock, flags); | 354 | spin_unlock_irqrestore(&ap->recv_lock, flags); |
@@ -356,8 +356,6 @@ ppp_asynctty_receive(struct tty_struct *tty, const unsigned char *buf, | |||
356 | tasklet_schedule(&ap->tsk); | 356 | tasklet_schedule(&ap->tsk); |
357 | ap_put(ap); | 357 | ap_put(ap); |
358 | tty_unthrottle(tty); | 358 | tty_unthrottle(tty); |
359 | |||
360 | return count; | ||
361 | } | 359 | } |
362 | 360 | ||
363 | static void | 361 | static void |
diff --git a/drivers/net/ppp_synctty.c b/drivers/net/ppp_synctty.c index 0815790a5cf9..2573f525f11c 100644 --- a/drivers/net/ppp_synctty.c +++ b/drivers/net/ppp_synctty.c | |||
@@ -381,7 +381,7 @@ ppp_sync_poll(struct tty_struct *tty, struct file *file, poll_table *wait) | |||
381 | } | 381 | } |
382 | 382 | ||
383 | /* May sleep, don't call from interrupt level or with interrupts disabled */ | 383 | /* May sleep, don't call from interrupt level or with interrupts disabled */ |
384 | static unsigned int | 384 | static void |
385 | ppp_sync_receive(struct tty_struct *tty, const unsigned char *buf, | 385 | ppp_sync_receive(struct tty_struct *tty, const unsigned char *buf, |
386 | char *cflags, int count) | 386 | char *cflags, int count) |
387 | { | 387 | { |
@@ -389,7 +389,7 @@ ppp_sync_receive(struct tty_struct *tty, const unsigned char *buf, | |||
389 | unsigned long flags; | 389 | unsigned long flags; |
390 | 390 | ||
391 | if (!ap) | 391 | if (!ap) |
392 | return -ENODEV; | 392 | return; |
393 | spin_lock_irqsave(&ap->recv_lock, flags); | 393 | spin_lock_irqsave(&ap->recv_lock, flags); |
394 | ppp_sync_input(ap, buf, cflags, count); | 394 | ppp_sync_input(ap, buf, cflags, count); |
395 | spin_unlock_irqrestore(&ap->recv_lock, flags); | 395 | spin_unlock_irqrestore(&ap->recv_lock, flags); |
@@ -397,8 +397,6 @@ ppp_sync_receive(struct tty_struct *tty, const unsigned char *buf, | |||
397 | tasklet_schedule(&ap->tsk); | 397 | tasklet_schedule(&ap->tsk); |
398 | sp_put(ap); | 398 | sp_put(ap); |
399 | tty_unthrottle(tty); | 399 | tty_unthrottle(tty); |
400 | |||
401 | return count; | ||
402 | } | 400 | } |
403 | 401 | ||
404 | static void | 402 | static void |
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/slip.c b/drivers/net/slip.c index 584809c656d5..8ec1a9a0bb9a 100644 --- a/drivers/net/slip.c +++ b/drivers/net/slip.c | |||
@@ -670,17 +670,16 @@ static void sl_setup(struct net_device *dev) | |||
670 | * in parallel | 670 | * in parallel |
671 | */ | 671 | */ |
672 | 672 | ||
673 | static unsigned int slip_receive_buf(struct tty_struct *tty, | 673 | static void slip_receive_buf(struct tty_struct *tty, const unsigned char *cp, |
674 | const unsigned char *cp, char *fp, int count) | 674 | char *fp, int count) |
675 | { | 675 | { |
676 | struct slip *sl = tty->disc_data; | 676 | struct slip *sl = tty->disc_data; |
677 | int bytes = count; | ||
678 | 677 | ||
679 | if (!sl || sl->magic != SLIP_MAGIC || !netif_running(sl->dev)) | 678 | if (!sl || sl->magic != SLIP_MAGIC || !netif_running(sl->dev)) |
680 | return -ENODEV; | 679 | return; |
681 | 680 | ||
682 | /* Read the characters out of the buffer */ | 681 | /* Read the characters out of the buffer */ |
683 | while (bytes--) { | 682 | while (count--) { |
684 | if (fp && *fp++) { | 683 | if (fp && *fp++) { |
685 | if (!test_and_set_bit(SLF_ERROR, &sl->flags)) | 684 | if (!test_and_set_bit(SLF_ERROR, &sl->flags)) |
686 | sl->dev->stats.rx_errors++; | 685 | sl->dev->stats.rx_errors++; |
@@ -694,8 +693,6 @@ static unsigned int slip_receive_buf(struct tty_struct *tty, | |||
694 | #endif | 693 | #endif |
695 | slip_unesc(sl, *cp++); | 694 | slip_unesc(sl, *cp++); |
696 | } | 695 | } |
697 | |||
698 | return count; | ||
699 | } | 696 | } |
700 | 697 | ||
701 | /************************************ | 698 | /************************************ |
diff --git a/drivers/net/smc-mca.c b/drivers/net/smc-mca.c index 0f29f261fcfe..d07c39cb4daf 100644 --- a/drivers/net/smc-mca.c +++ b/drivers/net/smc-mca.c | |||
@@ -156,7 +156,7 @@ static const struct { | |||
156 | { 14, 15 } | 156 | { 14, 15 } |
157 | }; | 157 | }; |
158 | 158 | ||
159 | static const short smc_mca_adapter_ids[] __devinitconst = { | 159 | static short smc_mca_adapter_ids[] __initdata = { |
160 | 0x61c8, | 160 | 0x61c8, |
161 | 0x61c9, | 161 | 0x61c9, |
162 | 0x6fc0, | 162 | 0x6fc0, |
@@ -168,7 +168,7 @@ static const short smc_mca_adapter_ids[] __devinitconst = { | |||
168 | 0x0000 | 168 | 0x0000 |
169 | }; | 169 | }; |
170 | 170 | ||
171 | static const char *const smc_mca_adapter_names[] __devinitconst = { | 171 | static char *smc_mca_adapter_names[] __initdata = { |
172 | "SMC Ethercard PLUS Elite/A BNC/AUI (WD8013EP/A)", | 172 | "SMC Ethercard PLUS Elite/A BNC/AUI (WD8013EP/A)", |
173 | "SMC Ethercard PLUS Elite/A UTP/AUI (WD8013WP/A)", | 173 | "SMC Ethercard PLUS Elite/A UTP/AUI (WD8013WP/A)", |
174 | "WD Ethercard PLUS/A (WD8003E/A or WD8003ET/A)", | 174 | "WD Ethercard PLUS/A (WD8003E/A or WD8003ET/A)", |
@@ -199,7 +199,7 @@ static const struct net_device_ops ultramca_netdev_ops = { | |||
199 | #endif | 199 | #endif |
200 | }; | 200 | }; |
201 | 201 | ||
202 | static int __devinit ultramca_probe(struct device *gen_dev) | 202 | static int __init ultramca_probe(struct device *gen_dev) |
203 | { | 203 | { |
204 | unsigned short ioaddr; | 204 | unsigned short ioaddr; |
205 | struct net_device *dev; | 205 | struct net_device *dev; |
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/tg3.c b/drivers/net/tg3.c index f4b01c638a33..a1f9f9eef37d 100644 --- a/drivers/net/tg3.c +++ b/drivers/net/tg3.c | |||
@@ -5774,7 +5774,7 @@ static void tg3_skb_error_unmap(struct tg3_napi *tnapi, | |||
5774 | dma_unmap_addr(txb, mapping), | 5774 | dma_unmap_addr(txb, mapping), |
5775 | skb_headlen(skb), | 5775 | skb_headlen(skb), |
5776 | PCI_DMA_TODEVICE); | 5776 | PCI_DMA_TODEVICE); |
5777 | for (i = 0; i <= last; i++) { | 5777 | for (i = 0; i < last; i++) { |
5778 | skb_frag_t *frag = &skb_shinfo(skb)->frags[i]; | 5778 | skb_frag_t *frag = &skb_shinfo(skb)->frags[i]; |
5779 | 5779 | ||
5780 | entry = NEXT_TX(entry); | 5780 | entry = NEXT_TX(entry); |
diff --git a/drivers/net/tokenring/madgemc.c b/drivers/net/tokenring/madgemc.c index 1313aa1315f0..2bedc0ace812 100644 --- a/drivers/net/tokenring/madgemc.c +++ b/drivers/net/tokenring/madgemc.c | |||
@@ -727,7 +727,7 @@ static int __devexit madgemc_remove(struct device *device) | |||
727 | return 0; | 727 | return 0; |
728 | } | 728 | } |
729 | 729 | ||
730 | static const short madgemc_adapter_ids[] __devinitconst = { | 730 | static short madgemc_adapter_ids[] __initdata = { |
731 | 0x002d, | 731 | 0x002d, |
732 | 0x0000 | 732 | 0x0000 |
733 | }; | 733 | }; |
diff --git a/drivers/net/tulip/de4x5.c b/drivers/net/tulip/de4x5.c index 45144d5bd11b..efaa1d69b720 100644 --- a/drivers/net/tulip/de4x5.c +++ b/drivers/net/tulip/de4x5.c | |||
@@ -1995,7 +1995,7 @@ SetMulticastFilter(struct net_device *dev) | |||
1995 | 1995 | ||
1996 | static u_char de4x5_irq[] = EISA_ALLOWED_IRQ_LIST; | 1996 | static u_char de4x5_irq[] = EISA_ALLOWED_IRQ_LIST; |
1997 | 1997 | ||
1998 | static int __devinit de4x5_eisa_probe (struct device *gendev) | 1998 | static int __init de4x5_eisa_probe (struct device *gendev) |
1999 | { | 1999 | { |
2000 | struct eisa_device *edev; | 2000 | struct eisa_device *edev; |
2001 | u_long iobase; | 2001 | u_long iobase; |
@@ -2097,7 +2097,7 @@ static int __devexit de4x5_eisa_remove (struct device *device) | |||
2097 | return 0; | 2097 | return 0; |
2098 | } | 2098 | } |
2099 | 2099 | ||
2100 | static const struct eisa_device_id de4x5_eisa_ids[] __devinitconst = { | 2100 | static struct eisa_device_id de4x5_eisa_ids[] = { |
2101 | { "DEC4250", 0 }, /* 0 is the board name index... */ | 2101 | { "DEC4250", 0 }, /* 0 is the board name index... */ |
2102 | { "" } | 2102 | { "" } |
2103 | }; | 2103 | }; |
diff --git a/drivers/net/usb/catc.c b/drivers/net/usb/catc.c index d7221c4a5dcf..8056f8a27c6a 100644 --- a/drivers/net/usb/catc.c +++ b/drivers/net/usb/catc.c | |||
@@ -495,7 +495,7 @@ static void catc_ctrl_run(struct catc *catc) | |||
495 | if (!q->dir && q->buf && q->len) | 495 | if (!q->dir && q->buf && q->len) |
496 | memcpy(catc->ctrl_buf, q->buf, q->len); | 496 | memcpy(catc->ctrl_buf, q->buf, q->len); |
497 | 497 | ||
498 | if ((status = usb_submit_urb(catc->ctrl_urb, GFP_KERNEL))) | 498 | if ((status = usb_submit_urb(catc->ctrl_urb, GFP_ATOMIC))) |
499 | err("submit(ctrl_urb) status %d", status); | 499 | err("submit(ctrl_urb) status %d", status); |
500 | } | 500 | } |
501 | 501 | ||
diff --git a/drivers/net/usb/cdc_ncm.c b/drivers/net/usb/cdc_ncm.c index cdd3ae486109..f33ca6aa29e9 100644 --- a/drivers/net/usb/cdc_ncm.c +++ b/drivers/net/usb/cdc_ncm.c | |||
@@ -54,7 +54,7 @@ | |||
54 | #include <linux/usb/usbnet.h> | 54 | #include <linux/usb/usbnet.h> |
55 | #include <linux/usb/cdc.h> | 55 | #include <linux/usb/cdc.h> |
56 | 56 | ||
57 | #define DRIVER_VERSION "24-May-2011" | 57 | #define DRIVER_VERSION "01-June-2011" |
58 | 58 | ||
59 | /* CDC NCM subclass 3.2.1 */ | 59 | /* CDC NCM subclass 3.2.1 */ |
60 | #define USB_CDC_NCM_NDP16_LENGTH_MIN 0x10 | 60 | #define USB_CDC_NCM_NDP16_LENGTH_MIN 0x10 |
@@ -1234,6 +1234,7 @@ static struct usb_driver cdc_ncm_driver = { | |||
1234 | .disconnect = cdc_ncm_disconnect, | 1234 | .disconnect = cdc_ncm_disconnect, |
1235 | .suspend = usbnet_suspend, | 1235 | .suspend = usbnet_suspend, |
1236 | .resume = usbnet_resume, | 1236 | .resume = usbnet_resume, |
1237 | .reset_resume = usbnet_resume, | ||
1237 | .supports_autosuspend = 1, | 1238 | .supports_autosuspend = 1, |
1238 | }; | 1239 | }; |
1239 | 1240 | ||
diff --git a/drivers/net/wan/x25_asy.c b/drivers/net/wan/x25_asy.c index 40398bf7d036..24297b274cd4 100644 --- a/drivers/net/wan/x25_asy.c +++ b/drivers/net/wan/x25_asy.c | |||
@@ -517,18 +517,17 @@ static int x25_asy_close(struct net_device *dev) | |||
517 | * and sent on to some IP layer for further processing. | 517 | * and sent on to some IP layer for further processing. |
518 | */ | 518 | */ |
519 | 519 | ||
520 | static unsigned int x25_asy_receive_buf(struct tty_struct *tty, | 520 | static void x25_asy_receive_buf(struct tty_struct *tty, |
521 | const unsigned char *cp, char *fp, int count) | 521 | const unsigned char *cp, char *fp, int count) |
522 | { | 522 | { |
523 | struct x25_asy *sl = tty->disc_data; | 523 | struct x25_asy *sl = tty->disc_data; |
524 | int bytes = count; | ||
525 | 524 | ||
526 | if (!sl || sl->magic != X25_ASY_MAGIC || !netif_running(sl->dev)) | 525 | if (!sl || sl->magic != X25_ASY_MAGIC || !netif_running(sl->dev)) |
527 | return; | 526 | return; |
528 | 527 | ||
529 | 528 | ||
530 | /* Read the characters out of the buffer */ | 529 | /* Read the characters out of the buffer */ |
531 | while (bytes--) { | 530 | while (count--) { |
532 | if (fp && *fp++) { | 531 | if (fp && *fp++) { |
533 | if (!test_and_set_bit(SLF_ERROR, &sl->flags)) | 532 | if (!test_and_set_bit(SLF_ERROR, &sl->flags)) |
534 | sl->dev->stats.rx_errors++; | 533 | sl->dev->stats.rx_errors++; |
@@ -537,8 +536,6 @@ static unsigned int x25_asy_receive_buf(struct tty_struct *tty, | |||
537 | } | 536 | } |
538 | x25_asy_unesc(sl, *cp++); | 537 | x25_asy_unesc(sl, *cp++); |
539 | } | 538 | } |
540 | |||
541 | return count; | ||
542 | } | 539 | } |
543 | 540 | ||
544 | /* | 541 | /* |
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/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/Kconfig b/drivers/net/wireless/ath/ath9k/Kconfig index d9ff8413ab9a..d9c08c619a3a 100644 --- a/drivers/net/wireless/ath/ath9k/Kconfig +++ b/drivers/net/wireless/ath/ath9k/Kconfig | |||
@@ -26,7 +26,6 @@ config ATH9K | |||
26 | config ATH9K_PCI | 26 | config ATH9K_PCI |
27 | bool "Atheros ath9k PCI/PCIe bus support" | 27 | bool "Atheros ath9k PCI/PCIe bus support" |
28 | depends on ATH9K && PCI | 28 | depends on ATH9K && PCI |
29 | default PCI | ||
30 | ---help--- | 29 | ---help--- |
31 | This option enables the PCI bus support in ath9k. | 30 | This option enables the PCI bus support in ath9k. |
32 | 31 | ||
diff --git a/drivers/net/wireless/ath/ath9k/ar9002_calib.c b/drivers/net/wireless/ath/ath9k/ar9002_calib.c index 015d97439935..2d4c0910295b 100644 --- a/drivers/net/wireless/ath/ath9k/ar9002_calib.c +++ b/drivers/net/wireless/ath/ath9k/ar9002_calib.c | |||
@@ -829,7 +829,7 @@ static bool ar9002_hw_init_cal(struct ath_hw *ah, struct ath9k_channel *chan) | |||
829 | if (AR_SREV_9271(ah)) { | 829 | if (AR_SREV_9271(ah)) { |
830 | if (!ar9285_hw_cl_cal(ah, chan)) | 830 | if (!ar9285_hw_cl_cal(ah, chan)) |
831 | return false; | 831 | return false; |
832 | } else if (AR_SREV_9285_12_OR_LATER(ah)) { | 832 | } else if (AR_SREV_9285(ah) && AR_SREV_9285_12_OR_LATER(ah)) { |
833 | if (!ar9285_hw_clc(ah, chan)) | 833 | if (!ar9285_hw_clc(ah, chan)) |
834 | return false; | 834 | return false; |
835 | } else { | 835 | } else { |
diff --git a/drivers/net/wireless/ath/ath9k/ar9003_eeprom.c b/drivers/net/wireless/ath/ath9k/ar9003_eeprom.c index 0ca7635d0669..ff8150e46f0e 100644 --- a/drivers/net/wireless/ath/ath9k/ar9003_eeprom.c +++ b/drivers/net/wireless/ath/ath9k/ar9003_eeprom.c | |||
@@ -4645,10 +4645,16 @@ static void ar9003_hw_set_power_per_rate_table(struct ath_hw *ah, | |||
4645 | case 1: | 4645 | case 1: |
4646 | break; | 4646 | break; |
4647 | case 2: | 4647 | case 2: |
4648 | scaledPower -= REDUCE_SCALED_POWER_BY_TWO_CHAIN; | 4648 | if (scaledPower > REDUCE_SCALED_POWER_BY_TWO_CHAIN) |
4649 | scaledPower -= REDUCE_SCALED_POWER_BY_TWO_CHAIN; | ||
4650 | else | ||
4651 | scaledPower = 0; | ||
4649 | break; | 4652 | break; |
4650 | case 3: | 4653 | case 3: |
4651 | scaledPower -= REDUCE_SCALED_POWER_BY_THREE_CHAIN; | 4654 | if (scaledPower > REDUCE_SCALED_POWER_BY_THREE_CHAIN) |
4655 | scaledPower -= REDUCE_SCALED_POWER_BY_THREE_CHAIN; | ||
4656 | else | ||
4657 | scaledPower = 0; | ||
4652 | break; | 4658 | break; |
4653 | } | 4659 | } |
4654 | 4660 | ||
diff --git a/drivers/net/wireless/ath/ath9k/ar9003_phy.c b/drivers/net/wireless/ath/ath9k/ar9003_phy.c index eee23ecd118a..892c48b15434 100644 --- a/drivers/net/wireless/ath/ath9k/ar9003_phy.c +++ b/drivers/net/wireless/ath/ath9k/ar9003_phy.c | |||
@@ -1381,3 +1381,25 @@ void ar9003_hw_bb_watchdog_dbg_info(struct ath_hw *ah) | |||
1381 | "==== BB update: done ====\n\n"); | 1381 | "==== BB update: done ====\n\n"); |
1382 | } | 1382 | } |
1383 | EXPORT_SYMBOL(ar9003_hw_bb_watchdog_dbg_info); | 1383 | EXPORT_SYMBOL(ar9003_hw_bb_watchdog_dbg_info); |
1384 | |||
1385 | void ar9003_hw_disable_phy_restart(struct ath_hw *ah) | ||
1386 | { | ||
1387 | u32 val; | ||
1388 | |||
1389 | /* While receiving unsupported rate frame rx state machine | ||
1390 | * gets into a state 0xb and if phy_restart happens in that | ||
1391 | * state, BB would go hang. If RXSM is in 0xb state after | ||
1392 | * first bb panic, ensure to disable the phy_restart. | ||
1393 | */ | ||
1394 | if (!((MS(ah->bb_watchdog_last_status, | ||
1395 | AR_PHY_WATCHDOG_RX_OFDM_SM) == 0xb) || | ||
1396 | ah->bb_hang_rx_ofdm)) | ||
1397 | return; | ||
1398 | |||
1399 | ah->bb_hang_rx_ofdm = true; | ||
1400 | val = REG_READ(ah, AR_PHY_RESTART); | ||
1401 | val &= ~AR_PHY_RESTART_ENA; | ||
1402 | |||
1403 | REG_WRITE(ah, AR_PHY_RESTART, val); | ||
1404 | } | ||
1405 | EXPORT_SYMBOL(ar9003_hw_disable_phy_restart); | ||
diff --git a/drivers/net/wireless/ath/ath9k/eeprom_9287.c b/drivers/net/wireless/ath/ath9k/eeprom_9287.c index 7856f0d4512d..343fc9f946db 100644 --- a/drivers/net/wireless/ath/ath9k/eeprom_9287.c +++ b/drivers/net/wireless/ath/ath9k/eeprom_9287.c | |||
@@ -524,10 +524,16 @@ static void ath9k_hw_set_ar9287_power_per_rate_table(struct ath_hw *ah, | |||
524 | case 1: | 524 | case 1: |
525 | break; | 525 | break; |
526 | case 2: | 526 | case 2: |
527 | scaledPower -= REDUCE_SCALED_POWER_BY_TWO_CHAIN; | 527 | if (scaledPower > REDUCE_SCALED_POWER_BY_TWO_CHAIN) |
528 | scaledPower -= REDUCE_SCALED_POWER_BY_TWO_CHAIN; | ||
529 | else | ||
530 | scaledPower = 0; | ||
528 | break; | 531 | break; |
529 | case 3: | 532 | case 3: |
530 | scaledPower -= REDUCE_SCALED_POWER_BY_THREE_CHAIN; | 533 | if (scaledPower > REDUCE_SCALED_POWER_BY_THREE_CHAIN) |
534 | scaledPower -= REDUCE_SCALED_POWER_BY_THREE_CHAIN; | ||
535 | else | ||
536 | scaledPower = 0; | ||
531 | break; | 537 | break; |
532 | } | 538 | } |
533 | scaledPower = max((u16)0, scaledPower); | 539 | scaledPower = max((u16)0, scaledPower); |
diff --git a/drivers/net/wireless/ath/ath9k/hw.c b/drivers/net/wireless/ath/ath9k/hw.c index 72543ce8f616..1be7c8bbef84 100644 --- a/drivers/net/wireless/ath/ath9k/hw.c +++ b/drivers/net/wireless/ath/ath9k/hw.c | |||
@@ -1555,9 +1555,12 @@ int ath9k_hw_reset(struct ath_hw *ah, struct ath9k_channel *chan, | |||
1555 | if (ah->btcoex_hw.enabled) | 1555 | if (ah->btcoex_hw.enabled) |
1556 | ath9k_hw_btcoex_enable(ah); | 1556 | ath9k_hw_btcoex_enable(ah); |
1557 | 1557 | ||
1558 | if (AR_SREV_9300_20_OR_LATER(ah)) | 1558 | if (AR_SREV_9300_20_OR_LATER(ah)) { |
1559 | ar9003_hw_bb_watchdog_config(ah); | 1559 | ar9003_hw_bb_watchdog_config(ah); |
1560 | 1560 | ||
1561 | ar9003_hw_disable_phy_restart(ah); | ||
1562 | } | ||
1563 | |||
1561 | ath9k_hw_apply_gpio_override(ah); | 1564 | ath9k_hw_apply_gpio_override(ah); |
1562 | 1565 | ||
1563 | return 0; | 1566 | return 0; |
diff --git a/drivers/net/wireless/ath/ath9k/hw.h b/drivers/net/wireless/ath/ath9k/hw.h index 57435ce62792..4b157c53d1a8 100644 --- a/drivers/net/wireless/ath/ath9k/hw.h +++ b/drivers/net/wireless/ath/ath9k/hw.h | |||
@@ -842,6 +842,7 @@ struct ath_hw { | |||
842 | 842 | ||
843 | u32 bb_watchdog_last_status; | 843 | u32 bb_watchdog_last_status; |
844 | u32 bb_watchdog_timeout_ms; /* in ms, 0 to disable */ | 844 | u32 bb_watchdog_timeout_ms; /* in ms, 0 to disable */ |
845 | u8 bb_hang_rx_ofdm; /* true if bb hang due to rx_ofdm */ | ||
845 | 846 | ||
846 | unsigned int paprd_target_power; | 847 | unsigned int paprd_target_power; |
847 | unsigned int paprd_training_power; | 848 | unsigned int paprd_training_power; |
@@ -990,6 +991,7 @@ void ar9002_hw_enable_wep_aggregation(struct ath_hw *ah); | |||
990 | void ar9003_hw_bb_watchdog_config(struct ath_hw *ah); | 991 | void ar9003_hw_bb_watchdog_config(struct ath_hw *ah); |
991 | void ar9003_hw_bb_watchdog_read(struct ath_hw *ah); | 992 | void ar9003_hw_bb_watchdog_read(struct ath_hw *ah); |
992 | void ar9003_hw_bb_watchdog_dbg_info(struct ath_hw *ah); | 993 | void ar9003_hw_bb_watchdog_dbg_info(struct ath_hw *ah); |
994 | void ar9003_hw_disable_phy_restart(struct ath_hw *ah); | ||
993 | void ar9003_paprd_enable(struct ath_hw *ah, bool val); | 995 | void ar9003_paprd_enable(struct ath_hw *ah, bool val); |
994 | void ar9003_paprd_populate_single_table(struct ath_hw *ah, | 996 | void ar9003_paprd_populate_single_table(struct ath_hw *ah, |
995 | struct ath9k_hw_cal_data *caldata, | 997 | struct ath9k_hw_cal_data *caldata, |
diff --git a/drivers/net/wireless/ath/ath9k/main.c b/drivers/net/wireless/ath/ath9k/main.c index a198ee374b05..2ca351fe6d3c 100644 --- a/drivers/net/wireless/ath/ath9k/main.c +++ b/drivers/net/wireless/ath/ath9k/main.c | |||
@@ -670,7 +670,8 @@ void ath9k_tasklet(unsigned long data) | |||
670 | u32 status = sc->intrstatus; | 670 | u32 status = sc->intrstatus; |
671 | u32 rxmask; | 671 | u32 rxmask; |
672 | 672 | ||
673 | if (status & ATH9K_INT_FATAL) { | 673 | if ((status & ATH9K_INT_FATAL) || |
674 | (status & ATH9K_INT_BB_WATCHDOG)) { | ||
674 | ath_reset(sc, true); | 675 | ath_reset(sc, true); |
675 | return; | 676 | return; |
676 | } | 677 | } |
@@ -737,6 +738,7 @@ irqreturn_t ath_isr(int irq, void *dev) | |||
737 | { | 738 | { |
738 | #define SCHED_INTR ( \ | 739 | #define SCHED_INTR ( \ |
739 | ATH9K_INT_FATAL | \ | 740 | ATH9K_INT_FATAL | \ |
741 | ATH9K_INT_BB_WATCHDOG | \ | ||
740 | ATH9K_INT_RXORN | \ | 742 | ATH9K_INT_RXORN | \ |
741 | ATH9K_INT_RXEOL | \ | 743 | ATH9K_INT_RXEOL | \ |
742 | ATH9K_INT_RX | \ | 744 | ATH9K_INT_RX | \ |
diff --git a/drivers/net/wireless/ath/ath9k/rc.c b/drivers/net/wireless/ath/ath9k/rc.c index 17542214c93f..ba7f36ab0a74 100644 --- a/drivers/net/wireless/ath/ath9k/rc.c +++ b/drivers/net/wireless/ath/ath9k/rc.c | |||
@@ -689,7 +689,8 @@ static void ath_rc_rate_set_series(const struct ath_rate_table *rate_table, | |||
689 | 689 | ||
690 | if (WLAN_RC_PHY_HT(rate_table->info[rix].phy)) { | 690 | if (WLAN_RC_PHY_HT(rate_table->info[rix].phy)) { |
691 | rate->flags |= IEEE80211_TX_RC_MCS; | 691 | rate->flags |= IEEE80211_TX_RC_MCS; |
692 | if (WLAN_RC_PHY_40(rate_table->info[rix].phy)) | 692 | if (WLAN_RC_PHY_40(rate_table->info[rix].phy) && |
693 | conf_is_ht40(&txrc->hw->conf)) | ||
693 | rate->flags |= IEEE80211_TX_RC_40_MHZ_WIDTH; | 694 | rate->flags |= IEEE80211_TX_RC_40_MHZ_WIDTH; |
694 | if (WLAN_RC_PHY_SGI(rate_table->info[rix].phy)) | 695 | if (WLAN_RC_PHY_SGI(rate_table->info[rix].phy)) |
695 | rate->flags |= IEEE80211_TX_RC_SHORT_GI; | 696 | rate->flags |= IEEE80211_TX_RC_SHORT_GI; |
diff --git a/drivers/net/wireless/b43/phy_n.c b/drivers/net/wireless/b43/phy_n.c index 9ed65157bef5..05960ddde24e 100644 --- a/drivers/net/wireless/b43/phy_n.c +++ b/drivers/net/wireless/b43/phy_n.c | |||
@@ -3093,7 +3093,7 @@ static int b43_nphy_cal_tx_iq_lo(struct b43_wldev *dev, | |||
3093 | int freq; | 3093 | int freq; |
3094 | bool avoid = false; | 3094 | bool avoid = false; |
3095 | u8 length; | 3095 | u8 length; |
3096 | u16 tmp, core, type, count, max, numb, last, cmd; | 3096 | u16 tmp, core, type, count, max, numb, last = 0, cmd; |
3097 | const u16 *table; | 3097 | const u16 *table; |
3098 | bool phy6or5x; | 3098 | bool phy6or5x; |
3099 | 3099 | ||
diff --git a/drivers/net/wireless/iwlegacy/iwl-4965-lib.c b/drivers/net/wireless/iwlegacy/iwl-4965-lib.c index 7e5e85a017b5..a7a4739880dc 100644 --- a/drivers/net/wireless/iwlegacy/iwl-4965-lib.c +++ b/drivers/net/wireless/iwlegacy/iwl-4965-lib.c | |||
@@ -628,11 +628,11 @@ void iwl4965_rx_reply_rx(struct iwl_priv *priv, | |||
628 | 628 | ||
629 | /* rx_status carries information about the packet to mac80211 */ | 629 | /* rx_status carries information about the packet to mac80211 */ |
630 | rx_status.mactime = le64_to_cpu(phy_res->timestamp); | 630 | rx_status.mactime = le64_to_cpu(phy_res->timestamp); |
631 | rx_status.band = (phy_res->phy_flags & RX_RES_PHY_FLAGS_BAND_24_MSK) ? | ||
632 | IEEE80211_BAND_2GHZ : IEEE80211_BAND_5GHZ; | ||
631 | rx_status.freq = | 633 | rx_status.freq = |
632 | ieee80211_channel_to_frequency(le16_to_cpu(phy_res->channel), | 634 | ieee80211_channel_to_frequency(le16_to_cpu(phy_res->channel), |
633 | rx_status.band); | 635 | rx_status.band); |
634 | rx_status.band = (phy_res->phy_flags & RX_RES_PHY_FLAGS_BAND_24_MSK) ? | ||
635 | IEEE80211_BAND_2GHZ : IEEE80211_BAND_5GHZ; | ||
636 | rx_status.rate_idx = | 636 | rx_status.rate_idx = |
637 | iwl4965_hwrate_to_mac80211_idx(rate_n_flags, rx_status.band); | 637 | iwl4965_hwrate_to_mac80211_idx(rate_n_flags, rx_status.band); |
638 | rx_status.flag = 0; | 638 | rx_status.flag = 0; |
diff --git a/drivers/net/wireless/iwlegacy/iwl-4965.c b/drivers/net/wireless/iwlegacy/iwl-4965.c index f5433c74b845..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 | } |
@@ -1543,7 +1541,7 @@ static void iwl4965_temperature_calib(struct iwl_priv *priv) | |||
1543 | s32 temp; | 1541 | s32 temp; |
1544 | 1542 | ||
1545 | temp = iwl4965_hw_get_temperature(priv); | 1543 | temp = iwl4965_hw_get_temperature(priv); |
1546 | if (temp < 0) | 1544 | if (IWL_TX_POWER_TEMPERATURE_OUT_OF_RANGE(temp)) |
1547 | return; | 1545 | return; |
1548 | 1546 | ||
1549 | if (priv->temperature != temp) { | 1547 | if (priv->temperature != temp) { |
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-2000.c b/drivers/net/wireless/iwlwifi/iwl-2000.c index 86feec86d130..2282279cffc4 100644 --- a/drivers/net/wireless/iwlwifi/iwl-2000.c +++ b/drivers/net/wireless/iwlwifi/iwl-2000.c | |||
@@ -177,79 +177,6 @@ static int iwl2000_hw_set_hw_params(struct iwl_priv *priv) | |||
177 | return 0; | 177 | return 0; |
178 | } | 178 | } |
179 | 179 | ||
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 = { | 180 | static struct iwl_lib_ops iwl2000_lib = { |
254 | .set_hw_params = iwl2000_hw_set_hw_params, | 181 | .set_hw_params = iwl2000_hw_set_hw_params, |
255 | .rx_handler_setup = iwlagn_rx_handler_setup, | 182 | .rx_handler_setup = iwlagn_rx_handler_setup, |
@@ -258,7 +185,6 @@ static struct iwl_lib_ops iwl2000_lib = { | |||
258 | .is_valid_rtc_data_addr = iwlagn_hw_valid_rtc_data_addr, | 185 | .is_valid_rtc_data_addr = iwlagn_hw_valid_rtc_data_addr, |
259 | .send_tx_power = iwlagn_send_tx_power, | 186 | .send_tx_power = iwlagn_send_tx_power, |
260 | .update_chain_flags = iwl_update_chain_flags, | 187 | .update_chain_flags = iwl_update_chain_flags, |
261 | .set_channel_switch = iwl2030_hw_channel_switch, | ||
262 | .apm_ops = { | 188 | .apm_ops = { |
263 | .init = iwl_apm_init, | 189 | .init = iwl_apm_init, |
264 | .config = iwl2000_nic_config, | 190 | .config = iwl2000_nic_config, |
diff --git a/drivers/net/wireless/iwlwifi/iwl-5000.c b/drivers/net/wireless/iwlwifi/iwl-5000.c index a70b8cfafda1..f99f9c193352 100644 --- a/drivers/net/wireless/iwlwifi/iwl-5000.c +++ b/drivers/net/wireless/iwlwifi/iwl-5000.c | |||
@@ -331,8 +331,6 @@ static int iwl5000_hw_channel_switch(struct iwl_priv *priv, | |||
331 | ctx->active.channel, ch); | 331 | ctx->active.channel, ch); |
332 | return -EFAULT; | 332 | return -EFAULT; |
333 | } | 333 | } |
334 | priv->switch_rxon.channel = cmd.channel; | ||
335 | priv->switch_rxon.switch_in_progress = true; | ||
336 | 334 | ||
337 | return iwl_send_cmd_sync(priv, &hcmd); | 335 | return iwl_send_cmd_sync(priv, &hcmd); |
338 | } | 336 | } |
@@ -425,7 +423,6 @@ static struct iwl_base_params iwl5000_base_params = { | |||
425 | }; | 423 | }; |
426 | static struct iwl_ht_params iwl5000_ht_params = { | 424 | static struct iwl_ht_params iwl5000_ht_params = { |
427 | .ht_greenfield_support = true, | 425 | .ht_greenfield_support = true, |
428 | .use_rts_for_aggregation = true, /* use rts/cts protection */ | ||
429 | }; | 426 | }; |
430 | 427 | ||
431 | #define IWL_DEVICE_5000 \ | 428 | #define IWL_DEVICE_5000 \ |
diff --git a/drivers/net/wireless/iwlwifi/iwl-6000.c b/drivers/net/wireless/iwlwifi/iwl-6000.c index f8c710db6e6f..fbe565c816e3 100644 --- a/drivers/net/wireless/iwlwifi/iwl-6000.c +++ b/drivers/net/wireless/iwlwifi/iwl-6000.c | |||
@@ -270,8 +270,6 @@ static int iwl6000_hw_channel_switch(struct iwl_priv *priv, | |||
270 | ctx->active.channel, ch); | 270 | ctx->active.channel, ch); |
271 | return -EFAULT; | 271 | return -EFAULT; |
272 | } | 272 | } |
273 | priv->switch_rxon.channel = cmd.channel; | ||
274 | priv->switch_rxon.switch_in_progress = true; | ||
275 | 273 | ||
276 | return iwl_send_cmd_sync(priv, &hcmd); | 274 | return iwl_send_cmd_sync(priv, &hcmd); |
277 | } | 275 | } |
@@ -603,19 +601,27 @@ struct iwl_cfg iwl6050_2abg_cfg = { | |||
603 | IWL_DEVICE_6050, | 601 | IWL_DEVICE_6050, |
604 | }; | 602 | }; |
605 | 603 | ||
604 | #define IWL_DEVICE_6150 \ | ||
605 | .fw_name_pre = IWL6050_FW_PRE, \ | ||
606 | .ucode_api_max = IWL6050_UCODE_API_MAX, \ | ||
607 | .ucode_api_min = IWL6050_UCODE_API_MIN, \ | ||
608 | .ops = &iwl6150_ops, \ | ||
609 | .eeprom_ver = EEPROM_6150_EEPROM_VERSION, \ | ||
610 | .eeprom_calib_ver = EEPROM_6150_TX_POWER_VERSION, \ | ||
611 | .base_params = &iwl6050_base_params, \ | ||
612 | .need_dc_calib = true, \ | ||
613 | .led_mode = IWL_LED_BLINK, \ | ||
614 | .internal_wimax_coex = true | ||
615 | |||
606 | struct iwl_cfg iwl6150_bgn_cfg = { | 616 | struct iwl_cfg iwl6150_bgn_cfg = { |
607 | .name = "Intel(R) Centrino(R) Wireless-N + WiMAX 6150 BGN", | 617 | .name = "Intel(R) Centrino(R) Wireless-N + WiMAX 6150 BGN", |
608 | .fw_name_pre = IWL6050_FW_PRE, | 618 | IWL_DEVICE_6150, |
609 | .ucode_api_max = IWL6050_UCODE_API_MAX, | ||
610 | .ucode_api_min = IWL6050_UCODE_API_MIN, | ||
611 | .eeprom_ver = EEPROM_6150_EEPROM_VERSION, | ||
612 | .eeprom_calib_ver = EEPROM_6150_TX_POWER_VERSION, | ||
613 | .ops = &iwl6150_ops, | ||
614 | .base_params = &iwl6050_base_params, | ||
615 | .ht_params = &iwl6000_ht_params, | 619 | .ht_params = &iwl6000_ht_params, |
616 | .need_dc_calib = true, | 620 | }; |
617 | .led_mode = IWL_LED_RF_STATE, | 621 | |
618 | .internal_wimax_coex = true, | 622 | struct iwl_cfg iwl6150_bg_cfg = { |
623 | .name = "Intel(R) Centrino(R) Wireless-N + WiMAX 6150 BG", | ||
624 | IWL_DEVICE_6150, | ||
619 | }; | 625 | }; |
620 | 626 | ||
621 | struct iwl_cfg iwl6000_3agn_cfg = { | 627 | struct iwl_cfg iwl6000_3agn_cfg = { |
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 11c6c1169e78..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 | ||
@@ -3831,11 +3832,11 @@ static DEFINE_PCI_DEVICE_TABLE(iwl_hw_card_ids) = { | |||
3831 | 3832 | ||
3832 | /* 6150 WiFi/WiMax Series */ | 3833 | /* 6150 WiFi/WiMax Series */ |
3833 | {IWL_PCI_DEVICE(0x0885, 0x1305, iwl6150_bgn_cfg)}, | 3834 | {IWL_PCI_DEVICE(0x0885, 0x1305, iwl6150_bgn_cfg)}, |
3834 | {IWL_PCI_DEVICE(0x0885, 0x1306, iwl6150_bgn_cfg)}, | 3835 | {IWL_PCI_DEVICE(0x0885, 0x1307, iwl6150_bg_cfg)}, |
3835 | {IWL_PCI_DEVICE(0x0885, 0x1325, iwl6150_bgn_cfg)}, | 3836 | {IWL_PCI_DEVICE(0x0885, 0x1325, iwl6150_bgn_cfg)}, |
3836 | {IWL_PCI_DEVICE(0x0885, 0x1326, iwl6150_bgn_cfg)}, | 3837 | {IWL_PCI_DEVICE(0x0885, 0x1327, iwl6150_bg_cfg)}, |
3837 | {IWL_PCI_DEVICE(0x0886, 0x1315, iwl6150_bgn_cfg)}, | 3838 | {IWL_PCI_DEVICE(0x0886, 0x1315, iwl6150_bgn_cfg)}, |
3838 | {IWL_PCI_DEVICE(0x0886, 0x1316, iwl6150_bgn_cfg)}, | 3839 | {IWL_PCI_DEVICE(0x0886, 0x1317, iwl6150_bg_cfg)}, |
3839 | 3840 | ||
3840 | /* 1000 Series WiFi */ | 3841 | /* 1000 Series WiFi */ |
3841 | {IWL_PCI_DEVICE(0x0083, 0x1205, iwl1000_bgn_cfg)}, | 3842 | {IWL_PCI_DEVICE(0x0083, 0x1205, iwl1000_bgn_cfg)}, |
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn.h b/drivers/net/wireless/iwlwifi/iwl-agn.h index 2495fe7a58cb..d1716844002e 100644 --- a/drivers/net/wireless/iwlwifi/iwl-agn.h +++ b/drivers/net/wireless/iwlwifi/iwl-agn.h | |||
@@ -89,6 +89,7 @@ extern struct iwl_cfg iwl6000_3agn_cfg; | |||
89 | extern struct iwl_cfg iwl6050_2agn_cfg; | 89 | extern struct iwl_cfg iwl6050_2agn_cfg; |
90 | extern struct iwl_cfg iwl6050_2abg_cfg; | 90 | extern struct iwl_cfg iwl6050_2abg_cfg; |
91 | extern struct iwl_cfg iwl6150_bgn_cfg; | 91 | extern struct iwl_cfg iwl6150_bgn_cfg; |
92 | extern struct iwl_cfg iwl6150_bg_cfg; | ||
92 | extern struct iwl_cfg iwl1000_bgn_cfg; | 93 | extern struct iwl_cfg iwl1000_bgn_cfg; |
93 | extern struct iwl_cfg iwl1000_bg_cfg; | 94 | extern struct iwl_cfg iwl1000_bg_cfg; |
94 | extern struct iwl_cfg iwl100_bgn_cfg; | 95 | extern struct iwl_cfg iwl100_bgn_cfg; |
diff --git a/drivers/net/wireless/iwlwifi/iwl-core.c b/drivers/net/wireless/iwlwifi/iwl-core.c index 4653deada05b..213c80c6a668 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 |
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/libertas/cmd.c b/drivers/net/wireless/libertas/cmd.c index 84566db486d2..71c8f3fccfa1 100644 --- a/drivers/net/wireless/libertas/cmd.c +++ b/drivers/net/wireless/libertas/cmd.c | |||
@@ -994,6 +994,8 @@ static void lbs_submit_command(struct lbs_private *priv, | |||
994 | cmd = cmdnode->cmdbuf; | 994 | cmd = cmdnode->cmdbuf; |
995 | 995 | ||
996 | spin_lock_irqsave(&priv->driver_lock, flags); | 996 | spin_lock_irqsave(&priv->driver_lock, flags); |
997 | priv->seqnum++; | ||
998 | cmd->seqnum = cpu_to_le16(priv->seqnum); | ||
997 | priv->cur_cmd = cmdnode; | 999 | priv->cur_cmd = cmdnode; |
998 | spin_unlock_irqrestore(&priv->driver_lock, flags); | 1000 | spin_unlock_irqrestore(&priv->driver_lock, flags); |
999 | 1001 | ||
@@ -1621,11 +1623,9 @@ struct cmd_ctrl_node *__lbs_cmd_async(struct lbs_private *priv, | |||
1621 | /* Copy the incoming command to the buffer */ | 1623 | /* Copy the incoming command to the buffer */ |
1622 | memcpy(cmdnode->cmdbuf, in_cmd, in_cmd_size); | 1624 | memcpy(cmdnode->cmdbuf, in_cmd, in_cmd_size); |
1623 | 1625 | ||
1624 | /* Set sequence number, clean result, move to buffer */ | 1626 | /* Set command, clean result, move to buffer */ |
1625 | priv->seqnum++; | ||
1626 | cmdnode->cmdbuf->command = cpu_to_le16(command); | 1627 | cmdnode->cmdbuf->command = cpu_to_le16(command); |
1627 | cmdnode->cmdbuf->size = cpu_to_le16(in_cmd_size); | 1628 | cmdnode->cmdbuf->size = cpu_to_le16(in_cmd_size); |
1628 | cmdnode->cmdbuf->seqnum = cpu_to_le16(priv->seqnum); | ||
1629 | cmdnode->cmdbuf->result = 0; | 1629 | cmdnode->cmdbuf->result = 0; |
1630 | 1630 | ||
1631 | lbs_deb_host("PREP_CMD: command 0x%04x\n", command); | 1631 | lbs_deb_host("PREP_CMD: command 0x%04x\n", command); |
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/sdio.h b/drivers/net/wireless/mwifiex/sdio.h index a0e9bc5253e0..4e97e90aa399 100644 --- a/drivers/net/wireless/mwifiex/sdio.h +++ b/drivers/net/wireless/mwifiex/sdio.h | |||
@@ -167,8 +167,8 @@ | |||
167 | /* Rx unit register */ | 167 | /* Rx unit register */ |
168 | #define CARD_RX_UNIT_REG 0x63 | 168 | #define CARD_RX_UNIT_REG 0x63 |
169 | 169 | ||
170 | /* Event header Len*/ | 170 | /* Event header len w/o 4 bytes of interface header */ |
171 | #define MWIFIEX_EVENT_HEADER_LEN 8 | 171 | #define MWIFIEX_EVENT_HEADER_LEN 4 |
172 | 172 | ||
173 | /* Max retry number of CMD53 write */ | 173 | /* Max retry number of CMD53 write */ |
174 | #define MAX_WRITE_IOMEM_RETRY 2 | 174 | #define MAX_WRITE_IOMEM_RETRY 2 |
diff --git a/drivers/net/wireless/rt2x00/Kconfig b/drivers/net/wireless/rt2x00/Kconfig index 9def1e5369a1..b2f8b8fd4d2d 100644 --- a/drivers/net/wireless/rt2x00/Kconfig +++ b/drivers/net/wireless/rt2x00/Kconfig | |||
@@ -166,7 +166,6 @@ config RT2800USB_RT35XX | |||
166 | config RT2800USB_RT53XX | 166 | config RT2800USB_RT53XX |
167 | bool "rt2800usb - Include support for rt53xx devices (EXPERIMENTAL)" | 167 | bool "rt2800usb - Include support for rt53xx devices (EXPERIMENTAL)" |
168 | depends on EXPERIMENTAL | 168 | depends on EXPERIMENTAL |
169 | default y | ||
170 | ---help--- | 169 | ---help--- |
171 | This adds support for rt53xx wireless chipset family to the | 170 | This adds support for rt53xx wireless chipset family to the |
172 | rt2800pci driver. | 171 | rt2800pci driver. |
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 a40952845436..9f8ccae93317 100644 --- a/drivers/net/wireless/rtlwifi/pci.c +++ b/drivers/net/wireless/rtlwifi/pci.c | |||
@@ -669,6 +669,14 @@ 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 | |||
672 | pci_unmap_single(rtlpci->pdev, | 680 | pci_unmap_single(rtlpci->pdev, |
673 | *((dma_addr_t *) skb->cb), | 681 | *((dma_addr_t *) skb->cb), |
674 | rtlpci->rxbuffersize, | 682 | rtlpci->rxbuffersize, |
@@ -690,7 +698,7 @@ static void _rtl_pci_rx_interrupt(struct ieee80211_hw *hw) | |||
690 | hdr = rtl_get_hdr(skb); | 698 | hdr = rtl_get_hdr(skb); |
691 | fc = rtl_get_fc(skb); | 699 | fc = rtl_get_fc(skb); |
692 | 700 | ||
693 | if (!stats.crc || !stats.hwerror) { | 701 | if (!stats.crc && !stats.hwerror) { |
694 | memcpy(IEEE80211_SKB_RXCB(skb), &rx_status, | 702 | memcpy(IEEE80211_SKB_RXCB(skb), &rx_status, |
695 | sizeof(rx_status)); | 703 | sizeof(rx_status)); |
696 | 704 | ||
@@ -758,15 +766,7 @@ static void _rtl_pci_rx_interrupt(struct ieee80211_hw *hw) | |||
758 | rtl_lps_leave(hw); | 766 | rtl_lps_leave(hw); |
759 | } | 767 | } |
760 | 768 | ||
761 | new_skb = dev_alloc_skb(rtlpci->rxbuffersize); | ||
762 | if (unlikely(!new_skb)) { | ||
763 | RT_TRACE(rtlpriv, (COMP_INTR | COMP_RECV), | ||
764 | DBG_DMESG, | ||
765 | ("can't alloc skb for rx\n")); | ||
766 | goto done; | ||
767 | } | ||
768 | skb = new_skb; | 769 | skb = new_skb; |
769 | /*skb->dev = dev; */ | ||
770 | 770 | ||
771 | rtlpci->rx_ring[rx_queue_idx].rx_buf[rtlpci-> | 771 | rtlpci->rx_ring[rx_queue_idx].rx_buf[rtlpci-> |
772 | rx_ring | 772 | rx_ring |
@@ -1113,6 +1113,13 @@ static int _rtl_pci_init_rx_ring(struct ieee80211_hw *hw) | |||
1113 | 1113 | ||
1114 | rtlpci->rx_ring[rx_queue_idx].idx = 0; | 1114 | rtlpci->rx_ring[rx_queue_idx].idx = 0; |
1115 | 1115 | ||
1116 | /* If amsdu_8k is disabled, set buffersize to 4096. This | ||
1117 | * change will reduce memory fragmentation. | ||
1118 | */ | ||
1119 | if (rtlpci->rxbuffersize > 4096 && | ||
1120 | rtlpriv->rtlhal.disable_amsdu_8k) | ||
1121 | rtlpci->rxbuffersize = 4096; | ||
1122 | |||
1116 | for (i = 0; i < rtlpci->rxringcount; i++) { | 1123 | for (i = 0; i < rtlpci->rxringcount; i++) { |
1117 | struct sk_buff *skb = | 1124 | struct sk_buff *skb = |
1118 | dev_alloc_skb(rtlpci->rxbuffersize); | 1125 | dev_alloc_skb(rtlpci->rxbuffersize); |
diff --git a/drivers/net/wireless/wl12xx/conf.h b/drivers/net/wireless/wl12xx/conf.h index 1ab6c86aac40..c83fefb6662f 100644 --- a/drivers/net/wireless/wl12xx/conf.h +++ b/drivers/net/wireless/wl12xx/conf.h | |||
@@ -1157,6 +1157,9 @@ struct conf_sched_scan_settings { | |||
1157 | /* time to wait on the channel for passive scans (in TUs) */ | 1157 | /* time to wait on the channel for passive scans (in TUs) */ |
1158 | u32 dwell_time_passive; | 1158 | u32 dwell_time_passive; |
1159 | 1159 | ||
1160 | /* time to wait on the channel for DFS scans (in TUs) */ | ||
1161 | u32 dwell_time_dfs; | ||
1162 | |||
1160 | /* number of probe requests to send on each channel in active scans */ | 1163 | /* number of probe requests to send on each channel in active scans */ |
1161 | u8 num_probe_reqs; | 1164 | u8 num_probe_reqs; |
1162 | 1165 | ||
diff --git a/drivers/net/wireless/wl12xx/main.c b/drivers/net/wireless/wl12xx/main.c index bc00e52f6445..e6497dc669df 100644 --- a/drivers/net/wireless/wl12xx/main.c +++ b/drivers/net/wireless/wl12xx/main.c | |||
@@ -311,6 +311,7 @@ static struct conf_drv_settings default_conf = { | |||
311 | .min_dwell_time_active = 8, | 311 | .min_dwell_time_active = 8, |
312 | .max_dwell_time_active = 30, | 312 | .max_dwell_time_active = 30, |
313 | .dwell_time_passive = 100, | 313 | .dwell_time_passive = 100, |
314 | .dwell_time_dfs = 150, | ||
314 | .num_probe_reqs = 2, | 315 | .num_probe_reqs = 2, |
315 | .rssi_threshold = -90, | 316 | .rssi_threshold = -90, |
316 | .snr_threshold = 0, | 317 | .snr_threshold = 0, |
diff --git a/drivers/net/wireless/wl12xx/scan.c b/drivers/net/wireless/wl12xx/scan.c index f37e5a391976..56f76abc754d 100644 --- a/drivers/net/wireless/wl12xx/scan.c +++ b/drivers/net/wireless/wl12xx/scan.c | |||
@@ -331,16 +331,22 @@ wl1271_scan_get_sched_scan_channels(struct wl1271 *wl, | |||
331 | struct conf_sched_scan_settings *c = &wl->conf.sched_scan; | 331 | struct conf_sched_scan_settings *c = &wl->conf.sched_scan; |
332 | int i, j; | 332 | int i, j; |
333 | u32 flags; | 333 | u32 flags; |
334 | bool force_passive = !req->n_ssids; | ||
334 | 335 | ||
335 | for (i = 0, j = start; | 336 | for (i = 0, j = start; |
336 | i < req->n_channels && j < MAX_CHANNELS_ALL_BANDS; | 337 | i < req->n_channels && j < MAX_CHANNELS_ALL_BANDS; |
337 | i++) { | 338 | i++) { |
338 | flags = req->channels[i]->flags; | 339 | flags = req->channels[i]->flags; |
339 | 340 | ||
340 | if (!(flags & IEEE80211_CHAN_DISABLED) && | 341 | if (force_passive) |
341 | ((flags & IEEE80211_CHAN_PASSIVE_SCAN) == passive) && | 342 | flags |= IEEE80211_CHAN_PASSIVE_SCAN; |
342 | ((flags & IEEE80211_CHAN_RADAR) == radar) && | 343 | |
343 | (req->channels[i]->band == band)) { | 344 | if ((req->channels[i]->band == band) && |
345 | !(flags & IEEE80211_CHAN_DISABLED) && | ||
346 | (!!(flags & IEEE80211_CHAN_RADAR) == radar) && | ||
347 | /* if radar is set, we ignore the passive flag */ | ||
348 | (radar || | ||
349 | !!(flags & IEEE80211_CHAN_PASSIVE_SCAN) == passive)) { | ||
344 | wl1271_debug(DEBUG_SCAN, "band %d, center_freq %d ", | 350 | wl1271_debug(DEBUG_SCAN, "band %d, center_freq %d ", |
345 | req->channels[i]->band, | 351 | req->channels[i]->band, |
346 | req->channels[i]->center_freq); | 352 | req->channels[i]->center_freq); |
@@ -350,7 +356,12 @@ wl1271_scan_get_sched_scan_channels(struct wl1271 *wl, | |||
350 | wl1271_debug(DEBUG_SCAN, "max_power %d", | 356 | wl1271_debug(DEBUG_SCAN, "max_power %d", |
351 | req->channels[i]->max_power); | 357 | req->channels[i]->max_power); |
352 | 358 | ||
353 | if (flags & IEEE80211_CHAN_PASSIVE_SCAN) { | 359 | if (flags & IEEE80211_CHAN_RADAR) { |
360 | channels[j].flags |= SCAN_CHANNEL_FLAGS_DFS; | ||
361 | channels[j].passive_duration = | ||
362 | cpu_to_le16(c->dwell_time_dfs); | ||
363 | } | ||
364 | else if (flags & IEEE80211_CHAN_PASSIVE_SCAN) { | ||
354 | channels[j].passive_duration = | 365 | channels[j].passive_duration = |
355 | cpu_to_le16(c->dwell_time_passive); | 366 | cpu_to_le16(c->dwell_time_passive); |
356 | } else { | 367 | } else { |
@@ -359,7 +370,7 @@ wl1271_scan_get_sched_scan_channels(struct wl1271 *wl, | |||
359 | channels[j].max_duration = | 370 | channels[j].max_duration = |
360 | cpu_to_le16(c->max_dwell_time_active); | 371 | cpu_to_le16(c->max_dwell_time_active); |
361 | } | 372 | } |
362 | channels[j].tx_power_att = req->channels[j]->max_power; | 373 | channels[j].tx_power_att = req->channels[i]->max_power; |
363 | channels[j].channel = req->channels[i]->hw_value; | 374 | channels[j].channel = req->channels[i]->hw_value; |
364 | 375 | ||
365 | j++; | 376 | j++; |
@@ -386,7 +397,11 @@ wl1271_scan_sched_scan_channels(struct wl1271 *wl, | |||
386 | wl1271_scan_get_sched_scan_channels(wl, req, cfg->channels, | 397 | wl1271_scan_get_sched_scan_channels(wl, req, cfg->channels, |
387 | IEEE80211_BAND_2GHZ, | 398 | IEEE80211_BAND_2GHZ, |
388 | false, false, idx); | 399 | false, false, idx); |
389 | idx += cfg->active[0]; | 400 | /* |
401 | * 5GHz channels always start at position 14, not immediately | ||
402 | * after the last 2.4GHz channel | ||
403 | */ | ||
404 | idx = 14; | ||
390 | 405 | ||
391 | cfg->passive[1] = | 406 | cfg->passive[1] = |
392 | wl1271_scan_get_sched_scan_channels(wl, req, cfg->channels, | 407 | wl1271_scan_get_sched_scan_channels(wl, req, cfg->channels, |
@@ -394,22 +409,23 @@ wl1271_scan_sched_scan_channels(struct wl1271 *wl, | |||
394 | false, true, idx); | 409 | false, true, idx); |
395 | idx += cfg->passive[1]; | 410 | idx += cfg->passive[1]; |
396 | 411 | ||
397 | cfg->active[1] = | 412 | cfg->dfs = |
398 | wl1271_scan_get_sched_scan_channels(wl, req, cfg->channels, | 413 | wl1271_scan_get_sched_scan_channels(wl, req, cfg->channels, |
399 | IEEE80211_BAND_5GHZ, | 414 | IEEE80211_BAND_5GHZ, |
400 | false, false, 14); | 415 | true, true, idx); |
401 | idx += cfg->active[1]; | 416 | idx += cfg->dfs; |
402 | 417 | ||
403 | cfg->dfs = | 418 | cfg->active[1] = |
404 | wl1271_scan_get_sched_scan_channels(wl, req, cfg->channels, | 419 | wl1271_scan_get_sched_scan_channels(wl, req, cfg->channels, |
405 | IEEE80211_BAND_5GHZ, | 420 | IEEE80211_BAND_5GHZ, |
406 | true, false, idx); | 421 | false, false, idx); |
407 | idx += cfg->dfs; | 422 | idx += cfg->active[1]; |
408 | 423 | ||
409 | wl1271_debug(DEBUG_SCAN, " 2.4GHz: active %d passive %d", | 424 | wl1271_debug(DEBUG_SCAN, " 2.4GHz: active %d passive %d", |
410 | cfg->active[0], cfg->passive[0]); | 425 | cfg->active[0], cfg->passive[0]); |
411 | wl1271_debug(DEBUG_SCAN, " 5GHz: active %d passive %d", | 426 | wl1271_debug(DEBUG_SCAN, " 5GHz: active %d passive %d", |
412 | cfg->active[1], cfg->passive[1]); | 427 | cfg->active[1], cfg->passive[1]); |
428 | wl1271_debug(DEBUG_SCAN, " DFS: %d", cfg->dfs); | ||
413 | 429 | ||
414 | return idx; | 430 | return idx; |
415 | } | 431 | } |
@@ -421,6 +437,7 @@ int wl1271_scan_sched_scan_config(struct wl1271 *wl, | |||
421 | struct wl1271_cmd_sched_scan_config *cfg = NULL; | 437 | struct wl1271_cmd_sched_scan_config *cfg = NULL; |
422 | struct conf_sched_scan_settings *c = &wl->conf.sched_scan; | 438 | struct conf_sched_scan_settings *c = &wl->conf.sched_scan; |
423 | int i, total_channels, ret; | 439 | int i, total_channels, ret; |
440 | bool force_passive = !req->n_ssids; | ||
424 | 441 | ||
425 | wl1271_debug(DEBUG_CMD, "cmd sched_scan scan config"); | 442 | wl1271_debug(DEBUG_CMD, "cmd sched_scan scan config"); |
426 | 443 | ||
@@ -444,7 +461,7 @@ int wl1271_scan_sched_scan_config(struct wl1271 *wl, | |||
444 | for (i = 0; i < SCAN_MAX_CYCLE_INTERVALS; i++) | 461 | for (i = 0; i < SCAN_MAX_CYCLE_INTERVALS; i++) |
445 | cfg->intervals[i] = cpu_to_le32(req->interval); | 462 | cfg->intervals[i] = cpu_to_le32(req->interval); |
446 | 463 | ||
447 | if (req->ssids[0].ssid_len && req->ssids[0].ssid) { | 464 | if (!force_passive && req->ssids[0].ssid_len && req->ssids[0].ssid) { |
448 | cfg->filter_type = SCAN_SSID_FILTER_SPECIFIC; | 465 | cfg->filter_type = SCAN_SSID_FILTER_SPECIFIC; |
449 | cfg->ssid_len = req->ssids[0].ssid_len; | 466 | cfg->ssid_len = req->ssids[0].ssid_len; |
450 | memcpy(cfg->ssid, req->ssids[0].ssid, | 467 | memcpy(cfg->ssid, req->ssids[0].ssid, |
@@ -461,7 +478,7 @@ int wl1271_scan_sched_scan_config(struct wl1271 *wl, | |||
461 | goto out; | 478 | goto out; |
462 | } | 479 | } |
463 | 480 | ||
464 | if (cfg->active[0]) { | 481 | if (!force_passive && cfg->active[0]) { |
465 | ret = wl1271_cmd_build_probe_req(wl, req->ssids[0].ssid, | 482 | ret = wl1271_cmd_build_probe_req(wl, req->ssids[0].ssid, |
466 | req->ssids[0].ssid_len, | 483 | req->ssids[0].ssid_len, |
467 | ies->ie[IEEE80211_BAND_2GHZ], | 484 | ies->ie[IEEE80211_BAND_2GHZ], |
@@ -473,7 +490,7 @@ int wl1271_scan_sched_scan_config(struct wl1271 *wl, | |||
473 | } | 490 | } |
474 | } | 491 | } |
475 | 492 | ||
476 | if (cfg->active[1]) { | 493 | if (!force_passive && cfg->active[1]) { |
477 | ret = wl1271_cmd_build_probe_req(wl, req->ssids[0].ssid, | 494 | ret = wl1271_cmd_build_probe_req(wl, req->ssids[0].ssid, |
478 | req->ssids[0].ssid_len, | 495 | req->ssids[0].ssid_len, |
479 | ies->ie[IEEE80211_BAND_5GHZ], | 496 | ies->ie[IEEE80211_BAND_5GHZ], |
diff --git a/drivers/net/wireless/wl12xx/scan.h b/drivers/net/wireless/wl12xx/scan.h index c83319579ca3..a0b6c5d67b07 100644 --- a/drivers/net/wireless/wl12xx/scan.h +++ b/drivers/net/wireless/wl12xx/scan.h | |||
@@ -137,6 +137,9 @@ enum { | |||
137 | SCAN_BSS_TYPE_ANY, | 137 | SCAN_BSS_TYPE_ANY, |
138 | }; | 138 | }; |
139 | 139 | ||
140 | #define SCAN_CHANNEL_FLAGS_DFS BIT(0) | ||
141 | #define SCAN_CHANNEL_FLAGS_DFS_ENABLED BIT(1) | ||
142 | |||
140 | struct conn_scan_ch_params { | 143 | struct conn_scan_ch_params { |
141 | __le16 min_duration; | 144 | __le16 min_duration; |
142 | __le16 max_duration; | 145 | __le16 max_duration; |
diff --git a/drivers/net/wireless/zd1211rw/zd_usb.c b/drivers/net/wireless/zd1211rw/zd_usb.c index 0e819943b9e4..631194d49828 100644 --- a/drivers/net/wireless/zd1211rw/zd_usb.c +++ b/drivers/net/wireless/zd1211rw/zd_usb.c | |||
@@ -1533,6 +1533,31 @@ static void __exit usb_exit(void) | |||
1533 | module_init(usb_init); | 1533 | module_init(usb_init); |
1534 | module_exit(usb_exit); | 1534 | module_exit(usb_exit); |
1535 | 1535 | ||
1536 | static int zd_ep_regs_out_msg(struct usb_device *udev, void *data, int len, | ||
1537 | int *actual_length, int timeout) | ||
1538 | { | ||
1539 | /* In USB 2.0 mode EP_REGS_OUT endpoint is interrupt type. However in | ||
1540 | * USB 1.1 mode endpoint is bulk. Select correct type URB by endpoint | ||
1541 | * descriptor. | ||
1542 | */ | ||
1543 | struct usb_host_endpoint *ep; | ||
1544 | unsigned int pipe; | ||
1545 | |||
1546 | pipe = usb_sndintpipe(udev, EP_REGS_OUT); | ||
1547 | ep = usb_pipe_endpoint(udev, pipe); | ||
1548 | if (!ep) | ||
1549 | return -EINVAL; | ||
1550 | |||
1551 | if (usb_endpoint_xfer_int(&ep->desc)) { | ||
1552 | return usb_interrupt_msg(udev, pipe, data, len, | ||
1553 | actual_length, timeout); | ||
1554 | } else { | ||
1555 | pipe = usb_sndbulkpipe(udev, EP_REGS_OUT); | ||
1556 | return usb_bulk_msg(udev, pipe, data, len, actual_length, | ||
1557 | timeout); | ||
1558 | } | ||
1559 | } | ||
1560 | |||
1536 | static int usb_int_regs_length(unsigned int count) | 1561 | static int usb_int_regs_length(unsigned int count) |
1537 | { | 1562 | { |
1538 | return sizeof(struct usb_int_regs) + count * sizeof(struct reg_data); | 1563 | return sizeof(struct usb_int_regs) + count * sizeof(struct reg_data); |
@@ -1648,15 +1673,14 @@ int zd_usb_ioread16v(struct zd_usb *usb, u16 *values, | |||
1648 | 1673 | ||
1649 | udev = zd_usb_to_usbdev(usb); | 1674 | udev = zd_usb_to_usbdev(usb); |
1650 | prepare_read_regs_int(usb); | 1675 | prepare_read_regs_int(usb); |
1651 | r = usb_interrupt_msg(udev, usb_sndintpipe(udev, EP_REGS_OUT), | 1676 | r = zd_ep_regs_out_msg(udev, req, req_len, &actual_req_len, 50 /*ms*/); |
1652 | req, req_len, &actual_req_len, 50 /* ms */); | ||
1653 | if (r) { | 1677 | if (r) { |
1654 | dev_dbg_f(zd_usb_dev(usb), | 1678 | dev_dbg_f(zd_usb_dev(usb), |
1655 | "error in usb_interrupt_msg(). Error number %d\n", r); | 1679 | "error in zd_ep_regs_out_msg(). Error number %d\n", r); |
1656 | goto error; | 1680 | goto error; |
1657 | } | 1681 | } |
1658 | if (req_len != actual_req_len) { | 1682 | if (req_len != actual_req_len) { |
1659 | dev_dbg_f(zd_usb_dev(usb), "error in usb_interrupt_msg()\n" | 1683 | dev_dbg_f(zd_usb_dev(usb), "error in zd_ep_regs_out_msg()\n" |
1660 | " req_len %d != actual_req_len %d\n", | 1684 | " req_len %d != actual_req_len %d\n", |
1661 | req_len, actual_req_len); | 1685 | req_len, actual_req_len); |
1662 | r = -EIO; | 1686 | r = -EIO; |
@@ -1818,9 +1842,17 @@ int zd_usb_iowrite16v_async(struct zd_usb *usb, const struct zd_ioreq16 *ioreqs, | |||
1818 | rw->value = cpu_to_le16(ioreqs[i].value); | 1842 | rw->value = cpu_to_le16(ioreqs[i].value); |
1819 | } | 1843 | } |
1820 | 1844 | ||
1821 | usb_fill_int_urb(urb, udev, usb_sndintpipe(udev, EP_REGS_OUT), | 1845 | /* In USB 2.0 mode endpoint is interrupt type. However in USB 1.1 mode |
1822 | req, req_len, iowrite16v_urb_complete, usb, | 1846 | * endpoint is bulk. Select correct type URB by endpoint descriptor. |
1823 | ep->desc.bInterval); | 1847 | */ |
1848 | if (usb_endpoint_xfer_int(&ep->desc)) | ||
1849 | usb_fill_int_urb(urb, udev, usb_sndintpipe(udev, EP_REGS_OUT), | ||
1850 | req, req_len, iowrite16v_urb_complete, usb, | ||
1851 | ep->desc.bInterval); | ||
1852 | else | ||
1853 | usb_fill_bulk_urb(urb, udev, usb_sndbulkpipe(udev, EP_REGS_OUT), | ||
1854 | req, req_len, iowrite16v_urb_complete, usb); | ||
1855 | |||
1824 | urb->transfer_flags |= URB_FREE_BUFFER; | 1856 | urb->transfer_flags |= URB_FREE_BUFFER; |
1825 | 1857 | ||
1826 | /* Submit previous URB */ | 1858 | /* Submit previous URB */ |
@@ -1924,15 +1956,14 @@ int zd_usb_rfwrite(struct zd_usb *usb, u32 value, u8 bits) | |||
1924 | } | 1956 | } |
1925 | 1957 | ||
1926 | udev = zd_usb_to_usbdev(usb); | 1958 | udev = zd_usb_to_usbdev(usb); |
1927 | r = usb_interrupt_msg(udev, usb_sndintpipe(udev, EP_REGS_OUT), | 1959 | r = zd_ep_regs_out_msg(udev, req, req_len, &actual_req_len, 50 /*ms*/); |
1928 | req, req_len, &actual_req_len, 50 /* ms */); | ||
1929 | if (r) { | 1960 | if (r) { |
1930 | dev_dbg_f(zd_usb_dev(usb), | 1961 | dev_dbg_f(zd_usb_dev(usb), |
1931 | "error in usb_interrupt_msg(). Error number %d\n", r); | 1962 | "error in zd_ep_regs_out_msg(). Error number %d\n", r); |
1932 | goto out; | 1963 | goto out; |
1933 | } | 1964 | } |
1934 | if (req_len != actual_req_len) { | 1965 | if (req_len != actual_req_len) { |
1935 | dev_dbg_f(zd_usb_dev(usb), "error in usb_interrupt_msg()" | 1966 | dev_dbg_f(zd_usb_dev(usb), "error in zd_ep_regs_out_msg()" |
1936 | " req_len %d != actual_req_len %d\n", | 1967 | " req_len %d != actual_req_len %d\n", |
1937 | req_len, actual_req_len); | 1968 | req_len, actual_req_len); |
1938 | r = -EIO; | 1969 | r = -EIO; |