OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2008-2009 Atheros Communications Inc. | 2 * Copyright (c) 2008-2009 Atheros Communications Inc. |
3 * | 3 * |
4 * Permission to use, copy, modify, and/or distribute this software for any | 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 | 5 * purpose with or without fee is hereby granted, provided that the above |
6 * copyright notice and this permission notice appear in all copies. | 6 * copyright notice and this permission notice appear in all copies. |
7 * | 7 * |
8 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES | 8 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES |
9 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF | 9 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF |
10 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR | 10 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR |
(...skipping 1538 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1549 } | 1549 } |
1550 } | 1550 } |
1551 | 1551 |
1552 /* | 1552 /* |
1553 * We just prepare to enable PS. We have to wait until our AP has | 1553 * We just prepare to enable PS. We have to wait until our AP has |
1554 * ACK'd our null data frame to disable RX otherwise we'll ignore | 1554 * ACK'd our null data frame to disable RX otherwise we'll ignore |
1555 * those ACKs and end up retransmitting the same null data frames. | 1555 * those ACKs and end up retransmitting the same null data frames. |
1556 * IEEE80211_CONF_CHANGE_PS is only passed by mac80211 for STA mode. | 1556 * IEEE80211_CONF_CHANGE_PS is only passed by mac80211 for STA mode. |
1557 */ | 1557 */ |
1558 if (changed & IEEE80211_CONF_CHANGE_PS) { | 1558 if (changed & IEEE80211_CONF_CHANGE_PS) { |
| 1559 unsigned long flags; |
| 1560 spin_lock_irqsave(&sc->sc_pm_lock, flags); |
1559 if (conf->flags & IEEE80211_CONF_PS) { | 1561 if (conf->flags & IEEE80211_CONF_PS) { |
1560 sc->ps_flags |= PS_ENABLED; | 1562 sc->ps_flags |= PS_ENABLED; |
1561 /* | 1563 /* |
1562 * At this point we know hardware has received an ACK | 1564 * At this point we know hardware has received an ACK |
1563 * of a previously sent null data frame. | 1565 * of a previously sent null data frame. |
1564 */ | 1566 */ |
1565 if ((sc->ps_flags & PS_NULLFUNC_COMPLETED)) { | 1567 if ((sc->ps_flags & PS_NULLFUNC_COMPLETED)) { |
1566 sc->ps_flags &= ~PS_NULLFUNC_COMPLETED; | 1568 sc->ps_flags &= ~PS_NULLFUNC_COMPLETED; |
1567 ath9k_enable_ps(sc); | 1569 ath9k_enable_ps(sc); |
1568 } | 1570 } |
1569 } else { | 1571 } else { |
1570 sc->ps_enabled = false; | 1572 sc->ps_enabled = false; |
1571 sc->ps_flags &= ~(PS_ENABLED | | 1573 sc->ps_flags &= ~(PS_ENABLED | |
1572 PS_NULLFUNC_COMPLETED); | 1574 PS_NULLFUNC_COMPLETED); |
1573 » » » ath9k_setpower(sc, ATH9K_PM_AWAKE); | 1575 » » » ath9k_hw_setpower(sc->sc_ah, ATH9K_PM_AWAKE); |
1574 if (!(ah->caps.hw_caps & | 1576 if (!(ah->caps.hw_caps & |
1575 ATH9K_HW_CAP_AUTOSLEEP)) { | 1577 ATH9K_HW_CAP_AUTOSLEEP)) { |
1576 ath9k_hw_setrxabort(sc->sc_ah, 0); | 1578 ath9k_hw_setrxabort(sc->sc_ah, 0); |
1577 sc->ps_flags &= ~(PS_WAIT_FOR_BEACON | | 1579 sc->ps_flags &= ~(PS_WAIT_FOR_BEACON | |
1578 PS_WAIT_FOR_CAB | | 1580 PS_WAIT_FOR_CAB | |
1579 PS_WAIT_FOR_PSPOLL_DATA | | 1581 PS_WAIT_FOR_PSPOLL_DATA | |
1580 PS_WAIT_FOR_TX_ACK); | 1582 PS_WAIT_FOR_TX_ACK); |
1581 if (ah->imask & ATH9K_INT_TIM_TIMER) { | 1583 if (ah->imask & ATH9K_INT_TIM_TIMER) { |
1582 ah->imask &= ~ATH9K_INT_TIM_TIMER; | 1584 ah->imask &= ~ATH9K_INT_TIM_TIMER; |
1583 ath9k_hw_set_interrupts(sc->sc_ah, | 1585 ath9k_hw_set_interrupts(sc->sc_ah, |
1584 ah->imask); | 1586 ah->imask); |
1585 } | 1587 } |
1586 } | 1588 } |
1587 } | 1589 } |
| 1590 spin_unlock_irqrestore(&sc->sc_pm_lock, flags); |
1588 } | 1591 } |
1589 | 1592 |
1590 if (changed & IEEE80211_CONF_CHANGE_MONITOR) { | 1593 if (changed & IEEE80211_CONF_CHANGE_MONITOR) { |
1591 if (conf->flags & IEEE80211_CONF_MONITOR) { | 1594 if (conf->flags & IEEE80211_CONF_MONITOR) { |
1592 ath_print(common, ATH_DBG_CONFIG, | 1595 ath_print(common, ATH_DBG_CONFIG, |
1593 "HW opmode set to Monitor mode\n"); | 1596 "HW opmode set to Monitor mode\n"); |
1594 sc->sc_ah->opmode = NL80211_IFTYPE_MONITOR; | 1597 sc->sc_ah->opmode = NL80211_IFTYPE_MONITOR; |
1595 } | 1598 } |
1596 } | 1599 } |
1597 | 1600 |
(...skipping 481 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2079 .get_tsf = ath9k_get_tsf, | 2082 .get_tsf = ath9k_get_tsf, |
2080 .set_tsf = ath9k_set_tsf, | 2083 .set_tsf = ath9k_set_tsf, |
2081 .reset_tsf = ath9k_reset_tsf, | 2084 .reset_tsf = ath9k_reset_tsf, |
2082 .ampdu_action = ath9k_ampdu_action, | 2085 .ampdu_action = ath9k_ampdu_action, |
2083 .get_survey = ath9k_get_survey, | 2086 .get_survey = ath9k_get_survey, |
2084 .sw_scan_start = ath9k_sw_scan_start, | 2087 .sw_scan_start = ath9k_sw_scan_start, |
2085 .sw_scan_complete = ath9k_sw_scan_complete, | 2088 .sw_scan_complete = ath9k_sw_scan_complete, |
2086 .rfkill_poll = ath9k_rfkill_poll_state, | 2089 .rfkill_poll = ath9k_rfkill_poll_state, |
2087 .set_coverage_class = ath9k_set_coverage_class, | 2090 .set_coverage_class = ath9k_set_coverage_class, |
2088 }; | 2091 }; |
OLD | NEW |