History log of /linux-master/drivers/net/wireless/ath/ath6kl/htc_mbox.c
Revision Date Author Comments
# b7d17447 13-Mar-2022 Julia Lawall <Julia.Lawall@inria.fr>

ath6kl: fix typos in comments

Various spelling mistakes in comments.
Detected with the help of Coccinelle.

Signed-off-by: Julia Lawall <Julia.Lawall@inria.fr>
Signed-off-by: Kalle Valo <quic_kvalo@quicinc.com>
Link: https://lore.kernel.org/r/20220314115354.144023-4-Julia.Lawall@inria.fr


# e3128a9d 08-Dec-2021 Kees Cook <keescook@chromium.org>

ath6kl: Use struct_group() to avoid size-mismatched casting

In builds with -Warray-bounds, casts from smaller objects to larger
objects will produce warnings. These can be overly conservative, but since
-Warray-bounds has been finding legitimate bugs, it is desirable to turn
it on globally. Instead of casting a u32 to a larger object, redefine
the u32 portion of the header to a separate struct that can be used for
both u32 operations and the distinct header fields. Silences this warning:

drivers/net/wireless/ath/ath6kl/htc_mbox.c: In function 'htc_wait_for_ctrl_msg':
drivers/net/wireless/ath/ath6kl/htc_mbox.c:2275:20: error: array subscript 'struct htc_frame_hdr[0]' is partly outside array bounds of 'u32[1]' {aka 'unsigned int[1]'} [-Werror=array-bounds]
2275 | if (htc_hdr->eid != ENDPOINT_0)
| ^~
drivers/net/wireless/ath/ath6kl/htc_mbox.c:2264:13: note: while referencing 'look_ahead'
2264 | u32 look_ahead;
| ^~~~~~~~~~

This change results in no executable instruction differences.

Signed-off-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Kalle Valo <quic_kvalo@quicinc.com>
Link: https://lore.kernel.org/r/20211207063538.2767954-1-keescook@chromium.org


# 0e7bf23e 28-Jul-2019 Jia-Ju Bai <baijiaju1990@gmail.com>

ath6kl: Fix a possible null-pointer dereference in ath6kl_htc_mbox_create()

In ath6kl_htc_mbox_create(), when kzalloc() on line 2855 fails,
target->dev is assigned to NULL, and ath6kl_htc_mbox_cleanup(target) is
called on line 2885.

In ath6kl_htc_mbox_cleanup(), target->dev is used on line 2895:
ath6kl_hif_cleanup_scatter(target->dev->ar);

Thus, a null-pointer dereference may occur.

To fix this bug, kfree(target) is called and NULL is returned when
kzalloc() on line 2855 fails.

This bug is found by a static analysis tool STCheck written by us.

Signed-off-by: Jia-Ju Bai <baijiaju1990@gmail.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>


# 79fd1709 18-Nov-2015 Steve deRosier <derosier@gmail.com>

ath6kl: Don't print error message when recv is canceled

An error message ath6kl_htc_rxmsg_pending_handler isn't appropate for when
the error is ECANCELED. This could be the result of a perfectly appropriate
RX cancel due to shutdown or suspend. This allows the right cleanup to
continue, but without an alarming error message in this particular case.

Signed-off-by: Steve deRosier <steve.derosier@lairdtech.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>


# 101d1f7f 07-Sep-2015 Colin Ian King <colin.king@canonical.com>

ath6kl: remove redundant null pointer check on send_pkt

The check for send_pkt being NULL is redundant before the call
to htc_reclaim_txctrl_buf, therefore it should be removed. This was
detected by static analysis by cppcheck.

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>


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

ath6kl: use braces on both arms of if statement

Fixes checkpatch warning:

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

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


# 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>


# 4771979a 18-Mar-2013 Kalle Valo <kvalo@qca.qualcomm.com>

ath6kl: adding tracing points for htc_mbox

Add tracing points for htc layer, just dumping the packets to user space.
I wasn't really sure what to do with the status value, it might not always
be accurate, but I included it anyway.

I skipped htc_pipe (and usb) implementation for now. Need to add those
tracepoints later.

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


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

ath6kl: Remove obselete USB device related checks

These checks are no longer needed as the necessary
USB support is already present in the driver.

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


# 86aa7c1e 21-Sep-2012 Pandiyarajan Pitchaimuthu <c_ppitch@qca.qualcomm.com>

ath6kl: Array index out of bounds check

The variable assigned_ep can be assigned value of -1 and is never
checked if it equals -1. So the endpoint array can have -1 as the index
value and can be out of bounds.

The value of assigned_ep is checked for -1 and is ensured that the
endpoint array doesn't go out of bounds.

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


# df6a7072 28-May-2012 Raja Mani <rmani@qca.qualcomm.com>

ath6kl: Fix typo in htc mbox debug print msg

Add missing ZERO (x%x to 0x%x) in the format specifier
while printing hex value in htc module.

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


# 93b42cae 26-Apr-2012 Vasanthakumar Thiagarajan <vthiagar@qca.qualcomm.com>

ath6kl: Complete failed tx packet in ath6kl_htc_tx_from_queue()

Return status of ath6kl_htc_tx_issue() is ignored in
ath6kl_htc_tx_from_queue(), but failed tx packet is
is not cleaned up. To fix memory leak in this case, call
completion with error. Also, throw an error debug message
when tx fails in ath6kl_sdio_write_async() due to shortage
in bus request buffer.

kvalo: change the error message to WARN_ON_ONCE()

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


# f5f7ba25 26-Apr-2012 Kevin Fang <chienf@qca.qualcomm.com>

ath6kl: handle background(BK) stream properly on htc mbox layer

When a STA sends huge BK QoS data frame first and then sends BE/VI/VO
QoS data frame, the corresponding throughput becomes much lower than
that without sends BK QoS data frame before.

The root cause is that when station send BK stream, the tx credits of
BK stream don't return back to higher priority QoS stream such as BE,
VI, and VO stream. This patch will handle BK stream properly, when
there is higher priority QoS stream, it will seek tx credits from BK
stream properly.

Signed-off-by: Kevin Fang <kevin.fang@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>


# b86aeb50 20-Apr-2012 Dan Carpenter <dan.carpenter@oracle.com>

ath6kl: fix an indenting issue

This is supposed to be pushed in one indent level.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>


# 3acabc88 20-Apr-2012 Dan Carpenter <dan.carpenter@oracle.com>

ath6kl: change || to &&

The original conditions are always true. I think && was intended here,
but I don't have the hardware to test. Could you take a look?

kvalo: Chilam confirmed that the fix is valid

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>


# 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>