summaryrefslogtreecommitdiff
path: root/drivers/net/wireless/rt2x00/rt2x00.h
AgeCommit message (Collapse)Author
2014-07-09rt2x00: fix rfkill regression on rt2500pciStanislaw Gruszka
commit 616a8394b5df8c88f4dd416f4527439a4e365034 upstream. As reported by Niels, starting rfkill polling during device probe (commit e2bc7c5, generally sane change) broke rfkill on rt2500pci device. I considered that bug as some initalization issue, which should be fixed on rt2500pci specific code. But after several attempts (see bug report for details) we fail to find working solution. Hence I decided to revert to old behaviour on rt2500pci to fix regression. Additionally patch also unregister rfkill on device remove instead of ifconfig down, what was another issue introduced by bad commit. Bug report: https://bugzilla.kernel.org/show_bug.cgi?id=73821 Fixes: e2bc7c5f3cb8 ("rt2x00: Fix rfkill_polling register function.") Bisected-by: Niels <nille0386@googlemail.com> Reported-and-tested-by: Niels <nille0386@googlemail.com> Signed-off-by: Stanislaw Gruszka <stf_xl@wp.pl> Signed-off-by: John W. Linville <linville@tuxdriver.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-04-22rt2x00: Use more current logging styles, shrink object sizeJoe Perches
Reduce object space ~2% using more current logging styles. Neaten and simplify logging macros. Use wiphy_<level> where appropriate. Coalesce formats. Convert ERROR/WARNING/INFO macros to rt2x00_<level> Convert EEPROM to rt2x00_eeprom_dbg Convert PROBE_ERROR to rt2x00_probe_err Convert DEBUG to rt2x00_dbg Convert EEPROM to rt2x00_eeprom_dbg $ size drivers/net/wireless/rt2x00/built-in.o* text data bss dec hex filename 245639 71696 69584 386919 5e767 drivers/net/wireless/rt2x00/built-in.o.new 240609 70096 68944 379649 5cb01 drivers/net/wireless/rt2x00/built-in.o.new.nodyndbg 240609 70096 68944 379649 5cb01 drivers/net/wireless/rt2x00/built-in.o.new.no_rt2x00_debug 249198 70096 70352 389646 5f20e drivers/net/wireless/rt2x00/built-in.o.old 249198 70096 70352 389646 5f20e drivers/net/wireless/rt2x00/built-in.o.old.nodyndbg 244222 70096 69712 384030 5dc1e drivers/net/wireless/rt2x00/built-in.o.old.no_rt2x00_debug Signed-off-by: Joe Perches <joe@perches.com> Acked-by: Gertjan van Wingerde <gwingerde@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-04-01rt2x00: introduce rt2x00_set_{rt,rf} helpersGabor Juhos
The new helpers can be used to set the type of the RT and RF chipsets separately. Signed-off-by: Gabor Juhos <juhosg@openwrt.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-03-25Merge branch 'for-john' of ↵John W. Linville
git://git.kernel.org/pub/scm/linux/kernel/git/jberg/mac80211-next
2013-03-18rt2800: 5592: add iq calibrationStanislaw Gruszka
Based on: GetIQCalibration() IQCalibration() from: DPO_RT5572_LinuxSTA_2.6.1.3_20121022/chips/rtmp_chip.c Signed-off-by: Stanislaw Gruszka <stf_xl@wp.pl> Tested-by: Wanlong Gao <gaowanlong@cn.fujitsu.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-03-18rt2800: 5592: early definesStanislaw Gruszka
Add basic defines for 5592 chip. It can not be enabled until CONFIG_RT2800USB_RT55XX configuration option will be provided in the Kconfig. Signed-off-by: Stanislaw Gruszka <stf_xl@wp.pl> Tested-by: Wanlong Gao <gaowanlong@cn.fujitsu.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-03-18mac80211: pass queue bitmap to flush operationJohannes Berg
There are a number of situations in which mac80211 only really needs to flush queues for one virtual interface, and in fact during this frames might be transmitted on other virtual interfaces. Calculate and pass a queue bitmap to the driver so it knows which queues to flush. Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2013-02-14rt2x00: check for dma mappings errorsStanislaw Gruszka
Check output of dma_map_single functions which nowadays can fail (when IOMMU is used). On write_beacon callbacks just print error, similar like padding error is handled by rt2800_write_beacon. Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-01-30rt2x00: remove NOTICEStanislaw Gruszka
We use this macro only on 3 places - remove it and replace by other appropriate macros for printing messages. Signed-off-by: Stanislaw Gruszka <stf_xl@wp.pl> Acked-by: Ivo van Doorn <IvDoorn@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-01-30rt2x00: print warning, notice and info as defaultStanislaw Gruszka
Some messages provide useful information, but are disabled without CONFIG_RT2X00_DEBUG=y, so enable them by default Signed-off-by: Stanislaw Gruszka <stf_xl@wp.pl> Acked-by: Gertjan van Wingerde <gwingerde@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-01-30rt2x00: print chip and firmware version by defaultStanislaw Gruszka
Signed-off-by: Stanislaw Gruszka <stf_xl@wp.pl> Tested-by: Xose Vazquez Perez <xose.vazquez@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-01-22rt2x00: Improve TX status handling for BlockAckReq framesHelmut Schaa
Since rt2800 hardware isn't capable of reporting the TX status of BlockAckReq frames implement the TX status handling of BARs in rt2x00lib. We keep track of all BARs that are send out and try to match incoming BAs to the appropriate BARs. This allows us to report a more or less accurate TX status for BAR frames which in turn improves BA session stability. This is loosley based on Christian Lamparter's patch for carl9170 "carl9170: fix HT peer BA session corruption". We have to walk the list of pending BARs for every rx'red BA even though most BAs don't belong to any of these BARs as they are just acknowledging an AMPDU. To keep that overhead low use RCU which allows us to walk the list of pending BARs without the need to acquire a lock. This however requires us to _copy_ relevant information from the BAR (RA, TA, control field, start sequence number) into our BAR list entry. Signed-off-by: Helmut Schaa <helmut.schaa@googlemail.com> Tested-by: Andreas Hartmann <andihartmann@01019freenet.de> Acked-by: Gertjan van Wingerde <gwingerde@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-09-25rt2x00: Replace open coded interface checking with interface combinations.Gertjan van Wingerde
Mac80211 has formal infrastructure to specify which interface combinations are supported. Make use of this facility in favor of open coding it ourselves. So far we only have to specify we can support multiple AP interfaces, no other combinations are supported. Inspired by an earlier patch from Paul Fertser. Signed-off-by: Gertjan van Wingerde <gwingerde@gmail.com> Cc: Paul Fertser <fercerpav@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-09-25rt2x00: Deprecate max_sta_intf field of struct rt2x00_ops.Gertjan van Wingerde
All drivers set this value to 1, so there is no need (currently) to let drivers set this. Therefor, remove the field; we can always add it back when it is needed. Inspired by an earlier patch from Paul Fertser. Signed-off-by: Gertjan van Wingerde <gwingerde@gmail.com> Cc: Paul Fertser <fercerpav@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-09-11rt2x00: add MediaTek/RaLink Rt3352 WiSoCDaniel Golle
Support for the RT3352 WiSoC was developed for and tested with the ALL5002 devboard running OpenWrt. For now, this supports only devices with internal TXALC. Corrections were made according to the remarks of Stanislaw Gruszka and Gertjan van Wingerde, thank you guys for reviewing! Signed-off-by: Daniel Golle <dgolle@allnet.de> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-07-31mac80211: move TX station pointer and restructure TXThomas Huehn
Remove the control.sta pointer from ieee80211_tx_info to free up sufficient space in the TX skb control buffer for the upcoming Transmit Power Control (TPC). Instead, the pointer is now on the stack in a new control struct that is passed as a function parameter to the drivers' tx method. Signed-off-by: Thomas Huehn <thomas@net.t-labs.tu-berlin.de> Signed-off-by: Alina Friedrichsen <x-alina@gmx.net> Signed-off-by: Felix Fietkau <nbd@openwrt.org> [reworded commit message] Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2012-06-20rt2x00 : RT3290 chip support v4Woody Hung
This patch support the new chipset rt3290 wifi implementation in rt2x00. It initailize the related mac, bbp and rf register in startup phase. And this patch modify the efuse read/write method for the different efuse data offset of rt3290. Signed-off-by: Woody Hung <Woody.Hung@mediatek.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-06-04rt2x00: use atomic variable for seqnoStanislaw Gruszka
Remove spinlock as atomic_t can be used instead. Note we use only 16 lower bits, upper bits are changed but we impilcilty cast to u16. This fix possible deadlock on IBSS mode reproted by lockdep: ================================= [ INFO: inconsistent lock state ] 3.4.0-wl+ #4 Not tainted --------------------------------- inconsistent {IN-SOFTIRQ-W} -> {SOFTIRQ-ON-W} usage. kworker/u:2/30374 [HC0[0]:SC0[0]:HE1:SE1] takes: (&(&intf->seqlock)->rlock){+.?...}, at: [<f9979a20>] rt2x00queue_create_tx_descriptor+0x380/0x490 [rt2x00lib] {IN-SOFTIRQ-W} state was registered at: [<c04978ab>] __lock_acquire+0x47b/0x1050 [<c0498504>] lock_acquire+0x84/0xf0 [<c0835733>] _raw_spin_lock+0x33/0x40 [<f9979a20>] rt2x00queue_create_tx_descriptor+0x380/0x490 [rt2x00lib] [<f9979f2a>] rt2x00queue_write_tx_frame+0x1a/0x300 [rt2x00lib] [<f997834f>] rt2x00mac_tx+0x7f/0x380 [rt2x00lib] [<f98fe363>] __ieee80211_tx+0x1b3/0x300 [mac80211] [<f98ffdf5>] ieee80211_tx+0x105/0x130 [mac80211] [<f99000dd>] ieee80211_xmit+0xad/0x100 [mac80211] [<f9900519>] ieee80211_subif_start_xmit+0x2d9/0x930 [mac80211] [<c0782e87>] dev_hard_start_xmit+0x307/0x660 [<c079bb71>] sch_direct_xmit+0xa1/0x1e0 [<c0784bb3>] dev_queue_xmit+0x183/0x730 [<c078c27a>] neigh_resolve_output+0xfa/0x1e0 [<c07b436a>] ip_finish_output+0x24a/0x460 [<c07b4897>] ip_output+0xb7/0x100 [<c07b2d60>] ip_local_out+0x20/0x60 [<c07e01ff>] igmpv3_sendpack+0x4f/0x60 [<c07e108f>] igmp_ifc_timer_expire+0x29f/0x330 [<c04520fc>] run_timer_softirq+0x15c/0x2f0 [<c0449e3e>] __do_softirq+0xae/0x1e0 irq event stamp: 18380437 hardirqs last enabled at (18380437): [<c0526027>] __slab_alloc.clone.3+0x67/0x5f0 hardirqs last disabled at (18380436): [<c0525ff3>] __slab_alloc.clone.3+0x33/0x5f0 softirqs last enabled at (18377616): [<c0449eb3>] __do_softirq+0x123/0x1e0 softirqs last disabled at (18377611): [<c041278d>] do_softirq+0x9d/0xe0 other info that might help us debug this: Possible unsafe locking scenario: CPU0 ---- lock(&(&intf->seqlock)->rlock); <Interrupt> lock(&(&intf->seqlock)->rlock); *** DEADLOCK *** 4 locks held by kworker/u:2/30374: #0: (wiphy_name(local->hw.wiphy)){++++.+}, at: [<c045cf99>] process_one_work+0x109/0x3f0 #1: ((&sdata->work)){+.+.+.}, at: [<c045cf99>] process_one_work+0x109/0x3f0 #2: (&ifibss->mtx){+.+.+.}, at: [<f98f005b>] ieee80211_ibss_work+0x1b/0x470 [mac80211] #3: (&intf->beacon_skb_mutex){+.+...}, at: [<f997a644>] rt2x00queue_update_beacon+0x24/0x50 [rt2x00lib] stack backtrace: Pid: 30374, comm: kworker/u:2 Not tainted 3.4.0-wl+ #4 Call Trace: [<c04962a6>] print_usage_bug+0x1f6/0x220 [<c0496a12>] mark_lock+0x2c2/0x300 [<c0495ff0>] ? check_usage_forwards+0xc0/0xc0 [<c04978ec>] __lock_acquire+0x4bc/0x1050 [<c0527890>] ? __kmalloc_track_caller+0x1c0/0x1d0 [<c0777fb6>] ? copy_skb_header+0x26/0x90 [<c0498504>] lock_acquire+0x84/0xf0 [<f9979a20>] ? rt2x00queue_create_tx_descriptor+0x380/0x490 [rt2x00lib] [<c0835733>] _raw_spin_lock+0x33/0x40 [<f9979a20>] ? rt2x00queue_create_tx_descriptor+0x380/0x490 [rt2x00lib] [<f9979a20>] rt2x00queue_create_tx_descriptor+0x380/0x490 [rt2x00lib] [<f997a5cf>] rt2x00queue_update_beacon_locked+0x5f/0xb0 [rt2x00lib] [<f997a64d>] rt2x00queue_update_beacon+0x2d/0x50 [rt2x00lib] [<f9977e3a>] rt2x00mac_bss_info_changed+0x1ca/0x200 [rt2x00lib] [<f9977c70>] ? rt2x00mac_remove_interface+0x70/0x70 [rt2x00lib] [<f98e4dd0>] ieee80211_bss_info_change_notify+0xe0/0x1d0 [mac80211] [<f98ef7b8>] __ieee80211_sta_join_ibss+0x3b8/0x610 [mac80211] [<c0496ab4>] ? mark_held_locks+0x64/0xc0 [<c0440012>] ? virt_efi_query_capsule_caps+0x12/0x50 [<f98efb09>] ieee80211_sta_join_ibss+0xf9/0x140 [mac80211] [<f98f0456>] ieee80211_ibss_work+0x416/0x470 [mac80211] [<c0496d8b>] ? trace_hardirqs_on+0xb/0x10 [<c077683b>] ? skb_dequeue+0x4b/0x70 [<f98f207f>] ieee80211_iface_work+0x13f/0x230 [mac80211] [<c045cf99>] ? process_one_work+0x109/0x3f0 [<c045d015>] process_one_work+0x185/0x3f0 [<c045cf99>] ? process_one_work+0x109/0x3f0 [<f98f1f40>] ? ieee80211_teardown_sdata+0xa0/0xa0 [mac80211] [<c045ed86>] worker_thread+0x116/0x270 [<c045ec70>] ? manage_workers+0x1e0/0x1e0 [<c0462f64>] kthread+0x84/0x90 [<c0462ee0>] ? __init_kthread_worker+0x60/0x60 [<c083d382>] kernel_thread_helper+0x6/0x10 Cc: stable@vger.kernel.org Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com> Acked-by: Helmut Schaa <helmut.schaa@googlemail.com> Acked-by: Gertjan van Wingerde <gwingerde@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-04-23rt2x00: Use GFP_KERNEL for rx buffer allocation on USB devicesHelmut Schaa
Since the RX path on USB devices is handled in process context we can use GFP_KERNEL for RX buffer allocation. This should reduce the likelihood of allocation failures. Signed-off-by: Helmut Schaa <helmut.schaa@googlemail.com> Acked-by: Gertjan van Wingerde <gwingerde@gmail.com> Tested-By: Marc Dietrich <marvin24@gmx.de> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-04-11rt2x00: do not generate seqno in h/w if QOS is disabledStanislaw Gruszka
This is workaround H/W or F/W bug, see in code comments. Without the fix ping can receive duplicated ICMP frames while associated with legacy AP. Reported-by: Walter Goldens <goldenstranger@yahoo.com> Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com> Acked-by: Helmut Schaa <helmut.schaa@googlemail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-04-11rt2x00: configure different txdesc parameters for non HT channelStanislaw Gruszka
This is needed when we are concted to non 11n AP. Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-03-15rt2x00: rt2800usb: rework txstatus codeStanislaw Gruszka
Currently we read tx status register after each urb data transfer. As callback procedure also trigger reading, that causing we have many "threads" of reading status. To prevent that introduce TX_STATUS_READING flags, and check if we are already in process of sequential reading TX_STA_FIFO, before requesting new reads. Change timer to hrtimer, that make TX_STA_FIFO overruns less possible. Use 200 us for initial timeout, and then reschedule in 100 us period, this values probably have to be tuned. Make changes on txdone work. Schedule it from rt2800usb_tx_sta_fifo_read_completed() callback when first valid status show up. Check in callback if tx status timeout happens, and schedule work on that condition too. That make possible to remove tx status timeout from generic watchdog. I moved that to rt2800usb. Loop in txdone work, that should prevent situation when we queue work, which is already processed, and after finish work is not rescheduled again. Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-02-27rt2x00:Add RT5372 chipset supportJohn Li
Signed-off-by: John Li <chen-yang.li@mediatek.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>
2012-02-27rt2x00:Add VCO recalibrationJohn Li
Signed-off-by: John Li <chen-yang.li@mediatek.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>
2012-02-08rt2x00: Update comment on freq_offset field in struct rt2x00_dev.Gertjan van Wingerde
The comment states that the field is only used for rt61pci and rt73usb. However, it is now used by rt2800pci and rt2800usb as well, so the comment is not correct anymore. Update the comment to not state any low-level drivers anymore. Signed-off-by: Gertjan van Wingerde <gwingerde@gmail.com> Acked-by: Stanislaw Gruszka <sgruszka@redhat.com> Acked-by: Ivo van Doorn <IvDoorn@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-02-08rt2x00: Use struct rt2x00_dev driver data in rt2800{pci,usb}.Gertjan van Wingerde
Start using the struct rt2x00_dev driver data in rt2800 for the calibration data. 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>
2012-02-08rt2x00: Introduce concept of driver data in struct rt2x00_dev.Gertjan van Wingerde
We are getting more and more fields in struct rt2x00_dev that are specific to one or two of the low-level drivers. Instead of putting these fields inside the main structure and thus clobbering all low-level drivers with these fields, introduce the concept of driver data inside struct rt2x00_dev, whose size is indicated by the low-level driver and which can be populated by the low-level driver. 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>
2012-01-04rt2x00: RT3593 is also applicable to USB.Gertjan van Wingerde
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>
2012-01-04rt2x00: Whitespace cleanup.Gertjan van Wingerde
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>
2011-11-15rt2x00: Fix sleep-while-atomic bug in powersaving code.Gertjan van Wingerde
The generic powersaving code that determines after reception of a frame whether the device should go back to sleep or whether is could stay awake was calling rt2x00lib_config directly from RX tasklet context. On a number of the devices this call can actually sleep, due to having to confirm that the sleeping commands have been executed successfully. Fix this by moving the call to rt2x00lib_config to a workqueue call. This fixes bug https://bugzilla.redhat.com/show_bug.cgi?id=731672 Tested-by: Tomas Trnka <tomastrnka@gmx.com> Signed-off-by: Gertjan van Wingerde <gwingerde@gmail.com> Cc: <stable@vger.kernel.org> Acked-by: Ivo van Doorn <IvDoorn@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-10-03mac80211: pass vif param to conf_tx() callbackEliad Peller
tx params should be configured per interface. add ieee80211_vif param to the conf_tx callback, and change all the drivers that use this callback. The following spatch was used: @rule1@ struct ieee80211_ops ops; identifier conf_tx_op; @@ ops.conf_tx = conf_tx_op; @rule2@ identifier rule1.conf_tx_op; identifier hw, queue, params; @@ conf_tx_op ( - struct ieee80211_hw *hw, + struct ieee80211_hw *hw, struct ieee80211_vif *vif, u16 queue, const struct ieee80211_tx_queue_params *params) {...} Signed-off-by: Eliad Peller <eliad@wizery.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-09-14rt2x00: Add WCID to crypto structHelmut Schaa
When a WCID was already assigned to a STA the key configuration functions need to use the same WCID for configuring the keys. Hence, add the WCID to the crypo configuration structure. Signed-off-by: Helmut Schaa <helmut.schaa@googlemail.com> Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-09-14rt2x00: Introduce sta_add/remove callbacksHelmut Schaa
This implements a basic sta_add and sta_remove callback. Introduce a new structure rt2x00_sta and ask mac80211 to allocate it as private part of its ieee80211_sta. rt2x00_sta only contains the WCID for now. The sta_add callback allows the driver to assign a WCID to a station that is currently being added. The same wcid is also passed to the sta_remove callback one mac80211 removes this STA. Signed-off-by: Helmut Schaa <helmut.schaa@googlemail.com> Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-09-14rt2x00: Move bssidx calculation into its own functionHelmut Schaa
This will be used by a later patch. No functional changes. Signed-off-by: Helmut Schaa <helmut.schaa@googlemail.com> Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-07-08Merge branch 'master' of ↵John W. Linville
git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-next-2.6 into for-davem
2011-07-07rt2x00: Implement tx_frames_pending mac80211 callback function.Gertjan van Wingerde
Implementing this callback function will cause mac80211 refrain from going to powersave state when there are still untransmitted TX frames in the queues. This would exactly mimic the behaviour of the legacy vendor driver which also doesn't go in powersave mode if there are still TX frames that are not transmitted. This should make powersaving and rt2x00 a better couple. Signed-off-by: Gertjan van Wingerde <gwingerde@gmail.com> Acked-by: Helmut Schaa <helmut.schaa@googlemail.com> Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-06-06net: remove interrupt.h inclusion from netdevice.hAlexey Dobriyan
* remove interrupt.g inclusion from netdevice.h -- not needed * fixup fallout, add interrupt.h and hardirq.h back where needed. Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2011-05-05Merge branch 'master' of ↵John W. Linville
git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-next-2.6 into for-davem Conflicts: drivers/net/wireless/libertas/if_cs.c drivers/net/wireless/rtlwifi/pci.c net/bluetooth/l2cap_sock.c
2011-05-02rt2x00: Add autowake support for USB hardwareIvo van Doorn
The USB drivers don't support automatically waking up when in powersaving mode, add a work object which will wakeup the device in time to receive the next beacon. Based on that beacon, we either go back into powersaving mode, or we remain awake to receive the buffered frames for our station. Some part of the code, especially rt2x00lib_find_ie and rt2x00lib_rxdone_check_ps are inspired on the code from carl9170. Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-05-02rt2x00: Introduce capability flag for Bluetooth co-existence.Gertjan van Wingerde
Use flag instead of re-reading the eeprom every time. Signed-off-by: Gertjan van Wingerde <gwingerde@gmail.com> Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-04-25Merge branch 'master' of ↵John W. Linville
git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-next-2.6 into for-davem Conflicts: drivers/net/wireless/iwlwifi/iwl-core.c drivers/net/wireless/rt2x00/rt2x00queue.c drivers/net/wireless/rt2x00/rt2x00queue.h
2011-04-19rt2x00: Implement get_antenna and set_antenna callback functionsIvo van Doorn
Implement the get_antenna and set_antenna callback functions, which will allow clients to control the antenna for all non-11n hardware (Antenna handling in rt2800 is still a bit magical, so we can't use the set_antenna for those drivers yet). To best support the set_antenna callback some modifications are needed in the diversity handling. We should never look at the default antenna settings to determine if software diversity is enabled. Instead we should set the diversity flag when possible, which will allow the link_tuner to automatically pick up the tuning. 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>
2011-04-19rt2x00: Implement get_ringparam callback functionIvo van Doorn
With the get_ringparam callback function we can export ring parameters to ethtool through the mac80211 interface. 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>
2011-04-19rt2x00: Decrease association time for USB devicesIvo van Doorn
When powersaving is enabled, assocaition times are very high (for WPA2 networks, the time can easily be around the 3 seconds). This is caused, because the flushing of the queues takes too much time. Without the flushing callback mac80211 assumes a timeout of 100ms while scanning. Limit all flush waiting loops to the same maximum. We can apply this maximum by passing the drop status to the driver, which makes sure the driver performs extra actions during the waiting for the queue to become empty. After these changes, association times fall within the healthy range of ~0.6 seconds with powersaving enabled. The difference between association time between powersaving enabled and disabled is now only ~0.1 second (which can also be due to the measuring method). 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>
2011-04-19rt2800usb: add timer to handle TX_STA_FIFOJohannes Stezenbach
TX status is reported by the hardware when a packet has been sent (or after TX failed after possible retries), which is some time after the DMA completion. Since the rt2800usb hardware can not signal interrupts we have to use a timer, otherwise the TX status would only be read by the next packet's TX DMA completion, or by the watchdog thread. Signed-off-by: Johannes Stezenbach <js@sig21.net> Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-04-19rt2800usb: read TX_STA_FIFO asynchronouslyJohannes Stezenbach
Trying to fix the "TX status report missed" warnings by reading the TX_STA_FIFO entries as quickly as possible. The TX_STA_FIFO is too small in hardware, thus reading it only from the workqueue is too slow and entries get lost. Start an asynchronous read of the TX_STA_FIFO directly from the TX URB completion callback (atomic context, thus it cannot use the blocking rt2800_register_read()). If the async read returns a valid FIFO entry, it is pushed into a larger FIFO inside struct rt2x00_dev, until rt2800_txdone() picks it up. A .tx_dma_done callback is added to struct rt2x00lib_ops to trigger the async read from the URB completion callback. Signed-off-by: Johannes Stezenbach <js@sig21.net> Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-04-19rt2x00: Split rt2x00dev->flagsIvo van Doorn
The number of flags defined for the rt2x00dev->flags field, has been growing over the years. Currently we are approaching the maximum number of bits which are available in the field. A secondary problem, is that one part of the field are initialized only during boot, because the driver requirements are initialized or device requirements are loaded from the EEPROM. In both cases, the flags are fixed and will not change during device operation. The other flags are the device state, and will change frequently. So far this resulted in the fact that for some flags, the atomic bit accessors are used, while for the others the non-atomic variants are used. By splitting the flags up into a "flags" and "cap_flags" we can put all flags which are fixed inside "cap_flags". This field can then be read non-atomically. In the "flags" field we keep the device state, which is going to be read atomically. This adds more room for more flags in the future, and sanitizes the field access methods. Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com> Acked-by: Helmut Schaa <helmut.schaa@googlemail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-04-12Merge branch 'master' of ↵John W. Linville
git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-next-2.6 into for-davem Conflicts: drivers/net/wireless/ath/ar9170/main.c drivers/net/wireless/ath/ar9170/phy.c drivers/net/wireless/zd1211rw/zd_rf_rf2959.c
2011-04-04rt2x00: Implement tx power temperature compensationHelmut Schaa
rt2800 devices should adjust their tx power in accordance with the eeproms temperature calibration values. Add a new driver callback gain_calibration that is called every 4 seconds. The rt2800 gain calibration routine simply runs the tx power configuration that takes care of calculating the temperature compensation delta. We don't need to synchronize the calls to rt2800_config_txpower as they should all happen from mac80211's single threaded workqueue. Signed-off-by: Helmut Schaa <helmut.schaa@googlemail.com> Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-04-04rt2x00: Remove DRIVER_SUPPORT_WATCHDOG flagHelmut Schaa
We can simply check if the driver registered the watchdog callback. There's no need to have an additional flag for that. Signed-off-by: Helmut Schaa <helmut.schaa@googlemail.com> Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>