drv->associated = 0;
os_memset(&drv->sta_mlo_info, 0, sizeof(drv->sta_mlo_info));
os_memset(drv->bssid, 0, ETH_ALEN);
- drv->first_bss->freq = 0;
+ drv->first_bss->flink->freq = 0;
#ifdef CONFIG_DRIVER_NL80211_QCA
os_free(drv->pending_roam_data);
drv->pending_roam_data = NULL;
dl_list_init(&w->drvs);
/* Beacon frames not supported in IEEE 802.11ad */
- if (ieee80211_freq_to_chan(bss->freq, &channel) !=
+ if (ieee80211_freq_to_chan(bss->flink->freq, &channel) !=
HOSTAPD_MODE_IEEE80211AD) {
w->nl_cb = nl_cb_alloc(NL_CB_DEFAULT);
if (!w->nl_cb) {
{
struct wpa_driver_nl80211_data *drv;
struct i802_bss *bss;
+ unsigned int i;
if (global_priv == NULL)
return NULL;
drv->in_interface_list = 1;
}
+ /*
+ * Set the default link to be the first one, and set its address to that
+ * of the interface.
+ */
+ bss->flink = &bss->links[0];
+ bss->n_links = 1;
+ os_memcpy(bss->flink->addr, bss->addr, ETH_ALEN);
+
+ for (i = 0; i < MAX_NUM_MLD_LINKS; i++)
+ bss->links[i].link_id = NL80211_DRV_LINK_ID_NA;
+
return bss;
failed:
wpa_printf(MSG_DEBUG, "nl80211: Remove beacon (ifindex=%d)",
drv->ifindex);
- bss->beacon_set = 0;
- bss->freq = 0;
+ bss->flink->beacon_set = 0;
+ bss->flink->freq = 0;
nl80211_put_wiphy_data_ap(bss);
msg = nl80211_drv_msg(drv, 0, NL80211_CMD_DEL_BEACON);
return send_and_recv_msgs(drv, msg, NULL, NULL, NULL, NULL);
if (drv->device_ap_sme && is_ap_interface(drv->nlmode)) {
if (freq == 0) {
wpa_printf(MSG_DEBUG, "nl80211: Use bss->freq=%d",
- bss->freq);
- freq = bss->freq;
+ bss->flink->freq);
+ freq = bss->flink->freq;
}
- if ((int) freq == bss->freq)
+ if ((int) freq == bss->flink->freq)
wait_time = 0;
goto send_frame_cmd;
}
}
if (freq == 0) {
wpa_printf(MSG_DEBUG, "nl80211: send_mlme - Use bss->freq=%u",
- bss->freq);
- freq = bss->freq;
+ bss->flink->freq);
+ freq = bss->flink->freq;
}
if (drv->use_monitor && is_ap_interface(drv->nlmode)) {
wpa_printf(MSG_DEBUG,
"nl80211: send_frame(freq=%u bss->freq=%u) -> send_monitor",
- freq, bss->freq);
+ freq, bss->flink->freq);
return nl80211_send_monitor(drv, data, data_len, encrypt,
noack);
}
struct wpa_driver_mesh_bss_params mesh_params;
#endif /* CONFIG_MESH */
- beacon_set = params->reenable ? 0 : bss->beacon_set;
+ beacon_set = params->reenable ? 0 : bss->flink->beacon_set;
wpa_printf(MSG_DEBUG, "nl80211: Set beacon (beacon_set=%d)",
beacon_set);
wpa_printf(MSG_DEBUG, "nl80211: Beacon set failed: %d (%s)",
ret, strerror(-ret));
} else {
- bss->beacon_set = 1;
+ bss->flink->beacon_set = 1;
nl80211_set_bss(bss, params->cts_protect, params->preamble,
params->short_slot_time, params->ht_opmode,
params->isolate, params->basic_rates);
nl80211_set_multicast_to_unicast(bss,
params->multicast_to_unicast);
if (beacon_set && params->freq &&
- params->freq->bandwidth != bss->bandwidth) {
+ params->freq->bandwidth != bss->flink->bandwidth) {
wpa_printf(MSG_DEBUG,
"nl80211: Update BSS %s bandwidth: %d -> %d",
- bss->ifname, bss->bandwidth,
+ bss->ifname, bss->flink->bandwidth,
params->freq->bandwidth);
ret = nl80211_set_channel(bss, params->freq, 1);
if (ret) {
} else {
wpa_printf(MSG_DEBUG,
"nl80211: Frequency set succeeded for ht2040 coex");
- bss->bandwidth = params->freq->bandwidth;
+ bss->flink->bandwidth = params->freq->bandwidth;
}
} else if (!beacon_set && params->freq) {
/*
* mode only at the point when beaconing is started, so
* set the initial value here.
*/
- bss->bandwidth = params->freq->bandwidth;
+ bss->flink->bandwidth = params->freq->bandwidth;
}
}
ret = send_and_recv_msgs(drv, msg, NULL, NULL, NULL, NULL);
if (ret == 0) {
- bss->freq = freq->freq;
+ bss->flink->freq = freq->freq;
return 0;
}
wpa_printf(MSG_DEBUG, "nl80211: Failed to set channel (freq=%d): "
nl80211_mgmt_unsubscribe(bss, "AP teardown");
nl80211_put_wiphy_data_ap(bss);
- bss->beacon_set = 0;
+ bss->flink->beacon_set = 0;
}
struct ieee80211_mgmt mgmt;
u8 channel;
- if (ieee80211_freq_to_chan(bss->freq, &channel) ==
+ if (ieee80211_freq_to_chan(bss->flink->freq, &channel) ==
HOSTAPD_MODE_IEEE80211AD) {
/* Deauthentication is not used in DMG/IEEE 802.11ad;
* disassociate the STA instead. */
if (type == WPA_IF_AP_BSS && setup_ap) {
struct i802_bss *new_bss = os_zalloc(sizeof(*new_bss));
+ unsigned int i;
+
if (new_bss == NULL) {
if (added)
nl80211_remove_iface(drv, ifidx);
return -1;
}
+ /* Initialize here before any failure path */
+ for (i = 0; i < MAX_NUM_MLD_LINKS; i++)
+ new_bss->links[i].link_id = NL80211_DRV_LINK_ID_NA;
+
if (bridge &&
i802_check_bridge(drv, new_bss, bridge, ifname) < 0) {
wpa_printf(MSG_ERROR, "nl80211: Failed to add the new "
new_bss->ifindex = ifidx;
new_bss->drv = drv;
new_bss->next = drv->first_bss->next;
- new_bss->freq = drv->first_bss->freq;
+ new_bss->flink = &new_bss->links[0];
+ new_bss->n_links = 1;
+ os_memcpy(new_bss->flink->addr, new_bss->addr, ETH_ALEN);
+
+ new_bss->flink->freq = drv->first_bss->flink->freq;
new_bss->ctx = bss_ctx;
new_bss->added_if = added;
drv->first_bss->next = new_bss;
struct ieee80211_hdr *hdr;
int offchanok = 1;
- if (is_ap_interface(drv->nlmode) && (int) freq == bss->freq &&
- bss->beacon_set)
+ if (is_ap_interface(drv->nlmode) && (int) freq == bss->flink->freq &&
+ bss->flink->beacon_set)
offchanok = 0;
wpa_printf(MSG_DEBUG, "nl80211: Send Action frame (ifindex=%d, "
modes = nl80211_get_hw_feature_data(bss, &num_modes,
&flags, &dfs_domain);
if (dfs_domain != HOSTAPD_DFS_REGION_ETSI &&
- ieee80211_is_dfs(bss->freq, modes, num_modes))
+ ieee80211_is_dfs(bss->flink->freq, modes, num_modes))
offchanok = 0;
if (modes) {
for (i = 0; i < num_modes; i++) {
if (is_ap_interface(drv->nlmode) &&
(!(drv->capa.flags & WPA_DRIVER_FLAGS_OFFCHANNEL_TX) ||
- (int) freq == bss->freq || drv->device_ap_sme ||
+ (int) freq == bss->flink->freq || drv->device_ap_sme ||
!drv->use_monitor))
ret = wpa_driver_nl80211_send_mlme(bss, buf, 24 + data_len,
0, freq, no_cck, offchanok,
bss->ifname,
bss->brname,
MAC2STR(bss->addr),
- bss->freq,
- bss->beacon_set ? "beacon_set=1\n" : "",
+ bss->flink->freq,
+ bss->flink->beacon_set ? "beacon_set=1\n" : "",
bss->added_if_into_bridge ?
"added_if_into_bridge=1\n" : "",
bss->already_in_bridge ? "already_in_bridge=1\n" : "",
goto fail;
}
ret = 0;
- drv->assoc_freq = bss->freq = params->freq.freq;
+ drv->assoc_freq = bss->flink->freq = params->freq.freq;
wpa_printf(MSG_DEBUG, "nl80211: mesh join request send successfully");
fail:
} else {
wpa_printf(MSG_DEBUG,
"nl80211: mesh leave request send successfully");
- drv->first_bss->freq = 0;
+ drv->first_bss->flink->freq = 0;
}
if (drv->start_mode_sta &&