lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Thu, 23 Dec 2021 01:14:07 +0000 (UTC)
From:   David Mosberger-Tang <davidm@...uge.net>
To:     Ajay Singh <ajay.kathat@...rochip.com>
Cc:     Claudiu Beznea <claudiu.beznea@...rochip.com>,
        Kalle Valo <kvalo@...nel.org>,
        "David S. Miller" <davem@...emloft.net>,
        Jakub Kicinski <kuba@...nel.org>,
        linux-wireless@...r.kernel.org, netdev@...r.kernel.org,
        linux-kernel@...r.kernel.org,
        David Mosberger-Tang <davidm@...uge.net>
Subject: [PATCH v2 32/50] wilc1000: introduce vmm_table_entry() helper
 function

This simplifies fill_vmm_table() a bit more and will become even more
useful with the following patches.

Signed-off-by: David Mosberger-Tang <davidm@...uge.net>
---
 drivers/net/wireless/microchip/wilc1000/wlan.c | 17 ++++++++++++-----
 1 file changed, 12 insertions(+), 5 deletions(-)

diff --git a/drivers/net/wireless/microchip/wilc1000/wlan.c b/drivers/net/wireless/microchip/wilc1000/wlan.c
index cff70f7d38c89..5939ed5b2db68 100644
--- a/drivers/net/wireless/microchip/wilc1000/wlan.c
+++ b/drivers/net/wireless/microchip/wilc1000/wlan.c
@@ -629,6 +629,17 @@ static u32 tx_hdr_len(u8 type)
 	}
 }
 
+static u32 vmm_table_entry(struct sk_buff *tqe, u32 vmm_sz)
+{
+	struct wilc_skb_tx_cb *tx_cb = WILC_SKB_TX_CB(tqe);
+	u32 entry;
+
+	entry = vmm_sz / 4;
+	if (tx_cb->type == WILC_CFG_PKT)
+		entry |= WILC_VMM_CFG_PKT;
+	return cpu_to_le32(entry);
+}
+
 /**
  * fill_vmm_table() - Fill VMM table with packets to be sent
  * @wilc: Pointer to the wilc structure.
@@ -691,11 +702,7 @@ static int fill_vmm_table(const struct wilc *wilc,
 
 				if (sum + vmm_sz > WILC_TX_BUFF_SIZE)
 					goto out;
-				vmm_table[i] = vmm_sz / 4;
-				if (tx_cb->type == WILC_CFG_PKT)
-					vmm_table[i] |= WILC_VMM_CFG_PKT;
-
-				cpu_to_le32s(&vmm_table[i]);
+				vmm_table[i] = vmm_table_entry(tqe_q[ac], vmm_sz);
 				vmm_entries_ac[i] = ac;
 
 				i++;
-- 
2.25.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ