Skip to contentSkip to conversation

wifi: mac80211: remove .config method requirement

PATCH New Johannes Berg 1 participant 1 message Oct 14

Subsystems (7)
lore
Share & tools
lore

Johannes Berg

author maintainer
#0 lore raw

PATCH 1/1 wifi: mac80211: remove .config method requirement

From: Johannes Berg <[email protected]>

Given chanctx support, driver don't really need to have a .config, so quite a few drivers now have an empty one. Allow it to be not set and remove those that are no longer needed.

---
 drivers/net/wireless/ath/ath12k/mac.c                 | 6 ------
 drivers/net/wireless/ath/ath12k/mac.h                 | 1 -
 drivers/net/wireless/ath/ath12k/wifi7/hw.c            | 1 -
 drivers/net/wireless/intel/iwlwifi/mld/mac80211.c     | 8 --------
 drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c     | 1 -
 drivers/net/wireless/intel/iwlwifi/mvm/mld-mac80211.c | 1 -
 drivers/net/wireless/intel/iwlwifi/mvm/mvm.h          | 5 -----
 drivers/net/wireless/mediatek/mt76/mt7996/main.c      | 6 ------
 drivers/net/wireless/purelifi/plfxlc/mac.c            | 6 ------
 drivers/net/wireless/silabs/wfx/main.c                | 1 -
 drivers/net/wireless/silabs/wfx/sta.c                 | 5 -----
 drivers/net/wireless/silabs/wfx/sta.h                 | 1 -
 include/net/mac80211.h                                | 2 +-
 net/mac80211/driver-ops.h                             | 5 +++--
 net/mac80211/main.c                                   | 2 +-
 15 files changed, 5 insertions(+), 46 deletions(-)
drivers/net/wireless/ath/ath12k/mac.c +0 -6
index 01f8c6572f65..c08216352c2c 100644
@@ -1584,12 +1584,6 @@ int ath12k_mac_vdev_stop(struct ath12k_link_vif *arvif)
 	return ret;
 }
 
-int ath12k_mac_op_config(struct ieee80211_hw *hw, int radio_idx, u32 changed)
-{
-	return 0;
-}
-EXPORT_SYMBOL(ath12k_mac_op_config);
-
 static int ath12k_mac_setup_bcn_p2p_ie(struct ath12k_link_vif *arvif,
 				       struct sk_buff *bcn)
 {
drivers/net/wireless/ath/ath12k/mac.h +0 -1
index ae44ebfd9bd9..61c2ec8865a3 100644
@@ -218,7 +218,6 @@ void ath12k_mac_op_remove_interface(struct ieee80211_hw *hw,
 				    struct ieee80211_vif *vif);
 void ath12k_mac_op_update_vif_offload(struct ieee80211_hw *hw,
 				      struct ieee80211_vif *vif);
-int ath12k_mac_op_config(struct ieee80211_hw *hw, int radio_idx, u32 changed);
 void ath12k_mac_op_link_info_changed(struct ieee80211_hw *hw,
 				     struct ieee80211_vif *vif,
 				     struct ieee80211_bss_conf *info,
drivers/net/wireless/ath/ath12k/wifi7/hw.c +0 -1
index b1c17cc197df..d3ae9e987fa9 100644
@@ -1183,7 +1183,6 @@ static const struct ieee80211_ops ath12k_ops_wifi7 = {
 	.add_interface                  = ath12k_mac_op_add_interface,
 	.remove_interface		= ath12k_mac_op_remove_interface,
 	.update_vif_offload		= ath12k_mac_op_update_vif_offload,
-	.config                         = ath12k_mac_op_config,
 	.link_info_changed              = ath12k_mac_op_link_info_changed,
 	.vif_cfg_changed		= ath12k_mac_op_vif_cfg_changed,
 	.change_vif_links               = ath12k_mac_op_change_vif_links,
drivers/net/wireless/intel/iwlwifi/mld/mac80211.c +0 -8
index e05bdbd3e1a9..99cbd279ce48 100644
@@ -652,13 +652,6 @@ void iwl_mld_mac80211_stop(struct ieee80211_hw *hw, bool suspend)
 			mld->scan.uid_status[i] = 0;
 }
 
-static
-int iwl_mld_mac80211_config(struct ieee80211_hw *hw, int radio_idx,
-			    u32 changed)
-{
-	return 0;
-}
-
 static
 int iwl_mld_mac80211_add_interface(struct ieee80211_hw *hw,
 				   struct ieee80211_vif *vif)
@@ -2921,7 +2914,6 @@ const struct ieee80211_ops iwl_mld_hw_ops = {
 	.tx = iwl_mld_mac80211_tx,
 	.start = iwl_mld_mac80211_start,
 	.stop = iwl_mld_mac80211_stop,
-	.config = iwl_mld_mac80211_config,
 	.get_antenna = iwl_mld_get_antenna,
 	.set_antenna = iwl_mld_set_antenna,
 	.add_interface = iwl_mld_mac80211_add_interface,
drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c +0 -1
index daa05339e3fb..937232882ea2 100644
@@ -6359,7 +6359,6 @@ const struct ieee80211_ops iwl_mvm_hw_ops = {
 	.stop = iwl_mvm_mac_stop,
 	.add_interface = iwl_mvm_mac_add_interface,
 	.remove_interface = iwl_mvm_mac_remove_interface,
-	.config = iwl_mvm_mac_config,
 	.prepare_multicast = iwl_mvm_prepare_multicast,
 	.configure_filter = iwl_mvm_configure_filter,
 	.config_iface_filter = iwl_mvm_config_iface_filter,
drivers/net/wireless/intel/iwlwifi/mvm/mld-mac80211.c +0 -1
index 6ea9a7c8da0c..5d1815528ac0 100644
@@ -897,7 +897,6 @@ const struct ieee80211_ops iwl_mvm_mld_hw_ops = {
 	.stop = iwl_mvm_mac_stop,
 	.add_interface = iwl_mvm_mld_mac_add_interface,
 	.remove_interface = iwl_mvm_mld_mac_remove_interface,
-	.config = iwl_mvm_mac_config,
 	.prepare_multicast = iwl_mvm_prepare_multicast,
 	.configure_filter = iwl_mvm_configure_filter,
 	.config_iface_filter = iwl_mvm_mld_config_iface_filter,
drivers/net/wireless/intel/iwlwifi/mvm/mvm.h +0 -5
index ae2ee8771f16..cfc0b0debfd8 100644
@@ -2704,11 +2704,6 @@ int iwl_mvm_mac_start(struct ieee80211_hw *hw);
 void iwl_mvm_mac_reconfig_complete(struct ieee80211_hw *hw,
 				   enum ieee80211_reconfig_type reconfig_type);
 void iwl_mvm_mac_stop(struct ieee80211_hw *hw, bool suspend);
-static inline int iwl_mvm_mac_config(struct ieee80211_hw *hw, int radio_idx,
-				     u32 changed)
-{
-	return 0;
-}
 
 u64 iwl_mvm_prepare_multicast(struct ieee80211_hw *hw,
 			      struct netdev_hw_addr_list *mc_list);
drivers/net/wireless/mediatek/mt76/mt7996/main.c +0 -6
index 9321c8146e2a..873c5aef4935 100644
@@ -752,11 +752,6 @@ static int mt7996_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd,
 	return err;
 }
 
-static int mt7996_config(struct ieee80211_hw *hw, int radio_idx, u32 changed)
-{
-	return 0;
-}
-
 static int
 mt7996_conf_tx(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
 	       unsigned int link_id, u16 queue,
@@ -3052,7 +3047,6 @@ const struct ieee80211_ops mt7996_ops = {
 	.stop = mt7996_stop,
 	.add_interface = mt7996_add_interface,
 	.remove_interface = mt7996_remove_interface,
-	.config = mt7996_config,
 	.conf_tx = mt7996_conf_tx,
 	.configure_filter = mt7996_configure_filter,
 	.vif_cfg_changed = mt7996_vif_cfg_changed,
drivers/net/wireless/purelifi/plfxlc/mac.c +0 -6
index a900421753ac..ad04730c8c0b 100644
@@ -526,11 +526,6 @@ static void plfxlc_op_remove_interface(struct ieee80211_hw *hw,
 	mac->vif = NULL;
 }
 
-static int plfxlc_op_config(struct ieee80211_hw *hw, int radio_idx, u32 changed)
-{
-	return 0;
-}
-
 #define SUPPORTED_FIF_FLAGS \
 	(FIF_ALLMULTI | FIF_FCSFAIL | FIF_CONTROL | \
 	 FIF_OTHER_BSS | FIF_BCN_PRBRESP_PROMISC)
@@ -690,7 +685,6 @@ static const struct ieee80211_ops plfxlc_ops = {
 	.add_interface = plfxlc_op_add_interface,
 	.remove_interface = plfxlc_op_remove_interface,
 	.set_rts_threshold = plfxlc_set_rts_threshold,
-	.config = plfxlc_op_config,
 	.configure_filter = plfxlc_op_configure_filter,
 	.bss_info_changed = plfxlc_op_bss_info_changed,
 	.get_stats = plfxlc_get_stats,
drivers/net/wireless/silabs/wfx/main.c +0 -1
index 16d5b51f6f03..9c40d738e5a1 100644
@@ -132,7 +132,6 @@ static const struct ieee80211_ops wfx_ops = {
 	.stop                    = wfx_stop,
 	.add_interface           = wfx_add_interface,
 	.remove_interface        = wfx_remove_interface,
-	.config                  = wfx_config,
 	.tx                      = wfx_tx,
 	.wake_tx_queue           = ieee80211_handle_wake_tx_queue,
 	.join_ibss               = wfx_join_ibss,
drivers/net/wireless/silabs/wfx/sta.c +0 -5
index d12fcc755701..210d2c07db87 100644
@@ -706,11 +706,6 @@ void wfx_unassign_vif_chanctx(struct ieee80211_hw *hw, struct ieee80211_vif *vif
 	wvif->channel = NULL;
 }
 
-int wfx_config(struct ieee80211_hw *hw, int radio_idx, u32 changed)
-{
-	return 0;
-}
-
 int wfx_add_interface(struct ieee80211_hw *hw, struct ieee80211_vif *vif)
 {
 	int i;
drivers/net/wireless/silabs/wfx/sta.h +0 -1
index b4812b294f3c..1d301b0f8d33 100644
@@ -21,7 +21,6 @@ struct wfx_sta_priv {
 /* mac80211 interface */
 int wfx_start(struct ieee80211_hw *hw);
 void wfx_stop(struct ieee80211_hw *hw, bool suspend);
-int wfx_config(struct ieee80211_hw *hw, int radio_idx, u32 changed);
 int wfx_set_rts_threshold(struct ieee80211_hw *hw, int radio_idx, u32 value);
 void wfx_set_default_unicast_key(struct ieee80211_hw *hw, struct ieee80211_vif *vif, int idx);
 void wfx_configure_filter(struct ieee80211_hw *hw, unsigned int changed_flags,
include/net/mac80211.h +1 -1
index a1a6409b44c1..a9ad89e77858 100644
@@ -4162,7 +4162,7 @@ struct ieee80211_prep_tx_info {
  * @config: Handler for configuration requests. IEEE 802.11 code calls this
  *	function to change hardware configuration, e.g., channel.
  *	This function should never fail but returns a negative error code
- *	if it does. The callback can sleep.
+ *	if it does. The callback is optional and can sleep.
  *
  * @bss_info_changed: Handler for configuration requests related to BSS
  *	parameters that may vary during BSS's lifespan, and may affect low
net/mac80211/driver-ops.h +3 -2
index 83dd15f2daf6..c401d27bb502 100644
@@ -147,13 +147,14 @@ void drv_remove_interface(struct ieee80211_local *local,
 static inline int drv_config(struct ieee80211_local *local, int radio_idx,
 			     u32 changed)
 {
-	int ret;
+	int ret = 0;
 
 	might_sleep();
 	lockdep_assert_wiphy(local->hw.wiphy);
 
 	trace_drv_config(local, radio_idx, changed);
-	ret = local->ops->config(&local->hw, radio_idx, changed);
+	if (local->ops->config)
+		ret = local->ops->config(&local->hw, radio_idx, changed);
 	trace_drv_return_int(local, ret);
 	return ret;
 }
net/mac80211/main.c +1 -1
index 76e85754deff..7d27e707f8fd 100644
@@ -804,7 +804,7 @@ struct ieee80211_hw *ieee80211_alloc_hw_nm(size_t priv_data_len,
 	struct wiphy *wiphy;
 	bool emulate_chanctx;
 
-	if (WARN_ON(!ops->tx || !ops->start || !ops->stop || !ops->config ||
+	if (WARN_ON(!ops->tx || !ops->start || !ops->stop ||
 		    !ops->add_interface || !ops->remove_interface ||
 		    !ops->configure_filter || !ops->wake_tx_queue))
 		return NULL;
Signature · 1 line
2.56.0