Commit 935ef47b authored by Lorenzo Bianconi's avatar Lorenzo Bianconi Committed by Johannes Berg

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: default avatarLorenzo Bianconi <lorenzo@kernel.org>
Link: https://lore.kernel.org/r/c687724e7b53556f7a2d9cbe3d11cdcf065cb687.1675255390.git.lorenzo@kernel.orgSigned-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
parent 9b89495e
...@@ -8936,12 +8936,11 @@ void cfg80211_bss_flush(struct wiphy *wiphy); ...@@ -8936,12 +8936,11 @@ void cfg80211_bss_flush(struct wiphy *wiphy);
/** /**
* cfg80211_bss_color_notify - notify about bss color event * cfg80211_bss_color_notify - notify about bss color event
* @dev: network device * @dev: network device
* @gfp: allocation flags
* @cmd: the actual event we want to notify * @cmd: the actual event we want to notify
* @count: the number of TBTTs until the color change happens * @count: the number of TBTTs until the color change happens
* @color_bitmap: representations of the colors that the local BSS is aware of * @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, enum nl80211_commands cmd, u8 count,
u64 color_bitmap); u64 color_bitmap);
...@@ -8952,10 +8951,9 @@ int cfg80211_bss_color_notify(struct net_device *dev, gfp_t gfp, ...@@ -8952,10 +8951,9 @@ int cfg80211_bss_color_notify(struct net_device *dev, gfp_t gfp,
* @gfp: allocation flags * @gfp: allocation flags
*/ */
static inline int cfg80211_obss_color_collision_notify(struct net_device *dev, 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, return cfg80211_bss_color_notify(dev, NL80211_CMD_OBSS_COLOR_COLLISION,
NL80211_CMD_OBSS_COLOR_COLLISION,
0, color_bitmap); 0, color_bitmap);
} }
...@@ -8969,8 +8967,7 @@ static inline int cfg80211_obss_color_collision_notify(struct net_device *dev, ...@@ -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, static inline int cfg80211_color_change_started_notify(struct net_device *dev,
u8 count) u8 count)
{ {
return cfg80211_bss_color_notify(dev, GFP_KERNEL, return cfg80211_bss_color_notify(dev, NL80211_CMD_COLOR_CHANGE_STARTED,
NL80211_CMD_COLOR_CHANGE_STARTED,
count, 0); count, 0);
} }
...@@ -8982,8 +8979,7 @@ static inline int cfg80211_color_change_started_notify(struct net_device *dev, ...@@ -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) static inline int cfg80211_color_change_aborted_notify(struct net_device *dev)
{ {
return cfg80211_bss_color_notify(dev, GFP_KERNEL, return cfg80211_bss_color_notify(dev, NL80211_CMD_COLOR_CHANGE_ABORTED,
NL80211_CMD_COLOR_CHANGE_ABORTED,
0, 0); 0, 0);
} }
...@@ -8995,7 +8991,7 @@ static inline int cfg80211_color_change_aborted_notify(struct net_device *dev) ...@@ -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) 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, NL80211_CMD_COLOR_CHANGE_COMPLETED,
0, 0); 0, 0);
} }
......
...@@ -4678,8 +4678,7 @@ void ieee80211_color_collision_detection_work(struct work_struct *work) ...@@ -4678,8 +4678,7 @@ void ieee80211_color_collision_detection_work(struct work_struct *work)
struct ieee80211_sub_if_data *sdata = link->sdata; struct ieee80211_sub_if_data *sdata = link->sdata;
sdata_lock(sdata); sdata_lock(sdata);
cfg80211_obss_color_collision_notify(sdata->dev, link->color_bitmap, cfg80211_obss_color_collision_notify(sdata->dev, link->color_bitmap);
GFP_KERNEL);
sdata_unlock(sdata); sdata_unlock(sdata);
} }
......
...@@ -19174,7 +19174,7 @@ void cfg80211_ch_switch_started_notify(struct net_device *dev, ...@@ -19174,7 +19174,7 @@ void cfg80211_ch_switch_started_notify(struct net_device *dev,
} }
EXPORT_SYMBOL(cfg80211_ch_switch_started_notify); 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, enum nl80211_commands cmd, u8 count,
u64 color_bitmap) u64 color_bitmap)
{ {
...@@ -19188,7 +19188,7 @@ int cfg80211_bss_color_notify(struct net_device *dev, gfp_t gfp, ...@@ -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); 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) if (!msg)
return -ENOMEM; return -ENOMEM;
...@@ -19211,7 +19211,7 @@ int cfg80211_bss_color_notify(struct net_device *dev, gfp_t gfp, ...@@ -19211,7 +19211,7 @@ int cfg80211_bss_color_notify(struct net_device *dev, gfp_t gfp,
genlmsg_end(msg, hdr); genlmsg_end(msg, hdr);
return genlmsg_multicast_netns(&nl80211_fam, wiphy_net(&rdev->wiphy), 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: nla_put_failure:
nlmsg_free(msg); nlmsg_free(msg);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment