aboutsummaryrefslogtreecommitdiff
path: root/drivers/net/wireless/airo.c
AgeCommit message (Collapse)AuthorFilesLines
2008-04-29wireless: use get/put_unaligned_* helpersHarvey Harrison1-1/+1
Signed-off-by: Harvey Harrison <[email protected]> Cc: John W. Linville <[email protected]> Cc: Michael Buesch <[email protected]> Cc: Daniel Drake <[email protected]> Cc: Al Viro <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2008-04-29netdev: use non-racy method for proc entries creationDenis V. Lunev1-52/+32
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 <[email protected]> Cc: Jeff Garzik <[email protected]> Cc: Alexey Dobriyan <[email protected]> Cc: "Eric W. Biederman" <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2008-04-29proc: remove proc_root_driverAlexey Dobriyan1-4/+4
Use creation by full path: "driver/foo". Signed-off-by: Alexey Dobriyan <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2008-01-28airo: last of endianness annotationsAl Viro1-226/+218
sanitize handling of ConfigRid Signed-off-by: Al Viro <[email protected]> Signed-off-by: John W. Linville <[email protected]>
2008-01-28airo: sanitize handling of StatusRidAl Viro1-65/+67
Signed-off-by: Al Viro <[email protected]> Signed-off-by: John W. Linville <[email protected]>
2008-01-28airo: sanitize APListRid handlingAl Viro1-12/+11
Signed-off-by: Al Viro <[email protected]> Signed-off-by: John W. Linville <[email protected]>
2008-01-28airo: sanitize handling of CapabilityRidAl Viro1-63/+69
Don't byteswap any fields, annotate. That has caught a bug, BTW - will be handled in the next patch. Signed-off-by: Al Viro <[email protected]> Signed-off-by: John W. Linville <[email protected]>
2008-01-28airo: sanitize handling of StatsRidAl Viro1-36/+42
Signed-off-by: Al Viro <[email protected]> Signed-off-by: John W. Linville <[email protected]>
2008-01-28airo: sanitize handling of WepKeyRidAl Viro1-39/+33
don't byteswap, update users to match that, annotate. Signed-off-by: Al Viro <[email protected]> Signed-off-by: John W. Linville <[email protected]>
2008-01-28airo: sanitize BSSListRid handlingAl Viro1-39/+30
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 <[email protected]> Signed-off-by: John W. Linville <[email protected]>
2008-01-28bap_read()/bap_write() work with fixed-endian buffersAl Viro1-27/+29
Signed-off-by: Al Viro <[email protected]> Signed-off-by: John W. Linville <[email protected]>
2008-01-28airo: sanitize handling of SSID_ridAl Viro1-54/+49
* 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 <[email protected]> Signed-off-by: John W. Linville <[email protected]>
2008-01-28airo: trivial endianness annotationsAl Viro1-25/+26
Signed-off-by: Al Viro <[email protected]> Signed-off-by: John W. Linville <[email protected]>
2008-01-28airo: fix writerids() endiannessAl Viro1-2/+2
in writerids() we do _not_ byteswap, so we want to access ->opmode as little-endian. Signed-off-by: Al Viro <[email protected]> Signed-off-by: John W. Linville <[email protected]>
2008-01-28airo endianness bug: cap_rid.extSoftCapAl Viro1-1/+2
never had been byteswapped, used as host-endian... Signed-off-by: Al Viro <[email protected]> Signed-off-by: John W. Linville <[email protected]>
2008-01-28airo: bug in airo_interrupt() handling on incoming 802.11Al Viro1-51/+23
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 <[email protected]> Signed-off-by: John W. Linville <[email protected]>
2008-01-28airo: fix endianness bug in ->dBm handlingAl Viro1-3/+6
airo_translate_scan() reads BSSListRid directly, does _not_ byteswap and uses ->dBm (__le16) as host-endian. Signed-off-by: Al Viro <[email protected]> Signed-off-by: John W. Linville <[email protected]>
2008-01-28airo: fix transmit_802_11_packet()Al Viro1-8/+3
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 <[email protected]> Signed-off-by: John W. Linville <[email protected]>
2008-01-28NULL noise in drivers/netAl Viro1-1/+1
Signed-off-by: Al Viro <[email protected]> Signed-off-by: Jeff Garzik <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2008-01-28wireless: checkpatch cleanupsJeff Garzik1-2/+1
Signed-off-by: Jeff Garzik <[email protected]>
2008-01-28[netdrvr] irq handler minor cleanups in several driversJeff Garzik1-2/+3
* 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 <[email protected]>
2008-01-28wireless: fix '!x & y' typo'sRoel Kluin1-1/+1
Fix priority mistakes similar to '!x & y' Signed-off-by: Roel Kluin <[email protected]> Signed-off-by: John W. Linville <[email protected]>
2007-10-10[NET]: Move hardware header operations out of netdevice.Stephen Hemminger1-1/+5
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 <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2007-10-10[NET]: Wrap hard_header_parseStephen Hemminger1-6/+1
Wrap the hard_header_parse function to simplify next step of header_ops conversion. Signed-off-by: Stephen Hemminger <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2007-10-10[NET]: Introduce and use print_mac() and DECLARE_MAC_BUF()Joe Perches1-20/+12
This is nicer than the MAC_FMT stuff. Signed-off-by: Joe Perches <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2007-10-10drivers/net/: all drivers/net/ cleanup with ARRAY_SIZEDenis Cheng1-3/+3
Signed-off-by: Denis Cheng <[email protected]> Signed-off-by: Jeff Garzik <[email protected]>
2007-10-10[NET]: Nuke SET_MODULE_OWNER macro.Ralf Baechle1-1/+0
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 <[email protected]> Signed-off-by: Jeff Garzik <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2007-10-10[PATCH] remove gratuitous space in airo module descriptionBill Nottingham1-2/+2
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 <[email protected]> Signed-off-by: John W. Linville <[email protected]>
2007-07-17Freezer: make kernel threads nonfreezable by defaultRafael J. Wysocki1-1/+2
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. [[email protected]: build fixes] Signed-off-by: Rafael J. Wysocki <[email protected]> Acked-by: Nigel Cunningham <[email protected]> Cc: Pavel Machek <[email protected]> Cc: Oleg Nesterov <[email protected]> Cc: Gautham R Shenoy <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2007-07-10[PATCH] airo: start with radio offMichal Schmidt1-1/+1
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 <[email protected]> Signed-off-by: John W. Linville <[email protected]>
2007-07-10[PATCH] airo: simpler calling convention for enable_MAC()Michal Schmidt1-36/+27
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 <[email protected]> Signed-off-by: John W. Linville <[email protected]>
2007-07-10[PATCH] airo: fix a race causing initialization failuresMichal Schmidt1-31/+28
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 <[email protected]> Signed-off-by: John W. Linville <[email protected]>
2007-07-10[PATCH] airo: delay some initialization until the netdev is upMichal Schmidt1-35/+45
airo's kernel thread and the IRQ handler are needed only when the interface is up. Signed-off-by: Michal Schmidt <[email protected]> Signed-off-by: John W. Linville <[email protected]>
2007-07-10[PATCH] airo: disable the PCI device when unloading moduleMichal Schmidt1-1/+5
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 <[email protected]> Signed-off-by: John W. Linville <[email protected]>
2007-05-08header cleaning: don't include smp_lock.h when not usedRandy Dunlap1-1/+0
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 <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2007-04-28[PATCH] airo: Make /sys/bus/pci/drivers/airo/{,un}bind workMichal Schmidt1-39/+29
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 <[email protected]> Signed-off-by: John W. Linville <[email protected]>
2007-04-28[PATCH] airo: Don't check for NULL before kfree()Michal Schmidt1-2/+0
It's unnecessary to check for NULL before calling kfree(). Signed-off-by: Michal Schmidt <[email protected]> Signed-off-by: John W. Linville <[email protected]>
2007-04-25[SK_BUFF]: Introduce skb_mac_header()Arnaldo Carvalho de Melo1-1/+1
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 <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2007-04-25[SK_BUFF]: Introduce skb_reset_mac_header(skb)Arnaldo Carvalho de Melo1-2/+2
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 <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2007-04-25[ETH]: Make eth_type_trans set skb->dev like the other *_type_transArnaldo Carvalho de Melo1-4/+1
One less thing for drivers writers to worry about. Signed-off-by: Arnaldo Carvalho de Melo <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2007-03-16[PATCH] airo: Fix an error path memory leakMichal Schmidt1-1/+3
The airo driver leaks memory if request_irq() fails. Signed-off-by: Michal Schmidt <[email protected]> Signed-off-by: John W. Linville <[email protected]>
2007-02-17Merge branch 'upstream' into upstream-jgarzikJohn W. Linville1-2/+2
Conflicts: net/ieee80211/softmac/ieee80211softmac_module.c net/ieee80211/softmac/ieee80211softmac_wx.c
2007-02-14[PATCH] misc-wireless: Use ARRAY_SIZE macro when appropriateAhmed S. Darwish1-2/+2
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 <[email protected]> Signed-off-by: John W. Linville <[email protected]>
2007-02-12[PATCH] mark struct file_operations const 5Arjan van de Ven1-8/+8
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 <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2006-12-07[PATCH] Add include/linux/freezer.h and move definitions from sched.hNigel Cunningham1-0/+1
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. [[email protected]: fix ueagle driver] Signed-off-by: Nigel Cunningham <[email protected]> Cc: "Rafael J. Wysocki" <[email protected]> Cc: Pavel Machek <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2006-10-16[PATCH] airo: check if need to freezeDave Kleikamp1-2/+4
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 <[email protected]> Cc: Jean Tourrilhes <[email protected]> Cc: Sukadev Bhattiprolu <[email protected]> Cc: Jeff Garzik <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: John W. Linville <[email protected]>
2006-10-16[PATCH] wireless: More WE-21 potential overflows...Jean Tourrilhes1-1/+0
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 <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: John W. Linville <[email protected]>
2006-10-16[PATCH] airo.c: check returned valuesFlorin Malita1-26/+72
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 <[email protected]> Signed-off-by: John W. Linville <[email protected]>
2006-10-05IRQ: Maintain regs pointer globally rather than passing to IRQ handlersDavid Howells1-3/+2
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 <[email protected]> (cherry picked from 1b16e7ac850969f38b375e511e3fa2f474a33867 commit)
2006-10-01drivers/net/wireless/{airo,ipw2100}: fix error handling bugsJeff Garzik1-4/+19
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 <[email protected]>