From: Roland Vossen Date: Fri, 2 Sep 2011 14:00:38 +0000 (+0200) Subject: staging: brcm80211: cleaned up softmac scb.h macro's X-Git-Tag: next-20111004~7^2~351 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=94dde6f46df0ab242875d14be9f454b414f1c0fe;p=karo-tx-linux.git staging: brcm80211: cleaned up softmac scb.h macro's Substituted/removed macro's. Reported-by: Johannes Berg Reviewed-by: Pieter-Paul Giesberts Reviewed-by: Arend van Spriel Signed-off-by: Roland Vossen Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/brcm80211/brcmsmac/main.c b/drivers/staging/brcm80211/brcmsmac/main.c index 4436b4fcdb60..6d2fc10318ad 100644 --- a/drivers/staging/brcm80211/brcmsmac/main.c +++ b/drivers/staging/brcm80211/brcmsmac/main.c @@ -7196,11 +7196,11 @@ brcms_c_d11hdrs_mac80211(struct brcms_c_info *wlc, struct ieee80211_hw *hw, } else { /* Increment the counter for first fragment */ if (tx_info->flags & IEEE80211_TX_CTL_FIRST_FRAGMENT) - SCB_SEQNUM(scb, p->priority)++; + scb->seqnum[p->priority]++; /* extract fragment number from frame first */ seq = le16_to_cpu(seq) & FRAGNUM_MASK; - seq |= (SCB_SEQNUM(scb, p->priority) << SEQNUM_SHIFT); + seq |= (scb->seqnum[p->priority] << SEQNUM_SHIFT); h->seq_ctrl = cpu_to_le16(seq); frameid = ((seq << TXFID_SEQ_SHIFT) & TXFID_SEQ_MASK) | @@ -7210,7 +7210,7 @@ brcms_c_d11hdrs_mac80211(struct brcms_c_info *wlc, struct ieee80211_hw *hw, frameid |= queue & TXFID_QUEUE_MASK; /* set the ignpmq bit for all pkts tx'd in PS mode and for beacons */ - if (SCB_PS(scb) || ieee80211_is_beacon(h->frame_control)) + if (ieee80211_is_beacon(h->frame_control)) mcl |= TXC_IGNOREPMQ; txrate[0] = tx_info->control.rates; @@ -7685,7 +7685,7 @@ brcms_c_d11hdrs_mac80211(struct brcms_c_info *wlc, struct ieee80211_hw *hw, } ac = skb_get_queue_mapping(p); - if (SCB_WME(scb) && qos && wlc->edcf_txop[ac]) { + if ((scb->flags & SCB_WMECAP) && qos && wlc->edcf_txop[ac]) { uint frag_dur, dur, dur_fallback; /* WME: Update TXOP threshold */ diff --git a/drivers/staging/brcm80211/brcmsmac/main.h b/drivers/staging/brcm80211/brcmsmac/main.h index 047c422174d9..a0dcacc8ec4d 100644 --- a/drivers/staging/brcm80211/brcmsmac/main.h +++ b/drivers/staging/brcm80211/brcmsmac/main.h @@ -221,7 +221,8 @@ struct brcms_stf { #define BRCMS_STF_SS_STBC_TX(wlc, scb) \ (((wlc)->stf->txstreams > 1) && (((wlc)->band->band_stf_stbc_tx == ON) \ - || (SCB_STBC_CAP((scb)) && (wlc)->band->band_stf_stbc_tx == AUTO && \ + || (((scb)->flags & SCB_STBCCAP) && \ + (wlc)->band->band_stf_stbc_tx == AUTO && \ isset(&((wlc)->stf->ss_algo_channel), PHY_TXC1_MODE_STBC)))) #define BRCMS_STBC_CAP_PHY(wlc) (BRCMS_ISNPHY(wlc->band) && \ diff --git a/drivers/staging/brcm80211/brcmsmac/rate.h b/drivers/staging/brcm80211/brcmsmac/rate.h index 39e1796e924a..ae5479b46098 100644 --- a/drivers/staging/brcm80211/brcmsmac/rate.h +++ b/drivers/staging/brcm80211/brcmsmac/rate.h @@ -123,22 +123,6 @@ extern const struct brcms_mcs_info mcs_table[]; RSPEC_ISSGI(rspec)) : \ (rspec & RSPEC_RATE_MASK)) -/* return rate in unit of 500Kbps -- for internal use in wlc_rate_sel.c */ -#define RSPEC2RATE500K(rspec) \ - ((rspec & RSPEC_MIMORATE) ? \ - MCS_RATE((rspec & RSPEC_RATE_MASK), state->is40bw, \ - RSPEC_ISSGI(rspec))/500 : \ - (rspec & RSPEC_RATE_MASK)) - -#define CRSPEC2RATE500K(rspec) \ - ((rspec & RSPEC_MIMORATE) ? \ - MCS_RATE((rspec & RSPEC_RATE_MASK), RSPEC_IS40MHZ(rspec), \ - RSPEC_ISSGI(rspec))/500 :\ - (rspec & RSPEC_RATE_MASK)) - -#define RSPEC2KBPS(rspec) \ - (IS_MCS(rspec) ? RSPEC2RATE(rspec) : RSPEC2RATE(rspec)*500) - #define RSPEC_PHYTXBYTE2(rspec) ((rspec & 0xff00) >> 8) #define RSPEC_GET_BW(rspec) ((rspec & RSPEC_BW_MASK) >> RSPEC_BW_SHIFT) diff --git a/drivers/staging/brcm80211/brcmsmac/scb.h b/drivers/staging/brcm80211/brcmsmac/scb.h index 3fe9cf20260b..b2aacf3bf3f5 100644 --- a/drivers/staging/brcm80211/brcmsmac/scb.h +++ b/drivers/staging/brcm80211/brcmsmac/scb.h @@ -24,6 +24,16 @@ #define AMPDU_TX_BA_MAX_WSIZE 64 /* max Tx ba window size (in pdu) */ +#define AMPDU_MAX_SCB_TID NUMPRIO + +/* scb flags */ +#define SCB_WMECAP 0x0040 /* may ONLY be set if pub->_wme!=OFF */ +#define SCB_HTCAP 0x10000 /* HT (MIMO) capable device */ +#define SCB_IS40 0x80000 /* 40MHz capable */ +#define SCB_STBCCAP 0x40000000 /* STBC Capable */ + +#define SCB_MAGIC 0xbeefcafe + /* structure to store per-tid state for the ampdu initiator */ struct scb_ampdu_tid_ini { u8 tx_in_transit; /* number of pending mpdus in transit in driver */ @@ -34,8 +44,6 @@ struct scb_ampdu_tid_ini { u8 ba_wsize; /* negotiated ba window size (in pdu) */ }; -#define AMPDU_MAX_SCB_TID NUMPRIO - struct scb_ampdu { struct scb *scb; /* back pointer for easy reference */ u8 mpdu_density; /* mpdu density */ @@ -54,8 +62,6 @@ struct scb_ampdu { struct scb_ampdu_tid_ini ini[AMPDU_MAX_SCB_TID]; }; -#define SCB_MAGIC 0xbeefcafe - /* station control block - one per remote MAC address */ struct scb { u32 magic; @@ -74,14 +80,4 @@ struct scb { struct scb_ampdu scb_ampdu; /* AMPDU state including per tid info */ }; -/* scb flags */ -#define SCB_WMECAP 0x0040 /* may ONLY be set if pub->_wme!=OFF */ -#define SCB_HTCAP 0x10000 /* HT (MIMO) capable device */ -#define SCB_IS40 0x80000 /* 40MHz capable */ -#define SCB_STBCCAP 0x40000000 /* STBC Capable */ -#define SCB_WME(a) ((a)->flags & SCB_WMECAP)/* implies WME enab */ -#define SCB_SEQNUM(scb, prio) ((scb)->seqnum[(prio)]) -#define SCB_PS(a) NULL -#define SCB_STBC_CAP(a) ((a)->flags & SCB_STBCCAP) -#define SCB_AMPDU(a) true #endif /* _BRCM_SCB_H_ */