Lines Matching refs:sdata

56 static int mesh_plink_frame_tx(struct ieee80211_sub_if_data *sdata,
62 static bool rssi_threshold_check(struct ieee80211_sub_if_data *sdata, in rssi_threshold_check() argument
65 s32 rssi_threshold = sdata->u.mesh.mshcfg.rssi_threshold; in rssi_threshold_check()
94 static u32 mesh_set_short_slot_time(struct ieee80211_sub_if_data *sdata) in mesh_set_short_slot_time() argument
96 struct ieee80211_local *local = sdata->local; in mesh_set_short_slot_time()
97 enum ieee80211_band band = ieee80211_get_sdata_band(sdata); in mesh_set_short_slot_time()
122 if (sdata != sta->sdata || in mesh_set_short_slot_time()
135 if (sdata->vif.bss_conf.use_short_slot != short_slot) { in mesh_set_short_slot_time()
136 sdata->vif.bss_conf.use_short_slot = short_slot; in mesh_set_short_slot_time()
138 mpl_dbg(sdata, "mesh_plink %pM: ERP short slot time %d\n", in mesh_set_short_slot_time()
139 sdata->vif.addr, short_slot); in mesh_set_short_slot_time()
154 static u32 mesh_set_ht_prot_mode(struct ieee80211_sub_if_data *sdata) in mesh_set_ht_prot_mode() argument
156 struct ieee80211_local *local = sdata->local; in mesh_set_ht_prot_mode()
161 switch (sdata->vif.bss_conf.chandef.width) { in mesh_set_ht_prot_mode()
172 if (sdata != sta->sdata || in mesh_set_ht_prot_mode()
180 mpl_dbg(sdata, "nonHT sta (%pM) is present\n", in mesh_set_ht_prot_mode()
186 mpl_dbg(sdata, "HT20 sta (%pM) is present\n", sta->sta.addr); in mesh_set_ht_prot_mode()
194 sdata->vif.bss_conf.chandef.width > NL80211_CHAN_WIDTH_20) in mesh_set_ht_prot_mode()
199 if (sdata->vif.bss_conf.ht_operation_mode == ht_opmode) in mesh_set_ht_prot_mode()
202 sdata->vif.bss_conf.ht_operation_mode = ht_opmode; in mesh_set_ht_prot_mode()
203 sdata->u.mesh.mshcfg.ht_opmode = ht_opmode; in mesh_set_ht_prot_mode()
204 mpl_dbg(sdata, "selected new HT protection mode %d\n", ht_opmode); in mesh_set_ht_prot_mode()
220 struct ieee80211_sub_if_data *sdata = sta->sdata; in __mesh_plink_deactivate() local
224 changed = mesh_plink_dec_estab_count(sdata); in __mesh_plink_deactivate()
244 struct ieee80211_sub_if_data *sdata = sta->sdata; in mesh_plink_deactivate() local
250 mesh_plink_frame_tx(sdata, WLAN_SP_MESH_PEERING_CLOSE, in mesh_plink_deactivate()
258 static int mesh_plink_frame_tx(struct ieee80211_sub_if_data *sdata, in mesh_plink_frame_tx() argument
262 struct ieee80211_local *local = sdata->local; in mesh_plink_frame_tx()
279 2 + sdata->u.mesh.mesh_id_len + in mesh_plink_frame_tx()
284 sdata->u.mesh.ie_len); in mesh_plink_frame_tx()
294 memcpy(mgmt->sa, sdata->vif.addr, ETH_ALEN); in mesh_plink_frame_tx()
295 memcpy(mgmt->bssid, sdata->vif.addr, ETH_ALEN); in mesh_plink_frame_tx()
300 enum ieee80211_band band = ieee80211_get_sdata_band(sdata); in mesh_plink_frame_tx()
310 if (ieee80211_add_srates_ie(sdata, skb, true, band) || in mesh_plink_frame_tx()
311 ieee80211_add_ext_srates_ie(sdata, skb, true, band) || in mesh_plink_frame_tx()
312 mesh_add_rsn_ie(sdata, skb) || in mesh_plink_frame_tx()
313 mesh_add_meshid_ie(sdata, skb) || in mesh_plink_frame_tx()
314 mesh_add_meshconf_ie(sdata, skb)) in mesh_plink_frame_tx()
318 if (mesh_add_meshid_ie(sdata, skb)) in mesh_plink_frame_tx()
362 if (mesh_add_ht_cap_ie(sdata, skb) || in mesh_plink_frame_tx()
363 mesh_add_ht_oper_ie(sdata, skb)) in mesh_plink_frame_tx()
367 if (mesh_add_vendor_ies(sdata, skb)) in mesh_plink_frame_tx()
370 ieee80211_tx_skb(sdata, skb); in mesh_plink_frame_tx()
377 static void mesh_sta_info_init(struct ieee80211_sub_if_data *sdata, in mesh_sta_info_init() argument
381 struct ieee80211_local *local = sdata->local; in mesh_sta_info_init()
382 enum ieee80211_band band = ieee80211_get_sdata_band(sdata); in mesh_sta_info_init()
388 rates = ieee80211_sta_get_rates(sdata, elems, band, &basic_rates); in mesh_sta_info_init()
401 if (ieee80211_ht_cap_ie_to_sta_ht_cap(sdata, sband, in mesh_sta_info_init()
426 __mesh_sta_info_alloc(struct ieee80211_sub_if_data *sdata, u8 *hw_addr) in __mesh_sta_info_alloc() argument
430 if (sdata->local->num_sta >= MESH_MAX_PLINKS) in __mesh_sta_info_alloc()
433 sta = sta_info_alloc(sdata, hw_addr, GFP_KERNEL); in __mesh_sta_info_alloc()
448 mesh_sta_info_alloc(struct ieee80211_sub_if_data *sdata, u8 *addr, in mesh_sta_info_alloc() argument
454 if (sdata->u.mesh.user_mpm || in mesh_sta_info_alloc()
455 sdata->u.mesh.security & IEEE80211_MESH_SEC_AUTHED) in mesh_sta_info_alloc()
456 cfg80211_notify_new_peer_candidate(sdata->dev, addr, in mesh_sta_info_alloc()
461 sta = __mesh_sta_info_alloc(sdata, addr); in mesh_sta_info_alloc()
477 mesh_sta_info_get(struct ieee80211_sub_if_data *sdata, in mesh_sta_info_get() argument
483 sta = sta_info_get(sdata, addr); in mesh_sta_info_get()
485 mesh_sta_info_init(sdata, sta, elems, false); in mesh_sta_info_get()
489 sta = mesh_sta_info_alloc(sdata, addr, elems); in mesh_sta_info_get()
495 mesh_sta_info_init(sdata, sta, elems, true); in mesh_sta_info_get()
513 void mesh_neighbour_update(struct ieee80211_sub_if_data *sdata, in mesh_neighbour_update() argument
520 sta = mesh_sta_info_get(sdata, hw_addr, elems); in mesh_neighbour_update()
526 sdata->u.mesh.accepting_plinks && in mesh_neighbour_update()
527 sdata->u.mesh.mshcfg.auto_open_plinks && in mesh_neighbour_update()
528 rssi_threshold_check(sdata, sta)) in mesh_neighbour_update()
534 ieee80211_mbss_info_change_notify(sdata, changed); in mesh_neighbour_update()
541 struct ieee80211_sub_if_data *sdata; in mesh_plink_timer() local
552 if (sta->sdata->local->quiescing) in mesh_plink_timer()
563 mpl_dbg(sta->sdata, in mesh_plink_timer()
573 mpl_dbg(sta->sdata, in mesh_plink_timer()
580 mpl_dbg(sta->sdata, in mesh_plink_timer()
583 sdata = sta->sdata; in mesh_plink_timer()
584 mshcfg = &sdata->u.mesh.mshcfg; in mesh_plink_timer()
592 mpl_dbg(sta->sdata, in mesh_plink_timer()
624 mesh_plink_frame_tx(sdata, action, sta->sta.addr, in mesh_plink_timer()
637 static bool llid_in_use(struct ieee80211_sub_if_data *sdata, in llid_in_use() argument
640 struct ieee80211_local *local = sdata->local; in llid_in_use()
656 static u16 mesh_get_new_llid(struct ieee80211_sub_if_data *sdata) in mesh_get_new_llid() argument
664 } while (llid_in_use(sdata, llid)); in mesh_get_new_llid()
671 struct ieee80211_sub_if_data *sdata = sta->sdata; in mesh_plink_open() local
678 sta->llid = mesh_get_new_llid(sdata); in mesh_plink_open()
685 mesh_plink_timer_set(sta, sdata->u.mesh.mshcfg.dot11MeshRetryTimeout); in mesh_plink_open()
687 mpl_dbg(sdata, in mesh_plink_open()
692 changed = ieee80211_mps_local_status_update(sdata); in mesh_plink_open()
694 mesh_plink_frame_tx(sdata, WLAN_SP_MESH_PEERING_OPEN, in mesh_plink_open()
711 static void mesh_plink_close(struct ieee80211_sub_if_data *sdata, in mesh_plink_close() argument
715 struct mesh_config *mshcfg = &sdata->u.mesh.mshcfg; in mesh_plink_close()
725 static u32 mesh_plink_establish(struct ieee80211_sub_if_data *sdata, in mesh_plink_establish() argument
728 struct mesh_config *mshcfg = &sdata->u.mesh.mshcfg; in mesh_plink_establish()
733 changed |= mesh_plink_inc_estab_count(sdata); in mesh_plink_establish()
734 changed |= mesh_set_ht_prot_mode(sdata); in mesh_plink_establish()
735 changed |= mesh_set_short_slot_time(sdata); in mesh_plink_establish()
736 mpl_dbg(sdata, "Mesh plink with %pM ESTABLISHED\n", sta->sta.addr); in mesh_plink_establish()
751 static u32 mesh_plink_fsm(struct ieee80211_sub_if_data *sdata, in mesh_plink_fsm() argument
754 struct mesh_config *mshcfg = &sdata->u.mesh.mshcfg; in mesh_plink_fsm()
758 mpl_dbg(sdata, "peer %pM in state %s got event %s\n", sta->sta.addr, in mesh_plink_fsm()
770 sta->llid = mesh_get_new_llid(sdata); in mesh_plink_fsm()
775 changed |= ieee80211_mps_local_status_update(sdata); in mesh_plink_fsm()
787 mesh_plink_close(sdata, sta, event); in mesh_plink_fsm()
808 mesh_plink_close(sdata, sta, event); in mesh_plink_fsm()
815 changed |= mesh_plink_establish(sdata, sta); in mesh_plink_fsm()
826 mesh_plink_close(sdata, sta, event); in mesh_plink_fsm()
830 changed |= mesh_plink_establish(sdata, sta); in mesh_plink_fsm()
841 changed |= mesh_set_ht_prot_mode(sdata); in mesh_plink_fsm()
842 changed |= mesh_set_short_slot_time(sdata); in mesh_plink_fsm()
843 mesh_plink_close(sdata, sta, event); in mesh_plink_fsm()
877 mesh_plink_frame_tx(sdata, action, sta->sta.addr, in mesh_plink_fsm()
882 mesh_plink_frame_tx(sdata, in mesh_plink_fsm()
906 mesh_plink_get_event(struct ieee80211_sub_if_data *sdata, in mesh_plink_get_event() argument
917 mesh_matches_local(sdata, elems)); in mesh_plink_get_event()
927 mpl_dbg(sdata, "Mesh plink: cls or cnf from unknown peer\n"); in mesh_plink_get_event()
931 if (!mesh_plink_free_count(sdata)) { in mesh_plink_get_event()
932 mpl_dbg(sdata, "Mesh plink error: no more free plinks\n"); in mesh_plink_get_event()
937 mpl_dbg(sdata, "Mesh plink: Action frame from non-authed peer\n"); in mesh_plink_get_event()
954 if (!mesh_plink_free_count(sdata) || in mesh_plink_get_event()
963 if (!mesh_plink_free_count(sdata) || in mesh_plink_get_event()
990 mpl_dbg(sdata, "Mesh plink: unknown frame subtype\n"); in mesh_plink_get_event()
999 mesh_process_plink_frame(struct ieee80211_sub_if_data *sdata, in mesh_process_plink_frame() argument
1012 mpl_dbg(sdata, in mesh_process_plink_frame()
1018 sdata->u.mesh.security == IEEE80211_MESH_SEC_NONE) { in mesh_process_plink_frame()
1019 mpl_dbg(sdata, in mesh_process_plink_frame()
1029 mpl_dbg(sdata, in mesh_process_plink_frame()
1037 mpl_dbg(sdata, "Mesh plink: missing necessary ie\n"); in mesh_process_plink_frame()
1051 sta = sta_info_get(sdata, mgmt->sa); in mesh_process_plink_frame()
1054 !rssi_threshold_check(sdata, sta)) { in mesh_process_plink_frame()
1055 mpl_dbg(sdata, "Mesh plink: %pM does not meet rssi threshold\n", in mesh_process_plink_frame()
1061 event = mesh_plink_get_event(sdata, sta, elems, ftype, llid, plid); in mesh_process_plink_frame()
1066 sta = mesh_sta_info_get(sdata, mgmt->sa, elems); in mesh_process_plink_frame()
1068 mpl_dbg(sdata, "Mesh plink: failed to init peer!\n"); in mesh_process_plink_frame()
1073 mesh_plink_frame_tx(sdata, WLAN_SP_MESH_PEERING_CLOSE, in mesh_process_plink_frame()
1086 changed |= mesh_plink_fsm(sdata, sta, event); in mesh_process_plink_frame()
1092 ieee80211_mbss_info_change_notify(sdata, changed); in mesh_process_plink_frame()
1095 void mesh_rx_plink_frame(struct ieee80211_sub_if_data *sdata, in mesh_rx_plink_frame() argument
1107 if (sdata->u.mesh.user_mpm) in mesh_rx_plink_frame()
1112 mpl_dbg(sdata, in mesh_rx_plink_frame()
1125 mesh_process_plink_frame(sdata, mgmt, &elems); in mesh_rx_plink_frame()