mirror of
https://github.com/torvalds/linux
synced 2024-10-15 15:59:15 +00:00
wifi: cfg80211: add inform_bss op to update BSS
This new function is called from within the inform_bss(_frame)_data functions in order for the driver to update data that it is tracking. Signed-off-by: Benjamin Berg <benjamin.berg@intel.com> Signed-off-by: Gregory Greenman <gregory.greenman@intel.com> Link: https://lore.kernel.org/r/20230616094949.8d7781b0f965.I80041183072b75c081996a1a5a230b34aff5c668@changeid Signed-off-by: Johannes Berg <johannes.berg@intel.com>
This commit is contained in:
parent
6b7c93c143
commit
5db25290b7
|
@ -2720,6 +2720,7 @@ enum cfg80211_signal_type {
|
||||||
* the BSS that requested the scan in which the beacon/probe was received.
|
* the BSS that requested the scan in which the beacon/probe was received.
|
||||||
* @chains: bitmask for filled values in @chain_signal.
|
* @chains: bitmask for filled values in @chain_signal.
|
||||||
* @chain_signal: per-chain signal strength of last received BSS in dBm.
|
* @chain_signal: per-chain signal strength of last received BSS in dBm.
|
||||||
|
* @drv_data: Data to be passed through to @inform_bss
|
||||||
*/
|
*/
|
||||||
struct cfg80211_inform_bss {
|
struct cfg80211_inform_bss {
|
||||||
struct ieee80211_channel *chan;
|
struct ieee80211_channel *chan;
|
||||||
|
@ -2730,6 +2731,8 @@ struct cfg80211_inform_bss {
|
||||||
u8 parent_bssid[ETH_ALEN] __aligned(2);
|
u8 parent_bssid[ETH_ALEN] __aligned(2);
|
||||||
u8 chains;
|
u8 chains;
|
||||||
s8 chain_signal[IEEE80211_MAX_CHAINS];
|
s8 chain_signal[IEEE80211_MAX_CHAINS];
|
||||||
|
|
||||||
|
void *drv_data;
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -4101,6 +4104,13 @@ struct mgmt_frame_regs {
|
||||||
*
|
*
|
||||||
* @change_bss: Modify parameters for a given BSS.
|
* @change_bss: Modify parameters for a given BSS.
|
||||||
*
|
*
|
||||||
|
* @inform_bss: Called by cfg80211 while being informed about new BSS data
|
||||||
|
* for every BSS found within the reported data or frame. This is called
|
||||||
|
* from within the cfg8011 inform_bss handlers while holding the bss_lock.
|
||||||
|
* The data parameter is passed through from drv_data inside
|
||||||
|
* struct cfg80211_inform_bss.
|
||||||
|
* The new IE data for the BSS is explicitly passed.
|
||||||
|
*
|
||||||
* @set_txq_params: Set TX queue parameters
|
* @set_txq_params: Set TX queue parameters
|
||||||
*
|
*
|
||||||
* @libertas_set_mesh_channel: Only for backward compatibility for libertas,
|
* @libertas_set_mesh_channel: Only for backward compatibility for libertas,
|
||||||
|
@ -4488,6 +4498,9 @@ struct cfg80211_ops {
|
||||||
int (*change_bss)(struct wiphy *wiphy, struct net_device *dev,
|
int (*change_bss)(struct wiphy *wiphy, struct net_device *dev,
|
||||||
struct bss_parameters *params);
|
struct bss_parameters *params);
|
||||||
|
|
||||||
|
void (*inform_bss)(struct wiphy *wiphy, struct cfg80211_bss *bss,
|
||||||
|
const struct cfg80211_bss_ies *ies, void *data);
|
||||||
|
|
||||||
int (*set_txq_params)(struct wiphy *wiphy, struct net_device *dev,
|
int (*set_txq_params)(struct wiphy *wiphy, struct net_device *dev,
|
||||||
struct ieee80211_txq_params *params);
|
struct ieee80211_txq_params *params);
|
||||||
|
|
||||||
|
|
|
@ -407,6 +407,18 @@ static inline int rdev_change_bss(struct cfg80211_registered_device *rdev,
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static inline void rdev_inform_bss(struct cfg80211_registered_device *rdev,
|
||||||
|
struct cfg80211_bss *bss,
|
||||||
|
const struct cfg80211_bss_ies *ies,
|
||||||
|
void *drv_data)
|
||||||
|
|
||||||
|
{
|
||||||
|
trace_rdev_inform_bss(&rdev->wiphy, bss);
|
||||||
|
if (rdev->ops->inform_bss)
|
||||||
|
rdev->ops->inform_bss(&rdev->wiphy, bss, ies, drv_data);
|
||||||
|
trace_rdev_return_void(&rdev->wiphy);
|
||||||
|
}
|
||||||
|
|
||||||
static inline int rdev_set_txq_params(struct cfg80211_registered_device *rdev,
|
static inline int rdev_set_txq_params(struct cfg80211_registered_device *rdev,
|
||||||
struct net_device *dev,
|
struct net_device *dev,
|
||||||
struct ieee80211_txq_params *params)
|
struct ieee80211_txq_params *params)
|
||||||
|
|
|
@ -2027,6 +2027,8 @@ cfg80211_inform_single_bss_data(struct wiphy *wiphy,
|
||||||
if (!res)
|
if (!res)
|
||||||
goto drop;
|
goto drop;
|
||||||
|
|
||||||
|
rdev_inform_bss(rdev, &res->pub, ies, data->drv_data);
|
||||||
|
|
||||||
if (non_tx_data) {
|
if (non_tx_data) {
|
||||||
/* this is a nontransmitting bss, we need to add it to
|
/* this is a nontransmitting bss, we need to add it to
|
||||||
* transmitting bss' list if it is not there
|
* transmitting bss' list if it is not there
|
||||||
|
@ -2502,6 +2504,8 @@ cfg80211_inform_single_bss_frame_data(struct wiphy *wiphy,
|
||||||
if (!res)
|
if (!res)
|
||||||
goto drop;
|
goto drop;
|
||||||
|
|
||||||
|
rdev_inform_bss(rdev, &res->pub, ies, data->drv_data);
|
||||||
|
|
||||||
spin_unlock_bh(&rdev->bss_lock);
|
spin_unlock_bh(&rdev->bss_lock);
|
||||||
|
|
||||||
trace_cfg80211_return_bss(&res->pub);
|
trace_cfg80211_return_bss(&res->pub);
|
||||||
|
|
|
@ -1159,6 +1159,23 @@ TRACE_EVENT(rdev_change_bss,
|
||||||
__entry->ap_isolate, __entry->ht_opmode)
|
__entry->ap_isolate, __entry->ht_opmode)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
TRACE_EVENT(rdev_inform_bss,
|
||||||
|
TP_PROTO(struct wiphy *wiphy, struct cfg80211_bss *bss),
|
||||||
|
TP_ARGS(wiphy, bss),
|
||||||
|
TP_STRUCT__entry(
|
||||||
|
WIPHY_ENTRY
|
||||||
|
MAC_ENTRY(bssid)
|
||||||
|
CHAN_ENTRY
|
||||||
|
),
|
||||||
|
TP_fast_assign(
|
||||||
|
WIPHY_ASSIGN;
|
||||||
|
MAC_ASSIGN(bssid, bss->bssid);
|
||||||
|
CHAN_ASSIGN(bss->channel);
|
||||||
|
),
|
||||||
|
TP_printk(WIPHY_PR_FMT ", %pM, " CHAN_PR_FMT,
|
||||||
|
WIPHY_PR_ARG, __entry->bssid, CHAN_PR_ARG)
|
||||||
|
);
|
||||||
|
|
||||||
TRACE_EVENT(rdev_set_txq_params,
|
TRACE_EVENT(rdev_set_txq_params,
|
||||||
TP_PROTO(struct wiphy *wiphy, struct net_device *netdev,
|
TP_PROTO(struct wiphy *wiphy, struct net_device *netdev,
|
||||||
struct ieee80211_txq_params *params),
|
struct ieee80211_txq_params *params),
|
||||||
|
|
Loading…
Reference in a new issue