Path: blob/master/ALFA-W1F1/RTL8814AU/core/mesh/rtw_mesh.h
1307 views
/******************************************************************************1*2* Copyright(c) 2007 - 2017 Realtek Corporation.3*4* This program is free software; you can redistribute it and/or modify it5* under the terms of version 2 of the GNU General Public License as6* published by the Free Software Foundation.7*8* This program is distributed in the hope that it will be useful, but WITHOUT9* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or10* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for11* more details.12*13*****************************************************************************/14#ifndef __RTW_MESH_H_15#define __RTW_MESH_H_1617#ifndef CONFIG_AP_MODE18#error "CONFIG_RTW_MESH can't be enabled when CONFIG_AP_MODE is not defined\n"19#endif2021#define RTW_MESH_TTL 3122#define RTW_MESH_PERR_MIN_INT 10023#define RTW_MESH_DEFAULT_ELEMENT_TTL 3124#define RTW_MESH_RANN_INTERVAL 500025#define RTW_MESH_PATH_TO_ROOT_TIMEOUT 600026#define RTW_MESH_DIAM_TRAVERSAL_TIME 5027#define RTW_MESH_PATH_TIMEOUT 500028#define RTW_MESH_PREQ_MIN_INT 1029#define RTW_MESH_MAX_PREQ_RETRIES 430#define RTW_MESH_MIN_DISCOVERY_TIMEOUT (2 * RTW_MESH_DIAM_TRAVERSAL_TIME)31#define RTW_MESH_ROOT_CONFIRMATION_INTERVAL 200032#define RTW_MESH_PATH_REFRESH_TIME 100033#define RTW_MESH_ROOT_INTERVAL 50003435#define RTW_MESH_SANE_METRIC_DELTA 10036#define RTW_MESH_MAX_ROOT_ADD_CHK_CNT 23738#define RTW_MESH_PLINK_UNKNOWN 039#define RTW_MESH_PLINK_LISTEN 140#define RTW_MESH_PLINK_OPN_SNT 241#define RTW_MESH_PLINK_OPN_RCVD 342#define RTW_MESH_PLINK_CNF_RCVD 443#define RTW_MESH_PLINK_ESTAB 544#define RTW_MESH_PLINK_HOLDING 645#define RTW_MESH_PLINK_BLOCKED 74647extern const char *_rtw_mesh_plink_str[];48#define rtw_mesh_plink_str(s) ((s <= RTW_MESH_PLINK_BLOCKED) ? _rtw_mesh_plink_str[s] : _rtw_mesh_plink_str[RTW_MESH_PLINK_UNKNOWN])4950#define RTW_MESH_PS_UNKNOWN 051#define RTW_MESH_PS_ACTIVE 152#define RTW_MESH_PS_LSLEEP 253#define RTW_MESH_PS_DSLEEP 35455extern const char *_rtw_mesh_ps_str[];56#define rtw_mesh_ps_str(mps) ((mps <= RTW_MESH_PS_DSLEEP) ? _rtw_mesh_ps_str[mps] : _rtw_mesh_ps_str[RTW_MESH_PS_UNKNOWN])5758#define GET_MESH_CONF_ELE_PATH_SEL_PROTO_ID(_iec) LE_BITS_TO_1BYTE(((u8 *)(_iec)) + 0, 0, 8)59#define GET_MESH_CONF_ELE_PATH_SEL_METRIC_ID(_iec) LE_BITS_TO_1BYTE(((u8 *)(_iec)) + 1, 0, 8)60#define GET_MESH_CONF_ELE_CONGEST_CTRL_MODE_ID(_iec) LE_BITS_TO_1BYTE(((u8 *)(_iec)) + 2, 0, 8)61#define GET_MESH_CONF_ELE_SYNC_METHOD_ID(_iec) LE_BITS_TO_1BYTE(((u8 *)(_iec)) + 3, 0, 8)62#define GET_MESH_CONF_ELE_AUTH_PROTO_ID(_iec) LE_BITS_TO_1BYTE(((u8 *)(_iec)) + 4, 0, 8)6364#define GET_MESH_CONF_ELE_MESH_FORMATION(_iec) LE_BITS_TO_1BYTE(((u8 *)(_iec)) + 5, 0, 8)65#define GET_MESH_CONF_ELE_CTO_MGATE(_iec) LE_BITS_TO_1BYTE(((u8 *)(_iec)) + 5, 0, 1)66#define GET_MESH_CONF_ELE_NUM_OF_PEERINGS(_iec) LE_BITS_TO_1BYTE(((u8 *)(_iec)) + 5, 1, 6)67#define GET_MESH_CONF_ELE_CTO_AS(_iec) LE_BITS_TO_1BYTE(((u8 *)(_iec)) + 5, 7, 1)6869#define GET_MESH_CONF_ELE_MESH_CAP(_iec) LE_BITS_TO_1BYTE(((u8 *)(_iec)) + 6, 0, 8)70#define GET_MESH_CONF_ELE_ACCEPT_PEERINGS(_iec) LE_BITS_TO_1BYTE(((u8 *)(_iec)) + 6, 0, 1)71#define GET_MESH_CONF_ELE_MCCA_SUP(_iec) LE_BITS_TO_1BYTE(((u8 *)(_iec)) + 6, 1, 1)72#define GET_MESH_CONF_ELE_MCCA_EN(_iec) LE_BITS_TO_1BYTE(((u8 *)(_iec)) + 6, 2, 1)73#define GET_MESH_CONF_ELE_FORWARDING(_iec) LE_BITS_TO_1BYTE(((u8 *)(_iec)) + 6, 3, 1)74#define GET_MESH_CONF_ELE_MBCA_EN(_iec) LE_BITS_TO_1BYTE(((u8 *)(_iec)) + 6, 4, 1)75#define GET_MESH_CONF_ELE_TBTT_ADJ(_iec) LE_BITS_TO_1BYTE(((u8 *)(_iec)) + 6, 5, 1)76#define GET_MESH_CONF_ELE_PS_LEVEL(_iec) LE_BITS_TO_1BYTE(((u8 *)(_iec)) + 6, 6, 1)7778#define SET_MESH_CONF_ELE_PATH_SEL_PROTO_ID(_iec, _val) SET_BITS_TO_LE_1BYTE(((u8 *)(_iec)) + 0, 0, 8, _val)79#define SET_MESH_CONF_ELE_PATH_SEL_METRIC_ID(_iec, _val) SET_BITS_TO_LE_1BYTE(((u8 *)(_iec)) + 1, 0, 8, _val)80#define SET_MESH_CONF_ELE_CONGEST_CTRL_MODE_ID(_iec, _val) SET_BITS_TO_LE_1BYTE(((u8 *)(_iec)) + 2, 0, 8, _val)81#define SET_MESH_CONF_ELE_SYNC_METHOD_ID(_iec, _val) SET_BITS_TO_LE_1BYTE(((u8 *)(_iec)) + 3, 0, 8, _val)82#define SET_MESH_CONF_ELE_AUTH_PROTO_ID(_iec, _val) SET_BITS_TO_LE_1BYTE(((u8 *)(_iec)) + 4, 0, 8, _val)8384#define SET_MESH_CONF_ELE_CTO_MGATE(_iec, _val) SET_BITS_TO_LE_1BYTE(((u8 *)(_iec)) + 5, 0, 1, _val)85#define SET_MESH_CONF_ELE_NUM_OF_PEERINGS(_iec, _val) SET_BITS_TO_LE_1BYTE(((u8 *)(_iec)) + 5, 1, 6, _val)86#define SET_MESH_CONF_ELE_CTO_AS(_iec, _val) SET_BITS_TO_LE_1BYTE(((u8 *)(_iec)) + 5, 7, 1, _val)8788#define SET_MESH_CONF_ELE_ACCEPT_PEERINGS(_iec, _val) SET_BITS_TO_LE_1BYTE(((u8 *)(_iec)) + 6, 0, 1, _val)89#define SET_MESH_CONF_ELE_MCCA_SUP(_iec, _val) SET_BITS_TO_LE_1BYTE(((u8 *)(_iec)) + 6, 1, 1, _val)90#define SET_MESH_CONF_ELE_MCCA_EN(_iec, _val) SET_BITS_TO_LE_1BYTE(((u8 *)(_iec)) + 6, 2, 1, _val)91#define SET_MESH_CONF_ELE_FORWARDING(_iec, _val) SET_BITS_TO_LE_1BYTE(((u8 *)(_iec)) + 6, 3, 1, _val)92#define SET_MESH_CONF_ELE_MBCA_EN(_iec, _val) SET_BITS_TO_LE_1BYTE(((u8 *)(_iec)) + 6, 4, 1, _val)93#define SET_MESH_CONF_ELE_TBTT_ADJ(_iec, _val) SET_BITS_TO_LE_1BYTE(((u8 *)(_iec)) + 6, 5, 1, _val)94#define SET_MESH_CONF_ELE_PS_LEVEL(_iec, _val) SET_BITS_TO_LE_1BYTE(((u8 *)(_iec)) + 6, 6, 1, _val)9596/* Mesh flags */97#define MESH_FLAGS_AE 0x3 /* mask */98#define MESH_FLAGS_AE_A4 0x199#define MESH_FLAGS_AE_A5_A6 0x2100101/* Max number of paths */102#define RTW_MESH_MAX_PATHS 1024103104#define RTW_PREQ_Q_F_START 0x1105#define RTW_PREQ_Q_F_REFRESH 0x2106#define RTW_PREQ_Q_F_CHK 0x4107#define RTW_PREQ_Q_F_PEER_AKA 0x8108#define RTW_PREQ_Q_F_BCAST_PREQ 0x10 /* force path_dicover using broadcast */109struct rtw_mesh_preq_queue {110_list list;111u8 dst[ETH_ALEN];112u8 flags;113};114115extern const u8 ae_to_mesh_ctrl_len[];116117enum mesh_frame_type {118MESH_UCAST_DATA = 0x0,119MESH_BMCAST_DATA = 0x1,120MESH_UCAST_PX_DATA = 0x2,121MESH_BMCAST_PX_DATA = 0x3,122MESH_MHOP_UCAST_ACT = 0x4,123MESH_MHOP_BMCAST_ACT = 0x5,124};125126enum mpath_sel_frame_type {127MPATH_PREQ = 0,128MPATH_PREP,129MPATH_PERR,130MPATH_RANN131};132133/**134* enum rtw_mesh_deferred_task_flags - mesh deferred tasks135*136*137*138* @RTW_MESH_WORK_HOUSEKEEPING: run the periodic mesh housekeeping tasks139* @RTW_MESH_WORK_ROOT: the mesh root station needs to send a frame140* @RTW_MESH_WORK_DRIFT_ADJUST: time to compensate for clock drift relative to other141* mesh nodes142* @RTW_MESH_WORK_MBSS_CHANGED: rebuild beacon and notify driver of BSS changes143*/144enum rtw_mesh_deferred_task_flags {145RTW_MESH_WORK_HOUSEKEEPING,146RTW_MESH_WORK_ROOT,147RTW_MESH_WORK_DRIFT_ADJUST,148RTW_MESH_WORK_MBSS_CHANGED,149};150151#define RTW_MESH_MAX_PEER_CANDIDATES 15 /* aid consideration */152#define RTW_MESH_MAX_PEER_LINKS 8153#define RTW_MESH_PEER_LINK_TIMEOUT 20154155#define RTW_MESH_PEER_CONF_DISABLED 0 /* special time value means no confirmation ongoing */156#if CONFIG_RTW_MESH_PEER_BLACKLIST157#define IS_PEER_CONF_DISABLED(plink) ((plink)->peer_conf_end_time == RTW_MESH_PEER_CONF_DISABLED)158#define IS_PEER_CONF_TIMEOUT(plink)(!IS_PEER_CONF_DISABLED(plink) && rtw_time_after(rtw_get_current_time(), (plink)->peer_conf_end_time))159#define SET_PEER_CONF_DISABLED(plink) (plink)->peer_conf_end_time = RTW_MESH_PEER_CONF_DISABLED160#define SET_PEER_CONF_END_TIME(plink, timeout_ms) \161do { \162(plink)->peer_conf_end_time = rtw_get_current_time() + rtw_ms_to_systime(timeout_ms); \163if ((plink)->peer_conf_end_time == RTW_MESH_PEER_CONF_DISABLED) \164(plink)->peer_conf_end_time++; \165} while (0)166#else167#define IS_PEER_CONF_DISABLED(plink) 1168#define IS_PEER_CONF_TIMEOUT(plink) 0169#define SET_PEER_CONF_DISABLED(plink) do {} while (0)170#define SET_PEER_CONF_END_TIME(plink, timeout_ms) do {} while (0)171#endif /* CONFIG_RTW_MESH_PEER_BLACKLIST */172173#define RTW_MESH_CTO_MGATE_CONF_DISABLED 0 /* special time value means no confirmation ongoing */174#if CONFIG_RTW_MESH_CTO_MGATE_BLACKLIST175#define IS_CTO_MGATE_CONF_DISABLED(plink) ((plink)->cto_mgate_conf_end_time == RTW_MESH_CTO_MGATE_CONF_DISABLED)176#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))177#define SET_CTO_MGATE_CONF_DISABLED(plink) (plink)->cto_mgate_conf_end_time = RTW_MESH_CTO_MGATE_CONF_DISABLED178#define SET_CTO_MGATE_CONF_END_TIME(plink, timeout_ms) \179do { \180(plink)->cto_mgate_conf_end_time = rtw_get_current_time() + rtw_ms_to_systime(timeout_ms); \181if ((plink)->cto_mgate_conf_end_time == RTW_MESH_CTO_MGATE_CONF_DISABLED) \182(plink)->cto_mgate_conf_end_time++; \183} while (0)184#else185#define IS_CTO_MGATE_CONF_DISABLED(plink) 1186#define IS_CTO_MGATE_CONF_TIMEOUT(plink) 0187#define SET_CTO_MGATE_CONF_DISABLED(plink) do {} while (0)188#define SET_CTO_MGATE_CONF_END_TIME(plink, timeout_ms) do {} while (0)189#endif /* CONFIG_RTW_MESH_CTO_MGATE_BLACKLIST */190191struct mesh_plink_ent {192u8 valid;193u8 addr[ETH_ALEN];194u8 plink_state;195196#ifdef CONFIG_RTW_MESH_AEK197u8 aek_valid;198u8 aek[32];199#endif200201u16 llid;202u16 plid;203#ifndef CONFIG_RTW_MESH_DRIVER_AID204u16 aid; /* aid assigned from upper layer */205#endif206u16 peer_aid; /* aid assigned from peer */207208u8 chosen_pmk[16];209210#ifdef CONFIG_RTW_MESH_AEK211u8 sel_pcs[4];212u8 l_nonce[32];213u8 p_nonce[32];214#endif215216#ifdef CONFIG_RTW_MESH_DRIVER_AID217u8 *tx_conf_ies;218u16 tx_conf_ies_len;219#endif220u8 *rx_conf_ies;221u16 rx_conf_ies_len;222223struct wlan_network *scanned;224225#if CONFIG_RTW_MESH_PEER_BLACKLIST226systime peer_conf_end_time;227#endif228#if CONFIG_RTW_MESH_CTO_MGATE_BLACKLIST229systime cto_mgate_conf_end_time;230#endif231};232233#ifdef CONFIG_RTW_MESH_AEK234#define MESH_PLINK_AEK_VALID(ent) ent->aek_valid235#else236#define MESH_PLINK_AEK_VALID(ent) 0237#endif238239struct mesh_plink_pool {240_lock lock;241u8 num; /* current ent being used */242struct mesh_plink_ent ent[RTW_MESH_MAX_PEER_CANDIDATES];243244#if CONFIG_RTW_MESH_ACNODE_PREVENT245u8 acnode_rsvd;246#endif247248#if CONFIG_RTW_MESH_PEER_BLACKLIST249_queue peer_blacklist;250#endif251#if CONFIG_RTW_MESH_CTO_MGATE_BLACKLIST252_queue cto_mgate_blacklist;253#endif254};255256struct mesh_peer_sel_policy {257u32 scanr_exp_ms;258259#if CONFIG_RTW_MESH_ACNODE_PREVENT260u8 acnode_prevent;261u32 acnode_conf_timeout_ms;262u32 acnode_notify_timeout_ms;263#endif264265#if CONFIG_RTW_MESH_OFFCH_CAND266u8 offch_cand;267u32 offch_find_int_ms; /* 0 means no offch find triggerred by driver self*/268#endif269270#if CONFIG_RTW_MESH_PEER_BLACKLIST271u32 peer_conf_timeout_ms;272u32 peer_blacklist_timeout_ms;273#endif274275#if CONFIG_RTW_MESH_CTO_MGATE_BLACKLIST276u8 cto_mgate_require;277u32 cto_mgate_conf_timeout_ms;278u32 cto_mgate_blacklist_timeout_ms;279#endif280};281282/* b2u flags */283#define RTW_MESH_B2U_ALL BIT0284#define RTW_MESH_B2U_GA_UCAST BIT1 /* Group addressed unicast frame, forward only */285#define RTW_MESH_B2U_BCAST BIT2286#define RTW_MESH_B2U_IP_MCAST BIT3287288#define rtw_msrc_b2u_policy_chk(flags, mda) ( \289(flags & RTW_MESH_B2U_ALL) \290|| ((flags & RTW_MESH_B2U_BCAST) && is_broadcast_mac_addr(mda)) \291|| ((flags & RTW_MESH_B2U_IP_MCAST) && (IP_MCAST_MAC(mda) || ICMPV6_MCAST_MAC(mda))) \292)293294#define rtw_mfwd_b2u_policy_chk(flags, mda, ucst) ( \295(flags & RTW_MESH_B2U_ALL) \296|| ((flags & RTW_MESH_B2U_GA_UCAST) && ucst) \297|| ((flags & RTW_MESH_B2U_BCAST) && is_broadcast_mac_addr(mda)) \298|| ((flags & RTW_MESH_B2U_IP_MCAST) && (IP_MCAST_MAC(mda) || ICMPV6_MCAST_MAC(mda))) \299)300301/**302* @sane_metric_delta: Controlling if trigger additional path check mechanism303* @max_root_add_chk_cnt: The retry cnt to send additional root confirmation304* PREQ through old(last) path305*/306struct rtw_mesh_cfg {307u8 max_peer_links; /* peering limit */308u32 plink_timeout; /* seconds */309310u8 dot11MeshTTL;311u8 element_ttl;312u32 path_refresh_time;313u16 dot11MeshHWMPpreqMinInterval;314u16 dot11MeshHWMPnetDiameterTraversalTime;315u32 dot11MeshHWMPactivePathTimeout;316u8 dot11MeshHWMPmaxPREQretries;317u16 min_discovery_timeout;318u16 dot11MeshHWMPconfirmationInterval;319u16 dot11MeshHWMPperrMinInterval;320u8 dot11MeshHWMPRootMode;321BOOLEAN dot11MeshForwarding;322s32 rssi_threshold; /* in dBm, 0: no specified */323u16 dot11MeshHWMPRannInterval;324BOOLEAN dot11MeshGateAnnouncementProtocol;325u32 dot11MeshHWMPactivePathToRootTimeout;326u16 dot11MeshHWMProotInterval;327u8 path_gate_timeout_factor;328#ifdef CONFIG_RTW_MESH_ADD_ROOT_CHK329u16 sane_metric_delta;330u8 max_root_add_chk_cnt;331#endif332333struct mesh_peer_sel_policy peer_sel_policy;334335#if CONFIG_RTW_MESH_DATA_BMC_TO_UC336u8 b2u_flags_msrc;337u8 b2u_flags_mfwd;338#endif339};340341struct rtw_mesh_stats {342u32 fwded_mcast; /* Mesh forwarded multicast frames */343u32 fwded_unicast; /* Mesh forwarded unicast frames */344u32 fwded_frames; /* Mesh total forwarded frames */345u32 dropped_frames_ttl; /* Not transmitted since mesh_ttl == 0*/346u32 dropped_frames_no_route; /* Not transmitted, no route found */347u32 dropped_frames_congestion;/* Not forwarded due to congestion */348u32 dropped_frames_duplicate;349350u32 mrc_del_qlen; /* MRC entry deleted cause by queue length limit */351};352353struct rtw_mrc;354355struct rtw_mesh_info {356u8 mesh_id[NDIS_802_11_LENGTH_SSID];357size_t mesh_id_len;358/* Active Path Selection Protocol Identifier */359u8 mesh_pp_id;360/* Active Path Selection Metric Identifier */361u8 mesh_pm_id;362/* Congestion Control Mode Identifier */363u8 mesh_cc_id;364/* Synchronization Protocol Identifier */365u8 mesh_sp_id;366/* Authentication Protocol Identifier */367u8 mesh_auth_id;368369struct mesh_plink_pool plink_ctl;370371u32 mesh_seqnum;372/* MSTA's own hwmp sequence number */373u32 sn;374systime last_preq;375systime last_sn_update;376systime next_perr;377/* Last used Path Discovery ID */378u32 preq_id;379380ATOMIC_T mpaths;381struct rtw_mesh_table *mesh_paths;382struct rtw_mesh_table *mpp_paths;383int mesh_paths_generation;384int mpp_paths_generation;385386int num_gates;387struct rtw_mesh_path *max_addr_gate;388bool max_addr_gate_is_larger_than_self;389390struct rtw_mesh_stats mshstats;391392_queue mpath_tx_queue;393u32 mpath_tx_queue_len;394_tasklet mpath_tx_tasklet;395396struct rtw_mrc *mrc;397398_lock mesh_preq_queue_lock;399struct rtw_mesh_preq_queue preq_queue;400int preq_queue_len;401};402403extern const char *_action_self_protected_str[];404#define action_self_protected_str(action) ((action < RTW_ACT_SELF_PROTECTED_NUM) ? _action_self_protected_str[action] : _action_self_protected_str[0])405406u8 *rtw_set_ie_mesh_id(u8 *buf, u32 *buf_len, const char *mesh_id, u8 id_len);407u8 *rtw_set_ie_mesh_config(u8 *buf, u32 *buf_len408, u8 path_sel_proto, u8 path_sel_metric, u8 congest_ctl_mode, u8 sync_method, u8 auth_proto409, u8 num_of_peerings, bool cto_mgate, bool cto_as410, bool accept_peerings, bool mcca_sup, bool mcca_en, bool forwarding411, bool mbca_en, bool tbtt_adj, bool ps_level);412413int rtw_bss_is_same_mbss(WLAN_BSSID_EX *a, WLAN_BSSID_EX *b);414int rtw_bss_is_candidate_mesh_peer(WLAN_BSSID_EX *self, WLAN_BSSID_EX *target, u8 ch, u8 add_peer);415416void rtw_chk_candidate_peer_notify(_adapter *adapter, struct wlan_network *scanned);417418void rtw_mesh_peer_status_chk(_adapter *adapter);419420#if CONFIG_RTW_MESH_ACNODE_PREVENT421void rtw_mesh_update_scanned_acnode_status(_adapter *adapter, struct wlan_network *scanned);422bool rtw_mesh_scanned_is_acnode_confirmed(_adapter *adapter, struct wlan_network *scanned);423bool rtw_mesh_acnode_prevent_allow_sacrifice(_adapter *adapter);424struct sta_info *rtw_mesh_acnode_prevent_pick_sacrifice(_adapter *adapter);425void dump_mesh_acnode_prevent_settings(void *sel, _adapter *adapter);426#endif427428#if CONFIG_RTW_MESH_OFFCH_CAND429u8 rtw_mesh_offch_candidate_accepted(_adapter *adapter);430u8 rtw_mesh_select_operating_ch(_adapter *adapter);431void dump_mesh_offch_cand_settings(void *sel, _adapter *adapter);432#endif433434#if CONFIG_RTW_MESH_PEER_BLACKLIST435int rtw_mesh_peer_blacklist_add(_adapter *adapter, const u8 *addr);436int rtw_mesh_peer_blacklist_del(_adapter *adapter, const u8 *addr);437int rtw_mesh_peer_blacklist_search(_adapter *adapter, const u8 *addr);438void rtw_mesh_peer_blacklist_flush(_adapter *adapter);439void dump_mesh_peer_blacklist(void *sel, _adapter *adapter);440void dump_mesh_peer_blacklist_settings(void *sel, _adapter *adapter);441#endif442#if CONFIG_RTW_MESH_CTO_MGATE_BLACKLIST443u8 rtw_mesh_cto_mgate_required(_adapter *adapter);444u8 rtw_mesh_cto_mgate_network_filter(_adapter *adapter, struct wlan_network *scanned);445int rtw_mesh_cto_mgate_blacklist_add(_adapter *adapter, const u8 *addr);446int rtw_mesh_cto_mgate_blacklist_del(_adapter *adapter, const u8 *addr);447int rtw_mesh_cto_mgate_blacklist_search(_adapter *adapter, const u8 *addr);448void rtw_mesh_cto_mgate_blacklist_flush(_adapter *adapter);449void dump_mesh_cto_mgate_blacklist(void *sel, _adapter *adapter);450void dump_mesh_cto_mgate_blacklist_settings(void *sel, _adapter *adapter);451#endif452void dump_mesh_peer_sel_policy(void *sel, _adapter *adapter);453void dump_mesh_networks(void *sel, _adapter *adapter);454455void rtw_mesh_adjust_chbw(u8 req_ch, u8 *req_bw, u8 *req_offset);456457void rtw_mesh_sae_check_frames(_adapter *adapter, const u8 *buf, u32 len, u8 tx, u16 alg, u16 seq, u16 status);458int rtw_mesh_check_frames_tx(_adapter *adapter, const u8 **buf, size_t *len);459int rtw_mesh_check_frames_rx(_adapter *adapter, const u8 *buf, size_t len);460461int rtw_mesh_on_auth(_adapter *adapter, union recv_frame *rframe);462unsigned int on_action_self_protected(_adapter *adapter, union recv_frame *rframe);463464bool rtw_mesh_update_bss_peering_status(_adapter *adapter, WLAN_BSSID_EX *bss);465bool rtw_mesh_update_bss_formation_info(_adapter *adapter, WLAN_BSSID_EX *bss);466bool rtw_mesh_update_bss_forwarding_state(_adapter *adapter, WLAN_BSSID_EX *bss);467468struct mesh_plink_ent *_rtw_mesh_plink_get(_adapter *adapter, const u8 *hwaddr);469struct mesh_plink_ent *rtw_mesh_plink_get(_adapter *adapter, const u8 *hwaddr);470struct mesh_plink_ent *rtw_mesh_plink_get_no_estab_by_idx(_adapter *adapter, u8 idx);471int _rtw_mesh_plink_add(_adapter *adapter, const u8 *hwaddr);472int rtw_mesh_plink_add(_adapter *adapter, const u8 *hwaddr);473int rtw_mesh_plink_set_state(_adapter *adapter, const u8 *hwaddr, u8 state);474#ifdef CONFIG_RTW_MESH_AEK475int rtw_mesh_plink_set_aek(_adapter *adapter, const u8 *hwaddr, const u8 *aek);476#endif477#if CONFIG_RTW_MESH_PEER_BLACKLIST478int rtw_mesh_plink_set_peer_conf_timeout(_adapter *adapter, const u8 *hwaddr);479#endif480void _rtw_mesh_plink_del_ent(_adapter *adapter, struct mesh_plink_ent *ent);481int rtw_mesh_plink_del(_adapter *adapter, const u8 *hwaddr);482void rtw_mesh_plink_ctl_init(_adapter *adapter);483void rtw_mesh_plink_ctl_deinit(_adapter *adapter);484void dump_mesh_plink_ctl(void *sel, _adapter *adapter);485486int rtw_mesh_peer_establish(_adapter *adapter, struct mesh_plink_ent *plink, struct sta_info *sta);487void _rtw_mesh_expire_peer_ent(_adapter *adapter, struct mesh_plink_ent *plink);488void rtw_mesh_expire_peer(_adapter *adapter, const u8 *peer_addr);489u8 rtw_mesh_ps_annc(_adapter *adapter, u8 ps);490491unsigned int on_action_mesh(_adapter *adapter, union recv_frame *rframe);492493void rtw_mesh_cfg_init(_adapter *adapter);494void rtw_mesh_cfg_init_max_peer_links(_adapter *adapter, u8 stack_conf);495void rtw_mesh_cfg_init_plink_timeout(_adapter *adapter, u32 stack_conf);496void rtw_mesh_init_mesh_info(_adapter *adapter);497void rtw_mesh_deinit_mesh_info(_adapter *adapter);498499#if CONFIG_RTW_MESH_DATA_BMC_TO_UC500void dump_mesh_b2u_flags(void *sel, _adapter *adapter);501#endif502503int rtw_mesh_addr_resolve(_adapter *adapter, struct xmit_frame *xframe, _pkt *pkt, _list *b2u_list);504505s8 rtw_mesh_tx_set_whdr_mctrl_len(u8 mesh_frame_mode, struct pkt_attrib *attrib);506void rtw_mesh_tx_build_mctrl(_adapter *adapter, struct pkt_attrib *attrib, u8 *buf);507u8 rtw_mesh_tx_build_whdr(_adapter *adapter, struct pkt_attrib *attrib508, u16 *fctrl, struct rtw_ieee80211_hdr *whdr);509510int rtw_mesh_rx_data_validate_hdr(_adapter *adapter, union recv_frame *rframe, struct sta_info **sta);511int rtw_mesh_rx_data_validate_mctrl(_adapter *adapter, union recv_frame *rframe512, const struct rtw_ieee80211s_hdr *mctrl, const u8 *mda, const u8 *msa513, u8 *mctrl_len, const u8 **da, const u8 **sa);514int rtw_mesh_rx_validate_mctrl_non_amsdu(_adapter *adapter, union recv_frame *rframe);515516int rtw_mesh_rx_msdu_act_check(union recv_frame *rframe517, const u8 *mda, const u8 *msa518, const u8 *da, const u8 *sa519, struct rtw_ieee80211s_hdr *mctrl520, struct xmit_frame **fwd_frame, _list *b2u_list);521522void dump_mesh_stats(void *sel, _adapter *adapter);523524#if defined(PLATFORM_LINUX) && (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 32))525#define rtw_lockdep_assert_held(l) lockdep_assert_held(l)526#define rtw_lockdep_is_held(l) lockdep_is_held(l)527#else528#error "TBD\n"529#endif530531#include "rtw_mesh_pathtbl.h"532#include "rtw_mesh_hwmp.h"533#endif /* __RTW_MESH_H_ */534535536537