Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f31cca8e authored by Larry Finger's avatar Larry Finger Committed by Greg Kroah-Hartman
Browse files

staging: r8188eu: Remove union wrapping of recv_frame



We have now removed everthing from the union except the struct. The union
can be deleted, the struct renamed, and the referencing of members of the
struct becomes a lot simpler.

Some, but not all, of the problems noted by checkpatch.pl have been fixed.

Sugggested-by: default avatarJes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: default avatarLarry Finger <Larry.Finger@lwfinger.net>
Cc: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 34fdae8d
Loading
Loading
Loading
Loading
+72 −71
Original line number Diff line number Diff line
@@ -414,10 +414,10 @@ void free_mlme_ext_priv(struct mlme_ext_priv *pmlmeext)
	}
}

static void _mgt_dispatcher(struct adapter *padapter, struct mlme_handler *ptable, union recv_frame *precv_frame)
static void _mgt_dispatcher(struct adapter *padapter, struct mlme_handler *ptable, struct recv_frame *precv_frame)
{
	u8 bc_addr[ETH_ALEN] = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff};
	u8 *pframe = precv_frame->u.hdr.rx_data;
	u8 *pframe = precv_frame->rx_data;

	  if (ptable->func) {
	 /* receive the frames that ra(a1) is my address or ra(a1) is bc address. */
@@ -428,7 +428,7 @@ static void _mgt_dispatcher(struct adapter *padapter, struct mlme_handler *ptabl
	}
}

void mgt_dispatcher(struct adapter *padapter, union recv_frame *precv_frame)
void mgt_dispatcher(struct adapter *padapter, struct recv_frame *precv_frame)
{
	int index;
	struct mlme_handler *ptable;
@@ -436,7 +436,7 @@ void mgt_dispatcher(struct adapter *padapter, union recv_frame *precv_frame)
	struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
#endif /* CONFIG_88EU_AP_MODE */
	u8 bc_addr[ETH_ALEN] = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff};
	u8 *pframe = precv_frame->u.hdr.rx_data;
	u8 *pframe = precv_frame->rx_data;
	struct sta_info *psta = rtw_get_stainfo(&padapter->stapriv, GetAddr2Ptr(pframe));

	RT_TRACE(_module_rtl871x_mlme_c_, _drv_info_,
@@ -465,13 +465,15 @@ void mgt_dispatcher(struct adapter *padapter, union recv_frame *precv_frame)

	if (psta != NULL) {
		if (GetRetry(pframe)) {
			if (precv_frame->u.hdr.attrib.seq_num == psta->RxMgmtFrameSeqNum) {
			if (precv_frame->attrib.seq_num ==
			    psta->RxMgmtFrameSeqNum) {
				/* drop the duplicate management frame */
				DBG_88E("Drop duplicate management frame with seq_num=%d.\n", precv_frame->u.hdr.attrib.seq_num);
				DBG_88E("Drop duplicate management frame with seq_num=%d.\n",
					precv_frame->attrib.seq_num);
				return;
			}
		}
		psta->RxMgmtFrameSeqNum = precv_frame->u.hdr.attrib.seq_num;
		psta->RxMgmtFrameSeqNum = precv_frame->attrib.seq_num;
	}

#ifdef CONFIG_88EU_AP_MODE
@@ -532,7 +534,7 @@ Following are the callback functions for each subtype of the management frames

*****************************************************************************/

unsigned int OnProbeReq(struct adapter *padapter, union recv_frame *precv_frame)
unsigned int OnProbeReq(struct adapter *padapter, struct recv_frame *precv_frame)
{
	unsigned int	ielen;
	unsigned char	*p;
@@ -540,8 +542,8 @@ unsigned int OnProbeReq(struct adapter *padapter, union recv_frame *precv_frame)
	struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv;
	struct mlme_ext_info	*pmlmeinfo = &(pmlmeext->mlmext_info);
	struct wlan_bssid_ex *cur = &(pmlmeinfo->network);
	u8 *pframe = precv_frame->u.hdr.rx_data;
	uint len = precv_frame->u.hdr.len;
	u8 *pframe = precv_frame->rx_data;
	uint len = precv_frame->len;
	u8 is_valid_p2p_probereq = false;

#ifdef CONFIG_88EU_P2P
@@ -609,12 +611,12 @@ _issue_probersp:
	return _SUCCESS;
}

unsigned int OnProbeRsp(struct adapter *padapter, union recv_frame *precv_frame)
unsigned int OnProbeRsp(struct adapter *padapter, struct recv_frame *precv_frame)
{
	struct mlme_ext_priv	*pmlmeext = &padapter->mlmeextpriv;
#ifdef CONFIG_88EU_P2P
	struct wifidirect_info	*pwdinfo = &padapter->wdinfo;
	u8 *pframe = precv_frame->u.hdr.rx_data;
	u8 *pframe = precv_frame->rx_data;
#endif

#ifdef CONFIG_88EU_P2P
@@ -663,7 +665,7 @@ unsigned int OnProbeRsp(struct adapter *padapter, union recv_frame *precv_frame)
	return _SUCCESS;
}

unsigned int OnBeacon(struct adapter *padapter, union recv_frame *precv_frame)
unsigned int OnBeacon(struct adapter *padapter, struct recv_frame *precv_frame)
{
	int cam_idx;
	struct sta_info	*psta;
@@ -671,8 +673,8 @@ unsigned int OnBeacon(struct adapter *padapter, union recv_frame *precv_frame)
	struct mlme_ext_info	*pmlmeinfo = &(pmlmeext->mlmext_info);
	struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
	struct sta_priv	*pstapriv = &padapter->stapriv;
	u8 *pframe = precv_frame->u.hdr.rx_data;
	uint len = precv_frame->u.hdr.len;
	u8 *pframe = precv_frame->rx_data;
	uint len = precv_frame->len;
	struct wlan_bssid_ex *pbss;
	int ret = _SUCCESS;

@@ -753,7 +755,7 @@ _END_ONBEACON_:
	return _SUCCESS;
}

unsigned int OnAuth(struct adapter *padapter, union recv_frame *precv_frame)
unsigned int OnAuth(struct adapter *padapter, struct recv_frame *precv_frame)
{
#ifdef CONFIG_88EU_AP_MODE
	unsigned int	auth_mode, ie_len;
@@ -767,8 +769,8 @@ unsigned int OnAuth(struct adapter *padapter, union recv_frame *precv_frame)
	struct security_priv *psecuritypriv = &padapter->securitypriv;
	struct mlme_ext_priv	*pmlmeext = &padapter->mlmeextpriv;
	struct mlme_ext_info	*pmlmeinfo = &(pmlmeext->mlmext_info);
	u8 *pframe = precv_frame->u.hdr.rx_data;
	uint len = precv_frame->u.hdr.len;
	u8 *pframe = precv_frame->rx_data;
	uint len = precv_frame->len;

	if ((pmlmeinfo->state&0x03) != WIFI_FW_AP_STATE)
		return _FAIL;
@@ -926,15 +928,15 @@ auth_fail:
	return _FAIL;
}

unsigned int OnAuthClient(struct adapter *padapter, union recv_frame *precv_frame)
unsigned int OnAuthClient(struct adapter *padapter, struct recv_frame *precv_frame)
{
	unsigned int	seq, len, status, offset;
	unsigned char	*p;
	unsigned int	go2asoc = 0;
	struct mlme_ext_priv	*pmlmeext = &padapter->mlmeextpriv;
	struct mlme_ext_info	*pmlmeinfo = &(pmlmeext->mlmext_info);
	u8 *pframe = precv_frame->u.hdr.rx_data;
	uint pkt_len = precv_frame->u.hdr.len;
	u8 *pframe = precv_frame->rx_data;
	uint pkt_len = precv_frame->len;

	DBG_88E("%s\n", __func__);

@@ -1001,7 +1003,7 @@ authclnt_fail:
	return _FAIL;
}

unsigned int OnAssocReq(struct adapter *padapter, union recv_frame *precv_frame)
unsigned int OnAssocReq(struct adapter *padapter, struct recv_frame *precv_frame)
{
#ifdef CONFIG_88EU_AP_MODE
	u16 capab_info;
@@ -1020,8 +1022,8 @@ unsigned int OnAssocReq(struct adapter *padapter, union recv_frame *precv_frame)
	struct mlme_ext_info	*pmlmeinfo = &(pmlmeext->mlmext_info);
	struct wlan_bssid_ex *cur = &(pmlmeinfo->network);
	struct sta_priv *pstapriv = &padapter->stapriv;
	u8 *pframe = precv_frame->u.hdr.rx_data;
	uint pkt_len = precv_frame->u.hdr.len;
	u8 *pframe = precv_frame->rx_data;
	uint pkt_len = precv_frame->len;
#ifdef CONFIG_88EU_P2P
	struct wifidirect_info	*pwdinfo = &(padapter->wdinfo);
	u8 p2p_status_code = P2P_STATUS_SUCCESS;
@@ -1470,7 +1472,7 @@ OnAssocReqFail:
	return _FAIL;
}

unsigned int OnAssocRsp(struct adapter *padapter, union recv_frame *precv_frame)
unsigned int OnAssocRsp(struct adapter *padapter, struct recv_frame *precv_frame)
{
	uint i;
	int res;
@@ -1480,8 +1482,8 @@ unsigned int OnAssocRsp(struct adapter *padapter, union recv_frame *precv_frame)
	struct mlme_ext_priv	*pmlmeext = &padapter->mlmeextpriv;
	struct mlme_ext_info	*pmlmeinfo = &(pmlmeext->mlmext_info);
	/* struct wlan_bssid_ex *cur_network = &(pmlmeinfo->network); */
	u8 *pframe = precv_frame->u.hdr.rx_data;
	uint pkt_len = precv_frame->u.hdr.len;
	u8 *pframe = precv_frame->rx_data;
	uint pkt_len = precv_frame->len;

	DBG_88E("%s\n", __func__);

@@ -1560,13 +1562,13 @@ report_assoc_result:
	return _SUCCESS;
}

unsigned int OnDeAuth(struct adapter *padapter, union recv_frame *precv_frame)
unsigned int OnDeAuth(struct adapter *padapter, struct recv_frame *precv_frame)
{
	unsigned short	reason;
	struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
	struct mlme_ext_priv	*pmlmeext = &padapter->mlmeextpriv;
	struct mlme_ext_info	*pmlmeinfo = &(pmlmeext->mlmext_info);
	u8 *pframe = precv_frame->u.hdr.rx_data;
	u8 *pframe = precv_frame->rx_data;
#ifdef CONFIG_88EU_P2P
	struct wifidirect_info *pwdinfo = &(padapter->wdinfo);
#endif /* CONFIG_88EU_P2P */
@@ -1624,13 +1626,13 @@ unsigned int OnDeAuth(struct adapter *padapter, union recv_frame *precv_frame)
	return _SUCCESS;
}

unsigned int OnDisassoc(struct adapter *padapter, union recv_frame *precv_frame)
unsigned int OnDisassoc(struct adapter *padapter, struct recv_frame *precv_frame)
{
	u16 reason;
	struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
	struct mlme_ext_priv	*pmlmeext = &padapter->mlmeextpriv;
	struct mlme_ext_info	*pmlmeinfo = &(pmlmeext->mlmext_info);
	u8 *pframe = precv_frame->u.hdr.rx_data;
	u8 *pframe = precv_frame->rx_data;
#ifdef CONFIG_88EU_P2P
	struct wifidirect_info *pwdinfo = &(padapter->wdinfo);
#endif /* CONFIG_88EU_P2P */
@@ -1687,18 +1689,18 @@ unsigned int OnDisassoc(struct adapter *padapter, union recv_frame *precv_frame)
	return _SUCCESS;
}

unsigned int OnAtim(struct adapter *padapter, union recv_frame *precv_frame)
unsigned int OnAtim(struct adapter *padapter, struct recv_frame *precv_frame)
{
	DBG_88E("%s\n", __func__);
	return _SUCCESS;
}

unsigned int on_action_spct(struct adapter *padapter, union recv_frame *precv_frame)
unsigned int on_action_spct(struct adapter *padapter, struct recv_frame *precv_frame)
{
	unsigned int ret = _FAIL;
	struct sta_info *psta = NULL;
	struct sta_priv *pstapriv = &padapter->stapriv;
	u8 *pframe = precv_frame->u.hdr.rx_data;
	u8 *pframe = precv_frame->rx_data;
	u8 *frame_body = (u8 *)(pframe + sizeof(struct rtw_ieee80211_hdr_3addr));
	u8 category;
	u8 action;
@@ -1731,17 +1733,17 @@ exit:
	return ret;
}

unsigned int OnAction_qos(struct adapter *padapter, union recv_frame *precv_frame)
unsigned int OnAction_qos(struct adapter *padapter, struct recv_frame *precv_frame)
{
	return _SUCCESS;
}

unsigned int OnAction_dls(struct adapter *padapter, union recv_frame *precv_frame)
unsigned int OnAction_dls(struct adapter *padapter, struct recv_frame *precv_frame)
{
	return _SUCCESS;
}

unsigned int OnAction_back(struct adapter *padapter, union recv_frame *precv_frame)
unsigned int OnAction_back(struct adapter *padapter, struct recv_frame *precv_frame)
{
	u8 *addr;
	struct sta_info *psta = NULL;
@@ -1751,7 +1753,7 @@ unsigned int OnAction_back(struct adapter *padapter, union recv_frame *precv_fra
	unsigned short	tid, status, reason_code = 0;
	struct mlme_ext_priv	*pmlmeext = &padapter->mlmeextpriv;
	struct mlme_ext_info	*pmlmeinfo = &(pmlmeext->mlmext_info);
	u8 *pframe = precv_frame->u.hdr.rx_data;
	u8 *pframe = precv_frame->rx_data;
	struct sta_priv *pstapriv = &padapter->stapriv;
	/* check RA matches or not */
	if (memcmp(myid(&(padapter->eeprompriv)), GetAddr1Ptr(pframe),
@@ -3857,13 +3859,13 @@ exit:

#endif /* CONFIG_88EU_P2P */

static s32 rtw_action_public_decache(union recv_frame *recv_frame, s32 token)
static s32 rtw_action_public_decache(struct recv_frame *recv_frame, s32 token)
{
	struct adapter *adapter = recv_frame->u.hdr.adapter;
	struct adapter *adapter = recv_frame->adapter;
	struct mlme_ext_priv *mlmeext = &(adapter->mlmeextpriv);
	u8 *frame = recv_frame->u.hdr.rx_data;
	u16 seq_ctrl = ((recv_frame->u.hdr.attrib.seq_num&0xffff) << 4) |
		(recv_frame->u.hdr.attrib.frag_num & 0xf);
	u8 *frame = recv_frame->rx_data;
	u16 seq_ctrl = ((recv_frame->attrib.seq_num&0xffff) << 4) |
		(recv_frame->attrib.frag_num & 0xf);

	if (GetRetry(frame)) {
		if (token >= 0) {
@@ -3889,14 +3891,14 @@ static s32 rtw_action_public_decache(union recv_frame *recv_frame, s32 token)
	return _SUCCESS;
}

static unsigned int on_action_public_p2p(union recv_frame *precv_frame)
static unsigned int on_action_public_p2p(struct recv_frame *precv_frame)
{
	u8 *pframe = precv_frame->u.hdr.rx_data;
	u8 *pframe = precv_frame->rx_data;
	u8 *frame_body;
	u8 dialogToken = 0;
#ifdef CONFIG_88EU_P2P
	struct adapter *padapter = precv_frame->u.hdr.adapter;
	uint len = precv_frame->u.hdr.len;
	struct adapter *padapter = precv_frame->adapter;
	uint len = precv_frame->len;
	u8 *p2p_ie;
	u32	p2p_ielen;
	struct	wifidirect_info	*pwdinfo = &(padapter->wdinfo);
@@ -4180,10 +4182,10 @@ static unsigned int on_action_public_p2p(union recv_frame *precv_frame)
	return _SUCCESS;
}

static unsigned int on_action_public_vendor(union recv_frame *precv_frame)
static unsigned int on_action_public_vendor(struct recv_frame *precv_frame)
{
	unsigned int ret = _FAIL;
	u8 *pframe = precv_frame->u.hdr.rx_data;
	u8 *pframe = precv_frame->rx_data;
	u8 *frame_body = pframe + sizeof(struct rtw_ieee80211_hdr_3addr);

	if (!memcmp(frame_body + 2, P2P_OUI, 4))
@@ -4192,10 +4194,10 @@ static unsigned int on_action_public_vendor(union recv_frame *precv_frame)
	return ret;
}

static unsigned int on_action_public_default(union recv_frame *precv_frame, u8 action)
static unsigned int on_action_public_default(struct recv_frame *precv_frame, u8 action)
{
	unsigned int ret = _FAIL;
	u8 *pframe = precv_frame->u.hdr.rx_data;
	u8 *pframe = precv_frame->rx_data;
	u8 *frame_body = pframe + sizeof(struct rtw_ieee80211_hdr_3addr);
	u8 token;

@@ -4210,10 +4212,10 @@ exit:
	return ret;
}

unsigned int on_action_public(struct adapter *padapter, union recv_frame *precv_frame)
unsigned int on_action_public(struct adapter *padapter, struct recv_frame *precv_frame)
{
	unsigned int ret = _FAIL;
	u8 *pframe = precv_frame->u.hdr.rx_data;
	u8 *pframe = precv_frame->rx_data;
	u8 *frame_body = pframe + sizeof(struct rtw_ieee80211_hdr_3addr);
	u8 category, action;

@@ -4239,23 +4241,23 @@ exit:
	return ret;
}

unsigned int OnAction_ht(struct adapter *padapter, union recv_frame *precv_frame)
unsigned int OnAction_ht(struct adapter *padapter, struct recv_frame *precv_frame)
{
	return _SUCCESS;
}

unsigned int OnAction_wmm(struct adapter *padapter, union recv_frame *precv_frame)
unsigned int OnAction_wmm(struct adapter *padapter, struct recv_frame *precv_frame)
{
	return _SUCCESS;
}

unsigned int OnAction_p2p(struct adapter *padapter, union recv_frame *precv_frame)
unsigned int OnAction_p2p(struct adapter *padapter, struct recv_frame *precv_frame)
{
#ifdef CONFIG_88EU_P2P
	u8 *frame_body;
	u8 category, OUI_Subtype;
	u8 *pframe = precv_frame->u.hdr.rx_data;
	uint len = precv_frame->u.hdr.len;
	u8 *pframe = precv_frame->rx_data;
	uint len = precv_frame->len;
	struct	wifidirect_info	*pwdinfo = &(padapter->wdinfo);


@@ -4294,13 +4296,13 @@ unsigned int OnAction_p2p(struct adapter *padapter, union recv_frame *precv_fram
	return _SUCCESS;
}

unsigned int OnAction(struct adapter *padapter, union recv_frame *precv_frame)
unsigned int OnAction(struct adapter *padapter, struct recv_frame *precv_frame)
{
	int i;
	unsigned char	category;
	struct action_handler *ptable;
	unsigned char	*frame_body;
	u8 *pframe = precv_frame->u.hdr.rx_data;
	u8 *pframe = precv_frame->rx_data;

	frame_body = (unsigned char *)(pframe + sizeof(struct rtw_ieee80211_hdr_3addr));

@@ -4314,7 +4316,7 @@ unsigned int OnAction(struct adapter *padapter, union recv_frame *precv_frame)
	return _SUCCESS;
}

unsigned int DoReserved(struct adapter *padapter, union recv_frame *precv_frame)
unsigned int DoReserved(struct adapter *padapter, struct recv_frame *precv_frame)
{
	return _SUCCESS;
}
@@ -6530,14 +6532,14 @@ void site_survey(struct adapter *padapter)
}

/* collect bss info from Beacon and Probe request/response frames. */
u8 collect_bss_info(struct adapter *padapter, union recv_frame *precv_frame, struct wlan_bssid_ex *bssid)
u8 collect_bss_info(struct adapter *padapter, struct recv_frame *precv_frame, struct wlan_bssid_ex *bssid)
{
	int	i;
	u32	len;
	u8 *p;
	u16 val16, subtype;
	u8 *pframe = precv_frame->u.hdr.rx_data;
	u32	packet_len = precv_frame->u.hdr.len;
	u8 *pframe = precv_frame->rx_data;
	u32	packet_len = precv_frame->len;
	u8 ie_offset;
	struct registry_priv	*pregistrypriv = &padapter->registrypriv;
	struct mlme_ext_priv	*pmlmeext = &padapter->mlmeextpriv;
@@ -6576,10 +6578,10 @@ u8 collect_bss_info(struct adapter *padapter, union recv_frame *precv_frame, str
	bssid->IELength = len;
	memcpy(bssid->IEs, (pframe + sizeof(struct rtw_ieee80211_hdr_3addr)), bssid->IELength);

	/* get the signal strength */
	bssid->Rssi = precv_frame->u.hdr.attrib.phy_info.recvpower; /*  in dBM.raw data */
	bssid->PhyInfo.SignalQuality = precv_frame->u.hdr.attrib.phy_info.SignalQuality;/* in percentage */
	bssid->PhyInfo.SignalStrength = precv_frame->u.hdr.attrib.phy_info.SignalStrength;/* in percentage */
	/* get the signal strength in dBM.raw data */
	bssid->Rssi = precv_frame->attrib.phy_info.recvpower;
	bssid->PhyInfo.SignalQuality = precv_frame->attrib.phy_info.SignalQuality;/* in percentage */
	bssid->PhyInfo.SignalStrength = precv_frame->attrib.phy_info.SignalStrength;/* in percentage */
	rtw_hal_get_def_var(padapter, HAL_DEF_CURRENT_ANTENNA,  &bssid->PhyInfo.Optimum_antenna);

	/*  checking SSID */
@@ -7032,7 +7034,8 @@ Following are the functions to report events

*****************************************************************************/

void report_survey_event(struct adapter *padapter, union recv_frame *precv_frame)
void report_survey_event(struct adapter *padapter,
			 struct recv_frame *precv_frame)
{
	struct cmd_obj *pcmd_obj;
	u8 *pevtcmd;
@@ -7041,8 +7044,6 @@ void report_survey_event(struct adapter *padapter, union recv_frame *precv_frame
	struct C2HEvent_Header *pc2h_evt_hdr;
	struct mlme_ext_priv *pmlmeext;
	struct cmd_priv *pcmdpriv;
	/* u8 *pframe = precv_frame->u.hdr.rx_data; */
	/* uint len = precv_frame->u.hdr.len; */

	if (!padapter)
		return;
+187 −156

File changed.

Preview size limit exceeded, changes collapsed.

+9 −9
Original line number Diff line number Diff line
@@ -205,11 +205,11 @@ void rtw_wep_decrypt(struct adapter *padapter, u8 *precvframe)
	u32	keylength;
	u8	*pframe, *payload, *iv, wepkey[16];
	u8	 keyindex;
	struct	rx_pkt_attrib	 *prxattrib = &(((union recv_frame *)precvframe)->u.hdr.attrib);
	struct	rx_pkt_attrib	 *prxattrib = &(((struct recv_frame *)precvframe)->attrib);
	struct	security_priv	*psecuritypriv = &padapter->securitypriv;


	pframe = (unsigned char *)((union recv_frame *)precvframe)->u.hdr.rx_data;
	pframe = (unsigned char *)((struct recv_frame *)precvframe)->rx_data;

	/* start to decrypt recvframe */
	if ((prxattrib->encrypt == _WEP40_) || (prxattrib->encrypt == _WEP104_)) {
@@ -218,7 +218,7 @@ void rtw_wep_decrypt(struct adapter *padapter, u8 *precvframe)
		keylength = psecuritypriv->dot11DefKeylen[keyindex];
		memcpy(&wepkey[0], iv, 3);
		memcpy(&wepkey[3], &psecuritypriv->dot11DefKey[keyindex].skey[0], keylength);
		length = ((union recv_frame *)precvframe)->u.hdr.len-prxattrib->hdrlen-prxattrib->iv_len;
		length = ((struct recv_frame *)precvframe)->len-prxattrib->hdrlen-prxattrib->iv_len;

		payload = pframe+prxattrib->iv_len+prxattrib->hdrlen;

@@ -653,12 +653,12 @@ u32 rtw_tkip_decrypt(struct adapter *padapter, u8 *precvframe)
	u8	*pframe, *payload, *iv, *prwskey;
	union pn48 dot11txpn;
	struct	sta_info		*stainfo;
	struct	rx_pkt_attrib	 *prxattrib = &((union recv_frame *)precvframe)->u.hdr.attrib;
	struct	rx_pkt_attrib	 *prxattrib = &((struct recv_frame *)precvframe)->attrib;
	struct	security_priv	*psecuritypriv = &padapter->securitypriv;
	u32		res = _SUCCESS;


	pframe = (unsigned char *)((union recv_frame *)precvframe)->u.hdr.rx_data;
	pframe = (unsigned char *)((struct recv_frame *)precvframe)->rx_data;

	/* 4 start to decrypt recvframe */
	if (prxattrib->encrypt == _TKIP_) {
@@ -678,7 +678,7 @@ u32 rtw_tkip_decrypt(struct adapter *padapter, u8 *precvframe)

			iv = pframe+prxattrib->hdrlen;
			payload = pframe+prxattrib->iv_len+prxattrib->hdrlen;
			length = ((union recv_frame *)precvframe)->u.hdr.len-prxattrib->hdrlen-prxattrib->iv_len;
			length = ((struct recv_frame *)precvframe)->len-prxattrib->hdrlen-prxattrib->iv_len;

			GET_TKIP_PN(iv, dot11txpn);

@@ -1455,10 +1455,10 @@ u32 rtw_aes_decrypt(struct adapter *padapter, u8 *precvframe)
	int		length;
	u8	*pframe, *prwskey;	/*  *payload,*iv */
	struct	sta_info		*stainfo;
	struct	rx_pkt_attrib	 *prxattrib = &((union recv_frame *)precvframe)->u.hdr.attrib;
	struct	rx_pkt_attrib	 *prxattrib = &((struct recv_frame *)precvframe)->attrib;
	struct	security_priv	*psecuritypriv = &padapter->securitypriv;
	u32	res = _SUCCESS;
	pframe = (unsigned char *)((union recv_frame *)precvframe)->u.hdr.rx_data;
	pframe = (unsigned char *)((struct recv_frame *)precvframe)->rx_data;
	/* 4 start to encrypt each fragment */
	if ((prxattrib->encrypt == _AES_)) {
		stainfo = rtw_get_stainfo(&padapter->stapriv, &prxattrib->ta[0]);
@@ -1482,7 +1482,7 @@ u32 rtw_aes_decrypt(struct adapter *padapter, u8 *precvframe)
			} else {
				prwskey = &stainfo->dot118021x_UncstKey.skey[0];
			}
			length = ((union recv_frame *)precvframe)->u.hdr.len-prxattrib->hdrlen-prxattrib->iv_len;
			length = ((struct recv_frame *)precvframe)->len-prxattrib->hdrlen-prxattrib->iv_len;
			res = aes_decipher(prwskey, prxattrib->hdrlen, pframe, length);
		} else {
			RT_TRACE(_module_rtl871x_security_c_, _drv_err_, ("rtw_aes_encrypt: stainfo==NULL!!!\n"));
+5 −5
Original line number Diff line number Diff line
@@ -346,8 +346,8 @@ u32 rtw_free_stainfo(struct adapter *padapter , struct sta_info *psta)
	/* for A-MPDU Rx reordering buffer control, cancel reordering_ctrl_timer */
	for (i = 0; i < 16; i++) {
		struct list_head *phead, *plist;
		struct recv_frame_hdr *prhdr;
		union recv_frame *prframe;
		struct recv_frame *prhdr;
		struct recv_frame *prframe;
		struct __queue *ppending_recvframe_queue;
		struct __queue *pfree_recv_queue = &padapter->recvpriv.free_recv_queue;

@@ -363,12 +363,12 @@ u32 rtw_free_stainfo(struct adapter *padapter , struct sta_info *psta)
		plist = phead->next;

		while (!rtw_is_list_empty(phead)) {
			prhdr = container_of(plist, struct recv_frame_hdr, list);
			prframe = (union recv_frame *)prhdr;
			prhdr = container_of(plist, struct recv_frame, list);
			prframe = (struct recv_frame *)prhdr;

			plist = plist->next;

			rtw_list_delete(&(prframe->u.hdr.list));
			rtw_list_delete(&(prframe->list));

			rtw_free_recvframe(prframe, pfree_recv_queue);
		}
+17 −14
Original line number Diff line number Diff line
@@ -23,9 +23,9 @@
#include <drv_types.h>
#include <rtl8188e_hal.h>

static void process_rssi(struct adapter *padapter, union recv_frame *prframe)
static void process_rssi(struct adapter *padapter, struct recv_frame *prframe)
{
	struct rx_pkt_attrib *pattrib = &prframe->u.hdr.attrib;
	struct rx_pkt_attrib *pattrib = &prframe->attrib;
	struct signal_stat *signal_stat = &padapter->recvpriv.signal_strength_data;

	if (signal_stat->update_req) {
@@ -39,7 +39,8 @@ static void process_rssi(struct adapter *padapter, union recv_frame *prframe)
	signal_stat->avg_val = signal_stat->total_val / signal_stat->total_num;
} /*  Process_UI_RSSI_8192C */

static void process_link_qual(struct adapter *padapter, union recv_frame *prframe)
static void process_link_qual(struct adapter *padapter,
			      struct recv_frame *prframe)
{
	struct rx_pkt_attrib *pattrib;
	struct signal_stat *signal_stat;
@@ -47,7 +48,7 @@ static void process_link_qual(struct adapter *padapter, union recv_frame *prfram
	if (prframe == NULL || padapter == NULL)
		return;

	pattrib = &prframe->u.hdr.attrib;
	pattrib = &prframe->attrib;
	signal_stat = &padapter->recvpriv.signal_qual_data;

	if (signal_stat->update_req) {
@@ -63,7 +64,7 @@ static void process_link_qual(struct adapter *padapter, union recv_frame *prfram

void rtl8188e_process_phy_info(struct adapter *padapter, void *prframe)
{
	union recv_frame *precvframe = (union recv_frame *)prframe;
	struct recv_frame *precvframe = (struct recv_frame *)prframe;

	/*  Check RSSI */
	process_rssi(padapter, precvframe);
@@ -71,7 +72,8 @@ void rtl8188e_process_phy_info(struct adapter *padapter, void *prframe)
	process_link_qual(padapter,  precvframe);
}

void update_recvframe_attrib_88e(union recv_frame *precvframe, struct recv_stat *prxstat)
void update_recvframe_attrib_88e(struct recv_frame *precvframe,
				 struct recv_stat *prxstat)
{
	struct rx_pkt_attrib	*pattrib;
	struct recv_stat	report;
@@ -83,7 +85,7 @@ void update_recvframe_attrib_88e(union recv_frame *precvframe, struct recv_stat
	report.rxdw4 = prxstat->rxdw4;
	report.rxdw5 = prxstat->rxdw5;

	pattrib = &precvframe->u.hdr.attrib;
	pattrib = &precvframe->attrib;
	_rtw_memset(pattrib, 0, sizeof(struct rx_pkt_attrib));

	pattrib->crc_err = (u8)((le32_to_cpu(report.rxdw0) >> 14) & 0x1);/* u8)prxreport->crc32; */
@@ -136,12 +138,13 @@ void update_recvframe_attrib_88e(union recv_frame *precvframe, struct recv_stat
/*
 * Notice:
 *	Before calling this function,
 *	precvframe->u.hdr.rx_data should be ready!
 *	precvframe->rx_data should be ready!
 */
void update_recvframe_phyinfo_88e(union recv_frame *precvframe, struct phy_stat *pphy_status)
void update_recvframe_phyinfo_88e(struct recv_frame *precvframe,
				  struct phy_stat *pphy_status)
{
	struct adapter *padapter = precvframe->u.hdr.adapter;
	struct rx_pkt_attrib *pattrib = &precvframe->u.hdr.attrib;
	struct adapter *padapter = precvframe->adapter;
	struct rx_pkt_attrib *pattrib = &precvframe->attrib;
	struct hal_data_8188e *pHalData = GET_HAL_DATA(padapter);
	struct odm_phy_status_info *pPHYInfo  = (struct odm_phy_status_info *)(&pattrib->phy_info);
	u8 *wlanhdr;
@@ -185,17 +188,17 @@ void update_recvframe_phyinfo_88e(union recv_frame *precvframe, struct phy_stat

	ODM_PhyStatusQuery(&pHalData->odmpriv, pPHYInfo, (u8 *)pphy_status, &(pkt_info));

	precvframe->u.hdr.psta = NULL;
	precvframe->psta = NULL;
	if (pkt_info.bPacketMatchBSSID &&
	    (check_fwstate(&padapter->mlmepriv, WIFI_AP_STATE))) {
		if (psta) {
			precvframe->u.hdr.psta = psta;
			precvframe->psta = psta;
			rtl8188e_process_phy_info(padapter, precvframe);
		}
	} else if (pkt_info.bPacketToSelf || pkt_info.bPacketBeacon) {
		if (check_fwstate(&padapter->mlmepriv, WIFI_ADHOC_STATE|WIFI_ADHOC_MASTER_STATE)) {
			if (psta)
				precvframe->u.hdr.psta = psta;
				precvframe->psta = psta;
		}
		rtl8188e_process_phy_info(padapter, precvframe);
	}
Loading