ath9k: Remove redundant data structure ath9k_txq_info
PATCH 2/6 ath9k: Remove redundant data structure ath9k_txq_info
Use ath9k_tx_queue_info which contains the same elements, and merge get/set functions of tx queue properties. Also, fix whitespace damage in struct ath_softc.
Signed-off-by Sujith Manoharan <[email protected]>
--- drivers/net/wireless/ath9k/ath9k.h | 27 +---- drivers/net/wireless/ath9k/beacon.c | 8 +- drivers/net/wireless/ath9k/core.h | 206 +++++++++++++++++------------------ drivers/net/wireless/ath9k/hw.c | 118 +++++++++----------- drivers/net/wireless/ath9k/main.c | 2 +- drivers/net/wireless/ath9k/xmit.c | 29 +++--- 6 files changed, 178 insertions(+), 212 deletions(-)
drivers/net/wireless/ath9k/ath9k.h +5 -22
@@ -282,23 +282,6 @@ enum ath9k_tx_queue_flags { TXQ_FLAG_FRAG_BURST_BACKOFF_ENABLE = 0x0080, }; -struct ath9k_txq_info { -u32 tqi_ver; -enum ath9k_tx_queue_subtype tqi_subtype; -enum ath9k_tx_queue_flags tqi_qflags; -u32 tqi_priority; -u32 tqi_aifs; -u32 tqi_cwmin; -u32 tqi_cwmax; -u16 tqi_shretry; -u16 tqi_lgretry; -u32 tqi_cbrPeriod; -u32 tqi_cbrOverflowLimit; -u32 tqi_burstTime; -u32 tqi_readyTime; -u32 tqi_compBuf; -}; -#define ATH9K_TXQ_USEDEFAULT ((u32) -1)#define ATH9K_DECOMP_MASK_SIZE 128
@@ -999,10 +982,10 @@ u32 ath9k_regd_get_ctl(struct ath_hal *ah, struct ath9k_channel *chan);u32 ath9k_regd_get_antenna_allowed (struct ath_hal *ah,struct ath9k_channel *chan);u32 ath9k_hw_mhz2ieee (struct ath_hal *ah,u32 freq,u32 flags); -bool ath9k_hw_gettxqueueprops (struct ath_hal *ah,int q, -struct ath9k_txq_info *qInfo); -bool ath9k_hw_settxqueueprops (struct ath_hal *ah,int q, -const struct ath9k_txq_info *qInfo); +bool ath9k_hw_get_txq_props (struct ath_hal *ah,int q, +struct ath9k_tx_queue_info *qinfo); +bool ath9k_hw_set_txq_props (struct ath_hal *ah,int q, +const struct ath9k_tx_queue_info *qinfo);struct ath9k_channel *ath9k_regd_check_channel (struct ath_hal *ah,const struct ath9k_channel *c); void ath9k_hw_set11n_txdesc(struct ath_hal *ah, struct ath_desc *ds,
@@ -1053,7 +1036,7 @@ void ath9k_hw_set11n_virtualmorefrag(struct ath_hal *ah,bool ath9k_hw_set_txpowerlimit (struct ath_hal *ah,u32 limit);bool ath9k_regd_is_public_safety_sku (struct ath_hal *ah);int ath9k_hw_setuptxqueue (struct ath_hal *ah,enum ath9k_tx_queue type, -const struct ath9k_txq_info *qInfo); +const struct ath9k_tx_queue_info *qinfo);u32 ath9k_hw_numtxpending (struct ath_hal *ah,u32 q);const char *ath9k_hw_probe (u16 vendorid,u16 devid);bool ath9k_hw_disable (struct ath_hal *ah);
drivers/net/wireless/ath9k/beacon.c +4 -4
@@ -30,9 +30,9 @@static int ath_beaconq_config (struct ath_softc *sc) {struct ath_hal *ah = sc->sc_ah; -struct ath9k_txq_info qi; +struct ath9k_tx_queue_info qi; -ath9k_hw_gettxqueueprops (ah, sc->sc_bhalq, &qi); +ath9k_hw_get_txq_props (ah, sc->sc_bhalq, &qi);if (sc->sc_opmode ==ATH9K_M_HOSTAP ) {/* Always burst out beacon and CAB traffic. */ qi.tqi_aifs =1 ;
@@ -45,7 +45,7 @@ static int ath_beaconq_config(struct ath_softc *sc) qi.tqi_cwmax = sc->sc_beacon_qi.tqi_cwmax; } -if (!ath9k_hw_settxqueueprops (ah, sc->sc_bhalq, &qi)) { +if (!ath9k_hw_set_txq_props (ah, sc->sc_bhalq, &qi)) {DPRINTF (sc,ATH_DBG_FATAL ,"%s: unable to update h/w beacon queue parameters\n" , __func__);
@@ -335,7 +335,7 @@ static void ath_beacon_start_adhoc(struct ath_softc *sc, int if_id)int ath_beaconq_setup (struct ath_hal *ah) { -struct ath9k_txq_info qi; +struct ath9k_tx_queue_info qi;memzero (&qi,sizeof (qi)); qi.tqi_aifs =1 ;
drivers/net/wireless/ath9k/core.h +99 -107
238 lines not on this page · raw message
drivers/net/wireless/ath9k/hw.c +54 -64
190 lines not on this page · raw message
drivers/net/wireless/ath9k/main.c +1 -1
@@ -700,7 +700,7 @@ static int ath9k_conf_tx(struct ieee80211_hw *hw, const struct ieee80211_tx_queue_params *params) {struct ath_softc *sc = hw->priv; -struct ath9k_txq_info qi; +struct ath9k_tx_queue_info qi;int ret =0 , qnum;if (queue >=WME_NUM_AC )
drivers/net/wireless/ath9k/xmit.c +15 -14
@@ -2209,7 +2209,7 @@ int ath_tx_cleanup(struct ath_softc *sc)struct ath_txq *ath_txq_setup (struct ath_softc *sc,int qtype,int subtype) {struct ath_hal *ah = sc->sc_ah; -struct ath9k_txq_info qi; +struct ath9k_tx_queue_info qi;int qnum;memzero (&qi,sizeof (qi));
@@ -2217,7 +2217,7 @@ struct ath_txq *ath_txq_setup(struct ath_softc *sc, int qtype, int subtype) qi.tqi_aifs =ATH9K_TXQ_USEDEFAULT ; qi.tqi_cwmin =ATH9K_TXQ_USEDEFAULT ; qi.tqi_cwmax =ATH9K_TXQ_USEDEFAULT ; - qi.tqi_compBuf =0 ; + qi.tqi_physCompBuf =0 ;/* * Enable interrupts only for EOL and DESC conditions.
@@ -2337,11 +2337,12 @@ int ath_tx_get_qnum(struct ath_softc *sc, int qtype, int haltype)/* Update parameters for a transmit queue */ -int ath_txq_update (struct ath_softc *sc,int qnum,struct ath9k_txq_info *qi0) +int ath_txq_update (struct ath_softc *sc,int qnum, +struct ath9k_tx_queue_info *qinfo) {struct ath_hal *ah = sc->sc_ah;int error =0 ; -struct ath9k_txq_info qi; +struct ath9k_tx_queue_info qi;if (qnum == sc->sc_bhalq) {/*
@@ -2349,20 +2350,20 @@ int ath_txq_update(struct ath_softc *sc, int qnum, struct ath9k_txq_info *qi0)* It will be picked up by ath_beaconq_config when * it's necessary. */ - sc->sc_beacon_qi = *qi0; + sc->sc_beacon_qi = *qinfo;return 0 ; }ASSERT (sc->sc_txq[qnum].axq_qnum == qnum); -ath9k_hw_gettxqueueprops (ah, qnum, &qi); - qi.tqi_aifs = qi0->tqi_aifs; - qi.tqi_cwmin = qi0->tqi_cwmin; - qi.tqi_cwmax = qi0->tqi_cwmax; - qi.tqi_burstTime = qi0->tqi_burstTime; - qi.tqi_readyTime = qi0->tqi_readyTime; +ath9k_hw_get_txq_props (ah, qnum, &qi); + qi.tqi_aifs = qinfo->tqi_aifs; + qi.tqi_cwmin = qinfo->tqi_cwmin; + qi.tqi_cwmax = qinfo->tqi_cwmax; + qi.tqi_burstTime = qinfo->tqi_burstTime; + qi.tqi_readyTime = qinfo->tqi_readyTime; -if (!ath9k_hw_settxqueueprops (ah, qnum, &qi)) { +if (!ath9k_hw_set_txq_props (ah, qnum, &qi)) {DPRINTF (sc,ATH_DBG_FATAL ,"%s: unable to update hardware queue %u!\n" , __func__, qnum);
@@ -2376,11 +2377,11 @@ int ath_txq_update(struct ath_softc *sc, int qnum, struct ath9k_txq_info *qi0)int ath_cabq_update (struct ath_softc *sc) { -struct ath9k_txq_info qi; +struct ath9k_tx_queue_info qi;int qnum = sc->sc_cabq->axq_qnum;struct ath_beacon_config conf; -ath9k_hw_gettxqueueprops (sc->sc_ah, qnum, &qi); +ath9k_hw_get_txq_props (sc->sc_ah, qnum, &qi);/* * Ensure the readytime % is within the bounds. */
Signature · 1 line
1.5.6.5