From owner-svn-soc-all@freebsd.org Wed Aug 17 16:01:53 2016 Return-Path: Delivered-To: svn-soc-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A0722BBD40E for ; Wed, 17 Aug 2016 16:01:53 +0000 (UTC) (envelope-from yuanxunzhang@FreeBSD.org) Received: from socsvn.freebsd.org (socsvn.freebsd.org [IPv6:2001:1900:2254:206a::50:2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 92F361EF6 for ; Wed, 17 Aug 2016 16:01:53 +0000 (UTC) (envelope-from yuanxunzhang@FreeBSD.org) Received: from socsvn.freebsd.org ([127.0.1.124]) by socsvn.freebsd.org (8.15.2/8.15.2) with ESMTP id u7HG1rVx031448 for ; Wed, 17 Aug 2016 16:01:53 GMT (envelope-from yuanxunzhang@FreeBSD.org) Received: (from www@localhost) by socsvn.freebsd.org (8.15.2/8.15.2/Submit) id u7HG1quv031075 for svn-soc-all@FreeBSD.org; Wed, 17 Aug 2016 16:01:52 GMT (envelope-from yuanxunzhang@FreeBSD.org) Date: Wed, 17 Aug 2016 16:01:52 GMT Message-Id: <201608171601.u7HG1quv031075@socsvn.freebsd.org> X-Authentication-Warning: socsvn.freebsd.org: www set sender to yuanxunzhang@FreeBSD.org using -f From: yuanxunzhang@FreeBSD.org To: svn-soc-all@FreeBSD.org Subject: socsvn commit: r307816 - in soc2016/yuanxunzhang/head: sys/net usr.sbin/eaps MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-soc-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the entire Summer of Code repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Aug 2016 16:01:53 -0000 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)