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

Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless

Conflicts:
drivers/net/wireless/ath/ath9k/Kconfig
net/mac80211/iface.c

+603 -309
+2
drivers/bcma/scan.c
··· 84 84 { BCMA_CORE_I2S, "I2S" }, 85 85 { BCMA_CORE_SDR_DDR1_MEM_CTL, "SDR/DDR1 Memory Controller" }, 86 86 { BCMA_CORE_SHIM, "SHIM" }, 87 + { BCMA_CORE_PCIE2, "PCIe Gen2" }, 88 + { BCMA_CORE_ARM_CR4, "ARM CR4" }, 87 89 { BCMA_CORE_DEFAULT, "Default" }, 88 90 }; 89 91
+2 -2
drivers/bluetooth/Kconfig
··· 201 201 The core driver to support Marvell Bluetooth devices. 202 202 203 203 This driver is required if you want to support 204 - Marvell Bluetooth devices, such as 8688/8787/8797. 204 + Marvell Bluetooth devices, such as 8688/8787/8797/8897. 205 205 206 206 Say Y here to compile Marvell Bluetooth driver 207 207 into the kernel or say M to compile it as module. ··· 214 214 The driver for Marvell Bluetooth chipsets with SDIO interface. 215 215 216 216 This driver is required if you want to use Marvell Bluetooth 217 - devices with SDIO interface. Currently SD8688/SD8787/SD8797 217 + devices with SDIO interface. Currently SD8688/SD8787/SD8797/SD8897 218 218 chipsets are supported. 219 219 220 220 Say Y here to compile support for Marvell BT-over-SDIO driver
+28
drivers/bluetooth/btmrvl_sdio.c
··· 82 82 .io_port_2 = 0x7a, 83 83 }; 84 84 85 + static const struct btmrvl_sdio_card_reg btmrvl_reg_88xx = { 86 + .cfg = 0x00, 87 + .host_int_mask = 0x02, 88 + .host_intstatus = 0x03, 89 + .card_status = 0x50, 90 + .sq_read_base_addr_a0 = 0x60, 91 + .sq_read_base_addr_a1 = 0x61, 92 + .card_revision = 0xbc, 93 + .card_fw_status0 = 0xc0, 94 + .card_fw_status1 = 0xc1, 95 + .card_rx_len = 0xc2, 96 + .card_rx_unit = 0xc3, 97 + .io_port_0 = 0xd8, 98 + .io_port_1 = 0xd9, 99 + .io_port_2 = 0xda, 100 + }; 101 + 85 102 static const struct btmrvl_sdio_device btmrvl_sdio_sd8688 = { 86 103 .helper = "mrvl/sd8688_helper.bin", 87 104 .firmware = "mrvl/sd8688.bin", ··· 120 103 .sd_blksz_fw_dl = 256, 121 104 }; 122 105 106 + static const struct btmrvl_sdio_device btmrvl_sdio_sd8897 = { 107 + .helper = NULL, 108 + .firmware = "mrvl/sd8897_uapsta.bin", 109 + .reg = &btmrvl_reg_88xx, 110 + .sd_blksz_fw_dl = 256, 111 + }; 112 + 123 113 static const struct sdio_device_id btmrvl_sdio_ids[] = { 124 114 /* Marvell SD8688 Bluetooth device */ 125 115 { SDIO_DEVICE(SDIO_VENDOR_ID_MARVELL, 0x9105), ··· 140 116 /* Marvell SD8797 Bluetooth device */ 141 117 { SDIO_DEVICE(SDIO_VENDOR_ID_MARVELL, 0x912A), 142 118 .driver_data = (unsigned long) &btmrvl_sdio_sd8797 }, 119 + /* Marvell SD8897 Bluetooth device */ 120 + { SDIO_DEVICE(SDIO_VENDOR_ID_MARVELL, 0x912E), 121 + .driver_data = (unsigned long) &btmrvl_sdio_sd8897 }, 143 122 144 123 { } /* Terminating entry */ 145 124 }; ··· 1221 1194 MODULE_FIRMWARE("mrvl/sd8688.bin"); 1222 1195 MODULE_FIRMWARE("mrvl/sd8787_uapsta.bin"); 1223 1196 MODULE_FIRMWARE("mrvl/sd8797_uapsta.bin"); 1197 + MODULE_FIRMWARE("mrvl/sd8897_uapsta.bin");
+8 -4
drivers/net/wireless/ath/ath9k/Kconfig
··· 17 17 18 18 config ATH9K 19 19 tristate "Atheros 802.11n wireless cards support" 20 - depends on MAC80211 20 + depends on MAC80211 && HAS_DMA 21 21 select ATH9K_HW 22 22 select MAC80211_LEDS 23 23 select LEDS_CLASS ··· 84 84 developed. At this point enabling this option won't do anything 85 85 except increase code size. 86 86 87 - config ATH9K_RATE_CONTROL 87 + config ATH9K_LEGACY_RATE_CONTROL 88 88 bool "Atheros ath9k rate control" 89 89 depends on ATH9K 90 - default y 90 + default n 91 91 ---help--- 92 92 Say Y, if you want to use the ath9k specific rate control 93 - module instead of minstrel_ht. 93 + module instead of minstrel_ht. Be warned that there are various 94 + issues with the ath9k RC and minstrel is a more robust algorithm. 95 + Note that even if this option is selected, "ath9k_rate_control" 96 + has to be passed to mac80211 using the module parameter, 97 + ieee80211_default_rc_algo. 94 98 95 99 config ATH9K_HTC 96 100 tristate "Atheros HTC based wireless cards support"
+1 -1
drivers/net/wireless/ath/ath9k/Makefile
··· 8 8 antenna.o 9 9 10 10 ath9k-$(CONFIG_ATH9K_BTCOEX_SUPPORT) += mci.o 11 - ath9k-$(CONFIG_ATH9K_RATE_CONTROL) += rc.o 11 + ath9k-$(CONFIG_ATH9K_LEGACY_RATE_CONTROL) += rc.o 12 12 ath9k-$(CONFIG_ATH9K_PCI) += pci.o 13 13 ath9k-$(CONFIG_ATH9K_AHB) += ahb.o 14 14 ath9k-$(CONFIG_ATH9K_DEBUGFS) += debug.o
+5 -5
drivers/net/wireless/ath/ath9k/ar9003_2p2_initvals.h
··· 958 958 {0x0000a074, 0x00000000}, 959 959 {0x0000a078, 0x00000000}, 960 960 {0x0000a07c, 0x00000000}, 961 - {0x0000a080, 0x1a1a1a1a}, 962 - {0x0000a084, 0x1a1a1a1a}, 963 - {0x0000a088, 0x1a1a1a1a}, 964 - {0x0000a08c, 0x1a1a1a1a}, 965 - {0x0000a090, 0x171a1a1a}, 961 + {0x0000a080, 0x22222229}, 962 + {0x0000a084, 0x1d1d1d1d}, 963 + {0x0000a088, 0x1d1d1d1d}, 964 + {0x0000a08c, 0x1d1d1d1d}, 965 + {0x0000a090, 0x171d1d1d}, 966 966 {0x0000a094, 0x11111717}, 967 967 {0x0000a098, 0x00030311}, 968 968 {0x0000a09c, 0x00000000},
+1 -1
drivers/net/wireless/ath/ath9k/ar9003_calib.c
··· 965 965 { 966 966 int i; 967 967 968 - if (!AR_SREV_9462(ah) && !AR_SREV_9565(ah)) 968 + if (!AR_SREV_9462(ah) && !AR_SREV_9565(ah) && !AR_SREV_9485(ah)) 969 969 return; 970 970 971 971 for (i = 0; i < AR9300_MAX_CHAINS; i++) {
+6 -3
drivers/net/wireless/ath/ath9k/ar9003_eeprom.h
··· 68 68 #define AR9300_BASE_ADDR 0x3ff 69 69 #define AR9300_BASE_ADDR_512 0x1ff 70 70 71 - #define AR9300_OTP_BASE (AR_SREV_9340(ah) ? 0x30000 : 0x14000) 72 - #define AR9300_OTP_STATUS (AR_SREV_9340(ah) ? 0x30018 : 0x15f18) 71 + #define AR9300_OTP_BASE \ 72 + ((AR_SREV_9340(ah) || AR_SREV_9550(ah)) ? 0x30000 : 0x14000) 73 + #define AR9300_OTP_STATUS \ 74 + ((AR_SREV_9340(ah) || AR_SREV_9550(ah)) ? 0x30018 : 0x15f18) 73 75 #define AR9300_OTP_STATUS_TYPE 0x7 74 76 #define AR9300_OTP_STATUS_VALID 0x4 75 77 #define AR9300_OTP_STATUS_ACCESS_BUSY 0x2 76 78 #define AR9300_OTP_STATUS_SM_BUSY 0x1 77 - #define AR9300_OTP_READ_DATA (AR_SREV_9340(ah) ? 0x3001c : 0x15f1c) 79 + #define AR9300_OTP_READ_DATA \ 80 + ((AR_SREV_9340(ah) || AR_SREV_9550(ah)) ? 0x3001c : 0x15f1c) 78 81 79 82 enum targetPowerHTRates { 80 83 HT_TARGET_RATE_0_8_16,
+2 -1
drivers/net/wireless/ath/ath9k/ar9003_phy.c
··· 334 334 REG_RMW_FIELD(ah, AR_PHY_SPUR_REG, 335 335 AR_PHY_SPUR_REG_EN_VIT_SPUR_RSSI, 1); 336 336 337 - if (REG_READ_FIELD(ah, AR_PHY_MODE, 337 + if (!AR_SREV_9340(ah) && 338 + REG_READ_FIELD(ah, AR_PHY_MODE, 338 339 AR_PHY_MODE_DYNAMIC) == 0x1) 339 340 REG_RMW_FIELD(ah, AR_PHY_SPUR_REG, 340 341 AR_PHY_SPUR_REG_ENABLE_NF_RSSI_SPUR_MIT, 1);
+1 -1
drivers/net/wireless/ath/ath9k/ar9485_initvals.h
··· 1020 1020 {0x0000a284, 0x00000000, 0x00000000, 0x000002a0, 0x000002a0}, 1021 1021 {0x0000a288, 0x00000000, 0x00000000, 0x00000000, 0x00000000}, 1022 1022 {0x0000a28c, 0x00000000, 0x00000000, 0x00000000, 0x00000000}, 1023 - {0x0000a2c4, 0x00158d18, 0x00158d18, 0x00158d18, 0x00158d18}, 1023 + {0x0000a2c4, 0x00158d18, 0x00158d18, 0x00058d18, 0x00058d18}, 1024 1024 {0x0000a2d0, 0x00071981, 0x00071981, 0x00071982, 0x00071982}, 1025 1025 {0x0000a2d8, 0xf999a83a, 0xf999a83a, 0xf999a83a, 0xf999a83a}, 1026 1026 {0x0000a358, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
+3 -7
drivers/net/wireless/ath/ath9k/ath9k.h
··· 251 251 int tidno; 252 252 int baw_head; /* first un-acked tx buffer */ 253 253 int baw_tail; /* next unused tx buffer slot */ 254 - int sched; 255 - int paused; 256 - u8 state; 254 + bool sched; 255 + bool paused; 256 + bool active; 257 257 }; 258 258 259 259 struct ath_node { ··· 273 273 struct dentry *node_stat; 274 274 #endif 275 275 }; 276 - 277 - #define AGGR_CLEANUP BIT(1) 278 - #define AGGR_ADDBA_COMPLETE BIT(2) 279 - #define AGGR_ADDBA_PROGRESS BIT(3) 280 276 281 277 struct ath_tx_control { 282 278 struct ath_txq *txq;
+8
drivers/net/wireless/ath/ath9k/debug.c
··· 1723 1723 WARN_ON(i != ATH9K_SSTATS_LEN); 1724 1724 } 1725 1725 1726 + void ath9k_deinit_debug(struct ath_softc *sc) 1727 + { 1728 + if (config_enabled(CONFIG_ATH9K_DEBUGFS) && sc->rfs_chan_spec_scan) { 1729 + relay_close(sc->rfs_chan_spec_scan); 1730 + sc->rfs_chan_spec_scan = NULL; 1731 + } 1732 + } 1733 + 1726 1734 int ath9k_init_debug(struct ath_hw *ah) 1727 1735 { 1728 1736 struct ath_common *common = ath9k_hw_common(ah);
+5
drivers/net/wireless/ath/ath9k/debug.h
··· 258 258 }; 259 259 260 260 int ath9k_init_debug(struct ath_hw *ah); 261 + void ath9k_deinit_debug(struct ath_softc *sc); 261 262 262 263 void ath_debug_stat_interrupt(struct ath_softc *sc, enum ath9k_int status); 263 264 void ath_debug_stat_tx(struct ath_softc *sc, struct ath_buf *bf, ··· 292 291 static inline int ath9k_init_debug(struct ath_hw *ah) 293 292 { 294 293 return 0; 294 + } 295 + 296 + static inline void ath9k_deinit_debug(struct ath_softc *sc) 297 + { 295 298 } 296 299 297 300 static inline void ath_debug_stat_interrupt(struct ath_softc *sc,
+17 -8
drivers/net/wireless/ath/ath9k/hw.c
··· 1170 1170 static inline void ath9k_hw_set_dma(struct ath_hw *ah) 1171 1171 { 1172 1172 struct ath_common *common = ath9k_hw_common(ah); 1173 + int txbuf_size; 1173 1174 1174 1175 ENABLE_REGWRITE_BUFFER(ah); 1175 1176 ··· 1224 1223 * So set the usable tx buf size also to half to 1225 1224 * avoid data/delimiter underruns 1226 1225 */ 1227 - REG_WRITE(ah, AR_PCU_TXBUF_CTRL, 1228 - AR_9285_PCU_TXBUF_CTRL_USABLE_SIZE); 1229 - } else if (!AR_SREV_9271(ah)) { 1230 - REG_WRITE(ah, AR_PCU_TXBUF_CTRL, 1231 - AR_PCU_TXBUF_CTRL_USABLE_SIZE); 1226 + txbuf_size = AR_9285_PCU_TXBUF_CTRL_USABLE_SIZE; 1227 + } else if (AR_SREV_9340_13_OR_LATER(ah)) { 1228 + /* Uses fewer entries for AR934x v1.3+ to prevent rx overruns */ 1229 + txbuf_size = AR_9340_PCU_TXBUF_CTRL_USABLE_SIZE; 1230 + } else { 1231 + txbuf_size = AR_PCU_TXBUF_CTRL_USABLE_SIZE; 1232 1232 } 1233 + 1234 + if (!AR_SREV_9271(ah)) 1235 + REG_WRITE(ah, AR_PCU_TXBUF_CTRL, txbuf_size); 1233 1236 1234 1237 REGWRITE_BUFFER_FLUSH(ah); 1235 1238 ··· 1309 1304 AR_RTC_RC_COLD_RESET | AR_RTC_RC_WARM_RESET; 1310 1305 } else { 1311 1306 tmpReg = REG_READ(ah, AR_INTR_SYNC_CAUSE); 1312 - if (tmpReg & 1313 - (AR_INTR_SYNC_LOCAL_TIMEOUT | 1314 - AR_INTR_SYNC_RADM_CPL_TIMEOUT)) { 1307 + if (AR_SREV_9340(ah)) 1308 + tmpReg &= AR9340_INTR_SYNC_LOCAL_TIMEOUT; 1309 + else 1310 + tmpReg &= AR_INTR_SYNC_LOCAL_TIMEOUT | 1311 + AR_INTR_SYNC_RADM_CPL_TIMEOUT; 1312 + 1313 + if (tmpReg) { 1315 1314 u32 val; 1316 1315 REG_WRITE(ah, AR_INTR_SYNC_ENABLE, 0); 1317 1316
+5 -12
drivers/net/wireless/ath/ath9k/init.c
··· 792 792 hw->wiphy->iface_combinations = if_comb; 793 793 hw->wiphy->n_iface_combinations = ARRAY_SIZE(if_comb); 794 794 795 - if (AR_SREV_5416(sc->sc_ah)) 796 - hw->wiphy->flags &= ~WIPHY_FLAG_PS_ON_BY_DEFAULT; 795 + hw->wiphy->flags &= ~WIPHY_FLAG_PS_ON_BY_DEFAULT; 797 796 798 797 hw->wiphy->flags |= WIPHY_FLAG_IBSS_RSN; 799 798 hw->wiphy->flags |= WIPHY_FLAG_SUPPORTS_TDLS; ··· 829 830 830 831 sc->ant_rx = hw->wiphy->available_antennas_rx; 831 832 sc->ant_tx = hw->wiphy->available_antennas_tx; 832 - 833 - #ifdef CONFIG_ATH9K_RATE_CONTROL 834 - hw->rate_control_algorithm = "ath9k_rate_control"; 835 - #endif 836 833 837 834 if (sc->sc_ah->caps.hw_caps & ATH9K_HW_CAP_2GHZ) 838 835 hw->wiphy->bands[IEEE80211_BAND_2GHZ] = ··· 902 907 if (!ath_is_world_regd(reg)) { 903 908 error = regulatory_hint(hw->wiphy, reg->alpha2); 904 909 if (error) 905 - goto unregister; 910 + goto debug_cleanup; 906 911 } 907 912 908 913 ath_init_leds(sc); ··· 910 915 911 916 return 0; 912 917 918 + debug_cleanup: 919 + ath9k_deinit_debug(sc); 913 920 unregister: 914 921 ieee80211_unregister_hw(hw); 915 922 rx_cleanup: ··· 940 943 sc->dfs_detector->exit(sc->dfs_detector); 941 944 942 945 ath9k_eeprom_release(sc); 943 - 944 - if (config_enabled(CONFIG_ATH9K_DEBUGFS) && sc->rfs_chan_spec_scan) { 945 - relay_close(sc->rfs_chan_spec_scan); 946 - sc->rfs_chan_spec_scan = NULL; 947 - } 948 946 } 949 947 950 948 void ath9k_deinit_device(struct ath_softc *sc) ··· 953 961 954 962 ath9k_ps_restore(sc); 955 963 964 + ath9k_deinit_debug(sc); 956 965 ieee80211_unregister_hw(hw); 957 966 ath_rx_cleanup(sc); 958 967 ath9k_deinit_softc(sc);
+1 -1
drivers/net/wireless/ath/ath9k/mac.c
··· 410 410 411 411 REG_WRITE(ah, AR_QMISC(q), AR_Q_MISC_DCU_EARLY_TERM_REQ); 412 412 413 - if (AR_SREV_9340(ah)) 413 + if (AR_SREV_9340(ah) && !AR_SREV_9340_13_OR_LATER(ah)) 414 414 REG_WRITE(ah, AR_DMISC(q), 415 415 AR_D_MISC_CW_BKOFF_EN | AR_D_MISC_FRAG_WAIT_EN | 0x1); 416 416 else
+5 -2
drivers/net/wireless/ath/ath9k/main.c
··· 1686 1686 u16 tid, u16 *ssn, u8 buf_size) 1687 1687 { 1688 1688 struct ath_softc *sc = hw->priv; 1689 + bool flush = false; 1689 1690 int ret = 0; 1690 1691 1691 1692 mutex_lock(&sc->mutex); ··· 1703 1702 ieee80211_start_tx_ba_cb_irqsafe(vif, sta->addr, tid); 1704 1703 ath9k_ps_restore(sc); 1705 1704 break; 1706 - case IEEE80211_AMPDU_TX_STOP_CONT: 1707 1705 case IEEE80211_AMPDU_TX_STOP_FLUSH: 1708 1706 case IEEE80211_AMPDU_TX_STOP_FLUSH_CONT: 1707 + flush = true; 1708 + case IEEE80211_AMPDU_TX_STOP_CONT: 1709 1709 ath9k_ps_wakeup(sc); 1710 1710 ath_tx_aggr_stop(sc, sta, tid); 1711 - ieee80211_stop_tx_ba_cb_irqsafe(vif, sta->addr, tid); 1711 + if (!flush) 1712 + ieee80211_stop_tx_ba_cb_irqsafe(vif, sta->addr, tid); 1712 1713 ath9k_ps_restore(sc); 1713 1714 break; 1714 1715 case IEEE80211_AMPDU_TX_OPERATIONAL:
+1 -4
drivers/net/wireless/ath/ath9k/rc.c
··· 1227 1227 return false; 1228 1228 1229 1229 txtid = ATH_AN_2_TID(an, tidno); 1230 - 1231 - if (!(txtid->state & (AGGR_ADDBA_COMPLETE | AGGR_ADDBA_PROGRESS))) 1232 - return true; 1233 - return false; 1230 + return !txtid->active; 1234 1231 } 1235 1232 1236 1233
+1 -1
drivers/net/wireless/ath/ath9k/rc.h
··· 231 231 } 232 232 #endif 233 233 234 - #ifdef CONFIG_ATH9K_RATE_CONTROL 234 + #ifdef CONFIG_ATH9K_LEGACY_RATE_CONTROL 235 235 int ath_rate_control_register(void); 236 236 void ath_rate_control_unregister(void); 237 237 #else
+11
drivers/net/wireless/ath/ath9k/reg.h
··· 798 798 #define AR_SREV_REVISION_9485_10 0 799 799 #define AR_SREV_REVISION_9485_11 1 800 800 #define AR_SREV_VERSION_9340 0x300 801 + #define AR_SREV_REVISION_9340_10 0 802 + #define AR_SREV_REVISION_9340_11 1 803 + #define AR_SREV_REVISION_9340_12 2 804 + #define AR_SREV_REVISION_9340_13 3 801 805 #define AR_SREV_VERSION_9580 0x1C0 802 806 #define AR_SREV_REVISION_9580_10 4 /* AR9580 1.0 */ 803 807 #define AR_SREV_VERSION_9462 0x280 ··· 900 896 901 897 #define AR_SREV_9340(_ah) \ 902 898 (((_ah)->hw_version.macVersion == AR_SREV_VERSION_9340)) 899 + 900 + #define AR_SREV_9340_13_OR_LATER(_ah) \ 901 + (AR_SREV_9340((_ah)) && \ 902 + ((_ah)->hw_version.macRev >= AR_SREV_REVISION_9340_13)) 903 903 904 904 #define AR_SREV_9285E_20(_ah) \ 905 905 (AR_SREV_9285_12_OR_LATER(_ah) && \ ··· 1014 1006 AR_INTR_SYNC_RADM_CPL_TIMEOUT | 1015 1007 AR_INTR_SYNC_LOCAL_TIMEOUT | 1016 1008 AR_INTR_SYNC_MAC_SLEEP_ACCESS), 1009 + 1010 + AR9340_INTR_SYNC_LOCAL_TIMEOUT = 0x00000010, 1017 1011 1018 1012 AR_INTR_SYNC_SPURIOUS = 0xFFFFFFFF, 1019 1013 ··· 1891 1881 #define AR_PCU_TXBUF_CTRL_SIZE_MASK 0x7FF 1892 1882 #define AR_PCU_TXBUF_CTRL_USABLE_SIZE 0x700 1893 1883 #define AR_9285_PCU_TXBUF_CTRL_USABLE_SIZE 0x380 1884 + #define AR_9340_PCU_TXBUF_CTRL_USABLE_SIZE 0x500 1894 1885 1895 1886 #define AR_PCU_MISC_MODE2 0x8344 1896 1887 #define AR_PCU_MISC_MODE2_MGMT_CRYPTO_ENABLE 0x00000002
+37 -75
drivers/net/wireless/ath/ath9k/xmit.c
··· 125 125 list_add_tail(&ac->list, &txq->axq_acq); 126 126 } 127 127 128 - static void ath_tx_resume_tid(struct ath_softc *sc, struct ath_atx_tid *tid) 129 - { 130 - struct ath_txq *txq = tid->ac->txq; 131 - 132 - WARN_ON(!tid->paused); 133 - 134 - ath_txq_lock(sc, txq); 135 - tid->paused = false; 136 - 137 - if (skb_queue_empty(&tid->buf_q)) 138 - goto unlock; 139 - 140 - ath_tx_queue_tid(txq, tid); 141 - ath_txq_schedule(sc, txq); 142 - unlock: 143 - ath_txq_unlock_complete(sc, txq); 144 - } 145 - 146 128 static struct ath_frame_info *get_frame_info(struct sk_buff *skb) 147 129 { 148 130 struct ieee80211_tx_info *tx_info = IEEE80211_SKB_CB(skb); ··· 181 199 ath_set_rates(tid->an->vif, tid->an->sta, bf); 182 200 ath_tx_send_normal(sc, txq, NULL, skb); 183 201 } 184 - } 185 - 186 - if (tid->baw_head == tid->baw_tail) { 187 - tid->state &= ~AGGR_ADDBA_COMPLETE; 188 - tid->state &= ~AGGR_CLEANUP; 189 202 } 190 203 191 204 if (sendbar) { ··· 254 277 255 278 list_add_tail(&bf->list, &bf_head); 256 279 257 - if (fi->retries) 258 - ath_tx_update_baw(sc, tid, bf->bf_state.seqno); 259 - 280 + ath_tx_update_baw(sc, tid, bf->bf_state.seqno); 260 281 ath_tx_complete_buf(sc, bf, txq, &bf_head, &ts, 0); 261 282 } 262 283 ··· 466 491 tx_info = IEEE80211_SKB_CB(skb); 467 492 fi = get_frame_info(skb); 468 493 469 - if (ATH_BA_ISSET(ba, ATH_BA_INDEX(seq_st, seqno))) { 494 + if (!BAW_WITHIN(tid->seq_start, tid->baw_size, seqno)) { 495 + /* 496 + * Outside of the current BlockAck window, 497 + * maybe part of a previous session 498 + */ 499 + txfail = 1; 500 + } else if (ATH_BA_ISSET(ba, ATH_BA_INDEX(seq_st, seqno))) { 470 501 /* transmit completion, subframe is 471 502 * acked by block ack */ 472 503 acked_cnt++; 473 504 } else if (!isaggr && txok) { 474 505 /* transmit completion */ 475 506 acked_cnt++; 476 - } else if (tid->state & AGGR_CLEANUP) { 477 - /* 478 - * cleanup in progress, just fail 479 - * the un-acked sub-frames 480 - */ 481 - txfail = 1; 482 507 } else if (flush) { 483 508 txpending = 1; 484 509 } else if (fi->retries < ATH_MAX_SW_RETRIES) { ··· 502 527 if (bf_next != NULL || !bf_last->bf_stale) 503 528 list_move_tail(&bf->list, &bf_head); 504 529 505 - if (!txpending || (tid->state & AGGR_CLEANUP)) { 530 + if (!txpending) { 506 531 /* 507 532 * complete the acked-ones/xretried ones; update 508 533 * block-ack window ··· 576 601 ath_txq_lock(sc, txq); 577 602 } 578 603 579 - if (tid->state & AGGR_CLEANUP) 580 - ath_tx_flush_tid(sc, tid); 581 - 582 604 rcu_read_unlock(); 583 605 584 606 if (needreset) ··· 592 620 struct ath_tx_status *ts, struct ath_buf *bf, 593 621 struct list_head *bf_head) 594 622 { 623 + struct ieee80211_tx_info *info; 595 624 bool txok, flush; 596 625 597 626 txok = !(ts->ts_status & ATH9K_TXERR_MASK); ··· 604 631 txq->axq_ampdu_depth--; 605 632 606 633 if (!bf_isampdu(bf)) { 607 - if (!flush) 634 + if (!flush) { 635 + info = IEEE80211_SKB_CB(bf->bf_mpdu); 636 + memcpy(info->control.rates, bf->rates, 637 + sizeof(info->control.rates)); 608 638 ath_tx_rc_status(sc, bf, ts, 1, txok ? 0 : 1, txok); 639 + } 609 640 ath_tx_complete_buf(sc, bf, txq, bf_head, ts, txok); 610 641 } else 611 642 ath_tx_complete_aggr(sc, txq, bf, bf_head, ts, txok); ··· 653 676 654 677 skb = bf->bf_mpdu; 655 678 tx_info = IEEE80211_SKB_CB(skb); 656 - rates = tx_info->control.rates; 679 + rates = bf->rates; 657 680 658 681 /* 659 682 * Find the lowest frame length among the rate series that will have a ··· 1208 1231 an = (struct ath_node *)sta->drv_priv; 1209 1232 txtid = ATH_AN_2_TID(an, tid); 1210 1233 1211 - if (txtid->state & (AGGR_CLEANUP | AGGR_ADDBA_COMPLETE)) 1212 - return -EAGAIN; 1213 - 1214 1234 /* update ampdu factor/density, they may have changed. This may happen 1215 1235 * in HT IBSS when a beacon with HT-info is received after the station 1216 1236 * has already been added. ··· 1219 1245 an->mpdudensity = density; 1220 1246 } 1221 1247 1222 - txtid->state |= AGGR_ADDBA_PROGRESS; 1248 + txtid->active = true; 1223 1249 txtid->paused = true; 1224 1250 *ssn = txtid->seq_start = txtid->seq_next; 1225 1251 txtid->bar_index = -1; ··· 1236 1262 struct ath_atx_tid *txtid = ATH_AN_2_TID(an, tid); 1237 1263 struct ath_txq *txq = txtid->ac->txq; 1238 1264 1239 - if (txtid->state & AGGR_CLEANUP) 1240 - return; 1241 - 1242 - if (!(txtid->state & AGGR_ADDBA_COMPLETE)) { 1243 - txtid->state &= ~AGGR_ADDBA_PROGRESS; 1244 - return; 1245 - } 1246 - 1247 1265 ath_txq_lock(sc, txq); 1266 + txtid->active = false; 1248 1267 txtid->paused = true; 1249 - 1250 - /* 1251 - * If frames are still being transmitted for this TID, they will be 1252 - * cleaned up during tx completion. To prevent race conditions, this 1253 - * TID can only be reused after all in-progress subframes have been 1254 - * completed. 1255 - */ 1256 - if (txtid->baw_head != txtid->baw_tail) 1257 - txtid->state |= AGGR_CLEANUP; 1258 - else 1259 - txtid->state &= ~AGGR_ADDBA_COMPLETE; 1260 - 1261 1268 ath_tx_flush_tid(sc, txtid); 1262 1269 ath_txq_unlock_complete(sc, txq); 1263 1270 } ··· 1304 1349 } 1305 1350 } 1306 1351 1307 - void ath_tx_aggr_resume(struct ath_softc *sc, struct ieee80211_sta *sta, u16 tid) 1352 + void ath_tx_aggr_resume(struct ath_softc *sc, struct ieee80211_sta *sta, 1353 + u16 tidno) 1308 1354 { 1309 - struct ath_atx_tid *txtid; 1355 + struct ath_atx_tid *tid; 1310 1356 struct ath_node *an; 1357 + struct ath_txq *txq; 1311 1358 1312 1359 an = (struct ath_node *)sta->drv_priv; 1360 + tid = ATH_AN_2_TID(an, tidno); 1361 + txq = tid->ac->txq; 1313 1362 1314 - txtid = ATH_AN_2_TID(an, tid); 1315 - txtid->baw_size = IEEE80211_MIN_AMPDU_BUF << sta->ht_cap.ampdu_factor; 1316 - txtid->state |= AGGR_ADDBA_COMPLETE; 1317 - txtid->state &= ~AGGR_ADDBA_PROGRESS; 1318 - ath_tx_resume_tid(sc, txtid); 1363 + ath_txq_lock(sc, txq); 1364 + 1365 + tid->baw_size = IEEE80211_MIN_AMPDU_BUF << sta->ht_cap.ampdu_factor; 1366 + tid->paused = false; 1367 + 1368 + if (!skb_queue_empty(&tid->buf_q)) { 1369 + ath_tx_queue_tid(txq, tid); 1370 + ath_txq_schedule(sc, txq); 1371 + } 1372 + 1373 + ath_txq_unlock_complete(sc, txq); 1319 1374 } 1320 1375 1321 1376 /********************/ ··· 2374 2409 tid->baw_head = tid->baw_tail = 0; 2375 2410 tid->sched = false; 2376 2411 tid->paused = false; 2377 - tid->state &= ~AGGR_CLEANUP; 2412 + tid->active = false; 2378 2413 __skb_queue_head_init(&tid->buf_q); 2379 2414 acno = TID_TO_WME_AC(tidno); 2380 2415 tid->ac = &an->ac[acno]; 2381 - tid->state &= ~AGGR_ADDBA_COMPLETE; 2382 - tid->state &= ~AGGR_ADDBA_PROGRESS; 2383 2416 } 2384 2417 2385 2418 for (acno = 0, ac = &an->ac[acno]; ··· 2414 2451 } 2415 2452 2416 2453 ath_tid_drain(sc, txq, tid); 2417 - tid->state &= ~AGGR_ADDBA_COMPLETE; 2418 - tid->state &= ~AGGR_CLEANUP; 2454 + tid->active = false; 2419 2455 2420 2456 ath_txq_unlock(sc, txq); 2421 2457 }
+1 -1
drivers/net/wireless/atmel.c
··· 1624 1624 1625 1625 netif_carrier_off(dev); 1626 1626 1627 - if (!proc_create_data("driver/atmel", 0, NULL, &atmel_proc_fops, priv)); 1627 + if (!proc_create_data("driver/atmel", 0, NULL, &atmel_proc_fops, priv)) 1628 1628 printk(KERN_WARNING "atmel: unable to create /proc entry.\n"); 1629 1629 1630 1630 printk(KERN_INFO "%s: Atmel at76c50x. Version %d.%d. MAC %pM\n",
+1 -1
drivers/net/wireless/b43/main.c
··· 2458 2458 for (i = 0; i < B43_NR_FWTYPES; i++) { 2459 2459 errmsg = ctx->errors[i]; 2460 2460 if (strlen(errmsg)) 2461 - b43err(dev->wl, errmsg); 2461 + b43err(dev->wl, "%s", errmsg); 2462 2462 } 2463 2463 b43_print_fw_helptext(dev->wl, 1); 2464 2464 goto out;
-18
drivers/net/wireless/brcm80211/brcmfmac/dhd_common.c
··· 27 27 #include "tracepoint.h" 28 28 29 29 #define PKTFILTER_BUF_SIZE 128 30 - #define BRCMF_ARPOL_MODE 0xb /* agent|snoop|peer_autoreply */ 31 30 #define BRCMF_DEFAULT_BCN_TIMEOUT 3 32 31 #define BRCMF_DEFAULT_SCAN_CHANNEL_TIME 40 33 32 #define BRCMF_DEFAULT_SCAN_UNASSOC_TIME 40 ··· 335 336 brcmf_err("BRCMF_C_SET_SCAN_UNASSOC_TIME error (%d)\n", 336 337 err); 337 338 goto done; 338 - } 339 - 340 - /* Try to set and enable ARP offload feature, this may fail */ 341 - err = brcmf_fil_iovar_int_set(ifp, "arp_ol", BRCMF_ARPOL_MODE); 342 - if (err) { 343 - brcmf_dbg(TRACE, "failed to set ARP offload mode to 0x%x, err = %d\n", 344 - BRCMF_ARPOL_MODE, err); 345 - err = 0; 346 - } else { 347 - err = brcmf_fil_iovar_int_set(ifp, "arpoe", 1); 348 - if (err) { 349 - brcmf_dbg(TRACE, "failed to enable ARP offload err = %d\n", 350 - err); 351 - err = 0; 352 - } else 353 - brcmf_dbg(TRACE, "successfully enabled ARP offload to 0x%x\n", 354 - BRCMF_ARPOL_MODE); 355 339 } 356 340 357 341 /* Setup packet filter */
+10 -6
drivers/net/wireless/brcm80211/brcmfmac/dhd_linux.c
··· 653 653 654 654 brcmf_dbg(INFO, "%s: Broadcom Dongle Host Driver\n", ndev->name); 655 655 656 + ndev->destructor = free_netdev; 656 657 return 0; 657 658 658 659 fail: 660 + drvr->iflist[ifp->bssidx] = NULL; 659 661 ndev->netdev_ops = NULL; 662 + free_netdev(ndev); 660 663 return -EBADE; 661 664 } 662 665 ··· 723 720 return 0; 724 721 725 722 fail: 723 + ifp->drvr->iflist[ifp->bssidx] = NULL; 724 + ndev->netdev_ops = NULL; 725 + free_netdev(ndev); 726 726 return -EBADE; 727 727 } 728 728 ··· 794 788 struct brcmf_if *ifp; 795 789 796 790 ifp = drvr->iflist[bssidx]; 791 + drvr->iflist[bssidx] = NULL; 797 792 if (!ifp) { 798 793 brcmf_err("Null interface, idx=%d\n", bssidx); 799 794 return; ··· 815 808 cancel_work_sync(&ifp->setmacaddr_work); 816 809 cancel_work_sync(&ifp->multicast_work); 817 810 } 818 - 811 + /* unregister will take care of freeing it */ 819 812 unregister_netdev(ifp->ndev); 820 813 if (bssidx == 0) 821 814 brcmf_cfg80211_detach(drvr->config); 822 - free_netdev(ifp->ndev); 823 815 } else { 824 816 kfree(ifp); 825 817 } 826 - drvr->iflist[bssidx] = NULL; 827 818 } 828 819 829 820 int brcmf_attach(uint bus_hdrlen, struct device *dev) ··· 930 925 brcmf_fws_del_interface(ifp); 931 926 brcmf_fws_deinit(drvr); 932 927 } 933 - free_netdev(ifp->ndev); 934 - drvr->iflist[0] = NULL; 935 928 if (p2p_ifp) { 936 929 free_netdev(p2p_ifp->ndev); 937 930 drvr->iflist[1] = NULL; ··· 937 934 return ret; 938 935 } 939 936 if ((brcmf_p2p_enable) && (p2p_ifp)) 940 - brcmf_net_p2p_attach(p2p_ifp); 937 + if (brcmf_net_p2p_attach(p2p_ifp) < 0) 938 + brcmf_p2p_enable = 0; 941 939 942 940 return 0; 943 941 }
+2 -1
drivers/net/wireless/brcm80211/brcmfmac/fweh.c
··· 202 202 return; 203 203 brcmf_fws_add_interface(ifp); 204 204 if (!drvr->fweh.evt_handler[BRCMF_E_IF]) 205 - err = brcmf_net_attach(ifp, false); 205 + if (brcmf_net_attach(ifp, false) < 0) 206 + return; 206 207 } 207 208 208 209 if (ifevent->action == BRCMF_E_IF_CHANGE)
+6
drivers/net/wireless/brcm80211/brcmfmac/fwil_types.h
··· 23 23 24 24 #define BRCMF_FIL_ACTION_FRAME_SIZE 1800 25 25 26 + /* ARP Offload feature flags for arp_ol iovar */ 27 + #define BRCMF_ARP_OL_AGENT 0x00000001 28 + #define BRCMF_ARP_OL_SNOOP 0x00000002 29 + #define BRCMF_ARP_OL_HOST_AUTO_REPLY 0x00000004 30 + #define BRCMF_ARP_OL_PEER_AUTO_REPLY 0x00000008 31 + 26 32 27 33 enum brcmf_fil_p2p_if_types { 28 34 BRCMF_FIL_P2P_IF_CLIENT,
+54 -20
drivers/net/wireless/brcm80211/brcmfmac/p2p.c
··· 47 47 #define IS_P2P_SOCIAL_CHANNEL(channel) ((channel == SOCIAL_CHAN_1) || \ 48 48 (channel == SOCIAL_CHAN_2) || \ 49 49 (channel == SOCIAL_CHAN_3)) 50 + #define BRCMF_P2P_TEMP_CHAN SOCIAL_CHAN_3 50 51 #define SOCIAL_CHAN_CNT 3 51 52 #define AF_PEER_SEARCH_CNT 2 52 53 ··· 1955 1954 err = brcmf_fil_iovar_int_set(pri_ifp, "p2p_disc", 1); 1956 1955 if (err < 0) { 1957 1956 brcmf_err("set p2p_disc error\n"); 1958 - brcmf_free_vif(p2p_vif); 1957 + brcmf_free_vif(cfg, p2p_vif); 1959 1958 goto exit; 1960 1959 } 1961 1960 /* obtain bsscfg index for P2P discovery */ 1962 1961 err = brcmf_fil_iovar_int_get(pri_ifp, "p2p_dev", &bssidx); 1963 1962 if (err < 0) { 1964 1963 brcmf_err("retrieving discover bsscfg index failed\n"); 1965 - brcmf_free_vif(p2p_vif); 1964 + brcmf_free_vif(cfg, p2p_vif); 1966 1965 goto exit; 1967 1966 } 1968 1967 /* Verify that firmware uses same bssidx as driver !! */ 1969 1968 if (p2p_ifp->bssidx != bssidx) { 1970 1969 brcmf_err("Incorrect bssidx=%d, compared to p2p_ifp->bssidx=%d\n", 1971 1970 bssidx, p2p_ifp->bssidx); 1972 - brcmf_free_vif(p2p_vif); 1971 + brcmf_free_vif(cfg, p2p_vif); 1973 1972 goto exit; 1974 1973 } 1975 1974 ··· 1997 1996 brcmf_p2p_cancel_remain_on_channel(vif->ifp); 1998 1997 brcmf_p2p_deinit_discovery(p2p); 1999 1998 /* remove discovery interface */ 2000 - brcmf_free_vif(vif); 1999 + brcmf_free_vif(p2p->cfg, vif); 2001 2000 p2p->bss_idx[P2PAPI_BSSCFG_DEVICE].vif = NULL; 2002 2001 } 2003 2002 /* just set it all to zero */ ··· 2014 2013 u16 *chanspec) 2015 2014 { 2016 2015 struct brcmf_if *ifp; 2017 - struct brcmf_fil_chan_info_le ci; 2016 + u8 mac_addr[ETH_ALEN]; 2018 2017 struct brcmu_chan ch; 2019 - s32 err; 2018 + struct brcmf_bss_info_le *bi; 2019 + u8 *buf; 2020 2020 2021 2021 ifp = p2p->bss_idx[P2PAPI_BSSCFG_PRIMARY].vif->ifp; 2022 2022 2023 - ch.chnum = 11; 2024 - 2025 - err = brcmf_fil_cmd_data_get(ifp, BRCMF_C_GET_CHANNEL, &ci, sizeof(ci)); 2026 - if (!err) 2027 - ch.chnum = le32_to_cpu(ci.hw_channel); 2023 + if (brcmf_fil_cmd_data_get(ifp, BRCMF_C_GET_BSSID, mac_addr, 2024 + ETH_ALEN) == 0) { 2025 + buf = kzalloc(WL_BSS_INFO_MAX, GFP_KERNEL); 2026 + if (buf != NULL) { 2027 + *(__le32 *)buf = cpu_to_le32(WL_BSS_INFO_MAX); 2028 + if (brcmf_fil_cmd_data_get(ifp, BRCMF_C_GET_BSS_INFO, 2029 + buf, WL_BSS_INFO_MAX) == 0) { 2030 + bi = (struct brcmf_bss_info_le *)(buf + 4); 2031 + *chanspec = le16_to_cpu(bi->chanspec); 2032 + kfree(buf); 2033 + return; 2034 + } 2035 + kfree(buf); 2036 + } 2037 + } 2038 + /* Use default channel for P2P */ 2039 + ch.chnum = BRCMF_P2P_TEMP_CHAN; 2028 2040 ch.bw = BRCMU_CHAN_BW_20; 2029 2041 p2p->cfg->d11inf.encchspec(&ch); 2030 2042 *chanspec = ch.chspec; ··· 2222 2208 return &p2p_vif->wdev; 2223 2209 2224 2210 fail: 2225 - brcmf_free_vif(p2p_vif); 2211 + brcmf_free_vif(p2p->cfg, p2p_vif); 2226 2212 return ERR_PTR(err); 2227 2213 } 2228 2214 ··· 2231 2217 * 2232 2218 * @vif: virtual interface object to delete. 2233 2219 */ 2234 - static void brcmf_p2p_delete_p2pdev(struct brcmf_cfg80211_vif *vif) 2220 + static void brcmf_p2p_delete_p2pdev(struct brcmf_cfg80211_info *cfg, 2221 + struct brcmf_cfg80211_vif *vif) 2235 2222 { 2236 - struct brcmf_p2p_info *p2p = &vif->ifp->drvr->config->p2p; 2237 - 2238 2223 cfg80211_unregister_wdev(&vif->wdev); 2239 - p2p->bss_idx[P2PAPI_BSSCFG_DEVICE].vif = NULL; 2240 - brcmf_free_vif(vif); 2224 + cfg->p2p.bss_idx[P2PAPI_BSSCFG_DEVICE].vif = NULL; 2225 + brcmf_free_vif(cfg, vif); 2226 + } 2227 + 2228 + /** 2229 + * brcmf_p2p_free_p2p_if() - free up net device related data. 2230 + * 2231 + * @ndev: net device that needs to be freed. 2232 + */ 2233 + static void brcmf_p2p_free_p2p_if(struct net_device *ndev) 2234 + { 2235 + struct brcmf_cfg80211_info *cfg; 2236 + struct brcmf_cfg80211_vif *vif; 2237 + struct brcmf_if *ifp; 2238 + 2239 + ifp = netdev_priv(ndev); 2240 + cfg = ifp->drvr->config; 2241 + vif = ifp->vif; 2242 + 2243 + brcmf_free_vif(cfg, vif); 2244 + free_netdev(ifp->ndev); 2241 2245 } 2242 2246 2243 2247 /** ··· 2335 2303 brcmf_err("Registering netdevice failed\n"); 2336 2304 goto fail; 2337 2305 } 2306 + /* override destructor */ 2307 + ifp->ndev->destructor = brcmf_p2p_free_p2p_if; 2308 + 2338 2309 cfg->p2p.bss_idx[P2PAPI_BSSCFG_CONNECTION].vif = vif; 2339 2310 /* Disable firmware roaming for P2P interface */ 2340 2311 brcmf_fil_iovar_int_set(ifp, "roam_off", 1); ··· 2349 2314 return &ifp->vif->wdev; 2350 2315 2351 2316 fail: 2352 - brcmf_free_vif(vif); 2317 + brcmf_free_vif(cfg, vif); 2353 2318 return ERR_PTR(err); 2354 2319 } 2355 2320 ··· 2385 2350 break; 2386 2351 2387 2352 case NL80211_IFTYPE_P2P_DEVICE: 2388 - brcmf_p2p_delete_p2pdev(vif); 2353 + brcmf_p2p_delete_p2pdev(cfg, vif); 2389 2354 return 0; 2390 2355 default: 2391 2356 return -ENOTSUPP; ··· 2413 2378 err = 0; 2414 2379 } 2415 2380 brcmf_cfg80211_arm_vif_event(cfg, NULL); 2416 - brcmf_free_vif(vif); 2417 2381 p2p->bss_idx[P2PAPI_BSSCFG_CONNECTION].vif = NULL; 2418 2382 2419 2383 return err;
+81 -15
drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.c
··· 459 459 return err; 460 460 } 461 461 462 + static s32 463 + brcmf_configure_arp_offload(struct brcmf_if *ifp, bool enable) 464 + { 465 + s32 err; 466 + u32 mode; 467 + 468 + if (enable) 469 + mode = BRCMF_ARP_OL_AGENT | BRCMF_ARP_OL_PEER_AUTO_REPLY; 470 + else 471 + mode = 0; 472 + 473 + /* Try to set and enable ARP offload feature, this may fail, then it */ 474 + /* is simply not supported and err 0 will be returned */ 475 + err = brcmf_fil_iovar_int_set(ifp, "arp_ol", mode); 476 + if (err) { 477 + brcmf_dbg(TRACE, "failed to set ARP offload mode to 0x%x, err = %d\n", 478 + mode, err); 479 + err = 0; 480 + } else { 481 + err = brcmf_fil_iovar_int_set(ifp, "arpoe", enable); 482 + if (err) { 483 + brcmf_dbg(TRACE, "failed to configure (%d) ARP offload err = %d\n", 484 + enable, err); 485 + err = 0; 486 + } else 487 + brcmf_dbg(TRACE, "successfully configured (%d) ARP offload to 0x%x\n", 488 + enable, mode); 489 + } 490 + 491 + return err; 492 + } 493 + 462 494 static struct wireless_dev *brcmf_cfg80211_add_iface(struct wiphy *wiphy, 463 495 const char *name, 464 496 enum nl80211_iftype type, ··· 2248 2216 } 2249 2217 2250 2218 pm = enabled ? PM_FAST : PM_OFF; 2219 + /* Do not enable the power save after assoc if it is a p2p interface */ 2220 + if (ifp->vif->wdev.iftype == NL80211_IFTYPE_P2P_CLIENT) { 2221 + brcmf_dbg(INFO, "Do not enable power save for P2P clients\n"); 2222 + pm = PM_OFF; 2223 + } 2251 2224 brcmf_dbg(INFO, "power save %s\n", (pm ? "enabled" : "disabled")); 2252 2225 2253 2226 err = brcmf_fil_cmd_int_set(ifp, BRCMF_C_SET_PM, pm); ··· 3677 3640 } 3678 3641 3679 3642 static s32 3643 + brcmf_cfg80211_set_channel(struct brcmf_cfg80211_info *cfg, 3644 + struct brcmf_if *ifp, 3645 + struct ieee80211_channel *channel) 3646 + { 3647 + u16 chanspec; 3648 + s32 err; 3649 + 3650 + brcmf_dbg(TRACE, "band=%d, center_freq=%d\n", channel->band, 3651 + channel->center_freq); 3652 + 3653 + chanspec = channel_to_chanspec(&cfg->d11inf, channel); 3654 + err = brcmf_fil_iovar_int_set(ifp, "chanspec", chanspec); 3655 + 3656 + return err; 3657 + } 3658 + 3659 + static s32 3680 3660 brcmf_cfg80211_start_ap(struct wiphy *wiphy, struct net_device *ndev, 3681 3661 struct cfg80211_ap_settings *settings) 3682 3662 { 3683 3663 s32 ie_offset; 3664 + struct brcmf_cfg80211_info *cfg = wiphy_to_cfg(wiphy); 3684 3665 struct brcmf_if *ifp = netdev_priv(ndev); 3685 3666 struct brcmf_tlv *ssid_ie; 3686 3667 struct brcmf_ssid_le ssid_le; ··· 3738 3683 } 3739 3684 3740 3685 brcmf_set_mpc(ifp, 0); 3686 + brcmf_configure_arp_offload(ifp, false); 3741 3687 3742 3688 /* find the RSN_IE */ 3743 3689 rsn_ie = brcmf_parse_tlvs((u8 *)settings->beacon.tail, ··· 3768 3712 } 3769 3713 3770 3714 brcmf_config_ap_mgmt_ie(ifp->vif, &settings->beacon); 3715 + 3716 + err = brcmf_cfg80211_set_channel(cfg, ifp, settings->chandef.chan); 3717 + if (err < 0) { 3718 + brcmf_err("Set Channel failed, %d\n", err); 3719 + goto exit; 3720 + } 3771 3721 3772 3722 if (settings->beacon_interval) { 3773 3723 err = brcmf_fil_cmd_int_set(ifp, BRCMF_C_SET_BCNPRD, ··· 3851 3789 set_bit(BRCMF_VIF_STATUS_AP_CREATED, &ifp->vif->sme_state); 3852 3790 3853 3791 exit: 3854 - if (err) 3792 + if (err) { 3855 3793 brcmf_set_mpc(ifp, 1); 3794 + brcmf_configure_arp_offload(ifp, true); 3795 + } 3856 3796 return err; 3857 3797 } 3858 3798 ··· 3895 3831 brcmf_err("bss_enable config failed %d\n", err); 3896 3832 } 3897 3833 brcmf_set_mpc(ifp, 1); 3834 + brcmf_configure_arp_offload(ifp, true); 3898 3835 set_bit(BRCMF_VIF_STATUS_AP_CREATING, &ifp->vif->sme_state); 3899 3836 clear_bit(BRCMF_VIF_STATUS_AP_CREATED, &ifp->vif->sme_state); 3900 3837 ··· 4205 4140 .types = BIT(NL80211_IFTYPE_P2P_CLIENT) | 4206 4141 BIT(NL80211_IFTYPE_P2P_GO) 4207 4142 }, 4143 + { 4144 + .max = 1, 4145 + .types = BIT(NL80211_IFTYPE_P2P_DEVICE) 4146 + } 4208 4147 }; 4209 4148 static const struct ieee80211_iface_combination brcmf_iface_combos[] = { 4210 4149 { 4211 4150 .max_interfaces = BRCMF_IFACE_MAX_CNT, 4212 - .num_different_channels = 1, /* no multi-channel for now */ 4151 + .num_different_channels = 2, 4213 4152 .n_limits = ARRAY_SIZE(brcmf_iface_limits), 4214 4153 .limits = brcmf_iface_limits 4215 4154 } ··· 4266 4197 BIT(NL80211_IFTYPE_ADHOC) | 4267 4198 BIT(NL80211_IFTYPE_AP) | 4268 4199 BIT(NL80211_IFTYPE_P2P_CLIENT) | 4269 - BIT(NL80211_IFTYPE_P2P_GO); 4200 + BIT(NL80211_IFTYPE_P2P_GO) | 4201 + BIT(NL80211_IFTYPE_P2P_DEVICE); 4270 4202 wiphy->iface_combinations = brcmf_iface_combos; 4271 4203 wiphy->n_iface_combinations = ARRAY_SIZE(brcmf_iface_combos); 4272 4204 wiphy->bands[IEEE80211_BAND_2GHZ] = &__wl_band_2ghz; ··· 4321 4251 return vif; 4322 4252 } 4323 4253 4324 - void brcmf_free_vif(struct brcmf_cfg80211_vif *vif) 4254 + void brcmf_free_vif(struct brcmf_cfg80211_info *cfg, 4255 + struct brcmf_cfg80211_vif *vif) 4325 4256 { 4326 - struct brcmf_cfg80211_info *cfg; 4327 - struct wiphy *wiphy; 4328 - 4329 - wiphy = vif->wdev.wiphy; 4330 - cfg = wiphy_priv(wiphy); 4331 4257 list_del(&vif->list); 4332 4258 cfg->vif_cnt--; 4333 4259 4334 4260 kfree(vif); 4335 4261 if (!cfg->vif_cnt) { 4336 - wiphy_unregister(wiphy); 4337 - wiphy_free(wiphy); 4262 + wiphy_unregister(cfg->wiphy); 4263 + wiphy_free(cfg->wiphy); 4338 4264 } 4339 4265 } 4340 4266 ··· 4707 4641 return 0; 4708 4642 4709 4643 case BRCMF_E_IF_DEL: 4710 - ifp->vif = NULL; 4711 4644 mutex_unlock(&event->vif_event_lock); 4712 4645 /* event may not be upon user request */ 4713 4646 if (brcmf_cfg80211_vif_event_armed(cfg)) ··· 4912 4847 wl_deinit_priv(cfg); 4913 4848 4914 4849 cfg80211_attach_out: 4915 - brcmf_free_vif(vif); 4916 - wiphy_free(wiphy); 4850 + brcmf_free_vif(cfg, vif); 4917 4851 return NULL; 4918 4852 } 4919 4853 ··· 4924 4860 wl_deinit_priv(cfg); 4925 4861 brcmf_btcoex_detach(cfg); 4926 4862 list_for_each_entry_safe(vif, tmp, &cfg->vif_list, list) { 4927 - brcmf_free_vif(vif); 4863 + brcmf_free_vif(cfg, vif); 4928 4864 } 4929 4865 } 4930 4866 ··· 5287 5223 err = brcmf_dongle_probecap(cfg); 5288 5224 if (err) 5289 5225 goto default_conf_out; 5226 + 5227 + brcmf_configure_arp_offload(ifp, true); 5290 5228 5291 5229 cfg->dongle_up = true; 5292 5230 default_conf_out:
+2 -1
drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.h
··· 487 487 struct brcmf_cfg80211_vif *brcmf_alloc_vif(struct brcmf_cfg80211_info *cfg, 488 488 enum nl80211_iftype type, 489 489 bool pm_block); 490 - void brcmf_free_vif(struct brcmf_cfg80211_vif *vif); 490 + void brcmf_free_vif(struct brcmf_cfg80211_info *cfg, 491 + struct brcmf_cfg80211_vif *vif); 491 492 492 493 s32 brcmf_vif_set_mgmt_ie(struct brcmf_cfg80211_vif *vif, s32 pktflag, 493 494 const u8 *vndr_ie_buf, u32 vndr_ie_len);
+1 -1
drivers/net/wireless/iwlegacy/common.c
··· 1423 1423 } 1424 1424 EXPORT_SYMBOL(il_setup_rx_scan_handlers); 1425 1425 1426 - inline u16 1426 + u16 1427 1427 il_get_active_dwell_time(struct il_priv *il, enum ieee80211_band band, 1428 1428 u8 n_probes) 1429 1429 {
+3 -3
drivers/net/wireless/iwlegacy/common.h
··· 1832 1832 __le32 il_add_beacon_time(struct il_priv *il, u32 base, u32 addon, 1833 1833 u32 beacon_interval); 1834 1834 1835 - #ifdef CONFIG_PM 1835 + #ifdef CONFIG_PM_SLEEP 1836 1836 extern const struct dev_pm_ops il_pm_ops; 1837 1837 1838 1838 #define IL_LEGACY_PM_OPS (&il_pm_ops) 1839 1839 1840 - #else /* !CONFIG_PM */ 1840 + #else /* !CONFIG_PM_SLEEP */ 1841 1841 1842 1842 #define IL_LEGACY_PM_OPS NULL 1843 1843 1844 - #endif /* !CONFIG_PM */ 1844 + #endif /* !CONFIG_PM_SLEEP */ 1845 1845 1846 1846 /***************************************************** 1847 1847 * Error Handling Debugging
+17 -5
drivers/net/wireless/mwifiex/debugfs.c
··· 26 26 static struct dentry *mwifiex_dfs_dir; 27 27 28 28 static char *bss_modes[] = { 29 - "Unknown", 30 - "Ad-hoc", 31 - "Managed", 32 - "Auto" 29 + "UNSPECIFIED", 30 + "ADHOC", 31 + "STATION", 32 + "AP", 33 + "AP_VLAN", 34 + "WDS", 35 + "MONITOR", 36 + "MESH_POINT", 37 + "P2P_CLIENT", 38 + "P2P_GO", 39 + "P2P_DEVICE", 33 40 }; 34 41 35 42 /* size/addr for mwifiex_debug_info */ ··· 207 200 p += sprintf(p, "driver_version = %s", fmt); 208 201 p += sprintf(p, "\nverext = %s", priv->version_str); 209 202 p += sprintf(p, "\ninterface_name=\"%s\"\n", netdev->name); 210 - p += sprintf(p, "bss_mode=\"%s\"\n", bss_modes[info.bss_mode]); 203 + 204 + if (info.bss_mode >= ARRAY_SIZE(bss_modes)) 205 + p += sprintf(p, "bss_mode=\"%d\"\n", info.bss_mode); 206 + else 207 + p += sprintf(p, "bss_mode=\"%s\"\n", bss_modes[info.bss_mode]); 208 + 211 209 p += sprintf(p, "media_state=\"%s\"\n", 212 210 (!priv->media_connected ? "Disconnected" : "Connected")); 213 211 p += sprintf(p, "mac_address=\"%pM\"\n", netdev->dev_addr);
+1
drivers/net/wireless/rtlwifi/pci.c
··· 764 764 "can't alloc skb for rx\n"); 765 765 goto done; 766 766 } 767 + kmemleak_not_leak(new_skb); 767 768 768 769 pci_unmap_single(rtlpci->pdev, 769 770 *((dma_addr_t *) skb->cb),
+2 -2
drivers/net/wireless/rtlwifi/rtl8188ee/trx.h
··· 550 550 rxmcs == DESC92C_RATE11M) 551 551 552 552 struct phy_rx_agc_info_t { 553 - #if __LITTLE_ENDIAN 553 + #ifdef __LITTLE_ENDIAN 554 554 u8 gain:7, trsw:1; 555 555 #else 556 556 u8 trsw:1, gain:7; ··· 574 574 u8 stream_target_csi[2]; 575 575 u8 sig_evm; 576 576 u8 rsvd_3; 577 - #if __LITTLE_ENDIAN 577 + #ifdef __LITTLE_ENDIAN 578 578 u8 antsel_rx_keep_2:1; /*ex_intf_flg:1;*/ 579 579 u8 sgi_en:1; 580 580 u8 rxsc:2;
+99 -33
drivers/net/wireless/rtlwifi/rtl8192cu/hw.c
··· 1973 1973 } 1974 1974 } 1975 1975 1976 - void rtl92cu_update_hal_rate_table(struct ieee80211_hw *hw, 1977 - struct ieee80211_sta *sta, 1978 - u8 rssi_level) 1976 + static void rtl92cu_update_hal_rate_table(struct ieee80211_hw *hw, 1977 + struct ieee80211_sta *sta) 1979 1978 { 1980 1979 struct rtl_priv *rtlpriv = rtl_priv(hw); 1981 1980 struct rtl_phy *rtlphy = &(rtlpriv->phy); 1982 1981 struct rtl_mac *mac = rtl_mac(rtl_priv(hw)); 1983 - u32 ratr_value = (u32) mac->basic_rates; 1984 - u8 *mcsrate = mac->mcs; 1982 + struct rtl_hal *rtlhal = rtl_hal(rtl_priv(hw)); 1983 + u32 ratr_value; 1985 1984 u8 ratr_index = 0; 1986 1985 u8 nmode = mac->ht_enable; 1987 - u8 mimo_ps = 1; 1988 - u16 shortgi_rate = 0; 1989 - u32 tmp_ratr_value = 0; 1986 + u8 mimo_ps = IEEE80211_SMPS_OFF; 1987 + u16 shortgi_rate; 1988 + u32 tmp_ratr_value; 1990 1989 u8 curtxbw_40mhz = mac->bw_40; 1991 - u8 curshortgi_40mhz = mac->sgi_40; 1992 - u8 curshortgi_20mhz = mac->sgi_20; 1990 + u8 curshortgi_40mhz = (sta->ht_cap.cap & IEEE80211_HT_CAP_SGI_40) ? 1991 + 1 : 0; 1992 + u8 curshortgi_20mhz = (sta->ht_cap.cap & IEEE80211_HT_CAP_SGI_20) ? 1993 + 1 : 0; 1993 1994 enum wireless_mode wirelessmode = mac->mode; 1994 1995 1995 - ratr_value |= ((*(u16 *) (mcsrate))) << 12; 1996 + if (rtlhal->current_bandtype == BAND_ON_5G) 1997 + ratr_value = sta->supp_rates[1] << 4; 1998 + else 1999 + ratr_value = sta->supp_rates[0]; 2000 + if (mac->opmode == NL80211_IFTYPE_ADHOC) 2001 + ratr_value = 0xfff; 2002 + 2003 + ratr_value |= (sta->ht_cap.mcs.rx_mask[1] << 20 | 2004 + sta->ht_cap.mcs.rx_mask[0] << 12); 1996 2005 switch (wirelessmode) { 1997 2006 case WIRELESS_MODE_B: 1998 2007 if (ratr_value & 0x0000000c) ··· 2015 2006 case WIRELESS_MODE_N_24G: 2016 2007 case WIRELESS_MODE_N_5G: 2017 2008 nmode = 1; 2018 - if (mimo_ps == 0) { 2009 + if (mimo_ps == IEEE80211_SMPS_STATIC) { 2019 2010 ratr_value &= 0x0007F005; 2020 2011 } else { 2021 2012 u32 ratr_mask; ··· 2025 2016 ratr_mask = 0x000ff005; 2026 2017 else 2027 2018 ratr_mask = 0x0f0ff005; 2028 - if (curtxbw_40mhz) 2029 - ratr_mask |= 0x00000010; 2019 + 2030 2020 ratr_value &= ratr_mask; 2031 2021 } 2032 2022 break; ··· 2034 2026 ratr_value &= 0x000ff0ff; 2035 2027 else 2036 2028 ratr_value &= 0x0f0ff0ff; 2029 + 2037 2030 break; 2038 2031 } 2032 + 2039 2033 ratr_value &= 0x0FFFFFFF; 2040 - if (nmode && ((curtxbw_40mhz && curshortgi_40mhz) || 2041 - (!curtxbw_40mhz && curshortgi_20mhz))) { 2034 + 2035 + if (nmode && ((curtxbw_40mhz && 2036 + curshortgi_40mhz) || (!curtxbw_40mhz && 2037 + curshortgi_20mhz))) { 2038 + 2042 2039 ratr_value |= 0x10000000; 2043 2040 tmp_ratr_value = (ratr_value >> 12); 2041 + 2044 2042 for (shortgi_rate = 15; shortgi_rate > 0; shortgi_rate--) { 2045 2043 if ((1 << shortgi_rate) & tmp_ratr_value) 2046 2044 break; 2047 2045 } 2046 + 2048 2047 shortgi_rate = (shortgi_rate << 12) | (shortgi_rate << 8) | 2049 - (shortgi_rate << 4) | (shortgi_rate); 2048 + (shortgi_rate << 4) | (shortgi_rate); 2050 2049 } 2050 + 2051 2051 rtl_write_dword(rtlpriv, REG_ARFR0 + ratr_index * 4, ratr_value); 2052 + 2053 + RT_TRACE(rtlpriv, COMP_RATR, DBG_DMESG, "%x\n", 2054 + rtl_read_dword(rtlpriv, REG_ARFR0)); 2052 2055 } 2053 2056 2054 - void rtl92cu_update_hal_rate_mask(struct ieee80211_hw *hw, u8 rssi_level) 2057 + static void rtl92cu_update_hal_rate_mask(struct ieee80211_hw *hw, 2058 + struct ieee80211_sta *sta, 2059 + u8 rssi_level) 2055 2060 { 2056 2061 struct rtl_priv *rtlpriv = rtl_priv(hw); 2057 2062 struct rtl_phy *rtlphy = &(rtlpriv->phy); 2058 2063 struct rtl_mac *mac = rtl_mac(rtl_priv(hw)); 2059 - u32 ratr_bitmap = (u32) mac->basic_rates; 2060 - u8 *p_mcsrate = mac->mcs; 2061 - u8 ratr_index = 0; 2062 - u8 curtxbw_40mhz = mac->bw_40; 2063 - u8 curshortgi_40mhz = mac->sgi_40; 2064 - u8 curshortgi_20mhz = mac->sgi_20; 2065 - enum wireless_mode wirelessmode = mac->mode; 2064 + struct rtl_hal *rtlhal = rtl_hal(rtl_priv(hw)); 2065 + struct rtl_sta_info *sta_entry = NULL; 2066 + u32 ratr_bitmap; 2067 + u8 ratr_index; 2068 + u8 curtxbw_40mhz = (sta->bandwidth >= IEEE80211_STA_RX_BW_40) ? 1 : 0; 2069 + u8 curshortgi_40mhz = curtxbw_40mhz && 2070 + (sta->ht_cap.cap & IEEE80211_HT_CAP_SGI_40) ? 2071 + 1 : 0; 2072 + u8 curshortgi_20mhz = (sta->ht_cap.cap & IEEE80211_HT_CAP_SGI_20) ? 2073 + 1 : 0; 2074 + enum wireless_mode wirelessmode = 0; 2066 2075 bool shortgi = false; 2067 2076 u8 rate_mask[5]; 2068 2077 u8 macid = 0; 2069 - u8 mimops = 1; 2078 + u8 mimo_ps = IEEE80211_SMPS_OFF; 2070 2079 2071 - ratr_bitmap |= (p_mcsrate[1] << 20) | (p_mcsrate[0] << 12); 2080 + sta_entry = (struct rtl_sta_info *) sta->drv_priv; 2081 + wirelessmode = sta_entry->wireless_mode; 2082 + if (mac->opmode == NL80211_IFTYPE_STATION || 2083 + mac->opmode == NL80211_IFTYPE_MESH_POINT) 2084 + curtxbw_40mhz = mac->bw_40; 2085 + else if (mac->opmode == NL80211_IFTYPE_AP || 2086 + mac->opmode == NL80211_IFTYPE_ADHOC) 2087 + macid = sta->aid + 1; 2088 + 2089 + if (rtlhal->current_bandtype == BAND_ON_5G) 2090 + ratr_bitmap = sta->supp_rates[1] << 4; 2091 + else 2092 + ratr_bitmap = sta->supp_rates[0]; 2093 + if (mac->opmode == NL80211_IFTYPE_ADHOC) 2094 + ratr_bitmap = 0xfff; 2095 + ratr_bitmap |= (sta->ht_cap.mcs.rx_mask[1] << 20 | 2096 + sta->ht_cap.mcs.rx_mask[0] << 12); 2072 2097 switch (wirelessmode) { 2073 2098 case WIRELESS_MODE_B: 2074 2099 ratr_index = RATR_INX_WIRELESS_B; ··· 2112 2071 break; 2113 2072 case WIRELESS_MODE_G: 2114 2073 ratr_index = RATR_INX_WIRELESS_GB; 2074 + 2115 2075 if (rssi_level == 1) 2116 2076 ratr_bitmap &= 0x00000f00; 2117 2077 else if (rssi_level == 2) ··· 2127 2085 case WIRELESS_MODE_N_24G: 2128 2086 case WIRELESS_MODE_N_5G: 2129 2087 ratr_index = RATR_INX_WIRELESS_NGB; 2130 - if (mimops == 0) { 2088 + 2089 + if (mimo_ps == IEEE80211_SMPS_STATIC) { 2131 2090 if (rssi_level == 1) 2132 2091 ratr_bitmap &= 0x00070000; 2133 2092 else if (rssi_level == 2) ··· 2171 2128 } 2172 2129 } 2173 2130 } 2131 + 2174 2132 if ((curtxbw_40mhz && curshortgi_40mhz) || 2175 2133 (!curtxbw_40mhz && curshortgi_20mhz)) { 2134 + 2176 2135 if (macid == 0) 2177 2136 shortgi = true; 2178 2137 else if (macid == 1) ··· 2183 2138 break; 2184 2139 default: 2185 2140 ratr_index = RATR_INX_WIRELESS_NGB; 2141 + 2186 2142 if (rtlphy->rf_type == RF_1T2R) 2187 2143 ratr_bitmap &= 0x000ff0ff; 2188 2144 else 2189 2145 ratr_bitmap &= 0x0f0ff0ff; 2190 2146 break; 2191 2147 } 2192 - RT_TRACE(rtlpriv, COMP_RATR, DBG_DMESG, "ratr_bitmap :%x\n", 2193 - ratr_bitmap); 2194 - *(u32 *)&rate_mask = ((ratr_bitmap & 0x0fffffff) | 2195 - ratr_index << 28); 2148 + sta_entry->ratr_index = ratr_index; 2149 + 2150 + RT_TRACE(rtlpriv, COMP_RATR, DBG_DMESG, 2151 + "ratr_bitmap :%x\n", ratr_bitmap); 2152 + *(u32 *)&rate_mask = (ratr_bitmap & 0x0fffffff) | 2153 + (ratr_index << 28); 2196 2154 rate_mask[4] = macid | (shortgi ? 0x20 : 0x00) | 0x80; 2197 2155 RT_TRACE(rtlpriv, COMP_RATR, DBG_DMESG, 2198 2156 "Rate_index:%x, ratr_val:%x, %5phC\n", 2199 2157 ratr_index, ratr_bitmap, rate_mask); 2200 - rtl92c_fill_h2c_cmd(hw, H2C_RA_MASK, 5, rate_mask); 2158 + memcpy(rtlpriv->rate_mask, rate_mask, 5); 2159 + /* rtl92c_fill_h2c_cmd() does USB I/O and will result in a 2160 + * "scheduled while atomic" if called directly */ 2161 + schedule_work(&rtlpriv->works.fill_h2c_cmd); 2162 + 2163 + if (macid != 0) 2164 + sta_entry->ratr_index = ratr_index; 2165 + } 2166 + 2167 + void rtl92cu_update_hal_rate_tbl(struct ieee80211_hw *hw, 2168 + struct ieee80211_sta *sta, 2169 + u8 rssi_level) 2170 + { 2171 + struct rtl_priv *rtlpriv = rtl_priv(hw); 2172 + 2173 + if (rtlpriv->dm.useramask) 2174 + rtl92cu_update_hal_rate_mask(hw, sta, rssi_level); 2175 + else 2176 + rtl92cu_update_hal_rate_table(hw, sta); 2201 2177 } 2202 2178 2203 2179 void rtl92cu_update_channel_access_setting(struct ieee80211_hw *hw)
-4
drivers/net/wireless/rtlwifi/rtl8192cu/hw.h
··· 98 98 u32 add_msr, u32 rm_msr); 99 99 void rtl92cu_get_hw_reg(struct ieee80211_hw *hw, u8 variable, u8 *val); 100 100 void rtl92cu_set_hw_reg(struct ieee80211_hw *hw, u8 variable, u8 *val); 101 - void rtl92cu_update_hal_rate_table(struct ieee80211_hw *hw, 102 - struct ieee80211_sta *sta, 103 - u8 rssi_level); 104 - void rtl92cu_update_hal_rate_mask(struct ieee80211_hw *hw, u8 rssi_level); 105 101 106 102 void rtl92cu_update_channel_access_setting(struct ieee80211_hw *hw); 107 103 bool rtl92cu_gpio_radio_on_off_checking(struct ieee80211_hw *hw, u8 * valid);
+17 -1
drivers/net/wireless/rtlwifi/rtl8192cu/mac.c
··· 289 289 macaddr = cam_const_broad; 290 290 entry_id = key_index; 291 291 } else { 292 + if (mac->opmode == NL80211_IFTYPE_AP || 293 + mac->opmode == NL80211_IFTYPE_MESH_POINT) { 294 + entry_id = rtl_cam_get_free_entry(hw, 295 + p_macaddr); 296 + if (entry_id >= TOTAL_CAM_ENTRY) { 297 + RT_TRACE(rtlpriv, COMP_SEC, 298 + DBG_EMERG, 299 + "Can not find free hw security cam entry\n"); 300 + return; 301 + } 302 + } else { 303 + entry_id = CAM_PAIRWISE_KEY_POSITION; 304 + } 305 + 292 306 key_index = PAIRWISE_KEYIDX; 293 - entry_id = CAM_PAIRWISE_KEY_POSITION; 294 307 is_pairwise = true; 295 308 } 296 309 } 297 310 if (rtlpriv->sec.key_len[key_index] == 0) { 298 311 RT_TRACE(rtlpriv, COMP_SEC, DBG_DMESG, 299 312 "delete one entry\n"); 313 + if (mac->opmode == NL80211_IFTYPE_AP || 314 + mac->opmode == NL80211_IFTYPE_MESH_POINT) 315 + rtl_cam_del_entry(hw, p_macaddr); 300 316 rtl_cam_delete_one_entry(hw, p_macaddr, entry_id); 301 317 } else { 302 318 RT_TRACE(rtlpriv, COMP_SEC, DBG_LOUD,
+3 -2
drivers/net/wireless/rtlwifi/rtl8192cu/sw.c
··· 106 106 .update_interrupt_mask = rtl92cu_update_interrupt_mask, 107 107 .get_hw_reg = rtl92cu_get_hw_reg, 108 108 .set_hw_reg = rtl92cu_set_hw_reg, 109 - .update_rate_tbl = rtl92cu_update_hal_rate_table, 110 - .update_rate_mask = rtl92cu_update_hal_rate_mask, 109 + .update_rate_tbl = rtl92cu_update_hal_rate_tbl, 111 110 .fill_tx_desc = rtl92cu_tx_fill_desc, 112 111 .fill_fake_txdesc = rtl92cu_fill_fake_txdesc, 113 112 .fill_tx_cmddesc = rtl92cu_tx_fill_cmddesc, ··· 136 137 .phy_lc_calibrate = _rtl92cu_phy_lc_calibrate, 137 138 .phy_set_bw_mode_callback = rtl92cu_phy_set_bw_mode_callback, 138 139 .dm_dynamic_txpower = rtl92cu_dm_dynamic_txpower, 140 + .fill_h2c_cmd = rtl92c_fill_h2c_cmd, 139 141 }; 140 142 141 143 static struct rtl_mod_params rtl92cu_mod_params = { ··· 349 349 {RTL_USB_DEVICE(0x07aa, 0x0056, rtl92cu_hal_cfg)}, /*ATKK-Gemtek*/ 350 350 {RTL_USB_DEVICE(0x07b8, 0x8178, rtl92cu_hal_cfg)}, /*Funai -Abocom*/ 351 351 {RTL_USB_DEVICE(0x0846, 0x9021, rtl92cu_hal_cfg)}, /*Netgear-Sercomm*/ 352 + {RTL_USB_DEVICE(0x0846, 0xf001, rtl92cu_hal_cfg)}, /*On Netwrks N300MA*/ 352 353 {RTL_USB_DEVICE(0x0b05, 0x17ab, rtl92cu_hal_cfg)}, /*ASUS-Edimax*/ 353 354 {RTL_USB_DEVICE(0x0bda, 0x8186, rtl92cu_hal_cfg)}, /*Realtek 92CE-VAU*/ 354 355 {RTL_USB_DEVICE(0x0df6, 0x0061, rtl92cu_hal_cfg)}, /*Sitecom-Edimax*/
+3
drivers/net/wireless/rtlwifi/rtl8192cu/sw.h
··· 49 49 u32 rtl92cu_phy_query_rf_reg(struct ieee80211_hw *hw, 50 50 enum radio_path rfpath, u32 regaddr, u32 bitmask); 51 51 void rtl92cu_phy_set_bw_mode_callback(struct ieee80211_hw *hw); 52 + void rtl92cu_update_hal_rate_tbl(struct ieee80211_hw *hw, 53 + struct ieee80211_sta *sta, 54 + u8 rssi_level); 52 55 53 56 #endif
+13
drivers/net/wireless/rtlwifi/usb.c
··· 824 824 825 825 /* should after adapter start and interrupt enable. */ 826 826 set_hal_stop(rtlhal); 827 + cancel_work_sync(&rtlpriv->works.fill_h2c_cmd); 827 828 /* Enable software */ 828 829 SET_USB_STOP(rtlusb); 829 830 rtl_usb_deinit(hw); ··· 1027 1026 return false; 1028 1027 } 1029 1028 1029 + static void rtl_fill_h2c_cmd_work_callback(struct work_struct *work) 1030 + { 1031 + struct rtl_works *rtlworks = 1032 + container_of(work, struct rtl_works, fill_h2c_cmd); 1033 + struct ieee80211_hw *hw = rtlworks->hw; 1034 + struct rtl_priv *rtlpriv = rtl_priv(hw); 1035 + 1036 + rtlpriv->cfg->ops->fill_h2c_cmd(hw, H2C_RA_MASK, 5, rtlpriv->rate_mask); 1037 + } 1038 + 1030 1039 static struct rtl_intf_ops rtl_usb_ops = { 1031 1040 .adapter_start = rtl_usb_start, 1032 1041 .adapter_stop = rtl_usb_stop, ··· 1068 1057 1069 1058 /* this spin lock must be initialized early */ 1070 1059 spin_lock_init(&rtlpriv->locks.usb_lock); 1060 + INIT_WORK(&rtlpriv->works.fill_h2c_cmd, 1061 + rtl_fill_h2c_cmd_work_callback); 1071 1062 1072 1063 rtlpriv->usb_data_index = 0; 1073 1064 init_completion(&rtlpriv->firmware_loading_complete);
+4
drivers/net/wireless/rtlwifi/wifi.h
··· 1736 1736 void (*bt_wifi_media_status_notify) (struct ieee80211_hw *hw, 1737 1737 bool mstate); 1738 1738 void (*bt_coex_off_before_lps) (struct ieee80211_hw *hw); 1739 + void (*fill_h2c_cmd) (struct ieee80211_hw *hw, u8 element_id, 1740 + u32 cmd_len, u8 *p_cmdbuffer); 1739 1741 }; 1740 1742 1741 1743 struct rtl_intf_ops { ··· 1871 1869 struct delayed_work fwevt_wq; 1872 1870 1873 1871 struct work_struct lps_change_work; 1872 + struct work_struct fill_h2c_cmd; 1874 1873 }; 1875 1874 1876 1875 struct rtl_debug { ··· 2051 2048 }; 2052 2049 }; 2053 2050 bool enter_ps; /* true when entering PS */ 2051 + u8 rate_mask[5]; 2054 2052 2055 2053 /*This must be the last item so 2056 2054 that it points to the data allocated
+1 -1
drivers/net/wireless/ti/wl12xx/scan.c
··· 310 310 memcpy(cmd->channels_2, cmd_channels->channels_2, 311 311 sizeof(cmd->channels_2)); 312 312 memcpy(cmd->channels_5, cmd_channels->channels_5, 313 - sizeof(cmd->channels_2)); 313 + sizeof(cmd->channels_5)); 314 314 /* channels_4 are not supported, so no need to copy them */ 315 315 } 316 316
+3 -3
drivers/net/wireless/ti/wl12xx/wl12xx.h
··· 36 36 #define WL127X_IFTYPE_SR_VER 3 37 37 #define WL127X_MAJOR_SR_VER 10 38 38 #define WL127X_SUBTYPE_SR_VER WLCORE_FW_VER_IGNORE 39 - #define WL127X_MINOR_SR_VER 115 39 + #define WL127X_MINOR_SR_VER 133 40 40 /* minimum multi-role FW version for wl127x */ 41 41 #define WL127X_IFTYPE_MR_VER 5 42 42 #define WL127X_MAJOR_MR_VER 7 43 43 #define WL127X_SUBTYPE_MR_VER WLCORE_FW_VER_IGNORE 44 - #define WL127X_MINOR_MR_VER 115 44 + #define WL127X_MINOR_MR_VER 42 45 45 46 46 /* FW chip version for wl128x */ 47 47 #define WL128X_CHIP_VER 7 ··· 49 49 #define WL128X_IFTYPE_SR_VER 3 50 50 #define WL128X_MAJOR_SR_VER 10 51 51 #define WL128X_SUBTYPE_SR_VER WLCORE_FW_VER_IGNORE 52 - #define WL128X_MINOR_SR_VER 115 52 + #define WL128X_MINOR_SR_VER 133 53 53 /* minimum multi-role FW version for wl128x */ 54 54 #define WL128X_IFTYPE_MR_VER 5 55 55 #define WL128X_MAJOR_MR_VER 7
+1 -1
drivers/net/wireless/ti/wl18xx/scan.c
··· 34 34 memcpy(cmd->channels_2, cmd_channels->channels_2, 35 35 sizeof(cmd->channels_2)); 36 36 memcpy(cmd->channels_5, cmd_channels->channels_5, 37 - sizeof(cmd->channels_2)); 37 + sizeof(cmd->channels_5)); 38 38 /* channels_4 are not supported, so no need to copy them */ 39 39 } 40 40
+1 -1
drivers/nfc/Kconfig
··· 28 28 29 29 config NFC_MEI_PHY 30 30 tristate "MEI bus NFC device support" 31 - depends on INTEL_MEI_BUS_NFC && NFC_HCI 31 + depends on INTEL_MEI && NFC_HCI 32 32 help 33 33 This adds support to use an mei bus nfc device. Select this if you 34 34 will use an HCI NFC driver for an NFC chip connected behind an
+9
drivers/nfc/mei_phy.c
··· 64 64 return r; 65 65 } 66 66 67 + r = mei_cl_register_event_cb(phy->device, nfc_mei_event_cb, phy); 68 + if (r) { 69 + pr_err("MEY_PHY: Event cb registration failed\n"); 70 + mei_cl_disable_device(phy->device); 71 + phy->powered = 0; 72 + 73 + return r; 74 + } 75 + 67 76 phy->powered = 1; 68 77 69 78 return 0;
+5 -15
drivers/nfc/microread/mei.c
··· 43 43 return -ENOMEM; 44 44 } 45 45 46 - r = mei_cl_register_event_cb(device, nfc_mei_event_cb, phy); 47 - if (r) { 48 - pr_err(MICROREAD_DRIVER_NAME ": event cb registration failed\n"); 49 - goto err_out; 50 - } 51 - 52 46 r = microread_probe(phy, &mei_phy_ops, LLC_NOP_NAME, 53 47 MEI_NFC_HEADER_SIZE, 0, MEI_NFC_MAX_HCI_PAYLOAD, 54 48 &phy->hdev); 55 - if (r < 0) 56 - goto err_out; 49 + if (r < 0) { 50 + nfc_mei_phy_free(phy); 51 + 52 + return r; 53 + } 57 54 58 55 return 0; 59 - 60 - err_out: 61 - nfc_mei_phy_free(phy); 62 - 63 - return r; 64 56 } 65 57 66 58 static int microread_mei_remove(struct mei_cl_device *device) ··· 62 70 pr_info("Removing microread\n"); 63 71 64 72 microread_remove(phy->hdev); 65 - 66 - nfc_mei_phy_disable(phy); 67 73 68 74 nfc_mei_phy_free(phy); 69 75
+5 -15
drivers/nfc/pn544/mei.c
··· 43 43 return -ENOMEM; 44 44 } 45 45 46 - r = mei_cl_register_event_cb(device, nfc_mei_event_cb, phy); 47 - if (r) { 48 - pr_err(PN544_DRIVER_NAME ": event cb registration failed\n"); 49 - goto err_out; 50 - } 51 - 52 46 r = pn544_hci_probe(phy, &mei_phy_ops, LLC_NOP_NAME, 53 47 MEI_NFC_HEADER_SIZE, 0, MEI_NFC_MAX_HCI_PAYLOAD, 54 48 &phy->hdev); 55 - if (r < 0) 56 - goto err_out; 49 + if (r < 0) { 50 + nfc_mei_phy_free(phy); 51 + 52 + return r; 53 + } 57 54 58 55 return 0; 59 - 60 - err_out: 61 - nfc_mei_phy_free(phy); 62 - 63 - return r; 64 56 } 65 57 66 58 static int pn544_mei_remove(struct mei_cl_device *device) ··· 62 70 pr_info("Removing pn544\n"); 63 71 64 72 pn544_hci_remove(phy->hdev); 65 - 66 - nfc_mei_phy_disable(phy); 67 73 68 74 nfc_mei_phy_free(phy); 69 75
+4 -1
include/linux/bcma/bcma.h
··· 134 134 #define BCMA_CORE_I2S 0x834 135 135 #define BCMA_CORE_SDR_DDR1_MEM_CTL 0x835 /* SDR/DDR1 memory controller core */ 136 136 #define BCMA_CORE_SHIM 0x837 /* SHIM component in ubus/6362 */ 137 - #define BCMA_CORE_ARM_CR4 0x83e 137 + #define BCMA_CORE_PHY_AC 0x83B 138 + #define BCMA_CORE_PCIE2 0x83C /* PCI Express Gen2 */ 139 + #define BCMA_CORE_USB30_DEV 0x83D 140 + #define BCMA_CORE_ARM_CR4 0x83E 138 141 #define BCMA_CORE_DEFAULT 0xFFF 139 142 140 143 #define BCMA_MAX_NR_CORES 16
+1
include/net/bluetooth/hci_core.h
··· 1117 1117 int mgmt_control(struct sock *sk, struct msghdr *msg, size_t len); 1118 1118 int mgmt_index_added(struct hci_dev *hdev); 1119 1119 int mgmt_index_removed(struct hci_dev *hdev); 1120 + int mgmt_set_powered_failed(struct hci_dev *hdev, int err); 1120 1121 int mgmt_powered(struct hci_dev *hdev, u8 powered); 1121 1122 int mgmt_discoverable(struct hci_dev *hdev, u8 discoverable); 1122 1123 int mgmt_connectable(struct hci_dev *hdev, u8 connectable);
+1
include/net/bluetooth/mgmt.h
··· 42 42 #define MGMT_STATUS_NOT_POWERED 0x0f 43 43 #define MGMT_STATUS_CANCELLED 0x10 44 44 #define MGMT_STATUS_INVALID_INDEX 0x11 45 + #define MGMT_STATUS_RFKILLED 0x12 45 46 46 47 struct mgmt_hdr { 47 48 __le16 opcode;
+5 -1
net/bluetooth/hci_core.c
··· 1555 1555 static void hci_power_on(struct work_struct *work) 1556 1556 { 1557 1557 struct hci_dev *hdev = container_of(work, struct hci_dev, power_on); 1558 + int err; 1558 1559 1559 1560 BT_DBG("%s", hdev->name); 1560 1561 1561 - if (hci_dev_open(hdev->id) < 0) 1562 + err = hci_dev_open(hdev->id); 1563 + if (err < 0) { 1564 + mgmt_set_powered_failed(hdev, err); 1562 1565 return; 1566 + } 1563 1567 1564 1568 if (test_bit(HCI_AUTO_OFF, &hdev->dev_flags)) 1565 1569 queue_delayed_work(hdev->req_workqueue, &hdev->power_off,
+52 -18
net/bluetooth/l2cap_core.c
··· 3677 3677 } 3678 3678 3679 3679 static inline int l2cap_command_rej(struct l2cap_conn *conn, 3680 - struct l2cap_cmd_hdr *cmd, u8 *data) 3680 + struct l2cap_cmd_hdr *cmd, u16 cmd_len, 3681 + u8 *data) 3681 3682 { 3682 3683 struct l2cap_cmd_rej_unk *rej = (struct l2cap_cmd_rej_unk *) data; 3684 + 3685 + if (cmd_len < sizeof(*rej)) 3686 + return -EPROTO; 3683 3687 3684 3688 if (rej->reason != L2CAP_REJ_NOT_UNDERSTOOD) 3685 3689 return 0; ··· 3833 3829 } 3834 3830 3835 3831 static int l2cap_connect_req(struct l2cap_conn *conn, 3836 - struct l2cap_cmd_hdr *cmd, u8 *data) 3832 + struct l2cap_cmd_hdr *cmd, u16 cmd_len, u8 *data) 3837 3833 { 3838 3834 struct hci_dev *hdev = conn->hcon->hdev; 3839 3835 struct hci_conn *hcon = conn->hcon; 3836 + 3837 + if (cmd_len < sizeof(struct l2cap_conn_req)) 3838 + return -EPROTO; 3840 3839 3841 3840 hci_dev_lock(hdev); 3842 3841 if (test_bit(HCI_MGMT, &hdev->dev_flags) && ··· 3854 3847 } 3855 3848 3856 3849 static int l2cap_connect_create_rsp(struct l2cap_conn *conn, 3857 - struct l2cap_cmd_hdr *cmd, u8 *data) 3850 + struct l2cap_cmd_hdr *cmd, u16 cmd_len, 3851 + u8 *data) 3858 3852 { 3859 3853 struct l2cap_conn_rsp *rsp = (struct l2cap_conn_rsp *) data; 3860 3854 u16 scid, dcid, result, status; 3861 3855 struct l2cap_chan *chan; 3862 3856 u8 req[128]; 3863 3857 int err; 3858 + 3859 + if (cmd_len < sizeof(*rsp)) 3860 + return -EPROTO; 3864 3861 3865 3862 scid = __le16_to_cpu(rsp->scid); 3866 3863 dcid = __le16_to_cpu(rsp->dcid); ··· 3963 3952 struct l2cap_chan *chan; 3964 3953 int len, err = 0; 3965 3954 3955 + if (cmd_len < sizeof(*req)) 3956 + return -EPROTO; 3957 + 3966 3958 dcid = __le16_to_cpu(req->dcid); 3967 3959 flags = __le16_to_cpu(req->flags); 3968 3960 ··· 3989 3975 3990 3976 /* Reject if config buffer is too small. */ 3991 3977 len = cmd_len - sizeof(*req); 3992 - if (len < 0 || chan->conf_len + len > sizeof(chan->conf_req)) { 3978 + if (chan->conf_len + len > sizeof(chan->conf_req)) { 3993 3979 l2cap_send_cmd(conn, cmd->ident, L2CAP_CONF_RSP, 3994 3980 l2cap_build_conf_rsp(chan, rsp, 3995 3981 L2CAP_CONF_REJECT, flags), rsp); ··· 4067 4053 } 4068 4054 4069 4055 static inline int l2cap_config_rsp(struct l2cap_conn *conn, 4070 - struct l2cap_cmd_hdr *cmd, u8 *data) 4056 + struct l2cap_cmd_hdr *cmd, u16 cmd_len, 4057 + u8 *data) 4071 4058 { 4072 4059 struct l2cap_conf_rsp *rsp = (struct l2cap_conf_rsp *)data; 4073 4060 u16 scid, flags, result; 4074 4061 struct l2cap_chan *chan; 4075 - int len = le16_to_cpu(cmd->len) - sizeof(*rsp); 4062 + int len = cmd_len - sizeof(*rsp); 4076 4063 int err = 0; 4064 + 4065 + if (cmd_len < sizeof(*rsp)) 4066 + return -EPROTO; 4077 4067 4078 4068 scid = __le16_to_cpu(rsp->scid); 4079 4069 flags = __le16_to_cpu(rsp->flags); ··· 4179 4161 } 4180 4162 4181 4163 static inline int l2cap_disconnect_req(struct l2cap_conn *conn, 4182 - struct l2cap_cmd_hdr *cmd, u8 *data) 4164 + struct l2cap_cmd_hdr *cmd, u16 cmd_len, 4165 + u8 *data) 4183 4166 { 4184 4167 struct l2cap_disconn_req *req = (struct l2cap_disconn_req *) data; 4185 4168 struct l2cap_disconn_rsp rsp; 4186 4169 u16 dcid, scid; 4187 4170 struct l2cap_chan *chan; 4188 4171 struct sock *sk; 4172 + 4173 + if (cmd_len != sizeof(*req)) 4174 + return -EPROTO; 4189 4175 4190 4176 scid = __le16_to_cpu(req->scid); 4191 4177 dcid = __le16_to_cpu(req->dcid); ··· 4230 4208 } 4231 4209 4232 4210 static inline int l2cap_disconnect_rsp(struct l2cap_conn *conn, 4233 - struct l2cap_cmd_hdr *cmd, u8 *data) 4211 + struct l2cap_cmd_hdr *cmd, u16 cmd_len, 4212 + u8 *data) 4234 4213 { 4235 4214 struct l2cap_disconn_rsp *rsp = (struct l2cap_disconn_rsp *) data; 4236 4215 u16 dcid, scid; 4237 4216 struct l2cap_chan *chan; 4217 + 4218 + if (cmd_len != sizeof(*rsp)) 4219 + return -EPROTO; 4238 4220 4239 4221 scid = __le16_to_cpu(rsp->scid); 4240 4222 dcid = __le16_to_cpu(rsp->dcid); ··· 4269 4243 } 4270 4244 4271 4245 static inline int l2cap_information_req(struct l2cap_conn *conn, 4272 - struct l2cap_cmd_hdr *cmd, u8 *data) 4246 + struct l2cap_cmd_hdr *cmd, u16 cmd_len, 4247 + u8 *data) 4273 4248 { 4274 4249 struct l2cap_info_req *req = (struct l2cap_info_req *) data; 4275 4250 u16 type; 4251 + 4252 + if (cmd_len != sizeof(*req)) 4253 + return -EPROTO; 4276 4254 4277 4255 type = __le16_to_cpu(req->type); 4278 4256 ··· 4324 4294 } 4325 4295 4326 4296 static inline int l2cap_information_rsp(struct l2cap_conn *conn, 4327 - struct l2cap_cmd_hdr *cmd, u8 *data) 4297 + struct l2cap_cmd_hdr *cmd, u16 cmd_len, 4298 + u8 *data) 4328 4299 { 4329 4300 struct l2cap_info_rsp *rsp = (struct l2cap_info_rsp *) data; 4330 4301 u16 type, result; 4302 + 4303 + if (cmd_len != sizeof(*rsp)) 4304 + return -EPROTO; 4331 4305 4332 4306 type = __le16_to_cpu(rsp->type); 4333 4307 result = __le16_to_cpu(rsp->result); ··· 5198 5164 5199 5165 switch (cmd->code) { 5200 5166 case L2CAP_COMMAND_REJ: 5201 - l2cap_command_rej(conn, cmd, data); 5167 + l2cap_command_rej(conn, cmd, cmd_len, data); 5202 5168 break; 5203 5169 5204 5170 case L2CAP_CONN_REQ: 5205 - err = l2cap_connect_req(conn, cmd, data); 5171 + err = l2cap_connect_req(conn, cmd, cmd_len, data); 5206 5172 break; 5207 5173 5208 5174 case L2CAP_CONN_RSP: 5209 5175 case L2CAP_CREATE_CHAN_RSP: 5210 - err = l2cap_connect_create_rsp(conn, cmd, data); 5176 + err = l2cap_connect_create_rsp(conn, cmd, cmd_len, data); 5211 5177 break; 5212 5178 5213 5179 case L2CAP_CONF_REQ: ··· 5215 5181 break; 5216 5182 5217 5183 case L2CAP_CONF_RSP: 5218 - err = l2cap_config_rsp(conn, cmd, data); 5184 + err = l2cap_config_rsp(conn, cmd, cmd_len, data); 5219 5185 break; 5220 5186 5221 5187 case L2CAP_DISCONN_REQ: 5222 - err = l2cap_disconnect_req(conn, cmd, data); 5188 + err = l2cap_disconnect_req(conn, cmd, cmd_len, data); 5223 5189 break; 5224 5190 5225 5191 case L2CAP_DISCONN_RSP: 5226 - err = l2cap_disconnect_rsp(conn, cmd, data); 5192 + err = l2cap_disconnect_rsp(conn, cmd, cmd_len, data); 5227 5193 break; 5228 5194 5229 5195 case L2CAP_ECHO_REQ: ··· 5234 5200 break; 5235 5201 5236 5202 case L2CAP_INFO_REQ: 5237 - err = l2cap_information_req(conn, cmd, data); 5203 + err = l2cap_information_req(conn, cmd, cmd_len, data); 5238 5204 break; 5239 5205 5240 5206 case L2CAP_INFO_RSP: 5241 - err = l2cap_information_rsp(conn, cmd, data); 5207 + err = l2cap_information_rsp(conn, cmd, cmd_len, data); 5242 5208 break; 5243 5209 5244 5210 case L2CAP_CREATE_CHAN_REQ:
+22 -1
net/bluetooth/mgmt.c
··· 2700 2700 break; 2701 2701 2702 2702 case DISCOV_TYPE_LE: 2703 - if (!lmp_host_le_capable(hdev)) { 2703 + if (!test_bit(HCI_LE_ENABLED, &hdev->dev_flags)) { 2704 2704 err = cmd_status(sk, hdev->id, MGMT_OP_START_DISCOVERY, 2705 2705 MGMT_STATUS_NOT_SUPPORTED); 2706 2706 mgmt_pending_remove(cmd); ··· 3414 3414 3415 3415 if (match.sk) 3416 3416 sock_put(match.sk); 3417 + 3418 + return err; 3419 + } 3420 + 3421 + int mgmt_set_powered_failed(struct hci_dev *hdev, int err) 3422 + { 3423 + struct pending_cmd *cmd; 3424 + u8 status; 3425 + 3426 + cmd = mgmt_pending_find(MGMT_OP_SET_POWERED, hdev); 3427 + if (!cmd) 3428 + return -ENOENT; 3429 + 3430 + if (err == -ERFKILL) 3431 + status = MGMT_STATUS_RFKILLED; 3432 + else 3433 + status = MGMT_STATUS_FAILED; 3434 + 3435 + err = cmd_status(cmd->sk, hdev->id, MGMT_OP_SET_POWERED, status); 3436 + 3437 + mgmt_pending_remove(cmd); 3417 3438 3418 3439 return err; 3419 3440 }
+2 -2
net/bluetooth/smp.c
··· 770 770 771 771 BT_DBG("conn %p hcon %p level 0x%2.2x", conn, hcon, sec_level); 772 772 773 - if (!lmp_host_le_capable(hcon->hdev)) 773 + if (!test_bit(HCI_LE_ENABLED, &hcon->hdev->dev_flags)) 774 774 return 1; 775 775 776 776 if (sec_level == BT_SECURITY_LOW) ··· 851 851 __u8 reason; 852 852 int err = 0; 853 853 854 - if (!lmp_host_le_capable(conn->hcon->hdev)) { 854 + if (!test_bit(HCI_LE_ENABLED, &conn->hcon->hdev->dev_flags)) { 855 855 err = -ENOTSUPP; 856 856 reason = SMP_PAIRING_NOTSUPP; 857 857 goto done;
+21 -7
net/mac80211/iface.c
··· 159 159 return 0; 160 160 } 161 161 162 - static int ieee80211_verify_mac(struct ieee80211_local *local, u8 *addr, 162 + static int ieee80211_verify_mac(struct ieee80211_sub_if_data *sdata, u8 *addr, 163 163 bool check_dup) 164 164 { 165 - struct ieee80211_sub_if_data *sdata; 165 + struct ieee80211_local *local = sdata->local; 166 + struct ieee80211_sub_if_data *iter; 166 167 u64 new, mask, tmp; 167 168 u8 *m; 168 169 int ret = 0; ··· 185 184 return ret; 186 185 187 186 mutex_lock(&local->iflist_mtx); 188 - list_for_each_entry(sdata, &local->interfaces, list) { 189 - if (sdata->vif.type == NL80211_IFTYPE_MONITOR && 190 - !(sdata->u.mntr_flags & MONITOR_FLAG_ACTIVE)) 187 + list_for_each_entry(iter, &local->interfaces, list) { 188 + if (iter == sdata) 191 189 continue; 192 190 193 - m = sdata->vif.addr; 191 + if (iter->vif.type == NL80211_IFTYPE_MONITOR && 192 + !(iter->u.mntr_flags & MONITOR_FLAG_ACTIVE)) 193 + continue; 194 + 195 + m = iter->vif.addr; 194 196 tmp = ((u64)m[0] << 5*8) | ((u64)m[1] << 4*8) | 195 197 ((u64)m[2] << 3*8) | ((u64)m[3] << 2*8) | 196 198 ((u64)m[4] << 1*8) | ((u64)m[5] << 0*8); ··· 222 218 !(sdata->u.mntr_flags & MONITOR_FLAG_ACTIVE)) 223 219 check_dup = false; 224 220 225 - ret = ieee80211_verify_mac(sdata->local, sa->sa_data, check_dup); 221 + ret = ieee80211_verify_mac(sdata, sa->sa_data, check_dup); 226 222 if (ret) 227 223 return ret; 228 224 ··· 1507 1503 break; 1508 1504 } 1509 1505 1506 + /* 1507 + * Pick address of existing interface in case user changed 1508 + * MAC address manually, default to perm_addr. 1509 + */ 1510 1510 m = local->hw.wiphy->perm_addr; 1511 + list_for_each_entry(sdata, &local->interfaces, list) { 1512 + if (sdata->vif.type == NL80211_IFTYPE_MONITOR) 1513 + continue; 1514 + m = sdata->vif.addr; 1515 + break; 1516 + } 1511 1517 start = ((u64)m[0] << 5*8) | ((u64)m[1] << 4*8) | 1512 1518 ((u64)m[2] << 3*8) | ((u64)m[3] << 2*8) | 1513 1519 ((u64)m[4] << 1*8) | ((u64)m[5] << 0*8);
-1
net/nfc/Makefile
··· 5 5 obj-$(CONFIG_NFC) += nfc.o 6 6 obj-$(CONFIG_NFC_NCI) += nci/ 7 7 obj-$(CONFIG_NFC_HCI) += hci/ 8 - #obj-$(CONFIG_NFC_LLCP) += llcp/ 9 8 10 9 nfc-objs := core.o netlink.o af_nfc.o rawsock.o llcp_core.o llcp_commands.o \ 11 10 llcp_sock.o