* [PATCH] brcmsmac: restructure info->control.sta handling as it is goning to be removed soon.
@ 2012-06-29 4:15 Thomas Huehn
2012-06-29 6:48 ` Johannes Berg
0 siblings, 1 reply; 3+ messages in thread
From: Thomas Huehn @ 2012-06-29 4:15 UTC (permalink / raw)
To: linux-wireless
Cc: nbd, thomas, brcm80211-dev-list, pieterpg, gregkh, frankyl,
arend, rvossen, brudley, linville
brcmsmac uses info->control.sta while doing ampdu aggregation. This patch
changes the usage of the structure info->control.sta, as it is going to be
removed soon from struct ieee80211_tx_info. This patch is a pre-requisit in
order to add transmission power control (TPC) to the mac80211 subsystem.
Suggested-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: Thomas Huehn <thomas@net.t-labs.tu-berlin.de>
---
drivers/net/wireless/brcm80211/brcmsmac/ampdu.c | 10 +++++-----
drivers/net/wireless/brcm80211/brcmsmac/mac80211_if.c | 2 ++
drivers/net/wireless/brcm80211/brcmsmac/main.c | 2 +-
3 files changed, 8 insertions(+), 6 deletions(-)
diff --git a/drivers/net/wireless/brcm80211/brcmsmac/ampdu.c b/drivers/net/wireless/brcm80211/brcmsmac/ampdu.c
index 01b190a..d341c91 100644
--- a/drivers/net/wireless/brcm80211/brcmsmac/ampdu.c
+++ b/drivers/net/wireless/brcm80211/brcmsmac/ampdu.c
@@ -665,7 +665,7 @@ brcms_c_sendampdu(struct ampdu_info *ampdu, struct brcms_txq_info *qi,
u8 plcp0, plcp3, is40, sgi;
struct ieee80211_sta *sta;
- sta = tx_info->control.sta;
+ sta = tx_info->rate_driver_data[0];
if (rr) {
plcp0 = plcp[0];
@@ -1195,8 +1195,8 @@ static bool cb_del_ampdu_pkt(struct sk_buff *mpdu, void *arg_a)
bool rc;
rc = tx_info->flags & IEEE80211_TX_CTL_AMPDU ? true : false;
- rc = rc && (tx_info->control.sta == NULL || ampdu_pars->sta == NULL ||
- tx_info->control.sta == ampdu_pars->sta);
+ rc = rc && (tx_info->rate_driver_data[0] == NULL || ampdu_pars->sta == NULL ||
+ tx_info->rate_driver_data[0] == ampdu_pars->sta);
rc = rc && ((u8)(mpdu->priority) == ampdu_pars->tid);
return rc;
}
@@ -1210,8 +1210,8 @@ static void dma_cb_fn_ampdu(void *txi, void *arg_a)
struct ieee80211_tx_info *tx_info = (struct ieee80211_tx_info *)txi;
if ((tx_info->flags & IEEE80211_TX_CTL_AMPDU) &&
- (tx_info->control.sta == sta || sta == NULL))
- tx_info->control.sta = NULL;
+ (tx_info->rate_driver_data[0] == sta || sta == NULL))
+ tx_info->rate_driver_data[0] = NULL;
}
/*
diff --git a/drivers/net/wireless/brcm80211/brcmsmac/mac80211_if.c b/drivers/net/wireless/brcm80211/brcmsmac/mac80211_if.c
index 2d5a404..946779f 100644
--- a/drivers/net/wireless/brcm80211/brcmsmac/mac80211_if.c
+++ b/drivers/net/wireless/brcm80211/brcmsmac/mac80211_if.c
@@ -267,7 +267,9 @@ static void brcms_set_basic_rate(struct brcm_rateset *rs, u16 rate, bool is_br)
static void brcms_ops_tx(struct ieee80211_hw *hw, struct sk_buff *skb)
{
struct brcms_info *wl = hw->priv;
+ struct ieee80211_tx_info *tx_info = IEEE80211_SKB_CB(skb);
+ tx_info->rate_driver_data[0] = tx_info->control.sta;
spin_lock_bh(&wl->lock);
if (!wl->pub->up) {
wiphy_err(wl->wiphy, "ops->tx called while down\n");
diff --git a/drivers/net/wireless/brcm80211/brcmsmac/main.c b/drivers/net/wireless/brcm80211/brcmsmac/main.c
index 8776fbc..28dd37e3 100644
--- a/drivers/net/wireless/brcm80211/brcmsmac/main.c
+++ b/drivers/net/wireless/brcm80211/brcmsmac/main.c
@@ -879,7 +879,7 @@ brcms_c_dotxstatus(struct brcms_c_info *wlc, struct tx_status *txs)
tx_info = IEEE80211_SKB_CB(p);
h = (struct ieee80211_hdr *)((u8 *) (txh + 1) + D11_PHY_HDR_LEN);
- if (tx_info->control.sta)
+ if (tx_info->rate_driver_data[0])
scb = &wlc->pri_scb;
if (tx_info->flags & IEEE80211_TX_CTL_AMPDU) {
--
1.7.10.4
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] brcmsmac: restructure info->control.sta handling as it is goning to be removed soon.
2012-06-29 4:15 [PATCH] brcmsmac: restructure info->control.sta handling as it is goning to be removed soon Thomas Huehn
@ 2012-06-29 6:48 ` Johannes Berg
2012-06-29 12:57 ` thomas
0 siblings, 1 reply; 3+ messages in thread
From: Johannes Berg @ 2012-06-29 6:48 UTC (permalink / raw)
To: Thomas Huehn
Cc: linux-wireless, nbd, brcm80211-dev-list, pieterpg, gregkh,
frankyl, arend, rvossen, brudley, linville
On Thu, 2012-06-28 at 21:15 -0700, Thomas Huehn wrote:
> @@ -267,7 +267,9 @@ static void brcms_set_basic_rate(struct brcm_rateset *rs, u16 rate, bool is_br)
> static void brcms_ops_tx(struct ieee80211_hw *hw, struct sk_buff *skb)
> {
> struct brcms_info *wl = hw->priv;
> + struct ieee80211_tx_info *tx_info = IEEE80211_SKB_CB(skb);
>
> + tx_info->rate_driver_data[0] = tx_info->control.sta;
It seems that brcmsmac doesn't care about anything but the
tx_info->flags, but it would still seem safer to overwrite the data
before the function returns, rather than as the first thing?
johannes
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] brcmsmac: restructure info->control.sta handling as it is goning to be removed soon.
2012-06-29 6:48 ` Johannes Berg
@ 2012-06-29 12:57 ` thomas
0 siblings, 0 replies; 3+ messages in thread
From: thomas @ 2012-06-29 12:57 UTC (permalink / raw)
To: Johannes Berg
Cc: linux-wireless, nbd, brcm80211-dev-list, pieterpg, gregkh,
frankyl, arend, rvossen, brudley, linville
Johannes Berg schrieb:
> On Thu, 2012-06-28 at 21:15 -0700, Thomas Huehn wrote:
>> @@ -267,7 +267,9 @@ static void brcms_set_basic_rate(struct brcm_rateset *rs, u16 rate, bool is_br)
>> static void brcms_ops_tx(struct ieee80211_hw *hw, struct sk_buff *skb)
>> {
>> struct brcms_info *wl = hw->priv;
>> + struct ieee80211_tx_info *tx_info = IEEE80211_SKB_CB(skb);
>>
>> + tx_info->rate_driver_data[0] = tx_info->control.sta;
>
> It seems that brcmsmac doesn't care about anything but the
> tx_info->flags, but it would still seem safer to overwrite the data
> before the function returns, rather than as the first thing?
>
I will send a version 2.
Thx Johannes for the suggestion.
Thomas
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2012-06-29 12:57 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-06-29 4:15 [PATCH] brcmsmac: restructure info->control.sta handling as it is goning to be removed soon Thomas Huehn
2012-06-29 6:48 ` Johannes Berg
2012-06-29 12:57 ` thomas
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.