aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/etherswitch
diff options
context:
space:
mode:
authorAdrian Chadd <adrian@FreeBSD.org>2012-05-12 20:36:12 +0000
committerAdrian Chadd <adrian@FreeBSD.org>2012-05-12 20:36:12 +0000
commit2015605e8dcbc6b06f82a5efeda7bb1c8d8db1b3 (patch)
tree26100a9bca08046074aa2fd22d0201b1da3478b3 /sys/dev/etherswitch
parente461aae747ef3815eb2bd016169d17eb611f8328 (diff)
Notes
Diffstat (limited to 'sys/dev/etherswitch')
-rw-r--r--sys/dev/etherswitch/arswitch/arswitchreg.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/sys/dev/etherswitch/arswitch/arswitchreg.h b/sys/dev/etherswitch/arswitch/arswitchreg.h
index ad0b4d5a5d8d0..499d94cef3ef7 100644
--- a/sys/dev/etherswitch/arswitch/arswitchreg.h
+++ b/sys/dev/etherswitch/arswitch/arswitchreg.h
@@ -29,6 +29,15 @@
#ifndef __AR8X16_SWITCHREG_H__
#define __AR8X16_SWITCHREG_H__
+/* XXX doesn't belong here; stolen shamelessly from ath_hal/ah_internal.h */
+/*
+ * Register manipulation macros that expect bit field defines
+ * to follow the convention that an _S suffix is appended for
+ * a shift count, while the field mask has no suffix.
+ */
+#define SM(_v, _f) (((_v) << _f##_S) & (_f))
+#define MS(_v, _f) (((_v) & (_f)) >> _f##_S)
+
/* Atheros specific MII registers */
#define MII_ATH_DBG_ADDR 0x1d
#define MII_ATH_DBG_DATA 0x1e
@@ -77,8 +86,13 @@
#define AR8X16_REG_GLOBAL_CTRL 0x0030
#define AR8216_GLOBAL_CTRL_MTU_MASK 0x00000fff
+#define AR8216_GLOBAL_CTRL_MTU_MASK_S 0
#define AR8316_GLOBAL_CTRL_MTU_MASK 0x00007fff
+#define AR8316_GLOBAL_CTRL_MTU_MASK_S 0
#define AR8236_GLOBAL_CTRL_MTU_MASK 0x00007fff
+#define AR8236_GLOBAL_CTRL_MTU_MASK_S 0
+#define AR7240_GLOBAL_CTRL_MTU_MASK 0x00003fff
+#define AR7240_GLOBAL_CTRL_MTU_MASK_S 0
#define AR8X16_REG_VLAN_CTRL 0x0040
#define AR8X16_VLAN_OP 0x00000007