wifi: iwlwifi: mvm: const-ify chandef pointers
authorJohannes Berg <johannes.berg@intel.com>
Sun, 4 Feb 2024 22:06:07 +0000 (00:06 +0200)
committerJohannes Berg <johannes.berg@intel.com>
Thu, 8 Feb 2024 14:00:46 +0000 (15:00 +0100)
In much of the PHY context handling code the chandef
coming from mac80211 is read-only, mark them const
to make that clearer.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://msgid.link/20240204235836.e7fbd3e26d85.I72d72e61dc5f5fc76c53e32cb60b66237eaedec3@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
drivers/net/wireless/intel/iwlwifi/mvm/mvm.h
drivers/net/wireless/intel/iwlwifi/mvm/phy-ctxt.c

index eb30c299a71ee2b6a8e4edc48cc91b5f2263377e..37195cb5f70b07361a4ec5477d816aaf321bd417 100644 (file)
@@ -1810,18 +1810,18 @@ void iwl_mvm_rx_shared_mem_cfg_notif(struct iwl_mvm *mvm,
 /* MVM PHY */
 struct iwl_mvm_phy_ctxt *iwl_mvm_get_free_phy_ctxt(struct iwl_mvm *mvm);
 int iwl_mvm_phy_ctxt_add(struct iwl_mvm *mvm, struct iwl_mvm_phy_ctxt *ctxt,
-                        struct cfg80211_chan_def *chandef,
+                        const struct cfg80211_chan_def *chandef,
                         u8 chains_static, u8 chains_dynamic);
 int iwl_mvm_phy_ctxt_changed(struct iwl_mvm *mvm, struct iwl_mvm_phy_ctxt *ctxt,
-                            struct cfg80211_chan_def *chandef,
+                            const struct cfg80211_chan_def *chandef,
                             u8 chains_static, u8 chains_dynamic);
 void iwl_mvm_phy_ctxt_ref(struct iwl_mvm *mvm,
                          struct iwl_mvm_phy_ctxt *ctxt);
 void iwl_mvm_phy_ctxt_unref(struct iwl_mvm *mvm,
                            struct iwl_mvm_phy_ctxt *ctxt);
 int iwl_mvm_phy_ctx_count(struct iwl_mvm *mvm);
-u8 iwl_mvm_get_channel_width(struct cfg80211_chan_def *chandef);
-u8 iwl_mvm_get_ctrl_pos(struct cfg80211_chan_def *chandef);
+u8 iwl_mvm_get_channel_width(const struct cfg80211_chan_def *chandef);
+u8 iwl_mvm_get_ctrl_pos(const struct cfg80211_chan_def *chandef);
 int iwl_mvm_phy_send_rlc(struct iwl_mvm *mvm, struct iwl_mvm_phy_ctxt *ctxt,
                         u8 chains_static, u8 chains_dynamic);
 
@@ -2530,7 +2530,7 @@ static inline void iwl_mvm_set_chan_info(struct iwl_mvm *mvm,
 static inline void
 iwl_mvm_set_chan_info_chandef(struct iwl_mvm *mvm,
                              struct iwl_fw_channel_info *ci,
-                             struct cfg80211_chan_def *chandef)
+                             const struct cfg80211_chan_def *chandef)
 {
        enum nl80211_band band = chandef->chan->band;
 
index 8bf778503b74e2a5cfd379fd21a029fc99dfcfbd..bac655834f32fe2c0d643179314f396072da5309 100644 (file)
@@ -9,7 +9,7 @@
 #include "mvm.h"
 
 /* Maps the driver specific channel width definition to the fw values */
-u8 iwl_mvm_get_channel_width(struct cfg80211_chan_def *chandef)
+u8 iwl_mvm_get_channel_width(const struct cfg80211_chan_def *chandef)
 {
        switch (chandef->width) {
        case NL80211_CHAN_WIDTH_20_NOHT:
@@ -33,7 +33,7 @@ u8 iwl_mvm_get_channel_width(struct cfg80211_chan_def *chandef)
  * Maps the driver specific control channel position (relative to the center
  * freq) definitions to the the fw values
  */
-u8 iwl_mvm_get_ctrl_pos(struct cfg80211_chan_def *chandef)
+u8 iwl_mvm_get_ctrl_pos(const struct cfg80211_chan_def *chandef)
 {
        int offs = chandef->chan->center_freq - chandef->center_freq1;
        int abs_offs = abs(offs);
@@ -116,7 +116,7 @@ static void iwl_mvm_phy_ctxt_set_rxchain(struct iwl_mvm *mvm,
 static void iwl_mvm_phy_ctxt_cmd_data_v1(struct iwl_mvm *mvm,
                                         struct iwl_mvm_phy_ctxt *ctxt,
                                         struct iwl_phy_context_cmd_v1 *cmd,
-                                        struct cfg80211_chan_def *chandef,
+                                        const struct cfg80211_chan_def *chandef,
                                         u8 chains_static, u8 chains_dynamic)
 {
        struct iwl_phy_context_cmd_tail *tail =
@@ -137,7 +137,7 @@ static void iwl_mvm_phy_ctxt_cmd_data_v1(struct iwl_mvm *mvm,
 static void iwl_mvm_phy_ctxt_cmd_data(struct iwl_mvm *mvm,
                                      struct iwl_mvm_phy_ctxt *ctxt,
                                      struct iwl_phy_context_cmd *cmd,
-                                     struct cfg80211_chan_def *chandef,
+                                     const struct cfg80211_chan_def *chandef,
                                      u8 chains_static, u8 chains_dynamic)
 {
        cmd->lmac_id = cpu_to_le32(iwl_mvm_get_lmac_id(mvm,
@@ -197,7 +197,7 @@ int iwl_mvm_phy_send_rlc(struct iwl_mvm *mvm, struct iwl_mvm_phy_ctxt *ctxt,
  */
 static int iwl_mvm_phy_ctxt_apply(struct iwl_mvm *mvm,
                                  struct iwl_mvm_phy_ctxt *ctxt,
-                                 struct cfg80211_chan_def *chandef,
+                                 const struct cfg80211_chan_def *chandef,
                                  u8 chains_static, u8 chains_dynamic,
                                  u32 action)
 {
@@ -254,7 +254,7 @@ static int iwl_mvm_phy_ctxt_apply(struct iwl_mvm *mvm,
  * Send a command to add a PHY context based on the current HW configuration.
  */
 int iwl_mvm_phy_ctxt_add(struct iwl_mvm *mvm, struct iwl_mvm_phy_ctxt *ctxt,
-                        struct cfg80211_chan_def *chandef,
+                        const struct cfg80211_chan_def *chandef,
                         u8 chains_static, u8 chains_dynamic)
 {
        int ret;
@@ -300,7 +300,7 @@ void iwl_mvm_phy_ctxt_ref(struct iwl_mvm *mvm, struct iwl_mvm_phy_ctxt *ctxt)
  * changed.
  */
 int iwl_mvm_phy_ctxt_changed(struct iwl_mvm *mvm, struct iwl_mvm_phy_ctxt *ctxt,
-                            struct cfg80211_chan_def *chandef,
+                            const struct cfg80211_chan_def *chandef,
                             u8 chains_static, u8 chains_dynamic)
 {
        enum iwl_ctxt_action action = FW_CTXT_ACTION_MODIFY;