History log of /linux-master/drivers/net/wireless/ath/ath9k/ar9003_mci.c
Revision Date Author Comments
# b3a663f0 06-Dec-2022 Wenli Looi <wlooi@ucalgary.ca>

wifi: ath9k: remove most hidden macro dependencies on ah

Adds an explicit _ah parameter to most macros that previously had a
hidden dependency on ah. This makes the code more compliant with the
style guide.

This change does not appear to affect the final binary.

Signed-off-by: Wenli Looi <wlooi@ucalgary.ca>
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/c8369317-cf84-f0e3-fe8-9b6e22e43a6a@ucalgary.ca


# dc453984 04-Nov-2022 Colin Ian King <colin.i.king@gmail.com>

wifi: ath9k: Remove unused variable mismatch

Variable mismatch is just being incremented and it's never used anywhere
else. The variable and the increment are redundant so remove it.

Signed-off-by: Colin Ian King <colin.i.king@gmail.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/20221104140723.226857-1-colin.i.king@gmail.com


# 53d76f16 22-Oct-2018 zhong jiang <zhongjiang@huawei.com>

ath9k: remove set but not used variable 'new_flags'

new_flags is not used after setting its value. It is safe to remove
the unused variable.

Signed-off-by: zhong jiang <zhongjiang@huawei.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>


# b2d70d49 06-Mar-2016 Miaoqing Pan <miaoqing@codeaurora.org>

ath9k: make GPIO API to support both of WMAC and SOC

commit 61b559dea40e ("ath9k: add extra GPIO led support")
added ath9k to support access SOC's GPIOs, but implemented
in a separated API: ath9k_hw_request_gpio().

So this patch make the APIs more common, to support both
of WMAC and SOC GPIOs. The new APIs as below,

void ath9k_hw_gpio_request_in();
void ath9k_hw_gpio_request_out();
void ath9k_hw_gpio_free();

NOTE, the BSP of the SOC chips(AR9340, AR9531, AR9550, AR9561)
should set the corresponding MUX registers correctly.

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


# 7644317b 13-Mar-2015 Sujith Manoharan <c_manoha@qca.qualcomm.com>

ath9k: Start AIC calibration during MCI reset

When a MCI reset is done, make sure that AIC
is started.

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>


# 60544603 13-Mar-2015 Sujith Manoharan <c_manoha@qca.qualcomm.com>

ath9k: Handle MCI_STATE_AIC_CAL

Add the main AIC calibration function to
handle MCI_STATE_AIC_CAL.

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>


# f2ef792a 13-Mar-2015 Sujith Manoharan <c_manoha@qca.qualcomm.com>

ath9k: Handle MCI_STATE_AIC_START

This patch adds a function to handle the
MCI message MCI_STATE_AIC_START.

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>


# 958b6827 13-Mar-2015 Sujith Manoharan <c_manoha@qca.qualcomm.com>

ath9k: Handle MCI_STATE_AIC_CAL_RESET

Add a routine to handle the MCI_STATE_AIC_CAL_RESET
message.

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>


# 208837ee 13-Mar-2015 Sujith Manoharan <c_manoha@qca.qualcomm.com>

ath9k: Disable AIC by default

Since various MCI messages need to be
handled, along with driver-level support
in upper layers, disable AIC for now.

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>


# b6ab9ae2 13-Mar-2015 Sujith Manoharan <c_manoha@qca.qualcomm.com>

ath9k: Handle MCI_STATE_AIC_CAL_SINGLE

This patch adds routines to handle the MCI
message AIC_CAL_SINGLE, starting the required
HW calibration.

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>


# 2f890cab 15-Feb-2015 Sujith Manoharan <c_manoha@qca.qualcomm.com>

ath9k: Mute BT properly

Set The BT/WLAN priority weights correctly and make sure
that MCI_LNA_TAKE is sent only for cards that share
PA/LNA.

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>


# ad1dc638 15-Feb-2015 Sujith Manoharan <c_manoha@qca.qualcomm.com>

ath9k: Fix GPM initialization

Handle MCI_STATE_INIT_GPM_OFFSET separately and do not
overload ar9003_mci_get_next_gpm_offset() with a special
case.

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>


# bc80d526 15-Feb-2015 Sujith Manoharan <c_manoha@qca.qualcomm.com>

ath9k: Prepare MCI interface correctly

The LNA_TRANS message needs to be sent only for
chips which have shared PA/LNA.

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>


# 4d9f7c68 15-Feb-2015 Sujith Manoharan <c_manoha@qca.qualcomm.com>

ath9k: Setup MCI statistics properly

Use a subroutine to enable MCI debug statistics
if it is present in the global configuration.

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>


# d808ecd8 15-Feb-2015 Sujith Manoharan <c_manoha@qca.qualcomm.com>

ath9k: Fix MCI TX control

This patch makes sure that the antenna configuration
is used properly when setting AR_MCI_TX_CTRL.

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>


# e18e164e 15-Feb-2015 Sujith Manoharan <c_manoha@qca.qualcomm.com>

ath9k: Handle 2-ANT AR9565 in MCI reset

The value programmed in the BTCOEX control register
is different for each chip. This patch adds support
for 2-ANT, 1-ANT solutions based on AR9565.

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>


# 7d1805e1 15-Feb-2015 Sujith Manoharan <c_manoha@qca.qualcomm.com>

ath9k: Remove useless check in MCI reset

If we fail to allocate the sched/gpm buffers when
initializing MCI, we bail out properly. Checking
them in ar9003_mci_reset() is unnecessary, so remove it.

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>


# 4b9b42bf 11-Sep-2013 Sujith Manoharan <c_manoha@qca.qualcomm.com>

ath9k: Use bitops for calibration flags

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


# b88083bf 20-Nov-2012 Rajkumar Manoharan <rmanohar@qca.qualcomm.com>

ath9k: Fix MCI reset in BT cal_req

This patch reverts the commit "ath9k_hw: Wait BT calibration to complete"
and bail out from MCI interrupt routine for chip reset. The above commit
stalls the WLAN TCP traffic while bringing up and down the BT interface
iteratively. Fixing this properly by queueing up chip reset and bailing
out properly from tasklet routine.

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


# e75d4ed6 25-Oct-2012 Rajkumar Manoharan <rmanohar@qca.qualcomm.com>

ath9k_hw: Fix concurrent tx on lower tx power

Whenever WLAN receives scheduling msg from BT, it reduces tx power
based on RSSI level. And then BT starts simultaneous transmission
along with WLAN. Sometimes HW MAC compares tx power that is used
prior to power reduction which is causing BT transmission to defer.

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


# 2097fdd7 15-Oct-2012 Rajkumar Manoharan <rmanohar@qca.qualcomm.com>

ath9k_hw: Fix frequent BT rx recovery

While resuming from S3, BT host issues HCI reset command and it
causes BT firmware to busy with security key calculation. At this
movement, WLAN detects MCI hardware error of MCI_CONT_INFO_TIMEOUT
and then it starts the recovery sequence repeatedly. Too many
recovery sequences would exhaust the BT kernel message pool. This
patch imposes a duration between consecutive BT recovery procedure.
Thus it solves BT firmware panic issue reported in AR9565.

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


# e9f9fd8c 15-Oct-2012 Rajkumar Manoharan <rmanohar@qca.qualcomm.com>

ath9k_hw: Disable MCI stat counter by default for AR9565

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


# b55f6bb7 15-Oct-2012 Bala Shanmugam <bkamatch@qca.qualcomm.com>

ath9k: turn off RXIQ calibration while re-calibrating radio

TXIQ and RXIQ share the same data path to upload the measurement
result, we should turn off RXIQ calibration while re-calibrating radio

Signed-off-by: Bala Shanmugam <bkamatch@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>


# d9575dad 15-Oct-2012 Bala Shanmugam <bkamatch@qca.qualcomm.com>

ath9k: Set appropriate bit for AR9565 in btc control register

Signed-off-by: Bala Shanmugam <bkamatch@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>


# 7d47884f 15-Oct-2012 Rajkumar Manoharan <rmanohar@qca.qualcomm.com>

ath9k_hw: Fix selfgen chainmask for 9565

Self generated MCI messages is configured to use chain 1. As
ar9565 is 1x1 solution, It can not use Chain 1. Hence fix
Chain 1 for ar9462 alone. Not doing so, could affect WLAN
connectivity in ar9565 as LNA sharing is not informed by BT.

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


# 4c6231a4 15-Oct-2012 Rajkumar Manoharan <rmanohar@qca.qualcomm.com>

ath9k_hw: Enable OSLA hw fix for AR9565

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


# e82cb03f 12-Oct-2012 Rajkumar Manoharan <rmanohar@qca.qualcomm.com>

ath9k: adjust WLAN and BT concurrent transmission

The simulataneous transmission of both WLAN and BT might cause
increase in power levels. To avoid regulatory violation, WLAN tx
power will be adjusted according to BT power index based on avaliability
of BT scheduling messages. WLAN tx power reduction might affect its
performance. So WLAN tx power is only be lowered when the signal strength
is good enough. Otherwise concurrent tx will be disabled and WLAN uses
it default power levels. Also concurrent tx is disabled whenever WLAN is
moving to off-channel which might be used by BT.

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


# 69c6ac60 25-Sep-2012 Sujith Manoharan <c_manoha@qualcomm.com>

ath9k: Handle errors properly in MCI initialization

The MCI initialization path has various points of failures,
handle these to ensure that we bail out correctly in such
cases.

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


# a50d1fd4 24-Sep-2012 Rajkumar Manoharan <rmanohar@qca.qualcomm.com>

ath9k_hw: fix BT sleep state on chip wakeup

Whenever both WLAN and BT in/out sleep mode, sometimes WLAN
is not able to take back the shared LNA control after resumes
from sleep mode. The idea is that for WLAN to check if BT owns
LNA control and BT is in sleep mode when WLAN just resumes from
sleep mode. If the condition is true, do a BTCOEX_RC_WARM_RESET
for WLAN to take back the control of shared LNA.
Now the issue is the BT sleep value read from MCI register is
overlooked by assigning u32 into u8. Hence the above condition never
be met so that WLAN used to report beacon losses and frequent
connection drops.

Signed-off-by: Rajkumar Manoharan <rmanohar@qca.qualcomm.com>
Tested-by: Paul Stewart <pstew@chromium.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>


# d92bb98f 12-Sep-2012 Rajkumar Manoharan <rmanohar@qca.qualcomm.com>

ath9k: flush bt profile whenever it is requested

Before processing BT profiles or status messages, check whether
it is requested to flush BT profile. Otherwise it might increase
number of BT profiles that affects the WLAN performance. Also
flush the profiles when MCI is recovering from broken rx. After
flushing BT profiles, query BT topology to refetch them.

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


# bfbee427 12-Sep-2012 Rajkumar Manoharan <rmanohar@qca.qualcomm.com>

ath9k_hw: fix ar9462 selfgen chainmask

When the 9462 is operating in 2G mode and MCI is enabled then
reduce the selfgen chain mask to chain 1. Otherwise poor performance
was reported at short range at Rx side when COEX is enabled.

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


# 83ad49a9 10-Sep-2012 Rajkumar Manoharan <rmanohar@qca.qualcomm.com>

ath9k_hw: Wait BT calibration to complete

Whenever BT calibration requested, WLAN has to wait for the
calibration to be completed. But right now we defer the waiting
which might cause BT calibration to fail. Fix that.

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


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

ath9k_hw: Fix invalid MCI GPM index access/caching

There is a possibility that AR_MCI_GPM_1 register can
return 0xdeadbeef and this results in caching of invalid
GPM index in ar9003_mci_is_gpm_valid. Ensure we
have appropriate checks to avoid this.

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


# 4653356f 24-Aug-2012 Mohammed Shafi Shajakhan <mohammed@qca.qualcomm.com>

ath9k_hw: small optimization

Assign the MCI BT state locally, rather than unnecessarily calling
ar9003_mci_state and updating it.

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


# 83bfea42 01-Jul-2012 Rajkumar Manoharan <rmanohar@qca.qualcomm.com>

ath9k_hw: fix AR9462 2g5g switch on full reset

On full reset, mci reset will put LNA update on 2G mode. And
Whenever 2g5g_switch is forced at the end of full reset, lna
update should not be skipped. Not doing so, is affecting WLAN
rx and causing beacon loss when BTCOEX is enabled on AR9462.

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


# 4ff6a9d2 18-Jun-2012 Rajkumar Manoharan <rmanohar@qca.qualcomm.com>

ath9k_hw: fix LNA control on WLAN sleep

When WLAN enter full sleep mode, WLAN HW should send out a LNA_TAKE
message for BT to take control of the shared LNA. Otherwise BT traffic
is completely stopped whenever the wlan interface is moved full sleep
mode.

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


# a68807e9 18-Jun-2012 Rajkumar Manoharan <rmanohar@qca.qualcomm.com>

ath9k_hw: fix BT mute at hw init

WLAN driver initialization is muting BT which is terminating
the ongoing BT traffic. The reason to mute BT is to avoid any
incoming MCI messages from BT when MCI reset is in progress that
could corrupt WLAN MCI RX state machine. But we should not
dedicate radio completely to WLAN in driver init itself. So this
patch removes the wlan weightage changes from mute BT to retain
BT connection.

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


# 9330969b 12-Jun-2012 Rajkumar Manoharan <rmanohar@qca.qualcomm.com>

ath9k_hw: remove MCI_STATE_SET_BT_SLEEP

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


# 26e942b7 12-Jun-2012 Rajkumar Manoharan <rmanohar@qca.qualcomm.com>

ath9k_hw: remove MCI_STATE_CONT_* state

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


# 6d97be48 12-Jun-2012 Rajkumar Manoharan <rmanohar@qca.qualcomm.com>

ath9k_hw: remove MCI_STATE_BT

remove MCI_STATE_BT and use bt_state instead.

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


# b98ccec0 12-Jun-2012 Rajkumar Manoharan <rmanohar@qca.qualcomm.com>

ath9k_hw: remove p_data argument from ar9003_mci_state

As p_data is unuse, lets remove it from ar9003_mci_state.

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


# d02ca07e 12-Jun-2012 Rajkumar Manoharan <rmanohar@qca.qualcomm.com>

ath9k_hw: remove MCI_STATE_NEED_FLUSH_BT_INFO

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


# 2d340ac8 12-Jun-2012 Rajkumar Manoharan <rmanohar@qca.qualcomm.com>

ath9k_hw: remove MCI_STATE_SEND_WLAN_CHANNELS

Add a MCI util function to send wlan channel info to BT.

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


# e1763d3f 12-Jun-2012 Rajkumar Manoharan <rmanohar@qca.qualcomm.com>

ath9k_hw: add utility function to set BT version

Add a utility function to set bluetooth version and remove
MCI_STATE_SET_BT_COEX_VERSION.

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


# 506847ad 12-Jun-2012 Rajkumar Manoharan <rmanohar@qca.qualcomm.com>

ath9k_hw: cleanup MCI gpm offset state

Add utility functions to get and test GPM offset and
remove MCI_STATE*_GPM_OFFSET states.

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


# 1bde95fa 10-Jun-2012 Rajkumar Manoharan <rmanohar@qca.qualcomm.com>

ath9k_hw: fix incorrect LNA register settings

After a full reset, mci_reset will put LNA update to the setting
for 2G mode. Those registers need to be forced to update when
the channel is in 5G.

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


# 3863495b 10-Jun-2012 Rajkumar Manoharan <rmanohar@qca.qualcomm.com>

ath9k_hw: check GPM HW write pointer before chip reset

Both "MAC Warm Reset" and "MCI Reset Rx" will reset GPM HW write_ptr.
We should check software cached write_ptr against HW write_ptr before
reset. Otherwise the pending DMA data will be lost.

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


# 9dd9b0dc 10-Jun-2012 Rajkumar Manoharan <rmanohar@qca.qualcomm.com>

ath9k_hw: Fix AR9462 power consumption on idle associated

The HW statemachine is sometimes found stuck in the state
WL_LNA_CTRL_DISABLE when BT is in sleep, which will cause
TX_HOLD always asserted and resmgr stuck in PENDING_TX state

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


# 0603143e 04-Jun-2012 Rajkumar Manoharan <rmanohar@qca.qualcomm.com>

ath9k: BT coex performance tuning for AR9462

Use smaller aggregation limit and increasing aggregation threshold
for osla that could improve wlan performance when there is HID profile.

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


# 99922a45 04-Jun-2012 Rajkumar Manoharan <rmanohar@qca.qualcomm.com>

ath9k_hw: fix BT RF performance

When software rfkill is triggered, before put the chip in reset
state, give LNA and SPDT control to BT to make sure BT can have
good RF performance.

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


# 4f6bd1a8 04-Jun-2012 Rajkumar Manoharan <rmanohar@qca.qualcomm.com>

ath9k: cleanup MCI indentation

Fix bad indentation & if nesting to lose about two levels
of unnecessary indentation.

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


# 2fd5d35b 04-Jun-2012 Sujith Manoharan <c_manoha@qca.qualcomm.com>

ath9k_hw: Fix variable usage

Exposed by sparse:
ar9003_mci.c:1134:31: warning: Using plain integer as NULL pointer

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


# 83c7a52d 04-Jun-2012 Sujith Manoharan <c_manoha@qca.qualcomm.com>

ath9k_hw: Fix AR_RTC_KEEP_AWAKE usage

The default value that is being programmed to AR_RTC_KEEP_AWAKE
is 0x2, there is no need to program it manually in various
functions.

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


# 8a90555f 04-May-2012 Sujith Manoharan <c_manoha@qca.qualcomm.com>

ath9k_hw: Fix RTT calibration

This patch fixes multiple issues with the current RTT
implementation in ath9k.

* The data that is obtained from the RTT interface registers
are stored in 31:5 - mask out the extra bits when reading them.

* A history buffer is maintained which is not needed at all.
Remove this array and just store the baseband data for each
chain (or bank).

* A 'num_readings' variable was being used to handle the
last entry. But it was being used in an improper manner, with
the result that the RTT values were never being written
to the RTT Interface registers. Fix this by using a simple
flag.

* Stop baseband operations before programming the calibration values
to the HW.

* Do not restore RX gain settings as part of RTT.

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


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

ath9k_hw: MCI whitespace/debug cleanup

This patch fixes indentation and the general coding style
in ar9003_mci.c. Also, minimize the amount of debug log
output generated by MCI.

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


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

ath9k_hw: Remove HW revision checks

They are not needed since MCI will be enabled only for
AR9462 v2.0

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


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

ath9k_hw: Cleanup MCI reset routine

* Use a separate function to enable/disable
OneStepLookAhead.

* Remove unnecessary hardware SREV checks.

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


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

ath9k: Remove ATH9K_HW_CAP_MCI checks

With the ability to remove BTCOEX support at compile time,
these checks are no longer needed.

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


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

ath9k_hw: Cleanup MCI function declarations

This patch converts a few functions to static variants
and removes extraneous declarations.

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


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

ath9k_hw: Cleanup MCI bits from ath9k_hw_reset()

This patch moves all the MCI-specific code in the main reset
function to helper functions.

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


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

ath9k_hw: Setup MCI calibration using a helper

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


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

ath9k_hw: Handle MCI power state using a helper

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


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

ath9k_hw: Use a helper function to get MCI ISR

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


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

ath9k: Cleanup MCI init/deinit routines

This patch simplifies the buffer allocation functions
for MCI and removes unneeded memset calls. Also, a couple
of unused variables are removed and a memory leak in DMA
allocation is fixed.

[ 1263.788267] WARNING: at /home/sujith/dev/wireless-testing/lib/dma-debug.c:875 check_unmap+0x173/0x7e0()
[ 1263.788273] ath9k 0000:06:00.0: DMA-API: device driver frees DMA memory with different size
[device address=0x0000000071908000] [map size=512 bytes] [unmap size=256 bytes]
[ 1263.788345] Pid: 774, comm: rmmod Tainted: G W O 3.3.0-rc3-wl #18
[ 1263.788348] Call Trace:
[ 1263.788355] [<ffffffff8105110f>] warn_slowpath_common+0x7f/0xc0
[ 1263.788359] [<ffffffff81051206>] warn_slowpath_fmt+0x46/0x50
[ 1263.788363] [<ffffffff8125a713>] check_unmap+0x173/0x7e0
[ 1263.788368] [<ffffffff8123fc22>] ? prio_tree_left+0x32/0xc0
[ 1263.788373] [<ffffffff8125aded>] debug_dma_free_coherent+0x6d/0x80
[ 1263.788381] [<ffffffffa0701c3c>] ath_mci_cleanup+0x7c/0x110 [ath9k]
[ 1263.788387] [<ffffffffa06f4033>] ath9k_deinit_softc+0x113/0x120 [ath9k]
[ 1263.788392] [<ffffffffa06f55cc>] ath9k_deinit_device+0x5c/0x70 [ath9k]
[ 1263.788397] [<ffffffffa0704934>] ath_pci_remove+0x54/0xa0 [ath9k]
[ 1263.788401] [<ffffffff81267d06>] pci_device_remove+0x46/0x110
[ 1263.788406] [<ffffffff813102bc>] __device_release_driver+0x7c/0xe0
[ 1263.788410] [<ffffffff81310a00>] driver_detach+0xd0/0xe0
[ 1263.788414] [<ffffffff81310118>] bus_remove_driver+0x88/0xe0
[ 1263.788418] [<ffffffff813111c2>] driver_unregister+0x62/0xa0
[ 1263.788421] [<ffffffff812680c4>] pci_unregister_driver+0x44/0xc0
[ 1263.788427] [<ffffffffa0705015>] ath_pci_exit+0x15/0x20 [ath9k]
[ 1263.788432] [<ffffffffa070a92d>] ath9k_exit+0x15/0x31 [ath9k]
[ 1263.788436] [<ffffffff810b971c>] sys_delete_module+0x18c/0x270
[ 1263.788441] [<ffffffff81436edd>] ? retint_swapgs+0x13/0x1b
[ 1263.788446] [<ffffffff812483be>] ? trace_hardirqs_on_thunk+0x3a/0x3f
[ 1263.788450] [<ffffffff814378e9>] system_call_fastpath+0x16/0x1b
[ 1263.788453] ---[ end trace 3ab4d030ffde40d4 ]---

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


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

ath9k: Remove AR9462 v1.0 support

v1.0 chips are not available in the market.

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
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>


# bbefb871 29-Nov-2011 Mohammed Shafi Shajakhan <mohammed@qca.qualcomm.com>

ath9k_hw: Add MCI h/w code and state machine

Cc: Wilson Tsao <wtsao@qca.qualcomm.com>
Cc: Senthil Balasubramanian <senthilb@qca.qualcomm.com>
Signed-off-by: Rajkumar Manoharan <rmanohar@qca.qualcomm.com>
Signed-off-by: Mohammed Shafi Shajakhan <mohammed@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>