Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6

* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6: (55 commits)
ISDN, hfcsusb: Don't leak in hfcsusb_ph_info()
netpoll: call dev_put() on error in netpoll_setup()
net: ep93xx_eth: fix DMA API violations
net: ep93xx_eth: drop GFP_DMA from call to dma_alloc_coherent()
net: ep93xx_eth: allocate buffers using kmalloc()
net: ep93xx_eth: pass struct device to DMA API functions
ep93xx: set DMA masks for the ep93xx_eth
vlan: Fix the ingress VLAN_FLAG_REORDER_HDR check
dl2k: EEPROM CRC calculation wrong endianess on bigendian machine
NET: am79c961: fix assembler warnings
NET: am79c961: ensure multicast filter is correctly set at open
NET: am79c961: ensure asm() statements are marked volatile
ethtool.h: fix typos
ep93xx_eth: Update MAINTAINERS
ipv4: Fix packet size calculation for raw IPsec packets in __ip_append_data
netpoll: prevent netpoll setup on slave devices
net: pmtu_expires fixes
gianfar:localized filer table
iwlegacy: fix channel switch locking
mac80211: fix IBSS teardown race
...

+553 -545
+1 -1
MAINTAINERS
··· 1739 1739 F: drivers/net/enic/ 1740 1740 1741 1741 CIRRUS LOGIC EP93XX ETHERNET DRIVER 1742 - M: Lennert Buytenhek <kernel@wantstofly.org> 1742 + M: Hartley Sweeten <hsweeten@visionengravers.com> 1743 1743 L: netdev@vger.kernel.org 1744 1744 S: Maintained 1745 1745 F: drivers/net/arm/ep93xx_eth.c
+5 -1
arch/arm/mach-ep93xx/core.c
··· 402 402 } 403 403 }; 404 404 405 + static u64 ep93xx_eth_dma_mask = DMA_BIT_MASK(32); 406 + 405 407 static struct platform_device ep93xx_eth_device = { 406 408 .name = "ep93xx-eth", 407 409 .id = -1, 408 410 .dev = { 409 - .platform_data = &ep93xx_eth_data, 411 + .platform_data = &ep93xx_eth_data, 412 + .coherent_dma_mask = DMA_BIT_MASK(32), 413 + .dma_mask = &ep93xx_eth_dma_mask, 410 414 }, 411 415 .num_resources = ARRAY_SIZE(ep93xx_eth_resource), 412 416 .resource = ep93xx_eth_resource,
+1
drivers/isdn/hardware/mISDN/hfcsusb.c
··· 283 283 _queue_data(&dch->dev.D, MPH_INFORMATION_IND, MISDN_ID_ANY, 284 284 sizeof(struct ph_info_dch) + dch->dev.nrbchan * 285 285 sizeof(struct ph_info_ch), phi, GFP_ATOMIC); 286 + kfree(phi); 286 287 } 287 288 288 289 /*
+65 -61
drivers/net/arm/am79c961a.c
··· 50 50 #ifdef __arm__ 51 51 static void write_rreg(u_long base, u_int reg, u_int val) 52 52 { 53 - __asm__( 53 + asm volatile( 54 54 "str%?h %1, [%2] @ NET_RAP\n\t" 55 55 "str%?h %0, [%2, #-4] @ NET_RDP" 56 56 : ··· 60 60 static inline unsigned short read_rreg(u_long base_addr, u_int reg) 61 61 { 62 62 unsigned short v; 63 - __asm__( 63 + asm volatile( 64 64 "str%?h %1, [%2] @ NET_RAP\n\t" 65 65 "ldr%?h %0, [%2, #-4] @ NET_RDP" 66 66 : "=r" (v) ··· 70 70 71 71 static inline void write_ireg(u_long base, u_int reg, u_int val) 72 72 { 73 - __asm__( 73 + asm volatile( 74 74 "str%?h %1, [%2] @ NET_RAP\n\t" 75 75 "str%?h %0, [%2, #8] @ NET_IDP" 76 76 : ··· 80 80 static inline unsigned short read_ireg(u_long base_addr, u_int reg) 81 81 { 82 82 u_short v; 83 - __asm__( 83 + asm volatile( 84 84 "str%?h %1, [%2] @ NAT_RAP\n\t" 85 85 "ldr%?h %0, [%2, #8] @ NET_IDP\n\t" 86 86 : "=r" (v) ··· 91 91 #define am_writeword(dev,off,val) __raw_writew(val, ISAMEM_BASE + ((off) << 1)) 92 92 #define am_readword(dev,off) __raw_readw(ISAMEM_BASE + ((off) << 1)) 93 93 94 - static inline void 94 + static void 95 95 am_writebuffer(struct net_device *dev, u_int offset, unsigned char *buf, unsigned int length) 96 96 { 97 97 offset = ISAMEM_BASE + (offset << 1); 98 98 length = (length + 1) & ~1; 99 99 if ((int)buf & 2) { 100 - __asm__ __volatile__("str%?h %2, [%0], #4" 100 + asm volatile("str%?h %2, [%0], #4" 101 101 : "=&r" (offset) : "0" (offset), "r" (buf[0] | (buf[1] << 8))); 102 102 buf += 2; 103 103 length -= 2; 104 104 } 105 105 while (length > 8) { 106 - unsigned int tmp, tmp2; 107 - __asm__ __volatile__( 108 - "ldm%?ia %1!, {%2, %3}\n\t" 106 + register unsigned int tmp asm("r2"), tmp2 asm("r3"); 107 + asm volatile( 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 115 "str%?h %2, [%0], #4\n\t" 110 116 "mov%? %2, %2, lsr #16\n\t" 111 - "str%?h %2, [%0], #4\n\t" 112 - "str%?h %3, [%0], #4\n\t" 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; 117 + "str%?h %2, [%0], #4" 118 + : "+r" (offset), "=&r" (tmp), "=&r" (tmp2)); 118 119 } 119 120 while (length > 0) { 120 - __asm__ __volatile__("str%?h %2, [%0], #4" 121 + asm volatile("str%?h %2, [%0], #4" 121 122 : "=&r" (offset) : "0" (offset), "r" (buf[0] | (buf[1] << 8))); 122 123 buf += 2; 123 124 length -= 2; 124 125 } 125 126 } 126 127 127 - static inline void 128 + static void 128 129 am_readbuffer(struct net_device *dev, u_int offset, unsigned char *buf, unsigned int length) 129 130 { 130 131 offset = ISAMEM_BASE + (offset << 1); 131 132 length = (length + 1) & ~1; 132 133 if ((int)buf & 2) { 133 134 unsigned int tmp; 134 - __asm__ __volatile__( 135 + asm volatile( 135 136 "ldr%?h %2, [%0], #4\n\t" 136 137 "str%?b %2, [%1], #1\n\t" 137 138 "mov%? %2, %2, lsr #8\n\t" ··· 141 140 length -= 2; 142 141 } 143 142 while (length > 8) { 144 - unsigned int tmp, tmp2, tmp3; 145 - __asm__ __volatile__( 143 + register unsigned int tmp asm("r2"), tmp2 asm("r3"), tmp3; 144 + asm volatile( 146 145 "ldr%?h %2, [%0], #4\n\t" 146 + "ldr%?h %4, [%0], #4\n\t" 147 147 "ldr%?h %3, [%0], #4\n\t" 148 - "orr%? %2, %2, %3, lsl #16\n\t" 149 - "ldr%?h %3, [%0], #4\n\t" 148 + "orr%? %2, %2, %4, lsl #16\n\t" 150 149 "ldr%?h %4, [%0], #4\n\t" 151 150 "orr%? %3, %3, %4, lsl #16\n\t" 152 151 "stm%?ia %1!, {%2, %3}" ··· 156 155 } 157 156 while (length > 0) { 158 157 unsigned int tmp; 159 - __asm__ __volatile__( 158 + asm volatile( 160 159 "ldr%?h %2, [%0], #4\n\t" 161 160 "str%?b %2, [%1], #1\n\t" 162 161 "mov%? %2, %2, lsr #8\n\t" ··· 197 196 return errorcount; 198 197 } 199 198 199 + static void am79c961_mc_hash(char *addr, u16 *hash) 200 + { 201 + if (addr[0] & 0x01) { 202 + int idx, bit; 203 + u32 crc; 204 + 205 + crc = ether_crc_le(ETH_ALEN, addr); 206 + 207 + idx = crc >> 30; 208 + bit = (crc >> 26) & 15; 209 + 210 + hash[idx] |= 1 << bit; 211 + } 212 + } 213 + 214 + static unsigned int am79c961_get_rx_mode(struct net_device *dev, u16 *hash) 215 + { 216 + unsigned int mode = MODE_PORT_10BT; 217 + 218 + if (dev->flags & IFF_PROMISC) { 219 + mode |= MODE_PROMISC; 220 + memset(hash, 0xff, 4 * sizeof(*hash)); 221 + } else if (dev->flags & IFF_ALLMULTI) { 222 + memset(hash, 0xff, 4 * sizeof(*hash)); 223 + } else { 224 + struct netdev_hw_addr *ha; 225 + 226 + memset(hash, 0, 4 * sizeof(*hash)); 227 + 228 + netdev_for_each_mc_addr(ha, dev) 229 + am79c961_mc_hash(ha->addr, hash); 230 + } 231 + 232 + return mode; 233 + } 234 + 200 235 static void 201 236 am79c961_init_for_open(struct net_device *dev) 202 237 { ··· 240 203 unsigned long flags; 241 204 unsigned char *p; 242 205 u_int hdr_addr, first_free_addr; 206 + u16 multi_hash[4], mode = am79c961_get_rx_mode(dev, multi_hash); 243 207 int i; 244 208 245 209 /* ··· 256 218 write_ireg (dev->base_addr, 2, 0x0000); /* MODE register selects media */ 257 219 258 220 for (i = LADRL; i <= LADRH; i++) 259 - write_rreg (dev->base_addr, i, 0); 221 + write_rreg (dev->base_addr, i, multi_hash[i - LADRL]); 260 222 261 223 for (i = PADRL, p = dev->dev_addr; i <= PADRH; i++, p += 2) 262 224 write_rreg (dev->base_addr, i, p[0] | (p[1] << 8)); 263 225 264 - i = MODE_PORT_10BT; 265 - if (dev->flags & IFF_PROMISC) 266 - i |= MODE_PROMISC; 267 - 268 - write_rreg (dev->base_addr, MODE, i); 226 + write_rreg (dev->base_addr, MODE, mode); 269 227 write_rreg (dev->base_addr, POLLINT, 0); 270 228 write_rreg (dev->base_addr, SIZERXR, -RX_BUFFERS); 271 229 write_rreg (dev->base_addr, SIZETXR, -TX_BUFFERS); ··· 374 340 return 0; 375 341 } 376 342 377 - static void am79c961_mc_hash(char *addr, unsigned short *hash) 378 - { 379 - if (addr[0] & 0x01) { 380 - int idx, bit; 381 - u32 crc; 382 - 383 - crc = ether_crc_le(ETH_ALEN, addr); 384 - 385 - idx = crc >> 30; 386 - bit = (crc >> 26) & 15; 387 - 388 - hash[idx] |= 1 << bit; 389 - } 390 - } 391 - 392 343 /* 393 344 * Set or clear promiscuous/multicast mode filter for this adapter. 394 345 */ ··· 381 362 { 382 363 struct dev_priv *priv = netdev_priv(dev); 383 364 unsigned long flags; 384 - unsigned short multi_hash[4], mode; 365 + u16 multi_hash[4], mode = am79c961_get_rx_mode(dev, multi_hash); 385 366 int i, stopped; 386 - 387 - mode = MODE_PORT_10BT; 388 - 389 - if (dev->flags & IFF_PROMISC) { 390 - mode |= MODE_PROMISC; 391 - } else if (dev->flags & IFF_ALLMULTI) { 392 - memset(multi_hash, 0xff, sizeof(multi_hash)); 393 - } else { 394 - struct netdev_hw_addr *ha; 395 - 396 - memset(multi_hash, 0x00, sizeof(multi_hash)); 397 - 398 - netdev_for_each_mc_addr(ha, dev) 399 - am79c961_mc_hash(ha->addr, multi_hash); 400 - } 401 367 402 368 spin_lock_irqsave(&priv->chip_lock, flags); 403 369
+41 -41
drivers/net/arm/ep93xx_eth.c
··· 283 283 284 284 skb = dev_alloc_skb(length + 2); 285 285 if (likely(skb != NULL)) { 286 + struct ep93xx_rdesc *rxd = &ep->descs->rdesc[entry]; 286 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 289 length, DMA_FROM_DEVICE); 289 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 294 skb_put(skb, length); 291 295 skb->protocol = eth_type_trans(skb, dev); 292 296 ··· 352 348 static int ep93xx_xmit(struct sk_buff *skb, struct net_device *dev) 353 349 { 354 350 struct ep93xx_priv *ep = netdev_priv(dev); 351 + struct ep93xx_tdesc *txd; 355 352 int entry; 356 353 357 354 if (unlikely(skb->len > MAX_PKT_SIZE)) { ··· 364 359 entry = ep->tx_pointer; 365 360 ep->tx_pointer = (ep->tx_pointer + 1) & (TX_QUEUE_ENTRIES - 1); 366 361 367 - ep->descs->tdesc[entry].tdesc1 = 368 - TDESC1_EOF | (entry << 16) | (skb->len & 0xfff); 362 + txd = &ep->descs->tdesc[entry]; 363 + 364 + txd->tdesc1 = TDESC1_EOF | (entry << 16) | (skb->len & 0xfff); 365 + dma_sync_single_for_cpu(dev->dev.parent, txd->buf_addr, skb->len, 366 + DMA_TO_DEVICE); 369 367 skb_copy_and_csum_dev(skb, ep->tx_buf[entry]); 370 - dma_sync_single_for_cpu(NULL, ep->descs->tdesc[entry].buf_addr, 371 - skb->len, DMA_TO_DEVICE); 368 + dma_sync_single_for_device(dev->dev.parent, txd->buf_addr, skb->len, 369 + DMA_TO_DEVICE); 372 370 dev_kfree_skb(skb); 373 371 374 372 spin_lock_irq(&ep->tx_pending_lock); ··· 465 457 466 458 static void ep93xx_free_buffers(struct ep93xx_priv *ep) 467 459 { 460 + struct device *dev = ep->dev->dev.parent; 468 461 int i; 469 462 470 - for (i = 0; i < RX_QUEUE_ENTRIES; i += 2) { 463 + for (i = 0; i < RX_QUEUE_ENTRIES; i++) { 471 464 dma_addr_t d; 472 465 473 466 d = ep->descs->rdesc[i].buf_addr; 474 467 if (d) 475 - dma_unmap_single(NULL, d, PAGE_SIZE, DMA_FROM_DEVICE); 468 + dma_unmap_single(dev, d, PKT_BUF_SIZE, DMA_FROM_DEVICE); 476 469 477 470 if (ep->rx_buf[i] != NULL) 478 - free_page((unsigned long)ep->rx_buf[i]); 471 + kfree(ep->rx_buf[i]); 479 472 } 480 473 481 - for (i = 0; i < TX_QUEUE_ENTRIES; i += 2) { 474 + for (i = 0; i < TX_QUEUE_ENTRIES; i++) { 482 475 dma_addr_t d; 483 476 484 477 d = ep->descs->tdesc[i].buf_addr; 485 478 if (d) 486 - dma_unmap_single(NULL, d, PAGE_SIZE, DMA_TO_DEVICE); 479 + dma_unmap_single(dev, d, PKT_BUF_SIZE, DMA_TO_DEVICE); 487 480 488 481 if (ep->tx_buf[i] != NULL) 489 - free_page((unsigned long)ep->tx_buf[i]); 482 + kfree(ep->tx_buf[i]); 490 483 } 491 484 492 - dma_free_coherent(NULL, sizeof(struct ep93xx_descs), ep->descs, 485 + dma_free_coherent(dev, sizeof(struct ep93xx_descs), ep->descs, 493 486 ep->descs_dma_addr); 494 487 } 495 488 496 - /* 497 - * The hardware enforces a sub-2K maximum packet size, so we put 498 - * two buffers on every hardware page. 499 - */ 500 489 static int ep93xx_alloc_buffers(struct ep93xx_priv *ep) 501 490 { 491 + struct device *dev = ep->dev->dev.parent; 502 492 int i; 503 493 504 - ep->descs = dma_alloc_coherent(NULL, sizeof(struct ep93xx_descs), 505 - &ep->descs_dma_addr, GFP_KERNEL | GFP_DMA); 494 + ep->descs = dma_alloc_coherent(dev, sizeof(struct ep93xx_descs), 495 + &ep->descs_dma_addr, GFP_KERNEL); 506 496 if (ep->descs == NULL) 507 497 return 1; 508 498 509 - for (i = 0; i < RX_QUEUE_ENTRIES; i += 2) { 510 - void *page; 499 + for (i = 0; i < RX_QUEUE_ENTRIES; i++) { 500 + void *buf; 511 501 dma_addr_t d; 512 502 513 - page = (void *)__get_free_page(GFP_KERNEL | GFP_DMA); 514 - if (page == NULL) 503 + buf = kmalloc(PKT_BUF_SIZE, GFP_KERNEL); 504 + if (buf == NULL) 515 505 goto err; 516 506 517 - d = dma_map_single(NULL, page, PAGE_SIZE, DMA_FROM_DEVICE); 518 - if (dma_mapping_error(NULL, d)) { 519 - free_page((unsigned long)page); 507 + d = dma_map_single(dev, buf, PKT_BUF_SIZE, DMA_FROM_DEVICE); 508 + if (dma_mapping_error(dev, d)) { 509 + kfree(buf); 520 510 goto err; 521 511 } 522 512 523 - ep->rx_buf[i] = page; 513 + ep->rx_buf[i] = buf; 524 514 ep->descs->rdesc[i].buf_addr = d; 525 515 ep->descs->rdesc[i].rdesc1 = (i << 16) | PKT_BUF_SIZE; 526 - 527 - ep->rx_buf[i + 1] = page + PKT_BUF_SIZE; 528 - ep->descs->rdesc[i + 1].buf_addr = d + PKT_BUF_SIZE; 529 - ep->descs->rdesc[i + 1].rdesc1 = ((i + 1) << 16) | PKT_BUF_SIZE; 530 516 } 531 517 532 - for (i = 0; i < TX_QUEUE_ENTRIES; i += 2) { 533 - void *page; 518 + for (i = 0; i < TX_QUEUE_ENTRIES; i++) { 519 + void *buf; 534 520 dma_addr_t d; 535 521 536 - page = (void *)__get_free_page(GFP_KERNEL | GFP_DMA); 537 - if (page == NULL) 522 + buf = kmalloc(PKT_BUF_SIZE, GFP_KERNEL); 523 + if (buf == NULL) 538 524 goto err; 539 525 540 - d = dma_map_single(NULL, page, PAGE_SIZE, DMA_TO_DEVICE); 541 - if (dma_mapping_error(NULL, d)) { 542 - free_page((unsigned long)page); 526 + d = dma_map_single(dev, buf, PKT_BUF_SIZE, DMA_TO_DEVICE); 527 + if (dma_mapping_error(dev, d)) { 528 + kfree(buf); 543 529 goto err; 544 530 } 545 531 546 - ep->tx_buf[i] = page; 532 + ep->tx_buf[i] = buf; 547 533 ep->descs->tdesc[i].buf_addr = d; 548 - 549 - ep->tx_buf[i + 1] = page + PKT_BUF_SIZE; 550 - ep->descs->tdesc[i + 1].buf_addr = d + PKT_BUF_SIZE; 551 534 } 552 535 553 536 return 0; ··· 828 829 } 829 830 ep = netdev_priv(dev); 830 831 ep->dev = dev; 832 + SET_NETDEV_DEV(dev, &pdev->dev); 831 833 netif_napi_add(dev, &ep->napi, ep93xx_poll, 64); 832 834 833 835 platform_set_drvdata(pdev, dev);
+11
drivers/net/bonding/bond_main.c
··· 388 388 return next; 389 389 } 390 390 391 + #define bond_queue_mapping(skb) (*(u16 *)((skb)->cb)) 392 + 391 393 /** 392 394 * bond_dev_queue_xmit - Prepare skb for xmit. 393 395 * ··· 402 400 { 403 401 skb->dev = slave_dev; 404 402 skb->priority = 1; 403 + 404 + skb->queue_mapping = bond_queue_mapping(skb); 405 + 405 406 if (unlikely(netpoll_tx_running(slave_dev))) 406 407 bond_netpoll_send_skb(bond_get_slave_by_dev(bond, slave_dev), skb); 407 408 else ··· 4211 4206 return res; 4212 4207 } 4213 4208 4209 + 4214 4210 static u16 bond_select_queue(struct net_device *dev, struct sk_buff *skb) 4215 4211 { 4216 4212 /* ··· 4221 4215 * way down to the bonding driver. 4222 4216 */ 4223 4217 u16 txq = skb_rx_queue_recorded(skb) ? skb_get_rx_queue(skb) : 0; 4218 + 4219 + /* 4220 + * Save the original txq to restore before passing to the driver 4221 + */ 4222 + bond_queue_mapping(skb) = skb->queue_mapping; 4224 4223 4225 4224 if (unlikely(txq >= dev->real_num_tx_queues)) { 4226 4225 do {
+1 -1
drivers/net/dl2k.c
··· 346 346 if (np->pdev->vendor == PCI_VENDOR_ID_DLINK) { /* D-Link Only */ 347 347 /* Check CRC */ 348 348 crc = ~ether_crc_le (256 - 4, sromdata); 349 - if (psrom->crc != crc) { 349 + if (psrom->crc != cpu_to_le32(crc)) { 350 350 printk (KERN_ERR "%s: EEPROM data CRC error.\n", 351 351 dev->name); 352 352 return -1;
+13 -16
drivers/net/gianfar.c
··· 10 10 * Maintainer: Kumar Gala 11 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 14 * Copyright 2007 MontaVista Software, Inc. 15 15 * 16 16 * This program is free software; you can redistribute it and/or modify it ··· 476 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 479 void lock_rx_qs(struct gfar_private *priv) 483 480 { 484 481 int i = 0x0; ··· 865 868 866 869 rqfar--; 867 870 rqfcr = RQFCR_CLE | RQFCR_PID_MASK | RQFCR_CMP_EXACT; 868 - ftp_rqfpr[rqfar] = rqfpr; 869 - ftp_rqfcr[rqfar] = rqfcr; 871 + priv->ftp_rqfpr[rqfar] = rqfpr; 872 + priv->ftp_rqfcr[rqfar] = rqfcr; 870 873 gfar_write_filer(priv, rqfar, rqfcr, rqfpr); 871 874 872 875 rqfar--; 873 876 rqfcr = RQFCR_CMP_NOMATCH; 874 - ftp_rqfpr[rqfar] = rqfpr; 875 - ftp_rqfcr[rqfar] = rqfcr; 877 + priv->ftp_rqfpr[rqfar] = rqfpr; 878 + priv->ftp_rqfcr[rqfar] = rqfcr; 876 879 gfar_write_filer(priv, rqfar, rqfcr, rqfpr); 877 880 878 881 rqfar--; 879 882 rqfcr = RQFCR_CMP_EXACT | RQFCR_PID_PARSE | RQFCR_CLE | RQFCR_AND; 880 883 rqfpr = class; 881 - ftp_rqfcr[rqfar] = rqfcr; 882 - ftp_rqfpr[rqfar] = rqfpr; 884 + priv->ftp_rqfcr[rqfar] = rqfcr; 885 + priv->ftp_rqfpr[rqfar] = rqfpr; 883 886 gfar_write_filer(priv, rqfar, rqfcr, rqfpr); 884 887 885 888 rqfar--; 886 889 rqfcr = RQFCR_CMP_EXACT | RQFCR_PID_MASK | RQFCR_AND; 887 890 rqfpr = class; 888 - ftp_rqfcr[rqfar] = rqfcr; 889 - ftp_rqfpr[rqfar] = rqfpr; 891 + priv->ftp_rqfcr[rqfar] = rqfcr; 892 + priv->ftp_rqfpr[rqfar] = rqfpr; 890 893 gfar_write_filer(priv, rqfar, rqfcr, rqfpr); 891 894 892 895 return rqfar; ··· 901 904 902 905 /* Default rule */ 903 906 rqfcr = RQFCR_CMP_MATCH; 904 - ftp_rqfcr[rqfar] = rqfcr; 905 - ftp_rqfpr[rqfar] = rqfpr; 907 + priv->ftp_rqfcr[rqfar] = rqfcr; 908 + priv->ftp_rqfpr[rqfar] = rqfpr; 906 909 gfar_write_filer(priv, rqfar, rqfcr, rqfpr); 907 910 908 911 rqfar = cluster_entry_per_class(priv, rqfar, RQFPR_IPV6); ··· 918 921 /* Rest are masked rules */ 919 922 rqfcr = RQFCR_CMP_NOMATCH; 920 923 for (i = 0; i < rqfar; i++) { 921 - ftp_rqfcr[i] = rqfcr; 922 - ftp_rqfpr[i] = rqfpr; 924 + priv->ftp_rqfcr[i] = rqfcr; 925 + priv->ftp_rqfpr[i] = rqfpr; 923 926 gfar_write_filer(priv, i, rqfcr, rqfpr); 924 927 } 925 928 }
+5 -3
drivers/net/gianfar.h
··· 9 9 * Maintainer: Kumar Gala 10 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 14 * This program is free software; you can redistribute it and/or modify it 15 15 * under the terms of the GNU General Public License as published by the ··· 1107 1107 /* HW time stamping enabled flag */ 1108 1108 int hwts_rx_en; 1109 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 1117 static inline int gfar_has_errata(struct gfar_private *priv, 1116 1118 enum gfar_errata err)
+33 -31
drivers/net/gianfar_ethtool.c
··· 9 9 * Maintainer: Kumar Gala 10 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 14 * This software may be used and distributed according to 15 15 * the terms of the GNU Public License, Version 2, incorporated herein ··· 609 609 if (ethflow & RXH_L2DA) { 610 610 fcr = RQFCR_PID_DAH |RQFCR_CMP_NOMATCH | 611 611 RQFCR_HASH | RQFCR_AND | RQFCR_HASHTBL_0; 612 - ftp_rqfpr[priv->cur_filer_idx] = fpr; 613 - ftp_rqfcr[priv->cur_filer_idx] = fcr; 612 + priv->ftp_rqfpr[priv->cur_filer_idx] = fpr; 613 + priv->ftp_rqfcr[priv->cur_filer_idx] = fcr; 614 614 gfar_write_filer(priv, priv->cur_filer_idx, fcr, fpr); 615 615 priv->cur_filer_idx = priv->cur_filer_idx - 1; 616 616 617 617 fcr = RQFCR_PID_DAL | RQFCR_AND | RQFCR_CMP_NOMATCH | 618 618 RQFCR_HASH | RQFCR_AND | RQFCR_HASHTBL_0; 619 - ftp_rqfpr[priv->cur_filer_idx] = fpr; 620 - ftp_rqfcr[priv->cur_filer_idx] = fcr; 619 + priv->ftp_rqfpr[priv->cur_filer_idx] = fpr; 620 + priv->ftp_rqfcr[priv->cur_filer_idx] = fcr; 621 621 gfar_write_filer(priv, priv->cur_filer_idx, fcr, fpr); 622 622 priv->cur_filer_idx = priv->cur_filer_idx - 1; 623 623 } ··· 626 626 fcr = RQFCR_PID_VID | RQFCR_CMP_NOMATCH | RQFCR_HASH | 627 627 RQFCR_AND | RQFCR_HASHTBL_0; 628 628 gfar_write_filer(priv, priv->cur_filer_idx, fcr, fpr); 629 - ftp_rqfpr[priv->cur_filer_idx] = fpr; 630 - ftp_rqfcr[priv->cur_filer_idx] = fcr; 629 + priv->ftp_rqfpr[priv->cur_filer_idx] = fpr; 630 + priv->ftp_rqfcr[priv->cur_filer_idx] = fcr; 631 631 priv->cur_filer_idx = priv->cur_filer_idx - 1; 632 632 } 633 633 634 634 if (ethflow & RXH_IP_SRC) { 635 635 fcr = RQFCR_PID_SIA | RQFCR_CMP_NOMATCH | RQFCR_HASH | 636 636 RQFCR_AND | RQFCR_HASHTBL_0; 637 - ftp_rqfpr[priv->cur_filer_idx] = fpr; 638 - ftp_rqfcr[priv->cur_filer_idx] = fcr; 637 + priv->ftp_rqfpr[priv->cur_filer_idx] = fpr; 638 + priv->ftp_rqfcr[priv->cur_filer_idx] = fcr; 639 639 gfar_write_filer(priv, priv->cur_filer_idx, fcr, fpr); 640 640 priv->cur_filer_idx = priv->cur_filer_idx - 1; 641 641 } ··· 643 643 if (ethflow & (RXH_IP_DST)) { 644 644 fcr = RQFCR_PID_DIA | RQFCR_CMP_NOMATCH | RQFCR_HASH | 645 645 RQFCR_AND | RQFCR_HASHTBL_0; 646 - ftp_rqfpr[priv->cur_filer_idx] = fpr; 647 - ftp_rqfcr[priv->cur_filer_idx] = fcr; 646 + priv->ftp_rqfpr[priv->cur_filer_idx] = fpr; 647 + priv->ftp_rqfcr[priv->cur_filer_idx] = fcr; 648 648 gfar_write_filer(priv, priv->cur_filer_idx, fcr, fpr); 649 649 priv->cur_filer_idx = priv->cur_filer_idx - 1; 650 650 } ··· 652 652 if (ethflow & RXH_L3_PROTO) { 653 653 fcr = RQFCR_PID_L4P | RQFCR_CMP_NOMATCH | RQFCR_HASH | 654 654 RQFCR_AND | RQFCR_HASHTBL_0; 655 - ftp_rqfpr[priv->cur_filer_idx] = fpr; 656 - ftp_rqfcr[priv->cur_filer_idx] = fcr; 655 + priv->ftp_rqfpr[priv->cur_filer_idx] = fpr; 656 + priv->ftp_rqfcr[priv->cur_filer_idx] = fcr; 657 657 gfar_write_filer(priv, priv->cur_filer_idx, fcr, fpr); 658 658 priv->cur_filer_idx = priv->cur_filer_idx - 1; 659 659 } ··· 661 661 if (ethflow & RXH_L4_B_0_1) { 662 662 fcr = RQFCR_PID_SPT | RQFCR_CMP_NOMATCH | RQFCR_HASH | 663 663 RQFCR_AND | RQFCR_HASHTBL_0; 664 - ftp_rqfpr[priv->cur_filer_idx] = fpr; 665 - ftp_rqfcr[priv->cur_filer_idx] = fcr; 664 + priv->ftp_rqfpr[priv->cur_filer_idx] = fpr; 665 + priv->ftp_rqfcr[priv->cur_filer_idx] = fcr; 666 666 gfar_write_filer(priv, priv->cur_filer_idx, fcr, fpr); 667 667 priv->cur_filer_idx = priv->cur_filer_idx - 1; 668 668 } ··· 670 670 if (ethflow & RXH_L4_B_2_3) { 671 671 fcr = RQFCR_PID_DPT | RQFCR_CMP_NOMATCH | RQFCR_HASH | 672 672 RQFCR_AND | RQFCR_HASHTBL_0; 673 - ftp_rqfpr[priv->cur_filer_idx] = fpr; 674 - ftp_rqfcr[priv->cur_filer_idx] = fcr; 673 + priv->ftp_rqfpr[priv->cur_filer_idx] = fpr; 674 + priv->ftp_rqfcr[priv->cur_filer_idx] = fcr; 675 675 gfar_write_filer(priv, priv->cur_filer_idx, fcr, fpr); 676 676 priv->cur_filer_idx = priv->cur_filer_idx - 1; 677 677 } ··· 705 705 } 706 706 707 707 for (i = 0; i < MAX_FILER_IDX + 1; i++) { 708 - local_rqfpr[j] = ftp_rqfpr[i]; 709 - local_rqfcr[j] = ftp_rqfcr[i]; 708 + local_rqfpr[j] = priv->ftp_rqfpr[i]; 709 + local_rqfcr[j] = priv->ftp_rqfcr[i]; 710 710 j--; 711 - if ((ftp_rqfcr[i] == (RQFCR_PID_PARSE | 711 + if ((priv->ftp_rqfcr[i] == (RQFCR_PID_PARSE | 712 712 RQFCR_CLE |RQFCR_AND)) && 713 - (ftp_rqfpr[i] == cmp_rqfpr)) 713 + (priv->ftp_rqfpr[i] == cmp_rqfpr)) 714 714 break; 715 715 } 716 716 ··· 724 724 * if it was already programmed, we need to overwrite these rules 725 725 */ 726 726 for (l = i+1; l < MAX_FILER_IDX; l++) { 727 - if ((ftp_rqfcr[l] & RQFCR_CLE) && 728 - !(ftp_rqfcr[l] & RQFCR_AND)) { 729 - ftp_rqfcr[l] = RQFCR_CLE | RQFCR_CMP_EXACT | 727 + if ((priv->ftp_rqfcr[l] & RQFCR_CLE) && 728 + !(priv->ftp_rqfcr[l] & RQFCR_AND)) { 729 + priv->ftp_rqfcr[l] = RQFCR_CLE | RQFCR_CMP_EXACT | 730 730 RQFCR_HASHTBL_0 | RQFCR_PID_MASK; 731 - ftp_rqfpr[l] = FPR_FILER_MASK; 732 - gfar_write_filer(priv, l, ftp_rqfcr[l], ftp_rqfpr[l]); 731 + priv->ftp_rqfpr[l] = FPR_FILER_MASK; 732 + gfar_write_filer(priv, l, priv->ftp_rqfcr[l], 733 + priv->ftp_rqfpr[l]); 733 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 739 continue; 738 740 else { 739 - local_rqfpr[j] = ftp_rqfpr[l]; 740 - local_rqfcr[j] = ftp_rqfcr[l]; 741 + local_rqfpr[j] = priv->ftp_rqfpr[l]; 742 + local_rqfcr[j] = priv->ftp_rqfcr[l]; 741 743 j--; 742 744 } 743 745 } ··· 752 750 753 751 /* Write back the popped out rules again */ 754 752 for (k = j+1; k < MAX_FILER_IDX; k++) { 755 - ftp_rqfpr[priv->cur_filer_idx] = local_rqfpr[k]; 756 - ftp_rqfcr[priv->cur_filer_idx] = local_rqfcr[k]; 753 + priv->ftp_rqfpr[priv->cur_filer_idx] = local_rqfpr[k]; 754 + priv->ftp_rqfcr[priv->cur_filer_idx] = local_rqfcr[k]; 757 755 gfar_write_filer(priv, priv->cur_filer_idx, 758 756 local_rqfcr[k], local_rqfpr[k]); 759 757 if (!priv->cur_filer_idx)
+3
drivers/net/igb/igb_main.c
··· 2373 2373 } 2374 2374 #endif /* CONFIG_PCI_IOV */ 2375 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 2381 * if rss_queues > 4 or vfs are going to be allocated with rss_queues
+1
drivers/net/qlcnic/qlcnic_hw.c
··· 1406 1406 1407 1407 for (loop = 0; loop < que->no_ops; loop++) { 1408 1408 QLCNIC_WR_DUMP_REG(que->sel_addr, base, que_id); 1409 + addr = que->read_addr; 1409 1410 for (i = 0; i < cnt; i++) { 1410 1411 QLCNIC_RD_DUMP_REG(addr, base, &data); 1411 1412 *buffer++ = cpu_to_le32(data);
+1
drivers/net/qlcnic/qlcnic_main.c
··· 2159 2159 2160 2160 nf = &pbuf->frag_array[0]; 2161 2161 pci_unmap_single(pdev, nf->dma, skb_headlen(skb), PCI_DMA_TODEVICE); 2162 + pbuf->skb = NULL; 2162 2163 } 2163 2164 2164 2165 static inline void
+3 -3
drivers/net/smc91x.c
··· 2400 2400 { .compatible = "smsc,lan91c94", }, 2401 2401 { .compatible = "smsc,lan91c111", }, 2402 2402 {}, 2403 - } 2403 + }; 2404 2404 MODULE_DEVICE_TABLE(of, smc91x_match); 2405 + #else 2406 + #define smc91x_match NULL 2405 2407 #endif 2406 2408 2407 2409 static struct dev_pm_ops smc_drv_pm_ops = { ··· 2418 2416 .name = CARDNAME, 2419 2417 .owner = THIS_MODULE, 2420 2418 .pm = &smc_drv_pm_ops, 2421 - #ifdef CONFIG_OF 2422 2419 .of_match_table = smc91x_match, 2423 - #endif 2424 2420 }, 2425 2421 }; 2426 2422
+10 -1
drivers/net/wireless/ath/ath5k/base.c
··· 72 72 module_param_named(all_channels, modparam_all_channels, bool, S_IRUGO); 73 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 80 /* Module info */ 76 81 MODULE_AUTHOR("Jiri Slaby"); 77 82 MODULE_AUTHOR("Nick Kossifidis"); ··· 2691 2686 struct ath5k_hw *ah = sc->ah; 2692 2687 struct ath_common *common = ath5k_hw_common(ah); 2693 2688 int ret, ani_mode; 2689 + bool fast; 2694 2690 2695 2691 ATH5K_DBG(sc, ATH5K_DEBUG_RESET, "resetting\n"); 2696 2692 ··· 2711 2705 ath5k_drain_tx_buffs(sc); 2712 2706 if (chan) 2713 2707 sc->curchan = chan; 2714 - ret = ath5k_hw_reset(ah, sc->opmode, sc->curchan, chan != NULL, 2708 + 2709 + fast = ((chan != NULL) && modparam_fastchanswitch) ? 1 : 0; 2710 + 2711 + ret = ath5k_hw_reset(ah, sc->opmode, sc->curchan, fast, 2715 2712 skip_pcu); 2716 2713 if (ret) { 2717 2714 ATH5K_ERR(sc, "can't reset hardware (%d)\n", ret);
+4 -1
drivers/net/wireless/ath/ath5k/reset.c
··· 1124 1124 /* Non fatal, can happen eg. 1125 1125 * on mode change */ 1126 1126 ret = 0; 1127 - } else 1127 + } else { 1128 + ATH5K_DBG(ah->ah_sc, ATH5K_DEBUG_RESET, 1129 + "fast chan change successful\n"); 1128 1130 return 0; 1131 + } 1129 1132 } 1130 1133 1131 1134 /*
+5 -7
drivers/net/wireless/iwlegacy/iwl-4965.c
··· 1218 1218 * receive commit_rxon request 1219 1219 * abort any previous channel switch if still in process 1220 1220 */ 1221 - if (priv->switch_rxon.switch_in_progress && 1222 - (priv->switch_rxon.channel != ctx->staging.channel)) { 1221 + if (test_bit(STATUS_CHANNEL_SWITCH_PENDING, &priv->status) && 1222 + (priv->switch_channel != ctx->staging.channel)) { 1223 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 1225 iwl_legacy_chswitch_done(priv, false); 1226 1226 } 1227 1227 ··· 1237 1237 1238 1238 memcpy(active_rxon, &ctx->staging, sizeof(*active_rxon)); 1239 1239 iwl_legacy_print_rx_config_cmd(priv, ctx); 1240 - return 0; 1240 + goto set_tx_power; 1241 1241 } 1242 1242 1243 1243 /* If we are currently associated and the new config requires ··· 1317 1317 1318 1318 iwl4965_init_sensitivity(priv); 1319 1319 1320 + set_tx_power: 1320 1321 /* If we issue a new RXON command which required a tune then we must 1321 1322 * send a new TXPOWER command or we won't be able to Tx any frames */ 1322 1323 ret = iwl_legacy_set_tx_power(priv, priv->tx_power_next, true); ··· 1403 1402 IWL_DEBUG_11H(priv, "error:%d fill txpower_tbl\n", rc); 1404 1403 return rc; 1405 1404 } 1406 - 1407 - priv->switch_rxon.channel = cmd.channel; 1408 - priv->switch_rxon.switch_in_progress = true; 1409 1405 1410 1406 return iwl_legacy_send_cmd_pdu(priv, 1411 1407 REPLY_CHANNEL_SWITCH, sizeof(cmd), &cmd);
+13 -17
drivers/net/wireless/iwlegacy/iwl-core.c
··· 859 859 if (test_bit(STATUS_EXIT_PENDING, &priv->status)) 860 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 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 865 EXPORT_SYMBOL(iwl_legacy_chswitch_done); 870 866 ··· 872 876 struct iwl_rxon_context *ctx = &priv->contexts[IWL_RXON_CTX_BSS]; 873 877 struct iwl_legacy_rxon_cmd *rxon = (void *)&ctx->active; 874 878 875 - if (priv->switch_rxon.switch_in_progress) { 876 - if (!le32_to_cpu(csa->status) && 877 - (csa->channel == priv->switch_rxon.channel)) { 878 - rxon->channel = csa->channel; 879 - ctx->staging.channel = csa->channel; 880 - IWL_DEBUG_11H(priv, "CSA notif: channel %d\n", 879 + if (!test_bit(STATUS_CHANNEL_SWITCH_PENDING, &priv->status)) 880 + return; 881 + 882 + if (!le32_to_cpu(csa->status) && csa->channel == priv->switch_channel) { 883 + rxon->channel = csa->channel; 884 + ctx->staging.channel = csa->channel; 885 + IWL_DEBUG_11H(priv, "CSA notif: channel %d\n", 881 886 le16_to_cpu(csa->channel)); 882 - iwl_legacy_chswitch_done(priv, true); 883 - } else { 884 - IWL_ERR(priv, "CSA notif (fail) : channel %d\n", 885 - le16_to_cpu(csa->channel)); 886 - iwl_legacy_chswitch_done(priv, false); 887 - } 887 + iwl_legacy_chswitch_done(priv, true); 888 + } else { 889 + IWL_ERR(priv, "CSA notif (fail) : channel %d\n", 890 + le16_to_cpu(csa->channel)); 891 + iwl_legacy_chswitch_done(priv, false); 888 892 } 889 893 } 890 894 EXPORT_SYMBOL(iwl_legacy_rx_csa);
+1 -1
drivers/net/wireless/iwlegacy/iwl-core.h
··· 560 560 #define STATUS_SCAN_HW 15 561 561 #define STATUS_POWER_PMI 16 562 562 #define STATUS_FW_ERROR 17 563 - 563 + #define STATUS_CHANNEL_SWITCH_PENDING 18 564 564 565 565 static inline int iwl_legacy_is_ready(struct iwl_priv *priv) 566 566 {
+1 -12
drivers/net/wireless/iwlegacy/iwl-dev.h
··· 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 858 * schedule the timer to wake up every UCODE_TRACE_PERIOD milliseconds 870 859 * to perform continuous uCode event logging operation if enabled 871 860 */ ··· 1104 1115 1105 1116 struct iwl_rxon_context contexts[NUM_IWL_RXON_CTX]; 1106 1117 1107 - struct iwl_switch_rxon switch_rxon; 1118 + __le16 switch_channel; 1108 1119 1109 1120 /* 1st responses from initialize and runtime uCode images. 1110 1121 * _4965's initialize alive response contains some calibration data. */
+10 -10
drivers/net/wireless/iwlegacy/iwl4965-base.c
··· 2861 2861 goto out; 2862 2862 2863 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 2866 goto out; 2866 2867 2867 2868 if (!iwl_legacy_is_associated_ctx(ctx)) 2868 - goto out; 2869 - 2870 - /* channel switch in progress */ 2871 - if (priv->switch_rxon.switch_in_progress == true) 2872 2869 goto out; 2873 2870 2874 2871 if (priv->cfg->ops->lib->set_channel_switch) { ··· 2916 2919 * at this point, staging_rxon has the 2917 2920 * configuration for channel switch 2918 2921 */ 2919 - if (priv->cfg->ops->lib->set_channel_switch(priv, 2920 - ch_switch)) 2921 - priv->switch_rxon.switch_in_progress = false; 2922 + set_bit(STATUS_CHANNEL_SWITCH_PENDING, &priv->status); 2923 + priv->switch_channel = cpu_to_le16(ch); 2924 + if (priv->cfg->ops->lib->set_channel_switch(priv, ch_switch)) { 2925 + clear_bit(STATUS_CHANNEL_SWITCH_PENDING, 2926 + &priv->status); 2927 + priv->switch_channel = 0; 2928 + ieee80211_chswitch_done(ctx->vif, false); 2929 + } 2922 2930 } 2923 2931 } 2924 2932 out: 2925 2933 mutex_unlock(&priv->mutex); 2926 - if (!priv->switch_rxon.switch_in_progress) 2927 - ieee80211_chswitch_done(ctx->vif, false); 2928 2934 IWL_DEBUG_MAC80211(priv, "leave\n"); 2929 2935 } 2930 2936
-74
drivers/net/wireless/iwlwifi/iwl-2000.c
··· 177 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 180 static struct iwl_lib_ops iwl2000_lib = { 254 181 .set_hw_params = iwl2000_hw_set_hw_params, 255 182 .rx_handler_setup = iwlagn_rx_handler_setup, ··· 185 258 .is_valid_rtc_data_addr = iwlagn_hw_valid_rtc_data_addr, 186 259 .send_tx_power = iwlagn_send_tx_power, 187 260 .update_chain_flags = iwl_update_chain_flags, 188 - .set_channel_switch = iwl2030_hw_channel_switch, 189 261 .apm_ops = { 190 262 .init = iwl_apm_init, 191 263 .config = iwl2000_nic_config,
-3
drivers/net/wireless/iwlwifi/iwl-5000.c
··· 331 331 ctx->active.channel, ch); 332 332 return -EFAULT; 333 333 } 334 - priv->switch_rxon.channel = cmd.channel; 335 - priv->switch_rxon.switch_in_progress = true; 336 334 337 335 return iwl_send_cmd_sync(priv, &hcmd); 338 336 } ··· 423 425 }; 424 426 static struct iwl_ht_params iwl5000_ht_params = { 425 427 .ht_greenfield_support = true, 426 - .use_rts_for_aggregation = true, /* use rts/cts protection */ 427 428 }; 428 429 429 430 #define IWL_DEVICE_5000 \
-2
drivers/net/wireless/iwlwifi/iwl-6000.c
··· 270 270 ctx->active.channel, ch); 271 271 return -EFAULT; 272 272 } 273 - priv->switch_rxon.channel = cmd.channel; 274 - priv->switch_rxon.switch_in_progress = true; 275 273 276 274 return iwl_send_cmd_sync(priv, &hcmd); 277 275 }
+2 -10
drivers/net/wireless/iwlwifi/iwl-agn-hcmd.c
··· 163 163 __le16 fc, __le32 *tx_flags) 164 164 { 165 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 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 171 /* Calc max signal level (dBm) among 3 possible receivers */
+16 -3
drivers/net/wireless/iwlwifi/iwl-agn-rxon.c
··· 325 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 336 if ((ctx->vif && ctx->vif->bss_conf.use_short_slot) || 329 337 !(ctx->staging.flags & RXON_FLG_BAND_24G_MSK)) 330 338 ctx->staging.flags |= RXON_FLG_SHORT_SLOT_MSK; ··· 350 342 * receive commit_rxon request 351 343 * abort any previous channel switch if still in process 352 344 */ 353 - if (priv->switch_rxon.switch_in_progress && 354 - (priv->switch_rxon.channel != ctx->staging.channel)) { 345 + if (test_bit(STATUS_CHANNEL_SWITCH_PENDING, &priv->status) && 346 + (priv->switch_channel != ctx->staging.channel)) { 355 347 IWL_DEBUG_11H(priv, "abort channel switch on %d\n", 356 - le16_to_cpu(priv->switch_rxon.channel)); 348 + le16_to_cpu(priv->switch_channel)); 357 349 iwl_chswitch_done(priv, false); 358 350 } 359 351 ··· 370 362 } 371 363 372 364 memcpy(active, &ctx->staging, sizeof(*active)); 365 + /* 366 + * We do not commit tx power settings while channel changing, 367 + * do it now if after settings changed. 368 + */ 369 + iwl_set_tx_power(priv, priv->tx_power_next, false); 373 370 return 0; 374 371 } 375 372
+10 -9
drivers/net/wireless/iwlwifi/iwl-agn.c
··· 2843 2843 goto out; 2844 2844 2845 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 2848 goto out; 2848 2849 2849 2850 if (!iwl_is_associated_ctx(ctx)) 2850 - goto out; 2851 - 2852 - /* channel switch in progress */ 2853 - if (priv->switch_rxon.switch_in_progress == true) 2854 2851 goto out; 2855 2852 2856 2853 if (priv->cfg->ops->lib->set_channel_switch) { ··· 2898 2901 * at this point, staging_rxon has the 2899 2902 * configuration for channel switch 2900 2903 */ 2904 + set_bit(STATUS_CHANNEL_SWITCH_PENDING, &priv->status); 2905 + priv->switch_channel = cpu_to_le16(ch); 2901 2906 if (priv->cfg->ops->lib->set_channel_switch(priv, 2902 - ch_switch)) 2903 - priv->switch_rxon.switch_in_progress = false; 2907 + ch_switch)) { 2908 + clear_bit(STATUS_CHANNEL_SWITCH_PENDING, 2909 + &priv->status); 2910 + priv->switch_channel = 0; 2911 + ieee80211_chswitch_done(ctx->vif, false); 2912 + } 2904 2913 } 2905 2914 } 2906 2915 out: 2907 2916 mutex_unlock(&priv->mutex); 2908 - if (!priv->switch_rxon.switch_in_progress) 2909 - ieee80211_chswitch_done(ctx->vif, false); 2910 2917 IWL_DEBUG_MAC80211(priv, "leave\n"); 2911 2918 } 2912 2919
+1 -5
drivers/net/wireless/iwlwifi/iwl-core.c
··· 843 843 if (test_bit(STATUS_EXIT_PENDING, &priv->status)) 844 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 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 850 #ifdef CONFIG_IWLWIFI_DEBUG
+1
drivers/net/wireless/iwlwifi/iwl-core.h
··· 560 560 #define STATUS_POWER_PMI 16 561 561 #define STATUS_FW_ERROR 17 562 562 #define STATUS_DEVICE_ENABLED 18 563 + #define STATUS_CHANNEL_SWITCH_PENDING 19 563 564 564 565 565 566 static inline int iwl_is_ready(struct iwl_priv *priv)
+1 -12
drivers/net/wireless/iwlwifi/iwl-dev.h
··· 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 985 * schedule the timer to wake up every UCODE_TRACE_PERIOD milliseconds 997 986 * to perform continuous uCode event logging operation if enabled 998 987 */ ··· 1276 1287 1277 1288 struct iwl_rxon_context contexts[NUM_IWL_RXON_CTX]; 1278 1289 1279 - struct iwl_switch_rxon switch_rxon; 1290 + __le16 switch_channel; 1280 1291 1281 1292 struct { 1282 1293 u32 error_event_table;
+12 -12
drivers/net/wireless/iwlwifi/iwl-rx.c
··· 250 250 struct iwl_rxon_context *ctx = &priv->contexts[IWL_RXON_CTX_BSS]; 251 251 struct iwl_rxon_cmd *rxon = (void *)&ctx->active; 252 252 253 - if (priv->switch_rxon.switch_in_progress) { 254 - if (!le32_to_cpu(csa->status) && 255 - (csa->channel == priv->switch_rxon.channel)) { 256 - rxon->channel = csa->channel; 257 - ctx->staging.channel = csa->channel; 258 - IWL_DEBUG_11H(priv, "CSA notif: channel %d\n", 253 + if (!test_bit(STATUS_CHANNEL_SWITCH_PENDING, &priv->status)) 254 + return; 255 + 256 + if (!le32_to_cpu(csa->status) && csa->channel == priv->switch_channel) { 257 + rxon->channel = csa->channel; 258 + ctx->staging.channel = csa->channel; 259 + IWL_DEBUG_11H(priv, "CSA notif: channel %d\n", 259 260 le16_to_cpu(csa->channel)); 260 - iwl_chswitch_done(priv, true); 261 - } else { 262 - IWL_ERR(priv, "CSA notif (fail) : channel %d\n", 263 - le16_to_cpu(csa->channel)); 264 - iwl_chswitch_done(priv, false); 265 - } 261 + iwl_chswitch_done(priv, true); 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
+16 -5
drivers/net/wireless/libertas/if_sdio.c
··· 907 907 card = sdio_get_drvdata(func); 908 908 909 909 cause = sdio_readb(card->func, IF_SDIO_H_INT_STATUS, &ret); 910 - if (ret) 910 + if (ret || !cause) 911 911 goto out; 912 912 913 913 lbs_deb_sdio("interrupt: 0x%X\n", (unsigned)cause); ··· 1008 1008 if (ret) 1009 1009 goto release; 1010 1010 1011 - ret = sdio_claim_irq(func, if_sdio_interrupt); 1012 - if (ret) 1013 - goto disable; 1014 - 1015 1011 /* For 1-bit transfers to the 8686 model, we need to enable the 1016 1012 * interrupt flag in the CCCR register. Set the MMC_QUIRK_LENIENT_FN0 1017 1013 * bit to allow access to non-vendor registers. */ ··· 1077 1081 card->rx_unit = if_sdio_read_rx_unit(card); 1078 1082 else 1079 1083 card->rx_unit = 0; 1084 + 1085 + /* 1086 + * Set up the interrupt handler late. 1087 + * 1088 + * If we set it up earlier, the (buggy) hardware generates a spurious 1089 + * interrupt, even before the interrupt has been enabled, with 1090 + * CCCR_INTx = 0. 1091 + * 1092 + * We register the interrupt handler late so that we can handle any 1093 + * spurious interrupts, and also to avoid generation of that known 1094 + * spurious interrupt in the first place. 1095 + */ 1096 + ret = sdio_claim_irq(func, if_sdio_interrupt); 1097 + if (ret) 1098 + goto disable; 1080 1099 1081 1100 /* 1082 1101 * Enable interrupts now that everything is set up
+2 -1
drivers/net/wireless/rt2x00/rt2x00config.c
··· 250 250 if (ieee80211_flags & IEEE80211_CONF_CHANGE_CHANNEL) 251 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 255 (ieee80211_flags & IEEE80211_CONF_CHANGE_PS) && 255 256 (conf->flags & IEEE80211_CONF_PS)) { 256 257 beacon_diff = (long)jiffies - (long)rt2x00dev->last_beacon;
+4
drivers/net/wireless/rt2x00/rt2x00dev.c
··· 146 146 struct rt2x00_dev *rt2x00dev = 147 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 152 if (rt2x00dev->ops->lib->set_device_state(rt2x00dev, STATE_AWAKE)) 150 153 ERROR(rt2x00dev, "Device failed to wakeup.\n"); 151 154 clear_bit(CONFIG_POWERSAVING, &rt2x00dev->flags); ··· 1163 1160 * Stop all work. 1164 1161 */ 1165 1162 cancel_work_sync(&rt2x00dev->intf_work); 1163 + cancel_delayed_work_sync(&rt2x00dev->autowakeup_work); 1166 1164 if (rt2x00_is_usb(rt2x00dev)) { 1167 1165 del_timer_sync(&rt2x00dev->txstatus_timer); 1168 1166 cancel_work_sync(&rt2x00dev->rxdone_work);
+14 -16
drivers/net/wireless/rtlwifi/pci.c
··· 669 669 &rx_status, 670 670 (u8 *) pdesc, skb); 671 671 672 + new_skb = dev_alloc_skb(rtlpci->rxbuffersize); 673 + if (unlikely(!new_skb)) { 674 + RT_TRACE(rtlpriv, (COMP_INTR | COMP_RECV), 675 + DBG_DMESG, 676 + ("can't alloc skb for rx\n")); 677 + goto done; 678 + } 679 + 680 + pci_unmap_single(rtlpci->pdev, 681 + *((dma_addr_t *) skb->cb), 682 + rtlpci->rxbuffersize, 683 + PCI_DMA_FROMDEVICE); 684 + 672 685 skb_put(skb, rtlpriv->cfg->ops->get_desc((u8 *) pdesc, 673 686 false, 674 687 HW_DESC_RXPKT_LEN)); ··· 698 685 hdr = rtl_get_hdr(skb); 699 686 fc = rtl_get_fc(skb); 700 687 701 - /* try for new buffer - if allocation fails, drop 702 - * frame and reuse old buffer 703 - */ 704 - new_skb = dev_alloc_skb(rtlpci->rxbuffersize); 705 - if (unlikely(!new_skb)) { 706 - RT_TRACE(rtlpriv, (COMP_INTR | COMP_RECV), 707 - DBG_DMESG, 708 - ("can't alloc skb for rx\n")); 709 - goto done; 710 - } 711 - pci_unmap_single(rtlpci->pdev, 712 - *((dma_addr_t *) skb->cb), 713 - rtlpci->rxbuffersize, 714 - PCI_DMA_FROMDEVICE); 715 - 716 - if (!stats.crc || !stats.hwerror) { 688 + if (!stats.crc && !stats.hwerror) { 717 689 memcpy(IEEE80211_SKB_RXCB(skb), &rx_status, 718 690 sizeof(rx_status)); 719 691
+6 -4
drivers/ssb/driver_pcicore.c
··· 539 539 if (!pc->hostmode) 540 540 ssb_pcicore_init_clientmode(pc); 541 541 542 - /* Additional always once-executed workarounds */ 543 - ssb_pcicore_serdes_workaround(pc); 544 - /* TODO: ASPM */ 545 - /* TODO: Clock Request Update */ 542 + /* Additional PCIe always once-executed workarounds */ 543 + if (dev->id.coreid == SSB_DEV_PCIE) { 544 + ssb_pcicore_serdes_workaround(pc); 545 + /* TODO: ASPM */ 546 + /* TODO: Clock Request Update */ 547 + } 546 548 } 547 549 548 550 static u32 ssb_pcie_read(struct ssb_pcicore *pc, u32 address)
+3 -3
include/linux/ethtool.h
··· 268 268 __u32 cmd; /* ETHTOOL_{G,S}PAUSEPARAM */ 269 269 270 270 /* If the link is being auto-negotiated (via ethtool_cmd.autoneg 271 - * being true) the user may set 'autonet' here non-zero to have the 271 + * being true) the user may set 'autoneg' here non-zero to have the 272 272 * pause parameters be auto-negotiated too. In such a case, the 273 273 * {rx,tx}_pause values below determine what capabilities are 274 274 * advertised. ··· 811 811 * @get_tx_csum: Deprecated as redundant. Report whether transmit checksums 812 812 * are turned on or off. 813 813 * @set_tx_csum: Deprecated in favour of generic netdev features. Turn 814 - * transmit checksums on or off. Returns a egative error code or zero. 814 + * transmit checksums on or off. Returns a negative error code or zero. 815 815 * @get_sg: Deprecated as redundant. Report whether scatter-gather is 816 816 * enabled. 817 817 * @set_sg: Deprecated in favour of generic netdev features. Turn ··· 1087 1087 /* The following are all involved in forcing a particular link 1088 1088 * mode for the device for setting things. When getting the 1089 1089 * devices settings, these indicate the current mode and whether 1090 - * it was foced up into this mode or autonegotiated. 1090 + * it was forced up into this mode or autonegotiated. 1091 1091 */ 1092 1092 1093 1093 /* The forced speed, 10Mb, 100Mb, gigabit, 2.5Gb, 10GbE. */
+2
include/linux/if_packet.h
··· 62 62 __u16 tp_mac; 63 63 __u16 tp_net; 64 64 __u16 tp_vlan_tci; 65 + __u16 tp_padding; 65 66 }; 66 67 67 68 /* Rx ring - header status */ ··· 102 101 __u32 tp_sec; 103 102 __u32 tp_nsec; 104 103 __u16 tp_vlan_tci; 104 + __u16 tp_padding; 105 105 }; 106 106 107 107 #define TPACKET2_HDRLEN (TPACKET_ALIGN(sizeof(struct tpacket2_hdr)) + sizeof(struct sockaddr_ll))
+22 -3
include/linux/if_vlan.h
··· 225 225 } 226 226 227 227 /** 228 - * __vlan_put_tag - regular VLAN tag inserting 228 + * vlan_insert_tag - regular VLAN tag inserting 229 229 * @skb: skbuff to tag 230 230 * @vlan_tci: VLAN TCI to insert 231 231 * ··· 234 234 * 235 235 * Following the skb_unshare() example, in case of error, the calling function 236 236 * doesn't have to worry about freeing the original skb. 237 + * 238 + * Does not change skb->protocol so this function can be used during receive. 237 239 */ 238 - static inline struct sk_buff *__vlan_put_tag(struct sk_buff *skb, u16 vlan_tci) 240 + static inline struct sk_buff *vlan_insert_tag(struct sk_buff *skb, u16 vlan_tci) 239 241 { 240 242 struct vlan_ethhdr *veth; 241 243 ··· 257 255 /* now, the TCI */ 258 256 veth->h_vlan_TCI = htons(vlan_tci); 259 257 260 - skb->protocol = htons(ETH_P_8021Q); 258 + return skb; 259 + } 261 260 261 + /** 262 + * __vlan_put_tag - regular VLAN tag inserting 263 + * @skb: skbuff to tag 264 + * @vlan_tci: VLAN TCI to insert 265 + * 266 + * Inserts the VLAN tag into @skb as part of the payload 267 + * Returns a VLAN tagged skb. If a new skb is created, @skb is freed. 268 + * 269 + * Following the skb_unshare() example, in case of error, the calling function 270 + * doesn't have to worry about freeing the original skb. 271 + */ 272 + static inline struct sk_buff *__vlan_put_tag(struct sk_buff *skb, u16 vlan_tci) 273 + { 274 + skb = vlan_insert_tag(skb, vlan_tci); 275 + if (skb) 276 + skb->protocol = htons(ETH_P_8021Q); 262 277 return skb; 263 278 } 264 279
+1 -1
include/linux/netdevice.h
··· 2555 2555 2556 2556 extern struct kobj_ns_type_operations net_ns_type_operations; 2557 2557 2558 - extern char *netdev_drivername(const struct net_device *dev, char *buffer, int len); 2558 + extern const char *netdev_drivername(const struct net_device *dev); 2559 2559 2560 2560 extern void linkwatch_run_queue(void); 2561 2561
+3
include/linux/netfilter/nf_conntrack_common.h
··· 18 18 /* >= this indicates reply direction */ 19 19 IP_CT_IS_REPLY, 20 20 21 + IP_CT_ESTABLISHED_REPLY = IP_CT_ESTABLISHED + IP_CT_IS_REPLY, 22 + IP_CT_RELATED_REPLY = IP_CT_RELATED + IP_CT_IS_REPLY, 23 + IP_CT_NEW_REPLY = IP_CT_NEW + IP_CT_IS_REPLY, 21 24 /* Number of distinct IP_CT types (no NEW in reply dirn). */ 22 25 IP_CT_NUMBER = IP_CT_IS_REPLY * 2 - 1 23 26 };
+5
include/linux/skbuff.h
··· 1256 1256 skb->tail += len; 1257 1257 } 1258 1258 1259 + static inline void skb_reset_mac_len(struct sk_buff *skb) 1260 + { 1261 + skb->mac_len = skb->network_header - skb->mac_header; 1262 + } 1263 + 1259 1264 #ifdef NET_SKBUFF_DATA_USES_OFFSET 1260 1265 static inline unsigned char *skb_transport_header(const struct sk_buff *skb) 1261 1266 {
+33 -27
net/8021q/vlan_core.c
··· 23 23 return false; 24 24 25 25 skb->dev = vlan_dev; 26 + if (skb->pkt_type == PACKET_OTHERHOST) { 27 + /* Our lower layer thinks this is not local, let's make sure. 28 + * This allows the VLAN to have a different MAC than the 29 + * underlying device, and still route correctly. */ 30 + if (!compare_ether_addr(eth_hdr(skb)->h_dest, 31 + vlan_dev->dev_addr)) 32 + skb->pkt_type = PACKET_HOST; 33 + } 34 + 35 + if (!(vlan_dev_info(vlan_dev)->flags & VLAN_FLAG_REORDER_HDR)) { 36 + unsigned int offset = skb->data - skb_mac_header(skb); 37 + 38 + /* 39 + * vlan_insert_tag expect skb->data pointing to mac header. 40 + * So change skb->data before calling it and change back to 41 + * original position later 42 + */ 43 + skb_push(skb, offset); 44 + skb = *skbp = vlan_insert_tag(skb, skb->vlan_tci); 45 + if (!skb) 46 + return false; 47 + skb_pull(skb, offset + VLAN_HLEN); 48 + skb_reset_mac_len(skb); 49 + } 50 + 26 51 skb->priority = vlan_get_ingress_priority(vlan_dev, skb->vlan_tci); 27 52 skb->vlan_tci = 0; 28 53 ··· 56 31 u64_stats_update_begin(&rx_stats->syncp); 57 32 rx_stats->rx_packets++; 58 33 rx_stats->rx_bytes += skb->len; 59 - 60 - switch (skb->pkt_type) { 61 - case PACKET_BROADCAST: 62 - break; 63 - case PACKET_MULTICAST: 34 + if (skb->pkt_type == PACKET_MULTICAST) 64 35 rx_stats->rx_multicast++; 65 - break; 66 - case PACKET_OTHERHOST: 67 - /* Our lower layer thinks this is not local, let's make sure. 68 - * This allows the VLAN to have a different MAC than the 69 - * underlying device, and still route correctly. */ 70 - if (!compare_ether_addr(eth_hdr(skb)->h_dest, 71 - vlan_dev->dev_addr)) 72 - skb->pkt_type = PACKET_HOST; 73 - break; 74 - } 75 36 u64_stats_update_end(&rx_stats->syncp); 76 37 77 38 return true; ··· 100 89 } 101 90 EXPORT_SYMBOL(vlan_gro_frags); 102 91 103 - static struct sk_buff *vlan_check_reorder_header(struct sk_buff *skb) 92 + static struct sk_buff *vlan_reorder_header(struct sk_buff *skb) 104 93 { 105 - if (vlan_dev_info(skb->dev)->flags & VLAN_FLAG_REORDER_HDR) { 106 - if (skb_cow(skb, skb_headroom(skb)) < 0) 107 - skb = NULL; 108 - if (skb) { 109 - /* Lifted from Gleb's VLAN code... */ 110 - memmove(skb->data - ETH_HLEN, 111 - skb->data - VLAN_ETH_HLEN, 12); 112 - skb->mac_header += VLAN_HLEN; 113 - } 114 - } 94 + if (skb_cow(skb, skb_headroom(skb)) < 0) 95 + return NULL; 96 + memmove(skb->data - ETH_HLEN, skb->data - VLAN_ETH_HLEN, 2 * ETH_ALEN); 97 + skb->mac_header += VLAN_HLEN; 98 + skb_reset_mac_len(skb); 115 99 return skb; 116 100 } 117 101 ··· 167 161 skb_pull_rcsum(skb, VLAN_HLEN); 168 162 vlan_set_encap_proto(skb, vhdr); 169 163 170 - skb = vlan_check_reorder_header(skb); 164 + skb = vlan_reorder_header(skb); 171 165 if (unlikely(!skb)) 172 166 goto err_free; 173 167
+6
net/bridge/br_netfilter.c
··· 104 104 { 105 105 } 106 106 107 + static u32 *fake_cow_metrics(struct dst_entry *dst, unsigned long old) 108 + { 109 + return NULL; 110 + } 111 + 107 112 static struct dst_ops fake_dst_ops = { 108 113 .family = AF_INET, 109 114 .protocol = cpu_to_be16(ETH_P_IP), 110 115 .update_pmtu = fake_update_pmtu, 116 + .cow_metrics = fake_cow_metrics, 111 117 }; 112 118 113 119 /*
+11 -12
net/core/dev.c
··· 3114 3114 3115 3115 skb_reset_network_header(skb); 3116 3116 skb_reset_transport_header(skb); 3117 - skb->mac_len = skb->network_header - skb->mac_header; 3117 + skb_reset_mac_len(skb); 3118 3118 3119 3119 pt_prev = NULL; 3120 3120 ··· 6178 6178 oldsd->output_queue = NULL; 6179 6179 oldsd->output_queue_tailp = &oldsd->output_queue; 6180 6180 } 6181 + /* Append NAPI poll list from offline CPU. */ 6182 + if (!list_empty(&oldsd->poll_list)) { 6183 + list_splice_init(&oldsd->poll_list, &sd->poll_list); 6184 + raise_softirq_irqoff(NET_RX_SOFTIRQ); 6185 + } 6181 6186 6182 6187 raise_softirq_irqoff(NET_TX_SOFTIRQ); 6183 6188 local_irq_enable(); ··· 6269 6264 /** 6270 6265 * netdev_drivername - network driver for the device 6271 6266 * @dev: network device 6272 - * @buffer: buffer for resulting name 6273 - * @len: size of buffer 6274 6267 * 6275 6268 * Determine network driver for device. 6276 6269 */ 6277 - char *netdev_drivername(const struct net_device *dev, char *buffer, int len) 6270 + const char *netdev_drivername(const struct net_device *dev) 6278 6271 { 6279 6272 const struct device_driver *driver; 6280 6273 const struct device *parent; 6281 - 6282 - if (len <= 0 || !buffer) 6283 - return buffer; 6284 - buffer[0] = 0; 6274 + const char *empty = ""; 6285 6275 6286 6276 parent = dev->dev.parent; 6287 - 6288 6277 if (!parent) 6289 - return buffer; 6278 + return empty; 6290 6279 6291 6280 driver = parent->driver; 6292 6281 if (driver && driver->name) 6293 - strlcpy(buffer, driver->name, len); 6294 - return buffer; 6282 + return driver->name; 6283 + return empty; 6295 6284 } 6296 6285 6297 6286 static int __netdev_printk(const char *level, const struct net_device *dev,
+7 -9
net/core/net_namespace.c
··· 310 310 struct file *file; 311 311 struct net *net; 312 312 313 - net = ERR_PTR(-EINVAL); 314 313 file = proc_ns_fget(fd); 315 - if (!file) 316 - goto out; 314 + if (IS_ERR(file)) 315 + return ERR_CAST(file); 317 316 318 317 ei = PROC_I(file->f_dentry->d_inode); 319 - if (ei->ns_ops != &netns_operations) 320 - goto out; 318 + if (ei->ns_ops == &netns_operations) 319 + net = get_net(ei->ns); 320 + else 321 + net = ERR_PTR(-EINVAL); 321 322 322 - net = get_net(ei->ns); 323 - out: 324 - if (file) 325 - fput(file); 323 + fput(file); 326 324 return net; 327 325 } 328 326
+7
net/core/netpoll.c
··· 792 792 return -ENODEV; 793 793 } 794 794 795 + if (ndev->master) { 796 + printk(KERN_ERR "%s: %s is a slave device, aborting.\n", 797 + np->name, np->dev_name); 798 + err = -EBUSY; 799 + goto put; 800 + } 801 + 795 802 if (!netif_running(ndev)) { 796 803 unsigned long atmost, atleast; 797 804
+3 -3
net/ipv4/ip_output.c
··· 799 799 int csummode = CHECKSUM_NONE; 800 800 struct rtable *rt = (struct rtable *)cork->dst; 801 801 802 - exthdrlen = transhdrlen ? rt->dst.header_len : 0; 802 + skb = skb_peek_tail(queue); 803 + 804 + exthdrlen = !skb ? rt->dst.header_len : 0; 803 805 length += exthdrlen; 804 806 transhdrlen += exthdrlen; 805 807 mtu = cork->fragsize; ··· 826 824 rt->dst.dev->features & NETIF_F_V4_CSUM && 827 825 !exthdrlen) 828 826 csummode = CHECKSUM_PARTIAL; 829 - 830 - skb = skb_peek_tail(queue); 831 827 832 828 cork->length += length; 833 829 if (((length > mtu) || (skb && skb_is_gso(skb))) &&
+2 -1
net/ipv4/netfilter/ip_queue.c
··· 402 402 static inline void 403 403 __ipq_rcv_skb(struct sk_buff *skb) 404 404 { 405 - int status, type, pid, flags, nlmsglen, skblen; 405 + int status, type, pid, flags; 406 + unsigned int nlmsglen, skblen; 406 407 struct nlmsghdr *nlh; 407 408 408 409 skblen = skb->len;
+3 -3
net/ipv4/netfilter/ipt_CLUSTERIP.c
··· 307 307 * error messages (RELATED) and information requests (see below) */ 308 308 if (ip_hdr(skb)->protocol == IPPROTO_ICMP && 309 309 (ctinfo == IP_CT_RELATED || 310 - ctinfo == IP_CT_RELATED + IP_CT_IS_REPLY)) 310 + ctinfo == IP_CT_RELATED_REPLY)) 311 311 return XT_CONTINUE; 312 312 313 313 /* ip_conntrack_icmp guarantees us that we only have ICMP_ECHO, ··· 321 321 ct->mark = hash; 322 322 break; 323 323 case IP_CT_RELATED: 324 - case IP_CT_RELATED+IP_CT_IS_REPLY: 324 + case IP_CT_RELATED_REPLY: 325 325 /* FIXME: we don't handle expectations at the 326 326 * moment. they can arrive on a different node than 327 327 * the master connection (e.g. FTP passive mode) */ 328 328 case IP_CT_ESTABLISHED: 329 - case IP_CT_ESTABLISHED+IP_CT_IS_REPLY: 329 + case IP_CT_ESTABLISHED_REPLY: 330 330 break; 331 331 default: 332 332 break;
+1 -1
net/ipv4/netfilter/ipt_MASQUERADE.c
··· 60 60 nat = nfct_nat(ct); 61 61 62 62 NF_CT_ASSERT(ct && (ctinfo == IP_CT_NEW || ctinfo == IP_CT_RELATED || 63 - ctinfo == IP_CT_RELATED + IP_CT_IS_REPLY)); 63 + ctinfo == IP_CT_RELATED_REPLY)); 64 64 65 65 /* Source address is 0.0.0.0 - locally generated packet that is 66 66 * probably not supposed to be masqueraded.
+1 -1
net/ipv4/netfilter/nf_conntrack_l3proto_ipv4.c
··· 101 101 102 102 /* This is where we call the helper: as the packet goes out. */ 103 103 ct = nf_ct_get(skb, &ctinfo); 104 - if (!ct || ctinfo == IP_CT_RELATED + IP_CT_IS_REPLY) 104 + if (!ct || ctinfo == IP_CT_RELATED_REPLY) 105 105 goto out; 106 106 107 107 help = nfct_help(ct);
+1 -1
net/ipv4/netfilter/nf_conntrack_proto_icmp.c
··· 160 160 /* Update skb to refer to this connection */ 161 161 skb->nfct = &nf_ct_tuplehash_to_ctrack(h)->ct_general; 162 162 skb->nfctinfo = *ctinfo; 163 - return -NF_ACCEPT; 163 + return NF_ACCEPT; 164 164 } 165 165 166 166 /* Small and modified version of icmp_rcv */
+1 -1
net/ipv4/netfilter/nf_nat_core.c
··· 433 433 434 434 /* Must be RELATED */ 435 435 NF_CT_ASSERT(skb->nfctinfo == IP_CT_RELATED || 436 - skb->nfctinfo == IP_CT_RELATED+IP_CT_IS_REPLY); 436 + skb->nfctinfo == IP_CT_RELATED_REPLY); 437 437 438 438 /* Redirects on non-null nats must be dropped, else they'll 439 439 start talking to each other without our translation, and be
+1 -1
net/ipv4/netfilter/nf_nat_helper.c
··· 160 160 161 161 if (skb->ip_summed != CHECKSUM_PARTIAL) { 162 162 if (!(rt->rt_flags & RTCF_LOCAL) && 163 - skb->dev->features & NETIF_F_V4_CSUM) { 163 + (!skb->dev || skb->dev->features & NETIF_F_V4_CSUM)) { 164 164 skb->ip_summed = CHECKSUM_PARTIAL; 165 165 skb->csum_start = skb_headroom(skb) + 166 166 skb_network_offset(skb) +
+1 -1
net/ipv4/netfilter/nf_nat_rule.c
··· 53 53 54 54 /* Connection must be valid and new. */ 55 55 NF_CT_ASSERT(ct && (ctinfo == IP_CT_NEW || ctinfo == IP_CT_RELATED || 56 - ctinfo == IP_CT_RELATED + IP_CT_IS_REPLY)); 56 + ctinfo == IP_CT_RELATED_REPLY)); 57 57 NF_CT_ASSERT(par->out != NULL); 58 58 59 59 return nf_nat_setup_info(ct, &mr->range[0], IP_NAT_MANIP_SRC);
+2 -2
net/ipv4/netfilter/nf_nat_standalone.c
··· 116 116 117 117 switch (ctinfo) { 118 118 case IP_CT_RELATED: 119 - case IP_CT_RELATED+IP_CT_IS_REPLY: 119 + case IP_CT_RELATED_REPLY: 120 120 if (ip_hdr(skb)->protocol == IPPROTO_ICMP) { 121 121 if (!nf_nat_icmp_reply_translation(ct, ctinfo, 122 122 hooknum, skb)) ··· 144 144 default: 145 145 /* ESTABLISHED */ 146 146 NF_CT_ASSERT(ctinfo == IP_CT_ESTABLISHED || 147 - ctinfo == (IP_CT_ESTABLISHED+IP_CT_IS_REPLY)); 147 + ctinfo == IP_CT_ESTABLISHED_REPLY); 148 148 } 149 149 150 150 return nf_nat_packet(ct, ctinfo, hooknum, skb);
+44 -34
net/ipv4/route.c
··· 1316 1316 ; 1317 1317 } 1318 1318 1319 + static bool peer_pmtu_expired(struct inet_peer *peer) 1320 + { 1321 + unsigned long orig = ACCESS_ONCE(peer->pmtu_expires); 1322 + 1323 + return orig && 1324 + time_after_eq(jiffies, orig) && 1325 + cmpxchg(&peer->pmtu_expires, orig, 0) == orig; 1326 + } 1327 + 1328 + static bool peer_pmtu_cleaned(struct inet_peer *peer) 1329 + { 1330 + unsigned long orig = ACCESS_ONCE(peer->pmtu_expires); 1331 + 1332 + return orig && 1333 + cmpxchg(&peer->pmtu_expires, orig, 0) == orig; 1334 + } 1335 + 1319 1336 static struct dst_entry *ipv4_negative_advice(struct dst_entry *dst) 1320 1337 { 1321 1338 struct rtable *rt = (struct rtable *)dst; ··· 1348 1331 rt_genid(dev_net(dst->dev))); 1349 1332 rt_del(hash, rt); 1350 1333 ret = NULL; 1351 - } else if (rt->peer && 1352 - rt->peer->pmtu_expires && 1353 - time_after_eq(jiffies, rt->peer->pmtu_expires)) { 1354 - unsigned long orig = rt->peer->pmtu_expires; 1355 - 1356 - if (cmpxchg(&rt->peer->pmtu_expires, orig, 0) == orig) 1357 - dst_metric_set(dst, RTAX_MTU, 1358 - rt->peer->pmtu_orig); 1334 + } else if (rt->peer && peer_pmtu_expired(rt->peer)) { 1335 + dst_metric_set(dst, RTAX_MTU, rt->peer->pmtu_orig); 1359 1336 } 1360 1337 } 1361 1338 return ret; ··· 1542 1531 1543 1532 static void check_peer_pmtu(struct dst_entry *dst, struct inet_peer *peer) 1544 1533 { 1545 - unsigned long expires = peer->pmtu_expires; 1534 + unsigned long expires = ACCESS_ONCE(peer->pmtu_expires); 1546 1535 1536 + if (!expires) 1537 + return; 1547 1538 if (time_before(jiffies, expires)) { 1548 1539 u32 orig_dst_mtu = dst_mtu(dst); 1549 1540 if (peer->pmtu_learned < orig_dst_mtu) { ··· 1568 1555 rt_bind_peer(rt, rt->rt_dst, 1); 1569 1556 peer = rt->peer; 1570 1557 if (peer) { 1558 + unsigned long pmtu_expires = ACCESS_ONCE(peer->pmtu_expires); 1559 + 1571 1560 if (mtu < ip_rt_min_pmtu) 1572 1561 mtu = ip_rt_min_pmtu; 1573 - if (!peer->pmtu_expires || mtu < peer->pmtu_learned) { 1574 - unsigned long pmtu_expires; 1562 + if (!pmtu_expires || mtu < peer->pmtu_learned) { 1575 1563 1576 1564 pmtu_expires = jiffies + ip_rt_mtu_expires; 1577 1565 if (!pmtu_expires) ··· 1626 1612 rt_bind_peer(rt, rt->rt_dst, 0); 1627 1613 1628 1614 peer = rt->peer; 1629 - if (peer && peer->pmtu_expires) 1615 + if (peer) { 1630 1616 check_peer_pmtu(dst, peer); 1631 1617 1632 - if (peer && peer->redirect_learned.a4 && 1633 - peer->redirect_learned.a4 != rt->rt_gateway) { 1634 - if (check_peer_redir(dst, peer)) 1635 - return NULL; 1618 + if (peer->redirect_learned.a4 && 1619 + peer->redirect_learned.a4 != rt->rt_gateway) { 1620 + if (check_peer_redir(dst, peer)) 1621 + return NULL; 1622 + } 1636 1623 } 1637 1624 1638 1625 rt->rt_peer_genid = rt_peer_genid(); ··· 1664 1649 icmp_send(skb, ICMP_DEST_UNREACH, ICMP_HOST_UNREACH, 0); 1665 1650 1666 1651 rt = skb_rtable(skb); 1667 - if (rt && 1668 - rt->peer && 1669 - rt->peer->pmtu_expires) { 1670 - unsigned long orig = rt->peer->pmtu_expires; 1671 - 1672 - if (cmpxchg(&rt->peer->pmtu_expires, orig, 0) == orig) 1673 - dst_metric_set(&rt->dst, RTAX_MTU, rt->peer->pmtu_orig); 1674 - } 1652 + if (rt && rt->peer && peer_pmtu_cleaned(rt->peer)) 1653 + dst_metric_set(&rt->dst, RTAX_MTU, rt->peer->pmtu_orig); 1675 1654 } 1676 1655 1677 1656 static int ip_rt_bug(struct sk_buff *skb) ··· 1779 1770 sizeof(u32) * RTAX_MAX); 1780 1771 dst_init_metrics(&rt->dst, peer->metrics, false); 1781 1772 1782 - if (peer->pmtu_expires) 1783 - check_peer_pmtu(&rt->dst, peer); 1773 + check_peer_pmtu(&rt->dst, peer); 1784 1774 if (peer->redirect_learned.a4 && 1785 1775 peer->redirect_learned.a4 != rt->rt_gateway) { 1786 1776 rt->rt_gateway = peer->redirect_learned.a4; ··· 2783 2775 struct rtable *rt = skb_rtable(skb); 2784 2776 struct rtmsg *r; 2785 2777 struct nlmsghdr *nlh; 2786 - long expires; 2778 + long expires = 0; 2779 + const struct inet_peer *peer = rt->peer; 2787 2780 u32 id = 0, ts = 0, tsage = 0, error; 2788 2781 2789 2782 nlh = nlmsg_put(skb, pid, seq, event, sizeof(*r), flags); ··· 2832 2823 NLA_PUT_BE32(skb, RTA_MARK, rt->rt_mark); 2833 2824 2834 2825 error = rt->dst.error; 2835 - expires = (rt->peer && rt->peer->pmtu_expires) ? 2836 - rt->peer->pmtu_expires - jiffies : 0; 2837 - if (rt->peer) { 2826 + if (peer) { 2838 2827 inet_peer_refcheck(rt->peer); 2839 - id = atomic_read(&rt->peer->ip_id_count) & 0xffff; 2840 - if (rt->peer->tcp_ts_stamp) { 2841 - ts = rt->peer->tcp_ts; 2842 - tsage = get_seconds() - rt->peer->tcp_ts_stamp; 2828 + id = atomic_read(&peer->ip_id_count) & 0xffff; 2829 + if (peer->tcp_ts_stamp) { 2830 + ts = peer->tcp_ts; 2831 + tsage = get_seconds() - peer->tcp_ts_stamp; 2843 2832 } 2833 + expires = ACCESS_ONCE(peer->pmtu_expires); 2834 + if (expires) 2835 + expires -= jiffies; 2844 2836 } 2845 2837 2846 2838 if (rt_is_input_route(rt)) {
+4
net/ipv6/af_inet6.c
··· 272 272 273 273 if (addr_len < SIN6_LEN_RFC2133) 274 274 return -EINVAL; 275 + 276 + if (addr->sin6_family != AF_INET6) 277 + return -EINVAL; 278 + 275 279 addr_type = ipv6_addr_type(&addr->sin6_addr); 276 280 if ((addr_type & IPV6_ADDR_MULTICAST) && sock->type == SOCK_STREAM) 277 281 return -EINVAL;
+2 -1
net/ipv6/netfilter/ip6_queue.c
··· 403 403 static inline void 404 404 __ipq_rcv_skb(struct sk_buff *skb) 405 405 { 406 - int status, type, pid, flags, nlmsglen, skblen; 406 + int status, type, pid, flags; 407 + unsigned int nlmsglen, skblen; 407 408 struct nlmsghdr *nlh; 408 409 409 410 skblen = skb->len;
+1 -1
net/ipv6/netfilter/nf_conntrack_l3proto_ipv6.c
··· 160 160 161 161 /* This is where we call the helper: as the packet goes out. */ 162 162 ct = nf_ct_get(skb, &ctinfo); 163 - if (!ct || ctinfo == IP_CT_RELATED + IP_CT_IS_REPLY) 163 + if (!ct || ctinfo == IP_CT_RELATED_REPLY) 164 164 goto out; 165 165 166 166 help = nfct_help(ct);
+1 -1
net/ipv6/netfilter/nf_conntrack_proto_icmpv6.c
··· 177 177 /* Update skb to refer to this connection */ 178 178 skb->nfct = &nf_ct_tuplehash_to_ctrack(h)->ct_general; 179 179 skb->nfctinfo = *ctinfo; 180 - return -NF_ACCEPT; 180 + return NF_ACCEPT; 181 181 } 182 182 183 183 static int
+5
net/irda/iriap.c
··· 87 87 iriap_watchdog_timer_expired); 88 88 } 89 89 90 + static struct lock_class_key irias_objects_key; 91 + 90 92 /* 91 93 * Function iriap_init (void) 92 94 * ··· 115 113 hashbin_delete(iriap, NULL); 116 114 return -ENOMEM; 117 115 } 116 + 117 + lockdep_set_class_and_name(&irias_objects->hb_spinlock, &irias_objects_key, 118 + "irias_objects"); 118 119 119 120 /* 120 121 * Register some default services for IrLMP
+1 -1
net/l2tp/l2tp_debugfs.c
··· 258 258 */ 259 259 pd->net = get_net_ns_by_pid(current->pid); 260 260 if (IS_ERR(pd->net)) { 261 - rc = -PTR_ERR(pd->net); 261 + rc = PTR_ERR(pd->net); 262 262 goto err_free_pd; 263 263 } 264 264
+4 -2
net/mac80211/ibss.c
··· 965 965 966 966 mutex_lock(&sdata->u.ibss.mtx); 967 967 968 + sdata->u.ibss.state = IEEE80211_IBSS_MLME_SEARCH; 969 + memset(sdata->u.ibss.bssid, 0, ETH_ALEN); 970 + sdata->u.ibss.ssid_len = 0; 971 + 968 972 active_ibss = ieee80211_sta_active_ibss(sdata); 969 973 970 974 if (!active_ibss && !is_zero_ether_addr(ifibss->bssid)) { ··· 1003 999 kfree_skb(skb); 1004 1000 1005 1001 skb_queue_purge(&sdata->skb_queue); 1006 - memset(sdata->u.ibss.bssid, 0, ETH_ALEN); 1007 - sdata->u.ibss.ssid_len = 0; 1008 1002 1009 1003 del_timer_sync(&sdata->u.ibss.timer); 1010 1004
-3
net/mac80211/ieee80211_i.h
··· 775 775 776 776 int tx_headroom; /* required headroom for hardware/radiotap */ 777 777 778 - /* count for keys needing tailroom space allocation */ 779 - int crypto_tx_tailroom_needed_cnt; 780 - 781 778 /* Tasklet and skb queue to process calls from IRQ mode. All frames 782 779 * added to skb_queue will be processed, but frames in 783 780 * skb_queue_unreliable may be dropped if the total length of these
+4
net/mac80211/iface.c
··· 1145 1145 + IEEE80211_ENCRYPT_HEADROOM; 1146 1146 ndev->needed_tailroom = IEEE80211_ENCRYPT_TAILROOM; 1147 1147 1148 + ret = dev_alloc_name(ndev, ndev->name); 1149 + if (ret < 0) 1150 + goto fail; 1151 + 1148 1152 ieee80211_assign_perm_addr(local, ndev, type); 1149 1153 memcpy(ndev->dev_addr, ndev->perm_addr, ETH_ALEN); 1150 1154 SET_NETDEV_DEV(ndev, wiphy_dev(local->hw.wiphy));
+2 -19
net/mac80211/key.c
··· 101 101 102 102 if (!ret) { 103 103 key->flags |= KEY_FLAG_UPLOADED_TO_HARDWARE; 104 - 105 - if (!((key->conf.flags & IEEE80211_KEY_FLAG_GENERATE_MMIC) || 106 - (key->conf.flags & IEEE80211_KEY_FLAG_GENERATE_IV))) 107 - key->local->crypto_tx_tailroom_needed_cnt--; 108 - 109 104 return 0; 110 105 } 111 106 ··· 156 161 key->conf.keyidx, sta ? sta->addr : bcast_addr, ret); 157 162 158 163 key->flags &= ~KEY_FLAG_UPLOADED_TO_HARDWARE; 159 - 160 - if (!((key->conf.flags & IEEE80211_KEY_FLAG_GENERATE_MMIC) || 161 - (key->conf.flags & IEEE80211_KEY_FLAG_GENERATE_IV))) 162 - key->local->crypto_tx_tailroom_needed_cnt++; 163 164 } 164 165 165 166 void ieee80211_key_removed(struct ieee80211_key_conf *key_conf) ··· 394 403 ieee80211_aes_key_free(key->u.ccmp.tfm); 395 404 if (key->conf.cipher == WLAN_CIPHER_SUITE_AES_CMAC) 396 405 ieee80211_aes_cmac_key_free(key->u.aes_cmac.tfm); 397 - if (key->local) { 406 + if (key->local) 398 407 ieee80211_debugfs_key_remove(key); 399 - key->local->crypto_tx_tailroom_needed_cnt--; 400 - } 401 408 402 409 kfree(key); 403 410 } ··· 457 468 458 469 ieee80211_debugfs_key_add(key); 459 470 460 - key->local->crypto_tx_tailroom_needed_cnt++; 461 - 462 471 ret = ieee80211_key_enable_hw_accel(key); 463 472 464 473 mutex_unlock(&sdata->local->key_mtx); ··· 498 511 499 512 mutex_lock(&sdata->local->key_mtx); 500 513 501 - sdata->local->crypto_tx_tailroom_needed_cnt = 0; 502 - 503 - list_for_each_entry(key, &sdata->key_list, list) { 504 - sdata->local->crypto_tx_tailroom_needed_cnt++; 514 + list_for_each_entry(key, &sdata->key_list, list) 505 515 ieee80211_key_enable_hw_accel(key); 506 - } 507 516 508 517 mutex_unlock(&sdata->local->key_mtx); 509 518 }
-6
net/mac80211/mlme.c
··· 232 232 WARN_ON(!ieee80211_set_channel_type(local, sdata, channel_type)); 233 233 } 234 234 235 - ieee80211_stop_queues_by_reason(&sdata->local->hw, 236 - IEEE80211_QUEUE_STOP_REASON_CSA); 237 - 238 235 /* channel_type change automatically detected */ 239 236 ieee80211_hw_config(local, 0); 240 237 ··· 244 247 channel_type); 245 248 rcu_read_unlock(); 246 249 } 247 - 248 - ieee80211_wake_queues_by_reason(&sdata->local->hw, 249 - IEEE80211_QUEUE_STOP_REASON_CSA); 250 250 251 251 ht_opmode = le16_to_cpu(hti->operation_mode); 252 252
+6 -1
net/mac80211/tx.c
··· 1480 1480 { 1481 1481 int tail_need = 0; 1482 1482 1483 - if (may_encrypt && local->crypto_tx_tailroom_needed_cnt) { 1483 + /* 1484 + * This could be optimised, devices that do full hardware 1485 + * crypto (including TKIP MMIC) need no tailroom... But we 1486 + * have no drivers for such devices currently. 1487 + */ 1488 + if (may_encrypt) { 1484 1489 tail_need = IEEE80211_ENCRYPT_TAILROOM; 1485 1490 tail_need -= skb_tailroom(skb); 1486 1491 tail_need = max_t(int, tail_need, 0);
+1 -1
net/netfilter/ipset/ip_set_core.c
··· 767 767 if (!attr[IPSET_ATTR_SETNAME]) { 768 768 for (i = 0; i < ip_set_max; i++) { 769 769 if (ip_set_list[i] != NULL && ip_set_list[i]->ref) { 770 - ret = IPSET_ERR_BUSY; 770 + ret = -IPSET_ERR_BUSY; 771 771 goto out; 772 772 } 773 773 }
+6 -4
net/netfilter/ipset/ip_set_hash_ipportnet.c
··· 146 146 { 147 147 const struct ip_set_hash *h = set->data; 148 148 ipset_adtfn adtfn = set->variant->adt[adt]; 149 - struct hash_ipportnet4_elem data = 150 - { .cidr = h->nets[0].cidr || HOST_MASK }; 149 + struct hash_ipportnet4_elem data = { 150 + .cidr = h->nets[0].cidr ? h->nets[0].cidr : HOST_MASK 151 + }; 151 152 152 153 if (data.cidr == 0) 153 154 return -EINVAL; ··· 395 394 { 396 395 const struct ip_set_hash *h = set->data; 397 396 ipset_adtfn adtfn = set->variant->adt[adt]; 398 - struct hash_ipportnet6_elem data = 399 - { .cidr = h->nets[0].cidr || HOST_MASK }; 397 + struct hash_ipportnet6_elem data = { 398 + .cidr = h->nets[0].cidr ? h->nets[0].cidr : HOST_MASK 399 + }; 400 400 401 401 if (data.cidr == 0) 402 402 return -EINVAL;
+6 -2
net/netfilter/ipset/ip_set_hash_net.c
··· 131 131 { 132 132 const struct ip_set_hash *h = set->data; 133 133 ipset_adtfn adtfn = set->variant->adt[adt]; 134 - struct hash_net4_elem data = { .cidr = h->nets[0].cidr || HOST_MASK }; 134 + struct hash_net4_elem data = { 135 + .cidr = h->nets[0].cidr ? h->nets[0].cidr : HOST_MASK 136 + }; 135 137 136 138 if (data.cidr == 0) 137 139 return -EINVAL; ··· 298 296 { 299 297 const struct ip_set_hash *h = set->data; 300 298 ipset_adtfn adtfn = set->variant->adt[adt]; 301 - struct hash_net6_elem data = { .cidr = h->nets[0].cidr || HOST_MASK }; 299 + struct hash_net6_elem data = { 300 + .cidr = h->nets[0].cidr ? h->nets[0].cidr : HOST_MASK 301 + }; 302 302 303 303 if (data.cidr == 0) 304 304 return -EINVAL;
+4 -2
net/netfilter/ipset/ip_set_hash_netport.c
··· 144 144 const struct ip_set_hash *h = set->data; 145 145 ipset_adtfn adtfn = set->variant->adt[adt]; 146 146 struct hash_netport4_elem data = { 147 - .cidr = h->nets[0].cidr || HOST_MASK }; 147 + .cidr = h->nets[0].cidr ? h->nets[0].cidr : HOST_MASK 148 + }; 148 149 149 150 if (data.cidr == 0) 150 151 return -EINVAL; ··· 358 357 const struct ip_set_hash *h = set->data; 359 358 ipset_adtfn adtfn = set->variant->adt[adt]; 360 359 struct hash_netport6_elem data = { 361 - .cidr = h->nets[0].cidr || HOST_MASK }; 360 + .cidr = h->nets[0].cidr ? h->nets[0].cidr : HOST_MASK 361 + }; 362 362 363 363 if (data.cidr == 0) 364 364 return -EINVAL;
+8 -8
net/netfilter/ipvs/ip_vs_core.c
··· 1772 1772 .owner = THIS_MODULE, 1773 1773 .pf = PF_INET, 1774 1774 .hooknum = NF_INET_LOCAL_IN, 1775 - .priority = 99, 1775 + .priority = NF_IP_PRI_NAT_SRC - 2, 1776 1776 }, 1777 1777 /* After packet filtering, forward packet through VS/DR, VS/TUN, 1778 1778 * or VS/NAT(change destination), so that filtering rules can be ··· 1782 1782 .owner = THIS_MODULE, 1783 1783 .pf = PF_INET, 1784 1784 .hooknum = NF_INET_LOCAL_IN, 1785 - .priority = 101, 1785 + .priority = NF_IP_PRI_NAT_SRC - 1, 1786 1786 }, 1787 1787 /* Before ip_vs_in, change source only for VS/NAT */ 1788 1788 { ··· 1790 1790 .owner = THIS_MODULE, 1791 1791 .pf = PF_INET, 1792 1792 .hooknum = NF_INET_LOCAL_OUT, 1793 - .priority = -99, 1793 + .priority = NF_IP_PRI_NAT_DST + 1, 1794 1794 }, 1795 1795 /* After mangle, schedule and forward local requests */ 1796 1796 { ··· 1798 1798 .owner = THIS_MODULE, 1799 1799 .pf = PF_INET, 1800 1800 .hooknum = NF_INET_LOCAL_OUT, 1801 - .priority = -98, 1801 + .priority = NF_IP_PRI_NAT_DST + 2, 1802 1802 }, 1803 1803 /* After packet filtering (but before ip_vs_out_icmp), catch icmp 1804 1804 * destined for 0.0.0.0/0, which is for incoming IPVS connections */ ··· 1824 1824 .owner = THIS_MODULE, 1825 1825 .pf = PF_INET6, 1826 1826 .hooknum = NF_INET_LOCAL_IN, 1827 - .priority = 99, 1827 + .priority = NF_IP6_PRI_NAT_SRC - 2, 1828 1828 }, 1829 1829 /* After packet filtering, forward packet through VS/DR, VS/TUN, 1830 1830 * or VS/NAT(change destination), so that filtering rules can be ··· 1834 1834 .owner = THIS_MODULE, 1835 1835 .pf = PF_INET6, 1836 1836 .hooknum = NF_INET_LOCAL_IN, 1837 - .priority = 101, 1837 + .priority = NF_IP6_PRI_NAT_SRC - 1, 1838 1838 }, 1839 1839 /* Before ip_vs_in, change source only for VS/NAT */ 1840 1840 { ··· 1842 1842 .owner = THIS_MODULE, 1843 1843 .pf = PF_INET, 1844 1844 .hooknum = NF_INET_LOCAL_OUT, 1845 - .priority = -99, 1845 + .priority = NF_IP6_PRI_NAT_DST + 1, 1846 1846 }, 1847 1847 /* After mangle, schedule and forward local requests */ 1848 1848 { ··· 1850 1850 .owner = THIS_MODULE, 1851 1851 .pf = PF_INET6, 1852 1852 .hooknum = NF_INET_LOCAL_OUT, 1853 - .priority = -98, 1853 + .priority = NF_IP6_PRI_NAT_DST + 2, 1854 1854 }, 1855 1855 /* After packet filtering (but before ip_vs_out_icmp), catch icmp 1856 1856 * destined for 0.0.0.0/0, which is for incoming IPVS connections */
+5 -2
net/netfilter/nf_conntrack_core.c
··· 850 850 851 851 /* It exists; we have (non-exclusive) reference. */ 852 852 if (NF_CT_DIRECTION(h) == IP_CT_DIR_REPLY) { 853 - *ctinfo = IP_CT_ESTABLISHED + IP_CT_IS_REPLY; 853 + *ctinfo = IP_CT_ESTABLISHED_REPLY; 854 854 /* Please set reply bit if this packet OK */ 855 855 *set_reply = 1; 856 856 } else { ··· 922 922 ret = -ret; 923 923 goto out; 924 924 } 925 + /* ICMP[v6] protocol trackers may assign one conntrack. */ 926 + if (skb->nfct) 927 + goto out; 925 928 } 926 929 927 930 ct = resolve_normal_ct(net, tmpl, skb, dataoff, pf, protonum, ··· 1146 1143 /* This ICMP is in reverse direction to the packet which caused it */ 1147 1144 ct = nf_ct_get(skb, &ctinfo); 1148 1145 if (CTINFO2DIR(ctinfo) == IP_CT_DIR_ORIGINAL) 1149 - ctinfo = IP_CT_RELATED + IP_CT_IS_REPLY; 1146 + ctinfo = IP_CT_RELATED_REPLY; 1150 1147 else 1151 1148 ctinfo = IP_CT_RELATED; 1152 1149
+1 -1
net/netfilter/nf_conntrack_ftp.c
··· 368 368 369 369 /* Until there's been traffic both ways, don't look in packets. */ 370 370 if (ctinfo != IP_CT_ESTABLISHED && 371 - ctinfo != IP_CT_ESTABLISHED + IP_CT_IS_REPLY) { 371 + ctinfo != IP_CT_ESTABLISHED_REPLY) { 372 372 pr_debug("ftp: Conntrackinfo = %u\n", ctinfo); 373 373 return NF_ACCEPT; 374 374 }
+4 -6
net/netfilter/nf_conntrack_h323_main.c
··· 571 571 int ret; 572 572 573 573 /* Until there's been traffic both ways, don't look in packets. */ 574 - if (ctinfo != IP_CT_ESTABLISHED && 575 - ctinfo != IP_CT_ESTABLISHED + IP_CT_IS_REPLY) { 574 + if (ctinfo != IP_CT_ESTABLISHED && ctinfo != IP_CT_ESTABLISHED_REPLY) 576 575 return NF_ACCEPT; 577 - } 576 + 578 577 pr_debug("nf_ct_h245: skblen = %u\n", skb->len); 579 578 580 579 spin_lock_bh(&nf_h323_lock); ··· 1124 1125 int ret; 1125 1126 1126 1127 /* Until there's been traffic both ways, don't look in packets. */ 1127 - if (ctinfo != IP_CT_ESTABLISHED && 1128 - ctinfo != IP_CT_ESTABLISHED + IP_CT_IS_REPLY) { 1128 + if (ctinfo != IP_CT_ESTABLISHED && ctinfo != IP_CT_ESTABLISHED_REPLY) 1129 1129 return NF_ACCEPT; 1130 - } 1130 + 1131 1131 pr_debug("nf_ct_q931: skblen = %u\n", skb->len); 1132 1132 1133 1133 spin_lock_bh(&nf_h323_lock);
+1 -2
net/netfilter/nf_conntrack_irc.c
··· 125 125 return NF_ACCEPT; 126 126 127 127 /* Until there's been traffic both ways, don't look in packets. */ 128 - if (ctinfo != IP_CT_ESTABLISHED && 129 - ctinfo != IP_CT_ESTABLISHED + IP_CT_IS_REPLY) 128 + if (ctinfo != IP_CT_ESTABLISHED && ctinfo != IP_CT_ESTABLISHED_REPLY) 130 129 return NF_ACCEPT; 131 130 132 131 /* Not a full tcp header? */
+1 -2
net/netfilter/nf_conntrack_pptp.c
··· 519 519 u_int16_t msg; 520 520 521 521 /* don't do any tracking before tcp handshake complete */ 522 - if (ctinfo != IP_CT_ESTABLISHED && 523 - ctinfo != IP_CT_ESTABLISHED + IP_CT_IS_REPLY) 522 + if (ctinfo != IP_CT_ESTABLISHED && ctinfo != IP_CT_ESTABLISHED_REPLY) 524 523 return NF_ACCEPT; 525 524 526 525 nexthdr_off = protoff;
+1 -1
net/netfilter/nf_conntrack_sane.c
··· 78 78 ct_sane_info = &nfct_help(ct)->help.ct_sane_info; 79 79 /* Until there's been traffic both ways, don't look in packets. */ 80 80 if (ctinfo != IP_CT_ESTABLISHED && 81 - ctinfo != IP_CT_ESTABLISHED+IP_CT_IS_REPLY) 81 + ctinfo != IP_CT_ESTABLISHED_REPLY) 82 82 return NF_ACCEPT; 83 83 84 84 /* Not a full tcp header? */
+1 -1
net/netfilter/nf_conntrack_sip.c
··· 1423 1423 typeof(nf_nat_sip_seq_adjust_hook) nf_nat_sip_seq_adjust; 1424 1424 1425 1425 if (ctinfo != IP_CT_ESTABLISHED && 1426 - ctinfo != IP_CT_ESTABLISHED + IP_CT_IS_REPLY) 1426 + ctinfo != IP_CT_ESTABLISHED_REPLY) 1427 1427 return NF_ACCEPT; 1428 1428 1429 1429 /* No Data ? */
+2 -2
net/netfilter/xt_socket.c
··· 143 143 ct = nf_ct_get(skb, &ctinfo); 144 144 if (ct && !nf_ct_is_untracked(ct) && 145 145 ((iph->protocol != IPPROTO_ICMP && 146 - ctinfo == IP_CT_IS_REPLY + IP_CT_ESTABLISHED) || 146 + ctinfo == IP_CT_ESTABLISHED_REPLY) || 147 147 (iph->protocol == IPPROTO_ICMP && 148 - ctinfo == IP_CT_IS_REPLY + IP_CT_RELATED)) && 148 + ctinfo == IP_CT_RELATED_REPLY)) && 149 149 (ct->status & IPS_SRC_NAT_DONE)) { 150 150 151 151 daddr = ct->tuplehash[IP_CT_DIR_ORIGINAL].tuple.src.u3.ip;
+2
net/packet/af_packet.c
··· 804 804 } else { 805 805 h.h2->tp_vlan_tci = 0; 806 806 } 807 + h.h2->tp_padding = 0; 807 808 hdrlen = sizeof(*h.h2); 808 809 break; 809 810 default: ··· 1737 1736 } else { 1738 1737 aux.tp_vlan_tci = 0; 1739 1738 } 1739 + aux.tp_padding = 0; 1740 1740 put_cmsg(msg, SOL_PACKET, PACKET_AUXDATA, sizeof(aux), &aux); 1741 1741 } 1742 1742
+1 -2
net/sched/sch_generic.c
··· 251 251 } 252 252 253 253 if (some_queue_timedout) { 254 - char drivername[64]; 255 254 WARN_ONCE(1, KERN_INFO "NETDEV WATCHDOG: %s (%s): transmit queue %u timed out\n", 256 - dev->name, netdev_drivername(dev, drivername, 64), i); 255 + dev->name, netdev_drivername(dev), i); 257 256 dev->netdev_ops->ndo_tx_timeout(dev); 258 257 } 259 258 if (!mod_timer(&dev->watchdog_timer,
+4 -5
net/wireless/nl80211.c
··· 3406 3406 i = 0; 3407 3407 if (info->attrs[NL80211_ATTR_SCAN_SSIDS]) { 3408 3408 nla_for_each_nested(attr, info->attrs[NL80211_ATTR_SCAN_SSIDS], tmp) { 3409 - request->ssids[i].ssid_len = nla_len(attr); 3410 - if (request->ssids[i].ssid_len > IEEE80211_MAX_SSID_LEN) { 3409 + if (nla_len(attr) > IEEE80211_MAX_SSID_LEN) { 3411 3410 err = -EINVAL; 3412 3411 goto out_free; 3413 3412 } 3413 + request->ssids[i].ssid_len = nla_len(attr); 3414 3414 memcpy(request->ssids[i].ssid, nla_data(attr), nla_len(attr)); 3415 3415 i++; 3416 3416 } ··· 3572 3572 if (info->attrs[NL80211_ATTR_SCAN_SSIDS]) { 3573 3573 nla_for_each_nested(attr, info->attrs[NL80211_ATTR_SCAN_SSIDS], 3574 3574 tmp) { 3575 - request->ssids[i].ssid_len = nla_len(attr); 3576 - if (request->ssids[i].ssid_len > 3577 - IEEE80211_MAX_SSID_LEN) { 3575 + if (nla_len(attr) > IEEE80211_MAX_SSID_LEN) { 3578 3576 err = -EINVAL; 3579 3577 goto out_free; 3580 3578 } 3579 + request->ssids[i].ssid_len = nla_len(attr); 3581 3580 memcpy(request->ssids[i].ssid, nla_data(attr), 3582 3581 nla_len(attr)); 3583 3582 i++;
+2 -2
net/xfrm/xfrm_replay.c
··· 265 265 bitnr = bitnr & 0x1F; 266 266 replay_esn->bmp[nr] |= (1U << bitnr); 267 267 } else { 268 - nr = replay_esn->replay_window >> 5; 268 + nr = (replay_esn->replay_window - 1) >> 5; 269 269 for (i = 0; i <= nr; i++) 270 270 replay_esn->bmp[i] = 0; 271 271 ··· 471 471 bitnr = bitnr & 0x1F; 472 472 replay_esn->bmp[nr] |= (1U << bitnr); 473 473 } else { 474 - nr = replay_esn->replay_window >> 5; 474 + nr = (replay_esn->replay_window - 1) >> 5; 475 475 for (i = 0; i <= nr; i++) 476 476 replay_esn->bmp[i] = 0; 477 477