From: "Franky Lin" <frankyl@broadcom.com>
To: gregkh@suse.de
Cc: devel@linuxdriverproject.org, linux-wireless@vger.kernel.org
Subject: [PATCH 03/20] staging: brcm80211: cleaning up tx rate control code in softmac
Date: Sun, 2 Oct 2011 10:14:28 -0700 [thread overview]
Message-ID: <1317575685-3156-4-git-send-email-frankyl@broadcom.com> (raw)
In-Reply-To: <1317575685-3156-1-git-send-email-frankyl@broadcom.com>
From: Roland Vossen <rvossen@broadcom.com>
Code cleanup. Code was unnecessarily complex.
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Signed-off-by: Franky Lin <frankyl@broadcom.com>
---
drivers/staging/brcm80211/brcmsmac/main.c | 19 +++++++------------
1 files changed, 7 insertions(+), 12 deletions(-)
diff --git a/drivers/staging/brcm80211/brcmsmac/main.c b/drivers/staging/brcm80211/brcmsmac/main.c
index e6bd3cf..10f1de2 100644
--- a/drivers/staging/brcm80211/brcmsmac/main.c
+++ b/drivers/staging/brcm80211/brcmsmac/main.c
@@ -7066,7 +7066,6 @@ brcms_c_d11hdrs_mac80211(struct brcms_c_info *wlc, struct ieee80211_hw *hw,
struct ieee80211_rts *rts = NULL;
bool qos;
uint ac;
- u32 rate_val[2];
bool hwtkmic = false;
u16 mimo_ctlchbw = PHY_TXC1_BW_20MHZ;
#define ANTCFG_NONE 0xFF
@@ -7077,7 +7076,7 @@ brcms_c_d11hdrs_mac80211(struct brcms_c_info *wlc, struct ieee80211_hw *hw,
struct ieee80211_tx_rate *txrate[2];
int k;
struct ieee80211_tx_info *tx_info;
- bool is_mcs[2];
+ bool is_mcs;
u16 mimo_txbw;
u8 mimo_preamble_type;
@@ -7137,13 +7136,12 @@ brcms_c_d11hdrs_mac80211(struct brcms_c_info *wlc, struct ieee80211_hw *hw,
txrate[1] = txrate[0];
for (k = 0; k < hw->max_rates; k++) {
- is_mcs[k] =
- txrate[k]->flags & IEEE80211_TX_RC_MCS ? true : false;
- if (!is_mcs[k]) {
+ is_mcs = txrate[k]->flags & IEEE80211_TX_RC_MCS ? true : false;
+ if (!is_mcs) {
if ((txrate[k]->idx >= 0)
&& (txrate[k]->idx <
hw->wiphy->bands[tx_info->band]->n_bitrates)) {
- rate_val[k] =
+ rspec[k] =
hw->wiphy->bands[tx_info->band]->
bitrates[txrate[k]->idx].hw_value;
short_preamble[k] =
@@ -7151,10 +7149,11 @@ brcms_c_d11hdrs_mac80211(struct brcms_c_info *wlc, struct ieee80211_hw *hw,
flags & IEEE80211_TX_RC_USE_SHORT_PREAMBLE ?
true : false;
} else {
- rate_val[k] = BRCM_RATE_1M;
+ rspec[k] = BRCM_RATE_1M;
}
} else {
- rate_val[k] = txrate[k]->idx;
+ rspec[k] = mac80211_wlc_set_nrate(wlc, wlc->band,
+ NRATE_MCS_INUSE | txrate[k]->idx);
}
/*
@@ -7169,10 +7168,6 @@ brcms_c_d11hdrs_mac80211(struct brcms_c_info *wlc, struct ieee80211_hw *hw,
txrate[k]->
flags & IEEE80211_TX_RC_USE_CTS_PROTECT ? true : false;
- if (is_mcs[k])
- rate_val[k] |= NRATE_MCS_INUSE;
-
- rspec[k] = mac80211_wlc_set_nrate(wlc, wlc->band, rate_val[k]);
/*
* (1) RATE:
--
1.7.1
next prev parent reply other threads:[~2011-10-02 17:14 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-10-02 17:14 [PATCH 00/20] staging: brcm80211: code clean up Franky Lin
2011-10-02 17:14 ` [PATCH 01/20] staging: brmc80211: removed some unused fmac variable declarations Franky Lin
2011-10-02 17:14 ` [PATCH 02/20] staging: brcm80211: removed unused smac tx ampdu packet queue Franky Lin
2011-10-02 17:14 ` Franky Lin [this message]
2011-10-02 17:14 ` [PATCH 04/20] staging: brcm80211: various __iomem additions to softmac Franky Lin
2011-10-10 14:23 ` Rafał Miłecki
2011-10-10 17:45 ` Dan Carpenter
2011-10-02 17:14 ` [PATCH 05/20] staging: brcm80211: reduced softmac sparse warnings Franky Lin
2011-10-02 17:14 ` [PATCH 06/20] staging: brcm80211: added __iomem qualifier to softmac main.c Franky Lin
2011-10-02 17:14 ` [PATCH 07/20] staging: brcm80211: added __iomem qualifier to softmac dma.c Franky Lin
2011-10-02 17:14 ` [PATCH 08/20] staging: brcm80211: added __iomem qualifier to softmac phy Franky Lin
2011-10-02 17:14 ` [PATCH 09/20] staging: brcm80211: only allow one call to add_interface callback Franky Lin
2011-10-02 17:14 ` [PATCH 10/20] staging: brcm80211: reduce indentation level in dhd_sdio.c #1 Franky Lin
2011-10-02 17:14 ` [PATCH 11/20] staging: brcm80211: reduce indentation level in dhd_sdio.c #2 Franky Lin
2011-10-02 17:14 ` [PATCH 12/20] staging: brcm80211: reduce indentation level in dhd_sdio.c #3 Franky Lin
2011-10-02 17:14 ` [PATCH 13/20] staging: brcm80211: reducing indentation levels in bcmsdh_sdmmc.c Franky Lin
2011-10-02 17:14 ` [PATCH 14/20] staging: brcm80211: removed unused fullmac spinlock Franky Lin
2011-10-02 17:14 ` [PATCH 15/20] staging: brcm80211: removed unused softmac mimo disable code Franky Lin
2011-10-02 17:14 ` [PATCH 16/20] staging: brcm80211: removed fullmac function brcmf_bus_devreset() Franky Lin
2011-10-02 17:14 ` [PATCH 17/20] staging: brcm80211: removed 'enforce_mutex' parameter in fullmac Franky Lin
2011-10-02 17:14 ` [PATCH 18/20] staging: brcm80211: renamed ioctl functions/structs to dcmd Franky Lin
2011-10-02 17:14 ` [PATCH 19/20] staging: brcm80211: cleaned up buffer len defines in fullmac Franky Lin
2011-10-02 17:14 ` [PATCH 20/20] staging: brcm80211: removed functionality to disable N mode Franky Lin
2011-10-03 23:23 ` [PATCH 00/20] staging: brcm80211: code clean up Greg KH
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1317575685-3156-4-git-send-email-frankyl@broadcom.com \
--to=frankyl@broadcom.com \
--cc=devel@linuxdriverproject.org \
--cc=gregkh@suse.de \
--cc=linux-wireless@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).