History log of /drivers/net/wireless/ath/ath6kl/main.c
Revision Date Author Comments
10d49878971852111b49f59f6f56c3641b691173 17-Aug-2014 Hans Wennborg <hans@hanshq.net> ath6kl: fix %d confusingly prefixed with 0x in format strings

Signed-off-by: Hans Wennborg <hans@hanshq.net>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
7880377012ef48bf75498648c3bcbcb60460ff28 16-Jun-2014 Jessica Wu <wjessica@qca.qualcomm.com> ath6kl: add support for ar6004 hw3.0

This change enables ath6kl driver to support ar6004 hw3.0. At the same time do
some fixes in firmware initialisation which applies to ar6004 hw1.3 as well.

Signed-off-by: Jessica Wu <wjessica@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
c1d32d3038ff4d366b837cedb95aeb1801730f2c 16-Jun-2014 Jessica Wu <wjessica@qca.qualcomm.com> ath6kl: add support wmi rate tables with mcs15

Some of the firmware versions support rate tables up to mcs15, add support for
that.

Signed-off-by: Jessica Wu <wjessica@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
a5d8f9dfcf5ead45a2f164f15ca4839325c08815 10-Mar-2014 Kalle Valo <kvalo@qca.qualcomm.com> ath6kl: use braces on both arms of if statement

Fixes checkpatch warning:

CHECK: braces {} should be used on all arms of this statement

Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
3629fa14388dbfcb150f5178a018b7eb265a1189 10-Mar-2014 Kalle Valo <kvalo@qca.qualcomm.com> ath6kl: fix blank lines before and after braces

Fixes checkpatch warnings:

CHECK: Blank lines aren't necessary after an open brace '{'
CHECK: Blank lines aren't necessary before a close brace '}'

Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
9d0e2f0772d394060bf3b17cd1f3a35574365103 05-Aug-2013 Mohammed Shafi Shajakhan <mohammed@qca.qualcomm.com> ath6kl: Fix invalid pointer access on fuzz testing with AP mode

In our Fuz testing, reference client corrupts the dest mac to "00:00:00:00:00:00"
in the WPA2 handshake no 2. During driver init the sta_list entries mac
addresses are by default "00:00:00:00:00:00". Driver returns an invalid
pointer (conn) and the drver shall crash, if rxtids (aggr_conn)
skb queues are accessed, since they would not be initialized.

Signed-off-by: Mohammed Shafi Shajakhan <mohammed@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
6a3e4e06a1a2238d5a2668d4a5bad58fc92c7a77 10-Mar-2013 Myoungje Kim <mjei78@gmail.com> ath6kl: Fix the byte alignment rule to avoid loss of bytes in a TCP segment

Either first 3 bytes of the first received tcp segment or last one
over MTU size file can be loss due to the byte alignment problem.
Although ATH6KL_HTC_ALIGN_BYTES was defined for 'extra bytes for htc header
alignment' in the patch "Fix buffer alignment for scatter-gather
I/O"(1df94a857), there exists the bytes loss issue which means that it will be
truncated 3 bytes in the transmitted file contents if a file which has over MTU
size is transferred through TCP/IP stack. It doesn't look like TCP/IP stack
bug of 3.5 or the latest version of kernel but the byte alignment issue. This
patch is to use the roundup() function for the byte alignment rather than the
predefined ATH6KL_HTC_ALIGN_BYTES.

kvalo: fixed indentation

Signed-off-by: Myoungje Kim <mjei78@gmail.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
ec1461dc30feb422af65ee849137f56e7f87f55e 08-Mar-2013 Kalle Valo <kvalo@qca.qualcomm.com> ath6kl: cleanup ath6kl_reset_device()

Move it to init.c, make it static, remove all useless checks and force it to
always do cold reset.

Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
698bf867d0d3b5669c4e85b29d2a44043a2c5c99 21-Sep-2012 Pandiyarajan Pitchaimuthu <c_ppitch@qca.qualcomm.com> ath6kl: Blocked client notification

When a station tries to connect to an AP and if the MAC of the
station is in the AP's block list, the station cannot connect to the
AP. This is notified to the userspace with event
NL80211_CMD_CONN_FAILED and attribute NL80211_ATTR_CONN_FAILED_REASON.
The reason sent will be NL80211_CONN_FAIL_BLOCKED_CLIENT.

Signed-off-by: Pandiyarajan Pitchaimuthu <c_ppitch@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
07033ce2fbfb8d27663d1cd1e9ce36b9661007e0 21-Sep-2012 Pandiyarajan Pitchaimuthu <c_ppitch@qca.qualcomm.com> ath6kl: Max clients reached notification

When a station requests connection to an AP, that has already been
connected to the maximum number of stations it can support, an event
is sent to user space via NL80211_CMD_CONN_FAILED command and reason
attribute NL80211_ATTR_CONN_FAILED_REASON with
NL80211_CONN_FAIL_MAX_CLIENTS as reason.

Signed-off-by: Pandiyarajan Pitchaimuthu <c_ppitch@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
f21243a82253e34f64187aeb3d7f93fb7cb92536 28-Jul-2012 Thomas Pedersen <c_tpeder@qca.qualcomm.com> ath6kl: reconfigure RSN capabilities when restarting AP

If the firmware decides to initiate a channel switch on an AP vif
running an RSN BSS, reconfigure the saved RSN IE capabilities as well.

Fixes a bug where the beacon and 4-way handshake would have a capability
mismatch after a channel switch, since the firmware apparently clears
these on an AP disconnect.

Signed-off-by: Thomas Pedersen <c_tpeder@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
b5495e666d0b83553f6330e7ba33c0cee2271332 27-Jul-2012 Thomas Pedersen <c_tpeder@qca.qualcomm.com> ath6kl: restart concurrent vifs on failed connect

When an ath6kl STA vif is issued a connect command, the firmware will
disconnect all other beaconing vifs in preparation for a potential
channel switch. The case where the connect fails is currently unhandled,
so if a connection attempt on a STA vif fails and any vifs were waiting
for a new channel, simply restart the concurrent vifs on their previous
channel.

Requires that we start tracking the last issued channel in ar->last_ch,
which is valid since ath6kl only supports 1 channel at a time.

Also clear the beaconing vif's want_ch_switch bit regardless of whether
channel switch succeeds, to stop recommitting the same failed profile.

Signed-off-by: Thomas Pedersen <c_tpeder@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
4aca81bfb0b13b927320448c6e4820ffb95f095b 10-Jul-2012 Pandiyarajan Pitchaimuthu <c_ppitch@qca.qualcomm.com> ath6kl: Make use of return value from ath6kl_diag_read()

In ath6kl_read_fwlogs(), return value from ath6kl_diag_read()is not
used to bail out in case of any errors in reading fw log. No real issue
is observed because of this, reported by source code analyzer.

kvalo: fix a long line warning

Signed-off-by: Pandiyarajan Pitchaimuthu <c_ppitch@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
b5b6f6a9a07ac230d54a85a9fb9e691c85f2eb0a 07-Jun-2012 Naveen Singh <navesing@qca.qualcomm.com> ath6kl: use firmware version from FW IE

Need to have different FW versioning for different FW binaries.
This is handled by appending different meta data in firmware
binaries.

kvalo: add an empty line before a debug message, use '0' instead of '0x00',
fix indentation

Signed-off-by: Naveen Singh <navesing@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
aa430da41019c1694f6a8e3b8bef1d12ed52b0ad 16-May-2012 Johannes Berg <johannes.berg@intel.com> cfg80211: provide channel to start_ap function

Instead of setting the channel first and then
starting the AP, let cfg80211 store the channel
and provide it as one of the AP settings.

This means that now you have to set the channel
before you can start an AP interface, but since
hostapd/wpa_supplicant always do that we're OK
with this change.

Alternatively, it's now possible to give the
channel as an attribute to the start-ap nl80211
command, overriding any preset channel.

Cc: Kalle Valo <kvalo@qca.qualcomm.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
6821d4f08dcdc7d8c21a3280f57f53a080f19840 11-May-2012 Naveen Gangadharan <ngangadh@qca.qualcomm.com> ath6kl: Add wow multicast firmware capability support

Infrastructure to enable Multicast WOW support based on
firmware capability added to the driver.This enables
different customers or chips to control this feature based
on firmware capability.

kvalo: Firmware capability infrastructure for multicast wow feature,
indetation fixes.

Signed-off-by: Naveen Gangadharan <ngangadh@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
6251d8012dbc49869f2453942089c4df82de0c80 20-Apr-2012 Naveen Gangadharan <ngangadh@qca.qualcomm.com> ath6kl: Multicast filter support in wow suspend and non-suspend

This patch enables all multicast packets in non suspend mode
and enable multicast filtering in wow suspend mode. This also
fixes a bug in multicast where the driver assumed disable
multicast-all command disabled/filtered all multicast
packets, which was wrong assumption, because firmware will
apply the programmed filter.

Multicast requirements
- Enable forward all multicast packets(no filtering) in
non suspend mode.
- Enable multicast filtering in wow suspend mode for both
AP and CLIENT.

kvalo: fix a checkpatch warning and drop unrelated newline removal

Signed-off-by: Naveen Gangadharan <ngangadh@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
d92917e4db2a9d6af9e362bda5151cadec9e1eeb 20-Apr-2012 Thomas Pedersen <c_tpeder@qca.qualcomm.com> 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>
cdeb860252e66bdaf1ab70420274df879f243d3d 12-Apr-2012 Kalle Valo <kvalo@qca.qualcomm.com> 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>
c4f7863eae6f580a0373cbd8dc2731d082570e69 06-Apr-2012 Thomas Pedersen <c_tpeder@qca.qualcomm.com> 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>
516304b0f45614fb8967dc86ff681499204cdbb1 19-Mar-2012 Joe Perches <joe@perches.com> 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>
f0446ea9c11243bcfe8559f0033a5e4790b0d95b 16-Mar-2012 Raja Mani <rmani@qca.qualcomm.com> 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>
ddc3d77c80bbaae562a91d4e032b56b2e4570f90 07-Mar-2012 Kalle Valo <kvalo@qca.qualcomm.com> ath6kl: logical continuations should be on the previous line

All found by checkpatch:

ath6kl/wmi.c:1036: CHECK: Logical continuations should be on the previous line

Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
96f1fadc94bc8dcde814109439e416143eed50fa 07-Mar-2012 Kalle Valo <kvalo@qca.qualcomm.com> ath6kl: alignment should match open parenthesis

Fix the issues which checkpatch found and were easy to fix. Especially
callers of ath6kl_bmi_write() are tricky and that needs to be fixed
separately.

Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
8f46fccd6cd0d7ba70ba1636e59e98ca17dd2239 20-Feb-2012 Raja Mani <rmani@qca.qualcomm.com> ath6kl: Maintain the listen interval per VIF specific

Firmware has the option to support the listen interval
per vif specific. Fix this.

Listen interval can be set by the TUs or by the number
of beacons. Current code enables the user to configure
the listen interval in the unit of 'number of beacons'
using debugfs entry "listen_interval". Going forward,
we need to alter the listen interval in the unit of TUs
to get good power numbers while going to WOW suspend/resume.

Allowing the user to change the listen interval in
the unit of "number of beacons" in debugfs and changing
listen interval in wow suspend/resume in the unit of
time (TUs) would lead us to confuse.

This patch make sures the listen interval is changed only
in the unit of time (TUs).

Signed-off-by: Raja Mani <rmani@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
4705b7036c2fec73856ae57b0a1f452fca705cd5 28-Feb-2012 Vasanthakumar Thiagarajan <vthiagar@qca.qualcomm.com> ath6kl: Initialize netdev hw_features for every interface

Move netdev->hw_features setting from ath6kl_core_init() to
init_netdev() so that it is done for every interface.

Signed-off-by: Vasanthakumar Thiagarajan <vthiagar@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
d0ff7383a3164adff7072719717d574436ec1677 09-Feb-2012 Naveen Gangadharan <ngangadh@qca.qualcomm.com> ath6kl: Add unicast mgmt frame buffering

PS buffering of unicast Action frames that are sent in a context
of a BSS. In AP mode when the recepient station goes to powersave
and PS_POLL flag is not set, we would buffer the frames. Send out
unicast mgmt bufferred frame when PS_POLL is received.

This fixes a bug in P2P GO behavior when sending a GO Discoverability
Request to a client that is in sleep mode.

kvalo: indentation fixes

Signed-off-by: Thirumalai Pachamuthu <tpachamu@qca.qualcomm.com>
Signed-off-by: Naveen Gangadharan <ngangadh@qca.qualcomm.com>
Signed-off-by: Aarthi Thiruvengadam <athiruve@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
1b2df4073447234034e2329f0df584c6346a8ec3 06-Feb-2012 Vasanthakumar Thiagarajan <vthiagar@qca.qualcomm.com> ath6kl: Update license header

Update license header with the copyright to Qualcomm Atheros, Inc.
for the year 2011-2012.

Signed-off-by: Vasanthakumar Thiagarajan <vthiagar@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
c86515412f0c364f2d45029b45d5909614087af3 26-Jan-2012 Vasanthakumar Thiagarajan <vthiagar@qca.qualcomm.com> ath6kl: Fix kernel panic during rx aggregation

"ath6kl: Define a structure for connection specific aggregation information"
introduces this. In aggr_conn_init(), vif->aggr_cntxt is assigned to
aggr_conn->aggr_info, but vif->aggr_cntxt is not initialized at this
point, this would end up accessing an invalid pointer in aggregation
receive path. Fix this by passing the correct aggr_info to aggr_conn_init().
The panic trace would look like.

[<ffffffff8159e02e>] panic+0xa1/0x1c6
[<ffffffff8103773d>] ? kmsg_dump+0xfd/0x160
[<ffffffff815a2f6a>] oops_end+0xea/0xf0
[<ffffffff8102b95d>] no_context+0x11d/0x2d0
[<ffffffff8102bc5d>] __bad_area_nosemaphore+0x14d/0x230
[<ffffffff815a5c4d>] ? do_page_fault+0x30d/0x520
[<ffffffff8102bd53>] bad_area_nosemaphore+0x13/0x20
[<ffffffff815a5cfd>] do_page_fault+0x3bd/0x520
[<ffffffff8108bd60>] ? __lock_acquire+0x320/0x1680
[<ffffffff812e3a9d>] ? trace_hardirqs_off_thunk+0x3a/0x3c
[<ffffffff815a2385>] page_fault+0x25/0x30
[<ffffffffa0487a5f>] ? aggr_slice_amsdu+0xdf/0x170 [ath6kl_core]
[<ffffffffa0487bac>] aggr_deque_frms+0xbc/0x190 [ath6kl_core]
[<ffffffffa0488404>] ath6kl_rx+0x3e4/0xae0 [ath6kl_core]
[<ffffffffa047ae77>] ath6kl_htc_rxmsg_pending_handler+0x8b7/0xf10 [ath6kl_core]
[<ffffffffa00c82f0>] ? mmc_do_release_host+0x70/0x90 [mmc_core]
[<ffffffffa00c833a>] ? mmc_release_host+0x2a/0x50 [mmc_core]
[<ffffffffa04865c0>] ? ath6kl_alloc_amsdu_rxbuf+0x140/0x140 [ath6kl_core]
[<ffffffffa0477772>] ath6kl_hif_intr_bh_handler+0x362/0x510 [ath6kl_core]
[<ffffffffa01f1000>] ath6kl_sdio_irq_handler+0x60/0xb0 [ath6kl_sdio]
[<ffffffffa00d30bc>] sdio_irq_thread+0xec/0x320 [mmc_core]
[<ffffffffa00d2fd0>] ? sdio_claim_irq+0x220/0x220 [mmc_core]
[<ffffffffa00d2fd0>] ? sdio_claim_irq+0x220/0x220 [mmc_core]
[<ffffffff8105b21e>] kthread+0xbe/0xd0
[<ffffffff815ab574>] kernel_thread_helper+0x4/0x10
[<ffffffff815a2174>] ? retint_restore_args+0x13/0x13
[<ffffffff8105b160>] ? __init_kthread_worker+0x70/0x70
[<ffffffff815ab570>] ? gs_change+0x13/0x13

Signed-off-by: Vasanthakumar Thiagarajan <vthiagar@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
1d2a4456de20db73362c86c88fe9c02169f29d0a 21-Jan-2012 Vasanthakumar Thiagarajan <vthiagar@qca.qualcomm.com> ath6kl: Fix bug in maintaining aggregation state in AP mode

Currently rx aggregation related states are maintained per
vif, but this will not properly work when operating in AP mode.
Aggregation is completely broken when more than one
11n stations are connected to AP mode vif. Fix this issue
by keeping station specific aggregation state in sta_list.

Signed-off-by: Vasanthakumar Thiagarajan <vthiagar@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
17741c8db4f53200a51600d1644ee6a2b76f0984 21-Jan-2012 Vasanthakumar Thiagarajan <vthiagar@qca.qualcomm.com> ath6kl: Pass vif instead of ar to ath6kl_add_new_sta()

This will be used when initializing station specific aggregation
information.

Signed-off-by: Vasanthakumar Thiagarajan <vthiagar@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
d6f802612af55cc1b3699d119a04dfa2fc8812a0 17-Jan-2012 Kalle Valo <kvalo@qca.qualcomm.com> ath6kl: use netdev_features_t

Commit c8f44affb7 ("net: introduce and use netdev_features_t for
device features sets") added netdev_features_t to ndo_set_features.
Change ath6kl to use the new type.

This fixes a warning:

ath6kl/main.c:1170: warning: initialization from incompatible pointer type

Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
e80ec84d9352419a7c0482edfbf1b96eaa4c8b95 12-Jan-2012 Raja Mani <rmani@qca.qualcomm.com> ath6kl: Remove useless initialization in ath6kl_read_fwlogs()

ath6kl_read_fwlogs() assigns the value zero to the variable 'ret'
at the time of declaration. Later, return value of ath6kl_diag_read32()
repalces the init value. Hence removing useless zero assignment.

Signed-off-by: Raja Mani <rmani@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
c1762a3fe196483981f91b926f5f6ee18af757f2 12-Jan-2012 Thirumalai Pachamuthu <tpachamu@qca.qualcomm.com> ath6kl: Add support for uAPSD

* A new APSD power save queue is added in the station structure.
* When a station has APSD capability and goes to power save, the frame
designated to the station will be buffered in APSD queue.
* When the host receives a frame which the firmware marked as trigger,
host delivers the buffered frame from the APSD power save queue.
Number of frames to deliver is decided by MAX SP length.
* When a station moves from sleep to awake state, all frames buffered
in APSD power save queue are sent to the firmware.
* When a station is disconnected, all frames bufferes in APSD power save
queue are dropped.
* When the host queues the first frame to the APSD queue or removes the
last frame from the APSD queue, it is indicated to the firmware using
WMI_AP_APSD_BUFFERED_TRAFFIC_CMD.

kvalo: fix buggy handling of sks queues, made it more obvious
the user priority when wmm is disabled, remove unneed else block and
combined some variable declarations

Signed-off-by: Thirumalai Pachamuthu <tpachamu@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
8232736dabd2a0310f76944fa7af0542fe3ded4f 10-Jan-2012 Sujith Manoharan <c_manoha@qca.qualcomm.com> ath6kl: Fix listen interval handling

This patch addresses a few problems with the commit:

"ath6kl: Implement support for listen interval from userspace"

* The debugfs file required for reading/writing the listen interval
wasn't created. Fix this.

* The interface index was being hardcoded to zero. Fix this.

* Two separate parameters, "listen_interval_time and listen_interval_beacons"
were being used. This fails to work as expected because the FW assigns
higher precedence to "listen_interval_beacons" and "listen_interval_time"
ends up being never used at all.

To handle this, fix the host driver to exclusively use listen interval
based on units of beacon intervals.

To set the listen interval, a user would now do something like this:

echo "10" > /sys/kernel/debug/ieee80211/*/ath6kl/listen_interval

kvalo: fix two checkpatch warnings

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
4269a930548966014dd4186a15c8e023ca4abc29 05-Jan-2012 Stephen Hemminger <shemminger@vyatta.com> ath6kl: make net_device_ops const

Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
982767b8c94482b4b7f694e2ab2074c95fbf3e0e 03-Jan-2012 Vasanthakumar Thiagarajan <vthiagar@qca.qualcomm.com> ath6kl: Change ielen in ath6kl_add_new_sta() from u8 to size_t

Otherwise if (ielen <= ATH6KL_MAX_IE) is dead code. It looks safe to
change the type of ielen from u8 to size_t instead of removing this
if check, this ielen can have the length of more than one ies in future.

Signed-off-by: Vasanthakumar Thiagarajan <vthiagar@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
3d6aba260bcd5a5f9d47056cac2e313ce986ad12 03-Jan-2012 Vasanthakumar Thiagarajan <vthiagar@qca.qualcomm.com> ath6kl: Remove deadcode in main.c

In ath6kl_reset_device(), since control can never reach switch..case
when the target_type is neither TARGET_TYPE_AR6003 nor TARGET_TYPE_AR6004,
remove the default option of switch statement.

Signed-off-by: Vasanthakumar Thiagarajan <vthiagar@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
80abaf9b4c920cab044e185ed4327f801c1ff99d 03-Jan-2012 Vasanthakumar Thiagarajan <vthiagar@qca.qualcomm.com> ath6kl: Implement ndo_set_rx_mode()

There are maximum of seven multicast filter are supported
by hw. When the requested number of filters exceeds the
maximum supported one, multicast filtering is completely
disabled, the requested filters will be configured in
firmware and the only multicast frames that host is interested
in will be passed to host for further processing otherwise.

Signed-off-by: Vasanthakumar Thiagarajan <vthiagar@qca.qualcomm.com>
792ecb33080f4e315695e0fe21cf3a3c2a514dd0 29-Dec-2011 Vivek Natarajan <nataraja@qca.qualcomm.com> ath6kl: Remove redundant key_index check.

Less-than-zero comparison of an unsigned value is never true.

kvalo: remove WMI_MIN_KEY_INDEX altogether, it's useless

Signed-off-by: Vivek Natarajan <nataraja@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
bc48ad31c5814feb4ff8faca9a8d422279593cb1 27-Dec-2011 Rishi Panjwani <rpanjwan@qca.qualcomm.com> ath6kl: Support for TCP checksum offload to firmware

The change enables offloading TCP checksum calculation to firmware.
There are still some issues with the checksum offload so better to
disable it by default until the issues are resolved.

To enable TCP checksum offload for tx and rx paths, use
the ethtool as follows:
ethtool -K <interface> tx on
ethtool -K <interface> rx on

To disable TCP checksum offload, for tx and rx paths, use
the ethtool as follows:
ethtool -K <interface> tx off
ethtool -K <interface> rx off

kvalo: indentation changes

Signed-off-by: Rishi Panjwani <rpanjwan@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
7125f01d98ed75028ead5b335ec32e6e501cd19b 13-Dec-2011 Kalle Valo <kvalo@qca.qualcomm.com> ath6kl: implement ath6kl_cfg80211_stop_all()

During suspend we need to stop all vifs, not just the first.

Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
ed8491a796558067200ae8a66570c83cb03cbd16 13-Dec-2011 Kalle Valo <kvalo@qca.qualcomm.com> ath6kl: call ath6kl_cfg80211_stop() from ath6kl_close()

This way it's possible to keep all disconnect logic in one function and
easier to add new functionality, like stopping scheduled scan.

There are some changes to commands called during network interface close,
but there should not be any visible changes in functionality.

Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
4703290af46c73094b5252f0cd643c64613c2cb2 08-Dec-2011 Jouni Malinen <jouni@qca.qualcomm.com> ath6kl: Use delayed key configuration for WAPI in AP mode

This is needed to allow WAPI AP to configure the initial group key
to the target in the same way as is done with TKIP/CCMP. This
fixes broadcast data frame delivery with the initial group key.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
293badf4e2fcb81aeab92616856c65fedc454c94 14-Nov-2011 Kalle Valo <kvalo@qca.qualcomm.com> ath6kl: add name field to struct ath6kl_hw

To make it easier to print name for each hardware type. Also move the hw
info print to ath6kl_init_hw_start() which is more logical place for it.

Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
c71114959dc952a509822f22251d01004b3b94cc 10-Nov-2011 Kalle Valo <kvalo@qca.qualcomm.com> ath6kl: move diag commands to hif driver

This is preparation for USB support which will have different diag
commands.

Based on code by Kevin Fang.

Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
30677ae015ade68a315e66385f64448c532ce39a 03-Nov-2011 Dai Shuibing <shuibing@qca.qualcomm.com> ath6kl: Indicate WAPI IE from (Re)Association Request frame

This is needed to know whether the STA requests WAPI to be used and if
so, with what AKM and cipher.

Signed-off-by: Dai Shuibing <shuibing@qca.qualcomm.com>
Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
f4bb9a6fbc1f49058fc9eb6dcb4a3022d99013b4 02-Nov-2011 Jouni Malinen <jouni@qca.qualcomm.com> ath6kl: Fix key configuration to copy at most seq_len from seq

There is no guarantee on the caller using 8-octet buffer for
key->seq, so better follow the key->seq_len parameter on figuring
out how many octets to copy.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
cf97fa9fdf145bff2a0117d2ead4a92b132f69f6 03-Nov-2011 Kalle Valo <kvalo@qca.qualcomm.com> ath6kl: don't power down hardware when interface is down

Jouni reported that my patch "ath6kl: power down hardware when interface
is down" caused a regression on his x86 boxes and scan didn't work anymore.
I was able to reproduce the problem by disabling all debug messages.

So there has to be a race condition somewhere in the code and disable the
functionality until the race is fixed. Now hardware is powered from the
point where module is loaded until it's removed.

Reported-by: Jouni Malinen <jouni@qca.qualcomm.com>
Tested-by: Jouni Malinen <jouni@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
11f6e40d9f21767a9090e4e559d3c63edf25e6c0 01-Nov-2011 Vasanthakumar Thiagarajan <vthiagar@qca.qualcomm.com> ath6kl: Fix lockdep warning

The following is the lockdep warning which detects possible
deadlock condition with the way ar->lock and ar->list_lock
are being used.

(&(&ar->lock)->rlock){+.-...}, at: [<ffffffffa0492d13>] ath6kl_indicate_tx_activity+0x83/0x110 [ath6kl]
but this lock took another, SOFTIRQ-unsafe lock in the past:
(&(&ar->list_lock)->rlock){+.+...}

and interrupts could create inverse lock ordering between them.

other info that might help us debug this:
Possible interrupt unsafe locking scenario:

CPU0 CPU1
---- ----
lock(&(&ar->list_lock)->rlock);
local_irq_disable();
lock(&(&ar->lock)->rlock);
lock(&(&ar->list_lock)->rlock);
<Interrupt>
lock(&(&ar->lock)->rlock);

*** DEADLOCK ***

softirqs have to be disabled when acquiring ar->list_lock to avoid
the above deadlock condition. When the above warning printed the
interface is still up and running without issue.

Reported-by: Kalle Valo <kvalo@qca.qualcomm.com>
Signed-off-by: Vasanthakumar Thiagarajan <vthiagar@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
52d81a6883fb36c4304fb5619bfa5f61eb7986ef 01-Nov-2011 Kalle Valo <kvalo@qca.qualcomm.com> ath6kl: implement ath6kl_cfg80211_suspend()

This is in preparation for cutpower suspend feature. HIF layer makes
the decision based on information provided by cfg80211 and what hardware
actually supports. Then it calls ath6kl_cfg80211_suspend() to enable
the chosen mode.

Functionality should be the same, this is just preparation for
more suspend modes (cutpower and wow).

Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
ec4b7f602d24839a85131dc5b498e69c84ee8373 01-Nov-2011 Kalle Valo <kvalo@qca.qualcomm.com> ath6kl: create ath6kl_cfg80211_stop()

Just take code from deep sleep for now, will be improved later. No
functional changes.

Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
1c17d313891c1477f5aad8d2e1da473bf8b9499d 01-Nov-2011 Kalle Valo <kvalo@qca.qualcomm.com> ath6kl: add aborted parameter to ath6kl_cfg80211_scan_complete_event()

Currently it takes an error code as status, but what we really want to
tell is if the scan was aborted or not.

Also fix a bug where we were comparing firmware scan status values
with kernel error codes, which is obviously wrong. This meant
that ath6kl didn't detect when firmware informed about failed scans. I
doubt that this fix doesn't make any difference in practise but it
still needs to be fixed. This is fixed by adding an enum for the success
status code and checking for that.

Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
68469341f32b566481bfccb776ee03146b63bae5 30-Oct-2011 Kalle Valo <kvalo@qca.qualcomm.com> ath6kl: fix WLAN_ENABLE usage in ath6kl_close()

If ath6kl_init_hw_stop() failed with an error WLAN_ENABLED would not
be cleared. Found during code review and just a theoretical issue.

Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
5fe4dffbc12b22507d2416667720cbd4b27c693b 30-Oct-2011 Kalle Valo <kvalo@qca.qualcomm.com> ath6kl: power down hardware when interface is down

The benefit from this is that user space can control hardware's power state
by putting interface up and down. This is handy if firmware gets to some
weird state.

The downside will be that putting interface up takes a bit longer,
I was measuring ~500 ms during interface up.

Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
d23ace77e2d90a093ead65a03d97c36ec261ce71 23-Oct-2011 Kalle Valo <kvalo@qca.qualcomm.com> ath6kl: remove unused debug levels

Few levels had only one user so I changed them to use WLAN_CFG.

Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
f2f921950d6a066f6e4a84c52fc69292bc877aa7 23-Oct-2011 Kalle Valo <kvalo@qca.qualcomm.com> ath6kl: move all credit distribution code to htc.c

As htc is the only user there's no reason to keep it in main.c.

No functional changes.

Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
3c3703987a43b969e2f1e54c4e28f1fc8594c9d8 23-Oct-2011 Kalle Valo <kvalo@qca.qualcomm.com> ath6kl: rename struct htc_credit_state_info to ath6kl_htc_credit_info

Also rename cred_dist_cntxt to credit_info in struct htc_target.

Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
fa99e963b1976374db1d89aea854e8740b92796d 23-Oct-2011 Kalle Valo <kvalo@qca.qualcomm.com> ath6kl: use ath6kl prefix in credit functions

This is to follow the common style in the driver. Also add braces to
fix a style issue.

Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2792972395356254252f12205915a32dce9f50e4 25-Oct-2011 Vasanthakumar Thiagarajan <vthiagar@qca.qualcomm.com> ath6kl: Use the other variant of netdev (un)register APIs

Use replace (un)register_netdev() with (un)register_netdevice()
so that the same ath6kl function can be used with
add_virtual_intf()/del_virtual_intf().

Signed-off-by: Vasanthakumar Thiagarajan <vthiagar@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
990bd9151927ad55c7e3da3b05cf13ecfe7a31bf 25-Oct-2011 Vasanthakumar Thiagarajan <vthiagar@qca.qualcomm.com> ath6kl: Maintain virtual interface in a list

This patch removes all references to ar->vif and takes
vif from a list.

Signed-off-by: Vasanthakumar Thiagarajan <vthiagar@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
478ac0272154023abb813db7ae12dc380caeb68e 25-Oct-2011 Vasanthakumar Thiagarajan <vthiagar@qca.qualcomm.com> ath6kl: Introduce spinlock to protect vif specific information

Use this spinlock to protect the vif's data instead of
one from ath6kl.

Signed-off-by: Vasanthakumar Thiagarajan <vthiagar@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
d66ea4f9d63732790ae260eccb6c991dfa7a3b32 25-Oct-2011 Vasanthakumar Thiagarajan <vthiagar@qca.qualcomm.com> ath6kl: Store hw mac address in struct ath6kl

WMI ready event gives the mac address, cache this
mac address in struct ath6kl so that it can be used to
compute the mac address for other vif in case of multi vif.

Signed-off-by: Vasanthakumar Thiagarajan <vthiagar@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
6765d0aa5ff5b92098f5e571f26904106eae6ff3 25-Oct-2011 Vasanthakumar Thiagarajan <vthiagar@qca.qualcomm.com> ath6kl: Use interface index from wmi data headr

Interface index is passed in wmi data header as well, use it
to get the corresponding vif structure.

Signed-off-by: Vasanthakumar Thiagarajan <vthiagar@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
6db8fa53ad4fa6d4b390e9bdd68f1238a01070ee 25-Oct-2011 Vasanthakumar Thiagarajan <vthiagar@qca.qualcomm.com> ath6kl: Refactor ath6kl_destroy()

So that the deinitialization of ath6kl and vif are separated.

Signed-off-by: Vasanthakumar Thiagarajan <vthiagar@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
e29f25f5cd23d705b3a186e53cfddd3663875c45 25-Oct-2011 Vasanthakumar Thiagarajan <vthiagar@qca.qualcomm.com> ath6kl: Cleanup parameters in ath6kl_init_control_info() and ath6kl_init_profile_info()

Pass vif structure to those functions instead of ath6kl because these
functions do vif specific information initialization.

Signed-off-by: Vasanthakumar Thiagarajan <vthiagar@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
28ae58dd1f55f55dabf02fbc76a76f0809eee937 25-Oct-2011 Vasanthakumar Thiagarajan <vthiagar@qca.qualcomm.com> ath6kl: Remove net_device from ath6kl

Use one which is available in vif structure instead.

Signed-off-by: Vasanthakumar Thiagarajan <vthiagar@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
240d279940ef496e9456db2287b7989f6521e2e2 25-Oct-2011 Vasanthakumar Thiagarajan <vthiagar@qca.qualcomm.com> ath6kl: Take vif information from wmi event

Interface index is passed in wmi command header from target.
Use this index to get the appropriate vif.

Signed-off-by: Vasanthakumar Thiagarajan <vthiagar@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
334234b51453fe5def250bd60ea63b1f04a8e0d2 25-Oct-2011 Vasanthakumar Thiagarajan <vthiagar@qca.qualcomm.com> ath6kl: Maintain firmware interface index in struct ath6kl_vif

Pass this index to target in wmi commands to specify the interface
for which the command needs to be handled.

Signed-off-by: Vasanthakumar Thiagarajan <vthiagar@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
b95907a744fb2afe282cebd9b58371533818fbae 25-Oct-2011 Vasanthakumar Thiagarajan <vthiagar@qca.qualcomm.com> ath6kl: Make net and target stats vif specific

Signed-off-by: Vasanthakumar Thiagarajan <vthiagar@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
cf5333d70f822d950f0c2f4bec7a8939871d9b6a 25-Oct-2011 Vasanthakumar Thiagarajan <vthiagar@qca.qualcomm.com> ath6kl: Move few more vif specific information to struct ath6kl_vif

Signed-off-by: Vasanthakumar Thiagarajan <vthiagar@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
14ee6f6b7db968229edb7524588e71182c843080 25-Oct-2011 Vasanthakumar Thiagarajan <vthiagar@qca.qualcomm.com> ath6kl: Move scan_req info and sme_state to vif

Signed-off-by: Vasanthakumar Thiagarajan <vthiagar@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
de3ad7138c853fb3f5c239a40e0228bd94d583e7 25-Oct-2011 Vasanthakumar Thiagarajan <vthiagar@qca.qualcomm.com> ath6kl: Move disconnect timer to vif structure

Signed-off-by: Vasanthakumar Thiagarajan <vthiagar@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2132c69cb9efaf2b7300f6da916ab5f96c9c95b7 25-Oct-2011 Vasanthakumar Thiagarajan <vthiagar@qca.qualcomm.com> ath6kl: Move aggregation information to vif structure

Signed-off-by: Vasanthakumar Thiagarajan <vthiagar@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
6f2a73f9e5c7013e14cf898fead81a363cdf0548 25-Oct-2011 Vasanthakumar Thiagarajan <vthiagar@qca.qualcomm.com> ath6kl: Move key information to vif structure

Signed-off-by: Vasanthakumar Thiagarajan <vthiagar@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
f74bac54a507a1b71be352d422b25cb5fd38db54 25-Oct-2011 Vasanthakumar Thiagarajan <vthiagar@qca.qualcomm.com> ath6kl: Move channel information to vif structure

Signed-off-by: Vasanthakumar Thiagarajan <vthiagar@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
8c8b65e3e3b81d28d185f0a8b6543e42b50a812d 25-Oct-2011 Vasanthakumar Thiagarajan <vthiagar@qca.qualcomm.com> ath6kl: Move bssid information to vif structure

Signed-off-by: Vasanthakumar Thiagarajan <vthiagar@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
f5938f249a08a4e6c9046fa095be00db664158cc 25-Oct-2011 Vasanthakumar Thiagarajan <vthiagar@qca.qualcomm.com> ath6kl: Move nw_type to vif structure

Signed-off-by: Vasanthakumar Thiagarajan <vthiagar@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
3450334f392bca1fccbf04a90020161ec4404a1e 25-Oct-2011 Vasanthakumar Thiagarajan <vthiagar@qca.qualcomm.com> ath6kl: Move ssid and crypto information to vif structure

Signed-off-by: Vasanthakumar Thiagarajan <vthiagar@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
59c98449b8af405aa6245ea9f640c5847f42d26e 25-Oct-2011 Vasanthakumar Thiagarajan <vthiagar@qca.qualcomm.com> ath6kl: Define interface specific states

Currently ar->flag maintains interface stats. Move interface
specific states from ar->flag to vif->flags.

Signed-off-by: Vasanthakumar Thiagarajan <vthiagar@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
be98e3a48cb9b9e63da8537a378f656af2a9f2c6 25-Oct-2011 Vasanthakumar Thiagarajan <vthiagar@qca.qualcomm.com> ath6kl: Keep wiphy reference in ath6kl structure

This is to avoid using ar->wdev to get wiphy pointer, this
may need further cleanup for multi vif support.

Signed-off-by: Vasanthakumar Thiagarajan <vthiagar@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
aa6cffc1a275a9369ca83e13cebc4b09e4f23954 05-Oct-2011 Chilam Ng <chilamng@qca.qualcomm.com> ath6kl: make sure WLAN power save is enabled during suspend

Power save is enabled during ath6kl init. But when user space disables power
save, the system will go into suspend with power save disabled. The ath6kl
driver will now explicitly enable power save prior to entering suspend and
restore its previous setting upon resume

Signed-off-by: Chilam Ng <chilamng@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
151bd30bdf88551d68a743b7f7504ca0f3ff2796 30-Sep-2011 Vasanthakumar Thiagarajan <vthiagar@qca.qualcomm.com> ath6kl: Replace spin_lock_irqsave with spin_lock_bh

It is not necessary to use spinlock primitive to
protect data which is accessed in hard irq context as
nothing is running in hard irq with this driver. The
spinlock primitive meant to protect data in softirq
context is more appropriate.

Signed-off-by: Vasanthakumar Thiagarajan <vthiagar@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
551185ca0a97a11917edc3ad8e11d68912795902 19-Sep-2011 Jouni Malinen <jouni@qca.qualcomm.com> ath6kl: Update BSS information after connection

Since we may end up using a dummy BSS entry when roaming, allow one Beacon
frame -based bssinfo from the current BSS to be processed prior to starting
to filter all bssinfo events. This allows cfg80211 BSS table to be filled
with proper data in the roaming case where the full Beacon data may not
have been present at the time of roamed event.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
3b25ed186fc3ac8d2517332bfbd5c44016c10f82 19-Sep-2011 Jouni Malinen <jouni@qca.qualcomm.com> ath6kl: Remove unnecessary node table update on disconnect event

Since ath6kl does not actually update cfg80211 BSS table when this
event occurs, there is not much need for removing the entries from
the internal table that is not really used or exposed.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
64b834d83a191dd6585c0778b1a7a92c36775554 19-Sep-2011 Jouni Malinen <jouni@qca.qualcomm.com> ath6kl: Remove RSSI update for internal node table

ath6kl does not actually update cfg80211 BSS table when this update
occurs, so there is not much need in updating the internal table
that is not used or exposed.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
151411e88fe1d1a729a4f706a2aebef8bc000a69 15-Sep-2011 Jouni Malinen <jouni@qca.qualcomm.com> ath6kl: Fix static WEP configuration in AP mode

Configuration of the WEP keys needs to be delayed until the AP mode has
been properly started at the target. Partial support for delaying the
WEP key configuration was already in place in the driver, but the actual
part of deciding when to do this was missing.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
572e27c00c9d1250ae2b4951eae7e73992174138 05-Sep-2011 Jouni Malinen <jouni@qca.qualcomm.com> ath6kl: Fix AP mode connect event parsing and TIM updates

This cleans up the connect event parsing by defining a union in
struct wmi_connect_event to match with the three possible sets of
fields that the target uses depending on which type of connect
event is being indicated. In addition, two AP cases are now
separated from ath6kl_connect_event() so that correct field names
can be used to make it actually possible to understand what the
code is doing.

The bug hiding in the previous mess was in parsing the AID incorrectly
when processing the new station connecting event in AP mode. The fix
here for that is also fixing TIM updates for PS buffering to use the
correct AID.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
f9ea0753a18448a5e92369317b6ac061fe1275bf 05-Sep-2011 Vasanthakumar Thiagarajan <vthiagar@qca.qualcomm.com> ath6kl: Fix endianness in register write

Signed-off-by: Vasanthakumar Thiagarajan <vthiagar@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
38c35ffd38be9fbbf2ec0b67a802472d3f58f9fa 05-Sep-2011 Vasanthakumar Thiagarajan <vthiagar@qca.qualcomm.com> ath6kl: Make ath6kl_diag_write32() non-static

So that this can be called from debug.c when adding support
to write chip register.

Signed-off-by: Vasanthakumar Thiagarajan <vthiagar@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
b142b91401b8e39671db74bd4fe89f281f4c2978 31-Aug-2011 Vasanthakumar Thiagarajan <vthiagar@qca.qualcomm.com> ath6kl: Fix endianness in requesting chip register read

Need to make sure the chip address for which we need the value
si endian safe.

Signed-off-by: Vasanthakumar Thiagarajan <vthiagar@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
bc07ddb29a7b71ad009bcd84bee4c93908cf22b6 02-Sep-2011 Kalle Valo <kvalo@qca.qualcomm.com> ath6kl: read fwlog from firmware ring buffer

Firmare sends the logs only when it's internal ring buffer is full. But
if firmware crashes we need to retrieve the latest logs through diagnose
window. This is now done everytime the debugfs file is read.

Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
addb44be036dd5fc814be770ec4b90f08c820e76 02-Sep-2011 Kalle Valo <kvalo@qca.qualcomm.com> ath6kl: cleanup diagnose window read and write functions

Just to make them a bit easier to read and unify naming. 32 suffix
in the function name means that it will be a 32 bit transfer. If there's
no number a buffer is transfered instead.

Use void pointers to get rid of ugly casts.

Don't provide target address as a pointer, pass it by value. Same for
the value used in write32().

Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
003353b0d27489228eff79447d0731687cea0207 01-Sep-2011 Kalle Valo <kvalo@qca.qualcomm.com> ath6kl: add testmode support

This is port from the staging version of ath6kl. The interface to user space
is exactly same.

Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
a587526a44d0c2812ee9d650e7c0626b48697aca 30-Aug-2011 Edward Lu <elu@qca.qualcomm.com> ath6kl: Do not clear CONNECT bit setting in AP mode for STA disconnect

Signed-off-by: Edward Lu <elu@qca.qualcomm.com>
Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
9a5b13182cc10d693c55a5c02d753e54514b9bfc 30-Aug-2011 Jouni Malinen <jouni@qca.qualcomm.com> ath6kl: Delay initial group key setup in AP mode

The target is not ready to accept addkey commands until the connect
event has been delivered, so delay these operations for the initial GTK.
In addition, properly set interface connected and mark netdev ready when
the AP mode setup has been completed.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
3c774bbab78435e349de2c88fc6e054716f8f2ea 30-Aug-2011 Jouni Malinen <jouni@qca.qualcomm.com> ath6kl: Fix AP mode (Re)AssocReq IE processing

Need to use correct length field for association request frame and
parse the IEs to find WPA/WPS/RSN IE. In addition, copying of the
IE better make sure it fits in into the buffer to avoid buffer
overflows.

In addition, add the (Re)AssocReq IEs to the cfg80211 new station
event for user space.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
abcb344b3b823c8c9eac6e13e45a53eaf1d5d00b 22-Jul-2011 Kalle Valo <kvalo@qca.qualcomm.com> ath6kl: implement suspend support

For now this is implemented so that if host supports power is kept in
the chip. If that's not supported, an error is returned and sdio stack
will remove the device during suspend.

Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
1df94a8578eb099d9362cc0b84ef85015c47bbc5 17-Aug-2011 Vasanthakumar Thiagarajan <vthiagar@qca.qualcomm.com> ath6kl: Fix buffer alignment for scatter-gather I/O

For non-scatter buffers, there is already a bounce buffer which
takes care of alignment. This patch is influenced by a rough patch of
Kalle.

Signed-off-by: Vasanthakumar Thiagarajan <vthiagar@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
31024d99003486c90c793dea58b55f7920f0488b 11-Jul-2011 Kevin Fang <kevin.fang@qca.qualcomm.com> ath6kl: Add beginning of AR6004 initialisation support

Support isn't complete yet.

Signed-off-by: Kevin Fang <kevin.fang@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
ad226ec22b92d7f0f834015149b1d1118e017f16 10-Aug-2011 Kalle Valo <kvalo@qca.qualcomm.com> ath6kl: fix function name conflicts with ath9k

Stephen reported that compilation fails if both ath6kl and ath9k are
compiled in:

drivers/net/wireless/ath/ath6kl/built-in.o: In function `htc_start':
(.opd+0x600): multiple definition of `htc_start'
drivers/net/wireless/ath/ath9k/built-in.o:(.opd+0x3e40): first defined here
drivers/net/wireless/ath/ath6kl/built-in.o: In function `.htc_stop':
(.text+0x7b40): multiple definition of `.htc_stop'
drivers/net/wireless/ath/ath9k/built-in.o:(.text+0x67b34): first defined he=
re
drivers/net/wireless/ath/ath6kl/built-in.o: In function `.htc_start':
(.text+0x7d18): multiple definition of `.htc_start'
drivers/net/wireless/ath/ath9k/built-in.o:(.text+0x67ba0): first defined he=
re
drivers/net/wireless/ath/ath6kl/built-in.o: In function `htc_stop':
(.opd+0x5e8): multiple definition of `htc_stop'
drivers/net/wireless/ath/ath9k/built-in.o:(.opd+0x3e28): first defined here

To fix this add ath6kl prefix to all public functions in htc.c.

Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
575b5f34aa089cdaf92dda905d3b1dff1947f257 19-Jul-2011 Raja Mani <rmani@qca.qualcomm.com> ath6kl: Use bit field macros to maintain wlan enabled and disabled status

Signed-off-by: Raja Mani <rmani@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
bdcd81707973cf8aa9305337166f8ee842a050d4 17-Jul-2011 Kalle Valo <kvalo@qca.qualcomm.com> Add ath6kl cleaned up driver

Last May we started working on cleaning up ath6kl driver which is
currently in staging. The work has happened in a separate
ath6kl-cleanup tree:

http://git.kernel.org/?p=linux/kernel/git/kvalo/ath6kl-cleanup.git;a=summary

After over 1100 (!) patches we have now reached a state where I would
like to start discussing about pushing the driver to the wireless
trees and replacing the staging driver.

The driver is now a lot smaller and looks like a proper Linux driver.
The size of the driver (measured with simple wc -l) dropped from 49
kLOC to 18 kLOC and the number of the .c and .h files dropped from 107
to 22. Most importantly the number of subdirectories reduced from 26
to zero :)

There are two remaining checkpatch warnings in the driver which we
decided to omit for now:

drivers/net/wireless/ath/ath6kl/debug.c:31:
WARNING: printk() should include KERN_ facility level
drivers/net/wireless/ath/ath6kl/sdio.c:527:
WARNING: msleep < 20ms can sleep for up to 20ms;
see Documentation/timers/timers-howto.txt

The driver has endian annotations for all the hardware specific
structures and there are no sparse errors. Unfortunately I don't have
any big endian hardware to test that right now.

We have been testing the driver both on x86 and arm platforms. The
code is also compiled with sparc and parisc cross compilers.

Notable missing features compared to the current staging driver are:

o HCI over SDIO support
o nl80211 testmode
o firmware logging
o suspend support

Testmode, firmware logging and suspend support will be added soon. HCI
over SDIO support will be more difficult as the HCI driver needs to
share code with the wifi driver. This is something we need to research
more.

Also I want to point out the changes I did for signed endian support.
As I wasn't able to find any support for signed endian annotations I
decided to follow what NTFS has done and added my own. Grep for sle16
and sle32, especially from wmi.h.

Various people have been working on the cleanup, the hall of
fame based on number of patches is:

543 Vasanthakumar Thiagarajan
403 Raja Mani
252 Kalle Valo
16 Vivek Natarajan
12 Suraj Sumangala
3 Joe Perches
2 Jouni Malinen

Signed-off-by: Vasanthakumar Thiagarajan <vthiagar@qca.qualcomm.com>
Signed-off-by: Raja Mani <rmani@qca.qualcomm.com>
Signed-off-by: Vivek Natarajan <nataraja@qca.qualcomm.com>
Signed-off-by: Suraj Sumangala <surajs@qca.qualcomm.com>
Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>