From owner-svn-src-all@FreeBSD.ORG Thu Aug 2 07:35:41 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 427C3106566B; Thu, 2 Aug 2012 07:35:41 +0000 (UTC) (envelope-from luigi@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1547F8FC0A; Thu, 2 Aug 2012 07:35:41 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q727Zeq6051575; Thu, 2 Aug 2012 07:35:40 GMT (envelope-from luigi@svn.freebsd.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q727ZeUd051573; Thu, 2 Aug 2012 07:35:40 GMT (envelope-from luigi@svn.freebsd.org) Message-Id: <201208020735.q727ZeUd051573@svn.freebsd.org> From: Luigi Rizzo Date: Thu, 2 Aug 2012 07:35:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238982 - head/sys/dev/netmap X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 Aug 2012 07:35:41 -0000 Author: luigi Date: Thu Aug 2 07:35:40 2012 New Revision: 238982 URL: http://svn.freebsd.org/changeset/base/238982 Log: Add a newline on an error message; rename linux functions to avoid confusion; fix error reporting on linux Modified: head/sys/dev/netmap/netmap.c Modified: head/sys/dev/netmap/netmap.c ============================================================================== --- head/sys/dev/netmap/netmap.c Thu Aug 2 00:00:34 2012 (r238981) +++ head/sys/dev/netmap/netmap.c Thu Aug 2 07:35:40 2012 (r238982) @@ -56,7 +56,7 @@ #ifdef linux #include "bsd_glue.h" -static netdev_tx_t netmap_start_linux(struct sk_buff *skb, struct net_device *dev); +static netdev_tx_t linux_netmap_start(struct sk_buff *skb, struct net_device *dev); #endif /* linux */ #ifdef __APPLE__ @@ -1331,7 +1331,7 @@ netmap_attach(struct netmap_adapter *na, /* prepare a clone of the netdev ops */ na->nm_ndo = *ifp->netdev_ops; } - na->nm_ndo.ndo_start_xmit = netmap_start_linux; + na->nm_ndo.ndo_start_xmit = linux_netmap_start; #endif D("%s for %s", buf ? "ok" : "failed", ifp->if_xname); @@ -1554,7 +1554,7 @@ linux_netmap_poll(struct file * file, st } static int -netmap_mmap(struct file *f, struct vm_area_struct *vma) +linux_netmap_mmap(struct file *f, struct vm_area_struct *vma) { int lut_skip, i, j; int user_skip = 0; @@ -1596,7 +1596,7 @@ netmap_mmap(struct file *f, struct vm_ar } static netdev_tx_t -netmap_start_linux(struct sk_buff *skb, struct net_device *dev) +linux_netmap_start(struct sk_buff *skb, struct net_device *dev) { netmap_start(dev, skb); return (NETDEV_TX_OK); @@ -1637,7 +1637,7 @@ netmap_release(struct inode *inode, stru static struct file_operations netmap_fops = { - .mmap = netmap_mmap, + .mmap = linux_netmap_mmap, LIN_IOCTL_NAME = linux_netmap_ioctl, .poll = linux_netmap_poll, .release = netmap_release, @@ -1652,7 +1652,13 @@ static struct miscdevice netmap_cdevsw = static int netmap_init(void); static void netmap_fini(void); -module_init(netmap_init); +/* Errors have negative values on linux */ +static int linux_netmap_init(void) +{ + return -netmap_init(); +} + +module_init(linux_netmap_init); module_exit(netmap_fini); /* export certain symbols to other modules */ EXPORT_SYMBOL(netmap_attach); // driver attach routines @@ -2038,7 +2044,7 @@ netmap_init(void) error = netmap_memory_init(); if (error != 0) { - printf("netmap: unable to initialize the memory allocator."); + printf("netmap: unable to initialize the memory allocator.\n"); return (error); } printf("netmap: loaded module with %d Mbytes\n",