Changeset 32655
- Timestamp:
- 2012-07-10T02:21:25+02:00 (6 years ago)
- Location:
- trunk/package/mac80211
- Files:
-
- 1 added
- 24 deleted
- 52 edited
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
trunk/package/mac80211/Makefile
r32588 r32655 11 11 PKG_NAME:=mac80211 12 12 13 PKG_VERSION:=2012-0 6-1414 PKG_RELEASE:= 213 PKG_VERSION:=2012-07-06 14 PKG_RELEASE:=1 15 15 PKG_SOURCE_URL:=http://mirror2.openwrt.org/sources 16 PKG_MD5SUM:= 009fd7aa420693e30df9090cee9ea18916 PKG_MD5SUM:=71e1ba84a7d1c3ab69ee1b68fa9e1269 17 17 18 18 PKG_SOURCE:=compat-wireless-$(PKG_VERSION).tar.bz2 -
trunk/package/mac80211/patches/000-disable_ethernet.patch
r32002 r32655 1 1 --- a/Makefile 2 2 +++ b/Makefile 3 @@ -4 4,9 +44,6 @@ obj-$(CONFIG_COMPAT_WIRELESS_MODULES) +=3 @@ -45,9 +45,6 @@ obj-$(CONFIG_COMPAT_WIRELESS_MODULES) += 4 4 5 5 obj-$(CONFIG_COMPAT_NET_USB_MODULES) += drivers/net/usb/ -
trunk/package/mac80211/patches/001-disable_b44.patch
r32420 r32655 1 1 --- a/config.mk 2 2 +++ b/config.mk 3 @@ -37 1,8 +371,8 @@ export CONFIG_B43_BCMA_EXTRA=y3 @@ -376,8 +376,8 @@ export CONFIG_B43_BCMA_EXTRA=y 4 4 5 5 export CONFIG_P54_PCI=m -
trunk/package/mac80211/patches/002-disable_rfkill.patch
r32420 r32655 10 10 ifeq ($(CONFIG_MAC80211),y) 11 11 $(error "ERROR: you have MAC80211 compiled into the kernel, CONFIG_MAC80211=y, as such you cannot replace its mac80211 driver. You need this set to CONFIG_MAC80211=m. If you are using Fedora upgrade your kernel as later version should this set as modular. For further information on Fedora see https://bugzilla.redhat.com/show_bug.cgi?id=470143. If you are using your own kernel recompile it and make mac80211 modular") 12 @@ -68 3,10 +683,10 @@ endif #CONFIG_COMPAT_KERNEL_2_6_2712 @@ -688,10 +688,10 @@ endif #CONFIG_COMPAT_KERNEL_2_6_27 13 13 # We need the backported rfkill module on kernel < 2.6.31. 14 14 # In more recent kernel versions use the in kernel rfkill module. -
trunk/package/mac80211/patches/005-disable_ssb_build.patch
r32420 r32655 1 1 --- a/Makefile 2 2 +++ b/Makefile 3 @@ -4 4,7 +44,6 @@ obj-$(CONFIG_COMPAT_WIRELESS_MODULES) +=3 @@ -45,7 +45,6 @@ obj-$(CONFIG_COMPAT_WIRELESS_MODULES) += 4 4 5 5 obj-$(CONFIG_COMPAT_NET_USB_MODULES) += drivers/net/usb/ … … 20 20 include $(KLIB_BUILD)/.config 21 21 endif 22 @@ -3 47,7 +347,8 @@ export CONFIG_IPW2200_QOS=y22 @@ -352,7 +352,8 @@ export CONFIG_IPW2200_QOS=y 23 23 # % echo 1 > /sys/bus/pci/drivers/ipw2200/*/rtap_iface 24 24 endif #CONFIG_WIRELESS_EXT … … 30 30 export CONFIG_SSB_SPROM=y 31 31 32 @@ -36 0,7 +361,7 @@ endif #CONFIG_PCMCIA32 @@ -365,7 +366,7 @@ endif #CONFIG_PCMCIA 33 33 # export CONFIG_SSB_DEBUG=y 34 34 export CONFIG_SSB_DRIVER_PCICORE=y … … 39 39 export CONFIG_BCMA=m 40 40 export CONFIG_BCMA_BLOCKIO=y 41 @@ -5 77,7 +578,7 @@ endif #CONFIG_SPI_MASTER end of SPI driv41 @@ -582,7 +583,7 @@ endif #CONFIG_SPI_MASTER end of SPI driv 42 42 43 43 ifdef CONFIG_MMC -
trunk/package/mac80211/patches/006-disable_bcma_build.patch
r32420 r32655 1 1 --- a/Makefile 2 2 +++ b/Makefile 3 @@ -4 4,7 +44,6 @@ obj-$(CONFIG_COMPAT_WIRELESS_MODULES) +=3 @@ -45,7 +45,6 @@ obj-$(CONFIG_COMPAT_WIRELESS_MODULES) += 4 4 5 5 obj-$(CONFIG_COMPAT_NET_USB_MODULES) += drivers/net/usb/ … … 11 11 --- a/config.mk 12 12 +++ b/config.mk 13 @@ -36 3,12 +363,12 @@ export CONFIG_SSB_DRIVER_PCICORE=y13 @@ -368,12 +368,12 @@ export CONFIG_SSB_DRIVER_PCICORE=y 14 14 export CONFIG_B43_SSB=y 15 15 endif #__CONFIG_SSB -
trunk/package/mac80211/patches/007-remove_misc_drivers.patch
r32420 r32655 10 10 11 11 # mac80211 test driver 12 @@ -40 0,15 +400,15 @@ endif #CONFIG_CRC_ITU_T12 @@ -405,15 +405,15 @@ endif #CONFIG_CRC_ITU_T 13 13 export CONFIG_MWL8K=m 14 14 … … 33 33 34 34 ifdef CONFIG_WIRELESS_EXT 35 @@ -4 69,21 +469,21 @@ endif #CONFIG_COMPAT_KERNEL_2_6_2935 @@ -474,21 +474,21 @@ endif #CONFIG_COMPAT_KERNEL_2_6_29 36 36 # Note: this depends on CONFIG_USB_NET_RNDIS_HOST and CONFIG_USB_NET_CDCETHER 37 37 # it also requires new RNDIS_HOST and CDC_ETHER modules which we add -
trunk/package/mac80211/patches/010-no_pcmcia.patch
r32420 r32655 10 10 else 11 11 include $(KLIB_BUILD)/.config 12 @@ - 298,7 +298,7 @@ export CONFIG_B43=m12 @@ -303,7 +303,7 @@ export CONFIG_B43=m 13 13 export CONFIG_B43_HWRNG=y 14 14 export CONFIG_B43_PCI_AUTOSELECT=y -
trunk/package/mac80211/patches/011-no_sdio.patch
r32420 r32655 1 1 --- a/config.mk 2 2 +++ b/config.mk 3 @@ -5 79,7 +579,7 @@ endif #CONFIG_SPI_MASTER end of SPI driv3 @@ -584,7 +584,7 @@ endif #CONFIG_SPI_MASTER end of SPI driv 4 4 ifdef CONFIG_MMC 5 5 -
trunk/package/mac80211/patches/013-disable_b43_nphy.patch
r32420 r32655 1 1 --- a/config.mk 2 2 +++ b/config.mk 3 @@ -30 4,8 +304,8 @@ ifdef CONFIG_MAC80211_LEDS3 @@ -309,8 +309,8 @@ ifdef CONFIG_MAC80211_LEDS 4 4 export CONFIG_B43_LEDS=y 5 5 endif #CONFIG_MAC80211_LEDS -
trunk/package/mac80211/patches/015-remove-rt2x00-options.patch
r32420 r32655 1 1 --- a/config.mk 2 2 +++ b/config.mk 3 @@ -3 79,7 +379,7 @@ export CONFIG_RTL8180=m3 @@ -384,7 +384,7 @@ export CONFIG_RTL8180=m 4 4 5 5 export CONFIG_ADM8211=m … … 10 10 export CONFIG_RT2500PCI=m 11 11 ifdef CONFIG_CRC_CCITT 12 @@ -5 25,7 +525,7 @@ export CONFIG_RT2800USB_RT35XX=y12 @@ -530,7 +530,7 @@ export CONFIG_RT2800USB_RT35XX=y 13 13 export CONFIG_RT2800USB_RT53XX=y 14 14 export CONFIG_RT2800USB_UNKNOWN=y -
trunk/package/mac80211/patches/019-remove_ath5k_pci_option.patch
r32002 r32655 1 1 --- a/config.mk 2 2 +++ b/config.mk 3 @@ -2 76,7 +276,7 @@ endif #CONFIG_COMPAT_KERNEL_2_6_273 @@ -281,7 +281,7 @@ endif #CONFIG_COMPAT_KERNEL_2_6_27 4 4 # PCI Drivers 5 5 ifdef CONFIG_PCI -
trunk/package/mac80211/patches/021-add_include_for_bcma.patch
r29436 r32655 1 1 --- a/include/linux/compat-3.0.h 2 2 +++ b/include/linux/compat-3.0.h 3 @@ -7,6 +7,8 @@ 3 @@ -36,6 +36,8 @@ static inline struct page *shmem_read_ma 4 #endif 4 5 5 #include <linux/rcupdate.h>6 6 7 7 +#include <linux/mod_devicetable.h> -
trunk/package/mac80211/patches/023-ath9k_disable_btcoex.patch
r32002 r32655 8 8 +# export CONFIG_ATH9K_BTCOEX_SUPPORT=y 9 9 10 ifndef CONFIG_COMPAT_KERNEL_2_6_2711 export CONFIG_ATH6KL=m10 # WIL6210 requires MSI only available >= 2.6.30 11 ifndef CONFIG_COMPAT_KERNEL_2_6_30 -
trunk/package/mac80211/patches/060-compat_add_module_pci_driver.patch
r32002 r32655 1 1 --- a/include/linux/compat-3.4.h 2 2 +++ b/include/linux/compat-3.4.h 3 @@ - 77,6 +77,19 @@ static inline void eth_hw_addr_random(st3 @@ -81,6 +81,19 @@ static inline void eth_hw_addr_random(st 4 4 module_driver(__pci_driver, pci_register_driver, \ 5 5 pci_unregister_driver) -
trunk/package/mac80211/patches/071-add_codel_ifdef.patch
r32420 r32655 10 10 * This backports: 11 11 * 12 @@ -1 06,6 +108,7 @@ struct vga_switcheroo_client_ops {12 @@ -135,6 +137,7 @@ static inline int compat_vga_switcheroo_ 13 13 14 14 #define SIZE_MAX (~(size_t)0) -
trunk/package/mac80211/patches/110-disable_usb_compat.patch
r32420 r32655 34 34 --- a/config.mk 35 35 +++ b/config.mk 36 @@ -5 07,7 +507,7 @@ endif #CONFIG_COMPAT_KERNEL_2_6_2936 @@ -512,7 +512,7 @@ endif #CONFIG_COMPAT_KERNEL_2_6_29 37 37 # This activates a threading fix for usb urb. 38 38 # this is mainline commit: b3e670443b7fb8a2d29831b62b44a039c283e351 -
trunk/package/mac80211/patches/130-mesh_pathtbl_backport.patch
r31322 r32655 1 1 --- a/net/mac80211/mesh_pathtbl.c 2 2 +++ b/net/mac80211/mesh_pathtbl.c 3 @@ -8 26,7 +826,6 @@ static void table_flush_by_iface(struct3 @@ -817,7 +817,6 @@ static void table_flush_by_iface(struct 4 4 struct hlist_node *p; 5 5 int i; -
trunk/package/mac80211/patches/300-pending_work.patch
r32492 r32655 1 --- a/drivers/net/wireless/ath/ath9k/ani.c 2 +++ b/drivers/net/wireless/ath/ath9k/ani.c 3 @@ -104,11 +104,6 @@ static const struct ani_cck_level_entry 4 #define ATH9K_ANI_CCK_DEF_LEVEL \ 5 2 /* default level - matches the INI settings */ 6 7 -static bool use_new_ani(struct ath_hw *ah) 1 --- a/drivers/net/wireless/ath/ath9k/ath9k.h 2 +++ b/drivers/net/wireless/ath/ath9k/ath9k.h 3 @@ -360,7 +360,7 @@ void ath_tx_aggr_sleep(struct ieee80211_ 4 5 struct ath_vif { 6 int av_bslot; 7 - bool is_bslot_active, primary_sta_vif; 8 + bool primary_sta_vif; 9 __le64 tsf_adjust; /* TSF adjustment for staggered beacons */ 10 struct ath_buf *av_bcbuf; 11 }; 12 @@ -386,6 +386,7 @@ struct ath_beacon_config { 13 u16 dtim_period; 14 u16 bmiss_timeout; 15 u8 dtim_count; 16 + bool enable_beacon; 17 }; 18 19 struct ath_beacon { 20 @@ -397,7 +398,6 @@ struct ath_beacon { 21 22 u32 beaconq; 23 u32 bmisscnt; 24 - u32 ast_be_xmit; 25 u32 bc_tstamp; 26 struct ieee80211_vif *bslot[ATH_BCBUF]; 27 int slottime; 28 @@ -411,12 +411,14 @@ struct ath_beacon { 29 bool tx_last; 30 }; 31 32 -void ath_beacon_tasklet(unsigned long data); 33 -void ath_beacon_config(struct ath_softc *sc, struct ieee80211_vif *vif); 34 -int ath_beacon_alloc(struct ath_softc *sc, struct ieee80211_vif *vif); 35 -void ath_beacon_return(struct ath_softc *sc, struct ath_vif *avp); 36 -int ath_beaconq_config(struct ath_softc *sc); 37 -void ath_set_beacon(struct ath_softc *sc); 38 +void ath9k_beacon_tasklet(unsigned long data); 39 +bool ath9k_allow_beacon_config(struct ath_softc *sc, struct ieee80211_vif *vif); 40 +void ath9k_beacon_config(struct ath_softc *sc, struct ieee80211_vif *vif, 41 + u32 changed); 42 +void ath9k_beacon_assign_slot(struct ath_softc *sc, struct ieee80211_vif *vif); 43 +void ath9k_beacon_remove_slot(struct ath_softc *sc, struct ieee80211_vif *vif); 44 +void ath9k_set_tsfadjust(struct ath_softc *sc, struct ieee80211_vif *vif); 45 +void ath9k_set_beacon(struct ath_softc *sc); 46 void ath9k_set_beaconing_status(struct ath_softc *sc, bool status); 47 48 /*******************/ 49 @@ -442,9 +444,12 @@ void ath_rx_poll(unsigned long data); 50 void ath_start_rx_poll(struct ath_softc *sc, u8 nbeacon); 51 void ath_paprd_calibrate(struct work_struct *work); 52 void ath_ani_calibrate(unsigned long data); 53 -void ath_start_ani(struct ath_common *common); 54 +void ath_start_ani(struct ath_softc *sc); 55 +void ath_stop_ani(struct ath_softc *sc); 56 +void ath_check_ani(struct ath_softc *sc); 57 int ath_update_survey_stats(struct ath_softc *sc); 58 void ath_update_survey_nf(struct ath_softc *sc, int channel); 59 +void ath9k_queue_reset(struct ath_softc *sc, enum ath_reset_type type); 60 61 /**********/ 62 /* BTCOEX */ 63 @@ -613,7 +618,6 @@ enum sc_op_flags { 64 SC_OP_INVALID, 65 SC_OP_BEACONS, 66 SC_OP_RXFLUSH, 67 - SC_OP_TSF_RESET, 68 SC_OP_ANI_RUN, 69 SC_OP_PRIM_STA_VIF, 70 SC_OP_HW_RESET, 71 --- a/drivers/net/wireless/ath/ath9k/beacon.c 72 +++ b/drivers/net/wireless/ath/ath9k/beacon.c 73 @@ -30,7 +30,7 @@ static void ath9k_reset_beacon_status(st 74 * the operating mode of the station (AP or AdHoc). Parameters are AIFS 75 * settings and channel width min/max 76 */ 77 -int ath_beaconq_config(struct ath_softc *sc) 78 +static void ath9k_beaconq_config(struct ath_softc *sc) 79 { 80 struct ath_hw *ah = sc->sc_ah; 81 struct ath_common *common = ath9k_hw_common(ah); 82 @@ -38,6 +38,7 @@ int ath_beaconq_config(struct ath_softc 83 struct ath_txq *txq; 84 85 ath9k_hw_get_txq_props(ah, sc->beacon.beaconq, &qi); 86 + 87 if (sc->sc_ah->opmode == NL80211_IFTYPE_AP) { 88 /* Always burst out beacon and CAB traffic. */ 89 qi.tqi_aifs = 1; 90 @@ -56,12 +57,9 @@ int ath_beaconq_config(struct ath_softc 91 } 92 93 if (!ath9k_hw_set_txq_props(ah, sc->beacon.beaconq, &qi)) { 94 - ath_err(common, 95 - "Unable to update h/w beacon queue parameters\n"); 96 - return 0; 97 + ath_err(common, "Unable to update h/w beacon queue parameters\n"); 98 } else { 99 ath9k_hw_resettxqueue(ah, sc->beacon.beaconq); 100 - return 1; 101 } 102 } 103 104 @@ -70,7 +68,7 @@ int ath_beaconq_config(struct ath_softc 105 * up rate codes, and channel flags. Beacons are always sent out at the 106 * lowest rate, and are not retried. 107 */ 108 -static void ath_beacon_setup(struct ath_softc *sc, struct ieee80211_vif *vif, 109 +static void ath9k_beacon_setup(struct ath_softc *sc, struct ieee80211_vif *vif, 110 struct ath_buf *bf, int rateidx) 111 { 112 struct sk_buff *skb = bf->bf_mpdu; 113 @@ -81,8 +79,6 @@ static void ath_beacon_setup(struct ath_ 114 u8 chainmask = ah->txchainmask; 115 u8 rate = 0; 116 117 - ath9k_reset_beacon_status(sc); 118 - 119 sband = &sc->sbands[common->hw->conf.channel->band]; 120 rate = sband->bitrates[rateidx].hw_value; 121 if (vif->bss_conf.use_short_preamble) 122 @@ -111,7 +107,7 @@ static void ath_beacon_setup(struct ath_ 123 ath9k_hw_set_txdesc(ah, bf->bf_desc, &info); 124 } 125 126 -static void ath_tx_cabq(struct ieee80211_hw *hw, struct sk_buff *skb) 127 +static void ath9k_tx_cabq(struct ieee80211_hw *hw, struct sk_buff *skb) 128 { 129 struct ath_softc *sc = hw->priv; 130 struct ath_common *common = ath9k_hw_common(sc->sc_ah); 131 @@ -128,28 +124,22 @@ static void ath_tx_cabq(struct ieee80211 132 } 133 } 134 135 -static struct ath_buf *ath_beacon_generate(struct ieee80211_hw *hw, 136 - struct ieee80211_vif *vif) 137 +static struct ath_buf *ath9k_beacon_generate(struct ieee80211_hw *hw, 138 + struct ieee80211_vif *vif) 139 { 140 struct ath_softc *sc = hw->priv; 141 struct ath_common *common = ath9k_hw_common(sc->sc_ah); 142 struct ath_buf *bf; 143 - struct ath_vif *avp; 144 + struct ath_vif *avp = (void *)vif->drv_priv; 145 struct sk_buff *skb; 146 - struct ath_txq *cabq; 147 + struct ath_txq *cabq = sc->beacon.cabq; 148 struct ieee80211_tx_info *info; 149 + struct ieee80211_mgmt *mgmt_hdr; 150 int cabq_depth; 151 152 - ath9k_reset_beacon_status(sc); 153 - 154 - avp = (void *)vif->drv_priv; 155 - cabq = sc->beacon.cabq; 156 - 157 - if ((avp->av_bcbuf == NULL) || !avp->is_bslot_active) 158 + if (avp->av_bcbuf == NULL) 159 return NULL; 160 161 - /* Release the old beacon first */ 162 - 163 bf = avp->av_bcbuf; 164 skb = bf->bf_mpdu; 165 if (skb) { 166 @@ -159,14 +149,14 @@ static struct ath_buf *ath_beacon_genera 167 bf->bf_buf_addr = 0; 168 } 169 170 - /* Get a new beacon from mac80211 */ 171 - 172 skb = ieee80211_beacon_get(hw, vif); 173 - bf->bf_mpdu = skb; 174 if (skb == NULL) 175 return NULL; 176 - ((struct ieee80211_mgmt *)skb->data)->u.beacon.timestamp = 177 - avp->tsf_adjust; 178 + 179 + bf->bf_mpdu = skb; 180 + 181 + mgmt_hdr = (struct ieee80211_mgmt *)skb->data; 182 + mgmt_hdr->u.beacon.timestamp = avp->tsf_adjust; 183 184 info = IEEE80211_SKB_CB(skb); 185 if (info->flags & IEEE80211_TX_CTL_ASSIGN_SEQ) { 186 @@ -212,61 +202,52 @@ static struct ath_buf *ath_beacon_genera 187 } 188 } 189 190 - ath_beacon_setup(sc, vif, bf, info->control.rates[0].idx); 191 + ath9k_beacon_setup(sc, vif, bf, info->control.rates[0].idx); 192 193 while (skb) { 194 - ath_tx_cabq(hw, skb); 195 + ath9k_tx_cabq(hw, skb); 196 skb = ieee80211_get_buffered_bc(hw, vif); 197 } 198 199 return bf; 200 } 201 202 -int ath_beacon_alloc(struct ath_softc *sc, struct ieee80211_vif *vif) 203 +void ath9k_beacon_assign_slot(struct ath_softc *sc, struct ieee80211_vif *vif) 204 { 205 struct ath_common *common = ath9k_hw_common(sc->sc_ah); 206 - struct ath_vif *avp; 207 - struct ath_buf *bf; 208 - struct sk_buff *skb; 209 - struct ath_beacon_config *cur_conf = &sc->cur_beacon_conf; 210 - __le64 tstamp; 211 + struct ath_vif *avp = (void *)vif->drv_priv; 212 + int slot; 213 214 - avp = (void *)vif->drv_priv; 215 + avp->av_bcbuf = list_first_entry(&sc->beacon.bbuf, struct ath_buf, list); 216 + list_del(&avp->av_bcbuf->list); 217 218 - /* Allocate a beacon descriptor if we haven't done so. */ 219 - if (!avp->av_bcbuf) { 220 - /* Allocate beacon state for hostap/ibss. We know 221 - * a buffer is available. */ 222 - avp->av_bcbuf = list_first_entry(&sc->beacon.bbuf, 223 - struct ath_buf, list); 224 - list_del(&avp->av_bcbuf->list); 225 - 226 - if (ath9k_uses_beacons(vif->type)) { 227 - int slot; 228 - /* 229 - * Assign the vif to a beacon xmit slot. As 230 - * above, this cannot fail to find one. 231 - */ 232 - avp->av_bslot = 0; 233 - for (slot = 0; slot < ATH_BCBUF; slot++) 234 - if (sc->beacon.bslot[slot] == NULL) { 235 - avp->av_bslot = slot; 236 - avp->is_bslot_active = false; 237 - 238 - /* NB: keep looking for a double slot */ 239 - if (slot == 0 || !sc->beacon.bslot[slot-1]) 240 - break; 241 - } 242 - BUG_ON(sc->beacon.bslot[avp->av_bslot] != NULL); 243 - sc->beacon.bslot[avp->av_bslot] = vif; 244 - sc->nbcnvifs++; 245 + for (slot = 0; slot < ATH_BCBUF; slot++) { 246 + if (sc->beacon.bslot[slot] == NULL) { 247 + avp->av_bslot = slot; 248 + break; 249 } 250 } 251 252 - /* release the previous beacon frame, if it already exists. */ 253 - bf = avp->av_bcbuf; 254 - if (bf->bf_mpdu != NULL) { 255 - skb = bf->bf_mpdu; 256 + sc->beacon.bslot[avp->av_bslot] = vif; 257 + sc->nbcnvifs++; 258 + 259 + ath_dbg(common, CONFIG, "Added interface at beacon slot: %d\n", 260 + avp->av_bslot); 261 +} 262 + 263 +void ath9k_beacon_remove_slot(struct ath_softc *sc, struct ieee80211_vif *vif) 264 +{ 265 + struct ath_common *common = ath9k_hw_common(sc->sc_ah); 266 + struct ath_vif *avp = (void *)vif->drv_priv; 267 + struct ath_buf *bf = avp->av_bcbuf; 268 + 269 + ath_dbg(common, CONFIG, "Removing interface at beacon slot: %d\n", 270 + avp->av_bslot); 271 + 272 + tasklet_disable(&sc->bcon_tasklet); 273 + 274 + if (bf && bf->bf_mpdu) { 275 + struct sk_buff *skb = bf->bf_mpdu; 276 dma_unmap_single(sc->dev, bf->bf_buf_addr, 277 skb->len, DMA_TO_DEVICE); 278 dev_kfree_skb_any(skb); 279 @@ -274,99 +255,74 @@ int ath_beacon_alloc(struct ath_softc *s 280 bf->bf_buf_addr = 0; 281 } 282 283 - /* NB: the beacon data buffer must be 32-bit aligned. */ 284 - skb = ieee80211_beacon_get(sc->hw, vif); 285 - if (skb == NULL) 286 - return -ENOMEM; 287 - 288 - tstamp = ((struct ieee80211_mgmt *)skb->data)->u.beacon.timestamp; 289 - sc->beacon.bc_tstamp = (u32) le64_to_cpu(tstamp); 290 - /* Calculate a TSF adjustment factor required for staggered beacons. */ 291 - if (avp->av_bslot > 0) { 292 - u64 tsfadjust; 293 - int intval; 294 + avp->av_bcbuf = NULL; 295 + sc->beacon.bslot[avp->av_bslot] = NULL; 296 + sc->nbcnvifs--; 297 + list_add_tail(&bf->list, &sc->beacon.bbuf); 298 299 - intval = cur_conf->beacon_interval ? : ATH_DEFAULT_BINTVAL; 300 + tasklet_enable(&sc->bcon_tasklet); 301 +} 302 303 - /* 304 - * Calculate the TSF offset for this beacon slot, i.e., the 305 - * number of usecs that need to be added to the timestamp field 306 - * in Beacon and Probe Response frames. Beacon slot 0 is 307 - * processed at the correct offset, so it does not require TSF 308 - * adjustment. Other slots are adjusted to get the timestamp 309 - * close to the TBTT for the BSS. 310 - */ 311 - tsfadjust = TU_TO_USEC(intval * avp->av_bslot) / ATH_BCBUF; 312 - avp->tsf_adjust = cpu_to_le64(tsfadjust); 313 +static int ath9k_beacon_choose_slot(struct ath_softc *sc) 314 +{ 315 + struct ath_common *common = ath9k_hw_common(sc->sc_ah); 316 + struct ath_beacon_config *cur_conf = &sc->cur_beacon_conf; 317 + u16 intval; 318 + u32 tsftu; 319 + u64 tsf; 320 + int slot; 321 322 - ath_dbg(common, BEACON, 323 - "stagger beacons, bslot %d intval %u tsfadjust %llu\n", 324 - avp->av_bslot, intval, (unsigned long long)tsfadjust); 325 + if (sc->sc_ah->opmode != NL80211_IFTYPE_AP) { 326 + ath_dbg(common, BEACON, "slot 0, tsf: %llu\n", 327 + ath9k_hw_gettsf64(sc->sc_ah)); 328 + return 0; 329 + } 330 331 - ((struct ieee80211_mgmt *)skb->data)->u.beacon.timestamp = 332 - avp->tsf_adjust; 333 - } else 334 - avp->tsf_adjust = cpu_to_le64(0); 335 + intval = cur_conf->beacon_interval ? : ATH_DEFAULT_BINTVAL; 336 + tsf = ath9k_hw_gettsf64(sc->sc_ah); 337 + tsf += TU_TO_USEC(sc->sc_ah->config.sw_beacon_response_time); 338 + tsftu = TSF_TO_TU((tsf * ATH_BCBUF) >>32, tsf * ATH_BCBUF); 339 + slot = (tsftu % (intval * ATH_BCBUF)) / intval; 340 341 - bf->bf_mpdu = skb; 342 - bf->bf_buf_addr = dma_map_single(sc->dev, skb->data, 343 - skb->len, DMA_TO_DEVICE); 344 - if (unlikely(dma_mapping_error(sc->dev, bf->bf_buf_addr))) { 345 - dev_kfree_skb_any(skb); 346 - bf->bf_mpdu = NULL; 347 - bf->bf_buf_addr = 0; 348 - ath_err(common, "dma_mapping_error on beacon alloc\n"); 349 - return -ENOMEM; 350 - } 351 - avp->is_bslot_active = true; 352 + ath_dbg(common, BEACON, "slot: %d tsf: %llu tsftu: %u\n", 353 + slot, tsf, tsftu / ATH_BCBUF); 354 355 - return 0; 356 + return slot; 357 } 358 359 -void ath_beacon_return(struct ath_softc *sc, struct ath_vif *avp) 360 +void ath9k_set_tsfadjust(struct ath_softc *sc, struct ieee80211_vif *vif) 361 { 362 - if (avp->av_bcbuf != NULL) { 363 - struct ath_buf *bf; 364 + struct ath_common *common = ath9k_hw_common(sc->sc_ah); 365 + struct ath_beacon_config *cur_conf = &sc->cur_beacon_conf; 366 + struct ath_vif *avp = (void *)vif->drv_priv; 367 + u64 tsfadjust; 368 369 - avp->is_bslot_active = false; 370 - if (avp->av_bslot != -1) { 371 - sc->beacon.bslot[avp->av_bslot] = NULL; 372 - sc->nbcnvifs--; 373 - avp->av_bslot = -1; 374 - } 375 + if (avp->av_bslot == 0) 376 + return; 377 378 - bf = avp->av_bcbuf; 379 - if (bf->bf_mpdu != NULL) { 380 - struct sk_buff *skb = bf->bf_mpdu; 381 - dma_unmap_single(sc->dev, bf->bf_buf_addr, 382 - skb->len, DMA_TO_DEVICE); 383 - dev_kfree_skb_any(skb); 384 - bf->bf_mpdu = NULL; 385 - bf->bf_buf_addr = 0; 386 - } 387 - list_add_tail(&bf->list, &sc->beacon.bbuf); 388 + tsfadjust = cur_conf->beacon_interval * avp->av_bslot / ATH_BCBUF; 389 + avp->tsf_adjust = cpu_to_le64(TU_TO_USEC(tsfadjust)); 390 391 - avp->av_bcbuf = NULL; 392 - } 393 + ath_dbg(common, CONFIG, "tsfadjust is: %llu for bslot: %d\n", 394 + (unsigned long long)tsfadjust, avp->av_bslot); 395 } 396 397 -void ath_beacon_tasklet(unsigned long data) 398 +void ath9k_beacon_tasklet(unsigned long data) 399 { 400 struct ath_softc *sc = (struct ath_softc *)data; 401 - struct ath_beacon_config *cur_conf = &sc->cur_beacon_conf; 402 struct ath_hw *ah = sc->sc_ah; 403 struct ath_common *common = ath9k_hw_common(ah); 404 struct ath_buf *bf = NULL; 405 struct ieee80211_vif *vif; 406 bool edma = !!(ah->caps.hw_caps & ATH9K_HW_CAP_EDMA); 407 int slot; 408 - u32 bfaddr, bc = 0; 409 410 - if (work_pending(&sc->hw_reset_work)) { 411 + if (test_bit(SC_OP_HW_RESET, &sc->sc_flags)) { 412 ath_dbg(common, RESET, 413 "reset work is pending, skip beaconing now\n"); 414 return; 415 } 416 + 417 /* 418 * Check if the previous beacon has gone out. If 419 * not don't try to post another, skip this period 420 @@ -390,55 +346,25 @@ void ath_beacon_tasklet(unsigned long da 421 } else if (sc->beacon.bmisscnt >= BSTUCK_THRESH) { 422 ath_dbg(common, BSTUCK, "beacon is officially stuck\n"); 423 sc->beacon.bmisscnt = 0; 424 - set_bit(SC_OP_TSF_RESET, &sc->sc_flags); 425 - ieee80211_queue_work(sc->hw, &sc->hw_reset_work); 426 + ath9k_queue_reset(sc, RESET_TYPE_BEACON_STUCK); 427 } 428 429 return; 430 } 431 432 - /* 433 - * Generate beacon frames. we are sending frames 434 - * staggered so calculate the slot for this frame based 435 - * on the tsf to safeguard against missing an swba. 436 - */ 437 - 438 - 439 - if (ah->opmode == NL80211_IFTYPE_AP) { 440 - u16 intval; 441 - u32 tsftu; 442 - u64 tsf; 443 - 444 - intval = cur_conf->beacon_interval ? : ATH_DEFAULT_BINTVAL; 445 - tsf = ath9k_hw_gettsf64(ah); 446 - tsf += TU_TO_USEC(ah->config.sw_beacon_response_time); 447 - tsftu = TSF_TO_TU((tsf * ATH_BCBUF) >>32, tsf * ATH_BCBUF); 448 - slot = (tsftu % (intval * ATH_BCBUF)) / intval; 449 - vif = sc->beacon.bslot[slot]; 450 - 451 - ath_dbg(common, BEACON, 452 - "slot %d [tsf %llu tsftu %u intval %u] vif %p\n", 453 - slot, tsf, tsftu / ATH_BCBUF, intval, vif); 454 - } else { 455 - slot = 0; 456 - vif = sc->beacon.bslot[slot]; 457 - } 458 + slot = ath9k_beacon_choose_slot(sc); 459 + vif = sc->beacon.bslot[slot]; 460 461 + if (!vif || !vif->bss_conf.enable_beacon) 462 + return; 463 464 - bfaddr = 0; 465 - if (vif) { 466 - bf = ath_beacon_generate(sc->hw, vif); 467 - if (bf != NULL) { 468 - bfaddr = bf->bf_daddr; 469 - bc = 1; 470 - } 471 + bf = ath9k_beacon_generate(sc->hw, vif); 472 + WARN_ON(!bf); 473 474 - if (sc->beacon.bmisscnt != 0) { 475 - ath_dbg(common, BSTUCK, 476 - "resume beacon xmit after %u misses\n", 477 - sc->beacon.bmisscnt); 478 - sc->beacon.bmisscnt = 0; 479 - } 480 + if (sc->beacon.bmisscnt != 0) { 481 + ath_dbg(common, BSTUCK, "resume beacon xmit after %u misses\n", 482 + sc->beacon.bmisscnt); 483 + sc->beacon.bmisscnt = 0; 484 } 485 486 /* 487 @@ -458,39 +384,37 @@ void ath_beacon_tasklet(unsigned long da 488 * set to ATH_BCBUF so this check is a noop. 489 */ 490 if (sc->beacon.updateslot == UPDATE) { 491 - sc->beacon.updateslot = COMMIT; /* commit next beacon */ 492 + sc->beacon.updateslot = COMMIT; 493 sc->beacon.slotupdate = slot; 494 - } else if (sc->beacon.updateslot == COMMIT && sc->beacon.slotupdate == slot) { 495 + } else if (sc->beacon.updateslot == COMMIT && 496 + sc->beacon.slotupdate == slot) { 497 ah->slottime = sc->beacon.slottime; 498 ath9k_hw_init_global_settings(ah); 499 sc->beacon.updateslot = OK; 500 } 501 - if (bfaddr != 0) { 502 + 503 + if (bf) { 504 + ath9k_reset_beacon_status(sc); 505 + 506 /* NB: cabq traffic should already be queued and primed */ 507 - ath9k_hw_puttxbuf(ah, sc->beacon.beaconq, bfaddr); 508 + ath9k_hw_puttxbuf(ah, sc->beacon.beaconq, bf->bf_daddr); 509 510 if (!edma) 511 ath9k_hw_txstart(ah, sc->beacon.beaconq); 512 - 513 - sc->beacon.ast_be_xmit += bc; /* XXX per-vif? */ 514 } 515 } 516 517 -static void ath9k_beacon_init(struct ath_softc *sc, 518 - u32 next_beacon, 519 - u32 beacon_period) 520 +static void ath9k_beacon_init(struct ath_softc *sc, u32 nexttbtt, u32 intval) 521 { 522 - if (test_bit(SC_OP_TSF_RESET, &sc->sc_flags)) { 523 - ath9k_ps_wakeup(sc); 524 - ath9k_hw_reset_tsf(sc->sc_ah); 525 - } 526 - 527 - ath9k_hw_beaconinit(sc->sc_ah, next_beacon, beacon_period); 528 + struct ath_hw *ah = sc->sc_ah; 529 530 - if (test_bit(SC_OP_TSF_RESET, &sc->sc_flags)) { 531 - ath9k_ps_restore(sc); 532 - clear_bit(SC_OP_TSF_RESET, &sc->sc_flags); 533 - } 534 + ath9k_hw_disable_interrupts(ah); 535 + ath9k_hw_reset_tsf(ah); 536 + ath9k_beaconq_config(sc); 537 + ath9k_hw_beaconinit(ah, nexttbtt, intval); 538 + sc->beacon.bmisscnt = 0; 539 + ath9k_hw_set_interrupts(ah); 540 + ath9k_hw_enable_interrupts(ah); 541 } 542 543 /* 544 @@ -498,32 +422,27 @@ static void ath9k_beacon_init(struct ath 545 * burst together. For the former arrange for the SWBA to be delivered for each 546 * slot. Slots that are not occupied will generate nothing. 547 */ 548 -static void ath_beacon_config_ap(struct ath_softc *sc, 549 - struct ath_beacon_config *conf) 550 +static void ath9k_beacon_config_ap(struct ath_softc *sc, 551 + struct ath_beacon_config *conf) 552 { 553 struct ath_hw *ah = sc->sc_ah; 554 + struct ath_common *common = ath9k_hw_common(ah); 555 u32 nexttbtt, intval; 556 557 /* NB: the beacon interval is kept internally in TU's */ 558 intval = TU_TO_USEC(conf->beacon_interval); 559 - intval /= ATH_BCBUF; /* for staggered beacons */ 560 + intval /= ATH_BCBUF; 561 nexttbtt = intval; 562 563 - /* 564 - * In AP mode we enable the beacon timers and SWBA interrupts to 565 - * prepare beacon frames. 566 - */ 567 - ah->imask |= ATH9K_INT_SWBA; 568 - ath_beaconq_config(sc); 569 + if (conf->enable_beacon) 570 + ah->imask |= ATH9K_INT_SWBA; 571 + else 572 + ah->imask &= ~ATH9K_INT_SWBA; 573 574 - /* Set the computed AP beacon timers */ 575 + ath_dbg(common, BEACON, "AP nexttbtt: %u intval: %u conf_intval: %u\n", 576 + nexttbtt, intval, conf->beacon_interval); 577 578 - ath9k_hw_disable_interrupts(ah); 579 - set_bit(SC_OP_TSF_RESET, &sc->sc_flags); 580 ath9k_beacon_init(sc, nexttbtt, intval); 581 - sc->beacon.bmisscnt = 0; 582 - ath9k_hw_set_interrupts(ah); 583 - ath9k_hw_enable_interrupts(ah); 584 } 585 586 /* 587 @@ -534,8 +453,8 @@ static void ath_beacon_config_ap(struct 588 * we'll receive a BMISS interrupt when we stop seeing beacons from the AP 589 * we've associated with. 590 */ 591 -static void ath_beacon_config_sta(struct ath_softc *sc, 592 - struct ath_beacon_config *conf) 593 +static void ath9k_beacon_config_sta(struct ath_softc *sc, 594 + struct ath_beacon_config *conf) 595 { 596 struct ath_hw *ah = sc->sc_ah; 597 struct ath_common *common = ath9k_hw_common(ah); 598 @@ -654,8 +573,8 @@ static void ath_beacon_config_sta(struct 599 ath9k_hw_enable_interrupts(ah); 600 } 601 602 -static void ath_beacon_config_adhoc(struct ath_softc *sc, 603 - struct ath_beacon_config *conf) 604 +static void ath9k_beacon_config_adhoc(struct ath_softc *sc, 605 + struct ath_beacon_config *conf) 606 { 607 struct ath_hw *ah = sc->sc_ah; 608 struct ath_common *common = ath9k_hw_common(ah); 609 @@ -669,82 +588,53 @@ static void ath_beacon_config_adhoc(stru 610 tsf = roundup(ath9k_hw_gettsf32(ah) + TU_TO_USEC(FUDGE), intval); 611 nexttbtt = tsf + intval; 612 613 - ath_dbg(common, BEACON, "IBSS nexttbtt %u intval %u (%u)\n", 614 - nexttbtt, intval, conf->beacon_interval); 615 - 616 - /* 617 - * In IBSS mode enable the beacon timers but only enable SWBA interrupts 618 - * if we need to manually prepare beacon frames. Otherwise we use a 619 - * self-linked tx descriptor and let the hardware deal with things. 620 - */ 621 - ah->imask |= ATH9K_INT_SWBA; 622 - 623 - ath_beaconq_config(sc); 624 + if (conf->enable_beacon) 625 + ah->imask |= ATH9K_INT_SWBA; 626 + else 627 + ah->imask &= ~ATH9K_INT_SWBA; 628 629 - /* Set the computed ADHOC beacon timers */ 630 + ath_dbg(common, BEACON, "IBSS nexttbtt: %u intval: %u conf_intval: %u\n", 631 + nexttbtt, intval, conf->beacon_interval); 632 633 - ath9k_hw_disable_interrupts(ah); 634 ath9k_beacon_init(sc, nexttbtt, intval); 635 - sc->beacon.bmisscnt = 0; 636 - 637 - ath9k_hw_set_interrupts(ah); 638 - ath9k_hw_enable_interrupts(ah); 639 } 640 641 -static bool ath9k_allow_beacon_config(struct ath_softc *sc, 642 - struct ieee80211_vif *vif) 643 +bool ath9k_allow_beacon_config(struct ath_softc *sc, struct ieee80211_vif *vif) 644 { 645 - struct ath_beacon_config *cur_conf = &sc->cur_beacon_conf; 646 struct ath_common *common = ath9k_hw_common(sc->sc_ah); 647 - struct ieee80211_bss_conf *bss_conf = &vif->bss_conf; 648 struct ath_vif *avp = (void *)vif->drv_priv; 649 650 - /* 651 - * Can not have different beacon interval on multiple 652 - * AP interface case 653 - */ 654 - if ((sc->sc_ah->opmode == NL80211_IFTYPE_AP) && 655 - (sc->nbcnvifs > 1) && 656 - (vif->type == NL80211_IFTYPE_AP) && 657 - (cur_conf->beacon_interval != bss_conf->beacon_int)) { 658 - ath_dbg(common, CONFIG, 659 - "Changing beacon interval of multiple AP interfaces !\n"); 660 - return false; 661 - } 662 - /* 663 - * Can not configure station vif's beacon config 664 - * while on AP opmode 665 - */ 666 - if ((sc->sc_ah->opmode == NL80211_IFTYPE_AP) && 667 - (vif->type != NL80211_IFTYPE_AP)) { 668 - ath_dbg(common, CONFIG, 669 - "STA vif's beacon not allowed on AP mode\n"); 670 - return false; 671 + if (sc->sc_ah->opmode == NL80211_IFTYPE_AP) { 672 + if ((vif->type != NL80211_IFTYPE_AP) || 673 + (sc->nbcnvifs > 1)) { 674 + ath_dbg(common, CONFIG, 675 + "An AP interface is already present !\n"); 676 + return false; 677 + } 678 } 679 - /* 680 - * Do not allow beacon config if HW was already configured 681 - * with another STA vif 682 - */ 683 - if ((sc->sc_ah->opmode == NL80211_IFTYPE_STATION) && 684 - (vif->type == NL80211_IFTYPE_STATION) && 685 - test_bit(SC_OP_BEACONS, &sc->sc_flags) && 686 - !avp->primary_sta_vif) { 687 - ath_dbg(common, CONFIG, 688 - "Beacon already configured for a station interface\n"); 689 - return false; 690 + 691 + if (sc->sc_ah->opmode == NL80211_IFTYPE_STATION) { 692 + if ((vif->type == NL80211_IFTYPE_STATION) && 693 + test_bit(SC_OP_BEACONS, &sc->sc_flags) && 694 + !avp->primary_sta_vif) { 695 + ath_dbg(common, CONFIG, 696 + "Beacon already configured for a station interface\n"); 697 + return false; 698 + } 699 } 700 + 701 return true; 702 } 703 704 -void ath_beacon_config(struct ath_softc *sc, struct ieee80211_vif *vif) 705 +static void ath9k_cache_beacon_config(struct ath_softc *sc, 706 + struct ieee80211_bss_conf *bss_conf) 707 { 708 + struct ath_common *common = ath9k_hw_common(sc->sc_ah); 709 struct ath_beacon_config *cur_conf = &sc->cur_beacon_conf; 710 - struct ieee80211_bss_conf *bss_conf = &vif->bss_conf; 711 712 - if (!ath9k_allow_beacon_config(sc, vif)) 713 - return; 714 + ath_dbg(common, BEACON, 715 + "Caching beacon data for BSS: %pM\n", bss_conf->bssid); 716 717 - /* Setup the beacon configuration parameters */ 718 cur_conf->beacon_interval = bss_conf->beacon_int; 719 cur_conf->dtim_period = bss_conf->dtim_period; 720 cur_conf->listen_interval = 1; 721 @@ -769,73 +659,59 @@ void ath_beacon_config(struct ath_softc 722 if (cur_conf->dtim_period == 0) 723 cur_conf->dtim_period = 1; 724 725 - ath_set_beacon(sc); 726 } 727 728 -static bool ath_has_valid_bslot(struct ath_softc *sc) 729 +void ath9k_beacon_config(struct ath_softc *sc, struct ieee80211_vif *vif, 730 + u32 changed) 731 { 732 - struct ath_vif *avp; 733 - int slot; 734 - bool found = false; 735 + struct ieee80211_bss_conf *bss_conf = &vif->bss_conf; 736 + struct ath_beacon_config *cur_conf = &sc->cur_beacon_conf; 737 738 - for (slot = 0; slot < ATH_BCBUF; slot++) { 739 - if (sc->beacon.bslot[slot]) { 740 - avp = (void *)sc->beacon.bslot[slot]->drv_priv; 741 - if (avp->is_bslot_active) { 742 - found = true; 743 - break; 744 - } 745 + ath9k_cache_beacon_config(sc, bss_conf); 746 + 747 + if (sc->sc_ah->opmode == NL80211_IFTYPE_STATION) { 748 + ath9k_set_beacon(sc); 749 + set_bit(SC_OP_BEACONS, &sc->sc_flags); 750 + } else { 751 + /* 752 + * Take care of multiple interfaces when 753 + * enabling/disabling SWBA. 754 + */ 755 + if (changed & BSS_CHANGED_BEACON_ENABLED) { 756 + if (!bss_conf->enable_beacon && 757 + (sc->nbcnvifs <= 1)) 758 + cur_conf->enable_beacon = false; 759 + else if (bss_conf->enable_beacon) 760 + cur_conf->enable_beacon = true; 761 } 762 + 763 + ath9k_set_beacon(sc); 764 + 765 + if (cur_conf->enable_beacon) 766 + set_bit(SC_OP_BEACONS, &sc->sc_flags); 767 + else 768 + clear_bit(SC_OP_BEACONS, &sc->sc_flags); 769 } 770 - return found; 771 } 772 773 - 774 -void ath_set_beacon(struct ath_softc *sc) 775 +void ath9k_set_beacon(struct ath_softc *sc) 776 { 777 struct ath_common *common = ath9k_hw_common(sc->sc_ah); 778 struct ath_beacon_config *cur_conf = &sc->cur_beacon_conf; 779 780 switch (sc->sc_ah->opmode) { 781 case NL80211_IFTYPE_AP: 782 - if (ath_has_valid_bslot(sc)) 783 - ath_beacon_config_ap(sc, cur_conf); 784 + ath9k_beacon_config_ap(sc, cur_conf); 785 break; 786 case NL80211_IFTYPE_ADHOC: 787 case NL80211_IFTYPE_MESH_POINT: 788 - ath_beacon_config_adhoc(sc, cur_conf); 789 + ath9k_beacon_config_adhoc(sc, cur_conf); 790 break; 791 case NL80211_IFTYPE_STATION: 792 - ath_beacon_config_sta(sc, cur_conf); 793 + ath9k_beacon_config_sta(sc, cur_conf); 794 break; 795 default: 796 ath_dbg(common, CONFIG, "Unsupported beaconing mode\n"); 797 return; 798 } 799 - 800 - set_bit(SC_OP_BEACONS, &sc->sc_flags); 801 -} 802 - 803 -void ath9k_set_beaconing_status(struct ath_softc *sc, bool status) 8 804 -{ 9 - return AR_SREV_9300_20_OR_LATER(ah) || modparam_force_new_ani; 10 -} 11 - 12 static void ath9k_hw_update_mibstats(struct ath_hw *ah, 13 struct ath9k_mib_stats *stats) 14 { 15 @@ -122,8 +117,6 @@ static void ath9k_hw_update_mibstats(str 16 static void ath9k_ani_restart(struct ath_hw *ah) 17 { 18 struct ar5416AniState *aniState; 19 - struct ath_common *common = ath9k_hw_common(ah); 20 - u32 ofdm_base = 0, cck_base = 0; 21 22 if (!DO_ANI(ah)) 23 return; 24 @@ -131,18 +124,10 @@ static void ath9k_ani_restart(struct ath 25 aniState = &ah->curchan->ani; 26 aniState->listenTime = 0; 27 28 - if (!use_new_ani(ah)) { 29 - ofdm_base = AR_PHY_COUNTMAX - ah->config.ofdm_trig_high; 30 - cck_base = AR_PHY_COUNTMAX - ah->config.cck_trig_high; 31 - } 32 - 33 - ath_dbg(common, ANI, "Writing ofdmbase=%u cckbase=%u\n", 34 - ofdm_base, cck_base); 35 - 36 ENABLE_REGWRITE_BUFFER(ah); 37 38 - REG_WRITE(ah, AR_PHY_ERR_1, ofdm_base); 39 - REG_WRITE(ah, AR_PHY_ERR_2, cck_base); 40 + REG_WRITE(ah, AR_PHY_ERR_1, 0); 41 + REG_WRITE(ah, AR_PHY_ERR_2, 0); 42 REG_WRITE(ah, AR_PHY_ERR_MASK_1, AR_PHY_ERR_OFDM_TIMING); 43 REG_WRITE(ah, AR_PHY_ERR_MASK_2, AR_PHY_ERR_CCK_TIMING); 44 45 @@ -154,110 +139,6 @@ static void ath9k_ani_restart(struct ath 46 aniState->cckPhyErrCount = 0; 47 } 48 49 -static void ath9k_hw_ani_ofdm_err_trigger_old(struct ath_hw *ah) 50 -{ 51 - struct ieee80211_conf *conf = &ath9k_hw_common(ah)->hw->conf; 52 - struct ar5416AniState *aniState; 53 - int32_t rssi; 54 - 55 - aniState = &ah->curchan->ani; 56 - 57 - if (aniState->noiseImmunityLevel < HAL_NOISE_IMMUNE_MAX) { 58 - if (ath9k_hw_ani_control(ah, ATH9K_ANI_NOISE_IMMUNITY_LEVEL, 59 - aniState->noiseImmunityLevel + 1)) { 60 - return; 61 - } 62 - } 63 - 64 - if (aniState->spurImmunityLevel < HAL_SPUR_IMMUNE_MAX) { 65 - if (ath9k_hw_ani_control(ah, ATH9K_ANI_SPUR_IMMUNITY_LEVEL, 66 - aniState->spurImmunityLevel + 1)) { 67 - return; 68 - } 69 - } 70 - 71 - if (ah->opmode == NL80211_IFTYPE_AP) { 72 - if (aniState->firstepLevel < HAL_FIRST_STEP_MAX) { 73 - ath9k_hw_ani_control(ah, ATH9K_ANI_FIRSTEP_LEVEL, 74 - aniState->firstepLevel + 1); 75 - } 805 - struct ath_hw *ah = sc->sc_ah; 806 - 807 - if (!ath_has_valid_bslot(sc)) { 808 - clear_bit(SC_OP_BEACONS, &sc->sc_flags); 76 809 - return; 77 810 - } 78 - rssi = BEACON_RSSI(ah); 79 - if (rssi > aniState->rssiThrHigh) { 80 - if (!aniState->ofdmWeakSigDetectOff) { 81 - if (ath9k_hw_ani_control(ah, 82 - ATH9K_ANI_OFDM_WEAK_SIGNAL_DETECTION, 83 - false)) { 84 - ath9k_hw_ani_control(ah, 85 - ATH9K_ANI_SPUR_IMMUNITY_LEVEL, 0); 86 - return; 87 - } 811 - 812 - ath9k_ps_wakeup(sc); 813 - if (status) { 814 - /* Re-enable beaconing */ 815 - ah->imask |= ATH9K_INT_SWBA; 816 - ath9k_hw_set_interrupts(ah); 817 - } else { 818 - /* Disable SWBA interrupt */ 819 - ah->imask &= ~ATH9K_INT_SWBA; 820 - ath9k_hw_set_interrupts(ah); 821 - tasklet_kill(&sc->bcon_tasklet); 822 - ath9k_hw_stop_dma_queue(ah, sc->beacon.beaconq); 823 - } 824 - ath9k_ps_restore(sc); 825 } 826 --- a/drivers/net/wireless/ath/ath9k/debug.c 827 +++ b/drivers/net/wireless/ath/ath9k/debug.c 828 @@ -206,10 +206,9 @@ static ssize_t write_file_disable_ani(st 829 830 if (disable_ani) { 831 clear_bit(SC_OP_ANI_RUN, &sc->sc_flags); 832 - del_timer_sync(&common->ani.timer); 833 + ath_stop_ani(sc); 834 } else { 835 - set_bit(SC_OP_ANI_RUN, &sc->sc_flags); 836 - ath_start_ani(common); 837 + ath_check_ani(sc); 838 } 839 840 return count; 841 --- a/drivers/net/wireless/ath/ath9k/debug.h 842 +++ b/drivers/net/wireless/ath/ath9k/debug.h 843 @@ -32,6 +32,19 @@ struct ath_buf; 844 #define RESET_STAT_INC(sc, type) do { } while (0) 845 #endif 846 847 +enum ath_reset_type { 848 + RESET_TYPE_BB_HANG, 849 + RESET_TYPE_BB_WATCHDOG, 850 + RESET_TYPE_FATAL_INT, 851 + RESET_TYPE_TX_ERROR, 852 + RESET_TYPE_TX_HANG, 853 + RESET_TYPE_PLL_HANG, 854 + RESET_TYPE_MAC_HANG, 855 + RESET_TYPE_BEACON_STUCK, 856 + RESET_TYPE_MCI, 857 + __RESET_TYPE_MAX 858 +}; 859 + 860 #ifdef CONFIG_ATH9K_DEBUGFS 861 862 /** 863 @@ -209,17 +222,6 @@ struct ath_rx_stats { 864 u32 rx_frags; 865 }; 866 867 -enum ath_reset_type { 868 - RESET_TYPE_BB_HANG, 869 - RESET_TYPE_BB_WATCHDOG, 870 - RESET_TYPE_FATAL_INT, 871 - RESET_TYPE_TX_ERROR, 872 - RESET_TYPE_TX_HANG, 873 - RESET_TYPE_PLL_HANG, 874 - RESET_TYPE_MAC_HANG, 875 - __RESET_TYPE_MAX 876 -}; 877 - 878 struct ath_stats { 879 struct ath_interrupt_stats istats; 880 struct ath_tx_stats txstats[ATH9K_NUM_TX_QUEUES]; 881 --- a/drivers/net/wireless/ath/ath9k/htc_drv_main.c 882 +++ b/drivers/net/wireless/ath/ath9k/htc_drv_main.c 883 @@ -1111,7 +1111,7 @@ static int ath9k_htc_add_interface(struc 884 885 if ((priv->ah->opmode == NL80211_IFTYPE_AP) && 886 !test_bit(OP_ANI_RUNNING, &priv->op_flags)) { 887 - ath9k_hw_set_tsfadjust(priv->ah, 1); 888 + ath9k_hw_set_tsfadjust(priv->ah, true); 889 ath9k_htc_start_ani(priv); 890 } 891 892 --- a/drivers/net/wireless/ath/ath9k/hw.c 893 +++ b/drivers/net/wireless/ath/ath9k/hw.c 894 @@ -2908,9 +2908,9 @@ void ath9k_hw_reset_tsf(struct ath_hw *a 895 } 896 EXPORT_SYMBOL(ath9k_hw_reset_tsf); 897 898 -void ath9k_hw_set_tsfadjust(struct ath_hw *ah, u32 setting) 899 +void ath9k_hw_set_tsfadjust(struct ath_hw *ah, bool set) 900 { 901 - if (setting) 902 + if (set) 903 ah->misc_mode |= AR_PCU_TX_ADD_TSF; 904 else 905 ah->misc_mode &= ~AR_PCU_TX_ADD_TSF; 906 --- a/drivers/net/wireless/ath/ath9k/hw.h 907 +++ b/drivers/net/wireless/ath/ath9k/hw.h 908 @@ -943,7 +943,7 @@ u32 ath9k_hw_gettsf32(struct ath_hw *ah) 909 u64 ath9k_hw_gettsf64(struct ath_hw *ah); 910 void ath9k_hw_settsf64(struct ath_hw *ah, u64 tsf64); 911 void ath9k_hw_reset_tsf(struct ath_hw *ah); 912 -void ath9k_hw_set_tsfadjust(struct ath_hw *ah, u32 setting); 913 +void ath9k_hw_set_tsfadjust(struct ath_hw *ah, bool set); 914 void ath9k_hw_init_global_settings(struct ath_hw *ah); 915 u32 ar9003_get_pll_sqsum_dvc(struct ath_hw *ah); 916 void ath9k_hw_set11nmac2040(struct ath_hw *ah); 917 --- a/drivers/net/wireless/ath/ath9k/init.c 918 +++ b/drivers/net/wireless/ath/ath9k/init.c 919 @@ -560,7 +560,7 @@ static int ath9k_init_softc(u16 devid, s 920 spin_lock_init(&sc->debug.samp_lock); 921 #endif 922 tasklet_init(&sc->intr_tq, ath9k_tasklet, (unsigned long)sc); 923 - tasklet_init(&sc->bcon_tasklet, ath_beacon_tasklet, 924 + tasklet_init(&sc->bcon_tasklet, ath9k_beacon_tasklet, 925 (unsigned long)sc); 926 927 INIT_WORK(&sc->hw_reset_work, ath_reset_work); 928 --- a/drivers/net/wireless/ath/ath9k/link.c 929 +++ b/drivers/net/wireless/ath/ath9k/link.c 930 @@ -50,8 +50,7 @@ void ath_tx_complete_poll_work(struct wo 931 if (needreset) { 932 ath_dbg(ath9k_hw_common(sc->sc_ah), RESET, 933 "tx hung, resetting the chip\n"); 934 - RESET_STAT_INC(sc, RESET_TYPE_TX_HANG); 935 - ieee80211_queue_work(sc->hw, &sc->hw_reset_work); 936 + ath9k_queue_reset(sc, RESET_TYPE_TX_HANG); 937 return; 938 } 939 940 @@ -69,6 +68,7 @@ void ath_hw_check(struct work_struct *wo 941 unsigned long flags; 942 int busy; 943 u8 is_alive, nbeacon = 1; 944 + enum ath_reset_type type; 945 946 ath9k_ps_wakeup(sc); 947 is_alive = ath9k_hw_check_alive(sc->sc_ah); 948 @@ -78,7 +78,7 @@ void ath_hw_check(struct work_struct *wo 949 else if (!is_alive && AR_SREV_9300(sc->sc_ah)) { 950 ath_dbg(common, RESET, 951 "DCU stuck is detected. Schedule chip reset\n"); 952 - RESET_STAT_INC(sc, RESET_TYPE_MAC_HANG); 953 + type = RESET_TYPE_MAC_HANG; 954 goto sched_reset; 955 } 956 957 @@ -90,7 +90,7 @@ void ath_hw_check(struct work_struct *wo 958 busy, sc->hw_busy_count + 1); 959 if (busy >= 99) { 960 if (++sc->hw_busy_count >= 3) { 961 - RESET_STAT_INC(sc, RESET_TYPE_BB_HANG); 962 + type = RESET_TYPE_BB_HANG; 963 goto sched_reset; 964 } 965 } else if (busy >= 0) { 966 @@ -102,7 +102,7 @@ void ath_hw_check(struct work_struct *wo 967 goto out; 968 969 sched_reset: 970 - ieee80211_queue_work(sc->hw, &sc->hw_reset_work); 971 + ath9k_queue_reset(sc, type); 972 out: 973 ath9k_ps_restore(sc); 974 } 975 @@ -119,8 +119,7 @@ static bool ath_hw_pll_rx_hang_check(str 976 count++; 977 if (count == 3) { 978 ath_dbg(common, RESET, "PLL WAR, resetting the chip\n"); 979 - RESET_STAT_INC(sc, RESET_TYPE_PLL_HANG); 980 - ieee80211_queue_work(sc->hw, &sc->hw_reset_work); 981 + ath9k_queue_reset(sc, RESET_TYPE_PLL_HANG); 982 count = 0; 983 return true; 984 } 985 @@ -432,26 +431,69 @@ set_timer: 986 } 987 } 988 989 -void ath_start_ani(struct ath_common *common) 990 +void ath_start_ani(struct ath_softc *sc) 991 { 992 - struct ath_hw *ah = common->ah; 993 + struct ath_hw *ah = sc->sc_ah; 994 + struct ath_common *common = ath9k_hw_common(ah); 995 unsigned long timestamp = jiffies_to_msecs(jiffies); 996 - struct ath_softc *sc = (struct ath_softc *) common->priv; 997 998 - if (!test_bit(SC_OP_ANI_RUN, &sc->sc_flags)) 999 - return; 1000 - 1001 - if (sc->hw->conf.flags & IEEE80211_CONF_OFFCHANNEL) 1002 + if (common->disable_ani || 1003 + !test_bit(SC_OP_ANI_RUN, &sc->sc_flags) || 1004 + (sc->hw->conf.flags & IEEE80211_CONF_OFFCHANNEL)) 1005 return; 1006 1007 common->ani.longcal_timer = timestamp; 1008 common->ani.shortcal_timer = timestamp; 1009 common->ani.checkani_timer = timestamp; 1010 1011 + ath_dbg(common, ANI, "Starting ANI\n"); 1012 mod_timer(&common->ani.timer, 1013 jiffies + msecs_to_jiffies((u32)ah->config.ani_poll_interval)); 1014 } 1015 1016 +void ath_stop_ani(struct ath_softc *sc) 1017 +{ 1018 + struct ath_common *common = ath9k_hw_common(sc->sc_ah); 1019 + 1020 + ath_dbg(common, ANI, "Stopping ANI\n"); 1021 + del_timer_sync(&common->ani.timer); 1022 +} 1023 + 1024 +void ath_check_ani(struct ath_softc *sc) 1025 +{ 1026 + struct ath_hw *ah = sc->sc_ah; 1027 + struct ath_beacon_config *cur_conf = &sc->cur_beacon_conf; 1028 + 1029 + /* 1030 + * Check for the various conditions in which ANI has to 1031 + * be stopped. 1032 + */ 1033 + if (ah->opmode == NL80211_IFTYPE_ADHOC) { 1034 + if (!cur_conf->enable_beacon) 1035 + goto stop_ani; 1036 + } else if (ah->opmode == NL80211_IFTYPE_AP) { 1037 + if (!cur_conf->enable_beacon) { 1038 + /* 1039 + * Disable ANI only when there are no 1040 + * associated stations. 1041 + */ 1042 + if (!test_bit(SC_OP_PRIM_STA_VIF, &sc->sc_flags)) 1043 + goto stop_ani; 1044 + } 1045 + } else if (ah->opmode == NL80211_IFTYPE_STATION) { 1046 + if (!test_bit(SC_OP_PRIM_STA_VIF, &sc->sc_flags)) 1047 + goto stop_ani; 1048 + } 1049 + 1050 + set_bit(SC_OP_ANI_RUN, &sc->sc_flags); 1051 + ath_start_ani(sc); 1052 + return; 1053 + 1054 +stop_ani: 1055 + clear_bit(SC_OP_ANI_RUN, &sc->sc_flags); 1056 + ath_stop_ani(sc); 1057 +} 1058 + 1059 void ath_update_survey_nf(struct ath_softc *sc, int channel) 1060 { 1061 struct ath_hw *ah = sc->sc_ah; 1062 --- a/drivers/net/wireless/ath/ath9k/main.c 1063 +++ b/drivers/net/wireless/ath/ath9k/main.c 1064 @@ -167,8 +167,6 @@ static void ath_cancel_work(struct ath_s 1065 1066 static void ath_restart_work(struct ath_softc *sc) 1067 { 1068 - struct ath_common *common = ath9k_hw_common(sc->sc_ah); 1069 - 1070 ieee80211_queue_delayed_work(sc->hw, &sc->tx_complete_work, 0); 1071 1072 if (AR_SREV_9340(sc->sc_ah) || AR_SREV_9485(sc->sc_ah) || 1073 @@ -177,21 +175,18 @@ static void ath_restart_work(struct ath_ 1074 msecs_to_jiffies(ATH_PLL_WORK_INTERVAL)); 1075 1076 ath_start_rx_poll(sc, 3); 1077 - 1078 - if (!common->disable_ani) 1079 - ath_start_ani(common); 1080 + ath_start_ani(sc); 1081 } 1082 1083 static bool ath_prepare_reset(struct ath_softc *sc, bool retry_tx, bool flush) 1084 { 1085 struct ath_hw *ah = sc->sc_ah; 1086 - struct ath_common *common = ath9k_hw_common(ah); 1087 bool ret = true; 1088 1089 ieee80211_stop_queues(sc->hw); 1090 1091 sc->hw_busy_count = 0; 1092 - del_timer_sync(&common->ani.timer); 1093 + ath_stop_ani(sc); 1094 del_timer_sync(&sc->rx_poll_timer); 1095 1096 ath9k_debug_samp_bb_mac(sc); 1097 @@ -236,7 +231,7 @@ static bool ath_complete_reset(struct at 1098 if (!test_bit(SC_OP_BEACONS, &sc->sc_flags)) 1099 goto work; 1100 1101 - ath_set_beacon(sc); 1102 + ath9k_set_beacon(sc); 1103 1104 if (ah->opmode == NL80211_IFTYPE_STATION && 1105 test_bit(SC_OP_PRIM_STA_VIF, &sc->sc_flags)) { 1106 @@ -365,6 +360,7 @@ void ath9k_tasklet(unsigned long data) 1107 struct ath_softc *sc = (struct ath_softc *)data; 1108 struct ath_hw *ah = sc->sc_ah; 1109 struct ath_common *common = ath9k_hw_common(ah); 1110 + enum ath_reset_type type; 1111 unsigned long flags; 1112 u32 status = sc->intrstatus; 1113 u32 rxmask; 1114 @@ -374,18 +370,13 @@ void ath9k_tasklet(unsigned long data) 1115 1116 if ((status & ATH9K_INT_FATAL) || 1117 (status & ATH9K_INT_BB_WATCHDOG)) { 1118 -#ifdef CONFIG_ATH9K_DEBUGFS 1119 - enum ath_reset_type type; 1120 1121 if (status & ATH9K_INT_FATAL) 1122 type = RESET_TYPE_FATAL_INT; 1123 else 1124 type = RESET_TYPE_BB_WATCHDOG; 1125 1126 - RESET_STAT_INC(sc, type); 1127 -#endif 1128 - set_bit(SC_OP_HW_RESET, &sc->sc_flags); 1129 - ieee80211_queue_work(sc->hw, &sc->hw_reset_work); 1130 + ath9k_queue_reset(sc, type); 1131 goto out; 1132 } 1133 1134 @@ -575,6 +566,15 @@ static int ath_reset(struct ath_softc *s 1135 return r; 1136 } 1137 1138 +void ath9k_queue_reset(struct ath_softc *sc, enum ath_reset_type type) 1139 +{ 1140 +#ifdef CONFIG_ATH9K_DEBUGFS 1141 + RESET_STAT_INC(sc, type); 1142 +#endif 1143 + set_bit(SC_OP_HW_RESET, &sc->sc_flags); 1144 + ieee80211_queue_work(sc->hw, &sc->hw_reset_work); 1145 +} 1146 + 1147 void ath_reset_work(struct work_struct *work) 1148 { 1149 struct ath_softc *sc = container_of(work, struct ath_softc, hw_reset_work); 1150 @@ -841,16 +841,6 @@ bool ath9k_uses_beacons(int type) 1151 } 1152 } 1153 1154 -static void ath9k_reclaim_beacon(struct ath_softc *sc, 1155 - struct ieee80211_vif *vif) 1156 -{ 1157 - struct ath_vif *avp = (void *)vif->drv_priv; 1158 - 1159 - ath9k_set_beaconing_status(sc, false); 1160 - ath_beacon_return(sc, avp); 1161 - ath9k_set_beaconing_status(sc, true); 1162 -} 1163 - 1164 static void ath9k_vif_iter(void *data, u8 *mac, struct ieee80211_vif *vif) 1165 { 1166 struct ath9k_vif_iter_data *iter_data = data; 1167 @@ -918,18 +908,14 @@ static void ath9k_calculate_summary_stat 1168 1169 ath9k_calculate_iter_data(hw, vif, &iter_data); 1170 1171 - /* Set BSSID mask. */ 1172 memcpy(common->bssidmask, iter_data.mask, ETH_ALEN); 1173 ath_hw_setbssidmask(common); 1174 1175 - /* Set op-mode & TSF */ 1176 if (iter_data.naps > 0) { 1177 - ath9k_hw_set_tsfadjust(ah, 1); 1178 - set_bit(SC_OP_TSF_RESET, &sc->sc_flags); 1179 + ath9k_hw_set_tsfadjust(ah, true); 1180 ah->opmode = NL80211_IFTYPE_AP; 1181 } else { 1182 - ath9k_hw_set_tsfadjust(ah, 0); 1183 - clear_bit(SC_OP_TSF_RESET, &sc->sc_flags); 1184 + ath9k_hw_set_tsfadjust(ah, false); 1185 1186 if (iter_data.nmeshes) 1187 ah->opmode = NL80211_IFTYPE_MESH_POINT; 1188 @@ -941,45 +927,14 @@ static void ath9k_calculate_summary_stat 1189 ah->opmode = NL80211_IFTYPE_STATION; 1190 } 1191 1192 - /* 1193 - * Enable MIB interrupts when there are hardware phy counters. 1194 - */ 1195 + ath9k_hw_setopmode(ah); 1196 + 1197 if ((iter_data.nstations + iter_data.nadhocs + iter_data.nmeshes) > 0) 1198 ah->imask |= ATH9K_INT_TSFOOR; 1199 else 1200 ah->imask &= ~ATH9K_INT_TSFOOR; 1201 1202 ath9k_hw_set_interrupts(ah); 1203 - 1204 - /* Set up ANI */ 1205 - if (iter_data.naps > 0) { 1206 - sc->sc_ah->stats.avgbrssi = ATH_RSSI_DUMMY_MARKER; 1207 - 1208 - if (!common->disable_ani) { 1209 - set_bit(SC_OP_ANI_RUN, &sc->sc_flags); 1210 - ath_start_ani(common); 88 1211 - } 89 - if (aniState->firstepLevel < HAL_FIRST_STEP_MAX) { 90 - ath9k_hw_ani_control(ah, ATH9K_ANI_FIRSTEP_LEVEL, 91 - aniState->firstepLevel + 1); 92 - return; 93 - } 94 - } else if (rssi > aniState->rssiThrLow) { 95 - if (aniState->ofdmWeakSigDetectOff) 96 - ath9k_hw_ani_control(ah, 97 - ATH9K_ANI_OFDM_WEAK_SIGNAL_DETECTION, 98 - true); 99 - if (aniState->firstepLevel < HAL_FIRST_STEP_MAX) 100 - ath9k_hw_ani_control(ah, ATH9K_ANI_FIRSTEP_LEVEL, 101 - aniState->firstepLevel + 1); 102 - return; 1212 - 103 1213 - } else { 104 - if ((conf->channel->band == IEEE80211_BAND_2GHZ) && 105 - !conf_is_ht(conf)) { 106 - if (!aniState->ofdmWeakSigDetectOff) 107 - ath9k_hw_ani_control(ah, 108 - ATH9K_ANI_OFDM_WEAK_SIGNAL_DETECTION, 109 - false); 110 - if (aniState->firstepLevel > 0) 111 - ath9k_hw_ani_control(ah, 112 - ATH9K_ANI_FIRSTEP_LEVEL, 0); 113 - return; 114 - } 1214 - clear_bit(SC_OP_ANI_RUN, &sc->sc_flags); 1215 - del_timer_sync(&common->ani.timer); 115 1216 - } 116 1217 -} 117 1218 - 118 -static void ath9k_hw_ani_cck_err_trigger_old(struct ath_hw *ah) 1219 -/* Called with sc->mutex held, vif counts set up properly. */ 1220 -static void ath9k_do_vif_add_setup(struct ieee80211_hw *hw, 1221 - struct ieee80211_vif *vif) 119 1222 -{ 120 - struct ieee80211_conf *conf = &ath9k_hw_common(ah)->hw->conf; 121 - struct ar5416AniState *aniState; 122 - int32_t rssi; 123 - 124 - aniState = &ah->curchan->ani; 125 - if (aniState->noiseImmunityLevel < HAL_NOISE_IMMUNE_MAX) { 126 - if (ath9k_hw_ani_control(ah, ATH9K_ANI_NOISE_IMMUNITY_LEVEL, 127 - aniState->noiseImmunityLevel + 1)) { 128 - return; 1223 - struct ath_softc *sc = hw->priv; 1224 - 1225 - ath9k_calculate_summary_state(hw, vif); 1226 - 1227 - if (ath9k_uses_beacons(vif->type)) { 1228 - /* Reserve a beacon slot for the vif */ 1229 - ath9k_set_beaconing_status(sc, false); 1230 - ath_beacon_alloc(sc, vif); 1231 - ath9k_set_beaconing_status(sc, true); 1232 - } 1233 } 1234 1235 static int ath9k_add_interface(struct ieee80211_hw *hw, 1236 @@ -1021,7 +976,10 @@ static int ath9k_add_interface(struct ie 1237 1238 sc->nvifs++; 1239 1240 - ath9k_do_vif_add_setup(hw, vif); 1241 + ath9k_calculate_summary_state(hw, vif); 1242 + if (ath9k_uses_beacons(vif->type)) 1243 + ath9k_beacon_assign_slot(sc, vif); 1244 + 1245 out: 1246 mutex_unlock(&sc->mutex); 1247 ath9k_ps_restore(sc); 1248 @@ -1038,6 +996,7 @@ static int ath9k_change_interface(struct 1249 int ret = 0; 1250 1251 ath_dbg(common, CONFIG, "Change Interface\n"); 1252 + 1253 mutex_lock(&sc->mutex); 1254 ath9k_ps_wakeup(sc); 1255 1256 @@ -1050,15 +1009,16 @@ static int ath9k_change_interface(struct 1257 } 1258 } 1259 1260 - /* Clean up old vif stuff */ 1261 if (ath9k_uses_beacons(vif->type)) 1262 - ath9k_reclaim_beacon(sc, vif); 1263 + ath9k_beacon_remove_slot(sc, vif); 1264 1265 - /* Add new settings */ 1266 vif->type = new_type; 1267 vif->p2p = p2p; 1268 1269 - ath9k_do_vif_add_setup(hw, vif); 1270 + ath9k_calculate_summary_state(hw, vif); 1271 + if (ath9k_uses_beacons(vif->type)) 1272 + ath9k_beacon_assign_slot(sc, vif); 1273 + 1274 out: 1275 ath9k_ps_restore(sc); 1276 mutex_unlock(&sc->mutex); 1277 @@ -1078,9 +1038,8 @@ static void ath9k_remove_interface(struc 1278 1279 sc->nvifs--; 1280 1281 - /* Reclaim beacon resources */ 1282 if (ath9k_uses_beacons(vif->type)) 1283 - ath9k_reclaim_beacon(sc, vif); 1284 + ath9k_beacon_remove_slot(sc, vif); 1285 1286 ath9k_calculate_summary_state(hw, NULL); 1287 1288 @@ -1388,10 +1347,6 @@ static int ath9k_conf_tx(struct ieee8021 1289 if (ret) 1290 ath_err(common, "TXQ Update failed\n"); 1291 1292 - if (sc->sc_ah->opmode == NL80211_IFTYPE_ADHOC) 1293 - if (queue == WME_AC_BE && !ret) 1294 - ath_beaconq_config(sc); 1295 - 1296 mutex_unlock(&sc->mutex); 1297 ath9k_ps_restore(sc); 1298 1299 @@ -1460,85 +1415,36 @@ static int ath9k_set_key(struct ieee8021 1300 1301 return ret; 1302 } 1303 -static void ath9k_bss_iter(void *data, u8 *mac, struct ieee80211_vif *vif) 1304 + 1305 +static void ath9k_bss_assoc_iter(void *data, u8 *mac, struct ieee80211_vif *vif) 1306 { 1307 struct ath_softc *sc = data; 1308 struct ath_common *common = ath9k_hw_common(sc->sc_ah); 1309 - struct ieee80211_bss_conf *bss_conf = &vif->bss_conf; 1310 struct ath_vif *avp = (void *)vif->drv_priv; 1311 + struct ieee80211_bss_conf *bss_conf = &vif->bss_conf; 1312 unsigned long flags; 1313 - /* 1314 - * Skip iteration if primary station vif's bss info 1315 - * was not changed 1316 - */ 1317 + 1318 if (test_bit(SC_OP_PRIM_STA_VIF, &sc->sc_flags)) 1319 return; 1320 1321 if (bss_conf->assoc) { 1322 set_bit(SC_OP_PRIM_STA_VIF, &sc->sc_flags); 1323 avp->primary_sta_vif = true; 1324 + 1325 memcpy(common->curbssid, bss_conf->bssid, ETH_ALEN); 1326 common->curaid = bss_conf->aid; 1327 ath9k_hw_write_associd(sc->sc_ah); 1328 - ath_dbg(common, CONFIG, "Bss Info ASSOC %d, bssid: %pM\n", 1329 - bss_conf->aid, common->curbssid); 1330 - ath_beacon_config(sc, vif); 1331 - /* 1332 - * Request a re-configuration of Beacon related timers 1333 - * on the receipt of the first Beacon frame (i.e., 1334 - * after time sync with the AP). 1335 - */ 1336 - spin_lock_irqsave(&sc->sc_pm_lock, flags); 1337 - sc->ps_flags |= PS_BEACON_SYNC | PS_WAIT_FOR_BEACON; 1338 - spin_unlock_irqrestore(&sc->sc_pm_lock, flags); 1339 1340 - /* Reset rssi stats */ 1341 sc->last_rssi = ATH_RSSI_DUMMY_MARKER; 1342 sc->sc_ah->stats.avgbrssi = ATH_RSSI_DUMMY_MARKER; 1343 1344 - ath_start_rx_poll(sc, 3); 1345 - 1346 - if (!common->disable_ani) { 1347 - set_bit(SC_OP_ANI_RUN, &sc->sc_flags); 1348 - ath_start_ani(common); 129 1349 - } 130 - } 131 - if (ah->opmode == NL80211_IFTYPE_AP) { 132 - if (aniState->firstepLevel < HAL_FIRST_STEP_MAX) { 133 - ath9k_hw_ani_control(ah, ATH9K_ANI_FIRSTEP_LEVEL, 134 - aniState->firstepLevel + 1); 135 - } 136 - return; 137 - } 138 - rssi = BEACON_RSSI(ah); 139 - if (rssi > aniState->rssiThrLow) { 140 - if (aniState->firstepLevel < HAL_FIRST_STEP_MAX) 141 - ath9k_hw_ani_control(ah, ATH9K_ANI_FIRSTEP_LEVEL, 142 - aniState->firstepLevel + 1); 143 - } else { 144 - if ((conf->channel->band == IEEE80211_BAND_2GHZ) && 145 - !conf_is_ht(conf)) { 146 - if (aniState->firstepLevel > 0) 147 - ath9k_hw_ani_control(ah, 148 - ATH9K_ANI_FIRSTEP_LEVEL, 0); 149 - } 1350 - 150 1351 - } 151 1352 -} 152 1353 - 153 /* Adjust the OFDM Noise Immunity Level */ 154 static void ath9k_hw_set_ofdm_nil(struct ath_hw *ah, u8 immunityLevel) 155 { 156 @@ -265,18 +146,15 @@ static void ath9k_hw_set_ofdm_nil(struct 1354 -static void ath9k_config_bss(struct ath_softc *sc, struct ieee80211_vif *vif) 1355 -{ 1356 - struct ath_common *common = ath9k_hw_common(sc->sc_ah); 1357 - struct ieee80211_bss_conf *bss_conf = &vif->bss_conf; 1358 - struct ath_vif *avp = (void *)vif->drv_priv; 1359 - 1360 - if (sc->sc_ah->opmode != NL80211_IFTYPE_STATION) 1361 - return; 1362 - 1363 - /* Reconfigure bss info */ 1364 - if (avp->primary_sta_vif && !bss_conf->assoc) { 1365 - ath_dbg(common, CONFIG, "Bss Info DISASSOC %d, bssid %pM\n", 1366 - common->curaid, common->curbssid); 1367 - clear_bit(SC_OP_PRIM_STA_VIF, &sc->sc_flags); 1368 - clear_bit(SC_OP_BEACONS, &sc->sc_flags); 1369 - avp->primary_sta_vif = false; 1370 - memset(common->curbssid, 0, ETH_ALEN); 1371 - common->curaid = 0; 1372 - } 1373 - 1374 - ieee80211_iterate_active_interfaces_atomic( 1375 - sc->hw, ath9k_bss_iter, sc); 1376 + spin_lock_irqsave(&sc->sc_pm_lock, flags); 1377 + sc->ps_flags |= PS_BEACON_SYNC | PS_WAIT_FOR_BEACON; 1378 + spin_unlock_irqrestore(&sc->sc_pm_lock, flags); 1379 1380 - /* 1381 - * None of station vifs are associated. 1382 - * Clear bssid & aid 1383 - */ 1384 - if (!test_bit(SC_OP_PRIM_STA_VIF, &sc->sc_flags)) { 1385 - ath9k_hw_write_associd(sc->sc_ah); 1386 - clear_bit(SC_OP_ANI_RUN, &sc->sc_flags); 1387 - del_timer_sync(&common->ani.timer); 1388 - del_timer_sync(&sc->rx_poll_timer); 1389 - memset(&sc->caldata, 0, sizeof(sc->caldata)); 1390 + ath_dbg(common, CONFIG, 1391 + "Primary Station interface: %pM, BSSID: %pM\n", 1392 + vif->addr, common->curbssid); 1393 } 1394 } 1395 1396 @@ -1547,6 +1453,11 @@ static void ath9k_bss_info_changed(struc 1397 struct ieee80211_bss_conf *bss_conf, 1398 u32 changed) 1399 { 1400 +#define CHECK_ANI \ 1401 + (BSS_CHANGED_ASSOC | \ 1402 + BSS_CHANGED_IBSS | \ 1403 + BSS_CHANGED_BEACON_ENABLED) 1404 + 1405 struct ath_softc *sc = hw->priv; 1406 struct ath_hw *ah = sc->sc_ah; 157 1407 struct ath_common *common = ath9k_hw_common(ah); 158 const struct ani_ofdm_level_entry *entry_ofdm; 159 const struct ani_cck_level_entry *entry_cck; 160 - 161 - aniState->noiseFloor = BEACON_RSSI(ah); 162 + bool weak_sig; 163 164 ath_dbg(common, ANI, "**** ofdmlevel %d=>%d, rssi=%d[lo=%d hi=%d]\n", 165 aniState->ofdmNoiseImmunityLevel, 166 - immunityLevel, aniState->noiseFloor, 167 + immunityLevel, BEACON_RSSI(ah), 168 aniState->rssiThrLow, aniState->rssiThrHigh); 169 170 if (aniState->update_ani) 171 - aniState->ofdmNoiseImmunityLevel = 172 - (immunityLevel > ATH9K_ANI_OFDM_DEF_LEVEL) ? 173 - immunityLevel : ATH9K_ANI_OFDM_DEF_LEVEL; 174 + aniState->ofdmNoiseImmunityLevel = immunityLevel; 175 176 entry_ofdm = &ofdm_level_table[aniState->ofdmNoiseImmunityLevel]; 177 entry_cck = &cck_level_table[aniState->cckNoiseImmunityLevel]; 178 @@ -292,12 +170,22 @@ static void ath9k_hw_set_ofdm_nil(struct 179 ATH9K_ANI_FIRSTEP_LEVEL, 180 entry_ofdm->fir_step_level); 181 182 - if ((aniState->noiseFloor >= aniState->rssiThrHigh) && 183 - (!aniState->ofdmWeakSigDetectOff != 184 - entry_ofdm->ofdm_weak_signal_on)) { 185 + weak_sig = entry_ofdm->ofdm_weak_signal_on; 186 + if (ah->opmode == NL80211_IFTYPE_STATION && 187 + BEACON_RSSI(ah) <= aniState->rssiThrHigh) 188 + weak_sig = true; 189 + 190 + if (aniState->ofdmWeakSigDetect != weak_sig) 191 ath9k_hw_ani_control(ah, 192 ATH9K_ANI_OFDM_WEAK_SIGNAL_DETECTION, 193 entry_ofdm->ofdm_weak_signal_on); 194 + 195 + if (aniState->ofdmNoiseImmunityLevel >= ATH9K_ANI_OFDM_DEF_LEVEL) { 196 + ah->config.ofdm_trig_high = ATH9K_ANI_OFDM_TRIG_HIGH; 197 + ah->config.ofdm_trig_low = ATH9K_ANI_OFDM_TRIG_LOW_ABOVE_INI; 198 + } else { 199 + ah->config.ofdm_trig_high = ATH9K_ANI_OFDM_TRIG_HIGH_BELOW_INI; 200 + ah->config.ofdm_trig_low = ATH9K_ANI_OFDM_TRIG_LOW; 201 } 202 } 203 204 @@ -308,11 +196,6 @@ static void ath9k_hw_ani_ofdm_err_trigge 205 if (!DO_ANI(ah)) 1408 @@ -1557,53 +1468,43 @@ static void ath9k_bss_info_changed(struc 1409 mutex_lock(&sc->mutex); 1410 1411 if (changed & BSS_CHANGED_ASSOC) { 1412 - ath9k_config_bss(sc, vif); 1413 + ath_dbg(common, CONFIG, "BSSID %pM Changed ASSOC %d\n", 1414 + bss_conf->bssid, bss_conf->assoc); 1415 1416 - ath_dbg(common, CONFIG, "BSSID: %pM aid: 0x%x\n", 1417 - common->curbssid, common->curaid); 1418 + /* 1419 + * Do not do anything when the opmode is not STATION. 1420 + */ 1421 + if (ah->opmode == NL80211_IFTYPE_STATION) { 1422 + if (avp->primary_sta_vif && !bss_conf->assoc) { 1423 + clear_bit(SC_OP_PRIM_STA_VIF, &sc->sc_flags); 1424 + clear_bit(SC_OP_BEACONS, &sc->sc_flags); 1425 + avp->primary_sta_vif = false; 1426 + } 1427 + 1428 + ieee80211_iterate_active_interfaces_atomic(sc->hw, 1429 + ath9k_bss_assoc_iter, sc); 1430 + 1431 + if (!test_bit(SC_OP_PRIM_STA_VIF, &sc->sc_flags)) { 1432 + memset(common->curbssid, 0, ETH_ALEN); 1433 + common->curaid = 0; 1434 + ath9k_hw_write_associd(sc->sc_ah); 1435 + } 1436 + } 1437 } 1438 1439 if (changed & BSS_CHANGED_IBSS) { 1440 - /* There can be only one vif available */ 1441 memcpy(common->curbssid, bss_conf->bssid, ETH_ALEN); 1442 common->curaid = bss_conf->aid; 1443 ath9k_hw_write_associd(sc->sc_ah); 1444 - 1445 - if (bss_conf->ibss_joined) { 1446 - sc->sc_ah->stats.avgbrssi = ATH_RSSI_DUMMY_MARKER; 1447 - 1448 - if (!common->disable_ani) { 1449 - set_bit(SC_OP_ANI_RUN, &sc->sc_flags); 1450 - ath_start_ani(common); 1451 - } 1452 - 1453 - } else { 1454 - clear_bit(SC_OP_ANI_RUN, &sc->sc_flags); 1455 - del_timer_sync(&common->ani.timer); 1456 - del_timer_sync(&sc->rx_poll_timer); 1457 - } 1458 } 1459 1460 - /* 1461 - * In case of AP mode, the HW TSF has to be reset 1462 - * when the beacon interval changes. 1463 - */ 1464 - if ((changed & BSS_CHANGED_BEACON_INT) && 1465 - (vif->type == NL80211_IFTYPE_AP)) 1466 - set_bit(SC_OP_TSF_RESET, &sc->sc_flags); 1467 - 1468 - /* Configure beaconing (AP, IBSS, MESH) */ 1469 - if (ath9k_uses_beacons(vif->type) && 1470 - ((changed & BSS_CHANGED_BEACON) || 1471 - (changed & BSS_CHANGED_BEACON_ENABLED) || 1472 - (changed & BSS_CHANGED_BEACON_INT))) { 1473 - ath9k_set_beaconing_status(sc, false); 1474 - if (bss_conf->enable_beacon) 1475 - ath_beacon_alloc(sc, vif); 1476 - else 1477 - avp->is_bslot_active = false; 1478 - ath_beacon_config(sc, vif); 1479 - ath9k_set_beaconing_status(sc, true); 1480 + if ((changed & BSS_CHANGED_BEACON) || 1481 + (changed & BSS_CHANGED_BEACON_ENABLED) || 1482 + (changed & BSS_CHANGED_BEACON_INT)) { 1483 + if (ah->opmode == NL80211_IFTYPE_AP) 1484 + ath9k_set_tsfadjust(sc, vif); 1485 + if (ath9k_allow_beacon_config(sc, vif)) 1486 + ath9k_beacon_config(sc, vif, changed); 1487 } 1488 1489 if (changed & BSS_CHANGED_ERP_SLOT) { 1490 @@ -1625,8 +1526,13 @@ static void ath9k_bss_info_changed(struc 1491 } 1492 } 1493 1494 + if (changed & CHECK_ANI) 1495 + ath_check_ani(sc); 1496 + 1497 mutex_unlock(&sc->mutex); 1498 ath9k_ps_restore(sc); 1499 + 1500 +#undef CHECK_ANI 1501 } 1502 1503 static u64 ath9k_get_tsf(struct ieee80211_hw *hw, struct ieee80211_vif *vif) 1504 @@ -1855,10 +1761,11 @@ static int ath9k_tx_last_beacon(struct i 1505 if (!vif) 1506 return 0; 1507 1508 - avp = (void *)vif->drv_priv; 1509 - if (!avp->is_bslot_active) 1510 + if (!vif->bss_conf.enable_beacon) 1511 return 0; 1512 1513 + avp = (void *)vif->drv_priv; 1514 + 1515 if (!sc->beacon.tx_processed && !edma) { 1516 tasklet_disable(&sc->bcon_tasklet); 1517 1518 --- a/drivers/net/wireless/ath/ath9k/mci.c 1519 +++ b/drivers/net/wireless/ath/ath9k/mci.c 1520 @@ -202,7 +202,7 @@ static void ath_mci_cal_msg(struct ath_s 1521 case MCI_GPM_BT_CAL_REQ: 1522 if (mci_hw->bt_state == MCI_BT_AWAKE) { 1523 ar9003_mci_state(ah, MCI_STATE_SET_BT_CAL_START); 1524 - ieee80211_queue_work(sc->hw, &sc->hw_reset_work); 1525 + ath9k_queue_reset(sc, RESET_TYPE_MCI); 1526 } 1527 ath_dbg(common, MCI, "MCI State : %d\n", mci_hw->bt_state); 1528 break; 1529 --- a/drivers/net/wireless/ath/ath9k/recv.c 1530 +++ b/drivers/net/wireless/ath/ath9k/recv.c 1531 @@ -553,7 +553,7 @@ static void ath_rx_ps_beacon(struct ath_ 1532 sc->ps_flags &= ~PS_BEACON_SYNC; 1533 ath_dbg(common, PS, 1534 "Reconfigure Beacon timers based on timestamp from the AP\n"); 1535 - ath_set_beacon(sc); 1536 + ath9k_set_beacon(sc); 1537 } 1538 1539 if (ath_beacon_dtim_pending_cab(skb)) { 1540 --- a/drivers/net/wireless/ath/ath9k/xmit.c 1541 +++ b/drivers/net/wireless/ath/ath9k/xmit.c 1542 @@ -614,10 +614,8 @@ static void ath_tx_complete_aggr(struct 1543 1544 rcu_read_unlock(); 1545 1546 - if (needreset) { 1547 - RESET_STAT_INC(sc, RESET_TYPE_TX_ERROR); 1548 - ieee80211_queue_work(sc->hw, &sc->hw_reset_work); 1549 - } 1550 + if (needreset) 1551 + ath9k_queue_reset(sc, RESET_TYPE_TX_ERROR); 1552 } 1553 1554 static bool ath_lookup_legacy(struct ath_buf *bf) 1555 @@ -1586,7 +1584,8 @@ void ath_txq_schedule(struct ath_softc * 1556 struct ath_atx_ac *ac, *ac_tmp, *last_ac; 1557 struct ath_atx_tid *tid, *last_tid; 1558 1559 - if (work_pending(&sc->hw_reset_work) || list_empty(&txq->axq_acq) || 1560 + if (test_bit(SC_OP_HW_RESET, &sc->sc_flags) || 1561 + list_empty(&txq->axq_acq) || 1562 txq->axq_ampdu_depth >= ATH_AGGR_MIN_QDEPTH) 206 1563 return; 207 1564 208 - if (!use_new_ani(ah)) { 209 - ath9k_hw_ani_ofdm_err_trigger_old(ah); 210 - return; 211 - } 212 - 213 aniState = &ah->curchan->ani; 214 215 if (aniState->ofdmNoiseImmunityLevel < ATH9K_ANI_OFDM_MAX_LEVEL) 216 @@ -329,22 +212,18 @@ static void ath9k_hw_set_cck_nil(struct 217 const struct ani_ofdm_level_entry *entry_ofdm; 218 const struct ani_cck_level_entry *entry_cck; 219 220 - aniState->noiseFloor = BEACON_RSSI(ah); 221 ath_dbg(common, ANI, "**** ccklevel %d=>%d, rssi=%d[lo=%d hi=%d]\n", 222 aniState->cckNoiseImmunityLevel, immunityLevel, 223 - aniState->noiseFloor, aniState->rssiThrLow, 224 + BEACON_RSSI(ah), aniState->rssiThrLow, 225 aniState->rssiThrHigh); 226 227 - if ((ah->opmode == NL80211_IFTYPE_STATION || 228 - ah->opmode == NL80211_IFTYPE_ADHOC) && 229 - aniState->noiseFloor <= aniState->rssiThrLow && 230 + if (ah->opmode == NL80211_IFTYPE_STATION && 231 + BEACON_RSSI(ah) <= aniState->rssiThrLow && 232 immunityLevel > ATH9K_ANI_CCK_MAX_LEVEL_LOW_RSSI) 233 immunityLevel = ATH9K_ANI_CCK_MAX_LEVEL_LOW_RSSI; 234 235 if (aniState->update_ani) 236 - aniState->cckNoiseImmunityLevel = 237 - (immunityLevel > ATH9K_ANI_CCK_DEF_LEVEL) ? 238 - immunityLevel : ATH9K_ANI_CCK_DEF_LEVEL; 239 + aniState->cckNoiseImmunityLevel = immunityLevel; 240 241 entry_ofdm = &ofdm_level_table[aniState->ofdmNoiseImmunityLevel]; 242 entry_cck = &cck_level_table[aniState->cckNoiseImmunityLevel]; 243 @@ -372,70 +251,12 @@ static void ath9k_hw_ani_cck_err_trigger 244 if (!DO_ANI(ah)) 245 return; 246 247 - if (!use_new_ani(ah)) { 248 - ath9k_hw_ani_cck_err_trigger_old(ah); 249 - return; 250 - } 251 - 252 aniState = &ah->curchan->ani; 253 254 if (aniState->cckNoiseImmunityLevel < ATH9K_ANI_CCK_MAX_LEVEL) 255 ath9k_hw_set_cck_nil(ah, aniState->cckNoiseImmunityLevel + 1); 256 } 257 258 -static void ath9k_hw_ani_lower_immunity_old(struct ath_hw *ah) 259 -{ 260 - struct ar5416AniState *aniState; 261 - int32_t rssi; 262 - 263 - aniState = &ah->curchan->ani; 264 - 265 - if (ah->opmode == NL80211_IFTYPE_AP) { 266 - if (aniState->firstepLevel > 0) { 267 - if (ath9k_hw_ani_control(ah, ATH9K_ANI_FIRSTEP_LEVEL, 268 - aniState->firstepLevel - 1)) 269 - return; 270 - } 271 - } else { 272 - rssi = BEACON_RSSI(ah); 273 - if (rssi > aniState->rssiThrHigh) { 274 - /* XXX: Handle me */ 275 - } else if (rssi > aniState->rssiThrLow) { 276 - if (aniState->ofdmWeakSigDetectOff) { 277 - if (ath9k_hw_ani_control(ah, 278 - ATH9K_ANI_OFDM_WEAK_SIGNAL_DETECTION, 279 - true)) 280 - return; 281 - } 282 - if (aniState->firstepLevel > 0) { 283 - if (ath9k_hw_ani_control(ah, 284 - ATH9K_ANI_FIRSTEP_LEVEL, 285 - aniState->firstepLevel - 1)) 286 - return; 287 - } 288 - } else { 289 - if (aniState->firstepLevel > 0) { 290 - if (ath9k_hw_ani_control(ah, 291 - ATH9K_ANI_FIRSTEP_LEVEL, 292 - aniState->firstepLevel - 1)) 293 - return; 294 - } 295 - } 296 - } 297 - 298 - if (aniState->spurImmunityLevel > 0) { 299 - if (ath9k_hw_ani_control(ah, ATH9K_ANI_SPUR_IMMUNITY_LEVEL, 300 - aniState->spurImmunityLevel - 1)) 301 - return; 302 - } 303 - 304 - if (aniState->noiseImmunityLevel > 0) { 305 - ath9k_hw_ani_control(ah, ATH9K_ANI_NOISE_IMMUNITY_LEVEL, 306 - aniState->noiseImmunityLevel - 1); 307 - return; 308 - } 309 -} 310 - 311 /* 312 * only lower either OFDM or CCK errors per turn 313 * we lower the other one next time 314 @@ -446,11 +267,6 @@ static void ath9k_hw_ani_lower_immunity( 315 316 aniState = &ah->curchan->ani; 317 318 - if (!use_new_ani(ah)) { 319 - ath9k_hw_ani_lower_immunity_old(ah); 320 - return; 321 - } 322 - 323 /* lower OFDM noise immunity */ 324 if (aniState->ofdmNoiseImmunityLevel > 0 && 325 (aniState->ofdmsTurn || aniState->cckNoiseImmunityLevel == 0)) { 326 @@ -463,72 +279,6 @@ static void ath9k_hw_ani_lower_immunity( 327 ath9k_hw_set_cck_nil(ah, aniState->cckNoiseImmunityLevel - 1); 328 } 329 330 -static void ath9k_ani_reset_old(struct ath_hw *ah, bool is_scanning) 331 -{ 332 - struct ar5416AniState *aniState; 333 - struct ath9k_channel *chan = ah->curchan; 334 - struct ath_common *common = ath9k_hw_common(ah); 335 - 336 - if (!DO_ANI(ah)) 337 - return; 338 - 339 - aniState = &ah->curchan->ani; 340 - 341 - if (ah->opmode != NL80211_IFTYPE_STATION 342 - && ah->opmode != NL80211_IFTYPE_ADHOC) { 343 - ath_dbg(common, ANI, "Reset ANI state opmode %u\n", ah->opmode); 344 - ah->stats.ast_ani_reset++; 345 - 346 - if (ah->opmode == NL80211_IFTYPE_AP) { 347 - /* 348 - * ath9k_hw_ani_control() will only process items set on 349 - * ah->ani_function 350 - */ 351 - if (IS_CHAN_2GHZ(chan)) 352 - ah->ani_function = (ATH9K_ANI_SPUR_IMMUNITY_LEVEL | 353 - ATH9K_ANI_FIRSTEP_LEVEL); 354 - else 355 - ah->ani_function = 0; 356 - } 357 - 358 - ath9k_hw_ani_control(ah, ATH9K_ANI_NOISE_IMMUNITY_LEVEL, 0); 359 - ath9k_hw_ani_control(ah, ATH9K_ANI_SPUR_IMMUNITY_LEVEL, 0); 360 - ath9k_hw_ani_control(ah, ATH9K_ANI_FIRSTEP_LEVEL, 0); 361 - ath9k_hw_ani_control(ah, ATH9K_ANI_OFDM_WEAK_SIGNAL_DETECTION, 362 - !ATH9K_ANI_USE_OFDM_WEAK_SIG); 363 - ath9k_hw_ani_control(ah, ATH9K_ANI_CCK_WEAK_SIGNAL_THR, 364 - ATH9K_ANI_CCK_WEAK_SIG_THR); 365 - 366 - ath9k_ani_restart(ah); 367 - return; 368 - } 369 - 370 - if (aniState->noiseImmunityLevel != 0) 371 - ath9k_hw_ani_control(ah, ATH9K_ANI_NOISE_IMMUNITY_LEVEL, 372 - aniState->noiseImmunityLevel); 373 - if (aniState->spurImmunityLevel != 0) 374 - ath9k_hw_ani_control(ah, ATH9K_ANI_SPUR_IMMUNITY_LEVEL, 375 - aniState->spurImmunityLevel); 376 - if (aniState->ofdmWeakSigDetectOff) 377 - ath9k_hw_ani_control(ah, ATH9K_ANI_OFDM_WEAK_SIGNAL_DETECTION, 378 - !aniState->ofdmWeakSigDetectOff); 379 - if (aniState->cckWeakSigThreshold) 380 - ath9k_hw_ani_control(ah, ATH9K_ANI_CCK_WEAK_SIGNAL_THR, 381 - aniState->cckWeakSigThreshold); 382 - if (aniState->firstepLevel != 0) 383 - ath9k_hw_ani_control(ah, ATH9K_ANI_FIRSTEP_LEVEL, 384 - aniState->firstepLevel); 385 - 386 - ath9k_ani_restart(ah); 387 - 388 - ENABLE_REGWRITE_BUFFER(ah); 389 - 390 - REG_WRITE(ah, AR_PHY_ERR_MASK_1, AR_PHY_ERR_OFDM_TIMING); 391 - REG_WRITE(ah, AR_PHY_ERR_MASK_2, AR_PHY_ERR_CCK_TIMING); 392 - 393 - REGWRITE_BUFFER_FLUSH(ah); 394 -} 395 - 396 /* 397 * Restore the ANI parameters in the HAL and reset the statistics. 398 * This routine should be called for every hardware reset and for 399 @@ -539,13 +289,11 @@ void ath9k_ani_reset(struct ath_hw *ah, 400 struct ar5416AniState *aniState = &ah->curchan->ani; 401 struct ath9k_channel *chan = ah->curchan; 402 struct ath_common *common = ath9k_hw_common(ah); 403 + int ofdm_nil, cck_nil; 404 405 if (!DO_ANI(ah)) 406 return; 407 408 - if (!use_new_ani(ah)) 409 - return ath9k_ani_reset_old(ah, is_scanning); 410 - 411 BUG_ON(aniState == NULL); 412 ah->stats.ast_ani_reset++; 413 414 @@ -563,6 +311,11 @@ void ath9k_ani_reset(struct ath_hw *ah, 415 /* always allow mode (on/off) to be controlled */ 416 ah->ani_function |= ATH9K_ANI_MODE; 417 418 + ofdm_nil = max_t(int, ATH9K_ANI_OFDM_DEF_LEVEL, 419 + aniState->ofdmNoiseImmunityLevel); 420 + cck_nil = max_t(int, ATH9K_ANI_CCK_DEF_LEVEL, 421 + aniState->cckNoiseImmunityLevel); 422 + 423 if (is_scanning || 424 (ah->opmode != NL80211_IFTYPE_STATION && 425 ah->opmode != NL80211_IFTYPE_ADHOC)) { 426 @@ -586,8 +339,8 @@ void ath9k_ani_reset(struct ath_hw *ah, 427 aniState->cckNoiseImmunityLevel); 428 429 aniState->update_ani = false; 430 - ath9k_hw_set_ofdm_nil(ah, ATH9K_ANI_OFDM_DEF_LEVEL); 431 - ath9k_hw_set_cck_nil(ah, ATH9K_ANI_CCK_DEF_LEVEL); 432 + ofdm_nil = ATH9K_ANI_OFDM_DEF_LEVEL; 433 + cck_nil = ATH9K_ANI_CCK_DEF_LEVEL; 434 } 435 } else { 436 /* 437 @@ -603,11 +356,9 @@ void ath9k_ani_reset(struct ath_hw *ah, 438 aniState->cckNoiseImmunityLevel); 439 440 aniState->update_ani = true; 441 - ath9k_hw_set_ofdm_nil(ah, 442 - aniState->ofdmNoiseImmunityLevel); 443 - ath9k_hw_set_cck_nil(ah, 444 - aniState->cckNoiseImmunityLevel); 445 } 446 + ath9k_hw_set_ofdm_nil(ah, ofdm_nil); 447 + ath9k_hw_set_cck_nil(ah, cck_nil); 448 449 /* 450 * enable phy counters if hw supports or if not, enable phy 451 @@ -627,9 +378,6 @@ static bool ath9k_hw_ani_read_counters(s 452 { 453 struct ath_common *common = ath9k_hw_common(ah); 454 struct ar5416AniState *aniState = &ah->curchan->ani; 455 - u32 ofdm_base = 0; 456 - u32 cck_base = 0; 457 - u32 ofdmPhyErrCnt, cckPhyErrCnt; 458 u32 phyCnt1, phyCnt2; 459 int32_t listenTime; 460 461 @@ -642,11 +390,6 @@ static bool ath9k_hw_ani_read_counters(s 462 return false; 463 } 464 465 - if (!use_new_ani(ah)) { 466 - ofdm_base = AR_PHY_COUNTMAX - ah->config.ofdm_trig_high; 467 - cck_base = AR_PHY_COUNTMAX - ah->config.cck_trig_high; 468 - } 469 - 470 aniState->listenTime += listenTime; 471 472 ath9k_hw_update_mibstats(ah, &ah->ah_mibStats); 473 @@ -654,35 +397,12 @@ static bool ath9k_hw_ani_read_counters(s 474 phyCnt1 = REG_READ(ah, AR_PHY_ERR_1); 475 phyCnt2 = REG_READ(ah, AR_PHY_ERR_2); 476 477 - if (!use_new_ani(ah) && (phyCnt1 < ofdm_base || phyCnt2 < cck_base)) { 478 - if (phyCnt1 < ofdm_base) { 479 - ath_dbg(common, ANI, 480 - "phyCnt1 0x%x, resetting counter value to 0x%x\n", 481 - phyCnt1, ofdm_base); 482 - REG_WRITE(ah, AR_PHY_ERR_1, ofdm_base); 483 - REG_WRITE(ah, AR_PHY_ERR_MASK_1, 484 - AR_PHY_ERR_OFDM_TIMING); 485 - } 486 - if (phyCnt2 < cck_base) { 487 - ath_dbg(common, ANI, 488 - "phyCnt2 0x%x, resetting counter value to 0x%x\n", 489 - phyCnt2, cck_base); 490 - REG_WRITE(ah, AR_PHY_ERR_2, cck_base); 491 - REG_WRITE(ah, AR_PHY_ERR_MASK_2, 492 - AR_PHY_ERR_CCK_TIMING); 493 - } 494 - return false; 495 - } 496 + ah->stats.ast_ani_ofdmerrs += phyCnt1 - aniState->ofdmPhyErrCount; 497 + aniState->ofdmPhyErrCount = phyCnt1; 498 + 499 + ah->stats.ast_ani_cckerrs += phyCnt2 - aniState->cckPhyErrCount; 500 + aniState->cckPhyErrCount = phyCnt2; 501 502 - ofdmPhyErrCnt = phyCnt1 - ofdm_base; 503 - ah->stats.ast_ani_ofdmerrs += 504 - ofdmPhyErrCnt - aniState->ofdmPhyErrCount; 505 - aniState->ofdmPhyErrCount = ofdmPhyErrCnt; 506 - 507 - cckPhyErrCnt = phyCnt2 - cck_base; 508 - ah->stats.ast_ani_cckerrs += 509 - cckPhyErrCnt - aniState->cckPhyErrCount; 510 - aniState->cckPhyErrCount = cckPhyErrCnt; 511 return true; 512 } 513 514 @@ -716,21 +436,10 @@ void ath9k_hw_ani_monitor(struct ath_hw 515 516 if (aniState->listenTime > ah->aniperiod) { 517 if (cckPhyErrRate < ah->config.cck_trig_low && 518 - ((ofdmPhyErrRate < ah->config.ofdm_trig_low && 519 - aniState->ofdmNoiseImmunityLevel < 520 - ATH9K_ANI_OFDM_DEF_LEVEL) || 521 - (ofdmPhyErrRate < ATH9K_ANI_OFDM_TRIG_LOW_ABOVE_INI && 522 - aniState->ofdmNoiseImmunityLevel >= 523 - ATH9K_ANI_OFDM_DEF_LEVEL))) { 524 + ofdmPhyErrRate < ah->config.ofdm_trig_low) { 525 ath9k_hw_ani_lower_immunity(ah); 526 aniState->ofdmsTurn = !aniState->ofdmsTurn; 527 - } else if ((ofdmPhyErrRate > ah->config.ofdm_trig_high && 528 - aniState->ofdmNoiseImmunityLevel >= 529 - ATH9K_ANI_OFDM_DEF_LEVEL) || 530 - (ofdmPhyErrRate > 531 - ATH9K_ANI_OFDM_TRIG_HIGH_BELOW_INI && 532 - aniState->ofdmNoiseImmunityLevel < 533 - ATH9K_ANI_OFDM_DEF_LEVEL)) { 534 + } else if (ofdmPhyErrRate > ah->config.ofdm_trig_high) { 535 ath9k_hw_ani_ofdm_err_trigger(ah); 536 aniState->ofdmsTurn = false; 537 } else if (cckPhyErrRate > ah->config.cck_trig_high) { 538 @@ -778,49 +487,6 @@ void ath9k_hw_disable_mib_counters(struc 539 } 540 EXPORT_SYMBOL(ath9k_hw_disable_mib_counters); 541 542 -/* 543 - * Process a MIB interrupt. We may potentially be invoked because 544 - * any of the MIB counters overflow/trigger so don't assume we're 545 - * here because a PHY error counter triggered. 1565 @@ -2191,7 +2190,7 @@ static void ath_tx_processq(struct ath_s 1566 1567 ath_txq_lock(sc, txq); 1568 for (;;) { 1569 - if (work_pending(&sc->hw_reset_work)) 1570 + if (test_bit(SC_OP_HW_RESET, &sc->sc_flags)) 1571 break; 1572 1573 if (list_empty(&txq->axq_q)) { 1574 @@ -2274,7 +2273,7 @@ void ath_tx_edma_tasklet(struct ath_soft 1575 int status; 1576 1577 for (;;) { 1578 - if (work_pending(&sc->hw_reset_work)) 1579 + if (test_bit(SC_OP_HW_RESET, &sc->sc_flags)) 1580 break; 1581 1582 status = ath9k_hw_txprocdesc(ah, NULL, (void *)&ts); 1583 --- a/include/net/mac80211.h 1584 +++ b/include/net/mac80211.h 1585 @@ -3596,22 +3596,6 @@ void ieee80211_request_smps(struct ieee8 1586 enum ieee80211_smps_mode smps_mode); 1587 1588 /** 1589 - * ieee80211_key_removed - disable hw acceleration for key 1590 - * @key_conf: The key hw acceleration should be disabled for 1591 - * 1592 - * This allows drivers to indicate that the given key has been 1593 - * removed from hardware acceleration, due to a new key that 1594 - * was added. Don't use this if the key can continue to be used 1595 - * for TX, if the key restriction is on RX only it is permitted 1596 - * to keep the key for TX only and not call this function. 1597 - * 1598 - * Due to locking constraints, it may only be called during 1599 - * @set_key. This function must be allowed to sleep, and the 1600 - * key it tries to disable may still be used until it returns. 546 1601 - */ 547 -void ath9k_hw_proc_mib_event(struct ath_hw *ah) 548 -{ 549 - u32 phyCnt1, phyCnt2; 550 - 551 - /* Reset these counters regardless */ 552 - REG_WRITE(ah, AR_FILT_OFDM, 0); 553 - REG_WRITE(ah, AR_FILT_CCK, 0); 554 - if (!(REG_READ(ah, AR_SLP_MIB_CTRL) & AR_SLP_MIB_PENDING)) 555 - REG_WRITE(ah, AR_SLP_MIB_CTRL, AR_SLP_MIB_CLEAR); 556 - 557 - /* Clear the mib counters and save them in the stats */ 558 - ath9k_hw_update_mibstats(ah, &ah->ah_mibStats); 559 - 560 - if (!DO_ANI(ah)) { 561 - /* 562 - * We must always clear the interrupt cause by 563 - * resetting the phy error regs. 564 - */ 565 - REG_WRITE(ah, AR_PHY_ERR_1, 0); 566 - REG_WRITE(ah, AR_PHY_ERR_2, 0); 567 - return; 568 - } 569 - 570 - /* NB: these are not reset-on-read */ 571 - phyCnt1 = REG_READ(ah, AR_PHY_ERR_1); 572 - phyCnt2 = REG_READ(ah, AR_PHY_ERR_2); 573 - if (((phyCnt1 & AR_MIBCNT_INTRMASK) == AR_MIBCNT_INTRMASK) || 574 - ((phyCnt2 & AR_MIBCNT_INTRMASK) == AR_MIBCNT_INTRMASK)) { 575 - 576 - if (!use_new_ani(ah)) 577 - ath9k_hw_ani_read_counters(ah); 578 - 579 - /* NB: always restart to insure the h/w counters are reset */ 580 - ath9k_ani_restart(ah); 581 - } 582 -} 583 -EXPORT_SYMBOL(ath9k_hw_proc_mib_event); 584 - 585 void ath9k_hw_ani_setup(struct ath_hw *ah) 586 { 587 int i; 588 @@ -845,50 +511,31 @@ void ath9k_hw_ani_init(struct ath_hw *ah 589 590 ath_dbg(common, ANI, "Initialize ANI\n"); 591 592 - if (use_new_ani(ah)) { 593 - ah->config.ofdm_trig_high = ATH9K_ANI_OFDM_TRIG_HIGH_NEW; 594 - ah->config.ofdm_trig_low = ATH9K_ANI_OFDM_TRIG_LOW_NEW; 595 + ah->config.ofdm_trig_high = ATH9K_ANI_OFDM_TRIG_HIGH; 596 + ah->config.ofdm_trig_low = ATH9K_ANI_OFDM_TRIG_LOW; 597 598 - ah->config.cck_trig_high = ATH9K_ANI_CCK_TRIG_HIGH_NEW; 599 - ah->config.cck_trig_low = ATH9K_ANI_CCK_TRIG_LOW_NEW; 600 - } else { 601 - ah->config.ofdm_trig_high = ATH9K_ANI_OFDM_TRIG_HIGH_OLD; 602 - ah->config.ofdm_trig_low = ATH9K_ANI_OFDM_TRIG_LOW_OLD; 603 - 604 - ah->config.cck_trig_high = ATH9K_ANI_CCK_TRIG_HIGH_OLD; 605 - ah->config.cck_trig_low = ATH9K_ANI_CCK_TRIG_LOW_OLD; 606 - } 607 + ah->config.cck_trig_high = ATH9K_ANI_CCK_TRIG_HIGH; 608 + ah->config.cck_trig_low = ATH9K_ANI_CCK_TRIG_LOW; 609 610 for (i = 0; i < ARRAY_SIZE(ah->channels); i++) { 611 struct ath9k_channel *chan = &ah->channels[i]; 612 struct ar5416AniState *ani = &chan->ani; 613 614 - if (use_new_ani(ah)) { 615 - ani->spurImmunityLevel = 616 - ATH9K_ANI_SPUR_IMMUNE_LVL_NEW; 617 + ani->spurImmunityLevel = ATH9K_ANI_SPUR_IMMUNE_LVL; 618 619 - ani->firstepLevel = ATH9K_ANI_FIRSTEP_LVL_NEW; 620 + ani->firstepLevel = ATH9K_ANI_FIRSTEP_LVL; 621 622 - if (AR_SREV_9300_20_OR_LATER(ah)) 623 - ani->mrcCCKOff = 624 - !ATH9K_ANI_ENABLE_MRC_CCK; 625 - else 626 - ani->mrcCCKOff = true; 627 - 628 - ani->ofdmsTurn = true; 629 - } else { 630 - ani->spurImmunityLevel = 631 - ATH9K_ANI_SPUR_IMMUNE_LVL_OLD; 632 - ani->firstepLevel = ATH9K_ANI_FIRSTEP_LVL_OLD; 633 + if (AR_SREV_9300_20_OR_LATER(ah)) 634 + ani->mrcCCKOff = 635 + !ATH9K_ANI_ENABLE_MRC_CCK; 636 + else 637 + ani->mrcCCKOff = true; 638 639 - ani->cckWeakSigThreshold = 640 - ATH9K_ANI_CCK_WEAK_SIG_THR; 641 - } 642 + ani->ofdmsTurn = true; 643 644 ani->rssiThrHigh = ATH9K_ANI_RSSI_THR_HIGH; 645 ani->rssiThrLow = ATH9K_ANI_RSSI_THR_LOW; 646 - ani->ofdmWeakSigDetectOff = 647 - !ATH9K_ANI_USE_OFDM_WEAK_SIG; 648 + ani->ofdmWeakSigDetect = ATH9K_ANI_USE_OFDM_WEAK_SIG; 649 ani->cckNoiseImmunityLevel = ATH9K_ANI_CCK_DEF_LEVEL; 650 ani->ofdmNoiseImmunityLevel = ATH9K_ANI_OFDM_DEF_LEVEL; 651 ani->update_ani = false; 652 @@ -898,13 +545,8 @@ void ath9k_hw_ani_init(struct ath_hw *ah 653 * since we expect some ongoing maintenance on the tables, let's sanity 654 * check here default level should not modify INI setting. 655 */ 656 - if (use_new_ani(ah)) { 657 - ah->aniperiod = ATH9K_ANI_PERIOD_NEW; 658 - ah->config.ani_poll_interval = ATH9K_ANI_POLLINTERVAL_NEW; 659 - } else { 660 - ah->aniperiod = ATH9K_ANI_PERIOD_OLD; 661 - ah->config.ani_poll_interval = ATH9K_ANI_POLLINTERVAL_OLD; 662 - } 663 + ah->aniperiod = ATH9K_ANI_PERIOD; 664 + ah->config.ani_poll_interval = ATH9K_ANI_POLLINTERVAL; 665 666 if (ah->config.enable_ani) 667 ah->proc_phyerr |= HAL_PROCESS_ANI; 668 --- a/drivers/net/wireless/ath/ath9k/ani.h 669 +++ b/drivers/net/wireless/ath/ath9k/ani.h 670 @@ -24,42 +24,34 @@ 671 #define BEACON_RSSI(ahp) (ahp->stats.avgbrssi) 672 673 /* units are errors per second */ 674 -#define ATH9K_ANI_OFDM_TRIG_HIGH_OLD 500 675 -#define ATH9K_ANI_OFDM_TRIG_HIGH_NEW 3500 676 +#define ATH9K_ANI_OFDM_TRIG_HIGH 3500 677 #define ATH9K_ANI_OFDM_TRIG_HIGH_BELOW_INI 1000 678 679 /* units are errors per second */ 680 -#define ATH9K_ANI_OFDM_TRIG_LOW_OLD 200 681 -#define ATH9K_ANI_OFDM_TRIG_LOW_NEW 400 682 +#define ATH9K_ANI_OFDM_TRIG_LOW 400 683 #define ATH9K_ANI_OFDM_TRIG_LOW_ABOVE_INI 900 684 685 /* units are errors per second */ 686 -#define ATH9K_ANI_CCK_TRIG_HIGH_OLD 200 687 -#define ATH9K_ANI_CCK_TRIG_HIGH_NEW 600 688 +#define ATH9K_ANI_CCK_TRIG_HIGH 600 689 690 /* units are errors per second */ 691 -#define ATH9K_ANI_CCK_TRIG_LOW_OLD 100 692 -#define ATH9K_ANI_CCK_TRIG_LOW_NEW 300 693 +#define ATH9K_ANI_CCK_TRIG_LOW 300 694 695 #define ATH9K_ANI_NOISE_IMMUNE_LVL 4 696 #define ATH9K_ANI_USE_OFDM_WEAK_SIG true 697 #define ATH9K_ANI_CCK_WEAK_SIG_THR false 698 699 -#define ATH9K_ANI_SPUR_IMMUNE_LVL_OLD 7 700 -#define ATH9K_ANI_SPUR_IMMUNE_LVL_NEW 3 701 +#define ATH9K_ANI_SPUR_IMMUNE_LVL 3 702 703 -#define ATH9K_ANI_FIRSTEP_LVL_OLD 0 704 -#define ATH9K_ANI_FIRSTEP_LVL_NEW 2 705 +#define ATH9K_ANI_FIRSTEP_LVL 2 706 707 #define ATH9K_ANI_RSSI_THR_HIGH 40 708 #define ATH9K_ANI_RSSI_THR_LOW 7 709 710 -#define ATH9K_ANI_PERIOD_OLD 100 711 -#define ATH9K_ANI_PERIOD_NEW 300 712 +#define ATH9K_ANI_PERIOD 300 713 714 /* in ms */ 715 -#define ATH9K_ANI_POLLINTERVAL_OLD 100 716 -#define ATH9K_ANI_POLLINTERVAL_NEW 1000 717 +#define ATH9K_ANI_POLLINTERVAL 1000 718 719 #define HAL_NOISE_IMMUNE_MAX 4 720 #define HAL_SPUR_IMMUNE_MAX 7 721 @@ -122,13 +114,12 @@ struct ar5416AniState { 722 u8 mrcCCKOff; 723 u8 spurImmunityLevel; 724 u8 firstepLevel; 725 - u8 ofdmWeakSigDetectOff; 726 + u8 ofdmWeakSigDetect; 727 u8 cckWeakSigThreshold; 728 bool update_ani; 729 u32 listenTime; 730 int32_t rssiThrLow; 731 int32_t rssiThrHigh; 732 - u32 noiseFloor; 733 u32 ofdmPhyErrCount; 734 u32 cckPhyErrCount; 735 int16_t pktRssi[2]; 736 --- a/drivers/net/wireless/ath/ath9k/ar5008_phy.c 737 +++ b/drivers/net/wireless/ath/ath9k/ar5008_phy.c 738 @@ -995,141 +995,6 @@ static u32 ar5008_hw_compute_pll_control 739 return pll; 740 } 741 742 -static bool ar5008_hw_ani_control_old(struct ath_hw *ah, 743 - enum ath9k_ani_cmd cmd, 744 - int param) 745 -{ 746 - struct ar5416AniState *aniState = &ah->curchan->ani; 747 - struct ath_common *common = ath9k_hw_common(ah); 748 - 749 - switch (cmd & ah->ani_function) { 750 - case ATH9K_ANI_NOISE_IMMUNITY_LEVEL:{ 751 - u32 level = param; 752 - 753 - if (level >= ARRAY_SIZE(ah->totalSizeDesired)) { 754 - ath_dbg(common, ANI, "level out of range (%u > %zu)\n", 755 - level, ARRAY_SIZE(ah->totalSizeDesired)); 756 - return false; 757 - } 758 - 759 - REG_RMW_FIELD(ah, AR_PHY_DESIRED_SZ, 760 - AR_PHY_DESIRED_SZ_TOT_DES, 761 - ah->totalSizeDesired[level]); 762 - REG_RMW_FIELD(ah, AR_PHY_AGC_CTL1, 763 - AR_PHY_AGC_CTL1_COARSE_LOW, 764 - ah->coarse_low[level]); 765 - REG_RMW_FIELD(ah, AR_PHY_AGC_CTL1, 766 - AR_PHY_AGC_CTL1_COARSE_HIGH, 767 - ah->coarse_high[level]); 768 - REG_RMW_FIELD(ah, AR_PHY_FIND_SIG, 769 - AR_PHY_FIND_SIG_FIRPWR, 770 - ah->firpwr[level]); 771 - 772 - if (level > aniState->noiseImmunityLevel) 773 - ah->stats.ast_ani_niup++; 774 - else if (level < aniState->noiseImmunityLevel) 775 - ah->stats.ast_ani_nidown++; 776 - aniState->noiseImmunityLevel = level; 777 - break; 778 - } 779 - case ATH9K_ANI_OFDM_WEAK_SIGNAL_DETECTION:{ 780 - u32 on = param ? 1 : 0; 781 - 782 - if (on) 783 - REG_SET_BIT(ah, AR_PHY_SFCORR_LOW, 784 - AR_PHY_SFCORR_LOW_USE_SELF_CORR_LOW); 785 - else 786 - REG_CLR_BIT(ah, AR_PHY_SFCORR_LOW, 787 - AR_PHY_SFCORR_LOW_USE_SELF_CORR_LOW); 788 - 789 - if (!on != aniState->ofdmWeakSigDetectOff) { 790 - if (on) 791 - ah->stats.ast_ani_ofdmon++; 792 - else 793 - ah->stats.ast_ani_ofdmoff++; 794 - aniState->ofdmWeakSigDetectOff = !on; 795 - } 796 - break; 797 - } 798 - case ATH9K_ANI_CCK_WEAK_SIGNAL_THR:{ 799 - static const int weakSigThrCck[] = { 8, 6 }; 800 - u32 high = param ? 1 : 0; 801 - 802 - REG_RMW_FIELD(ah, AR_PHY_CCK_DETECT, 803 - AR_PHY_CCK_DETECT_WEAK_SIG_THR_CCK, 804 - weakSigThrCck[high]); 805 - if (high != aniState->cckWeakSigThreshold) { 806 - if (high) 807 - ah->stats.ast_ani_cckhigh++; 808 - else 809 - ah->stats.ast_ani_ccklow++; 810 - aniState->cckWeakSigThreshold = high; 811 - } 812 - break; 813 - } 814 - case ATH9K_ANI_FIRSTEP_LEVEL:{ 815 - static const int firstep[] = { 0, 4, 8 }; 816 - u32 level = param; 817 - 818 - if (level >= ARRAY_SIZE(firstep)) { 819 - ath_dbg(common, ANI, "level out of range (%u > %zu)\n", 820 - level, ARRAY_SIZE(firstep)); 821 - return false; 822 - } 823 - REG_RMW_FIELD(ah, AR_PHY_FIND_SIG, 824 - AR_PHY_FIND_SIG_FIRSTEP, 825 - firstep[level]); 826 - if (level > aniState->firstepLevel) 827 - ah->stats.ast_ani_stepup++; 828 - else if (level < aniState->firstepLevel) 829 - ah->stats.ast_ani_stepdown++; 830 - aniState->firstepLevel = level; 831 - break; 832 - } 833 - case ATH9K_ANI_SPUR_IMMUNITY_LEVEL:{ 834 - static const int cycpwrThr1[] = { 2, 4, 6, 8, 10, 12, 14, 16 }; 835 - u32 level = param; 836 - 837 - if (level >= ARRAY_SIZE(cycpwrThr1)) { 838 - ath_dbg(common, ANI, "level out of range (%u > %zu)\n", 839 - level, ARRAY_SIZE(cycpwrThr1)); 840 - return false; 841 - } 842 - REG_RMW_FIELD(ah, AR_PHY_TIMING5, 843 - AR_PHY_TIMING5_CYCPWR_THR1, 844 - cycpwrThr1[level]); 845 - if (level > aniState->spurImmunityLevel) 846 - ah->stats.ast_ani_spurup++; 847 - else if (level < aniState->spurImmunityLevel) 848 - ah->stats.ast_ani_spurdown++; 849 - aniState->spurImmunityLevel = level; 850 - break; 851 - } 852 - case ATH9K_ANI_PRESENT: 853 - break; 854 - default: 855 - ath_dbg(common, ANI, "invalid cmd %u\n", cmd); 856 - return false; 857 - } 858 - 859 - ath_dbg(common, ANI, "ANI parameters:\n"); 860 - ath_dbg(common, ANI, 861 - "noiseImmunityLevel=%d, spurImmunityLevel=%d, ofdmWeakSigDetectOff=%d\n", 862 - aniState->noiseImmunityLevel, 863 - aniState->spurImmunityLevel, 864 - !aniState->ofdmWeakSigDetectOff); 865 - ath_dbg(common, ANI, 866 - "cckWeakSigThreshold=%d, firstepLevel=%d, listenTime=%d\n", 867 - aniState->cckWeakSigThreshold, 868 - aniState->firstepLevel, 869 - aniState->listenTime); 870 - ath_dbg(common, ANI, "ofdmPhyErrCount=%d, cckPhyErrCount=%d\n\n", 871 - aniState->ofdmPhyErrCount, 872 - aniState->cckPhyErrCount); 873 - 874 - return true; 875 -} 876 - 877 static bool ar5008_hw_ani_control_new(struct ath_hw *ah, 878 enum ath9k_ani_cmd cmd, 879 int param) 880 @@ -1206,18 +1071,18 @@ static bool ar5008_hw_ani_control_new(st 881 REG_CLR_BIT(ah, AR_PHY_SFCORR_LOW, 882 AR_PHY_SFCORR_LOW_USE_SELF_CORR_LOW); 883 884 - if (!on != aniState->ofdmWeakSigDetectOff) { 885 + if (on != aniState->ofdmWeakSigDetect) { 886 ath_dbg(common, ANI, 887 "** ch %d: ofdm weak signal: %s=>%s\n", 888 chan->channel, 889 - !aniState->ofdmWeakSigDetectOff ? 890 + aniState->ofdmWeakSigDetect ? 891 "on" : "off", 892 on ? "on" : "off"); 893 if (on) 894 ah->stats.ast_ani_ofdmon++; 895 else 896 ah->stats.ast_ani_ofdmoff++; 897 - aniState->ofdmWeakSigDetectOff = !on; 898 + aniState->ofdmWeakSigDetect = on; 899 } 900 break; 901 } 902 @@ -1236,7 +1101,7 @@ static bool ar5008_hw_ani_control_new(st 903 * from INI file & cap value 904 */ 905 value = firstep_table[level] - 906 - firstep_table[ATH9K_ANI_FIRSTEP_LVL_NEW] + 907 + firstep_table[ATH9K_ANI_FIRSTEP_LVL] + 908 aniState->iniDef.firstep; 909 if (value < ATH9K_SIG_FIRSTEP_SETTING_MIN) 910 value = ATH9K_SIG_FIRSTEP_SETTING_MIN; 911 @@ -1251,7 +1116,7 @@ static bool ar5008_hw_ani_control_new(st 912 * from INI file & cap value 913 */ 914 value2 = firstep_table[level] - 915 - firstep_table[ATH9K_ANI_FIRSTEP_LVL_NEW] + 916 + firstep_table[ATH9K_ANI_FIRSTEP_LVL] + 917 aniState->iniDef.firstepLow; 918 if (value2 < ATH9K_SIG_FIRSTEP_SETTING_MIN) 919 value2 = ATH9K_SIG_FIRSTEP_SETTING_MIN; 920 @@ -1267,7 +1132,7 @@ static bool ar5008_hw_ani_control_new(st 921 chan->channel, 922 aniState->firstepLevel, 923 level, 924 - ATH9K_ANI_FIRSTEP_LVL_NEW, 925 + ATH9K_ANI_FIRSTEP_LVL, 926 value, 927 aniState->iniDef.firstep); 928 ath_dbg(common, ANI, 929 @@ -1275,7 +1140,7 @@ static bool ar5008_hw_ani_control_new(st 930 chan->channel, 931 aniState->firstepLevel, 932 level, 933 - ATH9K_ANI_FIRSTEP_LVL_NEW, 934 + ATH9K_ANI_FIRSTEP_LVL, 935 value2, 936 aniState->iniDef.firstepLow); 937 if (level > aniState->firstepLevel) 938 @@ -1300,7 +1165,7 @@ static bool ar5008_hw_ani_control_new(st 939 * from INI file & cap value 940 */ 941 value = cycpwrThr1_table[level] - 942 - cycpwrThr1_table[ATH9K_ANI_SPUR_IMMUNE_LVL_NEW] + 943 + cycpwrThr1_table[ATH9K_ANI_SPUR_IMMUNE_LVL] + 944 aniState->iniDef.cycpwrThr1; 945 if (value < ATH9K_SIG_SPUR_IMM_SETTING_MIN) 946 value = ATH9K_SIG_SPUR_IMM_SETTING_MIN; 947 @@ -1316,7 +1181,7 @@ static bool ar5008_hw_ani_control_new(st 948 * from INI file & cap value 949 */ 950 value2 = cycpwrThr1_table[level] - 951 - cycpwrThr1_table[ATH9K_ANI_SPUR_IMMUNE_LVL_NEW] + 952 + cycpwrThr1_table[ATH9K_ANI_SPUR_IMMUNE_LVL] + 953 aniState->iniDef.cycpwrThr1Ext; 954 if (value2 < ATH9K_SIG_SPUR_IMM_SETTING_MIN) 955 value2 = ATH9K_SIG_SPUR_IMM_SETTING_MIN; 956 @@ -1331,7 +1196,7 @@ static bool ar5008_hw_ani_control_new(st 957 chan->channel, 958 aniState->spurImmunityLevel, 959 level, 960 - ATH9K_ANI_SPUR_IMMUNE_LVL_NEW, 961 + ATH9K_ANI_SPUR_IMMUNE_LVL, 962 value, 963 aniState->iniDef.cycpwrThr1); 964 ath_dbg(common, ANI, 965 @@ -1339,7 +1204,7 @@ static bool ar5008_hw_ani_control_new(st 966 chan->channel, 967 aniState->spurImmunityLevel, 968 level, 969 - ATH9K_ANI_SPUR_IMMUNE_LVL_NEW, 970 + ATH9K_ANI_SPUR_IMMUNE_LVL, 971 value2, 972 aniState->iniDef.cycpwrThr1Ext); 973 if (level > aniState->spurImmunityLevel) 974 @@ -1367,7 +1232,7 @@ static bool ar5008_hw_ani_control_new(st 975 ath_dbg(common, ANI, 976 "ANI parameters: SI=%d, ofdmWS=%s FS=%d MRCcck=%s listenTime=%d ofdmErrs=%d cckErrs=%d\n", 977 aniState->spurImmunityLevel, 978 - !aniState->ofdmWeakSigDetectOff ? "on" : "off", 979 + aniState->ofdmWeakSigDetect ? "on" : "off", 980 aniState->firstepLevel, 981 !aniState->mrcCCKOff ? "on" : "off", 982 aniState->listenTime, 983 @@ -1454,9 +1319,9 @@ static void ar5008_hw_ani_cache_ini_regs 984 AR_PHY_EXT_TIMING5_CYCPWR_THR1); 985 986 /* these levels just got reset to defaults by the INI */ 987 - aniState->spurImmunityLevel = ATH9K_ANI_SPUR_IMMUNE_LVL_NEW; 988 - aniState->firstepLevel = ATH9K_ANI_FIRSTEP_LVL_NEW; 989 - aniState->ofdmWeakSigDetectOff = !ATH9K_ANI_USE_OFDM_WEAK_SIG; 990 + aniState->spurImmunityLevel = ATH9K_ANI_SPUR_IMMUNE_LVL; 991 + aniState->firstepLevel = ATH9K_ANI_FIRSTEP_LVL; 992 + aniState->ofdmWeakSigDetect = ATH9K_ANI_USE_OFDM_WEAK_SIG; 993 aniState->mrcCCKOff = true; /* not available on pre AR9003 */ 994 } 995 996 @@ -1545,11 +1410,8 @@ void ar5008_hw_attach_phy_ops(struct ath 997 priv_ops->do_getnf = ar5008_hw_do_getnf; 998 priv_ops->set_radar_params = ar5008_hw_set_radar_params; 999 1000 - if (modparam_force_new_ani) { 1001 - priv_ops->ani_control = ar5008_hw_ani_control_new; 1002 - priv_ops->ani_cache_ini_regs = ar5008_hw_ani_cache_ini_regs; 1003 - } else 1004 - priv_ops->ani_control = ar5008_hw_ani_control_old; 1005 + priv_ops->ani_control = ar5008_hw_ani_control_new; 1006 + priv_ops->ani_cache_ini_regs = ar5008_hw_ani_cache_ini_regs; 1007 1008 if (AR_SREV_9100(ah) || AR_SREV_9160_10_OR_LATER(ah)) 1009 priv_ops->compute_pll_control = ar9160_hw_compute_pll_control; 1010 --- a/drivers/net/wireless/ath/ath9k/ar9002_hw.c 1011 +++ b/drivers/net/wireless/ath/ath9k/ar9002_hw.c 1012 @@ -21,10 +21,6 @@ 1013 #include "ar9002_initvals.h" 1014 #include "ar9002_phy.h" 1015 1016 -int modparam_force_new_ani; 1017 -module_param_named(force_new_ani, modparam_force_new_ani, int, 0444); 1018 -MODULE_PARM_DESC(force_new_ani, "Force new ANI for AR5008, AR9001, AR9002"); 1019 - 1020 /* General hardware code for the A5008/AR9001/AR9002 hadware families */ 1021 1022 static void ar9002_hw_init_mode_regs(struct ath_hw *ah) 1023 --- a/drivers/net/wireless/ath/ath9k/ar9003_phy.c 1024 +++ b/drivers/net/wireless/ath/ath9k/ar9003_phy.c 1025 @@ -825,18 +825,18 @@ static bool ar9003_hw_ani_control(struct 1026 REG_CLR_BIT(ah, AR_PHY_SFCORR_LOW, 1027 AR_PHY_SFCORR_LOW_USE_SELF_CORR_LOW); 1028 1029 - if (!on != aniState->ofdmWeakSigDetectOff) { 1030 + if (on != aniState->ofdmWeakSigDetect) { 1031 ath_dbg(common, ANI, 1032 "** ch %d: ofdm weak signal: %s=>%s\n", 1033 chan->channel, 1034 - !aniState->ofdmWeakSigDetectOff ? 1035 + aniState->ofdmWeakSigDetect ? 1036 "on" : "off", 1037 on ? "on" : "off"); 1038 if (on) 1039 ah->stats.ast_ani_ofdmon++; 1040 else 1041 ah->stats.ast_ani_ofdmoff++; 1042 - aniState->ofdmWeakSigDetectOff = !on; 1043 + aniState->ofdmWeakSigDetect = on; 1044 } 1045 break; 1046 } 1047 @@ -855,7 +855,7 @@ static bool ar9003_hw_ani_control(struct 1048 * from INI file & cap value 1049 */ 1050 value = firstep_table[level] - 1051 - firstep_table[ATH9K_ANI_FIRSTEP_LVL_NEW] + 1052 + firstep_table[ATH9K_ANI_FIRSTEP_LVL] + 1053 aniState->iniDef.firstep; 1054 if (value < ATH9K_SIG_FIRSTEP_SETTING_MIN) 1055 value = ATH9K_SIG_FIRSTEP_SETTING_MIN; 1056 @@ -870,7 +870,7 @@ static bool ar9003_hw_ani_control(struct 1057 * from INI file & cap value 1058 */ 1059 value2 = firstep_table[level] - 1060 - firstep_table[ATH9K_ANI_FIRSTEP_LVL_NEW] + 1061 + firstep_table[ATH9K_ANI_FIRSTEP_LVL] + 1062 aniState->iniDef.firstepLow; 1063 if (value2 < ATH9K_SIG_FIRSTEP_SETTING_MIN) 1064 value2 = ATH9K_SIG_FIRSTEP_SETTING_MIN; 1065 @@ -886,7 +886,7 @@ static bool ar9003_hw_ani_control(struct 1066 chan->channel, 1067 aniState->firstepLevel, 1068 level, 1069 - ATH9K_ANI_FIRSTEP_LVL_NEW, 1070 + ATH9K_ANI_FIRSTEP_LVL, 1071 value, 1072 aniState->iniDef.firstep); 1073 ath_dbg(common, ANI, 1074 @@ -894,7 +894,7 @@ static bool ar9003_hw_ani_control(struct 1075 chan->channel, 1076 aniState->firstepLevel, 1077 level, 1078 - ATH9K_ANI_FIRSTEP_LVL_NEW, 1079 + ATH9K_ANI_FIRSTEP_LVL, 1080 value2, 1081 aniState->iniDef.firstepLow); 1082 if (level > aniState->firstepLevel) 1083 @@ -919,7 +919,7 @@ static bool ar9003_hw_ani_control(struct 1084 * from INI file & cap value 1085 */ 1086 value = cycpwrThr1_table[level] - 1087 - cycpwrThr1_table[ATH9K_ANI_SPUR_IMMUNE_LVL_NEW] + 1088 + cycpwrThr1_table[ATH9K_ANI_SPUR_IMMUNE_LVL] + 1089 aniState->iniDef.cycpwrThr1; 1090 if (value < ATH9K_SIG_SPUR_IMM_SETTING_MIN) 1091 value = ATH9K_SIG_SPUR_IMM_SETTING_MIN; 1092 @@ -935,7 +935,7 @@ static bool ar9003_hw_ani_control(struct 1093 * from INI file & cap value 1094 */ 1095 value2 = cycpwrThr1_table[level] - 1096 - cycpwrThr1_table[ATH9K_ANI_SPUR_IMMUNE_LVL_NEW] + 1097 + cycpwrThr1_table[ATH9K_ANI_SPUR_IMMUNE_LVL] + 1098 aniState->iniDef.cycpwrThr1Ext; 1099 if (value2 < ATH9K_SIG_SPUR_IMM_SETTING_MIN) 1100 value2 = ATH9K_SIG_SPUR_IMM_SETTING_MIN; 1101 @@ -950,7 +950,7 @@ static bool ar9003_hw_ani_control(struct 1102 chan->channel, 1103 aniState->spurImmunityLevel, 1104 level, 1105 - ATH9K_ANI_SPUR_IMMUNE_LVL_NEW, 1106 + ATH9K_ANI_SPUR_IMMUNE_LVL, 1107 value, 1108 aniState->iniDef.cycpwrThr1); 1109 ath_dbg(common, ANI, 1110 @@ -958,7 +958,7 @@ static bool ar9003_hw_ani_control(struct 1111 chan->channel, 1112 aniState->spurImmunityLevel, 1113 level, 1114 - ATH9K_ANI_SPUR_IMMUNE_LVL_NEW, 1115 + ATH9K_ANI_SPUR_IMMUNE_LVL, 1116 value2, 1117 aniState->iniDef.cycpwrThr1Ext); 1118 if (level > aniState->spurImmunityLevel) 1119 @@ -1002,7 +1002,7 @@ static bool ar9003_hw_ani_control(struct 1120 ath_dbg(common, ANI, 1121 "ANI parameters: SI=%d, ofdmWS=%s FS=%d MRCcck=%s listenTime=%d ofdmErrs=%d cckErrs=%d\n", 1122 aniState->spurImmunityLevel, 1123 - !aniState->ofdmWeakSigDetectOff ? "on" : "off", 1124 + aniState->ofdmWeakSigDetect ? "on" : "off", 1125 aniState->firstepLevel, 1126 !aniState->mrcCCKOff ? "on" : "off", 1127 aniState->listenTime, 1128 @@ -1111,9 +1111,9 @@ static void ar9003_hw_ani_cache_ini_regs 1129 AR_PHY_EXT_CYCPWR_THR1); 1130 1131 /* these levels just got reset to defaults by the INI */ 1132 - aniState->spurImmunityLevel = ATH9K_ANI_SPUR_IMMUNE_LVL_NEW; 1133 - aniState->firstepLevel = ATH9K_ANI_FIRSTEP_LVL_NEW; 1134 - aniState->ofdmWeakSigDetectOff = !ATH9K_ANI_USE_OFDM_WEAK_SIG; 1135 + aniState->spurImmunityLevel = ATH9K_ANI_SPUR_IMMUNE_LVL; 1136 + aniState->firstepLevel = ATH9K_ANI_FIRSTEP_LVL; 1137 + aniState->ofdmWeakSigDetect = ATH9K_ANI_USE_OFDM_WEAK_SIG; 1138 aniState->mrcCCKOff = !ATH9K_ANI_ENABLE_MRC_CCK; 1139 } 1140 1141 --- a/drivers/net/wireless/ath/ath9k/debug.c 1142 +++ b/drivers/net/wireless/ath/ath9k/debug.c 1143 @@ -348,8 +348,6 @@ void ath_debug_stat_interrupt(struct ath 1144 sc->debug.stats.istats.txok++; 1145 if (status & ATH9K_INT_TXURN) 1146 sc->debug.stats.istats.txurn++; 1147 - if (status & ATH9K_INT_MIB) 1148 - sc->debug.stats.istats.mib++; 1149 if (status & ATH9K_INT_RXPHY) 1150 sc->debug.stats.istats.rxphyerr++; 1151 if (status & ATH9K_INT_RXKCM) 1152 --- a/drivers/net/wireless/ath/ath9k/hw.h 1153 +++ b/drivers/net/wireless/ath/ath9k/hw.h 1154 @@ -1019,16 +1019,8 @@ void ar9002_hw_attach_ops(struct ath_hw 1155 void ar9003_hw_attach_ops(struct ath_hw *ah); 1156 1157 void ar9002_hw_load_ani_reg(struct ath_hw *ah, struct ath9k_channel *chan); 1158 -/* 1159 - * ANI work can be shared between all families but a next 1160 - * generation implementation of ANI will be used only for AR9003 only 1161 - * for now as the other families still need to be tested with the same 1162 - * next generation ANI. Feel free to start testing it though for the 1163 - * older families (AR5008, AR9001, AR9002) by using modparam_force_new_ani. 1164 - */ 1165 -extern int modparam_force_new_ani; 1166 + 1167 void ath9k_ani_reset(struct ath_hw *ah, bool is_scanning); 1168 -void ath9k_hw_proc_mib_event(struct ath_hw *ah); 1169 void ath9k_hw_ani_monitor(struct ath_hw *ah, struct ath9k_channel *chan); 1170 1171 #ifdef CONFIG_ATH9K_BTCOEX_SUPPORT 1172 --- a/drivers/net/wireless/ath/ath9k/main.c 1173 +++ b/drivers/net/wireless/ath/ath9k/main.c 1174 @@ -19,7 +19,7 @@ 1175 #include "ath9k.h" 1176 #include "btcoex.h" 1177 1178 -static u8 parse_mpdudensity(u8 mpdudensity) 1179 +u8 ath9k_parse_mpdudensity(u8 mpdudensity) 1180 { 1181 /* 1182 * 802.11n D2.0 defined values for "Minimum MPDU Start Spacing": 1183 @@ -320,6 +320,7 @@ static void ath_node_attach(struct ath_s 1184 struct ieee80211_vif *vif) 1185 { 1186 struct ath_node *an; 1187 + u8 density; 1188 an = (struct ath_node *)sta->drv_priv; 1189 1190 #ifdef CONFIG_ATH9K_DEBUGFS 1191 @@ -334,7 +335,8 @@ static void ath_node_attach(struct ath_s 1192 ath_tx_node_init(sc, an); 1193 an->maxampdu = 1 << (IEEE80211_HT_MAX_AMPDU_FACTOR + 1194 sta->ht_cap.ampdu_factor); 1195 - an->mpdudensity = parse_mpdudensity(sta->ht_cap.ampdu_density); 1196 + density = ath9k_parse_mpdudensity(sta->ht_cap.ampdu_density); 1197 + an->mpdudensity = density; 1198 } 1199 } 1200 1201 @@ -516,24 +518,6 @@ irqreturn_t ath_isr(int irq, void *dev) 1202 ath9k_hw_set_interrupts(ah); 1203 } 1204 1205 - if (status & ATH9K_INT_MIB) { 1206 - /* 1207 - * Disable interrupts until we service the MIB 1208 - * interrupt; otherwise it will continue to 1209 - * fire. 1210 - */ 1211 - ath9k_hw_disable_interrupts(ah); 1212 - /* 1213 - * Let the hal handle the event. We assume 1214 - * it will clear whatever condition caused 1215 - * the interrupt. 1216 - */ 1217 - spin_lock(&common->cc_lock); 1218 - ath9k_hw_proc_mib_event(ah); 1219 - spin_unlock(&common->cc_lock); 1220 - ath9k_hw_enable_interrupts(ah); 1221 - } 1222 - 1223 if (!(ah->caps.hw_caps & ATH9K_HW_CAP_AUTOSLEEP)) 1224 if (status & ATH9K_INT_TIM_TIMER) { 1225 if (ATH_DBG_WARN_ON_ONCE(sc->ps_idle)) 1226 @@ -959,14 +943,10 @@ static void ath9k_calculate_summary_stat 1227 /* 1228 * Enable MIB interrupts when there are hardware phy counters. 1229 */ 1230 - if ((iter_data.nstations + iter_data.nadhocs + iter_data.nmeshes) > 0) { 1231 - if (ah->config.enable_ani) 1232 - ah->imask |= ATH9K_INT_MIB; 1233 + if ((iter_data.nstations + iter_data.nadhocs + iter_data.nmeshes) > 0) 1234 ah->imask |= ATH9K_INT_TSFOOR; 1235 - } else { 1236 - ah->imask &= ~ATH9K_INT_MIB; 1237 + else 1238 ah->imask &= ~ATH9K_INT_TSFOOR; 1239 - } 1240 1241 ath9k_hw_set_interrupts(ah); 1242 1602 -void ieee80211_key_removed(struct ieee80211_key_conf *key_conf); 1603 - 1604 -/** 1605 * ieee80211_ready_on_channel - notification of remain-on-channel start 1606 * @hw: pointer as obtained from ieee80211_alloc_hw() 1607 */ 1243 1608 --- a/net/mac80211/agg-rx.c 1244 1609 +++ b/net/mac80211/agg-rx.c 1245 @@ -20 1,6 +201,8 @@ static void ieee80211_send_addba_resp(st1610 @@ -203,6 +203,8 @@ static void ieee80211_send_addba_resp(st 1246 1611 memcpy(mgmt->bssid, sdata->u.mgd.bssid, ETH_ALEN); 1247 1612 else if (sdata->vif.type == NL80211_IFTYPE_ADHOC) … … 1264 1629 else if (sdata->vif.type == NL80211_IFTYPE_STATION) 1265 1630 memcpy(mgmt->bssid, sdata->u.mgd.bssid, ETH_ALEN); 1266 @@ -45 6,6 +457,7 @@ int ieee80211_start_tx_ba_session(struct1631 @@ -459,6 +460,7 @@ int ieee80211_start_tx_ba_session(struct 1267 1632 sdata->vif.type != NL80211_IFTYPE_MESH_POINT && 1268 1633 sdata->vif.type != NL80211_IFTYPE_AP_VLAN && … … 1271 1636 sdata->vif.type != NL80211_IFTYPE_ADHOC) 1272 1637 return -EINVAL; 1638 1639 --- a/net/mac80211/cfg.c 1640 +++ b/net/mac80211/cfg.c 1641 @@ -1741,6 +1741,8 @@ static int ieee80211_set_txq_params(stru 1642 return -EINVAL; 1643 } 1644 1645 + ieee80211_bss_info_change_notify(sdata, BSS_CHANGED_QOS); 1646 + 1647 return 0; 1648 } 1273 1649 1274 1650 --- a/net/mac80211/debugfs_sta.c … … 1290 1666 --- a/net/mac80211/iface.c 1291 1667 +++ b/net/mac80211/iface.c 1292 @@ - 284,7 +284,6 @@ static int ieee80211_do_open(struct net_1668 @@ -400,7 +400,6 @@ static int ieee80211_do_open(struct net_ 1293 1669 { 1294 1670 struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev); … … 1298 1674 int res; 1299 1675 u32 hw_reconf_flags = 0; 1300 @@ - 430,28 +429,6 @@ static int ieee80211_do_open(struct net_1676 @@ -538,28 +537,6 @@ static int ieee80211_do_open(struct net_ 1301 1677 1302 1678 set_bit(SDATA_STATE_RUNNING, &sdata->state); … … 1327 1703 * set_multicast_list will be invoked by the networking core 1328 1704 * which will check whether any increments here were done in 1329 @@ -639,6 +616,8 @@ static void ieee80211_do_stop(struct iee 1330 ieee80211_configure_filter(local); 1331 break; 1332 default: 1333 + flush_work(&local->hw_roc_start); 1334 + flush_work(&local->hw_roc_done); 1335 flush_work(&sdata->work); 1336 /* 1337 * When we get here, the interface is marked down. 1338 @@ -845,6 +824,72 @@ static void ieee80211_if_setup(struct ne 1705 @@ -949,6 +926,72 @@ static void ieee80211_if_setup(struct ne 1339 1706 dev->destructor = free_netdev; 1340 1707 } … … 1409 1776 { 1410 1777 struct ieee80211_sub_if_data *sdata = 1411 @@ - 949,6 +994,9 @@ static void ieee80211_iface_work(struct1778 @@ -1053,6 +1096,9 @@ static void ieee80211_iface_work(struct 1412 1779 break; 1413 1780 ieee80211_mesh_rx_queued_mgmt(sdata, skb); … … 1419 1786 WARN(1, "frame for unexpected interface type"); 1420 1787 break; 1788 --- a/net/mac80211/key.c 1789 +++ b/net/mac80211/key.c 1790 @@ -197,26 +197,6 @@ static void ieee80211_key_disable_hw_acc 1791 key->flags &= ~KEY_FLAG_UPLOADED_TO_HARDWARE; 1792 } 1793 1794 -void ieee80211_key_removed(struct ieee80211_key_conf *key_conf) 1795 -{ 1796 - struct ieee80211_key *key; 1797 - 1798 - key = container_of(key_conf, struct ieee80211_key, conf); 1799 - 1800 - might_sleep(); 1801 - assert_key_lock(key->local); 1802 - 1803 - key->flags &= ~KEY_FLAG_UPLOADED_TO_HARDWARE; 1804 - 1805 - /* 1806 - * Flush TX path to avoid attempts to use this key 1807 - * after this function returns. Until then, drivers 1808 - * must be prepared to handle the key. 1809 - */ 1810 - synchronize_rcu(); 1811 -} 1812 -EXPORT_SYMBOL_GPL(ieee80211_key_removed); 1813 - 1814 static void __ieee80211_set_default_key(struct ieee80211_sub_if_data *sdata, 1815 int idx, bool uni, bool multi) 1816 { 1817 --- a/net/mac80211/mlme.c 1818 +++ b/net/mac80211/mlme.c 1819 @@ -1108,7 +1108,7 @@ void ieee80211_dynamic_ps_timer(unsigned 1820 } 1821 1822 /* MLME */ 1823 -static void ieee80211_sta_wmm_params(struct ieee80211_local *local, 1824 +static bool ieee80211_sta_wmm_params(struct ieee80211_local *local, 1825 struct ieee80211_sub_if_data *sdata, 1826 u8 *wmm_param, size_t wmm_param_len) 1827 { 1828 @@ -1119,23 +1119,23 @@ static void ieee80211_sta_wmm_params(str 1829 u8 *pos, uapsd_queues = 0; 1830 1831 if (!local->ops->conf_tx) 1832 - return; 1833 + return false; 1834 1835 if (local->hw.queues < IEEE80211_NUM_ACS) 1836 - return; 1837 + return false; 1838 1839 if (!wmm_param) 1840 - return; 1841 + return false; 1842 1843 if (wmm_param_len < 8 || wmm_param[5] /* version */ != 1) 1844 - return; 1845 + return false; 1846 1847 if (ifmgd->flags & IEEE80211_STA_UAPSD_ENABLED) 1848 uapsd_queues = ifmgd->uapsd_queues; 1849 1850 count = wmm_param[6] & 0x0f; 1851 if (count == ifmgd->wmm_last_param_set) 1852 - return; 1853 + return false; 1854 ifmgd->wmm_last_param_set = count; 1855 1856 pos = wmm_param + 8; 1857 @@ -1202,6 +1202,7 @@ static void ieee80211_sta_wmm_params(str 1858 1859 /* enable WMM or activate new settings */ 1860 sdata->vif.bss_conf.qos = true; 1861 + return true; 1862 } 1863 1864 static void __ieee80211_stop_poll(struct ieee80211_sub_if_data *sdata) 1865 @@ -2435,14 +2436,6 @@ static void ieee80211_rx_mgmt_beacon(str 1866 directed_tim = ieee80211_check_tim(elems.tim, elems.tim_len, 1867 ifmgd->aid); 1868 1869 - if (ncrc != ifmgd->beacon_crc || !ifmgd->beacon_crc_valid) { 1870 - ieee80211_rx_bss_info(sdata, mgmt, len, rx_status, &elems, 1871 - true); 1872 - 1873 - ieee80211_sta_wmm_params(local, sdata, elems.wmm_param, 1874 - elems.wmm_param_len); 1875 - } 1876 - 1877 if (local->hw.flags & IEEE80211_HW_PS_NULLFUNC_STACK) { 1878 if (directed_tim) { 1879 if (local->hw.conf.dynamic_ps_timeout > 0) { 1880 @@ -2473,6 +2466,13 @@ static void ieee80211_rx_mgmt_beacon(str 1881 ifmgd->beacon_crc = ncrc; 1882 ifmgd->beacon_crc_valid = true; 1883 1884 + ieee80211_rx_bss_info(sdata, mgmt, len, rx_status, &elems, 1885 + true); 1886 + 1887 + if (ieee80211_sta_wmm_params(local, sdata, elems.wmm_param, 1888 + elems.wmm_param_len)) 1889 + changed |= BSS_CHANGED_QOS; 1890 + 1891 if (elems.erp_info && elems.erp_info_len >= 1) { 1892 erp_valid = true; 1893 erp_value = elems.erp_info[0]; 1894 --- a/net/mac80211/rc80211_minstrel_ht.c 1895 +++ b/net/mac80211/rc80211_minstrel_ht.c 1896 @@ -626,8 +626,12 @@ minstrel_ht_get_rate(void *priv, struct 1897 1898 #ifdef CONFIG_MAC80211_DEBUGFS 1899 /* use fixed index if set */ 1900 - if (mp->fixed_rate_idx != -1) 1901 - sample_idx = mp->fixed_rate_idx; 1902 + if (mp->fixed_rate_idx != -1) { 1903 + mi->max_tp_rate = mp->fixed_rate_idx; 1904 + mi->max_tp_rate2 = mp->fixed_rate_idx; 1905 + mi->max_prob_rate = mp->fixed_rate_idx; 1906 + sample_idx = -1; 1907 + } 1908 #endif 1909 1910 if (sample_idx >= 0) { 1421 1911 --- a/net/mac80211/rx.c 1422 1912 +++ b/net/mac80211/rx.c 1423 @@ -22 81,6 +2281,7 @@ ieee80211_rx_h_action(struct ieee80211_r1913 @@ -2262,6 +2262,7 @@ ieee80211_rx_h_action(struct ieee80211_r 1424 1914 sdata->vif.type != NL80211_IFTYPE_MESH_POINT && 1425 1915 sdata->vif.type != NL80211_IFTYPE_AP_VLAN && … … 1429 1919 break; 1430 1920 1431 @@ -24 95,14 +2496,15 @@ ieee80211_rx_h_mgmt(struct ieee80211_rx_1921 @@ -2479,14 +2480,15 @@ ieee80211_rx_h_mgmt(struct ieee80211_rx_ 1432 1922 1433 1923 if (!ieee80211_vif_is_mesh(&sdata->vif) && … … 1447 1937 case cpu_to_le16(IEEE80211_STYPE_ASSOC_RESP): 1448 1938 case cpu_to_le16(IEEE80211_STYPE_REASSOC_RESP): 1449 @@ -28 33,10 +2835,16 @@ static int prepare_for_handlers(struct i1939 @@ -2817,10 +2819,16 @@ static int prepare_for_handlers(struct i 1450 1940 } 1451 1941 break; … … 1484 1974 WLAN_STA_MFP, 1485 1975 WLAN_STA_BLOCK_BA, 1486 --- a/drivers/net/wireless/ath/ath9k/ath9k.h 1487 +++ b/drivers/net/wireless/ath/ath9k/ath9k.h 1488 @@ -214,6 +214,7 @@ struct ath_frame_info { 1489 enum ath9k_key_type keytype; 1490 u8 keyix; 1491 u8 retries; 1492 + u8 rtscts_rate; 1493 }; 1494 1495 struct ath_buf_state { 1496 @@ -721,6 +722,7 @@ extern int ath9k_modparam_nohwcrypt; 1497 extern int led_blink; 1498 extern bool is_ath9k_unloaded; 1499 1500 +u8 ath9k_parse_mpdudensity(u8 mpdudensity); 1501 irqreturn_t ath_isr(int irq, void *dev); 1502 int ath9k_init_device(u16 devid, struct ath_softc *sc, 1503 const struct ath_bus_ops *bus_ops); 1504 --- a/drivers/net/wireless/ath/ath9k/xmit.c 1505 +++ b/drivers/net/wireless/ath/ath9k/xmit.c 1506 @@ -938,6 +938,7 @@ static void ath_buf_set_rate(struct ath_ 1507 struct ieee80211_tx_rate *rates; 1508 const struct ieee80211_rate *rate; 1509 struct ieee80211_hdr *hdr; 1510 + struct ath_frame_info *fi = get_frame_info(bf->bf_mpdu); 1511 int i; 1512 u8 rix = 0; 1513 1514 @@ -948,18 +949,7 @@ static void ath_buf_set_rate(struct ath_ 1515 1516 /* set dur_update_en for l-sig computation except for PS-Poll frames */ 1517 info->dur_update = !ieee80211_is_pspoll(hdr->frame_control); 1518 - 1519 - /* 1520 - * We check if Short Preamble is needed for the CTS rate by 1521 - * checking the BSS's global flag. 1522 - * But for the rate series, IEEE80211_TX_RC_USE_SHORT_PREAMBLE is used. 1523 - */ 1524 - rate = ieee80211_get_rts_cts_rate(sc->hw, tx_info); 1525 - info->rtscts_rate = rate->hw_value; 1526 - 1527 - if (tx_info->control.vif && 1528 - tx_info->control.vif->bss_conf.use_short_preamble) 1529 - info->rtscts_rate |= rate->hw_value_short; 1530 + info->rtscts_rate = fi->rtscts_rate; 1531 1532 for (i = 0; i < 4; i++) { 1533 bool is_40, is_sgi, is_sp; 1534 @@ -1001,13 +991,13 @@ static void ath_buf_set_rate(struct ath_ 1535 } 1536 1537 /* legacy rates */ 1538 + rate = &sc->sbands[tx_info->band].bitrates[rates[i].idx]; 1539 if ((tx_info->band == IEEE80211_BAND_2GHZ) && 1540 !(rate->flags & IEEE80211_RATE_ERP_G)) 1541 phy = WLAN_RC_PHY_CCK; 1542 else 1543 phy = WLAN_RC_PHY_OFDM; 1544 1545 - rate = &sc->sbands[tx_info->band].bitrates[rates[i].idx]; 1546 info->rates[i].Rate = rate->hw_value; 1547 if (rate->hw_value_short) { 1548 if (rates[i].flags & IEEE80211_TX_RC_USE_SHORT_PREAMBLE) 1549 @@ -1175,6 +1165,7 @@ int ath_tx_aggr_start(struct ath_softc * 1550 { 1551 struct ath_atx_tid *txtid; 1552 struct ath_node *an; 1553 + u8 density; 1554 1555 an = (struct ath_node *)sta->drv_priv; 1556 txtid = ATH_AN_2_TID(an, tid); 1557 @@ -1182,6 +1173,17 @@ int ath_tx_aggr_start(struct ath_softc * 1558 if (txtid->state & (AGGR_CLEANUP | AGGR_ADDBA_COMPLETE)) 1559 return -EAGAIN; 1560 1561 + /* update ampdu factor/density, they may have changed. This may happen 1562 + * in HT IBSS when a beacon with HT-info is received after the station 1563 + * has already been added. 1564 + */ 1565 + if (sc->sc_ah->caps.hw_caps & ATH9K_HW_CAP_HT) { 1566 + an->maxampdu = 1 << (IEEE80211_HT_MAX_AMPDU_FACTOR + 1567 + sta->ht_cap.ampdu_factor); 1568 + density = ath9k_parse_mpdudensity(sta->ht_cap.ampdu_density); 1569 + an->mpdudensity = density; 1570 + } 1571 + 1572 txtid->state |= AGGR_ADDBA_PROGRESS; 1573 txtid->paused = true; 1574 *ssn = txtid->seq_start = txtid->seq_next; 1575 @@ -1776,10 +1778,22 @@ static void setup_frame_info(struct ieee 1576 struct ieee80211_sta *sta = tx_info->control.sta; 1577 struct ieee80211_key_conf *hw_key = tx_info->control.hw_key; 1578 struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)skb->data; 1579 + const struct ieee80211_rate *rate; 1580 struct ath_frame_info *fi = get_frame_info(skb); 1581 struct ath_node *an = NULL; 1582 enum ath9k_key_type keytype; 1583 + bool short_preamble = false; 1584 + 1585 + /* 1586 + * We check if Short Preamble is needed for the CTS rate by 1587 + * checking the BSS's global flag. 1588 + * But for the rate series, IEEE80211_TX_RC_USE_SHORT_PREAMBLE is used. 1589 + */ 1590 + if (tx_info->control.vif && 1591 + tx_info->control.vif->bss_conf.use_short_preamble) 1592 + short_preamble = true; 1593 1594 + rate = ieee80211_get_rts_cts_rate(hw, tx_info); 1595 keytype = ath9k_cmn_get_hw_crypto_keytype(skb); 1596 1597 if (sta) 1598 @@ -1794,6 +1808,9 @@ static void setup_frame_info(struct ieee 1599 fi->keyix = ATH9K_TXKEYIX_INVALID; 1600 fi->keytype = keytype; 1601 fi->framelen = framelen; 1602 + fi->rtscts_rate = rate->hw_value; 1603 + if (short_preamble) 1604 + fi->rtscts_rate |= rate->hw_value_short; 1605 } 1606 1607 u8 ath_txchainmask_reduction(struct ath_softc *sc, u8 chainmask, u32 rate) 1608 --- a/net/wireless/nl80211.c 1609 +++ b/net/wireless/nl80211.c 1610 @@ -2246,6 +2246,33 @@ static int nl80211_parse_beacon(struct g 1611 return 0; 1612 } 1613 1614 +static bool nl80211_get_ap_channel(struct cfg80211_registered_device *rdev, 1615 + struct cfg80211_ap_settings *params) 1616 +{ 1617 + struct wireless_dev *wdev; 1618 + bool ret = false; 1619 + 1620 + mutex_lock(&rdev->devlist_mtx); 1621 + 1622 + list_for_each_entry(wdev, &rdev->netdev_list, list) { 1623 + if (wdev->iftype != NL80211_IFTYPE_AP && 1624 + wdev->iftype != NL80211_IFTYPE_P2P_GO) 1625 + continue; 1626 + 1627 + if (!wdev->preset_chan) 1628 + continue; 1629 + 1630 + params->channel = wdev->preset_chan; 1631 + params->channel_type = wdev->preset_chantype; 1632 + ret = true; 1633 + break; 1634 + } 1635 + 1636 + mutex_unlock(&rdev->devlist_mtx); 1637 + 1638 + return ret; 1639 +} 1640 + 1641 static int nl80211_start_ap(struct sk_buff *skb, struct genl_info *info) 1642 { 1643 struct cfg80211_registered_device *rdev = info->user_ptr[0]; 1644 @@ -2348,7 +2375,7 @@ static int nl80211_start_ap(struct sk_bu 1645 } else if (wdev->preset_chan) { 1646 params.channel = wdev->preset_chan; 1647 params.channel_type = wdev->preset_chantype; 1648 - } else 1649 + } else if (!nl80211_get_ap_channel(rdev, ¶ms)) 1650 return -EINVAL; 1651 1652 if (!cfg80211_can_beacon_sec_chan(&rdev->wiphy, params.channel, 1653 @@ -2356,8 +2383,11 @@ static int nl80211_start_ap(struct sk_bu 1654 return -EINVAL; 1655 1656 err = rdev->ops->start_ap(&rdev->wiphy, dev, ¶ms); 1657 - if (!err) 1658 + if (!err) { 1659 + wdev->preset_chan = params.channel; 1660 + wdev->preset_chantype = params.channel_type; 1661 wdev->beacon_interval = params.beacon_interval; 1662 + } 1663 return err; 1664 } 1665 1666 --- a/drivers/net/wireless/ath/ath9k/link.c 1667 +++ b/drivers/net/wireless/ath/ath9k/link.c 1668 @@ -407,6 +407,7 @@ void ath_ani_calibrate(unsigned long dat 1669 longcal ? "long" : "", shortcal ? "short" : "", 1670 aniflag ? "ani" : "", common->ani.caldone ? "true" : "false"); 1671 1672 + ath9k_debug_samp_bb_mac(sc); 1673 ath9k_ps_restore(sc); 1674 1675 set_timer: 1676 @@ -415,7 +416,6 @@ set_timer: 1677 * The interval must be the shortest necessary to satisfy ANI, 1678 * short calibration and long calibration. 1679 */ 1680 - ath9k_debug_samp_bb_mac(sc); 1681 cal_interval = ATH_LONG_CALINTERVAL; 1682 if (sc->sc_ah->config.enable_ani) 1683 cal_interval = min(cal_interval, 1684 --- a/drivers/net/wireless/ath/ath.h 1685 +++ b/drivers/net/wireless/ath/ath.h 1686 @@ -143,6 +143,7 @@ struct ath_common { 1687 u32 keymax; 1688 DECLARE_BITMAP(keymap, ATH_KEYMAX); 1689 DECLARE_BITMAP(tkip_keymap, ATH_KEYMAX); 1690 + DECLARE_BITMAP(ccmp_keymap, ATH_KEYMAX); 1691 enum ath_crypt_caps crypt_caps; 1692 1693 unsigned int clockrate; 1694 --- a/drivers/net/wireless/ath/ath9k/recv.c 1695 +++ b/drivers/net/wireless/ath/ath9k/recv.c 1696 @@ -785,7 +785,8 @@ static bool ath9k_rx_accept(struct ath_c 1697 * descriptor does contain a valid key index. This has been observed 1698 * mostly with CCMP encryption. 1699 */ 1700 - if (rx_stats->rs_keyix == ATH9K_RXKEYIX_INVALID) 1701 + if (rx_stats->rs_keyix == ATH9K_RXKEYIX_INVALID || 1702 + !test_bit(rx_stats->rs_keyix, common->ccmp_keymap)) 1703 rx_stats->rs_status &= ~ATH9K_RXERR_KEYMISS; 1704 1705 if (!rx_stats->rs_datalen) { 1706 --- a/drivers/net/wireless/ath/key.c 1707 +++ b/drivers/net/wireless/ath/key.c 1708 @@ -556,6 +556,9 @@ int ath_key_config(struct ath_common *co 1709 return -EIO; 1710 1711 set_bit(idx, common->keymap); 1712 + if (key->cipher == WLAN_CIPHER_SUITE_CCMP) 1713 + set_bit(idx, common->ccmp_keymap); 1714 + 1715 if (key->cipher == WLAN_CIPHER_SUITE_TKIP) { 1716 set_bit(idx + 64, common->keymap); 1717 set_bit(idx, common->tkip_keymap); 1718 @@ -582,6 +585,7 @@ void ath_key_delete(struct ath_common *c 1719 return; 1720 1721 clear_bit(key->hw_key_idx, common->keymap); 1722 + clear_bit(key->hw_key_idx, common->ccmp_keymap); 1723 if (key->cipher != WLAN_CIPHER_SUITE_TKIP) 1724 return; 1725 1976 --- a/net/mac80211/tx.c 1977 +++ b/net/mac80211/tx.c 1978 @@ -2716,7 +2716,7 @@ EXPORT_SYMBOL(ieee80211_get_buffered_bc) 1979 void ieee80211_tx_skb_tid(struct ieee80211_sub_if_data *sdata, 1980 struct sk_buff *skb, int tid) 1981 { 1982 - int ac = ieee802_1d_to_ac[tid]; 1983 + int ac = ieee802_1d_to_ac[tid & 7]; 1984 1985 skb_set_mac_header(skb, 0); 1986 skb_set_network_header(skb, 0); -
trunk/package/mac80211/patches/402-ath9k-fix-invalid-mac-address-handling.patch
r32420 r32655 9 9 10 10 #include "hw.h" 11 @@ -52 3,8 +524,16 @@ static int ath9k_hw_init_macaddr(struct11 @@ -526,8 +527,16 @@ static int ath9k_hw_init_macaddr(struct 12 12 common->macaddr[2 * i] = eeval >> 8; 13 13 common->macaddr[2 * i + 1] = eeval & 0xff; -
trunk/package/mac80211/patches/405-regd_no_assoc_hints.patch
r31347 r32655 1 1 --- a/net/wireless/reg.c 2 2 +++ b/net/wireless/reg.c 3 @@ -1 699,6 +1699,8 @@ void regulatory_hint_11d(struct wiphy *w3 @@ -1702,6 +1702,8 @@ void regulatory_hint_11d(struct wiphy *w 4 4 enum environment_cap env = ENVIRON_ANY; 5 5 struct regulatory_request *request; … … 10 10 11 11 if (unlikely(!last_request)) 12 @@ -193 4,6 +1936,8 @@ static void restore_regulatory_settings(12 @@ -1937,6 +1939,8 @@ static void restore_regulatory_settings( 13 13 14 14 void regulatory_hint_disconnect(void) -
trunk/package/mac80211/patches/412-mac80211_allow_adhoc_and_ap.patch
r32420 r32655 1 1 --- a/net/mac80211/main.c 2 2 +++ b/net/mac80211/main.c 3 @@ -7 76,17 +776,11 @@ int ieee80211_register_hw(struct ieee8023 @@ -786,17 +786,11 @@ int ieee80211_register_hw(struct ieee802 4 4 */ 5 5 for (i = 0; i < hw->wiphy->n_iface_combinations; i++) { -
trunk/package/mac80211/patches/440-ath5k_channel_bw_debugfs.patch
r32595 r32655 10 10 1 files changed, 86 insertions(+), 0 deletions(-) 11 11 12 diff --git a/drivers/net/wireless/ath/ath5k/debug.c b/drivers/net/wireless/ath/ath5k/debug.c13 index 8c5ce8b..bb41066 10064414 12 --- a/drivers/net/wireless/ath/ath5k/debug.c 15 13 +++ b/drivers/net/wireless/ath/ath5k/debug.c 16 @@ -81 5,6 +815,89 @@ static const struct file_operations fops_ani = {14 @@ -812,6 +812,89 @@ static const struct file_operations fops 17 15 .llseek = default_llseek, 18 16 }; … … 104 102 /* debugfs: queues etc */ 105 103 106 @@ -90 6,6 +989,9 @@ ath5k_debug_init_device(struct ath5k_hw *ah)104 @@ -903,6 +986,9 @@ ath5k_debug_init_device(struct ath5k_hw 107 105 debugfs_create_file("beacon", S_IWUSR | S_IRUSR, phydir, ah, 108 106 &fops_beacon); … … 114 112 115 113 debugfs_create_file("antenna", S_IWUSR | S_IRUSR, phydir, ah, 116 -- -
trunk/package/mac80211/patches/500-ath9k_eeprom_debugfs.patch
r32420 r32655 1 1 --- a/drivers/net/wireless/ath/ath9k/debug.c 2 2 +++ b/drivers/net/wireless/ath/ath9k/debug.c 3 @@ -153 3,6 +1533,53 @@ static const struct file_operations fops3 @@ -1532,6 +1532,53 @@ static const struct file_operations fops 4 4 5 5 #endif … … 55 55 { 56 56 struct ath_common *common = ath9k_hw_common(ah); 57 @@ -159 6,5 +1643,8 @@ int ath9k_init_debug(struct ath_hw *ah)57 @@ -1595,5 +1642,8 @@ int ath9k_init_debug(struct ath_hw *ah) 58 58 debugfs_create_u32("gpio_val", S_IRUSR | S_IWUSR, 59 59 sc->debug.debugfs_phy, &sc->sc_ah->gpio_val); -
trunk/package/mac80211/patches/501-ath9k-eeprom_endianess.patch
r32420 r32655 72 72 --- a/drivers/net/wireless/ath/ath9k/hw.h 73 73 +++ b/drivers/net/wireless/ath/ath9k/hw.h 74 @@ -65 7,6 +657,7 @@ enum ath_cal_list {74 @@ -658,6 +658,7 @@ enum ath_cal_list { 75 75 #define AH_USE_EEPROM 0x1 76 76 #define AH_UNPLUGGED 0x2 /* The card has been physically removed. */ -
trunk/package/mac80211/patches/510-ath9k_intr_mitigation_tweak.patch
r32420 r32655 1 1 --- a/drivers/net/wireless/ath/ath9k/hw.c 2 2 +++ b/drivers/net/wireless/ath/ath9k/hw.c 3 @@ -19 28,8 +1928,8 @@ int ath9k_hw_reset(struct ath_hw *ah, st3 @@ -1956,8 +1956,8 @@ int ath9k_hw_reset(struct ath_hw *ah, st 4 4 REG_WRITE(ah, AR_OBS, 8); 5 5 -
trunk/package/mac80211/patches/512-ath9k_channelbw_debugfs.patch
r32491 r32655 1 1 --- a/drivers/net/wireless/ath/ath9k/ath9k.h 2 2 +++ b/drivers/net/wireless/ath/ath9k/ath9k.h 3 @@ -64 1,6 +641,7 @@ struct ath_softc {3 @@ -649,6 +649,7 @@ struct ath_softc { 4 4 struct ieee80211_hw *hw; 5 5 struct device *dev; … … 9 9 struct survey_info survey[ATH9K_NUM_CHANNELS]; 10 10 11 @@ -7 09,6 +710,7 @@ struct ath_softc {11 @@ -717,6 +718,7 @@ struct ath_softc { 12 12 struct dfs_pattern_detector *dfs_detector; 13 13 }; … … 19 19 --- a/drivers/net/wireless/ath/ath9k/debug.c 20 20 +++ b/drivers/net/wireless/ath/ath9k/debug.c 21 @@ -15 80,6 +1580,50 @@ static const struct file_operations fops21 @@ -1579,6 +1579,50 @@ static const struct file_operations fops 22 22 .owner = THIS_MODULE 23 23 }; … … 70 70 { 71 71 struct ath_common *common = ath9k_hw_common(ah); 72 @@ -164 6,5 +1690,8 @@ int ath9k_init_debug(struct ath_hw *ah)72 @@ -1645,5 +1689,8 @@ int ath9k_init_debug(struct ath_hw *ah) 73 73 debugfs_create_file("eeprom", S_IRUSR, sc->debug.debugfs_phy, sc, 74 74 &fops_eeprom); … … 81 81 --- a/drivers/net/wireless/ath/ath9k/main.c 82 82 +++ b/drivers/net/wireless/ath/ath9k/main.c 83 @@ -1 124,7 +1124,7 @@ static void ath9k_disable_ps(struct ath_83 @@ -1084,7 +1084,7 @@ static void ath9k_disable_ps(struct ath_ 84 84 ath_dbg(common, PS, "PowerSave disabled\n"); 85 85 } … … 90 90 struct ath_softc *sc = hw->priv; 91 91 struct ath_hw *ah = sc->sc_ah; 92 @@ -11 75,9 +1175,11 @@ static int ath9k_config(struct ieee8021192 @@ -1138,9 +1138,11 @@ static int ath9k_config(struct ieee80211 93 93 94 94 if ((changed & IEEE80211_CONF_CHANGE_CHANNEL) || reset_channel) { … … 102 102 if (ah->curchan) 103 103 old_pos = ah->curchan - &ah->channels[0]; 104 @@ -1 220,7 +1222,23 @@ static int ath9k_config(struct ieee80211104 @@ -1183,7 +1185,23 @@ static int ath9k_config(struct ieee80211 105 105 memset(&sc->survey[pos], 0, sizeof(struct survey_info)); 106 106 } -
trunk/package/mac80211/patches/513-mac80211_reduce_txqueuelen.patch
r32420 r32655 1 1 --- a/net/mac80211/iface.c 2 2 +++ b/net/mac80211/iface.c 3 @@ - 814,6 +814,7 @@ static const struct net_device_ops ieee83 @@ -916,6 +916,7 @@ static const struct net_device_ops ieee8 4 4 static void ieee80211_if_setup(struct net_device *dev) 5 5 { -
trunk/package/mac80211/patches/520-mac80211_cur_txpower.patch
r32420 r32655 12 12 --- a/net/mac80211/cfg.c 13 13 +++ b/net/mac80211/cfg.c 14 @@ -19 40,7 +1940,7 @@ static int ieee80211_get_tx_power(struct14 @@ -1956,7 +1956,7 @@ static int ieee80211_get_tx_power(struct 15 15 { 16 16 struct ieee80211_local *local = wiphy_priv(wiphy); -
trunk/package/mac80211/patches/521-ath9k_cur_txpower.patch
r32491 r32655 1 1 --- a/drivers/net/wireless/ath/ath9k/main.c 2 2 +++ b/drivers/net/wireless/ath/ath9k/main.c 3 @@ -12 45,6 +1245,8 @@ int ath9k_config(struct ieee80211_hw *hw3 @@ -1208,6 +1208,8 @@ int ath9k_config(struct ieee80211_hw *hw 4 4 return -EINVAL; 5 5 } … … 10 10 * The most recent snapshot of channel->noisefloor for the old 11 11 * channel is only available after the hardware reset. Copy it to 12 @@ -12 59,6 +1261,7 @@ int ath9k_config(struct ieee80211_hw *hw12 @@ -1222,6 +1224,7 @@ int ath9k_config(struct ieee80211_hw *hw 13 13 sc->config.txpowlimit = 2 * conf->power_level; 14 14 ath9k_cmn_update_txpow(ah, sc->curtxpow, -
trunk/package/mac80211/patches/522-ath9k_per_chain_signal_strength.patch
r32492 r32655 38 38 --- a/net/mac80211/rx.c 39 39 +++ b/net/mac80211/rx.c 40 @@ -12 63,6 +1263,7 @@ ieee80211_rx_h_sta_process(struct ieee8040 @@ -1254,6 +1254,7 @@ ieee80211_rx_h_sta_process(struct ieee80 41 41 struct sk_buff *skb = rx->skb; 42 42 struct ieee80211_rx_status *status = IEEE80211_SKB_RXCB(skb); … … 46 46 if (!sta) 47 47 return RX_CONTINUE; 48 @@ -1 307,6 +1308,19 @@ ieee80211_rx_h_sta_process(struct ieee8048 @@ -1298,6 +1299,19 @@ ieee80211_rx_h_sta_process(struct ieee80 49 49 ewma_add(&sta->avg_signal, -status->signal); 50 50 } … … 68 68 --- a/net/mac80211/sta_info.c 69 69 +++ b/net/mac80211/sta_info.c 70 @@ -25 6,6 +256,8 @@ struct sta_info *sta_info_alloc(struct i70 @@ -254,6 +254,8 @@ struct sta_info *sta_info_alloc(struct i 71 71 do_posix_clock_monotonic_gettime(&uptime); 72 72 sta->last_connected = uptime.tv_sec; … … 79 79 --- a/include/net/cfg80211.h 80 80 +++ b/include/net/cfg80211.h 81 @@ -5 27,6 +527,8 @@ struct station_parameters {81 @@ -546,6 +546,8 @@ struct station_parameters { 82 82 * @STATION_INFO_STA_FLAGS: @sta_flags filled 83 83 * @STATION_INFO_BEACON_LOSS_COUNT: @beacon_loss_count filled … … 88 88 enum station_info_flags { 89 89 STATION_INFO_INACTIVE_TIME = 1<<0, 90 @@ -5 50,6 +552,8 @@ enum station_info_flags {90 @@ -569,6 +571,8 @@ enum station_info_flags { 91 91 STATION_INFO_STA_FLAGS = 1<<18, 92 92 STATION_INFO_BEACON_LOSS_COUNT = 1<<19, … … 97 97 98 98 /** 99 @@ -6 31,6 +635,9 @@ struct sta_bss_parameters {100 NOTE:For CFG80211_SIGNAL_TYPE_MBM, value is expressed in _dBm_.101 * @signal_avg: avg signal strength, type depends on the wiphy's signal_type102 NOTE:For CFG80211_SIGNAL_TYPE_MBM, value is expressed in _dBm_.99 @@ -652,6 +656,9 @@ struct sta_bss_parameters { 100 * For CFG80211_SIGNAL_TYPE_MBM, value is expressed in _dBm_. 101 * @signal_avg: Average signal strength, type depends on the wiphy's signal_type. 102 * For CFG80211_SIGNAL_TYPE_MBM, value is expressed in _dBm_. 103 103 + * @chains: bitmask for filled values in @chain_signal, @chain_signal_avg 104 104 + * @chain_signal: per-chain signal strength of last received packet in dBm … … 107 107 * @rxrate: current unicast bitrate to this station 108 108 * @rx_packets: packets received from this station 109 @@ -6 63,6 +670,11 @@ struct station_info {109 @@ -684,6 +691,11 @@ struct station_info { 110 110 u8 plink_state; 111 111 s8 signal; … … 138 138 --- a/drivers/net/wireless/ath/ath9k/recv.c 139 139 +++ b/drivers/net/wireless/ath/ath9k/recv.c 140 @@ -95 2,6 +952,7 @@ static int ath9k_rx_skb_preprocess(struc140 @@ -955,6 +955,7 @@ static int ath9k_rx_skb_preprocess(struc 141 141 bool *decrypt_error) 142 142 { … … 146 146 /* 147 147 * everything but the rate is checked here, the rate check is done 148 @@ -9 77,6 +978,20 @@ static int ath9k_rx_skb_preprocess(struc148 @@ -980,6 +981,20 @@ static int ath9k_rx_skb_preprocess(struc 149 149 if (rx_stats->rs_moreaggr) 150 150 rx_status->flag |= RX_FLAG_NO_SIGNAL_VAL; … … 230 230 --- a/drivers/net/wireless/ath/ath9k/debug.c 231 231 +++ b/drivers/net/wireless/ath/ath9k/debug.c 232 @@ -99 8,12 +998,12 @@ void ath_debug_stat_rx(struct ath_softc232 @@ -997,12 +997,12 @@ void ath_debug_stat_rx(struct ath_softc 233 233 #ifdef CONFIG_ATH9K_MAC_DEBUG 234 234 spin_lock(&sc->debug.samp_lock); … … 251 251 --- a/include/linux/nl80211.h 252 252 +++ b/include/linux/nl80211.h 253 @@ -1 699,6 +1699,8 @@ enum nl80211_sta_bss_param {253 @@ -1729,6 +1729,8 @@ enum nl80211_sta_bss_param { 254 254 * @NL80211_STA_INFO_STA_FLAGS: Contains a struct nl80211_sta_flag_update. 255 255 * @NL80211_STA_INFO_BEACON_LOSS: count of times beacon loss was detected (u32) … … 260 260 * @NL80211_STA_INFO_MAX: highest possible station info attribute 261 261 */ 262 @@ -17 23,6 +1725,8 @@ enum nl80211_sta_info {262 @@ -1753,6 +1755,8 @@ enum nl80211_sta_info { 263 263 NL80211_STA_INFO_STA_FLAGS, 264 264 NL80211_STA_INFO_BEACON_LOSS, … … 271 271 --- a/net/wireless/nl80211.c 272 272 +++ b/net/wireless/nl80211.c 273 @@ -2 553,6 +2553,32 @@ nla_put_failure:273 @@ -2648,6 +2648,32 @@ nla_put_failure: 274 274 return false; 275 275 } … … 304 304 int flags, 305 305 struct cfg80211_registered_device *rdev, 306 @@ -2 614,6 +2640,18 @@ static int nl80211_send_station(struct s306 @@ -2709,6 +2735,18 @@ static int nl80211_send_station(struct s 307 307 default: 308 308 break; … … 325 325 --- a/net/mac80211/cfg.c 326 326 +++ b/net/mac80211/cfg.c 327 @@ -354,6 +354,7 @@ static void sta_set_sinfo(struct sta_inf 328 { 327 @@ -355,6 +355,7 @@ static void sta_set_sinfo(struct sta_inf 329 328 struct ieee80211_sub_if_data *sdata = sta->sdata; 329 struct ieee80211_local *local = sdata->local; 330 330 struct timespec uptime; 331 331 + int i; … … 333 333 sinfo->generation = sdata->local->sta_generation; 334 334 335 @@ -39 1,6 +392,17 @@ static void sta_set_sinfo(struct sta_inf336 sinfo->signal = (s8)sta->last_signal;335 @@ -394,6 +395,17 @@ static void sta_set_sinfo(struct sta_inf 336 sinfo->signal = (s8)sta->last_signal; 337 337 sinfo->signal_avg = (s8) -ewma_read(&sta->avg_signal); 338 338 } -
trunk/package/mac80211/patches/530-ath9k_fix_initvals.patch
r32515 r32655 1 1 --- a/drivers/net/wireless/ath/ath9k/ar9003_2p2_initvals.h 2 2 +++ b/drivers/net/wireless/ath/ath9k/ar9003_2p2_initvals.h 3 @@ -53 3,108 +533,108 @@ static const u32 ar9300_2p2_baseband_cor3 @@ -534,108 +534,108 @@ static const u32 ar9300_2p2_baseband_cor 4 4 5 5 static const u32 ar9300Modes_high_power_tx_gain_table_2p2[][5] = { -
trunk/package/mac80211/patches/540-ath9k_extra_leds.patch
r32515 r32655 1 1 --- a/drivers/net/wireless/ath/ath9k/ath9k.h 2 2 +++ b/drivers/net/wireless/ath/ath9k/ath9k.h 3 @@ -5 19,6 +519,9 @@ static inline u16 ath9k_btcoex_aggr_limi3 @@ -528,6 +528,9 @@ static inline void ath9k_btcoex_stop_gen 4 4 #ifdef CONFIG_MAC80211_LEDS 5 5 void ath_init_leds(struct ath_softc *sc); … … 11 11 static inline void ath_init_leds(struct ath_softc *sc) 12 12 { 13 @@ -6 37,6 +640,13 @@ struct ath9k_vif_iter_data {13 @@ -645,6 +648,13 @@ struct ath9k_vif_iter_data { 14 14 int nadhocs; /* number of adhoc vifs */ 15 15 }; … … 25 25 struct ieee80211_hw *hw; 26 26 struct device *dev; 27 @@ -6 78,9 +688,8 @@ struct ath_softc {27 @@ -686,9 +696,8 @@ struct ath_softc { 28 28 struct ieee80211_supported_band sbands[IEEE80211_NUM_BANDS]; 29 29 … … 183 183 --- a/drivers/net/wireless/ath/ath9k/debug.c 184 184 +++ b/drivers/net/wireless/ath/ath9k/debug.c 185 @@ -125 6,6 +1256,61 @@ static const struct file_operations fops185 @@ -1255,6 +1255,61 @@ static const struct file_operations fops 186 186 .llseek = default_llseek, 187 187 }; … … 245 245 246 246 void ath9k_debug_samp_bb_mac(struct ath_softc *sc) 247 @@ -168 1,6 +1736,11 @@ int ath9k_init_debug(struct ath_hw *ah)247 @@ -1680,6 +1735,11 @@ int ath9k_init_debug(struct ath_hw *ah) 248 248 &fops_samps); 249 249 #endif -
trunk/package/mac80211/patches/550-mac80211_optimize_mcs_rate_mask.patch
r32420 r32655 1 1 --- a/net/mac80211/ieee80211_i.h 2 2 +++ b/net/mac80211/ieee80211_i.h 3 @@ -7 02,6 +702,8 @@ struct ieee80211_sub_if_data {3 @@ -710,6 +710,8 @@ struct ieee80211_sub_if_data { 4 4 5 5 /* bitmap of allowed (non-MCS) rate indexes for rate control */ … … 12 12 --- a/net/mac80211/cfg.c 13 13 +++ b/net/mac80211/cfg.c 14 @@ -21 19,9 +2119,20 @@ static int ieee80211_set_bitrate_mask(st14 @@ -2135,9 +2135,20 @@ static int ieee80211_set_bitrate_mask(st 15 15 } 16 16 … … 35 35 --- a/include/net/mac80211.h 36 36 +++ b/include/net/mac80211.h 37 @@ -36 76,7 +3676,7 @@ void ieee80211_send_bar(struct ieee8021137 @@ -3665,7 +3665,7 @@ void ieee80211_send_bar(struct ieee80211 38 38 * (deprecated; this will be removed once drivers get updated to use 39 39 * rate_idx_mask) … … 44 44 */ 45 45 struct ieee80211_tx_rate_control { 46 @@ -36 88,7 +3688,7 @@ struct ieee80211_tx_rate_control {46 @@ -3677,7 +3677,7 @@ struct ieee80211_tx_rate_control { 47 47 bool rts, short_preamble; 48 48 u8 max_rate_idx; … … 55 55 --- a/net/mac80211/tx.c 56 56 +++ b/net/mac80211/tx.c 57 @@ -6 37,9 +637,11 @@ ieee80211_tx_h_rate_ctrl(struct ieee802157 @@ -624,9 +624,11 @@ ieee80211_tx_h_rate_ctrl(struct ieee8021 58 58 txrc.max_rate_idx = -1; 59 59 else … … 70 70 tx->sdata->vif.type == NL80211_IFTYPE_MESH_POINT || 71 71 tx->sdata->vif.type == NL80211_IFTYPE_ADHOC); 72 @@ -24 75,8 +2477,6 @@ struct sk_buff *ieee80211_beacon_get_tim72 @@ -2454,8 +2456,6 @@ struct sk_buff *ieee80211_beacon_get_tim 73 73 txrc.max_rate_idx = -1; 74 74 else -
trunk/package/mac80211/patches/561-ath9k_antenna_mask_validate.patch
r32509 r32655 1 1 --- a/drivers/net/wireless/ath/ath9k/main.c 2 2 +++ b/drivers/net/wireless/ath/ath9k/main.c 3 @@ -1 929,12 +1929,29 @@ static u32 fill_chainmask(u32 cap, u32 n3 @@ -1840,12 +1840,29 @@ static u32 fill_chainmask(u32 cap, u32 n 4 4 return filled; 5 5 } -
trunk/package/mac80211/patches/563-ath9k_enable_ar9340_ani.patch
r32510 r32655 1 1 --- a/drivers/net/wireless/ath/ath9k/hw.c 2 2 +++ b/drivers/net/wireless/ath/ath9k/hw.c 3 @@ -6 76,10 +676,6 @@ static int __ath9k_hw_init(struct ath_hw3 @@ -680,10 +680,6 @@ static int __ath9k_hw_init(struct ath_hw 4 4 if (!AR_SREV_9300_20_OR_LATER(ah)) 5 5 ah->ani_function &= ~ATH9K_ANI_MRC_CCK; -
trunk/package/mac80211/patches/570-ath9k_config_qlen.patch
r32589 r32655 21 21 --- a/drivers/net/wireless/ath/ath9k/xmit.c 22 22 +++ b/drivers/net/wireless/ath/ath9k/xmit.c 23 @@ -198 8,7 +1988,8 @@ int ath_tx_start(struct ieee80211_hw *hw23 @@ -1987,7 +1987,8 @@ int ath_tx_start(struct ieee80211_hw *hw 24 24 25 25 ath_txq_lock(sc, txq); … … 31 31 txq->stopped = true; 32 32 } 33 @@ -204 7,7 +2048,8 @@ static void ath_tx_complete(struct ath_s33 @@ -2046,7 +2047,8 @@ static void ath_tx_complete(struct ath_s 34 34 if (WARN_ON(--txq->pending_frames < 0)) 35 35 txq->pending_frames = 0; … … 43 43 --- a/drivers/net/wireless/ath/ath9k/debug.c 44 44 +++ b/drivers/net/wireless/ath/ath9k/debug.c 45 @@ -170 2,6 +1702,14 @@ int ath9k_init_debug(struct ath_hw *ah)45 @@ -1701,6 +1701,14 @@ int ath9k_init_debug(struct ath_hw *ah) 46 46 &fops_interrupt); 47 47 debugfs_create_file("xmit", S_IRUSR, sc->debug.debugfs_phy, sc, -
trunk/package/mac80211/patches/600-rt2x00-disable-pci-code-if-CONFIG_PCI-not-defined.patch
r26744 r32655 9 9 * PCI driver handlers. 10 10 */ 11 @@ -3 83,6 +384,7 @@ int rt2x00pci_resume(struct pci_dev *pci11 @@ -392,6 +393,7 @@ int rt2x00pci_resume(struct pci_dev *pci 12 12 } 13 13 EXPORT_SYMBOL_GPL(rt2x00pci_resume); -
trunk/package/mac80211/patches/601-rt2x00-set_pci_mwi.patch
r27394 r32655 1 1 --- a/drivers/net/wireless/rt2x00/rt2x00pci.c 2 2 +++ b/drivers/net/wireless/rt2x00/rt2x00pci.c 3 @@ -27 2,8 +272,10 @@ int rt2x00pci_probe(struct pci_dev *pci_3 @@ -273,8 +273,10 @@ int rt2x00pci_probe(struct pci_dev *pci_ 4 4 5 5 pci_set_master(pci_dev); -
trunk/package/mac80211/patches/603-rt2x00-introduce-rt2x00eeprom.patch
r32420 r32655 102 102 --- a/drivers/net/wireless/rt2x00/rt2x00.h 103 103 +++ b/drivers/net/wireless/rt2x00/rt2x00.h 104 @@ -5 59,6 +559,7 @@ struct rt2x00lib_ops {104 @@ -560,6 +560,7 @@ struct rt2x00lib_ops { 105 105 const u8 *data, const size_t len); 106 106 int (*load_firmware) (struct rt2x00_dev *rt2x00dev, … … 110 110 /* 111 111 * Device initialization/deinitialization handlers. 112 @@ -72 0,6 +721,7 @@ enum rt2x00_capability_flags {112 @@ -721,6 +722,7 @@ enum rt2x00_capability_flags { 113 113 REQUIRE_SW_SEQNO, 114 114 REQUIRE_HT_TX_DESC, … … 118 118 /* 119 119 * Capabilities 120 @@ -97 5,6 +977,11 @@ struct rt2x00_dev {120 @@ -976,6 +978,11 @@ struct rt2x00_dev { 121 121 const struct firmware *fw; 122 122 … … 165 165 select CRC_CCITT 166 166 select EEPROM_93CX6 167 @@ -2 04,6 +205,9 @@ config RT2X00_LIB_FIRMWARE167 @@ -212,6 +213,9 @@ config RT2X00_LIB_FIRMWARE 168 168 config RT2X00_LIB_CRYPTO 169 169 boolean … … 209 209 #ifdef CONFIG_PCI 210 210 static void rt2800pci_eepromregister_read(struct eeprom_93cx6 *eeprom) 211 @@ -31 1,6 +301,20 @@ static int rt2800pci_write_firmware(stru211 @@ -317,6 +307,20 @@ static int rt2800pci_write_firmware(stru 212 212 } 213 213 … … 230 230 */ 231 231 static bool rt2800pci_get_entry_state(struct queue_entry *entry) 232 @@ -1 082,6 +1086,7 @@ static const struct rt2x00lib_ops rt2800232 @@ -1159,6 +1163,7 @@ static const struct rt2x00lib_ops rt2800 233 233 .get_firmware_name = rt2800pci_get_firmware_name, 234 234 .check_firmware = rt2800_check_firmware, -
trunk/package/mac80211/patches/604-rt2x00-add-CONFIG_RT2X00_LIB_EEPROM-option.patch
r32420 r32655 1 1 --- a/config.mk 2 2 +++ b/config.mk 3 @@ -6 19,6 +619,7 @@ export CONFIG_RT2X00=y3 @@ -624,6 +624,7 @@ export CONFIG_RT2X00=y 4 4 export CONFIG_RT2X00_LIB=m 5 5 export CONFIG_RT2800_LIB=m -
trunk/package/mac80211/patches/605-rt2x00-pci-eeprom.patch
r31322 r32655 10 10 memcpy(rt2x00dev->eeprom, rt2x00dev->eeprom_file->data, EEPROM_SIZE); 11 11 } 12 @@ -9 68,8 +968,9 @@ static int rt2800pci_validate_eeprom(str12 @@ -974,8 +974,9 @@ static int rt2800pci_validate_eeprom(str 13 13 /* 14 14 * Read EEPROM into buffer … … 31 31 struct rt2x00_dev *rt2x00dev; 32 32 int retval; 33 34 @@ - 299,6 +300,12 @@ int rt2x00pci_probe(struct pci_dev *pci_33 u16 chip; 34 @@ -300,6 +301,12 @@ int rt2x00pci_probe(struct pci_dev *pci_ 35 35 rt2x00dev->irq = pci_dev->irq; 36 36 rt2x00dev->name = pci_name(pci_dev); -
trunk/package/mac80211/patches/607-rt2x00-allow_disabling_bands_through_platform_data.patch
r32420 r32655 38 38 --- a/drivers/net/wireless/rt2x00/rt2x00.h 39 39 +++ b/drivers/net/wireless/rt2x00/rt2x00.h 40 @@ -42 4,6 +424,7 @@ struct hw_mode_spec {40 @@ -425,6 +425,7 @@ struct hw_mode_spec { 41 41 unsigned int supported_bands; 42 42 #define SUPPORT_BAND_2GHZ 0x00000001 -
trunk/package/mac80211/patches/608-add_platform_data_mac_addr.patch
r32420 r32655 32 32 --- a/drivers/net/wireless/rt2x00/rt2x00.h 33 33 +++ b/drivers/net/wireless/rt2x00/rt2x00.h 34 @@ -12 79,6 +1279,7 @@ static inline void rt2x00debug_dump_fram34 @@ -1280,6 +1280,7 @@ static inline void rt2x00debug_dump_fram 35 35 */ 36 36 u32 rt2x00lib_get_bssidx(struct rt2x00_dev *rt2x00dev, -
trunk/package/mac80211/patches/700-mwl8k-missing-pci-id-for-WNR854T.patch
r31322 r32655 1 1 --- a/drivers/net/wireless/mwl8k.c 2 2 +++ b/drivers/net/wireless/mwl8k.c 3 @@ -529 6,6 +5296,7 @@ MODULE_FIRMWARE("mwl8k/fmimage_8366.fw")3 @@ -5297,6 +5297,7 @@ MODULE_FIRMWARE("mwl8k/fmimage_8366.fw") 4 4 MODULE_FIRMWARE(MWL8K_8366_AP_FW(MWL8K_8366_AP_FW_API)); 5 5 -
trunk/package/mac80211/patches/830-b43-workaround-pcie-bcm4716.patch
r32420 r32655 89 89 --- a/drivers/net/wireless/b43/phy_n.c 90 90 +++ b/drivers/net/wireless/b43/phy_n.c 91 @@ -483 7,14 +4837,14 @@ static inline void check_phyreg(struct b91 @@ -4838,14 +4838,14 @@ static inline void check_phyreg(struct b 92 92 static u16 b43_nphy_op_read(struct b43_wldev *dev, u16 reg) 93 93 { … … 106 106 } 107 107 108 @@ -485 2,7 +4852,7 @@ static void b43_nphy_op_maskset(struct b108 @@ -4853,7 +4853,7 @@ static void b43_nphy_op_maskset(struct b 109 109 u16 set) 110 110 { … … 115 115 } 116 116 117 @@ -486 3,7 +4863,7 @@ static u16 b43_nphy_op_radio_read(struct117 @@ -4864,7 +4864,7 @@ static u16 b43_nphy_op_radio_read(struct 118 118 /* N-PHY needs 0x100 for read access */ 119 119 reg |= 0x100; … … 124 124 } 125 125 126 @@ -487 2,7 +4872,7 @@ static void b43_nphy_op_radio_write(stru126 @@ -4873,7 +4873,7 @@ static void b43_nphy_op_radio_write(stru 127 127 /* Register 1 is a 32-bit register. */ 128 128 B43_WARN_ON(reg == 1); -
trunk/package/mac80211/patches/846-brcmsmac-remove-some-unnessessacry-casts-and-void-po.patch
r32020 r32655 1 1 --- a/drivers/net/wireless/brcm80211/brcmsmac/main.c 2 2 +++ b/drivers/net/wireless/brcm80211/brcmsmac/main.c 3 @@ -42 33,9 +4233,8 @@ static void brcms_c_radio_timer(void *ar3 @@ -4220,9 +4220,8 @@ static void brcms_c_radio_timer(void *ar 4 4 } 5 5 … … 12 12 13 13 BCMMSG(wlc->wiphy, "wl%d\n", wlc_hw->unit); 14 @@ -42 56,10 +4255,8 @@ static void brcms_b_watchdog(void *arg)14 @@ -4243,10 +4242,8 @@ static void brcms_b_watchdog(void *arg) 15 15 } 16 16 … … 24 24 25 25 if (!wlc->pub->up) 26 @@ -42 99,7 +4296,9 @@ static void brcms_c_watchdog(void *arg)26 @@ -4286,7 +4283,9 @@ static void brcms_c_watchdog(void *arg) 27 27 28 28 static void brcms_c_watchdog_by_timer(void *arg) -
trunk/package/mac80211/patches/847-brcmsmac-add-suome-conditions-for-the-bcm4716-again.patch
r32420 r32655 1 1 --- a/drivers/net/wireless/brcm80211/brcmsmac/main.c 2 2 +++ b/drivers/net/wireless/brcm80211/brcmsmac/main.c 3 @@ -194 3,7 +1943,8 @@ static bool brcms_b_radio_read_hwdisable3 @@ -1944,7 +1944,8 @@ static bool brcms_b_radio_read_hwdisable 4 4 * accesses phyreg throughput mac. This can be skipped since 5 5 * only mac reg is accessed below … … 11 11 /* 12 12 * TODO: test suspend/resume 13 @@ -202 4,7 +2025,8 @@ void brcms_b_corereset(struct brcms_hard13 @@ -2025,7 +2026,8 @@ void brcms_b_corereset(struct brcms_hard 14 14 * phyreg throughput mac, AND phy_reset is skipped at early stage when 15 15 * band->pi is invalid. need to enable PHY CLK -
trunk/package/mac80211/patches/848-brcmsmac-some-more-fixes-for-different-core-revs.patch
r32020 r32655 1 1 --- a/drivers/net/wireless/brcm80211/brcmsmac/main.c 2 2 +++ b/drivers/net/wireless/brcm80211/brcmsmac/main.c 3 @@ -27 0,7 +270,7 @@ struct brcms_c_bit_desc {3 @@ -271,7 +271,7 @@ struct brcms_c_bit_desc { 4 4 */ 5 5 … … 10 10 struct d11init { 11 11 __le16 addr; 12 @@ -33 4,6 +334,26 @@ const u8 wlc_prio2prec_map[] = {12 @@ -335,6 +335,26 @@ const u8 wlc_prio2prec_map[] = { 13 13 }; 14 14 … … 37 37 {20, 192, 192, 21, 17, 5}, 38 38 /* corerev 21: 2304, 14848, 5632, 3584, 3584, 1280 */ 39 @@ -34 4,6 +364,18 @@ static const u16 xmtfifo_sz[][NFIFO] = {39 @@ -345,6 +365,18 @@ static const u16 xmtfifo_sz[][NFIFO] = { 40 40 {20, 192, 192, 21, 17, 5}, 41 41 /* corerev 24: 2304, 14848, 5632, 3584, 3584, 1280 */ … … 56 56 57 57 #ifdef DEBUG 58 @@ -4 611,8 +4643,15 @@ static int brcms_b_attach(struct brcms_c58 @@ -4598,8 +4630,15 @@ static int brcms_b_attach(struct brcms_c 59 59 wlc_hw->machwcap_backup = wlc_hw->machwcap; 60 60 -
trunk/package/mac80211/patches/849-brcmsmac-add-device-found-on-some-SoCs-like-the-bcm4.patch
r32420 r32655 11 11 --- a/drivers/net/wireless/brcm80211/brcmsmac/main.c 12 12 +++ b/drivers/net/wireless/brcm80211/brcmsmac/main.c 13 @@ -75 1,7 +751,7 @@ static void brcms_c_ucode_bsinit(struct13 @@ -752,7 +752,7 @@ static void brcms_c_ucode_bsinit(struct 14 14 brcms_c_write_mhf(wlc_hw, wlc_hw->band->mhfs); 15 15 … … 20 20 brcms_c_write_inits(wlc_hw, ucode->d11n0bsinitvals16); 21 21 else 22 @@ -227 6,7 +2276,7 @@ static void brcms_ucode_download(struct22 @@ -2277,7 +2277,7 @@ static void brcms_ucode_download(struct 23 23 if (wlc_hw->ucode_loaded) 24 24 return; … … 29 29 brcms_ucode_write(wlc_hw, ucode->bcm43xx_16_mimo, 30 30 ucode->bcm43xx_16_mimosz); 31 @@ -32 52,7 +3252,7 @@ static void brcms_b_coreinit(struct brcm31 @@ -3239,7 +3239,7 @@ static void brcms_b_coreinit(struct brcm 32 32 33 33 sflags = bcma_aread32(core, BCMA_IOST); -
trunk/package/mac80211/patches/850-brcmsmac-add-support-for-BCM43224.patch
r32020 r32655 1 1 --- a/drivers/net/wireless/brcm80211/brcmsmac/main.c 2 2 +++ b/drivers/net/wireless/brcm80211/brcmsmac/main.c 3 @@ -41 66,6 +4166,7 @@ void brcms_c_wme_setparams(struct brcms_3 @@ -4153,6 +4153,7 @@ void brcms_c_wme_setparams(struct brcms_ 4 4 M_EDCF_QINFO + 5 5 wme_ac2fifo[aci] * M_EDCF_QLEN + i, … … 9 9 10 10 if (suspend) { 11 @@ -45 70,7 +4571,8 @@ static int brcms_b_attach(struct brcms_c11 @@ -4557,7 +4558,8 @@ static int brcms_b_attach(struct brcms_c 12 12 13 13 /* check device id(srom, nvram etc.) to set bands */ … … 19 19 wlc_hw->_nbands = 2; 20 20 else 21 @@ -58 31,7 +5833,7 @@ bool brcms_c_chipmatch(u16 vendor, u16 d21 @@ -5816,7 +5818,7 @@ bool brcms_c_chipmatch(u16 vendor, u16 d 22 22 return false; 23 23 } -
trunk/package/mac80211/patches/851-brcmsmac-start-adding-support-for-core-rev-28.patch
r32420 r32655 11 11 --- a/drivers/net/wireless/brcm80211/brcmsmac/main.c 12 12 +++ b/drivers/net/wireless/brcm80211/brcmsmac/main.c 13 @@ -75 1,7 +751,7 @@ static void brcms_c_ucode_bsinit(struct13 @@ -752,7 +752,7 @@ static void brcms_c_ucode_bsinit(struct 14 14 brcms_c_write_mhf(wlc_hw, wlc_hw->band->mhfs); 15 15 … … 20 20 brcms_c_write_inits(wlc_hw, ucode->d11n0bsinitvals16); 21 21 else 22 @@ -227 6,7 +2276,7 @@ static void brcms_ucode_download(struct22 @@ -2277,7 +2277,7 @@ static void brcms_ucode_download(struct 23 23 if (wlc_hw->ucode_loaded) 24 24 return; … … 29 29 brcms_ucode_write(wlc_hw, ucode->bcm43xx_16_mimo, 30 30 ucode->bcm43xx_16_mimosz); 31 @@ -32 52,7 +3252,7 @@ static void brcms_b_coreinit(struct brcm31 @@ -3239,7 +3239,7 @@ static void brcms_b_coreinit(struct brcm 32 32 33 33 sflags = bcma_aread32(core, BCMA_IOST);
Note: See TracChangeset
for help on using the changeset viewer.