void *pkt;
struct scb *scb = &global_scb;
struct ieee80211_hdr *d11_header = (struct ieee80211_hdr *)(sdu->data);
- u16 type, fc;
ASSERT(sdu);
- fc = le16_to_cpu(d11_header->frame_control);
- type = (fc & IEEE80211_FCTL_FTYPE);
-
/* 802.11 standard requires management traffic to go at highest priority */
- prio = (type == IEEE80211_FTYPE_DATA ? sdu->priority : MAXPRIO);
+ prio = ieee80211_is_data(d11_header->frame_control) ? sdu->priority :
+ MAXPRIO;
fifo = prio2fifo[prio];
ASSERT((uint) skb_headroom(sdu) >= TXOFF);
u8 *plcp, plcp_fallback[D11_PHY_HDR_LEN];
struct osl_info *osh;
int len, phylen, rts_phylen;
- u16 fc, type, frameid, mch, phyctl, xfts, mainrates;
+ u16 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};
/* locate 802.11 MAC header */
h = (struct ieee80211_hdr *)(p->data);
- fc = le16_to_cpu(h->frame_control);
- type = (fc & IEEE80211_FCTL_FTYPE);
-
- qos = (type == IEEE80211_FTYPE_DATA &&
- FC_SUBTYPE_ANY_QOS(fc));
+ qos = ieee80211_is_data_qos(h->frame_control);
/* compute length of frame in bytes for use in PLCP computations */
len = pkttotlen(p);
frameid |= queue & TXFID_QUEUE_MASK;
/* set the ignpmq bit for all pkts tx'd in PS mode and for beacons */
- if (SCB_PS(scb) || ((fc & FC_KIND_MASK) == FC_BEACON))
+ if (SCB_PS(scb) || ieee80211_is_beacon(h->frame_control))
mcl |= TXC_IGNOREPMQ;
ASSERT(hw->max_rates <= IEEE80211_TX_MAX_RATES);
txrate[1]->count = 0;
/* (2) PROTECTION, may change rspec */
- if ((ieee80211_is_data(fc) || ieee80211_is_mgmt(fc)) &&
+ if ((ieee80211_is_data(h->frame_control) ||
+ ieee80211_is_mgmt(h->frame_control)) &&
(phylen > wlc->RTSThresh) && !is_multicast_ether_addr(h->addr1))
use_rts = true;
plcp[0];
/* DUR field for main rate */
- if ((fc != FC_PS_POLL) &&
+ if (!ieee80211_is_pspoll(h->frame_control) &&
!is_multicast_ether_addr(h->addr1) && !use_rifs) {
durid =
wlc_compute_frame_dur(wlc, rspec[0], preamble_type[0],
}
/* DUR field for fallback rate */
- if (fc == FC_PS_POLL)
+ if (ieee80211_is_pspoll(h->frame_control))
txh->FragDurFallback = h->duration_id;
else if (is_multicast_ether_addr(h->addr1) || use_rifs)
txh->FragDurFallback = 0;
txh->RTSDurFallback = cpu_to_le16(durid);
if (use_cts) {
- rts->frame_control = cpu_to_le16(FC_CTS);
+ rts->frame_control = cpu_to_le16(IEEE80211_FTYPE_CTL |
+ IEEE80211_STYPE_CTS);
+
memcpy(&rts->ra, &h->addr2, ETH_ALEN);
} else {
- rts->frame_control = cpu_to_le16((u16) FC_RTS);
+ rts->frame_control = cpu_to_le16(IEEE80211_FTYPE_CTL |
+ IEEE80211_STYPE_RTS);
+
memcpy(&rts->ra, &h->addr1, 2 * ETH_ALEN);
}
uint totlen, supr_status;
bool lastframe;
struct ieee80211_hdr *h;
- u16 fc;
u16 mcl;
struct ieee80211_tx_info *tx_info;
struct ieee80211_tx_rate *txrate;
tx_info = IEEE80211_SKB_CB(p);
h = (struct ieee80211_hdr *)((u8 *) (txh + 1) + D11_PHY_HDR_LEN);
- fc = le16_to_cpu(h->frame_control);
scb = (struct scb *)tx_info->control.sta->drv_priv;
tx_rts_count =
(txs->status & TX_STATUS_RTS_RTX_MASK) >> TX_STATUS_RTS_RTX_SHIFT;
- lastframe = (fc & IEEE80211_FCTL_MOREFRAGS) == 0;
+ lastframe = !ieee80211_has_morefrags(h->frame_control);
if (!lastframe) {
WL_ERROR("Not last frame!\n");
d11rxhdr_t *rxh;
struct ieee80211_hdr *h;
struct osl_info *osh;
- u16 fc;
uint len;
bool is_amsdu;
}
/* check received pkt has at least frame control field */
- if (len >= D11_PHY_HDR_LEN + sizeof(h->frame_control)) {
- fc = le16_to_cpu(h->frame_control);
- } else {
+ if (len < D11_PHY_HDR_LEN + sizeof(h->frame_control)) {
wlc->pub->_cnt->rxrunt++;
goto toss;
}
/* explicitly test bad src address to avoid sending bad deauth */
if (!is_amsdu) {
/* CTS and ACK CTL frames are w/o a2 */
- if ((fc & IEEE80211_FCTL_FTYPE) == IEEE80211_FTYPE_DATA ||
- (fc & IEEE80211_FCTL_FTYPE) == IEEE80211_FTYPE_MGMT) {
+
+ if (ieee80211_is_data(h->frame_control) ||
+ ieee80211_is_mgmt(h->frame_control)) {
if ((is_zero_ether_addr(h->addr2) ||
is_multicast_ether_addr(h->addr2))) {
WL_ERROR("wl%d: %s: dropping a frame with "
}
/* due to sheer numbers, toss out probe reqs for now */
- if ((fc & IEEE80211_FCTL_FTYPE) == IEEE80211_FTYPE_MGMT) {
- if ((fc & FC_KIND_MASK) == FC_PROBE_REQ)
- goto toss;
- }
+ if (ieee80211_is_probe_req(h->frame_control))
+ goto toss;
if (is_amsdu) {
WL_ERROR("%s: is_amsdu causing toss\n", __func__);
* and included up to, but not including, the 4 byte FCS.
*/
static void
-wlc_bcn_prb_template(struct wlc_info *wlc, uint type, ratespec_t bcn_rspec,
+wlc_bcn_prb_template(struct wlc_info *wlc, u16 type, ratespec_t bcn_rspec,
wlc_bsscfg_t *cfg, u16 *buf, int *len)
{
static const u8 ether_bcast[ETH_ALEN] = {255, 255, 255, 255, 255, 255};
int hdr_len, body_len;
ASSERT(*len >= 142);
- ASSERT(type == FC_BEACON || type == FC_PROBE_RESP);
+ ASSERT(type == IEEE80211_STYPE_BEACON ||
+ type == IEEE80211_STYPE_PROBE_RESP);
- if (MBSS_BCN_ENAB(cfg) && type == FC_BEACON)
+ if (MBSS_BCN_ENAB(cfg) && type == IEEE80211_STYPE_BEACON)
hdr_len = DOT11_MAC_HDR_LEN;
else
hdr_len = D11_PHY_HDR_LEN + DOT11_MAC_HDR_LEN;
plcp = (cck_phy_hdr_t *) buf;
/* PLCP for Probe Response frames are filled in from core's rate table */
- if (type == FC_BEACON && !MBSS_BCN_ENAB(cfg)) {
+ if (type == IEEE80211_STYPE_BEACON && !MBSS_BCN_ENAB(cfg)) {
/* fill in PLCP */
wlc_compute_plcp(wlc, bcn_rspec,
(DOT11_MAC_HDR_LEN + body_len + FCS_LEN),
if (!SOFTBCN_ENAB(cfg))
wlc_beacon_phytxctl_txant_upd(wlc, bcn_rspec);
- if (MBSS_BCN_ENAB(cfg) && type == FC_BEACON)
+ if (MBSS_BCN_ENAB(cfg) && type == IEEE80211_STYPE_BEACON)
h = (struct ieee80211_mgmt *)&plcp[0];
else
h = (struct ieee80211_mgmt *)&plcp[1];
/* fill in 802.11 header */
- h->frame_control = cpu_to_le16((u16) type);
+ h->frame_control = cpu_to_le16(IEEE80211_FTYPE_MGMT | 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 (type == FC_BEACON)
+ if (type == IEEE80211_STYPE_BEACON)
memcpy(&h->da, ðer_bcast, ETH_ALEN);
memcpy(&h->sa, &cfg->cur_etheraddr, ETH_ALEN);
memcpy(&h->bssid, &cfg->BSSID, ETH_ALEN);
true));
/* update the template and ucode shm */
- wlc_bcn_prb_template(wlc, FC_BEACON, wlc->bcn_rspec, cfg, bcn,
- &len);
+ wlc_bcn_prb_template(wlc, IEEE80211_STYPE_BEACON,
+ wlc->bcn_rspec, cfg, bcn, &len);
wlc_write_hw_bcntemplates(wlc, bcn, len, false);
}
}
if (!MBSS_PRB_ENAB(cfg)) {
/* create the probe response template */
- wlc_bcn_prb_template(wlc, FC_PROBE_RESP, 0, cfg, prb_resp,
- &len);
+ wlc_bcn_prb_template(wlc, IEEE80211_STYPE_PROBE_RESP, 0, cfg,
+ prb_resp, &len);
if (suspend)
wlc_suspend_mac_and_wait(wlc);
d11txh_t *txh;
struct ieee80211_hdr *h;
struct scb *scb;
- u16 fc;
osh = wlc->osh;
ASSERT(txh);
h = (struct ieee80211_hdr *)((u8 *) (txh + 1) + D11_PHY_HDR_LEN);
ASSERT(h);
- fc = le16_to_cpu(h->frame_control);
/* get the pkt queue info. This was put at wlc_sendctl or wlc_send for PDU */
fifo = le16_to_cpu(txh->TxFrameID) & TXFID_QUEUE_MASK;