Merge pull request #253 from CGarces/staging_cherrypick5

Adapted commits from staging area (5)
This commit is contained in:
Carlos Garcés 2021-10-23 14:09:02 +02:00 committed by GitHub
commit 744bbe5297
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
54 changed files with 1044 additions and 2320 deletions

View File

@ -805,13 +805,13 @@ VOID efuse_PreUpdateAction(
#ifdef CONFIG_RTL8812A
BackupRegs[3] = phy_query_mac_reg(pAdapter, REG_AFE_MISC, bMaskDWord);
#endif
PlatformEFIOWrite4Byte(pAdapter, REG_RCR, 0x1);
PlatformEFIOWrite1Byte(pAdapter, REG_RXFLTMAP0, 0);
PlatformEFIOWrite1Byte(pAdapter, REG_RXFLTMAP0+1, 0);
PlatformEFIOWrite1Byte(pAdapter, REG_RXFLTMAP0+2, 0);
PlatformEFIOWrite1Byte(pAdapter, REG_RXFLTMAP0+3, 0);
PlatformEFIOWrite1Byte(pAdapter, REG_RXFLTMAP0+4, 0);
PlatformEFIOWrite1Byte(pAdapter, REG_RXFLTMAP0+5, 0);
rtw_write32(pAdapter, REG_RCR, 0x1);
rtw_write8(pAdapter, REG_RXFLTMAP0, 0);
rtw_write8(pAdapter, REG_RXFLTMAP0+1, 0);
rtw_write8(pAdapter, REG_RXFLTMAP0+2, 0);
rtw_write8(pAdapter, REG_RXFLTMAP0+3, 0);
rtw_write8(pAdapter, REG_RXFLTMAP0+4, 0);
rtw_write8(pAdapter, REG_RXFLTMAP0+5, 0);
#ifdef CONFIG_RTL8812A
/* <20140410, Kordan> 0x11 = 0x4E, lower down LX_SPS0 voltage. (Asked by Chunchu)*/
phy_set_mac_reg(pAdapter, REG_AFE_MISC, bMaskByte1, 0x4E);

View File

@ -85,19 +85,19 @@ inline u8 *rtw_set_ie_mpm(u8 *buf, u32 *buf_len
u8 data[24] = {0};
u8 *pos = data;
RTW_PUT_LE16(pos, proto_id);
*(u16 *) (pos) = cpu_to_le16(proto_id);
pos += 2;
RTW_PUT_LE16(pos, llid);
*(u16 *) (pos) = cpu_to_le16(llid);
pos += 2;
if (plid) {
RTW_PUT_LE16(pos, *plid);
*(u16 *) (pos) = cpu_to_le16(*plid));
pos += 2;
}
if (reason) {
RTW_PUT_LE16(pos, *reason);
*(u16 *) (pos) = cpu_to_le16(*reason));
pos += 2;
}
@ -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 == RTW_WLAN_CATEGORY_SELF_PROTECTED) {
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;
@ -1845,16 +1836,16 @@ unsigned int on_action_self_protected(_adapter *adapter, union recv_frame *rfram
goto exit;
category = frame_body[0];
if (category != RTW_WLAN_CATEGORY_SELF_PROTECTED)
if (category != WLAN_CATEGORY_SELF_PROTECTED)
goto exit;
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;
@ -1904,12 +1895,12 @@ unsigned int on_action_mesh(_adapter *adapter, union recv_frame *rframe)
/* check stainfo exist? */
category = frame_body[0];
if (category != RTW_WLAN_CATEGORY_MESH)
if (category != WLAN_CATEGORY_MESH_ACTION)
goto exit;
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++) = RTW_WLAN_CATEGORY_SELF_PROTECTED;
*(pos++) = RTW_ACT_SELF_PROTECTED_MESH_CLOSE;
pos += sizeof(struct ieee80211_hdr_3addr);
*(pos++) = WLAN_CATEGORY_SELF_PROTECTED;
*(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);
@ -3035,7 +3026,7 @@ void rtw_mesh_cfg_init(_adapter *adapter)
mcfg->dot11MeshHWMPpreqMinInterval = RTW_MESH_PREQ_MIN_INT;
mcfg->dot11MeshHWMPperrMinInterval = RTW_MESH_PERR_MIN_INT;
mcfg->dot11MeshHWMPnetDiameterTraversalTime = RTW_MESH_DIAM_TRAVERSAL_TIME;
mcfg->dot11MeshHWMPRootMode = RTW_IEEE80211_ROOTMODE_NO_ROOT;
mcfg->dot11MeshHWMPRootMode = IEEE80211_ROOTMODE_NO_ROOT;
mcfg->dot11MeshHWMPRannInterval = RTW_MESH_RANN_INTERVAL;
mcfg->dot11MeshGateAnnouncementProtocol = _FALSE;
mcfg->dot11MeshForwarding = _TRUE;
@ -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;

View File

@ -401,7 +401,6 @@ struct rtw_mesh_info {
};
extern const char *_action_self_protected_str[];
#define action_self_protected_str(action) ((action < RTW_ACT_SELF_PROTECTED_NUM) ? _action_self_protected_str[action] : _action_self_protected_str[0])
u8 *rtw_set_ie_mesh_id(u8 *buf, u32 *buf_len, const char *mesh_id, u8 id_len);
u8 *rtw_set_ie_mesh_config(u8 *buf, u32 *buf_len
@ -505,18 +504,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);

View File

@ -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 = RTW_WLAN_CATEGORY_MESH;
u8 action = RTW_ACT_MESH_HWMP_PATH_SELECTION;
u8 category = WLAN_CATEGORY_MESH_ACTION;
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 = RTW_WLAN_CATEGORY_MESH;
u8 action = RTW_ACT_MESH_HWMP_PATH_SELECTION;
u8 category = WLAN_CATEGORY_MESH_ACTION;
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;
@ -644,7 +644,7 @@ static void rtw_hwmp_preq_frame_process(_adapter *adapter,
target_flags = RTW_PREQ_IE_TARGET_F(preq_elem);
/* PREQ gate announcements */
flags = RTW_PREQ_IE_FLAGS(preq_elem);
preq_is_gate = !!(flags & RTW_IEEE80211_PREQ_IS_GATE_FLAG);
preq_is_gate = !!(flags & IEEE80211_PREQ_IS_GATE_FLAG);
RTW_HWMP_DBG("received PREQ from "MAC_FMT"\n", MAC_ARG(originator_addr));
@ -677,11 +677,11 @@ static void rtw_hwmp_preq_frame_process(_adapter *adapter,
}
target_sn = minfo->sn;
} else if (is_broadcast_mac_addr(target_addr) &&
(target_flags & RTW_IEEE80211_PREQ_TO_FLAG)) {
(target_flags & IEEE80211_PREQ_TO_FLAG)) {
rtw_rcu_read_lock();
path = rtw_mesh_path_lookup(adapter, originator_addr);
if (path) {
if (flags & RTW_IEEE80211_PREQ_PROACTIVE_PREP_FLAG) {
if (flags & IEEE80211_PREQ_PROACTIVE_PREP_FLAG) {
reply = _TRUE;
target_addr = adapter_mac_addr(adapter);
target_sn = ++minfo->sn;
@ -722,13 +722,13 @@ static void rtw_hwmp_preq_frame_process(_adapter *adapter,
RTW_SN_LT(path->sn, target_sn)) {
path->sn = target_sn;
path->flags |= RTW_MESH_PATH_SN_VALID;
} else if ((!(target_flags & RTW_IEEE80211_PREQ_TO_FLAG)) &&
} else if ((!(target_flags & IEEE80211_PREQ_TO_FLAG)) &&
(path->flags & RTW_MESH_PATH_ACTIVE)) {
reply = _TRUE;
target_metric = path->metric;
target_sn = path->sn;
/* Case E2 of sec 13.10.9.3 IEEE 802.11-2012*/
target_flags |= RTW_IEEE80211_PREQ_TO_FLAG;
target_flags |= IEEE80211_PREQ_TO_FLAG;
}
}
rtw_rcu_read_unlock();
@ -748,7 +748,7 @@ static void rtw_hwmp_preq_frame_process(_adapter *adapter,
RTW_HWMP_DBG("replying to the PREQ (PREQ for us)\n");
if (mshcfg->dot11MeshGateAnnouncementProtocol) {
/* BIT 7 is used to identify the prep is from mesh gate */
to_gate_ask = RTW_IEEE80211_PREQ_IS_GATE_FLAG | BIT(7);
to_gate_ask = IEEE80211_PREQ_IS_GATE_FLAG | BIT(7);
} else {
to_gate_ask = 0;
}
@ -780,7 +780,7 @@ static void rtw_hwmp_preq_frame_process(_adapter *adapter,
da = (path && path->is_root) ?
path->rann_snd_addr : bcast_addr;
if (flags & RTW_IEEE80211_PREQ_PROACTIVE_PREP_FLAG) {
if (flags & IEEE80211_PREQ_PROACTIVE_PREP_FLAG) {
target_addr = RTW_PREQ_IE_TARGET_ADDR(preq_elem);
target_sn = RTW_PREQ_IE_TARGET_SN(preq_elem);
}
@ -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;
@ -831,7 +831,7 @@ static void rtw_hwmp_prep_frame_process(_adapter *adapter,
enter_critical_bh(&path->state_lock);
path->gate_asked = false;
exit_critical_bh(&path->state_lock);
if (!(flags & RTW_IEEE80211_PREQ_IS_GATE_FLAG)) {
if (!(flags & IEEE80211_PREQ_IS_GATE_FLAG)) {
enter_critical_bh(&path->state_lock);
rtw_mesh_gate_del(adapter->mesh_info.mesh_paths, path);
exit_critical_bh(&path->state_lock);
@ -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;
@ -957,7 +957,7 @@ static void rtw_hwmp_rann_frame_process(_adapter *adapter,
ttl = rann->rann_ttl;
flags = rann->rann_flags;
root_is_gate = !!(flags & RTW_RANN_FLAG_IS_GATE);
root_is_gate = !!(flags & RANN_FLAG_IS_GATE);
originator_addr = rann->rann_addr;
originator_sn = le32_to_cpu(rann->rann_seq);
interval = le32_to_cpu(rann->rann_interval);
@ -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)
@ -1429,9 +1429,9 @@ void rtw_mesh_path_start_discovery(_adapter *adapter)
}
if (preq_node->flags & RTW_PREQ_Q_F_REFRESH)
target_flags |= RTW_IEEE80211_PREQ_TO_FLAG;
target_flags |= IEEE80211_PREQ_TO_FLAG;
else
target_flags &= ~RTW_IEEE80211_PREQ_TO_FLAG;
target_flags &= ~IEEE80211_PREQ_TO_FLAG;
#ifdef CONFIG_RTW_MESH_ADD_ROOT_CHK
is_root_add_chk = !!(path->flags & RTW_MESH_PATH_ROOT_ADD_CHK);
@ -1443,7 +1443,7 @@ void rtw_mesh_path_start_discovery(_adapter *adapter)
#ifdef CONFIG_RTW_MESH_ON_DMD_GANN
flags = (mshcfg->dot11MeshGateAnnouncementProtocol)
? RTW_IEEE80211_PREQ_IS_GATE_FLAG : 0;
? IEEE80211_PREQ_IS_GATE_FLAG : 0;
#endif
rtw_mesh_path_sel_frame_tx(RTW_MPATH_PREQ, flags, adapter_mac_addr(adapter), minfo->sn,
target_flags, path->dst, path->sn, da, 0,
@ -1516,21 +1516,21 @@ void rtw_mesh_path_tx_root_frame(_adapter *adapter)
u8 flags, target_flags = 0;
flags = (mshcfg->dot11MeshGateAnnouncementProtocol)
? RTW_RANN_FLAG_IS_GATE : 0;
? RANN_FLAG_IS_GATE : 0;
switch (mshcfg->dot11MeshHWMPRootMode) {
case RTW_IEEE80211_PROACTIVE_RANN:
case IEEE80211_PROACTIVE_RANN:
rtw_mesh_path_sel_frame_tx(RTW_MPATH_RANN, flags, adapter_mac_addr(adapter),
++minfo->sn, 0, NULL, 0, bcast_addr,
0, mshcfg->element_ttl,
interval, 0, 0, adapter);
break;
case RTW_IEEE80211_PROACTIVE_PREQ_WITH_PREP:
flags |= RTW_IEEE80211_PREQ_PROACTIVE_PREP_FLAG;
case RTW_IEEE80211_PROACTIVE_PREQ_NO_PREP:
case IEEE80211_PROACTIVE_PREQ_WITH_PREP:
flags |= IEEE80211_PREQ_PROACTIVE_PREP_FLAG;
case IEEE80211_PROACTIVE_PREQ_NO_PREP:
interval = mshcfg->dot11MeshHWMPactivePathToRootTimeout;
target_flags |= RTW_IEEE80211_PREQ_TO_FLAG |
RTW_IEEE80211_PREQ_USN_FLAG;
target_flags |= IEEE80211_PREQ_TO_FLAG |
IEEE80211_PREQ_USN_FLAG;
rtw_mesh_path_sel_frame_tx(RTW_MPATH_PREQ, flags, adapter_mac_addr(adapter),
++minfo->sn, target_flags,
(u8 *) bcast_addr, 0, bcast_addr,
@ -1570,7 +1570,7 @@ static void rtw_ieee80211_mesh_rootpath(_adapter *adapter)
rtw_mesh_path_tx_root_frame(adapter);
if (adapter->mesh_cfg.dot11MeshHWMPRootMode == RTW_IEEE80211_PROACTIVE_RANN)
if (adapter->mesh_cfg.dot11MeshHWMPRootMode == IEEE80211_PROACTIVE_RANN)
interval = adapter->mesh_cfg.dot11MeshHWMPRannInterval;
else
interval = adapter->mesh_cfg.dot11MeshHWMProotInterval;
@ -1583,7 +1583,7 @@ BOOLEAN rtw_ieee80211_mesh_root_setup(_adapter *adapter)
{
BOOLEAN root_enabled = _FALSE;
if (adapter->mesh_cfg.dot11MeshHWMPRootMode > RTW_IEEE80211_ROOTMODE_ROOT) {
if (adapter->mesh_cfg.dot11MeshHWMPRootMode > IEEE80211_ROOTMODE_ROOT) {
rtw_set_bit(RTW_MESH_WORK_ROOT, &adapter->wrkq_flags);
root_enabled = _TRUE;
}

View File

@ -268,8 +268,7 @@ void rtw_remove_bcn_ie(_adapter *padapter, WLAN_BSSID_EX *pnetwork, u8 index)
}
u8 chk_sta_is_alive(struct sta_info *psta);
u8 chk_sta_is_alive(struct sta_info *psta)
static u8 chk_sta_is_alive(struct sta_info *psta)
{
u8 ret = _FALSE;
#ifdef DBG_EXPIRATION_CHK
@ -2422,7 +2421,7 @@ int rtw_check_beacon_data(_adapter *padapter, u8 *pbuf, int len)
&& (!rfctl->country_ent || COUNTRY_CHPLAN_EN_11AC(rfctl->country_ent))
) {
/* Parsing VHT CAP IE */
p = rtw_get_ie(ie + _BEACON_IE_OFFSET_, EID_VHTCapability, &ie_len, (pbss_network->IELength - _BEACON_IE_OFFSET_));
p = rtw_get_ie(ie + _BEACON_IE_OFFSET_, WLAN_EID_VHT_CAPABILITY, &ie_len, (pbss_network->IELength - _BEACON_IE_OFFSET_));
if (p && ie_len > 0)
vht_cap = _TRUE;
@ -2453,7 +2452,7 @@ int rtw_check_beacon_data(_adapter *padapter, u8 *pbuf, int len)
SET_EXT_CAPABILITY_ELE_BSS_COEXIST(pmlmepriv->ext_capab_ie_data, 1);
pmlmepriv->ext_capab_ie_len = 10;
rtw_set_ie(pbss_network->IEs + pbss_network->IELength, EID_EXTCapability, 8, pmlmepriv->ext_capab_ie_data, &len);
rtw_set_ie(pbss_network->IEs + pbss_network->IELength, WLAN_EID_EXT_CAPABILITY, 8, pmlmepriv->ext_capab_ie_data, &len);
pbss_network->IELength += pmlmepriv->ext_capab_ie_len;
}
#endif /* CONFIG_80211N_HT */
@ -3332,8 +3331,8 @@ void rtw_process_public_act_bsscoex(_adapter *padapter, u8 *pframe, uint frame_l
struct sta_priv *pstapriv = &padapter->stapriv;
u8 beacon_updated = _FALSE;
struct mlme_priv *pmlmepriv = &(padapter->mlmepriv);
u8 *frame_body = pframe + sizeof(struct rtw_ieee80211_hdr_3addr);
uint frame_body_len = frame_len - sizeof(struct rtw_ieee80211_hdr_3addr);
u8 *frame_body = pframe + sizeof(struct ieee80211_hdr_3addr);
uint frame_body_len = frame_len - sizeof(struct ieee80211_hdr_3addr);
u8 category, action;
psta = rtw_get_stainfo(pstapriv, get_addr2_ptr(pframe));
@ -3345,7 +3344,7 @@ void rtw_process_public_act_bsscoex(_adapter *padapter, u8 *pframe, uint frame_l
action = frame_body[1];
if (frame_body_len > 0) {
if ((frame_body[2] == EID_BSSCoexistence) && (frame_body[3] > 0)) {
if ((frame_body[2] == WLAN_EID_BSS_COEX_2040) && (frame_body[3] > 0)) {
u8 ie_data = frame_body[4];
if (ie_data & RTW_WLAN_20_40_BSS_COEX_40MHZ_INTOL) {
@ -3365,8 +3364,8 @@ void rtw_process_public_act_bsscoex(_adapter *padapter, u8 *pframe, uint frame_l
}
if (frame_body_len > 8) {
/* if EID_BSSIntolerantChlReport ie exists */
if ((frame_body[5] == EID_BSSIntolerantChlReport) && (frame_body[6] > 0)) {
/* if WLAN_EID_BSS_INTOLERANT_CHL_REPORT ie exists */
if ((frame_body[5] == WLAN_EID_BSS_INTOLERANT_CHL_REPORT) && (frame_body[6] > 0)) {
/*todo:*/
if (pmlmepriv->ht_intolerant_ch_reported == _FALSE) {
pmlmepriv->ht_intolerant_ch_reported = _TRUE;
@ -4328,8 +4327,8 @@ void rtw_ap_update_bss_chbw(_adapter *adapter, WLAN_BSSID_EX *bss, u8 ch, u8 bw,
int vht_cap_ielen, vht_op_ielen;
u8 center_freq;
vht_cap_ie = rtw_get_ie((bss->IEs + sizeof(NDIS_802_11_FIXED_IEs)), EID_VHTCapability, &vht_cap_ielen, (bss->IELength - sizeof(NDIS_802_11_FIXED_IEs)));
vht_op_ie = rtw_get_ie((bss->IEs + sizeof(NDIS_802_11_FIXED_IEs)), EID_VHTOperation, &vht_op_ielen, (bss->IELength - sizeof(NDIS_802_11_FIXED_IEs)));
vht_cap_ie = rtw_get_ie((bss->IEs + sizeof(NDIS_802_11_FIXED_IEs)), WLAN_EID_VHT_CAPABILITY, &vht_cap_ielen, (bss->IELength - sizeof(NDIS_802_11_FIXED_IEs)));
vht_op_ie = rtw_get_ie((bss->IEs + sizeof(NDIS_802_11_FIXED_IEs)), WLAN_EID_VHT_OPERATION, &vht_op_ielen, (bss->IELength - sizeof(NDIS_802_11_FIXED_IEs)));
center_freq = rtw_get_center_ch(ch, bw, offset);
/* update vht cap ie */
@ -4370,8 +4369,8 @@ void rtw_ap_update_bss_chbw(_adapter *adapter, WLAN_BSSID_EX *bss, u8 ch, u8 bw,
u8 *ht_cap_ie, *ht_op_ie;
int ht_cap_ielen, ht_op_ielen;
ht_cap_ie = rtw_get_ie((bss->IEs + sizeof(NDIS_802_11_FIXED_IEs)), EID_HTCapability, &ht_cap_ielen, (bss->IELength - sizeof(NDIS_802_11_FIXED_IEs)));
ht_op_ie = rtw_get_ie((bss->IEs + sizeof(NDIS_802_11_FIXED_IEs)), EID_HTInfo, &ht_op_ielen, (bss->IELength - sizeof(NDIS_802_11_FIXED_IEs)));
ht_cap_ie = rtw_get_ie((bss->IEs + sizeof(NDIS_802_11_FIXED_IEs)), WLAN_EID_HT_CAPABILITY, &ht_cap_ielen, (bss->IELength - sizeof(NDIS_802_11_FIXED_IEs)));
ht_op_ie = rtw_get_ie((bss->IEs + sizeof(NDIS_802_11_FIXED_IEs)), WLAN_EID_HT_OPERATION, &ht_op_ielen, (bss->IELength - sizeof(NDIS_802_11_FIXED_IEs)));
/* update ht cap ie */
if (ht_cap_ie && ht_cap_ielen) {

View File

@ -176,7 +176,7 @@ static u8 _send_ht_ndpa_packet(PADAPTER adapter, u8 *ra, enum channel_width bw)
u8 ActionHdr[4] = {ACT_CAT_VENDOR, 0x00, 0xE0, 0x4C};
/* MISC */
struct pkt_attrib *attrib;
struct rtw_ieee80211_hdr *pwlanhdr;
struct ieee80211_hdr *pwlanhdr;
enum MGN_RATE txrate;
u8 *pframe;
u16 duration = 0;
@ -215,10 +215,10 @@ static u8 _send_ht_ndpa_packet(PADAPTER adapter, u8 *ra, enum channel_width bw)
memset(pmgntframe->buf_addr, 0, WLANHDR_OFFSET + TXDESC_OFFSET);
pframe = (u8 *)(pmgntframe->buf_addr) + TXDESC_OFFSET;
pwlanhdr = (struct rtw_ieee80211_hdr *)pframe;
pwlanhdr = (struct ieee80211_hdr *)pframe;
/* Frame control */
pwlanhdr->frame_ctl = 0;
pwlanhdr->frame_control = 0;
set_frame_sub_type(pframe, attrib->subtype);
set_order_bit(pframe);
@ -272,7 +272,7 @@ static u8 _send_vht_ndpa_packet(PADAPTER adapter, u8 *ra, u16 aid, enum channel_
struct ndpa_sta_info sta_info;
/* MISC */
struct pkt_attrib *attrib;
struct rtw_ieee80211_hdr *pwlanhdr;
struct ieee80211_hdr *pwlanhdr;
u8 *pframe;
enum MGN_RATE txrate;
u16 duration = 0;
@ -310,10 +310,10 @@ static u8 _send_vht_ndpa_packet(PADAPTER adapter, u8 *ra, u16 aid, enum channel_
memset(pmgntframe->buf_addr, 0, TXDESC_OFFSET + WLANHDR_OFFSET);
pframe = pmgntframe->buf_addr + TXDESC_OFFSET;
pwlanhdr = (struct rtw_ieee80211_hdr *)pframe;
pwlanhdr = (struct ieee80211_hdr *)pframe;
/* Frame control */
pwlanhdr->frame_ctl = 0;
pwlanhdr->frame_control = 0;
set_frame_sub_type(pframe, attrib->subtype);
/* Duration */
@ -379,7 +379,7 @@ static u8 _send_vht_mu_ndpa_packet(PADAPTER adapter, enum channel_width bw)
struct ndpa_sta_info sta_info;
/* MISC */
struct pkt_attrib *attrib;
struct rtw_ieee80211_hdr *pwlanhdr;
struct ieee80211_hdr *pwlanhdr;
enum MGN_RATE txrate;
u8 *pframe;
u8 *ra = NULL;
@ -427,10 +427,10 @@ static u8 _send_vht_mu_ndpa_packet(PADAPTER adapter, enum channel_width bw)
memset(pmgntframe->buf_addr, 0, TXDESC_OFFSET + WLANHDR_OFFSET);
pframe = pmgntframe->buf_addr + TXDESC_OFFSET;
pwlanhdr = (struct rtw_ieee80211_hdr *)pframe;
pwlanhdr = (struct ieee80211_hdr *)pframe;
/* Frame control */
pwlanhdr->frame_ctl = 0;
pwlanhdr->frame_control = 0;
set_frame_sub_type(pframe, attrib->subtype);
/* Duration */
@ -490,7 +490,7 @@ static u8 _send_bf_report_poll(PADAPTER adapter, u8 *ra, u8 bFinalPoll)
struct xmit_frame *pmgntframe;
/* MISC */
struct pkt_attrib *attrib;
struct rtw_ieee80211_hdr *pwlanhdr;
struct ieee80211_hdr *pwlanhdr;
u8 *pframe;
@ -519,10 +519,10 @@ static u8 _send_bf_report_poll(PADAPTER adapter, u8 *ra, u8 bFinalPoll)
memset(pmgntframe->buf_addr, 0, TXDESC_OFFSET + WLANHDR_OFFSET);
pframe = pmgntframe->buf_addr + TXDESC_OFFSET;
pwlanhdr = (struct rtw_ieee80211_hdr *)pframe;
pwlanhdr = (struct ieee80211_hdr *)pframe;
/* Frame control */
pwlanhdr->frame_ctl = 0;
pwlanhdr->frame_control = 0;
set_frame_sub_type(pframe, attrib->subtype);
/* Duration */
@ -1627,12 +1627,12 @@ u32 rtw_bf_get_report_packet(PADAPTER adapter, union recv_frame *precv_frame)
if (!bfee)
return _FAIL;
frame_body = pframe + sizeof(struct rtw_ieee80211_hdr_3addr);
frame_body = pframe + sizeof(struct ieee80211_hdr_3addr);
category = frame_body[0];
action = frame_body[1];
if ((category == RTW_WLAN_CATEGORY_VHT)
&& (action == RTW_WLAN_ACTION_VHT_COMPRESSED_BEAMFORMING)) {
if ((category == WLAN_CATEGORY_VHT)
&& (action == WLAN_VHT_ACTION_COMPRESSED_BF)) {
pMIMOCtrlField = pframe + 26;
Nc = (*pMIMOCtrlField) & 0x7;
Nr = ((*pMIMOCtrlField) & 0x38) >> 3;
@ -1646,8 +1646,8 @@ u32 rtw_bf_get_report_packet(PADAPTER adapter, union recv_frame *precv_frame)
pCSIMatrix = pMIMOCtrlField + 3 + Nc;
CSIMatrixLen = frame_len - 26 - 3 - Nc;
info->TargetCSIInfo.bVHT = _TRUE;
} else if ((category == RTW_WLAN_CATEGORY_HT)
&& (action == RTW_WLAN_ACTION_HT_COMPRESS_BEAMFORMING)) {
} else if ((category == WLAN_CATEGORY_HT)
&& (action == WLAN_HT_ACTION_COMPRESSED_BF)) {
pMIMOCtrlField = pframe + 26;
Nc = (*pMIMOCtrlField) & 0x3;
Nr = ((*pMIMOCtrlField) & 0xC) >> 2;
@ -1693,7 +1693,7 @@ u8 rtw_bf_send_vht_gid_mgnt_packet(PADAPTER adapter, u8 *ra, u8 *gid, u8 *positi
struct xmit_frame *pmgntframe;
/* MISC */
struct pkt_attrib *attrib;
struct rtw_ieee80211_hdr *wlanhdr;
struct ieee80211_hdr *wlanhdr;
u8 *pframe, *ptr;
@ -1714,9 +1714,9 @@ u8 rtw_bf_send_vht_gid_mgnt_packet(PADAPTER adapter, u8 *ra, u8 *gid, u8 *positi
memset(pmgntframe->buf_addr, 0, WLANHDR_OFFSET + TXDESC_OFFSET);
pframe = (u8 *)pmgntframe->buf_addr + TXDESC_OFFSET;
wlanhdr = (struct rtw_ieee80211_hdr *)pframe;
wlanhdr = (struct ieee80211_hdr *)pframe;
wlanhdr->frame_ctl = 0;
wlanhdr->frame_control = 0;
set_frame_sub_type(pframe, attrib->subtype);
set_duration(pframe, 0);
SetFragNum(pframe, 0);
@ -1726,8 +1726,8 @@ u8 rtw_bf_send_vht_gid_mgnt_packet(PADAPTER adapter, u8 *ra, u8 *gid, u8 *positi
memcpy(wlanhdr->addr2, adapter_mac_addr(adapter), ETH_ALEN);
memcpy(wlanhdr->addr3, get_bssid(mlmepriv), ETH_ALEN);
pframe[24] = RTW_WLAN_CATEGORY_VHT;
pframe[25] = RTW_WLAN_ACTION_VHT_GROUPID_MANAGEMENT;
pframe[24] = WLAN_CATEGORY_VHT;
pframe[25] = WLAN_VHT_ACTION_GROUPID_MGMT;
/* Set Membership Status Array */
ptr = pframe + 26;
memcpy(ptr, gid, 8);
@ -2176,7 +2176,7 @@ BOOLEAN issue_ht_sw_ndpa_packet(PADAPTER Adapter, u8 *ra, enum channel_width bw,
{
struct xmit_frame *pmgntframe;
struct pkt_attrib *pattrib;
struct rtw_ieee80211_hdr *pwlanhdr;
struct ieee80211_hdr *pwlanhdr;
struct xmit_priv *pxmitpriv = &(Adapter->xmitpriv);
struct mlme_ext_priv *pmlmeext = &Adapter->mlmeextpriv;
struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info);
@ -2209,9 +2209,9 @@ BOOLEAN issue_ht_sw_ndpa_packet(PADAPTER Adapter, u8 *ra, enum channel_width bw,
pframe = (u8 *)(pmgntframe->buf_addr) + TXDESC_OFFSET;
pwlanhdr = (struct rtw_ieee80211_hdr *)pframe;
pwlanhdr = (struct ieee80211_hdr *)pframe;
fctrl = &pwlanhdr->frame_ctl;
fctrl =&pwlanhdr->frame_control;
*(fctrl) = 0;
set_order_bit(pframe);
@ -2255,7 +2255,7 @@ BOOLEAN issue_ht_ndpa_packet(PADAPTER Adapter, u8 *ra, enum channel_width bw, u8
{
struct xmit_frame *pmgntframe;
struct pkt_attrib *pattrib;
struct rtw_ieee80211_hdr *pwlanhdr;
struct ieee80211_hdr *pwlanhdr;
struct xmit_priv *pxmitpriv = &(Adapter->xmitpriv);
struct mlme_ext_priv *pmlmeext = &Adapter->mlmeextpriv;
struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info);
@ -2285,9 +2285,9 @@ BOOLEAN issue_ht_ndpa_packet(PADAPTER Adapter, u8 *ra, enum channel_width bw, u8
pframe = (u8 *)(pmgntframe->buf_addr) + TXDESC_OFFSET;
pwlanhdr = (struct rtw_ieee80211_hdr *)pframe;
pwlanhdr = (struct ieee80211_hdr *)pframe;
fctrl = &pwlanhdr->frame_ctl;
fctrl =&pwlanhdr->frame_control;
*(fctrl) = 0;
set_order_bit(pframe);
@ -2334,7 +2334,7 @@ BOOLEAN issue_vht_sw_ndpa_packet(PADAPTER Adapter, u8 *ra, u16 aid, enum channel
{
struct xmit_frame *pmgntframe;
struct pkt_attrib *pattrib;
struct rtw_ieee80211_hdr *pwlanhdr;
struct ieee80211_hdr *pwlanhdr;
struct xmit_priv *pxmitpriv = &(Adapter->xmitpriv);
struct mlme_ext_priv *pmlmeext = &Adapter->mlmeextpriv;
struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info);
@ -2372,9 +2372,9 @@ BOOLEAN issue_vht_sw_ndpa_packet(PADAPTER Adapter, u8 *ra, u16 aid, enum channel
pframe = (u8 *)(pmgntframe->buf_addr) + TXDESC_OFFSET;
pwlanhdr = (struct rtw_ieee80211_hdr *)pframe;
pwlanhdr = (struct ieee80211_hdr *)pframe;
fctrl = &pwlanhdr->frame_ctl;
fctrl =&pwlanhdr->frame_control;
*(fctrl) = 0;
set_frame_sub_type(pframe, WIFI_NDPA);
@ -2428,7 +2428,7 @@ BOOLEAN issue_vht_ndpa_packet(PADAPTER Adapter, u8 *ra, u16 aid, enum channel_wi
{
struct xmit_frame *pmgntframe;
struct pkt_attrib *pattrib;
struct rtw_ieee80211_hdr *pwlanhdr;
struct ieee80211_hdr *pwlanhdr;
struct xmit_priv *pxmitpriv = &(Adapter->xmitpriv);
struct mlme_ext_priv *pmlmeext = &Adapter->mlmeextpriv;
struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info);
@ -2458,9 +2458,9 @@ BOOLEAN issue_vht_ndpa_packet(PADAPTER Adapter, u8 *ra, u16 aid, enum channel_wi
pframe = (u8 *)(pmgntframe->buf_addr) + TXDESC_OFFSET;
pwlanhdr = (struct rtw_ieee80211_hdr *)pframe;
pwlanhdr = (struct ieee80211_hdr *)pframe;
fctrl = &pwlanhdr->frame_ctl;
fctrl =&pwlanhdr->frame_control;
*(fctrl) = 0;
set_frame_sub_type(pframe, WIFI_NDPA);

View File

@ -811,7 +811,7 @@ int nat25_db_handle(_adapter *priv, struct sk_buff *skb, int method)
if (*((unsigned char *)&iph->daddr + 3) == 0xff) {
/* L2 is unicast but L3 is broadcast, make L2 bacome broadcast */
RTW_INFO("NAT25: Set DA as boardcast\n");
memset(skb->data, 0xff, ETH_ALEN);
eth_broadcast_addr(skb->data);
} else {
/* forward unknow IP packet to upper TCP/IP */
RTW_INFO("NAT25: Replace DA with BR's MAC\n");

View File

@ -21,7 +21,6 @@
u8 RTW_WPA_OUI_TYPE[] = { 0x00, 0x50, 0xf2, 1 };
u16 RTW_WPA_VERSION = 1;
u8 WPA_AUTH_KEY_MGMT_NONE[] = { 0x00, 0x50, 0xf2, 0 };
u8 WPA_AUTH_KEY_MGMT_UNSPEC_802_1X[] = { 0x00, 0x50, 0xf2, 1 };
u8 WPA_AUTH_KEY_MGMT_PSK_OVER_802_1X[] = { 0x00, 0x50, 0xf2, 2 };
@ -282,8 +281,8 @@ inline u8 *rtw_set_ie_mesh_ch_switch_parm(u8 *buf, u32 *buf_len, u8 ttl,
ie_data[0] = ttl;
ie_data[1] = flags;
RTW_PUT_LE16((u8 *)&ie_data[2], reason);
RTW_PUT_LE16((u8 *)&ie_data[4], precedence);
*(u16 *)(ie_data+2) = cpu_to_le16(reason);
*(u16 *)(ie_data+4) = cpu_to_le16(precedence);
return rtw_set_ie(buf, 0x118, 6, ie_data, buf_len);
}
@ -483,18 +482,13 @@ void rtw_set_supported_rate(u8 *SupportedRates, uint mode)
}
}
uint rtw_get_rateset_len(u8 *rateset)
uint rtw_get_rateset_len(u8 *rateset)
{
uint i = 0;
while (1) {
if ((rateset[i]) == 0)
break;
uint i;
if (i > 12)
for (i = 0; i < 13; i++)
if (rateset[i] == 0)
break;
i++;
}
return i;
}
@ -592,7 +586,7 @@ unsigned char *rtw_get_wpa_ie(unsigned char *pie, int *wpa_ie_len, int limit)
int limit_new = limit;
while (1) {
pbuf = rtw_get_ie(pbuf, _WPA_IE_ID_, &len, limit_new);
pbuf = rtw_get_ie(pbuf, WLAN_EID_VENDOR_SPECIFIC, &len, limit_new);
if (pbuf) {
@ -638,7 +632,7 @@ check_next_ie:
unsigned char *rtw_get_wpa2_ie(unsigned char *pie, int *rsn_ie_len, int limit)
{
return rtw_get_ie(pie, _WPA2_IE_ID_, rsn_ie_len, limit);
return rtw_get_ie(pie, WLAN_EID_RSN, rsn_ie_len, limit);
}
@ -724,7 +718,7 @@ int rtw_parse_wpa_ie(u8 *wpa_ie, int wpa_ie_len, int *group_cipher,
}
if ((*wpa_ie != _WPA_IE_ID_) || (*(wpa_ie + 1) != (u8)(wpa_ie_len - 2)) ||
if ((*wpa_ie != WLAN_EID_VENDOR_SPECIFIC) || (*(wpa_ie + 1) != (u8)(wpa_ie_len - 2)) ||
(_rtw_memcmp(wpa_ie + 2, RTW_WPA_OUI_TYPE, WPA_SELECTOR_LEN) != _TRUE))
return _FAIL;
@ -982,7 +976,7 @@ int rtw_get_sec_ie(u8 *in_ie, uint in_len, u8 *rsn_ie, u16 *rsn_len, u8 *wpa_ie,
while (cnt < in_len) {
authmode = in_ie[cnt];
if ((authmode == _WPA_IE_ID_) && (_rtw_memcmp(&in_ie[cnt + 2], &wpa_oui[0], 4) == _TRUE)) {
if ((authmode == WLAN_EID_VENDOR_SPECIFIC) && (_rtw_memcmp(&in_ie[cnt + 2], &wpa_oui[0], 4) == _TRUE)) {
if (wpa_ie)
memcpy(wpa_ie, &in_ie[cnt], in_ie[cnt + 1] + 2);
@ -990,7 +984,7 @@ int rtw_get_sec_ie(u8 *in_ie, uint in_len, u8 *rsn_ie, u16 *rsn_len, u8 *wpa_ie,
*wpa_len = in_ie[cnt + 1] + 2;
cnt += in_ie[cnt + 1] + 2; /* get next */
} else {
if (authmode == _WPA2_IE_ID_) {
if (authmode == WLAN_EID_RSN) {
if (rsn_ie)
memcpy(rsn_ie, &in_ie[cnt], in_ie[cnt + 1] + 2);
@ -1019,7 +1013,7 @@ u8 rtw_is_wps_ie(u8 *ie_ptr, uint *wps_ielen)
eid = ie_ptr[0];
if ((eid == _WPA_IE_ID_) && (_rtw_memcmp(&ie_ptr[2], wps_oui, 4) == _TRUE)) {
if ((eid == WLAN_EID_VENDOR_SPECIFIC) && (_rtw_memcmp(&ie_ptr[2], wps_oui, 4) == _TRUE)) {
/* RTW_INFO("==> found WPS_IE.....\n"); */
*wps_ielen = ie_ptr[1] + 2;
match = _TRUE;
@ -1214,13 +1208,13 @@ static int rtw_ieee802_11_parse_vendor_specific(u8 *pos, uint elen,
/* Microsoft/Wi-Fi information elements are further typed and
* subtyped */
switch (pos[3]) {
case 1:
case WLAN_OUI_TYPE_MICROSOFT_WPA:
/* Microsoft OUI (00:50:F2) with OUI Type 1:
* real WPA information element */
elems->wpa_ie = pos;
elems->wpa_ie_len = elen;
break;
case WME_OUI_TYPE: /* this is a Wi-Fi WME info. element */
case WLAN_OUI_TYPE_MICROSOFT_WMM: /* this is a Wi-Fi WME info. element */
if (elen < 5) {
RTW_DBG("short WME "
"information element ignored "
@ -1246,7 +1240,7 @@ static int rtw_ieee802_11_parse_vendor_specific(u8 *pos, uint elen,
return -1;
}
break;
case 4:
case WLAN_OUI_TYPE_MICROSOFT_WPS:
/* Wi-Fi Protected Setup (WPS) IE */
elems->wps_ie = pos;
elems->wps_ie_len = elen;
@ -1295,7 +1289,7 @@ static int rtw_ieee802_11_parse_vendor_specific(u8 *pos, uint elen,
* @show_errors: Whether to show parsing errors in debug log
* Returns: Parsing result
*/
ParseRes rtw_ieee802_11_parse_elems(u8 *start, uint len,
enum ParseRes rtw_ieee802_11_parse_elems(u8 *start, uint len,
struct rtw_ieee802_11_elems *elems,
int show_errors)
{
@ -1776,13 +1770,13 @@ void rtw_ies_get_chbw(u8 *ies, int ies_len, u8 *ch, u8 *bw, u8 *offset, u8 ht, u
u8 *ht_cap_ie, *ht_op_ie;
int ht_cap_ielen, ht_op_ielen;
ht_cap_ie = rtw_get_ie(ies, EID_HTCapability, &ht_cap_ielen, ies_len);
ht_cap_ie = rtw_get_ie(ies, WLAN_EID_HT_CAPABILITY, &ht_cap_ielen, ies_len);
if (ht_cap_ie && ht_cap_ielen) {
if (GET_HT_CAP_ELE_CHL_WIDTH(ht_cap_ie + 2))
*bw = CHANNEL_WIDTH_40;
}
ht_op_ie = rtw_get_ie(ies, EID_HTInfo, &ht_op_ielen, ies_len);
ht_op_ie = rtw_get_ie(ies, WLAN_EID_HT_OPERATION, &ht_op_ielen, ies_len);
if (ht_op_ie && ht_op_ielen) {
if (*ch == 0)
*ch = GET_HT_OP_ELE_PRI_CHL(ht_op_ie + 2);
@ -1811,7 +1805,7 @@ void rtw_ies_get_chbw(u8 *ies, int ies_len, u8 *ch, u8 *bw, u8 *offset, u8 ht, u
u8 *vht_op_ie;
int vht_op_ielen;
vht_op_ie = rtw_get_ie(ies, EID_VHTOperation, &vht_op_ielen, ies_len);
vht_op_ie = rtw_get_ie(ies, WLAN_EID_VHT_OPERATION, &vht_op_ielen, ies_len);
if (vht_op_ie && vht_op_ielen) {
if (GET_VHT_OPERATION_ELE_CHL_WIDTH(vht_op_ie + 2) >= 1)
*bw = CHANNEL_WIDTH_80;
@ -2169,8 +2163,7 @@ u32 rtw_set_p2p_attr_content(u8 *pbuf, u8 attr_id, u16 attr_len, u8 *pdata_attr)
*pbuf = attr_id;
/* *(u16*)(pbuf + 1) = cpu_to_le16(attr_len); */
RTW_PUT_LE16(pbuf + 1, attr_len);
*(u16 *)(pbuf + 1) = cpu_to_le16(attr_len);
if (pdata_attr)
memcpy(pbuf + 3, pdata_attr, attr_len);
@ -2664,50 +2657,6 @@ void rtw_bss_ex_del_wfd_attr(WLAN_BSSID_EX *bss_ex, u8 attr_id)
}
}
/* Baron adds to avoid FreeBSD warning */
int ieee80211_is_empty_essid(const char *essid, int essid_len)
{
/* Single white space is for Linksys APs */
if (essid_len == 1 && essid[0] == ' ')
return 1;
/* Otherwise, if the entire essid is 0, we assume it is hidden */
while (essid_len) {
essid_len--;
if (essid[essid_len] != '\0')
return 0;
}
return 1;
}
int ieee80211_get_hdrlen(u16 fc)
{
int hdrlen = 24;
switch (WLAN_FC_GET_TYPE(fc)) {
case RTW_IEEE80211_FTYPE_DATA:
if (fc & RTW_IEEE80211_STYPE_QOS_DATA)
hdrlen += 2;
if ((fc & RTW_IEEE80211_FCTL_FROMDS) && (fc & RTW_IEEE80211_FCTL_TODS))
hdrlen += 6; /* Addr4 */
break;
case RTW_IEEE80211_FTYPE_CTL:
switch (WLAN_FC_GET_STYPE(fc)) {
case RTW_IEEE80211_STYPE_CTS:
case RTW_IEEE80211_STYPE_ACK:
hdrlen = 10;
break;
default:
hdrlen = 16;
break;
}
break;
}
return hdrlen;
}
u8 rtw_ht_mcsset_to_nss(u8 *supp_mcs_set)
{
u8 nss = 1;
@ -2820,22 +2769,22 @@ u16 rtw_mcs_rate(u8 rf_type, u8 bw_40MHz, u8 short_GI, unsigned char *MCS_rate)
int rtw_action_frame_parse(const u8 *frame, u32 frame_len, u8 *category, u8 *action)
{
const u8 *frame_body = frame + sizeof(struct rtw_ieee80211_hdr_3addr);
const u8 *frame_body = frame + sizeof(struct ieee80211_hdr_3addr);
u16 fc;
u8 c;
u8 a = ACT_PUBLIC_MAX;
fc = le16_to_cpu(((struct rtw_ieee80211_hdr_3addr *)frame)->frame_ctl);
fc = le16_to_cpu(((struct ieee80211_hdr_3addr *)frame)->frame_control);
if ((fc & (RTW_IEEE80211_FCTL_FTYPE | RTW_IEEE80211_FCTL_STYPE))
!= (RTW_IEEE80211_FTYPE_MGMT | RTW_IEEE80211_STYPE_ACTION)
if ((fc & ( IEEE80211_FCTL_FTYPE | IEEE80211_FCTL_STYPE))
!= (IEEE80211_FTYPE_MGMT | IEEE80211_STYPE_ACTION)
)
return _FALSE;
c = frame_body[0];
switch (c) {
case RTW_WLAN_CATEGORY_P2P: /* vendor-specific */
case WLAN_CATEGORY_VENDOR_SPECIFIC: /* vendor-specific */
break;
default:
a = frame_body[1];
@ -2849,29 +2798,3 @@ int rtw_action_frame_parse(const u8 *frame, u32 frame_len, u8 *category, u8 *act
return _TRUE;
}
static const char *_action_public_str[] = {
"ACT_PUB_BSSCOEXIST",
"ACT_PUB_DSE_ENABLE",
"ACT_PUB_DSE_DEENABLE",
"ACT_PUB_DSE_REG_LOCATION",
"ACT_PUB_EXT_CHL_SWITCH",
"ACT_PUB_DSE_MSR_REQ",
"ACT_PUB_DSE_MSR_RPRT",
"ACT_PUB_MP",
"ACT_PUB_DSE_PWR_CONSTRAINT",
"ACT_PUB_VENDOR",
"ACT_PUB_GAS_INITIAL_REQ",
"ACT_PUB_GAS_INITIAL_RSP",
"ACT_PUB_GAS_COMEBACK_REQ",
"ACT_PUB_GAS_COMEBACK_RSP",
"ACT_PUB_TDLS_DISCOVERY_RSP",
"ACT_PUB_LOCATION_TRACK",
"ACT_PUB_RSVD",
};
const char *action_public_str(u8 action)
{
action = (action >= ACT_PUBLIC_MAX) ? ACT_PUBLIC_MAX : action;
return _action_public_str[action];
}

View File

@ -60,7 +60,7 @@ jackson@realtek.com.tw
#endif
u8 _rtw_read8(_adapter *adapter, u32 addr)
u8 rtw_read8(_adapter *adapter, u32 addr)
{
u8 r_val;
/* struct io_queue *pio_queue = (struct io_queue *)adapter->pio_queue; */
@ -73,7 +73,7 @@ u8 _rtw_read8(_adapter *adapter, u32 addr)
return r_val;
}
u16 _rtw_read16(_adapter *adapter, u32 addr)
u16 rtw_read16(_adapter *adapter, u32 addr)
{
u16 r_val;
/* struct io_queue *pio_queue = (struct io_queue *)adapter->pio_queue; */
@ -86,7 +86,7 @@ u16 _rtw_read16(_adapter *adapter, u32 addr)
return rtw_le16_to_cpu(r_val);
}
u32 _rtw_read32(_adapter *adapter, u32 addr)
u32 rtw_read32(_adapter *adapter, u32 addr)
{
u32 r_val;
/* struct io_queue *pio_queue = (struct io_queue *)adapter->pio_queue; */
@ -100,7 +100,7 @@ u32 _rtw_read32(_adapter *adapter, u32 addr)
}
int _rtw_write8(_adapter *adapter, u32 addr, u8 val)
int rtw_write8(_adapter *adapter, u32 addr, u8 val)
{
/* struct io_queue *pio_queue = (struct io_queue *)adapter->pio_queue; */
struct io_priv *pio_priv = &adapter->iopriv;
@ -113,7 +113,7 @@ int _rtw_write8(_adapter *adapter, u32 addr, u8 val)
return RTW_STATUS_CODE(ret);
}
int _rtw_write16(_adapter *adapter, u32 addr, u16 val)
int rtw_write16(_adapter *adapter, u32 addr, u16 val)
{
/* struct io_queue *pio_queue = (struct io_queue *)adapter->pio_queue; */
struct io_priv *pio_priv = &adapter->iopriv;
@ -127,7 +127,7 @@ int _rtw_write16(_adapter *adapter, u32 addr, u16 val)
return RTW_STATUS_CODE(ret);
}
int _rtw_write32(_adapter *adapter, u32 addr, u32 val)
int rtw_write32(_adapter *adapter, u32 addr, u32 val)
{
/* struct io_queue *pio_queue = (struct io_queue *)adapter->pio_queue; */
struct io_priv *pio_priv = &adapter->iopriv;
@ -142,7 +142,7 @@ int _rtw_write32(_adapter *adapter, u32 addr, u32 val)
return RTW_STATUS_CODE(ret);
}
int _rtw_writeN(_adapter *adapter, u32 addr , u32 length , u8 *pdata)
int rtw_writeN(_adapter *adapter, u32 addr , u32 length , u8 *pdata)
{
/* struct io_queue *pio_queue = (struct io_queue *)adapter->pio_queue; */
struct io_priv *pio_priv = &adapter->iopriv;
@ -717,90 +717,6 @@ bool match_rf_write_sniff_ranges(_adapter *adapter, u8 path, u32 addr, u32 mask)
return _FALSE;
}
u8 dbg_rtw_read8(_adapter *adapter, u32 addr, const char *caller, const int line)
{
u8 val = _rtw_read8(adapter, addr);
const struct rtw_io_sniff_ent *ent = match_read_sniff(adapter, addr, 1, val);
if (ent) {
RTW_INFO("DBG_IO %s:%d rtw_read8(0x%04x) return 0x%02x %s\n"
, caller, line, addr, val, rtw_io_sniff_ent_get_tag(ent));
}
return val;
}
u16 dbg_rtw_read16(_adapter *adapter, u32 addr, const char *caller, const int line)
{
u16 val = _rtw_read16(adapter, addr);
const struct rtw_io_sniff_ent *ent = match_read_sniff(adapter, addr, 2, val);
if (ent) {
RTW_INFO("DBG_IO %s:%d rtw_read16(0x%04x) return 0x%04x %s\n"
, caller, line, addr, val, rtw_io_sniff_ent_get_tag(ent));
}
return val;
}
u32 dbg_rtw_read32(_adapter *adapter, u32 addr, const char *caller, const int line)
{
u32 val = _rtw_read32(adapter, addr);
const struct rtw_io_sniff_ent *ent = match_read_sniff(adapter, addr, 4, val);
if (ent) {
RTW_INFO("DBG_IO %s:%d rtw_read32(0x%04x) return 0x%08x %s\n"
, caller, line, addr, val, rtw_io_sniff_ent_get_tag(ent));
}
return val;
}
int dbg_rtw_write8(_adapter *adapter, u32 addr, u8 val, const char *caller, const int line)
{
const struct rtw_io_sniff_ent *ent = match_write_sniff(adapter, addr, 1, val);
if (ent) {
RTW_INFO("DBG_IO %s:%d rtw_write8(0x%04x, 0x%02x) %s\n"
, caller, line, addr, val, rtw_io_sniff_ent_get_tag(ent));
}
return _rtw_write8(adapter, addr, val);
}
int dbg_rtw_write16(_adapter *adapter, u32 addr, u16 val, const char *caller, const int line)
{
const struct rtw_io_sniff_ent *ent = match_write_sniff(adapter, addr, 2, val);
if (ent) {
RTW_INFO("DBG_IO %s:%d rtw_write16(0x%04x, 0x%04x) %s\n"
, caller, line, addr, val, rtw_io_sniff_ent_get_tag(ent));
}
return _rtw_write16(adapter, addr, val);
}
int dbg_rtw_write32(_adapter *adapter, u32 addr, u32 val, const char *caller, const int line)
{
const struct rtw_io_sniff_ent *ent = match_write_sniff(adapter, addr, 4, val);
if (ent) {
RTW_INFO("DBG_IO %s:%d rtw_write32(0x%04x, 0x%08x) %s\n"
, caller, line, addr, val, rtw_io_sniff_ent_get_tag(ent));
}
return _rtw_write32(adapter, addr, val);
}
int dbg_rtw_writeN(_adapter *adapter, u32 addr , u32 length , u8 *data, const char *caller, const int line)
{
const struct rtw_io_sniff_ent *ent = match_write_sniff(adapter, addr, length, 0);
if (ent) {
RTW_INFO("DBG_IO %s:%d rtw_writeN(0x%04x, %u) %s\n"
, caller, line, addr, length, rtw_io_sniff_ent_get_tag(ent));
}
return _rtw_writeN(adapter, addr, length, data);
}
#ifdef CONFIG_SDIO_HCI
u8 dbg_rtw_sd_f0_read8(_adapter *adapter, u32 addr, const char *caller, const int line)
{

View File

@ -118,7 +118,6 @@ int _rtw_IOL_append_WB_cmd(struct xmit_frame *xmit_frame, u16 addr, u8 value, u8
{
struct ioreg_cfg cmd = {8, IOREG_CMD_WB_REG, 0x0, 0x0, 0x0};
/* RTW_PUT_LE16((u8*)&cmd.address, addr); */
/* RTW_PUT_LE32((u8*)&cmd.value, (u32)value); */
cmd.address = cpu_to_le16(addr);
cmd.data = cpu_to_le32(value);
@ -138,7 +137,6 @@ int _rtw_IOL_append_WW_cmd(struct xmit_frame *xmit_frame, u16 addr, u16 value, u
{
struct ioreg_cfg cmd = {8, IOREG_CMD_WW_REG, 0x0, 0x0, 0x0};
/* RTW_PUT_LE16((u8*)&cmd.address, addr); */
/* RTW_PUT_LE32((u8*)&cmd.value, (u32)value); */
cmd.address = cpu_to_le16(addr);
cmd.data = cpu_to_le32(value);
@ -158,7 +156,6 @@ int _rtw_IOL_append_WD_cmd(struct xmit_frame *xmit_frame, u16 addr, u32 value, u
{
struct ioreg_cfg cmd = {8, IOREG_CMD_WD_REG, 0x0, 0x0, 0x0};
/* RTW_PUT_LE16((u8*)&cmd.address, addr); */
/* RTW_PUT_LE32((u8*)&cmd.value, (u32)value); */
cmd.address = cpu_to_le16(addr);
cmd.data = cpu_to_le32(value);
@ -179,7 +176,6 @@ int _rtw_IOL_append_WRF_cmd(struct xmit_frame *xmit_frame, u8 rf_path, u16 addr,
{
struct ioreg_cfg cmd = {8, IOREG_CMD_W_RF, 0x0, 0x0, 0x0};
/* RTW_PUT_LE16((u8*)&cmd.address, addr); */
/* RTW_PUT_LE32((u8*)&cmd.value, (u32)value); */
cmd.address = (rf_path << 8) | ((addr) & 0xFF);
cmd.data = cpu_to_le32(value);
@ -201,7 +197,6 @@ int _rtw_IOL_append_WRF_cmd(struct xmit_frame *xmit_frame, u8 rf_path, u16 addr,
int rtw_IOL_append_DELAY_US_cmd(struct xmit_frame *xmit_frame, u16 us)
{
struct ioreg_cfg cmd = {4, IOREG_CMD_DELAY_US, 0x0, 0x0, 0x0};
/* RTW_PUT_LE16((u8*)&cmd.address, us); */
cmd.address = cpu_to_le16(us);
/* RTW_INFO("%s %u\n", __FUNCTION__, us); */
@ -212,7 +207,6 @@ int rtw_IOL_append_DELAY_MS_cmd(struct xmit_frame *xmit_frame, u16 ms)
{
struct ioreg_cfg cmd = {4, IOREG_CMD_DELAY_US, 0x0, 0x0, 0x0};
/* RTW_PUT_LE16((u8*)&cmd.address, ms); */
cmd.address = cpu_to_le16(ms);
/* RTW_INFO("%s %u\n", __FUNCTION__, ms); */

View File

@ -4321,7 +4321,7 @@ int rtw_rsn_sync_pmkid(_adapter *adapter, u8 *ie, uint ie_len, int i_ent)
} else
info.pmkid_cnt = 0; /* update new pmkid_cnt */
RTW_PUT_LE16(info.pmkid_list - 2, info.pmkid_cnt);
*(u16 *)(info.pmkid_list - 2) = cpu_to_le16(info.pmkid_cnt);
if (info.gmcs)
memcpy(info.pmkid_list + 16 * info.pmkid_cnt, gm_cs, 4);
@ -4350,15 +4350,15 @@ sint rtw_restruct_sec_ie(_adapter *adapter, u8 *out_ie)
uint ndisauthmode = psecuritypriv->ndisauthtype;
if ((ndisauthmode == Ndis802_11AuthModeWPA) || (ndisauthmode == Ndis802_11AuthModeWPAPSK))
authmode = _WPA_IE_ID_;
authmode = WLAN_EID_VENDOR_SPECIFIC;
if ((ndisauthmode == Ndis802_11AuthModeWPA2) || (ndisauthmode == Ndis802_11AuthModeWPA2PSK))
authmode = _WPA2_IE_ID_;
authmode = WLAN_EID_RSN;
if (check_fwstate(pmlmepriv, WIFI_UNDER_WPS)) {
memcpy(out_ie, psecuritypriv->wps_ie, psecuritypriv->wps_ie_len);
ielength = psecuritypriv->wps_ie_len;
} else if ((authmode == _WPA_IE_ID_) || (authmode == _WPA2_IE_ID_)) {
} else if ((authmode == WLAN_EID_VENDOR_SPECIFIC) || (authmode == WLAN_EID_RSN)) {
/* copy RSN or SSN */
memcpy(out_ie, psecuritypriv->supplicant_ie, psecuritypriv->supplicant_ie[1] + 2);
/* debug for CONFIG_IEEE80211W
@ -5118,7 +5118,7 @@ void rtw_append_exented_cap(_adapter *padapter, u8 *out_ie, uint *pout_len)
transmit the Extended Capabilities element.
*/
if (_FALSE == _rtw_memcmp(cap_content, null_content, 8))
pframe = rtw_set_ie(out_ie + *pout_len, EID_EXTCapability, 8, cap_content , pout_len);
pframe = rtw_set_ie(out_ie + *pout_len, WLAN_EID_EXT_CAPABILITY, 8, cap_content , pout_len);
}
#endif

File diff suppressed because it is too large Load Diff

View File

@ -331,7 +331,7 @@ void mpt_InitHWConfig(PADAPTER Adapter)
phy_set_mac_reg(Adapter, 0x4C , BIT23, 0); /*select DPDT_P and DPDT_N as output pin*/
#ifdef CONFIG_RTL8814A
else if (IS_HARDWARE_TYPE_8814A(Adapter))
PlatformEFIOWrite2Byte(Adapter, REG_RXFLTMAP1_8814A, 0x2000);
rtw_write16(Adapter, REG_RXFLTMAP1_8814A, 0x2000);
#endif
#ifdef CONFIG_RTL8812A
@ -346,7 +346,7 @@ void mpt_InitHWConfig(PADAPTER Adapter)
else if (IS_HARDWARE_TYPE_8822B(Adapter)) {
u32 tmp_reg = 0;
PlatformEFIOWrite2Byte(Adapter, REG_RXFLTMAP1_8822B, 0x2000);
rtw_write16(Adapter, REG_RXFLTMAP1_8822B, 0x2000);
/* fixed wifi can't 2.4g tx suggest by Szuyitasi 20160504 */
phy_set_bb_reg(Adapter, 0x70, bMaskByte3, 0x0e);
RTW_INFO(" 0x73 = 0x%x\n", phy_query_bb_reg(Adapter, 0x70, bMaskByte3));
@ -358,7 +358,7 @@ void mpt_InitHWConfig(PADAPTER Adapter)
#endif /* CONFIG_RTL8822B */
#ifdef CONFIG_RTL8821C
else if (IS_HARDWARE_TYPE_8821C(Adapter))
PlatformEFIOWrite2Byte(Adapter, REG_RXFLTMAP1_8821C, 0x2000);
rtw_write16(Adapter, REG_RXFLTMAP1_8821C, 0x2000);
#endif /* CONFIG_RTL8821C */
#if defined(CONFIG_RTL8188F) || defined(CONFIG_RTL8188GTV)
else if (IS_HARDWARE_TYPE_8188F(Adapter) || IS_HARDWARE_TYPE_8188GTV(Adapter)) {
@ -1830,7 +1830,7 @@ void SetPacketTx(PADAPTER padapter)
{
u8 *ptr, *pkt_start, *pkt_end;
u32 pkt_size, i;
struct rtw_ieee80211_hdr *hdr;
struct ieee80211_hdr *hdr;
u8 payload;
bool bmcast;
struct pkt_attrib *pattrib;
@ -1943,8 +1943,8 @@ void SetPacketTx(PADAPTER padapter)
#endif
/* 3 4. make wlan header, make_wlanhdr() */
hdr = (struct rtw_ieee80211_hdr *)pkt_start;
set_frame_sub_type(&hdr->frame_ctl, pattrib->subtype);
hdr = (struct ieee80211_hdr *)pkt_start;
set_frame_sub_type(&hdr->frame_control, pattrib->subtype);
memcpy(hdr->addr1, pattrib->dst, ETH_ALEN); /* DA */
memcpy(hdr->addr2, pattrib->src, ETH_ALEN); /* SA */

View File

@ -2249,7 +2249,7 @@ unsigned int mp_ioctl_xmit_packet_hdl(struct oid_par_priv *poid_par_priv)
unsigned char *pframe, *pmp_pkt;
struct ethhdr *pethhdr;
struct pkt_attrib *pattrib;
struct rtw_ieee80211_hdr *pwlanhdr;
struct ieee80211_hdr *pwlanhdr;
unsigned short *fctrl;
int llc_sz, payload_len;
struct mp_xmit_frame *pxframe = NULL;
@ -2295,9 +2295,9 @@ unsigned int mp_ioctl_xmit_packet_hdl(struct oid_par_priv *poid_par_priv)
memset(pxframe->mem, 0 , WLANHDR_OFFSET);
pframe = (u8 *)(pxframe->mem) + WLANHDR_OFFSET;
pwlanhdr = (struct rtw_ieee80211_hdr *)pframe;
pwlanhdr = (struct ieee80211_hdr *)pframe;
fctrl = &(pwlanhdr->frame_ctl);
fctrl =&pwlanhdr->frame_control;
*(fctrl) = 0;
set_frame_sub_type(pframe, (IEEE80211_FTYPE_DATA | IEEE80211_STYPE_DATA));

View File

@ -143,12 +143,12 @@ static void issue_group_disc_req(struct wifidirect_info *pwdinfo, u8 *da)
struct xmit_frame *pmgntframe;
struct pkt_attrib *pattrib;
unsigned char *pframe;
struct rtw_ieee80211_hdr *pwlanhdr;
struct ieee80211_hdr *pwlanhdr;
unsigned short *fctrl;
_adapter *padapter = pwdinfo->padapter;
struct xmit_priv *pxmitpriv = &(padapter->xmitpriv);
struct mlme_ext_priv *pmlmeext = &(padapter->mlmeextpriv);
unsigned char category = RTW_WLAN_CATEGORY_P2P;/* P2P action frame */
unsigned char category = WLAN_CATEGORY_VENDOR_SPECIFIC;/* P2P action frame */
u32 p2poui = cpu_to_be32(P2POUI);
u8 oui_subtype = P2P_GO_DISC_REQUEST;
u8 dialogToken = 0;
@ -166,9 +166,9 @@ static void issue_group_disc_req(struct wifidirect_info *pwdinfo, u8 *da)
memset(pmgntframe->buf_addr, 0, WLANHDR_OFFSET + TXDESC_OFFSET);
pframe = (u8 *)(pmgntframe->buf_addr) + TXDESC_OFFSET;
pwlanhdr = (struct rtw_ieee80211_hdr *)pframe;
pwlanhdr = (struct ieee80211_hdr *)pframe;
fctrl = &(pwlanhdr->frame_ctl);
fctrl =&pwlanhdr->frame_control;
*(fctrl) = 0;
memcpy(pwlanhdr->addr1, da, ETH_ALEN);
@ -179,8 +179,8 @@ static void issue_group_disc_req(struct wifidirect_info *pwdinfo, u8 *da)
pmlmeext->mgnt_seq++;
set_frame_sub_type(pframe, IEEE80211_STYPE_ACTION);
pframe += sizeof(struct rtw_ieee80211_hdr_3addr);
pattrib->pktlen = sizeof(struct rtw_ieee80211_hdr_3addr);
pframe += sizeof(struct ieee80211_hdr_3addr);
pattrib->pktlen = sizeof(struct ieee80211_hdr_3addr);
/* Build P2P action frame header */
pframe = rtw_set_fixed_ie(pframe, 1, &(category), &(pattrib->pktlen));
@ -201,12 +201,12 @@ static void issue_p2p_devdisc_resp(struct wifidirect_info *pwdinfo, u8 *da, u8 s
struct xmit_frame *pmgntframe;
struct pkt_attrib *pattrib;
unsigned char *pframe;
struct rtw_ieee80211_hdr *pwlanhdr;
struct ieee80211_hdr *pwlanhdr;
unsigned short *fctrl;
_adapter *padapter = pwdinfo->padapter;
struct xmit_priv *pxmitpriv = &(padapter->xmitpriv);
struct mlme_ext_priv *pmlmeext = &(padapter->mlmeextpriv);
unsigned char category = RTW_WLAN_CATEGORY_PUBLIC;
unsigned char category = WLAN_CATEGORY_PUBLIC;
u8 action = P2P_PUB_ACTION_ACTION;
u32 p2poui = cpu_to_be32(P2POUI);
u8 oui_subtype = P2P_DEVDISC_RESP;
@ -226,9 +226,9 @@ static void issue_p2p_devdisc_resp(struct wifidirect_info *pwdinfo, u8 *da, u8 s
memset(pmgntframe->buf_addr, 0, WLANHDR_OFFSET + TXDESC_OFFSET);
pframe = (u8 *)(pmgntframe->buf_addr) + TXDESC_OFFSET;
pwlanhdr = (struct rtw_ieee80211_hdr *)pframe;
pwlanhdr = (struct ieee80211_hdr *)pframe;
fctrl = &(pwlanhdr->frame_ctl);
fctrl =&pwlanhdr->frame_control;
*(fctrl) = 0;
memcpy(pwlanhdr->addr1, da, ETH_ALEN);
@ -239,8 +239,8 @@ static void issue_p2p_devdisc_resp(struct wifidirect_info *pwdinfo, u8 *da, u8 s
pmlmeext->mgnt_seq++;
set_frame_sub_type(pframe, IEEE80211_STYPE_ACTION);
pframe += sizeof(struct rtw_ieee80211_hdr_3addr);
pattrib->pktlen = sizeof(struct rtw_ieee80211_hdr_3addr);
pframe += sizeof(struct ieee80211_hdr_3addr);
pattrib->pktlen = sizeof(struct ieee80211_hdr_3addr);
/* Build P2P public action frame header */
pframe = rtw_set_fixed_ie(pframe, 1, &(category), &(pattrib->pktlen));
@ -272,7 +272,7 @@ static void issue_p2p_devdisc_resp(struct wifidirect_info *pwdinfo, u8 *da, u8 s
static void issue_p2p_provision_resp(struct wifidirect_info *pwdinfo, u8 *raddr, u8 *frame_body, u16 config_method)
{
_adapter *padapter = pwdinfo->padapter;
unsigned char category = RTW_WLAN_CATEGORY_PUBLIC;
unsigned char category = WLAN_CATEGORY_PUBLIC;
u8 action = P2P_PUB_ACTION_ACTION;
u8 dialogToken = frame_body[7]; /* The Dialog Token of provisioning discovery request frame. */
u32 p2poui = cpu_to_be32(P2POUI);
@ -286,7 +286,7 @@ static void issue_p2p_provision_resp(struct wifidirect_info *pwdinfo, u8 *raddr,
struct xmit_frame *pmgntframe;
struct pkt_attrib *pattrib;
unsigned char *pframe;
struct rtw_ieee80211_hdr *pwlanhdr;
struct ieee80211_hdr *pwlanhdr;
unsigned short *fctrl;
struct xmit_priv *pxmitpriv = &(padapter->xmitpriv);
struct mlme_ext_priv *pmlmeext = &(padapter->mlmeextpriv);
@ -303,9 +303,9 @@ static void issue_p2p_provision_resp(struct wifidirect_info *pwdinfo, u8 *raddr,
memset(pmgntframe->buf_addr, 0, WLANHDR_OFFSET + TXDESC_OFFSET);
pframe = (u8 *)(pmgntframe->buf_addr) + TXDESC_OFFSET;
pwlanhdr = (struct rtw_ieee80211_hdr *)pframe;
pwlanhdr = (struct ieee80211_hdr *)pframe;
fctrl = &(pwlanhdr->frame_ctl);
fctrl =&pwlanhdr->frame_control;
*(fctrl) = 0;
memcpy(pwlanhdr->addr1, raddr, ETH_ALEN);
@ -316,8 +316,8 @@ static void issue_p2p_provision_resp(struct wifidirect_info *pwdinfo, u8 *raddr,
pmlmeext->mgnt_seq++;
set_frame_sub_type(pframe, IEEE80211_STYPE_ACTION);
pframe += sizeof(struct rtw_ieee80211_hdr_3addr);
pattrib->pktlen = sizeof(struct rtw_ieee80211_hdr_3addr);
pframe += sizeof(struct 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, &(action), &(pattrib->pktlen));
@ -382,12 +382,12 @@ static void issue_p2p_presence_resp(struct wifidirect_info *pwdinfo, u8 *da, u8
struct xmit_frame *pmgntframe;
struct pkt_attrib *pattrib;
unsigned char *pframe;
struct rtw_ieee80211_hdr *pwlanhdr;
struct ieee80211_hdr *pwlanhdr;
unsigned short *fctrl;
_adapter *padapter = pwdinfo->padapter;
struct xmit_priv *pxmitpriv = &(padapter->xmitpriv);
struct mlme_ext_priv *pmlmeext = &(padapter->mlmeextpriv);
unsigned char category = RTW_WLAN_CATEGORY_P2P;/* P2P action frame */
unsigned char category = WLAN_CATEGORY_VENDOR_SPECIFIC;/* P2P action frame */
u32 p2poui = cpu_to_be32(P2POUI);
u8 oui_subtype = P2P_PRESENCE_RESPONSE;
u8 p2pie[MAX_P2P_IE_LEN] = { 0x00 };
@ -407,9 +407,9 @@ static void issue_p2p_presence_resp(struct wifidirect_info *pwdinfo, u8 *da, u8
memset(pmgntframe->buf_addr, 0, WLANHDR_OFFSET + TXDESC_OFFSET);
pframe = (u8 *)(pmgntframe->buf_addr) + TXDESC_OFFSET;
pwlanhdr = (struct rtw_ieee80211_hdr *)pframe;
pwlanhdr = (struct ieee80211_hdr *)pframe;
fctrl = &(pwlanhdr->frame_ctl);
fctrl =&pwlanhdr->frame_control;
*(fctrl) = 0;
memcpy(pwlanhdr->addr1, da, ETH_ALEN);
@ -420,8 +420,8 @@ static void issue_p2p_presence_resp(struct wifidirect_info *pwdinfo, u8 *da, u8
pmlmeext->mgnt_seq++;
set_frame_sub_type(pframe, IEEE80211_STYPE_ACTION);
pframe += sizeof(struct rtw_ieee80211_hdr_3addr);
pattrib->pktlen = sizeof(struct rtw_ieee80211_hdr_3addr);
pframe += sizeof(struct ieee80211_hdr_3addr);
pattrib->pktlen = sizeof(struct ieee80211_hdr_3addr);
/* Build P2P action frame header */
pframe = rtw_set_fixed_ie(pframe, 1, &(category), &(pattrib->pktlen));
@ -1900,8 +1900,7 @@ u32 build_probe_resp_p2p_ie(struct wifidirect_info *pwdinfo, u8 *pbuf)
p2pie[p2pielen++] = P2P_ATTR_CAPABILITY;
/* Length: */
/* *(u16*) ( p2pie + p2pielen ) = cpu_to_le16( 0x0002 ); */
RTW_PUT_LE16(p2pie + p2pielen, 0x0002);
*(u16 *) (p2pie + p2pielen) = cpu_to_le16(0x0002);
p2pielen += 2;
/* Value: */
@ -1929,19 +1928,16 @@ u32 build_probe_resp_p2p_ie(struct wifidirect_info *pwdinfo, u8 *pbuf)
p2pie[p2pielen++] = P2P_ATTR_EX_LISTEN_TIMING;
/* Length: */
/* *(u16*) ( p2pie + p2pielen ) = cpu_to_le16( 0x0004 ); */
RTW_PUT_LE16(p2pie + p2pielen, 0x0004);
*(u16 *) (p2pie + p2pielen) = cpu_to_le16(0x0004);
p2pielen += 2;
/* Value: */
/* Availability Period */
/* *(u16*) ( p2pie + p2pielen ) = cpu_to_le16( 0xFFFF ); */
RTW_PUT_LE16(p2pie + p2pielen, 0xFFFF);
*(u16*) ( p2pie + p2pielen ) = cpu_to_le16( 0xFFFF );
p2pielen += 2;
/* Availability Interval */
/* *(u16*) ( p2pie + p2pielen ) = cpu_to_le16( 0xFFFF ); */
RTW_PUT_LE16(p2pie + p2pielen, 0xFFFF);
*(u16*) ( p2pie + p2pielen ) = cpu_to_le16( 0xFFFF );
p2pielen += 2;
@ -1963,12 +1959,12 @@ u32 build_probe_resp_p2p_ie(struct wifidirect_info *pwdinfo, u8 *pbuf)
/* *(u16*) ( p2pie + p2pielen ) = cpu_to_le16( 21 + pwdinfo->device_name_len ); */
#ifdef CONFIG_INTEL_WIDI
if (widi_version == 35)
RTW_PUT_LE16(p2pie + p2pielen, 21 + 8 + pwdinfo->device_name_len);
*(u16 *) (p2pie + p2pielen) = cpu_to_le16(21 + 8 + pwdinfo->device_name_len);
else if (widi_version == 40)
RTW_PUT_LE16(p2pie + p2pielen, 21 + 8 * pmlmepriv->num_p2p_sdt + pwdinfo->device_name_len);
*(u16 *) (p2pie + p2pielen) = cpu_to_le16(21 + 8 * pmlmepriv->num_p2p_sdt + pwdinfo->device_name_len);
else
#endif /* CONFIG_INTEL_WIDI */
RTW_PUT_LE16(p2pie + p2pielen, 21 + pwdinfo->device_name_len);
*(u16 *) (p2pie + p2pielen) = cpu_to_le16(21 + pwdinfo->device_name_len);
p2pielen += 2;
/* Value: */
@ -2101,8 +2097,7 @@ u32 build_prov_disc_request_p2p_ie(struct wifidirect_info *pwdinfo, u8 *pbuf, u8
p2pie[p2pielen++] = P2P_ATTR_CAPABILITY;
/* Length: */
/* *(u16*) ( p2pie + p2pielen ) = cpu_to_le16( 0x0002 ); */
RTW_PUT_LE16(p2pie + p2pielen, 0x0002);
*(u16*) ( p2pie + p2pielen ) = cpu_to_le16( 0x0002 );
p2pielen += 2;
/* Value: */
@ -2123,8 +2118,7 @@ u32 build_prov_disc_request_p2p_ie(struct wifidirect_info *pwdinfo, u8 *pbuf, u8
/* Length: */
/* 21->P2P Device Address (6bytes) + Config Methods (2bytes) + Primary Device Type (8bytes) */
/* + NumofSecondDevType (1byte) + WPS Device Name ID field (2bytes) + WPS Device Name Len field (2bytes) */
/* *(u16*) ( p2pie + p2pielen ) = cpu_to_le16( 21 + pwdinfo->device_name_len ); */
RTW_PUT_LE16(p2pie + p2pielen, 21 + pwdinfo->device_name_len);
*(u16*) ( p2pie + p2pielen ) = cpu_to_le16( 21 + pwdinfo->device_name_len );
p2pielen += 2;
/* Value: */
@ -2187,8 +2181,7 @@ u32 build_prov_disc_request_p2p_ie(struct wifidirect_info *pwdinfo, u8 *pbuf, u8
p2pie[p2pielen++] = P2P_ATTR_GROUP_ID;
/* Length: */
/* *(u16*) ( p2pie + p2pielen ) = cpu_to_le16( ETH_ALEN + ussidlen ); */
RTW_PUT_LE16(p2pie + p2pielen, ETH_ALEN + ussidlen);
*(u16*) ( p2pie + p2pielen ) = cpu_to_le16( ETH_ALEN + ussidlen );
p2pielen += 2;
/* Value: */
@ -2435,7 +2428,7 @@ u32 process_p2p_devdisc_req(struct wifidirect_info *pwdinfo, u8 *pframe, uint le
u8 *p2p_ie;
u32 p2p_ielen = 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];
status = P2P_STATUS_FAIL_UNKNOWN_P2PGROUP;
@ -2513,7 +2506,7 @@ u8 process_p2p_provdisc_req(struct wifidirect_info *pwdinfo, u8 *pframe, uint l
u16 uconfig_method = 0;
frame_body = (pframe + sizeof(struct rtw_ieee80211_hdr_3addr));
frame_body = (pframe + sizeof(struct ieee80211_hdr_3addr));
wpsie = rtw_get_wps_ie(frame_body + _PUBLIC_ACTION_IE_OFFSET_, len - _PUBLIC_ACTION_IE_OFFSET_, NULL, &wps_ielen);
if (wpsie) {
@ -3057,7 +3050,7 @@ u8 process_p2p_presence_req(struct wifidirect_info *pwdinfo, u8 *pframe, uint le
u8 dialogToken = 0;
u8 status = P2P_STATUS_SUCCESS;
frame_body = (unsigned char *)(pframe + sizeof(struct rtw_ieee80211_hdr_3addr));
frame_body = (unsigned char *)(pframe + sizeof(struct ieee80211_hdr_3addr));
dialogToken = frame_body[6];
@ -3742,15 +3735,15 @@ u32 rtw_xframe_build_wfd_ie(struct xmit_frame *xframe)
_adapter *adapter = xframe->padapter;
struct wifidirect_info *wdinfo = &adapter->wdinfo;
u8 *frame = xframe->buf_addr + TXDESC_OFFSET;
u8 *frame_body = frame + sizeof(struct rtw_ieee80211_hdr_3addr);
u8 *frame_body = frame + sizeof(struct ieee80211_hdr_3addr);
u8 *frame_tail = frame + xframe->attrib.pktlen;
u8 category, action, OUI_Subtype, dialogToken = 0;
u32 wfdielen = 0;
category = frame_body[0];
if (category == RTW_WLAN_CATEGORY_PUBLIC) {
if (category == WLAN_CATEGORY_PUBLIC) {
action = frame_body[1];
if (action == ACT_PUBLIC_VENDOR
if (action == WLAN_PUB_ACTION_VENDOR_SPECIFIC
&& _rtw_memcmp(frame_body + 2, P2P_OUI, 4) == _TRUE
) {
OUI_Subtype = frame_body[6];
@ -3785,7 +3778,7 @@ u32 rtw_xframe_build_wfd_ie(struct xmit_frame *xframe)
}
}
} else if (category == RTW_WLAN_CATEGORY_P2P) {
} else if (category == WLAN_CATEGORY_VENDOR_SPECIFIC) {
OUI_Subtype = frame_body[5];
dialogToken = frame_body[6];
@ -3819,7 +3812,7 @@ bool rtw_xframe_del_wfd_ie(struct xmit_frame *xframe)
{
#define DBG_XFRAME_DEL_WFD_IE 0
u8 *frame = xframe->buf_addr + TXDESC_OFFSET;
u8 *frame_body = frame + sizeof(struct rtw_ieee80211_hdr_3addr);
u8 *frame_body = frame + sizeof(struct ieee80211_hdr_3addr);
u8 *frame_tail = frame + xframe->attrib.pktlen;
u8 category, action, OUI_Subtype;
u8 *ies = NULL;
@ -3827,9 +3820,9 @@ bool rtw_xframe_del_wfd_ie(struct xmit_frame *xframe)
uint ies_len = 0;
category = frame_body[0];
if (category == RTW_WLAN_CATEGORY_PUBLIC) {
if (category == WLAN_CATEGORY_PUBLIC) {
action = frame_body[1];
if (action == ACT_PUBLIC_VENDOR
if (action == WLAN_PUB_ACTION_VENDOR_SPECIFIC
&& _rtw_memcmp(frame_body + 2, P2P_OUI, 4) == _TRUE
) {
OUI_Subtype = frame_body[6];
@ -3965,12 +3958,12 @@ int rtw_p2p_check_frames(_adapter *padapter, const u8 *buf, u32 len, u8 tx)
u8 *iaddr = NULL;
u8 *gbssid = NULL;
frame_body = (unsigned char *)(buf + sizeof(struct rtw_ieee80211_hdr_3addr));
frame_body = (unsigned char *)(buf + sizeof(struct ieee80211_hdr_3addr));
category = frame_body[0];
/* just for check */
if (category == RTW_WLAN_CATEGORY_PUBLIC) {
if (category == WLAN_CATEGORY_PUBLIC) {
action = frame_body[1];
if (action == ACT_PUBLIC_VENDOR
if (action == WLAN_PUB_ACTION_VENDOR_SPECIFIC
&& _rtw_memcmp(frame_body + 2, P2P_OUI, 4) == _TRUE
) {
OUI_Subtype = frame_body[6];
@ -3978,13 +3971,13 @@ int rtw_p2p_check_frames(_adapter *padapter, const u8 *buf, u32 len, u8 tx)
is_p2p_frame = OUI_Subtype;
#ifdef CONFIG_DEBUG_CFG80211
RTW_INFO("ACTION_CATEGORY_PUBLIC: ACT_PUBLIC_VENDOR, OUI=0x%x, OUI_Subtype=%d, dialogToken=%d\n",
RTW_INFO("ACTION_CATEGORY_PUBLIC: WLAN_PUB_ACTION_VENDOR_SPECIFIC , OUI=0x%x, OUI_Subtype=%d, dialogToken=%d\n",
cpu_to_be32(*((u32 *)(frame_body + 2))), OUI_Subtype, dialogToken);
#endif
p2p_ie = rtw_get_p2p_ie(
(u8 *)buf + sizeof(struct rtw_ieee80211_hdr_3addr) + _PUBLIC_ACTION_IE_OFFSET_
, len - sizeof(struct rtw_ieee80211_hdr_3addr) - _PUBLIC_ACTION_IE_OFFSET_
(u8 *)buf + sizeof(struct ieee80211_hdr_3addr) + _PUBLIC_ACTION_IE_OFFSET_
, len - sizeof(struct ieee80211_hdr_3addr) - _PUBLIC_ACTION_IE_OFFSET_
, NULL, &p2p_ielen);
switch (OUI_Subtype) { /* OUI Subtype */
@ -4003,7 +3996,7 @@ int rtw_p2p_check_frames(_adapter *padapter, const u8 *buf, u32 len, u8 tx)
#if defined(CONFIG_CONCURRENT_MODE) && defined(CONFIG_CFG80211_ONECHANNEL_UNDER_CONCURRENT)
if (rtw_mi_check_status(padapter, MI_LINKED) && padapter->registrypriv.full_ch_in_p2p_handshake == 0)
rtw_cfg80211_adjust_p2pie_channel(padapter, frame_body, len - sizeof(struct rtw_ieee80211_hdr_3addr));
rtw_cfg80211_adjust_p2pie_channel(padapter, frame_body, len - sizeof(struct ieee80211_hdr_3addr));
#endif
}
@ -4043,10 +4036,10 @@ int rtw_p2p_check_frames(_adapter *padapter, const u8 *buf, u32 len, u8 tx)
if (!tx) {
#if defined(CONFIG_CONCURRENT_MODE) && defined(CONFIG_CFG80211_ONECHANNEL_UNDER_CONCURRENT)
if (rtw_mi_check_status(padapter, MI_LINKED)
&& rtw_chk_p2pie_ch_list_with_buddy(padapter, frame_body, len - sizeof(struct rtw_ieee80211_hdr_3addr)) == _FALSE
&& rtw_chk_p2pie_ch_list_with_buddy(padapter, frame_body, len - sizeof(struct ieee80211_hdr_3addr)) == _FALSE
&& padapter->registrypriv.full_ch_in_p2p_handshake == 0) {
RTW_INFO(FUNC_ADPT_FMT" ch_list has no intersect with buddy\n", FUNC_ADPT_ARG(padapter));
rtw_change_p2pie_ch_list(padapter, frame_body, len - sizeof(struct rtw_ieee80211_hdr_3addr), 0);
rtw_change_p2pie_ch_list(padapter, frame_body, len - sizeof(struct ieee80211_hdr_3addr), 0);
}
#endif
}
@ -4059,7 +4052,7 @@ int rtw_p2p_check_frames(_adapter *padapter, const u8 *buf, u32 len, u8 tx)
if (tx) {
#if defined(CONFIG_CONCURRENT_MODE) && defined(CONFIG_CFG80211_ONECHANNEL_UNDER_CONCURRENT)
if (rtw_mi_check_status(padapter, MI_LINKED) && padapter->registrypriv.full_ch_in_p2p_handshake == 0)
rtw_cfg80211_adjust_p2pie_channel(padapter, frame_body, len - sizeof(struct rtw_ieee80211_hdr_3addr));
rtw_cfg80211_adjust_p2pie_channel(padapter, frame_body, len - sizeof(struct ieee80211_hdr_3addr));
#endif
}
@ -4100,10 +4093,10 @@ int rtw_p2p_check_frames(_adapter *padapter, const u8 *buf, u32 len, u8 tx)
pwdev_priv->provdisc_req_issued = _FALSE;
#if defined(CONFIG_CONCURRENT_MODE) && defined(CONFIG_CFG80211_ONECHANNEL_UNDER_CONCURRENT)
if (rtw_mi_check_status(padapter, MI_LINKED)
&& rtw_chk_p2pie_ch_list_with_buddy(padapter, frame_body, len - sizeof(struct rtw_ieee80211_hdr_3addr)) == _FALSE
&& rtw_chk_p2pie_ch_list_with_buddy(padapter, frame_body, len - sizeof(struct ieee80211_hdr_3addr)) == _FALSE
&& padapter->registrypriv.full_ch_in_p2p_handshake == 0) {
RTW_INFO(FUNC_ADPT_FMT" ch_list has no intersect with buddy\n", FUNC_ADPT_ARG(padapter));
rtw_change_p2pie_ch_list(padapter, frame_body, len - sizeof(struct rtw_ieee80211_hdr_3addr), 0);
rtw_change_p2pie_ch_list(padapter, frame_body, len - sizeof(struct ieee80211_hdr_3addr), 0);
}
#endif
}
@ -4117,7 +4110,7 @@ int rtw_p2p_check_frames(_adapter *padapter, const u8 *buf, u32 len, u8 tx)
if (tx) {
#if defined(CONFIG_CONCURRENT_MODE) && defined(CONFIG_CFG80211_ONECHANNEL_UNDER_CONCURRENT)
if (rtw_mi_check_status(padapter, MI_LINKED) && padapter->registrypriv.full_ch_in_p2p_handshake == 0)
rtw_cfg80211_adjust_p2pie_channel(padapter, frame_body, len - sizeof(struct rtw_ieee80211_hdr_3addr));
rtw_cfg80211_adjust_p2pie_channel(padapter, frame_body, len - sizeof(struct ieee80211_hdr_3addr));
#endif
}
@ -4160,7 +4153,7 @@ int rtw_p2p_check_frames(_adapter *padapter, const u8 *buf, u32 len, u8 tx)
#if defined(CONFIG_CONCURRENT_MODE) && defined(CONFIG_CFG80211_ONECHANNEL_UNDER_CONCURRENT)
if (rtw_mi_check_status(padapter, MI_LINKED)
&& padapter->registrypriv.full_ch_in_p2p_handshake == 0)
rtw_cfg80211_adjust_p2pie_channel(padapter, frame_body, len - sizeof(struct rtw_ieee80211_hdr_3addr));
rtw_cfg80211_adjust_p2pie_channel(padapter, frame_body, len - sizeof(struct ieee80211_hdr_3addr));
#endif
}
@ -4197,14 +4190,14 @@ int rtw_p2p_check_frames(_adapter *padapter, const u8 *buf, u32 len, u8 tx)
#if defined(CONFIG_CONCURRENT_MODE) && defined(CONFIG_CFG80211_ONECHANNEL_UNDER_CONCURRENT)
if (rtw_mi_check_status(padapter, MI_LINKED) && padapter->registrypriv.full_ch_in_p2p_handshake == 0) {
#if defined(CONFIG_P2P_INVITE_IOT)
if (op_ch != -1 && rtw_chk_p2pie_op_ch_with_buddy(padapter, frame_body, len - sizeof(struct rtw_ieee80211_hdr_3addr)) == _FALSE) {
if (op_ch != -1 && rtw_chk_p2pie_op_ch_with_buddy(padapter, frame_body, len - sizeof(struct ieee80211_hdr_3addr)) == _FALSE) {
RTW_INFO(FUNC_ADPT_FMT" op_ch:%u has no intersect with buddy\n", FUNC_ADPT_ARG(padapter), op_ch);
rtw_change_p2pie_ch_list(padapter, frame_body, len - sizeof(struct rtw_ieee80211_hdr_3addr), 0);
rtw_change_p2pie_ch_list(padapter, frame_body, len - sizeof(struct ieee80211_hdr_3addr), 0);
} else
#endif
if (rtw_chk_p2pie_ch_list_with_buddy(padapter, frame_body, len - sizeof(struct rtw_ieee80211_hdr_3addr)) == _FALSE) {
if (rtw_chk_p2pie_ch_list_with_buddy(padapter, frame_body, len - sizeof(struct ieee80211_hdr_3addr)) == _FALSE) {
RTW_INFO(FUNC_ADPT_FMT" ch_list has no intersect with buddy\n", FUNC_ADPT_ARG(padapter));
rtw_change_p2pie_ch_list(padapter, frame_body, len - sizeof(struct rtw_ieee80211_hdr_3addr), 0);
rtw_change_p2pie_ch_list(padapter, frame_body, len - sizeof(struct ieee80211_hdr_3addr), 0);
}
}
#endif
@ -4218,7 +4211,7 @@ int rtw_p2p_check_frames(_adapter *padapter, const u8 *buf, u32 len, u8 tx)
if (tx) {
#if defined(CONFIG_CONCURRENT_MODE) && defined(CONFIG_CFG80211_ONECHANNEL_UNDER_CONCURRENT)
if (rtw_mi_check_status(padapter, MI_LINKED) && padapter->registrypriv.full_ch_in_p2p_handshake == 0)
rtw_cfg80211_adjust_p2pie_channel(padapter, frame_body, len - sizeof(struct rtw_ieee80211_hdr_3addr));
rtw_cfg80211_adjust_p2pie_channel(padapter, frame_body, len - sizeof(struct ieee80211_hdr_3addr));
#endif
}
@ -4268,7 +4261,7 @@ int rtw_p2p_check_frames(_adapter *padapter, const u8 *buf, u32 len, u8 tx)
RTW_INFO("RTW_%s:P2P_DEVDISC_RESP, dialogToken=%d, status:%d\n", (tx == _TRUE) ? "Tx" : "Rx", dialogToken, cont ? *cont : -1);
break;
case P2P_PROVISION_DISC_REQ: {
size_t frame_body_len = len - sizeof(struct rtw_ieee80211_hdr_3addr);
size_t frame_body_len = len - sizeof(struct ieee80211_hdr_3addr);
u8 *p2p_ie;
uint p2p_ielen = 0;
uint contentlen = 0;
@ -4305,7 +4298,7 @@ int rtw_p2p_check_frames(_adapter *padapter, const u8 *buf, u32 len, u8 tx)
}
} else if (category == RTW_WLAN_CATEGORY_P2P) {
} else if (category == WLAN_CATEGORY_VENDOR_SPECIFIC) {
OUI_Subtype = frame_body[5];
dialogToken = frame_body[6];

View File

@ -177,7 +177,7 @@ void _rtw_free_recv_priv(struct recv_priv *precvpriv)
bool rtw_rframe_del_wfd_ie(union recv_frame *rframe, u8 ies_offset)
{
#define DBG_RFRAME_DEL_WFD_IE 0
u8 *ies = rframe->u.hdr.rx_data + sizeof(struct rtw_ieee80211_hdr_3addr) + ies_offset;
u8 *ies = rframe->u.hdr.rx_data + sizeof(struct ieee80211_hdr_3addr) + ies_offset;
uint ies_len_ori = rframe->u.hdr.len - (ies - rframe->u.hdr.rx_data);
uint ies_len;
@ -1013,8 +1013,8 @@ sint OnTDLS(_adapter *adapter, union recv_frame *precv_frame)
ptdls_sta = rtw_get_stainfo(pstapriv, ieee80211_get_SA((struct ieee80211_hdr *)ptr));
if (ptdls_sta == NULL) {
switch (*paction) {
case TDLS_SETUP_REQUEST:
case TDLS_DISCOVERY_REQUEST:
case WLAN_TDLS_SETUP_REQUEST:
case WLAN_TDLS_DISCOVERY_REQUEST:
break;
default:
RTW_INFO("[TDLS] %s - Direct Link Peer = "MAC_FMT" not found for action = %d\n", __func__, MAC_ARG(ieee80211_get_SA((struct ieee80211_hdr *)ptr)), *paction);
@ -1024,32 +1024,32 @@ sint OnTDLS(_adapter *adapter, union recv_frame *precv_frame)
}
switch (*paction) {
case TDLS_SETUP_REQUEST:
case WLAN_TDLS_SETUP_REQUEST:
ret = On_TDLS_Setup_Req(adapter, precv_frame, ptdls_sta);
break;
case TDLS_SETUP_RESPONSE:
case WLAN_TDLS_SETUP_RESPONSE:
ret = On_TDLS_Setup_Rsp(adapter, precv_frame, ptdls_sta);
break;
case TDLS_SETUP_CONFIRM:
case WLAN_TDLS_SETUP_CONFIRM:
ret = On_TDLS_Setup_Cfm(adapter, precv_frame, ptdls_sta);
break;
case TDLS_TEARDOWN:
case WLAN_TDLS_TEARDOWN:
ret = On_TDLS_Teardown(adapter, precv_frame, ptdls_sta);
break;
case TDLS_DISCOVERY_REQUEST:
case WLAN_TDLS_DISCOVERY_REQUEST:
ret = On_TDLS_Dis_Req(adapter, precv_frame);
break;
case TDLS_PEER_TRAFFIC_INDICATION:
case WLAN_TDLS_PEER_TRAFFIC_INDICATION:
ret = On_TDLS_Peer_Traffic_Indication(adapter, precv_frame, ptdls_sta);
break;
case TDLS_PEER_TRAFFIC_RESPONSE:
case WLAN_TDLS_PEER_TRAFFIC_RESPONSE:
ret = On_TDLS_Peer_Traffic_Rsp(adapter, precv_frame, ptdls_sta);
break;
#ifdef CONFIG_TDLS_CH_SW
case TDLS_CHANNEL_SWITCH_REQUEST:
case WLAN_TDLS_CHANNEL_SWITCH_REQUEST:
ret = On_TDLS_Ch_Switch_Req(adapter, precv_frame, ptdls_sta);
break;
case TDLS_CHANNEL_SWITCH_RESPONSE:
case WLAN_TDLS_CHANNEL_SWITCH_RESPONSE:
ret = On_TDLS_Ch_Switch_Rsp(adapter, precv_frame, ptdls_sta);
break;
#endif
@ -1762,7 +1762,7 @@ static sint validate_mgmt_protect(_adapter *adapter, union recv_frame *precv_fra
} else {
RTW_INFO(FUNC_ADPT_FMT" bmc:%u, action(%u), privacy:%u, encrypt:%u, bdecrypted:%u\n"
, FUNC_ADPT_ARG(adapter), is_bmc
, *(ptr + sizeof(struct rtw_ieee80211_hdr_3addr))
, *(ptr + sizeof(struct ieee80211_hdr_3addr))
, pattrib->privacy, pattrib->encrypt, pattrib->bdecrypted);
}
}
@ -1775,7 +1775,7 @@ static sint validate_mgmt_protect(_adapter *adapter, union recv_frame *precv_fra
}
if (subtype == IEEE80211_STYPE_ACTION)
category = *(ptr + sizeof(struct rtw_ieee80211_hdr_3addr));
category = *(ptr + sizeof(struct ieee80211_hdr_3addr));
if (is_bmc) {
/* broadcast cases */
@ -1873,7 +1873,7 @@ bip_verify:
/* cases to decrypt mgmt frame */
pattrib->bdecrypted = 0;
pattrib->encrypt = _AES_;
pattrib->hdrlen = sizeof(struct rtw_ieee80211_hdr_3addr);
pattrib->hdrlen = sizeof(struct ieee80211_hdr_3addr);
/* set iv and icv length */
SET_ICE_IV_LEN(pattrib->iv_len, pattrib->icv_len, pattrib->encrypt);
@ -3049,7 +3049,7 @@ int amsdu_to_msdu(_adapter *padapter, union recv_frame *prframe)
#ifdef CONFIG_RTW_MESH
if (MLME_IS_MESH(padapter)) {
u8 *mda = pdata, *msa = pdata + ETH_ALEN;
struct rtw_ieee80211s_hdr *mctrl = (struct rtw_ieee80211s_hdr *)(pdata + ETH_HLEN);
struct ieee80211s_hdr *mctrl = (struct ieee80211s_hdr *)(pdata + ETH_HLEN);
int v_ret;
v_ret = rtw_mesh_rx_data_validate_mctrl(padapter, prframe
@ -3167,7 +3167,7 @@ static int recv_process_mpdu(_adapter *padapter, union recv_frame *prframe)
act = rtw_mesh_rx_msdu_act_check(prframe
, pattrib->mda, pattrib->msa
, pattrib->dst, pattrib->src
, (struct rtw_ieee80211s_hdr *)(get_recvframe_data(prframe) + pattrib->hdrlen + pattrib->iv_len)
, (struct ieee80211s_hdr *)(get_recvframe_data(prframe) + pattrib->hdrlen + pattrib->iv_len)
, &fwd_frame, &b2u_list);
}
#endif
@ -4351,7 +4351,7 @@ int recv_func_posthandle(_adapter *padapter, union recv_frame *prframe)
pcategory = psnap_type + ETH_TYPE_LEN + PAYLOAD_TYPE_LEN;
if ((_rtw_memcmp(psnap_type, SNAP_ETH_TYPE_TDLS, ETH_TYPE_LEN)) &&
((*pcategory == RTW_WLAN_CATEGORY_TDLS) || (*pcategory == RTW_WLAN_CATEGORY_P2P))) {
((*pcategory == WLAN_CATEGORY_TDLS) || (*pcategory == WLAN_CATEGORY_VENDOR_SPECIFIC))) {
ret = OnTDLS(padapter, prframe);
if (ret == _FAIL)
goto _exit_recv_func;

View File

@ -282,7 +282,7 @@ u8 rm_add_nb_req(_adapter *padapter, struct sta_info *psta)
}
prm->psta = psta;
prm->q.category = RTW_WLAN_CATEGORY_RADIO_MEAS;
prm->q.category = WLAN_CATEGORY_RADIO_MEASUREMENT;
prm->q.diag_token = pmlmeinfo->dialogToken++;
prm->q.m_token = 1;
@ -319,7 +319,7 @@ static u8 *build_wlan_hdr(_adapter *padapter, struct xmit_frame *pmgntframe,
u8 *pframe;
u16 *fctrl;
struct pkt_attrib *pattr;
struct rtw_ieee80211_hdr *pwlanhdr;
struct ieee80211_hdr *pwlanhdr;
struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv;
struct mlme_ext_info *pmlmeinfo = &pmlmeext->mlmext_info;
@ -331,9 +331,9 @@ static u8 *build_wlan_hdr(_adapter *padapter, struct xmit_frame *pmgntframe,
memset(pmgntframe->buf_addr, 0, WLANHDR_OFFSET + TXDESC_OFFSET);
pframe = (u8 *)(pmgntframe->buf_addr) + TXDESC_OFFSET;
pwlanhdr = (struct rtw_ieee80211_hdr *)pframe;
pwlanhdr = (struct ieee80211_hdr *)pframe;
fctrl = &(pwlanhdr->frame_ctl);
fctrl =&pwlanhdr->frame_control;
*(fctrl) = 0;
memcpy(pwlanhdr->addr1, psta->cmn.mac_addr, ETH_ALEN);
@ -349,8 +349,8 @@ static u8 *build_wlan_hdr(_adapter *padapter, struct xmit_frame *pmgntframe,
set_frame_sub_type(pframe, IEEE80211_STYPE_ACTION);
pframe += sizeof(struct rtw_ieee80211_hdr_3addr);
pattr->pktlen = sizeof(struct rtw_ieee80211_hdr_3addr);
pframe += sizeof(struct ieee80211_hdr_3addr);
pattr->pktlen = sizeof(struct ieee80211_hdr_3addr);
return pframe;
}
@ -763,7 +763,7 @@ int rm_recv_radio_mens_req(_adapter *padapter,
struct rm_obj *prm;
struct rm_priv *prmpriv = &padapter->rmpriv;
u8 *pdiag_body = (u8 *)(precv_frame->u.hdr.rx_data +
sizeof(struct rtw_ieee80211_hdr_3addr));
sizeof(struct ieee80211_hdr_3addr));
u8 *pmeas_body = &pdiag_body[5];
u8 rmid, update = 0;
@ -812,7 +812,7 @@ int rm_recv_radio_mens_req(_adapter *padapter,
RTW_INFO("RM: meas_type = %d\n", prm->q.m_type);
#endif
if (prm->q.e_id != _MEAS_REQ_IE_) /* 38 */
if (prm->q.e_id != WLAN_EID_MEASURE_REQUEST) /* 38 */
return _FALSE;
switch (prm->q.m_type) {
@ -863,7 +863,7 @@ int rm_recv_radio_mens_rep(_adapter *padapter,
struct rm_obj *prm;
u32 rmid;
u8 *pdiag_body = (u8 *)(precv_frame->u.hdr.rx_data +
sizeof(struct rtw_ieee80211_hdr_3addr));
sizeof(struct ieee80211_hdr_3addr));
u8 *pmeas_body = &pdiag_body[3];
@ -894,7 +894,7 @@ int rm_recv_radio_mens_rep(_adapter *padapter,
RTW_INFO("RM: meas_mode = %d\n", prm->p.m_mode);
RTW_INFO("RM: meas_type = %d\n", prm->p.m_type);
#endif
if (prm->p.e_id != _MEAS_RSP_IE_) /* 39 */
if (prm->p.e_id != WLAN_EID_MEASURE_REPORT) /* 39 */
return _FALSE;
RTW_INFO("RM: recv %s\n", rm_type_rep_name(prm->p.m_type));
@ -907,7 +907,7 @@ int rm_radio_mens_nb_rep(_adapter *padapter,
union recv_frame *precv_frame, struct sta_info *psta)
{
u8 *pdiag_body = (u8 *)(precv_frame->u.hdr.rx_data +
sizeof(struct rtw_ieee80211_hdr_3addr));
sizeof(struct ieee80211_hdr_3addr));
u8 *pmeas_body = &pdiag_body[3];
u32 len = precv_frame->u.hdr.len;
u32 rmid;
@ -938,7 +938,7 @@ int rm_radio_mens_nb_rep(_adapter *padapter,
#ifdef CONFIG_LAYER2_ROAMING
if (rtw_wnm_btm_candidates_survey(padapter
,(pdiag_body + 3)
,(len - sizeof(struct rtw_ieee80211_hdr_3addr))
,(len - sizeof(struct ieee80211_hdr_3addr))
,_FALSE) == _FAIL)
return _FALSE;
#endif
@ -954,7 +954,7 @@ unsigned int rm_on_action(_adapter *padapter, union recv_frame *precv_frame)
u8 *pframe_body = NULL;
u8 action_code = 0;
u8 diag_token = 0;
struct rtw_ieee80211_hdr_3addr *whdr;
struct ieee80211_hdr_3addr *whdr;
struct sta_info *psta;
@ -965,7 +965,7 @@ unsigned int rm_on_action(_adapter *padapter, union recv_frame *precv_frame)
GetAddr1Ptr(pframe), ETH_ALEN))
goto exit;
whdr = (struct rtw_ieee80211_hdr_3addr *)pframe;
whdr = (struct ieee80211_hdr_3addr *)pframe;
RTW_INFO("RM: %s bssid = " MAC_FMT "\n",
__func__, MAC_ARG(whdr->addr2));
@ -977,7 +977,7 @@ unsigned int rm_on_action(_adapter *padapter, union recv_frame *precv_frame)
}
pframe_body = (unsigned char *)(pframe +
sizeof(struct rtw_ieee80211_hdr_3addr));
sizeof(struct ieee80211_hdr_3addr));
/* Figure 8-438 radio measurement request frame Action field format */
/* Category = pframe_body[0] = 5 (Radio Measurement) */
@ -1103,11 +1103,11 @@ static u8 *rm_gen_bcn_detail_elem(_adapter *padapter, u8 *pframe,
continue;
#if (RM_MORE_DBG_MSG)
switch (eid) {
case EID_QBSSLoad:
RTW_INFO("RM: EID_QBSSLoad\n");
case WLAN_EID_QBSS_LOAD:
RTW_INFO("RM: WLAN_EID_QBSS_LOAD\n");
break;
case EID_HTCapability:
RTW_INFO("RM: EID_HTCapability\n");
case WLAN_EID_HT_CAPABILITY:
RTW_INFO("RM: WLAN_EID_HT_CAPABILITY\n");
break;
case _MDIE_:
RTW_INFO("RM: EID_MobilityDomain\n");
@ -1220,7 +1220,7 @@ static u8 *rm_bcn_rep_fill_scan_resule (struct rm_obj *prm,
my_len = 0;
/* meas ID */
val8 = EID_MeasureReport;
val8 = WLAN_EID_MEASURE_REPORT;
pframe = rtw_set_fixed_ie(pframe, 1, &val8, &my_len);
/* remember position form elelment length */
@ -2279,8 +2279,8 @@ static void rm_dbg_add_meas(_adapter *padapter, char *s)
prmpriv->prm_sel = NULL;
return;
}
prm->q.category = RTW_WLAN_CATEGORY_RADIO_MEAS;
prm->q.e_id = _MEAS_REQ_IE_; /* 38 */
prm->q.category = WLAN_CATEGORY_RADIO_MEASUREMENT;
prm->q.e_id = WLAN_EID_MEASURE_REQUEST; /* 38 */
if (prm->q.action_code == RM_ACT_RADIO_MEAS_REQ)
sprintf(pstr(s), "\nAdd rmid=%x, meas_type=%s ok\n",

View File

@ -519,7 +519,7 @@ static int rm_state_idle(struct rm_obj *prm, enum RM_EV_ID evid)
u32 val32;
prm->p.category = RTW_WLAN_CATEGORY_RADIO_MEAS;
prm->p.category = WLAN_CATEGORY_RADIO_MEASUREMENT;
switch (evid) {
case RM_EV_state_in:
@ -528,7 +528,7 @@ static int rm_state_idle(struct rm_obj *prm, enum RM_EV_ID evid)
/* copy attrib from meas_req to meas_rep */
prm->p.action_code = RM_ACT_RADIO_MEAS_REP;
prm->p.diag_token = prm->q.diag_token;
prm->p.e_id = _MEAS_RSP_IE_;
prm->p.e_id = WLAN_EID_MEASURE_REPORT;
prm->p.m_token = prm->q.m_token;
prm->p.m_type = prm->q.m_type;
prm->p.rpt = prm->q.rpt;

View File

@ -2041,7 +2041,7 @@ u32 rtw_BIP_verify(_adapter *padapter, u8 *whdr_pos, sint flen
uint len, ori_len;
u16 pkt_keyid = 0;
u64 pkt_ipn = 0;
struct rtw_ieee80211_hdr *pwlanhdr;
struct ieee80211_hdr *pwlanhdr;
u8 mic[16];
mme = whdr_pos + flen - 18;
@ -2073,7 +2073,7 @@ u32 rtw_BIP_verify(_adapter *padapter, u8 *whdr_pos, sint flen
}
/* mapping to wlan header */
pwlanhdr = (struct rtw_ieee80211_hdr *)whdr_pos;
pwlanhdr = (struct ieee80211_hdr *)whdr_pos;
/* save the frame body + MME */
memcpy(BIP_AAD + BIP_AAD_SIZE, whdr_pos + WLAN_HDR_A3_LEN, flen - WLAN_HDR_A3_LEN);
@ -2085,7 +2085,7 @@ u32 rtw_BIP_verify(_adapter *padapter, u8 *whdr_pos, sint flen
memset(mme + 10, 0, 8);
/* conscruct AAD, copy frame control field */
memcpy(BIP_AAD, &pwlanhdr->frame_ctl, 2);
memcpy(BIP_AAD, &pwlanhdr->frame_control, 2);
ClearRetry(BIP_AAD);
ClearPwrMgt(BIP_AAD);
ClearMData(BIP_AAD);

File diff suppressed because it is too large Load Diff

View File

@ -763,7 +763,7 @@ u32 rtw_build_vht_operation_ie(_adapter *padapter, u8 *pbuf, u8 channel)
memcpy(operation + 3, pvhtpriv->vht_mcs_map, 2);
rtw_set_ie(pbuf, EID_VHTOperation, 5, operation, &len);
rtw_set_ie(pbuf, WLAN_EID_VHT_OPERATION, 5, operation, &len);
return len;
}
@ -786,7 +786,7 @@ u32 rtw_build_vht_op_mode_notify_ie(_adapter *padapter, u8 *pbuf, u8 bw)
pvhtpriv->vht_op_mode_notify = opmode;
pbuf = rtw_set_ie(pbuf, EID_OpModeNotification, 1, &opmode, &len);
pbuf = rtw_set_ie(pbuf, WLAN_EID_OPMODE_NOTIF, 1, &opmode, &len);
return len;
}
@ -926,7 +926,7 @@ u32 rtw_build_vht_cap_ie(_adapter *padapter, u8 *pbuf)
SET_VHT_CAPABILITY_ELE_MCS_RX_HIGHEST_RATE(pcap, HighestRate); /* indicate we support highest rx rate is 600Mbps. */
SET_VHT_CAPABILITY_ELE_MCS_TX_HIGHEST_RATE(pcap, HighestRate); /* indicate we support highest tx rate is 600Mbps. */
pbuf = rtw_set_ie(pbuf, EID_VHTCapability, 12, pcap, &len);
pbuf = rtw_set_ie(pbuf, WLAN_EID_VHT_CAPABILITY, 12, pcap, &len);
return len;
}
@ -948,10 +948,10 @@ u32 rtw_restructure_vht_ie(_adapter *padapter, u8 *in_ie, u8 *out_ie, uint in_le
ht_op_ie = rtw_get_ie(in_ie + 12, WLAN_EID_HT_OPERATION, &ielen, in_len - 12);
if (!ht_op_ie || ielen != HT_OP_IE_LEN)
goto exit;
vht_cap_ie = rtw_get_ie(in_ie + 12, EID_VHTCapability, &ielen, in_len - 12);
vht_cap_ie = rtw_get_ie(in_ie + 12, WLAN_EID_VHT_CAPABILITY, &ielen, in_len - 12);
if (!vht_cap_ie || ielen != VHT_CAP_IE_LEN)
goto exit;
vht_op_ie = rtw_get_ie(in_ie + 12, EID_VHTOperation, &ielen, in_len - 12);
vht_op_ie = rtw_get_ie(in_ie + 12, WLAN_EID_VHT_OPERATION, &ielen, in_len - 12);
if (!vht_op_ie || ielen != VHT_OP_IE_LEN)
goto exit;
@ -961,7 +961,7 @@ u32 rtw_restructure_vht_ie(_adapter *padapter, u8 *in_ie, u8 *out_ie, uint in_le
/* VHT Operation element */
out_vht_op_ie = out_ie + *pout_len;
rtw_set_ie(out_vht_op_ie, EID_VHTOperation, VHT_OP_IE_LEN, vht_op_ie + 2 , pout_len);
rtw_set_ie(out_vht_op_ie, WLAN_EID_VHT_OPERATION, VHT_OP_IE_LEN, vht_op_ie + 2 , pout_len);
/* get primary channel from HT_OP_IE */
oper_ch = GET_HT_OP_ELE_PRI_CHL(ht_op_ie + 2);
@ -1072,7 +1072,7 @@ void rtw_vht_ies_attach(_adapter *padapter, WLAN_BSSID_EX *pnetwork)
sint ie_len = 0;
u8 *p = NULL;
p = rtw_get_ie(pnetwork->IEs + _BEACON_IE_OFFSET_, EID_VHTCapability, &ie_len,
p = rtw_get_ie(pnetwork->IEs + _BEACON_IE_OFFSET_, WLAN_EID_VHT_CAPABILITY, &ie_len,
(pnetwork->IELength - _BEACON_IE_OFFSET_));
if (p && ie_len > 0)
return;
@ -1082,7 +1082,7 @@ void rtw_vht_ies_attach(_adapter *padapter, WLAN_BSSID_EX *pnetwork)
/* VHT Operation mode notifiy bit in Extended IE (127) */
SET_EXT_CAPABILITY_ELE_OP_MODE_NOTIF(pmlmepriv->ext_capab_ie_data, 1);
pmlmepriv->ext_capab_ie_len = 10;
rtw_set_ie(pnetwork->IEs + pnetwork->IELength, EID_EXTCapability, 8, pmlmepriv->ext_capab_ie_data, &len);
rtw_set_ie(pnetwork->IEs + pnetwork->IELength, WLAN_EID_EXT_CAPABILITY, 8, pmlmepriv->ext_capab_ie_data, &len);
pnetwork->IELength += pmlmepriv->ext_capab_ie_len;
/* VHT Capabilities element */
@ -1103,9 +1103,9 @@ void rtw_vht_ies_detach(_adapter *padapter, WLAN_BSSID_EX *pnetwork)
{
struct mlme_priv *pmlmepriv = &(padapter->mlmepriv);
rtw_remove_bcn_ie(padapter, pnetwork, EID_EXTCapability);
rtw_remove_bcn_ie(padapter, pnetwork, EID_VHTCapability);
rtw_remove_bcn_ie(padapter, pnetwork, EID_VHTOperation);
rtw_remove_bcn_ie(padapter, pnetwork, WLAN_EID_EXT_CAPABILITY);
rtw_remove_bcn_ie(padapter, pnetwork, WLAN_EID_VHT_CAPABILITY);
rtw_remove_bcn_ie(padapter, pnetwork, WLAN_EID_VHT_OPERATION);
pmlmepriv->vhtpriv.vht_option = _FALSE;
}
@ -1123,7 +1123,7 @@ void rtw_check_for_vht20(_adapter *adapter, u8 *ies, int ies_len)
int vht_op_ielen;
RTW_INFO(FUNC_ADPT_FMT" vht80 is not allowed without ht40\n", FUNC_ADPT_ARG(adapter));
vht_op_ie = rtw_get_ie(ies, EID_VHTOperation, &vht_op_ielen, ies_len);
vht_op_ie = rtw_get_ie(ies, WLAN_EID_VHT_OPERATION, &vht_op_ielen, ies_len);
if (vht_op_ie && vht_op_ielen) {
RTW_INFO(FUNC_ADPT_FMT" switch to vht20\n", FUNC_ADPT_ARG(adapter));
SET_VHT_OPERATION_ELE_CHL_WIDTH(vht_op_ie + 2, 0);

View File

@ -310,7 +310,7 @@ void SecCalculateMicSMS4(
memcpy((TempBuf + 16), (pHeader + 16), 6); /* Addr3 */
fc = le16_to_cpu(header->frame_ctl);
fc = le16_to_cpu(header->frame_control);
@ -473,7 +473,7 @@ u8 WapiCheckPnInSwDecrypt(
header = (struct ieee80211_hdr_3addr_qos *)pskb->data;
pTaddr = header->addr2;
pRaddr = header->addr1;
fc = le16_to_cpu(header->frame_ctl);
fc = le16_to_cpu(header->frame_control);
if (GetToDs(&fc))
pDaddr = header->addr3;

View File

@ -2263,7 +2263,7 @@ int check_ielen(u8 *start, uint len)
int validate_beacon_len(u8 *pframe, u32 len)
{
u8 ie_offset = _BEACON_IE_OFFSET_ + sizeof(struct rtw_ieee80211_hdr_3addr);
u8 ie_offset = _BEACON_IE_OFFSET_ + sizeof(struct ieee80211_hdr_3addr);
if (len < ie_offset) {
RTW_INFO("%s: incorrect beacon length(%d)\n", __func__, len);
@ -2422,7 +2422,7 @@ void rtw_debug_rx_bcn(_adapter *adapter, u8 *pframe, u32 packet_len)
{
struct mlme_ext_priv *pmlmeext = &adapter->mlmeextpriv;
struct mlme_ext_info *mlmeinfo = &(pmlmeext->mlmext_info);
u16 sn = ((struct rtw_ieee80211_hdr_3addr *)pframe)->seq_ctl >> 4;
u16 sn = ((struct ieee80211_hdr_3addr *)pframe)->seq_ctl >> 4;
u64 tsf, tsf_offset;
u8 dtim_cnt, dtim_period, tim_bmap, tim_pvbit;
@ -2468,8 +2468,8 @@ int rtw_get_bcn_keys(ADAPTER *Adapter, u8 *pframe, u32 packet_len,
capability = le16_to_cpu(*(unsigned short *)(pframe + WLAN_HDR_A3_LEN + 10));
/* checking IEs */
left = packet_len - sizeof(struct rtw_ieee80211_hdr_3addr) - _BEACON_IE_OFFSET_;
pos = pframe + sizeof(struct rtw_ieee80211_hdr_3addr) + _BEACON_IE_OFFSET_;
left = packet_len - sizeof(struct ieee80211_hdr_3addr) - _BEACON_IE_OFFSET_;
pos = pframe + sizeof(struct ieee80211_hdr_3addr) + _BEACON_IE_OFFSET_;
if (rtw_ieee802_11_parse_elems(pos, left, &elems, 1) == ParseFailed)
return _FALSE;
@ -2691,7 +2691,7 @@ void update_beacon_info(_adapter *padapter, u8 *pframe, uint pkt_len, struct sta
bwmode_update_check(padapter, pIE);
break;
#ifdef CONFIG_80211AC_VHT
case EID_OpModeNotification:
case WLAN_EID_OPMODE_NOTIF:
rtw_process_vht_op_mode_notify(padapter, pIE->data, psta);
break;
#endif /* CONFIG_80211AC_VHT */
@ -2732,7 +2732,7 @@ void process_csa_ie(_adapter *padapter, u8 *ies, uint ies_len)
pIE = (PNDIS_802_11_VARIABLE_IEs)(ies + i);
switch (pIE->ElementID) {
case _CH_SWTICH_ANNOUNCE_:
case WLAN_EID_CHANNEL_SWITCH:
ch = *(pIE->data + 1);
break;
default:
@ -3254,7 +3254,7 @@ unsigned char get_vht_mu_bfer_cap(u8 *pframe, uint len)
switch (pIE->ElementID) {
case EID_VHTCapability:
case WLAN_EID_VHT_CAPABILITY:
mu_bfer = GET_VHT_CAPABILITY_ELE_MU_BFER(pIE->data);
break;
default:
@ -3585,7 +3585,7 @@ void update_TSF(struct mlme_ext_priv *pmlmeext, u8 *pframe, uint len)
u8 *pIE;
u32 *pbuf;
pIE = pframe + sizeof(struct rtw_ieee80211_hdr_3addr);
pIE = pframe + sizeof(struct ieee80211_hdr_3addr);
pbuf = (u32 *)pIE;
pmlmeext->TSFValue = le32_to_cpu(*(pbuf + 1));
@ -4178,7 +4178,7 @@ unsigned int setup_beacon_frame(_adapter *padapter, unsigned char *beacon_frame)
unsigned short ATIMWindow;
unsigned char *pframe;
struct tx_desc *ptxdesc;
struct rtw_ieee80211_hdr *pwlanhdr;
struct ieee80211_hdr *pwlanhdr;
unsigned short *fctrl;
unsigned int rate_len, len = 0;
struct xmit_priv *pxmitpriv = &(padapter->xmitpriv);
@ -4191,9 +4191,9 @@ unsigned int setup_beacon_frame(_adapter *padapter, unsigned char *beacon_frame)
pframe = beacon_frame + TXDESC_SIZE;
pwlanhdr = (struct rtw_ieee80211_hdr *)pframe;
pwlanhdr = (struct ieee80211_hdr *)pframe;
fctrl = &(pwlanhdr->frame_ctl);
fctrl =&pwlanhdr->frame_control;
*(fctrl) = 0;
memcpy(pwlanhdr->addr1, bc_addr, ETH_ALEN);
@ -4202,8 +4202,8 @@ unsigned int setup_beacon_frame(_adapter *padapter, unsigned char *beacon_frame)
set_frame_sub_type(pframe, IEEE80211_STYPE_BEACON);
pframe += sizeof(struct rtw_ieee80211_hdr_3addr);
len = sizeof(struct rtw_ieee80211_hdr_3addr);
pframe += sizeof(struct ieee80211_hdr_3addr);
len = sizeof(struct ieee80211_hdr_3addr);
/* timestamp will be inserted by hardware */
pframe += 8;

View File

@ -1720,12 +1720,12 @@ s32 rtw_make_wlanhdr(_adapter *padapter , u8 *hdr, struct pkt_attrib *pattrib)
{
u16 *qc;
struct rtw_ieee80211_hdr *pwlanhdr = (struct rtw_ieee80211_hdr *)hdr;
struct ieee80211_hdr *pwlanhdr = (struct ieee80211_hdr *)hdr;
struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
struct qos_priv *pqospriv = &pmlmepriv->qospriv;
u8 qos_option = _FALSE;
sint res = _SUCCESS;
u16 *fctrl = &pwlanhdr->frame_ctl;
u16 *fctrl =&pwlanhdr->frame_control;
/* struct sta_info *psta; */
@ -1996,7 +1996,7 @@ int rtw_build_tdls_ies(_adapter *padapter, struct xmit_frame *pxmitframe, u8 *pf
ptdls_sta = rtw_get_stainfo((&padapter->stapriv), pattrib->dst);
if (ptdls_sta == NULL) {
switch (ptxmgmt->action_code) {
case TDLS_DISCOVERY_REQUEST:
case WLAN_TDLS_DISCOVERY_REQUEST:
case TUNNELED_PROBE_REQ:
case TUNNELED_PROBE_RSP:
break;
@ -2008,33 +2008,33 @@ int rtw_build_tdls_ies(_adapter *padapter, struct xmit_frame *pxmitframe, u8 *pf
}
switch (ptxmgmt->action_code) {
case TDLS_SETUP_REQUEST:
case WLAN_TDLS_SETUP_REQUEST:
rtw_build_tdls_setup_req_ies(padapter, pxmitframe, pframe, ptxmgmt, ptdls_sta);
break;
case TDLS_SETUP_RESPONSE:
case WLAN_TDLS_SETUP_RESPONSE:
rtw_build_tdls_setup_rsp_ies(padapter, pxmitframe, pframe, ptxmgmt, ptdls_sta);
break;
case TDLS_SETUP_CONFIRM:
case WLAN_TDLS_SETUP_CONFIRM:
rtw_build_tdls_setup_cfm_ies(padapter, pxmitframe, pframe, ptxmgmt, ptdls_sta);
break;
case TDLS_TEARDOWN:
case WLAN_TDLS_TEARDOWN:
rtw_build_tdls_teardown_ies(padapter, pxmitframe, pframe, ptxmgmt, ptdls_sta);
break;
case TDLS_DISCOVERY_REQUEST:
case WLAN_TDLS_DISCOVERY_REQUEST:
rtw_build_tdls_dis_req_ies(padapter, pxmitframe, pframe, ptxmgmt);
break;
case TDLS_PEER_TRAFFIC_INDICATION:
case WLAN_TDLS_PEER_TRAFFIC_INDICATION:
rtw_build_tdls_peer_traffic_indication_ies(padapter, pxmitframe, pframe, ptxmgmt, ptdls_sta);
break;
#ifdef CONFIG_TDLS_CH_SW
case TDLS_CHANNEL_SWITCH_REQUEST:
case WLAN_TDLS_CHANNEL_SWITCH_REQUEST:
rtw_build_tdls_ch_switch_req_ies(padapter, pxmitframe, pframe, ptxmgmt, ptdls_sta);
break;
case TDLS_CHANNEL_SWITCH_RESPONSE:
case WLAN_TDLS_CHANNEL_SWITCH_RESPONSE:
rtw_build_tdls_ch_switch_rsp_ies(padapter, pxmitframe, pframe, ptxmgmt, ptdls_sta);
break;
#endif
case TDLS_PEER_TRAFFIC_RESPONSE:
case WLAN_TDLS_PEER_TRAFFIC_RESPONSE:
rtw_build_tdls_peer_traffic_rsp_ies(padapter, pxmitframe, pframe, ptxmgmt, ptdls_sta);
break;
#ifdef CONFIG_WFD
@ -2057,7 +2057,7 @@ exit:
s32 rtw_make_tdls_wlanhdr(_adapter *padapter , u8 *hdr, struct pkt_attrib *pattrib, struct tdls_txmgmt *ptxmgmt)
{
u16 *qc;
struct rtw_ieee80211_hdr *pwlanhdr = (struct rtw_ieee80211_hdr *)hdr;
struct ieee80211_hdr *pwlanhdr = (struct ieee80211_hdr *)hdr;
struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
struct qos_priv *pqospriv = &pmlmepriv->qospriv;
struct sta_priv *pstapriv = &padapter->stapriv;
@ -2065,7 +2065,7 @@ s32 rtw_make_tdls_wlanhdr(_adapter *padapter , u8 *hdr, struct pkt_attrib *pattr
u8 tdls_seq = 0, baddr[ETH_ALEN] = { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff };
sint res = _SUCCESS;
u16 *fctrl = &pwlanhdr->frame_ctl;
u16 *fctrl =&pwlanhdr->frame_control;
memset(hdr, 0, WLANHDR_OFFSET);
@ -2073,29 +2073,29 @@ s32 rtw_make_tdls_wlanhdr(_adapter *padapter , u8 *hdr, struct pkt_attrib *pattr
set_frame_sub_type(fctrl, pattrib->subtype);
switch (ptxmgmt->action_code) {
case TDLS_SETUP_REQUEST:
case TDLS_SETUP_RESPONSE:
case TDLS_SETUP_CONFIRM:
case TDLS_PEER_TRAFFIC_INDICATION:
case TDLS_PEER_PSM_REQUEST:
case WLAN_TDLS_SETUP_REQUEST:
case WLAN_TDLS_SETUP_RESPONSE:
case WLAN_TDLS_SETUP_CONFIRM:
case WLAN_TDLS_PEER_TRAFFIC_INDICATION:
case WLAN_TDLS_PEER_PSM_REQUEST:
case TUNNELED_PROBE_REQ:
case TUNNELED_PROBE_RSP:
case TDLS_DISCOVERY_REQUEST:
case WLAN_TDLS_DISCOVERY_REQUEST:
SetToDs(fctrl);
memcpy(pwlanhdr->addr1, get_bssid(pmlmepriv), ETH_ALEN);
memcpy(pwlanhdr->addr2, pattrib->src, ETH_ALEN);
memcpy(pwlanhdr->addr3, pattrib->dst, ETH_ALEN);
break;
case TDLS_CHANNEL_SWITCH_REQUEST:
case TDLS_CHANNEL_SWITCH_RESPONSE:
case TDLS_PEER_PSM_RESPONSE:
case TDLS_PEER_TRAFFIC_RESPONSE:
case WLAN_TDLS_CHANNEL_SWITCH_REQUEST:
case WLAN_TDLS_CHANNEL_SWITCH_RESPONSE:
case WLAN_TDLS_PEER_PSM_RESPONSE:
case WLAN_TDLS_PEER_TRAFFIC_RESPONSE:
memcpy(pwlanhdr->addr1, pattrib->dst, ETH_ALEN);
memcpy(pwlanhdr->addr2, pattrib->src, ETH_ALEN);
memcpy(pwlanhdr->addr3, get_bssid(pmlmepriv), ETH_ALEN);
tdls_seq = 1;
break;
case TDLS_TEARDOWN:
case WLAN_TDLS_TEARDOWN:
if (ptxmgmt->status_code == _RSON_TDLS_TEAR_UN_RSN_) {
memcpy(pwlanhdr->addr1, pattrib->dst, ETH_ALEN);
memcpy(pwlanhdr->addr2, pattrib->src, ETH_ALEN);
@ -2113,7 +2113,7 @@ s32 rtw_make_tdls_wlanhdr(_adapter *padapter , u8 *hdr, struct pkt_attrib *pattr
if (pattrib->encrypt)
SetPrivacy(fctrl);
if (ptxmgmt->action_code == TDLS_PEER_TRAFFIC_RESPONSE)
if (ptxmgmt->action_code == WLAN_TDLS_PEER_TRAFFIC_RESPONSE)
SetPwrMgt(fctrl);
if (pqospriv->qos_option) {
@ -2777,7 +2777,7 @@ s32 rtw_mgmt_xmitframe_coalesce(_adapter *padapter, _pkt *pkt, struct xmit_frame
struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv;
struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
struct rtw_ieee80211_hdr *pwlanhdr;
struct ieee80211_hdr *pwlanhdr;
u8 MME[_MME_IE_LENGTH_];
_irqL irqL;
@ -2792,14 +2792,14 @@ s32 rtw_mgmt_xmitframe_coalesce(_adapter *padapter, _pkt *pkt, struct xmit_frame
}
mem_start = pframe = (u8 *)(pxmitframe->buf_addr) + TXDESC_OFFSET;
pwlanhdr = (struct rtw_ieee80211_hdr *)pframe;
pwlanhdr = (struct ieee80211_hdr *)pframe;
subtype = get_frame_sub_type(pframe); /* bit(7)~bit(2) */
/* check if robust mgmt frame */
if (subtype != IEEE80211_STYPE_DEAUTH && subtype != IEEE80211_STYPE_DISASSOC && subtype != IEEE80211_STYPE_ACTION)
return _SUCCESS;
if (subtype == IEEE80211_STYPE_ACTION) {
category = *(pframe + sizeof(struct rtw_ieee80211_hdr_3addr));
category = *(pframe + sizeof(struct ieee80211_hdr_3addr));
if (CATEGORY_IS_NON_ROBUST(category))
return _SUCCESS;
}
@ -2878,7 +2878,7 @@ s32 rtw_mgmt_xmitframe_coalesce(_adapter *padapter, _pkt *pkt, struct xmit_frame
memset(MME, 0, _MME_IE_LENGTH_);
MGMT_body = pframe + sizeof(struct rtw_ieee80211_hdr_3addr);
MGMT_body = pframe + sizeof(struct ieee80211_hdr_3addr);
pframe += pattrib->pktlen;
/* octent 0 and 1 is key index ,BIP keyid is 4 or 5, LSB only need octent 0 */
@ -2891,10 +2891,10 @@ s32 rtw_mgmt_xmitframe_coalesce(_adapter *padapter, _pkt *pkt, struct xmit_frame
pframe = rtw_set_ie(pframe, WLAN_EID_MMIE , 16 , MME, &(pattrib->pktlen));
pattrib->last_txcmdsz = pattrib->pktlen;
/* total frame length - header length */
frame_body_len = pattrib->pktlen - sizeof(struct rtw_ieee80211_hdr_3addr);
frame_body_len = pattrib->pktlen - sizeof(struct ieee80211_hdr_3addr);
/* conscruct AAD, copy frame control field */
memcpy(BIP_AAD, &pwlanhdr->frame_ctl, 2);
memcpy(BIP_AAD, &pwlanhdr->frame_control, 2);
ClearRetry(BIP_AAD);
ClearPwrMgt(BIP_AAD);
ClearMData(BIP_AAD);
@ -4371,7 +4371,7 @@ s32 rtw_monitor_xmit_entry(struct sk_buff *skb, struct net_device *ndev)
struct ieee80211_radiotap_header rtap_hdr;
_adapter *padapter = (_adapter *)rtw_netdev_priv(ndev);
struct pkt_file pktfile;
struct rtw_ieee80211_hdr *pwlanhdr;
struct ieee80211_hdr *pwlanhdr;
struct pkt_attrib *pattrib;
struct xmit_frame *pmgntframe;
struct mlme_ext_priv *pmlmeext = &(padapter->mlmeextpriv);
@ -4416,9 +4416,9 @@ s32 rtw_monitor_xmit_entry(struct sk_buff *skb, struct net_device *ndev)
/* Check DATA/MGNT frames */
pwlanhdr = (struct rtw_ieee80211_hdr *)pframe;
frame_ctl = le16_to_cpu(pwlanhdr->frame_ctl);
if ((frame_ctl & RTW_IEEE80211_FCTL_FTYPE) == RTW_IEEE80211_FTYPE_DATA) {
pwlanhdr = (struct ieee80211_hdr *)pframe;
frame_ctl = le16_to_cpu(pwlanhdr->frame_control);
if ((frame_ctl & IEEE80211_FCTL_FTYPE) == IEEE80211_FTYPE_DATA) {
pattrib = &pmgntframe->attrib;
update_monitor_frame_attrib(padapter, pattrib);

View File

@ -142,13 +142,13 @@ u8 HalPwrSeqCmdParsing(
RTW_ERR("[WARNING] PCIE polling(0x%X) timeout(%d), Toggle 0x04[3] and try again.\n", offset, maxPollingCnt);
if (IS_HARDWARE_TYPE_8723DE(padapter))
PlatformEFIOWrite1Byte(padapter, 0x40, (PlatformEFIORead1Byte(padapter, 0x40)) & (~BIT3));
rtw_write8(padapter, 0x40, (rtw_read8(padapter, 0x40)) & (~BIT3));
PlatformEFIOWrite1Byte(padapter, 0x04, PlatformEFIORead1Byte(padapter, 0x04) | BIT3);
PlatformEFIOWrite1Byte(padapter, 0x04, PlatformEFIORead1Byte(padapter, 0x04) & ~BIT3);
rtw_write8(padapter, 0x04, rtw_read8(padapter, 0x04) | BIT3);
rtw_write8(padapter, 0x04, rtw_read8(padapter, 0x04) & ~BIT3);
if (IS_HARDWARE_TYPE_8723DE(padapter))
PlatformEFIOWrite1Byte(padapter, 0x40, PlatformEFIORead1Byte(padapter, 0x40)|BIT3);
rtw_write8(padapter, 0x40, rtw_read8(padapter, 0x40)|BIT3);
/* Retry Polling Process one more time */
pollingCount = 0;

View File

@ -5955,7 +5955,7 @@ static void rtw_hal_construct_P2PBeacon(_adapter *padapter, u8 *pframe, u32 *pLe
/* struct xmit_frame *pmgntframe; */
/* struct pkt_attrib *pattrib; */
/* unsigned char *pframe; */
struct rtw_ieee80211_hdr *pwlanhdr;
struct ieee80211_hdr *pwlanhdr;
unsigned short *fctrl;
unsigned int rate_len;
struct xmit_priv *pxmitpriv = &(padapter->xmitpriv);
@ -5968,7 +5968,6 @@ static void rtw_hal_construct_P2PBeacon(_adapter *padapter, u8 *pframe, u32 *pLe
struct mlme_ext_priv *pmlmeext = &(padapter->mlmeextpriv);
struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info);
WLAN_BSSID_EX *cur_network = &(pmlmeinfo->network);
u8 bc_addr[] = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff};
#ifdef CONFIG_P2P
struct wifidirect_info *pwdinfo = &(padapter->wdinfo);
#endif /* CONFIG_P2P */
@ -5982,13 +5981,13 @@ static void rtw_hal_construct_P2PBeacon(_adapter *padapter, u8 *pframe, u32 *pLe
/* _enter_critical_bh(&pmlmepriv->bcn_update_lock, &irqL);
* #endif */ /* #if defined (CONFIG_AP_MODE) && defined (CONFIG_NATIVEAP_MLME) */
pwlanhdr = (struct rtw_ieee80211_hdr *)pframe;
pwlanhdr = (struct ieee80211_hdr *)pframe;
fctrl = &(pwlanhdr->frame_ctl);
fctrl =&pwlanhdr->frame_control;
*(fctrl) = 0;
memcpy(pwlanhdr->addr1, bc_addr, ETH_ALEN);
eth_broadcast_addr(pwlanhdr->addr1);
memcpy(pwlanhdr->addr2, adapter_mac_addr(padapter), ETH_ALEN);
memcpy(pwlanhdr->addr3, get_my_bssid(cur_network), ETH_ALEN);
@ -5996,8 +5995,8 @@ static void rtw_hal_construct_P2PBeacon(_adapter *padapter, u8 *pframe, u32 *pLe
/* pmlmeext->mgnt_seq++; */
set_frame_sub_type(pframe, IEEE80211_STYPE_BEACON);
pframe += sizeof(struct rtw_ieee80211_hdr_3addr);
pktlen = sizeof(struct rtw_ieee80211_hdr_3addr);
pframe += sizeof(struct ieee80211_hdr_3addr);
pktlen = sizeof(struct ieee80211_hdr_3addr);
if ((pmlmeinfo->state & 0x03) == WIFI_FW_AP_STATE) {
/* RTW_INFO("ie len=%d\n", cur_network->IELength); */
@ -6113,8 +6112,8 @@ static void rtw_hal_construct_P2PBeacon(_adapter *padapter, u8 *pframe, u32 *pLe
u8 *wps_ie;
uint wps_ielen;
u8 sr = 0;
wps_ie = rtw_get_wps_ie(pmgntframe->buf_addr + TXDESC_OFFSET + sizeof(struct rtw_ieee80211_hdr_3addr) + _BEACON_IE_OFFSET_,
pattrib->pktlen - sizeof(struct rtw_ieee80211_hdr_3addr) - _BEACON_IE_OFFSET_, NULL, &wps_ielen);
wps_ie = rtw_get_wps_ie(pmgntframe->buf_addr + TXDESC_OFFSET + sizeof(struct ieee80211_hdr_3addr) + _BEACON_IE_OFFSET_,
pattrib->pktlen - sizeof(struct ieee80211_hdr_3addr) - _BEACON_IE_OFFSET_, NULL, &wps_ielen);
if (wps_ie && wps_ielen > 0)
rtw_get_wps_attr_content(wps_ie, wps_ielen, WPS_ATTR_SELECTED_REGISTRAR, (u8 *)(&sr), NULL);
if (sr != 0)
@ -6232,7 +6231,7 @@ static void rtw_hal_construct_P2PProbeRsp(_adapter *padapter, u8 *pframe, u32 *p
/* struct xmit_frame *pmgntframe; */
/* struct pkt_attrib *pattrib; */
/* unsigned char *pframe; */
struct rtw_ieee80211_hdr *pwlanhdr;
struct ieee80211_hdr *pwlanhdr;
unsigned short *fctrl;
unsigned char *mac;
struct xmit_priv *pxmitpriv = &(padapter->xmitpriv);
@ -6258,11 +6257,11 @@ static void rtw_hal_construct_P2PProbeRsp(_adapter *padapter, u8 *pframe, u32 *p
u8 dbgbufLen = 0, index = 0;
RTW_INFO("%s\n", __FUNCTION__);
pwlanhdr = (struct rtw_ieee80211_hdr *)pframe;
pwlanhdr = (struct ieee80211_hdr *)pframe;
mac = adapter_mac_addr(padapter);
fctrl = &(pwlanhdr->frame_ctl);
fctrl =&pwlanhdr->frame_control;
*(fctrl) = 0;
/* DA filled by FW */
@ -6275,7 +6274,7 @@ static void rtw_hal_construct_P2PProbeRsp(_adapter *padapter, u8 *pframe, u32 *p
SetSeqNum(pwlanhdr, 0);
set_frame_sub_type(fctrl, IEEE80211_STYPE_PROBE_RESP);
pktlen = sizeof(struct rtw_ieee80211_hdr_3addr);
pktlen = sizeof(struct ieee80211_hdr_3addr);
pframe += pktlen;
@ -6551,7 +6550,7 @@ static void rtw_hal_construct_P2PProbeRsp(_adapter *padapter, u8 *pframe, u32 *p
static void rtw_hal_construct_P2PNegoRsp(_adapter *padapter, u8 *pframe, u32 *pLength)
{
struct p2p_channels *ch_list = &(adapter_to_rfctl(padapter)->channel_list);
unsigned char category = RTW_WLAN_CATEGORY_PUBLIC;
unsigned char category = WLAN_CATEGORY_PUBLIC;
u8 action = P2P_PUB_ACTION_ACTION;
u32 p2poui = cpu_to_be32(P2POUI);
u8 oui_subtype = P2P_GO_NEGO_RESP;
@ -6568,7 +6567,7 @@ static void rtw_hal_construct_P2PNegoRsp(_adapter *padapter, u8 *pframe, u32 *pL
/* struct xmit_frame *pmgntframe; */
/* struct pkt_attrib *pattrib; */
/* unsigned char *pframe; */
struct rtw_ieee80211_hdr *pwlanhdr;
struct ieee80211_hdr *pwlanhdr;
unsigned short *fctrl;
struct xmit_priv *pxmitpriv = &(padapter->xmitpriv);
struct mlme_ext_priv *pmlmeext = &(padapter->mlmeextpriv);
@ -6585,9 +6584,9 @@ static void rtw_hal_construct_P2PNegoRsp(_adapter *padapter, u8 *pframe, u32 *pL
u8 dbgbufLen = 0, index = 0;
RTW_INFO("%s\n", __FUNCTION__);
pwlanhdr = (struct rtw_ieee80211_hdr *)pframe;
pwlanhdr = (struct ieee80211_hdr *)pframe;
fctrl = &(pwlanhdr->frame_ctl);
fctrl =&pwlanhdr->frame_control;
*(fctrl) = 0;
/* RA, filled by FW */
@ -6598,7 +6597,7 @@ static void rtw_hal_construct_P2PNegoRsp(_adapter *padapter, u8 *pframe, u32 *pL
SetSeqNum(pwlanhdr, 0);
set_frame_sub_type(pframe, IEEE80211_STYPE_ACTION);
pktlen = sizeof(struct rtw_ieee80211_hdr_3addr);
pktlen = sizeof(struct ieee80211_hdr_3addr);
pframe += pktlen;
pframe = rtw_set_fixed_ie(pframe, 1, &(category), &(pktlen));
@ -6954,7 +6953,7 @@ static void rtw_hal_construct_P2PNegoRsp(_adapter *padapter, u8 *pframe, u32 *pL
static void rtw_hal_construct_P2PInviteRsp(_adapter *padapter, u8 *pframe, u32 *pLength)
{
unsigned char category = RTW_WLAN_CATEGORY_PUBLIC;
unsigned char category = WLAN_CATEGORY_PUBLIC;
u8 action = P2P_PUB_ACTION_ACTION;
u32 p2poui = cpu_to_be32(P2POUI);
u8 oui_subtype = P2P_INVIT_RESP;
@ -6971,7 +6970,7 @@ static void rtw_hal_construct_P2PInviteRsp(_adapter *padapter, u8 *pframe, u32 *
/* struct xmit_frame *pmgntframe; */
/* struct pkt_attrib *pattrib; */
/* unsigned char *pframe; */
struct rtw_ieee80211_hdr *pwlanhdr;
struct ieee80211_hdr *pwlanhdr;
unsigned short *fctrl;
struct xmit_priv *pxmitpriv = &(padapter->xmitpriv);
struct mlme_ext_priv *pmlmeext = &(padapter->mlmeextpriv);
@ -6984,9 +6983,9 @@ static void rtw_hal_construct_P2PInviteRsp(_adapter *padapter, u8 *pframe, u32 *
RTW_INFO("%s\n", __FUNCTION__);
pwlanhdr = (struct rtw_ieee80211_hdr *)pframe;
pwlanhdr = (struct ieee80211_hdr *)pframe;
fctrl = &(pwlanhdr->frame_ctl);
fctrl =&pwlanhdr->frame_control;
*(fctrl) = 0;
/* RA fill by FW */
@ -6999,8 +6998,8 @@ static void rtw_hal_construct_P2PInviteRsp(_adapter *padapter, u8 *pframe, u32 *
SetSeqNum(pwlanhdr, 0);
set_frame_sub_type(pframe, IEEE80211_STYPE_ACTION);
pframe += sizeof(struct rtw_ieee80211_hdr_3addr);
pktlen = sizeof(struct rtw_ieee80211_hdr_3addr);
pframe += sizeof(struct ieee80211_hdr_3addr);
pktlen = sizeof(struct ieee80211_hdr_3addr);
pframe = rtw_set_fixed_ie(pframe, 1, &(category), &(pktlen));
pframe = rtw_set_fixed_ie(pframe, 1, &(action), &(pktlen));
@ -7201,7 +7200,7 @@ static void rtw_hal_construct_P2PInviteRsp(_adapter *padapter, u8 *pframe, u32 *
static void rtw_hal_construct_P2PProvisionDisRsp(_adapter *padapter, u8 *pframe, u32 *pLength)
{
unsigned char category = RTW_WLAN_CATEGORY_PUBLIC;
unsigned char category = WLAN_CATEGORY_PUBLIC;
u8 action = P2P_PUB_ACTION_ACTION;
u8 dialogToken = 0;
u32 p2poui = cpu_to_be32(P2POUI);
@ -7216,7 +7215,7 @@ static void rtw_hal_construct_P2PProvisionDisRsp(_adapter *padapter, u8 *pframe,
/* struct xmit_frame *pmgntframe; */
/* struct pkt_attrib *pattrib; */
/* unsigned char *pframe; */
struct rtw_ieee80211_hdr *pwlanhdr;
struct ieee80211_hdr *pwlanhdr;
unsigned short *fctrl;
struct xmit_priv *pxmitpriv = &(padapter->xmitpriv);
struct mlme_ext_priv *pmlmeext = &(padapter->mlmeextpriv);
@ -7229,9 +7228,9 @@ static void rtw_hal_construct_P2PProvisionDisRsp(_adapter *padapter, u8 *pframe,
RTW_INFO("%s\n", __FUNCTION__);
pwlanhdr = (struct rtw_ieee80211_hdr *)pframe;
pwlanhdr = (struct ieee80211_hdr *)pframe;
fctrl = &(pwlanhdr->frame_ctl);
fctrl =&pwlanhdr->frame_control;
*(fctrl) = 0;
/* RA filled by FW */
@ -7242,8 +7241,8 @@ static void rtw_hal_construct_P2PProvisionDisRsp(_adapter *padapter, u8 *pframe,
SetSeqNum(pwlanhdr, 0);
set_frame_sub_type(pframe, IEEE80211_STYPE_ACTION);
pframe += sizeof(struct rtw_ieee80211_hdr_3addr);
pktlen = sizeof(struct rtw_ieee80211_hdr_3addr);
pframe += sizeof(struct ieee80211_hdr_3addr);
pktlen = sizeof(struct ieee80211_hdr_3addr);
pframe = rtw_set_fixed_ie(pframe, 1, &(category), &(pktlen));
pframe = rtw_set_fixed_ie(pframe, 1, &(action), &(pktlen));
@ -7383,23 +7382,21 @@ u8 rtw_hal_set_p2p_wowlan_offload_cmd(_adapter *adapter)
void rtw_hal_construct_beacon(_adapter *padapter,
u8 *pframe, u32 *pLength)
{
struct rtw_ieee80211_hdr *pwlanhdr;
struct ieee80211_hdr *pwlanhdr;
u16 *fctrl;
u32 rate_len, pktlen;
struct mlme_ext_priv *pmlmeext = &(padapter->mlmeextpriv);
struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info);
WLAN_BSSID_EX *cur_network = &(pmlmeinfo->network);
u8 bc_addr[] = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff};
/* RTW_INFO("%s\n", __FUNCTION__); */
pwlanhdr = (struct rtw_ieee80211_hdr *)pframe;
pwlanhdr = (struct ieee80211_hdr *)pframe;
fctrl = &(pwlanhdr->frame_ctl);
fctrl =&pwlanhdr->frame_control;
*(fctrl) = 0;
memcpy(pwlanhdr->addr1, bc_addr, ETH_ALEN);
eth_broadcast_addr(pwlanhdr->addr1);
memcpy(pwlanhdr->addr2, adapter_mac_addr(padapter), ETH_ALEN);
memcpy(pwlanhdr->addr3, get_my_bssid(cur_network), ETH_ALEN);
@ -7407,8 +7404,8 @@ void rtw_hal_construct_beacon(_adapter *padapter,
/* pmlmeext->mgnt_seq++; */
set_frame_sub_type(pframe, IEEE80211_STYPE_BEACON);
pframe += sizeof(struct rtw_ieee80211_hdr_3addr);
pktlen = sizeof(struct rtw_ieee80211_hdr_3addr);
pframe += sizeof(struct ieee80211_hdr_3addr);
pktlen = sizeof(struct ieee80211_hdr_3addr);
/* timestamp will be inserted by hardware */
pframe += 8;
@ -7484,7 +7481,7 @@ _ConstructBeacon:
static void rtw_hal_construct_PSPoll(_adapter *padapter,
u8 *pframe, u32 *pLength)
{
struct rtw_ieee80211_hdr *pwlanhdr;
struct ieee80211_hdr *pwlanhdr;
u16 *fctrl;
u32 pktlen;
struct mlme_ext_priv *pmlmeext = &(padapter->mlmeextpriv);
@ -7492,10 +7489,10 @@ static void rtw_hal_construct_PSPoll(_adapter *padapter,
/* RTW_INFO("%s\n", __FUNCTION__); */
pwlanhdr = (struct rtw_ieee80211_hdr *)pframe;
pwlanhdr = (struct ieee80211_hdr *)pframe;
/* Frame control. */
fctrl = &(pwlanhdr->frame_ctl);
fctrl =&pwlanhdr->frame_control;
*(fctrl) = 0;
SetPwrMgt(fctrl);
set_frame_sub_type(pframe, (IEEE80211_FTYPE_CTL | IEEE80211_STYPE_PSPOLL));
@ -7519,24 +7516,22 @@ void rtw_hal_construct_fw_dbg_msg_pkt(
u8 *pframe,
u32 *plength)
{
struct rtw_ieee80211_hdr *pwlanhdr;
struct ieee80211_hdr *pwlanhdr;
u16 *fctrl;
u32 pktlen;
struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
struct wlan_network *cur_network = &pmlmepriv->cur_network;
struct mlme_ext_priv *pmlmeext = &(padapter->mlmeextpriv);
struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info);
u8 bc_addr[] = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff};
/* RTW_INFO("%s:%d\n", __FUNCTION__, bForcePowerSave); */
pwlanhdr = (struct rtw_ieee80211_hdr *)pframe;
pwlanhdr = (struct ieee80211_hdr *)pframe;
fctrl = &pwlanhdr->frame_ctl;
fctrl =&pwlanhdr->frame_control;
*(fctrl) = 0;
memcpy(pwlanhdr->addr1, bc_addr, ETH_ALEN);
eth_broadcast_addr(pwlanhdr->addr1);
memcpy(pwlanhdr->addr2, adapter_mac_addr(padapter), ETH_ALEN);
memcpy(pwlanhdr->addr3, get_my_bssid(&(pmlmeinfo->network)), ETH_ALEN);
@ -7544,7 +7539,7 @@ void rtw_hal_construct_fw_dbg_msg_pkt(
set_frame_sub_type(pframe, (IEEE80211_FTYPE_DATA | IEEE80211_STYPE_DATA));
pktlen = sizeof(struct rtw_ieee80211_hdr_3addr);
pktlen = sizeof(struct ieee80211_hdr_3addr);
*plength = pktlen;
}
@ -7559,7 +7554,7 @@ void rtw_hal_construct_NullFunctionData(
u8 bEosp,
u8 bForcePowerSave)
{
struct rtw_ieee80211_hdr *pwlanhdr;
struct ieee80211_hdr *pwlanhdr;
u16 *fctrl;
u32 pktlen;
struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
@ -7571,9 +7566,9 @@ void rtw_hal_construct_NullFunctionData(
/* RTW_INFO("%s:%d\n", __FUNCTION__, bForcePowerSave); */
pwlanhdr = (struct rtw_ieee80211_hdr *)pframe;
pwlanhdr = (struct ieee80211_hdr *)pframe;
fctrl = &pwlanhdr->frame_ctl;
fctrl =&pwlanhdr->frame_control;
*(fctrl) = 0;
if (bForcePowerSave)
SetPwrMgt(fctrl);
@ -7609,19 +7604,19 @@ void rtw_hal_construct_NullFunctionData(
set_duration(pwlanhdr, 0);
if (bQoS == _TRUE) {
struct rtw_ieee80211_hdr_3addr_qos *pwlanqoshdr;
struct ieee80211_qos_hdr *pwlanqoshdr;
set_frame_sub_type(pframe, IEEE80211_FTYPE_DATA | IEEE80211_STYPE_QOS_NULLFUNC);
pwlanqoshdr = (struct rtw_ieee80211_hdr_3addr_qos *)pframe;
SetPriority(&pwlanqoshdr->qc, AC);
SetEOSP(&pwlanqoshdr->qc, bEosp);
pwlanqoshdr = (struct ieee80211_qos_hdr *)pframe;
SetPriority(&pwlanqoshdr->qos_ctrl, AC);
SetEOSP(&pwlanqoshdr->qos_ctrl, bEosp);
pktlen = sizeof(struct rtw_ieee80211_hdr_3addr_qos);
pktlen = sizeof(struct ieee80211_qos_hdr);
} else {
set_frame_sub_type(pframe, IEEE80211_FTYPE_DATA | IEEE80211_STYPE_NULLFUNC);
pktlen = sizeof(struct rtw_ieee80211_hdr_3addr);
pktlen = sizeof(struct ieee80211_hdr_3addr);
}
*pLength = pktlen;
@ -7630,7 +7625,7 @@ void rtw_hal_construct_NullFunctionData(
void rtw_hal_construct_ProbeRsp(_adapter *padapter, u8 *pframe, u32 *pLength,
BOOLEAN bHideSSID)
{
struct rtw_ieee80211_hdr *pwlanhdr;
struct ieee80211_hdr *pwlanhdr;
u16 *fctrl;
u8 *mac, *bssid, *sta_addr;
u32 pktlen;
@ -7640,13 +7635,13 @@ void rtw_hal_construct_ProbeRsp(_adapter *padapter, u8 *pframe, u32 *pLength,
/*RTW_INFO("%s\n", __FUNCTION__);*/
pwlanhdr = (struct rtw_ieee80211_hdr *)pframe;
pwlanhdr = (struct ieee80211_hdr *)pframe;
mac = adapter_mac_addr(padapter);
bssid = cur_network->MacAddress;
sta_addr = get_my_bssid(&pmlmeinfo->network);
fctrl = &(pwlanhdr->frame_ctl);
fctrl =&pwlanhdr->frame_control;
*(fctrl) = 0;
memcpy(pwlanhdr->addr1, sta_addr, ETH_ALEN);
memcpy(pwlanhdr->addr2, mac, ETH_ALEN);
@ -7655,7 +7650,7 @@ void rtw_hal_construct_ProbeRsp(_adapter *padapter, u8 *pframe, u32 *pLength,
SetSeqNum(pwlanhdr, 0);
set_frame_sub_type(fctrl, IEEE80211_STYPE_PROBE_RESP);
pktlen = sizeof(struct rtw_ieee80211_hdr_3addr);
pktlen = sizeof(struct ieee80211_hdr_3addr);
pframe += pktlen;
if (cur_network->IELength > MAX_IE_SZ)
@ -7674,7 +7669,7 @@ static void rtw_hal_append_tkip_mic(PADAPTER padapter,
{
struct mlme_ext_priv *pmlmeext = &(padapter->mlmeextpriv);
struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info);
struct rtw_ieee80211_hdr *pwlanhdr;
struct ieee80211_hdr *pwlanhdr;
struct mic_data micdata;
struct sta_info *psta = NULL;
int res = 0;
@ -7687,7 +7682,7 @@ static void rtw_hal_append_tkip_mic(PADAPTER padapter,
RTW_INFO("%s(): Add MIC, offset: %d\n", __func__, offset);
pwlanhdr = (struct rtw_ieee80211_hdr *)pframe;
pwlanhdr = (struct ieee80211_hdr *)pframe;
psta = rtw_get_stainfo(&padapter->stapriv,
get_my_bssid(&(pmlmeinfo->network)));
@ -7726,7 +7721,7 @@ static void rtw_hal_construct_ARPRsp(
u8 *pIPAddress
)
{
struct rtw_ieee80211_hdr *pwlanhdr;
struct ieee80211_hdr *pwlanhdr;
u16 *fctrl;
u32 pktlen;
struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
@ -7741,9 +7736,9 @@ static void rtw_hal_construct_ARPRsp(
u8 EncryptionHeadOverhead = 0, arp_offset = 0;
/* RTW_INFO("%s:%d\n", __FUNCTION__, bForcePowerSave); */
pwlanhdr = (struct rtw_ieee80211_hdr *)pframe;
pwlanhdr = (struct ieee80211_hdr *)pframe;
fctrl = &pwlanhdr->frame_ctl;
fctrl =&pwlanhdr->frame_control;
*(fctrl) = 0;
/* ------------------------------------------------------------------------- */
@ -7853,7 +7848,7 @@ static void rtw_hal_construct_ARPRsp(
static void rtw_hal_construct_na_message(_adapter *padapter,
u8 *pframe, u32 *pLength)
{
struct rtw_ieee80211_hdr *pwlanhdr = NULL;
struct ieee80211_hdr *pwlanhdr = NULL;
struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
struct wlan_network *cur_network = &pmlmepriv->cur_network;
struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv;
@ -7875,9 +7870,9 @@ static void rtw_hal_construct_na_message(_adapter *padapter,
u8 EncryptionHeadOverhead = 0, na_msg_offset = 0;
/* RTW_INFO("%s:%d\n", __FUNCTION__, bForcePowerSave); */
pwlanhdr = (struct rtw_ieee80211_hdr *)pframe;
pwlanhdr = (struct ieee80211_hdr *)pframe;
fctrl = &pwlanhdr->frame_ctl;
fctrl =&pwlanhdr->frame_control;
*(fctrl) = 0;
/* ------------------------------------------------------------------------- */
@ -8030,7 +8025,7 @@ static void rtw_hal_construct_ndp_info(_adapter *padapter,
static void rtw_hal_construct_ProbeReq(_adapter *padapter, u8 *pframe,
u32 *pLength, pno_ssid_t *ssid)
{
struct rtw_ieee80211_hdr *pwlanhdr;
struct ieee80211_hdr *pwlanhdr;
u16 *fctrl;
u32 pktlen;
unsigned char *mac;
@ -8040,23 +8035,22 @@ static void rtw_hal_construct_ProbeReq(_adapter *padapter, u8 *pframe,
struct mlme_ext_priv *pmlmeext = &(padapter->mlmeextpriv);
struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info);
int bssrate_len = 0;
u8 bc_addr[] = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff};
pwlanhdr = (struct rtw_ieee80211_hdr *)pframe;
pwlanhdr = (struct ieee80211_hdr *)pframe;
mac = adapter_mac_addr(padapter);
fctrl = &(pwlanhdr->frame_ctl);
fctrl =&pwlanhdr->frame_control;
*(fctrl) = 0;
memcpy(pwlanhdr->addr1, bc_addr, ETH_ALEN);
memcpy(pwlanhdr->addr3, bc_addr, ETH_ALEN);
eth_broadcast_addr(pwlanhdr->addr1);
eth_broadcast_addr(pwlanhdr->addr3);
memcpy(pwlanhdr->addr2, mac, ETH_ALEN);
SetSeqNum(pwlanhdr, 0);
set_frame_sub_type(pframe, IEEE80211_STYPE_PROBE_REQ);
pktlen = sizeof(struct rtw_ieee80211_hdr_3addr);
pktlen = sizeof(struct ieee80211_hdr_3addr);
pframe += pktlen;
if (ssid == NULL)
@ -8210,7 +8204,7 @@ static void rtw_hal_construct_GTKRsp(
u32 *pLength
)
{
struct rtw_ieee80211_hdr *pwlanhdr;
struct ieee80211_hdr *pwlanhdr;
u16 *fctrl;
u32 pktlen;
struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
@ -8224,9 +8218,9 @@ static void rtw_hal_construct_GTKRsp(
u8 EncryptionHeadOverhead = 0;
/* RTW_INFO("%s:%d\n", __FUNCTION__, bForcePowerSave); */
pwlanhdr = (struct rtw_ieee80211_hdr *)pframe;
pwlanhdr = (struct ieee80211_hdr *)pframe;
fctrl = &pwlanhdr->frame_ctl;
fctrl =&pwlanhdr->frame_control;
*(fctrl) = 0;
/* ------------------------------------------------------------------------- */

View File

@ -98,7 +98,7 @@ static void rtw_hal_mcc_build_p2p_noa_attr(PADAPTER padapter, u8 *ie, u32 *ie_le
p2p_noa_attr_len = p2p_noa_attr_len + 1;
/* attrute length(2 bytes) length = noa_desc_num*13 + 2 */
RTW_PUT_LE16(p2p_noa_attr_ie + p2p_noa_attr_len, (noa_desc_num * 13 + 2));
*(u16 *) (p2p_noa_attr_ie + p2p_noa_attr_len) = cpu_to_le16(noa_desc_num * 13 + 2);
p2p_noa_attr_len = p2p_noa_attr_len + 2;
/* Index (1 byte) */
@ -984,8 +984,6 @@ exit:
static void rtw_hal_construct_CTS(PADAPTER padapter, u8 *pframe, u32 *pLength)
{
u8 broadcast_addr[ETH_ALEN] = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff};
/* frame type, length = 1*/
set_frame_sub_type(pframe, WIFI_RTS);
@ -997,7 +995,7 @@ static void rtw_hal_construct_CTS(PADAPTER padapter, u8 *pframe, u32 *pLength)
*(pframe + 3) = 0x78;
/* frame recvaddr, length = 6 */
memcpy((pframe + 4), broadcast_addr, ETH_ALEN);
eth_broadcast_addr((pframe + 4));
memcpy((pframe + 4 + ETH_ALEN), adapter_mac_addr(padapter), ETH_ALEN);
memcpy((pframe + 4 + ETH_ALEN*2), adapter_mac_addr(padapter), ETH_ALEN);
*pLength = 22;

View File

@ -90,7 +90,7 @@ void hal_mpt_SwitchRfSetting(PADAPTER pAdapter)
pMptCtx->backup0x52_RF_A = (u1Byte)phy_query_rf_reg(pAdapter, RF_PATH_A, RF_0x52, 0x000F0);
pMptCtx->backup0x52_RF_B = (u1Byte)phy_query_rf_reg(pAdapter, RF_PATH_B, RF_0x52, 0x000F0);
if ((PlatformEFIORead4Byte(pAdapter, 0xF4) & BIT29) == BIT29) {
if ((rtw_read32(pAdapter, 0xF4) & BIT29) == BIT29) {
phy_set_rf_reg(pAdapter, RF_PATH_A, RF_0x52, 0x000F0, 0xB);
phy_set_rf_reg(pAdapter, RF_PATH_B, RF_0x52, 0x000F0, 0xB);
} else {

View File

@ -760,9 +760,6 @@ void halrf_segment_iqk_trigger(void *dm_void, boolean clear,
return;
#endif
#if DISABLE_BB_RF
return;
#endif
if (iqk_info->rfk_forbidden)
return;
@ -1330,10 +1327,6 @@ void halrf_iqk_trigger(void *dm_void, boolean is_recovery)
if (!(rf->rf_supportability & HAL_RF_IQK))
return;
#if DISABLE_BB_RF
return;
#endif
if (iqk_info->rfk_forbidden)
return;
@ -1483,9 +1476,6 @@ void halrf_lck_trigger(void *dm_void)
if (!(rf->rf_supportability & HAL_RF_LCK))
return;
#if DISABLE_BB_RF
return;
#endif
if (iqk_info->rfk_forbidden)
return;
while (*dm->is_scan_in_process) {

View File

@ -1754,10 +1754,6 @@ void phy_set_rf_path_switch_8192e(
HAL_DATA_TYPE *hal_data = GET_HAL_DATA(adapter);
#endif
#ifdef DISABLE_BB_RF
return;
#endif
#if !(DM_ODM_SUPPORT_TYPE & ODM_AP)
if (IS_92C_SERIAL(hal_data->version_id))
_phy_set_rf_path_switch_8192e(adapter, is_main, true);

View File

@ -1961,10 +1961,6 @@ void phy_set_rf_path_switch_8192e(
HAL_DATA_TYPE *hal_data = GET_HAL_DATA(adapter);
#endif
#if DISABLE_BB_RF
return;
#endif
#if !(DM_ODM_SUPPORT_TYPE & ODM_AP)
#if (DM_ODM_SUPPORT_TYPE == ODM_CE)
_phy_set_rf_path_switch_8192e(dm, is_main, true);
@ -2012,9 +2008,6 @@ boolean phy_query_rf_path_switch_8192e(
{
HAL_DATA_TYPE *hal_data = GET_HAL_DATA(adapter);
#if DISABLE_BB_RF
return true;
#endif
#if !(DM_ODM_SUPPORT_TYPE & ODM_AP)
if (IS_2T2R(hal_data->version_id))
return _phy_query_rf_path_switch_8192e(adapter, true);

View File

@ -2070,10 +2070,6 @@ void phy_set_rf_path_switch_8192e(
/* HAL_DATA_TYPE *hal_data = GET_HAL_DATA(((PADAPTER)adapter)); */
#endif
#if DISABLE_BB_RF
return;
#endif
#if !(DM_ODM_SUPPORT_TYPE & ODM_AP)
_phy_set_rf_path_switch_8192e(adapter, is_main, true);
@ -2123,9 +2119,6 @@ boolean phy_query_rf_path_switch_8192e(
{
HAL_DATA_TYPE *hal_data = GET_HAL_DATA(((PADAPTER)adapter));
#if DISABLE_BB_RF
return true;
#endif
#if !(DM_ODM_SUPPORT_TYPE & ODM_AP)
if (IS_2T2R(hal_data->VersionID))
return _phy_query_rf_path_switch_8192e(adapter, true);

View File

@ -52,7 +52,7 @@ u8 odm_read_1byte(struct dm_struct *dm, u32 reg_addr)
return rtw_read8(adapter, reg_addr);
#elif (DM_ODM_SUPPORT_TYPE & ODM_WIN)
void *adapter = dm->adapter;
return PlatformEFIORead1Byte(adapter, reg_addr);
return rtw_read8(adapter, reg_addr);
#elif (DM_ODM_SUPPORT_TYPE & ODM_IOT)
void *adapter = dm->adapter;
@ -78,7 +78,7 @@ u16 odm_read_2byte(struct dm_struct *dm, u32 reg_addr)
return rtw_read16(adapter, reg_addr);
#elif (DM_ODM_SUPPORT_TYPE & ODM_WIN)
void *adapter = dm->adapter;
return PlatformEFIORead2Byte(adapter, reg_addr);
return rtw_read16(adapter, reg_addr);
#elif (DM_ODM_SUPPORT_TYPE & ODM_IOT)
void *adapter = dm->adapter;
@ -104,7 +104,7 @@ u32 odm_read_4byte(struct dm_struct *dm, u32 reg_addr)
return rtw_read32(adapter, reg_addr);
#elif (DM_ODM_SUPPORT_TYPE & ODM_WIN)
void *adapter = dm->adapter;
return PlatformEFIORead4Byte(adapter, reg_addr);
return rtw_read32(adapter, reg_addr);
#elif (DM_ODM_SUPPORT_TYPE & ODM_IOT)
void *adapter = dm->adapter;
@ -130,7 +130,7 @@ void odm_write_1byte(struct dm_struct *dm, u32 reg_addr, u8 data)
rtw_write8(adapter, reg_addr, data);
#elif (DM_ODM_SUPPORT_TYPE & ODM_WIN)
void *adapter = dm->adapter;
PlatformEFIOWrite1Byte(adapter, reg_addr, data);
rtw_write8(adapter, reg_addr, data);
#elif (DM_ODM_SUPPORT_TYPE & ODM_IOT)
void *adapter = dm->adapter;
@ -156,7 +156,7 @@ void odm_write_2byte(struct dm_struct *dm, u32 reg_addr, u16 data)
rtw_write16(adapter, reg_addr, data);
#elif (DM_ODM_SUPPORT_TYPE & ODM_WIN)
void *adapter = dm->adapter;
PlatformEFIOWrite2Byte(adapter, reg_addr, data);
rtw_write16(adapter, reg_addr, data);
#elif (DM_ODM_SUPPORT_TYPE & ODM_IOT)
void *adapter = dm->adapter;
@ -182,7 +182,7 @@ void odm_write_4byte(struct dm_struct *dm, u32 reg_addr, u32 data)
rtw_write32(adapter, reg_addr, data);
#elif (DM_ODM_SUPPORT_TYPE & ODM_WIN)
void *adapter = dm->adapter;
PlatformEFIOWrite4Byte(adapter, reg_addr, data);
rtw_write32(adapter, reg_addr, data);
#elif (DM_ODM_SUPPORT_TYPE & ODM_IOT)
void *adapter = dm->adapter;

View File

@ -1011,7 +1011,7 @@ send_fw_ht_ndpa_packet(
struct _ADAPTER *adapter = dm->adapter;
struct xmit_frame *pmgntframe;
struct pkt_attrib *pattrib;
struct rtw_ieee80211_hdr *pwlanhdr;
struct ieee80211_hdr *pwlanhdr;
struct xmit_priv *pxmitpriv = &(adapter->xmitpriv);
struct mlme_ext_priv *pmlmeext = &adapter->mlmeextpriv;
struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info);
@ -1048,9 +1048,9 @@ send_fw_ht_ndpa_packet(
pframe = (u8 *)(pmgntframe->buf_addr) + TXDESC_OFFSET;
pwlanhdr = (struct rtw_ieee80211_hdr *)pframe;
pwlanhdr = (struct ieee80211_hdr *)pframe;
fctrl = &pwlanhdr->frame_ctl;
fctrl =&pwlanhdr->frame_control;
*(fctrl) = 0;
set_order_bit(pframe);
@ -1099,7 +1099,7 @@ send_sw_ht_ndpa_packet(
struct _ADAPTER *adapter = dm->adapter;
struct xmit_frame *pmgntframe;
struct pkt_attrib *pattrib;
struct rtw_ieee80211_hdr *pwlanhdr;
struct ieee80211_hdr *pwlanhdr;
struct xmit_priv *pxmitpriv = &(adapter->xmitpriv);
struct mlme_ext_priv *pmlmeext = &adapter->mlmeextpriv;
struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info);
@ -1134,9 +1134,9 @@ send_sw_ht_ndpa_packet(
pframe = (u8 *)(pmgntframe->buf_addr) + TXDESC_OFFSET;
pwlanhdr = (struct rtw_ieee80211_hdr *)pframe;
pwlanhdr = (struct ieee80211_hdr *)pframe;
fctrl = &pwlanhdr->frame_ctl;
fctrl =&pwlanhdr->frame_control;
*(fctrl) = 0;
set_order_bit(pframe);
@ -1186,7 +1186,7 @@ send_fw_vht_ndpa_packet(
struct _ADAPTER *adapter = dm->adapter;
struct xmit_frame *pmgntframe;
struct pkt_attrib *pattrib;
struct rtw_ieee80211_hdr *pwlanhdr;
struct ieee80211_hdr *pwlanhdr;
struct xmit_priv *pxmitpriv = &(adapter->xmitpriv);
struct mlme_ext_priv *pmlmeext = &adapter->mlmeextpriv;
struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info);
@ -1224,9 +1224,9 @@ send_fw_vht_ndpa_packet(
pframe = (u8 *)(pmgntframe->buf_addr) + TXDESC_OFFSET;
pwlanhdr = (struct rtw_ieee80211_hdr *)pframe;
pwlanhdr = (struct ieee80211_hdr *)pframe;
fctrl = &pwlanhdr->frame_ctl;
fctrl =&pwlanhdr->frame_control;
*(fctrl) = 0;
set_frame_sub_type(pframe, WIFI_NDPA);
@ -1287,7 +1287,7 @@ send_sw_vht_ndpa_packet(
struct _ADAPTER *adapter = dm->adapter;
struct xmit_frame *pmgntframe;
struct pkt_attrib *pattrib;
struct rtw_ieee80211_hdr *pwlanhdr;
struct ieee80211_hdr *pwlanhdr;
struct xmit_priv *pxmitpriv = &(adapter->xmitpriv);
struct mlme_ext_priv *pmlmeext = &adapter->mlmeextpriv;
struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info);
@ -1325,9 +1325,9 @@ send_sw_vht_ndpa_packet(
pframe = (u8 *)(pmgntframe->buf_addr) + TXDESC_OFFSET;
pwlanhdr = (struct rtw_ieee80211_hdr *)pframe;
pwlanhdr = (struct ieee80211_hdr *)pframe;
fctrl = &pwlanhdr->frame_ctl;
fctrl =&pwlanhdr->frame_control;
*(fctrl) = 0;
set_frame_sub_type(pframe, WIFI_NDPA);

View File

@ -3633,10 +3633,6 @@ VOID _InitBeaconMaxError_8192E(
/* Set CCK and OFDM Block "ON" */
void _BBTurnOnBlock_8192E(PADAPTER padapter)
{
#if (DISABLE_BB_RF)
return;
#endif
phy_set_bb_reg(padapter, rFPGA0_RFMOD, bCCKEn, 0x1);
phy_set_bb_reg(padapter, rFPGA0_RFMOD, bOFDMEn, 0x1);
}
@ -3647,11 +3643,7 @@ hal_ReadRFType_8192E(
{
HAL_DATA_TYPE *pHalData = GET_HAL_DATA(Adapter);
#if DISABLE_BB_RF
pHalData->rf_chip = RF_PSEUDO_11N;
#else
pHalData->rf_chip = RF_6052;
#endif
pHalData->BandSet = BAND_ON_2_4G;
@ -3749,16 +3741,16 @@ u8 SetHwReg8192E(PADAPTER Adapter, u8 variable, u8 *val)
val[1] = 0x0e;
}
/* SIFS for OFDM Data ACK */
PlatformEFIOWrite1Byte(Adapter, REG_SIFS_CTX_8192E+1, val[0]);
rtw_write8(Adapter, REG_SIFS_CTX_8192E+1, val[0]);
/* SIFS for OFDM consecutive tx like CTS data! */
PlatformEFIOWrite1Byte(Adapter, REG_SIFS_TRX_8192E+1, val[1]);
rtw_write8(Adapter, REG_SIFS_TRX_8192E+1, val[1]);
PlatformEFIOWrite1Byte(Adapter, REG_SPEC_SIFS_8192E+1, val[0]);
PlatformEFIOWrite1Byte(Adapter, REG_MAC_SPEC_SIFS_8192E+1, val[0]);
rtw_write8(Adapter, REG_SPEC_SIFS_8192E+1, val[0]);
rtw_write8(Adapter, REG_MAC_SPEC_SIFS_8192E+1, val[0]);
/* Revise SIFS setting due to Hardware register definition change. */
PlatformEFIOWrite1Byte(Adapter, REG_RESP_SIFS_OFDM_8192E+1, val[0]);
PlatformEFIOWrite1Byte(Adapter, REG_RESP_SIFS_OFDM_8192E, val[0]);
rtw_write8(Adapter, REG_RESP_SIFS_OFDM_8192E+1, val[0]);
rtw_write8(Adapter, REG_RESP_SIFS_OFDM_8192E, val[0]);
}
#if 0

View File

@ -51,10 +51,6 @@ PHY_QueryBBReg8192E(
{
u32 ReturnValue = 0, OriginalValue, BitShift;
#if (DISABLE_BB_RF == 1)
return 0;
#endif
/* RTW_INFO("--->PHY_QueryBBReg8812(): RegAddr(%#x), BitMask(%#x)\n", RegAddr, BitMask); */
@ -77,10 +73,6 @@ PHY_SetBBReg8192E(
{
u4Byte OriginalValue, BitShift;
#if (DISABLE_BB_RF == 1)
return;
#endif
if (BitMask != bMaskDWord) {
/* if not "double word" write */
OriginalValue = rtw_read32(Adapter, RegAddr);
@ -230,10 +222,6 @@ PHY_QueryRFReg8192E(
{
u32 Original_Value, Readback_Value, BitShift;
#if (DISABLE_BB_RF == 1)
return 0;
#endif
Original_Value = phy_RFSerialRead(Adapter, eRFPath, RegAddr);
BitShift = PHY_CalculateBitShift(BitMask);
@ -252,9 +240,6 @@ PHY_SetRFReg8192E(
)
{
u32 Original_Value, BitShift;
#if (DISABLE_BB_RF == 1)
return;
#endif
if (BitMask == 0)
return;

View File

@ -923,7 +923,7 @@ s32 rtl8192eu_hostap_mgnt_xmit_entry(_adapter *padapter, _pkt *pkt)
struct urb *urb;
unsigned char *pxmitbuf;
struct tx_desc *ptxdesc;
struct rtw_ieee80211_hdr *tx_hdr;
struct ieee80211_hdr *tx_hdr;
struct hostapd_priv *phostapdpriv = padapter->phostapdpriv;
struct net_device *pnetdev = padapter->pnetdev;
HAL_DATA_TYPE *pHalData = GET_HAL_DATA(padapter);
@ -935,11 +935,11 @@ s32 rtl8192eu_hostap_mgnt_xmit_entry(_adapter *padapter, _pkt *pkt)
skb = pkt;
len = skb->len;
tx_hdr = (struct rtw_ieee80211_hdr *)(skb->data);
fc = le16_to_cpu(tx_hdr->frame_ctl);
tx_hdr = (struct ieee80211_hdr *)(skb->data);
fc = le16_to_cpu(tx_hdr->frame_control);
bmcst = is_multicast_ether_addr(tx_hdr->addr1);
if ((fc & RTW_IEEE80211_FCTL_FTYPE) != RTW_IEEE80211_FTYPE_MGMT)
if ((fc & IEEE80211_FCTL_FTYPE) != IEEE80211_FTYPE_MGMT)
goto _exit;
pxmit_skb = rtw_skb_alloc(len + TXDESC_SIZE);

View File

@ -170,64 +170,64 @@ _InitBurstPktLen_8192EU(IN PADAPTER Adapter)
HAL_DATA_TYPE *pHalData = GET_HAL_DATA(Adapter);
/* PlatformEFIOWrite2Byte(Adapter, REG_TRXDMA_CTRL_8195, 0xf5b0); */
/* PlatformEFIOWrite2Byte(Adapter, REG_TRXDMA_CTRL_8812, 0xf5b4); */
PlatformEFIOWrite2Byte(Adapter, REG_RXDMA_STATUS_8192E, 0x7400); /* burset lenght=4, set 0x3400 for burset length=2 */
PlatformEFIOWrite1Byte(Adapter, 0x289, 0xf5); /* for rxdma control */
/* PlatformEFIOWrite1Byte(Adapter, 0x3a, 0x46); */
/* rtw_write16(Adapter, REG_TRXDMA_CTRL_8195, 0xf5b0); */
/* rtw_write16(Adapter, REG_TRXDMA_CTRL_8812, 0xf5b4); */
rtw_write16(Adapter, REG_RXDMA_STATUS_8192E, 0x7400); /* burset lenght=4, set 0x3400 for burset length=2 */
rtw_write8(Adapter, 0x289, 0xf5); /* for rxdma control */
/* rtw_write8(Adapter, 0x3a, 0x46); */
/* 0x456 = 0x70, sugguested by Zhilin */
/* PlatformEFIOWrite1Byte(Adapter, REG_AMPDU_MAX_TIME_8192E, 0x70); */
/* rtw_write8(Adapter, REG_AMPDU_MAX_TIME_8192E, 0x70); */
/* Suggention by SD1 Jong and Pisa, by Maddest 20130107. */
PlatformEFIOWrite2Byte(Adapter, REG_MAX_AGGR_NUM_8192E, 0x0e0e);
PlatformEFIOWrite1Byte(Adapter, REG_FWHW_TXQ_CTRL_8192E, 0x80);/* EN_AMPDU_RTY_NEW */
PlatformEFIOWrite1Byte(Adapter, REG_AMPDU_MAX_TIME_8192E, 0x5e);
PlatformEFIOWrite4Byte(Adapter, REG_FAST_EDCA_CTRL_8192E, 0x03087777);
rtw_write16(Adapter, REG_MAX_AGGR_NUM_8192E, 0x0e0e);
rtw_write8(Adapter, REG_FWHW_TXQ_CTRL_8192E, 0x80);/* EN_AMPDU_RTY_NEW */
rtw_write8(Adapter, REG_AMPDU_MAX_TIME_8192E, 0x5e);
rtw_write32(Adapter, REG_FAST_EDCA_CTRL_8192E, 0x03087777);
/* PlatformEFIOWrite4Byte(Adapter, 0x458, 0xffffffff); */
PlatformEFIOWrite1Byte(Adapter, REG_USTIME_TSF_8192E, 0x50);
PlatformEFIOWrite1Byte(Adapter, REG_USTIME_EDCA_8192E, 0x50);
/* rtw_write32(Adapter, 0x458, 0xffffffff); */
rtw_write8(Adapter, REG_USTIME_TSF_8192E, 0x50);
rtw_write8(Adapter, REG_USTIME_EDCA_8192E, 0x50);
if (IS_HARDWARE_TYPE_8821U(Adapter) || IS_HARDWARE_TYPE_8192EU(Adapter))
speedvalue = BIT7;
else
speedvalue = PlatformEFIORead1Byte(Adapter, 0xff); /* check device operation speed: SS 0xff bit7 */
speedvalue = rtw_read8(Adapter, 0xff); /* check device operation speed: SS 0xff bit7 */
if (speedvalue & BIT7) { /* USB2/1.1 Mode */
temp = PlatformEFIORead1Byte(Adapter, REG_USB_INFO);
temp = rtw_read8(Adapter, REG_USB_INFO);
if (((temp >> 4) & 0x03) == 0) {
/* pHalData->UsbBulkOutSize = 512; */
provalue = PlatformEFIORead1Byte(Adapter, REG_RXDMA_PRO_8192E);
PlatformEFIOWrite1Byte(Adapter, REG_RXDMA_PRO_8192E, (provalue | BIT(4) & (~BIT(5)))); /* set burst pkt len=512B */
PlatformEFIOWrite2Byte(Adapter, REG_RXDMA_PRO_8192E, 0x1e);
provalue = rtw_read8(Adapter, REG_RXDMA_PRO_8192E);
rtw_write8(Adapter, REG_RXDMA_PRO_8192E, (provalue | BIT(4) & (~BIT(5)))); /* set burst pkt len=512B */
rtw_write16(Adapter, REG_RXDMA_PRO_8192E, 0x1e);
} else {
/* pHalData->UsbBulkOutSize = 64; */
provalue = PlatformEFIORead1Byte(Adapter, REG_RXDMA_PRO_8192E);
PlatformEFIOWrite1Byte(Adapter, REG_RXDMA_PRO_8192E, ((provalue | BIT(5)) & (~BIT(4)))); /* set burst pkt len=64B */
provalue = rtw_read8(Adapter, REG_RXDMA_PRO_8192E);
rtw_write8(Adapter, REG_RXDMA_PRO_8192E, ((provalue | BIT(5)) & (~BIT(4)))); /* set burst pkt len=64B */
}
PlatformEFIOWrite2Byte(Adapter, REG_RXDMA_AGG_PG_TH_8192E, 0x2005); /* dmc agg th 20K */
rtw_write16(Adapter, REG_RXDMA_AGG_PG_TH_8192E, 0x2005); /* dmc agg th 20K */
pHalData->bSupportUSB3 = FALSE;
}
PlatformEFIOWrite1Byte(Adapter, REG_DWBCN0_CTRL_8192E, 0x10);
rtw_write8(Adapter, REG_DWBCN0_CTRL_8192E, 0x10);
PlatformEFIOWrite1Byte(Adapter, 0x4c7, PlatformEFIORead1Byte(Adapter, 0x4c7) | BIT(7)); /* enable single pkt ampdu */
PlatformEFIOWrite1Byte(Adapter, REG_RX_PKT_LIMIT_8192E, 0x18); /* for VHT packet length 11K */
rtw_write8(Adapter, 0x4c7, rtw_read8(Adapter, 0x4c7) | BIT(7)); /* enable single pkt ampdu */
rtw_write8(Adapter, REG_RX_PKT_LIMIT_8192E, 0x18); /* for VHT packet length 11K */
/* PlatformEFIOWrite1Byte(Adapter, REG_MAX_AGGR_NUM_8192E, 0x1f); */
PlatformEFIOWrite1Byte(Adapter, REG_PIFS_8192E, 0x00);
/* PlatformEFIOWrite1Byte(Adapter, REG_FWHW_TXQ_CTRL_8192E, PlatformEFIORead1Byte(Adapter, REG_FWHW_TXQ_CTRL)&(~BIT(7))); */
/* rtw_write8(Adapter, REG_MAX_AGGR_NUM_8192E, 0x1f); */
rtw_write8(Adapter, REG_PIFS_8192E, 0x00);
/* rtw_write8(Adapter, REG_FWHW_TXQ_CTRL_8192E, rtw_read8(Adapter, REG_FWHW_TXQ_CTRL)&(~BIT(7))); */
#ifdef CONFIG_TX_EARLY_MODE
if (pHalData->AMPDUBurstMode)
PlatformEFIOWrite1Byte(Adapter, REG_SW_AMPDU_BURST_MODE_CTRL_8192E, 0x5F);
rtw_write8(Adapter, REG_SW_AMPDU_BURST_MODE_CTRL_8192E, 0x5F);
#endif
PlatformEFIOWrite1Byte(Adapter, 0x1c, PlatformEFIORead1Byte(Adapter, 0x1c) | BIT(5) | BIT(6)); /* to prevent mac is reseted by bus. 20111208, by Page */
rtw_write8(Adapter, 0x1c, rtw_read8(Adapter, 0x1c) | BIT(5) | BIT(6)); /* to prevent mac is reseted by bus. 20111208, by Page */
#endif
}
@ -255,8 +255,8 @@ static u32 _InitPowerOn_8192EU(_adapter *padapter)
/* 0x14[23:20]=b<><62>0101 (raise 1.2V voltage)
u1Byte tmp1Byte = PlatformEFIORead1Byte(Adapter,0x16);
PlatformEFIOWrite1Byte(Adapter,0x16,tmp1Byte |BIT4|BIT6); */
u1Byte tmp1Byte = rtw_read8(Adapter,0x16);
rtw_write8(Adapter,0x16,tmp1Byte |BIT4|BIT6); */
u32 voltage = rtw_read32(padapter , REG_SYS_SWR_CTRL2_8192E);
if (((voltage & 0x00F00000) >> 20) == 0x4) {
@ -870,21 +870,17 @@ u32 rtl8192eu_hal_init(PADAPTER Adapter)
pHalData->current_channel = 6;/* default set to 6 */
HAL_INIT_PROFILE_TAG(HAL_INIT_STAGES_MAC);
#if (HAL_MAC_ENABLE == 1)
status = PHY_MACConfig8192E(Adapter);
if (status == _FAIL)
goto exit;
#endif
HAL_INIT_PROFILE_TAG(HAL_INIT_STAGES_BB);
#if (HAL_BB_ENABLE == 1)
status = PHY_BBConfig8192E(Adapter);
if (status == _FAIL)
goto exit;
#endif
HAL_INIT_PROFILE_TAG(HAL_INIT_STAGES_RF);
#if (HAL_RF_ENABLE == 1)
status = PHY_RFConfig8192E(Adapter);
if (status == _FAIL)
goto exit;
@ -975,7 +971,6 @@ u32 rtl8192eu_hal_init(PADAPTER Adapter)
#endif /* CONFIG_RTW_LED */
_BBTurnOnBlock_8192E(Adapter);
#endif
/* */
/* Joseph Note: Keep RfRegChnlVal for later use. */
@ -1111,10 +1106,10 @@ u32 rtl8192eu_hal_init(PADAPTER Adapter)
#endif /* CONFIG_XMIT_ACK */
/* Fixed LDPC rx hang issue. */
{
u4Byte tmp4Byte = PlatformEFIORead4Byte(Adapter, REG_SYS_SWR_CTRL1_8192E);
PlatformEFIOWrite1Byte(Adapter, REG_SYS_SWR_CTRL2_8192E, 0x75);
u4Byte tmp4Byte = rtw_read32(Adapter, REG_SYS_SWR_CTRL1_8192E);
rtw_write8(Adapter, REG_SYS_SWR_CTRL2_8192E, 0x75);
tmp4Byte = (tmp4Byte & 0xfff00fff) | (0x7E << 12);
PlatformEFIOWrite4Byte(Adapter, REG_SYS_SWR_CTRL1_8192E, tmp4Byte);
rtw_write32(Adapter, REG_SYS_SWR_CTRL1_8192E, tmp4Byte);
}
exit:

View File

@ -179,7 +179,7 @@ int recvbuf2recvframe(PADAPTER padapter, void *ptr)
#ifdef CONFIG_RX_PACKET_APPEND_FCS
if (check_fwstate(&padapter->mlmepriv, WIFI_MONITOR_STATE) == _FALSE)
if ((pattrib->pkt_rpt_type == NORMAL_RX) && rtw_hal_rcr_check(padapter, RCR_APPFCS))
pattrib->pkt_len -= IEEE80211_FCS_LEN;
pattrib->pkt_len -= FCS_LEN;
#endif
if (rtw_os_alloc_recvframe(padapter, precvframe,

View File

@ -237,8 +237,6 @@
#define ENABLE_USB_DROP_INCORRECT_OUT
#define DISABLE_BB_RF 0
#define RTW_CONFIG_RFREG18_WA
/* #define RTL8191C_FPGA_NETWORKTYPE_ADHOC 0 */

View File

@ -1735,7 +1735,6 @@ int rtw_suspend_free_assoc_resource(_adapter *padapter);
/* HCI Related header file */
#ifdef CONFIG_USB_HCI
#include <usb_osintf.h>
#include <usb_ops.h>
#include <usb_hal.h>
#endif

View File

@ -15,19 +15,6 @@
#ifndef __HAL_PHY_H__
#define __HAL_PHY_H__
#if DISABLE_BB_RF
#define HAL_FW_ENABLE 0
#define HAL_MAC_ENABLE 0
#define HAL_BB_ENABLE 0
#define HAL_RF_ENABLE 0
#else /* FPGA_PHY and ASIC */
#define HAL_FW_ENABLE 1
#define HAL_MAC_ENABLE 1
#define HAL_BB_ENABLE 1
#define HAL_RF_ENABLE 1
#endif
#define RF6052_MAX_TX_PWR 0x3F
#define RF6052_MAX_REG_88E 0xFF
#define RF6052_MAX_REG_92C 0x7F

File diff suppressed because it is too large Load Diff

View File

@ -514,11 +514,6 @@ extern u32 rtw_random32(void);
} while (0)
#define RTW_GET_LE16(a) ((u16) (((a)[1] << 8) | (a)[0]))
#define RTW_PUT_LE16(a, val) \
do { \
(a)[1] = ((u16) (val)) >> 8; \
(a)[0] = ((u16) (val)) & 0xff; \
} while (0)
#define RTW_GET_BE24(a) ((((u32) (a)[0]) << 16) | (((u32) (a)[1]) << 8) | \
((u32) (a)[2]))

View File

@ -335,18 +335,18 @@ extern void unregister_intf_hdl(struct intf_hdl *pintfhdl);
extern void _rtw_attrib_read(_adapter *adapter, u32 addr, u32 cnt, u8 *pmem);
extern void _rtw_attrib_write(_adapter *adapter, u32 addr, u32 cnt, u8 *pmem);
extern u8 _rtw_read8(_adapter *adapter, u32 addr);
extern u16 _rtw_read16(_adapter *adapter, u32 addr);
extern u32 _rtw_read32(_adapter *adapter, u32 addr);
extern u8 rtw_read8(_adapter *adapter, u32 addr);
extern u16 rtw_read16(_adapter *adapter, u32 addr);
extern u32 rtw_read32(_adapter *adapter, u32 addr);
extern void _rtw_read_mem(_adapter *adapter, u32 addr, u32 cnt, u8 *pmem);
extern void _rtw_read_port(_adapter *adapter, u32 addr, u32 cnt, u8 *pmem);
extern void _rtw_read_port_cancel(_adapter *adapter);
extern int _rtw_write8(_adapter *adapter, u32 addr, u8 val);
extern int _rtw_write16(_adapter *adapter, u32 addr, u16 val);
extern int _rtw_write32(_adapter *adapter, u32 addr, u32 val);
extern int _rtw_writeN(_adapter *adapter, u32 addr, u32 length, u8 *pdata);
extern int rtw_write8(_adapter *adapter, u32 addr, u8 val);
extern int rtw_write16(_adapter *adapter, u32 addr, u16 val);
extern int rtw_write32(_adapter *adapter, u32 addr, u32 val);
extern int rtw_writeN(_adapter *adapter, u32 addr, u32 length, u8 *pdata);
#ifdef CONFIG_SDIO_HCI
u8 _rtw_sd_f0_read8(_adapter *adapter, u32 addr);
@ -377,15 +377,6 @@ const struct rtw_io_sniff_ent *match_write_sniff(_adapter *adapter, u32 addr, u1
bool match_rf_read_sniff_ranges(_adapter *adapter, u8 path, u32 addr, u32 mask);
bool match_rf_write_sniff_ranges(_adapter *adapter, u8 path, u32 addr, u32 mask);
extern u8 dbg_rtw_read8(_adapter *adapter, u32 addr, const char *caller, const int line);
extern u16 dbg_rtw_read16(_adapter *adapter, u32 addr, const char *caller, const int line);
extern u32 dbg_rtw_read32(_adapter *adapter, u32 addr, const char *caller, const int line);
extern int dbg_rtw_write8(_adapter *adapter, u32 addr, u8 val, const char *caller, const int line);
extern int dbg_rtw_write16(_adapter *adapter, u32 addr, u16 val, const char *caller, const int line);
extern int dbg_rtw_write32(_adapter *adapter, u32 addr, u32 val, const char *caller, const int line);
extern int dbg_rtw_writeN(_adapter *adapter, u32 addr , u32 length , u8 *data, const char *caller, const int line);
#ifdef CONFIG_SDIO_HCI
u8 dbg_rtw_sd_f0_read8(_adapter *adapter, u32 addr, const char *caller, const int line);
#ifdef CONFIG_SDIO_INDIRECT_ACCESS
@ -398,18 +389,10 @@ int dbg_rtw_sd_iwrite32(_adapter *adapter, u32 addr, u32 val, const char *caller
#endif /* CONFIG_SDIO_INDIRECT_ACCESS */
#endif /* CONFIG_SDIO_HCI */
#define rtw_read8(adapter, addr) dbg_rtw_read8((adapter), (addr), __FUNCTION__, __LINE__)
#define rtw_read16(adapter, addr) dbg_rtw_read16((adapter), (addr), __FUNCTION__, __LINE__)
#define rtw_read32(adapter, addr) dbg_rtw_read32((adapter), (addr), __FUNCTION__, __LINE__)
#define rtw_read_mem(adapter, addr, cnt, mem) _rtw_read_mem((adapter), (addr), (cnt), (mem))
#define rtw_read_port(adapter, addr, cnt, mem) _rtw_read_port((adapter), (addr), (cnt), (mem))
#define rtw_read_port_cancel(adapter) _rtw_read_port_cancel((adapter))
#define rtw_write8(adapter, addr, val) dbg_rtw_write8((adapter), (addr), (val), __FUNCTION__, __LINE__)
#define rtw_write16(adapter, addr, val) dbg_rtw_write16((adapter), (addr), (val), __FUNCTION__, __LINE__)
#define rtw_write32(adapter, addr, val) dbg_rtw_write32((adapter), (addr), (val), __FUNCTION__, __LINE__)
#define rtw_writeN(adapter, addr, length, data) dbg_rtw_writeN((adapter), (addr), (length), (data), __FUNCTION__, __LINE__)
#define rtw_write8_async(adapter, addr, val) _rtw_write8_async((adapter), (addr), (val))
#define rtw_write16_async(adapter, addr, val) _rtw_write16_async((adapter), (addr), (val))
#define rtw_write32_async(adapter, addr, val) _rtw_write32_async((adapter), (addr), (val))
@ -432,17 +415,10 @@ int dbg_rtw_sd_iwrite32(_adapter *adapter, u32 addr, u32 val, const char *caller
#endif /* CONFIG_SDIO_HCI */
#else /* DBG_IO */
#define rtw_read8(adapter, addr) _rtw_read8((adapter), (addr))
#define rtw_read16(adapter, addr) _rtw_read16((adapter), (addr))
#define rtw_read32(adapter, addr) _rtw_read32((adapter), (addr))
#define rtw_read_mem(adapter, addr, cnt, mem) _rtw_read_mem((adapter), (addr), (cnt), (mem))
#define rtw_read_port(adapter, addr, cnt, mem) _rtw_read_port((adapter), (addr), (cnt), (mem))
#define rtw_read_port_cancel(adapter) _rtw_read_port_cancel((adapter))
#define rtw_write8(adapter, addr, val) _rtw_write8((adapter), (addr), (val))
#define rtw_write16(adapter, addr, val) _rtw_write16((adapter), (addr), (val))
#define rtw_write32(adapter, addr, val) _rtw_write32((adapter), (addr), (val))
#define rtw_writeN(adapter, addr, length, data) _rtw_writeN((adapter), (addr), (length), (data))
#define rtw_write8_async(adapter, addr, val) _rtw_write8_async((adapter), (addr), (val))
#define rtw_write16_async(adapter, addr, val) _rtw_write16_async((adapter), (addr), (val))
@ -509,36 +485,4 @@ extern void bus_sync_io(struct io_queue *pio_q);
extern u32 _ioreq2rwmem(struct io_queue *pio_q);
extern void dev_power_down(_adapter *Adapter, u8 bpwrup);
/*
#define RTL_R8(reg) rtw_read8(padapter, reg)
#define RTL_R16(reg) rtw_read16(padapter, reg)
#define RTL_R32(reg) rtw_read32(padapter, reg)
#define RTL_W8(reg, val8) rtw_write8(padapter, reg, val8)
#define RTL_W16(reg, val16) rtw_write16(padapter, reg, val16)
#define RTL_W32(reg, val32) rtw_write32(padapter, reg, val32)
*/
/*
#define RTL_W8_ASYNC(reg, val8) rtw_write32_async(padapter, reg, val8)
#define RTL_W16_ASYNC(reg, val16) rtw_write32_async(padapter, reg, val16)
#define RTL_W32_ASYNC(reg, val32) rtw_write32_async(padapter, reg, val32)
#define RTL_WRITE_BB(reg, val32) phy_SetUsbBBReg(padapter, reg, val32)
#define RTL_READ_BB(reg) phy_QueryUsbBBReg(padapter, reg)
*/
#define PlatformEFIOWrite1Byte(_a, _b, _c) \
rtw_write8(_a, _b, _c)
#define PlatformEFIOWrite2Byte(_a, _b, _c) \
rtw_write16(_a, _b, _c)
#define PlatformEFIOWrite4Byte(_a, _b, _c) \
rtw_write32(_a, _b, _c)
#define PlatformEFIORead1Byte(_a, _b) \
rtw_read8(_a, _b)
#define PlatformEFIORead2Byte(_a, _b) \
rtw_read16(_a, _b)
#define PlatformEFIORead4Byte(_a, _b) \
rtw_read32(_a, _b)
#endif /* _RTL8711_IO_H_ */

View File

@ -38,9 +38,6 @@
const char *security_type_str(u8 value);
#define _WPA_IE_ID_ 0xdd
#define _WPA2_IE_ID_ 0x30
#define SHA256_MAC_LEN 32
#define AES_BLOCK_SIZE 16
#define AES_PRIV_SIZE (4 * 44)

View File

@ -15,7 +15,6 @@
#ifndef __SDIO_HAL_H__
#define __SDIO_HAL_H__
void sd_int_dpc(PADAPTER padapter);
u8 rtw_set_hal_ops(_adapter *padapter);
#ifdef CONFIG_RTL8188E

View File

@ -1,26 +0,0 @@
/******************************************************************************
*
* Copyright(c) 2007 - 2017 Realtek Corporation.
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of version 2 of the GNU General Public License as
* published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
*
*****************************************************************************/
#ifndef __USB_OSINTF_H
#define __USB_OSINTF_H
#include <usb_vendor_req.h>
#define USBD_HALTED(Status) ((ULONG)(Status) >> 30 == 3)
u8 usbvendorrequest(struct dvobj_priv *pdvobjpriv, RT_USB_BREQUEST brequest, RT_USB_WVALUE wvalue, u8 windex, void *data, u8 datalen, u8 isdirectionin);
#endif

View File

@ -1,56 +0,0 @@
/******************************************************************************
*
* Copyright(c) 2007 - 2017 Realtek Corporation.
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of version 2 of the GNU General Public License as
* published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
*
*****************************************************************************/
#ifndef _USB_VENDOR_REQUEST_H_
#define _USB_VENDOR_REQUEST_H_
/* 4 Set/Get Register related wIndex/Data */
#define RT_USB_RESET_MASK_OFF 0
#define RT_USB_RESET_MASK_ON 1
#define RT_USB_SLEEP_MASK_OFF 0
#define RT_USB_SLEEP_MASK_ON 1
#define RT_USB_LDO_ON 1
#define RT_USB_LDO_OFF 0
/* 4 Set/Get SYSCLK related wValue or Data */
#define RT_USB_SYSCLK_32KHZ 0
#define RT_USB_SYSCLK_40MHZ 1
#define RT_USB_SYSCLK_60MHZ 2
typedef enum _RT_USB_BREQUEST {
RT_USB_SET_REGISTER = 1,
RT_USB_SET_SYSCLK = 2,
RT_USB_GET_SYSCLK = 3,
RT_USB_GET_REGISTER = 4
} RT_USB_BREQUEST;
typedef enum _RT_USB_WVALUE {
RT_USB_RESET_MASK = 1,
RT_USB_SLEEP_MASK = 2,
RT_USB_USB_HRCPWM = 3,
RT_USB_LDO = 4,
RT_USB_BOOT_TYPE = 5
} RT_USB_WVALUE;
#if 0
BOOLEAN usbvendorrequest(PCE_USB_DEVICE CEdevice, RT_USB_BREQUEST bRequest, RT_USB_WVALUE wValue, UCHAR wIndex, PVOID Data, UCHAR DataLength, BOOLEAN isDirectionIn);
BOOLEAN CEusbGetStatusRequest(PCE_USB_DEVICE CEdevice, IN USHORT Op, IN USHORT Index, PVOID Data);
BOOLEAN CEusbFeatureRequest(PCE_USB_DEVICE CEdevice, IN USHORT Op, IN USHORT FeatureSelector, IN USHORT Index);
BOOLEAN CEusbGetDescriptorRequest(PCE_USB_DEVICE CEdevice, IN short urbLength, IN UCHAR DescriptorType, IN UCHAR Index, IN USHORT LanguageId, IN PVOID TransferBuffer, IN ULONG TransferBufferLength);
#endif
#endif

View File

@ -90,11 +90,6 @@ enum {
#define GetToDs(pbuf) (((*(unsigned short *)(pbuf)) & le16_to_cpu(IEEE80211_FCTL_TODS)) != 0)
#define ClearToDs(pbuf) \
do { \
*(unsigned short *)(pbuf) &= (~cpu_to_le16(IEEE80211_FCTL_TODS)); \
} while (0)
#define SetFrDs(pbuf) \
do { \
*(unsigned short *)(pbuf) |= cpu_to_le16(IEEE80211_FCTL_FROMDS); \
@ -102,11 +97,6 @@ enum {
#define GetFrDs(pbuf) (((*(unsigned short *)(pbuf)) & le16_to_cpu(IEEE80211_FCTL_FROMDS)) != 0)
#define ClearFrDs(pbuf) \
do { \
*(unsigned short *)(pbuf) &= (~cpu_to_le16(IEEE80211_FCTL_FROMDS)); \
} while (0)
#define get_tofr_ds(pframe) ((GetToDs(pframe) << 1) | GetFrDs(pframe))
@ -160,12 +150,6 @@ enum {
#define GetPrivacy(pbuf) (((*(unsigned short *)(pbuf)) & le16_to_cpu(IEEE80211_FCTL_PROTECTED)) != 0)
#define ClearPrivacy(pbuf) \
do { \
*(unsigned short *)(pbuf) &= (~cpu_to_le16(IEEE80211_FCTL_PROTECTED)); \
} while (0)
#define GetOrder(pbuf) (((*(unsigned short *)(pbuf)) & le16_to_cpu(IEEE80211_FCTL_ORDER)) != 0)
#define GetFrameType(pbuf) (le16_to_cpu(*(unsigned short *)(pbuf)) & (BIT(3) | BIT(2)))
@ -334,83 +318,6 @@ static inline int IsFrameTypeData(unsigned char *pframe)
#define _FIXED_IE_LENGTH_ _BEACON_IE_OFFSET_
typedef enum _ELEMENT_ID {
EID_SsId = 0, /* service set identifier (0:32) */
EID_SupRates = 1, /* supported rates (1:8) */
EID_FHParms = 2, /* FH parameter set (5) */
EID_DSParms = 3, /* DS parameter set (1) */
EID_CFParms = 4, /* CF parameter set (6) */
EID_Tim = 5, /* Traffic Information Map (4:254) */
EID_IbssParms = 6, /* IBSS parameter set (2) */
EID_Country = 7, /* */
/* Form 7.3.2: Information elements in 802.11E/D13.0, page 46. */
EID_QBSSLoad = 11,
EID_EDCAParms = 12,
EID_TSpec = 13,
EID_TClass = 14,
EID_Schedule = 15,
/* */
EID_Ctext = 16, /* challenge text*/
EID_POWER_CONSTRAINT = 32, /* Power Constraint*/
/* vivi for WIFITest, 802.11h AP, 20100427 */
/* 2010/12/26 MH The definition we can declare always!! */
EID_PowerCap = 33,
EID_SupportedChannels = 36,
EID_ChlSwitchAnnounce = 37,
EID_MeasureRequest = 38, /* Measurement Request */
EID_MeasureReport = 39, /* Measurement Report */
EID_ERPInfo = 42,
/* Form 7.3.2: Information elements in 802.11E/D13.0, page 46. */
EID_TSDelay = 43,
EID_TCLASProc = 44,
EID_HTCapability = 45,
EID_QoSCap = 46,
/* */
EID_WPA2 = 48,
EID_ExtSupRates = 50,
EID_FTIE = 55, /* Defined in 802.11r */
EID_Timeout = 56, /* Defined in 802.11r */
EID_SupRegulatory = 59, /* Supported Requlatory Classes 802.11y */
EID_HTInfo = 61,
EID_SecondaryChnlOffset = 62,
EID_BSSCoexistence = 72, /* 20/40 BSS Coexistence */
EID_BSSIntolerantChlReport = 73,
EID_OBSS = 74, /* Overlapping BSS Scan Parameters */
EID_LinkIdentifier = 101, /* Defined in 802.11z */
EID_WakeupSchedule = 102, /* Defined in 802.11z */
EID_ChnlSwitchTimeing = 104, /* Defined in 802.11z */
EID_PTIControl = 105, /* Defined in 802.11z */
EID_PUBufferStatus = 106, /* Defined in 802.11z */
EID_EXTCapability = 127, /* Extended Capabilities */
/* From S19:Aironet IE and S21:AP IP address IE in CCX v1.13, p16 and p18. */
EID_Aironet = 133, /* 0x85: Aironet Element for Cisco CCX */
EID_CiscoIP = 149, /* 0x95: IP Address IE for Cisco CCX */
EID_CellPwr = 150, /* 0x96: Cell Power Limit IE. Ref. 0x96. */
EID_CCKM = 156,
EID_Vendor = 221, /* 0xDD: Vendor Specific */
EID_WAPI = 68,
EID_VHTCapability = 191, /* Based on 802.11ac D2.0 */
EID_VHTOperation = 192, /* Based on 802.11ac D2.0 */
EID_AID = 197, /* Based on 802.11ac D4.0 */
EID_OpModeNotification = 199, /* Based on 802.11ac D3.0 */
} ELEMENT_ID, *PELEMENT_ID;
/* ---------------------------------------------------------------------------
Below is the fixed elements...
-----------------------------------------------------------------------------*/

View File

@ -786,9 +786,8 @@ struct cfg80211_bss *rtw_cfg80211_inform_bss(_adapter *padapter, struct wlan_net
u8 *pbuf;
size_t buf_size = MAX_BSSINFO_LEN;
size_t len, bssinf_len = 0;
struct rtw_ieee80211_hdr *pwlanhdr;
struct ieee80211_hdr *pwlanhdr;
unsigned short *fctrl;
u8 bc_addr[] = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff};
struct wireless_dev *wdev = padapter->rtw_wdev;
struct wiphy *wiphy = wdev->wiphy;
@ -802,7 +801,7 @@ struct cfg80211_bss *rtw_cfg80211_inform_bss(_adapter *padapter, struct wlan_net
/* RTW_INFO("%s\n", __func__); */
bssinf_len = pnetwork->network.IELength + sizeof(struct rtw_ieee80211_hdr_3addr);
bssinf_len = pnetwork->network.IELength + sizeof(struct ieee80211_hdr_3addr);
if (bssinf_len > buf_size) {
RTW_INFO("%s IE Length too long > %zu byte\n", __FUNCTION__, buf_size);
goto exit;
@ -855,15 +854,15 @@ struct cfg80211_bss *rtw_cfg80211_inform_bss(_adapter *padapter, struct wlan_net
/* pbuf = buf; */
pwlanhdr = (struct rtw_ieee80211_hdr *)pbuf;
fctrl = &(pwlanhdr->frame_ctl);
pwlanhdr = (struct ieee80211_hdr *)pbuf;
fctrl =&pwlanhdr->frame_control;
*(fctrl) = 0;
SetSeqNum(pwlanhdr, 0/*pmlmeext->mgnt_seq*/);
/* pmlmeext->mgnt_seq++; */
if (pnetwork->network.Reserved[0] == BSS_TYPE_BCN) { /* IEEE80211_STYPE_BEACON */
memcpy(pwlanhdr->addr1, bc_addr, ETH_ALEN);
eth_broadcast_addr(pwlanhdr->addr1);
set_frame_sub_type(pbuf, IEEE80211_STYPE_BEACON);
} else {
memcpy(pwlanhdr->addr1, adapter_mac_addr(padapter), ETH_ALEN);
@ -874,8 +873,8 @@ struct cfg80211_bss *rtw_cfg80211_inform_bss(_adapter *padapter, struct wlan_net
memcpy(pwlanhdr->addr3, pnetwork->network.MacAddress, ETH_ALEN);
/* pbuf += sizeof(struct rtw_ieee80211_hdr_3addr); */
len = sizeof(struct rtw_ieee80211_hdr_3addr);
/* pbuf += sizeof(struct ieee80211_hdr_3addr); */
len = sizeof(struct ieee80211_hdr_3addr);
memcpy((pbuf + len), pnetwork->network.IEs, pnetwork->network.IELength);
*((u64 *)(pbuf + len)) = cpu_to_le64(notify_timestamp);
@ -1125,10 +1124,10 @@ check_bss:
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 12, 0)
roam_info.bssid = cur_network->network.MacAddress;
roam_info.req_ie = pmlmepriv->assoc_req + sizeof(struct rtw_ieee80211_hdr_3addr) + 2;
roam_info.req_ie_len = pmlmepriv->assoc_req_len - sizeof(struct rtw_ieee80211_hdr_3addr) - 2;
roam_info.resp_ie = pmlmepriv->assoc_rsp + sizeof(struct rtw_ieee80211_hdr_3addr) + 6;
roam_info.resp_ie_len = pmlmepriv->assoc_rsp_len - sizeof(struct rtw_ieee80211_hdr_3addr) - 6;
roam_info.req_ie = pmlmepriv->assoc_req + sizeof(struct ieee80211_hdr_3addr) + 2;
roam_info.req_ie_len = pmlmepriv->assoc_req_len - sizeof(struct ieee80211_hdr_3addr) - 2;
roam_info.resp_ie = pmlmepriv->assoc_rsp + sizeof(struct ieee80211_hdr_3addr) + 6;
roam_info.resp_ie_len = pmlmepriv->assoc_rsp_len - sizeof(struct ieee80211_hdr_3addr) - 6;
cfg80211_roamed(padapter->pnetdev, &roam_info, GFP_ATOMIC);
#else
@ -1137,10 +1136,10 @@ check_bss:
, notify_channel
#endif
, cur_network->network.MacAddress
, pmlmepriv->assoc_req + sizeof(struct rtw_ieee80211_hdr_3addr) + 2
, pmlmepriv->assoc_req_len - sizeof(struct rtw_ieee80211_hdr_3addr) - 2
, pmlmepriv->assoc_rsp + sizeof(struct rtw_ieee80211_hdr_3addr) + 6
, pmlmepriv->assoc_rsp_len - sizeof(struct rtw_ieee80211_hdr_3addr) - 6
, pmlmepriv->assoc_req + sizeof(struct ieee80211_hdr_3addr) + 2
, pmlmepriv->assoc_req_len - sizeof(struct ieee80211_hdr_3addr) - 2
, pmlmepriv->assoc_rsp + sizeof(struct ieee80211_hdr_3addr) + 6
, pmlmepriv->assoc_rsp_len - sizeof(struct ieee80211_hdr_3addr) - 6
, GFP_ATOMIC);
#endif /*LINUX_VERSION_CODE >= KERNEL_VERSION(4, 12, 0)*/
@ -1157,10 +1156,10 @@ check_bss:
if (check_fwstate(pmlmepriv, WIFI_MONITOR_STATE) != _TRUE)
rtw_cfg80211_connect_result(pwdev, cur_network->network.MacAddress
, pmlmepriv->assoc_req + sizeof(struct rtw_ieee80211_hdr_3addr) + 2
, pmlmepriv->assoc_req_len - sizeof(struct rtw_ieee80211_hdr_3addr) - 2
, pmlmepriv->assoc_rsp + sizeof(struct rtw_ieee80211_hdr_3addr) + 6
, pmlmepriv->assoc_rsp_len - sizeof(struct rtw_ieee80211_hdr_3addr) - 6
, pmlmepriv->assoc_req + sizeof(struct ieee80211_hdr_3addr) + 2
, pmlmepriv->assoc_req_len - sizeof(struct ieee80211_hdr_3addr) - 2
, pmlmepriv->assoc_rsp + sizeof(struct ieee80211_hdr_3addr) + 6
, pmlmepriv->assoc_rsp_len - sizeof(struct ieee80211_hdr_3addr) - 6
, WLAN_STATUS_SUCCESS, GFP_ATOMIC);
#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 11, 0) || defined(COMPAT_KERNEL_RELEASE)
RTW_INFO("pwdev->sme_state(a)=%d\n", pwdev->sme_state);
@ -1724,7 +1723,7 @@ static int cfg80211_rtw_add_key(struct wiphy *wiphy, struct net_device *ndev
memset(param, 0, param_len);
param->cmd = IEEE_CMD_SET_ENCRYPTION;
memset(param->sta_addr, 0xff, ETH_ALEN);
eth_broadcast_addr(param->sta_addr);
switch (params->cipher) {
case IW_AUTH_CIPHER_NONE:
@ -4387,7 +4386,7 @@ void rtw_cfg80211_indicate_sta_disassoc(_adapter *padapter, const u8 *da, unsign
int channel;
u8 *pmgmt_frame;
uint frame_len;
struct rtw_ieee80211_hdr *pwlanhdr;
struct ieee80211_hdr *pwlanhdr;
unsigned short *fctrl;
u8 mgmt_buf[128] = {0};
struct mlme_ext_priv *pmlmeext = &(padapter->mlmeextpriv);
@ -4405,9 +4404,9 @@ void rtw_cfg80211_indicate_sta_disassoc(_adapter *padapter, const u8 *da, unsign
freq = rtw_ch2freq(channel);
pmgmt_frame = mgmt_buf;
pwlanhdr = (struct rtw_ieee80211_hdr *)pmgmt_frame;
pwlanhdr = (struct ieee80211_hdr *)pmgmt_frame;
fctrl = &(pwlanhdr->frame_ctl);
fctrl =&pwlanhdr->frame_control;
*(fctrl) = 0;
memcpy(pwlanhdr->addr1, adapter_mac_addr(padapter), ETH_ALEN);
@ -4418,8 +4417,8 @@ void rtw_cfg80211_indicate_sta_disassoc(_adapter *padapter, const u8 *da, unsign
pmlmeext->mgnt_seq++;
set_frame_sub_type(pmgmt_frame, IEEE80211_STYPE_DEAUTH);
pmgmt_frame += sizeof(struct rtw_ieee80211_hdr_3addr);
frame_len = sizeof(struct rtw_ieee80211_hdr_3addr);
pmgmt_frame += sizeof(struct ieee80211_hdr_3addr);
frame_len = sizeof(struct ieee80211_hdr_3addr);
reason = cpu_to_le16(reason);
pmgmt_frame = rtw_set_fixed_ie(pmgmt_frame, _RSON_CODE_ , (unsigned char *)&reason, &frame_len);
@ -4464,7 +4463,7 @@ static int rtw_cfg80211_monitor_if_xmit_entry(struct sk_buff *skb, struct net_de
u16 frame_ctl;
unsigned char src_mac_addr[ETH_ALEN];
unsigned char dst_mac_addr[ETH_ALEN];
struct rtw_ieee80211_hdr *dot11_hdr;
struct ieee80211_hdr *dot11_hdr;
struct ieee80211_radiotap_header *rtap_hdr;
_adapter *padapter = (_adapter *)rtw_netdev_priv(ndev);
#ifdef CONFIG_DFS_MASTER
@ -4502,16 +4501,16 @@ static int rtw_cfg80211_monitor_if_xmit_entry(struct sk_buff *skb, struct net_de
/* Skip the ratio tap header */
skb_pull(skb, rtap_len);
dot11_hdr = (struct rtw_ieee80211_hdr *)skb->data;
frame_ctl = le16_to_cpu(dot11_hdr->frame_ctl);
dot11_hdr = (struct ieee80211_hdr *)skb->data;
frame_ctl = le16_to_cpu(dot11_hdr->frame_control);
/* Check if the QoS bit is set */
if ((frame_ctl & RTW_IEEE80211_FCTL_FTYPE) == RTW_IEEE80211_FTYPE_DATA) {
if ((frame_ctl & IEEE80211_FCTL_FTYPE) == IEEE80211_FTYPE_DATA) {
/* Check if this ia a Wireless Distribution System (WDS) frame
* which has 4 MAC addresses
*/
if (dot11_hdr->frame_ctl & 0x0080)
if (dot11_hdr->frame_control & 0x0080)
qos_len = 2;
if ((dot11_hdr->frame_ctl & 0x0300) == 0x0300)
if ((dot11_hdr->frame_control & 0x0300) == 0x0300)
dot11_hdr_len += 6;
memcpy(dst_mac_addr, dot11_hdr->addr1, sizeof(dst_mac_addr));
@ -4532,8 +4531,8 @@ static int rtw_cfg80211_monitor_if_xmit_entry(struct sk_buff *skb, struct net_de
return ret;
} else if ((frame_ctl & (RTW_IEEE80211_FCTL_FTYPE | RTW_IEEE80211_FCTL_STYPE))
== (RTW_IEEE80211_FTYPE_MGMT | RTW_IEEE80211_STYPE_ACTION)
} else if ((frame_ctl & ( IEEE80211_FCTL_FTYPE | IEEE80211_FCTL_STYPE))
== (IEEE80211_FTYPE_MGMT | IEEE80211_STYPE_ACTION)
) {
/* only for action frames */
struct xmit_frame *pmgntframe;
@ -4541,7 +4540,7 @@ static int rtw_cfg80211_monitor_if_xmit_entry(struct sk_buff *skb, struct net_de
unsigned char *pframe;
/* u8 category, action, OUI_Subtype, dialogToken=0; */
/* unsigned char *frame_body; */
struct rtw_ieee80211_hdr *pwlanhdr;
struct ieee80211_hdr *pwlanhdr;
struct xmit_priv *pxmitpriv = &(padapter->xmitpriv);
struct mlme_ext_priv *pmlmeext = &(padapter->mlmeextpriv);
u8 *buf = skb->data;
@ -4551,7 +4550,7 @@ static int rtw_cfg80211_monitor_if_xmit_entry(struct sk_buff *skb, struct net_de
if (rtw_action_frame_parse(buf, len, &category, &action) == _FALSE) {
RTW_INFO(FUNC_NDEV_FMT" frame_control:0x%x\n", FUNC_NDEV_ARG(ndev),
le16_to_cpu(((struct rtw_ieee80211_hdr_3addr *)buf)->frame_ctl));
le16_to_cpu(((struct ieee80211_hdr_3addr *)buf)->frame_control));
goto fail;
}
@ -4562,10 +4561,6 @@ static int rtw_cfg80211_monitor_if_xmit_entry(struct sk_buff *skb, struct net_de
if (type >= 0)
goto dump;
#endif
if (category == RTW_WLAN_CATEGORY_PUBLIC)
RTW_INFO("RTW_Tx:%s\n", action_public_str(action));
else
RTW_INFO("RTW_Tx:category(%u), action(%u)\n", category, action);
dump:
/* starting alloc mgmt frame to dump it */
@ -4590,7 +4585,7 @@ dump:
rtw_xframe_chk_wfd_ie(pmgntframe);
#endif /* CONFIG_P2P */
pwlanhdr = (struct rtw_ieee80211_hdr *)pframe;
pwlanhdr = (struct ieee80211_hdr *)pframe;
/* update seq number */
pmlmeext->mgnt_seq = GetSequence(pwlanhdr);
pattrib->seqnum = pmlmeext->mgnt_seq;
@ -4602,7 +4597,7 @@ dump:
dump_mgntframe(padapter, pmgntframe);
} else
RTW_INFO("frame_ctl=0x%x\n", frame_ctl & (RTW_IEEE80211_FCTL_FTYPE | RTW_IEEE80211_FCTL_STYPE));
RTW_INFO("frame_ctl=0x%x\n", frame_ctl & ( IEEE80211_FCTL_FTYPE | IEEE80211_FCTL_STYPE));
fail:
@ -6204,8 +6199,8 @@ void rtw_cfg80211_rx_action(_adapter *adapter, union recv_frame *rframe, const c
}
#endif
rtw_action_frame_parse(frame, frame_len, &category, &action);
if (category == RTW_WLAN_CATEGORY_PUBLIC) {
if (action == ACT_PUBLIC_GAS_INITIAL_REQ) {
if (category == WLAN_CATEGORY_PUBLIC) {
if (action == WLAN_PUB_ACTION_GAS_INITIAL_REQ ) {
rtw_mi_set_scan_deny(adapter, 200);
rtw_mi_scan_abort(adapter, _FALSE); /*rtw_scan_abort_no_wait*/
}
@ -6270,7 +6265,7 @@ void rtw_cfg80211_rx_mframe(_adapter *adapter, union recv_frame *rframe, const c
if (msg)
RTW_INFO("RTW_Rx:%s\n", msg);
else
RTW_INFO("RTW_Rx:frame_control:0x%02x\n", le16_to_cpu(((struct rtw_ieee80211_hdr_3addr *)rframe)->frame_ctl));
RTW_INFO("RTW_Rx:frame_control:0x%02x\n", le16_to_cpu(((struct ieee80211_hdr_3addr *)rframe)->frame_control));
}
}
@ -6287,7 +6282,7 @@ void rtw_cfg80211_issue_p2p_provision_request(_adapter *padapter, const u8 *buf,
u16 capability = 0;
uint capability_len = 0;
unsigned char category = RTW_WLAN_CATEGORY_PUBLIC;
unsigned char category = WLAN_CATEGORY_PUBLIC;
u8 action = P2P_PUB_ACTION_ACTION;
u8 dialogToken = 1;
u32 p2poui = cpu_to_be32(P2POUI);
@ -6300,14 +6295,14 @@ void rtw_cfg80211_issue_p2p_provision_request(_adapter *padapter, const u8 *buf,
struct xmit_frame *pmgntframe;
struct pkt_attrib *pattrib;
unsigned char *pframe;
struct rtw_ieee80211_hdr *pwlanhdr;
struct ieee80211_hdr *pwlanhdr;
unsigned short *fctrl;
struct xmit_priv *pxmitpriv = &(padapter->xmitpriv);
struct mlme_ext_priv *pmlmeext = &(padapter->mlmeextpriv);
struct wifidirect_info *pwdinfo = &(padapter->wdinfo);
u8 *frame_body = (unsigned char *)(buf + sizeof(struct rtw_ieee80211_hdr_3addr));
size_t frame_body_len = len - sizeof(struct rtw_ieee80211_hdr_3addr);
u8 *frame_body = (unsigned char *)(buf + sizeof(struct ieee80211_hdr_3addr));
size_t frame_body_len = len - sizeof(struct ieee80211_hdr_3addr);
RTW_INFO("[%s] In\n", __FUNCTION__);
@ -6369,9 +6364,9 @@ void rtw_cfg80211_issue_p2p_provision_request(_adapter *padapter, const u8 *buf,
memset(pmgntframe->buf_addr, 0, WLANHDR_OFFSET + TXDESC_OFFSET);
pframe = (u8 *)(pmgntframe->buf_addr) + TXDESC_OFFSET;
pwlanhdr = (struct rtw_ieee80211_hdr *)pframe;
pwlanhdr = (struct ieee80211_hdr *)pframe;
fctrl = &(pwlanhdr->frame_ctl);
fctrl =&pwlanhdr->frame_control;
*(fctrl) = 0;
memcpy(pwlanhdr->addr1, pwdinfo->tx_prov_disc_info.peerDevAddr, ETH_ALEN);
@ -6382,8 +6377,8 @@ void rtw_cfg80211_issue_p2p_provision_request(_adapter *padapter, const u8 *buf,
pmlmeext->mgnt_seq++;
set_frame_sub_type(pframe, IEEE80211_STYPE_ACTION);
pframe += sizeof(struct rtw_ieee80211_hdr_3addr);
pattrib->pktlen = sizeof(struct rtw_ieee80211_hdr_3addr);
pframe += sizeof(struct 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, &(action), &(pattrib->pktlen));
@ -6411,8 +6406,7 @@ void rtw_cfg80211_issue_p2p_provision_request(_adapter *padapter, const u8 *buf,
p2p_ie[p2pielen++] = P2P_ATTR_CAPABILITY;
/* Length: */
/* *(u16*) ( p2pie + p2pielen ) = cpu_to_le16( 0x0002 ); */
RTW_PUT_LE16(p2p_ie + p2pielen, 0x0002);
*(u16*) ( p2p_ie + p2pielen ) = cpu_to_le16( 0x0002 );
p2pielen += 2;
/* Value: */
@ -6429,8 +6423,7 @@ void rtw_cfg80211_issue_p2p_provision_request(_adapter *padapter, const u8 *buf,
/* Length: */
/* 21->P2P Device Address (6bytes) + Config Methods (2bytes) + Primary Device Type (8bytes) */
/* + NumofSecondDevType (1byte) + WPS Device Name ID field (2bytes) + WPS Device Name Len field (2bytes) */
/* *(u16*) ( p2pie + p2pielen ) = cpu_to_le16( 21 + pwdinfo->device_name_len ); */
RTW_PUT_LE16(p2p_ie + p2pielen, devinfo_contentlen);
*(u16*) (p2p_ie + p2pielen) = cpu_to_le16(devinfo_contentlen);
p2pielen += 2;
/* Value: */
@ -7011,7 +7004,7 @@ static int _cfg80211_rtw_mgmt_tx(_adapter *padapter, u8 tx_ch, u8 no_cck, const
unsigned char *pframe;
int ret = _FAIL;
bool ack = _TRUE;
struct rtw_ieee80211_hdr *pwlanhdr;
struct ieee80211_hdr *pwlanhdr;
#if defined(RTW_ROCH_BACK_OP) && defined(CONFIG_P2P) && defined(CONFIG_CONCURRENT_MODE)
struct rtw_wdev_priv *pwdev_priv = adapter_wdev_data(padapter);
#endif
@ -7105,7 +7098,7 @@ issue_mgmt_frame:
memcpy(pframe, (void *)buf, len);
pattrib->pktlen = len;
pwlanhdr = (struct rtw_ieee80211_hdr *)pframe;
pwlanhdr = (struct ieee80211_hdr *)pframe;
/* update seq number */
pmlmeext->mgnt_seq = GetSequence(pwlanhdr);
pattrib->seqnum = pmlmeext->mgnt_seq;
@ -7324,7 +7317,7 @@ static int cfg80211_rtw_mgmt_tx(struct wiphy *wiphy,
cfg80211_action_tx_status(ndev, *cookie, buf, len, ack, GFP_KERNEL);
#endif
frame_styp = le16_to_cpu(((struct rtw_ieee80211_hdr_3addr *)buf)->frame_ctl) & IEEE80211_FCTL_STYPE;
frame_styp = le16_to_cpu(((struct ieee80211_hdr_3addr *)buf)->frame_control) & IEEE80211_FCTL_STYPE;
if (IEEE80211_STYPE_PROBE_RESP == frame_styp) {
#ifdef CONFIG_DEBUG_CFG80211
RTW_INFO("RTW_Tx: probe_resp tx_ch=%d, no_cck=%u, da="MAC_FMT"\n", tx_ch, no_cck, MAC_ARG(GetAddr1Ptr(buf)));
@ -7332,7 +7325,7 @@ static int cfg80211_rtw_mgmt_tx(struct wiphy *wiphy,
wait_ack = 0;
goto dump;
}
else if (frame_styp == RTW_IEEE80211_STYPE_AUTH) {
else if (frame_styp == IEEE80211_STYPE_AUTH) {
int retval = 0;
RTW_INFO("RTW_Tx:tx_ch=%d, no_cck=%u, da="MAC_FMT"\n", tx_ch, no_cck, MAC_ARG(GetAddr1Ptr(buf)));
@ -7348,7 +7341,7 @@ static int cfg80211_rtw_mgmt_tx(struct wiphy *wiphy,
if (rtw_action_frame_parse(buf, len, &category, &action) == _FALSE) {
RTW_INFO(FUNC_ADPT_FMT" frame_control:0x%02x\n", FUNC_ADPT_ARG(padapter),
le16_to_cpu(((struct rtw_ieee80211_hdr_3addr *)buf)->frame_ctl));
le16_to_cpu(((struct ieee80211_hdr_3addr *)buf)->frame_control));
goto exit;
}
@ -7370,18 +7363,17 @@ static int cfg80211_rtw_mgmt_tx(struct wiphy *wiphy,
}
}
#endif
if (category == RTW_WLAN_CATEGORY_PUBLIC) {
RTW_INFO("RTW_Tx:%s\n", action_public_str(action));
if (category == WLAN_CATEGORY_PUBLIC) {
switch (action) {
case ACT_PUBLIC_GAS_INITIAL_REQ:
case ACT_PUBLIC_GAS_INITIAL_RSP:
case WLAN_PUB_ACTION_GAS_INITIAL_REQ :
case WLAN_PUB_ACTION_GAS_INITIAL_RESP:
sleep_ms = 50;
retry_guarantee_ms = RTW_MAX_MGMT_TX_MS_GAS;
break;
}
}
#ifdef CONFIG_RTW_80211K
else if (category == RTW_WLAN_CATEGORY_RADIO_MEAS)
else if (category == WLAN_CATEGORY_RADIO_MEASUREMENT)
RTW_INFO("RTW_Tx: RRM Action\n");
#endif
else
@ -7619,22 +7611,22 @@ static int cfg80211_rtw_tdls_mgmt(struct wiphy *wiphy,
#endif
switch (txmgmt.action_code) {
case TDLS_SETUP_REQUEST:
case WLAN_TDLS_SETUP_REQUEST:
issue_tdls_setup_req(padapter, &txmgmt, _TRUE);
break;
case TDLS_SETUP_RESPONSE:
case WLAN_TDLS_SETUP_RESPONSE:
issue_tdls_setup_rsp(padapter, &txmgmt);
break;
case TDLS_SETUP_CONFIRM:
case WLAN_TDLS_SETUP_CONFIRM:
issue_tdls_setup_cfm(padapter, &txmgmt);
break;
case TDLS_TEARDOWN:
case WLAN_TDLS_TEARDOWN:
issue_tdls_teardown(padapter, &txmgmt, _TRUE);
break;
case TDLS_DISCOVERY_REQUEST:
case WLAN_TDLS_DISCOVERY_REQUEST:
issue_tdls_dis_req(padapter, &txmgmt);
break;
case TDLS_DISCOVERY_RESPONSE:
case WLAN_TDLS_DISCOVERY_RESPONSE:
issue_tdls_dis_rsp(padapter, &txmgmt, pmlmeinfo->enc_algo ? _TRUE : _FALSE);
break;
}
@ -8032,9 +8024,9 @@ static void rtw_cfg80211_mesh_cfg_set(_adapter *adapter, const struct mesh_confi
mcfg->dot11MeshGateAnnouncementProtocol = conf->dot11MeshGateAnnouncementProtocol;
/* our current gate annc implementation rides on root annc with gate annc bit in PREQ flags */
if (mcfg->dot11MeshGateAnnouncementProtocol
&& mcfg->dot11MeshHWMPRootMode <= RTW_IEEE80211_ROOTMODE_ROOT
&& mcfg->dot11MeshHWMPRootMode <= IEEE80211_ROOTMODE_ROOT
) {
mcfg->dot11MeshHWMPRootMode = RTW_IEEE80211_PROACTIVE_RANN;
mcfg->dot11MeshHWMPRootMode = IEEE80211_PROACTIVE_RANN;
RTW_INFO(ADPT_FMT" enable PROACTIVE_RANN becaue gate annc is needed\n", ADPT_ARG(adapter));
}
if (chk_mesh_attr(NL80211_MESHCONF_HWMP_RANN_INTERVAL, mask))
@ -8158,7 +8150,7 @@ u8 *rtw_cfg80211_construct_mesh_beacon_ies(struct wiphy *wiphy, _adapter *adapte
c = ies + 8;
/* beacon interval */
RTW_PUT_LE16(c , setup->beacon_interval);
*((u16 *)c) = cpu_to_le16(setup->beacon_interval);
c += 2;
/* capability */
@ -8208,7 +8200,7 @@ u8 *rtw_cfg80211_construct_mesh_beacon_ies(struct wiphy *wiphy, _adapter *adapte
memset(ht_op, 0, HT_OP_IE_LEN);
/* WLAN_EID_HT_CAPABILITY */
RTW_PUT_LE16(HT_CAP_ELE_CAP_INFO(ht_cap), sta_ht_cap->cap);
*(u16 *) (HT_CAP_ELE_CAP_INFO(ht_cap)) = cpu_to_le16(sta_ht_cap->cap);
SET_HT_CAP_ELE_MAX_AMPDU_LEN_EXP(ht_cap, sta_ht_cap->ampdu_factor);
SET_HT_CAP_ELE_MIN_MPDU_S_SPACE(ht_cap, sta_ht_cap->ampdu_density);
memcpy(HT_CAP_ELE_SUP_MCS_SET(ht_cap), &sta_ht_cap->mcs, 16);

View File

@ -367,7 +367,7 @@ static inline char *iwe_stream_protocol_process(_adapter *padapter,
#ifdef CONFIG_80211AC_VHT
/* parsing VHT_CAP_IE */
if(padapter->registrypriv.wireless_mode & WIRELESS_11AC) {
p = rtw_get_ie(&pnetwork->network.IEs[ie_offset], EID_VHTCapability, &vht_ielen, pnetwork->network.IELength - ie_offset);
p = rtw_get_ie(&pnetwork->network.IEs[ie_offset], WLAN_EID_VHT_CAPABILITY, &vht_ielen, pnetwork->network.IELength - ie_offset);
if (p && vht_ielen > 0)
vht_cap = _TRUE;
}
@ -436,7 +436,7 @@ static inline char *iwe_stream_rate_process(_adapter *padapter,
#ifdef CONFIG_80211AC_VHT
/* parsing VHT_CAP_IE */
if(padapter->registrypriv.wireless_mode & WIRELESS_11AC){
p = rtw_get_ie(&pnetwork->network.IEs[ie_offset], EID_VHTCapability, &vht_ielen, pnetwork->network.IELength - ie_offset);
p = rtw_get_ie(&pnetwork->network.IEs[ie_offset], WLAN_EID_VHT_CAPABILITY, &vht_ielen, pnetwork->network.IELength - ie_offset);
if (p && vht_ielen > 0) {
u8 mcs_map[2];
@ -755,13 +755,13 @@ static int wpa_set_auth_algs(struct net_device *dev, u32 value)
_adapter *padapter = (_adapter *) rtw_netdev_priv(dev);
int ret = 0;
if ((value & AUTH_ALG_SHARED_KEY) && (value & AUTH_ALG_OPEN_SYSTEM)) {
RTW_INFO("wpa_set_auth_algs, AUTH_ALG_SHARED_KEY and AUTH_ALG_OPEN_SYSTEM [value:0x%x]\n", value);
if ((value & IW_AUTH_ALG_SHARED_KEY) && (value & IW_AUTH_ALG_OPEN_SYSTEM)) {
RTW_INFO("wpa_set_auth_algs, IW_AUTH_ALG_SHARED_KEY and IW_AUTH_ALG_OPEN_SYSTEM [value:0x%x]\n", value);
padapter->securitypriv.ndisencryptstatus = Ndis802_11Encryption1Enabled;
padapter->securitypriv.ndisauthtype = Ndis802_11AuthModeAutoSwitch;
padapter->securitypriv.dot11AuthAlgrthm = dot11AuthAlgrthm_Auto;
} else if (value & AUTH_ALG_SHARED_KEY) {
RTW_INFO("wpa_set_auth_algs, AUTH_ALG_SHARED_KEY [value:0x%x]\n", value);
} else if (value & IW_AUTH_ALG_SHARED_KEY) {
RTW_INFO("wpa_set_auth_algs, IW_AUTH_ALG_SHARED_KEY [value:0x%x]\n", value);
padapter->securitypriv.ndisencryptstatus = Ndis802_11Encryption1Enabled;
#ifdef CONFIG_PLATFORM_MT53XX
@ -771,8 +771,8 @@ static int wpa_set_auth_algs(struct net_device *dev, u32 value)
padapter->securitypriv.ndisauthtype = Ndis802_11AuthModeShared;
padapter->securitypriv.dot11AuthAlgrthm = dot11AuthAlgrthm_Shared;
#endif
} else if (value & AUTH_ALG_OPEN_SYSTEM) {
RTW_INFO("wpa_set_auth_algs, AUTH_ALG_OPEN_SYSTEM\n");
} else if (value & IW_AUTH_ALG_OPEN_SYSTEM) {
RTW_INFO("wpa_set_auth_algs, IW_AUTH_ALG_OPEN_SYSTEM\n");
/* padapter->securitypriv.ndisencryptstatus = Ndis802_11EncryptionDisabled; */
if (padapter->securitypriv.ndisauthtype < Ndis802_11AuthModeWPAPSK) {
#ifdef CONFIG_PLATFORM_MT53XX
@ -784,8 +784,8 @@ static int wpa_set_auth_algs(struct net_device *dev, u32 value)
#endif
}
} else if (value & AUTH_ALG_LEAP)
RTW_INFO("wpa_set_auth_algs, AUTH_ALG_LEAP\n");
} else if (value & IW_AUTH_ALG_LEAP)
RTW_INFO("wpa_set_auth_algs, IW_AUTH_ALG_LEAP\n");
else {
RTW_INFO("wpa_set_auth_algs, error!\n");
ret = -EINVAL;
@ -3040,7 +3040,7 @@ static int rtw_wx_set_enc_ext(struct net_device *dev,
memset(param, 0, param_len);
param->cmd = IEEE_CMD_SET_ENCRYPTION;
memset(param->sta_addr, 0xff, ETH_ALEN);
eth_broadcast_addr(param->sta_addr);
switch (pext->alg) {
@ -6689,25 +6689,6 @@ static int wpa_set_param(struct net_device *dev, u8 name, u32 value)
* be set.
*/
#if 0
struct ieee80211_security sec = {
.flags = SEC_ENABLED,
.enabled = value,
};
ieee->drop_unencrypted = value;
/* We only change SEC_LEVEL for open mode. Others
* are set by ipw_wpa_set_encryption.
*/
if (!value) {
sec.flags |= SEC_LEVEL;
sec.level = SEC_LEVEL_0;
} else {
sec.flags |= SEC_LEVEL;
sec.level = SEC_LEVEL_1;
}
if (ieee->set_security)
ieee->set_security(ieee->dev, &sec);
#endif
break;
}
@ -11446,7 +11427,7 @@ static struct xmit_frame *createloopbackpkt(PADAPTER padapter, u32 size)
struct pkt_attrib *pattrib;
struct tx_desc *desc;
u8 *pkt_start, *pkt_end, *ptr;
struct rtw_ieee80211_hdr *hdr;
struct ieee80211_hdr *hdr;
bool bmcast;
_irqL irqL;
@ -11551,8 +11532,8 @@ static struct xmit_frame *createloopbackpkt(PADAPTER padapter, u32 size)
pkt_end = pkt_start + pattrib->last_txcmdsz;
/* 3 5.1. make wlan header, make_wlanhdr() */
hdr = (struct rtw_ieee80211_hdr *)pkt_start;
set_frame_sub_type(&hdr->frame_ctl, pattrib->subtype);
hdr = (struct ieee80211_hdr *)pkt_start;
set_frame_sub_type(&hdr->frame_control, pattrib->subtype);
memcpy(hdr->addr1, pattrib->dst, ETH_ALEN); /* DA */
memcpy(hdr->addr2, pattrib->src, ETH_ALEN); /* SA */
memcpy(hdr->addr3, get_bssid(&padapter->mlmepriv), ETH_ALEN); /* RA, BSSID */
@ -11642,7 +11623,7 @@ static u8 pktcmp(PADAPTER padapter, u8 *txbuf, u32 txsz, u8 *rxbuf, u32 rxsz)
phal = GET_HAL_DATA(padapter);
if (rtw_hal_rcr_check(padapter, RCR_APPFCS))
fcssize = IEEE80211_FCS_LEN;
fcssize = FCS_LEN;
else
fcssize = 0;

View File

@ -1087,10 +1087,10 @@ int rtw_mp_arx(struct net_device *dev,
if (pmppriv->bloopback == _TRUE) {
sprintf(extra , "Enter MAC LoopBack mode\n");
_rtw_write32(padapter, 0x100, 0xB0106FF);
RTW_INFO("0x100 :0x%x" , _rtw_read32(padapter, 0x100));
_rtw_write16(padapter, 0x608, 0x30c);
RTW_INFO("0x100 :0x%x" , _rtw_read32(padapter, 0x608));
rtw_write32(padapter, 0x100, 0xB0106FF);
RTW_INFO("0x100 :0x%x" , rtw_read32(padapter, 0x100));
rtw_write16(padapter, 0x608, 0x30c);
RTW_INFO("0x100 :0x%x" , rtw_read32(padapter, 0x608));
}
wrqu->length = strlen(extra) + 1;

View File

@ -187,7 +187,7 @@ void rtw_report_sec_ie(_adapter *adapter, u8 authmode, u8 *sec_ie)
buff = NULL;
if (authmode == _WPA_IE_ID_) {
if (authmode == WLAN_EID_VENDOR_SPECIFIC) {
buff = rtw_zmalloc(IW_CUSTOM_MAX);
if (NULL == buff) {