main.c (b942471bfcda207a51379628379aa821216486e7) main.c (05c0be2f7f10404e5b3bc4105f9206096e9b8767)
1/*
2 * Copyright (c) 2008-2011 Atheros Communications Inc.
3 *
4 * Permission to use, copy, modify, and/or distribute this software for any
5 * purpose with or without fee is hereby granted, provided that the above
6 * copyright notice and this permission notice appear in all copies.
7 *
8 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES

--- 120 unchanged lines hidden (view full) ---

129 PS_WAIT_FOR_PSPOLL_DATA |
130 PS_WAIT_FOR_TX_ACK)))
131 ath9k_hw_setpower(sc->sc_ah, ATH9K_PM_NETWORK_SLEEP);
132
133 unlock:
134 spin_unlock_irqrestore(&sc->sc_pm_lock, flags);
135}
136
1/*
2 * Copyright (c) 2008-2011 Atheros Communications Inc.
3 *
4 * Permission to use, copy, modify, and/or distribute this software for any
5 * purpose with or without fee is hereby granted, provided that the above
6 * copyright notice and this permission notice appear in all copies.
7 *
8 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES

--- 120 unchanged lines hidden (view full) ---

129 PS_WAIT_FOR_PSPOLL_DATA |
130 PS_WAIT_FOR_TX_ACK)))
131 ath9k_hw_setpower(sc->sc_ah, ATH9K_PM_NETWORK_SLEEP);
132
133 unlock:
134 spin_unlock_irqrestore(&sc->sc_pm_lock, flags);
135}
136
137static void ath_start_ani(struct ath_common *common)
137void ath_start_ani(struct ath_common *common)
138{
139 struct ath_hw *ah = common->ah;
140 unsigned long timestamp = jiffies_to_msecs(jiffies);
141 struct ath_softc *sc = (struct ath_softc *) common->priv;
142
143 if (!(sc->sc_flags & SC_OP_ANI_RUN))
144 return;
145

--- 149 unchanged lines hidden (view full) ---

295 sc->config.txpowlimit, &sc->curtxpow);
296 ath9k_hw_set_interrupts(ah, ah->imask);
297
298 if (!(sc->sc_flags & (SC_OP_OFFCHANNEL))) {
299 if (sc->sc_flags & SC_OP_BEACONS)
300 ath_set_beacon(sc);
301 ieee80211_queue_delayed_work(sc->hw, &sc->tx_complete_work, 0);
302 ieee80211_queue_delayed_work(sc->hw, &sc->hw_pll_work, HZ/2);
138{
139 struct ath_hw *ah = common->ah;
140 unsigned long timestamp = jiffies_to_msecs(jiffies);
141 struct ath_softc *sc = (struct ath_softc *) common->priv;
142
143 if (!(sc->sc_flags & SC_OP_ANI_RUN))
144 return;
145

--- 149 unchanged lines hidden (view full) ---

295 sc->config.txpowlimit, &sc->curtxpow);
296 ath9k_hw_set_interrupts(ah, ah->imask);
297
298 if (!(sc->sc_flags & (SC_OP_OFFCHANNEL))) {
299 if (sc->sc_flags & SC_OP_BEACONS)
300 ath_set_beacon(sc);
301 ieee80211_queue_delayed_work(sc->hw, &sc->tx_complete_work, 0);
302 ieee80211_queue_delayed_work(sc->hw, &sc->hw_pll_work, HZ/2);
303 ath_start_ani(common);
303 if (!common->disable_ani)
304 ath_start_ani(common);
304 }
305
306 ps_restore:
307 ieee80211_wake_queues(hw);
308
309 spin_unlock_bh(&sc->sc_pcu_lock);
310
311 ath9k_ps_restore(sc);

--- 651 unchanged lines hidden (view full) ---

963 struct ath_hw *ah = sc->sc_ah;
964 struct ath_common *common = ath9k_hw_common(ah);
965 struct ieee80211_hw *hw = sc->hw;
966 int r;
967
968 sc->hw_busy_count = 0;
969
970 /* Stop ANI */
305 }
306
307 ps_restore:
308 ieee80211_wake_queues(hw);
309
310 spin_unlock_bh(&sc->sc_pcu_lock);
311
312 ath9k_ps_restore(sc);

--- 651 unchanged lines hidden (view full) ---

964 struct ath_hw *ah = sc->sc_ah;
965 struct ath_common *common = ath9k_hw_common(ah);
966 struct ieee80211_hw *hw = sc->hw;
967 int r;
968
969 sc->hw_busy_count = 0;
970
971 /* Stop ANI */
972
971 del_timer_sync(&common->ani.timer);
972
973 ath9k_ps_wakeup(sc);
974 spin_lock_bh(&sc->sc_pcu_lock);
975
976 ieee80211_stop_queues(hw);
977
978 ath9k_hw_disable_interrupts(ah);

--- 33 unchanged lines hidden (view full) ---

1012 }
1013 }
1014 }
1015
1016 ieee80211_wake_queues(hw);
1017 spin_unlock_bh(&sc->sc_pcu_lock);
1018
1019 /* Start ANI */
973 del_timer_sync(&common->ani.timer);
974
975 ath9k_ps_wakeup(sc);
976 spin_lock_bh(&sc->sc_pcu_lock);
977
978 ieee80211_stop_queues(hw);
979
980 ath9k_hw_disable_interrupts(ah);

--- 33 unchanged lines hidden (view full) ---

1014 }
1015 }
1016 }
1017
1018 ieee80211_wake_queues(hw);
1019 spin_unlock_bh(&sc->sc_pcu_lock);
1020
1021 /* Start ANI */
1020 ath_start_ani(common);
1022 if (!common->disable_ani)
1023 ath_start_ani(common);
1024
1021 ath9k_ps_restore(sc);
1022
1023 return r;
1024}
1025
1026/**********************/
1027/* mac80211 callbacks */
1028/**********************/

--- 374 unchanged lines hidden (view full) ---

1403 ah->imask &= ~ATH9K_INT_TSFOOR;
1404 }
1405
1406 ath9k_hw_set_interrupts(ah, ah->imask);
1407
1408 /* Set up ANI */
1409 if (iter_data.naps > 0) {
1410 sc->sc_ah->stats.avgbrssi = ATH_RSSI_DUMMY_MARKER;
1025 ath9k_ps_restore(sc);
1026
1027 return r;
1028}
1029
1030/**********************/
1031/* mac80211 callbacks */
1032/**********************/

--- 374 unchanged lines hidden (view full) ---

1407 ah->imask &= ~ATH9K_INT_TSFOOR;
1408 }
1409
1410 ath9k_hw_set_interrupts(ah, ah->imask);
1411
1412 /* Set up ANI */
1413 if (iter_data.naps > 0) {
1414 sc->sc_ah->stats.avgbrssi = ATH_RSSI_DUMMY_MARKER;
1411 sc->sc_flags |= SC_OP_ANI_RUN;
1412 ath_start_ani(common);
1415
1416 if (!common->disable_ani) {
1417 sc->sc_flags |= SC_OP_ANI_RUN;
1418 ath_start_ani(common);
1419 }
1420
1413 } else {
1414 sc->sc_flags &= ~SC_OP_ANI_RUN;
1415 del_timer_sync(&common->ani.timer);
1416 }
1417}
1418
1419/* Called with sc->mutex held, vif counts set up properly. */
1420static void ath9k_do_vif_add_setup(struct ieee80211_hw *hw,

--- 547 unchanged lines hidden (view full) ---

1968 * on the receipt of the first Beacon frame (i.e.,
1969 * after time sync with the AP).
1970 */
1971 sc->ps_flags |= PS_BEACON_SYNC | PS_WAIT_FOR_BEACON;
1972 /* Reset rssi stats */
1973 sc->last_rssi = ATH_RSSI_DUMMY_MARKER;
1974 sc->sc_ah->stats.avgbrssi = ATH_RSSI_DUMMY_MARKER;
1975
1421 } else {
1422 sc->sc_flags &= ~SC_OP_ANI_RUN;
1423 del_timer_sync(&common->ani.timer);
1424 }
1425}
1426
1427/* Called with sc->mutex held, vif counts set up properly. */
1428static void ath9k_do_vif_add_setup(struct ieee80211_hw *hw,

--- 547 unchanged lines hidden (view full) ---

1976 * on the receipt of the first Beacon frame (i.e.,
1977 * after time sync with the AP).
1978 */
1979 sc->ps_flags |= PS_BEACON_SYNC | PS_WAIT_FOR_BEACON;
1980 /* Reset rssi stats */
1981 sc->last_rssi = ATH_RSSI_DUMMY_MARKER;
1982 sc->sc_ah->stats.avgbrssi = ATH_RSSI_DUMMY_MARKER;
1983
1976 sc->sc_flags |= SC_OP_ANI_RUN;
1977 ath_start_ani(common);
1984 if (!common->disable_ani) {
1985 sc->sc_flags |= SC_OP_ANI_RUN;
1986 ath_start_ani(common);
1987 }
1988
1978 }
1979}
1980
1981static void ath9k_config_bss(struct ath_softc *sc, struct ieee80211_vif *vif)
1982{
1983 struct ath_common *common = ath9k_hw_common(sc->sc_ah);
1984 struct ieee80211_bss_conf *bss_conf = &vif->bss_conf;
1985 struct ath_vif *avp = (void *)vif->drv_priv;

--- 52 unchanged lines hidden (view full) ---

2038 if (changed & BSS_CHANGED_IBSS) {
2039 /* There can be only one vif available */
2040 memcpy(common->curbssid, bss_conf->bssid, ETH_ALEN);
2041 common->curaid = bss_conf->aid;
2042 ath9k_hw_write_associd(sc->sc_ah);
2043
2044 if (bss_conf->ibss_joined) {
2045 sc->sc_ah->stats.avgbrssi = ATH_RSSI_DUMMY_MARKER;
1989 }
1990}
1991
1992static void ath9k_config_bss(struct ath_softc *sc, struct ieee80211_vif *vif)
1993{
1994 struct ath_common *common = ath9k_hw_common(sc->sc_ah);
1995 struct ieee80211_bss_conf *bss_conf = &vif->bss_conf;
1996 struct ath_vif *avp = (void *)vif->drv_priv;

--- 52 unchanged lines hidden (view full) ---

2049 if (changed & BSS_CHANGED_IBSS) {
2050 /* There can be only one vif available */
2051 memcpy(common->curbssid, bss_conf->bssid, ETH_ALEN);
2052 common->curaid = bss_conf->aid;
2053 ath9k_hw_write_associd(sc->sc_ah);
2054
2055 if (bss_conf->ibss_joined) {
2056 sc->sc_ah->stats.avgbrssi = ATH_RSSI_DUMMY_MARKER;
2046 sc->sc_flags |= SC_OP_ANI_RUN;
2047 ath_start_ani(common);
2057
2058 if (!common->disable_ani) {
2059 sc->sc_flags |= SC_OP_ANI_RUN;
2060 ath_start_ani(common);
2061 }
2062
2048 } else {
2049 sc->sc_flags &= ~SC_OP_ANI_RUN;
2050 del_timer_sync(&common->ani.timer);
2051 }
2052 }
2053
2054 /* Enable transmission of beacons (AP, IBSS, MESH) */
2055 if ((changed & BSS_CHANGED_BEACON) ||

--- 343 unchanged lines hidden ---
2063 } else {
2064 sc->sc_flags &= ~SC_OP_ANI_RUN;
2065 del_timer_sync(&common->ani.timer);
2066 }
2067 }
2068
2069 /* Enable transmission of beacons (AP, IBSS, MESH) */
2070 if ((changed & BSS_CHANGED_BEACON) ||

--- 343 unchanged lines hidden ---