History log of /linux-master/drivers/net/wireless/ath/ath6kl/usb.c
Revision Date Author Comments
# 62ebaf2f 13-Jun-2022 Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>

ath6kl: avoid flush_scheduled_work() usage

As per commit c4f135d643823a86 ("workqueue: Wrap flush_workqueue() using
a macro") says, use per "struct ath6kl_usb" workqueue.

This is a blind conversion, and is only compile tested.

Signed-off-by: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
Signed-off-by: Kalle Valo <quic_kvalo@quicinc.com>
Link: https://lore.kernel.org/r/f78ddbdc-8989-a1a7-2234-ce9ec3894625@I-love.SAKURA.ne.jp


# 0ac121b8 02-Mar-2022 André Apitzsch <git@apitzsch.eu>

ath6kl: add device ID for WLU5150-D81

This device with a male Mini-B USB connector is part of Panasonic TVs.

Signed-off-by: André Apitzsch <git@apitzsch.eu>
Signed-off-by: Kalle Valo <quic_kvalo@quicinc.com>
Link: https://lore.kernel.org/r/20220302211436.8746-1-git@apitzsch.eu


# c1b9ca36 27-Oct-2021 Johan Hovold <johan@kernel.org>

ath6kl: fix division by zero in send path

Add the missing endpoint max-packet sanity check to probe() to avoid
division by zero in ath10k_usb_hif_tx_sg() in case a malicious device
has broken descriptors (or when doing descriptor fuzz testing).

Note that USB core will reject URBs submitted for endpoints with zero
wMaxPacketSize but that drivers doing packet-size calculations still
need to handle this (cf. commit 2548288b4fb0 ("USB: Fix: Don't skip
endpoint descriptors with maxpacket=0")).

Fixes: 9cbee358687e ("ath6kl: add full USB support")
Cc: stable@vger.kernel.org # 3.5
Signed-off-by: Johan Hovold <johan@kernel.org>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Link: https://lore.kernel.org/r/20211027080819.6675-3-johan@kernel.org


# a066d28a 25-Oct-2021 Johan Hovold <johan@kernel.org>

ath6kl: fix control-message timeout

USB control-message timeouts are specified in milliseconds and should
specifically not vary with CONFIG_HZ.

Fixes: 241b128b6b69 ("ath6kl: add back beginnings of USB support")
Cc: stable@vger.kernel.org # 3.4
Signed-off-by: Johan Hovold <johan@kernel.org>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Link: https://lore.kernel.org/r/20211025120522.6045-3-johan@kernel.org


# 0e20c3e1 15-Jul-2020 Kieran Bingham <kieran.bingham+renesas@ideasonboard.com>

wireless: Fix trivial spelling

The word 'descriptor' is misspelled throughout the tree.

Fix it up accordingly:
decriptors -> descriptors

Signed-off-by: Kieran Bingham <kieran.bingham+renesas@ideasonboard.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Link: https://lore.kernel.org/r/20200715124839.252822-5-kieran.bingham+renesas@ideasonboard.com


# 39d170b3 03-Aug-2019 Hui Peng <benquike@gmail.com>

ath6kl: fix a NULL-ptr-deref bug in ath6kl_usb_alloc_urb_from_pipe()

The `ar_usb` field of `ath6kl_usb_pipe_usb_pipe` objects
are initialized to point to the containing `ath6kl_usb` object
according to endpoint descriptors read from the device side, as shown
below in `ath6kl_usb_setup_pipe_resources`:

for (i = 0; i < iface_desc->desc.bNumEndpoints; ++i) {
endpoint = &iface_desc->endpoint[i].desc;

// get the address from endpoint descriptor
pipe_num = ath6kl_usb_get_logical_pipe_num(ar_usb,
endpoint->bEndpointAddress,
&urbcount);
......
// select the pipe object
pipe = &ar_usb->pipes[pipe_num];

// initialize the ar_usb field
pipe->ar_usb = ar_usb;
}

The driver assumes that the addresses reported in endpoint
descriptors from device side to be complete. If a device is
malicious and does not report complete addresses, it may trigger
NULL-ptr-deref `ath6kl_usb_alloc_urb_from_pipe` and
`ath6kl_usb_free_urb_to_pipe`.

This patch fixes the bug by preventing potential NULL-ptr-deref
(CVE-2019-15098).

Signed-off-by: Hui Peng <benquike@gmail.com>
Reported-by: Hui Peng <benquike@gmail.com>
Reported-by: Mathias Payer <mathias.payer@nebelwelt.net>
Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>


# e881a658 09-Aug-2017 Arvind Yadav <arvind.yadav.cs@gmail.com>

ath6kl: constify usb_device_id

usb_device_id are not supposed to change at runtime. All functions
working with usb_device_id provided by <linux/usb.h> work with
const usb_device_id. So mark the non-const structs as const.

Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
Reviewed-by: Steve deRosier <derosier@gmail.com>
Tested-by: Steve deRosier <derosier@gmail.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>


# aa292fa4 30-Oct-2014 Alexey Khoroshilov <khoroshilov@ispras.ru>

ath6kl: remove incorrect reset_resume handler

Existing implementation of reset_resume handler just calls
ath6kl_usb_remove() that deallocates all resources.
It can lead to double free, etc. on disconnect.

The patch removes reset_resume handler,
so usb core could conservatively reset the driver.

Found by Linux Driver Verification project (linuxtesting.org).

Signed-off-by: Alexey Khoroshilov <khoroshilov@ispras.ru>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>


# 17dc0b80 01-Aug-2014 Himangi Saraogi <himangi774@gmail.com>

ath6kl: convert a driver to use module_usb_driver()

This converts a driver in drivers/net/* to use the
module_usb_driver() macro which makes the code smaller and a
bit simpler.

Signed-off-by: Himangi Saraogi <himangi774@gmail.com>
Acked-by: Julia Lawall <julia.lawall@lip6.fr>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>


# 78803770 16-Jun-2014 Jessica Wu <wjessica@qca.qualcomm.com>

ath6kl: add support for ar6004 hw3.0

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

Signed-off-by: Jessica Wu <wjessica@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>


# eba95bce 16-Jun-2014 Kalle Valo <kvalo@qca.qualcomm.com>

ath6kl: convert ar6004 hardware flags to firmware feature flags

The functionality defined through these flags were actually firmware features
which can change between firmware versions. To make it possible to support
different firmware versions with the same driver, convert the flags to firmware
feature flags.

For backwards compatibility support for old ar6004 firmware FW
API 3 or smaller images we forcefully set the feature bits in the driver.
Starting from FW API 5 the firmware image needs to set them.

Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>


# 3629fa14 10-Mar-2014 Kalle Valo <kvalo@qca.qualcomm.com>

ath6kl: fix blank lines before and after braces

Fixes checkpatch warnings:

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

Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>


# 61118fbf 06-Jan-2014 Julien Massot <jmassot@aldebaran-robotics.com>

ath6kl: set rx urb count threshold to 1

Reduce the Rx count threshold to make sure we read
the available credits for Tx.

Signed-off-by: Julien Massot <jmassot@aldebaran-robotics.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>


# 987cdcba 06-Jan-2014 Julien Massot <jmassot@aldebaran-robotics.com>

ath6kl: increase usb rx buffer size to 4096

With the previous value (1700), some urb are dropped
with a babble error (urb status equal -EOVERFLOW).

These error seems to only happen when urb length is a
multiple of packet size (512).

Signed-off-by: Julien Massot <jmassot@aldebaran-robotics.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>


# 8c40e4e0 14-May-2013 Mohammed Shafi Shajakhan <mohammed@qca.qualcomm.com>

ath6kl: Fix a suspend/resume crash in AR6004 USB

cfg80211 suspend/resume callbacks are not yet implemented
for AR6004 USB. Introduce dummy handlers for these to avoid
NULL pointer dereference.

Cc: Sivanesan Rajapupathi <c_srajap@qualcomm.com>
Signed-off-by: Mohammed Shafi Shajakhan <mohammed@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>


# 0b3d3ff1 14-May-2013 Mohammed Shafi Shajakhan <mohammed@qca.qualcomm.com>

ath6kl: Rename USB driver's suspend/resume/reset_resume

Rename USB driver's suspend/resume/reset_resume callbacks
with 'pm' prefix. This is necessary to differentiate it from
cfg80211/hif suspend/resume/reset_resume callbacks.

Cc: Sivanesan Rajapupathi <c_srajap@qualcomm.com>
Signed-off-by: Mohammed Shafi Shajakhan <mohammed@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>


# a41d9a91 10-Mar-2013 Andrei Epure <epure.andrei@gmail.com>

ath: changed kmalloc to kmemdup

Signed-off-by: Andrei Epure <epure.andrei@gmail.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>


# 4e1609c9 08-Mar-2013 Kalle Valo <kvalo@qca.qualcomm.com>

ath6kl: fix usb related error handling and warnings

It was annoying to debug usb warm reboot initialisation problems as many usb
related functions just ignored errors and it wasn't obvious from the kernel
logs what was failing. Fix all that so that error messages are printed and
errors are handled properly.

Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>


# e16ccfee 16-Nov-2012 Mohammed Shafi Shajakhan <mohammed@qca.qualcomm.com>

ath6kl: remove unnecessary check for NULL skb

dev_kfree_skb kernel API itself takes for checking for NULL
skb, so an explicit check is not required.

Signed-off-by: Mohammed Shafi Shajakhan <mohammed@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>


# 171fe768 27-Sep-2012 Mohammed Shafi Shajakhan <mohammed@qca.qualcomm.com>

ath6kl: Fix mapping uplink endpoint for AR6004

AR6004(UB134) firmware supports only LP Endpoint, So map
all Access Categories to Low Priority endpoints. This fixes a WPA2
connection issue as the uplink(tx) endpoint is appropriately
mapped in sync with the firmware.

Tested-by: Ben Gray <ben.r.gray@gmail.com>
Reported-by: Ben Gray <ben.r.gray@gmail.com>
Signed-off-by: Mohammed Shafi Shajakhan <mohammed@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>


# 5dbdf6fe 27-Sep-2012 Mohammed Shafi Shajakhan <mohammed@qca.qualcomm.com>

ath6kl: Return error case when ath6kl_usb_alloc_pipe_resources fails

Incase the resource allocation for the struct ath6kl_urb_context in the
function ath6kl_usb_alloc_pipe_resources fails, return this error
case so that ath6kl_usb_probe is aware of this error case.

Signed-off-by: Mohammed Shafi Shajakhan <mohammed@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>


# a3b3842c2 13-Aug-2012 Marina Makienko <makienko@ispras.ru>

ath6kl: check usb_register() return value

ath6kl_usb_init() does not check usb_register() return value.
As a result it may incorrectly report success of driver initialization.

Found by Linux Driver Verification project (linuxtesting.org).

kvalo: fix commit title and make cosmetic changes to the code to follow
more the style used in the driver

Signed-off-by: Marina Makienko <makienko@ispras.ru>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>


# bf744f11 16-Jul-2012 Bala Shanmugam <bkamatch@qca.qualcomm.com>

ath6kl: Add support for AR6004 hardware version 1.3

Add support for AR6004 hardware with version 1.3 and has
id 0x31c8088a.

Signed-off-by: Bala Shanmugam <bkamatch@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>


# e1f12eb6 23-Apr-2012 Sarah Sharp <sarah.a.sharp@linux.intel.com>

USB: Disable hub-initiated LPM for comms devices.

Hub-initiated LPM is not good for USB communications devices. Comms
devices should be able to tell when their link can go into a lower power
state, because they know when an incoming transmission is finished.
Ideally, these devices would slam their links into a lower power state,
using the device-initiated LPM, after finishing the last packet of their
data transfer.

If we enable the idle timeouts for the parent hubs to enable
hub-initiated LPM, we will get a lot of useless LPM packets on the bus
as the devices reject LPM transitions when they're in the middle of
receiving data. Worse, some devices might blindly accept the
hub-initiated LPM and power down their radios while they're in the
middle of receiving a transmission.

The Intel Windows folks are disabling hub-initiated LPM for all USB
communications devices under a xHCI USB 3.0 host. In order to keep
the Linux behavior as close as possible to Windows, we need to do the
same in Linux.

Set the disable_hub_initiated_lpm flag for for all USB communications
drivers. I know there aren't currently any USB 3.0 devices that
implement these class specifications, but we should be ready if they do.

Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>
Cc: Marcel Holtmann <marcel@holtmann.org>
Cc: Gustavo Padovan <gustavo@padovan.org>
Cc: Johan Hedberg <johan.hedberg@gmail.com>
Cc: Hansjoerg Lipp <hjlipp@web.de>
Cc: Tilman Schmidt <tilman@imap.cc>
Cc: Karsten Keil <isdn@linux-pingi.de>
Cc: Peter Korsgaard <jacmet@sunsite.dk>
Cc: Jan Dumon <j.dumon@option.com>
Cc: Petko Manolov <petkan@users.sourceforge.net>
Cc: Steve Glendinning <steve.glendinning@smsc.com>
Cc: "John W. Linville" <linville@tuxdriver.com>
Cc: Kalle Valo <kvalo@qca.qualcomm.com>
Cc: "Luis R. Rodriguez" <mcgrof@qca.qualcomm.com>
Cc: Jouni Malinen <jouni@qca.qualcomm.com>
Cc: Vasanthakumar Thiagarajan <vthiagar@qca.qualcomm.com>
Cc: Senthil Balasubramanian <senthilb@qca.qualcomm.com>
Cc: Christian Lamparter <chunkeey@googlemail.com>
Cc: Brett Rudley <brudley@broadcom.com>
Cc: Roland Vossen <rvossen@broadcom.com>
Cc: Arend van Spriel <arend@broadcom.com>
Cc: "Franky (Zhenhui) Lin" <frankyl@broadcom.com>
Cc: Kan Yan <kanyan@broadcom.com>
Cc: Dan Williams <dcbw@redhat.com>
Cc: Jussi Kivilinna <jussi.kivilinna@mbnet.fi>
Cc: Ivo van Doorn <IvDoorn@gmail.com>
Cc: Gertjan van Wingerde <gwingerde@gmail.com>
Cc: Helmut Schaa <helmut.schaa@googlemail.com>
Cc: Herton Ronaldo Krzesinski <herton@canonical.com>
Cc: Hin-Tak Leung <htl10@users.sourceforge.net>
Cc: Larry Finger <Larry.Finger@lwfinger.net>
Cc: Chaoming Li <chaoming_li@realsil.com.cn>
Cc: Daniel Drake <dsd@gentoo.org>
Cc: Ulrich Kunitz <kune@deine-taler.de>
Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>


# 08c61009 12-Apr-2012 Ray Chen <raychen@qca.qualcomm.com>

ath6kl: Fix system crash sometimes for USB hotplug

System crash because of NULL pointer reference due to
cleanup_scatter is not implemented for USB.

Signed-off-by: Ray Chen <raychen@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>


# 6146ca69 10-Apr-2012 Ray Chen <raychen@qca.qualcomm.com>

ath6kl: Add AR6004 1.2 support for USB and SDIO

Add the necessary change for AR6004 1.2 chip support

Signed-off-by: Ray Chen <raychen@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>


# 9cbee358 25-Mar-2012 Kalle Valo <kvalo@qca.qualcomm.com>

ath6kl: add full USB support

Now, with HTC pipe, it's possible to fully support USB version of AR6004.

Based on code by Kevin Fang.

Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>


# e76ac2bf 25-Mar-2012 Kalle Valo <kvalo@qca.qualcomm.com>

ath6kl: add htc ops

In preparation for adding HTC pipe implementation add htc-ops.h to make
it possible dynamically choose which HTC type is used.

Needed for full USB support.

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

Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
Signed-off-by: Ray Chen <raychen@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>


# 1b2df407 06-Feb-2012 Vasanthakumar Thiagarajan <vthiagar@qca.qualcomm.com>

ath6kl: Update license header

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

Signed-off-by: Vasanthakumar Thiagarajan <vthiagar@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>


# 241b128b 17-Jan-2012 Kalle Valo <kvalo@qca.qualcomm.com>

ath6kl: add back beginnings of USB support

John Linville had to revert the part of USB support which was already
in ath6kl due to build problems in commit cb00ec382b ("ath6kl: revert
USB support"). Now that I fixed the build problems properly by adding
ath6kl_core.ko kernel module it's possible to add back the
(incomplete) USB support. This patch is a revert of John's patch and
adds back the USB code which as already in ath6kl, only difference
being minor changes in Makefile and adapting usb.c to new core
function names.

Note that USB support in ath6kl is not complete yet. This code only
makes it possible to boot firmware but as HTC layer does not yet
support USB it's not possible to send any WMI commands nor data
packets to the firmware. That will be added soon.

Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>


# cb00ec38 05-Jan-2012 John W. Linville <linville@tuxdriver.com>

ath6kl: revert USB support

The ath6kl driver is causing build failures when the ath6kl bits are
not built as modules. A better fix is forthcoming in a future release,
but for now lets revert the problematic code.

This reverts the following commits:

fde57764ef8751b9aca11b6f6221ac5555bda699
d70385a26ad9a122a5450d066550470107b6bc38
59d954dda4b9b3f3e61d4b87a2b26952b8c4c09d

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


# c0038972 16-Dec-2011 Kalle Valo <kvalo@qca.qualcomm.com>

ath6kl: handle firmware names more dynamically

Currently ath6kl has just hardcoded paths to each firmware file. Change
this more dynamic by separating the the directory and file name from each
other. That way it's easier to dynamically create full paths to firmware and
code looks better. And now it's possible to remove a function needed by
devicetree code.

While at it add a structure inside struct ath6kl_hw to contain all
firmware names. I deliberately omitted board file support as
those will be handled later.

This is needed for firmware API 3.

Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>


# 0d0192ba 14-Nov-2011 Kalle Valo <kvalo@qca.qualcomm.com>

ath6kl: use hardware version names consistently

Part of ath6kl uses "REV3" style of naming hardware versions and elsewhere
"hw 2.1.1" is used instead for the same version. This is confusing, use
the latter term everywhere.

Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>


# 59d954dd 10-Nov-2011 Kalle Valo <kvalo@qca.qualcomm.com>

ath6kl: add USB support

Add USB support for ar6004. Currently only firmware can be booted,
no commands can be sent to firmware yet as HTC layer doesn't work
with USB yet.

Based on patches by Kevin Fang.

Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>