summaryrefslogtreecommitdiffstats
path: root/target/linux/generic-2.6/files/drivers/net/phy/ar8216.h
diff options
context:
space:
mode:
authornbd <nbd@3c298f89-4303-0410-b956-a3cf2f4a3e73>2010-03-09 14:35:41 +0000
committernbd <nbd@3c298f89-4303-0410-b956-a3cf2f4a3e73>2010-03-09 14:35:41 +0000
commit455e74f06309d6e4fc035f80698492fda2696aab (patch)
tree0d070cf1901b2c0db00fe54bab4b8ed35e5a35e5 /target/linux/generic-2.6/files/drivers/net/phy/ar8216.h
parent95a4336b23283964e9b5f0ddd7fd9fe24e3f55af (diff)
Several small fixes for ar8216 driver (patch by Jonas Gorski)
* Create defines for some magic values/masks. * Change vlan_id to u16, to allow VIDs > 255. * Add a range check to set_pvid as it isn't a VID, but the index in the vlan table. * Set the max VID to 4094, since 4095 is a reserved value and should not be used. * In mangle_rx replace the provided VID with the VID of the table entry of the port, not the index of the table. * In hw_apply, remove a redundant emptyness check (was already checked several lines above). * In no vlan mode do not set the ingress mode to secure, as there are no vlan table entries, but to use the port's destination masks. Otherwise the switch won't forward anything. * In read_status tell that the phy is up (taken from the rtl8306 driver). git-svn-id: svn://svn.openwrt.org/openwrt/trunk@20083 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'target/linux/generic-2.6/files/drivers/net/phy/ar8216.h')
-rw-r--r--target/linux/generic-2.6/files/drivers/net/phy/ar8216.h16
1 files changed, 14 insertions, 2 deletions
diff --git a/target/linux/generic-2.6/files/drivers/net/phy/ar8216.h b/target/linux/generic-2.6/files/drivers/net/phy/ar8216.h
index 741dce917..c1b8fdbd8 100644
--- a/target/linux/generic-2.6/files/drivers/net/phy/ar8216.h
+++ b/target/linux/generic-2.6/files/drivers/net/phy/ar8216.h
@@ -24,6 +24,10 @@
#define AR8216_NUM_VLANS 16
#define AR8216_REG_CTRL 0x0000
+#define AR8216_CTRL_REVISION BITS(0, 8)
+#define AR8216_CTRL_REVISION_S 0
+#define AR8216_CTRL_VERSION BITS(8, 8)
+#define AR8216_CTRL_VERSION_S 8
#define AR8216_CTRL_RESET BIT(31)
#define AR8216_REG_GLOBAL_CTRL 0x0030
@@ -73,8 +77,8 @@
#define AR8216_PORT_OFFSET(_i) (0x0100 * (_i + 1))
#define AR8216_REG_PORT_STATUS(_i) (AR8216_PORT_OFFSET(_i) + 0x0000)
-#define AR8216_PORT_STATUS_SPEED BIT(0)
-#define AR8216_PORT_STATUS_SPEED_ERR BIT(1)
+#define AR8216_PORT_STATUS_SPEED BITS(0,2)
+#define AR8216_PORT_STATUS_SPEED_S 0
#define AR8216_PORT_STATUS_TXMAC BIT(2)
#define AR8216_PORT_STATUS_RXMAC BIT(3)
#define AR8216_PORT_STATUS_TXFLOW BIT(4)
@@ -126,6 +130,14 @@
#define AR8216_REG_PORT_RATE(_i) (AR8216_PORT_OFFSET(_i) + 0x000c)
#define AR8216_REG_PORT_PRIO(_i) (AR8216_PORT_OFFSET(_i) + 0x0010)
+/* port speed */
+enum {
+ AR8216_PORT_SPEED_10M = 0,
+ AR8216_PORT_SPEED_100M = 1,
+ AR8216_PORT_SPEED_1000M = 2,
+ AR8216_PORT_SPEED_ERR = 3,
+};
+
/* ingress 802.1q mode */
enum {
AR8216_IN_PORT_ONLY = 0,