diff --git a/core/efuse/rtw_efuse.c b/core/efuse/rtw_efuse.c index 4c0043a..1c3eb8d 100644 --- a/core/efuse/rtw_efuse.c +++ b/core/efuse/rtw_efuse.c @@ -1952,7 +1952,7 @@ ReadEFuseByte( u32 value32; u8 readbyte; u16 retry; - /* systime start=rtw_get_current_time(); */ + /* systime start=jiffies; */ if (bPseudoTest) { Efuse_Read1ByteFromFakeContent(Adapter, _offset, pbuf); diff --git a/core/mesh/rtw_mesh.c b/core/mesh/rtw_mesh.c index 1807993..7409aa0 100644 --- a/core/mesh/rtw_mesh.c +++ b/core/mesh/rtw_mesh.c @@ -269,7 +269,7 @@ void rtw_mesh_update_scanned_acnode_status(_adapter *adapter, struct wlan_networ acnode = !nop && accept; if (acnode && scanned->acnode_stime == 0) { - scanned->acnode_stime = rtw_get_current_time(); + scanned->acnode_stime = jiffies; if (scanned->acnode_stime == 0) scanned->acnode_stime++; } else if (!acnode) { @@ -288,7 +288,7 @@ bool rtw_mesh_scanned_is_acnode_confirmed(_adapter *adapter, struct wlan_network static bool rtw_mesh_scanned_is_acnode_allow_notify(_adapter *adapter, struct wlan_network *scanned) { return scanned->acnode_notify_etime - && rtw_time_after(scanned->acnode_notify_etime, rtw_get_current_time()); + && rtw_time_after(scanned->acnode_notify_etime, jiffies); } bool rtw_mesh_acnode_prevent_allow_sacrifice(_adapter *adapter) @@ -329,7 +329,7 @@ static bool rtw_mesh_acnode_candidate_exist(_adapter *adapter) head = get_list_head(queue); list = get_next(head); - while (!rtw_end_of_queue_search(head, list)) { + while (head != list) { scanned = LIST_CONTAINOR(list, struct wlan_network, list); list = get_next(list); @@ -409,7 +409,7 @@ struct sta_info *_rtw_mesh_acnode_prevent_pick_sacrifice(_adapter *adapter) head = &stapriv->asoc_list; list = get_next(head); - while (rtw_end_of_queue_search(head, list) == _FALSE) { + while (head != list) { sta = LIST_CONTAINOR(list, struct sta_info, asoc_list); list = get_next(list); @@ -466,8 +466,8 @@ static void rtw_mesh_acnode_set_notify_etime(_adapter *adapter, u8 *rframe_whdr) struct wlan_network *scanned = rtw_find_network(&adapter->mlmepriv.scanned_queue, get_addr2_ptr(rframe_whdr)); if (rtw_mesh_scanned_is_acnode_confirmed(adapter, scanned)) { - scanned->acnode_notify_etime = rtw_get_current_time() - + rtw_ms_to_systime(adapter->mesh_cfg.peer_sel_policy.acnode_notify_timeout_ms); + scanned->acnode_notify_etime = jiffies + + msecs_to_jiffies(adapter->mesh_cfg.peer_sel_policy.acnode_notify_timeout_ms); if (scanned->acnode_notify_etime == 0) scanned->acnode_notify_etime++; } @@ -627,11 +627,11 @@ static void rtw_mesh_cto_mgate_blacklist_chk(_adapter *adapter) enter_critical_bh(&blist->lock); head = &blist->queue; list = get_next(head); - while (rtw_end_of_queue_search(head, list) == _FALSE) { + while (head != list) { ent = LIST_CONTAINOR(list, struct blacklist_ent, list); list = get_next(list); - if (rtw_time_after(rtw_get_current_time(), ent->exp_time)) { + if (rtw_time_after(jiffies, ent->exp_time)) { rtw_list_delete(&ent->list); rtw_mfree(ent, sizeof(struct blacklist_ent)); continue; @@ -748,7 +748,7 @@ void rtw_mesh_peer_status_chk(_adapter *adapter) head = &stapriv->asoc_list; list = get_next(head); - while (rtw_end_of_queue_search(head, list) == _FALSE) { + while (head != list) { sta = LIST_CONTAINOR(list, struct sta_info, asoc_list); list = get_next(list); @@ -893,7 +893,7 @@ static u8 rtw_mesh_offch_cto_mgate_required(_adapter *adapter) head = get_list_head(queue); pos = get_next(head); - while (!rtw_end_of_queue_search(head, pos)) { + while (!head == pos) { scanned = LIST_CONTAINOR(pos, struct wlan_network, list); if (rtw_get_passing_time_ms(scanned->last_scanned) < mcfg->peer_sel_policy.scanr_exp_ms @@ -913,7 +913,7 @@ static u8 rtw_mesh_offch_cto_mgate_required(_adapter *adapter) pos = get_next(pos); } - if (rtw_end_of_queue_search(head, pos)) + if (head == pos) ret = 1; exit_critical_bh(&(mlme->scanned_queue.lock)); @@ -979,7 +979,7 @@ u8 rtw_mesh_select_operating_ch(_adapter *adapter) head = get_list_head(queue); pos = get_next(head); - while (!rtw_end_of_queue_search(head, pos)) { + while (!head == pos) { scanned = LIST_CONTAINOR(pos, struct wlan_network, list); pos = get_next(pos); @@ -1085,7 +1085,7 @@ void dump_mesh_networks(void *sel, _adapter *adapter) head = get_list_head(queue); list = get_next(head); - while (rtw_end_of_queue_search(head, list) == _FALSE) { + while (head != list) { network = LIST_CONTAINOR(list, struct wlan_network, list); list = get_next(list); @@ -2344,7 +2344,7 @@ void dump_mesh_plink_ctl(void *sel, _adapter *adapter) #if CONFIG_RTW_MESH_PEER_BLACKLIST if (!IS_PEER_CONF_DISABLED(ent)) { if (!IS_PEER_CONF_TIMEOUT(ent)) - RTW_PRINT_SEL(sel, "peer_conf:%d\n", rtw_systime_to_ms(ent->peer_conf_end_time - rtw_get_current_time())); + RTW_PRINT_SEL(sel, "peer_conf:%d\n", jiffies_to_msecs(ent->peer_conf_end_time - jiffies)); else RTW_PRINT_SEL(sel, "peer_conf:TIMEOUT\n"); } @@ -2353,7 +2353,7 @@ void dump_mesh_plink_ctl(void *sel, _adapter *adapter) #if CONFIG_RTW_MESH_CTO_MGATE_BLACKLIST if (!IS_CTO_MGATE_CONF_DISABLED(ent)) { if (!IS_CTO_MGATE_CONF_TIMEOUT(ent)) - RTW_PRINT_SEL(sel, "cto_mgate_conf:%d\n", rtw_systime_to_ms(ent->cto_mgate_conf_end_time - rtw_get_current_time())); + RTW_PRINT_SEL(sel, "cto_mgate_conf:%d\n", jiffies_to_msecs(ent->cto_mgate_conf_end_time - jiffies)); else RTW_PRINT_SEL(sel, "cto_mgate_conf:TIMEOUT\n"); } @@ -2429,10 +2429,10 @@ int rtw_mesh_peer_establish(_adapter *adapter, struct mesh_plink_ent *plink, str rtw_ap_parse_sta_capability(adapter, sta, plink->rx_conf_ies); - if (rtw_ap_parse_sta_supported_rates(adapter, sta, tlv_ies, tlv_ieslen) != _STATS_SUCCESSFUL_) + if (rtw_ap_parse_sta_supported_rates(adapter, sta, tlv_ies, tlv_ieslen) != WLAN_STATUS_SUCCESS) goto exit; - if (rtw_ap_parse_sta_security_ie(adapter, sta, &elems) != _STATS_SUCCESSFUL_) + if (rtw_ap_parse_sta_security_ie(adapter, sta, &elems) != WLAN_STATUS_SUCCESS) goto exit; rtw_ap_parse_sta_wmm_ie(adapter, sta, tlv_ies, tlv_ieslen); @@ -2528,7 +2528,7 @@ static u8 *rtw_mesh_construct_peer_mesh_close(_adapter *adapter, struct mesh_pli memcpy(whdr->addr2, plink->addr, ETH_ALEN); memcpy(whdr->addr3, adapter_mac_addr(adapter), ETH_ALEN); - set_frame_sub_type(frame, WIFI_ACTION); + set_frame_sub_type(frame, IEEE80211_STYPE_ACTION); pos += sizeof(struct rtw_ieee80211_hdr_3addr); *(pos++) = RTW_WLAN_CATEGORY_SELF_PROTECTED; @@ -2643,7 +2643,7 @@ u8 rtw_mesh_ps_annc(_adapter *adapter, u8 ps) head = &stapriv->asoc_list; list = get_next(head); - while ((rtw_end_of_queue_search(head, list)) == _FALSE) { + while (head != list) { int stainfo_offset; sta = LIST_CONTAINOR(list, struct sta_info, asoc_list); @@ -2695,7 +2695,7 @@ static void mpath_tx_tasklet_hdl(void *priv) head = &tmp; list = get_next(head); - while (rtw_end_of_queue_search(head, list) == _FALSE) { + while (head != list) { xframe = LIST_CONTAINOR(list, struct xmit_frame, list); list = get_next(list); rtw_list_delete(&xframe->list); @@ -2726,7 +2726,7 @@ static void rtw_mpath_tx_queue_flush(_adapter *adapter) head = &tmp; list = get_next(head); - while (rtw_end_of_queue_search(head, list) == _FALSE) { + while (head != list) { xframe = LIST_CONTAINOR(list, struct xmit_frame, list); list = get_next(list); rtw_list_delete(&xframe->list); @@ -2924,7 +2924,7 @@ static int rtw_mrc_check(_adapter *adapter, const u8 *msa, u32 seq) idx = seq & mrc->idx_mask; rtw_hlist_for_each_entry_safe(p, np, n, &mrc->bucket[idx], list) { ++entries; - timeout = rtw_time_after(rtw_get_current_time(), p->exp_time); + timeout = rtw_time_after(jiffies, p->exp_time); if (timeout || entries == RTW_MRC_QUEUE_MAX_LEN) { if (!timeout) minfo->mshstats.mrc_del_qlen++; @@ -2941,7 +2941,7 @@ static int rtw_mrc_check(_adapter *adapter, const u8 *msa, u32 seq) return 0; p->seqnum = seq; - p->exp_time = rtw_get_current_time() + rtw_ms_to_systime(RTW_MRC_TIMEOUT_MS); + p->exp_time = jiffies + msecs_to_jiffies(RTW_MRC_TIMEOUT_MS); memcpy(p->msa, msa, ETH_ALEN); rtw_hlist_add_head(&p->list, &mrc->bucket[idx]); return 0; @@ -3081,9 +3081,9 @@ void rtw_mesh_init_mesh_info(_adapter *adapter) rtw_mesh_plink_ctl_init(adapter); - minfo->last_preq = rtw_get_current_time(); - /* minfo->last_sn_update = rtw_get_current_time(); */ - minfo->next_perr = rtw_get_current_time(); + minfo->last_preq = jiffies; + /* minfo->last_sn_update = jiffies; */ + minfo->next_perr = jiffies; atomic_set(&minfo->mpaths, 0); rtw_mesh_pathtbl_init(adapter); @@ -3213,9 +3213,9 @@ int rtw_mesh_nexthop_lookup(_adapter *adapter, if (!mpath || !(mpath->flags & RTW_MESH_PATH_ACTIVE)) goto endlookup; - if (rtw_time_after(rtw_get_current_time(), + if (rtw_time_after(jiffies, mpath->exp_time - - rtw_ms_to_systime(adapter->mesh_cfg.path_refresh_time)) && + msecs_to_jiffies(adapter->mesh_cfg.path_refresh_time)) && _rtw_memcmp(adapter_mac_addr(adapter), msa, ETH_ALEN) == _TRUE && !(mpath->flags & RTW_MESH_PATH_RESOLVING) && !(mpath->flags & RTW_MESH_PATH_FIXED)) { @@ -3253,7 +3253,7 @@ static bool rtw_mesh_data_bmc_to_uc(_adapter *adapter head = &stapriv->asoc_list; list = get_next(head); - while ((rtw_end_of_queue_search(head, list)) == _FALSE) { + while (head != list) { int stainfo_offset; sta = LIST_CONTAINOR(list, struct sta_info, asoc_list); @@ -3366,7 +3366,7 @@ int rtw_mesh_addr_resolve(_adapter *adapter, struct xmit_frame *xframe, _pkt *pk if (mpp_lookup) { mppath = rtw_mpp_path_lookup(adapter, etherhdr.h_dest); if (mppath) - mppath->exp_time = rtw_get_current_time(); + mppath->exp_time = jiffies; } if (mppath && mpath) @@ -3801,7 +3801,7 @@ int rtw_mesh_rx_msdu_act_check(union recv_frame *rframe enter_critical_bh(&mppath->state_lock); if (_rtw_memcmp(mppath->mpp, mpp_addr, ETH_ALEN) == _FALSE) memcpy(mppath->mpp, mpp_addr, ETH_ALEN); - mppath->exp_time = rtw_get_current_time(); + mppath->exp_time = jiffies; exit_critical_bh(&mppath->state_lock); } rtw_rcu_read_unlock(); diff --git a/core/mesh/rtw_mesh.h b/core/mesh/rtw_mesh.h index 63d66d8..bc480d8 100644 --- a/core/mesh/rtw_mesh.h +++ b/core/mesh/rtw_mesh.h @@ -155,11 +155,11 @@ enum rtw_mesh_deferred_task_flags { #define RTW_MESH_PEER_CONF_DISABLED 0 /* special time value means no confirmation ongoing */ #if CONFIG_RTW_MESH_PEER_BLACKLIST #define IS_PEER_CONF_DISABLED(plink) ((plink)->peer_conf_end_time == RTW_MESH_PEER_CONF_DISABLED) -#define IS_PEER_CONF_TIMEOUT(plink)(!IS_PEER_CONF_DISABLED(plink) && rtw_time_after(rtw_get_current_time(), (plink)->peer_conf_end_time)) +#define IS_PEER_CONF_TIMEOUT(plink)(!IS_PEER_CONF_DISABLED(plink) && rtw_time_after(jiffies, (plink)->peer_conf_end_time)) #define SET_PEER_CONF_DISABLED(plink) (plink)->peer_conf_end_time = RTW_MESH_PEER_CONF_DISABLED #define SET_PEER_CONF_END_TIME(plink, timeout_ms) \ do { \ - (plink)->peer_conf_end_time = rtw_get_current_time() + rtw_ms_to_systime(timeout_ms); \ + (plink)->peer_conf_end_time = jiffies + msecs_to_jiffies(timeout_ms); \ if ((plink)->peer_conf_end_time == RTW_MESH_PEER_CONF_DISABLED) \ (plink)->peer_conf_end_time++; \ } while (0) @@ -173,11 +173,11 @@ enum rtw_mesh_deferred_task_flags { #define RTW_MESH_CTO_MGATE_CONF_DISABLED 0 /* special time value means no confirmation ongoing */ #if CONFIG_RTW_MESH_CTO_MGATE_BLACKLIST #define IS_CTO_MGATE_CONF_DISABLED(plink) ((plink)->cto_mgate_conf_end_time == RTW_MESH_CTO_MGATE_CONF_DISABLED) -#define IS_CTO_MGATE_CONF_TIMEOUT(plink)(!IS_CTO_MGATE_CONF_DISABLED(plink) && rtw_time_after(rtw_get_current_time(), (plink)->cto_mgate_conf_end_time)) +#define IS_CTO_MGATE_CONF_TIMEOUT(plink)(!IS_CTO_MGATE_CONF_DISABLED(plink) && rtw_time_after(jiffies, (plink)->cto_mgate_conf_end_time)) #define SET_CTO_MGATE_CONF_DISABLED(plink) (plink)->cto_mgate_conf_end_time = RTW_MESH_CTO_MGATE_CONF_DISABLED #define SET_CTO_MGATE_CONF_END_TIME(plink, timeout_ms) \ do { \ - (plink)->cto_mgate_conf_end_time = rtw_get_current_time() + rtw_ms_to_systime(timeout_ms); \ + (plink)->cto_mgate_conf_end_time = jiffies + msecs_to_jiffies(timeout_ms); \ if ((plink)->cto_mgate_conf_end_time == RTW_MESH_CTO_MGATE_CONF_DISABLED) \ (plink)->cto_mgate_conf_end_time++; \ } while (0) diff --git a/core/mesh/rtw_mesh_hwmp.c b/core/mesh/rtw_mesh_hwmp.c index 8d76622..42b1a29 100644 --- a/core/mesh/rtw_mesh_hwmp.c +++ b/core/mesh/rtw_mesh_hwmp.c @@ -145,8 +145,8 @@ static inline u16 rtw_u16_field_get(const u8 *preq_elem, int shift, BOOLEAN ae) #define RTW_PERR_IE_TARGET_SN(x) rtw_u32_field_get(x, 9, 0) #define RTW_PERR_IE_TARGET_RCODE(x) rtw_u16_field_get(x, 13, 0) -#define RTW_TU_TO_SYSTIME(x) (rtw_us_to_systime((x) * 1024)) -#define RTW_TU_TO_EXP_TIME(x) (rtw_get_current_time() + RTW_TU_TO_SYSTIME(x)) +#define RTW_TU_TO_SYSTIME(x) (usecs_to_jiffies((x) * 1024)) +#define RTW_TU_TO_EXP_TIME(x) (jiffies + RTW_TU_TO_SYSTIME(x)) #define RTW_MSEC_TO_TU(x) (x*1000/1024) #define RTW_SN_GT(x, y) ((s32)(y - x) < 0) #define RTW_SN_LT(x, y) ((s32)(x - y) < 0) @@ -158,16 +158,16 @@ static inline u32 RTW_SN_DELTA(u32 x, u32 y) } #define rtw_net_traversal_jiffies(adapter) \ - rtw_ms_to_systime(adapter->mesh_cfg.dot11MeshHWMPnetDiameterTraversalTime) + msecs_to_jiffies(adapter->mesh_cfg.dot11MeshHWMPnetDiameterTraversalTime) #define rtw_default_lifetime(adapter) \ RTW_MSEC_TO_TU(adapter->mesh_cfg.dot11MeshHWMPactivePathTimeout) #define rtw_min_preq_int_jiff(adapter) \ - (rtw_ms_to_systime(adapter->mesh_cfg.dot11MeshHWMPpreqMinInterval)) + (msecs_to_jiffies(adapter->mesh_cfg.dot11MeshHWMPpreqMinInterval)) #define rtw_max_preq_retries(adapter) (adapter->mesh_cfg.dot11MeshHWMPmaxPREQretries) #define rtw_disc_timeout_jiff(adapter) \ - rtw_ms_to_systime(adapter->mesh_cfg.min_discovery_timeout) + msecs_to_jiffies(adapter->mesh_cfg.min_discovery_timeout) #define rtw_root_path_confirmation_jiffies(adapter) \ - rtw_ms_to_systime(adapter->mesh_cfg.dot11MeshHWMPconfirmationInterval) + msecs_to_jiffies(adapter->mesh_cfg.dot11MeshHWMPconfirmationInterval) static inline BOOLEAN rtw_ether_addr_equal(const u8 *addr1, const u8 *addr2) { @@ -245,7 +245,7 @@ static int rtw_mesh_path_sel_frame_tx(enum rtw_mpath_frame_type mpath_action, u8 SetSeqNum(pwlanhdr, pmlmeext->mgnt_seq); pmlmeext->mgnt_seq++; - set_frame_sub_type(pos, WIFI_ACTION); + set_frame_sub_type(pos, IEEE80211_STYPE_ACTION); pos += sizeof(struct rtw_ieee80211_hdr_3addr); pattrib->pktlen = sizeof(struct rtw_ieee80211_hdr_3addr); @@ -335,7 +335,7 @@ int rtw_mesh_path_error_tx(_adapter *adapter, u8 *pos, ie_len; u16 *fctrl = NULL; - if (rtw_time_before(rtw_get_current_time(), minfo->next_perr)) + if (rtw_time_before(jiffies, minfo->next_perr)) return -1; pmgntframe = alloc_mgtxmitframe(pxmitpriv); @@ -358,7 +358,7 @@ int rtw_mesh_path_error_tx(_adapter *adapter, SetSeqNum(pwlanhdr, pmlmeext->mgnt_seq); pmlmeext->mgnt_seq++; - set_frame_sub_type(pos, WIFI_ACTION); + set_frame_sub_type(pos, IEEE80211_STYPE_ACTION); pos += sizeof(struct rtw_ieee80211_hdr_3addr); pattrib->pktlen = sizeof(struct rtw_ieee80211_hdr_3addr); @@ -669,11 +669,11 @@ static void rtw_hwmp_preq_frame_process(_adapter *adapter, reply = _TRUE; to_gate_ask = 1; target_metric = 0; - if (rtw_time_after(rtw_get_current_time(), minfo->last_sn_update + + if (rtw_time_after(jiffies, minfo->last_sn_update + rtw_net_traversal_jiffies(adapter)) || - rtw_time_before(rtw_get_current_time(), minfo->last_sn_update)) { + rtw_time_before(jiffies, minfo->last_sn_update)) { ++minfo->sn; - minfo->last_sn_update = rtw_get_current_time(); + minfo->last_sn_update = jiffies; } target_sn = minfo->sn; } else if (is_broadcast_mac_addr(target_addr) && @@ -686,7 +686,7 @@ static void rtw_hwmp_preq_frame_process(_adapter *adapter, target_addr = adapter_mac_addr(adapter); target_sn = ++minfo->sn; target_metric = 0; - minfo->last_sn_update = rtw_get_current_time(); + minfo->last_sn_update = jiffies; } if (preq_is_gate) { @@ -998,9 +998,9 @@ static void rtw_hwmp_rann_frame_process(_adapter *adapter, } if ((!(path->flags & (RTW_MESH_PATH_ACTIVE | RTW_MESH_PATH_RESOLVING)) || - (rtw_time_after(rtw_get_current_time(), path->last_preq_to_root + + (rtw_time_after(jiffies, path->last_preq_to_root + rtw_root_path_confirmation_jiffies(adapter)) || - rtw_time_before(rtw_get_current_time(), path->last_preq_to_root))) && + rtw_time_before(jiffies, path->last_preq_to_root))) && !(path->flags & RTW_MESH_PATH_FIXED) && (ttl != 0)) { u8 preq_node_flag = RTW_PREQ_Q_F_START | RTW_PREQ_Q_F_REFRESH; @@ -1022,7 +1022,7 @@ static void rtw_hwmp_rann_frame_process(_adapter *adapter, } #endif rtw_mesh_queue_preq(path, preq_node_flag); - path->last_preq_to_root = rtw_get_current_time(); + path->last_preq_to_root = jiffies; } path->sn = originator_sn; @@ -1325,12 +1325,12 @@ void rtw_mesh_queue_preq(struct rtw_mesh_path *path, u8 flags) ++minfo->preq_queue_len; exit_critical_bh(&minfo->mesh_preq_queue_lock); - if (rtw_time_after(rtw_get_current_time(), minfo->last_preq + rtw_min_preq_int_jiff(adapter))) + if (rtw_time_after(jiffies, minfo->last_preq + rtw_min_preq_int_jiff(adapter))) rtw_mesh_work(&adapter->mesh_work); - else if (rtw_time_before(rtw_get_current_time(), minfo->last_preq)) { + else if (rtw_time_before(jiffies, minfo->last_preq)) { /* systime wrapped around issue */ - minfo->last_preq = rtw_get_current_time() - rtw_min_preq_int_jiff(adapter) - 1; + minfo->last_preq = jiffies - rtw_min_preq_int_jiff(adapter) - 1; rtw_mesh_work(&adapter->mesh_work); } else rtw_mod_timer(&adapter->mesh_path_timer, minfo->last_preq + @@ -1372,7 +1372,7 @@ void rtw_mesh_path_start_discovery(_adapter *adapter) enter_critical_bh(&minfo->mesh_preq_queue_lock); if (!minfo->preq_queue_len || - rtw_time_before(rtw_get_current_time(), minfo->last_preq + + rtw_time_before(jiffies, minfo->last_preq + rtw_min_preq_int_jiff(adapter))) { exit_critical_bh(&minfo->mesh_preq_queue_lock); return; @@ -1412,13 +1412,13 @@ void rtw_mesh_path_start_discovery(_adapter *adapter) goto enddiscovery; } - minfo->last_preq = rtw_get_current_time(); + minfo->last_preq = jiffies; - if (rtw_time_after(rtw_get_current_time(), minfo->last_sn_update + + if (rtw_time_after(jiffies, minfo->last_sn_update + rtw_net_traversal_jiffies(adapter)) || - rtw_time_before(rtw_get_current_time(), minfo->last_sn_update)) { + rtw_time_before(jiffies, minfo->last_sn_update)) { ++minfo->sn; - minfo->last_sn_update = rtw_get_current_time(); + minfo->last_sn_update = jiffies; } lifetime = rtw_default_lifetime(adapter); ttl = mshcfg->element_ttl; @@ -1448,7 +1448,7 @@ void rtw_mesh_path_start_discovery(_adapter *adapter) rtw_mesh_path_sel_frame_tx(RTW_MPATH_PREQ, flags, adapter_mac_addr(adapter), minfo->sn, target_flags, path->dst, path->sn, da, 0, ttl, lifetime, 0, minfo->preq_id++, adapter); - rtw_mod_timer(&path->timer, rtw_get_current_time() + path->discovery_timeout); + rtw_mod_timer(&path->timer, jiffies + path->discovery_timeout); enddiscovery: rtw_rcu_read_unlock(); @@ -1496,7 +1496,7 @@ void rtw_mesh_path_timer(void *ctx) RTW_MESH_PATH_REQ_QUEUED | RTW_MESH_PATH_ROOT_ADD_CHK | RTW_MESH_PATH_PEER_AKA); - path->exp_time = rtw_get_current_time(); + path->exp_time = jiffies; exit_critical_bh(&path->state_lock); if (!path->is_gate && rtw_mesh_gate_num(adapter) > 0) { ret = rtw_mesh_path_send_to_gates(path); @@ -1602,7 +1602,7 @@ void rtw_mesh_work_hdl(_workitem *work) _adapter *adapter = container_of(work, _adapter, mesh_work); while(adapter->mesh_info.preq_queue_len) { - if (rtw_time_after(rtw_get_current_time(), + if (rtw_time_after(jiffies, adapter->mesh_info.last_preq + rtw_min_preq_int_jiff(adapter))) /* It will consume preq_queue_len */ rtw_mesh_path_start_discovery(adapter); diff --git a/core/mesh/rtw_mesh_pathtbl.c b/core/mesh/rtw_mesh_pathtbl.c index 194ec42..a1323b9 100644 --- a/core/mesh/rtw_mesh_pathtbl.c +++ b/core/mesh/rtw_mesh_pathtbl.c @@ -61,7 +61,7 @@ static const rtw_rhashtable_params rtw_mesh_rht_params = { static inline bool rtw_mpath_expired(struct rtw_mesh_path *mpath) { return (mpath->flags & RTW_MESH_PATH_ACTIVE) && - rtw_time_after(rtw_get_current_time(), mpath->exp_time) && + rtw_time_after(jiffies, mpath->exp_time) && !(mpath->flags & RTW_MESH_PATH_FIXED); } @@ -114,7 +114,7 @@ void rtw_mesh_path_assign_nexthop(struct rtw_mesh_path *mpath, struct sta_info * enter_critical_bh(&mpath->frame_queue.lock); head = &mpath->frame_queue.queue; list = get_next(head); - while (rtw_end_of_queue_search(head, list) == _FALSE) { + while (head != list) { xframe = LIST_CONTAINOR(list, struct xmit_frame, list); list = get_next(list); memcpy(xframe->attrib.ra, sta->cmn.mac_addr, ETH_ALEN); @@ -183,7 +183,7 @@ static void rtw_mesh_path_move_to_queue(struct rtw_mesh_path *gate_mpath, head = &failq; list = get_next(head); - while (rtw_end_of_queue_search(head, list) == _FALSE) { + while (head != list) { if (gate_mpath->frame_queue_len >= RTW_MESH_FRAME_QUEUE_LEN) { RTW_MPATH_DBG(FUNC_ADPT_FMT" mpath queue for gate %pM is full!\n" , FUNC_ADPT_ARG(gate_mpath->adapter), gate_mpath->dst); @@ -359,8 +359,8 @@ int rtw_mesh_path_add_gate(struct rtw_mesh_path *mpath) enter_critical_bh(&mpath->state_lock); mcfg = &mpath->adapter->mesh_cfg; - mpath->gate_timeout = rtw_get_current_time() + - rtw_ms_to_systime(mcfg->path_gate_timeout_factor * + mpath->gate_timeout = jiffies + + msecs_to_jiffies(mcfg->path_gate_timeout_factor * mpath->gate_ann_int); if (mpath->is_gate) { err = -EEXIST; @@ -551,7 +551,7 @@ struct rtw_mesh_path *rtw_mesh_path_new(_adapter *adapter, new_mpath->gate_asked = false; _rtw_init_queue(&new_mpath->frame_queue); new_mpath->frame_queue_len = 0; - new_mpath->exp_time = rtw_get_current_time(); + new_mpath->exp_time = jiffies; _rtw_spinlock_init(&new_mpath->state_lock); rtw_init_timer(&new_mpath->timer, adapter, rtw_mesh_path_timer, new_mpath); @@ -1047,7 +1047,7 @@ void rtw_mesh_path_flush_pending(struct rtw_mesh_path *mpath) head = &tmp; list = get_next(head); - while (rtw_end_of_queue_search(head, list) == _FALSE) { + while (head != list) { xframe = LIST_CONTAINOR(list, struct xmit_frame, list); list = get_next(list); rtw_list_delete(&xframe->list); @@ -1134,21 +1134,21 @@ void rtw_mesh_path_tbl_expire(_adapter *adapter, break; if ((!(mpath->flags & RTW_MESH_PATH_RESOLVING)) && (!(mpath->flags & RTW_MESH_PATH_FIXED)) && - rtw_time_after(rtw_get_current_time(), mpath->exp_time + RTW_MESH_PATH_EXPIRE)) + rtw_time_after(jiffies, mpath->exp_time + RTW_MESH_PATH_EXPIRE)) __rtw_mesh_path_del(tbl, mpath); if (mpath->is_gate && /* need not to deal with non-gate case */ - rtw_time_after(rtw_get_current_time(), mpath->gate_timeout)) { + rtw_time_after(jiffies, mpath->gate_timeout)) { RTW_MPATH_DBG(FUNC_ADPT_FMT"mpath [%pM] expired systime is %lu systime is %lu\n", FUNC_ADPT_ARG(adapter), mpath->dst, - mpath->gate_timeout, rtw_get_current_time()); + mpath->gate_timeout, jiffies); enter_critical_bh(&mpath->state_lock); if (mpath->gate_asked) { /* asked gate before */ rtw_mesh_gate_del(tbl, mpath); exit_critical_bh(&mpath->state_lock); } else { mpath->gate_asked = true; - mpath->gate_timeout = rtw_get_current_time() + rtw_ms_to_systime(mpath->gate_ann_int); + mpath->gate_timeout = jiffies + msecs_to_jiffies(mpath->gate_ann_int); exit_critical_bh(&mpath->state_lock); rtw_mesh_queue_preq(mpath, RTW_PREQ_Q_F_START | RTW_PREQ_Q_F_REFRESH); RTW_MPATH_DBG(FUNC_ADPT_FMT"mpath [%pM] ask mesh gate existence (is_root=%d)\n", diff --git a/core/rtw_ap.c b/core/rtw_ap.c index 93bdb94..2da3dbe 100644 --- a/core/rtw_ap.c +++ b/core/rtw_ap.c @@ -102,7 +102,7 @@ static void update_BCNTIM(_adapter *padapter) u8 *p, *dst_ie, *premainder_ie = NULL, *pbackup_remainder_ie = NULL; uint offset, tmp_len, tim_ielen, tim_ie_offset, remainder_ielen; - p = rtw_get_ie(pie + _FIXED_IE_LENGTH_, _TIM_IE_, &tim_ielen, pnetwork_mlmeext->IELength - _FIXED_IE_LENGTH_); + p = rtw_get_ie(pie + _FIXED_IE_LENGTH_, WLAN_EID_DS_PARAMS, &tim_ielen, pnetwork_mlmeext->IELength - _FIXED_IE_LENGTH_); if (p != NULL && tim_ielen > 0) { tim_ielen += 2; @@ -121,12 +121,12 @@ static void update_BCNTIM(_adapter *padapter) offset = _FIXED_IE_LENGTH_; /* get ssid_ie len */ - p = rtw_get_ie(pie + _BEACON_IE_OFFSET_, _SSID_IE_, &tmp_len, (pnetwork_mlmeext->IELength - _BEACON_IE_OFFSET_)); + p = rtw_get_ie(pie + _BEACON_IE_OFFSET_, WLAN_EID_SSID, &tmp_len, (pnetwork_mlmeext->IELength - _BEACON_IE_OFFSET_)); if (p != NULL) offset += tmp_len + 2; /*get supported rates len*/ - p = rtw_get_ie(pie + _BEACON_IE_OFFSET_, _SUPPORTEDRATES_IE_, &tmp_len, (pnetwork_mlmeext->IELength - _BEACON_IE_OFFSET_)); + p = rtw_get_ie(pie + _BEACON_IE_OFFSET_, WLAN_EID_SUPP_RATES, &tmp_len, (pnetwork_mlmeext->IELength - _BEACON_IE_OFFSET_)); if (p != NULL) offset += tmp_len + 2; @@ -425,12 +425,12 @@ void expire_timeout_chk(_adapter *padapter) /* check auth_queue */ #ifdef DBG_EXPIRATION_CHK - if (rtw_end_of_queue_search(phead, plist) == _FALSE) { + if (phead != plist) { RTW_INFO(FUNC_ADPT_FMT" auth_list, cnt:%u\n" , FUNC_ADPT_ARG(padapter), pstapriv->auth_list_cnt); } #endif - while ((rtw_end_of_queue_search(phead, plist)) == _FALSE) { + while (phead != plist) { psta = LIST_CONTAINOR(plist, struct sta_info, auth_list); plist = get_next(plist); @@ -474,12 +474,12 @@ void expire_timeout_chk(_adapter *padapter) /* check asoc_queue */ #ifdef DBG_EXPIRATION_CHK - if (rtw_end_of_queue_search(phead, plist) == _FALSE) { + if (phead != plist) { RTW_INFO(FUNC_ADPT_FMT" asoc_list, cnt:%u\n" , FUNC_ADPT_ARG(padapter), pstapriv->asoc_list_cnt); } #endif - while ((rtw_end_of_queue_search(phead, plist)) == _FALSE) { + while (phead != plist) { psta = LIST_CONTAINOR(plist, struct sta_info, asoc_list); plist = get_next(plist); #ifdef CONFIG_ATMEL_RC_PATCH @@ -600,7 +600,7 @@ void expire_timeout_chk(_adapter *padapter) /* to update bcn with tim_bitmap for this station */ rtw_tim_map_set(padapter, pstapriv->tim_bitmap, psta->cmn.aid); - update_beacon(padapter, _TIM_IE_, NULL, _TRUE); + update_beacon(padapter, WLAN_EID_DS_PARAMS, NULL, _TRUE); if (!pmlmeext->active_keep_alive_check) continue; @@ -807,7 +807,7 @@ u8 rtw_ap_find_mini_tx_rate(_adapter *adapter) _enter_critical_bh(&pstapriv->asoc_list_lock, &irqL); phead = &pstapriv->asoc_list; plist = get_next(phead); - while ((rtw_end_of_queue_search(phead, plist)) == _FALSE) { + while (phead != plist) { psta = LIST_CONTAINOR(plist, struct sta_info, asoc_list); plist = get_next(plist); @@ -1452,7 +1452,7 @@ static void rtw_ap_check_scan(_adapter *padapter) _enter_critical_bh(&(pmlmepriv->scanned_queue.lock), &irqL); phead = get_list_head(queue); - if (rtw_end_of_queue_search(phead, get_next(phead)) == _TRUE) + if (phead == get_next(phead)) if (padapter->registrypriv.wifi_spec) { do_scan = _TRUE; reason |= RTW_AUTO_SCAN_REASON_2040_BSS; @@ -1485,7 +1485,7 @@ static void rtw_ap_check_scan(_adapter *padapter) while (1) { - if (rtw_end_of_queue_search(phead, plist) == _TRUE) + if (phead == plist) break; pnetwork = LIST_CONTAINOR(plist, struct wlan_network, list); @@ -1505,7 +1505,7 @@ static void rtw_ap_check_scan(_adapter *padapter) ie = pbss->IEs; /*check if HT CAP INFO IE exists or not*/ - pbuf = rtw_get_ie(ie + _BEACON_IE_OFFSET_, _HT_CAPABILITY_IE_, &ie_len, (pbss->IELength - _BEACON_IE_OFFSET_)); + pbuf = rtw_get_ie(ie + _BEACON_IE_OFFSET_, WLAN_EID_HT_CAPABILITY, &ie_len, (pbss->IELength - _BEACON_IE_OFFSET_)); if (pbuf == NULL) { /* HT CAP INFO IE don't exist, it is b/g mode bss.*/ @@ -1813,12 +1813,12 @@ update_beacon: if ((atomic_read(&mlme->olbc) == _TRUE) || (atomic_read(&mlme->olbc_ht) == _TRUE)) { /* AP is not starting a 40 MHz BSS in presence of an 802.11g BSS. */ mlme->ht_op_mode &= (~HT_INFO_OPERATION_MODE_OP_MODE_MASK); - mlme->ht_op_mode |= OP_MODE_MAY_BE_LEGACY_STAS; - update_beacon(pdvobj->padapters[i], _HT_ADD_INFO_IE_, NULL, _FALSE); + mlme->ht_op_mode |= IEEE80211_HT_OP_MODE_PROTECTION_NONMEMBER; + update_beacon(pdvobj->padapters[i], WLAN_EID_HT_OPERATION, NULL, _FALSE); } #endif - update_beacon(pdvobj->padapters[i], _TIM_IE_, NULL, _FALSE); + update_beacon(pdvobj->padapters[i], WLAN_EID_DS_PARAMS, NULL, _FALSE); } if (mlme_act != MLME_OPCH_SWITCH @@ -1897,9 +1897,8 @@ int rtw_check_beacon_data(_adapter *padapter, u8 *pbuf, int len) u8 mfp_opt = MFP_NO; u8 channel, network_type, supportRate[NDIS_802_11_LENGTH_RATES_EX]; int supportRateNum = 0; - u8 OUI1[] = {0x00, 0x50, 0xf2, 0x01}; u8 WMM_PARA_IE[] = {0x00, 0x50, 0xf2, 0x02, 0x01, 0x01}; - HT_CAP_AMPDU_DENSITY best_ampdu_density; + enum ieee80211_min_mpdu_spacing best_ampdu_density; struct registry_priv *pregistrypriv = &padapter->registrypriv; struct security_priv *psecuritypriv = &padapter->securitypriv; struct mlme_priv *pmlmepriv = &(padapter->mlmepriv); @@ -1964,7 +1963,7 @@ int rtw_check_beacon_data(_adapter *padapter, u8 *pbuf, int len) cap = RTW_GET_LE16(ie); /* SSID */ - p = rtw_get_ie(ie + _BEACON_IE_OFFSET_, _SSID_IE_, &ie_len, (pbss_network->IELength - _BEACON_IE_OFFSET_)); + p = rtw_get_ie(ie + _BEACON_IE_OFFSET_, WLAN_EID_SSID, &ie_len, (pbss_network->IELength - _BEACON_IE_OFFSET_)); if (p && ie_len > 0) { memset(&pbss_network->Ssid, 0, sizeof(NDIS_802_11_SSID)); memcpy(pbss_network->Ssid.Ssid, (p + 2), ie_len); @@ -1990,7 +1989,7 @@ int rtw_check_beacon_data(_adapter *padapter, u8 *pbuf, int len) /* chnnel */ channel = 0; pbss_network->Configuration.Length = 0; - p = rtw_get_ie(ie + _BEACON_IE_OFFSET_, _DSSET_IE_, &ie_len, (pbss_network->IELength - _BEACON_IE_OFFSET_)); + p = rtw_get_ie(ie + _BEACON_IE_OFFSET_, WLAN_EID_DS_PARAMS, &ie_len, (pbss_network->IELength - _BEACON_IE_OFFSET_)); if (p && ie_len > 0) channel = *(p + 2); @@ -1999,10 +1998,10 @@ int rtw_check_beacon_data(_adapter *padapter, u8 *pbuf, int len) memset(supportRate, 0, NDIS_802_11_LENGTH_RATES_EX); /* get supported rates */ - p = rtw_get_ie(ie + _BEACON_IE_OFFSET_, _SUPPORTEDRATES_IE_, &ie_len, (pbss_network->IELength - _BEACON_IE_OFFSET_)); + p = rtw_get_ie(ie + _BEACON_IE_OFFSET_, WLAN_EID_SUPP_RATES, &ie_len, (pbss_network->IELength - _BEACON_IE_OFFSET_)); if (p != NULL) { if (padapter->registrypriv.wireless_mode == WIRELESS_11B) { - ret_rm = rtw_remove_ie_g_rate(ie , &len, _BEACON_IE_OFFSET_, _SUPPORTEDRATES_IE_); + ret_rm = rtw_remove_ie_g_rate(ie , &len, _BEACON_IE_OFFSET_, WLAN_EID_SUPP_RATES); RTW_DBG("%s, rtw_remove_ie_g_rate=%d\n", __FUNCTION__,ret_rm); ie_len = ie_len - ret_rm; pbss_network->IELength=pbss_network->IELength - ret_rm; @@ -2013,12 +2012,12 @@ int rtw_check_beacon_data(_adapter *padapter, u8 *pbuf, int len) } /* get ext_supported rates */ - p = rtw_get_ie(ie + _BEACON_IE_OFFSET_, _EXT_SUPPORTEDRATES_IE_, &ie_len, pbss_network->IELength - _BEACON_IE_OFFSET_); + p = rtw_get_ie(ie + _BEACON_IE_OFFSET_, WLAN_EID_EXT_SUPP_RATES, &ie_len, pbss_network->IELength - _BEACON_IE_OFFSET_); if (p != NULL) { if (padapter->registrypriv.wireless_mode == WIRELESS_11B) { pbss_network->IELength = pbss_network->IELength-*(p+1) -2; ret_rm = rtw_ies_remove_ie(ie , &len,_BEACON_IE_OFFSET_, - _EXT_SUPPORTEDRATES_IE_,NULL,0); + WLAN_EID_EXT_SUPP_RATES,NULL,0); RTW_DBG("%s, remove_ie of ext_supported rates =%d\n", __FUNCTION__, ret_rm); } else { memcpy(supportRate + supportRateNum, p + 2, ie_len); @@ -2033,12 +2032,12 @@ int rtw_check_beacon_data(_adapter *padapter, u8 *pbuf, int len) /* parsing ERP_IE */ - p = rtw_get_ie(ie + _BEACON_IE_OFFSET_, _ERPINFO_IE_, &ie_len, (pbss_network->IELength - _BEACON_IE_OFFSET_)); + p = rtw_get_ie(ie + _BEACON_IE_OFFSET_, WLAN_EID_ERP_INFO, &ie_len, (pbss_network->IELength - _BEACON_IE_OFFSET_)); if (p && ie_len > 0) { if(padapter->registrypriv.wireless_mode == WIRELESS_11B ) { pbss_network->IELength = pbss_network->IELength - *(p+1) - 2; - ret_rm = rtw_ies_remove_ie(ie , &len, _BEACON_IE_OFFSET_, _ERPINFO_IE_,NULL,0); + ret_rm = rtw_ies_remove_ie(ie , &len, _BEACON_IE_OFFSET_, WLAN_EID_ERP_INFO,NULL,0); RTW_DBG("%s, remove_ie of ERP_IE=%d\n", __FUNCTION__, ret_rm); } else ERP_IE_handler(padapter, (PNDIS_802_11_VARIABLE_IEs)p); @@ -2059,7 +2058,7 @@ int rtw_check_beacon_data(_adapter *padapter, u8 *pbuf, int len) pairwise_cipher = 0; psecuritypriv->wpa2_group_cipher = _NO_PRIVACY_; psecuritypriv->wpa2_pairwise_cipher = _NO_PRIVACY_; - p = rtw_get_ie(ie + _BEACON_IE_OFFSET_, _RSN_IE_2_, &ie_len, (pbss_network->IELength - _BEACON_IE_OFFSET_)); + p = rtw_get_ie(ie + _BEACON_IE_OFFSET_, WLAN_EID_RSN, &ie_len, (pbss_network->IELength - _BEACON_IE_OFFSET_)); if (p && ie_len > 0) { if (rtw_parse_wpa2_ie(p, ie_len + 2, &group_cipher, &pairwise_cipher, &akm, &mfp_opt) == _SUCCESS) { psecuritypriv->dot11AuthAlgrthm = dot11AuthAlgrthm_8021X; @@ -2132,8 +2131,8 @@ int rtw_check_beacon_data(_adapter *padapter, u8 *pbuf, int len) psecuritypriv->wpa_group_cipher = _NO_PRIVACY_; psecuritypriv->wpa_pairwise_cipher = _NO_PRIVACY_; for (p = ie + _BEACON_IE_OFFSET_; ; p += (ie_len + 2)) { - p = rtw_get_ie(p, _SSN_IE_1_, &ie_len, (pbss_network->IELength - _BEACON_IE_OFFSET_ - (ie_len + 2))); - if ((p) && (_rtw_memcmp(p + 2, OUI1, 4))) { + p = rtw_get_ie(p, WLAN_EID_VENDOR_SPECIFIC, &ie_len, (pbss_network->IELength - _BEACON_IE_OFFSET_ - (ie_len + 2))); + if ((p) && (_rtw_memcmp(p + 2, RTW_WPA_OUI, 4))) { if (rtw_parse_wpa_ie(p, ie_len + 2, &group_cipher, &pairwise_cipher, NULL) == _SUCCESS) { psecuritypriv->dot11AuthAlgrthm = dot11AuthAlgrthm_8021X; psecuritypriv->ndisauthtype = Ndis802_11AuthModeWPAPSK; @@ -2214,7 +2213,7 @@ int rtw_check_beacon_data(_adapter *padapter, u8 *pbuf, int len) #endif if (pregistrypriv->wmm_enable) { for (p = ie + _BEACON_IE_OFFSET_; ; p += (ie_len + 2)) { - p = rtw_get_ie(p, _VENDOR_SPECIFIC_IE_, &ie_len, (pbss_network->IELength - _BEACON_IE_OFFSET_ - (ie_len + 2))); + p = rtw_get_ie(p, WLAN_EID_VENDOR_SPECIFIC, &ie_len, (pbss_network->IELength - _BEACON_IE_OFFSET_ - (ie_len + 2))); if ((p) && _rtw_memcmp(p + 2, WMM_PARA_IE, 6)) { pmlmepriv->qospriv.qos_option = 1; @@ -2239,11 +2238,11 @@ int rtw_check_beacon_data(_adapter *padapter, u8 *pbuf, int len) if(padapter->registrypriv.ht_enable && is_supported_ht(padapter->registrypriv.wireless_mode)) { /* parsing HT_CAP_IE */ - p = rtw_get_ie(ie + _BEACON_IE_OFFSET_, _HT_CAPABILITY_IE_, &ie_len, (pbss_network->IELength - _BEACON_IE_OFFSET_)); + p = rtw_get_ie(ie + _BEACON_IE_OFFSET_, WLAN_EID_HT_CAPABILITY, &ie_len, (pbss_network->IELength - _BEACON_IE_OFFSET_)); if (p && ie_len > 0) { u8 rf_type = 0; - HT_CAP_AMPDU_FACTOR max_rx_ampdu_factor = MAX_AMPDU_FACTOR_64K; - struct rtw_ieee80211_ht_cap *pht_cap = (struct rtw_ieee80211_ht_cap *)(p + 2); + enum ieee80211_max_ampdu_length_exp max_rx_ampdu_factor = IEEE80211_HT_MAX_AMPDU_64K; + struct ieee80211_ht_cap *pht_cap = (struct ieee80211_ht_cap *)(p + 2); if (0) { RTW_INFO(FUNC_ADPT_FMT" HT_CAP_IE from upper layer:\n", FUNC_ADPT_ARG(padapter)); @@ -2355,7 +2354,7 @@ int rtw_check_beacon_data(_adapter *padapter, u8 *pbuf, int len) } /* parsing HT_INFO_IE */ - p = rtw_get_ie(ie + _BEACON_IE_OFFSET_, _HT_ADD_INFO_IE_, &ie_len, (pbss_network->IELength - _BEACON_IE_OFFSET_)); + p = rtw_get_ie(ie + _BEACON_IE_OFFSET_, WLAN_EID_HT_OPERATION, &ie_len, (pbss_network->IELength - _BEACON_IE_OFFSET_)); if (p && ie_len > 0) { pHT_info_ie = p; if (channel == 0) @@ -2547,7 +2546,7 @@ static void _rtw_macaddr_acl_deinit(_adapter *adapter, u8 period, bool clear_onl _enter_critical_bh(&(acl_node_q->lock), &irqL); head = get_list_head(acl_node_q); list = get_next(head); - while (rtw_end_of_queue_search(head, list) == _FALSE) { + while (head != list) { acl_node = LIST_CONTAINOR(list, struct rtw_wlan_acl_node, list); list = get_next(list); @@ -2617,7 +2616,7 @@ int rtw_acl_add_sta(_adapter *adapter, u8 period, const u8 *addr) list = get_next(head); /* search for existed entry */ - while (rtw_end_of_queue_search(head, list) == _FALSE) { + while (head != list) { acl_node = LIST_CONTAINOR(list, struct rtw_wlan_acl_node, list); list = get_next(list); @@ -2689,7 +2688,7 @@ int rtw_acl_remove_sta(_adapter *adapter, u8 period, const u8 *addr) head = get_list_head(acl_node_q); list = get_next(head); - while (rtw_end_of_queue_search(head, list) == _FALSE) { + while (head != list) { acl_node = LIST_CONTAINOR(list, struct rtw_wlan_acl_node, list); list = get_next(list); @@ -2877,14 +2876,14 @@ u8 rtw_ap_bmc_frames_hdl(_adapter *padapter) if ((rtw_tim_map_is_set(padapter, pstapriv->tim_bitmap, 0)) && (psta_bmc->sleepq_len > 0)) { int tx_counts = 0; - _update_beacon(padapter, _TIM_IE_, NULL, _FALSE, "update TIM with TIB=1"); + _update_beacon(padapter, WLAN_EID_DS_PARAMS, NULL, _FALSE, "update TIM with TIB=1"); RTW_INFO("sleepq_len of bmc_sta = %d\n", psta_bmc->sleepq_len); xmitframe_phead = get_list_head(&psta_bmc->sleep_q); xmitframe_plist = get_next(xmitframe_phead); - while ((rtw_end_of_queue_search(xmitframe_phead, xmitframe_plist)) == _FALSE) { + while (xmitframe_phead != xmitframe_plist) { pxmitframe = LIST_CONTAINOR(xmitframe_plist, struct xmit_frame, list); xmitframe_plist = get_next(xmitframe_plist); @@ -2927,7 +2926,7 @@ u8 rtw_ap_bmc_frames_hdl(_adapter *padapter) if (update_tim == _TRUE) { RTW_INFO("clear TIB\n"); - _update_beacon(padapter, _TIM_IE_, NULL, _TRUE, "bmc sleepq and HIQ empty"); + _update_beacon(padapter, WLAN_EID_DS_PARAMS, NULL, _TRUE, "bmc sleepq and HIQ empty"); } } } @@ -3007,13 +3006,13 @@ static void update_bcn_ext_capab_ie(_adapter *padapter) u8 *ie = pnetwork->IEs; u8 null_extcap_data[8] = {0}; - pbuf = rtw_get_ie(ie + _BEACON_IE_OFFSET_, _EXT_CAP_IE_, &ie_len, (pnetwork->IELength - _BEACON_IE_OFFSET_)); + pbuf = rtw_get_ie(ie + _BEACON_IE_OFFSET_, WLAN_EID_EXT_CAPABILITY , &ie_len, (pnetwork->IELength - _BEACON_IE_OFFSET_)); if (pbuf && ie_len > 0) - rtw_remove_bcn_ie(padapter, pnetwork, _EXT_CAP_IE_); + rtw_remove_bcn_ie(padapter, pnetwork, WLAN_EID_EXT_CAPABILITY ); if ((pmlmepriv->ext_capab_ie_len > 0) && (_rtw_memcmp(pmlmepriv->ext_capab_ie_data, null_extcap_data, sizeof(null_extcap_data)) == _FALSE)) - rtw_add_bcn_ie(padapter, pnetwork, _EXT_CAP_IE_, pmlmepriv->ext_capab_ie_data, pmlmepriv->ext_capab_ie_len); + rtw_add_bcn_ie(padapter, pnetwork, WLAN_EID_EXT_CAPABILITY , pmlmepriv->ext_capab_ie_data, pmlmepriv->ext_capab_ie_len); } @@ -3032,7 +3031,7 @@ static void update_bcn_erpinfo_ie(_adapter *padapter) return; /* parsing ERP_IE */ - p = rtw_get_ie(ie + _BEACON_IE_OFFSET_, _ERPINFO_IE_, &len, (pnetwork->IELength - _BEACON_IE_OFFSET_)); + p = rtw_get_ie(ie + _BEACON_IE_OFFSET_, WLAN_EID_ERP_INFO, &len, (pnetwork->IELength - _BEACON_IE_OFFSET_)); if (p && len > 0) { PNDIS_802_11_VARIABLE_IEs pIE = (PNDIS_802_11_VARIABLE_IEs)p; @@ -3085,7 +3084,7 @@ static void update_bcn_htinfo_ie(_adapter *padapter) pmlmepriv->num_sta_40mhz_intolerant, pmlmepriv->ht_20mhz_width_req, pmlmepriv->ht_intolerant_ch_reported, atomic_read(&pmlmepriv->olbc)); /*parsing HT_INFO_IE, currently only update ht_op_mode - pht_info->infos[1] & pht_info->infos[2] for wifi logo test*/ - p = rtw_get_ie(ie + _BEACON_IE_OFFSET_, _HT_ADD_INFO_IE_, &len, (pnetwork->IELength - _BEACON_IE_OFFSET_)); + p = rtw_get_ie(ie + _BEACON_IE_OFFSET_, WLAN_EID_HT_OPERATION, &len, (pnetwork->IELength - _BEACON_IE_OFFSET_)); if (p && len > 0) { struct HT_info_element *pht_info = NULL; @@ -3119,7 +3118,7 @@ static void update_bcn_htinfo_ie(_adapter *padapter) SET_HT_OP_ELE_2ND_CHL_OFFSET(pht_info, (pmlmeext->cur_ch_offset == HAL_PRIME_CHNL_OFFSET_LOWER) ? - HT_INFO_HT_PARAM_SECONDARY_CHNL_ABOVE : HT_INFO_HT_PARAM_SECONDARY_CHNL_BELOW); + IEEE80211_HT_PARAM_CHA_SEC_ABOVE : IEEE80211_HT_PARAM_CHA_SEC_BELOW); pmlmepriv->sw_to_20mhz = 0; /* @@ -3263,27 +3262,27 @@ void _update_beacon(_adapter *padapter, u8 ie_id, u8 *oui, u8 tx, const char *ta _enter_critical_bh(&pmlmepriv->bcn_update_lock, &irqL); switch (ie_id) { - case _TIM_IE_: + case WLAN_EID_DS_PARAMS: update_BCNTIM(padapter); break; - case _ERPINFO_IE_: + case WLAN_EID_ERP_INFO: update_bcn_erpinfo_ie(padapter); break; - case _HT_CAPABILITY_IE_: + case WLAN_EID_HT_CAPABILITY: update_bcn_htcap_ie(padapter); break; - case _RSN_IE_2_: + case WLAN_EID_RSN: update_bcn_rsn_ie(padapter); break; - case _HT_ADD_INFO_IE_: + case WLAN_EID_HT_OPERATION: update_bcn_htinfo_ie(padapter); break; - case _EXT_CAP_IE_: + case WLAN_EID_EXT_CAPABILITY : update_bcn_ext_capab_ie(padapter); break; @@ -3295,7 +3294,7 @@ void _update_beacon(_adapter *padapter, u8 ie_id, u8 *oui, u8 tx, const char *ta break; #endif - case _VENDOR_SPECIFIC_IE_: + case WLAN_EID_VENDOR_SPECIFIC: update_bcn_vendor_spec_ie(padapter, oui); break; @@ -3378,7 +3377,7 @@ void rtw_process_public_act_bsscoex(_adapter *padapter, u8 *pframe, uint frame_l if (beacon_updated) { - update_beacon(padapter, _HT_ADD_INFO_IE_, NULL, _TRUE); + update_beacon(padapter, WLAN_EID_HT_OPERATION, NULL, _TRUE); associated_stainfo_update(padapter, psta, STA_INFO_UPDATE_BW); } @@ -3444,28 +3443,28 @@ int rtw_ht_operation_update(_adapter *padapter) RTW_INFO("%s current operation mode=0x%X\n", __FUNCTION__, pmlmepriv->ht_op_mode); - if (!(pmlmepriv->ht_op_mode & HT_INFO_OPERATION_MODE_NON_GF_DEVS_PRESENT) + if (!(pmlmepriv->ht_op_mode & IEEE80211_HT_OP_MODE_NON_GF_STA_PRSNT) && pmlmepriv->num_sta_ht_no_gf) { pmlmepriv->ht_op_mode |= - HT_INFO_OPERATION_MODE_NON_GF_DEVS_PRESENT; + IEEE80211_HT_OP_MODE_NON_GF_STA_PRSNT; op_mode_changes++; } else if ((pmlmepriv->ht_op_mode & - HT_INFO_OPERATION_MODE_NON_GF_DEVS_PRESENT) && + IEEE80211_HT_OP_MODE_NON_GF_STA_PRSNT) && pmlmepriv->num_sta_ht_no_gf == 0) { pmlmepriv->ht_op_mode &= - ~HT_INFO_OPERATION_MODE_NON_GF_DEVS_PRESENT; + ~IEEE80211_HT_OP_MODE_NON_GF_STA_PRSNT; op_mode_changes++; } - if (!(pmlmepriv->ht_op_mode & HT_INFO_OPERATION_MODE_NON_HT_STA_PRESENT) && + if (!(pmlmepriv->ht_op_mode & IEEE80211_HT_OP_MODE_NON_HT_STA_PRSNT) && (pmlmepriv->num_sta_no_ht || atomic_read(&pmlmepriv->olbc_ht))) { - pmlmepriv->ht_op_mode |= HT_INFO_OPERATION_MODE_NON_HT_STA_PRESENT; + pmlmepriv->ht_op_mode |= IEEE80211_HT_OP_MODE_NON_HT_STA_PRSNT; op_mode_changes++; } else if ((pmlmepriv->ht_op_mode & - HT_INFO_OPERATION_MODE_NON_HT_STA_PRESENT) && + IEEE80211_HT_OP_MODE_NON_HT_STA_PRSNT) && (pmlmepriv->num_sta_no_ht == 0 && !atomic_read(&pmlmepriv->olbc_ht))) { pmlmepriv->ht_op_mode &= - ~HT_INFO_OPERATION_MODE_NON_HT_STA_PRESENT; + ~IEEE80211_HT_OP_MODE_NON_HT_STA_PRSNT; op_mode_changes++; } @@ -3475,15 +3474,15 @@ int rtw_ht_operation_update(_adapter *padapter) */ new_op_mode = 0; if (pmlmepriv->num_sta_no_ht /*|| - (pmlmepriv->ht_op_mode & HT_INFO_OPERATION_MODE_NON_GF_DEVS_PRESENT)*/) - new_op_mode = OP_MODE_MIXED; + (pmlmepriv->ht_op_mode & IEEE80211_HT_OP_MODE_NON_GF_STA_PRSNT)*/) + new_op_mode = IEEE80211_HT_OP_MODE_PROTECTION_NONHT_MIXED; else if ((phtpriv_ap->ht_cap.cap_info & IEEE80211_HT_CAP_SUP_WIDTH_20_40) && pmlmepriv->num_sta_ht_20mhz) - new_op_mode = OP_MODE_20MHZ_HT_STA_ASSOCED; + new_op_mode = IEEE80211_HT_OP_MODE_PROTECTION_20MHZ; else if (atomic_read(&pmlmepriv->olbc_ht)) - new_op_mode = OP_MODE_MAY_BE_LEGACY_STAS; + new_op_mode = IEEE80211_HT_OP_MODE_PROTECTION_NONMEMBER; else - new_op_mode = OP_MODE_PURE; + new_op_mode = IEEE80211_HT_OP_MODE_PROTECTION_NONE; cur_op_mode = pmlmepriv->ht_op_mode & HT_INFO_OPERATION_MODE_OP_MODE_MASK; if (cur_op_mode != new_op_mode) { @@ -3516,7 +3515,7 @@ void associated_clients_update(_adapter *padapter, u8 updated, u32 sta_info_type plist = get_next(phead); /* check asoc_queue */ - while ((rtw_end_of_queue_search(phead, plist)) == _FALSE) { + while (phead != plist) { psta = LIST_CONTAINOR(plist, struct sta_info, asoc_list); plist = get_next(plist); @@ -3589,7 +3588,7 @@ void bss_cap_update_on_sta_join(_adapter *padapter, struct sta_info *psta) if (pmlmepriv->num_sta_non_erp == 1) { beacon_updated = _TRUE; - update_beacon(padapter, _ERPINFO_IE_, NULL, _FALSE); + update_beacon(padapter, WLAN_EID_ERP_INFO, NULL, _FALSE); } } @@ -3601,7 +3600,7 @@ void bss_cap_update_on_sta_join(_adapter *padapter, struct sta_info *psta) if (pmlmepriv->num_sta_non_erp == 0) { beacon_updated = _TRUE; - update_beacon(padapter, _ERPINFO_IE_, NULL, _FALSE); + update_beacon(padapter, WLAN_EID_ERP_INFO, NULL, _FALSE); } } @@ -3699,8 +3698,8 @@ void bss_cap_update_on_sta_join(_adapter *padapter, struct sta_info *psta) } if (rtw_ht_operation_update(padapter) > 0) { - update_beacon(padapter, _HT_CAPABILITY_IE_, NULL, _FALSE); - update_beacon(padapter, _HT_ADD_INFO_IE_, NULL, _FALSE); + update_beacon(padapter, WLAN_EID_HT_CAPABILITY, NULL, _FALSE); + update_beacon(padapter, WLAN_EID_HT_OPERATION, NULL, _FALSE); beacon_updated = _TRUE; } } @@ -3740,7 +3739,7 @@ u8 bss_cap_update_on_sta_leave(_adapter *padapter, struct sta_info *psta) if (rtw_tim_map_is_set(padapter, pstapriv->tim_bitmap, psta->cmn.aid)) { rtw_tim_map_clear(padapter, pstapriv->tim_bitmap, psta->cmn.aid); beacon_updated = _TRUE; - update_beacon(padapter, _TIM_IE_, NULL, _FALSE); + update_beacon(padapter, WLAN_EID_DS_PARAMS, NULL, _FALSE); } if (psta->no_short_preamble_set) { @@ -3756,7 +3755,7 @@ u8 bss_cap_update_on_sta_leave(_adapter *padapter, struct sta_info *psta) pmlmepriv->num_sta_non_erp--; if (pmlmepriv->num_sta_non_erp == 0) { beacon_updated = _TRUE; - update_beacon(padapter, _ERPINFO_IE_, NULL, _FALSE); + update_beacon(padapter, WLAN_EID_ERP_INFO, NULL, _FALSE); } } @@ -3793,8 +3792,8 @@ u8 bss_cap_update_on_sta_leave(_adapter *padapter, struct sta_info *psta) } if (rtw_ht_operation_update(padapter) > 0) { - update_beacon(padapter, _HT_CAPABILITY_IE_, NULL, _FALSE); - update_beacon(padapter, _HT_ADD_INFO_IE_, NULL, _FALSE); + update_beacon(padapter, WLAN_EID_HT_CAPABILITY, NULL, _FALSE); + update_beacon(padapter, WLAN_EID_HT_OPERATION, NULL, _FALSE); } #endif /* CONFIG_80211N_HT */ @@ -3915,7 +3914,7 @@ int rtw_ap_inform_ch_switch(_adapter *padapter, u8 new_ch, u8 ch_offset) plist = get_next(phead); /* for each sta in asoc_queue */ - while ((rtw_end_of_queue_search(phead, plist)) == _FALSE) { + while (phead != plist) { psta = LIST_CONTAINOR(plist, struct sta_info, asoc_list); plist = get_next(plist); @@ -3950,7 +3949,7 @@ int rtw_sta_flush(_adapter *padapter, bool enqueue) _enter_critical_bh(&pstapriv->asoc_list_lock, &irqL); phead = &pstapriv->asoc_list; plist = get_next(phead); - while ((rtw_end_of_queue_search(phead, plist)) == _FALSE) { + while (phead != plist) { int stainfo_offset; psta = LIST_CONTAINOR(plist, struct sta_info, asoc_list); @@ -4074,7 +4073,7 @@ void rtw_ap_restore_network(_adapter *padapter) phead = &pstapriv->asoc_list; plist = get_next(phead); - while ((rtw_end_of_queue_search(phead, plist)) == _FALSE) { + while (phead != plist) { int stainfo_offset; psta = LIST_CONTAINOR(plist, struct sta_info, asoc_list); @@ -4312,7 +4311,7 @@ void rtw_ap_update_bss_chbw(_adapter *adapter, WLAN_BSSID_EX *bss, u8 ch, u8 bw, change_band = _TRUE; /* update channel in IE */ - p = rtw_get_ie((bss->IEs + sizeof(NDIS_802_11_FIXED_IEs)), _DSSET_IE_, &ie_len, (bss->IELength - sizeof(NDIS_802_11_FIXED_IEs))); + p = rtw_get_ie((bss->IEs + sizeof(NDIS_802_11_FIXED_IEs)), WLAN_EID_DS_PARAMS, &ie_len, (bss->IELength - sizeof(NDIS_802_11_FIXED_IEs))); if (p && ie_len > 0) *(p + 2) = ch; @@ -4953,7 +4952,7 @@ u8 rtw_ap_sta_states_check(_adapter *adapter) _enter_critical_bh(&pstapriv->asoc_list_lock, &irqL); phead = &pstapriv->asoc_list; plist = get_next(phead); - while ((rtw_end_of_queue_search(phead, plist)) == _FALSE) { + while (phead != plist) { psta = LIST_CONTAINOR(plist, struct sta_info, asoc_list); plist = get_next(plist); @@ -5040,7 +5039,7 @@ void tx_beacon_handlder(struct dvobj_priv *pdvobj) padapter = NULL; phead = get_list_head(&pdvobj->ap_if_q); plist = get_next(phead); - while ((rtw_end_of_queue_search(phead, plist)) == _FALSE) { + while (phead != plist) { padapter = LIST_CONTAINOR(plist, struct _ADAPTER, list); plist = get_next(plist); @@ -5103,7 +5102,7 @@ void tx_beacon_handlder(struct dvobj_priv *pdvobj) if (!check_fwstate(&padapter->mlmepriv, WIFI_OP_CH_SWITCHING) && !IS_CH_WAITING(adapter_to_rfctl(padapter)) ) { - /*update_beacon(padapter, _TIM_IE_, NULL, _FALSE);*/ + /*update_beacon(padapter, WLAN_EID_DS_PARAMS, NULL, _FALSE);*/ /*issue_beacon(padapter, 0);*/ send_beacon(padapter); } @@ -5145,13 +5144,13 @@ u16 rtw_ap_parse_sta_supported_rates(_adapter *adapter, struct sta_info *sta, u8 u8 rate_set[12]; u8 rate_num; int i; - u16 status = _STATS_SUCCESSFUL_; + u16 status = WLAN_STATUS_SUCCESS; rtw_ies_get_supported_rate(tlv_ies, tlv_ies_len, rate_set, &rate_num); if (rate_num == 0) { RTW_INFO(FUNC_ADPT_FMT" sta "MAC_FMT" with no supported rate\n" , FUNC_ADPT_ARG(adapter), MAC_ARG(sta->cmn.mac_addr)); - status = _STATS_FAILURE_; + status = WLAN_STATUS_UNSPECIFIED_FAILURE; goto exit; } @@ -5184,7 +5183,7 @@ u16 rtw_ap_parse_sta_security_ie(_adapter *adapter, struct sta_info *sta, struct int group_cipher = 0, pairwise_cipher = 0; u32 akm = 0; u8 mfp_opt = MFP_NO; - u16 status = _STATS_SUCCESSFUL_; + u16 status = WLAN_STATUS_SUCCESS; sta->dot8021xalg = 0; sta->wpa_psk = 0; @@ -5269,7 +5268,7 @@ u16 rtw_ap_parse_sta_security_ie(_adapter *adapter, struct sta_info *sta, struct } #endif /* CONFIG_IOCTL_CFG80211 */ - if (status != _STATS_SUCCESSFUL_) + if (status != WLAN_STATUS_SUCCESS) goto exit; if (!MLME_IS_AP(adapter)) @@ -5307,7 +5306,7 @@ u16 rtw_ap_parse_sta_security_ie(_adapter *adapter, struct sta_info *sta, struct if (!selected_registrar) { RTW_INFO("selected_registrar is _FALSE , or AP is not ready to do WPS\n"); - status = _STATS_UNABLE_HANDLE_STA_; + status = WLAN_STATUS_AP_UNABLE_TO_HANDLE_NEW_STA; goto exit; } } @@ -5417,11 +5416,11 @@ void rtw_ap_parse_sta_ht_ie(_adapter *adapter, struct sta_info *sta, struct rtw_ goto exit; /* save HT capabilities in the sta object */ - memset(&sta->htpriv.ht_cap, 0, sizeof(struct rtw_ieee80211_ht_cap)); - if (elems->ht_capabilities && elems->ht_capabilities_len >= sizeof(struct rtw_ieee80211_ht_cap)) { + memset(&sta->htpriv.ht_cap, 0, sizeof(struct ieee80211_ht_cap)); + if (elems->ht_capabilities && elems->ht_capabilities_len >= sizeof(struct ieee80211_ht_cap)) { sta->flags |= WLAN_STA_HT; sta->flags |= WLAN_STA_WME; - memcpy(&sta->htpriv.ht_cap, elems->ht_capabilities, sizeof(struct rtw_ieee80211_ht_cap)); + memcpy(&sta->htpriv.ht_cap, elems->ht_capabilities, sizeof(struct ieee80211_ht_cap)); if (elems->ht_operation && elems->ht_operation_len == HT_OP_IE_LEN) { memcpy(sta->htpriv.ht_op, elems->ht_operation, HT_OP_IE_LEN); diff --git a/core/rtw_beamforming.c b/core/rtw_beamforming.c index bccef9f..d0898b7 100644 --- a/core/rtw_beamforming.c +++ b/core/rtw_beamforming.c @@ -205,7 +205,7 @@ static u8 _send_ht_ndpa_packet(PADAPTER adapter, u8 *ra, enum channel_width bw) /* update attribute */ attrib = &pmgntframe->attrib; update_mgntframe_attrib(adapter, attrib); - /*attrib->type = WIFI_MGT_TYPE;*/ /* set in update_mgntframe_attrib() */ + /*attrib->type = IEEE80211_FTYPE_MGMT;*/ /* set in update_mgntframe_attrib() */ attrib->subtype = WIFI_ACTION_NOACK; attrib->bwmode = bw; /*attrib->qsel = QSLT_MGNT;*/ /* set in update_mgntframe_attrib() */ @@ -301,7 +301,7 @@ static u8 _send_vht_ndpa_packet(PADAPTER adapter, u8 *ra, u16 aid, enum channel_ /* update attribute */ attrib = &pmgntframe->attrib; update_mgntframe_attrib(adapter, attrib); - /*pattrib->type = WIFI_MGT_TYPE;*/ /* set in update_mgntframe_attrib() */ + /*pattrib->type = IEEE80211_FTYPE_MGMT;*/ /* set in update_mgntframe_attrib() */ attrib->subtype = WIFI_NDPA; attrib->bwmode = bw; /*attrib->qsel = QSLT_MGNT;*/ /* set in update_mgntframe_attrib() */ @@ -414,7 +414,7 @@ static u8 _send_vht_mu_ndpa_packet(PADAPTER adapter, enum channel_width bw) /* update attribute */ attrib = &pmgntframe->attrib; update_mgntframe_attrib(adapter, attrib); - /*attrib->type = WIFI_MGT_TYPE;*/ /* set in update_mgntframe_attrib() */ + /*attrib->type = IEEE80211_FTYPE_MGMT;*/ /* set in update_mgntframe_attrib() */ attrib->subtype = WIFI_NDPA; attrib->bwmode = bw; /*attrib->qsel = QSLT_MGNT;*/ /* set in update_mgntframe_attrib() */ @@ -507,7 +507,7 @@ static u8 _send_bf_report_poll(PADAPTER adapter, u8 *ra, u8 bFinalPoll) /* update attribute */ attrib = &pmgntframe->attrib; update_mgntframe_attrib(adapter, attrib); - /*attrib->type = WIFI_MGT_TYPE;*/ /* set in update_mgntframe_attrib() */ + /*attrib->type = IEEE80211_FTYPE_MGMT;*/ /* set in update_mgntframe_attrib() */ attrib->subtype = WIFI_BF_REPORT_POLL; attrib->bwmode = CHANNEL_WIDTH_20; /*attrib->qsel = QSLT_MGNT;*/ /* set in update_mgntframe_attrib() */ @@ -1709,7 +1709,7 @@ u8 rtw_bf_send_vht_gid_mgnt_packet(PADAPTER adapter, u8 *ra, u8 *gid, u8 *positi update_mgntframe_attrib(adapter, attrib); attrib->rate = MGN_6M; attrib->bwmode = CHANNEL_WIDTH_20; - attrib->subtype = WIFI_ACTION; + attrib->subtype = IEEE80211_STYPE_ACTION; memset(pmgntframe->buf_addr, 0, WLANHDR_OFFSET + TXDESC_OFFSET); @@ -1952,7 +1952,7 @@ void rtw_bf_update_traffic(PADAPTER adapter) last_timestamp = bfee->tx_timestamp; last_bytes = bfee->tx_bytes; - bfee->tx_timestamp = rtw_get_current_time(); + bfee->tx_timestamp = jiffies; bfee->tx_bytes = sta->sta_stats.tx_bytes; if (last_timestamp) { if (bfee->tx_bytes >= last_bytes) diff --git a/core/rtw_chplan.c b/core/rtw_chplan.c index a77d4d8..106a0c3 100644 --- a/core/rtw_chplan.c +++ b/core/rtw_chplan.c @@ -569,7 +569,7 @@ u8 init_channel_set(_adapter *padapter, u8 ChannelPlan, RT_CHANNEL_INFO *channel #ifdef CONFIG_DFS_MASTER for (i = 0; i < chanset_size; i++) - channel_set[i].non_ocp_end_time = rtw_get_current_time(); + channel_set[i].non_ocp_end_time = jiffies; #endif #endif /* CONFIG_IEEE80211_BAND_5GHZ */ diff --git a/core/rtw_cmd.c b/core/rtw_cmd.c index 0031d17..dd1fe3d 100644 --- a/core/rtw_cmd.c +++ b/core/rtw_cmd.c @@ -187,8 +187,6 @@ static void _rtw_free_evt_priv(struct evt_priv *pevtpriv) #ifdef CONFIG_EVENT_THREAD_MODE - _rtw_free_sema(&(pevtpriv->evt_notify)); - if (pevtpriv->evt_allocated_buf) rtw_mfree(pevtpriv->evt_allocated_buf, MAX_EVTSZ + 4); #endif @@ -215,10 +213,6 @@ static void _rtw_free_cmd_priv(struct cmd_priv *pcmdpriv) { if (pcmdpriv) { - _rtw_free_sema(&(pcmdpriv->cmd_queue_sema)); - /* _rtw_free_sema(&(pcmdpriv->cmd_done_sema)); */ - _rtw_free_sema(&(pcmdpriv->start_cmdthread_sema)); - if (pcmdpriv->cmd_allocated_buf) rtw_mfree(pcmdpriv->cmd_allocated_buf, MAX_CMDSZ + CMDBUFF_ALIGN_SZ); @@ -579,7 +573,7 @@ _next: continue; } - cmd_start_time = rtw_get_current_time(); + cmd_start_time = jiffies; pcmdpriv->cmd_issued_cnt++; if (pcmd->cmdsz > MAX_CMDSZ) { @@ -895,7 +889,7 @@ u8 rtw_sitesurvey_cmd(_adapter *padapter, struct sitesurvey_parm *pparm) if (res == _SUCCESS) { u32 scan_timeout_ms; - pmlmepriv->scan_start_time = rtw_get_current_time(); + pmlmepriv->scan_start_time = jiffies; scan_timeout_ms = rtw_scan_timeout_decision(padapter); mlme_set_scan_to_timer(pmlmepriv,scan_timeout_ms); @@ -1476,7 +1470,7 @@ u8 rtw_joinbss_cmd(_adapter *padapter, struct wlan_network *pnetwork) #ifdef CONFIG_80211N_HT phtpriv->ht_option = _FALSE; if (pregistrypriv->ht_enable && is_supported_ht(pregistrypriv->wireless_mode)) { - ptmp = rtw_get_ie(&pnetwork->network.IEs[12], _HT_CAPABILITY_IE_, &tmp_len, pnetwork->network.IELength - 12); + ptmp = rtw_get_ie(&pnetwork->network.IEs[12], WLAN_EID_HT_CAPABILITY, &tmp_len, pnetwork->network.IELength - 12); if (ptmp && tmp_len > 0) { /* Added by Albert 2010/06/23 */ /* For the WEP mode, we will use the bg mode to do the connection to avoid some IOT issue. */ @@ -3237,8 +3231,8 @@ static void dynamic_update_bcn_check(_adapter *padapter) && _FALSE == atomic_read(&pmlmepriv->olbc_ht)) { if (rtw_ht_operation_update(padapter) > 0) { - update_beacon(padapter, _HT_CAPABILITY_IE_, NULL, _FALSE); - update_beacon(padapter, _HT_ADD_INFO_IE_, NULL, _TRUE); + update_beacon(padapter, WLAN_EID_HT_CAPABILITY, NULL, _FALSE); + update_beacon(padapter, WLAN_EID_HT_OPERATION, NULL, _TRUE); } } #endif /* CONFIG_80211N_HT */ @@ -3251,8 +3245,8 @@ static void dynamic_update_bcn_check(_adapter *padapter) && _FALSE != atomic_read(&pmlmepriv->olbc_ht)) { if (rtw_ht_operation_update(padapter) > 0) { - update_beacon(padapter, _HT_CAPABILITY_IE_, NULL, _FALSE); - update_beacon(padapter, _HT_ADD_INFO_IE_, NULL, _TRUE); + update_beacon(padapter, WLAN_EID_HT_CAPABILITY, NULL, _FALSE); + update_beacon(padapter, WLAN_EID_HT_OPERATION, NULL, _TRUE); } atomic_set(&pmlmepriv->olbc, _FALSE); @@ -4128,7 +4122,7 @@ static void rtw_chk_hi_queue_hdl(_adapter *padapter) { struct sta_info *psta_bmc; struct sta_priv *pstapriv = &padapter->stapriv; - systime start = rtw_get_current_time(); + systime start = jiffies; u8 empty = _FALSE; psta_bmc = rtw_get_bcmc_stainfo(padapter); @@ -4153,7 +4147,7 @@ static void rtw_chk_hi_queue_hdl(_adapter *padapter) rtw_tim_map_clear(padapter, pstapriv->sta_dz_bitmap, 0); if (update_tim == _TRUE) - _update_beacon(padapter, _TIM_IE_, NULL, _TRUE, "bmc sleepq and HIQ empty"); + _update_beacon(padapter, WLAN_EID_DS_PARAMS, NULL, _TRUE, "bmc sleepq and HIQ empty"); } else /* re check again */ rtw_chk_hi_queue_cmd(padapter); @@ -5233,7 +5227,7 @@ void session_tracker_chk_for_sta(_adapter *adapter, struct sta_info *sta) phead = &st_ctl->tracker_q.queue; plist = get_next(phead); pnext = get_next(plist); - while (rtw_end_of_queue_search(phead, plist) == _FALSE) { + while (phead != plist) { st = LIST_CONTAINOR(plist, struct session_tracker, list); plist = pnext; pnext = get_next(pnext); @@ -5269,7 +5263,7 @@ void session_tracker_chk_for_sta(_adapter *adapter, struct sta_info *sta) _exit_critical_bh(&st_ctl->tracker_q.lock, &irqL); plist = get_next(&dlist); - while (rtw_end_of_queue_search(&dlist, plist) == _FALSE) { + while (&dlist != plist) { st = LIST_CONTAINOR(plist, struct session_tracker, list); plist = get_next(plist); rtw_mfree((u8 *)st, sizeof(struct session_tracker)); @@ -5300,7 +5294,7 @@ void session_tracker_chk_for_adapter(_adapter *adapter) phead = &(stapriv->sta_hash[i]); plist = get_next(phead); - while ((rtw_end_of_queue_search(phead, plist)) == _FALSE) { + while (phead != plist) { sta = LIST_CONTAINOR(plist, struct sta_info, hash_list); plist = get_next(plist); @@ -5358,7 +5352,7 @@ void session_tracker_cmd_hdl(_adapter *adapter, struct st_cmd_parm *parm) phead = &st_ctl->tracker_q.queue; plist = get_next(phead); - while (rtw_end_of_queue_search(phead, plist) == _FALSE) { + while (phead != plist) { st = LIST_CONTAINOR(plist, struct session_tracker, list); if (st->local_naddr == local_naddr @@ -5370,7 +5364,7 @@ void session_tracker_cmd_hdl(_adapter *adapter, struct st_cmd_parm *parm) plist = get_next(plist); } - if (rtw_end_of_queue_search(phead, plist) == _TRUE) + if (phead == plist) st = NULL; switch (cmd) { @@ -5402,7 +5396,7 @@ unlock: st->local_port = local_port; st->remote_naddr = remote_naddr; st->remote_port = remote_port; - st->set_time = rtw_get_current_time(); + st->set_time = jiffies; st->status = ST_STATUS_CHECK; _enter_critical_bh(&st_ctl->tracker_q.lock, &irqL); @@ -5751,7 +5745,7 @@ void rtw_create_ibss_post_hdl(_adapter *padapter, int status) _exit_critical_bh(&(pmlmepriv->scanned_queue.lock), &irqL); goto createbss_cmd_fail; } - pwlan->last_scanned = rtw_get_current_time(); + pwlan->last_scanned = jiffies; } else rtw_list_insert_tail(&(pwlan->list), &pmlmepriv->scanned_queue.queue); diff --git a/core/rtw_debug.c b/core/rtw_debug.c index a6e07ed..77e0b2f 100644 --- a/core/rtw_debug.c +++ b/core/rtw_debug.c @@ -842,7 +842,7 @@ int proc_get_rx_stat(struct seq_file *m, void *v) for (i = 0; i < NUM_STA; i++) { phead = &(pstapriv->sta_hash[i]); plist = get_next(phead); - while ((rtw_end_of_queue_search(phead, plist)) == _FALSE) { + while (phead != plist) { psta = LIST_CONTAINOR(plist, struct sta_info, hash_list); plist = get_next(plist); pstats = &psta->sta_stats; @@ -894,7 +894,7 @@ int proc_get_tx_stat(struct seq_file *m, void *v) for (i = 0; i < NUM_STA; i++) { phead = &(pstapriv->sta_hash[i]); plist = get_next(phead); - while ((rtw_end_of_queue_search(phead, plist)) == _FALSE) { + while (phead != plist) { psta = LIST_CONTAINOR(plist, struct sta_info, hash_list); plist = get_next(plist); if ((_rtw_memcmp(psta->cmn.mac_addr, bc_addr, ETH_ALEN) != _TRUE) @@ -1422,7 +1422,7 @@ int proc_get_survey_info(struct seq_file *m, void *v) RTW_PRINT_SEL(m, "%5s %-17s %3s %-3s %-4s %-4s %5s %32s %32s\n", "index", "bssid", "ch", "RSSI", "SdBm", "Noise", "age", "flag", ssid_title_str); while (1) { - if (rtw_end_of_queue_search(phead, plist) == _TRUE) + if (phead == plist) break; pnetwork = LIST_CONTAINOR(plist, struct wlan_network, list); @@ -1817,7 +1817,7 @@ ssize_t proc_set_rate_ctl(struct file *file, const char __user *buffer, size_t c for (i = 0; i < NUM_STA; i++) { phead = &(pstapriv->sta_hash[i]); plist = get_next(phead); - while ((rtw_end_of_queue_search(phead, plist)) == _FALSE) { + while (phead != plist) { psta = LIST_CONTAINOR(plist, struct sta_info, hash_list); plist = get_next(plist); if ((_rtw_memcmp(psta->cmn.mac_addr, bc_addr, ETH_ALEN) != _TRUE) @@ -2132,7 +2132,7 @@ static u8 sta_linking_test_force_fail = 0; void rtw_sta_linking_test_set_start(void) { - sta_linking_test_start_time = rtw_get_current_time(); + sta_linking_test_start_time = jiffies; } bool rtw_sta_linking_test_wait_done(void) @@ -3662,7 +3662,7 @@ int proc_get_all_sta_info(struct seq_file *m, void *v) phead = &(pstapriv->sta_hash[i]); plist = get_next(phead); - while ((rtw_end_of_queue_search(phead, plist)) == _FALSE) { + while (phead != plist) { psta = LIST_CONTAINOR(plist, struct sta_info, hash_list); plist = get_next(plist); @@ -5283,7 +5283,7 @@ static int proc_tdls_display_tdls_sta_info(struct seq_file *m) for (i = 0; i < NUM_STA; i++) { phead = &(pstapriv->sta_hash[i]); plist = get_next(phead); - while ((rtw_end_of_queue_search(phead, plist)) == _FALSE) { + while (phead != plist) { psta = LIST_CONTAINOR(plist, struct sta_info, hash_list); plist = get_next(plist); if (psta->tdls_sta_state != TDLS_STATE_NONE) { @@ -5722,7 +5722,7 @@ ssize_t proc_set_tx_sa_query(struct file *file, const char __user *buffer, size_ phead = &(pstapriv->sta_hash[index]); plist = get_next(phead); - while ((rtw_end_of_queue_search(phead, plist)) == _FALSE) { + while (phead != plist) { psta = LIST_CONTAINOR(plist, struct sta_info, hash_list); plist = get_next(plist); memcpy(&mac_addr[psta->cmn.mac_id][0], psta->cmn.mac_addr, ETH_ALEN); @@ -5811,7 +5811,7 @@ ssize_t proc_set_tx_deauth(struct file *file, const char __user *buffer, size_t phead = &(pstapriv->sta_hash[index]); plist = get_next(phead); - while ((rtw_end_of_queue_search(phead, plist)) == _FALSE) { + while (phead != plist) { psta = LIST_CONTAINOR(plist, struct sta_info, hash_list); plist = get_next(plist); memcpy(&mac_addr[psta->cmn.mac_id][0], psta->cmn.mac_addr, ETH_ALEN); diff --git a/core/rtw_ieee80211.c b/core/rtw_ieee80211.c index 192cef2..fa949b8 100644 --- a/core/rtw_ieee80211.c +++ b/core/rtw_ieee80211.c @@ -530,7 +530,7 @@ int rtw_generate_ie(struct registry_priv *pregistrypriv) ie += 2; /* SSID */ - ie = rtw_set_ie(ie, _SSID_IE_, pdev_network->Ssid.SsidLength, pdev_network->Ssid.Ssid, &sz); + ie = rtw_set_ie(ie, WLAN_EID_SSID, pdev_network->Ssid.SsidLength, pdev_network->Ssid.Ssid, &sz); /* supported rates */ if (pregistrypriv->wireless_mode == WIRELESS_11ABGN) { @@ -551,21 +551,21 @@ int rtw_generate_ie(struct registry_priv *pregistrypriv) rateLen = rtw_get_rateset_len(pdev_network->SupportedRates); if (rateLen > 8) { - ie = rtw_set_ie(ie, _SUPPORTEDRATES_IE_, 8, pdev_network->SupportedRates, &sz); - /* ie = rtw_set_ie(ie, _EXT_SUPPORTEDRATES_IE_, (rateLen - 8), (pdev_network->SupportedRates + 8), &sz); */ + ie = rtw_set_ie(ie, WLAN_EID_SUPP_RATES, 8, pdev_network->SupportedRates, &sz); + /* ie = rtw_set_ie(ie, WLAN_EID_EXT_SUPP_RATES, (rateLen - 8), (pdev_network->SupportedRates + 8), &sz); */ } else - ie = rtw_set_ie(ie, _SUPPORTEDRATES_IE_, rateLen, pdev_network->SupportedRates, &sz); + ie = rtw_set_ie(ie, WLAN_EID_SUPP_RATES, rateLen, pdev_network->SupportedRates, &sz); /* DS parameter set */ - ie = rtw_set_ie(ie, _DSSET_IE_, 1, (u8 *)&(pdev_network->Configuration.DSConfig), &sz); + ie = rtw_set_ie(ie, WLAN_EID_DS_PARAMS, 1, (u8 *)&(pdev_network->Configuration.DSConfig), &sz); /* IBSS Parameter Set */ - ie = rtw_set_ie(ie, _IBSS_PARA_IE_, 2, (u8 *)&(pdev_network->Configuration.ATIMWindow), &sz); + ie = rtw_set_ie(ie, WLAN_EID_IBSS_PARAMS, 2, (u8 *)&(pdev_network->Configuration.ATIMWindow), &sz); if (rateLen > 8) - ie = rtw_set_ie(ie, _EXT_SUPPORTEDRATES_IE_, (rateLen - 8), (pdev_network->SupportedRates + 8), &sz); + ie = rtw_set_ie(ie, WLAN_EID_EXT_SUPP_RATES, (rateLen - 8), (pdev_network->SupportedRates + 8), &sz); #ifdef CONFIG_80211N_HT /* HT Cap. */ @@ -588,7 +588,6 @@ unsigned char *rtw_get_wpa_ie(unsigned char *pie, int *wpa_ie_len, int limit) { int len; u16 val16; - unsigned char wpa_oui_type[] = {0x00, 0x50, 0xf2, 0x01}; u8 *pbuf = pie; int limit_new = limit; @@ -598,7 +597,7 @@ unsigned char *rtw_get_wpa_ie(unsigned char *pie, int *wpa_ie_len, int limit) if (pbuf) { /* check if oui matches... */ - if (_rtw_memcmp((pbuf + 2), wpa_oui_type, sizeof(wpa_oui_type)) == _FALSE) + if (_rtw_memcmp((pbuf + 2), RTW_WPA_OUI_TYPE, sizeof(RTW_WPA_OUI_TYPE)) == _FALSE) goto check_next_ie; @@ -943,8 +942,8 @@ int rtw_get_wapi_ie(u8 *in_ie, uint in_len, u8 *wapi_ie, u16 *wapi_len) while (cnt < in_len) { authmode = in_ie[cnt]; - /* if(authmode==_WAPI_IE_) */ - if (authmode == _WAPI_IE_ && (_rtw_memcmp(&in_ie[cnt + 6], wapi_oui1, 4) == _TRUE || + /* if(authmode==WLAN_EID_BSS_AC_ACCESS_DELAY) */ + if (authmode == WLAN_EID_BSS_AC_ACCESS_DELAY && (_rtw_memcmp(&in_ie[cnt + 6], wapi_oui1, 4) == _TRUE || _rtw_memcmp(&in_ie[cnt + 6], wapi_oui2, 4) == _TRUE)) { if (wapi_ie) memcpy(wapi_ie, &in_ie[cnt], in_ie[cnt + 1] + 2); @@ -1125,7 +1124,7 @@ u8 *rtw_get_wps_attr(u8 *wps_ie, uint wps_ielen, u16 target_attr_id , u8 *buf_at if (len_attr) *len_attr = 0; - if ((wps_ie[0] != _VENDOR_SPECIFIC_IE_) || + if ((wps_ie[0] != WLAN_EID_VENDOR_SPECIFIC) || (_rtw_memcmp(wps_ie + 2, wps_oui , 4) != _TRUE)) return attr_ptr; @@ -1211,7 +1210,7 @@ static int rtw_ieee802_11_parse_vendor_specific(u8 *pos, uint elen, oui = RTW_GET_BE24(pos); switch (oui) { - case OUI_MICROSOFT: + case WLAN_OUI_MICROSOFT: /* Microsoft/Wi-Fi information elements are further typed and * subtyped */ switch (pos[3]) { @@ -1414,7 +1413,7 @@ ParseRes rtw_ieee802_11_parse_elems(u8 *start, uint len, elems->vht_op_mode_notify = pos; elems->vht_op_mode_notify_len = elen; break; - case _EID_RRM_EN_CAP_IE_: + case WLAN_EID_RRM_ENABLED_CAPABILITIES : elems->rm_en_cap = pos; elems->rm_en_cap_len = elen; break; @@ -1768,7 +1767,7 @@ void rtw_ies_get_chbw(u8 *ies, int ies_len, u8 *ch, u8 *bw, u8 *offset, u8 ht, u *bw = CHANNEL_WIDTH_20; *offset = HAL_PRIME_CHNL_OFFSET_DONT_CARE; - p = rtw_get_ie(ies, _DSSET_IE_, &ie_len, ies_len); + p = rtw_get_ie(ies, WLAN_EID_DS_PARAMS, &ie_len, ies_len); if (p && ie_len > 0) *ch = *(p + 2); @@ -1945,7 +1944,7 @@ u32 rtw_get_p2p_merged_ies_len(u8 *in_ie, u32 in_len) while (i < in_len) { pIE = (PNDIS_802_11_VARIABLE_IEs)(in_ie + i); - if (pIE->ElementID == _VENDOR_SPECIFIC_IE_ && _rtw_memcmp(pIE->data, OUI, 4)) { + if (pIE->ElementID == WLAN_EID_VENDOR_SPECIFIC && _rtw_memcmp(pIE->data, OUI, 4)) { len += pIE->Length - 4; /* 4 is P2P OUI length, don't count it in this loop */ } @@ -1979,7 +1978,7 @@ int rtw_p2p_merge_ies(u8 *in_ie, u32 in_len, u8 *merge_ie) pIE = (PNDIS_802_11_VARIABLE_IEs)(in_ie + i); /* Take out the rest of P2P OUIs */ - if (pIE->ElementID == _VENDOR_SPECIFIC_IE_ && _rtw_memcmp(pIE->data, OUI, 4)) { + if (pIE->ElementID == WLAN_EID_VENDOR_SPECIFIC && _rtw_memcmp(pIE->data, OUI, 4)) { memcpy(merge_ie, pIE->data + 4, pIE->Length - 4); len += pIE->Length - 4; merge_ie += pIE->Length - 4; diff --git a/core/rtw_ioctl_set.c b/core/rtw_ioctl_set.c index e2e8aeb..892d711 100644 --- a/core/rtw_ioctl_set.c +++ b/core/rtw_ioctl_set.c @@ -733,7 +733,7 @@ u16 rtw_get_cur_max_rate(_adapter *adapter) max_rate = rtw_mcs_rate(rf_type , (psta->cmn.bw_mode == CHANNEL_WIDTH_40) ? 1 : 0 , short_GI - , psta->htpriv.ht_cap.supp_mcs_set + , psta->htpriv.ht_cap.mcs.rx_mask ); } #ifdef CONFIG_80211AC_VHT diff --git a/core/rtw_iol.c b/core/rtw_iol.c index 19a2cda..e287b36 100644 --- a/core/rtw_iol.c +++ b/core/rtw_iol.c @@ -46,7 +46,7 @@ struct xmit_frame *rtw_IOL_accquire_xmit_frame(ADAPTER *adapter) pattrib = &xmit_frame->attrib; update_mgntframe_attrib(adapter, pattrib); pattrib->qsel = QSLT_BEACON;/* Beacon */ - pattrib->subtype = WIFI_BEACON; + pattrib->subtype = IEEE80211_STYPE_BEACON; pattrib->pktlen = pattrib->last_txcmdsz = 0; #else diff --git a/core/rtw_mi.c b/core/rtw_mi.c index 5e1a23f..da0d31c 100644 --- a/core/rtw_mi.c +++ b/core/rtw_mi.c @@ -1451,7 +1451,7 @@ void rtw_mi_buddy_clone_bcmc_packet(_adapter *padapter, union recv_frame *precvf continue; if (rtw_is_adapter_up(iface) == _FALSE || iface->registered == 0) continue; - if (type == WIFI_DATA_TYPE && !adapter_allow_bmc_data_rx(iface)) + if (type == IEEE80211_FTYPE_DATA && !adapter_allow_bmc_data_rx(iface)) continue; pcloneframe = rtw_alloc_recvframe(pfree_recv_queue); diff --git a/core/rtw_mlme.c b/core/rtw_mlme.c index 34d46dd..48e10ba 100644 --- a/core/rtw_mlme.c +++ b/core/rtw_mlme.c @@ -129,7 +129,7 @@ sint _rtw_init_mlme_priv(_adapter *padapter) pmlmepriv->roam_scan_int = RTW_ROAM_SCAN_INTERVAL; pmlmepriv->roam_rssi_threshold = RTW_ROAM_RSSI_THRESHOLD; pmlmepriv->need_to_roam = _FALSE; - pmlmepriv->last_roaming = rtw_get_current_time(); + pmlmepriv->last_roaming = jiffies; #endif /* CONFIG_LAYER2_ROAMING */ #ifdef CONFIG_RTW_80211R @@ -380,7 +380,7 @@ struct wlan_network *_rtw_alloc_network(struct mlme_priv *pmlmepriv) /* (_queue pnetwork->network_type = 0; pnetwork->fixed = _FALSE; - pnetwork->last_scanned = rtw_get_current_time(); + pnetwork->last_scanned = jiffies; #if defined(CONFIG_RTW_MESH) && CONFIG_RTW_MESH_ACNODE_PREVENT pnetwork->acnode_stime = 0; pnetwork->acnode_notify_etime = 0; @@ -480,7 +480,7 @@ void _rtw_free_network_queue(_adapter *padapter, u8 isfreeall) phead = get_list_head(scanned_queue); plist = get_next(phead); - while (rtw_end_of_queue_search(phead, plist) == _FALSE) { + while (phead != plist) { pnetwork = LIST_CONTAINOR(plist, struct wlan_network, list); @@ -777,7 +777,7 @@ struct wlan_network *rtw_get_oldest_wlan_network(_queue *scanned_queue) while (1) { - if (rtw_end_of_queue_search(phead, plist) == _TRUE) + if (phead == plist) break; pwlan = LIST_CONTAINOR(plist, struct wlan_network, list); @@ -962,7 +962,7 @@ bool rtw_update_scanned_network(_adapter *adapter, WLAN_BSSID_EX *target) #endif while (1) { - if (rtw_end_of_queue_search(phead, plist) == _TRUE) + if (phead == plist) break; pnetwork = LIST_CONTAINOR(plist, struct wlan_network, list); @@ -1033,10 +1033,10 @@ bool rtw_update_scanned_network(_adapter *adapter, WLAN_BSSID_EX *target) rtw_hal_get_odm_var(adapter, HAL_ODM_ANTDIV_SELECT, &(target->PhyInfo.Optimum_antenna), NULL); #endif memcpy(&(pnetwork->network), target, get_WLAN_BSSID_EX_sz(target)); - /* pnetwork->last_scanned = rtw_get_current_time(); */ + /* pnetwork->last_scanned = jiffies; */ /* variable initialize */ pnetwork->fixed = _FALSE; - pnetwork->last_scanned = rtw_get_current_time(); + pnetwork->last_scanned = jiffies; #if defined(CONFIG_RTW_MESH) && CONFIG_RTW_MESH_ACNODE_PREVENT pnetwork->acnode_stime = 0; pnetwork->acnode_notify_etime = 0; @@ -1063,7 +1063,7 @@ bool rtw_update_scanned_network(_adapter *adapter, WLAN_BSSID_EX *target) #endif memcpy(&(pnetwork->network), target, bssid_ex_sz); - pnetwork->last_scanned = rtw_get_current_time(); + pnetwork->last_scanned = jiffies; /* bss info not receving from the right channel */ if (pnetwork->network.PhyInfo.SignalQuality == 101) @@ -1081,7 +1081,7 @@ bool rtw_update_scanned_network(_adapter *adapter, WLAN_BSSID_EX *target) systime last_scanned = pnetwork->last_scanned; #endif - pnetwork->last_scanned = rtw_get_current_time(); + pnetwork->last_scanned = jiffies; /* target.Reserved[0]==BSS_TYPE_BCN, means that scanned network is a bcn frame. */ if ((pnetwork->network.IELength > target->IELength) && (target->Reserved[0] == BSS_TYPE_BCN)) @@ -1190,7 +1190,7 @@ int rtw_is_desired_network(_adapter *adapter, struct wlan_network *pnetwork) bselected = _FALSE; if (psecuritypriv->ndisauthtype == Ndis802_11AuthModeWPA2PSK) { - p = rtw_get_ie(pnetwork->network.IEs + _BEACON_IE_OFFSET_, _RSN_IE_2_, &ie_len, (pnetwork->network.IELength - _BEACON_IE_OFFSET_)); + p = rtw_get_ie(pnetwork->network.IEs + _BEACON_IE_OFFSET_, WLAN_EID_RSN, &ie_len, (pnetwork->network.IELength - _BEACON_IE_OFFSET_)); if (p && ie_len > 0) bselected = _TRUE; else @@ -1877,7 +1877,7 @@ static u32 _rtw_wait_scan_done(_adapter *adapter, u8 abort, u32 timeout_ms) struct mlme_priv *pmlmepriv = &(adapter->mlmepriv); struct mlme_ext_priv *pmlmeext = &(adapter->mlmeextpriv); - start = rtw_get_current_time(); + start = jiffies; pmlmeext->scan_abort = abort; @@ -1945,7 +1945,7 @@ static u32 _rtw_wait_join_done(_adapter *adapter, u8 abort, u32 timeout_ms) struct mlme_priv *pmlmepriv = &(adapter->mlmepriv); struct mlme_ext_priv *pmlmeext = &(adapter->mlmeextpriv); - start = rtw_get_current_time(); + start = jiffies; pmlmeext->join_abort = abort; if (abort) @@ -3661,7 +3661,7 @@ int rtw_select_roaming_candidate(struct mlme_priv *mlme) mlme->pscanned = get_next(phead); - while (!rtw_end_of_queue_search(phead, mlme->pscanned)) { + while (phead != mlme->pscanned) { pnetwork = LIST_CONTAINOR(mlme->pscanned, struct wlan_network, list); if (pnetwork == NULL) { @@ -3855,7 +3855,7 @@ int rtw_select_and_join_from_scanned_queue(struct mlme_priv *pmlmepriv) phead = get_list_head(queue); pmlmepriv->pscanned = get_next(phead); - while (!rtw_end_of_queue_search(phead, pmlmepriv->pscanned)) { + while (phead != pmlmepriv->pscanned) { pnetwork = LIST_CONTAINOR(pmlmepriv->pscanned, struct wlan_network, list); if (pnetwork == NULL) { @@ -4606,7 +4606,7 @@ void rtw_build_wmm_ie_ht(_adapter *padapter, u8 *out_ie, uint *pout_len) if (padapter->mlmepriv.qospriv.qos_option == 0) { out_len = *pout_len; - pframe = rtw_set_ie(out_ie + out_len, _VENDOR_SPECIFIC_IE_, + pframe = rtw_set_ie(out_ie + out_len, WLAN_EID_VENDOR_SPECIFIC, _WMM_IE_Length_, WMM_IE, pout_len); padapter->mlmepriv.qospriv.qos_option = 1; @@ -4618,10 +4618,10 @@ unsigned int rtw_restructure_ht_ie(_adapter *padapter, u8 *in_ie, u8 *out_ie, ui { u32 ielen, out_len; u32 rx_packet_offset, max_recvbuf_sz; - HT_CAP_AMPDU_FACTOR max_rx_ampdu_factor; - HT_CAP_AMPDU_DENSITY best_ampdu_density; + enum ieee80211_max_ampdu_length_exp max_rx_ampdu_factor; + enum ieee80211_min_mpdu_spacing best_ampdu_density; unsigned char *p, *pframe; - struct rtw_ieee80211_ht_cap ht_capie; + struct ieee80211_ht_cap ht_capie; u8 cbw40_enable = 0, rf_type = 0, rf_num = 0, rx_stbc_nss = 0, rx_nss = 0; struct registry_priv *pregistrypriv = &padapter->registrypriv; struct mlme_priv *pmlmepriv = &padapter->mlmepriv; @@ -4637,7 +4637,7 @@ unsigned int rtw_restructure_ht_ie(_adapter *padapter, u8 *in_ie, u8 *out_ie, ui out_len = *pout_len; - memset(&ht_capie, 0, sizeof(struct rtw_ieee80211_ht_cap)); + memset(&ht_capie, 0, sizeof(struct ieee80211_ht_cap)); ht_capie.cap_info = IEEE80211_HT_CAP_DSSSCCK40; @@ -4741,7 +4741,7 @@ unsigned int rtw_restructure_ht_ie(_adapter *padapter, u8 *in_ie, u8 *out_ie, ui } /* fill default supported_mcs_set */ - memcpy(ht_capie.supp_mcs_set, pmlmeext->default_supported_mcs_set, 16); + memcpy(ht_capie.mcs.rx_mask, pmlmeext->default_supported_mcs_set, 16); /* update default supported_mcs_set */ rtw_hal_get_hwreg(padapter, HW_VAR_RF_TYPE, (u8 *)(&rf_type)); @@ -4749,21 +4749,21 @@ unsigned int rtw_restructure_ht_ie(_adapter *padapter, u8 *in_ie, u8 *out_ie, ui switch (rx_nss) { case 1: - set_mcs_rate_by_mask(ht_capie.supp_mcs_set, MCS_RATE_1R); + set_mcs_rate_by_mask(ht_capie.mcs.rx_mask, MCS_RATE_1R); break; case 2: #ifdef CONFIG_DISABLE_MCS13TO15 if (cbw40_enable && pregistrypriv->wifi_spec != 1) - set_mcs_rate_by_mask(ht_capie.supp_mcs_set, MCS_RATE_2R_13TO15_OFF); + set_mcs_rate_by_mask(ht_capie.mcs.rx_mask, MCS_RATE_2R_13TO15_OFF); else #endif - set_mcs_rate_by_mask(ht_capie.supp_mcs_set, MCS_RATE_2R); + set_mcs_rate_by_mask(ht_capie.mcs.rx_mask, MCS_RATE_2R); break; case 3: - set_mcs_rate_by_mask(ht_capie.supp_mcs_set, MCS_RATE_3R); + set_mcs_rate_by_mask(ht_capie.mcs.rx_mask, MCS_RATE_3R); break; case 4: - set_mcs_rate_by_mask(ht_capie.supp_mcs_set, MCS_RATE_4R); + set_mcs_rate_by_mask(ht_capie.mcs.rx_mask, MCS_RATE_4R); break; default: RTW_WARN("rf_type:%d or rx_nss:%u is not expected\n", rf_type, hal_spec->rx_nss_num); @@ -4791,7 +4791,7 @@ unsigned int rtw_restructure_ht_ie(_adapter *padapter, u8 *in_ie, u8 *out_ie, ui */ if (padapter->driver_rx_ampdu_factor != 0xFF) - max_rx_ampdu_factor = (HT_CAP_AMPDU_FACTOR)padapter->driver_rx_ampdu_factor; + max_rx_ampdu_factor = (enum ieee80211_max_ampdu_length_exp)padapter->driver_rx_ampdu_factor; else rtw_hal_get_def_var(padapter, HW_VAR_MAX_RX_AMPDU_FACTOR, &max_rx_ampdu_factor); @@ -4846,16 +4846,16 @@ unsigned int rtw_restructure_ht_ie(_adapter *padapter, u8 *in_ie, u8 *out_ie, ui } #endif/*CONFIG_BEAMFORMING*/ - pframe = rtw_set_ie(out_ie + out_len, _HT_CAPABILITY_IE_, - sizeof(struct rtw_ieee80211_ht_cap), (unsigned char *)&ht_capie, pout_len); + pframe = rtw_set_ie(out_ie + out_len, WLAN_EID_HT_CAPABILITY, + sizeof(struct ieee80211_ht_cap), (unsigned char *)&ht_capie, pout_len); phtpriv->ht_option = _TRUE; if (in_ie != NULL) { - p = rtw_get_ie(in_ie, _HT_ADD_INFO_IE_, &ielen, in_len); + p = rtw_get_ie(in_ie, WLAN_EID_HT_OPERATION, &ielen, in_len); if (p && (ielen == sizeof(struct ieee80211_ht_addt_info))) { out_len = *pout_len; - pframe = rtw_set_ie(out_ie + out_len, _HT_ADD_INFO_IE_, ielen, p + 2 , pout_len); + pframe = rtw_set_ie(out_ie + out_len, WLAN_EID_HT_OPERATION, ielen, p + 2 , pout_len); } } @@ -4869,7 +4869,7 @@ void rtw_update_ht_cap(_adapter *padapter, u8 *pie, uint ie_len, u8 channel) u8 *p, max_ampdu_sz; int len; /* struct sta_info *bmc_sta, *psta; */ - struct rtw_ieee80211_ht_cap *pht_capie; + struct ieee80211_ht_cap *pht_capie; struct ieee80211_ht_addt_info *pht_addtinfo; /* struct recv_reorder_ctrl *preorder_ctrl; */ struct mlme_priv *pmlmepriv = &padapter->mlmepriv; @@ -4903,9 +4903,9 @@ void rtw_update_ht_cap(_adapter *padapter, u8 *pie, uint ie_len, u8 channel) /* check Max Rx A-MPDU Size */ len = 0; - p = rtw_get_ie(pie + sizeof(NDIS_802_11_FIXED_IEs), _HT_CAPABILITY_IE_, &len, ie_len - sizeof(NDIS_802_11_FIXED_IEs)); + p = rtw_get_ie(pie + sizeof(NDIS_802_11_FIXED_IEs), WLAN_EID_HT_CAPABILITY, &len, ie_len - sizeof(NDIS_802_11_FIXED_IEs)); if (p && len > 0) { - pht_capie = (struct rtw_ieee80211_ht_cap *)(p + 2); + pht_capie = (struct ieee80211_ht_cap *)(p + 2); max_ampdu_sz = (pht_capie->ampdu_params_info & IEEE80211_HT_AMPDU_PARM_FACTOR); max_ampdu_sz = 1 << (max_ampdu_sz + 3); /* max_ampdu_sz (kbytes); */ @@ -4916,7 +4916,7 @@ void rtw_update_ht_cap(_adapter *padapter, u8 *pie, uint ie_len, u8 channel) len = 0; - p = rtw_get_ie(pie + sizeof(NDIS_802_11_FIXED_IEs), _HT_ADD_INFO_IE_, &len, ie_len - sizeof(NDIS_802_11_FIXED_IEs)); + p = rtw_get_ie(pie + sizeof(NDIS_802_11_FIXED_IEs), WLAN_EID_HT_OPERATION, &len, ie_len - sizeof(NDIS_802_11_FIXED_IEs)); if (p && len > 0) { pht_addtinfo = (struct ieee80211_ht_addt_info *)(p + 2); /* todo: */ diff --git a/core/rtw_mlme_ext.c b/core/rtw_mlme_ext.c index fe23027..7358168 100644 --- a/core/rtw_mlme_ext.c +++ b/core/rtw_mlme_ext.c @@ -22,47 +22,47 @@ struct mlme_handler mlme_sta_tbl[] = { - {WIFI_ASSOCREQ, "OnAssocReq", &OnAssocReq}, - {WIFI_ASSOCRSP, "OnAssocRsp", &OnAssocRsp}, - {WIFI_REASSOCREQ, "OnReAssocReq", &OnAssocReq}, - {WIFI_REASSOCRSP, "OnReAssocRsp", &OnAssocRsp}, - {WIFI_PROBEREQ, "OnProbeReq", &OnProbeReq}, - {WIFI_PROBERSP, "OnProbeRsp", &OnProbeRsp}, + {IEEE80211_STYPE_ASSOC_REQ, "OnAssocReq", &OnAssocReq}, + {IEEE80211_STYPE_ASSOC_RESP, "OnAssocRsp", &OnAssocRsp}, + {IEEE80211_STYPE_REASSOC_REQ, "OnReAssocReq", &OnAssocReq}, + {IEEE80211_STYPE_REASSOC_RESP, "OnReAssocRsp", &OnAssocRsp}, + {IEEE80211_STYPE_PROBE_REQ, "OnProbeReq", &OnProbeReq}, + {IEEE80211_STYPE_PROBE_RESP, "OnProbeRsp", &OnProbeRsp}, /*---------------------------------------------------------- below 2 are reserved -----------------------------------------------------------*/ {0, "DoReserved", &DoReserved}, {0, "DoReserved", &DoReserved}, - {WIFI_BEACON, "OnBeacon", &OnBeacon}, - {WIFI_ATIM, "OnATIM", &OnAtim}, - {WIFI_DISASSOC, "OnDisassoc", &OnDisassoc}, - {WIFI_AUTH, "OnAuth", &OnAuthClient}, - {WIFI_DEAUTH, "OnDeAuth", &OnDeAuth}, - {WIFI_ACTION, "OnAction", &OnAction}, + {IEEE80211_STYPE_BEACON, "OnBeacon", &OnBeacon}, + {IEEE80211_STYPE_ATIM, "OnATIM", &OnAtim}, + {IEEE80211_STYPE_DISASSOC, "OnDisassoc", &OnDisassoc}, + {IEEE80211_STYPE_AUTH, "OnAuth", &OnAuthClient}, + {IEEE80211_STYPE_DEAUTH, "OnDeAuth", &OnDeAuth}, + {IEEE80211_STYPE_ACTION, "OnAction", &OnAction}, {WIFI_ACTION_NOACK, "OnActionNoAck", &OnAction}, }; #ifdef _CONFIG_NATIVEAP_MLME_ struct mlme_handler mlme_ap_tbl[] = { - {WIFI_ASSOCREQ, "OnAssocReq", &OnAssocReq}, - {WIFI_ASSOCRSP, "OnAssocRsp", &OnAssocRsp}, - {WIFI_REASSOCREQ, "OnReAssocReq", &OnAssocReq}, - {WIFI_REASSOCRSP, "OnReAssocRsp", &OnAssocRsp}, - {WIFI_PROBEREQ, "OnProbeReq", &OnProbeReq}, - {WIFI_PROBERSP, "OnProbeRsp", &OnProbeRsp}, + {IEEE80211_STYPE_ASSOC_REQ, "OnAssocReq", &OnAssocReq}, + {IEEE80211_STYPE_ASSOC_RESP, "OnAssocRsp", &OnAssocRsp}, + {IEEE80211_STYPE_REASSOC_REQ, "OnReAssocReq", &OnAssocReq}, + {IEEE80211_STYPE_REASSOC_RESP, "OnReAssocRsp", &OnAssocRsp}, + {IEEE80211_STYPE_PROBE_REQ, "OnProbeReq", &OnProbeReq}, + {IEEE80211_STYPE_PROBE_RESP, "OnProbeRsp", &OnProbeRsp}, /*---------------------------------------------------------- below 2 are reserved -----------------------------------------------------------*/ {0, "DoReserved", &DoReserved}, {0, "DoReserved", &DoReserved}, - {WIFI_BEACON, "OnBeacon", &OnBeacon}, - {WIFI_ATIM, "OnATIM", &OnAtim}, - {WIFI_DISASSOC, "OnDisassoc", &OnDisassoc}, - {WIFI_AUTH, "OnAuth", &OnAuth}, - {WIFI_DEAUTH, "OnDeAuth", &OnDeAuth}, - {WIFI_ACTION, "OnAction", &OnAction}, + {IEEE80211_STYPE_BEACON, "OnBeacon", &OnBeacon}, + {IEEE80211_STYPE_ATIM, "OnATIM", &OnAtim}, + {IEEE80211_STYPE_DISASSOC, "OnDisassoc", &OnDisassoc}, + {IEEE80211_STYPE_AUTH, "OnAuth", &OnAuth}, + {IEEE80211_STYPE_DEAUTH, "OnDeAuth", &OnDeAuth}, + {IEEE80211_STYPE_ACTION, "OnAction", &OnAction}, {WIFI_ACTION_NOACK, "OnActionNoAck", &OnAction}, }; #endif @@ -458,7 +458,7 @@ u32 rtw_chset_get_ch_non_ocp_ms(RT_CHANNEL_INFO *ch_set, u8 ch, u8 bw, u8 offset if (rtw_chbw_to_freq_range(ch, bw, offset, &hi, &lo) == _FALSE) goto exit; - current_time = rtw_get_current_time(); + current_time = jiffies; for (i = 0; i < MAX_CHANNEL_NUM && ch_set[i].ChannelNum != 0; i++) { if (!rtw_ch2freq(ch_set[i].ChannelNum)) { @@ -472,8 +472,8 @@ u32 rtw_chset_get_ch_non_ocp_ms(RT_CHANNEL_INFO *ch_set, u8 ch, u8 bw, u8 offset if (lo <= rtw_ch2freq(ch_set[i].ChannelNum) && rtw_ch2freq(ch_set[i].ChannelNum) <= hi ) { - if (rtw_systime_to_ms(ch_set[i].non_ocp_end_time - current_time) > ms) - ms = rtw_systime_to_ms(ch_set[i].non_ocp_end_time - current_time); + if (jiffies_to_msecs(ch_set[i].non_ocp_end_time - current_time) > ms) + ms = jiffies_to_msecs(ch_set[i].non_ocp_end_time - current_time); } } @@ -507,9 +507,9 @@ static void _rtw_chset_update_non_ocp(RT_CHANNEL_INFO *ch_set, u8 ch, u8 bw, u8 && rtw_ch2freq(ch_set[i].ChannelNum) <= hi ) { if (ms >= 0) - ch_set[i].non_ocp_end_time = rtw_get_current_time() + rtw_ms_to_systime(ms); + ch_set[i].non_ocp_end_time = jiffies + msecs_to_jiffies(ms); else - ch_set[i].non_ocp_end_time = rtw_get_current_time() + rtw_ms_to_systime(NON_OCP_TIME_MS); + ch_set[i].non_ocp_end_time = jiffies + msecs_to_jiffies(NON_OCP_TIME_MS); } } @@ -560,7 +560,7 @@ u32 rtw_get_ch_waiting_ms(struct rf_ctl_t *rfctl, u8 ch, u8 bw, u8 offset, u32 * cac_ms = 0; else if (in_rd_range && !non_ocp_ms) { if (IS_CH_WAITING(rfctl)) - cac_ms = rtw_systime_to_ms(rfctl->cac_end_time - rtw_get_current_time()); + cac_ms = jiffies_to_msecs(rfctl->cac_end_time - jiffies); else cac_ms = 0; } else if (rtw_is_long_cac_ch(ch, bw, offset, rtw_odm_get_dfs_domain(dvobj))) @@ -589,8 +589,8 @@ void rtw_reset_cac(struct rf_ctl_t *rfctl, u8 ch, u8 bw, u8 offset) , &cac_ms ); - rfctl->cac_start_time = rtw_get_current_time() + rtw_ms_to_systime(non_ocp_ms); - rfctl->cac_end_time = rfctl->cac_start_time + rtw_ms_to_systime(cac_ms); + rfctl->cac_start_time = jiffies + msecs_to_jiffies(non_ocp_ms); + rfctl->cac_end_time = rfctl->cac_start_time + msecs_to_jiffies(cac_ms); /* skip special value */ if (rfctl->cac_start_time == RTW_CAC_STOPPED) { @@ -607,7 +607,7 @@ u32 rtw_force_stop_cac(struct rf_ctl_t *rfctl, u32 timeout_ms) systime start; u32 pass_ms; - start = rtw_get_current_time(); + start = jiffies; rfctl->cac_force_stop = 1; @@ -767,7 +767,7 @@ void dump_chset(void *sel, RT_CHANNEL_INFO *ch_set) if (rtw_is_dfs_ch(ch_set[i].ChannelNum)) { if (CH_IS_NON_OCP(&ch_set[i])) _RTW_PRINT_SEL(sel, ", non_ocp:%d" - , rtw_systime_to_ms(ch_set[i].non_ocp_end_time - rtw_get_current_time())); + , jiffies_to_msecs(ch_set[i].non_ocp_end_time - jiffies)); else _RTW_PRINT_SEL(sel, ", non_ocp:N/A"); } @@ -1203,7 +1203,7 @@ static u8 cmp_pkt_chnl_diff(_adapter *padapter, u8 *pframe, uint packet_len) u8 channel; u8 *p; - p = rtw_get_ie(pframe + WLAN_HDR_A3_LEN + _BEACON_IE_OFFSET_, _DSSET_IE_, &len, packet_len - _BEACON_IE_OFFSET_); + p = rtw_get_ie(pframe + WLAN_HDR_A3_LEN + _BEACON_IE_OFFSET_, WLAN_EID_DS_PARAMS, &len, packet_len - _BEACON_IE_OFFSET_); if (p) { channel = *(p + 2); if (padapter->mlmeextpriv.cur_channel >= channel) @@ -1271,7 +1271,7 @@ void mgt_dispatcher(_adapter *padapter, union recv_frame *precv_frame) } #endif - if (GetFrameType(pframe) != WIFI_MGT_TYPE) { + if (GetFrameType(pframe) != IEEE80211_FTYPE_MGMT) { return; } @@ -1303,7 +1303,7 @@ void mgt_dispatcher(_adapter *padapter, union recv_frame *precv_frame) index = get_frame_sub_type(pframe) >> 4; #ifdef CONFIG_TDLS - if ((index << 4) == WIFI_ACTION) { + if ((index << 4) == IEEE80211_STYPE_ACTION) { /* category==public (4), action==TDLS_DISCOVERY_RESPONSE */ if (*(pframe + 24) == RTW_WLAN_CATEGORY_PUBLIC && *(pframe + 25) == TDLS_DISCOVERY_RESPONSE) { RTW_INFO("[TDLS] Recv %s from "MAC_FMT"\n", rtw_tdls_action_txt(TDLS_DISCOVERY_RESPONSE), MAC_ARG(get_addr2_ptr(pframe))); @@ -1338,7 +1338,7 @@ void mgt_dispatcher(_adapter *padapter, union recv_frame *precv_frame) #ifdef CONFIG_AP_MODE switch (get_frame_sub_type(pframe)) { - case WIFI_AUTH: + case IEEE80211_STYPE_AUTH: if (MLME_IS_AP(padapter) || MLME_IS_MESH(padapter)) ptable->func = &OnAuth; else @@ -1348,25 +1348,25 @@ void mgt_dispatcher(_adapter *padapter, union recv_frame *precv_frame) #else __attribute__ ((__fallthrough__)); #endif - case WIFI_ASSOCREQ: - case WIFI_REASSOCREQ: + case IEEE80211_STYPE_ASSOC_REQ: + case IEEE80211_STYPE_REASSOC_REQ: _mgt_dispatcher(padapter, ptable, precv_frame); #ifdef CONFIG_HOSTAPD_MLME if (MLME_IS_AP(padapter)) rtw_hostapd_mlme_rx(padapter, precv_frame); #endif break; - case WIFI_PROBEREQ: + case IEEE80211_STYPE_PROBE_REQ: _mgt_dispatcher(padapter, ptable, precv_frame); #ifdef CONFIG_HOSTAPD_MLME if (MLME_IS_AP(padapter)) rtw_hostapd_mlme_rx(padapter, precv_frame); #endif break; - case WIFI_BEACON: + case IEEE80211_STYPE_BEACON: _mgt_dispatcher(padapter, ptable, precv_frame); break; - case WIFI_ACTION: + case IEEE80211_STYPE_ACTION: _mgt_dispatcher(padapter, ptable, precv_frame); break; default: @@ -1498,7 +1498,7 @@ unsigned int OnProbeReq(_adapter *padapter, union recv_frame *precv_frame) if (padapter->wdinfo.driver_interface == DRIVER_WEXT) report_survey_event(padapter, precv_frame); - p2p_listen_state_process(padapter, get_sa(pframe)); + p2p_listen_state_process(padapter, ieee80211_get_SA((struct ieee80211_hdr *)pframe)); return _SUCCESS; } @@ -1532,10 +1532,10 @@ _continue: target_ie = rtw_get_wps_attr_content(wps_ie, wps_ielen, WPS_ATTR_MANUFACTURER, NULL, &target_ielen); if ((target_ie && (target_ielen == 4)) && (_TRUE == _rtw_memcmp((void *)target_ie, "Ozmo", 4))) { /* psta->flag_atmel_rc = 1; */ - unsigned char *sa_addr = get_sa(pframe); + unsigned char *sa_addr = ieee80211_get_SA((struct ieee80211_hdr *)pframe); printk("%s: Find Ozmo RC -- %02x:%02x:%02x:%02x:%02x:%02x \n\n", __func__, *sa_addr, *(sa_addr + 1), *(sa_addr + 2), *(sa_addr + 3), *(sa_addr + 4), *(sa_addr + 5)); - memcpy(pstapriv->atmel_rc_pattern, get_sa(pframe), ETH_ALEN); + memcpy(pstapriv->atmel_rc_pattern, ieee80211_get_SA((struct ieee80211_hdr *)pframe), ETH_ALEN); } #endif @@ -1550,7 +1550,7 @@ _continue: u8 RC_OUI[4] = {0x00, 0xE0, 0x4C, 0x0A}; /* EID[1] + EID_LEN[1] + RC_OUI[4] + MAC[6] + PairingID[2] + ChannelNum[2] */ - p = rtw_get_ie(pframe + WLAN_HDR_A3_LEN + _PROBEREQ_IE_OFFSET_, _VENDOR_SPECIFIC_IE_, (int *)&ielen, + p = rtw_get_ie(pframe + WLAN_HDR_A3_LEN + _PROBEREQ_IE_OFFSET_, WLAN_EID_VENDOR_SPECIFIC, (int *)&ielen, len - WLAN_HDR_A3_LEN - _PROBEREQ_IE_OFFSET_); if (!p || ielen != 14) @@ -1559,21 +1559,21 @@ _continue: if (!_rtw_memcmp(p + 2, RC_OUI, sizeof(RC_OUI))) goto _non_rc_device; - if (!_rtw_memcmp(p + 6, get_sa(pframe), ETH_ALEN)) { + if (!_rtw_memcmp(p + 6, ieee80211_get_SA((struct ieee80211_hdr *)pframe), ETH_ALEN)) { RTW_INFO("%s, do rc pairing ("MAC_FMT"), but mac addr mismatch!("MAC_FMT")\n", __FUNCTION__, - MAC_ARG(get_sa(pframe)), MAC_ARG(p + 6)); + MAC_ARG(ieee80211_get_SA((struct ieee80211_hdr *)pframe)), MAC_ARG(p + 6)); goto _non_rc_device; } - RTW_INFO("%s, got the pairing device("MAC_FMT")\n", __FUNCTION__, MAC_ARG(get_sa(pframe))); + RTW_INFO("%s, got the pairing device("MAC_FMT")\n", __FUNCTION__, MAC_ARG(ieee80211_get_SA((struct ieee80211_hdr *)pframe))); /* new a station */ - psta = rtw_get_stainfo(pstapriv, get_sa(pframe)); + psta = rtw_get_stainfo(pstapriv, ieee80211_get_SA((struct ieee80211_hdr *)pframe)); if (psta == NULL) { /* allocate a new one */ - RTW_INFO("going to alloc stainfo for rc="MAC_FMT"\n", MAC_ARG(get_sa(pframe))); - psta = rtw_alloc_stainfo(pstapriv, get_sa(pframe)); + RTW_INFO("going to alloc stainfo for rc="MAC_FMT"\n", MAC_ARG(ieee80211_get_SA((struct ieee80211_hdr *)pframe))); + psta = rtw_alloc_stainfo(pstapriv, ieee80211_get_SA((struct ieee80211_hdr *)pframe)); if (psta == NULL) { /* TODO: */ RTW_INFO(" Exceed the upper limit of supported clients...\n"); @@ -1635,7 +1635,7 @@ _continue: } - issue_probersp(padapter, get_sa(pframe), _FALSE); + issue_probersp(padapter, ieee80211_get_SA((struct ieee80211_hdr *)pframe), _FALSE); return _SUCCESS; @@ -1656,7 +1656,7 @@ _non_rc_device: } #endif - p = rtw_get_ie(pframe + WLAN_HDR_A3_LEN + _PROBEREQ_IE_OFFSET_, _SSID_IE_, (int *)&ielen, + p = rtw_get_ie(pframe + WLAN_HDR_A3_LEN + _PROBEREQ_IE_OFFSET_, WLAN_EID_SSID, (int *)&ielen, len - WLAN_HDR_A3_LEN - _PROBEREQ_IE_OFFSET_); @@ -1685,7 +1685,7 @@ _issue_probersp: if (((check_fwstate(pmlmepriv, _FW_LINKED) == _TRUE && pmlmepriv->cur_network.join_res == _TRUE)) || check_fwstate(pmlmepriv, WIFI_ADHOC_MASTER_STATE)) { /* RTW_INFO("+issue_probersp during ap mode\n"); */ - issue_probersp(padapter, get_sa(pframe), is_valid_p2p_probereq); + issue_probersp(padapter, ieee80211_get_SA((struct ieee80211_hdr *)pframe), is_valid_p2p_probereq); } } @@ -2111,14 +2111,14 @@ unsigned int OnAuth(_adapter *padapter, union recv_frame *precv_frame) RTW_INFO("auth rejected due to bad alg [alg=%d, auth_mib=%d] %02X%02X%02X%02X%02X%02X\n", algorithm, auth_mode, sa[0], sa[1], sa[2], sa[3], sa[4], sa[5]); - status = _STATS_NO_SUPP_ALG_; + status = WLAN_STATUS_NOT_SUPPORTED_AUTH_ALG; goto auth_fail; } #if CONFIG_RTW_MACADDR_ACL if (rtw_access_ctrl(padapter, sa) == _FALSE) { - status = _STATS_UNABLE_HANDLE_STA_; + status = WLAN_STATUS_AP_UNABLE_TO_HANDLE_NEW_STA; goto auth_fail; } #endif @@ -2131,7 +2131,7 @@ unsigned int OnAuth(_adapter *padapter, union recv_frame *precv_frame) pstat = rtw_alloc_stainfo(pstapriv, sa); if (pstat == NULL) { RTW_INFO(" Exceed the upper limit of supported clients...\n"); - status = _STATS_UNABLE_HANDLE_STA_; + status = WLAN_STATUS_AP_UNABLE_TO_HANDLE_NEW_STA; goto auth_fail; } @@ -2192,7 +2192,7 @@ unsigned int OnAuth(_adapter *padapter, union recv_frame *precv_frame) if ((pstat->auth_seq + 1) != seq) { RTW_INFO("(1)auth rejected because out of seq [rx_seq=%d, exp_seq=%d]!\n", seq, pstat->auth_seq + 1); - status = _STATS_OUT_OF_AUTH_SEQ_; + status = WLAN_STATUS_UNKNOWN_AUTH_TRANSACTION; goto auth_fail; } @@ -2210,7 +2210,7 @@ unsigned int OnAuth(_adapter *padapter, union recv_frame *precv_frame) } else { RTW_INFO("(2)auth rejected because out of seq [rx_seq=%d, exp_seq=%d]!\n", seq, pstat->auth_seq + 1); - status = _STATS_OUT_OF_AUTH_SEQ_; + status = WLAN_STATUS_UNKNOWN_AUTH_TRANSACTION; goto auth_fail; } } else { /* shared system or auto authentication */ @@ -2232,12 +2232,12 @@ unsigned int OnAuth(_adapter *padapter, union recv_frame *precv_frame) /* checking for challenging txt... */ RTW_INFO("checking for challenging txt...\n"); - p = rtw_get_ie(pframe + WLAN_HDR_A3_LEN + 4 + _AUTH_IE_OFFSET_ , _CHLGETXT_IE_, (int *)&ie_len, + p = rtw_get_ie(pframe + WLAN_HDR_A3_LEN + 4 + _AUTH_IE_OFFSET_ , WLAN_EID_CHALLENGE, (int *)&ie_len, len - WLAN_HDR_A3_LEN - _AUTH_IE_OFFSET_ - 4); if ((p == NULL) || (ie_len <= 0)) { RTW_INFO("auth rejected because challenge failure!(1)\n"); - status = _STATS_CHALLENGE_FAIL_; + status = WLAN_STATUS_CHALLENGE_FAIL; goto auth_fail; } @@ -2253,13 +2253,13 @@ unsigned int OnAuth(_adapter *padapter, union recv_frame *precv_frame) } } else { RTW_INFO("auth rejected because challenge failure!\n"); - status = _STATS_CHALLENGE_FAIL_; + status = WLAN_STATUS_CHALLENGE_FAIL; goto auth_fail; } } else { RTW_INFO("(3)auth rejected because out of seq [rx_seq=%d, exp_seq=%d]!\n", seq, pstat->auth_seq + 1); - status = _STATS_OUT_OF_AUTH_SEQ_; + status = WLAN_STATUS_UNKNOWN_AUTH_TRANSACTION; goto auth_fail; } } @@ -2269,7 +2269,7 @@ unsigned int OnAuth(_adapter *padapter, union recv_frame *precv_frame) pstat->auth_seq = seq + 1; #ifdef CONFIG_NATIVEAP_MLME - issue_auth(padapter, pstat, (unsigned short)(_STATS_SUCCESSFUL_)); + issue_auth(padapter, pstat, (unsigned short)(WLAN_STATUS_SUCCESS)); #endif if ((pstat->state & WIFI_FW_AUTH_SUCCESS) || (pstat->state & WIFI_FW_ASSOC_SUCCESS)) @@ -2325,7 +2325,7 @@ normal: #endif /* CONFIG_IOCTL_CFG80211 */ /* check A1 matches or not */ - if (!_rtw_memcmp(adapter_mac_addr(padapter), get_da(pframe), ETH_ALEN)) + if (!_rtw_memcmp(adapter_mac_addr(padapter), ieee80211_get_DA((struct ieee80211_hdr *)pframe), ETH_ALEN)) return _SUCCESS; if (!(pmlmeinfo->state & WIFI_FW_AUTH_STATE) || pmlmeext->join_abort) @@ -2355,7 +2355,7 @@ normal: if (seq == 2) { if (pmlmeinfo->auth_algo == dot11AuthAlgrthm_Shared) { /* legendary shared system */ - p = rtw_get_ie(pframe + WLAN_HDR_A3_LEN + _AUTH_IE_OFFSET_, _CHLGETXT_IE_, (int *)&len, + p = rtw_get_ie(pframe + WLAN_HDR_A3_LEN + _AUTH_IE_OFFSET_, WLAN_EID_CHALLENGE, (int *)&len, pkt_len - WLAN_HDR_A3_LEN - _AUTH_IE_OFFSET_); if (p == NULL) { @@ -2411,7 +2411,7 @@ unsigned int OnAssocReq(_adapter *padapter, union recv_frame *precv_frame) struct sta_info *pstat; unsigned char reassoc, *pos; int left; - unsigned short status = _STATS_SUCCESSFUL_; + unsigned short status = WLAN_STATUS_SUCCESS; unsigned short frame_type, ie_offset = 0; struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv; struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info); @@ -2438,10 +2438,10 @@ unsigned int OnAssocReq(_adapter *padapter, union recv_frame *precv_frame) return _FAIL; frame_type = get_frame_sub_type(pframe); - if (frame_type == WIFI_ASSOCREQ) { + if (frame_type == IEEE80211_STYPE_ASSOC_REQ) { reassoc = 0; ie_offset = _ASOCREQ_IE_OFFSET_; - } else { /* WIFI_REASSOCREQ */ + } else { /* IEEE80211_STYPE_REASSOC_REQ */ reassoc = 1; ie_offset = _REASOCREQ_IE_OFFSET_; } @@ -2455,7 +2455,7 @@ unsigned int OnAssocReq(_adapter *padapter, union recv_frame *precv_frame) pstat = rtw_get_stainfo(pstapriv, get_addr2_ptr(pframe)); if (pstat == (struct sta_info *)NULL) { - status = _RSON_CLS2_; + status = WLAN_REASON_CLASS2_FRAME_FROM_NONAUTH_STA; goto asoc_class2_error; } @@ -2475,7 +2475,7 @@ unsigned int OnAssocReq(_adapter *padapter, union recv_frame *precv_frame) /* check if this stat has been successfully authenticated/assocated */ if (!((pstat->state) & WIFI_FW_AUTH_SUCCESS)) { if (!((pstat->state) & WIFI_FW_ASSOC_SUCCESS)) { - status = _RSON_CLS2_; + status = WLAN_REASON_CLASS2_FRAME_FROM_NONAUTH_STA; goto asoc_class2_error; } else { pstat->state &= (~WIFI_FW_ASSOC_SUCCESS); @@ -2506,7 +2506,7 @@ unsigned int OnAssocReq(_adapter *padapter, union recv_frame *precv_frame) if (rtw_ieee802_11_parse_elems(pos, left, &elems, 1) == ParseFailed) { RTW_INFO("STA " MAC_FMT " sent invalid association request\n", MAC_ARG(pstat->cmn.mac_addr)); - status = _STATS_FAILURE_; + status = WLAN_STATUS_UNSPECIFIED_FAILURE; goto OnAssocReqFail; } @@ -2534,19 +2534,19 @@ unsigned int OnAssocReq(_adapter *padapter, union recv_frame *precv_frame) || elems.ssid_len != cur->Ssid.SsidLength || _rtw_memcmp(elems.ssid, cur->Ssid.Ssid, cur->Ssid.SsidLength) == _FALSE ) { - status = _STATS_FAILURE_; + status = WLAN_STATUS_UNSPECIFIED_FAILURE; goto OnAssocReqFail; } /* (Extended) Supported rates */ status = rtw_ap_parse_sta_supported_rates(padapter, pstat , pframe + WLAN_HDR_A3_LEN + ie_offset, pkt_len - WLAN_HDR_A3_LEN - ie_offset); - if (status != _STATS_SUCCESSFUL_) + if (status != WLAN_STATUS_SUCCESS) goto OnAssocReqFail; /* check RSN/WPA/WPS */ status = rtw_ap_parse_sta_security_ie(padapter, pstat, &elems); - if (status != _STATS_SUCCESSFUL_) + if (status != WLAN_STATUS_SUCCESS) goto OnAssocReqFail; /* check if there is WMM IE & support WWM-PS */ @@ -2575,7 +2575,7 @@ unsigned int OnAssocReq(_adapter *padapter, union recv_frame *precv_frame) */ } - if (status != _STATS_SUCCESSFUL_) + if (status != WLAN_STATUS_SUCCESS) goto OnAssocReqFail; #ifdef CONFIG_P2P @@ -2587,7 +2587,7 @@ unsigned int OnAssocReq(_adapter *padapter, union recv_frame *precv_frame) p2p_status_code = (u8)process_assoc_req_p2p_ie(pwdinfo, pframe, pkt_len, pstat); if (p2p_status_code > 0) { pstat->p2p_status_code = p2p_status_code; - status = _STATS_CAP_FAIL_; + status = WLAN_STATUS_CAPS_UNSUPPORTED; goto OnAssocReqFail; } } @@ -2650,7 +2650,7 @@ unsigned int OnAssocReq(_adapter *padapter, union recv_frame *precv_frame) } /* now the station is qualified to join our BSS... */ - if (pstat && (pstat->state & WIFI_FW_ASSOC_SUCCESS) && (_STATS_SUCCESSFUL_ == status)) { + if (pstat && (pstat->state & WIFI_FW_ASSOC_SUCCESS) && (WLAN_STATUS_SUCCESS == status)) { #ifdef CONFIG_NATIVEAP_MLME #ifdef CONFIG_IEEE80211W if (pstat->bpairwise_key_installed != _TRUE) @@ -2665,10 +2665,10 @@ unsigned int OnAssocReq(_adapter *padapter, union recv_frame *precv_frame) status = _STATS_REFUSED_TEMPORARILY_; #endif /* CONFIG_IEEE80211W */ /* .2 issue assoc rsp before notify station join event. */ - if (frame_type == WIFI_ASSOCREQ) - issue_asocrsp(padapter, status, pstat, WIFI_ASSOCRSP); + if (frame_type == IEEE80211_STYPE_ASSOC_REQ) + issue_asocrsp(padapter, status, pstat, IEEE80211_STYPE_ASSOC_RESP); else - issue_asocrsp(padapter, status, pstat, WIFI_REASSOCRSP); + issue_asocrsp(padapter, status, pstat, IEEE80211_STYPE_REASSOC_RESP); #ifdef CONFIG_IOCTL_CFG80211 _enter_critical_bh(&pstat->lock, &irqL); @@ -2716,10 +2716,10 @@ OnAssocReqFail: #ifdef CONFIG_NATIVEAP_MLME pstat->cmn.aid = 0; - if (frame_type == WIFI_ASSOCREQ) - issue_asocrsp(padapter, status, pstat, WIFI_ASSOCRSP); + if (frame_type == IEEE80211_STYPE_ASSOC_REQ) + issue_asocrsp(padapter, status, pstat, IEEE80211_STYPE_ASSOC_RESP); else - issue_asocrsp(padapter, status, pstat, WIFI_REASSOCRSP); + issue_asocrsp(padapter, status, pstat, IEEE80211_STYPE_REASSOC_RESP); #endif @@ -2776,7 +2776,7 @@ unsigned int OnAssocRsp(_adapter *padapter, union recv_frame *precv_frame) RTW_INFO("%s\n", __FUNCTION__); /* check A1 matches or not */ - if (!_rtw_memcmp(adapter_mac_addr(padapter), get_da(pframe), ETH_ALEN)) + if (!_rtw_memcmp(adapter_mac_addr(padapter), ieee80211_get_DA((struct ieee80211_hdr *)pframe), ETH_ALEN)) return _SUCCESS; if (!(pmlmeinfo->state & (WIFI_FW_AUTH_SUCCESS | WIFI_FW_ASSOC_STATE)) || pmlmeext->join_abort) @@ -2820,7 +2820,7 @@ unsigned int OnAssocRsp(_adapter *padapter, union recv_frame *precv_frame) pIE = (PNDIS_802_11_VARIABLE_IEs)(pframe + i); switch (pIE->ElementID) { - case _VENDOR_SPECIFIC_IE_: + case WLAN_EID_VENDOR_SPECIFIC: if (_rtw_memcmp(pIE->data, WMM_PARA_OUI, 6)) /* WMM */ WMM_param_handler(padapter, pIE); #if defined(CONFIG_P2P) && defined(CONFIG_WFD) @@ -2830,19 +2830,19 @@ unsigned int OnAssocRsp(_adapter *padapter, union recv_frame *precv_frame) break; #ifdef CONFIG_WAPI_SUPPORT - case _WAPI_IE_: + case WLAN_EID_BSS_AC_ACCESS_DELAY: pWapiIE = pIE; break; #endif - case _HT_CAPABILITY_IE_: /* HT caps */ + case WLAN_EID_HT_CAPABILITY: /* HT caps */ HT_caps_handler(padapter, pIE); #ifdef ROKU_PRIVATE HT_caps_handler_infra_ap(padapter, pIE); #endif /* ROKU_PRIVATE */ break; - case _HT_EXTRA_INFO_IE_: /* HT info */ + case WLAN_EID_HT_OPERATION: /* HT info */ HT_info_handler(padapter, pIE); break; @@ -2859,11 +2859,11 @@ unsigned int OnAssocRsp(_adapter *padapter, union recv_frame *precv_frame) break; #endif - case _ERPINFO_IE_: + case WLAN_EID_ERP_INFO: ERP_IE_handler(padapter, pIE); break; #ifdef CONFIG_TDLS - case _EXT_CAP_IE_: + case WLAN_EID_EXT_CAPABILITY : if (check_ap_tdls_prohibited(pIE->data, pIE->Length) == _TRUE) padapter->tdlsinfo.ap_prohibited = _TRUE; if (check_ap_tdls_ch_switching_prohibited(pIE->data, pIE->Length) == _TRUE) @@ -2872,18 +2872,18 @@ unsigned int OnAssocRsp(_adapter *padapter, union recv_frame *precv_frame) #endif /* CONFIG_TDLS */ #ifdef CONFIG_RTW_80211K - case _EID_RRM_EN_CAP_IE_: + case WLAN_EID_RRM_ENABLED_CAPABILITIES : RM_IE_handler(padapter, pIE); break; #endif #ifdef ROKU_PRIVATE /* Infra mode, used to store AP's info , Parse the supported rates from AssocRsp */ - case _SUPPORTEDRATES_IE_: + case WLAN_EID_SUPP_RATES: Supported_rate_infra_ap(padapter, pIE); break; - case _EXT_SUPPORTEDRATES_IE_: + case WLAN_EID_EXT_SUPP_RATES: Extended_Supported_rate_infra_ap(padapter, pIE); break; #endif /* ROKU_PRIVATE */ @@ -3255,7 +3255,7 @@ exit: u8 rtw_rx_ampdu_size(_adapter *adapter) { u8 size; - HT_CAP_AMPDU_FACTOR max_rx_ampdu_factor; + enum ieee80211_max_ampdu_length_exp max_rx_ampdu_factor; #ifdef CONFIG_BT_COEXIST if (rtw_btcoex_IsBTCoexCtrlAMPDUSize(adapter) == _TRUE) { @@ -3275,7 +3275,7 @@ u8 rtw_rx_ampdu_size(_adapter *adapter) /* default value based on max_rx_ampdu_factor */ if (adapter->driver_rx_ampdu_factor != 0xFF) - max_rx_ampdu_factor = (HT_CAP_AMPDU_FACTOR)adapter->driver_rx_ampdu_factor; + max_rx_ampdu_factor = (enum ieee80211_max_ampdu_length_exp)adapter->driver_rx_ampdu_factor; else rtw_hal_get_def_var(adapter, HW_VAR_MAX_RX_AMPDU_FACTOR, &max_rx_ampdu_factor); @@ -3286,13 +3286,13 @@ u8 rtw_rx_ampdu_size(_adapter *adapter) MSDU or AMSDU. The size variable means how many MSDUs or AMSDUs, it's not Kbytes. */ - if (MAX_AMPDU_FACTOR_64K == max_rx_ampdu_factor) + if (IEEE80211_HT_MAX_AMPDU_64K == max_rx_ampdu_factor) size = 64; - else if (MAX_AMPDU_FACTOR_32K == max_rx_ampdu_factor) + else if (IEEE80211_HT_MAX_AMPDU_32K == max_rx_ampdu_factor) size = 32; - else if (MAX_AMPDU_FACTOR_16K == max_rx_ampdu_factor) + else if (IEEE80211_HT_MAX_AMPDU_16K == max_rx_ampdu_factor) size = 16; - else if (MAX_AMPDU_FACTOR_8K == max_rx_ampdu_factor) + else if (IEEE80211_HT_MAX_AMPDU_8K == max_rx_ampdu_factor) size = 8; else size = 64; @@ -3473,7 +3473,7 @@ u8 rx_ampdu_size_sta_limit(_adapter *adapter, struct sta_info *sta) #endif if (is_supported_ht(sta->wireless_mode)) { nss = rtw_min(rtw_ht_mcsset_to_nss(mlmeinfo->HT_caps.u.HT_cap_element.MCS_rate) - , rtw_ht_mcsset_to_nss(sta->htpriv.ht_cap.supp_mcs_set)); + , rtw_ht_mcsset_to_nss(sta->htpriv.ht_cap.mcs.rx_mask)); } if (nss >= 1) @@ -3549,7 +3549,7 @@ u16 rtw_rx_ampdu_apply(_adapter *adapter) phead = &pstapriv->asoc_list; plist = get_next(phead); - while ((rtw_end_of_queue_search(phead, plist)) == _FALSE) { + while (phead != plist) { int stainfo_offset; sta = LIST_CONTAINOR(plist, struct sta_info, asoc_list); @@ -3603,7 +3603,7 @@ unsigned int OnAction_back(_adapter *padapter, union recv_frame *precv_frame) #if 0 /* check A1 matches or not */ - if (!_rtw_memcmp(adapter_mac_addr(padapter), get_da(pframe), ETH_ALEN)) + if (!_rtw_memcmp(adapter_mac_addr(padapter), ieee80211_get_DA((struct ieee80211_hdr *)pframe), ETH_ALEN)) return _SUCCESS; #endif @@ -3779,7 +3779,7 @@ void issue_p2p_GO_request(_adapter *padapter, u8 *raddr) SetSeqNum(pwlanhdr, pmlmeext->mgnt_seq); pmlmeext->mgnt_seq++; - set_frame_sub_type(pframe, WIFI_ACTION); + set_frame_sub_type(pframe, IEEE80211_STYPE_ACTION); pframe += sizeof(struct rtw_ieee80211_hdr_3addr); pattrib->pktlen = sizeof(struct rtw_ieee80211_hdr_3addr); @@ -3831,7 +3831,7 @@ void issue_p2p_GO_request(_adapter *padapter, u8 *raddr) wpsielen += 2; - pframe = rtw_set_ie(pframe, _VENDOR_SPECIFIC_IE_, wpsielen, (unsigned char *) wpsie, &pattrib->pktlen); + pframe = rtw_set_ie(pframe, WLAN_EID_VENDOR_SPECIFIC, wpsielen, (unsigned char *) wpsie, &pattrib->pktlen); /* P2P IE Section. */ @@ -4111,7 +4111,7 @@ void issue_p2p_GO_request(_adapter *padapter, u8 *raddr) /* Channel Number */ p2pie[p2pielen++] = pwdinfo->operating_channel; /* operating channel number */ - pframe = rtw_set_ie(pframe, _VENDOR_SPECIFIC_IE_, p2pielen, (unsigned char *) p2pie, &pattrib->pktlen); + pframe = rtw_set_ie(pframe, WLAN_EID_VENDOR_SPECIFIC, p2pielen, (unsigned char *) p2pie, &pattrib->pktlen); #ifdef CONFIG_WFD wfdielen = build_nego_req_wfd_ie(pwdinfo, pframe); @@ -4178,7 +4178,7 @@ void issue_p2p_GO_response(_adapter *padapter, u8 *raddr, u8 *frame_body, uint l SetSeqNum(pwlanhdr, pmlmeext->mgnt_seq); pmlmeext->mgnt_seq++; - set_frame_sub_type(pframe, WIFI_ACTION); + set_frame_sub_type(pframe, IEEE80211_STYPE_ACTION); pframe += sizeof(struct rtw_ieee80211_hdr_3addr); pattrib->pktlen = sizeof(struct rtw_ieee80211_hdr_3addr); @@ -4248,7 +4248,7 @@ void issue_p2p_GO_response(_adapter *padapter, u8 *raddr, u8 *frame_body, uint l memcpy(pwdinfo->rx_prov_disc_info.strconfig_method_desc_of_prov_disc_req, "pbc", 3); } - pframe = rtw_set_ie(pframe, _VENDOR_SPECIFIC_IE_, wpsielen, (unsigned char *) wpsie, &pattrib->pktlen); + pframe = rtw_set_ie(pframe, WLAN_EID_VENDOR_SPECIFIC, wpsielen, (unsigned char *) wpsie, &pattrib->pktlen); /* P2P IE Section. */ @@ -4529,7 +4529,7 @@ void issue_p2p_GO_response(_adapter *padapter, u8 *raddr, u8 *frame_body, uint l } - pframe = rtw_set_ie(pframe, _VENDOR_SPECIFIC_IE_, p2pielen, (unsigned char *) p2pie, &pattrib->pktlen); + pframe = rtw_set_ie(pframe, WLAN_EID_VENDOR_SPECIFIC, p2pielen, (unsigned char *) p2pie, &pattrib->pktlen); #ifdef CONFIG_WFD wfdielen = build_nego_resp_wfd_ie(pwdinfo, pframe); @@ -4590,7 +4590,7 @@ void issue_p2p_GO_confirm(_adapter *padapter, u8 *raddr, u8 result) SetSeqNum(pwlanhdr, pmlmeext->mgnt_seq); pmlmeext->mgnt_seq++; - set_frame_sub_type(pframe, WIFI_ACTION); + set_frame_sub_type(pframe, IEEE80211_STYPE_ACTION); pframe += sizeof(struct rtw_ieee80211_hdr_3addr); pattrib->pktlen = sizeof(struct rtw_ieee80211_hdr_3addr); @@ -4763,7 +4763,7 @@ void issue_p2p_GO_confirm(_adapter *padapter, u8 *raddr, u8 result) p2pielen += pwdinfo->nego_ssidlen; } - pframe = rtw_set_ie(pframe, _VENDOR_SPECIFIC_IE_, p2pielen, (unsigned char *) p2pie, &pattrib->pktlen); + pframe = rtw_set_ie(pframe, WLAN_EID_VENDOR_SPECIFIC, p2pielen, (unsigned char *) p2pie, &pattrib->pktlen); #ifdef CONFIG_WFD wfdielen = build_nego_confirm_wfd_ie(pwdinfo, pframe); @@ -4826,7 +4826,7 @@ void issue_p2p_invitation_request(_adapter *padapter, u8 *raddr) SetSeqNum(pwlanhdr, pmlmeext->mgnt_seq); pmlmeext->mgnt_seq++; - set_frame_sub_type(pframe, WIFI_ACTION); + set_frame_sub_type(pframe, IEEE80211_STYPE_ACTION); pframe += sizeof(struct rtw_ieee80211_hdr_3addr); pattrib->pktlen = sizeof(struct rtw_ieee80211_hdr_3addr); @@ -5061,7 +5061,7 @@ void issue_p2p_invitation_request(_adapter *padapter, u8 *raddr) memcpy(p2pie + p2pielen, pwdinfo->device_name, pwdinfo->device_name_len); p2pielen += pwdinfo->device_name_len; - pframe = rtw_set_ie(pframe, _VENDOR_SPECIFIC_IE_, p2pielen, (unsigned char *) p2pie, &pattrib->pktlen); + pframe = rtw_set_ie(pframe, WLAN_EID_VENDOR_SPECIFIC, p2pielen, (unsigned char *) p2pie, &pattrib->pktlen); #ifdef CONFIG_WFD wfdielen = build_invitation_req_wfd_ie(pwdinfo, pframe); @@ -5123,7 +5123,7 @@ void issue_p2p_invitation_response(_adapter *padapter, u8 *raddr, u8 dialogToken SetSeqNum(pwlanhdr, pmlmeext->mgnt_seq); pmlmeext->mgnt_seq++; - set_frame_sub_type(pframe, WIFI_ACTION); + set_frame_sub_type(pframe, IEEE80211_STYPE_ACTION); pframe += sizeof(struct rtw_ieee80211_hdr_3addr); pattrib->pktlen = sizeof(struct rtw_ieee80211_hdr_3addr); @@ -5296,7 +5296,7 @@ void issue_p2p_invitation_response(_adapter *padapter, u8 *raddr, u8 dialogToken } } - pframe = rtw_set_ie(pframe, _VENDOR_SPECIFIC_IE_, p2pielen, (unsigned char *) p2pie, &pattrib->pktlen); + pframe = rtw_set_ie(pframe, WLAN_EID_VENDOR_SPECIFIC, p2pielen, (unsigned char *) p2pie, &pattrib->pktlen); #ifdef CONFIG_WFD wfdielen = build_invitation_resp_wfd_ie(pwdinfo, pframe); @@ -5359,7 +5359,7 @@ void issue_p2p_provision_request(_adapter *padapter, u8 *pssid, u8 ussidlen, u8 SetSeqNum(pwlanhdr, pmlmeext->mgnt_seq); pmlmeext->mgnt_seq++; - set_frame_sub_type(pframe, WIFI_ACTION); + set_frame_sub_type(pframe, IEEE80211_STYPE_ACTION); pframe += sizeof(struct rtw_ieee80211_hdr_3addr); pattrib->pktlen = sizeof(struct rtw_ieee80211_hdr_3addr); @@ -5405,7 +5405,7 @@ void issue_p2p_provision_request(_adapter *padapter, u8 *pssid, u8 ussidlen, u8 *(u16 *)(wpsie + wpsielen) = cpu_to_be16(pwdinfo->tx_prov_disc_info.wps_config_method_request); wpsielen += 2; - pframe = rtw_set_ie(pframe, _VENDOR_SPECIFIC_IE_, wpsielen, (unsigned char *) wpsie, &pattrib->pktlen); + pframe = rtw_set_ie(pframe, WLAN_EID_VENDOR_SPECIFIC, wpsielen, (unsigned char *) wpsie, &pattrib->pktlen); #ifdef CONFIG_WFD @@ -5500,7 +5500,7 @@ void issue_probersp_p2p(_adapter *padapter, unsigned char *da) SetSeqNum(pwlanhdr, pmlmeext->mgnt_seq); pmlmeext->mgnt_seq++; - set_frame_sub_type(fctrl, WIFI_PROBERSP); + set_frame_sub_type(fctrl, IEEE80211_STYPE_PROBE_RESP); pattrib->hdrlen = sizeof(struct rtw_ieee80211_hdr_3addr); pattrib->pktlen = pattrib->hdrlen; @@ -5526,14 +5526,14 @@ void issue_probersp_p2p(_adapter *padapter, unsigned char *da) /* SSID */ - pframe = rtw_set_ie(pframe, _SSID_IE_, 7, pwdinfo->p2p_wildcard_ssid, &pattrib->pktlen); + pframe = rtw_set_ie(pframe, WLAN_EID_SSID, 7, pwdinfo->p2p_wildcard_ssid, &pattrib->pktlen); /* supported rates... */ /* Use the OFDM rate in the P2P probe response frame. ( 6(B), 9(B), 12, 18, 24, 36, 48, 54 ) */ - pframe = rtw_set_ie(pframe, _SUPPORTEDRATES_IE_, 8, pwdinfo->support_rate, &pattrib->pktlen); + pframe = rtw_set_ie(pframe, WLAN_EID_SUPP_RATES, 8, pwdinfo->support_rate, &pattrib->pktlen); /* DS parameter set */ - pframe = rtw_set_ie(pframe, _DSSET_IE_, 1, (unsigned char *)&pwdinfo->listen_channel, &pattrib->pktlen); + pframe = rtw_set_ie(pframe, WLAN_EID_DS_PARAMS, 1, (unsigned char *)&pwdinfo->listen_channel, &pattrib->pktlen); #ifdef CONFIG_IOCTL_CFG80211 if (adapter_wdev_data(padapter)->p2p_enabled && pwdinfo->driver_interface == DRIVER_CFG80211) { @@ -5747,7 +5747,7 @@ void issue_probersp_p2p(_adapter *padapter, unsigned char *da) wpsielen += 2; - pframe = rtw_set_ie(pframe, _VENDOR_SPECIFIC_IE_, wpsielen, (unsigned char *) wpsie, &pattrib->pktlen); + pframe = rtw_set_ie(pframe, WLAN_EID_VENDOR_SPECIFIC, wpsielen, (unsigned char *) wpsie, &pattrib->pktlen); p2pielen = build_probe_resp_p2p_ie(pwdinfo, pframe); @@ -5839,17 +5839,17 @@ int _issue_probereq_p2p(_adapter *padapter, u8 *da, int wait_ack) SetSeqNum(pwlanhdr, pmlmeext->mgnt_seq); pmlmeext->mgnt_seq++; - set_frame_sub_type(pframe, WIFI_PROBEREQ); + set_frame_sub_type(pframe, IEEE80211_STYPE_PROBE_REQ); pframe += sizeof(struct rtw_ieee80211_hdr_3addr); pattrib->pktlen = sizeof(struct rtw_ieee80211_hdr_3addr); if (rtw_p2p_chk_state(pwdinfo, P2P_STATE_TX_PROVISION_DIS_REQ)) - pframe = rtw_set_ie(pframe, _SSID_IE_, pwdinfo->tx_prov_disc_info.ssid.SsidLength, pwdinfo->tx_prov_disc_info.ssid.Ssid, &(pattrib->pktlen)); + pframe = rtw_set_ie(pframe, WLAN_EID_SSID, pwdinfo->tx_prov_disc_info.ssid.SsidLength, pwdinfo->tx_prov_disc_info.ssid.Ssid, &(pattrib->pktlen)); else - pframe = rtw_set_ie(pframe, _SSID_IE_, P2P_WILDCARD_SSID_LEN, pwdinfo->p2p_wildcard_ssid, &(pattrib->pktlen)); + pframe = rtw_set_ie(pframe, WLAN_EID_SSID, P2P_WILDCARD_SSID_LEN, pwdinfo->p2p_wildcard_ssid, &(pattrib->pktlen)); /* Use the OFDM rate in the P2P probe request frame. ( 6(B), 9(B), 12(B), 24(B), 36, 48, 54 ) */ - pframe = rtw_set_ie(pframe, _SUPPORTEDRATES_IE_, 8, pwdinfo->support_rate, &pattrib->pktlen); + pframe = rtw_set_ie(pframe, WLAN_EID_SUPP_RATES, 8, pwdinfo->support_rate, &pattrib->pktlen); #ifdef CONFIG_IOCTL_CFG80211 if (adapter_wdev_data(padapter)->p2p_enabled && pwdinfo->driver_interface == DRIVER_CFG80211) { @@ -5969,7 +5969,7 @@ int _issue_probereq_p2p(_adapter *padapter, u8 *da, int wait_ack) *(u16 *)(wpsie + wpsielen) = cpu_to_be16(WPS_DPID_REGISTRAR_SPEC); /* Registrar-specified */ wpsielen += 2; - pframe = rtw_set_ie(pframe, _VENDOR_SPECIFIC_IE_, wpsielen, (unsigned char *) wpsie, &pattrib->pktlen); + pframe = rtw_set_ie(pframe, WLAN_EID_VENDOR_SPECIFIC, wpsielen, (unsigned char *) wpsie, &pattrib->pktlen); /* P2P OUI */ p2pielen = 0; @@ -6071,7 +6071,7 @@ int _issue_probereq_p2p(_adapter *padapter, u8 *da, int wait_ack) } - pframe = rtw_set_ie(pframe, _VENDOR_SPECIFIC_IE_, p2pielen, (unsigned char *) p2pie, &pattrib->pktlen); + pframe = rtw_set_ie(pframe, WLAN_EID_VENDOR_SPECIFIC, p2pielen, (unsigned char *) p2pie, &pattrib->pktlen); } @@ -6114,7 +6114,7 @@ int issue_probereq_p2p_ex(_adapter *adapter, u8 *da, int try_cnt, int wait_ms) { int ret; int i = 0; - systime start = rtw_get_current_time(); + systime start = jiffies; do { ret = _issue_probereq_p2p(adapter, da, wait_ms > 0 ? _TRUE : _FALSE); @@ -7160,7 +7160,7 @@ void rtw_wnm_issue_action(_adapter *padapter, u8 action, u8 reason) SetSeqNum(pwlanhdr, pmlmeext->mgnt_seq); pmlmeext->mgnt_seq++; - set_frame_sub_type(pframe, WIFI_ACTION); + set_frame_sub_type(pframe, IEEE80211_STYPE_ACTION); pframe += sizeof(struct rtw_ieee80211_hdr_3addr); pattrib->pktlen = sizeof(struct rtw_ieee80211_hdr_3addr); @@ -7844,7 +7844,7 @@ void issue_beacon(_adapter *padapter, int timeout_ms) SetSeqNum(pwlanhdr, 0/*pmlmeext->mgnt_seq*/); /* pmlmeext->mgnt_seq++; */ - set_frame_sub_type(pframe, WIFI_BEACON); + set_frame_sub_type(pframe, IEEE80211_STYPE_BEACON); pframe += sizeof(struct rtw_ieee80211_hdr_3addr); pattrib->pktlen = sizeof(struct rtw_ieee80211_hdr_3addr); @@ -7974,7 +7974,7 @@ void issue_beacon(_adapter *padapter, int timeout_ms) } #ifdef CONFIG_RTW_80211K - pframe = rtw_set_ie(pframe, _EID_RRM_EN_CAP_IE_, + pframe = rtw_set_ie(pframe, WLAN_EID_RRM_ENABLED_CAPABILITIES , sizeof(padapter->rmpriv.rm_en_cap_def), padapter->rmpriv.rm_en_cap_def, &pattrib->pktlen); #endif @@ -8043,14 +8043,14 @@ void issue_beacon(_adapter *padapter, int timeout_ms) pattrib->pktlen += 2; /* SSID */ - pframe = rtw_set_ie(pframe, _SSID_IE_, cur_network->Ssid.SsidLength, cur_network->Ssid.Ssid, &pattrib->pktlen); + pframe = rtw_set_ie(pframe, WLAN_EID_SSID, cur_network->Ssid.SsidLength, cur_network->Ssid.Ssid, &pattrib->pktlen); /* supported rates... */ rate_len = rtw_get_rateset_len(cur_network->SupportedRates); - pframe = rtw_set_ie(pframe, _SUPPORTEDRATES_IE_, ((rate_len > 8) ? 8 : rate_len), cur_network->SupportedRates, &pattrib->pktlen); + pframe = rtw_set_ie(pframe, WLAN_EID_SUPP_RATES, ((rate_len > 8) ? 8 : rate_len), cur_network->SupportedRates, &pattrib->pktlen); /* DS parameter set */ - pframe = rtw_set_ie(pframe, _DSSET_IE_, 1, (unsigned char *)&(cur_network->Configuration.DSConfig), &pattrib->pktlen); + pframe = rtw_set_ie(pframe, WLAN_EID_DS_PARAMS, 1, (unsigned char *)&(cur_network->Configuration.DSConfig), &pattrib->pktlen); /* if( (pmlmeinfo->state&0x03) == WIFI_FW_ADHOC_STATE) */ { @@ -8059,16 +8059,16 @@ void issue_beacon(_adapter *padapter, int timeout_ms) /* IBSS Parameter Set... */ /* ATIMWindow = cur->Configuration.ATIMWindow; */ ATIMWindow = 0; - pframe = rtw_set_ie(pframe, _IBSS_PARA_IE_, 2, (unsigned char *)(&ATIMWindow), &pattrib->pktlen); + pframe = rtw_set_ie(pframe, WLAN_EID_IBSS_PARAMS, 2, (unsigned char *)(&ATIMWindow), &pattrib->pktlen); /* ERP IE */ - pframe = rtw_set_ie(pframe, _ERPINFO_IE_, 1, &erpinfo, &pattrib->pktlen); + pframe = rtw_set_ie(pframe, WLAN_EID_ERP_INFO, 1, &erpinfo, &pattrib->pktlen); } /* EXTERNDED SUPPORTED RATE */ if (rate_len > 8) - pframe = rtw_set_ie(pframe, _EXT_SUPPORTEDRATES_IE_, (rate_len - 8), (cur_network->SupportedRates + 8), &pattrib->pktlen); + pframe = rtw_set_ie(pframe, WLAN_EID_EXT_SUPP_RATES, (rate_len - 8), (cur_network->SupportedRates + 8), &pattrib->pktlen); /* todo:HT for adhoc */ @@ -8155,7 +8155,7 @@ void issue_probersp(_adapter *padapter, unsigned char *da, u8 is_valid_p2p_probe SetSeqNum(pwlanhdr, pmlmeext->mgnt_seq); pmlmeext->mgnt_seq++; - set_frame_sub_type(fctrl, WIFI_PROBERSP); + set_frame_sub_type(fctrl, IEEE80211_STYPE_PROBE_RESP); pattrib->hdrlen = sizeof(struct rtw_ieee80211_hdr_3addr); pattrib->pktlen = pattrib->hdrlen; @@ -8210,7 +8210,7 @@ void issue_probersp(_adapter *padapter, unsigned char *da, u8 is_valid_p2p_probe u8 buf[MAX_IE_SZ]; u8 *ies = pmgntframe->buf_addr + TXDESC_OFFSET + sizeof(struct rtw_ieee80211_hdr_3addr); - ssid_ie = rtw_get_ie(ies + _FIXED_IE_LENGTH_, _SSID_IE_, &ssid_ielen, + ssid_ie = rtw_get_ie(ies + _FIXED_IE_LENGTH_, WLAN_EID_SSID, &ssid_ielen, (pframe - ies) - _FIXED_IE_LENGTH_); ssid_ielen_diff = cur_network->Ssid.SsidLength - ssid_ielen; @@ -8266,14 +8266,14 @@ void issue_probersp(_adapter *padapter, unsigned char *da, u8 is_valid_p2p_probe /* below for ad-hoc mode */ /* SSID */ - pframe = rtw_set_ie(pframe, _SSID_IE_, cur_network->Ssid.SsidLength, cur_network->Ssid.Ssid, &pattrib->pktlen); + pframe = rtw_set_ie(pframe, WLAN_EID_SSID, cur_network->Ssid.SsidLength, cur_network->Ssid.Ssid, &pattrib->pktlen); /* supported rates... */ rate_len = rtw_get_rateset_len(cur_network->SupportedRates); - pframe = rtw_set_ie(pframe, _SUPPORTEDRATES_IE_, ((rate_len > 8) ? 8 : rate_len), cur_network->SupportedRates, &pattrib->pktlen); + pframe = rtw_set_ie(pframe, WLAN_EID_SUPP_RATES, ((rate_len > 8) ? 8 : rate_len), cur_network->SupportedRates, &pattrib->pktlen); /* DS parameter set */ - pframe = rtw_set_ie(pframe, _DSSET_IE_, 1, (unsigned char *)&(cur_network->Configuration.DSConfig), &pattrib->pktlen); + pframe = rtw_set_ie(pframe, WLAN_EID_DS_PARAMS, 1, (unsigned char *)&(cur_network->Configuration.DSConfig), &pattrib->pktlen); if ((pmlmeinfo->state & 0x03) == WIFI_FW_ADHOC_STATE) { u8 erpinfo = 0; @@ -8281,16 +8281,16 @@ void issue_probersp(_adapter *padapter, unsigned char *da, u8 is_valid_p2p_probe /* IBSS Parameter Set... */ /* ATIMWindow = cur->Configuration.ATIMWindow; */ ATIMWindow = 0; - pframe = rtw_set_ie(pframe, _IBSS_PARA_IE_, 2, (unsigned char *)(&ATIMWindow), &pattrib->pktlen); + pframe = rtw_set_ie(pframe, WLAN_EID_IBSS_PARAMS, 2, (unsigned char *)(&ATIMWindow), &pattrib->pktlen); /* ERP IE */ - pframe = rtw_set_ie(pframe, _ERPINFO_IE_, 1, &erpinfo, &pattrib->pktlen); + pframe = rtw_set_ie(pframe, WLAN_EID_ERP_INFO, 1, &erpinfo, &pattrib->pktlen); } /* EXTERNDED SUPPORTED RATE */ if (rate_len > 8) - pframe = rtw_set_ie(pframe, _EXT_SUPPORTEDRATES_IE_, (rate_len - 8), (cur_network->SupportedRates + 8), &pattrib->pktlen); + pframe = rtw_set_ie(pframe, WLAN_EID_EXT_SUPP_RATES, (rate_len - 8), (cur_network->SupportedRates + 8), &pattrib->pktlen); /* todo:HT for adhoc */ @@ -8298,7 +8298,7 @@ void issue_probersp(_adapter *padapter, unsigned char *da, u8 is_valid_p2p_probe } #ifdef CONFIG_RTW_80211K - pframe = rtw_set_ie(pframe, _EID_RRM_EN_CAP_IE_, + pframe = rtw_set_ie(pframe, WLAN_EID_RRM_ENABLED_CAPABILITIES , sizeof(padapter->rmpriv.rm_en_cap_def), padapter->rmpriv.rm_en_cap_def, &pattrib->pktlen); #endif @@ -8360,7 +8360,7 @@ void issue_probersp(_adapter *padapter, unsigned char *da, u8 is_valid_p2p_probe memcpy(&RC_INFO[10], (u8 *)&psta->pid, 2); memcpy(&RC_INFO[12], (u8 *)&cu_ch, 2); - pframe = rtw_set_ie(pframe, _VENDOR_SPECIFIC_IE_, sizeof(RC_INFO), RC_INFO, &pattrib->pktlen); + pframe = rtw_set_ie(pframe, WLAN_EID_VENDOR_SPECIFIC, sizeof(RC_INFO), RC_INFO, &pattrib->pktlen); } } #endif /* CONFIG_AUTO_AP_MODE */ @@ -8456,26 +8456,26 @@ int _issue_probereq(_adapter *padapter, const NDIS_802_11_SSID *pssid, const u8 SetSeqNum(pwlanhdr, pmlmeext->mgnt_seq); pmlmeext->mgnt_seq++; } - set_frame_sub_type(pframe, WIFI_PROBEREQ); + set_frame_sub_type(pframe, IEEE80211_STYPE_PROBE_REQ); pframe += sizeof(struct rtw_ieee80211_hdr_3addr); pattrib->pktlen = sizeof(struct rtw_ieee80211_hdr_3addr); if (pssid && !MLME_IS_MESH(padapter)) - pframe = rtw_set_ie(pframe, _SSID_IE_, pssid->SsidLength, pssid->Ssid, &(pattrib->pktlen)); + pframe = rtw_set_ie(pframe, WLAN_EID_SSID, pssid->SsidLength, pssid->Ssid, &(pattrib->pktlen)); else - pframe = rtw_set_ie(pframe, _SSID_IE_, 0, NULL, &(pattrib->pktlen)); + pframe = rtw_set_ie(pframe, WLAN_EID_SSID, 0, NULL, &(pattrib->pktlen)); get_rate_set(padapter, bssrate, &bssrate_len); if (bssrate_len > 8) { - pframe = rtw_set_ie(pframe, _SUPPORTEDRATES_IE_ , 8, bssrate, &(pattrib->pktlen)); - pframe = rtw_set_ie(pframe, _EXT_SUPPORTEDRATES_IE_ , (bssrate_len - 8), (bssrate + 8), &(pattrib->pktlen)); + pframe = rtw_set_ie(pframe, WLAN_EID_SUPP_RATES , 8, bssrate, &(pattrib->pktlen)); + pframe = rtw_set_ie(pframe, WLAN_EID_EXT_SUPP_RATES , (bssrate_len - 8), (bssrate + 8), &(pattrib->pktlen)); } else - pframe = rtw_set_ie(pframe, _SUPPORTEDRATES_IE_ , bssrate_len , bssrate, &(pattrib->pktlen)); + pframe = rtw_set_ie(pframe, WLAN_EID_SUPP_RATES , bssrate_len , bssrate, &(pattrib->pktlen)); if (ch) - pframe = rtw_set_ie(pframe, _DSSET_IE_, 1, &ch, &pattrib->pktlen); + pframe = rtw_set_ie(pframe, WLAN_EID_DS_PARAMS, 1, &ch, &pattrib->pktlen); #ifdef CONFIG_RTW_MESH if (MLME_IS_MESH(padapter)) { @@ -8533,7 +8533,7 @@ int issue_probereq_ex(_adapter *padapter, const NDIS_802_11_SSID *pssid, const u { int ret = _FAIL; int i = 0; - systime start = rtw_get_current_time(); + systime start = jiffies; if (rtw_rfctl_is_tx_blocked_by_ch_waiting(adapter_to_rfctl(padapter))) goto exit; @@ -8608,7 +8608,7 @@ void issue_auth(_adapter *padapter, struct sta_info *psta, unsigned short status SetSeqNum(pwlanhdr, pmlmeext->mgnt_seq); pmlmeext->mgnt_seq++; - set_frame_sub_type(pframe, WIFI_AUTH); + set_frame_sub_type(pframe, IEEE80211_STYPE_AUTH); pframe += sizeof(struct rtw_ieee80211_hdr_3addr); pattrib->pktlen = sizeof(struct rtw_ieee80211_hdr_3addr); @@ -8625,7 +8625,7 @@ void issue_auth(_adapter *padapter, struct sta_info *psta, unsigned short status /* setting auth algo number */ val16 = (u16)psta->authalg; - if (status != _STATS_SUCCESSFUL_) + if (status != WLAN_STATUS_SUCCESS) val16 = 0; if (val16) { @@ -8647,7 +8647,7 @@ void issue_auth(_adapter *padapter, struct sta_info *psta, unsigned short status /* added challenging text... */ if ((psta->auth_seq == 2) && (psta->state & WIFI_FW_AUTH_STATE) && (use_shared_key == 1)) - pframe = rtw_set_ie(pframe, _CHLGETXT_IE_, 128, psta->chg_txt, &(pattrib->pktlen)); + pframe = rtw_set_ie(pframe, WLAN_EID_CHALLENGE, 128, psta->chg_txt, &(pattrib->pktlen)); #endif } else { memcpy(pwlanhdr->addr1, get_my_bssid(&pmlmeinfo->network), ETH_ALEN); @@ -8700,7 +8700,7 @@ void issue_auth(_adapter *padapter, struct sta_info *psta, unsigned short status /* then checking to see if sending challenging text... */ if ((pmlmeinfo->auth_seq == 3) && (pmlmeinfo->state & WIFI_FW_AUTH_STATE) && (use_shared_key == 1)) { - pframe = rtw_set_ie(pframe, _CHLGETXT_IE_, 128, pmlmeinfo->chg_txt, &(pattrib->pktlen)); + pframe = rtw_set_ie(pframe, WLAN_EID_CHALLENGE, 128, pmlmeinfo->chg_txt, &(pattrib->pktlen)); SetPrivacy(fctrl); @@ -8778,7 +8778,7 @@ void issue_asocrsp(_adapter *padapter, unsigned short status, struct sta_info *p SetSeqNum(pwlanhdr, pmlmeext->mgnt_seq); pmlmeext->mgnt_seq++; - if ((pkt_type == WIFI_ASSOCRSP) || (pkt_type == WIFI_REASSOCRSP)) + if ((pkt_type == IEEE80211_STYPE_ASSOC_RESP) || (pkt_type == IEEE80211_STYPE_REASSOC_RESP)) set_frame_sub_type(pwlanhdr, pkt_type); else return; @@ -8799,10 +8799,10 @@ void issue_asocrsp(_adapter *padapter, unsigned short status, struct sta_info *p pframe = rtw_set_fixed_ie(pframe, _ASOC_ID_ , (unsigned char *)&val, &(pattrib->pktlen)); if (pstat->bssratelen <= 8) - pframe = rtw_set_ie(pframe, _SUPPORTEDRATES_IE_, pstat->bssratelen, pstat->bssrateset, &(pattrib->pktlen)); + pframe = rtw_set_ie(pframe, WLAN_EID_SUPP_RATES, pstat->bssratelen, pstat->bssrateset, &(pattrib->pktlen)); else { - pframe = rtw_set_ie(pframe, _SUPPORTEDRATES_IE_, 8, pstat->bssrateset, &(pattrib->pktlen)); - pframe = rtw_set_ie(pframe, _EXT_SUPPORTEDRATES_IE_, (pstat->bssratelen - 8), pstat->bssrateset + 8, &(pattrib->pktlen)); + pframe = rtw_set_ie(pframe, WLAN_EID_SUPP_RATES, 8, pstat->bssrateset, &(pattrib->pktlen)); + pframe = rtw_set_ie(pframe, WLAN_EID_EXT_SUPP_RATES, (pstat->bssratelen - 8), pstat->bssrateset + 8, &(pattrib->pktlen)); } #ifdef CONFIG_IEEE80211W @@ -8813,7 +8813,7 @@ void issue_asocrsp(_adapter *padapter, unsigned short status, struct sta_info *p timeout_itvl[0] = 0x03; timeout_interval = cpu_to_le32(timeout_interval); memcpy(timeout_itvl + 1, &timeout_interval, 4); - pframe = rtw_set_ie(pframe, _TIMEOUT_ITVL_IE_, 5, timeout_itvl, &(pattrib->pktlen)); + pframe = rtw_set_ie(pframe, WLAN_EID_TIMEOUT_INTERVAL, 5, timeout_itvl, &(pattrib->pktlen)); } #endif /* CONFIG_IEEE80211W */ @@ -8823,7 +8823,7 @@ void issue_asocrsp(_adapter *padapter, unsigned short status, struct sta_info *p /* FILL HT CAP INFO IE */ /* p = hostapd_eid_ht_capabilities_info(hapd, p); */ - pbuf = rtw_get_ie(ie + _BEACON_IE_OFFSET_, _HT_CAPABILITY_IE_, &ie_len, (pnetwork->IELength - _BEACON_IE_OFFSET_)); + pbuf = rtw_get_ie(ie + _BEACON_IE_OFFSET_, WLAN_EID_HT_CAPABILITY, &ie_len, (pnetwork->IELength - _BEACON_IE_OFFSET_)); if (pbuf && ie_len > 0) { memcpy(pframe, pbuf, ie_len + 2); pframe += (ie_len + 2); @@ -8832,7 +8832,7 @@ void issue_asocrsp(_adapter *padapter, unsigned short status, struct sta_info *p /* FILL HT ADD INFO IE */ /* p = hostapd_eid_ht_operation(hapd, p); */ - pbuf = rtw_get_ie(ie + _BEACON_IE_OFFSET_, _HT_ADD_INFO_IE_, &ie_len, (pnetwork->IELength - _BEACON_IE_OFFSET_)); + pbuf = rtw_get_ie(ie + _BEACON_IE_OFFSET_, WLAN_EID_HT_OPERATION, &ie_len, (pnetwork->IELength - _BEACON_IE_OFFSET_)); if (pbuf && ie_len > 0) { memcpy(pframe, pbuf, ie_len + 2); pframe += (ie_len + 2); @@ -8846,7 +8846,7 @@ void issue_asocrsp(_adapter *padapter, unsigned short status, struct sta_info *p if (pmlmepriv->ext_capab_ie_len > 0) { uint ie_len = 0; - pbuf = rtw_get_ie(ie + _BEACON_IE_OFFSET_, _EXT_CAP_IE_, &ie_len, (pnetwork->IELength - _BEACON_IE_OFFSET_)); + pbuf = rtw_get_ie(ie + _BEACON_IE_OFFSET_, WLAN_EID_EXT_CAPABILITY , &ie_len, (pnetwork->IELength - _BEACON_IE_OFFSET_)); if (pbuf && ie_len > 0) { memcpy(pframe, pbuf, ie_len + 2); pframe += (ie_len + 2); @@ -8884,7 +8884,7 @@ void issue_asocrsp(_adapter *padapter, unsigned short status, struct sta_info *p unsigned char WMM_PARA_IE[] = {0x00, 0x50, 0xf2, 0x02, 0x01, 0x01}; for (pbuf = ie + _BEACON_IE_OFFSET_; ; pbuf += (ie_len + 2)) { - pbuf = rtw_get_ie(pbuf, _VENDOR_SPECIFIC_IE_, &ie_len, (pnetwork->IELength - _BEACON_IE_OFFSET_ - (ie_len + 2))); + pbuf = rtw_get_ie(pbuf, WLAN_EID_VENDOR_SPECIFIC, &ie_len, (pnetwork->IELength - _BEACON_IE_OFFSET_ - (ie_len + 2))); if (pbuf && _rtw_memcmp(pbuf + 2, WMM_PARA_IE, 6)) { memcpy(pframe, pbuf, ie_len + 2); pframe += (ie_len + 2); @@ -8901,7 +8901,7 @@ void issue_asocrsp(_adapter *padapter, unsigned short status, struct sta_info *p if (pmlmeinfo->assoc_AP_vendor == HT_IOT_PEER_REALTEK) - pframe = rtw_set_ie(pframe, _VENDOR_SPECIFIC_IE_, 6 , REALTEK_96B_IE, &(pattrib->pktlen)); + pframe = rtw_set_ie(pframe, WLAN_EID_VENDOR_SPECIFIC, 6 , REALTEK_96B_IE, &(pattrib->pktlen)); /* add WPS IE ie for wps 2.0 */ if (pmlmepriv->wps_assoc_resp_ie && pmlmepriv->wps_assoc_resp_ie_len > 0) { @@ -9014,9 +9014,9 @@ void _issue_assocreq(_adapter *padapter, u8 is_reassoc) SetSeqNum(pwlanhdr, pmlmeext->mgnt_seq); pmlmeext->mgnt_seq++; if (is_reassoc == _TRUE) - set_frame_sub_type(pframe, WIFI_REASSOCREQ); + set_frame_sub_type(pframe, IEEE80211_STYPE_REASSOC_REQ); else - set_frame_sub_type(pframe, WIFI_ASSOCREQ); + set_frame_sub_type(pframe, IEEE80211_STYPE_ASSOC_REQ); pframe += sizeof(struct rtw_ieee80211_hdr_3addr); pattrib->pktlen = sizeof(struct rtw_ieee80211_hdr_3addr); @@ -9049,7 +9049,7 @@ void _issue_assocreq(_adapter *padapter, u8 is_reassoc) } /* SSID */ - pframe = rtw_set_ie(pframe, _SSID_IE_, pmlmeinfo->network.Ssid.SsidLength, pmlmeinfo->network.Ssid.Ssid, &(pattrib->pktlen)); + pframe = rtw_set_ie(pframe, WLAN_EID_SSID, pmlmeinfo->network.Ssid.SsidLength, pmlmeinfo->network.Ssid.Ssid, &(pattrib->pktlen)); #ifdef CONFIG_DFS /* Dot H */ @@ -9148,10 +9148,10 @@ void _issue_assocreq(_adapter *padapter, u8 is_reassoc) if (bssrate_len > 8) { - pframe = rtw_set_ie(pframe, _SUPPORTEDRATES_IE_ , 8, bssrate, &(pattrib->pktlen)); - pframe = rtw_set_ie(pframe, _EXT_SUPPORTEDRATES_IE_ , (bssrate_len - 8), (bssrate + 8), &(pattrib->pktlen)); + pframe = rtw_set_ie(pframe, WLAN_EID_SUPP_RATES , 8, bssrate, &(pattrib->pktlen)); + pframe = rtw_set_ie(pframe, WLAN_EID_EXT_SUPP_RATES , (bssrate_len - 8), (bssrate + 8), &(pattrib->pktlen)); } else if (bssrate_len > 0) - pframe = rtw_set_ie(pframe, _SUPPORTEDRATES_IE_ , bssrate_len , bssrate, &(pattrib->pktlen)); + pframe = rtw_set_ie(pframe, WLAN_EID_SUPP_RATES , bssrate_len , bssrate, &(pattrib->pktlen)); else RTW_INFO("%s: Connect to AP without 11b and 11g data rate!\n", __FUNCTION__); @@ -9161,7 +9161,7 @@ void _issue_assocreq(_adapter *padapter, u8 is_reassoc) | pmlmeinfo->network.PhyInfo.rm_en_cap[2] | pmlmeinfo->network.PhyInfo.rm_en_cap[3] | pmlmeinfo->network.PhyInfo.rm_en_cap[4]) - pframe = rtw_set_ie(pframe, _EID_RRM_EN_CAP_IE_, 5, + pframe = rtw_set_ie(pframe, WLAN_EID_RRM_ENABLED_CAPABILITIES , 5, (u8 *)padapter->rmpriv.rm_en_cap_def, &(pattrib->pktlen)); #endif /* CONFIG_RTW_80211K */ @@ -9170,7 +9170,7 @@ void _issue_assocreq(_adapter *padapter, u8 is_reassoc) pIE = (PNDIS_802_11_VARIABLE_IEs)(pmlmeinfo->network.IEs + i); switch (pIE->ElementID) { - case _VENDOR_SPECIFIC_IE_: + case WLAN_EID_VENDOR_SPECIFIC: if ((_rtw_memcmp(pIE->data, RTW_WPA_OUI, 4)) || (_rtw_memcmp(pIE->data, WMM_OUI, 4)) || (_rtw_memcmp(pIE->data, WPS_OUI, 4))) { @@ -9183,7 +9183,7 @@ void _issue_assocreq(_adapter *padapter, u8 is_reassoc) vs_ie_length = 14; } - pframe = rtw_set_ie(pframe, _VENDOR_SPECIFIC_IE_, vs_ie_length, pIE->data, &(pattrib->pktlen)); + pframe = rtw_set_ie(pframe, WLAN_EID_VENDOR_SPECIFIC, vs_ie_length, pIE->data, &(pattrib->pktlen)); } break; @@ -9243,7 +9243,7 @@ void _issue_assocreq(_adapter *padapter, u8 is_reassoc) } if (pmlmeinfo->assoc_AP_vendor == HT_IOT_PEER_REALTEK) - pframe = rtw_set_ie(pframe, _VENDOR_SPECIFIC_IE_, 6 , REALTEK_96B_IE, &(pattrib->pktlen)); + pframe = rtw_set_ie(pframe, WLAN_EID_VENDOR_SPECIFIC, 6 , REALTEK_96B_IE, &(pattrib->pktlen)); #ifdef CONFIG_WAPI_SUPPORT @@ -9387,7 +9387,7 @@ void _issue_assocreq(_adapter *padapter, u8 is_reassoc) memcpy(p2pie + p2pielen, pwdinfo->device_addr, ETH_ALEN); /* P2P Interface Address List */ p2pielen += ETH_ALEN; - pframe = rtw_set_ie(pframe, _VENDOR_SPECIFIC_IE_, p2pielen, (unsigned char *) p2pie, &pattrib->pktlen); + pframe = rtw_set_ie(pframe, WLAN_EID_VENDOR_SPECIFIC, p2pielen, (unsigned char *) p2pie, &pattrib->pktlen); } } @@ -9508,7 +9508,7 @@ static int _issue_nulldata(_adapter *padapter, unsigned char *da, unsigned int p SetSeqNum(pwlanhdr, pmlmeext->mgnt_seq); pmlmeext->mgnt_seq++; - set_frame_sub_type(pframe, WIFI_DATA_NULL); + set_frame_sub_type(pframe, IEEE80211_FTYPE_DATA | IEEE80211_STYPE_NULLFUNC); pframe += sizeof(struct rtw_ieee80211_hdr_3addr) + a4_shift; pattrib->pktlen = sizeof(struct rtw_ieee80211_hdr_3addr) + a4_shift; @@ -9537,7 +9537,7 @@ int issue_nulldata(_adapter *padapter, unsigned char *da, unsigned int power_mod { int ret = _FAIL; int i = 0; - systime start = rtw_get_current_time(); + systime start = jiffies; struct mlme_ext_priv *pmlmeext = &(padapter->mlmeextpriv); struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info); @@ -9662,7 +9662,7 @@ static int _issue_qos_nulldata(_adapter *padapter, unsigned char *da, u16 tid, u SetSeqNum(pwlanhdr, pmlmeext->mgnt_seq); pmlmeext->mgnt_seq++; - set_frame_sub_type(pframe, WIFI_QOS_DATA_NULL); + set_frame_sub_type(pframe, IEEE80211_FTYPE_DATA | IEEE80211_STYPE_QOS_NULLFUNC); pframe += sizeof(struct rtw_ieee80211_hdr_3addr_qos) + a4_shift; pattrib->pktlen = sizeof(struct rtw_ieee80211_hdr_3addr_qos) + a4_shift; @@ -9691,7 +9691,7 @@ int issue_qos_nulldata(_adapter *padapter, unsigned char *da, u16 tid, u8 ps, in { int ret = _FAIL; int i = 0; - systime start = rtw_get_current_time(); + systime start = jiffies; struct mlme_ext_priv *pmlmeext = &(padapter->mlmeextpriv); struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info); @@ -9786,7 +9786,7 @@ static int _issue_deauth(_adapter *padapter, unsigned char *da, unsigned short r SetSeqNum(pwlanhdr, pmlmeext->mgnt_seq); pmlmeext->mgnt_seq++; - set_frame_sub_type(pframe, WIFI_DEAUTH); + set_frame_sub_type(pframe, IEEE80211_STYPE_DEAUTH); pframe += sizeof(struct rtw_ieee80211_hdr_3addr); pattrib->pktlen = sizeof(struct rtw_ieee80211_hdr_3addr); @@ -9832,7 +9832,7 @@ int issue_deauth_ex(_adapter *padapter, u8 *da, unsigned short reason, int try_c { int ret = _FAIL; int i = 0; - systime start = rtw_get_current_time(); + systime start = jiffies; if (rtw_rfctl_is_tx_blocked_by_ch_waiting(adapter_to_rfctl(padapter))) goto exit; @@ -9909,7 +9909,7 @@ void issue_action_spct_ch_switch(_adapter *padapter, u8 *ra, u8 new_ch, u8 ch_of SetSeqNum(pwlanhdr, pmlmeext->mgnt_seq); pmlmeext->mgnt_seq++; - set_frame_sub_type(pframe, WIFI_ACTION); + set_frame_sub_type(pframe, IEEE80211_STYPE_ACTION); pframe += sizeof(struct rtw_ieee80211_hdr_3addr); pattrib->pktlen = sizeof(struct rtw_ieee80211_hdr_3addr); @@ -9984,7 +9984,7 @@ void issue_action_SA_Query(_adapter *padapter, unsigned char *raddr, unsigned ch SetSeqNum(pwlanhdr, pmlmeext->mgnt_seq); pmlmeext->mgnt_seq++; - set_frame_sub_type(pframe, WIFI_ACTION); + set_frame_sub_type(pframe, IEEE80211_STYPE_ACTION); pframe += sizeof(struct rtw_ieee80211_hdr_3addr); pattrib->pktlen = sizeof(struct rtw_ieee80211_hdr_3addr); @@ -10085,7 +10085,7 @@ static int issue_action_ba(_adapter *padapter, unsigned char *raddr, unsigned ch SetSeqNum(pwlanhdr, pmlmeext->mgnt_seq); pmlmeext->mgnt_seq++; - set_frame_sub_type(pframe, WIFI_ACTION); + set_frame_sub_type(pframe, IEEE80211_STYPE_ACTION); pframe += sizeof(struct rtw_ieee80211_hdr_3addr); pattrib->pktlen = sizeof(struct rtw_ieee80211_hdr_3addr); @@ -10248,7 +10248,7 @@ inline u8 issue_addba_rsp_wait_ack(_adapter *adapter, unsigned char *ra, u8 tid, { int ret = _FAIL; int i = 0; - systime start = rtw_get_current_time(); + systime start = jiffies; if (rtw_rfctl_is_tx_blocked_by_ch_waiting(adapter_to_rfctl(adapter))) goto exit; @@ -10326,7 +10326,7 @@ int issue_del_ba_ex(_adapter *adapter, unsigned char *ra, u8 tid, u16 reason, u8 { int ret = _FAIL; int i = 0; - systime start = rtw_get_current_time(); + systime start = jiffies; if (rtw_rfctl_is_tx_blocked_by_ch_waiting(adapter_to_rfctl(adapter))) goto exit; @@ -10422,7 +10422,7 @@ void issue_action_BSSCoexistPacket(_adapter *padapter) SetSeqNum(pwlanhdr, pmlmeext->mgnt_seq); pmlmeext->mgnt_seq++; - set_frame_sub_type(pframe, WIFI_ACTION); + set_frame_sub_type(pframe, IEEE80211_STYPE_ACTION); pframe += sizeof(struct rtw_ieee80211_hdr_3addr); pattrib->pktlen = sizeof(struct rtw_ieee80211_hdr_3addr); @@ -10457,7 +10457,7 @@ void issue_action_BSSCoexistPacket(_adapter *padapter) u8 *p; WLAN_BSSID_EX *pbss_network; - if (rtw_end_of_queue_search(phead, plist) == _TRUE) + if (phead == plist) break; pnetwork = LIST_CONTAINOR(plist, struct wlan_network, list); @@ -10466,7 +10466,7 @@ void issue_action_BSSCoexistPacket(_adapter *padapter) pbss_network = (WLAN_BSSID_EX *)&pnetwork->network; - p = rtw_get_ie(pbss_network->IEs + _FIXED_IE_LENGTH_, _HT_CAPABILITY_IE_, &len, pbss_network->IELength - _FIXED_IE_LENGTH_); + p = rtw_get_ie(pbss_network->IEs + _FIXED_IE_LENGTH_, WLAN_EID_HT_CAPABILITY, &len, pbss_network->IELength - _FIXED_IE_LENGTH_); if ((p == NULL) || (len == 0)) { /* non-HT */ if ((pbss_network->Configuration.DSConfig <= 0) || (pbss_network->Configuration.DSConfig > 14)) continue; @@ -10572,7 +10572,7 @@ int _issue_action_SM_PS(_adapter *padapter , unsigned char *raddr , u8 NewMimoP SetSeqNum(pwlanhdr, pmlmeext->mgnt_seq); pmlmeext->mgnt_seq++; - set_frame_sub_type(pframe, WIFI_ACTION); + set_frame_sub_type(pframe, IEEE80211_STYPE_ACTION); pframe += sizeof(struct rtw_ieee80211_hdr_3addr); pattrib->pktlen = sizeof(struct rtw_ieee80211_hdr_3addr); @@ -10607,7 +10607,7 @@ int issue_action_SM_PS_wait_ack(_adapter *padapter, unsigned char *raddr, u8 New { int ret = _FAIL; int i = 0; - systime start = rtw_get_current_time(); + systime start = jiffies; if (rtw_rfctl_is_tx_blocked_by_ch_waiting(adapter_to_rfctl(padapter))) goto exit; @@ -10798,7 +10798,7 @@ unsigned int send_beacon(_adapter *padapter) u8 bxmitok = _FALSE; int issue = 0; int poll = 0; - systime start = rtw_get_current_time(); + systime start = jiffies; #ifdef CONFIG_FW_HANDLE_TXBCN u8 vap_id = padapter->vap_id; @@ -10931,15 +10931,15 @@ u8 collect_bss_info(_adapter *padapter, union recv_frame *precv_frame, WLAN_BSSI subtype = get_frame_sub_type(pframe); - if (subtype == WIFI_BEACON) { + if (subtype == IEEE80211_STYPE_BEACON) { bssid->Reserved[0] = BSS_TYPE_BCN; ie_offset = _BEACON_IE_OFFSET_; } else { /* FIXME : more type */ - if (subtype == WIFI_PROBERSP) { + if (subtype == IEEE80211_STYPE_PROBE_RESP) { ie_offset = _PROBERSP_IE_OFFSET_; bssid->Reserved[0] = BSS_TYPE_PROB_RSP; - } else if (subtype == WIFI_PROBEREQ) { + } else if (subtype == IEEE80211_STYPE_PROBE_REQ) { ie_offset = _PROBEREQ_IE_OFFSET_; bssid->Reserved[0] = BSS_TYPE_PROB_REQ; } else { @@ -10974,7 +10974,7 @@ u8 collect_bss_info(_adapter *padapter, union recv_frame *precv_frame, WLAN_BSSI #endif /* checking SSID */ - p = rtw_get_ie(bssid->IEs + ie_offset, _SSID_IE_, &len, bssid->IELength - ie_offset); + p = rtw_get_ie(bssid->IEs + ie_offset, WLAN_EID_SSID, &len, bssid->IELength - ie_offset); if (p == NULL) { RTW_INFO("marc: cannot find SSID for survey event\n"); return _FAIL; @@ -10994,13 +10994,13 @@ u8 collect_bss_info(_adapter *padapter, union recv_frame *precv_frame, WLAN_BSSI /* checking rate info... */ i = 0; - p = rtw_get_ie(bssid->IEs + ie_offset, _SUPPORTEDRATES_IE_, &len, bssid->IELength - ie_offset); + p = rtw_get_ie(bssid->IEs + ie_offset, WLAN_EID_SUPP_RATES, &len, bssid->IELength - ie_offset); if (p != NULL) { if (len > NDIS_802_11_LENGTH_RATES_EX) { RTW_INFO("%s()-%d: IE too long (%d) for survey event\n", __FUNCTION__, __LINE__, len); return _FAIL; } - if (rtw_validate_value(_SUPPORTEDRATES_IE_, p+2, len) == _FALSE) { + if (rtw_validate_value(WLAN_EID_SUPP_RATES, p+2, len) == _FALSE) { rtw_absorb_ssid_ifneed(padapter, bssid, pframe); RTW_DBG_DUMP("Invalidated Support Rate IE --", p, len+2); return _FAIL; @@ -11009,13 +11009,13 @@ u8 collect_bss_info(_adapter *padapter, union recv_frame *precv_frame, WLAN_BSSI i = len; } - p = rtw_get_ie(bssid->IEs + ie_offset, _EXT_SUPPORTEDRATES_IE_, &len, bssid->IELength - ie_offset); + p = rtw_get_ie(bssid->IEs + ie_offset, WLAN_EID_EXT_SUPP_RATES, &len, bssid->IELength - ie_offset); if (p != NULL) { if (len > (NDIS_802_11_LENGTH_RATES_EX - i)) { RTW_INFO("%s()-%d: IE too long (%d) for survey event\n", __FUNCTION__, __LINE__, len); return _FAIL; } - if (rtw_validate_value(_EXT_SUPPORTEDRATES_IE_, p+2, len) == _FALSE) { + if (rtw_validate_value(WLAN_EID_EXT_SUPP_RATES, p+2, len) == _FALSE) { rtw_absorb_ssid_ifneed(padapter, bssid, pframe); RTW_DBG_DUMP("Invalidated EXT Support Rate IE --", p, len+2); return _FAIL; @@ -11034,7 +11034,7 @@ u8 collect_bss_info(_adapter *padapter, union recv_frame *precv_frame, WLAN_BSSI } #ifdef CONFIG_P2P - if (subtype == WIFI_PROBEREQ) { + if (subtype == IEEE80211_STYPE_PROBE_REQ) { u8 *p2p_ie; u32 p2p_ielen; /* Set Listion Channel */ @@ -11063,7 +11063,7 @@ u8 collect_bss_info(_adapter *padapter, union recv_frame *precv_frame, WLAN_BSSI return _FAIL; /* Checking for DSConfig */ - p = rtw_get_ie(bssid->IEs + ie_offset, _DSSET_IE_, &len, bssid->IELength - ie_offset); + p = rtw_get_ie(bssid->IEs + ie_offset, WLAN_EID_DS_PARAMS, &len, bssid->IELength - ie_offset); bssid->Configuration.DSConfig = 0; bssid->Configuration.Length = 0; @@ -11073,7 +11073,7 @@ u8 collect_bss_info(_adapter *padapter, union recv_frame *precv_frame, WLAN_BSSI else { /* In 5G, some ap do not have DSSET IE */ /* checking HT info for channel */ - p = rtw_get_ie(bssid->IEs + ie_offset, _HT_ADD_INFO_IE_, &len, bssid->IELength - ie_offset); + p = rtw_get_ie(bssid->IEs + ie_offset, WLAN_EID_HT_OPERATION, &len, bssid->IELength - ie_offset); if (p) { struct HT_info_element *HT_info = (struct HT_info_element *)(p + 2); bssid->Configuration.DSConfig = HT_info->primary_channel; @@ -11144,7 +11144,7 @@ u8 collect_bss_info(_adapter *padapter, union recv_frame *precv_frame, WLAN_BSSI if ((pregistrypriv->wifi_spec == 1) && (_FALSE == pmlmeinfo->bwmode_updated)) { struct mlme_priv *pmlmepriv = &padapter->mlmepriv; #ifdef CONFIG_80211N_HT - p = rtw_get_ie(bssid->IEs + ie_offset, _HT_CAPABILITY_IE_, &len, bssid->IELength - ie_offset); + p = rtw_get_ie(bssid->IEs + ie_offset, WLAN_EID_HT_CAPABILITY, &len, bssid->IELength - ie_offset); if (p && len > 0) { struct HT_caps_element *pHT_caps; pHT_caps = (struct HT_caps_element *)(p + 2); @@ -11178,7 +11178,7 @@ u8 collect_bss_info(_adapter *padapter, union recv_frame *precv_frame, WLAN_BSSI bssid->PhyInfo.SignalQuality = 101; #ifdef CONFIG_RTW_80211K - p = rtw_get_ie(bssid->IEs + ie_offset, _EID_RRM_EN_CAP_IE_, &len, bssid->IELength - ie_offset); + p = rtw_get_ie(bssid->IEs + ie_offset, WLAN_EID_RRM_ENABLED_CAPABILITIES , &len, bssid->IELength - ie_offset); if (p) memcpy(bssid->PhyInfo.rm_en_cap, (p + 2), *(p + 1)); @@ -11306,7 +11306,7 @@ void start_clnt_join(_adapter *padapter) _enter_critical_bh(&(padapter->mlmepriv.scanned_queue.lock), &irqL); - for (pos = get_next(head); !rtw_end_of_queue_search(head, pos); pos = get_next(pos)) { + for (pos = get_next(head); !head == pos; pos = get_next(pos)) { scanned = LIST_CONTAINOR(pos, struct wlan_network, list); @@ -11322,7 +11322,7 @@ void start_clnt_join(_adapter *padapter) _exit_critical_bh(&(padapter->mlmepriv.scanned_queue.lock), &irqL); - if (scanned == NULL || rtw_end_of_queue_search(head, pos) || has_p2p_ie == _FALSE) + if (scanned == NULL || head == pos || has_p2p_ie == _FALSE) #endif /* CONFIG_P2P */ /* To avoid connecting to AP fail during resume process, change retry count from 5 to 1 */ issue_deauth_ex(padapter, pnetwork->MacAddress, WLAN_REASON_DEAUTH_LEAVING, 1, 100); @@ -12190,7 +12190,7 @@ void update_sta_info(_adapter *padapter, struct sta_info *psta) psta->htpriv.stbc_cap = pmlmepriv->htpriv.stbc_cap; psta->htpriv.beamform_cap = pmlmepriv->htpriv.beamform_cap; - memcpy(&psta->htpriv.ht_cap, &pmlmeinfo->HT_caps, sizeof(struct rtw_ieee80211_ht_cap)); + memcpy(&psta->htpriv.ht_cap, &pmlmeinfo->HT_caps, sizeof(struct ieee80211_ht_cap)); #ifdef CONFIG_BEAMFORMING psta->htpriv.beamform_cap = pmlmepriv->htpriv.beamform_cap; psta->cmn.bf_info.ht_beamform_cap = pmlmepriv->htpriv.beamform_cap; @@ -12697,7 +12697,7 @@ void linked_status_chk_tdls(_adapter *padapter) phead = &(pstapriv->sta_hash[i]); plist = get_next(phead); - while ((rtw_end_of_queue_search(phead, plist)) == _FALSE) { + while (phead != plist) { psta = LIST_CONTAINOR(plist, struct sta_info, hash_list); plist = get_next(plist); @@ -12791,7 +12791,7 @@ void linked_status_chk(_adapter *padapter, u8 from_timer) #endif pmlmepriv->need_to_roam = _TRUE; rtw_drv_scan_by_self(padapter, RTW_AUTO_SCAN_REASON_ROAM); - pmlmepriv->last_roaming = rtw_get_current_time(); + pmlmepriv->last_roaming = jiffies; } else pmlmepriv->need_to_roam = _FALSE; } @@ -12979,7 +12979,7 @@ bypass_active_keep_alive: phead = &(pstapriv->sta_hash[i]); plist = get_next(phead); - while ((rtw_end_of_queue_search(phead, plist)) == _FALSE) { + while (phead != plist) { psta = LIST_CONTAINOR(plist, struct sta_info, hash_list); plist = get_next(plist); @@ -13001,7 +13001,7 @@ bypass_active_keep_alive: _exit_critical_bh(&pstapriv->sta_hash_lock, &irqL); plist = get_next(&dlist); - while (rtw_end_of_queue_search(&dlist, plist) == _FALSE) { + while (&dlist != plist) { psta = LIST_CONTAINOR(plist, struct sta_info, list); plist = get_next(plist); rtw_list_delete(&psta->list); @@ -13505,7 +13505,7 @@ void rtw_ft_issue_action_req(_adapter *padapter, u8 *pTargetAddr) SetSeqNum(pwlanhdr, pmlmeext->mgnt_seq); pmlmeext->mgnt_seq++; - set_frame_sub_type(pframe, WIFI_ACTION); + set_frame_sub_type(pframe, IEEE80211_STYPE_ACTION); pframe += sizeof(struct rtw_ieee80211_hdr_3addr); pattrib->pktlen = sizeof(struct rtw_ieee80211_hdr_3addr); @@ -13748,16 +13748,16 @@ static int rtw_auto_ap_start_beacon(_adapter *adapter) ie += 2; /* SSID */ - ie = rtw_set_ie(ie, _SSID_IE_, ssid_len, ssid, &sz); + ie = rtw_set_ie(ie, WLAN_EID_SSID, ssid_len, ssid, &sz); /* supported rates */ wireless_mode = WIRELESS_11BG_24N; rtw_set_supported_rate(supportRate, wireless_mode) ; rateLen = rtw_get_rateset_len(supportRate); if (rateLen > 8) - ie = rtw_set_ie(ie, _SUPPORTEDRATES_IE_, 8, supportRate, &sz); + ie = rtw_set_ie(ie, WLAN_EID_SUPP_RATES, 8, supportRate, &sz); else - ie = rtw_set_ie(ie, _SUPPORTEDRATES_IE_, rateLen, supportRate, &sz); + ie = rtw_set_ie(ie, WLAN_EID_SUPP_RATES, rateLen, supportRate, &sz); /* DS parameter set */ @@ -13766,11 +13766,11 @@ static int rtw_auto_ap_start_beacon(_adapter *adapter) else oper_channel = adapter_to_dvobj(adapter)->oper_channel; - ie = rtw_set_ie(ie, _DSSET_IE_, 1, &oper_channel, &sz); + ie = rtw_set_ie(ie, WLAN_EID_DS_PARAMS, 1, &oper_channel, &sz); /* ext supported rates */ if (rateLen > 8) - ie = rtw_set_ie(ie, _EXT_SUPPORTEDRATES_IE_, (rateLen - 8), (supportRate + 8), &sz); + ie = rtw_set_ie(ie, WLAN_EID_EXT_SUPP_RATES, (rateLen - 8), (supportRate + 8), &sz); RTW_INFO("%s, start auto ap beacon sz=%d\n", __FUNCTION__, sz); @@ -14009,17 +14009,17 @@ u8 join_cmd_hdl(_adapter *padapter, u8 *pbuf) pIE = (PNDIS_802_11_VARIABLE_IEs)(pnetwork->IEs + i); switch (pIE->ElementID) { - case _VENDOR_SPECIFIC_IE_: /* Get WMM IE. */ + case WLAN_EID_VENDOR_SPECIFIC: /* Get WMM IE. */ if (_rtw_memcmp(pIE->data, WMM_OUI, 4)) WMM_param_handler(padapter, pIE); break; #ifdef CONFIG_80211N_HT - case _HT_CAPABILITY_IE_: /* Get HT Cap IE. */ + case WLAN_EID_HT_CAPABILITY: /* Get HT Cap IE. */ pmlmeinfo->HT_caps_enable = 1; break; - case _HT_EXTRA_INFO_IE_: /* Get HT Info IE. */ + case WLAN_EID_HT_OPERATION: /* Get HT Info IE. */ pmlmeinfo->HT_info_enable = 1; break; #endif /* CONFIG_80211N_HT */ @@ -14250,7 +14250,7 @@ u8 rtw_scan_sparse(_adapter *adapter, struct rtw_ieee80211_channel *ch, u8 ch_nu goto exit; if (mlmeext->last_scan_time == 0) - mlmeext->last_scan_time = rtw_get_current_time(); + mlmeext->last_scan_time = jiffies; interval = rtw_get_passing_time_ms(mlmeext->last_scan_time); @@ -14306,7 +14306,7 @@ u8 rtw_scan_sparse(_adapter *adapter, struct rtw_ieee80211_channel *ch, u8 ch_nu memset(&ch[k], 0, sizeof(struct rtw_ieee80211_channel)); ret_num = k; - mlmeext->last_scan_time = rtw_get_current_time(); + mlmeext->last_scan_time = jiffies; } exit: @@ -15235,7 +15235,7 @@ operation_by_state: } mlmeext_set_scan_state(pmlmeext, SCAN_BACK_OP); - ss->backop_time = rtw_get_current_time(); + ss->backop_time = jiffies; if (mlmeext_chk_scan_backop_flags(pmlmeext, SS_BACKOP_TX_RESUME)) rtw_mi_os_xmit_schedule(padapter); @@ -15888,7 +15888,7 @@ u8 chk_bmc_sleepq_hdl(_adapter *padapter, unsigned char *pbuf) xmitframe_phead = get_list_head(&psta_bmc->sleep_q); xmitframe_plist = get_next(xmitframe_phead); - while ((rtw_end_of_queue_search(xmitframe_phead, xmitframe_plist)) == _FALSE) { + while (xmitframe_phead != xmitframe_plist) { pxmitframe = LIST_CONTAINOR(xmitframe_plist, struct xmit_frame, list); xmitframe_plist = get_next(xmitframe_plist); @@ -15965,7 +15965,7 @@ void change_band_update_ie(_adapter *padapter, WLAN_BSSID_EX *pnetwork, u8 ch) if (ch >= 36) { network_type = WIRELESS_11A; total_rate_len = IEEE80211_NUM_OFDM_RATESLEN; - rtw_remove_bcn_ie(padapter, pnetwork, _ERPINFO_IE_); + rtw_remove_bcn_ie(padapter, pnetwork, WLAN_EID_ERP_INFO); #ifdef CONFIG_80211AC_VHT /* if channel in 5G band, then add vht ie . */ if ((pmlmepriv->htpriv.ht_option == _TRUE) @@ -15981,7 +15981,7 @@ void change_band_update_ie(_adapter *padapter, WLAN_BSSID_EX *pnetwork, u8 ch) } else { network_type = WIRELESS_11BG; total_rate_len = IEEE80211_CCK_RATE_LEN + IEEE80211_NUM_OFDM_RATESLEN; - rtw_add_bcn_ie(padapter, pnetwork, _ERPINFO_IE_, &erpinfo, 1); + rtw_add_bcn_ie(padapter, pnetwork, WLAN_EID_ERP_INFO, &erpinfo, 1); #ifdef CONFIG_80211AC_VHT rtw_vht_ies_detach(padapter, pnetwork); #endif @@ -15999,12 +15999,12 @@ void change_band_update_ie(_adapter *padapter, WLAN_BSSID_EX *pnetwork, u8 ch) remainder_rate_len = 0; } - rtw_add_bcn_ie(padapter, pnetwork, _SUPPORTEDRATES_IE_, pnetwork->SupportedRates, rate_len); + rtw_add_bcn_ie(padapter, pnetwork, WLAN_EID_SUPP_RATES, pnetwork->SupportedRates, rate_len); if (remainder_rate_len) - rtw_add_bcn_ie(padapter, pnetwork, _EXT_SUPPORTEDRATES_IE_, (pnetwork->SupportedRates + 8), remainder_rate_len); + rtw_add_bcn_ie(padapter, pnetwork, WLAN_EID_EXT_SUPP_RATES, (pnetwork->SupportedRates + 8), remainder_rate_len); else - rtw_remove_bcn_ie(padapter, pnetwork, _EXT_SUPPORTEDRATES_IE_); + rtw_remove_bcn_ie(padapter, pnetwork, WLAN_EID_EXT_SUPP_RATES); pnetwork->Length = get_WLAN_BSSID_EX_sz(pnetwork); } diff --git a/core/rtw_mp.c b/core/rtw_mp.c index cb8074e..4114604 100644 --- a/core/rtw_mp.c +++ b/core/rtw_mp.c @@ -189,7 +189,7 @@ static void mp_init_xmit_attrib(struct mp_tx *pmptx, PADAPTER padapter) pattrib->ack_policy = 0; /* pattrib->pkt_hdrlen = ETH_HLEN; */ pattrib->hdrlen = WLAN_HDR_A3_LEN; - pattrib->subtype = WIFI_DATA; + pattrib->subtype = (IEEE80211_FTYPE_DATA | IEEE80211_STYPE_DATA); pattrib->priority = 0; pattrib->qsel = pattrib->priority; /* do_queue_select(padapter, pattrib); */ @@ -634,7 +634,6 @@ MPT_DeInitAdapter( pMptCtx->bMptDrvUnload = _TRUE; #if defined(CONFIG_RTL8723B) - _rtw_free_sema(&(pMptCtx->MPh2c_Sema)); _cancel_timer_ex(&pMptCtx->MPh2c_timeout_timer); #endif #if defined(CONFIG_RTL8723B) diff --git a/core/rtw_mp_ioctl.c b/core/rtw_mp_ioctl.c index bd730ba..096b980 100644 --- a/core/rtw_mp_ioctl.c +++ b/core/rtw_mp_ioctl.c @@ -2299,7 +2299,7 @@ unsigned int mp_ioctl_xmit_packet_hdl(struct oid_par_priv *poid_par_priv) fctrl = &(pwlanhdr->frame_ctl); *(fctrl) = 0; - set_frame_sub_type(pframe, WIFI_DATA); + set_frame_sub_type(pframe, (IEEE80211_FTYPE_DATA | IEEE80211_STYPE_DATA)); memcpy(pwlanhdr->addr1, pethhdr->h_dest, ETH_ALEN); memcpy(pwlanhdr->addr2, pethhdr->h_source, ETH_ALEN); diff --git a/core/rtw_p2p.c b/core/rtw_p2p.c index 662bdaf..fc0310d 100644 --- a/core/rtw_p2p.c +++ b/core/rtw_p2p.c @@ -64,7 +64,7 @@ static u32 go_add_group_info_attr(struct wifidirect_info *pwdinfo, u8 *pbuf) plist = get_next(phead); /* look up sta asoc_queue */ - while ((rtw_end_of_queue_search(phead, plist)) == _FALSE) { + while (phead != plist) { psta = LIST_CONTAINOR(plist, struct sta_info, asoc_list); plist = get_next(plist); @@ -177,7 +177,7 @@ static void issue_group_disc_req(struct wifidirect_info *pwdinfo, u8 *da) SetSeqNum(pwlanhdr, pmlmeext->mgnt_seq); pmlmeext->mgnt_seq++; - set_frame_sub_type(pframe, WIFI_ACTION); + set_frame_sub_type(pframe, IEEE80211_STYPE_ACTION); pframe += sizeof(struct rtw_ieee80211_hdr_3addr); pattrib->pktlen = sizeof(struct rtw_ieee80211_hdr_3addr); @@ -237,7 +237,7 @@ static void issue_p2p_devdisc_resp(struct wifidirect_info *pwdinfo, u8 *da, u8 s SetSeqNum(pwlanhdr, pmlmeext->mgnt_seq); pmlmeext->mgnt_seq++; - set_frame_sub_type(pframe, WIFI_ACTION); + set_frame_sub_type(pframe, IEEE80211_STYPE_ACTION); pframe += sizeof(struct rtw_ieee80211_hdr_3addr); pattrib->pktlen = sizeof(struct rtw_ieee80211_hdr_3addr); @@ -261,7 +261,7 @@ static void issue_p2p_devdisc_resp(struct wifidirect_info *pwdinfo, u8 *da, u8 s /* P2P_ATTR_STATUS */ p2pielen += rtw_set_p2p_attr_content(&p2pie[p2pielen], P2P_ATTR_STATUS, 1, &status); - pframe = rtw_set_ie(pframe, _VENDOR_SPECIFIC_IE_, p2pielen, p2pie, &pattrib->pktlen); + pframe = rtw_set_ie(pframe, WLAN_EID_VENDOR_SPECIFIC, p2pielen, p2pie, &pattrib->pktlen); pattrib->last_txcmdsz = pattrib->pktlen; @@ -314,7 +314,7 @@ static void issue_p2p_provision_resp(struct wifidirect_info *pwdinfo, u8 *raddr, SetSeqNum(pwlanhdr, pmlmeext->mgnt_seq); pmlmeext->mgnt_seq++; - set_frame_sub_type(pframe, WIFI_ACTION); + set_frame_sub_type(pframe, IEEE80211_STYPE_ACTION); pframe += sizeof(struct rtw_ieee80211_hdr_3addr); pattrib->pktlen = sizeof(struct rtw_ieee80211_hdr_3addr); @@ -361,7 +361,7 @@ static void issue_p2p_provision_resp(struct wifidirect_info *pwdinfo, u8 *raddr, RTW_PUT_BE16(wpsie + wpsielen, config_method); wpsielen += 2; - pframe = rtw_set_ie(pframe, _VENDOR_SPECIFIC_IE_, wpsielen, (unsigned char *) wpsie, &pattrib->pktlen); + pframe = rtw_set_ie(pframe, WLAN_EID_VENDOR_SPECIFIC, wpsielen, (unsigned char *) wpsie, &pattrib->pktlen); #ifdef CONFIG_WFD wfdielen = build_provdisc_resp_wfd_ie(pwdinfo, pframe); @@ -418,7 +418,7 @@ static void issue_p2p_presence_resp(struct wifidirect_info *pwdinfo, u8 *da, u8 SetSeqNum(pwlanhdr, pmlmeext->mgnt_seq); pmlmeext->mgnt_seq++; - set_frame_sub_type(pframe, WIFI_ACTION); + set_frame_sub_type(pframe, IEEE80211_STYPE_ACTION); pframe += sizeof(struct rtw_ieee80211_hdr_3addr); pattrib->pktlen = sizeof(struct rtw_ieee80211_hdr_3addr); @@ -451,7 +451,7 @@ static void issue_p2p_presence_resp(struct wifidirect_info *pwdinfo, u8 *da, u8 - pframe = rtw_set_ie(pframe, _VENDOR_SPECIFIC_IE_, p2pielen, p2pie, &(pattrib->pktlen)); + pframe = rtw_set_ie(pframe, WLAN_EID_VENDOR_SPECIFIC, p2pielen, p2pie, &(pattrib->pktlen)); pattrib->last_txcmdsz = pattrib->pktlen; @@ -510,7 +510,7 @@ u32 build_beacon_p2p_ie(struct wifidirect_info *pwdinfo, u8 *pbuf) /* go_add_noa_attr(pwdinfo); */ - pbuf = rtw_set_ie(pbuf, _VENDOR_SPECIFIC_IE_, p2pielen, (unsigned char *) p2pie, &len); + pbuf = rtw_set_ie(pbuf, WLAN_EID_VENDOR_SPECIFIC, p2pielen, (unsigned char *) p2pie, &len); return len; @@ -626,7 +626,7 @@ u32 build_beacon_wfd_ie(struct wifidirect_info *pwdinfo, u8 *pbuf) wfdie[wfdielen++] = 0; wfdie[wfdielen++] = 0; - rtw_set_ie(pbuf, _VENDOR_SPECIFIC_IE_, wfdielen, (unsigned char *) wfdie, &len); + rtw_set_ie(pbuf, WLAN_EID_VENDOR_SPECIFIC, wfdielen, (unsigned char *) wfdie, &len); exit: return len; @@ -738,7 +738,7 @@ u32 build_probe_req_wfd_ie(struct wifidirect_info *pwdinfo, u8 *pbuf) wfdie[wfdielen++] = 0; wfdie[wfdielen++] = 0; - rtw_set_ie(pbuf, _VENDOR_SPECIFIC_IE_, wfdielen, (unsigned char *) wfdie, &len); + rtw_set_ie(pbuf, WLAN_EID_VENDOR_SPECIFIC, wfdielen, (unsigned char *) wfdie, &len); exit: return len; @@ -929,7 +929,7 @@ u32 build_probe_resp_wfd_ie(struct wifidirect_info *pwdinfo, u8 *pbuf, u8 tunnel #endif /* CONFIG_TDLS*/ #endif /* CONFIG_CONCURRENT_MODE */ - pbuf = rtw_set_ie(pbuf, _VENDOR_SPECIFIC_IE_, wfdielen, (unsigned char *) wfdie, &len); + pbuf = rtw_set_ie(pbuf, WLAN_EID_VENDOR_SPECIFIC, wfdielen, (unsigned char *) wfdie, &len); exit: return len; @@ -1035,7 +1035,7 @@ u32 build_assoc_req_wfd_ie(struct wifidirect_info *pwdinfo, u8 *pbuf) wfdie[wfdielen++] = 0; wfdie[wfdielen++] = 0; - rtw_set_ie(pbuf, _VENDOR_SPECIFIC_IE_, wfdielen, (unsigned char *) wfdie, &len); + rtw_set_ie(pbuf, WLAN_EID_VENDOR_SPECIFIC, wfdielen, (unsigned char *) wfdie, &len); exit: return len; @@ -1134,7 +1134,7 @@ u32 build_assoc_resp_wfd_ie(struct wifidirect_info *pwdinfo, u8 *pbuf) wfdie[wfdielen++] = 0; wfdie[wfdielen++] = 0; - rtw_set_ie(pbuf, _VENDOR_SPECIFIC_IE_, wfdielen, (unsigned char *) wfdie, &len); + rtw_set_ie(pbuf, WLAN_EID_VENDOR_SPECIFIC, wfdielen, (unsigned char *) wfdie, &len); exit: return len; @@ -1233,7 +1233,7 @@ u32 build_nego_req_wfd_ie(struct wifidirect_info *pwdinfo, u8 *pbuf) wfdie[wfdielen++] = 0; wfdie[wfdielen++] = 0; - rtw_set_ie(pbuf, _VENDOR_SPECIFIC_IE_, wfdielen, (unsigned char *) wfdie, &len); + rtw_set_ie(pbuf, WLAN_EID_VENDOR_SPECIFIC, wfdielen, (unsigned char *) wfdie, &len); exit: return len; @@ -1333,7 +1333,7 @@ u32 build_nego_resp_wfd_ie(struct wifidirect_info *pwdinfo, u8 *pbuf) wfdie[wfdielen++] = 0; - rtw_set_ie(pbuf, _VENDOR_SPECIFIC_IE_, wfdielen, (unsigned char *) wfdie, &len); + rtw_set_ie(pbuf, WLAN_EID_VENDOR_SPECIFIC, wfdielen, (unsigned char *) wfdie, &len); exit: return len; @@ -1433,7 +1433,7 @@ u32 build_nego_confirm_wfd_ie(struct wifidirect_info *pwdinfo, u8 *pbuf) wfdie[wfdielen++] = 0; - pbuf = rtw_set_ie(pbuf, _VENDOR_SPECIFIC_IE_, wfdielen, (unsigned char *) wfdie, &len); + pbuf = rtw_set_ie(pbuf, WLAN_EID_VENDOR_SPECIFIC, wfdielen, (unsigned char *) wfdie, &len); exit: return len; @@ -1546,7 +1546,7 @@ u32 build_invitation_req_wfd_ie(struct wifidirect_info *pwdinfo, u8 *pbuf) } - rtw_set_ie(pbuf, _VENDOR_SPECIFIC_IE_, wfdielen, (unsigned char *) wfdie, &len); + rtw_set_ie(pbuf, WLAN_EID_VENDOR_SPECIFIC, wfdielen, (unsigned char *) wfdie, &len); exit: return len; @@ -1659,7 +1659,7 @@ u32 build_invitation_resp_wfd_ie(struct wifidirect_info *pwdinfo, u8 *pbuf) } - rtw_set_ie(pbuf, _VENDOR_SPECIFIC_IE_, wfdielen, (unsigned char *) wfdie, &len); + rtw_set_ie(pbuf, WLAN_EID_VENDOR_SPECIFIC, wfdielen, (unsigned char *) wfdie, &len); exit: return len; @@ -1759,7 +1759,7 @@ u32 build_provdisc_req_wfd_ie(struct wifidirect_info *pwdinfo, u8 *pbuf) wfdie[wfdielen++] = 0; - rtw_set_ie(pbuf, _VENDOR_SPECIFIC_IE_, wfdielen, (unsigned char *) wfdie, &len); + rtw_set_ie(pbuf, WLAN_EID_VENDOR_SPECIFIC, wfdielen, (unsigned char *) wfdie, &len); exit: return len; @@ -1858,7 +1858,7 @@ u32 build_provdisc_resp_wfd_ie(struct wifidirect_info *pwdinfo, u8 *pbuf) wfdie[wfdielen++] = 0; wfdie[wfdielen++] = 0; - rtw_set_ie(pbuf, _VENDOR_SPECIFIC_IE_, wfdielen, (unsigned char *) wfdie, &len); + rtw_set_ie(pbuf, WLAN_EID_VENDOR_SPECIFIC, wfdielen, (unsigned char *) wfdie, &len); exit: return len; @@ -2071,7 +2071,7 @@ u32 build_probe_resp_p2p_ie(struct wifidirect_info *pwdinfo, u8 *pbuf) p2pielen += go_add_group_info_attr(pwdinfo, p2pie + p2pielen); - pbuf = rtw_set_ie(pbuf, _VENDOR_SPECIFIC_IE_, p2pielen, (unsigned char *) p2pie, &len); + pbuf = rtw_set_ie(pbuf, WLAN_EID_VENDOR_SPECIFIC, p2pielen, (unsigned char *) p2pie, &len); return len; @@ -2200,7 +2200,7 @@ u32 build_prov_disc_request_p2p_ie(struct wifidirect_info *pwdinfo, u8 *pbuf, u8 } - pbuf = rtw_set_ie(pbuf, _VENDOR_SPECIFIC_IE_, p2pielen, (unsigned char *) p2pie, &len); + pbuf = rtw_set_ie(pbuf, WLAN_EID_VENDOR_SPECIFIC, p2pielen, (unsigned char *) p2pie, &len); return len; @@ -2235,7 +2235,7 @@ u32 build_assoc_resp_p2p_ie(struct wifidirect_info *pwdinfo, u8 *pbuf, u8 status /* Value: */ - pbuf = rtw_set_ie(pbuf, _VENDOR_SPECIFIC_IE_, p2pielen, (unsigned char *) p2pie, &len); + pbuf = rtw_set_ie(pbuf, WLAN_EID_VENDOR_SPECIFIC, p2pielen, (unsigned char *) p2pie, &len); return len; @@ -2256,7 +2256,7 @@ u32 process_probe_req_p2p_ie(struct wifidirect_info *pwdinfo, u8 *pframe, uint l u32 p2pielen = 0; int ssid_len = 0, rate_cnt = 0; - p = rtw_get_ie(pframe + WLAN_HDR_A3_LEN + _PROBEREQ_IE_OFFSET_, _SUPPORTEDRATES_IE_, (int *)&rate_cnt, + p = rtw_get_ie(pframe + WLAN_HDR_A3_LEN + _PROBEREQ_IE_OFFSET_, WLAN_EID_SUPP_RATES, (int *)&rate_cnt, len - WLAN_HDR_A3_LEN - _PROBEREQ_IE_OFFSET_); if (rate_cnt <= 4) { @@ -2289,7 +2289,7 @@ u32 process_probe_req_p2p_ie(struct wifidirect_info *pwdinfo, u8 *pframe, uint l /* 5. Requested Device Type in WSC IE. (Todo) */ /* 6. Device ID attribute in P2P IE. (Todo) */ - p = rtw_get_ie(pframe + WLAN_HDR_A3_LEN + _PROBEREQ_IE_OFFSET_, _SSID_IE_, (int *)&ssid_len, + p = rtw_get_ie(pframe + WLAN_HDR_A3_LEN + _PROBEREQ_IE_OFFSET_, WLAN_EID_SSID, (int *)&ssid_len, len - WLAN_HDR_A3_LEN - _PROBEREQ_IE_OFFSET_); ssid_len &= 0xff; /* Just last 1 byte is valid for ssid len of the probe request */ @@ -2331,9 +2331,9 @@ u32 process_assoc_req_p2p_ie(struct wifidirect_info *pwdinfo, u8 *pframe, uint l return P2P_STATUS_FAIL_REQUEST_UNABLE; frame_type = get_frame_sub_type(pframe); - if (frame_type == WIFI_ASSOCREQ) + if (frame_type == IEEE80211_STYPE_ASSOC_REQ) ie_offset = _ASOCREQ_IE_OFFSET_; - else /* WIFI_REASSOCREQ */ + else /* IEEE80211_STYPE_REASSOC_REQ */ ie_offset = _REASOCREQ_IE_OFFSET_; ies = pframe + WLAN_HDR_A3_LEN + ie_offset; @@ -2459,7 +2459,7 @@ u32 process_p2p_devdisc_req(struct wifidirect_info *pwdinfo, u8 *pframe, uint le plist = get_next(phead); /* look up sta asoc_queue */ - while ((rtw_end_of_queue_search(phead, plist)) == _FALSE) { + while (phead != plist) { psta = LIST_CONTAINOR(plist, struct sta_info, asoc_list); plist = get_next(plist); @@ -5123,7 +5123,7 @@ void init_wifidirect_info(_adapter *padapter, enum P2P_ROLE role) rtw_p2p_findphase_ex_set(pwdinfo, P2P_FINDPHASE_EX_NONE); - pwdinfo->listen_dwell = (u8)((rtw_get_current_time() % 3) + 1); + pwdinfo->listen_dwell = (u8)((jiffies % 3) + 1); /* RTW_INFO( "[%s] listen_dwell time is %d00ms\n", __FUNCTION__, pwdinfo->listen_dwell ); */ memset(&pwdinfo->tx_prov_disc_info, 0x00, sizeof(struct tx_provdisc_req_info)); diff --git a/core/rtw_pwrctrl.c b/core/rtw_pwrctrl.c index b6309de..ce77bf6 100644 --- a/core/rtw_pwrctrl.c +++ b/core/rtw_pwrctrl.c @@ -95,7 +95,7 @@ void _ips_enter(_adapter *padapter) pwrpriv->bkeepfwalive = _TRUE; #ifdef CONFIG_RTW_CFGVEDNOR_LLSTATS - pwrpriv->pwr_saving_start_time = rtw_get_current_time(); + pwrpriv->pwr_saving_start_time = jiffies; #endif /* CONFIG_RTW_CFGVEDNOR_LLSTATS */ rtw_ips_pwr_down(padapter); @@ -212,7 +212,7 @@ bool rtw_pwr_unassociated_idle(_adapter *adapter) goto exit; } - if (rtw_time_after(adapter_to_pwrctl(adapter)->ips_deny_time, rtw_get_current_time())) { + if (rtw_time_after(adapter_to_pwrctl(adapter)->ips_deny_time, jiffies)) { /* RTW_INFO("%s ips_deny_time\n", __func__); */ goto exit; } @@ -480,7 +480,7 @@ void traffic_check_for_leave_lps(PADAPTER padapter, u8 tx, u32 tx_packets) xmit_cnt += tx_packets; if (start_time == 0) - start_time = rtw_get_current_time(); + start_time = jiffies; if (rtw_get_passing_time_ms(start_time) > 2000) { /* 2 sec == watch dog timer */ if (xmit_cnt > 8) { @@ -495,7 +495,7 @@ void traffic_check_for_leave_lps(PADAPTER padapter, u8 tx, u32 tx_packets) } } - start_time = rtw_get_current_time(); + start_time = jiffies; xmit_cnt = 0; } @@ -538,7 +538,7 @@ u8 rtw_cpwm_polling(_adapter *adapter, u8 rpwm, u8 cpwm_orig) pwrpriv->rpwm_retry = 0; do { - start_time = rtw_get_current_time(); + start_time = jiffies; do { msleep(1); rtw_hal_get_hwreg(adapter, HW_VAR_CPWM, &cpwm_now); @@ -706,7 +706,7 @@ u8 PS_RDY_CHECK(_adapter *padapter) return _FALSE; #endif - if (rtw_time_after(pwrpriv->lps_deny_time, rtw_get_current_time())) + if (rtw_time_after(pwrpriv->lps_deny_time, jiffies)) return _FALSE; if (check_fwstate(pmlmepriv, WIFI_SITE_MONITOR) @@ -829,7 +829,7 @@ void rtw_set_fw_in_ips_mode(PADAPTER padapter, u8 enable) adapter_to_pwrctl(padapter)->tog = (val8 + 0x80) & 0x80; /* do polling cpwm */ - start_time = rtw_get_current_time(); + start_time = jiffies; do { mdelay(1); @@ -951,7 +951,7 @@ void rtw_set_ps_mode(PADAPTER padapter, u8 ps_mode, u8 smart_ps, u8 bcn_ant_mode phead = &(pstapriv->sta_hash[i]); plist = get_next(phead); - while ((rtw_end_of_queue_search(phead, plist)) == _FALSE) { + while (phead != plist) { ptdls_sta = LIST_CONTAINOR(plist, struct sta_info, hash_list); if (ptdls_sta->tdls_sta_state & TDLS_LINKED_STATE) @@ -972,7 +972,7 @@ void rtw_set_ps_mode(PADAPTER padapter, u8 ps_mode, u8 smart_ps, u8 bcn_ant_mode u32 delay_ms; u8 val8; delay_ms = 20; - start_time = rtw_get_current_time(); + start_time = jiffies; do { rtw_hal_get_hwreg(padapter, HW_VAR_SYS_CLKR, &val8); if (!(val8 & BIT(4))) { /* 0x08 bit4 =1 --> in 32k, bit4 = 0 --> leave 32k */ @@ -1049,7 +1049,7 @@ void rtw_set_ps_mode(PADAPTER padapter, u8 ps_mode, u8 smart_ps, u8 bcn_ant_mode phead = &(pstapriv->sta_hash[i]); plist = get_next(phead); - while ((rtw_end_of_queue_search(phead, plist)) == _FALSE) { + while (phead != plist) { ptdls_sta = LIST_CONTAINOR(plist, struct sta_info, hash_list); if (ptdls_sta->tdls_sta_state & TDLS_LINKED_STATE) @@ -1197,7 +1197,7 @@ void LPS_Enter(PADAPTER padapter, const char *msg) pwrpriv->bpower_saving = _TRUE; #ifdef CONFIG_RTW_CFGVEDNOR_LLSTATS - pwrpriv->pwr_saving_start_time = rtw_get_current_time(); + pwrpriv->pwr_saving_start_time = jiffies; #endif /* CONFIG_RTW_CFGVEDNOR_LLSTATS */ rtw_set_ps_mode(padapter, pwrpriv->power_mgnt, padapter->registrypriv.smart_ps, 0, buf); @@ -1433,7 +1433,7 @@ void LPS_Leave_check( pwrpriv = adapter_to_pwrctl(padapter); bReady = _FALSE; - start_time = rtw_get_current_time(); + start_time = jiffies; yield(); @@ -2128,7 +2128,7 @@ void rtw_init_pwrctrl_priv(PADAPTER padapter) pwrctrlpriv->ips_mode = padapter->registrypriv.ips_mode; pwrctrlpriv->ips_mode_req = padapter->registrypriv.ips_mode; - pwrctrlpriv->ips_deny_time = rtw_get_current_time(); + pwrctrlpriv->ips_deny_time = jiffies; pwrctrlpriv->lps_level = padapter->registrypriv.lps_level; pwrctrlpriv->pwr_state_check_interval = RTW_PWR_STATE_CHK_INTERVAL; @@ -2159,7 +2159,7 @@ void rtw_init_pwrctrl_priv(PADAPTER padapter) pwrctrlpriv->bLeisurePs = (PS_MODE_ACTIVE != pwrctrlpriv->power_mgnt) ? _TRUE : _FALSE; pwrctrlpriv->bFwCurrentInPSMode = _FALSE; - pwrctrlpriv->lps_deny_time = rtw_get_current_time(); + pwrctrlpriv->lps_deny_time = jiffies; pwrctrlpriv->rpwm = 0; pwrctrlpriv->cpwm = PS_STATE_S4; @@ -2475,7 +2475,7 @@ u8 rtw_interface_ps_func(_adapter *padapter, HAL_INTF_PS_FUNC efunc_id, u8 *val) inline void rtw_set_ips_deny(_adapter *padapter, u32 ms) { struct pwrctrl_priv *pwrpriv = adapter_to_pwrctl(padapter); - pwrpriv->ips_deny_time = rtw_get_current_time() + rtw_ms_to_systime(ms); + pwrpriv->ips_deny_time = jiffies + msecs_to_jiffies(ms); } /* @@ -2491,7 +2491,7 @@ int _rtw_pwr_wakeup(_adapter *padapter, u32 ips_deffer_ms, const char *caller) struct pwrctrl_priv *pwrpriv = dvobj_to_pwrctl(dvobj); struct mlme_priv *pmlmepriv; int ret = _SUCCESS; - systime start = rtw_get_current_time(); + systime start = jiffies; /*RTW_INFO(FUNC_ADPT_FMT "===>\n", FUNC_ADPT_ARG(padapter));*/ /* for LPS */ @@ -2501,8 +2501,8 @@ int _rtw_pwr_wakeup(_adapter *padapter, u32 ips_deffer_ms, const char *caller) padapter = GET_PRIMARY_ADAPTER(padapter); pmlmepriv = &padapter->mlmepriv; - if (rtw_time_after(rtw_get_current_time() + rtw_ms_to_systime(ips_deffer_ms), pwrpriv->ips_deny_time)) - pwrpriv->ips_deny_time = rtw_get_current_time() + rtw_ms_to_systime(ips_deffer_ms); + if (rtw_time_after(jiffies + msecs_to_jiffies(ips_deffer_ms), pwrpriv->ips_deny_time)) + pwrpriv->ips_deny_time = jiffies + msecs_to_jiffies(ips_deffer_ms); if (pwrpriv->ps_processing) { @@ -2627,8 +2627,8 @@ int _rtw_pwr_wakeup(_adapter *padapter, u32 ips_deffer_ms, const char *caller) } exit: - if (rtw_time_after(rtw_get_current_time() + rtw_ms_to_systime(ips_deffer_ms), pwrpriv->ips_deny_time)) - pwrpriv->ips_deny_time = rtw_get_current_time() + rtw_ms_to_systime(ips_deffer_ms); + if (rtw_time_after(jiffies + msecs_to_jiffies(ips_deffer_ms), pwrpriv->ips_deny_time)) + pwrpriv->ips_deny_time = jiffies + msecs_to_jiffies(ips_deffer_ms); /*RTW_INFO(FUNC_ADPT_FMT "<===\n", FUNC_ADPT_ARG(padapter));*/ return ret; @@ -2675,7 +2675,7 @@ int rtw_pm_set_lps_level(_adapter *padapter, u8 level) inline void rtw_set_lps_deny(_adapter *adapter, u32 ms) { struct pwrctrl_priv *pwrpriv = adapter_to_pwrctl(adapter); - pwrpriv->lps_deny_time = rtw_get_current_time() + rtw_ms_to_systime(ms); + pwrpriv->lps_deny_time = jiffies + msecs_to_jiffies(ms); } int rtw_pm_set_ips(_adapter *padapter, u8 mode) diff --git a/core/rtw_recv.c b/core/rtw_recv.c index 292646e..9cb73de 100644 --- a/core/rtw_recv.c +++ b/core/rtw_recv.c @@ -158,14 +158,6 @@ exit: } -void rtw_mfree_recv_priv_lock(struct recv_priv *precvpriv); -void rtw_mfree_recv_priv_lock(struct recv_priv *precvpriv) -{ -#ifdef CONFIG_RECV_THREAD_MODE - _rtw_free_sema(&precvpriv->recv_sema); -#endif -} - void _rtw_free_recv_priv(struct recv_priv *precvpriv) { _adapter *padapter = precvpriv->adapter; @@ -353,7 +345,7 @@ void rtw_free_recvframe_queue(_queue *pframequeue, _queue *pfree_recv_queue) phead = get_list_head(pframequeue); plist = get_next(phead); - while (rtw_end_of_queue_search(phead, plist) == _FALSE) { + while (phead != plist) { precvframe = LIST_CONTAINOR(plist, union recv_frame, u); plist = get_next(plist); @@ -592,7 +584,7 @@ union recv_frame *decryptor(_adapter *padapter, union recv_frame *precv_frame) } if (prxattrib->encrypt && !prxattrib->bdecrypted) { - if (GetFrameType(get_recvframe_data(precv_frame)) == WIFI_DATA + if (GetFrameType(get_recvframe_data(precv_frame)) == (IEEE80211_FTYPE_DATA | IEEE80211_STYPE_DATA) #ifdef CONFIG_CONCURRENT_MODE && !is_multicast_ether_addr(prxattrib->ra) /* bc/mc packets may use sw decryption for concurrent mode */ #endif @@ -1018,14 +1010,14 @@ sint OnTDLS(_adapter *adapter, union recv_frame *precv_frame) return ret; } - ptdls_sta = rtw_get_stainfo(pstapriv, get_sa(ptr)); + 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: break; default: - RTW_INFO("[TDLS] %s - Direct Link Peer = "MAC_FMT" not found for action = %d\n", __func__, MAC_ARG(get_sa(ptr)), *paction); + 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); ret = _FAIL; goto exit; } @@ -1119,7 +1111,7 @@ void count_rx_stats(_adapter *padapter, union recv_frame *prframe, struct sta_in pstats = &psta->sta_stats; - pstats->last_rx_time = rtw_get_current_time(); + pstats->last_rx_time = jiffies; pstats->rx_data_pkts++; pstats->rx_bytes += sz; if (is_broadcast_mac_addr(pattrib->ra)) { @@ -1248,7 +1240,7 @@ sint sta2sta_data_frame( process_pwrbit_data(adapter, precv_frame, ptdls_sta); /* if NULL-frame, check pwrbit */ - if ((get_frame_sub_type(ptr) & WIFI_DATA_NULL) == WIFI_DATA_NULL) { + if ((get_frame_sub_type(ptr) & IEEE80211_FTYPE_DATA | IEEE80211_STYPE_NULLFUNC) == IEEE80211_FTYPE_DATA | IEEE80211_STYPE_NULLFUNC) { /* NULL-frame with pwrbit=1, buffer_STA should buffer frames for sleep_STA */ if (GetPwrMgt(ptr)) { /* it would be triggered when we are off channel and receiving NULL DATA */ @@ -1270,7 +1262,7 @@ sint sta2sta_data_frame( goto exit; } - if ((get_frame_sub_type(ptr) & WIFI_QOS_DATA_TYPE) == WIFI_QOS_DATA_TYPE) + if ((get_frame_sub_type(ptr) & (IEEE80211_STYPE_QOS_DATA | IEEE80211_FTYPE_DATA)) == (IEEE80211_STYPE_QOS_DATA | IEEE80211_FTYPE_DATA)) process_wmmps_data(adapter, precv_frame, ptdls_sta); ptdls_sta->tdls_sta_state &= ~(TDLS_WAIT_PTR_STATE); @@ -1404,7 +1396,7 @@ sint ap2sta_data_frame( goto exit; } - /*if ((get_frame_sub_type(ptr) & WIFI_QOS_DATA_TYPE) == WIFI_QOS_DATA_TYPE) { + /*if ((get_frame_sub_type(ptr) & (IEEE80211_STYPE_QOS_DATA | IEEE80211_FTYPE_DATA)) == (IEEE80211_STYPE_QOS_DATA | IEEE80211_FTYPE_DATA)) { } */ @@ -1450,7 +1442,7 @@ sint ap2sta_data_frame( /* RTW_INFO("After send deauth , %u ms has elapsed.\n", rtw_get_passing_time_ms(send_issue_deauth_time)); */ if (rtw_get_passing_time_ms(send_issue_deauth_time) > 10000 || send_issue_deauth_time == 0) { - send_issue_deauth_time = rtw_get_current_time(); + send_issue_deauth_time = jiffies; RTW_INFO("issue_deauth to the ap=" MAC_FMT " for the reason(7)\n", MAC_ARG(pattrib->bssid)); @@ -1508,7 +1500,7 @@ sint sta2ap_data_frame( process_pwrbit_data(adapter, precv_frame, *psta); - if ((get_frame_sub_type(ptr) & WIFI_QOS_DATA_TYPE) == WIFI_QOS_DATA_TYPE) + if ((get_frame_sub_type(ptr) & (IEEE80211_STYPE_QOS_DATA | IEEE80211_FTYPE_DATA)) == (IEEE80211_STYPE_QOS_DATA | IEEE80211_FTYPE_DATA)) process_wmmps_data(adapter, precv_frame, *psta); if (get_frame_sub_type(ptr) & BIT(6)) { @@ -1569,7 +1561,7 @@ sint validate_recv_ctrl_frame(_adapter *padapter, union recv_frame *precv_frame) /* RTW_INFO("+validate_recv_ctrl_frame\n"); */ - if (GetFrameType(pframe) != WIFI_CTRL_TYPE) + if (GetFrameType(pframe) != IEEE80211_FTYPE_CTL) return _FAIL; /* receive the frames that ra(a1) is my address */ @@ -1581,11 +1573,11 @@ sint validate_recv_ctrl_frame(_adapter *padapter, union recv_frame *precv_frame) return _FAIL; /* for rx pkt statistics */ - psta->sta_stats.last_rx_time = rtw_get_current_time(); + psta->sta_stats.last_rx_time = jiffies; psta->sta_stats.rx_ctrl_pkts++; /* only handle ps-poll */ - if (get_frame_sub_type(pframe) == WIFI_PSPOLL) { + if (get_frame_sub_type(pframe) == (IEEE80211_FTYPE_CTL | IEEE80211_STYPE_PSPOLL)) { #ifdef CONFIG_AP_MODE u16 aid; u8 wmmps_ac = 0; @@ -1635,7 +1627,7 @@ sint validate_recv_ctrl_frame(_adapter *padapter, union recv_frame *precv_frame) xmitframe_phead = get_list_head(&psta->sleep_q); xmitframe_plist = get_next(xmitframe_phead); - if ((rtw_end_of_queue_search(xmitframe_phead, xmitframe_plist)) == _FALSE) { + if (xmitframe_phead != xmitframe_plist) { pxmitframe = LIST_CONTAINOR(xmitframe_plist, struct xmit_frame, list); xmitframe_plist = get_next(xmitframe_plist); @@ -1670,7 +1662,7 @@ sint validate_recv_ctrl_frame(_adapter *padapter, union recv_frame *precv_frame) /* upate BCN for TIM IE */ /* update_BCNTIM(padapter); */ - update_beacon(padapter, _TIM_IE_, NULL, _TRUE); + update_beacon(padapter, WLAN_EID_DS_PARAMS, NULL, _TRUE); } /* _exit_critical_bh(&psta->sleep_q.lock, &irqL); */ @@ -1696,7 +1688,7 @@ sint validate_recv_ctrl_frame(_adapter *padapter, union recv_frame *precv_frame) /* upate BCN for TIM IE */ /* update_BCNTIM(padapter); */ - update_beacon(padapter, _TIM_IE_, NULL, _TRUE); + update_beacon(padapter, WLAN_EID_DS_PARAMS, NULL, _TRUE); } } } @@ -1705,7 +1697,7 @@ sint validate_recv_ctrl_frame(_adapter *padapter, union recv_frame *precv_frame) #ifdef CONFIG_BEAMFORMING rtw_beamforming_get_ndpa_frame(padapter, precv_frame); #endif/*CONFIG_BEAMFORMING*/ - } else if (get_frame_sub_type(pframe) == WIFI_BAR) { + } else if (get_frame_sub_type(pframe) == IEEE80211_STYPE_BACK_REQ) { rtw_process_bar_frame(padapter, precv_frame); } @@ -1754,15 +1746,15 @@ static sint validate_mgmt_protect(_adapter *adapter, union recv_frame *precv_fra is_bmc = is_multicast_ether_addr(GetAddr1Ptr(ptr)); #if DBG_VALIDATE_MGMT_PROTECT - if (subtype == WIFI_DEAUTH) { + if (subtype == IEEE80211_STYPE_DEAUTH) { RTW_INFO(FUNC_ADPT_FMT" bmc:%u, deauth, privacy:%u, encrypt:%u, bdecrypted:%u\n" , FUNC_ADPT_ARG(adapter) , is_bmc, pattrib->privacy, pattrib->encrypt, pattrib->bdecrypted); - } else if (subtype == WIFI_DISASSOC) { + } else if (subtype == IEEE80211_STYPE_DISASSOC) { RTW_INFO(FUNC_ADPT_FMT" bmc:%u, disassoc, privacy:%u, encrypt:%u, bdecrypted:%u\n" , FUNC_ADPT_ARG(adapter) , is_bmc, pattrib->privacy, pattrib->encrypt, pattrib->bdecrypted); - } if (subtype == WIFI_ACTION) { + } if (subtype == IEEE80211_STYPE_ACTION) { if (pattrib->privacy) { RTW_INFO(FUNC_ADPT_FMT" bmc:%u, action(?), privacy:%u, encrypt:%u, bdecrypted:%u\n" , FUNC_ADPT_ARG(adapter) @@ -1782,12 +1774,12 @@ static sint validate_mgmt_protect(_adapter *adapter, union recv_frame *precv_fra goto exit; } - if (subtype == WIFI_ACTION) + if (subtype == IEEE80211_STYPE_ACTION) category = *(ptr + sizeof(struct rtw_ieee80211_hdr_3addr)); if (is_bmc) { /* broadcast cases */ - if (subtype == WIFI_ACTION) { + if (subtype == IEEE80211_STYPE_ACTION) { if (CATEGORY_IS_GROUP_PRIVACY(category)) { /* drop broadcast group privacy action frame without encryption */ #if DBG_VALIDATE_MGMT_PROTECT @@ -1801,7 +1793,7 @@ static sint validate_mgmt_protect(_adapter *adapter, union recv_frame *precv_fra goto bip_verify; } } - if (subtype == WIFI_DEAUTH || subtype == WIFI_DISASSOC) { + if (subtype == IEEE80211_STYPE_DEAUTH || subtype == IEEE80211_STYPE_DISASSOC) { /* broadcast deauth or disassoc frame need BIP check */ goto bip_verify; } @@ -1810,13 +1802,13 @@ static sint validate_mgmt_protect(_adapter *adapter, union recv_frame *precv_fra } else { /* unicast cases */ #ifdef CONFIG_IEEE80211W - if (subtype == WIFI_DEAUTH || subtype == WIFI_DISASSOC) { + if (subtype == IEEE80211_STYPE_DEAUTH || subtype == IEEE80211_STYPE_DISASSOC) { if (!MLME_IS_MESH(adapter)) { unsigned short reason = le16_to_cpu(*(unsigned short *)(ptr + WLAN_HDR_A3_LEN)); #if DBG_VALIDATE_MGMT_PROTECT RTW_INFO(FUNC_ADPT_FMT" unicast %s, reason=%d w/o encrypt\n" - , FUNC_ADPT_ARG(adapter), subtype == WIFI_DEAUTH ? "deauth" : "disassoc", reason); + , FUNC_ADPT_ARG(adapter), subtype == IEEE80211_STYPE_DEAUTH ? "deauth" : "disassoc", reason); #endif if (reason == 6 || reason == 7) { /* issue sa query request */ @@ -1827,7 +1819,7 @@ static sint validate_mgmt_protect(_adapter *adapter, union recv_frame *precv_fra } #endif - if (subtype == WIFI_ACTION && CATEGORY_IS_ROBUST(category)) { + if (subtype == IEEE80211_STYPE_ACTION && CATEGORY_IS_ROBUST(category)) { if (psta->bpairwise_key_installed == _TRUE) { #if DBG_VALIDATE_MGMT_PROTECT RTW_INFO(FUNC_ADPT_FMT" unicast robust action(%d) w/o encrypt\n" @@ -1965,13 +1957,13 @@ sint validate_recv_mgnt_frame(PADAPTER padapter, union recv_frame *precv_frame) /* for rx pkt statistics */ if (psta) { - psta->sta_stats.last_rx_time = rtw_get_current_time(); + psta->sta_stats.last_rx_time = jiffies; psta->sta_stats.rx_mgnt_pkts++; - if (get_frame_sub_type(precv_frame->u.hdr.rx_data) == WIFI_BEACON) + if (get_frame_sub_type(precv_frame->u.hdr.rx_data) == IEEE80211_STYPE_BEACON) psta->sta_stats.rx_beacon_pkts++; - else if (get_frame_sub_type(precv_frame->u.hdr.rx_data) == WIFI_PROBEREQ) + else if (get_frame_sub_type(precv_frame->u.hdr.rx_data) == IEEE80211_STYPE_PROBE_REQ) psta->sta_stats.rx_probereq_pkts++; - else if (get_frame_sub_type(precv_frame->u.hdr.rx_data) == WIFI_PROBERSP) { + else if (get_frame_sub_type(precv_frame->u.hdr.rx_data) == IEEE80211_STYPE_PROBE_RESP) { if (_rtw_memcmp(adapter_mac_addr(padapter), GetAddr1Ptr(precv_frame->u.hdr.rx_data), ETH_ALEN) == _TRUE) psta->sta_stats.rx_probersp_pkts++; else if (is_broadcast_mac_addr(GetAddr1Ptr(precv_frame->u.hdr.rx_data)) @@ -1988,8 +1980,8 @@ sint validate_recv_mgnt_frame(PADAPTER padapter, union recv_frame *precv_frame) struct recv_stat *prxstat = (struct recv_stat *) precv_frame->u.hdr.rx_head ; u8 *pda, *psa, *pbssid, *ptr; ptr = precv_frame->u.hdr.rx_data; - pda = get_da(ptr); - psa = get_sa(ptr); + pda = ieee80211_get_DA((struct ieee80211_hdr *)ptr); + psa = ieee80211_get_SA((struct ieee80211_hdr *)ptr); pbssid = get_hdr_bssid(ptr); @@ -2298,14 +2290,14 @@ sint validate_recv_frame(_adapter *adapter, union recv_frame *precv_frame) rtw_hal_get_def_var(adapter, HAL_DEF_DBG_DUMP_RXPKT, &(bDumpRxPkt)); if (bDumpRxPkt == 1) /* dump all rx packets */ dump_rx_packet(ptr); - else if ((bDumpRxPkt == 2) && (type == WIFI_MGT_TYPE)) + else if ((bDumpRxPkt == 2) && (type == IEEE80211_FTYPE_MGMT)) dump_rx_packet(ptr); - else if ((bDumpRxPkt == 3) && (type == WIFI_DATA_TYPE)) + else if ((bDumpRxPkt == 3) && (type == IEEE80211_FTYPE_DATA)) dump_rx_packet(ptr); } #endif switch (type) { - case WIFI_MGT_TYPE: /* mgnt */ + case IEEE80211_FTYPE_MGMT: /* mgnt */ DBG_COUNTER(adapter->rx_logs.core_rx_pre_mgmt); retval = validate_recv_mgnt_frame(adapter, precv_frame); if (retval == _FAIL) { @@ -2313,7 +2305,7 @@ sint validate_recv_frame(_adapter *adapter, union recv_frame *precv_frame) } retval = _FAIL; /* only data frame return _SUCCESS */ break; - case WIFI_CTRL_TYPE: /* ctrl */ + case IEEE80211_FTYPE_CTL: /* ctrl */ DBG_COUNTER(adapter->rx_logs.core_rx_pre_ctrl); retval = validate_recv_ctrl_frame(adapter, precv_frame); if (retval == _FAIL) { @@ -2321,7 +2313,7 @@ sint validate_recv_frame(_adapter *adapter, union recv_frame *precv_frame) } retval = _FAIL; /* only data frame return _SUCCESS */ break; - case WIFI_DATA_TYPE: /* data */ + case IEEE80211_FTYPE_DATA: /* data */ DBG_COUNTER(adapter->rx_logs.core_rx_pre_data); #ifdef CONFIG_WAPI_SUPPORT if (pattrib->qos) @@ -2700,7 +2692,7 @@ union recv_frame *recvframe_defrag(_adapter *adapter, _queue *defrag_q) data = get_recvframe_data(prframe); - while (rtw_end_of_queue_search(phead, plist) == _FALSE) { + while (phead != plist) { pnextrframe = LIST_CONTAINOR(plist, union recv_frame , u); pnfhdr = &pnextrframe->u.hdr; @@ -2773,7 +2765,7 @@ union recv_frame *recvframe_chk_defrag(PADAPTER padapter, union recv_frame *prec psta = rtw_get_stainfo(pstapriv, psta_addr); if (psta == NULL) { u8 type = GetFrameType(pfhdr->rx_data); - if (type != WIFI_DATA_TYPE) { + if (type != IEEE80211_FTYPE_DATA) { psta = rtw_get_bcmc_stainfo(padapter); if (psta) pdefrag_q = &psta->sta_recvpriv.defrag_q; @@ -2948,7 +2940,7 @@ static void recv_free_fwd_resource(_adapter *adapter, struct xmit_frame *fwd_fra _list *list; list = get_next(b2u_list); - while (rtw_end_of_queue_search(b2u_list, list) == _FALSE) { + while (b2u_list != list) { b2uframe = LIST_CONTAINOR(list, struct xmit_frame, list); list = get_next(list); rtw_list_delete(&b2uframe->list); @@ -2982,7 +2974,7 @@ static void recv_fwd_pkt_hdl(_adapter *adapter, _pkt *pkt _list *list = get_next(b2u_list); struct xmit_frame *b2uframe; - while (rtw_end_of_queue_search(b2u_list, list) == _FALSE) { + while (b2u_list != list) { b2uframe = LIST_CONTAINOR(list, struct xmit_frame, list); list = get_next(list); rtw_list_delete(&b2uframe->list); @@ -3322,7 +3314,7 @@ static int enqueue_reorder_recvframe(struct recv_reorder_ctrl *preorder_ctrl, un phead = get_list_head(ppending_recvframe_queue); plist = get_next(phead); - while (rtw_end_of_queue_search(phead, plist) == _FALSE) { + while (phead != plist) { pnextrframe = LIST_CONTAINOR(plist, union recv_frame, u); pnextattrib = &pnextrframe->u.hdr.attrib; @@ -3828,9 +3820,9 @@ int mp_recv_frame(_adapter *padapter, union recv_frame *rframe) pattrib->privacy = GetPrivacy(ptr); pattrib->order = GetOrder(ptr); - if (type == WIFI_DATA_TYPE) { - pda = get_da(ptr); - psa = get_sa(ptr); + if (type == IEEE80211_FTYPE_DATA) { + pda = ieee80211_get_DA((struct ieee80211_hdr *)ptr); + psa = ieee80211_get_SA((struct ieee80211_hdr *)ptr); pbssid = get_hdr_bssid(ptr); memcpy(pattrib->dst, pda, ETH_ALEN); @@ -4439,7 +4431,7 @@ int recv_func(_adapter *padapter, union recv_frame *rframe) {} #ifdef CONFIG_CUSTOMER_ALIBABA_GENERAL type = GetFrameType(ptr); - if ((type == WIFI_DATA_TYPE)&& check_fwstate(mlmepriv, WIFI_STATION_STATE)) { + if ((type == IEEE80211_FTYPE_DATA)&& check_fwstate(mlmepriv, WIFI_STATION_STATE)) { struct wlan_network *cur_network = &(mlmepriv->cur_network); if ( _rtw_memcmp(get_addr2_ptr(ptr), cur_network->network.MacAddress, ETH_ALEN)==0) { recv_frame_monitor(padapter, rframe); @@ -4803,7 +4795,7 @@ void rx_query_phy_status( if ((start_time == 0) || (rtw_get_passing_time_ms(start_time) > 5000)) { RTW_PRINT("Warning!!! %s: Confilc mac addr!!\n", __func__); - start_time = rtw_get_current_time(); + start_time = jiffies; } precvpriv->dbg_rx_conflic_mac_addr_cnt++; } else { @@ -4825,7 +4817,7 @@ void rx_query_phy_status( && _rtw_memcmp(ra, adapter_mac_addr(padapter), ETH_ALEN); pkt_info.is_packet_beacon = pkt_info.is_packet_match_bssid - && (get_frame_sub_type(wlanhdr) == WIFI_BEACON); + && (get_frame_sub_type(wlanhdr) == IEEE80211_STYPE_BEACON); if (psta && IsFrameTypeData(wlanhdr)) { if (is_ra_bmc) @@ -4947,7 +4939,7 @@ bypass_concurrent_hdl: #endif /* CONFIG_CONCURRENT_MODE */ if (primary_padapter->registrypriv.mp_mode != 1) { /* skip unnecessary bmc data frame for primary adapter */ - if (ra_is_bmc == _TRUE && GetFrameType(pbuf) == WIFI_DATA_TYPE + if (ra_is_bmc == _TRUE && GetFrameType(pbuf) == IEEE80211_FTYPE_DATA && !adapter_allow_bmc_data_rx(precvframe->u.hdr.adapter) ) { rtw_free_recvframe(precvframe, &precvframe->u.hdr.adapter->recvpriv.free_recv_queue); diff --git a/core/rtw_rf.c b/core/rtw_rf.c index 65e48fc..00b840f 100644 --- a/core/rtw_rf.c +++ b/core/rtw_rf.c @@ -593,7 +593,7 @@ void _dump_regd_exc_list(void *sel, struct rf_ctl_t *rfctl) head = &rfctl->reg_exc_list; cur = get_next(head); - while ((rtw_end_of_queue_search(head, cur)) == _FALSE) { + while (head != cur) { u8 has_country; ent = LIST_CONTAINOR(cur, struct regd_exc_ent, list); @@ -666,7 +666,7 @@ struct regd_exc_ent *_rtw_regd_exc_search(struct rf_ctl_t *rfctl, const char *co head = &rfctl->reg_exc_list; cur = get_next(head); - while ((rtw_end_of_queue_search(head, cur)) == _FALSE) { + while (head != cur) { u8 has_country; ent = LIST_CONTAINOR(cur, struct regd_exc_ent, list); @@ -723,7 +723,7 @@ void rtw_regd_exc_list_free(struct rf_ctl_t *rfctl) head = &rfctl->reg_exc_list; cur = get_next(head); - while ((rtw_end_of_queue_search(head, cur)) == _FALSE) { + while (head != cur) { ent = LIST_CONTAINOR(cur, struct regd_exc_ent, list); cur = get_next(cur); rtw_list_delete(&ent->list); @@ -869,7 +869,7 @@ void dump_txpwr_lmt(void *sel, _adapter *adapter) head = &rfctl->txpwr_lmt_list; cur = get_next(head); - while ((rtw_end_of_queue_search(head, cur)) == _FALSE) { + while (head != cur) { ent = LIST_CONTAINOR(cur, struct txpwr_lmt_ent, list); cur = get_next(cur); @@ -892,7 +892,7 @@ void dump_txpwr_lmt(void *sel, _adapter *adapter) _RTW_PRINT_SEL(sel, "|"); head = &rfctl->txpwr_lmt_list; cur = get_next(head); - while ((rtw_end_of_queue_search(head, cur)) == _FALSE) { + while (head != cur) { ent = LIST_CONTAINOR(cur, struct txpwr_lmt_ent, list); cur = get_next(cur); _RTW_PRINT_SEL(sel, "%3c " @@ -922,7 +922,7 @@ void dump_txpwr_lmt(void *sel, _adapter *adapter) RTW_PRINT_SEL(sel, "%3u ", ch); head = &rfctl->txpwr_lmt_list; cur = get_next(head); - while ((rtw_end_of_queue_search(head, cur)) == _FALSE) { + while (head != cur) { ent = LIST_CONTAINOR(cur, struct txpwr_lmt_ent, list); cur = get_next(cur); lmt = phy_get_txpwr_lmt_abs(adapter, ent->regd_name, band, bw, tlrs, ntx_idx, ch, 0); @@ -974,7 +974,7 @@ void dump_txpwr_lmt(void *sel, _adapter *adapter) head = &rfctl->txpwr_lmt_list; cur = get_next(head); i = 0; - while ((rtw_end_of_queue_search(head, cur)) == _FALSE) { + while (head != cur) { ent = LIST_CONTAINOR(cur, struct txpwr_lmt_ent, list); cur = get_next(cur); lmt_offset = phy_get_txpwr_lmt(adapter, ent->regd_name, band, bw, path, rs, ntx_idx, ch, 0); @@ -1046,7 +1046,7 @@ void rtw_txpwr_lmt_add_with_nlen(struct rf_ctl_t *rfctl, const char *regd_name, /* search for existed entry */ head = &rfctl->txpwr_lmt_list; cur = get_next(head); - while ((rtw_end_of_queue_search(head, cur)) == _FALSE) { + while (head != cur) { ent = LIST_CONTAINOR(cur, struct txpwr_lmt_ent, list); cur = get_next(cur); @@ -1134,7 +1134,7 @@ struct txpwr_lmt_ent *_rtw_txpwr_lmt_get_by_name(struct rf_ctl_t *rfctl, const c head = &rfctl->txpwr_lmt_list; cur = get_next(head); - while ((rtw_end_of_queue_search(head, cur)) == _FALSE) { + while (head != cur) { ent = LIST_CONTAINOR(cur, struct txpwr_lmt_ent, list); cur = get_next(cur); @@ -1172,7 +1172,7 @@ void rtw_txpwr_lmt_list_free(struct rf_ctl_t *rfctl) head = &rfctl->txpwr_lmt_list; cur = get_next(head); - while ((rtw_end_of_queue_search(head, cur)) == _FALSE) { + while (head != cur) { ent = LIST_CONTAINOR(cur, struct txpwr_lmt_ent, list); cur = get_next(cur); if (ent->regd_name == rfctl->regd_name) diff --git a/core/rtw_rm.c b/core/rtw_rm.c index 8e4827e..2df4186 100644 --- a/core/rtw_rm.c +++ b/core/rtw_rm.c @@ -347,7 +347,7 @@ static u8 *build_wlan_hdr(_adapter *padapter, struct xmit_frame *pmgntframe, pmlmeext->mgnt_seq++; SetFragNum(pframe, 0); - set_frame_sub_type(pframe, WIFI_ACTION); + set_frame_sub_type(pframe, IEEE80211_STYPE_ACTION); pframe += sizeof(struct rtw_ieee80211_hdr_3addr); pattr->pktlen = sizeof(struct rtw_ieee80211_hdr_3addr); @@ -410,7 +410,7 @@ int issue_null_reply(struct rm_obj *prm) return _FALSE; } pattr = &pmgntframe->attrib; - pframe = build_wlan_hdr(padapter, pmgntframe, prm->psta, WIFI_ACTION); + pframe = build_wlan_hdr(padapter, pmgntframe, prm->psta, IEEE80211_STYPE_ACTION); pframe = rtw_set_fixed_ie(pframe, 3, &prm->p.category, &pattr->pktlen); my_len = 0; @@ -1082,7 +1082,7 @@ static u8 *rm_gen_bcn_detail_elem(_adapter *padapter, u8 *pframe, #if (RM_MORE_DBG_MSG) RTW_INFO("RM: bcn_req_ssid\n"); #endif - pframe = rtw_set_ie(pframe, _SSID_IE_, + pframe = rtw_set_ie(pframe, WLAN_EID_SSID, pbss->Ssid.SsidLength, pbss->Ssid.Ssid, &my_len); break; @@ -1423,7 +1423,7 @@ static int retrieve_scan_result(struct rm_obj *prm) /* search scan queue to find requested SSID */ while (1) { - if (rtw_end_of_queue_search(phead, plist) == _TRUE) + if (phead == plist) break; pnetwork = LIST_CONTAINOR(plist, struct wlan_network, list); @@ -1556,7 +1556,7 @@ int issue_beacon_rep(struct rm_obj *prm) } pattr = &pmgntframe->attrib; pframe = build_wlan_hdr(padapter, - pmgntframe, prm->psta, WIFI_ACTION); + pmgntframe, prm->psta, IEEE80211_STYPE_ACTION); pframe = rtw_set_fixed_ie(pframe, 3, &prm->p.category, &pattr->pktlen); @@ -1600,7 +1600,7 @@ int issue_nb_req(struct rm_obj *prm) return _FALSE; } pattr = &pmgntframe->attrib; - pframe = build_wlan_hdr(padapter, pmgntframe, psta, WIFI_ACTION); + pframe = build_wlan_hdr(padapter, pmgntframe, psta, IEEE80211_STYPE_ACTION); pframe = rtw_set_fixed_ie(pframe, 3, &prm->q.category, &pattr->pktlen); @@ -1743,7 +1743,7 @@ int issue_radio_meas_req(struct rm_obj *prm) return _FALSE; } pattr = &pmgntframe->attrib; - pframe = build_wlan_hdr(padapter, pmgntframe, prm->psta, WIFI_ACTION); + pframe = build_wlan_hdr(padapter, pmgntframe, prm->psta, IEEE80211_STYPE_ACTION); pframe = rtw_set_fixed_ie(pframe, 3, &prm->q.category, &pattr->pktlen); /* repeat */ @@ -1917,7 +1917,7 @@ int issue_radio_meas_rep(struct rm_obj *prm) return _FALSE; } pattr = &pmgntframe->attrib; - pframe = build_wlan_hdr(padapter, pmgntframe, psta, WIFI_ACTION); + pframe = build_wlan_hdr(padapter, pmgntframe, psta, IEEE80211_STYPE_ACTION); pframe = rtw_set_fixed_ie(pframe, 3, &prm->p.category, &pattr->pktlen); @@ -2050,7 +2050,7 @@ void rm_dbg_list_sta(_adapter *padapter, char *s) phead = &(pstapriv->sta_hash[i]); plist = get_next(phead); - while ((rtw_end_of_queue_search(phead, plist)) == _FALSE) { + while (phead != plist) { psta = LIST_CONTAINOR(plist, struct sta_info, hash_list); @@ -2106,7 +2106,7 @@ struct sta_info *rm_get_sta(_adapter *padapter, u16 aid, u8* pbssid) phead = &(pstapriv->sta_hash[i]); plist = get_next(phead); - while ((rtw_end_of_queue_search(phead, plist)) == _FALSE) { + while (phead != plist) { psta = LIST_CONTAINOR(plist, struct sta_info, hash_list); @@ -2395,7 +2395,7 @@ static void rm_dbg_list_meas(_adapter *padapter, char *s) plist = get_next(phead); meas_amount = 0; - while ((rtw_end_of_queue_search(phead, plist)) == _FALSE) { + while (phead != plist) { prm = LIST_CONTAINOR(plist, struct rm_obj, list); meas_amount++; plist = get_next(plist); diff --git a/core/rtw_rm_fsm.c b/core/rtw_rm_fsm.c index 1378175..190b770 100644 --- a/core/rtw_rm_fsm.c +++ b/core/rtw_rm_fsm.c @@ -329,7 +329,7 @@ static struct rm_obj *_rm_get_rmobj(_queue *queue, u32 rmid) phead = get_list_head(queue); plist = get_next(phead); - while ((rtw_end_of_queue_search(phead, plist)) == _FALSE) { + while (phead != plist) { prm = LIST_CONTAINOR(plist, struct rm_obj, list); if (rmid == (prm->rmid)) { @@ -435,7 +435,7 @@ static void rm_bcast_aid_handler(_adapter *padapter, struct rm_event *pev) _enter_critical(&queue->lock, &irqL); phead = get_list_head(queue); plist = get_next(phead); - while ((rtw_end_of_queue_search(phead, plist)) == _FALSE) { + while (phead != plist) { prm = LIST_CONTAINOR(plist, struct rm_obj, list); plist = get_next(plist); diff --git a/core/rtw_rson.c b/core/rtw_rson.c index b8a5b70..713aca6 100644 --- a/core/rtw_rson.c +++ b/core/rtw_rson.c @@ -218,7 +218,7 @@ int rtw_get_rson_struct(WLAN_BSSID_EX *bssid, struct rtw_rson_struct *rson_data limit = bssid->IELength - _BEACON_IE_OFFSET_; for (p = bssid->IEs + _BEACON_IE_OFFSET_; ; p += (len + 2)) { - p = rtw_get_ie(p, _VENDOR_SPECIFIC_IE_, &len, limit); + p = rtw_get_ie(p, WLAN_EID_VENDOR_SPECIFIC, &len, limit); limit -= len; if ((p == NULL) || (len == 0)) break; @@ -252,7 +252,7 @@ u32 rtw_rson_append_ie(_adapter *padapter, unsigned char *pframe, u32 *len) if ((!pdvobj) || (!pframe)) return 0; ptr = ori = pframe; - *ptr++ = _VENDOR_SPECIFIC_IE_; + *ptr++ = WLAN_EID_VENDOR_SPECIFIC; *ptr++ = ie_len = sizeof(RTW_RSON_OUI)+sizeof(pdvobj->rson_data); memcpy(ptr, RTW_RSON_OUI, sizeof(RTW_RSON_OUI)); ptr = ptr + sizeof(RTW_RSON_OUI); @@ -389,7 +389,7 @@ void rtw_rson_show_survey_info(struct seq_file *m, _list *plist, _list *phead) RTW_PRINT_SEL(m, "%5s %-17s %3s %5s %14s %10s %-3s %5s %32s\n", "index", "bssid", "ch", "id", "hop_cnt", "loading", "RSSI", "score", "ssid"); while (1) { - if (rtw_end_of_queue_search(phead, plist) == _TRUE) + if (phead == plist) break; pnetwork = LIST_CONTAINOR(plist, struct wlan_network, list); @@ -434,7 +434,7 @@ u8 rtw_rson_ap_check_sta(_adapter *padapter, u8 *pframe, uint pkt_len, unsigned #ifndef CONFIG_RTW_REPEATER_SON_ROOT memset(&rson_target, 0, sizeof(rson_target)); for (p = pframe + WLAN_HDR_A3_LEN + ie_offset; ; p += (len + 2)) { - p = rtw_get_ie(p, _VENDOR_SPECIFIC_IE_, &len, pkt_len - WLAN_HDR_A3_LEN - ie_offset); + p = rtw_get_ie(p, WLAN_EID_VENDOR_SPECIFIC, &len, pkt_len - WLAN_HDR_A3_LEN - ie_offset); if ((p == NULL) || (len == 0)) break; diff --git a/core/rtw_security.c b/core/rtw_security.c index 44b1d69..526cb03 100644 --- a/core/rtw_security.c +++ b/core/rtw_security.c @@ -829,7 +829,7 @@ u32 rtw_tkip_decrypt(_adapter *padapter, u8 *precvframe) res = _FAIL; if (start == 0) - start = rtw_get_current_time(); + start = jiffies; if (is_broadcast_mac_addr(prxattrib->ra)) no_gkey_bc_cnt++; @@ -841,7 +841,7 @@ u32 rtw_tkip_decrypt(_adapter *padapter, u8 *precvframe) RTW_PRINT(FUNC_ADPT_FMT" no_gkey_bc_cnt:%u, no_gkey_mc_cnt:%u\n", FUNC_ADPT_ARG(padapter), no_gkey_bc_cnt, no_gkey_mc_cnt); } - start = rtw_get_current_time(); + start = jiffies; no_gkey_bc_cnt = 0; no_gkey_mc_cnt = 0; } @@ -1180,7 +1180,7 @@ static void construct_mic_iv( mic_iv[1] = 0x00; #if defined(CONFIG_IEEE80211W) || defined(CONFIG_RTW_MESH) /* 802.11w management frame should set management bit(4) */ - if (frtype == WIFI_MGT_TYPE) + if (frtype == IEEE80211_FTYPE_MGMT) mic_iv[1] |= BIT(4); #endif for (i = 2; i < 8; i++) @@ -1214,7 +1214,7 @@ static void construct_mic_header1( mic_header1[1] = (u8)((header_length - 2) % 256); #if defined(CONFIG_IEEE80211W) || defined(CONFIG_RTW_MESH) /* 802.11w management frame don't AND subtype bits 4,5,6 of frame control field */ - if (frtype == WIFI_MGT_TYPE) + if (frtype == IEEE80211_FTYPE_MGMT) mic_header1[2] = mpdu[0]; else #endif @@ -1315,7 +1315,7 @@ static void construct_ctr_preload( ctr_preload[1] = mpdu[24] & 0x0f; #if defined(CONFIG_IEEE80211W) || defined(CONFIG_RTW_MESH) /* 802.11w management frame should set management bit(4) */ - if (frtype == WIFI_MGT_TYPE) + if (frtype == IEEE80211_FTYPE_MGMT) ctr_preload[1] |= BIT(4); #endif for (i = 2; i < 8; i++) @@ -1383,15 +1383,15 @@ static sint aes_cipher(u8 *key, uint hdrlen, a4_exists = 1; if ( - ((frtype | frsubtype) == WIFI_DATA_CFACK) || - ((frtype | frsubtype) == WIFI_DATA_CFPOLL) || - ((frtype | frsubtype) == WIFI_DATA_CFACKPOLL)) { + ((frtype | frsubtype) == (IEEE80211_FTYPE_DATA | IEEE80211_STYPE_DATA_CFACK)) || + ((frtype | frsubtype) == (IEEE80211_FTYPE_DATA | IEEE80211_STYPE_DATA_CFPOLL)) || + ((frtype | frsubtype) == (IEEE80211_FTYPE_DATA | IEEE80211_STYPE_DATA_CFACKPOLL))) { qc_exists = 1; if (hdrlen != WLAN_HDR_A3_QOS_LEN && hdrlen != WLAN_HDR_A4_QOS_LEN) hdrlen += 2; } /* add for CONFIG_IEEE80211W, none 11w also can use */ - else if ((frtype == WIFI_DATA) && + else if ((frtype == (IEEE80211_FTYPE_DATA | IEEE80211_STYPE_DATA)) && ((frsubtype == 0x08) || (frsubtype == 0x09) || (frsubtype == 0x0a) || @@ -1702,14 +1702,14 @@ static sint aes_decipher(u8 *key, uint hdrlen, a4_exists = 1; if ( - ((frtype | frsubtype) == WIFI_DATA_CFACK) || - ((frtype | frsubtype) == WIFI_DATA_CFPOLL) || - ((frtype | frsubtype) == WIFI_DATA_CFACKPOLL)) { + ((frtype | frsubtype) == (IEEE80211_FTYPE_DATA | IEEE80211_STYPE_DATA_CFACK)) || + ((frtype | frsubtype) == (IEEE80211_FTYPE_DATA | IEEE80211_STYPE_DATA_CFPOLL)) || + ((frtype | frsubtype) == (IEEE80211_FTYPE_DATA | IEEE80211_STYPE_DATA_CFACKPOLL))) { qc_exists = 1; if (hdrlen != WLAN_HDR_A3_QOS_LEN && hdrlen != WLAN_HDR_A4_QOS_LEN) hdrlen += 2; } /* only for data packet . add for CONFIG_IEEE80211W, none 11w also can use */ - else if ((frtype == WIFI_DATA) && + else if ((frtype == (IEEE80211_FTYPE_DATA | IEEE80211_STYPE_DATA)) && ((frsubtype == 0x08) || (frsubtype == 0x09) || (frsubtype == 0x0a) || @@ -1950,7 +1950,7 @@ u32 rtw_aes_decrypt(_adapter *padapter, u8 *precvframe) res = _FAIL; if (start == 0) - start = rtw_get_current_time(); + start = jiffies; if (is_broadcast_mac_addr(prxattrib->ra)) no_gkey_bc_cnt++; @@ -1962,7 +1962,7 @@ u32 rtw_aes_decrypt(_adapter *padapter, u8 *precvframe) RTW_PRINT(FUNC_ADPT_FMT" no_gkey_bc_cnt:%u, no_gkey_mc_cnt:%u\n", FUNC_ADPT_ARG(padapter), no_gkey_bc_cnt, no_gkey_mc_cnt); } - start = rtw_get_current_time(); + start = jiffies; no_gkey_bc_cnt = 0; no_gkey_mc_cnt = 0; } @@ -2045,7 +2045,7 @@ u32 rtw_BIP_verify(_adapter *padapter, u8 *whdr_pos, sint flen u8 mic[16]; mme = whdr_pos + flen - 18; - if (*mme != _MME_IE_) + if (*mme != WLAN_EID_MMIE ) return RTW_RX_HANDLED; /* copy key index */ diff --git a/core/rtw_sreset.c b/core/rtw_sreset.c index 03dba20..1823148 100644 --- a/core/rtw_sreset.c +++ b/core/rtw_sreset.c @@ -273,7 +273,7 @@ void sreset_reset(_adapter *padapter) struct mlme_priv *pmlmepriv = &(padapter->mlmepriv); struct xmit_priv *pxmitpriv = &padapter->xmitpriv; _irqL irqL; - systime start = rtw_get_current_time(); + systime start = jiffies; struct dvobj_priv *psdpriv = padapter->dvobj; struct debug_priv *pdbgpriv = &psdpriv->drv_dbg; diff --git a/core/rtw_sta_mgt.c b/core/rtw_sta_mgt.c index 34cc6a1..7c7e076 100644 --- a/core/rtw_sta_mgt.c +++ b/core/rtw_sta_mgt.c @@ -43,7 +43,7 @@ inline void rtw_st_ctl_clear_tracker_q(struct st_ctl_t *st_ctl) _enter_critical_bh(&st_ctl->tracker_q.lock, &irqL); phead = &st_ctl->tracker_q.queue; plist = get_next(phead); - while (rtw_end_of_queue_search(phead, plist) == _FALSE) { + while (phead != plist) { st = LIST_CONTAINOR(plist, struct session_tracker, list); plist = get_next(plist); rtw_list_delete(&st->list); @@ -180,7 +180,7 @@ void dump_st_ctl(void *sel, struct st_ctl_t *st_ctl) _enter_critical_bh(&st_ctl->tracker_q.lock, &irqL); phead = &st_ctl->tracker_q.queue; plist = get_next(phead); - while (rtw_end_of_queue_search(phead, plist) == _FALSE) { + while (phead != plist) { st = LIST_CONTAINOR(plist, struct session_tracker, list); plist = get_next(plist); @@ -358,7 +358,7 @@ void rtw_mfree_all_stainfo(struct sta_priv *pstapriv) phead = get_list_head(&pstapriv->free_sta_queue); plist = get_next(phead); - while ((rtw_end_of_queue_search(phead, plist)) == _FALSE) { + while (phead != plist) { psta = LIST_CONTAINOR(plist, struct sta_info , list); plist = get_next(plist); } @@ -391,7 +391,7 @@ u32 _rtw_free_sta_priv(struct sta_priv *pstapriv) phead = &(pstapriv->sta_hash[index]); plist = get_next(phead); - while ((rtw_end_of_queue_search(phead, plist)) == _FALSE) { + while (phead != plist) { int i; psta = LIST_CONTAINOR(plist, struct sta_info , hash_list); plist = get_next(plist); @@ -803,7 +803,7 @@ void rtw_free_all_stainfo(_adapter *padapter) phead = &(pstapriv->sta_hash[index]); plist = get_next(phead); - while ((rtw_end_of_queue_search(phead, plist)) == _FALSE) { + while (phead != plist) { psta = LIST_CONTAINOR(plist, struct sta_info , hash_list); plist = get_next(plist); @@ -865,7 +865,7 @@ struct sta_info *rtw_get_stainfo(struct sta_priv *pstapriv, const u8 *hwaddr) plist = get_next(phead); - while ((rtw_end_of_queue_search(phead, plist)) == _FALSE) { + while (phead != plist) { psta = LIST_CONTAINOR(plist, struct sta_info, hash_list); @@ -1026,7 +1026,7 @@ u8 _rtw_access_ctrl(_adapter *adapter, u8 period, const u8 *mac_addr) _enter_critical_bh(&(acl_node_q->lock), &irqL); head = get_list_head(acl_node_q); list = get_next(head); - while (rtw_end_of_queue_search(head, list) == _FALSE) { + while (head != list) { acl_node = LIST_CONTAINOR(list, struct rtw_wlan_acl_node, list); list = get_next(list); diff --git a/core/rtw_tdls.c b/core/rtw_tdls.c index 67926b5..809c9de 100644 --- a/core/rtw_tdls.c +++ b/core/rtw_tdls.c @@ -111,7 +111,7 @@ void rtw_free_all_tdls_sta(_adapter *padapter, u8 enqueue_cmd) phead = &(pstapriv->sta_hash[index]); plist = get_next(phead); - while (rtw_end_of_queue_search(phead, plist) == _FALSE) { + while (phead != plist) { psta = LIST_CONTAINOR(plist, struct sta_info, hash_list); plist = get_next(plist); @@ -231,7 +231,7 @@ u8 rtw_is_tdls_sta_existed(_adapter *padapter) for (i = 0; i < NUM_STA; i++) { phead = &(pstapriv->sta_hash[i]); plist = get_next(phead); - while ((rtw_end_of_queue_search(phead, plist)) == _FALSE) { + while (phead != plist) { psta = LIST_CONTAINOR(plist, struct sta_info, hash_list); plist = get_next(plist); if (psta->tdls_sta_state != TDLS_STATE_NONE) { @@ -327,7 +327,7 @@ int _issue_nulldata_to_TDLS_peer_STA(_adapter *padapter, unsigned char *da, unsi SetSeqNum(pwlanhdr, pmlmeext->mgnt_seq); pmlmeext->mgnt_seq++; - set_frame_sub_type(pframe, WIFI_QOS_DATA_NULL); + set_frame_sub_type(pframe, IEEE80211_FTYPE_DATA | IEEE80211_STYPE_QOS_NULLFUNC); pframe += sizeof(struct rtw_ieee80211_hdr_3addr_qos); pattrib->pktlen = sizeof(struct rtw_ieee80211_hdr_3addr_qos); @@ -355,7 +355,7 @@ int issue_nulldata_to_TDLS_peer_STA(_adapter *padapter, unsigned char *da, unsig { int ret; int i = 0; - systime start = rtw_get_current_time(); + systime start = jiffies; struct mlme_ext_priv *pmlmeext = &(padapter->mlmeextpriv); struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info); @@ -425,12 +425,12 @@ void rtw_tdls_process_ht_cap(_adapter *padapter, struct sta_info *ptdls_sta, u8 u8 cur_ldpc_cap = 0, cur_stbc_cap = 0, cur_beamform_cap = 0; /* Save HT capabilities in the sta object */ - memset(&ptdls_sta->htpriv.ht_cap, 0, sizeof(struct rtw_ieee80211_ht_cap)); - if (data && Length >= sizeof(struct rtw_ieee80211_ht_cap)) { + memset(&ptdls_sta->htpriv.ht_cap, 0, sizeof(struct ieee80211_ht_cap)); + if (data && Length >= sizeof(struct ieee80211_ht_cap)) { ptdls_sta->flags |= WLAN_STA_HT; ptdls_sta->flags |= WLAN_STA_WME; - memcpy(&ptdls_sta->htpriv.ht_cap, data, sizeof(struct rtw_ieee80211_ht_cap)); + memcpy(&ptdls_sta->htpriv.ht_cap, data, sizeof(struct ieee80211_ht_cap)); } else { ptdls_sta->flags &= ~WLAN_STA_HT; return; @@ -727,24 +727,24 @@ u8 *rtw_tdls_set_rsnie(struct tdls_txmgmt *ptxmgmt, u8 *pframe, struct pkt_attri int len = 0; if (ptxmgmt->len > 0) - p = rtw_get_ie(ptxmgmt->buf, _RSN_IE_2_, &len, ptxmgmt->len); + p = rtw_get_ie(ptxmgmt->buf, WLAN_EID_RSN, &len, ptxmgmt->len); if (p != NULL) - return rtw_set_ie(pframe, _RSN_IE_2_, len, p + 2, &(pattrib->pktlen)); + return rtw_set_ie(pframe, WLAN_EID_RSN, len, p + 2, &(pattrib->pktlen)); else if (init == _TRUE) - return rtw_set_ie(pframe, _RSN_IE_2_, sizeof(TDLS_RSNIE), TDLS_RSNIE, &(pattrib->pktlen)); + return rtw_set_ie(pframe, WLAN_EID_RSN, sizeof(TDLS_RSNIE), TDLS_RSNIE, &(pattrib->pktlen)); else - return rtw_set_ie(pframe, _RSN_IE_2_, sizeof(ptdls_sta->TDLS_RSNIE), ptdls_sta->TDLS_RSNIE, &(pattrib->pktlen)); + return rtw_set_ie(pframe, WLAN_EID_RSN, sizeof(ptdls_sta->TDLS_RSNIE), ptdls_sta->TDLS_RSNIE, &(pattrib->pktlen)); } u8 *rtw_tdls_set_ext_cap(u8 *pframe, struct pkt_attrib *pattrib) { - return rtw_set_ie(pframe, _EXT_CAP_IE_ , sizeof(TDLS_EXT_CAPIE), TDLS_EXT_CAPIE, &(pattrib->pktlen)); + return rtw_set_ie(pframe, WLAN_EID_EXT_CAPABILITY , sizeof(TDLS_EXT_CAPIE), TDLS_EXT_CAPIE, &(pattrib->pktlen)); } u8 *rtw_tdls_set_qos_cap(u8 *pframe, struct pkt_attrib *pattrib) { - return rtw_set_ie(pframe, _VENDOR_SPECIFIC_IE_, sizeof(TDLS_WMMIE), TDLS_WMMIE, &(pattrib->pktlen)); + return rtw_set_ie(pframe, WLAN_EID_VENDOR_SPECIFIC, sizeof(TDLS_WMMIE), TDLS_WMMIE, &(pattrib->pktlen)); } u8 *rtw_tdls_set_ftie(struct tdls_txmgmt *ptxmgmt, u8 *pframe, struct pkt_attrib *pattrib, u8 *ANonce, u8 *SNonce) @@ -777,10 +777,10 @@ u8 *rtw_tdls_set_timeout_interval(struct tdls_txmgmt *ptxmgmt, u8 *pframe, struc int len = 0; if (ptxmgmt->len > 0) - p = rtw_get_ie(ptxmgmt->buf, _TIMEOUT_ITVL_IE_, &len, ptxmgmt->len); + p = rtw_get_ie(ptxmgmt->buf, WLAN_EID_TIMEOUT_INTERVAL, &len, ptxmgmt->len); if (p != NULL) - return rtw_set_ie(pframe, _TIMEOUT_ITVL_IE_, len, p + 2, &(pattrib->pktlen)); + return rtw_set_ie(pframe, WLAN_EID_TIMEOUT_INTERVAL, len, p + 2, &(pattrib->pktlen)); else { /* Timeout interval */ timeout_itvl[0] = 0x02; @@ -789,7 +789,7 @@ u8 *rtw_tdls_set_timeout_interval(struct tdls_txmgmt *ptxmgmt, u8 *pframe, struc else memcpy(timeout_itvl + 1, (u8 *)(&ptdls_sta->TDLS_PeerKey_Lifetime), 4); - return rtw_set_ie(pframe, _TIMEOUT_ITVL_IE_, 5, timeout_itvl, &(pattrib->pktlen)); + return rtw_set_ie(pframe, WLAN_EID_TIMEOUT_INTERVAL, 5, timeout_itvl, &(pattrib->pktlen)); } } @@ -867,14 +867,14 @@ u8 *rtw_tdls_set_supported_rate(_adapter *padapter, u8 *pframe, struct pkt_attri bssrate_len = rtw_get_rateset_len(bssrate); if (bssrate_len > 8) { - pframe = rtw_set_ie(pframe, _SUPPORTEDRATES_IE_ , 8, bssrate, &(pattrib->pktlen)); + pframe = rtw_set_ie(pframe, WLAN_EID_SUPP_RATES , 8, bssrate, &(pattrib->pktlen)); more_supportedrates = 1; } else - pframe = rtw_set_ie(pframe, _SUPPORTEDRATES_IE_ , bssrate_len , bssrate, &(pattrib->pktlen)); + pframe = rtw_set_ie(pframe, WLAN_EID_SUPP_RATES , bssrate_len , bssrate, &(pattrib->pktlen)); /* extended supported rates */ if (more_supportedrates == 1) - pframe = rtw_set_ie(pframe, _EXT_SUPPORTEDRATES_IE_ , (bssrate_len - 8), (bssrate + 8), &(pattrib->pktlen)); + pframe = rtw_set_ie(pframe, WLAN_EID_EXT_SUPP_RATES , (bssrate_len - 8), (bssrate + 8), &(pattrib->pktlen)); return pframe; } @@ -991,7 +991,7 @@ s32 rtw_tdls_do_ch_sw(_adapter *padapter, struct sta_info *ptdls_sta, u8 chnl_ty u8 take_care_iqk; s32 ret = _FAIL; - ch_sw_time_start = rtw_systime_to_ms(rtw_get_current_time()); + ch_sw_time_start = jiffies_to_msecs(jiffies); /* set mac_id sleep before channel switch */ rtw_hal_macid_sleep(padapter, ptdls_sta->cmn.mac_id); @@ -1043,7 +1043,7 @@ s32 rtw_tdls_do_ch_sw(_adapter *padapter, struct sta_info *ptdls_sta, u8 chnl_ty #endif if (ret == _SUCCESS) { - ch_sw_time_spent = rtw_systime_to_ms(rtw_get_current_time()) - ch_sw_time_start; + ch_sw_time_spent = jiffies_to_msecs(jiffies) - ch_sw_time_start; if (chnl_type == TDLS_CH_SW_OFF_CHNL) { if ((u32)ch_switch_time / 1000 > ch_sw_time_spent) wait_time = (u32)ch_switch_time / 1000 - ch_sw_time_spent; @@ -1075,7 +1075,7 @@ u8 *rtw_tdls_set_wmm_params(_adapter *padapter, u8 *pframe, struct pkt_attrib *p memcpy(wmm_param_ele + 6, (u8 *)&TDLS_WMM_PARAM_IE, sizeof(TDLS_WMM_PARAM_IE)); else memcpy(wmm_param_ele + 6, (u8 *)&pmlmeinfo->WMM_param, sizeof(pmlmeinfo->WMM_param)); - return rtw_set_ie(pframe, _VENDOR_SPECIFIC_IE_, 24, wmm_param_ele, &(pattrib->pktlen)); + return rtw_set_ie(pframe, WLAN_EID_VENDOR_SPECIFIC, 24, wmm_param_ele, &(pattrib->pktlen)); } else return pframe; } @@ -1538,7 +1538,7 @@ int issue_tdls_dis_rsp(_adapter *padapter, struct tdls_txmgmt *ptxmgmt, u8 priva SetSeqNum(pwlanhdr, pmlmeext->mgnt_seq); pmlmeext->mgnt_seq++; - set_frame_sub_type(pframe, WIFI_ACTION); + set_frame_sub_type(pframe, IEEE80211_STYPE_ACTION); pframe += sizeof(struct rtw_ieee80211_hdr_3addr); pattrib->pktlen = sizeof(struct rtw_ieee80211_hdr_3addr); @@ -1771,7 +1771,7 @@ int On_TDLS_Dis_Rsp(_adapter *padapter, union recv_frame *precv_frame) /* WFDTDLS: for sigma test, not to setup direct link automatically */ ptdlsinfo->dev_discovered = _TRUE; - psa = get_sa(ptr); + psa = ieee80211_get_SA((struct ieee80211_hdr *)ptr); ptdls_sta = rtw_get_stainfo(&(padapter->stapriv), psa); if (ptdls_sta != NULL) ptdls_sta->sta_stats.rx_tdls_disc_rsp_pkts++; @@ -1848,7 +1848,7 @@ sint On_TDLS_Setup_Req(_adapter *padapter, union recv_frame *precv_frame, struct goto exit; memset(&txmgmt, 0x00, sizeof(struct tdls_txmgmt)); - psa = get_sa(ptr); + psa = ieee80211_get_SA((struct ieee80211_hdr *)ptr); if (ptdlsinfo->sta_maximum == _TRUE) { if (ptdls_sta == NULL) @@ -1902,7 +1902,7 @@ sint On_TDLS_Setup_Req(_adapter *padapter, union recv_frame *precv_frame, struct if (ptdls_sta) { txmgmt.dialog_token = *(ptr + 2); /* Copy dialog token */ - txmgmt.status_code = _STATS_SUCCESSFUL_; + txmgmt.status_code = WLAN_STATUS_SUCCESS; /* Parsing information element */ for (j = FIXED_IE; j < parsing_length;) { @@ -1910,13 +1910,13 @@ sint On_TDLS_Setup_Req(_adapter *padapter, union recv_frame *precv_frame, struct pIE = (PNDIS_802_11_VARIABLE_IEs)(ptr + j); switch (pIE->ElementID) { - case _SUPPORTEDRATES_IE_: + case WLAN_EID_SUPP_RATES: memcpy(supportRate, pIE->data, pIE->Length); supportRateNum = pIE->Length; break; case _COUNTRY_IE_: break; - case _EXT_SUPPORTEDRATES_IE_: + case WLAN_EID_EXT_SUPP_RATES: if (supportRateNum < sizeof(supportRate)) { memcpy(supportRate + supportRateNum, pIE->data, pIE->Length); supportRateNum += pIE->Length; @@ -1924,7 +1924,7 @@ sint On_TDLS_Setup_Req(_adapter *padapter, union recv_frame *precv_frame, struct break; case _SUPPORTED_CH_IE_: break; - case _RSN_IE_2_: + case WLAN_EID_RSN: rsnie_included = 1; if (prx_pkt_attrib->encrypt) { prsnie = (u8 *)pIE; @@ -1941,22 +1941,22 @@ sint On_TDLS_Setup_Req(_adapter *padapter, union recv_frame *precv_frame, struct txmgmt.status_code = _STATS_INVALID_RSNIE_; } break; - case _EXT_CAP_IE_: + case WLAN_EID_EXT_CAPABILITY : break; - case _VENDOR_SPECIFIC_IE_: + case WLAN_EID_VENDOR_SPECIFIC: break; case _FTIE_: if (prx_pkt_attrib->encrypt) memcpy(SNonce, (ptr + j + 52), 32); break; - case _TIMEOUT_ITVL_IE_: + case WLAN_EID_TIMEOUT_INTERVAL: if (prx_pkt_attrib->encrypt) timeout_interval = cpu_to_le32(*(u32 *)(ptr + j + 3)); break; case _RIC_Descriptor_IE_: break; #ifdef CONFIG_80211N_HT - case _HT_CAPABILITY_IE_: + case WLAN_EID_HT_CAPABILITY: rtw_tdls_process_ht_cap(padapter, ptdls_sta, pIE->data, pIE->Length); break; #endif @@ -1983,7 +1983,7 @@ sint On_TDLS_Setup_Req(_adapter *padapter, union recv_frame *precv_frame, struct /* Check status code */ /* If responder STA has/hasn't security on AP, but request hasn't/has RSNIE, it should reject */ - if (txmgmt.status_code == _STATS_SUCCESSFUL_) { + if (txmgmt.status_code == WLAN_STATUS_SUCCESS) { if (rsnie_included && prx_pkt_attrib->encrypt == 0) txmgmt.status_code = _STATS_SEC_DISABLED_; else if (rsnie_included == 0 && prx_pkt_attrib->encrypt) @@ -2027,7 +2027,7 @@ sint On_TDLS_Setup_Req(_adapter *padapter, union recv_frame *precv_frame, struct if (rtw_tdls_is_driver_setup(padapter)) { issue_tdls_setup_rsp(padapter, &txmgmt); - if (txmgmt.status_code == _STATS_SUCCESSFUL_) + if (txmgmt.status_code == WLAN_STATUS_SUCCESS) _set_timer(&ptdls_sta->handshake_timer, TDLS_HANDSHAKE_TIME); else { rtw_tdls_teardown_pre_hdl(padapter, ptdls_sta); @@ -2064,7 +2064,7 @@ int On_TDLS_Setup_Rsp(_adapter *padapter, union recv_frame *precv_frame, struct u32 timeout_interval = TDLS_TPK_RESEND_COUNT; memset(&txmgmt, 0x00, sizeof(struct tdls_txmgmt)); - psa = get_sa(ptr); + psa = ieee80211_get_SA((struct ieee80211_hdr *)ptr); ptr += prx_pkt_attrib->hdrlen + prx_pkt_attrib->iv_len + LLC_HEADER_SIZE + ETH_TYPE_LEN + PAYLOAD_TYPE_LEN; parsing_length = ((union recv_frame *)precv_frame)->u.hdr.len @@ -2092,13 +2092,13 @@ int On_TDLS_Setup_Rsp(_adapter *padapter, union recv_frame *precv_frame, struct pIE = (PNDIS_802_11_VARIABLE_IEs)(ptr + j); switch (pIE->ElementID) { - case _SUPPORTEDRATES_IE_: + case WLAN_EID_SUPP_RATES: memcpy(supportRate, pIE->data, pIE->Length); supportRateNum = pIE->Length; break; case _COUNTRY_IE_: break; - case _EXT_SUPPORTEDRATES_IE_: + case WLAN_EID_EXT_SUPP_RATES: if (supportRateNum < sizeof(supportRate)) { memcpy(supportRate + supportRateNum, pIE->data, pIE->Length); supportRateNum += pIE->Length; @@ -2106,7 +2106,7 @@ int On_TDLS_Setup_Rsp(_adapter *padapter, union recv_frame *precv_frame, struct break; case _SUPPORTED_CH_IE_: break; - case _RSN_IE_2_: + case WLAN_EID_RSN: prsnie = (u8 *)pIE; /* Check CCMP pairwise_cipher presence. */ ppairwise_cipher = prsnie + 10; @@ -2115,9 +2115,9 @@ int On_TDLS_Setup_Rsp(_adapter *padapter, union recv_frame *precv_frame, struct if (_rtw_memcmp(ppairwise_cipher + 4 * k, RSN_CIPHER_SUITE_CCMP, 4) == _TRUE) verify_ccmp = 1; } - case _EXT_CAP_IE_: + case WLAN_EID_EXT_CAPABILITY : break; - case _VENDOR_SPECIFIC_IE_: + case WLAN_EID_VENDOR_SPECIFIC: if (_rtw_memcmp((u8 *)pIE + 2, WMM_INFO_OUI, 6) == _TRUE) { /* WMM Info ID and OUI */ if ((pregistrypriv->wmm_enable == _TRUE) || (padapter->mlmepriv.htpriv.ht_option == _TRUE)) @@ -2128,14 +2128,14 @@ int On_TDLS_Setup_Rsp(_adapter *padapter, union recv_frame *precv_frame, struct pftie = (u8 *)pIE; memcpy(ANonce, (ptr + j + 20), 32); break; - case _TIMEOUT_ITVL_IE_: + case WLAN_EID_TIMEOUT_INTERVAL: ptimeout_ie = (u8 *)pIE; timeout_interval = cpu_to_le32(*(u32 *)(ptimeout_ie + 3)); break; case _RIC_Descriptor_IE_: break; #ifdef CONFIG_80211N_HT - case _HT_CAPABILITY_IE_: + case WLAN_EID_HT_CAPABILITY: rtw_tdls_process_ht_cap(padapter, ptdls_sta, pIE->data, pIE->Length); break; #endif @@ -2173,7 +2173,7 @@ int On_TDLS_Setup_Rsp(_adapter *padapter, union recv_frame *precv_frame, struct if (prx_pkt_attrib->encrypt) { if (verify_ccmp == 1) { - txmgmt.status_code = _STATS_SUCCESSFUL_; + txmgmt.status_code = WLAN_STATUS_SUCCESS; if (rtw_tdls_is_driver_setup(padapter) == _TRUE) { wpa_tdls_generate_tpk(padapter, ptdls_sta); if (tdls_verify_mic(ptdls_sta->tpk.kck, 2, plinkid_ie, prsnie, ptimeout_ie, pftie) == _FAIL) { @@ -2188,13 +2188,13 @@ int On_TDLS_Setup_Rsp(_adapter *padapter, union recv_frame *precv_frame, struct } else txmgmt.status_code = _STATS_INVALID_RSNIE_; } else - txmgmt.status_code = _STATS_SUCCESSFUL_; + txmgmt.status_code = WLAN_STATUS_SUCCESS; if (rtw_tdls_is_driver_setup(padapter) == _TRUE) { memcpy(txmgmt.peer, prx_pkt_attrib->src, ETH_ALEN); issue_tdls_setup_cfm(padapter, &txmgmt); - if (txmgmt.status_code == _STATS_SUCCESSFUL_) { + if (txmgmt.status_code == WLAN_STATUS_SUCCESS) { rtw_tdls_set_link_established(padapter, _TRUE); if (ptdls_sta->tdls_sta_state & TDLS_RESPONDER_STATE) { @@ -2235,7 +2235,7 @@ int On_TDLS_Setup_Cfm(_adapter *padapter, union recv_frame *precv_frame, struct u16 j, pairwise_count; int ret = _SUCCESS; - psa = get_sa(ptr); + psa = ieee80211_get_SA((struct ieee80211_hdr *)ptr); ptr += prx_pkt_attrib->hdrlen + prx_pkt_attrib->iv_len + LLC_HEADER_SIZE + ETH_TYPE_LEN + PAYLOAD_TYPE_LEN; parsing_length = ((union recv_frame *)precv_frame)->u.hdr.len @@ -2262,10 +2262,10 @@ int On_TDLS_Setup_Cfm(_adapter *padapter, union recv_frame *precv_frame, struct pIE = (PNDIS_802_11_VARIABLE_IEs)(ptr + j); switch (pIE->ElementID) { - case _RSN_IE_2_: + case WLAN_EID_RSN: prsnie = (u8 *)pIE; break; - case _VENDOR_SPECIFIC_IE_: + case WLAN_EID_VENDOR_SPECIFIC: if (_rtw_memcmp((u8 *)pIE + 2, WMM_PARA_OUI, 6) == _TRUE) { /* WMM Parameter ID and OUI */ ptdls_sta->qos_option = _TRUE; @@ -2274,11 +2274,11 @@ int On_TDLS_Setup_Cfm(_adapter *padapter, union recv_frame *precv_frame, struct case _FTIE_: pftie = (u8 *)pIE; break; - case _TIMEOUT_ITVL_IE_: + case WLAN_EID_TIMEOUT_INTERVAL: ptimeout_ie = (u8 *)pIE; break; #ifdef CONFIG_80211N_HT - case _HT_EXTRA_INFO_IE_: + case WLAN_EID_HT_OPERATION: break; #endif #ifdef CONFIG_80211AC_VHT @@ -2478,7 +2478,7 @@ int On_TDLS_Peer_Traffic_Rsp(_adapter *padapter, union recv_frame *precv_frame, xmitframe_plist = get_next(xmitframe_phead); /* transmit buffered frames */ - while (rtw_end_of_queue_search(xmitframe_phead, xmitframe_plist) == _FALSE) { + while (xmitframe_phead != xmitframe_plist) { pxmitframe = LIST_CONTAINOR(xmitframe_plist, struct xmit_frame, list); xmitframe_plist = get_next(xmitframe_plist); rtw_list_delete(&pxmitframe->list); @@ -2789,7 +2789,7 @@ void wfd_ie_tdls(_adapter *padapter, u8 *pframe, u32 *pktlen) memcpy(wfdie + wfdielen, pwfd_info->ip_address, 4); wfdielen += 4; - pframe = rtw_set_ie(pframe, _VENDOR_SPECIFIC_IE_, wfdielen, (unsigned char *) wfdie, pktlen); + pframe = rtw_set_ie(pframe, WLAN_EID_VENDOR_SPECIFIC, wfdielen, (unsigned char *) wfdie, pktlen); } #endif /* CONFIG_WFD */ @@ -2807,7 +2807,7 @@ void rtw_build_tdls_setup_req_ies(_adapter *padapter, struct xmit_frame *pxmitfr /* SNonce */ if (pattrib->encrypt) { for (i = 0; i < 8; i++) { - time = rtw_get_current_time(); + time = jiffies; memcpy(&ptdls_sta->SNonce[4 * i], (u8 *)&time, 4); } } @@ -2883,7 +2883,7 @@ void rtw_build_tdls_setup_rsp_ies(_adapter *padapter, struct xmit_frame *pxmitfr if (pattrib->encrypt) { for (k = 0; k < 8; k++) { - time = rtw_get_current_time(); + time = jiffies; memcpy(&ptdls_sta->ANonce[4 * k], (u8 *)&time, 4); } } diff --git a/core/rtw_wapi.c b/core/rtw_wapi.c index 2502f8a..d852764 100644 --- a/core/rtw_wapi.c +++ b/core/rtw_wapi.c @@ -396,7 +396,7 @@ u8 rtw_wapi_is_wai_packet(_adapter *padapter, u8 *pkt_data) WAPI_TRACE(WAPI_TX | WAPI_RX, "%s: bFind=%d pTaddr="MAC_FMT"\n", __FUNCTION__, bFind, MAC_ARG(pTaddr)); - if (pkt_data[0] == WIFI_QOS_DATA_TYPE) + if (pkt_data[0] == (IEEE80211_STYPE_QOS_DATA | IEEE80211_FTYPE_DATA)) Offset_TypeWAI += 2; /* 88b4? */ @@ -569,7 +569,7 @@ void rtw_build_probe_resp_wapi_ie(_adapter *padapter, unsigned char *pframe, str WapiSetIE(padapter); WapiIELength = pWapiInfo->wapiIELength; - pframe[0] = _WAPI_IE_; + pframe[0] = WLAN_EID_BSS_AC_ACCESS_DELAY; pframe[1] = WapiIELength; memcpy(pframe + 2, pWapiInfo->wapiIE, WapiIELength); pframe += WapiIELength + 2; @@ -591,7 +591,7 @@ void rtw_build_beacon_wapi_ie(_adapter *padapter, unsigned char *pframe, struct WapiSetIE(padapter); WapiIELength = pWapiInfo->wapiIELength; - pframe[0] = _WAPI_IE_; + pframe[0] = WLAN_EID_BSS_AC_ACCESS_DELAY; pframe[1] = WapiIELength; memcpy(pframe + 2, pWapiInfo->wapiIE, WapiIELength); pframe += WapiIELength + 2; @@ -627,7 +627,7 @@ void rtw_build_assoc_req_wapi_ie(_adapter *padapter, unsigned char *pframe, stru memcpy(pWapiInfo->wapiIE + WapiIELength, &bkidNum, 2); WapiIELength += 2; - pframe[0] = _WAPI_IE_; + pframe[0] = WLAN_EID_BSS_AC_ACCESS_DELAY; pframe[1] = WapiIELength; memcpy(pframe + 2, pWapiInfo->wapiIE, WapiIELength); pframe += WapiIELength + 2; diff --git a/core/rtw_wapi_sms4.c b/core/rtw_wapi_sms4.c index d96865a..5acdf84 100644 --- a/core/rtw_wapi_sms4.c +++ b/core/rtw_wapi_sms4.c @@ -482,7 +482,7 @@ u8 WapiCheckPnInSwDecrypt( if ((_rtw_memcmp(pRaddr, padapter->pnetdev->dev_addr, ETH_ALEN) == 0) && !(pDaddr) - && (GetFrameType(&fc) == WIFI_QOS_DATA_TYPE)) + && (GetFrameType(&fc) == (IEEE80211_STYPE_QOS_DATA | IEEE80211_FTYPE_DATA))) /* && ieee->pHTInfo->bCurrentHTSupport && */ /* ieee->pHTInfo->bCurRxReorderEnable) */ ret = false; @@ -509,7 +509,7 @@ int SecSMS4HeaderFillIV(_adapter *padapter, u8 *pxmitframe) return ret; #if 0 hdr_len = sMacHdrLng; - if (GetFrameType(pskb->data) == WIFI_QOS_DATA_TYPE) + if (GetFrameType(pskb->data) == (IEEE80211_STYPE_QOS_DATA | IEEE80211_FTYPE_DATA)) hdr_len += 2; /* hdr_len += SNAP_SIZE + sizeof(u16); */ @@ -694,7 +694,7 @@ u8 SecSWSMS4Decryption( WAPI_DATA(WAPI_RX, "Decryption - Before decryption", pskb->data, pskb->len); IVOffset = sMacHdrLng; - bQosData = GetFrameType(pskb->data) == WIFI_QOS_DATA_TYPE; + bQosData = GetFrameType(pskb->data) == (IEEE80211_STYPE_QOS_DATA | IEEE80211_FTYPE_DATA); if (bQosData) IVOffset += 2; @@ -757,7 +757,7 @@ u8 SecSWSMS4Decryption( if (pWapiSta->wapiUsk.keyId == KeyIdx && pWapiSta->wapiUsk.bSet) { WAPI_TRACE(WAPI_RX, "%s: Use USK for Decryption!!!\n", __FUNCTION__); if (precv_hdr->bWapiCheckPNInDecrypt) { - if (GetFrameType(pskb->data) == WIFI_QOS_DATA_TYPE) { + if (GetFrameType(pskb->data) == (IEEE80211_STYPE_QOS_DATA | IEEE80211_FTYPE_DATA)) { WapiGetLastRxUnicastPNForQoSData(TID, pWapiSta, lastRxPNforQoS); pLastRxPN = lastRxPNforQoS; } else diff --git a/core/rtw_wlan_util.c b/core/rtw_wlan_util.c index 499e5f7..1ef4098 100644 --- a/core/rtw_wlan_util.c +++ b/core/rtw_wlan_util.c @@ -154,7 +154,7 @@ s8 rtw_get_sta_rx_nss(_adapter *adapter, struct sta_info *psta) else #endif /* CONFIG_80211AC_VHT */ if (psta->htpriv.ht_option) - nss = rtw_min(nss, rtw_ht_mcsset_to_nss(psta->htpriv.ht_cap.supp_mcs_set)); + nss = rtw_min(nss, rtw_ht_mcsset_to_nss(psta->htpriv.ht_cap.mcs.rx_mask)); #endif /*CONFIG_80211N_HT*/ RTW_INFO("%s: %d SS\n", __func__, nss); return nss; @@ -183,7 +183,7 @@ s8 rtw_get_sta_tx_nss(_adapter *adapter, struct sta_info *psta) else #endif /* CONFIG_80211AC_VHT */ if (psta->htpriv.ht_option) - nss = rtw_min(nss, rtw_ht_mcsset_to_nss(psta->htpriv.ht_cap.supp_mcs_set)); + nss = rtw_min(nss, rtw_ht_mcsset_to_nss(psta->htpriv.ht_cap.mcs.rx_mask)); #endif /*CONFIG_80211N_HT*/ RTW_INFO("%s: %d SS\n", __func__, nss); return nss; @@ -419,7 +419,7 @@ inline void rtw_set_oper_ch(_adapter *adapter, u8 ch) struct dvobj_priv *dvobj = adapter_to_dvobj(adapter); if (dvobj->oper_channel != ch) { - dvobj->on_oper_ch_time = rtw_get_current_time(); + dvobj->on_oper_ch_time = jiffies; #ifdef DBG_CH_SWITCH cnt += snprintf(msg + cnt, len - cnt, "switch to ch %3u", ch); @@ -2181,7 +2181,7 @@ void VCS_update(_adapter *padapter, struct sta_info *psta) case 2: /* auto */ default: if (((pmlmeinfo->ERP_enable) && (pmlmeinfo->ERP_IE & BIT(1))) - /*||(pmlmepriv->ht_op_mode & HT_INFO_OPERATION_MODE_NON_GF_DEVS_PRESENT)*/ + /*||(pmlmepriv->ht_op_mode & IEEE80211_HT_OP_MODE_NON_GF_STA_PRSNT)*/ ) { if (pregpriv->vcs_type == 1) { psta->rtsen = 1; @@ -2298,8 +2298,8 @@ inline bool match_ranges(u16 EID, u32 value) int nr_range; switch (EID) { - case _EXT_SUPPORTEDRATES_IE_: - case _SUPPORTEDRATES_IE_: + case WLAN_EID_EXT_SUPP_RATES: + case WLAN_EID_SUPP_RATES: nr_range = sizeof(support_rate_ranges)/sizeof(u8); for (i = 0; i < nr_range; i++) { /* clear bit7 before searching. */ @@ -2331,8 +2331,8 @@ bool rtw_validate_value(u16 EID, u8 *p, u16 len) u32 i, nr_val; switch (EID) { - case _EXT_SUPPORTEDRATES_IE_: - case _SUPPORTEDRATES_IE_: + case WLAN_EID_EXT_SUPP_RATES: + case WLAN_EID_SUPP_RATES: nr_val = len; for (i=0; iReserved[0] = BSS_TYPE_BCN; ie_offset = _BEACON_IE_OFFSET_; } else { /* FIXME : more type */ - if (subtype == WIFI_PROBERSP) { + if (subtype == IEEE80211_STYPE_PROBE_RESP) { ie_offset = _PROBERSP_IE_OFFSET_; bssid->Reserved[0] = BSS_TYPE_PROB_RSP; - } else if (subtype == WIFI_PROBEREQ) { + } else if (subtype == IEEE80211_STYPE_PROBE_REQ) { ie_offset = _PROBEREQ_IE_OFFSET_; bssid->Reserved[0] = BSS_TYPE_PROB_REQ; } else { @@ -2397,7 +2397,7 @@ void rtw_absorb_ssid_ifneed(_adapter *padapter, WLAN_BSSID_EX *bssid, u8 *pframe snetwork = &(scanned->network); /* scan queue records as Hidden SSID && Input frame is NOT Hidden SSID */ if (hidden_ssid_ap(snetwork) && !hidden_ssid_ap(bssid)) { - p = rtw_get_ie(snetwork->IEs+ie_offset, _SSID_IE_, &ssid_len_ori, snetwork->IELength-ie_offset); + p = rtw_get_ie(snetwork->IEs+ie_offset, WLAN_EID_SSID, &ssid_len_ori, snetwork->IELength-ie_offset); if (!p) { _exit_critical_bh(&padapter->mlmepriv.scanned_queue.lock, &irqL); return; @@ -2679,14 +2679,14 @@ void update_beacon_info(_adapter *padapter, u8 *pframe, uint pkt_len, struct sta pIE = (PNDIS_802_11_VARIABLE_IEs)(pframe + (_BEACON_IE_OFFSET_ + WLAN_HDR_A3_LEN) + i); switch (pIE->ElementID) { - case _VENDOR_SPECIFIC_IE_: + case WLAN_EID_VENDOR_SPECIFIC: /* to update WMM paramter set while receiving beacon */ if (_rtw_memcmp(pIE->data, WMM_PARA_OUI, 6) && pIE->Length == WLAN_WMM_LEN) /* WMM */ (WMM_param_handler(padapter, pIE)) ? report_wmm_edca_update(padapter) : 0; break; - case _HT_EXTRA_INFO_IE_: /* HT info */ + case WLAN_EID_HT_OPERATION: /* HT info */ /* HT_info_handler(padapter, pIE); */ bwmode_update_check(padapter, pIE); break; @@ -2695,13 +2695,13 @@ void update_beacon_info(_adapter *padapter, u8 *pframe, uint pkt_len, struct sta rtw_process_vht_op_mode_notify(padapter, pIE->data, psta); break; #endif /* CONFIG_80211AC_VHT */ - case _ERPINFO_IE_: + case WLAN_EID_ERP_INFO: ERP_IE_handler(padapter, pIE); VCS_update(padapter, psta); break; #ifdef CONFIG_TDLS - case _EXT_CAP_IE_: + case WLAN_EID_EXT_CAPABILITY : if (check_ap_tdls_prohibited(pIE->data, pIE->Length) == _TRUE) ptdlsinfo->ap_prohibited = _TRUE; if (check_ap_tdls_ch_switching_prohibited(pIE->data, pIE->Length) == _TRUE) @@ -2813,12 +2813,12 @@ unsigned int is_ap_in_tkip(_adapter *padapter) pIE = (PNDIS_802_11_VARIABLE_IEs)(pmlmeinfo->network.IEs + i); switch (pIE->ElementID) { - case _VENDOR_SPECIFIC_IE_: + case WLAN_EID_VENDOR_SPECIFIC: if ((_rtw_memcmp(pIE->data, RTW_WPA_OUI, 4)) && (_rtw_memcmp((pIE->data + 12), WPA_TKIP_CIPHER, 4))) return _TRUE; break; - case _RSN_IE_2_: + case WLAN_EID_RSN: if (_rtw_memcmp((pIE->data + 8), RSN_TKIP_CIPHER, 4)) return _TRUE; @@ -2847,14 +2847,14 @@ unsigned int should_forbid_n_rate(_adapter *padapter) pIE = (PNDIS_802_11_VARIABLE_IEs)(cur_network->IEs + i); switch (pIE->ElementID) { - case _VENDOR_SPECIFIC_IE_: + case WLAN_EID_VENDOR_SPECIFIC: if (_rtw_memcmp(pIE->data, RTW_WPA_OUI, 4) && ((_rtw_memcmp((pIE->data + 12), WPA_CIPHER_SUITE_CCMP, 4)) || (_rtw_memcmp((pIE->data + 16), WPA_CIPHER_SUITE_CCMP, 4)))) return _FALSE; break; - case _RSN_IE_2_: + case WLAN_EID_RSN: if ((_rtw_memcmp((pIE->data + 8), RSN_CIPHER_SUITE_CCMP, 4)) || (_rtw_memcmp((pIE->data + 12), RSN_CIPHER_SUITE_CCMP, 4))) return _FALSE; @@ -2886,12 +2886,12 @@ unsigned int is_ap_in_wep(_adapter *padapter) pIE = (PNDIS_802_11_VARIABLE_IEs)(pmlmeinfo->network.IEs + i); switch (pIE->ElementID) { - case _VENDOR_SPECIFIC_IE_: + case WLAN_EID_VENDOR_SPECIFIC: if (_rtw_memcmp(pIE->data, RTW_WPA_OUI, 4)) return _FALSE; break; - case _RSN_IE_2_: + case WLAN_EID_RSN: return _FALSE; default: @@ -3098,7 +3098,7 @@ unsigned char check_assoc_AP(u8 *pframe, uint len) pIE = (PNDIS_802_11_VARIABLE_IEs)(pframe + i); switch (pIE->ElementID) { - case _VENDOR_SPECIFIC_IE_: + case WLAN_EID_VENDOR_SPECIFIC: if ((_rtw_memcmp(pIE->data, ARTHEROS_OUI1, 3)) || (_rtw_memcmp(pIE->data, ARTHEROS_OUI2, 3))) { RTW_INFO("link to Artheros AP\n"); return HT_IOT_PEER_ATHEROS; @@ -3462,7 +3462,7 @@ int rtw_ies_get_supported_rate(u8 *ies, uint ies_len, u8 *rate_set, u8 *rate_num return _FALSE; *rate_num = 0; - ie = rtw_get_ie(ies, _SUPPORTEDRATES_IE_, &ie_len, ies_len); + ie = rtw_get_ie(ies, WLAN_EID_SUPP_RATES, &ie_len, ies_len); if (ie == NULL) goto ext_rate; @@ -3480,7 +3480,7 @@ int rtw_ies_get_supported_rate(u8 *ies, uint ies_len, u8 *rate_set, u8 *rate_num } ext_rate: - ie = rtw_get_ie(ies, _EXT_SUPPORTEDRATES_IE_, &ie_len, ies_len); + ie = rtw_get_ie(ies, WLAN_EID_EXT_SUPP_RATES, &ie_len, ies_len); if (ie) { /* get valid extended supported rates */ for (i = 0; i < 12; i++) { @@ -4200,7 +4200,7 @@ unsigned int setup_beacon_frame(_adapter *padapter, unsigned char *beacon_frame) memcpy(pwlanhdr->addr2, adapter_mac_addr(padapter), ETH_ALEN); memcpy(pwlanhdr->addr3, get_my_bssid(cur_network), ETH_ALEN); - set_frame_sub_type(pframe, WIFI_BEACON); + set_frame_sub_type(pframe, IEEE80211_STYPE_BEACON); pframe += sizeof(struct rtw_ieee80211_hdr_3addr); len = sizeof(struct rtw_ieee80211_hdr_3addr); @@ -4222,25 +4222,25 @@ unsigned int setup_beacon_frame(_adapter *padapter, unsigned char *beacon_frame) len += 2; /* SSID */ - pframe = rtw_set_ie(pframe, _SSID_IE_, cur_network->Ssid.SsidLength, cur_network->Ssid.Ssid, &len); + pframe = rtw_set_ie(pframe, WLAN_EID_SSID, cur_network->Ssid.SsidLength, cur_network->Ssid.Ssid, &len); /* supported rates... */ rate_len = rtw_get_rateset_len(cur_network->SupportedRates); - pframe = rtw_set_ie(pframe, _SUPPORTEDRATES_IE_, ((rate_len > 8) ? 8 : rate_len), cur_network->SupportedRates, &len); + pframe = rtw_set_ie(pframe, WLAN_EID_SUPP_RATES, ((rate_len > 8) ? 8 : rate_len), cur_network->SupportedRates, &len); /* DS parameter set */ - pframe = rtw_set_ie(pframe, _DSSET_IE_, 1, (unsigned char *)&(cur_network->Configuration.DSConfig), &len); + pframe = rtw_set_ie(pframe, WLAN_EID_DS_PARAMS, 1, (unsigned char *)&(cur_network->Configuration.DSConfig), &len); /* IBSS Parameter Set... */ /* ATIMWindow = cur->Configuration.ATIMWindow; */ ATIMWindow = 0; - pframe = rtw_set_ie(pframe, _IBSS_PARA_IE_, 2, (unsigned char *)(&ATIMWindow), &len); + pframe = rtw_set_ie(pframe, WLAN_EID_IBSS_PARAMS, 2, (unsigned char *)(&ATIMWindow), &len); /* todo: ERP IE */ /* EXTERNDED SUPPORTED RATE */ if (rate_len > 8) - pframe = rtw_set_ie(pframe, _EXT_SUPPORTEDRATES_IE_, (rate_len - 8), (cur_network->SupportedRates + 8), &len); + pframe = rtw_set_ie(pframe, WLAN_EID_EXT_SUPP_RATES, (rate_len - 8), (cur_network->SupportedRates + 8), &len); if ((len + TXDESC_SIZE) > 256) { /* RTW_INFO("marc: beacon frame too large\n"); */ diff --git a/core/rtw_xmit.c b/core/rtw_xmit.c index 158e679..c547dcf 100644 --- a/core/rtw_xmit.c +++ b/core/rtw_xmit.c @@ -347,13 +347,6 @@ exit: return res; } -void rtw_mfree_xmit_priv_lock(struct xmit_priv *pxmitpriv); -void rtw_mfree_xmit_priv_lock(struct xmit_priv *pxmitpriv) -{ - _rtw_free_sema(&pxmitpriv->xmit_sema); -} - - void _rtw_free_xmit_priv(struct xmit_priv *pxmitpriv) { int i; @@ -364,8 +357,6 @@ void _rtw_free_xmit_priv(struct xmit_priv *pxmitpriv) rtw_hal_free_xmit_priv(padapter); - rtw_mfree_xmit_priv_lock(pxmitpriv); - if (pxmitpriv->pxmit_frame_buf == NULL) goto out; @@ -1167,7 +1158,7 @@ static void set_qos(struct pkt_file *ppktfile, struct pkt_attrib *pattrib) #endif/*CONFIG_IP_R_MONITOR*/ pattrib->priority = UserPriority; pattrib->hdrlen = WLAN_HDR_A3_QOS_LEN; - pattrib->subtype = WIFI_QOS_DATA_TYPE; + pattrib->subtype = (IEEE80211_STYPE_QOS_DATA | IEEE80211_FTYPE_DATA); } #ifdef CONFIG_TDLS @@ -1232,11 +1223,11 @@ s32 update_tdls_attrib(_adapter *padapter, struct pkt_attrib *pattrib) if (pqospriv->qos_option && psta->qos_option) { pattrib->priority = 4; /* tdls management frame should be AC_VI */ pattrib->hdrlen = WLAN_HDR_A3_QOS_LEN; - pattrib->subtype = WIFI_QOS_DATA_TYPE; + pattrib->subtype = (IEEE80211_STYPE_QOS_DATA | IEEE80211_FTYPE_DATA); } else { pattrib->priority = 0; pattrib->hdrlen = WLAN_HDR_A3_LEN; - pattrib->subtype = WIFI_DATA_TYPE; + pattrib->subtype = IEEE80211_FTYPE_DATA; } /* TODO:_lock */ @@ -1499,7 +1490,7 @@ get_sta_info: pattrib->pkt_hdrlen = ETH_HLEN;/* (pattrib->ether_type == 0x8100) ? (14 + 4 ): 14; */ /* vlan tag */ pattrib->hdrlen = WLAN_HDR_A3_LEN; - pattrib->subtype = WIFI_DATA_TYPE; + pattrib->subtype = IEEE80211_FTYPE_DATA; pattrib->qos_en = psta->qos_option; pattrib->priority = 0; @@ -1766,7 +1757,7 @@ s32 rtw_make_wlanhdr(_adapter *padapter , u8 *hdr, struct pkt_attrib *pattrib) set_frame_sub_type(fctrl, pattrib->subtype); - if (pattrib->subtype & WIFI_DATA_TYPE) { + if (pattrib->subtype & IEEE80211_FTYPE_DATA) { if ((check_fwstate(pmlmepriv, WIFI_STATION_STATE) == _TRUE)) { #ifdef CONFIG_TDLS if (pattrib->direct_link == _TRUE) { @@ -2805,9 +2796,9 @@ s32 rtw_mgmt_xmitframe_coalesce(_adapter *padapter, _pkt *pkt, struct xmit_frame subtype = get_frame_sub_type(pframe); /* bit(7)~bit(2) */ /* check if robust mgmt frame */ - if (subtype != WIFI_DEAUTH && subtype != WIFI_DISASSOC && subtype != WIFI_ACTION) + if (subtype != IEEE80211_STYPE_DEAUTH && subtype != IEEE80211_STYPE_DISASSOC && subtype != IEEE80211_STYPE_ACTION) return _SUCCESS; - if (subtype == WIFI_ACTION) { + if (subtype == IEEE80211_STYPE_ACTION) { category = *(pframe + sizeof(struct rtw_ieee80211_hdr_3addr)); if (CATEGORY_IS_NON_ROBUST(category)) return _SUCCESS; @@ -2840,7 +2831,7 @@ s32 rtw_mgmt_xmitframe_coalesce(_adapter *padapter, _pkt *pkt, struct xmit_frame _enter_critical_bh(&padapter->security_key_mutex, &irqL); if (bmcst) { - if (subtype == WIFI_ACTION && CATEGORY_IS_GROUP_PRIVACY(category)) { + if (subtype == IEEE80211_STYPE_ACTION && CATEGORY_IS_GROUP_PRIVACY(category)) { /* broadcast group privacy action frame */ #if DBG_MGMT_XMIT_COALESEC_DUMP RTW_INFO(FUNC_ADPT_FMT" broadcast gp action(%u)\n" @@ -2875,11 +2866,11 @@ s32 rtw_mgmt_xmitframe_coalesce(_adapter *padapter, _pkt *pkt, struct xmit_frame goto xmitframe_coalesce_success; #if DBG_MGMT_XMIT_COALESEC_DUMP - if (subtype == WIFI_DEAUTH) + if (subtype == IEEE80211_STYPE_DEAUTH) RTW_INFO(FUNC_ADPT_FMT" braodcast deauth\n", FUNC_ADPT_ARG(padapter)); - else if (subtype == WIFI_DISASSOC) + else if (subtype == IEEE80211_STYPE_DISASSOC) RTW_INFO(FUNC_ADPT_FMT" braodcast disassoc\n", FUNC_ADPT_ARG(padapter)); - else if (subtype == WIFI_ACTION) { + else if (subtype == IEEE80211_STYPE_ACTION) { RTW_INFO(FUNC_ADPT_FMT" braodcast action(%u)\n" , FUNC_ADPT_ARG(padapter), category); } @@ -2897,7 +2888,7 @@ s32 rtw_mgmt_xmitframe_coalesce(_adapter *padapter, _pkt *pkt, struct xmit_frame RTW_PUT_LE64(&MME[2], padapter->securitypriv.dot11wBIPtxpn.val); /* add MME IE with MIC all zero, MME string doesn't include element id and length */ - pframe = rtw_set_ie(pframe, _MME_IE_ , 16 , MME, &(pattrib->pktlen)); + 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); @@ -2961,13 +2952,13 @@ s32 rtw_mgmt_xmitframe_coalesce(_adapter *padapter, _pkt *pkt, struct xmit_frame else { /* unicast robust mgmt frame */ #if DBG_MGMT_XMIT_COALESEC_DUMP - if (subtype == WIFI_DEAUTH) { + if (subtype == IEEE80211_STYPE_DEAUTH) { RTW_INFO(FUNC_ADPT_FMT" unicast deauth to "MAC_FMT"\n" , FUNC_ADPT_ARG(padapter), MAC_ARG(pattrib->ra)); - } else if (subtype == WIFI_DISASSOC) { + } else if (subtype == IEEE80211_STYPE_DISASSOC) { RTW_INFO(FUNC_ADPT_FMT" unicast disassoc to "MAC_FMT"\n" , FUNC_ADPT_ARG(padapter), MAC_ARG(pattrib->ra)); - } else if (subtype == WIFI_ACTION) { + } else if (subtype == IEEE80211_STYPE_ACTION) { RTW_INFO(FUNC_ADPT_FMT" unicast action(%u) to "MAC_FMT"\n" , FUNC_ADPT_ARG(padapter), category, MAC_ARG(pattrib->ra)); } @@ -3133,7 +3124,7 @@ void rtw_update_protection(_adapter *padapter, u8 *ie, uint ie_len) case AUTO_VCS: default: - perp = rtw_get_ie(ie, _ERPINFO_IE_, &erp_len, ie_len); + perp = rtw_get_ie(ie, WLAN_EID_ERP_INFO, &erp_len, ie_len); if (perp == NULL) pxmitpriv->vcs = NONE_VCS; else { @@ -3657,7 +3648,7 @@ void rtw_free_xmitframe_queue(struct xmit_priv *pxmitpriv, _queue *pframequeue) phead = get_list_head(pframequeue); plist = get_next(phead); - while (rtw_end_of_queue_search(phead, plist) == _FALSE) { + while (phead != plist) { pxmitframe = LIST_CONTAINOR(plist, struct xmit_frame, list); @@ -3689,7 +3680,7 @@ static struct xmit_frame *dequeue_one_xmitframe(struct xmit_priv *pxmitpriv, str xmitframe_phead = get_list_head(pframe_queue); xmitframe_plist = get_next(xmitframe_phead); - while ((rtw_end_of_queue_search(xmitframe_phead, xmitframe_plist)) == _FALSE) { + while (xmitframe_phead != xmitframe_plist) { pxmitframe = LIST_CONTAINOR(xmitframe_plist, struct xmit_frame, list); /* xmitframe_plist = get_next(xmitframe_plist); */ @@ -3731,7 +3722,7 @@ static struct xmit_frame *get_one_xmitframe(struct xmit_priv *pxmitpriv, struct xmitframe_phead = get_list_head(pframe_queue); xmitframe_plist = get_next(xmitframe_phead); - while ((rtw_end_of_queue_search(xmitframe_phead, xmitframe_plist)) == _FALSE) { + while (xmitframe_phead != xmitframe_plist) { pxmitframe = LIST_CONTAINOR(xmitframe_plist, struct xmit_frame, list); break; } @@ -3774,7 +3765,7 @@ struct xmit_frame *rtw_get_xframe(struct xmit_priv *pxmitpriv, int *num_frame) sta_phead = get_list_head(phwxmit->sta_queue); sta_plist = get_next(sta_phead); - while ((rtw_end_of_queue_search(sta_phead, sta_plist)) == _FALSE) { + while (sta_phead != sta_plist) { ptxservq = LIST_CONTAINOR(sta_plist, struct tx_servq, tx_pending); pframe_queue = &ptxservq->sta_pending; @@ -3840,7 +3831,7 @@ struct xmit_frame *rtw_dequeue_xframe(struct xmit_priv *pxmitpriv, struct hw_xmi sta_phead = get_list_head(phwxmit->sta_queue); sta_plist = get_next(sta_phead); - while ((rtw_end_of_queue_search(sta_phead, sta_plist)) == _FALSE) { + while (sta_phead != sta_plist) { ptxservq = LIST_CONTAINOR(sta_plist, struct tx_servq, tx_pending); @@ -4543,14 +4534,14 @@ s32 rtw_xmit(_adapter *padapter, _pkt **ppkt) return -1; if (start == 0) - start = rtw_get_current_time(); + start = jiffies; pxmitframe = rtw_alloc_xmitframe(pxmitpriv); if (rtw_get_passing_time_ms(start) > 2000) { if (drop_cnt) RTW_INFO("DBG_TX_DROP_FRAME %s no more pxmitframe, drop_cnt:%u\n", __FUNCTION__, drop_cnt); - start = rtw_get_current_time(); + start = jiffies; drop_cnt = 0; } @@ -4599,7 +4590,7 @@ s32 rtw_xmit(_adapter *padapter, _pkt **ppkt) _list *list = get_next(&b2u_list); struct xmit_frame *b2uframe; - while ((rtw_end_of_queue_search(&b2u_list, list)) == _FALSE) { + while (&b2u_list != list) { b2uframe = LIST_CONTAINOR(list, struct xmit_frame, list); list = get_next(list); rtw_list_delete(&b2uframe->list); @@ -4825,9 +4816,9 @@ sint xmitframe_enqueue_for_sleeping_sta(_adapter *padapter, struct xmit_frame *p /* RTW_INFO_DUMP("enqueue, tim=", pstapriv->tim_bitmap, pstapriv->aid_bmp_len); */ if (update_tim == _TRUE) { if (is_broadcast_mac_addr(pattrib->ra)) - _update_beacon(padapter, _TIM_IE_, NULL, _TRUE, "buffer BC"); + _update_beacon(padapter, WLAN_EID_DS_PARAMS, NULL, _TRUE, "buffer BC"); else - _update_beacon(padapter, _TIM_IE_, NULL, _TRUE, "buffer MC"); + _update_beacon(padapter, WLAN_EID_DS_PARAMS, NULL, _TRUE, "buffer MC"); } else chk_bmc_sleepq_cmd(padapter); @@ -4894,7 +4885,7 @@ sint xmitframe_enqueue_for_sleeping_sta(_adapter *padapter, struct xmit_frame *p if (update_tim == _TRUE) { /* RTW_INFO("sleepq_len==1, update BCNTIM\n"); */ /* upate BCN for TIM IE */ - _update_beacon(padapter, _TIM_IE_, NULL, _TRUE, "buffer UC"); + _update_beacon(padapter, WLAN_EID_DS_PARAMS, NULL, _TRUE, "buffer UC"); } } @@ -4931,7 +4922,7 @@ static void dequeue_xmitframes_to_sleeping_queue(_adapter *padapter, struct sta_ phead = get_list_head(pframequeue); plist = get_next(phead); - while (rtw_end_of_queue_search(phead, plist) == _FALSE) { + while (phead != plist) { pxmitframe = LIST_CONTAINOR(plist, struct xmit_frame, list); plist = get_next(plist); @@ -5029,7 +5020,7 @@ void wakeup_sta_to_xmit(_adapter *padapter, struct sta_info *psta) xmitframe_phead = get_list_head(&psta->sleep_q); xmitframe_plist = get_next(xmitframe_phead); - while ((rtw_end_of_queue_search(xmitframe_phead, xmitframe_plist)) == _FALSE) { + while (xmitframe_phead != xmitframe_plist) { pxmitframe = LIST_CONTAINOR(xmitframe_plist, struct xmit_frame, list); xmitframe_plist = get_next(xmitframe_plist); @@ -5129,7 +5120,7 @@ void wakeup_sta_to_xmit(_adapter *padapter, struct sta_info *psta) xmitframe_phead = get_list_head(&psta_bmc->sleep_q); xmitframe_plist = get_next(xmitframe_phead); - while ((rtw_end_of_queue_search(xmitframe_phead, xmitframe_plist)) == _FALSE) { + while (xmitframe_phead != xmitframe_plist) { pxmitframe = LIST_CONTAINOR(xmitframe_plist, struct xmit_frame, list); xmitframe_plist = get_next(xmitframe_plist); @@ -5179,11 +5170,11 @@ _exit: if (update_mask) { /* update_BCNTIM(padapter); */ if ((update_mask & (BIT(0) | BIT(1))) == (BIT(0) | BIT(1))) - _update_beacon(padapter, _TIM_IE_, NULL, _TRUE, "clear UC&BMC"); + _update_beacon(padapter, WLAN_EID_DS_PARAMS, NULL, _TRUE, "clear UC&BMC"); else if ((update_mask & BIT(1)) == BIT(1)) - _update_beacon(padapter, _TIM_IE_, NULL, _TRUE, "clear BMC"); + _update_beacon(padapter, WLAN_EID_DS_PARAMS, NULL, _TRUE, "clear BMC"); else - _update_beacon(padapter, _TIM_IE_, NULL, _TRUE, "clear UC"); + _update_beacon(padapter, WLAN_EID_DS_PARAMS, NULL, _TRUE, "clear UC"); } } @@ -5204,7 +5195,7 @@ void xmit_delivery_enabled_frames(_adapter *padapter, struct sta_info *psta) xmitframe_phead = get_list_head(&psta->sleep_q); xmitframe_plist = get_next(xmitframe_phead); - while ((rtw_end_of_queue_search(xmitframe_phead, xmitframe_plist)) == _FALSE) { + while (xmitframe_phead != xmitframe_plist) { pxmitframe = LIST_CONTAINOR(xmitframe_plist, struct xmit_frame, list); xmitframe_plist = get_next(xmitframe_plist); @@ -5261,7 +5252,7 @@ void xmit_delivery_enabled_frames(_adapter *padapter, struct sta_info *psta) /* RTW_INFO_DUMP("update_BCNTIM, tim=", pstapriv->tim_bitmap, pstapriv->aid_bmp_len); */ /* upate BCN for TIM IE */ /* update_BCNTIM(padapter); */ - update_beacon(padapter, _TIM_IE_, NULL, _TRUE); + update_beacon(padapter, WLAN_EID_DS_PARAMS, NULL, _TRUE); /* update_mask = BIT(0); */ } @@ -5762,7 +5753,7 @@ u8 rtw_get_tx_desc_backup(_adapter *padapter, u8 hwq, struct rtw_tx_desc_backup void rtw_sctx_init(struct submit_ctx *sctx, int timeout_ms) { sctx->timeout_ms = timeout_ms; - sctx->submit_time = rtw_get_current_time(); + sctx->submit_time = jiffies; #ifdef PLATFORM_LINUX /* TODO: add condition wating interface for other os */ init_completion(&sctx->done); #endif @@ -5829,7 +5820,7 @@ int rtw_ack_tx_wait(struct xmit_priv *pxmitpriv, u32 timeout_ms) { struct submit_ctx *pack_tx_ops = &pxmitpriv->ack_tx_ops; - pack_tx_ops->submit_time = rtw_get_current_time(); + pack_tx_ops->submit_time = jiffies; pack_tx_ops->timeout_ms = timeout_ms; pack_tx_ops->status = RTW_SCTX_SUBMITTED; diff --git a/hal/hal_btcoex.c b/hal/hal_btcoex.c index 58701f1..fbed20a 100644 --- a/hal/hal_btcoex.c +++ b/hal/hal_btcoex.c @@ -394,7 +394,7 @@ void halbtcoutsrc_LeaveLowPower(PBTC_COEXIST pBtCoexist) if (GLBtcBtCoexAliveRegistered == _TRUE) return; - stime = rtw_get_current_time(); + stime = jiffies; do { ready = rtw_register_task_alive(padapter, BTCOEX_ALIVE); if (_SUCCESS == ready) @@ -454,7 +454,7 @@ void halbtcoutsrc_AggregationCheck(PBTC_COEXIST pBtCoexist) /* It can only be called after 8 seconds. */ /* ===================================== */ - curTime = rtw_systime_to_ms(rtw_get_current_time()); + curTime = jiffies_to_msecs(jiffies); if ((curTime - preTime) < HALBTCOUTSRC_AGG_CHK_WINDOW_IN_MS) /* over 8 seconds you can execute this function again. */ return; else diff --git a/hal/hal_com.c b/hal/hal_com.c index 825bfba..bdc3b2d 100644 --- a/hal/hal_com.c +++ b/hal/hal_com.c @@ -1376,7 +1376,7 @@ int c2h_iqk_offload_wait(_adapter *adapter, u32 timeout_ms) HAL_DATA_TYPE *hal_data = GET_HAL_DATA(adapter); struct submit_ctx *iqk_sctx = &hal_data->iqk_sctx; - iqk_sctx->submit_time = rtw_get_current_time(); + iqk_sctx->submit_time = jiffies; iqk_sctx->timeout_ms = timeout_ms; iqk_sctx->status = RTW_SCTX_SUBMITTED; @@ -1536,7 +1536,7 @@ int hal_read_mac_hidden_rpt(_adapter *adapter) int ret = _FAIL; int ret_fwdl; u8 mac_hidden_rpt[MAC_HIDDEN_RPT_LEN + MAC_HIDDEN_RPT_2_LEN] = {0}; - systime start = rtw_get_current_time(); + systime start = jiffies; u32 cnt = 0; u32 timeout_ms = 800; u32 min_cnt = 10; @@ -1562,7 +1562,7 @@ int hal_read_mac_hidden_rpt(_adapter *adapter) goto mac_hidden_rpt_hdl; /* polling for data ready */ - start = rtw_get_current_time(); + start = jiffies; do { cnt++; id = rtw_read8(adapter, REG_C2HEVT_MSG_NORMAL); @@ -2088,7 +2088,7 @@ if (padapter->registrypriv.ht_enable && is_supported_ht(padapter->registrypriv.w } } - tmp64 = rtw_ht_mcs_set_to_bitmap(psta->htpriv.ht_cap.supp_mcs_set, tx_nss); + tmp64 = rtw_ht_mcs_set_to_bitmap(psta->htpriv.ht_cap.mcs.rx_mask, tx_nss); tx_ra_bitmap |= (tmp64 << 12); } } @@ -2249,7 +2249,7 @@ u32 rtw_sec_read_cam(_adapter *adapter, u8 addr) rtw_write32(adapter, REG_CAMCMD, CAM_POLLINIG | addr); - start = rtw_get_current_time(); + start = jiffies; while (1) { if (rtw_is_surprise_removed(adapter)) { sr = 1; @@ -2265,7 +2265,7 @@ u32 rtw_sec_read_cam(_adapter *adapter, u8 addr) break; } } - end = rtw_get_current_time(); + end = jiffies; rdata = rtw_read32(adapter, REG_CAMREAD); @@ -2292,7 +2292,7 @@ void rtw_sec_write_cam(_adapter *adapter, u8 addr, u32 wdata) rtw_write32(adapter, REG_CAMWRITE, wdata); rtw_write32(adapter, REG_CAMCMD, CAM_POLLINIG | CAM_WRITE | addr); - start = rtw_get_current_time(); + start = jiffies; while (1) { if (rtw_is_surprise_removed(adapter)) { sr = 1; @@ -2308,7 +2308,7 @@ void rtw_sec_write_cam(_adapter *adapter, u8 addr, u32 wdata) break; } } - end = rtw_get_current_time(); + end = jiffies; _exit_critical_mutex(mutex, NULL); @@ -3366,7 +3366,7 @@ static void rtw_hal_tsf_update_pause(_adapter *adapter) rtw_hal_set_tsf_update(iface, 0); if (iface->mlmeextpriv.tsf_update_required) { - iface->mlmeextpriv.tsf_update_pause_stime = rtw_get_current_time(); + iface->mlmeextpriv.tsf_update_pause_stime = jiffies; if (!iface->mlmeextpriv.tsf_update_pause_stime) iface->mlmeextpriv.tsf_update_pause_stime++; } @@ -3413,7 +3413,7 @@ void rtw_hal_periodic_tsf_update_chk(_adapter *adapter) u32 restore_ms = 0; if (dvobj->periodic_tsf_update_etime) { - if (rtw_time_after(rtw_get_current_time(), dvobj->periodic_tsf_update_etime)) { + if (rtw_time_after(jiffies, dvobj->periodic_tsf_update_etime)) { /* end for restore status */ dvobj->periodic_tsf_update_etime = 0; rtw_hal_rcr_set_chk_bssid(adapter, MLME_ACTION_NONE); @@ -3448,7 +3448,7 @@ void rtw_hal_periodic_tsf_update_chk(_adapter *adapter) if (!restore_ms) return; - dvobj->periodic_tsf_update_etime = rtw_get_current_time() + rtw_ms_to_systime(restore_ms); + dvobj->periodic_tsf_update_etime = jiffies + msecs_to_jiffies(restore_ms); if (!dvobj->periodic_tsf_update_etime) dvobj->periodic_tsf_update_etime++; @@ -5994,7 +5994,7 @@ static void rtw_hal_construct_P2PBeacon(_adapter *padapter, u8 *pframe, u32 *pLe SetSeqNum(pwlanhdr, 0/*pmlmeext->mgnt_seq*/); /* pmlmeext->mgnt_seq++; */ - set_frame_sub_type(pframe, WIFI_BEACON); + set_frame_sub_type(pframe, IEEE80211_STYPE_BEACON); pframe += sizeof(struct rtw_ieee80211_hdr_3addr); pktlen = sizeof(struct rtw_ieee80211_hdr_3addr); @@ -6174,14 +6174,14 @@ static void rtw_hal_construct_P2PBeacon(_adapter *padapter, u8 *pframe, u32 *pLe pktlen += 2; /* SSID */ - pframe = rtw_set_ie(pframe, _SSID_IE_, cur_network->Ssid.SsidLength, cur_network->Ssid.Ssid, &pktlen); + pframe = rtw_set_ie(pframe, WLAN_EID_SSID, cur_network->Ssid.SsidLength, cur_network->Ssid.Ssid, &pktlen); /* supported rates... */ rate_len = rtw_get_rateset_len(cur_network->SupportedRates); - pframe = rtw_set_ie(pframe, _SUPPORTEDRATES_IE_, ((rate_len > 8) ? 8 : rate_len), cur_network->SupportedRates, &pktlen); + pframe = rtw_set_ie(pframe, WLAN_EID_SUPP_RATES, ((rate_len > 8) ? 8 : rate_len), cur_network->SupportedRates, &pktlen); /* DS parameter set */ - pframe = rtw_set_ie(pframe, _DSSET_IE_, 1, (unsigned char *)&(cur_network->Configuration.DSConfig), &pktlen); + pframe = rtw_set_ie(pframe, WLAN_EID_DS_PARAMS, 1, (unsigned char *)&(cur_network->Configuration.DSConfig), &pktlen); /* if( (pmlmeinfo->state&0x03) == WIFI_FW_ADHOC_STATE) */ { @@ -6190,16 +6190,16 @@ static void rtw_hal_construct_P2PBeacon(_adapter *padapter, u8 *pframe, u32 *pLe /* IBSS Parameter Set... */ /* ATIMWindow = cur->Configuration.ATIMWindow; */ ATIMWindow = 0; - pframe = rtw_set_ie(pframe, _IBSS_PARA_IE_, 2, (unsigned char *)(&ATIMWindow), &pktlen); + pframe = rtw_set_ie(pframe, WLAN_EID_IBSS_PARAMS, 2, (unsigned char *)(&ATIMWindow), &pktlen); /* ERP IE */ - pframe = rtw_set_ie(pframe, _ERPINFO_IE_, 1, &erpinfo, &pktlen); + pframe = rtw_set_ie(pframe, WLAN_EID_ERP_INFO, 1, &erpinfo, &pktlen); } /* EXTERNDED SUPPORTED RATE */ if (rate_len > 8) - pframe = rtw_set_ie(pframe, _EXT_SUPPORTEDRATES_IE_, (rate_len - 8), (cur_network->SupportedRates + 8), &pktlen); + pframe = rtw_set_ie(pframe, WLAN_EID_EXT_SUPP_RATES, (rate_len - 8), (cur_network->SupportedRates + 8), &pktlen); /* todo:HT for adhoc */ @@ -6273,7 +6273,7 @@ static void rtw_hal_construct_P2PProbeRsp(_adapter *padapter, u8 *pframe, u32 *p memcpy(pwlanhdr->addr3, mac, ETH_ALEN); SetSeqNum(pwlanhdr, 0); - set_frame_sub_type(fctrl, WIFI_PROBERSP); + set_frame_sub_type(fctrl, IEEE80211_STYPE_PROBE_RESP); pktlen = sizeof(struct rtw_ieee80211_hdr_3addr); pframe += pktlen; @@ -6299,14 +6299,14 @@ static void rtw_hal_construct_P2PProbeRsp(_adapter *padapter, u8 *pframe, u32 *p /* SSID */ - pframe = rtw_set_ie(pframe, _SSID_IE_, 7, pwdinfo->p2p_wildcard_ssid, &pktlen); + pframe = rtw_set_ie(pframe, WLAN_EID_SSID, 7, pwdinfo->p2p_wildcard_ssid, &pktlen); /* supported rates... */ /* Use the OFDM rate in the P2P probe response frame. ( 6(B), 9(B), 12, 18, 24, 36, 48, 54 ) */ - pframe = rtw_set_ie(pframe, _SUPPORTEDRATES_IE_, 8, pwdinfo->support_rate, &pktlen); + pframe = rtw_set_ie(pframe, WLAN_EID_SUPP_RATES, 8, pwdinfo->support_rate, &pktlen); /* DS parameter set */ - pframe = rtw_set_ie(pframe, _DSSET_IE_, 1, (unsigned char *)&pwdinfo->listen_channel, &pktlen); + pframe = rtw_set_ie(pframe, WLAN_EID_DS_PARAMS, 1, (unsigned char *)&pwdinfo->listen_channel, &pktlen); #ifdef CONFIG_IOCTL_CFG80211 if (pwdinfo->driver_interface == DRIVER_CFG80211) { @@ -6520,7 +6520,7 @@ static void rtw_hal_construct_P2PProbeRsp(_adapter *padapter, u8 *pframe, u32 *p wpsielen += 2; - pframe = rtw_set_ie(pframe, _VENDOR_SPECIFIC_IE_, wpsielen, (unsigned char *) wpsie, &pktlen); + pframe = rtw_set_ie(pframe, WLAN_EID_VENDOR_SPECIFIC, wpsielen, (unsigned char *) wpsie, &pktlen); p2pielen = build_probe_resp_p2p_ie(pwdinfo, pframe); @@ -6596,7 +6596,7 @@ static void rtw_hal_construct_P2PNegoRsp(_adapter *padapter, u8 *pframe, u32 *pL memcpy(pwlanhdr->addr3, adapter_mac_addr(padapter), ETH_ALEN); SetSeqNum(pwlanhdr, 0); - set_frame_sub_type(pframe, WIFI_ACTION); + set_frame_sub_type(pframe, IEEE80211_STYPE_ACTION); pktlen = sizeof(struct rtw_ieee80211_hdr_3addr); pframe += pktlen; @@ -6648,7 +6648,7 @@ static void rtw_hal_construct_P2PNegoRsp(_adapter *padapter, u8 *pframe, u32 *pL *(u16 *)(wpsie + wpsielen) = cpu_to_be16(WPS_DPID_PBC); wpsielen += 2; - pframe = rtw_set_ie(pframe, _VENDOR_SPECIFIC_IE_, wpsielen, (unsigned char *) wpsie, &pktlen); + pframe = rtw_set_ie(pframe, WLAN_EID_VENDOR_SPECIFIC, wpsielen, (unsigned char *) wpsie, &pktlen); /* P2P IE Section. */ @@ -6930,7 +6930,7 @@ static void rtw_hal_construct_P2PNegoRsp(_adapter *padapter, u8 *pframe, u32 *pL } - pframe = rtw_set_ie(pframe, _VENDOR_SPECIFIC_IE_, p2pielen, (unsigned char *) p2pie, &pktlen); + pframe = rtw_set_ie(pframe, WLAN_EID_VENDOR_SPECIFIC, p2pielen, (unsigned char *) p2pie, &pktlen); #ifdef CONFIG_WFD wfdielen = build_nego_resp_wfd_ie(pwdinfo, pframe); @@ -6997,7 +6997,7 @@ static void rtw_hal_construct_P2PInviteRsp(_adapter *padapter, u8 *pframe, u32 * memset(pwlanhdr->addr3, 0, ETH_ALEN); SetSeqNum(pwlanhdr, 0); - set_frame_sub_type(pframe, WIFI_ACTION); + set_frame_sub_type(pframe, IEEE80211_STYPE_ACTION); pframe += sizeof(struct rtw_ieee80211_hdr_3addr); pktlen = sizeof(struct rtw_ieee80211_hdr_3addr); @@ -7175,7 +7175,7 @@ static void rtw_hal_construct_P2PInviteRsp(_adapter *padapter, u8 *pframe, u32 * } #endif - pframe = rtw_set_ie(pframe, _VENDOR_SPECIFIC_IE_, p2pielen, (unsigned char *) p2pie, &pktlen); + pframe = rtw_set_ie(pframe, WLAN_EID_VENDOR_SPECIFIC, p2pielen, (unsigned char *) p2pie, &pktlen); #ifdef CONFIG_WFD wfdielen = build_invitation_resp_wfd_ie(pwdinfo, pframe); @@ -7240,7 +7240,7 @@ static void rtw_hal_construct_P2PProvisionDisRsp(_adapter *padapter, u8 *pframe, memcpy(pwlanhdr->addr3, adapter_mac_addr(padapter), ETH_ALEN); SetSeqNum(pwlanhdr, 0); - set_frame_sub_type(pframe, WIFI_ACTION); + set_frame_sub_type(pframe, IEEE80211_STYPE_ACTION); pframe += sizeof(struct rtw_ieee80211_hdr_3addr); pktlen = sizeof(struct rtw_ieee80211_hdr_3addr); @@ -7288,7 +7288,7 @@ static void rtw_hal_construct_P2PProvisionDisRsp(_adapter *padapter, u8 *pframe, RTW_PUT_BE16(wpsie + wpsielen, WPS_CM_PUSH_BUTTON); wpsielen += 2; - pframe = rtw_set_ie(pframe, _VENDOR_SPECIFIC_IE_, wpsielen, (unsigned char *) wpsie, &pktlen); + pframe = rtw_set_ie(pframe, WLAN_EID_VENDOR_SPECIFIC, wpsielen, (unsigned char *) wpsie, &pktlen); #ifdef CONFIG_WFD wfdielen = build_provdisc_resp_wfd_ie(pwdinfo, pframe); @@ -7405,7 +7405,7 @@ void rtw_hal_construct_beacon(_adapter *padapter, SetSeqNum(pwlanhdr, 0/*pmlmeext->mgnt_seq*/); /* pmlmeext->mgnt_seq++; */ - set_frame_sub_type(pframe, WIFI_BEACON); + set_frame_sub_type(pframe, IEEE80211_STYPE_BEACON); pframe += sizeof(struct rtw_ieee80211_hdr_3addr); pktlen = sizeof(struct rtw_ieee80211_hdr_3addr); @@ -7438,21 +7438,21 @@ void rtw_hal_construct_beacon(_adapter *padapter, /* below for ad-hoc mode */ /* SSID */ - pframe = rtw_set_ie(pframe, _SSID_IE_, cur_network->Ssid.SsidLength, cur_network->Ssid.Ssid, &pktlen); + pframe = rtw_set_ie(pframe, WLAN_EID_SSID, cur_network->Ssid.SsidLength, cur_network->Ssid.Ssid, &pktlen); /* supported rates... */ rate_len = rtw_get_rateset_len(cur_network->SupportedRates); - pframe = rtw_set_ie(pframe, _SUPPORTEDRATES_IE_, ((rate_len > 8) ? 8 : rate_len), cur_network->SupportedRates, &pktlen); + pframe = rtw_set_ie(pframe, WLAN_EID_SUPP_RATES, ((rate_len > 8) ? 8 : rate_len), cur_network->SupportedRates, &pktlen); /* DS parameter set */ - pframe = rtw_set_ie(pframe, _DSSET_IE_, 1, (unsigned char *)&(cur_network->Configuration.DSConfig), &pktlen); + pframe = rtw_set_ie(pframe, WLAN_EID_DS_PARAMS, 1, (unsigned char *)&(cur_network->Configuration.DSConfig), &pktlen); if ((pmlmeinfo->state & 0x03) == WIFI_FW_ADHOC_STATE) { u32 ATIMWindow; /* IBSS Parameter Set... */ /* ATIMWindow = cur->Configuration.ATIMWindow; */ ATIMWindow = 0; - pframe = rtw_set_ie(pframe, _IBSS_PARA_IE_, 2, (unsigned char *)(&ATIMWindow), &pktlen); + pframe = rtw_set_ie(pframe, WLAN_EID_IBSS_PARAMS, 2, (unsigned char *)(&ATIMWindow), &pktlen); } @@ -7461,7 +7461,7 @@ void rtw_hal_construct_beacon(_adapter *padapter, /* EXTERNDED SUPPORTED RATE */ if (rate_len > 8) - pframe = rtw_set_ie(pframe, _EXT_SUPPORTEDRATES_IE_, (rate_len - 8), (cur_network->SupportedRates + 8), &pktlen); + pframe = rtw_set_ie(pframe, WLAN_EID_EXT_SUPP_RATES, (rate_len - 8), (cur_network->SupportedRates + 8), &pktlen); /* todo:HT for adhoc */ #endif @@ -7498,7 +7498,7 @@ static void rtw_hal_construct_PSPoll(_adapter *padapter, fctrl = &(pwlanhdr->frame_ctl); *(fctrl) = 0; SetPwrMgt(fctrl); - set_frame_sub_type(pframe, WIFI_PSPOLL); + set_frame_sub_type(pframe, (IEEE80211_FTYPE_CTL | IEEE80211_STYPE_PSPOLL)); /* AID. */ set_duration(pframe, (pmlmeinfo->aid | 0xc000)); @@ -7542,7 +7542,7 @@ void rtw_hal_construct_fw_dbg_msg_pkt( SetSeqNum(pwlanhdr, 0); - set_frame_sub_type(pframe, WIFI_DATA); + set_frame_sub_type(pframe, (IEEE80211_FTYPE_DATA | IEEE80211_STYPE_DATA)); pktlen = sizeof(struct rtw_ieee80211_hdr_3addr); @@ -7611,7 +7611,7 @@ void rtw_hal_construct_NullFunctionData( if (bQoS == _TRUE) { struct rtw_ieee80211_hdr_3addr_qos *pwlanqoshdr; - set_frame_sub_type(pframe, WIFI_QOS_DATA_NULL); + set_frame_sub_type(pframe, IEEE80211_FTYPE_DATA | IEEE80211_STYPE_QOS_NULLFUNC); pwlanqoshdr = (struct rtw_ieee80211_hdr_3addr_qos *)pframe; SetPriority(&pwlanqoshdr->qc, AC); @@ -7619,7 +7619,7 @@ void rtw_hal_construct_NullFunctionData( pktlen = sizeof(struct rtw_ieee80211_hdr_3addr_qos); } else { - set_frame_sub_type(pframe, WIFI_DATA_NULL); + set_frame_sub_type(pframe, IEEE80211_FTYPE_DATA | IEEE80211_STYPE_NULLFUNC); pktlen = sizeof(struct rtw_ieee80211_hdr_3addr); } @@ -7653,7 +7653,7 @@ void rtw_hal_construct_ProbeRsp(_adapter *padapter, u8 *pframe, u32 *pLength, memcpy(pwlanhdr->addr3, bssid, ETH_ALEN); SetSeqNum(pwlanhdr, 0); - set_frame_sub_type(fctrl, WIFI_PROBERSP); + set_frame_sub_type(fctrl, IEEE80211_STYPE_PROBE_RESP); pktlen = sizeof(struct rtw_ieee80211_hdr_3addr); pframe += pktlen; @@ -7749,7 +7749,7 @@ static void rtw_hal_construct_ARPRsp( /* ------------------------------------------------------------------------- */ /* MAC Header. */ /* ------------------------------------------------------------------------- */ - SetFrameType(fctrl, WIFI_DATA); + SetFrameType(fctrl, (IEEE80211_FTYPE_DATA | IEEE80211_STYPE_DATA)); /* set_frame_sub_type(fctrl, 0); */ SetToDs(fctrl); memcpy(pwlanhdr->addr1, get_my_bssid(&(pmlmeinfo->network)), ETH_ALEN); @@ -7883,7 +7883,7 @@ static void rtw_hal_construct_na_message(_adapter *padapter, /* ------------------------------------------------------------------------- */ /* MAC Header. */ /* ------------------------------------------------------------------------- */ - SetFrameType(fctrl, WIFI_DATA); + SetFrameType(fctrl, (IEEE80211_FTYPE_DATA | IEEE80211_STYPE_DATA)); SetToDs(fctrl); memcpy(pwlanhdr->addr1, get_my_bssid(&(pmlmeinfo->network)), ETH_ALEN); @@ -8054,25 +8054,25 @@ static void rtw_hal_construct_ProbeReq(_adapter *padapter, u8 *pframe, memcpy(pwlanhdr->addr2, mac, ETH_ALEN); SetSeqNum(pwlanhdr, 0); - set_frame_sub_type(pframe, WIFI_PROBEREQ); + set_frame_sub_type(pframe, IEEE80211_STYPE_PROBE_REQ); pktlen = sizeof(struct rtw_ieee80211_hdr_3addr); pframe += pktlen; if (ssid == NULL) - pframe = rtw_set_ie(pframe, _SSID_IE_, 0, NULL, &pktlen); + pframe = rtw_set_ie(pframe, WLAN_EID_SSID, 0, NULL, &pktlen); else { /* RTW_INFO("%s len:%d\n", ssid->SSID, ssid->SSID_len); */ - pframe = rtw_set_ie(pframe, _SSID_IE_, ssid->SSID_len, ssid->SSID, &pktlen); + pframe = rtw_set_ie(pframe, WLAN_EID_SSID, ssid->SSID_len, ssid->SSID, &pktlen); } get_rate_set(padapter, bssrate, &bssrate_len); if (bssrate_len > 8) { - pframe = rtw_set_ie(pframe, _SUPPORTEDRATES_IE_ , 8, bssrate, &pktlen); - pframe = rtw_set_ie(pframe, _EXT_SUPPORTEDRATES_IE_ , (bssrate_len - 8), (bssrate + 8), &pktlen); + pframe = rtw_set_ie(pframe, WLAN_EID_SUPP_RATES , 8, bssrate, &pktlen); + pframe = rtw_set_ie(pframe, WLAN_EID_EXT_SUPP_RATES , (bssrate_len - 8), (bssrate + 8), &pktlen); } else - pframe = rtw_set_ie(pframe, _SUPPORTEDRATES_IE_ , bssrate_len , bssrate, &pktlen); + pframe = rtw_set_ie(pframe, WLAN_EID_SUPP_RATES , bssrate_len , bssrate, &pktlen); *pLength = pktlen; } @@ -8232,7 +8232,7 @@ static void rtw_hal_construct_GTKRsp( /* ------------------------------------------------------------------------- */ /* MAC Header. */ /* ------------------------------------------------------------------------- */ - SetFrameType(fctrl, WIFI_DATA); + SetFrameType(fctrl, (IEEE80211_FTYPE_DATA | IEEE80211_STYPE_DATA)); /* set_frame_sub_type(fctrl, 0); */ SetToDs(fctrl); @@ -9280,7 +9280,7 @@ static u32 _rtw_wow_pattern_read_cam(_adapter *adapter, u8 addr) rtw_write32(adapter, REG_WKFMCAM_CMD, BIT_WKFCAM_POLLING_V1 | BIT_WKFCAM_ADDR_V2(addr)); - start = rtw_get_current_time(); + start = jiffies; while (1) { if (rtw_is_surprise_removed(adapter)) break; @@ -9351,7 +9351,7 @@ static void _rtw_wow_pattern_write_cam(_adapter *adapter, u8 addr, u32 wdata) rtw_write32(adapter, REG_WKFMCAM_RWD, wdata); rtw_write32(adapter, REG_WKFMCAM_CMD, BIT_WKFCAM_POLLING_V1 | BIT_WKFCAM_WE | BIT_WKFCAM_ADDR_V2(addr)); - start = rtw_get_current_time(); + start = jiffies; while (1) { if (rtw_is_surprise_removed(adapter)) break; @@ -9365,7 +9365,7 @@ static void _rtw_wow_pattern_write_cam(_adapter *adapter, u8 addr, u32 wdata) break; } } - end = rtw_get_current_time(); + end = jiffies; _exit_critical_mutex(mutex, NULL); @@ -9418,7 +9418,7 @@ static u8 _rtw_wow_pattern_clean_cam(_adapter *adapter) _enter_critical_mutex(mutex, NULL); rtw_write32(adapter, REG_WKFMCAM_CMD, BIT_WKFCAM_POLLING_V1 | BIT_WKFCAM_CLR_V1); - start = rtw_get_current_time(); + start = jiffies; while (1) { if (rtw_is_surprise_removed(adapter)) break; @@ -12442,7 +12442,7 @@ void rtw_dump_rx_dframe_info(_adapter *padapter, void *sel) phead = &(pstapriv->sta_hash[i]); plist = get_next(phead); - while ((rtw_end_of_queue_search(phead, plist)) == _FALSE) { + while (phead != plist) { psta = LIST_CONTAINOR(plist, struct sta_info, hash_list); plist = get_next(plist); @@ -12523,9 +12523,9 @@ void rtw_store_phy_info(_adapter *padapter, union recv_frame *prframe) } } #ifdef DBG_RX_DFRAME_RAW_DATA - if ((dframe_type == WIFI_DATA_TYPE) || (dframe_type == WIFI_QOS_DATA_TYPE) || (padapter->registrypriv.mp_mode == 1)) { + if ((dframe_type == IEEE80211_FTYPE_DATA) || (dframe_type == (IEEE80211_STYPE_QOS_DATA | IEEE80211_FTYPE_DATA)) || (padapter->registrypriv.mp_mode == 1)) { - /*RTW_INFO("=>%s WIFI_DATA_TYPE or WIFI_QOS_DATA_TYPE\n", __FUNCTION__);*/ + /*RTW_INFO("=>%s IEEE80211_FTYPE_DATA or (IEEE80211_STYPE_QOS_DATA | IEEE80211_FTYPE_DATA)\n", __FUNCTION__);*/ if (psta) { if (is_multicast_ether_addr(get_ra(get_recvframe_data(prframe)))) psta_dframe_info = &psta->sta_dframe_info_bmc; @@ -14424,7 +14424,7 @@ u8 rtw_ap_bcn_recovery(_adapter *padapter) #ifdef CONFIG_BCN_XMIT_PROTECT u8 rtw_ap_bcn_queue_empty_check(_adapter *padapter, u32 txbcn_timer_ms) { - u32 start_time = rtw_get_current_time(); + u32 start_time = jiffies; u8 bcn_queue_empty = _FALSE; do { @@ -14585,7 +14585,7 @@ u8 * rtw_hal_set_8812a_vendor_ie(_adapter *padapter , u8 *pframe ,uint *frlen ) vendor_info[6] = RT_HT_CAP_USE_JAGUAR_CCUT; else vendor_info[6] = RT_HT_CAP_USE_JAGUAR_BCUT; - pframe = rtw_set_ie(pframe, _VENDOR_SPECIFIC_IE_,vender_len,vendor_info , frlen); + pframe = rtw_set_ie(pframe, WLAN_EID_VENDOR_SPECIFIC,vender_len,vendor_info , frlen); return pframe; } diff --git a/hal/hal_com_phycfg.c b/hal/hal_com_phycfg.c index 5dd7f27..d0a9f4e 100644 --- a/hal/hal_com_phycfg.c +++ b/hal/hal_com_phycfg.c @@ -2960,7 +2960,7 @@ s8 phy_get_txpwr_lmt_abs( lmt = hal_spec->txgi_max; head = &rfctl->txpwr_lmt_list; cur = get_next(head); - while ((rtw_end_of_queue_search(head, cur)) == _FALSE) { + while (head != cur) { ent = LIST_CONTAINOR(cur, struct txpwr_lmt_ent, list); cur = get_next(cur); if (ent->lmt_2g[bw][tlrs][ch_idx][ntx_idx] != ww_lmt_val) @@ -2979,7 +2979,7 @@ s8 phy_get_txpwr_lmt_abs( lmt = hal_spec->txgi_max; head = &rfctl->txpwr_lmt_list; cur = get_next(head); - while ((rtw_end_of_queue_search(head, cur)) == _FALSE) { + while (head != cur) { ent = LIST_CONTAINOR(cur, struct txpwr_lmt_ent, list); cur = get_next(cur); if (ent->lmt_5g[bw][tlrs - 1][ch_idx][ntx_idx] != ww_lmt_val) @@ -3174,7 +3174,7 @@ static void phy_txpwr_lmt_cck_ofdm_mt_chk(_adapter *adapter) head = &rfctl->txpwr_lmt_list; cur = get_next(head); - while ((rtw_end_of_queue_search(head, cur)) == _FALSE) { + while (head != cur) { ent = LIST_CONTAINOR(cur, struct txpwr_lmt_ent, list); cur = get_next(cur); @@ -3245,7 +3245,7 @@ static void phy_txpwr_lmt_cross_ref_ht_vht(_adapter *adapter) head = &rfctl->txpwr_lmt_list; cur = get_next(head); - while ((rtw_end_of_queue_search(head, cur)) == _FALSE) { + while (head != cur) { ent = LIST_CONTAINOR(cur, struct txpwr_lmt_ent, list); cur = get_next(cur); @@ -3427,7 +3427,7 @@ void phy_txpwr_limit_bandwidth_chk(_adapter *adapter) head = &rfctl->txpwr_lmt_list; cur = get_next(head); - while ((rtw_end_of_queue_search(head, cur)) == _FALSE) { + while (head != cur) { ent = LIST_CONTAINOR(cur, struct txpwr_lmt_ent, list); cur = get_next(cur); diff --git a/hal/hal_dm_acs.c b/hal/hal_dm_acs.c index 95bc76d..2328eec 100644 --- a/hal/hal_dm_acs.c +++ b/hal/hal_dm_acs.c @@ -38,7 +38,7 @@ static void _rtw_bss_nums_count(_adapter *adapter, u8 *pbss_nums) phead = get_list_head(queue); plist = get_next(phead); while (1) { - if (rtw_end_of_queue_search(phead, plist) == _TRUE) + if (phead == plist) break; pnetwork = LIST_CONTAINOR(plist, struct wlan_network, list); diff --git a/hal/hal_halmac.c b/hal/hal_halmac.c index 021a4bb..b8c10f8 100644 --- a/hal/hal_halmac.c +++ b/hal/hal_halmac.c @@ -3150,7 +3150,7 @@ static int _cpu_sleep(struct dvobj_priv *d, u32 timeout) mac = dvobj_to_halmac(d); api = HALMAC_GET_API(mac); - start_t = rtw_get_current_time(); + start_t = jiffies; status = _enter_cpu_sleep_mode(d); if (status != HALMAC_RET_SUCCESS) { @@ -3650,7 +3650,7 @@ int rtw_halmac_txfifo_wait_empty(struct dvobj_priv *d, u32 timeout) a = dvobj_get_primary_adapter(d); - start_time = rtw_get_current_time(); + start_time = jiffies; do { cnt++; diff --git a/hal/hal_intf.c b/hal/hal_intf.c index 9f52d0c..e11347f 100644 --- a/hal/hal_intf.c +++ b/hal/hal_intf.c @@ -54,7 +54,7 @@ u8 rtw_hal_read_chip_info(_adapter *padapter) { u8 rtn = _SUCCESS; u8 hci_type = rtw_get_intf_type(padapter); - systime start = rtw_get_current_time(); + systime start = jiffies; /* before access eFuse, make sure card enable has been called */ if ((hci_type == RTW_SDIO || hci_type == RTW_GSPI) @@ -472,7 +472,7 @@ s32 rtw_hal_fw_dl(_adapter *padapter, u8 wowlan) #ifdef RTW_HALMAC s32 rtw_hal_fw_mem_dl(_adapter *padapter, enum fw_mem mem) { - systime dlfw_start_time = rtw_get_current_time(); + systime dlfw_start_time = jiffies; struct dvobj_priv *dvobj = adapter_to_dvobj(padapter); struct debug_priv *pdbgpriv = &dvobj->drv_dbg; s32 rst = _FALSE; diff --git a/hal/hal_mcc.c b/hal/hal_mcc.c index 0555d73..a1cf8fd 100644 --- a/hal/hal_mcc.c +++ b/hal/hal_mcc.c @@ -132,7 +132,7 @@ static void rtw_hal_mcc_build_p2p_noa_attr(PADAPTER padapter, u8 *ie, u32 *ie_le , p2p_noa_attr_ie[p2p_noa_attr_len + 3]); p2p_noa_attr_len = p2p_noa_attr_len + 4; - rtw_set_ie(ie, _VENDOR_SPECIFIC_IE_, p2p_noa_attr_len, (u8 *)p2p_noa_attr_ie, ie_len); + rtw_set_ie(ie, WLAN_EID_VENDOR_SPECIFIC, p2p_noa_attr_len, (u8 *)p2p_noa_attr_ie, ie_len); } @@ -183,7 +183,7 @@ static void rtw_hal_mcc_update_go_p2p_ie(PADAPTER padapter) RTW_INFO("p2p_go_noa_ie_len:%d\n", pmccadapriv->p2p_go_noa_ie_len); RTW_INFO_DUMP("\n", pmccadapriv->p2p_go_noa_ie, pmccadapriv->p2p_go_noa_ie_len); } - update_beacon(padapter, _VENDOR_SPECIFIC_IE_, P2P_OUI, _TRUE); + update_beacon(padapter, WLAN_EID_VENDOR_SPECIFIC, P2P_OUI, _TRUE); } /** @@ -200,7 +200,7 @@ static void rtw_hal_mcc_remove_go_p2p_ie(PADAPTER padapter) return; pmccadapriv->p2p_go_noa_ie_len = 0; - update_beacon(padapter, _VENDOR_SPECIFIC_IE_, P2P_OUI, _TRUE); + update_beacon(padapter, WLAN_EID_VENDOR_SPECIFIC, P2P_OUI, _TRUE); } /* restore IQK value for all interface */ @@ -459,7 +459,7 @@ static void rtw_hal_config_mcc_role_setting(PADAPTER padapter, u8 order) plist = get_next(phead); pmccadapriv->mcc_macid_bitmap = 0; - while ((rtw_end_of_queue_search(phead, plist)) == _FALSE) { + while (phead != plist) { psta = LIST_CONTAINOR(plist, struct sta_info, asoc_list); plist = get_next(plist); pmccadapriv->mcc_macid_bitmap |= BIT(psta->cmn.mac_id); @@ -2249,7 +2249,7 @@ static u8 rtw_hal_set_mcc_setting(PADAPTER padapter, u8 status) u8 ret = _FAIL; struct mcc_obj_priv *pmccobjpriv = &(adapter_to_dvobj(padapter)->mcc_objpriv); u8 stop = (status < MCC_SETCMD_STATUS_START_CONNECT) ? _TRUE : _FALSE; - u32 start_time = rtw_get_current_time(); + u32 start_time = jiffies; RTW_INFO("===> "FUNC_ADPT_FMT"\n", FUNC_ADPT_ARG(padapter)); @@ -2538,7 +2538,7 @@ void rtw_hal_mcc_c2h_handler(PADAPTER padapter, u8 buflen, u8 *tmpBuf) case MCC_RPT_READY: _enter_critical_bh(&pmccobjpriv->mcc_lock, &irqL); /* initialize counter & time */ - pmccobjpriv->mcc_launch_time = rtw_get_current_time(); + pmccobjpriv->mcc_launch_time = jiffies; pmccobjpriv->mcc_c2h_status = MCC_RPT_READY; pmccobjpriv->cur_mcc_success_cnt = 0; pmccobjpriv->prev_mcc_success_cnt = 0; @@ -3236,7 +3236,7 @@ void rtw_hal_mcc_issue_null_data(_adapter *padapter, u8 chbw_allow, u8 ps_mode) { struct dvobj_priv *dvobj = adapter_to_dvobj(padapter); _adapter *iface = NULL; - systime start = rtw_get_current_time(); + systime start = jiffies; u8 i = 0; if (!MCC_EN(padapter)) diff --git a/hal/phydm/phydm_interface.c b/hal/phydm/phydm_interface.c index 40ba9f3..1c96c90 100644 --- a/hal/phydm/phydm_interface.c +++ b/hal/phydm/phydm_interface.c @@ -1059,17 +1059,17 @@ u8 phydm_c2H_content_parsing(void *dm_void, u8 c2h_cmd_id, u8 c2h_cmd_len, u64 odm_get_current_time(struct dm_struct *dm) { #if (DM_ODM_SUPPORT_TYPE & (ODM_AP)) - return (u64)rtw_get_current_time(); + return (u64)jiffies; #elif (DM_ODM_SUPPORT_TYPE & ODM_CE) && defined(DM_ODM_CE_MAC80211) return jiffies; #elif (DM_ODM_SUPPORT_TYPE & ODM_CE) && defined(DM_ODM_CE_MAC80211_V2) return jiffies; #elif (DM_ODM_SUPPORT_TYPE & ODM_CE) - return rtw_get_current_time(); + return jiffies; #elif (DM_ODM_SUPPORT_TYPE & ODM_WIN) return PlatformGetCurrentTime(); #elif (DM_ODM_SUPPORT_TYPE & ODM_IOT) - return rtw_get_current_time(); + return jiffies; #endif } diff --git a/hal/rtl8192e/rtl8192e_hal_init.c b/hal/rtl8192e/rtl8192e_hal_init.c index e9ee441..08835e9 100644 --- a/hal/rtl8192e/rtl8192e_hal_init.c +++ b/hal/rtl8192e/rtl8192e_hal_init.c @@ -76,7 +76,7 @@ s32 InitLLTTable8192E(PADAPTER padapter, u8 txpktbuf_bndy) value32 = rtw_read32(padapter, REG_AUTO_LLT); rtw_write32(padapter, REG_AUTO_LLT, value32 | BIT_AUTO_INIT_LLT); - start = rtw_get_current_time(); + start = jiffies; while (((value32 = rtw_read32(padapter, REG_AUTO_LLT)) & BIT_AUTO_INIT_LLT) && ((passing_time = rtw_get_passing_time_ms(start)) < 1000) ) @@ -367,7 +367,7 @@ static s32 polling_fwdl_chksum(_adapter *adapter, u32 min_cnt, u32 timeout_ms) { s32 ret = _FAIL; u32 value32; - systime start = rtw_get_current_time(); + systime start = jiffies; u32 cnt = 0; /* polling CheckSum report */ @@ -398,7 +398,7 @@ static s32 _FWFreeToGo8192E(_adapter *adapter, u32 min_cnt, u32 timeout_ms) { s32 ret = _FAIL; u32 value32; - systime start = rtw_get_current_time(); + systime start = jiffies; u32 cnt = 0; value32 = rtw_read32(adapter, REG_MCUFWDL); @@ -554,7 +554,7 @@ FirmwareDownload8192E( } _FWDownloadEnable_8192E(Adapter, _TRUE); - fwdl_start_time = rtw_get_current_time(); + fwdl_start_time = jiffies; while (!RTW_CANNOT_IO(Adapter) && (write_fw++ < 3 || rtw_get_passing_time_ms(fwdl_start_time) < 500)) { /* reset FWDL chksum */ @@ -3963,7 +3963,7 @@ u8 SetHwReg8192E(PADAPTER Adapter, u8 variable, u8 *val) u16 val16; u32 reg_200 = 0, reg_204 = 0, reg_214 = 0; u32 init_reg_200 = 0, init_reg_204 = 0, init_reg_214 = 0; - systime start = rtw_get_current_time(); + systime start = jiffies; u32 pass_ms; int i = 0; @@ -4509,7 +4509,7 @@ GetHalDefVar8192E( *((u32 *)pValue) = 8; break; case HW_VAR_BEST_AMPDU_DENSITY: - *((u32 *)pValue) = AMPDU_DENSITY_VALUE_7; + *((u32 *)pValue) = IEEE80211_HT_MPDU_DENSITY_16; break; default: bResult = GetHalDefVar(Adapter, eVariable, pValue); diff --git a/hal/rtl8192e/rtl8192e_sreset.c b/hal/rtl8192e/rtl8192e_sreset.c index c7085a4..3f5ea29 100644 --- a/hal/rtl8192e/rtl8192e_sreset.c +++ b/hal/rtl8192e/rtl8192e_sreset.c @@ -38,7 +38,7 @@ void rtl8192e_sreset_xmit_status_check(_adapter *padapter) /* total xmit irp = 4 */ /* RTW_INFO("==>%s free_xmitbuf_cnt(%d),txirp_cnt(%d)\n",__FUNCTION__,pxmitpriv->free_xmitbuf_cnt,pxmitpriv->txirp_cnt); */ /* if(pxmitpriv->txirp_cnt == NR_XMITBUFF+1) */ - current_time = rtw_get_current_time(); + current_time = jiffies; if (0 == pxmitpriv->free_xmitbuf_cnt || 0 == pxmitpriv->free_xmit_extbuf_cnt) { diff --git a/hal/rtl8192e/usb/rtl8192eu_xmit.c b/hal/rtl8192e/usb/rtl8192eu_xmit.c index ceede6d..8f43e60 100644 --- a/hal/rtl8192e/usb/rtl8192eu_xmit.c +++ b/hal/rtl8192e/usb/rtl8192eu_xmit.c @@ -568,12 +568,12 @@ s32 rtl8192eu_xmitframe_complete(_adapter *padapter, struct xmit_priv *pxmitpriv sta_phead = get_list_head(phwxmit->sta_queue); sta_plist = get_next(sta_phead); - single_sta_in_queue = rtw_end_of_queue_search(sta_phead, get_next(sta_plist)); + single_sta_in_queue = (sta_phead == get_next(sta_plist)); xmitframe_phead = get_list_head(&ptxservq->sta_pending); xmitframe_plist = get_next(xmitframe_phead); - while (rtw_end_of_queue_search(xmitframe_phead, xmitframe_plist) == _FALSE) { + while (xmitframe_phead != xmitframe_plist) { pxmitframe = LIST_CONTAINOR(xmitframe_plist, struct xmit_frame, list); xmitframe_plist = get_next(xmitframe_plist); diff --git a/hal/rtl8192e/usb/usb_halinit.c b/hal/rtl8192e/usb/usb_halinit.c index c3f42c9..67e129e 100644 --- a/hal/rtl8192e/usb/usb_halinit.c +++ b/hal/rtl8192e/usb/usb_halinit.c @@ -693,7 +693,7 @@ u32 rtl8192eu_hal_init(PADAPTER Adapter) rt_rf_power_state eRfPowerStateToSet; - systime init_start_time = rtw_get_current_time(); + systime init_start_time = jiffies; #ifdef DBG_HAL_INIT_PROFILING @@ -763,7 +763,7 @@ u32 rtl8192eu_hal_init(PADAPTER Adapter) for (hal_init_profiling_i = 0; hal_init_profiling_i < HAL_INIT_STAGES_NUM; hal_init_profiling_i++) hal_init_stages_timestamp[hal_init_profiling_i] = 0; -#define HAL_INIT_PROFILE_TAG(stage) do { hal_init_stages_timestamp[(stage)] = rtw_get_current_time(); } while (0) +#define HAL_INIT_PROFILE_TAG(stage) do { hal_init_stages_timestamp[(stage)] = jiffies; } while (0) #else #define HAL_INIT_PROFILE_TAG(stage) do {} while (0) #endif /* DBG_HAL_INIT_PROFILING */ @@ -1123,7 +1123,7 @@ exit: RTW_INFO("%s in %dms\n", __FUNCTION__, rtw_get_passing_time_ms(init_start_time)); #ifdef DBG_HAL_INIT_PROFILING - hal_init_stages_timestamp[HAL_INIT_STAGES_END] = rtw_get_current_time(); + hal_init_stages_timestamp[HAL_INIT_STAGES_END] = jiffies; for (hal_init_profiling_i = 0; hal_init_profiling_i < HAL_INIT_STAGES_NUM - 1; hal_init_profiling_i++) { RTW_INFO("DBG_HAL_INIT_PROFILING: %35s, %u, %5u, %5u\n" @@ -1710,7 +1710,7 @@ GetHalDefVar8192EUsb( switch (eVariable) { case HW_VAR_MAX_RX_AMPDU_FACTOR: - *((u32 *)pValue) = MAX_AMPDU_FACTOR_64K; /* MAX_AMPDU_FACTOR_64K; */ + *((u32 *)pValue) = IEEE80211_HT_MAX_AMPDU_64K; /* IEEE80211_HT_MAX_AMPDU_64K; */ break; default: GetHalDefVar8192E(Adapter, eVariable, pValue); diff --git a/hal/rtl8192e/usb/usb_ops_linux.c b/hal/rtl8192e/usb/usb_ops_linux.c index 81e1b14..a70639a 100644 --- a/hal/rtl8192e/usb/usb_ops_linux.c +++ b/hal/rtl8192e/usb/usb_ops_linux.c @@ -50,7 +50,7 @@ void interrupt_handler_8192eu(_adapter *padapter, u16 pkt_len, u8 *pbuf) if (pHalData->IntArray[0] & IMR_BCNDMAINT0_88E) { struct tdls_ch_switch *pchsw_info = &padapter->tdlsinfo.chsw_info; u32 last_time = pchsw_info->cur_time; - pchsw_info->cur_time = rtw_systime_to_ms(rtw_get_current_time()); + pchsw_info->cur_time = jiffies_to_msecs(jiffies); if ((atomic_read(&pchsw_info->chsw_on) == _TRUE) && /* Sometimes we receive multiple interrupts in very little time period, use the follow condition test to filter */ (pchsw_info->cur_time - last_time > padapter->mlmeextpriv.mlmext_info.bcn_interval - 5) && diff --git a/include/drv_types.h b/include/drv_types.h index 0bc36a0..d71d15c 100644 --- a/include/drv_types.h +++ b/include/drv_types.h @@ -907,8 +907,8 @@ struct rf_ctl_t { #define RTW_CAC_STOPPED 0 #ifdef CONFIG_DFS_MASTER #define IS_CAC_STOPPED(rfctl) ((rfctl)->cac_end_time == RTW_CAC_STOPPED) -#define IS_CH_WAITING(rfctl) (!IS_CAC_STOPPED(rfctl) && rtw_time_after((rfctl)->cac_end_time, rtw_get_current_time())) -#define IS_UNDER_CAC(rfctl) (IS_CH_WAITING(rfctl) && rtw_time_after(rtw_get_current_time(), (rfctl)->cac_start_time)) +#define IS_CH_WAITING(rfctl) (!IS_CAC_STOPPED(rfctl) && rtw_time_after((rfctl)->cac_end_time, jiffies)) +#define IS_UNDER_CAC(rfctl) (IS_CH_WAITING(rfctl) && rtw_time_after(jiffies, (rfctl)->cac_start_time)) #define IS_RADAR_DETECTED(rfctl) ((rfctl)->radar_detected) #else #define IS_CAC_STOPPED(rfctl) 1 diff --git a/include/ieee80211.h b/include/ieee80211.h index 52ec1ab..29dd539 100644 --- a/include/ieee80211.h +++ b/include/ieee80211.h @@ -343,7 +343,7 @@ typedef struct ieee_param { u16 capability; int flags; u8 tx_supp_rates[16]; - struct rtw_ieee80211_ht_cap ht_cap; + struct ieee80211_ht_cap ht_cap; } add_sta; struct { u8 reserved[2];/* for set max_num_sta */ @@ -368,7 +368,7 @@ struct sta_data { u32 sta_set; u8 tx_supp_rates[16]; u32 tx_supp_rates_len; - struct rtw_ieee80211_ht_cap ht_cap; + struct ieee80211_ht_cap ht_cap; u64 rx_pkts; u64 rx_bytes; u64 rx_drops; @@ -1550,8 +1550,6 @@ enum rtw_ieee80211_wnm_actioncode { }; #endif -#define OUI_MICROSOFT 0x0050f2 /* Microsoft (also used in Wi-Fi specs) - * 00:50:F2 */ #define WME_OUI_TYPE 2 #define WME_OUI_SUBTYPE_INFORMATION_ELEMENT 0 diff --git a/include/osdep_service.h b/include/osdep_service.h index 2baa01a..18d67a5 100644 --- a/include/osdep_service.h +++ b/include/osdep_service.h @@ -260,7 +260,6 @@ void rtw_hlist_add_head_rcu(rtw_hlist_node *n, rtw_hlist_head *h); void rtw_hlist_del_rcu(rtw_hlist_node *n); extern void _rtw_init_sema(_sema *sema, int init_val); -extern void _rtw_free_sema(_sema *sema); extern void _rtw_up_sema(_sema *sema); extern u32 _rtw_down_sema(_sema *sema); extern void _rtw_mutex_init(_mutex *pmutex); @@ -274,32 +273,19 @@ extern void _rtw_spinunlock_ex(_lock *plock); extern void _rtw_init_queue(_queue *pqueue); extern void _rtw_deinit_queue(_queue *pqueue); extern u32 _rtw_queue_empty(_queue *pqueue); -extern u32 rtw_end_of_queue_search(_list *queue, _list *pelement); -extern systime _rtw_get_current_time(void); -extern u32 _rtw_systime_to_ms(systime stime); -extern systime _rtw_ms_to_systime(u32 ms); -extern systime _rtw_us_to_systime(u32 us); extern s32 _rtw_get_passing_time_ms(systime start); extern s32 _rtw_get_remaining_time_ms(systime end); extern s32 _rtw_get_time_interval_ms(systime start, systime end); extern bool _rtw_time_after(systime a, systime b); #ifdef DBG_SYSTIME -#define rtw_get_current_time() ({systime __stime = _rtw_get_current_time(); __stime;}) -#define rtw_systime_to_ms(stime) ({u32 __ms = _rtw_systime_to_ms(stime); typecheck(systime, stime); __ms;}) -#define rtw_ms_to_systime(ms) ({systime __stime = _rtw_ms_to_systime(ms); __stime;}) -#define rtw_us_to_systime(us) ({systime __stime = _rtw_us_to_systime(us); __stime;}) #define rtw_get_passing_time_ms(start) ({u32 __ms = _rtw_get_passing_time_ms(start); typecheck(systime, start); __ms;}) #define rtw_get_remaining_time_ms(end) ({u32 __ms = _rtw_get_remaining_time_ms(end); typecheck(systime, end); __ms;}) #define rtw_get_time_interval_ms(start, end) ({u32 __ms = _rtw_get_time_interval_ms(start, end); typecheck(systime, start); typecheck(systime, end); __ms;}) #define rtw_time_after(a,b) ({bool __r = _rtw_time_after(a,b); typecheck(systime, a); typecheck(systime, b); __r;}) #define rtw_time_before(a,b) ({bool __r = _rtw_time_after(b, a); typecheck(systime, a); typecheck(systime, b); __r;}) #else -#define rtw_get_current_time() _rtw_get_current_time() -#define rtw_systime_to_ms(stime) _rtw_systime_to_ms(stime) -#define rtw_ms_to_systime(ms) _rtw_ms_to_systime(ms) -#define rtw_us_to_systime(us) _rtw_us_to_systime(us) #define rtw_get_passing_time_ms(start) _rtw_get_passing_time_ms(start) #define rtw_get_remaining_time_ms(end) _rtw_get_remaining_time_ms(end) #define rtw_get_time_interval_ms(start, end) _rtw_get_time_interval_ms(start, end) diff --git a/include/rtw_ht.h b/include/rtw_ht.h index 8237bbe..6f8539a 100644 --- a/include/rtw_ht.h +++ b/include/rtw_ht.h @@ -46,7 +46,7 @@ struct ht_priv { u8 op_present:1; /* ht_op is present */ - struct rtw_ieee80211_ht_cap ht_cap; + struct ieee80211_ht_cap ht_cap; u8 ht_op[HT_OP_IE_LEN]; }; diff --git a/include/rtw_mlme_ext.h b/include/rtw_mlme_ext.h index 4324816..20cfa29 100644 --- a/include/rtw_mlme_ext.h +++ b/include/rtw_mlme_ext.h @@ -392,7 +392,7 @@ void rtw_rfctl_deinit(_adapter *adapter); #ifdef CONFIG_DFS_MASTER struct rf_ctl_t; -#define CH_IS_NON_OCP(rt_ch_info) (rtw_time_after((rt_ch_info)->non_ocp_end_time, rtw_get_current_time())) +#define CH_IS_NON_OCP(rt_ch_info) (rtw_time_after((rt_ch_info)->non_ocp_end_time, jiffies)) bool rtw_is_cac_reset_needed(struct rf_ctl_t *rfctl, u8 ch, u8 bw, u8 offset); bool _rtw_rfctl_overlap_radar_detect_ch(struct rf_ctl_t *rfctl, u8 ch, u8 bw, u8 offset); bool rtw_rfctl_overlap_radar_detect_ch(struct rf_ctl_t *rfctl); diff --git a/include/rtw_pwrctrl.h b/include/rtw_pwrctrl.h index 6afd25c..5e82e95 100644 --- a/include/rtw_pwrctrl.h +++ b/include/rtw_pwrctrl.h @@ -156,7 +156,6 @@ __inline static void _init_pwrlock(_pwrlock *plock) __inline static void _free_pwrlock(_pwrlock *plock) { - _rtw_free_sema(plock); } diff --git a/include/wifi.h b/include/wifi.h index 427408e..a90dded 100644 --- a/include/wifi.h +++ b/include/wifi.h @@ -71,154 +71,40 @@ #pragma pack(1) #endif -enum WIFI_FRAME_TYPE { - WIFI_MGT_TYPE = (0), - WIFI_CTRL_TYPE = (BIT(2)), - WIFI_DATA_TYPE = (BIT(3)), - WIFI_QOS_DATA_TYPE = (BIT(7) | BIT(3)), /* !< QoS Data */ -}; - -enum WIFI_FRAME_SUBTYPE { - - /* below is for mgt frame */ - WIFI_ASSOCREQ = (0 | WIFI_MGT_TYPE), - WIFI_ASSOCRSP = (BIT(4) | WIFI_MGT_TYPE), - WIFI_REASSOCREQ = (BIT(5) | WIFI_MGT_TYPE), - WIFI_REASSOCRSP = (BIT(5) | BIT(4) | WIFI_MGT_TYPE), - WIFI_PROBEREQ = (BIT(6) | WIFI_MGT_TYPE), - WIFI_PROBERSP = (BIT(6) | BIT(4) | WIFI_MGT_TYPE), - WIFI_BEACON = (BIT(7) | WIFI_MGT_TYPE), - WIFI_ATIM = (BIT(7) | BIT(4) | WIFI_MGT_TYPE), - WIFI_DISASSOC = (BIT(7) | BIT(5) | WIFI_MGT_TYPE), - WIFI_AUTH = (BIT(7) | BIT(5) | BIT(4) | WIFI_MGT_TYPE), - WIFI_DEAUTH = (BIT(7) | BIT(6) | WIFI_MGT_TYPE), - WIFI_ACTION = (BIT(7) | BIT(6) | BIT(4) | WIFI_MGT_TYPE), - WIFI_ACTION_NOACK = (BIT(7) | BIT(6) | BIT(5) | WIFI_MGT_TYPE), - - /* below is for control frame */ - WIFI_BF_REPORT_POLL = (BIT(6) | WIFI_CTRL_TYPE), - WIFI_NDPA = (BIT(6) | BIT(4) | WIFI_CTRL_TYPE), - WIFI_BAR = (BIT(7) | WIFI_CTRL_TYPE), - WIFI_PSPOLL = (BIT(7) | BIT(5) | WIFI_CTRL_TYPE), - WIFI_RTS = (BIT(7) | BIT(5) | BIT(4) | WIFI_CTRL_TYPE), - WIFI_CTS = (BIT(7) | BIT(6) | WIFI_CTRL_TYPE), - WIFI_ACK = (BIT(7) | BIT(6) | BIT(4) | WIFI_CTRL_TYPE), - WIFI_CFEND = (BIT(7) | BIT(6) | BIT(5) | WIFI_CTRL_TYPE), - WIFI_CFEND_CFACK = (BIT(7) | BIT(6) | BIT(5) | BIT(4) | WIFI_CTRL_TYPE), - - /* below is for data frame */ - WIFI_DATA = (0 | WIFI_DATA_TYPE), - WIFI_DATA_CFACK = (BIT(4) | WIFI_DATA_TYPE), - WIFI_DATA_CFPOLL = (BIT(5) | WIFI_DATA_TYPE), - WIFI_DATA_CFACKPOLL = (BIT(5) | BIT(4) | WIFI_DATA_TYPE), - WIFI_DATA_NULL = (BIT(6) | WIFI_DATA_TYPE), - WIFI_CF_ACK = (BIT(6) | BIT(4) | WIFI_DATA_TYPE), - WIFI_CF_POLL = (BIT(6) | BIT(5) | WIFI_DATA_TYPE), - WIFI_CF_ACKPOLL = (BIT(6) | BIT(5) | BIT(4) | WIFI_DATA_TYPE), - WIFI_QOS_DATA_NULL = (BIT(6) | WIFI_QOS_DATA_TYPE), -}; - -enum WIFI_REASON_CODE { - _RSON_RESERVED_ = 0, - _RSON_UNSPECIFIED_ = 1, - _RSON_AUTH_NO_LONGER_VALID_ = 2, - _RSON_DEAUTH_STA_LEAVING_ = 3, - _RSON_INACTIVITY_ = 4, - _RSON_UNABLE_HANDLE_ = 5, - _RSON_CLS2_ = 6, - _RSON_CLS3_ = 7, - _RSON_DISAOC_STA_LEAVING_ = 8, - _RSON_ASOC_NOT_AUTH_ = 9, - - /* WPA reason */ - _RSON_INVALID_IE_ = 13, - _RSON_MIC_FAILURE_ = 14, - _RSON_4WAY_HNDSHK_TIMEOUT_ = 15, - _RSON_GROUP_KEY_UPDATE_TIMEOUT_ = 16, - _RSON_DIFF_IE_ = 17, - _RSON_MLTCST_CIPHER_NOT_VALID_ = 18, - _RSON_UNICST_CIPHER_NOT_VALID_ = 19, - _RSON_AKMP_NOT_VALID_ = 20, - _RSON_UNSUPPORT_RSNE_VER_ = 21, - _RSON_INVALID_RSNE_CAP_ = 22, - _RSON_IEEE_802DOT1X_AUTH_FAIL_ = 23, - - /* belowing are Realtek definition */ - _RSON_PMK_NOT_AVAILABLE_ = 24, - _RSON_TDLS_TEAR_TOOFAR_ = 25, - _RSON_TDLS_TEAR_UN_RSN_ = 26, -}; +/*ieee80211 management */ +#define WIFI_ACTION_NOACK (BIT(7) | BIT(6) | BIT(5) | IEEE80211_FTYPE_MGMT) +/* below is for control frame */ +#define WIFI_NDPA (BIT(6) | BIT(4) | IEEE80211_FTYPE_CTL) /* Reason codes (IEEE 802.11-2007, 7.3.1.7, Table 7-22) */ - -enum WIFI_STATUS_CODE { - _STATS_SUCCESSFUL_ = 0, - _STATS_FAILURE_ = 1, - _STATS_SEC_DISABLED_ = 5, - _STATS_NOT_IN_SAME_BSS_ = 7, - _STATS_CAP_FAIL_ = 10, - _STATS_NO_ASOC_ = 11, - _STATS_OTHER_ = 12, - _STATS_NO_SUPP_ALG_ = 13, - _STATS_OUT_OF_AUTH_SEQ_ = 14, - _STATS_CHALLENGE_FAIL_ = 15, - _STATS_AUTH_TIMEOUT_ = 16, - _STATS_UNABLE_HANDLE_STA_ = 17, - _STATS_RATE_FAIL_ = 18, - _STATS_REFUSED_TEMPORARILY_ = 30, - _STATS_DECLINE_REQ_ = 37, - _STATS_INVALID_PARAMETERS_ = 38, - _STATS_INVALID_RSNIE_ = 72, +enum { + _STATS_REFUSED_TEMPORARILY_ = 30, /* Code-22-65535 reserved */ }; - /* IEEE 802.11r */ #define WLAN_STATUS_INVALID_PMKID 53 -enum WIFI_REG_DOMAIN { - DOMAIN_FCC = 1, - DOMAIN_IC = 2, - DOMAIN_ETSI = 3, - DOMAIN_SPAIN = 4, - DOMAIN_FRANCE = 5, - DOMAIN_MKK = 6, - DOMAIN_ISRAEL = 7, - DOMAIN_MKK1 = 8, - DOMAIN_MKK2 = 9, - DOMAIN_MKK3 = 10, - DOMAIN_MAX -}; - -#define _TO_DS_ BIT(8) -#define _FROM_DS_ BIT(9) -#define _MORE_FRAG_ BIT(10) -#define _RETRY_ BIT(11) -#define _PWRMGT_ BIT(12) -#define _MORE_DATA_ BIT(13) -#define _PRIVACY_ BIT(14) -#define _ORDER_ BIT(15) - #define SetToDs(pbuf) \ do { \ - *(unsigned short *)(pbuf) |= cpu_to_le16(_TO_DS_); \ + *(unsigned short *)(pbuf) |= cpu_to_le16(IEEE80211_FCTL_TODS); \ } while (0) -#define GetToDs(pbuf) (((*(unsigned short *)(pbuf)) & le16_to_cpu(_TO_DS_)) != 0) +#define GetToDs(pbuf) (((*(unsigned short *)(pbuf)) & le16_to_cpu(IEEE80211_FCTL_TODS)) != 0) #define ClearToDs(pbuf) \ do { \ - *(unsigned short *)(pbuf) &= (~cpu_to_le16(_TO_DS_)); \ + *(unsigned short *)(pbuf) &= (~cpu_to_le16(IEEE80211_FCTL_TODS)); \ } while (0) #define SetFrDs(pbuf) \ do { \ - *(unsigned short *)(pbuf) |= cpu_to_le16(_FROM_DS_); \ + *(unsigned short *)(pbuf) |= cpu_to_le16(IEEE80211_FCTL_FROMDS); \ } while (0) -#define GetFrDs(pbuf) (((*(unsigned short *)(pbuf)) & le16_to_cpu(_FROM_DS_)) != 0) +#define GetFrDs(pbuf) (((*(unsigned short *)(pbuf)) & le16_to_cpu(IEEE80211_FCTL_FROMDS)) != 0) #define ClearFrDs(pbuf) \ do { \ - *(unsigned short *)(pbuf) &= (~cpu_to_le16(_FROM_DS_)); \ + *(unsigned short *)(pbuf) &= (~cpu_to_le16(IEEE80211_FCTL_FROMDS)); \ } while (0) #define get_tofr_ds(pframe) ((GetToDs(pframe) << 1) | GetFrDs(pframe)) @@ -226,66 +112,61 @@ enum WIFI_REG_DOMAIN { #define SetMFrag(pbuf) \ do { \ - *(unsigned short *)(pbuf) |= cpu_to_le16(_MORE_FRAG_); \ + *(unsigned short *)(pbuf) |= cpu_to_le16(IEEE80211_FCTL_MOREFRAGS); \ } while (0) -#define GetMFrag(pbuf) (((*(unsigned short *)(pbuf)) & le16_to_cpu(_MORE_FRAG_)) != 0) +#define GetMFrag(pbuf) (((*(unsigned short *)(pbuf)) & le16_to_cpu(IEEE80211_FCTL_MOREFRAGS)) != 0) #define ClearMFrag(pbuf) \ do { \ - *(unsigned short *)(pbuf) &= (~cpu_to_le16(_MORE_FRAG_)); \ + *(unsigned short *)(pbuf) &= (~cpu_to_le16(IEEE80211_FCTL_MOREFRAGS)); \ } while (0) -#define SetRetry(pbuf) \ - do { \ - *(unsigned short *)(pbuf) |= cpu_to_le16(_RETRY_); \ - } while (0) - -#define GetRetry(pbuf) (((*(unsigned short *)(pbuf)) & le16_to_cpu(_RETRY_)) != 0) +#define GetRetry(pbuf) (((*(unsigned short *)(pbuf)) & le16_to_cpu(IEEE80211_FCTL_RETRY)) != 0) #define ClearRetry(pbuf) \ do { \ - *(unsigned short *)(pbuf) &= (~cpu_to_le16(_RETRY_)); \ + *(unsigned short *)(pbuf) &= (~cpu_to_le16(IEEE80211_FCTL_RETRY)); \ } while (0) #define SetPwrMgt(pbuf) \ do { \ - *(unsigned short *)(pbuf) |= cpu_to_le16(_PWRMGT_); \ + *(unsigned short *)(pbuf) |= cpu_to_le16(IEEE80211_FCTL_PM); \ } while (0) -#define GetPwrMgt(pbuf) (((*(unsigned short *)(pbuf)) & le16_to_cpu(_PWRMGT_)) != 0) +#define GetPwrMgt(pbuf) (((*(unsigned short *)(pbuf)) & le16_to_cpu(IEEE80211_FCTL_PM)) != 0) #define ClearPwrMgt(pbuf) \ do { \ - *(unsigned short *)(pbuf) &= (~cpu_to_le16(_PWRMGT_)); \ + *(unsigned short *)(pbuf) &= (~cpu_to_le16(IEEE80211_FCTL_PM)); \ } while (0) #define SetMData(pbuf) \ do { \ - *(unsigned short *)(pbuf) |= cpu_to_le16(_MORE_DATA_); \ + *(unsigned short *)(pbuf) |= cpu_to_le16(IEEE80211_FCTL_MOREDATA); \ } while (0) -#define GetMData(pbuf) (((*(unsigned short *)(pbuf)) & le16_to_cpu(_MORE_DATA_)) != 0) +#define GetMData(pbuf) (((*(unsigned short *)(pbuf)) & le16_to_cpu(IEEE80211_FCTL_MOREDATA)) != 0) #define ClearMData(pbuf) \ do { \ - *(unsigned short *)(pbuf) &= (~cpu_to_le16(_MORE_DATA_)); \ + *(unsigned short *)(pbuf) &= (~cpu_to_le16(IEEE80211_FCTL_MOREDATA)); \ } while (0) #define SetPrivacy(pbuf) \ do { \ - *(unsigned short *)(pbuf) |= cpu_to_le16(_PRIVACY_); \ + *(unsigned short *)(pbuf) |= cpu_to_le16(IEEE80211_FCTL_PROTECTED); \ } while (0) -#define GetPrivacy(pbuf) (((*(unsigned short *)(pbuf)) & le16_to_cpu(_PRIVACY_)) != 0) +#define GetPrivacy(pbuf) (((*(unsigned short *)(pbuf)) & le16_to_cpu(IEEE80211_FCTL_PROTECTED)) != 0) #define ClearPrivacy(pbuf) \ do { \ - *(unsigned short *)(pbuf) &= (~cpu_to_le16(_PRIVACY_)); \ + *(unsigned short *)(pbuf) &= (~cpu_to_le16(IEEE80211_FCTL_PROTECTED)); \ } while (0) -#define GetOrder(pbuf) (((*(unsigned short *)(pbuf)) & le16_to_cpu(_ORDER_)) != 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))) @@ -377,54 +258,6 @@ __inline static unsigned char *get_ta(unsigned char *pframe) return ta; } -/* can't apply to mesh mode */ -__inline static unsigned char *get_da(unsigned char *pframe) -{ - unsigned char *da; - unsigned int to_fr_ds = (GetToDs(pframe) << 1) | GetFrDs(pframe); - - switch (to_fr_ds) { - case 0x00: /* ToDs=0, FromDs=0 */ - da = GetAddr1Ptr(pframe); - break; - case 0x01: /* ToDs=0, FromDs=1 */ - da = GetAddr1Ptr(pframe); - break; - case 0x02: /* ToDs=1, FromDs=0 */ - da = GetAddr3Ptr(pframe); - break; - default: /* ToDs=1, FromDs=1 */ - da = GetAddr3Ptr(pframe); - break; - } - - return da; -} - -/* can't apply to mesh mode */ -__inline static unsigned char *get_sa(unsigned char *pframe) -{ - unsigned char *sa; - unsigned int to_fr_ds = (GetToDs(pframe) << 1) | GetFrDs(pframe); - - switch (to_fr_ds) { - case 0x00: /* ToDs=0, FromDs=0 */ - sa = get_addr2_ptr(pframe); - break; - case 0x01: /* ToDs=0, FromDs=1 */ - sa = GetAddr3Ptr(pframe); - break; - case 0x02: /* ToDs=1, FromDs=0 */ - sa = get_addr2_ptr(pframe); - break; - default: /* ToDs=1, FromDs=1 */ - sa = GetAddr4Ptr(pframe); - break; - } - - return sa; -} - /* can't apply to mesh mode */ __inline static unsigned char *get_hdr_bssid(unsigned char *pframe) { @@ -452,21 +285,21 @@ __inline static unsigned char *get_hdr_bssid(unsigned char *pframe) __inline static int IsFrameTypeCtrl(unsigned char *pframe) { - if (WIFI_CTRL_TYPE == GetFrameType(pframe)) + if (IEEE80211_FTYPE_CTL == GetFrameType(pframe)) return _TRUE; else return _FALSE; } static inline int IsFrameTypeMgnt(unsigned char *pframe) { - if (GetFrameType(pframe) == WIFI_MGT_TYPE) + if (GetFrameType(pframe) == IEEE80211_FTYPE_MGMT) return _TRUE; else return _FALSE; } static inline int IsFrameTypeData(unsigned char *pframe) { - if (GetFrameType(pframe) == WIFI_DATA_TYPE) + if (GetFrameType(pframe) == IEEE80211_FTYPE_DATA) return _TRUE; else return _FALSE; @@ -501,47 +334,6 @@ static inline int IsFrameTypeData(unsigned char *pframe) #define _FIXED_IE_LENGTH_ _BEACON_IE_OFFSET_ -#define _SSID_IE_ 0 -#define _SUPPORTEDRATES_IE_ 1 -#define _DSSET_IE_ 3 -#define _TIM_IE_ 5 -#define _IBSS_PARA_IE_ 6 -#define _COUNTRY_IE_ 7 -#define _CHLGETXT_IE_ 16 -#define _SUPPORTED_CH_IE_ 36 -#define _CH_SWTICH_ANNOUNCE_ 37 /* Secondary Channel Offset */ -#define _MEAS_REQ_IE_ 38 -#define _MEAS_RSP_IE_ 39 -#define _RSN_IE_2_ 48 -#define _SSN_IE_1_ 221 -#define _ERPINFO_IE_ 42 -#define _EXT_SUPPORTEDRATES_IE_ 50 - -#define _HT_CAPABILITY_IE_ 45 -#define _MDIE_ 54 -#define _FTIE_ 55 -#define _TIMEOUT_ITVL_IE_ 56 -#define _SRC_IE_ 59 -#define _HT_EXTRA_INFO_IE_ 61 -#define _HT_ADD_INFO_IE_ 61 /* _HT_EXTRA_INFO_IE_ */ -#define _WAPI_IE_ 68 -#define _EID_RRM_EN_CAP_IE_ 70 - - -/* #define EID_BSSCoexistence 72 */ /* 20/40 BSS Coexistence - * #define EID_BSSIntolerantChlReport 73 */ -#define _RIC_Descriptor_IE_ 75 -#ifdef CONFIG_IEEE80211W -#define _MME_IE_ 76 /* 802.11w Management MIC element */ -#endif /* CONFIG_IEEE80211W */ -#define _LINK_ID_IE_ 101 -#define _CH_SWITCH_TIMING_ 104 -#define _PTI_BUFFER_STATUS_ 106 -#define _EXT_CAP_IE_ 127 -#define _VENDOR_SPECIFIC_IE_ 221 - -#define _RESERVED47_ 47 - typedef enum _ELEMENT_ID { EID_SsId = 0, /* service set identifier (0:32) */ EID_SupRates = 1, /* supported rates (1:8) */ @@ -685,50 +477,17 @@ typedef enum _ELEMENT_ID { #define set_order_bit(pbuf) \ do { \ - *(unsigned short *)(pbuf) |= cpu_to_le16(_ORDER_); \ + *(unsigned short *)(pbuf) |= cpu_to_le16(IEEE80211_FCTL_ORDER); \ } while (0) -#define GetOrderBit(pbuf) (((*(unsigned short *)(pbuf)) & le16_to_cpu(_ORDER_)) != 0) +#define GetOrderBit(pbuf) (((*(unsigned short *)(pbuf)) & le16_to_cpu(IEEE80211_FCTL_ORDER)) != 0) #define ACT_CAT_VENDOR 0x7F/* 127 */ /** - * struct rtw_ieee80211_bar - HT Block Ack Request - * - * This structure refers to "HT BlockAckReq" as - * described in 802.11n draft section 7.2.1.7.1 - */ -#if defined(PLATFORM_LINUX) || defined(CONFIG_RTL8712FW) -struct rtw_ieee80211_bar { - unsigned short frame_control; - unsigned short duration; - unsigned char ra[6]; - unsigned char ta[6]; - unsigned short control; - unsigned short start_seq_num; -} __attribute__((packed)); -#endif - -/** -* struct rtw_ieee80211_ht_cap - HT capabilities -* -* This structure refers to "HT capabilities element" as -* described in 802.11n draft section 7.3.2.52 -*/ - -struct rtw_ieee80211_ht_cap { - unsigned short cap_info; - unsigned char ampdu_params_info; - unsigned char supp_mcs_set[16]; - unsigned short extended_ht_cap_info; - unsigned int tx_BF_cap_info; - unsigned char antenna_selection_info; -} __attribute__((packed)); - -/** - * struct rtw_ieee80211_ht_cap - HT additional information + * struct ieee80211_ht_cap - HT additional information * * This structure refers to "HT information element" as * described in 802.11n draft section 7.3.2.53 @@ -782,31 +541,7 @@ struct ADDBA_request { unsigned short BA_starting_seqctrl; } __attribute__((packed)); -typedef enum _HT_CAP_AMPDU_FACTOR { - MAX_AMPDU_FACTOR_8K = 0, - MAX_AMPDU_FACTOR_16K = 1, - MAX_AMPDU_FACTOR_32K = 2, - MAX_AMPDU_FACTOR_64K = 3, -} HT_CAP_AMPDU_FACTOR; -typedef enum _VHT_CAP_AMPDU_FACTOR { - MAX_AMPDU_FACTOR_128K = 4, - MAX_AMPDU_FACTOR_256K = 5, - MAX_AMPDU_FACTOR_512K = 6, - MAX_AMPDU_FACTOR_1M = 7, -} VHT_CAP_AMPDU_FACTOR; - - -typedef enum _HT_CAP_AMPDU_DENSITY { - AMPDU_DENSITY_VALUE_0 = 0 , /* For no restriction */ - AMPDU_DENSITY_VALUE_1 = 1 , /* For 1/4 us */ - AMPDU_DENSITY_VALUE_2 = 2 , /* For 1/2 us */ - AMPDU_DENSITY_VALUE_3 = 3 , /* For 1 us */ - AMPDU_DENSITY_VALUE_4 = 4 , /* For 2 us */ - AMPDU_DENSITY_VALUE_5 = 5 , /* For 4 us */ - AMPDU_DENSITY_VALUE_6 = 6 , /* For 8 us */ - AMPDU_DENSITY_VALUE_7 = 7 , /* For 16 us */ -} HT_CAP_AMPDU_DENSITY; /* 802.11n HT capabilities masks */ #define IEEE80211_HT_CAP_RX_STBC_1R 0x0100 @@ -822,41 +557,8 @@ typedef enum _HT_CAP_AMPDU_DENSITY { #define IEEE80211_MAX_AMPDU_BUF 0x40 #endif -/* Spatial Multiplexing Power Save Modes */ -#define WLAN_HT_CAP_SM_PS_STATIC 0 -#define WLAN_HT_CAP_SM_PS_DYNAMIC 1 -#define WLAN_HT_CAP_SM_PS_INVALID 2 -#define WLAN_HT_CAP_SM_PS_DISABLED 3 - - -#define OP_MODE_PURE 0 -#define OP_MODE_MAY_BE_LEGACY_STAS 1 -#define OP_MODE_20MHZ_HT_STA_ASSOCED 2 -#define OP_MODE_MIXED 3 - -#define HT_INFO_HT_PARAM_SECONDARY_CHNL_OFF_MASK ((u8) BIT(0) | BIT(1)) -#define HT_INFO_HT_PARAM_SECONDARY_CHNL_ABOVE ((u8) BIT(0)) -#define HT_INFO_HT_PARAM_SECONDARY_CHNL_BELOW ((u8) BIT(0) | BIT(1)) -#define HT_INFO_HT_PARAM_REC_TRANS_CHNL_WIDTH ((u8) BIT(2)) -#define HT_INFO_HT_PARAM_RIFS_MODE ((u8) BIT(3)) -#define HT_INFO_HT_PARAM_CTRL_ACCESS_ONLY ((u8) BIT(4)) -#define HT_INFO_HT_PARAM_SRV_INTERVAL_GRANULARITY ((u8) BIT(5)) - #define HT_INFO_OPERATION_MODE_OP_MODE_MASK \ ((u16) (0x0001 | 0x0002)) -#define HT_INFO_OPERATION_MODE_OP_MODE_OFFSET 0 -#define HT_INFO_OPERATION_MODE_NON_GF_DEVS_PRESENT ((u8) BIT(2)) -#define HT_INFO_OPERATION_MODE_TRANSMIT_BURST_LIMIT ((u8) BIT(3)) -#define HT_INFO_OPERATION_MODE_NON_HT_STA_PRESENT ((u8) BIT(4)) - -#define HT_INFO_STBC_PARAM_DUAL_BEACON ((u16) BIT(6)) -#define HT_INFO_STBC_PARAM_DUAL_STBC_PROTECT ((u16) BIT(7)) -#define HT_INFO_STBC_PARAM_SECONDARY_BCN ((u16) BIT(8)) -#define HT_INFO_STBC_PARAM_LSIG_TXOP_PROTECT_ALLOWED ((u16) BIT(9)) -#define HT_INFO_STBC_PARAM_PCO_ACTIVE ((u16) BIT(10)) -#define HT_INFO_STBC_PARAM_PCO_PHASE ((u16) BIT(11)) - - /* #endif */ diff --git a/os_dep/linux/ioctl_cfg80211.c b/os_dep/linux/ioctl_cfg80211.c index 411c5f6..6bdb7a9 100644 --- a/os_dep/linux/ioctl_cfg80211.c +++ b/os_dep/linux/ioctl_cfg80211.c @@ -862,12 +862,12 @@ struct cfg80211_bss *rtw_cfg80211_inform_bss(_adapter *padapter, struct wlan_net SetSeqNum(pwlanhdr, 0/*pmlmeext->mgnt_seq*/); /* pmlmeext->mgnt_seq++; */ - if (pnetwork->network.Reserved[0] == BSS_TYPE_BCN) { /* WIFI_BEACON */ + if (pnetwork->network.Reserved[0] == BSS_TYPE_BCN) { /* IEEE80211_STYPE_BEACON */ memcpy(pwlanhdr->addr1, bc_addr, ETH_ALEN); - set_frame_sub_type(pbuf, WIFI_BEACON); + set_frame_sub_type(pbuf, IEEE80211_STYPE_BEACON); } else { memcpy(pwlanhdr->addr1, adapter_mac_addr(padapter), ETH_ALEN); - set_frame_sub_type(pbuf, WIFI_PROBERSP); + set_frame_sub_type(pbuf, IEEE80211_STYPE_PROBE_RESP); } memcpy(pwlanhdr->addr2, pnetwork->network.MacAddress, ETH_ALEN); @@ -904,7 +904,7 @@ struct cfg80211_bss *rtw_cfg80211_inform_bss(_adapter *padapter, struct wlan_net #if (LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 38)) #ifndef COMPAT_KERNEL_RELEASE /* patch for cfg80211, update beacon ies to information_elements */ - if (pnetwork->network.Reserved[0] == BSS_TYPE_BCN) { /* WIFI_BEACON */ + if (pnetwork->network.Reserved[0] == BSS_TYPE_BCN) { /* IEEE80211_STYPE_BEACON */ if (bss->len_information_elements != bss->len_beacon_ies) { bss->information_elements = bss->beacon_ies; @@ -2527,7 +2527,7 @@ u32 rtw_cfg80211_wait_scan_req_empty(_adapter *adapter, u32 timeout_ms) systime start; u32 pass_ms; - start = rtw_get_current_time(); + start = jiffies; while (rtw_get_passing_time_ms(start) <= timeout_ms) { @@ -2633,7 +2633,7 @@ static void _rtw_cfg80211_surveydone_event_callback(_adapter *padapter, struct c plist = get_next(phead); while (1) { - if (rtw_end_of_queue_search(phead, plist) == _TRUE) + if (phead == plist) break; pnetwork = LIST_CONTAINOR(plist, struct wlan_network, list); @@ -2657,7 +2657,7 @@ static void _rtw_cfg80211_surveydone_event_callback(_adapter *padapter, struct c if (_rtw_memcmp(pnetwork->network.Ssid.Ssid, "Ralink_11n_AP", 13)) { uint ie_len = 0; u8 *p = NULL; - p = rtw_get_ie(pnetwork->network.IEs + _BEACON_IE_OFFSET_, _RSN_IE_2_, &ie_len, (pnetwork->network.IELength - _BEACON_IE_OFFSET_)); + p = rtw_get_ie(pnetwork->network.IEs + _BEACON_IE_OFFSET_, WLAN_EID_RSN, &ie_len, (pnetwork->network.IELength - _BEACON_IE_OFFSET_)); RTW_INFO("ie_len=%d\n", ie_len); } } @@ -3227,7 +3227,7 @@ cancel_ps_deny: exit: if (pmlmepriv) - pmlmepriv->lastscantime = rtw_get_current_time(); + pmlmepriv->lastscantime = jiffies; return ret; } @@ -4344,9 +4344,9 @@ void rtw_cfg80211_indicate_sta_assoc(_adapter *padapter, u8 *pmgmt_frame, uint f { struct station_info sinfo; u8 ie_offset; - if (get_frame_sub_type(pmgmt_frame) == WIFI_ASSOCREQ) + if (get_frame_sub_type(pmgmt_frame) == IEEE80211_STYPE_ASSOC_REQ) ie_offset = _ASOCREQ_IE_OFFSET_; - else /* WIFI_REASSOCREQ */ + else /* IEEE80211_STYPE_REASSOC_REQ */ ie_offset = _REASOCREQ_IE_OFFSET_; memset(&sinfo, 0, sizeof(sinfo)); @@ -4416,7 +4416,7 @@ void rtw_cfg80211_indicate_sta_disassoc(_adapter *padapter, const u8 *da, unsign SetSeqNum(pwlanhdr, pmlmeext->mgnt_seq); pmlmeext->mgnt_seq++; - set_frame_sub_type(pmgmt_frame, WIFI_DEAUTH); + 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); @@ -4944,8 +4944,8 @@ static int rtw_add_beacon(_adapter *adapter, const u8 *head, size_t head_len, co #endif /* CONFIG_P2P */ /* pbss_network->IEs will not include p2p_ie, wfd ie */ - rtw_ies_remove_ie(pbuf, &len, _BEACON_IE_OFFSET_, _VENDOR_SPECIFIC_IE_, P2P_OUI, 4); - rtw_ies_remove_ie(pbuf, &len, _BEACON_IE_OFFSET_, _VENDOR_SPECIFIC_IE_, WFD_OUI, 4); + rtw_ies_remove_ie(pbuf, &len, _BEACON_IE_OFFSET_, WLAN_EID_VENDOR_SPECIFIC, P2P_OUI, 4); + rtw_ies_remove_ie(pbuf, &len, _BEACON_IE_OFFSET_, WLAN_EID_VENDOR_SPECIFIC, WFD_OUI, 4); if (rtw_check_beacon_data(adapter, pbuf, len) == _SUCCESS) { #ifdef CONFIG_P2P @@ -5531,7 +5531,7 @@ static int cfg80211_rtw_del_station(struct wiphy *wiphy, struct net_device *ndev plist = get_next(phead); /* check asoc_queue */ - while ((rtw_end_of_queue_search(phead, plist)) == _FALSE) { + while (phead != plist) { psta = LIST_CONTAINOR(plist, struct sta_info, asoc_list); plist = get_next(plist); @@ -5718,7 +5718,7 @@ struct sta_info *rtw_sta_info_get_by_idx(struct sta_priv *pstapriv, const int id plist = get_next(phead); /* check asoc_queue */ - while ((rtw_end_of_queue_search(phead, plist)) == _FALSE) { + while (phead != plist) { if (idx == i) psta = LIST_CONTAINOR(plist, struct sta_info, asoc_list); plist = get_next(plist); @@ -6380,7 +6380,7 @@ void rtw_cfg80211_issue_p2p_provision_request(_adapter *padapter, const u8 *buf, SetSeqNum(pwlanhdr, pmlmeext->mgnt_seq); pmlmeext->mgnt_seq++; - set_frame_sub_type(pframe, WIFI_ACTION); + set_frame_sub_type(pframe, IEEE80211_STYPE_ACTION); pframe += sizeof(struct rtw_ieee80211_hdr_3addr); pattrib->pktlen = sizeof(struct rtw_ieee80211_hdr_3addr); @@ -6438,7 +6438,7 @@ void rtw_cfg80211_issue_p2p_provision_request(_adapter *padapter, const u8 *buf, p2pielen += devinfo_contentlen; - pframe = rtw_set_ie(pframe, _VENDOR_SPECIFIC_IE_, p2pielen, (unsigned char *) p2p_ie, &p2p_ielen); + pframe = rtw_set_ie(pframe, WLAN_EID_VENDOR_SPECIFIC, p2pielen, (unsigned char *) p2p_ie, &p2p_ielen); /* p2pielen = build_prov_disc_request_p2p_ie( pwdinfo, pframe, NULL, 0, pwdinfo->tx_prov_disc_info.peerDevAddr); */ /* pframe += p2pielen; */ pattrib->pktlen += p2p_ielen; @@ -6473,7 +6473,7 @@ void rtw_cfg80211_issue_p2p_provision_request(_adapter *padapter, const u8 *buf, *(u16 *)(wpsie + wpsielen) = cpu_to_be16(pwdinfo->tx_prov_disc_info.wps_config_method_request); wpsielen += 2; - pframe = rtw_set_ie(pframe, _VENDOR_SPECIFIC_IE_, wpsielen, (unsigned char *) wpsie, &pattrib->pktlen); + pframe = rtw_set_ie(pframe, WLAN_EID_VENDOR_SPECIFIC, wpsielen, (unsigned char *) wpsie, &pattrib->pktlen); #ifdef CONFIG_WFD @@ -6569,7 +6569,7 @@ void rtw_cfg80211_external_auth_request(_adapter *padapter, union recv_frame *rf cfg80211_external_auth_request(netdev, (struct cfg80211_external_auth_params *)¶ms, GFP_ATOMIC); #elif (KERNEL_VERSION(2, 6, 37) <= LINUX_VERSION_CODE) - set_frame_sub_type(frame, WIFI_AUTH); + set_frame_sub_type(frame, IEEE80211_STYPE_AUTH); memcpy(frame + 4, get_my_bssid(&pmlmeinfo->network), ETH_ALEN); memcpy(frame + 10, adapter_mac_addr(padapter), ETH_ALEN); @@ -6604,7 +6604,7 @@ inline bool rtw_cfg80211_is_ro_ch_once(_adapter *adapter) inline void rtw_cfg80211_set_last_ro_ch_time(_adapter *adapter) { - adapter->cfg80211_wdinfo.last_ro_ch_time = rtw_get_current_time(); + adapter->cfg80211_wdinfo.last_ro_ch_time = jiffies; if (!adapter->cfg80211_wdinfo.last_ro_ch_time) adapter->cfg80211_wdinfo.last_ro_ch_time++; @@ -6711,7 +6711,7 @@ static s32 cfg80211_rtw_remain_on_channel(struct wiphy *wiphy, RTW_INFO(FUNC_ADPT_FMT" init listen_channel %u\n" , FUNC_ADPT_ARG(padapter), padapter->wdinfo.listen_channel); } else if (rtw_p2p_chk_state(pwdinfo , P2P_STATE_LISTEN) - && (time_after_eq(rtw_get_current_time(), pwdev_priv->probe_resp_ie_update_time) + && (time_after_eq(jiffies, pwdev_priv->probe_resp_ie_update_time) && rtw_get_passing_time_ms(pwdev_priv->probe_resp_ie_update_time) < 50) ) { if (padapter->wdinfo.listen_channel != remain_ch) { @@ -7247,7 +7247,7 @@ static int cfg80211_rtw_mgmt_tx(struct wiphy *wiphy, u8 is_p2p = 0; #endif int type = (-1); - systime start = rtw_get_current_time(); + systime start = jiffies; _adapter *padapter; struct dvobj_priv *dvobj; struct rtw_wdev_priv *pwdev_priv; @@ -8188,7 +8188,7 @@ u8 *rtw_cfg80211_construct_mesh_beacon_ies(struct wiphy *wiphy, _adapter *adapte *c = WLAN_EID_TIM; *(c + 1) = 4; c += 6; - //c = rtw_set_ie(c, _TIM_IE_, 4, NULL, NULL); + //c = rtw_set_ie(c, WLAN_EID_DS_PARAMS, 4, NULL, NULL); /* Extended Supported Rates */ if (n_bitrates > 8) @@ -8598,9 +8598,9 @@ static void rtw_cfg80211_mpath_set_pinfo(struct rtw_mesh_path *mpath, u8 *next_h pinfo->frame_qlen = mpath->frame_queue_len; pinfo->sn = mpath->sn; pinfo->metric = mpath->metric; - if (rtw_time_after(mpath->exp_time, rtw_get_current_time())) + if (rtw_time_after(mpath->exp_time, jiffies)) pinfo->exptime = rtw_get_remaining_time_ms(mpath->exp_time); - pinfo->discovery_timeout = rtw_systime_to_ms(mpath->discovery_timeout); + pinfo->discovery_timeout = jiffies_to_msecs(mpath->discovery_timeout); pinfo->discovery_retries = mpath->discovery_retries; if (mpath->flags & RTW_MESH_PATH_ACTIVE) pinfo->flags |= NL80211_MPATH_FLAG_ACTIVE; @@ -8889,7 +8889,7 @@ static int rtw_cfg80211_set_beacon_wpsp2pie(struct net_device *ndev, char *buf, memcpy(pmlmepriv->wps_beacon_ie, wps_ie, wps_ielen); pmlmepriv->wps_beacon_ie_len = wps_ielen; - update_beacon(padapter, _VENDOR_SPECIFIC_IE_, wps_oui, _TRUE); + update_beacon(padapter, WLAN_EID_VENDOR_SPECIFIC, wps_oui, _TRUE); } @@ -9192,7 +9192,7 @@ int rtw_cfg80211_set_mgnt_wpsp2pie(struct net_device *net, char *buf, int len, ret = rtw_cfg80211_set_probe_resp_wpsp2pie(net, buf, len); #ifdef CONFIG_P2P if (ret == 0) - adapter_wdev_data((_adapter *)rtw_netdev_priv(net))->probe_resp_ie_update_time = rtw_get_current_time(); + adapter_wdev_data((_adapter *)rtw_netdev_priv(net))->probe_resp_ie_update_time = jiffies; #endif break; case 0x4: /* ASSOC_RESP */ @@ -10068,7 +10068,7 @@ int rtw_wdev_alloc(_adapter *padapter, struct wiphy *wiphy) _rtw_spinlock_init(&pwdev_priv->connect_req_lock); pwdev_priv->p2p_enabled = _FALSE; - pwdev_priv->probe_resp_ie_update_time = rtw_get_current_time(); + pwdev_priv->probe_resp_ie_update_time = jiffies; pwdev_priv->provdisc_req_issued = _FALSE; rtw_wdev_invit_info_init(&pwdev_priv->invit_info); rtw_wdev_nego_info_init(&pwdev_priv->nego_info); diff --git a/os_dep/linux/ioctl_linux.c b/os_dep/linux/ioctl_linux.c index 04b23a9..2c7b3cf 100644 --- a/os_dep/linux/ioctl_linux.c +++ b/os_dep/linux/ioctl_linux.c @@ -358,7 +358,7 @@ static inline char *iwe_stream_protocol_process(_adapter *padapter, #ifdef CONFIG_80211N_HT /* parsing HT_CAP_IE */ if(padapter->registrypriv.ht_enable && is_supported_ht(padapter->registrypriv.wireless_mode)) { - p = rtw_get_ie(&pnetwork->network.IEs[ie_offset], _HT_CAPABILITY_IE_, &ht_ielen, pnetwork->network.IELength - ie_offset); + p = rtw_get_ie(&pnetwork->network.IEs[ie_offset], WLAN_EID_HT_CAPABILITY, &ht_ielen, pnetwork->network.IELength - ie_offset); if (p && ht_ielen > 0) ht_cap = _TRUE; } @@ -423,12 +423,12 @@ static inline char *iwe_stream_rate_process(_adapter *padapter, /* parsing HT_CAP_IE */ if(is_supported_ht(padapter->registrypriv.wireless_mode)) { - p = rtw_get_ie(&pnetwork->network.IEs[ie_offset], _HT_CAPABILITY_IE_, &ht_ielen, pnetwork->network.IELength - ie_offset); + p = rtw_get_ie(&pnetwork->network.IEs[ie_offset], WLAN_EID_HT_CAPABILITY, &ht_ielen, pnetwork->network.IELength - ie_offset); if (p && ht_ielen > 0) { - struct rtw_ieee80211_ht_cap *pht_capie; + struct ieee80211_ht_cap *pht_capie; ht_cap = _TRUE; - pht_capie = (struct rtw_ieee80211_ht_cap *)(p + 2); - memcpy(&mcs_rate , pht_capie->supp_mcs_set, 2); + pht_capie = (struct ieee80211_ht_cap *)(p + 2); + memcpy(&mcs_rate , pht_capie->mcs.rx_mask, 2); bw_40MHz = (pht_capie->cap_info & IEEE80211_HT_CAP_SUP_WIDTH_20_40) ? 1 : 0; short_GI = (pht_capie->cap_info & (IEEE80211_HT_CAP_SGI_20 | IEEE80211_HT_CAP_SGI_40)) ? 1 : 0; } @@ -1093,7 +1093,7 @@ static int rtw_set_wpa_ie(_adapter *padapter, char *pie, unsigned short ielen) while (cnt < ielen) { eid = buf[cnt]; - if ((eid == _VENDOR_SPECIFIC_IE_) && (_rtw_memcmp(&buf[cnt + 2], wps_oui, 4) == _TRUE)) { + if ((eid == WLAN_EID_VENDOR_SPECIFIC) && (_rtw_memcmp(&buf[cnt + 2], wps_oui, 4) == _TRUE)) { RTW_INFO("SET WPS_IE\n"); padapter->securitypriv.wps_ie_len = ((buf[cnt + 1] + 2) < MAX_WPS_IE_LEN) ? (buf[cnt + 1] + 2) : MAX_WPS_IE_LEN; @@ -1150,7 +1150,7 @@ static int rtw_wx_get_name(struct net_device *dev, if (check_fwstate(pmlmepriv, _FW_LINKED | WIFI_ADHOC_MASTER_STATE) == _TRUE) { /* parsing HT_CAP_IE */ if( is_supported_ht(padapter->registrypriv.wireless_mode)&&(padapter->registrypriv.ht_enable)) { - p = rtw_get_ie(&pcur_bss->IEs[12], _HT_CAPABILITY_IE_, &ht_ielen, pcur_bss->IELength - 12); + p = rtw_get_ie(&pcur_bss->IEs[12], WLAN_EID_HT_CAPABILITY, &ht_ielen, pcur_bss->IELength - 12); if (p && ht_ielen > 0 ) ht_cap = _TRUE; } @@ -1725,7 +1725,7 @@ static int rtw_wx_set_wap(struct net_device *dev, while (1) { - if ((rtw_end_of_queue_search(phead, pmlmepriv->pscanned)) == _TRUE) { + if (phead != pmlmepriv->pscanned) { #if 0 ret = -EINVAL; goto cancel_ps_deny; @@ -2177,7 +2177,7 @@ static int rtw_wx_get_scan(struct net_device *dev, struct iw_request_info *a, plist = get_next(phead); while (1) { - if (rtw_end_of_queue_search(phead, plist) == _TRUE) + if (phead == plist) break; if ((stop - ev) < SCAN_ITEM_SIZE) { @@ -2317,7 +2317,7 @@ static int rtw_wx_set_essid(struct net_device *dev, pmlmepriv->pscanned = get_next(phead); while (1) { - if (rtw_end_of_queue_search(phead, pmlmepriv->pscanned) == _TRUE) { + if (phead != pmlmepriv->pscanned) { #if 0 if (check_fwstate(pmlmepriv, WIFI_ADHOC_STATE) == _TRUE) { rtw_set_802_11_ssid(padapter, &ndis_ssid); @@ -3686,7 +3686,7 @@ static int rtw_get_ap_info(struct net_device *dev, plist = get_next(phead); while (1) { - if (rtw_end_of_queue_search(phead, plist) == _TRUE) + if (phead == plist) break; @@ -4241,7 +4241,7 @@ static int rtw_p2p_get_wps_configmethod(struct net_device *dev, plist = get_next(phead); while (1) { - if (rtw_end_of_queue_search(phead, plist) == _TRUE) + if (phead == plist) break; pnetwork = LIST_CONTAINOR(plist, struct wlan_network, list); @@ -4370,7 +4370,7 @@ static int rtw_p2p_get_go_device_address(struct net_device *dev, plist = get_next(phead); while (1) { - if (rtw_end_of_queue_search(phead, plist) == _TRUE) + if (phead == plist) break; pnetwork = LIST_CONTAINOR(plist, struct wlan_network, list); @@ -4456,7 +4456,7 @@ static int rtw_p2p_get_device_type(struct net_device *dev, plist = get_next(phead); while (1) { - if (rtw_end_of_queue_search(phead, plist) == _TRUE) + if (phead == plist) break; pnetwork = LIST_CONTAINOR(plist, struct wlan_network, list); @@ -4530,7 +4530,7 @@ static int rtw_p2p_get_device_name(struct net_device *dev, plist = get_next(phead); while (1) { - if (rtw_end_of_queue_search(phead, plist) == _TRUE) + if (phead == plist) break; pnetwork = LIST_CONTAINOR(plist, struct wlan_network, list); @@ -4600,7 +4600,7 @@ static int rtw_p2p_get_invitation_procedure(struct net_device *dev, plist = get_next(phead); while (1) { - if (rtw_end_of_queue_search(phead, plist) == _TRUE) + if (phead == plist) break; pnetwork = LIST_CONTAINOR(plist, struct wlan_network, list); @@ -4698,7 +4698,7 @@ static int rtw_p2p_connect(struct net_device *dev, plist = get_next(phead); while (1) { - if (rtw_end_of_queue_search(phead, plist) == _TRUE) + if (phead == plist) break; pnetwork = LIST_CONTAINOR(plist, struct wlan_network, list); @@ -4843,7 +4843,7 @@ static int rtw_p2p_invite_req(struct net_device *dev, plist = get_next(phead); while (1) { - if (rtw_end_of_queue_search(phead, plist) == _TRUE) + if (phead == plist) break; pnetwork = LIST_CONTAINOR(plist, struct wlan_network, list); @@ -5100,7 +5100,7 @@ static int rtw_p2p_set_pc(struct net_device *dev, plist = get_next(phead); while (1) { - if (rtw_end_of_queue_search(phead, plist) == _TRUE) + if (phead == plist) break; pnetwork = LIST_CONTAINOR(plist, struct wlan_network, list); @@ -5348,7 +5348,7 @@ static int rtw_p2p_prov_disc(struct net_device *dev, plist = get_next(phead); while (1) { - if (rtw_end_of_queue_search(phead, plist) == _TRUE) + if (phead == plist) break; if (uintPeerChannel != 0) @@ -6177,7 +6177,7 @@ static int rtw_dbg_port(struct net_device *dev, phead = &(pstapriv->sta_hash[i]); plist = get_next(phead); - while ((rtw_end_of_queue_search(phead, plist)) == _FALSE) { + while (phead != plist) { psta = LIST_CONTAINOR(plist, struct sta_info, hash_list); plist = get_next(plist); @@ -7226,7 +7226,7 @@ static int rtw_add_sta(struct net_device *dev, struct ieee_param *param) (WLAN_STA_HT & flags)) { psta->htpriv.ht_option = _TRUE; psta->qos_option = 1; - memcpy((void *)&psta->htpriv.ht_cap, (void *)¶m->u.add_sta.ht_cap, sizeof(struct rtw_ieee80211_ht_cap)); + memcpy((void *)&psta->htpriv.ht_cap, (void *)¶m->u.add_sta.ht_cap, sizeof(struct ieee80211_ht_cap)); } else psta->htpriv.ht_option = _FALSE; @@ -7325,7 +7325,7 @@ static int rtw_ioctl_get_sta_data(struct net_device *dev, struct ieee_param *par u32 sta_set; u8 tx_supp_rates[16]; u32 tx_supp_rates_len; - struct rtw_ieee80211_ht_cap ht_cap; + struct ieee80211_ht_cap ht_cap; u64 rx_pkts; u64 rx_bytes; u64 rx_drops; @@ -7358,7 +7358,7 @@ static int rtw_ioctl_get_sta_data(struct net_device *dev, struct ieee_param *par memcpy(psta_data->tx_supp_rates, psta->bssrateset, psta->bssratelen); #ifdef CONFIG_80211N_HT if(padapter->registrypriv.ht_enable && is_supported_ht(padapter->registrypriv.wireless_mode)) - memcpy(&psta_data->ht_cap, &psta->htpriv.ht_cap, sizeof(struct rtw_ieee80211_ht_cap)); + memcpy(&psta_data->ht_cap, &psta->htpriv.ht_cap, sizeof(struct ieee80211_ht_cap)); #endif /* CONFIG_80211N_HT */ psta_data->rx_pkts = psta->sta_stats.rx_data_pkts; psta_data->rx_bytes = psta->sta_stats.rx_bytes; @@ -7450,7 +7450,7 @@ static int rtw_set_wps_beacon(struct net_device *dev, struct ieee_param *param, memcpy(pmlmepriv->wps_beacon_ie, param->u.bcn_ie.buf, ie_len); - update_beacon(padapter, _VENDOR_SPECIFIC_IE_, wps_oui, _TRUE); + update_beacon(padapter, WLAN_EID_VENDOR_SPECIFIC, wps_oui, _TRUE); pmlmeext->bstart_bss = _TRUE; @@ -7833,7 +7833,7 @@ static int rtw_wx_set_priv(struct net_device *dev, int probereq_wpsie_len = len; u8 wps_oui[4] = {0x0, 0x50, 0xf2, 0x04}; - if ((_VENDOR_SPECIFIC_IE_ == probereq_wpsie[0]) && + if ((WLAN_EID_VENDOR_SPECIFIC == probereq_wpsie[0]) && (_rtw_memcmp(&probereq_wpsie[2], wps_oui, 4) == _TRUE)) { cp_sz = probereq_wpsie_len > MAX_WPS_IE_LEN ? MAX_WPS_IE_LEN : probereq_wpsie_len; @@ -7960,7 +7960,7 @@ static int rtw_wowlan_ctrl(struct net_device *dev, struct mlme_priv *pmlmepriv = &padapter->mlmepriv; struct sta_info *psta = NULL; int ret = 0; - systime start_time = rtw_get_current_time(); + systime start_time = jiffies; poidparam.subcode = 0; RTW_INFO("+rtw_wowlan_ctrl: %s\n", extra); @@ -8032,7 +8032,7 @@ static int rtw_wowlan_set_pattern(struct net_device *dev, struct mlme_priv *pmlmepriv = &padapter->mlmepriv; struct wowlan_ioctl_param poidparam; int ret = 0, len = 0, i = 0; - systime start_time = rtw_get_current_time(); + systime start_time = jiffies; u8 input[wrqu->data.length]; u8 index = 0; @@ -8103,7 +8103,7 @@ static int rtw_ap_wowlan_ctrl(struct net_device *dev, struct mlme_priv *pmlmepriv = &padapter->mlmepriv; struct sta_info *psta = NULL; int ret = 0; - systime start_time = rtw_get_current_time(); + systime start_time = jiffies; poidparam.subcode = 0; RTW_INFO("+rtw_ap_wowlan_ctrl: %s\n", extra); @@ -11493,7 +11493,7 @@ static struct xmit_frame *createloopbackpkt(PADAPTER padapter, u32 size) pattrib->ack_policy = 0; /* pattrib->pkt_hdrlen = ETH_HLEN; */ pattrib->hdrlen = WLAN_HDR_A3_LEN; - pattrib->subtype = WIFI_DATA; + pattrib->subtype = (IEEE80211_FTYPE_DATA | IEEE80211_STYPE_DATA); pattrib->priority = 0; pattrib->qsel = pattrib->priority; /* do_queue_select(padapter, pattrib); */ diff --git a/os_dep/linux/os_intfs.c b/os_dep/linux/os_intfs.c index dbabac2..cd0a7c9 100644 --- a/os_dep/linux/os_intfs.c +++ b/os_dep/linux/os_intfs.c @@ -3485,8 +3485,8 @@ netdev_open_normal_process: #endif #ifdef CONFIG_RTW_CFGVEDNOR_LLSTATS - pwrctrlpriv->radio_on_start_time = rtw_get_current_time(); - pwrctrlpriv->pwr_saving_start_time = rtw_get_current_time(); + pwrctrlpriv->radio_on_start_time = jiffies; + pwrctrlpriv->pwr_saving_start_time = jiffies; pwrctrlpriv->pwr_saving_time = 0; pwrctrlpriv->on_time = 0; pwrctrlpriv->tx_time = 0; @@ -3607,7 +3607,7 @@ int rtw_ips_pwr_up(_adapter *padapter) struct sreset_priv *psrtpriv = &pHalData->srestpriv; #endif/* #ifdef DBG_CONFIG_ERROR_DETECT */ #endif /* defined(CONFIG_SWLPS_IN_IPS) || defined(CONFIG_FWLPS_IN_IPS) */ - systime start_time = rtw_get_current_time(); + systime start_time = jiffies; RTW_INFO("===> rtw_ips_pwr_up..............\n"); #if defined(CONFIG_SWLPS_IN_IPS) || defined(CONFIG_FWLPS_IN_IPS) @@ -3628,7 +3628,7 @@ int rtw_ips_pwr_up(_adapter *padapter) void rtw_ips_pwr_down(_adapter *padapter) { - systime start_time = rtw_get_current_time(); + systime start_time = jiffies; RTW_INFO("===> rtw_ips_pwr_down...................\n"); padapter->net_closed = _TRUE; @@ -4629,7 +4629,7 @@ int rtw_suspend_common(_adapter *padapter) #endif int ret = 0; - systime start_time = rtw_get_current_time(); + systime start_time = jiffies; RTW_PRINT(" suspend start\n"); RTW_INFO("==> %s (%s:%d)\n", __FUNCTION__, current->comm, current->pid); @@ -5096,7 +5096,7 @@ exit: int rtw_resume_common(_adapter *padapter) { int ret = 0; - systime start_time = rtw_get_current_time(); + systime start_time = jiffies; struct pwrctrl_priv *pwrpriv = adapter_to_pwrctl(padapter); if (pwrpriv->bInSuspend == _FALSE) diff --git a/os_dep/linux/recv_linux.c b/os_dep/linux/recv_linux.c index ad3e27f..d79221f 100644 --- a/os_dep/linux/recv_linux.c +++ b/os_dep/linux/recv_linux.c @@ -562,16 +562,16 @@ void rtw_handle_tkip_mic_err(_adapter *padapter, struct sta_info *sta, u8 bgroup systime cur_time = 0; if (psecuritypriv->last_mic_err_time == 0) - psecuritypriv->last_mic_err_time = rtw_get_current_time(); + psecuritypriv->last_mic_err_time = jiffies; else { - cur_time = rtw_get_current_time(); + cur_time = jiffies; if (cur_time - psecuritypriv->last_mic_err_time < 60 * HZ) { psecuritypriv->btkip_countermeasure = _TRUE; psecuritypriv->last_mic_err_time = 0; psecuritypriv->btkip_countermeasure_time = cur_time; } else - psecuritypriv->last_mic_err_time = rtw_get_current_time(); + psecuritypriv->last_mic_err_time = jiffies; } #ifdef CONFIG_IOCTL_CFG80211 diff --git a/os_dep/linux/rtw_cfgvendor.c b/os_dep/linux/rtw_cfgvendor.c index da94074..578567a 100644 --- a/os_dep/linux/rtw_cfgvendor.c +++ b/os_dep/linux/rtw_cfgvendor.c @@ -1167,13 +1167,13 @@ static void LinkLayerStats(_adapter *padapter) if (rtw_mi_check_fwstate(padapter, _FW_LINKED)) { if ( pwrpriv->bpower_saving == _TRUE ) { pwrpriv->pwr_saving_time += rtw_get_passing_time_ms(pwrpriv->pwr_saving_start_time); - pwrpriv->pwr_saving_start_time = rtw_get_current_time(); + pwrpriv->pwr_saving_start_time = jiffies; } } else { #ifdef CONFIG_IPS if ( pwrpriv->bpower_saving == _TRUE ) { pwrpriv->pwr_saving_time += rtw_get_passing_time_ms(pwrpriv->pwr_saving_start_time); - pwrpriv->pwr_saving_start_time = rtw_get_current_time(); + pwrpriv->pwr_saving_start_time = jiffies; } #else pwrpriv->pwr_saving_time = pwrpriv->on_time; diff --git a/os_dep/linux/rtw_proc.c b/os_dep/linux/rtw_proc.c index fa3b650..c57fa32 100644 --- a/os_dep/linux/rtw_proc.c +++ b/os_dep/linux/rtw_proc.c @@ -888,7 +888,7 @@ static int proc_get_tx_info_msg(struct seq_file *m, void *v) phead = &(pstapriv->sta_hash[i]); plist = get_next(phead); - while ((rtw_end_of_queue_search(phead, plist)) == _FALSE) { + while (phead != plist) { psta = LIST_CONTAINOR(plist, struct sta_info, hash_list); diff --git a/os_dep/linux/usb_intf.c b/os_dep/linux/usb_intf.c index de37244..28e4764 100644 --- a/os_dep/linux/usb_intf.c +++ b/os_dep/linux/usb_intf.c @@ -1122,7 +1122,7 @@ static int rtw_resume(struct usb_interface *pusb_intf) } } - pmlmeext->last_scan_time = rtw_get_current_time(); + pmlmeext->last_scan_time = jiffies; RTW_INFO("<======== %s return %d\n", __FUNCTION__, ret); return ret; diff --git a/os_dep/linux/usb_ops_linux.c b/os_dep/linux/usb_ops_linux.c index 8b0bdd7..f09e332 100644 --- a/os_dep/linux/usb_ops_linux.c +++ b/os_dep/linux/usb_ops_linux.c @@ -442,7 +442,7 @@ static void usb_write_port_complete(struct urb *purb, struct pt_regs *regs) #ifdef DBG_CONFIG_ERROR_DETECT { HAL_DATA_TYPE *pHalData = GET_HAL_DATA(padapter); - pHalData->srestpriv.last_tx_complete_time = rtw_get_current_time(); + pHalData->srestpriv.last_tx_complete_time = jiffies; } #endif @@ -563,7 +563,7 @@ u32 usb_write_port(struct intf_hdl *pintfhdl, u32 addr, u32 cnt, u8 *wmem) #ifdef DBG_CONFIG_ERROR_DETECT { HAL_DATA_TYPE *pHalData = GET_HAL_DATA(padapter); - pHalData->srestpriv.last_tx_time = rtw_get_current_time(); + pHalData->srestpriv.last_tx_time = jiffies; } #endif } else { diff --git a/os_dep/linux/xmit_linux.c b/os_dep/linux/xmit_linux.c index 9248901..9d6dd09 100644 --- a/os_dep/linux/xmit_linux.c +++ b/os_dep/linux/xmit_linux.c @@ -389,7 +389,7 @@ int rtw_mlcst2unicst(_adapter *padapter, struct sk_buff *skb) plist = get_next(phead); /* free sta asoc_queue */ - while ((rtw_end_of_queue_search(phead, plist)) == _FALSE) { + while (phead != plist) { int stainfo_offset; psta = LIST_CONTAINOR(plist, struct sta_info, asoc_list); plist = get_next(plist); diff --git a/os_dep/osdep_service.c b/os_dep/osdep_service.c index 49969a4..dc78eb6 100644 --- a/os_dep/osdep_service.c +++ b/os_dep/osdep_service.c @@ -367,7 +367,7 @@ void rtw_mstat_update(const enum mstat_f flags, const MSTAT_STATUS status, u32 s /* if (rtw_get_passing_time_ms(update_time) > 5000) { */ /* rtw_mstat_dump(RTW_DBGDUMP); */ - update_time = rtw_get_current_time(); + update_time = jiffies; /* } */ } @@ -847,11 +847,6 @@ void _rtw_init_sema(_sema *sema, int init_val) } -void _rtw_free_sema(_sema *sema) -{ - -} - void _rtw_up_sema(_sema *sema) { @@ -999,61 +994,20 @@ u32 _rtw_queue_empty(_queue *pqueue) return rtw_is_list_empty(&(pqueue->queue)); } - -u32 rtw_end_of_queue_search(_list *head, _list *plist) -{ - if (head == plist) - return _TRUE; - else - return _FALSE; -} - - -systime _rtw_get_current_time(void) -{ - -#ifdef PLATFORM_LINUX - return jiffies; -#endif -} - -inline u32 _rtw_systime_to_ms(systime stime) -{ -#ifdef PLATFORM_LINUX - return jiffies_to_msecs(stime); -#endif -} - -inline systime _rtw_ms_to_systime(u32 ms) -{ -#ifdef PLATFORM_LINUX - return msecs_to_jiffies(ms); -#endif -} - -inline systime _rtw_us_to_systime(u32 us) -{ -#ifdef PLATFORM_LINUX - return usecs_to_jiffies(us); -#else - #error "TBD\n" -#endif -} - -/* the input parameter start use the same unit as returned by rtw_get_current_time */ +/* the input parameter start use the same unit as returned by jiffies */ inline s32 _rtw_get_passing_time_ms(systime start) { - return _rtw_systime_to_ms(_rtw_get_current_time() - start); + return jiffies_to_msecs(jiffies - start); } inline s32 _rtw_get_remaining_time_ms(systime end) { - return _rtw_systime_to_ms(end - _rtw_get_current_time()); + return jiffies_to_msecs(end - jiffies); } inline s32 _rtw_get_time_interval_ms(systime start, systime end) { - return _rtw_systime_to_ms(end - start); + return jiffies_to_msecs(end - start); } inline bool _rtw_time_after(systime a, systime b) @@ -1197,9 +1151,9 @@ inline void rtw_resume_unlock_suspend(void) inline void rtw_lock_suspend_timeout(u32 timeout_ms) { #ifdef CONFIG_WAKELOCK - wake_lock_timeout(&rtw_suspend_lock, rtw_ms_to_systime(timeout_ms)); + wake_lock_timeout(&rtw_suspend_lock, msecs_to_jiffies(timeout_ms)); #elif defined(CONFIG_ANDROID_POWER) - android_lock_suspend_auto_expire(&rtw_suspend_lock, rtw_ms_to_systime(timeout_ms)); + android_lock_suspend_auto_expire(&rtw_suspend_lock, msecs_to_jiffies(timeout_ms)); #endif } @@ -1207,9 +1161,9 @@ inline void rtw_lock_suspend_timeout(u32 timeout_ms) inline void rtw_lock_traffic_suspend_timeout(u32 timeout_ms) { #ifdef CONFIG_WAKELOCK - wake_lock_timeout(&rtw_suspend_traffic_lock, rtw_ms_to_systime(timeout_ms)); + wake_lock_timeout(&rtw_suspend_traffic_lock, msecs_to_jiffies(timeout_ms)); #elif defined(CONFIG_ANDROID_POWER) - android_lock_suspend_auto_expire(&rtw_suspend_traffic_lock, rtw_ms_to_systime(timeout_ms)); + android_lock_suspend_auto_expire(&rtw_suspend_traffic_lock, msecs_to_jiffies(timeout_ms)); #endif /* RTW_INFO("traffic lock timeout:%d\n", timeout_ms); */ } @@ -1918,20 +1872,20 @@ int rtw_blacklist_add(_queue *blist, const u8 *addr, u32 timeout_ms) head = &blist->queue; list = get_next(head); - while (rtw_end_of_queue_search(head, list) == _FALSE) { + while (head != list) { ent = LIST_CONTAINOR(list, struct blacklist_ent, list); list = get_next(list); if (_rtw_memcmp(ent->addr, addr, ETH_ALEN) == _TRUE) { exist = _TRUE; - if (rtw_time_after(rtw_get_current_time(), ent->exp_time)) + if (rtw_time_after(jiffies, ent->exp_time)) timeout = _TRUE; - ent->exp_time = rtw_get_current_time() - + rtw_ms_to_systime(timeout_ms); + ent->exp_time = jiffies + + msecs_to_jiffies(timeout_ms); break; } - if (rtw_time_after(rtw_get_current_time(), ent->exp_time)) { + if (rtw_time_after(jiffies, ent->exp_time)) { rtw_list_delete(&ent->list); rtw_mfree(ent, sizeof(struct blacklist_ent)); } @@ -1941,8 +1895,8 @@ int rtw_blacklist_add(_queue *blist, const u8 *addr, u32 timeout_ms) ent = rtw_malloc(sizeof(struct blacklist_ent)); if (ent) { memcpy(ent->addr, addr, ETH_ALEN); - ent->exp_time = rtw_get_current_time() - + rtw_ms_to_systime(timeout_ms); + ent->exp_time = jiffies + + msecs_to_jiffies(timeout_ms); rtw_list_insert_tail(&ent->list, head); } } @@ -1962,7 +1916,7 @@ int rtw_blacklist_del(_queue *blist, const u8 *addr) enter_critical_bh(&blist->lock); head = &blist->queue; list = get_next(head); - while (rtw_end_of_queue_search(head, list) == _FALSE) { + while (head != list) { ent = LIST_CONTAINOR(list, struct blacklist_ent, list); list = get_next(list); @@ -1973,7 +1927,7 @@ int rtw_blacklist_del(_queue *blist, const u8 *addr) break; } - if (rtw_time_after(rtw_get_current_time(), ent->exp_time)) { + if (rtw_time_after(jiffies, ent->exp_time)) { rtw_list_delete(&ent->list); rtw_mfree(ent, sizeof(struct blacklist_ent)); } @@ -1994,12 +1948,12 @@ int rtw_blacklist_search(_queue *blist, const u8 *addr) enter_critical_bh(&blist->lock); head = &blist->queue; list = get_next(head); - while (rtw_end_of_queue_search(head, list) == _FALSE) { + while (head != list) { ent = LIST_CONTAINOR(list, struct blacklist_ent, list); list = get_next(list); if (_rtw_memcmp(ent->addr, addr, ETH_ALEN) == _TRUE) { - if (rtw_time_after(rtw_get_current_time(), ent->exp_time)) { + if (rtw_time_after(jiffies, ent->exp_time)) { rtw_list_delete(&ent->list); rtw_mfree(ent, sizeof(struct blacklist_ent)); } else @@ -2007,7 +1961,7 @@ int rtw_blacklist_search(_queue *blist, const u8 *addr) break; } - if (rtw_time_after(rtw_get_current_time(), ent->exp_time)) { + if (rtw_time_after(jiffies, ent->exp_time)) { rtw_list_delete(&ent->list); rtw_mfree(ent, sizeof(struct blacklist_ent)); } @@ -2033,7 +1987,7 @@ void rtw_blacklist_flush(_queue *blist) head = &tmp; list = get_next(head); - while (rtw_end_of_queue_search(head, list) == _FALSE) { + while (head != list) { ent = LIST_CONTAINOR(list, struct blacklist_ent, list); list = get_next(list); rtw_list_delete(&ent->list); @@ -2050,15 +2004,15 @@ void dump_blacklist(void *sel, _queue *blist, const char *title) head = &blist->queue; list = get_next(head); - if (rtw_end_of_queue_search(head, list) == _FALSE) { + if (head != list) { if (title) RTW_PRINT_SEL(sel, "%s:\n", title); - while (rtw_end_of_queue_search(head, list) == _FALSE) { + while (head != list) { ent = LIST_CONTAINOR(list, struct blacklist_ent, list); list = get_next(list); - if (rtw_time_after(rtw_get_current_time(), ent->exp_time)) + if (rtw_time_after(jiffies, ent->exp_time)) RTW_PRINT_SEL(sel, MAC_FMT" expired\n", MAC_ARG(ent->addr)); else RTW_PRINT_SEL(sel, MAC_FMT" %u\n", MAC_ARG(ent->addr)