Commit Graph

27361 Commits

Author SHA1 Message Date
Ping-Ke Shih 1d22b17744 rtlwifi: Add bw_update parameter for RA mask update.
- Add new parameter "is_bw_update" to control if current bandwidth setting
  is updated to FW RA.
- After this commit, we keep the same setting as before.
- Later, bandwidth update in watchdog is changed to false for 8822BE.

Signed-off-by: Tsang-Shian Lin <thlin@realtek.com>
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Cc: Yan-Hsuan Chuang <yhchuang@realtek.com>
Cc: Birming Chiu <birming@realtek.com>
Cc: Shaofu <shaofu@realtek.com>
Cc: Steven Ting <steventing@realtek.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2017-10-13 12:43:41 +03:00
Ping-Ke Shih aa59a1e7c6 rtlwifi: Remove BAND_NUM and related fields
These fields are unused, and we will define them in phydm later.

Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Cc: Yan-Hsuan Chuang <yhchuang@realtek.com>
Cc: Birming Chiu <birming@realtek.com>
Cc: Shaofu <shaofu@realtek.com>
Cc: Steven Ting <steventing@realtek.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2017-10-13 12:43:41 +03:00
Ping-Ke Shih 08ab7465f3 rtlwifi: Add RSSI and RF type to wifi.h for phydm
These definition will be used by phydm later.

Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Cc: Yan-Hsuan Chuang <yhchuang@realtek.com>
Cc: Birming Chiu <birming@realtek.com>
Cc: Shaofu <shaofu@realtek.com>
Cc: Steven Ting <steventing@realtek.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2017-10-13 12:43:40 +03:00
Ping-Ke Shih 74451b935c rtlwifi: Add TX/RX throughput statistics in period
The statistic variables use u64 to get higher precision.

Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Cc: Yan-Hsuan Chuang <yhchuang@realtek.com>
Cc: Birming Chiu <birming@realtek.com>
Cc: Shaofu <shaofu@realtek.com>
Cc: Steven Ting <steventing@realtek.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2017-10-13 12:43:40 +03:00
Ping-Ke Shih c1816f1709 rtlwifi: Add rtl_get_hal_edca_param() to generate register's format of EDCA.
Convert from the value of ieee80211_tx_queue_params to Realtek's
register value.

Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Cc: Yan-Hsuan Chuang <yhchuang@realtek.com>
Cc: Birming Chiu <birming@realtek.com>
Cc: Shaofu <shaofu@realtek.com>
Cc: Steven Ting <steventing@realtek.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2017-10-13 12:43:39 +03:00
Ping-Ke Shih cdc9c7a032 rtlwifi: Implement rtl_get_tx_hw_rate to yield correct hw_rate
Originally, we get legacy rate only, so we extend to get HT and VHT rate.

Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Cc: Yan-Hsuan Chuang <yhchuang@realtek.com>
Cc: Birming Chiu <birming@realtek.com>
Cc: Shaofu <shaofu@realtek.com>
Cc: Steven Ting <steventing@realtek.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2017-10-13 12:43:39 +03:00
Ping-Ke Shih 0c07bd7457 rtlwifi: rtl8192ee: Make driver support 64bits DMA.
1. Both 32-bit and 64-bit use the same TX/RX buffer desc layout
2. Extend set_desc() and get_desc() to set and get 64-bit address
3. Remove directive DMA_IS_64BIT
4. Add module parameter to turn on 64-bit dma

Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Cc: Yan-Hsuan Chuang <yhchuang@realtek.com>
Cc: Birming Chiu <birming@realtek.com>
Cc: Shaofu <shaofu@realtek.com>
Cc: Steven Ting <steventing@realtek.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2017-10-13 12:43:38 +03:00
Ping-Ke Shih ecf4000e0d rtlwifi: Remove redundant semicolon in wifi.h.
The semicolon can cause compiler error, if it exists in if...else
statement.

Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Cc: Yan-Hsuan Chuang <yhchuang@realtek.com>
Cc: Birming Chiu <birming@realtek.com>
Cc: Shaofu <shaofu@realtek.com>
Cc: Steven Ting <steventing@realtek.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2017-10-13 12:43:37 +03:00
Ping-Ke Shih f06eb3f9c0 rtlwifi: Fix MAX MPDU of VHT capability
We must choose only one of VHT_CAP among
IEEE80211_VHT_CAP_MAX_MPDU_LENGTH_3895,
IEEE80211_VHT_CAP_MAX_MPDU_LENGTH_7991 and
IEEE80211_VHT_CAP_MAX_MPDU_LENGTH_11454.

Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Cc: Yan-Hsuan Chuang <yhchuang@realtek.com>
Cc: Birming Chiu <birming@realtek.com>
Cc: Shaofu <shaofu@realtek.com>
Cc: Steven Ting <steventing@realtek.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2017-10-13 12:43:37 +03:00
Himanshu Jha 317049204c mwifiex: Use put_unaligned_le32
Use put_unaligned_le32 rather than using byte ordering function and
memcpy which makes code clear.
Also, add the header file where it is declared.

Done using Coccinelle and semantic patch used is :

@ rule1 @
identifier tmp; expression ptr,x; type T;
@@

- tmp = cpu_to_le32(x);

  <+... when != tmp
- memcpy(ptr, (T)&tmp, ...);
+ put_unaligned_le32(x,ptr);
  ...+>

@ depends on rule1 @
type j; identifier tmp;
@@

- j tmp;
  ...when != tmp

Signed-off-by: Himanshu Jha <himanshujha199640@gmail.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2017-10-13 12:39:49 +03:00
Rohit Fule 2d5cc60949 mwifiex: double the size of chan_stats array in adapter
When a user requests scan, driver sends multiple scan requests
to firmware, which might be active or passive. Firmware will
send channel statistics for each channel in the request. This will
be stored in chan_stats array.

Few channels might report hidden SSIDs in passive scan results.
So, once the original scan request is finished, driver issues an
active scan request for all channels which reported hidden SSIDs.
This will cause duplicates in the chan_stats array. At worst,
every channel will have a hidden SSID, in which case the driver
can issue active scan requests for each channel. So the complete
scan statistics size will be twice of existing limit.

At present maximum number of channels returned in scan statistics
is 31(BG) + 14(A) = 45. Clearly there will be an overflow of the
chan_stats array in the above mentioned scenario. To fix this
double the size of chan_stats array.

Signed-off-by: Rohit Fule <rohitf@marvell.com>
Signed-off-by: Mangesh Malusare <mmangesh@marvell.com>
Signed-off-by: Ganapathi Bhat <gbhat@marvell.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2017-10-13 12:39:13 +03:00
Douglas Anderson f0f7c2275f mwifiex: minor cleanups w/ sta_list_spinlock in cfg80211.c
The sta_list_spinlock looks to be used to control locking of the
list. Specifically when someone has the lock they may be allowed
to modify or delete elements of the list.

That implies that we shouldn't access the fields of the elements
returned by mwifiex_get_sta_entry() after we've released the
spinlock. Let's make some small changes so this is true.

It's unlikely that this matters since it looks to be just error
handling, but it's nice to be clean.

Signed-off-by: Douglas Anderson <dianders@chromium.org>
Signed-off-by: Ganapathi Bhat <gbhat@marvell.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2017-10-13 12:38:03 +03:00
Douglas Anderson 40351051d0 mwifiex: kill useless list_empty checks
There's absolutely no reason to check to see if a list is empty
before iterating through it.  It's just like writing code like
this:

if (count != 0) {
  for (i = 0; i < count; i++) {
     ...
  }
}

The loop will already be avoided if "count == 0" so there was no
reason to check.

Signed-off-by: Douglas Anderson <dianders@chromium.org>
Signed-off-by: Ganapathi Bhat <gbhat@marvell.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2017-10-13 12:38:02 +03:00
Kalle Valo 20d879e7f0 First batch of iwlwifi patches for 4.15 (v2)
* Cleanups: - remove an unused value that we read from the NVM;
             - remove link quality measurement code that was never used;
 * One FW command API update;
 * A fix and an addition for PCI devices for the A000 family;
 * Tiny refactor of ref/unref code used by runtime-PM;
 * Some debugging improvements;
 * Implementation of a more flexible way to define command queue sizes;
 * ACPI code refactoring;
 * Some coding-style fixes;
 * Avoid redundant command to the firmware;
 * Add a struct with the format of one FW command;
 * Change an error log to a warning when the FW API is not aligned with
   the driver (important during development);
 * Change a WARN_ON to WARN_ONCE to make it more descriptive and less
   noisy (i.e. no repeated warnings on a firmware triggered error);
 * Dump PCI registers when an error occurs, to make it easier to debug;
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEF3LNfgb2BPWm68smoUecoho8xfoFAlnXdt0ACgkQoUecoho8
 xfq1QQ//c4mVNNi0eqgMtamkQ2VJdy233dlxKwzRyaA8ZymMmrWlbHxpCFWS6Iw8
 246iWR7EHeC749DIotalCb83ixi02GTGqA65/0eB+LxHTf4TzWx0CmAMBvEdWJQA
 X+GfUPQSmOTqASoHNV7dmtGH6P3LHL82OAV5OumVTTdSimwt3gdqTv9R53HitXQn
 br0/IDmx6UEnv7vaymZvVQKarliEdV2IEY59MQLQ/ny7GyTALvu99f/HUlIIvMhk
 TgGQNcN+ozLhYcJ97DhpWLkkXfaM3e+o6rVmx6xeDT3q4DSveDHYLyXDluXnkXl1
 D20bAekeaS46zNmwin8sWtNjpajEElbEWj7pxkJVH+uGRDB9zkqNI9rq35+3BR+u
 uki7E1mPAVxSthxBT58XbTxM5QghaJLMiYwmDTeRFFkgL5HUEC6hYbB4YKroVn26
 56qrIGMyVoWbrlvKUcC5y8ImrbdIzetlhZAWVVqP0Lz2s2KW73xJ4yq+FW1isWTN
 iRuO3GoLqgR8g4WFVT+90C2O8A5NlgAySG3ScayjOPAFG0+OMjuTszEG/mF7xInU
 F9Yetd/Ob6MK2p8fb55daZidu+aqDRFNk4lgDlguSLq5vy+a5DvXNQ7rp898uRuQ
 8lpCK9qOUpMlkApK3JihUi7C2FORn7Q4bncYcv3HZVI3mxRQQnE=
 =wHeE
 -----END PGP SIGNATURE-----

Merge tag 'iwlwifi-next-for-kalle-2017-10-06-2' of git://git.kernel.org/pub/scm/linux/kernel/git/iwlwifi/iwlwifi-next

First batch of iwlwifi patches for 4.15 (v2)

* Cleanups: - remove an unused value that we read from the NVM;
            - remove link quality measurement code that was never used;
* One FW command API update;
* A fix and an addition for PCI devices for the A000 family;
* Tiny refactor of ref/unref code used by runtime-PM;
* Some debugging improvements;
* Implementation of a more flexible way to define command queue sizes;
* ACPI code refactoring;
* Some coding-style fixes;
* Avoid redundant command to the firmware;
* Add a struct with the format of one FW command;
* Change an error log to a warning when the FW API is not aligned with
  the driver (important during development);
* Change a WARN_ON to WARN_ONCE to make it more descriptive and less
  noisy (i.e. no repeated warnings on a firmware triggered error);
* Dump PCI registers when an error occurs, to make it easier to debug;
2017-10-11 11:36:47 +03:00
Karthik Ananthapadmanabha 073a435d55 mwifiex: Random MAC address during scanning
Driver will advertise RANDOM_MAC support only if the device
supports this feature.

Signed-off-by: Karthik Ananthapadmanabha <karthida@marvell.com>
Signed-off-by: Ganapathi Bhat <gbhat@marvell.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2017-10-10 11:21:06 +03:00
Dan Carpenter 64e79426c2 rtlwifi: silence underflow warning
My static checker complains that we have an upper bound but no lower
bound.  I suspect neither are really required but it doesn't hurt to add
a check for negatives.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2017-10-10 11:19:26 +03:00
Andrey Konovalov fc09785de0 p54: don't unregister leds when they are not initialized
ieee80211_register_hw() in p54_register_common() may fail and leds won't
get initialized. Currently p54_unregister_common() doesn't check that and
always calls p54_unregister_leds(). The fix is to check priv->registered
flag before calling p54_unregister_leds().

Found by syzkaller.

INFO: trying to register non-static key.
the code is fine but needs lockdep annotation.
turning off the locking correctness validator.
CPU: 1 PID: 1404 Comm: kworker/1:1 Not tainted
4.14.0-rc1-42251-gebb2c2437d80-dirty #205
Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS Bochs 01/01/2011
Workqueue: usb_hub_wq hub_event
Call Trace:
 __dump_stack lib/dump_stack.c:16
 dump_stack+0x292/0x395 lib/dump_stack.c:52
 register_lock_class+0x6c4/0x1a00 kernel/locking/lockdep.c:769
 __lock_acquire+0x27e/0x4550 kernel/locking/lockdep.c:3385
 lock_acquire+0x259/0x620 kernel/locking/lockdep.c:4002
 flush_work+0xf0/0x8c0 kernel/workqueue.c:2886
 __cancel_work_timer+0x51d/0x870 kernel/workqueue.c:2961
 cancel_delayed_work_sync+0x1f/0x30 kernel/workqueue.c:3081
 p54_unregister_leds+0x6c/0xc0 drivers/net/wireless/intersil/p54/led.c:160
 p54_unregister_common+0x3d/0xb0 drivers/net/wireless/intersil/p54/main.c:856
 p54u_disconnect+0x86/0x120 drivers/net/wireless/intersil/p54/p54usb.c:1073
 usb_unbind_interface+0x21c/0xa90 drivers/usb/core/driver.c:423
 __device_release_driver drivers/base/dd.c:861
 device_release_driver_internal+0x4f4/0x5c0 drivers/base/dd.c:893
 device_release_driver+0x1e/0x30 drivers/base/dd.c:918
 bus_remove_device+0x2f4/0x4b0 drivers/base/bus.c:565
 device_del+0x5c4/0xab0 drivers/base/core.c:1985
 usb_disable_device+0x1e9/0x680 drivers/usb/core/message.c:1170
 usb_disconnect+0x260/0x7a0 drivers/usb/core/hub.c:2124
 hub_port_connect drivers/usb/core/hub.c:4754
 hub_port_connect_change drivers/usb/core/hub.c:5009
 port_event drivers/usb/core/hub.c:5115
 hub_event+0x1318/0x3740 drivers/usb/core/hub.c:5195
 process_one_work+0xc7f/0x1db0 kernel/workqueue.c:2119
 process_scheduled_works kernel/workqueue.c:2179
 worker_thread+0xb2b/0x1850 kernel/workqueue.c:2255
 kthread+0x3a1/0x470 kernel/kthread.c:231
 ret_from_fork+0x2a/0x40 arch/x86/entry/entry_64.S:431

Cc: stable@vger.kernel.org
Signed-off-by: Andrey Konovalov <andreyknvl@google.com>
Acked-by: Christian Lamparter <chunkeey@googlemail.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2017-10-10 11:08:27 +03:00
Luca Coelho f2abcfa6c8 iwlwifi: remove dflt_pwr_limit from the transport
The default power limit read from the SPLC method in ACPI doesn't
have anything to do with the transport and is only used in the opmode,
so we can remove it from the trans.  Additionally, this value is only
user when the opmode is starting, so we don't need to store it
anywhere.

Remove the dflt_pwr_limit element from the trans and move call to
iwl_acpi_get_pwr_limit() call to mvm.

Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2017-10-06 15:22:34 +03:00
Johannes Berg 42fa5e0e32 iwlwifi: mvm: warn on invalid statistics size
Getting the wrong statistics size is a problem, having a warning
will help us catch it quicker during firmware/driver development.
In released firmware/driver versions, we obviously make sure this
won't happen.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2017-10-06 15:22:33 +03:00
Luca Coelho 1184611ee8 iwlwifi: acpi: move code that reads SPLC to acpi
Move most of the set_dflt_pwr_limit() function to acpi.c and make it
return the pwr_limit value instead of setting directly.  Also rename
it to iwl_acpi_get_pwr_limit().

Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2017-10-06 15:22:33 +03:00
Johannes Berg e59a00f488 iwlwifi: fix indentation in a000 family configuration
Fix the double indentation in the configuration structs
for a000 family devices.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2017-10-06 15:22:33 +03:00
Luca Coelho 45f65569e0 iwlwifi: acpi: move function to get mcc into acpi code
The iwl_get_bios_mcc() function was in the iwl-nvm-parse.c file, but
it has nothing to do with the NVM.  Move it to fw/acpi.c and rename it
to iwl_acpi_get_mcc().

Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2017-10-06 15:22:32 +03:00
Luca Coelho d953cdb8ee iwlwifi: acpi: remove a couple of unnecessary ifdefs
Some of the #ifdef CONFIG_ACPI are not needed anymore, so they can be
removed.

Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2017-10-06 15:22:32 +03:00
Luca Coelho ed1a962db7 iwlwifi: acpi: make iwl_get_bios_mcc() use the common acpi functions
The way iwl_get_bios_mcc() gets the WiFi package and checks for its
integrity is almost identical to the new iwl_acpi_get_wifi_pkg()
function.  Instead of having duplicate code, convert it to use the
common code.

Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2017-10-06 15:22:31 +03:00
Luca Coelho 45a5c6f68b iwlwifi: acpi: use iwl_acpi_get_wifi_pkg when reading reading SPLC
Instead of finding the wifi package with its own code, we can reuse
the new iwl_acpi_get_wifi_pkg() function when reading the default
power limit from SPLC.

Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2017-10-06 15:22:30 +03:00
Luca Coelho 2fa388cfeb iwlwifi: acpi: generalize iwl_mvm_sar_find_wifi_pkg()
Move this function to acpi.c, renaming it to iwl_acpi_get_wifi_pkg(),
because it can also be used with other methods (i.e. SPLC and WRDD).

Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2017-10-06 15:22:29 +03:00
Luca Coelho e7a3b8d879 iwlwifi: acpi: move ACPI-related definitions to acpi.h
The ACPI table size definitions were spread around the different files
that used them.  Move them all to a common place.

Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2017-10-06 15:22:29 +03:00
Luca Coelho 1c73acf58b iwlwifi: acpi: move ACPI method definitions to acpi.h
Instead of defining each method where they are used and re-defining
WIFI_DOMAIN in each one of them, move all the definitions to a central
place and define the domain only a single time.

Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2017-10-06 15:22:29 +03:00
Luca Coelho 813df5cef3 iwlwifi: acpi: add common code to read from ACPI
There are many places where the same process of invoking a method from
ACPI is used, causing a lot of duplicate code.  To improve this,
introduce a new function to get an ACPI object by invoking an ACPI
method that can be reused.

Additionally, since this function needs to be called when we only have
the trans, the opmode or the device, introduce a new debug macro that
gets the device as a parameter so it can be used in the new function.

Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2017-10-06 15:22:28 +03:00
Sara Sharon 417795a3f4 iwlwifi: mvm: change warning to warn_once()
In case there is a FW bug where the BAID value in the
metadata is not properly initialized we hit the warning for
every RX packet.
Change it to warn once and add elaborate message.

Signed-off-by: Sara Sharon <sara.sharon@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2017-10-06 15:22:28 +03:00
Rajat Jain a6d24fad00 iwlwifi: pcie: dump registers when HW becomes inaccessible
We conclude the HW became inaccessible when we timeout waiting for
a bit to be set in a memory mapped register (CSR_GP_CNTRL). This
conclusion may not be true because the bit may not get set due to:
- a firmware issue
- a driver issue
- a PCI bus issue
- a platform issue
There are a lot of such reports with really no good debug information
beyond this message to help us.

Add some debug information and attempt to dump the different register
spaces at such a failure:

* Dump some configuration space of device - this will tell us if
something very basic is broken in the PCIe bus (so that configuration
accesses are failing). If this works, the PCIe bus seems OK. If this
does not work, it is definitely an PCIe issue.

* Dump some memory mapped registers - if we're reading some sane'ish
values, this will tell us that the PCIe bus is OK, but may be a firmware
/ driver issue. If this does not work, it may be a PCI configuration
issue or a driver/firmware issue.

* Dump parent and device's AER registers, will give us some straws to
chew on.

This is the sample output:
[   13.082651] ------------[ cut here ]------------
[   13.086791] iwlwifi 0000:01:00.0: iwlwifi transaction failed, dumping registers
[   13.086793] iwlwifi 0000:01:00.0: iwlwifi device config registers:
[   13.086893] iwlwifi 0000:01:00.0: 00000000: 095a8086 00100406 02800059 00000000 00000004 00000000 00000000 00000000
[   13.086895] iwlwifi 0000:01:00.0: 00000020: 00000000 00000000 00000000 50108086 00000000 000000c8 00000000 00000100
[   13.086901] iwlwifi 0000:01:00.0: iwlwifi device memory mapped registers:
[   13.086989] iwlwifi 0000:01:00.0: 00000000: ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff
[   13.086991] iwlwifi 0000:01:00.0: 00000020: ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff
[   13.086999] iwlwifi 0000:01:00.0: iwlwifi device AER capability structure:
[   13.087033] iwlwifi 0000:01:00.0: 00000000: 14010001 00100000 00000000 00462031 00002000 00002000 00000014 40000001
[   13.087034] iwlwifi 0000:01:00.0: 00000020: 0000000f d140000c 00000000
[   13.087036] iwlwifi 0000:01:00.0: iwlwifi parent port (0000:00:1c.0) config registers:
[   13.087074] iwlwifi 0000:00:1c.0: 00000000: 9d108086 00100506 060400f1 00810010 00000000 00000000 00010100 200000f0
[   13.087075] iwlwifi 0000:00:1c.0: 00000020: d140d140 0001fff1 00000000 00000000 00000000 00000040 00000000 0006010b
[   13.087087] ------------[ cut here ]------------
[   13.087095] WARNING: CPU: 0 PID: 1759 at drivers/net/wireless/iwl7000/iwlwifi/pcie/trans.c:2082 iwl_trans_pcie_reclaim+0x1ee4/0x2b9a [iwlwifi]()
[   13.087096] Timeout waiting for hardware access (CSR_GP_CNTRL 0xffffffff)

Signed-off-by: Rajat Jain <rajatja@google.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2017-10-06 15:22:27 +03:00
Christoph Böhmwalder 1e37f79945 iwlwifi: fix minor code style issues
Fixes three trivial issues as reported by checkpatch.pl, namely two
switch/case indentation issues and one alignment issue in a multiline
comment.

Signed-off-by: Christoph Böhmwalder <christoph@boehmwalder.at>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2017-10-06 14:57:23 +03:00
Mordechay Goodstein 5281f5181a iwlwifi: mvm: add marker cmd response struct.
This helps for documentation and clarifies the code by defining the
exact response struct for the marker command.

Signed-off-by: Mordechay Goodstein <mordechay.goodstein@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2017-10-06 14:57:23 +03:00
Johannes Berg aed52a88c0 iwlwifi: fw: api: remove excess enum value documentation
These enum values don't exist, so remove their documentation as well.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2017-10-06 14:57:23 +03:00
Emmanuel Grumbach 7a20bcceed iwlwifi: mvm: don't send identical PHY_CTXT_CMD
When we have an AP which supports HT and a single HT
station is connected, we change the min_width from
NL80211_CHAN_WIDTH_20_NOHT to NL80211_CHAN_WIDTH_20. This
of course has no implication on the channel width but still
sends a command to the firmware.
Remember the last width that was sent and refrain from
sending unnecessary commands to the firmware.

Sending a PHY_CTXT_CMD to the firmware has a cost since it
recalculates the presence on the medium and because of that
it closes the transmit queues for a short while.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2017-10-06 14:57:22 +03:00
Chaya Rachel Ivgi a2ff48af65 iwlwifi: remove redundant reading from NVM file
The driver reads xtal_calib from NVM file, but actually never uses it.
This is only used in dvm driver.

Signed-off-by: Chaya Rachel Ivgi <chaya.rachel.ivgi@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2017-10-06 14:57:22 +03:00
Shahar S Matityahu dd05f9aab4 iwlwifi: pcie: dynamic Tx command queue size
Devices in the A000 family can use a different size for the command queue.
To allow this, make the command queue size configurable and set the size
for A000 devices to 32.

Signed-off-by: Shahar S Matityahu <shahar.s.matityahu@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2017-10-06 14:57:22 +03:00
Ilan Peer b88beaf95a iwlwifi: Add few debug prints to the WRT dump flow
This would enable to better catch timing issues with
cases that WRT dump takes too much time.

Signed-off-by: Ilan Peer <ilan.peer@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2017-10-06 14:57:22 +03:00
Emmanuel Grumbach 528a542aa6 iwlwifi: mvm: support firmware debug trigger on frame reorder timeout
The trigger that collects data when a frame is released
because of the timer of the reordering buffer was not
implemented for 9000 devices.
Fix this.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2017-10-06 14:57:21 +03:00
Emmanuel Grumbach d7b9bb69c9 iwlwifi: mvm: remove support for Link Quality Measurements
This was never used by any product. Remove it.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2017-10-06 14:57:21 +03:00
David Spinadel 72cbb73e8a iwlwifi: mvm: Add new quota command API
New quota command adds a field indicating low latency
direction per quota.

A TLV API bit was added to indicate the new API.

Signed-off-by: David Spinadel <david.spinadel@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2017-10-06 14:57:21 +03:00
Oren Givon d048b36b96 iwlwifi: add a new a000 device
Add a new a000 device with PCI ID (0x2720, 0x0030).

Signed-off-by: Oren Givon <oren.givon@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2017-10-06 14:57:21 +03:00
Oren Givon f7f5873bbd iwlwifi: fix wrong struct for a000 device
The PCI ID (0x2720, 0x0070) was set with the config struct
iwla000_2ax_cfg_hr instead of iwla000_2ac_cfg_hr_cdb.

Fixes: 175b87c692 ("iwlwifi: add the new a000_2ax series")
Signed-off-by: Oren Givon <oren.givon@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2017-10-06 14:57:20 +03:00
Luca Coelho d621d3c733 iwlwifi: trans: move ref/unref code to the common part of the transport
De-inline iwl_trans_ref/unref and move it to common transport code
in preparation for more common code to come to these functions.

Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2017-10-06 14:57:20 +03:00
Liad Kaufman 3669cd3192 iwlwifi: mvm: add dbgfs entry for fw info
Add a dbgfs entry for an easy way during runtime to
check what FW file was loaded, and get some general
FW-related data.

Signed-off-by: Liad Kaufman <liad.kaufman@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2017-10-06 14:57:20 +03:00
Chaya Rachel Ivgi 44fd09dad5 iwlwifi: nvm: set the correct offsets to 3168 series
The driver currently handles two NVM formats,
one for 7000 family and below, and one for 8000 family and above.
The 3168 series uses something in between,
so currently the driver uses incorrect offsets for it.
Fix the incorrect offsets.

Fixes: c4836b056d ("iwlwifi: Add PCI IDs for the new 3168 series")
Signed-off-by: Chaya Rachel Ivgi <chaya.rachel.ivgi@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2017-10-06 13:59:44 +03:00
Johannes Berg d8c73e455d iwlwifi: nvm-parse: unify channel flags printing
The current channel flags printing is very strange and messy,
in LAR we sometimes print the channel number and sometimes the
frequency, in both we print a calculated value (whether ad-hoc
is supported or not) etc.

Unify all this to
 * print the channel number, not the frequency
 * remove the band print (2.4/5.2 GHz, it's obvious)
 * remove the calculated Ad-Hoc print

Doing all of this also gets the length of the string to a max
of 101 characters, which is below the max of 110 for tracing,
and thus avoids the warning that came up on certain channels
with certain flag combinations.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2017-10-06 13:59:44 +03:00
Luca Coelho 1442a9a9f2 iwlwifi: mvm: return -ENODATA when reading the temperature with the FW down
It seems that libsensors treats -EIO as a special non-recoverable
failure when it tries to read the temperature while the firmware is
not running.  To solve that, change the error code to a milder
-ENODATA.

This fixes https://bugzilla.kernel.org/show_bug.cgi?id=196941

Fixes: c221daf219 ("iwlwifi: mvm: add registration to thermal zone")
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2017-10-06 13:59:44 +03:00
Golan Ben Ami 1efc3843a4 iwlwifi: stop dbgc recording before stopping DMA
Today we stop the device and the DMA without stopping the dbgc
recording before. This causes host crashes when the DMA
rate is high.

Stop dbgc recording when clearing the fw debug configuration
to fix this.

Signed-off-by: Golan Ben Ami <golan.ben.ami@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2017-10-06 13:59:44 +03:00
Shaul Triebitz baf41bc35f iwlwifi: mvm: do not print security error in monitor mode
In monitor mode we are not expected to decrypt encrypted
packets (not having the keys).
Hence we are expected to get an unknown rx security status.
Keeping the print in monitor mode causes a print for each
captured packet flooding the dmesg.

Signed-off-by: Shaul Triebitz <shaul.triebitz@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2017-10-06 13:59:44 +03:00
Johannes Berg 753d179ad0 Merge remote-tracking branch 'net-next/master' into mac80211-next
Merging this brings in the timer_setup() change, which allows
me to apply Kees's mac80211 changes for it.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2017-10-06 11:46:55 +02:00
David S. Miller 53954cf8c5 Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
Just simple overlapping changes.

Signed-off-by: David S. Miller <davem@davemloft.net>
2017-10-05 18:19:22 -07:00
Kees Cook 1d27e3e225 timer: Remove expires and data arguments from DEFINE_TIMER
Drop the arguments from the macro and adjust all callers with the
following script:

  perl -pi -e 's/DEFINE_TIMER\((.*), 0, 0\);/DEFINE_TIMER($1);/g;' \
    $(git grep DEFINE_TIMER | cut -d: -f1 | sort -u | grep -v timer.h)

Signed-off-by: Kees Cook <keescook@chromium.org>
Acked-by: Geert Uytterhoeven <geert@linux-m68k.org> # for m68k parts
Acked-by: Guenter Roeck <linux@roeck-us.net> # for watchdog parts
Acked-by: David S. Miller <davem@davemloft.net> # for networking parts
Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Acked-by: Kalle Valo <kvalo@codeaurora.org> # for wireless parts
Acked-by: Arnd Bergmann <arnd@arndb.de>
Cc: linux-mips@linux-mips.org
Cc: Petr Mladek <pmladek@suse.com>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Lai Jiangshan <jiangshanlai@gmail.com>
Cc: Sebastian Reichel <sre@kernel.org>
Cc: Kalle Valo <kvalo@qca.qualcomm.com>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Pavel Machek <pavel@ucw.cz>
Cc: linux1394-devel@lists.sourceforge.net
Cc: Chris Metcalf <cmetcalf@mellanox.com>
Cc: linux-s390@vger.kernel.org
Cc: linux-wireless@vger.kernel.org
Cc: "James E.J. Bottomley" <jejb@linux.vnet.ibm.com>
Cc: Wim Van Sebroeck <wim@iguana.be>
Cc: Michael Ellerman <mpe@ellerman.id.au>
Cc: Ursula Braun <ubraun@linux.vnet.ibm.com>
Cc: Viresh Kumar <viresh.kumar@linaro.org>
Cc: Harish Patil <harish.patil@cavium.com>
Cc: Stephen Boyd <sboyd@codeaurora.org>
Cc: Michael Reed <mdr@sgi.com>
Cc: Manish Chopra <manish.chopra@cavium.com>
Cc: Len Brown <len.brown@intel.com>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: linux-pm@vger.kernel.org
Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
Cc: Tejun Heo <tj@kernel.org>
Cc: Julian Wiedmann <jwi@linux.vnet.ibm.com>
Cc: John Stultz <john.stultz@linaro.org>
Cc: Mark Gross <mark.gross@intel.com>
Cc: linux-watchdog@vger.kernel.org
Cc: linux-scsi@vger.kernel.org
Cc: "Martin K. Petersen" <martin.petersen@oracle.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: "Rafael J. Wysocki" <rjw@rjwysocki.net>
Cc: Oleg Nesterov <oleg@redhat.com>
Cc: Ralf Baechle <ralf@linux-mips.org>
Cc: Stefan Richter <stefanr@s5r6.in-berlin.de>
Cc: Guenter Roeck <linux@roeck-us.net>
Cc: netdev@vger.kernel.org
Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: linuxppc-dev@lists.ozlabs.org
Cc: Sudip Mukherjee <sudipm.mukherjee@gmail.com>
Link: https://lkml.kernel.org/r/1507159627-127660-11-git-send-email-keescook@chromium.org
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
2017-10-05 15:01:20 +02:00
Kees Cook df7e828c1b timer: Remove init_timer_deferrable() in favor of timer_setup()
This refactors the only users of init_timer_deferrable() to use
the new timer_setup() and from_timer(). Removes definition of
init_timer_deferrable().

Signed-off-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Acked-by: David S. Miller <davem@davemloft.net> # for networking parts
Acked-by: Sebastian Reichel <sre@kernel.org> # for drivers/hsi parts
Cc: linux-mips@linux-mips.org
Cc: Petr Mladek <pmladek@suse.com>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Lai Jiangshan <jiangshanlai@gmail.com>
Cc: Oleg Nesterov <oleg@redhat.com>
Cc: Kalle Valo <kvalo@qca.qualcomm.com>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Pavel Machek <pavel@ucw.cz>
Cc: linux1394-devel@lists.sourceforge.net
Cc: Chris Metcalf <cmetcalf@mellanox.com>
Cc: linux-s390@vger.kernel.org
Cc: "James E.J. Bottomley" <jejb@linux.vnet.ibm.com>
Cc: Wim Van Sebroeck <wim@iguana.be>
Cc: Michael Ellerman <mpe@ellerman.id.au>
Cc: Ursula Braun <ubraun@linux.vnet.ibm.com>
Cc: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: Viresh Kumar <viresh.kumar@linaro.org>
Cc: Harish Patil <harish.patil@cavium.com>
Cc: Stephen Boyd <sboyd@codeaurora.org>
Cc: Guenter Roeck <linux@roeck-us.net>
Cc: Manish Chopra <manish.chopra@cavium.com>
Cc: Len Brown <len.brown@intel.com>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: linux-pm@vger.kernel.org
Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
Cc: Tejun Heo <tj@kernel.org>
Cc: Julian Wiedmann <jwi@linux.vnet.ibm.com>
Cc: John Stultz <john.stultz@linaro.org>
Cc: Mark Gross <mark.gross@intel.com>
Cc: "Rafael J. Wysocki" <rjw@rjwysocki.net>
Cc: linux-watchdog@vger.kernel.org
Cc: linux-scsi@vger.kernel.org
Cc: "Martin K. Petersen" <martin.petersen@oracle.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: linux-wireless@vger.kernel.org
Cc: Sebastian Reichel <sre@kernel.org>
Cc: Ralf Baechle <ralf@linux-mips.org>
Cc: Stefan Richter <stefanr@s5r6.in-berlin.de>
Cc: Michael Reed <mdr@sgi.com>
Cc: netdev@vger.kernel.org
Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: linuxppc-dev@lists.ozlabs.org
Cc: Sudip Mukherjee <sudipm.mukherjee@gmail.com>
Link: https://lkml.kernel.org/r/1507159627-127660-6-git-send-email-keescook@chromium.org
2017-10-05 15:01:18 +02:00
Colin Ian King eba0f28473 ath9k: make const array reg_hole_list static, reduces object code size
Don't populate the read-only array reg_hole_list on the stack, instead make
it static.  Makes the object code smaller by over 200 bytes:

Before:
   text	   data	    bss	    dec	    hex	filename
  57518	  15248	      0	  72766	  11c3e	debug.o

After:
   text	   data	    bss	    dec	    hex	filename
  57218	  15344	      0	  72562	  11b72	debug.o

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2017-10-04 12:07:46 +03:00
Kevin Cernekee a7c9acc452 brcmfmac: Delete redundant length check
brcmf_fweh_process_event() sets event->datalen to the
endian-swapped value of event_packet->msg.datalen, which is the
same as emsg.datalen.  This length is already validated in
brcmf_fweh_process_event(), so there is no need to check it
again upon dequeuing the event.

Suggested-by: Arend van Spriel <arend.vanspriel@broadcom.com>
Signed-off-by: Kevin Cernekee <cernekee@chromium.org>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2017-10-02 17:07:00 +03:00
Kevin Cernekee 73f2c8e933 brcmfmac: Avoid possible out-of-bounds read
In brcmf_p2p_notify_rx_mgmt_p2p_probereq(), chanspec is assigned before
the length of rxframe is validated.  This could lead to uninitialized
data being accessed (but not printed).  Since we already have a
perfectly good endian-swapped copy of rxframe->chanspec in ch.chspec,
and ch.chspec is not modified by decchspec(), avoid the extra
assignment and use ch.chspec in the debug print.

Suggested-by: Mattias Nissler <mnissler@chromium.org>
Signed-off-by: Kevin Cernekee <cernekee@chromium.org>
Reviewed-by: Arend van Spriel <arend.vanspriel@broadcom.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2017-10-02 17:07:00 +03:00
Arnd Bergmann c503dd38f8 brcmsmac: make some local variables 'static const' to reduce stack size
With KASAN and a couple of other patches applied, this driver is one
of the few remaining ones that actually use more than 2048 bytes of
kernel stack:

broadcom/brcm80211/brcmsmac/phy/phy_n.c: In function 'wlc_phy_workarounds_nphy_gainctrl':
broadcom/brcm80211/brcmsmac/phy/phy_n.c:16065:1: warning: the frame size of 3264 bytes is larger than 2048 bytes [-Wframe-larger-than=]
broadcom/brcm80211/brcmsmac/phy/phy_n.c: In function 'wlc_phy_workarounds_nphy':
broadcom/brcm80211/brcmsmac/phy/phy_n.c:17138:1: warning: the frame size of 2864 bytes is larger than 2048 bytes [-Wframe-larger-than=]

Here, I'm reducing the stack size by marking as many local variables as
'static const' as I can without changing the actual code.

This is the first of three patches to improve the stack usage in this
driver. It would be good to have this backported to stabl kernels
to get all drivers in 'allmodconfig' below the 2048 byte limit so
we can turn on the frame warning again globally, but I realize that
the patch is larger than the normal limit for stable backports.

The other two patches do not need to be backported.

Cc: <stable@vger.kernel.org>
Acked-by: Arend van Spriel <arend.vanspriel@broadcom.com>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2017-10-02 16:52:55 +03:00
Kevin Cernekee dd2349121b brcmfmac: Add check for short event packets
The length of the data in the received skb is currently passed into
brcmf_fweh_process_event() as packet_len, but this value is not checked.
event_packet should be followed by DATALEN bytes of additional event
data.  Ensure that the received packet actually contains at least
DATALEN bytes of additional data, to avoid copying uninitialized memory
into event->data.

Cc: <stable@vger.kernel.org> # v3.8
Suggested-by: Mattias Nissler <mnissler@chromium.org>
Signed-off-by: Kevin Cernekee <cernekee@chromium.org>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2017-10-02 16:51:21 +03:00
Larry Finger b8b8b16352 rtlwifi: rtl8821ae: Fix connection lost problem
In commit 40b368af4b ("rtlwifi: Fix alignment issues"), the read
of REG_DBI_READ was changed from 16 to 8 bits. For unknown reasonsi
this change results in reduced stability for the wireless connection.
This regression was located using bisection.

Fixes: 40b368af4b ("rtlwifi: Fix alignment issues")
Reported-and-tested-by: James Cameron <quozl@laptop.org>
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Cc: Stable <stable@vger.kernel.org> # 4.11+
Cc: Ping-Ke Shih <pkshih@realtek.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2017-10-02 16:03:38 +03:00
Colin Ian King 96cbe3d638 b43: make const arrays static, reduces object code size
Don't populate const arrays on the stack, instead make them static.
Makes the object code smaller by over 60 bytes:

Before:
   text	   data	    bss	    dec	    hex	filename
  14816	   1296	      0	  16112	   3ef0	b43/phy_ht.o

After:
   text	   data	    bss	    dec	    hex	filename
  14551	   1496	      0	  16047	   3eaf	b43/phy_ht.o

(gcc 6.3.0, x86-64)

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2017-09-25 11:30:20 +03:00
Colin Ian King 9b029e178e iwlegacy: make const array static to shink object code size
Don't populate const array ac_to_fifo on the stack in an inlined
function, instead make it static.  Makes the object code smaller
by over 800 bytes:

   text	   data	    bss	    dec	    hex	filename
 159029	  33154	   1216	 193399	  2f377	4965-mac.o

   text	   data	    bss	    dec	    hex	filename
 158122	  33250	   1216	 192588	  2f04c	4965-mac.o

(gcc version 7.2.0 x86_64)

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Acked-by: Stanislaw Gruszka <sgruszka@redhat.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2017-09-25 11:29:18 +03:00
Igor Mitsyanko 115af85123 qtnfmac: do not report channel changes until wiphy is registered
Wireless device may send "channel changed" event before driver
registered this device with wireless core, which will result in
warnings.
Once device is registered, higher layer will query channel info
manually using .get_channel callback.

Signed-off-by: Igor Mitsyanko <igor.mitsyanko.os@quantenna.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2017-09-25 11:27:18 +03:00
Igor Mitsyanko 6bfe61d697 qtnfmac: remove unused mac::status field
There are no users of this field and it can safely be removed.

Signed-off-by: Igor Mitsyanko <igor.mitsyanko.os@quantenna.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2017-09-25 11:27:17 +03:00
Igor Mitsyanko 9739763310 qtnfmac: do not cache CSA chandef info
It is never used for anything useful, and all logic is handled by
either WiFi card or higher layers.

Signed-off-by: Igor Mitsyanko <igor.mitsyanko.os@quantenna.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2017-09-25 11:27:17 +03:00
Igor Mitsyanko 8c015b9067 qtnfmac: pass VIF info to SendChannel command
Do not assume whether wireless device can or can not handle switching
several interfaces on a single radio to different channels. Device will
handle it itself and will return appropriate error code.

Signed-off-by: Igor Mitsyanko <igor.mitsyanko.os@quantenna.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2017-09-25 11:27:16 +03:00
Igor Mitsyanko 3656ab0fef qtnfmac: let wifi card handle channel switch request to the same chan
No reason to verify channel switch request in driver, it can simply be
forwarded to wireless device. Device can perform required checks and
return appropriate error code, and driver may not even have information
on current operational channel.

Signed-off-by: Igor Mitsyanko <igor.mitsyanko.os@quantenna.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2017-09-25 11:27:15 +03:00
Igor Mitsyanko 96d4eaf20f qtnfmac: do not cache channel info from "connect" command
This makes no sense because real operational channel is choosen based
on AP operation, not on what STA is configured to.

Signed-off-by: Igor Mitsyanko <igor.mitsyanko.os@quantenna.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2017-09-25 11:27:15 +03:00
Igor Mitsyanko 9e5478b608 qtnfmac: retrieve current channel info from EP
Do not try to cache current operational channel info in driver, this
is a potential source of synchronization issues + driver does not
really need that info.

Introduce GET_CHANNEL command and process it appropriately.

Signed-off-by: Igor Mitsyanko <igor.mitsyanko.os@quantenna.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2017-09-25 11:27:14 +03:00
Igor Mitsyanko fac7f9bf14 qtnfmac: make "Channel change" event report full channel info
Specifically, it has to report center frequency, secondary center
frequency (for 80+80) and BW.
Introduce channel definition structure to qlink and modify channel
change event processing function accordingly.

Signed-off-by: Igor Mitsyanko <igor.mitsyanko.os@quantenna.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2017-09-25 11:27:13 +03:00
Igor Mitsyanko 77d6814774 qtnfmac: convert channel width from bitfiled to simple enum
This will allow to use qlink channel width values to specify BW setting
corresponding to enum nl80211_chan_width.
Current user is converted to apply BIT() macro manually to each individual
qlink_channel_width enumeration value.

Signed-off-by: Igor Mitsyanko <igor.mitsyanko.os@quantenna.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2017-09-25 11:27:13 +03:00
Karun Eagalapati 20db073327 rsi: sdio suspend and resume support
SDIO suspend and resume handlers are implemented and verified
that device works after suspend/resume cycle.

Signed-off-by: Karun Eagalapati <karun256@gmail.com>
Signed-off-by: Amitkumar Karwar <amit.karwar@redpinesignals.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2017-09-25 11:26:30 +03:00
Pavani Muthyala 192524a499 rsi: add version information
We will dump information about firmware version, firmware file
name and operating mode during initialization.

Signed-off-by: Pavani Muthyala <pavani.muthyala@redpinesignals.com>
Signed-off-by: Amitkumar Karwar <amit.karwar@redpinesignals.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2017-09-25 11:25:23 +03:00
Colin Ian King 7dfb0ebd02 mwifiex: make const array tos_to_ac static, reduces object code size
Don't populate the read-only const array tos_to_ac on the stack,
instead make it static. Makes the object code smaller by 250 bytes:

Before:
   text	   data	    bss	    dec	    hex	filename
  26104	   2720	    128	  28952	   7118	wmm.o

After:
   text	   data	    bss	    dec	    hex	filename
  25758	   2816	    128	  28702	   701e	wmm.o

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2017-09-25 11:24:38 +03:00
Adam Borowski e0a576d747 rtl8xxxu: Don't printk raw binary if serial number is not burned in.
I assume that a blank efuse comes with all ones, thus I did not bother
recognizing other possible junk values.  This matches 100% of dongles
I've seen (a single Gembird 8192eu).

Signed-off-by: Adam Borowski <kilobyte@angband.pl>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2017-09-25 11:24:05 +03:00
Colin Ian King d5633bb2c6 brcmsmac: make const array ucode_ofdm_rates static, reduces object code size
Don't populate const array ucode_ofdm_rates on the stack, instead make it
static. Makes the object code smaller by 100 bytes:

Before:
   text	   data	    bss	    dec	    hex	filename
  39482	    564	      0	  40046	   9c6e	phy_cmn.o

After
   text	   data	    bss	    dec	    hex	filename
  39326	    620	      0	  39946	   9c0a	phy_cmn.o

(gcc 6.3.0, x86-64)

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Acked-by: Arend van Spriel <arend.vanspriel@broadcom.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2017-09-25 11:23:10 +03:00
Allen Pais 30ac407639 brcmfmac: use setup_timer() helper
Use setup_timer function instead of initializing timer with the
function and data fields.

Signed-off-by: Allen Pais <allen.lkml@gmail.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2017-09-25 11:21:19 +03:00
Loic Poulain fd52bdae9a wcn36xx: Disable 5GHz for wcn3620
wcn3620 can only operate on 2.4GHz band due to RF limitation.
If wcn36xx digital block is associated with an external IRIS
RF module, retrieve the id and disable 5GHz band in case of
wcn3620 id.

Signed-off-by: Loic Poulain <loic.poulain@linaro.org>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2017-09-25 10:20:58 +03:00
Ville Syrjälä ba24d63dd3 ath9k: Avoid a potential deadlock
Lockdep warns us that sc_pm_lock and cc_lock can cause a deadlock when
cc_lock is acquired by itself with interrupts enabled. Disable irqs
whenever taking cc_lock to avoid this.

[   19.094524] kworker/u2:0/5 just changed the state of lock:
[   19.094578]  (&(&sc->sc_pm_lock)->rlock){-.-...}, at: [<f836c00e>] ath_isr+0x15e/0x200 [ath9k]
[   19.094674] but this lock took another, HARDIRQ-unsafe lock in the past:
[   19.094731]  (&(&common->cc_lock)->rlock){+.-...}
[   19.094741]

               and interrupts could create inverse lock ordering between them.

[   19.094866]
               other info that might help us debug this:
[   19.094926]  Possible interrupt unsafe locking scenario:

[   19.094985]        CPU0                    CPU1
[   19.095036]        ----                    ----
[   19.095086]   lock(&(&common->cc_lock)->rlock);
[   19.095197]                                local_irq_disable();
[   19.095305]                                lock(&(&sc->sc_pm_lock)->rlock);
[   19.095423]                                lock(&(&common->cc_lock)->rlock);
[   19.095539]   <Interrupt>
[   19.095636]     lock(&(&sc->sc_pm_lock)->rlock);
[   19.095745]
                *** DEADLOCK ***

[   19.095965] 3 locks held by kworker/u2:0/5:
[   19.096067]  #0:  ("%s"wiphy_name(local->hw.wiphy)){.+.+.+}, at: [<c1067f37>] process_one_work+0x127/0x580
[   19.096260]  #1:  ((&local->dynamic_ps_enable_work)){+.+...}, at: [<c1067f37>] process_one_work+0x127/0x580
[   19.096447]  #2:  (&sc->mutex){+.+...}, at: [<f836b8b0>] ath9k_config+0x30/0x1d0 [ath9k]
[   19.096639]
               the shortest dependencies between 2nd lock and 1st lock:
[   19.096813]  -> (&(&common->cc_lock)->rlock){+.-...} ops: 38 {
[   19.096816]     HARDIRQ-ON-W at:
[   19.096816]                       __lock_acquire+0x57e/0x1260
[   19.096816]                       lock_acquire+0xb1/0x1c0
[   19.096816]                       _raw_spin_lock_bh+0x3f/0x50
[   19.096816]                       ath_chanctx_set_channel+0xb6/0x2c0 [ath9k]
[   19.096816]                       ath9k_config+0xa8/0x1d0 [ath9k]
[   19.096816]                       ieee80211_hw_config+0xa8/0x5f0 [mac80211]
[   19.096816]                       ieee80211_do_open+0x67a/0x920 [mac80211]
[   19.096816]                       ieee80211_open+0x41/0x50 [mac80211]
[   19.096816]                       __dev_open+0xab/0x140
[   19.096816]                       __dev_change_flags+0x89/0x150
[   19.096816]                       dev_change_flags+0x28/0x60
[   19.096816]                       do_setlink+0x290/0x890
[   19.096816]                       rtnl_newlink+0x7cf/0x8e0
[   19.096816]                       rtnetlink_rcv_msg+0xbf/0x1f0
[   19.096816]                       netlink_rcv_skb+0xb9/0xe0
[   19.096816]                       rtnetlink_rcv+0x1e/0x30
[   19.096816]                       netlink_unicast+0x13a/0x2c0
[   19.096816]                       netlink_sendmsg+0x290/0x380
[   19.096816]                       ___sys_sendmsg+0x1e2/0x280
[   19.096816]                       __sys_sendmsg+0x3f/0x80
[   19.096816]                       SyS_socketcall+0x58c/0x6b0
[   19.096816]                       do_fast_syscall_32+0x96/0x1d0
[   19.096816]                       entry_SYSENTER_32+0x4c/0x7b
[   19.096816]     IN-SOFTIRQ-W at:
[   19.096816]                       __lock_acquire+0x55a/0x1260
[   19.096816]                       lock_acquire+0xb1/0x1c0
[   19.096816]                       _raw_spin_lock+0x3c/0x50
[   19.096816]                       ath_ps_full_sleep+0x24/0x70 [ath9k]
[   19.096816]                       call_timer_fn+0xa4/0x300
[   19.096816]                       run_timer_softirq+0x1b1/0x560
[   19.096816]                       __do_softirq+0xb0/0x430
[   19.096816]                       do_softirq_own_stack+0x33/0x40
[   19.096816]                       irq_exit+0xad/0xc0
[   19.096816]                       smp_apic_timer_interrupt+0x31/0x40
[   19.096816]                       apic_timer_interrupt+0x37/0x3c
[   19.096816]                       wp_page_copy+0xb8/0x580
[   19.096816]                       do_wp_page+0x64/0x420
[   19.096816]                       handle_mm_fault+0x430/0x990
[   19.096816]                       __do_page_fault+0x18b/0x430
[   19.096816]                       do_page_fault+0xb/0x10
[   19.096816]                       common_exception+0x62/0x6a
[   19.096816]     INITIAL USE at:
[   19.096816]                      __lock_acquire+0x204/0x1260
[   19.096816]                      lock_acquire+0xb1/0x1c0
[   19.096816]                      _raw_spin_lock_bh+0x3f/0x50
[   19.096816]                      ath_chanctx_set_channel+0xb6/0x2c0 [ath9k]
[   19.096816]                      ath9k_config+0xa8/0x1d0 [ath9k]
[   19.096816]                      ieee80211_hw_config+0xa8/0x5f0 [mac80211]
[   19.096816]                      ieee80211_do_open+0x67a/0x920 [mac80211]
[   19.096816]                      ieee80211_open+0x41/0x50 [mac80211]
[   19.096816]                      __dev_open+0xab/0x140
[   19.096816]                      __dev_change_flags+0x89/0x150
[   19.096816]                      dev_change_flags+0x28/0x60
[   19.096816]                      do_setlink+0x290/0x890
[   19.096816]                      rtnl_newlink+0x7cf/0x8e0
[   19.096816]                      rtnetlink_rcv_msg+0xbf/0x1f0
[   19.096816]                      netlink_rcv_skb+0xb9/0xe0
[   19.096816]                      rtnetlink_rcv+0x1e/0x30
[   19.096816]                      netlink_unicast+0x13a/0x2c0
[   19.096816]                      netlink_sendmsg+0x290/0x380
[   19.096816]                      ___sys_sendmsg+0x1e2/0x280
[   19.096816]                      __sys_sendmsg+0x3f/0x80
[   19.096816]                      SyS_socketcall+0x58c/0x6b0
[   19.096816]                      do_fast_syscall_32+0x96/0x1d0
[   19.096816]                      entry_SYSENTER_32+0x4c/0x7b
[   19.096816]   }
[   19.096816]   ... key      at: [<f837b694>] __key.61991+0x0/0xffffc96c [ath9k]
[   19.096816]   ... acquired at:
[   19.096816]    lock_acquire+0xb1/0x1c0
[   19.096816]    _raw_spin_lock+0x3c/0x50
[   19.096816]    ath9k_ps_wakeup+0x85/0xe0 [ath9k]
[   19.096816]    ath9k_bss_info_changed+0x2a/0x1b0 [ath9k]
[   19.096816]    ieee80211_bss_info_change_notify+0xf3/0x360 [mac80211]
[   19.096816]    ieee80211_recalc_txpower+0x33/0x40 [mac80211]
[   19.096816]    ieee80211_set_tx_power+0x45/0x1d0 [mac80211]
[   19.096816]    cfg80211_wext_siwtxpower+0xd3/0x350 [cfg80211]
[   19.096816]    ioctl_standard_call+0x4e/0x400
[   19.096816]    wext_handle_ioctl+0xf4/0x190
[   19.096816]    dev_ioctl+0xb7/0x630
[   19.096816]    sock_ioctl+0x13e/0x2d0
[   19.096816]    do_vfs_ioctl+0x84/0x750
[   19.096816]    SyS_ioctl+0x34/0x60
[   19.096816]    do_fast_syscall_32+0x96/0x1d0
[   19.096816]    entry_SYSENTER_32+0x4c/0x7b

[   19.096816] -> (&(&sc->sc_pm_lock)->rlock){-.-...} ops: 597 {
[   19.096816]    IN-HARDIRQ-W at:
[   19.096816]                     __lock_acquire+0x6ae/0x1260
[   19.096816]                     lock_acquire+0xb1/0x1c0
[   19.096816]                     _raw_spin_lock_irqsave+0x45/0x60
[   19.096816]                     ath_isr+0x15e/0x200 [ath9k]
[   19.096816]                     __handle_irq_event_percpu+0x44/0x340
[   19.096816]                     handle_irq_event_percpu+0x1d/0x50
[   19.096816]                     handle_irq_event+0x32/0x60
[   19.096816]                     handle_level_irq+0x81/0x100
[   19.096816]                     handle_irq+0x9c/0xd0
[   19.096816]                     do_IRQ+0x5c/0x120
[   19.096816]                     common_interrupt+0x36/0x3c
[   19.096816]                     _raw_spin_unlock_irqrestore+0x57/0x70
[   19.096816]                     ath9k_config+0x16a/0x1d0 [ath9k]
[   19.096816]                     ieee80211_hw_config+0xa8/0x5f0 [mac80211]
[   19.096816]                     ieee80211_dynamic_ps_enable_work+0x1c3/0x680 [mac80211]
[   19.096816]                     process_one_work+0x1d1/0x580
[   19.096816]                     worker_thread+0x31/0x380
[   19.096816]                     kthread+0xd9/0x110
[   19.096816]                     ret_from_fork+0x19/0x24
[   19.096816]    IN-SOFTIRQ-W at:
[   19.096816]                     __lock_acquire+0x55a/0x1260
[   19.096816]                     lock_acquire+0xb1/0x1c0
[   19.096816]                     _raw_spin_lock_irqsave+0x45/0x60
[   19.096816]                     ath9k_ps_wakeup+0x24/0xe0 [ath9k]
[   19.096816]                     ath9k_tasklet+0x42/0x260 [ath9k]
[   19.096816]                     tasklet_action+0x196/0x1e0
[   19.096816]                     __do_softirq+0xb0/0x430
[   19.096816]                     do_softirq_own_stack+0x33/0x40
[   19.096816]                     irq_exit+0xad/0xc0
[   19.096816]                     do_IRQ+0x65/0x120
[   19.096816]                     common_interrupt+0x36/0x3c
[   19.096816]                     get_page_from_freelist+0x20a/0x970
[   19.096816]                     __alloc_pages_nodemask+0xca/0xed0
[   19.096816]                     __get_free_pages+0x14/0x30
[   19.096816]                     pgd_alloc+0x1d/0x160
[   19.096816]                     mm_init.isra.47+0x13a/0x1b0
[   19.096816]                     copy_process.part.54+0xb55/0x1700
[   19.096816]                     _do_fork+0xd4/0x6a0
[   19.096816]                     SyS_clone+0x27/0x30
[   19.096816]                     do_fast_syscall_32+0x96/0x1d0
[   19.096816]                     entry_SYSENTER_32+0x4c/0x7b
[   19.096816]    INITIAL USE at:
[   19.096816]                    __lock_acquire+0x204/0x1260
[   19.096816]                    lock_acquire+0xb1/0x1c0
[   19.096816]                    _raw_spin_lock_irqsave+0x45/0x60
[   19.096816]                    ath9k_ps_wakeup+0x24/0xe0 [ath9k]
[   19.096816]                    ath9k_start+0x29/0x1f0 [ath9k]
[   19.096816]                    drv_start+0x71/0x270 [mac80211]
[   19.096816]                    ieee80211_do_open+0x31f/0x920 [mac80211]
[   19.096816]                    ieee80211_open+0x41/0x50 [mac80211]
[   19.096816]                    __dev_open+0xab/0x140
[   19.096816]                    __dev_change_flags+0x89/0x150
[   19.096816]                    dev_change_flags+0x28/0x60
[   19.096816]                    do_setlink+0x290/0x890
[   19.096816]                    rtnl_newlink+0x7cf/0x8e0
[   19.096816]                    rtnetlink_rcv_msg+0xbf/0x1f0
[   19.096816]                    netlink_rcv_skb+0xb9/0xe0
[   19.096816]                    rtnetlink_rcv+0x1e/0x30
[   19.096816]                    netlink_unicast+0x13a/0x2c0
[   19.096816]                    netlink_sendmsg+0x290/0x380
[   19.096816]                    ___sys_sendmsg+0x1e2/0x280
[   19.096816]                    __sys_sendmsg+0x3f/0x80
[   19.096816]                    SyS_socketcall+0x58c/0x6b0
[   19.096816]                    do_fast_syscall_32+0x96/0x1d0
[   19.096816]                    entry_SYSENTER_32+0x4c/0x7b
[   19.096816]  }
[   19.096816]  ... key      at: [<f837b67c>] __key.61994+0x0/0xffffc984 [ath9k]
[   19.096816]  ... acquired at:
[   19.096816]    check_usage_forwards+0x118/0x120
[   19.096816]    mark_lock+0x2e4/0x590
[   19.096816]    __lock_acquire+0x6ae/0x1260
[   19.096816]    lock_acquire+0xb1/0x1c0
[   19.096816]    _raw_spin_lock_irqsave+0x45/0x60
[   19.096816]    ath_isr+0x15e/0x200 [ath9k]
[   19.096816]    __handle_irq_event_percpu+0x44/0x340
[   19.096816]    handle_irq_event_percpu+0x1d/0x50
[   19.096816]    handle_irq_event+0x32/0x60
[   19.096816]    handle_level_irq+0x81/0x100
[   19.096816]    handle_irq+0x9c/0xd0
[   19.096816]    do_IRQ+0x5c/0x120
[   19.096816]    common_interrupt+0x36/0x3c
[   19.096816]    _raw_spin_unlock_irqrestore+0x57/0x70
[   19.096816]    ath9k_config+0x16a/0x1d0 [ath9k]
[   19.096816]    ieee80211_hw_config+0xa8/0x5f0 [mac80211]
[   19.096816]    ieee80211_dynamic_ps_enable_work+0x1c3/0x680 [mac80211]
[   19.096816]    process_one_work+0x1d1/0x580
[   19.096816]    worker_thread+0x31/0x380
[   19.096816]    kthread+0xd9/0x110
[   19.096816]    ret_from_fork+0x19/0x24

[   19.096816]
               stack backtrace:
[   19.096816] CPU: 0 PID: 5 Comm: kworker/u2:0 Not tainted 4.13.0-mgm-ovl+ #51
[   19.096816] Hardware name: FUJITSU SIEMENS LIFEBOOK S6120/FJNB16C, BIOS Version 1.26  05/10/2004
[   19.096816] Workqueue: phy0 ieee80211_dynamic_ps_enable_work [mac80211]
[   19.096816] Call Trace:
[   19.096816]  <IRQ>
[   19.096816]  dump_stack+0x16/0x19
[   19.096816]  print_irq_inversion_bug.part.37+0x16c/0x179
[   19.096816]  check_usage_forwards+0x118/0x120
[   19.096816]  ? ret_from_fork+0x19/0x24
[   19.096816]  ? print_shortest_lock_dependencies+0x1a0/0x1a0
[   19.096816]  mark_lock+0x2e4/0x590
[   19.096816]  ? print_shortest_lock_dependencies+0x1a0/0x1a0
[   19.096816]  __lock_acquire+0x6ae/0x1260
[   19.096816]  lock_acquire+0xb1/0x1c0
[   19.096816]  ? ath_isr+0x15e/0x200 [ath9k]
[   19.096816]  _raw_spin_lock_irqsave+0x45/0x60
[   19.096816]  ? ath_isr+0x15e/0x200 [ath9k]
[   19.096816]  ath_isr+0x15e/0x200 [ath9k]
[   19.096816]  __handle_irq_event_percpu+0x44/0x340
[   19.096816]  handle_irq_event_percpu+0x1d/0x50
[   19.096816]  handle_irq_event+0x32/0x60
[   19.096816]  ? handle_nested_irq+0x100/0x100
[   19.096816]  handle_level_irq+0x81/0x100
[   19.096816]  handle_irq+0x9c/0xd0
[   19.096816]  </IRQ>
[   19.096816]  do_IRQ+0x5c/0x120
[   19.096816]  common_interrupt+0x36/0x3c
[   19.096816] EIP: _raw_spin_unlock_irqrestore+0x57/0x70
[   19.096816] EFLAGS: 00000286 CPU: 0
[   19.096816] EAX: f60a3600 EBX: 00000286 ECX: 00000006 EDX: 00000001
[   19.096816] ESI: f46c9e68 EDI: f46c8620 EBP: f60b5e8c ESP: f60b5e84
[   19.096816]  DS: 007b ES: 007b FS: 0000 GS: 0000 SS: 0068
[   19.096816]  ath9k_config+0x16a/0x1d0 [ath9k]
[   19.096816]  ieee80211_hw_config+0xa8/0x5f0 [mac80211]
[   19.096816]  ? ieee80211_hw_config+0x1db/0x5f0 [mac80211]
[   19.096816]  ieee80211_dynamic_ps_enable_work+0x1c3/0x680 [mac80211]
[   19.096816]  ? process_one_work+0x127/0x580
[   19.096816]  ? process_one_work+0x127/0x580
[   19.096816]  process_one_work+0x1d1/0x580
[   19.096816]  ? process_one_work+0x127/0x580
[   19.096816]  worker_thread+0x31/0x380
[   19.096816]  kthread+0xd9/0x110
[   19.096816]  ? process_one_work+0x580/0x580
[   19.096816]  ? kthread_create_on_node+0x30/0x30
[   19.096816]  ret_from_fork+0x19/0x24

Cc: QCA ath9k Development <ath9k-devel@qca.qualcomm.com>
Cc: Kalle Valo <kvalo@codeaurora.org>
Cc: netdev@vger.kernel.org
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2017-09-25 10:17:42 +03:00
Bhumika Goyal 496cbf3ebb ath10k: make ath10k_hw_ce_regs const
Make them const as they are not modified in the file referencing
them. They are only stored in the const field 'hw_ce_reg' of an ath10k
structure. Also, make the declarations in the header const.

Signed-off-by: Bhumika Goyal <bhumirks@gmail.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2017-09-25 10:15:45 +03:00
Thomas Meyer 896cbefadf ath9k: Use ARRAY_SIZE macro
Use ARRAY_SIZE macro, rather than explicitly coding some variant of it
yourself.
Found with: find -type f -name "*.c" -o -name "*.h" | xargs perl -p -i -e
's/\bsizeof\s*\(\s*(\w+)\s*\)\s*\ /\s*sizeof\s*\(\s*\1\s*\[\s*0\s*\]\s*\)
/ARRAY_SIZE(\1)/g' and manual check/verification.

Signed-off-by: Thomas Meyer <thomas@m3y3r.de>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2017-09-25 10:14:41 +03:00
Himanshu Jha 50c8cd44ed ath9k: remove cast to void pointer
casting to void pointer from any pointer type and vice-versa is done
implicitly and therefore casting is not needed in such a case.

Done using Coccinellle.
Semantic Patch used :

@r@
expression x;
void* e;
type T;
identifier f;
@@

(
  *((T *)e)
|
  ((T *)x)[...]
|
  ((T *)x)->f
|
- (T *)
  e
)


Signed-off-by: Himanshu Jha <himanshujha199640@gmail.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2017-09-25 10:13:58 +03:00
Kalle Valo 3e747fa182 Merge ath-current from ath.git
ath.git fixes for 4.14. Major changes:

ath10k

* fix a PCI PM related gcc warning
2017-09-25 10:06:12 +03:00
Allen Pais b9496b6b91 drivers: net: ath6kl: use setup_timer() helper.
Use setup_timer function instead of initializing timer with the
    function and data fields.

Signed-off-by: Allen Pais <allen.lkml@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2017-09-21 11:44:42 -07:00
Allen Pais 55d3cef4ee drivers: net: atmel: use setup_timer() helper.
Use setup_timer function instead of initializing timer with the
    function and data fields.

Signed-off-by: Allen Pais <allen.lkml@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2017-09-21 11:44:41 -07:00
Allen Pais 531f3ce953 drivers: net: rsi_91x: use setup_timer() helper.
Use setup_timer function instead of initializing timer with the
    function and data fields.

Signed-off-by: Allen Pais <allen.lkml@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2017-09-21 11:44:39 -07:00
Allen Pais 27dd085264 drivers: net: brcm80211: use setup_timer() helper.
Use setup_timer function instead of initializing timer with the
    function and data fields.

Signed-off-by: Allen Pais <allen.lkml@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2017-09-21 11:44:39 -07:00
Arnd Bergmann 6af1de2e4e ath10k: mark PM functions as __maybe_unused
When CONFIG_PM_SLEEP is disabled, we get a compile-time
warning:

drivers/net/wireless/ath/ath10k/pci.c:3417:12: error: 'ath10k_pci_pm_resume' defined but not used [-Werror=unused-function]
 static int ath10k_pci_pm_resume(struct device *dev)
            ^~~~~~~~~~~~~~~~~~~~
drivers/net/wireless/ath/ath10k/pci.c:3401:12: error: 'ath10k_pci_pm_suspend' defined but not used [-Werror=unused-function]
 static int ath10k_pci_pm_suspend(struct device *dev)

Rather than fixing the #ifdef, this just marks both functions
as __maybe_unused, which is a more robust way to do this.

Fixes: 32faa3f0ee ("ath10k: add the PCI PM core suspend/resume ops")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2017-09-21 18:01:30 +03:00
Lubomir Rintel 62b093b375 mac80211_hwsim: use dyndbg for debug messages
The mac80211_hwsim doesn't offer a way to disable the debugging output.
Unfortunately, it's pretty chatty, dumping a  lot of stuff into the message
buffer.

This patch changes it to use dyndbg for controlling the debug output.
It's disabled by default, but can be enabled by a module parameter (1),
at runtime (2) or persisted in modprobe.conf (3).

  (1) modprobe mac80211_hwsim dyndbg=+p
  (2) echo "module mac80211_hwsim +p" >/sys/kernel/debug/dynamic_debug/control
  (3) echo "options mac80211_hwsim dyndbg=+p" >>/etc/modprobe.d/my.conf

Signed-off-by: Lubomir Rintel <lkundrak@v3.sk>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2017-09-21 11:42:02 +02:00
Ganapathi Bhat e9a3846afa mwifiex: use get_random_mask_addr() helper
Avoid calculating random MAC address in driver. Instead make
use of 'get_random_mask_addr()' function.

Signed-off-by: Ganapathi Bhat <gbhat@marvell.com>
Reviewed-by: Brian Norris <briannorris@chromium.org>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2017-09-20 15:48:34 +03:00
Ganapathi Bhat e251a882c0 mwifiex: avoid storing random_mac in private
Application will keep track of whether MAC address randomization
is enabled or not during scan. But at present driver is storing
'random_mac' in mwifiex_private which implies even after scan is
done driver has some reference to the earlier 'scan request'. To
avoid this, make use of 'mac_addr' variable in 'scan_request' to
store 'random_mac'. This structure will be freed by cfg80211 once
scan is done.

Signed-off-by: Ganapathi Bhat <gbhat@marvell.com>
Reviewed-by: Brian Norris <briannorris@chromium.org>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2017-09-20 15:47:53 +03:00
Colin Ian King d157bcfaf8 mwifiex: make const arrays static to shink object code size
Don't populate const arrays on the stack, instead make them static
Makes the object code smaller by nearly 300 bytes:

Before:
   text	   data	    bss	    dec	    hex	filename
  69260	  16149	    576	  85985	  14fe1	cfg80211.o

After:
   text	   data	    bss	    dec	    hex	filename
  68385	  16725	    576	  85686	  14eb6	cfg80211.o

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2017-09-20 15:47:24 +03:00
Himanshu Jha 85dafc1291 mwifiex: remove unnecessary call to memset
call to memset to assign 0 value immediately after allocating
memory with kzalloc is unnecesaary as kzalloc allocates the memory
filled with 0 value.

Semantic patch used to resolve this issue:

@@
expression e,e2; constant c;
statement S;
@@

  e = kzalloc(e2, c);
  if(e == NULL) S
- memset(e, 0, e2);

Signed-off-by: Himanshu Jha <himanshujha199640@gmail.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2017-09-20 15:46:59 +03:00
Ganapathi Bhat 26177d7f39 mwifiex: check for mfg_mode in add_virtual_intf
If driver is loaded with 'mfg_mode' enabled, then the sending
commands are not allowed. So, skip sending commands, to firmware
in mwifiex_add_virtual_intf if 'mfg_mode' is enabled.

Fixes: 7311ea8500 ("mwifiex: fix AP start problem for newly added interface")
Signed-off-by: Ganapathi Bhat <gbhat@marvell.com>
Reviewed-by: Brian Norris <briannorris@chromium.org>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2017-09-20 15:46:32 +03:00
Ganapathi Bhat 31726ff201 mwifiex: notify cfg80211 about scan abort
Driver sends a series of scan commands to firmware to serve a
user scan request. If an intermediate scan command fails, driver
aborts the scan but it is not being informed to cfg80211. This
will cause issues in applications performing periodic scans.
Fix this by informing scan abort.

Signed-off-by: Cathy Luo <cluo@marvell.com>
Signed-off-by: Ganapathi Bhat <gbhat@marvell.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2017-09-20 15:45:45 +03:00
Larry Finger 519ce2f933 rtlwifi: rtl8192ee: Fix memory leak when loading firmware
In routine rtl92ee_set_fw_rsvdpagepkt(), the driver allocates an skb, but
never calls rtl_cmd_send_packet(), which will free the buffer. All other
rtlwifi drivers perform this operation correctly.

This problem has been in the driver since it was included in the kernel.
Fortunately, each firmware load only leaks 4 buffers, which likely
explains why it has not previously been detected.

Cc: Stable <stable@vger.kernel.org> # 3.18+
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2017-09-20 15:44:44 +03:00
Larry Finger 0f61953dd0 rtlwifi: btcoexist: 23b 1ant: fix duplicated code for different branches
A typo led to this issue, which was detected with the help of Coccinelle.

In addition to fixing the error, the code is refactored to eliminate an
if statement.

Addresses-Coverity-ID: 1226788

Reported-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Cc: Ping-Ke Shih <pkshih@realtek.com>
Cc: Yan-Hsuan Chuang <yhchuang@realtek.com>
Cc: Birming Chiu <birming@realtek.com>
Cc: Shaofu <shaofu@realtek.com>
Cc: Steven Ting <steventing@realtek.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2017-09-20 15:41:47 +03:00
Colin Ian King e3ae1c7720 b43legacy: fix unitialized reads of ret by initializing the array to zero
The u8 char array ret is not being initialized and elements outside
the range start to end contain just garbage values from the stack.
This results in a later scan of the array to read potentially
uninitialized values.  Fix this by initializing the array to zero.
This seems to have been an issue since the very first commit.

Detected by CoverityScan CID#139653 ("Uninitialized scalar variable")

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Reviewed-by: Michael Buesch <m@bues.ch>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2017-09-20 15:41:08 +03:00
Colin Ian King e31fbe1034 b43: fix unitialized reads of ret by initializing the array to zero
The u8 char array ret is not being initialized and elements outside
the range start to end contain just garbage values from the stack.
This results in a later scan of the array to read potentially
uninitialized values.  Fix this by initializing the array to zero.
This seems to have been an issue since the very first commit.

Detected by CoverityScan CID#139652 ("Uninitialized scalar variable")

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Reviewed-by: Michael Buesch <m@bues.ch>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2017-09-20 15:41:07 +03:00
Colin Ian King 6508497cbd rsi: fix a dereference on adapter before it has been null checked
The assignment of dev is dereferencing adapter before adapter has
been null checked, potentially leading to a null pointer dereference.
Fix this by simply moving the assignment of dev to a later point
after the sanity null check of adapter.

Detected by CoverityScan CID#1398383 ("Dereference before null check")

Fixes: dad0d04fa7 ("rsi: Add RS9113 wireless driver")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2017-09-20 15:40:16 +03:00
Prameela Rani Garnepudi af75687286 rsi: miscellaneous changes for p2p mode
Add P2P_GO condition as well when handling BEACON_ENABLE
from mac80211. Also passing 'vif' for auto rate request.

Signed-off-by: Prameela Rani Garnepudi <prameela.j04cs@gmail.com>
Signed-off-by: Amitkumar Karwar <amit.karwar@redpinesignals.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2017-09-20 15:38:58 +03:00
Prameela Rani Garnepudi c7245c0975 rsi: aggregation changes for p2p mode
P2P Go condition is added wherever AP mode is there
in aggregation path.

Signed-off-by: Prameela Rani Garnepudi <prameela.j04cs@gmail.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2017-09-20 15:38:57 +03:00
Prameela Rani Garnepudi efe877aa0f rsi: disallow power save config when AP vap running
When AP or P2P GO VAP is running, power save configuration should
be disallowed. To check interface type in power save configuration
'vif' parameters is passed.

Signed-off-by: Prameela Rani Garnepudi <prameela.j04cs@gmail.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2017-09-20 15:38:57 +03:00
Prameela Rani Garnepudi eac4eed322 rsi: tx and rx path enhancements for p2p mode
Data descriptor is updated to include vap_id. TX command frame
key config also updated to include vap_id.

Signed-off-by: Prameela Rani Garnepudi <prameela.j04cs@gmail.com>
Signed-off-by: Amitkumar Karwar <amit.karwar@redpinesignals.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2017-09-20 15:38:56 +03:00
Prameela Rani Garnepudi 4671c209ac rsi: handle peer connection and disconnection in p2p mode
Parameter 'vif' is passed to inform_bss_status function to
check the type of vif and to get vap_id.

Signed-off-by: Prameela Rani Garnepudi <prameela.j04cs@gmail.com>
Signed-off-by: Amitkumar Karwar <amit.karwar@redpinesignals.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2017-09-20 15:38:56 +03:00
Prameela Rani Garnepudi df77191191 rsi: add support for p2p listen
Remain-on-channel and cancel-remain-on-channel are implemented
to support p2p listen phase.

Signed-off-by: Prameela Rani Garnepudi <prameela.j04cs@gmail.com>
Signed-off-by: Amitkumar Karwar <amit.karwar@redpinesignals.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2017-09-20 15:38:55 +03:00
Prameela Rani Garnepudi b8bd3a439f rsi: add/remove interface enhancements for p2p
STA_OPMODE and AP_OPMODE macros are renamed to RSI_OPMODE_STA
and RSI_OPMODE_AP. New opmodes are added to this list for P2P
support. Mapping of mac80211 interface types to rsi interface
types are added.
Add and remove interface callbacks are handled for P2P mode.

Signed-off-by: Prameela Rani Garnepudi <prameela.j04cs@gmail.com>
Signed-off-by: Amitkumar Karwar <amit.karwar@redpinesignals.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2017-09-20 15:38:55 +03:00
Prameela Rani Garnepudi 421eedff11 rsi: add p2p support parameters to mac80211
This patch adds p2p supported parameters to mac80211 hw and
wiphy structures during mac80211 registration.

Signed-off-by: Prameela Rani Garnepudi <prameela.j04cs@gmail.com>
Signed-off-by: Amitkumar Karwar <amit.karwar@redpinesignals.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2017-09-20 15:38:54 +03:00
Sergey Matyukevich a715b3a0ef qtnfmac: cancel scans on wireless interface changes
Cancel active scans and deactivate firmware scan watchdog timer
when wireless interface configuration is changed. The usecases
include wireless interface mode change, interface down,
AP stop, virtual interface removal.

Signed-off-by: Sergey Matyukevich <sergey.matyukevich.os@quantenna.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2017-09-20 15:35:33 +03:00
Sergey Matyukevich 20da2ec06b qtnfmac: lock access to h/w in tx path
Fix tx path regression. Lock should be held when queuing packets
to h/w fifos in order to properly handle configurations with
multiple enabled interfaces.

Signed-off-by: Sergey Matyukevich <sergey.matyukevich.os@quantenna.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2017-09-20 15:35:32 +03:00
Arend Van Spriel 35f62727df brcmfmac: setup passive scan if requested by user-space
The driver was not properly configuring firmware with regard to the
type of scan. It always performed an active scan even when user-space
was requesting for passive scan, ie. the scan request was done without
any SSIDs specified.

Cc: stable@vger.kernel.org # v4.0.x
Reported-by: Huang, Jiangyang <Jiangyang.Huang@itron.com>
Reviewed-by: Hante Meuleman <hante.meuleman@broadcom.com>
Reviewed-by: Pieter-Paul Giesberts <pieter-paul.giesberts@broadcom.com>
Reviewed-by: Franky Lin <franky.lin@broadcom.com>
Signed-off-by: Arend van Spriel <arend.vanspriel@broadcom.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2017-09-20 07:46:30 +03:00
Arend Van Spriel 17df6453d4 brcmfmac: add length check in brcmf_cfg80211_escan_handler()
Upon handling the firmware notification for scans the length was
checked properly and may result in corrupting kernel heap memory
due to buffer overruns. This fix addresses CVE-2017-0786.

Cc: stable@vger.kernel.org # v4.0.x
Cc: Kevin Cernekee <cernekee@chromium.org>
Reviewed-by: Hante Meuleman <hante.meuleman@broadcom.com>
Reviewed-by: Pieter-Paul Giesberts <pieter-paul.giesberts@broadcom.com>
Reviewed-by: Franky Lin <franky.lin@broadcom.com>
Signed-off-by: Arend van Spriel <arend.vanspriel@broadcom.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2017-09-20 07:46:29 +03:00
Kalle Valo 4c707c04f6 First set of fixes for 4.14
* A couple of bugzilla bugs related to multicast handling;
 * Two fixes for WoWLAN bugs that were causing queue hangs and
   re-initialization problems;
 * Two fixes for potential uninitialized variable use reported by Dan
   Carpenter in relation to a recently introduced patch;
 * A fix for buffer reordering in the newly supported 9000 device
   family;
 * Fix a race when starting aggregation;
 * Small fix for a recent patch to wake mac80211 queues;
 * Send non-bufferable management frames in the generic queue so they
   are not sent on queues that are under power-save;
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCAAdFiEEF3LNfgb2BPWm68smoUecoho8xfoFAlm7u44ACgkQoUecoho8
 xfqOPw//TF8p9ZqXknYahiaSM8pQFSXbnbPCa8IFnZs4yTV7f6htQ50bRjafFsbV
 nAUAXaJI3901QyP96yHKX09IYJ6QMFxiCiB2uFmwUdVw+WFRPd9fJMMIFYKKIQTp
 2v3NA2odBrDzWZRp7HAipo6xQTkAEBqubrJqWMGLKoQUcMm7ocVLAazCj66dxbLd
 onyunys2+8DU2krGdDTZA8vlcXWSWvMtDzvsB3yfB4Do0rG+jQj5CDeB6ou7VKtq
 SvVr75qCc/4YHHCxWEU380Usdz36pgW22BVGp8OoAX1SRR26zpeT8g2FwiUIK8R/
 0+vSmbOFnAkXDMezNGQ74tdTB/AoT43kymEq2fCxll7gPMLabuYkZhSIBgIj6rZs
 KCcPcazP93CofTMpG9G/cLphsvGgB0WlYwQhcuUts3+goLKApvpbsKThWRPjsBW4
 0VbH/TTDddaMEuDvm+I1wL49GiF1l2uLlzjuol9W2oM1MXnhFn/QXuntjrKKRwP0
 XiLx07zjaS21jZaIJjRDf7LB02V/47YbJQ83p+kbDccKLhUOtSnbXmZsDfPRLWV+
 klQF2kRusuZbVUrIvExKjJlloz1ydk6MnTP4W31kEyqtNjr1m92oKRvx8vHIZ+A5
 id6KWed8DZU1VM4yFQSt/4LltN7ewdjlRaSOO0WO/C51iHV/vsA=
 =DM5q
 -----END PGP SIGNATURE-----

Merge tag 'iwlwifi-for-kalle-2017-09-15' of git://git.kernel.org/pub/scm/linux/kernel/git/iwlwifi/iwlwifi-fixes

First set of fixes for 4.14

* A couple of bugzilla bugs related to multicast handling;
* Two fixes for WoWLAN bugs that were causing queue hangs and
  re-initialization problems;
* Two fixes for potential uninitialized variable use reported by Dan
  Carpenter in relation to a recently introduced patch;
* A fix for buffer reordering in the newly supported 9000 device
  family;
* Fix a race when starting aggregation;
* Small fix for a recent patch to wake mac80211 queues;
* Send non-bufferable management frames in the generic queue so they
  are not sent on queues that are under power-save;
2017-09-18 14:08:43 +03:00
David S. Miller 91aac5637f wireless-drivers fixes for 4.14
Few fixes to regressions introduced in the last one or two releases.
 The iwlwifi fix is for a regression reported by Linus.
 
 rtlwifi
 
 * fix two antenna selection related bugs
 
 iwlwifi
 
 * fix regression with older firmwares
 
 brcmfmac
 
 * workaround firmware crash for bcm4345
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1
 
 iQEcBAABAgAGBQJZsrqPAAoJEG4XJFUm622bT04IAIR/MiSKo+IJ8wpvzXJ5K7x5
 /IzGDoJofqiQHVG0Rc72+0ooFwSe6nxQ3E+OzQM9yLIC8XcjPwd8mqnV4dzF5rIs
 Q0ou092eBOVfMZO9EMrZJLuFiItfF8deH+nnYDuQBFsTHVKdkYVltB5JUX98hj6q
 SFY7RYgmTcXq7j5H5u7AuDueJu0maHq2eb9t6MvtD06pbyvmh5t6CRsSORinMfff
 090mWhPYTgZZqCuVQk9lki2671vgqjqfyr2M0hGWnsQCM+IiXUIptSGPEjwRDGDv
 0yePGq750YPVjlMixIHfKEfm446YHp++Yjl/QzYCV3bbCHF5yEAUVoG8Nv3ibxc=
 =DL06
 -----END PGP SIGNATURE-----

Merge tag 'wireless-drivers-for-davem-2017-09-08' of git://git.kernel.org/pub/scm/linux/kernel/git/kvalo/wireless-drivers

Kalle Valo says:

====================
wireless-drivers fixes for 4.14

Few fixes to regressions introduced in the last one or two releases.
The iwlwifi fix is for a regression reported by Linus.

rtlwifi

* fix two antenna selection related bugs

iwlwifi

* fix regression with older firmwares

brcmfmac

* workaround firmware crash for bcm4345
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
2017-09-08 10:09:57 -07:00
Ian W MORRISON f957dd3c8d brcmfmac: feature check for multi-scheduled scan fails on bcm4345 devices
The firmware feature check introduced for multi-scheduled scan is also
failing for bcm4345 devices resulting in a firmware crash.
The reason for this crash has not yet been root cause so this patch avoids
the feature check for those device as a short-term fix.

Fixes: 9fe929aaac ("brcmfmac: add firmware feature detection for gscan feature")
Cc: <stable@vger.kernel.org> # v4.13
Signed-off-by: Ian W MORRISON <ianwmorrison@gmail.com>
Acked-by: Arend van Spriel <arend.vanspriel@broadcom.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2017-09-08 12:25:24 +03:00
Sara Sharon 5f90472c00 iwlwifi: mvm: fix reorder buffer for 9000 devices
The condition to check if reorder buffer ran out of
space is faulty, as it takes into account only the
NSSN.
In case the head SN was too far behind the reorder
buffer should move forward, regardless of the NSSN
status.
This caused the driver to release packets out of order
in some scenarios.

Fixes: b915c10174 ("iwlwifi: mvm: add reorder buffer per queue")
Signed-off-by: Sara Sharon <sara.sharon@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2017-09-08 11:52:51 +03:00
Luca Coelho d460f1fb83 iwlwifi: mvm: set status before calling iwl_mvm_send_cmd_status()
We always must set the status to what we consider success before
calling iwl_mvm_send_cmd_status() (also iwl_mvm_send_cmd_pdu_status()
which calls it).  Fix a few places where initialization is missing.

Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2017-09-08 11:50:30 +03:00
Luca Coelho 3f497de997 iwlwifi: mvm: initialize status in iwl_mvm_add_int_sta_common()
We always need to initialize the status argument to the success case
before calling iwl_mvm_send_cmd_status() or
iwl_mvm_send_cmd_pdu_status() (which calls the former) otherwise we
may get an uninitialized value back.  In this case, we use
ADD_STA_SUCCESS as success.

Fixes: 732d06e9d9 ("iwlwifi: mvm: add station before allocating a queue")
Reported by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2017-09-08 11:49:15 +03:00
Luca Coelho 61e7d91bcf iwlwifi: mvm: handle FIF_ALLMULTI when setting multicast addresses
We were ignoring the FIF_ALLMULTI flag when setting the multicast
addresses with MCAST_FILTER_CMD.  Check if this flag is set and enable
pass_all accordingly.  We also need to set the count to 0 if pass_all
is enable so we don't pass addresses to the firmware when not needed
(as doing so causes an assert).

This fixes https://bugzilla.kernel.org/show_bug.cgi?id=196741

Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2017-09-08 11:47:37 +03:00
Luca Coelho 97bce57bd7 iwlwifi: mvm: use IWL_HCMD_NOCOPY for MCAST_FILTER_CMD
The MCAST_FILTER_CMD can get quite large when we have many mcast
addresses to set (we support up to 255).  So the command should be
send as NOCOPY to prevent a warning caused by too-long commands:

WARNING: CPU: 0 PID: 9700 at /root/iwlwifi/stack-dev/drivers/net/wireless/intel/iwlwifi/pcie/tx.c:1550 iwl_pcie_enqueue_hcmd+0x8c7/0xb40 [iwlwifi]
Command MCAST_FILTER_CMD (0x1d0) is too large (328 bytes)

This fixes: https://bugzilla.kernel.org/show_bug.cgi?id=196743

Cc: stable@vger.kernel.org
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2017-09-08 11:44:39 +03:00
Avraham Stern 8458e48ac7 iwlwifi: mvm: wake the correct mac80211 queue
iwl_mvm_start_mac_queues() takes a bitmap of the queues to wake.
When deferred tx is purged, set the bit of the hw_queue so
the correct queue will be waken up.

Fixes: 7e39a00d59 ("iwlwifi: mvm: start mac queues when deferred tx frames are purged")
Signed-off-by: Avraham Stern <avraham.stern@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2017-09-08 11:44:09 +03:00
Naftali Goldstein bd800e41a3 iwlwifi: mvm: change state when queueing agg start work
Add a new state to enum iwl_mvm_agg_state, which is used between
queueing the work that starts tx aggregations and actually starting that
work (changing to state IWL_AGG_STARTING).
This solves a race where ieee80211_start_tx_ba_session is called a
second time, before the work queued by the first run has a chance to
change the agg_state. In this case the second call to
ieee80211_start_tx_ba_session returns an error, and the fallback is to
abort the ba session start.

Fixes: 482e48440a ("iwlwifi: mvm: change open and close criteria of a BA session")
Signed-off-by: Naftali Goldstein <naftali.goldstein@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2017-09-08 11:43:38 +03:00
Avraham Stern 0fe8bed6e3 iwlwifi: mvm: send all non-bufferable frames on the probe queue
AP interfaces now send all non-bufferable frames using the broadcast
station. Thus allow them to use the probe queue and don't warn about
it.

Fixes: eb045e6e03 ("iwlwifi: mvm: Avoid deferring non bufferable frames")
Signed-off-by: Avraham Stern <avraham.stern@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2017-09-08 11:34:51 +03:00
David Spinadel 6110d9e5bd iwlwifi: mvm: Flush non STA TX queues
When starting wowlan mac80211 requests flush w/o vif
and we ignore this request. As a result some packets
stay stuck in the queue and it may end up with a queue
hang.

Allow the driver to flush queues even if station isn't
specified.

Signed-off-by: David Spinadel <david.spinadel@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2017-09-08 11:28:34 +03:00
Matt Chen 59cd827f26 iwlwifi: mvm: fix wowlan resume failed to load INIT ucode
If we set disconnect on wowlan and run suspend/resume, will run
into:
...snipped
iwlwifi 0000:01:00.0: Failed to load firmware chunk!
iwlwifi 0000:01:00.0: Could not load the [0] uCode section
iwlwifi 0000:01:00.0: Failed to start INIT ucode: -110
iwlwifi 0000:01:00.0: Failed to run INIT ucode: -110
iwlwifi 0000:01:00.0: Failed to start RT ucode: -110

It is because we still keep IWL_MVM_STATUS_IN_HW_RESTART in
__iwl_mvm_resume.  When mac80211 starts the device as
__iwl_mvm_mac_start(), we will miss iwl_mvm_restart_cleanup(mvm).

Signed-off-by: Matt Chen <matt.chen@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2017-09-08 11:25:31 +03:00
David S. Miller 0f2be423f1 Back from a long absence, so we have a number of things:
* a remain-on-channel fix from Avi
  * hwsim TX power fix from Beni
  * null-PTR dereference with iTXQ in some rare configurations (Chunho)
  * 40 MHz custom regdomain fixes (Emmanuel)
  * look at right place in HT/VHT capability parsing (Igor)
  * complete A-MPDU teardown properly (Ilan)
  * Mesh ID Element ordering fix (Liad)
  * avoid tracing warning in ht_dbg() (Sharon)
  * fix print of assoc/reassoc (Simon)
  * fix encrypted VLAN with iTXQ (myself)
  * fix calling context of TX queue wake (myself)
  * fix a deadlock with ath10k aggregation (myself)
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEExu3sM/nZ1eRSfR9Ha3t4Rpy0AB0FAlmw78wACgkQa3t4Rpy0
 AB1viw/+K2xrwzsKqrNoNM1sV4bPItUTjay64dPVD5CjJ/pAwou6HCu0gCJCh4kt
 mXhLWHds7Q4sBY+DlN9eIagQLJUaw897FWV+tHHirDGKMsE4tBaIct7PLBpM7r5O
 H03T5qT9+nDGRAJq6ucLG8v91cTAlBNfEIV73Au9Oi5B0Rq4cs+Tz8xS24EHjfTB
 zRcLMaE8qoQjIfrwQsYNQBdvYHY5G+Ui5sbPh3HPLDPzAfKAsc75nbikI2QE//s0
 cMv5ro39vy0DGyQmdTqNzzzuWWzYvhUD7EiIr7Dfm9ilhljCiVqZg6y7ZVMB/QNq
 +HRD7ShbTnNMx1fx8w5WO6gKGVSeo0Ga6KKEauTGiWJQTfZQLuIBLylSMVclfvBN
 4zOv3vC9EUP5qqPt0cby7VV2D+1Z4Lw2GYZZKHF5numMkgHAoDJ+tJHbBFmz1CEX
 co/79RFhGLKvZE+8lN40hqvPoYA5NOUO6jyOq384ZbnC190nVqOXvIxi9jmFKBHp
 rGBE/8e0VPYlc48m6NUFwAvc0HOeN3/ZVaUnoo6SY8fCbru3yhRYzC3pmcepTEbA
 OVBHirgYtntI2mk4FWd2dkTC6aOfP1o11dwm3deaaEtkwaiKlxI2xfnkbsGaMaOh
 RW787Y10g0k785ABD/GxynOeqfiXnIxIjMKZiQliR33zxdv4cAI=
 =QYS4
 -----END PGP SIGNATURE-----

Merge tag 'mac80211-for-davem-2017-09-07' of git://git.kernel.org/pub/scm/linux/kernel/git/jberg/mac80211

Johannes Berg says:

====================
Back from a long absence, so we have a number of things:
 * a remain-on-channel fix from Avi
 * hwsim TX power fix from Beni
 * null-PTR dereference with iTXQ in some rare configurations (Chunho)
 * 40 MHz custom regdomain fixes (Emmanuel)
 * look at right place in HT/VHT capability parsing (Igor)
 * complete A-MPDU teardown properly (Ilan)
 * Mesh ID Element ordering fix (Liad)
 * avoid tracing warning in ht_dbg() (Sharon)
 * fix print of assoc/reassoc (Simon)
 * fix encrypted VLAN with iTXQ (myself)
 * fix calling context of TX queue wake (myself)
 * fix a deadlock with ath10k aggregation (myself)
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
2017-09-07 09:40:58 -07:00
Luca Coelho 2eabc84d2f iwlwifi: mvm: only send LEDS_CMD when the FW supports it
The LEDS_CMD command is only supported in some newer FW versions
(e.g. iwlwifi-8000C-31.ucode), so we can't send it to older versions
(such as iwlwifi-8000C-27.ucode).

To fix this, check for a new bit in the FW capabilities TLV that tells
when the command is supported.

Note that the current version of -31.ucode in linux-firmware.git
(31.532993.0) does not have this capability bit set, so the LED won't
work, even though this version should support it.  But we will update
this firmware soon, so it won't be a problem anymore.

Fixes: 7089ae634c ("iwlwifi: mvm: use firmware LED command where applicable")
Reported-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2017-09-07 19:40:09 +03:00
Larry Finger 6d62269283 rtlwifi: btcoexist: Fix antenna selection code
In commit 87d8a9f352 ("rtlwifi: btcoex: call bind to setup btcoex"),
the code turns on a call to exhalbtc_bind_bt_coex_withadapter(). This
routine contains a bug that causes incorrect antenna selection for those
HP laptops with only one antenna and an incorrectly programmed EFUSE.
These boxes are the ones that need the ant_sel module parameter.

Fixes: 87d8a9f352 ("rtlwifi: btcoex: call bind to setup btcoex")
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Cc: Ping-Ke Shih <pkshih@realtek.com>
Cc: Yan-Hsuan Chuang <yhchuang@realtek.com>
Cc: Birming Chiu <birming@realtek.com>
Cc: Shaofu <shaofu@realtek.com>
Cc: Steven Ting <steventing@realtek.com>
Cc: Stable <stable@vger.kernel.org> # 4.13+
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2017-09-07 15:55:56 +03:00
Larry Finger a33fcba6ec rtlwifi: btcoexist: Fix breakage of ant_sel for rtl8723be
In commit bcd37f4a08 ("rtlwifi: btcoex: 23b 2ant: let bt transmit when
hw initialisation done"), there is an additional error when the module
parameter ant_sel is used to select the auxilary antenna. The error is
that the antenna selection is not checked when writing the antenna
selection register.

Fixes: bcd37f4a08 ("rtlwifi: btcoex: 23b 2ant: let bt transmit when hw initialisation done")
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Cc: Ping-Ke Shih <pkshih@realtek.com>
Cc: Yan-Hsuan Chuang <yhchuang@realtek.com>
Cc: Birming Chiu <birming@realtek.com>
Cc: Shaofu <shaofu@realtek.com>
Cc: Steven Ting <steventing@realtek.com>
Cc: Stable <stable@vger.kernel.org> # 4.12+
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2017-09-07 15:55:56 +03:00
Beni Lev 9de981f507 mac80211_hwsim: Use proper TX power
In struct ieee80211_tx_info, control.vif pointer and rate_driver_data[0]
falls on the same place, depending on the union usage.
During the whole TX process, the union is referred to as a control struct,
which holds the vif that is later used in the tx flow, especially in order
to derive the used tx power.
Referring direcly to rate_driver_data[0] and assigning a value to it,
overwrites the vif pointer, hence making all later references irrelevant.
Moreover, rate_driver_data[0] isn't used later in the flow in order to
retrieve the channel that it is pointing to.

Cc: stable@vger.kernel.org
Signed-off-by: Beni Lev <beni.lev@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2017-09-05 11:28:52 +02:00
David S. Miller 6026e043d0 Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
Three cases of simple overlapping changes.

Signed-off-by: David S. Miller <davem@davemloft.net>
2017-09-01 17:42:05 -07:00
Cong Wang f581a0dd74 wl1251: add a missing spin_lock_init()
wl1251: add a missing spin_lock_init()

This fixes the following kernel warning:

 [ 5668.771453] BUG: spinlock bad magic on CPU#0, kworker/u2:3/9745
 [ 5668.771850]  lock: 0xce63ef20, .magic: 00000000, .owner: <none>/-1,
 .owner_cpu: 0
 [ 5668.772277] CPU: 0 PID: 9745 Comm: kworker/u2:3 Tainted: G        W
 4.12.0-03002-gec979a4-dirty #40
 [ 5668.772796] Hardware name: Nokia RX-51 board
 [ 5668.773071] Workqueue: phy1 wl1251_irq_work
 [ 5668.773345] [<c010c9e4>] (unwind_backtrace) from [<c010a274>]
 (show_stack+0x10/0x14)
 [ 5668.773803] [<c010a274>] (show_stack) from [<c01545a4>]
 (do_raw_spin_lock+0x6c/0xa0)
 [ 5668.774230] [<c01545a4>] (do_raw_spin_lock) from [<c06ca578>]
 (_raw_spin_lock_irqsave+0x10/0x18)
 [ 5668.774658] [<c06ca578>] (_raw_spin_lock_irqsave) from [<c048c010>]
 (wl1251_op_tx+0x38/0x5c)
 [ 5668.775115] [<c048c010>] (wl1251_op_tx) from [<c06a12e8>]
 (ieee80211_tx_frags+0x188/0x1c0)
 [ 5668.775543] [<c06a12e8>] (ieee80211_tx_frags) from [<c06a138c>]
 (__ieee80211_tx+0x6c/0x130)
 [ 5668.775970] [<c06a138c>] (__ieee80211_tx) from [<c06a3dbc>]
 (ieee80211_tx+0xdc/0x104)
 [ 5668.776367] [<c06a3dbc>] (ieee80211_tx) from [<c06a4af0>]
 (__ieee80211_subif_start_xmit+0x454/0x8c8)
 [ 5668.776824] [<c06a4af0>] (__ieee80211_subif_start_xmit) from
 [<c06a4f94>] (ieee80211_subif_start_xmit+0x30/0x2fc)
 [ 5668.777343] [<c06a4f94>] (ieee80211_subif_start_xmit) from
 [<c0578848>] (dev_hard_start_xmit+0x80/0x118)
...

    by adding the missing spin_lock_init().

Reported-by: Pavel Machek <pavel@ucw.cz>
Cc: Kalle Valo <kvalo@codeaurora.org>
Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>
Acked-by: Pavel Machek <pavel@ucw.cz>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Signed-off-by: Pavel Machek <pavel@ucw.cz>
Cc: stable@kernel.org
Signed-off-by: David S. Miller <davem@davemloft.net>
2017-08-31 13:11:15 -07:00
Kalle Valo eb464d4a8d Merge ath-next from git://git.kernel.org/pub/scm/linux/kernel/git/kvalo/ath.git
ath.git patches for 4.14. Major changes:

wil6210

* support FW RSSI reporting (by mistake this was accidentally
  mentioned already in the previous pull request, but now it's really
  included)

* make debugfs optional, adds new Kconfig option CONFIG_WIL6210_DEBUGFS
2017-08-31 21:34:22 +03:00
Ryan Hsu 393b706cf2 ath10k: configure and enable the wakeup capability
ACPI will rely on device driver to tell it if the device could support
wakeup function when system in D3 state.

This has caused some platform can't support remote wakeup correctly,
because the ACPI wakeup GPE is not enabled, hence registers the .set_wakeup
callback to handle it if device supports wakeup.

Tested with QCA6174 hw3.0, firmware ('WLAN.RM.4.4.1-00008-QCARMSWP-1')

Signed-off-by: Ryan Hsu <ryanhsu@qti.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2017-08-31 21:17:04 +03:00
Ryan Hsu 32faa3f0ee ath10k: add the PCI PM core suspend/resume ops
The actual PCI suspend/resume in ath10k has been handled in wow.c,
but in the case of the device doesn't support remote wakeup,
the .hif_suspend() and .hif_resume() will never be handled.

  ath10k_wow_op_suspend()
  {
	if (WARN_ON(!test_bit(ATH10K_FW_FEATURE_WOWLAN_SUPPORT,
		    ar->running_fw->fw_file.fw_features))) {
		ret = 1;
		goto exit;
	}

	....

	ret = ath10k_hif_suspend(ar);
  }

So register the PCI PM core to support the suspend/resume if the device
doesn't support remote wakeup.

Signed-off-by: Ryan Hsu <ryanhsu@qti.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2017-08-31 21:16:56 +03:00
Gustavo A. R. Silva a9a65a6b2b rtlwifi: rtl8723be: fix duplicated code for different branches
Refactor code in order to avoid identical code for different branches.

Addresses-Coverity-ID: 1248728
Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
Acked-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2017-08-31 15:59:23 +03:00
Hans de Goede f38966a7ac brcmfmac: Log chip id and revision
For debugging some problems, it is useful to know the chip revision
add a brcmf_info message logging this.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Arend van Spriel <arend.vanspriel@broadcom.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2017-08-31 15:58:39 +03:00
Sergey Matyukevich f31039d4ae qtnfmac: implement 64-bit dma support
Use 64-bit dma for hosts with CONFIG_ARCH_DMA_ADDR_T_64BIT enabled.

Signed-off-by: Sergey Matyukevich <sergey.matyukevich.os@quantenna.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2017-08-31 15:57:40 +03:00
Sergey Matyukevich b00edea3ed qtnfmac: fix free_xfer_buffer cleanup
Check if skb tracking arrays has been already allocated. This additional
check handles the case when init partially failed.

Signed-off-by: Sergey Matyukevich <sergey.matyukevich.os@quantenna.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2017-08-31 15:57:39 +03:00
Sergey Matyukevich bab5dac73c qtnfmac: modify qtnf_map_bar not to return NULL
NULL is not a special type of success here but a error pointer.
So it makes sense to check against NULL in qtnf_map_bar
and return error code.

Signed-off-by: Sergey Matyukevich <sergey.matyukevich.os@quantenna.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2017-08-31 15:57:39 +03:00
Sergey Matyukevich 97f3801145 qtnfmac: module param sanity check
Linux built-in circ_buf implementation assumes that that the
circular buffer length is a power of 2. Make sure that
rx and tx descriptor queue lengths are power-of-2.

Signed-off-by: Sergey Matyukevich <sergey.matyukevich.os@quantenna.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2017-08-31 15:57:38 +03:00
Sergey Matyukevich 57b18a75d9 qtnfmac: drop -D__CHECK_ENDIAN from cflags
Flag -D__CHECK_ENDIAN was wrong: it should be -D__CHECK_ENDIAN__ instead.
However now this flag is enabled by default, so it can be removed.

Signed-off-by: Sergey Matyukevich <sergey.matyukevich.os@quantenna.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2017-08-31 15:57:37 +03:00
Lior David 69fecf599f wil6210: ensure P2P device is stopped before removing interface
User space can remove the P2P management interface while it is active
(for example, while listen/search is active) and this can cause
a crash. Ensure the P2P device is fully stopped before removing.

Signed-off-by: Lior David <qca_liord@qca.qualcomm.com>
Signed-off-by: Maya Erez <qca_merez@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2017-08-31 15:19:54 +03:00
Lior David d83ad4c4fd wil6210: increase connect timeout
Connect can take longer than current timeout in some scenarios,
for example with long-range antenna array. Increase the timeout
to support these scenarios.

Signed-off-by: Lior David <qca_liord@qca.qualcomm.com>
Signed-off-by: Maya Erez <qca_merez@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2017-08-31 15:19:50 +03:00
Dedy Lansky 7086d86175 wil6210: clear PAL_UNIT_ICR part of device reset
When FW starts running it can get D0 to D3 interrupt that is a leftover
from previous system suspend while FW was not running.
As this interrupt is not relevant anymore, clear it part of device reset
procedure.

Signed-off-by: Dedy Lansky <qca_dlansky@qca.qualcomm.com>
Signed-off-by: Maya Erez <qca_merez@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2017-08-31 15:19:45 +03:00
Dedy Lansky 1490846d25 wil6210: move pre-FW configuration to separate function
Re-arrange the code to have dedicated function for device configuration
which takes place before FW starts running.

Signed-off-by: Dedy Lansky <qca_dlansky@qca.qualcomm.com>
Signed-off-by: Maya Erez <qca_merez@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2017-08-31 15:19:40 +03:00
Lazar Alexei 761f8e4d46 wil6210: align to latest auto generated wmi.h
Align to latest version of the auto generated wmi file
describing the interface with FW.

Signed-off-by: Lazar Alexei <qca_ailizaro@qca.qualcomm.com>
Signed-off-by: Maya Erez <qca_merez@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2017-08-31 15:19:35 +03:00
Gidon Studinski 5f591dac9f wil6210: make debugfs compilation optional
Since debugfs is a kernel configuration option, enable the driver to
compile without debugfs.

Signed-off-by: Gidon Studinski <qca_gidons@qca.qualcomm.com>
Signed-off-by: Hamad Kadmany <qca_hkadmany@qca.qualcomm.com>
Signed-off-by: Maya Erez <qca_merez@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2017-08-31 15:19:31 +03:00
Lior David 40cbd88be7 wil6210: ratelimit errors in TX/RX interrupts
Sometimes there is a firmware crash but the hardware
is not fully stopped and continue to send TX/RX interrupts.
This can cause an overload of messages which can bring the
host down. Add ratelimit to these error messages to fix this.

Signed-off-by: Lior David <qca_liord@qca.qualcomm.com>
Signed-off-by: Maya Erez <qca_merez@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2017-08-31 15:19:26 +03:00
Hauke Mehrtens c0cc00f250 ath10k: activate user space firmware loading again
In commit 9f5bcfe933 ("ath10k: silence firmware file probing
warnings") the firmware loading was changed from request_firmware() to
request_firmware_direct() to silence some warnings in case it fails.
request_firmware_direct() directly searches in the file system only and
does not send a hotplug event to user space in case it could not find
the firmware directly.
In LEDE we use a user space script to extract the calibration data from
the flash memory which gets triggered by the hotplug event. This way the
firmware gets extracted from some vendor specific partition when the
driver requests this firmware. This mechanism does not work any more
after this change.

Fixes: 9f5bcfe933 ("ath10k: silence firmware file probing warnings")
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Cc: Michal Kazior <michal.kazior@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2017-08-31 15:15:15 +03:00
Erik Stromdahl 30b83fff6d ath10k: sdio: remove unused struct member
irq_wq in struct ath10k_sdio is a remnant from an earlier
version of the sdio patchset.

Its use was removed as a result of Kalle's review, but somehow
the struct member survived.

It is not used and can therefore safely be removed.

Signed-off-by: Erik Stromdahl <erik.stromdahl@gmail.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2017-08-31 15:14:18 +03:00
Ryan Hsu c9353bf483 ath10k: fix napi_poll budget overflow
In napi_poll, the budget number is used to control the amount of packets
we should handle per poll to balance the resource in the system.

In the list of the amsdu packets reception, we check if there is budget
count left and handle the complete list of the packets, that it will have
chances the very last list will over the budget leftover.

So adding one more parameter - budget_left, this would help while
traversing the list to avoid handling more than the budget given.

Reported-by: Andrey Ryabinin <aryabinin@virtuozzo.com>
Fix-suggested-by: Igor Mitsyanko <igor.mitsyanko.os@quantenna.com>
Link: https://lkml.kernel.org/r/26670dce-4dd2-f8e4-0e14-90d74257e739@virtuozzo.com
Signed-off-by: Ryan Hsu <ryanhsu@qti.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2017-08-31 15:13:18 +03:00
Himanshu Jha 66a3479e12 rsi: remove memset before memcpy
calling memcpy immediately after memset with the same region of memory
makes memset redundant.

Signed-off-by: Himanshu Jha <himanshujha199640@gmail.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2017-08-30 19:51:29 +03:00
Stanislaw Gruszka 83ec489193 rt2800: fix TX_PIN_CFG setting for non MT7620 chips
Since commit 41977e86c9 ("rt2x00: add support for MT7620") we do not
initialize TX_PIN_CFG setting. This cause breakage at least on some
RT3573 devices. To fix the problem patch restores previous behaviour
for non MT7620 chips.

Fixes: 41977e86c9 ("rt2x00: add support for MT7620")
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1480829
Reported-and-tested-by: Jussi Eloranta <jussi.eloranta@csun.edu>
Cc: Daniel Golle <daniel@makrotopia.org>
Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
Acked-by: Daniel Golle <daniel@makrotopia.org>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2017-08-30 19:50:09 +03:00
Dan Carpenter 0270639e89 rsi: missing unlocks on error paths
There is a missing unlock if rsi_find_sta() fails in
rsi_mac80211_ampdu_action() or if we hit the -EINVAL path in
rsi_mac80211_sta_add().

Fixes: 3528608f3a ("rsi: handle station connection in AP mode")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2017-08-30 19:48:32 +03:00
Dan Carpenter fc43867294 rsi: update some comments
These functions don't return -1 on failure.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2017-08-30 19:48:31 +03:00
Emmanuel Grumbach d7a5b3e9e4 iwlwifi: mvm: bump API to 34 for 8000 and up
These devices support -34.ucode, so load it.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2017-08-30 12:30:56 +03:00
David Spinadel eb045e6e03 iwlwifi: mvm: Avoid deferring non bufferable frames
Use bcast station for all non bufferable frames on AP and AD-HOC.

The host is no longer aware of STAs PS status because of buffer
station offload, so we can't rely on mac80211 to toggle on
IEEE80211_TX_CTL_NO_PS_BUFFER bit.

A possible issue with buffering such frames, beside the obvious spec
violation, is when a station disconnects while in PS but the AP isn't
aware of that. In such scenarios the AP won't be able to send probe
responses or auth frames so the STA won't be able to reconnect and
the AP will have a queue hang.

Fixes: 3e56eadfb6 ("iwlwifi: mvm: implement AP/GO uAPSD support")
Signed-off-by: David Spinadel <david.spinadel@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2017-08-30 12:30:56 +03:00
Liad Kaufman 075d8a75da iwlwifi: fix long debug print
There is a debug print that sometimes reaches over
110 chars, thus generating a warning in those cases.
Split the print into two to prevent these cases.

Fixes: 92b0f7b26b ("iwlwifi: split the regulatory rules when the bandwidth flags require it")
Signed-off-by: Liad Kaufman <liad.kaufman@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2017-08-30 12:30:56 +03:00
Luca Coelho 10a54d8196 iwlwifi: pcie: move rx workqueue initialization to iwl_trans_pcie_alloc()
Work queues cannot be allocated when a mutex is held because the mutex
may be in use and that would make it sleep.  Doing so generates the
following splat with 4.13+:

[   19.513298] ======================================================
[   19.513429] WARNING: possible circular locking dependency detected
[   19.513557] 4.13.0-rc5+ #6 Not tainted
[   19.513638] ------------------------------------------------------
[   19.513767] cpuhp/0/12 is trying to acquire lock:
[   19.513867]  (&tz->lock){+.+.+.}, at: [<ffffffff924afebb>] thermal_zone_get_temp+0x5b/0xb0
[   19.514047]
[   19.514047] but task is already holding lock:
[   19.514166]  (cpuhp_state){+.+.+.}, at: [<ffffffff91cc4baa>] cpuhp_thread_fun+0x3a/0x210
[   19.514338]
[   19.514338] which lock already depends on the new lock.

This lock dependency already existed with previous kernel versions,
but it was not detected until commit 49dfe2a677 ("cpuhotplug: Link
lock stacks for hotplug callbacks") was introduced.

Reported-by: David Weinehall <david.weinehall@intel.com>
Reported-by: Jiri Kosina <jikos@kernel.org>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2017-08-24 16:49:00 +03:00
Kalle Valo 5307eca136 Merge git://git.kernel.org/pub/scm/linux/kernel/git/kvalo/wireless-drivers.git
Stephen Rothwell reported quite a few conflicts in iwlwifi between
wireless-drivers and wireless-drivers-next. To avoid any problems later in
other trees merge w-d to w-d-next to fix those conflicts early.
2017-08-24 14:47:42 +03:00
Bhumika Goyal 2c1dca3c6b wireless: ipw2x00: make iw_handler_def const
Make these const as they are only stored in the const field of a
net_device structure.

Signed-off-by: Bhumika Goyal <bhumirks@gmail.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2017-08-24 12:58:17 +03:00
Arvind Yadav 9ea792a48c net: rsi: mac80211: constify ieee80211_ops
ieee80211_ops are not supposed to change at runtime. All functions
working with ieee80211_ops provided by <net/mac80211.h> work with
const ieee80211_ops. So mark the non-const structs as const.

Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2017-08-24 12:57:31 +03:00
Romain Perier 28b75415ad wireless: ipw2200: Replace PCI pool old API
The PCI pool API is deprecated. This commit replaces the PCI pool old
API by the appropriate function with the DMA pool API.

Signed-off-by: Romain Perier <romain.perier@collabora.com>
Reviewed-by: Peter Senna Tschudin <peter.senna@collabora.com>
Acked-by: Stanislav Yakovlev <stas.yakovlev@gmail.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2017-08-24 12:56:45 +03:00
Colin Ian King 2cc8918eb9 rtlwifi: rtl8821ae: fix spelling mistake: "faill" -> "failed"
Trivial fix to spelling mistake in RT_TRACE message

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2017-08-24 12:56:05 +03:00
Christophe Jaillet b3b2f62c62 mt7601u: check memory allocation failure
Check memory allocation failure and return -ENOMEM in such a case, as
already done a few lines below.

As 'dev->tx_q' can be NULL, we also need to check for that in
'mt7601u_free_tx()', and return early.

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Acked-by: Jakub Kicinski <kubakici@wp.pl>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2017-08-24 12:54:33 +03:00
Dan Carpenter d9ee6015e5 rtlwifi: make a couple arrays larger
This is a static checker fix.  "cal_num" is 10.  We're declaring the
tx_dt[] and rx_td[] arrays as 3 element arrays.  The static checker
complains that we do:

	tx_dt[cal] = (vdf_y[1]>>20)-(vdf_y[0]>>20);

"cal" is the iterator and it is in the 0-9 range so it looks like
we could corrupt memory.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Acked-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2017-08-24 12:53:50 +03:00
Gustavo A. R. Silva 14cc696c0a rtlwifi: btcoex: 23b 1ant: fix duplicated code for different branches
Refactor code in order to avoid identical code for different branches.

This issue was detected with the help of Coccinelle.

Addresses-Coverity-ID: 1415177
Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2017-08-24 12:52:22 +03:00
Reizer, Eyal d382b9c007 wlcore: add missing nvs file name info for wilink8
The following commits:
commit c815fdebef ("wlcore: spi: Populate config firmware data")
commit d776fc86b8 ("wlcore: sdio: Populate config firmware data")

Populated the nvs entry for wilink6 and wilink7 only while it is
still needed for wilink8 as well.
This broke user space backward compatibility when upgrading from older
kernels, as the alternate mac address would not be read from the nvs that
is present in the file system (lib/firmware/ti-connectivity/wl1271-nvs.bin)
causing mac address change of the wlan interface.

This patch fix this and update the structure field with the same default
nvs file name that has been used before.

In addition, some distros hold a default wl1271-nvs.bin in the file
system with a bogus mac address (deadbeef...) that overrides the mac
address that is stored inside the device.
Warn users about this bogus mac address and use the internal mac address

Fixes: c815fdebef ("wlcore: spi: Populate config firmware data")
Fixes: d776fc86b8 ("wlcore: sdio: Populate config firmware data")
Signed-off-by: Eyal Reizer <eyalr@ti.com>
Reviewed-by: Sebastian Reichel <sebastian.reichel@collabora.co.uk>
Tested-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2017-08-24 12:51:22 +03:00
Kalle Valo 90bc7dfdcb Merge ath-next from git://git.kernel.org/pub/scm/linux/kernel/git/kvalo/ath.git
ath.git patches for 4.14. Major changes:

ath10k

* initial UBS bus support (no full support yet)

* add tdls support for 10.4 firmware

ath9k

* add Dell Wireless 1802

wil6210

* support FW RSSI reporting
2017-08-24 12:26:17 +03:00
Luca Coelho 8fe34b060a iwlwifi: use big-endian for the hw section of the nvm
Unlike the other sections of the NVM, the hw section is in big-endian.
To read a value from it, we had to cast it to __be16.  Fix that by
using __be16 * for the entire section.

Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2017-08-18 17:36:42 +03:00
Luca Coelho ee4fe54024 iwlwifi: mvm: remove useless check for mvm->cfg in iwl_parse_nvm_section()
At this point we have already copied the cfg pointer to mvm and we
have been dereferencing this pointer many times before, so it will
never be NULL or we would have crashed.  Remove the useless check.

Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2017-08-18 17:36:42 +03:00
Luca Coelho 5bd1d2c1ea iwlwifi: mvm: remove useless argument in iwl_nvm_init()
We always call iwl_nvm_init() with read_nvm_from_nic == true, so this
argument is useless.  Remove it.

Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2017-08-18 17:36:42 +03:00
Luca Coelho 8a0d53ce10 iwlwifi: fw: fix lar_enabled endian problem in iwl_fw_get_nvm
We read the regulatory.lar_enabled field in iwl_fw_get_nvm() and store
it in nvm->lar_enabled, taking care of endianness.  But then later we
read it again to pass the value to iwl_init_sbands() without handling
endianness.  To solve this, simply reuse nvm->lar_enabled when calling
that function.

Fixes: e9e1ba3dbf ("iwlwifi: mvm: support getting nvm data from firmware")
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2017-08-18 17:36:41 +03:00
Luca Coelho 01a9c948a0 iwlwifi: add workaround to disable wide channels in 5GHz
The OTP in some SKUs have erroneously allowed 40MHz and 80MHz channels
in the 5.2GHz band.  The firmware has been modified to not allow this
in those SKUs, so the driver needs to do the same otherwise the
firmware will assert when we try to use it.

Cc: stable@vger.kernel.org
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2017-08-18 17:36:41 +03:00
Gregory Greenman 482e48440a iwlwifi: mvm: change open and close criteria of a BA session
Tx BA session should be started according to the current throughput
without any dependence on the internal rate scaling state. The criteria
for opening a BA session will be 10 frames per second.

Sending frequent del BAs can cause inter-op issues with some APs. We'll
not close a BA session until we receive an explicit del BA from the
peer.

Signed-off-by: Gregory Greenman <gregory.greenman@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2017-08-18 17:24:04 +03:00
Luca Coelho b823cf3bae iwlwifi: update channel flags parser
There are some new flags in the channel flags that we don't know
about.  Also, the "WIDE" flag is very confusing, because it actually
means 20MHz bandwidth, which is not very wide.

Add the new flags and rename the confusing one.

Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2017-08-18 17:13:36 +03:00
Luca Coelho 3f7a5e13e8 iwlwifi: pci: add new PCI ID for 7265D
We have a new PCI subsystem ID for 7265D.  Add it to the list.

Cc: stable@vger.kernel.org
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2017-08-18 17:13:35 +03:00
Tzipi Peres 5f19d6dd81 iwlwifi: distinguish different RF modules in A000 devices
Newer versions of A000 devices come with two diffenent RF modules.
The PCI_ID, the subsystem ID and the RF ID are identical in these two cases,
so we need to differentiate them by using the CSR_HW_RF_ID register-
in order to load the appropriate firmware.

Signed-off-by: Tzipi Peres <tzipi.peres@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2017-08-18 17:13:35 +03:00
Ilan Peer f5d8f50f27 iwlwifi: mvm: Fix channel switch in case of count <= 1
The code did not consider the case that the channel switch counter
is <= 1, which would result with an inaccurate calculation of the
time event apply time.

As the specification states that in case of counter == 0 the switch
occurs at any time after the reception the frame, and for counter == 1
the switch would happens before the next TBTT, schedule the time
event immediately.

Signed-off-by: Ilan Peer <ilan.peer@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2017-08-18 16:16:11 +03:00
João Paulo Rechi Vita 5f5537ac3f iwlwifi: Demote messages about fw flags size to info
These messages are not reporting a real error, just the fact that the
firmware knows about more flags than the driver.

Currently these messages are presented to the user during boot if there
is no bootsplash covering the console, even when booting the kernel with
"quiet".

Demoting it to the warn level helps having a clean boot process.

Signed-off-by: João Paulo Rechi Vita <jprvita@endlessm.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2017-08-18 16:13:18 +03:00
Luca Coelho d91c3fd0ce iwlwifi: move BT_MBOX_PRINT macro to common header
Move the BT_MBOX_PRINT() macro from mvm/debugfs.c to fw/api/coex.h so
it can be reused and remove duplicate definition of BT_MBOX_MSG(),
keeping only the one already in coex.h.

Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2017-08-18 16:10:44 +03:00
Emmanuel Grumbach 114db230d3 iwlwifi: mvm: don't send BAR on flushed frames
When we flush a queue, the packets will have a 'failed'
status but we shouldn't send a BAR. This check was missing.
Because of that, when we got an ampdu_action with
IEEE80211_AMPDU_TX_STOP_FLUSH, we started the following
ping pong with the firmware:

1) Set the station as 'draining'
2) Get a failed Tx status (DRAINED)
3) Send a BAR because of the failed Tx status

(loop of 2 and 3)

This loop wasn't endless since the BAR isn't sent on a
queue that would trigger a "nested" BAR.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2017-08-18 16:10:44 +03:00
Avraham Stern 3edfb5f44b iwlwifi: mvm: remove session protection to allow channel switch
If a time event is already scheduled when trying to schedule one for
channel switch, the code assumes the channel switch is already
scheduled and no further action is required.
However, it is possible that the scheduled time event is actually
for session protection (e.g. when the first beacon after association
contains the CSA IE). In this case the channel switch will not be
scheduled which will finally lead to disconnection.

Fix this by removing the old time event and schduling a new one for
the channel switch.

Signed-off-by: Avraham Stern <avraham.stern@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2017-08-18 16:10:43 +03:00
Emmanuel Grumbach f9cd3e0871 iwlwifi: mvm: update the firmware API in TX
The firmware team is now re-using a bit that hasn't been
used for a few generations. Re-use for TX_ON_AIR drop.
This bit will be set by the firmware to indicate that
a frame in an A-MPDU was dropped but not because of the
already mapped reasons.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2017-08-18 16:06:59 +03:00
Luca Coelho 7ccb498ca8 iwlwifi: mvm: use mvmsta consistently in rs.c
We use mvmsta for the sta->drv_priv in mvm, but in rs.c we have a
bunch of instances using sta_priv, which is probably due to it being
copied from dvm.  Change all occurrences to mvmsta for consistency
with the rest of the driver

Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2017-08-18 16:06:44 +03:00
Luca Coelho 18f1755db7 iwlwifi: mvm: group all dummy SAR function declarations together
We have some of the SAR dummy functions when ACPI is not set declared
in mvm.h and some declared in fw.c.  Group them all together in fw.c
for consistency and to avoid static/non-static issues.

Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2017-08-18 16:06:24 +03:00
Emmanuel Grumbach 790e663433 iwlwifi: mvm: include more debug data when we get an unexpected baid
When we get a valid baid in a received frame, we need to
check that we are aware of this baid. If not, we check
that the OLD_SN bit set. If that's not the case, we issue
a WARNING. Print more data when that happens.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2017-08-18 16:06:07 +03:00
Emmanuel Grumbach 3e73aa3bf9 iwlwifi: mvm: add command name for FRAME_RELEASE
This name was missing in the list.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2017-08-18 16:05:00 +03:00
Emmanuel Grumbach 4ecab56160 iwlwifi: pcie: support short Tx queues for A000 device family
This allows to modify TFD_TX_CMD_SLOTS to a power of 2
which is smaller than 256.
Note that we still need to set values to wrap at 256
into the scheduler's write pointer, but all the rest of
the code can use shorter transmit queues.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2017-08-18 16:04:44 +03:00
Emmanuel Grumbach fbfe378fe4 iwlwifi: mvm: support new Coex firmware API
The firmware now adds more information about time sharing
with the Bluetooth core.
Adapt the API structures and add the new fields in the
debugfs hooks.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2017-08-18 16:03:40 +03:00
Luca Coelho d98d94952a iwlwifi: call iwl_remove_notification from iwl_wait_notification
The iwl_wait_notification() function removes the wait entry from the
list.  To make it clearer that it's doing the same thing as
iwl_remove_notification(), call the latter instead of having duplicate
code.

Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2017-08-18 16:03:22 +03:00
Luca Coelho 00e0c6c8fe iwlwifi: mvm: consider RFKILL during INIT as success
There's no need to differentiate an INIT that ended early because of
RFKILL from one that succeded.  Additionally, if INIT fails later,
during calibration, due to RFKILL, we can just return success and
continue as if we were already in RFKILL to start with.

Remove this unnecessary differentiation and do some other small
clean-ups while at it.

Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2017-08-18 16:02:54 +03:00
Emmanuel Grumbach 64511df45c iwlwifi: mvm: remove the corunning support
The corunning block was supposed to help in coex scenarios.
It required the driver to configure the firmware based on
the coupling between the two antennas of the devices.
This was never in use and the configuration sent by the
driver has always been blank.
Remove all that code.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2017-08-18 15:59:47 +03:00
Prameela Rani Garnepudi 38ef62353a rsi: security enhancements for AP mode
Station id should be set in load key frame configured to device.
For WEP mode, key is configured once from mac80211. This key is
saved and configured to device every time a station is connected.

Signed-off-by: Prameela Rani Garnepudi <prameela.j04cs@gmail.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2017-08-17 10:07:00 +03:00
Prameela Rani Garnepudi 32be57a666 rsi: aggregation parameters frame for AP mode
TX command frame ampdu aggregation parameters is updated to
include sta_id for AP mode.

Signed-off-by: Prameela Rani Garnepudi <prameela.j04cs@gmail.com>
Signed-off-by: Amitkumar Karwar <amit.karwar@redpinesignals.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2017-08-17 10:06:59 +03:00
Prameela Rani Garnepudi 8a1ff83f2b rsi: update tx auto rate command frame for AP mode
Auto rate frame is sent to firmware when a new station is
connected. Station id and station's ht capabilities are updated
in auto rate command frame.

Signed-off-by: Prameela Rani Garnepudi <prameela.j04cs@gmail.com>
Signed-off-by: Amitkumar Karwar <amit.karwar@redpinesignals.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2017-08-17 10:06:58 +03:00
Prameela Rani Garnepudi 6572f054e9 rsi: use common descriptor for auto rate frame
TX command frame auto rate request is modified to use common
descriptor struture.

Signed-off-by: Prameela Rani Garnepudi <prameela.j04cs@gmail.com>
Signed-off-by: Amitkumar Karwar <amit.karwar@redpinesignals.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2017-08-17 10:06:58 +03:00
Prameela Rani Garnepudi 19844c0a9a rsi: data and managemet path changes for AP mode
Station id needs to be get for data and management frames
to fill in the descruptor for AP mode. Few other changes
related to AP mode are covered here.

Signed-off-by: Prameela Rani Garnepudi <prameela.j04cs@gmail.com>
Signed-off-by: Amitkumar Karwar <amit.karwar@redpinesignals.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2017-08-17 10:06:57 +03:00
Prameela Rani Garnepudi 571b050b42 rsi: handle station disconnection in AP mode
When sta_remove of mac80211 is called, driver iterates through
list of existing stations to get the station id. Then peer notify
is prepared and send to firmare.

Signed-off-by: Prameela Rani Garnepudi <prameela.j04cs@gmail.com>
Signed-off-by: Amitkumar Karwar <amit.karwar@redpinesignals.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2017-08-17 10:06:57 +03:00