svn commit: r262428 - head/sys/dev/etherswitch/arswitch
Adrian Chadd
adrian at FreeBSD.org
Mon Feb 24 04:43:24 UTC 2014
Author: adrian
Date: Mon Feb 24 04:43:23 2014
New Revision: 262428
URL: http://svnweb.freebsd.org/changeset/base/262428
Log:
* Ensure enough ports/phys are available for both the AR8327 and previous
switches.
* Add some new VLAN HAL methods that will be used by the VLAN configuration
code. The AR933x and later switches use slightly different register
layouts (even though the driver currently doesn't support it.)
Modified:
head/sys/dev/etherswitch/arswitch/arswitchvar.h
Modified: head/sys/dev/etherswitch/arswitch/arswitchvar.h
==============================================================================
--- head/sys/dev/etherswitch/arswitch/arswitchvar.h Mon Feb 24 03:51:31 2014 (r262427)
+++ head/sys/dev/etherswitch/arswitch/arswitchvar.h Mon Feb 24 04:43:23 2014 (r262428)
@@ -45,6 +45,9 @@ typedef enum {
#define AR8X16_IS_SWITCH(_sc, _type) \
(!!((_sc)->sc_switchtype == AR8X16_SWITCH_ ## _type))
+#define ARSWITCH_NUM_PORTS MAX(AR8327_NUM_PORTS, AR8X16_NUM_PORTS)
+#define ARSWITCH_NUM_PHYS MAX(AR8327_NUM_PHYS, AR8X16_NUM_PHYS)
+
struct arswitch_softc {
struct mtx sc_mtx; /* serialize access to softc */
device_t sc_dev;
@@ -59,9 +62,10 @@ struct arswitch_softc {
int chip_rev;
int mii_lo_first;
ar8x16_switch_type sc_switchtype;
- char *ifname[AR8X16_NUM_PHYS];
- device_t miibus[AR8X16_NUM_PHYS];
- struct ifnet *ifp[AR8X16_NUM_PHYS];
+ /* should be the max of both pre-AR8327 and AR8327 ports */
+ char *ifname[ARSWITCH_NUM_PHYS];
+ device_t miibus[ARSWITCH_NUM_PHYS];
+ struct ifnet *ifp[ARSWITCH_NUM_PHYS];
struct callout callout_tick;
etherswitch_info_t info;
@@ -82,6 +86,15 @@ struct arswitch_softc {
etherswitch_port_t *);
int (* arswitch_port_vlan_get) (struct arswitch_softc *,
etherswitch_port_t *);
+ void (* arswitch_vlan_init_hw) (struct arswitch_softc *);
+ int (* arswitch_vlan_getvgroup) (struct arswitch_softc *,
+ etherswitch_vlangroup_t *);
+ int (* arswitch_vlan_setvgroup) (struct arswitch_softc *,
+ etherswitch_vlangroup_t *);
+ int (* arswitch_vlan_get_pvid) (struct arswitch_softc *, int,
+ int *);
+ int (* arswitch_vlan_set_pvid) (struct arswitch_softc *, int,
+ int);
} hal;
};
More information about the svn-src-all
mailing list