* RFC: Store premable and g-mode flags in ieee80211_tx_info
@ 2010-09-28 17:25 Ben Greear
2010-09-28 17:48 ` Johannes Berg
0 siblings, 1 reply; 6+ messages in thread
From: Ben Greear @ 2010-09-28 17:25 UTC (permalink / raw)
To: linux-wireless@vger.kernel.org
This way, you don't need to pass vif to ieee80211_rts_duration.
diff --git a/include/net/mac80211.h b/include/net/mac80211.h
index fe8b9da..5d3de80 100644
--- a/include/net/mac80211.h
+++ b/include/net/mac80211.h
@@ -321,6 +321,8 @@ struct ieee80211_bss_conf {
* @IEEE80211_TX_CTL_LDPC: tells the driver to use LDPC for this frame
* @IEEE80211_TX_CTL_STBC: Enables Space-Time Block Coding (STBC) for this
* frame and selects the maximum number of streams that it can use.
+ * @IEEE80211_TX_SHORT_PREAMBLE: Sdata->vif is configured for short_preamble.
+ * @IEEE80211_TX_GMODE: Sdata is configured for GMode.
*
* Note: If you have to add new flags to the enumeration, then don't
* forget to update %IEEE80211_TX_TEMPORARY_FLAGS when necessary.
@@ -349,6 +351,8 @@ enum mac80211_tx_control_flags {
IEEE80211_TX_INTFL_NL80211_FRAME_TX = BIT(21),
IEEE80211_TX_CTL_LDPC = BIT(22),
IEEE80211_TX_CTL_STBC = BIT(23) | BIT(24),
+ IEEE80211_TX_SHORT_PREABLE = BIT(25),
+ IEEE80211_TX_GMODE = BIT(26),
};
#define IEEE80211_TX_CTL_STBC_SHIFT 23
diff --git a/net/mac80211/tx.c b/net/mac80211/tx.c
index e1733dc..0ed22b5 100644
--- a/net/mac80211/tx.c
+++ b/net/mac80211/tx.c
@@ -1264,6 +1264,14 @@ ieee80211_tx_prepare(struct ieee80211_sub_if_data *sdata,
}
info->flags |= IEEE80211_TX_CTL_FIRST_FRAGMENT;
+ /* Set this here so drivers don't need to reference vif
+ * when calling ieee80211_rts_duration
+ */
+ if (sdata->vif.bss_conf.use_short_preamble)
+ tx.flags |= IEEE80211_TX_SHORT_PREABLE;
+ if (sdata->flags & IEEE80211_SDATA_OPERATING_GMODE)
+ tx.flags |= IEEE80211_TX_GMODE
+
return TX_CONTINUE;
}
diff --git a/net/mac80211/util.c b/net/mac80211/util.c
index aba025d..bd2227d 100644
--- a/net/mac80211/util.c
+++ b/net/mac80211/util.c
@@ -209,6 +209,10 @@ __le16 ieee80211_rts_duration(struct ieee80211_hw *hw,
short_preamble = sdata->vif.bss_conf.use_short_preamble;
if (sdata->flags & IEEE80211_SDATA_OPERATING_GMODE)
erp = rate->flags & IEEE80211_RATE_ERP_G;
+ } else {
+ short_preamble = !!(frame_txctl->flags & IEEE80211_TX_SHORT_PREABLE);
+ if (frame_txctl->flags & IEEE80211_TX_GMODE)
+ erp = rate->flags & IEEE80211_RATE_ERP_G;
}
/* CTS duration */
--
Ben Greear <greearb@candelatech.com>
Candela Technologies Inc http://www.candelatech.com
^ permalink raw reply related [flat|nested] 6+ messages in thread* Re: RFC: Store premable and g-mode flags in ieee80211_tx_info
2010-09-28 17:25 RFC: Store premable and g-mode flags in ieee80211_tx_info Ben Greear
@ 2010-09-28 17:48 ` Johannes Berg
2010-09-28 17:56 ` Ben Greear
0 siblings, 1 reply; 6+ messages in thread
From: Johannes Berg @ 2010-09-28 17:48 UTC (permalink / raw)
To: Ben Greear; +Cc: linux-wireless@vger.kernel.org
On Tue, 2010-09-28 at 10:25 -0700, Ben Greear wrote:
> This way, you don't need to pass vif to ieee80211_rts_duration.
> --- a/net/mac80211/tx.c
> +++ b/net/mac80211/tx.c
> @@ -1264,6 +1264,14 @@ ieee80211_tx_prepare(struct ieee80211_sub_if_data *sdata,
> }
> info->flags |= IEEE80211_TX_CTL_FIRST_FRAGMENT;
>
> + /* Set this here so drivers don't need to reference vif
> + * when calling ieee80211_rts_duration
> + */
> + if (sdata->vif.bss_conf.use_short_preamble)
> + tx.flags |= IEEE80211_TX_SHORT_PREABLE;
> + if (sdata->flags & IEEE80211_SDATA_OPERATING_GMODE)
> + tx.flags |= IEEE80211_TX_GMODE
Don't understand -- tx.flags? Drivers don't reference that? How would a
driver use this?
johannes
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: RFC: Store premable and g-mode flags in ieee80211_tx_info
2010-09-28 17:48 ` Johannes Berg
@ 2010-09-28 17:56 ` Ben Greear
2010-09-28 18:53 ` Johannes Berg
0 siblings, 1 reply; 6+ messages in thread
From: Ben Greear @ 2010-09-28 17:56 UTC (permalink / raw)
To: Johannes Berg; +Cc: linux-wireless@vger.kernel.org
On 09/28/2010 10:48 AM, Johannes Berg wrote:
> On Tue, 2010-09-28 at 10:25 -0700, Ben Greear wrote:
>> This way, you don't need to pass vif to ieee80211_rts_duration.
>
>
>> --- a/net/mac80211/tx.c
>> +++ b/net/mac80211/tx.c
>> @@ -1264,6 +1264,14 @@ ieee80211_tx_prepare(struct ieee80211_sub_if_data *sdata,
>> }
>> info->flags |= IEEE80211_TX_CTL_FIRST_FRAGMENT;
>>
>> + /* Set this here so drivers don't need to reference vif
>> + * when calling ieee80211_rts_duration
>> + */
>> + if (sdata->vif.bss_conf.use_short_preamble)
>> + tx.flags |= IEEE80211_TX_SHORT_PREABLE;
>> + if (sdata->flags& IEEE80211_SDATA_OPERATING_GMODE)
>> + tx.flags |= IEEE80211_TX_GMODE
>
> Don't understand -- tx.flags? Drivers don't reference that? How would a
> driver use this?
Sorry, it should be info->flags,
and missing a semi-colon...I guess I forgot to compile :P
Anyway, the reason is that the driver may not know the VIF (and
vif may be deleted) when calling the ieee80211_rts_duration, so it needs to be stored
in the tx_info structure.
Thanks,
Ben
>
> johannes
--
Ben Greear <greearb@candelatech.com>
Candela Technologies Inc http://www.candelatech.com
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: RFC: Store premable and g-mode flags in ieee80211_tx_info
2010-09-28 17:56 ` Ben Greear
@ 2010-09-28 18:53 ` Johannes Berg
2010-09-28 19:01 ` Ben Greear
0 siblings, 1 reply; 6+ messages in thread
From: Johannes Berg @ 2010-09-28 18:53 UTC (permalink / raw)
To: Ben Greear; +Cc: linux-wireless@vger.kernel.org
On Tue, 2010-09-28 at 10:56 -0700, Ben Greear wrote:
> Anyway, the reason is that the driver may not know the VIF (and
> vif may be deleted) when calling the ieee80211_rts_duration, so it needs to be stored
> in the tx_info structure.
But the vif pointer in the tx_info structure is valid during the entire
tx() call, why would you need to call rts_duration during TX status?
johannes
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: RFC: Store premable and g-mode flags in ieee80211_tx_info
2010-09-28 18:53 ` Johannes Berg
@ 2010-09-28 19:01 ` Ben Greear
2010-09-28 19:11 ` Johannes Berg
0 siblings, 1 reply; 6+ messages in thread
From: Ben Greear @ 2010-09-28 19:01 UTC (permalink / raw)
To: Johannes Berg; +Cc: linux-wireless@vger.kernel.org
On 09/28/2010 11:53 AM, Johannes Berg wrote:
> On Tue, 2010-09-28 at 10:56 -0700, Ben Greear wrote:
>
>> Anyway, the reason is that the driver may not know the VIF (and
>> vif may be deleted) when calling the ieee80211_rts_duration, so it needs to be stored
>> in the tx_info structure.
>
> But the vif pointer in the tx_info structure is valid during the entire
> tx() call, why would you need to call rts_duration during TX status?
Err, I guess you are right. I was thinking it might retransmit sometime
later, but at least ath5k doesn't appear to do this.
I'll remove that part of the patch unless someone thinks of a reason
to keep it.
Thanks,
Ben
>
> johannes
--
Ben Greear <greearb@candelatech.com>
Candela Technologies Inc http://www.candelatech.com
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: RFC: Store premable and g-mode flags in ieee80211_tx_info
2010-09-28 19:01 ` Ben Greear
@ 2010-09-28 19:11 ` Johannes Berg
0 siblings, 0 replies; 6+ messages in thread
From: Johannes Berg @ 2010-09-28 19:11 UTC (permalink / raw)
To: Ben Greear; +Cc: linux-wireless@vger.kernel.org
On Tue, 2010-09-28 at 12:01 -0700, Ben Greear wrote:
> On 09/28/2010 11:53 AM, Johannes Berg wrote:
> > On Tue, 2010-09-28 at 10:56 -0700, Ben Greear wrote:
> >
> >> Anyway, the reason is that the driver may not know the VIF (and
> >> vif may be deleted) when calling the ieee80211_rts_duration, so it needs to be stored
> >> in the tx_info structure.
> >
> > But the vif pointer in the tx_info structure is valid during the entire
> > tx() call, why would you need to call rts_duration during TX status?
>
> Err, I guess you are right. I was thinking it might retransmit sometime
> later, but at least ath5k doesn't appear to do this.
mac80211 has retransmit support, but that'll go through TX with a valid
vif pointer again ...
johannes
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2010-09-28 19:11 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-09-28 17:25 RFC: Store premable and g-mode flags in ieee80211_tx_info Ben Greear
2010-09-28 17:48 ` Johannes Berg
2010-09-28 17:56 ` Ben Greear
2010-09-28 18:53 ` Johannes Berg
2010-09-28 19:01 ` Ben Greear
2010-09-28 19:11 ` Johannes Berg
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).