summaryrefslogtreecommitdiff
path: root/drivers/net/wireless/iwlwifi/iwl-core.h
AgeCommit message (Collapse)Author
2011-04-18iwlagn: use direct call for led functionsWey-Yi Guy
After driver split, no need to call led functions through callback Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2011-04-08iwlagn: clean up & autodetect statisticsJohannes Berg
There's no need to keep both normal and BT statistics versions around all the time in memory when we only use a subset of both. So keep only the subsets that we need in memory, depending on the debug config). Also, in doing so, we can remove all the calls to iwl_bt_statistics() in the driver as we'll just access the copied statistics now. Finally, also remove this call from the one place where it might still be needed and automatically detect what kind of statistics the device is sending based on their size. This way, we don't need to keep track of which devices do what any more, which is good since this is subject to change based on the ucode version (as some ucode even for non-BT devices will in fact use BT statistics). Warn upon encountering a statistics command from the ucode that isn't known, so we will find such issues earlier in the future. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Tested-by: Don Fry <donald.h.fry@intel.com> Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2011-04-08iwlagn: sensitivity and chain noise done by driverWey-Yi Guy
_agn driver should perform both sensitivity and chain noise calib. Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2011-04-08iwlagn: tx power calib always done in firmwareWey-Yi Guy
Remove the config flag for tx power calib Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2011-04-08iwlagn: all _agn devices support power save modeWey-Yi Guy
Remove broken_power_save checking Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2011-04-08iwlagn: remove un-needed configurationWey-Yi Guy
After driver split, set_l0s config is no longer needed, remove it Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2011-04-08iwlagn: PAPD read for 2000 series devicesWey-Yi Guy
For 2000 series NICs, disable OTP refresh in order to read correct PAPD table from high OTP block Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2011-04-08iwlagn: remove un-necessary function pointerWey-Yi Guy
After driver split, no need to use function pointer for those event and register dump function. Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2011-04-07iwlagn: remove ISR opsJohannes Berg
The ISR (interrupt service routine) ops are now no longer necessary since they are the same for all devices this driver now handles. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-04-07iwlagn: remove BSM clock settingJohannes Berg
Again, a 4965 specific code path that we no longer need in iwlagn. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-04-07iwlagn: add feature flagsJohannes Berg
Some new devices and microcode files will a greater variety of features, so the TLV-per-feature approach we took before will quickly make things harder to manage and increase the file size. Add a new TLV that has feature flags. Currently, it will contain: 1) a PAN feature flag, which moves from a separate TLV 2) a new BT stats bit that indicates whether the microcode image uses bluetooth statistics 3) a new MFP flag for management frame protection which can be enabled once the device/microcode supports it Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-04-07iwlagn: change Copyright to 2011Wey-Yi Guy
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-04-07iwlagn: centralize and fix ucode restartJohannes Berg
The ucode restart has to take into account a number of things, like clearing the HCMD_ACTIVE and other status bits, and waking up the wait_command_queue. Currently, however, there are a number of places that neither do that, nor actually set the FW error bit that leads to proper restart handling, which means that in those cases things will probably just hang completely. To clean this up, make all ucode restart go through a single function, except for the cases where it's called during firmware loading. Also fix a bug in wimax coexist restart avoidance, it needs to first clear the status bits (and it has to clear the HCMD_ACTIVE one as well) and then wake up anything waiting on wait_command_queue. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-04-07iwlagn: clean up ucode loadingJohannes Berg
All agn devices behave the same, so there's no need to go through function pointers for any of the ucode loading functionality. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-03-25iwlagn: remove deprecated module parametersWey-Yi Guy
Number of deprecated module parameters need to be remove for 2.6.40 kernel Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2011-03-25iwlwifi: remove legacy isr taskletWey-Yi Guy
After driver split, no need for support legacy isr, remove it. Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2011-03-25iwlwifi: cleanup and bugfix tx aggregation codeDaniel Halperin
Since the driver split, there's no need for no_agg_framecnt_info since all devices have this set to false. Secondly, the compressed block ack handling code was broken. Fix this. (1) A shift less than zero simply implies that the buffer wrapped, this is expected. Remove the incorrect comment. (2) The (agg->frame_count > (64-sh)) condition can happen if the last frame is dropped. E.g., if I send 7 frames and the 6th is received but the 7th is lost, the other side may only shift the window 6, not 7 frames since the last bit is a 0. This is perfectly fine behavior and doesn't invalidate the feedback. (3) Store the feedback from a Compressed BA in the first newly received frame, rather than the start of the window. This way it will get processed by the rate selection code. Feedback stored in a non-received frame is likely to get overwritten by the retransmission. This is based on the approach taken by minstrel_ht. Signed-off-by: Daniel Halperin <dhalperi@cs.washington.edu> Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2011-03-25iwlagn: clean up TX aggregation codeJohannes Berg
Since the driver split, there's no need for function pointers any more for aggregation queue setup and teardown as all devices now share the same code. Simplify this. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2011-03-11iwlagn: support off-channel TXJohannes Berg
Add support to iwlagn for off-channel TX. The microcode API for this is a bit strange in that it uses a hacked-up scan command, so the scan code needs to change quite a bit to accomodate that and be able to send it out. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-03-04iwlwifi: move rx handlers code to iwl-rx.cStanislaw Gruszka
Put generic rx_handlers (except iwlagn_rx_reply_compressed_ba) to iwl-rx.c . Make functions static and change prefix from iwlagn_ to iwl_ . Beautify iwl_setup_rx_handlers and do some other minor coding style changes. Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com> Acked-by: Wey-Yi Guy <wey-yi.w.guy@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-02-28iwlwifi: move remaining iwl-agn-rx.c code into iwl-rx.cStanislaw Gruszka
There is no need to have separate iwl-agn-rx.c file after iwlegacy split. Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com> Acked-by: Wey-Yi Guy <wey-yi.w.guy@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-02-28iwlwifi: move check health code into iwl-rx.cStanislaw Gruszka
Remove check_plcp_health and check_ack_health ops methods, they are unneeded after iwlegacy driver split. Merge check health code into to iwl-rx.c and make functions static. Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com> Acked-by: Wey-Yi Guy <wey-yi.w.guy@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-02-28iwlwifi: add {ack,plpc}_check module parametersStanislaw Gruszka
Add module ack_check, and plcp_check parameters. Ack_check is disabled by default since is proved that check ack health can cause troubles. Plcp_check is enabled by default. Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com> Acked-by: Wey-Yi Guy <wey-yi.w.guy@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-02-28iwlwifi: fix dma mappings and skbs leakStanislaw Gruszka
Since commit commit 470058e0ad82fcfaaffd57307d8bf8c094e8e9d7 "iwlwifi: avoid Tx queue memory allocation in interface down" we do not unmap dma and free skbs when down device and there is pending transfer. What in consequence may cause that system hung (waiting for free skb's) when performing shutdown at iptables module unload. DMA leak manifest itself following warning: WARNING: at lib/dma-debug.c:689 dma_debug_device_change+0x15a/0x1b0() Hardware name: HP xw8600 Workstation pci 0000:80:00.0: DMA-API: device driver has pending DMA allocations while released from device [count=240] Modules linked in: iwlagn(-) aes_x86_64 aes_generic fuse cpufreq_ondemand acpi_cpufreq freq_table mperf xt_physdev ipt_REJECT nf_conntrack_ipv4 nf_defrag_ipv4 iptable_filter ip_tables ip6t_REJECT nf_conntrack_ipv6 nf_defrag_ipv6 xt_state nf_conntrack ip6table_filter ip6_tables ipv6 ext3 jbd dm_mirror dm_region_hash dm_log dm_mod uinput hp_wmi sparse_keymap sg wmi microcode serio_raw tg3 arc4 ecb shpchp mac80211 cfg80211 rfkill ext4 mbcache jbd2 sr_mod cdrom sd_mod crc_t10dif firewire_ohci firewire_core crc_itu_t mptsas mptscsih mptbase scsi_transport_sas pata_acpi ata_generic ata_piix ahci libahci floppy nouveau ttm drm_kms_helper drm i2c_algo_bit i2c_core video [last unloaded: iwlagn] Pid: 9131, comm: rmmod Tainted: G W 2.6.38-rc6-wl+ #33 Call Trace: [<ffffffff810649ef>] ? warn_slowpath_common+0x7f/0xc0 [<ffffffff81064ae6>] ? warn_slowpath_fmt+0x46/0x50 [<ffffffff812320ab>] ? dma_debug_device_change+0xdb/0x1b0 [<ffffffff8123212a>] ? dma_debug_device_change+0x15a/0x1b0 [<ffffffff8149dc18>] ? notifier_call_chain+0x58/0xb0 [<ffffffff8108e370>] ? __blocking_notifier_call_chain+0x60/0x90 [<ffffffff8108e3b6>] ? blocking_notifier_call_chain+0x16/0x20 [<ffffffff812f570c>] ? __device_release_driver+0xbc/0xe0 [<ffffffff812f5808>] ? driver_detach+0xd8/0xe0 [<ffffffff812f45d1>] ? bus_remove_driver+0x91/0x100 [<ffffffff812f6022>] ? driver_unregister+0x62/0xa0 [<ffffffff8123d5d4>] ? pci_unregister_driver+0x44/0xa0 [<ffffffffa05632d1>] ? iwl_exit+0x15/0x1c [iwlagn] [<ffffffff810ab492>] ? sys_delete_module+0x1a2/0x270 [<ffffffff81498da9>] ? trace_hardirqs_on_thunk+0x3a/0x3f [<ffffffff8100bf42>] ? system_call_fastpath+0x16/0x1b I still can observe above warning after apply patch, but it is very hard to reproduce it, and have count=1. Whereas that one is easy to reproduce using debugfs force_reset while transmitting data, and have very big counts eg. 240, like quoted here. So count=1 WARNING seems to be different issue that need to be resolved separately. v1 -> v2: fix infinity loop bug I made during "for" to "while" loop transition. v2 -> v3: remove unneeded EXPORT_SYMBOL Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com> Acked-by: Wey-Yi Guy <wey-yi.w.guy@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-02-26iwlagn: enable BT session 2 type UART for 2000 seriesWey-Yi Guy
For 2000 series device, use session 2 type of BT UART message Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2011-01-31iwlwifi: always support idle mode for agn devicesWey-Yi Guy
For agn devices, always support idle mode which help power consumption in idle unassociated state. Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2011-01-31iwlagn: add IQ inversion support for 2000 series devicesWey-Yi Guy
The I/Q swapping is extremely important and should be dealt with extra care. It will affects OFDM and CCK differently. For 6000/6005/6030 series devices, the I/Q were swapped, and for 2000 series devices, it is in non-swapped status (but its swapped with respected to 6000/6005/6030). so the CSR_GP_DRIVER_REG_BIT_RADIO_IQ_INVER register need to be set to support the correct behavior. Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2011-01-28iwlwifi: introduce iwl_bt_statisticsStanislaw Gruszka
We use priv->cfg->bt_params && priv->cfg->bt_params->bt_statistics conditional in few places, merge it into one function. Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com> Acked-by: Wey-Yi Guy <wey-yi.w.guy@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-01-28iwlwifi: introduce iwl_advanced_bt_coexist()Stanislaw Gruszka
We use priv->cfg->bt_params && priv->cfg->bt_params->advanced_bt_coexist conditional in few places, merge it into one function. Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com> Acked-by: Wey-Yi Guy <wey-yi.w.guy@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-01-21iwlwifi: use mac80211 throughput triggerWey-Yi Guy
Instead of keeping track of LED blink speed in the driver, use the new mac80211 trigger and link it up with an LED classdev that we now register. This also allows users more flexibility in how they want to have the LED blink or not. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2011-01-04iwlagn: fix scan tx antenna setting on 5Ghz bandStanislaw Gruszka
Looks that we do not set correctly antennas when scanning on 5Ghz band and when bluetooth is enabled, because priv->cfg->scan_tx_antennas[band] is only defined for IEEE80211_BAND_2GHZ. To fix we check band before limiting antennas to first one. This allow to remove hard coded cfg->scan_tx_antennas[band]. Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com> Acked-by: Wey-Yi Guy <wey-yi.w.guy@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-12-13iwlwifi: do not reload fw if WiMAX own the RFWey-Yi Guy
For WiFi/WiMAX combo devices, if WiMAX own the RF, WiFi driver try to access RF and fail. This is the W/A to To avoid WiFi keep reloading firmware and try to access RF again. Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2010-12-13iwlagn: remove old EEPROM TX power readingJohannes Berg
This removes the old TX power reading code, it isn't necessary since the new code is able to read all the various EEPROM layouts due to relying on information contained in the EEPROM. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2010-12-13iwlagn: implement layout-agnostic EEPROM readingJohannes Berg
The current EEPROM reading code has some layout assumptions that now turned out to be false with some newer versions of the EEPROM. Luckily, we can avoid all such assumptions by using data in the EEPROM itself, so implement using that. However, for risk mitigation purposes, keep the old reading code for current hardware for now. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2010-12-13iwlagn: rx antenna diversityWey-Yi Guy
For the new 1x1 devices, hw and uCode will support rx antenna diversity, but we need to indicate 1x1 device to AccessPoint to make sure it won't use MIMO. Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2010-12-06iwlwifi: jiffies based tx queues watchdogStanislaw Gruszka
This patch replace monitor/recover timer by watchdog based on time stamp. New code allow to discover hangs more precisely. Timeout values are currently doubled monitoring period values of previous timer. This have to be tuned based of firmware timing capabilities. Tested on 3945, 4965, 5300, 6300. Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com> Acked-by: Wey-Yi Guy <wey-yi.w.guy@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-11-24iwlwifi: advance power management supportWey-Yi Guy
For 6000g2b and up, adding advance power management support for better power consumption Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-11-24iwlwifi: consider BT for power managementWey-Yi Guy
Check the BT PSPoll flag when fill PM command to uCode Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-11-16iwlwifi: change default led mode for different devicesWey-Yi Guy
Set the default led mode for different devices. For the newer devices such as 6000g2a, 6000g2b and newer, the default led mode is On/Off instead of blinking. The led_mode still can be control through module parameter 0: system default 1: On/Off 2: blinking Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2010-11-16iwlagn: used frame count info in compressed ba packetWey-Yi Guy
For newer devices, uCode provide both "number of frames sent" and "number of frames acked" information inside the compressed_ba packet. So instead of figure the success/failure information through the bitmap, use those information which is much betrer approach. Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2010-11-15iwlagn: enable shadow registerWey-Yi Guy
For 6000 series devices and up, enable automatic update MAC's register for better power usage in PSP mode Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-11-15iwlwifi: legacy tx_cmd_protection functionWey-Yi Guy
Legacy (4965 and 3945) devices has different tx_cmd_protection routine. Move to iwl-legacy.c Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-11-15iwlwifi: put all the isr related function under opsWey-Yi Guy
There were two type of isr supported by iwlwifi devices. legacy isr - only used by legacy devices (3945 & 4965) ict isr - used by all new generation of iwlwifi devices Move all the isr related functions into ops, the ict type of isr supports only needed for newer devices. Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-11-15iwlwifi: Legacy isr only used by legacy devicesWey-Yi Guy
Move iwl_isr_legacy function to iwl_legacy.c since it only used by legacy devices. Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-11-15iwlwifi: implement switching iftype while upJohannes Berg
Implement switching the interface while an interface is up in iwlwifi. Interfaces have to stay on the context they were created on. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-11-15iwlagn: new RXON processing for modern devicesJohannes Berg
In order to simplify the flow, and make new enhancements easier, separate out the RXON processing for modern AGN (5000 and newer) from RXON processing for the older 3945 and 4965 devices. Avoid changing these old ones to avoid regressions and move their code to a new file (iwl-legacy.c). 4965 gets the commit_rxon that used to be common for all AGN devices, but with removed PAN support. The new RXON processing is more central and does more work in committing, so that it is easier to follow. To make it more evident what is split out for legacy, split the necessary operations for that into a new struct iwl_legacy_ops. Those parts that still exist in the new AGN code don't need to be parametrized. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-11-15iwlwifi: make mac80211 ops a device configJohannes Berg
In the future, 4965 and modern AGN devices will need to have different mac80211 callbacks since they have different capabilities. Prepare for that by making the mac80211 operations a device config. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-11-15iwlwifi: Convert to new PCI PM frameworkJohn W. Linville
Use the new PCI PM and let the PCI core code handle the PCI-specific details of power transitions. Based on similarly titled ath9k patch posted by Rafael J. Wysocki. Signed-off-by: John W. Linville <linville@tuxdriver.com> Acked-by: Rafael J. Wysocki <rjw@sisk.pl> Acked-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2010-10-07iwlagn: add temperature offset calib for 6000g2Shanyu Zhao
6000g2 devices need to have temperature offset calibration. The runtime uCode needs to receive the calibration results just like BB and LO calibration. To do this, driver reads the offset value from NVM and send it to uCode after runtime uCode is alive. Signed-off-by: Shanyu Zhao <shanyu.zhao@intel.com> Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2010-10-07iwlwifi: clean up declarationsJohannes Berg
A number of declarations in iwl-core.h should be in agn specific files, and also rename the iwl-calib.h file to iwl-agn-calib.h to better reflect that it belongs to agn. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>