Skip to contentSkip to conversation

orinoco rfmon

PATCH In review Eric Gaumer 5 participants 9 messages Feb 26, 2005 – Feb 28, 2005 Networking drivers (wireless)

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 orinoco rfmon

Could anyone elaborate on the status of this patch? I've had 344 days of uptime on a PPC powerbook using it on 2.4.22 and about 3 months of solid use on 2.6.

If the code looks problematic could someone point out possible deficiencies so we can work toward a satisfactory resolution? I didn't write the code but I'm willing do what I have to in order to get this (wireless scanning) into the official tree.

diff -ur linux-2.6.9/drivers/net/wireless/hermes.c linux-2.6.9-orinoco/drivers/net/wireless/hermes.c

drivers/net/wireless/hermes.c +4 -0
@@ -182,6 +182,10 @@
 	if (err)
 		return err;
 
+        for ( k = 0; k < HERMES_NUMPORTS_MAX; k++) {
+		hw->port_enabled[k] = 0;
+	}
+
 	reg = hermes_read_regn(hw, EVSTAT);
 	k = CMD_INIT_TIMEOUT;
 	while ( (! (reg & HERMES_EV_CMD)) && k) {

diff -ur linux-2.6.9/drivers/net/wireless/hermes.h linux-2.6.9-orinoco/drivers/net/wireless/hermes.h

drivers/net/wireless/hermes.h +54 -0

96 lines not on this page · raw message

diff -ur linux-2.6.9/drivers/net/wireless/orinoco.c linux-2.6.9-orinoco/drivers/net/wireless/orinoco.c

drivers/net/wireless/orinoco.c +458 -11

586 lines not on this page · raw message

diff -ur linux-2.6.9/drivers/net/wireless/orinoco.h linux-2.6.9-orinoco/drivers/net/wireless/orinoco.h

drivers/net/wireless/orinoco.h +179 -0

201 lines not on this page · raw message

--
"Education is what remains after one has forgotten everything he learned in school."
- Albert Einstein

#1 lore raw
Quoted 4 lines · Eric Gaumer

If the code looks problematic could someone point out possible deficiencies so we can work toward a satisfactory resolution? I didn't write the code but I'm willing do what I have to in order to get this (wireless scanning) into the official tree.

Uhhh... Started to comment line-by-line but then realized it would take too much time.

* Read Documentaion/CodingStyle.
* Indent code with tabs where it is already indented with tabs.
* Brackets around a single number in #define's are useless.
* Use u8, u16, u32 (not uint*_t) where the code already uses them.
* Comments are supposed to be anonymous.
* Use appropriate KERN_* constant in printk()'s.
* Don't pack simple types (uint32_t, ...)
* Common convention is to return 0 on success, negative number on error. Positive return values don't fit well into this scheme. If possible follow it.

Oh, and the type p80211item_uint32_t when in fact it is a 12-bytes long structure ...

Alexey

#2 lore raw
Quoted 23 lines · Alexey Dobriyan
Quoted 4 lines · Eric Gaumer

If the code looks problematic could someone point out possible deficiencies so we can work toward a satisfactory resolution? I didn't write the code but I'm willing do what I have to in order to get this (wireless scanning) into the official tree.

Uhhh... Started to comment line-by-line but then realized it would take too much time.

* Read Documentaion/CodingStyle.
* Indent code with tabs where it is already indented with tabs.
* Brackets around a single number in #define's are useless.
* Use u8, u16, u32 (not uint*_t) where the code already uses them.
* Comments are supposed to be anonymous.
* Use appropriate KERN_* constant in printk()'s.
* Don't pack simple types (uint32_t, ...)
* Common convention is to return 0 on success, negative number on error. Positive return values don't fit well into this scheme. If possible follow it.

Quoted 4 lines

Oh, and the type p80211item_uint32_t when in fact it is a 12-bytes long structure ...

Alexey

What is the difference between u* and uint*_t ? Both are derived from the same basic data type.

typedef unsigned char __u8;
typedef __u8 uint8_t;

And...

typedef unsigned char u8;

--
"Education is what remains after one has forgotten everything he learned in school."
- Albert Einstein

#3 lore raw
Quoted 9 lines · Eric Gaumer

What is the difference between u* and uint*_t ? Both are derived from the same basic data type.

typedef unsigned char __u8;
typedef __u8 uint8_t;

And...

typedef unsigned char u8;

Don't use the uint*_t types, they are not correct. See the lkml archives for why this is true.

Use the u8 for when you are in the kernel, and __u8 when you need it for a variable that crosses the userspace/kernelspace barrier.

thanks,

greg k-h

#4 lore raw
Quoted 13 lines · Greg KH
Quoted 9 lines · Eric Gaumer

What is the difference between u* and uint*_t ? Both are derived from the same basic data type.

typedef unsigned char __u8;
typedef __u8 uint8_t;

And...

typedef unsigned char u8;

Quoted 8 lines

Don't use the uint*_t types, they are not correct. See the lkml archives for why this is true.

Use the u8 for when you are in the kernel, and __u8 when you need it for a variable that crosses the userspace/kernelspace barrier.

thanks,

Thanks, I'll dig up those archives.

--
"Education is what remains after one has forgotten everything he learned in school."
- Albert Einstein

#5 lore raw
In reply to Eric Gaumer
Quoted 9 lines · Eric Gaumer

Could anyone elaborate on the status of this patch? I've had 344 days of uptime on a PPC
powerbook using it on 2.4.22 and about 3 months of solid use on 2.6.

If the code looks problematic could someone point out possible deficiencies so we can work
toward a satisfactory resolution? I didn't write the code but I'm willing do what I have to
in order to get this (wireless scanning) into the official tree.

This looks like the ancient version of the monitor patch - which includes importing a lot of needless junk from the linux-wlan-ng tree. A cleaned up version of monitor has been merged in the orinoco CVS tree for ages now, but unfortunately that's long overdue for a merge with mainline. I'm trying to get that merge done - I just don't have much time or energy for the orinoco driver these days. One stack of patches which gets part of the way went to Jeff Garzik last week. We'll see how we go.

In the meantime go to http://savannah.nongnu.org/projects/orinoco for access to the driver CVS. You probably want to get the "for_linus" branch of CVS if you're planning to work with 2.6.

Signature · 4 lines
David Gibson			| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist.  NOT _the_ _other_ _way_
				| _around_!
http://www.ozlabs.org/people/dgibson
#6 lore raw
Quoted 10 lines · David Gibson

This looks like the ancient version of the monitor patch - which includes importing a lot of needless junk from the linux-wlan-ng tree. A cleaned up version of monitor has been merged in the orinoco CVS tree for ages now, but unfortunately that's long overdue for a merge with mainline. I'm trying to get that merge done - I just don't have much time or energy for the orinoco driver these days. One stack of patches which gets part of the way went to Jeff Garzik last week. We'll see how we go.

Quoted 4 lines

In the meantime go to http://savannah.nongnu.org/projects/orinoco for access to the driver CVS. You probably want to get the "for_linus" branch of CVS if you're planning to work with 2.6.

Thanks David, the CVS code works great with the small excpetion of the following change to get it to build.

orinoco_cs.c 2005-02-27 15:00:07.698368136 -0800 renamed from orinoco_cs.c 2005-02-26 22:21:55.000000000 -0800 +1 -1
diff -Nru orinoco-cvs/orinoco_cs.c orinoco-build/orinoco_cs.c
@@ -428,7 +428,7 @@
        SET_MODULE_OWNER(dev);
        card->node.major = card->node.minor = 0;
 
-       SET_NETDEV_DEV(dev, &handle_to_dev(handle));
+       dev->name[0] = '\0';
        /* Tell the stack we exist */
        if (register_netdev(dev) != 0) {
                printk(KERN_ERR PFX "register_netdev() failed\n");

What's the deal with the broken firmware for monitor mode?

* v0.15rc1 -> v0.15rc2 - 28 Jul 2004 - Pavel Roskin & David Gibson
* o orinoco_pci saves PCI registers on suspend (Simon Huggins).
* o Monitor mode disabled on Agere 8.xx firmware - it's broken.

I have 8.4 but things seem fine (used this card in monitor mode for over a year without problems).

I just disabled the check for broken firmware and things seem fine (better than the original patch I posted). The iwlist command now works. Could the buggy firmware be generalized a bit too much? Perhaps only certain versions > 8 are buggy?

--
"Education is what remains after one has forgotten everything he learned in school."
- Albert Einstein

#7 lore raw
Quoted 43 lines · Eric Gaumer
Quoted 10 lines · David Gibson

This looks like the ancient version of the monitor patch - which includes importing a lot of needless junk from the linux-wlan-ng tree. A cleaned up version of monitor has been merged in the orinoco CVS tree for ages now, but unfortunately that's long overdue for a merge with mainline. I'm trying to get that merge done - I just don't have much time or energy for the orinoco driver these days. One stack of patches which gets part of the way went to Jeff Garzik last week. We'll see how we go.

Quoted 4 lines

In the meantime go to http://savannah.nongnu.org/projects/orinoco for access to the driver CVS. You probably want to get the "for_linus" branch of CVS if you're planning to work with 2.6.

Thanks David, the CVS code works great with the small excpetion of the following change to
get it to build.

diff -Nru orinoco-cvs/orinoco_cs.c orinoco-build/orinoco_cs.c +++ orinoco-build/orinoco_cs.c 2005-02-27 15:00:07.698368136 -0800

orinoco_cs.c 2005-02-27 15:00:07.698368136 -0800 renamed from orinoco_cs.c 2005-02-26 22:21:55.000000000 -0800 +1 -1
@@ -428,7 +428,7 @@
        SET_MODULE_OWNER(dev);
        card->node.major = card->node.minor = 0;
 
-       SET_NETDEV_DEV(dev, &handle_to_dev(handle));
+       dev->name[0] = '\0';
        /* Tell the stack we exist */
        if (register_netdev(dev) != 0) {
                printk(KERN_ERR PFX "register_netdev() failed\n");

What's the deal with the broken firmware for monitor mode?

* v0.15rc1 -> v0.15rc2 - 28 Jul 2004 - Pavel Roskin & David Gibson
* o orinoco_pci saves PCI registers on suspend (Simon Huggins).
* o Monitor mode disabled on Agere 8.xx firmware - it's broken.

I have 8.4 but things seem fine (used this card in monitor mode for over a year without
problems).

Quoted 5 lines

I just disabled the check for broken firmware and things seem fine (better than the original
patch I posted). The iwlist command now works. Could the buggy firmware be generalized a bit
too much? Perhaps only certain versions > 8 are buggy?

Possibly, but I don't really have the means to find out in more detail. The trouble is that when it falls over, it falls over very badly, which is why we disable this rather than just letting the user risk it. Pavel knows more of the details on this one.

Signature · 4 lines
David Gibson			| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist.  NOT _the_ _other_ _way_
				| _around_!
http://www.ozlabs.org/people/dgibson
#8 lore raw

Hello!

Quoted 11 lines
Quoted 5 lines

I just disabled the check for broken firmware and things seem fine (better than the original
patch I posted). The iwlist command now works. Could the buggy firmware be generalized a bit
too much? Perhaps only certain versions > 8 are buggy?

Possibly, but I don't really have the means to find out in more detail. The trouble is that when it falls over, it falls over very badly, which is why we disable this rather than just letting the user risk it. Pavel knows more of the details on this one.

Try AirSnort with scanning enabled - it will bring the firmware down in a few minutes.

Signature · 2 lines
Regards,
Pavel Roskin