Commit graph

490 commits

Author SHA1 Message Date
Dan Carpenter b86aeb502a ath6kl: fix an indenting issue
This is supposed to be pushed in one indent level.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2012-04-23 14:37:07 +03:00
Dan Carpenter 3acabc8807 ath6kl: change || to &&
The original conditions are always true.  I think && was intended here,
but I don't have the hardware to test.  Could you take a look?

kvalo: Chilam confirmed that the fix is valid

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2012-04-23 14:36:34 +03:00
Thomas Pedersen 77ed4e4583 ath6kl: disallow WoW with multiple vifs
The ath6kl fw does not have enough memory to support the WoW filters of
more than one vif. Disallow WoW suspend if this is the case.

Signed-off-by: Thomas Pedersen <c_tpeder@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2012-04-23 14:30:35 +03:00
Thomas Pedersen 37a2f950ac ath6kl: only restore supported HT caps
Now that we know the supported PHY capabilities, only restore supported
bands / HT capabilities in firmware when stopping AP.

Signed-off-by: Thomas Pedersen <c_tpeder@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2012-04-23 14:28:02 +03:00
Thomas Pedersen d92917e4db ath6kl: support fw reporting phy capabilities
Currently the supported bands are just hard coded in the driver.
However, the ath6kl FW will include its 11n and band capabilites in a
WMI_READY event. Handle this and report capabilites to cfg80211
accordingly.

Signed-off-by: Thomas Pedersen <c_tpeder@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2012-04-23 14:28:00 +03:00
Ming Jiang 5699257f69 ath6kl clear the MMC_PM_KEEP_POWER for cutpower case
ath6kl: If wow deepsleep pno suspend failure driver will choose cutpower.
in this scenario MMC_PM_KEEP_POWER should be cleared so that mmc will power
off the ar6000

kvalo: remove extra parenthesis

Signed-off-by: Ming Jiang <mjiang@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2012-04-23 14:25:34 +03:00
Jouni Malinen 3b8ffc6a22 ath6kl: Configure probed SSID list consistently
Set max_scan_ssids and max_sched_scan_ssids to same value. These use the
same probed SSID list, so there is no point in using different maximum
number of SSIDs.

Clear probed SSID entries that are not used. This was already done for
sched_scan, but not for scan. Be consistent and clear the table for both
cases to avoid leaving bogus entries.

In addition, share the same function for setting the probed SSIDs for
scan and sched_scan paths. This fixes setting of wildcard SSID flag
(ANY_SSID_FLAG) and changes the scan path to use probed SSID index
consistently (i.e., start with 0 similarly to sched_scan; firmware
will handle the needed internal mapping).

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2012-04-18 13:12:26 +03:00
Jouni Malinen a432e7cc4f ath6kl: Remove incorrect Probe Response offload support for Interworking
ath6kl does not support Probe Response offloading for Interworking (IEEE
802.11u), so remove the incorrectly added capability flag for it.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2012-04-18 13:10:04 +03:00
Subramania Sharma Thandaveswaran d472b5e43d ath6kl: Fix bug in bg scan configuration in schedule scan
Background scan interval should not be modified while starting
schedule scanning as it changes the bg scan interval when connected to AP.
Use the currently configured interval instead.

kvalo: improve commit log

Signed-off-by: Subramania Sharma <sharmat@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2012-04-18 13:03:55 +03:00
Raja Mani eb38987e89 ath6kl: Retain bg scan period value modified by the user
Added a new member bg_scan_period in struct ath6kl_vif
to retain background scan period value configured via debugfs
entry 'bgscan_interval'. This backup is needed in schedule scan
path while configuring scan parameters.

Signed-off-by: Raja Mani <rmani@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2012-04-18 12:56:38 +03:00
Dan Carpenter ebc6a5332f ath6kl: list_first_entry() is never NULL
We can remove the NULL check here.  It triggers a Smatch warning because
list_first_entry() never is NULL and people who check for it normally
intend to check for list_empty() instead.  In these cases however,
we've already verified that the lists are not empty.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2012-04-16 09:32:04 +03:00
Tim Gardner 2023dbb831 ath6kl: Normalize use of FW_DIR
kvalo: do the same changes for ar6004 hw1.2 as well

Cc: Kalle Valo <kvalo@qca.qualcomm.com>
Cc: "John W. Linville" <linville@tuxdriver.com>
Cc: linux-wireless@vger.kernel.org
Cc: netdev@vger.kernel.org
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2012-04-16 09:31:50 +03:00
Ming Jiang 48f27587aa ath6kl: allow deepsleep_suspend function when wlan interface down
Aafter wlan interface is down WLAN_ENABLED flags will be cleared and
deepsleep_suspend function will be blocked in this senario. This patch
allows deepsleep_suspend function when wlan interface down by removed
the WLAN_ENABLED flag checking.

kvalo: fix commit log

Signed-off-by: Ming Jiang <mjiang@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2012-04-16 09:13:39 +03:00
Ray Chen 08c6100967 ath6kl: Fix system crash sometimes for USB hotplug
System crash because of NULL pointer reference due to
cleanup_scatter is not implemented for USB.

Signed-off-by: Ray Chen <raychen@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2012-04-16 09:12:21 +03:00
Kalle Valo cdeb860252 ath6kl: merge split format strings into one
Found by checkpatch:

WARNING: quoted string split across lines

Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2012-04-16 09:08:51 +03:00
Jesper Juhl ae9a3405fd ath6kl: fix memory leak in ath6kl_fwlog_block_read()
If, in
drivers/net/wireless/ath/ath6kl/debug.c::ath6kl_fwlog_block_read(),
the call to wait_for_completion_interruptible() returns -ERESTARTSYS
then we'll return without freeing the (as yet unused) memory we
allocated for 'buf' - thus leaking it.

Signed-off-by: Jesper Juhl <jj@chaosbits.net>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2012-04-13 14:42:15 +03:00
Ray Chen 6146ca6903 ath6kl: Add AR6004 1.2 support for USB and SDIO
Add the necessary change for AR6004 1.2 chip support

Signed-off-by: Ray Chen <raychen@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2012-04-12 11:04:03 +03:00
Vasanthakumar Thiagarajan 9e8b16dbd0 ath6kl: Configure 0 as rsn cap when it is not there in rsn ie
Currently rsn capability is not set when it is not available in
rsn IE. Set it to 0 in firmware when it is not there in the ie to
make sure host and target are consistent.

Signed-off-by: Vasanthakumar Thiagarajan <vthiagar@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2012-04-12 10:37:13 +03:00
Vasanthakumar Thiagarajan 798985c688 ath6kl: Fix possible unaligned memory access in ath6kl_get_rsn_capab()
alignment is not taken care in accessing pairwise cipher and AKM suite
count which are parsed from rsn ie. Fix this alignment issue.

Reported-by: Joe Perches <joe@perches.com>
Signed-off-by: Vasanthakumar Thiagarajan <vthiagar@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2012-04-12 10:35:03 +03:00
Thomas Pedersen c4f7863eae ath6kl: handle concurrent AP-STA channel switches
If an ath6kl AP vif is beaconing on one channel, and a STA vif
associates on a different channel, a WMI_DISCONNECT event will be sent
to the AP vif. Make the AP vif follow the STA interface, and notify
userspace.

kvalo: fix a sparse warning with vif->next_chan

Signed-off-by: Thomas Pedersen <c_tpeder@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2012-04-12 09:55:52 +03:00
Kalle Valo d968370ee7 Merge remote branch 'wireless-next/master' into ath6kl-next 2012-04-12 09:45:11 +03:00
Joe Perches 516304b0f4 ath: Add and use pr_fmt, convert printks to pr_<level>
Use a more current logging style.
Make sure all output is prefixed appropriately.

Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-04-10 14:52:13 -04:00
Vasanthakumar Thiagarajan d97c121bb2 ath6kl: Fix 4-way handshake failure in AP and P2P GO mode
RSN capability field of RSN IE which is generated (which is what really
advertised in beacon/probe response) differs from the one generated in
wpa_supplicant. This inconsistency in rsn IE results in 4-way handshake
failure. To fix this, configure rsn capability used in wpa_supplicant
in firmware using a new wmi command, WMI_SET_IE_CMDID. There is a bit
(ATH6KL_FW_CAPABILITY_RSN_CAP_OVERRIDE) in fw_capabilities to advertise
this support to driver.

Signed-off-by: Subramania Sharma <sharmat@qca.qualcomm.com>
Signed-off-by: Vasanthakumar Thiagarajan <vthiagar@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2012-04-09 18:33:07 +03:00
Vasanthakumar Thiagarajan df90b36940 ath6kl: Configure htcap in fw based on the channel type in AP mode
This patch disables HT in start_ap if the type of the channel on
which the AP mode is going to be operating is non-HT. HT is enabled
with default ht cap setting if the operating channel is going to be
11n.

Signed-off-by: Vasanthakumar Thiagarajan <vthiagar@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2012-04-09 18:25:56 +03:00
Vasanthakumar Thiagarajan bed56e313a ath6kl: Don't advertise HT40 support in 2.4 Ghz
HT40 is not supported in 2.4Ghz.

Signed-off-by: Vasanthakumar Thiagarajan <vthiagar@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2012-04-09 18:25:56 +03:00
Vasanthakumar Thiagarajan 1e8d13b0ac ath6kl: Fix target assert in p2p bringup with multi vif
Using interface 0 for p2p causes target assert. This is because
interface 0 is always initialized to non-p2p operations. Fix this
issue by initializing all the interfaces for p2p when fw is capable
of dynamic interface switching. When fw is not capable of dynamic
switching, make sure p2p is not brought up on interface which is
not initialized for this purpose.

Reported-by: Naveen Singh navesing@qca.qualcomm.com
Signed-off-by: Vasanthakumar Thiagarajan <vthiagar@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2012-04-09 17:49:43 +03:00
Vasanthakumar Thiagarajan b514fab5a1 ath6kl: Support net_stats.multicast
net_stats.multicast is updated with the count of received multicast packets.

kvalo: indentation changes

Signed-off-by: Vasanthakumar Thiagarajan <vthiagar@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2012-04-04 14:43:55 +03:00
Vivek Natarajan 3d79499c1c ath6kl: Fix scan related issue on suspend-resume
When a scan request is pending while going to suspend, any new
scan request after resume will fail. So, cancel all scan requests
in all the vifs before moving to suspend state.

Signed-off-by: PingYang Zhang <pingzhan@qca.qualcomm.com>
Signed-off-by: Vivek Natarajan <nataraja@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2012-04-03 21:26:01 +03:00
Vivek Natarajan 8437754c83 ath6kl: Use vmalloc instead of kmalloc for fw
Sometimes it has been observed that allocating a contiguous memory
of more than 100K fails with kmalloc. This has been modified to
use vmalloc instead.

Signed-off-by: PingYang Zhang <pingzhan@qca.qualcomm.com>
Signed-off-by: Vivek Natarajan <nataraja@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2012-04-03 21:26:01 +03:00
Bala Shanmugam f599359cb9 ath6kl: Set background scan period.
After connect command, send scan params WMI command to
set background scan period. If period value is zero
send 0xffff as bg scan period to disable bg scan.
Set default bg scan period to be 60 seconds if
not specified.

This patch depends on below patch
cfg80211: Add background scan period attribute.

kvalo: fix open parenthesis alignment

Signed-off-by: Bala Shanmugam <bkamatch@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2012-03-28 16:52:41 +03:00
Raja Mani 5b35dff0bb ath6kl: Store scan request info in-advance before sending SCAN request
In current code, Scan request info is recorded in vif->scan_req
after sending SCAN request to the firmware in ath6kl_cfg80211_scan().

In some corner cases, firmware sends SCAN_COMPLETE event immediately
when it receives SCAN request, which internally executes scan
complete event handler ath6kl_cfg80211_scan_complete_event() first.
So, Scan completion handler will a get a chance to executed even
before storing scan request info in ath6kl_cfg80211_scan().

Scan completion handler never report SCAN_COMPLETE event to
cfg80211 if scan request info(vif->scan_req) is NULL. This leads
to scan failure issue ("Device or resource busy error") during
next SCAN request from the user space. This patch ensures that scan
request info is stored before sending SCAN request.

Signed-off-by: Raja Mani <rmani@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2012-03-28 16:33:38 +03:00
Kalle Valo 9cbee35868 ath6kl: add full USB support
Now, with HTC pipe, it's possible to fully support USB version of AR6004.

Based on code by Kevin Fang.

Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2012-03-26 16:36:46 +03:00
Kalle Valo 636f828844 ath6kl: Add HTC pipe implementation
This is needed for USB.

Based on code by Kevin Fang.

Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2012-03-26 16:36:46 +03:00
Kalle Valo e76ac2bf63 ath6kl: add htc ops
In preparation for adding HTC pipe implementation add htc-ops.h to make
it possible dynamically choose which HTC type is used.

Needed for full USB support.

Based on the code by Ray Chen <raychen@qca.qualcomm.com>.

Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
Signed-off-by: Ray Chen <raychen@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2012-03-26 16:36:46 +03:00
Kalle Valo 048f24f695 ath6kl: remove void pointer from ath6kl_credit_setup()
Void pointers are bad.

Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2012-03-26 16:36:46 +03:00
Kalle Valo 8bd5bca821 ath6kl: add rx data padding support
Needed when using USB.

Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2012-03-26 16:36:45 +03:00
Kalle Valo cfc10f2457 ath6kl: add pointer to the skb in htc_packet
Needed by the USB code.

Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2012-03-26 16:36:45 +03:00
Kalle Valo 900d6b3fea ath6kl: add tx_comp_multi() to struct htc_ep_callbacks
It's also needed by the USB code.

Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2012-03-26 16:36:45 +03:00
Kalle Valo 63de111257 ath6kl: Add tx_complete() to struct htc_ep_callbacks
This is needed by the USB code. Also while at it replace one void pointer
with a properly typed pointer.

Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2012-03-26 16:36:45 +03:00
Kalle Valo 6b42d30804 ath6kl: set ram reserved size only for ar6003
Ram reserved size is not needed with ar6004.

Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2012-03-26 16:36:45 +03:00
Vasanthakumar Thiagarajan 03bdeb0d54 ath6kl: Configure inactivity timeout in fw
Configure the inactivity timeout passed in start_ap() to
firmware. This capability is advertised only when fw supports
it, there is a new bit (ATH6KL_FW_CAPABILITY_INACTIVITY_TIMEOUT)
in firmware capability ie for driver to learn fw's capability.
After the fw finds out the station is inactive, it will probe
the station with null func frames. By default, the timeout is
10 secs.

Signed-off-by: Vasanthakumar Thiagarajan <vthiagar@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2012-03-26 16:28:39 +03:00
Kalle Valo 0564161ea9 Merge remote branch 'wireless-next/master' into ath6kl-next 2012-03-26 16:26:56 +03:00
Raja Mani 40abc2defb ath6kl: Optimize target power in deep sleep suspend
Adding below steps helps to get good power numbers
in deep sleep suspend path,

    * Disable WOW mode.
    * Flush data packets and wait for all control packets.
      to be cleared in TX path before deep sleep suspend.
    * Set host sleep mode to SLEEP.

Below steps are added to perform the recovery action
while the system resume from deep sleep,

     * Set host sleep mode to AWAKE.
     * Reset scan parameters to default value.

In addition, Debug prints are added to track deep sleep
suspend/resume state.

Signed-off-by: Raja Mani <rmani@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2012-03-26 16:07:40 +03:00
Raja Mani 055bde493f ath6kl: Isolate host sleep mode config part from ath6kl_wow_suspend
The piece of code used in ath6kk_wow_suspend function
to configure the host sleep mode is needed in deep sleep
case also.

Moving that portion to a separate function called
ath6kl_update_host_mode() would be helpful to avoid
the duplication of the same code in deep sleep path.

There is no functional change.

kvalo: move inline functions to cfg80211.c and fix a long line

Signed-off-by: Raja Mani <rmani@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2012-03-26 16:07:19 +03:00
Vasanthakumar Thiagarajan 5c980fbb4e ath6kl: Dump htc header when invalid Rx frame length is detected
Dump htc header along with the warning message when the request
to Rx with invalid frame length is detected.

kvalo: fix open parenthesis alignment

Signed-off-by: Vasanthakumar Thiagarajan <vthiagar@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2012-03-26 15:47:49 +03:00
Kalle Valo b4d13d3b70 ath6kl: abort normal scan when scheduled scan is started
If the device disconnects from an AP when it is in suspending state. You will
get the following message from wpa_supplicant after waking the device up and
sending scan request:

"Scan trigger failed: ret=-16 (Device or resource busy)"

Fix the issue by sending a scan complete event before starting scheduled
scan.

kvalo: cosmetic changes to commit log

Signed-off-by: Isaac.li <shonmou@gmail.com>
Tested-by: Raja Mani <rmani@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2012-03-21 10:06:43 +02:00
Joe Perches 7084beeadb ath6kl: Add __printf verification to ath6kl_printk
Make sure printf formats and arguments match.

Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2012-03-20 11:49:45 +02:00
Raja Mani f0446ea9c1 ath6kl: Add ARP offload related statistic info in tgt_stats
Firmware reports the below ARP offload related information
while sending the target statistic event to the host.

     * Number of ARP packets received.
     * Number of packets matched with the device IP addr.
     * Number of ARP response packet sent to the remote.

This patch adds the additional debug prints in debugfs
entry tgt_stats. It will be useful to know the ARP offload
execution status.

Signed-off-by: Raja Mani <rmani@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2012-03-20 10:59:45 +02:00
Aarthi Thiruvengadam 7397ddebdf ath6kl: add debug log for AP MLME operations
This is useful during debugging to check if disconnect commands were issued by
the host.

Signed-off-by: Aarthi Thiruvengadam <athiruve@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2012-03-20 10:42:36 +02:00
Aarthi Thiruvengadam c86e4f44f1 ath6kl: handle probe response from P2P device in P2P GO mode
When the device is in P2P GO mode and in listen state, the correct behavior is
to see two different probe response frames - one from P2P device and the other
from GO. wpa_supplicant uses the same mechanism to send the frame in both cases
(ath6kl_mgmt_tx). For GO probe response, ath6kl needs to call
ath6kl_send_go_probe_resp (this will add only WSC/P2P IEs and the rest of the
IEs are filled in by the firmware). That was done based on the nw_type ==
AP_NETWORK which would work if P2P Device role were in a separate netdev. When
P2P Device and GO use the same netdev, ath6kl needs to use the special GO probe
response case only if SSID is longer than P2P wildcard SSID.

Signed-off-by: Aarthi Thiruvengadam <athiruve@qca.qualcomm.com>
Reviewed-by: Jouni Malinen <jouni@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2012-03-20 10:33:11 +02:00