socsvn commit: r307816 - in soc2016/yuanxunzhang/head: sys/net usr.sbin/eaps
yuanxunzhang at FreeBSD.org
yuanxunzhang at FreeBSD.org
Wed Aug 17 16:01:53 UTC 2016
Author: yuanxunzhang
Date: Wed Aug 17 16:01:51 2016
New Revision: 307816
URL: http://svnweb.FreeBSD.org/socsvn/?view=rev&rev=307816
Log:
EAPS: query eaps domian status
Modified:
soc2016/yuanxunzhang/head/sys/net/eaps.c
soc2016/yuanxunzhang/head/sys/net/eaps.h
soc2016/yuanxunzhang/head/usr.sbin/eaps/eaps.h
Modified: soc2016/yuanxunzhang/head/sys/net/eaps.c
==============================================================================
--- soc2016/yuanxunzhang/head/sys/net/eaps.c Wed Aug 17 15:50:56 2016 (r307815)
+++ soc2016/yuanxunzhang/head/sys/net/eaps.c Wed Aug 17 16:01:51 2016 (r307816)
@@ -70,6 +70,7 @@
static int eaps_transmit(struct ifnet *, struct mbuf *);
static void eaps_qflush(struct ifnet *);
static void eaps_init(void *);
+static void eaps_domain_init(struct eaps_softc *);
static VNET_DEFINE(struct if_clone *, eaps_cloner);
#define V_eaps_cloner VNET(eaps_cloner)
@@ -231,6 +232,13 @@
{
}
+static void
+eaps_domain_init(struct eaps_softc *sc)
+{
+ //set eaps domain default state
+ sc->sc_eaps->state = EAPS_S_IDLE;
+ sc->sc_eaps->active = EAPS_ACTIVE_DISABLE;
+}
/*
* eaps_init:
*
Modified: soc2016/yuanxunzhang/head/sys/net/eaps.h
==============================================================================
--- soc2016/yuanxunzhang/head/sys/net/eaps.h Wed Aug 17 15:50:56 2016 (r307815)
+++ soc2016/yuanxunzhang/head/sys/net/eaps.h Wed Aug 17 16:01:51 2016 (r307816)
@@ -31,6 +31,14 @@
#ifndef _NET_EAPS_H
#define _NET_EAPS_H
+/*
+* eaps state information
+*/
+struct eaps_state {
+ char ifname[IFNAMSIZ]; /* name of the eaps */
+ uint8_t state; /* state of eaps */
+ uint8_t active; /* enable or disable eaps */
+};
/*
* Software state for each EAPS Domain
@@ -38,18 +46,12 @@
struct eaps_softc {
struct ifnet *sc_ifp; /* make this an interface */
struct rmlock sc_mtx;
+ struct eaps_state sc_eaps; /* state of eaps */
LIST_ENTRY(eaps_softc) sc_list;
u_char sc_defaddr[6]; /* Default MAC address */
};
-/*
-* eaps ring information
-*/
-struct eaps_reqall {
- char eaps_ifname[IFNAMSIZ]; /* name of the eaps */
- uint8_t eaps_state; /* state of eaps */
- uint8_t enable_state; /* enable or disable eaps ring */
-};
+
#define SIOCSEAPSDOMAIN _IOWR('i', 300, struct eaps_reqall)
@@ -148,6 +150,11 @@
#define EAPS_S_PREFORWARD 0x05 /* Transit in PREFORWARDING State */
#define EAPS_S_INIT 0x06 /* Master node in INIT state */
+/*
+ * EAPS ring active states
+ */
+#define EAPS_ACTIVE_DISABLE 0x00 /* Disable the eaps domain */
+#define EAPS_ACTIVE_ENABLE 0x01 /* Enable the eaps domain */
#define EAPS_LOCK_INIT(_sc) rm_init(&(_sc)->sc_mtx, "eaps rmlock")
#define EAPS_LOCK_DESTROY(_sc) rm_destroy(&(_sc)->sc_mtx)
Modified: soc2016/yuanxunzhang/head/usr.sbin/eaps/eaps.h
==============================================================================
--- soc2016/yuanxunzhang/head/usr.sbin/eaps/eaps.h Wed Aug 17 15:50:56 2016 (r307815)
+++ soc2016/yuanxunzhang/head/usr.sbin/eaps/eaps.h Wed Aug 17 16:01:51 2016 (r307816)
@@ -35,12 +35,12 @@
*/
/*
-* eaps ring information
+* eaps state information
*/
-struct eaps_reqall {
- char eaps_ifname[IFNAMSIZ]; /* name of the eaps */
- uint8_t eaps_state; /* state of eaps */
- uint8_t enable_state; /* enable or disable eaps ring */
+struct eaps_state {
+ char ifname[IFNAMSIZ]; /* name of the eaps */
+ uint8_t state; /* state of eaps */
+ uint8_t active; /* enable or disable eaps */
};
#define SIOCSEAPSDOMAIN _IOWR('i', 300, struct eaps_reqall)
More information about the svn-soc-all
mailing list