All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 18/18] wl1251: disable retry and ACK policy for injected packets
       [not found] <4D45A7BD.705@davizone.at>
@ 2011-01-30 19:11 ` David Gnedt
  2011-01-30 23:08   ` Gábor Stefanik
  0 siblings, 1 reply; 4+ messages in thread
From: David Gnedt @ 2011-01-30 19:11 UTC (permalink / raw)
  To: John W. Linville
  Cc: linux-wireless, Kalle Valo, Grazvydas Ignotas,
	Denis 'GNUtoo' Carikli

Set the retry limit to 0 and disable the ACK policy for injected packets.

Signed-off-by: David Gnedt <david.gnedt@davizone.at>
---
Sorry for the partly broken patches, I thought I configured my client the
right way. I tried to stop the mails at my mailserver, but it was mostly
already too late.
---
 drivers/net/wireless/wl1251/acx.c |    8 +++++++-
 drivers/net/wireless/wl1251/tx.c  |    7 ++++++-
 2 files changed, 13 insertions(+), 2 deletions(-)

diff --git a/drivers/net/wireless/wl1251/acx.c b/drivers/net/wireless/wl1251/acx.c
index 38d33f0..435ed08 100644
--- a/drivers/net/wireless/wl1251/acx.c
+++ b/drivers/net/wireless/wl1251/acx.c
@@ -947,12 +947,18 @@ int wl1251_acx_rate_policies(struct wl1251 *wl)
 	}
 
 	/* configure one default (one-size-fits-all) rate class */
-	acx->rate_class_cnt = 1;
+	acx->rate_class_cnt = 2;
 	acx->rate_class[0].enabled_rates = ACX_RATE_MASK_UNSPECIFIED;
 	acx->rate_class[0].short_retry_limit = ACX_RATE_RETRY_LIMIT;
 	acx->rate_class[0].long_retry_limit = ACX_RATE_RETRY_LIMIT;
 	acx->rate_class[0].aflags = 0;
 
+	/* no-retry rate class */
+	acx->rate_class[1].enabled_rates = ACX_RATE_MASK_UNSPECIFIED;
+	acx->rate_class[1].short_retry_limit = 0;
+	acx->rate_class[1].long_retry_limit = 0;
+	acx->rate_class[1].aflags = 0;
+
 	ret = wl1251_cmd_configure(wl, ACX_RATE_POLICY, acx, sizeof(*acx));
 	if (ret < 0) {
 		wl1251_warning("Setting of rate policies failed: %d", ret);
diff --git a/drivers/net/wireless/wl1251/tx.c b/drivers/net/wireless/wl1251/tx.c
index 1de4ccb..e559bc4 100644
--- a/drivers/net/wireless/wl1251/tx.c
+++ b/drivers/net/wireless/wl1251/tx.c
@@ -90,8 +90,12 @@ static void wl1251_tx_control(struct tx_double_buffer_desc *tx_hdr,
 	/* 802.11 packets */
 	tx_hdr->control.packet_type = 0;
 
-	if (control->flags & IEEE80211_TX_CTL_NO_ACK)
+	/* Also disable retry and ACK policy for injected packets */
+	if ((control->flags & IEEE80211_TX_CTL_NO_ACK) ||
+	    (control->flags & IEEE80211_TX_CTL_INJECTED)) {
+		tx_hdr->control.rate_policy = 1;
 		tx_hdr->control.ack_policy = 1;
+	}
 
 	tx_hdr->control.tx_complete = 1;
 
@@ -414,6 +418,7 @@ static void wl1251_tx_packet_cb(struct wl1251 *wl,
 	info = IEEE80211_SKB_CB(skb);
 
 	if (!(info->flags & IEEE80211_TX_CTL_NO_ACK) &&
+	    !(info->flags & IEEE80211_TX_CTL_INJECTED) &&
 	    (result->status == TX_SUCCESS))
 		info->flags |= IEEE80211_TX_STAT_ACK;
 
-- 
1.7.0.4



^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH 18/18] wl1251: disable retry and ACK policy for injected packets
  2011-01-30 19:11 ` [PATCH 18/18] wl1251: disable retry and ACK policy for injected packets David Gnedt
@ 2011-01-30 23:08   ` Gábor Stefanik
  2011-01-31 16:04     ` Kalle Valo
  0 siblings, 1 reply; 4+ messages in thread
From: Gábor Stefanik @ 2011-01-30 23:08 UTC (permalink / raw)
  To: David Gnedt
  Cc: John W. Linville, linux-wireless, Kalle Valo, Grazvydas Ignotas,
	Denis 'GNUtoo' Carikli

On Sun, Jan 30, 2011 at 8:11 PM, David Gnedt <david.gnedt@davizone.at> wrote:
> Set the retry limit to 0 and disable the ACK policy for injected packets.
>
> Signed-off-by: David Gnedt <david.gnedt@davizone.at>
> ---
> Sorry for the partly broken patches, I thought I configured my client the
> right way. I tried to stop the mails at my mailserver, but it was mostly
> already too late.
> ---
>  drivers/net/wireless/wl1251/acx.c |    8 +++++++-
>  drivers/net/wireless/wl1251/tx.c  |    7 ++++++-
>  2 files changed, 13 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/net/wireless/wl1251/acx.c b/drivers/net/wireless/wl1251/acx.c
> index 38d33f0..435ed08 100644
> --- a/drivers/net/wireless/wl1251/acx.c
> +++ b/drivers/net/wireless/wl1251/acx.c
> @@ -947,12 +947,18 @@ int wl1251_acx_rate_policies(struct wl1251 *wl)
>        }
>
>        /* configure one default (one-size-fits-all) rate class */
> -       acx->rate_class_cnt = 1;
> +       acx->rate_class_cnt = 2;
>        acx->rate_class[0].enabled_rates = ACX_RATE_MASK_UNSPECIFIED;
>        acx->rate_class[0].short_retry_limit = ACX_RATE_RETRY_LIMIT;
>        acx->rate_class[0].long_retry_limit = ACX_RATE_RETRY_LIMIT;
>        acx->rate_class[0].aflags = 0;
>
> +       /* no-retry rate class */
> +       acx->rate_class[1].enabled_rates = ACX_RATE_MASK_UNSPECIFIED;
> +       acx->rate_class[1].short_retry_limit = 0;
> +       acx->rate_class[1].long_retry_limit = 0;
> +       acx->rate_class[1].aflags = 0;
> +
>        ret = wl1251_cmd_configure(wl, ACX_RATE_POLICY, acx, sizeof(*acx));
>        if (ret < 0) {
>                wl1251_warning("Setting of rate policies failed: %d", ret);
> diff --git a/drivers/net/wireless/wl1251/tx.c b/drivers/net/wireless/wl1251/tx.c
> index 1de4ccb..e559bc4 100644
> --- a/drivers/net/wireless/wl1251/tx.c
> +++ b/drivers/net/wireless/wl1251/tx.c
> @@ -90,8 +90,12 @@ static void wl1251_tx_control(struct tx_double_buffer_desc *tx_hdr,
>        /* 802.11 packets */
>        tx_hdr->control.packet_type = 0;
>
> -       if (control->flags & IEEE80211_TX_CTL_NO_ACK)
> +       /* Also disable retry and ACK policy for injected packets */
> +       if ((control->flags & IEEE80211_TX_CTL_NO_ACK) ||
> +           (control->flags & IEEE80211_TX_CTL_INJECTED)) {
> +               tx_hdr->control.rate_policy = 1;
>                tx_hdr->control.ack_policy = 1;
> +       }
>
>        tx_hdr->control.tx_complete = 1;
>
> @@ -414,6 +418,7 @@ static void wl1251_tx_packet_cb(struct wl1251 *wl,
>        info = IEEE80211_SKB_CB(skb);
>
>        if (!(info->flags & IEEE80211_TX_CTL_NO_ACK) &&
> +           !(info->flags & IEEE80211_TX_CTL_INJECTED) &&
>            (result->status == TX_SUCCESS))
>                info->flags |= IEEE80211_TX_STAT_ACK;
>
> --
> 1.7.0.4
>
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>

Hi,

Unfortunately this is not the right thing to do - something like this
should be done in mac80211, but triggered by radiotap (sometimes, it
makes sense to inject packets and expect ACKs). See the list for
earlier discussions about the TX Flags field, and
patches.aircrack-ng.org for a proof-of-concept implementation.

--Gábor

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH 18/18] wl1251: disable retry and ACK policy for injected packets
  2011-01-30 23:08   ` Gábor Stefanik
@ 2011-01-31 16:04     ` Kalle Valo
  2011-01-31 23:02       ` David Gnedt
  0 siblings, 1 reply; 4+ messages in thread
From: Kalle Valo @ 2011-01-31 16:04 UTC (permalink / raw)
  To: Gábor Stefanik
  Cc: David Gnedt, John W. Linville, linux-wireless, Grazvydas Ignotas,
	Denis 'GNUtoo' Carikli

Gábor Stefanik <netrolller.3d@gmail.com> writes:

> On Sun, Jan 30, 2011 at 8:11 PM, David Gnedt <david.gnedt@davizone.at> wrote:
>> Set the retry limit to 0 and disable the ACK policy for injected
>> packets.
>
> Unfortunately this is not the right thing to do - something like this
> should be done in mac80211, but triggered by radiotap (sometimes, it
> makes sense to inject packets and expect ACKs). See the list for
> earlier discussions about the TX Flags field, and
> patches.aircrack-ng.org for a proof-of-concept implementation.

Agreed. Again I prefer the less-logic-in-the-driver philosophy.

-- 
Kalle Valo

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH 18/18] wl1251: disable retry and ACK policy for injected packets
  2011-01-31 16:04     ` Kalle Valo
@ 2011-01-31 23:02       ` David Gnedt
  0 siblings, 0 replies; 4+ messages in thread
From: David Gnedt @ 2011-01-31 23:02 UTC (permalink / raw)
  To: Kalle Valo
  Cc: Gábor Stefanik, John W. Linville, linux-wireless,
	Grazvydas Ignotas, Denis 'GNUtoo' Carikli

Am 2011-01-31 17:04, schrieb Kalle Valo:
> Gábor Stefanik <netrolller.3d@gmail.com> writes:
> 
>> On Sun, Jan 30, 2011 at 8:11 PM, David Gnedt <david.gnedt@davizone.at> wrote:
>>> Set the retry limit to 0 and disable the ACK policy for injected
>>> packets.
>>
>> Unfortunately this is not the right thing to do - something like this
>> should be done in mac80211, but triggered by radiotap (sometimes, it
>> makes sense to inject packets and expect ACKs). See the list for
>> earlier discussions about the TX Flags field, and
>> patches.aircrack-ng.org for a proof-of-concept implementation.
> 
> Agreed. Again I prefer the less-logic-in-the-driver philosophy.

Yeah, you are right. I will remove the IEEE80211_TX_CTL_INJECTED check, but I
think the rate class setting for IEEE80211_TX_CTL_NO_ACK frames is still needed,
as my testing showed that the ack_policy setting is not sufficient to disable
retries.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2011-01-31 23:03 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <4D45A7BD.705@davizone.at>
2011-01-30 19:11 ` [PATCH 18/18] wl1251: disable retry and ACK policy for injected packets David Gnedt
2011-01-30 23:08   ` Gábor Stefanik
2011-01-31 16:04     ` Kalle Valo
2011-01-31 23:02       ` David Gnedt

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.