Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 17d7904d authored by Sujith's avatar Sujith Committed by John W. Linville
Browse files

ath9k: Remove all the sc_ prefixes



This patch removes the useless sc_ prefixes for all variables.
Also, refer to interfaces as VIFs and not as VAPs anymore.

Signed-off-by: default avatarSujith <Sujith.Manoharan@atheros.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent ee6e8d1c
Loading
Loading
Loading
Loading
+66 −78
Original line number Diff line number Diff line
@@ -104,13 +104,13 @@ enum buffer_type {
};

struct ath_buf_state {
	int bfs_nframes;		/* # frames in aggregate */
	u16 bfs_al;			/* length of aggregate */
	u16 bfs_frmlen;			/* length of frame */
	int bfs_seqno;			/* sequence number */
	int bfs_tidno;			/* tid of this frame */
	int bfs_retries;		/* current retries */
	u32 bf_type;			/* BUF_* (enum buffer_type) */
	int bfs_nframes;
	u16 bfs_al;
	u16 bfs_frmlen;
	int bfs_seqno;
	int bfs_tidno;
	int bfs_retries;
	u32 bf_type;
	u32 bfs_keyix;
	enum ath9k_key_type bfs_keytype;
};
@@ -129,10 +129,6 @@ struct ath_buf_state {
#define bf_isretried(bf)	(bf->bf_state.bf_type & BUF_RETRY)
#define bf_isxretried(bf)	(bf->bf_state.bf_type & BUF_XRETRY)

/*
 * Abstraction of a contiguous buffer to transmit/receive.  There is only
 * a single hw descriptor encapsulated here.
 */
struct ath_buf {
	struct list_head list;
	struct ath_buf *bf_lastbf;	/* last buf of this unit (a frame or
@@ -143,22 +139,20 @@ struct ath_buf {
	dma_addr_t bf_daddr;		/* physical addr of desc */
	dma_addr_t bf_buf_addr;		/* physical addr of data buffer */
	u32 bf_status;
	u16 bf_flags;			/* tx descriptor flags */
	struct ath_buf_state bf_state;	/* buffer state */
	u16 bf_flags;
	struct ath_buf_state bf_state;
	dma_addr_t bf_dmacontext;
};

#define ATH_RXBUF_RESET(_bf)    ((_bf)->bf_status = 0)
#define ATH_BUFSTATUS_STALE     0x00000002

/* DMA state for tx/rx descriptors */

struct ath_descdma {
	const char *dd_name;
	struct ath_desc *dd_desc;	/* descriptors  */
	dma_addr_t dd_desc_paddr;	/* physical addr of dd_desc  */
	u32 dd_desc_len;		/* size of dd_desc  */
	struct ath_buf *dd_bufptr;	/* associated buffers */
	struct ath_desc *dd_desc;
	dma_addr_t dd_desc_paddr;
	u32 dd_desc_len;
	struct ath_buf *dd_bufptr;
	dma_addr_t dd_dmacontext;
};

@@ -246,15 +240,15 @@ enum ATH_AGGR_STATUS {
};

struct ath_txq {
	u32 axq_qnum;			/* hardware q number */
	u32 *axq_link;			/* link ptr in last TX desc */
	struct list_head axq_q;		/* transmit queue */
	u32 axq_qnum;
	u32 *axq_link;
	struct list_head axq_q;
	spinlock_t axq_lock;
	u32 axq_depth;			/* queue depth */
	u8 axq_aggr_depth;		/* aggregates queued */
	u32 axq_totalqueued;		/* total ever queued */
	bool stopped;			/* Is mac80211 queue stopped ? */
	struct ath_buf *axq_linkbuf;	/* virtual addr of last buffer*/
	u32 axq_depth;
	u8 axq_aggr_depth;
	u32 axq_totalqueued;
	bool stopped;
	struct ath_buf *axq_linkbuf;

	/* first desc of the last descriptor that contains CTS */
	struct ath_desc *axq_lastdsWithCTS;
@@ -270,13 +264,12 @@ struct ath_txq {
#define AGGR_ADDBA_COMPLETE  BIT(2)
#define AGGR_ADDBA_PROGRESS  BIT(3)

/* per TID aggregate tx state for a destination */
struct ath_atx_tid {
	struct list_head list;		/* round-robin tid entry */
	struct list_head buf_q;		/* pending buffers */
	struct list_head list;
	struct list_head buf_q;
	struct ath_node *an;
	struct ath_atx_ac *ac;
	struct ath_buf *tx_buf[ATH_TID_MAX_BUFS]; /* active tx frames */
	struct ath_buf *tx_buf[ATH_TID_MAX_BUFS];
	u16 seq_start;
	u16 seq_next;
	u16 baw_size;
@@ -289,26 +282,21 @@ struct ath_atx_tid {
	int addba_exchangeattempts;
};

/* per access-category aggregate tx state for a destination */
struct ath_atx_ac {
	int sched;			/* dest-ac is scheduled */
	int qnum;			/* H/W queue number associated
					   with this AC */
	struct list_head list;		/* round-robin txq entry */
	struct list_head tid_q;		/* queue of TIDs with buffers */
	int sched;
	int qnum;
	struct list_head list;
	struct list_head tid_q;
};

/* per-frame tx control block */
struct ath_tx_control {
	struct ath_txq *txq;
	int if_id;
};

/* per frame tx status block */
struct ath_xmit_status {
	int retries;	/* number of retries to successufully
			   transmit this frame */
	int flags;	/* status of transmit */
	int retries;
	int flags;
#define ATH_TX_ERROR        0x01
#define ATH_TX_XRETRY       0x02
#define ATH_TX_BAR          0x04
@@ -396,21 +384,21 @@ int ath_tx_aggr_stop(struct ath_softc *sc, struct ieee80211_sta *sta, u16 tid);
void ath_tx_aggr_resume(struct ath_softc *sc, struct ieee80211_sta *sta, u16 tid);

/********/
/* VAPs */
/* VIFs */
/********/

/*
 * Define the scheme that we select MAC address for multiple
 * BSS on the same radio. The very first VAP will just use the MAC
 * address from the EEPROM. For the next 3 VAPs, we set the
 * BSS on the same radio. The very first VIF will just use the MAC
 * address from the EEPROM. For the next 3 VIFs, we set the
 * U/L bit (bit 1) in MAC address, and use the next two bits as the
 * index of the VAP.
 * index of the VIF.
 */

#define ATH_SET_VAP_BSSID_MASK(bssid_mask) \
#define ATH_SET_VIF_BSSID_MASK(bssid_mask) \
	((bssid_mask)[0] &= ~(((ATH_BCBUF-1)<<2)|0x02))

struct ath_vap {
struct ath_vif {
	int av_bslot;
	enum nl80211_iftype av_opmode;
	struct ath_buf *av_bcbuf;
@@ -469,7 +457,7 @@ void ath9k_beacon_tasklet(unsigned long data);
void ath_beacon_config(struct ath_softc *sc, int if_id);
int ath_beaconq_setup(struct ath_hal *ah);
int ath_beacon_alloc(struct ath_softc *sc, int if_id);
void ath_beacon_return(struct ath_softc *sc, struct ath_vap *avp);
void ath_beacon_return(struct ath_softc *sc, struct ath_vif *avp);
void ath_beacon_sync(struct ath_softc *sc, int if_id);

/*******/
@@ -485,12 +473,12 @@ void ath_beacon_sync(struct ath_softc *sc, int if_id);
#define ATH_RESTART_CALINTERVAL 1200000 /* 20 minutes between calibrations */

struct ath_ani {
	bool sc_caldone;
	int16_t sc_noise_floor;
	unsigned int sc_longcal_timer;
	unsigned int sc_shortcal_timer;
	unsigned int sc_resetcal_timer;
	unsigned int sc_checkani_timer;
	bool caldone;
	int16_t noise_floor;
	unsigned int longcal_timer;
	unsigned int shortcal_timer;
	unsigned int resetcal_timer;
	unsigned int checkani_timer;
	struct timer_list timer;
};

@@ -591,31 +579,31 @@ struct ath_softc {
	spinlock_t sc_resetlock;
	struct mutex mutex;

	u8 sc_curbssid[ETH_ALEN];
	u8 sc_myaddr[ETH_ALEN];
	u8 sc_bssidmask[ETH_ALEN];
	u32 sc_intrstatus;
	u8 curbssid[ETH_ALEN];
	u8 macaddr[ETH_ALEN];
	u8 bssidmask[ETH_ALEN];
	u32 intrstatus;
	u32 sc_flags; /* SC_OP_* */
	u16 sc_curtxpow;
	u16 sc_curaid;
	u16 sc_cachelsz;
	u8 sc_nbcnvaps;
	u16 sc_nvaps;
	u8 sc_tx_chainmask;
	u8 sc_rx_chainmask;
	u32 sc_keymax;
	DECLARE_BITMAP(sc_keymap, ATH_KEYMAX);
	u8 sc_splitmic;
	u16 curtxpow;
	u16 curaid;
	u16 cachelsz;
	u8 nbcnvifs;
	u16 nvifs;
	u8 tx_chainmask;
	u8 rx_chainmask;
	u32 keymax;
	DECLARE_BITMAP(keymap, ATH_KEYMAX);
	u8 splitmic;
	atomic_t ps_usecount;
	enum ath9k_int sc_imask;
	enum ath9k_ht_extprotspacing sc_ht_extprotspacing;
	enum ath9k_int imask;
	enum ath9k_ht_extprotspacing ht_extprotspacing;
	enum ath9k_ht_macmode tx_chan_width;

	struct ath_config sc_config;
	struct ath_config config;
	struct ath_rx rx;
	struct ath_tx tx;
	struct ath_beacon beacon;
	struct ieee80211_vif *sc_vaps[ATH_BCBUF];
	struct ieee80211_vif *vifs[ATH_BCBUF];
	struct ieee80211_rate rates[IEEE80211_NUM_BANDS][ATH_RATE_MAX];
	struct ath_rate_table *hw_rate_table[ATH9K_MODE_MAX];
	struct ath_rate_table *cur_rate_table;
@@ -632,10 +620,10 @@ struct ath_softc {
	int led_off_cnt;

	struct ath_rfkill rf_kill;
	struct ath_ani sc_ani;
	struct ath9k_node_stats sc_halstats;
	struct ath_ani ani;
	struct ath9k_node_stats nodestats;
#ifdef CONFIG_ATH9K_DEBUG
	struct ath9k_debug sc_debug;
	struct ath9k_debug debug;
#endif
	struct ath_bus_ops *bus_ops;
};
+28 −28
Original line number Diff line number Diff line
@@ -63,7 +63,7 @@ static void ath_bstuck_process(struct ath_softc *sc)
 *  Beacons are always sent out at the lowest rate, and are not retried.
*/
static void ath_beacon_setup(struct ath_softc *sc,
			     struct ath_vap *avp, struct ath_buf *bf)
			     struct ath_vif *avp, struct ath_buf *bf)
{
	struct sk_buff *skb = (struct sk_buff *)bf->bf_mpdu;
	struct ath_hal *ah = sc->sc_ah;
@@ -96,7 +96,7 @@ static void ath_beacon_setup(struct ath_softc *sc,
		 * SWBA's
		 * XXX assumes two antenna
		 */
		antenna = ((sc->beacon.ast_be_xmit / sc->sc_nbcnvaps) & 1 ? 2 : 1);
		antenna = ((sc->beacon.ast_be_xmit / sc->nbcnvifs) & 1 ? 2 : 1);
	}

	ds->ds_data = bf->bf_buf_addr;
@@ -132,24 +132,24 @@ static void ath_beacon_setup(struct ath_softc *sc,
	memset(series, 0, sizeof(struct ath9k_11n_rate_series) * 4);
	series[0].Tries = 1;
	series[0].Rate = rate;
	series[0].ChSel = sc->sc_tx_chainmask;
	series[0].ChSel = sc->tx_chainmask;
	series[0].RateFlags = (ctsrate) ? ATH9K_RATESERIES_RTS_CTS : 0;
	ath9k_hw_set11n_ratescenario(ah, ds, ds, 0,
		ctsrate, ctsduration, series, 4, 0);
}

/* Generate beacon frame and queue cab data for a vap */
/* Generate beacon frame and queue cab data for a VIF */
static struct ath_buf *ath_beacon_generate(struct ath_softc *sc, int if_id)
{
	struct ath_buf *bf;
	struct ath_vap *avp;
	struct ath_vif *avp;
	struct sk_buff *skb;
	struct ath_txq *cabq;
	struct ieee80211_vif *vif;
	struct ieee80211_tx_info *info;
	int cabq_depth;

	vif = sc->sc_vaps[if_id];
	vif = sc->vifs[if_id];
	ASSERT(vif);

	avp = (void *)vif->drv_priv;
@@ -204,10 +204,10 @@ static struct ath_buf *ath_beacon_generate(struct ath_softc *sc, int if_id)
	/*
	 * if the CABQ traffic from previous DTIM is pending and the current
	 *  beacon is also a DTIM.
	 *  1) if there is only one vap let the cab traffic continue.
	 *  2) if there are more than one vap and we are using staggered
	 *  1) if there is only one vif let the cab traffic continue.
	 *  2) if there are more than one vif and we are using staggered
	 *     beacons, then drain the cabq by dropping all the frames in
	 *     the cabq so that the current vaps cab traffic can be scheduled.
	 *     the cabq so that the current vifs cab traffic can be scheduled.
	 */
	spin_lock_bh(&cabq->axq_lock);
	cabq_depth = cabq->axq_depth;
@@ -219,7 +219,7 @@ static struct ath_buf *ath_beacon_generate(struct ath_softc *sc, int if_id)
		 * the lock again which is a common function and that
		 * acquires txq lock inside.
		 */
		if (sc->sc_nvaps > 1) {
		if (sc->nvifs > 1) {
			ath_draintxq(sc, cabq, false);
			DPRINTF(sc, ATH_DBG_BEACON,
				"flush previous cabq traffic\n");
@@ -250,10 +250,10 @@ static void ath_beacon_start_adhoc(struct ath_softc *sc, int if_id)
	struct ieee80211_vif *vif;
	struct ath_hal *ah = sc->sc_ah;
	struct ath_buf *bf;
	struct ath_vap *avp;
	struct ath_vif *avp;
	struct sk_buff *skb;

	vif = sc->sc_vaps[if_id];
	vif = sc->vifs[if_id];
	ASSERT(vif);

	avp = (void *)vif->drv_priv;
@@ -291,13 +291,13 @@ int ath_beaconq_setup(struct ath_hal *ah)
int ath_beacon_alloc(struct ath_softc *sc, int if_id)
{
	struct ieee80211_vif *vif;
	struct ath_vap *avp;
	struct ath_vif *avp;
	struct ieee80211_hdr *hdr;
	struct ath_buf *bf;
	struct sk_buff *skb;
	__le64 tstamp;

	vif = sc->sc_vaps[if_id];
	vif = sc->vifs[if_id];
	ASSERT(vif);

	avp = (void *)vif->drv_priv;
@@ -314,7 +314,7 @@ int ath_beacon_alloc(struct ath_softc *sc, int if_id)
		    !(sc->sc_ah->ah_caps.hw_caps & ATH9K_HW_CAP_VEOL)) {
			int slot;
			/*
			 * Assign the vap to a beacon xmit slot. As
			 * Assign the vif to a beacon xmit slot. As
			 * above, this cannot fail to find one.
			 */
			avp->av_bslot = 0;
@@ -335,7 +335,7 @@ int ath_beacon_alloc(struct ath_softc *sc, int if_id)
				}
			BUG_ON(sc->beacon.bslot[avp->av_bslot] != ATH_IF_ID_ANY);
			sc->beacon.bslot[avp->av_bslot] = if_id;
			sc->sc_nbcnvaps++;
			sc->nbcnvifs++;
		}
	}

@@ -384,8 +384,8 @@ int ath_beacon_alloc(struct ath_softc *sc, int if_id)
		 * timestamp then convert to TSF units and handle
		 * byte swapping before writing it in the frame.
		 * The hardware will then add this each time a beacon
		 * frame is sent.  Note that we align vap's 1..N
		 * and leave vap 0 untouched.  This means vap 0
		 * frame is sent.  Note that we align vif's 1..N
		 * and leave vif 0 untouched.  This means vap 0
		 * has a timestamp in one beacon interval while the
		 * others get a timestamp aligned to the next interval.
		 */
@@ -416,14 +416,14 @@ int ath_beacon_alloc(struct ath_softc *sc, int if_id)
	return 0;
}

void ath_beacon_return(struct ath_softc *sc, struct ath_vap *avp)
void ath_beacon_return(struct ath_softc *sc, struct ath_vif *avp)
{
	if (avp->av_bcbuf != NULL) {
		struct ath_buf *bf;

		if (avp->av_bslot != -1) {
			sc->beacon.bslot[avp->av_bslot] = ATH_IF_ID_ANY;
			sc->sc_nbcnvaps--;
			sc->nbcnvifs--;
		}

		bf = avp->av_bcbuf;
@@ -597,7 +597,7 @@ void ath9k_beacon_tasklet(unsigned long data)
		ath9k_hw_puttxbuf(ah, sc->beacon.beaconq, bfaddr);
		ath9k_hw_txstart(ah, sc->beacon.beaconq);

		sc->beacon.ast_be_xmit += bc;     /* XXX per-vap? */
		sc->beacon.ast_be_xmit += bc;     /* XXX per-vif? */
	}
}

@@ -621,12 +621,12 @@ void ath_beacon_config(struct ath_softc *sc, int if_id)
	struct ieee80211_vif *vif;
	struct ath_hal *ah = sc->sc_ah;
	struct ath_beacon_config conf;
	struct ath_vap *avp;
	struct ath_vif *avp;
	enum nl80211_iftype opmode;
	u32 nexttbtt, intval;

	if (if_id != ATH_IF_ID_ANY) {
		vif = sc->sc_vaps[if_id];
		vif = sc->vifs[if_id];
		ASSERT(vif);
		avp = (void *)vif->drv_priv;
		opmode = avp->av_opmode;
@@ -781,8 +781,8 @@ void ath_beacon_config(struct ath_softc *sc, int if_id)

		ath9k_hw_set_interrupts(ah, 0);
		ath9k_hw_set_sta_beacon_timers(ah, &bs);
		sc->sc_imask |= ATH9K_INT_BMISS;
		ath9k_hw_set_interrupts(ah, sc->sc_imask);
		sc->imask |= ATH9K_INT_BMISS;
		ath9k_hw_set_interrupts(ah, sc->imask);
	} else {
		u64 tsf;
		u32 tsftu;
@@ -819,7 +819,7 @@ void ath_beacon_config(struct ath_softc *sc, int if_id)
			 */
			intval |= ATH9K_BEACON_ENA;
			if (!(ah->ah_caps.hw_caps & ATH9K_HW_CAP_VEOL))
				sc->sc_imask |= ATH9K_INT_SWBA;
				sc->imask |= ATH9K_INT_SWBA;
			ath_beaconq_config(sc);
		} else if (sc->sc_ah->ah_opmode == NL80211_IFTYPE_AP) {
			/*
@@ -827,12 +827,12 @@ void ath_beacon_config(struct ath_softc *sc, int if_id)
			 * SWBA interrupts to prepare beacon frames.
			 */
			intval |= ATH9K_BEACON_ENA;
			sc->sc_imask |= ATH9K_INT_SWBA;   /* beacon prepare */
			sc->imask |= ATH9K_INT_SWBA;   /* beacon prepare */
			ath_beaconq_config(sc);
		}
		ath9k_hw_beaconinit(ah, nexttbtt, intval);
		sc->beacon.bmisscnt = 0;
		ath9k_hw_set_interrupts(ah, sc->sc_imask);
		ath9k_hw_set_interrupts(ah, sc->imask);
		/*
		 * When using a self-linked beacon descriptor in
		 * ibss mode load it once here.
+65 −65
Original line number Diff line number Diff line
@@ -24,7 +24,7 @@ void DPRINTF(struct ath_softc *sc, int dbg_mask, const char *fmt, ...)
	if (!sc)
		return;

	if (sc->sc_debug.debug_mask & dbg_mask) {
	if (sc->debug.debug_mask & dbg_mask) {
		va_list args;

		va_start(args, fmt);
@@ -130,41 +130,41 @@ static const struct file_operations fops_dma = {
void ath_debug_stat_interrupt(struct ath_softc *sc, enum ath9k_int status)
{
	if (status)
		sc->sc_debug.stats.istats.total++;
		sc->debug.stats.istats.total++;
	if (status & ATH9K_INT_RX)
		sc->sc_debug.stats.istats.rxok++;
		sc->debug.stats.istats.rxok++;
	if (status & ATH9K_INT_RXEOL)
		sc->sc_debug.stats.istats.rxeol++;
		sc->debug.stats.istats.rxeol++;
	if (status & ATH9K_INT_RXORN)
		sc->sc_debug.stats.istats.rxorn++;
		sc->debug.stats.istats.rxorn++;
	if (status & ATH9K_INT_TX)
		sc->sc_debug.stats.istats.txok++;
		sc->debug.stats.istats.txok++;
	if (status & ATH9K_INT_TXURN)
		sc->sc_debug.stats.istats.txurn++;
		sc->debug.stats.istats.txurn++;
	if (status & ATH9K_INT_MIB)
		sc->sc_debug.stats.istats.mib++;
		sc->debug.stats.istats.mib++;
	if (status & ATH9K_INT_RXPHY)
		sc->sc_debug.stats.istats.rxphyerr++;
		sc->debug.stats.istats.rxphyerr++;
	if (status & ATH9K_INT_RXKCM)
		sc->sc_debug.stats.istats.rx_keycache_miss++;
		sc->debug.stats.istats.rx_keycache_miss++;
	if (status & ATH9K_INT_SWBA)
		sc->sc_debug.stats.istats.swba++;
		sc->debug.stats.istats.swba++;
	if (status & ATH9K_INT_BMISS)
		sc->sc_debug.stats.istats.bmiss++;
		sc->debug.stats.istats.bmiss++;
	if (status & ATH9K_INT_BNR)
		sc->sc_debug.stats.istats.bnr++;
		sc->debug.stats.istats.bnr++;
	if (status & ATH9K_INT_CST)
		sc->sc_debug.stats.istats.cst++;
		sc->debug.stats.istats.cst++;
	if (status & ATH9K_INT_GTT)
		sc->sc_debug.stats.istats.gtt++;
		sc->debug.stats.istats.gtt++;
	if (status & ATH9K_INT_TIM)
		sc->sc_debug.stats.istats.tim++;
		sc->debug.stats.istats.tim++;
	if (status & ATH9K_INT_CABEND)
		sc->sc_debug.stats.istats.cabend++;
		sc->debug.stats.istats.cabend++;
	if (status & ATH9K_INT_DTIMSYNC)
		sc->sc_debug.stats.istats.dtimsync++;
		sc->debug.stats.istats.dtimsync++;
	if (status & ATH9K_INT_DTIM)
		sc->sc_debug.stats.istats.dtim++;
		sc->debug.stats.istats.dtim++;
}

static ssize_t read_file_interrupt(struct file *file, char __user *user_buf,
@@ -175,41 +175,41 @@ static ssize_t read_file_interrupt(struct file *file, char __user *user_buf,
	unsigned int len = 0;

	len += snprintf(buf + len, sizeof(buf) - len,
		"%8s: %10u\n", "RX", sc->sc_debug.stats.istats.rxok);
		"%8s: %10u\n", "RX", sc->debug.stats.istats.rxok);
	len += snprintf(buf + len, sizeof(buf) - len,
		"%8s: %10u\n", "RXEOL", sc->sc_debug.stats.istats.rxeol);
		"%8s: %10u\n", "RXEOL", sc->debug.stats.istats.rxeol);
	len += snprintf(buf + len, sizeof(buf) - len,
		"%8s: %10u\n", "RXORN", sc->sc_debug.stats.istats.rxorn);
		"%8s: %10u\n", "RXORN", sc->debug.stats.istats.rxorn);
	len += snprintf(buf + len, sizeof(buf) - len,
		"%8s: %10u\n", "TX", sc->sc_debug.stats.istats.txok);
		"%8s: %10u\n", "TX", sc->debug.stats.istats.txok);
	len += snprintf(buf + len, sizeof(buf) - len,
		"%8s: %10u\n", "TXURN", sc->sc_debug.stats.istats.txurn);
		"%8s: %10u\n", "TXURN", sc->debug.stats.istats.txurn);
	len += snprintf(buf + len, sizeof(buf) - len,
		"%8s: %10u\n", "MIB", sc->sc_debug.stats.istats.mib);
		"%8s: %10u\n", "MIB", sc->debug.stats.istats.mib);
	len += snprintf(buf + len, sizeof(buf) - len,
		"%8s: %10u\n", "RXPHY", sc->sc_debug.stats.istats.rxphyerr);
		"%8s: %10u\n", "RXPHY", sc->debug.stats.istats.rxphyerr);
	len += snprintf(buf + len, sizeof(buf) - len,
		"%8s: %10u\n", "RXKCM", sc->sc_debug.stats.istats.rx_keycache_miss);
		"%8s: %10u\n", "RXKCM", sc->debug.stats.istats.rx_keycache_miss);
	len += snprintf(buf + len, sizeof(buf) - len,
		"%8s: %10u\n", "SWBA", sc->sc_debug.stats.istats.swba);
		"%8s: %10u\n", "SWBA", sc->debug.stats.istats.swba);
	len += snprintf(buf + len, sizeof(buf) - len,
		"%8s: %10u\n", "BMISS", sc->sc_debug.stats.istats.bmiss);
		"%8s: %10u\n", "BMISS", sc->debug.stats.istats.bmiss);
	len += snprintf(buf + len, sizeof(buf) - len,
		"%8s: %10u\n", "BNR", sc->sc_debug.stats.istats.bnr);
		"%8s: %10u\n", "BNR", sc->debug.stats.istats.bnr);
	len += snprintf(buf + len, sizeof(buf) - len,
		"%8s: %10u\n", "CST", sc->sc_debug.stats.istats.cst);
		"%8s: %10u\n", "CST", sc->debug.stats.istats.cst);
	len += snprintf(buf + len, sizeof(buf) - len,
		"%8s: %10u\n", "GTT", sc->sc_debug.stats.istats.gtt);
		"%8s: %10u\n", "GTT", sc->debug.stats.istats.gtt);
	len += snprintf(buf + len, sizeof(buf) - len,
		"%8s: %10u\n", "TIM", sc->sc_debug.stats.istats.tim);
		"%8s: %10u\n", "TIM", sc->debug.stats.istats.tim);
	len += snprintf(buf + len, sizeof(buf) - len,
		"%8s: %10u\n", "CABEND", sc->sc_debug.stats.istats.cabend);
		"%8s: %10u\n", "CABEND", sc->debug.stats.istats.cabend);
	len += snprintf(buf + len, sizeof(buf) - len,
		"%8s: %10u\n", "DTIMSYNC", sc->sc_debug.stats.istats.dtimsync);
		"%8s: %10u\n", "DTIMSYNC", sc->debug.stats.istats.dtimsync);
	len += snprintf(buf + len, sizeof(buf) - len,
		"%8s: %10u\n", "DTIM", sc->sc_debug.stats.istats.dtim);
		"%8s: %10u\n", "DTIM", sc->debug.stats.istats.dtim);
	len += snprintf(buf + len, sizeof(buf) - len,
		"%8s: %10u\n", "TOTAL", sc->sc_debug.stats.istats.total);
		"%8s: %10u\n", "TOTAL", sc->debug.stats.istats.total);

	return simple_read_from_buffer(user_buf, count, ppos, buf, len);
}
@@ -231,7 +231,7 @@ static void ath_debug_stat_11n_rc(struct ath_softc *sc, struct sk_buff *skb)
	final_ts_idx = tx_info_priv->tx.ts_rateindex;
	idx = sc->cur_rate_table->info[rates[final_ts_idx].idx].dot11rate;

	sc->sc_debug.stats.n_rcstats[idx].success++;
	sc->debug.stats.n_rcstats[idx].success++;
}

static void ath_debug_stat_legacy_rc(struct ath_softc *sc, struct sk_buff *skb)
@@ -245,7 +245,7 @@ static void ath_debug_stat_legacy_rc(struct ath_softc *sc, struct sk_buff *skb)
	final_ts_idx = tx_info_priv->tx.ts_rateindex;
	idx = rates[final_ts_idx].idx;

	sc->sc_debug.stats.legacy_rcstats[idx].success++;
	sc->debug.stats.legacy_rcstats[idx].success++;
}

void ath_debug_stat_rc(struct ath_softc *sc, struct sk_buff *skb)
@@ -263,8 +263,8 @@ void ath_debug_stat_retries(struct ath_softc *sc, int rix,
	if (conf_is_ht(&sc->hw->conf)) {
		int idx = sc->cur_rate_table->info[rix].dot11rate;

		sc->sc_debug.stats.n_rcstats[idx].xretries += xretries;
		sc->sc_debug.stats.n_rcstats[idx].retries += retries;
		sc->debug.stats.n_rcstats[idx].xretries += xretries;
		sc->debug.stats.n_rcstats[idx].retries += retries;
	}
}

@@ -283,9 +283,9 @@ static ssize_t ath_read_file_stat_11n_rc(struct file *file,
	for (i = 0; i <= 15; i++) {
		len += snprintf(buf + len, sizeof(buf) - len,
				"%5s%3d: %8u %8u %8u\n", "MCS", i,
				sc->sc_debug.stats.n_rcstats[i].success,
				sc->sc_debug.stats.n_rcstats[i].retries,
				sc->sc_debug.stats.n_rcstats[i].xretries);
				sc->debug.stats.n_rcstats[i].success,
				sc->debug.stats.n_rcstats[i].retries,
				sc->debug.stats.n_rcstats[i].xretries);
	}

	return simple_read_from_buffer(user_buf, count, ppos, buf, len);
@@ -305,7 +305,7 @@ static ssize_t ath_read_file_stat_legacy_rc(struct file *file,
	for (i = 0; i < sc->cur_rate_table->rate_cnt; i++) {
		len += snprintf(buf + len, sizeof(buf) - len, "%5u: %12u\n",
				sc->cur_rate_table->info[i].ratekbps / 1000,
				sc->sc_debug.stats.legacy_rcstats[i].success);
				sc->debug.stats.legacy_rcstats[i].success);
	}

	return simple_read_from_buffer(user_buf, count, ppos, buf, len);
@@ -330,34 +330,34 @@ static const struct file_operations fops_rcstat = {

int ath9k_init_debug(struct ath_softc *sc)
{
	sc->sc_debug.debug_mask = ath9k_debug;
	sc->debug.debug_mask = ath9k_debug;

	sc->sc_debug.debugfs_root = debugfs_create_dir(KBUILD_MODNAME, NULL);
	if (!sc->sc_debug.debugfs_root)
	sc->debug.debugfs_root = debugfs_create_dir(KBUILD_MODNAME, NULL);
	if (!sc->debug.debugfs_root)
		goto err;

	sc->sc_debug.debugfs_phy = debugfs_create_dir(wiphy_name(sc->hw->wiphy),
						      sc->sc_debug.debugfs_root);
	if (!sc->sc_debug.debugfs_phy)
	sc->debug.debugfs_phy = debugfs_create_dir(wiphy_name(sc->hw->wiphy),
						      sc->debug.debugfs_root);
	if (!sc->debug.debugfs_phy)
		goto err;

	sc->sc_debug.debugfs_dma = debugfs_create_file("dma", S_IRUGO,
				       sc->sc_debug.debugfs_phy, sc, &fops_dma);
	if (!sc->sc_debug.debugfs_dma)
	sc->debug.debugfs_dma = debugfs_create_file("dma", S_IRUGO,
				       sc->debug.debugfs_phy, sc, &fops_dma);
	if (!sc->debug.debugfs_dma)
		goto err;

	sc->sc_debug.debugfs_interrupt = debugfs_create_file("interrupt",
	sc->debug.debugfs_interrupt = debugfs_create_file("interrupt",
						     S_IRUGO,
						     sc->sc_debug.debugfs_phy,
						     sc->debug.debugfs_phy,
						     sc, &fops_interrupt);
	if (!sc->sc_debug.debugfs_interrupt)
	if (!sc->debug.debugfs_interrupt)
		goto err;

	sc->sc_debug.debugfs_rcstat = debugfs_create_file("rcstat",
	sc->debug.debugfs_rcstat = debugfs_create_file("rcstat",
						  S_IRUGO,
						  sc->sc_debug.debugfs_phy,
						  sc->debug.debugfs_phy,
						  sc, &fops_rcstat);
	if (!sc->sc_debug.debugfs_rcstat)
	if (!sc->debug.debugfs_rcstat)
		goto err;

	return 0;
@@ -368,9 +368,9 @@ int ath9k_init_debug(struct ath_softc *sc)

void ath9k_exit_debug(struct ath_softc *sc)
{
	debugfs_remove(sc->sc_debug.debugfs_rcstat);
	debugfs_remove(sc->sc_debug.debugfs_interrupt);
	debugfs_remove(sc->sc_debug.debugfs_dma);
	debugfs_remove(sc->sc_debug.debugfs_phy);
	debugfs_remove(sc->sc_debug.debugfs_root);
	debugfs_remove(sc->debug.debugfs_rcstat);
	debugfs_remove(sc->debug.debugfs_interrupt);
	debugfs_remove(sc->debug.debugfs_dma);
	debugfs_remove(sc->debug.debugfs_phy);
	debugfs_remove(sc->debug.debugfs_root);
}
+3 −3
Original line number Diff line number Diff line
@@ -2158,9 +2158,9 @@ int ath9k_hw_reset(struct ath_hal *ah, struct ath9k_channel *chan,
	u32 macStaId1;
	int i, rx_chainmask, r;

	ahp->ah_extprotspacing = sc->sc_ht_extprotspacing;
	ahp->ah_txchainmask = sc->sc_tx_chainmask;
	ahp->ah_rxchainmask = sc->sc_rx_chainmask;
	ahp->ah_extprotspacing = sc->ht_extprotspacing;
	ahp->ah_txchainmask = sc->tx_chainmask;
	ahp->ah_rxchainmask = sc->rx_chainmask;

	if (AR_SREV_9285(ah)) {
		ahp->ah_txchainmask &= 0x1;
+151 −151

File changed.

Preview size limit exceeded, changes collapsed.

Loading