Linux wireless drivers development
 help / color / mirror / Atom feed
* Re: [RFC] rtl8180: change PCI DMA mask to DMA_BIT_MASK(32) to solve "No suitable DMA available" problems on sparc64.
From: John W. Linville @ 2009-10-28 19:11 UTC (permalink / raw)
  To: Tiziano Müller; +Cc: linux-wireless
In-Reply-To: <1252575463.30576.59.camel@localhost>

Can I get a "Signed-off-by:" line from you for this?

Thanks,

John

On Thu, Sep 10, 2009 at 11:37:43AM +0200, Tiziano Müller wrote:
> Hi there
> 
> I had problems to get my rtl8185 PCI card running on Sparc64: I always
> got an error about "No suitable DMA available" followed by an error
> that no device could be detected. When comparing the rtl8180 driver to
> others I noticed that others are mostly using DMA_BIT_MASK so I changed
> the custom mask to DMA_BIT_MASK(32) which fixed my issue.
> 
> Cheers,
> Tiziano
> 
> ---
>  drivers/net/wireless/rtl818x/rtl8180_dev.c |    4 ++--
>  1 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/net/wireless/rtl818x/rtl8180_dev.c b/drivers/net/wireless/rtl818x/rtl8180_dev.c
> index 16429c4..515f562 100644
> --- a/drivers/net/wireless/rtl818x/rtl8180_dev.c
> +++ b/drivers/net/wireless/rtl818x/rtl8180_dev.c
> @@ -850,8 +850,8 @@ static int __devinit rtl8180_probe(struct pci_dev *pdev,
>  		goto err_free_reg;
>  	}
>  
> -	if ((err = pci_set_dma_mask(pdev, 0xFFFFFF00ULL)) ||
> -	    (err = pci_set_consistent_dma_mask(pdev, 0xFFFFFF00ULL))) {
> +	if ((err = pci_set_dma_mask(pdev, DMA_BIT_MASK(32))) ||
> +	    (err = pci_set_consistent_dma_mask(pdev, DMA_BIT_MASK(32)))) {
>  		printk(KERN_ERR "%s (rtl8180): No suitable DMA available\n",
>  		       pci_name(pdev));
>  		goto err_free_reg;
> -- 
> 1.6.4
> 
> 

-- 
John W. Linville		Someday the world will need a hero, and you
linville@tuxdriver.com			might be all we have.  Be ready.

^ permalink raw reply

* Re: 2.6.32-rc5-git3: Reported regressions from 2.6.31
From: John W. Linville @ 2009-10-28 19:05 UTC (permalink / raw)
  To: Michael Buesch; +Cc: linux-wireless, Christian Casteyde, Johannes Berg
In-Reply-To: <200910262138.30396.mb@bu3sch.de>

Christian,

Will you be able to test this patch for us?

Thanks,

John

On Mon, Oct 26, 2009 at 09:38:28PM +0100, Michael Buesch wrote:
> On Monday 26 October 2009 20:37:33 Michael Buesch wrote:
> > Ok, it just turns out this actually is a driver bug.
> > Thanks to Johannes Berg for tracking it down.
> > 
> > I think it's caused by the DMA bouncebuffer stuff that does not copy the skb->cb
> > and does not adjust the "tx-info" pointer.
> > I wonder why this didn't blow up easlier, because this bug is there since mac80211
> > switched to using the CB.
> > 
> > Here's a completely untested patch.
> 
> Here's a new version of the patch that also fixes queue mapping bugs:
> 
> ---
>  drivers/net/wireless/b43/dma.c |   15 +++++++++++++--
>  1 file changed, 13 insertions(+), 2 deletions(-)
> 
> --- wireless-testing.orig/drivers/net/wireless/b43/dma.c
> +++ wireless-testing/drivers/net/wireless/b43/dma.c
> @@ -1157,8 +1157,9 @@ struct b43_dmaring *parse_cookie(struct 
>  }
>  
>  static int dma_tx_fragment(struct b43_dmaring *ring,
> -			   struct sk_buff *skb)
> +			   struct sk_buff **in_skb)
>  {
> +	struct sk_buff *skb = *in_skb;
>  	const struct b43_dma_ops *ops = ring->ops;
>  	struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb);
>  	u8 *header;
> @@ -1224,8 +1225,14 @@ static int dma_tx_fragment(struct b43_dm
>  		}
>  
>  		memcpy(skb_put(bounce_skb, skb->len), skb->data, skb->len);
> +		memcpy(bounce_skb->cb, skb->cb, sizeof(skb->cb));
> +		bounce_skb->dev = skb->dev;
> +		skb_set_queue_mapping(bounce_skb, skb_get_queue_mapping(skb));
> +		info = IEEE80211_SKB_CB(bounce_skb);
> +
>  		dev_kfree_skb_any(skb);
>  		skb = bounce_skb;
> +		*in_skb = bounce_skb;
>  		meta->skb = skb;
>  		meta->dmaaddr = map_descbuffer(ring, skb->data, skb->len, 1);
>  		if (b43_dma_mapping_error(ring, meta->dmaaddr, skb->len, 1)) {
> @@ -1355,7 +1362,11 @@ int b43_dma_tx(struct b43_wldev *dev, st
>  	 * static, so we don't need to store it per frame. */
>  	ring->queue_prio = skb_get_queue_mapping(skb);
>  
> -	err = dma_tx_fragment(ring, skb);
> +	/* dma_tx_fragment might reallocate the skb, so invalidate pointers pointing
> +	 * into the skb data or cb now. */
> +	hdr = NULL;
> +	info = NULL;
> +	err = dma_tx_fragment(ring, &skb);
>  	if (unlikely(err == -ENOKEY)) {
>  		/* Drop this packet, as we don't have the encryption key
>  		 * anymore and must not transmit it unencrypted. */
> 
> 
> 
> -- 
> Greetings, Michael.
> 

-- 
John W. Linville		Someday the world will need a hero, and you
linville@tuxdriver.com			might be all we have.  Be ready.

^ permalink raw reply

* Re: [PATCH] rt73usb.c : more ids
From: John W. Linville @ 2009-10-28 19:20 UTC (permalink / raw)
  To: Xose Vazquez Perez; +Cc: linux-wireless, users, IvDoorn
In-Reply-To: <4ADC368F.1050709@gmail.com>

On Mon, Oct 19, 2009 at 11:51:11AM +0200, Xose Vazquez Perez wrote:
> hi,
> 
> stolen from windows inf file(07/17/2009, 1.03.05.0000)
> Ovislink 0x1b75, 0x7318
> MSI 0x0db0, 0x4600
> WideTell 0x7167, 0x3840
> 
> 
> -thanks-
> 
> regards,
> 
> Signed-off-by: Xose Vazquez Perez <xose.vazquez@gmail.com>
> 
> -- 
> «Allá muevan feroz guerra, ciegos reyes por un palmo más de tierra;
> que yo aquí tengo por mío cuanto abarca el mar bravío, a quien nadie
> impuso leyes. Y no hay playa, sea cualquiera, ni bandera de esplendor,
> que no sienta mi derecho y dé pecho a mi valor.»
> 
> 

> --- o/drivers/net/wireless/rt73usb.c	2009-10-13 12:58:32.042380351 +0200
> +++ n/drivers/net/wireless/rt73usb.c	2009-10-13 13:01:01.073379225 +0200

WTF is this?  That's not where that file lives in any tree I have...

I manually applied this one, but in the future please go to the
effort of sending a patch against the sources everyone else is using.
Not sending it as an attachment and not cluttering the changelog
with "hi...thanks, regards..." etc would be appreciated as well.
Maybe you could even read the link I sent you previously...

John
-- 
John W. Linville		Someday the world will need a hero, and you
linville@tuxdriver.com			might be all we have.  Be ready.

^ permalink raw reply

* Re: [rt2x00-users] [PATCH] rt2800pci.c : more ids
From: John W. Linville @ 2009-10-28 19:44 UTC (permalink / raw)
  To: rt2x00 Users List; +Cc: Xose Vazquez Perez, linux-wireless
In-Reply-To: <200910191931.07361.IvDoorn@gmail.com>

Looks like those IDs were already added by Ivo...

On Mon, Oct 19, 2009 at 07:31:06PM +0200, Ivo van Doorn wrote:
> Hi,
> 
> I have merged your previous rt2800pci patch before sending it
> upstream. Please recheck and if required rebase your patch
> to the new version.
> 
> Thanks,
> 
> Ivo
> 
> On Monday 19 October 2009, Xose Vazquez Perez wrote:
> > On 10/13/2009 10:05 AM, Xose Vazquez Perez wrote:
> > 
> > > stolen from windows inf file(09/05/2009, 1.04.07.0000)
> > > 
> > > 0x1814, 0x3060
> > 
> > apply this one instead, 
> > got 0x1462,0x89a from linux driver(2009_0903_RT3090_Linux_STA_v2.2.0.1)
> > 
> > -thanks-
> > 
> > Signed-off-by: Xose Vazquez Perez <xose.vazquez@gmail.com>
> > 
> 
> 
> 
> _______________________________________________
> users mailing list
> users@rt2x00.serialmonkey.com
> http://rt2x00.serialmonkey.com/mailman/listinfo/users_rt2x00.serialmonkey.com
> 

-- 
John W. Linville		Someday the world will need a hero, and you
linville@tuxdriver.com			might be all we have.  Be ready.

^ permalink raw reply

* [PATCH] mac80211: make align adjustment code support paged SKB
From: Reinette Chatre @ 2009-10-28 20:13 UTC (permalink / raw)
  To: johannes, linville; +Cc: linux-wireless, Zhu Yi, Reinette Chatre

From: Zhu Yi <yi.zhu@intel.com>

This fixed a BUG_ON in __skb_trim() when paged rx is used in
iwlwifi driver. Yes, the whole mac80211 stack doesn't support
paged SKB yet. But let's start the work slowly from small
code snippets.

Reported-and-tested-by: Abhijeet Kolekar <abhijeet.kolekar@intel.com>
Signed-off-by: Zhu Yi <yi.zhu@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
---
 net/mac80211/rx.c |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/net/mac80211/rx.c b/net/mac80211/rx.c
index 5c385e3..a50d5f3 100644
--- a/net/mac80211/rx.c
+++ b/net/mac80211/rx.c
@@ -1337,10 +1337,10 @@ ieee80211_deliver_skb(struct ieee80211_rx_data *rx)
 				skb = NULL;
 			} else {
 				u8 *data = skb->data;
-				size_t len = skb->len;
-				u8 *new = __skb_push(skb, align);
-				memmove(new, data, len);
-				__skb_trim(skb, len);
+				size_t len = skb_headlen(skb);
+				skb->data -= align;
+				memmove(skb->data, data, len);
+				skb_set_tail_pointer(skb, len);
 			}
 		}
 #endif
-- 
1.5.6.3


^ permalink raw reply related

* Re: [PATCH] mac80211: make align adjustment code support paged SKB
From: Johannes Berg @ 2009-10-28 20:15 UTC (permalink / raw)
  To: Reinette Chatre; +Cc: linville, linux-wireless, Zhu Yi
In-Reply-To: <1256760832-29063-1-git-send-email-reinette.chatre@intel.com>

[-- Attachment #1: Type: text/plain, Size: 1393 bytes --]

On Wed, 2009-10-28 at 13:13 -0700, Reinette Chatre wrote:
> From: Zhu Yi <yi.zhu@intel.com>
> 
> This fixed a BUG_ON in __skb_trim() when paged rx is used in
> iwlwifi driver. Yes, the whole mac80211 stack doesn't support
> paged SKB yet. But let's start the work slowly from small
> code snippets.
> 
> Reported-and-tested-by: Abhijeet Kolekar <abhijeet.kolekar@intel.com>
> Signed-off-by: Zhu Yi <yi.zhu@intel.com>
> Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>

Acked-by: Johannes Berg <johannes@sipsolutions.net>

we'll also be working on moving more paged RX awareness into the stack
so other drivers can benefit and things get more efficient.

johannes

> ---
>  net/mac80211/rx.c |    8 ++++----
>  1 files changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/net/mac80211/rx.c b/net/mac80211/rx.c
> index 5c385e3..a50d5f3 100644
> --- a/net/mac80211/rx.c
> +++ b/net/mac80211/rx.c
> @@ -1337,10 +1337,10 @@ ieee80211_deliver_skb(struct ieee80211_rx_data *rx)
>  				skb = NULL;
>  			} else {
>  				u8 *data = skb->data;
> -				size_t len = skb->len;
> -				u8 *new = __skb_push(skb, align);
> -				memmove(new, data, len);
> -				__skb_trim(skb, len);
> +				size_t len = skb_headlen(skb);
> +				skb->data -= align;
> +				memmove(skb->data, data, len);
> +				skb_set_tail_pointer(skb, len);
>  			}
>  		}
>  #endif


[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 801 bytes --]

^ permalink raw reply

* Re: odd state reached when AP deauths you after assoc
From: Johannes Berg @ 2009-10-28 20:24 UTC (permalink / raw)
  To: Luis R. Rodriguez; +Cc: linux-wireless
In-Reply-To: <20091028183726.GA4952@tux>

[-- Attachment #1: Type: text/plain, Size: 644 bytes --]

On Wed, 2009-10-28 at 11:37 -0700, Luis R. Rodriguez wrote:
> I ran into this when ath5k with wpa_supplicant with config file with
> a wrong password against a Cisco AP. It seems the Cisco AP auths you
> and lets you assoc but later it deauths you -- I guess after it
> determines you are auth credentials failed. When this happens I get:
> 
> mcgrof@tux ~ $ iw dev wlan0 link
> Authenticated with 00:0b:85:5b:8d:6c (on wlan0)
> Not connected.

I'm guessing that you're using -Dnl80211. You need this patch, or
equivalent:
http://johannes.sipsolutions.net/patches/hostap/all/2009-10-26-12%3a59/deauth-on-disassoc.patch

johannes

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 801 bytes --]

^ permalink raw reply

* Re: 2.6.32-rc5-git3: Reported regressions from 2.6.31
From: Christian Casteyde @ 2009-10-28 20:38 UTC (permalink / raw)
  To: John W. Linville; +Cc: Michael Buesch, linux-wireless, Johannes Berg
In-Reply-To: <20091028190547.GA2856@tuxdriver.com>

I've just tested the patch posted in bugzilla: it works.
That is, I do not manage to get the warning anymore in 3 boots in a row.

CC
Le mercredi 28 octobre 2009 20:05:47, John W. Linville a écrit :
> Christian,
> 
> Will you be able to test this patch for us?
> 
> Thanks,
> 
> John
> 
> On Mon, Oct 26, 2009 at 09:38:28PM +0100, Michael Buesch wrote:
> > On Monday 26 October 2009 20:37:33 Michael Buesch wrote:
> > > Ok, it just turns out this actually is a driver bug.
> > > Thanks to Johannes Berg for tracking it down.
> > >
> > > I think it's caused by the DMA bouncebuffer stuff that does not copy
> > > the skb->cb and does not adjust the "tx-info" pointer.
> > > I wonder why this didn't blow up easlier, because this bug is there
> > > since mac80211 switched to using the CB.
> > >
> > > Here's a completely untested patch.
> >
> > Here's a new version of the patch that also fixes queue mapping bugs:
> >
> > ---
> >  drivers/net/wireless/b43/dma.c |   15 +++++++++++++--
> >  1 file changed, 13 insertions(+), 2 deletions(-)
> >
> > --- wireless-testing.orig/drivers/net/wireless/b43/dma.c
> > +++ wireless-testing/drivers/net/wireless/b43/dma.c
> > @@ -1157,8 +1157,9 @@ struct b43_dmaring *parse_cookie(struct
> >  }
> >
> >  static int dma_tx_fragment(struct b43_dmaring *ring,
> > -			   struct sk_buff *skb)
> > +			   struct sk_buff **in_skb)
> >  {
> > +	struct sk_buff *skb = *in_skb;
> >  	const struct b43_dma_ops *ops = ring->ops;
> >  	struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb);
> >  	u8 *header;
> > @@ -1224,8 +1225,14 @@ static int dma_tx_fragment(struct b43_dm
> >  		}
> >
> >  		memcpy(skb_put(bounce_skb, skb->len), skb->data, skb->len);
> > +		memcpy(bounce_skb->cb, skb->cb, sizeof(skb->cb));
> > +		bounce_skb->dev = skb->dev;
> > +		skb_set_queue_mapping(bounce_skb, skb_get_queue_mapping(skb));
> > +		info = IEEE80211_SKB_CB(bounce_skb);
> > +
> >  		dev_kfree_skb_any(skb);
> >  		skb = bounce_skb;
> > +		*in_skb = bounce_skb;
> >  		meta->skb = skb;
> >  		meta->dmaaddr = map_descbuffer(ring, skb->data, skb->len, 1);
> >  		if (b43_dma_mapping_error(ring, meta->dmaaddr, skb->len, 1)) {
> > @@ -1355,7 +1362,11 @@ int b43_dma_tx(struct b43_wldev *dev, st
> >  	 * static, so we don't need to store it per frame. */
> >  	ring->queue_prio = skb_get_queue_mapping(skb);
> >
> > -	err = dma_tx_fragment(ring, skb);
> > +	/* dma_tx_fragment might reallocate the skb, so invalidate pointers
> > pointing +	 * into the skb data or cb now. */
> > +	hdr = NULL;
> > +	info = NULL;
> > +	err = dma_tx_fragment(ring, &skb);
> >  	if (unlikely(err == -ENOKEY)) {
> >  		/* Drop this packet, as we don't have the encryption key
> >  		 * anymore and must not transmit it unencrypted. */
> 

^ permalink raw reply

* [RFC] ath9k: update hw configuration for virtual wiphys
From: Luis R. Rodriguez @ 2009-10-28 20:43 UTC (permalink / raw)
  To: Jouni.Malinen; +Cc: linux-wireless, ath9k-devel, Luis R. Rodriguez

ath9k supports its own virtual wiphys. The hardware code
relies on the ieee80211_hw for the present interface but
with recent changes introduced the common->hw was never
updated and is required for virtual wiphys.

Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
---

Jouni, it seems this the right place for this, do you agree?

 drivers/net/wireless/ath/ath9k/virtual.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/drivers/net/wireless/ath/ath9k/virtual.c b/drivers/net/wireless/ath/ath9k/virtual.c
index bc7d173..fe2e300 100644
--- a/drivers/net/wireless/ath/ath9k/virtual.c
+++ b/drivers/net/wireless/ath/ath9k/virtual.c
@@ -298,6 +298,7 @@ static void ath9k_wiphy_unpause_channel(struct ath_softc *sc)
 void ath9k_wiphy_chan_work(struct work_struct *work)
 {
 	struct ath_softc *sc = container_of(work, struct ath_softc, chan_work);
+	struct ath_common *common = ath9k_hw_common(sc->sc_ah);
 	struct ath_wiphy *aphy = sc->next_wiphy;
 
 	if (aphy == NULL)
@@ -313,6 +314,10 @@ void ath9k_wiphy_chan_work(struct work_struct *work)
 	/* XXX: remove me eventually */
 	ath9k_update_ichannel(sc, aphy->hw,
 			      &sc->sc_ah->channels[sc->chan_idx]);
+
+	/* sync hw configuration for hw code */
+	common->hw = aphy->hw;
+
 	ath_update_chainmask(sc, sc->chan_is_ht);
 	if (ath_set_channel(sc, aphy->hw,
 			    &sc->sc_ah->channels[sc->chan_idx]) < 0) {
-- 
1.6.0.4


^ permalink raw reply related

* Re: 2.6.32-rc5-git3: Reported regressions from 2.6.31
From: Michael Buesch @ 2009-10-28 20:57 UTC (permalink / raw)
  To: Christian Casteyde; +Cc: John W. Linville, linux-wireless, Johannes Berg
In-Reply-To: <200910282138.37401.casteyde.christian@free.fr>

On Wednesday 28 October 2009 21:38:37 Christian Casteyde wrote:
> I've just tested the patch posted in bugzilla: it works.
> That is, I do not manage to get the warning anymore in 3 boots in a row.

Thanks a lot for testing. I'll resend with proper signoff.

> CC
> Le mercredi 28 octobre 2009 20:05:47, John W. Linville a écrit :
> > Christian,
> > 
> > Will you be able to test this patch for us?
> > 
> > Thanks,
> > 
> > John
> > 
> > On Mon, Oct 26, 2009 at 09:38:28PM +0100, Michael Buesch wrote:
> > > On Monday 26 October 2009 20:37:33 Michael Buesch wrote:
> > > > Ok, it just turns out this actually is a driver bug.
> > > > Thanks to Johannes Berg for tracking it down.
> > > >
> > > > I think it's caused by the DMA bouncebuffer stuff that does not copy
> > > > the skb->cb and does not adjust the "tx-info" pointer.
> > > > I wonder why this didn't blow up easlier, because this bug is there
> > > > since mac80211 switched to using the CB.
> > > >
> > > > Here's a completely untested patch.
> > >
> > > Here's a new version of the patch that also fixes queue mapping bugs:
> > >
> > > ---
> > >  drivers/net/wireless/b43/dma.c |   15 +++++++++++++--
> > >  1 file changed, 13 insertions(+), 2 deletions(-)
> > >
> > > --- wireless-testing.orig/drivers/net/wireless/b43/dma.c
> > > +++ wireless-testing/drivers/net/wireless/b43/dma.c
> > > @@ -1157,8 +1157,9 @@ struct b43_dmaring *parse_cookie(struct
> > >  }
> > >
> > >  static int dma_tx_fragment(struct b43_dmaring *ring,
> > > -			   struct sk_buff *skb)
> > > +			   struct sk_buff **in_skb)
> > >  {
> > > +	struct sk_buff *skb = *in_skb;
> > >  	const struct b43_dma_ops *ops = ring->ops;
> > >  	struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb);
> > >  	u8 *header;
> > > @@ -1224,8 +1225,14 @@ static int dma_tx_fragment(struct b43_dm
> > >  		}
> > >
> > >  		memcpy(skb_put(bounce_skb, skb->len), skb->data, skb->len);
> > > +		memcpy(bounce_skb->cb, skb->cb, sizeof(skb->cb));
> > > +		bounce_skb->dev = skb->dev;
> > > +		skb_set_queue_mapping(bounce_skb, skb_get_queue_mapping(skb));
> > > +		info = IEEE80211_SKB_CB(bounce_skb);
> > > +
> > >  		dev_kfree_skb_any(skb);
> > >  		skb = bounce_skb;
> > > +		*in_skb = bounce_skb;
> > >  		meta->skb = skb;
> > >  		meta->dmaaddr = map_descbuffer(ring, skb->data, skb->len, 1);
> > >  		if (b43_dma_mapping_error(ring, meta->dmaaddr, skb->len, 1)) {
> > > @@ -1355,7 +1362,11 @@ int b43_dma_tx(struct b43_wldev *dev, st
> > >  	 * static, so we don't need to store it per frame. */
> > >  	ring->queue_prio = skb_get_queue_mapping(skb);
> > >
> > > -	err = dma_tx_fragment(ring, skb);
> > > +	/* dma_tx_fragment might reallocate the skb, so invalidate pointers
> > > pointing +	 * into the skb data or cb now. */
> > > +	hdr = NULL;
> > > +	info = NULL;
> > > +	err = dma_tx_fragment(ring, &skb);
> > >  	if (unlikely(err == -ENOKEY)) {
> > >  		/* Drop this packet, as we don't have the encryption key
> > >  		 * anymore and must not transmit it unencrypted. */
> > 
> 
> 



-- 
Greetings, Michael.

^ permalink raw reply

* pull request: wireless-2.6 2009-10-28
From: John W. Linville @ 2009-10-28 20:53 UTC (permalink / raw)
  To: davem; +Cc: linux-wireless, netdev, linux-kernel

Dave,

Here is a collection of fixes (mostly (almost-)one-liners) intended
for 2.6.32.  There are a couple of fixes relating to behavior when an
association failes, as well as spelling fixes, simply endian fixes,
a MAINTAINERS change...I don't think there is anything controversial
here...

Please let me know if there are problems!

Thanks,

John

---

Individual patches are available here:

	http://www.kernel.org/pub/linux/kernel/people/linville/wireless-2.6/

---

The following changes since commit 66ed1e5ec1d979e572554643063734a7664261bb:
  Eric Dumazet (1):
        pktgen: Dont leak kernel memory

are available in the git repository at:

  git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-2.6.git master

Andrey Yurovsky (1):
      mac80211: trivial: fix spelling in mesh_hwmp

Bartlomiej Zolnierkiewicz (1):
      MAINTAINERS: rt2x00 list is moderated

Benoit PAPILLAULT (1):
      rt2x00: Fix crypto in TX frame for rt2800usb

Björn Smedman (1):
      mac80211: fix for incorrect sequence number on hostapd injected frames

Holger Schurig (1):
      libertas spi: fix sparse errors

Johannes Berg (2):
      mac80211: keep auth state when assoc fails
      cfg80211: sme: deauthenticate on assoc failure

Larry Finger (1):
      b43: Fix Bugzilla #14181 and the bug from the previous 'fix'

Miguel Boton (1):
      b43: add 'struct b43_wl' missing declaration

Reinette Chatre (1):
      mac80211: fix ibss joining

Roel Kluin (1):
      airo: Reorder tests, check bounds before element

 MAINTAINERS                             |    2 +-
 drivers/net/wireless/airo.c             |    5 ++---
 drivers/net/wireless/b43/leds.h         |    1 +
 drivers/net/wireless/b43/main.c         |    1 -
 drivers/net/wireless/b43/rfkill.c       |    3 ++-
 drivers/net/wireless/libertas/if_spi.c  |   10 +++++-----
 drivers/net/wireless/rt2x00/rt2800usb.c |    2 +-
 net/mac80211/ibss.c                     |    6 ++----
 net/mac80211/mesh_hwmp.c                |    2 +-
 net/mac80211/mlme.c                     |    3 +--
 net/mac80211/tx.c                       |    2 +-
 net/wireless/core.h                     |    1 +
 net/wireless/mlme.c                     |    9 +++++++++
 net/wireless/sme.c                      |   21 +++++++++++++++++++--
 14 files changed, 46 insertions(+), 22 deletions(-)

diff --git a/MAINTAINERS b/MAINTAINERS
index 70bc7de..cdbbaf5 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -4280,7 +4280,7 @@ F:	drivers/video/aty/aty128fb.c
 RALINK RT2X00 WIRELESS LAN DRIVER
 P:	rt2x00 project
 L:	linux-wireless@vger.kernel.org
-L:	users@rt2x00.serialmonkey.com
+L:	users@rt2x00.serialmonkey.com (moderated for non-subscribers)
 W:	http://rt2x00.serialmonkey.com/
 S:	Maintained
 T:	git git://git.kernel.org/pub/scm/linux/kernel/git/ivd/rt2x00.git
diff --git a/drivers/net/wireless/airo.c b/drivers/net/wireless/airo.c
index 7116a1a..abf896a 100644
--- a/drivers/net/wireless/airo.c
+++ b/drivers/net/wireless/airo.c
@@ -4790,9 +4790,8 @@ static int proc_stats_rid_open( struct inode *inode,
 static int get_dec_u16( char *buffer, int *start, int limit ) {
 	u16 value;
 	int valid = 0;
-	for( value = 0; buffer[*start] >= '0' &&
-		     buffer[*start] <= '9' &&
-		     *start < limit; (*start)++ ) {
+	for (value = 0; *start < limit && buffer[*start] >= '0' &&
+			buffer[*start] <= '9'; (*start)++) {
 		valid = 1;
 		value *= 10;
 		value += buffer[*start] - '0';
diff --git a/drivers/net/wireless/b43/leds.h b/drivers/net/wireless/b43/leds.h
index 4c56187..32b66d5 100644
--- a/drivers/net/wireless/b43/leds.h
+++ b/drivers/net/wireless/b43/leds.h
@@ -1,6 +1,7 @@
 #ifndef B43_LEDS_H_
 #define B43_LEDS_H_
 
+struct b43_wl;
 struct b43_wldev;
 
 #ifdef CONFIG_B43_LEDS
diff --git a/drivers/net/wireless/b43/main.c b/drivers/net/wireless/b43/main.c
index df6b26a..86f3582 100644
--- a/drivers/net/wireless/b43/main.c
+++ b/drivers/net/wireless/b43/main.c
@@ -4501,7 +4501,6 @@ static void b43_op_stop(struct ieee80211_hw *hw)
 
 	cancel_work_sync(&(wl->beacon_update_trigger));
 
-	wiphy_rfkill_stop_polling(hw->wiphy);
 	mutex_lock(&wl->mutex);
 	if (b43_status(dev) >= B43_STAT_STARTED) {
 		dev = b43_wireless_core_stop(dev);
diff --git a/drivers/net/wireless/b43/rfkill.c b/drivers/net/wireless/b43/rfkill.c
index 7a3218c..ffdce6f 100644
--- a/drivers/net/wireless/b43/rfkill.c
+++ b/drivers/net/wireless/b43/rfkill.c
@@ -33,7 +33,8 @@ bool b43_is_hw_radio_enabled(struct b43_wldev *dev)
 		      & B43_MMIO_RADIO_HWENABLED_HI_MASK))
 			return 1;
 	} else {
-		if (b43_read16(dev, B43_MMIO_RADIO_HWENABLED_LO)
+		if (b43_status(dev) >= B43_STAT_STARTED &&
+		    b43_read16(dev, B43_MMIO_RADIO_HWENABLED_LO)
 		    & B43_MMIO_RADIO_HWENABLED_LO_MASK)
 			return 1;
 	}
diff --git a/drivers/net/wireless/libertas/if_spi.c b/drivers/net/wireless/libertas/if_spi.c
index cb8be8d..5b3672c 100644
--- a/drivers/net/wireless/libertas/if_spi.c
+++ b/drivers/net/wireless/libertas/if_spi.c
@@ -134,7 +134,7 @@ static void spu_transaction_finish(struct if_spi_card *card)
 static int spu_write(struct if_spi_card *card, u16 reg, const u8 *buf, int len)
 {
 	int err = 0;
-	u16 reg_out = cpu_to_le16(reg | IF_SPI_WRITE_OPERATION_MASK);
+	__le16 reg_out = cpu_to_le16(reg | IF_SPI_WRITE_OPERATION_MASK);
 	struct spi_message m;
 	struct spi_transfer reg_trans;
 	struct spi_transfer data_trans;
@@ -166,7 +166,7 @@ static int spu_write(struct if_spi_card *card, u16 reg, const u8 *buf, int len)
 
 static inline int spu_write_u16(struct if_spi_card *card, u16 reg, u16 val)
 {
-	u16 buff;
+	__le16 buff;
 
 	buff = cpu_to_le16(val);
 	return spu_write(card, reg, (u8 *)&buff, sizeof(u16));
@@ -188,7 +188,7 @@ static int spu_read(struct if_spi_card *card, u16 reg, u8 *buf, int len)
 {
 	unsigned int delay;
 	int err = 0;
-	u16 reg_out = cpu_to_le16(reg | IF_SPI_READ_OPERATION_MASK);
+	__le16 reg_out = cpu_to_le16(reg | IF_SPI_READ_OPERATION_MASK);
 	struct spi_message m;
 	struct spi_transfer reg_trans;
 	struct spi_transfer dummy_trans;
@@ -235,7 +235,7 @@ static int spu_read(struct if_spi_card *card, u16 reg, u8 *buf, int len)
 /* Read 16 bits from an SPI register */
 static inline int spu_read_u16(struct if_spi_card *card, u16 reg, u16 *val)
 {
-	u16 buf;
+	__le16 buf;
 	int ret;
 
 	ret = spu_read(card, reg, (u8 *)&buf, sizeof(buf));
@@ -248,7 +248,7 @@ static inline int spu_read_u16(struct if_spi_card *card, u16 reg, u16 *val)
  * The low 16 bits are read first. */
 static int spu_read_u32(struct if_spi_card *card, u16 reg, u32 *val)
 {
-	u32 buf;
+	__le32 buf;
 	int err;
 
 	err = spu_read(card, reg, (u8 *)&buf, sizeof(buf));
diff --git a/drivers/net/wireless/rt2x00/rt2800usb.c b/drivers/net/wireless/rt2x00/rt2800usb.c
index a084077..9fe770f 100644
--- a/drivers/net/wireless/rt2x00/rt2800usb.c
+++ b/drivers/net/wireless/rt2x00/rt2800usb.c
@@ -1994,7 +1994,7 @@ static void rt2800usb_write_tx_desc(struct rt2x00_dev *rt2x00dev,
 	rt2x00_set_field32(&word, TXWI_W1_BW_WIN_SIZE, txdesc->ba_size);
 	rt2x00_set_field32(&word, TXWI_W1_WIRELESS_CLI_ID,
 			   test_bit(ENTRY_TXD_ENCRYPT, &txdesc->flags) ?
-			       (skbdesc->entry->entry_idx + 1) : 0xff);
+			   txdesc->key_idx : 0xff);
 	rt2x00_set_field32(&word, TXWI_W1_MPDU_TOTAL_BYTE_COUNT,
 			   skb->len - txdesc->l2pad);
 	rt2x00_set_field32(&word, TXWI_W1_PACKETID,
diff --git a/net/mac80211/ibss.c b/net/mac80211/ibss.c
index 6eaf698..ca8ecce 100644
--- a/net/mac80211/ibss.c
+++ b/net/mac80211/ibss.c
@@ -538,13 +538,12 @@ static void ieee80211_sta_find_ibss(struct ieee80211_sub_if_data *sdata)
 				       WLAN_CAPABILITY_PRIVACY,
 				       capability);
 
+	if (bss) {
 #ifdef CONFIG_MAC80211_IBSS_DEBUG
-	if (bss)
 		printk(KERN_DEBUG "   sta_find_ibss: selected %pM current "
 		       "%pM\n", bss->cbss.bssid, ifibss->bssid);
 #endif /* CONFIG_MAC80211_IBSS_DEBUG */
 
-	if (bss && !memcmp(ifibss->bssid, bss->cbss.bssid, ETH_ALEN)) {
 		printk(KERN_DEBUG "%s: Selected IBSS BSSID %pM"
 		       " based on configured SSID\n",
 		       sdata->dev->name, bss->cbss.bssid);
@@ -552,8 +551,7 @@ static void ieee80211_sta_find_ibss(struct ieee80211_sub_if_data *sdata)
 		ieee80211_sta_join_ibss(sdata, bss);
 		ieee80211_rx_bss_put(local, bss);
 		return;
-	} else if (bss)
-		ieee80211_rx_bss_put(local, bss);
+	}
 
 #ifdef CONFIG_MAC80211_IBSS_DEBUG
 	printk(KERN_DEBUG "   did not try to join ibss\n");
diff --git a/net/mac80211/mesh_hwmp.c b/net/mac80211/mesh_hwmp.c
index e12a786..29b82e9 100644
--- a/net/mac80211/mesh_hwmp.c
+++ b/net/mac80211/mesh_hwmp.c
@@ -259,7 +259,7 @@ static u32 airtime_link_metric_get(struct ieee80211_local *local,
  * @hwmp_ie: hwmp information element (PREP or PREQ)
  *
  * This function updates the path routing information to the originator and the
- * transmitter of a HWMP PREQ or PREP fram.
+ * transmitter of a HWMP PREQ or PREP frame.
  *
  * Returns: metric to frame originator or 0 if the frame should not be further
  * processed
diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c
index 8d26e9b..dc5049d 100644
--- a/net/mac80211/mlme.c
+++ b/net/mac80211/mlme.c
@@ -1457,8 +1457,7 @@ ieee80211_rx_mgmt_assoc_resp(struct ieee80211_sub_if_data *sdata,
 	if (status_code != WLAN_STATUS_SUCCESS) {
 		printk(KERN_DEBUG "%s: AP denied association (code=%d)\n",
 		       sdata->dev->name, status_code);
-		list_del(&wk->list);
-		kfree(wk);
+		wk->state = IEEE80211_MGD_STATE_IDLE;
 		return RX_MGMT_CFG80211_ASSOC;
 	}
 
diff --git a/net/mac80211/tx.c b/net/mac80211/tx.c
index db4bda6..eaa4118 100644
--- a/net/mac80211/tx.c
+++ b/net/mac80211/tx.c
@@ -1445,7 +1445,7 @@ static void ieee80211_xmit(struct ieee80211_sub_if_data *sdata,
 				if (tmp_sdata->vif.type != NL80211_IFTYPE_AP)
 					continue;
 				if (compare_ether_addr(tmp_sdata->dev->dev_addr,
-						       hdr->addr2)) {
+						       hdr->addr2) == 0) {
 					dev_hold(tmp_sdata->dev);
 					dev_put(sdata->dev);
 					sdata = tmp_sdata;
diff --git a/net/wireless/core.h b/net/wireless/core.h
index 2a33d8b..68b3219 100644
--- a/net/wireless/core.h
+++ b/net/wireless/core.h
@@ -358,6 +358,7 @@ int cfg80211_mgd_wext_connect(struct cfg80211_registered_device *rdev,
 			      struct wireless_dev *wdev);
 
 void cfg80211_conn_work(struct work_struct *work);
+void cfg80211_sme_failed_assoc(struct wireless_dev *wdev);
 bool cfg80211_sme_failed_reassoc(struct wireless_dev *wdev);
 
 /* internal helpers */
diff --git a/net/wireless/mlme.c b/net/wireless/mlme.c
index 79d2eec..0a6b7a0 100644
--- a/net/wireless/mlme.c
+++ b/net/wireless/mlme.c
@@ -62,6 +62,7 @@ void cfg80211_send_rx_assoc(struct net_device *dev, const u8 *buf, size_t len)
 	u8 *ie = mgmt->u.assoc_resp.variable;
 	int i, ieoffs = offsetof(struct ieee80211_mgmt, u.assoc_resp.variable);
 	struct cfg80211_internal_bss *bss = NULL;
+	bool need_connect_result = true;
 
 	wdev_lock(wdev);
 
@@ -94,6 +95,14 @@ void cfg80211_send_rx_assoc(struct net_device *dev, const u8 *buf, size_t len)
 		}
 
 		WARN_ON(!bss);
+	} else if (wdev->conn) {
+		cfg80211_sme_failed_assoc(wdev);
+		need_connect_result = false;
+		/*
+		 * do not call connect_result() now because the
+		 * sme will schedule work that does it later.
+		 */
+		goto out;
 	}
 
 	if (!wdev->conn && wdev->sme_state == CFG80211_SME_IDLE) {
diff --git a/net/wireless/sme.c b/net/wireless/sme.c
index 93c3ed3..ece378d 100644
--- a/net/wireless/sme.c
+++ b/net/wireless/sme.c
@@ -26,6 +26,7 @@ struct cfg80211_conn {
 		CFG80211_CONN_AUTHENTICATING,
 		CFG80211_CONN_ASSOCIATE_NEXT,
 		CFG80211_CONN_ASSOCIATING,
+		CFG80211_CONN_DEAUTH_ASSOC_FAIL,
 	} state;
 	u8 bssid[ETH_ALEN], prev_bssid[ETH_ALEN];
 	u8 *ie;
@@ -148,6 +149,12 @@ static int cfg80211_conn_do_work(struct wireless_dev *wdev)
 					       NULL, 0,
 					       WLAN_REASON_DEAUTH_LEAVING);
 		return err;
+	case CFG80211_CONN_DEAUTH_ASSOC_FAIL:
+		__cfg80211_mlme_deauth(rdev, wdev->netdev, params->bssid,
+				       NULL, 0,
+				       WLAN_REASON_DEAUTH_LEAVING);
+		/* return an error so that we call __cfg80211_connect_result() */
+		return -EINVAL;
 	default:
 		return 0;
 	}
@@ -158,6 +165,7 @@ void cfg80211_conn_work(struct work_struct *work)
 	struct cfg80211_registered_device *rdev =
 		container_of(work, struct cfg80211_registered_device, conn_work);
 	struct wireless_dev *wdev;
+	u8 bssid[ETH_ALEN];
 
 	rtnl_lock();
 	cfg80211_lock_rdev(rdev);
@@ -173,10 +181,10 @@ void cfg80211_conn_work(struct work_struct *work)
 			wdev_unlock(wdev);
 			continue;
 		}
+		memcpy(bssid, wdev->conn->params.bssid, ETH_ALEN);
 		if (cfg80211_conn_do_work(wdev))
 			__cfg80211_connect_result(
-					wdev->netdev,
-					wdev->conn->params.bssid,
+					wdev->netdev, bssid,
 					NULL, 0, NULL, 0,
 					WLAN_STATUS_UNSPECIFIED_FAILURE,
 					false, NULL);
@@ -337,6 +345,15 @@ bool cfg80211_sme_failed_reassoc(struct wireless_dev *wdev)
 	return true;
 }
 
+void cfg80211_sme_failed_assoc(struct wireless_dev *wdev)
+{
+	struct wiphy *wiphy = wdev->wiphy;
+	struct cfg80211_registered_device *rdev = wiphy_to_dev(wiphy);
+
+	wdev->conn->state = CFG80211_CONN_DEAUTH_ASSOC_FAIL;
+	schedule_work(&rdev->conn_work);
+}
+
 void __cfg80211_connect_result(struct net_device *dev, const u8 *bssid,
 			       const u8 *req_ie, size_t req_ie_len,
 			       const u8 *resp_ie, size_t resp_ie_len,
-- 
John W. Linville		Someday the world will need a hero, and you
linville@tuxdriver.com			might be all we have.  Be ready.

^ permalink raw reply related

* [PATCH] b43: Fix DMA TX bounce buffer copying
From: Michael Buesch @ 2009-10-28 21:08 UTC (permalink / raw)
  To: linville; +Cc: bcm43xx-dev, linux-wireless, Larry Finger, Christian Casteyde

b43 allocates a bouncebuffer, if the supplied TX skb is in an invalid
memory range for DMA.
However, this is broken in that it fails to copy over some metadata to the
new skb.

This patch fixes three problems:
* Failure to adjust the ieee80211_tx_info pointer to the new buffer.
  This results in a kmemcheck warning.
* Failure to copy the skb cb, which contains ieee80211_tx_info, to the new skb.
  This results in breakage of various TX-status postprocessing (Rate control).
* Failure to transfer the queue mapping.
  This results in the wrong queue being stopped on saturation and can result in queue overflow.

Signed-off-by: Michael Buesch <mb@bu3sch.de>
Tested-by: Christian Casteyde <casteyde.christian@free.fr>

---

Thanks to Johannes for tracking down this hard to find bug and
thanks to Christian for testing.

Larry, I think I remember you reported a strange rate control failure on
one of your cards. Does this patch fix it?

b43legacy:
Note that b43legacy has the same bug and also needs fixing.
Is there a maintainer for b43legacy?

stable:
I'm not sure if it's necessary to send this patch to stable.
The problem is there since the very beginning and it doesn't affect many people.
I'll leave this decision to somebody else, if somebody cares.




---
 drivers/net/wireless/b43/dma.c |   15 +++++++++++++--
 1 file changed, 13 insertions(+), 2 deletions(-)

--- wireless-testing.orig/drivers/net/wireless/b43/dma.c
+++ wireless-testing/drivers/net/wireless/b43/dma.c
@@ -1157,8 +1157,9 @@ struct b43_dmaring *parse_cookie(struct 
 }
 
 static int dma_tx_fragment(struct b43_dmaring *ring,
-			   struct sk_buff *skb)
+			   struct sk_buff **in_skb)
 {
+	struct sk_buff *skb = *in_skb;
 	const struct b43_dma_ops *ops = ring->ops;
 	struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb);
 	u8 *header;
@@ -1224,8 +1225,14 @@ static int dma_tx_fragment(struct b43_dm
 		}
 
 		memcpy(skb_put(bounce_skb, skb->len), skb->data, skb->len);
+		memcpy(bounce_skb->cb, skb->cb, sizeof(skb->cb));
+		bounce_skb->dev = skb->dev;
+		skb_set_queue_mapping(bounce_skb, skb_get_queue_mapping(skb));
+		info = IEEE80211_SKB_CB(bounce_skb);
+
 		dev_kfree_skb_any(skb);
 		skb = bounce_skb;
+		*in_skb = bounce_skb;
 		meta->skb = skb;
 		meta->dmaaddr = map_descbuffer(ring, skb->data, skb->len, 1);
 		if (b43_dma_mapping_error(ring, meta->dmaaddr, skb->len, 1)) {
@@ -1355,7 +1362,11 @@ int b43_dma_tx(struct b43_wldev *dev, st
 	 * static, so we don't need to store it per frame. */
 	ring->queue_prio = skb_get_queue_mapping(skb);
 
-	err = dma_tx_fragment(ring, skb);
+	/* dma_tx_fragment might reallocate the skb, so invalidate pointers pointing
+	 * into the skb data or cb now. */
+	hdr = NULL;
+	info = NULL;
+	err = dma_tx_fragment(ring, &skb);
 	if (unlikely(err == -ENOKEY)) {
 		/* Drop this packet, as we don't have the encryption key
 		 * anymore and must not transmit it unencrypted. */

-- 
Greetings, Michael.

^ permalink raw reply

* pull request: wireless-next-2.6 2009-10-28
From: John W. Linville @ 2009-10-28 21:10 UTC (permalink / raw)
  To: davem; +Cc: linux-wireless, netdev, linux-kernel

Dave,

I let my patches pile-up!  Yikes!!

This request includes the usual ton of stuff for -next -- driver
updates, fixes for some earlier -next stuff, a few cfg80211 changes to
accomodate the libertas driver, etc.  Of note is the rt2800pci support
added to the rt2x00 family.

Pleaset let me know if there are problems!

Thanks,

John

---

Individual patches are available here:

	http://www.kernel.org/pub/linux/kernel/people/linville/wireless-next-2.6/

---

The following changes since commit b37b62fea1d1bf68ca51818f8eb1035188efd030:
  Ben Hutchings (1):
        sfc: Rename 'xfp' file and functions to reflect reality

are available in the git repository at:

  git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-next-2.6.git master

Abhijeet Kolekar (5):
      iwlwifi/iwl3945: unify rts_tx_cmd_flag
      iwl3945: rename tx to tx_cmd
      iwlwifi/iwl3945: remove data_retry_limit
      iwl3945: rearrange the code.
      iwl3945: disable all tx fifos

Amitkumar Karwar (1):
      libertas: Check return status of command functions

Ben M Cahill (8):
      iwl3945: update iwl3945_apm_init()
      iwlwifi: turn off device when not used.
      iwl3945: remove unnecessary call to apm_ops.reset()
      iwlagn, iwl3945: remove apm_reset() functions
      iwl3945: streamline iwl3945_rfkill_poll()
      iwl3945: move iwl_power_initialize()
      iwlwifi: consolidate apm_init() functions
      iwlwifi: make sure device is reset when unloading driver

Benoit PAPILLAULT (1):
      zd1211rw: Fix TX status reporting in order to have proper rate control

Bob Copeland (1):
      ath5k: use noise calibration from madwifi hal

Christian Lamparter (3):
      ar9170: atomic pending A-MPDU counter
      ar9170usb: atomic pending urbs counter
      ar9170: don't filter BlockACK frames

David Kilroy (1):
      orinoco: use cfg80211 ethtool ops

David-John Willis (1):
      wl1251: add support for PG11 chips.

Holger Schurig (22):
      cfg80211: no cookies in cfg80211_send_XXX()
      cfg80211: remove warning in deauth case
      libertas: make __lbs_cmd_async() non-static
      libertas: cleanup host.h and hostcmd.h
      libertas: harmonize cmd.h
      libertas: make lbs_get_channel() static
      libertas: remove unused lbs_cmd_802_11_inactivity_timeout()
      libertas: remove unused 11d code
      libertas: remove unused 11d.h as well, priv->countryinfo
      libertas: change IW_ESSID_MAX_SIZE -> IEEE80211_MAX_SSID_LEN
      libertas: move scan/assoc related stuff
      libertas: sort variables in struct lbs_private
      libertas: get current channel out of priv->curbssparams
      libertas: move association related commands into assoc.c
      libertas: move lbs_send_iwevcustom_event() to wext.c
      libertas: remove handling for CMD_802_11_LED_GPIO_CTRL
      libertas: remove handling for CMD_GET_TSF
      libertas: remove "struct cmd_ds_gen"
      libertas: move SIOCGIWAP calls to wext.c
      libertas: move mic failure event to wext.c
      libertas: sort and categorize entries in decl.h
      libertas: remove some references to IW_MODE_abc

Ivo van Doorn (2):
      rt2x00: Add rt2x00soc bus module
      rt2x00: Implement support for rt2800pci

Javier Cardona (1):
      mac80211: Learn about mesh portals from multicast traffic

Jay Sternberg (1):
      iwlwifi: add missing commands to syslog messages

John W. Linville (3):
      mac80211: replace netif_tx_{start,stop,wake}_all_queues
      b43: use ieee80211_rx_ni()
      wl1251: re-disable PG10 chips

Juuso Oikarinen (44):
      wl1271: Correction to TX block allocation calculation
      wl1271: Security sequence number handling for TX (for WPA)
      wl1271: Correct TKIP header space handling in TX path
      wl1271: Implement delayed entry into ELP
      wl1271: mask aid bits 14 and 15 in ps-poll template
      wl1271: Implementation for SPI busy word checking
      wl1271: Configure rate policies based on AP rates
      wl1271: Update join usage
      wl1271: Corrections to TX path
      wl1271: use workqueue provided by mac80211 instead of the default
      wl1271: Clear probe-request template after scan
      wl1271: Multicast filtering configuration
      wl1271: Use vmalloc to allocate memory for firmware
      wl1271: Add connection monitoring configuration
      wl1271: Enable beacon filtering with the stack
      wl1271: Configure beacon filtering on if PSM used
      wl1271: Mask unneeded events from firmware to conserve power
      wl1271: Update memory mapping for firmware revision 6.1.0.0.241
      wl1271: Remove RX workaround
      wl1271: Add top-register access functions
      wl1271: RefClk configuration
      wl1271: Update interrupt handling by removing an extra SPI read
      wl1271: Enable ELP
      wl1271: Enable smart reflex
      wl1271: Update TX path block calucation algo
      wl1271: Remove outdated SPI functions
      wl1271: Update boot time configuration for the new firmware
      wl1271: Workaround for reference clock setting on boot.
      wl1271: Add structure for firmware configuration values
      wl1271: Add config structure for RX path parameters
      wl1271: Add config structure for TX path parameters
      wl1271: Add config structure for connection management parameters
      wl1271: Add config structure for FW init parameters
      wl1271: Move default FW config struct away from stack
      wl1271: Fix IRQ enable handling on FW init failure
      wl1271: Implement beacon early termination support
      wl1271: Remove busy-word checking
      wl1271: Fix multicast list handling
      wl1271: Fix event handling mechanism
      wl1271: Support for IPv4 ARP filtering
      wl1271: Remove unnecessary rx_descriptor memory allocation
      wl1271: Correct memory handling for FW boot
      wl1271: Fix filter configuration
      wl1271: Set IEEE80211_FCTL_TODS in the null data template

Kalle Valo (3):
      wl1251: rename spi device to wl1251
      mac80211: add ieee80211_rx_ni()
      wl1251: use ieee80211_rx_ni()

Luciano Coelho (15):
      wl1271: remove unecessary qual parameter from rx status
      wl1271: added Juuso Oikarinen as module author
      wl1271: hack to disable filters
      wl1271: implement cmd_disconnect
      wl1271: workaround to send a disconnect before rejoining
      wl1271: add workaround to avoid distortion due to excessive tx power
      wl1271: enable HW_AVAILABLE interrupt to fix ELP
      wl1271: use acx_rx_config instead of join when updating filters
      wl1271: remove unnecessary joins and join only when the bssid changes
      wl1271: make sure PS is disabled in PLT
      wl1271: fix sparse warnings about undeclared functions
      wl1271: added missing packed modifier in some acx structs
      wl1271: fix endianess issues
      wl1271: added missing packed modifier in some cmd structs
      wl1271: use ieee80211_rx_ni()

Luis R. Rodriguez (2):
      ath9k_hw: run the carrier leakage calibration fix for ar9271 as well
      ath9k_hw: run ath9k_hw_9271_pa_cal() initial calibration

Marek Lindner (1):
      ath9k: adjust ahb callbacks to new struct layout to avoid compile errors

Matthieu CASTET (1):
      airo : allow supend with card without power management

Michael Buesch (4):
      b43/legacy: Fix usage of host_pci pointer
      ssb: Put host pointers into a union
      b43: Remove me as maintainer
      b43: Optimize PIO scratchbuffer usage

Reinette Chatre (5):
      iwlwifi: fix userspace setting of sleep_level_override
      iwlwifi: move iwl_setup_mac to iwlagn
      iwlwifi: move rate scaling structures to header file
      iwlagn: store station rate scale information in mac80211 station structure
      iwlwifi: remove duplicate defines

Rui Paulo (1):
      mesh: use set_bit() to set MESH_WORK_HOUSEKEEPING.

Samuel Ortiz (13):
      iwmc3200wifi: WPS support
      iwmc3200wifi: CT kill support
      iwmc3200wifi: Profile flags can be WPA1 or WPA2 not both
      iwmc3200wifi: Improve rx debug
      iwmc3200wifi: Update statistics notification structure
      iwmc3200wifi: Update fixed size config definitions
      iwmc3200wifi: Tx power setting
      iwmc3200wifi: SDIO disable race fix
      iwmc3200wifi: Check for cmd pointer before dereferencing it
      iwmc3200wifi: Do not handle wifi command if the interface is not ready
      iwmc3200wifi: Try shared auth when open WEP fails
      iwmc3200wifi: Support unexpected reboot barker
      iwmc3200wifi: Set wiphy firmware version

Sujith (1):
      ath9k: Fix TX hang poll routine

Teemu Paasikivi (5):
      wl1271: Added 5 GHz parameters for wl1273
      wl1271: Scan only enabled channels
      wl1271: Added support to scan on 5 GHz band
      wl1271: Added 5 GHz support to join and rx
      wl1271: Checking of rx descriptor status fixed

Vivek Natarajan (1):
      ath: Updates for regulatory and country codes.

Wey-Yi Guy (23):
      iwlwifi: remove duplicated/unused definition
      iwlwifi: additional items in sensitivity range table
      iwlwifi: dynamic allocate tx queue structure
      iwlwifi: showing accumulative ucode statistics counters
      iwlwifi: update channel switch command API
      iwlwifi: show current power save status reported by uCode
      iwlwifi: identify eeprom version for 6x50 series NIC
      iwlwifi: fix incorrect otp blocks number for 6x50 series
      iwlwifi: set auto clock gate disable bit for 6x00/6x50 series
      iwlwifi: no chain noise support for 6x50 series
      iwlwifi: rework for static power save
      iwlwifi: fix gain computation for 5000 series and up
      iwlwifi: separate led function from statistic notification
      iwlwifi: update bt co-exit configuration parameter
      iwlwifi: specify the valid tx/rx chain in device config structure
      iwlwifi: increase max tfd payload size
      iwlwifi: choose thermal throttle method based on device config
      iwlwifi: issue ct_kill host command based on device config
      iwlwifi: add channel switch support to 5000 series and up
      iwlwifi: remove unused parameters
      iwlwifi: remove duplicated define
      iwlwifi: update lowest API version support for 6x00 & 6x50 series
      iwlwifi: minor comments changes for wimax co-exist command

Zhu Yi (6):
      iwlwifi: use paged Rx
      iwmc3200wifi: add BGN sdio device id
      iwmc3200wifi: allow joining an existed IBSS network
      iwmc3200wifi: handle coexistence radio notification
      iwlwifi: fix use after free bug for paged rx
      iwlwifi: reuse page for notification packets

 MAINTAINERS                                  |    1 -
 drivers/net/wireless/airo.c                  |    3 +-
 drivers/net/wireless/ath/ar9170/ar9170.h     |    2 +-
 drivers/net/wireless/ath/ar9170/hw.h         |    4 +-
 drivers/net/wireless/ath/ar9170/main.c       |   11 +-
 drivers/net/wireless/ath/ar9170/usb.c        |   12 +-
 drivers/net/wireless/ath/ar9170/usb.h        |    2 +-
 drivers/net/wireless/ath/ath5k/ath5k.h       |   13 +
 drivers/net/wireless/ath/ath5k/attach.c      |    2 +
 drivers/net/wireless/ath/ath5k/phy.c         |  185 +-
 drivers/net/wireless/ath/ath5k/reg.h         |   11 +-
 drivers/net/wireless/ath/ath5k/reset.c       |   17 +-
 drivers/net/wireless/ath/ath9k/ahb.c         |    6 +-
 drivers/net/wireless/ath/ath9k/calib.c       |   28 +-
 drivers/net/wireless/ath/ath9k/xmit.c        |    2 +
 drivers/net/wireless/ath/regd.h              |    8 +
 drivers/net/wireless/ath/regd_common.h       |   32 +-
 drivers/net/wireless/b43/b43.h               |   16 +-
 drivers/net/wireless/b43/main.c              |    4 +-
 drivers/net/wireless/b43/pio.c               |   79 +-
 drivers/net/wireless/b43/xmit.c              |    7 +-
 drivers/net/wireless/b43legacy/main.c        |    4 +-
 drivers/net/wireless/iwlwifi/iwl-1000.c      |   17 +-
 drivers/net/wireless/iwlwifi/iwl-3945-hw.h   |   12 -
 drivers/net/wireless/iwlwifi/iwl-3945.c      |  237 +-
 drivers/net/wireless/iwlwifi/iwl-3945.h      |    8 -
 drivers/net/wireless/iwlwifi/iwl-4965-hw.h   |    3 -
 drivers/net/wireless/iwlwifi/iwl-4965.c      |  172 +-
 drivers/net/wireless/iwlwifi/iwl-5000.c      |  219 +-
 drivers/net/wireless/iwlwifi/iwl-6000.c      |  172 ++-
 drivers/net/wireless/iwlwifi/iwl-agn-rs.c    |  108 +-
 drivers/net/wireless/iwlwifi/iwl-agn-rs.h    |  101 +
 drivers/net/wireless/iwlwifi/iwl-agn.c       |  154 +-
 drivers/net/wireless/iwlwifi/iwl-calib.c     |    9 +-
 drivers/net/wireless/iwlwifi/iwl-commands.h  |   79 +-
 drivers/net/wireless/iwlwifi/iwl-core.c      |  260 ++-
 drivers/net/wireless/iwlwifi/iwl-core.h      |   24 +-
 drivers/net/wireless/iwlwifi/iwl-csr.h       |   11 +-
 drivers/net/wireless/iwlwifi/iwl-debug.h     |    1 +
 drivers/net/wireless/iwlwifi/iwl-debugfs.c   |  676 ++++--
 drivers/net/wireless/iwlwifi/iwl-dev.h       |   82 +-
 drivers/net/wireless/iwlwifi/iwl-eeprom.c    |    8 +
 drivers/net/wireless/iwlwifi/iwl-eeprom.h    |    5 +-
 drivers/net/wireless/iwlwifi/iwl-hcmd.c      |   23 +-
 drivers/net/wireless/iwlwifi/iwl-power.c     |   83 +-
 drivers/net/wireless/iwlwifi/iwl-rx.c        |  177 +-
 drivers/net/wireless/iwlwifi/iwl-scan.c      |   20 +-
 drivers/net/wireless/iwlwifi/iwl-spectrum.c  |    2 +-
 drivers/net/wireless/iwlwifi/iwl-sta.c       |   62 +-
 drivers/net/wireless/iwlwifi/iwl-tx.c        |   45 +-
 drivers/net/wireless/iwlwifi/iwl3945-base.c  |  266 ++-
 drivers/net/wireless/iwmc3200wifi/cfg80211.c |   47 +-
 drivers/net/wireless/iwmc3200wifi/commands.c |   31 +-
 drivers/net/wireless/iwmc3200wifi/commands.h |   70 +-
 drivers/net/wireless/iwmc3200wifi/fw.c       |    9 +
 drivers/net/wireless/iwmc3200wifi/iwm.h      |    6 +
 drivers/net/wireless/iwmc3200wifi/lmac.h     |    8 +
 drivers/net/wireless/iwmc3200wifi/main.c     |   46 +
 drivers/net/wireless/iwmc3200wifi/netdev.c   |    1 +
 drivers/net/wireless/iwmc3200wifi/rx.c       |   84 +-
 drivers/net/wireless/iwmc3200wifi/sdio.c     |   10 +-
 drivers/net/wireless/iwmc3200wifi/umac.h     |    5 +
 drivers/net/wireless/libertas/11d.c          |  696 ------
 drivers/net/wireless/libertas/11d.h          |  105 -
 drivers/net/wireless/libertas/Makefile       |    1 -
 drivers/net/wireless/libertas/assoc.c        |  445 ++++-
 drivers/net/wireless/libertas/assoc.h        |  141 ++-
 drivers/net/wireless/libertas/cmd.c          |  482 +----
 drivers/net/wireless/libertas/cmd.h          |  127 +-
 drivers/net/wireless/libertas/cmdresp.c      |  104 +-
 drivers/net/wireless/libertas/debugfs.c      |   27 +-
 drivers/net/wireless/libertas/decl.h         |   62 +-
 drivers/net/wireless/libertas/defs.h         |    1 -
 drivers/net/wireless/libertas/dev.h          |  424 +---
 drivers/net/wireless/libertas/host.h         |  960 +++++++--
 drivers/net/wireless/libertas/hostcmd.h      |  800 -------
 drivers/net/wireless/libertas/main.c         |  202 +--
 drivers/net/wireless/libertas/persistcfg.c   |    8 +-
 drivers/net/wireless/libertas/rx.c           |    2 +-
 drivers/net/wireless/libertas/scan.c         |  250 ++-
 drivers/net/wireless/libertas/scan.h         |   30 +
 drivers/net/wireless/libertas/tx.c           |    2 +-
 drivers/net/wireless/libertas/types.h        |    4 +-
 drivers/net/wireless/libertas/wext.c         |  144 +-
 drivers/net/wireless/libertas/wext.h         |    8 +
 drivers/net/wireless/orinoco/hw.c            |   33 +-
 drivers/net/wireless/orinoco/hw.h            |    3 +-
 drivers/net/wireless/orinoco/main.c          |   33 +-
 drivers/net/wireless/orinoco/orinoco.h       |    1 -
 drivers/net/wireless/rt2x00/Kconfig          |   30 +
 drivers/net/wireless/rt2x00/Makefile         |    2 +
 drivers/net/wireless/rt2x00/rt2800pci.c      | 3323 ++++++++++++++++++++++++++
 drivers/net/wireless/rt2x00/rt2800pci.h      | 1960 +++++++++++++++
 drivers/net/wireless/rt2x00/rt2x00.h         |    7 +
 drivers/net/wireless/rt2x00/rt2x00soc.c      |  159 ++
 drivers/net/wireless/rt2x00/rt2x00soc.h      |   52 +
 drivers/net/wireless/wl12xx/wl1251_main.c    |    7 +-
 drivers/net/wireless/wl12xx/wl1251_rx.c      |    2 +-
 drivers/net/wireless/wl12xx/wl1251_spi.c     |    2 +-
 drivers/net/wireless/wl12xx/wl1271.h         |   92 +-
 drivers/net/wireless/wl12xx/wl1271_acx.c     |  369 +++-
 drivers/net/wireless/wl12xx/wl1271_acx.h     |  586 ++---
 drivers/net/wireless/wl12xx/wl1271_boot.c    |  215 +-
 drivers/net/wireless/wl12xx/wl1271_boot.h    |   22 +-
 drivers/net/wireless/wl12xx/wl1271_cmd.c     |  329 ++-
 drivers/net/wireless/wl12xx/wl1271_cmd.h     |  115 +-
 drivers/net/wireless/wl12xx/wl1271_conf.h    |  911 +++++++
 drivers/net/wireless/wl12xx/wl1271_event.c   |   64 +-
 drivers/net/wireless/wl12xx/wl1271_event.h   |   30 +-
 drivers/net/wireless/wl12xx/wl1271_init.c    |  155 +-
 drivers/net/wireless/wl12xx/wl1271_init.h    |   53 +-
 drivers/net/wireless/wl12xx/wl1271_main.c    |  963 ++++++--
 drivers/net/wireless/wl12xx/wl1271_ps.c      |   68 +-
 drivers/net/wireless/wl12xx/wl1271_ps.h      |    2 +-
 drivers/net/wireless/wl12xx/wl1271_reg.h     |   47 +-
 drivers/net/wireless/wl12xx/wl1271_rx.c      |   86 +-
 drivers/net/wireless/wl12xx/wl1271_rx.h      |    4 +-
 drivers/net/wireless/wl12xx/wl1271_spi.c     |  311 ++--
 drivers/net/wireless/wl12xx/wl1271_spi.h     |   65 +-
 drivers/net/wireless/wl12xx/wl1271_tx.c      |   76 +-
 drivers/net/wireless/wl12xx/wl1271_tx.h      |   18 +-
 drivers/net/wireless/wl12xx/wl12xx_80211.h   |    4 +-
 drivers/net/wireless/zd1211rw/zd_chip.c      |    4 +-
 drivers/net/wireless/zd1211rw/zd_chip.h      |   18 +-
 drivers/net/wireless/zd1211rw/zd_mac.c       |  202 ++-
 drivers/net/wireless/zd1211rw/zd_mac.h       |   25 +-
 drivers/net/wireless/zd1211rw/zd_usb.c       |    4 +-
 drivers/ssb/driver_pcicore.c                 |    4 +-
 include/linux/ssb/ssb.h                      |   20 +-
 include/net/cfg80211.h                       |   31 +-
 include/net/mac80211.h                       |   32 +-
 net/mac80211/iface.c                         |    4 +-
 net/mac80211/mesh.c                          |    4 +-
 net/mac80211/mlme.c                          |   22 +-
 net/mac80211/rx.c                            |   21 +-
 net/mac80211/scan.c                          |   10 +-
 net/wireless/mlme.c                          |   45 +-
 137 files changed, 13469 insertions(+), 6003 deletions(-)
 delete mode 100644 drivers/net/wireless/libertas/11d.c
 delete mode 100644 drivers/net/wireless/libertas/11d.h
 delete mode 100644 drivers/net/wireless/libertas/hostcmd.h
 create mode 100644 drivers/net/wireless/rt2x00/rt2800pci.c
 create mode 100644 drivers/net/wireless/rt2x00/rt2800pci.h
 create mode 100644 drivers/net/wireless/rt2x00/rt2x00soc.c
 create mode 100644 drivers/net/wireless/rt2x00/rt2x00soc.h
 create mode 100644 drivers/net/wireless/wl12xx/wl1271_conf.h

Omnibus patch is available here:

	http://www.kernel.org/pub/linux/kernel/people/linville/wireless-next-2.6-2009-10-28.patch.bz2

-- 
John W. Linville		Someday the world will need a hero, and you
linville@tuxdriver.com			might be all we have.  Be ready.

^ permalink raw reply

* Re: [PATCH] b43: Fix DMA TX bounce buffer copying
From: Larry Finger @ 2009-10-28 21:48 UTC (permalink / raw)
  To: Michael Buesch; +Cc: linville, bcm43xx-dev, linux-wireless, Christian Casteyde
In-Reply-To: <200910282208.15792.mb@bu3sch.de>

Michael Buesch wrote:
> b43 allocates a bouncebuffer, if the supplied TX skb is in an invalid
> memory range for DMA.
> However, this is broken in that it fails to copy over some metadata to the
> new skb.
> 
> This patch fixes three problems:
> * Failure to adjust the ieee80211_tx_info pointer to the new buffer.
>   This results in a kmemcheck warning.
> * Failure to copy the skb cb, which contains ieee80211_tx_info, to the new skb.
>   This results in breakage of various TX-status postprocessing (Rate control).
> * Failure to transfer the queue mapping.
>   This results in the wrong queue being stopped on saturation and can result in queue overflow.
> 
> Signed-off-by: Michael Buesch <mb@bu3sch.de>
> Tested-by: Christian Casteyde <casteyde.christian@free.fr>
> 
> ---
> 
> Thanks to Johannes for tracking down this hard to find bug and
> thanks to Christian for testing.
> 
> Larry, I think I remember you reported a strange rate control failure on
> one of your cards. Does this patch fix it?
> 
> b43legacy:
> Note that b43legacy has the same bug and also needs fixing.
> Is there a maintainer for b43legacy?

Michael,

There was not really a rate-control problem - just a difficulty with
the operator. I was making a transmit test, then interrogating the
rate from the same console. By that time, the rate was back to 1 Mb/s
for control messages. When I looped the transmit tests, and looked at
the rate in a separate console, the code was doing mostly what it
should. Mostly because the success rate for the LP PHY does not
satisfy the assumptions that mistrel makes. One gets a higher
throughput with a fixed rate, but that will improve as power control
is implemented.

There is no maintainer for b43legacy. I have ported your patch for b43
to legacy and I will be testing and submitting it.

Larry


^ permalink raw reply

* Re: pull request: wireless-next-2.6 2009-10-28
From: Bartlomiej Zolnierkiewicz @ 2009-10-28 21:56 UTC (permalink / raw)
  To: John W. Linville; +Cc: davem, linux-wireless, netdev, linux-kernel
In-Reply-To: <20091028211031.GF2856@tuxdriver.com>

On Wednesday 28 October 2009 22:10:32 John W. Linville wrote:
> Dave,
> 
> I let my patches pile-up!  Yikes!!
> 
> This request includes the usual ton of stuff for -next -- driver
> updates, fixes for some earlier -next stuff, a few cfg80211 changes to
> accomodate the libertas driver, etc.  Of note is the rt2800pci support
> added to the rt2x00 family.

Unfortunately rt2800pci support is non-functioning at the moment... :(

> Pleaset let me know if there are problems!

I find it rather disappointing that all my review comments regarding
rt2800pci support were just completely ignored and then the initial
patch was merged just as it was..

The way rt2800usb and rt2800pci drivers are designed really results
in making the task of adding working support for RT28x0 and RT30x0
chipsets to rt2x00 infrastructure more difficult and time consuming
than it should be... :(

-- 
Bartlomiej Zolnierkiewicz

^ permalink raw reply

* [PATCH -next] wireless: airo_cs needs WEXT_SPY
From: Randy Dunlap @ 2009-10-28 23:08 UTC (permalink / raw)
  To: Stephen Rothwell, linux-wireless; +Cc: linux-next, LKML, linville
In-Reply-To: <20091028190643.627f10aa.sfr@canb.auug.org.au>

From: Randy Dunlap <randy.dunlap@oracle.com>

airo_cs uses spy interfaces so it needs to select WEXT_SPY.

ERROR: "iw_handler_set_thrspy" [drivers/net/wireless/airo.ko] undefined!
ERROR: "wireless_spy_update" [drivers/net/wireless/airo.ko] undefined!
ERROR: "iw_handler_get_spy" [drivers/net/wireless/airo.ko] undefined!
ERROR: "iw_handler_get_thrspy" [drivers/net/wireless/airo.ko] undefined!
ERROR: "iw_handler_set_spy" [drivers/net/wireless/airo.ko] undefined!

Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
---
 drivers/net/wireless/Kconfig |    1 +
 1 file changed, 1 insertion(+)

--- linux-next-20091028.orig/drivers/net/wireless/Kconfig
+++ linux-next-20091028/drivers/net/wireless/Kconfig
@@ -111,6 +111,7 @@ config AIRO_CS
 	tristate "Cisco/Aironet 34X/35X/4500/4800 PCMCIA cards"
 	depends on PCMCIA && (BROKEN || !M32R)
 	select WIRELESS_EXT
+	select WEXT_SPY
 	select CRYPTO
 	select CRYPTO_AES
 	---help---

^ permalink raw reply

* [PATCH] ath9k: fix misplaced semicolon on rate control
From: Luis R. Rodriguez @ 2009-10-29  0:19 UTC (permalink / raw)
  To: linville; +Cc: linux-wireless, ath9k-devel, Luis R. Rodriguez, stable

The patch e43419f9:

	ath9k: downgrade assert in rc.c for invalid rate

downgraded an ASSERT to a WARN_ON() but also misplaced a
semicolon at the end of the second check. What this did
was force the rate control code to always return the rate
even if we should have warned about it. Since this should
not have happened anymore anyway this fix isn't critical
as the proper rate would have been returned anyway.

Cc: stable@kernel.org
Reported-by: Jiri Slaby <jirislaby@gmail.com>
Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
---
 drivers/net/wireless/ath/ath9k/rc.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/net/wireless/ath/ath9k/rc.c b/drivers/net/wireless/ath/ath9k/rc.c
index 0639364..bb72b46 100644
--- a/drivers/net/wireless/ath/ath9k/rc.c
+++ b/drivers/net/wireless/ath/ath9k/rc.c
@@ -679,7 +679,7 @@ static u8 ath_rc_get_highest_rix(struct ath_softc *sc,
 		return rate;
 
 	if (rate_table->info[rate].valid_single_stream &&
-	    !(ath_rc_priv->ht_cap & WLAN_RC_DS_FLAG));
+	    !(ath_rc_priv->ht_cap & WLAN_RC_DS_FLAG))
 		return rate;
 
 	/* This should not happen */
-- 
1.6.0.4


^ permalink raw reply related

* Re: [RFC] ath9k: update hw configuration for virtual wiphys
From: Luis R. Rodriguez @ 2009-10-29  1:36 UTC (permalink / raw)
  To: Luis R. Rodriguez; +Cc: Jouni.Malinen, linux-wireless, ath9k-devel
In-Reply-To: <1256762627-1574-1-git-send-email-lrodriguez@atheros.com>

On Wed, Oct 28, 2009 at 04:43:47PM -0400, Luis R. Rodriguez wrote:
> ath9k supports its own virtual wiphys. The hardware code
> relies on the ieee80211_hw for the present interface but
> with recent changes introduced the common->hw was never
> updated and is required for virtual wiphys.
> 
> Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
> ---
> 
> Jouni, it seems this the right place for this, do you agree?
> 
>  drivers/net/wireless/ath/ath9k/virtual.c |    5 +++++
>  1 files changed, 5 insertions(+), 0 deletions(-)

Here is a bigger alternative to that 5-line patch. What it
illustrates is that the the current virtual wiphy needs to be kept
record of for asynchronous events one way or another. I list
the events below.

  Luis

From: Luis R. Rodriguez <lrodriguez@atheros.com>
Subject: [PATCH] ath9k: update hw configuration for virtual wiphys

ath9k supports its own virtual wiphys. The hardware code
relies on the ieee80211_hw for the present interface but
with recent changes introduced the common->hw was never
updated and is required for virtual wiphys. Instead of
relying on the common->hw pointer remove it and instead
require all hw code to pass the currently used ieee80211_hw
struct used.

Worth noting though is that at specific events we need
the hw code to access the hw configuration and during
those events the driver has currently no way of knowing
what the currently used virtual wiphy. For now we stick
to using the sc->hw for those events. These events are:

Interrupt:

  * ISR --> ATH9K_INT_MIB --> ath9k_hw_procmibevent()
  * tasklet --> ATH9K_INT_FATAL --> ath_reset()
  * beacon tasklet --> ath_reset()

Timer:

  * ath_ani_calibrate -->
		ath9k_hw_reset_calvalid()
		ath9k_hw_ani_monitor()

Xmit:

  * ath_tx_complete_poll_work --> needreset --> ath_reset() (Xmit hang check)
  * tasklet --> tx --> ath_tx_complete_aggr() --> needreset --> ath_reset()
  * tasklet --> ath_draintxq --> ath_tx_complete_aggr() --> needreset --> ath_reset()

Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
---
 drivers/net/wireless/ath/ath.h           |    1 -
 drivers/net/wireless/ath/ath5k/base.c    |    1 -
 drivers/net/wireless/ath/ath9k/ani.c     |   21 +++---
 drivers/net/wireless/ath/ath9k/ani.h     |    5 +-
 drivers/net/wireless/ath/ath9k/ath9k.h   |    8 ++-
 drivers/net/wireless/ath/ath9k/beacon.c  |    4 +-
 drivers/net/wireless/ath/ath9k/calib.c   |   20 +++---
 drivers/net/wireless/ath/ath9k/calib.h   |    3 +-
 drivers/net/wireless/ath/ath9k/hw.c      |  115 ++++++++++++++++++-----------
 drivers/net/wireless/ath/ath9k/hw.h      |   11 ++-
 drivers/net/wireless/ath/ath9k/main.c    |   44 +++++++-----
 drivers/net/wireless/ath/ath9k/virtual.c |    6 +-
 drivers/net/wireless/ath/ath9k/xmit.c    |    6 +-
 13 files changed, 150 insertions(+), 95 deletions(-)

diff --git a/drivers/net/wireless/ath/ath.h b/drivers/net/wireless/ath/ath.h
index 5e19a73..e97f5c9 100644
--- a/drivers/net/wireless/ath/ath.h
+++ b/drivers/net/wireless/ath/ath.h
@@ -62,7 +62,6 @@ struct ath_bus_ops {
 struct ath_common {
 	void *ah;
 	void *priv;
-	struct ieee80211_hw *hw;
 	int debug_mask;
 	enum ath_device_state state;
 
diff --git a/drivers/net/wireless/ath/ath5k/base.c b/drivers/net/wireless/ath/ath5k/base.c
index 07c1e52..523b359 100644
--- a/drivers/net/wireless/ath/ath5k/base.c
+++ b/drivers/net/wireless/ath/ath5k/base.c
@@ -594,7 +594,6 @@ ath5k_pci_probe(struct pci_dev *pdev,
 	common = ath5k_hw_common(sc->ah);
 	common->ops = &ath5k_common_ops;
 	common->ah = sc->ah;
-	common->hw = hw;
 	common->cachelsz = csz << 2; /* convert to bytes */
 
 	/* Initialize device */
diff --git a/drivers/net/wireless/ath/ath9k/ani.c b/drivers/net/wireless/ath/ath9k/ani.c
index 2a0cd64..dd87cbd 100644
--- a/drivers/net/wireless/ath/ath9k/ani.c
+++ b/drivers/net/wireless/ath/ath9k/ani.c
@@ -273,9 +273,10 @@ static void ath9k_ani_restart(struct ath_hw *ah)
 	aniState->cckPhyErrCount = 0;
 }
 
-static void ath9k_hw_ani_ofdm_err_trigger(struct ath_hw *ah)
+static void ath9k_hw_ani_ofdm_err_trigger(struct ath_hw *ah,
+					  struct ieee80211_hw *hw)
 {
-	struct ieee80211_conf *conf = &ath9k_hw_common(ah)->hw->conf;
+	struct ieee80211_conf *conf = &hw->conf;
 	struct ar5416AniState *aniState;
 	int32_t rssi;
 
@@ -345,9 +346,10 @@ static void ath9k_hw_ani_ofdm_err_trigger(struct ath_hw *ah)
 	}
 }
 
-static void ath9k_hw_ani_cck_err_trigger(struct ath_hw *ah)
+static void ath9k_hw_ani_cck_err_trigger(struct ath_hw *ah,
+					 struct ieee80211_hw *hw)
 {
-	struct ieee80211_conf *conf = &ath9k_hw_common(ah)->hw->conf;
+	struct ieee80211_conf *conf = &hw->conf;
 	struct ar5416AniState *aniState;
 	int32_t rssi;
 
@@ -545,6 +547,7 @@ void ath9k_ani_reset(struct ath_hw *ah)
 }
 
 void ath9k_hw_ani_monitor(struct ath_hw *ah,
+			  struct ieee80211_hw *hw,
 			  struct ath9k_channel *chan)
 {
 	struct ar5416AniState *aniState;
@@ -619,12 +622,12 @@ void ath9k_hw_ani_monitor(struct ath_hw *ah,
 	} else if (aniState->listenTime > ah->aniperiod) {
 		if (aniState->ofdmPhyErrCount > aniState->listenTime *
 		    aniState->ofdmTrigHigh / 1000) {
-			ath9k_hw_ani_ofdm_err_trigger(ah);
+			ath9k_hw_ani_ofdm_err_trigger(ah, hw);
 			ath9k_ani_restart(ah);
 		} else if (aniState->cckPhyErrCount >
 			   aniState->listenTime * aniState->cckTrigHigh /
 			   1000) {
-			ath9k_hw_ani_cck_err_trigger(ah);
+			ath9k_hw_ani_cck_err_trigger(ah, hw);
 			ath9k_ani_restart(ah);
 		}
 	}
@@ -708,7 +711,7 @@ u32 ath9k_hw_GetMibCycleCountsPct(struct ath_hw *ah,
  * any of the MIB counters overflow/trigger so don't assume we're
  * here because a PHY error counter triggered.
  */
-void ath9k_hw_procmibevent(struct ath_hw *ah)
+void ath9k_hw_procmibevent(struct ath_hw *ah, struct ieee80211_hw *hw)
 {
 	u32 phyCnt1, phyCnt2;
 
@@ -750,9 +753,9 @@ void ath9k_hw_procmibevent(struct ath_hw *ah)
 		 * check will never be true.
 		 */
 		if (aniState->ofdmPhyErrCount > aniState->ofdmTrigHigh)
-			ath9k_hw_ani_ofdm_err_trigger(ah);
+			ath9k_hw_ani_ofdm_err_trigger(ah, hw);
 		if (aniState->cckPhyErrCount > aniState->cckTrigHigh)
-			ath9k_hw_ani_cck_err_trigger(ah);
+			ath9k_hw_ani_cck_err_trigger(ah, hw);
 		/* NB: always restart to insure the h/w counters are reset */
 		ath9k_ani_restart(ah);
 	}
diff --git a/drivers/net/wireless/ath/ath9k/ani.h b/drivers/net/wireless/ath/ath9k/ani.h
index 4e1ab94..ac0592e 100644
--- a/drivers/net/wireless/ath/ath9k/ani.h
+++ b/drivers/net/wireless/ath/ath9k/ani.h
@@ -17,6 +17,8 @@
 #ifndef ANI_H
 #define ANI_H
 
+#include "hw.h"
+
 #define HAL_PROCESS_ANI           0x00000001
 
 #define DO_ANI(ah) (((ah)->proc_phyerr & HAL_PROCESS_ANI))
@@ -110,12 +112,13 @@ struct ar5416Stats {
 
 void ath9k_ani_reset(struct ath_hw *ah);
 void ath9k_hw_ani_monitor(struct ath_hw *ah,
+			  struct ieee80211_hw *hw,
 			  struct ath9k_channel *chan);
 void ath9k_enable_mib_counters(struct ath_hw *ah);
 void ath9k_hw_disable_mib_counters(struct ath_hw *ah);
 u32 ath9k_hw_GetMibCycleCountsPct(struct ath_hw *ah, u32 *rxc_pcnt,
 				  u32 *rxf_pcnt, u32 *txf_pcnt);
-void ath9k_hw_procmibevent(struct ath_hw *ah);
+void ath9k_hw_procmibevent(struct ath_hw *ah, struct ieee80211_hw *hw);
 void ath9k_hw_ani_setup(struct ath_hw *ah);
 void ath9k_hw_ani_init(struct ath_hw *ah);
 void ath9k_hw_ani_disable(struct ath_hw *ah);
diff --git a/drivers/net/wireless/ath/ath9k/ath9k.h b/drivers/net/wireless/ath/ath9k/ath9k.h
index 13dd020..3b551a7 100644
--- a/drivers/net/wireless/ath/ath9k/ath9k.h
+++ b/drivers/net/wireless/ath/ath9k/ath9k.h
@@ -341,7 +341,9 @@ int ath_rx_tasklet(struct ath_softc *sc, int flush);
 struct ath_txq *ath_txq_setup(struct ath_softc *sc, int qtype, int subtype);
 void ath_tx_cleanupq(struct ath_softc *sc, struct ath_txq *txq);
 int ath_tx_setup(struct ath_softc *sc, int haltype);
-void ath_drain_all_txq(struct ath_softc *sc, bool retry_tx);
+void ath_drain_all_txq(struct ath_softc *sc,
+		       struct ieee80211_hw *hw,
+		       bool retry_tx);
 void ath_draintxq(struct ath_softc *sc,
 		     struct ath_txq *txq, bool retry_tx);
 void ath_tx_node_init(struct ath_softc *sc, struct ath_node *an);
@@ -654,8 +656,8 @@ void ath9k_update_ichannel(struct ath_softc *sc, struct ieee80211_hw *hw,
 void ath_update_chainmask(struct ath_softc *sc, int is_ht);
 int ath_set_channel(struct ath_softc *sc, struct ieee80211_hw *hw,
 		    struct ath9k_channel *hchan);
-void ath_radio_enable(struct ath_softc *sc);
-void ath_radio_disable(struct ath_softc *sc);
+void ath_radio_enable(struct ath_softc *sc, struct ieee80211_hw *hw);
+void ath_radio_disable(struct ath_softc *sc, struct ieee80211_hw *hw);
 
 #ifdef CONFIG_PCI
 int ath_pci_init(void);
diff --git a/drivers/net/wireless/ath/ath9k/beacon.c b/drivers/net/wireless/ath/ath9k/beacon.c
index b10c884..0797207 100644
--- a/drivers/net/wireless/ath/ath9k/beacon.c
+++ b/drivers/net/wireless/ath/ath9k/beacon.c
@@ -385,6 +385,7 @@ void ath_beacon_tasklet(unsigned long data)
 	struct ath_buf *bf = NULL;
 	struct ieee80211_vif *vif;
 	struct ath_wiphy *aphy;
+	struct ieee80211_hw *hw;
 	int slot;
 	u32 bfaddr, bc = 0, tsftu;
 	u64 tsf;
@@ -442,6 +443,7 @@ void ath_beacon_tasklet(unsigned long data)
 	slot = ATH_BCBUF - slot - 1;
 	vif = sc->beacon.bslot[slot];
 	aphy = sc->beacon.bslot_aphy[slot];
+	hw = aphy->hw;
 
 	ath_print(common, ATH_DBG_BEACON,
 		  "slot %d [tsf %llu tsftu %u intval %u] vif %p\n",
@@ -476,7 +478,7 @@ void ath_beacon_tasklet(unsigned long data)
 		sc->beacon.updateslot = COMMIT; /* commit next beacon */
 		sc->beacon.slotupdate = slot;
 	} else if (sc->beacon.updateslot == COMMIT && sc->beacon.slotupdate == slot) {
-		ath9k_hw_setslottime(sc->sc_ah, sc->beacon.slottime);
+		ath9k_hw_setslottime(sc->sc_ah, &hw->conf, sc->beacon.slottime);
 		sc->beacon.updateslot = OK;
 	}
 	if (bfaddr != 0) {
diff --git a/drivers/net/wireless/ath/ath9k/calib.c b/drivers/net/wireless/ath/ath9k/calib.c
index 238a574..cb42861 100644
--- a/drivers/net/wireless/ath/ath9k/calib.c
+++ b/drivers/net/wireless/ath/ath9k/calib.c
@@ -279,10 +279,9 @@ static bool ath9k_hw_per_calibration(struct ath_hw *ah,
 
 /* Assumes you are talking about the currently configured channel */
 static bool ath9k_hw_iscal_supported(struct ath_hw *ah,
+				     struct ieee80211_conf *conf,
 				     enum ath9k_cal_types calType)
 {
-	struct ieee80211_conf *conf = &ath9k_hw_common(ah)->hw->conf;
-
 	switch (calType & ah->supp_cals) {
 	case IQ_MISMATCH_CAL: /* Both 2 GHz and 5 GHz support OFDM */
 		return true;
@@ -560,10 +559,10 @@ static void ath9k_hw_adc_dccal_calibrate(struct ath_hw *ah, u8 numChains)
 }
 
 /* This is done for the currently configured channel */
-bool ath9k_hw_reset_calvalid(struct ath_hw *ah)
+bool ath9k_hw_reset_calvalid(struct ath_hw *ah, struct ieee80211_hw *hw)
 {
 	struct ath_common *common = ath9k_hw_common(ah);
-	struct ieee80211_conf *conf = &common->hw->conf;
+	struct ieee80211_conf *conf = &hw->conf;
 	struct ath9k_cal_list *currCal = ah->cal_list_curr;
 
 	if (!ah->curchan)
@@ -582,7 +581,7 @@ bool ath9k_hw_reset_calvalid(struct ath_hw *ah)
 		return true;
 	}
 
-	if (!ath9k_hw_iscal_supported(ah, currCal->calData->calType))
+	if (!ath9k_hw_iscal_supported(ah, conf, currCal->calData->calType))
 		return true;
 
 	ath_print(common, ATH_DBG_CALIBRATE,
@@ -1121,8 +1120,11 @@ static bool ar9285_clc(struct ath_hw *ah, struct ath9k_channel *chan)
 	return true;
 }
 
-bool ath9k_hw_init_cal(struct ath_hw *ah, struct ath9k_channel *chan)
+bool ath9k_hw_init_cal(struct ath_hw *ah,
+		       struct ieee80211_hw *hw,
+		       struct ath9k_channel *chan)
 {
+	struct ieee80211_conf *conf = &hw->conf;
 	struct ath_common *common = ath9k_hw_common(ah);
 
 	if (AR_SREV_9271(ah) || AR_SREV_9285_12_OR_LATER(ah)) {
@@ -1174,19 +1176,19 @@ bool ath9k_hw_init_cal(struct ath_hw *ah, struct ath9k_channel *chan)
 
 	/* Enable IQ, ADC Gain and ADC DC offset CALs */
 	if (AR_SREV_9100(ah) || AR_SREV_9160_10_OR_LATER(ah)) {
-		if (ath9k_hw_iscal_supported(ah, ADC_GAIN_CAL)) {
+		if (ath9k_hw_iscal_supported(ah, conf, ADC_GAIN_CAL)) {
 			INIT_CAL(&ah->adcgain_caldata);
 			INSERT_CAL(ah, &ah->adcgain_caldata);
 			ath_print(common, ATH_DBG_CALIBRATE,
 				  "enabling ADC Gain Calibration.\n");
 		}
-		if (ath9k_hw_iscal_supported(ah, ADC_DC_CAL)) {
+		if (ath9k_hw_iscal_supported(ah, conf, ADC_DC_CAL)) {
 			INIT_CAL(&ah->adcdc_caldata);
 			INSERT_CAL(ah, &ah->adcdc_caldata);
 			ath_print(common, ATH_DBG_CALIBRATE,
 				  "enabling ADC DC Calibration.\n");
 		}
-		if (ath9k_hw_iscal_supported(ah, IQ_MISMATCH_CAL)) {
+		if (ath9k_hw_iscal_supported(ah, conf, IQ_MISMATCH_CAL)) {
 			INIT_CAL(&ah->iq_caldata);
 			INSERT_CAL(ah, &ah->iq_caldata);
 			ath_print(common, ATH_DBG_CALIBRATE,
diff --git a/drivers/net/wireless/ath/ath9k/calib.h b/drivers/net/wireless/ath/ath9k/calib.h
index b2c873e..ff7b3c1 100644
--- a/drivers/net/wireless/ath/ath9k/calib.h
+++ b/drivers/net/wireless/ath/ath9k/calib.h
@@ -120,7 +120,7 @@ struct ath9k_pacal_info{
 	int8_t skipcount;	/* No. of times the PACAL to be skipped */
 };
 
-bool ath9k_hw_reset_calvalid(struct ath_hw *ah);
+bool ath9k_hw_reset_calvalid(struct ath_hw *ah, struct ieee80211_hw *hw);
 void ath9k_hw_start_nfcal(struct ath_hw *ah);
 void ath9k_hw_loadnf(struct ath_hw *ah, struct ath9k_channel *chan);
 int16_t ath9k_hw_getnf(struct ath_hw *ah,
@@ -130,6 +130,7 @@ s16 ath9k_hw_getchan_noise(struct ath_hw *ah, struct ath9k_channel *chan);
 bool ath9k_hw_calibrate(struct ath_hw *ah, struct ath9k_channel *chan,
 			u8 rxchainmask, bool longcal);
 bool ath9k_hw_init_cal(struct ath_hw *ah,
+		       struct ieee80211_hw *hw,
 		       struct ath9k_channel *chan);
 
 #endif /* CALIB_H */
diff --git a/drivers/net/wireless/ath/ath9k/hw.c b/drivers/net/wireless/ath/ath9k/hw.c
index 111ff04..f08cc61 100644
--- a/drivers/net/wireless/ath/ath9k/hw.c
+++ b/drivers/net/wireless/ath/ath9k/hw.c
@@ -26,7 +26,9 @@
 #define ATH9K_CLOCK_RATE_2GHZ_OFDM	44
 
 static bool ath9k_hw_set_reset_reg(struct ath_hw *ah, u32 type);
-static void ath9k_hw_set_regs(struct ath_hw *ah, struct ath9k_channel *chan);
+static void ath9k_hw_set_regs(struct ath_hw *ah,
+			      struct ieee80211_hw *hw,
+			      struct ath9k_channel *chan);
 static u32 ath9k_hw_ini_fixup(struct ath_hw *ah,
 			      struct ar5416_eeprom_def *pEepData,
 			      u32 reg, u32 value);
@@ -52,10 +54,10 @@ module_exit(ath9k_exit);
 /* Helper Functions */
 /********************/
 
-static u32 ath9k_hw_mac_usec(struct ath_hw *ah, u32 clks)
+static u32 ath9k_hw_mac_usec(struct ath_hw *ah,
+			     struct ieee80211_conf *conf,
+			     u32 clks)
 {
-	struct ieee80211_conf *conf = &ath9k_hw_common(ah)->hw->conf;
-
 	if (!ah->curchan) /* should really check for CCK instead */
 		return clks / ATH9K_CLOCK_RATE_CCK;
 	if (conf->channel->band == IEEE80211_BAND_2GHZ)
@@ -64,20 +66,20 @@ static u32 ath9k_hw_mac_usec(struct ath_hw *ah, u32 clks)
 	return clks / ATH9K_CLOCK_RATE_5GHZ_OFDM;
 }
 
-static u32 ath9k_hw_mac_to_usec(struct ath_hw *ah, u32 clks)
+static u32 ath9k_hw_mac_to_usec(struct ath_hw *ah,
+				struct ieee80211_conf *conf,
+				u32 clks)
 {
-	struct ieee80211_conf *conf = &ath9k_hw_common(ah)->hw->conf;
-
 	if (conf_is_ht40(conf))
-		return ath9k_hw_mac_usec(ah, clks) / 2;
+		return ath9k_hw_mac_usec(ah, conf, clks) / 2;
 	else
-		return ath9k_hw_mac_usec(ah, clks);
+		return ath9k_hw_mac_usec(ah, conf, clks);
 }
 
-static u32 ath9k_hw_mac_clks(struct ath_hw *ah, u32 usecs)
+static u32 ath9k_hw_mac_clks(struct ath_hw *ah,
+			     struct ieee80211_conf *conf,
+			     u32 usecs)
 {
-	struct ieee80211_conf *conf = &ath9k_hw_common(ah)->hw->conf;
-
 	if (!ah->curchan) /* should really check for CCK instead */
 		return usecs *ATH9K_CLOCK_RATE_CCK;
 	if (conf->channel->band == IEEE80211_BAND_2GHZ)
@@ -85,14 +87,14 @@ static u32 ath9k_hw_mac_clks(struct ath_hw *ah, u32 usecs)
 	return usecs *ATH9K_CLOCK_RATE_5GHZ_OFDM;
 }
 
-static u32 ath9k_hw_mac_to_clks(struct ath_hw *ah, u32 usecs)
+static u32 ath9k_hw_mac_to_clks(struct ath_hw *ah,
+				struct ieee80211_conf *conf,
+				u32 usecs)
 {
-	struct ieee80211_conf *conf = &ath9k_hw_common(ah)->hw->conf;
-
 	if (conf_is_ht40(conf))
-		return ath9k_hw_mac_clks(ah, usecs) * 2;
+		return ath9k_hw_mac_clks(ah, conf, usecs) * 2;
 	else
-		return ath9k_hw_mac_clks(ah, usecs);
+		return ath9k_hw_mac_clks(ah, conf, usecs);
 }
 
 bool ath9k_hw_wait(struct ath_hw *ah, u32 reg, u32 mask, u32 val, u32 timeout)
@@ -1205,31 +1207,43 @@ static void ath9k_hw_init_interrupt_masks(struct ath_hw *ah,
 	}
 }
 
-static bool ath9k_hw_set_ack_timeout(struct ath_hw *ah, u32 us)
+static bool ath9k_hw_set_ack_timeout(struct ath_hw *ah,
+				     struct ieee80211_conf *conf,
+				     u32 us)
 {
-	if (us > ath9k_hw_mac_to_usec(ah, MS(0xffffffff, AR_TIME_OUT_ACK))) {
+	if (us > ath9k_hw_mac_to_usec(ah,
+				      conf,
+				      MS(0xffffffff, AR_TIME_OUT_ACK))) {
 		ath_print(ath9k_hw_common(ah), ATH_DBG_RESET,
 			  "bad ack timeout %u\n", us);
 		ah->acktimeout = (u32) -1;
 		return false;
 	} else {
-		REG_RMW_FIELD(ah, AR_TIME_OUT,
-			      AR_TIME_OUT_ACK, ath9k_hw_mac_to_clks(ah, us));
+		REG_RMW_FIELD(ah,
+			      AR_TIME_OUT,
+			      AR_TIME_OUT_ACK,
+			      ath9k_hw_mac_to_clks(ah, conf, us));
 		ah->acktimeout = us;
 		return true;
 	}
 }
 
-static bool ath9k_hw_set_cts_timeout(struct ath_hw *ah, u32 us)
+static bool ath9k_hw_set_cts_timeout(struct ath_hw *ah,
+				     struct ieee80211_conf *conf,
+				     u32 us)
 {
-	if (us > ath9k_hw_mac_to_usec(ah, MS(0xffffffff, AR_TIME_OUT_CTS))) {
+	if (us > ath9k_hw_mac_to_usec(ah,
+				      conf,
+				      MS(0xffffffff, AR_TIME_OUT_CTS))) {
 		ath_print(ath9k_hw_common(ah), ATH_DBG_RESET,
 			  "bad cts timeout %u\n", us);
 		ah->ctstimeout = (u32) -1;
 		return false;
 	} else {
-		REG_RMW_FIELD(ah, AR_TIME_OUT,
-			      AR_TIME_OUT_CTS, ath9k_hw_mac_to_clks(ah, us));
+		REG_RMW_FIELD(ah,
+			      AR_TIME_OUT,
+			      AR_TIME_OUT_CTS,
+			      ath9k_hw_mac_to_clks(ah, conf, us));
 		ah->ctstimeout = us;
 		return true;
 	}
@@ -1249,7 +1263,8 @@ static bool ath9k_hw_set_global_txtimeout(struct ath_hw *ah, u32 tu)
 	}
 }
 
-static void ath9k_hw_init_user_settings(struct ath_hw *ah)
+static void ath9k_hw_init_user_settings(struct ath_hw *ah,
+					struct ieee80211_conf *conf)
 {
 	ath_print(ath9k_hw_common(ah), ATH_DBG_RESET, "ah->misc_mode 0x%x\n",
 		  ah->misc_mode);
@@ -1258,11 +1273,11 @@ static void ath9k_hw_init_user_settings(struct ath_hw *ah)
 		REG_WRITE(ah, AR_PCU_MISC,
 			  REG_READ(ah, AR_PCU_MISC) | ah->misc_mode);
 	if (ah->slottime != (u32) -1)
-		ath9k_hw_setslottime(ah, ah->slottime);
+		ath9k_hw_setslottime(ah, conf, ah->slottime);
 	if (ah->acktimeout != (u32) -1)
-		ath9k_hw_set_ack_timeout(ah, ah->acktimeout);
+		ath9k_hw_set_ack_timeout(ah, conf, ah->acktimeout);
 	if (ah->ctstimeout != (u32) -1)
-		ath9k_hw_set_cts_timeout(ah, ah->ctstimeout);
+		ath9k_hw_set_cts_timeout(ah, conf, ah->ctstimeout);
 	if (ah->globaltxtimeout != (u32) -1)
 		ath9k_hw_set_global_txtimeout(ah, ah->globaltxtimeout);
 }
@@ -1431,6 +1446,7 @@ static u32 ath9k_regd_get_ctl(struct ath_regulatory *reg,
 }
 
 static int ath9k_hw_process_ini(struct ath_hw *ah,
+				struct ieee80211_hw *hw,
 				struct ath9k_channel *chan)
 {
 	struct ath_regulatory *regulatory = ath9k_hw_regulatory(ah);
@@ -1537,7 +1553,7 @@ static int ath9k_hw_process_ini(struct ath_hw *ah,
 	}
 
 	ath9k_hw_override_ini(ah, chan);
-	ath9k_hw_set_regs(ah, chan);
+	ath9k_hw_set_regs(ah, hw, chan);
 	ath9k_hw_init_chain_masks(ah);
 
 	if (OLC_FOR_AR9280_20_LATER)
@@ -1818,8 +1834,11 @@ static bool ath9k_hw_set_reset_reg(struct ath_hw *ah, u32 type)
 	}
 }
 
-static void ath9k_hw_set_regs(struct ath_hw *ah, struct ath9k_channel *chan)
+static void ath9k_hw_set_regs(struct ath_hw *ah,
+			      struct ieee80211_hw *hw,
+			      struct ath9k_channel *chan)
 {
+	struct ieee80211_conf *conf = &hw->conf;
 	u32 phymode;
 	u32 enableDacFifo = 0;
 
@@ -1840,7 +1859,7 @@ static void ath9k_hw_set_regs(struct ath_hw *ah, struct ath9k_channel *chan)
 	}
 	REG_WRITE(ah, AR_PHY_TURBO, phymode);
 
-	ath9k_hw_set11nmac2040(ah);
+	ath9k_hw_set11nmac2040(ah, conf);
 
 	REG_WRITE(ah, AR_GTXTO, 25 << AR_GTXTO_TIMEOUT_LIMIT_S);
 	REG_WRITE(ah, AR_CST, 0xF << AR_CST_TIMEOUT_LIMIT_S);
@@ -1866,6 +1885,7 @@ static bool ath9k_hw_chip_reset(struct ath_hw *ah,
 }
 
 static bool ath9k_hw_channel_change(struct ath_hw *ah,
+				    struct ieee80211_hw *hw,
 				    struct ath9k_channel *chan)
 {
 	struct ath_regulatory *regulatory = ath9k_hw_regulatory(ah);
@@ -1891,7 +1911,7 @@ static bool ath9k_hw_channel_change(struct ath_hw *ah,
 		return false;
 	}
 
-	ath9k_hw_set_regs(ah, chan);
+	ath9k_hw_set_regs(ah, hw, chan);
 
 	r = ah->ath9k_hw_rf_set_freq(ah, chan);
 	if (r) {
@@ -1940,10 +1960,13 @@ static void ath9k_enable_rfkill(struct ath_hw *ah)
 	REG_SET_BIT(ah, AR_PHY_TEST, RFSILENT_BB);
 }
 
-int ath9k_hw_reset(struct ath_hw *ah, struct ath9k_channel *chan,
-		    bool bChannelChange)
+int ath9k_hw_reset(struct ath_hw *ah,
+		   struct ieee80211_hw *hw,
+		   struct ath9k_channel *chan,
+		   bool bChannelChange)
 {
 	struct ath_common *common = ath9k_hw_common(ah);
+	struct ieee80211_conf *conf = &hw->conf;
 	u32 saveLedState;
 	struct ath9k_channel *curchan = ah->curchan;
 	u32 saveDefAntenna;
@@ -1969,7 +1992,7 @@ int ath9k_hw_reset(struct ath_hw *ah, struct ath9k_channel *chan,
 	     !(AR_SREV_9280(ah) || IS_CHAN_A_5MHZ_SPACED(chan) ||
 	     IS_CHAN_A_5MHZ_SPACED(ah->curchan))) {
 
-		if (ath9k_hw_channel_change(ah, chan)) {
+		if (ath9k_hw_channel_change(ah, hw, chan)) {
 			ath9k_hw_loadnf(ah, ah->curchan);
 			ath9k_hw_start_nfcal(ah);
 			return 0;
@@ -2029,7 +2052,7 @@ int ath9k_hw_reset(struct ath_hw *ah, struct ath9k_channel *chan,
 		REG_SET_BIT(ah, AR_MAC_PCU_ASYNC_FIFO_REG3,
 				AR_MAC_PCU_ASYNC_FIFO_REG3_SOFT_RESET);
 	}
-	r = ath9k_hw_process_ini(ah, chan);
+	r = ath9k_hw_process_ini(ah, hw, chan);
 	if (r)
 		return r;
 
@@ -2095,7 +2118,7 @@ int ath9k_hw_reset(struct ath_hw *ah, struct ath9k_channel *chan,
 	if (ah->caps.hw_caps & ATH9K_HW_CAP_RFSILENT)
 		ath9k_enable_rfkill(ah);
 
-	ath9k_hw_init_user_settings(ah);
+	ath9k_hw_init_user_settings(ah, conf);
 
 	if (AR_SREV_9287_12_OR_LATER(ah)) {
 		REG_WRITE(ah, AR_D_GBL_IFS_SIFS,
@@ -2132,7 +2155,7 @@ int ath9k_hw_reset(struct ath_hw *ah, struct ath9k_channel *chan,
 
 	ath9k_hw_init_bb(ah, chan);
 
-	if (!ath9k_hw_init_cal(ah, chan))
+	if (!ath9k_hw_init_cal(ah, hw, chan))
 		return -EIO;
 
 	rx_chainmask = ah->rxchainmask;
@@ -3710,24 +3733,28 @@ void ath9k_hw_set_tsfadjust(struct ath_hw *ah, u32 setting)
 }
 EXPORT_SYMBOL(ath9k_hw_set_tsfadjust);
 
-bool ath9k_hw_setslottime(struct ath_hw *ah, u32 us)
+bool ath9k_hw_setslottime(struct ath_hw *ah,
+			  struct ieee80211_conf *conf,
+			  u32 us)
 {
-	if (us < ATH9K_SLOT_TIME_9 || us > ath9k_hw_mac_to_usec(ah, 0xffff)) {
+	if (us < ATH9K_SLOT_TIME_9 ||
+	    us > ath9k_hw_mac_to_usec(ah, conf, 0xffff)) {
 		ath_print(ath9k_hw_common(ah), ATH_DBG_RESET,
 			  "bad slot time %u\n", us);
 		ah->slottime = (u32) -1;
 		return false;
 	} else {
-		REG_WRITE(ah, AR_D_GBL_IFS_SLOT, ath9k_hw_mac_to_clks(ah, us));
+		REG_WRITE(ah,
+			  AR_D_GBL_IFS_SLOT,
+			  ath9k_hw_mac_to_clks(ah, conf, us));
 		ah->slottime = us;
 		return true;
 	}
 }
 EXPORT_SYMBOL(ath9k_hw_setslottime);
 
-void ath9k_hw_set11nmac2040(struct ath_hw *ah)
+void ath9k_hw_set11nmac2040(struct ath_hw *ah, struct ieee80211_conf *conf)
 {
-	struct ieee80211_conf *conf = &ath9k_hw_common(ah)->hw->conf;
 	u32 macmode;
 
 	if (conf_is_ht40(conf) && !ah->config.cwm_ignore_extcca)
diff --git a/drivers/net/wireless/ath/ath9k/hw.h b/drivers/net/wireless/ath/ath9k/hw.h
index c7b0c4d..a7ae7ac 100644
--- a/drivers/net/wireless/ath/ath9k/hw.h
+++ b/drivers/net/wireless/ath/ath9k/hw.h
@@ -20,6 +20,7 @@
 #include <linux/if_ether.h>
 #include <linux/delay.h>
 #include <linux/io.h>
+#include <net/mac80211.h>
 
 #include "mac.h"
 #include "ani.h"
@@ -635,7 +636,9 @@ static inline struct ath_regulatory *ath9k_hw_regulatory(struct ath_hw *ah)
 const char *ath9k_hw_probe(u16 vendorid, u16 devid);
 void ath9k_hw_detach(struct ath_hw *ah);
 int ath9k_hw_init(struct ath_hw *ah);
-int ath9k_hw_reset(struct ath_hw *ah, struct ath9k_channel *chan,
+int ath9k_hw_reset(struct ath_hw *ah,
+		   struct ieee80211_hw *hw,
+		   struct ath9k_channel *chan,
 		   bool bChannelChange);
 void ath9k_hw_fill_cap_info(struct ath_hw *ah);
 bool ath9k_hw_getcapability(struct ath_hw *ah, enum ath9k_capability_type type,
@@ -689,8 +692,10 @@ u64 ath9k_hw_gettsf64(struct ath_hw *ah);
 void ath9k_hw_settsf64(struct ath_hw *ah, u64 tsf64);
 void ath9k_hw_reset_tsf(struct ath_hw *ah);
 void ath9k_hw_set_tsfadjust(struct ath_hw *ah, u32 setting);
-bool ath9k_hw_setslottime(struct ath_hw *ah, u32 us);
-void ath9k_hw_set11nmac2040(struct ath_hw *ah);
+bool ath9k_hw_setslottime(struct ath_hw *ah,
+			  struct ieee80211_conf *conf,
+			  u32 us);
+void ath9k_hw_set11nmac2040(struct ath_hw *ah, struct ieee80211_conf *conf);
 void ath9k_hw_beaconinit(struct ath_hw *ah, u32 next_beacon, u32 beacon_period);
 void ath9k_hw_set_sta_beacon_timers(struct ath_hw *ah,
 				    const struct ath9k_beacon_state *bs);
diff --git a/drivers/net/wireless/ath/ath9k/main.c b/drivers/net/wireless/ath/ath9k/main.c
index 9fefc51..4dec8c0 100644
--- a/drivers/net/wireless/ath/ath9k/main.c
+++ b/drivers/net/wireless/ath/ath9k/main.c
@@ -303,7 +303,7 @@ int ath_set_channel(struct ath_softc *sc, struct ieee80211_hw *hw,
 {
 	struct ath_hw *ah = sc->sc_ah;
 	struct ath_common *common = ath9k_hw_common(ah);
-	struct ieee80211_conf *conf = &common->hw->conf;
+	struct ieee80211_conf *conf = &hw->conf;
 	bool fastcc = true, stopped;
 	struct ieee80211_channel *channel = hw->conf.channel;
 	int r;
@@ -323,7 +323,7 @@ int ath_set_channel(struct ath_softc *sc, struct ieee80211_hw *hw,
 	 * the relevant bits of the h/w.
 	 */
 	ath9k_hw_set_interrupts(ah, 0);
-	ath_drain_all_txq(sc, false);
+	ath_drain_all_txq(sc, hw, false);
 	stopped = ath_stoprecv(sc);
 
 	/* XXX: do not flush receive queue here. We don't want
@@ -340,7 +340,7 @@ int ath_set_channel(struct ath_softc *sc, struct ieee80211_hw *hw,
 
 	spin_lock_bh(&sc->sc_resetlock);
 
-	r = ath9k_hw_reset(ah, hchan, fastcc);
+	r = ath9k_hw_reset(ah, hw, hchan, fastcc);
 	if (r) {
 		ath_print(common, ATH_DBG_FATAL,
 			  "Unable to reset channel (%u Mhz) "
@@ -381,6 +381,8 @@ static void ath_ani_calibrate(unsigned long data)
 	struct ath_softc *sc = (struct ath_softc *)data;
 	struct ath_hw *ah = sc->sc_ah;
 	struct ath_common *common = ath9k_hw_common(ah);
+	/* XXX: this is not right when using a virtual wiphy */
+	struct ieee80211_hw *hw = sc->hw;
 	bool longcal = false;
 	bool shortcal = false;
 	bool aniflag = false;
@@ -423,7 +425,7 @@ static void ath_ani_calibrate(unsigned long data)
 	} else {
 		if ((timestamp - sc->ani.resetcal_timer) >=
 		    ATH_RESTART_CALINTERVAL) {
-			sc->ani.caldone = ath9k_hw_reset_calvalid(ah);
+			sc->ani.caldone = ath9k_hw_reset_calvalid(ah, hw);
 			if (sc->ani.caldone)
 				sc->ani.resetcal_timer = timestamp;
 		}
@@ -439,7 +441,7 @@ static void ath_ani_calibrate(unsigned long data)
 	if (longcal || shortcal || aniflag) {
 		/* Call ANI routine if necessary */
 		if (aniflag)
-			ath9k_hw_ani_monitor(ah, ah->curchan);
+			ath9k_hw_ani_monitor(ah, hw, ah->curchan);
 
 		/* Perform calibration if necessary */
 		if (longcal || shortcal) {
@@ -663,7 +665,8 @@ irqreturn_t ath_isr(int irq, void *dev)
 		 * it will clear whatever condition caused
 		 * the interrupt.
 		 */
-		ath9k_hw_procmibevent(ah);
+		/* XXX: the sc->hw is bogus here when using virtual wiphys */
+		ath9k_hw_procmibevent(ah, sc->hw);
 		ath9k_hw_set_interrupts(ah, sc->imask);
 	}
 
@@ -1200,7 +1203,7 @@ fail:
 	ath_deinit_leds(sc);
 }
 
-void ath_radio_enable(struct ath_softc *sc)
+void ath_radio_enable(struct ath_softc *sc, struct ieee80211_hw *hw)
 {
 	struct ath_hw *ah = sc->sc_ah;
 	struct ath_common *common = ath9k_hw_common(ah);
@@ -1214,7 +1217,7 @@ void ath_radio_enable(struct ath_softc *sc)
 		ah->curchan = ath_get_curchannel(sc, sc->hw);
 
 	spin_lock_bh(&sc->sc_resetlock);
-	r = ath9k_hw_reset(ah, ah->curchan, false);
+	r = ath9k_hw_reset(ah, hw, ah->curchan, false);
 	if (r) {
 		ath_print(common, ATH_DBG_FATAL,
 			  "Unable to reset channel %u (%uMhz) ",
@@ -1245,7 +1248,7 @@ void ath_radio_enable(struct ath_softc *sc)
 	ath9k_ps_restore(sc);
 }
 
-void ath_radio_disable(struct ath_softc *sc)
+void ath_radio_disable(struct ath_softc *sc, struct ieee80211_hw *hw)
 {
 	struct ath_hw *ah = sc->sc_ah;
 	struct ieee80211_channel *channel = sc->hw->conf.channel;
@@ -1261,7 +1264,7 @@ void ath_radio_disable(struct ath_softc *sc)
 	/* Disable interrupts */
 	ath9k_hw_set_interrupts(ah, 0);
 
-	ath_drain_all_txq(sc, false);	/* clear pending tx frames */
+	ath_drain_all_txq(sc, hw, false); /* clear pending tx frames */
 	ath_stoprecv(sc);		/* turn off frame recv */
 	ath_flushrecv(sc);		/* flush recv queue */
 
@@ -1269,7 +1272,7 @@ void ath_radio_disable(struct ath_softc *sc)
 		ah->curchan = ath_get_curchannel(sc, sc->hw);
 
 	spin_lock_bh(&sc->sc_resetlock);
-	r = ath9k_hw_reset(ah, ah->curchan, false);
+	r = ath9k_hw_reset(ah, hw, ah->curchan, false);
 	if (r) {
 		ath_print(ath9k_hw_common(sc->sc_ah), ATH_DBG_FATAL,
 			  "Unable to reset channel %u (%uMhz) "
@@ -1652,7 +1655,6 @@ static int ath_init_softc(u16 devid, struct ath_softc *sc, u16 subsysid,
 	common->ops = &ath9k_common_ops;
 	common->bus_ops = bus_ops;
 	common->ah = ah;
-	common->hw = sc->hw;
 	common->priv = sc;
 	common->debug_mask = ath9k_debug;
 
@@ -1988,16 +1990,22 @@ int ath_reset(struct ath_softc *sc, bool retry_tx)
 {
 	struct ath_hw *ah = sc->sc_ah;
 	struct ath_common *common = ath9k_hw_common(ah);
+	/*
+	 * XXX: the sc->hw may not be the active one,
+	 * we may actually be on a virtual wiphy aphy->hw
+	 * but currently have no way of knowing which is the
+	 * active one.
+	 */
 	struct ieee80211_hw *hw = sc->hw;
 	int r;
 
 	ath9k_hw_set_interrupts(ah, 0);
-	ath_drain_all_txq(sc, retry_tx);
+	ath_drain_all_txq(sc, hw, retry_tx);
 	ath_stoprecv(sc);
 	ath_flushrecv(sc);
 
 	spin_lock_bh(&sc->sc_resetlock);
-	r = ath9k_hw_reset(ah, sc->sc_ah->curchan, false);
+	r = ath9k_hw_reset(ah, hw, sc->sc_ah->curchan, false);
 	if (r)
 		ath_print(common, ATH_DBG_FATAL,
 			  "Unable to reset hardware; reset status %d\n", r);
@@ -2308,7 +2316,7 @@ static int ath9k_start(struct ieee80211_hw *hw)
 	 * and then setup of the interrupt mask.
 	 */
 	spin_lock_bh(&sc->sc_resetlock);
-	r = ath9k_hw_reset(ah, init_channel, false);
+	r = ath9k_hw_reset(ah, hw, init_channel, false);
 	if (r) {
 		ath_print(common, ATH_DBG_FATAL,
 			  "Unable to reset hardware; reset status %d "
@@ -2539,7 +2547,7 @@ static void ath9k_stop(struct ieee80211_hw *hw)
 	ath9k_hw_set_interrupts(ah, 0);
 
 	if (!(sc->sc_flags & SC_OP_INVALID)) {
-		ath_drain_all_txq(sc, false);
+		ath_drain_all_txq(sc, hw, false);
 		ath_stoprecv(sc);
 		ath9k_hw_phy_disable(ah);
 	} else
@@ -2704,7 +2712,7 @@ static int ath9k_config(struct ieee80211_hw *hw, u32 changed)
 				disable_radio = true;
 		}
 		else if (all_wiphys_idle) {
-			ath_radio_enable(sc);
+			ath_radio_enable(sc, hw);
 			ath_print(common, ATH_DBG_CONFIG,
 				  "not-idle: enabling radio\n");
 		}
@@ -2781,7 +2789,7 @@ skip_chan_change:
 
 	if (disable_radio) {
 		ath_print(common, ATH_DBG_CONFIG, "idle: disabling radio\n");
-		ath_radio_disable(sc);
+		ath_radio_disable(sc, hw);
 	}
 
 	mutex_unlock(&sc->mutex);
diff --git a/drivers/net/wireless/ath/ath9k/virtual.c b/drivers/net/wireless/ath/ath9k/virtual.c
index bc7d173..2dcbfbd 100644
--- a/drivers/net/wireless/ath/ath9k/virtual.c
+++ b/drivers/net/wireless/ath/ath9k/virtual.c
@@ -508,6 +508,8 @@ int ath9k_wiphy_select(struct ath_wiphy *aphy)
 		sc->wiphy_select_failures++;
 		if (time_after(jiffies, sc->wiphy_select_first_fail + HZ / 2))
 		{
+			struct ieee80211_hw *hw = aphy->hw;
+
 			printk(KERN_DEBUG "ath9k: Previous wiphy select timed "
 			       "out; disable/enable hw to recover\n");
 			__ath9k_wiphy_mark_all_paused(sc);
@@ -521,8 +523,8 @@ int ath9k_wiphy_select(struct ath_wiphy *aphy)
 			 * frame being completed)
 			 */
 			spin_unlock_bh(&sc->wiphy_lock);
-			ath_radio_disable(sc);
-			ath_radio_enable(sc);
+			ath_radio_disable(sc, hw);
+			ath_radio_enable(sc, hw);
 			ieee80211_queue_work(aphy->sc->hw,
 				   &aphy->sc->chan_work);
 			return -EBUSY; /* previous select still in progress */
diff --git a/drivers/net/wireless/ath/ath9k/xmit.c b/drivers/net/wireless/ath/ath9k/xmit.c
index 2a4efcb..e6c6d35 100644
--- a/drivers/net/wireless/ath/ath9k/xmit.c
+++ b/drivers/net/wireless/ath/ath9k/xmit.c
@@ -1053,7 +1053,9 @@ void ath_draintxq(struct ath_softc *sc, struct ath_txq *txq, bool retry_tx)
 	}
 }
 
-void ath_drain_all_txq(struct ath_softc *sc, bool retry_tx)
+void ath_drain_all_txq(struct ath_softc *sc,
+		       struct ieee80211_hw *hw,
+		       bool retry_tx)
 {
 	struct ath_hw *ah = sc->sc_ah;
 	struct ath_common *common = ath9k_hw_common(sc->sc_ah);
@@ -1082,7 +1084,7 @@ void ath_drain_all_txq(struct ath_softc *sc, bool retry_tx)
 			  "Unable to stop TxDMA. Reset HAL!\n");
 
 		spin_lock_bh(&sc->sc_resetlock);
-		r = ath9k_hw_reset(ah, sc->sc_ah->curchan, true);
+		r = ath9k_hw_reset(ah, hw, sc->sc_ah->curchan, true);
 		if (r)
 			ath_print(common, ATH_DBG_FATAL,
 				  "Unable to reset hardware; reset status %d\n",
-- 
1.6.0.4


^ permalink raw reply related

* Re: LinuxUSB_AR2524-3.0.0.56_2009May_pathset
From: Hin-Tak Leung @ 2009-10-29  7:08 UTC (permalink / raw)
  To: daniel.schmitt; +Cc: zd1211-devs, linux-wireless
In-Reply-To: <375b18c40b54ff9adc56af39431b864e.squirrel@unimail.uni-dortmund.de>

--- On Thu, 29/10/09, Daniel Schmitt <daniel.schmitt@udo.edu> wrote:

> Hello Hin-Tak,
> 
> this URL does not work either:
> http://htl10.users.sourceforge.net/LinuxUSB_AR2524-3.0.0.56_2009May_pathset/
> 
> Can you please mail me a .tar.bz-archive of the patches you
> did for the
> ZD1211 3.00 Vendor driver?
> I want to get AP mode running and this doesn't work with
> zd1211rw driver.
> 
> Thanks,
> Daniel
> 
> 

Sorry, I moved it slightly:
http://htl10.users.sourceforge.net/patchsets/LinuxUSB_AR2524-3.0.0.56/

and withdrawn patch 04 (which I inherit from somebody), which seems to be not needed and breaks 64-bit platform; there were also two new patches which ports it forward to 2.6.30/2.6.31 since I last wrote.


      

^ permalink raw reply

* [PATCH] mac80211: introduce ieee80211_beacon_get_tim()
From: Johannes Berg @ 2009-10-29  7:30 UTC (permalink / raw)
  To: John Linville; +Cc: linux-wireless

Compared to ieee80211_beacon_get(), the new function
ieee80211_beacon_get_tim() returns information on the
location and length of the TIM IE, which some drivers
need in order to generate the TIM on the device. The
old function, ieee80211_beacon_get(), becomes a small
static inline wrapper around the new one to not break
all drivers.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
---
Will allow a cleanup of a number of drivers ... that parsing code has
irked me for a while now. But for now I'll leave it to the driver
maintainers to use this new function :)

 include/net/mac80211.h |   42 ++++++++++++++++++++++++++++++++++--------
 net/mac80211/tx.c      |   17 ++++++++++++++---
 2 files changed, 48 insertions(+), 11 deletions(-)

--- wireless-testing.orig/include/net/mac80211.h	2009-10-29 08:26:31.000000000 +0100
+++ wireless-testing/include/net/mac80211.h	2009-10-29 08:27:27.000000000 +0100
@@ -1743,19 +1743,45 @@ void ieee80211_tx_status_irqsafe(struct 
 				 struct sk_buff *skb);
 
 /**
- * ieee80211_beacon_get - beacon generation function
+ * ieee80211_beacon_get_tim - beacon generation function
  * @hw: pointer obtained from ieee80211_alloc_hw().
  * @vif: &struct ieee80211_vif pointer from &struct ieee80211_if_init_conf.
+ * @tim_offset: pointer to variable that will receive the TIM IE offset.
+ *	Set to 0 if invalid (in non-AP modes).
+ * @tim_length: pointer to variable that will receive the TIM IE length,
+ *	(including the ID and length bytes!).
+ *	Set to 0 if invalid (in non-AP modes).
+ *
+ * If the driver implements beaconing modes, it must use this function to
+ * obtain the beacon frame/template.
  *
  * If the beacon frames are generated by the host system (i.e., not in
- * hardware/firmware), the low-level driver uses this function to receive
- * the next beacon frame from the 802.11 code. The low-level is responsible
- * for calling this function before beacon data is needed (e.g., based on
- * hardware interrupt). Returned skb is used only once and low-level driver
- * is responsible for freeing it.
+ * hardware/firmware), the driver uses this function to get each beacon
+ * frame from mac80211 -- it is responsible for calling this function
+ * before the beacon is needed (e.g. based on hardware interrupt).
+ *
+ * If the beacon frames are generated by the device, then the driver
+ * must use the returned beacon as the template and change the TIM IE
+ * according to the current DTIM parameters/TIM bitmap.
+ *
+ * The driver is responsible for freeing the returned skb.
+ */
+struct sk_buff *ieee80211_beacon_get_tim(struct ieee80211_hw *hw,
+					 struct ieee80211_vif *vif,
+					 u16 *tim_offset, u16 *tim_length);
+
+/**
+ * ieee80211_beacon_get - beacon generation function
+ * @hw: pointer obtained from ieee80211_alloc_hw().
+ * @vif: &struct ieee80211_vif pointer from &struct ieee80211_if_init_conf.
+ *
+ * See ieee80211_beacon_get_tim().
  */
-struct sk_buff *ieee80211_beacon_get(struct ieee80211_hw *hw,
-				     struct ieee80211_vif *vif);
+static inline struct sk_buff *ieee80211_beacon_get(struct ieee80211_hw *hw,
+						   struct ieee80211_vif *vif)
+{
+	return ieee80211_beacon_get_tim(hw, vif, NULL, NULL);
+}
 
 /**
  * ieee80211_rts_get - RTS frame generation function
--- wireless-testing.orig/net/mac80211/tx.c	2009-10-29 08:26:31.000000000 +0100
+++ wireless-testing/net/mac80211/tx.c	2009-10-29 08:27:27.000000000 +0100
@@ -2012,8 +2012,9 @@ static void ieee80211_beacon_add_tim(str
 	}
 }
 
-struct sk_buff *ieee80211_beacon_get(struct ieee80211_hw *hw,
-				     struct ieee80211_vif *vif)
+struct sk_buff *ieee80211_beacon_get_tim(struct ieee80211_hw *hw,
+					 struct ieee80211_vif *vif,
+					 u16 *tim_offset, u16 *tim_length)
 {
 	struct ieee80211_local *local = hw_to_local(hw);
 	struct sk_buff *skb = NULL;
@@ -2030,6 +2031,11 @@ struct sk_buff *ieee80211_beacon_get(str
 
 	sdata = vif_to_sdata(vif);
 
+	if (tim_offset)
+		*tim_offset = 0;
+	if (tim_length)
+		*tim_length = 0;
+
 	if (sdata->vif.type == NL80211_IFTYPE_AP) {
 		ap = &sdata->u.ap;
 		beacon = rcu_dereference(ap->beacon);
@@ -2065,6 +2071,11 @@ struct sk_buff *ieee80211_beacon_get(str
 				spin_unlock_irqrestore(&local->sta_lock, flags);
 			}
 
+			if (tim_offset)
+				*tim_offset = beacon->head_len;
+			if (tim_length)
+				*tim_length = skb->len - beacon->head_len;
+
 			if (beacon->tail)
 				memcpy(skb_put(skb, beacon->tail_len),
 				       beacon->tail, beacon->tail_len);
@@ -2141,7 +2152,7 @@ struct sk_buff *ieee80211_beacon_get(str
 	rcu_read_unlock();
 	return skb;
 }
-EXPORT_SYMBOL(ieee80211_beacon_get);
+EXPORT_SYMBOL(ieee80211_beacon_get_tim);
 
 void ieee80211_rts_get(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
 		       const void *frame, size_t frame_len,



^ permalink raw reply

* [PATCH 2.6.32] mac80211: fix addba timer
From: Johannes Berg @ 2009-10-29  7:34 UTC (permalink / raw)
  To: John Linville; +Cc: linux-wireless

The addba timer function acquires the sta spinlock,
but at the same time we try to del_timer_sync() it
under the spinlock which can produce deadlocks.

To fix this, always del_timer_sync() the timer in
ieee80211_process_addba_resp() and add it again
after checking the conditions, if necessary.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
---
Looks like I forgot to send this when I made it and then hid it in the
middle of my patch pile and forgot!

 net/mac80211/agg-tx.c |   19 ++++++++++++-------
 1 file changed, 12 insertions(+), 7 deletions(-)

--- wireless-testing.orig/net/mac80211/agg-tx.c	2009-10-27 09:06:13.000000000 +0100
+++ wireless-testing/net/mac80211/agg-tx.c	2009-10-29 08:32:15.000000000 +0100
@@ -666,26 +666,25 @@ void ieee80211_process_addba_resp(struct
 
 	state = &sta->ampdu_mlme.tid_state_tx[tid];
 
+	del_timer_sync(&sta->ampdu_mlme.tid_tx[tid]->addba_resp_timer);
+
 	spin_lock_bh(&sta->lock);
 
-	if (!(*state & HT_ADDBA_REQUESTED_MSK)) {
-		spin_unlock_bh(&sta->lock);
-		return;
-	}
+	if (!(*state & HT_ADDBA_REQUESTED_MSK))
+		goto timer_still_needed;
 
 	if (mgmt->u.action.u.addba_resp.dialog_token !=
 		sta->ampdu_mlme.tid_tx[tid]->dialog_token) {
-		spin_unlock_bh(&sta->lock);
 #ifdef CONFIG_MAC80211_HT_DEBUG
 		printk(KERN_DEBUG "wrong addBA response token, tid %d\n", tid);
 #endif /* CONFIG_MAC80211_HT_DEBUG */
-		return;
+		goto timer_still_needed;
 	}
 
-	del_timer_sync(&sta->ampdu_mlme.tid_tx[tid]->addba_resp_timer);
 #ifdef CONFIG_MAC80211_HT_DEBUG
 	printk(KERN_DEBUG "switched off addBA timer for tid %d \n", tid);
 #endif /* CONFIG_MAC80211_HT_DEBUG */
+
 	if (le16_to_cpu(mgmt->u.action.u.addba_resp.status)
 			== WLAN_STATUS_SUCCESS) {
 		u8 curstate = *state;
@@ -699,5 +698,11 @@ void ieee80211_process_addba_resp(struct
 	} else {
 		___ieee80211_stop_tx_ba_session(sta, tid, WLAN_BACK_INITIATOR);
 	}
+
+	goto out;
+
+ timer_still_needed:
+	add_timer(&sta->ampdu_mlme.tid_tx[tid]->addba_resp_timer);
+ out:
 	spin_unlock_bh(&sta->lock);
 }



^ permalink raw reply

* [PATCH] mac80211: deprecate qual value
From: Johannes Berg @ 2009-10-29  7:41 UTC (permalink / raw)
  To: John Linville; +Cc: linux-wireless

This value is unused by mac80211, because it was only
be used by wireless extensions, and turned out to not
be useful there because the quality value needs to be
comparable between scan results and the current value
which is impossible when the qual value is calculated
taking into account noise, for example.

Since it is unused anyway, this patch deprecates it
in the hope that drivers will remove their sometimes
quite expensive calculations of the value.

I'm open to actual uses of the value, but the best
way of using it seems to be what the Intel drivers do
which should probably be generalised if we have noise
values from the hardware.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
---
 include/net/mac80211.h     |    2 +-
 net/mac80211/debugfs_sta.c |    2 --
 net/mac80211/rx.c          |    1 -
 net/mac80211/sta_info.h    |    2 --
 4 files changed, 1 insertion(+), 6 deletions(-)

--- wireless-testing.orig/include/net/mac80211.h	2009-10-29 08:35:37.000000000 +0100
+++ wireless-testing/include/net/mac80211.h	2009-10-29 08:40:25.000000000 +0100
@@ -552,7 +552,7 @@ struct ieee80211_rx_status {
 	int freq;
 	int signal;
 	int noise;
-	int qual;
+	int __deprecated qual;
 	int antenna;
 	int rate_idx;
 	int flag;
--- wireless-testing.orig/net/mac80211/debugfs_sta.c	2009-10-29 08:32:19.000000000 +0100
+++ wireless-testing/net/mac80211/debugfs_sta.c	2009-10-29 08:40:25.000000000 +0100
@@ -57,7 +57,6 @@ STA_FILE(tx_filtered, tx_filtered_count,
 STA_FILE(tx_retry_failed, tx_retry_failed, LU);
 STA_FILE(tx_retry_count, tx_retry_count, LU);
 STA_FILE(last_signal, last_signal, D);
-STA_FILE(last_qual, last_qual, D);
 STA_FILE(last_noise, last_noise, D);
 STA_FILE(wep_weak_iv_count, wep_weak_iv_count, LU);
 
@@ -233,7 +232,6 @@ void ieee80211_sta_debugfs_add(struct st
 	DEBUGFS_ADD(tx_retry_failed);
 	DEBUGFS_ADD(tx_retry_count);
 	DEBUGFS_ADD(last_signal);
-	DEBUGFS_ADD(last_qual);
 	DEBUGFS_ADD(last_noise);
 	DEBUGFS_ADD(wep_weak_iv_count);
 	DEBUGFS_ADD(ht_capa);
--- wireless-testing.orig/net/mac80211/rx.c	2009-10-28 22:22:48.000000000 +0100
+++ wireless-testing/net/mac80211/rx.c	2009-10-29 08:40:25.000000000 +0100
@@ -859,7 +859,6 @@ ieee80211_rx_h_sta_process(struct ieee80
 	sta->rx_fragments++;
 	sta->rx_bytes += rx->skb->len;
 	sta->last_signal = rx->status->signal;
-	sta->last_qual = rx->status->qual;
 	sta->last_noise = rx->status->noise;
 
 	/*
--- wireless-testing.orig/net/mac80211/sta_info.h	2009-10-28 22:22:48.000000000 +0100
+++ wireless-testing/net/mac80211/sta_info.h	2009-10-29 08:40:25.000000000 +0100
@@ -193,7 +193,6 @@ struct sta_ampdu_mlme {
  * @rx_fragments: number of received MPDUs
  * @rx_dropped: number of dropped MPDUs from this STA
  * @last_signal: signal of last received frame from this STA
- * @last_qual: qual of last received frame from this STA
  * @last_noise: noise of last received frame from this STA
  * @last_seq_ctrl: last received seq/frag number from this STA (per RX queue)
  * @tx_filtered_count: number of frames the hardware filtered for this STA
@@ -259,7 +258,6 @@ struct sta_info {
 	unsigned long rx_fragments;
 	unsigned long rx_dropped;
 	int last_signal;
-	int last_qual;
 	int last_noise;
 	__le16 last_seq_ctrl[NUM_RX_DATA_QUEUES];
 



^ permalink raw reply

* [PATCH] mac80211: make CALL_TXH a statement
From: Johannes Berg @ 2009-10-29  7:43 UTC (permalink / raw)
  To: John Linville; +Cc: linux-wireless

The multi-line code in this macro wasn't wrapped
in do {} while (0) so we cannot use it in an if()
branch safely in the future -- fix that.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
---
 net/mac80211/tx.c |   34 ++++++++++++++++++----------------
 1 file changed, 18 insertions(+), 16 deletions(-)

--- wireless-testing.orig/net/mac80211/tx.c	2009-10-06 14:57:11.000000000 +0200
+++ wireless-testing/net/mac80211/tx.c	2009-10-06 14:57:39.000000000 +0200
@@ -1201,23 +1201,25 @@ static int invoke_tx_handlers(struct iee
 	struct sk_buff *skb = tx->skb;
 	ieee80211_tx_result res = TX_DROP;
 
-#define CALL_TXH(txh)		\
-	res = txh(tx);		\
-	if (res != TX_CONTINUE)	\
-		goto txh_done;
-
-	CALL_TXH(ieee80211_tx_h_check_assoc)
-	CALL_TXH(ieee80211_tx_h_ps_buf)
-	CALL_TXH(ieee80211_tx_h_select_key)
-	CALL_TXH(ieee80211_tx_h_michael_mic_add)
-	CALL_TXH(ieee80211_tx_h_rate_ctrl)
-	CALL_TXH(ieee80211_tx_h_misc)
-	CALL_TXH(ieee80211_tx_h_sequence)
-	CALL_TXH(ieee80211_tx_h_fragment)
+#define CALL_TXH(txh) \
+	do {				\
+		res = txh(tx);		\
+		if (res != TX_CONTINUE)	\
+			goto txh_done;	\
+	} while (0)
+
+	CALL_TXH(ieee80211_tx_h_check_assoc);
+	CALL_TXH(ieee80211_tx_h_ps_buf);
+	CALL_TXH(ieee80211_tx_h_select_key);
+	CALL_TXH(ieee80211_tx_h_michael_mic_add);
+	CALL_TXH(ieee80211_tx_h_rate_ctrl);
+	CALL_TXH(ieee80211_tx_h_misc);
+	CALL_TXH(ieee80211_tx_h_sequence);
+	CALL_TXH(ieee80211_tx_h_fragment);
 	/* handlers after fragment must be aware of tx info fragmentation! */
-	CALL_TXH(ieee80211_tx_h_stats)
-	CALL_TXH(ieee80211_tx_h_encrypt)
-	CALL_TXH(ieee80211_tx_h_calculate_duration)
+	CALL_TXH(ieee80211_tx_h_stats);
+	CALL_TXH(ieee80211_tx_h_encrypt);
+	CALL_TXH(ieee80211_tx_h_calculate_duration);
 #undef CALL_TXH
 
  txh_done:



^ permalink raw reply

* Re: pull request: wireless-2.6 2009-10-28
From: David Miller @ 2009-10-29  8:07 UTC (permalink / raw)
  To: linville; +Cc: linux-wireless, netdev, linux-kernel
In-Reply-To: <20091028205346.GE2856@tuxdriver.com>

From: "John W. Linville" <linville@tuxdriver.com>
Date: Wed, 28 Oct 2009 16:53:46 -0400

> Here is a collection of fixes (mostly (almost-)one-liners) intended
> for 2.6.32.  There are a couple of fixes relating to behavior when an
> association failes, as well as spelling fixes, simply endian fixes,
> a MAINTAINERS change...I don't think there is anything controversial
> here...
> 
> Please let me know if there are problems!

Pulled, thanks a lot John.

^ permalink raw reply

* [PATCH] mac80211: fix reason code output endianness
From: Johannes Berg @ 2009-10-29  9:09 UTC (permalink / raw)
  To: John Linville; +Cc: linux-wireless

When HT debugging is enabled and we receive a DelBA
frame we print out the reason code in the wrong byte
order. Fix that so we don't get weird values printed.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
---
 net/mac80211/ht.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- wireless-testing.orig/net/mac80211/ht.c	2009-10-29 10:07:41.000000000 +0100
+++ wireless-testing/net/mac80211/ht.c	2009-10-29 10:07:49.000000000 +0100
@@ -153,7 +153,7 @@ void ieee80211_process_delba(struct ieee
 	if (net_ratelimit())
 		printk(KERN_DEBUG "delba from %pM (%s) tid %d reason code %d\n",
 			mgmt->sa, initiator ? "initiator" : "recipient", tid,
-			mgmt->u.action.u.delba.reason_code);
+			le16_to_cpu(mgmt->u.action.u.delba.reason_code));
 #endif /* CONFIG_MAC80211_HT_DEBUG */
 
 	if (initiator == WLAN_BACK_INITIATOR)



^ permalink raw reply


This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox