John Linville [Mon, 10 Aug 2015 16:05:39 +0000 (12:05 -0400)]
mwl8k: refactor some conditionals for clarity
CC [M] drivers/net/wireless/mwl8k.o
drivers/net/wireless/mwl8k.c: In function ‘mwl8k_bss_info_changed’:
drivers/net/wireless/mwl8k.c:3290:2: warning: ‘ap_mcs_rates’ may be used uninitialized in this function [-Wmaybe-uninitialized]
memcpy(cmd->mcs_set, mcs_rates, 16);
^
drivers/net/wireless/mwl8k.c:4987:5: note: ‘ap_mcs_rates’ was declared here
u8 ap_mcs_rates[16];
^
The warning was bogus. But the conditionals were rather complicated,
with multiple redundant checks. This consolidates the checking and
makes it more readable IMHO.
Signed-off-by: John W. Linville <linville@tuxdriver.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
rtlwifi: rtl8192cu: Remove and replace routine in hw.c and mac.c
I remove duplicated routines which related rtl92cu_set_hw_reg().
1. rtl92c_set_qos() and HW_VAR_AC_PARAM routine are similar code.
so i replace code with rtlpriv->cfg->ops->set_hw_reg().
2. rtl92c_set_mac_addr() and 'HW_VAR_ETHER_ADDR' case at
rtl92cu_set_hw_reg() routine are similar code.
so i removed rtl92c_set_mac_addr() function.
also it was not used anywhere.
3. remove HW_VAR_ACM_CTRL routine in rtl92cu_set_hw_reg().
if rtl_usb->acm_method is not EACMWAY2_SW, HW_VAR_ACM_CTRL is called
from HW_VAR_AC_PARAM. but it never called. because acm_method is always
EACMWAY2_SW. so i remove acm_method check routine
and HW_VAR_ACM_CTRL routine.
both usb and pci interface is not used HW_VAR_ACM_CTRL.
but i can't test pci interface module, so i didn't modify pci code.
Signed-off-by: Taehee Yoo <ap420073@gmail.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Taehee Yoo [Mon, 30 Mar 2015 15:55:32 +0000 (00:55 +0900)]
rtlwifi: rtl8192cu: remove duplicated routine in hw.c and mac.c
rtl92c_set_xxx_filter is same routine with rtl92cu_set_hw_reg.
so i remove those functions that are rtl92c_set_xxx_filter.
(rtl92c_get_xxx_filter is also same reason.)
also i add code updating struct rtl_mac member variable in the
rtl92cu_set_hw_reg.
after that, no more _update_mac_setting is not useful. thus i remove that.
Signed-off-by: Taehee Yoo <ap420073@gmail.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Kalle Valo [Mon, 17 Aug 2015 08:23:03 +0000 (11:23 +0300)]
Merge ath-next from ath.git. Major changes in ath10k:
* add support for qca99x0 family of devices
* improve performance of tx_lock
* add support for raw mode (802.11 frame format) and software crypto
engine enabled via a module parameter
wil6210:
* implement TSO support
* support bootloader v1 and onwards
Johannes Berg [Mon, 13 Jul 2015 10:17:25 +0000 (12:17 +0200)]
average: provide macro to create static EWMA
Having the EWMA parameters stored in the runtime struct imposes
memory requirements for the constant values that could just be
inlined in the code. This particularly makes sense if there are
a lot of such structs, for example in mac80211 in the station
table where each station has a number of these in an array, and
there can be many stations.
Provide a macro DECLARE_EWMA() that declares the necessary struct
and inline functions to access it with the parameters hard-coded;
using this also means the user no longer needs to 'select AVERAGE'
as it's entirely self-contained.
In the mac80211 case, on x86-64, this actually slightly *reduces*
code size, while also saving 80 bytes of runtime memory per sta.
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Su Kang Yin [Fri, 7 Aug 2015 08:54:10 +0000 (16:54 +0800)]
mac80211_hwsim: unregister genetlink family properly
During hwsim_init_netlink(), we should call genl_unregister_family()
if failed on netlink_register_notifier() since the genetlink is
already registered.
Signed-off-by: Su Kang Yin <cantona@cantona.net> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
mac80211: remove ieee80211_tx_rate dependency in rate mask code
Remove ieee80211_tx_rate dependency in rate_idx_match_legacy_mask(),
rate_idx_match_mcs_mask() and rate_idx_match_mask() in order to use the
previous logic to define a ratemask in rate_control_set_rates() for
station rate table. Moreover move rate mask definition logic in
rate_control_cap_mask()
Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi83@gmail.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
mac80211: remove ieee80211_tx_info from rate_control_apply_mask signature
Remove unnecessary ieee80211_tx_info pointer from rate_control_apply_mask
signature. rate_control_apply_mask() will be used to define a ratemask in
rate_control_set_rates() for station rate table
Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi83@gmail.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Currently OCB mode accepts frames with bssid==broadcast and type!=beacon.
Some non-data frames are sent matching this, for example probe responses.
This results in unnecessary creation of STA entries.
Signed-off-by: Bertold Van den Bergh <bertold.vandenbergh@esat.kuleuven.be> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
To make mac80211 accept the multicast rate requested by the user the
rate control should be told that it is operating in BSS mode.
Without this, the default rate is selected in rate_control_send_low
(!pubsta and !txrc->bss)
Signed-off-by: Bertold Van den Bergh <bertold.vandenbergh@esat.kuleuven.be> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Michal Kazior [Mon, 3 Aug 2015 08:55:24 +0000 (10:55 +0200)]
cfg80211: propagate set_wiphy failure to userspace
If driver failed to setup wiphy params (e.g. rts
threshold, fragmentation treshold) userspace
wasn't properly notified about this. This could
lead to user confusion who would think the command
succeeded even if that wasn't the case.
Signed-off-by: Michal Kazior <michal.kazior@tieto.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Matthias May [Fri, 17 Jul 2015 13:28:39 +0000 (15:28 +0200)]
cfg80211: regulatory: handle 5 and 10 MHz channels properly
The original assumption of 20MHz wide channels hasn't been true since
the addition of support for 5 and 10 MHz channels.
Change the code to no longer disable all channels that don't fit into
the 20MHz grid, but instead set the appropriate flags to disable
operation on specific bandwidths.
Signed-off-by: Matthias May <matthias.may@neratec.com>
[reword commit message] Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Jes Sorensen [Thu, 6 Aug 2015 16:46:31 +0000 (12:46 -0400)]
orinoco: Do not call wiphy_unregister() from free_orinocodev()
alloc_orinocodev() would allocate the wiphy entry, but it would only get
registered much later in orinoco_init(). If something failed in the init
process inbetween the call to alloc_orinocodev() and the completion
of orinoco_init(), the drivers would end up calling wiphy_unregister()
with a NULL pointer causing beautiful OOPS fireworks.
Explicitly call wiphy_unregister() instead in the right places.
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
mwifiex: claim sdio bus while downloading the firmware
Our 8887 A2 chip can have separate firmware images for
bluetooth and WLAN. We observed an issue during parallel
downloading of these images by btmrvl and mwifiex drivers.
This patch claims sdio bus before starting of the firmware
download in mwifiex and releases it after completion to
fix the problem.
Signed-off-by: Aniket Nagarnaik <aniketn@marvell.com> Signed-off-by: Amitkumar Karwar <akarwar@marvell.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Zhaoyang Liu [Wed, 5 Aug 2015 13:09:41 +0000 (06:09 -0700)]
mwifiex: add firmware dump support for SD8997
This patch adds firmware dump feature for SD8997 chipset.
The difference here is only one memory type is needed
to save all firmware information. Device dump information
will be uploaded to usersapace file.
Signed-off-by: Zhaoyang Liu <liuzy@marvell.com> Signed-off-by: Cathy Luo <cluo@marvell.com> Signed-off-by: Amitkumar Karwar <akarwar@marvell.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Zhaoyang Liu [Wed, 5 Aug 2015 13:09:40 +0000 (06:09 -0700)]
mwifiex: add support for 8997 chipset
This patch adds support for 8997 chipset to mwifiex
with SDIO/PCIe/USB interface.
The corresponding firmware image files are located in:
"mrvl/sd8997_uapsta.bin"
"mrvl/pcie8997_uapsta.bin"
"mrvl/usb8997_uapsta.bin"
Signed-off-by: Zhaoyang Liu <liuzy@marvell.com> Signed-off-by: Cathy Luo <cluo@marvell.com> Signed-off-by: Amitkumar Karwar <akarwar@marvell.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Dan Carpenter [Tue, 4 Aug 2015 07:49:27 +0000 (10:49 +0300)]
mwifiex: usb: return an error if kmalloc fails
The current code returns success if kmalloc fails.
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Acked-by: Amitkumar Karwar <akarwar@marvell.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Larry Finger [Mon, 3 Aug 2015 21:15:53 +0000 (16:15 -0500)]
rtlwifi: rtl8192c-common: Fix two typos
In this driver, two variables are masked by one quantity, and then tested
against a second number with more bits that the mask. Accordingly, the
test always fails. To minimize the possibility of such typos, a symbolic
definition of the mask is created and used.
The separate load and mask operations are also combined into a single
statement.
Reported-by: David Binderman <dcb314@hotmail.com> Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net> Cc: David Binderman <dcb314@hotmail.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
This driver is converted to use the common firmware header struct.
Because the old header definition failed to indicate that the multi-byte
entries should be little endian, several problems were thus exposed.
These are fixed.
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
This driver is converted to use the common firmware header struct.
Because the old header definition failed to indicate that the multi-byte
entries should be little endian, several problems were thus exposed.
These are fixed.
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
This driver is converted to use the common firmware header struct.
Because the old header definition failed to indicate that the multi-byte
entries should be little endian, several problems were thus exposed.
These are fixed.
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Larry Finger [Mon, 3 Aug 2015 20:56:13 +0000 (15:56 -0500)]
rtlwifi: rtl8821ae: Fix firmware endian issues
This driver is converted to use the common firmware header struct.
Because the old header definition failed to indicate that the multi-byte
entries should be little endian, several problems were thus exposed.
These are fixed.
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
The drivers are converted to use the common firmware header struct.
Because the old header definition failed to indicate that the multi-byte
entries should be little endian, several problems were thus exposed.
These are fixed.
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Larry Finger [Mon, 3 Aug 2015 20:56:11 +0000 (15:56 -0500)]
rtlwifi: rtl8192ce: rtl8192cu: Fix endian issue
Commit e996db69833a (rtlwifi: rtl8192c: Add init codes for "fw_version"
and "fw_subversion") added initialization for fw_version, but failed to
note that the variable in the firmware header is little-endian. The
following Sparse warning results:
CHECK drivers/net/wireless/rtlwifi/rtl8192c/fw_common.c
drivers/net/wireless/rtlwifi/rtl8192c/fw_common.c:242:36: warning: incorrect type in assignment (different base types)
drivers/net/wireless/rtlwifi/rtl8192c/fw_common.c:242:36: expected unsigned short [unsigned] [usertype] fw_version
drivers/net/wireless/rtlwifi/rtl8192c/fw_common.c:242:36: got restricted __le16 [usertype] version
When fixing this problem, I noticed that several of the drivers contain
nearly identical copies of the firmware header struct, and that only the one
used in rtl8192c{e,u} had correct endian notation. The struct has been
moved into a common header, and the other drivers will be fixed in
subsequant patches.
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
ath9k: match wait_for_completion_timeout return type
Return type of wait_for_completion_timeout is unsigned long not int.
As time_left is exclusively used for wait_for_completion_timeout here its
type is simply changed to unsigned long.
API conformance testing for completions with coccinelle spatches are being
used to locate API usage inconsistencies:
./drivers/net/wireless/ath/ath9k/link.c:197
int return assigned to unsigned long
Patch was compile tested with x86_64_defconfig + CONFIG_ATH_CARDS=m,
Patch is against 4.1-rc3 (localversion-next is -next-20150514)
Signed-off-by: Nicholas Mc Guire <hofrat@osadl.org> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
ath9k_htc: wmi: match wait_for_completion_timeout return type
Return type of wait_for_completion_timeout is unsigned long not int.
As time_left is exclusively used for wait_for_completion_timeout here its
type is simply changed to unsigned long.
API conformance testing for completions with coccinelle spatches are being
used to locate API usage inconsistencies:
./drivers/net/wireless/ath/ath9k/wmi.c:331
int return assigned to unsigned long
Patch was compile tested with x86_64_defconfig + CONFIG_ATH_CARDS=m,
CONFIG_ATH9K_HTC=m
Patch is against 4.1-rc3 (localversion-next is -next-20150514)
Signed-off-by: Nicholas Mc Guire <hofrat@osadl.org> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
ath9k_htc: drv_init: match wait_for_completion_timeout return type
Return type of wait_for_completion_timeout is unsigned long not int.
As time_left is exclusively used for wait_for_completion_timeout here its
type is simply changed to unsigned long.
API conformance testing for completions with coccinelle spatches are being
used to locate API usage inconsistencies:
./drivers/net/wireless/ath/ath9k/htc_drv_init.c:81
int return assigned to unsigned long
Patch was compile tested with x86_64_defconfig + CONFIG_ATH_CARDS=m,
CONFIG_ATH9K_HTC=m
Patch is against 4.1-rc3 (localversion-next is -next-20150514)
Signed-off-by: Nicholas Mc Guire <hofrat@osadl.org> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
ath9k_htc: match wait_for_completion_timeout return type
Return type of wait_for_completion_timeout is unsigned long not int.
As time_left is exclusively used for wait_for_completion_timeout here its
type is simply changed to unsigned long.
API conformance testing for completions with coccinelle spatches are being
used to locate API usage inconsistencies:
./drivers/net/wireless/ath/ath9k/htc_hst.c:171
int return assigned to unsigned long
./drivers/net/wireless/ath/ath9k/htc_hst.c:277
int return assigned to unsigned long
./drivers/net/wireless/ath/ath9k/htc_hst.c:206
int return assigned to unsigned long
Patch was compile tested with x86_64_defconfig + CONFIG_ATH_CARDS=m,
CONFIG_ATH9K_HTC=m
Patch is against 4.1-rc3 (localversion-next is -next-20150514)
Signed-off-by: Nicholas Mc Guire <hofrat@osadl.org> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Michal Kazior [Wed, 5 Aug 2015 10:15:24 +0000 (12:15 +0200)]
ath10k: fix peer limit enforcement
Firmware peer entries are involved in internal
firmware vdev structures. This was not accounted
for and could lead firmware to crash due to asking
it to do more than it could.
Fixes: 039a0051ec1a ("ath10k: allocate fw resources for iface combinations") Signed-off-by: Michal Kazior <michal.kazior@tieto.com> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
Michal Kazior [Wed, 5 Aug 2015 10:15:23 +0000 (12:15 +0200)]
ath10k: don't remove peer that doesn't exist
If peer creation failed during offchannel Tx the
driver attempted to delete the peer nonetheless.
This caused the ar->num_peers counter to be
incorrectly decremented. This subsequently could
cause the counter to drop below 0 and also
eventually lead to firmware crash because host
would think there are less peer entries created in
firmware then there really were.
Signed-off-by: Michal Kazior <michal.kazior@tieto.com> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
Michal Kazior [Wed, 5 Aug 2015 10:08:38 +0000 (12:08 +0200)]
ath10k: fix hw reconfig on wow failure
When WoWLAN resume fails with retval 1 mac80211
will attempt to reconfig the device in a similar
manner when hw restart is requested. This wasn't
handled properly and yielded call trace warnings
and the device ended up not working.
Signed-off-by: Michal Kazior <michal.kazior@tieto.com> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
Michal Kazior [Wed, 5 Aug 2015 04:55:37 +0000 (06:55 +0200)]
ath10k: initialize fw_features var
If firmware did not have any feature flags set the
var would be left with values found on the stack
(i.e. garbage) yielding print string like this:
(...) features \xffffffa6m:^R\xfffffffbԂ\xffffffc4^E
Fixes: b27bc5a40f91 ("ath10k: dump fw features during probing") Signed-off-by: Michal Kazior <michal.kazior@tieto.com> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
Vivek Natarajan [Tue, 4 Aug 2015 05:15:11 +0000 (10:45 +0530)]
ath10k: Support different txbf configuration schemes
qca61x4 uses the vdev param as a sole sufficient configuration
for txbf while qca99x0 enables txbf during peer assoc by
combining the vdev param value with peer assoc's vht capabilities
This patch gets the appropriate txbf configuration scheme
before passing the wmi command to enable the same in the firmware.
Signed-off-by: Vivek Natarajan <nataraja@qti.qualcomm.com> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
Michal Kazior [Mon, 3 Aug 2015 09:16:43 +0000 (11:16 +0200)]
ath10k: reject 11b tx fragmentation configuration
Even though there's a WMI enum for fragmentation
threshold no known firmware actually implements
it. Moreover it is not possible to rely frame
fragmentation to mac80211 because firmware clears
the "more fragments" bit in frame control making
it impossible for remote devices to reassemble
frames.
Hence implement a dummy callback just to say
fragmentation isn't supported. This effectively
prevents mac80211 from doing frame fragmentation
in software.
This fixes Tx becoming broken after setting
fragmentation threshold.
Fixes: 1010ba4c5d1c ("ath10k: unregister and remove frag_threshold callback") Signed-off-by: Michal Kazior <michal.kazior@tieto.com> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
Commit 1010ba4c5d1c ("ath10k: unregister and
remove frag_threshold callback") didn't remove all
instances of (futile) fragmentation threshold
configuration. No known firmware supports the
parameter so don't even bother setting it.
Signed-off-by: Michal Kazior <michal.kazior@tieto.com> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
Dan Carpenter [Mon, 27 Jul 2015 08:11:11 +0000 (11:11 +0300)]
mac80211: remove always true condition
The outside if statement checks that IEEE80211_TX_INTFL_MLME_CONN_TX is
set so this condition is always true. Checking twice upsets the static
checkers.
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Johannes Berg [Fri, 19 Jun 2015 08:20:10 +0000 (10:20 +0200)]
iwlwifi: mvm: don't set K1/K2 for AES-CMAC
According to firmware engineers, the firmware has never required
these fields and the values have always been calculated, they were
just leftovers from a previous implementation.
Therefore remove the unnecessary calculation.
Reviewed-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
rfkill: Allow compile test of GPIO consumers if !GPIOLIB
The GPIO subsystem provides dummy GPIO consumer functions if GPIOLIB is
not enabled. Hence drivers that depend on GPIOLIB, but use GPIO consumer
functionality only, can still be compiled if GPIOLIB is not enabled.
Relax the dependency on GPIOLIB if COMPILE_TEST is enabled, where
appropriate.
Hauke Mehrtens [Sun, 2 Aug 2015 18:26:52 +0000 (20:26 +0200)]
bcma: fix access to host_pdev for PCIe devices
bus->host_pdev is part of a union so bus->host_pdev != NULL is probably
also true for PCIe devices, because there it accesses bus->host_pci. If
we access the dev member at the offset defined in struct
platform_device in struct pci_dev instead we probably get something
else.
This patch adds a new function which returns the host dev struct and
NULL if we do not have a host dev. When this gets registered on MIPS
brcm47xx we do not have a host dev in some situations.
This function could also be used in other places.
This problem was introduced in this commit:
commit cae761b5a6bdc597ba476a040fdcd5b4bc559b85
Author: Rafa? Mi?ecki <zajec5@gmail.com>
Date: Sun Jun 28 17:17:13 2015 +0200
bcma: populate bus DT subnodes as platform_device-s
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Jakub Kicinski [Fri, 31 Jul 2015 13:04:48 +0000 (15:04 +0200)]
mt7601u: fix tx status reporting contexts
mac80211 requires that rx path does not run concurrently with
tx status reporting. Since rx path is run in driver tasklet,
tx status cannot be reported directly from interrupt context
(there would be no way to lock it out).
Add tasklet for tx and move all possible code from irq handler
there.
Note: tx tasklet is needed because workqueue is queued very
rarely and that kills TCP performance.
Signed-off-by: Jakub Kicinski <kubakici@wp.pl> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Jakub Kicinski [Fri, 31 Jul 2015 13:04:46 +0000 (15:04 +0200)]
mt7601u: fix dma from stack address
DMA to variables located on the stack is a bad idea.
For simplicity and to avoid frequent allocations create
a buffer inside the device structure. Protect this
buffer with vendor_req_mutex. Don't protect vendor
requests which don't use this buffer.
Signed-off-by: Jakub Kicinski <kubakici@wp.pl> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
When starting a p2p mgmt interface, enable its device role. This
allows us to keep the sta role disabled and scan on the dev role.
In general, p2p management interfaces cannot send vif-specific commands
to FW, as the vif role id is invalid. Only off-channel data and scans
happen on this vif, so most ops are not relevant.
If the vif is a p2p mgmt vif, block some mac80211 ops.
Configure rate policies for p2p mgmt interface, as
otherwise p2p packets come out with arbitrary rates.
Since wpa_supplicant currently doesn't support standalone
p2p device mode (without another attached managed interface),
add p2p device to the allowed interface combinations without
decreasing the allowed station count.
Moreover, increase the station count in some cases, as AP
mode usually starts as station interface, and the AP interface
is now different from the p2p management one).
Signed-off-by: Arik Nemtsov <arik@wizery.com> Signed-off-by: Eliad Peller <eliad@wizery.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Added support for a new time sync event
the event data contains the WiLink TSF value.
To trigger the event, a HW modification is required,
so as a supporting firmware binary.
Signed-off-by: Yaniv Machani <yanivma@ti.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
mwifiex: correct TDLS link delete failure message priority
Commit d8d2f19feb16 ("mwifiex: silence TDLS link delete failure
for nonexistent link") lowers the priority of error message when
TDLS link is already deleted. But it had got increased by
commit acebe8c10a6e ("mwifiex: change dbg print func to
mwifiex_dbg")
Reported-by: Nicholas Mc Guire <der.herr@hofr.at> Signed-off-by: Amitkumar Karwar <akarwar@marvell.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Felix Fietkau [Thu, 6 Aug 2015 10:44:30 +0000 (12:44 +0200)]
ath9k: fix build with CONFIG_ATH9K_STATION_STATISTICS=y
kbuild bot reported that commit 592fa228f213 ("ath9k: remove struct
ath_atx_ac") broke the build when CONFIG_ATH9K_STATION_STATISTICS is y.
Reported-by: kbuild test robot <fengguang.wu@intel.com> Fixes: 592fa228f213 ("ath9k: remove struct ath_atx_ac") Signed-off-by: Felix Fietkau <nbd@openwrt.org> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Kalle Valo [Thu, 6 Aug 2015 07:27:59 +0000 (10:27 +0300)]
Merge tag 'iwlwifi-next-for-kalle-2015-08-04' of https://git.kernel.org/pub/scm/linux/kernel/git/iwlwifi/iwlwifi-next
* Deprecate -10.ucode
* Clean ups towards multiple Rx queues
* Add support for longer CMD IDs. This will be required by new
firmwares since we are getting close to the u8 limit.
* bugfixes for the D0i3 power state
* Add basic support for FTM
* More random that doesn't really stand out
mwifiex: add missing skb_push() in mwifiex_check_uap_capabilties
For PCIe/USB chipsets, preallocated skb buffers are reused for
event handling. mwifiex_check_uap_capabilties() performs
skb_pull(). This patch adds missing skb_push() to restore skb's
data pointer/length.
This bug was introduced by commit debfc6008169 ("mwifiex: update
AP WMM settings from BSS_START event")
Signed-off-by: Amitkumar Karwar <akarwar@marvell.com> Signed-off-by: Nishant Sarmukadam <nishants@marvell.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Preallocated event SKBs are getting reused for PCIe chipset.
Their physical addresses are shared with firmware so that
firmware can write data into them.
This patch makes sure that SKB is cleared and length is set to
default while submitting it to firmware.
Signed-off-by: Amitkumar Karwar <akarwar@marvell.com> Signed-off-by: Zhaoyang Liu <liuzy@marvell.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Zhaoyang Liu [Wed, 22 Jul 2015 11:53:44 +0000 (04:53 -0700)]
mwifiex: fix system crash observed during initialisation
System crash was observed if one of the driver initialisation
commands is timed out. The reason is our timeout handler triggers
firmware dump, meanwhile driver initialisation error paths have
already freed the adapter structure.
Firmware hasn't yet completely initialized. So collecting firmware
dump is not needed in this case. Command timeout handler is
modified in this patch to fix the crash issue.
Signed-off-by: Zhaoyang Liu <liuzy@marvell.com> Signed-off-by: Amitkumar Karwar <akarwar@marvell.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Zhaoyang Liu [Wed, 22 Jul 2015 11:53:43 +0000 (04:53 -0700)]
mwifiex: fix command timeout for PCIe chipsets
When WLAN interface is up and running, driver unload and
load was causing command timeout error.
We enable Rx data by updating RX ring read pointer in
init_fw_port(). It should be done when FW is completely
intialialised. Command timeout is fixed in this patch by
moving init_fw_port() call to mwifiex_init_fw_complete().
Signed-off-by: Zhaoyang Liu <liuzy@marvell.com> Signed-off-by: Amitkumar Karwar <akarwar@marvell.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Xinming Hu [Wed, 22 Jul 2015 11:53:42 +0000 (04:53 -0700)]
mwifiex: using right aid value for tdls action frame
Variable pos is u8 here, so memcpy is needed to store u16 aid.
At the same time, aid should be platform independent, upper layer
utility(wpa_supplicant,etc.,) parse it as le16, so keep it le16
here.
Signed-off-by: Xinming Hu <huxm@marvell.com> Signed-off-by: Amitkumar Karwar <akarwar@marvell.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Felix Fietkau [Wed, 22 Jul 2015 11:06:13 +0000 (13:06 +0200)]
ath9k: remove struct ath_atx_ac
struct ath_atx_ac contains a list of active TIDs belonging to one WMM AC.
This patch changes the code to track active station TIDs in the txq directly.
Signed-off-by: Felix Fietkau <nbd@openwrt.org> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
This fix problem we didn't configure rxfilter, next
didn't receive probe requests and next failed
p2p_find. This was seen when ath9k loaded with
use_chanctx=1
Signed-off-by: Janusz Dziedzic <janusz.dziedzic@tieto.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Andreas Fenkart [Fri, 17 Jul 2015 07:13:06 +0000 (09:13 +0200)]
mwifiex: simplify mwifiex_complete_cmd
600f5d909a54("mwifiex: cleanup ioctl wait queue and abstraction layer")
introduced the wakeup_interruptible suppression in mwifiex_complete_cmd b1a47aa5e1e1("mwifiex: fix system hang issue in cmd timeout error case")
then added wakup_interruptible to mwifiex_cmd_timeout_func the single
place setting a status of ETIMEDOUT.
Instead of doing extra work, using the standard call-chain will have the
same effect:
mwifiex_cancel_pending_ioctl
-> mwifiex_recycle_cmd_node
-> mwifiex_insert_cmd_to_free_q
-> mwifiex_complete_cmd
-> wake_up_interruptible
The difference is that previously the condition was not set to true,
but that's probably just an oversight in b1a47aa5e1e1 and shouldn't
have any consequence
Signed-off-by: Andreas Fenkart <afenkart@gmail.com> Acked-by: Amitkumar Karwar <akarwar@marvell.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Andreas Fenkart [Fri, 17 Jul 2015 07:13:05 +0000 (09:13 +0200)]
mwifiex: remove CMD_F_CANCELED flag
CMD_F_CANCELED was used to abort mwifiex_process_cmdresp in
case it already started or starts processing the cmd.
But this was probably not working the way intended:
- it is racy: mwifiex_process_cmdresp might already have passed that
test and is continuing to use the cmd node being recycled
- mwifiex_process_cmdresp repeatedly uses adapter->curr_cmd which
we just set to NULL
- mwifiex_recycle_cmd_node will clear the flag
The reason why it probably works is that mwifiex_cancel_pending_ioctl
is only called from mwifiex_cmd_timeout_func, where the there is little
chance of a command response still arriving
Signed-off-by: Andreas Fenkart <afenkart@gmail.com> Acked-by: Amitkumar Karwar <akarwar@marvell.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Andreas Fenkart [Fri, 17 Jul 2015 07:13:04 +0000 (09:13 +0200)]
mwifiex: remove redundant reset of cmd_wait_q status
mwifiex_cancel_pending_ioctl is called only from
mwifiex_cmd_timeout_func. There the wait_q status is set to
-ETIMEDWAIT before calling this function. Whether we reset the status
to -1 or leave it at -ETIMEDWAIT at end doesn't matter since both
are != 0 hence mean failure
Signed-off-by: Andreas Fenkart <afenkart@gmail.com> Acked-by: Amitkumar Karwar <akarwar@marvell.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Andreas Fenkart [Thu, 16 Jul 2015 16:50:01 +0000 (18:50 +0200)]
mwifiex: sdio: reset adapter using mmc_hw_reset
Since 1fb654fd97ff("mmc: sdio: add reset callback to bus operations"),
sdio cards can be power cycled using mmc_hw_reset.
The use mmc_remove_host/mmc_add_host is discouraged, because these are
internal functions to the mmc core and should only be used by mmc hosts
Signed-off-by: Andreas Fenkart <afenkart@gmail.com> Acked-by: Amitkumar Karwar <akarwar@marvell.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Support for the system suspend/resume.
In preparation for the run-time PM, implementation made
run-time PM friendly: common for system and run-time PM
code factored out as generic functions, albeit is_runtime
parameter value is always false currently.
For debug purposes, "PM" debug category introduced.
Policy: AP-like interface can't be suspended; otherwise
suspend is allowed. Hardware brought down if interface
was up. Connection, if existed, get lost.
Interface will be brought up upon resume if it was up
before suspend.
Signed-off-by: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
Vladimir Shulman [Thu, 30 Jul 2015 10:52:04 +0000 (13:52 +0300)]
wil6210: allow to handle Rx on 2 cores
Allow network stack part of Rx processing to run on separate core,
relaxing CPU utilization on the core used for Rx NAPI.
If RXHASH feature is enabled, the driver sets rxhash of each skb to 1
to enable RPS. The core for processing the rx skb is determined by RPS
mechanism according to rx_cpus bit mask which is configured at user level.
For processing skbs on different core from the core which processes
the interrupts, it is recommended not to enable core 0 in rx_cpus bit mask.
Signed-off-by: Vladimir Shulman <QCA_shulmanv@QCA.qualcomm.com> Signed-off-by: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
In the recent kernel versions, multiple MSI is not well supported.
In particular, it is not supported on x86 and ARM architectures.
Also, internal interrupt handling logic is simpler and
more effective when using single interrupt.
Remove support for 3 MSI, convert module parameter
"use_msi" from int with range [0,1,3] to boolean.
Signed-off-by: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
Rx drops may be for 2 reasons: frame is old,
or it is duplicate. On the debugfs "stations" entry,
provide counters per reorder buffer for total
frames processed, drops for these 2 reasons.
Also add debug print for dropped frames.
Signed-off-by: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
wil6210: treat "unhandled event" as warning instead of error
FW is allowed to generate WMI events that are not handled by this driver.
Treat such case as warning instead of error.
Signed-off-by: Dedy Lansky <qca_dlansky@qca.qualcomm.com> Signed-off-by: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
Driver report supported TSO (v4 & v6) and IP checksum offload
in addition to previously supported features. In data path
skbs are checked for non-zero gso_size, and when detected sent
to additional function for processing TSO SKBs. Since HW does not
fully support TSO, additional effort is required from the driver.
Driver partitions the data into mss sized descriptors which are
then DMAed to the HW.
Signed-off-by: Vladimir Shulman <QCA_shulmanv@QCA.qualcomm.com> Signed-off-by: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>