SetSeqNum(pwlanhdr, 0/*pmlmeext->mgnt_seq*/);
        /* pmlmeext->mgnt_seq++; */
-       SetFrameSubType(pframe, WIFI_BEACON);
+       SetFrameSubType(pframe, IEEE80211_STYPE_BEACON);
 
        pframe += sizeof(struct ieee80211_hdr_3addr);
        pattrib->pktlen = sizeof(struct ieee80211_hdr_3addr);
 
        SetSeqNum(pwlanhdr, pmlmeext->mgnt_seq);
        pmlmeext->mgnt_seq++;
-       SetFrameSubType(fctrl, WIFI_PROBERSP);
+       SetFrameSubType(fctrl, IEEE80211_STYPE_PROBE_RESP);
 
        pattrib->hdrlen = sizeof(struct ieee80211_hdr_3addr);
        pattrib->pktlen = pattrib->hdrlen;
 
        SetSeqNum(pwlanhdr, pmlmeext->mgnt_seq);
        pmlmeext->mgnt_seq++;
-       SetFrameSubType(pframe, WIFI_PROBEREQ);
+       SetFrameSubType(pframe, IEEE80211_STYPE_PROBE_REQ);
 
        pframe += sizeof(struct ieee80211_hdr_3addr);
        pattrib->pktlen = sizeof(struct ieee80211_hdr_3addr);
 
        SetSeqNum(pwlanhdr, pmlmeext->mgnt_seq);
        pmlmeext->mgnt_seq++;
-       SetFrameSubType(pframe, WIFI_AUTH);
+       SetFrameSubType(pframe, IEEE80211_STYPE_AUTH);
 
        pframe += sizeof(struct ieee80211_hdr_3addr);
        pattrib->pktlen = sizeof(struct ieee80211_hdr_3addr);
 
        SetSeqNum(pwlanhdr, pmlmeext->mgnt_seq);
        pmlmeext->mgnt_seq++;
-       if ((pkt_type == WIFI_ASSOCRSP) || (pkt_type == WIFI_REASSOCRSP))
+       if ((pkt_type == IEEE80211_STYPE_ASSOC_RESP) || (pkt_type == IEEE80211_STYPE_REASSOC_RESP))
                SetFrameSubType(pwlanhdr, pkt_type);
        else
                return;
 
        SetSeqNum(pwlanhdr, pmlmeext->mgnt_seq);
        pmlmeext->mgnt_seq++;
-       SetFrameSubType(pframe, WIFI_ASSOCREQ);
+       SetFrameSubType(pframe, IEEE80211_STYPE_ASSOC_REQ);
 
        pframe += sizeof(struct ieee80211_hdr_3addr);
        pattrib->pktlen = sizeof(struct ieee80211_hdr_3addr);
 
        SetSeqNum(pwlanhdr, pmlmeext->mgnt_seq);
        pmlmeext->mgnt_seq++;
-       SetFrameSubType(pframe, WIFI_DATA_NULL);
+       SetFrameSubType(pframe, IEEE80211_FTYPE_DATA | IEEE80211_STYPE_NULLFUNC);
 
        pframe += sizeof(struct ieee80211_hdr_3addr);
        pattrib->pktlen = sizeof(struct ieee80211_hdr_3addr);
 
        SetSeqNum(pwlanhdr, pmlmeext->mgnt_seq);
        pmlmeext->mgnt_seq++;
-       SetFrameSubType(pframe, WIFI_QOS_DATA_NULL);
+       SetFrameSubType(pframe, IEEE80211_FTYPE_DATA | IEEE80211_STYPE_QOS_NULLFUNC);
 
        pframe += sizeof(struct ieee80211_qos_hdr);
        pattrib->pktlen = sizeof(struct ieee80211_qos_hdr);
 
        SetSeqNum(pwlanhdr, pmlmeext->mgnt_seq);
        pmlmeext->mgnt_seq++;
-       SetFrameSubType(pframe, WIFI_DEAUTH);
+       SetFrameSubType(pframe, IEEE80211_STYPE_DEAUTH);
 
        pframe += sizeof(struct ieee80211_hdr_3addr);
        pattrib->pktlen = sizeof(struct ieee80211_hdr_3addr);
 
        SetSeqNum(pwlanhdr, pmlmeext->mgnt_seq);
        pmlmeext->mgnt_seq++;
-       SetFrameSubType(pframe, WIFI_ACTION);
+       SetFrameSubType(pframe, IEEE80211_STYPE_ACTION);
 
        pframe += sizeof(struct ieee80211_hdr_3addr);
        pattrib->pktlen = sizeof(struct ieee80211_hdr_3addr);
 
        SetSeqNum(pwlanhdr, pmlmeext->mgnt_seq);
        pmlmeext->mgnt_seq++;
-       SetFrameSubType(pframe, WIFI_ACTION);
+       SetFrameSubType(pframe, IEEE80211_STYPE_ACTION);
 
        pframe += sizeof(struct ieee80211_hdr_3addr);
        pattrib->pktlen = sizeof(struct ieee80211_hdr_3addr);
 
        subtype = GetFrameSubType(pframe);
 
-       if (subtype == WIFI_BEACON) {
+       if (subtype == IEEE80211_STYPE_BEACON) {
                bssid->Reserved[0] = 1;
                ie_offset = _BEACON_IE_OFFSET_;
        } else {
                /*  FIXME : more type */
-               if (subtype == WIFI_PROBEREQ) {
+               if (subtype == IEEE80211_STYPE_PROBE_REQ) {
                        ie_offset = _PROBEREQ_IE_OFFSET_;
                        bssid->Reserved[0] = 2;
-               } else if (subtype == WIFI_PROBERSP) {
+               } else if (subtype == IEEE80211_STYPE_PROBE_RESP) {
                        ie_offset = _PROBERSP_IE_OFFSET_;
                        bssid->Reserved[0] = 3;
                } else {
                }
        }
 
-       if (subtype == WIFI_PROBEREQ) {
+       if (subtype == IEEE80211_STYPE_PROBE_REQ) {
                /*  FIXME */
                bssid->InfrastructureMode = Ndis802_11Infrastructure;
                ether_addr_copy(bssid->MacAddress, GetAddr2Ptr(pframe));
                return _FAIL;
 
        frame_type = GetFrameSubType(pframe);
-       if (frame_type == WIFI_ASSOCREQ) {
+       if (frame_type == IEEE80211_STYPE_ASSOC_REQ) {
                reassoc = 0;
                ie_offset = _ASOCREQ_IE_OFFSET_;
-       } else { /*  WIFI_REASSOCREQ */
+       } else { /*  IEEE80211_STYPE_REASSOC_REQ */
                reassoc = 1;
                ie_offset = _REASOCREQ_IE_OFFSET_;
        }
                sta_info_update(padapter, pstat);
 
                /* issue assoc rsp before notify station join event. */
-               if (frame_type == WIFI_ASSOCREQ)
-                       issue_asocrsp(padapter, status, pstat, WIFI_ASSOCRSP);
+               if (frame_type == IEEE80211_STYPE_ASSOC_REQ)
+                       issue_asocrsp(padapter, status, pstat, IEEE80211_STYPE_ASSOC_RESP);
                else
-                       issue_asocrsp(padapter, status, pstat, WIFI_REASSOCRSP);
+                       issue_asocrsp(padapter, status, pstat, IEEE80211_STYPE_REASSOC_RESP);
 
                /* 2 - report to upper layer */
                DBG_88E("indicate_sta_join_event to upper layer - hostapd\n");
 OnAssocReqFail:
 
        pstat->aid = 0;
-       if (frame_type == WIFI_ASSOCREQ)
-               issue_asocrsp(padapter, status, pstat, WIFI_ASSOCRSP);
+       if (frame_type == IEEE80211_STYPE_ASSOC_REQ)
+               issue_asocrsp(padapter, status, pstat, IEEE80211_STYPE_ASSOC_RESP);
        else
-               issue_asocrsp(padapter, status, pstat, WIFI_REASSOCRSP);
+               issue_asocrsp(padapter, status, pstat, IEEE80211_STYPE_REASSOC_RESP);
 
 #endif /* CONFIG_88EU_AP_MODE */
 
 *****************************************************************************/
 
 static struct mlme_handler mlme_sta_tbl[] = {
-       {WIFI_ASSOCREQ,   "OnAssocReq",   &OnAssocReq},
-       {WIFI_ASSOCRSP,   "OnAssocRsp",   &OnAssocRsp},
-       {WIFI_REASSOCREQ, "OnReAssocReq", &OnAssocReq},
-       {WIFI_REASSOCRSP, "OnReAssocRsp", &OnAssocRsp},
-       {WIFI_PROBEREQ,   "OnProbeReq",   &OnProbeReq},
-       {WIFI_PROBERSP,   "OnProbeRsp",   &OnProbeRsp},
-       {0,               "DoReserved",   &DoReserved},
-       {0,               "DoReserved",   &DoReserved},
-       {WIFI_BEACON,     "OnBeacon",     &OnBeacon},
-       {WIFI_ATIM,       "OnATIM",       &OnAtim},
-       {WIFI_DISASSOC,   "OnDisassoc",   &OnDisassoc},
-       {WIFI_AUTH,       "OnAuth",       &OnAuthClient},
-       {WIFI_DEAUTH,     "OnDeAuth",     &OnDeAuth},
-       {WIFI_ACTION,     "OnAction",     &OnAction},
+       {IEEE80211_STYPE_ASSOC_REQ,     "OnAssocReq",   &OnAssocReq},
+       {IEEE80211_STYPE_ASSOC_RESP,    "OnAssocRsp",   &OnAssocRsp},
+       {IEEE80211_STYPE_REASSOC_REQ,   "OnReAssocReq", &OnAssocReq},
+       {IEEE80211_STYPE_REASSOC_RESP,  "OnReAssocRsp", &OnAssocRsp},
+       {IEEE80211_STYPE_PROBE_REQ,     "OnProbeReq",   &OnProbeReq},
+       {IEEE80211_STYPE_PROBE_RESP,    "OnProbeRsp",   &OnProbeRsp},
+       {0,                             "DoReserved",   &DoReserved},
+       {0,                             "DoReserved",   &DoReserved},
+       {IEEE80211_STYPE_BEACON,        "OnBeacon",     &OnBeacon},
+       {IEEE80211_STYPE_ATIM,          "OnATIM",       &OnAtim},
+       {IEEE80211_STYPE_DISASSOC,      "OnDisassoc",   &OnDisassoc},
+       {IEEE80211_STYPE_AUTH,          "OnAuth",       &OnAuthClient},
+       {IEEE80211_STYPE_DEAUTH,        "OnDeAuth",     &OnDeAuth},
+       {IEEE80211_STYPE_ACTION,        "OnAction",     &OnAction},
 };
 
 int init_hw_mlme_ext(struct adapter *padapter)
 
 #ifdef CONFIG_88EU_AP_MODE
        switch (GetFrameSubType(pframe)) {
-       case WIFI_AUTH:
+       case IEEE80211_STYPE_AUTH:
                if (check_fwstate(pmlmepriv, WIFI_AP_STATE))
                        ptable->func = &OnAuth;
                else
                        ptable->func = &OnAuthClient;
                fallthrough;
-       case WIFI_ASSOCREQ:
-       case WIFI_REASSOCREQ:
-       case WIFI_PROBEREQ:
-       case WIFI_BEACON:
-       case WIFI_ACTION:
+       case IEEE80211_STYPE_ASSOC_REQ:
+       case IEEE80211_STYPE_REASSOC_REQ:
+       case IEEE80211_STYPE_PROBE_REQ:
+       case IEEE80211_STYPE_BEACON:
+       case IEEE80211_STYPE_ACTION:
                _mgt_dispatcher(padapter, ptable, precv_frame);
                break;
        default:
 
        WIFI_QOS_DATA_TYPE      = (BIT(7) | BIT(3)),    /*  QoS Data */
 };
 
-enum WIFI_FRAME_SUBTYPE {
-       /*  below is for mgt frame */
-       WIFI_ASSOCREQ       = (0 | WIFI_MGT_TYPE),
-       WIFI_ASSOCRSP       = (BIT(4) | WIFI_MGT_TYPE),
-       WIFI_REASSOCREQ     = (BIT(5) | WIFI_MGT_TYPE),
-       WIFI_REASSOCRSP     = (BIT(5) | BIT(4) | WIFI_MGT_TYPE),
-       WIFI_PROBEREQ       = (BIT(6) | WIFI_MGT_TYPE),
-       WIFI_PROBERSP       = (BIT(6) | BIT(4) | WIFI_MGT_TYPE),
-       WIFI_BEACON         = (BIT(7) | WIFI_MGT_TYPE),
-       WIFI_ATIM           = (BIT(7) | BIT(4) | WIFI_MGT_TYPE),
-       WIFI_DISASSOC       = (BIT(7) | BIT(5) | WIFI_MGT_TYPE),
-       WIFI_AUTH           = (BIT(7) | BIT(5) | BIT(4) | WIFI_MGT_TYPE),
-       WIFI_DEAUTH         = (BIT(7) | BIT(6) | WIFI_MGT_TYPE),
-       WIFI_ACTION         = (BIT(7) | BIT(6) | BIT(4) | WIFI_MGT_TYPE),
-
-       /*  below is for control frame */
-       WIFI_PSPOLL         = (BIT(7) | BIT(5) | WIFI_CTRL_TYPE),
-       WIFI_RTS            = (BIT(7) | BIT(5) | BIT(4) | WIFI_CTRL_TYPE),
-       WIFI_CTS            = (BIT(7) | BIT(6) | WIFI_CTRL_TYPE),
-       WIFI_ACK            = (BIT(7) | BIT(6) | BIT(4) | WIFI_CTRL_TYPE),
-       WIFI_CFEND          = (BIT(7) | BIT(6) | BIT(5) | WIFI_CTRL_TYPE),
-       WIFI_CFEND_CFACK    = (BIT(7) | BIT(6) | BIT(5) | BIT(4) |
-       WIFI_CTRL_TYPE),
-
-       /*  below is for data frame */
-       WIFI_DATA           = (0 | WIFI_DATA_TYPE),
-       WIFI_DATA_CFACK     = (BIT(4) | WIFI_DATA_TYPE),
-       WIFI_DATA_CFPOLL    = (BIT(5) | WIFI_DATA_TYPE),
-       WIFI_DATA_CFACKPOLL = (BIT(5) | BIT(4) | WIFI_DATA_TYPE),
-       WIFI_DATA_NULL      = (BIT(6) | WIFI_DATA_TYPE),
-       WIFI_CF_ACK         = (BIT(6) | BIT(4) | WIFI_DATA_TYPE),
-       WIFI_CF_POLL        = (BIT(6) | BIT(5) | WIFI_DATA_TYPE),
-       WIFI_CF_ACKPOLL     = (BIT(6) | BIT(5) | BIT(4) | WIFI_DATA_TYPE),
-       WIFI_QOS_DATA_NULL      = (BIT(6) | WIFI_QOS_DATA_TYPE),
-};
-
 #define SetToDs(pbuf)  \
        *(__le16 *)(pbuf) |= cpu_to_le16(IEEE80211_FCTL_TODS)