summaryrefslogtreecommitdiffstats
path: root/sys/dev/netmap/ixgbe_netmap.h
diff options
context:
space:
mode:
authorluigi <luigi@FreeBSD.org>2012-02-13 18:56:34 +0000
committerluigi <luigi@FreeBSD.org>2012-02-13 18:56:34 +0000
commit22f0ffdf7d29c6da65e725e5424ac30ccc3283ed (patch)
tree03c80ec35deedb547cec96fb9ffabbec273b6a5c /sys/dev/netmap/ixgbe_netmap.h
parent4772d2322f30ac2aa49760c6ef85b0834f9b8e4c (diff)
downloadFreeBSD-src-22f0ffdf7d29c6da65e725e5424ac30ccc3283ed.zip
FreeBSD-src-22f0ffdf7d29c6da65e725e5424ac30ccc3283ed.tar.gz
- use struct ifnet as explicit type of the argument to the
txsync() and rxsync() callbacks, removing some variables made useless by this change; - add generic lock and irq handling routines. These can be useful in case there are no driver locks that we can reuse; - add a few macros to reduce differences with the Linux version.
Diffstat (limited to 'sys/dev/netmap/ixgbe_netmap.h')
-rw-r--r--sys/dev/netmap/ixgbe_netmap.h18
1 files changed, 9 insertions, 9 deletions
diff --git a/sys/dev/netmap/ixgbe_netmap.h b/sys/dev/netmap/ixgbe_netmap.h
index 644ab2e..bdcaf38 100644
--- a/sys/dev/netmap/ixgbe_netmap.h
+++ b/sys/dev/netmap/ixgbe_netmap.h
@@ -55,9 +55,9 @@
* *_netmap_attach() routine.
*/
static int ixgbe_netmap_reg(struct ifnet *, int onoff);
-static int ixgbe_netmap_txsync(void *, u_int, int);
-static int ixgbe_netmap_rxsync(void *, u_int, int);
-static void ixgbe_netmap_lock_wrapper(void *, int, u_int);
+static int ixgbe_netmap_txsync(struct ifnet *, u_int, int);
+static int ixgbe_netmap_rxsync(struct ifnet *, u_int, int);
+static void ixgbe_netmap_lock_wrapper(struct ifnet *, int, u_int);
/*
@@ -90,9 +90,9 @@ ixgbe_netmap_attach(struct adapter *adapter)
* wrapper to export locks to the generic netmap code.
*/
static void
-ixgbe_netmap_lock_wrapper(void *_a, int what, u_int queueid)
+ixgbe_netmap_lock_wrapper(struct ifnet *_a, int what, u_int queueid)
{
- struct adapter *adapter = _a;
+ struct adapter *adapter = _a->if_softc;
ASSERT(queueid < adapter->num_queues);
switch (what) {
@@ -190,9 +190,9 @@ fail:
* buffers irrespective of interrupt mitigation.
*/
static int
-ixgbe_netmap_txsync(void *a, u_int ring_nr, int do_lock)
+ixgbe_netmap_txsync(struct ifnet *ifp, u_int ring_nr, int do_lock)
{
- struct adapter *adapter = a;
+ struct adapter *adapter = ifp->if_softc;
struct tx_ring *txr = &adapter->tx_rings[ring_nr];
struct netmap_adapter *na = NA(adapter->ifp);
struct netmap_kring *kring = &na->tx_rings[ring_nr];
@@ -418,9 +418,9 @@ ring_reset:
* do_lock has a special meaning: please refer to txsync.
*/
static int
-ixgbe_netmap_rxsync(void *a, u_int ring_nr, int do_lock)
+ixgbe_netmap_rxsync(struct ifnet *ifp, u_int ring_nr, int do_lock)
{
- struct adapter *adapter = a;
+ struct adapter *adapter = ifp->if_softc;
struct rx_ring *rxr = &adapter->rx_rings[ring_nr];
struct netmap_adapter *na = NA(adapter->ifp);
struct netmap_kring *kring = &na->rx_rings[ring_nr];
OpenPOWER on IntegriCloud