diff mbox series

[v2,23/50] wilc1000: introduce symbolic names for two tx-related control bits

Message ID 20211223011358.4031459-24-davidm@egauge.net
State New
Headers show
Series wilc1000: rework tx path to use sk_buffs throughout | expand

Commit Message

David Mosberger-Tang Dec. 23, 2021, 1:14 a.m. UTC
I wish these registers were documented so I wouldn't have to guess at
their meanings and make up my own names.

Signed-off-by: David Mosberger-Tang <davidm@egauge.net>
---
 drivers/net/wireless/microchip/wilc1000/wlan.c | 6 +++---
 drivers/net/wireless/microchip/wilc1000/wlan.h | 2 ++
 2 files changed, 5 insertions(+), 3 deletions(-)
diff mbox series

Patch

diff --git a/drivers/net/wireless/microchip/wilc1000/wlan.c b/drivers/net/wireless/microchip/wilc1000/wlan.c
index 27b1d317dc0c4..f82857cebe35e 100644
--- a/drivers/net/wireless/microchip/wilc1000/wlan.c
+++ b/drivers/net/wireless/microchip/wilc1000/wlan.c
@@ -675,7 +675,7 @@  static int fill_vmm_table(const struct wilc *wilc,
 					goto out;
 				vmm_table[i] = vmm_sz / 4;
 				if (tx_cb->type == WILC_CFG_PKT)
-					vmm_table[i] |= BIT(10);
+					vmm_table[i] |= WILC_VMM_CFG_PKT;
 
 				cpu_to_le32s(&vmm_table[i]);
 				vmm_entries_ac[i] = ac;
@@ -721,7 +721,7 @@  static int send_vmm_table(struct wilc *wilc, int i, const u32 *vmm_table)
 		if (ret)
 			break;
 
-		if ((reg & 0x1) == 0) {
+		if ((reg & WILC_HOST_TX_CTRL_BUSY) == 0) {
 			ac_update_fw_ac_pkt_info(wilc, reg);
 			break;
 		}
@@ -769,7 +769,7 @@  static int send_vmm_table(struct wilc *wilc, int i, const u32 *vmm_table)
 			ret = func->hif_read_reg(wilc, WILC_HOST_TX_CTRL, &reg);
 			if (ret)
 				break;
-			reg &= ~BIT(0);
+			reg &= ~WILC_HOST_TX_CTRL_BUSY;
 			ret = func->hif_write_reg(wilc, WILC_HOST_TX_CTRL, reg);
 		} else {
 			ret = entries;
diff --git a/drivers/net/wireless/microchip/wilc1000/wlan.h b/drivers/net/wireless/microchip/wilc1000/wlan.h
index 10618327133ce..f5d32ec93fdb9 100644
--- a/drivers/net/wireless/microchip/wilc1000/wlan.h
+++ b/drivers/net/wireless/microchip/wilc1000/wlan.h
@@ -224,6 +224,7 @@ 
 #define BE_AC_ACM_STAT_FIELD		BIT(8)
 #define BK_AC_COUNT_FIELD		GENMASK(7, 3)
 #define BK_AC_ACM_STAT_FIELD		BIT(1)
+#define WILC_HOST_TX_CTRL_BUSY		BIT(0)
 
 #define WILC_PKT_HDR_CONFIG_FIELD	BIT(31)
 #define WILC_PKT_HDR_OFFSET_FIELD	GENMASK(30, 22)
@@ -233,6 +234,7 @@ 
 #define WILC_INTERRUPT_DATA_SIZE	GENMASK(14, 0)
 
 #define WILC_VMM_BUFFER_SIZE		GENMASK(9, 0)
+#define WILC_VMM_CFG_PKT		BIT(10)
 
 #define WILC_VMM_HDR_TYPE		BIT(31)
 #define WILC_VMM_HDR_MGMT_FIELD		BIT(30)