summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorstsp <stsp@openbsd.org>2020-06-22 08:21:51 +0000
committerstsp <stsp@openbsd.org>2020-06-22 08:21:51 +0000
commite1b95be80cd169f00369922e63be4f5104996045 (patch)
treeaeb6870a61c36b703e205a466271cfea4e8ad714
parentPrepare for newer iwx(4) firmware scan command versions. (diff)
downloadwireguard-openbsd-e1b95be80cd169f00369922e63be4f5104996045.tar.xz
wireguard-openbsd-e1b95be80cd169f00369922e63be4f5104996045.zip
Fix two iwx(4) TX_CMD_OFFLD macros.
The IP_HDR and MH_SIZE fields represent byte offsets into the frame, rather than flags. Make these macros require a parameter to prevent them from being misunderstood as flag bits. In iwlwifi these are defined via an enum, with most values being used as parameters to BIT(). Yet these IP and MH ones are actually used to shift length values to particular positions within the offloading parameters of the Tx command. Fortunately, these macros aren't used yet in our version of the driver.
-rw-r--r--sys/dev/pci/if_iwxreg.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/sys/dev/pci/if_iwxreg.h b/sys/dev/pci/if_iwxreg.h
index bd0f6f3c6e9..1457a0c2a5e 100644
--- a/sys/dev/pci/if_iwxreg.h
+++ b/sys/dev/pci/if_iwxreg.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_iwxreg.h,v 1.13 2020/06/22 08:05:52 stsp Exp $ */
+/* $OpenBSD: if_iwxreg.h,v 1.14 2020/06/22 08:21:51 stsp Exp $ */
/*-
* Based on BSD-licensed source modules in the Linux iwlwifi driver,
@@ -4863,10 +4863,10 @@ struct iwx_tlc_update_notif {
* alignment
* @TX_CMD_OFFLD_AMSDU: mark TX command is A-MSDU
*/
-#define IWX_TX_CMD_OFFLD_IP_HDR (1 << 0)
+#define IWX_TX_CMD_OFFLD_IP_HDR(x) ((x) << 0)
#define IWX_TX_CMD_OFFLD_L4_EN (1 << 6)
#define IWX_TX_CMD_OFFLD_L3_EN (1 << 7)
-#define IWX_TX_CMD_OFFLD_MH_SIZE (1 << 8)
+#define IWX_TX_CMD_OFFLD_MH_SIZE(x) ((x) << 8)
#define IWX_TX_CMD_OFFLD_PAD (1 << 13)
#define IWX_TX_CMD_OFFLD_AMSDU (1 << 14)
#define IWX_TX_CMD_OFFLD_MH_MASK 0x1f