Lines Matching refs:sdata
23 #define rssi_threshold_check(sta, sdata) \ argument
24 (sdata->u.mesh.mshcfg.rssi_threshold == 0 ||\
26 sdata->u.mesh.mshcfg.rssi_threshold))
62 static int mesh_plink_frame_tx(struct ieee80211_sub_if_data *sdata,
90 static u32 mesh_set_short_slot_time(struct ieee80211_sub_if_data *sdata) in mesh_set_short_slot_time() argument
92 struct ieee80211_local *local = sdata->local; in mesh_set_short_slot_time()
93 enum ieee80211_band band = ieee80211_get_sdata_band(sdata); in mesh_set_short_slot_time()
118 if (sdata != sta->sdata || in mesh_set_short_slot_time()
131 if (sdata->vif.bss_conf.use_short_slot != short_slot) { in mesh_set_short_slot_time()
132 sdata->vif.bss_conf.use_short_slot = short_slot; in mesh_set_short_slot_time()
134 mpl_dbg(sdata, "mesh_plink %pM: ERP short slot time %d\n", in mesh_set_short_slot_time()
135 sdata->vif.addr, short_slot); in mesh_set_short_slot_time()
150 static u32 mesh_set_ht_prot_mode(struct ieee80211_sub_if_data *sdata) in mesh_set_ht_prot_mode() argument
152 struct ieee80211_local *local = sdata->local; in mesh_set_ht_prot_mode()
157 if (sdata->vif.bss_conf.chandef.width == NL80211_CHAN_WIDTH_20_NOHT) in mesh_set_ht_prot_mode()
162 if (sdata != sta->sdata || in mesh_set_ht_prot_mode()
170 mpl_dbg(sdata, "nonHT sta (%pM) is present\n", in mesh_set_ht_prot_mode()
176 mpl_dbg(sdata, "HT20 sta (%pM) is present\n", sta->sta.addr); in mesh_set_ht_prot_mode()
184 sdata->vif.bss_conf.chandef.width > NL80211_CHAN_WIDTH_20) in mesh_set_ht_prot_mode()
189 if (sdata->vif.bss_conf.ht_operation_mode == ht_opmode) in mesh_set_ht_prot_mode()
192 sdata->vif.bss_conf.ht_operation_mode = ht_opmode; in mesh_set_ht_prot_mode()
193 sdata->u.mesh.mshcfg.ht_opmode = ht_opmode; in mesh_set_ht_prot_mode()
194 mpl_dbg(sdata, "selected new HT protection mode %d\n", ht_opmode); in mesh_set_ht_prot_mode()
210 struct ieee80211_sub_if_data *sdata = sta->sdata; in __mesh_plink_deactivate() local
214 changed = mesh_plink_dec_estab_count(sdata); in __mesh_plink_deactivate()
219 changed |= ieee80211_mps_local_status_update(sdata); in __mesh_plink_deactivate()
233 struct ieee80211_sub_if_data *sdata = sta->sdata; in mesh_plink_deactivate() local
239 mesh_plink_frame_tx(sdata, WLAN_SP_MESH_PEERING_CLOSE, in mesh_plink_deactivate()
247 static int mesh_plink_frame_tx(struct ieee80211_sub_if_data *sdata, in mesh_plink_frame_tx() argument
251 struct ieee80211_local *local = sdata->local; in mesh_plink_frame_tx()
268 2 + sdata->u.mesh.mesh_id_len + in mesh_plink_frame_tx()
273 sdata->u.mesh.ie_len); in mesh_plink_frame_tx()
283 memcpy(mgmt->sa, sdata->vif.addr, ETH_ALEN); in mesh_plink_frame_tx()
284 memcpy(mgmt->bssid, sdata->vif.addr, ETH_ALEN); in mesh_plink_frame_tx()
289 enum ieee80211_band band = ieee80211_get_sdata_band(sdata); in mesh_plink_frame_tx()
299 if (ieee80211_add_srates_ie(sdata, skb, true, band) || in mesh_plink_frame_tx()
300 ieee80211_add_ext_srates_ie(sdata, skb, true, band) || in mesh_plink_frame_tx()
301 mesh_add_rsn_ie(sdata, skb) || in mesh_plink_frame_tx()
302 mesh_add_meshid_ie(sdata, skb) || in mesh_plink_frame_tx()
303 mesh_add_meshconf_ie(sdata, skb)) in mesh_plink_frame_tx()
307 if (mesh_add_meshid_ie(sdata, skb)) in mesh_plink_frame_tx()
351 if (mesh_add_ht_cap_ie(sdata, skb) || in mesh_plink_frame_tx()
352 mesh_add_ht_oper_ie(sdata, skb)) in mesh_plink_frame_tx()
356 if (mesh_add_vendor_ies(sdata, skb)) in mesh_plink_frame_tx()
359 ieee80211_tx_skb(sdata, skb); in mesh_plink_frame_tx()
366 static void mesh_sta_info_init(struct ieee80211_sub_if_data *sdata, in mesh_sta_info_init() argument
370 struct ieee80211_local *local = sdata->local; in mesh_sta_info_init()
371 enum ieee80211_band band = ieee80211_get_sdata_band(sdata); in mesh_sta_info_init()
389 if (ieee80211_ht_cap_ie_to_sta_ht_cap(sdata, sband, in mesh_sta_info_init()
411 __mesh_sta_info_alloc(struct ieee80211_sub_if_data *sdata, u8 *hw_addr) in __mesh_sta_info_alloc() argument
415 if (sdata->local->num_sta >= MESH_MAX_PLINKS) in __mesh_sta_info_alloc()
418 sta = sta_info_alloc(sdata, hw_addr, GFP_KERNEL); in __mesh_sta_info_alloc()
434 mesh_sta_info_alloc(struct ieee80211_sub_if_data *sdata, u8 *addr, in mesh_sta_info_alloc() argument
440 if (sdata->u.mesh.user_mpm || in mesh_sta_info_alloc()
441 sdata->u.mesh.security & IEEE80211_MESH_SEC_AUTHED) in mesh_sta_info_alloc()
442 cfg80211_notify_new_peer_candidate(sdata->dev, addr, in mesh_sta_info_alloc()
447 sta = __mesh_sta_info_alloc(sdata, addr); in mesh_sta_info_alloc()
463 mesh_sta_info_get(struct ieee80211_sub_if_data *sdata, in mesh_sta_info_get() argument
469 sta = sta_info_get(sdata, addr); in mesh_sta_info_get()
471 mesh_sta_info_init(sdata, sta, elems, false); in mesh_sta_info_get()
475 sta = mesh_sta_info_alloc(sdata, addr, elems); in mesh_sta_info_get()
481 mesh_sta_info_init(sdata, sta, elems, true); in mesh_sta_info_get()
499 void mesh_neighbour_update(struct ieee80211_sub_if_data *sdata, in mesh_neighbour_update() argument
506 sta = mesh_sta_info_get(sdata, hw_addr, elems); in mesh_neighbour_update()
512 sdata->u.mesh.accepting_plinks && in mesh_neighbour_update()
513 sdata->u.mesh.mshcfg.auto_open_plinks && in mesh_neighbour_update()
514 rssi_threshold_check(sta, sdata)) in mesh_neighbour_update()
520 ieee80211_mbss_info_change_notify(sdata, changed); in mesh_neighbour_update()
527 struct ieee80211_sub_if_data *sdata; in mesh_plink_timer() local
537 if (sta->sdata->local->quiescing) in mesh_plink_timer()
546 mpl_dbg(sta->sdata, in mesh_plink_timer()
552 sdata = sta->sdata; in mesh_plink_timer()
553 mshcfg = &sdata->u.mesh.mshcfg; in mesh_plink_timer()
561 mpl_dbg(sta->sdata, in mesh_plink_timer()
571 mesh_plink_frame_tx(sdata, WLAN_SP_MESH_PEERING_OPEN, in mesh_plink_timer()
584 mesh_plink_frame_tx(sdata, WLAN_SP_MESH_PEERING_CLOSE, in mesh_plink_timer()
611 struct ieee80211_sub_if_data *sdata = sta->sdata; in mesh_plink_open() local
626 mesh_plink_timer_set(sta, sdata->u.mesh.mshcfg.dot11MeshRetryTimeout); in mesh_plink_open()
628 mpl_dbg(sdata, in mesh_plink_open()
633 changed = ieee80211_mps_local_status_update(sdata); in mesh_plink_open()
635 mesh_plink_frame_tx(sdata, WLAN_SP_MESH_PEERING_OPEN, in mesh_plink_open()
653 void mesh_rx_plink_frame(struct ieee80211_sub_if_data *sdata, in mesh_rx_plink_frame() argument
657 struct mesh_config *mshcfg = &sdata->u.mesh.mshcfg; in mesh_rx_plink_frame()
673 if (sdata->u.mesh.user_mpm) in mesh_rx_plink_frame()
678 mpl_dbg(sdata, in mesh_rx_plink_frame()
693 mpl_dbg(sdata, in mesh_rx_plink_frame()
699 sdata->u.mesh.security == IEEE80211_MESH_SEC_NONE) { in mesh_rx_plink_frame()
700 mpl_dbg(sdata, in mesh_rx_plink_frame()
711 mpl_dbg(sdata, in mesh_rx_plink_frame()
719 mpl_dbg(sdata, "Mesh plink: missing necessary ie\n"); in mesh_rx_plink_frame()
733 sta = sta_info_get(sdata, mgmt->sa); in mesh_rx_plink_frame()
735 mpl_dbg(sdata, "Mesh plink: cls or cnf from unknown peer\n"); in mesh_rx_plink_frame()
741 !rssi_threshold_check(sta, sdata)) { in mesh_rx_plink_frame()
742 mpl_dbg(sdata, "Mesh plink: %pM does not meet rssi threshold\n", in mesh_rx_plink_frame()
749 mpl_dbg(sdata, "Mesh plink: Action frame from non-authed peer\n"); in mesh_rx_plink_frame()
762 !mesh_matches_local(sdata, &elems)) { in mesh_rx_plink_frame()
780 mesh_plink_frame_tx(sdata, WLAN_SP_MESH_PEERING_CLOSE, in mesh_rx_plink_frame()
785 if (!mesh_plink_free_count(sdata)) { in mesh_rx_plink_frame()
786 mpl_dbg(sdata, "Mesh plink error: no more free plinks\n"); in mesh_rx_plink_frame()
794 if (!mesh_plink_free_count(sdata) || in mesh_rx_plink_frame()
801 if (!mesh_plink_free_count(sdata) || in mesh_rx_plink_frame()
827 mpl_dbg(sdata, "Mesh plink: unknown frame subtype\n"); in mesh_rx_plink_frame()
836 sta = mesh_sta_info_get(sdata, mgmt->sa, &elems); in mesh_rx_plink_frame()
838 mpl_dbg(sdata, "Mesh plink: failed to init peer!\n"); in mesh_rx_plink_frame()
844 mpl_dbg(sdata, "peer %pM in state %s got event %s\n", mgmt->sa, in mesh_rx_plink_frame()
865 changed |= ieee80211_mps_local_status_update(sdata); in mesh_rx_plink_frame()
868 mesh_plink_frame_tx(sdata, in mesh_rx_plink_frame()
871 mesh_plink_frame_tx(sdata, in mesh_rx_plink_frame()
897 mesh_plink_frame_tx(sdata, in mesh_rx_plink_frame()
907 mesh_plink_frame_tx(sdata, in mesh_rx_plink_frame()
941 mesh_plink_frame_tx(sdata, WLAN_SP_MESH_PEERING_CLOSE, in mesh_rx_plink_frame()
947 mesh_plink_frame_tx(sdata, in mesh_rx_plink_frame()
955 changed |= mesh_plink_inc_estab_count(sdata); in mesh_rx_plink_frame()
956 changed |= mesh_set_ht_prot_mode(sdata); in mesh_rx_plink_frame()
957 changed |= mesh_set_short_slot_time(sdata); in mesh_rx_plink_frame()
958 mpl_dbg(sdata, "Mesh plink with %pM ESTABLISHED\n", in mesh_rx_plink_frame()
986 mesh_plink_frame_tx(sdata, in mesh_rx_plink_frame()
994 changed |= mesh_plink_inc_estab_count(sdata); in mesh_rx_plink_frame()
995 changed |= mesh_set_ht_prot_mode(sdata); in mesh_rx_plink_frame()
996 changed |= mesh_set_short_slot_time(sdata); in mesh_rx_plink_frame()
997 mpl_dbg(sdata, "Mesh plink with %pM ESTABLISHED\n", in mesh_rx_plink_frame()
999 mesh_plink_frame_tx(sdata, in mesh_rx_plink_frame()
1022 changed |= mesh_set_ht_prot_mode(sdata); in mesh_rx_plink_frame()
1023 changed |= mesh_set_short_slot_time(sdata); in mesh_rx_plink_frame()
1024 mesh_plink_frame_tx(sdata, WLAN_SP_MESH_PEERING_CLOSE, in mesh_rx_plink_frame()
1030 mesh_plink_frame_tx(sdata, in mesh_rx_plink_frame()
1054 mesh_plink_frame_tx(sdata, WLAN_SP_MESH_PEERING_CLOSE, in mesh_rx_plink_frame()
1072 ieee80211_mbss_info_change_notify(sdata, changed); in mesh_rx_plink_frame()