Lines Matching refs:sdata
58 static bool rssi_threshold_check(struct ieee80211_sub_if_data *sdata, in rssi_threshold_check() argument
61 s32 rssi_threshold = sdata->u.mesh.mshcfg.rssi_threshold; in rssi_threshold_check()
93 static u64 mesh_set_short_slot_time(struct ieee80211_sub_if_data *sdata) in mesh_set_short_slot_time() argument
95 struct ieee80211_local *local = sdata->local; in mesh_set_short_slot_time()
103 sband = ieee80211_get_sband(sdata); in mesh_set_short_slot_time()
124 if (sdata != sta->sdata || in mesh_set_short_slot_time()
137 if (sdata->vif.bss_conf.use_short_slot != short_slot) { in mesh_set_short_slot_time()
138 sdata->vif.bss_conf.use_short_slot = short_slot; in mesh_set_short_slot_time()
140 mpl_dbg(sdata, "mesh_plink %pM: ERP short slot time %d\n", in mesh_set_short_slot_time()
141 sdata->vif.addr, short_slot); in mesh_set_short_slot_time()
157 static u64 mesh_set_ht_prot_mode(struct ieee80211_sub_if_data *sdata) in mesh_set_ht_prot_mode() argument
159 struct ieee80211_local *local = sdata->local; in mesh_set_ht_prot_mode()
164 switch (sdata->vif.bss_conf.chandef.width) { in mesh_set_ht_prot_mode()
175 if (sdata != sta->sdata || in mesh_set_ht_prot_mode()
183 mpl_dbg(sdata, "nonHT sta (%pM) is present\n", in mesh_set_ht_prot_mode()
189 mpl_dbg(sdata, "HT20 sta (%pM) is present\n", sta->sta.addr); in mesh_set_ht_prot_mode()
197 sdata->vif.bss_conf.chandef.width > NL80211_CHAN_WIDTH_20) in mesh_set_ht_prot_mode()
202 if (sdata->vif.bss_conf.ht_operation_mode == ht_opmode) in mesh_set_ht_prot_mode()
205 sdata->vif.bss_conf.ht_operation_mode = ht_opmode; in mesh_set_ht_prot_mode()
206 sdata->u.mesh.mshcfg.ht_opmode = ht_opmode; in mesh_set_ht_prot_mode()
207 mpl_dbg(sdata, "selected new HT protection mode %d\n", ht_opmode); in mesh_set_ht_prot_mode()
211 static int mesh_plink_frame_tx(struct ieee80211_sub_if_data *sdata, in mesh_plink_frame_tx() argument
216 struct ieee80211_local *local = sdata->local; in mesh_plink_frame_tx()
227 ie_len_he_cap = ieee80211_ie_len_he_cap(sdata, in mesh_plink_frame_tx()
229 ie_len_eht_cap = ieee80211_ie_len_eht_cap(sdata, in mesh_plink_frame_tx()
237 2 + sdata->u.mesh.mesh_id_len + in mesh_plink_frame_tx()
251 sdata->u.mesh.ie_len); in mesh_plink_frame_tx()
260 memcpy(mgmt->sa, sdata->vif.addr, ETH_ALEN); in mesh_plink_frame_tx()
261 memcpy(mgmt->bssid, sdata->vif.addr, ETH_ALEN); in mesh_plink_frame_tx()
269 sband = ieee80211_get_sband(sdata); in mesh_plink_frame_tx()
283 if (ieee80211_add_srates_ie(sdata, skb, true, band) || in mesh_plink_frame_tx()
284 ieee80211_add_ext_srates_ie(sdata, skb, true, band) || in mesh_plink_frame_tx()
285 mesh_add_rsn_ie(sdata, skb) || in mesh_plink_frame_tx()
286 mesh_add_meshid_ie(sdata, skb) || in mesh_plink_frame_tx()
287 mesh_add_meshconf_ie(sdata, skb)) in mesh_plink_frame_tx()
291 if (mesh_add_meshid_ie(sdata, skb)) in mesh_plink_frame_tx()
335 if (mesh_add_ht_cap_ie(sdata, skb) || in mesh_plink_frame_tx()
336 mesh_add_ht_oper_ie(sdata, skb) || in mesh_plink_frame_tx()
337 mesh_add_vht_cap_ie(sdata, skb) || in mesh_plink_frame_tx()
338 mesh_add_vht_oper_ie(sdata, skb) || in mesh_plink_frame_tx()
339 mesh_add_he_cap_ie(sdata, skb, ie_len_he_cap) || in mesh_plink_frame_tx()
340 mesh_add_he_oper_ie(sdata, skb) || in mesh_plink_frame_tx()
341 mesh_add_he_6ghz_cap_ie(sdata, skb) || in mesh_plink_frame_tx()
342 mesh_add_eht_cap_ie(sdata, skb, ie_len_eht_cap) || in mesh_plink_frame_tx()
343 mesh_add_eht_oper_ie(sdata, skb)) in mesh_plink_frame_tx()
347 if (mesh_add_vendor_ies(sdata, skb)) in mesh_plink_frame_tx()
350 ieee80211_tx_skb(sdata, skb); in mesh_plink_frame_tx()
371 struct ieee80211_sub_if_data *sdata = sta->sdata; in __mesh_plink_deactivate() local
377 changed = mesh_plink_dec_estab_count(sdata); in __mesh_plink_deactivate()
396 struct ieee80211_sub_if_data *sdata = sta->sdata; in mesh_plink_deactivate() local
402 if (!sdata->u.mesh.user_mpm) { in mesh_plink_deactivate()
404 mesh_plink_frame_tx(sdata, sta, WLAN_SP_MESH_PEERING_CLOSE, in mesh_plink_deactivate()
409 if (!sdata->u.mesh.user_mpm) in mesh_plink_deactivate()
419 static void mesh_sta_info_init(struct ieee80211_sub_if_data *sdata, in mesh_sta_info_init() argument
423 struct ieee80211_local *local = sdata->local; in mesh_sta_info_init()
428 sband = ieee80211_get_sband(sdata); in mesh_sta_info_init()
432 rates = ieee80211_sta_get_rates(sdata, elems, sband->band, in mesh_sta_info_init()
448 if (ieee80211_ht_cap_ie_to_sta_ht_cap(sdata, sband, in mesh_sta_info_init()
453 ieee80211_vht_cap_ie_to_sta_vht_cap(sdata, sband, in mesh_sta_info_init()
457 ieee80211_he_cap_ie_to_sta_he_cap(sdata, sband, elems->he_cap, in mesh_sta_info_init()
462 ieee80211_eht_cap_ie_to_sta_eht_cap(sdata, sband, elems->he_cap, in mesh_sta_info_init()
487 static int mesh_allocate_aid(struct ieee80211_sub_if_data *sdata) in mesh_allocate_aid() argument
501 list_for_each_entry_rcu(sta, &sdata->local->sta_list, list) in mesh_allocate_aid()
515 __mesh_sta_info_alloc(struct ieee80211_sub_if_data *sdata, u8 *hw_addr) in __mesh_sta_info_alloc() argument
520 if (sdata->local->num_sta >= MESH_MAX_PLINKS) in __mesh_sta_info_alloc()
523 aid = mesh_allocate_aid(sdata); in __mesh_sta_info_alloc()
527 sta = sta_info_alloc(sdata, hw_addr, GFP_KERNEL); in __mesh_sta_info_alloc()
543 mesh_sta_info_alloc(struct ieee80211_sub_if_data *sdata, u8 *addr, in mesh_sta_info_alloc() argument
550 if (sdata->u.mesh.user_mpm || in mesh_sta_info_alloc()
551 sdata->u.mesh.security & IEEE80211_MESH_SEC_AUTHED) { in mesh_sta_info_alloc()
553 mesh_plink_availables(sdata)) { in mesh_sta_info_alloc()
556 if (ieee80211_hw_check(&sdata->local->hw, SIGNAL_DBM)) in mesh_sta_info_alloc()
559 cfg80211_notify_new_peer_candidate(sdata->dev, addr, in mesh_sta_info_alloc()
565 sta = __mesh_sta_info_alloc(sdata, addr); in mesh_sta_info_alloc()
582 mesh_sta_info_get(struct ieee80211_sub_if_data *sdata, in mesh_sta_info_get() argument
589 sta = sta_info_get(sdata, addr); in mesh_sta_info_get()
591 mesh_sta_info_init(sdata, sta, elems); in mesh_sta_info_get()
595 sta = mesh_sta_info_alloc(sdata, addr, elems, rx_status); in mesh_sta_info_get()
601 mesh_sta_info_init(sdata, sta, elems); in mesh_sta_info_get()
620 void mesh_neighbour_update(struct ieee80211_sub_if_data *sdata, in mesh_neighbour_update() argument
628 sta = mesh_sta_info_get(sdata, hw_addr, elems, rx_status); in mesh_neighbour_update()
637 sdata->u.mesh.accepting_plinks && in mesh_neighbour_update()
638 sdata->u.mesh.mshcfg.auto_open_plinks && in mesh_neighbour_update()
639 rssi_threshold_check(sdata, sta)) in mesh_neighbour_update()
645 ieee80211_mbss_info_change_notify(sdata, changed); in mesh_neighbour_update()
653 struct ieee80211_sub_if_data *sdata; in mesh_plink_timer() local
664 if (sta->sdata->local->quiescing) in mesh_plink_timer()
675 mpl_dbg(sta->sdata, in mesh_plink_timer()
685 mpl_dbg(sta->sdata, in mesh_plink_timer()
692 mpl_dbg(sta->sdata, in mesh_plink_timer()
695 sdata = sta->sdata; in mesh_plink_timer()
696 mshcfg = &sdata->u.mesh.mshcfg; in mesh_plink_timer()
704 mpl_dbg(sta->sdata, in mesh_plink_timer()
736 mesh_plink_frame_tx(sdata, sta, action, sta->sta.addr, in mesh_plink_timer()
746 static bool llid_in_use(struct ieee80211_sub_if_data *sdata, in llid_in_use() argument
749 struct ieee80211_local *local = sdata->local; in llid_in_use()
755 if (sdata != sta->sdata) in llid_in_use()
768 static u16 mesh_get_new_llid(struct ieee80211_sub_if_data *sdata) in mesh_get_new_llid() argument
774 } while (llid_in_use(sdata, llid)); in mesh_get_new_llid()
781 struct ieee80211_sub_if_data *sdata = sta->sdata; in mesh_plink_open() local
788 sta->mesh->llid = mesh_get_new_llid(sdata); in mesh_plink_open()
795 mesh_plink_timer_set(sta, sdata->u.mesh.mshcfg.dot11MeshRetryTimeout); in mesh_plink_open()
797 mpl_dbg(sdata, in mesh_plink_open()
802 changed = ieee80211_mps_local_status_update(sdata); in mesh_plink_open()
804 mesh_plink_frame_tx(sdata, sta, WLAN_SP_MESH_PEERING_OPEN, in mesh_plink_open()
822 static void mesh_plink_close(struct ieee80211_sub_if_data *sdata, in mesh_plink_close() argument
826 struct mesh_config *mshcfg = &sdata->u.mesh.mshcfg; in mesh_plink_close()
835 static u64 mesh_plink_establish(struct ieee80211_sub_if_data *sdata, in mesh_plink_establish() argument
838 struct mesh_config *mshcfg = &sdata->u.mesh.mshcfg; in mesh_plink_establish()
843 changed |= mesh_plink_inc_estab_count(sdata); in mesh_plink_establish()
844 changed |= mesh_set_ht_prot_mode(sdata); in mesh_plink_establish()
845 changed |= mesh_set_short_slot_time(sdata); in mesh_plink_establish()
846 mpl_dbg(sdata, "Mesh plink with %pM ESTABLISHED\n", sta->sta.addr); in mesh_plink_establish()
861 static u64 mesh_plink_fsm(struct ieee80211_sub_if_data *sdata, in mesh_plink_fsm() argument
864 struct mesh_config *mshcfg = &sdata->u.mesh.mshcfg; in mesh_plink_fsm()
869 mpl_dbg(sdata, "peer %pM in state %s got event %s\n", sta->sta.addr, in mesh_plink_fsm()
881 sta->mesh->llid = mesh_get_new_llid(sdata); in mesh_plink_fsm()
886 changed |= ieee80211_mps_local_status_update(sdata); in mesh_plink_fsm()
898 mesh_plink_close(sdata, sta, event); in mesh_plink_fsm()
919 mesh_plink_close(sdata, sta, event); in mesh_plink_fsm()
926 changed |= mesh_plink_establish(sdata, sta); in mesh_plink_fsm()
937 mesh_plink_close(sdata, sta, event); in mesh_plink_fsm()
941 changed |= mesh_plink_establish(sdata, sta); in mesh_plink_fsm()
952 changed |= mesh_set_ht_prot_mode(sdata); in mesh_plink_fsm()
953 changed |= mesh_set_short_slot_time(sdata); in mesh_plink_fsm()
954 mesh_plink_close(sdata, sta, event); in mesh_plink_fsm()
991 mesh_plink_frame_tx(sdata, sta, action, sta->sta.addr, in mesh_plink_fsm()
997 mesh_plink_frame_tx(sdata, sta, in mesh_plink_fsm()
1021 mesh_plink_get_event(struct ieee80211_sub_if_data *sdata, in mesh_plink_get_event() argument
1032 mesh_matches_local(sdata, elems)); in mesh_plink_get_event()
1042 mpl_dbg(sdata, "Mesh plink: cls or cnf from unknown peer\n"); in mesh_plink_get_event()
1046 if (!mesh_plink_free_count(sdata)) { in mesh_plink_get_event()
1047 mpl_dbg(sdata, "Mesh plink error: no more free plinks\n"); in mesh_plink_get_event()
1056 mpl_dbg(sdata, "Mesh plink: Action frame from non-authed peer\n"); in mesh_plink_get_event()
1067 if (!mesh_plink_free_count(sdata) || in mesh_plink_get_event()
1076 if (!mesh_plink_free_count(sdata) || in mesh_plink_get_event()
1103 mpl_dbg(sdata, "Mesh plink: unknown frame subtype\n"); in mesh_plink_get_event()
1112 mesh_process_plink_frame(struct ieee80211_sub_if_data *sdata, in mesh_process_plink_frame() argument
1126 mpl_dbg(sdata, in mesh_process_plink_frame()
1132 sdata->u.mesh.security == IEEE80211_MESH_SEC_NONE) { in mesh_process_plink_frame()
1133 mpl_dbg(sdata, in mesh_process_plink_frame()
1143 mpl_dbg(sdata, in mesh_process_plink_frame()
1151 mpl_dbg(sdata, "Mesh plink: missing necessary ie\n"); in mesh_process_plink_frame()
1165 sta = sta_info_get(sdata, mgmt->sa); in mesh_process_plink_frame()
1168 !rssi_threshold_check(sdata, sta)) { in mesh_process_plink_frame()
1169 mpl_dbg(sdata, "Mesh plink: %pM does not meet rssi threshold\n", in mesh_process_plink_frame()
1175 event = mesh_plink_get_event(sdata, sta, elems, ftype, llid, plid); in mesh_process_plink_frame()
1180 sta = mesh_sta_info_get(sdata, mgmt->sa, elems, rx_status); in mesh_process_plink_frame()
1182 mpl_dbg(sdata, "Mesh plink: failed to init peer!\n"); in mesh_process_plink_frame()
1187 mesh_plink_frame_tx(sdata, NULL, WLAN_SP_MESH_PEERING_CLOSE, in mesh_process_plink_frame()
1204 changed |= mesh_plink_fsm(sdata, sta, event); in mesh_process_plink_frame()
1210 ieee80211_mbss_info_change_notify(sdata, changed); in mesh_process_plink_frame()
1213 void mesh_rx_plink_frame(struct ieee80211_sub_if_data *sdata, in mesh_rx_plink_frame() argument
1225 if (sdata->u.mesh.user_mpm) in mesh_rx_plink_frame()
1230 mpl_dbg(sdata, in mesh_rx_plink_frame()
1246 mesh_process_plink_frame(sdata, mgmt, elems, rx_status); in mesh_rx_plink_frame()