aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/iwlwifi/iwl-agn.c
Commit message (Collapse)AuthorAge
* iwlagn: new RXON processing for modern devicesJohannes Berg2010-11-15
| | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* iwlagn: don't resend RXON timingJohannes Berg2010-11-15
| | | | | | | | | | | | | | | Resending RXON timing here caused issues with dual-mode under certain circumstances, so avoid doing it here right now. This effectively reverts b01efe434bd6ea807eb72b and partially 2491fa42d9bdf26075765. The next patch will make all this cleaner for just the devices that need 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>
* iwlwifi: make mac80211 ops a device configJohannes Berg2010-11-15
| | | | | | | | | | | | 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>
* iwlwifi: Convert to new PCI PM frameworkJohn W. Linville2010-11-15
| | | | | | | | | | | 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>
* iwlwifi: avoid commit rxon during scan in iwlagn_configure_filterStanislaw Gruszka2010-11-15
| | | | | | | | | | | | | | | Almost anywhere in the code we avoid committing rxon while performing scan, and make rxon commit when scan complete. However in some places in the code we do not follow that rule. This patch fix that problem in iwlagn_configure_filter(). Since we do not commit directly in iwl3945_configure_filter, we can also do the same for agn, so I just remove iwlcore_commit_rxon() function and add a comment. Also change comment for iwl3945. 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>
* iwlwifi: fix set_tx_power vs scanStanislaw Gruszka2010-11-15
| | | | | | | | | | | | | According to comment in iwl_bg_scan_completed, setting tx power should be deferred during pending scan, but we are not doing this. This patch change code to really defer setting tx power after scan complete. Additionally refactor iwl_set_tx_power code and call lib->send_tx_power() directly from iwlagn_commit_rxon. 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>
* iwlagn: check beacon frame sizeJohannes Berg2010-10-14
| | | | | | | | | | | When the beacon_skb is NULL, we might still attempt to use it in this code path (if we ever get here) -- make the code a bit more defensive and check the return value of iwl_fill_beacon_frame() against zero. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
* iwlwifi: clean up some beacon handlingJohannes Berg2010-10-14
| | | | | | | | | | | | | | | | | | There's no need to check for NULL before calling dev_kfree_skb() since it is valid to call it on NULL -- it becomes a no-op. There's also no need to initialise the beacon_skb variable to NULL just after the memory it is in has been kzalloc'ed. Some minor whitespace cleanups, and a lock assertion in a function that needs the mutex (to access the beacon_skb var) complete the patch. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
* iwlwifi: rename ibss_beacon variableJohannes Berg2010-10-14
| | | | | | | | | Since we're also going to support AP (GO) mode, the variable isn't used for just IBSS beacons any more -- rename it to not mislead readers. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
* iwlagn: prio_tbl need to download before calibrationWey-Yi Guy2010-10-12
| | | | | | | For WiFi/BT combo devices, priority table always need to download before perform any calibration operation. Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
* iiwlagn: always download priority tableWey-Yi Guy2010-10-12
| | | | | | | For advance BT/WiFi co-exist, always download bt priority table before sending bt_config command Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
* iwlagn: fix default calibration table sizeShanyu Zhao2010-10-07
| | | | | | | | | | | | | | | | | | | | | iwlagn driver uses the IWL_MAX_STANDARD_PHY_CALIBRATE_TBL_SIZE as the chain noise reset calibration index and IWL_MAX_STANDARD_PHY_CALIBRATE_TBL_SIZE+1 as the chain noise gain calibration index, if not specified by the TLV value in the new firmware format. However, this is broken if we need to add more calibrations like the temperature offset calibration because we increased IWL_MAX_STANDARD_PHY_CALIBRATE_TBL_SIZE by 1. To fix this issue, define IWL_DEFAULT_STANDARD_PHY_CALIBRATE_TBL_SIZE and use it as the calibration index instead. We still keep the IWL_MAX_STANDARD_PHY_CALIBRATE_TBL_SIZE as a sanity check for the TLV value given by ucode. 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>
* iwlagn: no version check for experimental uCodeWey-Yi Guy2010-10-07
| | | | | | | | For experimental uCode, it should work with the driver if driver has experimental uCode support option enabled; remove the API version checking. Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
* iwlwifi: clean up declarationsJohannes Berg2010-10-07
| | | | | | | | | | 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>
* iwlwifi: remove apm_ops.stopJohannes Berg2010-10-07
| | | | | | | | Since all devices share the same operation here, there's no need to call it indirectly. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
* iwlwifi: remove set_pwr_src operationJohannes Berg2010-10-07
| | | | | | | | | | | | | 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>
* iwlwifi: move agn specific station code thereJohannes Berg2010-10-07
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* iwlagn: rename iwl_commit_rxonJohannes Berg2010-10-07
| | | | | | | | iwl_commit_rxon really should be named iwlagn_commit_rxon, so rename it. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
* iwlagn: define 130 series of WiFi/BT combo devicesWey-Yi Guy2010-10-06
| | | | | | add new structures and defines need to identify 130 devices. Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
* iwlagn: reduce redundant parameter definitionsWey-Yi Guy2010-10-06
| | | | | | | | | | | | | 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>
* iwlwifi: schedule to deprecate software scan supportWey-Yi Guy2010-10-06
| | | | | | | | Hardware scan is the prefer method for all iwlwifi devices; especially for dual-mode functions. Schedule to deprecate the software scan support in kernel 2.6.40 Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
* iwlwifi: send DC calib config to runtime ucodeShanyu Zhao2010-09-28
| | | | | | | | | | | | | | | Since uCode is responsible for doing DC calibration, there's no need to let init uCode to do initial DC calibration then send results back to driver, then driver sends the results to runtime uCode. Driver can simply tell runtime uCode to do DC calibration. Actually, this patch does not disable DC calib for init uCode. It just prevent driver from saving and sending the DC calib results (from init ucode) to runtime uCode. The driver still uses 0xffffffff in CALIB_CFG_CMD for init ucode. Signed-off-by: Shanyu Zhao <shanyu.zhao@intel.com> Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
* iwlwifi: define 100 devicesJay Sternberg2010-09-28
| | | | | | | add new structures and defines need to identify 100 devices. Signed-off-by: Jay Sternberg <jay.e.sternberg@intel.com> Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
* iwlwifi: do not force complete scan too earlyStanislaw Gruszka2010-09-14
| | | | | | | | | | | | Currently we force scan complete at the end of iwl_scan_cancel_timeout function. This cause race condition when we can get a new scan request from mac80211 and complete it by iwl_bg_complete from older scan. Change code to force scan complete only when really needed: device goes down, interface is removed or scan timeout occurs. 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>
* iwlwifi: cancel scan when down the deviceStanislaw Gruszka2010-09-14
| | | | | | | | | | | | | | | | | Always cancel scan when stooping device and scan is currently pending, we should newer have scan running after down device. To assure we start scan cancel from restart work we have to schedule abort_scan to different workqueue than priv->workqueue. Patch fix not cancel scanning when restarting firmware, what is one of the causes of wdev_cleanup_work warning (together with permanent network connection lost) reported at https://bugzilla.redhat.com/show_bug.cgi?id=593566 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>
* iwlwifi: make sure runtime calibration is enabled after associationWey-Yi Guy2010-09-11
| | | | | | | | | Clear the "start calib" flag only for new association, The flag will be set in post_associate function to trigger the runtime calibration. Set this flag to "0" will stop the runtime sensitivity calibration Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
* iwlwifi: avoid sending too many commandsJohannes Berg2010-09-11
| | | | | | | | | | | | When the PAN context is unused, there's no need to continually update it in the device. So track which contexts are active (with the special case that the WLAN context is always active ...) and only send their commands to the device when needed. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
* iwlwifi: remember the last uCode sysassert error codeWey-Yi Guy2010-09-11
| | | | | | | | When sysassert happen, uCode will report the error code, driver dump the information to dmesg. Here also remember the last error code for future reference. Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
* drivers/net/wireless/iwlwifi/iwl-agn.c: Fix return value from an unsigned ↵Julia Lawall2010-09-07
| | | | | | | | | | | | | | | | | | | | | | | | | | | | function The function has an unsigned return type, but returns a negative constant to indicate an error condition. Another error condition in the same function is indicated by returning 0, and indeed the only call to the function checks for 0 to detect errors, so the return of a negative value it converted to a return of 0. A sematic match that finds this problem is as follows: (http://coccinelle.lip6.fr/) // <smpl> @exists@ identifier f; constant C; @@ unsigned f(...) { <+... * return -C; ...+> } // </smpl> Signed-off-by: Julia Lawall <julia@diku.dk> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* iwlagn: open/close envlope to force move BT state machineWey-Yi Guy2010-09-03
| | | | | | | | | | | | | | | In uCode, BT state machine need to receive open envlope command before perform calibration; followed by close envlope command to move to next stage. Since Linux has two separated uCode, one for init and the second one for runtime; we use open envlope commands for init uCode to indicate we are ready to perform calibration operation. But for runtime uCode, we are not doing any init calibration, so we issue open/close envlope commands to force uCode move to "BT COEX ON" state. Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
* iwlwifi: allow using multiple contextsJohannes Berg2010-08-27
| | | | | | | | | | | We're now ready to start using multiple contexts. We do this by keeping track of the valid interface types per context (exclusive [ibss] and normal) and checking which context is "free" when a new interface is added. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
* iwlagn: always send RXON timingJohannes Berg2010-08-27
| | | | | | | | | The PAN context requires also getting RXON timing when we send an unassociated RXON in some cases. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
* iwlwifi: pass context to iwl_send_rxon_timingJohannes Berg2010-08-27
| | | | | | | | | | Sometimes we need to send RXON timing even when we don't have a virtual interface yet, so pass the context and allow passing one without a virtual interface pointer. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
* iwlwifi: send PAN parametersJohannes Berg2010-08-27
| | | | | | | | | | | 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>
* iwlagn: send beacon before committing associated RXONJohannes Berg2010-08-27
| | | | | | | | | Newer AGN microcode requires know the beacon before starting the AP so that it can start beaconing right away. Implement that. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
* iwlagn: send RXON timing before associatingJohannes Berg2010-08-27
| | | | | | | | | | The PAN functionality requires us to send the timing including a valid DTIM period to the microcode before associating, so request this data from mac80211 and send it to the device. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
* iwlagn: queue frames according to contextJohannes Berg2010-08-27
| | | | | | | | | | | Frames for different contexts need to be put on different queues, and multicast after DTIM frames have a special queue yet which also depends on the context, so put all this into the context. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
* iwlagn: remove iw_mode check for beaconJohannes Berg2010-08-27
| | | | | | | | | | | | Since we have the beacon context now, we no longer need to rely on iw_mode but can check the beacon context interface's type. However, that check must be in the work item instead due to locking constraints (mutex must be held when dereferencing beacon_ctx pointer). Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
* iwlagn: detect PAN capabilityJohannes Berg2010-08-27
| | | | | | | | | | Detect whether or not the ucode is PAN capable and adjust the valid contexts accordingly. To be able to do this, add the PAN context to the array as well. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
* iwlwifi: introduce beacon contextJohannes Berg2010-08-27
| | | | | | | | | Only one context can be beaconing at a time, but we need to track which one. Introduce a new variable priv->beacon_ctx to do that. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
* iwlwifi: move HT configuration data into contextJohannes Berg2010-08-27
| | | | | | | | | | A lot of HT configuration semantically belongs into the context, even if right now it will never be different between contexts. Move it so we're better prepared for future changes in mac80211. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
* iwlwifi: add context pointer to stationJohannes Berg2010-08-27
| | | | | | | | | Sometimes we only pass around station pointers but need to find the context they belong to, so store it in there. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
* iwlwifi: make hw crypto context awareJohannes Berg2010-08-27
| | | | | | | | | | HW crypto needs to be aware of the context, and there are different command IDs for the WEP keys per context, so move the key tracking variables and command IDs 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>
* iwlwifi: move AP sta ID to contextJohannes Berg2010-08-27
| | | | | | | | | Each context needs to use a different AP sta ID, so we need to move that into the context struct instead of hardcoding it. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
* iwlwifi: move virtual interface pointer into contextJohannes Berg2010-08-27
| | | | | | | | | | 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>
* iwlwifi: move QoS into contextJohannes Berg2010-08-27
| | | | | | | | | | Since mac80211 doesn't currently enable/disable QoS per interface, we can't yet do it properly, but we can already prepare for it and move the QoS data and command ID into the context struct. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
* iwlwifi: contextify command sendingJohannes Berg2010-08-27
| | | | | | | | | | Some commands will have different command IDs for different contexts, so we need to store those IDs in the context structure and use them instead of hardcoding the commands. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
* iwlwifi: contextify-stations-completelyJohannes Berg2010-08-27
| | | | | | | | | | The microcode tracks stations per context, so the driver needs to do that as well for adding, deleting and restoring them, especially in the implicit removal case when we send an RXON. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
* iwlwifi: contextify broadcast stationJohannes Berg2010-08-27
| | | | | | | | | 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>
* iwlwifi: define PAN queues/FIFOsJohannes Berg2010-08-27
| | | | | | | | | | PAN capable microcode has a different queue assignment (not just more queues for PAN) due to the way multicast is handled for AP mode. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>