History log of /linux-master/drivers/net/wireless/ath/ath9k/htc_drv_main.c
Revision Date Author Comments
# 0a44dfc0 29-Jan-2024 Johannes Berg <johannes.berg@intel.com>

wifi: mac80211: simplify non-chanctx drivers

There are still surprisingly many non-chanctx drivers, but in
mac80211 that code is a bit awkward. Simplify this by having
those drivers assign 'emulated' ops, so that the mac80211 code
can be more unified between non-chanctx/chanctx drivers. This
cuts the number of places caring about it by about 15, which
are scattered across - now they're fewer and no longer in the
channel context handling.

Link: https://msgid.link/20240129194108.6d0ead50f5cf.I60d093b2fc81ca1853925a4d0ac3a2337d5baa5b@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>


# 3b86f86d 14-Aug-2023 Arnd Bergmann <arnd@arndb.de>

wifi: ath: remove unused-but-set parameter

This has never been used since the driver was merged, but it now causes
a W=1 warning in recent clang versions

drivers/net/wireless/ath/ath9k/main.c:1566:21: error: parameter 'changed_flags' set but not used [-Werror,-Wunused-but-set-parameter]
drivers/net/wireless/ath/ath9k/htc_drv_main.c:1258:25: error: parameter 'changed_flags' set but not used [-Werror,-Wunused-but-set-parameter]
drivers/net/wireless/ath/ath5k/mac80211-ops.c:367:62: error: parameter 'changed_flags' set but not used [-Werror,-Wunused-but-set-parameter]

Remove the bit manipulation on the otherwise unused parameter.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Reviewed-by: Jeff Johnson <quic_jjohnson@quicinc.com>
Acked-by: Toke Høiland-Jørgensen <toke@toke.dk>
Signed-off-by: Kalle Valo <quic_kvalo@quicinc.com>
Link: https://lore.kernel.org/r/20230814073255.1065242-1-arnd@kernel.org


# b2fd72aa 31-Jul-2023 Ruan Jinjie <ruanjinjie@huawei.com>

wifi: ath9k: Remove unnecessary ternary operators

Ther are a little ternary operators, the true or false judgement
of which is unnecessary in C language semantics.

Signed-off-by: Ruan Jinjie <ruanjinjie@huawei.com>
Acked-by: Toke Høiland-Jørgensen <toke@toke.dk>
Signed-off-by: Kalle Valo <quic_kvalo@quicinc.com>
Link: https://lore.kernel.org/r/20230731124455.2039184-1-ruanjinjie@huawei.com


# a790cc3a 09-Oct-2022 Alexander Wetzel <alexander@wetzel-home.de>

wifi: mac80211: add wake_tx_queue callback to drivers

mac80211 is fully switching over to the internal TX queue (iTXQ)
implementation. Update all drivers not yet providing the now mandatory
wake_tx_queue() callback.

As an side effect the netdev interfaces of all updated drivers will
switch to the noqueue qdisc.

Signed-off-by: Alexander Wetzel <alexander@wetzel-home.de>
[add staging drivers]
Signed-off-by: Johannes Berg <johannes.berg@intel.com>


# b3e2130b 24-Jun-2022 Johannes Berg <johannes.berg@intel.com>

wifi: mac80211: change QoS settings API to take link into account

Take the link into account in the QoS settings (EDCA parameters)
APIs.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>


# 7b7090b4 24-May-2022 Johannes Berg <johannes.berg@intel.com>

wifi: mac80211: split bss_info_changed method

Split the bss_info_changed method to vif_cfg_changed and
link_info_changed, with the latter getting a link ID.
Also change the 'changed' parameter to u64 already, we
know we need that.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>


# f276e20b 10-May-2022 Johannes Berg <johannes.berg@intel.com>

wifi: mac80211: move interface config to new struct

We'll use bss_conf for per-link configuration later, so
move out all the non-link-specific data out into a new
struct ieee80211_vif_cfg used in the vif.

Some adjustments were done with the following spatch:

@@
expression sdata;
struct ieee80211_vif *vifp;
identifier var = { assoc, ibss_joined, aid, arp_addr_list, arp_addr_cnt, ssid, ssid_len, s1g, ibss_creator };
@@
(
-sdata->vif.bss_conf.var
+sdata->vif.cfg.var
|
-vifp->bss_conf.var
+vifp->cfg.var
)

@bss_conf@
struct ieee80211_bss_conf *bss_conf;
identifier var = { assoc, ibss_joined, aid, arp_addr_list, arp_addr_cnt, ssid, ssid_len, s1g, ibss_creator };
@@
-bss_conf->var
+vif_cfg->var

(though more manual fixups were needed, e.g. replacing
"vif_cfg->" by "vif->cfg." in many files.)

Signed-off-by: Johannes Berg <johannes.berg@intel.com>


# 046d2e7c 04-Apr-2022 Sriram R <quic_srirrama@quicinc.com>

mac80211: prepare sta handling for MLO support

Currently in mac80211 each STA object is represented
using sta_info datastructure with the associated
STA specific information and drivers access ieee80211_sta
part of it.

With MLO (Multi Link Operation) support being added
in 802.11be standard, though the association is logically
with a single Multi Link capable STA, at the physical level
communication can happen via different advertised
links (uniquely identified by Channel, operating class,
BSSID) and hence the need to handle multiple link
STA parameters within a composite sta_info object
called the MLD STA. The different link STA part of
MLD STA are identified using the link address which can
be same or different as the MLD STA address and unique
link id based on the link vif.

To support extension of such a model, the sta_info
datastructure is modified to hold multiple link STA
objects with link specific params currently within
sta_info moved to this new structure. Similarly this is
done for ieee80211_sta as well which will be accessed
within mac80211 as well as by drivers, hence trivial
driver changes are expected to support this.

For current non MLO supported drivers, only one link STA
is present and link information is accessed via 'deflink'
member.

For MLO drivers, we still need to define the APIs etc. to
get the correct link ID and access the correct part of
the station info.

Currently in mac80211, all link STA info are accessed directly
via deflink. These will be updated to access via link pointers
indexed by link id with MLO support patches, with link id
being 0 for non MLO supported cases.

Except for couple of macro related changes, below spatch takes
care of updating mac80211 and driver code to access to the
link STA info via deflink.

@ieee80211_sta@
struct ieee80211_sta *s;
struct sta_info *si;
identifier var = {supp_rates, ht_cap, vht_cap, he_cap, he_6ghz_capa, eht_cap, rx_nss, bandwidth, txpwr};
@@

(
s->
- var
+ deflink.var
|
si->sta.
- var
+ deflink.var
)

@sta_info@
struct sta_info *si;
identifier var = {gtk, pcpu_rx_stats, rx_stats, rx_stats_avg, status_stats, tx_stats, cur_max_bandwidth};
@@

(
si->
- var
+ deflink.var
)

Signed-off-by: Sriram R <quic_srirrama@quicinc.com>
Link: https://lore.kernel.org/r/1649086883-13246-1-git-send-email-quic_srirrama@quicinc.com
[remove MLO-drivers notes from commit message, not clear yet; run spatch]
Signed-off-by: Johannes Berg <johannes.berg@intel.com>


# 144cd24d 14-Dec-2020 Jouni Malinen <jouni@codeaurora.org>

ath: Modify ath_key_delete() to not need full key entry

tkip_keymap can be used internally to avoid the reference to key->cipher
and with this, only the key index value itself is needed. This allows
ath_key_delete() call to be postponed to be handled after the upper
layer STA and key entry have already been removed. This is needed to
make ath9k key cache management safer.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Link: https://lore.kernel.org/r/20201214172118.18100-5-jouni@codeaurora.org


# 2a9311b5 26-Apr-2020 Jouni Malinen <jouni@codeaurora.org>

ath9k_htc: Set RX filter based to allow broadcast Action frame RX

Advertise support for multicast frame registration and update the RX
filter based on the recently added FIF_MCAST_ACTION to allow broadcast
Action frames to be received. This is needed for Device Provisioning
Protocol (DPP) use cases that use broadcast Public Action frames.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
Reported-by: kbuild test robot <lkp@intel.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Link: https://lore.kernel.org/r/20200426084733.7889-2-jouni@codeaurora.org


# 2ce113de 02-Oct-2019 Johannes Berg <johannes.berg@intel.com>

mac80211: simplify TX aggregation start

There really is no need to make drivers call the
ieee80211_start_tx_ba_cb_irqsafe() function and then
schedule the worker if all we want is to set a bit.

Add a new return value (that was previously considered
invalid) to indicate that the driver is immediately
ready for the session, and make drivers use it. The
only drivers that remain different are the Intel ones
as they need to negotiate more with the firmware.

Link: https://lore.kernel.org/r/1570007543-I152912660131cbab2e5d80b4218238c20f8a06e5@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>


# 413fd2f5 05-Dec-2017 Dan Carpenter <dan.carpenter@oracle.com>

ath9k_htc: Add a sanity check in ath9k_htc_ampdu_action()

Smatch generates a warning here:

drivers/net/wireless/ath/ath9k/htc_drv_main.c:1688 ath9k_htc_ampdu_action()
error: buffer overflow 'ista->tid_state' 8 <= 15

I don't know if it's a real bug or not but the other paths through this
function all ensure that "tid" is less than ATH9K_HTC_MAX_TID (8) so
checking here makes things more consistent.

Fixes: fb9987d0f748 ("ath9k_htc: Support for AR9271 chipset.")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>


# 50c8cd44 31-Aug-2017 Himanshu Jha <himanshujha199640@gmail.com>

ath9k: remove cast to void pointer

casting to void pointer from any pointer type and vice-versa is done
implicitly and therefore casting is not needed in such a case.

Done using Coccinellle.
Semantic Patch used :

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

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


Signed-off-by: Himanshu Jha <himanshujha199640@gmail.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>


# f286dd89 01-Jan-2016 Markus Elfring <elfring@users.sourceforge.net>

ath9k_htc: Replace a variable initialisation by an assignment in ath9k_htc_set_channel()

Replace an explicit initialisation for one local variable at the beginning
by a conditional assignment.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Reviewed-by: Oleksij Rempel <linux@rempel-privat.de>
Reviewed-by: Julian Calaby <julian.calaby@gmail.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>


# 57fbcce3 12-Apr-2016 Johannes Berg <johannes.berg@intel.com>

cfg80211: remove enum ieee80211_band

This enum is already perfectly aliased to enum nl80211_band, and
the only reason for it is that we get IEEE80211_NUM_BANDS out of
it. There's no really good reason to not declare the number of
bands in nl80211 though, so do that and remove the cfg80211 one.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>


# 50ea05ef 30-Dec-2015 Sara Sharon <sarasharon1@gmail.com>

mac80211: pass block ack session timeout to to driver

Currently mac80211 does not inform the driver of the session
block ack timeout when starting a rx aggregation session.
Drivers that manage the reorder buffer need to know this
parameter.
Seeing that there are now too many arguments for the
drv_ampdu_action() function, wrap them inside a structure.

Signed-off-by: Sara Sharon <sara.sharon@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>


# 5c352bf0 14-Dec-2015 Andrzej Hajda <a.hajda@samsung.com>

ath9k_htc: fix handling return value of ath9k_hw_calibrate

The function can return negative values in case of error.
Its result should be then tested for such case.

The problem has been detected using proposed semantic patch
scripts/coccinelle/tests/assign_signed_to_unsigned.cocci [1].

[1]: http://permalink.gmane.org/gmane.linux.kernel/2046107

Signed-off-by: Andrzej Hajda <a.hajda@samsung.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>


# e3abc8ff 16-Aug-2015 Emmanuel Grumbach <emmanuel.grumbach@intel.com>

mac80211: allow to transmit A-MSDU within A-MPDU

Advertise the capability to send A-MSDU within A-MPDU
in the AddBA request sent by mac80211. Let the driver
know about the peer's capabilities.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>


# 14250640 13-Aug-2015 Oleksij Rempel <linux@rempel-privat.de>

ath9k_htc: do ani shortcalibratio if we got -ETIMEDOUT

current code will handle -ETIMEDOUT as success which is probalbly wrong.

According to this comment I assume it is safe to handle -ETIMEDOUT as false:
drivers/net/wireless/ath/ath9k/calib.c
290 /*
291 * We timed out waiting for the noisefloor to load, probably due to an
292 * in-progress rx. Simply return here and allow the load plenty of time
293 * to complete before the next calibration interval. We need to avoid
294 * trying to load -50 (which happens below) while the previous load is
295 * still in progress as this can cause rx deafness. Instead by returning
296 * here, the baseband nf cal will just be capped by our present
297 * noisefloor until the next calibration timer.
298 */

Since no other error wariants are present, this patch is checking only
for (ret <= 0).

Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Oleksij Rempel <linux@rempel-privat.de>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>


# f0e44962 09-Jun-2015 Chun-Yeow Yeoh <yeohchunyeow@gmail.com>

ath9k_htc: add support of channel switch

Add the support of channel switching functionality, similar
to ath9k support.

Tested with TP-Link TL-WN722N and TL-WN821N.

Signed-off-by: Chun-Yeow Yeoh <yeohchunyeow@gmail.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>


# df140465 22-Apr-2015 Johannes Berg <johannes.berg@intel.com>

mac80211: remove support for IFF_PROMISC

This support is essentially useless as typically networks are encrypted,
frames will be filtered by hardware, and rate scaling will be done with
the intended recipient in mind. For real monitoring of the network, the
monitor mode support should be used instead.

Removing it removes a lot of corner cases.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>


# 93803b33 02-Mar-2015 Joe Perches <joe@perches.com>

wireless: Use eth_<foo>_addr instead of memset

Use the built-in function instead of memset.

Miscellanea:

Add #include <linux/etherdevice.h> where appropriate
Use ETH_ALEN instead of 6

Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: David S. Miller <davem@davemloft.net>


# a344d677 12-Jun-2014 Johannes Berg <johannes.berg@intel.com>

mac80211: allow drivers to support NL80211_SCAN_FLAG_RANDOM_ADDR

Allow drivers to support NL80211_SCAN_FLAG_RANDOM_ADDR with software
based scanning and generate a random MAC address for them for every
scan request with the flag.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>


# e6510b11 15-Nov-2014 Chun-Yeow Yeoh <yeohchunyeow@gmail.com>

ath9k|ath9k_htc: Seperate the software crypto flag for Tx and Rx

Use the sw_mgmt_crypto_tx flag to trigger the CCMP encryption
for transmitted management frames to be done in software while
the sw_mgmt_crypto_rx flag is used to trigger the CCMP decryption
for received management frames to be done in software.

Signed-off-by: Chun-Yeow Yeoh <yeohchunyeow@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>


# 911544f6 06-Nov-2014 Oleksij Rempel <linux@rempel-privat.de>

ath9k_htc: trigger spectral scan on set_channel

Signed-off-by: Oleksij Rempel <linux@rempel-privat.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>


# a4bcaf55 04-Sep-2014 Lorenzo Bianconi <lorenzo.bianconi83@gmail.com>

mac80211: extend set_coverage_class signature

Extend mac80211 set_coverage_class API in order to enable ACK timeout
estimation algorithm (dynack) passing coverage class equals to -1
to lower drivers. Synchronize set_coverage_class routine signature with
mac80211 function pointer for p54, ath9k, ath9k_htc and ath5k drivers.

Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi83@gmail.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>


# faf1dc64 14-May-2014 Rajkumar Manoharan <rmanohar@qti.qualcomm.com>

ath9k_htc: Stop ANI before doing hw_reset

During remain on channel request, ANI worker thread is not stopped
before doing hw reset. This is causing kernel crash in
hw_per_calibration. This change ensures that ANI is stopped before
doing chip reset and it will be rescheduled later when the chip is
configured back to home channel and having valid bss.

Reported-by: David Herrmann <dh.herrmann@gmail.com>
Tested-by: David Herrmann <dh.herrmann@gmail.com>
Signed-off-by: Rajkumar Manoharan <rmanohar@qti.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>


# cc24c86f 01-Mar-2014 Oleksij Rempel <linux@rempel-privat.de>

ath9k_htc: sync beacon slot code with ath9k

we will need it for common-beacon

Signed-off-by: Oleksij Rempel <linux@rempel-privat.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>


# c35ccb38 01-Mar-2014 Oleksij Rempel <linux@rempel-privat.de>

ath9k_htc: add ATH_OP_PRIM_STA_VIF

we will need it to make common-beacon code work.

Signed-off-by: Oleksij Rempel <linux@rempel-privat.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>


# 92c3f7ef 01-Mar-2014 Oleksij Rempel <linux@rempel-privat.de>

ath9k_htc: use common->op_flags

Signed-off-by: Oleksij Rempel <linux@rempel-privat.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>


# 88a4f56e 01-Mar-2014 Oleksij Rempel <linux@rempel-privat.de>

ath9k_htc: use ath_beacon_conf.enable_beacon

to reduce difference between ath9k and ath9k_htc

Signed-off-by: Oleksij Rempel <linux@rempel-privat.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>


# e5ba18c6 04-Feb-2014 Oleksij Rempel <linux@rempel-privat.de>

ath9k_htc: use ath9k_cmn_process_rssi

Signed-off-by: Oleksij Rempel <linux@rempel-privat.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>


# a243de48 03-Feb-2014 Stanislaw Gruszka <sgruszka@redhat.com>

ath9k_htc: avoid scheduling while atomic on sta_rc_update

mac80211 ->sta_rc_update() callback must be atomic. Since we have to
take mutex and do other operations that can sleep when sending fimrware
commands to device, the only option to satisfy atomicity requirement of
->sta_rc_update(), that I can see, is introduce work_struct and defer
uploading new rates to that work.

Tested-by: Oleksij Rempel <linux@rempel-privat.de>
Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>


# 2fa4cb90 28-Jan-2014 Stanislaw Gruszka <sgruszka@redhat.com>

ath9k_htc: make ->sta_rc_update atomic for most calls

sta_rc_update() callback must be atomic, hence we can not take mutexes
or do other operations, which can sleep in ath9k_htc_sta_rc_update().

I think we can just return from ath9k_htc_sta_rc_update(), if it is
called without IEEE80211_RC_SUPP_RATES_CHANGED bit. That will help
with scheduling while atomic bug for most cases (except mesh and IBSS
modes).

For mesh and IBSS I do not see other solution like creating additional
workqueue, because sending firmware command require us to sleep, but
this can be done in additional patch.

Patch partially fixes bug:
https://bugzilla.redhat.com/show_bug.cgi?id=990955

Cc: stable@vger.kernel.org
Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>


# 657eb17d 27-Nov-2013 Mathy Vanhoef <vanhoefm@gmail.com>

ath9k_htc: properly set MAC address and BSSID mask

Pick the MAC address of the first virtual interface as the new hardware MAC
address. Set BSSID mask according to this MAC address. This fixes CVE-2013-4579.

Signed-off-by: Mathy Vanhoef <vanhoefm@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>


# 2297f1c7 11-Oct-2013 Felix Fietkau <nbd@openwrt.org>

ath9k: make ath9k_cmn_update_ichannel static

Rework its wrapper function to make it more generic, using it as a
replacement for previous calls to ath9k_cmn_update_ichannel.

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>


# 8896934c 11-Oct-2013 Felix Fietkau <nbd@openwrt.org>

ath9k_hw: remove direct accesses to channel mode flags

Use wrappers where available. Simplifies code and helps with further
improvements to the channel data structure

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>


# 0671894f 16-Aug-2013 Simon Wunderlich <simon.wunderlich@s2003.tu-chemnitz.de>

ath9k: use chandef instead of channel_type

To enable support for 5/10 MHz, some internal functions must be
converted from using the (old) channel_type to chandef. This is a good
chance to change all remaining occurences.

Signed-off-by: Simon Wunderlich <siwu@hrz.tu-chemnitz.de>
Signed-off-by: Mathias Kretschmer <mathias.kretschmer@fokus.fraunhofer.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>


# 68185a4b 19-Jun-2013 Ben Greear <greearb@candelatech.com>

ath9k_htc: Add ethtool stats support.

This provides some of the same info found in
the ath9k_htc debugfs through the standard ethtool stats API.

This logic is only supported when ath9k_htc debugfs kernel
feature is enabled, since that is the only time stats
are actually gathered.

Signed-off-by: Ben Greear <greearb@candelatech.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>


# 156652bb 19-Jun-2013 Ben Greear <greearb@candelatech.com>

ath9k_htc: Support reporting tx and rx chain mask.

Signed-off-by: Ben Greear <greearb@candelatech.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>


# 075163bb 20-Jun-2013 Sujith Manoharan <c_manoha@qca.qualcomm.com>

ath9k_htc: Handle IDLE state transition properly

Make sure that a chip reset is done when IDLE is turned
off - this fixes authentication timeouts.

Cc: stable@vger.kernel.org
Reported-by: Ignacy Gawedzki <i@lri.fr>
Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>


# a226c3d9 09-Jun-2013 Oleksij Rempel <linux@rempel-privat.de>

ath9k_htc: add STBC TX support

All known ar7010+ar* device and current FW support STBC TX. This patch
make use of it and suggest to send STBC if peer support it.
I use wort "suggest" since currenly we have separate rate controller
in FW which will make decision based on rate and hardware.

Signed-off-by: Oleksij Rempel <linux@rempel-privat.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>


# e323300d 02-Jun-2013 Sujith Manoharan <c_manoha@qca.qualcomm.com>

ath9k: Simplify ANI initialization

The check "enable_ani" is not required since it is always
set to true and the logic for disabling/enabling ANI via
debugfs is done at a higher layer.

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>


# 594e65b6 08-May-2013 Javier Cardona <javier@cozybit.com>

ath9k_htc: Add support for mesh interfaces

More specifically, enable AP-style beaconing on mesh
ifaces and change the hw capabilities to reflect mesh
support.

Coexistence with a virtual STA interface was tested as
working fine.

Signed-off-by: Javier Cardona <javier@cozybit.com>
[rebase, add iface combinations]
Signed-off-by: Thomas Pedersen <thomas@cozybit.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>


# c60c9929 07-Apr-2013 Felix Fietkau <nbd@openwrt.org>

ath9k_common: remove ath9k_cmn_padpos

It is equivalent to ieee80211_hdrlen

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>


# 675a0b04 25-Mar-2013 Karl Beldan <karl.beldan@rivierawaves.com>

mac80211: Use a cfg80211_chan_def in ieee80211_hw_conf_chan

Drivers that don't use chanctxes cannot perform VHT association because
they still use a "backward compatibility" pair of {ieee80211_channel,
nl80211_channel_type} in ieee80211_conf and ieee80211_local.

Signed-off-by: Karl Beldan <karl.beldan@rivierawaves.com>
[fix kernel-doc]
Signed-off-by: Johannes Berg <johannes.berg@intel.com>


# 18b559d5 18-Jul-2012 Johannes Berg <johannes.berg@intel.com>

mac80211: split TX aggregation stop action

When TX aggregation is stopped, there are a few
different cases:
- connection with the peer was dropped
- session stop was requested locally
- session stop was requested by the peer
- connection was dropped while a session is stopping

The behaviour in these cases should be different, if
the connection is dropped then the driver should drop
all frames, otherwise the frames may continue to be
transmitted, aggregated in the case of a locally
requested session stop or unaggregated in the case of
the peer requesting session stop.

Split these different cases so that the driver can
act accordingly; however, treat local and remote stop
the same way and ask the driver to not send frames as
aggregated packets any more.

In the case of connection drop, the stop callback the
driver is otherwise supposed to call is no longer
required.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>


# bea843c7 21-Nov-2012 Sujith Manoharan <c_manoha@qca.qualcomm.com>

ath9k/ath9k_htc: Remove WME macros

Use the macros provided by mac80211 and remove redundant
declarations inside the drivers.

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>


# 8b2c9824 06-Nov-2012 Johannes Berg <johannes.berg@intel.com>

mac80211: clarify interface iteration and make it configurable

During hardware restart, all interfaces are iterated even
though they haven't been re-added to the driver, document
this behaviour. The same also happens during resume, which
is even more confusing since all of the interfaces were
previously removed from the driver. Make this optional so
drivers relying on the current behaviour can still use it,
but to let drivers that don't want this behaviour disable
it.

Also convert all API users, keeping the old semantics
except in hwsim, where the new normal ones are desired.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>


# 96f99d3d 08-Oct-2012 Mohammed Shafi Shajakhan <mohammed@qca.qualcomm.com>

ath9k_htc: Remove interface combination specific checks

Once the driver advertizes interface combination logic
based on its firmware/hardware limitation, cfg80211
takes care of all the necessary logic such as maximum
beaconing vifs, standlone interface etc.

Signed-off-by: Mohammed Shafi Shajakhan <mohammed@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>


# fed27f6f 04-Sep-2012 Mohammed Shafi Shajakhan <mohammed@qca.qualcomm.com>

ath9k_htc: minor cleanup in ath9k_htc_add_station

Signed-off-by: Mohammed Shafi Shajakhan <mohammed@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>


# e548c49e 04-Sep-2012 Johannes Berg <johannes.berg@intel.com>

mac80211: add key flag for management keys

Mark keys that might be used to receive management
frames so drivers can fall back on software crypto
for them if they don't support hardware offload.
As the new flag is only set correctly for RX keys
and the existing IEEE80211_KEY_FLAG_SW_MGMT flag
can only affect TX, also rename the latter to
IEEE80211_KEY_FLAG_SW_MGMT_TX.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>


# 69578029 12-Aug-2012 Antonio Quartulli <ordex@autistici.org>

ath9k_htc: implement sta_rc_update() mac80211 callback

In case of changes in the supported rates set for a given station, it is now
possible to use this callback to update the current internal state of the
station in the htc driver.

Reported-by: Gui Iribarren <gui@altermundi.net>
Signed-off-by: Antonio Quartulli <ordex@autistici.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>


# 36323f81 23-Jul-2012 Thomas Huehn <thomas@net.t-labs.tu-berlin.de>

mac80211: move TX station pointer and restructure TX

Remove the control.sta pointer from ieee80211_tx_info to free up
sufficient space in the TX skb control buffer for the upcoming
Transmit Power Control (TPC).
Instead, the pointer is now on the stack in a new control struct
that is passed as a function parameter to the drivers' tx method.

Signed-off-by: Thomas Huehn <thomas@net.t-labs.tu-berlin.de>
Signed-off-by: Alina Friedrichsen <x-alina@gmx.net>
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
[reworded commit message]
Signed-off-by: Johannes Berg <johannes.berg@intel.com>


# 60ca9f87 17-Jul-2012 Sujith Manoharan <c_manoha@qca.qualcomm.com>

ath9k_hw: Cleanup ath9k_hw_set_tsfadjust

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>


# 531bd079 15-Jul-2012 Felix Fietkau <nbd@openwrt.org>

ath9k/ath9k_htc: fix txop limit handling

In all those years apparently nobody noticed that the txop limit programmed
into the chip was off by a factor of 32 (!), probably because the VI and VO
queues aren't used that much aside from mgmt frames on VO.

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>


# 6bcfe67f 25-Jun-2012 Sujith Manoharan <c_manoha@qca.qualcomm.com>

ath9k_htc: Fix IDLE power save

Remove the radio enable/disable stuff and fix the
transition to FULL_SLEEP mode when the device is idle.

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>


# d8a2c51c 25-Jun-2012 Sujith Manoharan <c_manoha@qca.qualcomm.com>

ath9k_htc: Use atomic operations for op_flags

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>


# 931cb03a 20-Jun-2012 Rajkumar Manoharan <rmanohar@qca.qualcomm.com>

ath9k_htc: configure bssid on ASSOC/IBSS change

After the change "mac80211: remove spurious BSSID change flag",
BSS_CHANGED_BSSID will not be passed on association or IBSS
status changes. So it could be better to program bssid on ASSOC
or IBSS change notification. Not doing so, is affecting the
packet transmission.

Cc: stable@vger.kernel.org [3.4+]
Reported-by: Michael Leun <lkml20120218@newton.leun.net>
Signed-off-by: Rajkumar Manoharan <rmanohar@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>


# 8efa7a81 14-Mar-2012 Felix Fietkau <nbd@openwrt.org>

ath9k_hw: remove ath9k_hw_htc_resetinit

Automatically set the ah->htc_reset_init on init and after PHY disable.

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>


# bf047fcd 21-Feb-2012 Sujith Manoharan <c_manoha@qca.qualcomm.com>

ath9k_htc: Start/stop btcoex using a helper

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>


# d7d312ca 17-Jan-2012 Antonio Quartulli <ordex@autistici.org>

ath9k_htc: claim support for IBSS RSN

Skip group keys configuration in hardware in order to make IBSS RSN work.
Keys will be managed using software.

Signed-off-by: Antonio Quartulli <ordex@autistici.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>


# 8a309305 17-Dec-2011 Felix Fietkau <nbd@openwrt.org>

ath9k_hw: make bluetooth coexistence support optional at compile time

Many systems (e.g. embedded systems) do not have wifi modules connected to
bluetooth modules, so bluetooth coexistence is irrelevant there. With the
addition of MCI support, ath9k picked up quite a bit of extra code that
can be compiled out this way.

This patch redefines ATH9K_HW_CAP_MCI and adds an inline wrapper for
querying the bluetooth coexistence scheme, allowing the compiler to
eliminate code that uses it, with only very little use of #ifdef.

On MIPS this reduces the total size for the modules by about 20k.

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>


# d2182b69 15-Dec-2011 Joe Perches <joe@perches.com>

ath: Convert ath_dbg(bar, ATH_DBG_<FOO>, to ath_dbg(bar, FOO

Add ATH_DBG_ to macros to shorten the uses and
reduce the line count.

Coalesce ath_dbg formats.
Add missing spaces to coalesced formats.
Add missing newline terminations to ath_dbg formats.
Align ath_dbg arguments where appropriate.
Standardize ath_dbg formats without periods.

Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>


# 4279425c 02-Dec-2011 Nikolay Martynov <mar.kolya@gmail.com>

ath9k: use config.enable_ani to check if ani should be performed

Currently in ath9k code there is an attempt which is meant to
disable ANI for ar9100 and ar9340. But it doesn't really achieve
this. All it does is disable ANI init and setup (i.e. calls to
ath9k_hw_ani_setup and ath9k_hw_ani_init). Since ath9k_hw_ani_setup is
not called ah->config.ani_poll_interval is never initialized (i.e. it
is always zero) and ath_ani_calibrate always executes ANI procedures
(over uninitialized ANI parameters).
Moreover, ath_ani_calibrate is being called each 1ms because
common->ani.timer is set to zero interval because
ah->config.ani_poll_interval==0 (and thus smallest value of all
intervals). Normally it should not be called this often.
This patch changes the code so config.enable_ani is used to check if
ANI should be performed.
config.enable_ani is initialized to true by default. This patch sets
it to false for ar9100 and ar9340.

Signed-off-by: Nikolay Martynov <mar.kolya@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>


# 8a3a3c85 02-Oct-2011 Eliad Peller <eliad@wizery.com>

mac80211: pass vif param to conf_tx() callback

tx params should be configured per interface.
add ieee80211_vif param to the conf_tx callback,
and change all the drivers that use this callback.

The following spatch was used:
@rule1@
struct ieee80211_ops ops;
identifier conf_tx_op;
@@
ops.conf_tx = conf_tx_op;

@rule2@
identifier rule1.conf_tx_op;
identifier hw, queue, params;
@@
conf_tx_op (
- struct ieee80211_hw *hw,
+ struct ieee80211_hw *hw, struct ieee80211_vif *vif,
u16 queue,
const struct ieee80211_tx_queue_params *params) {...}

Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>


# 37a41b4a 21-Sep-2011 Eliad Peller <eliad@wizery.com>

mac80211: add ieee80211_vif param to tsf functions

TSF can be kept per vif.
Add ieee80211_vif param to set/get/reset_tsf, and move
the debugfs entries to the per-vif directory.

Update all the drivers that implement these callbacks.

Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>


# 82b2d334 02-Sep-2011 Felix Fietkau <nbd@openwrt.org>

ath9k: eliminate common->{rx,tx}_chainmask

we already have ah->{rx,tx}chainmask for the same purpose

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>


# 1ba45b9e 27-Aug-2011 Larry Finger <Larry.Finger@lwfinger.net>

ath9k: Fix a smatch warnings

Smatch shows the following warnings:

CHECK drivers/net/wireless/ath/ath9k/htc_drv_main.c
drivers/net/wireless/ath/ath9k/htc_drv_main.c +1315 ath9k_htc_configure_filter(27) warn: inconsistent returns mutex:&priv->mutex: locked (1303) unlocked (1315)

CHECK drivers/net/wireless/ath/ath9k/ar9003_eeprom.c
drivers/net/wireless/ath/ath9k/ar9003_eeprom.c +3321 ar9300_eeprom_restore_internal(20) warn: returning -1 instead of -ENOMEM is sloppy

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>


# 5fa71984 24-Aug-2011 Mohammed Shafi Shajakhan <mohammed@qca.qualcomm.com>

ath9k_htc: Add get_stats call back

currently this call back is used only in debugfs of mac80211

Signed-off-by: Mohammed Shafi Shajakhan <mohammed@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>


# 565dfefb 07-Jul-2011 Rajkumar Manoharan <rmanohar@qca.qualcomm.com>

ath9k_htc: do not configure filter before driver is started

Signed-off-by: Rajkumar Manoharan <rmanohar@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>


# 5b68138e 17-May-2011 Sujith Manoharan <Sujith.Manoharan@atheros.com>

ath9k: Drag the driver to the year 2011

The Times They Are a-Changin'.

Signed-off-by: Sujith Manoharan <Sujith.Manoharan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>


# bd548799 16-May-2011 Sujith Manoharan <Sujith.Manoharan@atheros.com>

ath9k_htc: Fix max subframe handling

Commit "ath9k_htc: Fix AMPDU subframe handling" registered the maximum
subframe limit of the driver with mac80211, which was used in ADDBA
negotiation. While technically correct, this causes inter-operability issues
with a few APs. Revert to the older behavior to fix this.

Signed-off-by: Sujith Manoharan <Sujith.Manoharan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>


# 0cd075d7 16-May-2011 Sujith Manoharan <Sujith.Manoharan@atheros.com>

ath9k_htc: Fix BSSID calculation

The BSSID/AID has to be set for the first associated station interface.
Subsequent interfaces may move out of assoc/disassoc status, in which
case, the BSSID has to be re-calculated from the available interfaces.
Also, ANI should be enabled or disabled based on the current opmode.

Signed-off-by: Sujith Manoharan <Sujith.Manoharan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>


# db32124a 16-May-2011 Sujith Manoharan <Sujith.Manoharan@atheros.com>

ath9k_htc: Recalculate the BSSID mask on interface

Signed-off-by: Sujith Manoharan <Sujith.Manoharan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>


# 84dfa730 16-May-2011 Sujith Manoharan <Sujith.Manoharan@atheros.com>

ath9k_htc: Fix station flags

The FW does absolutely nothing with the station flags,
so remove them. But keep the field around since it might
come in handy in the future.

Signed-off-by: Sujith Manoharan <Sujith.Manoharan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>


# c75197a7 16-May-2011 Sujith Manoharan <Sujith.Manoharan@atheros.com>

ath9k_htc: Fix mode selection

Remove all the unsupported modes like FH, TURBO etc.
Since this requires a FW update, increase the fw version to 1.3

Signed-off-by: Sujith Manoharan <Sujith.Manoharan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>


# d244f21e 28-Apr-2011 Sujith Manoharan <Sujith.Manoharan@atheros.com>

ath9k_htc: Revamp LED management

Remove all the convoluted hacks in the driver and simplify things
by making use of mac80211's LED triggers.

Signed-off-by: Sujith Manoharan <Sujith.Manoharan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>


# e2186b7c 27-Apr-2011 Sujith Manoharan <Sujith.Manoharan@atheros.com>

ath9k_htc: Add set_bitrate_mask() callback

This callback is used to set the minimum rate for management
frames.

Signed-off-by: Sujith Manoharan <Sujith.Manoharan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>


# c58ca5b5 19-Apr-2011 Sujith Manoharan <Sujith.Manoharan@atheros.com>

ath9k_htc: Use power save wrappers when accessing HW

Signed-off-by: Sujith Manoharan <Sujith.Manoharan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>


# f0dd4980 19-Apr-2011 Sujith Manoharan <Sujith.Manoharan@atheros.com>

ath9k_htc: Fix max A-MPDU size handling

Set the maximum ampdu size of a station correctly
in the target by using the ampdu_factor.

Signed-off-by: Sujith Manoharan <Sujith.Manoharan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>


# 3a0593ef 20-Apr-2011 Sujith Manoharan <Sujith.Manoharan@atheros.com>

ath9k_htc: Fix AMPDU subframe handling

* Register the driver's maximum ampdu subframe limit to mac80211.
* Cleanup the target capabilities structure and fix an endian issue.
* Fix BTCOEX by sending a command to the target when the BT priority
changes.
* Bump the required firmware version to 1.1

Signed-off-by: Sujith Manoharan <Sujith.Manoharan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>


# 0ff2b5c0 19-Apr-2011 Sujith Manoharan <Sujith.Manoharan@atheros.com>

ath9k: Fix warnings from -Wunused-but-set-variable

Signed-off-by: Sujith Manoharan <Sujith.Manoharan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>


# 859c3ca1 12-Apr-2011 Sujith Manoharan <Sujith.Manoharan@atheros.com>

ath9k_htc: Add a timer to cleanup WMI events

Occasionally, a WMI event would arrive ahead of the TX
URB completion handler. Discarding these events would exhaust
the available TX slots, so handle them by running a timer
cleaning up such events. Also, timeout packets for which TX
completion events have not arrived.

Signed-off-by: Sujith Manoharan <Sujith.Manoharan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>


# 84c9e164 12-Apr-2011 Sujith Manoharan <Sujith.Manoharan@atheros.com>

ath9k_htc: Drain packets on station removal

When a station entry is removed, there could still be
pending packets destined for that station in the HIF layer.
Sending these to the target is not necessary, so drain them
in the driver itself.

Signed-off-by: Sujith Manoharan <Sujith.Manoharan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>


# b587fc81 12-Apr-2011 Sujith Manoharan <Sujith.Manoharan@atheros.com>

ath9k_htc: Drain pending TX frames properly

When doing a channel set or a reset operation the pending
frames queued up for transmission have to be flushed and
sent to mac80211. Fixing this has to be done in two separate
steps:

* Flush queued frames and kill the URB TX completion handler.
* Complete all the frames that in the TX pending queue.

This patch adds proper support for draining and all the callsites
namely, channel change/reset/idle/stop are fixed. A separate queue
is used for handling failed frames.

Signed-off-by: Sujith Manoharan <Sujith.Manoharan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>


# 2c5d57f0 12-Apr-2011 Sujith Manoharan <Sujith.Manoharan@atheros.com>

ath9k_htc: Add TX slots

Maintain a bitmap of slots for transmission and update
the cookie field for every packet with the slot value.
This value would be used for matching packets when TX
completion processing is added.

Signed-off-by: Sujith Manoharan <Sujith.Manoharan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>


# 8e86a547 12-Apr-2011 Sujith Manoharan <Sujith.Manoharan@atheros.com>

ath9k_htc: Fix TX queue management

Handle queue start/stop properly by maintaining
a counter to check if the pending frame count has
exceeded the threshold. Otherwise, packets would be
dropped needlessly. While at it, use a simple flag
to track queue status and use helper functions too.

Signed-off-by: Sujith Manoharan <Sujith.Manoharan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>


# 658ef04f 12-Apr-2011 Sujith Manoharan <Sujith.Manoharan@atheros.com>

ath9k_htc: Move TX specific stuff to a separate structure

Signed-off-by: Sujith Manoharan <Sujith.Manoharan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>


# e4c62506 12-Apr-2011 Sujith Manoharan <Sujith.Manoharan@atheros.com>

ath9k_htc: Sync struct ath9k_htc_target_vif with FW

Signed-off-by: Sujith Manoharan <Sujith.Manoharan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>


# b97c57ff 12-Apr-2011 Sujith Manoharan <Sujith.Manoharan@atheros.com>

ath9k_htc: Sync struct ath9k_htc_target_sta with FW

Signed-off-by: Sujith Manoharan <Sujith.Manoharan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>


# 8e42e4ba 12-Apr-2011 Sujith Manoharan <Sujith.Manoharan@atheros.com>

ath9k_htc: Move debug code to a separate file

Signed-off-by: Sujith Manoharan <Sujith.Manoharan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>


# f4c88991 12-Apr-2011 Sujith Manoharan <Sujith.Manoharan@atheros.com>

ath9k_htc: Queue WMI events

Use a queue to handle WMI events and schedule a tasklet
to process the events. This fixes the race between the
WMI event ISR and the SWBA tasklet when the arrival of
WMI events in quick succession could overwrite the SWBA
data before the tasklet from a previous iteration could
have been scheduled. Also, drain the WMI queue properly.

Signed-off-by: Sujith Manoharan <Sujith.Manoharan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>


# 7d547eb4 12-Apr-2011 Sujith Manoharan <Sujith.Manoharan@atheros.com>

ath9k_htc: Handle buffered frames in AP mode

Use the CAB endpoint to send buffered multicast or
broadcast frames after each SWBA event.

Signed-off-by: Sujith Manoharan <Sujith.Manoharan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>


# 9b674a02 12-Apr-2011 Sujith Manoharan <Sujith.Manoharan@atheros.com>

ath9k_htc: Add TSF adjust capability

In multi-interface mode, beacons/probe responses that are
sent out must have their timestamp field updated. Calculate
the TSF adjustment value for each beaconing interface and set it
in the frame properly.

Signed-off-by: Sujith Manoharan <Sujith.Manoharan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>


# 832f6a18 12-Apr-2011 Sujith Manoharan <Sujith.Manoharan@atheros.com>

ath9k_htc: Add beacon slots

Beacon transmission is now handled through a slot mechanism.
This allows multiple beaconing interfaces to be be present.

Signed-off-by: Sujith Manoharan <Sujith.Manoharan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>


# e7a2a4f5 26-Feb-2011 Sujith Manoharan <Sujith.Manoharan@atheros.com>

ath9k_htc: Handle BSSID/AID for multiple interfaces

The AID and BSSID should be set in the HW only for the
first station interface or adhoc interface. Also, cancel
the ANI timer in stop() for multi-STA scenario. And finally
configure the HW beacon timers only for the first station
interface.

Signed-off-by: Sujith Manoharan <Sujith.Manoharan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>


# 7bb45683 24-Feb-2011 Johannes Berg <johannes.berg@intel.com>

mac80211: make tx() operation return void

The return value of the tx operation is commonly
misused by drivers, leading to errors. All drivers
will drop frames if they fail to TX the frame, and
they must also properly manage the queues (if they
didn't, mac80211 would already warn).

Removing the ability for drivers to return a BUSY
value also allows significant cleanups of the TX
TX handling code in mac80211.

Note that this also fixes a bug in ath9k_htc, the
old "return -1" there was wrong.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Tested-by: Sedat Dilek <sedat.dilek@googlemail.com> [ath5k]
Acked-by: Gertjan van Wingerde <gwingerde@gmail.com> [rt2x00]
Acked-by: Larry Finger <Larry.Finger@lwfinger.net> [b43, rtl8187, rtlwifi]
Acked-by: Luciano Coelho <coelho@ti.com> [wl12xx]
Signed-off-by: John W. Linville <linville@tuxdriver.com>


# a5fae37d 20-Feb-2011 Sujith Manoharan <Sujith.Manoharan@atheros.com>

ath9k_htc: Configure beacon timers in AP mode

Handle multi-interface situations by checking if
AP interfaces are already present.

Signed-off-by: Sujith Manoharan <Sujith.Manoharan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>


# a236254c 20-Feb-2011 Sujith Manoharan <Sujith.Manoharan@atheros.com>

ath9k_htc: Add ANI for AP mode

The time granularity for the ANI task is different for AP and
station mode.

Signed-off-by: Sujith Manoharan <Sujith.Manoharan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>


# ffbe7c83 20-Feb-2011 Sujith Manoharan <Sujith.Manoharan@atheros.com>

ath9k_htc: Calculate and set the HW opmode

Signed-off-by: Sujith Manoharan <Sujith.Manoharan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>


# da8d9d93 20-Feb-2011 Sujith Manoharan <Sujith.Manoharan@atheros.com>

ath9k_htc: Allow AP interface to be created

Signed-off-by: Sujith Manoharan <Sujith.Manoharan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>


# 0df8359a 20-Feb-2011 Sujith Manoharan <Sujith.Manoharan@atheros.com>

ath9k_htc: Maintain individual counters for interfaces

This is required for allowing only one IBSS interface to be
configured.

Signed-off-by: Sujith Manoharan <Sujith.Manoharan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>


# 87df8957 20-Feb-2011 Sujith Manoharan <Sujith.Manoharan@atheros.com>

ath9k_htc: Protect ampdu_action with a mutex

This is required when issuing commands to the firmware.

Signed-off-by: Sujith Manoharan <Sujith.Manoharan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>


# 585895cd 20-Feb-2011 Sujith Manoharan <Sujith.Manoharan@atheros.com>

ath9k_htc: Set the BSSID mask for multiple interfaces

Signed-off-by: Sujith Manoharan <Sujith.Manoharan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>


# 7c277349 20-Feb-2011 Sujith Manoharan <Sujith.Manoharan@atheros.com>

ath9k_htc: Remove OP_ASSOCIATED variable

mac80211 stores the association state in ieee80211_bss_conf.
Use this and remove the local state, which is incorrect anyway
since it is stored globally and not on a per-VIF basis.

Restarting ANI and reconfiguration of HW beacon timers when a
scan run ends requires more work. This is handled by iterating
over the active interfaces.

Finally, remove the useless check for associated status in RX
processing.

Signed-off-by: Sujith Manoharan <Sujith.Manoharan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>


# 9304c82d 20-Feb-2011 Sujith Manoharan <Sujith.Manoharan@atheros.com>

ath9k_htc: Remove OP_PROTECT_ENABLE

CTS protection can be obtained from mac80211 directly.

Signed-off-by: Sujith Manoharan <Sujith.Manoharan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>


# cf04e772 20-Feb-2011 Sujith Manoharan <Sujith.Manoharan@atheros.com>

ath9k_htc: Remove OP_PREAMBLE_SHORT

mac80211's BSS info can be used for this.

Signed-off-by: Sujith Manoharan <Sujith.Manoharan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>


# ab77c70a 20-Feb-2011 Sujith Manoharan <Sujith.Manoharan@atheros.com>

ath9k_htc: Fix error handling in add_interface

Addition of a station might fail - handle this error
properly by removing the VAP on the target.
Also, bail out immediately if the max. no of interfaces
has been reached.

Signed-off-by: Sujith Manoharan <Sujith.Manoharan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>


# 1057b750 20-Feb-2011 Sujith Manoharan <Sujith.Manoharan@atheros.com>

ath9k_htc: Unify target capability updating

Update capabilites on the target once, when
start() is called, there is no need for redundant
updating on adding an interface.

Signed-off-by: Sujith Manoharan <Sujith.Manoharan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>


# a97b478c 20-Feb-2011 Sujith Manoharan <Sujith.Manoharan@atheros.com>

ath9k_htc: Allow upto two simultaneous interfaces

Multiple interfaces can be configured if a slot is free
on the target. Monitor mode also requires a slot.

The maximum number of stations that can be handled in
the firmware is 8, manage the station slots accordingly.

Signed-off-by: Sujith Manoharan <Sujith.Manoharan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>


# 8354dd3e 18-Feb-2011 Vivek Natarajan <vnatarajan@atheros.com>

ath9k_htc: Fix a compilation warning.

Initialize caldata to avoid compilation warning.

CC [M] drivers/net/wireless/ath/ath9k/htc_drv_main.o
drivers/net/wireless/ath/ath9k/htc_drv_main.c: In function ‘ath9k_htc_config’:
drivers/net/wireless/ath/ath9k/htc_drv_main.c:172: warning: ‘caldata’ may be used uninitialized in this function
drivers/net/wireless/ath/ath9k/htc_drv_main.c:172: note: ‘caldata’ was declared here

Signed-off-by: Vivek Natarajan <vnatarajan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>


# b2a5c3df 31-Jan-2011 Rajkumar Manoharan <rmanoharan@atheros.com>

ath9k_htc: make use common of function to update txpower

Signed-off-by: Rajkumar Manoharan <rmanoharan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>


# 45655baa 31-Jan-2011 Rajkumar Manoharan <rmanoharan@atheros.com>

ath9k_htc: cancel ani work in ath9k_htc_stop

ani work is cancelled in dissaoctiation. But in some cases
during suspend, deauthention never be called. So we failed
to stop ani work which was identified by the following
warning.

Call Trace:
[<ffffffffa0454a1d>] ieee80211_can_queue_work.clone.17+0x2d/0x40 [mac80211]
[<ffffffffa0454a60>] ieee80211_queue_delayed_work+0x30/0x60 [mac80211]
[<ffffffffa0567f82>] ath9k_ani_work+0x142/0x250 [ath9k_htc]
[<ffffffff81073c70>] async_run_entry_fn+0x0/0x180
[<ffffffffa0567e40>] ath9k_ani_work+0x0/0x250 [ath9k_htc]

Signed-off-by: Rajkumar Manoharan <rmanoharan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>


# ea888357 25-Jan-2011 Stanislaw Gruszka <sgruszka@redhat.com>

ath9k_htc: fix race conditions when stop device

We do not kill any scheduled tasklets when stopping device, that may
cause usage of resources after free. Disable interrupts, kill tasklets
and then works in correct order.

Cc: stable@kernel.org
Tested-by: Sujith <m.sujith@gmail.com>
Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>


# 0b01f030 18-Jan-2011 Johannes Berg <johannes.berg@intel.com>

mac80211: track receiver's aggregation reorder buffer size

The aggregation code currently doesn't implement the
buffer size negotiation. It will always request a max
buffer size (which is fine, if a little pointless, as
the mac80211 code doesn't know and might just use 0
instead), but if the peer requests a smaller size it
isn't possible to honour this request.

In order to fix this, look at the buffer size in the
addBA response frame, keep track of it and pass it to
the driver in the ampdu_action callback when called
with the IEEE80211_AMPDU_TX_OPERATIONAL action. That
way the driver can limit the number of subframes in
aggregates appropriately.

Note that this doesn't fix any drivers apart from the
addition of the new argument -- they all need to be
updated separately to use this variable!

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>


# 4e3ae387 14-Jan-2011 Rajkumar Manoharan <rmanoharan@atheros.com>

ath9k_htc: keep calibrated noise floor value for oper channel

The ath9k_hw assumes that caldata is valid only for
oper channel. But with ath9k_htc case, the caldata is
passed for all channels on hw_reset though we are not doing
calibration on that channel. So the oper channel's nf history
got cleared to default due to mismatch in channel flags.
This patch also saves some space.

Signed-off-by: Rajkumar Manoharan <rmanoharan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>


# 55de80d6 04-Jan-2011 Sujith Manoharan <Sujith.Manoharan@atheros.com>

ath9k_htc: Really fix packet injection

The chainmask value along with other configuration has to be set
on the target for packet injection. Fix this and also move the monitor
interface addition before the channel set segment to ensure that
the opmode is updated properly.

Signed-off-by: Sujith Manoharan <Sujith.Manoharan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>


# cc721287 03-Jan-2011 Sujith Manoharan <Sujith.Manoharan@atheros.com>

ath9k_htc: Fix packet injection

To inject a packet in monitor mode, a dummy station has
to be associated with the monitor interface in the target.
Failing to do this would result in a firmware crash on the device.

Signed-off-by: Sujith Manoharan <Sujith.Manoharan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>


# 1e1f4ad2 28-Dec-2010 Sujith Manoharan <Sujith.Manoharan@atheros.com>

ath9k_htc: Move LED/RFKILL code to htc_drv_gpio.c

And add the copyright/license header.

Signed-off-by: Sujith Manoharan <Sujith.Manoharan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>


# 039a0721 28-Dec-2010 Sujith Manoharan <Sujith.Manoharan@atheros.com>

ath9k_htc: Fix fast channel change

When returning to the operating channel, a full HW
reset has to be done instead of a fast channel change.
Since sw_scan_complete() is called after the config() call for the
home channel, we end up doing a FCC. Fix this issue by checking
the OFFCHANNEL flag to determine FCC.

Signed-off-by: Sujith Manoharan <Sujith.Manoharan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>


# 73908674 28-Dec-2010 Sujith Manoharan <Sujith.Manoharan@atheros.com>

ath9k_htc: Handle FATAL events

The device has to be reset when a FATAL event is received.
Not doing so would leave the card in a non-working state.

Signed-off-by: Sujith Manoharan <Sujith.Manoharan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>


# 66e35474 28-Dec-2010 Sujith Manoharan <Sujith.Manoharan@atheros.com>

ath9k_htc: Move work cancellation outside of mutex

There is no need to lock the various work cancellation
calls. This will be helpful when handling FATAL events.

Signed-off-by: Sujith Manoharan <Sujith.Manoharan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>


# 64c6e50c 14-Dec-2010 Sujith Manoharan <Sujith.Manoharan@atheros.com>

ath9k_htc: Remove PCI specific configuration

This is not required for USB devices.

Signed-off-by: Sujith Manoharan <Sujith.Manoharan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>


# f933ebed 30-Nov-2010 Sujith Manoharan <Sujith.Manoharan@atheros.com>

ath9k_htc: Fix suspend/resume

The HW has to be set to FULLSLEEP mode during suspend,
when no interface has been brought up. Not doing this would
break resume, as the chip won't be powered up at all.

Signed-off-by: Sujith Manoharan <Sujith.Manoharan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>


# 692d6b17 07-Dec-2010 Sujith Manoharan <Sujith.Manoharan@atheros.com>

ath9k_htc: Add support for handling TX power configuration

Signed-off-by: Sujith Manoharan <Sujith.Manoharan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>


# 226afe68 02-Dec-2010 Joe Perches <joe@perches.com>

ath: Convert ath_print to ath_dbg

Remove ath/debug.h and the includes of these files.
Coalesce long formats.
Correct a few misspellings and missing "\n"s from these logging messages.
Remove unnecessary trailing space before a newline.
Remove ARRAY_SIZE casts, use printf type %zu

Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>


# 3800276a 02-Dec-2010 Joe Perches <joe@perches.com>

ath: Convert ath_print(.., ATH_DBG_FATAL to ath_err

So these errors are always emitted at KERN_ERR level.
Remove ARRAY_SIZE casts, use printf type %zu

Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>


# 81fc2a33 26-Nov-2010 Rajkumar Manoharan <rmanoharan@atheros.com>

Revert "ath9k_htc: Handle monitor mode properly for HTC devices"

This reverts commit 446fad5a5b6be765c8ec39bfdbbc6c7aa63fbcbb.

The change had broken the packet injection on monitoring mode.

Signed-off-by: Rajkumar Manoharan <rmanoharan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>


# 446fad5a 26-Oct-2010 Rajkumar Manoharan <rmanoharan@atheros.com>

ath9k_htc: Handle monitor mode properly for HTC devices

No need to inform about monitor interface changes to
firmware. Set the HW mode to monitor type based on mac80211
indication flag is sufficient.

Signed-off-by: Rajkumar Manoharan <rmanoharan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>


# babcbc29 19-Oct-2010 Felix Fietkau <nbd@openwrt.org>

ath9k: initialize per-channel tx power limits instead of hardcoding them

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>


# de40f316 19-Oct-2010 Felix Fietkau <nbd@openwrt.org>

ath9k_hw: extend ath9k_hw_set_txpowerlimit to test channel txpower

ath9k_hw_set_txpowerlimit gets an extra boolean parameter that - if set -
causes the rate txpower table and the regulatory limit to be calculated
and stored, without changing hardware registers.

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>


# 94a40c0c 13-Oct-2010 Rajkumar Manoharan <rmanoharan@atheros.com>

ath9k_htc: set probe request rx filter

This patch enables to receive probe request frames on p2p
client mode.

Signed-off-by: Rajkumar Manoharan <rmanoharan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>


# 6038f373 15-Aug-2010 Arnd Bergmann <arnd@arndb.de>

llseek: automatically add .llseek fop

All file_operations should get a .llseek operation so we can make
nonseekable_open the default for future file operations without a
.llseek pointer.

The three cases that we can automatically detect are no_llseek, seq_lseek
and default_llseek. For cases where we can we can automatically prove that
the file offset is always ignored, we use noop_llseek, which maintains
the current behavior of not returning an error from a seek.

New drivers should normally not use noop_llseek but instead use no_llseek
and call nonseekable_open at open time. Existing drivers can be converted
to do the same when the maintainer knows for certain that no user code
relies on calling seek on the device file.

The generated code is often incorrectly indented and right now contains
comments that clarify for each added line why a specific variant was
chosen. In the version that gets submitted upstream, the comments will
be gone and I will manually fix the indentation, because there does not
seem to be a way to do that using coccinelle.

Some amount of new code is currently sitting in linux-next that should get
the same modifications, which I will do at the end of the merge window.

Many thanks to Julia Lawall for helping me learn to write a semantic
patch that does all this.

===== begin semantic patch =====
// This adds an llseek= method to all file operations,
// as a preparation for making no_llseek the default.
//
// The rules are
// - use no_llseek explicitly if we do nonseekable_open
// - use seq_lseek for sequential files
// - use default_llseek if we know we access f_pos
// - use noop_llseek if we know we don't access f_pos,
// but we still want to allow users to call lseek
//
@ open1 exists @
identifier nested_open;
@@
nested_open(...)
{
<+...
nonseekable_open(...)
...+>
}

@ open exists@
identifier open_f;
identifier i, f;
identifier open1.nested_open;
@@
int open_f(struct inode *i, struct file *f)
{
<+...
(
nonseekable_open(...)
|
nested_open(...)
)
...+>
}

@ read disable optional_qualifier exists @
identifier read_f;
identifier f, p, s, off;
type ssize_t, size_t, loff_t;
expression E;
identifier func;
@@
ssize_t read_f(struct file *f, char *p, size_t s, loff_t *off)
{
<+...
(
*off = E
|
*off += E
|
func(..., off, ...)
|
E = *off
)
...+>
}

@ read_no_fpos disable optional_qualifier exists @
identifier read_f;
identifier f, p, s, off;
type ssize_t, size_t, loff_t;
@@
ssize_t read_f(struct file *f, char *p, size_t s, loff_t *off)
{
... when != off
}

@ write @
identifier write_f;
identifier f, p, s, off;
type ssize_t, size_t, loff_t;
expression E;
identifier func;
@@
ssize_t write_f(struct file *f, const char *p, size_t s, loff_t *off)
{
<+...
(
*off = E
|
*off += E
|
func(..., off, ...)
|
E = *off
)
...+>
}

@ write_no_fpos @
identifier write_f;
identifier f, p, s, off;
type ssize_t, size_t, loff_t;
@@
ssize_t write_f(struct file *f, const char *p, size_t s, loff_t *off)
{
... when != off
}

@ fops0 @
identifier fops;
@@
struct file_operations fops = {
...
};

@ has_llseek depends on fops0 @
identifier fops0.fops;
identifier llseek_f;
@@
struct file_operations fops = {
...
.llseek = llseek_f,
...
};

@ has_read depends on fops0 @
identifier fops0.fops;
identifier read_f;
@@
struct file_operations fops = {
...
.read = read_f,
...
};

@ has_write depends on fops0 @
identifier fops0.fops;
identifier write_f;
@@
struct file_operations fops = {
...
.write = write_f,
...
};

@ has_open depends on fops0 @
identifier fops0.fops;
identifier open_f;
@@
struct file_operations fops = {
...
.open = open_f,
...
};

// use no_llseek if we call nonseekable_open
////////////////////////////////////////////
@ nonseekable1 depends on !has_llseek && has_open @
identifier fops0.fops;
identifier nso ~= "nonseekable_open";
@@
struct file_operations fops = {
... .open = nso, ...
+.llseek = no_llseek, /* nonseekable */
};

@ nonseekable2 depends on !has_llseek @
identifier fops0.fops;
identifier open.open_f;
@@
struct file_operations fops = {
... .open = open_f, ...
+.llseek = no_llseek, /* open uses nonseekable */
};

// use seq_lseek for sequential files
/////////////////////////////////////
@ seq depends on !has_llseek @
identifier fops0.fops;
identifier sr ~= "seq_read";
@@
struct file_operations fops = {
... .read = sr, ...
+.llseek = seq_lseek, /* we have seq_read */
};

// use default_llseek if there is a readdir
///////////////////////////////////////////
@ fops1 depends on !has_llseek && !nonseekable1 && !nonseekable2 && !seq @
identifier fops0.fops;
identifier readdir_e;
@@
// any other fop is used that changes pos
struct file_operations fops = {
... .readdir = readdir_e, ...
+.llseek = default_llseek, /* readdir is present */
};

// use default_llseek if at least one of read/write touches f_pos
/////////////////////////////////////////////////////////////////
@ fops2 depends on !fops1 && !has_llseek && !nonseekable1 && !nonseekable2 && !seq @
identifier fops0.fops;
identifier read.read_f;
@@
// read fops use offset
struct file_operations fops = {
... .read = read_f, ...
+.llseek = default_llseek, /* read accesses f_pos */
};

@ fops3 depends on !fops1 && !fops2 && !has_llseek && !nonseekable1 && !nonseekable2 && !seq @
identifier fops0.fops;
identifier write.write_f;
@@
// write fops use offset
struct file_operations fops = {
... .write = write_f, ...
+ .llseek = default_llseek, /* write accesses f_pos */
};

// Use noop_llseek if neither read nor write accesses f_pos
///////////////////////////////////////////////////////////

@ fops4 depends on !fops1 && !fops2 && !fops3 && !has_llseek && !nonseekable1 && !nonseekable2 && !seq @
identifier fops0.fops;
identifier read_no_fpos.read_f;
identifier write_no_fpos.write_f;
@@
// write fops use offset
struct file_operations fops = {
...
.write = write_f,
.read = read_f,
...
+.llseek = noop_llseek, /* read and write both use no f_pos */
};

@ depends on has_write && !has_read && !fops1 && !fops2 && !has_llseek && !nonseekable1 && !nonseekable2 && !seq @
identifier fops0.fops;
identifier write_no_fpos.write_f;
@@
struct file_operations fops = {
... .write = write_f, ...
+.llseek = noop_llseek, /* write uses no f_pos */
};

@ depends on has_read && !has_write && !fops1 && !fops2 && !has_llseek && !nonseekable1 && !nonseekable2 && !seq @
identifier fops0.fops;
identifier read_no_fpos.read_f;
@@
struct file_operations fops = {
... .read = read_f, ...
+.llseek = noop_llseek, /* read uses no f_pos */
};

@ depends on !has_read && !has_write && !fops1 && !fops2 && !has_llseek && !nonseekable1 && !nonseekable2 && !seq @
identifier fops0.fops;
@@
struct file_operations fops = {
...
+.llseek = noop_llseek, /* no read or write fn */
};
===== End semantic patch =====

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Cc: Julia Lawall <julia@diku.dk>
Cc: Christoph Hellwig <hch@infradead.org>


# 35ecfe03 29-Sep-2010 Felix Fietkau <nbd@openwrt.org>

ath9k_htc: remove use of common->ani.noise_floor

It is unused aside from a single redundant debug message

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>


# 040e539e 08-Sep-2010 Bruno Randolf <br1@einfach.org>

ath9k: Use common ath key management functions

Use key management functions which have been moved to ath/key.c and remove
ath9k copies of these functions and other now unused definitions.

Signed-off-by: Bruno Randolf <br1@einfach.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>


# 7cf1f2dd 02-Sep-2010 Rajkumar Manoharan <rmanoharan@atheros.com>

ath9k_htc: Enable fastcc for HTC devices.

By enabling fastcc, the scan time reduced to half.

Signed-off-by: Rajkumar Manoharan <rmanoharan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>


# fe67470d 26-Aug-2010 Rajkumar Manoharan <rmanoharan@atheros.com>

ath9k_htc: Enable ANI in associated state only

While scanning, ANI is triggered unnecessarily where sta is in
unassociated state. And cancelling ani work in ath9k_htc_stop
is not required.

Signed-off-by: Rajkumar Manoharan <rmanoharan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>


# 21cb9879 18-Aug-2010 Vivek Natarajan <vnatarajan@atheros.com>

ath9k_htc: Add support for bluetooth coexistence.

Signed-off-by: Vivek Natarajan <vnatarajan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>


# 97359d12 10-Aug-2010 Johannes Berg <johannes.berg@intel.com>

mac80211: use cipher suite selectors

Currently, mac80211 translates the cfg80211
cipher suite selectors into ALG_* values.
That isn't all too useful, and some drivers
benefit from the distinction between WEP40
and WEP104 as well. Therefore, convert it
all to use the cipher suite selectors.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Acked-by: Gertjan van Wingerde <gwingerde@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>


# 71ba186c 12-Aug-2010 Vivek Natarajan <vnatarajan@atheros.com>

ath9k_htc: Fix disconnect issue in HT40 mode.

Some APs advertise that they may be HT40 capable in the capabilites
but the current operating channel configuration may be only HT20.
This causes disconnection as ath9k_htc sets WLAN_RC_40_FLAG despite
the AP operating in HT20 mode.
Hence set this flag only if the current channel configuration
is HT40 enabled.

Cc: stable@kernel.org
Signed-off-by: Vivek Natarajan <vnatarajan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>


# 20bd2a09 30-Jul-2010 Felix Fietkau <nbd@openwrt.org>

ath9k_hw: clean up per-channel calibration data

The noise floor history buffer is currently not kept per channel, which
can lead to problems when changing channels from a clean channel to a
noisy one. Also when switching from HT20 to HT40, the noise floor
history buffer is full of measurements, but none of them contain data
for the extension channel, which it needs quite a bit of time to recover
from.

This patch puts all the per-channel calibration data into a single data
structure, and gives the the driver control over whether that is used
per-channel or even not used for some channels.

For ath9k_htc, I decided to keep this per-channel in order to avoid
creating regressions.

For ath9k, the data is kept only for the operating channel, which saves
some space. ath9k_hw takes care of wiping old data when the operating
channel or its channel flags change.

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>


# 9746010b 22-Jul-2010 Dan Carpenter <error27@gmail.com>

ath9k: snprintf() returns largish values

The snprintf() function returns the number of characters that would have
been written (not counting the NUL character on the end). It could
potentially be larger than the size of the buffer.

Signed-off-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>


# 9edd9520 13-Jul-2010 Luis R. Rodriguez <lrodriguez@atheros.com>

ath9k_htc: make ath9k_htc_tx_aggr_oper() static

This fixes this sparse complaint:

CHECK drivers/net/wireless/ath/ath9k/htc_drv_main.c
drivers/net/wireless/ath/ath9k/htc_drv_main.c:441:5:
warning: symbol 'ath9k_htc_tx_aggr_oper'
was not declared. Should it be static?

Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>


# 57674308 12-Jul-2010 Joe Perches <joe@perches.com>

drivers/net/wireless: Remove unnecessary casts of private_data

Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>


# 88c1f4f6 30-Jun-2010 Sujith <Sujith.Manoharan@atheros.com>

ath9k_htc: Add LED support for AR7010

Signed-off-by: Sujith <Sujith.Manoharan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>


# d7ca2139 14-Jun-2010 Sujith <Sujith.Manoharan@atheros.com>

ath9k_htc: Fix ampdu_action callback

Now that ampdu_action() can sleep, remove all
the driver hacks and just issue WMI commands
to the target.

Signed-off-by: Sujith <Sujith.Manoharan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>


# 3553727c 12-Jun-2010 Felix Fietkau <nbd@openwrt.org>

ath9k/ath9k_htc: remove redundand checks for dual-stream tx support

mac80211 already masks the HT sta capabilities based on hardware support

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>


# 9cc3271f 12-Jun-2010 Felix Fietkau <nbd@openwrt.org>

ath9k_hw: remove ATH9K_CAP_TXPOW

replace calls that read this capability with accesses to ath9k_hw's
regulatory data.

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>


# e8c35a77 11-Jun-2010 Felix Fietkau <nbd@openwrt.org>

ath9k_htc: use common WMM AC definitions instead of ath9k ones

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>


# 5d22c89b 10-Jun-2010 Johannes Berg <johannes.berg@intel.com>

mac80211: remove non-irqsafe aggregation callbacks

The non-irqsafe aggregation start/stop done
callbacks are currently only used by ath9k_htc,
and can cause callbacks into the driver again.
This might lead to locking issues, which will
only get worse as we modify locking. To avoid
trouble, remove the non-irqsafe versions and
change ath9k_htc to use those instead.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>


# ea46e644 02-Jun-2010 Sujith <Sujith.Manoharan@atheros.com>

ath9k_htc: Setup 5GHz channels

AR7010 is dual-band. Setup the channels and rateset
for 5GHz band.

Signed-off-by: Sujith <Sujith.Manoharan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>


# 29d9075e 02-Jun-2010 Sujith <Sujith.Manoharan@atheros.com>

ath9k_htc: Configure dual stream rates

The rate information on the target has to be updated
for 2-stream devices, along with the correct chainmask.

Signed-off-by: Sujith <Sujith.Manoharan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>


# abd984e6 18-May-2010 Sujith <Sujith.Manoharan@atheros.com>

ath9k_htc: Use proper station add/remove callbacks

sta_add/sta_remove are the callbacks that can sleep.
Use them instead of sta_notify.

Signed-off-by: Sujith <Sujith.Manoharan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>


# 764580f5 01-Jun-2010 Sujith <Sujith.Manoharan@atheros.com>

ath9k_htc: Fix fair beacon distribution

This patch fixes beacon distribution in IBSS mode
by configuring the hardware beacon queue properly.

Signed-off-by: Sujith <Sujith.Manoharan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>


# 21d5130b 01-Jun-2010 Sujith <Sujith.Manoharan@atheros.com>

ath9k_htc: Handle host RX disable

The MIB counters used by ANI have to be disabled
on the host because the FW doesn't do it on the target side.
Also, flush the receive buffers before initializing
RX on the target.

Signed-off-by: Sujith <Sujith.Manoharan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>


# e9201f09 01-Jun-2010 Sujith <Sujith.Manoharan@atheros.com>

ath9k_htc: Handle monitor interface removal

The monitor interface instance on the target has
to be removed before setting it to FULLSLEEP.
Handle this properly.

Signed-off-by: Sujith <Sujith.Manoharan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>


# 23367769 01-Jun-2010 Sujith <Sujith.Manoharan@atheros.com>

ath9k_htc: Fix locking for ps_idle

ps_idle is protected by the htc_pm_lock mutex.
Use it to protect the variable.

Signed-off-by: Sujith <Sujith.Manoharan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>


# 3901737e 01-Jun-2010 Sujith <Sujith.Manoharan@atheros.com>

ath9k_htc: Remove useless cancel_work_sync

There is no need to cancel the PS work when disassociation
happens. The work handlers are cancelled in the stop()
callback.

Signed-off-by: Sujith <Sujith.Manoharan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>


# 4a34a8c1 01-Jun-2010 Sujith <Sujith.Manoharan@atheros.com>

ath9k_htc: Fix bug in handling CONF_IDLE

Disable the radio only when mac80211 indicates it,
through the IEEE80211_CONF_CHANGE_IDLE flag.
Not handling this properly will result in multiple
calls to radio_disable() even though the radio is
already idle.

Signed-off-by: Sujith <Sujith.Manoharan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>


# cb551df2 01-Jun-2010 Sujith <Sujith.Manoharan@atheros.com>

ath9k_htc: Add PS wrappers

The HW has to be awake when registers are accessed.
Ensure this is so by using the PS wrappers at
appropriate places.

Signed-off-by: Sujith <Sujith.Manoharan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>


# 881ac6a5 01-Jun-2010 Sujith <Sujith.Manoharan@atheros.com>

ath9k_htc: Revamp CONF_IDLE handling

This patch revamps IDLE power save handling in the driver.
Two separate functions (radio enable/disable) are introduced,
because the semantics of radio handling is just not the same
as the start()/stop() callbacks. For example, the HW must not
be disabled, instead, the PHY has to be disabled in radio_disable().
Also, the HW has to be reset properly in radio enable/disable and
certain registers have to be programmed only once, in the
start() callback.

The radio_enable() routine doesn't need the PS wrappers since
we set the HW power mode to AWAKE anyway before calling it.

Signed-off-by: Sujith <Sujith.Manoharan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>


# b4dec5e8 16-May-2010 Sujith <Sujith.Manoharan@atheros.com>

ath9k_htc: Enable SGI in HT20 for AR9271

Signed-off-by: Sujith <Sujith.Manoharan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>


# 2c76ef89 16-May-2010 Sujith <Sujith.Manoharan@atheros.com>

ath9k_htc: Update HT configuration properly

Use BSS_CHANGED_HT to handle HT parameter changes.
The rate information on the target has to be updated
to handle changes in HT configuration.

Signed-off-by: Sujith <Sujith.Manoharan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>


# 0d425a7d 16-May-2010 Sujith <Sujith.Manoharan@atheros.com>

ath9k_htc: Cleanup rate initialization

This patch removes a large chunk of code dealing
with rate management within the driver and simplifying
things by removing the hacky method of calculating
HT changes. A subsequent patch would fix this by
just using BSS_CHANGED_HT from mac80211.

Signed-off-by: Sujith <Sujith.Manoharan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>


# 2edb4583 13-May-2010 Sujith <Sujith.Manoharan@atheros.com>

ath9k_htc: Add queue statistics to xmit debugfs file

Signed-off-by: Sujith <Sujith.Manoharan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>


# 05a30f9c 11-May-2010 Sujith.Manoharan@atheros.com <Sujith.Manoharan@atheros.com>

ath9k_htc: Lock sta_notify() callback

Since ->sta_notify() can sleep, protect
the callback with a mutex.

Signed-off-by: Sujith <Sujith.Manoharan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>


# 0730d114 08-May-2010 Dan Carpenter <error27@gmail.com>

ath9k/htc_drv_main: off by one error

I changed "> ATH9K_HTC_MAX_TID" to ">= ATH9K_HTC_MAX_TID" to avoid a
potential overflow.

Signed-off-by: Dan Carpenter <error27@gmail.com>
Acked-by: Sujith <Sujith.Manoharan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>


# 277a64d1 08-May-2010 Dan Carpenter <error27@gmail.com>

ath9k/htc_drv_main: null dereference typo

This is a stray null dereference. We initialize "ista" properly later on.

Signed-off-by: Dan Carpenter <error27@gmail.com>
Acked-by: Sujith <Sujith.Manoharan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>


# 2ff6575b 07-May-2010 Sujith <Sujith.Manoharan@atheros.com>

ath9k_htc: Handle IDLE LED properly

Switch LED off/on when handling CONF_CHANGE_IDLE.
Not doing this would leave the radio LED on even
though the chip would be in full sleep mode.

Signed-off-by: Sujith <Sujith.Manoharan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>


# 9c6dda4e 06-May-2010 Sujith <Sujith.Manoharan@atheros.com>

ath9k_htc: Fix beaconing in IBSS mode

The current way of managing beaconing in ad-hoc
mode has a subtle race - the beacon obtained from mac80211
is freed in the SWBA handler rather than the TX
completion routine. But transmission of beacons goes
through the normal SKB queue maintained in hif_usb,
leading to a situation where __skb_dequeue() in the TX
completion handler goes kaput.

Fix this by simply getting a beacon from mac80211 for
every SWBA and free it in its completion routine.

Signed-off-by: Sujith <Sujith.Manoharan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>


# 8a8572a8 27-Apr-2010 Vivek Natarajan <vnatarajan@atheros.com>

ath9k_htc: Handle CONF_IDLE during unassociated state to save power.

Signed-off-by: Vivek Natarajan <vnatarajan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>


# 5bf1e17a 26-Apr-2010 Sujith <Sujith.Manoharan@atheros.com>

ath9k_htc: Remove unnecessary powersave restore

Signed-off-by: Sujith <Sujith.Manoharan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>


# 7073daa6 22-Apr-2010 Sujith <Sujith.Manoharan@atheros.com>

ath9k_htc: Cancel running timers before disabling HW

Signed-off-by: Sujith <Sujith.Manoharan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>


# 7f1f5a00 16-Apr-2010 Sujith <Sujith.Manoharan@atheros.com>

ath9k_htc: Fix sparse endian warnings

This patch fixes a bunch of endian issues that
were exposed by sparse. It's a miracle that the driver
worked at all till now.

The Lord be praised.

Signed-off-by: Sujith <Sujith.Manoharan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>


# eac8e385 16-Apr-2010 Sujith <Sujith.Manoharan@atheros.com>

ath9k_htc: Add dropped SKB count to debugfs

Signed-off-by: Sujith <Sujith.Manoharan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>


# 0daa3e3a 16-Apr-2010 Sujith <Sujith.Manoharan@atheros.com>

ath9k_htc: Remove GPIO set on unload

There is no point in trying to set the LED pin
when the module is being unloaded. The target
would be reset anyway.

Signed-off-by: Sujith <Sujith.Manoharan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>


# fcb9392f 16-Apr-2010 Sujith <Sujith.Manoharan@atheros.com>

ath9k_htc: Cleanup beacon configuration

This patch cleans up beacon configuration,
removing a redundant interface type check
and updating beacon interval in the correct place.

Signed-off-by: Sujith <Sujith.Manoharan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>


# 1c3652a5 05-Apr-2010 Vivek Natarajan <vnatarajan@atheros.com>

ath9k_htc: Configure the beacon timers once the scan is completed.

Signed-off-by: Vivek Natarajan <vnatarajan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>


# bde748a4 05-Apr-2010 Vivek Natarajan <vnatarajan@atheros.com>

ath9k_htc: Add support for power save.

Signed-off-by: Vivek Natarajan <vnatarajan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>


# 7757dfed 29-Mar-2010 Sujith <Sujith.Manoharan@atheros.com>

ath9k_htc: Handle TX queue overflow

Stop/restart TX queues when the internal SKB
queue is full. This helps handle TX better
under heavy load.

Signed-off-by: Sujith <Sujith.Manoharan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>


# ef98c3cd 29-Mar-2010 Sujith <Sujith.Manoharan@atheros.com>

ath9k_htc: Fix bug in aggregation initiation

Accessing the sta pointer in TX completion without
approprate RCU protection is wrong. Fix this.

Also, RCU protection is needed when the station's
aggregation state is updated. Handle this properly.

Signed-off-by: Sujith <Sujith.Manoharan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>


# 0995d110 29-Mar-2010 Sujith <Sujith.Manoharan@atheros.com>

ath9k_common: Move RX filter code to ath9k_htc

The calculation of RX filter is fairly different
between ath9k and ath9k_htc, trying to make this
common between the two drivers would result in code churn.

While at it, remove the handling of PSPOLL filter,
it can be added when(if) AP support is added to ath9k_htc.

Signed-off-by: Sujith <Sujith.Manoharan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>


# e1572c5e 24-Mar-2010 Sujith <Sujith.Manoharan@atheros.com>

ath9k_htc: Fix symbol collision with ath9k

Signed-off-by: Sujith <Sujith.Manoharan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>


# fb9987d0 17-Mar-2010 Sujith <Sujith.Manoharan@atheros.com>

ath9k_htc: Support for AR9271 chipset.

Features:

* Station mode
* IBSS mode
* Monitor mode
* Legacy support
* HT support
* TX/RX 11n Aggregation
* HW encryption
* LED
* Suspend/Resume

For more information: http://wireless.kernel.org/en/users/Drivers/ath9k_htc

Signed-off-by: Sujith <Sujith.Manoharan@atheros.com>
Signed-off-by: Vasanthakumar Thiagarajan <vasanth@atheros.com>
Signed-off-by: Senthil Balasubramanian <senthilkumar@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>