summaryrefslogtreecommitdiff
path: root/drivers/net/wireless/rt2x00/rt2x00dev.c
AgeCommit message (Collapse)Author
2010-03-30include cleanup: Update gfp.h and slab.h includes to prepare for breaking ↵Tejun Heo
implicit slab.h inclusion from percpu.h percpu.h is included by sched.h and module.h and thus ends up being included when building most .c files. percpu.h includes slab.h which in turn includes gfp.h making everything defined by the two files universally available and complicating inclusion dependencies. percpu.h -> slab.h dependency is about to be removed. Prepare for this change by updating users of gfp and slab facilities include those headers directly instead of assuming availability. As this conversion needs to touch large number of source files, the following script is used as the basis of conversion. http://userweb.kernel.org/~tj/misc/slabh-sweep.py The script does the followings. * Scan files for gfp and slab usages and update includes such that only the necessary includes are there. ie. if only gfp is used, gfp.h, if slab is used, slab.h. * When the script inserts a new include, it looks at the include blocks and try to put the new include such that its order conforms to its surrounding. It's put in the include block which contains core kernel includes, in the same order that the rest are ordered - alphabetical, Christmas tree, rev-Xmas-tree or at the end if there doesn't seem to be any matching order. * If the script can't find a place to put a new include (mostly because the file doesn't have fitting include block), it prints out an error message indicating which .h file needs to be added to the file. The conversion was done in the following steps. 1. The initial automatic conversion of all .c files updated slightly over 4000 files, deleting around 700 includes and adding ~480 gfp.h and ~3000 slab.h inclusions. The script emitted errors for ~400 files. 2. Each error was manually checked. Some didn't need the inclusion, some needed manual addition while adding it to implementation .h or embedding .c file was more appropriate for others. This step added inclusions to around 150 files. 3. The script was run again and the output was compared to the edits from #2 to make sure no file was left behind. 4. Several build tests were done and a couple of problems were fixed. e.g. lib/decompress_*.c used malloc/free() wrappers around slab APIs requiring slab.h to be added manually. 5. The script was run on all .h files but without automatically editing them as sprinkling gfp.h and slab.h inclusions around .h files could easily lead to inclusion dependency hell. Most gfp.h inclusion directives were ignored as stuff from gfp.h was usually wildly available and often used in preprocessor macros. Each slab.h inclusion directive was examined and added manually as necessary. 6. percpu.h was updated not to include slab.h. 7. Build test were done on the following configurations and failures were fixed. CONFIG_GCOV_KERNEL was turned off for all tests (as my distributed build env didn't work with gcov compiles) and a few more options had to be turned off depending on archs to make things build (like ipr on powerpc/64 which failed due to missing writeq). * x86 and x86_64 UP and SMP allmodconfig and a custom test config. * powerpc and powerpc64 SMP allmodconfig * sparc and sparc64 SMP allmodconfig * ia64 SMP allmodconfig * s390 SMP allmodconfig * alpha SMP allmodconfig * um on x86_64 SMP allmodconfig 8. percpu.h modifications were reverted so that it could be applied as a separate patch and serve as bisection point. Given the fact that I had only a couple of failures from tests on step 6, I'm fairly confident about the coverage of this conversion patch. If there is a breakage, it's likely to be something in one of the arch headers which should be easily discoverable easily on most builds of the specific arch. Signed-off-by: Tejun Heo <tj@kernel.org> Guess-its-ok-by: Christoph Lameter <cl@linux-foundation.org> Cc: Ingo Molnar <mingo@redhat.com> Cc: Lee Schermerhorn <Lee.Schermerhorn@hp.com>
2010-03-08Merge branch 'for-next' into for-linusJiri Kosina
Conflicts: Documentation/filesystems/proc.txt arch/arm/mach-u300/include/mach/debug-macro.S drivers/net/qlge/qlge_ethtool.c drivers/net/qlge/qlge_main.c drivers/net/typhoon.c
2010-02-09tree-wide: Assorted spelling fixesDaniel Mack
In particular, several occurances of funny versions of 'success', 'unknown', 'therefore', 'acknowledge', 'argument', 'achieve', 'address', 'beginning', 'desirable', 'separate' and 'necessary' are fixed. Signed-off-by: Daniel Mack <daniel@caiaq.de> Cc: Joe Perches <joe@perches.com> Cc: Junio C Hamano <gitster@pobox.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2010-01-05Merge git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-2.6John W. Linville
Conflicts: net/mac80211/iface.c
2010-01-05rt2x00: Properly request tx headroom for alignment operations.Gertjan van Wingerde
Current rt2x00 drivers may result in a "ieee80211_tx_status: headroom too small" error message when a frame needs to be properly aligned before transmitting it. This is because the space needed to ensure proper alignment isn't requested from mac80211. Fix this by adding sufficient amount of alignment space to the amount of headroom requested for TX frames. Reported-by: David Ellingsworth <david@identd.dyndns.org> Signed-off-by: Gertjan van Wingerde <gwingerde@gmail.com> Acked-by: Ivo van Doorn <ivdoorn@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-12-21rt2x00: Only remove L2 padding in received frames if there is payload.Gertjan van Wingerde
L2 padding will only be present when there is actual payload present. Signed-off-by: Gertjan van Wingerde <gwingerde@gmail.com> Acked-by: Ivo van Doorn <ivdoorn@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-12-21rt2x00 : trim the skb after having the l2pad removed.Alban Browaeys
Otherwise we end up truncating the skb before removing the l2pad thus we might have the truncated part become garbage while getting it back in remove_l2pad. For the same issue: remove the skb_trim from the rt2800 fill_rxdone (it is done after l2pad removal in rt2x00lib_rxdone). Signed-off-by: Alban Browaeys <prahal@yahoo.com> Acked-by: Gertjan van Wingerde <gwingerde@gmail.com> Acked-by: Ivo van Doorn <ivdoorn@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-11-28rt2x00: Centralize setting of extra TX headroom requested by rt2x00.Gertjan van Wingerde
Set the value of extra_tx_headroom in a central place, rather than in each of the drivers. This is preparatory for taking alignment space into account in the TX headroom requested by rt2x00. Signed-off-by: Gertjan van Wingerde <gwingerde@gmail.com> Acked-by: Ivo van Doorn <IvDoorn@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-11-19mac80211: request TX status where neededJohannes Berg
Right now all frames mac80211 hands to the driver have the IEEE80211_TX_CTL_REQ_TX_STATUS flag set to request TX status. This isn't really necessary, only the injected frames need TX status (the latter for hostapd) so move setting this flag. The rate control algorithms also need TX status, but they don't require it. Also, rt2x00 uses that bit for its own purposes and seems to require it being set for all frames, but that can be fixed in rt2x00. This doesn't really change anything for any drivers but in the future drivers using hw-rate control may opt to not report TX status for frames that don't have the IEEE80211_TX_CTL_REQ_TX_STATUS flag set. Signed-off-by: Johannes Berg <johannes@sipsolutions.net> Acked-by: Ivo van Doorn <IvDoorn@gmail.com> [rt2x00 bits] Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-11-11rt2x00: Update copyright statements.Gertjan van Wingerde
As mentioned on the linux-wireless mailing list, the current copyright statements in the rt2x00 are meaningless, as the rt2x00 project is not even a formal legal entity. Therefore it is better to replace the existing copyright statements with copyright statements for the people that actually wrote the code. Note: Updated to the best of my knowledge with respect to who contributed considerable amounts of code. Signed-off-by: Gertjan van Wingerde <gwingerde@gmail.com> Acked-by: Ivo van Doorn <IvDoorn@gmail.com> CC: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-11-11rt2x00: Remove deprecated ieee80211_rx_status->qual usageIvo van Doorn
ieee80211_rx_status->qual has been marked deprecated. This allows us to remove several functions and fields which were used to calculate a reasonable value for it. Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com> Acked-by: Gertjan van Wingerde <gwingerde@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-11-06rt2x00: Don't queue ieee80211 work after USB removalSean Cross
This prevents the rt2x00 driver from queueing ieee80211 work after the   USB card has been removed, preventing a kernel panic. Signed-off-by: Sean Cross <sean@chumby.com> Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-08-31rt2x00: Reorganize padding & L2 paddingIvo van Doorn
The old function rt2x00queue_payload_align() handled both adding and removing L2 padding and some basic frame alignment. The entire function was being abused because it had multiple functions and the header length argument was somtimes used to align the header instead of the payload. Additionally there was a bug when inserting L2 padding that only the payload was aligned but not the header. This happens when the header wasn't aligned properly by mac80211, but rt2x00lib only moves the payload. A secondary problem was that when removing L2 padding during TXdone or RX the skb wasn't resized to the proper size. Split the function into seperate functions each handling its task as it should. Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-08-31rt2x00: Fix TX status reportingIvo van Doorn
Not all values of the TX status enumeration were covered during updating of the TX statistics. This could lead to wrong bitrate tuning but also wrong behavior in tools like hostapd. Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-08-20rt2x00: bss_info_changed() callback is allowed to sleepIvo van Doorn
The bss_info_changed() callback function no longer needs to be atomic. Remove the scheduled work structure and call into the driver directly. Additionaly this makes the DRIVER_REQUIRE_SCHEDULED flag redundant so it can be removed. Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-08-20rt2x00: configure_filter() callback is allowed to sleepIvo van Doorn
The configure_filter() callback function no longer needs to be atomic. Remove the scheduled work structure and call into the driver configure_filter() directly. Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-08-20rt2x00: Add support for retry ratesBenoit PAPILLAULT
rt2800pci can handle different retry rates, it will always step 1 rate down after a failed transmission so creating the retry rate list for mac80211 is quite simple. Signed-off-by: Benoit PAPILLAULT <benoit.papillault@free.fr> Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-08-14rt2x00: Fix for race condition while update beaconIgor Perminov
The patch "Implement set_tim callback for all drivers" can cause kernel oops in rt73usb_write_beacon. The oops is caused by one of the following race conditions: * In case of two near calls to set_tim: rt2x00lib_beacondone_iter is cleaning the beacon skb, whereas rt73usb_write_beacon is still using it. * In case of two near updates of beacon: first as the result of set_tim and second as the result of a call from an application (e.g. hostapd). This patch fixes the race condition by rearranging the update logic and guarding rt2x00_intf->beacon->skb with a mutex. Signed-off-by: Igor Perminov <igor.perminov@inbox.ru> Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-08-14rt2x00: Remove usage of deprecated radio_enabled & ↵Ivo van Doorn
IEEE80211_CONF_CHANGE_RADIO_ENABLED In the config() callback function the fields radio_enabled and the change flag IEEE80211_CONF_CHANGE_RADIO_ENABLED have been deprecated. This removes the usage of those fields by improving antenna change detection in the antenna configuration function. Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-08-04rt2x00: cancel all work on disconnectPavel Roskin
Signed-off-by: Pavel Roskin <proski@gnu.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-08-04mac80211: redefine usage of the mac80211 workqueueLuis R. Rodriguez
The mac80211 workqueue exists to enable mac80211 and drivers to queue their own work on a single threaded workqueue. mac80211 takes care to flush the workqueue during suspend but we never really had requirements on drivers for how they should use the workqueue in consideration for suspend. We extend mac80211 to document how the mac80211 workqueue should be used, how it should not be used and finally move raw access to the workqueue to mac80211 only. Drivers and mac80211 use helpers to queue work onto the mac80211 workqueue: * ieee80211_queue_work() * ieee80211_queue_delayed_work() These helpers will now warn if mac80211 already completed its suspend cycle and someone is trying to queue work. mac80211 flushes the mac80211 workqueue prior to suspend a few times, but we haven't taken the care to ensure drivers won't add more work after suspend. To help with this we add a warning when someone tries to add work and mac80211 already completed the suspend cycle. Drivers should ensure they cancel any work or delayed work in the mac80211 stop() callback. Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-07-24rt2x00: Remove DEVICE_STATE_DISABLED_RADIO_HWIvo van Doorn
The DEVICE_STATE_DISABLED_RADIO_HW flag is only read but never set, it is an ancient part of one of the many versions of the rfkill implementations in rt2x00. It is about time is disappears. Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-07-10rt2x00: use wiphy rfkill interfaceIvo van Doorn
Remove the input_polldev from rt2x00 and replace it with the rfkill interface offered by the wiphy structure. This simplifies the entire rfkill handling in rt2x00 and allows us to remove the CONFIG_RT2X00_LIB_RFKILL option and always enables rfkill capabilities. Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-07-10mac80211: push rx status into skb->cbJohannes Berg
Within mac80211, we often need to copy the rx status into skb->cb. This is wasteful, as drivers could be building it in there to start with. This patch changes the API so that drivers are expected to pass the RX status in skb->cb, now accessible as IEEE80211_SKB_RXCB(skb). It also updates all drivers to pass the rx status in there, but only by making them memcpy() it into place before the call to the receive function (ieee80211_rx(_irqsafe)). Each driver can now be optimised on its own schedule. Signed-off-by: Johannes Berg <johannes@sipsolutions.net> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-05-20rt73usb: fix for master modeAlexandre Becholey
Report status unknown as if there were successfully transmitted. This will avoid hostapd to disassociate because it doesn't understand what a status unknown is. Signed-off-by: Alexandre Becholey <alexandre.becholey@epfl.ch> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-05-06rt2x00: Implement support for 802.11nIvo van Doorn
Extend rt2x00lib capabilities to support 802.11n, it still lacks aggregation support, but that can be added in the future. Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-05-06rt2x00: Add support for L2 padding during TX/RXIvo van Doorn
Some hardware require L2 padding between header and payload because both must be aligned to a 4-byte boundary. This hardware also is easier during the RX path since we no longer need to move the entire payload but rather only the header to remove the padding (mac80211 only wants the payload to be 4-byte aligned). Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-04-16rt2x00: prevent double kfree when failing to register hardwareHerton Ronaldo Krzesinski
In a scenario where there isn't any firmware available, we will have a double kfree of rt2x00dev->spec.channels_info when ieee80211_register_hw returns an error status inside rt2x00lib_probe_hw. The problem is that if ieee80211_register_hw fails, we call rt2x00lib_remove_hw twice: * first inside rt2x00lib_probe_hw upon failure of ieee80211_register_hw * error status is returned to rt2x00lib_probe_dev, which then sees it and calls in this case rt2x00lib_remove_dev that will again run rt2x00lib_remove_hw Prevent this avoiding calling rt2x00lib_remove_hw inside rt2x00lib_probe_hw Problem was detected with CONFIG_DEBUG_PAGEALLOC=y, CONFIG_SLUB_DEBUG=y, CONFIG_SLUB_DEBUG_ON=y, that dumps this with no firmware available: rt61pci 0000:00:07.0: PCI INT A -> GSI 19 (level, low) -> IRQ 19 wmaster0 (rt61pci): not using net_device_ops yet phy0: Selected rate control algorithm 'pid' phy0: Failed to initialize wep: -2 phy0 -> rt2x00lib_probe_dev: Error - Failed to initialize hw. ============================================================================= BUG kmalloc-128: Object already free ----------------------------------------------------------------------------- INFO: Allocated in rt61pci_probe_hw+0x3e5/0x6e0 [rt61pci] age=340 cpu=0 pid=21 INFO: Freed in rt2x00lib_remove_hw+0x59/0x70 [rt2x00lib] age=0 cpu=0 pid=21 INFO: Slab 0xc13ac3e0 objects=23 used=10 fp=0xdd59f6e0 flags=0x400000c3 INFO: Object 0xdd59f6e0 @offset=1760 fp=0xdd59f790 Bytes b4 0xdd59f6d0: 15 00 00 00 b2 8a fb ff 5a 5a 5a 5a 5a 5a 5a 5a ....².ûÿZZZZZZZZ Object 0xdd59f6e0: 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b kkkkkkkkkkkkkkkk Object 0xdd59f6f0: 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b kkkkkkkkkkkkkkkk Object 0xdd59f700: 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b kkkkkkkkkkkkkkkk Object 0xdd59f710: 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b kkkkkkkkkkkkkkkk Object 0xdd59f720: 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b kkkkkkkkkkkkkkkk Object 0xdd59f730: 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b kkkkkkkkkkkkkkkk Object 0xdd59f740: 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b kkkkkkkkkkkkkkkk Object 0xdd59f750: 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b a5 kkkkkkkkkkkkkkk¥ Redzone 0xdd59f760: bb bb bb bb »»»» Padding 0xdd59f788: 5a 5a 5a 5a 5a 5a 5a 5a ZZZZZZZZ Pid: 21, comm: stage1 Not tainted 2.6.29.1-desktop-1.1mnb #1 Call Trace: [<c01abbb3>] print_trailer+0xd3/0x120 [<c01abd37>] object_err+0x37/0x50 [<c01acf57>] __slab_free+0xe7/0x2f0 [<c01ad1de>] kfree+0x7e/0xd0 [<e0e4a239>] ? rt2x00lib_remove_hw+0x59/0x70 [rt2x00lib] [<e0e4a239>] ? rt2x00lib_remove_hw+0x59/0x70 [rt2x00lib] [<e0e4a239>] rt2x00lib_remove_hw+0x59/0x70 [rt2x00lib] [<e0e4acc7>] rt2x00lib_remove_dev+0x37/0x50 [rt2x00lib] [<e0e4b087>] rt2x00lib_probe_dev+0x1a7/0x3b0 [rt2x00lib] [<e0eb288f>] rt2x00pci_probe+0xdf/0x1ee [rt2x00pci] [<c026b9ee>] local_pci_probe+0xe/0x10 [<c026c750>] pci_device_probe+0x60/0x80 [<c02d5c2a>] driver_probe_device+0x9a/0x2e0 [<c02d5ef9>] __driver_attach+0x89/0x90 [<c02d541b>] bus_for_each_dev+0x4b/0x70 [<c026c690>] ? pci_device_remove+0x0/0x40 [<c02d59d9>] driver_attach+0x19/0x20 [<c02d5e70>] ? __driver_attach+0x0/0x90 [<c02d4cef>] bus_add_driver+0x1cf/0x2a0 [<c026c690>] ? pci_device_remove+0x0/0x40 [<c02d60c9>] driver_register+0x69/0x140 [<c026c9b0>] __pci_register_driver+0x40/0x80 [<e0ecc000>] ? rt61pci_init+0x0/0x19 [rt61pci] [<e0ecc017>] rt61pci_init+0x17/0x19 [rt61pci] [<c0101116>] do_one_initcall+0x26/0x1c0 [<c01ab90c>] ? slab_pad_check+0x3c/0x120 [<c01ab90c>] ? slab_pad_check+0x3c/0x120 [<c01ac8da>] ? check_object+0xda/0x210 [<c01b0026>] ? percpu_free+0x46/0x50 [<c01ad09e>] ? __slab_free+0x22e/0x2f0 [<c01b0026>] ? percpu_free+0x46/0x50 [<c01b0026>] ? percpu_free+0x46/0x50 [<c01b0026>] ? percpu_free+0x46/0x50 [<c01687ec>] ? stop_machine_destroy+0x3c/0x40 [<c015e515>] ? load_module+0xa5/0x1c50 [<e0ec5000>] ? rt61pci_eepromregister_read+0x0/0x40 [rt61pci] [<e0eb2000>] ? rt2x00pci_write_tx_data+0x0/0x90 [rt2x00pci] [<c03ac2fb>] ? mutex_lock+0xb/0x20 [<c03ac2fb>] ? mutex_lock+0xb/0x20 [<c017ad16>] ? tracepoint_update_probe_range+0x76/0xa0 [<c017ad6f>] ? tracepoint_module_notify+0x2f/0x40 [<c03b02ed>] ? notifier_call_chain+0x2d/0x70 [<c014f0ed>] ? __blocking_notifier_call_chain+0x4d/0x60 [<c014f11a>] ? blocking_notifier_call_chain+0x1a/0x20 [<c0160156>] sys_init_module+0x96/0x1d0 [<c019dad6>] ? sys_munmap+0x46/0x60 [<c0105546>] syscall_call+0x7/0xb FIX kmalloc-128: Object at 0xdd59f6e0 not freed rt61pci 0000:00:07.0: PCI INT A disabled rt61pci: probe of 0000:00:07.0 failed with error -2 Signed-off-by: Herton Ronaldo Krzesinski <herton@mandriva.com.br> Acked-by: Ivo van Doorn <IvDoorn@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-02-09rt2x00: Add kill_tx_queue callback functionIvo van Doorn
provide rt2x00lib the possibility to kill a particular TX queue. This can be useful when disabling the radio, but more importantly will allow beaconing to be disabled when mac80211 requests this (during scanning for example) Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-02-09rt2x00: Move intf_work to mac82011 workqueueIvo van Doorn
ieee80211_iterate_active_interfaces() no longer acquires the RTNL lock which means the intf_work handler can be safely used from the mac80211 workqueue again. Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-01-29rt2x00: Simplify suspend/resume handlingIvo van Doorn
With mac80211 handling all open interfaces during suspend and resume we can simplify suspend/resume within rt2x00lib. The only thing rt2x00 needs to do is free up memory during suspend and bring back the minimal required components during resume. Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-01-29rt2x00: Update copyright year to 2009Ivo van Doorn
Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-01-29rt2x00: Introduce RXDONE_SIGNAL_MASK maskIvo van Doorn
Improve error message reporting when a frame was received with unknown rate. Instead of using the boolean check if the frame is supposed to be a PLCP value or not, we should add a new mask (RXDONE_SIGNAL_MASK) which returns the type identification for a signal value (i.e. PLCP). At the moment we only have 2 different types, but more will arrive when support for 11n is added. Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-01-29rt2x00: Allow drivers to pass the noise value during rxdoneIvo van Doorn
Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-01-29rt2x00: Implement WDS supportIvo van Doorn
WDS support should be very easy to handle, mac80211 handles everything for us, so all that is needed is to set the support flags and handle it in the add_interface() callback. Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-01-29rt2x00: Add mesh supportAndrey Yurovsky
This adds initial support for Mesh Point mode. For this we tell mac80211 that we support NL80211_IFTYPE_MESH_POINT. We also need to send beacons. mac80211 will configure our RX filter accordingly. Signed-off-by: Andrey Yurovsky <andrey@cozybit.com> Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-01-29rt2x00: Move link tuning into seperate fileIvo van Doorn
Move link and antenna tuning into a seperate file named rt2x00link.c, this makes the interface to the link tuner a lot cleaner. Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-01-12rt2x00: Fix TX short preamble detectionIvo van Doorn
The short preamble mode was not correctly detected during TX, rt2x00 used the rate->hw_value_short field but mac80211 is not using this field that way. Instead the flag IEEE80211_TX_RC_USE_SHORT_PREAMBLE should be used to determine if the frame should be send out using short preamble or not. Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-12-05rt2x00: Add RXDONE_CRYPTO_IV/ICV flagsIvo van Doorn
Drivers should notify rt2x00lib when they provide the IV/ICV data. This adds some flexibility to drivers which can't provide all information. * rt2500usb provides ICV inside the frame * rt2800pci doesn't provide IV/ICV * rt2800usb doesn't provide IV/ICV Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-11-21rt2x00: Fix race condition when using inderect registersIvo van Doorn
Indirect registers require multiple calls to the CSR register in order to access the indirect registers. This must be protected under a lock to prevent race conditions which could cause invalid data to be returned when reading from the indirect register or silent failures when writing data to the indirect register. USB drivers where already protected under a mutex, so rename the mutex and make PCI drivers use the mutex as well. This now means that BBP and RF registers are no longer accessible in interrupt context. That is not a bad situation since the slow behavior of accessing those registers means we don't _want_ to access them in interrupt context either. Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-11-21rt2x00: Cleanup TX/RX entry handlingIvo van Doorn
Merge the callback functions init_txentry() and init_rxentry(). This makes life in rt2x00lib a lot simpler and we can cleanup several functions. rt2x00pci contained "fake" FIELD definitions for descriptor words. This is not flexible since it assumes the driver will always have the same field to indicate if a driver is available or not. This should be dependent on the driver, and we should add a callback function for this. Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-11-21rt2x00: Fix BUG_ON() with antenna handlingIvo van Doorn
With the new configuration handling, and more specifically splitting the configuration of the antenna from the normal configuration steps allowed a BUG_ON() to be triggered in the driver because the SW_DIVERSITY was send to the driver. This fixes that by catching the value early in rt2x00config.c and replacing it with a sensible value. This also fixes a problem where the antenna is not being initialized at all when the radio is enabled. Since it no longer is part of the mac80211 configuration the only place where rt2x00 configured it was the SW diversity handler. Obviously this is broken for all non-diversity hardware and breaks SW diversity due to a broken initialization. When the radio is enabled the antenna will be configured once as soon as the config() callback function is called. Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-11-21rt2x00: Remove RATE_BASIC flagIvo van Doorn
mac80211 is in charge of determining the basic rates, so we are not using the RATE_BASIC flag anymore. Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-11-10rt2x00: Improve interface_modes initializationIvo van Doorn
All operating modes which require beaconing should depend on the availability of beacon entries from the hardware. Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-11-10rt2x00: Remove ieee80211_bss_conf from rt2x00_intfIvo van Doorn
We can safely remove ieee80211_bss_conf from rt2x00_intf, it is provided by mac80211 in ieee80211_vif as well. (rt2x00_intf is the drv_priv field of ieee80211_vif). Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-10-31mac80211/drivers: rewrite the rate control APIJohannes Berg
So after the previous changes we were still unhappy with how convoluted the API is and decided to make things simpler for everybody. This completely changes the rate control API, now taking into account 802.11n with MCS rates and more control, most drivers don't support that though. Signed-off-by: Felix Fietkau <nbd@openwrt.org> Signed-off-by: Johannes Berg <johannes@sipsolutions.net> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-10-31mac80211: introduce hw config change flagsJohannes Berg
This makes mac80211 notify the driver which configuration actually changed, e.g. channel etc. No driver changes, this is just plumbing, driver authors are expected to act on this if they want to. Also remove the HW CONFIG debug printk, it's incorrect, often we configure something else. Signed-off-by: Johannes Berg <johannes@sipsolutions.net> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-10-31mac80211: kill hw.conf.antenna_sel_{rx,tx}Johannes Berg
Never actually used. Signed-off-by: Johannes Berg <johannes@sipsolutions.net> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-09-15mac80211: use nl80211 interface typesJohannes Berg
There's really no reason for mac80211 to be using its own interface type defines. Use the nl80211 types and simplify the configuration code a bit: there's no need to translate them any more now. Signed-off-by: Johannes Berg <johannes@sipsolutions.net> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-09-05cfg80211: keep track of supported interface modesLuis R. Rodriguez
It is obviously good for userspace to know up front which interface modes a given piece of hardware might support (even if adding such an interface might fail later because of concurrency issues), so let's make cfg80211 aware of that. For good measure, disallow adding interfaces in all other modes so drivers don't forget to announce support for one mode when they add it. Signed-off-by: Johannes Berg <johannes@sipsolutions.net> Signed-off-by: Stephen Blackheath <tramp.enshrine.stephen@blacksapphire.com> Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com> Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>