Commit a2906ea6 authored by Johannes Berg's avatar Johannes Berg

wifi: iwlwifi: mvm: make internal callback structs const

There's no need for these to be writable, so they can
be const (and static).
Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
Signed-off-by: default avatarGregory Greenman <gregory.greenman@intel.com>
Link: https://lore.kernel.org/r/20230524203151.c41eb6687868.I2dac1158e5723187bda1973aa49fde8a794621c8@changeidSigned-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
parent d464550b
...@@ -3054,7 +3054,7 @@ static void iwl_mvm_bss_info_changed(struct ieee80211_hw *hw, ...@@ -3054,7 +3054,7 @@ static void iwl_mvm_bss_info_changed(struct ieee80211_hw *hw,
struct ieee80211_bss_conf *bss_conf, struct ieee80211_bss_conf *bss_conf,
u64 changes) u64 changes)
{ {
struct iwl_mvm_bss_info_changed_ops callbacks = { static const struct iwl_mvm_bss_info_changed_ops callbacks = {
.bss_info_changed_sta = iwl_mvm_bss_info_changed_station, .bss_info_changed_sta = iwl_mvm_bss_info_changed_station,
.bss_info_changed_ap_ibss = iwl_mvm_bss_info_changed_ap_ibss, .bss_info_changed_ap_ibss = iwl_mvm_bss_info_changed_ap_ibss,
}; };
...@@ -3067,7 +3067,7 @@ void ...@@ -3067,7 +3067,7 @@ void
iwl_mvm_bss_info_changed_common(struct ieee80211_hw *hw, iwl_mvm_bss_info_changed_common(struct ieee80211_hw *hw,
struct ieee80211_vif *vif, struct ieee80211_vif *vif,
struct ieee80211_bss_conf *bss_conf, struct ieee80211_bss_conf *bss_conf,
struct iwl_mvm_bss_info_changed_ops *callbacks, const struct iwl_mvm_bss_info_changed_ops *callbacks,
u64 changes) u64 changes)
{ {
struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw); struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw);
...@@ -3564,7 +3564,7 @@ static int iwl_mvm_mac_sta_state(struct ieee80211_hw *hw, ...@@ -3564,7 +3564,7 @@ static int iwl_mvm_mac_sta_state(struct ieee80211_hw *hw,
enum ieee80211_sta_state old_state, enum ieee80211_sta_state old_state,
enum ieee80211_sta_state new_state) enum ieee80211_sta_state new_state)
{ {
struct iwl_mvm_sta_state_ops callbacks = { static const struct iwl_mvm_sta_state_ops callbacks = {
.add_sta = iwl_mvm_add_sta, .add_sta = iwl_mvm_add_sta,
.update_sta = iwl_mvm_update_sta, .update_sta = iwl_mvm_update_sta,
.rm_sta = iwl_mvm_rm_sta, .rm_sta = iwl_mvm_rm_sta,
...@@ -3672,7 +3672,7 @@ static int ...@@ -3672,7 +3672,7 @@ static int
iwl_mvm_sta_state_notexist_to_none(struct iwl_mvm *mvm, iwl_mvm_sta_state_notexist_to_none(struct iwl_mvm *mvm,
struct ieee80211_vif *vif, struct ieee80211_vif *vif,
struct ieee80211_sta *sta, struct ieee80211_sta *sta,
struct iwl_mvm_sta_state_ops *callbacks) const struct iwl_mvm_sta_state_ops *callbacks)
{ {
struct iwl_mvm_vif *mvmvif = iwl_mvm_vif_from_mac80211(vif); struct iwl_mvm_vif *mvmvif = iwl_mvm_vif_from_mac80211(vif);
unsigned int i; unsigned int i;
...@@ -3721,7 +3721,7 @@ iwl_mvm_sta_state_auth_to_assoc(struct ieee80211_hw *hw, ...@@ -3721,7 +3721,7 @@ iwl_mvm_sta_state_auth_to_assoc(struct ieee80211_hw *hw,
struct iwl_mvm *mvm, struct iwl_mvm *mvm,
struct ieee80211_vif *vif, struct ieee80211_vif *vif,
struct ieee80211_sta *sta, struct ieee80211_sta *sta,
struct iwl_mvm_sta_state_ops *callbacks) const struct iwl_mvm_sta_state_ops *callbacks)
{ {
struct iwl_mvm_vif *mvmvif = iwl_mvm_vif_from_mac80211(vif); struct iwl_mvm_vif *mvmvif = iwl_mvm_vif_from_mac80211(vif);
struct iwl_mvm_sta *mvm_sta = iwl_mvm_sta_from_mac80211(sta); struct iwl_mvm_sta *mvm_sta = iwl_mvm_sta_from_mac80211(sta);
...@@ -3778,7 +3778,7 @@ static int ...@@ -3778,7 +3778,7 @@ static int
iwl_mvm_sta_state_assoc_to_authorized(struct iwl_mvm *mvm, iwl_mvm_sta_state_assoc_to_authorized(struct iwl_mvm *mvm,
struct ieee80211_vif *vif, struct ieee80211_vif *vif,
struct ieee80211_sta *sta, struct ieee80211_sta *sta,
struct iwl_mvm_sta_state_ops *callbacks) const struct iwl_mvm_sta_state_ops *callbacks)
{ {
struct iwl_mvm_vif *mvmvif = iwl_mvm_vif_from_mac80211(vif); struct iwl_mvm_vif *mvmvif = iwl_mvm_vif_from_mac80211(vif);
struct iwl_mvm_sta *mvm_sta = iwl_mvm_sta_from_mac80211(sta); struct iwl_mvm_sta *mvm_sta = iwl_mvm_sta_from_mac80211(sta);
...@@ -3813,7 +3813,7 @@ static int ...@@ -3813,7 +3813,7 @@ static int
iwl_mvm_sta_state_authorized_to_assoc(struct iwl_mvm *mvm, iwl_mvm_sta_state_authorized_to_assoc(struct iwl_mvm *mvm,
struct ieee80211_vif *vif, struct ieee80211_vif *vif,
struct ieee80211_sta *sta, struct ieee80211_sta *sta,
struct iwl_mvm_sta_state_ops *callbacks) const struct iwl_mvm_sta_state_ops *callbacks)
{ {
struct iwl_mvm_vif *mvmvif = iwl_mvm_vif_from_mac80211(vif); struct iwl_mvm_vif *mvmvif = iwl_mvm_vif_from_mac80211(vif);
struct iwl_mvm_sta *mvmsta = iwl_mvm_sta_from_mac80211(sta); struct iwl_mvm_sta *mvmsta = iwl_mvm_sta_from_mac80211(sta);
...@@ -3851,7 +3851,7 @@ int iwl_mvm_mac_sta_state_common(struct ieee80211_hw *hw, ...@@ -3851,7 +3851,7 @@ int iwl_mvm_mac_sta_state_common(struct ieee80211_hw *hw,
struct ieee80211_sta *sta, struct ieee80211_sta *sta,
enum ieee80211_sta_state old_state, enum ieee80211_sta_state old_state,
enum ieee80211_sta_state new_state, enum ieee80211_sta_state new_state,
struct iwl_mvm_sta_state_ops *callbacks) const struct iwl_mvm_sta_state_ops *callbacks)
{ {
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);
...@@ -4578,7 +4578,7 @@ static int iwl_mvm_roc(struct ieee80211_hw *hw, ...@@ -4578,7 +4578,7 @@ static int iwl_mvm_roc(struct ieee80211_hw *hw,
int duration, int duration,
enum ieee80211_roc_type type) enum ieee80211_roc_type type)
{ {
struct iwl_mvm_roc_ops ops = { static const struct iwl_mvm_roc_ops ops = {
.add_aux_sta_for_hs20 = iwl_mvm_add_aux_sta_for_hs20, .add_aux_sta_for_hs20 = iwl_mvm_add_aux_sta_for_hs20,
.switch_phy_ctxt = iwl_mvm_roc_switch_binding, .switch_phy_ctxt = iwl_mvm_roc_switch_binding,
}; };
...@@ -4590,7 +4590,7 @@ static int iwl_mvm_roc(struct ieee80211_hw *hw, ...@@ -4590,7 +4590,7 @@ static int iwl_mvm_roc(struct ieee80211_hw *hw,
int iwl_mvm_roc_common(struct ieee80211_hw *hw, struct ieee80211_vif *vif, int iwl_mvm_roc_common(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
struct ieee80211_channel *channel, int duration, struct ieee80211_channel *channel, int duration,
enum ieee80211_roc_type type, enum ieee80211_roc_type type,
struct iwl_mvm_roc_ops *ops) const struct iwl_mvm_roc_ops *ops)
{ {
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);
...@@ -5097,7 +5097,7 @@ static void iwl_mvm_unassign_vif_chanctx(struct ieee80211_hw *hw, ...@@ -5097,7 +5097,7 @@ static void iwl_mvm_unassign_vif_chanctx(struct ieee80211_hw *hw,
static int static int
iwl_mvm_switch_vif_chanctx_swap(struct iwl_mvm *mvm, iwl_mvm_switch_vif_chanctx_swap(struct iwl_mvm *mvm,
struct ieee80211_vif_chanctx_switch *vifs, struct ieee80211_vif_chanctx_switch *vifs,
struct iwl_mvm_switch_vif_chanctx_ops *ops) const struct iwl_mvm_switch_vif_chanctx_ops *ops)
{ {
int ret; int ret;
...@@ -5156,7 +5156,7 @@ iwl_mvm_switch_vif_chanctx_swap(struct iwl_mvm *mvm, ...@@ -5156,7 +5156,7 @@ iwl_mvm_switch_vif_chanctx_swap(struct iwl_mvm *mvm,
static int static int
iwl_mvm_switch_vif_chanctx_reassign(struct iwl_mvm *mvm, iwl_mvm_switch_vif_chanctx_reassign(struct iwl_mvm *mvm,
struct ieee80211_vif_chanctx_switch *vifs, struct ieee80211_vif_chanctx_switch *vifs,
struct iwl_mvm_switch_vif_chanctx_ops *ops) const struct iwl_mvm_switch_vif_chanctx_ops *ops)
{ {
int ret; int ret;
...@@ -5199,7 +5199,7 @@ iwl_mvm_switch_vif_chanctx_common(struct ieee80211_hw *hw, ...@@ -5199,7 +5199,7 @@ iwl_mvm_switch_vif_chanctx_common(struct ieee80211_hw *hw,
struct ieee80211_vif_chanctx_switch *vifs, struct ieee80211_vif_chanctx_switch *vifs,
int n_vifs, int n_vifs,
enum ieee80211_chanctx_switch_mode mode, enum ieee80211_chanctx_switch_mode mode,
struct iwl_mvm_switch_vif_chanctx_ops *ops) const struct iwl_mvm_switch_vif_chanctx_ops *ops)
{ {
struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw); struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw);
int ret; int ret;
...@@ -5228,7 +5228,7 @@ static int iwl_mvm_switch_vif_chanctx(struct ieee80211_hw *hw, ...@@ -5228,7 +5228,7 @@ static int iwl_mvm_switch_vif_chanctx(struct ieee80211_hw *hw,
int n_vifs, int n_vifs,
enum ieee80211_chanctx_switch_mode mode) enum ieee80211_chanctx_switch_mode mode)
{ {
struct iwl_mvm_switch_vif_chanctx_ops ops = { static const struct iwl_mvm_switch_vif_chanctx_ops ops = {
.__assign_vif_chanctx = __iwl_mvm_assign_vif_chanctx, .__assign_vif_chanctx = __iwl_mvm_assign_vif_chanctx,
.__unassign_vif_chanctx = __iwl_mvm_unassign_vif_chanctx, .__unassign_vif_chanctx = __iwl_mvm_unassign_vif_chanctx,
}; };
......
...@@ -492,7 +492,7 @@ static int iwl_mvm_mld_mac_sta_state(struct ieee80211_hw *hw, ...@@ -492,7 +492,7 @@ static int iwl_mvm_mld_mac_sta_state(struct ieee80211_hw *hw,
enum ieee80211_sta_state old_state, enum ieee80211_sta_state old_state,
enum ieee80211_sta_state new_state) enum ieee80211_sta_state new_state)
{ {
struct iwl_mvm_sta_state_ops callbacks = { static const struct iwl_mvm_sta_state_ops callbacks = {
.add_sta = iwl_mvm_mld_add_sta, .add_sta = iwl_mvm_mld_add_sta,
.update_sta = iwl_mvm_mld_update_sta, .update_sta = iwl_mvm_mld_update_sta,
.rm_sta = iwl_mvm_mld_rm_sta, .rm_sta = iwl_mvm_mld_rm_sta,
...@@ -779,7 +779,7 @@ iwl_mvm_mld_switch_vif_chanctx(struct ieee80211_hw *hw, ...@@ -779,7 +779,7 @@ iwl_mvm_mld_switch_vif_chanctx(struct ieee80211_hw *hw,
int n_vifs, int n_vifs,
enum ieee80211_chanctx_switch_mode mode) enum ieee80211_chanctx_switch_mode mode)
{ {
struct iwl_mvm_switch_vif_chanctx_ops ops = { static const struct iwl_mvm_switch_vif_chanctx_ops ops = {
.__assign_vif_chanctx = __iwl_mvm_mld_assign_vif_chanctx, .__assign_vif_chanctx = __iwl_mvm_mld_assign_vif_chanctx,
.__unassign_vif_chanctx = __iwl_mvm_mld_unassign_vif_chanctx, .__unassign_vif_chanctx = __iwl_mvm_mld_unassign_vif_chanctx,
}; };
...@@ -871,7 +871,7 @@ static int iwl_mvm_mld_roc(struct ieee80211_hw *hw, struct ieee80211_vif *vif, ...@@ -871,7 +871,7 @@ static int iwl_mvm_mld_roc(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
struct ieee80211_channel *channel, int duration, struct ieee80211_channel *channel, int duration,
enum ieee80211_roc_type type) enum ieee80211_roc_type type)
{ {
struct iwl_mvm_roc_ops ops = { static const struct iwl_mvm_roc_ops ops = {
.add_aux_sta_for_hs20 = iwl_mvm_mld_add_aux_sta, .add_aux_sta_for_hs20 = iwl_mvm_mld_add_aux_sta,
.switch_phy_ctxt = iwl_mvm_link_switch_phy_ctx, .switch_phy_ctxt = iwl_mvm_link_switch_phy_ctx,
}; };
......
...@@ -1888,7 +1888,7 @@ void ...@@ -1888,7 +1888,7 @@ void
iwl_mvm_bss_info_changed_common(struct ieee80211_hw *hw, iwl_mvm_bss_info_changed_common(struct ieee80211_hw *hw,
struct ieee80211_vif *vif, struct ieee80211_vif *vif,
struct ieee80211_bss_conf *bss_conf, struct ieee80211_bss_conf *bss_conf,
struct iwl_mvm_bss_info_changed_ops *callbacks, const struct iwl_mvm_bss_info_changed_ops *callbacks,
u64 changes); u64 changes);
void void
iwl_mvm_bss_info_changed_station_common(struct iwl_mvm *mvm, iwl_mvm_bss_info_changed_station_common(struct iwl_mvm *mvm,
...@@ -1922,7 +1922,7 @@ struct iwl_mvm_roc_ops { ...@@ -1922,7 +1922,7 @@ struct iwl_mvm_roc_ops {
int iwl_mvm_roc_common(struct ieee80211_hw *hw, struct ieee80211_vif *vif, int iwl_mvm_roc_common(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
struct ieee80211_channel *channel, int duration, struct ieee80211_channel *channel, int duration,
enum ieee80211_roc_type type, enum ieee80211_roc_type type,
struct iwl_mvm_roc_ops *ops); const struct iwl_mvm_roc_ops *ops);
int iwl_mvm_cancel_roc(struct ieee80211_hw *hw, int iwl_mvm_cancel_roc(struct ieee80211_hw *hw,
struct ieee80211_vif *vif); struct ieee80211_vif *vif);
/*Session Protection */ /*Session Protection */
...@@ -2420,7 +2420,7 @@ iwl_mvm_switch_vif_chanctx_common(struct ieee80211_hw *hw, ...@@ -2420,7 +2420,7 @@ iwl_mvm_switch_vif_chanctx_common(struct ieee80211_hw *hw,
struct ieee80211_vif_chanctx_switch *vifs, struct ieee80211_vif_chanctx_switch *vifs,
int n_vifs, int n_vifs,
enum ieee80211_chanctx_switch_mode mode, enum ieee80211_chanctx_switch_mode mode,
struct iwl_mvm_switch_vif_chanctx_ops *ops); const struct iwl_mvm_switch_vif_chanctx_ops *ops);
/* Channel info utils */ /* Channel info utils */
static inline bool iwl_mvm_has_ultra_hb_channel(struct iwl_mvm *mvm) static inline bool iwl_mvm_has_ultra_hb_channel(struct iwl_mvm *mvm)
......
...@@ -616,7 +616,7 @@ int iwl_mvm_mac_sta_state_common(struct ieee80211_hw *hw, ...@@ -616,7 +616,7 @@ int iwl_mvm_mac_sta_state_common(struct ieee80211_hw *hw,
struct ieee80211_sta *sta, struct ieee80211_sta *sta,
enum ieee80211_sta_state old_state, enum ieee80211_sta_state old_state,
enum ieee80211_sta_state new_state, enum ieee80211_sta_state new_state,
struct iwl_mvm_sta_state_ops *callbacks); const struct iwl_mvm_sta_state_ops *callbacks);
/* New MLD STA related APIs */ /* New MLD STA related APIs */
/* STA */ /* STA */
......
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