提交 fe741e5e 编写于 作者: R Roland Vossen 提交者: Greg Kroah-Hartman

staging: brcm80211: replaced wlc_ by brcms_c_

Code cleanup.
Signed-off-by: NRoland Vossen <rvossen@broadcom.com>
Reviewed-by: NArend van Spriel <arend@broadcom.com>
Reviewed-by: NFranky Lin <frankyl@broadcom.com>
Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
上级 c654fce6
......@@ -20,8 +20,8 @@
#include "main.h"
#include "alloc.h"
static struct wlc_bsscfg *wlc_bsscfg_malloc(uint unit);
static void wlc_bsscfg_mfree(struct wlc_bsscfg *cfg);
static struct brcms_c_bsscfg *wlc_bsscfg_malloc(uint unit);
static void wlc_bsscfg_mfree(struct brcms_c_bsscfg *cfg);
static struct wlc_pub *wlc_pub_malloc(uint unit,
uint *err, uint devid);
static void wlc_pub_mfree(struct wlc_pub *pub);
......@@ -87,11 +87,11 @@ static void wlc_pub_mfree(struct wlc_pub *pub)
kfree(pub);
}
static struct wlc_bsscfg *wlc_bsscfg_malloc(uint unit)
static struct brcms_c_bsscfg *wlc_bsscfg_malloc(uint unit)
{
struct wlc_bsscfg *cfg;
struct brcms_c_bsscfg *cfg;
cfg = kzalloc(sizeof(struct wlc_bsscfg), GFP_ATOMIC);
cfg = kzalloc(sizeof(struct brcms_c_bsscfg), GFP_ATOMIC);
if (cfg == NULL)
goto fail;
......@@ -106,7 +106,7 @@ static struct wlc_bsscfg *wlc_bsscfg_malloc(uint unit)
return NULL;
}
static void wlc_bsscfg_mfree(struct wlc_bsscfg *cfg)
static void wlc_bsscfg_mfree(struct brcms_c_bsscfg *cfg)
{
if (cfg == NULL)
return;
......@@ -116,8 +116,8 @@ static void wlc_bsscfg_mfree(struct wlc_bsscfg *cfg)
kfree(cfg);
}
static void wlc_bsscfg_ID_assign(struct wlc_info *wlc,
struct wlc_bsscfg *bsscfg)
static void wlc_bsscfg_ID_assign(struct brcms_c_info *wlc,
struct brcms_c_bsscfg *bsscfg)
{
bsscfg->ID = wlc->next_bsscfg_ID;
wlc->next_bsscfg_ID++;
......@@ -126,17 +126,17 @@ static void wlc_bsscfg_ID_assign(struct wlc_info *wlc,
/*
* The common driver entry routine. Error codes should be unique
*/
struct wlc_info *wlc_attach_malloc(uint unit, uint *err, uint devid)
struct brcms_c_info *wlc_attach_malloc(uint unit, uint *err, uint devid)
{
struct wlc_info *wlc;
struct brcms_c_info *wlc;
wlc = kzalloc(sizeof(struct wlc_info), GFP_ATOMIC);
wlc = kzalloc(sizeof(struct brcms_c_info), GFP_ATOMIC);
if (wlc == NULL) {
*err = 1002;
goto fail;
}
/* allocate struct wlc_pub state structure */
/* allocate struct brcms_c_pub state structure */
wlc->pub = wlc_pub_malloc(unit, err, devid);
if (wlc->pub == NULL) {
*err = 1003;
......@@ -144,9 +144,9 @@ struct wlc_info *wlc_attach_malloc(uint unit, uint *err, uint devid)
}
wlc->pub->wlc = wlc;
/* allocate struct wlc_hw_info state structure */
/* allocate struct brcms_c_hw_info state structure */
wlc->hw = kzalloc(sizeof(struct wlc_hw_info), GFP_ATOMIC);
wlc->hw = kzalloc(sizeof(struct brcms_c_hw_info), GFP_ATOMIC);
if (wlc->hw == NULL) {
*err = 1005;
goto fail;
......@@ -154,7 +154,7 @@ struct wlc_info *wlc_attach_malloc(uint unit, uint *err, uint devid)
wlc->hw->wlc = wlc;
wlc->hw->bandstate[0] =
kzalloc(sizeof(struct wlc_hwband) * MAXBANDS, GFP_ATOMIC);
kzalloc(sizeof(struct brcms_c_hwband) * MAXBANDS, GFP_ATOMIC);
if (wlc->hw->bandstate[0] == NULL) {
*err = 1006;
goto fail;
......@@ -162,9 +162,9 @@ struct wlc_info *wlc_attach_malloc(uint unit, uint *err, uint devid)
int i;
for (i = 1; i < MAXBANDS; i++) {
wlc->hw->bandstate[i] = (struct wlc_hwband *)
wlc->hw->bandstate[i] = (struct brcms_c_hwband *)
((unsigned long)wlc->hw->bandstate[0] +
(sizeof(struct wlc_hwband) * i));
(sizeof(struct brcms_c_hwband) * i));
}
}
......@@ -202,20 +202,21 @@ struct wlc_info *wlc_attach_malloc(uint unit, uint *err, uint devid)
}
}
wlc->protection = kzalloc(sizeof(struct wlc_protection), GFP_ATOMIC);
wlc->protection = kzalloc(sizeof(struct brcms_c_protection),
GFP_ATOMIC);
if (wlc->protection == NULL) {
*err = 1016;
goto fail;
}
wlc->stf = kzalloc(sizeof(struct wlc_stf), GFP_ATOMIC);
wlc->stf = kzalloc(sizeof(struct brcms_c_stf), GFP_ATOMIC);
if (wlc->stf == NULL) {
*err = 1017;
goto fail;
}
wlc->bandstate[0] =
kzalloc(sizeof(struct wlcband)*MAXBANDS, GFP_ATOMIC);
kzalloc(sizeof(struct brcms_c_band)*MAXBANDS, GFP_ATOMIC);
if (wlc->bandstate[0] == NULL) {
*err = 1025;
goto fail;
......@@ -223,13 +224,13 @@ struct wlc_info *wlc_attach_malloc(uint unit, uint *err, uint devid)
int i;
for (i = 1; i < MAXBANDS; i++) {
wlc->bandstate[i] =
(struct wlcband *) ((unsigned long)wlc->bandstate[0]
+ (sizeof(struct wlcband)*i));
wlc->bandstate[i] = (struct brcms_c_band *)
((unsigned long)wlc->bandstate[0]
+ (sizeof(struct brcms_c_band)*i));
}
}
wlc->corestate = kzalloc(sizeof(struct wlccore), GFP_ATOMIC);
wlc->corestate = kzalloc(sizeof(struct brcms_c_core), GFP_ATOMIC);
if (wlc->corestate == NULL) {
*err = 1026;
goto fail;
......@@ -249,7 +250,7 @@ struct wlc_info *wlc_attach_malloc(uint unit, uint *err, uint devid)
return NULL;
}
void wlc_detach_mfree(struct wlc_info *wlc)
void wlc_detach_mfree(struct brcms_c_info *wlc)
{
if (wlc == NULL)
return;
......
......@@ -14,5 +14,5 @@
* CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
extern struct wlc_info *wlc_attach_malloc(uint unit, uint *err, uint devid);
extern void wlc_detach_mfree(struct wlc_info *wlc);
extern struct brcms_c_info *wlc_attach_malloc(uint unit, uint *err, uint devid);
extern void wlc_detach_mfree(struct brcms_c_info *wlc);
......@@ -72,7 +72,7 @@ typedef struct wlc_fifo_info {
/* AMPDU module specific state */
struct ampdu_info {
struct wlc_info *wlc; /* pointer to main wlc structure */
struct brcms_c_info *wlc; /* pointer to main wlc structure */
int scb_handle; /* scb cubby handle to retrieve data from scb */
u8 ini_enable[AMPDU_MAX_SCB_TID]; /* per-tid initiator enable/disable of ampdu */
u8 ba_tx_wsize; /* Tx ba window size (in pdu) */
......@@ -111,7 +111,7 @@ struct cb_del_ampdu_pars {
#define SCB_AMPDU_INI(scb_ampdu, tid) (&(scb_ampdu->ini[tid]))
static void wlc_ffpld_init(struct ampdu_info *ampdu);
static int wlc_ffpld_check_txfunfl(struct wlc_info *wlc, int f);
static int wlc_ffpld_check_txfunfl(struct brcms_c_info *wlc, int f);
static void wlc_ffpld_calc_mcs2ampdu_table(struct ampdu_info *ampdu, int f);
static scb_ampdu_tid_ini_t *wlc_ampdu_init_tid_ini(struct ampdu_info *ampdu,
......@@ -130,7 +130,7 @@ static void wlc_ampdu_dotxstatus_complete(struct ampdu_info *ampdu,
static bool wlc_ampdu_cap(struct ampdu_info *ampdu);
static int wlc_ampdu_set(struct ampdu_info *ampdu, bool on);
struct ampdu_info *wlc_ampdu_attach(struct wlc_info *wlc)
struct ampdu_info *wlc_ampdu_attach(struct brcms_c_info *wlc)
{
struct ampdu_info *ampdu;
int i;
......@@ -197,7 +197,7 @@ void wlc_ampdu_detach(struct ampdu_info *ampdu)
kfree(ampdu->ini_free[i]);
}
wlc_module_unregister(ampdu->wlc->pub, "ampdu", ampdu);
brcms_c_module_unregister(ampdu->wlc->pub, "ampdu", ampdu);
kfree(ampdu);
}
......@@ -258,7 +258,7 @@ static void wlc_ffpld_init(struct ampdu_info *ampdu)
* Return 1 if pre-loading not active, -1 if not an underflow event,
* 0 if pre-loading module took care of the event.
*/
static int wlc_ffpld_check_txfunfl(struct wlc_info *wlc, int fid)
static int wlc_ffpld_check_txfunfl(struct brcms_c_info *wlc, int fid)
{
struct ampdu_info *ampdu = wlc->ampdu;
u32 phy_rate = MCS_RATE(FFPLD_MAX_MCS, true, false);
......@@ -273,7 +273,7 @@ static int wlc_ffpld_check_txfunfl(struct wlc_info *wlc, int fid)
/* return if we got here for a different reason than underflows */
cur_txunfl =
wlc_read_shm(wlc,
brcms_c_read_shm(wlc,
M_UCODE_MACSTAT + offsetof(macstat_t, txfunfl[fid]));
new_txunfl = (u16) (cur_txunfl - fifo->prev_txfunfl);
if (new_txunfl == 0) {
......@@ -286,9 +286,8 @@ static int wlc_ffpld_check_txfunfl(struct wlc_info *wlc, int fid)
return 1;
/* check if fifo is big enough */
if (wlc_xmtfifo_sz_get(wlc, fid, &xmtfifo_sz)) {
if (brcms_c_xmtfifo_sz_get(wlc, fid, &xmtfifo_sz))
return -1;
}
if ((TXFIFO_SIZE_UNIT * (u32) xmtfifo_sz) <= ampdu->ffpld_rsvd)
return 1;
......@@ -428,10 +427,10 @@ wlc_ampdu_agg(struct ampdu_info *ampdu, struct scb *scb, struct sk_buff *p,
}
int
wlc_sendampdu(struct ampdu_info *ampdu, struct wlc_txq_info *qi,
wlc_sendampdu(struct ampdu_info *ampdu, struct brcms_c_txq_info *qi,
struct sk_buff **pdu, int prec)
{
struct wlc_info *wlc;
struct brcms_c_info *wlc;
struct sk_buff *p, *pkt[AMPDU_MAX_MPDU];
u8 tid, ndelim;
int err = 0;
......@@ -493,7 +492,7 @@ wlc_sendampdu(struct ampdu_info *ampdu, struct wlc_txq_info *qi,
txrate = tx_info->status.rates;
if (tx_info->flags & IEEE80211_TX_CTL_AMPDU) {
err = wlc_prep_pdu(wlc, p, &fifo);
err = brcms_c_prep_pdu(wlc, p, &fifo);
} else {
wiphy_err(wiphy, "%s: AMPDU flag is off!\n", __func__);
*pdu = NULL;
......@@ -643,11 +642,11 @@ wlc_sendampdu(struct ampdu_info *ampdu, struct wlc_txq_info *qi,
if (use_rts || use_cts) {
rts_rspec =
wlc_rspec_to_rts_rspec(wlc, rspec, false,
mimo_ctlchbw);
brcms_c_rspec_to_rts_rspec(wlc,
rspec, false, mimo_ctlchbw);
rts_rspec_fallback =
wlc_rspec_to_rts_rspec(wlc, rspec_fallback,
false, mimo_ctlchbw);
brcms_c_rspec_to_rts_rspec(wlc,
rspec_fallback, false, mimo_ctlchbw);
}
}
......@@ -730,13 +729,14 @@ wlc_sendampdu(struct ampdu_info *ampdu, struct wlc_txq_info *qi,
/* reset the mixed mode header durations */
if (txh->MModeLen) {
u16 mmodelen =
wlc_calc_lsig_len(wlc, rspec, ampdu_len);
brcms_c_calc_lsig_len(wlc, rspec, ampdu_len);
txh->MModeLen = cpu_to_le16(mmodelen);
preamble_type = WLC_MM_PREAMBLE;
}
if (txh->MModeFbrLen) {
u16 mmfbrlen =
wlc_calc_lsig_len(wlc, rspec_fallback, ampdu_len);
brcms_c_calc_lsig_len(wlc, rspec_fallback,
ampdu_len);
txh->MModeFbrLen = cpu_to_le16(mmfbrlen);
fbr_preamble_type = WLC_MM_PREAMBLE;
}
......@@ -763,12 +763,12 @@ wlc_sendampdu(struct ampdu_info *ampdu, struct wlc_txq_info *qi,
rts_fbr_preamble_type = WLC_SHORT_PREAMBLE;
durid =
wlc_compute_rtscts_dur(wlc, use_cts, rts_rspec,
brcms_c_compute_rtscts_dur(wlc, use_cts, rts_rspec,
rspec, rts_preamble_type,
preamble_type, ampdu_len,
true);
rts->duration = cpu_to_le16(durid);
durid = wlc_compute_rtscts_dur(wlc, use_cts,
durid = brcms_c_compute_rtscts_dur(wlc, use_cts,
rts_rspec_fallback,
rspec_fallback,
rts_fbr_preamble_type,
......@@ -799,7 +799,7 @@ wlc_sendampdu(struct ampdu_info *ampdu, struct wlc_txq_info *qi,
"TXFID_RATE_PROBE_MASK!?\n", __func__);
}
for (i = 0; i < count; i++)
wlc_txfifo(wlc, fifo, pkt[i], i == (count - 1),
brcms_c_txfifo(wlc, fifo, pkt[i], i == (count - 1),
ampdu->txpkt_weight);
}
......@@ -812,7 +812,7 @@ wlc_ampdu_dotxstatus(struct ampdu_info *ampdu, struct scb *scb,
struct sk_buff *p, tx_status_t *txs)
{
scb_ampdu_t *scb_ampdu;
struct wlc_info *wlc = ampdu->wlc;
struct brcms_c_info *wlc = ampdu->wlc;
scb_ampdu_tid_ini_t *ini;
u32 s1 = 0, s2 = 0;
struct ieee80211_tx_info *tx_info;
......@@ -858,13 +858,13 @@ wlc_ampdu_dotxstatus(struct ampdu_info *ampdu, struct scb *scb,
break;
p = GETNEXTTXP(wlc, queue);
}
wlc_txfifo_complete(wlc, queue, ampdu->txpkt_weight);
brcms_c_txfifo_complete(wlc, queue, ampdu->txpkt_weight);
}
wlc_ampdu_txflowcontrol(wlc, scb_ampdu, ini);
}
static void
rate_status(struct wlc_info *wlc, struct ieee80211_tx_info *tx_info,
rate_status(struct brcms_c_info *wlc, struct ieee80211_tx_info *tx_info,
tx_status_t *txs, u8 mcs)
{
struct ieee80211_tx_rate *txrate = tx_info->status.rates;
......@@ -885,7 +885,7 @@ wlc_ampdu_dotxstatus_complete(struct ampdu_info *ampdu, struct scb *scb,
u32 s1, u32 s2)
{
scb_ampdu_t *scb_ampdu;
struct wlc_info *wlc = ampdu->wlc;
struct brcms_c_info *wlc = ampdu->wlc;
scb_ampdu_tid_ini_t *ini;
u8 bitmap[8], queue, tid;
d11txh_t *txh;
......@@ -981,9 +981,9 @@ wlc_ampdu_dotxstatus_complete(struct ampdu_info *ampdu, struct scb *scb,
if (WL_ERROR_ON()) {
brcmu_prpkt("txpkt (AMPDU)", p);
wlc_print_txdesc((d11txh_t *) p->data);
brcms_c_print_txdesc((d11txh_t *) p->data);
}
wlc_print_txstatus(txs);
brcms_c_print_txstatus(txs);
}
}
......@@ -1040,8 +1040,9 @@ wlc_ampdu_dotxstatus_complete(struct ampdu_info *ampdu, struct scb *scb,
ini->txretry[index]++;
ini->tx_in_transit--;
/* Use high prededence for retransmit to give some punch */
/* wlc_txq_enq(wlc, scb, p, WLC_PRIO_TO_PREC(tid)); */
wlc_txq_enq(wlc, scb, p,
/* brcms_c_txq_enq(wlc, scb, p,
* WLC_PRIO_TO_PREC(tid)); */
brcms_c_txq_enq(wlc, scb, p,
WLC_PRIO_TO_HI_PREC(tid));
} else {
/* Retry timeout */
......@@ -1069,12 +1070,12 @@ wlc_ampdu_dotxstatus_complete(struct ampdu_info *ampdu, struct scb *scb,
p = GETNEXTTXP(wlc, queue);
}
wlc_send_q(wlc);
brcms_c_send_q(wlc);
/* update rate state */
antselid = wlc_antsel_antsel2id(wlc->asi, mimoantsel);
wlc_txfifo_complete(wlc, queue, ampdu->txpkt_weight);
brcms_c_txfifo_complete(wlc, queue, ampdu->txpkt_weight);
}
/* initialize the initiator code for tid */
......@@ -1100,7 +1101,7 @@ static scb_ampdu_tid_ini_t *wlc_ampdu_init_tid_ini(struct ampdu_info *ampdu,
static int wlc_ampdu_set(struct ampdu_info *ampdu, bool on)
{
struct wlc_info *wlc = ampdu->wlc;
struct brcms_c_info *wlc = ampdu->wlc;
wlc->pub->_ampdu = false;
......@@ -1150,34 +1151,35 @@ static void ampdu_update_max_txlen(struct ampdu_info *ampdu, u8 dur)
}
}
void wlc_ampdu_macaddr_upd(struct wlc_info *wlc)
void wlc_ampdu_macaddr_upd(struct brcms_c_info *wlc)
{
char template[T_RAM_ACCESS_SZ * 2];
/* driver needs to write the ta in the template; ta is at offset 16 */
memset(template, 0, sizeof(template));
memcpy(template, wlc->pub->cur_etheraddr, ETH_ALEN);
wlc_write_template_ram(wlc, (T_BA_TPL_BASE + 16), (T_RAM_ACCESS_SZ * 2),
template);
brcms_c_write_template_ram(wlc, (T_BA_TPL_BASE + 16),
(T_RAM_ACCESS_SZ * 2),
template);
}
bool wlc_aggregatable(struct wlc_info *wlc, u8 tid)
bool brcms_c_aggregatable(struct brcms_c_info *wlc, u8 tid)
{
return wlc->ampdu->ini_enable[tid];
}
void wlc_ampdu_shm_upd(struct ampdu_info *ampdu)
{
struct wlc_info *wlc = ampdu->wlc;
struct brcms_c_info *wlc = ampdu->wlc;
/* Extend ucode internal watchdog timer to match larger received frames */
if ((ampdu->rx_factor & IEEE80211_HT_AMPDU_PARM_FACTOR) ==
IEEE80211_HT_MAX_AMPDU_64K) {
wlc_write_shm(wlc, M_MIMO_MAXSYM, MIMO_MAXSYM_MAX);
wlc_write_shm(wlc, M_WATCHDOG_8TU, WATCHDOG_8TU_MAX);
brcms_c_write_shm(wlc, M_MIMO_MAXSYM, MIMO_MAXSYM_MAX);
brcms_c_write_shm(wlc, M_WATCHDOG_8TU, WATCHDOG_8TU_MAX);
} else {
wlc_write_shm(wlc, M_MIMO_MAXSYM, MIMO_MAXSYM_DEF);
wlc_write_shm(wlc, M_WATCHDOG_8TU, WATCHDOG_8TU_DEF);
brcms_c_write_shm(wlc, M_MIMO_MAXSYM, MIMO_MAXSYM_DEF);
brcms_c_write_shm(wlc, M_WATCHDOG_8TU, WATCHDOG_8TU_DEF);
}
}
......@@ -1215,10 +1217,10 @@ static void dma_cb_fn_ampdu(void *txi, void *arg_a)
* When a remote party is no longer available for ampdu communication, any
* pending tx ampdu packets in the driver have to be flushed.
*/
void wlc_ampdu_flush(struct wlc_info *wlc,
void wlc_ampdu_flush(struct brcms_c_info *wlc,
struct ieee80211_sta *sta, u16 tid)
{
struct wlc_txq_info *qi = wlc->pkt_queue;
struct brcms_c_txq_info *qi = wlc->pkt_queue;
struct pktq *pq = &qi->q;
int prec;
struct cb_del_ampdu_pars ampdu_pars;
......@@ -1229,5 +1231,5 @@ void wlc_ampdu_flush(struct wlc_info *wlc,
brcmu_pktq_pflush(pq, prec, true, cb_del_ampdu_pkt,
(void *)&ampdu_pars);
}
wlc_inval_dma_pkts(wlc->hw, sta, dma_cb_fn_ampdu);
brcms_c_inval_dma_pkts(wlc->hw, sta, dma_cb_fn_ampdu);
}
......@@ -17,13 +17,13 @@
#ifndef _BRCM_AMPDU_H_
#define _BRCM_AMPDU_H_
extern struct ampdu_info *wlc_ampdu_attach(struct wlc_info *wlc);
extern struct ampdu_info *wlc_ampdu_attach(struct brcms_c_info *wlc);
extern void wlc_ampdu_detach(struct ampdu_info *ampdu);
extern int wlc_sendampdu(struct ampdu_info *ampdu, struct wlc_txq_info *qi,
extern int wlc_sendampdu(struct ampdu_info *ampdu, struct brcms_c_txq_info *qi,
struct sk_buff **aggp, int prec);
extern void wlc_ampdu_dotxstatus(struct ampdu_info *ampdu, struct scb *scb,
struct sk_buff *p, tx_status_t *txs);
extern void wlc_ampdu_macaddr_upd(struct wlc_info *wlc);
extern void wlc_ampdu_macaddr_upd(struct brcms_c_info *wlc);
extern void wlc_ampdu_shm_upd(struct ampdu_info *ampdu);
#endif /* _BRCM_AMPDU_H_ */
......@@ -81,7 +81,7 @@ const u8 mimo_2x3_div_antselid_tbl[16] = {
0, 0, 0, 0, 0, 0, 0, 0 /* pat to antselid */
};
struct antsel_info *wlc_antsel_attach(struct wlc_info *wlc)
struct antsel_info *wlc_antsel_attach(struct brcms_c_info *wlc)
{
struct antsel_info *asi;
......@@ -282,7 +282,7 @@ static u16 wlc_antsel_antcfg2antsel(struct antsel_info *asi, u8 ant_cfg)
/* boardlevel antenna selection: ucode interface control */
static int wlc_antsel_cfgupd(struct antsel_info *asi, wlc_antselcfg_t *antsel)
{
struct wlc_info *wlc = asi->wlc;
struct brcms_c_info *wlc = asi->wlc;
u8 ant_cfg;
u16 mimo_antsel;
......@@ -291,7 +291,7 @@ static int wlc_antsel_cfgupd(struct antsel_info *asi, wlc_antselcfg_t *antsel)
*/
ant_cfg = antsel->ant_config[ANT_SELCFG_TX_DEF];
mimo_antsel = wlc_antsel_antcfg2antsel(asi, ant_cfg);
wlc_write_shm(wlc, M_MIMO_ANTSEL_TXDFLT, mimo_antsel);
brcms_c_write_shm(wlc, M_MIMO_ANTSEL_TXDFLT, mimo_antsel);
/* Update driver stats for currently selected default tx/rx antenna config */
asi->antcfg_cur.ant_config[ANT_SELCFG_TX_DEF] = ant_cfg;
......@@ -300,7 +300,7 @@ static int wlc_antsel_cfgupd(struct antsel_info *asi, wlc_antselcfg_t *antsel)
*/
ant_cfg = antsel->ant_config[ANT_SELCFG_RX_DEF];
mimo_antsel = wlc_antsel_antcfg2antsel(asi, ant_cfg);
wlc_write_shm(wlc, M_MIMO_ANTSEL_RXDFLT, mimo_antsel);
brcms_c_write_shm(wlc, M_MIMO_ANTSEL_RXDFLT, mimo_antsel);
/* Update driver stats for currently selected default tx/rx antenna config */
asi->antcfg_cur.ant_config[ANT_SELCFG_RX_DEF] = ant_cfg;
......
......@@ -17,7 +17,7 @@
#ifndef _BRCM_ANTSEL_H_
#define _BRCM_ANTSEL_H_
extern struct antsel_info *wlc_antsel_attach(struct wlc_info *wlc);
extern struct antsel_info *wlc_antsel_attach(struct brcms_c_info *wlc);
extern void wlc_antsel_detach(struct antsel_info *asi);
extern void wlc_antsel_init(struct antsel_info *asi);
extern void wlc_antsel_antcfg_get(struct antsel_info *asi, bool usedef,
......
......@@ -19,7 +19,7 @@
#include <brcmu_wifi.h>
#include "types.h"
/* dup state between BMAC(struct wlc_hw_info) and HIGH(struct wlc_info)
/* dup state between BMAC(struct brcms_c_hw_info) and HIGH(struct brcms_c_info)
driver */
struct brcms_b_state {
u32 machwcap; /* mac hw capibility */
......@@ -71,100 +71,104 @@ enum {
IOV_BMAC_LAST
};
extern int brcms_b_attach(struct wlc_info *wlc, u16 vendor, u16 device,
extern int brcms_b_attach(struct brcms_c_info *wlc, u16 vendor, u16 device,
uint unit, bool piomode, void *regsva, uint bustype,
void *btparam);
extern int brcms_b_detach(struct wlc_info *wlc);
extern int brcms_b_detach(struct brcms_c_info *wlc);
extern void brcms_b_watchdog(void *arg);
/* up/down, reset, clk */
extern void brcms_b_copyto_objmem(struct wlc_hw_info *wlc_hw,
extern void brcms_b_copyto_objmem(struct brcms_c_hw_info *wlc_hw,
uint offset, const void *buf, int len,
u32 sel);
extern void brcms_b_copyfrom_objmem(struct wlc_hw_info *wlc_hw, uint offset,
extern void brcms_b_copyfrom_objmem(struct brcms_c_hw_info *wlc_hw, uint offset,
void *buf, int len, u32 sel);
#define brcms_b_copyfrom_shm(wlc_hw, offset, buf, len) \
brcms_b_copyfrom_objmem(wlc_hw, offset, buf, len, OBJADDR_SHM_SEL)
#define brcms_b_copyto_shm(wlc_hw, offset, buf, len) \
brcms_b_copyto_objmem(wlc_hw, offset, buf, len, OBJADDR_SHM_SEL)
extern void brcms_b_core_phypll_reset(struct wlc_hw_info *wlc_hw);
extern void brcms_b_core_phypll_ctl(struct wlc_hw_info *wlc_hw, bool on);
extern void brcms_b_phyclk_fgc(struct wlc_hw_info *wlc_hw, bool clk);
extern void brcms_b_macphyclk_set(struct wlc_hw_info *wlc_hw, bool clk);
extern void brcms_b_phy_reset(struct wlc_hw_info *wlc_hw);
extern void brcms_b_corereset(struct wlc_hw_info *wlc_hw, u32 flags);
extern void brcms_b_reset(struct wlc_hw_info *wlc_hw);
extern void brcms_b_init(struct wlc_hw_info *wlc_hw, chanspec_t chanspec,
extern void brcms_b_core_phypll_reset(struct brcms_c_hw_info *wlc_hw);
extern void brcms_b_core_phypll_ctl(struct brcms_c_hw_info *wlc_hw, bool on);
extern void brcms_b_phyclk_fgc(struct brcms_c_hw_info *wlc_hw, bool clk);
extern void brcms_b_macphyclk_set(struct brcms_c_hw_info *wlc_hw, bool clk);
extern void brcms_b_phy_reset(struct brcms_c_hw_info *wlc_hw);
extern void brcms_b_corereset(struct brcms_c_hw_info *wlc_hw, u32 flags);
extern void brcms_b_reset(struct brcms_c_hw_info *wlc_hw);
extern void brcms_b_init(struct brcms_c_hw_info *wlc_hw, chanspec_t chanspec,
bool mute);
extern int brcms_b_up_prep(struct wlc_hw_info *wlc_hw);
extern int brcms_b_up_finish(struct wlc_hw_info *wlc_hw);
extern int brcms_b_bmac_down_prep(struct wlc_hw_info *wlc_hw);
extern int brcms_b_down_finish(struct wlc_hw_info *wlc_hw);
extern void brcms_b_switch_macfreq(struct wlc_hw_info *wlc_hw, u8 spurmode);
extern int brcms_b_up_prep(struct brcms_c_hw_info *wlc_hw);
extern int brcms_b_up_finish(struct brcms_c_hw_info *wlc_hw);
extern int brcms_b_bmac_down_prep(struct brcms_c_hw_info *wlc_hw);
extern int brcms_b_down_finish(struct brcms_c_hw_info *wlc_hw);
extern void brcms_b_switch_macfreq(struct brcms_c_hw_info *wlc_hw, u8 spurmode);
/* chanspec, ucode interface */
extern void brcms_b_set_chanspec(struct wlc_hw_info *wlc_hw,
extern void brcms_b_set_chanspec(struct brcms_c_hw_info *wlc_hw,
chanspec_t chanspec,
bool mute, struct txpwr_limits *txpwr);
extern int brcms_b_xmtfifo_sz_get(struct wlc_hw_info *wlc_hw, uint fifo,
extern int brcms_b_xmtfifo_sz_get(struct brcms_c_hw_info *wlc_hw, uint fifo,
uint *blocks);
extern void brcms_b_mhf(struct wlc_hw_info *wlc_hw, u8 idx, u16 mask,
extern void brcms_b_mhf(struct brcms_c_hw_info *wlc_hw, u8 idx, u16 mask,
u16 val, int bands);
extern void brcms_b_mctrl(struct wlc_hw_info *wlc_hw, u32 mask, u32 val);
extern u16 brcms_b_mhf_get(struct wlc_hw_info *wlc_hw, u8 idx, int bands);
extern void brcms_b_txant_set(struct wlc_hw_info *wlc_hw, u16 phytxant);
extern u16 brcms_b_get_txant(struct wlc_hw_info *wlc_hw);
extern void brcms_b_antsel_type_set(struct wlc_hw_info *wlc_hw,
extern void brcms_b_mctrl(struct brcms_c_hw_info *wlc_hw, u32 mask, u32 val);
extern u16 brcms_b_mhf_get(struct brcms_c_hw_info *wlc_hw, u8 idx, int bands);
extern void brcms_b_txant_set(struct brcms_c_hw_info *wlc_hw, u16 phytxant);
extern u16 brcms_b_get_txant(struct brcms_c_hw_info *wlc_hw);
extern void brcms_b_antsel_type_set(struct brcms_c_hw_info *wlc_hw,
u8 antsel_type);
extern int brcms_b_state_get(struct wlc_hw_info *wlc_hw,
extern int brcms_b_state_get(struct brcms_c_hw_info *wlc_hw,
brcms_b_state_t *state);
extern void brcms_b_write_shm(struct wlc_hw_info *wlc_hw, uint offset, u16 v);
extern u16 brcms_b_read_shm(struct wlc_hw_info *wlc_hw, uint offset);
extern void brcms_b_write_template_ram(struct wlc_hw_info *wlc_hw, int offset,
int len, void *buf);
extern void brcms_b_copyfrom_vars(struct wlc_hw_info *wlc_hw, char **buf,
extern void brcms_b_write_shm(struct brcms_c_hw_info *wlc_hw, uint offset,
u16 v);
extern u16 brcms_b_read_shm(struct brcms_c_hw_info *wlc_hw, uint offset);
extern void brcms_b_write_template_ram(struct brcms_c_hw_info *wlc_hw,
int offset, int len, void *buf);
extern void brcms_b_copyfrom_vars(struct brcms_c_hw_info *wlc_hw, char **buf,
uint *len);
extern void brcms_b_hw_etheraddr(struct wlc_hw_info *wlc_hw,
extern void brcms_b_hw_etheraddr(struct brcms_c_hw_info *wlc_hw,
u8 *ea);
extern bool brcms_b_radio_read_hwdisabled(struct wlc_hw_info *wlc_hw);
extern void brcms_b_set_shortslot(struct wlc_hw_info *wlc_hw, bool shortslot);
extern void brcms_b_band_stf_ss_set(struct wlc_hw_info *wlc_hw, u8 stf_mode);
extern bool brcms_b_radio_read_hwdisabled(struct brcms_c_hw_info *wlc_hw);
extern void brcms_b_set_shortslot(struct brcms_c_hw_info *wlc_hw,
bool shortslot);
extern void brcms_b_band_stf_ss_set(struct brcms_c_hw_info *wlc_hw,
u8 stf_mode);
extern void brcms_b_wait_for_wake(struct wlc_hw_info *wlc_hw);
extern void brcms_b_wait_for_wake(struct brcms_c_hw_info *wlc_hw);
extern void wlc_ucode_wake_override_set(struct wlc_hw_info *wlc_hw,
extern void wlc_ucode_wake_override_set(struct brcms_c_hw_info *wlc_hw,
u32 override_bit);
extern void wlc_ucode_wake_override_clear(struct wlc_hw_info *wlc_hw,
extern void wlc_ucode_wake_override_clear(struct brcms_c_hw_info *wlc_hw,
u32 override_bit);
extern void brcms_b_set_addrmatch(struct wlc_hw_info *wlc_hw,
extern void brcms_b_set_addrmatch(struct brcms_c_hw_info *wlc_hw,
int match_reg_offset,
const u8 *addr);
extern void brcms_b_write_hw_bcntemplates(struct wlc_hw_info *wlc_hw,
extern void brcms_b_write_hw_bcntemplates(struct brcms_c_hw_info *wlc_hw,
void *bcn, int len, bool both);
extern void brcms_b_read_tsf(struct wlc_hw_info *wlc_hw, u32 *tsf_l_ptr,
extern void brcms_b_read_tsf(struct brcms_c_hw_info *wlc_hw, u32 *tsf_l_ptr,
u32 *tsf_h_ptr);
extern void brcms_b_set_cwmin(struct wlc_hw_info *wlc_hw, u16 newmin);
extern void brcms_b_set_cwmax(struct wlc_hw_info *wlc_hw, u16 newmax);
extern void brcms_b_set_cwmin(struct brcms_c_hw_info *wlc_hw, u16 newmin);
extern void brcms_b_set_cwmax(struct brcms_c_hw_info *wlc_hw, u16 newmax);
extern void brcms_b_retrylimit_upd(struct wlc_hw_info *wlc_hw, u16 SRL,
extern void brcms_b_retrylimit_upd(struct brcms_c_hw_info *wlc_hw, u16 SRL,
u16 LRL);
extern void brcms_b_fifoerrors(struct wlc_hw_info *wlc_hw);
extern void brcms_b_fifoerrors(struct brcms_c_hw_info *wlc_hw);
/* API for BMAC driver (e.g. wlc_phy.c etc) */
extern void brcms_b_bw_set(struct wlc_hw_info *wlc_hw, u16 bw);
extern void brcms_b_pllreq(struct wlc_hw_info *wlc_hw, bool set,
extern void brcms_b_bw_set(struct brcms_c_hw_info *wlc_hw, u16 bw);
extern void brcms_b_pllreq(struct brcms_c_hw_info *wlc_hw, bool set,
mbool req_bit);
extern void brcms_b_hw_up(struct wlc_hw_info *wlc_hw);
extern u16 brcms_b_rate_shm_offset(struct wlc_hw_info *wlc_hw, u8 rate);
extern void brcms_b_antsel_set(struct wlc_hw_info *wlc_hw, u32 antsel_avail);
extern void brcms_b_hw_up(struct brcms_c_hw_info *wlc_hw);
extern u16 brcms_b_rate_shm_offset(struct brcms_c_hw_info *wlc_hw, u8 rate);
extern void brcms_b_antsel_set(struct brcms_c_hw_info *wlc_hw,
u32 antsel_avail);
#endif /* _BRCM_BOTTOM_MAC_H_ */
......@@ -40,7 +40,7 @@ typedef struct wlc_cm_band {
struct wlc_cm_info {
struct wlc_pub *pub;
struct wlc_info *wlc;
struct brcms_c_info *wlc;
char srom_ccode[WLC_CNTRY_BUF_SZ]; /* Country Code in SROM */
uint srom_regrev; /* Regulatory Rev for the SROM ccode */
const country_info_t *country; /* current country def */
......@@ -77,13 +77,13 @@ static bool wlc_valid_channel20_db(wlc_cm_info_t *wlc_cm, uint val);
static bool wlc_valid_channel20_in_band(wlc_cm_info_t *wlc_cm, uint bandunit,
uint val);
static bool wlc_valid_channel20(wlc_cm_info_t *wlc_cm, uint val);
static const country_info_t *wlc_country_lookup(struct wlc_info *wlc,
static const country_info_t *wlc_country_lookup(struct brcms_c_info *wlc,
const char *ccode);
static void wlc_locale_get_channels(const locale_info_t *locale,
chanvec_t *valid_channels);
static const locale_info_t *wlc_get_locale_2g(u8 locale_idx);
static const locale_info_t *wlc_get_locale_5g(u8 locale_idx);
static bool wlc_japan(struct wlc_info *wlc);
static bool wlc_japan(struct brcms_c_info *wlc);
static bool wlc_japan_ccode(const char *ccode);
static void wlc_channel_min_txpower_limits_with_local_constraint(wlc_cm_info_t *
wlc_cm,
......@@ -611,7 +611,7 @@ static const locale_mimo_info_t *wlc_get_mimo_5g(u8 locale_idx)
return g_mimo_5g_table[locale_idx];
}
wlc_cm_info_t *wlc_channel_mgr_attach(struct wlc_info *wlc)
wlc_cm_info_t *wlc_channel_mgr_attach(struct brcms_c_info *wlc)
{
wlc_cm_info_t *wlc_cm;
char country_abbrev[WLC_CNTRY_BUF_SZ];
......@@ -718,7 +718,7 @@ wlc_set_country_common(wlc_cm_info_t *wlc_cm,
{
const locale_mimo_info_t *li_mimo;
const locale_info_t *locale;
struct wlc_info *wlc = wlc_cm->wlc;
struct brcms_c_info *wlc = wlc_cm->wlc;
char prev_country_abbrev[WLC_CNTRY_BUF_SZ];
/* save current country state */
......@@ -735,12 +735,12 @@ wlc_set_country_common(wlc_cm_info_t *wlc_cm,
/* disable/restore nmode based on country regulations */
li_mimo = wlc_get_mimo_2g(country->locale_mimo_2G);
if (li_mimo && (li_mimo->flags & WLC_NO_MIMO)) {
wlc_set_nmode(wlc, OFF);
brcms_c_set_nmode(wlc, OFF);
wlc->stf->no_cddstbc = true;
} else {
wlc->stf->no_cddstbc = false;
if (N_ENAB(wlc->pub) != wlc->protection->nmode_user)
wlc_set_nmode(wlc, wlc->protection->nmode_user);
brcms_c_set_nmode(wlc, wlc->protection->nmode_user);
}
wlc_stf_ss_update(wlc, wlc->bandstate[BAND_2G_INDEX]);
......@@ -748,9 +748,9 @@ wlc_set_country_common(wlc_cm_info_t *wlc_cm,
/* set or restore gmode as required by regulatory */
locale = wlc_get_locale_2g(country->locale_2G);
if (locale && (locale->flags & WLC_NO_OFDM)) {
wlc_set_gmode(wlc, GMODE_LEGACY_B, false);
brcms_c_set_gmode(wlc, GMODE_LEGACY_B, false);
} else {
wlc_set_gmode(wlc, wlc->protection->gmode_user, false);
brcms_c_set_gmode(wlc, wlc->protection->gmode_user, false);
}
wlc_channels_init(wlc_cm, country);
......@@ -761,7 +761,7 @@ wlc_set_country_common(wlc_cm_info_t *wlc_cm,
/* Lookup a country info structure from a null terminated country code
* The lookup is case sensitive.
*/
static const country_info_t *wlc_country_lookup(struct wlc_info *wlc,
static const country_info_t *wlc_country_lookup(struct brcms_c_info *wlc,
const char *ccode)
{
const country_info_t *country;
......@@ -780,7 +780,7 @@ static const country_info_t *wlc_countrycode_map(wlc_cm_info_t *wlc_cm,
char *mapped_ccode,
uint *mapped_regrev)
{
struct wlc_info *wlc = wlc_cm->wlc;
struct brcms_c_info *wlc = wlc_cm->wlc;
const country_info_t *country;
uint srom_regrev = wlc_cm->srom_regrev;
const char *srom_ccode = wlc_cm->srom_ccode;
......@@ -859,9 +859,9 @@ static const country_info_t *wlc_country_lookup_direct(const char *ccode,
static int
wlc_channels_init(wlc_cm_info_t *wlc_cm, const country_info_t *country)
{
struct wlc_info *wlc = wlc_cm->wlc;
struct brcms_c_info *wlc = wlc_cm->wlc;
uint i, j;
struct wlcband *band;
struct brcms_c_band *band;
const locale_info_t *li;
chanvec_t sup_chan;
const locale_mimo_info_t *li_mimo;
......@@ -911,7 +911,7 @@ wlc_channels_init(wlc_cm_info_t *wlc_cm, const country_info_t *country)
*/
static void wlc_channels_commit(wlc_cm_info_t *wlc_cm)
{
struct wlc_info *wlc = wlc_cm->wlc;
struct brcms_c_info *wlc = wlc_cm->wlc;
uint chan;
struct txpwr_limits txpwr;
......@@ -960,9 +960,9 @@ static void wlc_channels_commit(wlc_cm_info_t *wlc_cm)
/* reset the quiet channels vector to the union of the restricted and radar channel sets */
static void wlc_quiet_channels_reset(wlc_cm_info_t *wlc_cm)
{
struct wlc_info *wlc = wlc_cm->wlc;
struct brcms_c_info *wlc = wlc_cm->wlc;
uint i, j;
struct wlcband *band;
struct brcms_c_band *band;
const chanvec_t *chanvec;
memset(&wlc_cm->quiet_channels, 0, sizeof(chanvec_t));
......@@ -998,7 +998,7 @@ static bool wlc_quiet_chanspec(wlc_cm_info_t *wlc_cm, chanspec_t chspec)
*/
static bool wlc_valid_channel20_db(wlc_cm_info_t *wlc_cm, uint val)
{
struct wlc_info *wlc = wlc_cm->wlc;
struct brcms_c_info *wlc = wlc_cm->wlc;
return VALID_CHANNEL20(wlc, val) ||
(!wlc->bandlocked
......@@ -1016,7 +1016,7 @@ wlc_valid_channel20_in_band(wlc_cm_info_t *wlc_cm, uint bandunit, uint val)
/* Is the channel valid for the current locale and current band? */
static bool wlc_valid_channel20(wlc_cm_info_t *wlc_cm, uint val)
{
struct wlc_info *wlc = wlc_cm->wlc;
struct brcms_c_info *wlc = wlc_cm->wlc;
return ((val < MAXCHANNEL) &&
isset(wlc_cm->bandstate[wlc->band->bandunit].valid_channels.vec,
......@@ -1114,7 +1114,7 @@ void
wlc_channel_set_chanspec(wlc_cm_info_t *wlc_cm, chanspec_t chanspec,
u8 local_constraint_qdbm)
{
struct wlc_info *wlc = wlc_cm->wlc;
struct brcms_c_info *wlc = wlc_cm->wlc;
struct txpwr_limits txpwr;
wlc_channel_reg_limits(wlc_cm, chanspec, &txpwr);
......@@ -1248,13 +1248,13 @@ void
wlc_channel_reg_limits(wlc_cm_info_t *wlc_cm, chanspec_t chanspec,
txpwr_limits_t *txpwr)
{
struct wlc_info *wlc = wlc_cm->wlc;
struct brcms_c_info *wlc = wlc_cm->wlc;
uint i;
uint chan;
int maxpwr;
int delta;
const country_info_t *country;
struct wlcband *band;
struct brcms_c_band *band;
const locale_info_t *li;
int conducted_max;
int conducted_ofdm_max;
......@@ -1458,7 +1458,7 @@ wlc_channel_reg_limits(wlc_cm_info_t *wlc_cm, chanspec_t chanspec,
}
/* Returns true if currently set country is Japan or variant */
static bool wlc_japan(struct wlc_info *wlc)
static bool wlc_japan(struct brcms_c_info *wlc)
{
return wlc_japan_ccode(wlc->cmi->country_abbrev);
}
......@@ -1477,7 +1477,7 @@ static bool wlc_japan_ccode(const char *ccode)
static bool
wlc_valid_chanspec_ext(wlc_cm_info_t *wlc_cm, chanspec_t chspec, bool dualband)
{
struct wlc_info *wlc = wlc_cm->wlc;
struct brcms_c_info *wlc = wlc_cm->wlc;
u8 channel = CHSPEC_CHANNEL(chspec);
/* check the chanspec */
......
......@@ -20,7 +20,7 @@
#define WLC_TXPWR_DB_FACTOR 4 /* conversion for phy txpwr cacluations that use .25 dB units */
struct wlc_info;
struct brcms_c_info;
/* maxpwr mapping to 5GHz band channels:
* maxpwr[0] - channels [34-48]
......@@ -105,7 +105,7 @@ struct country_info {
const u8 locale_mimo_5G; /* 5G mimo info */
};
extern wlc_cm_info_t *wlc_channel_mgr_attach(struct wlc_info *wlc);
extern wlc_cm_info_t *wlc_channel_mgr_attach(struct brcms_c_info *wlc);
extern void wlc_channel_mgr_detach(wlc_cm_info_t *wlc_cm);
extern u8 wlc_channel_locale_flags_in_band(wlc_cm_info_t *wlc_cm,
......
......@@ -165,7 +165,7 @@ static void brcms_ops_tx(struct ieee80211_hw *hw, struct sk_buff *skb)
kfree_skb(skb);
goto done;
}
wlc_sendpkt_mac80211(wl->wlc, skb, hw);
brcms_c_sendpkt_mac80211(wl->wlc, skb, hw);
done:
UNLOCK(wl);
}
......@@ -248,7 +248,7 @@ ieee_set_channel(struct ieee80211_hw *hw, struct ieee80211_channel *chan,
switch (type) {
case NL80211_CHAN_HT20:
case NL80211_CHAN_NO_HT:
err = wlc_set(wl->wlc, WLC_SET_CHANNEL, chan->hw_value);
err = brcms_c_set(wl->wlc, WLC_SET_CHANNEL, chan->hw_value);
break;
case NL80211_CHAN_HT40MINUS:
case NL80211_CHAN_HT40PLUS:
......@@ -273,14 +273,14 @@ static int brcms_ops_config(struct ieee80211_hw *hw, u32 changed)
LOCK(wl);
if (changed & IEEE80211_CONF_CHANGE_LISTEN_INTERVAL) {
if (wlc_set_par(wl->wlc, IOV_BCN_LI_BCN, conf->listen_interval)
< 0) {
if (brcms_c_set_par(wl->wlc, IOV_BCN_LI_BCN,
conf->listen_interval) < 0) {
wiphy_err(wiphy, "%s: Error setting listen_interval\n",
__func__);
err = -EIO;
goto config_out;
}
wlc_get_par(wl->wlc, IOV_BCN_LI_BCN, &new_int);
brcms_c_get_par(wl->wlc, IOV_BCN_LI_BCN, &new_int);
}
if (changed & IEEE80211_CONF_CHANGE_MONITOR)
wiphy_err(wiphy, "%s: change monitor mode: %s (implement)\n",
......@@ -292,14 +292,14 @@ static int brcms_ops_config(struct ieee80211_hw *hw, u32 changed)
"true" : "false");
if (changed & IEEE80211_CONF_CHANGE_POWER) {
if (wlc_set_par(wl->wlc, IOV_QTXPOWER, conf->power_level * 4)
< 0) {
if (brcms_c_set_par(wl->wlc, IOV_QTXPOWER,
conf->power_level * 4) < 0) {
wiphy_err(wiphy, "%s: Error setting power_level\n",
__func__);
err = -EIO;
goto config_out;
}
wlc_get_par(wl->wlc, IOV_QTXPOWER, &new_int);
brcms_c_get_par(wl->wlc, IOV_QTXPOWER, &new_int);
if (new_int != (conf->power_level * 4))
wiphy_err(wiphy, "%s: Power level req != actual, %d %d"
"\n", __func__, conf->power_level * 4,
......@@ -309,15 +309,15 @@ static int brcms_ops_config(struct ieee80211_hw *hw, u32 changed)
err = ieee_set_channel(hw, conf->channel, conf->channel_type);
}
if (changed & IEEE80211_CONF_CHANGE_RETRY_LIMITS) {
if (wlc_set
if (brcms_c_set
(wl->wlc, WLC_SET_SRL,
conf->short_frame_max_tx_count) < 0) {
wiphy_err(wiphy, "%s: Error setting srl\n", __func__);
err = -EIO;
goto config_out;
}
if (wlc_set(wl->wlc, WLC_SET_LRL, conf->long_frame_max_tx_count)
< 0) {
if (brcms_c_set(wl->wlc, WLC_SET_LRL,
conf->long_frame_max_tx_count) < 0) {
wiphy_err(wiphy, "%s: Error setting lrl\n", __func__);
err = -EIO;
goto config_out;
......@@ -345,7 +345,7 @@ brcms_ops_bss_info_changed(struct ieee80211_hw *hw,
wiphy_err(wiphy, "%s: %s: %sassociated\n", KBUILD_MODNAME,
__func__, info->assoc ? "" : "dis");
LOCK(wl);
wlc_associate_upd(wl->wlc, info->assoc);
brcms_c_associate_upd(wl->wlc, info->assoc);
UNLOCK(wl);
}
if (changed & BSS_CHANGED_ERP_SLOT) {
......@@ -355,7 +355,7 @@ brcms_ops_bss_info_changed(struct ieee80211_hw *hw,
else
val = 0;
LOCK(wl);
wlc_set(wl->wlc, WLC_SET_SHORTSLOT_OVERRIDE, val);
brcms_c_set(wl->wlc, WLC_SET_SHORTSLOT_OVERRIDE, val);
UNLOCK(wl);
}
......@@ -364,11 +364,11 @@ brcms_ops_bss_info_changed(struct ieee80211_hw *hw,
u16 mode = info->ht_operation_mode;
LOCK(wl);
wlc_protection_upd(wl->wlc, WLC_PROT_N_CFG,
brcms_c_protection_upd(wl->wlc, WLC_PROT_N_CFG,
mode & IEEE80211_HT_OP_MODE_PROTECTION);
wlc_protection_upd(wl->wlc, WLC_PROT_N_NONGF,
brcms_c_protection_upd(wl->wlc, WLC_PROT_N_NONGF,
mode & IEEE80211_HT_OP_MODE_NON_GF_STA_PRSNT);
wlc_protection_upd(wl->wlc, WLC_PROT_N_OBSS,
brcms_c_protection_upd(wl->wlc, WLC_PROT_N_OBSS,
mode & IEEE80211_HT_OP_MODE_NON_HT_STA_PRSNT);
UNLOCK(wl);
}
......@@ -381,7 +381,7 @@ brcms_ops_bss_info_changed(struct ieee80211_hw *hw,
/* retrieve the current rates */
LOCK(wl);
error = wlc_ioctl(wl->wlc, WLC_GET_CURR_RATESET,
error = brcms_c_ioctl(wl->wlc, WLC_GET_CURR_RATESET,
&rs, sizeof(rs), NULL);
UNLOCK(wl);
if (error) {
......@@ -390,7 +390,7 @@ brcms_ops_bss_info_changed(struct ieee80211_hw *hw,
return;
}
br_mask = info->basic_rates;
bi = hw->wiphy->bands[wlc_get_curband(wl->wlc)];
bi = hw->wiphy->bands[brcms_c_get_curband(wl->wlc)];
for (i = 0; i < bi->n_bitrates; i++) {
/* convert to internal rate value */
rate = (bi->bitrates[i].bitrate << 1) / 10;
......@@ -402,19 +402,19 @@ brcms_ops_bss_info_changed(struct ieee80211_hw *hw,
/* update the rate set */
LOCK(wl);
wlc_ioctl(wl->wlc, WLC_SET_RATESET, &rs, sizeof(rs), NULL);
brcms_c_ioctl(wl->wlc, WLC_SET_RATESET, &rs, sizeof(rs), NULL);
UNLOCK(wl);
}
if (changed & BSS_CHANGED_BEACON_INT) {
/* Beacon interval changed */
LOCK(wl);
wlc_set(wl->wlc, WLC_SET_BCNPRD, info->beacon_int);
brcms_c_set(wl->wlc, WLC_SET_BCNPRD, info->beacon_int);
UNLOCK(wl);
}
if (changed & BSS_CHANGED_BSSID) {
/* BSSID changed, for whatever reason (IBSS and managed mode) */
LOCK(wl);
wlc_set_addrmatch(wl->wlc, RCM_BSSID_OFFSET,
brcms_c_set_addrmatch(wl->wlc, RCM_BSSID_OFFSET,
info->bssid);
UNLOCK(wl);
}
......@@ -486,9 +486,9 @@ brcms_ops_configure_filter(struct ieee80211_hw *hw,
LOCK(wl);
if (*total_flags & FIF_BCN_PRBRESP_PROMISC) {
wl->pub->mac80211_state |= MAC80211_PROMISC_BCNS;
wlc_mac_bcn_promisc_change(wl->wlc, 1);
brcms_c_mac_bcn_promisc_change(wl->wlc, 1);
} else {
wlc_mac_bcn_promisc_change(wl->wlc, 0);
brcms_c_mac_bcn_promisc_change(wl->wlc, 0);
wl->pub->mac80211_state &= ~MAC80211_PROMISC_BCNS;
}
UNLOCK(wl);
......@@ -506,7 +506,7 @@ static void brcms_ops_sw_scan_start(struct ieee80211_hw *hw)
{
struct brcms_info *wl = hw->priv;
LOCK(wl);
wlc_scan_start(wl->wlc);
brcms_c_scan_start(wl->wlc);
UNLOCK(wl);
return;
}
......@@ -515,7 +515,7 @@ static void brcms_ops_sw_scan_complete(struct ieee80211_hw *hw)
{
struct brcms_info *wl = hw->priv;
LOCK(wl);
wlc_scan_stop(wl->wlc);
brcms_c_scan_stop(wl->wlc);
UNLOCK(wl);
return;
}
......@@ -563,7 +563,7 @@ brcms_ops_conf_tx(struct ieee80211_hw *hw, u16 queue,
struct brcms_info *wl = hw->priv;
LOCK(wl);
wlc_wme_setparams(wl->wlc, queue, params, true);
brcms_c_wme_setparams(wl->wlc, queue, params, true);
UNLOCK(wl);
return 0;
......@@ -637,7 +637,7 @@ brcms_ops_ampdu_action(struct ieee80211_hw *hw,
break;
case IEEE80211_AMPDU_TX_START:
LOCK(wl);
status = wlc_aggregatable(wl->wlc, tid);
status = brcms_c_aggregatable(wl->wlc, tid);
UNLOCK(wl);
if (!status) {
wiphy_err(wl->wiphy, "START: tid %d is not agg\'able\n",
......@@ -673,7 +673,7 @@ static void brcms_ops_rfkill_poll(struct ieee80211_hw *hw)
bool blocked;
LOCK(wl);
blocked = wlc_check_radio_disabled(wl->wlc);
blocked = brcms_c_check_radio_disabled(wl->wlc);
UNLOCK(wl);
wiphy_rfkill_set_hw_state(wl->pub->ieee_hw->wiphy, blocked);
......@@ -687,7 +687,7 @@ static void brcms_ops_flush(struct ieee80211_hw *hw, bool drop)
/* wait for packet queue and dma fifos to run empty */
LOCK(wl);
wlc_wait_for_tx_completion(wl->wlc, drop);
brcms_c_wait_for_tx_completion(wl->wlc, drop);
UNLOCK(wl);
}
......@@ -797,7 +797,7 @@ static struct brcms_info *brcms_attach(u16 vendor, u16 device,
}
/* common load-time initialization */
wl->wlc = wlc_attach((void *)wl, vendor, device, unit, false,
wl->wlc = brcms_c_attach((void *)wl, vendor, device, unit, false,
wl->regsva, wl->bcm_bustype, btparam, &err);
brcms_release_fw(wl);
if (!wl->wlc) {
......@@ -805,11 +805,11 @@ static struct brcms_info *brcms_attach(u16 vendor, u16 device,
KBUILD_MODNAME, err);
goto fail;
}
wl->pub = wlc_pub(wl->wlc);
wl->pub = brcms_c_pub(wl->wlc);
wl->pub->ieee_hw = hw;
if (wlc_set_par(wl->wlc, IOV_MPC, 0) < 0) {
if (brcms_c_set_par(wl->wlc, IOV_MPC, 0) < 0) {
wiphy_err(wl->wiphy, "wl%d: Error setting MPC variable to 0\n",
unit);
}
......@@ -822,7 +822,7 @@ static struct brcms_info *brcms_attach(u16 vendor, u16 device,
wl->irq = irq;
/* register module */
wlc_module_register(wl->pub, "linux", wl, wl_linux_watchdog, NULL);
brcms_c_module_register(wl->pub, "linux", wl, wl_linux_watchdog, NULL);
if (ieee_hw_init(hw)) {
wiphy_err(wl->wiphy, "wl%d: %s: ieee_hw_init failed!\n", unit,
......@@ -1040,9 +1040,8 @@ static int ieee_hw_rate_init(struct ieee80211_hw *hw)
hw->wiphy->bands[IEEE80211_BAND_2GHZ] = NULL;
hw->wiphy->bands[IEEE80211_BAND_5GHZ] = NULL;
if (wlc_get(wl->wlc, WLC_GET_PHYLIST, (int *)&phy_list) < 0) {
if (brcms_c_get(wl->wlc, WLC_GET_PHYLIST, (int *)&phy_list) < 0)
wiphy_err(hw->wiphy, "Phy list failed\n");
}
if (phy_list[0] == 'n' || phy_list[0] == 'c') {
if (phy_list[0] == 'c') {
......@@ -1078,7 +1077,7 @@ static int ieee_hw_init(struct ieee80211_hw *hw)
| IEEE80211_HW_REPORTS_TX_ACK_STATUS
| IEEE80211_HW_AMPDU_AGGREGATION;
hw->extra_tx_headroom = wlc_get_header_len();
hw->extra_tx_headroom = brcms_c_get_header_len();
hw->queues = N_TX_QUEUES;
/* FIXME: this doesn't seem to be used properly in minstrel_ht.
* mac80211/status.c:ieee80211_tx_status() checks this value,
......@@ -1239,7 +1238,7 @@ static void brcms_remove(struct pci_dev *pdev)
}
LOCK(wl);
status = wlc_chipmatch(pdev->vendor, pdev->device);
status = brcms_c_chipmatch(pdev->vendor, pdev->device);
UNLOCK(wl);
if (!status) {
wiphy_err(wl->wiphy, "wl: brcms_remove: wlc_chipmatch "
......@@ -1337,12 +1336,12 @@ static void brcms_free(struct brcms_info *wl)
tasklet_kill(&wl->tasklet);
if (wl->pub) {
wlc_module_unregister(wl->pub, "linux", wl);
brcms_c_module_unregister(wl->pub, "linux", wl);
}
/* free common resources */
if (wl->wlc) {
wlc_detach(wl->wlc);
brcms_c_detach(wl->wlc);
wl->wlc = NULL;
wl->pub = NULL;
}
......@@ -1407,7 +1406,7 @@ void brcms_init(struct brcms_info *wl)
BCMMSG(WL_TO_HW(wl)->wiphy, "wl%d\n", wl->pub->unit);
brcms_reset(wl);
wlc_init(wl->wlc);
brcms_c_init(wl->wlc);
}
/*
......@@ -1416,7 +1415,7 @@ void brcms_init(struct brcms_info *wl)
uint brcms_reset(struct brcms_info *wl)
{
BCMMSG(WL_TO_HW(wl)->wiphy, "wl%d\n", wl->pub->unit);
wlc_reset(wl->wlc);
brcms_c_reset(wl->wlc);
/* dpc will not be rescheduled */
wl->resched = 0;
......@@ -1433,7 +1432,7 @@ void brcms_intrson(struct brcms_info *wl)
unsigned long flags;
INT_LOCK(wl, flags);
wlc_intrson(wl->wlc);
brcms_c_intrson(wl->wlc);
INT_UNLOCK(wl, flags);
}
......@@ -1451,7 +1450,7 @@ u32 brcms_intrsoff(struct brcms_info *wl)
u32 status;
INT_LOCK(wl, flags);
status = wlc_intrsoff(wl->wlc);
status = brcms_c_intrsoff(wl->wlc);
INT_UNLOCK(wl, flags);
return status;
}
......@@ -1461,7 +1460,7 @@ void brcms_intrsrestore(struct brcms_info *wl, u32 macintmask)
unsigned long flags;
INT_LOCK(wl, flags);
wlc_intrsrestore(wl->wlc, macintmask);
brcms_c_intrsrestore(wl->wlc, macintmask);
INT_UNLOCK(wl, flags);
}
......@@ -1475,7 +1474,7 @@ int brcms_up(struct brcms_info *wl)
if (wl->pub->up)
return 0;
error = wlc_up(wl->wlc);
error = brcms_c_up(wl->wlc);
return error;
}
......@@ -1488,7 +1487,7 @@ void brcms_down(struct brcms_info *wl)
uint callbacks, ret_val = 0;
/* call common down function */
ret_val = wlc_down(wl->wlc);
ret_val = brcms_c_down(wl->wlc);
callbacks = atomic_read(&wl->callbacks) - ret_val;
/* wait for down callbacks to complete */
......@@ -1513,7 +1512,7 @@ static irqreturn_t brcms_isr(int irq, void *dev_id)
ISR_LOCK(wl, flags);
/* call common first level interrupt handler */
ours = wlc_isr(wl->wlc, &wantdpc);
ours = brcms_c_isr(wl->wlc, &wantdpc);
if (ours) {
/* if more to do... */
if (wantdpc) {
......@@ -1543,14 +1542,14 @@ static void brcms_dpc(unsigned long data)
unsigned long flags;
INT_LOCK(wl, flags);
wlc_intrsupd(wl->wlc);
brcms_c_intrsupd(wl->wlc);
INT_UNLOCK(wl, flags);
}
wl->resched = wlc_dpc(wl->wlc, true);
wl->resched = brcms_c_dpc(wl->wlc, true);
}
/* wlc_dpc() may bring the driver down */
/* brcms_c_dpc() may bring the driver down */
if (!wl->pub->up)
goto done;
......@@ -1913,7 +1912,7 @@ int brcms_check_firmwares(struct brcms_info *wl)
*/
bool brcms_rfkill_set_hw_state(struct brcms_info *wl)
{
bool blocked = wlc_check_radio_disabled(wl->wlc);
bool blocked = brcms_c_check_radio_disabled(wl->wlc);
UNLOCK(wl);
wiphy_rfkill_set_hw_state(wl->pub->ieee_hw->wiphy, blocked);
......
......@@ -85,7 +85,7 @@ struct brcms_info {
/* misc callbacks */
struct brcms_info;
struct brcms_if;
struct wlc_if;
struct brcms_c_if;
extern void brcms_init(struct brcms_info *wl);
extern uint brcms_reset(struct brcms_info *wl);
extern void brcms_intrson(struct brcms_info *wl);
......
......@@ -49,7 +49,7 @@ struct wlc_phy_srom_fem {
u8 antswctrllut; /* antswctrl lookup table configuration: 32 possible choices */
};
struct wlc_hw_info;
struct brcms_c_hw_info;
typedef void (*initfn_t) (phy_info_t *);
typedef void (*chansetfn_t) (phy_info_t *, chanspec_t);
typedef int (*longtrnfn_t) (phy_info_t *, int);
......
......@@ -30,12 +30,12 @@
/* PHY SHIM module specific state */
struct wlc_phy_shim_info {
struct wlc_hw_info *wlc_hw; /* pointer to main wlc_hw structure */
struct brcms_c_hw_info *wlc_hw; /* pointer to main wlc_hw structure */
void *wlc; /* pointer to main wlc structure */
void *wl; /* pointer to os-specific private state */
};
wlc_phy_shim_info_t *wlc_phy_shim_attach(struct wlc_hw_info *wlc_hw,
wlc_phy_shim_info_t *wlc_phy_shim_attach(struct brcms_c_hw_info *wlc_hw,
void *wl, void *wlc) {
wlc_phy_shim_info_t *physhim = NULL;
......@@ -122,7 +122,7 @@ void wlapi_bmac_corereset(wlc_phy_shim_info_t *physhim, u32 flags)
void wlapi_suspend_mac_and_wait(wlc_phy_shim_info_t *physhim)
{
wlc_suspend_mac_and_wait(physhim->wlc);
brcms_c_suspend_mac_and_wait(physhim->wlc);
}
void wlapi_switch_macfreq(wlc_phy_shim_info_t *physhim, u8 spurmode)
......@@ -132,7 +132,7 @@ void wlapi_switch_macfreq(wlc_phy_shim_info_t *physhim, u8 spurmode)
void wlapi_enable_mac(wlc_phy_shim_info_t *physhim)
{
wlc_enable_mac(physhim->wlc);
brcms_c_enable_mac(physhim->wlc);
}
void wlapi_bmac_mctrl(wlc_phy_shim_info_t *physhim, u32 mask, u32 val)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册