Added prefix WLC_ to the rate related definition.
Reviewed-by: Roland Vossen <[email protected]>
Signed-off-by: Arend van Spriel <[email protected]>
---
drivers/staging/brcm80211/brcmsmac/wlc_bmac.c | 2 +-
drivers/staging/brcm80211/brcmsmac/wlc_main.c | 38 +++++++++++++-----------
drivers/staging/brcm80211/brcmsmac/wlc_rate.c | 8 ++--
drivers/staging/brcm80211/brcmsmac/wlc_rate.h | 13 ++++----
4 files changed, 33 insertions(+), 28 deletions(-)
diff --git a/drivers/staging/brcm80211/brcmsmac/wlc_bmac.c
b/drivers/staging/brcm80211/brcmsmac/wlc_bmac.c
index a49c63c..e39444a 100644
--- a/drivers/staging/brcm80211/brcmsmac/wlc_bmac.c
+++ b/drivers/staging/brcm80211/brcmsmac/wlc_bmac.c
@@ -3738,7 +3738,7 @@ u16 wlc_bmac_rate_shm_offset(struct wlc_hw_info *wlc_hw,
u8 rate)
/* for a given rate, the LS-nibble of the PLCP SIGNAL field is
* the index into the rate table.
*/
- phy_rate = rate_info[rate] & RATE_MASK;
+ phy_rate = rate_info[rate] & WLC_RATE_MASK;
index = phy_rate & 0xf;
/* Find the SHM pointer to the rate table entry by looking in the
diff --git a/drivers/staging/brcm80211/brcmsmac/wlc_main.c
b/drivers/staging/brcm80211/brcmsmac/wlc_main.c
index 16a5f96..b433658 100644
--- a/drivers/staging/brcm80211/brcmsmac/wlc_main.c
+++ b/drivers/staging/brcm80211/brcmsmac/wlc_main.c
@@ -1101,10 +1101,10 @@ ratespec_t wlc_lowest_basic_rspec(struct wlc_info *wlc,
wlc_rateset_t *rs)
uint i;
/* Use the lowest basic rate */
- lowest_basic_rspec = rs->rates[0] & RATE_MASK;
+ lowest_basic_rspec = rs->rates[0] & WLC_RATE_MASK;
for (i = 0; i < rs->count; i++) {
if (rs->rates[i] & WLC_RATE_FLAG) {
- lowest_basic_rspec = rs->rates[i] & RATE_MASK;
+ lowest_basic_rspec = rs->rates[i] & WLC_RATE_MASK;
break;
}
}
@@ -1284,7 +1284,7 @@ static void wlc_bandinit_ordered(struct wlc_info *wlc,
chanspec_t chanspec)
/* fill in hw_rate */
wlc_rateset_filter(&default_rateset, &wlc->band->hw_rateset,
- false, WLC_RATES_CCK_OFDM, RATE_MASK,
+ false, WLC_RATES_CCK_OFDM, WLC_RATE_MASK,
(bool) N_ENAB(wlc->pub));
/* init basic rate lookup */
@@ -1869,7 +1869,7 @@ void *wlc_attach(void *wl, u16 vendor, u16 device, uint
unit, bool piomode,
/* fill in hw_rateset (used early by WLC_SET_RATESET) */
wlc_rateset_filter(&wlc->band->defrateset,
&wlc->band->hw_rateset, false,
- WLC_RATES_CCK_OFDM, RATE_MASK,
+ WLC_RATES_CCK_OFDM, WLC_RATE_MASK,
(bool) N_ENAB(wlc->pub));
}
@@ -4018,15 +4018,19 @@ _wlc_ioctl(struct wlc_info *wlc, int cmd, void *arg,
int len,
break;
}
- /* validate rateset by comparing pre and post sorted
against 11g hw rates */
- wlc_rateset_filter(&rs, &new, false, WLC_RATES_CCK_OFDM,
- RATE_MASK, BSS_N_ENAB(wlc, bsscfg));
+ /*
+ * validate rateset by comparing pre and
+ * post sorted against 11g hw rates
+ */
+ wlc_rateset_filter(&rs, &new, false,
+ WLC_RATES_CCK_OFDM, WLC_RATE_MASK,
+ BSS_N_ENAB(wlc, bsscfg));
wlc_rate_hwrs_filter_sort_validate(&new,
&cck_ofdm_rates,
false,
wlc->stf->txstreams);
if (rs.count != new.count) {
- bcmerror = BCME_BADRATESET; /* invalid
rateset */
+ bcmerror = BCME_BADRATESET;
break;
}
@@ -5401,7 +5405,7 @@ wlc_compute_ofdm_plcp(ratespec_t rspec, u32 length, u8
*plcp)
ASSERT(IS_OFDM(rspec));
/* encode rate per 802.11a-1999 sec 17.3.4.1, with lsb transmitted
first */
- rate_signal = rate_info[rate] & RATE_MASK;
+ rate_signal = rate_info[rate] & WLC_RATE_MASK;
ASSERT(rate_signal != 0);
memset(plcp, 0, D11_PHY_HDR_LEN);
@@ -7307,7 +7311,7 @@ void wlc_rate_lookup_init(struct wlc_info *wlc,
wlc_rateset_t *rateset)
continue;
/* mask off basic bit */
- rate = (rateset->rates[i] & RATE_MASK);
+ rate = (rateset->rates[i] & WLC_RATE_MASK);
if (rate > WLC_MAXRATE) {
dev_err(wlc->dev, "wlc_rate_lookup_init: invalid rate
0x%X in rate set\n",
@@ -7393,8 +7397,8 @@ static void wlc_write_rate_shm(struct wlc_info *wlc, u8
rate, u8 basic_rate)
* for a given rate, the LS-nibble of the PLCP SIGNAL field is
* the index into the rate table.
*/
- phy_rate = rate_info[rate] & RATE_MASK;
- basic_phy_rate = rate_info[basic_rate] & RATE_MASK;
+ phy_rate = rate_info[rate] & WLC_RATE_MASK;
+ basic_phy_rate = rate_info[basic_rate] & WLC_RATE_MASK;
index = phy_rate & 0xf;
basic_index = basic_phy_rate & 0xf;
@@ -7441,7 +7445,7 @@ void wlc_set_ratetable(struct wlc_info *wlc)
/* walk the phy rate table and update SHM basic rate lookup table */
for (i = 0; i < rs.count; i++) {
- rate = rs.rates[i] & RATE_MASK;
+ rate = rs.rates[i] & WLC_RATE_MASK;
/* for a given rate WLC_BASIC_RATE returns the rate at
* which a response ACK/CTS should be sent.
@@ -7451,7 +7455,7 @@ void wlc_set_ratetable(struct wlc_info *wlc)
/* This should only happen if we are using a
* restricted rateset.
*/
- basic_rate = rs.rates[0] & RATE_MASK;
+ basic_rate = rs.rates[0] & WLC_RATE_MASK;
}
wlc_write_rate_shm(wlc, rate, basic_rate);
@@ -7544,7 +7548,7 @@ void wlc_mod_prb_rsp_rate_table(struct wlc_info *wlc,
uint frame_len)
/* walk the phy rate table and update MAC core SHM basic rate table
entries */
for (i = 0; i < rs.count; i++) {
- rate = rs.rates[i] & RATE_MASK;
+ rate = rs.rates[i] & WLC_RATE_MASK;
entry_ptr = wlc_rate_shm_offset(wlc, rate);
@@ -7908,7 +7912,7 @@ int wlc_get_revision_info(struct wlc_info *wlc, void
*buf, uint len)
void wlc_default_rateset(struct wlc_info *wlc, wlc_rateset_t *rs)
{
wlc_rateset_default(rs, NULL, wlc->band->phytype, wlc->band->bandtype,
- false, RATE_MASK_FULL, (bool) N_ENAB(wlc->pub),
+ false, WLC_RATE_MASK_FULL, (bool) N_ENAB(wlc->pub),
CHSPEC_WLC_BW(wlc->default_bss->chanspec),
wlc->stf->txstreams);
}
@@ -7941,7 +7945,7 @@ static void wlc_bss_default_init(struct wlc_info *wlc)
/* init bss rates to the band specific default rate set */
wlc_rateset_default(&bi->rateset, NULL, band->phytype, band->bandtype,
- false, RATE_MASK_FULL, (bool) N_ENAB(wlc->pub),
+ false, WLC_RATE_MASK_FULL, (bool) N_ENAB(wlc->pub),
CHSPEC_WLC_BW(chanspec), wlc->stf->txstreams);
if (N_ENAB(wlc->pub))
diff --git a/drivers/staging/brcm80211/brcmsmac/wlc_rate.c
b/drivers/staging/brcm80211/brcmsmac/wlc_rate.c
index 9741f9a..1f3f320 100644
--- a/drivers/staging/brcm80211/brcmsmac/wlc_rate.c
+++ b/drivers/staging/brcm80211/brcmsmac/wlc_rate.c
@@ -304,7 +304,7 @@ wlc_rate_hwrs_filter_sort_validate(wlc_rateset_t *rs,
for (i = 0; i < count; i++) {
/* mask off "basic rate" bit, WLC_RATE_FLAG */
- r = (int)rs->rates[i] & RATE_MASK;
+ r = (int)rs->rates[i] & WLC_RATE_MASK;
if ((r > WLC_MAXRATE) || (rate_info[r] == 0)) {
continue;
}
@@ -314,7 +314,7 @@ wlc_rate_hwrs_filter_sort_validate(wlc_rateset_t *rs,
/* fill out the rates in order, looking at only supported rates */
count = 0;
for (i = 0; i < hw_rs->count; i++) {
- r = hw_rs->rates[i] & RATE_MASK;
+ r = hw_rs->rates[i] & WLC_RATE_MASK;
ASSERT(r <= WLC_MAXRATE);
if (rateset[r])
rs->rates[count++] = rateset[r];
@@ -407,9 +407,9 @@ wlc_rateset_filter(wlc_rateset_t *src, wlc_rateset_t *dst,
bool basic_only,
r = src->rates[i];
if (basic_only && !(r & WLC_RATE_FLAG))
continue;
- if ((rates == WLC_RATES_CCK) && IS_OFDM((r & RATE_MASK)))
+ if ((rates == WLC_RATES_CCK) && IS_OFDM((r & WLC_RATE_MASK)))
continue;
- if ((rates == WLC_RATES_OFDM) && IS_CCK((r & RATE_MASK)))
+ if ((rates == WLC_RATES_OFDM) && IS_CCK((r & WLC_RATE_MASK)))
continue;
dst->rates[count++] = r & xmask;
}
diff --git a/drivers/staging/brcm80211/brcmsmac/wlc_rate.h
b/drivers/staging/brcm80211/brcmsmac/wlc_rate.h
index 25ba2a4..5643adf 100644
--- a/drivers/staging/brcm80211/brcmsmac/wlc_rate.h
+++ b/drivers/staging/brcm80211/brcmsmac/wlc_rate.h
@@ -54,11 +54,12 @@ extern const mcs_info_t mcs_table[];
(_is40 ? mcs_table[_mcs].phy_rate_40 : mcs_table[_mcs].phy_rate_20))
#define VALID_MCS(_mcs) ((_mcs < MCS_TABLE_SIZE))
+/* rate related definitions */
#define WLC_RATE_FLAG 0x80 /* Rate flag: basic or ofdm */
+#define WLC_RATE_MASK 0x7f /* Rate value mask w/o basic rate flag
*/
-/* Macros to use the rate_info table */
-#define RATE_MASK 0x7f /* Rate value mask w/o basic rate flag
*/
-#define RATE_MASK_FULL 0xff /* Rate value mask with basic rate flag
*/
+/* Macro to use in the rate_info table */
+#define WLC_RATE_MASK_FULL 0xff /* Rate value mask with basic
rate flag */
#define WLC_RATE_500K_TO_BPS(rate) ((rate) * 500000) /* convert
500kbps to bps */
@@ -115,9 +116,9 @@ typedef u32 ratespec_t;
/* Rate info table; takes a legacy rate or ratespec_t */
#define IS_MCS(r) (r & RSPEC_MIMORATE)
#define IS_OFDM(r) (!IS_MCS(r) && (rate_info[(r) &
RSPEC_RATE_MASK] & WLC_RATE_FLAG))
-#define IS_CCK(r) (!IS_MCS(r) && (((r) & RATE_MASK) ==
WLC_RATE_1M || \
- ((r) & RATE_MASK) == WLC_RATE_2M || \
- ((r) & RATE_MASK) == WLC_RATE_5M5 || ((r) & RATE_MASK)
== WLC_RATE_11M))
+#define IS_CCK(r) (!IS_MCS(r) && (((r) & WLC_RATE_MASK) ==
WLC_RATE_1M || \
+ ((r) & WLC_RATE_MASK) == WLC_RATE_2M || \
+ ((r) & WLC_RATE_MASK) == WLC_RATE_5M5 || ((r) &
WLC_RATE_MASK) == WLC_RATE_11M))
#define IS_SINGLE_STREAM(mcs) (((mcs) <= HIGHEST_SINGLE_STREAM_MCS) || ((mcs)
== 32))
#define CCK_RSPEC(cck) ((cck) & RSPEC_RATE_MASK)
#define OFDM_RSPEC(ofdm) (((ofdm) & RSPEC_RATE_MASK) |\
--
1.7.1
_______________________________________________
devel mailing list
[email protected]
http://driverdev.linuxdriverproject.org/mailman/listinfo/devel