* Re: [PATCH 2.6.17-rc6] Remove Prism II support from Orinoco
From: Dave Jones @ 2006-06-11 23:08 UTC (permalink / raw)
To: Kyle McMartin; +Cc: Faidon Liambotis, netdev
In-Reply-To: <20060611223140.GB1163@skunkworks.cabal.ca>
On Sun, Jun 11, 2006 at 06:31:40PM -0400, Kyle McMartin wrote:
> On Sun, Jun 11, 2006 at 06:40:54PM -0400, Dave Jones wrote:
> > Under hostap, it's a brick, it won't even report any scanning results.
> >
>
> Did you switch it into managed mode? The hostap driver, iirc, defaults
> to running in master (AP) mode.
Ah, yes, that gets it able to scan again, thanks.
This is another gotcha that is going to prevent a smooth transition
from orinoco->hostap for end users though.
Dave
--
http://www.codemonkey.org.uk
^ permalink raw reply
* [PATCH] [IrDA] irda-usb.c: STIR421x cleanups
From: Samuel Ortiz @ 2006-06-12 6:12 UTC (permalink / raw)
To: David S. Miller; +Cc: netdev, irda-users, Nick Fedchik
This patch is for the net-2.6.18 tree.
It cleans the STIR421x part of the irda-usb code. We also no longer try to
load all existing firmwares but only the matching one (according to the USB
id we get from the dongle).
Signed-off-by: Nick Fedchik <nfedchik@atlantic-link.com.ua>
Signed-off-by: Samuel Ortiz <samuel@sortiz.org>
---
drivers/net/irda/irda-usb.c | 327 +++++++++++++++++++------------------------
drivers/net/irda/irda-usb.h | 10 +
2 files changed, 145 insertions(+), 192 deletions(-)
946837ac4e7bb301a1fcef0046b2a72e8e81b57c
diff --git a/drivers/net/irda/irda-usb.c b/drivers/net/irda/irda-usb.c
index cd87593..844fa74 100644
--- a/drivers/net/irda/irda-usb.c
+++ b/drivers/net/irda/irda-usb.c
@@ -83,9 +83,9 @@ static struct usb_device_id dongles[] =
/* Extended Systems, Inc., XTNDAccess IrDA USB (ESI-9685) */
{ USB_DEVICE(0x8e9, 0x100), .driver_info = IUC_SPEED_BUG | IUC_NO_WINDOW },
/* SigmaTel STIR4210/4220/4116 USB IrDA (VFIR) Bridge */
- { USB_DEVICE(0x66f, 0x4210), .driver_info = IUC_STIR_4210 | IUC_SPEED_BUG },
- { USB_DEVICE(0x66f, 0x4220), .driver_info = IUC_STIR_4210 | IUC_SPEED_BUG },
- { USB_DEVICE(0x66f, 0x4116), .driver_info = IUC_STIR_4210 | IUC_SPEED_BUG },
+ { USB_DEVICE(0x66f, 0x4210), .driver_info = IUC_STIR421X | IUC_SPEED_BUG },
+ { USB_DEVICE(0x66f, 0x4220), .driver_info = IUC_STIR421X | IUC_SPEED_BUG },
+ { USB_DEVICE(0x66f, 0x4116), .driver_info = IUC_STIR421X | IUC_SPEED_BUG },
{ .match_flags = USB_DEVICE_ID_MATCH_INT_CLASS |
USB_DEVICE_ID_MATCH_INT_SUBCLASS,
.bInterfaceClass = USB_CLASS_APP_SPEC,
@@ -154,7 +154,7 @@ static void irda_usb_build_header(struct
* and if either speed or xbofs (or both) needs
* to be changed.
*/
- if (self->capability & IUC_STIR_4210 &&
+ if (self->capability & IUC_STIR421X &&
((self->new_speed != -1) || (self->new_xbofs != -1))) {
/* With STIR421x, speed and xBOFs must be set at the same
@@ -318,7 +318,7 @@ static void irda_usb_change_speed_xbofs(
/* Set the new speed and xbofs in this fake frame */
irda_usb_build_header(self, frame, 1);
- if ( self->capability & IUC_STIR_4210 ) {
+ if (self->capability & IUC_STIR421X) {
if (frame[0] == 0) return ; // do nothing if no change
frame[1] = 0; // other parameters don't change here
frame[2] = 0;
@@ -455,7 +455,7 @@ static int irda_usb_hard_xmit(struct sk_
/* Change setting for next frame */
- if ( self->capability & IUC_STIR_4210 ) {
+ if (self->capability & IUC_STIR421X) {
__u8 turnaround_time;
__u8* frame;
turnaround_time = get_turnaround_time( skb );
@@ -897,10 +897,13 @@ static void irda_usb_receive(struct urb
docopy = (urb->actual_length < IRDA_RX_COPY_THRESHOLD);
/* Allocate a new skb */
- if ( self->capability & IUC_STIR_4210 )
- newskb = dev_alloc_skb(docopy ? urb->actual_length : IRDA_SKB_MAX_MTU + USB_IRDA_SIGMATEL_HEADER);
+ if (self->capability & IUC_STIR421X)
+ newskb = dev_alloc_skb(docopy ? urb->actual_length :
+ IRDA_SKB_MAX_MTU +
+ USB_IRDA_STIR421X_HEADER);
else
- newskb = dev_alloc_skb(docopy ? urb->actual_length : IRDA_SKB_MAX_MTU);
+ newskb = dev_alloc_skb(docopy ? urb->actual_length :
+ IRDA_SKB_MAX_MTU);
if (!newskb) {
self->stats.rx_dropped++;
@@ -1022,188 +1025,140 @@ static int irda_usb_is_receiving(struct
return 0; /* For now */
}
-
-#define STIR421X_PATCH_PRODUCT_VERSION_STR "Product Version: "
-#define STIR421X_PATCH_COMPONENT_VERSION_STR "Component Version: "
-#define STIR421X_PATCH_DATA_TAG_STR "STMP"
-#define STIR421X_PATCH_FILE_VERSION_MAX_OFFSET 512 /* version info is before here */
-#define STIR421X_PATCH_FILE_IMAGE_MAX_OFFSET 512 /* patch image starts before here */
-#define STIR421X_PATCH_FILE_END_OF_HEADER_TAG 0x1A /* marks end of patch file header (PC DOS text file EOF character) */
+#define STIR421X_PATCH_PRODUCT_VER "Product Version: "
+#define STIR421X_PATCH_STMP_TAG "STMP"
+#define STIR421X_PATCH_CODE_OFFSET 512 /* patch image starts before here */
+/* marks end of patch file header (PC DOS text file EOF character) */
+#define STIR421X_PATCH_END_OF_HDR_TAG 0x1A
+#define STIR421X_PATCH_BLOCK_SIZE 1023
/*
- * Known firmware patches for STIR421x dongles
+ * Function stir421x_fwupload (struct irda_usb_cb *self,
+ * unsigned char *patch,
+ * const unsigned int patch_len)
+ *
+ * Upload firmware code to SigmaTel 421X IRDA-USB dongle
*/
-static char * stir421x_patches[] = {
- "42101001.sb",
- "42101002.sb",
-};
-
-static int stir421x_get_patch_version(unsigned char * patch, const unsigned long patch_len)
+static int stir421x_fw_upload(struct irda_usb_cb *self,
+ unsigned char *patch,
+ const unsigned int patch_len)
{
- unsigned int version_offset;
- unsigned long version_major, version_minor, version_build;
- unsigned char * version_start;
- int version_found = 0;
-
- for (version_offset = 0;
- version_offset < STIR421X_PATCH_FILE_END_OF_HEADER_TAG;
- version_offset++) {
- if (!memcmp(patch + version_offset,
- STIR421X_PATCH_PRODUCT_VERSION_STR,
- sizeof(STIR421X_PATCH_PRODUCT_VERSION_STR) - 1)) {
- version_found = 1;
- version_start = patch +
- version_offset +
- sizeof(STIR421X_PATCH_PRODUCT_VERSION_STR) - 1;
- break;
- }
+ int ret = -ENOMEM;
+ int actual_len = 0;
+ unsigned int i;
+ unsigned int block_size = 0;
+ unsigned char *patch_block;
+
+ patch_block = kzalloc(STIR421X_PATCH_BLOCK_SIZE, GFP_KERNEL);
+ if (patch_block == NULL)
+ return -ENOMEM;
+
+ /* break up patch into 1023-byte sections */
+ for (i = 0; i < patch_len; i += block_size) {
+ block_size = patch_len - i;
+
+ if (block_size > STIR421X_PATCH_BLOCK_SIZE)
+ block_size = STIR421X_PATCH_BLOCK_SIZE;
+
+ /* upload the patch section */
+ memcpy(patch_block, patch + i, block_size);
+
+ ret = usb_bulk_msg(self->usbdev,
+ usb_sndbulkpipe(self->usbdev,
+ self->bulk_out_ep),
+ patch_block, block_size,
+ &actual_len, msecs_to_jiffies(500));
+ IRDA_DEBUG(3,"%s(): Bulk send %u bytes, ret=%d\n",
+ __FUNCTION__, actual_len, ret);
+
+ if (ret < 0)
+ break;
}
- /* We couldn't find a product version on this patch */
- if (!version_found)
- return -EINVAL;
-
- /* Let's check if the product version is dotted */
- if (version_start[3] != '.' ||
- version_start[7] != '.')
- return -EINVAL;
-
- version_major = simple_strtoul(version_start, NULL, 10);
- version_minor = simple_strtoul(version_start + 4, NULL, 10);
- version_build = simple_strtoul(version_start + 8, NULL, 10);
-
- IRDA_DEBUG(2, "%s(), Major: %ld Minor: %ld Build: %ld\n",
- __FUNCTION__,
- version_major, version_minor, version_build);
-
- return (((version_major) << 12) +
- ((version_minor) << 8) +
- ((version_build / 10) << 4) +
- (version_build % 10));
-
-}
-
-
-static int stir421x_upload_patch (struct irda_usb_cb *self,
- unsigned char * patch,
- const unsigned int patch_len)
-{
- int retval = 0;
- int actual_len;
- unsigned int i = 0, download_amount = 0;
- unsigned char * patch_chunk;
-
- IRDA_DEBUG (2, "%s(), Uploading STIR421x Patch\n", __FUNCTION__);
-
- patch_chunk = kzalloc(STIR421X_MAX_PATCH_DOWNLOAD_SIZE, GFP_KERNEL);
- if (patch_chunk == NULL)
- return -ENOMEM;
-
- /* break up patch into 1023-byte sections */
- for (i = 0; retval >= 0 && i < patch_len; i += download_amount) {
- download_amount = patch_len - i;
- if (download_amount > STIR421X_MAX_PATCH_DOWNLOAD_SIZE)
- download_amount = STIR421X_MAX_PATCH_DOWNLOAD_SIZE;
-
- /* download the patch section */
- memcpy(patch_chunk, patch + i, download_amount);
-
- retval = usb_bulk_msg (self->usbdev,
- usb_sndbulkpipe (self->usbdev,
- self->bulk_out_ep),
- patch_chunk, download_amount,
- &actual_len, msecs_to_jiffies (500));
- IRDA_DEBUG (2, "%s(), Sent %u bytes\n", __FUNCTION__,
- actual_len);
- if (retval == 0)
- mdelay(10);
- }
-
- kfree(patch_chunk);
-
- if (i != patch_len) {
- IRDA_ERROR ("%s(), Pushed %d bytes (!= patch_len (%d))\n",
- __FUNCTION__, i, patch_len);
- retval = -EIO;
- }
-
- if (retval < 0)
- /* todo - mark device as not ready */
- IRDA_ERROR ("%s(), STIR421x patch upload failed (%d)\n",
- __FUNCTION__, retval);
-
- return retval;
-}
+ kfree(patch_block);
+ return ret;
+ }
+/*
+ * Function stir421x_patch_device(struct irda_usb_cb *self)
+ *
+ * Get a firmware code from userspase using hotplug request_firmware() call
+ */
static int stir421x_patch_device(struct irda_usb_cb *self)
{
- unsigned int i, patch_found = 0, data_found = 0, data_offset;
- int patch_version, ret = 0;
- const struct firmware *fw_entry;
-
- for (i = 0; i < ARRAY_SIZE(stir421x_patches); i++) {
- if(request_firmware(&fw_entry, stir421x_patches[i], &self->usbdev->dev) != 0) {
- IRDA_ERROR( "%s(), Patch %s is not available\n", __FUNCTION__, stir421x_patches[i]);
- continue;
- }
-
- /* We found a patch from userspace */
- patch_version = stir421x_get_patch_version (fw_entry->data, fw_entry->size);
-
- if (patch_version < 0) {
- /* Couldn't fetch a version, let's move on to the next file */
- IRDA_ERROR("%s(), version parsing failed\n", __FUNCTION__);
- ret = patch_version;
- release_firmware(fw_entry);
- continue;
- }
-
- if (patch_version != self->usbdev->descriptor.bcdDevice) {
- /* Patch version and device don't match */
- IRDA_ERROR ("%s(), wrong patch version (%d <-> %d)\n",
- __FUNCTION__,
- patch_version, self->usbdev->descriptor.bcdDevice);
- ret = -EINVAL;
- release_firmware(fw_entry);
- continue;
- }
-
- /* If we're here, we've found a correct patch */
- patch_found = 1;
- break;
-
- }
-
- /* We couldn't find a valid firmware, let's leave */
- if (!patch_found)
- return ret;
-
- /* The actual image starts after the "STMP" keyword */
- for (data_offset = 0; data_offset < STIR421X_PATCH_FILE_IMAGE_MAX_OFFSET; data_offset++) {
- if (!memcmp(fw_entry->data + data_offset,
- STIR421X_PATCH_DATA_TAG_STR,
- sizeof(STIR421X_PATCH_FILE_IMAGE_MAX_OFFSET))) {
- IRDA_DEBUG(2, "%s(), found patch data for STIR421x at offset %d\n",
- __FUNCTION__, data_offset);
- data_found = 1;
- break;
- }
- }
-
- /* We couldn't find "STMP" from the header */
- if (!data_found)
- return -EINVAL;
-
- /* Let's upload the patch to the target */
- ret = stir421x_upload_patch(self,
- &fw_entry->data[data_offset + sizeof(STIR421X_PATCH_FILE_IMAGE_MAX_OFFSET)],
- fw_entry->size - (data_offset + sizeof(STIR421X_PATCH_FILE_IMAGE_MAX_OFFSET)));
-
- release_firmware(fw_entry);
-
- return ret;
-
+ unsigned int i;
+ int ret;
+ char stir421x_fw_name[11];
+ const struct firmware *fw;
+ unsigned char *fw_version_ptr; /* pointer to version string */
+ unsigned long fw_version = 0;
+
+ /*
+ * Known firmware patch file names for STIR421x dongles
+ * are "42101001.sb" or "42101002.sb"
+ */
+ sprintf(stir421x_fw_name, "4210%4X.sb",
+ self->usbdev->descriptor.bcdDevice);
+ ret = request_firmware(&fw, stir421x_fw_name, &self->usbdev->dev);
+ if (ret < 0)
+ return ret;
+
+ /* We get a patch from userspace */
+ IRDA_MESSAGE("%s(): Received firmware %s (%u bytes)\n",
+ __FUNCTION__, stir421x_fw_name, fw->size);
+
+ ret = -EINVAL;
+
+ /* Get the bcd product version */
+ if (!memcmp(fw->data, STIR421X_PATCH_PRODUCT_VER,
+ sizeof(STIR421X_PATCH_PRODUCT_VER) - 1)) {
+ fw_version_ptr = fw->data +
+ sizeof(STIR421X_PATCH_PRODUCT_VER) - 1;
+
+ /* Let's check if the product version is dotted */
+ if (fw_version_ptr[3] == '.' &&
+ fw_version_ptr[7] == '.') {
+ unsigned long major, minor, build;
+ major = simple_strtoul(fw_version_ptr, NULL, 10);
+ minor = simple_strtoul(fw_version_ptr + 4, NULL, 10);
+ build = simple_strtoul(fw_version_ptr + 8, NULL, 10);
+
+ fw_version = (major << 12)
+ + (minor << 8)
+ + ((build / 10) << 4)
+ + (build % 10);
+
+ IRDA_DEBUG(3, "%s(): Firmware Product version %ld\n",
+ __FUNCTION__, fw_version);
+ }
+ }
+
+ if (self->usbdev->descriptor.bcdDevice == fw_version) {
+ /*
+ * If we're here, we've found a correct patch
+ * The actual image starts after the "STMP" keyword
+ * so forward to the firmware header tag
+ */
+ for (i = 0; (fw->data[i] != STIR421X_PATCH_END_OF_HDR_TAG)
+ && (i < fw->size); i++) ;
+ /* here we check for the out of buffer case */
+ if ((STIR421X_PATCH_END_OF_HDR_TAG == fw->data[i])
+ && (i < STIR421X_PATCH_CODE_OFFSET)) {
+ if (!memcmp(fw->data + i + 1, STIR421X_PATCH_STMP_TAG,
+ sizeof(STIR421X_PATCH_STMP_TAG) - 1)) {
+
+ /* We can upload the patch to the target */
+ i += sizeof(STIR421X_PATCH_STMP_TAG);
+ ret = stir421x_fw_upload(self, &fw->data[i],
+ fw->size - i);
+ }
+ }
+ }
+
+ release_firmware(fw);
+
+ return ret;
}
@@ -1702,12 +1657,12 @@ static int irda_usb_probe(struct usb_int
init_timer(&self->rx_defer_timer);
self->capability = id->driver_info;
- self->needspatch = ((self->capability & IUC_STIR_4210) != 0) ;
+ self->needspatch = ((self->capability & IUC_STIR421X) != 0);
/* Create all of the needed urbs */
- if (self->capability & IUC_STIR_4210) {
+ if (self->capability & IUC_STIR421X) {
self->max_rx_urb = IU_SIGMATEL_MAX_RX_URBS;
- self->header_length = USB_IRDA_SIGMATEL_HEADER;
+ self->header_length = USB_IRDA_STIR421X_HEADER;
} else {
self->max_rx_urb = IU_MAX_RX_URBS;
self->header_length = USB_IRDA_HEADER;
@@ -1813,8 +1768,8 @@ static int irda_usb_probe(struct usb_int
/* Now we fetch and upload the firmware patch */
ret = stir421x_patch_device(self);
self->needspatch = (ret < 0);
- if (ret < 0) {
- printk("patch_device failed\n");
+ if (self->needspatch) {
+ IRDA_ERROR("STIR421X: Couldn't upload patch\n");
goto err_out_5;
}
diff --git a/drivers/net/irda/irda-usb.h b/drivers/net/irda/irda-usb.h
index d833db5..6b2271f 100644
--- a/drivers/net/irda/irda-usb.h
+++ b/drivers/net/irda/irda-usb.h
@@ -34,9 +34,6 @@ #include <linux/time.h>
#include <net/irda/irda.h>
#include <net/irda/irda_device.h> /* struct irlap_cb */
-#define PATCH_FILE_SIZE_MAX 65536
-#define PATCH_FILE_SIZE_MIN 80
-
#define RX_COPY_THRESHOLD 200
#define IRDA_USB_MAX_MTU 2051
#define IRDA_USB_SPEED_MTU 64 /* Weird, but work like this */
@@ -107,14 +104,15 @@ #define IUC_SIR_ONLY 0x08 /* Device does
#define IUC_SMALL_PKT 0x10 /* Device doesn't behave with big Rx packets */
#define IUC_MAX_WINDOW 0x20 /* Device underestimate the Rx window */
#define IUC_MAX_XBOFS 0x40 /* Device need more xbofs than advertised */
-#define IUC_STIR_4210 0x80 /* SigmaTel 4210/4220/4116 VFIR */
+#define IUC_STIR421X 0x80 /* SigmaTel 4210/4220/4116 VFIR */
/* USB class definitions */
#define USB_IRDA_HEADER 0x01
#define USB_CLASS_IRDA 0x02 /* USB_CLASS_APP_SPEC subclass */
#define USB_DT_IRDA 0x21
-#define USB_IRDA_SIGMATEL_HEADER 0x03
-#define IU_SIGMATEL_MAX_RX_URBS (IU_MAX_ACTIVE_RX_URBS + USB_IRDA_SIGMATEL_HEADER)
+#define USB_IRDA_STIR421X_HEADER 0x03
+#define IU_SIGMATEL_MAX_RX_URBS (IU_MAX_ACTIVE_RX_URBS + \
+ USB_IRDA_STIR421X_HEADER)
struct irda_class_desc {
__u8 bLength;
--
1.3.3
^ permalink raw reply related
* Re: [PATCH 2.6.17-rc6] Remove Prism II support from Orinoco
From: Kyle McMartin @ 2006-06-11 22:31 UTC (permalink / raw)
To: Dave Jones; +Cc: Faidon Liambotis, netdev
In-Reply-To: <20060611224054.GB13139@redhat.com>
On Sun, Jun 11, 2006 at 06:40:54PM -0400, Dave Jones wrote:
> Under hostap, it's a brick, it won't even report any scanning results.
>
Did you switch it into managed mode? The hostap driver, iirc, defaults
to running in master (AP) mode.
Cheers,
Kyle
^ permalink raw reply
* Re: [PATCH 2.6.17-rc6] Remove Prism II support from Orinoco
From: Dave Jones @ 2006-06-11 22:40 UTC (permalink / raw)
To: Faidon Liambotis; +Cc: netdev
In-Reply-To: <20060611222719.GA13139@redhat.com>
On Sun, Jun 11, 2006 at 06:27:19PM -0400, Dave Jones wrote:
> On Sat, Jun 10, 2006 at 02:08:50PM -0400, Dave Jones wrote:
> > On Sat, Jun 10, 2006 at 08:50:10PM +0300, Faidon Liambotis wrote:
> > > Remove Prism II IDs from the orinoco driver since now we have a separate
> > > driver for them (HostAP). Additionally, kill orinoco_{pci,plx,nortel}
> > > completely, since they only exist to support Prism cards.
> > > No attempt was made to clean up the rest of the driver of the actual
> > > Prism II code, only the PCI IDs were removed.
> >
> > I'm fairly certain I have a buffalo card that doesn't work with hostap
> > that works just fine with orinoco. I'll dig it out and see if that
> > has been improved.
>
> Objection rescinded, I have a WLI-PCM-L11G, which this patch doesn't affect.
Ah-ha, I had tested the wrong card.
I also have a Sitecom card, which matches this ident you remove in your patch..
PCMCIA_DEVICE_MANF_CARD(0xd601, 0x0002), /* Safeway 802.11b, ZCOMAX AirRunner/XI-300 */
pccardctl ident shows it as:
Socket 0:
product info: " ", "IEEE 802.11 Wireless LAN/PC Card", "", ""
manfid: 0xd601, 0x0002
function: 6 (network)
Under hostap, it's a brick, it won't even report any scanning results.
pccard: PCMCIA card inserted into slot 0
pcmcia: registering new device pcmcia0.0
ieee80211_crypt: registered algorithm 'NULL'
hostap_cs: 0.4.4-kernel (Jouni Malinen <jkmaline@cc.hut.fi>)
hostap_cs: setting Vcc=33 (constant)
Checking CFTABLE_ENTRY 0x01 (default 0x01)
IO window settings: cfg->io.nwin=1 dflt.io.nwin=1
io->flags = 0x0046, io.base=0x0000, len=64
hostap_cs: Registered netdevice wifi0
hostap_cs: index 0x01: , irq 4, io 0x0100-0x013f
prism2_hw_init: initialized in 108 ms
wifi0: NIC: id=0x8002 v1.0.0
wifi0: PRI: id=0x15 v0.3.0
wifi0: STA: id=0x1f v1.3.4
wifi0: defaulting to host-based encryption as a workaround for firmware bug in Host AP mode WEP
wifi0: defaulting to bogus WDS frame as a workaround for firmware bug in Host AP mode WDS
wifi0: registered netdevice wlan0
Scan result translation succeeded (length=0)
With orinoco however, it works just fine..
(Asides from the irritating feature of orinoco that the interface has to be 'up'
before an iwlist scanning works)
pccard: PCMCIA card inserted into slot 0
pcmcia: registering new device pcmcia0.0
eth1: Hardware identity 8002:0000:0001:0000
eth1: Station identity 001f:0004:0001:0003
eth1: Firmware determined as Intersil 1.3.4
eth1: Ad-hoc demo mode supported
eth1: IEEE standard IBSS ad-hoc mode supported
eth1: WEP supported, 104-bit key
eth1: MAC address 00:60:B3:68:AE:9B
eth1: Station name "Prism I"
eth1: ready
eth1: index 0x01: , irq 4, io 0x0100-0x013f
ADDRCONF(NETDEV_UP): eth1: link is not ready
eth1: New link status: Connected (0001)
ADDRCONF(NETDEV_CHANGE): eth1: link becomes ready
So with your patch, this card will become totally useless to me.
Dave
--
http://www.codemonkey.org.uk
^ permalink raw reply
* Re: [PATCH 2.6.17-rc6] Remove Prism II support from Orinoco
From: Dave Jones @ 2006-06-11 22:27 UTC (permalink / raw)
To: Faidon Liambotis; +Cc: netdev
In-Reply-To: <20060610180850.GP7420@redhat.com>
On Sat, Jun 10, 2006 at 02:08:50PM -0400, Dave Jones wrote:
> On Sat, Jun 10, 2006 at 08:50:10PM +0300, Faidon Liambotis wrote:
> > Remove Prism II IDs from the orinoco driver since now we have a separate
> > driver for them (HostAP). Additionally, kill orinoco_{pci,plx,nortel}
> > completely, since they only exist to support Prism cards.
> > No attempt was made to clean up the rest of the driver of the actual
> > Prism II code, only the PCI IDs were removed.
>
> I'm fairly certain I have a buffalo card that doesn't work with hostap
> that works just fine with orinoco. I'll dig it out and see if that
> has been improved.
Objection rescinded, I have a WLI-PCM-L11G, which this patch doesn't affect.
One question though. People who are currently using orinoco will have
networking scripts set up by their distros autodetection mechanisms to
set up an 'ethX' interface. Switching to hostap by default will change
their interface to a wlanX interface, requiring them to either edit
their networking interface scripts, or to add dev_template parameters
to their /etc/modprobe.conf
Whichever is chosen, the upgrade process is going to blindside end-users
into broken wireless. Maybe things would just transparently keep working
if the default template was also ethX. Though that would cause breakage
for anyone with a currently working 'wlanX' interface on upgrade.
Hmm, tricky.
Dave
--
http://www.codemonkey.org.uk
^ permalink raw reply
* [PATCH] zd1211rw: disable TX queue during stop
From: Daniel Drake @ 2006-06-11 22:18 UTC (permalink / raw)
To: linville; +Cc: netdev
This avoids some potential races.
Signed-off-by: Daniel Drake <dsd@gentoo.org>
diff --git a/drivers/net/wireless/zd1211rw/zd_mac.c b/drivers/net/wireless/zd1211rw/zd_mac.c
index bbe067e..3bdc54d 100644
--- a/drivers/net/wireless/zd1211rw/zd_mac.c
+++ b/drivers/net/wireless/zd1211rw/zd_mac.c
@@ -197,6 +197,8 @@ int zd_mac_stop(struct net_device *netde
struct zd_mac *mac = zd_netdev_mac(netdev);
struct zd_chip *chip = &mac->chip;
+ netif_stop_queue(netdev);
+
/*
* The order here deliberately is a little different from the open()
* method, since we need to make sure there is no opportunity for RX
^ permalink raw reply related
* Re: [PATCH] [2.6.17-rc6] Section mismatch in drivers/net/ne.o during modpost
From: Sam Ravnborg @ 2006-06-11 21:54 UTC (permalink / raw)
To: Mikael Pettersson; +Cc: rdunlap, akpm, jgarzik, linux-kernel, netdev
In-Reply-To: <200606111437.k5BEbVu5021415@harpo.it.uu.se>
On Sun, Jun 11, 2006 at 04:37:31PM +0200, Mikael Pettersson wrote:
> On Sat, 10 Jun 2006 22:38:00 +0200, Sam Ravnborg wrote:
> >> --- linux-2617-rc6.orig/drivers/net/ne.c
> >> +++ linux-2617-rc6/drivers/net/ne.c
> >> @@ -829,7 +829,7 @@ that the ne2k probe is the last 8390 bas
> >> is at boot) and so the probe will get confused by any other 8390 cards.
> >> ISA device autoprobes on a running machine are not recommended anyway. */
> >>
> >> -int init_module(void)
> >> +int __init init_module(void)
> >> {
> >> int this_dev, found = 0;
> >
> >When you anyway touches the driver I suggest to name the function
> ><module>_init, <module>_cleanup and use module_init(), module_cleanup().
>
> Maybe not: in the ne.c driver init_module() is inside #ifdef MODULE,
> so conversion to ne_init() + module_init(ne_init) would be a no-op
> except for making the code larger. In the non-MODULE case Space.c
> calls ne_probe() directly.
The whole purpose of marking a function __init is to place in in a
section that can be discarded after init. This has the added advantage
that it kills off some ugly #ifdef MODULE / #endif as is the case for
ne.c
Even if not discarded then the code cleaniness is preferable to #ifdef /
#endif if purpose is only to save a few bytes.
Shifting to module_init(), module_cleanup() is the only right thing to
do - and the old behaviour is not even documented in LDD3 anymore.
[At least I did not find it last time I searched].
Sam
^ permalink raw reply
* Re: [patch 7/8] lock validator: fix ns83820.c irq-flags bug
From: Benjamin LaHaise @ 2006-06-11 20:28 UTC (permalink / raw)
To: Jeff Garzik; +Cc: akpm, netdev, mingo, arjan
In-Reply-To: <448C4C7A.7020301@garzik.org>
> The above code snippet removes the nested unlock-irq, but now the code
> is unbalanced, so IMO this patch _adds_ confusion.
>
> I think the conservative patch for 2.6.17 is the one I have attached.
> Unless there are objections, that is what I will forward...
This looks reasonable and sufficiently conservative. Reworking locking is
something that I'm a bit more hesitant about, although folding misc_lock
in with the other locks perhaps makes sense. I would like to keep the
split between tx and tx completion, though. Also, any rework is going to
need real testing, which is not something that a simple release cycle is
likely to get enough coverage on.
-ben
--
"Time is of no importance, Mr. President, only life is important."
Don't Email: <dont@kvack.org>.
^ permalink raw reply
* IEEE80211 Regulatory/Geographical Support for WLAN driver
From: Ulrich Kunitz @ 2006-06-11 20:21 UTC (permalink / raw)
To: Larry Finger; +Cc: netdev
In-Reply-To: <448C48CF.50205@lwfinger.net>
On 06-06-11 11:46 Larry Finger wrote:
> I don't see any means for the daemon to know its country other than the
> driver or the user telling it. If such a means exists, I would like to
> learn of it. My current working model is to supply the country code from a
> module option when the driver is loaded.
I thought about a config option. However thinking about they whole
thing more, I believe the functionality of your daemon should be
included into WPA supplicant and should use it's user space
communication mechanisms. It will become the universal WLAN user
space daemon anyhow. The second best option would be to extend
udev and reuse the firmware loading code.
BTW creating a file with 0666 is almost always a bad idea, even if
it exists only a "short" time.
Kind regards,
Uli
--
Uli Kunitz
^ permalink raw reply
* Re: [PATCH RFC] netpoll: don't spin forever sending to stopped queues
From: Matt Mackall @ 2006-06-11 20:04 UTC (permalink / raw)
To: Jeremy Fitzhardinge; +Cc: Linux Kernel Mailing List, netdev
In-Reply-To: <4488D9D6.6070205@goop.org>
On Thu, Jun 08, 2006 at 07:15:50PM -0700, Jeremy Fitzhardinge wrote:
> Matt Mackall wrote:
> >That's odd. Netpoll holds a reference to the device, of course, but so
> >does a normal "up" interface. So that shouldn't be the problem.
> >Another possibility is that outgoing packets from printks in the
> >driver are causing difficulty. Not sure what can be done about that.
> >
> Here's a patch. I haven't tested it beyond compiling it, and I don't
> know if it is actually correct. In this case, it seems pointless to
> spin waiting for an even which will never happen. Should
> netif_poll_disable() cause netpoll_send_skb() (or something) to not even
> bother trying to send? netif_poll_disable seems mysteriously simple to me.
>
> J
Did this work for you at all?
> When transmitting a skb in netpoll_send_skb(), only retry a limited
> number of times if the device queue is stopped.
Where limited = once?
> Signed-off-by: Jeremy Fitzhardinge <jeremy@goop.org>
>
> diff -r aac813f54617 net/core/netpoll.c
> --- a/net/core/netpoll.c Wed Jun 07 14:53:40 2006 -0700
> +++ b/net/core/netpoll.c Thu Jun 08 19:00:29 2006 -0700
> @@ -280,15 +280,10 @@ static void netpoll_send_skb(struct netp
> * network drivers do not expect to be called if the queue is
> * stopped.
> */
> - if (netif_queue_stopped(np->dev)) {
> - np->dev->xmit_lock_owner = -1;
> - spin_unlock(&np->dev->xmit_lock);
> - netpoll_poll(np);
> - udelay(50);
> - continue;
> - }
> -
> - status = np->dev->hard_start_xmit(skb, np->dev);
> + status = NETDEV_TX_BUSY;
> + if (!netif_queue_stopped(np->dev))
> + status = np->dev->hard_start_xmit(skb, np->dev);
> +
> np->dev->xmit_lock_owner = -1;
> spin_unlock(&np->dev->xmit_lock);
>
>
>
--
Mathematics is the supreme nostalgia of our time.
^ permalink raw reply
* Re: [patch 7/8] lock validator: fix ns83820.c irq-flags bug
From: Arjan van de Ven @ 2006-06-11 17:02 UTC (permalink / raw)
To: Jeff Garzik; +Cc: akpm, netdev, mingo, bcrl
In-Reply-To: <448C4C7A.7020301@garzik.org>
> The above code snippet removes the nested unlock-irq, but now the code
> is unbalanced, so IMO this patch _adds_ confusion.
>
> I think the conservative patch for 2.6.17 is the one I have attached.
> Unless there are objections, that is what I will forward...
this looks entirely fair and reasonable
Acked-by: Arjan van de Ven <arjan@linux.intel.com>
^ permalink raw reply
* Re: [patch 7/8] lock validator: fix ns83820.c irq-flags bug
From: Jeff Garzik @ 2006-06-11 17:01 UTC (permalink / raw)
To: akpm; +Cc: netdev, mingo, arjan, bcrl
In-Reply-To: <200606090519.k595JmDG032032@shell0.pdx.osdl.net>
[-- Attachment #1: Type: text/plain, Size: 819 bytes --]
akpm@osdl.org wrote:
> diff -puN drivers/net/ns83820.c~lock-validator-fix-ns83820c-irq-flags-bug drivers/net/ns83820.c
> --- devel/drivers/net/ns83820.c~lock-validator-fix-ns83820c-irq-flags-bug 2006-06-08 22:18:34.000000000 -0700
> +++ devel-akpm/drivers/net/ns83820.c 2006-06-08 22:18:48.000000000 -0700
> @@ -804,7 +804,7 @@ static int ns83820_setup_rx(struct net_d
>
> writel(dev->IMR_cache, dev->base + IMR);
> writel(1, dev->base + IER);
> - spin_unlock_irq(&dev->misc_lock);
> + spin_unlock(&dev->misc_lock);
>
> kick_rx(ndev);
>
The above code snippet removes the nested unlock-irq, but now the code
is unbalanced, so IMO this patch _adds_ confusion.
I think the conservative patch for 2.6.17 is the one I have attached.
Unless there are objections, that is what I will forward...
Jeff
[-- Attachment #2: patch --]
[-- Type: text/plain, Size: 1156 bytes --]
diff --git a/drivers/net/ns83820.c b/drivers/net/ns83820.c
index 706aed7..cee0e74 100644
--- a/drivers/net/ns83820.c
+++ b/drivers/net/ns83820.c
@@ -776,9 +776,11 @@ static int ns83820_setup_rx(struct net_d
ret = rx_refill(ndev, GFP_KERNEL);
if (!ret) {
+ unsigned long flags;
+
dprintk("starting receiver\n");
/* prevent the interrupt handler from stomping on us */
- spin_lock_irq(&dev->rx_info.lock);
+ spin_lock_irqsave(&dev->rx_info.lock, flags);
writel(0x0001, dev->base + CCSR);
writel(0, dev->base + RFCR);
@@ -790,7 +792,7 @@ static int ns83820_setup_rx(struct net_d
phy_intr(ndev);
/* Okay, let it rip */
- spin_lock_irq(&dev->misc_lock);
+ spin_lock(&dev->misc_lock);
dev->IMR_cache |= ISR_PHY;
dev->IMR_cache |= ISR_RXRCMP;
//dev->IMR_cache |= ISR_RXERR;
@@ -804,11 +806,11 @@ static int ns83820_setup_rx(struct net_d
writel(dev->IMR_cache, dev->base + IMR);
writel(1, dev->base + IER);
- spin_unlock_irq(&dev->misc_lock);
+ spin_unlock(&dev->misc_lock);
kick_rx(ndev);
- spin_unlock_irq(&dev->rx_info.lock);
+ spin_unlock_irqrestore(&dev->rx_info.lock, flags);
}
return ret;
}
^ permalink raw reply related
* Re: [RFC ] [1 of 4] IEEE802.11 Regulatory/Geographical Support for drivers - statement of project
From: Larry Finger @ 2006-06-11 16:46 UTC (permalink / raw)
To: netdev
In-Reply-To: <20060611100750.GF24167@p15091797.pureserver.info>
Uli,
Ulrich Kunitz wrote:
> Larry,
>
> I've not read your patches your detail, so I comment only on your
> description.
>
>
> The problem is the driver doesn't have good ideas, whether the
> device is outdoor and in which country it operates. Devices have
> some information available, but I have definitely a device
> marketed in Canada, which had an EEPROM value for ETSI as
> regulatory domain. I would expect the daemon to know, in which
> country it is and whether the device is used outdoors. Keep also
> in mind, that this information will be available from the AP at a
> later time.
I agree that once the AP is broadcasting the country code, this all gets easier. I have a problem
similar to yours in that my interface's EEPROM supplies a code that indicates the world, which leads
to the bcm43xx driver code setting 2.4 GHz channels 1 - 14 and then running active scans on all of
them. Of course in the US 12, 13 and 14 are illegal and could lead to legal action if the FCC were
monitoring outside my house.
I don't see any means for the daemon to know its country other than the driver or the user telling
it. If such a means exists, I would like to learn of it. My current working model is to supply the
country code from a module option when the driver is loaded.
> So there should be an explicit method to request the minimum set
> or the configuration of daemon. Later the set can be changed again
> by the AP information provided.
If the daemon is not running, if the country code is " ", or if it doesn't match any country in the
database, the minimum set is supplied, but the driver could call the routine again if it learned
more about its environment.
>> b) It then creates a new directory, '/proc/net/ieee80211_geo', and
>> populates it with 2 files for communication with the daemon. The first,
>> which is read by the daemon, contains the country and outdoor codes, and
>> the second is for the the daemon to write the 'struct ieee80211_geo' data
>> corresponding to the country and indoor/outdoor information passed from the
>> kernel.
>
> Michael Buesch already commented on /proc/net. I don't think, that
> this will be popular with a lot of folks. sysfs should be
> supported and the mechanism should be comparable to firmware
> loading. Maybe this could be some kind of udev extension. And make
> it device specific, the whole approach should not break, if you
> are accessing two devices connecting to two different access
> points at the same time, where one of them is configured by the
> central networking folks, who don't bother to adapt there configs
> to specific countries and the other is a perfectly conformant
> local AP, which is used for "testing" purposes.
Based on Michael's comments, I have changed the kernel - user space communication to use sysfs
rather than procfs. It also uses only a single mode 0666 file in /sys for communication. The deamon
spins waiting for that file to exist, then reads it to get the country and in/out flags. It then
writes the geo binary data to the file, closes it, delays a while and then repeats. After the geo
data are read, the kernel routine deletes the kobjects that create the sysfs file, loads the geo
data into the location supplied by the driver, and exits. Because the /sys file exists for only a
short time, I don't think that having it world writable will cause any problems. In addition, the
data supplied are thoroughly checked to make sure that it has the proper data for geo information.
If the 0666 mode is a problem, the daemon may have to become root to write the data.
Because, the geo data is loaded into a data area that is specific to each device, I don't expect any
problem with the situation you describe even if the same driver is operating both devices. If I have
missed some nuance, please enlighten me.
>> 2. The user-space daemon, which need not be run as root, does the following:
>
> It needs only to run temporarily run as root. I would definitely
> recommend that all file parsing activities should not run as root.
At present, it does everything as an unprivileged user.
>> e) It then spins waiting for the existence of file
>> '/proc/net/ieee80211_geo/country', which is the indication that the kernel
>> is requesting data.
>
> Again the whole interface should be device specific.
This part I don't understand. Everything in the geo data is generic to ieee802.11 devices. As I
stated earlier, it will end up in the private data for the device, but I don't see any reason for
the daemon to know which device is going to use the data.
Thanks for your comments,
Larry
^ permalink raw reply
* Re: [PATCH 1/2] PHYLIB: Add get_link ethtool helper function
From: Jeff Garzik @ 2006-06-11 16:13 UTC (permalink / raw)
To: Nathaniel Case; +Cc: Andy Fleming, netdev, galak
In-Reply-To: <1149551292.10700.47.camel@localhost.localdomain>
Nathaniel Case wrote:
> This adds a phy_ethtool_get_link() function along the same lines as
> phy_ethtool_gset(). This provides drivers utilizing PHYLIB an
> alternative to using ethtool_op_get_link(). This is more desirable
> since the "Link detected" field in ethtool would actually reflect the
> state of the PHY register.
>
> Patch depends on previous patch (0/2).
>
> Signed-off-by: Nate Case <ncase@xes-inc.com>
> Signed-off-by: Andy Fleming <afleming@freescale.com>
NAK, needs an EXPORT
^ permalink raw reply
* Re: [patch 7/8] lock validator: fix ns83820.c irq-flags bug
From: Arjan van de Ven @ 2006-06-11 16:12 UTC (permalink / raw)
To: Jeff Garzik; +Cc: akpm, netdev, mingo, bcrl
In-Reply-To: <448C4021.80102@garzik.org>
Jeff Garzik wrote:
> Arjan van de Ven wrote:
>> Jeff Garzik wrote:
>>> The driver's locking is definitely wrong, but I don't think this is
>>> the fix,
>>
>> it's an obvious correct fix in the correctness sense though...
>>
>>>
>>> Jesus, the locking here is awful. No wonder there are bugs.
>>
>>
>> ... which given that fact, is for 2.6.17 probably the right thing,
>> pending
>> a nicer fix for 2.6.18
>
> I disagree, the patch is wrong too.
wrong as in "not quite optimal", not wrong as in "buggy".
> For normal PCI hardware, the in-ISR paths should all use spin_lock(),
only for per hardware locks obviously, not for per driver locks ;)
you are right that it's a lot nicer to do what you describe. No argument
from me on that part. But to call it "wrong" or "incorrect" is not quite
ok. In terms of changing/fixing the approach we did was the simplest one.
Not the "make it look nice" one. Fix it by making the bug go away in the light
of a LOT of fishy locking.
You can demand that we first fix all the fishy locking first, and I can even
in part agree with that, but for -stable and 2.6.17 that is obviously out
of scope while a simple "make the bug go away" fix is not.
^ permalink raw reply
* Re: [patch 7/8] lock validator: fix ns83820.c irq-flags bug
From: Jeff Garzik @ 2006-06-11 16:09 UTC (permalink / raw)
To: Arjan van de Ven; +Cc: akpm, netdev, mingo, bcrl
In-Reply-To: <448C2FFE.3010002@linux.intel.com>
Arjan van de Ven wrote:
> Jeff Garzik wrote:
>> The driver's locking is definitely wrong, but I don't think this is
>> the fix,
>
> it's an obvious correct fix in the correctness sense though...
>
>>
>> Jesus, the locking here is awful. No wonder there are bugs.
>
>
> ... which given that fact, is for 2.6.17 probably the right thing, pending
> a nicer fix for 2.6.18
I disagree, the patch is wrong too.
For normal PCI hardware, the in-ISR paths should all use spin_lock(),
and the outside-ISR paths should use either spin_lock_irq() or
spin_lock_irqsave().
Jeff
^ permalink raw reply
* [PATCH] SoftMAC: Add network to ieee80211softmac_call_events when associate times out
From: Joseph Jezak @ 2006-06-11 16:01 UTC (permalink / raw)
To: NetDev, bcm43xx-dev
The ieee80211softmac_call_events function, when called with event type
IEEE80211SOFTMAC_EVENT_ASSOCIATE_TIMEOUT should pass the network as the
third parameter. This patch does that.
Signed-off-by: Joseph Jezak <josejx@gentoo.org>
---
diff --git a/net/ieee80211/softmac/ieee80211softmac_assoc.c b/net/ieee80211/softmac/ieee80211softmac_assoc.c
index aa65a7e..f9f7c8d 100644
--- a/net/ieee80211/softmac/ieee80211softmac_assoc.c
+++ b/net/ieee80211/softmac/ieee80211softmac_assoc.c
@@ -61,6 +61,7 @@ void
ieee80211softmac_assoc_timeout(void *d)
{
struct ieee80211softmac_device *mac = (struct ieee80211softmac_device *)d;
+ struct ieee80211softmac_network *n;
unsigned long flags;
spin_lock_irqsave(&mac->lock, flags);
@@ -73,11 +74,12 @@ ieee80211softmac_assoc_timeout(void *d)
mac->associnfo.associating = 0;
mac->associnfo.bssvalid = 0;
mac->associated = 0;
+
+ n = ieee80211softmac_get_network_by_bssid_locked(mac, mac->associnfo.bssid);
spin_unlock_irqrestore(&mac->lock, flags);
dprintk(KERN_INFO PFX "assoc request timed out!\n");
- /* FIXME: we need to know the network here. that requires a bit of restructuring */
- ieee80211softmac_call_events(mac, IEEE80211SOFTMAC_EVENT_ASSOCIATE_TIMEOUT, NULL);
+ ieee80211softmac_call_events(mac, IEEE80211SOFTMAC_EVENT_ASSOCIATE_TIMEOUT, n);
}
/* Sends out a disassociation request to the desired AP */
^ permalink raw reply related
* [PATCH] SoftMAC: Prevent multiple authentication attempts on the same network
From: Joseph Jezak @ 2006-06-11 16:00 UTC (permalink / raw)
To: NetDev; +Cc: bcm43xx-dev
This patch addresses the "No queue exists" messages commonly seen during
authentication and associating. These appear due to scheduling multiple
authentication attempts on the same network. To prevent this, I added a
flag to stop multiple authentication attempts by the association layer.
I also added a check to the wx handler to see if we're connecting to a
different network than the one already in progress. This scenario was
causing multiple requests on the same network because the network BSSID
was not being updated despite the fact that the ESSID changed.
Signed-off-by: Joseph Jezak <josejx@gentoo.org>
---
diff --git a/include/net/ieee80211softmac.h b/include/net/ieee80211softmac.h
index 052ed59..82a299a 100644
--- a/include/net/ieee80211softmac.h
+++ b/include/net/ieee80211softmac.h
@@ -101,6 +101,7 @@ struct ieee80211softmac_assoc_info {
*/
u8 static_essid:1,
associating:1,
+ assoc_wait:1,
bssvalid:1,
bssfixed:1;
diff --git a/net/ieee80211/softmac/ieee80211softmac_assoc.c b/net/ieee80211/softmac/ieee80211softmac_assoc.c
index 57ea9f6..aa65a7e 100644
--- a/net/ieee80211/softmac/ieee80211softmac_assoc.c
+++ b/net/ieee80211/softmac/ieee80211softmac_assoc.c
@@ -47,9 +47,7 @@ ieee80211softmac_assoc(struct ieee80211s
dprintk(KERN_INFO PFX "sent association request!\n");
- /* Change the state to associating */
spin_lock_irqsave(&mac->lock, flags);
- mac->associnfo.associating = 1;
mac->associated = 0; /* just to make sure */
/* Set a timer for timeout */
@@ -181,6 +179,10 @@ ieee80211softmac_assoc_work(void *d)
/* meh */
if (mac->associated)
ieee80211softmac_disassoc(mac, WLAN_REASON_DISASSOC_STA_HAS_LEFT);
+
+ spin_lock_irqsave(&mac->lock, flags);
+ mac->associnfo.associating = 1;
+ spin_unlock_irqrestore(&mac->lock, flags);
/* try to find the requested network in our list, if we found one already */
if (mac->associnfo.bssvalid || mac->associnfo.bssfixed)
@@ -274,19 +276,32 @@ ieee80211softmac_assoc_work(void *d)
memcpy(mac->associnfo.associate_essid.data, found->essid.data, IW_ESSID_MAX_SIZE + 1);
/* we found a network! authenticate (if necessary) and associate to it. */
- if (!found->authenticated) {
+ if (found->authenticating) {
+ dprintk(KERN_INFO PFX "Already requested authentication, waiting...\n");
+ if(!mac->associnfo.assoc_wait) {
+ mac->associnfo.assoc_wait = 1;
+ ieee80211softmac_notify_internal(mac, IEEE80211SOFTMAC_EVENT_ANY, found, ieee80211softmac_assoc_notify, NULL, GFP_KERNEL);
+ }
+ return;
+ }
+ if (!found->authenticated && !found->authenticating) {
/* This relies on the fact that _auth_req only queues the work,
* otherwise adding the notification would be racy. */
if (!ieee80211softmac_auth_req(mac, found)) {
- dprintk(KERN_INFO PFX "cannot associate without being authenticated, requested authentication\n");
- ieee80211softmac_notify_internal(mac, IEEE80211SOFTMAC_EVENT_ANY, found, ieee80211softmac_assoc_notify, NULL, GFP_KERNEL);
+ if(!mac->associnfo.assoc_wait) {
+ dprintk(KERN_INFO PFX "Cannot associate without being authenticated, requested authentication\n");
+ mac->associnfo.assoc_wait = 1;
+ ieee80211softmac_notify_internal(mac, IEEE80211SOFTMAC_EVENT_ANY, found, ieee80211softmac_assoc_notify, NULL, GFP_KERNEL);
+ }
} else {
printkl(KERN_WARNING PFX "Not authenticated, but requesting authentication failed. Giving up to associate\n");
+ mac->associnfo.assoc_wait = 0;
ieee80211softmac_call_events(mac, IEEE80211SOFTMAC_EVENT_ASSOCIATE_FAILED, found);
}
return;
}
/* finally! now we can start associating */
+ mac->associnfo.assoc_wait = 0;
ieee80211softmac_assoc(mac, found);
}
diff --git a/net/ieee80211/softmac/ieee80211softmac_auth.c b/net/ieee80211/softmac/ieee80211softmac_auth.c
index 06e3326..23125ae 100644
--- a/net/ieee80211/softmac/ieee80211softmac_auth.c
+++ b/net/ieee80211/softmac/ieee80211softmac_auth.c
@@ -36,8 +36,9 @@ ieee80211softmac_auth_req(struct ieee802
struct ieee80211softmac_auth_queue_item *auth;
unsigned long flags;
- if (net->authenticating)
+ if (net->authenticating || net->authenticated)
return 0;
+ net->authenticating = 1;
/* Add the network if it's not already added */
ieee80211softmac_add_network(mac, net);
@@ -92,7 +93,6 @@ ieee80211softmac_auth_queue(void *data)
return;
}
net->authenticated = 0;
- net->authenticating = 1;
/* add a timeout call so we eventually give up waiting for an auth reply */
schedule_delayed_work(&auth->work, IEEE80211SOFTMAC_AUTH_TIMEOUT);
auth->retry--;
diff --git a/net/ieee80211/softmac/ieee80211softmac_wx.c b/net/ieee80211/softmac/ieee80211softmac_wx.c
index 27edb2b..abd5f9c 100644
--- a/net/ieee80211/softmac/ieee80211softmac_wx.c
+++ b/net/ieee80211/softmac/ieee80211softmac_wx.c
@@ -70,12 +70,44 @@ ieee80211softmac_wx_set_essid(struct net
char *extra)
{
struct ieee80211softmac_device *sm = ieee80211_priv(net_dev);
+ struct ieee80211softmac_network *n;
+ struct ieee80211softmac_auth_queue_item *authptr;
int length = 0;
unsigned long flags;
-
+
+ /* Check if we're already associating to this or another network
+ * If it's another network, cancel and start over with our new network
+ * If it's our network, ignore the change, we're already doing it!
+ */
+ if((sm->associnfo.associating || sm->associated) &&
+ (data->essid.flags && data->essid.length && extra)) {
+ /* Get the associating network */
+ n = ieee80211softmac_get_network_by_bssid(sm, sm->associnfo.bssid);
+ if(n && n->essid.len == (data->essid.length - 1) &&
+ !memcmp(n->essid.data, extra, n->essid.len)) {
+ dprintk(KERN_INFO PFX "Already associating or associated to "MAC_FMT"\n",
+ MAC_ARG(sm->associnfo.bssid));
+ return 0;
+ } else {
+ dprintk(KERN_INFO PFX "Canceling existing associate request!\n");
+ spin_lock_irqsave(&sm->lock,flags);
+ /* Cancel assoc work */
+ cancel_delayed_work(&sm->associnfo.work);
+ /* We don't have to do this, but it's a little cleaner */
+ list_for_each_entry(authptr, &sm->auth_queue, list)
+ cancel_delayed_work(&authptr->work);
+ sm->associnfo.bssvalid = 0;
+ sm->associnfo.bssfixed = 0;
+ spin_unlock_irqrestore(&sm->lock,flags);
+ flush_scheduled_work();
+ }
+ }
+
+
spin_lock_irqsave(&sm->lock, flags);
-
+
sm->associnfo.static_essid = 0;
+ sm->associnfo.assoc_wait = 0;
if (data->essid.flags && data->essid.length && extra /*required?*/) {
length = min(data->essid.length - 1, IW_ESSID_MAX_SIZE);
^ permalink raw reply related
* Re: [RFC ] [2 of 4] IEEE802.11 Regulatory/Geographical Support for drivers - database
From: Larry Finger @ 2006-06-11 15:59 UTC (permalink / raw)
To: netdev
In-Reply-To: <20060611094236.GE24167@p15091797.pureserver.info>
Hi Uli,
Thanks for the comments.
Ulrich Kunitz wrote:
> two minor comments.
>
> 1. I appreciate that you are keeping everything in 80 character
> lines. So I believe the one line extending 80 characters is an
> oversight.
I have tried, but will watch that more carefully.
>
> 2. Could you just add a simple explanation for the pow column for
> the uninformed reader?
It was described in the initial text material that was not sent out. I have duplicated that info at
the beginning of each type of group description, and have added it to the header on the debug output
as follows:
AT, HR, CY, CZ, DK, EE, EU, FI, FR, GF, DE, VA, HU, IE, IT, LV, LT, LU, MK, MT
NL, PL, RE, SI, SE, GB
Indoor Group 1 with 18 channels in 5 GHz bands
Chn Freq Pow(dBm) Flags
36 5180 23 PASSIVE H_RULES
40 5200 23 PASSIVE H_RULES
44 5220 23 PASSIVE H_RULES
48 5240 23 PASSIVE H_RULES
52 5260 23 PASSIVE H_RULES
Larry
^ permalink raw reply
* Re: [patch 7/8] lock validator: fix ns83820.c irq-flags bug
From: Arjan van de Ven @ 2006-06-11 15:00 UTC (permalink / raw)
To: Jeff Garzik; +Cc: akpm, netdev, mingo, bcrl
In-Reply-To: <448C2EEE.1020405@garzik.org>
Jeff Garzik wrote:
> The driver's locking is definitely wrong, but I don't think this is the
> fix,
it's an obvious correct fix in the correctness sense though...
>
> Jesus, the locking here is awful. No wonder there are bugs.
... which given that fact, is for 2.6.17 probably the right thing, pending
a nicer fix for 2.6.18
I fully agree with you that the locking is trying to be WAAAY too smart
for it's own good, and that a much simpler scheme is called for.
^ permalink raw reply
* Re: [patch 7/8] lock validator: fix ns83820.c irq-flags bug
From: Jeff Garzik @ 2006-06-11 14:55 UTC (permalink / raw)
To: akpm, arjan; +Cc: netdev, mingo, bcrl
In-Reply-To: <200606090519.k595JmDG032032@shell0.pdx.osdl.net>
akpm@osdl.org wrote:
> From: Ingo Molnar <mingo@elte.hu>
>
> Barry K. Nathan reported the following lockdep warning:
>
> [ 197.343948] BUG: warning at kernel/lockdep.c:1856/trace_hardirqs_on()
> [ 197.345928] [<c010329b>] show_trace_log_lvl+0x5b/0x105
> [ 197.346359] [<c0103896>] show_trace+0x1b/0x20
> [ 197.346759] [<c01038ed>] dump_stack+0x1f/0x24
> [ 197.347159] [<c012efa2>] trace_hardirqs_on+0xfb/0x185
> [ 197.348873] [<c029b009>] _spin_unlock_irq+0x24/0x2d
> [ 197.350620] [<e09034e8>] do_tx_done+0x171/0x179 [ns83820]
> [ 197.350895] [<e090445c>] ns83820_irq+0x149/0x20b [ns83820]
> [ 197.351166] [<c013b4b8>] handle_IRQ_event+0x1d/0x52
> [ 197.353216] [<c013c6c2>] handle_level_irq+0x97/0xe1
> [ 197.355157] [<c01048c3>] do_IRQ+0x8b/0xac
> [ 197.355612] [<c0102d9d>] common_interrupt+0x25/0x2c
The driver's locking is definitely wrong, but I don't think this is the
fix, because PCI drivers with a single interrupt should be using
spin_lock() in the interrupt handler. Anything more would be uncivilized :)
/me starts to do a better patch...
Jesus, the locking here is awful. No wonder there are bugs.
Since this driver isn't seeing a ton of work these days, I think the
best thing to do would be to _simplify_ the locking. This driver is
grabbing so many locks, turning interrupts off+on so often that any
benefit the multiple locks had is probably long gone, particularly on
modern machines.
Let me see what I can do with it...
Jeff
^ permalink raw reply
* Re: [PATCH] [2.6.17-rc6] Section mismatch in drivers/net/ne.o during modpost
From: Mikael Pettersson @ 2006-06-11 14:37 UTC (permalink / raw)
To: rdunlap, sam; +Cc: akpm, jgarzik, linux-kernel, netdev
On Sat, 10 Jun 2006 22:38:00 +0200, Sam Ravnborg wrote:
>> --- linux-2617-rc6.orig/drivers/net/ne.c
>> +++ linux-2617-rc6/drivers/net/ne.c
>> @@ -829,7 +829,7 @@ that the ne2k probe is the last 8390 bas
>> is at boot) and so the probe will get confused by any other 8390 cards.
>> ISA device autoprobes on a running machine are not recommended anyway. */
>>
>> -int init_module(void)
>> +int __init init_module(void)
>> {
>> int this_dev, found = 0;
>
>When you anyway touches the driver I suggest to name the function
><module>_init, <module>_cleanup and use module_init(), module_cleanup().
Maybe not: in the ne.c driver init_module() is inside #ifdef MODULE,
so conversion to ne_init() + module_init(ne_init) would be a no-op
except for making the code larger. In the non-MODULE case Space.c
calls ne_probe() directly.
/Mikael
^ permalink raw reply
* Hello
From: Mrs. Florence Lloyd @ 2006-06-11 13:53 UTC (permalink / raw)
To: netdev
[-- Attachment #1: Type: text/plain, Size: 1813 bytes --]
DDear Sir,
Haven found you listed in the World Trade Centre Chambers of Commerce directory of my country, I find it pleasurable to offer you my partnership in business, for which purpose I have tried to call your telephone number several times but it seems disconnected or changed, I only pray at this time that your address is still valid.
I am contacting you regarding a brief for the Investment of Twenty Five Million Dollars (US$ 25,000,000:00) in your country, as I presently have a client who is interested in investing in your country, but haven never done business in your country before. I find it imperative to solicit for a partnership.
Hence upon receipt of this letter, I implore you to kindly respond and let me know how possible it is to work with you in mutual partnership under the conditions that:
1. My client's fund is held in cash.
2. My client is willing to invest immediately.
3. My client will pay you a commission of 15% of the investment fund for logistics and protocols.
4. My client desires absolute confidentiality in the handling and management of this brief.
I must draw your attention to the fact that I have kept the information's herein this letter stated brief; as I do not know if you will receive this letter and or what your response will be, If you do have the interest and the capability to partner with me under the above stated conditionality, I will appreciate your response sent back to me by fax or call me Immediately.
I will appreciate that you include a brief profile of your self and your company for me to better appreciate your personality. I look forward to your response and our partnership.
Have a nice day.
Sincerely Yours.
Mrs. Florence Lloyd
Lloyds Investment Consulting UK
Tel: + 44 7031958835
Email: lloydsinvestment.consult@yahoo.co.uk
^ permalink raw reply
* http://bugzilla.kernel.org/show_bug.cgi?id=6197
From: Andrew Morton @ 2006-06-11 12:51 UTC (permalink / raw)
To: netdev; +Cc: Patrick McHardy
The reporter claims this is a netfilter bug.
^ permalink raw reply
* UNHERALDED NEWS WITH COMMENTS: About rising interest rates and much more
From: info @ 2006-06-12 0:36 UTC (permalink / raw)
To: netdev
Reply-To: Edward
Subscribe here (twice weekly):http://straitgateministry.net
UNHERALDED NEWS WITH COMMENTS: About rising interest rates, gifts to Israel, Christian-Zionism on the march, Wall Street and Oil....
READ THE FULL STORIES HERE: http://straitgateministry.net (Unheralded News)
"My Name is Rachel Corrie" is banned in New York theaters
Albawaba Jun 08, 2006
"The impact of this decision is enormous--it is bigger than Rachel and bigger than this play," Cindy Corrie, Rachel's mother, said. "There was something about this play that made them (Israeli Patriots?) feel so vulnerable.
'CENTRIST' DEMOCRATS SOUND WARNING About 'Liberal Fundamentalism'
CNSNews.com Jun 07, 2006
"MoveOn.org's political action committee recently endorsed Lieberman Democratic challenger, noting grassroots frustration with Lieberman's "continued support for the war in Iraq" and his support for "Big Oil's energy bill."
WILL BUSH'S APPEAL TO RELIGIOUS RIGHT on gay marriage backfire among Jews?
JTA Jun 06, 2006
Another rut in the road between Israel and the "Christian Right;" 75% of American Jews tell us the favor homosexual marriage, and the Christian Right overwhelmingly claims to opposes it. But don't worry, its only a lover's spat, Christian-Zionist is Judaism. -Ed.
FED WARNING
Associated Press Jun 06, 2006
So far this year, inflation at the consumer level has been elevated in large part by rising energy prices, Bernanke said. As measured by the Consumer Price Index, "core" inflation rose at an annual rate of 3.2 percent over the last three months and 2.8 percent over the past six months. "These are unwelcome developments," he said.
ISRAEL SAYS HAS 200 NUCLEAR WARHEADS
Global News Service of the Jewish people (JTA) Jun 06, 2006
Editor Asks: Why would a peace loving country need 200 nuclear warheads? Would that not be five or ten bombs for every population area in the Mideast?
AMNESTY INTERNATIONAL COUNTS Israeli/Palestinian kill rate
JTA Global News Service for Jewish People
Israel has always maintained a reprisal ratio of about 5 executed Philistines for every Israeli lost to bomb or bullet. The ratio is much higher among children, about 8 to 1. Historically this ratio has varied but always 3 or more Palestinians are executed for every Israeli death.- ed
HILLARY SEEKS 'ENERGY REVOLUTION' with spending scheme
CNSNews.com
"Greater fuel efficiency and a $50 billion research fund" is the Clinton Program. She would subsidize industry to do what they will have to do anyway when buyers will no longer drive home SUV'S that hold 40 gallons of Gas. War increases the cost of everything, especially fuel. Mrs. Clinton did not oppose war spending, which is why the ladies in Pink protested her.- ed
FED 'CANNOT IGNORE' STOCK MOVEMENTS To Set Interest Rates
AP Economics Writer
Ben Shalome Bernake wrote. "There is little or no evidence that the Fed "is better able than the market to identify speculative bubbles and that it can successfully `deflate' such bubbles without harming the broader economy." Ben is far too modest, for the FED does not predict "bubbles" it causes them to happen, and it contracts debt without the least concern for collateral damage. That is what it is doing right now.-ed
KNESSET CHRISTIAN ALLIES CAUCUS for Jewish-Christian Relations
CNS News
May 25, 2006, Unity Coalition for Israel
The Knesset Christian Allies Caucus Presented the Newly Created KCAC
Women's Council Today in its First Meeting of the Seventeenth Knesset
Speaker of Knesset Dalia Itzik Addresses the KCAC Women's Council
Judeo-Christian Values at Center of Council's Strategy to Liberate
Oppressed Women Around the World
Tuesday, May 23, 2006- The Knesset Christian Allies Caucus (KCAC)
met today in the Knesset and launched the KCAC Women's Council, a powerful
union of Israeli and Christian women focused on advancing the status of
women worldwide using Judeo-Christian values.
It was announced in the meeting that an Israeli board of directors in
Jerusalem and an international board of directors in the United States
will govern the Women's Council through a joint steering committee. ..... Kay Arthur,
Chairwoman of the international board, spoke of the importance of Jews and
Christians working together for the advancement of the status of women.
"You have the Tanach. We have the Bible. The word of God is our
common ground," she declared.
yshtern1@knesset.gov.il
054-697-4172
JIMMY CARTER: Punishing the innocent is a crime
International Herald Tribune
Carter: " Although Hamas leaders have refused to recognize the state of Israel while their territory is being occupied, Prime Minister Ismail Haniyeh has expressed approval for peace talks between Abbas and Prime Minister Ehud Olmert of Israel. "
WALL STREET AIMS to buy into the Euro exchanges
Associated Press Paris
Cashing in on the bull market: Thain said the NYSE would most likely have to issue its own bonds, borrowing at least some of the $3 billion necessary for Euronext shareholders. The NYSE Group currently has about $650 million in cash available.
READ ALL THE FULL STORIES HERE:
http://straitgateministry.net (Unheralded News)
Strait Gate Ministry HAS A GIFT TO YOU while they last (you find it and pay the shipping cost):
Click here: http://straitgateministry.net (a hint: try "bookstore")
"ONE NATION UNDER ISRAEL" by Andrew Hurley, 345 page documentary, may be the best historically documented expose of the hijacking of the American Congress. It is a popular lament that, "Congress is out of control," but nothing could be further from the truth. Author Andrew Hurley explains that Congress is not under the control of its constituents but answers to a foreign power. And Andrew Hurley provides a blueprint for peace in the Mideast
Strait Gate Ministry
P.O. Box 14491
Scottsdale, AZ 85267
http://straitgateministry.net
cecarl@straitgateministry.net
To be blocked from future mailings reply with Delete'
Write it in the subject line please.
^ permalink raw reply
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox