summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrad Smith <brad@cvs.openbsd.org>2014-12-01 01:59:46 +0000
committerBrad Smith <brad@cvs.openbsd.org>2014-12-01 01:59:46 +0000
commitdf9c2106155a8a5b630ba8089610353e21c31399 (patch)
tree00c5111c907d4548763bf9a13da7b56e94f04cf1
parent7e1c0e56270cc2d1f6631a610c261bf24fd03f53 (diff)
rxr ioctl handling.
-rw-r--r--sys/dev/pci/if_vic.c23
1 files changed, 22 insertions, 1 deletions
diff --git a/sys/dev/pci/if_vic.c b/sys/dev/pci/if_vic.c
index 3fc1646415b..cdea3b6bbee 100644
--- a/sys/dev/pci/if_vic.c
+++ b/sys/dev/pci/if_vic.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_vic.c,v 1.81 2014/07/13 23:10:23 deraadt Exp $ */
+/* $OpenBSD: if_vic.c,v 1.82 2014/12/01 01:59:45 brad Exp $ */
/*
* Copyright (c) 2006 Reyk Floeter <reyk@openbsd.org>
@@ -342,6 +342,7 @@ int vic_load_txb(struct vic_softc *, struct vic_txbuf *,
struct mbuf *);
void vic_watchdog(struct ifnet *);
int vic_ioctl(struct ifnet *, u_long, caddr_t);
+int vic_rxrinfo(struct vic_softc *, struct if_rxrinfo *);
void vic_init(struct ifnet *);
void vic_stop(struct ifnet *);
void vic_tick(void *);
@@ -1234,6 +1235,10 @@ vic_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data)
error = ifmedia_ioctl(ifp, ifr, &sc->sc_media, cmd);
break;
+ case SIOCGIFRXR:
+ error = vic_rxrinfo(sc, (struct if_rxrinfo *)ifr->ifr_data);
+ break;
+
default:
error = ether_ioctl(ifp, &sc->sc_ac, cmd, data);
}
@@ -1248,6 +1253,22 @@ vic_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data)
return (error);
}
+int
+vic_rxrinfo(struct vic_softc *sc, struct if_rxrinfo *ifri)
+{
+ struct if_rxring_info ifr[2];
+
+ memset(ifr, 0, sizeof(ifr));
+
+ ifr[0].ifr_size = MCLBYTES;
+ ifr[0].ifr_info = sc->sc_rxq[0].ring;
+
+ ifr[1].ifr_size = 4096;
+ ifr[1].ifr_info = sc->sc_rxq[1].ring;
+
+ return (if_rxr_info_ioctl(ifri, nitems(ifr), ifr));
+}
+
void
vic_init(struct ifnet *ifp)
{