wifi: cfg80211: get rid of gfp in cfg80211_bss_color_notify

Since cfg80211_bss_color_notify() is now always run in non-atomic
context, get rid of gfp_t flags in the routine signature and always use
GFP_KERNEL for netlink message allocation.

Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Link: https://lore.kernel.org/r/c687724e7b53556f7a2d9cbe3d11cdcf065cb687.1675255390.git.lorenzo@kernel.org
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
This commit is contained in:
Lorenzo Bianconi 2023-02-01 13:48:30 +01:00 committed by Johannes Berg
parent 9b89495e47
commit 935ef47b16
3 changed files with 10 additions and 15 deletions

View file

@ -8936,12 +8936,11 @@ void cfg80211_bss_flush(struct wiphy *wiphy);
/**
* cfg80211_bss_color_notify - notify about bss color event
* @dev: network device
* @gfp: allocation flags
* @cmd: the actual event we want to notify
* @count: the number of TBTTs until the color change happens
* @color_bitmap: representations of the colors that the local BSS is aware of
*/
int cfg80211_bss_color_notify(struct net_device *dev, gfp_t gfp,
int cfg80211_bss_color_notify(struct net_device *dev,
enum nl80211_commands cmd, u8 count,
u64 color_bitmap);
@ -8952,10 +8951,9 @@ int cfg80211_bss_color_notify(struct net_device *dev, gfp_t gfp,
* @gfp: allocation flags
*/
static inline int cfg80211_obss_color_collision_notify(struct net_device *dev,
u64 color_bitmap, gfp_t gfp)
u64 color_bitmap)
{
return cfg80211_bss_color_notify(dev, gfp,
NL80211_CMD_OBSS_COLOR_COLLISION,
return cfg80211_bss_color_notify(dev, NL80211_CMD_OBSS_COLOR_COLLISION,
0, color_bitmap);
}
@ -8969,8 +8967,7 @@ static inline int cfg80211_obss_color_collision_notify(struct net_device *dev,
static inline int cfg80211_color_change_started_notify(struct net_device *dev,
u8 count)
{
return cfg80211_bss_color_notify(dev, GFP_KERNEL,
NL80211_CMD_COLOR_CHANGE_STARTED,
return cfg80211_bss_color_notify(dev, NL80211_CMD_COLOR_CHANGE_STARTED,
count, 0);
}
@ -8982,8 +8979,7 @@ static inline int cfg80211_color_change_started_notify(struct net_device *dev,
*/
static inline int cfg80211_color_change_aborted_notify(struct net_device *dev)
{
return cfg80211_bss_color_notify(dev, GFP_KERNEL,
NL80211_CMD_COLOR_CHANGE_ABORTED,
return cfg80211_bss_color_notify(dev, NL80211_CMD_COLOR_CHANGE_ABORTED,
0, 0);
}
@ -8995,7 +8991,7 @@ static inline int cfg80211_color_change_aborted_notify(struct net_device *dev)
*/
static inline int cfg80211_color_change_notify(struct net_device *dev)
{
return cfg80211_bss_color_notify(dev, GFP_KERNEL,
return cfg80211_bss_color_notify(dev,
NL80211_CMD_COLOR_CHANGE_COMPLETED,
0, 0);
}

View file

@ -4678,8 +4678,7 @@ void ieee80211_color_collision_detection_work(struct work_struct *work)
struct ieee80211_sub_if_data *sdata = link->sdata;
sdata_lock(sdata);
cfg80211_obss_color_collision_notify(sdata->dev, link->color_bitmap,
GFP_KERNEL);
cfg80211_obss_color_collision_notify(sdata->dev, link->color_bitmap);
sdata_unlock(sdata);
}

View file

@ -19174,7 +19174,7 @@ void cfg80211_ch_switch_started_notify(struct net_device *dev,
}
EXPORT_SYMBOL(cfg80211_ch_switch_started_notify);
int cfg80211_bss_color_notify(struct net_device *dev, gfp_t gfp,
int cfg80211_bss_color_notify(struct net_device *dev,
enum nl80211_commands cmd, u8 count,
u64 color_bitmap)
{
@ -19188,7 +19188,7 @@ int cfg80211_bss_color_notify(struct net_device *dev, gfp_t gfp,
trace_cfg80211_bss_color_notify(dev, cmd, count, color_bitmap);
msg = nlmsg_new(NLMSG_DEFAULT_SIZE, gfp);
msg = nlmsg_new(NLMSG_DEFAULT_SIZE, GFP_KERNEL);
if (!msg)
return -ENOMEM;
@ -19211,7 +19211,7 @@ int cfg80211_bss_color_notify(struct net_device *dev, gfp_t gfp,
genlmsg_end(msg, hdr);
return genlmsg_multicast_netns(&nl80211_fam, wiphy_net(&rdev->wiphy),
msg, 0, NL80211_MCGRP_MLME, gfp);
msg, 0, NL80211_MCGRP_MLME, GFP_KERNEL);
nla_put_failure:
nlmsg_free(msg);