diff options
author | luigi <luigi@FreeBSD.org> | 2012-04-12 11:27:09 +0000 |
---|---|---|
committer | luigi <luigi@FreeBSD.org> | 2012-04-12 11:27:09 +0000 |
commit | 3d2bebcc357d4da177ad59f682b1fc1ed4bd0cc0 (patch) | |
tree | c99f27d37227d2e9605a9818308be06280c1733a /sys/dev/netmap/netmap_kern.h | |
parent | c67d18e86934afd3ef175f3eb60c663181ca2d24 (diff) | |
download | FreeBSD-src-3d2bebcc357d4da177ad59f682b1fc1ed4bd0cc0.zip FreeBSD-src-3d2bebcc357d4da177ad59f682b1fc1ed4bd0cc0.tar.gz |
Some code restructuring to bring the memory allocator out of netmap.c
and make it easier to replace it with a different implementation.
On passing, also fix indentation.
NOTE: I know that #include "foo.c" is ugly, but the alternative
(add another entry to sys/conf/files, add a separate header with
structs and prototypes, and expose functions that are meant to
be private) looks even worse to me.
We need a more modular way to specify dependencies and build options.
Diffstat (limited to 'sys/dev/netmap/netmap_kern.h')
-rw-r--r-- | sys/dev/netmap/netmap_kern.h | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/sys/dev/netmap/netmap_kern.h b/sys/dev/netmap/netmap_kern.h index 7660d14..f271b5e 100644 --- a/sys/dev/netmap/netmap_kern.h +++ b/sys/dev/netmap/netmap_kern.h @@ -86,7 +86,7 @@ struct netmap_kring { u_int nr_hwcur; int nr_hwavail; u_int nr_kflags; /* private driver flags */ -#define NKR_PENDINTR 0x1 // Pending interrupt. +#define NKR_PENDINTR 0x1 // Pending interrupt. u_int nkr_num_slots; int nkr_hwofs; /* offset between NIC and netmap ring */ @@ -208,7 +208,7 @@ struct netmap_slot *netmap_reset(struct netmap_adapter *na, int netmap_ring_reinit(struct netmap_kring *); extern int netmap_buf_size; -#define NETMAP_BUF_SIZE netmap_buf_size +#define NETMAP_BUF_SIZE netmap_buf_size extern int netmap_mitigate; extern int netmap_no_pendintr; extern u_int netmap_total_buffers; @@ -303,7 +303,7 @@ NMB(struct netmap_slot *slot) { uint32_t i = slot->buf_idx; return (i >= netmap_total_buffers) ? netmap_buffer_base : - netmap_buffer_base + (i *NETMAP_BUF_SIZE); + netmap_buffer_base + (i * NETMAP_BUF_SIZE); } static inline void * @@ -311,7 +311,7 @@ PNMB(struct netmap_slot *slot, uint64_t *pp) { uint32_t i = slot->buf_idx; void *ret = (i >= netmap_total_buffers) ? netmap_buffer_base : - netmap_buffer_base + (i *NETMAP_BUF_SIZE); + netmap_buffer_base + (i * NETMAP_BUF_SIZE); *pp = vtophys(ret); return ret; } @@ -319,8 +319,4 @@ PNMB(struct netmap_slot *slot, uint64_t *pp) /* default functions to handle rx/tx interrupts */ int netmap_rx_irq(struct ifnet *, int, int *); #define netmap_tx_irq(_n, _q) netmap_rx_irq(_n, _q, NULL) -#ifdef __linux__ -#define bus_dmamap_sync(_a, _b, _c) // wmb() or rmb() ? -netdev_tx_t netmap_start_linux(struct sk_buff *skb, struct net_device *dev); -#endif #endif /* _NET_NETMAP_KERN_H_ */ |