summaryrefslogtreecommitdiff
path: root/drivers/net/wireless/iwlwifi/iwl-agn.c
AgeCommit message (Collapse)Author
2011-08-08iwlagn: support new P2P implementationJohannes Berg
The previous P2P implementation turned out to not work well and new uCode capabilities were added to support P2P. Modify the driver to take advantage of those, and also discover P2P support automatically based on a uCode flag instead of having a Kconfig symbol for P2P. 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-08-08iwlagn: move context init after firmware loadingJohannes Berg
The availability of contexts depends on the firmware capabilities. Currently only the presence of the second context depends on it, but soon P2P support will also be different. Move the context initialisation code to the firmware-dependent setup before registering with mac80211 to make it easier to handle. 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-08-08iwlagn: separate firmware version warningJohannes Berg
We sometimes need to support new firmware API for a while before we can publish them since testing them fully takes a long time. We could keep all the new code private, but that causes plenty of problems and sometimes we can give a pre-release version of firmware to people who need to test. However, when we just bump the API version, the driver will warn everybody that their firmware is outdated, when in fact it isn't. (Currently our case for this doesn't really change the API but bumping the API version is necessary because the firmware isn't fully backward compatible) In order to handle this in the future, add a new "api_ok" version; only below this will the driver warn that the uCode is too old. 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-08-08iwlagn: remove wireless extensions inclusionsJohannes Berg
linux/wireless.h and net/iw_handler.h headers are for wireless extensions only, so mac80211 drivers shouldn't be including them. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-07-24iwlwifi: Fix build with CONFIG_PM disabled.David S. Miller
Signed-off-by: David S. Miller <davem@davemloft.net>
2011-07-21iwlagn: probe would crash with DEBUG_SHIRQEmmanuel Grumbach
This is since my patch: iwlagn: introduce transport layer and implement rx_init The IRQ is requested before the locks are initialized, hence the crash. Initialize the tasklet before we request the IRQ on the way. Reported-by: Johannes Berg <johannes.berg@intel.com> Tested-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com> Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2011-07-21iwlagn: implement WoWLANJohannes Berg
Implement WoWLAN support in iwlagn. The device supports a number of wakeup triggers and can do GTK rekeying when asleep (if HW crypto is used). Unfortunately, we need to disconnect from the AP after resume since we can't yet get all the info out of the wowlan uCode to stay connected safely. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2011-07-21iwlagn: rewrite HW cryptoJohannes Berg
As I just discovered while doing WoWLAN, HW crypto is done wrong for GTKs: they should be programmed for the AP station ID (in the managed mode case) and the HW can actually deal with multiple group keys per station as well (which is useful in IBSS RSN but that I've chosen not to use this). To fix all this, modify the way keys are sent to the device and key offsets are allocated. After these changes, key offsets are stored into the hw_key_idx which we can then track for the key lifetime, not relying on our sta_cmd array. WEP default keys get special treatment, of course. Additionally, since I had the API for it, we can now pre-fill TKIP phase 1 keys for RX now that we can obtain the P1K from mac80211, a capability I had added for WoWLAN initially. Finally, some keys simply don't need to be added into the device's key cache -- a key that won't be used for RX is only needed in the TX header, so "pretend" to have accepted any key without adding it into the device -- no need to use up key space there for it. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2011-07-21iwlagn: remove un-necessary "_agn"Wey-Yi Guy
After driver split, extra _agn in priv structure is no needed, remove it. Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2011-07-21iwlagn: iwl_bus holds drv_data as void * instead of iwl_privEmmanuel Grumbach
The price to pay is the access to the log system. Therefore logs from bus layer are sent by dev_printk instead of IWL_XXXX. Rename bus->priv to bus->drv_data to make the separation even clearer. Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com> Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2011-07-21iwlagn: simplify the bus architectureEmmanuel Grumbach
Call iwl_probe with a ready iwl_bus struct. This means that the bus layer assigns the irq, dev and iwl_bus_ops pointers to iwl_bus before giving it to iwl_probe. The device specific struct is allocated together with the common iwl_bus struct by the bus specific layer. The pointer to the aggregate struct is passed to the upper layer that holds a pointer to iwl_bus instead of an embedded iw_bus. The private data given to the PCI subsystem is now iwl_bus and not iwl_priv. Provide bus_* inliners on the way in order to simplify the syntax. Rename iwl-pci.h -> iwl-bus.h since it is bus agnostic and represent the external of the bus layer. Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com> Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2011-07-21iwlagn: transport layer receives struct iwl_trans*Emmanuel Grumbach
It still holds a pointer to iwl_priv. But hopefully this will disappear at some point. Also add the multiple inclusion protection to iwl-trans.h that was forgotten. Move iwl-trans structures to iwl-trans.h Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com> Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2011-07-21iwlagn: move iwl_prepare_card_hw to the transport layerEmmanuel Grumbach
This function is really related to the transport layer - move it. Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com> Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2011-07-21iwlagn: move more functions from the start flow to the transport layerEmmanuel Grumbach
Basically all the nic_init flow should be in the transport layer. iwl_prepare_card_hw will move to the transport too in a separate patch. Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com> Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2011-07-21iwlagn: SCD configuration for AMPDU moves to transport layerEmmanuel Grumbach
All the configurations of the HW for AMPDU are now in the transport layer. Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com> Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2011-07-21iwlagn: kill iwlagn_setup_deferred_workEmmanuel Grumbach
Since iwlagn_setup_deferred_work is always called, fold it into iwl_setup_deferred_work. BT related works are setup by the new bt_setup_deferred_work lib_ops. Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com> Signed-off-by: Wey-Yi Guy <wey-yi.guy@intel.com>
2011-07-16iwlagn: move all the ICT related functions to iwl-trans-rx-pcie.cEmmanuel Grumbach
Since the ICT is transport related, move all its functions to the transport layer. Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com> Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2011-07-16iwlagn: move iwlagn_stop_device to transport layerEmmanuel Grumbach
Since iwlagn_stop_device was the only caller to the rx_stop / tx_stop, these two don't need to be API any more. Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com> Signed-off-by: Wey-Yi Guy <wey-yi.guy@intel.com>
2011-07-16iwlagn: move rx transport functions to iwl-trans-rx-pcie.cEmmanuel Grumbach
Also create a new file: iwl-trans-int-pcie.h which will include the non static functions that are shared among the current pcie transport layer. Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com> Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2011-07-16iwlagn: remove indirection for iwlagn_hw_valid_rtc_data_addrFry, Donald H
Not needed since the driver split. Signed-off-by: Don Fry <donald.h.fry@intel.com> Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2011-07-16iwlagn: remove dual-indirect call to simply the codeWey-Yi Guy
After driver split, no need to make the code so complex Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2011-07-16iwlagn: remove un-necessary fileWey-Yi Guy
Most of the functions in iwl-agn-hcmd are move to other files, no point to keep the file anymore. Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2011-07-16iwlagn: move the Rx dispatching to the upper layerEmmanuel Grumbach
The upper layer receives a pointer to an iwl_rx_mem_buffer. I would prefer the upper layer to receive a pointer to an iwl_rx_packet, but this is impossible since the Rx path needs to add the address of the page to the skb. I may find a solution later. All the pre_rx_handler and notification code has been moved to the upper layer. Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com> Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2011-07-16iwlagn: move sync_irq to transport layerEmmanuel Grumbach
Since all the irq / tasklet is now handled in the transport layer, it should give an API to ensure that all the irq / tasklet have finished running. This will allow the upper layer to release all its resources. Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com> Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2011-07-16iwlagn: move the tasklet / irq to the transport layerEmmanuel Grumbach
PCIe doesn't provide any ISR registration API, whereas other buses do. Hence, we need to move the tasklet and irq to the transport layer to allow this flexibility. Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com> Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2011-07-13iwlagn: Add missing comma between constant string arrayJoe Perches
Multiple quoted strings are concatenated without comma separators. Make the array const while there. Signed-off-by: Joe Perches <joe@perches.com> Acked-by: Wey-Yi Guy <wey-yi.w.guy@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-07-11iwlagn: declare staticWey-Yi Guy
Declare iwl_mac_rssi_callback as "static" Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-07-11iwlagn: Enable/disable PS poll based on RSSI and BT coex traffic stateMeenakshi Venkataraman
WiFi throughput drops drastically when BT is turned on, BT and WiFi are simultaneously transmitting/receiving traffic. This is particularly true when BT has higher priority over WiFi, and hence the device defers TX frames. The AP assumes that the channel is bad and reduces the data rate, implying longer airtime, which exacerbates the problem further, resulting ultimately in what is popularly called the "death-spiral" phenomenon. The use of PS-poll in such scenarios guarantees a low but consistent throughput. Since the death-spiral phenomenon is observed only when the RSSI is low, use PS-poll only when RSSI is low and disable when high, with a known hysterisis. This feature specifies the high and low thresholds and implements the callbacks registered with mac80211, which will be called when threshold events occur. iwlwifi: dynamic pspoll: optimize rssi monitor code Signed-off-by: Meenakshi Venkataraman <meenakshi.venkataraman@intel.com> Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-07-11iwlagn: provide heplers to access the transport opsEmmanuel Grumbach
This removes the for priv->trans.ops->... Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com> Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-07-11iwlagn: consolidate the API that sends host commands and move to transportEmmanuel Grumbach
Now, there are only two functions to send a host command: * send_cmd that receives a iwl_host_cmd * send_cmd_pdu that builds the iwl_host_cmd itself and received flags The flags CMD_ASYNC / CMD_SYNC / CMD_WANT_SKB are not changed by the API functions. Kill the unused flags CMD_SIZE_NORMAL / CMD_NO_SKB on the way. Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com> Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-07-11iwlagn: add an API to free the TX contextEmmanuel Grumbach
Tx free functions move to the transport layer. Unify the functions that deal with tx queues and cmd queue. Since the CMD queue is not fully allocated, but uses the q->n_bd / q->window trick, the release flow of TX queue and CMD queue was different. iwlagn_txq_free_tfd receives now the index of the TFD to be freed, which allows to unify the release flow for all the queues. Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com> Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-07-01iwlagn: remove hcmd opsWey-Yi Guy
All "agn" devices use the same hcmd functions, no need to call indirectly. remove hcmd_ops Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2011-07-01iwlagn: call bt_coex directllyWey-Yi Guy
Call the 2-wire and advanced bt-coex function directly to avoid mistake Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2011-07-01iwlagn: add rx_free to transport layerEmmanuel Grumbach
The transport layer ness to release all rx ressources. This function is an API for it. Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com> Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2011-07-01iwlagn: introduce transport layer and implement rx_initEmmanuel Grumbach
The transport layer is responsible for all the queues, DMA rings etc... This is the beginning of the separation of all the code that is tighly related to HW design to the aforementioned transport layer. Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com> Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2011-07-01iwlagn: add module parameter to disable stuck queue watchdog timerWey-Yi Guy
Add the parameter to disable stuck queue watchdog timer, different platforms might have different timing. Provide the option to disable the timer to prevent un-necessary firmware reload. Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2011-06-24iwlagn: fill beacon TX rate properlyJohannes Berg
Use the rate that mac80211 requested to fill the uCode TX command for the beacon. Unfortunately, the uCode is (currently?) ignoring it, but now at least fill it properly. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2011-06-18iwlagn: Add power_level module parameterWey-Yi Guy
Add power_level module parameter to set the default power save level. Power save level has range from 1 - 5, default power save level is 1. Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2011-06-18iwlagn: add power_save module parameterWey-Yi Guy
Add power_save module parameter to enable power management if needed Default power management is disabled. Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2011-06-18iwlagn: store the irq number to iwl_bus just like devEmmanuel Grumbach
Since the irq number is just an unsigned int, store it inside iwl_bus instead of calling the get_irq ops every time it is needed. Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com> Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2011-06-18iwlagn: fix misplaced bracketEmmanuel Grumbach
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com> Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2011-06-18iwlagn: waterfall the bus level if prepare card failedEmmanuel Grumbach
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com> Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2011-06-18iwlagn: finally kill the pointer to pci_dev from iwl-dev.hEmmanuel Grumbach
All pci related stuff is in iwl-pci.c. Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com> Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2011-06-18iwlagn: add a get_irq method to iwl_bus_ops and use itEmmanuel Grumbach
In order to remove a few more dereference to priv->pdev that will be killed [Asoon, there is now a method to get the IRQ number. Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com> Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2011-06-18iwlagn: don't read the PCI_REVISION_ID from iwl-agn.cEmmanuel Grumbach
The PCI_REVISION_ID is read and printed in iwl_pci_probe anyway using pr_info Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com> Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2011-06-18iwlagn: don't use the PCI wrappers for DMA operationEmmanuel Grumbach
Get a pointer to the struct device during probe and get the rid of all the PCI specific DMA wrappers. Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com> Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2011-06-18iwlagn: move PCI related operations from probe and remove to PCI layerEmmanuel Grumbach
Since we have now a PCI layer, all the init and deinit code that is PCI related should move to there. Also move the IO functions: read8/read32/write32. They need hw_base which is killed from priv. Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com> Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2011-06-18iwlagn: add get_dev to iwl_bus_opsEmmanuel Grumbach
Bus specific layer must know how to return the struct device* of the device. Implement that as a callback of iwl_bus_ops and use that callback instead of using the priv->pdev pointer which is meant to disappear soon. Since the struct device * is needed in hot path, iwl_bus holds a pointer to it instead of calling get_dev all the time. Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com> Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2011-06-18iwlagn: introduce iwl_bus and iwl_bus_opsEmmanuel Grumbach
iwl_bus will represent a bus, and iwl_bus_ops all the operations that can be done on this bus. For the moment only set_prv_data is implemented. More to come... Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com> Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2011-06-18iwlagn: add a iwl_pci.[ch] files that will contain all PCI specific codeEmmanuel Grumbach
Move some PCI functionality to the new iwl_pci.[ch] files: * the PCI_DEVICE_TABLE * the pci_driver struct definition * the PCI probe / remove functions * the PCI suspend / resume functions All these functions are now split: the trigger comes from the PCI layer which calls to the bus generic code located in the other files. This is the beginning only. There are still a lot of PCI related code needs to be gathered. Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com> Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>