mirror of
https://github.com/Mange/rtl8192eu-linux-driver
synced 2026-02-12 16:04:39 +00:00
switch to common ieee80211 headers
This patch switches to <linux/ieee80211.h> and <net/cfg80211.h> and deletes a lot of duplicate definitions plus many unused ones. rtw_ieee80211_hdr_3addr_qos is duplicate of ieee80211_qos_hdr. rtw_ieee80211_spectrum_mgmt_actioncode is a duplication of ieee80211_spectrum_mgmt_actioncode rtw_ieee80211_hdr_3addr is duplicate of ieee80211_hdr_3addr. rtw_ieee80211_hdr is duplicate of ieee80211_hdr rtw_ieee80211s_hdr is duplicate of ieee80211s_hdr rtw_ieee80211_rann_ie is duplicate of ieee80211_rann_ie from include/linux/ieee80211.h. Link: https://lore.kernel.org/r/20200906133236.556427-1-insafonov@gmail.com Link: https://lore.kernel.org/r/20200609194848.166130-1-pterjan@google.com Also port 5cd8396540b5f7ef7c3ac499e967dd4deb8e9930 bbfe286b07d8282f4957dee692e85b3bd60de770 d87f574d6923c546e7d0f75ce0581436376b98a6 36eb7d108e8de3097f373eb8629d8739d4fa3e74 1b9e6df5169b36b3242e2e28c39f9bbfc01863e8 d94971aa97670d400371baef5d9d5cf6dc8ea2b5
This commit is contained in:
@@ -1312,7 +1312,7 @@ static int rtw_mpm_tx_ies_sync_bss(_adapter *adapter, struct mesh_plink_ent *pli
|
||||
#endif
|
||||
|
||||
/* count for new frame length */
|
||||
new_len = sizeof(struct rtw_ieee80211_hdr_3addr) + tlv_ies_offset;
|
||||
new_len = sizeof(struct ieee80211_hdr_3addr) + tlv_ies_offset;
|
||||
left = BSS_EX_TLV_IES_LEN(network);
|
||||
pos = BSS_EX_TLV_IES(network);
|
||||
while (left >= 2) {
|
||||
@@ -1349,10 +1349,10 @@ static int rtw_mpm_tx_ies_sync_bss(_adapter *adapter, struct mesh_plink_ent *pli
|
||||
}
|
||||
|
||||
/* build new frame */
|
||||
memcpy(new_buf, fhead, sizeof(struct rtw_ieee80211_hdr_3addr) + tlv_ies_offset);
|
||||
memcpy(new_buf, fhead, sizeof(struct ieee80211_hdr_3addr) + tlv_ies_offset);
|
||||
new_fhead = new_buf;
|
||||
new_flen = new_len;
|
||||
new_fbody = new_fhead + sizeof(struct rtw_ieee80211_hdr_3addr);
|
||||
new_fbody = new_fhead + sizeof(struct ieee80211_hdr_3addr);
|
||||
|
||||
fpos = new_fbody + tlv_ies_offset;
|
||||
left = BSS_EX_TLV_IES_LEN(network);
|
||||
@@ -1483,7 +1483,7 @@ static int rtw_mpm_check_frames(_adapter *adapter, u8 action, const u8 **buf, si
|
||||
u8 *fhead = (u8 *)*buf;
|
||||
size_t flen = *len;
|
||||
u8 *peer_addr = tx ? GetAddr1Ptr(fhead) : get_addr2_ptr(fhead);
|
||||
u8 *frame_body = fhead + sizeof(struct rtw_ieee80211_hdr_3addr);
|
||||
u8 *frame_body = fhead + sizeof(struct ieee80211_hdr_3addr);
|
||||
struct mpm_frame_info mpm_info;
|
||||
u8 tlv_ies_offset;
|
||||
u8 *mpm_ie = NULL;
|
||||
@@ -1493,11 +1493,11 @@ static int rtw_mpm_check_frames(_adapter *adapter, u8 action, const u8 **buf, si
|
||||
int ret = 0;
|
||||
u8 mpm_log_buf[MPM_LOG_BUF_LEN] = {0};
|
||||
|
||||
if (action == RTW_ACT_SELF_PROTECTED_MESH_OPEN)
|
||||
if (action == WLAN_SP_MESH_PEERING_OPEN)
|
||||
tlv_ies_offset = 4;
|
||||
else if (action == RTW_ACT_SELF_PROTECTED_MESH_CONF)
|
||||
else if (action == WLAN_SP_MESH_PEERING_CONFIRM)
|
||||
tlv_ies_offset = 6;
|
||||
else if (action == RTW_ACT_SELF_PROTECTED_MESH_CLOSE)
|
||||
else if (action == WLAN_SP_MESH_PEERING_CLOSE)
|
||||
tlv_ies_offset = 2;
|
||||
else {
|
||||
rtw_warn_on(1);
|
||||
@@ -1505,23 +1505,20 @@ static int rtw_mpm_check_frames(_adapter *adapter, u8 action, const u8 **buf, si
|
||||
}
|
||||
|
||||
plink = rtw_mesh_plink_get(adapter, peer_addr);
|
||||
if (!plink && (tx == _TRUE || action == RTW_ACT_SELF_PROTECTED_MESH_CONF)) {
|
||||
/* warning message if no plink when: 1.TX all MPM or 2.RX CONF */
|
||||
RTW_WARN("RTW_%s:%s without plink of "MAC_FMT"\n"
|
||||
, (tx == _TRUE) ? "Tx" : "Rx", action_self_protected_str(action), MAC_ARG(peer_addr));
|
||||
if (!plink && (tx == _TRUE || action == WLAN_SP_MESH_PEERING_CONFIRM)) {
|
||||
goto exit;
|
||||
}
|
||||
|
||||
memset(&mpm_info, 0, sizeof(struct mpm_frame_info));
|
||||
|
||||
if (action == RTW_ACT_SELF_PROTECTED_MESH_CONF) {
|
||||
if (action == WLAN_SP_MESH_PEERING_CONFIRM) {
|
||||
mpm_info.aid = (u8 *)frame_body + 4;
|
||||
mpm_info.aid_v = RTW_GET_LE16(mpm_info.aid);
|
||||
}
|
||||
|
||||
mpm_ie = rtw_get_ie(fhead + sizeof(struct rtw_ieee80211_hdr_3addr) + tlv_ies_offset
|
||||
mpm_ie = rtw_get_ie(fhead + sizeof(struct ieee80211_hdr_3addr) + tlv_ies_offset
|
||||
, WLAN_EID_MPM, &mpm_ielen
|
||||
, flen - sizeof(struct rtw_ieee80211_hdr_3addr) - tlv_ies_offset);
|
||||
, flen - sizeof(struct ieee80211_hdr_3addr) - tlv_ies_offset);
|
||||
if (!mpm_ie || mpm_ielen < 2 + 2)
|
||||
goto exit;
|
||||
|
||||
@@ -1531,7 +1528,7 @@ static int rtw_mpm_check_frames(_adapter *adapter, u8 action, const u8 **buf, si
|
||||
mpm_info.llid_v = RTW_GET_LE16(mpm_info.llid);
|
||||
|
||||
switch (action) {
|
||||
case RTW_ACT_SELF_PROTECTED_MESH_OPEN:
|
||||
case WLAN_SP_MESH_PEERING_OPEN:
|
||||
/* pid:2, llid:2, (chosen_pmk:16) */
|
||||
if (mpm_info.pid_v == 0 && mpm_ielen == 4)
|
||||
;
|
||||
@@ -1540,7 +1537,7 @@ static int rtw_mpm_check_frames(_adapter *adapter, u8 action, const u8 **buf, si
|
||||
else
|
||||
goto exit;
|
||||
break;
|
||||
case RTW_ACT_SELF_PROTECTED_MESH_CONF:
|
||||
case WLAN_SP_MESH_PEERING_CONFIRM:
|
||||
/* pid:2, llid:2, plid:2, (chosen_pmk:16) */
|
||||
mpm_info.plid = mpm_info.llid + 2;
|
||||
mpm_info.plid_v = RTW_GET_LE16(mpm_info.plid);
|
||||
@@ -1551,7 +1548,7 @@ static int rtw_mpm_check_frames(_adapter *adapter, u8 action, const u8 **buf, si
|
||||
else
|
||||
goto exit;
|
||||
break;
|
||||
case RTW_ACT_SELF_PROTECTED_MESH_CLOSE:
|
||||
case WLAN_SP_MESH_PEERING_CLOSE:
|
||||
/* pid:2, llid:2, (plid:2), reason:2, (chosen_pmk:16) */
|
||||
if (mpm_info.pid_v == 0 && mpm_ielen == 6) {
|
||||
/* MPM, without plid */
|
||||
@@ -1581,15 +1578,15 @@ static int rtw_mpm_check_frames(_adapter *adapter, u8 action, const u8 **buf, si
|
||||
};
|
||||
|
||||
if (mpm_info.pid_v == 1) {
|
||||
mic_ie = rtw_get_ie(fhead + sizeof(struct rtw_ieee80211_hdr_3addr) + tlv_ies_offset
|
||||
mic_ie = rtw_get_ie(fhead + sizeof(struct ieee80211_hdr_3addr) + tlv_ies_offset
|
||||
, WLAN_EID_MIC, &mic_ielen
|
||||
, flen - sizeof(struct rtw_ieee80211_hdr_3addr) - tlv_ies_offset);
|
||||
, flen - sizeof(struct ieee80211_hdr_3addr) - tlv_ies_offset);
|
||||
if (!mic_ie || mic_ielen != AES_BLOCK_SIZE)
|
||||
goto exit;
|
||||
}
|
||||
|
||||
#if CONFIG_RTW_MPM_TX_IES_SYNC_BSS
|
||||
if ((action == RTW_ACT_SELF_PROTECTED_MESH_OPEN || action == RTW_ACT_SELF_PROTECTED_MESH_CONF)
|
||||
if ((action == WLAN_SP_MESH_PEERING_OPEN || action == WLAN_SP_MESH_PEERING_CONFIRM)
|
||||
&& tx == _TRUE
|
||||
) {
|
||||
#define DBG_RTW_MPM_TX_IES_SYNC_BSS 0
|
||||
@@ -1602,8 +1599,8 @@ static int rtw_mpm_check_frames(_adapter *adapter, u8 action, const u8 **buf, si
|
||||
if (DBG_RTW_MPM_TX_IES_SYNC_BSS) {
|
||||
RTW_INFO(FUNC_ADPT_FMT" before:\n", FUNC_ADPT_ARG(adapter));
|
||||
dump_ies(RTW_DBGDUMP
|
||||
, fhead + sizeof(struct rtw_ieee80211_hdr_3addr) + tlv_ies_offset
|
||||
, flen - sizeof(struct rtw_ieee80211_hdr_3addr) - tlv_ies_offset);
|
||||
, fhead + sizeof(struct ieee80211_hdr_3addr) + tlv_ies_offset
|
||||
, flen - sizeof(struct ieee80211_hdr_3addr) - tlv_ies_offset);
|
||||
}
|
||||
|
||||
rtw_mpm_tx_ies_sync_bss(adapter, plink
|
||||
@@ -1615,18 +1612,18 @@ static int rtw_mpm_check_frames(_adapter *adapter, u8 action, const u8 **buf, si
|
||||
/* update pointer & len for new frame */
|
||||
fhead = nbuf;
|
||||
flen = nlen;
|
||||
frame_body = fhead + sizeof(struct rtw_ieee80211_hdr_3addr);
|
||||
frame_body = fhead + sizeof(struct ieee80211_hdr_3addr);
|
||||
if (mpm_info.pid_v == 1) {
|
||||
mic_ie = rtw_get_ie(fhead + sizeof(struct rtw_ieee80211_hdr_3addr) + tlv_ies_offset
|
||||
mic_ie = rtw_get_ie(fhead + sizeof(struct ieee80211_hdr_3addr) + tlv_ies_offset
|
||||
, WLAN_EID_MIC, &mic_ielen
|
||||
, flen - sizeof(struct rtw_ieee80211_hdr_3addr) - tlv_ies_offset);
|
||||
, flen - sizeof(struct ieee80211_hdr_3addr) - tlv_ies_offset);
|
||||
}
|
||||
|
||||
if (DBG_RTW_MPM_TX_IES_SYNC_BSS) {
|
||||
RTW_INFO(FUNC_ADPT_FMT" after:\n", FUNC_ADPT_ARG(adapter));
|
||||
dump_ies(RTW_DBGDUMP
|
||||
, fhead + sizeof(struct rtw_ieee80211_hdr_3addr) + tlv_ies_offset
|
||||
, flen - sizeof(struct rtw_ieee80211_hdr_3addr) - tlv_ies_offset);
|
||||
, fhead + sizeof(struct ieee80211_hdr_3addr) + tlv_ies_offset
|
||||
, flen - sizeof(struct ieee80211_hdr_3addr) - tlv_ies_offset);
|
||||
}
|
||||
}
|
||||
bypass_sync_bss:
|
||||
@@ -1636,14 +1633,14 @@ bypass_sync_bss:
|
||||
goto mpm_log;
|
||||
|
||||
#if CONFIG_RTW_MESH_PEER_BLACKLIST
|
||||
if (action == RTW_ACT_SELF_PROTECTED_MESH_OPEN) {
|
||||
if (action == WLAN_SP_MESH_PEERING_OPEN) {
|
||||
if (tx)
|
||||
rtw_mesh_plink_set_peer_conf_timeout(adapter, peer_addr);
|
||||
|
||||
} else
|
||||
#endif
|
||||
#if CONFIG_RTW_MESH_ACNODE_PREVENT
|
||||
if (action == RTW_ACT_SELF_PROTECTED_MESH_CLOSE) {
|
||||
if (action == WLAN_SP_MESH_PEERING_CLOSE) {
|
||||
if (tx && mpm_info.reason && mpm_info.reason_v == WLAN_REASON_MESH_MAX_PEERS) {
|
||||
if (rtw_mesh_scanned_is_acnode_confirmed(adapter, plink->scanned)
|
||||
&& rtw_mesh_acnode_prevent_allow_sacrifice(adapter)
|
||||
@@ -1676,7 +1673,7 @@ bypass_sync_bss:
|
||||
}
|
||||
} else
|
||||
#endif
|
||||
if (action == RTW_ACT_SELF_PROTECTED_MESH_CONF) {
|
||||
if (action == WLAN_SP_MESH_PEERING_CONFIRM) {
|
||||
_irqL irqL;
|
||||
u8 *ies = NULL;
|
||||
u16 ies_len = 0;
|
||||
@@ -1718,13 +1715,13 @@ bypass_sync_bss:
|
||||
|
||||
/* copy mesh confirm IEs */
|
||||
if (mpm_info.pid_v == 1) /* not include MIC & encrypted AMPE */
|
||||
ies_len = (mic_ie - fhead) - sizeof(struct rtw_ieee80211_hdr_3addr) - 2;
|
||||
ies_len = (mic_ie - fhead) - sizeof(struct ieee80211_hdr_3addr) - 2;
|
||||
else
|
||||
ies_len = flen - sizeof(struct rtw_ieee80211_hdr_3addr) - 2;
|
||||
ies_len = flen - sizeof(struct ieee80211_hdr_3addr) - 2;
|
||||
|
||||
ies = rtw_zmalloc(ies_len);
|
||||
if (ies) {
|
||||
memcpy(ies, fhead + sizeof(struct rtw_ieee80211_hdr_3addr) + 2, ies_len);
|
||||
memcpy(ies, fhead + sizeof(struct ieee80211_hdr_3addr) + 2, ies_len);
|
||||
if (tx == _FALSE) {
|
||||
plink->rx_conf_ies = ies;
|
||||
plink->rx_conf_ies_len = ies_len;
|
||||
@@ -1743,11 +1740,6 @@ release_plink_ctl:
|
||||
|
||||
mpm_log:
|
||||
rtw_mpm_info_msg(&mpm_info, mpm_log_buf);
|
||||
RTW_INFO("RTW_%s:%s %s\n"
|
||||
, (tx == _TRUE) ? "Tx" : "Rx"
|
||||
, action_self_protected_str(action)
|
||||
, mpm_log_buf
|
||||
);
|
||||
|
||||
ret = 1;
|
||||
|
||||
@@ -1769,21 +1761,20 @@ static int rtw_mesh_check_frames(_adapter *adapter, const u8 **buf, size_t *len,
|
||||
const u8 *frame_body;
|
||||
u8 category, action;
|
||||
|
||||
frame_body = *buf + sizeof(struct rtw_ieee80211_hdr_3addr);
|
||||
frame_body = *buf + sizeof(struct ieee80211_hdr_3addr);
|
||||
category = frame_body[0];
|
||||
|
||||
if (category == WLAN_CATEGORY_SELF_PROTECTED) {
|
||||
action = frame_body[1];
|
||||
switch (action) {
|
||||
case RTW_ACT_SELF_PROTECTED_MESH_OPEN:
|
||||
case RTW_ACT_SELF_PROTECTED_MESH_CONF:
|
||||
case RTW_ACT_SELF_PROTECTED_MESH_CLOSE:
|
||||
case WLAN_SP_MESH_PEERING_OPEN:
|
||||
case WLAN_SP_MESH_PEERING_CONFIRM:
|
||||
case WLAN_SP_MESH_PEERING_CLOSE:
|
||||
rtw_mpm_check_frames(adapter, action, buf, len, tx);
|
||||
is_mesh_frame = action;
|
||||
break;
|
||||
case RTW_ACT_SELF_PROTECTED_MESH_GK_INFORM:
|
||||
case RTW_ACT_SELF_PROTECTED_MESH_GK_ACK:
|
||||
RTW_INFO("RTW_%s:%s\n", (tx == _TRUE) ? "Tx" : "Rx", action_self_protected_str(action));
|
||||
case WLAN_SP_MGK_ACK:
|
||||
is_mesh_frame = action;
|
||||
break;
|
||||
default:
|
||||
@@ -1836,7 +1827,7 @@ unsigned int on_action_self_protected(_adapter *adapter, union recv_frame *rfram
|
||||
struct sta_info *sta = NULL;
|
||||
u8 *pframe = rframe->u.hdr.rx_data;
|
||||
uint frame_len = rframe->u.hdr.len;
|
||||
u8 *frame_body = (u8 *)(pframe + sizeof(struct rtw_ieee80211_hdr_3addr));
|
||||
u8 *frame_body = (u8 *)(pframe + sizeof(struct ieee80211_hdr_3addr));
|
||||
u8 category;
|
||||
u8 action;
|
||||
|
||||
@@ -1850,11 +1841,11 @@ unsigned int on_action_self_protected(_adapter *adapter, union recv_frame *rfram
|
||||
|
||||
action = frame_body[1];
|
||||
switch (action) {
|
||||
case RTW_ACT_SELF_PROTECTED_MESH_OPEN:
|
||||
case RTW_ACT_SELF_PROTECTED_MESH_CONF:
|
||||
case RTW_ACT_SELF_PROTECTED_MESH_CLOSE:
|
||||
case WLAN_SP_MESH_PEERING_OPEN:
|
||||
case WLAN_SP_MESH_PEERING_CONFIRM:
|
||||
case WLAN_SP_MESH_PEERING_CLOSE:
|
||||
case RTW_ACT_SELF_PROTECTED_MESH_GK_INFORM:
|
||||
case RTW_ACT_SELF_PROTECTED_MESH_GK_ACK:
|
||||
case WLAN_SP_MGK_ACK:
|
||||
if (!(MLME_IS_MESH(adapter) && MLME_IS_ASOC(adapter)))
|
||||
goto exit;
|
||||
#ifdef CONFIG_IOCTL_CFG80211
|
||||
@@ -1894,7 +1885,7 @@ unsigned int on_action_mesh(_adapter *adapter, union recv_frame *rframe)
|
||||
struct sta_priv *stapriv = &adapter->stapriv;
|
||||
u8 *pframe = rframe->u.hdr.rx_data;
|
||||
uint frame_len = rframe->u.hdr.len;
|
||||
u8 *frame_body = (u8 *)(pframe + sizeof(struct rtw_ieee80211_hdr_3addr));
|
||||
u8 *frame_body = (u8 *)(pframe + sizeof(struct ieee80211_hdr_3addr));
|
||||
u8 category;
|
||||
u8 action;
|
||||
|
||||
@@ -1909,7 +1900,7 @@ unsigned int on_action_mesh(_adapter *adapter, union recv_frame *rframe)
|
||||
|
||||
action = frame_body[1];
|
||||
switch (action) {
|
||||
case RTW_ACT_MESH_HWMP_PATH_SELECTION:
|
||||
case WLAN_MESH_ACTION_HWMP_PATH_SELECTION:
|
||||
rtw_mesh_rx_path_sel_frame(adapter, rframe);
|
||||
ret = _SUCCESS;
|
||||
break;
|
||||
@@ -2506,12 +2497,12 @@ static u8 *rtw_mesh_construct_peer_mesh_close(_adapter *adapter, struct mesh_pli
|
||||
struct rtw_mesh_info *minfo = &adapter->mesh_info;
|
||||
u8 *frame = NULL, *pos;
|
||||
u32 flen;
|
||||
struct rtw_ieee80211_hdr *whdr;
|
||||
struct ieee80211_hdr *whdr;
|
||||
|
||||
if (minfo->mesh_auth_id && !MESH_PLINK_AEK_VALID(plink))
|
||||
goto exit;
|
||||
|
||||
flen = sizeof(struct rtw_ieee80211_hdr_3addr)
|
||||
flen = sizeof(struct ieee80211_hdr_3addr)
|
||||
+ 2 /* category, action */
|
||||
+ 2 + minfo->mesh_id_len /* mesh id */
|
||||
+ 2 + 8 + (minfo->mesh_auth_id ? 16 : 0) /* mpm */
|
||||
@@ -2523,16 +2514,16 @@ static u8 *rtw_mesh_construct_peer_mesh_close(_adapter *adapter, struct mesh_pli
|
||||
if (!frame)
|
||||
goto exit;
|
||||
|
||||
whdr = (struct rtw_ieee80211_hdr *)frame;
|
||||
whdr = (struct ieee80211_hdr *)frame;
|
||||
memcpy(whdr->addr1, adapter_mac_addr(adapter), ETH_ALEN);
|
||||
memcpy(whdr->addr2, plink->addr, ETH_ALEN);
|
||||
memcpy(whdr->addr3, adapter_mac_addr(adapter), ETH_ALEN);
|
||||
|
||||
set_frame_sub_type(frame, IEEE80211_STYPE_ACTION);
|
||||
|
||||
pos += sizeof(struct rtw_ieee80211_hdr_3addr);
|
||||
pos += sizeof(struct ieee80211_hdr_3addr);
|
||||
*(pos++) = WLAN_CATEGORY_SELF_PROTECTED;
|
||||
*(pos++) = RTW_ACT_SELF_PROTECTED_MESH_CLOSE;
|
||||
*(pos++) = WLAN_SP_MESH_PEERING_CLOSE;
|
||||
|
||||
pos = rtw_set_ie_mesh_id(pos, NULL, minfo->mesh_id, minfo->mesh_id_len);
|
||||
|
||||
@@ -2558,7 +2549,7 @@ static u8 *rtw_mesh_construct_peer_mesh_close(_adapter *adapter, struct mesh_pli
|
||||
memcpy(ampe_buf + 38, plink->l_nonce, 32);
|
||||
|
||||
enc_ret = rtw_mpm_ampe_enc(adapter, plink
|
||||
, frame + sizeof(struct rtw_ieee80211_hdr_3addr)
|
||||
, frame + sizeof(struct ieee80211_hdr_3addr)
|
||||
, pos, ampe_buf, 1);
|
||||
if (enc_ret != _SUCCESS) {
|
||||
rtw_mfree(frame, flen);
|
||||
@@ -3457,7 +3448,7 @@ s8 rtw_mesh_tx_set_whdr_mctrl_len(u8 mesh_frame_mode, struct pkt_attrib *attrib)
|
||||
|
||||
void rtw_mesh_tx_build_mctrl(_adapter *adapter, struct pkt_attrib *attrib, u8 *buf)
|
||||
{
|
||||
struct rtw_ieee80211s_hdr *mctrl = (struct rtw_ieee80211s_hdr *)buf;
|
||||
struct ieee80211s_hdr *mctrl = (struct ieee80211s_hdr *)buf;
|
||||
|
||||
memset(mctrl, 0, XATTRIB_GET_MCTRL_LEN(attrib));
|
||||
|
||||
@@ -3505,7 +3496,7 @@ void rtw_mesh_tx_build_mctrl(_adapter *adapter, struct pkt_attrib *attrib, u8 *b
|
||||
}
|
||||
|
||||
u8 rtw_mesh_tx_build_whdr(_adapter *adapter, struct pkt_attrib *attrib
|
||||
, u16 *fctrl, struct rtw_ieee80211_hdr *whdr)
|
||||
, u16 *fctrl, struct ieee80211_hdr *whdr)
|
||||
{
|
||||
switch (attrib->mesh_frame_mode) {
|
||||
case MESH_UCAST_DATA: /* 1, 1, RA, TA, mDA(=DA), mSA(=SA) */
|
||||
@@ -3635,7 +3626,7 @@ exit:
|
||||
}
|
||||
|
||||
int rtw_mesh_rx_data_validate_mctrl(_adapter *adapter, union recv_frame *rframe
|
||||
, const struct rtw_ieee80211s_hdr *mctrl, const u8 *mda, const u8 *msa
|
||||
, const struct ieee80211s_hdr *mctrl, const u8 *mda, const u8 *msa
|
||||
, u8 *mctrl_len
|
||||
, const u8 **da, const u8 **sa)
|
||||
{
|
||||
@@ -3689,7 +3680,7 @@ inline int rtw_mesh_rx_validate_mctrl_non_amsdu(_adapter *adapter, union recv_fr
|
||||
int ret;
|
||||
|
||||
ret = rtw_mesh_rx_data_validate_mctrl(adapter, rframe
|
||||
, (struct rtw_ieee80211s_hdr *)(get_recvframe_data(rframe) + rattrib->hdrlen + rattrib->iv_len)
|
||||
, (struct ieee80211s_hdr *)(get_recvframe_data(rframe) + rattrib->hdrlen + rattrib->iv_len)
|
||||
, rattrib->mda, rattrib->msa
|
||||
, &rattrib->mesh_ctrl_len
|
||||
, &da, &sa);
|
||||
@@ -3756,7 +3747,7 @@ endlookup:
|
||||
int rtw_mesh_rx_msdu_act_check(union recv_frame *rframe
|
||||
, const u8 *mda, const u8 *msa
|
||||
, const u8 *da, const u8 *sa
|
||||
, struct rtw_ieee80211s_hdr *mctrl
|
||||
, struct ieee80211s_hdr *mctrl
|
||||
, struct xmit_frame **fwd_frame, _list *b2u_list)
|
||||
{
|
||||
_adapter *adapter = rframe->u.hdr.adapter;
|
||||
|
||||
@@ -505,18 +505,18 @@ int rtw_mesh_addr_resolve(_adapter *adapter, struct xmit_frame *xframe, _pkt *pk
|
||||
s8 rtw_mesh_tx_set_whdr_mctrl_len(u8 mesh_frame_mode, struct pkt_attrib *attrib);
|
||||
void rtw_mesh_tx_build_mctrl(_adapter *adapter, struct pkt_attrib *attrib, u8 *buf);
|
||||
u8 rtw_mesh_tx_build_whdr(_adapter *adapter, struct pkt_attrib *attrib
|
||||
, u16 *fctrl, struct rtw_ieee80211_hdr *whdr);
|
||||
, u16 *fctrl, struct ieee80211_hdr *whdr);
|
||||
|
||||
int rtw_mesh_rx_data_validate_hdr(_adapter *adapter, union recv_frame *rframe, struct sta_info **sta);
|
||||
int rtw_mesh_rx_data_validate_mctrl(_adapter *adapter, union recv_frame *rframe
|
||||
, const struct rtw_ieee80211s_hdr *mctrl, const u8 *mda, const u8 *msa
|
||||
, const struct ieee80211s_hdr *mctrl, const u8 *mda, const u8 *msa
|
||||
, u8 *mctrl_len, const u8 **da, const u8 **sa);
|
||||
int rtw_mesh_rx_validate_mctrl_non_amsdu(_adapter *adapter, union recv_frame *rframe);
|
||||
|
||||
int rtw_mesh_rx_msdu_act_check(union recv_frame *rframe
|
||||
, const u8 *mda, const u8 *msa
|
||||
, const u8 *da, const u8 *sa
|
||||
, struct rtw_ieee80211s_hdr *mctrl
|
||||
, struct ieee80211s_hdr *mctrl
|
||||
, struct xmit_frame **fwd_frame, _list *b2u_list);
|
||||
|
||||
void dump_mesh_stats(void *sel, _adapter *adapter);
|
||||
|
||||
@@ -216,10 +216,10 @@ static int rtw_mesh_path_sel_frame_tx(enum rtw_mpath_frame_type mpath_action, u8
|
||||
struct xmit_priv *pxmitpriv = &(adapter->xmitpriv);
|
||||
struct mlme_ext_priv *pmlmeext = &(adapter->mlmeextpriv);
|
||||
struct xmit_frame *pmgntframe = NULL;
|
||||
struct rtw_ieee80211_hdr *pwlanhdr = NULL;
|
||||
struct ieee80211_hdr *pwlanhdr = NULL;
|
||||
struct pkt_attrib *pattrib = NULL;
|
||||
u8 category = WLAN_CATEGORY_MESH_ACTION;
|
||||
u8 action = RTW_ACT_MESH_HWMP_PATH_SELECTION;
|
||||
u8 action = WLAN_MESH_ACTION_HWMP_PATH_SELECTION;
|
||||
u16 *fctrl = NULL;
|
||||
u8 *pos, ie_len;
|
||||
|
||||
@@ -233,10 +233,10 @@ static int rtw_mesh_path_sel_frame_tx(enum rtw_mpath_frame_type mpath_action, u8
|
||||
memset(pmgntframe->buf_addr, 0, WLANHDR_OFFSET + TXDESC_OFFSET);
|
||||
|
||||
pos = (u8 *)(pmgntframe->buf_addr) + TXDESC_OFFSET;
|
||||
pwlanhdr = (struct rtw_ieee80211_hdr *)pos;
|
||||
pwlanhdr = (struct ieee80211_hdr *)pos;
|
||||
|
||||
|
||||
fctrl = &(pwlanhdr->frame_ctl);
|
||||
fctrl =&pwlanhdr->frame_control;
|
||||
*(fctrl) = 0;
|
||||
|
||||
memcpy(pwlanhdr->addr1, da, ETH_ALEN);
|
||||
@@ -247,8 +247,8 @@ static int rtw_mesh_path_sel_frame_tx(enum rtw_mpath_frame_type mpath_action, u8
|
||||
pmlmeext->mgnt_seq++;
|
||||
set_frame_sub_type(pos, IEEE80211_STYPE_ACTION);
|
||||
|
||||
pos += sizeof(struct rtw_ieee80211_hdr_3addr);
|
||||
pattrib->pktlen = sizeof(struct rtw_ieee80211_hdr_3addr);
|
||||
pos += sizeof(struct ieee80211_hdr_3addr);
|
||||
pattrib->pktlen = sizeof(struct ieee80211_hdr_3addr);
|
||||
|
||||
pos = rtw_set_fixed_ie(pos, 1, &(category), &(pattrib->pktlen));
|
||||
pos = rtw_set_fixed_ie(pos, 1, &(action), &(pattrib->pktlen));
|
||||
@@ -268,7 +268,7 @@ static int rtw_mesh_path_sel_frame_tx(enum rtw_mpath_frame_type mpath_action, u8
|
||||
break;
|
||||
case RTW_MPATH_RANN:
|
||||
RTW_HWMP_DBG("sending RANN from "MAC_FMT"\n", MAC_ARG(originator_addr));
|
||||
ie_len = sizeof(struct rtw_ieee80211_rann_ie);
|
||||
ie_len = sizeof(struct ieee80211_rann_ie);
|
||||
pattrib->pktlen += (ie_len + 2);
|
||||
*pos++ = WLAN_EID_RANN;
|
||||
break;
|
||||
@@ -327,11 +327,11 @@ int rtw_mesh_path_error_tx(_adapter *adapter,
|
||||
struct xmit_priv *pxmitpriv = &(adapter->xmitpriv);
|
||||
struct mlme_ext_priv *pmlmeext = &(adapter->mlmeextpriv);
|
||||
struct xmit_frame *pmgntframe = NULL;
|
||||
struct rtw_ieee80211_hdr *pwlanhdr = NULL;
|
||||
struct ieee80211_hdr *pwlanhdr = NULL;
|
||||
struct pkt_attrib *pattrib = NULL;
|
||||
struct rtw_mesh_info *minfo = &adapter->mesh_info;
|
||||
u8 category = WLAN_CATEGORY_MESH_ACTION;
|
||||
u8 action = RTW_ACT_MESH_HWMP_PATH_SELECTION;
|
||||
u8 action = WLAN_MESH_ACTION_HWMP_PATH_SELECTION;
|
||||
u8 *pos, ie_len;
|
||||
u16 *fctrl = NULL;
|
||||
|
||||
@@ -347,9 +347,9 @@ int rtw_mesh_path_error_tx(_adapter *adapter,
|
||||
memset(pmgntframe->buf_addr, 0, WLANHDR_OFFSET + TXDESC_OFFSET);
|
||||
|
||||
pos = (u8 *)(pmgntframe->buf_addr) + TXDESC_OFFSET;
|
||||
pwlanhdr = (struct rtw_ieee80211_hdr *)pos;
|
||||
pwlanhdr = (struct ieee80211_hdr *)pos;
|
||||
|
||||
fctrl = &(pwlanhdr->frame_ctl);
|
||||
fctrl =&pwlanhdr->frame_control;
|
||||
*(fctrl) = 0;
|
||||
|
||||
memcpy(pwlanhdr->addr1, ra, ETH_ALEN);
|
||||
@@ -360,8 +360,8 @@ int rtw_mesh_path_error_tx(_adapter *adapter,
|
||||
pmlmeext->mgnt_seq++;
|
||||
set_frame_sub_type(pos, IEEE80211_STYPE_ACTION);
|
||||
|
||||
pos += sizeof(struct rtw_ieee80211_hdr_3addr);
|
||||
pattrib->pktlen = sizeof(struct rtw_ieee80211_hdr_3addr);
|
||||
pos += sizeof(struct ieee80211_hdr_3addr);
|
||||
pattrib->pktlen = sizeof(struct ieee80211_hdr_3addr);
|
||||
|
||||
pos = rtw_set_fixed_ie(pos, 1, &(category), &(pattrib->pktlen));
|
||||
pos = rtw_set_fixed_ie(pos, 1, &(action), &(pattrib->pktlen));
|
||||
@@ -622,7 +622,7 @@ void rtw_ieee80211s_update_metric(_adapter *adapter, u8 mac_id,
|
||||
}
|
||||
|
||||
static void rtw_hwmp_preq_frame_process(_adapter *adapter,
|
||||
struct rtw_ieee80211_hdr_3addr *mgmt,
|
||||
struct ieee80211_hdr_3addr *mgmt,
|
||||
const u8 *preq_elem, u32 originator_metric)
|
||||
{
|
||||
struct rtw_mesh_info *minfo = &adapter->mesh_info;
|
||||
@@ -805,7 +805,7 @@ rtw_next_hop_deref_protected(struct rtw_mesh_path *path)
|
||||
}
|
||||
|
||||
static void rtw_hwmp_prep_frame_process(_adapter *adapter,
|
||||
struct rtw_ieee80211_hdr_3addr *mgmt,
|
||||
struct ieee80211_hdr_3addr *mgmt,
|
||||
const u8 *prep_elem, u32 metric)
|
||||
{
|
||||
struct rtw_mesh_cfg *mshcfg = &adapter->mesh_cfg;
|
||||
@@ -887,7 +887,7 @@ fail:
|
||||
}
|
||||
|
||||
static void rtw_hwmp_perr_frame_process(_adapter *adapter,
|
||||
struct rtw_ieee80211_hdr_3addr *mgmt,
|
||||
struct ieee80211_hdr_3addr *mgmt,
|
||||
const u8 *perr_elem)
|
||||
{
|
||||
struct rtw_mesh_cfg *mshcfg = &adapter->mesh_cfg;
|
||||
@@ -942,8 +942,8 @@ endperr:
|
||||
}
|
||||
|
||||
static void rtw_hwmp_rann_frame_process(_adapter *adapter,
|
||||
struct rtw_ieee80211_hdr_3addr *mgmt,
|
||||
const struct rtw_ieee80211_rann_ie *rann)
|
||||
struct ieee80211_hdr_3addr *mgmt,
|
||||
const struct ieee80211_rann_ie *rann)
|
||||
{
|
||||
struct sta_info *sta;
|
||||
struct sta_priv *pstapriv = &adapter->stapriv;
|
||||
@@ -1060,7 +1060,7 @@ static void rtw_hwmp_rann_frame_process(_adapter *adapter,
|
||||
}
|
||||
|
||||
static u32 rtw_hwmp_route_info_get(_adapter *adapter,
|
||||
struct rtw_ieee80211_hdr_3addr *mgmt,
|
||||
struct ieee80211_hdr_3addr *mgmt,
|
||||
const u8 *hwmp_ie, enum rtw_mpath_frame_type action)
|
||||
{
|
||||
struct rtw_mesh_path *path;
|
||||
@@ -1227,8 +1227,8 @@ void rtw_mesh_rx_path_sel_frame(_adapter *adapter, union recv_frame *rframe)
|
||||
struct rx_pkt_attrib *attrib = &rframe->u.hdr.attrib;
|
||||
u8 *pframe = rframe->u.hdr.rx_data, *start;
|
||||
uint frame_len = rframe->u.hdr.len, left;
|
||||
struct rtw_ieee80211_hdr_3addr *frame_hdr = (struct rtw_ieee80211_hdr_3addr *)pframe;
|
||||
u8 *frame_body = (u8 *)(pframe + sizeof(struct rtw_ieee80211_hdr_3addr));
|
||||
struct ieee80211_hdr_3addr *frame_hdr = (struct ieee80211_hdr_3addr *)pframe;
|
||||
u8 *frame_body = (u8 *)(pframe + sizeof(struct ieee80211_hdr_3addr));
|
||||
ParseRes parse_res;
|
||||
|
||||
plink = rtw_mesh_plink_get(adapter, get_addr2_ptr(pframe));
|
||||
@@ -1238,7 +1238,7 @@ void rtw_mesh_rx_path_sel_frame(_adapter *adapter, union recv_frame *rframe)
|
||||
rtw_mesh_rx_hwmp_frame_cnts(adapter, get_addr2_ptr(pframe));
|
||||
|
||||
/* Mesh action frame IE offset = 2 */
|
||||
attrib->hdrlen = sizeof(struct rtw_ieee80211_hdr_3addr);
|
||||
attrib->hdrlen = sizeof(struct ieee80211_hdr_3addr);
|
||||
left = frame_len - attrib->hdrlen - attrib->iv_len - attrib->icv_len - 2;
|
||||
start = pframe + attrib->hdrlen + 2;
|
||||
|
||||
@@ -1277,7 +1277,7 @@ void rtw_mesh_rx_path_sel_frame(_adapter *adapter, union recv_frame *rframe)
|
||||
rtw_hwmp_perr_frame_process(adapter, frame_hdr, elems.perr);
|
||||
}
|
||||
if (elems.rann)
|
||||
rtw_hwmp_rann_frame_process(adapter, frame_hdr, (struct rtw_ieee80211_rann_ie *)elems.rann);
|
||||
rtw_hwmp_rann_frame_process(adapter, frame_hdr, (struct ieee80211_rann_ie *)elems.rann);
|
||||
}
|
||||
|
||||
void rtw_mesh_queue_preq(struct rtw_mesh_path *path, u8 flags)
|
||||
|
||||
Reference in New Issue
Block a user