mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
synced 2025-01-07 14:32:23 +00:00
wifi: mac80211: pass the link id in start/stop ap
In start_ap and stop_ap mac80211 callbacks pass the link_id to the drivers. Signed-off-by: Shaul Triebitz <shaul.triebitz@intel.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
This commit is contained in:
parent
d9f83f22a7
commit
ae7ba17b49
@ -2396,7 +2396,8 @@ static void iwl_mvm_bss_info_changed_station(struct iwl_mvm *mvm,
|
|||||||
}
|
}
|
||||||
|
|
||||||
static int iwl_mvm_start_ap_ibss(struct ieee80211_hw *hw,
|
static int iwl_mvm_start_ap_ibss(struct ieee80211_hw *hw,
|
||||||
struct ieee80211_vif *vif)
|
struct ieee80211_vif *vif,
|
||||||
|
unsigned int link_id)
|
||||||
{
|
{
|
||||||
struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw);
|
struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw);
|
||||||
struct iwl_mvm_vif *mvmvif = iwl_mvm_vif_from_mac80211(vif);
|
struct iwl_mvm_vif *mvmvif = iwl_mvm_vif_from_mac80211(vif);
|
||||||
@ -2522,8 +2523,22 @@ static int iwl_mvm_start_ap_ibss(struct ieee80211_hw *hw,
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void iwl_mvm_stop_ap_ibss(struct ieee80211_hw *hw,
|
static int iwl_mvm_start_ap(struct ieee80211_hw *hw,
|
||||||
|
struct ieee80211_vif *vif,
|
||||||
|
unsigned int link_id)
|
||||||
|
{
|
||||||
|
return iwl_mvm_start_ap_ibss(hw, vif, link_id);
|
||||||
|
}
|
||||||
|
|
||||||
|
static int iwl_mvm_start_ibss(struct ieee80211_hw *hw,
|
||||||
struct ieee80211_vif *vif)
|
struct ieee80211_vif *vif)
|
||||||
|
{
|
||||||
|
return iwl_mvm_start_ap_ibss(hw, vif, 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void iwl_mvm_stop_ap_ibss(struct ieee80211_hw *hw,
|
||||||
|
struct ieee80211_vif *vif,
|
||||||
|
unsigned int link_id)
|
||||||
{
|
{
|
||||||
struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw);
|
struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw);
|
||||||
struct iwl_mvm_vif *mvmvif = iwl_mvm_vif_from_mac80211(vif);
|
struct iwl_mvm_vif *mvmvif = iwl_mvm_vif_from_mac80211(vif);
|
||||||
@ -2586,6 +2601,19 @@ static void iwl_mvm_stop_ap_ibss(struct ieee80211_hw *hw,
|
|||||||
mutex_unlock(&mvm->mutex);
|
mutex_unlock(&mvm->mutex);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void iwl_mvm_stop_ap(struct ieee80211_hw *hw,
|
||||||
|
struct ieee80211_vif *vif,
|
||||||
|
unsigned int link_id)
|
||||||
|
{
|
||||||
|
iwl_mvm_stop_ap_ibss(hw, vif, link_id);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void iwl_mvm_stop_ibss(struct ieee80211_hw *hw,
|
||||||
|
struct ieee80211_vif *vif)
|
||||||
|
{
|
||||||
|
iwl_mvm_stop_ap_ibss(hw, vif, 0);
|
||||||
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
iwl_mvm_bss_info_changed_ap_ibss(struct iwl_mvm *mvm,
|
iwl_mvm_bss_info_changed_ap_ibss(struct iwl_mvm *mvm,
|
||||||
struct ieee80211_vif *vif,
|
struct ieee80211_vif *vif,
|
||||||
@ -5408,10 +5436,10 @@ const struct ieee80211_ops iwl_mvm_hw_ops = {
|
|||||||
.unassign_vif_chanctx = iwl_mvm_unassign_vif_chanctx,
|
.unassign_vif_chanctx = iwl_mvm_unassign_vif_chanctx,
|
||||||
.switch_vif_chanctx = iwl_mvm_switch_vif_chanctx,
|
.switch_vif_chanctx = iwl_mvm_switch_vif_chanctx,
|
||||||
|
|
||||||
.start_ap = iwl_mvm_start_ap_ibss,
|
.start_ap = iwl_mvm_start_ap,
|
||||||
.stop_ap = iwl_mvm_stop_ap_ibss,
|
.stop_ap = iwl_mvm_stop_ap,
|
||||||
.join_ibss = iwl_mvm_start_ap_ibss,
|
.join_ibss = iwl_mvm_start_ibss,
|
||||||
.leave_ibss = iwl_mvm_stop_ap_ibss,
|
.leave_ibss = iwl_mvm_stop_ibss,
|
||||||
|
|
||||||
.tx_last_beacon = iwl_mvm_tx_last_beacon,
|
.tx_last_beacon = iwl_mvm_tx_last_beacon,
|
||||||
|
|
||||||
|
@ -429,7 +429,8 @@ static void rtw_ops_bss_info_changed(struct ieee80211_hw *hw,
|
|||||||
mutex_unlock(&rtwdev->mutex);
|
mutex_unlock(&rtwdev->mutex);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int rtw_ops_start_ap(struct ieee80211_hw *hw, struct ieee80211_vif *vif)
|
static int rtw_ops_start_ap(struct ieee80211_hw *hw,
|
||||||
|
struct ieee80211_vif *vif, unsigned int link_id)
|
||||||
{
|
{
|
||||||
struct rtw_dev *rtwdev = hw->priv;
|
struct rtw_dev *rtwdev = hw->priv;
|
||||||
struct rtw_chip_info *chip = rtwdev->chip;
|
struct rtw_chip_info *chip = rtwdev->chip;
|
||||||
|
@ -381,7 +381,8 @@ static void rtw89_ops_bss_info_changed(struct ieee80211_hw *hw,
|
|||||||
mutex_unlock(&rtwdev->mutex);
|
mutex_unlock(&rtwdev->mutex);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int rtw89_ops_start_ap(struct ieee80211_hw *hw, struct ieee80211_vif *vif)
|
static int rtw89_ops_start_ap(struct ieee80211_hw *hw,
|
||||||
|
struct ieee80211_vif *vif, unsigned int link_id)
|
||||||
{
|
{
|
||||||
struct rtw89_dev *rtwdev = hw->priv;
|
struct rtw89_dev *rtwdev = hw->priv;
|
||||||
struct rtw89_vif *rtwvif = (struct rtw89_vif *)vif->drv_priv;
|
struct rtw89_vif *rtwvif = (struct rtw89_vif *)vif->drv_priv;
|
||||||
@ -401,7 +402,8 @@ static int rtw89_ops_start_ap(struct ieee80211_hw *hw, struct ieee80211_vif *vif
|
|||||||
}
|
}
|
||||||
|
|
||||||
static
|
static
|
||||||
void rtw89_ops_stop_ap(struct ieee80211_hw *hw, struct ieee80211_vif *vif)
|
void rtw89_ops_stop_ap(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
|
||||||
|
unsigned int link_id)
|
||||||
{
|
{
|
||||||
struct rtw89_dev *rtwdev = hw->priv;
|
struct rtw89_dev *rtwdev = hw->priv;
|
||||||
struct rtw89_vif *rtwvif = (struct rtw89_vif *)vif->drv_priv;
|
struct rtw89_vif *rtwvif = (struct rtw89_vif *)vif->drv_priv;
|
||||||
|
@ -378,7 +378,8 @@ static void wfx_set_mfp_ap(struct wfx_vif *wvif)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int wfx_start_ap(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 wfx_vif *wvif = (struct wfx_vif *)vif->drv_priv;
|
struct wfx_vif *wvif = (struct wfx_vif *)vif->drv_priv;
|
||||||
struct wfx_dev *wdev = wvif->wdev;
|
struct wfx_dev *wdev = wvif->wdev;
|
||||||
@ -396,7 +397,8 @@ int wfx_start_ap(struct ieee80211_hw *hw, struct ieee80211_vif *vif)
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
void wfx_stop_ap(struct ieee80211_hw *hw, struct ieee80211_vif *vif)
|
void wfx_stop_ap(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
|
||||||
|
unsigned int link_id)
|
||||||
{
|
{
|
||||||
struct wfx_vif *wvif = (struct wfx_vif *)vif->drv_priv;
|
struct wfx_vif *wvif = (struct wfx_vif *)vif->drv_priv;
|
||||||
|
|
||||||
|
@ -29,8 +29,10 @@ void wfx_configure_filter(struct ieee80211_hw *hw, unsigned int changed_flags,
|
|||||||
|
|
||||||
int wfx_add_interface(struct ieee80211_hw *hw, struct ieee80211_vif *vif);
|
int wfx_add_interface(struct ieee80211_hw *hw, struct ieee80211_vif *vif);
|
||||||
void wfx_remove_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);
|
int wfx_start_ap(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
|
||||||
void wfx_stop_ap(struct ieee80211_hw *hw, struct ieee80211_vif *vif);
|
unsigned int link_id);
|
||||||
|
void wfx_stop_ap(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
|
||||||
|
unsigned int link_id);
|
||||||
int wfx_join_ibss(struct ieee80211_hw *hw, struct ieee80211_vif *vif);
|
int wfx_join_ibss(struct ieee80211_hw *hw, struct ieee80211_vif *vif);
|
||||||
void wfx_leave_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,
|
int wfx_conf_tx(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
|
||||||
|
@ -4084,8 +4084,10 @@ struct ieee80211_ops {
|
|||||||
struct ieee80211_vif *vif,
|
struct ieee80211_vif *vif,
|
||||||
unsigned int link_id, u64 changed);
|
unsigned int link_id, u64 changed);
|
||||||
|
|
||||||
int (*start_ap)(struct ieee80211_hw *hw, struct ieee80211_vif *vif);
|
int (*start_ap)(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
|
||||||
void (*stop_ap)(struct ieee80211_hw *hw, struct ieee80211_vif *vif);
|
unsigned int link_id);
|
||||||
|
void (*stop_ap)(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
|
||||||
|
unsigned int link_id);
|
||||||
|
|
||||||
u64 (*prepare_multicast)(struct ieee80211_hw *hw,
|
u64 (*prepare_multicast)(struct ieee80211_hw *hw,
|
||||||
struct netdev_hw_addr_list *mc_list);
|
struct netdev_hw_addr_list *mc_list);
|
||||||
|
@ -1287,7 +1287,7 @@ static int ieee80211_start_ap(struct wiphy *wiphy, struct net_device *dev,
|
|||||||
changed |= BSS_CHANGED_UNSOL_BCAST_PROBE_RESP;
|
changed |= BSS_CHANGED_UNSOL_BCAST_PROBE_RESP;
|
||||||
}
|
}
|
||||||
|
|
||||||
err = drv_start_ap(sdata->local, sdata);
|
err = drv_start_ap(sdata->local, sdata, link_id);
|
||||||
if (err) {
|
if (err) {
|
||||||
old = sdata_dereference(link->u.ap.beacon, sdata);
|
old = sdata_dereference(link->u.ap.beacon, sdata);
|
||||||
|
|
||||||
@ -1442,7 +1442,7 @@ static int ieee80211_stop_ap(struct wiphy *wiphy, struct net_device *dev,
|
|||||||
GFP_KERNEL);
|
GFP_KERNEL);
|
||||||
}
|
}
|
||||||
|
|
||||||
drv_stop_ap(sdata->local, sdata);
|
drv_stop_ap(sdata->local, sdata, link_id);
|
||||||
|
|
||||||
/* free all potentially still buffered bcast frames */
|
/* free all potentially still buffered bcast frames */
|
||||||
local->total_ps_buffered -= skb_queue_len(&sdata->u.ap.ps.bc_buf);
|
local->total_ps_buffered -= skb_queue_len(&sdata->u.ap.ps.bc_buf);
|
||||||
|
@ -985,7 +985,8 @@ int drv_switch_vif_chanctx(struct ieee80211_local *local,
|
|||||||
int n_vifs, enum ieee80211_chanctx_switch_mode mode);
|
int n_vifs, enum ieee80211_chanctx_switch_mode mode);
|
||||||
|
|
||||||
static inline int drv_start_ap(struct ieee80211_local *local,
|
static inline int drv_start_ap(struct ieee80211_local *local,
|
||||||
struct ieee80211_sub_if_data *sdata)
|
struct ieee80211_sub_if_data *sdata,
|
||||||
|
unsigned int link_id)
|
||||||
{
|
{
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
|
|
||||||
@ -994,22 +995,24 @@ static inline int drv_start_ap(struct ieee80211_local *local,
|
|||||||
if (!check_sdata_in_driver(sdata))
|
if (!check_sdata_in_driver(sdata))
|
||||||
return -EIO;
|
return -EIO;
|
||||||
|
|
||||||
trace_drv_start_ap(local, sdata, &sdata->vif.bss_conf);
|
trace_drv_start_ap(local, sdata, sdata->vif.link_conf[link_id],
|
||||||
|
link_id);
|
||||||
if (local->ops->start_ap)
|
if (local->ops->start_ap)
|
||||||
ret = local->ops->start_ap(&local->hw, &sdata->vif);
|
ret = local->ops->start_ap(&local->hw, &sdata->vif, link_id);
|
||||||
trace_drv_return_int(local, ret);
|
trace_drv_return_int(local, ret);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline void drv_stop_ap(struct ieee80211_local *local,
|
static inline void drv_stop_ap(struct ieee80211_local *local,
|
||||||
struct ieee80211_sub_if_data *sdata)
|
struct ieee80211_sub_if_data *sdata,
|
||||||
|
unsigned int link_id)
|
||||||
{
|
{
|
||||||
if (!check_sdata_in_driver(sdata))
|
if (!check_sdata_in_driver(sdata))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
trace_drv_stop_ap(local, sdata);
|
trace_drv_stop_ap(local, sdata, link_id);
|
||||||
if (local->ops->stop_ap)
|
if (local->ops->stop_ap)
|
||||||
local->ops->stop_ap(&local->hw, &sdata->vif);
|
local->ops->stop_ap(&local->hw, &sdata->vif, link_id);
|
||||||
trace_drv_return_void(local);
|
trace_drv_return_void(local);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1752,13 +1752,15 @@ DEFINE_EVENT(local_sdata_chanctx, drv_unassign_vif_chanctx,
|
|||||||
TRACE_EVENT(drv_start_ap,
|
TRACE_EVENT(drv_start_ap,
|
||||||
TP_PROTO(struct ieee80211_local *local,
|
TP_PROTO(struct ieee80211_local *local,
|
||||||
struct ieee80211_sub_if_data *sdata,
|
struct ieee80211_sub_if_data *sdata,
|
||||||
struct ieee80211_bss_conf *info),
|
struct ieee80211_bss_conf *info,
|
||||||
|
unsigned int link_id),
|
||||||
|
|
||||||
TP_ARGS(local, sdata, info),
|
TP_ARGS(local, sdata, info, link_id),
|
||||||
|
|
||||||
TP_STRUCT__entry(
|
TP_STRUCT__entry(
|
||||||
LOCAL_ENTRY
|
LOCAL_ENTRY
|
||||||
VIF_ENTRY
|
VIF_ENTRY
|
||||||
|
__field(u32, link_id)
|
||||||
__field(u8, dtimper)
|
__field(u8, dtimper)
|
||||||
__field(u16, bcnint)
|
__field(u16, bcnint)
|
||||||
__dynamic_array(u8, ssid, sdata->vif.cfg.ssid_len)
|
__dynamic_array(u8, ssid, sdata->vif.cfg.ssid_len)
|
||||||
@ -1768,6 +1770,7 @@ TRACE_EVENT(drv_start_ap,
|
|||||||
TP_fast_assign(
|
TP_fast_assign(
|
||||||
LOCAL_ASSIGN;
|
LOCAL_ASSIGN;
|
||||||
VIF_ASSIGN;
|
VIF_ASSIGN;
|
||||||
|
__entry->link_id = link_id;
|
||||||
__entry->dtimper = info->dtim_period;
|
__entry->dtimper = info->dtim_period;
|
||||||
__entry->bcnint = info->beacon_int;
|
__entry->bcnint = info->beacon_int;
|
||||||
memcpy(__get_dynamic_array(ssid),
|
memcpy(__get_dynamic_array(ssid),
|
||||||
@ -1777,15 +1780,34 @@ TRACE_EVENT(drv_start_ap,
|
|||||||
),
|
),
|
||||||
|
|
||||||
TP_printk(
|
TP_printk(
|
||||||
LOCAL_PR_FMT VIF_PR_FMT,
|
LOCAL_PR_FMT VIF_PR_FMT " link id %u",
|
||||||
LOCAL_PR_ARG, VIF_PR_ARG
|
LOCAL_PR_ARG, VIF_PR_ARG, __entry->link_id
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
DEFINE_EVENT(local_sdata_evt, drv_stop_ap,
|
TRACE_EVENT(drv_stop_ap,
|
||||||
TP_PROTO(struct ieee80211_local *local,
|
TP_PROTO(struct ieee80211_local *local,
|
||||||
struct ieee80211_sub_if_data *sdata),
|
struct ieee80211_sub_if_data *sdata,
|
||||||
TP_ARGS(local, sdata)
|
unsigned int link_id),
|
||||||
|
|
||||||
|
TP_ARGS(local, sdata, link_id),
|
||||||
|
|
||||||
|
TP_STRUCT__entry(
|
||||||
|
LOCAL_ENTRY
|
||||||
|
VIF_ENTRY
|
||||||
|
__field(u32, link_id)
|
||||||
|
),
|
||||||
|
|
||||||
|
TP_fast_assign(
|
||||||
|
LOCAL_ASSIGN;
|
||||||
|
VIF_ASSIGN;
|
||||||
|
__entry->link_id = link_id;
|
||||||
|
),
|
||||||
|
|
||||||
|
TP_printk(
|
||||||
|
LOCAL_PR_FMT VIF_PR_FMT " link id %u",
|
||||||
|
LOCAL_PR_ARG, VIF_PR_ARG, __entry->link_id
|
||||||
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
TRACE_EVENT(drv_reconfig_complete,
|
TRACE_EVENT(drv_reconfig_complete,
|
||||||
|
@ -2568,7 +2568,7 @@ int ieee80211_reconfig(struct ieee80211_local *local)
|
|||||||
changed |= BSS_CHANGED_AP_PROBE_RESP;
|
changed |= BSS_CHANGED_AP_PROBE_RESP;
|
||||||
|
|
||||||
if (rcu_access_pointer(sdata->deflink.u.ap.beacon))
|
if (rcu_access_pointer(sdata->deflink.u.ap.beacon))
|
||||||
drv_start_ap(local, sdata);
|
drv_start_ap(local, sdata, 0);
|
||||||
}
|
}
|
||||||
fallthrough;
|
fallthrough;
|
||||||
case NL80211_IFTYPE_MESH_POINT:
|
case NL80211_IFTYPE_MESH_POINT:
|
||||||
|
Loading…
Reference in New Issue
Block a user