static int iwl_mvm_start_ap_ibss(struct ieee80211_hw *hw,
struct ieee80211_vif *vif,
- unsigned int link_id)
+ struct ieee80211_bss_conf *link_conf)
{
struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw);
struct iwl_mvm_vif *mvmvif = iwl_mvm_vif_from_mac80211(vif);
static int iwl_mvm_start_ap(struct ieee80211_hw *hw,
struct ieee80211_vif *vif,
- unsigned int link_id)
+ struct ieee80211_bss_conf *link_conf)
{
- return iwl_mvm_start_ap_ibss(hw, vif, link_id);
+ return iwl_mvm_start_ap_ibss(hw, vif, link_conf);
}
static int iwl_mvm_start_ibss(struct ieee80211_hw *hw,
struct ieee80211_vif *vif)
{
- return iwl_mvm_start_ap_ibss(hw, vif, 0);
+ return iwl_mvm_start_ap_ibss(hw, vif, &vif->bss_conf);
}
static void iwl_mvm_stop_ap_ibss(struct ieee80211_hw *hw,
struct ieee80211_vif *vif,
- unsigned int link_id)
+ struct ieee80211_bss_conf *link_conf)
{
struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw);
struct iwl_mvm_vif *mvmvif = iwl_mvm_vif_from_mac80211(vif);
static void iwl_mvm_stop_ap(struct ieee80211_hw *hw,
struct ieee80211_vif *vif,
- unsigned int link_id)
+ struct ieee80211_bss_conf *link_conf)
{
- iwl_mvm_stop_ap_ibss(hw, vif, link_id);
+ iwl_mvm_stop_ap_ibss(hw, vif, link_conf);
}
static void iwl_mvm_stop_ibss(struct ieee80211_hw *hw,
struct ieee80211_vif *vif)
{
- iwl_mvm_stop_ap_ibss(hw, vif, 0);
+ iwl_mvm_stop_ap_ibss(hw, vif, &vif->bss_conf);
}
static void
}
static int rtw_ops_start_ap(struct ieee80211_hw *hw,
- struct ieee80211_vif *vif, unsigned int link_id)
+ struct ieee80211_vif *vif,
+ struct ieee80211_bss_conf *link_conf)
{
struct rtw_dev *rtwdev = hw->priv;
struct rtw_chip_info *chip = rtwdev->chip;
}
static int rtw89_ops_start_ap(struct ieee80211_hw *hw,
- struct ieee80211_vif *vif, unsigned int link_id)
+ struct ieee80211_vif *vif,
+ struct ieee80211_bss_conf *link_conf)
{
struct rtw89_dev *rtwdev = hw->priv;
struct rtw89_vif *rtwvif = (struct rtw89_vif *)vif->drv_priv;
static
void rtw89_ops_stop_ap(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
- unsigned int link_id)
+ struct ieee80211_bss_conf *link_conf)
{
struct rtw89_dev *rtwdev = hw->priv;
struct rtw89_vif *rtwvif = (struct rtw89_vif *)vif->drv_priv;
}
int wfx_start_ap(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
- unsigned int link_id)
+ struct ieee80211_bss_conf *link_conf)
{
struct wfx_vif *wvif = (struct wfx_vif *)vif->drv_priv;
struct wfx_dev *wdev = wvif->wdev;
}
void wfx_stop_ap(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
- unsigned int link_id)
+ struct ieee80211_bss_conf *link_conf)
{
struct wfx_vif *wvif = (struct wfx_vif *)vif->drv_priv;
int wfx_add_interface(struct ieee80211_hw *hw, struct ieee80211_vif *vif);
void wfx_remove_interface(struct ieee80211_hw *hw, struct ieee80211_vif *vif);
int wfx_start_ap(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
- unsigned int link_id);
+ struct ieee80211_bss_conf *link_conf);
void wfx_stop_ap(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
- unsigned int link_id);
+ struct ieee80211_bss_conf *link_conf);
int wfx_join_ibss(struct ieee80211_hw *hw, struct ieee80211_vif *vif);
void wfx_leave_ibss(struct ieee80211_hw *hw, struct ieee80211_vif *vif);
int wfx_conf_tx(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
u64 changed);
int (*start_ap)(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
- unsigned int link_id);
+ struct ieee80211_bss_conf *link_conf);
void (*stop_ap)(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
- unsigned int link_id);
+ struct ieee80211_bss_conf *link_conf);
u64 (*prepare_multicast)(struct ieee80211_hw *hw,
struct netdev_hw_addr_list *mc_list);
changed |= BSS_CHANGED_UNSOL_BCAST_PROBE_RESP;
}
- err = drv_start_ap(sdata->local, sdata, link_id);
+ err = drv_start_ap(sdata->local, sdata, link_conf);
if (err) {
old = sdata_dereference(link->u.ap.beacon, sdata);
GFP_KERNEL);
}
- drv_stop_ap(sdata->local, sdata, link_id);
+ drv_stop_ap(sdata->local, sdata, link_conf);
/* free all potentially still buffered bcast frames */
local->total_ps_buffered -= skb_queue_len(&sdata->u.ap.ps.bc_buf);
static inline int drv_start_ap(struct ieee80211_local *local,
struct ieee80211_sub_if_data *sdata,
- unsigned int link_id)
+ struct ieee80211_bss_conf *link_conf)
{
int ret = 0;
+ /* make sure link_conf is protected */
+ sdata_assert_lock(sdata);
+
might_sleep();
if (!check_sdata_in_driver(sdata))
return -EIO;
- trace_drv_start_ap(local, sdata, link_id);
+ trace_drv_start_ap(local, sdata, link_conf);
if (local->ops->start_ap)
- ret = local->ops->start_ap(&local->hw, &sdata->vif, link_id);
+ ret = local->ops->start_ap(&local->hw, &sdata->vif, link_conf);
trace_drv_return_int(local, ret);
return ret;
}
static inline void drv_stop_ap(struct ieee80211_local *local,
struct ieee80211_sub_if_data *sdata,
- unsigned int link_id)
+ struct ieee80211_bss_conf *link_conf)
{
+ /* make sure link_conf is protected */
+ sdata_assert_lock(sdata);
+
if (!check_sdata_in_driver(sdata))
return;
- trace_drv_stop_ap(local, sdata, link_id);
+ trace_drv_stop_ap(local, sdata, link_conf);
if (local->ops->stop_ap)
- local->ops->stop_ap(&local->hw, &sdata->vif, link_id);
+ local->ops->stop_ap(&local->hw, &sdata->vif, link_conf);
trace_drv_return_void(local);
}
TRACE_EVENT(drv_start_ap,
TP_PROTO(struct ieee80211_local *local,
struct ieee80211_sub_if_data *sdata,
- unsigned int link_id),
+ struct ieee80211_bss_conf *link_conf),
- TP_ARGS(local, sdata, link_id),
+ TP_ARGS(local, sdata, link_conf),
TP_STRUCT__entry(
LOCAL_ENTRY
),
TP_fast_assign(
- struct ieee80211_bss_conf *info =
- sdata_dereference(sdata->vif.link_conf[link_id], sdata);
-
LOCAL_ASSIGN;
VIF_ASSIGN;
- __entry->link_id = link_id;
- if (info) {
- __entry->dtimper = info->dtim_period;
- __entry->bcnint = info->beacon_int;
- __entry->hidden_ssid = info->hidden_ssid;
- }
+ __entry->link_id = link_conf->link_id;
+ __entry->dtimper = link_conf->dtim_period;
+ __entry->bcnint = link_conf->beacon_int;
+ __entry->hidden_ssid = link_conf->hidden_ssid;
memcpy(__get_dynamic_array(ssid),
sdata->vif.cfg.ssid,
sdata->vif.cfg.ssid_len);
TRACE_EVENT(drv_stop_ap,
TP_PROTO(struct ieee80211_local *local,
struct ieee80211_sub_if_data *sdata,
- unsigned int link_id),
+ struct ieee80211_bss_conf *link_conf),
- TP_ARGS(local, sdata, link_id),
+ TP_ARGS(local, sdata, link_conf),
TP_STRUCT__entry(
LOCAL_ENTRY
TP_fast_assign(
LOCAL_ASSIGN;
VIF_ASSIGN;
- __entry->link_id = link_id;
+ __entry->link_id = link_conf->link_id;
),
TP_printk(
changed |= BSS_CHANGED_AP_PROBE_RESP;
if (rcu_access_pointer(sdata->deflink.u.ap.beacon))
- drv_start_ap(local, sdata, 0);
+ drv_start_ap(local, sdata,
+ sdata->deflink.conf);
}
fallthrough;
case NL80211_IFTYPE_MESH_POINT: