Thread (55 messages) 55 messages, 3 authors, 2021-12-28
STALE1616d

[PATCH v2 32/50] wilc1000: introduce vmm_table_entry() helper function

From: David Mosberger-Tang <hidden>
Date: 2021-12-23 01:17:31
Also in: lkml, netdev
Subsystem: microchip wilc1000 wifi driver, the rest · Maintainers: Ajay Singh, Claudiu Beznea, Linus Torvalds

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

Signed-off-by: David Mosberger-Tang <redacted>
---
 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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help