projects
/
open-ath9k-htc-firmware.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
remove unused adf_os_cpu_to_le16
[open-ath9k-htc-firmware.git]
/
target_firmware
/
wlan
/
if_ath.c
diff --git
a/target_firmware/wlan/if_ath.c
b/target_firmware/wlan/if_ath.c
index b8874bf00ec66fb500137bdda3b83618e6630813..53b15cd1f34760ea9c2b36a9a81b2b7c1d75cb96 100755
(executable)
--- a/
target_firmware/wlan/if_ath.c
+++ b/
target_firmware/wlan/if_ath.c
@@
-50,13
+50,12
@@
#include <adf_os_irq.h>
#include <if_ath_pci.h>
#include <adf_os_irq.h>
#include <if_ath_pci.h>
-#include "if_ethersubr.h"
#include "if_llc.h"
#include "ieee80211_var.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"
#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;
static a_int32_t ath_numrxbufs = -1;
static a_int32_t ath_numrxdescs = -1;
@@
-81,27
+80,17
@@
void owl_tgt_node_init(struct ath_node_target * an);
void ath_tgt_tx_sched_normal(struct ath_softc_tgt *sc, struct ath_buf *bf);
void ath_tgt_tx_sched_nonaggr(struct ath_softc_tgt *sc,struct ath_buf * bf_host);
void ath_tgt_tx_sched_normal(struct ath_softc_tgt *sc, struct ath_buf *bf);
void ath_tgt_tx_sched_nonaggr(struct ath_softc_tgt *sc,struct ath_buf * bf_host);
-/*************/
-/* Utilities */
-/*************/
-
-#undef adf_os_cpu_to_le16
-
-static a_uint16_t adf_os_cpu_to_le16(a_uint16_t x)
-{
- return ((((x) & 0xff00) >> 8) | (((x) & 0x00ff) << 8));
-}
-
/*
* Extend a 32 bit TSF to 64 bit, taking wrapping into account.
*/
static u_int64_t ath_extend_tsf(struct ath_softc_tgt *sc, u_int32_t rstamp)
{
/*
* Extend a 32 bit TSF to 64 bit, taking wrapping into account.
*/
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;
u_int64_t tsf;
u_int32_t tsf_low;
u_int64_t tsf64;
- tsf = a
th_hal_gettsf64(sc->sc_
ah);
+ tsf = a
h->ah_getTsf64(
ah);
tsf_low = tsf & 0xffffffff;
tsf64 = (tsf & ~0xffffffffULL) | rstamp;
tsf_low = tsf & 0xffffffff;
tsf64 = (tsf & ~0xffffffffULL) | rstamp;
@@
-121,10
+110,10
@@
static a_int32_t ath_rate_setup(struct ath_softc_tgt *sc, a_uint32_t mode)
switch (mode) {
case IEEE80211_MODE_11NA:
switch (mode) {
case IEEE80211_MODE_11NA:
- sc->sc_rates[mode] = a
th_hal_getratet
able(ah, HAL_MODE_11NA);
+ sc->sc_rates[mode] = a
h->ah_getRateT
able(ah, HAL_MODE_11NA);
break;
case IEEE80211_MODE_11NG:
break;
case IEEE80211_MODE_11NG:
- sc->sc_rates[mode] = a
th_hal_getratet
able(ah, HAL_MODE_11NG);
+ sc->sc_rates[mode] = a
h->ah_getRateT
able(ah, HAL_MODE_11NG);
break;
default:
return 0;
break;
default:
return 0;
@@
-266,18
+255,18
@@
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);
ds->ds_link = 0;
adf_nbuf_peek_header(ds->ds_nbuf, &anbdata, &anblen);
- a
th_hal_setuprxd
esc(ah, ds,
+ a
h->ah_setupRxD
esc(ah, ds,
adf_nbuf_tailroom(ds->ds_nbuf),
0);
if (sc->sc_rxlink == NULL) {
adf_nbuf_tailroom(ds->ds_nbuf),
0);
if (sc->sc_rxlink == NULL) {
- a
th_hal_putrxbuf
(ah, ds->ds_daddr);
+ a
h->ah_setRxDP
(ah, ds->ds_daddr);
}
else {
*sc->sc_rxlink = ds->ds_daddr;
}
sc->sc_rxlink = &ds->ds_link;
}
else {
*sc->sc_rxlink = ds->ds_daddr;
}
sc->sc_rxlink = &ds->ds_link;
- a
th_hal_rxena
(ah);
+ a
h->ah_enableReceive
(ah);
return 0;
}
return 0;
}
@@
-335,7
+324,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)))
((struct ath_desc *)((caddr_t)(_sc)->sc_rxdma.dd_desc + \
((_pa) - (_sc)->sc_rxdma.dd_desc_paddr)))
- tsf = a
th_hal_gett
sf64(ah);
+ tsf = a
h->ah_getT
sf64(ah);
bf = asf_tailq_first(&sc->sc_rxbuf);
ds = asf_tailq_first(&sc->sc_rxdesc);
bf = asf_tailq_first(&sc->sc_rxbuf);
ds = asf_tailq_first(&sc->sc_rxdesc);
@@
-386,7
+375,7
@@
static void ath_uapsd_processtriggers(struct ath_softc_tgt *sc)
continue;
}
continue;
}
- retval = a
th_hal_rxprocdescf
ast(ah, ds, ds->ds_daddr,
+ retval = a
h->ah_procRxDescF
ast(ah, ds, ds->ds_daddr,
PA2DESC(sc, ds->ds_link), &bf->bf_rx_status);
if (HAL_EINPROGRESS == retval) {
break;
PA2DESC(sc, ds->ds_link), &bf->bf_rx_status);
if (HAL_EINPROGRESS == retval) {
break;
@@
-472,7
+461,7
@@
static a_int32_t ath_startrecv(struct ath_softc_tgt *sc)
}
ds = asf_tailq_first(&sc->sc_rxdesc);
}
ds = asf_tailq_first(&sc->sc_rxdesc);
- a
th_hal_putrxbuf
(ah, ds->ds_daddr);
+ a
h->ah_setRxDP
(ah, ds->ds_daddr);
return 0;
}
return 0;
}
@@
-522,7
+511,7
@@
static void ath_tgt_rx_tasklet(TQUEUE_ARG data)
} while(1);
sc->sc_imask |= HAL_INT_RX;
} while(1);
sc->sc_imask |= HAL_INT_RX;
- a
th_hal_intrset
(ah, sc->sc_imask);
+ a
h->ah_setInterrupts
(ah, sc->sc_imask);
}
/*******************/
}
/*******************/
@@
-555,7
+544,7
@@
static void ath_beacon_setup(struct ath_softc_tgt *sc,
rt = sc->sc_currates;
rate = rt->info[rix].rateCode;
rt = sc->sc_currates;
rate = rt->info[rix].rateCode;
- a
th_hal_setuptxd
esc(ah, ds
+ a
h->ah_setupTxD
esc(ah, ds
, adf_nbuf_len(skb) + IEEE80211_CRC_LEN
, sizeof(struct ieee80211_frame)
, HAL_PKT_TYPE_BEACON
, adf_nbuf_len(skb) + IEEE80211_CRC_LEN
, sizeof(struct ieee80211_frame)
, HAL_PKT_TYPE_BEACON
@@
-570,7
+559,7
@@
static void ath_beacon_setup(struct ath_softc_tgt *sc,
, 0
, ATH_COMP_PROC_NO_COMP_NO_CCS);
, 0
, ATH_COMP_PROC_NO_COMP_NO_CCS);
- a
th_hal_filltxd
esc(ah, ds
+ a
h->ah_fillTxD
esc(ah, ds
, asf_roundup(adf_nbuf_len(skb), 4)
, AH_TRUE
, AH_TRUE
, asf_roundup(adf_nbuf_len(skb), 4)
, AH_TRUE
, AH_TRUE
@@
-580,7
+569,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;
series[0].Rate = rate;
series[0].ChSel = sc->sc_ic.ic_tx_chainmask;
series[0].RateFlags = 0;
- a
th_hal_set11n_rates
cenario(ah, ds, 0, 0, 0, series, 4, 0);
+ a
h->ah_set11nRateS
cenario(ah, ds, 0, 0, 0, series, 4, 0);
}
static void ath_tgt_send_beacon(struct ath_softc_tgt *sc, adf_nbuf_t bc_hdr,
}
static void ath_tgt_send_beacon(struct ath_softc_tgt *sc, adf_nbuf_t bc_hdr,
@@
-624,9
+613,9
@@
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]);
adf_nbuf_dmamap_info(bf->bf_dmamap,&bf->bf_dmamap_info);
ath_beacon_setup(sc, bf, &sc->sc_vap[vap_index]);
- a
th_hal_stoptxd
ma(ah, sc->sc_bhalq);
- a
th_hal_puttxbuf
(ah, sc->sc_bhalq, ATH_BUF_GET_DESC_PHY_ADDR(bf));
- a
th_hal_txstart
(ah, sc->sc_bhalq);
+ a
h->ah_stopTxD
ma(ah, sc->sc_bhalq);
+ a
h->ah_setTxDP
(ah, sc->sc_bhalq, ATH_BUF_GET_DESC_PHY_ADDR(bf));
+ a
h->ah_startTxDma
(ah, sc->sc_bhalq);
}
/******/
}
/******/
@@
-637,7
+626,7
@@
static void ath_tx_stopdma(struct ath_softc_tgt *sc, struct ath_txq *txq)
{
struct ath_hal *ah = sc->sc_ah;
{
struct ath_hal *ah = sc->sc_ah;
-
(void) ath_hal_stoptxd
ma(ah, txq->axq_qnum);
+
ah->ah_stopTxD
ma(ah, txq->axq_qnum);
}
static void owltgt_txq_drain(struct ath_softc_tgt *sc, struct ath_txq *txq)
}
static void owltgt_txq_drain(struct ath_softc_tgt *sc, struct ath_txq *txq)
@@
-660,7
+649,7
@@
static void ath_draintxq(struct ath_softc_tgt *sc, HAL_BOOL drain_softq)
ath_tx_status_clear(sc);
sc->sc_tx_draining = 1;
ath_tx_status_clear(sc);
sc->sc_tx_draining = 1;
-
(void) ath_hal_stoptxd
ma(ah, sc->sc_bhalq);
+
ah->ah_stopTxD
ma(ah, sc->sc_bhalq);
for (i = 0; i < HAL_NUM_TX_QUEUES; i++)
if (ATH_TXQ_SETUP(sc, i))
for (i = 0; i < HAL_NUM_TX_QUEUES; i++)
if (ATH_TXQ_SETUP(sc, i))
@@
-785,7
+774,7
@@
static void tgt_HTCRecv_cabhandler(HTC_ENDPOINT_ID EndPt, adf_nbuf_t hdr_buf,
a_uint32_t tmp;
#ifdef ATH_ENABLE_CABQ
a_uint32_t tmp;
#ifdef ATH_ENABLE_CABQ
- tsf = a
th_hal_gett
sf64(ah);
+ tsf = a
h->ah_getT
sf64(ah);
tmp = tsf - sc->sc_swba_tsf;
if ( tmp > ATH_CABQ_HANDLING_THRESHOLD ) {
tmp = tsf - sc->sc_swba_tsf;
if ( tmp > ATH_CABQ_HANDLING_THRESHOLD ) {
@@
-1021,24
+1010,24
@@
adf_os_irq_resp_t ath_intr(adf_drv_handle_t hdl)
if (sc->sc_invalid)
return ADF_OS_IRQ_NONE;
if (sc->sc_invalid)
return ADF_OS_IRQ_NONE;
- if (!a
th_hal_intrpend
(ah))
+ if (!a
h->ah_isInterruptPending
(ah))
return ADF_OS_IRQ_NONE;
return ADF_OS_IRQ_NONE;
- a
th_hal_getisr
(ah, &status);
+ a
h->ah_getPendingInterrupts
(ah, &status);
status &= sc->sc_imask;
if (status & HAL_INT_FATAL) {
status &= sc->sc_imask;
if (status & HAL_INT_FATAL) {
- a
th_hal_intrset
(ah, 0);
+ a
h->ah_setInterrupts
(ah, 0);
ATH_SCHEDULE_TQUEUE(sc->sc_dev, &sc->sc_fataltq);
} else {
if (status & HAL_INT_SWBA) {
WMI_SWBA_EVENT swbaEvt;
struct ath_txq *txq = ATH_TXQ(sc, 8);
ATH_SCHEDULE_TQUEUE(sc->sc_dev, &sc->sc_fataltq);
} else {
if (status & HAL_INT_SWBA) {
WMI_SWBA_EVENT swbaEvt;
struct ath_txq *txq = ATH_TXQ(sc, 8);
- swbaEvt.tsf = a
th_hal_gett
sf64(ah);
- swbaEvt.beaconPendingCount = a
th_hal_numtxp
ending(ah, sc->sc_bhalq);
- sc->sc_swba_tsf = a
th_hal_gett
sf64(ah);
+ swbaEvt.tsf = a
h->ah_getT
sf64(ah);
+ swbaEvt.beaconPendingCount = a
h->ah_numTxP
ending(ah, sc->sc_bhalq);
+ sc->sc_swba_tsf = a
h->ah_getT
sf64(ah);
wmi_event(sc->tgt_wmi_handle,
WMI_SWBA_EVENTID,
wmi_event(sc->tgt_wmi_handle,
WMI_SWBA_EVENTID,
@@
-1061,14
+1050,14
@@
adf_os_irq_resp_t ath_intr(adf_drv_handle_t hdl)
ath_uapsd_processtriggers(sc);
sc->sc_imask &= ~HAL_INT_RX;
ath_uapsd_processtriggers(sc);
sc->sc_imask &= ~HAL_INT_RX;
- a
th_hal_intrset
(ah, sc->sc_imask);
+ a
h->ah_setInterrupts
(ah, sc->sc_imask);
ATH_SCHEDULE_TQUEUE(sc->sc_dev, &sc->sc_rxtq);
}
if (status & HAL_INT_TXURN) {
sc->sc_int_stats.ast_txurn++;
ATH_SCHEDULE_TQUEUE(sc->sc_dev, &sc->sc_rxtq);
}
if (status & HAL_INT_TXURN) {
sc->sc_int_stats.ast_txurn++;
- a
th_hal_updatetxtrigl
evel(ah, AH_TRUE);
+ a
h->ah_updateTxTrigL
evel(ah, AH_TRUE);
}
ATH_SCHEDULE_TQUEUE(sc->sc_dev, &sc->sc_txtq);
}
ATH_SCHEDULE_TQUEUE(sc->sc_dev, &sc->sc_txtq);
@@
-1127,7
+1116,7
@@
static void ath_enable_intr_tgt(void *Context, A_UINT16 Command,
sc->sc_imask |= HAL_INT_BMISS;
}
sc->sc_imask |= HAL_INT_BMISS;
}
- a
th_hal_intrset
(ah, sc->sc_imask);
+ a
h->ah_setInterrupts
(ah, sc->sc_imask);
wmi_cmd_rsp(sc->tgt_wmi_handle, Command, SeqNo,NULL, 0);
}
wmi_cmd_rsp(sc->tgt_wmi_handle, Command, SeqNo,NULL, 0);
}
@@
-1146,18
+1135,8
@@
static void ath_init_tgt(void *Context, A_UINT16 Command,
if (ath_hal_htsupported(ah))
sc->sc_imask |= HAL_INT_CST;
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);
adf_os_setup_intr(sc->sc_dev, ath_intr);
- a
th_hal_intrset
(ah, sc->sc_imask);
+ a
h->ah_setInterrupts
(ah, sc->sc_imask);
wmi_cmd_rsp(sc->tgt_wmi_handle, Command, SeqNo, NULL, 0);
}
wmi_cmd_rsp(sc->tgt_wmi_handle, Command, SeqNo, NULL, 0);
}
@@
-1526,7
+1505,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;
struct ath_softc_tgt *sc = (struct ath_softc_tgt *)Context;
struct ath_hal *ah = sc->sc_ah;
- a
th_hal_intrset
(ah, 0);
+ a
h->ah_setInterrupts
(ah, 0);
wmi_cmd_rsp(sc->tgt_wmi_handle, Command, SeqNo,NULL, 0);
}
wmi_cmd_rsp(sc->tgt_wmi_handle, Command, SeqNo,NULL, 0);
}
@@
-1575,8
+1554,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;
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;
- a
th_hal_aborttxd
ma(sc->sc_ah);
+ a
h->ah_abortTxD
ma(sc->sc_ah);
wmi_cmd_rsp(sc->tgt_wmi_handle, Command, SeqNo, NULL, 0);
}
wmi_cmd_rsp(sc->tgt_wmi_handle, Command, SeqNo, NULL, 0);
}
@@
-1606,7
+1586,7
@@
static void ath_stop_tx_dma_tgt(void *Context, A_UINT16 Command,
q = *(a_uint32_t *)data;
q = adf_os_ntohl(q);
q = *(a_uint32_t *)data;
q = adf_os_ntohl(q);
- a
th_hal_stoptxd
ma(ah, q);
+ a
h->ah_stopTxD
ma(ah, q);
wmi_cmd_rsp(sc->tgt_wmi_handle, Command, SeqNo, NULL, 0);
}
wmi_cmd_rsp(sc->tgt_wmi_handle, Command, SeqNo, NULL, 0);
}
@@
-1626,9
+1606,9
@@
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;
struct ath_softc_tgt *sc = (struct ath_softc_tgt *)Context;
struct ath_hal *ah = sc->sc_ah;
- a
th_hal_stoppcurecv
(ah);
- a
th_hal_setrxf
ilter(ah, 0);
- a
th_hal_stopdmarecv
(ah);
+ a
h->ah_stopPcuReceive
(ah);
+ a
h->ah_setRxF
ilter(ah, 0);
+ a
h->ah_stopDmaReceive
(ah);
sc->sc_rxlink = NULL;
wmi_cmd_rsp(sc->tgt_wmi_handle, Command, SeqNo, NULL, 0);
sc->sc_rxlink = NULL;
wmi_cmd_rsp(sc->tgt_wmi_handle, Command, SeqNo, NULL, 0);
@@
-1655,7
+1635,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);
struct ath_hal *ah = sc->sc_ah;
ath_desc_free(sc);
- a
th_hal
_detach(ah);
+ a
h->ah
_detach(ah);
wmi_cmd_rsp(sc->tgt_wmi_handle, Command, SeqNo, NULL, 0);
adf_os_mem_free(sc);
}
wmi_cmd_rsp(sc->tgt_wmi_handle, Command, SeqNo, NULL, 0);
adf_os_mem_free(sc);
}
@@
-1940,14
+1920,14
@@
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_tgt_txq_setup(sc);
sc->sc_imask =0;
- a
th_hal_intrset(ah,
0);
+ a
h->ah_setInterrupts(ah,
0);
return 0;
bad:
bad2:
ath_desc_free(sc);
if (ah)
return 0;
bad:
bad2:
ath_desc_free(sc);
if (ah)
- a
th_hal
_detach(ah);
+ a
h->ah
_detach(ah);
}
static void tgt_hif_htc_wmi_shutdown(struct ath_softc_tgt *sc)
}
static void tgt_hif_htc_wmi_shutdown(struct ath_softc_tgt *sc)