History log of /linux-master/drivers/net/wireless/ath/ath9k/tx99.c
Revision Date Author Comments
# 8b804643 26-Jul-2023 Dmitry Antipov <dmantipov@yandex.ru>

wifi: ath9k: consistently use kstrtoX_from_user() functions

Use 'kstrtoul_from_user()' and 'kstrtobool_from_user()'
where appropriate and thus avoid some code duplication.

Signed-off-by: Dmitry Antipov <dmantipov@yandex.ru>
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/20230726185046.188225-1-dmantipov@yandex.ru


# 417f1735 01-Nov-2022 Christophe JAILLET <christophe.jaillet@wanadoo.fr>

wifi: Use kstrtobool() instead of strtobool()

strtobool() is the same as kstrtobool().
However, the latter is more used within the kernel.

In order to remove strtobool() and slightly simplify kstrtox.h, switch to
the other function name.

While at it, include the corresponding header file (<linux/kstrtox.h>)

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Signed-off-by: Kalle Valo <kvalo@kernel.org>
Link: https://lore.kernel.org/r/1ff34549af5ad6f7c80d5b9e11872b5499065fc1.1667336095.git.christophe.jaillet@wanadoo.fr


# 6df0580b 22-Sep-2018 Felix Fietkau <nbd@nbd.name>

ath9k: add back support for using active monitor interfaces for tx99

Various documented examples on how to set up tx99 with ath9k rely
on setting up a regular monitor interface for setting the channel.
My previous patch "ath9k: fix tx99 with monitor mode interface" made
it possible to set it up this way again. However, it was removing support
for using an active monitor interface, which is required for controlling
the bitrate as well, since the bitrate is not passed down with a regular
monitor interface.

This patch partially reverts the previous one, but keeps support for using
a regular monitor interface to keep documented steps working in cases
where the bitrate does not matter

Fixes: d9c52fd17cb48 ("ath9k: fix tx99 with monitor mode interface")
Signed-off-by: Felix Fietkau <nbd@nbd.name>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>


# d9c52fd1 20-Aug-2018 Felix Fietkau <nbd@nbd.name>

ath9k: fix tx99 with monitor mode interface

Tx99 is typically configured via a monitor mode interface, which does
not get added to the driver as a vif. Since the code currently expects
a configured virtual interface for tx99, enabling tx99 via debugfs fails.
Since the vif is not needed anyway, remove all checks for it.

Signed-off-by: Felix Fietkau <nbd@nbd.name>
[kvalo@codeaurora.org: s/CPTCFG/CONFIG/]
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>


# 2ef00c53 23-Mar-2018 Joe Perches <joe@perches.com>

wireless: Use octal not symbolic permissions

Prefer the direct use of octal for permissions.

Done with checkpatch -f --types=SYMBOLIC_PERMS --fix-inplace
and some typing.

Miscellanea:

o Whitespace neatening around these conversions.

Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>


# ee0a4718 26-Sep-2017 Miaoqing Pan <miaoqing@codeaurora.org>

ath9k: fix tx99 potential info leak

When the user sets count to zero the string buffer would remain
completely uninitialized which causes the kernel to parse its
own stack data, potentially leading to an info leak. In addition
to that, the string might be not terminated properly when the
user data does not contain a 0-terminator.

Signed-off-by: Miaoqing Pan <miaoqing@codeaurora.org>
Reviewed-by: Christoph Böhmwalder <christoph@boehmwalder.at>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>


# cf8ce1ea 27-Jun-2017 Miaoqing Pan <miaoqing@codeaurora.org>

ath9k: fix tx99 use after free

One scenario that could lead to UAF is two threads writing
simultaneously to the "tx99" debug file. One of them would
set the "start" value to true and follow to ath9k_tx99_init().
Inside the function it would set the sc->tx99_state to true
after allocating sc->tx99skb. Then, the other thread would
execute write_file_tx99() and call ath9k_tx99_deinit().
sc->tx99_state would be freed. After that, the first thread
would continue inside ath9k_tx99_init() and call
r = ath9k_tx99_send(sc, sc->tx99_skb, &txctl);
that would make use of the freed sc->tx99_skb memory.

Cc: <stable@vger.kernel.org>
Signed-off-by: Miaoqing Pan <miaoqing@codeaurora.org>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>


# c46e2a84 27-Apr-2017 Ammly Fredrick <ammlyf@gmail.com>

ath9k: fix spelling in ath9k_tx99_init()

It's spelled hardware, not harware.

Signed-off-by: Ammly Fredrick <ammlyf@gmail.com>
[kvalo@qca.qualcomm.com: improve commit log]
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>


# 8a0a36cf 19-May-2016 Eduardo Abinader <eabinader@ocedo.com>

ath9k: Proper TX99 interrupt ref count

On TX99 mode, instead of assuming interrupt mask non ATH9K_INT_GLOBAL,
let ath9k_hw_disable_interrupts proper set interrupt ref count.
This prevents some PCI PERR occurring specialy when setting 11b and n rates.

Signed-off-by: Eduardo Abinader <eduardo.abinader@riverbed.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>


# e94610cc 09-May-2016 Eduardo Abinader <eabinader@ocedo.com>

ath9k: allow tx99 for ar9002 based cards

As there is current support for ar9002 tx99 mode, just allow
to init debugfs and enable tx99.

Signed-off-by: Eduardo Abinader <eduardo.abinader@riverbed.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>


# 5555c955 16-Oct-2014 Sujith Manoharan <c_manoha@qca.qualcomm.com>

ath9k: Unify reset API

Instead of having ath_reset_internal() and ath_reset()
as two separate calls to perform a HW reset, have
one function. This makes sure that the behavior will
be the same at all callsites.

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


# ca14405e 07-Oct-2014 Sujith Manoharan <c_manoha@qca.qualcomm.com>

ath9k: Fix sequence number assignment

Currently, ath9k uses a global counter for all
frames that need to be assigned a sequence number.
QoS-data frames are handled properly since they
have a per-tid counter. But, beacons and other
management frames use the same counter even if
multiple interfaces or contexts are present.

Fix this issue by making the counter per-interface
and using it when mac80211 sets IEEE80211_TX_CTL_ASSIGN_SEQ.

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


# ca529c93 04-Sep-2014 Sujith Manoharan <c_manoha@qca.qualcomm.com>

ath9k: Fix interface accounting

Currently, the interface count is maintained globally,
but this causes problems in RX filter calculation.
Make the interface count a per-channel-context variable
to fix this.

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


# 39305635 11-Jun-2014 Felix Fietkau <nbd@openwrt.org>

ath9k: Implement channel context ops

Add channel context operations (add, remove, change, assign and
unassign) to enable support for multiple channels.

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


# eefa01dd 27-Feb-2014 Oleksij Rempel <linux@rempel-privat.de>

ath9k: move sc_flags to ath_common

we will need it for ath9k_htc, may be other drivers too

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


# 55957fb7 09-Dec-2013 Lorenzo Bianconi <lorenzo.bianconi83@gmail.com>

ath9k: initialize retry chain flags in tx99 code

Initialize first chain flags in ath9k_build_tx99_skb() according to
configured channel mode and channel width

Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi83@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>


# fc70ff72 24-Nov-2013 Lorenzo Bianconi <lorenzo.bianconi83@gmail.com>

ath9k: fix retry chain initialization in tx99 code

Initialize first chain attempt counter to 1 in ath9k_build_tx99_skb().
Otherwise multi-retry chain is initialized to {idx,count} = {-1, 0} in
rate_control_fill_sta_table() and tx99 transmission rate is not configured in
rate_control_apply_mask() since first chain idx is set to -1

Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi83@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>


# 26f2a64a 14-Nov-2013 Dan Carpenter <dan.carpenter@oracle.com>

ath9k: fix SC_OP_INVALID test in ath9k_tx99_init()

SC_OP_INVALID is zero so the test is always false. We're supposed to be
testing the lowest bit instead.

Fixes: 89f927af7f33 ('ath9k: add TX99 support')
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>


# ef6b19e4 23-Oct-2013 Sujith Manoharan <c_manoha@qca.qualcomm.com>

ath9k: Fix TX99 config option usage

Use CONFIG_ATH9K_TX99 to properly enclose the tx99 code
and make sure that it is not compiled as part of the driver
when it is not selected. Move the tx99 code to a new file tx99.c
and also add ATH9K_DEBUGFS as a dependency in Kconfig.

This reduces the module size on platforms like OpenWrt where
ATH9K_DEBUGFS is selected, but TX99 might be disabled.

Cc: Luis R. Rodriguez <mcgrof@do-not-panic.com>
Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>