summaryrefslogtreecommitdiffstats
path: root/sys/dev/netmap
diff options
context:
space:
mode:
authorluigi <luigi@FreeBSD.org>2012-07-30 18:21:48 +0000
committerluigi <luigi@FreeBSD.org>2012-07-30 18:21:48 +0000
commita85891a9e65f7574e20609c913c528d61354dd3c (patch)
tree60cc21d00648c4e4de5362b930a08956e1a1bea0 /sys/dev/netmap
parent18c77ad45409e71e62e91d336526a6254a64a1c9 (diff)
downloadFreeBSD-src-a85891a9e65f7574e20609c913c528d61354dd3c.zip
FreeBSD-src-a85891a9e65f7574e20609c913c528d61354dd3c.tar.gz
- move the inclusion of netmap headers to the common part of the code;
- more portable annotations for unused arguments;
Diffstat (limited to 'sys/dev/netmap')
-rw-r--r--sys/dev/netmap/netmap.c19
-rw-r--r--sys/dev/netmap/netmap_mem2.c5
2 files changed, 15 insertions, 9 deletions
diff --git a/sys/dev/netmap/netmap.c b/sys/dev/netmap/netmap.c
index 59263e5..6fcdb17 100644
--- a/sys/dev/netmap/netmap.c
+++ b/sys/dev/netmap/netmap.c
@@ -90,13 +90,14 @@ __FBSDID("$FreeBSD$");
#include <net/if.h>
#include <net/bpf.h> /* BIOCIMMEDIATE */
#include <net/vnet.h>
-#include <net/netmap.h>
-#include <dev/netmap/netmap_kern.h>
#include <machine/bus.h> /* bus_dmamap_* */
MALLOC_DEFINE(M_NETMAP, "netmap", "Network memory map");
#endif /* __FreeBSD__ */
+#include <net/netmap.h>
+#include <dev/netmap/netmap_kern.h>
+
/*
* lock and unlock for the netmap memory allocator
*/
@@ -764,8 +765,8 @@ netmap_set_ringid(struct netmap_priv_d *priv, u_int ringid)
* Return 0 on success, errno otherwise.
*/
static int
-netmap_ioctl(__unused struct cdev *dev, u_long cmd, caddr_t data,
- __unused int fflag, struct thread *td)
+netmap_ioctl(struct cdev *dev, u_long cmd, caddr_t data,
+ int fflag, struct thread *td)
{
struct netmap_priv_d *priv = NULL;
struct ifnet *ifp;
@@ -775,6 +776,8 @@ netmap_ioctl(__unused struct cdev *dev, u_long cmd, caddr_t data,
u_int i, lim;
struct netmap_if *nifp;
+ (void)dev; /* UNUSED */
+ (void)fflag; /* UNUSED */
#ifdef linux
#define devfs_get_cdevpriv(pp) \
({ *(struct netmap_priv_d **)pp = ((struct file *)td)->private_data; \
@@ -1551,7 +1554,7 @@ linux_netmap_poll(struct file * file, struct poll_table_struct *pwait)
}
static int
-netmap_mmap(__unused struct file *f, struct vm_area_struct *vma)
+netmap_mmap(struct file *f, struct vm_area_struct *vma)
{
int lut_skip, i, j;
int user_skip = 0;
@@ -1565,6 +1568,7 @@ netmap_mmap(__unused struct file *f, struct vm_area_struct *vma)
* vma->vm_end: end of the mapping user address space
*/
+ (void)f; /* UNUSED */
// XXX security checks
for (i = 0; i < 3; i++) { /* loop through obj_pools */
@@ -1599,7 +1603,7 @@ netmap_start_linux(struct sk_buff *skb, struct net_device *dev)
}
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,38)
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,37) // XXX was 38
#define LIN_IOCTL_NAME .ioctl
int
linux_netmap_ioctl(struct inode *inode, struct file *file, u_int cmd, u_long data /* arg */)
@@ -1623,8 +1627,9 @@ linux_netmap_ioctl(struct file *file, u_int cmd, u_long data /* arg */)
static int
-netmap_release(__unused struct inode *inode, struct file *file)
+netmap_release(struct inode *inode, struct file *file)
{
+ (void)inode; /* UNUSED */
if (file->private_data)
netmap_dtor(file->private_data);
return (0);
diff --git a/sys/dev/netmap/netmap_mem2.c b/sys/dev/netmap/netmap_mem2.c
index b44d9f4..03a665a 100644
--- a/sys/dev/netmap/netmap_mem2.c
+++ b/sys/dev/netmap/netmap_mem2.c
@@ -25,7 +25,7 @@
/*
* $FreeBSD$
- * $Id: netmap_mem2.c 10830 2012-03-22 18:06:01Z luigi $
+ * $Id: netmap_mem2.c 11445 2012-07-30 10:49:07Z luigi $
*
* New memory allocator for netmap
*/
@@ -300,12 +300,13 @@ netmap_obj_free_va(struct netmap_obj_pool *p, void *vaddr)
static void
-netmap_new_bufs(struct netmap_if *nifp __unused,
+netmap_new_bufs(struct netmap_if *nifp,
struct netmap_slot *slot, u_int n)
{
struct netmap_obj_pool *p = nm_mem->nm_buf_pool;
uint32_t i = 0; /* slot counter */
+ (void)nifp; /* UNUSED */
for (i = 0; i < n; i++) {
void *vaddr = netmap_buf_malloc();
if (vaddr == NULL) {
OpenPOWER on IntegriCloud