Lines Matching defs:sdata
41 struct ieee80211_sub_if_data *sdata =
42 from_timer(sdata, t, u.mesh.housekeeping_timer);
43 struct ieee80211_local *local = sdata->local;
44 struct ieee80211_if_mesh *ifmsh = &sdata->u.mesh;
48 wiphy_work_queue(local->hw.wiphy, &sdata->work);
54 * @sdata: local mesh subif
60 bool mesh_matches_local(struct ieee80211_sub_if_data *sdata,
63 struct ieee80211_if_mesh *ifmsh = &sdata->u.mesh;
88 sband = ieee80211_get_sband(sdata);
92 ieee80211_sta_get_rates(sdata, ie, sband->band,
95 if (sdata->vif.bss_conf.basic_rates != basic_rates)
98 cfg80211_chandef_create(&sta_chan_def, sdata->vif.bss_conf.chandef.chan,
105 ieee80211_chandef_vht_oper(&sdata->local->hw, vht_cap_info,
108 ieee80211_chandef_he_6ghz_oper(sdata, ie->he_operation, ie->eht_operation,
111 if (!cfg80211_chandef_compatible(&sdata->vif.bss_conf.chandef,
132 * @sdata: mesh interface in which mesh beacons are going to be updated
136 u64 mesh_accept_plinks_update(struct ieee80211_sub_if_data *sdata)
147 free_plinks = mesh_plink_availables(sdata);
149 if (free_plinks != sdata->u.mesh.accepting_plinks) {
150 sdata->u.mesh.accepting_plinks = free_plinks;
164 struct ieee80211_sub_if_data *sdata = sta->sdata;
168 ieee80211_mbss_info_change_notify(sdata, changed);
171 int mesh_rmc_init(struct ieee80211_sub_if_data *sdata)
175 sdata->u.mesh.rmc = kmalloc(sizeof(struct mesh_rmc), GFP_KERNEL);
176 if (!sdata->u.mesh.rmc)
178 sdata->u.mesh.rmc->idx_mask = RMC_BUCKETS - 1;
180 INIT_HLIST_HEAD(&sdata->u.mesh.rmc->bucket[i]);
184 void mesh_rmc_free(struct ieee80211_sub_if_data *sdata)
186 struct mesh_rmc *rmc = sdata->u.mesh.rmc;
191 if (!sdata->u.mesh.rmc)
202 sdata->u.mesh.rmc = NULL;
208 * @sdata: interface
218 int mesh_rmc_check(struct ieee80211_sub_if_data *sdata,
221 struct mesh_rmc *rmc = sdata->u.mesh.rmc;
256 int mesh_add_meshconf_ie(struct ieee80211_sub_if_data *sdata,
259 struct ieee80211_if_mesh *ifmsh = &sdata->u.mesh;
305 int mesh_add_meshid_ie(struct ieee80211_sub_if_data *sdata, struct sk_buff *skb)
307 struct ieee80211_if_mesh *ifmsh = &sdata->u.mesh;
322 static int mesh_add_awake_window_ie(struct ieee80211_sub_if_data *sdata,
325 struct ieee80211_if_mesh *ifmsh = &sdata->u.mesh;
345 int mesh_add_vendor_ies(struct ieee80211_sub_if_data *sdata,
348 struct ieee80211_if_mesh *ifmsh = &sdata->u.mesh;
369 int mesh_add_rsn_ie(struct ieee80211_sub_if_data *sdata, struct sk_buff *skb)
371 struct ieee80211_if_mesh *ifmsh = &sdata->u.mesh;
392 static int mesh_add_ds_params_ie(struct ieee80211_sub_if_data *sdata,
403 chanctx_conf = rcu_dereference(sdata->vif.bss_conf.chanctx_conf);
419 int mesh_add_ht_cap_ie(struct ieee80211_sub_if_data *sdata,
425 sband = ieee80211_get_sband(sdata);
434 sdata->vif.bss_conf.chandef.width == NL80211_CHAN_WIDTH_20_NOHT ||
435 sdata->vif.bss_conf.chandef.width == NL80211_CHAN_WIDTH_5 ||
436 sdata->vif.bss_conf.chandef.width == NL80211_CHAN_WIDTH_10)
448 int mesh_add_ht_oper_ie(struct ieee80211_sub_if_data *sdata,
451 struct ieee80211_local *local = sdata->local;
459 chanctx_conf = rcu_dereference(sdata->vif.bss_conf.chanctx_conf);
475 sdata->vif.bss_conf.chandef.width == NL80211_CHAN_WIDTH_20_NOHT ||
476 sdata->vif.bss_conf.chandef.width == NL80211_CHAN_WIDTH_5 ||
477 sdata->vif.bss_conf.chandef.width == NL80211_CHAN_WIDTH_10)
484 ieee80211_ie_build_ht_oper(pos, ht_cap, &sdata->vif.bss_conf.chandef,
485 sdata->vif.bss_conf.ht_operation_mode,
491 int mesh_add_vht_cap_ie(struct ieee80211_sub_if_data *sdata,
497 sband = ieee80211_get_sband(sdata);
506 sdata->vif.bss_conf.chandef.width == NL80211_CHAN_WIDTH_20_NOHT ||
507 sdata->vif.bss_conf.chandef.width == NL80211_CHAN_WIDTH_5 ||
508 sdata->vif.bss_conf.chandef.width == NL80211_CHAN_WIDTH_10)
520 int mesh_add_vht_oper_ie(struct ieee80211_sub_if_data *sdata,
523 struct ieee80211_local *local = sdata->local;
531 chanctx_conf = rcu_dereference(sdata->vif.bss_conf.chanctx_conf);
547 sdata->vif.bss_conf.chandef.width == NL80211_CHAN_WIDTH_20_NOHT ||
548 sdata->vif.bss_conf.chandef.width == NL80211_CHAN_WIDTH_5 ||
549 sdata->vif.bss_conf.chandef.width == NL80211_CHAN_WIDTH_10)
557 &sdata->vif.bss_conf.chandef);
562 int mesh_add_he_cap_ie(struct ieee80211_sub_if_data *sdata,
569 sband = ieee80211_get_sband(sdata);
576 sdata->vif.bss_conf.chandef.width == NL80211_CHAN_WIDTH_20_NOHT ||
577 sdata->vif.bss_conf.chandef.width == NL80211_CHAN_WIDTH_5 ||
578 sdata->vif.bss_conf.chandef.width == NL80211_CHAN_WIDTH_10)
590 int mesh_add_he_oper_ie(struct ieee80211_sub_if_data *sdata,
598 sband = ieee80211_get_sband(sdata);
604 sdata->vif.bss_conf.chandef.width == NL80211_CHAN_WIDTH_20_NOHT ||
605 sdata->vif.bss_conf.chandef.width == NL80211_CHAN_WIDTH_5 ||
606 sdata->vif.bss_conf.chandef.width == NL80211_CHAN_WIDTH_10)
610 if (sdata->vif.bss_conf.chandef.chan->band == NL80211_BAND_6GHZ)
617 ieee80211_ie_build_he_oper(pos, &sdata->vif.bss_conf.chandef);
622 int mesh_add_he_6ghz_cap_ie(struct ieee80211_sub_if_data *sdata,
628 sband = ieee80211_get_sband(sdata);
638 ieee80211_ie_build_he_6ghz_cap(sdata, sdata->deflink.smps_mode, skb);
642 int mesh_add_eht_cap_ie(struct ieee80211_sub_if_data *sdata,
650 sband = ieee80211_get_sband(sdata);
657 sdata->vif.bss_conf.chandef.width == NL80211_CHAN_WIDTH_20_NOHT ||
658 sdata->vif.bss_conf.chandef.width == NL80211_CHAN_WIDTH_5 ||
659 sdata->vif.bss_conf.chandef.width == NL80211_CHAN_WIDTH_10)
671 int mesh_add_eht_oper_ie(struct ieee80211_sub_if_data *sdata, struct sk_buff *skb)
678 sband = ieee80211_get_sband(sdata);
684 sdata->vif.bss_conf.chandef.width == NL80211_CHAN_WIDTH_20_NOHT ||
685 sdata->vif.bss_conf.chandef.width == NL80211_CHAN_WIDTH_5 ||
686 sdata->vif.bss_conf.chandef.width == NL80211_CHAN_WIDTH_10)
696 ieee80211_ie_build_eht_oper(pos, &sdata->vif.bss_conf.chandef, eht_cap);
703 struct ieee80211_sub_if_data *sdata =
704 from_timer(sdata, t, u.mesh.mesh_path_timer);
706 wiphy_work_queue(sdata->local->hw.wiphy, &sdata->work);
711 struct ieee80211_sub_if_data *sdata =
712 from_timer(sdata, t, u.mesh.mesh_path_root_timer);
713 struct ieee80211_if_mesh *ifmsh = &sdata->u.mesh;
717 wiphy_work_queue(sdata->local->hw.wiphy, &sdata->work);
732 ieee80211_mesh_update_bss_params(struct ieee80211_sub_if_data *sdata,
739 sband = ieee80211_get_sband(sdata);
744 sdata->vif.bss_conf.chandef.width == NL80211_CHAN_WIDTH_20_NOHT ||
745 sdata->vif.bss_conf.chandef.width == NL80211_CHAN_WIDTH_5 ||
746 sdata->vif.bss_conf.chandef.width == NL80211_CHAN_WIDTH_10)
749 sdata->vif.bss_conf.he_support = true;
757 sdata->vif.bss_conf.he_oper.params =
760 sdata->vif.bss_conf.eht_support =
764 bool ieee80211_mesh_xmit_fast(struct ieee80211_sub_if_data *sdata,
767 struct ieee80211_if_mesh *ifmsh = &sdata->u.mesh;
803 entry = mesh_fast_tx_get(sdata, skb->data);
827 skb_set_queue_mapping(skb, ieee80211_select_queue(sdata, sta, skb));
840 put_unaligned_le32(atomic_inc_return(&sdata->u.mesh.mesh_seqnum),
842 meshhdr->ttl = sdata->u.mesh.mshcfg.dot11MeshTTL;
847 __ieee80211_xmit_fast(sdata, sta, &entry->fast_tx, skb, tid_tx,
848 entry->mpath->dst, sdata->vif.addr);
886 * @sdata: mesh interface to be used
896 unsigned int ieee80211_new_mesh_header(struct ieee80211_sub_if_data *sdata,
905 meshhdr->ttl = sdata->u.mesh.mshcfg.dot11MeshTTL;
907 put_unaligned_le32(atomic_inc_return(&sdata->u.mesh.mesh_seqnum),
923 static void ieee80211_mesh_housekeeping(struct ieee80211_sub_if_data *sdata)
925 struct ieee80211_if_mesh *ifmsh = &sdata->u.mesh;
929 ieee80211_sta_expire(sdata, ifmsh->mshcfg.plink_timeout * HZ);
930 mesh_path_expire(sdata);
932 changed = mesh_accept_plinks_update(sdata);
933 ieee80211_mbss_info_change_notify(sdata, changed);
935 mesh_fast_tx_gc(sdata);
942 static void ieee80211_mesh_rootpath(struct ieee80211_sub_if_data *sdata)
944 struct ieee80211_if_mesh *ifmsh = &sdata->u.mesh;
947 mesh_path_tx_root_frame(sdata);
970 struct ieee80211_sub_if_data *sdata;
973 sdata = container_of(ifmsh, struct ieee80211_sub_if_data, u.mesh);
975 chanctx_conf = rcu_dereference(sdata->vif.bss_conf.chanctx_conf);
979 ie_len_he_cap = ieee80211_ie_len_he_cap(sdata,
981 ie_len_eht_cap = ieee80211_ie_len_eht_cap(sdata,
1029 memcpy(mgmt->sa, sdata->vif.addr, ETH_ALEN);
1030 memcpy(mgmt->bssid, sdata->vif.addr, ETH_ALEN);
1031 ieee80211_mps_set_frame_flags(sdata, NULL, (void *) mgmt);
1033 cpu_to_le16(sdata->vif.bss_conf.beacon_int);
1035 sdata->u.mesh.security ? WLAN_CAPABILITY_PRIVACY : 0);
1106 if (ieee80211_add_srates_ie(sdata, skb, true, band) ||
1107 mesh_add_ds_params_ie(sdata, skb))
1117 if (ieee80211_add_ext_srates_ie(sdata, skb, true, band) ||
1118 mesh_add_rsn_ie(sdata, skb) ||
1119 mesh_add_ht_cap_ie(sdata, skb) ||
1120 mesh_add_ht_oper_ie(sdata, skb) ||
1121 mesh_add_meshid_ie(sdata, skb) ||
1122 mesh_add_meshconf_ie(sdata, skb) ||
1123 mesh_add_awake_window_ie(sdata, skb) ||
1124 mesh_add_vht_cap_ie(sdata, skb) ||
1125 mesh_add_vht_oper_ie(sdata, skb) ||
1126 mesh_add_he_cap_ie(sdata, skb, ie_len_he_cap) ||
1127 mesh_add_he_oper_ie(sdata, skb) ||
1128 mesh_add_he_6ghz_cap_ie(sdata, skb) ||
1129 mesh_add_eht_cap_ie(sdata, skb, ie_len_eht_cap) ||
1130 mesh_add_eht_oper_ie(sdata, skb) ||
1131 mesh_add_vendor_ies(sdata, skb))
1136 ieee80211_mesh_update_bss_params(sdata, bcn->tail, bcn->tail_len);
1150 ieee80211_mesh_rebuild_beacon(struct ieee80211_sub_if_data *sdata)
1155 old_bcn = sdata_dereference(sdata->u.mesh.beacon, sdata);
1156 ret = ieee80211_mesh_build_beacon(&sdata->u.mesh);
1166 void ieee80211_mbss_info_change_notify(struct ieee80211_sub_if_data *sdata,
1169 struct ieee80211_if_mesh *ifmsh = &sdata->u.mesh;
1180 wiphy_work_queue(sdata->local->hw.wiphy, &sdata->work);
1183 int ieee80211_start_mesh(struct ieee80211_sub_if_data *sdata)
1185 struct ieee80211_if_mesh *ifmsh = &sdata->u.mesh;
1186 struct ieee80211_local *local = sdata->local;
1205 wiphy_work_queue(local->hw.wiphy, &sdata->work);
1206 sdata->vif.bss_conf.ht_operation_mode =
1208 sdata->vif.bss_conf.enable_beacon = true;
1210 changed |= ieee80211_mps_local_status_update(sdata);
1213 ieee80211_stop_mesh(sdata);
1217 ieee80211_recalc_dtim(local, sdata);
1218 ieee80211_link_info_change_notify(sdata, &sdata->deflink, changed);
1220 netif_carrier_on(sdata->dev);
1224 void ieee80211_stop_mesh(struct ieee80211_sub_if_data *sdata)
1226 struct ieee80211_local *local = sdata->local;
1227 struct ieee80211_if_mesh *ifmsh = &sdata->u.mesh;
1230 netif_carrier_off(sdata->dev);
1233 sta_info_flush(sdata);
1234 ieee80211_free_keys(sdata, true);
1235 mesh_path_flush_by_iface(sdata);
1239 sdata->vif.bss_conf.enable_beacon = false;
1240 sdata->beacon_rate_set = false;
1241 clear_bit(SDATA_STATE_OFFCHANNEL_BEACON_STOPPED, &sdata->state);
1242 ieee80211_link_info_change_notify(sdata, &sdata->deflink,
1246 bcn = sdata_dereference(ifmsh->beacon, sdata);
1254 del_timer_sync(&sdata->u.mesh.housekeeping_timer);
1255 del_timer_sync(&sdata->u.mesh.mesh_path_root_timer);
1256 del_timer_sync(&sdata->u.mesh.mesh_path_timer);
1267 static void ieee80211_mesh_csa_mark_radar(struct ieee80211_sub_if_data *sdata)
1274 err = cfg80211_chandef_dfs_required(sdata->local->hw.wiphy,
1275 &sdata->vif.bss_conf.chandef,
1278 cfg80211_radar_event(sdata->local->hw.wiphy,
1279 &sdata->vif.bss_conf.chandef, GFP_ATOMIC);
1283 ieee80211_mesh_process_chnswitch(struct ieee80211_sub_if_data *sdata,
1288 struct ieee80211_if_mesh *ifmsh = &sdata->u.mesh;
1294 sdata_assert_lock(sdata);
1296 sband = ieee80211_get_sband(sdata);
1300 switch (sdata->vif.bss_conf.chandef.width) {
1319 err = ieee80211_parse_ch_switch_ie(sdata, elems, sband->band,
1321 conn_flags, sdata->vif.addr,
1332 ieee80211_mesh_csa_mark_radar(sdata);
1337 if (!cfg80211_chandef_usable(sdata->local->hw.wiphy, ¶ms.chandef,
1339 !cfg80211_reg_can_beacon(sdata->local->hw.wiphy, ¶ms.chandef,
1341 sdata_info(sdata,
1343 sdata->vif.addr,
1351 err = cfg80211_chandef_dfs_required(sdata->local->hw.wiphy,
1357 sdata_info(sdata,
1359 sdata->vif.addr,
1370 &sdata->vif.bss_conf.chandef)) {
1371 mcsa_dbg(sdata,
1376 mcsa_dbg(sdata,
1393 if (ieee80211_channel_switch(sdata->local->hw.wiphy, sdata->dev,
1401 ieee80211_mesh_rx_probe_req(struct ieee80211_sub_if_data *sdata,
1404 struct ieee80211_local *local = sdata->local;
1405 struct ieee80211_if_mesh *ifmsh = &sdata->u.mesh;
1426 if ((!ether_addr_equal(mgmt->da, sdata->vif.addr) &&
1455 ieee80211_tx_skb(sdata, presp);
1462 static void ieee80211_mesh_rx_bcn_presp(struct ieee80211_sub_if_data *sdata,
1468 struct ieee80211_local *local = sdata->local;
1469 struct ieee80211_if_mesh *ifmsh = &sdata->u.mesh;
1478 !ether_addr_equal(mgmt->da, sdata->vif.addr))
1493 (elems->rsn && sdata->u.mesh.security == IEEE80211_MESH_SEC_NONE) ||
1494 (!elems->rsn && sdata->u.mesh.security != IEEE80211_MESH_SEC_NONE))
1507 if (mesh_matches_local(sdata, elems)) {
1508 mpl_dbg(sdata, "rssi_threshold=%d,rx_status->signal=%d\n",
1509 sdata->u.mesh.mshcfg.rssi_threshold, rx_status->signal);
1510 if (!sdata->u.mesh.user_mpm ||
1511 sdata->u.mesh.mshcfg.rssi_threshold == 0 ||
1512 sdata->u.mesh.mshcfg.rssi_threshold < rx_status->signal)
1513 mesh_neighbour_update(sdata, mgmt->sa, elems,
1517 !sdata->vif.bss_conf.csa_active)
1518 ieee80211_mesh_process_chnswitch(sdata, elems, true);
1522 ifmsh->sync_ops->rx_bcn_presp(sdata, stype, mgmt, len,
1528 int ieee80211_mesh_finish_csa(struct ieee80211_sub_if_data *sdata, u64 *changed)
1530 struct ieee80211_if_mesh *ifmsh = &sdata->u.mesh;
1539 tmp_csa_settings = sdata_dereference(ifmsh->csa, sdata);
1543 ret = ieee80211_mesh_rebuild_beacon(sdata);
1549 mcsa_dbg(sdata, "complete switching to center freq %d MHz",
1550 sdata->vif.bss_conf.chandef.chan->center_freq);
1554 int ieee80211_mesh_csa_beacon(struct ieee80211_sub_if_data *sdata,
1558 struct ieee80211_if_mesh *ifmsh = &sdata->u.mesh;
1562 lockdep_assert_held(&sdata->wdev.mtx);
1574 ret = ieee80211_mesh_rebuild_beacon(sdata);
1586 static int mesh_fwd_csa_frame(struct ieee80211_sub_if_data *sdata,
1592 struct ieee80211_local *local = sdata->local;
1606 memcpy(mgmt_fwd->sa, sdata->vif.addr, ETH_ALEN);
1607 memcpy(mgmt_fwd->bssid, sdata->vif.addr, ETH_ALEN);
1609 ieee80211_tx_skb(sdata, skb);
1613 static void mesh_rx_csa_frame(struct ieee80211_sub_if_data *sdata,
1616 struct ieee80211_if_mesh *ifmsh = &sdata->u.mesh;
1634 if (!mesh_matches_local(sdata, elems))
1647 if (!sdata->vif.bss_conf.csa_active &&
1648 !ieee80211_mesh_process_chnswitch(sdata, elems, false)) {
1649 mcsa_dbg(sdata, "Failed to process CSA action frame");
1655 if (mesh_fwd_csa_frame(sdata, mgmt, len, elems) < 0)
1656 mcsa_dbg(sdata, "Failed to forward the CSA frame");
1662 static void ieee80211_mesh_rx_mgmt_action(struct ieee80211_sub_if_data *sdata,
1673 mesh_rx_plink_frame(sdata, mgmt, len, rx_status);
1679 mesh_rx_path_sel_frame(sdata, mgmt, len);
1682 mesh_rx_csa_frame(sdata, mgmt, len);
1687 void ieee80211_mesh_rx_queued_mgmt(struct ieee80211_sub_if_data *sdata,
1694 sdata_lock(sdata);
1697 if (!sdata->u.mesh.mesh_id_len)
1707 ieee80211_mesh_rx_bcn_presp(sdata, stype, mgmt, skb->len,
1711 ieee80211_mesh_rx_probe_req(sdata, mgmt, skb->len);
1714 ieee80211_mesh_rx_mgmt_action(sdata, mgmt, skb->len, rx_status);
1718 sdata_unlock(sdata);
1721 static void mesh_bss_info_changed(struct ieee80211_sub_if_data *sdata)
1723 struct ieee80211_if_mesh *ifmsh = &sdata->u.mesh;
1733 if (sdata->vif.bss_conf.enable_beacon &&
1738 if (ieee80211_mesh_rebuild_beacon(sdata))
1741 ieee80211_link_info_change_notify(sdata, &sdata->deflink, changed);
1744 void ieee80211_mesh_work(struct ieee80211_sub_if_data *sdata)
1746 struct ieee80211_if_mesh *ifmsh = &sdata->u.mesh;
1748 sdata_lock(sdata);
1751 if (!sdata->u.mesh.mesh_id_len)
1757 mesh_path_start_discovery(sdata);
1760 ieee80211_mesh_housekeeping(sdata);
1763 ieee80211_mesh_rootpath(sdata);
1766 mesh_sync_adjust_tsf(sdata);
1769 mesh_bss_info_changed(sdata);
1771 sdata_unlock(sdata);
1775 void ieee80211_mesh_init_sdata(struct ieee80211_sub_if_data *sdata)
1777 struct ieee80211_if_mesh *ifmsh = &sdata->u.mesh;
1785 mesh_rmc_init(sdata);
1793 mesh_pathtbl_init(sdata);
1804 sdata->vif.bss_conf.bssid = zero_addr;
1807 void ieee80211_mesh_teardown_sdata(struct ieee80211_sub_if_data *sdata)
1809 mesh_rmc_free(sdata);
1810 mesh_pathtbl_unregister(sdata);