diff options
Diffstat (limited to 'drivers/net/wireless/ath/ath9k')
-rw-r--r-- | drivers/net/wireless/ath/ath9k/ath9k.h | 39 | ||||
-rw-r--r-- | drivers/net/wireless/ath/ath9k/beacon.c | 11 | ||||
-rw-r--r-- | drivers/net/wireless/ath/ath9k/calib.c | 6 | ||||
-rw-r--r-- | drivers/net/wireless/ath/ath9k/hw.c | 37 | ||||
-rw-r--r-- | drivers/net/wireless/ath/ath9k/hw.h | 3 | ||||
-rw-r--r-- | drivers/net/wireless/ath/ath9k/main.c | 206 | ||||
-rw-r--r-- | drivers/net/wireless/ath/ath9k/rc.c | 70 | ||||
-rw-r--r-- | drivers/net/wireless/ath/ath9k/xmit.c | 10 |
8 files changed, 187 insertions, 195 deletions
diff --git a/drivers/net/wireless/ath/ath9k/ath9k.h b/drivers/net/wireless/ath/ath9k/ath9k.h index c92d46fa9d51..10ffc9442859 100644 --- a/drivers/net/wireless/ath/ath9k/ath9k.h +++ b/drivers/net/wireless/ath/ath9k/ath9k.h | |||
@@ -576,8 +576,8 @@ struct ath_softc { | |||
576 | struct ath_tx tx; | 576 | struct ath_tx tx; |
577 | struct ath_beacon beacon; | 577 | struct ath_beacon beacon; |
578 | struct ieee80211_rate rates[IEEE80211_NUM_BANDS][ATH_RATE_MAX]; | 578 | struct ieee80211_rate rates[IEEE80211_NUM_BANDS][ATH_RATE_MAX]; |
579 | struct ath_rate_table *hw_rate_table[ATH9K_MODE_MAX]; | 579 | const struct ath_rate_table *hw_rate_table[ATH9K_MODE_MAX]; |
580 | struct ath_rate_table *cur_rate_table; | 580 | const struct ath_rate_table *cur_rate_table; |
581 | struct ieee80211_supported_band sbands[IEEE80211_NUM_BANDS]; | 581 | struct ieee80211_supported_band sbands[IEEE80211_NUM_BANDS]; |
582 | 582 | ||
583 | struct ath_led radio_led; | 583 | struct ath_led radio_led; |
@@ -590,6 +590,8 @@ struct ath_softc { | |||
590 | int led_on_cnt; | 590 | int led_on_cnt; |
591 | int led_off_cnt; | 591 | int led_off_cnt; |
592 | 592 | ||
593 | int beacon_interval; | ||
594 | |||
593 | struct ath_rfkill rf_kill; | 595 | struct ath_rfkill rf_kill; |
594 | struct ath_ani ani; | 596 | struct ath_ani ani; |
595 | struct ath9k_node_stats nodestats; | 597 | struct ath9k_node_stats nodestats; |
@@ -695,36 +697,7 @@ void ath9k_wiphy_pause_all_forced(struct ath_softc *sc, | |||
695 | bool ath9k_wiphy_scanning(struct ath_softc *sc); | 697 | bool ath9k_wiphy_scanning(struct ath_softc *sc); |
696 | void ath9k_wiphy_work(struct work_struct *work); | 698 | void ath9k_wiphy_work(struct work_struct *work); |
697 | 699 | ||
698 | /* | 700 | void ath9k_iowrite32(struct ath_hw *ah, u32 reg_offset, u32 val); |
699 | * Read and write, they both share the same lock. We do this to serialize | 701 | unsigned int ath9k_ioread32(struct ath_hw *ah, u32 reg_offset); |
700 | * reads and writes on Atheros 802.11n PCI devices only. This is required | ||
701 | * as the FIFO on these devices can only accept sanely 2 requests. After | ||
702 | * that the device goes bananas. Serializing the reads/writes prevents this | ||
703 | * from happening. | ||
704 | */ | ||
705 | |||
706 | static inline void ath9k_iowrite32(struct ath_hw *ah, u32 reg_offset, u32 val) | ||
707 | { | ||
708 | if (ah->config.serialize_regmode == SER_REG_MODE_ON) { | ||
709 | unsigned long flags; | ||
710 | spin_lock_irqsave(&ah->ah_sc->sc_serial_rw, flags); | ||
711 | iowrite32(val, ah->ah_sc->mem + reg_offset); | ||
712 | spin_unlock_irqrestore(&ah->ah_sc->sc_serial_rw, flags); | ||
713 | } else | ||
714 | iowrite32(val, ah->ah_sc->mem + reg_offset); | ||
715 | } | ||
716 | |||
717 | static inline unsigned int ath9k_ioread32(struct ath_hw *ah, u32 reg_offset) | ||
718 | { | ||
719 | u32 val; | ||
720 | if (ah->config.serialize_regmode == SER_REG_MODE_ON) { | ||
721 | unsigned long flags; | ||
722 | spin_lock_irqsave(&ah->ah_sc->sc_serial_rw, flags); | ||
723 | val = ioread32(ah->ah_sc->mem + reg_offset); | ||
724 | spin_unlock_irqrestore(&ah->ah_sc->sc_serial_rw, flags); | ||
725 | } else | ||
726 | val = ioread32(ah->ah_sc->mem + reg_offset); | ||
727 | return val; | ||
728 | } | ||
729 | 702 | ||
730 | #endif /* ATH9K_H */ | 703 | #endif /* ATH9K_H */ |
diff --git a/drivers/net/wireless/ath/ath9k/beacon.c b/drivers/net/wireless/ath/ath9k/beacon.c index eb4759fc6a0d..3a7154beeae1 100644 --- a/drivers/net/wireless/ath/ath9k/beacon.c +++ b/drivers/net/wireless/ath/ath9k/beacon.c | |||
@@ -63,7 +63,7 @@ static void ath_beacon_setup(struct ath_softc *sc, struct ath_vif *avp, | |||
63 | struct ath_hw *ah = sc->sc_ah; | 63 | struct ath_hw *ah = sc->sc_ah; |
64 | struct ath_desc *ds; | 64 | struct ath_desc *ds; |
65 | struct ath9k_11n_rate_series series[4]; | 65 | struct ath9k_11n_rate_series series[4]; |
66 | struct ath_rate_table *rt; | 66 | const struct ath_rate_table *rt; |
67 | int flags, antenna, ctsrate = 0, ctsduration = 0; | 67 | int flags, antenna, ctsrate = 0, ctsduration = 0; |
68 | u8 rate; | 68 | u8 rate; |
69 | 69 | ||
@@ -320,8 +320,7 @@ int ath_beacon_alloc(struct ath_wiphy *aphy, struct ieee80211_vif *vif) | |||
320 | u64 tsfadjust; | 320 | u64 tsfadjust; |
321 | int intval; | 321 | int intval; |
322 | 322 | ||
323 | intval = sc->hw->conf.beacon_int ? | 323 | intval = sc->beacon_interval ? : ATH_DEFAULT_BINTVAL; |
324 | sc->hw->conf.beacon_int : ATH_DEFAULT_BINTVAL; | ||
325 | 324 | ||
326 | /* | 325 | /* |
327 | * Calculate the TSF offset for this beacon slot, i.e., the | 326 | * Calculate the TSF offset for this beacon slot, i.e., the |
@@ -431,8 +430,7 @@ void ath_beacon_tasklet(unsigned long data) | |||
431 | * on the tsf to safeguard against missing an swba. | 430 | * on the tsf to safeguard against missing an swba. |
432 | */ | 431 | */ |
433 | 432 | ||
434 | intval = sc->hw->conf.beacon_int ? | 433 | intval = sc->beacon_interval ? : ATH_DEFAULT_BINTVAL; |
435 | sc->hw->conf.beacon_int : ATH_DEFAULT_BINTVAL; | ||
436 | 434 | ||
437 | tsf = ath9k_hw_gettsf64(ah); | 435 | tsf = ath9k_hw_gettsf64(ah); |
438 | tsftu = TSF_TO_TU(tsf>>32, tsf); | 436 | tsftu = TSF_TO_TU(tsf>>32, tsf); |
@@ -711,8 +709,7 @@ void ath_beacon_config(struct ath_softc *sc, struct ieee80211_vif *vif) | |||
711 | /* Setup the beacon configuration parameters */ | 709 | /* Setup the beacon configuration parameters */ |
712 | 710 | ||
713 | memset(&conf, 0, sizeof(struct ath_beacon_config)); | 711 | memset(&conf, 0, sizeof(struct ath_beacon_config)); |
714 | conf.beacon_interval = sc->hw->conf.beacon_int ? | 712 | conf.beacon_interval = sc->beacon_interval ? : ATH_DEFAULT_BINTVAL; |
715 | sc->hw->conf.beacon_int : ATH_DEFAULT_BINTVAL; | ||
716 | conf.listen_interval = 1; | 713 | conf.listen_interval = 1; |
717 | conf.dtim_period = conf.beacon_interval; | 714 | conf.dtim_period = conf.beacon_interval; |
718 | conf.dtim_count = 1; | 715 | conf.dtim_count = 1; |
diff --git a/drivers/net/wireless/ath/ath9k/calib.c b/drivers/net/wireless/ath/ath9k/calib.c index a197041d76b5..a32d7e7fecbe 100644 --- a/drivers/net/wireless/ath/ath9k/calib.c +++ b/drivers/net/wireless/ath/ath9k/calib.c | |||
@@ -863,7 +863,7 @@ bool ath9k_hw_calibrate(struct ath_hw *ah, struct ath9k_channel *chan, | |||
863 | } | 863 | } |
864 | 864 | ||
865 | if (longcal) { | 865 | if (longcal) { |
866 | if (AR_SREV_9285(ah) && AR_SREV_9285_11_OR_LATER(ah)) | 866 | if (AR_SREV_9285_11_OR_LATER(ah)) |
867 | ath9k_hw_9285_pa_cal(ah); | 867 | ath9k_hw_9285_pa_cal(ah); |
868 | 868 | ||
869 | if (OLC_FOR_AR9280_20_LATER) | 869 | if (OLC_FOR_AR9280_20_LATER) |
@@ -917,7 +917,7 @@ static bool ar9285_clc(struct ath_hw *ah, struct ath9k_channel *chan) | |||
917 | 917 | ||
918 | bool ath9k_hw_init_cal(struct ath_hw *ah, struct ath9k_channel *chan) | 918 | bool ath9k_hw_init_cal(struct ath_hw *ah, struct ath9k_channel *chan) |
919 | { | 919 | { |
920 | if (AR_SREV_9285(ah) && AR_SREV_9285_12_OR_LATER(ah)) { | 920 | if (AR_SREV_9285_12_OR_LATER(ah)) { |
921 | if (!ar9285_clc(ah, chan)) | 921 | if (!ar9285_clc(ah, chan)) |
922 | return false; | 922 | return false; |
923 | } else { | 923 | } else { |
@@ -947,7 +947,7 @@ bool ath9k_hw_init_cal(struct ath_hw *ah, struct ath9k_channel *chan) | |||
947 | } | 947 | } |
948 | 948 | ||
949 | /* Do PA Calibration */ | 949 | /* Do PA Calibration */ |
950 | if (AR_SREV_9285(ah) && AR_SREV_9285_11_OR_LATER(ah)) | 950 | if (AR_SREV_9285_11_OR_LATER(ah)) |
951 | ath9k_hw_9285_pa_cal(ah); | 951 | ath9k_hw_9285_pa_cal(ah); |
952 | 952 | ||
953 | /* Do NF Calibration after DC offset and other calibrations */ | 953 | /* Do NF Calibration after DC offset and other calibrations */ |
diff --git a/drivers/net/wireless/ath/ath9k/hw.c b/drivers/net/wireless/ath/ath9k/hw.c index ec2a7a40b00d..5879c731e9e7 100644 --- a/drivers/net/wireless/ath/ath9k/hw.c +++ b/drivers/net/wireless/ath/ath9k/hw.c | |||
@@ -84,6 +84,38 @@ static u32 ath9k_hw_mac_to_clks(struct ath_hw *ah, u32 usecs) | |||
84 | return ath9k_hw_mac_clks(ah, usecs); | 84 | return ath9k_hw_mac_clks(ah, usecs); |
85 | } | 85 | } |
86 | 86 | ||
87 | /* | ||
88 | * Read and write, they both share the same lock. We do this to serialize | ||
89 | * reads and writes on Atheros 802.11n PCI devices only. This is required | ||
90 | * as the FIFO on these devices can only accept sanely 2 requests. After | ||
91 | * that the device goes bananas. Serializing the reads/writes prevents this | ||
92 | * from happening. | ||
93 | */ | ||
94 | |||
95 | void ath9k_iowrite32(struct ath_hw *ah, u32 reg_offset, u32 val) | ||
96 | { | ||
97 | if (ah->config.serialize_regmode == SER_REG_MODE_ON) { | ||
98 | unsigned long flags; | ||
99 | spin_lock_irqsave(&ah->ah_sc->sc_serial_rw, flags); | ||
100 | iowrite32(val, ah->ah_sc->mem + reg_offset); | ||
101 | spin_unlock_irqrestore(&ah->ah_sc->sc_serial_rw, flags); | ||
102 | } else | ||
103 | iowrite32(val, ah->ah_sc->mem + reg_offset); | ||
104 | } | ||
105 | |||
106 | unsigned int ath9k_ioread32(struct ath_hw *ah, u32 reg_offset) | ||
107 | { | ||
108 | u32 val; | ||
109 | if (ah->config.serialize_regmode == SER_REG_MODE_ON) { | ||
110 | unsigned long flags; | ||
111 | spin_lock_irqsave(&ah->ah_sc->sc_serial_rw, flags); | ||
112 | val = ioread32(ah->ah_sc->mem + reg_offset); | ||
113 | spin_unlock_irqrestore(&ah->ah_sc->sc_serial_rw, flags); | ||
114 | } else | ||
115 | val = ioread32(ah->ah_sc->mem + reg_offset); | ||
116 | return val; | ||
117 | } | ||
118 | |||
87 | bool ath9k_hw_wait(struct ath_hw *ah, u32 reg, u32 mask, u32 val, u32 timeout) | 119 | bool ath9k_hw_wait(struct ath_hw *ah, u32 reg, u32 mask, u32 val, u32 timeout) |
88 | { | 120 | { |
89 | int i; | 121 | int i; |
@@ -136,7 +168,7 @@ bool ath9k_get_channel_edges(struct ath_hw *ah, | |||
136 | } | 168 | } |
137 | 169 | ||
138 | u16 ath9k_hw_computetxtime(struct ath_hw *ah, | 170 | u16 ath9k_hw_computetxtime(struct ath_hw *ah, |
139 | struct ath_rate_table *rates, | 171 | const struct ath_rate_table *rates, |
140 | u32 frameLen, u16 rateix, | 172 | u32 frameLen, u16 rateix, |
141 | bool shortPreamble) | 173 | bool shortPreamble) |
142 | { | 174 | { |
@@ -1313,8 +1345,7 @@ static int ath9k_hw_process_ini(struct ath_hw *ah, | |||
1313 | if (AR_SREV_9280(ah)) | 1345 | if (AR_SREV_9280(ah)) |
1314 | REG_WRITE_ARRAY(&ah->iniModesRxGain, modesIndex, regWrites); | 1346 | REG_WRITE_ARRAY(&ah->iniModesRxGain, modesIndex, regWrites); |
1315 | 1347 | ||
1316 | if (AR_SREV_9280(ah) || (AR_SREV_9285(ah) && | 1348 | if (AR_SREV_9280(ah) || AR_SREV_9285_12_OR_LATER(ah)) |
1317 | AR_SREV_9285_12_OR_LATER(ah))) | ||
1318 | REG_WRITE_ARRAY(&ah->iniModesTxGain, modesIndex, regWrites); | 1349 | REG_WRITE_ARRAY(&ah->iniModesTxGain, modesIndex, regWrites); |
1319 | 1350 | ||
1320 | for (i = 0; i < ah->iniCommon.ia_rows; i++) { | 1351 | for (i = 0; i < ah->iniCommon.ia_rows; i++) { |
diff --git a/drivers/net/wireless/ath/ath9k/hw.h b/drivers/net/wireless/ath/ath9k/hw.h index ab3412672e36..ddb24c47ebcf 100644 --- a/drivers/net/wireless/ath/ath9k/hw.h +++ b/drivers/net/wireless/ath/ath9k/hw.h | |||
@@ -580,7 +580,8 @@ bool ath9k_hw_setantennaswitch(struct ath_hw *ah, | |||
580 | bool ath9k_hw_wait(struct ath_hw *ah, u32 reg, u32 mask, u32 val, u32 timeout); | 580 | bool ath9k_hw_wait(struct ath_hw *ah, u32 reg, u32 mask, u32 val, u32 timeout); |
581 | u32 ath9k_hw_reverse_bits(u32 val, u32 n); | 581 | u32 ath9k_hw_reverse_bits(u32 val, u32 n); |
582 | bool ath9k_get_channel_edges(struct ath_hw *ah, u16 flags, u16 *low, u16 *high); | 582 | bool ath9k_get_channel_edges(struct ath_hw *ah, u16 flags, u16 *low, u16 *high); |
583 | u16 ath9k_hw_computetxtime(struct ath_hw *ah, struct ath_rate_table *rates, | 583 | u16 ath9k_hw_computetxtime(struct ath_hw *ah, |
584 | const struct ath_rate_table *rates, | ||
584 | u32 frameLen, u16 rateix, bool shortPreamble); | 585 | u32 frameLen, u16 rateix, bool shortPreamble); |
585 | void ath9k_hw_get_channel_centers(struct ath_hw *ah, | 586 | void ath9k_hw_get_channel_centers(struct ath_hw *ah, |
586 | struct ath9k_channel *chan, | 587 | struct ath9k_channel *chan, |
diff --git a/drivers/net/wireless/ath/ath9k/main.c b/drivers/net/wireless/ath/ath9k/main.c index 2398d4f45f28..bbbfdcde2727 100644 --- a/drivers/net/wireless/ath/ath9k/main.c +++ b/drivers/net/wireless/ath/ath9k/main.c | |||
@@ -189,7 +189,7 @@ static u8 parse_mpdudensity(u8 mpdudensity) | |||
189 | 189 | ||
190 | static void ath_setup_rates(struct ath_softc *sc, enum ieee80211_band band) | 190 | static void ath_setup_rates(struct ath_softc *sc, enum ieee80211_band band) |
191 | { | 191 | { |
192 | struct ath_rate_table *rate_table = NULL; | 192 | const struct ath_rate_table *rate_table = NULL; |
193 | struct ieee80211_supported_band *sband; | 193 | struct ieee80211_supported_band *sband; |
194 | struct ieee80211_rate *rate; | 194 | struct ieee80211_rate *rate; |
195 | int i, maxrates; | 195 | int i, maxrates; |
@@ -2358,114 +2358,6 @@ skip_chan_change: | |||
2358 | if (changed & IEEE80211_CONF_CHANGE_POWER) | 2358 | if (changed & IEEE80211_CONF_CHANGE_POWER) |
2359 | sc->config.txpowlimit = 2 * conf->power_level; | 2359 | sc->config.txpowlimit = 2 * conf->power_level; |
2360 | 2360 | ||
2361 | /* | ||
2362 | * The HW TSF has to be reset when the beacon interval changes. | ||
2363 | * We set the flag here, and ath_beacon_config_ap() would take this | ||
2364 | * into account when it gets called through the subsequent | ||
2365 | * config_interface() call - with IFCC_BEACON in the changed field. | ||
2366 | */ | ||
2367 | |||
2368 | if (changed & IEEE80211_CONF_CHANGE_BEACON_INTERVAL) | ||
2369 | sc->sc_flags |= SC_OP_TSF_RESET; | ||
2370 | |||
2371 | mutex_unlock(&sc->mutex); | ||
2372 | |||
2373 | return 0; | ||
2374 | } | ||
2375 | |||
2376 | static int ath9k_config_interface(struct ieee80211_hw *hw, | ||
2377 | struct ieee80211_vif *vif, | ||
2378 | struct ieee80211_if_conf *conf) | ||
2379 | { | ||
2380 | struct ath_wiphy *aphy = hw->priv; | ||
2381 | struct ath_softc *sc = aphy->sc; | ||
2382 | struct ath_hw *ah = sc->sc_ah; | ||
2383 | struct ath_vif *avp = (void *)vif->drv_priv; | ||
2384 | u32 rfilt = 0; | ||
2385 | int error, i; | ||
2386 | |||
2387 | mutex_lock(&sc->mutex); | ||
2388 | |||
2389 | /* TODO: Need to decide which hw opmode to use for multi-interface | ||
2390 | * cases */ | ||
2391 | if (vif->type == NL80211_IFTYPE_AP && | ||
2392 | ah->opmode != NL80211_IFTYPE_AP) { | ||
2393 | ah->opmode = NL80211_IFTYPE_STATION; | ||
2394 | ath9k_hw_setopmode(ah); | ||
2395 | memcpy(sc->curbssid, sc->sc_ah->macaddr, ETH_ALEN); | ||
2396 | sc->curaid = 0; | ||
2397 | ath9k_hw_write_associd(sc); | ||
2398 | /* Request full reset to get hw opmode changed properly */ | ||
2399 | sc->sc_flags |= SC_OP_FULL_RESET; | ||
2400 | } | ||
2401 | |||
2402 | if ((conf->changed & IEEE80211_IFCC_BSSID) && | ||
2403 | !is_zero_ether_addr(conf->bssid)) { | ||
2404 | switch (vif->type) { | ||
2405 | case NL80211_IFTYPE_STATION: | ||
2406 | case NL80211_IFTYPE_ADHOC: | ||
2407 | case NL80211_IFTYPE_MESH_POINT: | ||
2408 | /* Set BSSID */ | ||
2409 | memcpy(sc->curbssid, conf->bssid, ETH_ALEN); | ||
2410 | memcpy(avp->bssid, conf->bssid, ETH_ALEN); | ||
2411 | sc->curaid = 0; | ||
2412 | ath9k_hw_write_associd(sc); | ||
2413 | |||
2414 | /* Set aggregation protection mode parameters */ | ||
2415 | sc->config.ath_aggr_prot = 0; | ||
2416 | |||
2417 | DPRINTF(sc, ATH_DBG_CONFIG, | ||
2418 | "RX filter 0x%x bssid %pM aid 0x%x\n", | ||
2419 | rfilt, sc->curbssid, sc->curaid); | ||
2420 | |||
2421 | /* need to reconfigure the beacon */ | ||
2422 | sc->sc_flags &= ~SC_OP_BEACONS ; | ||
2423 | |||
2424 | break; | ||
2425 | default: | ||
2426 | break; | ||
2427 | } | ||
2428 | } | ||
2429 | |||
2430 | if ((vif->type == NL80211_IFTYPE_ADHOC) || | ||
2431 | (vif->type == NL80211_IFTYPE_AP) || | ||
2432 | (vif->type == NL80211_IFTYPE_MESH_POINT)) { | ||
2433 | if ((conf->changed & IEEE80211_IFCC_BEACON) || | ||
2434 | (conf->changed & IEEE80211_IFCC_BEACON_ENABLED && | ||
2435 | conf->enable_beacon)) { | ||
2436 | /* | ||
2437 | * Allocate and setup the beacon frame. | ||
2438 | * | ||
2439 | * Stop any previous beacon DMA. This may be | ||
2440 | * necessary, for example, when an ibss merge | ||
2441 | * causes reconfiguration; we may be called | ||
2442 | * with beacon transmission active. | ||
2443 | */ | ||
2444 | ath9k_hw_stoptxdma(sc->sc_ah, sc->beacon.beaconq); | ||
2445 | |||
2446 | error = ath_beacon_alloc(aphy, vif); | ||
2447 | if (error != 0) { | ||
2448 | mutex_unlock(&sc->mutex); | ||
2449 | return error; | ||
2450 | } | ||
2451 | |||
2452 | ath_beacon_config(sc, vif); | ||
2453 | } | ||
2454 | } | ||
2455 | |||
2456 | /* Check for WLAN_CAPABILITY_PRIVACY ? */ | ||
2457 | if ((avp->av_opmode != NL80211_IFTYPE_STATION)) { | ||
2458 | for (i = 0; i < IEEE80211_WEP_NKID; i++) | ||
2459 | if (ath9k_hw_keyisvalid(sc->sc_ah, (u16)i)) | ||
2460 | ath9k_hw_keysetmac(sc->sc_ah, | ||
2461 | (u16)i, | ||
2462 | sc->curbssid); | ||
2463 | } | ||
2464 | |||
2465 | /* Only legacy IBSS for now */ | ||
2466 | if (vif->type == NL80211_IFTYPE_ADHOC) | ||
2467 | ath_update_chainmask(sc, 0); | ||
2468 | |||
2469 | mutex_unlock(&sc->mutex); | 2361 | mutex_unlock(&sc->mutex); |
2470 | 2362 | ||
2471 | return 0; | 2363 | return 0; |
@@ -2607,9 +2499,92 @@ static void ath9k_bss_info_changed(struct ieee80211_hw *hw, | |||
2607 | { | 2499 | { |
2608 | struct ath_wiphy *aphy = hw->priv; | 2500 | struct ath_wiphy *aphy = hw->priv; |
2609 | struct ath_softc *sc = aphy->sc; | 2501 | struct ath_softc *sc = aphy->sc; |
2502 | struct ath_hw *ah = sc->sc_ah; | ||
2503 | struct ath_vif *avp = (void *)vif->drv_priv; | ||
2504 | u32 rfilt = 0; | ||
2505 | int error, i; | ||
2610 | 2506 | ||
2611 | mutex_lock(&sc->mutex); | 2507 | mutex_lock(&sc->mutex); |
2612 | 2508 | ||
2509 | /* | ||
2510 | * TODO: Need to decide which hw opmode to use for | ||
2511 | * multi-interface cases | ||
2512 | * XXX: This belongs into add_interface! | ||
2513 | */ | ||
2514 | if (vif->type == NL80211_IFTYPE_AP && | ||
2515 | ah->opmode != NL80211_IFTYPE_AP) { | ||
2516 | ah->opmode = NL80211_IFTYPE_STATION; | ||
2517 | ath9k_hw_setopmode(ah); | ||
2518 | memcpy(sc->curbssid, sc->sc_ah->macaddr, ETH_ALEN); | ||
2519 | sc->curaid = 0; | ||
2520 | ath9k_hw_write_associd(sc); | ||
2521 | /* Request full reset to get hw opmode changed properly */ | ||
2522 | sc->sc_flags |= SC_OP_FULL_RESET; | ||
2523 | } | ||
2524 | |||
2525 | if ((changed & BSS_CHANGED_BSSID) && | ||
2526 | !is_zero_ether_addr(bss_conf->bssid)) { | ||
2527 | switch (vif->type) { | ||
2528 | case NL80211_IFTYPE_STATION: | ||
2529 | case NL80211_IFTYPE_ADHOC: | ||
2530 | case NL80211_IFTYPE_MESH_POINT: | ||
2531 | /* Set BSSID */ | ||
2532 | memcpy(sc->curbssid, bss_conf->bssid, ETH_ALEN); | ||
2533 | memcpy(avp->bssid, bss_conf->bssid, ETH_ALEN); | ||
2534 | sc->curaid = 0; | ||
2535 | ath9k_hw_write_associd(sc); | ||
2536 | |||
2537 | /* Set aggregation protection mode parameters */ | ||
2538 | sc->config.ath_aggr_prot = 0; | ||
2539 | |||
2540 | DPRINTF(sc, ATH_DBG_CONFIG, | ||
2541 | "RX filter 0x%x bssid %pM aid 0x%x\n", | ||
2542 | rfilt, sc->curbssid, sc->curaid); | ||
2543 | |||
2544 | /* need to reconfigure the beacon */ | ||
2545 | sc->sc_flags &= ~SC_OP_BEACONS ; | ||
2546 | |||
2547 | break; | ||
2548 | default: | ||
2549 | break; | ||
2550 | } | ||
2551 | } | ||
2552 | |||
2553 | if ((vif->type == NL80211_IFTYPE_ADHOC) || | ||
2554 | (vif->type == NL80211_IFTYPE_AP) || | ||
2555 | (vif->type == NL80211_IFTYPE_MESH_POINT)) { | ||
2556 | if ((changed & BSS_CHANGED_BEACON) || | ||
2557 | (changed & BSS_CHANGED_BEACON_ENABLED && | ||
2558 | bss_conf->enable_beacon)) { | ||
2559 | /* | ||
2560 | * Allocate and setup the beacon frame. | ||
2561 | * | ||
2562 | * Stop any previous beacon DMA. This may be | ||
2563 | * necessary, for example, when an ibss merge | ||
2564 | * causes reconfiguration; we may be called | ||
2565 | * with beacon transmission active. | ||
2566 | */ | ||
2567 | ath9k_hw_stoptxdma(sc->sc_ah, sc->beacon.beaconq); | ||
2568 | |||
2569 | error = ath_beacon_alloc(aphy, vif); | ||
2570 | if (!error) | ||
2571 | ath_beacon_config(sc, vif); | ||
2572 | } | ||
2573 | } | ||
2574 | |||
2575 | /* Check for WLAN_CAPABILITY_PRIVACY ? */ | ||
2576 | if ((avp->av_opmode != NL80211_IFTYPE_STATION)) { | ||
2577 | for (i = 0; i < IEEE80211_WEP_NKID; i++) | ||
2578 | if (ath9k_hw_keyisvalid(sc->sc_ah, (u16)i)) | ||
2579 | ath9k_hw_keysetmac(sc->sc_ah, | ||
2580 | (u16)i, | ||
2581 | sc->curbssid); | ||
2582 | } | ||
2583 | |||
2584 | /* Only legacy IBSS for now */ | ||
2585 | if (vif->type == NL80211_IFTYPE_ADHOC) | ||
2586 | ath_update_chainmask(sc, 0); | ||
2587 | |||
2613 | if (changed & BSS_CHANGED_ERP_PREAMBLE) { | 2588 | if (changed & BSS_CHANGED_ERP_PREAMBLE) { |
2614 | DPRINTF(sc, ATH_DBG_CONFIG, "BSS Changed PREAMBLE %d\n", | 2589 | DPRINTF(sc, ATH_DBG_CONFIG, "BSS Changed PREAMBLE %d\n", |
2615 | bss_conf->use_short_preamble); | 2590 | bss_conf->use_short_preamble); |
@@ -2635,6 +2610,18 @@ static void ath9k_bss_info_changed(struct ieee80211_hw *hw, | |||
2635 | ath9k_bss_assoc_info(sc, vif, bss_conf); | 2610 | ath9k_bss_assoc_info(sc, vif, bss_conf); |
2636 | } | 2611 | } |
2637 | 2612 | ||
2613 | /* | ||
2614 | * The HW TSF has to be reset when the beacon interval changes. | ||
2615 | * We set the flag here, and ath_beacon_config_ap() would take this | ||
2616 | * into account when it gets called through the subsequent | ||
2617 | * config_interface() call - with IFCC_BEACON in the changed field. | ||
2618 | */ | ||
2619 | |||
2620 | if (changed & BSS_CHANGED_BEACON_INT) { | ||
2621 | sc->sc_flags |= SC_OP_TSF_RESET; | ||
2622 | sc->beacon_interval = bss_conf->beacon_int; | ||
2623 | } | ||
2624 | |||
2638 | mutex_unlock(&sc->mutex); | 2625 | mutex_unlock(&sc->mutex); |
2639 | } | 2626 | } |
2640 | 2627 | ||
@@ -2755,7 +2742,6 @@ struct ieee80211_ops ath9k_ops = { | |||
2755 | .add_interface = ath9k_add_interface, | 2742 | .add_interface = ath9k_add_interface, |
2756 | .remove_interface = ath9k_remove_interface, | 2743 | .remove_interface = ath9k_remove_interface, |
2757 | .config = ath9k_config, | 2744 | .config = ath9k_config, |
2758 | .config_interface = ath9k_config_interface, | ||
2759 | .configure_filter = ath9k_configure_filter, | 2745 | .configure_filter = ath9k_configure_filter, |
2760 | .sta_notify = ath9k_sta_notify, | 2746 | .sta_notify = ath9k_sta_notify, |
2761 | .conf_tx = ath9k_conf_tx, | 2747 | .conf_tx = ath9k_conf_tx, |
diff --git a/drivers/net/wireless/ath/ath9k/rc.c b/drivers/net/wireless/ath/ath9k/rc.c index 8f3cf10f65c4..ba06e78b2f50 100644 --- a/drivers/net/wireless/ath/ath9k/rc.c +++ b/drivers/net/wireless/ath/ath9k/rc.c | |||
@@ -17,7 +17,7 @@ | |||
17 | 17 | ||
18 | #include "ath9k.h" | 18 | #include "ath9k.h" |
19 | 19 | ||
20 | static struct ath_rate_table ar5416_11na_ratetable = { | 20 | static const struct ath_rate_table ar5416_11na_ratetable = { |
21 | 42, | 21 | 42, |
22 | { | 22 | { |
23 | { VALID, VALID, WLAN_RC_PHY_OFDM, 6000, /* 6 Mb */ | 23 | { VALID, VALID, WLAN_RC_PHY_OFDM, 6000, /* 6 Mb */ |
@@ -155,7 +155,7 @@ static struct ath_rate_table ar5416_11na_ratetable = { | |||
155 | /* 4ms frame limit not used for NG mode. The values filled | 155 | /* 4ms frame limit not used for NG mode. The values filled |
156 | * for HT are the 64K max aggregate limit */ | 156 | * for HT are the 64K max aggregate limit */ |
157 | 157 | ||
158 | static struct ath_rate_table ar5416_11ng_ratetable = { | 158 | static const struct ath_rate_table ar5416_11ng_ratetable = { |
159 | 46, | 159 | 46, |
160 | { | 160 | { |
161 | { VALID_ALL, VALID_ALL, WLAN_RC_PHY_CCK, 1000, /* 1 Mb */ | 161 | { VALID_ALL, VALID_ALL, WLAN_RC_PHY_CCK, 1000, /* 1 Mb */ |
@@ -302,7 +302,7 @@ static struct ath_rate_table ar5416_11ng_ratetable = { | |||
302 | WLAN_RC_HT_FLAG, /* Phy rates allowed initially */ | 302 | WLAN_RC_HT_FLAG, /* Phy rates allowed initially */ |
303 | }; | 303 | }; |
304 | 304 | ||
305 | static struct ath_rate_table ar5416_11a_ratetable = { | 305 | static const struct ath_rate_table ar5416_11a_ratetable = { |
306 | 8, | 306 | 8, |
307 | { | 307 | { |
308 | { VALID, VALID, WLAN_RC_PHY_OFDM, 6000, /* 6 Mb */ | 308 | { VALID, VALID, WLAN_RC_PHY_OFDM, 6000, /* 6 Mb */ |
@@ -335,7 +335,7 @@ static struct ath_rate_table ar5416_11a_ratetable = { | |||
335 | 0, /* Phy rates allowed initially */ | 335 | 0, /* Phy rates allowed initially */ |
336 | }; | 336 | }; |
337 | 337 | ||
338 | static struct ath_rate_table ar5416_11g_ratetable = { | 338 | static const struct ath_rate_table ar5416_11g_ratetable = { |
339 | 12, | 339 | 12, |
340 | { | 340 | { |
341 | { VALID, VALID, WLAN_RC_PHY_CCK, 1000, /* 1 Mb */ | 341 | { VALID, VALID, WLAN_RC_PHY_CCK, 1000, /* 1 Mb */ |
@@ -380,7 +380,7 @@ static struct ath_rate_table ar5416_11g_ratetable = { | |||
380 | 0, /* Phy rates allowed initially */ | 380 | 0, /* Phy rates allowed initially */ |
381 | }; | 381 | }; |
382 | 382 | ||
383 | static struct ath_rate_table ar5416_11b_ratetable = { | 383 | static const struct ath_rate_table ar5416_11b_ratetable = { |
384 | 4, | 384 | 4, |
385 | { | 385 | { |
386 | { VALID, VALID, WLAN_RC_PHY_CCK, 1000, /* 1 Mb */ | 386 | { VALID, VALID, WLAN_RC_PHY_CCK, 1000, /* 1 Mb */ |
@@ -420,7 +420,7 @@ static inline int8_t median(int8_t a, int8_t b, int8_t c) | |||
420 | } | 420 | } |
421 | } | 421 | } |
422 | 422 | ||
423 | static void ath_rc_sort_validrates(struct ath_rate_table *rate_table, | 423 | static void ath_rc_sort_validrates(const struct ath_rate_table *rate_table, |
424 | struct ath_rate_priv *ath_rc_priv) | 424 | struct ath_rate_priv *ath_rc_priv) |
425 | { | 425 | { |
426 | u8 i, j, idx, idx_next; | 426 | u8 i, j, idx, idx_next; |
@@ -461,10 +461,11 @@ static inline int ath_rc_isvalid_txmask(struct ath_rate_priv *ath_rc_priv, | |||
461 | return ath_rc_priv->valid_rate_index[index]; | 461 | return ath_rc_priv->valid_rate_index[index]; |
462 | } | 462 | } |
463 | 463 | ||
464 | static inline int ath_rc_get_nextvalid_txrate(struct ath_rate_table *rate_table, | 464 | static inline |
465 | struct ath_rate_priv *ath_rc_priv, | 465 | int ath_rc_get_nextvalid_txrate(const struct ath_rate_table *rate_table, |
466 | u8 cur_valid_txrate, | 466 | struct ath_rate_priv *ath_rc_priv, |
467 | u8 *next_idx) | 467 | u8 cur_valid_txrate, |
468 | u8 *next_idx) | ||
468 | { | 469 | { |
469 | u8 i; | 470 | u8 i; |
470 | 471 | ||
@@ -500,7 +501,7 @@ static int ath_rc_valid_phyrate(u32 phy, u32 capflag, int ignore_cw) | |||
500 | } | 501 | } |
501 | 502 | ||
502 | static inline int | 503 | static inline int |
503 | ath_rc_get_nextlowervalid_txrate(struct ath_rate_table *rate_table, | 504 | ath_rc_get_nextlowervalid_txrate(const struct ath_rate_table *rate_table, |
504 | struct ath_rate_priv *ath_rc_priv, | 505 | struct ath_rate_priv *ath_rc_priv, |
505 | u8 cur_valid_txrate, u8 *next_idx) | 506 | u8 cur_valid_txrate, u8 *next_idx) |
506 | { | 507 | { |
@@ -517,7 +518,7 @@ ath_rc_get_nextlowervalid_txrate(struct ath_rate_table *rate_table, | |||
517 | } | 518 | } |
518 | 519 | ||
519 | static u8 ath_rc_init_validrates(struct ath_rate_priv *ath_rc_priv, | 520 | static u8 ath_rc_init_validrates(struct ath_rate_priv *ath_rc_priv, |
520 | struct ath_rate_table *rate_table, | 521 | const struct ath_rate_table *rate_table, |
521 | u32 capflag) | 522 | u32 capflag) |
522 | { | 523 | { |
523 | u8 i, hi = 0; | 524 | u8 i, hi = 0; |
@@ -547,7 +548,7 @@ static u8 ath_rc_init_validrates(struct ath_rate_priv *ath_rc_priv, | |||
547 | } | 548 | } |
548 | 549 | ||
549 | static u8 ath_rc_setvalid_rates(struct ath_rate_priv *ath_rc_priv, | 550 | static u8 ath_rc_setvalid_rates(struct ath_rate_priv *ath_rc_priv, |
550 | struct ath_rate_table *rate_table, | 551 | const struct ath_rate_table *rate_table, |
551 | struct ath_rateset *rateset, | 552 | struct ath_rateset *rateset, |
552 | u32 capflag) | 553 | u32 capflag) |
553 | { | 554 | { |
@@ -592,7 +593,7 @@ static u8 ath_rc_setvalid_rates(struct ath_rate_priv *ath_rc_priv, | |||
592 | } | 593 | } |
593 | 594 | ||
594 | static u8 ath_rc_setvalid_htrates(struct ath_rate_priv *ath_rc_priv, | 595 | static u8 ath_rc_setvalid_htrates(struct ath_rate_priv *ath_rc_priv, |
595 | struct ath_rate_table *rate_table, | 596 | const struct ath_rate_table *rate_table, |
596 | u8 *mcs_set, u32 capflag) | 597 | u8 *mcs_set, u32 capflag) |
597 | { | 598 | { |
598 | struct ath_rateset *rateset = (struct ath_rateset *)mcs_set; | 599 | struct ath_rateset *rateset = (struct ath_rateset *)mcs_set; |
@@ -630,7 +631,7 @@ static u8 ath_rc_setvalid_htrates(struct ath_rate_priv *ath_rc_priv, | |||
630 | 631 | ||
631 | static u8 ath_rc_ratefind_ht(struct ath_softc *sc, | 632 | static u8 ath_rc_ratefind_ht(struct ath_softc *sc, |
632 | struct ath_rate_priv *ath_rc_priv, | 633 | struct ath_rate_priv *ath_rc_priv, |
633 | struct ath_rate_table *rate_table, | 634 | const struct ath_rate_table *rate_table, |
634 | int *is_probing) | 635 | int *is_probing) |
635 | { | 636 | { |
636 | u32 dt, best_thruput, this_thruput, now_msec; | 637 | u32 dt, best_thruput, this_thruput, now_msec; |
@@ -748,7 +749,7 @@ static u8 ath_rc_ratefind_ht(struct ath_softc *sc, | |||
748 | return rate; | 749 | return rate; |
749 | } | 750 | } |
750 | 751 | ||
751 | static void ath_rc_rate_set_series(struct ath_rate_table *rate_table, | 752 | static void ath_rc_rate_set_series(const struct ath_rate_table *rate_table, |
752 | struct ieee80211_tx_rate *rate, | 753 | struct ieee80211_tx_rate *rate, |
753 | struct ieee80211_tx_rate_control *txrc, | 754 | struct ieee80211_tx_rate_control *txrc, |
754 | u8 tries, u8 rix, int rtsctsenable) | 755 | u8 tries, u8 rix, int rtsctsenable) |
@@ -769,7 +770,7 @@ static void ath_rc_rate_set_series(struct ath_rate_table *rate_table, | |||
769 | } | 770 | } |
770 | 771 | ||
771 | static void ath_rc_rate_set_rtscts(struct ath_softc *sc, | 772 | static void ath_rc_rate_set_rtscts(struct ath_softc *sc, |
772 | struct ath_rate_table *rate_table, | 773 | const struct ath_rate_table *rate_table, |
773 | struct ieee80211_tx_info *tx_info) | 774 | struct ieee80211_tx_info *tx_info) |
774 | { | 775 | { |
775 | struct ieee80211_tx_rate *rates = tx_info->control.rates; | 776 | struct ieee80211_tx_rate *rates = tx_info->control.rates; |
@@ -807,7 +808,7 @@ static void ath_rc_rate_set_rtscts(struct ath_softc *sc, | |||
807 | 808 | ||
808 | static u8 ath_rc_rate_getidx(struct ath_softc *sc, | 809 | static u8 ath_rc_rate_getidx(struct ath_softc *sc, |
809 | struct ath_rate_priv *ath_rc_priv, | 810 | struct ath_rate_priv *ath_rc_priv, |
810 | struct ath_rate_table *rate_table, | 811 | const struct ath_rate_table *rate_table, |
811 | u8 rix, u16 stepdown, | 812 | u8 rix, u16 stepdown, |
812 | u16 min_rate) | 813 | u16 min_rate) |
813 | { | 814 | { |
@@ -838,7 +839,7 @@ static void ath_rc_ratefind(struct ath_softc *sc, | |||
838 | struct ath_rate_priv *ath_rc_priv, | 839 | struct ath_rate_priv *ath_rc_priv, |
839 | struct ieee80211_tx_rate_control *txrc) | 840 | struct ieee80211_tx_rate_control *txrc) |
840 | { | 841 | { |
841 | struct ath_rate_table *rate_table; | 842 | const struct ath_rate_table *rate_table; |
842 | struct sk_buff *skb = txrc->skb; | 843 | struct sk_buff *skb = txrc->skb; |
843 | struct ieee80211_tx_info *tx_info = IEEE80211_SKB_CB(skb); | 844 | struct ieee80211_tx_info *tx_info = IEEE80211_SKB_CB(skb); |
844 | struct ieee80211_tx_rate *rates = tx_info->control.rates; | 845 | struct ieee80211_tx_rate *rates = tx_info->control.rates; |
@@ -937,7 +938,7 @@ static void ath_rc_ratefind(struct ath_softc *sc, | |||
937 | } | 938 | } |
938 | 939 | ||
939 | static bool ath_rc_update_per(struct ath_softc *sc, | 940 | static bool ath_rc_update_per(struct ath_softc *sc, |
940 | struct ath_rate_table *rate_table, | 941 | const struct ath_rate_table *rate_table, |
941 | struct ath_rate_priv *ath_rc_priv, | 942 | struct ath_rate_priv *ath_rc_priv, |
942 | struct ath_tx_info_priv *tx_info_priv, | 943 | struct ath_tx_info_priv *tx_info_priv, |
943 | int tx_rate, int xretries, int retries, | 944 | int tx_rate, int xretries, int retries, |
@@ -1142,7 +1143,7 @@ static void ath_rc_update_ht(struct ath_softc *sc, | |||
1142 | int rate; | 1143 | int rate; |
1143 | u8 last_per; | 1144 | u8 last_per; |
1144 | bool state_change = false; | 1145 | bool state_change = false; |
1145 | struct ath_rate_table *rate_table = sc->cur_rate_table; | 1146 | const struct ath_rate_table *rate_table = sc->cur_rate_table; |
1146 | int size = ath_rc_priv->rate_table_size; | 1147 | int size = ath_rc_priv->rate_table_size; |
1147 | 1148 | ||
1148 | if ((tx_rate < 0) || (tx_rate > rate_table->rate_cnt)) | 1149 | if ((tx_rate < 0) || (tx_rate > rate_table->rate_cnt)) |
@@ -1276,7 +1277,7 @@ static void ath_rc_update_ht(struct ath_softc *sc, | |||
1276 | #undef CHK_RSSI | 1277 | #undef CHK_RSSI |
1277 | } | 1278 | } |
1278 | 1279 | ||
1279 | static int ath_rc_get_rateindex(struct ath_rate_table *rate_table, | 1280 | static int ath_rc_get_rateindex(const struct ath_rate_table *rate_table, |
1280 | struct ieee80211_tx_rate *rate) | 1281 | struct ieee80211_tx_rate *rate) |
1281 | { | 1282 | { |
1282 | int rix; | 1283 | int rix; |
@@ -1300,7 +1301,7 @@ static void ath_rc_tx_status(struct ath_softc *sc, | |||
1300 | int final_ts_idx, int xretries, int long_retry) | 1301 | int final_ts_idx, int xretries, int long_retry) |
1301 | { | 1302 | { |
1302 | struct ath_tx_info_priv *tx_info_priv = ATH_TX_INFO_PRIV(tx_info); | 1303 | struct ath_tx_info_priv *tx_info_priv = ATH_TX_INFO_PRIV(tx_info); |
1303 | struct ath_rate_table *rate_table; | 1304 | const struct ath_rate_table *rate_table; |
1304 | struct ieee80211_tx_rate *rates = tx_info->status.rates; | 1305 | struct ieee80211_tx_rate *rates = tx_info->status.rates; |
1305 | u8 flags; | 1306 | u8 flags; |
1306 | u32 i = 0, rix; | 1307 | u32 i = 0, rix; |
@@ -1354,9 +1355,11 @@ static void ath_rc_tx_status(struct ath_softc *sc, | |||
1354 | xretries, long_retry); | 1355 | xretries, long_retry); |
1355 | } | 1356 | } |
1356 | 1357 | ||
1357 | static struct ath_rate_table *ath_choose_rate_table(struct ath_softc *sc, | 1358 | static const |
1358 | enum ieee80211_band band, | 1359 | struct ath_rate_table *ath_choose_rate_table(struct ath_softc *sc, |
1359 | bool is_ht, bool is_cw_40) | 1360 | enum ieee80211_band band, |
1361 | bool is_ht, | ||
1362 | bool is_cw_40) | ||
1360 | { | 1363 | { |
1361 | int mode = 0; | 1364 | int mode = 0; |
1362 | 1365 | ||
@@ -1390,7 +1393,7 @@ static void ath_rc_init(struct ath_softc *sc, | |||
1390 | struct ath_rate_priv *ath_rc_priv, | 1393 | struct ath_rate_priv *ath_rc_priv, |
1391 | struct ieee80211_supported_band *sband, | 1394 | struct ieee80211_supported_band *sband, |
1392 | struct ieee80211_sta *sta, | 1395 | struct ieee80211_sta *sta, |
1393 | struct ath_rate_table *rate_table) | 1396 | const struct ath_rate_table *rate_table) |
1394 | { | 1397 | { |
1395 | struct ath_rateset *rateset = &ath_rc_priv->neg_rates; | 1398 | struct ath_rateset *rateset = &ath_rc_priv->neg_rates; |
1396 | u8 *ht_mcs = (u8 *)&ath_rc_priv->neg_ht_rates; | 1399 | u8 *ht_mcs = (u8 *)&ath_rc_priv->neg_ht_rates; |
@@ -1568,12 +1571,13 @@ static void ath_get_rate(void *priv, struct ieee80211_sta *sta, void *priv_sta, | |||
1568 | struct ath_rate_priv *ath_rc_priv = priv_sta; | 1571 | struct ath_rate_priv *ath_rc_priv = priv_sta; |
1569 | __le16 fc = hdr->frame_control; | 1572 | __le16 fc = hdr->frame_control; |
1570 | 1573 | ||
1571 | /* lowest rate for management and multicast/broadcast frames */ | 1574 | /* lowest rate for management and NO_ACK frames */ |
1572 | if (!ieee80211_is_data(fc) || is_multicast_ether_addr(hdr->addr1) || | 1575 | if (!ieee80211_is_data(fc) || |
1573 | !sta) { | 1576 | tx_info->flags & IEEE80211_TX_CTL_NO_ACK || !sta) { |
1574 | tx_info->control.rates[0].idx = rate_lowest_index(sband, sta); | 1577 | tx_info->control.rates[0].idx = rate_lowest_index(sband, sta); |
1575 | tx_info->control.rates[0].count = | 1578 | tx_info->control.rates[0].count = |
1576 | is_multicast_ether_addr(hdr->addr1) ? 1 : ATH_MGT_TXMAXTRY; | 1579 | (tx_info->flags & IEEE80211_TX_CTL_NO_ACK) ? |
1580 | 1 : ATH_MGT_TXMAXTRY; | ||
1577 | return; | 1581 | return; |
1578 | } | 1582 | } |
1579 | 1583 | ||
@@ -1586,7 +1590,7 @@ static void ath_rate_init(void *priv, struct ieee80211_supported_band *sband, | |||
1586 | { | 1590 | { |
1587 | struct ath_softc *sc = priv; | 1591 | struct ath_softc *sc = priv; |
1588 | struct ath_rate_priv *ath_rc_priv = priv_sta; | 1592 | struct ath_rate_priv *ath_rc_priv = priv_sta; |
1589 | struct ath_rate_table *rate_table = NULL; | 1593 | const struct ath_rate_table *rate_table = NULL; |
1590 | bool is_cw40, is_sgi40; | 1594 | bool is_cw40, is_sgi40; |
1591 | int i, j = 0; | 1595 | int i, j = 0; |
1592 | 1596 | ||
@@ -1635,7 +1639,7 @@ static void ath_rate_update(void *priv, struct ieee80211_supported_band *sband, | |||
1635 | { | 1639 | { |
1636 | struct ath_softc *sc = priv; | 1640 | struct ath_softc *sc = priv; |
1637 | struct ath_rate_priv *ath_rc_priv = priv_sta; | 1641 | struct ath_rate_priv *ath_rc_priv = priv_sta; |
1638 | struct ath_rate_table *rate_table = NULL; | 1642 | const struct ath_rate_table *rate_table = NULL; |
1639 | bool oper_cw40 = false, oper_sgi40; | 1643 | bool oper_cw40 = false, oper_sgi40; |
1640 | bool local_cw40 = (ath_rc_priv->ht_cap & WLAN_RC_40_FLAG) ? | 1644 | bool local_cw40 = (ath_rc_priv->ht_cap & WLAN_RC_40_FLAG) ? |
1641 | true : false; | 1645 | true : false; |
diff --git a/drivers/net/wireless/ath/ath9k/xmit.c b/drivers/net/wireless/ath/ath9k/xmit.c index faf2cab49ea3..41c42824a5ca 100644 --- a/drivers/net/wireless/ath/ath9k/xmit.c +++ b/drivers/net/wireless/ath/ath9k/xmit.c | |||
@@ -434,7 +434,7 @@ static void ath_tx_complete_aggr(struct ath_softc *sc, struct ath_txq *txq, | |||
434 | static u32 ath_lookup_rate(struct ath_softc *sc, struct ath_buf *bf, | 434 | static u32 ath_lookup_rate(struct ath_softc *sc, struct ath_buf *bf, |
435 | struct ath_atx_tid *tid) | 435 | struct ath_atx_tid *tid) |
436 | { | 436 | { |
437 | struct ath_rate_table *rate_table = sc->cur_rate_table; | 437 | const struct ath_rate_table *rate_table = sc->cur_rate_table; |
438 | struct sk_buff *skb; | 438 | struct sk_buff *skb; |
439 | struct ieee80211_tx_info *tx_info; | 439 | struct ieee80211_tx_info *tx_info; |
440 | struct ieee80211_tx_rate *rates; | 440 | struct ieee80211_tx_rate *rates; |
@@ -497,7 +497,7 @@ static u32 ath_lookup_rate(struct ath_softc *sc, struct ath_buf *bf, | |||
497 | static int ath_compute_num_delims(struct ath_softc *sc, struct ath_atx_tid *tid, | 497 | static int ath_compute_num_delims(struct ath_softc *sc, struct ath_atx_tid *tid, |
498 | struct ath_buf *bf, u16 frmlen) | 498 | struct ath_buf *bf, u16 frmlen) |
499 | { | 499 | { |
500 | struct ath_rate_table *rt = sc->cur_rate_table; | 500 | const struct ath_rate_table *rt = sc->cur_rate_table; |
501 | struct sk_buff *skb = bf->bf_mpdu; | 501 | struct sk_buff *skb = bf->bf_mpdu; |
502 | struct ieee80211_tx_info *tx_info = IEEE80211_SKB_CB(skb); | 502 | struct ieee80211_tx_info *tx_info = IEEE80211_SKB_CB(skb); |
503 | u32 nsymbits, nsymbols, mpdudensity; | 503 | u32 nsymbits, nsymbols, mpdudensity; |
@@ -971,7 +971,7 @@ int ath_cabq_update(struct ath_softc *sc) | |||
971 | else if (sc->config.cabqReadytime > ATH9K_READY_TIME_HI_BOUND) | 971 | else if (sc->config.cabqReadytime > ATH9K_READY_TIME_HI_BOUND) |
972 | sc->config.cabqReadytime = ATH9K_READY_TIME_HI_BOUND; | 972 | sc->config.cabqReadytime = ATH9K_READY_TIME_HI_BOUND; |
973 | 973 | ||
974 | qi.tqi_readyTime = (sc->hw->conf.beacon_int * | 974 | qi.tqi_readyTime = (sc->beacon_interval * |
975 | sc->config.cabqReadytime) / 100; | 975 | sc->config.cabqReadytime) / 100; |
976 | ath_txq_update(sc, qnum, &qi); | 976 | ath_txq_update(sc, qnum, &qi); |
977 | 977 | ||
@@ -1407,7 +1407,7 @@ static int setup_tx_flags(struct ath_softc *sc, struct sk_buff *skb, | |||
1407 | static u32 ath_pkt_duration(struct ath_softc *sc, u8 rix, struct ath_buf *bf, | 1407 | static u32 ath_pkt_duration(struct ath_softc *sc, u8 rix, struct ath_buf *bf, |
1408 | int width, int half_gi, bool shortPreamble) | 1408 | int width, int half_gi, bool shortPreamble) |
1409 | { | 1409 | { |
1410 | struct ath_rate_table *rate_table = sc->cur_rate_table; | 1410 | const struct ath_rate_table *rate_table = sc->cur_rate_table; |
1411 | u32 nbits, nsymbits, duration, nsymbols; | 1411 | u32 nbits, nsymbits, duration, nsymbols; |
1412 | u8 rc; | 1412 | u8 rc; |
1413 | int streams, pktlen; | 1413 | int streams, pktlen; |
@@ -1439,7 +1439,7 @@ static u32 ath_pkt_duration(struct ath_softc *sc, u8 rix, struct ath_buf *bf, | |||
1439 | 1439 | ||
1440 | static void ath_buf_set_rate(struct ath_softc *sc, struct ath_buf *bf) | 1440 | static void ath_buf_set_rate(struct ath_softc *sc, struct ath_buf *bf) |
1441 | { | 1441 | { |
1442 | struct ath_rate_table *rt = sc->cur_rate_table; | 1442 | const struct ath_rate_table *rt = sc->cur_rate_table; |
1443 | struct ath9k_11n_rate_series series[4]; | 1443 | struct ath9k_11n_rate_series series[4]; |
1444 | struct sk_buff *skb; | 1444 | struct sk_buff *skb; |
1445 | struct ieee80211_tx_info *tx_info; | 1445 | struct ieee80211_tx_info *tx_info; |