/* local prototypes */
extern void wlc_txq_enq(void *ctx, struct scb *scb, void *sdu, uint prec);
-static uint16 BCMFASTPATH wlc_d11hdrs_mac80211(wlc_info_t *wlc,
+static u16 BCMFASTPATH wlc_d11hdrs_mac80211(wlc_info_t *wlc,
struct ieee80211_hw *hw, void *p,
struct scb *scb, uint frag,
uint nfrags, uint queue,
static void wlc_txflowcontrol_signal(wlc_info_t *wlc, wlc_txq_info_t *qi,
bool on, int prio);
static void wlc_txflowcontrol_reset(wlc_info_t *wlc);
-static uint16 wlc_compute_airtime(wlc_info_t *wlc, ratespec_t rspec,
+static u16 wlc_compute_airtime(wlc_info_t *wlc, ratespec_t rspec,
uint length);
static void wlc_compute_cck_plcp(ratespec_t rate, uint length, u8 *plcp);
static void wlc_compute_ofdm_plcp(ratespec_t rate, uint length, u8 *plcp);
static void wlc_compute_mimo_plcp(ratespec_t rate, uint length, u8 *plcp);
-static uint16 wlc_compute_frame_dur(wlc_info_t *wlc, ratespec_t rate,
+static u16 wlc_compute_frame_dur(wlc_info_t *wlc, ratespec_t rate,
u8 preamble_type, uint next_frag_len);
static void wlc_recvctl(wlc_info_t *wlc, osl_t *osh, d11rxhdr_t *rxh,
void *p);
addr->octet[3] = (u8) (v32 >> 24);
W_REG(osh, ®s->objaddr, (OBJADDR_RCMTA_SEL | ((idx * 2) + 1)));
(void)R_REG(osh, ®s->objaddr);
- v32 = R_REG(osh, (volatile uint16 *)(uintptr) & regs->objdata);
+ v32 = R_REG(osh, (volatile u16 *)(uintptr) & regs->objdata);
addr->octet[4] = (u8) v32;
addr->octet[5] = (u8) (v32 >> 8);
}
/* read the ucode version if we have not yet done so */
if (wlc->ucode_rev == 0) {
wlc->ucode_rev =
- wlc_read_shm(wlc, M_BOM_REV_MAJOR) << NBITS(uint16);
+ wlc_read_shm(wlc, M_BOM_REV_MAJOR) << NBITS(u16);
wlc->ucode_rev |= wlc_read_shm(wlc, M_BOM_REV_MINOR);
}
*/
void wlc_beacon_phytxctl_txant_upd(wlc_info_t *wlc, ratespec_t bcn_rspec)
{
- uint16 phyctl;
- uint16 phytxant = wlc->stf->phytxant;
- uint16 mask = PHY_TXC_ANT_MASK;
+ u16 phyctl;
+ u16 phytxant = wlc->stf->phytxant;
+ u16 mask = PHY_TXC_ANT_MASK;
/* for non-siso rates or default setting, use the available chains */
if (WLC_PHY_11N_CAP(wlc->band)) {
{
int i;
shm_acparams_t acp_shm;
- uint16 *shm_entry;
+ u16 *shm_entry;
struct ieee80211_tx_queue_params *params = arg;
ASSERT(wlc);
acp_shm.status |= WME_STATUS_NEWAC;
/* Fill in shm acparam table */
- shm_entry = (uint16 *) &acp_shm;
+ shm_entry = (u16 *) &acp_shm;
for (i = 0; i < (int)sizeof(shm_acparams_t); i += 2)
wlc_write_shm(wlc,
M_EDCF_QINFO +
uint aci, i, j;
edcf_acparam_t *edcf_acp;
shm_acparams_t acp_shm;
- uint16 *shm_entry;
+ u16 *shm_entry;
ASSERT(cfg);
ASSERT(wlc);
acp_shm.status |= WME_STATUS_NEWAC;
/* Fill in shm acparam table */
- shm_entry = (uint16 *) &acp_shm;
+ shm_entry = (u16 *) &acp_shm;
for (j = 0; j < (int)sizeof(shm_acparams_t); j += 2)
wlc_write_shm(wlc,
M_EDCF_QINFO +
/*
* The common driver entry routine. Error codes should be unique
*/
-void *BCMATTACHFN(wlc_attach) (void *wl, uint16 vendor, uint16 device,
+void *BCMATTACHFN(wlc_attach) (void *wl, u16 vendor, u16 device,
uint unit, bool piomode, osl_t *osh,
void *regsva, uint bustype, void *btparam,
uint *perr) {
/* set maximum allowed duty cycle */
wlc->tx_duty_cycle_ofdm =
- (uint16) getintvar(pub->vars, "tx_duty_cycle_ofdm");
+ (u16) getintvar(pub->vars, "tx_duty_cycle_ofdm");
wlc->tx_duty_cycle_cck =
- (uint16) getintvar(pub->vars, "tx_duty_cycle_cck");
+ (u16) getintvar(pub->vars, "tx_duty_cycle_cck");
wlc_stf_phy_chain_calc(wlc);
#ifdef WLC_HIGH_ONLY
/* HIGH_ONLY bmac_attach, which sync over LOW_ONLY bmac_attach states */
int
-BCMATTACHFN(wlc_bmac_attach) (wlc_info_t *wlc, uint16 vendor, uint16 device,
+BCMATTACHFN(wlc_bmac_attach) (wlc_info_t *wlc, u16 vendor, u16 device,
uint unit, bool piomode, osl_t *osh,
void *regsva, uint bustype, void *btparam) {
wlc_bmac_revinfo_t revinfo;
bzero(&revinfo, sizeof(wlc_bmac_revinfo_t));
if (wlc_bmac_revinfo_get(wlc->hw, &revinfo) != 0)
return -1;
- wlc->vendorid = (uint16) revinfo.vendorid;
- wlc->deviceid = (uint16) revinfo.deviceid;
+ wlc->vendorid = (u16) revinfo.vendorid;
+ wlc->deviceid = (u16) revinfo.deviceid;
- wlc->pub->boardrev = (uint16) revinfo.boardrev;
+ wlc->pub->boardrev = (u16) revinfo.boardrev;
wlc->pub->corerev = revinfo.corerev;
wlc->pub->sromrev = (u8) revinfo.sromrev;
wlc->pub->sih->chiprev = revinfo.chiprev;
wlc->bandstate[bandunit]->radiorev =
(u8) revinfo.band[idx].radiorev;
wlc->bandstate[bandunit]->phytype =
- (uint16) revinfo.band[idx].phytype;
+ (u16) revinfo.band[idx].phytype;
wlc->bandstate[bandunit]->phyrev =
- (uint16) revinfo.band[idx].phyrev;
+ (u16) revinfo.band[idx].phyrev;
wlc->bandstate[bandunit]->radioid =
- (uint16) revinfo.band[idx].radioid;
+ (u16) revinfo.band[idx].radioid;
wlc->bandstate[bandunit]->abgphy_encore =
revinfo.band[idx].abgphy_encore;
static void BCMINITFN(wlc_tx_prec_map_init) (wlc_info_t *wlc)
{
wlc->tx_prec_map = WLC_PREC_BMP_ALL;
- bzero(wlc->fifo2prec_map, sizeof(uint16) * NFIFO);
+ bzero(wlc->fifo2prec_map, sizeof(u16) * NFIFO);
/* For non-WME, both fifos have overlapping MAXPRIO. So just disable all precedences
* if either is full.
if (bcmerror)
break;
- i = (uint16) val;
+ i = (u16) val;
if (i >= MHFMAX) {
bcmerror = BCME_RANGE;
break;
}
- wlc_mhf(wlc, (u8) i, 0xffff, (uint16) (val >> NBITS(uint16)),
+ wlc_mhf(wlc, (u8) i, 0xffff, (u16) (val >> NBITS(u16)),
WLC_BAND_AUTO);
break;
break;
}
- *pval = wlc_read_shm(wlc, (uint16) val);
+ *pval = wlc_read_shm(wlc, (u16) val);
break;
case WLC_SET_SHMEM:
break;
}
- wlc_write_shm(wlc, (uint16) val,
- (uint16) (val >> NBITS(uint16)));
+ wlc_write_shm(wlc, (u16) val,
+ (u16) (val >> NBITS(u16)));
break;
case WLC_R_REG: /* MAC registers */
R_REG(osh,
(uint32 *) ((unsigned char *) (uintptr) regs +
r->byteoff));
- else if (r->size == sizeof(uint16))
+ else if (r->size == sizeof(u16))
r->val =
R_REG(osh,
- (uint16 *) ((unsigned char *) (uintptr) regs +
+ (u16 *) ((unsigned char *) (uintptr) regs +
r->byteoff));
else
bcmerror = BCME_BADADDR;
W_REG(osh,
(uint32 *) ((unsigned char *) (uintptr) regs +
r->byteoff), r->val);
- else if (r->size == sizeof(uint16))
+ else if (r->size == sizeof(u16))
W_REG(osh,
- (uint16 *) ((unsigned char *) (uintptr) regs +
+ (u16 *) ((unsigned char *) (uintptr) regs +
r->byteoff), r->val);
else
bcmerror = BCME_BADADDR;
break;
case WLC_GET_RX_ANT:{ /* get latest used rx antenna */
- uint16 rxstatus;
+ u16 rxstatus;
if (!wlc->pub->up) {
bcmerror = BCME_NOTUP;
}
rxstatus = R_REG(wlc->osh, &wlc->regs->phyrxstatus0);
- if (rxstatus == 0xdead || rxstatus == (uint16) -1) {
+ if (rxstatus == 0xdead || rxstatus == (u16) -1) {
bcmerror = BCME_ERROR;
break;
}
case WLC_SET_SRL:
if (val >= 1 && val <= RETRY_SHORT_MAX) {
int ac;
- wlc->SRL = (uint16) val;
+ wlc->SRL = (u16) val;
wlc_bmac_retrylimit_upd(wlc->hw, wlc->SRL, wlc->LRL);
case WLC_SET_LRL:
if (val >= 1 && val <= 255) {
int ac;
- wlc->LRL = (uint16) val;
+ wlc->LRL = (u16) val;
wlc_bmac_retrylimit_upd(wlc->hw, wlc->SRL, wlc->LRL);
}
if (val >= 1 && val <= 255) {
- wlc_set_cwmin(wlc, (uint16) val);
+ wlc_set_cwmin(wlc, (u16) val);
} else
bcmerror = BCME_RANGE;
break;
}
if (val >= 255 && val <= 2047) {
- wlc_set_cwmax(wlc, (uint16) val);
+ wlc_set_cwmax(wlc, (u16) val);
} else
bcmerror = BCME_RANGE;
break;
case WLC_SET_RADIO:{ /* 32 bits input, higher 16 bits are mask, lower 16 bits are value to
* set
*/
- uint16 radiomask, radioval;
+ u16 radiomask, radioval;
uint validbits =
WL_RADIO_SW_DISABLE | WL_RADIO_HW_DISABLE;
mbool new = 0;
if ((val >= 0) && (val < WLC_MAX_WSEC_KEYS(wlc)) &&
(key != NULL)) {
u8 seq[DOT11_WPA_KEY_RSC_LEN];
- uint16 lo;
+ u16 lo;
uint32 hi;
/* group keys in WPA-NONE (IBSS only, AES and TKIP) use a global TXIV */
if ((bsscfg->WPA_auth & WPA_AUTH_NONE)
/* range [1, 0xffff] */
if (val >= DOT11_MIN_BEACON_PERIOD
&& val <= DOT11_MAX_BEACON_PERIOD) {
- wlc->default_bss->beacon_period = (uint16) val;
+ wlc->default_bss->beacon_period = (u16) val;
} else
bcmerror = BCME_RANGE;
break;
case WLC_SET_WPA_AUTH:
/* change of WPA_Auth modifies the PS_ALLOWED state */
if (BSSCFG_STA(bsscfg)) {
- bsscfg->WPA_auth = (uint16) val;
+ bsscfg->WPA_auth = (u16) val;
} else
- bsscfg->WPA_auth = (uint16) val;
+ bsscfg->WPA_auth = (u16) val;
break;
#endif /* SUPPORT_HWKEY */
bcmerror = BCME_RANGE; /* bad value */
break;
}
- wlc->prb_resp_timeout = (uint16) val;
+ wlc->prb_resp_timeout = (u16) val;
break;
case WLC_GET_KEY_PRIMARY:{
"Lifetime Expiry", "Underflow"
};
-static void wlc_print_txs_status(uint16 s)
+static void wlc_print_txs_status(u16 s)
{
printf("[15:12] %d frame attempts\n", (s & TX_STATUS_FRM_RTX_MASK) >>
TX_STATUS_FRM_RTX_SHIFT);
void wlc_print_txstatus(tx_status_t *txs)
{
#if defined(BCMDBG)
- uint16 s = txs->status;
- uint16 ackphyrxsh = txs->ackphyrxsh;
+ u16 s = txs->status;
+ u16 ackphyrxsh = txs->ackphyrxsh;
printf("\ntxpkt (MPDU) Complete\n");
{
int i;
#ifdef BCMDBG
- uint16 delta;
- uint16 rxf0ovfl;
- uint16 txfunfl[NFIFO];
+ u16 delta;
+ u16 rxf0ovfl;
+ u16 txfunfl[NFIFO];
#endif /* BCMDBG */
/* if driver down, make no sense to update stats */
#ifdef BCMDBG
/* check for rx fifo 0 overflow */
- delta = (uint16) (wlc->core->macstat_snapshot->rxf0ovfl - rxf0ovfl);
+ delta = (u16) (wlc->core->macstat_snapshot->rxf0ovfl - rxf0ovfl);
if (delta)
WL_ERROR(("wl%d: %u rx fifo 0 overflows!\n", wlc->pub->unit,
delta));
/* check for tx fifo underflows */
for (i = 0; i < NFIFO; i++) {
delta =
- (uint16) (wlc->core->macstat_snapshot->txfunfl[i] -
+ (u16) (wlc->core->macstat_snapshot->txfunfl[i] -
txfunfl[i]);
if (delta)
WL_ERROR(("wl%d: %u tx fifo %d underflows!\n",
WLCNTADD(wlc->pub->_cnt->rxerror, wlc->pub->_cnt->rxuflo[i]);
}
-bool wlc_chipmatch(uint16 vendor, uint16 device)
+bool wlc_chipmatch(u16 vendor, u16 device)
{
if (vendor != VENDOR_BROADCOM) {
WL_ERROR(("wlc_chipmatch: unknown vendor id %04x\n", vendor));
#if defined(BCMDBG)
void wlc_print_txdesc(d11txh_t *txh)
{
- uint16 mtcl = ltoh16(txh->MacTxControlLow);
- uint16 mtch = ltoh16(txh->MacTxControlHigh);
- uint16 mfc = ltoh16(txh->MacFrameControl);
- uint16 tfest = ltoh16(txh->TxFesTimeNormal);
- uint16 ptcw = ltoh16(txh->PhyTxControlWord);
- uint16 ptcw_1 = ltoh16(txh->PhyTxControlWord_1);
- uint16 ptcw_1_Fbr = ltoh16(txh->PhyTxControlWord_1_Fbr);
- uint16 ptcw_1_Rts = ltoh16(txh->PhyTxControlWord_1_Rts);
- uint16 ptcw_1_FbrRts = ltoh16(txh->PhyTxControlWord_1_FbrRts);
- uint16 mainrates = ltoh16(txh->MainRates);
- uint16 xtraft = ltoh16(txh->XtraFrameTypes);
+ u16 mtcl = ltoh16(txh->MacTxControlLow);
+ u16 mtch = ltoh16(txh->MacTxControlHigh);
+ u16 mfc = ltoh16(txh->MacFrameControl);
+ u16 tfest = ltoh16(txh->TxFesTimeNormal);
+ u16 ptcw = ltoh16(txh->PhyTxControlWord);
+ u16 ptcw_1 = ltoh16(txh->PhyTxControlWord_1);
+ u16 ptcw_1_Fbr = ltoh16(txh->PhyTxControlWord_1_Fbr);
+ u16 ptcw_1_Rts = ltoh16(txh->PhyTxControlWord_1_Rts);
+ u16 ptcw_1_FbrRts = ltoh16(txh->PhyTxControlWord_1_FbrRts);
+ u16 mainrates = ltoh16(txh->MainRates);
+ u16 xtraft = ltoh16(txh->XtraFrameTypes);
u8 *iv = txh->IV;
u8 *ra = txh->TxFrameRA;
- uint16 tfestfb = ltoh16(txh->TxFesTimeFallback);
+ u16 tfestfb = ltoh16(txh->TxFesTimeFallback);
u8 *rtspfb = txh->RTSPLCPFallback;
- uint16 rtsdfb = ltoh16(txh->RTSDurFallback);
+ u16 rtsdfb = ltoh16(txh->RTSDurFallback);
u8 *fragpfb = txh->FragPLCPFallback;
- uint16 fragdfb = ltoh16(txh->FragDurFallback);
- uint16 mmodelen = ltoh16(txh->MModeLen);
- uint16 mmodefbrlen = ltoh16(txh->MModeFbrLen);
- uint16 tfid = ltoh16(txh->TxFrameID);
- uint16 txs = ltoh16(txh->TxStatus);
- uint16 mnmpdu = ltoh16(txh->MaxNMpdus);
- uint16 mabyte = ltoh16(txh->MaxABytes_MRT);
- uint16 mabyte_f = ltoh16(txh->MaxABytes_FBR);
- uint16 mmbyte = ltoh16(txh->MinMBytes);
+ u16 fragdfb = ltoh16(txh->FragDurFallback);
+ u16 mmodelen = ltoh16(txh->MModeLen);
+ u16 mmodefbrlen = ltoh16(txh->MModeFbrLen);
+ u16 tfid = ltoh16(txh->TxFrameID);
+ u16 txs = ltoh16(txh->TxStatus);
+ u16 mnmpdu = ltoh16(txh->MaxNMpdus);
+ u16 mabyte = ltoh16(txh->MaxABytes_MRT);
+ u16 mabyte_f = ltoh16(txh->MaxABytes_FBR);
+ u16 mmbyte = ltoh16(txh->MinMBytes);
u8 *rtsph = txh->RTSPhyHeader;
struct dot11_rts_frame rts = txh->rts_frame;
#if defined(BCMDBG)
void wlc_print_rxh(d11rxhdr_t *rxh)
{
- uint16 len = rxh->RxFrameSize;
- uint16 phystatus_0 = rxh->PhyRxStatus_0;
- uint16 phystatus_1 = rxh->PhyRxStatus_1;
- uint16 phystatus_2 = rxh->PhyRxStatus_2;
- uint16 phystatus_3 = rxh->PhyRxStatus_3;
- uint16 macstatus1 = rxh->RxStatus1;
- uint16 macstatus2 = rxh->RxStatus2;
+ u16 len = rxh->RxFrameSize;
+ u16 phystatus_0 = rxh->PhyRxStatus_0;
+ u16 phystatus_1 = rxh->PhyRxStatus_1;
+ u16 phystatus_2 = rxh->PhyRxStatus_2;
+ u16 phystatus_3 = rxh->PhyRxStatus_3;
+ u16 macstatus1 = rxh->RxStatus1;
+ u16 macstatus2 = rxh->RxStatus2;
char flagstr[64];
char lenbuf[20];
static const bcm_bit_desc_t macstat_flags[] = {
}
#endif /* defined(BCMDBG) */
-uint16 wlc_rate_shm_offset(wlc_info_t *wlc, u8 rate)
+u16 wlc_rate_shm_offset(wlc_info_t *wlc, u8 rate)
{
return wlc_bmac_rate_shm_offset(wlc->hw, rate);
}
void *pkt;
struct scb *scb = &global_scb;
struct dot11_header *d11_header = (struct dot11_header *)PKTDATA(sdu);
- uint16 type, fc;
+ u16 type, fc;
ASSERT(sdu);
{
void *pkt[DOT11_MAXNUMFRAGS];
int prec;
- uint16 prec_map;
+ u16 prec_map;
int err = 0, i, count;
uint fifo;
struct pktq *q = &qi->q;
* Generate frame ID for a BCMC packet. The frag field is not used
* for MC frames so is used as part of the sequence number.
*/
-static inline uint16
+static inline u16
bcmc_fid_generate(wlc_info_t *wlc, wlc_bsscfg_t *bsscfg, d11txh_t *txh)
{
- uint16 frameid;
+ u16 frameid;
frameid = ltoh16(txh->TxFrameID) & ~(TXFID_SEQ_MASK | TXFID_QUEUE_MASK);
frameid |=
void BCMFASTPATH
wlc_txfifo(wlc_info_t *wlc, uint fifo, void *p, bool commit, s8 txpktpend)
{
- uint16 frameid = INVALIDFID;
+ u16 frameid = INVALIDFID;
d11txh_t *txh;
ASSERT(fifo < NFIFO);
#endif /* WLC_HIGH_ONLY */
}
-static uint16
+static u16
wlc_compute_airtime(wlc_info_t *wlc, ratespec_t rspec, uint length)
{
- uint16 usec = 0;
+ u16 usec = 0;
uint mac_rate = RSPEC2RATE(rspec);
uint nsyms;
nsyms = CEIL((length * 8), (mac_rate * 2));
/* usec = symbols * usec/symbol */
- usec = (uint16) (nsyms * APHY_SYMBOL_TIME);
+ usec = (u16) (nsyms * APHY_SYMBOL_TIME);
return usec;
} else {
switch (mac_rate) {
static void wlc_cck_plcp_set(int rate_500, uint length, u8 *plcp)
{
- uint16 usec = 0;
+ u16 usec = 0;
u8 le = 0;
switch (rate_500) {
plcp[0] = rate_500 * 5; /* r (500kbps) * 5 == r (100kbps) */
/* PLCP service byte */
plcp[1] = (u8) (le | D11B_PLCP_SIGNAL_LOCKED);
- /* PLCP length uint16, little endian */
+ /* PLCP length u16, little endian */
plcp[2] = usec & 0xff;
plcp[3] = (usec >> 8) & 0xff;
/* PLCP CRC16 */
* next_frag_len next MPDU length in bytes
* preamble_type use short/GF or long/MM PLCP header
*/
-static uint16 BCMFASTPATH
+static u16 BCMFASTPATH
wlc_compute_frame_dur(wlc_info_t *wlc, ratespec_t rate, u8 preamble_type,
uint next_frag_len)
{
- uint16 dur, sifs;
+ u16 dur, sifs;
sifs = SIFS(wlc->band);
dur = sifs;
- dur += (uint16) wlc_calc_ack_time(wlc, rate, preamble_type);
+ dur += (u16) wlc_calc_ack_time(wlc, rate, preamble_type);
if (next_frag_len) {
/* Double the current DUR to get 2 SIFS + 2 ACKs */
/* add another SIFS and the frag time */
dur += sifs;
dur +=
- (uint16) wlc_calc_frame_time(wlc, rate, preamble_type,
+ (u16) wlc_calc_frame_time(wlc, rate, preamble_type,
next_frag_len);
}
return dur;
* rate next MPDU rate in unit of 500kbps
* frame_len next MPDU frame length in bytes
*/
-uint16 BCMFASTPATH
+u16 BCMFASTPATH
wlc_compute_rtscts_dur(wlc_info_t *wlc, bool cts_only, ratespec_t rts_rate,
ratespec_t frame_rate, u8 rts_preamble_type,
u8 frame_preamble_type, uint frame_len, bool ba)
{
- uint16 dur, sifs;
+ u16 dur, sifs;
sifs = SIFS(wlc->band);
if (!cts_only) { /* RTS/CTS */
dur = 3 * sifs;
dur +=
- (uint16) wlc_calc_cts_time(wlc, rts_rate,
+ (u16) wlc_calc_cts_time(wlc, rts_rate,
rts_preamble_type);
} else { /* CTS-TO-SELF */
dur = 2 * sifs;
}
dur +=
- (uint16) wlc_calc_frame_time(wlc, frame_rate, frame_preamble_type,
+ (u16) wlc_calc_frame_time(wlc, frame_rate, frame_preamble_type,
frame_len);
if (ba)
dur +=
- (uint16) wlc_calc_ba_time(wlc, frame_rate,
+ (u16) wlc_calc_ba_time(wlc, frame_rate,
WLC_SHORT_PREAMBLE);
else
dur +=
- (uint16) wlc_calc_ack_time(wlc, frame_rate,
+ (u16) wlc_calc_ack_time(wlc, frame_rate,
frame_preamble_type);
return dur;
}
-static bool wlc_phy_rspec_check(wlc_info_t *wlc, uint16 bw, ratespec_t rspec)
+static bool wlc_phy_rspec_check(wlc_info_t *wlc, u16 bw, ratespec_t rspec)
{
if (IS_MCS(rspec)) {
uint mcs = rspec & RSPEC_RATE_MASK;
return TRUE;
}
-uint16 BCMFASTPATH wlc_phytxctl1_calc(wlc_info_t *wlc, ratespec_t rspec)
+u16 BCMFASTPATH wlc_phytxctl1_calc(wlc_info_t *wlc, ratespec_t rspec)
{
- uint16 phyctl1 = 0;
- uint16 bw;
+ u16 phyctl1 = 0;
+ u16 bw;
if (WLCISLCNPHY(wlc->band)) {
bw = PHY_TXC1_BW_20MHZ;
ratespec_t BCMFASTPATH
wlc_rspec_to_rts_rspec(wlc_info_t *wlc, ratespec_t rspec, bool use_rspec,
- uint16 mimo_ctlchbw)
+ u16 mimo_ctlchbw)
{
ratespec_t rts_rspec = 0;
* headroom == D11_PHY_HDR_LEN + D11_TXH_LEN (D11_TXH_LEN is now 104 bytes)
*
*/
-static uint16 BCMFASTPATH
+static u16 BCMFASTPATH
wlc_d11hdrs_mac80211(wlc_info_t *wlc, struct ieee80211_hw *hw,
void *p, struct scb *scb, uint frag,
uint nfrags, uint queue, uint next_frag_len,
u8 *plcp, plcp_fallback[D11_PHY_HDR_LEN];
osl_t *osh;
int len, phylen, rts_phylen;
- uint16 fc, type, frameid, mch, phyctl, xfts, mainrates;
- uint16 seq = 0, mcl = 0, status = 0;
+ u16 fc, type, frameid, mch, phyctl, xfts, mainrates;
+ u16 seq = 0, mcl = 0, status = 0;
ratespec_t rspec[2] = { WLC_RATE_1M, WLC_RATE_1M }, rts_rspec[2] = {
WLC_RATE_1M, WLC_RATE_1M};
bool use_rts = FALSE;
uint ac;
uint32 rate_val[2];
bool hwtkmic = FALSE;
- uint16 mimo_ctlchbw = PHY_TXC1_BW_20MHZ;
+ u16 mimo_ctlchbw = PHY_TXC1_BW_20MHZ;
#ifdef WLANTSEL
#define ANTCFG_NONE 0xFF
u8 antcfg = ANTCFG_NONE;
u8 fbantcfg = ANTCFG_NONE;
#endif
uint phyctl1_stf = 0;
- uint16 durid = 0;
+ u16 durid = 0;
struct ieee80211_tx_rate *txrate[2];
int k;
struct ieee80211_tx_info *tx_info;
bool is_mcs[2];
- uint16 mimo_txbw;
+ u16 mimo_txbw;
u8 mimo_preamble_type;
frameid = 0;
} else if (use_rifs) {
/* NAV protect to end of next max packet size */
durid =
- (uint16) wlc_calc_frame_time(wlc, rspec[0],
+ (u16) wlc_calc_frame_time(wlc, rspec[0],
preamble_type[0],
DOT11_MAX_FRAG_LEN);
durid += RIFS_11N_TIME;
}
/* MacFrameControl */
- bcopy((char *)&h->fc, (char *)&txh->MacFrameControl, sizeof(uint16));
+ bcopy((char *)&h->fc, (char *)&txh->MacFrameControl, sizeof(u16));
txh->TxFesTimeNormal = htol16(0);
}
/* RTS PLCP header */
- ASSERT(ISALIGNED((uintptr) txh->RTSPhyHeader, sizeof(uint16)));
+ ASSERT(ISALIGNED((uintptr) txh->RTSPhyHeader, sizeof(u16)));
rts_plcp = txh->RTSPhyHeader;
if (use_cts)
rts_phylen = DOT11_CTS_LEN + DOT11_FCS_LEN;
rts->fc = htol16(FC_CTS);
bcopy((char *)&h->a2, (char *)&rts->ra, ETHER_ADDR_LEN);
} else {
- rts->fc = htol16((uint16) FC_RTS);
+ rts->fc = htol16((u16) FC_RTS);
bcopy((char *)&h->a1, (char *)&rts->ra,
2 * ETHER_ADDR_LEN);
}
/* PhyTxControlWord_1 */
if (WLC_PHY_11N_CAP(wlc->band)) {
- uint16 phyctl1 = 0;
+ u16 phyctl1 = 0;
phyctl1 = wlc_phytxctl1_calc(wlc, rspec[0]);
txh->PhyTxControlWord_1 = htol16(phyctl1);
* it will be unnecessary if they are separated
*/
if (IS_MCS(rspec[0]) && (preamble_type[0] == WLC_MM_PREAMBLE)) {
- uint16 mmodelen =
+ u16 mmodelen =
wlc_calc_lsig_len(wlc, rspec[0], phylen);
txh->MModeLen = htol16(mmodelen);
}
if (IS_MCS(rspec[1]) && (preamble_type[1] == WLC_MM_PREAMBLE)) {
- uint16 mmodefbrlen =
+ u16 mmodefbrlen =
wlc_calc_lsig_len(wlc, rspec[1], phylen);
txh->MModeFbrLen = htol16(mmodefbrlen);
}
preamble_type[1], 0);
}
/* NEED to set TxFesTimeNormal (hard) */
- txh->TxFesTimeNormal = htol16((uint16) dur);
+ txh->TxFesTimeNormal = htol16((u16) dur);
/* NEED to set fallback rate version of TxFesTimeNormal (hard) */
- txh->TxFesTimeFallback = htol16((uint16) dur_fallback);
+ txh->TxFesTimeFallback = htol16((u16) dur_fallback);
/* update txop byte threshold (txop minus intraframe overhead) */
if (wlc->edcf_txop[ac] >= (dur - frag_dur)) {
wlc->usr_fragthresh;
/* update the fragthresh and do txc update */
if (wlc->fragthresh[queue] !=
- (uint16) newfragthresh) {
+ (u16) newfragthresh) {
wlc->fragthresh[queue] =
- (uint16) newfragthresh;
+ (u16) newfragthresh;
}
}
} else
uint totlen, supr_status;
bool lastframe;
struct dot11_header *h;
- uint16 fc;
- uint16 mcl;
+ u16 fc;
+ u16 mcl;
struct ieee80211_tx_info *tx_info;
struct ieee80211_tx_rate *txrate;
int i;
if (!lastframe) {
WL_ERROR(("Not last frame!\n"));
} else {
- uint16 sfbl, lfbl;
+ u16 sfbl, lfbl;
ieee80211_tx_info_clear_status(tx_info);
if (queue < AC_COUNT) {
sfbl = WLC_WME_RETRY_SFB_GET(wlc, wme_fifo2ac[queue]);
* and
* (X + Y) mod Z = ((X mod Z) + (Y mod Z)) mod Z
*
- * So, if BTk[n] = uint16 n [0,3] of BTk.
+ * So, if BTk[n] = u16 n [0,3] of BTk.
* BTk % BP = SUM((BTk[n] * 2^16n) % BP , 0<=n<4) % BP
* and the SUM term can be broken down:
* (BTk[n] * 2^16n) % BP
d11rxhdr_t *rxh;
struct dot11_header *h;
osl_t *osh;
- uint16 fc;
+ u16 fc;
uint len;
bool is_amsdu;
#ifdef BCMDBG
* Formula given by HT PHY Spec v 1.13
* len = 3(nsyms + nstream + 3) - 3
*/
-uint16 BCMFASTPATH
+u16 BCMFASTPATH
wlc_calc_lsig_len(wlc_info_t *wlc, ratespec_t ratespec, uint mac_len)
{
uint nsyms, len = 0, kNdps;
len = (3 * nsyms) - 3; /* (-3) excluding service bits and tail bits */
}
- return (uint16) len;
+ return (u16) len;
}
/* calculate frame duration of a given rate and length, return time in usec unit */
{
u8 phy_rate, index;
u8 basic_phy_rate, basic_index;
- uint16 dir_table, basic_table;
- uint16 basic_ptr;
+ u16 dir_table, basic_table;
+ u16 basic_ptr;
/* Shared memory address for the table we are reading */
dir_table = IS_OFDM(basic_rate) ? M_RT_DIRMAP_A : M_RT_DIRMAP_B;
const wlc_rateset_t *rs_dflt;
wlc_rateset_t rs;
u8 rate;
- uint16 entry_ptr;
+ u16 entry_ptr;
u8 plcp[D11_PHY_HDR_LEN];
- uint16 dur, sifs;
+ u16 dur, sifs;
uint i;
sifs = SIFS(wlc->band);
/* Calculate the duration of the Probe Response frame plus SIFS for the MAC */
dur =
- (uint16) wlc_calc_frame_time(wlc, rate, WLC_LONG_PREAMBLE,
+ (u16) wlc_calc_frame_time(wlc, rate, WLC_LONG_PREAMBLE,
frame_len);
dur += sifs;
/* Update the SHM Rate Table entry Probe Response values */
wlc_write_shm(wlc, entry_ptr + M_RT_PRS_PLCP_POS,
- (uint16) (plcp[0] + (plcp[1] << 8)));
+ (u16) (plcp[0] + (plcp[1] << 8)));
wlc_write_shm(wlc, entry_ptr + M_RT_PRS_PLCP_POS + 2,
- (uint16) (plcp[2] + (plcp[3] << 8)));
+ (u16) (plcp[2] + (plcp[3] << 8)));
wlc_write_shm(wlc, entry_ptr + M_RT_PRS_DUR_POS, dur);
}
}
-uint16
+u16
wlc_compute_bcntsfoff(wlc_info_t *wlc, ratespec_t rspec, bool short_preamble,
bool phydelay)
{
D11B_PHY_LPREHDR_TIME;
bcntsfoff += wlc_compute_airtime(wlc, rspec, DOT11_MAC_HDR_LEN);
}
- return (uint16) (bcntsfoff);
+ return (u16) (bcntsfoff);
}
/* Max buffering needed for beacon template/prb resp template is 142 bytes.
*/
static void
wlc_bcn_prb_template(wlc_info_t *wlc, uint type, ratespec_t bcn_rspec,
- wlc_bsscfg_t *cfg, uint16 *buf, int *len)
+ wlc_bsscfg_t *cfg, u16 *buf, int *len)
{
cck_phy_hdr_t *plcp;
struct dot11_management_header *h;
h = (struct dot11_management_header *)&plcp[1];
/* fill in 802.11 header */
- h->fc = htol16((uint16) type);
+ h->fc = htol16((u16) type);
/* DUR is 0 for multicast bcn, or filled in by MAC for prb resp */
/* A1 filled in by MAC for prb resp, broadcast for bcn */
if (MBSS_BCN_ENAB(cfg)) { /* Optimize: Some of if/else could be combined */
} else if (HWBCN_ENAB(cfg)) { /* Hardware beaconing for this config */
- uint16 bcn[BCN_TMPL_LEN / 2];
+ u16 bcn[BCN_TMPL_LEN / 2];
uint32 both_valid = MCMD_BCN0VLD | MCMD_BCN1VLD;
d11regs_t *regs = wlc->regs;
osl_t *osh = NULL;
void wlc_shm_ssid_upd(wlc_info_t *wlc, wlc_bsscfg_t *cfg)
{
u8 *ssidptr = cfg->SSID;
- uint16 base = M_SSID;
+ u16 base = M_SSID;
u8 ssidbuf[DOT11_MAX_SSID_LEN];
/* padding the ssid with zero and copy it into shm */
wlc_copyto_shm(wlc, base, ssidbuf, DOT11_MAX_SSID_LEN);
if (!MBSS_BCN_ENAB(cfg))
- wlc_write_shm(wlc, M_SSIDLEN, (uint16) cfg->SSID_len);
+ wlc_write_shm(wlc, M_SSIDLEN, (u16) cfg->SSID_len);
}
void wlc_update_probe_resp(wlc_info_t *wlc, bool suspend)
void
wlc_bss_update_probe_resp(wlc_info_t *wlc, wlc_bsscfg_t *cfg, bool suspend)
{
- uint16 prb_resp[BCN_TMPL_LEN / 2];
+ u16 prb_resp[BCN_TMPL_LEN / 2];
int len = BCN_TMPL_LEN;
/* write the probe response to hardware, or save in the config structure */
(len + 3) & ~3, prb_resp);
/* write the length of the probe response frame (+PLCP/-FCS) */
- wlc_write_shm(wlc, M_PRB_RESP_FRM_LEN, (uint16) len);
+ wlc_write_shm(wlc, M_PRB_RESP_FRM_LEN, (u16) len);
/* write the SSID and SSID length */
wlc_shm_ssid_upd(wlc, cfg);
* wlc_mod_prb_rsp_rate_table() by subtracting the PLCP len and adding the FCS.
*/
len += (-D11_PHY_HDR_LEN + DOT11_FCS_LEN);
- wlc_mod_prb_rsp_rate_table(wlc, (uint16) len);
+ wlc_mod_prb_rsp_rate_table(wlc, (u16) len);
if (suspend)
wlc_enable_mac(wlc);
d11txh_t *txh;
struct dot11_header *h;
struct scb *scb;
- uint16 fc;
+ u16 fc;
osh = wlc->osh;
idle_busy_ratio_x_16 = (100 - duty_cycle) * 16 / duty_cycle;
/* Only write to shared memory when wl is up */
if (writeToShm)
- wlc_write_shm(wlc, offset, (uint16) idle_busy_ratio_x_16);
+ wlc_write_shm(wlc, offset, (u16) idle_busy_ratio_x_16);
if (isOFDM)
- wlc->tx_duty_cycle_ofdm = (uint16) duty_cycle;
+ wlc->tx_duty_cycle_ofdm = (u16) duty_cycle;
else
- wlc->tx_duty_cycle_cck = (uint16) duty_cycle;
+ wlc->tx_duty_cycle_cck = (u16) duty_cycle;
return BCME_OK;
}
struct ether_addr *sa, uint32 wait_delay)
{
bool suspend;
- uint16 val = M_PKTENG_MODE_TX;
- volatile uint16 frame_cnt_check;
+ u16 val = M_PKTENG_MODE_TX;
+ volatile u16 frame_cnt_check;
u8 counter = 0;
wlc_bmac_set_deaf(wlc->hw, TRUE);
/* CTS frame */
val |= M_PKTENG_MODE_TX_CTS;
wlc_bmac_write_shm(wlc->hw, M_PKTENG_IFS,
- (uint16) pkteng->delay);
+ (u16) pkteng->delay);
wlc_bmac_write_shm(wlc->hw, M_PKTENG_CTRL, val);
}
wlc_bmac_set_deaf(wlc->hw, FALSE);
}
-/* Read a single uint16 from shared memory.
+/* Read a single u16 from shared memory.
* SHM 'offset' needs to be an even address
*/
-uint16 wlc_read_shm(wlc_info_t *wlc, uint offset)
+u16 wlc_read_shm(wlc_info_t *wlc, uint offset)
{
return wlc_bmac_read_shm(wlc->hw, offset);
}
-/* Write a single uint16 to shared memory.
+/* Write a single u16 to shared memory.
* SHM 'offset' needs to be an even address
*/
-void wlc_write_shm(wlc_info_t *wlc, uint offset, uint16 v)
+void wlc_write_shm(wlc_info_t *wlc, uint offset, u16 v)
{
wlc_bmac_write_shm(wlc->hw, offset, v);
}
* SHM 'offset' needs to be an even address and
* Range length 'len' must be an even number of bytes
*/
-void wlc_set_shm(wlc_info_t *wlc, uint offset, uint16 v, int len)
+void wlc_set_shm(wlc_info_t *wlc, uint offset, u16 v, int len)
{
/* offset and len need to be even */
ASSERT((offset & 1) == 0);
wlc_bmac_corereset(wlc->hw, flags);
}
-void wlc_mhf(wlc_info_t *wlc, u8 idx, uint16 mask, uint16 val, int bands)
+void wlc_mhf(wlc_info_t *wlc, u8 idx, u16 mask, u16 val, int bands)
{
wlc_bmac_mhf(wlc->hw, idx, mask, val, bands);
}
-uint16 wlc_mhf_get(wlc_info_t *wlc, u8 idx, int bands)
+u16 wlc_mhf_get(wlc_info_t *wlc, u8 idx, int bands)
{
return wlc_bmac_mhf_get(wlc->hw, idx, bands);
}
wlc_bmac_read_tsf(wlc->hw, tsf_l_ptr, tsf_h_ptr);
}
-void wlc_set_cwmin(wlc_info_t *wlc, uint16 newmin)
+void wlc_set_cwmin(wlc_info_t *wlc, u16 newmin)
{
wlc->band->CWmin = newmin;
wlc_bmac_set_cwmin(wlc->hw, newmin);
}
-void wlc_set_cwmax(wlc_info_t *wlc, uint16 newmax)
+void wlc_set_cwmax(wlc_info_t *wlc, u16 newmax)
{
wlc->band->CWmax = newmax;
wlc_bmac_set_cwmax(wlc->hw, newmax);