diff options
author | Christophe JAILLET <christophe.jaillet@wanadoo.fr> | 2021-05-02 13:30:06 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2021-05-10 11:19:34 +0200 |
commit | 33ed2b7079f6c38abce6abbaf1e6be4edad919d8 (patch) | |
tree | 9f0050949bb89459be0ce3330fa990ddfd903876 /drivers/staging/rtl8188eu/hal/rtl8188e_cmd.c | |
parent | staging: rtl8712: Fix some tests against some 'data' subtype frames (diff) | |
download | linux-dev-33ed2b7079f6c38abce6abbaf1e6be4edad919d8.tar.xz linux-dev-33ed2b7079f6c38abce6abbaf1e6be4edad919d8.zip |
staging: rtl8188eu: 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>.
Special care must be taken for control and data frame, because the coding
of the frame type is not included in the IEEE80211_STYPE_xxx values and
must be added explicitly.
There is no problem for management frame because the type si coded as (0)
(in rtl8188eu) and (0x0000) (in <linux/ieee80211.h>).
Values used for control frame (WIFI_PSPOLL) must be OR'eded with
IEEE80211_FTYPE_CTL.
Values used for data frame (WIFI_DATA_NULL and WIFI_QOS_DATA_NULL) must be
OR'ed with IEEE80211_FTYPE_DATA.
Use theses values to avoid code duplication.
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Link: https://lore.kernel.org/r/7c1007d5706a42e0ba1fe805089fab523f9db7ea.1619953884.git.christophe.jaillet@wanadoo.fr
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/rtl8188eu/hal/rtl8188e_cmd.c')
-rw-r--r-- | drivers/staging/rtl8188eu/hal/rtl8188e_cmd.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/drivers/staging/rtl8188eu/hal/rtl8188e_cmd.c b/drivers/staging/rtl8188eu/hal/rtl8188e_cmd.c index 3a0e3d41a404..34d2c62765f0 100644 --- a/drivers/staging/rtl8188eu/hal/rtl8188e_cmd.c +++ b/drivers/staging/rtl8188eu/hal/rtl8188e_cmd.c @@ -218,7 +218,7 @@ static void ConstructBeacon(struct adapter *adapt, u8 *pframe, u32 *pLength) ether_addr_copy(pwlanhdr->addr3, cur_network->MacAddress); SetSeqNum(pwlanhdr, 0/*pmlmeext->mgnt_seq*/); - SetFrameSubType(pframe, WIFI_BEACON); + SetFrameSubType(pframe, IEEE80211_STYPE_BEACON); pframe += sizeof(struct ieee80211_hdr_3addr); pktlen = sizeof(struct ieee80211_hdr_3addr); @@ -297,7 +297,7 @@ static void ConstructPSPoll(struct adapter *adapt, u8 *pframe, u32 *pLength) fctrl = &pwlanhdr->frame_control; *(fctrl) = 0; SetPwrMgt(fctrl); - SetFrameSubType(pframe, WIFI_PSPOLL); + SetFrameSubType(pframe, IEEE80211_FTYPE_CTL | IEEE80211_STYPE_PSPOLL); /* AID. */ SetDuration(pframe, (pmlmeinfo->aid | 0xc000)); @@ -361,7 +361,7 @@ static void ConstructNullFunctionData(struct adapter *adapt, u8 *pframe, if (bQoS) { struct ieee80211_qos_hdr *pwlanqoshdr; - SetFrameSubType(pframe, WIFI_QOS_DATA_NULL); + SetFrameSubType(pframe, IEEE80211_FTYPE_DATA | IEEE80211_STYPE_QOS_NULLFUNC); pwlanqoshdr = (struct ieee80211_qos_hdr *)pframe; SetPriority(&pwlanqoshdr->qos_ctrl, AC); @@ -369,7 +369,7 @@ static void ConstructNullFunctionData(struct adapter *adapt, u8 *pframe, pktlen = sizeof(struct ieee80211_qos_hdr); } else { - SetFrameSubType(pframe, WIFI_DATA_NULL); + SetFrameSubType(pframe, IEEE80211_FTYPE_DATA | IEEE80211_STYPE_NULLFUNC); pktlen = sizeof(struct ieee80211_hdr_3addr); } @@ -399,7 +399,7 @@ static void ConstructProbeRsp(struct adapter *adapt, u8 *pframe, u32 *pLength, u ether_addr_copy(pwlanhdr->addr3, bssid); SetSeqNum(pwlanhdr, 0); - SetFrameSubType(fctrl, WIFI_PROBERSP); + SetFrameSubType(fctrl, IEEE80211_STYPE_PROBE_RESP); pktlen = sizeof(struct ieee80211_hdr_3addr); pframe += pktlen; |