From 87a225354701d95e49b748efbd810baed27eea04 Mon Sep 17 00:00:00 2001 From: Oleksij Rempel Date: Wed, 8 May 2013 10:57:51 +0200 Subject: [PATCH 01/57] simplify STBC handling Current STBC handler was waiting for peer caps to make decision. Better way will be to make right decision on the host and tell firmware what it can use. This patch changes behaviour of firmware. Up now host should send ATH_RC_TX_STBC_FLAG to enable STBC. Signed-off-by: Oleksij Rempel --- target_firmware/wlan/ratectrl_11n_ln.c | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-) diff --git a/target_firmware/wlan/ratectrl_11n_ln.c b/target_firmware/wlan/ratectrl_11n_ln.c index de86550..788822c 100755 --- a/target_firmware/wlan/ratectrl_11n_ln.c +++ b/target_firmware/wlan/ratectrl_11n_ln.c @@ -438,8 +438,7 @@ rcSibUpdate_11n(struct ath_softc_tgt *sc, struct ath_node_target *pSib, ((capflag & ATH_RC_DS_FLAG) ? WLAN_RC_DS_FLAG : 0) | ((capflag & ATH_RC_HT40_SGI_FLAG) ? WLAN_RC_HT40_SGI_FLAG : 0) | ((capflag & ATH_RC_HT_FLAG) ? WLAN_RC_HT_FLAG : 0) | - ((capflag & ATH_RC_CW40_FLAG) ? WLAN_RC_40_FLAG : 0) | - ((capflag & ATH_RC_TX_STBC_FLAG) ? WLAN_RC_STBC_FLAG : 0), + ((capflag & ATH_RC_CW40_FLAG) ? WLAN_RC_40_FLAG : 0), keepState, pRateSet); } @@ -1220,18 +1219,8 @@ ath_rate_newassoc_11n(struct ath_softc_tgt *sc, struct ath_node_target *an, int ((capflag & ATH_RC_WEP_TKIP_FLAG) ? WLAN_RC_WEP_TKIP_FLAG : 0); #ifdef MAGPIE_MERLIN - /* Rx STBC is a 2-bit mask. Needs to convert from ath definition to wlan definition. */ - - oan->htcap |= (((capflag & ATH_RC_RX_STBC_FLAG) >> ATH_RC_RX_STBC_FLAG_S) - << WLAN_RC_STBC_FLAG_S); - - /* If only one chain is enabled, do not do stbc. */ - if (sc->sc_txstbcsupport) { - oan->stbc = (capflag & ATH_RC_RX_STBC_FLAG) >> ATH_RC_RX_STBC_FLAG_S; - } else { - oan->stbc = 0; - } - + /* Only MERLIN can send STBC */ + oan->stbc = (capflag & ATH_RC_TX_STBC_FLAG) ? 1 : 0; #endif rcSibUpdate_11n(sc, an, oan->htcap, 0, rs); } From c5f5ca5355e01fcb5f5ec15ff1a87c03c24d9731 Mon Sep 17 00:00:00 2001 From: Oleksij Rempel Date: Sun, 5 May 2013 21:33:33 +0200 Subject: [PATCH 02/57] ratectrl_11n_ln: nuke rcSibUpdate_11n This function is reather useless. Side effect of it is a filter for some bits which can be in other way implemented. For now, i do not see any sense for this filter. Signed-off-by: Oleksij Rempel --- target_firmware/wlan/ratectrl.h | 1 - target_firmware/wlan/ratectrl11n.h | 14 -------------- target_firmware/wlan/ratectrl_11n_ln.c | 22 ++-------------------- 3 files changed, 2 insertions(+), 35 deletions(-) diff --git a/target_firmware/wlan/ratectrl.h b/target_firmware/wlan/ratectrl.h index c832dc1..97ee9a6 100755 --- a/target_firmware/wlan/ratectrl.h +++ b/target_firmware/wlan/ratectrl.h @@ -159,7 +159,6 @@ typedef struct phy_rate_ctrl { struct atheros_node { TX_RATE_CTRL txRateCtrl; /* rate control state proper */ A_UINT32 lastRateKbps; /* last rate in Kb/s */ - A_UINT32 htcap; /* ht capabilites */ A_UINT8 singleStream :1, /* When TRUE, only single stream Tx possible */ stbc :2; /* Rx stbc capability */ diff --git a/target_firmware/wlan/ratectrl11n.h b/target_firmware/wlan/ratectrl11n.h index f220819..1123feb 100755 --- a/target_firmware/wlan/ratectrl11n.h +++ b/target_firmware/wlan/ratectrl11n.h @@ -157,20 +157,6 @@ typedef struct { rc11n_info_t info[]; } RATE_TABLE_11N; -/* - * Update the SIB's rate control information - * - * This should be called when the supported rates change - * (e.g. SME operation, wireless mode change) - * - * It will determine which rates are valid for use. - */ -void rcSibUpdate_11n(struct ath_softc_tgt *, - struct ath_node_target *, - A_UINT32 capflag, - A_BOOL keepState, - struct ieee80211_rate *rs); - /* * Determines and returns the new Tx rate index. */ diff --git a/target_firmware/wlan/ratectrl_11n_ln.c b/target_firmware/wlan/ratectrl_11n_ln.c index 788822c..b80f478 100755 --- a/target_firmware/wlan/ratectrl_11n_ln.c +++ b/target_firmware/wlan/ratectrl_11n_ln.c @@ -429,19 +429,7 @@ rcSibUpdate_ht(struct ath_softc_tgt *sc, struct ath_node_target *an, rcSortValidRates(pRateTable, pRc); } -void -rcSibUpdate_11n(struct ath_softc_tgt *sc, struct ath_node_target *pSib, - A_UINT32 capflag, A_BOOL keepState, struct ieee80211_rate *pRateSet) -{ - rcSibUpdate_ht(sc, - pSib, - ((capflag & ATH_RC_DS_FLAG) ? WLAN_RC_DS_FLAG : 0) | - ((capflag & ATH_RC_HT40_SGI_FLAG) ? WLAN_RC_HT40_SGI_FLAG : 0) | - ((capflag & ATH_RC_HT_FLAG) ? WLAN_RC_HT_FLAG : 0) | - ((capflag & ATH_RC_CW40_FLAG) ? WLAN_RC_40_FLAG : 0), - keepState, - pRateSet); -} + /* * Return the median of three numbers @@ -1212,17 +1200,11 @@ ath_rate_newassoc_11n(struct ath_softc_tgt *sc, struct ath_node_target *an, int if (isnew) { struct atheros_node *oan = ATH_NODE_ATHEROS(an); - oan->htcap = ((capflag & ATH_RC_DS_FLAG) ? WLAN_RC_DS_FLAG : 0) | - ((capflag & ATH_RC_HT40_SGI_FLAG) ? WLAN_RC_HT40_SGI_FLAG : 0) | - ((capflag & ATH_RC_HT_FLAG) ? WLAN_RC_HT_FLAG : 0) | - ((capflag & ATH_RC_CW40_FLAG) ? WLAN_RC_40_FLAG : 0) | - ((capflag & ATH_RC_WEP_TKIP_FLAG) ? WLAN_RC_WEP_TKIP_FLAG : 0); - #ifdef MAGPIE_MERLIN /* Only MERLIN can send STBC */ oan->stbc = (capflag & ATH_RC_TX_STBC_FLAG) ? 1 : 0; #endif - rcSibUpdate_11n(sc, an, oan->htcap, 0, rs); + rcSibUpdate_ht(sc, an, capflag, 0, rs); } } From 49e3b3f4dbe78e1ccf0dfdaf7dae0b593ebaa523 Mon Sep 17 00:00:00 2001 From: Oleksij Rempel Date: Sun, 5 May 2013 21:38:23 +0200 Subject: [PATCH 03/57] nuke ath_hal_*xstbcsupport Signed-off-by: Oleksij Rempel --- target_firmware/wlan/ah.c | 6 ------ target_firmware/wlan/ah.h | 2 -- target_firmware/wlan/ah_internal.h | 2 -- target_firmware/wlan/ar5416_hw.c | 26 +------------------------- target_firmware/wlan/if_ath.c | 10 ---------- target_firmware/wlan/if_athvar.h | 6 ------ 6 files changed, 1 insertion(+), 51 deletions(-) diff --git a/target_firmware/wlan/ah.c b/target_firmware/wlan/ah.c index ada5ab2..30c9594 100755 --- a/target_firmware/wlan/ah.c +++ b/target_firmware/wlan/ah.c @@ -67,12 +67,6 @@ ath_hal_getcapability(struct ath_hal *ah, HAL_CAPABILITY_TYPE type, return pCap->halBssIdMaskSupport ? HAL_OK : HAL_ENOTSUPP; case HAL_CAP_VEOL: return pCap->halVEOLSupport ? HAL_OK : HAL_ENOTSUPP; -#ifdef MAGPIE_MERLIN - case HAL_CAP_RX_STBC: - return HAL_ENOTSUPP; - case HAL_CAP_TX_STBC: - return HAL_ENOTSUPP; -#endif default: return HAL_EINVAL; } diff --git a/target_firmware/wlan/ah.h b/target_firmware/wlan/ah.h index 385d1fd..4901097 100755 --- a/target_firmware/wlan/ah.h +++ b/target_firmware/wlan/ah.h @@ -75,8 +75,6 @@ typedef enum { HAL_CAP_VEOL = 0, HAL_CAP_BSSIDMASK = 1, HAL_CAP_TSF_ADJUST = 2, - HAL_CAP_RX_STBC = 3, - HAL_CAP_TX_STBC = 4, HAL_CAP_HT = 5, HAL_CAP_RTS_AGGR_LIMIT = 6, } HAL_CAPABILITY_TYPE; diff --git a/target_firmware/wlan/ah_internal.h b/target_firmware/wlan/ah_internal.h index a43c8eb..6506049 100755 --- a/target_firmware/wlan/ah_internal.h +++ b/target_firmware/wlan/ah_internal.h @@ -126,8 +126,6 @@ typedef struct { halChanHalfRate : 1, halChanQuarterRate : 1, halHTSupport : 1, - halRxStbcSupport : 1, - halTxStbcSupport : 1, halGTTSupport : 1, halFastCCSupport : 1, halExtChanDfsSupport : 1, diff --git a/target_firmware/wlan/ar5416_hw.c b/target_firmware/wlan/ar5416_hw.c index 8da2ee6..5d9b3f3 100644 --- a/target_firmware/wlan/ar5416_hw.c +++ b/target_firmware/wlan/ar5416_hw.c @@ -298,31 +298,7 @@ HAL_STATUS ar5416GetCapability(struct ath_hal *ah, HAL_CAPABILITY_TYPE type, a_uint32_t capability, a_uint32_t *result) { - HAL_CAPABILITIES *pCap = &AH_PRIVATE(ah)->ah_caps; -#ifndef MAGPIE_MERLIN // K2 - pCap->halRxStbcSupport = 1; /* K2 supports STBC Rx only */ - pCap->halTxStbcSupport = 0; -#else - pCap->halRxStbcSupport = 1; /* number of streams for STBC recieve. */ - pCap->halTxStbcSupport = 1; -#endif - - switch (type) { -#ifdef MAGPIE_MERLIN - case HAL_CAP_RX_STBC: - { - *result = pCap->halRxStbcSupport; - return HAL_OK; - } - case HAL_CAP_TX_STBC: - { - *result = pCap->halTxStbcSupport; - return HAL_OK; - } -#endif - default: - return ath_hal_getcapability(ah, type, capability, result); - } + return ath_hal_getcapability(ah, type, capability, result); } /****************/ diff --git a/target_firmware/wlan/if_ath.c b/target_firmware/wlan/if_ath.c index b8874bf..4c9e98b 100755 --- a/target_firmware/wlan/if_ath.c +++ b/target_firmware/wlan/if_ath.c @@ -1146,16 +1146,6 @@ static void ath_init_tgt(void *Context, A_UINT16 Command, if (ath_hal_htsupported(ah)) sc->sc_imask |= HAL_INT_CST; -#ifdef MAGPIE_MERLIN - { - a_uint32_t stbcsupport; - if (ath_hal_txstbcsupport(ah, &stbcsupport)) - sc->sc_txstbcsupport = stbcsupport; - - if (ath_hal_rxstbcsupport(ah, &stbcsupport)) - sc->sc_rxstbcsupport = stbcsupport; - } -#endif adf_os_setup_intr(sc->sc_dev, ath_intr); ath_hal_intrset(ah, sc->sc_imask); diff --git a/target_firmware/wlan/if_athvar.h b/target_firmware/wlan/if_athvar.h index f2412c0..c3a6fbe 100755 --- a/target_firmware/wlan/if_athvar.h +++ b/target_firmware/wlan/if_athvar.h @@ -366,8 +366,6 @@ struct ath_softc_tgt struct ath_ratectrl *sc_rc; a_uint32_t sc_invalid : 1, - sc_txstbcsupport : 1, - sc_rxstbcsupport : 2, sc_tx_draining : 1, sc_enable_coex : 1; @@ -547,10 +545,6 @@ a_uint8_t ath_get_minrateidx(struct ath_softc_tgt *sc, struct ath_vap_target *av ((*(_ah)->ah_stopPcuReceive)((_ah))) #define ath_hal_htsupported(_ah) \ (ath_hal_getcapability(_ah, HAL_CAP_HT, 0, NULL) == HAL_OK) -#define ath_hal_rxstbcsupport(_ah, _rxstbc) \ - (ath_hal_getcapability(_ah, HAL_CAP_RX_STBC, 0, _rxstbc) == HAL_OK) -#define ath_hal_txstbcsupport(_ah, _txstbc) \ - (ath_hal_getcapability(_ah, HAL_CAP_TX_STBC, 0, _txstbc) == HAL_OK) #define ath_hal_getrtsaggrlimit(_ah, _pv) \ (ath_hal_getcapability(_ah, HAL_CAP_RTS_AGGR_LIMIT, 0, _pv) == HAL_OK) #define ath_hal_puttxbuf(_ah, _q, _bufaddr) \ From 4d3dd4df19e1865d56e555cdb5e53dd4643ee761 Mon Sep 17 00:00:00 2001 From: Oleksij Rempel Date: Sat, 11 May 2013 00:49:41 +0200 Subject: [PATCH 04/57] remove ar5416phy.h, we do not use it Signed-off-by: Oleksij Rempel --- target_firmware/wlan/ar5416_hw.c | 1 - target_firmware/wlan/ar5416phy.h | 460 ------------------------------- 2 files changed, 461 deletions(-) delete mode 100755 target_firmware/wlan/ar5416phy.h diff --git a/target_firmware/wlan/ar5416_hw.c b/target_firmware/wlan/ar5416_hw.c index 5d9b3f3..1261565 100644 --- a/target_firmware/wlan/ar5416_hw.c +++ b/target_firmware/wlan/ar5416_hw.c @@ -38,7 +38,6 @@ #include "ah_internal.h" #include "ar5416.h" #include "ar5416reg.h" -#include "ar5416phy.h" #include "ar5416desc.h" #define N(a) (sizeof(a)/sizeof(a[0])) diff --git a/target_firmware/wlan/ar5416phy.h b/target_firmware/wlan/ar5416phy.h deleted file mode 100755 index 9733f58..0000000 --- a/target_firmware/wlan/ar5416phy.h +++ /dev/null @@ -1,460 +0,0 @@ -/* - * Copyright (c) 2013 Qualcomm Atheros, Inc. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted (subject to the limitations in the - * disclaimer below) provided that the following conditions are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the - * distribution. - * - * * Neither the name of Qualcomm Atheros nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE - * GRANTED BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT - * HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR - * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE - * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN - * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -/* - * Copyright (c) 2002-2005 Sam Leffler, Errno Consulting - * Copyright (c) 2002-2005 Atheros Communications, Inc. - * All rights reserved. - * - * $Id: //depot/sw/branches/fusion_usb/target_firmware/wlan/target/hal/main/ar5416/ar5416phy.h#1 $ - */ -#ifndef _DEV_ATH_AR5416PHY_H_ -#define _DEV_ATH_AR5416PHY_H_ - -/* PHY registers */ -#define AR_PHY_BASE 0x9800 /* base address of phy regs */ -#define AR_PHY(_n) (AR_PHY_BASE + ((_n)<<2)) - -#define AR_PHY_TEST 0x9800 /* PHY test control */ -#define PHY_AGC_CLR 0x10000000 /* disable AGC to A2 */ -#define RFSILENT_BB 0x00002000 /* shush bb */ - -/* TX99_11N_CHANGE begin */ -#define AR_PHY_TESTCTRL 0x9808 /* PHY Test Control/Status */ -#define AR_PHY_TESTCTRL_TXHOLD 0x3800 /* Select Tx hold */ -#define AR_PHY_TESTCTRL_TXSRC_ALT 0x00000080 /* Select input to tsdac along with bit 1 */ -#define AR_PHY_TESTCTRL_TXSRC_ALT_S 7 -#define AR_PHY_TESTCTRL_TXSRC_SRC 0x00000002 /* Used with bit 7 */ -#define AR_PHY_TESTCTRL_TXSRC_SRC_S 1 -/* TX99_11N_CHANGE end */ - - -#define AR_PHY_TURBO 0x9804 /* frame control register */ -#define AR_PHY_FC_TURBO_MODE 0x00000001 /* Set turbo mode bits */ -#define AR_PHY_FC_TURBO_SHORT 0x00000002 /* Set short symbols to turbo mode setting */ -#define AR_PHY_FC_DYN2040_EN 0x00000004 /* Enable dyn 20/40 mode */ -#define AR_PHY_FC_DYN2040_PRI_ONLY 0x00000008 /* dyn 20/40 - primary only */ -#define AR_PHY_FC_DYN2040_PRI_CH 0x00000010 /* dyn 20/40 - primary ch offset (0=+10MHz, 1=-10MHz)*/ -#define AR_PHY_FC_DYN2040_EXT_CH 0x00000020 /* dyn 20/40 - ext ch spacing (0=20MHz/ 1=25MHz) */ -#define AR_PHY_FC_HT_EN 0x00000040 /* ht enable */ -#define AR_PHY_FC_SHORT_GI_40 0x00000080 /* allow short GI for HT 40 */ -#define AR_PHY_FC_WALSH 0x00000100 /* walsh spatial spreading for 2 chains,2 streams TX */ -#define AR_PHY_FC_SINGLE_HT_LTF1 0x00000200 /* single length (4us) 1st HT long training symbol */ - -#define AR_PHY_TIMING2 0x9810 /* Timing Control 2 */ -#define AR_PHY_TIMING2_USE_FORCE 0x00001000 -#define AR_PHY_TIMING2_FORCE_VAL 0x00000fff - -#define AR_PHY_TIMING3 0x9814 /* Timing control 3 */ -#define AR_PHY_TIMING3_DSC_MAN 0xFFFE0000 -#define AR_PHY_TIMING3_DSC_MAN_S 17 -#define AR_PHY_TIMING3_DSC_EXP 0x0001E000 -#define AR_PHY_TIMING3_DSC_EXP_S 13 - -#define AR_PHY_CHIP_ID 0x9818 /* PHY chip revision ID */ -#define AR_PHY_CHIP_ID_REV_0 0x80 /* 5416 Rev 0 (owl 1.0) BB */ -#define AR_PHY_CHIP_ID_REV_1 0x81 /* 5416 Rev 1 (owl 2.0) BB */ -#define AR_PHY_CHIP_ID_SOWL_REV_0 0xb0 /* 9160 Rev 0 (sowl 1.0) BB */ - -#define AR_PHY_ACTIVE 0x981C /* activation register */ -#define AR_PHY_ACTIVE_EN 0x00000001 /* Activate PHY chips */ -#define AR_PHY_ACTIVE_DIS 0x00000000 /* Deactivate PHY chips */ - -#define AR_PHY_RF_CTL2 0x9824 -#define AR_PHY_TX_END_DATA_START 0x000000FF -#define AR_PHY_TX_END_DATA_START_S 0 -#define AR_PHY_TX_END_PA_ON 0x0000FF00 -#define AR_PHY_TX_END_PA_ON_S 8 - - -#define AR_PHY_RF_CTL3 0x9828 -#define AR_PHY_TX_END_TO_A2_RX_ON 0x00FF0000 -#define AR_PHY_TX_END_TO_A2_RX_ON_S 16 - -#define AR_PHY_ADC_CTL 0x982C -#define AR_PHY_ADC_CTL_OFF_INBUFGAIN 0x00000003 -#define AR_PHY_ADC_CTL_OFF_INBUFGAIN_S 0 -#define AR_PHY_ADC_CTL_OFF_PWDDAC 0x00002000 -#define AR_PHY_ADC_CTL_OFF_PWDBANDGAP 0x00004000 /* BB Rev 4.2+ only */ -#define AR_PHY_ADC_CTL_OFF_PWDADC 0x00008000 /* BB Rev 4.2+ only */ -#define AR_PHY_ADC_CTL_ON_INBUFGAIN 0x00030000 -#define AR_PHY_ADC_CTL_ON_INBUFGAIN_S 16 - -#define AR_PHY_ADC_SERIAL_CTL 0x9830 -#define AR_PHY_SEL_INTERNAL_ADDAC 0x00000000 -#define AR_PHY_SEL_EXTERNAL_RADIO 0x00000001 - -#define AR_PHY_RF_CTL4 0x9834 -#define AR_PHY_RF_CTL4_TX_END_XPAB_OFF 0xFF000000 -#define AR_PHY_RF_CTL4_TX_END_XPAB_OFF_S 24 -#define AR_PHY_RF_CTL4_TX_END_XPAA_OFF 0x00FF0000 -#define AR_PHY_RF_CTL4_TX_END_XPAA_OFF_S 16 -#define AR_PHY_RF_CTL4_FRAME_XPAB_ON 0x0000FF00 -#define AR_PHY_RF_CTL4_FRAME_XPAB_ON_S 8 -#define AR_PHY_RF_CTL4_FRAME_XPAA_ON 0x000000FF -#define AR_PHY_RF_CTL4_FRAME_XPAA_ON_S 0 - -/* TX99_11N_CHANGE begin */ -#define AR_PHY_BB_XP_PA_CTL 0x9838 -#define AR_PHY_BB_XPAA_ACTIVE_HIGH 0x00000001 -#define AR_PHY_BB_XPAB_ACTIVE_HIGH 0x00000002 -#define AR_PHY_BB_XPAB_ACTIVE_HIGH_S 1 - -#define AR_PHY_TSTDAC_CONST 0x983C -#define AR_PHY_TSTDAC_CONST_Q 0x0003FE00 -#define AR_PHY_TSTDAC_CONST_Q_S 9 -#define AR_PHY_TSTDAC_CONST_I 0x000001FF -/* TX99_11N_CHANGE end */ - -#define AR_PHY_SETTLING 0x9844 -#define AR_PHY_SETTLING_SWITCH 0x00003F80 -#define AR_PHY_SETTLING_SWITCH_S 7 - -#define AR_PHY_RXGAIN 0x9848 -#define AR_PHY_RXGAIN_TXRX_ATTEN 0x0003F000 -#define AR_PHY_RXGAIN_TXRX_ATTEN_S 12 -#define AR_PHY_RXGAIN_TXRX_RF_MAX 0x007C0000 -#define AR_PHY_RXGAIN_TXRX_RF_MAX_S 18 - -#define AR_PHY_DESIRED_SZ 0x9850 -#define AR_PHY_DESIRED_SZ_ADC 0x000000FF -#define AR_PHY_DESIRED_SZ_ADC_S 0 -#define AR_PHY_DESIRED_SZ_PGA 0x0000FF00 -#define AR_PHY_DESIRED_SZ_PGA_S 8 -#define AR_PHY_DESIRED_SZ_TOT_DES 0x0FF00000 -#define AR_PHY_DESIRED_SZ_TOT_DES_S 20 - -#define AR_PHY_FIND_SIG 0x9858 -#define AR_PHY_FIND_SIG_FIRSTEP 0x0003F000 -#define AR_PHY_FIND_SIG_FIRSTEP_S 12 -#define AR_PHY_FIND_SIG_FIRPWR 0x03FC0000 -#define AR_PHY_FIND_SIG_FIRPWR_S 18 - -#define AR_PHY_AGC_CTL1 0x985C -#define AR_PHY_AGC_CTL1_COARSE_LOW 0x00007F80 -#define AR_PHY_AGC_CTL1_COARSE_LOW_S 7 -#define AR_PHY_AGC_CTL1_COARSE_HIGH 0x003F8000 -#define AR_PHY_AGC_CTL1_COARSE_HIGH_S 15 - -#define AR_PHY_AGC_CONTROL 0x9860 /* chip calibration and noise floor setting */ -#define AR_PHY_AGC_CONTROL_CAL 0x00000001 /* do internal calibration */ -#define AR_PHY_AGC_CONTROL_NF 0x00000002 /* do noise-floor calculation */ - -#define AR_PHY_CCA 0x9864 -#define AR_PHY_MINCCA_PWR 0x0FF80000 -#define AR_PHY_MINCCA_PWR_S 19 -#define AR_PHY_CCA_THRESH62 0x0007F000 -#define AR_PHY_CCA_THRESH62_S 12 - -#define AR_PHY_SFCORR_LOW 0x986C -#define AR_PHY_SFCORR_LOW_USE_SELF_CORR_LOW 0x00000001 -#define AR_PHY_SFCORR_LOW_M2COUNT_THR_LOW 0x00003F00 -#define AR_PHY_SFCORR_LOW_M2COUNT_THR_LOW_S 8 -#define AR_PHY_SFCORR_LOW_M1_THRESH_LOW 0x001FC000 -#define AR_PHY_SFCORR_LOW_M1_THRESH_LOW_S 14 -#define AR_PHY_SFCORR_LOW_M2_THRESH_LOW 0x0FE00000 -#define AR_PHY_SFCORR_LOW_M2_THRESH_LOW_S 21 - -#define AR_PHY_SFCORR 0x9868 -#define AR_PHY_SFCORR_M2COUNT_THR 0x0000001F -#define AR_PHY_SFCORR_M2COUNT_THR_S 0 -#define AR_PHY_SFCORR_M1_THRESH 0x00FE0000 -#define AR_PHY_SFCORR_M1_THRESH_S 17 -#define AR_PHY_SFCORR_M2_THRESH 0x7F000000 -#define AR_PHY_SFCORR_M2_THRESH_S 24 - -#define AR_PHY_SLEEP_CTR_CONTROL 0x9870 -#define AR_PHY_SLEEP_CTR_LIMIT 0x9874 -#define AR_PHY_SLEEP_SCAL 0x9878 - -#define AR_PHY_PLL_CTL 0x987c /* PLL control register */ -#define AR_PHY_PLL_CTL_40 0xaa /* 40 MHz */ -#define AR_PHY_PLL_CTL_40_5413 0x04 -#define AR_PHY_PLL_CTL_44 0xab /* 44 MHz for 11b, 11g */ -#define AR_PHY_PLL_CTL_44_2133 0xeb /* 44 MHz for 11b, 11g */ -#define AR_PHY_PLL_CTL_40_2133 0xea /* 40 MHz for 11a, turbos */ - -#define AR_PHY_RX_DELAY 0x9914 /* analog pow-on time (100ns) */ -#define AR_PHY_RX_DELAY_DELAY 0x00003FFF /* delay from wakeup to rx ena */ - -#define AR_PHY_TIMING_CTRL4(_i) (0x9920 + ((_i) << 12)) /* timing control */ -#define AR_PHY_TIMING_CTRL4_IQCORR_Q_Q_COFF 0x01F /* Mask for kcos_theta-1 for q correction */ -#define AR_PHY_TIMING_CTRL4_IQCORR_Q_Q_COFF_S 0 /* shift for Q_COFF */ -#define AR_PHY_TIMING_CTRL4_IQCORR_Q_I_COFF 0x7E0 /* Mask for sin_theta for i correction */ -#define AR_PHY_TIMING_CTRL4_IQCORR_Q_I_COFF_S 5 /* Shift for sin_theta for i correction */ -#define AR_PHY_TIMING_CTRL4_IQCORR_ENABLE 0x800 /* enable IQ correction */ -#define AR_PHY_TIMING_CTRL4_IQCAL_LOG_COUNT_MAX 0xF000 /* Mask for max number of samples (logarithmic) */ -#define AR_PHY_TIMING_CTRL4_IQCAL_LOG_COUNT_MAX_S 12 /* Shift for max number of samples */ -#define AR_PHY_TIMING_CTRL4_DO_IQCAL 0x10000 /* perform IQ calibration */ - -#define AR_PHY_TIMING5 0x9924 -#define AR_PHY_TIMING5_CYCPWR_THR1 0x000000FE -#define AR_PHY_TIMING5_CYCPWR_THR1_S 1 - -#define AR_PHY_POWER_TX_RATE1 0x9934 -#define AR_PHY_POWER_TX_RATE2 0x9938 -#define AR_PHY_POWER_TX_RATE_MAX 0x993c -#define AR_PHY_POWER_TX_RATE_MAX_TPC_ENABLE 0x00000040 - -#define AR_PHY_FRAME_CTL 0x9944 -#define AR_PHY_FRAME_CTL_TX_CLIP 0x00000038 -#define AR_PHY_FRAME_CTL_TX_CLIP_S 3 - -#define AR_PHY_TXPWRADJ 0x994C /* BB Rev 4.2+ only */ -#define AR_PHY_TXPWRADJ_CCK_GAIN_DELTA 0x00000FC0 -#define AR_PHY_TXPWRADJ_CCK_GAIN_DELTA_S 6 -#define AR_PHY_TXPWRADJ_CCK_PCDAC_INDEX 0x00FC0000 -#define AR_PHY_TXPWRADJ_CCK_PCDAC_INDEX_S 18 - -#define AR_PHY_RADAR_0 0x9954 /* radar detection settings */ -#define AR_PHY_RADAR_0_ENA 0x00000001 /* Enable radar detection */ -#define AR_PHY_RADAR_0_INBAND 0x0000003e /* Inband pulse threshold */ -#define AR_PHY_RADAR_0_INBAND_S 1 -#define AR_PHY_RADAR_0_PRSSI 0x00000FC0 /* Pulse rssi threshold */ -#define AR_PHY_RADAR_0_PRSSI_S 6 -#define AR_PHY_RADAR_0_HEIGHT 0x0003F000 /* Pulse height threshold */ -#define AR_PHY_RADAR_0_HEIGHT_S 12 -#define AR_PHY_RADAR_0_RRSSI 0x00FC0000 /* Radar rssi threshold */ -#define AR_PHY_RADAR_0_RRSSI_S 18 -#define AR_PHY_RADAR_0_FIRPWR 0x7F000000 /* Radar firpwr threshold */ -#define AR_PHY_RADAR_0_FIRPWR_S 24 - -#define AR_PHY_RADAR_1 0x9958 /* AR5413+ radar settigns */ -#define AR_PHY_RADAR_1_RELPWR_ENA 0x00800000 /* enable to check radar relative power */ -#define AR_PHY_RADAR_1_USE_FIR128 0x00400000 /* enable to use the average inband power - * measured over 128 cycles - */ -#define AR_PHY_RADAR_1_RELPWR_THRESH 0x003F0000 /* relative pwr thresh */ -#define AR_PHY_RADAR_1_RELPWR_THRESH_S 16 -#define AR_PHY_RADAR_1_BLOCK_CHECK 0x00008000 /* Enable to block radar check if weak - * OFDM sig or pkt is immediately after - * tx to rx transition - */ -#define AR_PHY_RADAR_1_MAX_RRSSI 0x00004000 /* Enable to use max rssi */ -#define AR_PHY_RADAR_1_RELSTEP_CHECK 0x00002000 /* Enable to use pulse relative step check */ -#define AR_PHY_RADAR_1_RELSTEP_THRESH 0x00001F00 /* Pulse relative step threshold */ -#define AR_PHY_RADAR_1_RELSTEP_THRESH_S 8 -#define AR_PHY_RADAR_1_MAXLEN 0x000000FF /* Max length of radar pulse */ -#define AR_PHY_RADAR_1_MAXLEN_S 0 - -#define AR_PHY_SWITCH_CHAIN_0 0x9960 -#define AR_PHY_SWITCH_COM 0x9964 - -#define AR_PHY_SIGMA_DELTA 0x996C /* AR5312 only */ -#define AR_PHY_SIGMA_DELTA_ADC_SEL 0x00000003 -#define AR_PHY_SIGMA_DELTA_ADC_SEL_S 0 -#define AR_PHY_SIGMA_DELTA_FILT2 0x000000F8 -#define AR_PHY_SIGMA_DELTA_FILT2_S 3 -#define AR_PHY_SIGMA_DELTA_FILT1 0x00001F00 -#define AR_PHY_SIGMA_DELTA_FILT1_S 8 -#define AR_PHY_SIGMA_DELTA_ADC_CLIP 0x01FFE000 -#define AR_PHY_SIGMA_DELTA_ADC_CLIP_S 13 - -#define AR_PHY_RESTART 0x9970 /* restart */ -#define AR_PHY_RESTART_DIV_GC 0x001C0000 /* bb_ant_fast_div_gc_limit */ -#define AR_PHY_RESTART_DIV_GC_S 18 - -#define AR_PHY_RFBUS_REQ 0x997C -#define AR_PHY_RFBUS_REQ_EN 0x00000001 - -#define AR_PHY_RX_CHAINMASK 0x99a4 - -#define AR_PHY_EXT_CCA 0x99bc -#define AR_PHY_EXT_CCA_THRESH62 0x007F0000 // [22:16] not replicated -#define AR_PHY_EXT_CCA_THRESH62_S 16 -#define AR_PHY_EXT_MINCCA_PWR 0xFF800000 -#define AR_PHY_EXT_MINCCA_PWR_S 23 - -#define AR_PHY_HALFGI 0x99D0 /* Timing control 3 */ -#define AR_PHY_HALFGI_DSC_MAN 0x0007FFF0 -#define AR_PHY_HALFGI_DSC_MAN_S 4 -#define AR_PHY_HALFGI_DSC_EXP 0x0000000F -#define AR_PHY_HALFGI_DSC_EXP_S 0 - -#define AR_PHY_HEAVY_CLIP_ENABLE 0x99E0 - -#define AR_PHY_M_SLEEP 0x99f0 /* sleep control registers */ -#define AR_PHY_REFCLKDLY 0x99f4 -#define AR_PHY_REFCLKPD 0x99f8 - -#define AR_PHY_CALMODE 0x99f0 -/* PHY IQ calibration results */ -#define AR_PHY_IQCAL_RES_PWR_MEAS_I(_i) (0x9c10 + ((_i) << 12)) /* power measurement for I */ -#define AR_PHY_IQCAL_RES_PWR_MEAS_Q(_i) (0x9c14 + ((_i) << 12)) /* power measurement for Q */ -#define AR_PHY_IQCAL_RES_IQ_CORR_MEAS(_i) (0x9c18 + ((_i) << 12)) /* IQ correlation measurement */ - -#define AR_PHY_CURRENT_RSSI 0x9c1c /* rssi of current frame rx'd */ - -#define AR_PHY_RFBUS_GRANT 0x9C20 -#define AR_PHY_RFBUS_GRANT_EN 0x00000001 - -#define AR_PHY_MODE 0xA200 /* Mode register */ -#define AR_PHY_MODE_AR2133 0x08 /* AR2133 */ -#define AR_PHY_MODE_AR5111 0x00 /* AR5111/AR2111 */ -#define AR_PHY_MODE_AR5112 0x08 /* AR5112*/ -#define AR_PHY_MODE_DYNAMIC 0x04 /* dynamic CCK/OFDM mode */ -#define AR_PHY_MODE_RF2GHZ 0x02 /* 2.4 GHz */ -#define AR_PHY_MODE_RF5GHZ 0x00 /* 5 GHz */ -#define AR_PHY_MODE_CCK 0x01 /* CCK */ -#define AR_PHY_MODE_OFDM 0x00 /* OFDM */ - -#define AR_PHY_CCK_TX_CTRL 0xA204 -#define AR_PHY_CCK_TX_CTRL_JAPAN 0x00000010 - -#define AR_PHY_CCK_DETECT 0xA208 -#define AR_PHY_CCK_DETECT_WEAK_SIG_THR_CCK 0x0000003F -#define AR_PHY_CCK_DETECT_WEAK_SIG_THR_CCK_S 0 -#define AR_PHY_CCK_DETECT_ANT_SWITCH_TIME 0x00001FC0 // [12:6] settling time for antenna switch -#define AR_PHY_CCK_DETECT_ANT_SWITCH_TIME_S 6 -#define AR_PHY_CCK_DETECT_BB_ENABLE_ANT_FAST_DIV 0x2000 - -#define AR_PHY_GAIN_2GHZ 0xA20C -#define AR_PHY_GAIN_2GHZ_RXTX_MARGIN 0x00FC0000 -#define AR_PHY_GAIN_2GHZ_RXTX_MARGIN_S 18 -#define AR_PHY_GAIN_2GHZ_BSW_MARGIN 0x00003C00 -#define AR_PHY_GAIN_2GHZ_BSW_MARGIN_S 10 -#define AR_PHY_GAIN_2GHZ_BSW_ATTEN 0x0000001F -#define AR_PHY_GAIN_2GHZ_BSW_ATTEN_S 0 - -#define AR_PHY_CCK_RXCTRL4 0xA21C -#define AR_PHY_CCK_RXCTRL4_FREQ_EST_SHORT 0x01F80000 -#define AR_PHY_CCK_RXCTRL4_FREQ_EST_SHORT_S 19 - -#define AR_PHY_DAG_CTRLCCK 0xA228 -#define AR_PHY_DAG_CTRLCCK_EN_RSSI_THR 0x00000200 /* BB Rev 4.2+ only */ -#define AR_PHY_DAG_CTRLCCK_RSSI_THR 0x0001FC00 /* BB Rev 4.2+ only */ -#define AR_PHY_DAG_CTRLCCK_RSSI_THR_S 10 /* BB Rev 4.2+ only */ - -#define AR_PHY_POWER_TX_RATE3 0xA234 -#define AR_PHY_POWER_TX_RATE4 0xA238 - -#define AR_PHY_SCRM_SEQ_XR 0xA23C -#define AR_PHY_HEADER_DETECT_XR 0xA240 -#define AR_PHY_CHIRP_DETECTED_XR 0xA244 -#define AR_PHY_BLUETOOTH 0xA254 - -#define AR_PHY_TPCRG1 0xA258 /* ar2413 power control */ -#define AR_PHY_TPCRG1_NUM_PD_GAIN 0x0000c000 -#define AR_PHY_TPCRG1_NUM_PD_GAIN_S 14 - -#define AR_PHY_TPCRG1_PD_GAIN_1 0x00030000 -#define AR_PHY_TPCRG1_PD_GAIN_1_S 16 -#define AR_PHY_TPCRG1_PD_GAIN_2 0x000C0000 -#define AR_PHY_TPCRG1_PD_GAIN_2_S 18 -#define AR_PHY_TPCRG1_PD_GAIN_3 0x00300000 -#define AR_PHY_TPCRG1_PD_GAIN_3_S 20 -// - -#define AR_PHY_ANALOG_SWAP 0xa268 -#define AR_PHY_SWAP_ALT_CHAIN 0x00000040 - -#define AR_PHY_TPCRG5 0xA26C /* ar2413 power control */ -#define AR_PHY_TPCRG5_PD_GAIN_OVERLAP 0x0000000F -#define AR_PHY_TPCRG5_PD_GAIN_OVERLAP_S 0 -#define AR_PHY_TPCRG5_PD_GAIN_BOUNDARY_1 0x000003F0 -#define AR_PHY_TPCRG5_PD_GAIN_BOUNDARY_1_S 4 -#define AR_PHY_TPCRG5_PD_GAIN_BOUNDARY_2 0x0000FC00 -#define AR_PHY_TPCRG5_PD_GAIN_BOUNDARY_2_S 10 -#define AR_PHY_TPCRG5_PD_GAIN_BOUNDARY_3 0x003F0000 -#define AR_PHY_TPCRG5_PD_GAIN_BOUNDARY_3_S 16 -#define AR_PHY_TPCRG5_PD_GAIN_BOUNDARY_4 0x0FC00000 -#define AR_PHY_TPCRG5_PD_GAIN_BOUNDARY_4_S 22 - -#define AR_PHY_POWER_TX_RATE5 0xA38C -#define AR_PHY_POWER_TX_RATE6 0xA390 - -#define AR_PHY_CAL_CHAINMASK 0xA39C - -#define AR_PHY_POWER_TX_SUB 0xA3C8 -#define AR_PHY_POWER_TX_RATE7 0xA3CC -#define AR_PHY_POWER_TX_RATE8 0xA3D0 -#define AR_PHY_POWER_TX_RATE9 0xA3D4 - -#define AR_PHY_CH1_CCA 0xa864 -#define AR_PHY_CH1_MINCCA_PWR 0x0FF80000 -#define AR_PHY_CH1_MINCCA_PWR_S 19 - -#define AR_PHY_CH2_CCA 0xb864 -#define AR_PHY_CH2_MINCCA_PWR 0x0FF80000 -#define AR_PHY_CH2_MINCCA_PWR_S 19 - -#define AR_PHY_CH1_EXT_CCA 0xa9bc -#define AR_PHY_CH1_EXT_MINCCA_PWR 0xFF800000 -#define AR_PHY_CH1_EXT_MINCCA_PWR_S 23 - -#define AR_PHY_CH2_EXT_CCA 0xb9bc -#define AR_PHY_CH2_EXT_MINCCA_PWR 0xFF800000 -#define AR_PHY_CH2_EXT_MINCCA_PWR_S 23 - - -#ifdef MAGPIE_MERLIN - -#define AR9280_PHY_RXGAIN_TXRX_ATTEN 0x00003F80 -#define AR9280_PHY_RXGAIN_TXRX_ATTEN_S 7 -#define AR9280_PHY_RXGAIN_TXRX_MARGIN 0x001FC000 -#define AR9280_PHY_RXGAIN_TXRX_MARGIN_S 14 - -#define AR_PHY_AGC_CONTROL_ENABLE_NF 0x00008000 /* Enable noise floor calibration to happen */ -#define AR_PHY_AGC_CONTROL_NO_UPDATE_NF 0x00020000 /* Don't update noise floor automatically */ - -#define AR9280_PHY_MINCCA_PWR 0x1FF00000 -#define AR9280_PHY_MINCCA_PWR_S 20 -#define AR9280_PHY_CCA_THRESH62 0x000FF000 -#define AR9280_PHY_CCA_THRESH62_S 12 - -#define AR_PHY_CCA_MAX_GOOD_VALUE -85 -#define AR_PHY_CCA_MAX_HIGH_VALUE -62 -#define AR_PHY_CCA_MIN_BAD_VALUE -121 - -#define AR_PHY_SYNTH_CONTROL 0x9874 -#define AR9280_PHY_CURRENT_RSSI 0x9c3c - -#define AR9280_PHY_CURRENT_RSSI 0x9c3c - -#define AR_PHY_XPA_CFG 0xA3D8 -#define AR_PHY_FORCE_XPA_CFG 0x000000001 -#define AR_PHY_FORCE_XPA_CFG_S 0 - -#define AR9280_PHY_CH1_MINCCA_PWR 0x1FF00000 -#define AR9280_PHY_CH1_MINCCA_PWR_S 20 - -#define AR9280_PHY_CH1_EXT_MINCCA_PWR 0x01FF0000 -#define AR9280_PHY_CH1_EXT_MINCCA_PWR_S 16 - -#endif - - - -#endif /* _DEV_ATH_AR5416PHY_H_ */ From edce413c46ed0dfa289bc7438cac2e294b6f0448 Mon Sep 17 00:00:00 2001 From: Oleksij Rempel Date: Sat, 11 May 2013 00:53:50 +0200 Subject: [PATCH 05/57] remove unused wlan/queue.h Signed-off-by: Oleksij Rempel --- target_firmware/wlan/queue.h | 567 ----------------------------------- 1 file changed, 567 deletions(-) delete mode 100755 target_firmware/wlan/queue.h diff --git a/target_firmware/wlan/queue.h b/target_firmware/wlan/queue.h deleted file mode 100755 index 34bf4b7..0000000 --- a/target_firmware/wlan/queue.h +++ /dev/null @@ -1,567 +0,0 @@ -/* - * Copyright (c) 1991, 1993 - * The Regents of the University of California. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 4. Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * @(#)queue.h 8.5 (Berkeley) 8/20/94 - * $FreeBSD: src/sys/sys/queue.h,v 1.58 2004/04/07 04:19:49 imp Exp $ - * $Id: //depot/sw/branches/fusion_usb/target_firmware/wlan/target/madwifi/include/sys/queue.h#1 $ - */ - -#ifndef _SYS_QUEUE_H_ -#define _SYS_QUEUE_H_ - -/* - * This file defines four types of data structures: singly-linked lists, - * singly-linked tail queues, lists and tail queues. - * - * A singly-linked list is headed by a single forward pointer. The elements - * are singly linked for minimum space and pointer manipulation overhead at - * the expense of O(n) removal for arbitrary elements. New elements can be - * added to the list after an existing element or at the head of the list. - * Elements being removed from the head of the list should use the explicit - * macro for this purpose for optimum efficiency. A singly-linked list may - * only be traversed in the forward direction. Singly-linked lists are ideal - * for applications with large datasets and few or no removals or for - * implementing a LIFO queue. - * - * A singly-linked tail queue is headed by a pair of pointers, one to the - * head of the list and the other to the tail of the list. The elements are - * singly linked for minimum space and pointer manipulation overhead at the - * expense of O(n) removal for arbitrary elements. New elements can be added - * to the list after an existing element, at the head of the list, or at the - * end of the list. Elements being removed from the head of the tail queue - * should use the explicit macro for this purpose for optimum efficiency. - * A singly-linked tail queue may only be traversed in the forward direction. - * Singly-linked tail queues are ideal for applications with large datasets - * and few or no removals or for implementing a FIFO queue. - * - * A list is headed by a single forward pointer (or an array of forward - * pointers for a hash table header). The elements are doubly linked - * so that an arbitrary element can be removed without a need to - * traverse the list. New elements can be added to the list before - * or after an existing element or at the head of the list. A list - * may only be traversed in the forward direction. - * - * A tail queue is headed by a pair of pointers, one to the head of the - * list and the other to the tail of the list. The elements are doubly - * linked so that an arbitrary element can be removed without a need to - * traverse the list. New elements can be added to the list before or - * after an existing element, at the head of the list, or at the end of - * the list. A tail queue may be traversed in either direction. - * - * For details on the use of these macros, see the queue(3) manual page. - * - * - * SLIST LIST STAILQ TAILQ - * _HEAD + + + + - * _HEAD_INITIALIZER + + + + - * _ENTRY + + + + - * _INIT + + + + - * _EMPTY + + + + - * _FIRST + + + + - * _NEXT + + + + - * _PREV - - - + - * _LAST - - + + - * _FOREACH + + + + - * _FOREACH_SAFE + + + + - * _FOREACH_REVERSE - - - + - * _FOREACH_REVERSE_SAFE - - - + - * _INSERT_HEAD + + + + - * _INSERT_BEFORE - + - + - * _INSERT_AFTER + + + + - * _INSERT_TAIL - - + + - * _CONCAT - - + + - * _REMOVE_HEAD + - + - - * _REMOVE + + + + - * - */ -#define QUEUE_MACRO_DEBUG 0 -#if QUEUE_MACRO_DEBUG -/* Store the last 2 places the queue element or head was altered */ -struct qm_trace { - char * lastfile; - a_int32_t lastline; - char * prevfile; - a_int32_t prevline; -}; - -#define TRACEBUF struct qm_trace trace; -#define TRASHIT(x) do {(x) = (void *)-1;} while (0) - -#define QMD_TRACE_HEAD(head) do { \ - (head)->trace.prevline = (head)->trace.lastline; \ - (head)->trace.prevfile = (head)->trace.lastfile; \ - (head)->trace.lastline = __LINE__; \ - (head)->trace.lastfile = __FILE__; \ -} while (0) - -#define QMD_TRACE_ELEM(elem) do { \ - (elem)->trace.prevline = (elem)->trace.lastline; \ - (elem)->trace.prevfile = (elem)->trace.lastfile; \ - (elem)->trace.lastline = __LINE__; \ - (elem)->trace.lastfile = __FILE__; \ -} while (0) - -#else -#define QMD_TRACE_ELEM(elem) -#define QMD_TRACE_HEAD(head) -#define TRACEBUF -#define TRASHIT(x) -#endif /* QUEUE_MACRO_DEBUG */ - -/* - * Singly-linked List declarations. - */ -#define SLIST_HEAD(name, type) \ -struct name { \ - struct type *slh_first; /* first element */ \ -} - -#define SLIST_HEAD_INITIALIZER(head) \ - { NULL } - -#define SLIST_ENTRY(type) \ -struct { \ - struct type *sle_next; /* next element */ \ -} - -/* - * Singly-linked List functions. - */ -#define SLIST_EMPTY(head) ((head)->slh_first == NULL) - -#define SLIST_FIRST(head) ((head)->slh_first) - -#define SLIST_FOREACH(var, head, field) \ - for ((var) = SLIST_FIRST((head)); \ - (var); \ - (var) = SLIST_NEXT((var), field)) - -#define SLIST_FOREACH_SAFE(var, head, field, tvar) \ - for ((var) = SLIST_FIRST((head)); \ - (var) && ((tvar) = SLIST_NEXT((var), field), 1); \ - (var) = (tvar)) - -#define SLIST_FOREACH_PREVPTR(var, varp, head, field) \ - for ((varp) = &SLIST_FIRST((head)); \ - ((var) = *(varp)) != NULL; \ - (varp) = &SLIST_NEXT((var), field)) - -#define SLIST_INIT(head) do { \ - SLIST_FIRST((head)) = NULL; \ -} while (0) - -#define SLIST_INSERT_AFTER(slistelm, elm, field) do { \ - SLIST_NEXT((elm), field) = SLIST_NEXT((slistelm), field); \ - SLIST_NEXT((slistelm), field) = (elm); \ -} while (0) - -#define SLIST_INSERT_HEAD(head, elm, field) do { \ - SLIST_NEXT((elm), field) = SLIST_FIRST((head)); \ - SLIST_FIRST((head)) = (elm); \ -} while (0) - -#define SLIST_NEXT(elm, field) ((elm)->field.sle_next) - -#define SLIST_REMOVE(head, elm, type, field) do { \ - if (SLIST_FIRST((head)) == (elm)) { \ - SLIST_REMOVE_HEAD((head), field); \ - } \ - else { \ - struct type *curelm = SLIST_FIRST((head)); \ - while (SLIST_NEXT(curelm, field) != (elm)) \ - curelm = SLIST_NEXT(curelm, field); \ - SLIST_NEXT(curelm, field) = \ - SLIST_NEXT(SLIST_NEXT(curelm, field), field); \ - } \ -} while (0) - -#define SLIST_REMOVE_HEAD(head, field) do { \ - SLIST_FIRST((head)) = SLIST_NEXT(SLIST_FIRST((head)), field); \ -} while (0) - -/* - * Singly-linked Tail queue declarations. - */ -#define STAILQ_HEAD(name, type) \ -struct name { \ - struct type *stqh_first;/* first element */ \ - struct type **stqh_last;/* addr of last next element */ \ -} - -#define STAILQ_HEAD_INITIALIZER(head) \ - { NULL, &(head).stqh_first } - -#define STAILQ_ENTRY(type) \ -struct { \ - struct type *stqe_next; /* next element */ \ -} - -/* - * Singly-linked Tail queue functions. - */ -#define STAILQ_CONCAT(head1, head2) do { \ - if (!STAILQ_EMPTY((head2))) { \ - *(head1)->stqh_last = (head2)->stqh_first; \ - (head1)->stqh_last = (head2)->stqh_last; \ - STAILQ_INIT((head2)); \ - } \ -} while (0) - -#define STAILQ_EMPTY(head) ((head)->stqh_first == NULL) - -#define STAILQ_FIRST(head) ((head)->stqh_first) - -#define STAILQ_FOREACH(var, head, field) \ - for((var) = STAILQ_FIRST((head)); \ - (var); \ - (var) = STAILQ_NEXT((var), field)) - - -#define STAILQ_FOREACH_SAFE(var, head, field, tvar) \ - for ((var) = STAILQ_FIRST((head)); \ - (var) && ((tvar) = STAILQ_NEXT((var), field), 1); \ - (var) = (tvar)) - -#define STAILQ_INIT(head) do { \ - STAILQ_FIRST((head)) = NULL; \ - (head)->stqh_last = &STAILQ_FIRST((head)); \ -} while (0) - -#define STAILQ_INSERT_AFTER(head, tqelm, elm, field) do { \ - if ((STAILQ_NEXT((elm), field) = STAILQ_NEXT((tqelm), field)) == NULL)\ - (head)->stqh_last = &STAILQ_NEXT((elm), field); \ - STAILQ_NEXT((tqelm), field) = (elm); \ -} while (0) - -#define STAILQ_INSERT_HEAD(head, elm, field) do { \ - if ((STAILQ_NEXT((elm), field) = STAILQ_FIRST((head))) == NULL) \ - (head)->stqh_last = &STAILQ_NEXT((elm), field); \ - STAILQ_FIRST((head)) = (elm); \ -} while (0) - -#define STAILQ_INSERT_TAIL(head, elm, field) do { \ - STAILQ_NEXT((elm), field) = NULL; \ - *(head)->stqh_last = (elm); \ - (head)->stqh_last = &STAILQ_NEXT((elm), field); \ -} while (0) - -#define STAILQ_LAST(head, type, field) \ - (STAILQ_EMPTY((head)) ? \ - NULL : \ - ((struct type *) \ - ((char *)((head)->stqh_last) - asf_offsetof(struct type, field)))) - -#define STAILQ_NEXT(elm, field) ((elm)->field.stqe_next) - -#define STAILQ_REMOVE(head, elm, type, field) do { \ - if (STAILQ_FIRST((head)) == (elm)) { \ - STAILQ_REMOVE_HEAD((head), field); \ - } \ - else { \ - struct type *curelm = STAILQ_FIRST((head)); \ - while (STAILQ_NEXT(curelm, field) != (elm)) \ - curelm = STAILQ_NEXT(curelm, field); \ - if ((STAILQ_NEXT(curelm, field) = \ - STAILQ_NEXT(STAILQ_NEXT(curelm, field), field)) == NULL)\ - (head)->stqh_last = &STAILQ_NEXT((curelm), field);\ - } \ -} while (0) - - -#define STAILQ_REMOVE_AFTER(head, elm, field) do { \ - if (STAILQ_NEXT(elm, field)) { \ - if ((STAILQ_NEXT(elm, field) = \ - STAILQ_NEXT(STAILQ_NEXT(elm, field), field)) == NULL)\ - (head)->stqh_last = &STAILQ_NEXT((elm), field); \ - } \ -} while (0) - - -#define STAILQ_REMOVE_HEAD(head, field) do { \ - if ((STAILQ_FIRST((head)) = \ - STAILQ_NEXT(STAILQ_FIRST((head)), field)) == NULL) \ - (head)->stqh_last = &STAILQ_FIRST((head)); \ -} while (0) - -#define STAILQ_REMOVE_HEAD_UNTIL(head, elm, field) do { \ - if ((STAILQ_FIRST((head)) = STAILQ_NEXT((elm), field)) == NULL) \ - (head)->stqh_last = &STAILQ_FIRST((head)); \ -} while (0) - -/* - * List declarations. - */ -#define LIST_HEAD(name, type) \ -struct name { \ - struct type *lh_first; /* first element */ \ -} - -#define ATH_LIST_HEAD(name, type) \ -struct name { \ - struct type *lh_first; /* first element */ \ -} - -#define LIST_HEAD_INITIALIZER(head) \ - { NULL } - -#define LIST_ENTRY(type) \ -struct { \ - struct type *le_next; /* next element */ \ - struct type **le_prev; /* address of previous next element */ \ -} - -/* - * List functions. - */ - -#define LIST_EMPTY(head) ((head)->lh_first == NULL) - -#define LIST_FIRST(head) ((head)->lh_first) - -#define LIST_FOREACH(var, head, field) \ - for ((var) = LIST_FIRST((head)); \ - (var); \ - (var) = LIST_NEXT((var), field)) - -#define LIST_FOREACH_SAFE(var, head, field, tvar) \ - for ((var) = LIST_FIRST((head)); \ - (var) && ((tvar) = LIST_NEXT((var), field), 1); \ - (var) = (tvar)) - -#define LIST_INIT(head) do { \ - LIST_FIRST((head)) = NULL; \ -} while (0) - -#define LIST_INSERT_AFTER(listelm, elm, field) do { \ - if ((LIST_NEXT((elm), field) = LIST_NEXT((listelm), field)) != NULL)\ - LIST_NEXT((listelm), field)->field.le_prev = \ - &LIST_NEXT((elm), field); \ - LIST_NEXT((listelm), field) = (elm); \ - (elm)->field.le_prev = &LIST_NEXT((listelm), field); \ -} while (0) - -#define LIST_INSERT_BEFORE(listelm, elm, field) do { \ - (elm)->field.le_prev = (listelm)->field.le_prev; \ - LIST_NEXT((elm), field) = (listelm); \ - *(listelm)->field.le_prev = (elm); \ - (listelm)->field.le_prev = &LIST_NEXT((elm), field); \ -} while (0) - -#define LIST_INSERT_HEAD(head, elm, field) do { \ - if ((LIST_NEXT((elm), field) = LIST_FIRST((head))) != NULL) \ - LIST_FIRST((head))->field.le_prev = &LIST_NEXT((elm), field);\ - LIST_FIRST((head)) = (elm); \ - (elm)->field.le_prev = &LIST_FIRST((head)); \ -} while (0) - -#define LIST_NEXT(elm, field) ((elm)->field.le_next) - -#define LIST_REMOVE(elm, field) do { \ - if (LIST_NEXT((elm), field) != NULL) \ - LIST_NEXT((elm), field)->field.le_prev = \ - (elm)->field.le_prev; \ - *(elm)->field.le_prev = LIST_NEXT((elm), field); \ -} while (0) - -/* - * Tail queue declarations. - */ -#define TAILQ_HEAD(name, type) \ -struct name { \ - struct type *tqh_first; /* first element */ \ - struct type **tqh_last; /* addr of last next element */ \ - TRACEBUF \ -} - -#define TAILQ_HEAD_INITIALIZER(head) \ - { NULL, &(head).tqh_first } - -#define TAILQ_ENTRY(type) \ -struct { \ - struct type *tqe_next; /* next element */ \ - struct type **tqe_prev; /* address of previous next element */ \ - TRACEBUF \ -} - -/* - * Tail queue functions. - */ -#define TAILQ_CONCAT(head1, head2, field) do { \ - if (!TAILQ_EMPTY(head2)) { \ - *(head1)->tqh_last = (head2)->tqh_first; \ - (head2)->tqh_first->field.tqe_prev = (head1)->tqh_last; \ - (head1)->tqh_last = (head2)->tqh_last; \ - TAILQ_INIT((head2)); \ - QMD_TRACE_HEAD(head); \ - QMD_TRACE_HEAD(head2); \ - } \ -} while (0) - -#define TAILQ_EMPTY(head) ((head)->tqh_first == NULL) - -#define TAILQ_FIRST(head) ((head)->tqh_first) - -#define TAILQ_FOREACH(var, head, field) \ - for ((var) = TAILQ_FIRST((head)); \ - (var); \ - (var) = TAILQ_NEXT((var), field)) - -#define TAILQ_FOREACH_SAFE(var, head, field, tvar) \ - for ((var) = TAILQ_FIRST((head)); \ - (var) && ((tvar) = TAILQ_NEXT((var), field), 1); \ - (var) = (tvar)) - -#define TAILQ_FOREACH_REVERSE(var, head, headname, field) \ - for ((var) = TAILQ_LAST((head), headname); \ - (var); \ - (var) = TAILQ_PREV((var), headname, field)) - -#define TAILQ_FOREACH_REVERSE_SAFE(var, head, headname, field, tvar) \ - for ((var) = TAILQ_LAST((head), headname); \ - (var) && ((tvar) = TAILQ_PREV((var), headname, field), 1); \ - (var) = (tvar)) - -#define TAILQ_INIT(head) do { \ - TAILQ_FIRST((head)) = NULL; \ - (head)->tqh_last = &TAILQ_FIRST((head)); \ - QMD_TRACE_HEAD(head); \ -} while (0) - -#define TAILQ_INSERT_AFTER(head, listelm, elm, field) do { \ - if ((TAILQ_NEXT((elm), field) = TAILQ_NEXT((listelm), field)) != NULL)\ - TAILQ_NEXT((elm), field)->field.tqe_prev = \ - &TAILQ_NEXT((elm), field); \ - else { \ - (head)->tqh_last = &TAILQ_NEXT((elm), field); \ - QMD_TRACE_HEAD(head); \ - } \ - TAILQ_NEXT((listelm), field) = (elm); \ - (elm)->field.tqe_prev = &TAILQ_NEXT((listelm), field); \ - QMD_TRACE_ELEM(&(elm)->field); \ - QMD_TRACE_ELEM(&listelm->field); \ -} while (0) - -#define TAILQ_INSERT_BEFORE(listelm, elm, field) do { \ - (elm)->field.tqe_prev = (listelm)->field.tqe_prev; \ - TAILQ_NEXT((elm), field) = (listelm); \ - *(listelm)->field.tqe_prev = (elm); \ - (listelm)->field.tqe_prev = &TAILQ_NEXT((elm), field); \ - QMD_TRACE_ELEM(&(elm)->field); \ - QMD_TRACE_ELEM(&listelm->field); \ -} while (0) - -#define TAILQ_INSERT_HEAD(head, elm, field) do { \ - if ((TAILQ_NEXT((elm), field) = TAILQ_FIRST((head))) != NULL) \ - TAILQ_FIRST((head))->field.tqe_prev = \ - &TAILQ_NEXT((elm), field); \ - else \ - (head)->tqh_last = &TAILQ_NEXT((elm), field); \ - TAILQ_FIRST((head)) = (elm); \ - (elm)->field.tqe_prev = &TAILQ_FIRST((head)); \ - QMD_TRACE_HEAD(head); \ - QMD_TRACE_ELEM(&(elm)->field); \ -} while (0) - -#define TAILQ_INSERT_TAIL(head, elm, field) do { \ - TAILQ_NEXT((elm), field) = NULL; \ - (elm)->field.tqe_prev = (head)->tqh_last; \ - *(head)->tqh_last = (elm); \ - (head)->tqh_last = &TAILQ_NEXT((elm), field); \ - QMD_TRACE_HEAD(head); \ - QMD_TRACE_ELEM(&(elm)->field); \ -} while (0) - -#define TAILQ_LAST(head, headname) \ - (*(((struct headname *)((head)->tqh_last))->tqh_last)) - -#define TAILQ_NEXT(elm, field) ((elm)->field.tqe_next) - -#define TAILQ_PREV(elm, headname, field) \ - (*(((struct headname *)((elm)->field.tqe_prev))->tqh_last)) - -#define TAILQ_REMOVE(head, elm, field) do { \ - if ((TAILQ_NEXT((elm), field)) != NULL) \ - TAILQ_NEXT((elm), field)->field.tqe_prev = \ - (elm)->field.tqe_prev; \ - else { \ - (head)->tqh_last = (elm)->field.tqe_prev; \ - QMD_TRACE_HEAD(head); \ - } \ - *(elm)->field.tqe_prev = TAILQ_NEXT((elm), field); \ - TRASHIT((elm)->field.tqe_next); \ - TRASHIT((elm)->field.tqe_prev); \ - QMD_TRACE_ELEM(&(elm)->field); \ -} while (0) - - -#ifdef _KERNEL - -/* - * XXX insque() and remque() are an old way of handling certain queues. - * They bogusly assumes that all queue heads look alike. - */ - -struct quehead { - struct quehead *qh_link; - struct quehead *qh_rlink; -}; - -#if defined(__GNUC__) || defined(__INTEL_COMPILER) - -static __inline void -insque(void *a, void *b) -{ - struct quehead *element = (struct quehead *)a, - *head = (struct quehead *)b; - - element->qh_link = head->qh_link; - element->qh_rlink = head; - head->qh_link = element; - element->qh_link->qh_rlink = element; -} - -static __inline void -remque(void *a) -{ - struct quehead *element = (struct quehead *)a; - - element->qh_link->qh_rlink = element->qh_rlink; - element->qh_rlink->qh_link = element->qh_link; - element->qh_rlink = 0; -} - -#else /* !(__GNUC__ || __INTEL_COMPILER) */ - -void insque(void *a, void *b); -void remque(void *a); - -#endif /* __GNUC__ || __INTEL_COMPILER */ - -#endif /* _KERNEL */ - -#endif /* !_SYS_QUEUE_H_ */ From ffa1323fc031016d68ccdcf2f73bb82bda51d7ee Mon Sep 17 00:00:00 2001 From: Oleksij Rempel Date: Sat, 11 May 2013 01:00:30 +0200 Subject: [PATCH 06/57] do not include opt_ah.h, it is not used by ar5416_hw.c Signed-off-by: Oleksij Rempel --- target_firmware/wlan/ar5416_hw.c | 1 - 1 file changed, 1 deletion(-) diff --git a/target_firmware/wlan/ar5416_hw.c b/target_firmware/wlan/ar5416_hw.c index 1261565..dfa34fd 100644 --- a/target_firmware/wlan/ar5416_hw.c +++ b/target_firmware/wlan/ar5416_hw.c @@ -33,7 +33,6 @@ * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#include "opt_ah.h" #include "ah.h" #include "ah_internal.h" #include "ar5416.h" From 96ac9ba3e6a122184ef392f7c26ae8748b8c8b22 Mon Sep 17 00:00:00 2001 From: Oleksij Rempel Date: Sat, 11 May 2013 01:09:28 +0200 Subject: [PATCH 07/57] ah.c: do not inclue opt_ah.h Signed-off-by: Oleksij Rempel --- target_firmware/wlan/ah.c | 1 - 1 file changed, 1 deletion(-) diff --git a/target_firmware/wlan/ah.c b/target_firmware/wlan/ah.c index 30c9594..b1ead39 100755 --- a/target_firmware/wlan/ah.c +++ b/target_firmware/wlan/ah.c @@ -33,7 +33,6 @@ * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#include "opt_ah.h" #include "ah.h" #include "ah_internal.h" #include From 26fcc4982d5efcb83a995484c658e64105791be7 Mon Sep 17 00:00:00 2001 From: Oleksij Rempel Date: Sat, 11 May 2013 01:12:24 +0200 Subject: [PATCH 08/57] ah_osdep.c: don't include adf_net_types.h Signed-off-by: Oleksij Rempel --- target_firmware/wlan/ah_osdep.c | 1 - 1 file changed, 1 deletion(-) diff --git a/target_firmware/wlan/ah_osdep.c b/target_firmware/wlan/ah_osdep.c index dc1753b..4eb6727 100755 --- a/target_firmware/wlan/ah_osdep.c +++ b/target_firmware/wlan/ah_osdep.c @@ -48,7 +48,6 @@ #include #include #include -#include #include "ah.h" #include From 7a2a1fe26cdfe70b5f66ed648c183a504dd52769 Mon Sep 17 00:00:00 2001 From: Oleksij Rempel Date: Sat, 11 May 2013 01:14:18 +0200 Subject: [PATCH 09/57] ar5416_phy.c: don't include opt_ah.h Signed-off-by: Oleksij Rempel --- target_firmware/wlan/ar5416_phy.c | 1 - 1 file changed, 1 deletion(-) diff --git a/target_firmware/wlan/ar5416_phy.c b/target_firmware/wlan/ar5416_phy.c index 7842bd9..4031066 100755 --- a/target_firmware/wlan/ar5416_phy.c +++ b/target_firmware/wlan/ar5416_phy.c @@ -33,7 +33,6 @@ * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#include "opt_ah.h" #include "ah.h" #include "ah_internal.h" #include "ar5416.h" From 53d0d734de874907916226a6f919ec8c2f794280 Mon Sep 17 00:00:00 2001 From: Oleksij Rempel Date: Sat, 11 May 2013 01:18:18 +0200 Subject: [PATCH 10/57] ieee80211_output.c: remove unused includes Signed-off-by: Oleksij Rempel --- target_firmware/wlan/ieee80211_output.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/target_firmware/wlan/ieee80211_output.c b/target_firmware/wlan/ieee80211_output.c index 562edba..ce034ed 100755 --- a/target_firmware/wlan/ieee80211_output.c +++ b/target_firmware/wlan/ieee80211_output.c @@ -48,10 +48,8 @@ #include #include -#include #include "ieee80211_var.h" -#include "_ieee80211.h" #include "ieee80211.h" #include From 234300e94bb7f73c4cb8b4946b08e768046a9ad9 Mon Sep 17 00:00:00 2001 From: Oleksij Rempel Date: Sat, 11 May 2013 01:54:27 +0200 Subject: [PATCH 11/57] wlan/if_ath.c: remove unused includes Signed-off-by: Oleksij Rempel --- target_firmware/wlan/if_ath.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/target_firmware/wlan/if_ath.c b/target_firmware/wlan/if_ath.c index 4c9e98b..25d41ff 100755 --- a/target_firmware/wlan/if_ath.c +++ b/target_firmware/wlan/if_ath.c @@ -50,10 +50,8 @@ #include #include -#include "if_ethersubr.h" #include "if_llc.h" #include "ieee80211_var.h" -#include "ieee80211_proto.h" #include "if_athrate.h" #include "if_athvar.h" #include "ah_desc.h" From 74486f880eb0bbbe3ec3f10bfe433f5046a7c65f Mon Sep 17 00:00:00 2001 From: Oleksij Rempel Date: Sat, 11 May 2013 01:56:38 +0200 Subject: [PATCH 12/57] wlan/if_ath_pci.c: remove unused inlcudes Signed-off-by: Oleksij Rempel --- target_firmware/wlan/if_ath_pci.c | 1 - 1 file changed, 1 deletion(-) diff --git a/target_firmware/wlan/if_ath_pci.c b/target_firmware/wlan/if_ath_pci.c index 320e29e..c261206 100755 --- a/target_firmware/wlan/if_ath_pci.c +++ b/target_firmware/wlan/if_ath_pci.c @@ -57,7 +57,6 @@ #include #include -#include #include #include From bd0fb563fc5786b0ebec7119490b146c36fed8cb Mon Sep 17 00:00:00 2001 From: Oleksij Rempel Date: Sat, 11 May 2013 01:27:49 +0200 Subject: [PATCH 13/57] if_owl.c: remove unused includes Signed-off-by: Oleksij Rempel --- target_firmware/wlan/if_owl.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/target_firmware/wlan/if_owl.c b/target_firmware/wlan/if_owl.c index 40721cd..1b152d7 100755 --- a/target_firmware/wlan/if_owl.c +++ b/target_firmware/wlan/if_owl.c @@ -47,7 +47,6 @@ #include #include -#include "if_ethersubr.h" #include "if_llc.h" #ifdef USE_HEADERLEN_RESV @@ -58,7 +57,6 @@ #include "if_athrate.h" #include "if_athvar.h" #include "ah_desc.h" -#include "if_ath_pci.h" #define ath_tgt_free_skb adf_nbuf_free From 468aa44b4eb1c40bd46246a9d95481262a20ccbc Mon Sep 17 00:00:00 2001 From: Oleksij Rempel Date: Sat, 11 May 2013 01:29:01 +0200 Subject: [PATCH 14/57] ratectrl_11n_ln.c: remove unused includes Signed-off-by: Oleksij Rempel --- target_firmware/wlan/ratectrl_11n_ln.c | 1 - 1 file changed, 1 deletion(-) diff --git a/target_firmware/wlan/ratectrl_11n_ln.c b/target_firmware/wlan/ratectrl_11n_ln.c index b80f478..01ca7d3 100755 --- a/target_firmware/wlan/ratectrl_11n_ln.c +++ b/target_firmware/wlan/ratectrl_11n_ln.c @@ -47,7 +47,6 @@ #include #include #include -#include #include From ba4f8640e71f0597f2e25983bfbf2d6c7a9d0b1f Mon Sep 17 00:00:00 2001 From: Oleksij Rempel Date: Sat, 11 May 2013 01:37:39 +0200 Subject: [PATCH 15/57] remove wlan/if_ethersubr.h Signed-off-by: Oleksij Rempel --- target_firmware/wlan/if_ethersubr.h | 79 ----------------------------- 1 file changed, 79 deletions(-) delete mode 100755 target_firmware/wlan/if_ethersubr.h diff --git a/target_firmware/wlan/if_ethersubr.h b/target_firmware/wlan/if_ethersubr.h deleted file mode 100755 index 32d5068..0000000 --- a/target_firmware/wlan/if_ethersubr.h +++ /dev/null @@ -1,79 +0,0 @@ -/*- - * Copyright (c) 2002-2004 Sam Leffler, Errno Consulting - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer, - * without modification. - * 2. Redistributions in binary form must reproduce at minimum a disclaimer - * similar to the "NO WARRANTY" disclaimer below ("Disclaimer") and any - * redistribution must be conditioned upon including a substantially - * similar Disclaimer requirement for further binary redistribution. - * 3. Neither the names of the above-listed copyright holders nor the names - * of any contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * Alternatively, this software may be distributed under the terms of the - * GNU General Public License ("GPL") version 2 as published by the Free - * Software Foundation. - * - * NO WARRANTY - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF NONINFRINGEMENT, MERCHANTIBILITY - * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL - * THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, - * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER - * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF - * THE POSSIBILITY OF SUCH DAMAGES. - * - * $Id: //depot/sw/branches/fusion_usb/target_firmware/wlan/target/madwifi/net80211/if_ethersubr.h#1 $ - */ - -#ifndef _NET_IF_ETHERSUBR_H_ -#define _NET_IF_ETHERSUBR_H_ - -#define ETHER_ADDR_LEN 6 /* length of an Ethernet address */ -#define ETHER_TYPE_LEN 2 /* length of the Ethernet type field */ -#define ETHER_CRC_LEN 4 /* length of the Ethernet CRC */ -#define ETHER_HDR_LEN (ETHER_ADDR_LEN*2+ETHER_TYPE_LEN) -#define ETHER_MAX_LEN 1518 - -#define ETHERMTU (ETHER_MAX_LEN-ETHER_HDR_LEN-ETHER_CRC_LEN) - -/* - * Structure of a 10Mb/s Ethernet header. - */ -/* struct ether_header { */ -/* u_char ether_dhost[ETHER_ADDR_LEN]; */ -/* u_char ether_shost[ETHER_ADDR_LEN]; */ -/* u_short ether_type; */ -/* } adf_os_packed; */ - -#ifndef ETHERTYPE_PAE -#define ETHERTYPE_PAE 0x888e /* EAPOL PAE/802.1x */ -#endif -#ifndef ETHERTYPE_IP -#define ETHERTYPE_IP 0x0800 /* IP protocol */ -#endif - -/* - * Structure of a 48-bit Ethernet address. - */ -/* struct ether_addr { */ -/* u_char octet[ETHER_ADDR_LEN]; */ -/* } adf_os_packed; */ - -#define ETHER_IS_MULTICAST(addr) (*(addr) & 0x01) /* is address mcast/bcast? */ - -#define VLAN_PRI_SHIFT 13 /* Shift to find VLAN user priority */ -#define VLAN_PRI_MASK 7 /* Mask for user priority bits in VLAN */ - - -#endif /* _NET_IF_ETHERSUBR_H_ */ From 3c2a030b0ed1690532f3ef40379635fd249815a0 Mon Sep 17 00:00:00 2001 From: Oleksij Rempel Date: Sat, 11 May 2013 09:10:46 +0200 Subject: [PATCH 16/57] ar5416_hw.c: remove ar5416GetCapability Chain call of this function looks like this: ath_hal_getcapability(makro) -> ar5416GetCapability -> ath_hal_getcapability(funct) Signed-off-by: Oleksij Rempel --- target_firmware/wlan/ah.h | 3 --- target_firmware/wlan/ar5416_hw.c | 12 ------------ target_firmware/wlan/if_athvar.h | 2 -- 3 files changed, 17 deletions(-) diff --git a/target_firmware/wlan/ah.h b/target_firmware/wlan/ah.h index 4901097..67ca199 100755 --- a/target_firmware/wlan/ah.h +++ b/target_firmware/wlan/ah.h @@ -377,9 +377,6 @@ struct ath_hal HAL_BOOL incTrigLevel); /* Misc Functions */ - HAL_STATUS __ahdecl(*ah_getCapability)(struct ath_hal *, - HAL_CAPABILITY_TYPE, a_uint32_t capability, - a_uint32_t *result); void __ahdecl(*ah_setDefAntenna)(struct ath_hal*, a_uint32_t); HAL_BOOL __ahdecl(*ah_updateCTSForBursting)(struct ath_hal *, diff --git a/target_firmware/wlan/ar5416_hw.c b/target_firmware/wlan/ar5416_hw.c index dfa34fd..2cf2892 100644 --- a/target_firmware/wlan/ar5416_hw.c +++ b/target_firmware/wlan/ar5416_hw.c @@ -67,7 +67,6 @@ static const struct ath_hal_private ar5416hal_10 = {{ .ah_abortTxDma = ar5416AbortTxDma, /* Misc Functions */ - .ah_getCapability = ar5416GetCapability, .ah_getTsf32 = ar5416GetTsf32, .ah_getTsf64 = ar5416GetTsf64, .ah_resetTsf = ar5416ResetTsf, @@ -288,17 +287,6 @@ ar5416SetInterrupts(struct ath_hal *ah, HAL_INT ints) return omask; } -/****************/ -/* Capabilities */ -/****************/ - -HAL_STATUS ar5416GetCapability(struct ath_hal *ah, HAL_CAPABILITY_TYPE type, - a_uint32_t capability, a_uint32_t *result) - -{ - return ath_hal_getcapability(ah, type, capability, result); -} - /****************/ /* TSF Handling */ /****************/ diff --git a/target_firmware/wlan/if_athvar.h b/target_firmware/wlan/if_athvar.h index c3a6fbe..304049d 100755 --- a/target_firmware/wlan/if_athvar.h +++ b/target_firmware/wlan/if_athvar.h @@ -557,8 +557,6 @@ a_uint8_t ath_get_minrateidx(struct ath_softc_tgt *sc, struct ath_vap_target *av ((*(_ah)->ah_getTsf64)((_ah))) #define ath_hal_intrset(_ah, _mask) \ ((*(_ah)->ah_setInterrupts)((_ah), (_mask))) -#define ath_hal_getcapability(_ah, _cap, _param, _result) \ - ((*(_ah)->ah_getCapability)((_ah), (_cap), (_param), (_result))) #define ath_hal_set11n_aggr_first(_ah, _ds, _aggrlen, _numdelims) \ ((*(_ah)->ah_set11nAggrFirst)(_ah, _ds, _aggrlen, _numdelims)) #define ath_hal_set11n_aggr_middle(_ah, _ds, _numdelims) \ From c882ca00b0d70c0fa1f758c310c455ed2e7ba4b6 Mon Sep 17 00:00:00 2001 From: Oleksij Rempel Date: Sat, 11 May 2013 09:40:29 +0200 Subject: [PATCH 17/57] use ah_getRateTable directly Signed-off-by: Oleksij Rempel --- target_firmware/wlan/ah.h | 3 --- target_firmware/wlan/if_ath.c | 5 +++-- target_firmware/wlan/if_athvar.h | 2 -- 3 files changed, 3 insertions(+), 7 deletions(-) diff --git a/target_firmware/wlan/ah.h b/target_firmware/wlan/ah.h index 67ca199..6b9f2b7 100755 --- a/target_firmware/wlan/ah.h +++ b/target_firmware/wlan/ah.h @@ -476,9 +476,6 @@ extern struct ath_hal * __ahdecl ath_hal_attach_tgt(a_uint32_t devid, HAL_SOFTC, adf_os_device_t dev, a_uint32_t flags, HAL_STATUS* status); -extern const HAL_RATE_TABLE * __ahdecl ath_hal_getratetable(struct ath_hal *, - a_uint32_t mode); - extern a_uint16_t __ahdecl ath_hal_computetxtime(struct ath_hal *, const HAL_RATE_TABLE *rates, a_uint32_t frameLen, diff --git a/target_firmware/wlan/if_ath.c b/target_firmware/wlan/if_ath.c index 25d41ff..889d1b4 100755 --- a/target_firmware/wlan/if_ath.c +++ b/target_firmware/wlan/if_ath.c @@ -55,6 +55,7 @@ #include "if_athrate.h" #include "if_athvar.h" #include "ah_desc.h" +#include "ah.h" static a_int32_t ath_numrxbufs = -1; static a_int32_t ath_numrxdescs = -1; @@ -119,10 +120,10 @@ static a_int32_t ath_rate_setup(struct ath_softc_tgt *sc, a_uint32_t mode) switch (mode) { case IEEE80211_MODE_11NA: - sc->sc_rates[mode] = ath_hal_getratetable(ah, HAL_MODE_11NA); + sc->sc_rates[mode] = ah->ah_getRateTable(ah, HAL_MODE_11NA); break; case IEEE80211_MODE_11NG: - sc->sc_rates[mode] = ath_hal_getratetable(ah, HAL_MODE_11NG); + sc->sc_rates[mode] = ah->ah_getRateTable(ah, HAL_MODE_11NG); break; default: return 0; diff --git a/target_firmware/wlan/if_athvar.h b/target_firmware/wlan/if_athvar.h index 304049d..90150a2 100755 --- a/target_firmware/wlan/if_athvar.h +++ b/target_firmware/wlan/if_athvar.h @@ -489,8 +489,6 @@ typedef enum { a_uint8_t ath_get_minrateidx(struct ath_softc_tgt *sc, struct ath_vap_target *avp); -#define ath_hal_getratetable(_ah, _mode) \ - ((*(_ah)->ah_getRateTable)((_ah), (_mode))) #define ath_hal_intrset(_ah, _mask) \ ((*(_ah)->ah_setInterrupts)((_ah), (_mask))) #define ath_hal_intrpend(_ah) \ From 5bc39b0a9caa9dca168c59fdc51f378bcbe9203b Mon Sep 17 00:00:00 2001 From: Oleksij Rempel Date: Sat, 11 May 2013 09:47:42 +0200 Subject: [PATCH 18/57] use ah_detach directly Signed-off-by: Oleksij Rempel --- target_firmware/wlan/ah_osdep.c | 6 ------ target_firmware/wlan/ah_osdep.h | 1 - target_firmware/wlan/if_ath.c | 4 ++-- 3 files changed, 2 insertions(+), 9 deletions(-) diff --git a/target_firmware/wlan/ah_osdep.c b/target_firmware/wlan/ah_osdep.c index 4eb6727..eebf722 100755 --- a/target_firmware/wlan/ah_osdep.c +++ b/target_firmware/wlan/ah_osdep.c @@ -70,12 +70,6 @@ _ath_hal_attach_tgt(a_uint32_t devid, HAL_SOFTC sc, return ah; } -void -ath_hal_detach(struct ath_hal *ah) -{ - (*ah->ah_detach)(ah); -} - extern void *global_hdl; /* diff --git a/target_firmware/wlan/ah_osdep.h b/target_firmware/wlan/ah_osdep.h index f45e0cb..a4a3c6d 100755 --- a/target_firmware/wlan/ah_osdep.h +++ b/target_firmware/wlan/ah_osdep.h @@ -158,5 +158,4 @@ extern a_uint32_t __ahdecl ath_hal_reg_read_target(struct ath_hal *ah, a_uint32 #define AH_USE_EEPROM 0x00000001 extern struct ath_hal *_ath_hal_attach_tgt( a_uint32_t, HAL_SOFTC, adf_os_device_t, a_uint32_t flags, void* status); -extern void ath_hal_detach(struct ath_hal *); #endif /* _ATH_AH_OSDEP_H_ */ diff --git a/target_firmware/wlan/if_ath.c b/target_firmware/wlan/if_ath.c index 889d1b4..4cfc8c8 100755 --- a/target_firmware/wlan/if_ath.c +++ b/target_firmware/wlan/if_ath.c @@ -1644,7 +1644,7 @@ static void ath_detach_tgt(void *Context, A_UINT16 Command, A_UINT16 SeqNo, struct ath_hal *ah = sc->sc_ah; ath_desc_free(sc); - ath_hal_detach(ah); + ah->ah_detach(ah); wmi_cmd_rsp(sc->tgt_wmi_handle, Command, SeqNo, NULL, 0); adf_os_mem_free(sc); } @@ -1936,7 +1936,7 @@ a_int32_t ath_tgt_attach(a_uint32_t devid, struct ath_softc_tgt *sc, adf_os_devi bad2: ath_desc_free(sc); if (ah) - ath_hal_detach(ah); + ah->ah_detach(ah); } static void tgt_hif_htc_wmi_shutdown(struct ath_softc_tgt *sc) From 6efc1f98e04402a34688c2d75d8492b5fe1c5267 Mon Sep 17 00:00:00 2001 From: Oleksij Rempel Date: Sat, 11 May 2013 09:54:37 +0200 Subject: [PATCH 19/57] use ah_updateTxTrigLevel directly Signed-off-by: Oleksij Rempel --- target_firmware/wlan/if_ath.c | 2 +- target_firmware/wlan/if_athvar.h | 2 -- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/target_firmware/wlan/if_ath.c b/target_firmware/wlan/if_ath.c index 4cfc8c8..91376c5 100755 --- a/target_firmware/wlan/if_ath.c +++ b/target_firmware/wlan/if_ath.c @@ -1067,7 +1067,7 @@ adf_os_irq_resp_t ath_intr(adf_drv_handle_t hdl) if (status & HAL_INT_TXURN) { sc->sc_int_stats.ast_txurn++; - ath_hal_updatetxtriglevel(ah, AH_TRUE); + ah->ah_updateTxTrigLevel(ah, AH_TRUE); } ATH_SCHEDULE_TQUEUE(sc->sc_dev, &sc->sc_txtq); diff --git a/target_firmware/wlan/if_athvar.h b/target_firmware/wlan/if_athvar.h index 90150a2..d91d2ae 100755 --- a/target_firmware/wlan/if_athvar.h +++ b/target_firmware/wlan/if_athvar.h @@ -495,8 +495,6 @@ a_uint8_t ath_get_minrateidx(struct ath_softc_tgt *sc, struct ath_vap_target *av ((*(_ah)->ah_isInterruptPending)((_ah))) #define ath_hal_getisr(_ah, _pmask) \ ((*(_ah)->ah_getPendingInterrupts)((_ah), (_pmask))) -#define ath_hal_updatetxtriglevel(_ah, _inc) \ - ((*(_ah)->ah_updateTxTrigLevel)((_ah), (_inc))) #define ath_hal_setuprxdesc(_ah, _ds, _size, _intreq) \ ((*(_ah)->ah_setupRxDesc)((_ah), (_ds), (_size), (_intreq))) #define ath_hal_rxprocdescfast(_ah, _ds, _dspa, _dsnext, _rx_stats) \ From b354afb3c86e18d23c77aeff58a0c264caa06fb4 Mon Sep 17 00:00:00 2001 From: Oleksij Rempel Date: Sat, 11 May 2013 09:57:45 +0200 Subject: [PATCH 20/57] remove ar5416GetTxDP Signed-off-by: Oleksij Rempel --- target_firmware/wlan/ah.h | 2 -- target_firmware/wlan/ar5416_hw.c | 7 ------- 2 files changed, 9 deletions(-) diff --git a/target_firmware/wlan/ah.h b/target_firmware/wlan/ah.h index 6b9f2b7..6cf9354 100755 --- a/target_firmware/wlan/ah.h +++ b/target_firmware/wlan/ah.h @@ -387,8 +387,6 @@ struct ath_hal /* Target Transmit Functions */ - - a_uint32_t __ahdecl(*ah_getTxDP)(struct ath_hal*, a_uint32_t); HAL_BOOL __ahdecl(*ah_setTxDP)(struct ath_hal*, a_uint32_t, a_uint32_t txdp); a_uint32_t __ahdecl(*ah_numTxPending)(struct ath_hal *, a_uint32_t q); HAL_BOOL __ahdecl(*ah_startTxDma)(struct ath_hal*, a_uint32_t); diff --git a/target_firmware/wlan/ar5416_hw.c b/target_firmware/wlan/ar5416_hw.c index 2cf2892..d1ceb66 100644 --- a/target_firmware/wlan/ar5416_hw.c +++ b/target_firmware/wlan/ar5416_hw.c @@ -57,7 +57,6 @@ static const struct ath_hal_private ar5416hal_10 = {{ /* Transmit functions */ .ah_updateTxTrigLevel = ar5416UpdateTxTrigLevel, - .ah_getTxDP = ar5416GetTxDP, .ah_setTxDP = ar5416SetTxDP, .ah_numTxPending = ar5416NumTxPending, .ah_startTxDma = ar5416StartTxDma, @@ -567,12 +566,6 @@ HAL_BOOL ar5416UpdateTxTrigLevel(struct ath_hal *ah, HAL_BOOL bIncTrigLevel) return (newLevel != curLevel); } -a_uint32_t ar5416GetTxDP(struct ath_hal *ah, a_uint32_t q) -{ - HALASSERT(q < AH_PRIVATE(ah)->ah_caps.halTotalQueues); - return OS_REG_READ(ah, AR_QTXDP(q)); -} - HAL_BOOL ar5416SetTxDP(struct ath_hal *ah, a_uint32_t q, a_uint32_t txdp) { HALASSERT(q < AH_PRIVATE(ah)->ah_caps.halTotalQueues); From 50d42b895f52767935de18dbbb901566e95088d9 Mon Sep 17 00:00:00 2001 From: Oleksij Rempel Date: Sat, 11 May 2013 10:01:32 +0200 Subject: [PATCH 21/57] use ah_setTxDP directly Signed-off-by: Oleksij Rempel --- target_firmware/wlan/if_ath.c | 2 +- target_firmware/wlan/if_athvar.h | 2 -- target_firmware/wlan/if_owl.c | 6 +++--- 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/target_firmware/wlan/if_ath.c b/target_firmware/wlan/if_ath.c index 91376c5..95ee869 100755 --- a/target_firmware/wlan/if_ath.c +++ b/target_firmware/wlan/if_ath.c @@ -624,7 +624,7 @@ static void ath_tgt_send_beacon(struct ath_softc_tgt *sc, adf_nbuf_t bc_hdr, ath_beacon_setup(sc, bf, &sc->sc_vap[vap_index]); ath_hal_stoptxdma(ah, sc->sc_bhalq); - ath_hal_puttxbuf(ah, sc->sc_bhalq, ATH_BUF_GET_DESC_PHY_ADDR(bf)); + ah->ah_setTxDP(ah, sc->sc_bhalq, ATH_BUF_GET_DESC_PHY_ADDR(bf)); ath_hal_txstart(ah, sc->sc_bhalq); } diff --git a/target_firmware/wlan/if_athvar.h b/target_firmware/wlan/if_athvar.h index d91d2ae..04f1070 100755 --- a/target_firmware/wlan/if_athvar.h +++ b/target_firmware/wlan/if_athvar.h @@ -543,8 +543,6 @@ a_uint8_t ath_get_minrateidx(struct ath_softc_tgt *sc, struct ath_vap_target *av (ath_hal_getcapability(_ah, HAL_CAP_HT, 0, NULL) == HAL_OK) #define ath_hal_getrtsaggrlimit(_ah, _pv) \ (ath_hal_getcapability(_ah, HAL_CAP_RTS_AGGR_LIMIT, 0, _pv) == HAL_OK) -#define ath_hal_puttxbuf(_ah, _q, _bufaddr) \ - ((*(_ah)->ah_setTxDP)((_ah), (_q), (_bufaddr))) #define ath_hal_txstart(_ah, _q) \ ((*(_ah)->ah_startTxDma)((_ah), (_q))) #define ath_hal_setrxfilter(_ah, _filter) \ diff --git a/target_firmware/wlan/if_owl.c b/target_firmware/wlan/if_owl.c index 1b152d7..2f7e55b 100755 --- a/target_firmware/wlan/if_owl.c +++ b/target_firmware/wlan/if_owl.c @@ -888,13 +888,13 @@ static void ath_tgt_txq_add_ucast(struct ath_softc_tgt *sc, struct ath_tx_buf *b ATH_TXQ_INSERT_TAIL(txq, bf, bf_list); if (txq->axq_link == NULL) { - ath_hal_puttxbuf(ah, txq->axq_qnum, ATH_BUF_GET_DESC_PHY_ADDR(bf)); + ah->ah_setTxDP(ah, txq->axq_qnum, ATH_BUF_GET_DESC_PHY_ADDR(bf)); } else { *txq->axq_link = ATH_BUF_GET_DESC_PHY_ADDR(bf); txe_val = OS_REG_READ(ah, 0x840); if (!(txe_val & (1<< txq->axq_qnum))) - ath_hal_puttxbuf(ah, txq->axq_qnum, ATH_BUF_GET_DESC_PHY_ADDR(bf)); + ah->ah_setTxDP(ah, txq->axq_qnum, ATH_BUF_GET_DESC_PHY_ADDR(bf)); } txq->axq_link = &bf->bf_lastds->ds_link; @@ -1248,7 +1248,7 @@ ath_tgt_txqaddbuf(struct ath_softc_tgt *sc, ATH_TXQ_INSERT_TAIL(txq, bf, bf_list); if (txq->axq_link == NULL) { - ath_hal_puttxbuf(ah, txq->axq_qnum, ATH_BUF_GET_DESC_PHY_ADDR(bf)); + ah->ah_setTxDP(ah, txq->axq_qnum, ATH_BUF_GET_DESC_PHY_ADDR(bf)); } else { *txq->axq_link = ATH_BUF_GET_DESC_PHY_ADDR(bf); } From f3f566ca472219fea26dfa848eef213e351d88f4 Mon Sep 17 00:00:00 2001 From: Oleksij Rempel Date: Sat, 11 May 2013 10:05:06 +0200 Subject: [PATCH 22/57] use ah_numTxPending directly Signed-off-by: Oleksij Rempel --- target_firmware/wlan/if_ath.c | 2 +- target_firmware/wlan/if_athvar.h | 2 -- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/target_firmware/wlan/if_ath.c b/target_firmware/wlan/if_ath.c index 95ee869..af6684a 100755 --- a/target_firmware/wlan/if_ath.c +++ b/target_firmware/wlan/if_ath.c @@ -1036,7 +1036,7 @@ adf_os_irq_resp_t ath_intr(adf_drv_handle_t hdl) struct ath_txq *txq = ATH_TXQ(sc, 8); swbaEvt.tsf = ath_hal_gettsf64(ah); - swbaEvt.beaconPendingCount = ath_hal_numtxpending(ah, sc->sc_bhalq); + swbaEvt.beaconPendingCount = ah->ah_numTxPending(ah, sc->sc_bhalq); sc->sc_swba_tsf = ath_hal_gettsf64(ah); wmi_event(sc->tgt_wmi_handle, diff --git a/target_firmware/wlan/if_athvar.h b/target_firmware/wlan/if_athvar.h index 04f1070..945a955 100755 --- a/target_firmware/wlan/if_athvar.h +++ b/target_firmware/wlan/if_athvar.h @@ -557,7 +557,5 @@ a_uint8_t ath_get_minrateidx(struct ath_softc_tgt *sc, struct ath_vap_target *av ((*(_ah)->ah_set11nAggrMiddle)(_ah, _ds, _numdelims)) #define ath_hal_set11n_aggr_last(_ah, _ds) \ ((*(_ah)->ah_set11nAggrLast)(_ah, _ds)) -#define ath_hal_numtxpending(_ah, _q) \ - ((*(_ah)->ah_numTxPending)((_ah), (_q))) #endif /* _DEV_ATH_ATHVAR_H */ From cef962728c0e8d1d778a027613c12ec0cecfe9cc Mon Sep 17 00:00:00 2001 From: Oleksij Rempel Date: Sat, 11 May 2013 10:08:17 +0200 Subject: [PATCH 23/57] use ah_startTxDma directly Signed-off-by: Oleksij Rempel --- target_firmware/wlan/if_ath.c | 2 +- target_firmware/wlan/if_athvar.h | 2 -- target_firmware/wlan/if_owl.c | 4 ++-- 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/target_firmware/wlan/if_ath.c b/target_firmware/wlan/if_ath.c index af6684a..1059a25 100755 --- a/target_firmware/wlan/if_ath.c +++ b/target_firmware/wlan/if_ath.c @@ -625,7 +625,7 @@ static void ath_tgt_send_beacon(struct ath_softc_tgt *sc, adf_nbuf_t bc_hdr, ath_beacon_setup(sc, bf, &sc->sc_vap[vap_index]); ath_hal_stoptxdma(ah, sc->sc_bhalq); ah->ah_setTxDP(ah, sc->sc_bhalq, ATH_BUF_GET_DESC_PHY_ADDR(bf)); - ath_hal_txstart(ah, sc->sc_bhalq); + ah->ah_startTxDma(ah, sc->sc_bhalq); } /******/ diff --git a/target_firmware/wlan/if_athvar.h b/target_firmware/wlan/if_athvar.h index 945a955..4bd3b41 100755 --- a/target_firmware/wlan/if_athvar.h +++ b/target_firmware/wlan/if_athvar.h @@ -543,8 +543,6 @@ a_uint8_t ath_get_minrateidx(struct ath_softc_tgt *sc, struct ath_vap_target *av (ath_hal_getcapability(_ah, HAL_CAP_HT, 0, NULL) == HAL_OK) #define ath_hal_getrtsaggrlimit(_ah, _pv) \ (ath_hal_getcapability(_ah, HAL_CAP_RTS_AGGR_LIMIT, 0, _pv) == HAL_OK) - #define ath_hal_txstart(_ah, _q) \ - ((*(_ah)->ah_startTxDma)((_ah), (_q))) #define ath_hal_setrxfilter(_ah, _filter) \ ((*(_ah)->ah_setRxFilter)((_ah), (_filter))) #define ath_hal_gettsf64(_ah) \ diff --git a/target_firmware/wlan/if_owl.c b/target_firmware/wlan/if_owl.c index 2f7e55b..3d4744d 100755 --- a/target_firmware/wlan/if_owl.c +++ b/target_firmware/wlan/if_owl.c @@ -898,7 +898,7 @@ static void ath_tgt_txq_add_ucast(struct ath_softc_tgt *sc, struct ath_tx_buf *b } txq->axq_link = &bf->bf_lastds->ds_link; - ath_hal_txstart(ah, txq->axq_qnum); + ah->ah_startTxDma(ah, txq->axq_qnum); } static a_int32_t ath_tgt_txbuf_setup(struct ath_softc_tgt *sc, @@ -1254,7 +1254,7 @@ ath_tgt_txqaddbuf(struct ath_softc_tgt *sc, } txq->axq_link = &lastds->ds_link; - ath_hal_txstart(ah, txq->axq_qnum); + ah->ah_startTxDma(ah, txq->axq_qnum); } void ath_tgt_handle_normal(struct ath_softc_tgt *sc, struct ath_tx_buf *bf) From 99a90c5f547a506bd953b53a10b29d86f9820d7f Mon Sep 17 00:00:00 2001 From: Oleksij Rempel Date: Sat, 11 May 2013 10:08:17 +0200 Subject: [PATCH 24/57] use ah_stopTxDma directly Signed-off-by: Oleksij Rempel --- target_firmware/wlan/if_ath.c | 8 ++++---- target_firmware/wlan/if_athvar.h | 2 -- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/target_firmware/wlan/if_ath.c b/target_firmware/wlan/if_ath.c index 1059a25..f526e46 100755 --- a/target_firmware/wlan/if_ath.c +++ b/target_firmware/wlan/if_ath.c @@ -623,7 +623,7 @@ static void ath_tgt_send_beacon(struct ath_softc_tgt *sc, adf_nbuf_t bc_hdr, adf_nbuf_dmamap_info(bf->bf_dmamap,&bf->bf_dmamap_info); ath_beacon_setup(sc, bf, &sc->sc_vap[vap_index]); - ath_hal_stoptxdma(ah, sc->sc_bhalq); + ah->ah_stopTxDma(ah, sc->sc_bhalq); ah->ah_setTxDP(ah, sc->sc_bhalq, ATH_BUF_GET_DESC_PHY_ADDR(bf)); ah->ah_startTxDma(ah, sc->sc_bhalq); } @@ -636,7 +636,7 @@ static void ath_tx_stopdma(struct ath_softc_tgt *sc, struct ath_txq *txq) { struct ath_hal *ah = sc->sc_ah; - (void) ath_hal_stoptxdma(ah, txq->axq_qnum); + ah->ah_stopTxDma(ah, txq->axq_qnum); } static void owltgt_txq_drain(struct ath_softc_tgt *sc, struct ath_txq *txq) @@ -659,7 +659,7 @@ static void ath_draintxq(struct ath_softc_tgt *sc, HAL_BOOL drain_softq) ath_tx_status_clear(sc); sc->sc_tx_draining = 1; - (void) ath_hal_stoptxdma(ah, sc->sc_bhalq); + ah->ah_stopTxDma(ah, sc->sc_bhalq); for (i = 0; i < HAL_NUM_TX_QUEUES; i++) if (ATH_TXQ_SETUP(sc, i)) @@ -1595,7 +1595,7 @@ static void ath_stop_tx_dma_tgt(void *Context, A_UINT16 Command, q = *(a_uint32_t *)data; q = adf_os_ntohl(q); - ath_hal_stoptxdma(ah, q); + ah->ah_stopTxDma(ah, q); wmi_cmd_rsp(sc->tgt_wmi_handle, Command, SeqNo, NULL, 0); } diff --git a/target_firmware/wlan/if_athvar.h b/target_firmware/wlan/if_athvar.h index 4bd3b41..04e4e37 100755 --- a/target_firmware/wlan/if_athvar.h +++ b/target_firmware/wlan/if_athvar.h @@ -499,8 +499,6 @@ a_uint8_t ath_get_minrateidx(struct ath_softc_tgt *sc, struct ath_vap_target *av ((*(_ah)->ah_setupRxDesc)((_ah), (_ds), (_size), (_intreq))) #define ath_hal_rxprocdescfast(_ah, _ds, _dspa, _dsnext, _rx_stats) \ ((*(_ah)->ah_procRxDescFast)((_ah), (_ds), (_dspa), (_dsnext), (_rx_stats))) -#define ath_hal_stoptxdma(_ah, _qnum) \ - ((*(_ah)->ah_stopTxDma)((_ah), (_qnum))) #define ath_hal_aborttxdma(_ah) \ ((*(_ah)->ah_abortTxDma)(_ah)) #define ath_hal_set11n_txdesc(_ah, _ds, _pktlen, _type, _txpower,\ From ffbdd7c413ff6ba105395ccd6377487c4231a1c9 Mon Sep 17 00:00:00 2001 From: Oleksij Rempel Date: Sat, 11 May 2013 10:27:34 +0200 Subject: [PATCH 25/57] remove ah_getTxIntrQueue Signed-off-by: Oleksij Rempel --- target_firmware/wlan/ah.h | 1 - target_firmware/wlan/ar5416_hw.c | 10 +--------- 2 files changed, 1 insertion(+), 10 deletions(-) diff --git a/target_firmware/wlan/ah.h b/target_firmware/wlan/ah.h index 6cf9354..62031d7 100755 --- a/target_firmware/wlan/ah.h +++ b/target_firmware/wlan/ah.h @@ -435,7 +435,6 @@ struct ath_hal HAL_BOOL lastSeg, const struct ath_tx_desc *); HAL_BOOL __ahdecl (*ah_fillKeyTxDesc) (struct ath_hal *, struct ath_tx_desc *, HAL_KEY_TYPE); HAL_STATUS __ahdecl(*ah_procTxDesc)(struct ath_hal *, struct ath_tx_desc *); - void __ahdecl(*ah_getTxIntrQueue)(struct ath_hal *, a_uint32_t *); void __ahdecl(*ah_reqTxIntrDesc)(struct ath_hal *, struct ath_desc*); HAL_BOOL __ahdecl(*ah_setBssIdMask)(struct ath_hal *, const a_uint8_t*); void __ahdecl(*ah_setPCUConfig)(struct ath_hal *); diff --git a/target_firmware/wlan/ar5416_hw.c b/target_firmware/wlan/ar5416_hw.c index d1ceb66..947e9a0 100644 --- a/target_firmware/wlan/ar5416_hw.c +++ b/target_firmware/wlan/ar5416_hw.c @@ -61,8 +61,7 @@ static const struct ath_hal_private ar5416hal_10 = {{ .ah_numTxPending = ar5416NumTxPending, .ah_startTxDma = ar5416StartTxDma, .ah_stopTxDma = ar5416StopTxDma, - - .ah_getTxIntrQueue = ar5416GetTxIntrQueue, + .ah_abortTxDma = ar5416AbortTxDma, /* Misc Functions */ @@ -689,13 +688,6 @@ HAL_BOOL ar5416StopTxDma(struct ath_hal*ah, a_uint32_t q) return (i != 0); } -void ar5416GetTxIntrQueue(struct ath_hal *ah, a_uint32_t *txqs) -{ - struct ath_hal_5416 *ahp = AH5416(ah); - *txqs &= ahp->ah_intrTxqs; - ahp->ah_intrTxqs &= ~(*txqs); -} - void ar5416IntrReqTxDesc_20(struct ath_hal *ah, struct ath_desc *ds) { struct ar5416_desc *ads = AR5416DESC(ds); From 4427905657514f83ca5d45673e4607e4e26998bb Mon Sep 17 00:00:00 2001 From: Oleksij Rempel Date: Sat, 11 May 2013 10:29:57 +0200 Subject: [PATCH 26/57] use ah_abortTxDma directly Signed-off-by: Oleksij Rempel --- target_firmware/wlan/if_ath.c | 3 ++- target_firmware/wlan/if_athvar.h | 2 -- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/target_firmware/wlan/if_ath.c b/target_firmware/wlan/if_ath.c index f526e46..46fde90 100755 --- a/target_firmware/wlan/if_ath.c +++ b/target_firmware/wlan/if_ath.c @@ -1564,8 +1564,9 @@ static void ath_aborttx_dma_tgt(void *Context, A_UINT16 Command, A_UINT16 SeqNo, A_UINT8 *data, a_int32_t datalen) { struct ath_softc_tgt *sc = (struct ath_softc_tgt *)Context; + struct ath_hal *ah = sc->sc_ah; - ath_hal_aborttxdma(sc->sc_ah); + ah->ah_abortTxDma(sc->sc_ah); wmi_cmd_rsp(sc->tgt_wmi_handle, Command, SeqNo, NULL, 0); } diff --git a/target_firmware/wlan/if_athvar.h b/target_firmware/wlan/if_athvar.h index 04e4e37..a04f1da 100755 --- a/target_firmware/wlan/if_athvar.h +++ b/target_firmware/wlan/if_athvar.h @@ -499,8 +499,6 @@ a_uint8_t ath_get_minrateidx(struct ath_softc_tgt *sc, struct ath_vap_target *av ((*(_ah)->ah_setupRxDesc)((_ah), (_ds), (_size), (_intreq))) #define ath_hal_rxprocdescfast(_ah, _ds, _dspa, _dsnext, _rx_stats) \ ((*(_ah)->ah_procRxDescFast)((_ah), (_ds), (_dspa), (_dsnext), (_rx_stats))) -#define ath_hal_aborttxdma(_ah) \ - ((*(_ah)->ah_abortTxDma)(_ah)) #define ath_hal_set11n_txdesc(_ah, _ds, _pktlen, _type, _txpower,\ _keyix, _keytype, _flags) \ ((*(_ah)->ah_set11nTxDesc)(_ah, _ds, _pktlen, _type, _txpower, _keyix,\ From 4537b13b8d1a7a0e2b4c61b99c64b421a1c4a265 Mon Sep 17 00:00:00 2001 From: Oleksij Rempel Date: Sat, 11 May 2013 10:34:17 +0200 Subject: [PATCH 27/57] remove ar5416GetTsf32 Signed-off-by: Oleksij Rempel --- target_firmware/wlan/ah.h | 3 +-- target_firmware/wlan/ar5416_hw.c | 6 ------ 2 files changed, 1 insertion(+), 8 deletions(-) diff --git a/target_firmware/wlan/ah.h b/target_firmware/wlan/ah.h index 62031d7..6694d76 100755 --- a/target_firmware/wlan/ah.h +++ b/target_firmware/wlan/ah.h @@ -440,8 +440,7 @@ struct ath_hal void __ahdecl(*ah_setPCUConfig)(struct ath_hal *); void __ahdecl(*ah_setMulticastFilter)(struct ath_hal*, a_uint32_t filter0, a_uint32_t filter1); - - a_uint32_t __ahdecl(*ah_getTsf32)(struct ath_hal*); + u_int64_t __ahdecl(*ah_getTsf64)(struct ath_hal*); void __ahdecl(*ah_resetTsf)(struct ath_hal*); diff --git a/target_firmware/wlan/ar5416_hw.c b/target_firmware/wlan/ar5416_hw.c index 947e9a0..c58aac9 100644 --- a/target_firmware/wlan/ar5416_hw.c +++ b/target_firmware/wlan/ar5416_hw.c @@ -65,7 +65,6 @@ static const struct ath_hal_private ar5416hal_10 = {{ .ah_abortTxDma = ar5416AbortTxDma, /* Misc Functions */ - .ah_getTsf32 = ar5416GetTsf32, .ah_getTsf64 = ar5416GetTsf64, .ah_resetTsf = ar5416ResetTsf, .ah_setRxFilter = ar5416SetRxFilter, @@ -299,11 +298,6 @@ u_int64_t ar5416GetTsf64(struct ath_hal *ah) return tsf; } -a_uint32_t ar5416GetTsf32(struct ath_hal *ah) -{ - return OS_REG_READ(ah, AR_TSF_L32); -} - void ar5416ResetTsf(struct ath_hal *ah) { a_int32_t count; From 7707a40c0e38e0e95f776d97cc6dd22c73fa16b4 Mon Sep 17 00:00:00 2001 From: Oleksij Rempel Date: Sat, 11 May 2013 10:39:21 +0200 Subject: [PATCH 28/57] use ah_getTsf64 directly Signed-off-by: Oleksij Rempel --- target_firmware/wlan/if_ath.c | 11 ++++++----- target_firmware/wlan/if_athvar.h | 2 -- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/target_firmware/wlan/if_ath.c b/target_firmware/wlan/if_ath.c index 46fde90..bdadbf0 100755 --- a/target_firmware/wlan/if_ath.c +++ b/target_firmware/wlan/if_ath.c @@ -96,11 +96,12 @@ static a_uint16_t adf_os_cpu_to_le16(a_uint16_t x) */ static u_int64_t ath_extend_tsf(struct ath_softc_tgt *sc, u_int32_t rstamp) { + struct ath_hal *ah = sc->sc_ah; u_int64_t tsf; u_int32_t tsf_low; u_int64_t tsf64; - tsf = ath_hal_gettsf64(sc->sc_ah); + tsf = ah->ah_getTsf64(ah); tsf_low = tsf & 0xffffffff; tsf64 = (tsf & ~0xffffffffULL) | rstamp; @@ -334,7 +335,7 @@ static void ath_uapsd_processtriggers(struct ath_softc_tgt *sc) ((struct ath_desc *)((caddr_t)(_sc)->sc_rxdma.dd_desc + \ ((_pa) - (_sc)->sc_rxdma.dd_desc_paddr))) - tsf = ath_hal_gettsf64(ah); + tsf = ah->ah_getTsf64(ah); bf = asf_tailq_first(&sc->sc_rxbuf); ds = asf_tailq_first(&sc->sc_rxdesc); @@ -784,7 +785,7 @@ static void tgt_HTCRecv_cabhandler(HTC_ENDPOINT_ID EndPt, adf_nbuf_t hdr_buf, a_uint32_t tmp; #ifdef ATH_ENABLE_CABQ - tsf = ath_hal_gettsf64(ah); + tsf = ah->ah_getTsf64(ah); tmp = tsf - sc->sc_swba_tsf; if ( tmp > ATH_CABQ_HANDLING_THRESHOLD ) { @@ -1035,9 +1036,9 @@ adf_os_irq_resp_t ath_intr(adf_drv_handle_t hdl) WMI_SWBA_EVENT swbaEvt; struct ath_txq *txq = ATH_TXQ(sc, 8); - swbaEvt.tsf = ath_hal_gettsf64(ah); + swbaEvt.tsf = ah->ah_getTsf64(ah); swbaEvt.beaconPendingCount = ah->ah_numTxPending(ah, sc->sc_bhalq); - sc->sc_swba_tsf = ath_hal_gettsf64(ah); + sc->sc_swba_tsf = ah->ah_getTsf64(ah); wmi_event(sc->tgt_wmi_handle, WMI_SWBA_EVENTID, diff --git a/target_firmware/wlan/if_athvar.h b/target_firmware/wlan/if_athvar.h index a04f1da..9a94cfd 100755 --- a/target_firmware/wlan/if_athvar.h +++ b/target_firmware/wlan/if_athvar.h @@ -541,8 +541,6 @@ a_uint8_t ath_get_minrateidx(struct ath_softc_tgt *sc, struct ath_vap_target *av (ath_hal_getcapability(_ah, HAL_CAP_RTS_AGGR_LIMIT, 0, _pv) == HAL_OK) #define ath_hal_setrxfilter(_ah, _filter) \ ((*(_ah)->ah_setRxFilter)((_ah), (_filter))) -#define ath_hal_gettsf64(_ah) \ - ((*(_ah)->ah_getTsf64)((_ah))) #define ath_hal_intrset(_ah, _mask) \ ((*(_ah)->ah_setInterrupts)((_ah), (_mask))) #define ath_hal_set11n_aggr_first(_ah, _ds, _aggrlen, _numdelims) \ From 13b1bc625de7820964eefc22a5eb8c11e9449138 Mon Sep 17 00:00:00 2001 From: Oleksij Rempel Date: Sat, 11 May 2013 10:42:01 +0200 Subject: [PATCH 29/57] remove ar5416ResetTsf Signed-off-by: Oleksij Rempel --- target_firmware/wlan/ah.h | 1 - target_firmware/wlan/ar5416_hw.c | 17 ----------------- 2 files changed, 18 deletions(-) diff --git a/target_firmware/wlan/ah.h b/target_firmware/wlan/ah.h index 6694d76..0633382 100755 --- a/target_firmware/wlan/ah.h +++ b/target_firmware/wlan/ah.h @@ -442,7 +442,6 @@ struct ath_hal a_uint32_t filter0, a_uint32_t filter1); u_int64_t __ahdecl(*ah_getTsf64)(struct ath_hal*); - void __ahdecl(*ah_resetTsf)(struct ath_hal*); /* Target receive Functions */ a_uint32_t __ahdecl(*ah_getRxDP)(struct ath_hal*); diff --git a/target_firmware/wlan/ar5416_hw.c b/target_firmware/wlan/ar5416_hw.c index c58aac9..c3e08ea 100644 --- a/target_firmware/wlan/ar5416_hw.c +++ b/target_firmware/wlan/ar5416_hw.c @@ -66,7 +66,6 @@ static const struct ath_hal_private ar5416hal_10 = {{ /* Misc Functions */ .ah_getTsf64 = ar5416GetTsf64, - .ah_resetTsf = ar5416ResetTsf, .ah_setRxFilter = ar5416SetRxFilter, /* RX Functions */ @@ -298,22 +297,6 @@ u_int64_t ar5416GetTsf64(struct ath_hal *ah) return tsf; } -void ar5416ResetTsf(struct ath_hal *ah) -{ - a_int32_t count; - - count = 0; - - while (OS_REG_READ(ah, AR_SLP32_MODE) & AR_SLP32_TSF_WRITE_STATUS) { - count++; - if (count > 10) { - break; - } - OS_DELAY(10); - } - OS_REG_WRITE(ah, AR_RESET_TSF, AR_RESET_TSF_ONCE); -} - /******/ /* RX */ /******/ From 85ca555c7b110fcb1b6ca8e988c1bff77daf0ee4 Mon Sep 17 00:00:00 2001 From: Oleksij Rempel Date: Sat, 11 May 2013 10:44:39 +0200 Subject: [PATCH 30/57] use ah_setRxFilter directly Signed-off-by: Oleksij Rempel --- target_firmware/wlan/if_ath.c | 2 +- target_firmware/wlan/if_athvar.h | 2 -- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/target_firmware/wlan/if_ath.c b/target_firmware/wlan/if_ath.c index bdadbf0..f228a14 100755 --- a/target_firmware/wlan/if_ath.c +++ b/target_firmware/wlan/if_ath.c @@ -1618,7 +1618,7 @@ static void ath_stoprecv_tgt(void *Context, A_UINT16 Command, struct ath_hal *ah = sc->sc_ah; ath_hal_stoppcurecv(ah); - ath_hal_setrxfilter(ah, 0); + ah->ah_setRxFilter(ah, 0); ath_hal_stopdmarecv(ah); sc->sc_rxlink = NULL; diff --git a/target_firmware/wlan/if_athvar.h b/target_firmware/wlan/if_athvar.h index 9a94cfd..6a505de 100755 --- a/target_firmware/wlan/if_athvar.h +++ b/target_firmware/wlan/if_athvar.h @@ -539,8 +539,6 @@ a_uint8_t ath_get_minrateidx(struct ath_softc_tgt *sc, struct ath_vap_target *av (ath_hal_getcapability(_ah, HAL_CAP_HT, 0, NULL) == HAL_OK) #define ath_hal_getrtsaggrlimit(_ah, _pv) \ (ath_hal_getcapability(_ah, HAL_CAP_RTS_AGGR_LIMIT, 0, _pv) == HAL_OK) -#define ath_hal_setrxfilter(_ah, _filter) \ - ((*(_ah)->ah_setRxFilter)((_ah), (_filter))) #define ath_hal_intrset(_ah, _mask) \ ((*(_ah)->ah_setInterrupts)((_ah), (_mask))) #define ath_hal_set11n_aggr_first(_ah, _ds, _aggrlen, _numdelims) \ From a4470e15a89a60ef995c792b44ea9843d533fb21 Mon Sep 17 00:00:00 2001 From: Oleksij Rempel Date: Sat, 11 May 2013 10:47:26 +0200 Subject: [PATCH 31/57] remove ar5416GetRxDP Signed-off-by: Oleksij Rempel --- target_firmware/wlan/ah.h | 1 - target_firmware/wlan/ar5416_hw.c | 8 -------- 2 files changed, 9 deletions(-) diff --git a/target_firmware/wlan/ah.h b/target_firmware/wlan/ah.h index 0633382..4e3ab42 100755 --- a/target_firmware/wlan/ah.h +++ b/target_firmware/wlan/ah.h @@ -444,7 +444,6 @@ struct ath_hal u_int64_t __ahdecl(*ah_getTsf64)(struct ath_hal*); /* Target receive Functions */ - a_uint32_t __ahdecl(*ah_getRxDP)(struct ath_hal*); void __ahdecl(*ah_setRxDP)(struct ath_hal*, a_uint32_t rxdp); HAL_BOOL __ahdecl(*ah_setupRxDesc)(struct ath_hal *, struct ath_rx_desc *, a_uint32_t size, a_uint32_t flags); diff --git a/target_firmware/wlan/ar5416_hw.c b/target_firmware/wlan/ar5416_hw.c index c3e08ea..23ca493 100644 --- a/target_firmware/wlan/ar5416_hw.c +++ b/target_firmware/wlan/ar5416_hw.c @@ -69,7 +69,6 @@ static const struct ath_hal_private ar5416hal_10 = {{ .ah_setRxFilter = ar5416SetRxFilter, /* RX Functions */ - .ah_getRxDP = ar5416GetRxDP, .ah_setRxDP = ar5416SetRxDP, .ah_stopDmaReceive = ar5416StopDmaReceive, .ah_enableReceive = ar5416EnableReceive, @@ -300,13 +299,6 @@ u_int64_t ar5416GetTsf64(struct ath_hal *ah) /******/ /* RX */ /******/ - -a_uint32_t ar5416GetRxDP(struct ath_hal *ath) -{ - return OS_REG_READ(ath, AR_RXDP); -} - - void ar5416SetRxDP(struct ath_hal *ah, a_uint32_t rxdp) { OS_REG_WRITE(ah, AR_RXDP, rxdp); From 65b99a2b8bb5218d9d98a8c248dff3af71de0b6a Mon Sep 17 00:00:00 2001 From: Oleksij Rempel Date: Sat, 11 May 2013 10:50:11 +0200 Subject: [PATCH 32/57] use ah_setRxDP directly Signed-off-by: Oleksij Rempel --- target_firmware/wlan/if_ath.c | 4 ++-- target_firmware/wlan/if_athvar.h | 2 -- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/target_firmware/wlan/if_ath.c b/target_firmware/wlan/if_ath.c index f228a14..ce29af4 100755 --- a/target_firmware/wlan/if_ath.c +++ b/target_firmware/wlan/if_ath.c @@ -271,7 +271,7 @@ static a_int32_t ath_rxdesc_init(struct ath_softc_tgt *sc, struct ath_rx_desc *d 0); if (sc->sc_rxlink == NULL) { - ath_hal_putrxbuf(ah, ds->ds_daddr); + ah->ah_setRxDP(ah, ds->ds_daddr); } else { *sc->sc_rxlink = ds->ds_daddr; @@ -472,7 +472,7 @@ static a_int32_t ath_startrecv(struct ath_softc_tgt *sc) } ds = asf_tailq_first(&sc->sc_rxdesc); - ath_hal_putrxbuf(ah, ds->ds_daddr); + ah->ah_setRxDP(ah, ds->ds_daddr); return 0; } diff --git a/target_firmware/wlan/if_athvar.h b/target_firmware/wlan/if_athvar.h index 6a505de..3a1402f 100755 --- a/target_firmware/wlan/if_athvar.h +++ b/target_firmware/wlan/if_athvar.h @@ -527,8 +527,6 @@ a_uint8_t ath_get_minrateidx(struct ath_softc_tgt *sc, struct ath_vap_target *av ((*(_ah)->ah_fillTxDesc)((_ah), (_ds), (_l), (_first), (_last), (_ds0))) #define ath_hal_txprocdesc(_ah, _ds) \ ((*(_ah)->ah_procTxDesc)((_ah), (_ds))) -#define ath_hal_putrxbuf(_ah, _bufaddr) \ - ((*(_ah)->ah_setRxDP)((_ah), (_bufaddr))) #define ath_hal_rxena(_ah) \ ((*(_ah)->ah_enableReceive)((_ah))) #define ath_hal_stopdmarecv(_ah) \ From c50852a192a320ea25a7923eac2c34cf87025af8 Mon Sep 17 00:00:00 2001 From: Oleksij Rempel Date: Sat, 11 May 2013 10:52:30 +0200 Subject: [PATCH 33/57] use ah_stopDmaReceive directly Signed-off-by: Oleksij Rempel --- target_firmware/wlan/if_ath.c | 2 +- target_firmware/wlan/if_athvar.h | 2 -- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/target_firmware/wlan/if_ath.c b/target_firmware/wlan/if_ath.c index ce29af4..a024574 100755 --- a/target_firmware/wlan/if_ath.c +++ b/target_firmware/wlan/if_ath.c @@ -1619,7 +1619,7 @@ static void ath_stoprecv_tgt(void *Context, A_UINT16 Command, ath_hal_stoppcurecv(ah); ah->ah_setRxFilter(ah, 0); - ath_hal_stopdmarecv(ah); + ah->ah_stopDmaReceive(ah); sc->sc_rxlink = NULL; wmi_cmd_rsp(sc->tgt_wmi_handle, Command, SeqNo, NULL, 0); diff --git a/target_firmware/wlan/if_athvar.h b/target_firmware/wlan/if_athvar.h index 3a1402f..2f9d0c9 100755 --- a/target_firmware/wlan/if_athvar.h +++ b/target_firmware/wlan/if_athvar.h @@ -529,8 +529,6 @@ a_uint8_t ath_get_minrateidx(struct ath_softc_tgt *sc, struct ath_vap_target *av ((*(_ah)->ah_procTxDesc)((_ah), (_ds))) #define ath_hal_rxena(_ah) \ ((*(_ah)->ah_enableReceive)((_ah))) -#define ath_hal_stopdmarecv(_ah) \ - ((*(_ah)->ah_stopDmaReceive)((_ah))) #define ath_hal_stoppcurecv(_ah) \ ((*(_ah)->ah_stopPcuReceive)((_ah))) #define ath_hal_htsupported(_ah) \ From 726def25cc87d572a92b341b52125d74f23ab8d9 Mon Sep 17 00:00:00 2001 From: Oleksij Rempel Date: Sat, 11 May 2013 10:54:18 +0200 Subject: [PATCH 34/57] use ah_enableReceive directly Signed-off-by: Oleksij Rempel --- target_firmware/wlan/if_ath.c | 2 +- target_firmware/wlan/if_athvar.h | 2 -- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/target_firmware/wlan/if_ath.c b/target_firmware/wlan/if_ath.c index a024574..5c2cff8 100755 --- a/target_firmware/wlan/if_ath.c +++ b/target_firmware/wlan/if_ath.c @@ -277,7 +277,7 @@ static a_int32_t ath_rxdesc_init(struct ath_softc_tgt *sc, struct ath_rx_desc *d *sc->sc_rxlink = ds->ds_daddr; } sc->sc_rxlink = &ds->ds_link; - ath_hal_rxena(ah); + ah->ah_enableReceive(ah); return 0; } diff --git a/target_firmware/wlan/if_athvar.h b/target_firmware/wlan/if_athvar.h index 2f9d0c9..1609318 100755 --- a/target_firmware/wlan/if_athvar.h +++ b/target_firmware/wlan/if_athvar.h @@ -527,8 +527,6 @@ a_uint8_t ath_get_minrateidx(struct ath_softc_tgt *sc, struct ath_vap_target *av ((*(_ah)->ah_fillTxDesc)((_ah), (_ds), (_l), (_first), (_last), (_ds0))) #define ath_hal_txprocdesc(_ah, _ds) \ ((*(_ah)->ah_procTxDesc)((_ah), (_ds))) -#define ath_hal_rxena(_ah) \ - ((*(_ah)->ah_enableReceive)((_ah))) #define ath_hal_stoppcurecv(_ah) \ ((*(_ah)->ah_stopPcuReceive)((_ah))) #define ath_hal_htsupported(_ah) \ From 5bed391ecc860db906301d3cf23a4898c17c2e0b Mon Sep 17 00:00:00 2001 From: Oleksij Rempel Date: Sat, 11 May 2013 10:59:47 +0200 Subject: [PATCH 35/57] remove ar5416StartPcuReceive Signed-off-by: Oleksij Rempel --- target_firmware/wlan/ah.h | 1 - target_firmware/wlan/ar5416_hw.c | 7 ------- 2 files changed, 8 deletions(-) diff --git a/target_firmware/wlan/ah.h b/target_firmware/wlan/ah.h index 4e3ab42..eac8118 100755 --- a/target_firmware/wlan/ah.h +++ b/target_firmware/wlan/ah.h @@ -454,7 +454,6 @@ struct ath_hal struct ath_desc *nds, struct ath_rx_status *rx_stats); HAL_BOOL __ahdecl(*ah_stopDmaReceive)(struct ath_hal*); - void __ahdecl(*ah_startPcuReceive)(struct ath_hal*); void __ahdecl(*ah_stopPcuReceive)(struct ath_hal*); void __ahdecl(*ah_enableReceive)(struct ath_hal*); diff --git a/target_firmware/wlan/ar5416_hw.c b/target_firmware/wlan/ar5416_hw.c index 23ca493..7c271ce 100644 --- a/target_firmware/wlan/ar5416_hw.c +++ b/target_firmware/wlan/ar5416_hw.c @@ -72,7 +72,6 @@ static const struct ath_hal_private ar5416hal_10 = {{ .ah_setRxDP = ar5416SetRxDP, .ah_stopDmaReceive = ar5416StopDmaReceive, .ah_enableReceive = ar5416EnableReceive, - .ah_startPcuReceive = ar5416StartPcuReceive, .ah_stopPcuReceive = ar5416StopPcuReceive, /* Interrupt Functions */ @@ -353,12 +352,6 @@ HAL_BOOL ar5416SetMulticastFilterIndex(struct ath_hal *ah, a_uint32_t ix) return AH_TRUE; } -void ar5416StartPcuReceive(struct ath_hal *ah) -{ - OS_REG_CLR_BIT(ah, AR_DIAG_SW, - (AR_DIAG_RX_DIS | AR_DIAG_RX_ABORT)); -} - void ar5416SetRxFilter(struct ath_hal *ah, a_uint32_t bits) { a_uint32_t phybits; From 9ba327882cd3ace17ca5c5e390dca249b39cc9ad Mon Sep 17 00:00:00 2001 From: Oleksij Rempel Date: Sat, 11 May 2013 11:01:43 +0200 Subject: [PATCH 36/57] use ah_stopPcuReceive directly Signed-off-by: Oleksij Rempel --- target_firmware/wlan/if_ath.c | 2 +- target_firmware/wlan/if_athvar.h | 2 -- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/target_firmware/wlan/if_ath.c b/target_firmware/wlan/if_ath.c index 5c2cff8..b44d299 100755 --- a/target_firmware/wlan/if_ath.c +++ b/target_firmware/wlan/if_ath.c @@ -1617,7 +1617,7 @@ static void ath_stoprecv_tgt(void *Context, A_UINT16 Command, struct ath_softc_tgt *sc = (struct ath_softc_tgt *)Context; struct ath_hal *ah = sc->sc_ah; - ath_hal_stoppcurecv(ah); + ah->ah_stopPcuReceive(ah); ah->ah_setRxFilter(ah, 0); ah->ah_stopDmaReceive(ah); diff --git a/target_firmware/wlan/if_athvar.h b/target_firmware/wlan/if_athvar.h index 1609318..4a014cc 100755 --- a/target_firmware/wlan/if_athvar.h +++ b/target_firmware/wlan/if_athvar.h @@ -527,8 +527,6 @@ a_uint8_t ath_get_minrateidx(struct ath_softc_tgt *sc, struct ath_vap_target *av ((*(_ah)->ah_fillTxDesc)((_ah), (_ds), (_l), (_first), (_last), (_ds0))) #define ath_hal_txprocdesc(_ah, _ds) \ ((*(_ah)->ah_procTxDesc)((_ah), (_ds))) -#define ath_hal_stoppcurecv(_ah) \ - ((*(_ah)->ah_stopPcuReceive)((_ah))) #define ath_hal_htsupported(_ah) \ (ath_hal_getcapability(_ah, HAL_CAP_HT, 0, NULL) == HAL_OK) #define ath_hal_getrtsaggrlimit(_ah, _pv) \ From a7cdc4fc47c51b777c1c6abd432d2381e8ff97a5 Mon Sep 17 00:00:00 2001 From: Oleksij Rempel Date: Sat, 11 May 2013 11:04:24 +0200 Subject: [PATCH 37/57] use ah_isInterruptPending directly Signed-off-by: Oleksij Rempel --- target_firmware/wlan/if_ath.c | 2 +- target_firmware/wlan/if_athvar.h | 2 -- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/target_firmware/wlan/if_ath.c b/target_firmware/wlan/if_ath.c index b44d299..c61832e 100755 --- a/target_firmware/wlan/if_ath.c +++ b/target_firmware/wlan/if_ath.c @@ -1021,7 +1021,7 @@ adf_os_irq_resp_t ath_intr(adf_drv_handle_t hdl) if (sc->sc_invalid) return ADF_OS_IRQ_NONE; - if (!ath_hal_intrpend(ah)) + if (!ah->ah_isInterruptPending(ah)) return ADF_OS_IRQ_NONE; ath_hal_getisr(ah, &status); diff --git a/target_firmware/wlan/if_athvar.h b/target_firmware/wlan/if_athvar.h index 4a014cc..dbb69cd 100755 --- a/target_firmware/wlan/if_athvar.h +++ b/target_firmware/wlan/if_athvar.h @@ -491,8 +491,6 @@ a_uint8_t ath_get_minrateidx(struct ath_softc_tgt *sc, struct ath_vap_target *av #define ath_hal_intrset(_ah, _mask) \ ((*(_ah)->ah_setInterrupts)((_ah), (_mask))) -#define ath_hal_intrpend(_ah) \ - ((*(_ah)->ah_isInterruptPending)((_ah))) #define ath_hal_getisr(_ah, _pmask) \ ((*(_ah)->ah_getPendingInterrupts)((_ah), (_pmask))) #define ath_hal_setuprxdesc(_ah, _ds, _size, _intreq) \ From a7874ac222cc78c637a561036978106452b5c0a1 Mon Sep 17 00:00:00 2001 From: Oleksij Rempel Date: Sat, 11 May 2013 11:05:53 +0200 Subject: [PATCH 38/57] use ah_getPendingInterrupts directly Signed-off-by: Oleksij Rempel --- target_firmware/wlan/if_ath.c | 2 +- target_firmware/wlan/if_athvar.h | 2 -- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/target_firmware/wlan/if_ath.c b/target_firmware/wlan/if_ath.c index c61832e..3907262 100755 --- a/target_firmware/wlan/if_ath.c +++ b/target_firmware/wlan/if_ath.c @@ -1024,7 +1024,7 @@ adf_os_irq_resp_t ath_intr(adf_drv_handle_t hdl) if (!ah->ah_isInterruptPending(ah)) return ADF_OS_IRQ_NONE; - ath_hal_getisr(ah, &status); + ah->ah_getPendingInterrupts(ah, &status); status &= sc->sc_imask; diff --git a/target_firmware/wlan/if_athvar.h b/target_firmware/wlan/if_athvar.h index dbb69cd..a519513 100755 --- a/target_firmware/wlan/if_athvar.h +++ b/target_firmware/wlan/if_athvar.h @@ -491,8 +491,6 @@ a_uint8_t ath_get_minrateidx(struct ath_softc_tgt *sc, struct ath_vap_target *av #define ath_hal_intrset(_ah, _mask) \ ((*(_ah)->ah_setInterrupts)((_ah), (_mask))) -#define ath_hal_getisr(_ah, _pmask) \ - ((*(_ah)->ah_getPendingInterrupts)((_ah), (_pmask))) #define ath_hal_setuprxdesc(_ah, _ds, _size, _intreq) \ ((*(_ah)->ah_setupRxDesc)((_ah), (_ds), (_size), (_intreq))) #define ath_hal_rxprocdescfast(_ah, _ds, _dspa, _dsnext, _rx_stats) \ From 230ec859e99b54d1742c42d9f5d1d58a3b5e1d04 Mon Sep 17 00:00:00 2001 From: Oleksij Rempel Date: Sat, 11 May 2013 11:07:35 +0200 Subject: [PATCH 39/57] remove ar5416GetInterrupts Signed-off-by: Oleksij Rempel --- target_firmware/wlan/ah.h | 1 - target_firmware/wlan/ar5416_hw.c | 6 ------ 2 files changed, 7 deletions(-) diff --git a/target_firmware/wlan/ah.h b/target_firmware/wlan/ah.h index eac8118..606058e 100755 --- a/target_firmware/wlan/ah.h +++ b/target_firmware/wlan/ah.h @@ -460,7 +460,6 @@ struct ath_hal /* Interrupt functions */ HAL_BOOL __ahdecl(*ah_isInterruptPending)(struct ath_hal*); HAL_BOOL __ahdecl(*ah_getPendingInterrupts)(struct ath_hal*, HAL_INT*); - HAL_INT __ahdecl(*ah_getInterrupts)(struct ath_hal*); HAL_INT __ahdecl(*ah_setInterrupts)(struct ath_hal*, HAL_INT); }; diff --git a/target_firmware/wlan/ar5416_hw.c b/target_firmware/wlan/ar5416_hw.c index 7c271ce..fcec3bf 100644 --- a/target_firmware/wlan/ar5416_hw.c +++ b/target_firmware/wlan/ar5416_hw.c @@ -77,7 +77,6 @@ static const struct ath_hal_private ar5416hal_10 = {{ /* Interrupt Functions */ .ah_isInterruptPending = ar5416IsInterruptPending, .ah_getPendingInterrupts = ar5416GetPendingInterrupts, - .ah_getInterrupts = ar5416GetInterrupts, .ah_setInterrupts = ar5416SetInterrupts, }, }; @@ -222,11 +221,6 @@ HAL_BOOL ar5416GetPendingInterrupts(struct ath_hal *ah, HAL_INT *masked) return AH_TRUE; } -HAL_INT ar5416GetInterrupts(struct ath_hal *ah) -{ - return AH5416(ah)->ah_maskReg; -} - HAL_INT ar5416SetInterrupts(struct ath_hal *ah, HAL_INT ints) { From 25933412d251021341fcec445c4e013e71052f29 Mon Sep 17 00:00:00 2001 From: Oleksij Rempel Date: Sat, 11 May 2013 11:13:57 +0200 Subject: [PATCH 40/57] use ah_setInterrupts directly Signed-off-by: Oleksij Rempel --- target_firmware/wlan/if_ath.c | 14 +++++++------- target_firmware/wlan/if_athvar.h | 4 ---- target_firmware/wlan/if_owl.c | 5 +++-- 3 files changed, 10 insertions(+), 13 deletions(-) diff --git a/target_firmware/wlan/if_ath.c b/target_firmware/wlan/if_ath.c index 3907262..9d0f8d4 100755 --- a/target_firmware/wlan/if_ath.c +++ b/target_firmware/wlan/if_ath.c @@ -522,7 +522,7 @@ static void ath_tgt_rx_tasklet(TQUEUE_ARG data) } while(1); sc->sc_imask |= HAL_INT_RX; - ath_hal_intrset(ah, sc->sc_imask); + ah->ah_setInterrupts(ah, sc->sc_imask); } /*******************/ @@ -1029,7 +1029,7 @@ adf_os_irq_resp_t ath_intr(adf_drv_handle_t hdl) status &= sc->sc_imask; if (status & HAL_INT_FATAL) { - ath_hal_intrset(ah, 0); + ah->ah_setInterrupts(ah, 0); ATH_SCHEDULE_TQUEUE(sc->sc_dev, &sc->sc_fataltq); } else { if (status & HAL_INT_SWBA) { @@ -1061,7 +1061,7 @@ adf_os_irq_resp_t ath_intr(adf_drv_handle_t hdl) ath_uapsd_processtriggers(sc); sc->sc_imask &= ~HAL_INT_RX; - ath_hal_intrset(ah, sc->sc_imask); + ah->ah_setInterrupts(ah, sc->sc_imask); ATH_SCHEDULE_TQUEUE(sc->sc_dev, &sc->sc_rxtq); } @@ -1127,7 +1127,7 @@ static void ath_enable_intr_tgt(void *Context, A_UINT16 Command, sc->sc_imask |= HAL_INT_BMISS; } - ath_hal_intrset(ah, sc->sc_imask); + ah->ah_setInterrupts(ah, sc->sc_imask); wmi_cmd_rsp(sc->tgt_wmi_handle, Command, SeqNo,NULL, 0); } @@ -1147,7 +1147,7 @@ static void ath_init_tgt(void *Context, A_UINT16 Command, sc->sc_imask |= HAL_INT_CST; adf_os_setup_intr(sc->sc_dev, ath_intr); - ath_hal_intrset(ah, sc->sc_imask); + ah->ah_setInterrupts(ah, sc->sc_imask); wmi_cmd_rsp(sc->tgt_wmi_handle, Command, SeqNo, NULL, 0); } @@ -1516,7 +1516,7 @@ static void ath_disable_intr_tgt(void *Context, A_UINT16 Command, struct ath_softc_tgt *sc = (struct ath_softc_tgt *)Context; struct ath_hal *ah = sc->sc_ah; - ath_hal_intrset(ah, 0); + ah->ah_setInterrupts(ah, 0); wmi_cmd_rsp(sc->tgt_wmi_handle, Command, SeqNo,NULL, 0); } @@ -1931,7 +1931,7 @@ a_int32_t ath_tgt_attach(a_uint32_t devid, struct ath_softc_tgt *sc, adf_os_devi ath_tgt_txq_setup(sc); sc->sc_imask =0; - ath_hal_intrset(ah,0); + ah->ah_setInterrupts(ah, 0); return 0; bad: diff --git a/target_firmware/wlan/if_athvar.h b/target_firmware/wlan/if_athvar.h index a519513..d553189 100755 --- a/target_firmware/wlan/if_athvar.h +++ b/target_firmware/wlan/if_athvar.h @@ -489,8 +489,6 @@ typedef enum { a_uint8_t ath_get_minrateidx(struct ath_softc_tgt *sc, struct ath_vap_target *avp); -#define ath_hal_intrset(_ah, _mask) \ - ((*(_ah)->ah_setInterrupts)((_ah), (_mask))) #define ath_hal_setuprxdesc(_ah, _ds, _size, _intreq) \ ((*(_ah)->ah_setupRxDesc)((_ah), (_ds), (_size), (_intreq))) #define ath_hal_rxprocdescfast(_ah, _ds, _dspa, _dsnext, _rx_stats) \ @@ -527,8 +525,6 @@ a_uint8_t ath_get_minrateidx(struct ath_softc_tgt *sc, struct ath_vap_target *av (ath_hal_getcapability(_ah, HAL_CAP_HT, 0, NULL) == HAL_OK) #define ath_hal_getrtsaggrlimit(_ah, _pv) \ (ath_hal_getcapability(_ah, HAL_CAP_RTS_AGGR_LIMIT, 0, _pv) == HAL_OK) -#define ath_hal_intrset(_ah, _mask) \ - ((*(_ah)->ah_setInterrupts)((_ah), (_mask))) #define ath_hal_set11n_aggr_first(_ah, _ds, _aggrlen, _numdelims) \ ((*(_ah)->ah_set11nAggrFirst)(_ah, _ds, _aggrlen, _numdelims)) #define ath_hal_set11n_aggr_middle(_ah, _ds, _numdelims) \ diff --git a/target_firmware/wlan/if_owl.c b/target_firmware/wlan/if_owl.c index 3d4744d..f5ce647 100755 --- a/target_firmware/wlan/if_owl.c +++ b/target_firmware/wlan/if_owl.c @@ -616,9 +616,10 @@ void ath_tx_status_send(struct ath_softc_tgt *sc) static void owltgt_tx_process_cabq(struct ath_softc_tgt *sc, struct ath_txq *txq) { - ath_hal_intrset(sc->sc_ah, sc->sc_imask & ~HAL_INT_SWBA); + struct ath_hal *ah = sc->sc_ah; + ah->ah_setInterrupts(ah, sc->sc_imask & ~HAL_INT_SWBA); owltgt_tx_processq(sc, txq, OWL_TXQ_ACTIVE); - ath_hal_intrset(sc->sc_ah, sc->sc_imask); + ah->ah_setInterrupts(ah, sc->sc_imask); } void owl_tgt_tx_tasklet(TQUEUE_ARG data) From 68c955d747ed599a619c192da93c019bf7848631 Mon Sep 17 00:00:00 2001 From: Oleksij Rempel Date: Sat, 11 May 2013 12:00:54 +0200 Subject: [PATCH 41/57] use ah_set11nTxDesc directly Signed-off-by: Oleksij Rempel --- target_firmware/wlan/if_athvar.h | 4 ---- target_firmware/wlan/if_owl.c | 3 ++- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/target_firmware/wlan/if_athvar.h b/target_firmware/wlan/if_athvar.h index d553189..d84176b 100755 --- a/target_firmware/wlan/if_athvar.h +++ b/target_firmware/wlan/if_athvar.h @@ -493,10 +493,6 @@ a_uint8_t ath_get_minrateidx(struct ath_softc_tgt *sc, struct ath_vap_target *av ((*(_ah)->ah_setupRxDesc)((_ah), (_ds), (_size), (_intreq))) #define ath_hal_rxprocdescfast(_ah, _ds, _dspa, _dsnext, _rx_stats) \ ((*(_ah)->ah_procRxDescFast)((_ah), (_ds), (_dspa), (_dsnext), (_rx_stats))) -#define ath_hal_set11n_txdesc(_ah, _ds, _pktlen, _type, _txpower,\ - _keyix, _keytype, _flags) \ - ((*(_ah)->ah_set11nTxDesc)(_ah, _ds, _pktlen, _type, _txpower, _keyix,\ - _keytype, _flags)) #define ath_hal_set11n_ratescenario(_ah, _ds, _durupdate, _rtsctsrate, _rtsctsduration, \ _series, _nseries, _flags) \ ((*(_ah)->ah_set11nRateScenario)(_ah, _ds, _durupdate, _rtsctsrate, _rtsctsduration,\ diff --git a/target_firmware/wlan/if_owl.c b/target_firmware/wlan/if_owl.c index f5ce647..23fa9f6 100755 --- a/target_firmware/wlan/if_owl.c +++ b/target_firmware/wlan/if_owl.c @@ -263,6 +263,7 @@ static void ath_filltxdesc(struct ath_softc_tgt *sc, struct ath_tx_buf *bf) static void ath_tx_tgt_setds(struct ath_softc_tgt *sc, struct ath_tx_buf *bf) { struct ath_tx_desc *ds = bf->bf_desc; + struct ath_hal *ah = sc->sc_ah; switch (bf->bf_protmode) { case IEEE80211_PROT_RTSCTS: @@ -275,7 +276,7 @@ static void ath_tx_tgt_setds(struct ath_softc_tgt *sc, struct ath_tx_buf *bf) break; } - ath_hal_set11n_txdesc(sc->sc_ah, ds + ah->ah_set11nTxDesc(ah, ds , bf->bf_pktlen , bf->bf_atype , 60 From 75f847430fd5a622df5bb655d141326f24ec39ff Mon Sep 17 00:00:00 2001 From: Oleksij Rempel Date: Sat, 11 May 2013 12:03:38 +0200 Subject: [PATCH 42/57] use ah_set11nRateScenario directly Signed-off-by: Oleksij Rempel --- target_firmware/wlan/if_ath.c | 2 +- target_firmware/wlan/if_athvar.h | 4 ---- target_firmware/wlan/if_owl.c | 7 ++++--- 3 files changed, 5 insertions(+), 8 deletions(-) diff --git a/target_firmware/wlan/if_ath.c b/target_firmware/wlan/if_ath.c index 9d0f8d4..41ba354 100755 --- a/target_firmware/wlan/if_ath.c +++ b/target_firmware/wlan/if_ath.c @@ -580,7 +580,7 @@ static void ath_beacon_setup(struct ath_softc_tgt *sc, series[0].Rate = rate; series[0].ChSel = sc->sc_ic.ic_tx_chainmask; series[0].RateFlags = 0; - ath_hal_set11n_ratescenario(ah, ds, 0, 0, 0, series, 4, 0); + ah->ah_set11nRateScenario(ah, ds, 0, 0, 0, series, 4, 0); } static void ath_tgt_send_beacon(struct ath_softc_tgt *sc, adf_nbuf_t bc_hdr, diff --git a/target_firmware/wlan/if_athvar.h b/target_firmware/wlan/if_athvar.h index d84176b..b69817c 100755 --- a/target_firmware/wlan/if_athvar.h +++ b/target_firmware/wlan/if_athvar.h @@ -493,10 +493,6 @@ a_uint8_t ath_get_minrateidx(struct ath_softc_tgt *sc, struct ath_vap_target *av ((*(_ah)->ah_setupRxDesc)((_ah), (_ds), (_size), (_intreq))) #define ath_hal_rxprocdescfast(_ah, _ds, _dspa, _dsnext, _rx_stats) \ ((*(_ah)->ah_procRxDescFast)((_ah), (_ds), (_dspa), (_dsnext), (_rx_stats))) -#define ath_hal_set11n_ratescenario(_ah, _ds, _durupdate, _rtsctsrate, _rtsctsduration, \ - _series, _nseries, _flags) \ - ((*(_ah)->ah_set11nRateScenario)(_ah, _ds, _durupdate, _rtsctsrate, _rtsctsduration,\ - _series, _nseries, _flags)) #define ath_hal_clr11n_aggr(_ah, _ds) \ ((*(_ah)->ah_clr11nAggr)(_ah, _ds)) #define ath_hal_set11n_burstduration(_ah, _ds, _burstduration) \ diff --git a/target_firmware/wlan/if_owl.c b/target_firmware/wlan/if_owl.c index 23fa9f6..657c89b 100755 --- a/target_firmware/wlan/if_owl.c +++ b/target_firmware/wlan/if_owl.c @@ -443,7 +443,7 @@ static void ath_buf_set_rate(struct ath_softc_tgt *sc, struct ath_tx_buf *bf) rtsctsrate = rt->info[cix].rateCode | (bf->bf_shpream ? rt->info[cix].shortPreamble : 0); - ath_hal_set11n_ratescenario(ah, ds, 1, + ah->ah_set11nRateScenario(ah, ds, 1, rtsctsrate, ctsduration, series, 4, flags); @@ -1231,7 +1231,7 @@ ath_tgt_send_mgt(struct ath_softc_tgt *sc,adf_nbuf_t hdr_buf, adf_nbuf_t skb, series[i].ChSel = sc->sc_ic.ic_tx_chainmask; series[i].RateFlags = 0; } - ath_hal_set11n_ratescenario(ah, ds, 0, ctsrate, ctsduration, series, 4, 0); + ah->ah_set11nRateScenario(ah, ds, 0, ctsrate, ctsduration, series, 4, 0); ath_tgt_txqaddbuf(sc, txq, bf, bf->bf_lastds); return; @@ -2081,6 +2081,7 @@ static void ath_bar_tx(struct ath_softc_tgt *sc, struct ieee80211_frame_bar *bar; u_int8_t min_rate; struct ath_tx_desc *ds, *ds0; + struct ath_hal *ah = sc->sc_ah; HAL_11N_RATE_SERIES series[4]; int i = 0; adf_nbuf_queue_t skbhead; @@ -2152,6 +2153,6 @@ static void ath_bar_tx(struct ath_softc_tgt *sc, series[i].ChSel = sc->sc_ic.ic_tx_chainmask; } - ath_hal_set11n_ratescenario(sc->sc_ah, bf->bf_desc, 0, 0, 0, series, 4, 4); + ah->ah_set11nRateScenario(ah, bf->bf_desc, 0, 0, 0, series, 4, 4); ath_tgt_txq_add_ucast(sc, bf); } From 008f512abedd72a3f3990b86af07486aa5835886 Mon Sep 17 00:00:00 2001 From: Oleksij Rempel Date: Sat, 11 May 2013 12:06:34 +0200 Subject: [PATCH 43/57] use ah_set11nAggrFirst directly Signed-off-by: Oleksij Rempel --- target_firmware/wlan/if_athvar.h | 2 -- target_firmware/wlan/if_owl.c | 3 ++- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/target_firmware/wlan/if_athvar.h b/target_firmware/wlan/if_athvar.h index b69817c..f4ee58b 100755 --- a/target_firmware/wlan/if_athvar.h +++ b/target_firmware/wlan/if_athvar.h @@ -517,8 +517,6 @@ a_uint8_t ath_get_minrateidx(struct ath_softc_tgt *sc, struct ath_vap_target *av (ath_hal_getcapability(_ah, HAL_CAP_HT, 0, NULL) == HAL_OK) #define ath_hal_getrtsaggrlimit(_ah, _pv) \ (ath_hal_getcapability(_ah, HAL_CAP_RTS_AGGR_LIMIT, 0, _pv) == HAL_OK) -#define ath_hal_set11n_aggr_first(_ah, _ds, _aggrlen, _numdelims) \ - ((*(_ah)->ah_set11nAggrFirst)(_ah, _ds, _aggrlen, _numdelims)) #define ath_hal_set11n_aggr_middle(_ah, _ds, _numdelims) \ ((*(_ah)->ah_set11nAggrMiddle)(_ah, _ds, _numdelims)) #define ath_hal_set11n_aggr_last(_ah, _ds) \ diff --git a/target_firmware/wlan/if_owl.c b/target_firmware/wlan/if_owl.c index 657c89b..5a06c59 100755 --- a/target_firmware/wlan/if_owl.c +++ b/target_firmware/wlan/if_owl.c @@ -1379,6 +1379,7 @@ ath_tgt_tx_sched_aggr(struct ath_softc_tgt *sc, ath_atx_tid_t *tid) ath_tx_bufhead bf_q; struct ath_txq *txq = TID_TO_ACTXQ(tid->tidno); struct ath_tx_desc *ds = NULL; + struct ath_hal *ah = sc->sc_ah; int i; @@ -1423,7 +1424,7 @@ ath_tgt_tx_sched_aggr(struct ath_softc_tgt *sc, ath_atx_tid_t *tid) bf->bf_isaggr = 1; ath_buf_set_rate(sc, bf); - ath_hal_set11n_aggr_first(sc->sc_ah, bf->bf_desc, bf->bf_al, + ah->ah_set11nAggrFirst(ah, bf->bf_desc, bf->bf_al, bf->bf_ndelim); bf->bf_lastds = bf_last->bf_lastds; From c7576fc13b69ff104d0b3230aab556e8c4e60bf8 Mon Sep 17 00:00:00 2001 From: Oleksij Rempel Date: Sat, 11 May 2013 12:12:06 +0200 Subject: [PATCH 44/57] use ah_set11nAggrMiddle directly Signed-off-by: Oleksij Rempel --- target_firmware/wlan/if_athvar.h | 2 -- target_firmware/wlan/if_owl.c | 3 ++- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/target_firmware/wlan/if_athvar.h b/target_firmware/wlan/if_athvar.h index f4ee58b..909b3f2 100755 --- a/target_firmware/wlan/if_athvar.h +++ b/target_firmware/wlan/if_athvar.h @@ -517,8 +517,6 @@ a_uint8_t ath_get_minrateidx(struct ath_softc_tgt *sc, struct ath_vap_target *av (ath_hal_getcapability(_ah, HAL_CAP_HT, 0, NULL) == HAL_OK) #define ath_hal_getrtsaggrlimit(_ah, _pv) \ (ath_hal_getcapability(_ah, HAL_CAP_RTS_AGGR_LIMIT, 0, _pv) == HAL_OK) -#define ath_hal_set11n_aggr_middle(_ah, _ds, _numdelims) \ - ((*(_ah)->ah_set11nAggrMiddle)(_ah, _ds, _numdelims)) #define ath_hal_set11n_aggr_last(_ah, _ds) \ ((*(_ah)->ah_set11nAggrLast)(_ah, _ds)) diff --git a/target_firmware/wlan/if_owl.c b/target_firmware/wlan/if_owl.c index 5a06c59..f1876e2 100755 --- a/target_firmware/wlan/if_owl.c +++ b/target_firmware/wlan/if_owl.c @@ -1497,6 +1497,7 @@ int ath_tgt_tx_form_aggr(struct ath_softc_tgt *sc, ath_atx_tid_t *tid, int nframes = 0, rl = 0;; struct ath_tx_desc *ds = NULL; struct ath_tx_buf *bf; + struct ath_hal *ah = sc->sc_ah; u_int16_t aggr_limit = (64*1024 -1), al = 0, bpad = 0, al_delta; u_int16_t h_baw = tid->baw_size/2, prev_al = 0, prev_frames = 0; @@ -1573,7 +1574,7 @@ int ath_tgt_tx_form_aggr(struct ath_softc_tgt *sc, ath_atx_tid_t *tid, bf_prev = bf; for(ds = bf->bf_desc; ds <= bf->bf_lastds; ds++) - ath_hal_set11n_aggr_middle(sc->sc_ah, ds, bf->bf_ndelim); + ah->ah_set11nAggrMiddle(ah, ds, bf->bf_ndelim); } while (!asf_tailq_empty(&tid->buf_q)); From 181753e831eef1e20f209c45c372e65c53ccc3d5 Mon Sep 17 00:00:00 2001 From: Oleksij Rempel Date: Sat, 11 May 2013 12:13:49 +0200 Subject: [PATCH 45/57] use ah_set11nAggrLast directly Signed-off-by: Oleksij Rempel --- target_firmware/wlan/if_athvar.h | 2 -- target_firmware/wlan/if_owl.c | 2 +- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/target_firmware/wlan/if_athvar.h b/target_firmware/wlan/if_athvar.h index 909b3f2..cd56d23 100755 --- a/target_firmware/wlan/if_athvar.h +++ b/target_firmware/wlan/if_athvar.h @@ -517,7 +517,5 @@ a_uint8_t ath_get_minrateidx(struct ath_softc_tgt *sc, struct ath_vap_target *av (ath_hal_getcapability(_ah, HAL_CAP_HT, 0, NULL) == HAL_OK) #define ath_hal_getrtsaggrlimit(_ah, _pv) \ (ath_hal_getcapability(_ah, HAL_CAP_RTS_AGGR_LIMIT, 0, _pv) == HAL_OK) -#define ath_hal_set11n_aggr_last(_ah, _ds) \ - ((*(_ah)->ah_set11nAggrLast)(_ah, _ds)) #endif /* _DEV_ATH_ATHVAR_H */ diff --git a/target_firmware/wlan/if_owl.c b/target_firmware/wlan/if_owl.c index f1876e2..19d7a44 100755 --- a/target_firmware/wlan/if_owl.c +++ b/target_firmware/wlan/if_owl.c @@ -1429,7 +1429,7 @@ ath_tgt_tx_sched_aggr(struct ath_softc_tgt *sc, ath_atx_tid_t *tid) bf->bf_lastds = bf_last->bf_lastds; for (i = 0; i < bf_last->bf_dmamap_info.nsegs; i++) - ath_hal_set11n_aggr_last(sc->sc_ah, &bf_last->bf_descarr[i]); + ah->ah_set11nAggrLast(ah, &bf_last->bf_descarr[i]); if (status == ATH_AGGR_8K_LIMITED) { adf_os_assert(0); From 6fd36fcc0c51ebeaec0d5a37ed6a0c2b44f403ec Mon Sep 17 00:00:00 2001 From: Oleksij Rempel Date: Sat, 11 May 2013 12:17:39 +0200 Subject: [PATCH 46/57] use ah_clr11nAggr directly Signed-off-by: Oleksij Rempel --- target_firmware/wlan/if_athvar.h | 2 -- target_firmware/wlan/if_owl.c | 10 ++++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/target_firmware/wlan/if_athvar.h b/target_firmware/wlan/if_athvar.h index cd56d23..35d48d9 100755 --- a/target_firmware/wlan/if_athvar.h +++ b/target_firmware/wlan/if_athvar.h @@ -493,8 +493,6 @@ a_uint8_t ath_get_minrateidx(struct ath_softc_tgt *sc, struct ath_vap_target *av ((*(_ah)->ah_setupRxDesc)((_ah), (_ds), (_size), (_intreq))) #define ath_hal_rxprocdescfast(_ah, _ds, _dspa, _dsnext, _rx_stats) \ ((*(_ah)->ah_procRxDescFast)((_ah), (_ds), (_dspa), (_dsnext), (_rx_stats))) -#define ath_hal_clr11n_aggr(_ah, _ds) \ - ((*(_ah)->ah_clr11nAggr)(_ah, _ds)) #define ath_hal_set11n_burstduration(_ah, _ds, _burstduration) \ ((*(_ah)->ah_set11nBurstDuration)(_ah, _ds, _burstduration)) #define ath_hal_set11n_virtualmorefrag(_ah, _ds, _vmf) \ diff --git a/target_firmware/wlan/if_owl.c b/target_firmware/wlan/if_owl.c index 19d7a44..a4e3c71 100755 --- a/target_firmware/wlan/if_owl.c +++ b/target_firmware/wlan/if_owl.c @@ -983,9 +983,10 @@ ath_tx_freebuf(struct ath_softc_tgt *sc, struct ath_tx_buf *bf) { a_int32_t i ; struct ath_tx_desc *bfd = NULL; + struct ath_hal *ah = sc->sc_ah; for (bfd = bf->bf_desc, i = 0; i < bf->bf_dmamap_info.nsegs; bfd++, i++) { - ath_hal_clr11n_aggr(sc->sc_ah, bfd); + ah->ah_clr11nAggr(sc->sc_ah, bfd); ath_hal_set11n_burstduration(sc->sc_ah, bfd, 0); ath_hal_set11n_virtualmorefrag(sc->sc_ah, bfd, 0); } @@ -1410,7 +1411,7 @@ ath_tgt_tx_sched_aggr(struct ath_softc_tgt *sc, ath_atx_tid_t *tid) bf->bf_next = NULL; for(ds = bf->bf_desc; ds <= bf->bf_lastds; ds++) - ath_hal_clr11n_aggr(sc->sc_ah, ds); + ah->ah_clr11nAggr(ah, ds); ath_buf_set_rate(sc, bf); bf->bf_txq_add(sc, bf); @@ -1803,12 +1804,13 @@ ath_tx_retry_subframe(struct ath_softc_tgt *sc, struct ath_tx_buf *bf, struct ath_node_target *an = ATH_NODE_TARGET(bf->bf_node); ath_atx_tid_t *tid = ATH_AN_2_TID(an, bf->bf_tidno); struct ath_tx_desc *ds = NULL; + struct ath_hal *ah = sc->sc_ah; int i = 0; __stats(sc, txaggr_compretries); for(ds = bf->bf_desc, i = 0; i < bf->bf_dmamap_info.nsegs; ds++, i++) { - ath_hal_clr11n_aggr(sc->sc_ah, ds); + ah->ah_clr11nAggr(ah, ds); ath_hal_set11n_burstduration(sc->sc_ah, ds, 0); ath_hal_set11n_virtualmorefrag(sc->sc_ah, ds, 0); } @@ -2144,7 +2146,7 @@ static void ath_bar_tx(struct ath_softc_tgt *sc, bf->bf_next = NULL; for (ds0 = ds, i=0; i < bf->bf_dmamap_info.nsegs; ds0++, i++) { - ath_hal_clr11n_aggr(sc->sc_ah, ds0); + ah->ah_clr11nAggr(ah, ds0); } ath_filltxdesc(sc, bf); From 4b7dbbc63efdf6f70c30bbee48d96835e5ab1cb9 Mon Sep 17 00:00:00 2001 From: Oleksij Rempel Date: Sat, 11 May 2013 12:43:07 +0200 Subject: [PATCH 47/57] use ah_set11nBurstDuration directly Signed-off-by: Oleksij Rempel --- target_firmware/wlan/if_athvar.h | 2 -- target_firmware/wlan/if_owl.c | 6 +++--- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/target_firmware/wlan/if_athvar.h b/target_firmware/wlan/if_athvar.h index 35d48d9..6084d9c 100755 --- a/target_firmware/wlan/if_athvar.h +++ b/target_firmware/wlan/if_athvar.h @@ -493,8 +493,6 @@ a_uint8_t ath_get_minrateidx(struct ath_softc_tgt *sc, struct ath_vap_target *av ((*(_ah)->ah_setupRxDesc)((_ah), (_ds), (_size), (_intreq))) #define ath_hal_rxprocdescfast(_ah, _ds, _dspa, _dsnext, _rx_stats) \ ((*(_ah)->ah_procRxDescFast)((_ah), (_ds), (_dspa), (_dsnext), (_rx_stats))) -#define ath_hal_set11n_burstduration(_ah, _ds, _burstduration) \ - ((*(_ah)->ah_set11nBurstDuration)(_ah, _ds, _burstduration)) #define ath_hal_set11n_virtualmorefrag(_ah, _ds, _vmf) \ ((*(_ah)->ah_set11nVirtualMoreFrag)(_ah, _ds, _vmf)) #define ath_hal_setuptxdesc(_ah, _ds, _plen, _hlen, _atype, _txpow, \ diff --git a/target_firmware/wlan/if_owl.c b/target_firmware/wlan/if_owl.c index a4e3c71..0793c41 100755 --- a/target_firmware/wlan/if_owl.c +++ b/target_firmware/wlan/if_owl.c @@ -986,8 +986,8 @@ ath_tx_freebuf(struct ath_softc_tgt *sc, struct ath_tx_buf *bf) struct ath_hal *ah = sc->sc_ah; for (bfd = bf->bf_desc, i = 0; i < bf->bf_dmamap_info.nsegs; bfd++, i++) { - ah->ah_clr11nAggr(sc->sc_ah, bfd); - ath_hal_set11n_burstduration(sc->sc_ah, bfd, 0); + ah->ah_clr11nAggr(ah, bfd); + ah->ah_set11nBurstDuration(ah, bfd, 0); ath_hal_set11n_virtualmorefrag(sc->sc_ah, bfd, 0); } @@ -1811,7 +1811,7 @@ ath_tx_retry_subframe(struct ath_softc_tgt *sc, struct ath_tx_buf *bf, for(ds = bf->bf_desc, i = 0; i < bf->bf_dmamap_info.nsegs; ds++, i++) { ah->ah_clr11nAggr(ah, ds); - ath_hal_set11n_burstduration(sc->sc_ah, ds, 0); + ah->ah_set11nBurstDuration(ah, ds, 0); ath_hal_set11n_virtualmorefrag(sc->sc_ah, ds, 0); } From 525f7fae586943b05a4e146bff4836b3b5fe868e Mon Sep 17 00:00:00 2001 From: Oleksij Rempel Date: Sat, 11 May 2013 12:44:42 +0200 Subject: [PATCH 48/57] use ah_setupRxDesc directly Signed-off-by: Oleksij Rempel --- target_firmware/wlan/if_ath.c | 2 +- target_firmware/wlan/if_athvar.h | 2 -- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/target_firmware/wlan/if_ath.c b/target_firmware/wlan/if_ath.c index 41ba354..7dabb5f 100755 --- a/target_firmware/wlan/if_ath.c +++ b/target_firmware/wlan/if_ath.c @@ -266,7 +266,7 @@ static a_int32_t ath_rxdesc_init(struct ath_softc_tgt *sc, struct ath_rx_desc *d ds->ds_link = 0; adf_nbuf_peek_header(ds->ds_nbuf, &anbdata, &anblen); - ath_hal_setuprxdesc(ah, ds, + ah->ah_setupRxDesc(ah, ds, adf_nbuf_tailroom(ds->ds_nbuf), 0); diff --git a/target_firmware/wlan/if_athvar.h b/target_firmware/wlan/if_athvar.h index 6084d9c..82792f9 100755 --- a/target_firmware/wlan/if_athvar.h +++ b/target_firmware/wlan/if_athvar.h @@ -489,8 +489,6 @@ typedef enum { a_uint8_t ath_get_minrateidx(struct ath_softc_tgt *sc, struct ath_vap_target *avp); -#define ath_hal_setuprxdesc(_ah, _ds, _size, _intreq) \ - ((*(_ah)->ah_setupRxDesc)((_ah), (_ds), (_size), (_intreq))) #define ath_hal_rxprocdescfast(_ah, _ds, _dspa, _dsnext, _rx_stats) \ ((*(_ah)->ah_procRxDescFast)((_ah), (_ds), (_dspa), (_dsnext), (_rx_stats))) #define ath_hal_set11n_virtualmorefrag(_ah, _ds, _vmf) \ From d0629ae408b222de5d9692643a16130abf944e4e Mon Sep 17 00:00:00 2001 From: Oleksij Rempel Date: Sat, 11 May 2013 12:46:19 +0200 Subject: [PATCH 49/57] use ah_procRxDescFast directly Signed-off-by: Oleksij Rempel --- target_firmware/wlan/if_ath.c | 2 +- target_firmware/wlan/if_athvar.h | 2 -- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/target_firmware/wlan/if_ath.c b/target_firmware/wlan/if_ath.c index 7dabb5f..6186f67 100755 --- a/target_firmware/wlan/if_ath.c +++ b/target_firmware/wlan/if_ath.c @@ -386,7 +386,7 @@ static void ath_uapsd_processtriggers(struct ath_softc_tgt *sc) continue; } - retval = ath_hal_rxprocdescfast(ah, ds, ds->ds_daddr, + retval = ah->ah_procRxDescFast(ah, ds, ds->ds_daddr, PA2DESC(sc, ds->ds_link), &bf->bf_rx_status); if (HAL_EINPROGRESS == retval) { break; diff --git a/target_firmware/wlan/if_athvar.h b/target_firmware/wlan/if_athvar.h index 82792f9..07ceac3 100755 --- a/target_firmware/wlan/if_athvar.h +++ b/target_firmware/wlan/if_athvar.h @@ -489,8 +489,6 @@ typedef enum { a_uint8_t ath_get_minrateidx(struct ath_softc_tgt *sc, struct ath_vap_target *avp); -#define ath_hal_rxprocdescfast(_ah, _ds, _dspa, _dsnext, _rx_stats) \ - ((*(_ah)->ah_procRxDescFast)((_ah), (_ds), (_dspa), (_dsnext), (_rx_stats))) #define ath_hal_set11n_virtualmorefrag(_ah, _ds, _vmf) \ ((*(_ah)->ah_set11nVirtualMoreFrag)(_ah, _ds, _vmf)) #define ath_hal_setuptxdesc(_ah, _ds, _plen, _hlen, _atype, _txpow, \ From ee90af48818c08032beb9fd2c3967d35adfea3b6 Mon Sep 17 00:00:00 2001 From: Oleksij Rempel Date: Sat, 11 May 2013 12:47:58 +0200 Subject: [PATCH 50/57] remove ah_updateCTSForBursting Signed-off-by: Oleksij Rempel --- target_firmware/wlan/ah.h | 5 ----- target_firmware/wlan/ar5416_hw.c | 1 - 2 files changed, 6 deletions(-) diff --git a/target_firmware/wlan/ah.h b/target_firmware/wlan/ah.h index 606058e..0f986ee 100755 --- a/target_firmware/wlan/ah.h +++ b/target_firmware/wlan/ah.h @@ -378,11 +378,6 @@ struct ath_hal /* Misc Functions */ void __ahdecl(*ah_setDefAntenna)(struct ath_hal*, a_uint32_t); - - HAL_BOOL __ahdecl(*ah_updateCTSForBursting)(struct ath_hal *, - struct ath_desc *, struct ath_desc *, - struct ath_desc *, struct ath_desc *, - a_uint32_t, a_uint32_t); void __ahdecl(*ah_setRxFilter)(struct ath_hal*, a_uint32_t); diff --git a/target_firmware/wlan/ar5416_hw.c b/target_firmware/wlan/ar5416_hw.c index fcec3bf..ec35f3a 100644 --- a/target_firmware/wlan/ar5416_hw.c +++ b/target_firmware/wlan/ar5416_hw.c @@ -118,7 +118,6 @@ ar5416Attach(a_uint32_t devid,HAL_SOFTC sc, adf_os_device_t dev, ah->ah_set11nBurstDuration = ar5416Set11nBurstDuration_20; ah->ah_setupRxDesc = ar5416SetupRxDesc_20; ah->ah_procRxDescFast = ar5416ProcRxDescFast_20; - ah->ah_updateCTSForBursting = NULL; ah->ah_setupTxDesc = ar5416SetupTxDesc_20; ah->ah_reqTxIntrDesc = ar5416IntrReqTxDesc_20; ah->ah_fillTxDesc = ar5416FillTxDesc_20; From 40dfc4cb8a636e81632bc5eef4abff68f6cd5788 Mon Sep 17 00:00:00 2001 From: Oleksij Rempel Date: Sat, 11 May 2013 12:51:12 +0200 Subject: [PATCH 51/57] use ah_setupTxDesc directly Signed-off-by: Oleksij Rempel --- target_firmware/wlan/if_ath.c | 2 +- target_firmware/wlan/if_athvar.h | 8 -------- target_firmware/wlan/if_owl.c | 4 ++-- 3 files changed, 3 insertions(+), 11 deletions(-) diff --git a/target_firmware/wlan/if_ath.c b/target_firmware/wlan/if_ath.c index 6186f67..9f1e172 100755 --- a/target_firmware/wlan/if_ath.c +++ b/target_firmware/wlan/if_ath.c @@ -555,7 +555,7 @@ static void ath_beacon_setup(struct ath_softc_tgt *sc, rt = sc->sc_currates; rate = rt->info[rix].rateCode; - ath_hal_setuptxdesc(ah, ds + ah->ah_setupTxDesc(ah, ds , adf_nbuf_len(skb) + IEEE80211_CRC_LEN , sizeof(struct ieee80211_frame) , HAL_PKT_TYPE_BEACON diff --git a/target_firmware/wlan/if_athvar.h b/target_firmware/wlan/if_athvar.h index 07ceac3..a641fde 100755 --- a/target_firmware/wlan/if_athvar.h +++ b/target_firmware/wlan/if_athvar.h @@ -491,14 +491,6 @@ a_uint8_t ath_get_minrateidx(struct ath_softc_tgt *sc, struct ath_vap_target *av #define ath_hal_set11n_virtualmorefrag(_ah, _ds, _vmf) \ ((*(_ah)->ah_set11nVirtualMoreFrag)(_ah, _ds, _vmf)) -#define ath_hal_setuptxdesc(_ah, _ds, _plen, _hlen, _atype, _txpow, \ - _txr0, _txtr0, _keyix, _ant, _flags, \ - _rtsrate, _rtsdura, \ - _compicvlen, _compivlen, _comp) \ - ((*(_ah)->ah_setupTxDesc)((_ah), (_ds), (_plen), (_hlen), (_atype), \ - (_txpow), (_txr0), (_txtr0), (_keyix), (_ant), \ - (_flags), (_rtsrate), (_rtsdura), \ - (_compicvlen), (_compivlen), (_comp))) #define ath_hal_fillkeytxdesc(_ah, _ds, _keytype) \ ((*(_ah)->ah_fillKeyTxDesc)((_ah), (_ds), (_keytype))) #define ath_hal_filltxdesc(_ah, _ds, _l, _first, _last, _ds0) \ diff --git a/target_firmware/wlan/if_owl.c b/target_firmware/wlan/if_owl.c index 0793c41..f8cfd64 100755 --- a/target_firmware/wlan/if_owl.c +++ b/target_firmware/wlan/if_owl.c @@ -1199,7 +1199,7 @@ ath_tgt_send_mgt(struct ath_softc_tgt *sc,adf_nbuf_t hdr_buf, adf_nbuf_t skb, flags |= HAL_TXDESC_INTREQ; - ath_hal_setuptxdesc(ah, ds + ah->ah_setupTxDesc(ah, ds , pktlen , hdrlen , atype @@ -2127,7 +2127,7 @@ static void ath_bar_tx(struct ath_softc_tgt *sc, adf_nbuf_dmamap_info(bf->bf_dmamap, &bf->bf_dmamap_info); ds = bf->bf_desc; - ath_hal_setuptxdesc(sc->sc_ah, ds + ah->ah_setupTxDesc(ah, ds , adf_nbuf_len(skb) + IEEE80211_CRC_LEN , 0 , HAL_PKT_TYPE_NORMAL From 4cd46c8b906af84c318a2fa130ece0bfaf6e6db4 Mon Sep 17 00:00:00 2001 From: Oleksij Rempel Date: Sat, 11 May 2013 12:54:00 +0200 Subject: [PATCH 52/57] remove ar5416IntrReqTxDesc_20 Signed-off-by: Oleksij Rempel --- target_firmware/wlan/ah.h | 1 - target_firmware/wlan/ar5416_hw.c | 7 ------- target_firmware/wlan/ar5416desc.h | 1 - 3 files changed, 9 deletions(-) diff --git a/target_firmware/wlan/ah.h b/target_firmware/wlan/ah.h index 0f986ee..e391a9d 100755 --- a/target_firmware/wlan/ah.h +++ b/target_firmware/wlan/ah.h @@ -430,7 +430,6 @@ struct ath_hal HAL_BOOL lastSeg, const struct ath_tx_desc *); HAL_BOOL __ahdecl (*ah_fillKeyTxDesc) (struct ath_hal *, struct ath_tx_desc *, HAL_KEY_TYPE); HAL_STATUS __ahdecl(*ah_procTxDesc)(struct ath_hal *, struct ath_tx_desc *); - void __ahdecl(*ah_reqTxIntrDesc)(struct ath_hal *, struct ath_desc*); HAL_BOOL __ahdecl(*ah_setBssIdMask)(struct ath_hal *, const a_uint8_t*); void __ahdecl(*ah_setPCUConfig)(struct ath_hal *); void __ahdecl(*ah_setMulticastFilter)(struct ath_hal*, diff --git a/target_firmware/wlan/ar5416_hw.c b/target_firmware/wlan/ar5416_hw.c index ec35f3a..f1f88a9 100644 --- a/target_firmware/wlan/ar5416_hw.c +++ b/target_firmware/wlan/ar5416_hw.c @@ -119,7 +119,6 @@ ar5416Attach(a_uint32_t devid,HAL_SOFTC sc, adf_os_device_t dev, ah->ah_setupRxDesc = ar5416SetupRxDesc_20; ah->ah_procRxDescFast = ar5416ProcRxDescFast_20; ah->ah_setupTxDesc = ar5416SetupTxDesc_20; - ah->ah_reqTxIntrDesc = ar5416IntrReqTxDesc_20; ah->ah_fillTxDesc = ar5416FillTxDesc_20; ah->ah_fillKeyTxDesc = ar5416FillKeyTxDesc_20; ah->ah_procTxDesc = ar5416ProcTxDesc_20; @@ -643,12 +642,6 @@ HAL_BOOL ar5416StopTxDma(struct ath_hal*ah, a_uint32_t q) return (i != 0); } -void ar5416IntrReqTxDesc_20(struct ath_hal *ah, struct ath_desc *ds) -{ - struct ar5416_desc *ads = AR5416DESC(ds); - ads->ds_ctl0 |= AR_TxIntrReq; -} - HAL_BOOL ar5416SetupTxDesc_20(struct ath_hal *ah, struct ath_tx_desc *ds, a_uint32_t pktLen, a_uint32_t hdrLen, diff --git a/target_firmware/wlan/ar5416desc.h b/target_firmware/wlan/ar5416desc.h index ecc7e3b..9da5988 100755 --- a/target_firmware/wlan/ar5416desc.h +++ b/target_firmware/wlan/ar5416desc.h @@ -474,7 +474,6 @@ extern HAL_BOOL ar5416FillTxDesc_20(struct ath_hal *ah, struct ath_tx_desc *ds, extern HAL_BOOL ar5416FillKeyTxDesc_20(struct ath_hal *ah, struct ath_tx_desc *,HAL_KEY_TYPE); extern HAL_STATUS ar5416ProcTxDesc_20(struct ath_hal *ah, struct ath_tx_desc *); -extern void ar5416IntrReqTxDesc_20(struct ath_hal *ah, struct ath_desc *ds); extern void ar5416Set11nTxDesc_20(struct ath_hal *ah, struct ath_tx_desc *ds, a_uint32_t pktLen, HAL_PKT_TYPE type, a_uint32_t txPower, a_uint32_t keyIx, HAL_KEY_TYPE keyType, a_uint32_t flags); From b20199739f615b436e23f069215d932e91f2a1a8 Mon Sep 17 00:00:00 2001 From: Oleksij Rempel Date: Sat, 11 May 2013 12:56:12 +0200 Subject: [PATCH 53/57] use ah_fillTxDesc directly Signed-off-by: Oleksij Rempel --- target_firmware/wlan/if_ath.c | 2 +- target_firmware/wlan/if_athvar.h | 2 -- target_firmware/wlan/if_owl.c | 3 ++- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/target_firmware/wlan/if_ath.c b/target_firmware/wlan/if_ath.c index 9f1e172..59b6c94 100755 --- a/target_firmware/wlan/if_ath.c +++ b/target_firmware/wlan/if_ath.c @@ -570,7 +570,7 @@ static void ath_beacon_setup(struct ath_softc_tgt *sc, , 0 , ATH_COMP_PROC_NO_COMP_NO_CCS); - ath_hal_filltxdesc(ah, ds + ah->ah_fillTxDesc(ah, ds , asf_roundup(adf_nbuf_len(skb), 4) , AH_TRUE , AH_TRUE diff --git a/target_firmware/wlan/if_athvar.h b/target_firmware/wlan/if_athvar.h index a641fde..edcf74c 100755 --- a/target_firmware/wlan/if_athvar.h +++ b/target_firmware/wlan/if_athvar.h @@ -493,8 +493,6 @@ a_uint8_t ath_get_minrateidx(struct ath_softc_tgt *sc, struct ath_vap_target *av ((*(_ah)->ah_set11nVirtualMoreFrag)(_ah, _ds, _vmf)) #define ath_hal_fillkeytxdesc(_ah, _ds, _keytype) \ ((*(_ah)->ah_fillKeyTxDesc)((_ah), (_ds), (_keytype))) -#define ath_hal_filltxdesc(_ah, _ds, _l, _first, _last, _ds0) \ - ((*(_ah)->ah_fillTxDesc)((_ah), (_ds), (_l), (_first), (_last), (_ds0))) #define ath_hal_txprocdesc(_ah, _ds) \ ((*(_ah)->ah_procTxDesc)((_ah), (_ds))) #define ath_hal_htsupported(_ah) \ diff --git a/target_firmware/wlan/if_owl.c b/target_firmware/wlan/if_owl.c index f8cfd64..31a4ab4 100755 --- a/target_firmware/wlan/if_owl.c +++ b/target_firmware/wlan/if_owl.c @@ -237,6 +237,7 @@ static void ath_dma_unmap(struct ath_softc_tgt *sc, struct ath_tx_buf *bf) static void ath_filltxdesc(struct ath_softc_tgt *sc, struct ath_tx_buf *bf) { struct ath_tx_desc *ds0, *ds = bf->bf_desc; + struct ath_hal *ah = sc->sc_ah; a_uint8_t i; ds0 = ds; @@ -252,7 +253,7 @@ static void ath_filltxdesc(struct ath_softc_tgt *sc, struct ath_tx_buf *bf) } else ds->ds_link = ATH_BUF_GET_DESC_PHY_ADDR_WITH_IDX(bf, i+1); - ath_hal_filltxdesc(sc->sc_ah, ds + ah->ah_fillTxDesc(ah, ds , bf->bf_dmamap_info.dma_segs[i].len , i == 0 , i == (bf->bf_dmamap_info.nsegs - 1) From a49436f66fe13b99a2577226dd8d25af0e1f42ee Mon Sep 17 00:00:00 2001 From: Oleksij Rempel Date: Sat, 11 May 2013 12:58:12 +0200 Subject: [PATCH 54/57] use ah_fillKeyTxDesc directly Signed-off-by: Oleksij Rempel --- target_firmware/wlan/if_athvar.h | 2 -- target_firmware/wlan/if_owl.c | 4 ++-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/target_firmware/wlan/if_athvar.h b/target_firmware/wlan/if_athvar.h index edcf74c..bddebce 100755 --- a/target_firmware/wlan/if_athvar.h +++ b/target_firmware/wlan/if_athvar.h @@ -491,8 +491,6 @@ a_uint8_t ath_get_minrateidx(struct ath_softc_tgt *sc, struct ath_vap_target *av #define ath_hal_set11n_virtualmorefrag(_ah, _ds, _vmf) \ ((*(_ah)->ah_set11nVirtualMoreFrag)(_ah, _ds, _vmf)) -#define ath_hal_fillkeytxdesc(_ah, _ds, _keytype) \ - ((*(_ah)->ah_fillKeyTxDesc)((_ah), (_ds), (_keytype))) #define ath_hal_txprocdesc(_ah, _ds) \ ((*(_ah)->ah_procTxDesc)((_ah), (_ds))) #define ath_hal_htsupported(_ah) \ diff --git a/target_firmware/wlan/if_owl.c b/target_firmware/wlan/if_owl.c index 31a4ab4..4cce3e6 100755 --- a/target_firmware/wlan/if_owl.c +++ b/target_firmware/wlan/if_owl.c @@ -1222,8 +1222,8 @@ ath_tgt_send_mgt(struct ath_softc_tgt *sc,adf_nbuf_t hdr_buf, adf_nbuf_t skb, * in Auth frame 3 of Shared Authentication, owl needs this. */ if (iswep && (keyix != HAL_TXKEYIX_INVALID) && - (wh->i_fc[0] & IEEE80211_FC0_SUBTYPE_MASK) == IEEE80211_FC0_SUBTYPE_AUTH) - ath_hal_fillkeytxdesc(ah, ds, mh->keytype); + (wh->i_fc[0] & IEEE80211_FC0_SUBTYPE_MASK) == IEEE80211_FC0_SUBTYPE_AUTH) + ah->ah_fillKeyTxDesc(ah, ds, mh->keytype); ath_filltxdesc(sc, bf); From e384f0a6c8055382e78a6d68426f3bd58eddddbb Mon Sep 17 00:00:00 2001 From: Oleksij Rempel Date: Sat, 11 May 2013 13:00:50 +0200 Subject: [PATCH 55/57] use ah_procTxDesc directly Signed-off-by: Oleksij Rempel --- target_firmware/wlan/if_athvar.h | 2 -- target_firmware/wlan/if_owl.c | 5 +++-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/target_firmware/wlan/if_athvar.h b/target_firmware/wlan/if_athvar.h index bddebce..c378b58 100755 --- a/target_firmware/wlan/if_athvar.h +++ b/target_firmware/wlan/if_athvar.h @@ -491,8 +491,6 @@ a_uint8_t ath_get_minrateidx(struct ath_softc_tgt *sc, struct ath_vap_target *av #define ath_hal_set11n_virtualmorefrag(_ah, _ds, _vmf) \ ((*(_ah)->ah_set11nVirtualMoreFrag)(_ah, _ds, _vmf)) -#define ath_hal_txprocdesc(_ah, _ds) \ - ((*(_ah)->ah_procTxDesc)((_ah), (_ds))) #define ath_hal_htsupported(_ah) \ (ath_hal_getcapability(_ah, HAL_CAP_HT, 0, NULL) == HAL_OK) #define ath_hal_getrtsaggrlimit(_ah, _pv) \ diff --git a/target_firmware/wlan/if_owl.c b/target_firmware/wlan/if_owl.c index 4cce3e6..00a9129 100755 --- a/target_firmware/wlan/if_owl.c +++ b/target_firmware/wlan/if_owl.c @@ -651,6 +651,7 @@ void owltgt_tx_processq(struct ath_softc_tgt *sc, struct ath_txq *txq, { struct ath_tx_buf *bf; struct ath_tx_desc *ds; + struct ath_hal *ah = sc->sc_ah; HAL_STATUS status; for (;;) { @@ -663,7 +664,7 @@ void owltgt_tx_processq(struct ath_softc_tgt *sc, struct ath_txq *txq, bf = asf_tailq_first(&txq->axq_q); ds = bf->bf_lastds; - status = ath_hal_txprocdesc(sc->sc_ah, ds); + status = ah->ah_procTxDesc(ah, ds); if (status == HAL_EINPROGRESS) { if (txqstate == OWL_TXQ_ACTIVE) @@ -886,7 +887,7 @@ static void ath_tgt_txq_add_ucast(struct ath_softc_tgt *sc, struct ath_tx_buf *b txq = bf->bf_txq; - status = ath_hal_txprocdesc(sc->sc_ah, bf->bf_lastds); + status = ah->ah_procTxDesc(ah, bf->bf_lastds); ATH_TXQ_INSERT_TAIL(txq, bf, bf_list); From e32755a118c8755668821ffcf5eb1c9169902497 Mon Sep 17 00:00:00 2001 From: Oleksij Rempel Date: Sat, 11 May 2013 13:03:20 +0200 Subject: [PATCH 56/57] use ah_set11nVirtualMoreFrag directly Signed-off-by: Oleksij Rempel --- target_firmware/wlan/if_athvar.h | 2 -- target_firmware/wlan/if_owl.c | 4 ++-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/target_firmware/wlan/if_athvar.h b/target_firmware/wlan/if_athvar.h index c378b58..f6f67cb 100755 --- a/target_firmware/wlan/if_athvar.h +++ b/target_firmware/wlan/if_athvar.h @@ -489,8 +489,6 @@ typedef enum { a_uint8_t ath_get_minrateidx(struct ath_softc_tgt *sc, struct ath_vap_target *avp); -#define ath_hal_set11n_virtualmorefrag(_ah, _ds, _vmf) \ - ((*(_ah)->ah_set11nVirtualMoreFrag)(_ah, _ds, _vmf)) #define ath_hal_htsupported(_ah) \ (ath_hal_getcapability(_ah, HAL_CAP_HT, 0, NULL) == HAL_OK) #define ath_hal_getrtsaggrlimit(_ah, _pv) \ diff --git a/target_firmware/wlan/if_owl.c b/target_firmware/wlan/if_owl.c index 00a9129..19a945c 100755 --- a/target_firmware/wlan/if_owl.c +++ b/target_firmware/wlan/if_owl.c @@ -990,7 +990,7 @@ ath_tx_freebuf(struct ath_softc_tgt *sc, struct ath_tx_buf *bf) for (bfd = bf->bf_desc, i = 0; i < bf->bf_dmamap_info.nsegs; bfd++, i++) { ah->ah_clr11nAggr(ah, bfd); ah->ah_set11nBurstDuration(ah, bfd, 0); - ath_hal_set11n_virtualmorefrag(sc->sc_ah, bfd, 0); + ah->ah_set11nVirtualMoreFrag(ah, bfd, 0); } ath_dma_unmap(sc, bf); @@ -1814,7 +1814,7 @@ ath_tx_retry_subframe(struct ath_softc_tgt *sc, struct ath_tx_buf *bf, for(ds = bf->bf_desc, i = 0; i < bf->bf_dmamap_info.nsegs; ds++, i++) { ah->ah_clr11nAggr(ah, ds); ah->ah_set11nBurstDuration(ah, ds, 0); - ath_hal_set11n_virtualmorefrag(sc->sc_ah, ds, 0); + ah->ah_set11nVirtualMoreFrag(ah, ds, 0); } if (bf->bf_retries >= OWLMAX_RETRIES) { From effcef2555d3b3e62c648d08ed369f80f8e38df8 Mon Sep 17 00:00:00 2001 From: Oleksij Rempel Date: Sat, 11 May 2013 13:05:16 +0200 Subject: [PATCH 57/57] ar5416Attach: remove useless check Signed-off-by: Oleksij Rempel --- target_firmware/wlan/ar5416_hw.c | 34 ++++++++++++++------------------ 1 file changed, 15 insertions(+), 19 deletions(-) diff --git a/target_firmware/wlan/ar5416_hw.c b/target_firmware/wlan/ar5416_hw.c index f1f88a9..78882ff 100644 --- a/target_firmware/wlan/ar5416_hw.c +++ b/target_firmware/wlan/ar5416_hw.c @@ -105,25 +105,21 @@ ar5416Attach(a_uint32_t devid,HAL_SOFTC sc, adf_os_device_t dev, ah->ah_dev = dev; ah->ah_sc = sc; - - /* If its a Owl 2.0 chip then change the hal structure to - point to the Owl 2.0 ar5416_hal_20 structure */ - if(1) { - ah->ah_set11nTxDesc = ar5416Set11nTxDesc_20; - ah->ah_set11nRateScenario = ar5416Set11nRateScenario_20; - ah->ah_set11nAggrFirst = ar5416Set11nAggrFirst_20; - ah->ah_set11nAggrMiddle = ar5416Set11nAggrMiddle_20; - ah->ah_set11nAggrLast = ar5416Set11nAggrLast_20; - ah->ah_clr11nAggr = ar5416Clr11nAggr_20; - ah->ah_set11nBurstDuration = ar5416Set11nBurstDuration_20; - ah->ah_setupRxDesc = ar5416SetupRxDesc_20; - ah->ah_procRxDescFast = ar5416ProcRxDescFast_20; - ah->ah_setupTxDesc = ar5416SetupTxDesc_20; - ah->ah_fillTxDesc = ar5416FillTxDesc_20; - ah->ah_fillKeyTxDesc = ar5416FillKeyTxDesc_20; - ah->ah_procTxDesc = ar5416ProcTxDesc_20; - ah->ah_set11nVirtualMoreFrag = ar5416Set11nVirtualMoreFrag_20; - } + + ah->ah_set11nTxDesc = ar5416Set11nTxDesc_20; + ah->ah_set11nRateScenario = ar5416Set11nRateScenario_20; + ah->ah_set11nAggrFirst = ar5416Set11nAggrFirst_20; + ah->ah_set11nAggrMiddle = ar5416Set11nAggrMiddle_20; + ah->ah_set11nAggrLast = ar5416Set11nAggrLast_20; + ah->ah_clr11nAggr = ar5416Clr11nAggr_20; + ah->ah_set11nBurstDuration = ar5416Set11nBurstDuration_20; + ah->ah_setupRxDesc = ar5416SetupRxDesc_20; + ah->ah_procRxDescFast = ar5416ProcRxDescFast_20; + ah->ah_setupTxDesc = ar5416SetupTxDesc_20; + ah->ah_fillTxDesc = ar5416FillTxDesc_20; + ah->ah_fillKeyTxDesc = ar5416FillKeyTxDesc_20; + ah->ah_procTxDesc = ar5416ProcTxDesc_20; + ah->ah_set11nVirtualMoreFrag = ar5416Set11nVirtualMoreFrag_20; return ah; }