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:
Carlos Garces
2021-10-18 16:05:53 +02:00
parent 3555bdb258
commit c5f30cb5cc
21 changed files with 193 additions and 236 deletions

View File

@@ -1180,7 +1180,7 @@ static void construct_mic_iv(
mic_iv[1] = 0x00;
#if defined(CONFIG_IEEE80211W) || defined(CONFIG_RTW_MESH)
/* 802.11w management frame should set management bit(4) */
if (frtype == WIFI_MGT_TYPE)
if (frtype == IEEE80211_FTYPE_MGMT)
mic_iv[1] |= BIT(4);
#endif
for (i = 2; i < 8; i++)
@@ -1214,7 +1214,7 @@ static void construct_mic_header1(
mic_header1[1] = (u8)((header_length - 2) % 256);
#if defined(CONFIG_IEEE80211W) || defined(CONFIG_RTW_MESH)
/* 802.11w management frame don't AND subtype bits 4,5,6 of frame control field */
if (frtype == WIFI_MGT_TYPE)
if (frtype == IEEE80211_FTYPE_MGMT)
mic_header1[2] = mpdu[0];
else
#endif
@@ -1315,7 +1315,7 @@ static void construct_ctr_preload(
ctr_preload[1] = mpdu[24] & 0x0f;
#if defined(CONFIG_IEEE80211W) || defined(CONFIG_RTW_MESH)
/* 802.11w management frame should set management bit(4) */
if (frtype == WIFI_MGT_TYPE)
if (frtype == IEEE80211_FTYPE_MGMT)
ctr_preload[1] |= BIT(4);
#endif
for (i = 2; i < 8; i++)
@@ -1383,15 +1383,15 @@ static sint aes_cipher(u8 *key, uint hdrlen,
a4_exists = 1;
if (
((frtype | frsubtype) == WIFI_DATA_CFACK) ||
((frtype | frsubtype) == WIFI_DATA_CFPOLL) ||
((frtype | frsubtype) == WIFI_DATA_CFACKPOLL)) {
((frtype | frsubtype) == (IEEE80211_FTYPE_DATA | IEEE80211_STYPE_DATA_CFACK)) ||
((frtype | frsubtype) == (IEEE80211_FTYPE_DATA | IEEE80211_STYPE_DATA_CFPOLL)) ||
((frtype | frsubtype) == (IEEE80211_FTYPE_DATA | IEEE80211_STYPE_DATA_CFACKPOLL))) {
qc_exists = 1;
if (hdrlen != WLAN_HDR_A3_QOS_LEN && hdrlen != WLAN_HDR_A4_QOS_LEN)
hdrlen += 2;
}
/* add for CONFIG_IEEE80211W, none 11w also can use */
else if ((frtype == WIFI_DATA) &&
else if ((frtype == (IEEE80211_FTYPE_DATA | IEEE80211_STYPE_DATA)) &&
((frsubtype == 0x08) ||
(frsubtype == 0x09) ||
(frsubtype == 0x0a) ||
@@ -1702,14 +1702,14 @@ static sint aes_decipher(u8 *key, uint hdrlen,
a4_exists = 1;
if (
((frtype | frsubtype) == WIFI_DATA_CFACK) ||
((frtype | frsubtype) == WIFI_DATA_CFPOLL) ||
((frtype | frsubtype) == WIFI_DATA_CFACKPOLL)) {
((frtype | frsubtype) == (IEEE80211_FTYPE_DATA | IEEE80211_STYPE_DATA_CFACK)) ||
((frtype | frsubtype) == (IEEE80211_FTYPE_DATA | IEEE80211_STYPE_DATA_CFPOLL)) ||
((frtype | frsubtype) == (IEEE80211_FTYPE_DATA | IEEE80211_STYPE_DATA_CFACKPOLL))) {
qc_exists = 1;
if (hdrlen != WLAN_HDR_A3_QOS_LEN && hdrlen != WLAN_HDR_A4_QOS_LEN)
hdrlen += 2;
} /* only for data packet . add for CONFIG_IEEE80211W, none 11w also can use */
else if ((frtype == WIFI_DATA) &&
else if ((frtype == (IEEE80211_FTYPE_DATA | IEEE80211_STYPE_DATA)) &&
((frsubtype == 0x08) ||
(frsubtype == 0x09) ||
(frsubtype == 0x0a) ||