summaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)AuthorFilesLines
2014-02-03iwlwifi: mvm: BT Coex - fix SYNC2SCO flagsEmmanuel Grumbach3-16/+6
The Sync to SCO is a feature that allows to synchronize between the WiFi traffic and the expectable BT traffic when SCO profile is active. We need to set the validity bit in the command in the init flow, and set / clear the enablement bit if we want to enabled / disable the feature. While at it, clean up the flags that are not used in the API. This feature needs to be enabled / disabled easily, so export its enablement to constants.h. Reviewed-by: Eyal Zolotov <eyal.zolotov@intel.com> Reviewed-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2014-02-03iwlwifi: fix kerneldoc formatEmmanuel Grumbach1-1/+1
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2014-02-03iwlwifi: mvm: abort scheduled scan on scan requestJohannes Berg3-3/+31
Some older versions of wpa_supplicant don't necessarily stop scheduled scan before starting a regular scan, and there's nothing in the API that requires it either. As a consequence our driver's behaviour of not allowing scan while scheduled scan was in progress broke userspace. However, it is valid to unilaterally stop scheduled scan at any point in time, so when a regular scan request comes just abort the scheduled scan and run the regular scan. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Reviewed-by: Alexander Bondar <alexander.bondar@intel.com> Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2014-02-03iwlwifi: fix potential buffer overrun in fw nameLiad Kaufman1-2/+3
Fix a potential buffer overrun when creating the fw name in drv->firmware_name by setting a maximal length to the char array copied to it. The maximal length is also updated to 32 rather than 25 to keep both 32bit and 64bit alignment without requiring padding to the struct it is in. Signed-off-by: Liad Kaufman <liad.kaufman@intel.com> Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2014-02-03iwlwifi: mvm: support multiple firmware sectionsEran Harary2-25/+47
Newer devices have two embedded CPUs, and the firwmare for both of them is include in the .ucode file requested upon enumeration. An empty section with address=0xFFFFCCCC separates between the sections intended for cpu1 and the sections intended for cpu2. Update the driver to parse the .ucode file with this format and act accordingly. Signed-off-by: Eran Harary <eran.harary@intel.com> Reviewed-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2014-02-03iwlwifi: mvm: remove unneeded calculationsJohannes Berg1-7/+1
In iwl_mvm_calc_rssi() some values are calculated but then never used, remove the calculations. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2014-02-03iwlwifi: mvm: add debugfs hook to take an mvm refEliad Peller2-2/+32
Support taking an mvm ref (and preventing D0i3) by writing '1' into the d0i3_refs debugfs file. The reference can be unref by writing 0 to the same file. Signed-off-by: Eliad Peller <eliadx.peller@intel.com> Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2014-02-03iwlwifi: mvm: get status on D0i3 exitEliad Peller4-4/+88
Schedule work to query the wakeup reasons, and disconnect in some cases (e.g. beacon loss). Signed-off-by: Eliad Peller <eliadx.peller@intel.com> Reviewed-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2014-02-03iwlwifi: mvm: configure WOWLAN_CONFIGURATION on D0i3 entryEliad Peller2-1/+18
We need to ask the fw to wake up on incoming packets (that pass the filters). Signed-off-by: Eliad Peller <eliadx.peller@intel.com> Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2014-02-03iwlwifi: mvm: add d0i3_refs debugfs fileEliad Peller1-0/+30
Add d0i3_refs debugfs file that prints the currently taken mvm D0i3 refs. Signed-off-by: Eliad Peller <eliadx.peller@intel.com> Reviewed-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2014-02-03iwlwifi: mvm: add D0i3 ref/unref when ap, ibss or p2p_cli vifs are runningEliad Peller2-0/+11
We don't want to go into D0i3, when P2P_CLI, AP (including GO) or IBSS interfaces are running, so take appropriate references. Signed-off-by: Eliad Peller <eliadx.peller@intel.com> Reviewed-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2014-02-03iwlwifi: mvm: add D0i3 ref/unref for ROC commandsEliad Peller2-0/+3
Take a reference when ROC command is started, and unref it on completion. Signed-off-by: Eliad Peller <eliadx.peller@intel.com> Reviewed-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2014-02-03iwlwifi: mvm: add D0i3 ref/unref for scanArik Nemtsov3-3/+13
Take a reference when starting to scan and release it on completion. Note that if the scan is cancelled/aborted, a completion will still be sent up. Signed-off-by: Arik Nemtsov <arikx.nemtsov@intel.com> Signed-off-by: Eliad Peller <eliadx.peller@intel.com> Reviewed-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2014-02-03iwlwifi: mvm: allow transport sleep when FW is operationalEliad Peller4-0/+72
Hold a bitmap of taken references, according to the reference reason (e.g. down, scan). This will allow us validate our state and add some debugfs entries later on. Unref the transport when the FW is fully initialized, allowing it to go into a low power mode. Disallow the transition to low-power while recovery is in progress. Signed-off-by: Arik Nemtsov <arikx.nemtsov@intel.com> Signed-off-by: Eliad Peller <eliadx.peller@intel.com> Reviewed-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2014-02-03iwlwifi: mvm: configure vifs upon D0i3 entry/exitEliad Peller1-1/+50
Upon D0i3 entry/exit, iterate over the active interfaces and configure them appropriately. Signed-off-by: Eliad Peller <eliadx.peller@intel.com> Reviewed-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2014-02-03iwlwifi: mvm: add D0i3 power configurationsEliad Peller5-41/+139
Configure skip-over-dtim and beacon filtering on D0i3 enter/exit. Since the D0i3 entry/exit commands require different command flags (e.g. CMD_HIGH_PRIORITY), add a new parameter to the functions being called, and make the current users pass CMD_SYNC. Signed-off-by: Eliad Peller <eliadx.peller@intel.com> Reviewed-by: Johannes Berg <johannes.berg@intel.com> Reviewed-by: Alexander Bondar <alexander.bondar@intel.com> Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2014-02-03iwlwifi: add very first D0i3 supportArik Nemtsov3-2/+30
When the bus is in D0i3, we can't send regular commands to the firmware. This means that we need to add a state to remember what is our d0i3 state and make sure that only d0i3 exit commands can be sent. Add flags to CMD_ flags and transport status for this purpose. Commands with CMD_HIGH_PRIO set are queued at the head of the command queue, behind other high priority commands. Commands with CMD_SEND_IN_IDLE set can be sent while the transport is idle (without taking rpm reference). Commands with CMD_MAKE_TRANS_IDLE set indicate that command completion should mark the transport as idle (and release the bus). Commands with CMD_WAKE_UP_TRANS set instruct the transport to exit from idle when this command is completed. The transport is marked as idle (STATUS_TRANS_IDLE) when the FW enters D0i3 state. This bit is cleared when it enters D0 state again. Process only commands with CMD_SEND_IN_IDLE flag while the transport is idle. Other enqueued commands will be processed only later, right after exiting D0i3. Signed-off-by: Arik Nemtsov <arik@wizery.com> Signed-off-by: Eliad Peller <eliadx.peller@intel.com> Reviewed-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2014-02-03iwlwifi: add enter/exit D0i3 opsEliad Peller3-0/+42
Add new enter_d0i3 and exit_d0i3 ops that will be called by the transport on D0i3 enter/exit. Each one of these ops will include the host commands mentionned in the previous patch. Signed-off-by: Eliad Peller <eliad@wizery.com> Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2014-02-03iwlwifi: add D0i3 references boiler plateEliad Peller2-0/+21
D0i3 is bus power saving feature. It involves the firmware - the driver needs to send a list of commands to the firmware before entering this state. Wake up from d0i3 also requires a few commands to the firmware. The trigger to enter D0i3 is an idle timeout that will be implemented later and will most probably rely on RUNTIME_PM infrastructure. In order to prevent entrance to D0i3 in critical flows, we implement here a reference infrastructure. When a ref is taken, we can't enter D0i3. PCIe does't support D0i3. Signed-off-by: Eliad Peller <eliad@wizery.com> Signed-off-by: Arik Nemtsov <arik@wizery.com> Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2014-02-03iwlwifi: 7265: add power limit/tx backoff translation tableIdo Yariv1-0/+14
Signed-off-by: Ido Yariv <idox.yariv@intel.com> Reviewed-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2014-02-03iwlwifi: mvm: handle platform PCIe power limitationIdo Yariv5-4/+43
The tx backoff settings used by the thermal throttling mechanism can also be used for enforcing a limit on the power consumption of the module. Handle the platform PCIe power limitation by translating the limit (measured in mw) to its respective tx backoff value. The translation is module specific. The resulting tx backoff value is sent to the ucode, and also serves as the minimal backoff value that can be set by the thermal throttling mechanism. Signed-off-by: Ido Yariv <idox.yariv@intel.com> Reviewed-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2014-02-03iwlwifi: pcie: retrieve and parse ACPI power limitationsIdo Yariv2-0/+81
Some platforms may have power limitations on PCIe cards connected to specific root ports. This information is encoded as part of the ACPI tables, for instance: <snip> Name (SPLX, Package (0x02) { Zero, Package (0x03) { 0x07, 0x00000500, 0x80000000 } }) Method (SPLC, 0, Serialized) { Return (SPLX) } </snip> The structure returned contains the domain type, the default power limitation and the default time window (reserved for future use). Upon PCI probing, call the relevant ACPI method, parse the returned structure, and save the power limitation. Signed-off-by: Ido Yariv <idox.yariv@intel.com> Reviewed-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2014-02-03iwlwifi: mvm: fix quota allocationIlan Peer1-8/+28
Divide the maximal quota between all the data interfaces even in the case of a single low latency binding without any other non low latency interfaces, so that afterwards the quota allocation (which considers the number of data interfaces) will be correct. Signed-off-by: Ilan Peer <ilan.peer@intel.com> Reviewed-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2014-02-03iwlwifi: mvm: add the quota remainder to a data bindingIlan Peer1-2/+7
Currently the quota remainder was added to the first binding, although it is possible that this was not a data binding (only the P2P_DEVICE interface is part of the binding). Fix this by adding the remainder to the first binding that was actually allocated quota. Signed-off-by: Ilan Peer <ilan.peer@intel.com> Reviewed-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2014-02-03iwlwifi: mvm: add vif type in debugfs outputEmmanuel Grumbach1-0/+23
Add the vif type when we print the mac params. Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2014-02-03iwlwifi: rs: use const u16 for throughput tablesJohannes Berg5-37/+36
This makes the code a little bit longer as zero-extension has to be done (mov vs. movzwl), but that's miniscule and the space saving is significant, about 600 bytes in DVM and 700 bytes in MVM, so the cache effect should be worth the few bytes more code. While at it, remove two spurious blank lines in variable declaration blocks. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Reviewed-by: Eyal Shapira <eyal@wizery.com> Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2014-02-03iwlwifi: mvm: allow to force reduced tx power from debugfsEmmanuel Grumbach4-7/+43
This will be useful during tests done on the physical layer. Reviewed-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2014-02-03iwlwifi: mvm: add bcast_filtering debugfs entriesEliad Peller3-14/+250
Allow reading and setting bcast filtering configuration through debugfs. By default, mvm->bcast_filters is used for setting the bcast filtering configuration (these filters will be configured for each associated station). For testing purposes, allow overriding this configuration, and setting the bcast filtering configuration manually. The following debugfs keys can be used: * bcast_filtering/override - use debugfs values instead of default configuration * bcast_filtering/filters - set filters (+ attributes) * bcast_filtering/macs - per-mac bcast filtering configuration (policy + attached filters) Signed-off-by: Eliad Peller <eliadx.peller@intel.com> Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2014-02-03iwlwifi: mvm: add dest ip to bcast filter configurationEliad Peller1-0/+73
Add our ip as a new attribute to the bcast filtering configuration (i.e. check the dest ip field of the arp request). Add bcast filter to pass incoming dhcp offer broadcast frames as well (for sta vifs). In order to support such dynamic configuration, use the reserved1 field as a bitmap for driver internal flags (which will indicate we want to configure the ip in this attribute), and reconfigure the bcast filtering on BSS_CHANGED_ARP_FILTER indication. Signed-off-by: Eliad Peller <eliadx.peller@intel.com> Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2014-02-03iwlwifi: mvm: add predefined broadcast filter configurationEliad Peller1-0/+27
Configure arp request broadcast filter if this option is enabled, in order to allow only arp request broadcasts to pass-in. (A following patch will make this filter even narrower by limiting the arp request to our own ip) Signed-off-by: Eliad Peller <eliadx.peller@intel.com> Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2014-02-03iwlwifi: mvm: add basic bcast filtering implementationEliad Peller6-0/+222
Broadcast filtering allows dropping broadcast frames that don't match the configured patterns. Use predefined filters, and configure them for each associated station vif. There is no need to optimize and attach the same filter to multiple vifs, as a following patch will configure each filter to have per-vif unique values. Configure the bcast filtering on assoc changes. Add a new IWLWIFI_BCAST_FILTERING Kconfig option in order to enable broadcast filtering. Signed-off-by: Eliad Peller <eliadx.peller@intel.com> Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2014-02-03iwlwifi: mvm: change the format of the SRAM dumpEmmanuel Grumbach1-2/+8
As a debug tool, we dump the SRAM from the device when an error occurs. The main users of this want it in a different format, so change the format to suit their needs. Also - add a short delay between the prints to make sure that the user space logger can catch up. This happens only when the firmware asserts, and only when fw_restart is set to 0 which is typically a testing configuration. Reviewed-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2014-02-03iwlwifi: mvm: BT Coex - change SMPS settings in AP modeEmmanuel Grumbach2-32/+60
Based on the Bluetooth activity grading, we can stop using the shared antenna and ask the stations to honor the new SMPS state. Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2014-02-03iwlwifi: mvm: BT Coex - set low latency vif as primaryEmmanuel Grumbach2-5/+27
If a vif is in low latency mode, it should be in primary channel. Also tell BT Coex about the change when a vif enters or exits low latency mode. Reviewed-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2014-02-03iwlwifi: mvm: limit non-low-latency binding scheduling durationJohannes Berg2-7/+28
Limit the scheduling duration of bindings without a low-latency interface in the firmware, this prevents those bindings from occupying the medium for a period of time longer than what we want for the other interfaces in low-latency mode. As older firmware doesn't do anything with the max_duration field and ignores it completely, there's no need for a firmware flag. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2014-02-03iwlwifi: mvm: reserve bandwidth for low-latency interfaceJohannes Berg2-14/+50
If there is/are interface(s) in low-latency mode, reserve a percentage (currently 64%) of the quota for that binding to improve the quality of service for those interfaces. However, if there's more than one binding that has low-latency, then give up and don't reserve, we can't allocate more than 100%. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2014-02-03iwlwifi: mvm: disable powersave in low-latencyJohannes Berg2-2/+7
While an interface is in low-latency mode, for now powersave should be disabled for it, so take low-latency into account in the powersave code and force powersave recalculation when low-latency mode changes. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2014-02-03iwlwifi: mvm: add low-latency frameworkJohannes Berg3-1/+74
For various traffic use cases, we want to be able to treat multi- channel scenarios differently. Introduce a low-latency framework that currently only has a debugfs file to enable low-latency mode, but can later be extended. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2014-02-03iwlwifi: mvm: notify scan completed even if no fw_restartDavid Spinadel2-21/+24
Notify scan completed if fw_restart flow isn't going to be run. Otherwise, the scan will stay stack forever and mac80211 will not be able to remove the interface. Signed-off-by: David Spinadel <david.spinadel@intel.com> Reviewed-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2014-02-03iwlwifi: mvm: don't stop sched scan in restartDavid Spinadel1-1/+1
Don't stop scheduled scan before reporting HW restart; mac80211 was changed to reschedule it after reconfigure. Signed-off-by: David Spinadel <david.spinadel@intel.com> Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2014-02-03iwlwifi: pcie: fix unused variable gcc warningEmmanuel Grumbach1-2/+1
In iwl_pcie_int_cause_non_ict, trans_pcie is used for lockdep purposes only. Since this might not be enabled, trans_pcie finds itself without user leading to a complaint from gcc. Avoid using trans_pcie by inlining IWL_TRANS_GET_PCIE_TRANS. Reviewed-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2014-02-03iwlwifi: mvm: check ARRAY_SIZE(mvm->fw_id_to_mac_id) = IWL_MVM_STATION_COUNTEmmanuel Grumbach1-0/+7
Since we use IWL_MVM_STATION_COUNT all over the driver, we need to make sure that it is the right constant to look at. Reviewed-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2014-02-03iwlwifi: mvm: provide helper to fetch the iwl_mvm_sta from sta_idEmmanuel Grumbach3-18/+25
We somtimes need to fetch the iwl_mvm_sta structure from a station index - provide a helper to do that. Reviewed-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2014-02-03iwlwifi: remove obsolete TODOEmmanuel Grumbach1-5/+1
The calib_version is 255 and this is perfectly fine - no need to leave a TODO there. Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2014-02-03iwlwifi: 7000: warn about old firmwareEmmanuel Grumbach1-2/+2
iwlwifi-7260-8.ucode has been release. Warn if it is not on the file system. iwlwifi-7260-7.ucode is still supported for another kernel version. Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2014-02-03iwlwifi: pcie: make FH debugfs file code easier to understandJohannes Berg1-9/+8
The code seems fine, as buf won't be assigned when an error is returned, but checking for the error first is easier to understand. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2014-02-03iwlwifi: pcie: fix secure section / dual cpu firmware loadingEran Harary5-120/+159
Also handle the bypass mode in which the second CPU doesn't interfere. Signed-off-by: Eran Harary <eran.harary@intel.com> Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2014-02-03iwlwifi: pcie: Disable L0S exit timer for 8000 HW familyEran Harary1-2/+3
This configuration is invalid for this family. Signed-off-by: Eran Harary <eran.harary@intel.com> Reviewed-by: Dor Shaish <dor.shaish@intel.com> Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2014-02-03iwlwifi: pcie: change CSR reset in family 8000Eran Harary2-0/+13
This register is not present in 8000 family devices. There is prph register instead. Signed-off-by: Eran Harary <eran.harary@intel.com> Reviewed-by: Dor Shaish <dor.shaish@intel.com> Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2014-02-03iwlwifi: pcie: disable APMG configurations for family 8000Eran Harary3-16/+23
APMG HW block was removed in this NIC, hence, no need to configure it. Signed-off-by: Eran Harary <eran.harary@intel.com> Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>