Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 314040
b: refs/heads/master
c: 781b14a
h: refs/heads/master
v: v3
  • Loading branch information
Sujith Manoharan authored and John W. Linville committed Jun 6, 2012
1 parent 857aa96 commit cafc9c8
Show file tree
Hide file tree
Showing 10 changed files with 53 additions and 51 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 8da07830e10a91cbe7badf9767230aafdd520b9c
refs/heads/master: 781b14a3153a722fec820374271316537881076e
2 changes: 1 addition & 1 deletion trunk/drivers/net/wireless/ath/ath9k/ahb.c
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ static int ath_ahb_probe(struct platform_device *pdev)
sc->irq = irq;

/* Will be cleared in ath9k_start() */
sc->sc_flags |= SC_OP_INVALID;
set_bit(SC_OP_INVALID, &sc->sc_flags);

ret = request_irq(irq, ath_isr, IRQF_SHARED, "ath9k", sc);
if (ret) {
Expand Down
16 changes: 9 additions & 7 deletions trunk/drivers/net/wireless/ath/ath9k/ath9k.h
Original file line number Diff line number Diff line change
Expand Up @@ -604,12 +604,14 @@ void ath_ant_comb_update(struct ath_softc *sc);
#define ATH_TXPOWER_MAX 100 /* .5 dBm units */
#define ATH_RATE_DUMMY_MARKER 0

#define SC_OP_INVALID BIT(0)
#define SC_OP_BEACONS BIT(1)
#define SC_OP_RXFLUSH BIT(2)
#define SC_OP_TSF_RESET BIT(3)
#define SC_OP_ANI_RUN BIT(4)
#define SC_OP_PRIM_STA_VIF BIT(5)
enum sc_op_flags {
SC_OP_INVALID,
SC_OP_BEACONS,
SC_OP_RXFLUSH,
SC_OP_TSF_RESET,
SC_OP_ANI_RUN,
SC_OP_PRIM_STA_VIF,
};

/* Powersave flags */
#define PS_WAIT_FOR_BEACON BIT(0)
Expand Down Expand Up @@ -655,9 +657,9 @@ struct ath_softc {
struct completion paprd_complete;

unsigned int hw_busy_count;
unsigned long sc_flags;

u32 intrstatus;
u32 sc_flags; /* SC_OP_* */
u16 ps_flags; /* PS_* */
u16 curtxpow;
bool ps_enabled;
Expand Down
18 changes: 9 additions & 9 deletions trunk/drivers/net/wireless/ath/ath9k/beacon.c
Original file line number Diff line number Diff line change
Expand Up @@ -390,7 +390,7 @@ void ath_beacon_tasklet(unsigned long data)
} else if (sc->beacon.bmisscnt >= BSTUCK_THRESH) {
ath_dbg(common, BSTUCK, "beacon is officially stuck\n");
sc->beacon.bmisscnt = 0;
sc->sc_flags |= SC_OP_TSF_RESET;
set_bit(SC_OP_TSF_RESET, &sc->sc_flags);
ieee80211_queue_work(sc->hw, &sc->hw_reset_work);
}

Expand Down Expand Up @@ -480,16 +480,16 @@ static void ath9k_beacon_init(struct ath_softc *sc,
u32 next_beacon,
u32 beacon_period)
{
if (sc->sc_flags & SC_OP_TSF_RESET) {
if (test_bit(SC_OP_TSF_RESET, &sc->sc_flags)) {
ath9k_ps_wakeup(sc);
ath9k_hw_reset_tsf(sc->sc_ah);
}

ath9k_hw_beaconinit(sc->sc_ah, next_beacon, beacon_period);

if (sc->sc_flags & SC_OP_TSF_RESET) {
if (test_bit(SC_OP_TSF_RESET, &sc->sc_flags)) {
ath9k_ps_restore(sc);
sc->sc_flags &= ~SC_OP_TSF_RESET;
clear_bit(SC_OP_TSF_RESET, &sc->sc_flags);
}
}

Expand Down Expand Up @@ -519,7 +519,7 @@ static void ath_beacon_config_ap(struct ath_softc *sc,
/* Set the computed AP beacon timers */

ath9k_hw_disable_interrupts(ah);
sc->sc_flags |= SC_OP_TSF_RESET;
set_bit(SC_OP_TSF_RESET, &sc->sc_flags);
ath9k_beacon_init(sc, nexttbtt, intval);
sc->beacon.bmisscnt = 0;
ath9k_hw_set_interrupts(ah);
Expand Down Expand Up @@ -662,7 +662,7 @@ static void ath_beacon_config_adhoc(struct ath_softc *sc,
u32 tsf, intval, nexttbtt;

ath9k_reset_beacon_status(sc);
if (!(sc->sc_flags & SC_OP_BEACONS))
if (!test_bit(SC_OP_BEACONS, &sc->sc_flags))
ath9k_hw_settsf64(ah, sc->beacon.bc_tstamp);

intval = TU_TO_USEC(conf->beacon_interval);
Expand Down Expand Up @@ -727,7 +727,7 @@ static bool ath9k_allow_beacon_config(struct ath_softc *sc,
*/
if ((sc->sc_ah->opmode == NL80211_IFTYPE_STATION) &&
(vif->type == NL80211_IFTYPE_STATION) &&
(sc->sc_flags & SC_OP_BEACONS) &&
test_bit(SC_OP_BEACONS, &sc->sc_flags) &&
!avp->primary_sta_vif) {
ath_dbg(common, CONFIG,
"Beacon already configured for a station interface\n");
Expand Down Expand Up @@ -813,15 +813,15 @@ void ath_set_beacon(struct ath_softc *sc)
return;
}

sc->sc_flags |= SC_OP_BEACONS;
set_bit(SC_OP_BEACONS, &sc->sc_flags);
}

void ath9k_set_beaconing_status(struct ath_softc *sc, bool status)
{
struct ath_hw *ah = sc->sc_ah;

if (!ath_has_valid_bslot(sc)) {
sc->sc_flags &= ~SC_OP_BEACONS;
clear_bit(SC_OP_BEACONS, &sc->sc_flags);
return;
}

Expand Down
6 changes: 3 additions & 3 deletions trunk/drivers/net/wireless/ath/ath9k/debug.c
Original file line number Diff line number Diff line change
Expand Up @@ -205,10 +205,10 @@ static ssize_t write_file_disable_ani(struct file *file,
common->disable_ani = !!disable_ani;

if (disable_ani) {
sc->sc_flags &= ~SC_OP_ANI_RUN;
clear_bit(SC_OP_ANI_RUN, &sc->sc_flags);
del_timer_sync(&common->ani.timer);
} else {
sc->sc_flags |= SC_OP_ANI_RUN;
set_bit(SC_OP_ANI_RUN, &sc->sc_flags);
ath_start_ani(common);
}

Expand Down Expand Up @@ -1321,7 +1321,7 @@ static int open_file_bb_mac_samps(struct inode *inode, struct file *file)
u8 chainmask = (ah->rxchainmask << 3) | ah->rxchainmask;
u8 nread;

if (sc->sc_flags & SC_OP_INVALID)
if (test_bit(SC_OP_INVALID, &sc->sc_flags))
return -EAGAIN;

buf = vmalloc(size);
Expand Down
4 changes: 2 additions & 2 deletions trunk/drivers/net/wireless/ath/ath9k/link.c
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ void ath_start_rx_poll(struct ath_softc *sc, u8 nbeacon)
if (!AR_SREV_9300(sc->sc_ah))
return;

if (!(sc->sc_flags & SC_OP_PRIM_STA_VIF))
if (!test_bit(SC_OP_PRIM_STA_VIF, &sc->sc_flags))
return;

mod_timer(&sc->rx_poll_timer, jiffies + msecs_to_jiffies
Expand Down Expand Up @@ -430,7 +430,7 @@ void ath_start_ani(struct ath_common *common)
unsigned long timestamp = jiffies_to_msecs(jiffies);
struct ath_softc *sc = (struct ath_softc *) common->priv;

if (!(sc->sc_flags & SC_OP_ANI_RUN))
if (!test_bit(SC_OP_ANI_RUN, &sc->sc_flags))
return;

if (sc->hw->conf.flags & IEEE80211_CONF_OFFCHANNEL)
Expand Down
42 changes: 21 additions & 21 deletions trunk/drivers/net/wireless/ath/ath9k/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ static bool ath_complete_reset(struct ath_softc *sc, bool start)
ath9k_hw_enable_interrupts(ah);

if (!(sc->hw->conf.flags & IEEE80211_CONF_OFFCHANNEL) && start) {
if (sc->sc_flags & SC_OP_BEACONS)
if (test_bit(SC_OP_BEACONS, &sc->sc_flags))
ath_set_beacon(sc);

ath_restart_work(sc);
Expand Down Expand Up @@ -293,7 +293,7 @@ static int ath_set_channel(struct ath_softc *sc, struct ieee80211_hw *hw,
{
int r;

if (sc->sc_flags & SC_OP_INVALID)
if (test_bit(SC_OP_INVALID, &sc->sc_flags))
return -EIO;

r = ath_reset_internal(sc, hchan, false);
Expand Down Expand Up @@ -435,7 +435,7 @@ irqreturn_t ath_isr(int irq, void *dev)
* touch anything. Note this can happen early
* on if the IRQ is shared.
*/
if (sc->sc_flags & SC_OP_INVALID)
if (test_bit(SC_OP_INVALID, &sc->sc_flags))
return IRQ_NONE;


Expand Down Expand Up @@ -635,7 +635,7 @@ static int ath9k_start(struct ieee80211_hw *hw)

ath_mci_enable(sc);

sc->sc_flags &= ~SC_OP_INVALID;
clear_bit(SC_OP_INVALID, &sc->sc_flags);
sc->sc_ah->is_monitoring = false;

if (!ath_complete_reset(sc, false)) {
Expand Down Expand Up @@ -754,7 +754,7 @@ static void ath9k_stop(struct ieee80211_hw *hw)
ath_cancel_work(sc);
del_timer_sync(&sc->rx_poll_timer);

if (sc->sc_flags & SC_OP_INVALID) {
if (test_bit(SC_OP_INVALID, &sc->sc_flags)) {
ath_dbg(common, ANY, "Device not present\n");
mutex_unlock(&sc->mutex);
return;
Expand Down Expand Up @@ -811,7 +811,7 @@ static void ath9k_stop(struct ieee80211_hw *hw)

ath9k_ps_restore(sc);

sc->sc_flags |= SC_OP_INVALID;
set_bit(SC_OP_INVALID, &sc->sc_flags);
sc->ps_idle = prev_idle;

mutex_unlock(&sc->mutex);
Expand Down Expand Up @@ -915,11 +915,11 @@ static void ath9k_calculate_summary_state(struct ieee80211_hw *hw,
/* Set op-mode & TSF */
if (iter_data.naps > 0) {
ath9k_hw_set_tsfadjust(ah, 1);
sc->sc_flags |= SC_OP_TSF_RESET;
set_bit(SC_OP_TSF_RESET, &sc->sc_flags);
ah->opmode = NL80211_IFTYPE_AP;
} else {
ath9k_hw_set_tsfadjust(ah, 0);
sc->sc_flags &= ~SC_OP_TSF_RESET;
clear_bit(SC_OP_TSF_RESET, &sc->sc_flags);

if (iter_data.nmeshes)
ah->opmode = NL80211_IFTYPE_MESH_POINT;
Expand Down Expand Up @@ -950,12 +950,12 @@ static void ath9k_calculate_summary_state(struct ieee80211_hw *hw,
sc->sc_ah->stats.avgbrssi = ATH_RSSI_DUMMY_MARKER;

if (!common->disable_ani) {
sc->sc_flags |= SC_OP_ANI_RUN;
set_bit(SC_OP_ANI_RUN, &sc->sc_flags);
ath_start_ani(common);
}

} else {
sc->sc_flags &= ~SC_OP_ANI_RUN;
clear_bit(SC_OP_ANI_RUN, &sc->sc_flags);
del_timer_sync(&common->ani.timer);
}
}
Expand Down Expand Up @@ -1479,11 +1479,11 @@ static void ath9k_bss_iter(void *data, u8 *mac, struct ieee80211_vif *vif)
* Skip iteration if primary station vif's bss info
* was not changed
*/
if (sc->sc_flags & SC_OP_PRIM_STA_VIF)
if (test_bit(SC_OP_PRIM_STA_VIF, &sc->sc_flags))
return;

if (bss_conf->assoc) {
sc->sc_flags |= SC_OP_PRIM_STA_VIF;
set_bit(SC_OP_PRIM_STA_VIF, &sc->sc_flags);
avp->primary_sta_vif = true;
memcpy(common->curbssid, bss_conf->bssid, ETH_ALEN);
common->curaid = bss_conf->aid;
Expand All @@ -1504,7 +1504,7 @@ static void ath9k_bss_iter(void *data, u8 *mac, struct ieee80211_vif *vif)
ath_start_rx_poll(sc, 3);

if (!common->disable_ani) {
sc->sc_flags |= SC_OP_ANI_RUN;
set_bit(SC_OP_ANI_RUN, &sc->sc_flags);
ath_start_ani(common);
}

Expand All @@ -1524,7 +1524,8 @@ static void ath9k_config_bss(struct ath_softc *sc, struct ieee80211_vif *vif)
if (avp->primary_sta_vif && !bss_conf->assoc) {
ath_dbg(common, CONFIG, "Bss Info DISASSOC %d, bssid %pM\n",
common->curaid, common->curbssid);
sc->sc_flags &= ~(SC_OP_PRIM_STA_VIF | SC_OP_BEACONS);
clear_bit(SC_OP_PRIM_STA_VIF, &sc->sc_flags);
clear_bit(SC_OP_BEACONS, &sc->sc_flags);
avp->primary_sta_vif = false;
memset(common->curbssid, 0, ETH_ALEN);
common->curaid = 0;
Expand All @@ -1537,10 +1538,9 @@ static void ath9k_config_bss(struct ath_softc *sc, struct ieee80211_vif *vif)
* None of station vifs are associated.
* Clear bssid & aid
*/
if (!(sc->sc_flags & SC_OP_PRIM_STA_VIF)) {
if (!test_bit(SC_OP_PRIM_STA_VIF, &sc->sc_flags)) {
ath9k_hw_write_associd(sc->sc_ah);
/* Stop ANI */
sc->sc_flags &= ~SC_OP_ANI_RUN;
clear_bit(SC_OP_ANI_RUN, &sc->sc_flags);
del_timer_sync(&common->ani.timer);
del_timer_sync(&sc->rx_poll_timer);
memset(&sc->caldata, 0, sizeof(sc->caldata));
Expand Down Expand Up @@ -1578,12 +1578,12 @@ static void ath9k_bss_info_changed(struct ieee80211_hw *hw,
sc->sc_ah->stats.avgbrssi = ATH_RSSI_DUMMY_MARKER;

if (!common->disable_ani) {
sc->sc_flags |= SC_OP_ANI_RUN;
set_bit(SC_OP_ANI_RUN, &sc->sc_flags);
ath_start_ani(common);
}

} else {
sc->sc_flags &= ~SC_OP_ANI_RUN;
clear_bit(SC_OP_ANI_RUN, &sc->sc_flags);
del_timer_sync(&common->ani.timer);
del_timer_sync(&sc->rx_poll_timer);
}
Expand All @@ -1595,7 +1595,7 @@ static void ath9k_bss_info_changed(struct ieee80211_hw *hw,
*/
if ((changed & BSS_CHANGED_BEACON_INT) &&
(vif->type == NL80211_IFTYPE_AP))
sc->sc_flags |= SC_OP_TSF_RESET;
set_bit(SC_OP_TSF_RESET, &sc->sc_flags);

/* Configure beaconing (AP, IBSS, MESH) */
if (ath9k_uses_beacons(vif->type) &&
Expand Down Expand Up @@ -1787,7 +1787,7 @@ static void ath9k_flush(struct ieee80211_hw *hw, bool drop)
return;
}

if (sc->sc_flags & SC_OP_INVALID) {
if (test_bit(SC_OP_INVALID, &sc->sc_flags)) {
ath_dbg(common, ANY, "Device not present\n");
mutex_unlock(&sc->mutex);
return;
Expand Down
2 changes: 1 addition & 1 deletion trunk/drivers/net/wireless/ath/ath9k/pci.c
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ static int ath_pci_probe(struct pci_dev *pdev, const struct pci_device_id *id)
sc->mem = mem;

/* Will be cleared in ath9k_start() */
sc->sc_flags |= SC_OP_INVALID;
set_bit(SC_OP_INVALID, &sc->sc_flags);

ret = request_irq(pdev->irq, ath_isr, IRQF_SHARED, "ath9k", sc);
if (ret) {
Expand Down
10 changes: 5 additions & 5 deletions trunk/drivers/net/wireless/ath/ath9k/recv.c
Original file line number Diff line number Diff line change
Expand Up @@ -285,8 +285,8 @@ int ath_rx_init(struct ath_softc *sc, int nbufs)
int error = 0;

spin_lock_init(&sc->sc_pcu_lock);
sc->sc_flags &= ~SC_OP_RXFLUSH;
spin_lock_init(&sc->rx.rxbuflock);
clear_bit(SC_OP_RXFLUSH, &sc->sc_flags);

common->rx_bufsize = IEEE80211_MAX_MPDU_LEN / 2 +
sc->sc_ah->caps.rx_status_len;
Expand Down Expand Up @@ -498,11 +498,11 @@ bool ath_stoprecv(struct ath_softc *sc)

void ath_flushrecv(struct ath_softc *sc)
{
sc->sc_flags |= SC_OP_RXFLUSH;
set_bit(SC_OP_RXFLUSH, &sc->sc_flags);
if (sc->sc_ah->caps.hw_caps & ATH9K_HW_CAP_EDMA)
ath_rx_tasklet(sc, 1, true);
ath_rx_tasklet(sc, 1, false);
sc->sc_flags &= ~SC_OP_RXFLUSH;
clear_bit(SC_OP_RXFLUSH, &sc->sc_flags);
}

static bool ath_beacon_dtim_pending_cab(struct sk_buff *skb)
Expand Down Expand Up @@ -1063,7 +1063,7 @@ int ath_rx_tasklet(struct ath_softc *sc, int flush, bool hp)

do {
/* If handling rx interrupt and flush is in progress => exit */
if ((sc->sc_flags & SC_OP_RXFLUSH) && (flush == 0))
if (test_bit(SC_OP_RXFLUSH, &sc->sc_flags) && (flush == 0))
break;

memset(&rs, 0, sizeof(rs));
Expand Down Expand Up @@ -1108,7 +1108,7 @@ int ath_rx_tasklet(struct ath_softc *sc, int flush, bool hp)
* If we're asked to flush receive queue, directly
* chain it back at the queue without processing it.
*/
if (sc->sc_flags & SC_OP_RXFLUSH) {
if (test_bit(SC_OP_RXFLUSH, &sc->sc_flags)) {
RX_STAT_INC(rx_drop_rxflush);
goto requeue_drop_frag;
}
Expand Down
2 changes: 1 addition & 1 deletion trunk/drivers/net/wireless/ath/ath9k/xmit.c
Original file line number Diff line number Diff line change
Expand Up @@ -1536,7 +1536,7 @@ bool ath_drain_all_txq(struct ath_softc *sc, bool retry_tx)
int i;
u32 npend = 0;

if (sc->sc_flags & SC_OP_INVALID)
if (test_bit(SC_OP_INVALID, &sc->sc_flags))
return true;

ath9k_hw_abort_tx_dma(ah);
Expand Down

0 comments on commit cafc9c8

Please sign in to comment.