aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/iwlwifi/iwl-agn-lib.c (follow)
AgeCommit message (Collapse)AuthorFilesLines
2011-01-21cfg80211: Extend channel to frequency mapping for 802.11jBruno Randolf1-2/+3
Extend channel to frequency mapping for 802.11j Japan 4.9GHz band, according to IEEE802.11 section 17.3.8.3.2 and Annex J. Because there are now overlapping channel numbers in the 2GHz and 5GHz band we can't map from channel to frequency without knowing the band. This is no problem as in most contexts we know the band. In places where we don't know the band (and WEXT compatibility) we assume the 2GHz band for channels below 14. This patch does not implement all channel to frequency mappings defined in 802.11, it's just an extension for 802.11j 20MHz channels. 5MHz and 10MHz channels as well as 802.11y channels have been omitted. The following drivers have been updated to reflect the API changes: iwl-3945, iwl-agn, iwmc3200wifi, libertas, mwl8k, rt2x00, wl1251, wl12xx. The drivers have been compile-tested only. Signed-off-by: Bruno Randolf <br1@einfach.org> Signed-off-by: Brian Prodoehl <bprodoehl@gmail.com> Acked-by: Luciano Coelho <coelho@ti.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-01-21iwlagn: add support for waiting for notificationsJohannes Berg1-0/+46
In order to implement waiting for notifications, add a structure that captures the information, and a list of such structures that will be traversed when a command is received from the ucode. Use sparse checking to make sure calls to the prepare/wait/cancel functions are always nested correctly. 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-01-04iwlagn: fix scan tx antenna setting on 5Ghz bandStanislaw Gruszka1-9/+5
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: keep track of bt coex enable/disable stageWey-Yi Guy1-0/+1
For debugging purpose, keep track of the bt coex enable/disable state. Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2010-12-13iwlagn: implement layout-agnostic EEPROM readingJohannes Berg1-0/+6
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-06iwlwifi: jiffies based tx queues watchdogStanislaw Gruszka1-0/+1
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-24iwlagn: minor change in bt coex normal LUTWey-Yi Guy1-1/+1
Minor changes in LUT Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2010-11-24iwlagn: use different kill mask when SCO activeWey-Yi Guy1-13/+19
use different kill_ack_mask and kill_cts_mask when detect SCO is active. Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2010-11-24iwlwifi: consider BT for power managementWey-Yi Guy1-0/+4
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-22iwlwifi: Use static constJoe Perches1-3/+3
Using static const generally increases object text and decreases data size. It also generally decreases overall object size. text data bss dec hex filename 48644 57 12120 60821 ed95 drivers/net/wireless/b43/phy_n.o.new 48661 57 12120 60838 eda6 drivers/net/wireless/b43/phy_n.o.old 37906 86 7904 45896 b348 drivers/net/wireless/iwlwifi/iwl-agn-lib.o.new 37937 86 7904 45927 b367 drivers/net/wireless/iwlwifi/iwl-agn-lib.o.old 37781 523 6752 45056 b000 drivers/net/wireless/iwlwifi/iwl-3945.o.new 37781 523 6752 45056 b000 drivers/net/wireless/iwlwifi/iwl-3945.o.old Changed b43_nphy_write_clip_detection to take a const u16 * Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-11-16iwlwifi: always build swq_id as virtual queue IDJohannes Berg1-1/+0
Previously, we used the swq_id's mechanism to have AC and HW queue different only for aggregation queues. To be able to fix a bug with iPAN simply always build the swq_id as ac | (hwq << 2) and remove the flag bit. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2010-11-16iwlwifi: pass txq to wake/stop queueJohannes Berg1-2/+2
Instead of passing the txq->swq_id, pass the txq struct directly to make sure that in the future nobody will pass an invalid number. Only three places actually change from using the txq_id or the skb's queue_mapping to now using txq->swq_id as well. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2010-11-16iwlagn: remove a bogus AGG_OFF checkJohannes Berg1-6/+2
Even if this check were to happen, using the txq_id here (which is a HW queue) would lead to confusion in mac80211. Luckily, it doesn't seem like this can ever happen. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2010-11-16iwlagn: support dynamic aggregation for BT coexWey-Yi Guy1-4/+2
Use dynamic aggregation threshold if bt traffic load is high to reduce the impact on aggregated frame. Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2010-11-15iwlagn: enable shadow registerWey-Yi Guy1-0/+6
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-15iwlagn: fix non-5000+ buildJohannes Berg1-16/+0
When building 4965 without 5000+ there were a lot of build errors due to functions being used that weren't even compiled in. To fix this move some code around and only compile the HCMD code for 5000+ series as it's not used for 4965. 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: turn dynamic smps on while BT is onWey-Yi Guy1-1/+4
While BT is on and doing iscan and/or pscan, BT is in listen mode which will impact WiFi throughput, we need to enable dynamic smps in order to improve the rx throughput. Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-11-15iwlwifi: avoid commit rxon during scan in iwlagn_bt_traffic_change_workStanislaw Gruszka1-1/+16
Avoid sending commands to firmware (including commit_rxon) when scan is pending and we are calling iwlagn_bt_traffic_change_work simultaneously. Also comment some innocent race conditions. 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-15iwlwifi: send tx_power_cmd synchronouslyStanislaw Gruszka1-3/+2
On 5xxx and 6xxx change to send tx_power_cmd command synchronously, to do not start other commands when setting tx power is pending. We currently do the same for 4956 and 3945. 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-15iwlwifi: warn when send tx power settings during scanStanislaw Gruszka1-0/+4
Add WARN_ONCE when scanning is pending. Use STATUS_SCAN_HW bit since we can have scan canceled or completed but STATUS_SCANNING bit still set. v1 -> v2: replace EIO to EAGAIN Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com> Acked-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-10-14iwlwifi: allow probe-after-rx on 2.4 GHzJohannes Berg1-20/+20
There are two passive 2.4 GHz channels: 12 and 13. If you have a hidden SSID on those, you will not be able to connect to it because we don't send out probe requests there. We can allow this by using the firmware's probe-after-rx functionality on those channels as well. This fixes https://bugzilla.kernel.org/show_bug.cgi?id=16462 Reported-by: Daniel J Blueman <daniel.blueman@gmail.com> Tested-by: Daniel J Blueman <daniel.blueman@gmail.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2010-10-07iwlwifi: fix dual-mode scanningJohannes Berg1-1/+3
The recent scanning code shuffle accidentally moved the SCAN_HW bit setting _after_ the PAN parameters are modified, which means that they don't take the scan into account -- fix that. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2010-10-07iwlwifi: remove set_pwr_src operationJohannes Berg1-1/+18
The set_pwr_src operation is only ever used from within the same sub-driver that it is declared in, so it can just be called directly instead of being an operation. Also, it is never called to set the power source to V_aux, so change the two functions accordingly (but keep the V_aux code for documentation purposes in a comment). Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2010-10-07iwlwifi: move iwl_dump_fh to agnJohannes Berg1-0/+61
The iwl_dump_fh function is only used by the agn module, so it can be there instead of being exported by the core. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2010-10-07iwlwifi: move iwl_dump_csr to agnJohannes Berg1-0/+69
The iwl_dump_csr function is only used within the agn module, so it can be moved there instead of being exported by the core. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2010-10-07iwlwifi: move iwl_toggle_rx_ant to agnJohannes Berg1-0/+17
The iwl_toggle_tx_ant function is only used by agn code, so it can be moved into the agn module instead of being exported from the core. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2010-10-07iwlwifi: move agn specific station code thereJohannes Berg1-3/+3
By duplicating a little bit of code between 3945 and agn, we can move a lot of code into an agn specific station management file and thus reduce the amount of code in core that is dead to 3945. before: text data bss dec hex filename 212886 3872 96 216854 34f16 iwlcore.ko 620542 10448 304 631294 9a1fe iwlagn.ko 314013 3264 196 317473 4d821 iwl3945.ko after: text data bss dec hex filename 202857 3872 92 206821 327e5 iwlcore.ko 629102 10448 308 639858 9c372 iwlagn.ko 314240 3264 196 317700 4d904 iwl3945.ko delta: -10029 iwlcore.ko 8560 iwlagn.ko 227 iwl3945.ko so it's a net win even if you have both loaded, likely because a lot of EXPORT_SYMBOLs go away. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2010-10-07iwlwifi: move chain settings to agnJohannes Berg1-0/+140
The core module doesn't need to carry around the code for chain settings that is used for HT drivers (agn) only. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2010-10-07iwlwifi: introduce post_scan hookJohannes Berg1-0/+16
The different drivers need to do different things after a scan, so create a post_scan hook to allow them to do this. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2010-10-06iwlagn: rename iwl5000_tx_respWey-Yi Guy1-6/+8
iwl5000_tx_resp really should be iwlagn_tx_resp, rename it. Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2010-10-06iwlagn: rename iwl5000_tx_power_dbm_cmdWey-Yi Guy1-3/+3
iwl5000_tx_power_dbm_cmd really should be iwlagn_tx_power_dbm_cmd, so rename it. Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2010-10-06iwlagn: reduce redundant parameter definitionsWey-Yi Guy1-9/+18
move paramater definitions to a device paramater structure only leaving the device name, which antennas are used and what firmware file to use in the iwl_cfg structure. this will not completely remove the redundancies but greatly reduce them for devices that only vary by name or antennas. the parameters that are more likely to change within a given device family are left in iwl_cfg. also separate bt param structure added to help reduce more. Signed-off-by: Jay Sternberg <jay.e.sternberg@intel.com> Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2010-09-17iwlagn: initialize both tx/rx prio boost parametersWey-Yi Guy1-0/+2
For config bt command, initialize both tx_prio_boost and rx_prio_boost to "0". Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2010-09-17iwlagn: correct naming for failure reply tx statusWey-Yi Guy1-2/+2
For failure tx status 0x90 and 0x91, give the correct name to reflect the errors. Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2010-09-17iwlagn: keep track of aggregated tx frames failure counterWey-Yi Guy1-0/+50
When uCode completed the aggregated frames transmission attempt, it will send tx command response with aggregated frame status. Keep track of the failure counter which help indicate any transmission error condition. Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2010-09-17iwlagn: log aggregation tx command statusWey-Yi Guy1-0/+32
For aggregated frames with block ack, different status flag will be used as part of tx command response. Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2010-09-17iwlagn: keep track fail tx reason counterWey-Yi Guy1-0/+79
If uCode fail to transmit frame, it will send reply tx back to driver with failure status; keep the counters of each failure cases for debugging. Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2010-09-14iwlwifi: unify scan start checksJohannes Berg1-67/+21
Rather than duplicating all the checks and even in case of errors accepting the scan request from mac80211, we can push the checks to the caller and in all error cases reject the scan request right away (rather than accepting and then saying it was aborted). Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com> Acked-by: Wey-Yi W Guy <wey-yi.w.guy@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-09-14iwlwifi: remove unused conf variablesJohannes Berg1-3/+0
There are a number of conf variables that are unused, remove them. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com> Acked-by: Wey-Yi W Guy <wey-yi.w.guy@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-09-11iwlwifi: remove code repetitionWey-Yi Guy1-32/+28
Move the duplicated code into single static function. Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2010-08-27iwlwifi: send PAN parametersJohannes Berg1-0/+5
In order for the microcode to be able to handle multiple interfaces, we need to give it the PAN parameters that state how to allocate the time between the two interfaces. Do this, and update it wherever necessary. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2010-08-27iwlwifi: move virtual interface pointer into contextJohannes Berg1-3/+7
iwlwifi occasionally needs to find the virtual interface pointer to give it to mac80211, but right now it only keeps one. Move it into the context so that we can keep one pointer each. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2010-08-27iwlwifi: contextify broadcast stationJohannes Berg1-2/+7
The broadcast station ID is per context, so add a variable for the ID in the context and use it everywhere we previously hardcoded it. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2010-08-27iwlwifi: prepare for PAN queue/fifo assignmentJohannes Berg1-1/+1
PAN ucode will require a different queue assignment, in particular queue 9 instead of 4 should be used for commands. This is required because the ucode will stop/start queues 4 and 8 depending on the PAN state, since queue 8 will be used for PAN multicast (after DTIM). Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2010-08-27iwlwifi: initial contextificationJohannes Berg1-2/+4
In order to support multiple interfaces, we must move a lot of data into per-context structures so we can use the contexts the device offers. To start with, this makes a lot of code context-aware, more changes will move more things into the context structure. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2010-08-25iwlagn: generic bt coex functionsWey-Yi Guy1-0/+370
Move bt coex functions to iwl-agn-lib.c, so those functions can be shared by multiple wifi/bt combo devices Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-08-25iwlwifi: indicate bt_kill condition when receive tx replyWey-Yi Guy1-1/+8
Generate log when receive tx reply with bt_kill count > 0 and in advance bt coex mode Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-08-25iwlwifi: add bt full concurrency supportWey-Yi Guy1-0/+11
Adding the bluetooth full concurrency support for WiFi/BT combo devices. Driver should configure uCode to operate in "full concurrency" mode (via LUT) if both conditions are met: - Antenna Coupling is more than 35dB - WiFi Channel Inhibition Request is hornored by BT Core Currently, there is no antenna coupling information provided by uCode; use module parameter to specified the antenna coupling in dB. When in "full concurrency" mode, driver need to download different LUT to uCode while sending bt configuration command; also, driver need to configure the device operate in 1x1 while in full concurrency mode. Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-08-25iwlagn: set BT IGNORE for some framesJohannes Berg1-0/+6
The BT ignore bit should be set when transmitting auth, assoc response and eap frames. Also, scanning should set the BT ignore bit for the probe request transmission; Note that we only use the non-shared antenna. 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-08-24iwlwifi: do not call ieee80211_frequency_to_channelShanyu Zhao1-1/+1
A few cases in iwlwifi driver function ieee80211_frequency_to_channel() is called to get channel number from center frequency. This is not needed since the channel number is already saved in hw_value field of struct ieee80211_channel in function iwlcore_init_geos(). So replace those function calls with hw_value field of struct ieee80211_channel. Signed-off-by: Shanyu Zhao <shanyu.zhao@intel.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>