Commit bbfe286b authored by Ivan Safonov's avatar Ivan Safonov Committed by Greg Kroah-Hartman

staging: r8188eu: replace rtw_ieee80211_hdr_3addr with ieee80211_hdr_3addr

rtw_ieee80211_hdr_3addr is duplicate of ieee80211_hdr_3addr.
Signed-off-by: default avatarIvan Safonov <insafonov@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent d87f574d
...@@ -361,8 +361,8 @@ static void issue_beacon(struct adapter *padapter, int timeout_ms) ...@@ -361,8 +361,8 @@ static void issue_beacon(struct adapter *padapter, int timeout_ms)
/* pmlmeext->mgnt_seq++; */ /* pmlmeext->mgnt_seq++; */
SetFrameSubType(pframe, WIFI_BEACON); SetFrameSubType(pframe, WIFI_BEACON);
pframe += sizeof(struct rtw_ieee80211_hdr_3addr); pframe += sizeof(struct ieee80211_hdr_3addr);
pattrib->pktlen = sizeof(struct rtw_ieee80211_hdr_3addr); pattrib->pktlen = sizeof(struct ieee80211_hdr_3addr);
if ((pmlmeinfo->state&0x03) == WIFI_FW_AP_STATE) { if ((pmlmeinfo->state&0x03) == WIFI_FW_AP_STATE) {
int len_diff; int len_diff;
...@@ -377,8 +377,8 @@ static void issue_beacon(struct adapter *padapter, int timeout_ms) ...@@ -377,8 +377,8 @@ static void issue_beacon(struct adapter *padapter, int timeout_ms)
); );
pframe += (cur_network->IELength+len_diff); pframe += (cur_network->IELength+len_diff);
pattrib->pktlen += (cur_network->IELength+len_diff); pattrib->pktlen += (cur_network->IELength+len_diff);
wps_ie = rtw_get_wps_ie(pmgntframe->buf_addr+TXDESC_OFFSET+sizeof(struct rtw_ieee80211_hdr_3addr)+_BEACON_IE_OFFSET_, wps_ie = rtw_get_wps_ie(pmgntframe->buf_addr+TXDESC_OFFSET+sizeof(struct ieee80211_hdr_3addr)+_BEACON_IE_OFFSET_,
pattrib->pktlen-sizeof(struct rtw_ieee80211_hdr_3addr)-_BEACON_IE_OFFSET_, NULL, &wps_ielen); pattrib->pktlen-sizeof(struct ieee80211_hdr_3addr)-_BEACON_IE_OFFSET_, NULL, &wps_ielen);
if (wps_ie && wps_ielen > 0) if (wps_ie && wps_ielen > 0)
rtw_get_wps_attr_content(wps_ie, wps_ielen, WPS_ATTR_SELECTED_REGISTRAR, (u8 *)(&sr), NULL); rtw_get_wps_attr_content(wps_ie, wps_ielen, WPS_ATTR_SELECTED_REGISTRAR, (u8 *)(&sr), NULL);
if (sr != 0) if (sr != 0)
...@@ -503,7 +503,7 @@ static void issue_probersp(struct adapter *padapter, unsigned char *da) ...@@ -503,7 +503,7 @@ static void issue_probersp(struct adapter *padapter, unsigned char *da)
pmlmeext->mgnt_seq++; pmlmeext->mgnt_seq++;
SetFrameSubType(fctrl, WIFI_PROBERSP); SetFrameSubType(fctrl, WIFI_PROBERSP);
pattrib->hdrlen = sizeof(struct rtw_ieee80211_hdr_3addr); pattrib->hdrlen = sizeof(struct ieee80211_hdr_3addr);
pattrib->pktlen = pattrib->hdrlen; pattrib->pktlen = pattrib->hdrlen;
pframe += pattrib->hdrlen; pframe += pattrib->hdrlen;
...@@ -656,8 +656,8 @@ static int issue_probereq(struct adapter *padapter, struct ndis_802_11_ssid *pss ...@@ -656,8 +656,8 @@ static int issue_probereq(struct adapter *padapter, struct ndis_802_11_ssid *pss
pmlmeext->mgnt_seq++; pmlmeext->mgnt_seq++;
SetFrameSubType(pframe, WIFI_PROBEREQ); SetFrameSubType(pframe, WIFI_PROBEREQ);
pframe += sizeof(struct rtw_ieee80211_hdr_3addr); pframe += sizeof(struct ieee80211_hdr_3addr);
pattrib->pktlen = sizeof(struct rtw_ieee80211_hdr_3addr); pattrib->pktlen = sizeof(struct ieee80211_hdr_3addr);
if (pssid) if (pssid)
pframe = rtw_set_ie(pframe, _SSID_IE_, pssid->SsidLength, pssid->Ssid, &(pattrib->pktlen)); pframe = rtw_set_ie(pframe, _SSID_IE_, pssid->SsidLength, pssid->Ssid, &(pattrib->pktlen));
...@@ -778,8 +778,8 @@ static void issue_auth(struct adapter *padapter, struct sta_info *psta, ...@@ -778,8 +778,8 @@ static void issue_auth(struct adapter *padapter, struct sta_info *psta,
pmlmeext->mgnt_seq++; pmlmeext->mgnt_seq++;
SetFrameSubType(pframe, WIFI_AUTH); SetFrameSubType(pframe, WIFI_AUTH);
pframe += sizeof(struct rtw_ieee80211_hdr_3addr); pframe += sizeof(struct ieee80211_hdr_3addr);
pattrib->pktlen = sizeof(struct rtw_ieee80211_hdr_3addr); pattrib->pktlen = sizeof(struct ieee80211_hdr_3addr);
if (psta) {/* for AP mode */ if (psta) {/* for AP mode */
...@@ -866,7 +866,7 @@ static void issue_auth(struct adapter *padapter, struct sta_info *psta, ...@@ -866,7 +866,7 @@ static void issue_auth(struct adapter *padapter, struct sta_info *psta,
SetPrivacy(fctrl); SetPrivacy(fctrl);
pattrib->hdrlen = sizeof(struct rtw_ieee80211_hdr_3addr); pattrib->hdrlen = sizeof(struct ieee80211_hdr_3addr);
pattrib->encrypt = _WEP40_; pattrib->encrypt = _WEP40_;
...@@ -933,7 +933,7 @@ static void issue_asocrsp(struct adapter *padapter, unsigned short status, ...@@ -933,7 +933,7 @@ static void issue_asocrsp(struct adapter *padapter, unsigned short status,
else else
return; return;
pattrib->hdrlen = sizeof(struct rtw_ieee80211_hdr_3addr); pattrib->hdrlen = sizeof(struct ieee80211_hdr_3addr);
pattrib->pktlen += pattrib->hdrlen; pattrib->pktlen += pattrib->hdrlen;
pframe += pattrib->hdrlen; pframe += pattrib->hdrlen;
...@@ -1052,8 +1052,8 @@ static void issue_assocreq(struct adapter *padapter) ...@@ -1052,8 +1052,8 @@ static void issue_assocreq(struct adapter *padapter)
pmlmeext->mgnt_seq++; pmlmeext->mgnt_seq++;
SetFrameSubType(pframe, WIFI_ASSOCREQ); SetFrameSubType(pframe, WIFI_ASSOCREQ);
pframe += sizeof(struct rtw_ieee80211_hdr_3addr); pframe += sizeof(struct ieee80211_hdr_3addr);
pattrib->pktlen = sizeof(struct rtw_ieee80211_hdr_3addr); pattrib->pktlen = sizeof(struct ieee80211_hdr_3addr);
/* caps */ /* caps */
...@@ -1260,8 +1260,8 @@ static int _issue_nulldata(struct adapter *padapter, unsigned char *da, unsigned ...@@ -1260,8 +1260,8 @@ static int _issue_nulldata(struct adapter *padapter, unsigned char *da, unsigned
pmlmeext->mgnt_seq++; pmlmeext->mgnt_seq++;
SetFrameSubType(pframe, WIFI_DATA_NULL); SetFrameSubType(pframe, WIFI_DATA_NULL);
pframe += sizeof(struct rtw_ieee80211_hdr_3addr); pframe += sizeof(struct ieee80211_hdr_3addr);
pattrib->pktlen = sizeof(struct rtw_ieee80211_hdr_3addr); pattrib->pktlen = sizeof(struct ieee80211_hdr_3addr);
pattrib->last_txcmdsz = pattrib->pktlen; pattrib->last_txcmdsz = pattrib->pktlen;
...@@ -1491,8 +1491,8 @@ static int _issue_deauth(struct adapter *padapter, unsigned char *da, unsigned s ...@@ -1491,8 +1491,8 @@ static int _issue_deauth(struct adapter *padapter, unsigned char *da, unsigned s
pmlmeext->mgnt_seq++; pmlmeext->mgnt_seq++;
SetFrameSubType(pframe, WIFI_DEAUTH); SetFrameSubType(pframe, WIFI_DEAUTH);
pframe += sizeof(struct rtw_ieee80211_hdr_3addr); pframe += sizeof(struct ieee80211_hdr_3addr);
pattrib->pktlen = sizeof(struct rtw_ieee80211_hdr_3addr); pattrib->pktlen = sizeof(struct ieee80211_hdr_3addr);
le_tmp = cpu_to_le16(reason); le_tmp = cpu_to_le16(reason);
pframe = rtw_set_fixed_ie(pframe, _RSON_CODE_, &le_tmp, pframe = rtw_set_fixed_ie(pframe, _RSON_CODE_, &le_tmp,
...@@ -1609,8 +1609,8 @@ static void issue_action_BA(struct adapter *padapter, unsigned char *raddr, ...@@ -1609,8 +1609,8 @@ static void issue_action_BA(struct adapter *padapter, unsigned char *raddr,
pmlmeext->mgnt_seq++; pmlmeext->mgnt_seq++;
SetFrameSubType(pframe, WIFI_ACTION); SetFrameSubType(pframe, WIFI_ACTION);
pframe += sizeof(struct rtw_ieee80211_hdr_3addr); pframe += sizeof(struct ieee80211_hdr_3addr);
pattrib->pktlen = sizeof(struct rtw_ieee80211_hdr_3addr); pattrib->pktlen = sizeof(struct ieee80211_hdr_3addr);
pframe = rtw_set_fixed_ie(pframe, 1, &(category), &(pattrib->pktlen)); pframe = rtw_set_fixed_ie(pframe, 1, &(category), &(pattrib->pktlen));
pframe = rtw_set_fixed_ie(pframe, 1, &(action), &(pattrib->pktlen)); pframe = rtw_set_fixed_ie(pframe, 1, &(action), &(pattrib->pktlen));
...@@ -1768,8 +1768,8 @@ static void issue_action_BSSCoexistPacket(struct adapter *padapter) ...@@ -1768,8 +1768,8 @@ static void issue_action_BSSCoexistPacket(struct adapter *padapter)
pmlmeext->mgnt_seq++; pmlmeext->mgnt_seq++;
SetFrameSubType(pframe, WIFI_ACTION); SetFrameSubType(pframe, WIFI_ACTION);
pframe += sizeof(struct rtw_ieee80211_hdr_3addr); pframe += sizeof(struct ieee80211_hdr_3addr);
pattrib->pktlen = sizeof(struct rtw_ieee80211_hdr_3addr); pattrib->pktlen = sizeof(struct ieee80211_hdr_3addr);
pframe = rtw_set_fixed_ie(pframe, 1, &(category), &(pattrib->pktlen)); pframe = rtw_set_fixed_ie(pframe, 1, &(category), &(pattrib->pktlen));
pframe = rtw_set_fixed_ie(pframe, 1, &(action), &(pattrib->pktlen)); pframe = rtw_set_fixed_ie(pframe, 1, &(action), &(pattrib->pktlen));
...@@ -2052,7 +2052,7 @@ static u8 collect_bss_info(struct adapter *padapter, ...@@ -2052,7 +2052,7 @@ static u8 collect_bss_info(struct adapter *padapter,
struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv; struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv;
struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info); struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info);
len = packet_len - sizeof(struct rtw_ieee80211_hdr_3addr); len = packet_len - sizeof(struct ieee80211_hdr_3addr);
if (len > MAX_IE_SZ) if (len > MAX_IE_SZ)
return _FAIL; return _FAIL;
...@@ -2082,7 +2082,7 @@ static u8 collect_bss_info(struct adapter *padapter, ...@@ -2082,7 +2082,7 @@ static u8 collect_bss_info(struct adapter *padapter,
/* below is to copy the information element */ /* below is to copy the information element */
bssid->IELength = len; bssid->IELength = len;
memcpy(bssid->IEs, (pframe + sizeof(struct rtw_ieee80211_hdr_3addr)), bssid->IELength); memcpy(bssid->IEs, (pframe + sizeof(struct ieee80211_hdr_3addr)), bssid->IELength);
/* get the signal strength in dBM.raw data */ /* get the signal strength in dBM.raw data */
bssid->Rssi = precv_frame->attrib.phy_info.recvpower; bssid->Rssi = precv_frame->attrib.phy_info.recvpower;
...@@ -2624,7 +2624,7 @@ static unsigned int OnBeacon(struct adapter *padapter, ...@@ -2624,7 +2624,7 @@ static unsigned int OnBeacon(struct adapter *padapter,
} }
/* check the vendor of the assoc AP */ /* check the vendor of the assoc AP */
pmlmeinfo->assoc_AP_vendor = check_assoc_AP(pframe+sizeof(struct rtw_ieee80211_hdr_3addr), len-sizeof(struct rtw_ieee80211_hdr_3addr)); pmlmeinfo->assoc_AP_vendor = check_assoc_AP(pframe+sizeof(struct ieee80211_hdr_3addr), len-sizeof(struct ieee80211_hdr_3addr));
/* update TSF Value */ /* update TSF Value */
update_TSF(pmlmeext, pframe, len); update_TSF(pmlmeext, pframe, len);
...@@ -3581,7 +3581,7 @@ static unsigned int on_action_spct(struct adapter *padapter, ...@@ -3581,7 +3581,7 @@ static unsigned int on_action_spct(struct adapter *padapter,
struct sta_info *psta = NULL; struct sta_info *psta = NULL;
struct sta_priv *pstapriv = &padapter->stapriv; struct sta_priv *pstapriv = &padapter->stapriv;
u8 *pframe = precv_frame->rx_data; u8 *pframe = precv_frame->rx_data;
u8 *frame_body = pframe + sizeof(struct rtw_ieee80211_hdr_3addr); u8 *frame_body = pframe + sizeof(struct ieee80211_hdr_3addr);
u8 category; u8 category;
u8 action; u8 action;
...@@ -3655,7 +3655,7 @@ static unsigned int OnAction_back(struct adapter *padapter, ...@@ -3655,7 +3655,7 @@ static unsigned int OnAction_back(struct adapter *padapter,
if (psta == NULL) if (psta == NULL)
return _SUCCESS; return _SUCCESS;
frame_body = (unsigned char *)(pframe + sizeof(struct rtw_ieee80211_hdr_3addr)); frame_body = (unsigned char *)(pframe + sizeof(struct ieee80211_hdr_3addr));
category = frame_body[0]; category = frame_body[0];
if (category == RTW_WLAN_CATEGORY_BACK) { /* representing Block Ack */ if (category == RTW_WLAN_CATEGORY_BACK) { /* representing Block Ack */
...@@ -3742,7 +3742,7 @@ static unsigned int on_action_public_p2p(struct recv_frame *precv_frame) ...@@ -3742,7 +3742,7 @@ static unsigned int on_action_public_p2p(struct recv_frame *precv_frame)
u8 *pframe = precv_frame->rx_data; u8 *pframe = precv_frame->rx_data;
u8 *frame_body; u8 *frame_body;
u8 dialogToken = 0; u8 dialogToken = 0;
frame_body = (unsigned char *)(pframe + sizeof(struct rtw_ieee80211_hdr_3addr)); frame_body = (unsigned char *)(pframe + sizeof(struct ieee80211_hdr_3addr));
dialogToken = frame_body[7]; dialogToken = frame_body[7];
...@@ -3756,7 +3756,7 @@ static unsigned int on_action_public_vendor(struct recv_frame *precv_frame) ...@@ -3756,7 +3756,7 @@ static unsigned int on_action_public_vendor(struct recv_frame *precv_frame)
{ {
unsigned int ret = _FAIL; unsigned int ret = _FAIL;
u8 *pframe = precv_frame->rx_data; u8 *pframe = precv_frame->rx_data;
u8 *frame_body = pframe + sizeof(struct rtw_ieee80211_hdr_3addr); u8 *frame_body = pframe + sizeof(struct ieee80211_hdr_3addr);
if (!memcmp(frame_body + 2, P2P_OUI, 4)) if (!memcmp(frame_body + 2, P2P_OUI, 4))
ret = on_action_public_p2p(precv_frame); ret = on_action_public_p2p(precv_frame);
...@@ -3768,7 +3768,7 @@ static unsigned int on_action_public_default(struct recv_frame *precv_frame, u8 ...@@ -3768,7 +3768,7 @@ static unsigned int on_action_public_default(struct recv_frame *precv_frame, u8
{ {
unsigned int ret = _FAIL; unsigned int ret = _FAIL;
u8 *pframe = precv_frame->rx_data; u8 *pframe = precv_frame->rx_data;
u8 *frame_body = pframe + sizeof(struct rtw_ieee80211_hdr_3addr); u8 *frame_body = pframe + sizeof(struct ieee80211_hdr_3addr);
u8 token; u8 token;
token = frame_body[2]; token = frame_body[2];
...@@ -3787,7 +3787,7 @@ static unsigned int on_action_public(struct adapter *padapter, ...@@ -3787,7 +3787,7 @@ static unsigned int on_action_public(struct adapter *padapter,
{ {
unsigned int ret = _FAIL; unsigned int ret = _FAIL;
u8 *pframe = precv_frame->rx_data; u8 *pframe = precv_frame->rx_data;
u8 *frame_body = pframe + sizeof(struct rtw_ieee80211_hdr_3addr); u8 *frame_body = pframe + sizeof(struct ieee80211_hdr_3addr);
u8 category, action; u8 category, action;
/* check RA matches or not */ /* check RA matches or not */
...@@ -3859,7 +3859,7 @@ static unsigned int OnAction(struct adapter *padapter, ...@@ -3859,7 +3859,7 @@ static unsigned int OnAction(struct adapter *padapter,
unsigned char *frame_body; unsigned char *frame_body;
u8 *pframe = precv_frame->rx_data; u8 *pframe = precv_frame->rx_data;
frame_body = (unsigned char *)(pframe + sizeof(struct rtw_ieee80211_hdr_3addr)); frame_body = (unsigned char *)(pframe + sizeof(struct ieee80211_hdr_3addr));
category = frame_body[0]; category = frame_body[0];
......
...@@ -881,7 +881,7 @@ int rtw_check_bcn_info(struct adapter *Adapter, u8 *pframe, u32 packet_len) ...@@ -881,7 +881,7 @@ int rtw_check_bcn_info(struct adapter *Adapter, u8 *pframe, u32 packet_len)
if (is_client_associated_to_ap(Adapter) == false) if (is_client_associated_to_ap(Adapter) == false)
return true; return true;
len = packet_len - sizeof(struct rtw_ieee80211_hdr_3addr); len = packet_len - sizeof(struct ieee80211_hdr_3addr);
if (len > MAX_IE_SZ) { if (len > MAX_IE_SZ) {
DBG_88E("%s IE too long for survey event\n", __func__); DBG_88E("%s IE too long for survey event\n", __func__);
...@@ -907,7 +907,7 @@ int rtw_check_bcn_info(struct adapter *Adapter, u8 *pframe, u32 packet_len) ...@@ -907,7 +907,7 @@ int rtw_check_bcn_info(struct adapter *Adapter, u8 *pframe, u32 packet_len)
/* below is to copy the information element */ /* below is to copy the information element */
bssid->IELength = len; bssid->IELength = len;
memcpy(bssid->IEs, (pframe + sizeof(struct rtw_ieee80211_hdr_3addr)), bssid->IELength); memcpy(bssid->IEs, (pframe + sizeof(struct ieee80211_hdr_3addr)), bssid->IELength);
/* check bw and channel offset */ /* check bw and channel offset */
/* parsing HT_CAP_IE */ /* parsing HT_CAP_IE */
...@@ -1587,7 +1587,7 @@ void update_TSF(struct mlme_ext_priv *pmlmeext, u8 *pframe, uint len) ...@@ -1587,7 +1587,7 @@ void update_TSF(struct mlme_ext_priv *pmlmeext, u8 *pframe, uint len)
u8 *pIE; u8 *pIE;
__le32 *pbuf; __le32 *pbuf;
pIE = pframe + sizeof(struct rtw_ieee80211_hdr_3addr); pIE = pframe + sizeof(struct ieee80211_hdr_3addr);
pbuf = (__le32 *)pIE; pbuf = (__le32 *)pIE;
pmlmeext->TSFValue = le32_to_cpu(*(pbuf+1)); pmlmeext->TSFValue = le32_to_cpu(*(pbuf+1));
......
...@@ -239,8 +239,8 @@ static void ConstructBeacon(struct adapter *adapt, u8 *pframe, u32 *pLength) ...@@ -239,8 +239,8 @@ static void ConstructBeacon(struct adapter *adapt, u8 *pframe, u32 *pLength)
SetSeqNum(pwlanhdr, 0/*pmlmeext->mgnt_seq*/); SetSeqNum(pwlanhdr, 0/*pmlmeext->mgnt_seq*/);
SetFrameSubType(pframe, WIFI_BEACON); SetFrameSubType(pframe, WIFI_BEACON);
pframe += sizeof(struct rtw_ieee80211_hdr_3addr); pframe += sizeof(struct ieee80211_hdr_3addr);
pktlen = sizeof(struct rtw_ieee80211_hdr_3addr); pktlen = sizeof(struct ieee80211_hdr_3addr);
/* timestamp will be inserted by hardware */ /* timestamp will be inserted by hardware */
pframe += 8; pframe += 8;
...@@ -390,7 +390,7 @@ static void ConstructNullFunctionData(struct adapter *adapt, u8 *pframe, ...@@ -390,7 +390,7 @@ static void ConstructNullFunctionData(struct adapter *adapt, u8 *pframe,
} else { } else {
SetFrameSubType(pframe, WIFI_DATA_NULL); SetFrameSubType(pframe, WIFI_DATA_NULL);
pktlen = sizeof(struct rtw_ieee80211_hdr_3addr); pktlen = sizeof(struct ieee80211_hdr_3addr);
} }
*pLength = pktlen; *pLength = pktlen;
...@@ -420,7 +420,7 @@ static void ConstructProbeRsp(struct adapter *adapt, u8 *pframe, u32 *pLength, u ...@@ -420,7 +420,7 @@ static void ConstructProbeRsp(struct adapter *adapt, u8 *pframe, u32 *pLength, u
SetSeqNum(pwlanhdr, 0); SetSeqNum(pwlanhdr, 0);
SetFrameSubType(fctrl, WIFI_PROBERSP); SetFrameSubType(fctrl, WIFI_PROBERSP);
pktlen = sizeof(struct rtw_ieee80211_hdr_3addr); pktlen = sizeof(struct ieee80211_hdr_3addr);
pframe += pktlen; pframe += pktlen;
if (cur_network->IELength > MAX_IE_SZ) if (cur_network->IELength > MAX_IE_SZ)
......
...@@ -291,15 +291,6 @@ struct sta_data { ...@@ -291,15 +291,6 @@ struct sta_data {
/* this is stolen from ipw2200 driver */ /* this is stolen from ipw2200 driver */
#define IEEE_IBSS_MAC_HASH_SIZE 31 #define IEEE_IBSS_MAC_HASH_SIZE 31
struct rtw_ieee80211_hdr_3addr {
__le16 frame_ctl;
__le16 duration_id;
u8 addr1[ETH_ALEN];
u8 addr2[ETH_ALEN];
u8 addr3[ETH_ALEN];
u16 seq_ctl;
} __packed;
struct rtw_ieee80211_hdr_3addr_qos { struct rtw_ieee80211_hdr_3addr_qos {
__le16 frame_ctl; __le16 frame_ctl;
__le16 duration_id; __le16 duration_id;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment