Commit 8b4fa9c3 authored by Christophe JAILLET's avatar Christophe JAILLET Committed by Greg Kroah-Hartman
Browse files

staging: rtl8712: remove (most of) enum WIFI_FRAME_TYPE



The values defined in enum WIFI_FRAME_TYPE are the same the #define
IEEE80211_FTYPE_xxx from <linux/ieee80211.h>

Use these values to avoid code duplication.

WIFI_QOS_DATA_TYPE is a bit more tricky and doesn't have a direct
equivalence in <linux/ieee80211.h>. So leave this one as-is for now.

Signed-off-by: default avatarChristophe JAILLET <christophe.jaillet@wanadoo.fr>
Link: https://lore.kernel.org/r/e009a4ee6429a3f79742f9a912e3f6a650fb33ed.1617911201.git.christophe.jaillet@wanadoo.fr


Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 6e2baa44
Loading
Loading
Loading
Loading
+4 −3
Original line number Diff line number Diff line
@@ -21,6 +21,7 @@
#include <linux/if_ether.h>
#include <linux/kmemleak.h>
#include <linux/etherdevice.h>
#include <linux/ieee80211.h>
#include <net/cfg80211.h>

#include "osdep_service.h"
@@ -565,13 +566,13 @@ sint r8712_validate_recv_frame(struct _adapter *adapter,
	pattrib->privacy =  GetPrivacy(ptr);
	pattrib->order = GetOrder(ptr);
	switch (type) {
	case WIFI_MGT_TYPE: /*mgnt*/
	case IEEE80211_FTYPE_MGMT:
		retval = validate_recv_mgnt_frame(adapter, precv_frame);
		break;
	case WIFI_CTRL_TYPE:/*ctrl*/
	case IEEE80211_FTYPE_CTL:
		retval = validate_recv_ctrl_frame(adapter, precv_frame);
		break;
	case WIFI_DATA_TYPE: /*data*/
	case IEEE80211_FTYPE_DATA:
		pattrib->qos = (subtype & BIT(7)) ? 1 : 0;
		retval = validate_recv_data_frame(adapter, precv_frame);
		break;
+2 −3
Original line number Diff line number Diff line
@@ -18,7 +18,6 @@

#include "osdep_service.h"
#include "drv_types.h"
#include "wifi.h"
#include "osdep_intf.h"
#include "usb_ops.h"

@@ -294,7 +293,7 @@ int r8712_update_attrib(struct _adapter *padapter, _pkt *pkt,
		r8712_set_qos(&pktfile, pattrib);
	} else {
		pattrib->hdrlen = WLAN_HDR_A3_LEN;
		pattrib->subtype = WIFI_DATA_TYPE;
		pattrib->subtype = IEEE80211_FTYPE_DATA;
		pattrib->priority = 0;
	}
	if (psta->ieee8021x_blocked) {
@@ -480,7 +479,7 @@ static int make_wlanhdr(struct _adapter *padapter, u8 *hdr,

	memset(hdr, 0, WLANHDR_OFFSET);
	SetFrameSubType(fctrl, pattrib->subtype);
	if (!(pattrib->subtype & WIFI_DATA_TYPE))
	if (!(pattrib->subtype & IEEE80211_FTYPE_DATA))
		return 0;

	bssid = get_bssid(pmlmepriv);
+0 −3
Original line number Diff line number Diff line
@@ -23,9 +23,6 @@
#define P80211CAPTURE_VERSION	0x80211001

enum WIFI_FRAME_TYPE {
	WIFI_MGT_TYPE  =	(0),
	WIFI_CTRL_TYPE =	(BIT(2)),
	WIFI_DATA_TYPE =	(BIT(3)),
	WIFI_QOS_DATA_TYPE	= (BIT(7) | BIT(3)),	/*!< QoS Data */
};