]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
iwlwifi: mvm: clear up iwl_mvm_notify_rx_queue() argument type
authorJohannes Berg <johannes.berg@intel.com>
Wed, 9 Dec 2020 21:16:27 +0000 (23:16 +0200)
committerLuca Coelho <luciano.coelho@intel.com>
Wed, 9 Dec 2020 22:14:15 +0000 (00:14 +0200)
The argument type to iwl_mvm_notify_rx_queue() is currently just
a u8 *, but that's misleading because we actually need the inner
data to be of type struct iwl_mvm_internal_rxq_notif, because we
interpret it when we get it back from the device (to check the
sync bool and possibly the cookie.)

Therefore, clear up any potential confusion and require that the
data passed is of type struct iwl_mvm_internal_rxq_notif *.

Also, while at it, rename the "count" to "notif_size" as "count"
doesn't really clearly say what it's counting.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Link: https://lore.kernel.org/r/iwlwifi.20201209231352.d28e14682bdc.I9ac366aa97db045be4daa4ba263267a3ac6a6a2f@changeid
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c
drivers/net/wireless/intel/iwlwifi/mvm/mvm.h
drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c

index 284e29ef0fc87db59566e6205662c45acc000e24..2ca57ca200af8f72b1bc5ea05479abbf4b3c74c2 100644 (file)
@@ -5104,8 +5104,7 @@ void iwl_mvm_sync_rx_queues_internal(struct iwl_mvm *mvm,
                           mvm->trans->num_rx_queues);
        }
 
-       ret = iwl_mvm_notify_rx_queue(mvm, qmask, (u8 *)notif,
-                                     size, !notif->sync);
+       ret = iwl_mvm_notify_rx_queue(mvm, qmask, notif, size, !notif->sync);
        if (ret) {
                IWL_ERR(mvm, "Failed to trigger RX queues sync (%d)\n", ret);
                goto out;
index 047bd47df32e920f58fcfc40a4bff829be1f12ad..7e28a088f3e600264966d8244f71571c385d581f 100644 (file)
@@ -1615,7 +1615,8 @@ void iwl_mvm_rx_frame_release(struct iwl_mvm *mvm, struct napi_struct *napi,
 void iwl_mvm_rx_bar_frame_release(struct iwl_mvm *mvm, struct napi_struct *napi,
                                  struct iwl_rx_cmd_buffer *rxb, int queue);
 int iwl_mvm_notify_rx_queue(struct iwl_mvm *mvm, u32 rxq_mask,
-                           const u8 *data, u32 count, bool async);
+                           const struct iwl_mvm_internal_rxq_notif *notif,
+                           u32 notif_size, bool async);
 void iwl_mvm_rx_queue_notif(struct iwl_mvm *mvm, struct napi_struct *napi,
                            struct iwl_rx_cmd_buffer *rxb, int queue);
 void iwl_mvm_rx_tx_cmd(struct iwl_mvm *mvm, struct iwl_rx_cmd_buffer *rxb);
index 1d51ec95ec2110714aaf15bc0e9bb16a8f7f2e3c..ef5bd58ef74284d41186de17bb6466ddf00cc5fc 100644 (file)
@@ -510,26 +510,27 @@ static bool iwl_mvm_is_dup(struct ieee80211_sta *sta, int queue,
 }
 
 int iwl_mvm_notify_rx_queue(struct iwl_mvm *mvm, u32 rxq_mask,
-                           const u8 *data, u32 count, bool async)
+                           const struct iwl_mvm_internal_rxq_notif *notif,
+                           u32 notif_size, bool async)
 {
        u8 buf[sizeof(struct iwl_rxq_sync_cmd) +
               sizeof(struct iwl_mvm_rss_sync_notif)];
        struct iwl_rxq_sync_cmd *cmd = (void *)buf;
-       u32 data_size = sizeof(*cmd) + count;
+       u32 data_size = sizeof(*cmd) + notif_size;
        int ret;
 
        /*
         * size must be a multiple of DWORD
         * Ensure we don't overflow buf
         */
-       if (WARN_ON(count & 3 ||
-                   count > sizeof(struct iwl_mvm_rss_sync_notif)))
+       if (WARN_ON(notif_size & 3 ||
+                   notif_size > sizeof(struct iwl_mvm_rss_sync_notif)))
                return -EINVAL;
 
        cmd->rxq_mask = cpu_to_le32(rxq_mask);
-       cmd->count =  cpu_to_le32(count);
+       cmd->count =  cpu_to_le32(notif_size);
        cmd->flags = 0;
-       memcpy(cmd->payload, data, count);
+       memcpy(cmd->payload, notif, notif_size);
 
        ret = iwl_mvm_send_cmd_pdu(mvm,
                                   WIDE_ID(DATA_PATH_GROUP,