aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/ath/ath9k/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/wireless/ath/ath9k/main.c')
-rw-r--r--drivers/net/wireless/ath/ath9k/main.c129
1 files changed, 63 insertions, 66 deletions
diff --git a/drivers/net/wireless/ath/ath9k/main.c b/drivers/net/wireless/ath/ath9k/main.c
index c7a7abfb2221..a59cfce3335a 100644
--- a/drivers/net/wireless/ath/ath9k/main.c
+++ b/drivers/net/wireless/ath/ath9k/main.c
@@ -260,11 +260,11 @@ int ath_set_channel(struct ath_softc *sc, struct ieee80211_hw *hw,
260 if (!(sc->sc_flags & SC_OP_OFFCHANNEL)) 260 if (!(sc->sc_flags & SC_OP_OFFCHANNEL))
261 caldata = &aphy->caldata; 261 caldata = &aphy->caldata;
262 262
263 ath_print(common, ATH_DBG_CONFIG, 263 ath_dbg(common, ATH_DBG_CONFIG,
264 "(%u MHz) -> (%u MHz), conf_is_ht40: %d fastcc: %d\n", 264 "(%u MHz) -> (%u MHz), conf_is_ht40: %d fastcc: %d\n",
265 sc->sc_ah->curchan->channel, 265 sc->sc_ah->curchan->channel,
266 channel->center_freq, conf_is_ht40(conf), 266 channel->center_freq, conf_is_ht40(conf),
267 fastcc); 267 fastcc);
268 268
269 r = ath9k_hw_reset(ah, hchan, caldata, fastcc); 269 r = ath9k_hw_reset(ah, hchan, caldata, fastcc);
270 if (r) { 270 if (r) {
@@ -387,10 +387,9 @@ void ath_paprd_calibrate(struct work_struct *work)
387 msecs_to_jiffies(ATH_PAPRD_TIMEOUT)); 387 msecs_to_jiffies(ATH_PAPRD_TIMEOUT));
388 sc->paprd_pending = false; 388 sc->paprd_pending = false;
389 if (!time_left) { 389 if (!time_left) {
390 ath_print(ath9k_hw_common(ah), ATH_DBG_CALIBRATE, 390 ath_dbg(ath9k_hw_common(ah), ATH_DBG_CALIBRATE,
391 "Timeout waiting for paprd training on " 391 "Timeout waiting for paprd training on TX chain %d\n",
392 "TX chain %d\n", 392 chain);
393 chain);
394 goto fail_paprd; 393 goto fail_paprd;
395 } 394 }
396 395
@@ -449,7 +448,7 @@ void ath_ani_calibrate(unsigned long data)
449 /* Long calibration runs independently of short calibration. */ 448 /* Long calibration runs independently of short calibration. */
450 if ((timestamp - common->ani.longcal_timer) >= long_cal_interval) { 449 if ((timestamp - common->ani.longcal_timer) >= long_cal_interval) {
451 longcal = true; 450 longcal = true;
452 ath_print(common, ATH_DBG_ANI, "longcal @%lu\n", jiffies); 451 ath_dbg(common, ATH_DBG_ANI, "longcal @%lu\n", jiffies);
453 common->ani.longcal_timer = timestamp; 452 common->ani.longcal_timer = timestamp;
454 } 453 }
455 454
@@ -457,8 +456,8 @@ void ath_ani_calibrate(unsigned long data)
457 if (!common->ani.caldone) { 456 if (!common->ani.caldone) {
458 if ((timestamp - common->ani.shortcal_timer) >= short_cal_interval) { 457 if ((timestamp - common->ani.shortcal_timer) >= short_cal_interval) {
459 shortcal = true; 458 shortcal = true;
460 ath_print(common, ATH_DBG_ANI, 459 ath_dbg(common, ATH_DBG_ANI,
461 "shortcal @%lu\n", jiffies); 460 "shortcal @%lu\n", jiffies);
462 common->ani.shortcal_timer = timestamp; 461 common->ani.shortcal_timer = timestamp;
463 common->ani.resetcal_timer = timestamp; 462 common->ani.resetcal_timer = timestamp;
464 } 463 }
@@ -542,10 +541,10 @@ void ath_update_chainmask(struct ath_softc *sc, int is_ht)
542 common->rx_chainmask = 1; 541 common->rx_chainmask = 1;
543 } 542 }
544 543
545 ath_print(common, ATH_DBG_CONFIG, 544 ath_dbg(common, ATH_DBG_CONFIG,
546 "tx chmask: %d, rx chmask: %d\n", 545 "tx chmask: %d, rx chmask: %d\n",
547 common->tx_chainmask, 546 common->tx_chainmask,
548 common->rx_chainmask); 547 common->rx_chainmask);
549} 548}
550 549
551static void ath_node_attach(struct ath_softc *sc, struct ieee80211_sta *sta) 550static void ath_node_attach(struct ath_softc *sc, struct ieee80211_sta *sta)
@@ -641,8 +640,8 @@ void ath9k_tasklet(unsigned long data)
641 * TSF sync does not look correct; remain awake to sync with 640 * TSF sync does not look correct; remain awake to sync with
642 * the next Beacon. 641 * the next Beacon.
643 */ 642 */
644 ath_print(common, ATH_DBG_PS, 643 ath_dbg(common, ATH_DBG_PS,
645 "TSFOOR - Sync with next Beacon\n"); 644 "TSFOOR - Sync with next Beacon\n");
646 sc->ps_flags |= PS_WAIT_FOR_BEACON | PS_BEACON_SYNC; 645 sc->ps_flags |= PS_WAIT_FOR_BEACON | PS_BEACON_SYNC;
647 } 646 }
648 647
@@ -840,9 +839,9 @@ static void ath9k_bss_assoc_info(struct ath_softc *sc,
840 struct ath_common *common = ath9k_hw_common(ah); 839 struct ath_common *common = ath9k_hw_common(ah);
841 840
842 if (bss_conf->assoc) { 841 if (bss_conf->assoc) {
843 ath_print(common, ATH_DBG_CONFIG, 842 ath_dbg(common, ATH_DBG_CONFIG,
844 "Bss Info ASSOC %d, bssid: %pM\n", 843 "Bss Info ASSOC %d, bssid: %pM\n",
845 bss_conf->aid, common->curbssid); 844 bss_conf->aid, common->curbssid);
846 845
847 /* New association, store aid */ 846 /* New association, store aid */
848 common->curaid = bss_conf->aid; 847 common->curaid = bss_conf->aid;
@@ -865,7 +864,7 @@ static void ath9k_bss_assoc_info(struct ath_softc *sc,
865 sc->sc_flags |= SC_OP_ANI_RUN; 864 sc->sc_flags |= SC_OP_ANI_RUN;
866 ath_start_ani(common); 865 ath_start_ani(common);
867 } else { 866 } else {
868 ath_print(common, ATH_DBG_CONFIG, "Bss Info DISASSOC\n"); 867 ath_dbg(common, ATH_DBG_CONFIG, "Bss Info DISASSOC\n");
869 common->curaid = 0; 868 common->curaid = 0;
870 /* Stop ANI */ 869 /* Stop ANI */
871 sc->sc_flags &= ~SC_OP_ANI_RUN; 870 sc->sc_flags &= ~SC_OP_ANI_RUN;
@@ -1064,9 +1063,9 @@ static int ath9k_start(struct ieee80211_hw *hw)
1064 struct ath9k_channel *init_channel; 1063 struct ath9k_channel *init_channel;
1065 int r; 1064 int r;
1066 1065
1067 ath_print(common, ATH_DBG_CONFIG, 1066 ath_dbg(common, ATH_DBG_CONFIG,
1068 "Starting driver with initial channel: %d MHz\n", 1067 "Starting driver with initial channel: %d MHz\n",
1069 curchan->center_freq); 1068 curchan->center_freq);
1070 1069
1071 mutex_lock(&sc->mutex); 1070 mutex_lock(&sc->mutex);
1072 1071
@@ -1196,9 +1195,9 @@ static int ath9k_tx(struct ieee80211_hw *hw,
1196 struct ieee80211_hdr *hdr = (struct ieee80211_hdr *) skb->data; 1195 struct ieee80211_hdr *hdr = (struct ieee80211_hdr *) skb->data;
1197 1196
1198 if (aphy->state != ATH_WIPHY_ACTIVE && aphy->state != ATH_WIPHY_SCAN) { 1197 if (aphy->state != ATH_WIPHY_ACTIVE && aphy->state != ATH_WIPHY_SCAN) {
1199 ath_print(common, ATH_DBG_XMIT, 1198 ath_dbg(common, ATH_DBG_XMIT,
1200 "ath9k: %s: TX in unexpected wiphy state " 1199 "ath9k: %s: TX in unexpected wiphy state %d\n",
1201 "%d\n", wiphy_name(hw->wiphy), aphy->state); 1200 wiphy_name(hw->wiphy), aphy->state);
1202 goto exit; 1201 goto exit;
1203 } 1202 }
1204 1203
@@ -1210,8 +1209,8 @@ static int ath9k_tx(struct ieee80211_hw *hw,
1210 if (ieee80211_is_data(hdr->frame_control) && 1209 if (ieee80211_is_data(hdr->frame_control) &&
1211 !ieee80211_is_nullfunc(hdr->frame_control) && 1210 !ieee80211_is_nullfunc(hdr->frame_control) &&
1212 !ieee80211_has_pm(hdr->frame_control)) { 1211 !ieee80211_has_pm(hdr->frame_control)) {
1213 ath_print(common, ATH_DBG_PS, "Add PM=1 for a TX frame " 1212 ath_dbg(common, ATH_DBG_PS,
1214 "while in PS mode\n"); 1213 "Add PM=1 for a TX frame while in PS mode\n");
1215 hdr->frame_control |= cpu_to_le16(IEEE80211_FCTL_PM); 1214 hdr->frame_control |= cpu_to_le16(IEEE80211_FCTL_PM);
1216 } 1215 }
1217 } 1216 }
@@ -1226,12 +1225,12 @@ static int ath9k_tx(struct ieee80211_hw *hw,
1226 if (!(sc->sc_ah->caps.hw_caps & ATH9K_HW_CAP_AUTOSLEEP)) 1225 if (!(sc->sc_ah->caps.hw_caps & ATH9K_HW_CAP_AUTOSLEEP))
1227 ath9k_hw_setrxabort(sc->sc_ah, 0); 1226 ath9k_hw_setrxabort(sc->sc_ah, 0);
1228 if (ieee80211_is_pspoll(hdr->frame_control)) { 1227 if (ieee80211_is_pspoll(hdr->frame_control)) {
1229 ath_print(common, ATH_DBG_PS, 1228 ath_dbg(common, ATH_DBG_PS,
1230 "Sending PS-Poll to pick a buffered frame\n"); 1229 "Sending PS-Poll to pick a buffered frame\n");
1231 sc->ps_flags |= PS_WAIT_FOR_PSPOLL_DATA; 1230 sc->ps_flags |= PS_WAIT_FOR_PSPOLL_DATA;
1232 } else { 1231 } else {
1233 ath_print(common, ATH_DBG_PS, 1232 ath_dbg(common, ATH_DBG_PS,
1234 "Wake up to complete TX\n"); 1233 "Wake up to complete TX\n");
1235 sc->ps_flags |= PS_WAIT_FOR_TX_ACK; 1234 sc->ps_flags |= PS_WAIT_FOR_TX_ACK;
1236 } 1235 }
1237 /* 1236 /*
@@ -1245,10 +1244,10 @@ static int ath9k_tx(struct ieee80211_hw *hw,
1245 memset(&txctl, 0, sizeof(struct ath_tx_control)); 1244 memset(&txctl, 0, sizeof(struct ath_tx_control));
1246 txctl.txq = sc->tx.txq_map[skb_get_queue_mapping(skb)]; 1245 txctl.txq = sc->tx.txq_map[skb_get_queue_mapping(skb)];
1247 1246
1248 ath_print(common, ATH_DBG_XMIT, "transmitting packet, skb: %p\n", skb); 1247 ath_dbg(common, ATH_DBG_XMIT, "transmitting packet, skb: %p\n", skb);
1249 1248
1250 if (ath_tx_start(hw, skb, &txctl) != 0) { 1249 if (ath_tx_start(hw, skb, &txctl) != 0) {
1251 ath_print(common, ATH_DBG_XMIT, "TX failed\n"); 1250 ath_dbg(common, ATH_DBG_XMIT, "TX failed\n");
1252 goto exit; 1251 goto exit;
1253 } 1252 }
1254 1253
@@ -1288,7 +1287,7 @@ static void ath9k_stop(struct ieee80211_hw *hw)
1288 } 1287 }
1289 1288
1290 if (sc->sc_flags & SC_OP_INVALID) { 1289 if (sc->sc_flags & SC_OP_INVALID) {
1291 ath_print(common, ATH_DBG_ANY, "Device not present\n"); 1290 ath_dbg(common, ATH_DBG_ANY, "Device not present\n");
1292 mutex_unlock(&sc->mutex); 1291 mutex_unlock(&sc->mutex);
1293 return; 1292 return;
1294 } 1293 }
@@ -1337,7 +1336,7 @@ static void ath9k_stop(struct ieee80211_hw *hw)
1337 1336
1338 mutex_unlock(&sc->mutex); 1337 mutex_unlock(&sc->mutex);
1339 1338
1340 ath_print(common, ATH_DBG_CONFIG, "Driver halt\n"); 1339 ath_dbg(common, ATH_DBG_CONFIG, "Driver halt\n");
1341} 1340}
1342 1341
1343static int ath9k_add_interface(struct ieee80211_hw *hw, 1342static int ath9k_add_interface(struct ieee80211_hw *hw,
@@ -1376,8 +1375,8 @@ static int ath9k_add_interface(struct ieee80211_hw *hw,
1376 goto out; 1375 goto out;
1377 } 1376 }
1378 1377
1379 ath_print(common, ATH_DBG_CONFIG, 1378 ath_dbg(common, ATH_DBG_CONFIG,
1380 "Attach a VIF of type: %d\n", ic_opmode); 1379 "Attach a VIF of type: %d\n", ic_opmode);
1381 1380
1382 /* Set the VIF opmode */ 1381 /* Set the VIF opmode */
1383 avp->av_opmode = ic_opmode; 1382 avp->av_opmode = ic_opmode;
@@ -1433,7 +1432,7 @@ static void ath9k_remove_interface(struct ieee80211_hw *hw,
1433 bool bs_valid = false; 1432 bool bs_valid = false;
1434 int i; 1433 int i;
1435 1434
1436 ath_print(common, ATH_DBG_CONFIG, "Detach Interface\n"); 1435 ath_dbg(common, ATH_DBG_CONFIG, "Detach Interface\n");
1437 1436
1438 mutex_lock(&sc->mutex); 1437 mutex_lock(&sc->mutex);
1439 1438
@@ -1548,8 +1547,8 @@ static int ath9k_config(struct ieee80211_hw *hw, u32 changed)
1548 if (enable_radio) { 1547 if (enable_radio) {
1549 sc->ps_idle = false; 1548 sc->ps_idle = false;
1550 ath_radio_enable(sc, hw); 1549 ath_radio_enable(sc, hw);
1551 ath_print(common, ATH_DBG_CONFIG, 1550 ath_dbg(common, ATH_DBG_CONFIG,
1552 "not-idle: enabling radio\n"); 1551 "not-idle: enabling radio\n");
1553 } 1552 }
1554 } 1553 }
1555 1554
@@ -1571,12 +1570,12 @@ static int ath9k_config(struct ieee80211_hw *hw, u32 changed)
1571 1570
1572 if (changed & IEEE80211_CONF_CHANGE_MONITOR) { 1571 if (changed & IEEE80211_CONF_CHANGE_MONITOR) {
1573 if (conf->flags & IEEE80211_CONF_MONITOR) { 1572 if (conf->flags & IEEE80211_CONF_MONITOR) {
1574 ath_print(common, ATH_DBG_CONFIG, 1573 ath_dbg(common, ATH_DBG_CONFIG,
1575 "Monitor mode is enabled\n"); 1574 "Monitor mode is enabled\n");
1576 sc->sc_ah->is_monitoring = true; 1575 sc->sc_ah->is_monitoring = true;
1577 } else { 1576 } else {
1578 ath_print(common, ATH_DBG_CONFIG, 1577 ath_dbg(common, ATH_DBG_CONFIG,
1579 "Monitor mode is disabled\n"); 1578 "Monitor mode is disabled\n");
1580 sc->sc_ah->is_monitoring = false; 1579 sc->sc_ah->is_monitoring = false;
1581 } 1580 }
1582 } 1581 }
@@ -1608,8 +1607,8 @@ static int ath9k_config(struct ieee80211_hw *hw, u32 changed)
1608 goto skip_chan_change; 1607 goto skip_chan_change;
1609 } 1608 }
1610 1609
1611 ath_print(common, ATH_DBG_CONFIG, "Set channel: %d MHz\n", 1610 ath_dbg(common, ATH_DBG_CONFIG, "Set channel: %d MHz\n",
1612 curchan->center_freq); 1611 curchan->center_freq);
1613 1612
1614 /* XXX: remove me eventualy */ 1613 /* XXX: remove me eventualy */
1615 ath9k_update_ichannel(sc, hw, &sc->sc_ah->channels[pos]); 1614 ath9k_update_ichannel(sc, hw, &sc->sc_ah->channels[pos]);
@@ -1667,7 +1666,7 @@ skip_chan_change:
1667 spin_unlock_bh(&sc->wiphy_lock); 1666 spin_unlock_bh(&sc->wiphy_lock);
1668 1667
1669 if (disable_radio) { 1668 if (disable_radio) {
1670 ath_print(common, ATH_DBG_CONFIG, "idle: disabling radio\n"); 1669 ath_dbg(common, ATH_DBG_CONFIG, "idle: disabling radio\n");
1671 sc->ps_idle = true; 1670 sc->ps_idle = true;
1672 ath_radio_disable(sc, hw); 1671 ath_radio_disable(sc, hw);
1673 } 1672 }
@@ -1706,8 +1705,8 @@ static void ath9k_configure_filter(struct ieee80211_hw *hw,
1706 ath9k_hw_setrxfilter(sc->sc_ah, rfilt); 1705 ath9k_hw_setrxfilter(sc->sc_ah, rfilt);
1707 ath9k_ps_restore(sc); 1706 ath9k_ps_restore(sc);
1708 1707
1709 ath_print(ath9k_hw_common(sc->sc_ah), ATH_DBG_CONFIG, 1708 ath_dbg(ath9k_hw_common(sc->sc_ah), ATH_DBG_CONFIG,
1710 "Set HW RX filter: 0x%x\n", rfilt); 1709 "Set HW RX filter: 0x%x\n", rfilt);
1711} 1710}
1712 1711
1713static int ath9k_sta_add(struct ieee80211_hw *hw, 1712static int ath9k_sta_add(struct ieee80211_hw *hw,
@@ -1758,11 +1757,10 @@ static int ath9k_conf_tx(struct ieee80211_hw *hw, u16 queue,
1758 qi.tqi_cwmax = params->cw_max; 1757 qi.tqi_cwmax = params->cw_max;
1759 qi.tqi_burstTime = params->txop; 1758 qi.tqi_burstTime = params->txop;
1760 1759
1761 ath_print(common, ATH_DBG_CONFIG, 1760 ath_dbg(common, ATH_DBG_CONFIG,
1762 "Configure tx [queue/halq] [%d/%d], " 1761 "Configure tx [queue/halq] [%d/%d], aifs: %d, cw_min: %d, cw_max: %d, txop: %d\n",
1763 "aifs: %d, cw_min: %d, cw_max: %d, txop: %d\n", 1762 queue, txq->axq_qnum, params->aifs, params->cw_min,
1764 queue, txq->axq_qnum, params->aifs, params->cw_min, 1763 params->cw_max, params->txop);
1765 params->cw_max, params->txop);
1766 1764
1767 ret = ath_txq_update(sc, txq->axq_qnum, &qi); 1765 ret = ath_txq_update(sc, txq->axq_qnum, &qi);
1768 if (ret) 1766 if (ret)
@@ -1793,7 +1791,7 @@ static int ath9k_set_key(struct ieee80211_hw *hw,
1793 1791
1794 mutex_lock(&sc->mutex); 1792 mutex_lock(&sc->mutex);
1795 ath9k_ps_wakeup(sc); 1793 ath9k_ps_wakeup(sc);
1796 ath_print(common, ATH_DBG_CONFIG, "Set HW Key\n"); 1794 ath_dbg(common, ATH_DBG_CONFIG, "Set HW Key\n");
1797 1795
1798 switch (cmd) { 1796 switch (cmd) {
1799 case SET_KEY: 1797 case SET_KEY:
@@ -1852,9 +1850,8 @@ static void ath9k_bss_info_changed(struct ieee80211_hw *hw,
1852 if (vif->type == NL80211_IFTYPE_ADHOC) 1850 if (vif->type == NL80211_IFTYPE_ADHOC)
1853 ath_update_chainmask(sc, 0); 1851 ath_update_chainmask(sc, 0);
1854 1852
1855 ath_print(common, ATH_DBG_CONFIG, 1853 ath_dbg(common, ATH_DBG_CONFIG, "BSSID: %pM aid: 0x%x\n",
1856 "BSSID: %pM aid: 0x%x\n", 1854 common->curbssid, common->curaid);
1857 common->curbssid, common->curaid);
1858 1855
1859 /* need to reconfigure the beacon */ 1856 /* need to reconfigure the beacon */
1860 sc->sc_flags &= ~SC_OP_BEACONS ; 1857 sc->sc_flags &= ~SC_OP_BEACONS ;
@@ -1910,8 +1907,8 @@ static void ath9k_bss_info_changed(struct ieee80211_hw *hw,
1910 } 1907 }
1911 1908
1912 if (changed & BSS_CHANGED_ERP_PREAMBLE) { 1909 if (changed & BSS_CHANGED_ERP_PREAMBLE) {
1913 ath_print(common, ATH_DBG_CONFIG, "BSS Changed PREAMBLE %d\n", 1910 ath_dbg(common, ATH_DBG_CONFIG, "BSS Changed PREAMBLE %d\n",
1914 bss_conf->use_short_preamble); 1911 bss_conf->use_short_preamble);
1915 if (bss_conf->use_short_preamble) 1912 if (bss_conf->use_short_preamble)
1916 sc->sc_flags |= SC_OP_PREAMBLE_SHORT; 1913 sc->sc_flags |= SC_OP_PREAMBLE_SHORT;
1917 else 1914 else
@@ -1919,8 +1916,8 @@ static void ath9k_bss_info_changed(struct ieee80211_hw *hw,
1919 } 1916 }
1920 1917
1921 if (changed & BSS_CHANGED_ERP_CTS_PROT) { 1918 if (changed & BSS_CHANGED_ERP_CTS_PROT) {
1922 ath_print(common, ATH_DBG_CONFIG, "BSS Changed CTS PROT %d\n", 1919 ath_dbg(common, ATH_DBG_CONFIG, "BSS Changed CTS PROT %d\n",
1923 bss_conf->use_cts_prot); 1920 bss_conf->use_cts_prot);
1924 if (bss_conf->use_cts_prot && 1921 if (bss_conf->use_cts_prot &&
1925 hw->conf.channel->band != IEEE80211_BAND_5GHZ) 1922 hw->conf.channel->band != IEEE80211_BAND_5GHZ)
1926 sc->sc_flags |= SC_OP_PROTECT_ENABLE; 1923 sc->sc_flags |= SC_OP_PROTECT_ENABLE;
@@ -1929,7 +1926,7 @@ static void ath9k_bss_info_changed(struct ieee80211_hw *hw,
1929 } 1926 }
1930 1927
1931 if (changed & BSS_CHANGED_ASSOC) { 1928 if (changed & BSS_CHANGED_ASSOC) {
1932 ath_print(common, ATH_DBG_CONFIG, "BSS Changed ASSOC %d\n", 1929 ath_dbg(common, ATH_DBG_CONFIG, "BSS Changed ASSOC %d\n",
1933 bss_conf->assoc); 1930 bss_conf->assoc);
1934 ath9k_bss_assoc_info(sc, hw, vif, bss_conf); 1931 ath9k_bss_assoc_info(sc, hw, vif, bss_conf);
1935 } 1932 }