[9610] wlbt: Fixed WLAN banks to PHYs banks mapping
authorAlbert Cano <a.canocamps@samsung.com>
Mon, 30 Jul 2018 16:26:13 +0000 (17:26 +0100)
committerCosmin Tanislav <demonsingur@gmail.com>
Mon, 22 Apr 2024 17:22:58 +0000 (20:22 +0300)
Incorrect mapping occurs when WLAN is allocating banks in the WLAN array.

WLAN will use the phy/logical map to configure the SMAPPER FW however
when FW returns entries mapped to phy banks, WLAN is not able to map to
their own logical WLAN banks.

This patch adds a lookup table to map PHY->WLAN banks

Change-Id: Iffaa3484cfe5298dfd0f1a5e0619364e8f27cca6
SCSC-Bug-Id: SSB-42392
Signed-off-by: Albert Cano <a.canocamps@samsung.com>
drivers/net/wireless/scsc/hip4_smapper.c
drivers/net/wireless/scsc/hip4_smapper.h

index f6d9c8a4ebcfc03bfa42309e2f2c1bf17f8a1b12..4f0063b1770b708c5f548af95e648c22c7a897e2 100644 (file)
@@ -21,6 +21,7 @@ static int hip4_smapper_alloc_bank(struct slsi_dev *sdev, struct hip4_priv *priv
 {
        u16 i;
        struct hip4_smapper_bank *bank = &(priv)->smapper_banks[bank_name];
+       struct hip4_smapper_control *control = &(priv)->smapper_control;
 
        SLSI_DBG4_NODEV(SLSI_SMAPPER, "Init bank %d entry_size %d is_large %d\n", bank_name, entry_size, is_large);
        bank->entry_size = entry_size;
@@ -41,6 +42,9 @@ static int hip4_smapper_alloc_bank(struct slsi_dev *sdev, struct hip4_priv *priv
        bank->align = scsc_service_get_alignment(sdev->service);
        bank->in_use = true;
 
+       /* update the mapping with BANK# in WLAN with PHY BANK#*/
+       control->lookuptable[bank->bank] = bank_name;
+
        return 0;
 }
 
@@ -200,11 +204,15 @@ int hip4_smapper_consume_entry(struct slsi_dev *sdev, struct slsi_hip4 *hip, str
        len = desc->entry_size;
        headroom = desc->headroom;
 
+
        if (bank_num > HIP4_SMAPPER_TOTAL_BANKS) {
                SLSI_DBG4_NODEV(SLSI_SMAPPER, "Incorrect bank_num %d\n", bank_num);
                goto error;
        }
 
+       /* Transform PHY BANK# with BANK# in Wlan service*/
+       bank_num = control->lookuptable[bank_num];
+
        bank = &hip->hip_priv->smapper_banks[bank_num];
 
        if (entry > bank->entries) {
index 37d54ca5d2931064080a5e450a7497c572d2eed4..fa3d9b5f45a45f2a367d67c18e201b71f9b44dd6 100644 (file)
@@ -71,6 +71,8 @@ struct hip4_smapper_control {
        u32  mbox_scb;   /* SMAPPER MBOX scoreboard location */
        u32 *mbox_ptr;   /* Mbox pointer */
        spinlock_t   smapper_lock;
+       /* Lookup table to map the virtual bank mapping in wlan with the phy mapping in HW */
+       u8 lookuptable[HIP4_SMAPPER_TOTAL_BANKS];
 };
 
 struct hip4_smapper_bank {