All of lore.kernel.org
 help / color / mirror / Atom feed
From: Michael Buesch <mb@bu3sch.de>
To: Harvey Harrison <harvey.harrison@gmail.com>
Cc: John Linville <linville@tuxdriver.com>,
	linux-wireless <linux-wireless@vger.kernel.org>
Subject: Re: [PATCH 3/4] b43: use frame control helpers
Date: Sun, 15 Jun 2008 12:38:14 +0200	[thread overview]
Message-ID: <200806151238.14474.mb@bu3sch.de> (raw)
In-Reply-To: <1213511619.11544.32.camel@brick>

On Sunday 15 June 2008 08:33:39 Harvey Harrison wrote:
> Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com>

ACK.

> ---
>  drivers/net/wireless/b43/xmit.c |   17 +++++++----------
>  1 files changed, 7 insertions(+), 10 deletions(-)
> 
> diff --git a/drivers/net/wireless/b43/xmit.c b/drivers/net/wireless/b43/xmit.c
> index f9e1cff..bf6f6c1 100644
> --- a/drivers/net/wireless/b43/xmit.c
> +++ b/drivers/net/wireless/b43/xmit.c
> @@ -193,7 +193,7 @@ int b43_generate_txhdr(struct b43_wldev *dev,
>  	const struct ieee80211_hdr *wlhdr =
>  	    (const struct ieee80211_hdr *)fragment_data;
>  	int use_encryption = (!(info->flags & IEEE80211_TX_CTL_DO_NOT_ENCRYPT));
> -	u16 fctl = le16_to_cpu(wlhdr->frame_control);
> +	__le16 fctl = wlhdr->frame_control;
>  	struct ieee80211_rate *fbrate;
>  	u8 rate, rate_fb;
>  	int rate_ofdm, rate_fb_ofdm;
> @@ -259,7 +259,7 @@ int b43_generate_txhdr(struct b43_wldev *dev,
>  			   B43_TXH_MAC_KEYIDX;
>  		mac_ctl |= (key->algorithm << B43_TXH_MAC_KEYALG_SHIFT) &
>  			   B43_TXH_MAC_KEYALG;
> -		wlhdr_len = ieee80211_get_hdrlen(fctl);
> +		wlhdr_len = ieee80211_hdrlen(fctl);
>  		iv_len = min((size_t) info->control.iv_len,
>  			     ARRAY_SIZE(txhdr->iv));
>  		memcpy(txhdr->iv, ((u8 *) wlhdr) + wlhdr_len, iv_len);
> @@ -317,8 +317,7 @@ int b43_generate_txhdr(struct b43_wldev *dev,
>  	/* MAC control */
>  	if (!(info->flags & IEEE80211_TX_CTL_NO_ACK))
>  		mac_ctl |= B43_TXH_MAC_ACK;
> -	if (!(((fctl & IEEE80211_FCTL_FTYPE) == IEEE80211_FTYPE_CTL) &&
> -	      ((fctl & IEEE80211_FCTL_STYPE) == IEEE80211_STYPE_PSPOLL)))
> +	if (!ieee80211_is_pspoll(fctl))
>  		mac_ctl |= B43_TXH_MAC_HWSEQ;
>  	if (info->flags & IEEE80211_TX_CTL_FIRST_FRAGMENT)
>  		mac_ctl |= B43_TXH_MAC_STMSDU;
> @@ -509,7 +508,7 @@ void b43_rx(struct b43_wldev *dev, struct sk_buff *skb, const void *_rxhdr)
>  	struct b43_plcp_hdr6 *plcp;
>  	struct ieee80211_hdr *wlhdr;
>  	const struct b43_rxhdr_fw4 *rxhdr = _rxhdr;
> -	u16 fctl;
> +	__le16 fctl;
>  	u16 phystat0, phystat3, chanstat, mactime;
>  	u32 macstat;
>  	u16 chanid;
> @@ -549,7 +548,7 @@ void b43_rx(struct b43_wldev *dev, struct sk_buff *skb, const void *_rxhdr)
>  		goto drop;
>  	}
>  	wlhdr = (struct ieee80211_hdr *)(skb->data);
> -	fctl = le16_to_cpu(wlhdr->frame_control);
> +	fctl = wlhdr->frame_control;
>  
>  	if (macstat & B43_RX_MAC_DEC) {
>  		unsigned int keyidx;
> @@ -564,7 +563,7 @@ void b43_rx(struct b43_wldev *dev, struct sk_buff *skb, const void *_rxhdr)
>  		B43_WARN_ON(keyidx >= dev->max_nr_keys);
>  
>  		if (dev->key[keyidx].algorithm != B43_SEC_ALGO_NONE) {
> -			wlhdr_len = ieee80211_get_hdrlen(fctl);
> +			wlhdr_len = ieee80211_hdrlen(fctl);
>  			if (unlikely(skb->len < (wlhdr_len + 3))) {
>  				b43dbg(dev->wl,
>  				       "RX: Packet size underrun (3)\n");
> @@ -604,9 +603,7 @@ void b43_rx(struct b43_wldev *dev, struct sk_buff *skb, const void *_rxhdr)
>  	 * of timestamp, i.e. about 65 milliseconds after the PHY received
>  	 * the first symbol.
>  	 */
> -	if (((fctl & (IEEE80211_FCTL_FTYPE | IEEE80211_FCTL_STYPE))
> -	    == (IEEE80211_FTYPE_MGMT | IEEE80211_STYPE_BEACON)) ||
> -	    dev->wl->radiotap_enabled) {
> +	if (ieee80211_is_beacon(fctl) || dev->wl->radiotap_enabled) {
>  		u16 low_mactime_now;
>  
>  		b43_tsf_read(dev, &status.mactime);



-- 
Greetings Michael.

      reply	other threads:[~2008-06-15 10:38 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-06-15  6:33 [PATCH 3/4] b43: use frame control helpers Harvey Harrison
2008-06-15 10:38 ` Michael Buesch [this message]

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=200806151238.14474.mb@bu3sch.de \
    --to=mb@bu3sch.de \
    --cc=harvey.harrison@gmail.com \
    --cc=linux-wireless@vger.kernel.org \
    --cc=linville@tuxdriver.com \
    /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 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.