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

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

Pull networking changes from David S. Miller:

1) Fix IPSEC header length calculation for transport mode in ESP. The
issue is whether to do the calculation before or after alignment.
Fix from Benjamin Poirier.

2) Fix regression in IPV6 IPSEC fragment length calculations, from Gao
Feng. This is another transport vs tunnel mode issue.

3) Handle AF_UNSPEC connect()s properly in L2TP to avoid OOPSes. Fix
from James Chapman.

4) Fix USB ASIX driver's reception of full sized VLAN packets, from
Eric Dumazet.

5) Allow drop monitor (and, more generically, all generic netlink
protocols) to be automatically loaded as a module. From Neil
Horman.

Fix up trivial conflict in Documentation/feature-removal-schedule.txt
due to new entries added next to each other at the end. As usual.

* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net: (38 commits)
net/smsc911x: Repair broken failure paths
virtio-net: remove useless disable on freeze
netdevice: Update netif_dbg for CONFIG_DYNAMIC_DEBUG
drop_monitor: Add module alias to enable automatic module loading
genetlink: Build a generic netlink family module alias
net: add MODULE_ALIAS_NET_PF_PROTO_NAME
r6040: Do a Proper deinit at errorpath and also when driver unloads (calling r6040_remove_one)
r6040: disable pci device if the subsequent calls (after pci_enable_device) fails
skb: avoid unnecessary reallocations in __skb_cow
net: sh_eth: fix the rxdesc pointer when rx descriptor empty happens
asix: allow full size 8021Q frames to be received
rds_rdma: don't assume infiniband device is PCI
l2tp: fix oops in L2TP IP sockets for connect() AF_UNSPEC case
mac80211: fix ADDBA declined after suspend with wowlan
wlcore: fix undefined symbols when CONFIG_PM is not defined
mac80211: fix flag check for QoS NOACK frames
ath9k_hw: apply internal regulator settings on AR933x
ath9k_hw: update AR933x initvals to fix issues with high power devices
ath9k: fix a use-after-free-bug when ath_tx_setup_buffer() fails
ath9k: stop rx dma before stopping tx
...

+343 -645
+6
Documentation/feature-removal-schedule.txt
··· 606 606 Who: Ludovic Desroches <ludovic.desroches@atmel.com> 607 607 608 608 ---------------------------- 609 + 610 + What: net/wanrouter/ 611 + When: June 2013 612 + Why: Unsupported/unmaintained/unused since 2.6 613 + 614 + ----------------------------
+1 -1
MAINTAINERS
··· 6657 6657 F: kernel/taskstats.c 6658 6658 6659 6659 TC CLASSIFIER 6660 - M: Jamal Hadi Salim <hadi@cyberus.ca> 6660 + M: Jamal Hadi Salim <jhs@mojatatu.com> 6661 6661 L: netdev@vger.kernel.org 6662 6662 S: Maintained 6663 6663 F: include/linux/pkt_cls.h
+3 -1
drivers/atm/solos-pci.c
··· 984 984 } else if (skb && card->using_dma) { 985 985 SKB_CB(skb)->dma_addr = pci_map_single(card->dev, skb->data, 986 986 skb->len, PCI_DMA_TODEVICE); 987 + card->tx_skb[port] = skb; 987 988 iowrite32(SKB_CB(skb)->dma_addr, 988 989 card->config_regs + TX_DMA_ADDR(port)); 989 990 } ··· 1153 1152 db_fpga_upgrade = db_firmware_upgrade = 0; 1154 1153 } 1155 1154 1156 - if (card->fpga_version >= DMA_SUPPORTED){ 1155 + if (card->fpga_version >= DMA_SUPPORTED) { 1156 + pci_set_master(dev); 1157 1157 card->using_dma = 1; 1158 1158 } else { 1159 1159 card->using_dma = 0;
+11 -4
drivers/net/ethernet/rdc/r6040.c
··· 1096 1096 if (err) { 1097 1097 dev_err(&pdev->dev, "32-bit PCI DMA addresses" 1098 1098 "not supported by the card\n"); 1099 - goto err_out; 1099 + goto err_out_disable_dev; 1100 1100 } 1101 1101 err = pci_set_consistent_dma_mask(pdev, DMA_BIT_MASK(32)); 1102 1102 if (err) { 1103 1103 dev_err(&pdev->dev, "32-bit PCI DMA addresses" 1104 1104 "not supported by the card\n"); 1105 - goto err_out; 1105 + goto err_out_disable_dev; 1106 1106 } 1107 1107 1108 1108 /* IO Size check */ 1109 1109 if (pci_resource_len(pdev, bar) < io_size) { 1110 1110 dev_err(&pdev->dev, "Insufficient PCI resources, aborting\n"); 1111 1111 err = -EIO; 1112 - goto err_out; 1112 + goto err_out_disable_dev; 1113 1113 } 1114 1114 1115 1115 pci_set_master(pdev); ··· 1117 1117 dev = alloc_etherdev(sizeof(struct r6040_private)); 1118 1118 if (!dev) { 1119 1119 err = -ENOMEM; 1120 - goto err_out; 1120 + goto err_out_disable_dev; 1121 1121 } 1122 1122 SET_NETDEV_DEV(dev, &pdev->dev); 1123 1123 lp = netdev_priv(dev); ··· 1233 1233 err_out_mdio: 1234 1234 mdiobus_free(lp->mii_bus); 1235 1235 err_out_unmap: 1236 + netif_napi_del(&lp->napi); 1237 + pci_set_drvdata(pdev, NULL); 1236 1238 pci_iounmap(pdev, ioaddr); 1237 1239 err_out_free_res: 1238 1240 pci_release_regions(pdev); 1239 1241 err_out_free_dev: 1240 1242 free_netdev(dev); 1243 + err_out_disable_dev: 1244 + pci_disable_device(pdev); 1241 1245 err_out: 1242 1246 return err; 1243 1247 } ··· 1255 1251 mdiobus_unregister(lp->mii_bus); 1256 1252 kfree(lp->mii_bus->irq); 1257 1253 mdiobus_free(lp->mii_bus); 1254 + netif_napi_del(&lp->napi); 1255 + pci_set_drvdata(pdev, NULL); 1256 + pci_iounmap(pdev, lp->base); 1258 1257 pci_release_regions(pdev); 1259 1258 free_netdev(dev); 1260 1259 pci_disable_device(pdev);
+5 -3
drivers/net/ethernet/renesas/sh_eth.c
··· 1101 1101 1102 1102 /* Restart Rx engine if stopped. */ 1103 1103 /* If we don't need to check status, don't. -KDU */ 1104 - if (!(sh_eth_read(ndev, EDRRR) & EDRRR_R)) 1104 + if (!(sh_eth_read(ndev, EDRRR) & EDRRR_R)) { 1105 + /* fix the values for the next receiving */ 1106 + mdp->cur_rx = mdp->dirty_rx = (sh_eth_read(ndev, RDFAR) - 1107 + sh_eth_read(ndev, RDLAR)) >> 4; 1105 1108 sh_eth_write(ndev, EDRRR_R, EDRRR); 1109 + } 1106 1110 1107 1111 return 0; 1108 1112 } ··· 1203 1199 /* Receive Descriptor Empty int */ 1204 1200 ndev->stats.rx_over_errors++; 1205 1201 1206 - if (sh_eth_read(ndev, EDRRR) ^ EDRRR_R) 1207 - sh_eth_write(ndev, EDRRR_R, EDRRR); 1208 1202 if (netif_msg_rx_err(mdp)) 1209 1203 dev_err(&ndev->dev, "Receive Descriptor Empty\n"); 1210 1204 }
+4 -3
drivers/net/ethernet/smsc/smsc911x.c
··· 2390 2390 2391 2391 retval = smsc911x_request_resources(pdev); 2392 2392 if (retval) 2393 - goto out_return_resources; 2393 + goto out_request_resources_fail; 2394 2394 2395 2395 retval = smsc911x_enable_resources(pdev); 2396 2396 if (retval) 2397 - goto out_disable_resources; 2397 + goto out_enable_resources_fail; 2398 2398 2399 2399 if (pdata->ioaddr == NULL) { 2400 2400 SMSC_WARN(pdata, probe, "Error smsc911x base address invalid"); ··· 2501 2501 free_irq(dev->irq, dev); 2502 2502 out_disable_resources: 2503 2503 (void)smsc911x_disable_resources(pdev); 2504 - out_return_resources: 2504 + out_enable_resources_fail: 2505 2505 smsc911x_free_resources(pdev); 2506 + out_request_resources_fail: 2506 2507 platform_set_drvdata(pdev, NULL); 2507 2508 iounmap(pdata->ioaddr); 2508 2509 free_netdev(dev);
+2 -1
drivers/net/usb/asix.c
··· 35 35 #include <linux/crc32.h> 36 36 #include <linux/usb/usbnet.h> 37 37 #include <linux/slab.h> 38 + #include <linux/if_vlan.h> 38 39 39 40 #define DRIVER_VERSION "22-Dec-2011" 40 41 #define DRIVER_NAME "asix" ··· 322 321 return 0; 323 322 } 324 323 325 - if ((size > dev->net->mtu + ETH_HLEN) || 324 + if ((size > dev->net->mtu + ETH_HLEN + VLAN_HLEN) || 326 325 (size + offset > skb->len)) { 327 326 netdev_err(dev->net, "asix_rx_fixup() Bad RX Length %d\n", 328 327 size);
+2
drivers/net/usb/qmi_wwan.c
··· 547 547 {QMI_GOBI_DEVICE(0x16d8, 0x8002)}, /* CMDTech Gobi 2000 Modem device (VU922) */ 548 548 {QMI_GOBI_DEVICE(0x05c6, 0x9205)}, /* Gobi 2000 Modem device */ 549 549 {QMI_GOBI_DEVICE(0x1199, 0x9013)}, /* Sierra Wireless Gobi 3000 Modem device (MC8355) */ 550 + {QMI_GOBI_DEVICE(0x1199, 0x9015)}, /* Sierra Wireless Gobi 3000 Modem device */ 551 + {QMI_GOBI_DEVICE(0x1199, 0x9019)}, /* Sierra Wireless Gobi 3000 Modem device */ 550 552 { } /* END */ 551 553 }; 552 554 MODULE_DEVICE_TABLE(usb, products);
-5
drivers/net/virtio_net.c
··· 1231 1231 vi->config_enable = false; 1232 1232 mutex_unlock(&vi->config_lock); 1233 1233 1234 - virtqueue_disable_cb(vi->rvq); 1235 - virtqueue_disable_cb(vi->svq); 1236 - if (virtio_has_feature(vi->vdev, VIRTIO_NET_F_CTRL_VQ)) 1237 - virtqueue_disable_cb(vi->cvq); 1238 - 1239 1234 netif_device_detach(vi->dev); 1240 1235 cancel_delayed_work_sync(&vi->refill); 1241 1236
+19
drivers/net/wireless/ath/ath5k/base.c
··· 2415 2415 * Initialization routines * 2416 2416 \*************************/ 2417 2417 2418 + static const struct ieee80211_iface_limit if_limits[] = { 2419 + { .max = 2048, .types = BIT(NL80211_IFTYPE_STATION) }, 2420 + { .max = 4, .types = 2421 + #ifdef CONFIG_MAC80211_MESH 2422 + BIT(NL80211_IFTYPE_MESH_POINT) | 2423 + #endif 2424 + BIT(NL80211_IFTYPE_AP) }, 2425 + }; 2426 + 2427 + static const struct ieee80211_iface_combination if_comb = { 2428 + .limits = if_limits, 2429 + .n_limits = ARRAY_SIZE(if_limits), 2430 + .max_interfaces = 2048, 2431 + .num_different_channels = 1, 2432 + }; 2433 + 2418 2434 int __devinit 2419 2435 ath5k_init_ah(struct ath5k_hw *ah, const struct ath_bus_ops *bus_ops) 2420 2436 { ··· 2451 2435 BIT(NL80211_IFTYPE_STATION) | 2452 2436 BIT(NL80211_IFTYPE_ADHOC) | 2453 2437 BIT(NL80211_IFTYPE_MESH_POINT); 2438 + 2439 + hw->wiphy->iface_combinations = &if_comb; 2440 + hw->wiphy->n_iface_combinations = 1; 2454 2441 2455 2442 /* SW support for IBSS_RSN is provided by mac80211 */ 2456 2443 hw->wiphy->flags |= WIPHY_FLAG_IBSS_RSN;
+1 -1
drivers/net/wireless/ath/ath9k/ar9003_eeprom.c
··· 3809 3809 return true; 3810 3810 } 3811 3811 3812 - static void ar9003_hw_internal_regulator_apply(struct ath_hw *ah) 3812 + void ar9003_hw_internal_regulator_apply(struct ath_hw *ah) 3813 3813 { 3814 3814 int internal_regulator = 3815 3815 ath9k_hw_ar9300_get_eeprom(ah, EEP_INTERNAL_REGULATOR);
+3
drivers/net/wireless/ath/ath9k/ar9003_eeprom.h
··· 334 334 335 335 unsigned int ar9003_get_paprd_scale_factor(struct ath_hw *ah, 336 336 struct ath9k_channel *chan); 337 + 338 + void ar9003_hw_internal_regulator_apply(struct ath_hw *ah); 339 + 337 340 #endif
+90 -88
drivers/net/wireless/ath/ath9k/ar9330_1p1_initvals.h
··· 1 1 /* 2 - * Copyright (c) 2011 Atheros Communications Inc. 2 + * Copyright (c) 2010-2011 Atheros Communications Inc. 3 + * Copyright (c) 2011-2012 Qualcomm Atheros Inc. 3 4 * 4 5 * Permission to use, copy, modify, and/or distribute this software for any 5 6 * purpose with or without fee is hereby granted, provided that the above ··· 19 18 #define INITVALS_9330_1P1_H 20 19 21 20 static const u32 ar9331_1p1_baseband_postamble[][5] = { 22 - /* Addr 5G_HT20 5G_HT40 2G_HT40 2G_HT20 */ 21 + /* Addr 5G_HT20 5G_HT40 2G_HT40 2G_HT20 */ 23 22 {0x00009810, 0xd00a8005, 0xd00a8005, 0xd00a8005, 0xd00a8005}, 24 23 {0x00009820, 0x206a002e, 0x206a002e, 0x206a002e, 0x206a002e}, 25 24 {0x00009824, 0x5ac640d0, 0x5ac640d0, 0x5ac640d0, 0x5ac640d0}, ··· 28 27 {0x00009830, 0x0000059c, 0x0000059c, 0x0000059c, 0x0000059c}, 29 28 {0x00009c00, 0x00000044, 0x00000044, 0x00000044, 0x00000044}, 30 29 {0x00009e00, 0x0372161e, 0x0372161e, 0x037216a4, 0x037216a4}, 31 - {0x00009e04, 0x00182020, 0x00182020, 0x00182020, 0x00182020}, 30 + {0x00009e04, 0x00202020, 0x00202020, 0x00202020, 0x00202020}, 32 31 {0x00009e0c, 0x6c4000e2, 0x6d4000e2, 0x6d4000e2, 0x6c4000e2}, 33 32 {0x00009e10, 0x7ec80d2e, 0x7ec80d2e, 0x7ec80d2e, 0x7ec80d2e}, 34 - {0x00009e14, 0x31395d5e, 0x3139605e, 0x3139605e, 0x31395d5e}, 33 + {0x00009e14, 0x31365d5e, 0x3136605e, 0x3136605e, 0x31365d5e}, 35 34 {0x00009e18, 0x00000000, 0x00000000, 0x00000000, 0x00000000}, 36 35 {0x00009e1c, 0x0001cf9c, 0x0001cf9c, 0x00021f9c, 0x00021f9c}, 37 36 {0x00009e20, 0x000003b5, 0x000003b5, 0x000003ce, 0x000003ce}, ··· 56 55 {0x0000a288, 0x00000000, 0x00000000, 0x00000000, 0x00000000}, 57 56 {0x0000a28c, 0x00000000, 0x00000000, 0x00000000, 0x00000000}, 58 57 {0x0000a2c4, 0x00158d18, 0x00158d18, 0x00158d18, 0x00158d18}, 59 - {0x0000a2d0, 0x00071981, 0x00071981, 0x00071981, 0x00071981}, 58 + {0x0000a2d0, 0x00071982, 0x00071982, 0x00071982, 0x00071982}, 60 59 {0x0000a2d8, 0xf999a83a, 0xf999a83a, 0xf999a83a, 0xf999a83a}, 61 60 {0x0000a358, 0x00000000, 0x00000000, 0x00000000, 0x00000000}, 62 61 {0x0000ae04, 0x00802020, 0x00802020, 0x00802020, 0x00802020}, ··· 64 63 }; 65 64 66 65 static const u32 ar9331_modes_lowest_ob_db_tx_gain_1p1[][5] = { 67 - /* Addr 5G_HT20 5G_HT40 2G_HT40 2G_HT20 */ 66 + /* Addr 5G_HT20 5G_HT40 2G_HT40 2G_HT20 */ 68 67 {0x0000a2d8, 0x7999a83a, 0x7999a83a, 0x7999a83a, 0x7999a83a}, 69 68 {0x0000a2dc, 0xffff2a52, 0xffff2a52, 0xffff2a52, 0xffff2a52}, 70 69 {0x0000a2e0, 0xffffcc84, 0xffffcc84, 0xffffcc84, 0xffffcc84}, ··· 156 155 }; 157 156 158 157 static const u32 ar9331_modes_high_ob_db_tx_gain_1p1[][5] = { 159 - /* Addr 5G_HT20 5G_HT40 2G_HT40 2G_HT20 */ 158 + /* Addr 5G_HT20 5G_HT40 2G_HT40 2G_HT20 */ 160 159 {0x0000a2d8, 0x7999a83a, 0x7999a83a, 0x7999a83a, 0x7999a83a}, 161 160 {0x0000a2dc, 0xffaa9a52, 0xffaa9a52, 0xffaa9a52, 0xffaa9a52}, 162 161 {0x0000a2e0, 0xffb31c84, 0xffb31c84, 0xffb31c84, 0xffb31c84}, ··· 246 245 }; 247 246 248 247 static const u32 ar9331_modes_low_ob_db_tx_gain_1p1[][5] = { 249 - /* Addr 5G_HT20 5G_HT40 2G_HT40 2G_HT20 */ 248 + /* Addr 5G_HT20 5G_HT40 2G_HT40 2G_HT20 */ 250 249 {0x0000a2d8, 0x7999a83a, 0x7999a83a, 0x7999a83a, 0x7999a83a}, 251 250 {0x0000a2dc, 0xffff2a52, 0xffff2a52, 0xffff2a52, 0xffff2a52}, 252 251 {0x0000a2e0, 0xffffcc84, 0xffffcc84, 0xffffcc84, 0xffffcc84}, ··· 378 377 {0x000160b4, 0x92480040}, 379 378 {0x000160c0, 0x006db6db}, 380 379 {0x000160c4, 0x0186db60}, 381 - {0x000160c8, 0x6db6db6c}, 380 + {0x000160c8, 0x6db4db6c}, 382 381 {0x000160cc, 0x6de6c300}, 383 382 {0x000160d0, 0x14500820}, 384 383 {0x00016100, 0x04cb0001}, 385 384 {0x00016104, 0xfff80015}, 386 385 {0x00016108, 0x00080010}, 387 386 {0x0001610c, 0x00170000}, 388 - {0x00016140, 0x10804000}, 387 + {0x00016140, 0x10800000}, 389 388 {0x00016144, 0x01884080}, 390 389 {0x00016148, 0x000080c0}, 391 390 {0x00016280, 0x01000015}, ··· 418 417 }; 419 418 420 419 static const u32 ar9331_1p1_soc_postamble[][5] = { 421 - /* Addr 5G_HT20 5G_HT40 2G_HT40 2G_HT20 */ 420 + /* Addr 5G_HT20 5G_HT40 2G_HT40 2G_HT20 */ 422 421 {0x00007010, 0x00000022, 0x00000022, 0x00000022, 0x00000022}, 423 422 }; 424 423 ··· 692 691 }; 693 692 694 693 static const u32 ar9331_modes_high_power_tx_gain_1p1[][5] = { 695 - /* Addr 5G_HT20 5G_HT40 2G_HT40 2G_HT20 */ 694 + /* Addr 5G_HT20 5G_HT40 2G_HT40 2G_HT20 */ 696 695 {0x0000a2d8, 0x7999a83a, 0x7999a83a, 0x7999a83a, 0x7999a83a}, 697 696 {0x0000a2dc, 0xffff2a52, 0xffff2a52, 0xffff2a52, 0xffff2a52}, 698 697 {0x0000a2e0, 0xffffcc84, 0xffffcc84, 0xffffcc84, 0xffffcc84}, ··· 784 783 }; 785 784 786 785 static const u32 ar9331_1p1_mac_postamble[][5] = { 787 - /* Addr 5G_HT20 5G_HT40 2G_HT40 2G_HT20 */ 786 + /* Addr 5G_HT20 5G_HT40 2G_HT40 2G_HT20 */ 788 787 {0x00001030, 0x00000230, 0x00000460, 0x000002c0, 0x00000160}, 789 788 {0x00001070, 0x00000168, 0x000002d0, 0x00000318, 0x0000018c}, 790 789 {0x000010b0, 0x00000e60, 0x00001cc0, 0x00007c70, 0x00003e38}, ··· 974 973 975 974 static const u32 ar9331_common_rx_gain_1p1[][2] = { 976 975 /* Addr allmodes */ 977 - {0x0000a000, 0x00010000}, 978 - {0x0000a004, 0x00030002}, 979 - {0x0000a008, 0x00050004}, 980 - {0x0000a00c, 0x00810080}, 981 - {0x0000a010, 0x00830082}, 982 - {0x0000a014, 0x01810180}, 983 - {0x0000a018, 0x01830182}, 984 - {0x0000a01c, 0x01850184}, 985 - {0x0000a020, 0x01890188}, 986 - {0x0000a024, 0x018b018a}, 987 - {0x0000a028, 0x018d018c}, 988 - {0x0000a02c, 0x01910190}, 989 - {0x0000a030, 0x01930192}, 990 - {0x0000a034, 0x01950194}, 991 - {0x0000a038, 0x038a0196}, 992 - {0x0000a03c, 0x038c038b}, 993 - {0x0000a040, 0x0390038d}, 994 - {0x0000a044, 0x03920391}, 995 - {0x0000a048, 0x03940393}, 996 - {0x0000a04c, 0x03960395}, 976 + {0x00009e18, 0x05000000}, 977 + {0x0000a000, 0x00060005}, 978 + {0x0000a004, 0x00810080}, 979 + {0x0000a008, 0x00830082}, 980 + {0x0000a00c, 0x00850084}, 981 + {0x0000a010, 0x01820181}, 982 + {0x0000a014, 0x01840183}, 983 + {0x0000a018, 0x01880185}, 984 + {0x0000a01c, 0x018a0189}, 985 + {0x0000a020, 0x02850284}, 986 + {0x0000a024, 0x02890288}, 987 + {0x0000a028, 0x028b028a}, 988 + {0x0000a02c, 0x03850384}, 989 + {0x0000a030, 0x03890388}, 990 + {0x0000a034, 0x038b038a}, 991 + {0x0000a038, 0x038d038c}, 992 + {0x0000a03c, 0x03910390}, 993 + {0x0000a040, 0x03930392}, 994 + {0x0000a044, 0x03950394}, 995 + {0x0000a048, 0x00000396}, 996 + {0x0000a04c, 0x00000000}, 997 997 {0x0000a050, 0x00000000}, 998 998 {0x0000a054, 0x00000000}, 999 999 {0x0000a058, 0x00000000}, ··· 1007 1005 {0x0000a074, 0x00000000}, 1008 1006 {0x0000a078, 0x00000000}, 1009 1007 {0x0000a07c, 0x00000000}, 1010 - {0x0000a080, 0x22222229}, 1011 - {0x0000a084, 0x1d1d1d1d}, 1012 - {0x0000a088, 0x1d1d1d1d}, 1013 - {0x0000a08c, 0x1d1d1d1d}, 1014 - {0x0000a090, 0x171d1d1d}, 1015 - {0x0000a094, 0x11111717}, 1016 - {0x0000a098, 0x00030311}, 1017 - {0x0000a09c, 0x00000000}, 1018 - {0x0000a0a0, 0x00000000}, 1008 + {0x0000a080, 0x28282828}, 1009 + {0x0000a084, 0x28282828}, 1010 + {0x0000a088, 0x28282828}, 1011 + {0x0000a08c, 0x28282828}, 1012 + {0x0000a090, 0x28282828}, 1013 + {0x0000a094, 0x24242428}, 1014 + {0x0000a098, 0x171e1e1e}, 1015 + {0x0000a09c, 0x02020b0b}, 1016 + {0x0000a0a0, 0x02020202}, 1019 1017 {0x0000a0a4, 0x00000000}, 1020 1018 {0x0000a0a8, 0x00000000}, 1021 1019 {0x0000a0ac, 0x00000000}, ··· 1023 1021 {0x0000a0b4, 0x00000000}, 1024 1022 {0x0000a0b8, 0x00000000}, 1025 1023 {0x0000a0bc, 0x00000000}, 1026 - {0x0000a0c0, 0x001f0000}, 1027 - {0x0000a0c4, 0x01000101}, 1028 - {0x0000a0c8, 0x011e011f}, 1029 - {0x0000a0cc, 0x011c011d}, 1030 - {0x0000a0d0, 0x02030204}, 1031 - {0x0000a0d4, 0x02010202}, 1032 - {0x0000a0d8, 0x021f0200}, 1033 - {0x0000a0dc, 0x0302021e}, 1034 - {0x0000a0e0, 0x03000301}, 1035 - {0x0000a0e4, 0x031e031f}, 1036 - {0x0000a0e8, 0x0402031d}, 1037 - {0x0000a0ec, 0x04000401}, 1038 - {0x0000a0f0, 0x041e041f}, 1039 - {0x0000a0f4, 0x0502041d}, 1040 - {0x0000a0f8, 0x05000501}, 1041 - {0x0000a0fc, 0x051e051f}, 1042 - {0x0000a100, 0x06010602}, 1043 - {0x0000a104, 0x061f0600}, 1044 - {0x0000a108, 0x061d061e}, 1045 - {0x0000a10c, 0x07020703}, 1046 - {0x0000a110, 0x07000701}, 1024 + {0x0000a0c0, 0x22072208}, 1025 + {0x0000a0c4, 0x22052206}, 1026 + {0x0000a0c8, 0x22032204}, 1027 + {0x0000a0cc, 0x22012202}, 1028 + {0x0000a0d0, 0x221f2200}, 1029 + {0x0000a0d4, 0x221d221e}, 1030 + {0x0000a0d8, 0x33023303}, 1031 + {0x0000a0dc, 0x33003301}, 1032 + {0x0000a0e0, 0x331e331f}, 1033 + {0x0000a0e4, 0x4402331d}, 1034 + {0x0000a0e8, 0x44004401}, 1035 + {0x0000a0ec, 0x441e441f}, 1036 + {0x0000a0f0, 0x55025503}, 1037 + {0x0000a0f4, 0x55005501}, 1038 + {0x0000a0f8, 0x551e551f}, 1039 + {0x0000a0fc, 0x6602551d}, 1040 + {0x0000a100, 0x66006601}, 1041 + {0x0000a104, 0x661e661f}, 1042 + {0x0000a108, 0x7703661d}, 1043 + {0x0000a10c, 0x77017702}, 1044 + {0x0000a110, 0x00007700}, 1047 1045 {0x0000a114, 0x00000000}, 1048 1046 {0x0000a118, 0x00000000}, 1049 1047 {0x0000a11c, 0x00000000}, ··· 1056 1054 {0x0000a138, 0x00000000}, 1057 1055 {0x0000a13c, 0x00000000}, 1058 1056 {0x0000a140, 0x001f0000}, 1059 - {0x0000a144, 0x01000101}, 1060 - {0x0000a148, 0x011e011f}, 1061 - {0x0000a14c, 0x011c011d}, 1062 - {0x0000a150, 0x02030204}, 1063 - {0x0000a154, 0x02010202}, 1064 - {0x0000a158, 0x021f0200}, 1065 - {0x0000a15c, 0x0302021e}, 1066 - {0x0000a160, 0x03000301}, 1067 - {0x0000a164, 0x031e031f}, 1068 - {0x0000a168, 0x0402031d}, 1069 - {0x0000a16c, 0x04000401}, 1070 - {0x0000a170, 0x041e041f}, 1071 - {0x0000a174, 0x0502041d}, 1072 - {0x0000a178, 0x05000501}, 1073 - {0x0000a17c, 0x051e051f}, 1074 - {0x0000a180, 0x06010602}, 1075 - {0x0000a184, 0x061f0600}, 1076 - {0x0000a188, 0x061d061e}, 1077 - {0x0000a18c, 0x07020703}, 1078 - {0x0000a190, 0x07000701}, 1057 + {0x0000a144, 0x111f1100}, 1058 + {0x0000a148, 0x111d111e}, 1059 + {0x0000a14c, 0x111b111c}, 1060 + {0x0000a150, 0x22032204}, 1061 + {0x0000a154, 0x22012202}, 1062 + {0x0000a158, 0x221f2200}, 1063 + {0x0000a15c, 0x221d221e}, 1064 + {0x0000a160, 0x33013302}, 1065 + {0x0000a164, 0x331f3300}, 1066 + {0x0000a168, 0x4402331e}, 1067 + {0x0000a16c, 0x44004401}, 1068 + {0x0000a170, 0x441e441f}, 1069 + {0x0000a174, 0x55015502}, 1070 + {0x0000a178, 0x551f5500}, 1071 + {0x0000a17c, 0x6602551e}, 1072 + {0x0000a180, 0x66006601}, 1073 + {0x0000a184, 0x661e661f}, 1074 + {0x0000a188, 0x7703661d}, 1075 + {0x0000a18c, 0x77017702}, 1076 + {0x0000a190, 0x00007700}, 1079 1077 {0x0000a194, 0x00000000}, 1080 1078 {0x0000a198, 0x00000000}, 1081 1079 {0x0000a19c, 0x00000000}, ··· 1102 1100 {0x0000a1f0, 0x00000396}, 1103 1101 {0x0000a1f4, 0x00000396}, 1104 1102 {0x0000a1f8, 0x00000396}, 1105 - {0x0000a1fc, 0x00000196}, 1103 + {0x0000a1fc, 0x00000296}, 1106 1104 }; 1107 1105 1108 1106 static const u32 ar9331_common_tx_gain_offset1_1[][1] = { 1109 - {0}, 1110 - {3}, 1111 - {0}, 1112 - {0}, 1107 + {0x00000000}, 1108 + {0x00000003}, 1109 + {0x00000000}, 1110 + {0x00000000}, 1113 1111 }; 1114 1112 1115 1113 static const u32 ar9331_1p1_chansel_xtal_25M[] = {
+3
drivers/net/wireless/ath/ath9k/hw.c
··· 1468 1468 return false; 1469 1469 1470 1470 ah->chip_fullsleep = false; 1471 + 1472 + if (AR_SREV_9330(ah)) 1473 + ar9003_hw_internal_regulator_apply(ah); 1471 1474 ath9k_hw_init_pll(ah, chan); 1472 1475 ath9k_hw_set_rfmode(ah, chan); 1473 1476
+4 -3
drivers/net/wireless/ath/ath9k/main.c
··· 239 239 { 240 240 struct ath_hw *ah = sc->sc_ah; 241 241 struct ath_common *common = ath9k_hw_common(ah); 242 - bool ret; 242 + bool ret = true; 243 243 244 244 ieee80211_stop_queues(sc->hw); 245 245 ··· 250 250 ath9k_debug_samp_bb_mac(sc); 251 251 ath9k_hw_disable_interrupts(ah); 252 252 253 - ret = ath_drain_all_txq(sc, retry_tx); 254 - 255 253 if (!ath_stoprecv(sc)) 254 + ret = false; 255 + 256 + if (!ath_drain_all_txq(sc, retry_tx)) 256 257 ret = false; 257 258 258 259 if (!flush) {
+10 -6
drivers/net/wireless/ath/ath9k/xmit.c
··· 64 64 static struct ath_buf *ath_tx_setup_buffer(struct ath_softc *sc, 65 65 struct ath_txq *txq, 66 66 struct ath_atx_tid *tid, 67 - struct sk_buff *skb); 67 + struct sk_buff *skb, 68 + bool dequeue); 68 69 69 70 enum { 70 71 MCS_HT20, ··· 812 811 fi = get_frame_info(skb); 813 812 bf = fi->bf; 814 813 if (!fi->bf) 815 - bf = ath_tx_setup_buffer(sc, txq, tid, skb); 814 + bf = ath_tx_setup_buffer(sc, txq, tid, skb, true); 816 815 817 816 if (!bf) 818 817 continue; ··· 1727 1726 return; 1728 1727 } 1729 1728 1730 - bf = ath_tx_setup_buffer(sc, txctl->txq, tid, skb); 1729 + bf = ath_tx_setup_buffer(sc, txctl->txq, tid, skb, false); 1731 1730 if (!bf) 1732 1731 return; 1733 1732 ··· 1754 1753 1755 1754 bf = fi->bf; 1756 1755 if (!bf) 1757 - bf = ath_tx_setup_buffer(sc, txq, tid, skb); 1756 + bf = ath_tx_setup_buffer(sc, txq, tid, skb, false); 1758 1757 1759 1758 if (!bf) 1760 1759 return; ··· 1815 1814 static struct ath_buf *ath_tx_setup_buffer(struct ath_softc *sc, 1816 1815 struct ath_txq *txq, 1817 1816 struct ath_atx_tid *tid, 1818 - struct sk_buff *skb) 1817 + struct sk_buff *skb, 1818 + bool dequeue) 1819 1819 { 1820 1820 struct ath_common *common = ath9k_hw_common(sc->sc_ah); 1821 1821 struct ath_frame_info *fi = get_frame_info(skb); ··· 1865 1863 return bf; 1866 1864 1867 1865 error: 1866 + if (dequeue) 1867 + __skb_unlink(skb, &tid->buf_q); 1868 1868 dev_kfree_skb_any(skb); 1869 1869 return NULL; 1870 1870 } ··· 1897 1893 */ 1898 1894 ath_tx_send_ampdu(sc, tid, skb, txctl); 1899 1895 } else { 1900 - bf = ath_tx_setup_buffer(sc, txctl->txq, tid, skb); 1896 + bf = ath_tx_setup_buffer(sc, txctl->txq, tid, skb, false); 1901 1897 if (!bf) 1902 1898 return; 1903 1899
+3 -2
drivers/net/wireless/brcm80211/brcmfmac/usb.c
··· 28 28 #include <linux/uaccess.h> 29 29 #include <linux/firmware.h> 30 30 #include <linux/usb.h> 31 + #include <linux/vmalloc.h> 31 32 #include <net/cfg80211.h> 32 33 33 34 #include <defs.h> ··· 1240 1239 return -EINVAL; 1241 1240 } 1242 1241 1243 - devinfo->image = kmalloc(fw->size, GFP_ATOMIC); /* plus nvram */ 1242 + devinfo->image = vmalloc(fw->size); /* plus nvram */ 1244 1243 if (!devinfo->image) 1245 1244 return -ENOMEM; 1246 1245 ··· 1604 1603 void brcmf_usb_exit(void) 1605 1604 { 1606 1605 usb_deregister(&brcmf_usbdrvr); 1607 - kfree(g_image.data); 1606 + vfree(g_image.data); 1608 1607 g_image.data = NULL; 1609 1608 g_image.len = 0; 1610 1609 }
-8
drivers/net/wireless/iwlwifi/Kconfig
··· 137 137 even if the microcode doesn't advertise it. 138 138 139 139 Say Y only if you want to experiment with MFP. 140 - 141 - config IWLWIFI_UCODE16 142 - bool "support uCode 16.0" 143 - depends on IWLWIFI 144 - help 145 - This option enables support for uCode version 16.0. 146 - 147 - Say Y if you want to use 16.0 microcode.
-1
drivers/net/wireless/iwlwifi/Makefile
··· 18 18 iwlwifi-objs += iwl-trans-pcie.o iwl-trans-pcie-rx.o iwl-trans-pcie-tx.o 19 19 20 20 21 - iwlwifi-$(CONFIG_IWLWIFI_UCODE16) += iwl-phy-db.o 22 21 iwlwifi-$(CONFIG_IWLWIFI_DEBUGFS) += iwl-debugfs.o 23 22 iwlwifi-$(CONFIG_IWLWIFI_DEVICE_TRACING) += iwl-devtrace.o 24 23 iwlwifi-$(CONFIG_IWLWIFI_DEVICE_TESTMODE) += iwl-testmode.o
+2 -2
drivers/net/wireless/iwlwifi/iwl-2000.c
··· 79 79 .chain_noise_scale = 1000, 80 80 .wd_timeout = IWL_DEF_WD_TIMEOUT, 81 81 .max_event_log_size = 512, 82 - .shadow_reg_enable = true, 82 + .shadow_reg_enable = false, /* TODO: fix bugs using this feature */ 83 83 .hd_v2 = true, 84 84 }; 85 85 ··· 97 97 .chain_noise_scale = 1000, 98 98 .wd_timeout = IWL_LONG_WD_TIMEOUT, 99 99 .max_event_log_size = 512, 100 - .shadow_reg_enable = true, 100 + .shadow_reg_enable = false, /* TODO: fix bugs using this feature */ 101 101 .hd_v2 = true, 102 102 }; 103 103
+3 -3
drivers/net/wireless/iwlwifi/iwl-6000.c
··· 86 86 .chain_noise_scale = 1000, 87 87 .wd_timeout = IWL_DEF_WD_TIMEOUT, 88 88 .max_event_log_size = 512, 89 - .shadow_reg_enable = true, 89 + .shadow_reg_enable = false, /* TODO: fix bugs using this feature */ 90 90 }; 91 91 92 92 static const struct iwl_base_params iwl6050_base_params = { ··· 102 102 .chain_noise_scale = 1500, 103 103 .wd_timeout = IWL_DEF_WD_TIMEOUT, 104 104 .max_event_log_size = 1024, 105 - .shadow_reg_enable = true, 105 + .shadow_reg_enable = false, /* TODO: fix bugs using this feature */ 106 106 }; 107 107 108 108 static const struct iwl_base_params iwl6000_g2_base_params = { ··· 118 118 .chain_noise_scale = 1000, 119 119 .wd_timeout = IWL_LONG_WD_TIMEOUT, 120 120 .max_event_log_size = 512, 121 - .shadow_reg_enable = true, 121 + .shadow_reg_enable = false, /* TODO: fix bugs using this feature */ 122 122 }; 123 123 124 124 static const struct iwl_ht_params iwl6000_ht_params = {
+1
drivers/net/wireless/iwlwifi/iwl-agn-rs.c
··· 884 884 if ((priv->bt_traffic_load != priv->last_bt_traffic_load) || 885 885 (priv->bt_full_concurrent != full_concurrent)) { 886 886 priv->bt_full_concurrent = full_concurrent; 887 + priv->last_bt_traffic_load = priv->bt_traffic_load; 887 888 888 889 /* Update uCode's rate table. */ 889 890 tbl = &(lq_sta->lq_info[lq_sta->active_tbl]);
+1 -1
drivers/net/wireless/iwlwifi/iwl-agn-sta.c
··· 772 772 ~IWL_STA_DRIVER_ACTIVE; 773 773 priv->stations[i].used &= 774 774 ~IWL_STA_UCODE_INPROGRESS; 775 - spin_unlock_bh(&priv->sta_lock); 775 + continue; 776 776 } 777 777 /* 778 778 * Rate scaling has already been initialized, send
+9 -9
drivers/net/wireless/iwlwifi/iwl-drv.c
··· 657 657 return -EINVAL; 658 658 } 659 659 660 - static int alloc_pci_desc(struct iwl_drv *drv, 661 - struct iwl_firmware_pieces *pieces, 662 - enum iwl_ucode_type type) 660 + static int iwl_alloc_ucode(struct iwl_drv *drv, 661 + struct iwl_firmware_pieces *pieces, 662 + enum iwl_ucode_type type) 663 663 { 664 664 int i; 665 665 for (i = 0; 666 666 i < IWL_UCODE_SECTION_MAX && get_sec_size(pieces, type, i); 667 667 i++) 668 668 if (iwl_alloc_fw_desc(drv, &(drv->fw.img[type].sec[i]), 669 - get_sec(pieces, type, i))) 670 - return -1; 669 + get_sec(pieces, type, i))) 670 + return -ENOMEM; 671 671 return 0; 672 672 } 673 673 ··· 825 825 * 1) unmodified from disk 826 826 * 2) backup cache for save/restore during power-downs */ 827 827 for (i = 0; i < IWL_UCODE_TYPE_MAX; i++) 828 - if (alloc_pci_desc(drv, &pieces, i)) 829 - goto err_pci_alloc; 828 + if (iwl_alloc_ucode(drv, &pieces, i)) 829 + goto out_free_fw; 830 830 831 831 /* Now that we can no longer fail, copy information */ 832 832 ··· 866 866 drv->op_mode = iwl_dvm_ops.start(drv->trans, drv->cfg, &drv->fw); 867 867 868 868 if (!drv->op_mode) 869 - goto out_unbind; 869 + goto out_free_fw; 870 870 871 871 return; 872 872 ··· 877 877 goto out_unbind; 878 878 return; 879 879 880 - err_pci_alloc: 880 + out_free_fw: 881 881 IWL_ERR(drv, "failed to allocate pci memory\n"); 882 882 iwl_dealloc_ucode(drv); 883 883 release_firmware(ucode_raw);
-288
drivers/net/wireless/iwlwifi/iwl-phy-db.c
··· 1 - /****************************************************************************** 2 - * 3 - * This file is provided under a dual BSD/GPLv2 license. When using or 4 - * redistributing this file, you may do so under either license. 5 - * 6 - * GPL LICENSE SUMMARY 7 - * 8 - * Copyright(c) 2007 - 2012 Intel Corporation. All rights reserved. 9 - * 10 - * This program is free software; you can redistribute it and/or modify 11 - * it under the terms of version 2 of the GNU General Public License as 12 - * published by the Free Software Foundation. 13 - * 14 - * This program is distributed in the hope that it will be useful, but 15 - * WITHOUT ANY WARRANTY; without even the implied warranty of 16 - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 17 - * General Public License for more details. 18 - * 19 - * You should have received a copy of the GNU General Public License 20 - * along with this program; if not, write to the Free Software 21 - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110, 22 - * USA 23 - * 24 - * The full GNU General Public License is included in this distribution 25 - * in the file called LICENSE.GPL. 26 - * 27 - * Contact Information: 28 - * Intel Linux Wireless <ilw@linux.intel.com> 29 - * Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497 30 - * 31 - * BSD LICENSE 32 - * 33 - * Copyright(c) 2005 - 2012 Intel Corporation. All rights reserved. 34 - * All rights reserved. 35 - * 36 - * Redistribution and use in source and binary forms, with or without 37 - * modification, are permitted provided that the following conditions 38 - * are met: 39 - * 40 - * * Redistributions of source code must retain the above copyright 41 - * notice, this list of conditions and the following disclaimer. 42 - * * Redistributions in binary form must reproduce the above copyright 43 - * notice, this list of conditions and the following disclaimer in 44 - * the documentation and/or other materials provided with the 45 - * distribution. 46 - * * Neither the name Intel Corporation nor the names of its 47 - * contributors may be used to endorse or promote products derived 48 - * from this software without specific prior written permission. 49 - * 50 - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 51 - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 52 - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 53 - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 54 - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 55 - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 56 - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 57 - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 58 - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 59 - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 60 - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 61 - * 62 - *****************************************************************************/ 63 - 64 - #include <linux/slab.h> 65 - #include <linux/string.h> 66 - 67 - #include "iwl-debug.h" 68 - #include "iwl-dev.h" 69 - 70 - #include "iwl-phy-db.h" 71 - 72 - #define CHANNEL_NUM_SIZE 4 /* num of channels in calib_ch size */ 73 - 74 - struct iwl_phy_db *iwl_phy_db_init(struct device *dev) 75 - { 76 - struct iwl_phy_db *phy_db = kzalloc(sizeof(struct iwl_phy_db), 77 - GFP_KERNEL); 78 - 79 - if (!phy_db) 80 - return phy_db; 81 - 82 - phy_db->dev = dev; 83 - 84 - /* TODO: add default values of the phy db. */ 85 - return phy_db; 86 - } 87 - 88 - /* 89 - * get phy db section: returns a pointer to a phy db section specified by 90 - * type and channel group id. 91 - */ 92 - static struct iwl_phy_db_entry * 93 - iwl_phy_db_get_section(struct iwl_phy_db *phy_db, 94 - enum iwl_phy_db_section_type type, 95 - u16 chg_id) 96 - { 97 - if (!phy_db || type < 0 || type >= IWL_PHY_DB_MAX) 98 - return NULL; 99 - 100 - switch (type) { 101 - case IWL_PHY_DB_CFG: 102 - return &phy_db->cfg; 103 - case IWL_PHY_DB_CALIB_NCH: 104 - return &phy_db->calib_nch; 105 - case IWL_PHY_DB_CALIB_CH: 106 - return &phy_db->calib_ch; 107 - case IWL_PHY_DB_CALIB_CHG_PAPD: 108 - if (chg_id < 0 || chg_id >= IWL_NUM_PAPD_CH_GROUPS) 109 - return NULL; 110 - return &phy_db->calib_ch_group_papd[chg_id]; 111 - case IWL_PHY_DB_CALIB_CHG_TXP: 112 - if (chg_id < 0 || chg_id >= IWL_NUM_TXP_CH_GROUPS) 113 - return NULL; 114 - return &phy_db->calib_ch_group_txp[chg_id]; 115 - default: 116 - return NULL; 117 - } 118 - return NULL; 119 - } 120 - 121 - static void iwl_phy_db_free_section(struct iwl_phy_db *phy_db, 122 - enum iwl_phy_db_section_type type, 123 - u16 chg_id) 124 - { 125 - struct iwl_phy_db_entry *entry = 126 - iwl_phy_db_get_section(phy_db, type, chg_id); 127 - if (!entry) 128 - return; 129 - 130 - kfree(entry->data); 131 - entry->data = NULL; 132 - entry->size = 0; 133 - } 134 - 135 - void iwl_phy_db_free(struct iwl_phy_db *phy_db) 136 - { 137 - int i; 138 - 139 - if (!phy_db) 140 - return; 141 - 142 - iwl_phy_db_free_section(phy_db, IWL_PHY_DB_CFG, 0); 143 - iwl_phy_db_free_section(phy_db, IWL_PHY_DB_CALIB_NCH, 0); 144 - iwl_phy_db_free_section(phy_db, IWL_PHY_DB_CALIB_CH, 0); 145 - for (i = 0; i < IWL_NUM_PAPD_CH_GROUPS; i++) 146 - iwl_phy_db_free_section(phy_db, IWL_PHY_DB_CALIB_CHG_PAPD, i); 147 - for (i = 0; i < IWL_NUM_TXP_CH_GROUPS; i++) 148 - iwl_phy_db_free_section(phy_db, IWL_PHY_DB_CALIB_CHG_TXP, i); 149 - 150 - kfree(phy_db); 151 - } 152 - 153 - int iwl_phy_db_set_section(struct iwl_phy_db *phy_db, 154 - enum iwl_phy_db_section_type type, u8 *data, 155 - u16 size, gfp_t alloc_ctx) 156 - { 157 - struct iwl_phy_db_entry *entry; 158 - u16 chg_id = 0; 159 - 160 - if (!phy_db) 161 - return -EINVAL; 162 - 163 - if (type == IWL_PHY_DB_CALIB_CHG_PAPD || 164 - type == IWL_PHY_DB_CALIB_CHG_TXP) 165 - chg_id = le16_to_cpup((__le16 *)data); 166 - 167 - entry = iwl_phy_db_get_section(phy_db, type, chg_id); 168 - if (!entry) 169 - return -EINVAL; 170 - 171 - kfree(entry->data); 172 - entry->data = kmemdup(data, size, alloc_ctx); 173 - if (!entry->data) { 174 - entry->size = 0; 175 - return -ENOMEM; 176 - } 177 - 178 - entry->size = size; 179 - 180 - if (type == IWL_PHY_DB_CALIB_CH) { 181 - phy_db->channel_num = le32_to_cpup((__le32 *)data); 182 - phy_db->channel_size = 183 - (size - CHANNEL_NUM_SIZE) / phy_db->channel_num; 184 - } 185 - 186 - return 0; 187 - } 188 - 189 - static int is_valid_channel(u16 ch_id) 190 - { 191 - if (ch_id <= 14 || 192 - (36 <= ch_id && ch_id <= 64 && ch_id % 4 == 0) || 193 - (100 <= ch_id && ch_id <= 140 && ch_id % 4 == 0) || 194 - (145 <= ch_id && ch_id <= 165 && ch_id % 4 == 1)) 195 - return 1; 196 - return 0; 197 - } 198 - 199 - static u8 ch_id_to_ch_index(u16 ch_id) 200 - { 201 - if (WARN_ON(!is_valid_channel(ch_id))) 202 - return 0xff; 203 - 204 - if (ch_id <= 14) 205 - return ch_id - 1; 206 - if (ch_id <= 64) 207 - return (ch_id + 20) / 4; 208 - if (ch_id <= 140) 209 - return (ch_id - 12) / 4; 210 - return (ch_id - 13) / 4; 211 - } 212 - 213 - 214 - static u16 channel_id_to_papd(u16 ch_id) 215 - { 216 - if (WARN_ON(!is_valid_channel(ch_id))) 217 - return 0xff; 218 - 219 - if (1 <= ch_id && ch_id <= 14) 220 - return 0; 221 - if (36 <= ch_id && ch_id <= 64) 222 - return 1; 223 - if (100 <= ch_id && ch_id <= 140) 224 - return 2; 225 - return 3; 226 - } 227 - 228 - static u16 channel_id_to_txp(struct iwl_phy_db *phy_db, u16 ch_id) 229 - { 230 - struct iwl_phy_db_chg_txp *txp_chg; 231 - int i; 232 - u8 ch_index = ch_id_to_ch_index(ch_id); 233 - if (ch_index == 0xff) 234 - return 0xff; 235 - 236 - for (i = 0; i < IWL_NUM_TXP_CH_GROUPS; i++) { 237 - txp_chg = (void *)phy_db->calib_ch_group_txp[i].data; 238 - if (!txp_chg) 239 - return 0xff; 240 - /* 241 - * Looking for the first channel group that its max channel is 242 - * higher then wanted channel. 243 - */ 244 - if (le16_to_cpu(txp_chg->max_channel_idx) >= ch_index) 245 - return i; 246 - } 247 - return 0xff; 248 - } 249 - 250 - int iwl_phy_db_get_section_data(struct iwl_phy_db *phy_db, 251 - enum iwl_phy_db_section_type type, u8 **data, 252 - u16 *size, u16 ch_id) 253 - { 254 - struct iwl_phy_db_entry *entry; 255 - u32 channel_num; 256 - u32 channel_size; 257 - u16 ch_group_id = 0; 258 - u16 index; 259 - 260 - if (!phy_db) 261 - return -EINVAL; 262 - 263 - /* find wanted channel group */ 264 - if (type == IWL_PHY_DB_CALIB_CHG_PAPD) 265 - ch_group_id = channel_id_to_papd(ch_id); 266 - else if (type == IWL_PHY_DB_CALIB_CHG_TXP) 267 - ch_group_id = channel_id_to_txp(phy_db, ch_id); 268 - 269 - entry = iwl_phy_db_get_section(phy_db, type, ch_group_id); 270 - if (!entry) 271 - return -EINVAL; 272 - 273 - if (type == IWL_PHY_DB_CALIB_CH) { 274 - index = ch_id_to_ch_index(ch_id); 275 - channel_num = phy_db->channel_num; 276 - channel_size = phy_db->channel_size; 277 - if (index >= channel_num) { 278 - IWL_ERR(phy_db, "Wrong channel number %d", ch_id); 279 - return -EINVAL; 280 - } 281 - *data = entry->data + CHANNEL_NUM_SIZE + index * channel_size; 282 - *size = channel_size; 283 - } else { 284 - *data = entry->data; 285 - *size = entry->size; 286 - } 287 - return 0; 288 - }
-129
drivers/net/wireless/iwlwifi/iwl-phy-db.h
··· 1 - /****************************************************************************** 2 - * 3 - * This file is provided under a dual BSD/GPLv2 license. When using or 4 - * redistributing this file, you may do so under either license. 5 - * 6 - * GPL LICENSE SUMMARY 7 - * 8 - * Copyright(c) 2007 - 2012 Intel Corporation. All rights reserved. 9 - * 10 - * This program is free software; you can redistribute it and/or modify 11 - * it under the terms of version 2 of the GNU General Public License as 12 - * published by the Free Software Foundation. 13 - * 14 - * This program is distributed in the hope that it will be useful, but 15 - * WITHOUT ANY WARRANTY; without even the implied warranty of 16 - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 17 - * General Public License for more details. 18 - * 19 - * You should have received a copy of the GNU General Public License 20 - * along with this program; if not, write to the Free Software 21 - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110, 22 - * USA 23 - * 24 - * The full GNU General Public License is included in this distribution 25 - * in the file called LICENSE.GPL. 26 - * 27 - * Contact Information: 28 - * Intel Linux Wireless <ilw@linux.intel.com> 29 - * Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497 30 - * 31 - * BSD LICENSE 32 - * 33 - * Copyright(c) 2005 - 2012 Intel Corporation. All rights reserved. 34 - * All rights reserved. 35 - * 36 - * Redistribution and use in source and binary forms, with or without 37 - * modification, are permitted provided that the following conditions 38 - * are met: 39 - * 40 - * * Redistributions of source code must retain the above copyright 41 - * notice, this list of conditions and the following disclaimer. 42 - * * Redistributions in binary form must reproduce the above copyright 43 - * notice, this list of conditions and the following disclaimer in 44 - * the documentation and/or other materials provided with the 45 - * distribution. 46 - * * Neither the name Intel Corporation nor the names of its 47 - * contributors may be used to endorse or promote products derived 48 - * from this software without specific prior written permission. 49 - * 50 - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 51 - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 52 - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 53 - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 54 - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 55 - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 56 - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 57 - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 58 - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 59 - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 60 - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 61 - * 62 - *****************************************************************************/ 63 - 64 - #ifndef __IWL_PHYDB_H__ 65 - #define __IWL_PHYDB_H__ 66 - 67 - #include <linux/types.h> 68 - 69 - #define IWL_NUM_PAPD_CH_GROUPS 4 70 - #define IWL_NUM_TXP_CH_GROUPS 8 71 - 72 - struct iwl_phy_db_entry { 73 - u16 size; 74 - u8 *data; 75 - }; 76 - 77 - struct iwl_shared; 78 - 79 - /** 80 - * struct iwl_phy_db - stores phy configuration and calibration data. 81 - * 82 - * @cfg: phy configuration. 83 - * @calib_nch: non channel specific calibration data. 84 - * @calib_ch: channel specific calibration data. 85 - * @calib_ch_group_papd: calibration data related to papd channel group. 86 - * @calib_ch_group_txp: calibration data related to tx power chanel group. 87 - */ 88 - struct iwl_phy_db { 89 - struct iwl_phy_db_entry cfg; 90 - struct iwl_phy_db_entry calib_nch; 91 - struct iwl_phy_db_entry calib_ch; 92 - struct iwl_phy_db_entry calib_ch_group_papd[IWL_NUM_PAPD_CH_GROUPS]; 93 - struct iwl_phy_db_entry calib_ch_group_txp[IWL_NUM_TXP_CH_GROUPS]; 94 - 95 - u32 channel_num; 96 - u32 channel_size; 97 - 98 - /* for an access to the logger */ 99 - struct device *dev; 100 - }; 101 - 102 - enum iwl_phy_db_section_type { 103 - IWL_PHY_DB_CFG = 1, 104 - IWL_PHY_DB_CALIB_NCH, 105 - IWL_PHY_DB_CALIB_CH, 106 - IWL_PHY_DB_CALIB_CHG_PAPD, 107 - IWL_PHY_DB_CALIB_CHG_TXP, 108 - IWL_PHY_DB_MAX 109 - }; 110 - 111 - /* for parsing of tx power channel group data that comes from the firmware*/ 112 - struct iwl_phy_db_chg_txp { 113 - __le32 space; 114 - __le16 max_channel_idx; 115 - } __packed; 116 - 117 - struct iwl_phy_db *iwl_phy_db_init(struct device *dev); 118 - 119 - void iwl_phy_db_free(struct iwl_phy_db *phy_db); 120 - 121 - int iwl_phy_db_set_section(struct iwl_phy_db *phy_db, 122 - enum iwl_phy_db_section_type type, u8 *data, 123 - u16 size, gfp_t alloc_ctx); 124 - 125 - int iwl_phy_db_get_section_data(struct iwl_phy_db *phy_db, 126 - enum iwl_phy_db_section_type type, u8 **data, 127 - u16 *size, u16 ch_id); 128 - 129 - #endif /* __IWL_PHYDB_H__ */
+1 -1
drivers/net/wireless/iwlwifi/iwl-trans-pcie-int.h
··· 347 347 void iwl_trans_pcie_tx_agg_setup(struct iwl_trans *trans, int queue, int fifo, 348 348 int sta_id, int tid, int frame_limit, u16 ssn); 349 349 void iwlagn_txq_free_tfd(struct iwl_trans *trans, struct iwl_tx_queue *txq, 350 - int index, enum dma_data_direction dma_dir); 350 + enum dma_data_direction dma_dir); 351 351 int iwl_tx_queue_reclaim(struct iwl_trans *trans, int txq_id, int index, 352 352 struct sk_buff_head *skbs); 353 353 int iwl_queue_space(const struct iwl_queue *q);
+14 -8
drivers/net/wireless/iwlwifi/iwl-trans-pcie-tx.c
··· 204 204 for (i = 1; i < num_tbs; i++) 205 205 dma_unmap_single(trans->dev, iwl_tfd_tb_get_addr(tfd, i), 206 206 iwl_tfd_tb_get_len(tfd, i), dma_dir); 207 + 208 + tfd->num_tbs = 0; 207 209 } 208 210 209 211 /** 210 212 * iwlagn_txq_free_tfd - Free all chunks referenced by TFD [txq->q.read_ptr] 211 213 * @trans - transport private data 212 214 * @txq - tx queue 213 - * @index - the index of the TFD to be freed 214 - *@dma_dir - the direction of the DMA mapping 215 + * @dma_dir - the direction of the DMA mapping 215 216 * 216 217 * Does NOT advance any TFD circular buffer read/write indexes 217 218 * Does NOT free the TFD itself (which is within circular buffer) 218 219 */ 219 220 void iwlagn_txq_free_tfd(struct iwl_trans *trans, struct iwl_tx_queue *txq, 220 - int index, enum dma_data_direction dma_dir) 221 + enum dma_data_direction dma_dir) 221 222 { 222 223 struct iwl_tfd *tfd_tmp = txq->tfds; 223 224 225 + /* rd_ptr is bounded by n_bd and idx is bounded by n_window */ 226 + int rd_ptr = txq->q.read_ptr; 227 + int idx = get_cmd_index(&txq->q, rd_ptr); 228 + 224 229 lockdep_assert_held(&txq->lock); 225 230 226 - iwlagn_unmap_tfd(trans, &txq->entries[index].meta, 227 - &tfd_tmp[index], dma_dir); 231 + /* We have only q->n_window txq->entries, but we use q->n_bd tfds */ 232 + iwlagn_unmap_tfd(trans, &txq->entries[idx].meta, 233 + &tfd_tmp[rd_ptr], dma_dir); 228 234 229 235 /* free SKB */ 230 236 if (txq->entries) { 231 237 struct sk_buff *skb; 232 238 233 - skb = txq->entries[index].skb; 239 + skb = txq->entries[idx].skb; 234 240 235 241 /* Can be called from irqs-disabled context 236 242 * If skb is not NULL, it means that the whole queue is being ··· 244 238 */ 245 239 if (skb) { 246 240 iwl_op_mode_free_skb(trans->op_mode, skb); 247 - txq->entries[index].skb = NULL; 241 + txq->entries[idx].skb = NULL; 248 242 } 249 243 } 250 244 } ··· 979 973 980 974 iwlagn_txq_inval_byte_cnt_tbl(trans, txq); 981 975 982 - iwlagn_txq_free_tfd(trans, txq, txq->q.read_ptr, DMA_TO_DEVICE); 976 + iwlagn_txq_free_tfd(trans, txq, DMA_TO_DEVICE); 983 977 freed++; 984 978 } 985 979
+1 -3
drivers/net/wireless/iwlwifi/iwl-trans-pcie.c
··· 435 435 436 436 spin_lock_bh(&txq->lock); 437 437 while (q->write_ptr != q->read_ptr) { 438 - /* The read_ptr needs to bound by q->n_window */ 439 - iwlagn_txq_free_tfd(trans, txq, get_cmd_index(q, q->read_ptr), 440 - dma_dir); 438 + iwlagn_txq_free_tfd(trans, txq, dma_dir); 441 439 q->read_ptr = iwl_queue_inc_wrap(q->read_ptr, q->n_bd); 442 440 } 443 441 spin_unlock_bh(&txq->lock);
+1 -1
drivers/net/wireless/ti/wl1251/sdio.c
··· 260 260 } 261 261 262 262 if (wl->irq) { 263 + irq_set_status_flags(wl->irq, IRQ_NOAUTOEN); 263 264 ret = request_irq(wl->irq, wl1251_line_irq, 0, "wl1251", wl); 264 265 if (ret < 0) { 265 266 wl1251_error("request_irq() failed: %d", ret); ··· 268 267 } 269 268 270 269 irq_set_irq_type(wl->irq, IRQ_TYPE_EDGE_RISING); 271 - disable_irq(wl->irq); 272 270 273 271 wl1251_sdio_ops.enable_irq = wl1251_enable_line_irq; 274 272 wl1251_sdio_ops.disable_irq = wl1251_disable_line_irq;
+1 -2
drivers/net/wireless/ti/wl1251/spi.c
··· 281 281 282 282 wl->use_eeprom = pdata->use_eeprom; 283 283 284 + irq_set_status_flags(wl->irq, IRQ_NOAUTOEN); 284 285 ret = request_irq(wl->irq, wl1251_irq, 0, DRIVER_NAME, wl); 285 286 if (ret < 0) { 286 287 wl1251_error("request_irq() failed: %d", ret); ··· 289 288 } 290 289 291 290 irq_set_irq_type(wl->irq, IRQ_TYPE_EDGE_RISING); 292 - 293 - disable_irq(wl->irq); 294 291 295 292 ret = wl1251_init_ieee80211(wl); 296 293 if (ret)
+2
drivers/net/wireless/ti/wlcore/acx.c
··· 1715 1715 1716 1716 } 1717 1717 1718 + #ifdef CONFIG_PM 1718 1719 /* Set the global behaviour of RX filters - On/Off + default action */ 1719 1720 int wl1271_acx_default_rx_filter_enable(struct wl1271 *wl, bool enable, 1720 1721 enum rx_filter_action action) ··· 1795 1794 kfree(acx); 1796 1795 return ret; 1797 1796 } 1797 + #endif /* CONFIG_PM */
+3 -1
drivers/net/wireless/ti/wlcore/acx.h
··· 1330 1330 int wl1271_acx_fm_coex(struct wl1271 *wl); 1331 1331 int wl12xx_acx_set_rate_mgmt_params(struct wl1271 *wl); 1332 1332 int wl12xx_acx_config_hangover(struct wl1271 *wl); 1333 + 1334 + #ifdef CONFIG_PM 1333 1335 int wl1271_acx_default_rx_filter_enable(struct wl1271 *wl, bool enable, 1334 1336 enum rx_filter_action action); 1335 1337 int wl1271_acx_set_rx_filter(struct wl1271 *wl, u8 index, bool enable, 1336 1338 struct wl12xx_rx_filter *filter); 1337 - 1339 + #endif /* CONFIG_PM */ 1338 1340 #endif /* __WL1271_ACX_H__ */
+2
drivers/net/wireless/ti/wlcore/rx.c
··· 279 279 wl12xx_rearm_rx_streaming(wl, active_hlids); 280 280 } 281 281 282 + #ifdef CONFIG_PM 282 283 int wl1271_rx_filter_enable(struct wl1271 *wl, 283 284 int index, bool enable, 284 285 struct wl12xx_rx_filter *filter) ··· 315 314 wl1271_rx_filter_enable(wl, i, 0, NULL); 316 315 } 317 316 } 317 + #endif /* CONFIG_PM */
+1 -2
drivers/net/xen-netback/netback.c
··· 325 325 unsigned int count; 326 326 int i, copy_off; 327 327 328 - count = DIV_ROUND_UP( 329 - offset_in_page(skb->data)+skb_headlen(skb), PAGE_SIZE); 328 + count = DIV_ROUND_UP(skb_headlen(skb), PAGE_SIZE); 330 329 331 330 copy_off = skb_headlen(skb) % PAGE_SIZE; 332 331
+1 -1
drivers/nfc/pn544_hci.c
··· 232 232 233 233 static int check_crc(u8 *buf, int buflen) 234 234 { 235 - u8 len; 235 + int len; 236 236 u16 crc; 237 237 238 238 len = buf[0] + 1;
+3
include/linux/genetlink.h
··· 110 110 #define genl_dereference(p) \ 111 111 rcu_dereference_protected(p, lockdep_genl_is_held()) 112 112 113 + #define MODULE_ALIAS_GENL_FAMILY(family)\ 114 + MODULE_ALIAS_NET_PF_PROTO_NAME(PF_NETLINK, NETLINK_GENERIC, "-family-" family) 115 + 113 116 #endif /* __KERNEL__ */ 114 117 115 118 #endif /* __LINUX_GENERIC_NETLINK_H */
+3
include/linux/net.h
··· 313 313 MODULE_ALIAS("net-pf-" __stringify(pf) "-proto-" __stringify(proto) \ 314 314 "-type-" __stringify(type)) 315 315 316 + #define MODULE_ALIAS_NET_PF_PROTO_NAME(pf, proto, name) \ 317 + MODULE_ALIAS("net-pf-" __stringify(pf) "-proto-" __stringify(proto) \ 318 + name) 316 319 #endif /* __KERNEL__ */ 317 320 #endif /* _LINUX_NET_H */
+4 -4
include/linux/netdevice.h
··· 2795 2795 #define netif_info(priv, type, dev, fmt, args...) \ 2796 2796 netif_level(info, priv, type, dev, fmt, ##args) 2797 2797 2798 - #if defined(DEBUG) 2799 - #define netif_dbg(priv, type, dev, format, args...) \ 2800 - netif_printk(priv, type, KERN_DEBUG, dev, format, ##args) 2801 - #elif defined(CONFIG_DYNAMIC_DEBUG) 2798 + #if defined(CONFIG_DYNAMIC_DEBUG) 2802 2799 #define netif_dbg(priv, type, netdev, format, args...) \ 2803 2800 do { \ 2804 2801 if (netif_msg_##type(priv)) \ 2805 2802 dynamic_netdev_dbg(netdev, format, ##args); \ 2806 2803 } while (0) 2804 + #elif defined(DEBUG) 2805 + #define netif_dbg(priv, type, dev, format, args...) \ 2806 + netif_printk(priv, type, KERN_DEBUG, dev, format, ##args) 2807 2807 #else 2808 2808 #define netif_dbg(priv, type, dev, format, args...) \ 2809 2809 ({ \
-2
include/linux/skbuff.h
··· 1896 1896 { 1897 1897 int delta = 0; 1898 1898 1899 - if (headroom < NET_SKB_PAD) 1900 - headroom = NET_SKB_PAD; 1901 1899 if (headroom > skb_headroom(skb)) 1902 1900 delta = headroom - skb_headroom(skb); 1903 1901
+1
include/net/dst.h
··· 60 60 #define DST_NOCOUNT 0x0020 61 61 #define DST_NOPEER 0x0040 62 62 #define DST_FAKE_RTABLE 0x0080 63 + #define DST_XFRM_TUNNEL 0x0100 63 64 64 65 short error; 65 66 short obsolete;
+1
net/core/drop_monitor.c
··· 468 468 469 469 MODULE_LICENSE("GPL v2"); 470 470 MODULE_AUTHOR("Neil Horman <nhorman@tuxdriver.com>"); 471 + MODULE_ALIAS_GENL_FAMILY("NET_DM");
+9 -15
net/ipv4/esp4.c
··· 459 459 struct esp_data *esp = x->data; 460 460 u32 blksize = ALIGN(crypto_aead_blocksize(esp->aead), 4); 461 461 u32 align = max_t(u32, blksize, esp->padlen); 462 - u32 rem; 463 - 464 - mtu -= x->props.header_len + crypto_aead_authsize(esp->aead); 465 - rem = mtu & (align - 1); 466 - mtu &= ~(align - 1); 462 + unsigned int net_adj; 467 463 468 464 switch (x->props.mode) { 465 + case XFRM_MODE_TRANSPORT: 466 + case XFRM_MODE_BEET: 467 + net_adj = sizeof(struct iphdr); 468 + break; 469 469 case XFRM_MODE_TUNNEL: 470 + net_adj = 0; 470 471 break; 471 472 default: 472 - case XFRM_MODE_TRANSPORT: 473 - /* The worst case */ 474 - mtu -= blksize - 4; 475 - mtu += min_t(u32, blksize - 4, rem); 476 - break; 477 - case XFRM_MODE_BEET: 478 - /* The worst case. */ 479 - mtu += min_t(u32, IPV4_BEET_PHMAXLEN, rem); 480 - break; 473 + BUG(); 481 474 } 482 475 483 - return mtu - 2; 476 + return ((mtu - x->props.header_len - crypto_aead_authsize(esp->aead) - 477 + net_adj) & ~(align - 1)) + (net_adj - 2); 484 478 } 485 479 486 480 static void esp4_err(struct sk_buff *skb, u32 info)
+7 -11
net/ipv6/esp6.c
··· 413 413 struct esp_data *esp = x->data; 414 414 u32 blksize = ALIGN(crypto_aead_blocksize(esp->aead), 4); 415 415 u32 align = max_t(u32, blksize, esp->padlen); 416 - u32 rem; 416 + unsigned int net_adj; 417 417 418 - mtu -= x->props.header_len + crypto_aead_authsize(esp->aead); 419 - rem = mtu & (align - 1); 420 - mtu &= ~(align - 1); 418 + if (x->props.mode != XFRM_MODE_TUNNEL) 419 + net_adj = sizeof(struct ipv6hdr); 420 + else 421 + net_adj = 0; 421 422 422 - if (x->props.mode != XFRM_MODE_TUNNEL) { 423 - u32 padsize = ((blksize - 1) & 7) + 1; 424 - mtu -= blksize - padsize; 425 - mtu += min_t(u32, blksize - padsize, rem); 426 - } 427 - 428 - return mtu - 2; 423 + return ((mtu - x->props.header_len - crypto_aead_authsize(esp->aead) - 424 + net_adj) & ~(align - 1)) + (net_adj - 2); 429 425 } 430 426 431 427 static void esp6_err(struct sk_buff *skb, struct inet6_skb_parm *opt,
+50 -18
net/ipv6/ip6_output.c
··· 1187 1187 return src ? kmemdup(src, (src->hdrlen + 1) * 8, gfp) : NULL; 1188 1188 } 1189 1189 1190 + static void ip6_append_data_mtu(int *mtu, 1191 + int *maxfraglen, 1192 + unsigned int fragheaderlen, 1193 + struct sk_buff *skb, 1194 + struct rt6_info *rt) 1195 + { 1196 + if (!(rt->dst.flags & DST_XFRM_TUNNEL)) { 1197 + if (skb == NULL) { 1198 + /* first fragment, reserve header_len */ 1199 + *mtu = *mtu - rt->dst.header_len; 1200 + 1201 + } else { 1202 + /* 1203 + * this fragment is not first, the headers 1204 + * space is regarded as data space. 1205 + */ 1206 + *mtu = dst_mtu(rt->dst.path); 1207 + } 1208 + *maxfraglen = ((*mtu - fragheaderlen) & ~7) 1209 + + fragheaderlen - sizeof(struct frag_hdr); 1210 + } 1211 + } 1212 + 1190 1213 int ip6_append_data(struct sock *sk, int getfrag(void *from, char *to, 1191 1214 int offset, int len, int odd, struct sk_buff *skb), 1192 1215 void *from, int length, int transhdrlen, ··· 1219 1196 struct inet_sock *inet = inet_sk(sk); 1220 1197 struct ipv6_pinfo *np = inet6_sk(sk); 1221 1198 struct inet_cork *cork; 1222 - struct sk_buff *skb; 1199 + struct sk_buff *skb, *skb_prev = NULL; 1223 1200 unsigned int maxfraglen, fragheaderlen; 1224 1201 int exthdrlen; 1225 1202 int dst_exthdrlen; ··· 1276 1253 inet->cork.fl.u.ip6 = *fl6; 1277 1254 np->cork.hop_limit = hlimit; 1278 1255 np->cork.tclass = tclass; 1279 - mtu = np->pmtudisc == IPV6_PMTUDISC_PROBE ? 1280 - rt->dst.dev->mtu : dst_mtu(&rt->dst); 1256 + if (rt->dst.flags & DST_XFRM_TUNNEL) 1257 + mtu = np->pmtudisc == IPV6_PMTUDISC_PROBE ? 1258 + rt->dst.dev->mtu : dst_mtu(&rt->dst); 1259 + else 1260 + mtu = np->pmtudisc == IPV6_PMTUDISC_PROBE ? 1261 + rt->dst.dev->mtu : dst_mtu(rt->dst.path); 1281 1262 if (np->frag_size < mtu) { 1282 1263 if (np->frag_size) 1283 1264 mtu = np->frag_size; ··· 1377 1350 unsigned int fraglen; 1378 1351 unsigned int fraggap; 1379 1352 unsigned int alloclen; 1380 - struct sk_buff *skb_prev; 1381 1353 alloc_new_skb: 1382 - skb_prev = skb; 1383 - 1384 1354 /* There's no room in the current skb */ 1385 - if (skb_prev) 1386 - fraggap = skb_prev->len - maxfraglen; 1355 + if (skb) 1356 + fraggap = skb->len - maxfraglen; 1387 1357 else 1388 1358 fraggap = 0; 1359 + /* update mtu and maxfraglen if necessary */ 1360 + if (skb == NULL || skb_prev == NULL) 1361 + ip6_append_data_mtu(&mtu, &maxfraglen, 1362 + fragheaderlen, skb, rt); 1363 + 1364 + skb_prev = skb; 1389 1365 1390 1366 /* 1391 1367 * If remaining data exceeds the mtu, 1392 1368 * we know we need more fragment(s). 1393 1369 */ 1394 1370 datalen = length + fraggap; 1395 - if (datalen > (cork->length <= mtu && !(cork->flags & IPCORK_ALLFRAG) ? mtu : maxfraglen) - fragheaderlen) 1396 - datalen = maxfraglen - fragheaderlen; 1397 1371 1398 - fraglen = datalen + fragheaderlen; 1372 + if (datalen > (cork->length <= mtu && !(cork->flags & IPCORK_ALLFRAG) ? mtu : maxfraglen) - fragheaderlen) 1373 + datalen = maxfraglen - fragheaderlen - rt->dst.trailer_len; 1399 1374 if ((flags & MSG_MORE) && 1400 1375 !(rt->dst.dev->features&NETIF_F_SG)) 1401 1376 alloclen = mtu; ··· 1406 1377 1407 1378 alloclen += dst_exthdrlen; 1408 1379 1409 - /* 1410 - * The last fragment gets additional space at tail. 1411 - * Note: we overallocate on fragments with MSG_MODE 1412 - * because we have no idea if we're the last one. 1413 - */ 1414 - if (datalen == length + fraggap) 1415 - alloclen += rt->dst.trailer_len; 1380 + if (datalen != length + fraggap) { 1381 + /* 1382 + * this is not the last fragment, the trailer 1383 + * space is regarded as data space. 1384 + */ 1385 + datalen += rt->dst.trailer_len; 1386 + } 1387 + 1388 + alloclen += rt->dst.trailer_len; 1389 + fraglen = datalen + fragheaderlen; 1416 1390 1417 1391 /* 1418 1392 * We just reserve space for fragment header.
+22 -2
net/l2tp/l2tp_ip.c
··· 239 239 { 240 240 struct inet_sock *inet = inet_sk(sk); 241 241 struct sockaddr_l2tpip *addr = (struct sockaddr_l2tpip *) uaddr; 242 - int ret = -EINVAL; 242 + int ret; 243 243 int chk_addr_ret; 244 + 245 + if (!sock_flag(sk, SOCK_ZAPPED)) 246 + return -EINVAL; 247 + if (addr_len < sizeof(struct sockaddr_l2tpip)) 248 + return -EINVAL; 249 + if (addr->l2tp_family != AF_INET) 250 + return -EINVAL; 244 251 245 252 ret = -EADDRINUSE; 246 253 read_lock_bh(&l2tp_ip_lock); ··· 279 272 sk_del_node_init(sk); 280 273 write_unlock_bh(&l2tp_ip_lock); 281 274 ret = 0; 275 + sock_reset_flag(sk, SOCK_ZAPPED); 276 + 282 277 out: 283 278 release_sock(sk); 284 279 ··· 296 287 { 297 288 struct sockaddr_l2tpip *lsa = (struct sockaddr_l2tpip *) uaddr; 298 289 int rc; 290 + 291 + if (sock_flag(sk, SOCK_ZAPPED)) /* Must bind first - autobinding does not work */ 292 + return -EINVAL; 299 293 300 294 if (addr_len < sizeof(*lsa)) 301 295 return -EINVAL; ··· 321 309 322 310 release_sock(sk); 323 311 return rc; 312 + } 313 + 314 + static int l2tp_ip_disconnect(struct sock *sk, int flags) 315 + { 316 + if (sock_flag(sk, SOCK_ZAPPED)) 317 + return 0; 318 + 319 + return udp_disconnect(sk, flags); 324 320 } 325 321 326 322 static int l2tp_ip_getname(struct socket *sock, struct sockaddr *uaddr, ··· 550 530 .close = l2tp_ip_close, 551 531 .bind = l2tp_ip_bind, 552 532 .connect = l2tp_ip_connect, 553 - .disconnect = udp_disconnect, 533 + .disconnect = l2tp_ip_disconnect, 554 534 .ioctl = udp_ioctl, 555 535 .destroy = l2tp_ip_destroy_sock, 556 536 .setsockopt = ip_setsockopt,
+17 -1
net/l2tp/l2tp_ip6.c
··· 258 258 int addr_type; 259 259 int err; 260 260 261 + if (!sock_flag(sk, SOCK_ZAPPED)) 262 + return -EINVAL; 263 + if (addr->l2tp_family != AF_INET6) 264 + return -EINVAL; 261 265 if (addr_len < sizeof(*addr)) 262 266 return -EINVAL; 263 267 ··· 335 331 sk_del_node_init(sk); 336 332 write_unlock_bh(&l2tp_ip6_lock); 337 333 334 + sock_reset_flag(sk, SOCK_ZAPPED); 338 335 release_sock(sk); 339 336 return 0; 340 337 ··· 358 353 struct in6_addr *daddr; 359 354 int addr_type; 360 355 int rc; 356 + 357 + if (sock_flag(sk, SOCK_ZAPPED)) /* Must bind first - autobinding does not work */ 358 + return -EINVAL; 361 359 362 360 if (addr_len < sizeof(*lsa)) 363 361 return -EINVAL; ··· 389 381 release_sock(sk); 390 382 391 383 return rc; 384 + } 385 + 386 + static int l2tp_ip6_disconnect(struct sock *sk, int flags) 387 + { 388 + if (sock_flag(sk, SOCK_ZAPPED)) 389 + return 0; 390 + 391 + return udp_disconnect(sk, flags); 392 392 } 393 393 394 394 static int l2tp_ip6_getname(struct socket *sock, struct sockaddr *uaddr, ··· 705 689 .close = l2tp_ip6_close, 706 690 .bind = l2tp_ip6_bind, 707 691 .connect = l2tp_ip6_connect, 708 - .disconnect = udp_disconnect, 692 + .disconnect = l2tp_ip6_disconnect, 709 693 .ioctl = udp_ioctl, 710 694 .destroy = l2tp_ip6_destroy_sock, 711 695 .setsockopt = ipv6_setsockopt,
+1 -2
net/l2tp/l2tp_netlink.c
··· 923 923 MODULE_DESCRIPTION("L2TP netlink"); 924 924 MODULE_LICENSE("GPL"); 925 925 MODULE_VERSION("1.0"); 926 - MODULE_ALIAS("net-pf-" __stringify(PF_NETLINK) "-proto-" \ 927 - __stringify(NETLINK_GENERIC) "-type-" "l2tp"); 926 + MODULE_ALIAS_GENL_FAMILY("l2tp");
+2 -1
net/mac80211/mlme.c
··· 1522 1522 * anymore. The timeout will be reset if the frame is ACKed by 1523 1523 * the AP. 1524 1524 */ 1525 + ifmgd->probe_send_count++; 1526 + 1525 1527 if (sdata->local->hw.flags & IEEE80211_HW_REPORTS_TX_ACK_STATUS) { 1526 1528 ifmgd->nullfunc_failed = false; 1527 1529 ieee80211_send_nullfunc(sdata->local, sdata, 0); ··· 1540 1538 0, (u32) -1, true, false); 1541 1539 } 1542 1540 1543 - ifmgd->probe_send_count++; 1544 1541 ifmgd->probe_timeout = jiffies + msecs_to_jiffies(probe_wait_ms); 1545 1542 run_again(ifmgd, ifmgd->probe_timeout); 1546 1543 if (sdata->local->hw.flags & IEEE80211_HW_REPORTS_TX_ACK_STATUS)
+1 -1
net/mac80211/tx.c
··· 153 153 154 154 /* Don't calculate ACKs for QoS Frames with NoAck Policy set */ 155 155 if (ieee80211_is_data_qos(hdr->frame_control) && 156 - *(ieee80211_get_qos_ctl(hdr)) | IEEE80211_QOS_CTL_ACK_POLICY_NOACK) 156 + *(ieee80211_get_qos_ctl(hdr)) & IEEE80211_QOS_CTL_ACK_POLICY_NOACK) 157 157 dur = 0; 158 158 else 159 159 /* Time needed to transmit ACK
+6 -6
net/mac80211/util.c
··· 1371 1371 } 1372 1372 } 1373 1373 1374 + /* add back keys */ 1375 + list_for_each_entry(sdata, &local->interfaces, list) 1376 + if (ieee80211_sdata_running(sdata)) 1377 + ieee80211_enable_keys(sdata); 1378 + 1379 + wake_up: 1374 1380 /* 1375 1381 * Clear the WLAN_STA_BLOCK_BA flag so new aggregation 1376 1382 * sessions can be established after a resume. ··· 1398 1392 mutex_unlock(&local->sta_mtx); 1399 1393 } 1400 1394 1401 - /* add back keys */ 1402 - list_for_each_entry(sdata, &local->interfaces, list) 1403 - if (ieee80211_sdata_running(sdata)) 1404 - ieee80211_enable_keys(sdata); 1405 - 1406 - wake_up: 1407 1395 ieee80211_wake_queues_by_reason(hw, 1408 1396 IEEE80211_QUEUE_STOP_REASON_SUSPEND); 1409 1397
+1 -1
net/netlink/genetlink.c
··· 836 836 #ifdef CONFIG_MODULES 837 837 if (res == NULL) { 838 838 genl_unlock(); 839 - request_module("net-pf-%d-proto-%d-type-%s", 839 + request_module("net-pf-%d-proto-%d-family-%s", 840 840 PF_NETLINK, NETLINK_GENERIC, name); 841 841 genl_lock(); 842 842 res = genl_family_find_byname(name);
+1 -2
net/rds/ib.h
··· 186 186 struct work_struct free_work; 187 187 }; 188 188 189 - #define pcidev_to_node(pcidev) pcibus_to_node(pcidev->bus) 190 - #define ibdev_to_node(ibdev) pcidev_to_node(to_pci_dev(ibdev->dma_device)) 189 + #define ibdev_to_node(ibdev) dev_to_node(ibdev->dma_device) 191 190 #define rdsibdev_to_node(rdsibdev) ibdev_to_node(rdsibdev->dev) 192 191 193 192 /* bits for i_ack_flags */
+1 -1
net/wanrouter/Kconfig
··· 3 3 # 4 4 5 5 config WAN_ROUTER 6 - tristate "WAN router" 6 + tristate "WAN router (DEPRECATED)" 7 7 depends on EXPERIMENTAL 8 8 ---help--- 9 9 Wide Area Networks (WANs), such as X.25, frame relay and leased
+3
net/xfrm/xfrm_policy.c
··· 1921 1921 } 1922 1922 ok: 1923 1923 xfrm_pols_put(pols, drop_pols); 1924 + if (dst && dst->xfrm && 1925 + dst->xfrm->props.mode == XFRM_MODE_TUNNEL) 1926 + dst->flags |= DST_XFRM_TUNNEL; 1924 1927 return dst; 1925 1928 1926 1929 nopol: