Linux wireless drivers development
 help / color / mirror / Atom feed
* A file to print the release of loaded compat-wireless stuff
From: Luis R. Rodriguez @ 2010-05-04 20:44 UTC (permalink / raw)
  To: linux-wireless

It seems there is a reasonable need to find out what version of
compat-wireless you have running. This will be a dated thing when
based on linux-next but more importantly it will contain the 2.6.3x.y
release the release was based on for the stable releases. Any ideas of
what filesystem API to use for this, I was thinking maybe a simple
sysfs entry for the compat module. Thoughts, preferences?

  Luis

^ permalink raw reply

* Re: A file to print the release of loaded compat-wireless stuff
From: Pavel Roskin @ 2010-05-04 21:11 UTC (permalink / raw)
  To: Luis R. Rodriguez; +Cc: linux-wireless
In-Reply-To: <x2q43e72e891005041344gb9945d73p3d97e648fd13aa85@mail.gmail.com>

On Tue, 2010-05-04 at 13:44 -0700, Luis R. Rodriguez wrote:
> It seems there is a reasonable need to find out what version of
> compat-wireless you have running. This will be a dated thing when
> based on linux-next but more importantly it will contain the 2.6.3x.y
> release the release was based on for the stable releases. Any ideas of
> what filesystem API to use for this, I was thinking maybe a simple
> sysfs entry for the compat module. Thoughts, preferences?

We could use a read-only parameter of the compat module.  Then the
version would be in /sys/module/compat/parameters/version

Module parameters are visible in sysfs even if the code is compiled into
the kernel.

-- 
Regards,
Pavel Roskin

^ permalink raw reply

* 2.6.34-rc6-git2: Reported regressions from 2.6.33
From: Rafael J. Wysocki @ 2010-05-04 20:49 UTC (permalink / raw)
  To: Linux Kernel Mailing List
  Cc: Maciej Rutecki, Andrew Morton, Linus Torvalds,
	Kernel Testers List, Network Development, Linux ACPI,
	Linux PM List, Linux SCSI List, Linux Wireless List, DRI

This message contains a list of some regressions from 2.6.33,
for which there are no fixes in the mainline known to the tracking team.
If any of them have been fixed already, please let us know.

If you know of any other unresolved regressions from 2.6.33, please let us
know either and we'll add them to the list.  Also, please let us know
if any of the entries below are invalid.

Each entry from the list will be sent additionally in an automatic reply
to this message with CCs to the people involved in reporting and handling
the issue.


Listed regressions statistics:

  Date          Total  Pending  Unresolved
  ----------------------------------------
  2010-05-04       76       26          22
  2010-04-20       64       35          34
  2010-04-07       48       35          33
  2010-03-21       15       13          10


Unresolved regressions
----------------------

Bug-Entry	: http://bugzilla.kernel.org/show_bug.cgi?id=15880
Subject		: Very bad regression from 2.6.33 as of 1600f9def
Submitter	: Alex Elsayed <eternaleye@gmail.com>
Date		: 2010-04-29 2:28 (6 days old)
Message-ID	: <loom.20100429T041908-663@post.gmane.org>
References	: http://marc.info/?l=linux-kernel&m=127250825306178&w=2


Bug-Entry	: http://bugzilla.kernel.org/show_bug.cgi?id=15863
Subject		: 2.6.34-rc5-git7 (plus all patches) -- another suspicious rcu_dereference_check() usage.
Submitter	: Miles Lane <miles.lane@gmail.com>
Date		: 2010-04-27 0:51 (8 days old)
Message-ID	: <h2ya44ae5cd1004261751waa5cb65ei3d139cbcfa2cc5cf@mail.gmail.com>
References	: http://marc.info/?l=linux-kernel&m=127232949104878&w=2


Bug-Entry	: http://bugzilla.kernel.org/show_bug.cgi?id=15862
Subject		: 2.6.34-rc4/5: iwlagn unusable until reload
Submitter	: Nico Schottelius <nico-linux-20100427@schottelius.org>
Date		: 2010-04-27 7:49 (8 days old)
Message-ID	: <20100427074934.GB3261@ikn.schottelius.org>
References	: http://marc.info/?l=linux-kernel&m=127235784004839&w=2


Bug-Entry	: http://bugzilla.kernel.org/show_bug.cgi?id=15858
Subject		: [2.6.34-rc5] bad page state copying to/from HFS+ filesystem...
Submitter	: Daniel J Blueman <daniel.blueman@gmail.com>
Date		: 2010-04-25 21:14 (10 days old)
Message-ID	: <v2k6278d2221004251414kbbcc41baw78b86120d81dce7d@mail.gmail.com>
References	: http://marc.info/?l=linux-kernel&m=127223008621881&w=2


Bug-Entry	: http://bugzilla.kernel.org/show_bug.cgi?id=15805
Subject		: reiserfs locking
Submitter	: Alexander Beregalov <a.beregalov@gmail.com>
Date		: 2010-04-15 21:02 (20 days old)
Message-ID	: <t2ka4423d671004151402n7b2dc425mdc9c6bb9640d63fb@mail.gmail.com>
References	: http://marc.info/?l=linux-kernel&m=127136535323933&w=2


Bug-Entry	: http://bugzilla.kernel.org/show_bug.cgi?id=15790
Subject		: Meta-Bug: Regressions
Submitter	: Florian Mickler <fmickler@gmx.de>
Date		: 2010-04-15 18:21 (20 days old)


Bug-Entry	: http://bugzilla.kernel.org/show_bug.cgi?id=15788
Subject		: external usb sound card doesn't work after resume
Submitter	: François Valenduc <francois.valenduc@tvcablenet.be>
Date		: 2010-04-15 10:16 (20 days old)


Bug-Entry	: http://bugzilla.kernel.org/show_bug.cgi?id=15717
Subject		: bluetooth oops
Submitter	: Pavel Machek <pavel@ucw.cz>
Date		: 2010-03-14 20:14 (52 days old)
Message-ID	: <20100314201434.GE22059@elf.ucw.cz>
References	: http://marc.info/?l=linux-kernel&m=126859771528426&w=4
Handled-By	: Marcel Holtmann <marcel@holtmann.org>


Bug-Entry	: http://bugzilla.kernel.org/show_bug.cgi?id=15713
Subject		: hackbench regression due to commit 9dfc6e68bfe6e
Submitter	: Alex Shi <alex.shi@intel.com>
Date		: 2010-03-25 8:40 (41 days old)
First-Bad-Commit: http://git.kernel.org/linus/9dfc6e68bfe6ee452efb1a4e9ca26a9007f2b864
Message-ID	: <1269506457.4513.141.camel@alexs-hp.sh.intel.com>
References	: http://marc.info/?l=linux-kernel&m=126950632920682&w=4
Handled-By	: Christoph Lameter <cl@linux-foundation.org>
		  Pekka Enberg <penberg@cs.helsinki.fi>


Bug-Entry	: http://bugzilla.kernel.org/show_bug.cgi?id=15712
Subject		: [regression] 2.6.34-rc1 to -rc3 on zaurus: no longer boots
Submitter	: Pavel Machek <pavel@ucw.cz>
Date		: 2010-04-01 6:06 (34 days old)
Message-ID	: <20100401060624.GA1329@ucw.cz>
References	: http://marc.info/?l=linux-kernel&m=127010200817402&w=2


Bug-Entry	: http://bugzilla.kernel.org/show_bug.cgi?id=15704
Subject		: [r8169] WARNING: at net/sched/sch_generic.c
Submitter	: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
Date		: 2010-03-31 10:21 (35 days old)
Message-ID	: <<20100331102142.GA3294@swordfish.minsk.epam.com>>
References	: http://marc.info/?l=linux-kernel&m=127003090406108&w=2


Bug-Entry	: http://bugzilla.kernel.org/show_bug.cgi?id=15673
Subject		: 2.6.34-rc2: "ima_dec_counts: open/free imbalance"?
Submitter	: Thomas Meyer <thomas@m3y3r.de>
Date		: 2010-03-28 11:31 (38 days old)
Message-ID	: <1269775909.5301.4.camel@localhost.localdomain>
References	: http://marc.info/?l=linux-kernel&m=126977593326800&w=2


Bug-Entry	: http://bugzilla.kernel.org/show_bug.cgi?id=15671
Subject		: intel graphic card hanging (Hangcheck timer elapsed... GPU hung)
Submitter	: Norbert Preining <preining@logic.at>
Date		: 2010-03-27 16:11 (39 days old)
Message-ID	: <20100327161104.GA12043@gamma.logic.tuwien.ac.at>
References	: http://marc.info/?l=linux-kernel&m=126970883105262&w=2


Bug-Entry	: http://bugzilla.kernel.org/show_bug.cgi?id=15669
Subject		: INFO: suspicious rcu_dereference_check()
Submitter	: Zdenek Kabelac <zdenek.kabelac@gmail.com>
Date		: 2010-03-08 1:26 (58 days old)
Message-ID	: <c4e36d111003250348q678eb2e6w4f3e8133e7fd6e58@mail.gmail.com>
References	: http://marc.info/?l=linux-kernel&m=126801163107713&w=2


Bug-Entry	: http://bugzilla.kernel.org/show_bug.cgi?id=15664
Subject		: Graphics hang and kernel backtrace when starting Azureus with Compiz enabled
Submitter	: Alex Villacis Lasso <avillaci@ceibo.fiec.espol.edu.ec>
Date		: 2010-04-01 01:09 (34 days old)


Bug-Entry	: http://bugzilla.kernel.org/show_bug.cgi?id=15659
Subject		: [Regresion] [2.6.34-rc1] [drm:i915_hangcheck_elapsed] *ERROR* Hangcheck timer elapsed... GPU hung
Submitter	: Maciej Rutecki <maciej.rutecki@gmail.com>
Date		: 2010-03-25 20:04 (41 days old)
Message-ID	: <<201003252104.24965.maciej.rutecki@gmail.com>>
References	: http://marc.info/?l=linux-kernel&m=126954749618319&w=2


Bug-Entry	: http://bugzilla.kernel.org/show_bug.cgi?id=15625
Subject		: BUG: 2.6.34-rc1, RIP is (null)
Submitter	: Randy Dunlap <randy.dunlap@oracle.com>
Date		: 2010-03-18 22:22 (48 days old)
Message-ID	: <4BA2A7A9.4080503@oracle.com>
References	: http://marc.info/?l=linux-kernel&m=126895098217351&w=2


Bug-Entry	: http://bugzilla.kernel.org/show_bug.cgi?id=15611
Subject		: Failure with the 2.6.34-rc1 kernel
Submitter	: Rupjyoti Sarmah <rsarmah@amcc.com>
Date		: 2010-03-16 15:45 (50 days old)
Message-ID	: <AC311A8E81420D4EBC1F26E6479848FE065B7D3D@SDCEXCHANGE01.ad.amcc.com>
References	: http://marc.info/?l=linux-kernel&m=126875435718396&w=2


Bug-Entry	: http://bugzilla.kernel.org/show_bug.cgi?id=15610
Subject		: fsck leads to swapper - BUG: unable to handle kernel NULL pointer dereference & panic
Submitter	: Ozgur Yuksel <ozgur.yuksel@oracle.com>
Date		: 2010-03-22 15:59 (44 days old)


Bug-Entry	: http://bugzilla.kernel.org/show_bug.cgi?id=15601
Subject		: [BUG] SLOB breaks Crypto
Submitter	: michael-dev@fami-braun.de
Date		: 2010-03-15 13:39 (51 days old)
Message-ID	: <4B9E38AF.70309@fami-braun.de>
References	: http://marc.info/?l=linux-kernel&m=126866044724539&w=2


Bug-Entry	: http://bugzilla.kernel.org/show_bug.cgi?id=15590
Subject		: 2.6.34-rc1: regression: ^Z no longer stops sound
Submitter	: Pavel Machek <pavel@ucw.cz>
Date		: 2010-03-14 7:58 (52 days old)
Message-ID	: <20100314075831.GA13457@elf.ucw.cz>
References	: http://marc.info/?l=linux-kernel&m=126855353122623&w=2


Bug-Entry	: http://bugzilla.kernel.org/show_bug.cgi?id=15589
Subject		: 2.6.34-rc1: Badness at fs/proc/generic.c:316
Submitter	: Christian Kujau <lists@nerdbynature.de>
Date		: 2010-03-13 23:53 (53 days old)
Message-ID	: <alpine.DEB.2.01.1003131544340.5493@bogon.housecafe.de>
References	: http://marc.info/?l=linux-kernel&m=126852442903680&w=2


Regressions with patches
------------------------

Bug-Entry	: http://bugzilla.kernel.org/show_bug.cgi?id=15893
Subject		: Alps: No edge-scrolling since 2.6.34-rc5
Submitter	: Felix Zweig <f.zweig@yahoo.de>
Date		: 2010-05-01 16:23 (4 days old)
Handled-By	:  Dan Carpenter <error27@gmail.com>
Patch		: https://bugzilla.kernel.org/attachment.cgi?id=26218


Bug-Entry	: http://bugzilla.kernel.org/show_bug.cgi?id=15768
Subject		: Incorrectly calculated free blocks result in ENOSPC from writepage
Submitter	: Dmitry Monakhov <dmonakhov@openvz.org>
Date		: 2010-04-12 11:24 (23 days old)
Handled-By	: Dmitry Monakhov <dmonakhov@openvz.org>
Patch		: http://patchwork.ozlabs.org/patch/49989/


Bug-Entry	: http://bugzilla.kernel.org/show_bug.cgi?id=15729
Subject		: BUG: physmap modprobe & rmmod
Submitter	: Randy Dunlap <randy.dunlap@oracle.com>
Date		: 2010-04-02 20:40 (33 days old)
Message-ID	: <20100402134058.c4682716.randy.dunlap@oracle.com>
References	: http://marc.info/?l=linux-kernel&m=127024096210230&w=2
Handled-By	: Hartley Sweeten <hsweeten@visionengravers.com>
Patch		: https://patchwork.kernel.org/patch/90497/


Bug-Entry	: http://bugzilla.kernel.org/show_bug.cgi?id=15505
Subject		: No more b43 wireless interface since 2.6.34-rc1
Submitter	: Christian Casteyde <casteyde.christian@free.fr>
Date		: 2010-03-10 06:59 (56 days old)
Handled-By	: Yinghai Lu <yinghai@kernel.org>
Patch		: https://bugzilla.kernel.org/show_bug.cgi?id=15505#c11


For details, please visit the bug entries and follow the links given in
references.

As you can see, there is a Bugzilla entry for each of the listed regressions.
There also is a Bugzilla entry used for tracking the regressions from 2.6.33,
unresolved as well as resolved, at:

http://bugzilla.kernel.org/show_bug.cgi?id=15310

Please let the tracking team know if there are any Bugzilla entries that
should be added to the list in there.

Thanks!


^ permalink raw reply

* Re: [PATCH] rtl8187: use SET_IEEE80211_PERM_ADDR
From: Hin-Tak Leung @ 2010-05-04 21:33 UTC (permalink / raw)
  To: linux-wireless, John W. Linville; +Cc: herton, Larry.Finger, John W. Linville
In-Reply-To: <1273002809-8595-1-git-send-email-linville@tuxdriver.com>

--- On Tue, 4/5/10, John W. Linville <linville@tuxdriver.com> wrote:

> Signed-off-by: John W. Linville
> <linville@tuxdriver.com>

Acked-by: Hin-Tak Leung <htl10@users.sourceforge.net>

Look likes a good direction of change to hide the wiphy details.

Hin-Tak


      

^ permalink raw reply

* Re: A file to print the release of loaded compat-wireless stuff
From: Luis R. Rodriguez @ 2010-05-04 21:51 UTC (permalink / raw)
  To: Pavel Roskin; +Cc: linux-wireless
In-Reply-To: <1273007509.12618.1.camel@mj>

On Tue, May 4, 2010 at 2:11 PM, Pavel Roskin <proski@gnu.org> wrote:
> On Tue, 2010-05-04 at 13:44 -0700, Luis R. Rodriguez wrote:
>> It seems there is a reasonable need to find out what version of
>> compat-wireless you have running. This will be a dated thing when
>> based on linux-next but more importantly it will contain the 2.6.3x.y
>> release the release was based on for the stable releases. Any ideas of
>> what filesystem API to use for this, I was thinking maybe a simple
>> sysfs entry for the compat module. Thoughts, preferences?
>
> We could use a read-only parameter of the compat module.  Then the
> version would be in /sys/module/compat/parameters/version
>
> Module parameters are visible in sysfs even if the code is compiled into
> the kernel.

Neat trick thanks for the tip, will give that a shot.

  Luis

^ permalink raw reply

* orinoco_usb: support wpa
From: David Kilroy @ 2010-05-04 21:54 UTC (permalink / raw)
  To: linux-wireless; +Cc: orinoco-devel, linville, David Kilroy

The following patches enable WPA for the orinoco_usb cards. The first
patch contains all the code required to use WPA. The second patch
neatens things up but doesn't work so well, since it relies on having
spare tailroom in the SKB to store the MIC.

In order to use WPA with these cards, the following is required:
 * Agere firmware 9.42 or better (as with other orinoco cards)
 * compatible bridge firmware

The bridge firmware currently extracted by the orinoco-fwutils scripts
is not compatible with WPA. Instead you'll need to find the v7.82
Agere driver containing the WPA-enabled USB driver (containing the
appropriate bridge firmware and Agere fw 9.42). I'm not sure if there
is still a reliable source on the net. Further details about
extracting the firmware below.

John: 1st patch should be OK for w-t if there are no objections. I'm
expecting to redo or drop the second, depending on feedback.



Regards,

Dave.

The bridge firmware is in WLAGS51.SYS. The firmware will be 6976 bytes
long, starting with the bytes 0x02 0x10 at an offset around 0x028480.
I used the following command to extract it (you may need to modify
this if you get something different from what I have):

dd if=WLAGS51.SYS of=orinoco_ezusb_fw skip=10312 count=436 bs=16

---
David Kilroy (2):
  orinoco: refactor xmit path
  orinoco: use SKB tail for MIC

 drivers/net/wireless/orinoco/main.c        |  175 ++++++++++++++++------------
 drivers/net/wireless/orinoco/orinoco.h     |    5 +
 drivers/net/wireless/orinoco/orinoco_usb.c |   77 +++++--------
 3 files changed, 135 insertions(+), 122 deletions(-)


^ permalink raw reply

* [PATCH] orinoco: refactor xmit path
From: David Kilroy @ 2010-05-04 21:54 UTC (permalink / raw)
  To: linux-wireless; +Cc: orinoco-devel, linville, David Kilroy
In-Reply-To: <1273010082-15871-1-git-send-email-kilroyd@googlemail.com>

... so orinoco_usb can share some common functionality.

Handle 802.2 encapsulation and MIC calculation in that function.
The 802.3 header is prepended to the SKB. The calculated MIC is written
to a specified buffer. Also modify the transmit control word that will
be passed onto the hardware to specify whether the MIC is present, and
the key used.

Signed-off-by: David Kilroy <kilroyd@googlemail.com>
---
 drivers/net/wireless/orinoco/main.c        |  169 +++++++++++++++++----------
 drivers/net/wireless/orinoco/orinoco.h     |    6 +
 drivers/net/wireless/orinoco/orinoco_usb.c |   91 +++++++--------
 3 files changed, 155 insertions(+), 111 deletions(-)

diff --git a/drivers/net/wireless/orinoco/main.c b/drivers/net/wireless/orinoco/main.c
index 1d60c7e..3b9a5fb 100644
--- a/drivers/net/wireless/orinoco/main.c
+++ b/drivers/net/wireless/orinoco/main.c
@@ -340,18 +340,109 @@ EXPORT_SYMBOL(orinoco_change_mtu);
 /* Tx path                                                          */
 /********************************************************************/
 
+/* Add encapsulation and MIC to the existing SKB.
+ * The main xmit routine will then send the whole lot to the card.
+ * Need 8 bytes headroom
+ * Need 8 bytes tailroom
+ *
+ *                          With encapsulated ethernet II frame
+ *                          --------
+ *                          803.3 header (14 bytes)
+ *                           dst[6]
+ * --------                  src[6]
+ * 803.3 header (14 bytes)   len[2]
+ *  dst[6]                  803.2 header (8 bytes)
+ *  src[6]                   encaps[6]
+ *  len[2] <- leave alone -> len[2]
+ * --------                 -------- <-- 0
+ * Payload                  Payload
+ * ...                      ...
+ *
+ * --------                 --------
+ *                          MIC (8 bytes)
+ *                          --------
+ *
+ * returns 0 on success, -ENOMEM on error.
+ */
+int orinoco_process_xmit_skb(struct sk_buff *skb,
+			     struct net_device *dev,
+			     struct orinoco_private *priv,
+			     int *tx_control,
+			     u8 *mic_buf)
+{
+	struct orinoco_tkip_key *key;
+	struct ethhdr *eh;
+	int do_mic;
+
+	key = (struct orinoco_tkip_key *) priv->keys[priv->tx_key].key;
+
+	do_mic = ((priv->encode_alg == ORINOCO_ALG_TKIP) &&
+		  (key != NULL));
+
+	if (do_mic)
+		*tx_control |= (priv->tx_key << HERMES_MIC_KEY_ID_SHIFT) |
+			HERMES_TXCTRL_MIC;
+
+	eh = (struct ethhdr *)skb->data;
+
+	/* Encapsulate Ethernet-II frames */
+	if (ntohs(eh->h_proto) > ETH_DATA_LEN) { /* Ethernet-II frame */
+		struct header_struct {
+			struct ethhdr eth;	/* 802.3 header */
+			u8 encap[6];		/* 802.2 header */
+		} __attribute__ ((packed)) hdr;
+		int len = skb->len + sizeof(encaps_hdr) - (2 * ETH_ALEN);
+
+		if (skb_headroom(skb) < ENCAPS_OVERHEAD) {
+			if (net_ratelimit())
+				printk(KERN_ERR
+				       "%s: Not enough headroom for 802.2 headers %d\n",
+				       dev->name, skb_headroom(skb));
+			return -ENOMEM;
+		}
+
+		/* Fill in new header */
+		memcpy(&hdr.eth, eh, 2 * ETH_ALEN);
+		hdr.eth.h_proto = htons(len);
+		memcpy(hdr.encap, encaps_hdr, sizeof(encaps_hdr));
+
+		/* Make room for the new header, and copy it in */
+		eh = (struct ethhdr *) skb_push(skb, ENCAPS_OVERHEAD);
+		memcpy(eh, &hdr, sizeof(hdr));
+	}
+
+	/* Calculate Michael MIC */
+	if (do_mic) {
+		size_t len = skb->len - ETH_HLEN;
+		u8 *mic = &mic_buf[0];
+
+		/* Have to write to an even address, so copy the spare
+		 * byte across */
+		if (skb->len % 2) {
+			*mic = skb->data[skb->len - 1];
+			mic++;
+		}
+
+		orinoco_mic(priv->tx_tfm_mic, key->tx_mic,
+			    eh->h_dest, eh->h_source, 0 /* priority */,
+			    skb->data + ETH_HLEN,
+			    len, mic);
+	}
+
+	return 0;
+}
+EXPORT_SYMBOL(orinoco_process_xmit_skb);
+
 static netdev_tx_t orinoco_xmit(struct sk_buff *skb, struct net_device *dev)
 {
 	struct orinoco_private *priv = ndev_priv(dev);
 	struct net_device_stats *stats = &priv->stats;
-	struct orinoco_tkip_key *key;
 	hermes_t *hw = &priv->hw;
 	int err = 0;
 	u16 txfid = priv->txfid;
-	struct ethhdr *eh;
 	int tx_control;
 	unsigned long flags;
-	int do_mic;
+	u8 mic_buf[MICHAEL_MIC_LEN+1];
 
 	if (!netif_running(dev)) {
 		printk(KERN_ERR "%s: Tx on stopped device!\n",
@@ -383,16 +474,12 @@ static netdev_tx_t orinoco_xmit(struct sk_buff *skb, struct net_device *dev)
 	if (skb->len < ETH_HLEN)
 		goto drop;
 
-	key = (struct orinoco_tkip_key *) priv->keys[priv->tx_key].key;
-
-	do_mic = ((priv->encode_alg == ORINOCO_ALG_TKIP) &&
-		  (key != NULL));
-
 	tx_control = HERMES_TXCTRL_TX_OK | HERMES_TXCTRL_TX_EX;
 
-	if (do_mic)
-		tx_control |= (priv->tx_key << HERMES_MIC_KEY_ID_SHIFT) |
-			HERMES_TXCTRL_MIC;
+	err = orinoco_process_xmit_skb(skb, dev, priv, &tx_control,
+				       &mic_buf[0]);
+	if (err)
+		goto drop;
 
 	if (priv->has_alt_txcntl) {
 		/* WPA enabled firmwares have tx_cntl at the end of
@@ -435,34 +522,6 @@ static netdev_tx_t orinoco_xmit(struct sk_buff *skb, struct net_device *dev)
 				   HERMES_802_3_OFFSET - HERMES_802_11_OFFSET);
 	}
 
-	eh = (struct ethhdr *)skb->data;
-
-	/* Encapsulate Ethernet-II frames */
-	if (ntohs(eh->h_proto) > ETH_DATA_LEN) { /* Ethernet-II frame */
-		struct header_struct {
-			struct ethhdr eth;	/* 802.3 header */
-			u8 encap[6];		/* 802.2 header */
-		} __attribute__ ((packed)) hdr;
-
-		/* Strip destination and source from the data */
-		skb_pull(skb, 2 * ETH_ALEN);
-
-		/* And move them to a separate header */
-		memcpy(&hdr.eth, eh, 2 * ETH_ALEN);
-		hdr.eth.h_proto = htons(sizeof(encaps_hdr) + skb->len);
-		memcpy(hdr.encap, encaps_hdr, sizeof(encaps_hdr));
-
-		/* Insert the SNAP header */
-		if (skb_headroom(skb) < sizeof(hdr)) {
-			printk(KERN_ERR
-			       "%s: Not enough headroom for 802.2 headers %d\n",
-			       dev->name, skb_headroom(skb));
-			goto drop;
-		}
-		eh = (struct ethhdr *) skb_push(skb, sizeof(hdr));
-		memcpy(eh, &hdr, sizeof(hdr));
-	}
-
 	err = hw->ops->bap_pwrite(hw, USER_BAP, skb->data, skb->len,
 				  txfid, HERMES_802_3_OFFSET);
 	if (err) {
@@ -471,32 +530,16 @@ static netdev_tx_t orinoco_xmit(struct sk_buff *skb, struct net_device *dev)
 		goto busy;
 	}
 
-	/* Calculate Michael MIC */
-	if (do_mic) {
-		u8 mic_buf[MICHAEL_MIC_LEN + 1];
-		u8 *mic;
-		size_t offset;
-		size_t len;
+	if (tx_control & HERMES_TXCTRL_MIC) {
+		size_t offset = HERMES_802_3_OFFSET + skb->len;
+		size_t len = MICHAEL_MIC_LEN;
 
-		if (skb->len % 2) {
-			/* MIC start is on an odd boundary */
-			mic_buf[0] = skb->data[skb->len - 1];
-			mic = &mic_buf[1];
-			offset = skb->len - 1;
-			len = MICHAEL_MIC_LEN + 1;
-		} else {
-			mic = &mic_buf[0];
-			offset = skb->len;
-			len = MICHAEL_MIC_LEN;
+		if (offset % 2) {
+			offset--;
+			len++;
 		}
-
-		orinoco_mic(priv->tx_tfm_mic, key->tx_mic,
-			    eh->h_dest, eh->h_source, 0 /* priority */,
-			    skb->data + ETH_HLEN, skb->len - ETH_HLEN, mic);
-
-		/* Write the MIC */
 		err = hw->ops->bap_pwrite(hw, USER_BAP, &mic_buf[0], len,
-					  txfid, HERMES_802_3_OFFSET + offset);
+					  txfid, offset);
 		if (err) {
 			printk(KERN_ERR "%s: Error %d writing MIC to BAP\n",
 			       dev->name, err);
@@ -2235,7 +2278,7 @@ int orinoco_if_add(struct orinoco_private *priv,
 	/* we use the default eth_mac_addr for setting the MAC addr */
 
 	/* Reserve space in skb for the SNAP header */
-	dev->hard_header_len += ENCAPS_OVERHEAD;
+	dev->needed_headroom = ENCAPS_OVERHEAD;
 
 	netif_carrier_off(dev);
 
diff --git a/drivers/net/wireless/orinoco/orinoco.h b/drivers/net/wireless/orinoco/orinoco.h
index e9f415a..a6da86e 100644
--- a/drivers/net/wireless/orinoco/orinoco.h
+++ b/drivers/net/wireless/orinoco/orinoco.h
@@ -200,6 +200,12 @@ extern irqreturn_t orinoco_interrupt(int irq, void *dev_id);
 extern void __orinoco_ev_info(struct net_device *dev, hermes_t *hw);
 extern void __orinoco_ev_rx(struct net_device *dev, hermes_t *hw);
 
+int orinoco_process_xmit_skb(struct sk_buff *skb,
+			     struct net_device *dev,
+			     struct orinoco_private *priv,
+			     int *tx_control,
+			     u8 *mic);
+
 /* Common ndo functions exported for reuse by orinoco_usb */
 int orinoco_open(struct net_device *dev);
 int orinoco_stop(struct net_device *dev);
diff --git a/drivers/net/wireless/orinoco/orinoco_usb.c b/drivers/net/wireless/orinoco/orinoco_usb.c
index e220933..78f089b 100644
--- a/drivers/net/wireless/orinoco/orinoco_usb.c
+++ b/drivers/net/wireless/orinoco/orinoco_usb.c
@@ -67,6 +67,7 @@
 #include <linux/wireless.h>
 #include <linux/firmware.h>
 
+#include "mic.h"
 #include "orinoco.h"
 
 #ifndef URB_ASYNC_UNLINK
@@ -1198,11 +1199,9 @@ static netdev_tx_t ezusb_xmit(struct sk_buff *skb, struct net_device *dev)
 	struct orinoco_private *priv = ndev_priv(dev);
 	struct net_device_stats *stats = &priv->stats;
 	struct ezusb_priv *upriv = priv->card;
+	u8 mic[MICHAEL_MIC_LEN+1];
 	int err = 0;
-	char *p;
-	struct ethhdr *eh;
-	int len, data_len, data_off;
-	__le16 tx_control;
+	int tx_control;
 	unsigned long flags;
 	struct request_context *ctx;
 	u8 *buf;
@@ -1222,7 +1221,7 @@ static netdev_tx_t ezusb_xmit(struct sk_buff *skb, struct net_device *dev)
 
 	if (orinoco_lock(priv, &flags) != 0) {
 		printk(KERN_ERR
-		       "%s: orinoco_xmit() called while hw_unavailable\n",
+		       "%s: ezusb_xmit() called while hw_unavailable\n",
 		       dev->name);
 		return NETDEV_TX_BUSY;
 	}
@@ -1232,53 +1231,46 @@ static netdev_tx_t ezusb_xmit(struct sk_buff *skb, struct net_device *dev)
 		/* Oops, the firmware hasn't established a connection,
 		   silently drop the packet (this seems to be the
 		   safest approach). */
-		stats->tx_errors++;
-		orinoco_unlock(priv, &flags);
-		dev_kfree_skb(skb);
-		return NETDEV_TX_OK;
+		goto drop;
 	}
 
+	/* Check packet length */
+	if (skb->len < ETH_HLEN)
+		goto drop;
+
 	ctx = ezusb_alloc_ctx(upriv, EZUSB_RID_TX, 0);
 	if (!ctx)
-		goto fail;
+		goto busy;
 
 	memset(ctx->buf, 0, BULK_BUF_SIZE);
 	buf = ctx->buf->data;
 
-	/* Length of the packet body */
-	/* FIXME: what if the skb is smaller than this? */
-	len = max_t(int, skb->len - ETH_HLEN, ETH_ZLEN - ETH_HLEN);
-
-	eh = (struct ethhdr *) skb->data;
-
-	tx_control = cpu_to_le16(0);
-	memcpy(buf, &tx_control, sizeof(tx_control));
-	buf += sizeof(tx_control);
-	/* Encapsulate Ethernet-II frames */
-	if (ntohs(eh->h_proto) > ETH_DATA_LEN) {	/* Ethernet-II frame */
-		struct header_struct *hdr = (void *) buf;
-		buf += sizeof(*hdr);
-		data_len = len;
-		data_off = sizeof(tx_control) + sizeof(*hdr);
-		p = skb->data + ETH_HLEN;
-
-		/* 802.3 header */
-		memcpy(hdr->dest, eh->h_dest, ETH_ALEN);
-		memcpy(hdr->src, eh->h_source, ETH_ALEN);
-		hdr->len = htons(data_len + ENCAPS_OVERHEAD);
-
-		/* 802.2 header */
-		memcpy(&hdr->dsap, &encaps_hdr, sizeof(encaps_hdr));
-
-		hdr->ethertype = eh->h_proto;
-	} else {		/* IEEE 802.3 frame */
-		data_len = len + ETH_HLEN;
-		data_off = sizeof(tx_control);
-		p = skb->data;
+	tx_control = 0;
+
+	err = orinoco_process_xmit_skb(skb, dev, priv, &tx_control,
+				       &mic[0]);
+	if (err)
+		goto drop;
+
+	{
+		__le16 *tx_cntl = (__le16 *)buf;
+		*tx_cntl = cpu_to_le16(tx_control);
+		buf += sizeof(*tx_cntl);
 	}
 
-	memcpy(buf, p, data_len);
-	buf += data_len;
+	memcpy(buf, skb->data, skb->len);
+	buf += skb->len;
+
+	if (tx_control & HERMES_TXCTRL_MIC) {
+		u8 *m = mic;
+		/* Mic has been offset so it can be copied to an even
+		 * address. We're copying eveything anyway, so we
+		 * don't need to copy that first byte. */
+		if (skb->len % 2)
+			m++;
+		memcpy(buf, m, MICHAEL_MIC_LEN);
+		buf += MICHAEL_MIC_LEN;
+	}
 
 	/* Finally, we actually initiate the send */
 	netif_stop_queue(dev);
@@ -1294,20 +1286,23 @@ static netdev_tx_t ezusb_xmit(struct sk_buff *skb, struct net_device *dev)
 		if (net_ratelimit())
 			printk(KERN_ERR "%s: Error %d transmitting packet\n",
 				dev->name, err);
-		stats->tx_errors++;
-		goto fail;
+		goto busy;
 	}
 
 	dev->trans_start = jiffies;
-	stats->tx_bytes += data_off + data_len;
+	stats->tx_bytes += skb->len;
+	goto ok;
 
-	orinoco_unlock(priv, &flags);
+ drop:
+	stats->tx_errors++;
+	stats->tx_dropped++;
 
+ ok:
+	orinoco_unlock(priv, &flags);
 	dev_kfree_skb(skb);
-
 	return NETDEV_TX_OK;
 
- fail:
+ busy:
 	orinoco_unlock(priv, &flags);
 	return NETDEV_TX_BUSY;
 }
-- 
1.6.4.4


^ permalink raw reply related

* [RFC] orinoco: use SKB tail for MIC
From: David Kilroy @ 2010-05-04 21:54 UTC (permalink / raw)
  To: linux-wireless; +Cc: orinoco-devel, linville, David Kilroy
In-Reply-To: <1273010082-15871-1-git-send-email-kilroyd@googlemail.com>

The interface is much neater if we can append the calculated MIC to
the SKB which gets blatted to the hardware wholesale.

Unfortunately, this doesn't work very well. Without spare padding, we
never seem to have any tailroom, and even we ask for extra tailroom
it's not guaranteed.

We could probably call pskb_expand_skb or something to get the tailroom.
But should we really be doing that on the majority of packets?

Signed-off-by: David Kilroy <kilroyd@googlemail.com>
---
 drivers/net/wireless/orinoco/main.c        |   42 ++++++++-------------------
 drivers/net/wireless/orinoco/orinoco.h     |    3 +-
 drivers/net/wireless/orinoco/orinoco_usb.c |   16 +----------
 3 files changed, 15 insertions(+), 46 deletions(-)

diff --git a/drivers/net/wireless/orinoco/main.c b/drivers/net/wireless/orinoco/main.c
index 3b9a5fb..95e9edb 100644
--- a/drivers/net/wireless/orinoco/main.c
+++ b/drivers/net/wireless/orinoco/main.c
@@ -367,8 +367,7 @@ EXPORT_SYMBOL(orinoco_change_mtu);
 int orinoco_process_xmit_skb(struct sk_buff *skb,
 			     struct net_device *dev,
 			     struct orinoco_private *priv,
-			     int *tx_control,
-			     u8 *mic_buf)
+			     int *tx_control)
 {
 	struct orinoco_tkip_key *key;
 	struct ethhdr *eh;
@@ -414,15 +413,18 @@ int orinoco_process_xmit_skb(struct sk_buff *skb,
 	/* Calculate Michael MIC */
 	if (do_mic) {
 		size_t len = skb->len - ETH_HLEN;
-		u8 *mic = &mic_buf[0];
+		u8 *mic;
 
-		/* Have to write to an even address, so copy the spare
-		 * byte across */
-		if (skb->len % 2) {
-			*mic = skb->data[skb->len - 1];
-			mic++;
+		if (skb_tailroom(skb) < MICHAEL_MIC_LEN) {
+			if (net_ratelimit())
+				printk(KERN_ERR "%s: Insufficient tailroom (%d) for MIC (%d)\n",
+				       dev->name,
+				       skb_tailroom(skb), MICHAEL_MIC_LEN);
+			return -ENOMEM;
 		}
 
+		mic = skb_put(skb, MICHAEL_MIC_LEN);
+
 		orinoco_mic(priv->tx_tfm_mic, key->tx_mic,
 			    eh->h_dest, eh->h_source, 0 /* priority */,
 			    skb->data + ETH_HLEN,
@@ -442,7 +444,6 @@ static netdev_tx_t orinoco_xmit(struct sk_buff *skb, struct net_device *dev)
 	u16 txfid = priv->txfid;
 	int tx_control;
 	unsigned long flags;
-	u8 mic_buf[MICHAEL_MIC_LEN+1];
 
 	if (!netif_running(dev)) {
 		printk(KERN_ERR "%s: Tx on stopped device!\n",
@@ -476,8 +477,7 @@ static netdev_tx_t orinoco_xmit(struct sk_buff *skb, struct net_device *dev)
 
 	tx_control = HERMES_TXCTRL_TX_OK | HERMES_TXCTRL_TX_EX;
 
-	err = orinoco_process_xmit_skb(skb, dev, priv, &tx_control,
-				       &mic_buf[0]);
+	err = orinoco_process_xmit_skb(skb, dev, priv, &tx_control);
 	if (err)
 		goto drop;
 
@@ -530,23 +530,6 @@ static netdev_tx_t orinoco_xmit(struct sk_buff *skb, struct net_device *dev)
 		goto busy;
 	}
 
-	if (tx_control & HERMES_TXCTRL_MIC) {
-		size_t offset = HERMES_802_3_OFFSET + skb->len;
-		size_t len = MICHAEL_MIC_LEN;
-
-		if (offset % 2) {
-			offset--;
-			len++;
-		}
-		err = hw->ops->bap_pwrite(hw, USER_BAP, &mic_buf[0], len,
-					  txfid, offset);
-		if (err) {
-			printk(KERN_ERR "%s: Error %d writing MIC to BAP\n",
-			       dev->name, err);
-			goto busy;
-		}
-	}
-
 	/* Finally, we actually initiate the send */
 	netif_stop_queue(dev);
 
@@ -2277,8 +2260,9 @@ int orinoco_if_add(struct orinoco_private *priv,
 
 	/* we use the default eth_mac_addr for setting the MAC addr */
 
-	/* Reserve space in skb for the SNAP header */
+	/* Reserve space in skb for the SNAP header, and MIC */
 	dev->needed_headroom = ENCAPS_OVERHEAD;
+	dev->needed_tailroom = MICHAEL_MIC_LEN;
 
 	netif_carrier_off(dev);
 
diff --git a/drivers/net/wireless/orinoco/orinoco.h b/drivers/net/wireless/orinoco/orinoco.h
index a6da86e..5ea3de8 100644
--- a/drivers/net/wireless/orinoco/orinoco.h
+++ b/drivers/net/wireless/orinoco/orinoco.h
@@ -203,8 +203,7 @@ extern void __orinoco_ev_rx(struct net_device *dev, hermes_t *hw);
 int orinoco_process_xmit_skb(struct sk_buff *skb,
 			     struct net_device *dev,
 			     struct orinoco_private *priv,
-			     int *tx_control,
-			     u8 *mic);
+			     int *tx_control);
 
 /* Common ndo functions exported for reuse by orinoco_usb */
 int orinoco_open(struct net_device *dev);
diff --git a/drivers/net/wireless/orinoco/orinoco_usb.c b/drivers/net/wireless/orinoco/orinoco_usb.c
index 78f089b..dabea30 100644
--- a/drivers/net/wireless/orinoco/orinoco_usb.c
+++ b/drivers/net/wireless/orinoco/orinoco_usb.c
@@ -67,7 +67,6 @@
 #include <linux/wireless.h>
 #include <linux/firmware.h>
 
-#include "mic.h"
 #include "orinoco.h"
 
 #ifndef URB_ASYNC_UNLINK
@@ -1199,7 +1198,6 @@ static netdev_tx_t ezusb_xmit(struct sk_buff *skb, struct net_device *dev)
 	struct orinoco_private *priv = ndev_priv(dev);
 	struct net_device_stats *stats = &priv->stats;
 	struct ezusb_priv *upriv = priv->card;
-	u8 mic[MICHAEL_MIC_LEN+1];
 	int err = 0;
 	int tx_control;
 	unsigned long flags;
@@ -1247,8 +1245,7 @@ static netdev_tx_t ezusb_xmit(struct sk_buff *skb, struct net_device *dev)
 
 	tx_control = 0;
 
-	err = orinoco_process_xmit_skb(skb, dev, priv, &tx_control,
-				       &mic[0]);
+	err = orinoco_process_xmit_skb(skb, dev, priv, &tx_control);
 	if (err)
 		goto drop;
 
@@ -1261,17 +1258,6 @@ static netdev_tx_t ezusb_xmit(struct sk_buff *skb, struct net_device *dev)
 	memcpy(buf, skb->data, skb->len);
 	buf += skb->len;
 
-	if (tx_control & HERMES_TXCTRL_MIC) {
-		u8 *m = mic;
-		/* Mic has been offset so it can be copied to an even
-		 * address. We're copying eveything anyway, so we
-		 * don't need to copy that first byte. */
-		if (skb->len % 2)
-			m++;
-		memcpy(buf, m, MICHAEL_MIC_LEN);
-		buf += MICHAEL_MIC_LEN;
-	}
-
 	/* Finally, we actually initiate the send */
 	netif_stop_queue(dev);
 
-- 
1.6.4.4


^ permalink raw reply related

* [PATCH] compat: backport orinoco updates
From: Hauke Mehrtens @ 2010-05-04 22:40 UTC (permalink / raw)
  To: lrodriguez; +Cc: linux-wireless, mcgrof, Hauke Mehrtens


Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
---
 include/linux/compat-2.6.29.h |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/include/linux/compat-2.6.29.h b/include/linux/compat-2.6.29.h
index c3572a2..2709953 100644
--- a/include/linux/compat-2.6.29.h
+++ b/include/linux/compat-2.6.29.h
@@ -61,6 +61,8 @@ extern void usb_unpoison_anchored_urbs(struct usb_anchor *anchor);
 
 extern int eth_mac_addr(struct net_device *dev, void *p);
 
+#define orinoco_if_add(priv, base_addr, irq, ops) orinoco_if_add(priv, base_addr, irq)
+
 #endif /* (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,29)) */
 
 #endif /*  LINUX_26_29_COMPAT_H */
-- 
1.7.0.4


^ permalink raw reply related

* [PATCH] compat-wireless: updates for orinoco
From: Hauke Mehrtens @ 2010-05-04 22:40 UTC (permalink / raw)
  To: lrodriguez; +Cc: linux-wireless, mcgrof, Hauke Mehrtens

* Make all the patches apply again.
* rename read_pda to avoid conflicts with definitions in kernel <= 2.6.29
* add orinoco usb

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
---
 config.mk                                 |    2 +
 patches/01-netdev.patch                   |   51 +++++++++++++++++++++-----
 patches/24-pcmcia.patch                   |   10 +++---
 patches/27-hermes-read-pda-conflict.patch |   56 +++++++++++++++++++++++++++++
 4 files changed, 104 insertions(+), 15 deletions(-)
 create mode 100644 patches/27-hermes-read-pda-conflict.patch

diff --git a/config.mk b/config.mk
index 6a7c5c9..176c0af 100644
--- a/config.mk
+++ b/config.mk
@@ -388,6 +388,8 @@ CONFIG_LIBERTAS_USB=m
 NEED_LIBERTAS=y
 endif
 
+CONFIG_ORINOCO_USB=m
+
 endif # end of USB driver list
 
 ifneq ($(CONFIG_SPI_MASTER),)
diff --git a/patches/01-netdev.patch b/patches/01-netdev.patch
index 01dbbce..51d12c4 100644
--- a/patches/01-netdev.patch
+++ b/patches/01-netdev.patch
@@ -575,7 +575,7 @@ without creating a headache on maintenance of the pathes.
  	dev->tx_queue_len = 0;
 --- a/drivers/net/wireless/orinoco/main.c
 +++ b/drivers/net/wireless/orinoco/main.c
-@@ -2078,6 +2078,7 @@ int orinoco_init(struct orinoco_private 
+@@ -2087,6 +2087,7 @@ int orinoco_init(struct orinoco_private 
  }
  EXPORT_SYMBOL(orinoco_init);
  
@@ -583,7 +583,7 @@ without creating a headache on maintenance of the pathes.
  static const struct net_device_ops orinoco_netdev_ops = {
  	.ndo_open		= orinoco_open,
  	.ndo_stop		= orinoco_stop,
-@@ -2089,6 +2090,7 @@ static const struct net_device_ops orino
+@@ -2098,6 +2099,7 @@ static const struct net_device_ops orino
  	.ndo_tx_timeout		= orinoco_tx_timeout,
  	.ndo_get_stats		= orinoco_get_stats,
  };
@@ -591,12 +591,15 @@ without creating a headache on maintenance of the pathes.
  
  /* Allocate private data.
   *
-@@ -2211,7 +2213,18 @@ int orinoco_if_add(struct orinoco_privat
- 
- 	/* Setup / override net_device fields */
- 	dev->ieee80211_ptr = wdev;
+@@ -2227,10 +2229,21 @@ int orinoco_if_add(struct orinoco_privat
+ 	dev->wireless_data = &priv->wireless_data;
+ #endif
+ 	/* Default to standard ops if not set */
 +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,29))
- 	dev->netdev_ops = &orinoco_netdev_ops;
+ 	if (ops)
+ 		dev->netdev_ops = ops;
+ 	else
+ 		dev->netdev_ops = &orinoco_netdev_ops;
 +#else
 +	dev->open = orinoco_open;
 +	dev->stop = orinoco_stop;
@@ -607,9 +610,37 @@ without creating a headache on maintenance of the pathes.
 +	dev->tx_timeout = orinoco_tx_timeout;
 +	dev->get_stats = orinoco_get_stats;
 +#endif
- 	dev->watchdog_timeo = HZ; /* 1 second timeout */
- 	dev->wireless_handlers = &orinoco_handler_def;
- #ifdef WIRELESS_SPY
+ 
+ 	/* we use the default eth_mac_addr for setting the MAC addr */
+ 
+--- a/drivers/net/wireless/orinoco/orinoco_usb.c
++++ b/drivers/net/wireless/orinoco/orinoco_usb.c
+@@ -1566,6 +1566,7 @@ static const struct hermes_ops ezusb_ops
+ 	.unlock_irq = ezusb_unlock_irq,
+ };
+ 
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,29))
+ static const struct net_device_ops ezusb_netdev_ops = {
+ 	.ndo_open		= orinoco_open,
+ 	.ndo_stop		= orinoco_stop,
+@@ -1577,6 +1578,7 @@ static const struct net_device_ops ezusb
+ 	.ndo_tx_timeout		= orinoco_tx_timeout,
+ 	.ndo_get_stats		= orinoco_get_stats,
+ };
++#endif
+ 
+ static int ezusb_probe(struct usb_interface *interface,
+ 		       const struct usb_device_id *id)
+@@ -1722,6 +1724,9 @@ static int ezusb_probe(struct usb_interf
+ 		err("%s: orinoco_if_add() failed", __func__);
+ 		goto error;
+ 	}
++#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,29))
++	priv->ndev->hard_start_xmit = ezusb_xmit;
++#endif
+ 	upriv->dev = priv->ndev;
+ 
+ 	goto exit;
 --- a/net/bluetooth/bnep/netdev.c
 +++ b/net/bluetooth/bnep/netdev.c
 @@ -168,8 +168,12 @@ static inline int bnep_net_proto_filter(
diff --git a/patches/24-pcmcia.patch b/patches/24-pcmcia.patch
index 283b30d..3bc395d 100644
--- a/patches/24-pcmcia.patch
+++ b/patches/24-pcmcia.patch
@@ -251,9 +251,9 @@
  	/* Register an interface with the stack */
  	if (orinoco_if_add(priv, link->io.BasePort1,
 +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35))
- 			   link->irq) != 0) {
+ 			   link->irq, NULL) != 0) {
 +#else
-+			   link->irq.AssignedIRQ) != 0) {
++			   link->irq.AssignedIRQ, NULL) != 0) {
 +#endif
  		printk(KERN_ERR PFX "orinoco_if_add() failed\n");
  		goto failed;
@@ -285,14 +285,14 @@
  	if (ret)
  		goto failed;
  
-@@ -359,7 +369,11 @@ spectrum_cs_config(struct pcmcia_device 
+@@ -360,7 +370,11 @@ spectrum_cs_config(struct pcmcia_device 
  
  	/* Register an interface with the stack */
  	if (orinoco_if_add(priv, link->io.BasePort1,
 +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35))
- 			   link->irq) != 0) {
+ 			   link->irq, NULL) != 0) {
 +#else
-+			   link->irq.AssignedIRQ) != 0) {
++			   link->irq.AssignedIRQ, NULL) != 0) {
 +#endif
  		printk(KERN_ERR PFX "orinoco_if_add() failed\n");
  		goto failed;
diff --git a/patches/27-hermes-read-pda-conflict.patch b/patches/27-hermes-read-pda-conflict.patch
new file mode 100644
index 0000000..fe6b181
--- /dev/null
+++ b/patches/27-hermes-read-pda-conflict.patch
@@ -0,0 +1,56 @@
+Rename read_pda to something else because this symbol is used in a
+define for something else in arch/um/include/asm/pda.h on older kernels.
+
+--- a/drivers/net/wireless/orinoco/fw.c
++++ b/drivers/net/wireless/orinoco/fw.c
+@@ -122,7 +122,7 @@ orinoco_dl_firmware(struct orinoco_priva
+ 	dev_dbg(dev, "Attempting to download firmware %s\n", firmware);
+ 
+ 	/* Read current plug data */
+-	err = hw->ops->read_pda(hw, pda, fw->pda_addr, fw->pda_size);
++	err = hw->ops->read_pda_h(hw, pda, fw->pda_addr, fw->pda_size);
+ 	dev_dbg(dev, "Read PDA returned %d\n", err);
+ 	if (err)
+ 		goto free;
+@@ -224,7 +224,7 @@ symbol_dl_image(struct orinoco_private *
+ 		if (!pda)
+ 			return -ENOMEM;
+ 
+-		ret = hw->ops->read_pda(hw, pda, fw->pda_addr, fw->pda_size);
++		ret = hw->ops->read_pda_h(hw, pda, fw->pda_addr, fw->pda_size);
+ 		if (ret)
+ 			goto free;
+ 	}
+--- a/drivers/net/wireless/orinoco/hermes.c
++++ b/drivers/net/wireless/orinoco/hermes.c
+@@ -765,7 +765,7 @@ static const struct hermes_ops hermes_op
+ 	.write_ltv = hermes_write_ltv,
+ 	.bap_pread = hermes_bap_pread,
+ 	.bap_pwrite = hermes_bap_pwrite,
+-	.read_pda = hermes_read_pda,
++	.read_pda_h = hermes_read_pda,
+ 	.program_init = hermesi_program_init,
+ 	.program_end = hermesi_program_end,
+ 	.program = hermes_program_bytes,
+--- a/drivers/net/wireless/orinoco/hermes.h
++++ b/drivers/net/wireless/orinoco/hermes.h
+@@ -393,7 +393,7 @@ struct hermes_ops {
+ 			 u16 id, u16 offset);
+ 	int (*bap_pwrite)(struct hermes *hw, int bap, const void *buf,
+ 			  int len, u16 id, u16 offset);
+-	int (*read_pda)(struct hermes *hw, __le16 *pda,
++	int (*read_pda_h)(struct hermes *hw, __le16 *pda,
+ 			u32 pda_addr, u16 pda_len);
+ 	int (*program_init)(struct hermes *hw, u32 entry_point);
+ 	int (*program_end)(struct hermes *hw);
+--- a/drivers/net/wireless/orinoco/orinoco_usb.c
++++ b/drivers/net/wireless/orinoco/orinoco_usb.c
+@@ -1556,7 +1556,7 @@ static const struct hermes_ops ezusb_ops
+ 	.read_ltv = ezusb_read_ltv,
+ 	.write_ltv = ezusb_write_ltv,
+ 	.bap_pread = ezusb_bap_pread,
+-	.read_pda = ezusb_read_pda,
++	.read_pda_h = ezusb_read_pda,
+ 	.program_init = ezusb_program_init,
+ 	.program_end = ezusb_program_end,
+ 	.program = ezusb_program,
-- 
1.7.0.4


^ permalink raw reply related

* [PATCH] mac80211: remove association work when processing deauth request
From: Reinette Chatre @ 2010-05-04 23:04 UTC (permalink / raw)
  To: johannes, linville; +Cc: linux-wireless, Reinette Chatre

From: Reinette Chatre <reinette.chatre@intel.com>

In https://bugzilla.kernel.org/show_bug.cgi?id=15794 a user encountered the
following:

[18967.469098] wlan0: authenticated
[18967.472527] wlan0: associate with 00:1c:10:b8:e3:ea (try 1)
[18967.472585] wlan0: deauthenticating from 00:1c:10:b8:e3:ea by local choice (reason=3)
[18967.672057] wlan0: associate with 00:1c:10:b8:e3:ea (try 2)
[18967.872357] wlan0: associate with 00:1c:10:b8:e3:ea (try 3)
[18968.072960] wlan0: association with 00:1c:10:b8:e3:ea timed out
[18968.076890] ------------[ cut here ]------------
[18968.076898] WARNING: at net/wireless/mlme.c:341 cfg80211_send_assoc_timeout+0xa8/0x140()
[18968.076900] Hardware name: GX628
[18968.076924] Pid: 1408, comm: phy0 Not tainted 2.6.34-rc4-00082-g250541f-dirty #3
[18968.076926] Call Trace:
[18968.076931]  [<ffffffff8103459e>] ?  warn_slowpath_common+0x6e/0xb0
[18968.076934]  [<ffffffff8157c2d8>] ?  cfg80211_send_assoc_timeout+0xa8/0x140
[18968.076937]  [<ffffffff8103ff8b>] ? mod_timer+0x10b/0x180
[18968.076940]  [<ffffffff8158f0fc>] ?  ieee80211_assoc_done+0xbc/0xc0
[18968.076943]  [<ffffffff81590d53>] ?  ieee80211_work_work+0x553/0x11c0
[18968.076945]  [<ffffffff8102d931>] ? finish_task_switch+0x41/0xb0
[18968.076948]  [<ffffffff81590800>] ?  ieee80211_work_work+0x0/0x11c0
[18968.076951]  [<ffffffff810476fb>] ? worker_thread+0x13b/0x210
[18968.076954]  [<ffffffff8104b6b0>] ?  autoremove_wake_function+0x0/0x30
[18968.076956]  [<ffffffff810475c0>] ? worker_thread+0x0/0x210
[18968.076959]  [<ffffffff8104b21e>] ? kthread+0x8e/0xa0
[18968.076962]  [<ffffffff810031f4>] ?  kernel_thread_helper+0x4/0x10
[18968.076964]  [<ffffffff8104b190>] ? kthread+0x0/0xa0
[18968.076966]  [<ffffffff810031f0>] ?  kernel_thread_helper+0x0/0x10
[18968.076968] ---[ end trace 8aa6265f4b1adfe0 ]---

As explained by Johannes Berg <johannes@sipsolutions.net>:

We authenticate successfully, and then userspace requests association.
Then we start that process, but the AP doesn't respond. While we're
still waiting for an AP response, userspace asks for a deauth. We do
the deauth, but don't abort the association work. Then once the
association work times out we tell cfg80211, but it no longer wants
to know since for all it is concerned we accepted the deauth that
also kills the association attempt.

Fix this by, upon receipt of deauth request, removing the association work
and continuing to send the deauth.

Unfortunately the user reporting the issue is not able to reproduce this
problem anymore and cannot verify this fix. This seems like a well understood
issue though and I thus present the patch.

Bug-identified-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
---
 net/mac80211/mlme.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c
index 358226f..890510c 100644
--- a/net/mac80211/mlme.c
+++ b/net/mac80211/mlme.c
@@ -2176,7 +2176,8 @@ int ieee80211_mgd_deauth(struct ieee80211_sub_if_data *sdata,
 				continue;
 
 			if (wk->type != IEEE80211_WORK_DIRECT_PROBE &&
-			    wk->type != IEEE80211_WORK_AUTH)
+			    wk->type != IEEE80211_WORK_AUTH &&
+			    wk->type != IEEE80211_WORK_ASSOC)
 				continue;
 
 			if (memcmp(req->bss->bssid, wk->filter_ta, ETH_ALEN))
-- 
1.6.3.3


^ permalink raw reply related

* Re: [PATCH] mac80211: remove association work when processing deauth request
From: reinette chatre @ 2010-05-04 23:11 UTC (permalink / raw)
  To: johannes@sipsolutions.net
  Cc: linville@tuxdriver.com, linux-wireless@vger.kernel.org
In-Reply-To: <1273014289-21765-1-git-send-email-reinette.chatre@intel.com>

On Tue, 2010-05-04 at 16:04 -0700, Chatre, Reinette wrote:
> From: Reinette Chatre <reinette.chatre@intel.com>
> 
> In https://bugzilla.kernel.org/show_bug.cgi?id=15794 a user encountered the
> following:
> 
> [18967.469098] wlan0: authenticated
> [18967.472527] wlan0: associate with 00:1c:10:b8:e3:ea (try 1)
> [18967.472585] wlan0: deauthenticating from 00:1c:10:b8:e3:ea by local choice (reason=3)
> [18967.672057] wlan0: associate with 00:1c:10:b8:e3:ea (try 2)
> [18967.872357] wlan0: associate with 00:1c:10:b8:e3:ea (try 3)
> [18968.072960] wlan0: association with 00:1c:10:b8:e3:ea timed out
> [18968.076890] ------------[ cut here ]------------
> [18968.076898] WARNING: at net/wireless/mlme.c:341 cfg80211_send_assoc_timeout+0xa8/0x140()
> [18968.076900] Hardware name: GX628
> [18968.076924] Pid: 1408, comm: phy0 Not tainted 2.6.34-rc4-00082-g250541f-dirty #3
> [18968.076926] Call Trace:
> [18968.076931]  [<ffffffff8103459e>] ?  warn_slowpath_common+0x6e/0xb0
> [18968.076934]  [<ffffffff8157c2d8>] ?  cfg80211_send_assoc_timeout+0xa8/0x140
> [18968.076937]  [<ffffffff8103ff8b>] ? mod_timer+0x10b/0x180
> [18968.076940]  [<ffffffff8158f0fc>] ?  ieee80211_assoc_done+0xbc/0xc0
> [18968.076943]  [<ffffffff81590d53>] ?  ieee80211_work_work+0x553/0x11c0
> [18968.076945]  [<ffffffff8102d931>] ? finish_task_switch+0x41/0xb0
> [18968.076948]  [<ffffffff81590800>] ?  ieee80211_work_work+0x0/0x11c0
> [18968.076951]  [<ffffffff810476fb>] ? worker_thread+0x13b/0x210
> [18968.076954]  [<ffffffff8104b6b0>] ?  autoremove_wake_function+0x0/0x30
> [18968.076956]  [<ffffffff810475c0>] ? worker_thread+0x0/0x210
> [18968.076959]  [<ffffffff8104b21e>] ? kthread+0x8e/0xa0
> [18968.076962]  [<ffffffff810031f4>] ?  kernel_thread_helper+0x4/0x10
> [18968.076964]  [<ffffffff8104b190>] ? kthread+0x0/0xa0
> [18968.076966]  [<ffffffff810031f0>] ?  kernel_thread_helper+0x0/0x10
> [18968.076968] ---[ end trace 8aa6265f4b1adfe0 ]---
> 
> As explained by Johannes Berg <johannes@sipsolutions.net>:
> 
> We authenticate successfully, and then userspace requests association.
> Then we start that process, but the AP doesn't respond. While we're
> still waiting for an AP response, userspace asks for a deauth. We do
> the deauth, but don't abort the association work. Then once the
> association work times out we tell cfg80211, but it no longer wants
> to know since for all it is concerned we accepted the deauth that
> also kills the association attempt.
> 
> Fix this by, upon receipt of deauth request, removing the association work
> and continuing to send the deauth.
> 
> Unfortunately the user reporting the issue is not able to reproduce this
> problem anymore and cannot verify this fix. This seems like a well understood
> issue though and I thus present the patch.
> 
> Bug-identified-by: Johannes Berg <johannes@sipsolutions.net>
> Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
> ---

Please also consider this patch for wireless-2.6 - it applies cleanly.

Reinette



^ permalink raw reply

* Re: [PATCH] compat-wireless: updates for orinoco
From: Luis R. Rodriguez @ 2010-05-04 23:26 UTC (permalink / raw)
  To: Hauke Mehrtens, Stephen Hemminger, David Miller
  Cc: linux-wireless, mcgrof, netdev
In-Reply-To: <1273012850-8359-1-git-send-email-hauke@hauke-m.de>

First of all, thanks a lot! Some comments below.

On Tue, May 4, 2010 at 3:40 PM, Hauke Mehrtens <hauke@hauke-m.de> wrote:
> * Make all the patches apply again.
> * rename read_pda to avoid conflicts with definitions in kernel <= 2.6.29

I'm going to apply these two changes, if you get time can you send a
patch to rename read_pda upstream as well, that way we don't have to
carry this?

> * add orinoco usb

Thanks for this but I've grown tired of updating these netdev ops and
I think we can do better. I'll add a netdev_attach_ops() which would
simply do all the backport stuff for us, this way for backporting
purposes all we have to do is replace the old lines with a
netdev_attach_ops() call. In fact if we *really* wanted to we could
add a dummy netdev_attach_ops() upstream and just backport that on
older kernels, this would mean 0 line changes to backport a newer
driver.

Something like this maybe on the generic compat module, it builds for
me, will commit soon.

/*
 * Expand this as drivers require more ops, for now this
 * only sets the ones we need.
 */
void netdev_attach_ops(struct net_device *dev,
                      const struct net_device_ops *ops)
{
#define SET_NETDEVOP(_op) (_op ? _op : NULL)
       dev->open = SET_NETDEVOP(ops->ndo_open);
       dev->stop = SET_NETDEVOP(ops->ndo_stop);
       dev->hard_start_xmit = SET_NETDEVOP(ops->ndo_start_xmit);
       dev->set_multicast_list = SET_NETDEVOP(ops->ndo_set_multicast_list);
       dev->change_mtu = SET_NETDEVOP(ops->ndo_change_mtu);
       dev->set_mac_address = SET_NETDEVOP(ops->ndo_set_mac_address);
       dev->tx_timeout = SET_NETDEVOP(ops->ndo_tx_timeout);
       dev->get_stats = SET_NETDEVOP(ops->ndo_get_stats);
#undef SET_NETDEVOP
}
EXPORT_SYMBOL(netdev_attach_ops);

For newer kernels then this would just be:

static inline void netdev_attach_ops(struct net_device *dev,
                      const struct net_device_ops *ops)
{
       dev->netdev_ops = ops;
}

Stephen, would the above be acceptable upstream on netdevice.h ? It
would eliminate all needs from having to #ifdef network drivers when
backporting. If so I can send a respective patch and spatch all the
setters I think. An example of the nasty ifdef crap we have to do for
the current backport of netdevop'able drivers is below.

  Luis

> Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
> ---
>  config.mk                                 |    2 +
>  patches/01-netdev.patch                   |   51 +++++++++++++++++++++-----
>  patches/24-pcmcia.patch                   |   10 +++---
>  patches/27-hermes-read-pda-conflict.patch |   56 +++++++++++++++++++++++++++++
>  4 files changed, 104 insertions(+), 15 deletions(-)
>  create mode 100644 patches/27-hermes-read-pda-conflict.patch
>
> diff --git a/config.mk b/config.mk
> index 6a7c5c9..176c0af 100644
> --- a/config.mk
> +++ b/config.mk
> @@ -388,6 +388,8 @@ CONFIG_LIBERTAS_USB=m
>  NEED_LIBERTAS=y
>  endif
>
> +CONFIG_ORINOCO_USB=m
> +
>  endif # end of USB driver list
>
>  ifneq ($(CONFIG_SPI_MASTER),)
> diff --git a/patches/01-netdev.patch b/patches/01-netdev.patch
> index 01dbbce..51d12c4 100644
> --- a/patches/01-netdev.patch
> +++ b/patches/01-netdev.patch
> @@ -575,7 +575,7 @@ without creating a headache on maintenance of the pathes.
>        dev->tx_queue_len = 0;
>  --- a/drivers/net/wireless/orinoco/main.c
>  +++ b/drivers/net/wireless/orinoco/main.c
> -@@ -2078,6 +2078,7 @@ int orinoco_init(struct orinoco_private
> +@@ -2087,6 +2087,7 @@ int orinoco_init(struct orinoco_private
>  }
>  EXPORT_SYMBOL(orinoco_init);
>
> @@ -583,7 +583,7 @@ without creating a headache on maintenance of the pathes.
>  static const struct net_device_ops orinoco_netdev_ops = {
>        .ndo_open               = orinoco_open,
>        .ndo_stop               = orinoco_stop,
> -@@ -2089,6 +2090,7 @@ static const struct net_device_ops orino
> +@@ -2098,6 +2099,7 @@ static const struct net_device_ops orino
>        .ndo_tx_timeout         = orinoco_tx_timeout,
>        .ndo_get_stats          = orinoco_get_stats,
>  };
> @@ -591,12 +591,15 @@ without creating a headache on maintenance of the pathes.
>
>  /* Allocate private data.
>   *
> -@@ -2211,7 +2213,18 @@ int orinoco_if_add(struct orinoco_privat
> -
> -       /* Setup / override net_device fields */
> -       dev->ieee80211_ptr = wdev;
> +@@ -2227,10 +2229,21 @@ int orinoco_if_add(struct orinoco_privat
> +       dev->wireless_data = &priv->wireless_data;
> + #endif
> +       /* Default to standard ops if not set */
>  +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,29))
> -       dev->netdev_ops = &orinoco_netdev_ops;
> +       if (ops)
> +               dev->netdev_ops = ops;
> +       else
> +               dev->netdev_ops = &orinoco_netdev_ops;
>  +#else
>  +      dev->open = orinoco_open;
>  +      dev->stop = orinoco_stop;
> @@ -607,9 +610,37 @@ without creating a headache on maintenance of the pathes.
>  +      dev->tx_timeout = orinoco_tx_timeout;
>  +      dev->get_stats = orinoco_get_stats;
>  +#endif
> -       dev->watchdog_timeo = HZ; /* 1 second timeout */
> -       dev->wireless_handlers = &orinoco_handler_def;
> - #ifdef WIRELESS_SPY
> +
> +       /* we use the default eth_mac_addr for setting the MAC addr */
> +
> +--- a/drivers/net/wireless/orinoco/orinoco_usb.c
> ++++ b/drivers/net/wireless/orinoco/orinoco_usb.c
> +@@ -1566,6 +1566,7 @@ static const struct hermes_ops ezusb_ops
> +       .unlock_irq = ezusb_unlock_irq,
> + };
> +
> ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,29))
> + static const struct net_device_ops ezusb_netdev_ops = {
> +       .ndo_open               = orinoco_open,
> +       .ndo_stop               = orinoco_stop,
> +@@ -1577,6 +1578,7 @@ static const struct net_device_ops ezusb
> +       .ndo_tx_timeout         = orinoco_tx_timeout,
> +       .ndo_get_stats          = orinoco_get_stats,
> + };
> ++#endif
> +
> + static int ezusb_probe(struct usb_interface *interface,
> +                      const struct usb_device_id *id)
> +@@ -1722,6 +1724,9 @@ static int ezusb_probe(struct usb_interf
> +               err("%s: orinoco_if_add() failed", __func__);
> +               goto error;
> +       }
> ++#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,29))
> ++      priv->ndev->hard_start_xmit = ezusb_xmit;
> ++#endif
> +       upriv->dev = priv->ndev;
> +
> +       goto exit;
>  --- a/net/bluetooth/bnep/netdev.c
>  +++ b/net/bluetooth/bnep/netdev.c
>  @@ -168,8 +168,12 @@ static inline int bnep_net_proto_filter(
> diff --git a/patches/24-pcmcia.patch b/patches/24-pcmcia.patch
> index 283b30d..3bc395d 100644
> --- a/patches/24-pcmcia.patch
> +++ b/patches/24-pcmcia.patch
> @@ -251,9 +251,9 @@
>        /* Register an interface with the stack */
>        if (orinoco_if_add(priv, link->io.BasePort1,
>  +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35))
> -                          link->irq) != 0) {
> +                          link->irq, NULL) != 0) {
>  +#else
> -+                         link->irq.AssignedIRQ) != 0) {
> ++                         link->irq.AssignedIRQ, NULL) != 0) {
>  +#endif
>                printk(KERN_ERR PFX "orinoco_if_add() failed\n");
>                goto failed;
> @@ -285,14 +285,14 @@
>        if (ret)
>                goto failed;
>
> -@@ -359,7 +369,11 @@ spectrum_cs_config(struct pcmcia_device
> +@@ -360,7 +370,11 @@ spectrum_cs_config(struct pcmcia_device
>
>        /* Register an interface with the stack */
>        if (orinoco_if_add(priv, link->io.BasePort1,
>  +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35))
> -                          link->irq) != 0) {
> +                          link->irq, NULL) != 0) {
>  +#else
> -+                         link->irq.AssignedIRQ) != 0) {
> ++                         link->irq.AssignedIRQ, NULL) != 0) {
>  +#endif
>                printk(KERN_ERR PFX "orinoco_if_add() failed\n");
>                goto failed;
> diff --git a/patches/27-hermes-read-pda-conflict.patch b/patches/27-hermes-read-pda-conflict.patch
> new file mode 100644
> index 0000000..fe6b181
> --- /dev/null
> +++ b/patches/27-hermes-read-pda-conflict.patch
> @@ -0,0 +1,56 @@
> +Rename read_pda to something else because this symbol is used in a
> +define for something else in arch/um/include/asm/pda.h on older kernels.
> +
> +--- a/drivers/net/wireless/orinoco/fw.c
> ++++ b/drivers/net/wireless/orinoco/fw.c
> +@@ -122,7 +122,7 @@ orinoco_dl_firmware(struct orinoco_priva
> +       dev_dbg(dev, "Attempting to download firmware %s\n", firmware);
> +
> +       /* Read current plug data */
> +-      err = hw->ops->read_pda(hw, pda, fw->pda_addr, fw->pda_size);
> ++      err = hw->ops->read_pda_h(hw, pda, fw->pda_addr, fw->pda_size);
> +       dev_dbg(dev, "Read PDA returned %d\n", err);
> +       if (err)
> +               goto free;
> +@@ -224,7 +224,7 @@ symbol_dl_image(struct orinoco_private *
> +               if (!pda)
> +                       return -ENOMEM;
> +
> +-              ret = hw->ops->read_pda(hw, pda, fw->pda_addr, fw->pda_size);
> ++              ret = hw->ops->read_pda_h(hw, pda, fw->pda_addr, fw->pda_size);
> +               if (ret)
> +                       goto free;
> +       }
> +--- a/drivers/net/wireless/orinoco/hermes.c
> ++++ b/drivers/net/wireless/orinoco/hermes.c
> +@@ -765,7 +765,7 @@ static const struct hermes_ops hermes_op
> +       .write_ltv = hermes_write_ltv,
> +       .bap_pread = hermes_bap_pread,
> +       .bap_pwrite = hermes_bap_pwrite,
> +-      .read_pda = hermes_read_pda,
> ++      .read_pda_h = hermes_read_pda,
> +       .program_init = hermesi_program_init,
> +       .program_end = hermesi_program_end,
> +       .program = hermes_program_bytes,
> +--- a/drivers/net/wireless/orinoco/hermes.h
> ++++ b/drivers/net/wireless/orinoco/hermes.h
> +@@ -393,7 +393,7 @@ struct hermes_ops {
> +                        u16 id, u16 offset);
> +       int (*bap_pwrite)(struct hermes *hw, int bap, const void *buf,
> +                         int len, u16 id, u16 offset);
> +-      int (*read_pda)(struct hermes *hw, __le16 *pda,
> ++      int (*read_pda_h)(struct hermes *hw, __le16 *pda,
> +                       u32 pda_addr, u16 pda_len);
> +       int (*program_init)(struct hermes *hw, u32 entry_point);
> +       int (*program_end)(struct hermes *hw);
> +--- a/drivers/net/wireless/orinoco/orinoco_usb.c
> ++++ b/drivers/net/wireless/orinoco/orinoco_usb.c
> +@@ -1556,7 +1556,7 @@ static const struct hermes_ops ezusb_ops
> +       .read_ltv = ezusb_read_ltv,
> +       .write_ltv = ezusb_write_ltv,
> +       .bap_pread = ezusb_bap_pread,
> +-      .read_pda = ezusb_read_pda,
> ++      .read_pda_h = ezusb_read_pda,
> +       .program_init = ezusb_program_init,
> +       .program_end = ezusb_program_end,
> +       .program = ezusb_program,
> --
> 1.7.0.4
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>

^ permalink raw reply

* Re: [PATCH] compat: backport orinoco updates
From: Luis R. Rodriguez @ 2010-05-04 23:29 UTC (permalink / raw)
  To: Hauke Mehrtens; +Cc: linux-wireless, mcgrof
In-Reply-To: <1273012837-8325-1-git-send-email-hauke@hauke-m.de>

On Tue, May 4, 2010 at 3:40 PM, Hauke Mehrtens <hauke@hauke-m.de> wrote:
>
> Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
> ---
>  include/linux/compat-2.6.29.h |    2 ++
>  1 files changed, 2 insertions(+), 0 deletions(-)
>
> diff --git a/include/linux/compat-2.6.29.h b/include/linux/compat-2.6.29.h
> index c3572a2..2709953 100644
> --- a/include/linux/compat-2.6.29.h
> +++ b/include/linux/compat-2.6.29.h
> @@ -61,6 +61,8 @@ extern void usb_unpoison_anchored_urbs(struct usb_anchor *anchor);
>
>  extern int eth_mac_addr(struct net_device *dev, void *p);
>
> +#define orinoco_if_add(priv, base_addr, irq, ops) orinoco_if_add(priv, base_addr, irq)
> +
>  #endif /* (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,29)) */

Since we're going to have the netdevice ops available on older kernels
I'll skip this patch and first try by just backporting the netdevice
ops a bit differently. Thanks though.

  Luis

^ permalink raw reply

* Re: 2.6.34-rc6-git2: Reported regressions from 2.6.33
From: Linus Torvalds @ 2010-05-05  0:00 UTC (permalink / raw)
  To: Rafael J. Wysocki
  Cc: Linux Kernel Mailing List, Maciej Rutecki, Andrew Morton,
	Kernel Testers List, Network Development, Linux ACPI,
	Linux PM List, Linux SCSI List, Linux Wireless List, DRI
In-Reply-To: <JzEGxUyyQHG.A.ZtH.YHJ4LB@chimera>



On Tue, 4 May 2010, Rafael J. Wysocki wrote:
> 
> Unresolved regressions
> ----------------------
> 
> Bug-Entry	: http://bugzilla.kernel.org/show_bug.cgi?id=15880
> Subject		: Very bad regression from 2.6.33 as of 1600f9def
> Submitter	: Alex Elsayed <eternaleye@gmail.com>
> Date		: 2010-04-29 2:28 (6 days old)
> Message-ID	: <loom.20100429T041908-663@post.gmane.org>
> References	: http://marc.info/?l=linux-kernel&m=127250825306178&w=2

This looks like it wasn't a regression, but some other compile/install 
issue. See

	http://marc.info/?l=linux-kernel&m=127274294422719&w=2

where he reports that his self-compiled 2.6.33 doesn't boot either. 

There's some confusion about .config, but it might well be an install 
problem too (in fact, that sounds more likely - the original bug-report 
seems to reboot before the kernel has really even booted - it apparently 
hasn't done the graphics mode switch by the early bootloader)

		Linus

^ permalink raw reply

* Re: [PATCH] compat-wireless: updates for orinoco
From: Stephen Hemminger @ 2010-05-05  0:04 UTC (permalink / raw)
  To: Luis R. Rodriguez
  Cc: Hauke Mehrtens, David Miller, linux-wireless, mcgrof, netdev
In-Reply-To: <v2u43e72e891005041626n14deaca5z284f2472e909c923@mail.gmail.com>

On Tue, 4 May 2010 16:26:53 -0700
"Luis R. Rodriguez" <lrodriguez@atheros.com> wrote:

> First of all, thanks a lot! Some comments below.
> 
> On Tue, May 4, 2010 at 3:40 PM, Hauke Mehrtens <hauke@hauke-m.de> wrote:
> > * Make all the patches apply again.
> > * rename read_pda to avoid conflicts with definitions in kernel <= 2.6.29
> 
> I'm going to apply these two changes, if you get time can you send a
> patch to rename read_pda upstream as well, that way we don't have to
> carry this?
> 
> > * add orinoco usb
> 
> Thanks for this but I've grown tired of updating these netdev ops and
> I think we can do better. I'll add a netdev_attach_ops() which would
> simply do all the backport stuff for us, this way for backporting
> purposes all we have to do is replace the old lines with a
> netdev_attach_ops() call. In fact if we *really* wanted to we could
> add a dummy netdev_attach_ops() upstream and just backport that on
> older kernels, this would mean 0 line changes to backport a newer
> driver.
> 
> Something like this maybe on the generic compat module, it builds for
> me, will commit soon.
> 
> /*
>  * Expand this as drivers require more ops, for now this
>  * only sets the ones we need.
>  */
> void netdev_attach_ops(struct net_device *dev,
>                       const struct net_device_ops *ops)
> {
> #define SET_NETDEVOP(_op) (_op ? _op : NULL)
>        dev->open = SET_NETDEVOP(ops->ndo_open);
>        dev->stop = SET_NETDEVOP(ops->ndo_stop);
>        dev->hard_start_xmit = SET_NETDEVOP(ops->ndo_start_xmit);
>        dev->set_multicast_list = SET_NETDEVOP(ops->ndo_set_multicast_list);
>        dev->change_mtu = SET_NETDEVOP(ops->ndo_change_mtu);
>        dev->set_mac_address = SET_NETDEVOP(ops->ndo_set_mac_address);
>        dev->tx_timeout = SET_NETDEVOP(ops->ndo_tx_timeout);
>        dev->get_stats = SET_NETDEVOP(ops->ndo_get_stats);
> #undef SET_NETDEVOP
> }
> EXPORT_SYMBOL(netdev_attach_ops);
> 
> For newer kernels then this would just be:
> 
> static inline void netdev_attach_ops(struct net_device *dev,
>                       const struct net_device_ops *ops)
> {
>        dev->netdev_ops = ops;
> }
> 
> Stephen, would the above be acceptable upstream on netdevice.h ? It
> would eliminate all needs from having to #ifdef network drivers when
> backporting. If so I can send a respective patch and spatch all the
> setters I think. An example of the nasty ifdef crap we have to do for
> the current backport of netdevop'able drivers is below.
> 

No. supporting backporting is not part of the upstream kernel
mission. Honestly, we try for forward compatibility but intentionally
ignore carrying extra backport baggage.

^ permalink raw reply

* Re: [PATCH] compat-wireless: updates for orinoco
From: Luis R. Rodriguez @ 2010-05-05  0:18 UTC (permalink / raw)
  To: Stephen Hemminger
  Cc: Luis Rodriguez, Hauke Mehrtens, David Miller,
	linux-wireless@vger.kernel.org, mcgrof@kernel.org,
	netdev@vger.kernel.org
In-Reply-To: <20100504170409.46914a88@nehalam>

On Tue, May 04, 2010 at 05:04:09PM -0700, Stephen Hemminger wrote:
> On Tue, 4 May 2010 16:26:53 -0700
> "Luis R. Rodriguez" <lrodriguez@atheros.com> wrote:
> 
> > First of all, thanks a lot! Some comments below.
> > 
> > On Tue, May 4, 2010 at 3:40 PM, Hauke Mehrtens <hauke@hauke-m.de> wrote:
> > > * Make all the patches apply again.
> > > * rename read_pda to avoid conflicts with definitions in kernel <= 2.6.29
> > 
> > I'm going to apply these two changes, if you get time can you send a
> > patch to rename read_pda upstream as well, that way we don't have to
> > carry this?
> > 
> > > * add orinoco usb
> > 
> > Thanks for this but I've grown tired of updating these netdev ops and
> > I think we can do better. I'll add a netdev_attach_ops() which would
> > simply do all the backport stuff for us, this way for backporting
> > purposes all we have to do is replace the old lines with a
> > netdev_attach_ops() call. In fact if we *really* wanted to we could
> > add a dummy netdev_attach_ops() upstream and just backport that on
> > older kernels, this would mean 0 line changes to backport a newer
> > driver.
> > 
> > Something like this maybe on the generic compat module, it builds for
> > me, will commit soon.
> > 
> > /*
> >  * Expand this as drivers require more ops, for now this
> >  * only sets the ones we need.
> >  */
> > void netdev_attach_ops(struct net_device *dev,
> >                       const struct net_device_ops *ops)
> > {
> > #define SET_NETDEVOP(_op) (_op ? _op : NULL)
> >        dev->open = SET_NETDEVOP(ops->ndo_open);
> >        dev->stop = SET_NETDEVOP(ops->ndo_stop);
> >        dev->hard_start_xmit = SET_NETDEVOP(ops->ndo_start_xmit);
> >        dev->set_multicast_list = SET_NETDEVOP(ops->ndo_set_multicast_list);
> >        dev->change_mtu = SET_NETDEVOP(ops->ndo_change_mtu);
> >        dev->set_mac_address = SET_NETDEVOP(ops->ndo_set_mac_address);
> >        dev->tx_timeout = SET_NETDEVOP(ops->ndo_tx_timeout);
> >        dev->get_stats = SET_NETDEVOP(ops->ndo_get_stats);
> > #undef SET_NETDEVOP
> > }
> > EXPORT_SYMBOL(netdev_attach_ops);
> > 
> > For newer kernels then this would just be:
> > 
> > static inline void netdev_attach_ops(struct net_device *dev,
> >                       const struct net_device_ops *ops)
> > {
> >        dev->netdev_ops = ops;
> > }
> > 
> > Stephen, would the above be acceptable upstream on netdevice.h ? It
> > would eliminate all needs from having to #ifdef network drivers when
> > backporting. If so I can send a respective patch and spatch all the
> > setters I think. An example of the nasty ifdef crap we have to do for
> > the current backport of netdevop'able drivers is below.
> > 
> 
> No. supporting backporting is not part of the upstream kernel
> mission. Honestly, we try for forward compatibility but intentionally
> ignore carrying extra backport baggage.

Sure, understood, just had to try :), if only I could find a *good*
non-backport reason to have the netdev_attach_ops()...

  Luis

^ permalink raw reply

* Re: [PATCH] compat-wireless: updates for orinoco
From: Luis R. Rodriguez @ 2010-05-05  1:47 UTC (permalink / raw)
  To: Stephen Hemminger
  Cc: Luis Rodriguez, Hauke Mehrtens, David Miller,
	linux-wireless@vger.kernel.org, mcgrof@kernel.org,
	netdev@vger.kernel.org
In-Reply-To: <20100505001830.GO2624@tux>

On Tue, May 4, 2010 at 5:18 PM, Luis R. Rodriguez
<lrodriguez@atheros.com> wrote:
> On Tue, May 04, 2010 at 05:04:09PM -0700, Stephen Hemminger wrote:
>> On Tue, 4 May 2010 16:26:53 -0700
>> "Luis R. Rodriguez" <lrodriguez@atheros.com> wrote:
>>
>> > First of all, thanks a lot! Some comments below.
>> >
>> > On Tue, May 4, 2010 at 3:40 PM, Hauke Mehrtens <hauke@hauke-m.de> wrote:
>> > > * Make all the patches apply again.
>> > > * rename read_pda to avoid conflicts with definitions in kernel <= 2.6.29
>> >
>> > I'm going to apply these two changes, if you get time can you send a
>> > patch to rename read_pda upstream as well, that way we don't have to
>> > carry this?
>> >
>> > > * add orinoco usb
>> >
>> > Thanks for this but I've grown tired of updating these netdev ops and
>> > I think we can do better. I'll add a netdev_attach_ops() which would
>> > simply do all the backport stuff for us, this way for backporting
>> > purposes all we have to do is replace the old lines with a
>> > netdev_attach_ops() call. In fact if we *really* wanted to we could
>> > add a dummy netdev_attach_ops() upstream and just backport that on
>> > older kernels, this would mean 0 line changes to backport a newer
>> > driver.
>> >
>> > Something like this maybe on the generic compat module, it builds for
>> > me, will commit soon.
>> >
>> > /*
>> >  * Expand this as drivers require more ops, for now this
>> >  * only sets the ones we need.
>> >  */
>> > void netdev_attach_ops(struct net_device *dev,
>> >                       const struct net_device_ops *ops)
>> > {
>> > #define SET_NETDEVOP(_op) (_op ? _op : NULL)
>> >        dev->open = SET_NETDEVOP(ops->ndo_open);
>> >        dev->stop = SET_NETDEVOP(ops->ndo_stop);
>> >        dev->hard_start_xmit = SET_NETDEVOP(ops->ndo_start_xmit);
>> >        dev->set_multicast_list = SET_NETDEVOP(ops->ndo_set_multicast_list);
>> >        dev->change_mtu = SET_NETDEVOP(ops->ndo_change_mtu);
>> >        dev->set_mac_address = SET_NETDEVOP(ops->ndo_set_mac_address);
>> >        dev->tx_timeout = SET_NETDEVOP(ops->ndo_tx_timeout);
>> >        dev->get_stats = SET_NETDEVOP(ops->ndo_get_stats);
>> > #undef SET_NETDEVOP
>> > }
>> > EXPORT_SYMBOL(netdev_attach_ops);
>> >
>> > For newer kernels then this would just be:
>> >
>> > static inline void netdev_attach_ops(struct net_device *dev,
>> >                       const struct net_device_ops *ops)
>> > {
>> >        dev->netdev_ops = ops;
>> > }
>> >
>> > Stephen, would the above be acceptable upstream on netdevice.h ? It
>> > would eliminate all needs from having to #ifdef network drivers when
>> > backporting. If so I can send a respective patch and spatch all the
>> > setters I think. An example of the nasty ifdef crap we have to do for
>> > the current backport of netdevop'able drivers is below.
>> >
>>
>> No. supporting backporting is not part of the upstream kernel
>> mission. Honestly, we try for forward compatibility but intentionally
>> ignore carrying extra backport baggage.
>
> Sure, understood, just had to try :), if only I could find a *good*
> non-backport reason to have the netdev_attach_ops()...

FWIW, it helped a lot, porting an Ethernet driver for example consists
of a 1 line change to the driver, this goes down to 2.6.21 even. With
a netdev_attach_ops() upstream this would require 0 lines of code
changes. But --- I understand, I'll try to find a real value for it on
existing kernels.

 patches/01-netdev.patch |  625 ++++++-----------------------------------------
 1 files changed, 75 insertions(+), 550 deletions(-)

  Luis

^ permalink raw reply

* Re: [PATCH] ath9k: fix another source of corrupt frames
From: Luis R. Rodriguez @ 2010-05-05  5:25 UTC (permalink / raw)
  To: Felix Fietkau; +Cc: Luis Rodriguez, linux-wireless, John W. Linville
In-Reply-To: <20100504195500.GH2624@tux>

On Tue, May 4, 2010 at 12:55 PM, Luis R. Rodriguez
<lrodriguez@atheros.com> wrote:
> ath9k_rx_accept

So this guys is called only within ath9k_cmn_rx_skb_preprocess() and
that is only called by ath9k.. so yeah ath9k_htc no longer uses this
stuff. The patch is fine, please do merge John.

  Luis

^ permalink raw reply

* Re: [PATCH] cfg80211: Check for channel HT capabilities in an IBSS
From: Benoit Papillault @ 2010-05-05  6:28 UTC (permalink / raw)
  To: Luis R. Rodriguez; +Cc: johannes, linux-wireless
In-Reply-To: <o2h43e72e891005041114sb04fbfcbl7e1f144826a02479@mail.gmail.com>

Le 04/05/2010 20:14, Luis R. Rodriguez a écrit :
> On Mon, May 3, 2010 at 11:47 PM, Benoit Papillault
> <benoit.papillault@free.fr>  wrote:
>> When configuring an HT IBSS, we need to check if the specified channel
>> is capable of ht40+, ht40- or ht20.
>>
>> Signed-off-by: Benoit Papillault<benoit.papillault@free.fr>
>> ---
>>   net/wireless/nl80211.c |    8 ++++----
>>   1 files changed, 4 insertions(+), 4 deletions(-)
>>
>> diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c
>> index 8da9823..0a82623 100644
>> --- a/net/wireless/nl80211.c
>> +++ b/net/wireless/nl80211.c
>> @@ -3858,11 +3858,11 @@ static int nl80211_join_ibss(struct sk_buff *skb, struct genl_info *info)
>>                 ibss.ie_len = nla_len(info->attrs[NL80211_ATTR_IE]);
>>         }
>>
>> -       ibss.channel = ieee80211_get_channel(wiphy,
>> -               nla_get_u32(info->attrs[NL80211_ATTR_WIPHY_FREQ]));
>> +       ibss.channel = rdev_freq_to_chan(rdev,
>> +               nla_get_u32(info->attrs[NL80211_ATTR_WIPHY_FREQ]),
>> +               channel_type);
>>         if (!ibss.channel ||
>> -           ibss.channel->flags&  IEEE80211_CHAN_NO_IBSS ||
>> -           ibss.channel->flags&  IEEE80211_CHAN_DISABLED) {
>> +           ibss.channel->flags&  IEEE80211_CHAN_NO_IBSS) {
>>                 err = -EINVAL;
>
> Why is the disabled channel check being removed here?
>
>    Luis
>

Hi Luis,

It's because the check is already done in rdev_freq_to_chan.

Regards,
Benoit

^ permalink raw reply

* Re: [PATCH] cfg80211: Check for channel HT capabilities in an IBSS
From: Benoit Papillault @ 2010-05-05  6:29 UTC (permalink / raw)
  To: Johannes Berg; +Cc: linux-wireless
In-Reply-To: <1272961391.3673.3.camel@jlt3.sipsolutions.net>

Le 04/05/2010 10:23, Johannes Berg a écrit :
> On Tue, 2010-05-04 at 08:47 +0200, Benoit Papillault wrote:
>> When configuring an HT IBSS, we need to check if the specified channel
>> is capable of ht40+, ht40- or ht20.
>
> These first two patches cannot be separate.
>
> johannes
>
>

Right. Will repost a single patch including both.

Regards,
Benoit


^ permalink raw reply

* Re: [PATCH] mac80211: Add HT IE to IBSS beacons and probe responses.
From: Benoit Papillault @ 2010-05-05  6:37 UTC (permalink / raw)
  To: Johannes Berg; +Cc: linux-wireless
In-Reply-To: <1272961608.3673.7.camel@jlt3.sipsolutions.net>

Le 04/05/2010 10:26, Johannes Berg a écrit :
>
>> @@ -118,7 +119,10 @@ static void __ieee80211_sta_join_ibss(struct ieee80211_sub_if_data *sdata,
>>   		*pos++ = basic | (u8) (rate / 5);
>>   	}
>>
>> -	/* Build IBSS probe response */
>> +	/*
>> +	 * Build IBSS probe response template (also used for beacon template
>> +	 * in ieee80211_beacon_get_tim())
>> +	 */
>
> That change is wrong -- no way beacon code can call into IBSS code.

I meant the skb that is produced here and stored in ifibss->presp is 
then used both for sending beacons in ieee80211_beacon_get_tim and for 
sending probe response in ieee80211_rx_mgmt_probe_req

>
> I think you meant to say "I need to create a common helper function that
> I call here and in the beacon code."

You are right : I will add a helper function to create HT Capability IE.

>
>> --- a/net/mac80211/util.c
>> +++ b/net/mac80211/util.c
>> @@ -967,7 +967,7 @@ int ieee80211_build_preq_ies(struct ieee80211_local *local, u8 *buffer,
>>
>>   	if (sband->ht_cap.ht_supported) {
>>   		u16 cap = sband->ht_cap.cap;
>> -		__le16 tmp;
>> +		struct ieee80211_ht_cap ht_cap;
>>
>>   		if (ieee80211_disable_40mhz_24ghz&&
>>   		sband->band == IEEE80211_BAND_2GHZ) {
>> @@ -975,18 +975,19 @@ int ieee80211_build_preq_ies(struct ieee80211_local *local, u8 *buffer,
>>   			cap&= ~IEEE80211_HT_CAP_SGI_40;
>>   		}
>>
>> +		ht_cap.cap_info = cpu_to_le16(cap);
>> +		ht_cap.ampdu_params_info = sband->ht_cap.ampdu_factor |
>> +			(sband->ht_cap.ampdu_density<<
>> +			 IEEE80211_HT_AMPDU_PARM_DENSITY_SHIFT);
>> +		ht_cap.mcs = sband->ht_cap.mcs;
>> +		ht_cap.extended_ht_cap_info = cpu_to_le16(0);
>> +		ht_cap.tx_BF_cap_info = cpu_to_le32(0);
>> +		ht_cap.antenna_selection_info = 0;
>> +
>>   		*pos++ = WLAN_EID_HT_CAPABILITY;
>>   		*pos++ = sizeof(struct ieee80211_ht_cap);
>> -		memset(pos, 0, sizeof(struct ieee80211_ht_cap));
>> -		tmp = cpu_to_le16(cap);
>> -		memcpy(pos,&tmp, sizeof(u16));
>> -		pos += sizeof(u16);
>> -		*pos++ = sband->ht_cap.ampdu_factor |
>> -			 (sband->ht_cap.ampdu_density<<
>> -				IEEE80211_HT_AMPDU_PARM_DENSITY_SHIFT);
>> -		memcpy(pos,&sband->ht_cap.mcs, sizeof(sband->ht_cap.mcs));
>> -		pos += sizeof(sband->ht_cap.mcs);
>> -		pos += 2 + 4 + 1; /* ext info, BF cap, antsel */
>> +		memcpy(pos,&ht_cap, sizeof(struct ieee80211_ht_cap));
>> +		pos += sizeof(struct ieee80211_ht_cap);
>
> And this is an unrelated change that doesn't belong into this patch at
> all.
>
> johannes
>
>

Regards,
Benoit

^ permalink raw reply

* Re: [PATCH] compat-wireless: updates for orinoco
From: Johannes Berg @ 2010-05-05  6:45 UTC (permalink / raw)
  To: Luis R. Rodriguez; +Cc: Hauke Mehrtens, linux-wireless
In-Reply-To: <v2u43e72e891005041626n14deaca5z284f2472e909c923@mail.gmail.com>

On Tue, 2010-05-04 at 16:26 -0700, Luis R. Rodriguez wrote:

> void netdev_attach_ops(struct net_device *dev,
>                       const struct net_device_ops *ops)
> {
> #define SET_NETDEVOP(_op) (_op ? _op : NULL)

isn't that like the dumbest macro ever?

johannes


^ permalink raw reply

* [PATCH] mac80211: fix BSS info reconfiguration
From: Johannes Berg @ 2010-05-05  7:44 UTC (permalink / raw)
  To: John Linville; +Cc: linux-wireless, Reinette Chatre

When reconfiguring an interface due to a previous
hardware restart, mac80211 will currently include
the new IBSS flag on non-IBSS interfaces which may
confuse drivers.

Instead of doing the ~0 trick, simply spell out
which things are going to be reconfigured.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
---
 include/net/mac80211.h |    2 ++
 net/mac80211/util.c    |   25 ++++++++++++++++++++-----
 2 files changed, 22 insertions(+), 5 deletions(-)

--- wireless-testing.orig/include/net/mac80211.h	2010-05-01 08:47:54.000000000 +0200
+++ wireless-testing/include/net/mac80211.h	2010-05-05 09:41:46.000000000 +0200
@@ -160,6 +160,8 @@ enum ieee80211_bss_change {
 	BSS_CHANGED_BEACON_ENABLED	= 1<<9,
 	BSS_CHANGED_CQM			= 1<<10,
 	BSS_CHANGED_IBSS		= 1<<11,
+
+	/* when adding here, make sure to change ieee80211_reconfig */
 };
 
 /**
--- wireless-testing.orig/net/mac80211/util.c	2010-04-09 11:46:46.000000000 +0200
+++ wireless-testing/net/mac80211/util.c	2010-05-05 09:41:46.000000000 +0200
@@ -1160,18 +1160,33 @@ int ieee80211_reconfig(struct ieee80211_
 
 	/* Finally also reconfigure all the BSS information */
 	list_for_each_entry(sdata, &local->interfaces, list) {
-		u32 changed = ~0;
+		u32 changed;
+
 		if (!ieee80211_sdata_running(sdata))
 			continue;
+
+		/* common change flags for all interface types */
+		changed = BSS_CHANGED_ERP_CTS_PROT |
+			  BSS_CHANGED_ERP_PREAMBLE |
+			  BSS_CHANGED_ERP_SLOT |
+			  BSS_CHANGED_HT |
+			  BSS_CHANGED_BASIC_RATES |
+			  BSS_CHANGED_BEACON_INT |
+			  BSS_CHANGED_BSSID |
+			  BSS_CHANGED_CQM;
+
 		switch (sdata->vif.type) {
 		case NL80211_IFTYPE_STATION:
-			/* disable beacon change bits */
-			changed &= ~(BSS_CHANGED_BEACON |
-				     BSS_CHANGED_BEACON_ENABLED);
-			/* fall through */
+			changed |= BSS_CHANGED_ASSOC;
+			ieee80211_bss_info_change_notify(sdata, changed);
+			break;
 		case NL80211_IFTYPE_ADHOC:
+			changed |= BSS_CHANGED_IBSS;
+			/* fall through */
 		case NL80211_IFTYPE_AP:
 		case NL80211_IFTYPE_MESH_POINT:
+			changed |= BSS_CHANGED_BEACON |
+				   BSS_CHANGED_BEACON_ENABLED;
 			ieee80211_bss_info_change_notify(sdata, changed);
 			break;
 		case NL80211_IFTYPE_WDS:



^ permalink raw reply

* Re: [PATCH] mac80211: fix BSS info reconfiguration
From: Johannes Berg @ 2010-05-05  7:47 UTC (permalink / raw)
  To: John Linville; +Cc: linux-wireless, Reinette Chatre
In-Reply-To: <1273045442.3728.1.camel@jlt3.sipsolutions.net>

On Wed, 2010-05-05 at 09:44 +0200, Johannes Berg wrote:
> When reconfiguring an interface due to a previous
> hardware restart, mac80211 will currently include
> the new IBSS flag on non-IBSS interfaces which may
> confuse drivers.
> 
> Instead of doing the ~0 trick, simply spell out
> which things are going to be reconfigured.
> 
> Signed-off-by: Johannes Berg <johannes.berg@intel.com>

Oops, that might get confusing.

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

though I'm still me either way I think.

> ---
>  include/net/mac80211.h |    2 ++
>  net/mac80211/util.c    |   25 ++++++++++++++++++++-----
>  2 files changed, 22 insertions(+), 5 deletions(-)
> 
> --- wireless-testing.orig/include/net/mac80211.h	2010-05-01 08:47:54.000000000 +0200
> +++ wireless-testing/include/net/mac80211.h	2010-05-05 09:41:46.000000000 +0200
> @@ -160,6 +160,8 @@ enum ieee80211_bss_change {
>  	BSS_CHANGED_BEACON_ENABLED	= 1<<9,
>  	BSS_CHANGED_CQM			= 1<<10,
>  	BSS_CHANGED_IBSS		= 1<<11,
> +
> +	/* when adding here, make sure to change ieee80211_reconfig */
>  };
>  
>  /**
> --- wireless-testing.orig/net/mac80211/util.c	2010-04-09 11:46:46.000000000 +0200
> +++ wireless-testing/net/mac80211/util.c	2010-05-05 09:41:46.000000000 +0200
> @@ -1160,18 +1160,33 @@ int ieee80211_reconfig(struct ieee80211_
>  
>  	/* Finally also reconfigure all the BSS information */
>  	list_for_each_entry(sdata, &local->interfaces, list) {
> -		u32 changed = ~0;
> +		u32 changed;
> +
>  		if (!ieee80211_sdata_running(sdata))
>  			continue;
> +
> +		/* common change flags for all interface types */
> +		changed = BSS_CHANGED_ERP_CTS_PROT |
> +			  BSS_CHANGED_ERP_PREAMBLE |
> +			  BSS_CHANGED_ERP_SLOT |
> +			  BSS_CHANGED_HT |
> +			  BSS_CHANGED_BASIC_RATES |
> +			  BSS_CHANGED_BEACON_INT |
> +			  BSS_CHANGED_BSSID |
> +			  BSS_CHANGED_CQM;
> +
>  		switch (sdata->vif.type) {
>  		case NL80211_IFTYPE_STATION:
> -			/* disable beacon change bits */
> -			changed &= ~(BSS_CHANGED_BEACON |
> -				     BSS_CHANGED_BEACON_ENABLED);
> -			/* fall through */
> +			changed |= BSS_CHANGED_ASSOC;
> +			ieee80211_bss_info_change_notify(sdata, changed);
> +			break;
>  		case NL80211_IFTYPE_ADHOC:
> +			changed |= BSS_CHANGED_IBSS;
> +			/* fall through */
>  		case NL80211_IFTYPE_AP:
>  		case NL80211_IFTYPE_MESH_POINT:
> +			changed |= BSS_CHANGED_BEACON |
> +				   BSS_CHANGED_BEACON_ENABLED;
>  			ieee80211_bss_info_change_notify(sdata, changed);
>  			break;
>  		case NL80211_IFTYPE_WDS:
> 
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 



^ 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