ath9k: Miscellaneous fixes
PATCH 3/6 ath9k: Miscellaneous fixes
This patch removes ath_vap_listen() and dma wrapper macros. Also, Inline abuse is cleaned up and a few typos are fixed.
Signed-off-by Sujith Manoharan <[email protected]>
--- drivers/net/wireless/ath9k/beacon.c | 52 ++++++++++++------------ drivers/net/wireless/ath9k/core.c | 74 ++--------------------------------- drivers/net/wireless/ath9k/core.h | 6 +-- drivers/net/wireless/ath9k/hw.c | 68 ++++++++++++++++---------------- drivers/net/wireless/ath9k/main.c | 19 +------- drivers/net/wireless/ath9k/xmit.c | 29 +++++-------- 6 files changed, 79 insertions(+), 169 deletions(-)
drivers/net/wireless/ath9k/beacon.c +26 -26
@@ -114,21 +114,21 @@ static void ath_beacon_setup(struct ath_softc *sc,if (sc->sc_flags &SC_OP_PREAMBLE_SHORT ) rate |= rt->info[rix].shortPreamble; -ath9k_hw_set11n_txdesc (ah, ds - , skb->len +FCS_LEN /* frame length */ - ,ATH9K_PKT_TYPE_BEACON /* Atheros packet type */ - , avp->av_btxctl.txpower/* txpower XXX */ - ,ATH9K_TXKEYIX_INVALID /* no encryption */ - ,ATH9K_KEY_TYPE_CLEAR /* no encryption */ - , flags/* no ack, veol for beacons */ +ath9k_hw_set11n_txdesc (ah, ds, + skb->len +FCS_LEN ,/* frame length */ +ATH9K_PKT_TYPE_BEACON ,/* Atheros packet type */ + avp->av_btxctl.txpower,/* txpower XXX */ +ATH9K_TXKEYIX_INVALID ,/* no encryption */ +ATH9K_KEY_TYPE_CLEAR ,/* no encryption */ + flags/* no ack, veol for beacons */ );/* NB: beacon's BufLen must be a multiple of 4 bytes */ -ath9k_hw_filltxdesc (ah, ds - ,roundup (skb->len,4 )/* buffer length */ - , true/* first segment */ - , true/* last segment */ - , ds/* first descriptor */ +ath9k_hw_filltxdesc (ah, ds, +roundup (skb->len,4 ),/* buffer length */ + true,/* first segment */ + true,/* last segment */ + ds/* first descriptor */ );memzero (series,sizeof (struct ath9k_11n_rate_series ) *4 );
@@ -551,7 +551,7 @@ void ath_beacon_free(struct ath_softc *sc)void ath9k_beacon_tasklet (unsigned long data) { -#define TSF_TO_TU (_h,_l) \ +#define TSF_TO_TU (_h,_l) \ ((((u32)(_h)) << 22) | (((u32)(_l)) >> 10))struct ath_softc *sc = (struct ath_softc *)data;
@@ -898,19 +898,19 @@ void ath_beacon_config(struct ath_softc *sc, int if_id)"cfp:period %u " "maxdur %u " "next %u " -"timoffset %u\n" - , __func__ - , (unsigned long long )tsf, tsftu - , bs.bs_intval - , bs.bs_nexttbtt - , bs.bs_dtimperiod - , bs.bs_nextdtim - , bs.bs_bmissthreshold - , bs.bs_sleepduration - , bs.bs_cfpperiod - , bs.bs_cfpmaxduration - , bs.bs_cfpnext - , bs.bs_timoffset +"timoffset %u\n" , + __func__, + (unsigned long long )tsf, tsftu, + bs.bs_intval, + bs.bs_nexttbtt, + bs.bs_dtimperiod, + bs.bs_nextdtim, + bs.bs_bmissthreshold, + bs.bs_sleepduration, + bs.bs_cfpperiod, + bs.bs_cfpmaxduration, + bs.bs_cfpnext, + bs.bs_timoffset );ath9k_hw_set_interrupts (ah,0 );
drivers/net/wireless/ath9k/core.c +4 -70
105 lines not on this page · raw message
drivers/net/wireless/ath9k/core.h +1 -5
@@ -82,9 +82,6 @@ struct ath_node;/* XXX: remove */ #define memzero (_buf, _len) memset(_buf, 0, _len) -#define get_dma_mem_context (var, field) (&((var)->field)) -#define copy_dma_mem_context (dst, src) (*dst = *src) -#define ATH9K_BH_STATUS_INTACT 0#define ATH9K_BH_STATUS_CHANGE 1
@@ -769,8 +766,7 @@ int ath_vap_attach(struct ath_softc *sc, enum ath9k_opmode opmode);int ath_vap_detach (struct ath_softc *sc,int if_id);int ath_vap_config (struct ath_softc *sc, -int if_id,struct ath_vap_config *if_config); -int ath_vap_listen (struct ath_softc *sc,int if_id); +int if_id,struct ath_vap_config *if_config);/*********************/ /* Antenna diversity */
drivers/net/wireless/ath9k/hw.c +34 -34
242 lines not on this page · raw message
drivers/net/wireless/ath9k/main.c +3 -16
@@ -212,12 +212,10 @@ static int ath_key_config(struct ath_softc *sc,static void ath_key_delete (struct ath_softc *sc,struct ieee80211_key_conf *key) { -#define ATH_MAX_NUM_KEYS 4int freeslot; - freeslot = (key->keyidx >=ATH_MAX_NUM_KEYS ) ?1 :0 ; + freeslot = (key->keyidx >=4 ) ?1 :0 ;ath_key_reset (sc, key->keyidx, freeslot); -#undef ATH_MAX_NUM_KEYS }static void setup_ht_cap (struct ieee80211_ht_info *ht_info)
@@ -620,7 +618,8 @@ static int ath9k_config_interface(struct ieee80211_hw *hw, }if ((conf->changed &IEEE80211_IFCC_BEACON ) && - (vif->type ==IEEE80211_IF_TYPE_IBSS )) { + ((vif->type ==IEEE80211_IF_TYPE_IBSS ) || + (vif->type ==IEEE80211_IF_TYPE_AP ))) {/* * Allocate and setup the beacon frame. *
@@ -638,18 +637,6 @@ static int ath9k_config_interface(struct ieee80211_hw *hw,ath_beacon_sync (sc,0 ); } -if ((conf->changed &IEEE80211_IFCC_BEACON ) && - (vif->type ==IEEE80211_IF_TYPE_AP )) { -ath9k_hw_stoptxdma (sc->sc_ah, sc->sc_bhalq); - - error =ath_beacon_alloc (sc,0 ); -if (error !=0 ) -return error; - -ath_beacon_config (sc,0 ); - sc->sc_flags |=SC_OP_BEACONS ; - } -/* Check for WLAN_CAPABILITY_PRIVACY ? */ if ((avp->av_opmode !=IEEE80211_IF_TYPE_STA )) {for (i =0 ; i <IEEE80211_WEP_NKID ; i++)
drivers/net/wireless/ath9k/xmit.c +11 -18
@@ -499,7 +499,6 @@ static void ath_tx_complete_buf(struct ath_softc *sc, {struct sk_buff *skb = bf->bf_mpdu;struct ath_xmit_status tx_status; -dma_addr_t *pa;/* * Set retry information.
@@ -519,9 +518,8 @@ static void ath_tx_complete_buf(struct ath_softc *sc, tx_status.flags |=ATH_TX_XRETRY ; }/* Unmap this frame */ - pa =get_dma_mem_context (bf, bf_dmacontext);pci_unmap_single (sc->pdev, - *pa, + bf->bf_dmacontext, skb->len,PCI_DMA_TODEVICE );/* complete this frame */
@@ -1172,11 +1170,8 @@ static void ath_tx_complete_aggr_rifs(struct ath_softc *sc, tbf->bf_lastfrm->bf_desc);/* copy the DMA context */ -copy_dma_mem_context ( -get_dma_mem_context (tbf, - bf_dmacontext), -get_dma_mem_context (bf_last, - bf_dmacontext)); + tbf->bf_dmacontext = + bf_last->bf_dmacontext; }list_add_tail (&tbf->list, &bf_head); }else {
@@ -1185,7 +1180,7 @@ static void ath_tx_complete_aggr_rifs(struct ath_softc *sc,* software retry */ ath9k_hw_cleartxdesc (sc->sc_ah, - bf->bf_lastfrm->bf_desc); + bf->bf_lastfrm->bf_desc); }/*
@@ -2045,8 +2040,7 @@ static int ath_tx_start_dma(struct ath_softc *sc,/* * Save the DMA context in the first ath_buf */ -copy_dma_mem_context (get_dma_mem_context (bf, bf_dmacontext), -get_dma_mem_context (txctl, dmacontext)); + bf->bf_dmacontext = txctl->dmacontext;/* * Formulate first tx descriptor with tx controls.
@@ -2127,25 +2121,26 @@ static int ath_tx_start_dma(struct ath_softc *sc,static void xmit_map_sg (struct ath_softc *sc,struct sk_buff *skb, -dma_addr_t *pa,struct ath_tx_control *txctl) {struct ath_xmit_status tx_status;struct ath_atx_tid *tid;struct scatterlist sg; - *pa =pci_map_single (sc->pdev, skb->data, skb->len,PCI_DMA_TODEVICE ); + txctl->dmacontext =pci_map_single (sc->pdev, skb->data, + skb->len,PCI_DMA_TODEVICE );/* setup S/G list */ memset (&sg,0 ,sizeof (struct scatterlist )); -sg_dma_address (&sg) = *pa; +sg_dma_address (&sg) = txctl->dmacontext;sg_dma_len (&sg) = skb->len;if (ath_tx_start_dma (sc, skb, &sg,1 , txctl) !=0 ) {/* * We have to do drop frame here. */ -pci_unmap_single (sc->pdev, *pa, skb->len,PCI_DMA_TODEVICE ); +pci_unmap_single (sc->pdev, txctl->dmacontext, + skb->len,PCI_DMA_TODEVICE ); tx_status.retries =0 ; tx_status.flags =ATH_TX_ERROR ;
@@ -2419,9 +2414,7 @@ int ath_tx_start(struct ath_softc *sc, struct sk_buff *skb)* ath_tx_start_dma() will be called either synchronously * or asynchrounsly once DMA is complete. */ -xmit_map_sg (sc, skb, -get_dma_mem_context (&txctl, dmacontext), - &txctl); +xmit_map_sg (sc, skb, &txctl); else ath_node_put(sc, txctl.an, ATH9K_BH_STATUS_CHANGE);
Signature · 1 line
1.5.6.5