mirror of
https://github.com/Mange/rtl8192eu-linux-driver
synced 2025-12-10 00:04:17 +00:00
remove enum WIFI_FRAME_SUBTYPE
The values defined in enum WIFI_FRAME_SUBTYPE are the same the #define IEEE80211_STYPE_xxx from <linux/ieee80211.h>. Port 33ed2b7079f6c38abce6abbaf1e6be4edad919d8
This commit is contained in:
@@ -584,7 +584,7 @@ union recv_frame *decryptor(_adapter *padapter, union recv_frame *precv_frame)
|
||||
}
|
||||
|
||||
if (prxattrib->encrypt && !prxattrib->bdecrypted) {
|
||||
if (GetFrameType(get_recvframe_data(precv_frame)) == WIFI_DATA
|
||||
if (GetFrameType(get_recvframe_data(precv_frame)) == (IEEE80211_FTYPE_DATA | IEEE80211_STYPE_DATA)
|
||||
#ifdef CONFIG_CONCURRENT_MODE
|
||||
&& !is_multicast_ether_addr(prxattrib->ra) /* bc/mc packets may use sw decryption for concurrent mode */
|
||||
#endif
|
||||
@@ -1240,7 +1240,7 @@ sint sta2sta_data_frame(
|
||||
process_pwrbit_data(adapter, precv_frame, ptdls_sta);
|
||||
|
||||
/* if NULL-frame, check pwrbit */
|
||||
if ((get_frame_sub_type(ptr) & WIFI_DATA_NULL) == WIFI_DATA_NULL) {
|
||||
if ((get_frame_sub_type(ptr) & IEEE80211_FTYPE_DATA | IEEE80211_STYPE_NULLFUNC) == IEEE80211_FTYPE_DATA | IEEE80211_STYPE_NULLFUNC) {
|
||||
/* NULL-frame with pwrbit=1, buffer_STA should buffer frames for sleep_STA */
|
||||
if (GetPwrMgt(ptr)) {
|
||||
/* it would be triggered when we are off channel and receiving NULL DATA */
|
||||
@@ -1262,7 +1262,7 @@ sint sta2sta_data_frame(
|
||||
goto exit;
|
||||
}
|
||||
|
||||
if ((get_frame_sub_type(ptr) & WIFI_QOS_DATA_TYPE) == WIFI_QOS_DATA_TYPE)
|
||||
if ((get_frame_sub_type(ptr) & (IEEE80211_STYPE_QOS_DATA | IEEE80211_FTYPE_DATA)) == (IEEE80211_STYPE_QOS_DATA | IEEE80211_FTYPE_DATA))
|
||||
process_wmmps_data(adapter, precv_frame, ptdls_sta);
|
||||
|
||||
ptdls_sta->tdls_sta_state &= ~(TDLS_WAIT_PTR_STATE);
|
||||
@@ -1396,7 +1396,7 @@ sint ap2sta_data_frame(
|
||||
goto exit;
|
||||
}
|
||||
|
||||
/*if ((get_frame_sub_type(ptr) & WIFI_QOS_DATA_TYPE) == WIFI_QOS_DATA_TYPE) {
|
||||
/*if ((get_frame_sub_type(ptr) & (IEEE80211_STYPE_QOS_DATA | IEEE80211_FTYPE_DATA)) == (IEEE80211_STYPE_QOS_DATA | IEEE80211_FTYPE_DATA)) {
|
||||
}
|
||||
*/
|
||||
|
||||
@@ -1500,7 +1500,7 @@ sint sta2ap_data_frame(
|
||||
|
||||
process_pwrbit_data(adapter, precv_frame, *psta);
|
||||
|
||||
if ((get_frame_sub_type(ptr) & WIFI_QOS_DATA_TYPE) == WIFI_QOS_DATA_TYPE)
|
||||
if ((get_frame_sub_type(ptr) & (IEEE80211_STYPE_QOS_DATA | IEEE80211_FTYPE_DATA)) == (IEEE80211_STYPE_QOS_DATA | IEEE80211_FTYPE_DATA))
|
||||
process_wmmps_data(adapter, precv_frame, *psta);
|
||||
|
||||
if (get_frame_sub_type(ptr) & BIT(6)) {
|
||||
@@ -1561,7 +1561,7 @@ sint validate_recv_ctrl_frame(_adapter *padapter, union recv_frame *precv_frame)
|
||||
|
||||
/* RTW_INFO("+validate_recv_ctrl_frame\n"); */
|
||||
|
||||
if (GetFrameType(pframe) != WIFI_CTRL_TYPE)
|
||||
if (GetFrameType(pframe) != IEEE80211_FTYPE_CTL)
|
||||
return _FAIL;
|
||||
|
||||
/* receive the frames that ra(a1) is my address */
|
||||
@@ -1577,7 +1577,7 @@ sint validate_recv_ctrl_frame(_adapter *padapter, union recv_frame *precv_frame)
|
||||
psta->sta_stats.rx_ctrl_pkts++;
|
||||
|
||||
/* only handle ps-poll */
|
||||
if (get_frame_sub_type(pframe) == WIFI_PSPOLL) {
|
||||
if (get_frame_sub_type(pframe) == (IEEE80211_FTYPE_CTL | IEEE80211_STYPE_PSPOLL)) {
|
||||
#ifdef CONFIG_AP_MODE
|
||||
u16 aid;
|
||||
u8 wmmps_ac = 0;
|
||||
@@ -1697,7 +1697,7 @@ sint validate_recv_ctrl_frame(_adapter *padapter, union recv_frame *precv_frame)
|
||||
#ifdef CONFIG_BEAMFORMING
|
||||
rtw_beamforming_get_ndpa_frame(padapter, precv_frame);
|
||||
#endif/*CONFIG_BEAMFORMING*/
|
||||
} else if (get_frame_sub_type(pframe) == WIFI_BAR) {
|
||||
} else if (get_frame_sub_type(pframe) == IEEE80211_STYPE_BACK_REQ) {
|
||||
rtw_process_bar_frame(padapter, precv_frame);
|
||||
}
|
||||
|
||||
@@ -1746,15 +1746,15 @@ static sint validate_mgmt_protect(_adapter *adapter, union recv_frame *precv_fra
|
||||
is_bmc = is_multicast_ether_addr(GetAddr1Ptr(ptr));
|
||||
|
||||
#if DBG_VALIDATE_MGMT_PROTECT
|
||||
if (subtype == WIFI_DEAUTH) {
|
||||
if (subtype == IEEE80211_STYPE_DEAUTH) {
|
||||
RTW_INFO(FUNC_ADPT_FMT" bmc:%u, deauth, privacy:%u, encrypt:%u, bdecrypted:%u\n"
|
||||
, FUNC_ADPT_ARG(adapter)
|
||||
, is_bmc, pattrib->privacy, pattrib->encrypt, pattrib->bdecrypted);
|
||||
} else if (subtype == WIFI_DISASSOC) {
|
||||
} else if (subtype == IEEE80211_STYPE_DISASSOC) {
|
||||
RTW_INFO(FUNC_ADPT_FMT" bmc:%u, disassoc, privacy:%u, encrypt:%u, bdecrypted:%u\n"
|
||||
, FUNC_ADPT_ARG(adapter)
|
||||
, is_bmc, pattrib->privacy, pattrib->encrypt, pattrib->bdecrypted);
|
||||
} if (subtype == WIFI_ACTION) {
|
||||
} if (subtype == IEEE80211_STYPE_ACTION) {
|
||||
if (pattrib->privacy) {
|
||||
RTW_INFO(FUNC_ADPT_FMT" bmc:%u, action(?), privacy:%u, encrypt:%u, bdecrypted:%u\n"
|
||||
, FUNC_ADPT_ARG(adapter)
|
||||
@@ -1774,12 +1774,12 @@ static sint validate_mgmt_protect(_adapter *adapter, union recv_frame *precv_fra
|
||||
goto exit;
|
||||
}
|
||||
|
||||
if (subtype == WIFI_ACTION)
|
||||
if (subtype == IEEE80211_STYPE_ACTION)
|
||||
category = *(ptr + sizeof(struct rtw_ieee80211_hdr_3addr));
|
||||
|
||||
if (is_bmc) {
|
||||
/* broadcast cases */
|
||||
if (subtype == WIFI_ACTION) {
|
||||
if (subtype == IEEE80211_STYPE_ACTION) {
|
||||
if (CATEGORY_IS_GROUP_PRIVACY(category)) {
|
||||
/* drop broadcast group privacy action frame without encryption */
|
||||
#if DBG_VALIDATE_MGMT_PROTECT
|
||||
@@ -1793,7 +1793,7 @@ static sint validate_mgmt_protect(_adapter *adapter, union recv_frame *precv_fra
|
||||
goto bip_verify;
|
||||
}
|
||||
}
|
||||
if (subtype == WIFI_DEAUTH || subtype == WIFI_DISASSOC) {
|
||||
if (subtype == IEEE80211_STYPE_DEAUTH || subtype == IEEE80211_STYPE_DISASSOC) {
|
||||
/* broadcast deauth or disassoc frame need BIP check */
|
||||
goto bip_verify;
|
||||
}
|
||||
@@ -1802,13 +1802,13 @@ static sint validate_mgmt_protect(_adapter *adapter, union recv_frame *precv_fra
|
||||
} else {
|
||||
/* unicast cases */
|
||||
#ifdef CONFIG_IEEE80211W
|
||||
if (subtype == WIFI_DEAUTH || subtype == WIFI_DISASSOC) {
|
||||
if (subtype == IEEE80211_STYPE_DEAUTH || subtype == IEEE80211_STYPE_DISASSOC) {
|
||||
if (!MLME_IS_MESH(adapter)) {
|
||||
unsigned short reason = le16_to_cpu(*(unsigned short *)(ptr + WLAN_HDR_A3_LEN));
|
||||
|
||||
#if DBG_VALIDATE_MGMT_PROTECT
|
||||
RTW_INFO(FUNC_ADPT_FMT" unicast %s, reason=%d w/o encrypt\n"
|
||||
, FUNC_ADPT_ARG(adapter), subtype == WIFI_DEAUTH ? "deauth" : "disassoc", reason);
|
||||
, FUNC_ADPT_ARG(adapter), subtype == IEEE80211_STYPE_DEAUTH ? "deauth" : "disassoc", reason);
|
||||
#endif
|
||||
if (reason == 6 || reason == 7) {
|
||||
/* issue sa query request */
|
||||
@@ -1819,7 +1819,7 @@ static sint validate_mgmt_protect(_adapter *adapter, union recv_frame *precv_fra
|
||||
}
|
||||
#endif
|
||||
|
||||
if (subtype == WIFI_ACTION && CATEGORY_IS_ROBUST(category)) {
|
||||
if (subtype == IEEE80211_STYPE_ACTION && CATEGORY_IS_ROBUST(category)) {
|
||||
if (psta->bpairwise_key_installed == _TRUE) {
|
||||
#if DBG_VALIDATE_MGMT_PROTECT
|
||||
RTW_INFO(FUNC_ADPT_FMT" unicast robust action(%d) w/o encrypt\n"
|
||||
@@ -1959,11 +1959,11 @@ sint validate_recv_mgnt_frame(PADAPTER padapter, union recv_frame *precv_frame)
|
||||
if (psta) {
|
||||
psta->sta_stats.last_rx_time = jiffies;
|
||||
psta->sta_stats.rx_mgnt_pkts++;
|
||||
if (get_frame_sub_type(precv_frame->u.hdr.rx_data) == WIFI_BEACON)
|
||||
if (get_frame_sub_type(precv_frame->u.hdr.rx_data) == IEEE80211_STYPE_BEACON)
|
||||
psta->sta_stats.rx_beacon_pkts++;
|
||||
else if (get_frame_sub_type(precv_frame->u.hdr.rx_data) == WIFI_PROBEREQ)
|
||||
else if (get_frame_sub_type(precv_frame->u.hdr.rx_data) == IEEE80211_STYPE_PROBE_REQ)
|
||||
psta->sta_stats.rx_probereq_pkts++;
|
||||
else if (get_frame_sub_type(precv_frame->u.hdr.rx_data) == WIFI_PROBERSP) {
|
||||
else if (get_frame_sub_type(precv_frame->u.hdr.rx_data) == IEEE80211_STYPE_PROBE_RESP) {
|
||||
if (_rtw_memcmp(adapter_mac_addr(padapter), GetAddr1Ptr(precv_frame->u.hdr.rx_data), ETH_ALEN) == _TRUE)
|
||||
psta->sta_stats.rx_probersp_pkts++;
|
||||
else if (is_broadcast_mac_addr(GetAddr1Ptr(precv_frame->u.hdr.rx_data))
|
||||
@@ -2290,14 +2290,14 @@ sint validate_recv_frame(_adapter *adapter, union recv_frame *precv_frame)
|
||||
rtw_hal_get_def_var(adapter, HAL_DEF_DBG_DUMP_RXPKT, &(bDumpRxPkt));
|
||||
if (bDumpRxPkt == 1) /* dump all rx packets */
|
||||
dump_rx_packet(ptr);
|
||||
else if ((bDumpRxPkt == 2) && (type == WIFI_MGT_TYPE))
|
||||
else if ((bDumpRxPkt == 2) && (type == IEEE80211_FTYPE_MGMT))
|
||||
dump_rx_packet(ptr);
|
||||
else if ((bDumpRxPkt == 3) && (type == WIFI_DATA_TYPE))
|
||||
else if ((bDumpRxPkt == 3) && (type == IEEE80211_FTYPE_DATA))
|
||||
dump_rx_packet(ptr);
|
||||
}
|
||||
#endif
|
||||
switch (type) {
|
||||
case WIFI_MGT_TYPE: /* mgnt */
|
||||
case IEEE80211_FTYPE_MGMT: /* mgnt */
|
||||
DBG_COUNTER(adapter->rx_logs.core_rx_pre_mgmt);
|
||||
retval = validate_recv_mgnt_frame(adapter, precv_frame);
|
||||
if (retval == _FAIL) {
|
||||
@@ -2305,7 +2305,7 @@ sint validate_recv_frame(_adapter *adapter, union recv_frame *precv_frame)
|
||||
}
|
||||
retval = _FAIL; /* only data frame return _SUCCESS */
|
||||
break;
|
||||
case WIFI_CTRL_TYPE: /* ctrl */
|
||||
case IEEE80211_FTYPE_CTL: /* ctrl */
|
||||
DBG_COUNTER(adapter->rx_logs.core_rx_pre_ctrl);
|
||||
retval = validate_recv_ctrl_frame(adapter, precv_frame);
|
||||
if (retval == _FAIL) {
|
||||
@@ -2313,7 +2313,7 @@ sint validate_recv_frame(_adapter *adapter, union recv_frame *precv_frame)
|
||||
}
|
||||
retval = _FAIL; /* only data frame return _SUCCESS */
|
||||
break;
|
||||
case WIFI_DATA_TYPE: /* data */
|
||||
case IEEE80211_FTYPE_DATA: /* data */
|
||||
DBG_COUNTER(adapter->rx_logs.core_rx_pre_data);
|
||||
#ifdef CONFIG_WAPI_SUPPORT
|
||||
if (pattrib->qos)
|
||||
@@ -2765,7 +2765,7 @@ union recv_frame *recvframe_chk_defrag(PADAPTER padapter, union recv_frame *prec
|
||||
psta = rtw_get_stainfo(pstapriv, psta_addr);
|
||||
if (psta == NULL) {
|
||||
u8 type = GetFrameType(pfhdr->rx_data);
|
||||
if (type != WIFI_DATA_TYPE) {
|
||||
if (type != IEEE80211_FTYPE_DATA) {
|
||||
psta = rtw_get_bcmc_stainfo(padapter);
|
||||
if (psta)
|
||||
pdefrag_q = &psta->sta_recvpriv.defrag_q;
|
||||
@@ -3820,7 +3820,7 @@ int mp_recv_frame(_adapter *padapter, union recv_frame *rframe)
|
||||
pattrib->privacy = GetPrivacy(ptr);
|
||||
pattrib->order = GetOrder(ptr);
|
||||
|
||||
if (type == WIFI_DATA_TYPE) {
|
||||
if (type == IEEE80211_FTYPE_DATA) {
|
||||
pda = get_da(ptr);
|
||||
psa = get_sa(ptr);
|
||||
pbssid = get_hdr_bssid(ptr);
|
||||
@@ -4431,7 +4431,7 @@ int recv_func(_adapter *padapter, union recv_frame *rframe)
|
||||
{}
|
||||
#ifdef CONFIG_CUSTOMER_ALIBABA_GENERAL
|
||||
type = GetFrameType(ptr);
|
||||
if ((type == WIFI_DATA_TYPE)&& check_fwstate(mlmepriv, WIFI_STATION_STATE)) {
|
||||
if ((type == IEEE80211_FTYPE_DATA)&& check_fwstate(mlmepriv, WIFI_STATION_STATE)) {
|
||||
struct wlan_network *cur_network = &(mlmepriv->cur_network);
|
||||
if ( _rtw_memcmp(get_addr2_ptr(ptr), cur_network->network.MacAddress, ETH_ALEN)==0) {
|
||||
recv_frame_monitor(padapter, rframe);
|
||||
@@ -4817,7 +4817,7 @@ void rx_query_phy_status(
|
||||
&& _rtw_memcmp(ra, adapter_mac_addr(padapter), ETH_ALEN);
|
||||
|
||||
pkt_info.is_packet_beacon = pkt_info.is_packet_match_bssid
|
||||
&& (get_frame_sub_type(wlanhdr) == WIFI_BEACON);
|
||||
&& (get_frame_sub_type(wlanhdr) == IEEE80211_STYPE_BEACON);
|
||||
|
||||
if (psta && IsFrameTypeData(wlanhdr)) {
|
||||
if (is_ra_bmc)
|
||||
@@ -4939,7 +4939,7 @@ bypass_concurrent_hdl:
|
||||
#endif /* CONFIG_CONCURRENT_MODE */
|
||||
if (primary_padapter->registrypriv.mp_mode != 1) {
|
||||
/* skip unnecessary bmc data frame for primary adapter */
|
||||
if (ra_is_bmc == _TRUE && GetFrameType(pbuf) == WIFI_DATA_TYPE
|
||||
if (ra_is_bmc == _TRUE && GetFrameType(pbuf) == IEEE80211_FTYPE_DATA
|
||||
&& !adapter_allow_bmc_data_rx(precvframe->u.hdr.adapter)
|
||||
) {
|
||||
rtw_free_recvframe(precvframe, &precvframe->u.hdr.adapter->recvpriv.free_recv_queue);
|
||||
|
||||
Reference in New Issue
Block a user