summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authorimp <imp@FreeBSD.org>2006-10-20 07:04:56 +0000
committerimp <imp@FreeBSD.org>2006-10-20 07:04:56 +0000
commite08539a4c7cf2b2975211c6cab9a2c8c637540fe (patch)
tree500f1cd86ace07566f9f8567faf6cb6d72791780 /sys
parent4084c0b8bc746da65c38bf615dcd6287852b305b (diff)
downloadFreeBSD-src-e08539a4c7cf2b2975211c6cab9a2c8c637540fe.zip
FreeBSD-src-e08539a4c7cf2b2975211c6cab9a2c8c637540fe.tar.gz
Add sysctl to export current state of rmii vs mii configuraiton.
Fix a typo in resource allocation.
Diffstat (limited to 'sys')
-rw-r--r--sys/arm/at91/if_ate.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/sys/arm/at91/if_ate.c b/sys/arm/at91/if_ate.c
index b236154..baaa112 100644
--- a/sys/arm/at91/if_ate.c
+++ b/sys/arm/at91/if_ate.c
@@ -29,7 +29,7 @@
*
* 1) detach
* 2) Free dma setup
- * 3) Turn on the clock in pmc and turn on pins? Turn off?
+ * 3) Turn on the clock in pmc? Turn off?
*/
#include <sys/cdefs.h>
@@ -45,6 +45,7 @@ __FBSDID("$FreeBSD$");
#include <sys/rman.h>
#include <sys/socket.h>
#include <sys/sockio.h>
+#include <sys/sysctl.h>
#include <machine/bus.h>
#include <net/ethernet.h>
@@ -167,6 +168,8 @@ ate_attach(device_t dev)
{
struct ate_softc *sc = device_get_softc(dev);
struct ifnet *ifp = NULL;
+ struct sysctl_ctx_list *sctx;
+ struct sysctl_oid *soid;
int err;
u_char eaddr[6];
@@ -177,6 +180,13 @@ ate_attach(device_t dev)
sc->use_rmii = (RD4(sc, ETH_CFG) & ETH_CFG_RMII) == ETH_CFG_RMII;
+
+ /*Sysctls*/
+ sctx = device_get_sysctl_ctx(dev);
+ soid = device_get_sysctl_tree(dev);
+ SYSCTL_ADD_UINT(sctx, SYSCTL_CHILDREN(soid), OID_AUTO, "rmii",
+ CTLFLAG_RD, &sc->use_rmii, 0, "rmii in use");
+
/* calling atestop before ifp is set is OK */
atestop(sc);
ATE_LOCK_INIT(sc);
@@ -323,7 +333,7 @@ ate_activate(device_t dev)
rid = 0;
sc->irq_res = bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid,
RF_ACTIVE);
- if (sc->mem_res == NULL)
+ if (sc->irq_res == NULL)
goto errout;
/*
OpenPOWER on IntegriCloud