History log of /drivers/net/wireless/airo.c
Revision Date Author Comments
9ffc93f203c18a70623f21950f1dd473c9ec48cd 28-Mar-2012 David Howells <dhowells@redhat.com> Remove all #inclusions of asm/system.h

Remove all #inclusions of asm/system.h preparatory to splitting and killing
it. Performed with the following command:

perl -p -i -e 's!^#\s*include\s*<asm/system[.]h>.*\n!!' `grep -Irl '^#\s*include\s*<asm/system[.]h>' *`

Signed-off-by: David Howells <dhowells@redhat.com>
e9a8e8ec1e487536568adc4b3efa8f56e4391a7b 05-Mar-2012 Dan Carpenter <dan.carpenter@oracle.com> airo: fix test for FLAG_RADIO_DOWN

We should be doing a shift (1 << FLAG_RADIO_DOWN) here before testing
the flag. As luck would have it, this test works almost correctly.
The current code tests for FLAG_RADIO_OFF instead of FLAG_RADIO_DOWN.

#define FLAG_RADIO_OFF 0 /* User disabling of MAC */
#define FLAG_RADIO_DOWN 1 /* ifup/ifdown disabling of MAC */

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
f47398409c140a48dd40faf75a18f7c93504a22e 26-Nov-2011 David S. Miller <davem@davemloft.net> airo: Fix array bounds warning when moving packet payload.

drivers/net/wireless/airo.c: In function ‘encapsulate’:
drivers/net/wireless/airo.c:1421:15: warning: array subscript is above array bounds [-Warray-bounds]
drivers/net/wireless/airo.c: In function ‘decapsulate’:
drivers/net/wireless/airo.c:1509:16: warning: array subscript is above array bounds [-Warray-bounds]

Signed-off-by: David S. Miller <davem@davemloft.net>
afc4b13df143122f99a0eb10bfefb216c2806de0 16-Aug-2011 Jiri Pirko <jpirko@redhat.com> net: remove use of ndo_set_multicast_list in drivers

replace it by ndo_set_rx_mode

Signed-off-by: Jiri Pirko <jpirko@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
550fd08c2cebad61c548def135f67aba284c6162 26-Jul-2011 Neil Horman <nhorman@tuxdriver.com> net: Audit drivers to identify those needing IFF_TX_SKB_SHARING cleared

After the last patch, We are left in a state in which only drivers calling
ether_setup have IFF_TX_SKB_SHARING set (we assume that drivers touching real
hardware call ether_setup for their net_devices and don't hold any state in
their skbs. There are a handful of drivers that violate this assumption of
course, and need to be fixed up. This patch identifies those drivers, and marks
them as not being able to support the safe transmission of skbs by clearning the
IFF_TX_SKB_SHARING flag in priv_flags

Signed-off-by: Neil Horman <nhorman@tuxdriver.com>
CC: Karsten Keil <isdn@linux-pingi.de>
CC: "David S. Miller" <davem@davemloft.net>
CC: Jay Vosburgh <fubar@us.ibm.com>
CC: Andy Gospodarek <andy@greyhouse.net>
CC: Patrick McHardy <kaber@trash.net>
CC: Krzysztof Halasa <khc@pm.waw.pl>
CC: "John W. Linville" <linville@tuxdriver.com>
CC: Greg Kroah-Hartman <gregkh@suse.de>
CC: Marcel Holtmann <marcel@holtmann.org>
CC: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
011159a0a746e03ae42d559ce5c2a70138da3129 13-May-2011 Alexey Dobriyan <adobriyan@gmail.com> airo: correct proc entry creation interfaces

* use proc_mkdir_mode() instead of create_proc_entry(S_IFDIR|...),
export proc_mkdir_mode() for that, oh well.
* don't supply S_IFREG to proc_create_data(), it's unnecessary

Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
85ee7a1d39d75d23d21f3871f6dc9b87d572747a 24-Apr-2011 Joe Perches <joe@perches.com> treewide: cleanup continuations and remove logging message whitespace

Using C line continuation inside format strings is error prone.
Clean up the unintended whitespace introduced by misuse of \.
Neaten correctly used line continations as well for consistency.

drivers/scsi/arcmsr/arcmsr_hba.c has these errors as well,
but arcmsr needs a lot more work and the driver should likely be
moved to staging instead.

Signed-off-by: Joe Perches <joe@perches.com>
Acked-by: Randy Dunlap <randy.dunlap@oracle.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
25985edcedea6396277003854657b5f3cb31a628 31-Mar-2011 Lucas De Marchi <lucas.demarchi@profusion.mobi> Fix common misspellings

Fixes generated by 'codespell' and manually reviewed.

Signed-off-by: Lucas De Marchi <lucas.demarchi@profusion.mobi>
ad9082adfc0a6bdcef1bad2f22485575479d7a9d 25-Dec-2010 Akinobu Mita <akinobu.mita@gmail.com> airo: use simple_write_to_buffer

Simplify write file operation for /proc files by using
simple_write_to_buffer().

Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Cc: "John W. Linville" <linville@tuxdriver.com>
Cc: linux-wireless@vger.kernel.org
Cc: netdev@vger.kernel.org
Signed-off-by: John W. Linville <linville@tuxdriver.com>
6038f373a3dc1f1c26496e60b6c40b164716f07e 15-Aug-2010 Arnd Bergmann <arnd@arndb.de> llseek: automatically add .llseek fop

All file_operations should get a .llseek operation so we can make
nonseekable_open the default for future file operations without a
.llseek pointer.

The three cases that we can automatically detect are no_llseek, seq_lseek
and default_llseek. For cases where we can we can automatically prove that
the file offset is always ignored, we use noop_llseek, which maintains
the current behavior of not returning an error from a seek.

New drivers should normally not use noop_llseek but instead use no_llseek
and call nonseekable_open at open time. Existing drivers can be converted
to do the same when the maintainer knows for certain that no user code
relies on calling seek on the device file.

The generated code is often incorrectly indented and right now contains
comments that clarify for each added line why a specific variant was
chosen. In the version that gets submitted upstream, the comments will
be gone and I will manually fix the indentation, because there does not
seem to be a way to do that using coccinelle.

Some amount of new code is currently sitting in linux-next that should get
the same modifications, which I will do at the end of the merge window.

Many thanks to Julia Lawall for helping me learn to write a semantic
patch that does all this.

===== begin semantic patch =====
// This adds an llseek= method to all file operations,
// as a preparation for making no_llseek the default.
//
// The rules are
// - use no_llseek explicitly if we do nonseekable_open
// - use seq_lseek for sequential files
// - use default_llseek if we know we access f_pos
// - use noop_llseek if we know we don't access f_pos,
// but we still want to allow users to call lseek
//
@ open1 exists @
identifier nested_open;
@@
nested_open(...)
{
<+...
nonseekable_open(...)
...+>
}

@ open exists@
identifier open_f;
identifier i, f;
identifier open1.nested_open;
@@
int open_f(struct inode *i, struct file *f)
{
<+...
(
nonseekable_open(...)
|
nested_open(...)
)
...+>
}

@ read disable optional_qualifier exists @
identifier read_f;
identifier f, p, s, off;
type ssize_t, size_t, loff_t;
expression E;
identifier func;
@@
ssize_t read_f(struct file *f, char *p, size_t s, loff_t *off)
{
<+...
(
*off = E
|
*off += E
|
func(..., off, ...)
|
E = *off
)
...+>
}

@ read_no_fpos disable optional_qualifier exists @
identifier read_f;
identifier f, p, s, off;
type ssize_t, size_t, loff_t;
@@
ssize_t read_f(struct file *f, char *p, size_t s, loff_t *off)
{
... when != off
}

@ write @
identifier write_f;
identifier f, p, s, off;
type ssize_t, size_t, loff_t;
expression E;
identifier func;
@@
ssize_t write_f(struct file *f, const char *p, size_t s, loff_t *off)
{
<+...
(
*off = E
|
*off += E
|
func(..., off, ...)
|
E = *off
)
...+>
}

@ write_no_fpos @
identifier write_f;
identifier f, p, s, off;
type ssize_t, size_t, loff_t;
@@
ssize_t write_f(struct file *f, const char *p, size_t s, loff_t *off)
{
... when != off
}

@ fops0 @
identifier fops;
@@
struct file_operations fops = {
...
};

@ has_llseek depends on fops0 @
identifier fops0.fops;
identifier llseek_f;
@@
struct file_operations fops = {
...
.llseek = llseek_f,
...
};

@ has_read depends on fops0 @
identifier fops0.fops;
identifier read_f;
@@
struct file_operations fops = {
...
.read = read_f,
...
};

@ has_write depends on fops0 @
identifier fops0.fops;
identifier write_f;
@@
struct file_operations fops = {
...
.write = write_f,
...
};

@ has_open depends on fops0 @
identifier fops0.fops;
identifier open_f;
@@
struct file_operations fops = {
...
.open = open_f,
...
};

// use no_llseek if we call nonseekable_open
////////////////////////////////////////////
@ nonseekable1 depends on !has_llseek && has_open @
identifier fops0.fops;
identifier nso ~= "nonseekable_open";
@@
struct file_operations fops = {
... .open = nso, ...
+.llseek = no_llseek, /* nonseekable */
};

@ nonseekable2 depends on !has_llseek @
identifier fops0.fops;
identifier open.open_f;
@@
struct file_operations fops = {
... .open = open_f, ...
+.llseek = no_llseek, /* open uses nonseekable */
};

// use seq_lseek for sequential files
/////////////////////////////////////
@ seq depends on !has_llseek @
identifier fops0.fops;
identifier sr ~= "seq_read";
@@
struct file_operations fops = {
... .read = sr, ...
+.llseek = seq_lseek, /* we have seq_read */
};

// use default_llseek if there is a readdir
///////////////////////////////////////////
@ fops1 depends on !has_llseek && !nonseekable1 && !nonseekable2 && !seq @
identifier fops0.fops;
identifier readdir_e;
@@
// any other fop is used that changes pos
struct file_operations fops = {
... .readdir = readdir_e, ...
+.llseek = default_llseek, /* readdir is present */
};

// use default_llseek if at least one of read/write touches f_pos
/////////////////////////////////////////////////////////////////
@ fops2 depends on !fops1 && !has_llseek && !nonseekable1 && !nonseekable2 && !seq @
identifier fops0.fops;
identifier read.read_f;
@@
// read fops use offset
struct file_operations fops = {
... .read = read_f, ...
+.llseek = default_llseek, /* read accesses f_pos */
};

@ fops3 depends on !fops1 && !fops2 && !has_llseek && !nonseekable1 && !nonseekable2 && !seq @
identifier fops0.fops;
identifier write.write_f;
@@
// write fops use offset
struct file_operations fops = {
... .write = write_f, ...
+ .llseek = default_llseek, /* write accesses f_pos */
};

// Use noop_llseek if neither read nor write accesses f_pos
///////////////////////////////////////////////////////////

@ fops4 depends on !fops1 && !fops2 && !fops3 && !has_llseek && !nonseekable1 && !nonseekable2 && !seq @
identifier fops0.fops;
identifier read_no_fpos.read_f;
identifier write_no_fpos.write_f;
@@
// write fops use offset
struct file_operations fops = {
...
.write = write_f,
.read = read_f,
...
+.llseek = noop_llseek, /* read and write both use no f_pos */
};

@ depends on has_write && !has_read && !fops1 && !fops2 && !has_llseek && !nonseekable1 && !nonseekable2 && !seq @
identifier fops0.fops;
identifier write_no_fpos.write_f;
@@
struct file_operations fops = {
... .write = write_f, ...
+.llseek = noop_llseek, /* write uses no f_pos */
};

@ depends on has_read && !has_write && !fops1 && !fops2 && !has_llseek && !nonseekable1 && !nonseekable2 && !seq @
identifier fops0.fops;
identifier read_no_fpos.read_f;
@@
struct file_operations fops = {
... .read = read_f, ...
+.llseek = noop_llseek, /* read uses no f_pos */
};

@ depends on !has_read && !has_write && !fops1 && !fops2 && !has_llseek && !nonseekable1 && !nonseekable2 && !seq @
identifier fops0.fops;
@@
struct file_operations fops = {
...
+.llseek = noop_llseek, /* no read or write fn */
};
===== End semantic patch =====

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Cc: Julia Lawall <julia@diku.dk>
Cc: Christoph Hellwig <hch@infradead.org>
ed627be38a1a07c6986a9f17c299f6afc86ac6b7 12-Sep-2010 Dan Carpenter <error27@gmail.com> airo: remove "basic_rate" module option

The "basic_rate" module option is not implemented correctly. If the
rate was set to zero it was supposed to set it to "basic_rate | 0x80".
Unfortunately the check to see if what zero was wrong and it checked
"!ai->config.rates" (which is always false) instead of
"!ai->config.rates[i]".

This option was just used for development and it wasn't documented
anywhere. Instead of fixing it, we can just remove it.

Reported-by: Stanislaw Gruszka <sgruszka@redhat.com>
Signed-off-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
7a374d8eeb1140c08d215de7a181e595ca606196 02-Sep-2010 Stephen Hemminger <shemminger@vyatta.com> airo: make strings const

Make read/only data structures const. Compile tested only.

Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
baeb2ffab4e67bb9174e6166e070a9a8ec94b0f6 11-Aug-2010 Joe Perches <joe@perches.com> drivers/net: Convert unbounded kzalloc calls to kcalloc

These changes may be slightly safer in some instances.

There are other kzalloc calls with a multiply, but those
calls are typically "small fixed #" * sizeof(some pointer)"
and those are not converted.

Signed-off-by: Joe Perches <joe@perches.com>
Acked-by: Gertjan van Wingerde <gwingerde@gmail.com>
Acked-by: Luciano Coelho <luciano.coelho@nokia.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
ff4bf917cd4d355f23eea5812a11be5711dcfb8c 13-Jul-2010 Kulikov Vasiliy <segooon@gmail.com> wireless: airo: delete netdev from list after it is freed

We must call del_airo_dev() before free_netdev() since we call
add_airo_dev() exactly after alloc_netdev().

Signed-off-by: Kulikov Vasiliy <segooon@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
57674308d00b5ebb639ce53d388e61728e0c7f72 12-Jul-2010 Joe Perches <joe@perches.com> drivers/net/wireless: Remove unnecessary casts of private_data

Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
ba2d3587912f82d1ab4367975b1df460db60fb1e 02-Jun-2010 Eric Dumazet <eric.dumazet@gmail.com> drivers/net: use __packed annotation

cleanup patch.

Use new __packed annotation in drivers/net/

Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
26355387c21accb0919d34ee59478c23b2030ee5 24-May-2010 Andy Shevchenko <ext-andriy.shevchenko@nokia.com> drivers: wireless: use new hex_to_bin() method

Instead of using own implementation involve hex_to_bin() function.

Signed-off-by: Andy Shevchenko <ext-andriy.shevchenko@nokia.com>
Acked-by: John W. Linville <linville@tuxdriver.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
f3a981ffddcc9671505b85ead976630878116434 28-Feb-2010 matthieu castet <castet.matthieu@free.fr> airo : Print of firmware version

For the firmware version 5.30.17 the log file shows:
Firmware version 5.30.11

The variable softSubVer is binary.

Signed-off-by: Matthieu CASTET <castet.matthieu@free.fr>
Signed-off-by: Jose Alonso <joalonsof@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
3bc819e8d4dd385e481137b2dbe3b7d23314319e 28-Feb-2010 matthieu castet <castet.matthieu@free.fr> airo : fix printing status info

For some status, reason is encoded in the low byte, but airo_print_status forgot tp mask low byte in status parsing.

This make it only work when reason is 0.

Signed-off-by: Matthieu CASTET <castet.matthieu@free.fr>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
6510b8917948283005a125c8337d3312a8a0561c 26-Feb-2010 Stanislaw Gruszka <sgruszka@redhat.com> airo: return from set_wep_key() when key length is zero

Even if keylen == 0 is a bug and should not really happen, better avoid
possibility of passing bad value to firmware.

Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2bf9fa6980a5ca12333634e48c8dd69024b88eba 12-Feb-2010 Randy Dunlap <randy.dunlap@oracle.com> wireless: airo_cs build fixes

When WEXT_PRIV is not enabled, airo_cs has build errors.
It needs to include net/iw_handler.h and it should select
WEXT_PRIV, like the airo driver does.

drivers/net/wireless/airo.c:7655: error: unknown field 'num_private' specified in initializer
drivers/net/wireless/airo.c:7655: warning: initialization makes pointer from integer without a cast
drivers/net/wireless/airo.c:7656: error: unknown field 'num_private_args' specified in initializer
drivers/net/wireless/airo.c:7656: warning: excess elements in struct initializer
drivers/net/wireless/airo.c:7656: warning: (near initialization for 'airo_handler_def')
drivers/net/wireless/airo.c:7658: error: unknown field 'private' specified in initializer
drivers/net/wireless/airo.c:7658: warning: initialization makes integer from pointer without a cast
drivers/net/wireless/airo.c:7658: error: initializer element is not computable at load time
drivers/net/wireless/airo.c:7658: error: (near initialization for 'airo_handler_def.num_standard')
drivers/net/wireless/airo.c:7659: error: unknown field 'private_args' specified in initializer
drivers/net/wireless/airo.c:7659: warning: initialization from incompatible pointer type

Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
4cd24eaf0c6ee7f0242e34ee77ec899f255e66b5 08-Feb-2010 Jiri Pirko <jpirko@redhat.com> net: use netdev_mc_count and netdev_mc_empty when appropriate

This patch replaces dev->mc_count in all drivers (hopefully I didn't miss
anything). Used spatch and did small tweaks and conding style changes when
it was suitable.

Jirka

Signed-off-by: Jiri Pirko <jpirko@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
f09c256375c7cf1e112b8ef6306cdd313490d7c0 02-Feb-2010 Stanislaw Gruszka <sgruszka@redhat.com> airo: fix setting zero length WEP key

Patch prevents call set_wep_key() with zero key length. That fix long
standing regression since commit c0380693520b1a1e4f756799a0edc379378b462a
"airo: clean up WEP key operations". Additionally print call trace when
someone will try to use improper parameters, and remove key.len = 0
assignment, because it is in not possible code path.

Reported-by: Chris Siebenmann <cks-rhbugzilla@cs.toronto.edu>
Bisected-by: Chris Siebenmann <cks-rhbugzilla@cs.toronto.edu>
Tested-by: Chris Siebenmann <cks@cs.toronto.edu>
Cc: Dan Williams <dcbw@redhat.com>
Cc: <stable@kernel.org>
Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
a3aa18842a5303fc28fcc4d57dbd16618bd830a0 07-Jan-2010 Alexey Dobriyan <adobriyan@gmail.com> drivers/net/: use DEFINE_PCI_DEVICE_TABLE()

Use DEFINE_PCI_DEVICE_TABLE() so we get place PCI ids table into correct section
in every case.

Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
1f351e3840dcf25aaddec2d908c3ab06ae105ee6 25-Nov-2009 Michael Buesch <mb@bu3sch.de> airo: Fix integer overflow warning

On BigEndian gcc complains:

drivers/net/wireless/airo.c: In function ‘sniffing_mode’:
drivers/net/wireless/airo.c:4809: warning: integer overflow in expression

Fix this by doing the bitwise AND on the host-endian value.

Signed-off-by: John W. Linville <linville@tuxdriver.com>
40b93ad6e97a1d412c4b86f4717fee9b4bc830e1 09-Oct-2009 matthieu castet <castet.matthieu@free.fr> airo : allow supend with card without power management

Some airo card don't support power Management [1].
Don't abort suspend with those cards.

00:06.0 Network controller: AIRONET Wireless Communications PC4800 (rev 01)
Flags: medium devsel, IRQ 17
Memory at dffffe00 (32-bit, non-prefetchable) [size=128]
I/O ports at d000 [size=128]
I/O ports at cc00 [size=64]
Kernel driver in use: airo

Signed-off-by: Matthieu CASTET <castet.matthieu@free.fr>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
30bd5726730e374a81c9e677d1a5ba2cf8f94a7c 26-Oct-2009 Roel Kluin <roel.kluin@gmail.com> airo: Reorder tests, check bounds before element

Test whether index is within bounds before reading the element

Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
d0cf9c0dadcdc89a755bcb301cfc9c796eb28ccf 31-Aug-2009 Stephen Hemminger <shemminger@vyatta.com> wireless: convert drivers to netdev_tx_t

Mostly just simple conversions:
* ray_cs had bogus return of NET_TX_LOCKED but driver
was not using NETIF_F_LLTX
* hostap and ipw2x00 had some code that returned value
from a called function that also had to change to return netdev_tx_t

Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
3d0ccd021b23c18ea2d399fe4a43c955485c765c 25-Jul-2009 Roel Kluin <roel.kluin@gmail.com> airo: Buffer overflow

SSID_rid has space for only 3 ssids.
txPowerLevels[i] is read before the bounds check for i

Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
Acked-by: Dan Williams <dcbw@redhat.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
6ed106549d17474ca17a16057f4c0ed4eba5a7ca 23-Jun-2009 Patrick McHardy <kaber@trash.net> net: use NETDEV_TX_OK instead of 0 in ndo_start_xmit() functions

This patch is the result of an automatic spatch transformation to convert
all ndo_start_xmit() return values of 0 to NETDEV_TX_OK.

Some occurences are missed by the automatic conversion, those will be
handled in a seperate patch.

Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
5b548140225c6bbbbd560551dd1048b2c0ce58be 12-Jun-2009 Patrick McHardy <kaber@trash.net> net: use symbolic values for ndo_start_xmit() return codes

Convert magic values 1 and -1 to NETDEV_TX_BUSY and NETDEV_TX_LOCKED respectively.

0 (NETDEV_TX_OK) is not changed to keep the noise down, except in very few cases
where its in direct proximity to one of the other values.

Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
4153e77596c4caaf52293b0c6b2207d73ed8f1eb 12-Jun-2009 Patrick McHardy <kaber@trash.net> net: fix network drivers ndo_start_xmit() return values (part 3)

net: fix network drivers ndo_start_xmit() return values (part 3)

Fix up wireless drivers that return an errno value to qdisc_restart(), causing
qdisc_restart() to print a warning an requeue/retransmit the skb.

- airo: transmission not implemented for chip, intention is to free and abort
- ipw2200: transmission not implemented for promiscous mode, intention is to
drop
- prism54: intention is to drop
- wl3501_cs: intention appears to be to drop
- zd1201: error counter indicates intention is to drop

All drivers compile tested.

Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
267d493b322b05984048aef8ea9b5b213490bbe0 20-May-2009 John W. Linville <linville@tuxdriver.com> airo: fix airo_get_encode{,ext} buffer overflow like I mean it...

"airo: airo_get_encode{,ext} potential buffer overflow" was actually a
no-op, due to an unrecognized type overflow in an assignment. Oddly,
gcc only seems to tell me about it when using -Wextra...grrr...

Signed-off-by: John W. Linville <linville@tuxdriver.com>
aedec9226809ae9d1972f8f8079fc70206ee7a88 04-May-2009 John W. Linville <linville@tuxdriver.com> airo: airo_get_encode{,ext} potential buffer overflow

Feeding the return code of get_wep_key directly to the length parameter
of memcpy is a bad idea since it could be -1...

Reported-by: Eugene Teo <eugeneteo@kernel.sg>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
011f5c5bb20c08af93faa8bfd8d611c8cf85134f 08-Apr-2009 Dan Williams <dcbw@redhat.com> airo: queue SIOCSIWAUTH-requested auth mode change for next commit

Code was clearly wrong, plus callers expect the mode change to happen as
soon as possible, not dropped on the floor until the next time some
other config value changes and a commit happens.

Signed-off-by: Dan Williams <dcbw@redhat.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
99b76233803beab302123d243eea9e41149804f3 25-Mar-2009 Alexey Dobriyan <adobriyan@gmail.com> proc 2/2: remove struct proc_dir_entry::owner

Setting ->owner as done currently (pde->owner = THIS_MODULE) is racy
as correctly noted at bug #12454. Someone can lookup entry with NULL
->owner, thus not pinning enything, and release it later resulting
in module refcount underflow.

We can keep ->owner and supply it at registration time like ->proc_fops
and ->data.

But this leaves ->owner as easy-manipulative field (just one C assignment)
and somebody will forget to unpin previous/pin current module when
switching ->owner. ->proc_fops is declared as "const" which should give
some thoughts.

->read_proc/->write_proc were just fixed to not require ->owner for
protection.

rmmod'ed directories will be empty and return "." and ".." -- no harm.
And directories with tricky enough readdir and lookup shouldn't be modular.
We definitely don't want such modular code.

Removing ->owner will also make PDE smaller.

So, let's nuke it.

Kudos to Jeff Layton for reminding about this, let's say, oversight.

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

Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
321dee6e8b235c496f0a068a72d8df9a4e13ceb9 29-Mar-2009 Alexander Beregalov <a.beregalov@gmail.com> wireless: remove duplicated .ndo_set_mac_address

Signed-off-by: Alexander Beregalov <a.beregalov@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
7ae41cc3c04b0e79b7c9c3e5cbb5222f181e3ca1 20-Mar-2009 Stephen Hemminger <shemminger@vyatta.com> airo: convert to net_device_ops

Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
998a5a7d6aabe7e450759e0d82c8a79afd5a97ff 25-Feb-2009 Frank Seidel <frank@f-seidel.de> airo: reduce stack memory footprint

Applying kernel janitors todos (reduce stack
footprint where possible) to airo wireless driver.
(Before 1124 bytes on i386, now 876)

Signed-off-by: Frank Seidel <frank@f-seidel.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
bc8263f1d86946ffe97eb249fc1d6660da1e1055 10-Feb-2009 John W. Linville <linville@tuxdriver.com> airo: correct improper initialization of local variable

Signed-off-by: John W. Linville <linville@tuxdriver.com>
9e05a2df09e91bfe50d16ff96cc208708599185c 14-Feb-2009 Hannes Eder <hannes@hanneseder.net> drivers/net/wireless: fix sparse warnings: fix signedness

Fix this sparse warnings:
drivers/net/wireless/airo.c:2102:21: warning: incorrect type in initializer (different signedness)
drivers/net/wireless/airo.c:2126:21: warning: incorrect type in initializer (different signedness)
drivers/net/wireless/airo.c:2167:21: warning: incorrect type in initializer (different signedness)
drivers/net/wireless/airo.c:2191:21: warning: incorrect type in initializer (different signedness)

Signed-off-by: Hannes Eder <hannes@hanneseder.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
49c4a5dceaff63c3080b3c9d311c1c023c3003af 14-Feb-2009 Hannes Eder <hannes@hanneseder.net> drivers/net/wireless: fix sparse warnings: symbol shadows an earlier one

Impact:
Move variable closer to usage resp.
remove redundant variables resp.
rename function scope variable.

Fix this sparse warnings:
drivers/net/wireless/airo.c:3840:29: warning: symbol 'i' shadows an earlier one
drivers/net/wireless/airo.c:3751:13: originally declared here
drivers/net/wireless/airo.c:3847:29: warning: symbol 'i' shadows an earlier one
drivers/net/wireless/airo.c:3751:13: originally declared here
drivers/net/wireless/airo.c:3861:21: warning: symbol 'i' shadows an earlier one
drivers/net/wireless/airo.c:3751:13: originally declared here
drivers/net/wireless/wavelan.c:43:13: warning: symbol 'irq' shadows an earlier one
drivers/net/wireless/wavelan.p.h:692:17: originally declared here

Signed-off-by: Hannes Eder <hannes@hanneseder.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
506d03f97d10e54fd27c58c872a98242326d6419 24-Jan-2009 Dan Williams <dcbw@redhat.com> airo: remove useless #defines

Signed-off-by: Dan Williams <dcbw@redhat.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
018697d178717d63f668b9e5f3b473f4e37f6304 24-Jan-2009 Dan Williams <dcbw@redhat.com> airo: clean up and clarify micinit()

Fix some endian issues too.

Signed-off-by: Dan Williams <dcbw@redhat.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
99590ffefc803caaf6ba923da092cde739269c06 24-Jan-2009 Dan Williams <dcbw@redhat.com> airo: use __attribute__ ((packed)) not #pragma

Signed-off-by: Dan Williams <dcbw@redhat.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
c0380693520b1a1e4f756799a0edc379378b462a 24-Jan-2009 Dan Williams <dcbw@redhat.com> airo: clean up WEP key operations

get_wep_key() and set_wep_key() combind both get/set of the actual WEP
key and get/set of the transmit index into the same functions. Split those
out so it's clearer what is going one where. Add error checking to WEP
key hardware operations too.

Signed-off-by: Dan Williams <dcbw@redhat.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
138c0c688262b7f4ed07cdc6d0592299c4f12998 24-Jan-2009 Dan Williams <dcbw@redhat.com> airo: simplify WEP index and capability checks

Do the computation once at init time; don't ask the hardware
every time.

Signed-off-by: Dan Williams <dcbw@redhat.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
f65b56d67b48eec7ffe174f223e98db58c3bf2b5 24-Jan-2009 Dan Williams <dcbw@redhat.com> airo: re-arrange WPA capability checks

The capability register has to be read for other (upcoming) stuff, so fold
the WPA test function back into _init_airo_card() and move the netdevice
registration stuff above it so that the netdevice has a name by the time
the card's capabilities are printed out.

Signed-off-by: Dan Williams <dcbw@redhat.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
f55d4517ebdd6de627d42a24baefaeb689978087 24-Jan-2009 Dan Williams <dcbw@redhat.com> airo: clean up and clarify interrupt-time task handling

Split each specific interrupt-time task out into its own function to
make airo_interrupt() actually readable.

Signed-off-by: Dan Williams <dcbw@redhat.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
9ee677c2276bfcbcf68042ec2718a504af0c5fd7 23-Dec-2008 David Kilroy <kilroyd@googlemail.com> wireless: Add channel/frequency conversions to ieee80211.h

Added mappings for FHSS, DSSS and OFDM channels - with macros to point
HR DSSS and ERP to the DSSS mappings. Currently just static inline
functions.

Use the new functions in the older fullmac drivers. This eliminates a
number of const static buffers and removes a couple of range checks that
are now redundant.

Signed-off-by: David Kilroy <kilroyd@googlemail.com>
Acked-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Acked-by: Richard Farina <sidhayn@gmail.com>
Acked-by: Jeroen Vreeken <pe1rxq@amsat.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2ed5ba890e1e8dda89557e4ea233a26ab8bf3d58 26-Dec-2008 Hannes Eder <hannes@hanneseder.net> drivers/net/wireless: fix sparse warnings: make symbols static

Fix this sparse warnings:

drivers/net/wireless/airo.c:3610:6: warning: symbol 'mpi_receive_802_11' was not declared. Should it be static?
drivers/net/wireless/atmel.c:3183:6: warning: symbol 'atmel_join_bss' was not declared. Should it be static?
drivers/net/wireless/ray_cs.c:831:5: warning: symbol 'ray_dev_init' was not declared. Should it be static?

Signed-off-by: Hannes Eder <hannes@hanneseder.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
2c706002fc147decdba2658ea48e4436faca3af2 30-Oct-2008 Johannes Berg <johannes@sipsolutions.net> don't use net/ieee80211.h

Convert all the drivers using net/ieee80211.h to use linux/ieee80211.h.
Contains a bugfix in libertas where the SSID parsing could overrun the
buffer when the AP sends invalid information.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Acked-by: Dan Williams <dcbw@redhat.com> [airo, libertas]
Acked-by: Pavel Roskin <proski@gnu.org> [orinoco]
Acked-by: David Kilroy <kilroyd@googlemail.com> [orinoco]
Signed-off-by: John W. Linville <linville@tuxdriver.com>
babcda74e9d96bb58fd9c6c5112dbdbff169e695 04-Nov-2008 David S. Miller <davem@davemloft.net> drivers/net: Kill now superfluous ->last_rx stores.

The generic packet receive code takes care of setting
netdev->last_rx when necessary, for the sake of the
bonding ARP monitor.

Drivers need not do it any more.

Some cases had to be skipped over because the drivers
were making use of the ->last_rx value themselves.

Signed-off-by: David S. Miller <davem@davemloft.net>
faf3994a9f65fd95a68bbcc03c318a427cd1e7d3 14-Oct-2008 Wang Chen <wangchen@cn.fujitsu.com> airo: Kill directly reference of netdev->priv

We have some reasons to kill netdev->priv:
1. netdev->priv is equal to netdev_priv().
2. netdev_priv() wraps the calculation of netdev->priv's offset, obviously
netdev_priv() is more flexible than netdev->priv.
But we cann't kill netdev->priv, because so many drivers reference to it
directly.

OK, becasue Dave S. Miller said, "every direct netdev->priv usage is a bug",
and I want to kill netdev->priv later, I decided to convert all the direct
reference of netdev->priv first.

In this driver, I don't simply use netdev_priv() to replace netdev->priv.

The reason is:
Pointer netdev->priv was changed in this driver, but it shouldn't.
Because the memory was allocated when alloc_netdev() and netdev->priv
should always point to that memory.

So I use netdev->ml_priv to replace netdev->priv.
After replacing, both ai and ai->wifidev->ml_priv point to the same memory.

Signed-off-by: Wang Chen <wangchen@cn.fujitsu.com>
Cc: John W. Linville <linville@tuxdriver.com>
Cc: Dan Williams <dcbw@redhat.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
e174961ca1a0b28f7abf0be47973ad57cb74e5f0 27-Oct-2008 Johannes Berg <johannes@sipsolutions.net> net: convert print_mac to %pM

This converts pretty much everything to print_mac. There were
a few things that had conflicts which I have just dropped for
now, no harm done.

I've built an allyesconfig with this and looked at the files
that weren't built very carefully, but it's a huge patch.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
9930ccee16addda9fa7d9af00cd03cd5a10c8965 13-Sep-2008 David Kilroy <kilroyd@googlemail.com> wireless: Read scan flags correctly on x86-64

The SIOCSIWSCAN handler is passed data in an iw_point structure. Some
drivers erronously use an iw_param instead.

On 32 bit architectures the difference isn't noticed as the flags
parameter tends to be the only one used by scan handlers and is at the
same offset.

On 64 bit architectures the pointer in the iw_point structure means the
flag parameter is at different offsets in these structures.

Thanks to Jean Tourrilhes for tracking this down for orinoco, and Pavel
Roskin for confirming the fix and identifying other suspect handlers.

Signed-off-by: David Kilroy <kilroyd@googlemail.com>
Acked-by: Pavel Roskin <proski@gnu.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
c94c93da90a9e46a73a5733ff8454fb4b14733fb 29-Jul-2008 Harvey Harrison <harvey.harrison@gmail.com> wireless: replace __FUNCTION__ with __func__

__FUNCTION__ is gcc-specific, use __func__

Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
e292c737fc57d3ca718056f3308c725c8e541729 25-Jun-2008 Pavel Machek <pavel@suse.cz> wireless: Small cleanups

Small whitespace cleanups for wireless drivers

Signed-off-by: Pavel Machek <pavel@suse.cz>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
ccc580571cf0799d0460a085a7632b77753f083e 17-Jun-2008 David S. Miller <davem@davemloft.net> wext: Emit event stream entries correctly when compat.

Three major portions to this change:

1) Add IW_EV_COMPAT_LCP_LEN, IW_EV_COMPAT_POINT_OFF,
and IW_EV_COMPAT_POINT_LEN helper defines.

2) Delete iw_stream_check_add_*(), they are unused.

3) Add iw_request_info argument to iwe_stream_add_*(), and use it to
size the event and pointer lengths correctly depending upon whether
IW_REQUEST_FLAG_COMPAT is set or not.

4) The mechanical transformations to the drivers and wireless stack
bits to get the iw_request_info passed down into the routines
modified in #3. Also, explicit references to IW_EV_LCP_LEN are
replaced with iwe_stream_lcp_len(info).

With a lot of help and bug fixes from Masakazu Mokuno.

Signed-off-by: David S. Miller <davem@davemloft.net>
cc0d9ff2c998410c7d4a99061a3ebdaa5c55ae9d 10-Jun-2008 Akinobu Mita <akinobu.mita@gmail.com> airo: use simple_read_from_buffer()

Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Cc: Dan Williams <dcbw@redhat.com>
Cc: Michal Schmidt <mschmidt@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
b212f3378a9cfca4da52d7c7e6f79ead8ec287fc 28-May-2008 Andrew Morton <akpm@linux-foundation.org> airo warning fix

WARNING: space prohibited between function name and open parenthesis '('
#22: FILE: drivers/net/wireless/airo.c:2907:
+ while ((IN4500 (ai, COMMAND) & COMMAND_BUSY) && (delay < 10000)) {

total: 0 errors, 1 warnings, 8 lines checked

./patches/wireless-airo-waitbusy-wont-delay.patch has style problems, please review. If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.

Please run checkpatch prior to sending patches

Cc: Dan Williams <dcbw@redhat.com>
Cc: Roel Kluin <roel.kluin@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
229ce3abb6d6d4598de8ef1ed1e2da8163a9bbc0 14-May-2008 Masakazu Mokuno <mokuno@sm.sony.co.jp> wireless: Create 'device' symlink in sysfs

Some network interfaces of the wireless drivers lack the 'device'
symlink in sysfs.
This patch lets the drivers create the links.

Signed-off-by: Masakazu Mokuno <mokuno@sm.sony.co.jp>
Acked-by: Dan Williams <dcbw@redhat.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
b7acbdfbd1f277c1eb23f344f899cfa4cd0bf36a 13-May-2008 Roel Kluin <roel.kluin@gmail.com> wireless, airo: waitbusy() won't delay

There will be no delay even when COMMAND_BUSY (defined 0x8000) is set:
0x8000 & (delay < 10000) will evaluate to 0 - when delay is 0.

Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
5d9276daa4c489e9c37c0f0cda915ece632f3cf1 05-May-2008 Paulius Zaleckas <paulius.zaleckas@teltonika.lt> airo: use netstats in net_device structure

Use net_device_stats from net_device structure instead of local.
Changed airo_read_stats function parameter to net_device.

Signed-off-by: Paulius Zaleckas <paulius.zaleckas@teltonika.lt>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
533dd1b0be103b0ff11da71152877e1ba530f1c2 29-Apr-2008 Harvey Harrison <harvey.harrison@gmail.com> wireless: use get/put_unaligned_* helpers

Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com>
Cc: John W. Linville <linville@tuxdriver.com>
Cc: Michael Buesch <mb@bu3sch.de>
Cc: Daniel Drake <dsd@gentoo.org>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
a95609cb0283a23e519e607ff9fc2a4aa77e2532 29-Apr-2008 Denis V. Lunev <den@openvz.org> netdev: use non-racy method for proc entries creation

Use proc_create()/proc_create_data() to make sure that ->proc_fops and ->data
be setup before gluing PDE to main tree.

Signed-off-by: Denis V. Lunev <den@openvz.org>
Cc: Jeff Garzik <jgarzik@pobox.com>
Cc: Alexey Dobriyan <adobriyan@gmail.com>
Cc: "Eric W. Biederman" <ebiederm@xmission.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
928b4d8c8963e75bdb133f562b03b07f9aa4844a 29-Apr-2008 Alexey Dobriyan <adobriyan@gmail.com> proc: remove proc_root_driver

Use creation by full path: "driver/foo".

Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
3eb9b41f2474c53fe469fbe383955d5aae9e76e4 21-Dec-2007 Al Viro <viro@zeniv.linux.org.uk> airo: last of endianness annotations

sanitize handling of ConfigRid

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
329e2c0067d5a2da88aa844bf57b2aaba9fceb2f 21-Dec-2007 Al Viro <viro@zeniv.linux.org.uk> airo: sanitize handling of StatusRid

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
a749716ecc85743f04f7117e3b373266b63edf7e 20-Dec-2007 Al Viro <viro@zeniv.linux.org.uk> airo: sanitize APListRid handling

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
56d81bd3c76f3ac917a560c662a696aa5e29b980 20-Dec-2007 Al Viro <viro@zeniv.linux.org.uk> airo: sanitize handling of CapabilityRid

Don't byteswap any fields, annotate. That has caught a bug,
BTW - will be handled in the next patch.

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
a23ace5f226aea6c8ba04794720502b1aad1dd92 20-Dec-2007 Al Viro <viro@zeniv.linux.org.uk> airo: sanitize handling of StatsRid

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
4293ea33c8a85c3b4401df5df82fc3e070ec0c8e 20-Dec-2007 Al Viro <viro@zeniv.linux.org.uk> airo: sanitize handling of WepKeyRid

don't byteswap, update users to match that, annotate.

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
17e70491404c73012a7991a068ba62ec59bebdb2 20-Dec-2007 Al Viro <viro@zeniv.linux.org.uk> airo: sanitize BSSListRid handling

Stop byteswap-in-place in readBSSListRid(), annotate the sucker.
BTW, that had immediately found a bug - another codepath fetching
the same struct from card did _not_ byteswap, but used ->dBm the
same as everything else - host-endian. Fix in the next patch...

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
b8c06bc1f39a0311cb0f41099be03ee2b202aeae 19-Dec-2007 Al Viro <viro@zeniv.linux.org.uk> bap_read()/bap_write() work with fixed-endian buffers

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
0dd2212fb6872d8f5dd90391a12fb3fcb877c7c1 17-Dec-2007 Al Viro <viro@zeniv.linux.org.uk> airo: sanitize handling of SSID_rid

* store SSID_rid without conversions
* sanitize proc_SSID_on_close() (and avoid access past the end of
buffer, while we are at it)

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
593c2b9cf28355c6c409d71594bed797279d01f5 17-Dec-2007 Al Viro <viro@zeniv.linux.org.uk> airo: trivial endianness annotations

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2ab1f519cbec0902cb86f1e29b10f2f00dd020c0 21-Dec-2007 Al Viro <viro@zeniv.linux.org.uk> airo: fix writerids() endianness

in writerids() we do _not_ byteswap, so we want to access
->opmode as little-endian.

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15617858b3cf249a3577df8da970f779bbc8a737 20-Dec-2007 Al Viro <viro@zeniv.linux.org.uk> airo endianness bug: cap_rid.extSoftCap

never had been byteswapped, used as host-endian...

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
0300b3321d9ed73a0c3f575f2df250c577852356 20-Dec-2007 Al Viro <viro@zeniv.linux.org.uk> airo: bug in airo_interrupt() handling on incoming 802.11

On big-endian we end up with swapped first two bytes in packet,
due to earlier conversion to host-endian and forgotten conversion
back.

The code we calculated that host-endian for had been duplicated
several time - it finds the 802.11 MAC header length by the first
two bytes of packet; taken into a new helper (header_len(__le16 ctl)).

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
851b3e5e3de0feea7bfee634f99a940648de58c8 20-Dec-2007 Al Viro <viro@zeniv.linux.org.uk> airo: fix endianness bug in ->dBm handling

airo_translate_scan() reads BSSListRid directly, does _not_ byteswap
and uses ->dBm (__le16) as host-endian.

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
977b143c13e685081625704ac356b741d71c6a73 19-Dec-2007 Al Viro <viro@zeniv.linux.org.uk> airo: fix transmit_802_11_packet()

a) gaplen would better be stored little-endian
b) for control packets (shorter than 24-byte header) we ended up with
bap_write(ai, hdrlen == 30 ?
(const u16*)&gap.gaplen : (const u16*)&gap, 38 - hdrlen, BAP1);
passing to card the data past the end of gap (i.e. random stuff from stack)
and did _not_ feed the gaplen at the right offset.
c) sending the contents of uninitialized fields of struct is Not Nice(tm) either

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
79ea13ce07c951bb4d95471e7300baa0f1be9e78 24-Jan-2008 Al Viro <viro@zeniv.linux.org.uk> NULL noise in drivers/net

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
93a3b607e6eff7880959149a581d90c71887eb19 24-Nov-2007 Jeff Garzik <jeff@garzik.org> wireless: checkpatch cleanups

Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
28fc1f5a0c375cb6375fa48e9a8b393f2a189be6 29-Oct-2007 Jeff Garzik <jeff@garzik.org> [netdrvr] irq handler minor cleanups in several drivers

* use irq_handler_t where appropriate

* no need to use 'irq' function arg, its already stored in a data struct

* rename irq handler 'irq' argument to 'dummy', where the function
has been analyzed and proven not to use its first argument.

* remove always-false "dev_id == NULL" test from irq handlers

* remove pointless casts from void*

* declance: irq argument is not const

* add KERN_xxx printk prefix

* fix minor whitespace weirdness

Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
f59d9782751bf1a2c51e7e1e9f614ffec35fb52e 26-Oct-2007 Roel Kluin <12o3l@tiscali.nl> wireless: fix '!x & y' typo's

Fix priority mistakes similar to '!x & y'

Signed-off-by: Roel Kluin <12o3l@tiscali.nl>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
3b04ddde02cf1b6f14f2697da5c20eca5715017f 09-Oct-2007 Stephen Hemminger <shemminger@linux-foundation.org> [NET]: Move hardware header operations out of netdevice.

Since hardware header operations are part of the protocol class
not the device instance, make them into a separate object and
save memory.

Signed-off-by: Stephen Hemminger <shemminger@linux-foundation.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
b95cce3576813ac3f86bafa6b5daaaaf7574b0fe 27-Sep-2007 Stephen Hemminger <shemminger@linux-foundation.org> [NET]: Wrap hard_header_parse

Wrap the hard_header_parse function to simplify next step of
header_ops conversion.

Signed-off-by: Stephen Hemminger <shemminger@linux-foundation.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
0795af5729b18218767fab27c44b1384f72dc9ad 04-Oct-2007 Joe Perches <joe@perches.com> [NET]: Introduce and use print_mac() and DECLARE_MAC_BUF()

This is nicer than the MAC_FMT stuff.

Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
ff8ac60948ba819b89e9c87083e8050fc2f89999 02-Sep-2007 Denis Cheng <crquan@gmail.com> drivers/net/: all drivers/net/ cleanup with ARRAY_SIZE

Signed-off-by: Denis Cheng <crquan@gmail.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
10d024c1b2fd58af8362670d7d6e5ae52fc33353 17-Sep-2007 Ralf Baechle <ralf@linux-mips.org> [NET]: Nuke SET_MODULE_OWNER macro.

It's been a useless no-op for long enough in 2.6 so I figured it's time to
remove it. The number of people that could object because they're
maintaining unified 2.4 and 2.6 drivers is probably rather small.

[ Handled drivers added by netdev tree and some missed IRDA cases... -DaveM ]

Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
d73ae55ad46be6a0a11b9b71f9910c73c1b9dbb7 28-Jul-2007 Bill Nottingham <notting@redhat.com> [PATCH] remove gratuitous space in airo module description

Currently the modinfo looks like:

description: Support for Cisco/Aironet 802.11 wireless ethernet cards. Direct support for ISA/PCI/MPI cards and support for PCMCIA when used with airo_cs.

Arguably, it should be cut at the end of the first sentence.
This at least makes it somewhat more legible.

Signed-off-by: Bill Nottingham <notting@redhat.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
831441862956fffa17b9801db37e6ea1650b0f69 17-Jul-2007 Rafael J. Wysocki <rjw@sisk.pl> Freezer: make kernel threads nonfreezable by default

Currently, the freezer treats all tasks as freezable, except for the kernel
threads that explicitly set the PF_NOFREEZE flag for themselves. This
approach is problematic, since it requires every kernel thread to either
set PF_NOFREEZE explicitly, or call try_to_freeze(), even if it doesn't
care for the freezing of tasks at all.

It seems better to only require the kernel threads that want to or need to
be frozen to use some freezer-related code and to remove any
freezer-related code from the other (nonfreezable) kernel threads, which is
done in this patch.

The patch causes all kernel threads to be nonfreezable by default (ie. to
have PF_NOFREEZE set by default) and introduces the set_freezable()
function that should be called by the freezable kernel threads in order to
unset PF_NOFREEZE. It also makes all of the currently freezable kernel
threads call set_freezable(), so it shouldn't cause any (intentional)
change of behaviour to appear. Additionally, it updates documentation to
describe the freezing of tasks more accurately.

[akpm@linux-foundation.org: build fixes]
Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Acked-by: Nigel Cunningham <nigel@nigel.suspend2.net>
Cc: Pavel Machek <pavel@ucw.cz>
Cc: Oleg Nesterov <oleg@tv-sign.ru>
Cc: Gautham R Shenoy <ego@in.ibm.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
fb038c279694638cb3cd24d496062ae38700f542 29-Jun-2007 Michal Schmidt <mschmidt@redhat.com> [PATCH] airo: start with radio off

Don't turn the radio on until the interface is up. This saves some power in
case the driver is loaded but the card is not used.

Signed-off-by: Michal Schmidt <mschmidt@redhat.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
175ec1a1fa78c784f5f99ad56c2274f58bcb35f1 29-Jun-2007 Michal Schmidt <mschmidt@redhat.com> [PATCH] airo: simpler calling convention for enable_MAC()

Callers of enable_MAC() shouldn't have to worry about the bits in the
response's status word (and most of them don't). The return value is
sufficient information.

Signed-off-by: Michal Schmidt <mschmidt@redhat.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
1138c37b66c16a5c7b49389ae566a4d73d60c2aa 29-Jun-2007 Michal Schmidt <mschmidt@redhat.com> [PATCH] airo: fix a race causing initialization failures

Matteo Croce reported Aironet initialization failures. They were caused by
a race in airo. airo finds a free interface name, then initializes the card
and finally registers the interface. Another device may get the same name
in the meantime.
The reason airo gets its name early is to use it in informative printks and
to name the resources it requests. The printks will be just fine without
the interface name and the resources can use the driver's name - that's
what other network drivers do anyway.
One of the talkative functions is setup_card(). It is called once before
registration and can be called later again. Let's have an empty dev->name
during the first call, so it doesn't print the ugly "airo(eth%d)" message.

Signed-off-by: Michal Schmidt <mschmidt@redhat.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
1c2b7db8c8c4212761fcb5190a4122afd5e02d58 29-Jun-2007 Michal Schmidt <mschmidt@redhat.com> [PATCH] airo: delay some initialization until the netdev is up

airo's kernel thread and the IRQ handler are needed only when the interface
is up.

Signed-off-by: Michal Schmidt <mschmidt@redhat.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
777ec5e9cec521af617fc52a1c1ae24f68f4a43b 29-Jun-2007 Michal Schmidt <mschmidt@redhat.com> [PATCH] airo: disable the PCI device when unloading module

Fix an assymetry between pci_{enable,disable}_device. airo did not disable
the PCI device when unloading the module. This caused suspend failures
after modprobe -r airo && modprobe airo.

Signed-off-by: Michal Schmidt <mschmidt@redhat.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
e63340ae6b6205fef26b40a75673d1c9c0c8bb90 08-May-2007 Randy Dunlap <randy.dunlap@oracle.com> header cleaning: don't include smp_lock.h when not used

Remove includes of <linux/smp_lock.h> where it is not used/needed.
Suggested by Al Viro.

Builds cleanly on x86_64, i386, alpha, ia64, powerpc, sparc,
sparc64, and arm (all 59 defconfigs).

Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
af5b5c9aa92ced95fca509e775aec90933f8959d 16-Mar-2007 Michal Schmidt <mschmidt@redhat.com> [PATCH] airo: Make /sys/bus/pci/drivers/airo/{,un}bind work

The way airo.c keeps track of all its devices is complicated and buggy
as well (del_airo_dev forgets to free the memory add_airo_dev allocates).
It's cleaner to use the standard list primitives.
While we're at it, it's not necessary to put PCI cards in the list, because
the kernel already keeps track of them. We can take advantage of it and
use the .remove callback as it was meant to be.
This makes /sys/bus/pci/drivers/airo/{,un}bind work.

Signed-off-by: Michal Schmidt <mschmidt@redhat.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
fd48f8d3a3e147e666d838194d5f9de64403ecb1 16-Mar-2007 Michal Schmidt <mschmidt@redhat.com> [PATCH] airo: Don't check for NULL before kfree()

It's unnecessary to check for NULL before calling kfree().

Signed-off-by: Michal Schmidt <mschmidt@redhat.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
98e399f82ab3a6d863d1d4a7ea48925cc91c830e 19-Mar-2007 Arnaldo Carvalho de Melo <acme@redhat.com> [SK_BUFF]: Introduce skb_mac_header()

For the places where we need a pointer to the mac header, it is still legal to
touch skb->mac.raw directly if just adding to, subtracting from or setting it
to another layer header.

This one also converts some more cases to skb_reset_mac_header() that my
regex missed as it had no spaces before nor after '=', ugh.

Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
459a98ed881802dee55897441bc7f77af614368e 19-Mar-2007 Arnaldo Carvalho de Melo <acme@redhat.com> [SK_BUFF]: Introduce skb_reset_mac_header(skb)

For the common, open coded 'skb->mac.raw = skb->data' operation, so that we can
later turn skb->mac.raw into a offset, reducing the size of struct sk_buff in
64bit land while possibly keeping it as a pointer on 32bit.

This one touches just the most simple case, next will handle the slightly more
"complex" cases.

Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
4c13eb6657fe9ef7b4dc8f1a405c902e9e5234e0 26-Apr-2007 Arnaldo Carvalho de Melo <acme@redhat.com> [ETH]: Make eth_type_trans set skb->dev like the other *_type_trans

One less thing for drivers writers to worry about.

Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
4d881901b8c2167884d213eb546ffffc9e5e35ac 16-Mar-2007 Michal Schmidt <mschmidt@redhat.com> [PATCH] airo: Fix an error path memory leak

The airo driver leaks memory if request_irq() fails.

Signed-off-by: Michal Schmidt <mschmidt@redhat.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
e7c04fd3d00f69ce1cad5418a08016da484ea86a 05-Feb-2007 Ahmed S. Darwish <darwish.07@gmail.com> [PATCH] misc-wireless: Use ARRAY_SIZE macro when appropriate

A patch to use ARRAY_SIZE macro already defined in kernel.h for some
miscellaneous wireless drivers with no specific maintaners.

Signed-off-by: Ahmed S. Darwish <darwish.07@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
d54b1fdb1d9f82e375a299e22bd366aad52d4c34 12-Feb-2007 Arjan van de Ven <arjan@linux.intel.com> [PATCH] mark struct file_operations const 5

Many struct file_operations in the kernel can be "const". Marking them const
moves these to the .rodata section, which avoids false sharing with potential
dirty data. In addition it'll catch accidental writes at compile time to
these shared resources.

Signed-off-by: Arjan van de Ven <arjan@linux.intel.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
7dfb71030f7636a0d65200158113c37764552f93 07-Dec-2006 Nigel Cunningham <ncunningham@linuxmail.org> [PATCH] Add include/linux/freezer.h and move definitions from sched.h

Move process freezing functions from include/linux/sched.h to freezer.h, so
that modifications to the freezer or the kernel configuration don't require
recompiling just about everything.

[akpm@osdl.org: fix ueagle driver]
Signed-off-by: Nigel Cunningham <nigel@suspend2.net>
Cc: "Rafael J. Wysocki" <rjw@sisk.pl>
Cc: Pavel Machek <pavel@ucw.cz>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
5bb85f18087b10a908bd793e9fd3ccd63aebb724 10-Oct-2006 Dave Kleikamp <shaggy@austin.ibm.com> [PATCH] airo: check if need to freeze

The airo driver used to break out of while loop if there were any signals
pending. Since it no longer checks for signals, it at least needs to check
if it needs to be frozen.

Signed-off-by: Dave Kleikamp <shaggy@austin.ibm.com>
Cc: Jean Tourrilhes <jt@hpl.hp.com>
Cc: Sukadev Bhattiprolu <sukadev@us.ibm.com>
Cc: Jeff Garzik <jeff@garzik.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
53077944f119808df3d1c6be07241f17a87e7c28 10-Oct-2006 Jean Tourrilhes <jt@hpl.hp.com> [PATCH] wireless: More WE-21 potential overflows...

After the Orinoco issue, I did an audit of other drivers for the same
issue. Three drivers were NULL terminating the ESSID, which could cause an
overflow in WE-21 when the ESSID has maximum size.

Signed-off-by: Jean Tourrilhes <jt@hpl.hp.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
431aca5a18f15f61cc51c466073928c4f9565fe4 10-Oct-2006 Florin Malita <fmalita@gmail.com> [PATCH] airo.c: check returned values

create_proc_entry() can fail and return NULL in setup_proc_entry(), the
result must be checked before dereferencing. (Coverity ID 1443)

init_wifidev() & setup_proc_entry() can also fail in _init_airo_card().

This adds the checks & cleanup code and removes some whitespace.

Signed-off-by: Florin Malita <fmalita@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
7d12e780e003f93433d49ce78cfedf4b4c52adc5 05-Oct-2006 David Howells <dhowells@redhat.com> IRQ: Maintain regs pointer globally rather than passing to IRQ handlers

Maintain a per-CPU global "struct pt_regs *" variable which can be used instead
of passing regs around manually through all ~1800 interrupt handlers in the
Linux kernel.

The regs pointer is used in few places, but it potentially costs both stack
space and code to pass it around. On the FRV arch, removing the regs parameter
from all the genirq function results in a 20% speed up of the IRQ exit path
(ie: from leaving timer_interrupt() to leaving do_IRQ()).

Where appropriate, an arch may override the generic storage facility and do
something different with the variable. On FRV, for instance, the address is
maintained in GR28 at all times inside the kernel as part of general exception
handling.

Having looked over the code, it appears that the parameter may be handed down
through up to twenty or so layers of functions. Consider a USB character
device attached to a USB hub, attached to a USB controller that posts its
interrupts through a cascaded auxiliary interrupt controller. A character
device driver may want to pass regs to the sysrq handler through the input
layer which adds another few layers of parameter passing.

I've build this code with allyesconfig for x86_64 and i386. I've runtested the
main part of the code on FRV and i386, though I can't test most of the drivers.
I've also done partial conversion for powerpc and MIPS - these at least compile
with minimal configurations.

This will affect all archs. Mostly the changes should be relatively easy.
Take do_IRQ(), store the regs pointer at the beginning, saving the old one:

struct pt_regs *old_regs = set_irq_regs(regs);

And put the old one back at the end:

set_irq_regs(old_regs);

Don't pass regs through to generic_handle_irq() or __do_IRQ().

In timer_interrupt(), this sort of change will be necessary:

- update_process_times(user_mode(regs));
- profile_tick(CPU_PROFILING, regs);
+ update_process_times(user_mode(get_irq_regs()));
+ profile_tick(CPU_PROFILING);

I'd like to move update_process_times()'s use of get_irq_regs() into itself,
except that i386, alone of the archs, uses something other than user_mode().

Some notes on the interrupt handling in the drivers:

(*) input_dev() is now gone entirely. The regs pointer is no longer stored in
the input_dev struct.

(*) finish_unlinks() in drivers/usb/host/ohci-q.c needs checking. It does
something different depending on whether it's been supplied with a regs
pointer or not.

(*) Various IRQ handler function pointers have been moved to type
irq_handler_t.

Signed-Off-By: David Howells <dhowells@redhat.com>
(cherry picked from 1b16e7ac850969f38b375e511e3fa2f474a33867 commit)
de897881e474cae06cf06c830fcadc916c53ce64 01-Oct-2006 Jeff Garzik <jeff@garzik.org> drivers/net/wireless/{airo,ipw2100}: fix error handling bugs

airo:
* fix oops, if !CONFIG_PROC_FS (create_proc_entry always returns NULL)

* handle pci_register_driver() failure. if it fails, we really do
want to exit, rather than (as a comment indicates) return success
because-we-are-a-library.

* #if 0 have_isa_dev variable, which is assigned a value but never used

ipw2100:
* handle sysfs_create_group() failure

* handle driver_create_file() failure

Signed-off-by: Jeff Garzik <jeff@garzik.org>
7f8544cc95c7f521847fa760ce38d932e6ab4542 30-Aug-2006 Jean Tourrilhes <jt@hpl.hp.com> [PATCH] WE-21 for airo

Signed-off-by: Jean Tourrilhes <jt@hpl.hp.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
f12cc2090d721647c23dfce20834f4306db3b77d 22-Aug-2006 Herbert Xu <herbert@gondor.apana.org.au> [CRYPTO] users: Use block ciphers where applicable

This patch converts all remaining users to use the new block cipher type
where applicable. It also changes all simple cipher operations to use
the new encrypt_one/decrypt_one interface.

Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
3b4c7d640376dbccfe80fc4f7b8772ecc7de28c5 15-Aug-2006 Sukadev Bhattiprolu <sukadev@us.ibm.com> [PATCH] kthread: airo.c

The airo driver is currently caching a pid for later use, but with the
implementation of containers, pids themselves do not uniquely identify a
task. The driver is also using kernel_thread() which is deprecated in
drivers.

This patch essentially replaces the kernel_thread() with kthread_create().
It also stores the task_struct of the airo_thread rather than its pid.
Since this introduces a second task_struct in struct airo_info, the patch
renames airo_info.task to airo_info.list_bss_task.

As an extension of these changes, the patch further:

- replaces kill_proc() with kthread_stop()
- replaces signal_pending() with kthread_should_stop()
- removes thread completion synchronisation which is handled by
kthread_stop().

[akpm@osdl.org: fix races]
Signed-off-by: Sukadev Bhattiprolu <sukadev@us.ibm.com>
Cc: Javier Achirica <achirica@gmail.com>
Cc: Christoph Hellwig <hch@infradead.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13dca9b87edebd5aa1d9ea5811bcf0fa1e975b52 10-Jul-2006 Robert Schulze <rob@net-pr.de> [PATCH] airo: collapse debugging-messages in issuecommand to one line


Signed-off-by: John W. Linville <linville@tuxdriver.com>
1fb9df5d3069064c037c81c0ab8bf783ffa5e373 02-Jul-2006 Thomas Gleixner <tglx@linutronix.de> [PATCH] irq-flags: drivers/net: Use the new IRQF_ constants

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Jeff Garzik <jeff@garzik.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
6ab3d5624e172c553004ecc862bfeac16d9d68b7 30-Jun-2006 Jörn Engel <joern@wohnheim.fh-wedel.de> Remove obsolete #include <linux/config.h>

Signed-off-by: Jörn Engel <joern@wohnheim.fh-wedel.de>
Signed-off-by: Adrian Bunk <bunk@stusta.de>
0c6157a371f72b91bd9d2f72c2e65e2bde4cdf39 02-May-2006 Michal Schmidt <xschmi00@stud.feec.vutbr.cz> [PATCH] wireless/airo: minimal WPA awareness

Running Linux 2.6.17-rc3-mm1 which has this patch included I get this
interesting message:
airo(eth0): WPA unsupported (only firmware versions 5.30.17 and greater
support WPA. Detected 5.30.17)

airo_test_wpa_capable assumes that the softSubVer part of the firmware
version number is coded in BCD. Apparently, that's not true.
I have firmware version 5.30.17 and cap_rid.softSubVer is 0x11==17.

Signed-off-by: Michal Schmidt <xschmi00@stud.feec.vutbr.cz>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
3c304956755fa63ee80ca51ce38078fe1c4e8818 15-Apr-2006 Dan Williams <dcbw@redhat.com> [PATCH] wireless/airo: minimal WPA awareness

airo cards with firmware versions of 5.30.17 and higher support WPA.
This patch recognizes WPA-capable firmware versions and adds support for
retrieving the WPA and RSN information elements from the card's scan
results. The JOB and FLAG fields are now independent, since there was
no space left in the FLAG field for FLAG_WPA_CAPABLE.

Signed-off-by: matthieu castet <castet.matthieu@free.fr>
Signed-off-by: Dan Williams <dcbw@redhat.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
6fcdf565ffb8c661749372115d28efdbe525aeba 31-Mar-2006 Dan Williams <dcbw@redhat.com> [PATCH] wireless/airo: clean up WEXT association and scan events

Airo firmware versions >= 5.30.17 send re-association events to the
driver that are currently unrecognized, causing spurious disassociation
events to be sent to user space. Loss of sync due to scan requests also
results in disassociation events sent to user space. This patch traps
those two events; suppressing sync-loss on scan, and sending the correct
association event on re-association notifications.

Signed-off-by: Dan Williams <dcbw@redhat.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
9e75af30d529d54fc650586776c100d0665c0c93 16-Mar-2006 Dan Williams <dcbw@redhat.com> [PATCH] wireless/airo: cache wireless scans

Observed problems when multiple processes request scans and subsequently
scan results. This causes a scan result request to hit card registers
before the scan is complete, returning an incomplete scan list and
possibly making the card very angry. Instead, cache the results of a
wireless scan and serve result requests from the cache, rather than
hitting the hardware for them.

Signed-off-by: Dan Williams <dcbw@redhat.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15db2763202b9479f3d30ea61a283be4fc48559d 16-Mar-2006 Dan Williams <dcbw@redhat.com> [PATCH] wireless/airo: define default MTU

The number 2312 was used all over the place to refer to the card's
default MTU. Make it a #define and use that everywhere rather than the
number.

Signed-off-by: Dan Williams <dcbw@redhat.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
934d8bf142541ea013bc4002e200fa0e6815bf38 16-Mar-2006 Dan Williams <dcbw@redhat.com> [PATCH] wireless/airo: clean up printk usage to print device name

Show the specific device that driver messages are about.

Signed-off-by: Dan Williams <dcbw@redhat.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
a23f460dd0c7c9c58b03494c7819e126b2c72383 27-Feb-2006 Dan Williams <dcbw@redhat.com> [PATCH] wireless/airo: Remove 'Setting transmit key' info messages

These messages end up polluting logs when things like NetworkManager or
wpa_supplicant are controlling the driver. They aren't really that
useful, and no other drivers output messages like this when the user
fiddles with encryption keys. Users can use iwconfig and other
wireless-tools methods to determine and change the current transmit key
if they wish to do so manually. Therefore, remove the messages.

Signed-off-by: Dan Williams <dcbw@redhat.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
22d8846e5ce329436628da71a4239ccc2745869f 06-Feb-2006 Dan Williams <dcbw@redhat.com> [PATCH] wireless/airo: fix setting TX key index plus key in ENCODEEXT

The previous patch that added ENCODEEXT and AUTH support to the airo
driver contained a slight error which would cause setting the TX
key index ignore a valid key-set request at the same time. This patch
allows any combination of setting the TX key index and setting an
encryption key.

Signed-off-by: Dan Williams <dcbw@redhat.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
4be757dd4c00ddabff2d6faf639466bb5d76bc79 30-Jan-2006 Dan Williams <dcbw@redhat.com> [PATCH] wireless/airo: add IWENCODEEXT and IWAUTH support

This patch adds IWENCODEEXT and IWAUTH support to the airo driver for
WEP and unencrypted operation. No WPA though. It allows the driver to
operate more willingly with wpa_supplicant and NetworkManager.

Signed-off-by: Dan Williams <dcbw@redhat.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
a39d3e796cd2df8576c0418faa2c3833153bb3a9 21-Jan-2006 Adrian Bunk <bunk@stusta.de> [PATCH] AIRO{,_CS} <-> CRYPTO fixes

CRYPTO is a helper variable, and to make it easier for users, it should
therefore select'ed and not be listed in the dependencies.

drivers/net/wireless/airo.c requires CONFIG_CRYPTO for compilations.

Therefore, AIRO_CS also has to CRYPTO.

Additionally, this patch removes the #ifdef's for the non-compiling
CRYPTO=n case from drivers/net/wireless/airo.c.

Signed-off-by: Adrian Bunk <bunk@stusta.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2610c733023850be2db9fef9c81f851a64bb9f67 17-Jan-2006 Javier Achirica <achirica@gmail.com> airo: Off-by-one channel fix
d6a13a24b76236ade7fd70081ba41a51e8215578 12-Jan-2006 Dan Williams <dcbw@redhat.com> [PATCH] drivers/net/wireless: correct reported ssid lengths

ESSIDs can technically include NULL characters. Drivers should not be
adjusting the length of the ESSID before reporting it in their
SIOCGIWESSID handlers. Breaks stuff like wpa_supplicant. Note that ipw
drivers, which seem to currently be the "most correct", don't have this
problem.

Signed-off-by: Dan Williams <dcbw@redhat.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
f89b23217372ed9bdba8804c1616d445402d1e05 11-Nov-2005 Dan Streetman <ddstreet@ieee.org> [PATCH] airo.c: add support for IW_ENCODE_TEMP (i.e. xsupplicant)

Hello Jeff,

this patch changes causes the airo driver to not reset the card when a
temporary WEP key is set, when the IW_ENCODE_TEMP flag is used. This is
needed for xsupplicant as 802.1x, LEAP, etc. change WEP keys frequently
after authentication and resetting the card causes infinite
reauthentication.

Javier and Jean agree with the patch, Javier suggested I send this to
you, can you apply this?

Thanks.

Signed-off-by: Dan Streetman <ddstreet@ieee.org>
Signed-off-by: Jeff Garzik <jgarzik@pobox.com>
1d97f384486a697ed227ef4609a26f18a8ea9a11 01-Dec-2005 Matthieu CASTET <castet.matthieu@free.fr> [wireless airo] reset card in init

without this patch after an rmmod, modprobe the card won't work anymore
until the next reboot.

This patch seem safe to apply for all cards as the bsd driver already do
that.

I had to add a timeout because strange things happen (issuecommand will
fail) if the card is already reseted (after a reboot).

PS : it seems there are missing reset when leaving monitor mode...

Signed-off-by: Matthieu CASTET <castet.matthieu@free.fr>
b69a3aa85cb7bda2eb6c5932a62c1337d0d6612c 08-Nov-2005 Panagiotis Issaris <takis@issaris.org> [PATCH] wireless net: Conversions of kmalloc/memset to kzalloc

More conversions of kmalloc/memset to kzalloc

Signed-off-by: Panagiotis Issaris <takis@issaris.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
d38087609aefdf0918960c9d941d46f884a4f4eb 05-Nov-2005 Adrian Bunk <bunk@stusta.de> [PATCH] airo.c/airo_cs.c: correct prototypes

This patch creates a file airo.h containing prototypes of the global
functions in airo.c used by airo_cs.c .

If you got strange problems with either airo_cs devices or in any other
completely unrelated part of the kernel shortly or long after a airo_cs
device was detected by the kernel, this might have been caused by the
fact that caller and callee disagreed regarding the size of the first
argument to init_airo_card()...

Signed-off-by: Adrian Bunk <bunk@stusta.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
29b09fcc341ede8dc08c900b132903fdd0231400 04-Nov-2005 Gabriel A. Devenyi <ace@staticwave.ca> [PATCH] drivers/net/wireless/airo.c unsigned comparason

fid is declared as a u32 (unsigned int), and then a few lines later, it is checked for a value < 0, which is clearly useless.
In the two locations this function is used, in one it is *explicitly* given a negative number, which would be ignored with the
current definition.

Thanks to LinuxICC (http://linuxicc.sf.net).

Signed-off-by: Gabriel A. Devenyi <ace@staticwave.ca>
Signed-off-by: Jeff Garzik <jgarzik@pobox.com>
6df5b9f48dd0e77fa796b9b7d3fde7cc5f1237f2 19-Sep-2005 Herbert Xu <herbert@gondor.apana.org.au> [CRYPTO] Simplify one-member scatterlist expressions

This patch rewrites various occurences of &sg[0] where sg is an array
of length one to simply sg.

Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
378f058cc49bcda7fa63d3cd86d2f9a0a5188b1c 17-Sep-2005 David Hardeman <david@2gen.com> [PATCH] Use sg_set_buf/sg_init_one where applicable

This patch uses sg_set_buf/sg_init_one in some places where it was
duplicated.

Signed-off-by: David Hardeman <david@2gen.com>
Cc: James Bottomley <James.Bottomley@steeleye.com>
Cc: Greg KH <greg@kroah.com>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: Jeff Garzik <jgarzik@pobox.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
b4558ea93d66a43f7990d26f145fd4c54a01c9bf 28-Oct-2005 Jesper Juhl <jesper.juhl@gmail.com> drivers/net: Remove pointless checks for NULL prior to calling kfree()
53232803241ae0f26b39897a4d4b37775837de00 04-Oct-2005 Michal Schmidt <xschmi00@stud.feec.vutbr.cz> airo: fix resume

Cisco Aironet doesn't resume properly from swsusp, because the resume
method confuses a PM_EVENT_* for a PCI power state. It thinks that it is
resuming from PCI_D1 and doesn't do the necessary initialization of the
card.

Signed-off-by: Michal Schmidt <xschmi00@stud.feec.vutbr.cz>
2759c8d536efe3b853867f345627d89fb64c37af 24-Sep-2005 Jeff Garzik <jgarzik@pobox.com> [wireless airo] remove needed dma_addr_t obfuscation

Fixes bus address truncation bug for certain configs.
e2e965072564e7aad8df963107677a6d22c41767 24-Sep-2005 Jeff Garzik <jgarzik@pobox.com> Remove WIRELESS_EXT ifdefs from several wireless drivers.
1141455d5e29e47004ad61e0fc385cb612d4e51c 12-Sep-2005 matthieu castet <castet.matthieu@free.fr> [PATCH] airo : fix channel number in scan

this patch display the correct channel number with iwlist scan

Signed-off-by: Matthieu CASTET <castet.matthieu@free.fr>
Signed-off-by: Jeff Garzik <jgarzik@pobox.com>
bbeec90b98a3066f6f2b8d41c80561f5665e4631 07-Sep-2005 Jeff Garzik <jgarzik@pobox.com> [wireless] build fixes after merging WE-19
ce6623c3d8f932a15306355a7c9a0cdfdd6a26ec 02-Sep-2005 Jean Tourrilhes <jt@hpl.hp.com> [PATCH] airo : WE-19 support

Dan Williams already included most parts of my WE-19 patch for
the airo driver in the kernel. There was just a few bits he could not
do because WE-19 itself was not in the kernel. Those are the missing
bits.
Tested with 2.6.13 (with real HW).

Signed-off-by: Jean Tourrilhes <jt@hpl.hp.com>
Signed-off-by: Jeff Garzik <jgarzik@pobox.com>
ca078bae813dd46c0f9b102fdfb4a3384641ff48 04-Sep-2005 Pavel Machek <pavel@ucw.cz> [PATCH] swsusp: switch pm_message_t to struct

This adds type-checking to pm_message_t, so that people can't confuse it
with int or u32. It also allows us to fix "disk yoyo" during suspend (disk
spinning down/up/down).

[We've tried that before; since that cpufreq problems were fixed and I've
tried make allyes config and fixed resulting damage.]

Signed-off-by: Pavel Machek <pavel@suse.cz>
Signed-off-by: Alexander Nyberg <alexn@telia.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
573dbd95964b01a942aa0c68e92b06f2c9536964 02-Sep-2005 Jesper Juhl <jesper.juhl@gmail.com> [CRYPTO]: crypto_free_tfm() callers no longer need to check for NULL

Since the patch to add a NULL short-circuit to crypto_free_tfm() went in,
there's no longer any need for callers of that function to check for NULL.
This patch removes the redundant NULL checks and also a few similar checks
for NULL before calls to kfree() that I ran into while doing the
crypto_free_tfm bits.

I've succesfuly compile tested this patch, and a kernel with the patch
applied boots and runs just fine.

When I posted the patch to LKML (and other lists/people on Cc) it drew the
following comments :

J. Bruce Fields commented
"I've no problem with the auth_gss or nfsv4 bits.--b."

Sridhar Samudrala said
"sctp change looks fine."

Herbert Xu signed off on the patch.

So, I guess this is ready to be dropped into -mm and eventually mainline.

Signed-off-by: Jesper Juhl <jesper.juhl@gmail.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
eb6f1160ddb2fdadf50f350da79d0796c37f17e2 02-Sep-2005 Herbert Xu <herbert@gondor.apana.org.au> [CRYPTO]: Use CRYPTO_TFM_REQ_MAY_SLEEP where appropriate

This patch goes through the current users of the crypto layer and sets
CRYPTO_TFM_REQ_MAY_SLEEP at crypto_alloc_tfm() where all crypto operations
are performed in process context.

Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
77933d7276ee8fa0e2947641941a6f7a100a327b 27-Jul-2005 Jesper Juhl <juhl@dif.dk> [PATCH] clean up inline static vs static inline

`gcc -W' likes to complain if the static keyword is not at the beginning of
the declaration. This patch fixes all remaining occurrences of "inline
static" up with "static inline" in the entire kernel tree (140 occurrences in
47 files).

While making this change I came across a few lines with trailing whitespace
that I also fixed up, I have also added or removed a blank line or two here
and there, but there are no functional changes in the patch.

Signed-off-by: Jesper Juhl <juhl-lkml@dif.dk>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
b03efcfb2180289718991bb984044ce6c5b7d1b0 08-Jul-2005 David S. Miller <davem@davemloft.net> [NET]: Transform skb_queue_len() binary tests into skb_queue_empty()

This is part of the grand scheme to eliminate the qlen
member of skb_queue_head, and subsequently remove the
'list' member of sk_buff.

Most users of skb_queue_len() want to know if the queue is
empty or not, and that's trivially done with skb_queue_empty()
which doesn't use the skb_queue_head->qlen member and instead
uses the queue list emptyness as the test.

Signed-off-by: David S. Miller <davem@davemloft.net>
62595eb9066ea09f7f8a789a38bec16d70ee0321 20-Jun-2005 Domen Puncer <domen@coderock.org> [PATCH] wireless: char* -> char[] conversion in airo.c

This conversion makes code from line 7101 right:
if (copy_to_user(com.data, swversion, sizeof(swversion)))

size output (before, after):
55416 2228 160 57804 e1cc drivers/net/wireless/airo.o
55412 2228 160 57800 e1c8 drivers/net/wireless/airo.o

more outputs from Alexey Dobriyan:
2.95.3:
text data bss dec hex filename
before 51118 2156 160 53434 d0ba drivers/net/wireless/airo.o
after 51118 2156 160 53434 d0ba drivers/net/wireless/airo.o

3.3.5-20050130:
before 46999 2156 160 49315 c0a3 drivers/net/wireless/airo.o
after 46994 2156 160 49310 c09e drivers/net/wireless/airo.o

4.1.0-20050522:
before 45555 2220 160 47935 bb3f drivers/net/wireless/airo.o
after 45550 2220 160 47930 bb3a drivers/net/wireless/airo.o

Signed-off-by: Domen Puncer <domen@coderock.org>
1cc68ae0cf9e3384d9eef6985b312bf2bf1161b3 21-Jun-2005 Pavel Machek <pavel@ucw.cz> [PATCH] fix int vs. pm_message_t confusion in airo

Fix int vs. pm_message_t confusion in airo. Should change no code.

Signed-off-by: Pavel Machek <pavel@suse.cz>
Cc: Jeff Garzik <jgarzik@pobox.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
3e1d1d28d99dabe63c64f7f40f1ca1d646de1f73 25-Jun-2005 Christoph Lameter <christoph@lameter.com> [PATCH] Cleanup patch for process freezing

1. Establish a simple API for process freezing defined in linux/include/sched.h:

frozen(process) Check for frozen process
freezing(process) Check if a process is being frozen
freeze(process) Tell a process to freeze (go to refrigerator)
thaw_process(process) Restart process
frozen_process(process) Process is frozen now

2. Remove all references to PF_FREEZE and PF_FROZEN from all
kernel sources except sched.h

3. Fix numerous locations where try_to_freeze is manually done by a driver

4. Remove the argument that is no longer necessary from two function calls.

5. Some whitespace cleanup

6. Clear potential race in refrigerator (provides an open window of PF_FREEZE
cleared before setting PF_FROZEN, recalc_sigpending does not check
PF_FROZEN).

This patch does not address the problem of freeze_processes() violating the rule
that a task may only modify its own flags by setting PF_FREEZE. This is not clean
in an SMP environment. freeze(process) is therefore not SMP safe!

Signed-off-by: Christoph Lameter <christoph@lameter.com>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
41480af27a85d6008d9e11db8bc2730407c25e1d 10-May-2005 Dan Williams <dcbw@redhat.com> [PATCH] wireless/airo: WEXT and quality corrections

This patch brings the airo driver into line with the current
WEXT specification of signal quality. It also fixes the values
used to determine signal quality and level for MPI & PCMCIA 350
cards. It turns out that BSSListRid.rssi was actually in dBm
for 350 series cards, and that we can use the normalized
signal strength reported by the card as our "quality" value, on
a scale of 0 - 100. Since signal level values are in dBm for
this driver, max_qual->level MUST be 0, as specified in the WEXT
spec. This patch also uses the IW_QUAL constants new in WEXT
version 17.

Signed-off-by: Dan Williams <dcbw@redhat.com>
ff1d2767d5a43c85f944e86a45284b721f66196c 13-May-2005 Jouni Malinen <jkmaline@cc.hut.fi> Add HostAP wireless driver.

Includes minor cleanups from Adrian Bunk <bunk@stusta.de>.
05adc3b7458e97a1d0180828000207a403083389 17-Apr-2005 Pavel Machek <pavel@ucw.cz> [PATCH] u32 vs. pm_message_t fixes for drivers/net

This fixes remaining u32s in drivers/ net.

Signed-off-by: Pavel Machek <pavel@suse.cz>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 17-Apr-2005 Linus Torvalds <torvalds@ppc970.osdl.org> Linux-2.6.12-rc2

Initial git repository build. I'm not bothering with the full history,
even though we have it. We can create a separate "historical" git
archive of that later if we want to, and in the meantime it's about
3.2GB when imported into git - space that would just make the early
git days unnecessarily complicated, when we don't have a lot of good
infrastructure for it.

Let it rip!