summaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/intel/iwlwifi/mvm
Commit message (Collapse)AuthorAgeFilesLines
* iwlwifi: mvm: avoid unnecessary cache trashing in Tx pathEmmanuel Grumbach2017-06-221-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | When sending a Tx Command with a Tx packet, we allocate the Tx command separately from the payload of the packet. The WiFi MAC header is then copied into the buffer that was allocated for the Tx Command. This means that this buffer needs to be big enough to contain both. This is why it is allocated with iwl_trans_alloc_tx_cmd which returns a pointer to a newly allocated not zeroed struct iwl_device_cmd. The Tx command has a few bit fields and hence it needs to be zeroed, but all the rest of the buffer doesn't need to be zeroed since it will either be memcopy'ed with the MAC header, or not even sent to the device. This means that we don't need to zero all the iwl_device_cmd structure, but rather only the size of the iwl_tx_cmd structure. Since sizeof(iwl_tx_cmd) - sizeof(iwl_tx_cmd) is about 260 bytes, this can avoid touching 4 cache lines for each packet. Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
* iwlwifi: mvm: Enable security on new TX APIDavid Spinadel2017-06-222-40/+80
| | | | | | | | | | | Install GTKs on AP side for new TX API. Don't add IV space, it's added by the HW. While at that fix GCMP abnd GCMP-256 GTK installation which work similarly to the new TX API. Signed-off-by: David Spinadel <david.spinadel@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
* iwlwifi: mvm: disable dbg data collect when fw isn't aliveLiad Kaufman2017-06-221-0/+4
| | | | | | | | | | If FW isn't alive, trying to collect debug data will result in errors both in driver and in the collected data, so just warn and leave the collecting function in this case. Signed-off-by: Liad Kaufman <liad.kaufman@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
* iwlwifi: remove resp_pkt NULL checksJohannes Berg2017-06-224-24/+0Star
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Contrary to what some of the comments say, if rfkill was asserted the transport will return -ERFKILL instead of success, if CMD_WANT_SKB was set, so it's not necessary to check cmd.resp_pkt for being NULL if the return code was success. Validate that this is true in iwl_trans_send_cmd(). Most of the other code modifications were done with the following spatch: @@ struct iwl_host_cmd cmd; identifier pkt; @@ <... ( pkt = cmd.resp_pkt; ... -if (!pkt) { ... } | pkt = cmd.resp_pkt; ... -if (WARN_ON(!pkt)) { ... } | -if (!cmd.resp_pkt) { ... } ) ...> Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
* iwlwifi: mvm: remove txq EMPTYING_DELBA state for DQALiad Kaufman2017-06-221-2/+7
| | | | | | | | | In DQA mode, there is no need to wait for the TXQ to clear out after getting a DELBA, since traffic can continue running on the queue. Signed-off-by: Liad Kaufman <liad.kaufman@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
* Merge tag 'iwlwifi-next-for-kalle-2017-06-06' of ↵Kalle Valo2017-06-1231-357/+1131
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/iwlwifi/iwlwifi-next First batch of iwlwifi driver patches 4.13 * Loads of FW API documentation improvements (for tools and htmldoc); * Continued work for the new A000 family; * Bumped the maximum supported FW API to 31; * Improve the differentiation between 8000, 9000 and A000 families; * A lot of fixes and cleanups here and there; kvalo: There were conflicts iwl_mvm_stop_device() and iwl_mvm_tcool_set_cur_state(). The former was easy but latter needed more thought. Apparently the mutex was taken too late, so I fixed so that the mutex is taken first and then check for iwl_mvm_firmware_running().
| * iwlwifi: fw-api: cleanup cycle includesMordechai Goodstein2017-06-052-4/+0Star
| | | | | | | | | | | | | | | | The include in the deleted file are included in the fw-api.h file. Which caused a cycle include in the dependencies. Signed-off-by: Mordechai Goodstein <mordechay.goodstein@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
| * iwlwifi: mvm: remove SCAN_GROUPJohannes Berg2017-06-051-1/+0Star
| | | | | | | | | | | | | | | | The firmware no longer uses this command group, so remove it from the driver as well. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
| * iwlwifi: mvm: link to TX commands in documentationJohannes Berg2017-06-051-1/+3
| | | | | | | | | | | | | | Link from the TX_CMD enum value to the TX command structs. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
| * iwlwifi: mvm: document structures used for BEACON_TEMPLATE_CMDJohannes Berg2017-06-051-0/+6
| | | | | | | | | | Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
| * iwlwifi: mvm: link queue cmd docs to A000 command structsJohannes Berg2017-06-051-1/+3
| | | | | | | | | | | | | | | | Document which structures are used with the command for the A000 hardware flavour. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
| * iwlwifi: mvm: clear firmware running bit earlierJohannes Berg2017-06-051-0/+11
| | | | | | | | | | | | | | | | | | | | | | | | Clear the firmware running bit before flushing the FW (error) dump work, because otherwise debugfs isn't blocked (previous patch) and can cause a new work to be scheduled, which will then run after we actually shut down the device, wreaking havoc. Clearing it ensures that debugfs can't interfere anymore, and we can safely cancel or flush the work struct. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
| * iwlwifi: mvm: convert ucode_loaded to a status bitJohannes Berg2017-06-052-5/+5
| | | | | | | | | | | | | | | | | | | | Convert ucode_loaded to a status bit called FIRMWARE_RUNNING. This will make it easier to clear this earlier, to avoid any spurious accesses while shutting down, for example through debugfs. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
| * iwlwifi: mvm: add and use iwl_mvm_device_running()Johannes Berg2017-06-054-15/+30
| | | | | | | | | | | | | | This will help refactor this later. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
| * iwlwifi: mvm: use schedule_delayed_work()Johannes Berg2017-06-054-8/+7Star
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There's no need to refer to system_wq directly, use the provided wrapper schedule_delayed_work(). Made with the following spatch: @@ expression E,F; @@ -queue_delayed_work(system_wq, E, F); +schedule_delayed_work(E, F); Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
| * iwlwifi: mvm: check firmware is up in debugfsJohannes Berg2017-06-051-6/+49
| | | | | | | | | | | | | | | | | | | | | | Protect various debugfs files that need to communicate with the firmware from being used when the firmware isn't running. Some will just reject getting written to, while others that store some state will simply store it and not apply it immediately. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
| * iwlwifi: mvm: disable prph collection in a000 hwLiad Kaufman2017-06-051-10/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | Apart from the current list of PRPH that can't be collected in A000 HW, the rest of the debug dump data the driver collects is valid, so there is no need to disable collection only because of this. Disable PRPH collecting in A000 HW, and allow collecting the rest of the debug data. Signed-off-by: Liad Kaufman <liad.kaufman@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
| * iwlwifi: add 9000 and A000 device familiesSara Sharon2017-06-054-11/+13
| | | | | | | | | | | | | | Add two new device families to differentiate them from 8000. Signed-off-by: Sara Sharon <sara.sharon@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
| * iwlwifi: mvm: support init flow debuggingLiad Kaufman2017-06-057-6/+42
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In case an assert happens on init flow, the current driver powers down the NIC, except if iwlmvm modparam init_dbg=1, and only on very specific flows. Extend this capability to cover most failure cases by keeping track of what init configurations have been completed. This way, we can allow NOT powering down the NIC, while making sure that when the driver is removed we don't try to free resources that haven't been allocated. (This can result in a kernel panic.) Signed-off-by: Liad Kaufman <liad.kaufman@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
| * iwlwifi: remove references to 8000 B-step devicesSara Sharon2017-06-052-33/+2Star
| | | | | | | | | | | | | | | | | | | | We don't have any 8000 B-step right now, and there is no firmware loading code for them anyway. Further more, 9000 B-step devices will hit those code paths. Remove code that was introduced only for 8000 B-step. Signed-off-by: Sara Sharon <sara.sharon@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
| * iwlwifi: cleanup references to 8000 family in NVM codeSara Sharon2017-06-052-12/+12
| | | | | | | | | | | | | | | | | | | | NVM code is tightly coupled with 8000 family, while it really refers to extended NVM format introduced back then. Separate it to a configuration dependent boolean, and rename defines accordingly. Signed-off-by: Sara Sharon <sara.sharon@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
| * iwlwifi: mvm: document RX structuresJohannes Berg2017-06-052-5/+84
| | | | | | | | | | | | | | Document the structures used in RX and link them to the command ID. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
| * iwlwifi: mvm: add AMSDU flag to offload assistSara Sharon2017-06-051-1/+7
| | | | | | | | | | | | | | | | Enable offload assist for AMSDU when the AMSDU present flag is set. Fixes: a830baba9c2e ("iwlwifi: mvm: support new TX API") Signed-off-by: Sara Sharon <sara.sharon@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
| * iwlwifi: add wait for tx queue emptySara Sharon2017-06-023-4/+43
| | | | | | | | | | | | | | | | | | | | Now that we have 512 queues, add a wait for single TX queue to gen2. This replaces gen1 wait_tx_queues_empty, which was limited to 32 queues. Signed-off-by: Sara Sharon <sara.sharon@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
| * iwlwifi: mvm: fix many kernel-doc warningsJohannes Berg2017-06-023-20/+46
| | | | | | | | | | | | | | | | Fix many kernel-doc warnings. In one case, this required adding a new enum value to be able to document things properly. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
| * iwlwifi: mvm: remove unused REPLY_MAXJohannes Berg2017-06-021-2/+0Star
| | | | | | | | | | | | | | | | This value is unused, and there's no reason we'd ever use it. Just remove it. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
| * iwlwifi: kernel-doc: make proper linksJohannes Berg2017-06-021-2/+2
| | | | | | | | | | | | | | | | | | Using %enum instead of &enum (and in one case, %struct) results in the wrong parsing. Fix that so that if documentation is generated, the result is clickable links. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
| * iwlwifi: mvm: remove unused TX_CMD_NEXT_FRAME_*Johannes Berg2017-06-021-24/+1Star
| | | | | | | | | | Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
| * iwlwifi: mvm: remove wrt support of page dumps in gen2Liad Kaufman2017-06-021-2/+4
| | | | | | | | | | | | | | | | | | In gen2, page dumping should be done in transport layer, since the addresses needed for the paging mechanism reside there. Signed-off-by: Liad Kaufman <liad.kaufman@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
| * iwlwifi: mvm: document structures used by commandsJohannes Berg2017-06-022-12/+209
| | | | | | | | | | | | | | | | | | Add documentation to a lot of command IDs that links to the appropriate structure(s) used with those IDs. In one case, actually add and use a new struct for that purpose. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
| * iwlwifi: mvm: create/name various enumsJohannes Berg2017-06-023-19/+77
| | | | | | | | | | | | | | | | Some values should be in enums so documentation can refer to them, some values should be named for the same reason. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
| * iwlwifi: mvm: disentangle binding command versionsJohannes Berg2017-06-021-2/+21
| | | | | | | | | | | | | | | | | | The comments/size of the different binding commands get lost in documentation, so introduce two different command structs that can be used there. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
| * iwlwifi: mvm: add documentation links to various fieldsJohannes Berg2017-06-027-32/+45
| | | | | | | | | | | | | | | | Link various fields to the documentation of the enums that define their values. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
| * iwlwifi: mvm: fix some kernel-docJohannes Berg2017-06-026-66/+76
| | | | | | | | | | | | | | | | This mostly fixes missing tags/struct names, but also some other things. Lots of issues remain though. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
| * iwlwifi: mvm: wait for the flushed queue onlySara Sharon2017-06-021-2/+1Star
| | | | | | | | | | | | | | | | | | | | The function flushed only agg queue and no more traffic is queued on it. However, it waits for all queues to empty, which is not necessary and may take more time. Signed-off-by: Sara Sharon <sara.sharon@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
| * iwlwifi: mvm: add documentation to some WoWLAN commandsJohannes Berg2017-06-021-1/+28
| | | | | | | | | | | | | | | | Add some documentation for the WoWLAN commands, also linking the correct enums used. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
| * iwlwifi: mvm: disentangle paging command structsJohannes Berg2017-06-022-15/+33
| | | | | | | | | | | | | | | | | | Instead of using a union and hard-coding the size difference, declare both command structs properly, use a union on the stack to build them and the right sizeof() for the size. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
| * iwlwifi: mvm: use u8 for reserved fieldsJohannes Berg2017-06-022-3/+3
| | | | | | | | | | | | | | | | There's no saying what kind of type a reserved field will get in the future, so use u8 arrays to reserve space. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
| * iwlwifi: mvm: fix MCC endianness bugJohannes Berg2017-06-022-3/+3
| | | | | | | | | | Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
| * iwlwifi: mvm: use proper sta_addr in firmware APIJohannes Berg2017-06-022-5/+3Star
| | | | | | | | | | | | | | | | | | There's no point to declare an address as a __le32/__le16 and then only take a pointer to it anyway, change that to just a sta_addr[ETH_ALEN]. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
| * iwlwifi: mvm: document which group enums are used with which group IDJohannes Berg2017-06-021-3/+24
| | | | | | | | | | | | | | | | | | Make it explicit which command definition enum is supposed to be used with which command group, rather than relying on being able to figure it out by name. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
| * iwlwifi: mvm: fix endianness in lq_cmd declarationJohannes Berg2017-06-021-1/+1
| | | | | | | | | | | | | | | | This member doesn't seem to be used, so this doesn't really fix anything, but it's better to have the right type there. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
| * iwlwifi: mvm: support old method of NVM parsingSara Sharon2017-06-022-1/+10
| | | | | | | | | | | | | | | | Add configuration for allowing driver's nvm parsing and bypassing the new host command, for debugging. Signed-off-by: Sara Sharon <sara.sharon@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
| * iwlwifi: mvm: support getting nvm data from firmwareSara Sharon2017-06-025-19/+188
| | | | | | | | | | | | | | | | This API replaces the complex NVM parsing of the iwlwifi module. Instead, we get all needed data from firmware. Signed-off-by: Sara Sharon <sara.sharon@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
| * iwlwifi: mvm: flush per station for DQA modeSara Sharon2017-06-025-14/+42
| | | | | | | | | | | | | | | | Avoid using the global flush and move to flush per station whenever possible in DQA mode. Signed-off-by: Sara Sharon <sara.sharon@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
* | iwlwifi: mvm: clear new beacon command template structJohannes Berg2017-06-051-1/+1
| | | | | | | | | | | | | | | | Clear the struct so that all reserved fields are zero when we send the struct down to the device. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
* | iwlwifi: mvm: don't fail when removing a key from an inexisting staLuca Coelho2017-06-051-8/+5Star
| | | | | | | | | | | | | | | | | | | | | | | | The iwl_mvm_remove_sta_key() function handles removing a key when the sta doesn't exist anymore. Mistakenly, this was changed to return an error while fixing another bug. If the mvm_sta doesn't exist, we continue normally, but just don't try to remove the igtk key. Fixes: cd4d23c1ea9b ("iwlwifi: mvm: Fix removal of IGTK") Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
* | iwlwifi: mvm: fix firmware debug restart recordingEmmanuel Grumbach2017-06-053-19/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When we want to stop the recording of the firmware debug and restart it later without reloading the firmware we don't need to resend the configuration that comes with host commands. Sending those commands confused the hardware and led to an NMI 0x66. Change the flow as following: * read the relevant registers (DBGC_IN_SAMPLE, DBGC_OUT_CTRL) * clear those registers * wait for the hardware to complete its write to the buffer * get the data * restore the value of those registers (to restart the recording) For early start (where the configuration is already compiled in the firmware), we don't need to set those registers after the firmware has been loaded, but only when we want to restart the recording without having restarted the firmware. Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
* | iwlwifi: tt: move ucode_loaded check under mutexJohannes Berg2017-06-051-3/+5
| | | | | | | | | | | | | | | | | | | | The ucode_loaded check should be under the mutex, since it can otherwise change state after we looked at it and before we got the mutex. Fix that. Fixes: 5c89e7bc557e ("iwlwifi: mvm: add registration to cooling device") Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
* | iwlwifi: mvm: support ibss in dqa modeLiad Kaufman2017-06-051-1/+12
| | | | | | | | | | | | | | | | | | | | Allow working IBSS also when working in DQA mode. This is done by setting it to treat the queues the same as a BSS AP treats the queues. Fixes: 7948b87308a4 ("iwlwifi: mvm: enable dynamic queue allocation mode") Signed-off-by: Liad Kaufman <liad.kaufman@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>