Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 111269
b: refs/heads/master
c: 672840a
h: refs/heads/master
i:
  111267: 8e08c59
v: v3
  • Loading branch information
Sujith authored and John W. Linville committed Aug 29, 2008
1 parent 233bc19 commit 86bff01
Show file tree
Hide file tree
Showing 8 changed files with 67 additions and 63 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: b4696c8b9233bea812b972a5e79c5db7ecf13867
refs/heads/master: 672840ac04f79f499b60b9f0eb41799c837db4eb
4 changes: 2 additions & 2 deletions trunk/drivers/net/wireless/ath9k/beacon.c
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ static void ath_beacon_setup(struct ath_softc *sc,
rix = 0;
rt = sc->sc_currates;
rate = rt->info[rix].rateCode;
if (sc->sc_flags & ATH_PREAMBLE_SHORT)
if (sc->sc_flags & SC_OP_PREAMBLE_SHORT)
rate |= rt->info[rix].shortPreamble;

ath9k_hw_set11n_txdesc(ah, ds
Expand Down Expand Up @@ -975,5 +975,5 @@ void ath_beacon_sync(struct ath_softc *sc, int if_id)
* beacon frame we just received.
*/
ath_beacon_config(sc, if_id);
sc->sc_beacons = 1;
sc->sc_flags |= SC_OP_BEACONS;
}
45 changes: 23 additions & 22 deletions trunk/drivers/net/wireless/ath9k/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -272,8 +272,8 @@ static int ath_stop(struct ath_softc *sc)
{
struct ath_hal *ah = sc->sc_ah;

DPRINTF(sc, ATH_DBG_CONFIG, "%s: invalid %u\n",
__func__, sc->sc_invalid);
DPRINTF(sc, ATH_DBG_CONFIG, "%s: invalid %ld\n",
__func__, sc->sc_flags & SC_OP_INVALID);

/*
* Shutdown the hardware and driver:
Expand All @@ -291,10 +291,10 @@ static int ath_stop(struct ath_softc *sc)
* hardware is gone (invalid).
*/

if (!sc->sc_invalid)
if (!(sc->sc_flags & SC_OP_INVALID))
ath9k_hw_set_interrupts(ah, 0);
ath_draintxq(sc, false);
if (!sc->sc_invalid) {
if (!(sc->sc_flags & SC_OP_INVALID)) {
ath_stoprecv(sc);
ath9k_hw_phy_disable(ah);
} else
Expand All @@ -316,7 +316,7 @@ int ath_set_channel(struct ath_softc *sc, struct ath9k_channel *hchan)
bool fastcc = true, stopped;
enum ath9k_ht_macmode ht_macmode;

if (sc->sc_invalid) /* if the device is invalid or removed */
if (sc->sc_flags & SC_OP_INVALID) /* the device is invalid or removed */
return -EIO;

DPRINTF(sc, ATH_DBG_CONFIG,
Expand All @@ -332,7 +332,8 @@ int ath_set_channel(struct ath_softc *sc, struct ath9k_channel *hchan)

if (hchan->channel != sc->sc_curchan.channel ||
hchan->channelFlags != sc->sc_curchan.channelFlags ||
sc->sc_update_chainmask || sc->sc_full_reset) {
(sc->sc_flags & SC_OP_CHAINMASK_UPDATE) ||
(sc->sc_flags & SC_OP_FULL_RESET)) {
int status;
/*
* This is only performed if the channel settings have
Expand All @@ -351,7 +352,7 @@ int ath_set_channel(struct ath_softc *sc, struct ath9k_channel *hchan)
* to flush data frames already in queue because of
* changing channel. */

if (!stopped || sc->sc_full_reset)
if (!stopped || (sc->sc_flags & SC_OP_FULL_RESET))
fastcc = false;

spin_lock_bh(&sc->sc_resetlock);
Expand All @@ -372,8 +373,8 @@ int ath_set_channel(struct ath_softc *sc, struct ath9k_channel *hchan)
spin_unlock_bh(&sc->sc_resetlock);

sc->sc_curchan = *hchan;
sc->sc_update_chainmask = 0;
sc->sc_full_reset = 0;
sc->sc_flags &= ~SC_OP_CHAINMASK_UPDATE;
sc->sc_flags &= ~SC_OP_FULL_RESET;

/* Re-enable rx framework */
if (ath_startrecv(sc) != 0) {
Expand Down Expand Up @@ -484,7 +485,7 @@ int ath_chainmask_sel_logic(struct ath_softc *sc, struct ath_node *an)

void ath_update_chainmask(struct ath_softc *sc, int is_ht)
{
sc->sc_update_chainmask = 1;
sc->sc_flags |= SC_OP_CHAINMASK_UPDATE;
if (is_ht) {
sc->sc_tx_chainmask = sc->sc_ah->ah_caps.tx_chainmask;
sc->sc_rx_chainmask = sc->sc_ah->ah_caps.rx_chainmask;
Expand Down Expand Up @@ -553,7 +554,7 @@ int ath_vap_listen(struct ath_softc *sc, int if_id)
sc->sc_imask & ~(ATH9K_INT_SWBA | ATH9K_INT_BMISS));
sc->sc_imask &= ~(ATH9K_INT_SWBA | ATH9K_INT_BMISS);
/* need to reconfigure the beacons when it moves to RUN */
sc->sc_beacons = 0;
sc->sc_flags &= ~SC_OP_BEACONS;

return 0;
}
Expand Down Expand Up @@ -773,7 +774,7 @@ int ath_open(struct ath_softc *sc, struct ath9k_channel *initial_chan)

/* XXX: we must make sure h/w is ready and clear invalid flag
* before turning on interrupt. */
sc->sc_invalid = 0;
sc->sc_flags &= ~SC_OP_INVALID;
done:
return error;
}
Expand Down Expand Up @@ -816,7 +817,7 @@ int ath_reset(struct ath_softc *sc, bool retry_tx)

ath_update_txpow(sc);

if (sc->sc_beacons)
if (sc->sc_flags & SC_OP_BEACONS)
ath_beacon_config(sc, ATH_IF_ID_ANY); /* restart beacons */

ath9k_hw_set_interrupts(ah, sc->sc_imask);
Expand All @@ -841,15 +842,15 @@ int ath_suspend(struct ath_softc *sc)
struct ath_hal *ah = sc->sc_ah;

/* No I/O if device has been surprise removed */
if (sc->sc_invalid)
if (sc->sc_flags & SC_OP_INVALID)
return -EIO;

/* Shut off the interrupt before setting sc->sc_invalid to '1' */
ath9k_hw_set_interrupts(ah, 0);

/* XXX: we must make sure h/w will not generate any interrupt
* before setting the invalid flag. */
sc->sc_invalid = 1;
sc->sc_flags |= SC_OP_INVALID;

/* disable HAL and put h/w to sleep */
ath9k_hw_disable(sc->sc_ah);
Expand All @@ -870,7 +871,7 @@ irqreturn_t ath_isr(int irq, void *dev)
bool sched = false;

do {
if (sc->sc_invalid) {
if (sc->sc_flags & SC_OP_INVALID) {
/*
* The hardware is not ready/present, don't
* touch anything. Note this can happen early
Expand Down Expand Up @@ -1026,7 +1027,7 @@ int ath_init(u16 devid, struct ath_softc *sc)
u32 rd;

/* XXX: hardware will not be ready until ath_open() being called */
sc->sc_invalid = 1;
sc->sc_flags |= SC_OP_INVALID;

sc->sc_debug = DBG_DEFAULT;
DPRINTF(sc, ATH_DBG_CONFIG, "%s: devid 0x%x\n", __func__, devid);
Expand Down Expand Up @@ -1210,8 +1211,8 @@ int ath_init(u16 devid, struct ath_softc *sc)

/* 11n Capabilities */
if (ah->ah_caps.hw_caps & ATH9K_HW_CAP_HT) {
sc->sc_txaggr = 1;
sc->sc_rxaggr = 1;
sc->sc_flags |= SC_OP_TXAGGR;
sc->sc_flags |= SC_OP_RXAGGR;
}

sc->sc_tx_chainmask = ah->ah_caps.tx_chainmask;
Expand Down Expand Up @@ -1267,7 +1268,7 @@ void ath_deinit(struct ath_softc *sc)
DPRINTF(sc, ATH_DBG_CONFIG, "%s\n", __func__);

ath_stop(sc);
if (!sc->sc_invalid)
if (!(sc->sc_flags & SC_OP_INVALID))
ath9k_hw_setpower(sc->sc_ah, ATH9K_PM_AWAKE);
ath_rate_detach(sc->sc_rc);
/* cleanup tx queues */
Expand Down Expand Up @@ -1394,9 +1395,9 @@ void ath_newassoc(struct ath_softc *sc,
/* if station reassociates, tear down the aggregation state. */
if (!isnew) {
for (tidno = 0; tidno < WME_NUM_TID; tidno++) {
if (sc->sc_txaggr)
if (sc->sc_flags & SC_OP_TXAGGR)
ath_tx_aggr_teardown(sc, an, tidno);
if (sc->sc_rxaggr)
if (sc->sc_flags & SC_OP_RXAGGR)
ath_rx_aggr_teardown(sc, an, tidno);
}
}
Expand Down
24 changes: 13 additions & 11 deletions trunk/drivers/net/wireless/ath9k/core.h
Original file line number Diff line number Diff line change
Expand Up @@ -830,8 +830,6 @@ void ath_setdefantenna(void *sc, u32 antenna);
#define ATH_DEFAULT_NOISE_FLOOR -95
#define ATH_REGCLASSIDS_MAX 10
#define ATH_CABQ_READY_TIME 80 /* % of beacon interval */
#define ATH_PREAMBLE_SHORT (1<<0)
#define ATH_PROTECT_ENABLE (1<<1)
#define ATH_MAX_SW_RETRIES 10
#define ATH_CHAN_MAX 255
#define IEEE80211_WEP_NKID 4 /* number of key ids */
Expand Down Expand Up @@ -892,25 +890,30 @@ struct ath_ht_info {
u8 ext_chan_offset;
};

#define SC_OP_INVALID BIT(0)
#define SC_OP_BEACONS BIT(1)
#define SC_OP_RXAGGR BIT(2)
#define SC_OP_TXAGGR BIT(3)
#define SC_OP_CHAINMASK_UPDATE BIT(4)
#define SC_OP_FULL_RESET BIT(5)
#define SC_OP_PREAMBLE_SHORT BIT(6)
#define SC_OP_PROTECT_ENABLE BIT(7)

struct ath_softc {
struct ieee80211_hw *hw;
struct pci_dev *pdev;
struct tasklet_struct intr_tq;
struct tasklet_struct bcon_tasklet;
struct ath_config sc_config; /* load-time parameters */
struct ath_config sc_config;
struct ath_hal *sc_ah;
struct ath_rate_softc *sc_rc; /* tx rate control support */
struct ath_rate_softc *sc_rc;
void __iomem *mem;

int sc_debug;
u32 sc_intrstatus;
u32 sc_flags; /* SC_OP_* */
unsigned int rx_filter;
u8 sc_invalid; /* being detached */
u8 sc_beacons; /* beacons running */
u8 sc_txaggr; /* enable 11n tx aggregation */
u8 sc_rxaggr; /* enable 11n rx aggregation */
u8 sc_update_chainmask; /* change chain mask */
u8 sc_full_reset; /* force full reset */

enum wireless_mode sc_curmode; /* current phy mode */
u16 sc_curtxpow;
u16 sc_curaid;
Expand Down Expand Up @@ -944,7 +947,6 @@ struct ath_softc {
u8 sc_rxchaindetect_delta5GHz;
u8 sc_rxchaindetect_delta2GHz;
u32 sc_rtsaggrlimit; /* Chipset specific aggr limit */
u32 sc_flags;
#ifdef CONFIG_SLOW_ANT_DIV
struct ath_antdiv sc_antdiv;
#endif
Expand Down
14 changes: 7 additions & 7 deletions trunk/drivers/net/wireless/ath9k/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -481,7 +481,7 @@ static void ath9k_remove_interface(struct ieee80211_hw *hw,
/* Set interrupt mask */
sc->sc_imask &= ~(ATH9K_INT_SWBA | ATH9K_INT_BMISS);
ath9k_hw_set_interrupts(sc->sc_ah, sc->sc_imask & ~ATH9K_INT_GLOBAL);
sc->sc_beacons = 0;
sc->sc_flags &= ~SC_OP_BEACONS;

error = ath_vap_detach(sc, 0);
if (error)
Expand Down Expand Up @@ -582,7 +582,7 @@ static int ath9k_config_interface(struct ieee80211_hw *hw,
print_mac(mac, sc->sc_curbssid), sc->sc_curaid);

/* need to reconfigure the beacon */
sc->sc_beacons = 0;
sc->sc_flags &= ~SC_OP_BEACONS ;

break;
default:
Expand Down Expand Up @@ -833,7 +833,7 @@ static void ath9k_bss_assoc_info(struct ath_softc *sc,

/* Configure the beacon */
ath_beacon_config(sc, 0);
sc->sc_beacons = 1;
sc->sc_flags |= SC_OP_BEACONS;

/* Reset rssi stats */
sc->sc_halstats.ns_avgbrssi = ATH_RSSI_DUMMY_MARKER;
Expand Down Expand Up @@ -896,9 +896,9 @@ static void ath9k_bss_info_changed(struct ieee80211_hw *hw,
__func__,
bss_conf->use_short_preamble);
if (bss_conf->use_short_preamble)
sc->sc_flags |= ATH_PREAMBLE_SHORT;
sc->sc_flags |= SC_OP_PREAMBLE_SHORT;
else
sc->sc_flags &= ~ATH_PREAMBLE_SHORT;
sc->sc_flags &= ~SC_OP_PREAMBLE_SHORT;
}

if (changed & BSS_CHANGED_ERP_CTS_PROT) {
Expand All @@ -907,9 +907,9 @@ static void ath9k_bss_info_changed(struct ieee80211_hw *hw,
bss_conf->use_cts_prot);
if (bss_conf->use_cts_prot &&
hw->conf.channel->band != IEEE80211_BAND_5GHZ)
sc->sc_flags |= ATH_PROTECT_ENABLE;
sc->sc_flags |= SC_OP_PROTECT_ENABLE;
else
sc->sc_flags &= ~ATH_PROTECT_ENABLE;
sc->sc_flags &= ~SC_OP_PROTECT_ENABLE;
}

if (changed & BSS_CHANGED_HT) {
Expand Down
2 changes: 1 addition & 1 deletion trunk/drivers/net/wireless/ath9k/rc.c
Original file line number Diff line number Diff line change
Expand Up @@ -1903,7 +1903,7 @@ static void ath_tx_aggr_resp(struct ath_softc *sc,
int state;
DECLARE_MAC_BUF(mac);

if (!sc->sc_txaggr)
if (!(sc->sc_flags & SC_OP_TXAGGR))
return;

txtid = ATH_AN_2_TID(an, tidno);
Expand Down
8 changes: 4 additions & 4 deletions trunk/drivers/net/wireless/ath9k/recv.c
Original file line number Diff line number Diff line change
Expand Up @@ -724,7 +724,7 @@ int ath_rx_input(struct ath_softc *sc,
struct ath_recv_status *rx_status,
enum ATH_RX_TYPE *status)
{
if (is_ampdu && sc->sc_rxaggr) {
if (is_ampdu && (sc->sc_flags & SC_OP_RXAGGR)) {
*status = ATH_RX_CONSUMED;
return ath_ampdu_input(sc, an, skb, rx_status);
} else {
Expand Down Expand Up @@ -1132,7 +1132,7 @@ int ath_rx_aggr_start(struct ath_softc *sc,
rxtid = &an->an_aggr.rx.tid[tid];

spin_lock_bh(&rxtid->tidlock);
if (sc->sc_rxaggr) {
if (sc->sc_flags & SC_OP_RXAGGR) {
/* Allow aggregation reception
* Adjust rx BA window size. Peer might indicate a
* zero buffer size for a _dont_care_ condition.
Expand Down Expand Up @@ -1232,7 +1232,7 @@ void ath_rx_aggr_teardown(struct ath_softc *sc,

void ath_rx_node_init(struct ath_softc *sc, struct ath_node *an)
{
if (sc->sc_rxaggr) {
if (sc->sc_flags & SC_OP_RXAGGR) {
struct ath_arx_tid *rxtid;
int tidno;

Expand Down Expand Up @@ -1264,7 +1264,7 @@ void ath_rx_node_init(struct ath_softc *sc, struct ath_node *an)

void ath_rx_node_cleanup(struct ath_softc *sc, struct ath_node *an)
{
if (sc->sc_rxaggr) {
if (sc->sc_flags & SC_OP_RXAGGR) {
struct ath_arx_tid *rxtid;
int tidno, i;

Expand Down
Loading

0 comments on commit 86bff01

Please sign in to comment.