* [PATCH] adm8211: remove masking of protected bit
@ 2008-06-20 3:34 Harvey Harrison
2008-06-20 6:48 ` Johannes Berg
2008-06-22 2:21 ` Michael Wu
0 siblings, 2 replies; 4+ messages in thread
From: Harvey Harrison @ 2008-06-20 3:34 UTC (permalink / raw)
To: Michael Wu; +Cc: linux-wireless, John Linville
Use the ieee80211_hdrlen helper to avoid byteshifting.
The masking of the protected bit made the two tests below never trigger.
Possibly a bugfix.
Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com>
---
I'm not sure if this was intentional, please review. If it was intentional
the two if-blocks should probably be deleted.
drivers/net/wireless/adm8211.c | 8 +++-----
1 files changed, 3 insertions(+), 5 deletions(-)
diff --git a/drivers/net/wireless/adm8211.c b/drivers/net/wireless/adm8211.c
index 0ba55ba..ed650d7 100644
--- a/drivers/net/wireless/adm8211.c
+++ b/drivers/net/wireless/adm8211.c
@@ -1685,7 +1685,6 @@ static void adm8211_tx_raw(struct ieee80211_hw *dev, struct sk_buff *skb,
static int adm8211_tx(struct ieee80211_hw *dev, struct sk_buff *skb)
{
struct adm8211_tx_hdr *txhdr;
- u16 fc;
size_t payload_len, hdrlen;
int plcp, dur, len, plcp_signal, short_preamble;
struct ieee80211_hdr *hdr;
@@ -1696,8 +1695,7 @@ static int adm8211_tx(struct ieee80211_hw *dev, struct sk_buff *skb)
plcp_signal = txrate->bitrate;
hdr = (struct ieee80211_hdr *)skb->data;
- fc = le16_to_cpu(hdr->frame_control) & ~IEEE80211_FCTL_PROTECTED;
- hdrlen = ieee80211_get_hdrlen(fc);
+ hdrlen = ieee80211_hdrlen(hdr->frame_control);
memcpy(skb->cb, skb->data, hdrlen);
hdr = (struct ieee80211_hdr *)skb->cb;
skb_pull(skb, hdrlen);
@@ -1711,7 +1709,7 @@ static int adm8211_tx(struct ieee80211_hw *dev, struct sk_buff *skb)
txhdr->frame_control = hdr->frame_control;
len = hdrlen + payload_len + FCS_LEN;
- if (fc & IEEE80211_FCTL_PROTECTED)
+ if (ieee80211_has_protected(hdr->frame_control))
len += 8;
txhdr->frag = cpu_to_le16(0x0FFF);
@@ -1730,7 +1728,7 @@ static int adm8211_tx(struct ieee80211_hw *dev, struct sk_buff *skb)
if (info->flags & IEEE80211_TX_CTL_USE_RTS_CTS)
txhdr->header_control |= cpu_to_le16(ADM8211_TXHDRCTL_ENABLE_RTS);
- if (fc & IEEE80211_FCTL_PROTECTED)
+ if (ieee80211_has_protected(hdr->frame_control))
txhdr->header_control |= cpu_to_le16(ADM8211_TXHDRCTL_ENABLE_WEP_ENGINE);
txhdr->retry_limit = info->control.retry_limit;
--
1.5.6.290.gc4e15
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] adm8211: remove masking of protected bit
2008-06-20 3:34 [PATCH] adm8211: remove masking of protected bit Harvey Harrison
@ 2008-06-20 6:48 ` Johannes Berg
2008-06-22 2:21 ` Michael Wu
1 sibling, 0 replies; 4+ messages in thread
From: Johannes Berg @ 2008-06-20 6:48 UTC (permalink / raw)
To: Harvey Harrison; +Cc: Michael Wu, linux-wireless, John Linville
[-- Attachment #1: Type: text/plain, Size: 562 bytes --]
On Thu, 2008-06-19 at 20:34 -0700, Harvey Harrison wrote:
> Use the ieee80211_hdrlen helper to avoid byteshifting.
>
> The masking of the protected bit made the two tests below never trigger.
> I'm not sure if this was intentional, please review. If it was intentional
> the two if-blocks should probably be deleted.
It was intentional, I think I asked before, adm8211 doesn't support hw
crypto. But I agree, those code blocks should be deleted since the
driver shouldn't use that bit anyway to detect whether to do hw crypto
or not.
johannes
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] adm8211: remove masking of protected bit
2008-06-20 3:34 [PATCH] adm8211: remove masking of protected bit Harvey Harrison
2008-06-20 6:48 ` Johannes Berg
@ 2008-06-22 2:21 ` Michael Wu
2008-06-22 2:33 ` [PATCH] adm8211: remove unnecessary protected bit mask/check Harvey Harrison
1 sibling, 1 reply; 4+ messages in thread
From: Michael Wu @ 2008-06-22 2:21 UTC (permalink / raw)
To: Harvey Harrison; +Cc: linux-wireless, John Linville
[-- Attachment #1: Type: text/plain, Size: 419 bytes --]
On Thursday 19 June 2008 23:34:10 Harvey Harrison wrote:
> I'm not sure if this was intentional, please review. If it was intentional
> the two if-blocks should probably be deleted.
>
This was intentional. The key configuration code for adm8211 was never hooked
up so the hardware can't do encryption. You can remove the checks for the
protected frame bit. Just leave the local fc variable in.
-Michael Wu
[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 194 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH] adm8211: remove unnecessary protected bit mask/check
2008-06-22 2:21 ` Michael Wu
@ 2008-06-22 2:33 ` Harvey Harrison
0 siblings, 0 replies; 4+ messages in thread
From: Harvey Harrison @ 2008-06-22 2:33 UTC (permalink / raw)
To: Michael Wu; +Cc: linux-wireless, John Linville
Removes now unused fc local var and uses the new ieee80211_hdrlen
which directly uses the le16 frame control value.
Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com>
---
drivers/net/wireless/adm8211.c | 9 +--------
1 files changed, 1 insertions(+), 8 deletions(-)
diff --git a/drivers/net/wireless/adm8211.c b/drivers/net/wireless/adm8211.c
index 0ba55ba..3333d45 100644
--- a/drivers/net/wireless/adm8211.c
+++ b/drivers/net/wireless/adm8211.c
@@ -1685,7 +1685,6 @@ static void adm8211_tx_raw(struct ieee80211_hw *dev, struct sk_buff *skb,
static int adm8211_tx(struct ieee80211_hw *dev, struct sk_buff *skb)
{
struct adm8211_tx_hdr *txhdr;
- u16 fc;
size_t payload_len, hdrlen;
int plcp, dur, len, plcp_signal, short_preamble;
struct ieee80211_hdr *hdr;
@@ -1696,8 +1695,7 @@ static int adm8211_tx(struct ieee80211_hw *dev, struct sk_buff *skb)
plcp_signal = txrate->bitrate;
hdr = (struct ieee80211_hdr *)skb->data;
- fc = le16_to_cpu(hdr->frame_control) & ~IEEE80211_FCTL_PROTECTED;
- hdrlen = ieee80211_get_hdrlen(fc);
+ hdrlen = ieee80211_hdrlen(hdr->frame_control);
memcpy(skb->cb, skb->data, hdrlen);
hdr = (struct ieee80211_hdr *)skb->cb;
skb_pull(skb, hdrlen);
@@ -1711,8 +1709,6 @@ static int adm8211_tx(struct ieee80211_hw *dev, struct sk_buff *skb)
txhdr->frame_control = hdr->frame_control;
len = hdrlen + payload_len + FCS_LEN;
- if (fc & IEEE80211_FCTL_PROTECTED)
- len += 8;
txhdr->frag = cpu_to_le16(0x0FFF);
adm8211_calc_durations(&dur, &plcp, payload_len,
@@ -1730,9 +1726,6 @@ static int adm8211_tx(struct ieee80211_hw *dev, struct sk_buff *skb)
if (info->flags & IEEE80211_TX_CTL_USE_RTS_CTS)
txhdr->header_control |= cpu_to_le16(ADM8211_TXHDRCTL_ENABLE_RTS);
- if (fc & IEEE80211_FCTL_PROTECTED)
- txhdr->header_control |= cpu_to_le16(ADM8211_TXHDRCTL_ENABLE_WEP_ENGINE);
-
txhdr->retry_limit = info->control.retry_limit;
adm8211_tx_raw(dev, skb, plcp_signal, hdrlen);
--
1.5.6.290.gc4e15
^ permalink raw reply related [flat|nested] 4+ messages in thread
end of thread, other threads:[~2008-06-22 2:33 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-06-20 3:34 [PATCH] adm8211: remove masking of protected bit Harvey Harrison
2008-06-20 6:48 ` Johannes Berg
2008-06-22 2:21 ` Michael Wu
2008-06-22 2:33 ` [PATCH] adm8211: remove unnecessary protected bit mask/check Harvey Harrison
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).