wifi: wfx: relocate wfx_rate_mask_to_hw()
authorJérôme Pouiller <jerome.pouiller@silabs.com>
Wed, 4 Oct 2023 17:28:37 +0000 (19:28 +0200)
committerKalle Valo <kvalo@kernel.org>
Mon, 9 Oct 2023 06:53:06 +0000 (09:53 +0300)
wfx_rate_mask_to_hw() is only used in hif_tx.c. So relocate it into
hif_tx.c and mark it static.

Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
Signed-off-by: Kalle Valo <kvalo@kernel.org>
Link: https://lore.kernel.org/r/20231004172843.195332-3-jerome.pouiller@silabs.com
drivers/net/wireless/silabs/wfx/hif_tx.c
drivers/net/wireless/silabs/wfx/sta.c
drivers/net/wireless/silabs/wfx/sta.h

index 9402503fbde3cbf815b9a352fadc3396dff5ba2d..de5a31482df389c9285443dc44e8ee1d440e9741 100644 (file)
@@ -45,6 +45,24 @@ static void *wfx_alloc_hif(size_t body_len, struct wfx_hif_msg **hif)
                return NULL;
 }
 
+static u32 wfx_rate_mask_to_hw(struct wfx_dev *wdev, u32 rates)
+{
+       int i;
+       u32 ret = 0;
+       /* The device only supports 2GHz */
+       struct ieee80211_supported_band *sband = wdev->hw->wiphy->bands[NL80211_BAND_2GHZ];
+
+       for (i = 0; i < sband->n_bitrates; i++) {
+               if (rates & BIT(i)) {
+                       if (i >= sband->n_bitrates)
+                               dev_warn(wdev->dev, "unsupported basic rate\n");
+                       else
+                               ret |= BIT(sband->bitrates[i].hw_value);
+               }
+       }
+       return ret;
+}
+
 int wfx_cmd_send(struct wfx_dev *wdev, struct wfx_hif_msg *request,
                 void *reply, size_t reply_len, bool no_reply)
 {
index 9c0a11c277e975aefaa3a4505420c612cb164eca..c58db2bcea87be04dc41d9985940890d856aa9a9 100644 (file)
 
 #define HIF_MAX_ARP_IP_ADDRTABLE_ENTRIES 2
 
-u32 wfx_rate_mask_to_hw(struct wfx_dev *wdev, u32 rates)
-{
-       int i;
-       u32 ret = 0;
-       /* The device only supports 2GHz */
-       struct ieee80211_supported_band *sband = wdev->hw->wiphy->bands[NL80211_BAND_2GHZ];
-
-       for (i = 0; i < sband->n_bitrates; i++) {
-               if (rates & BIT(i)) {
-                       if (i >= sband->n_bitrates)
-                               dev_warn(wdev->dev, "unsupported basic rate\n");
-                       else
-                               ret |= BIT(sband->bitrates[i].hw_value);
-               }
-       }
-       return ret;
-}
-
 void wfx_cooling_timeout_work(struct work_struct *work)
 {
        struct wfx_dev *wdev = container_of(to_delayed_work(work), struct wfx_dev,
index 888db5cd3206b8a4425a89ccfc156fa1de73b5f2..c478ddcb934bd35675dad5826a2dcdb818ac4643 100644 (file)
@@ -66,6 +66,5 @@ int wfx_update_pm(struct wfx_vif *wvif);
 
 /* Other Helpers */
 void wfx_reset(struct wfx_vif *wvif);
-u32 wfx_rate_mask_to_hw(struct wfx_dev *wdev, u32 rates);
 
 #endif