From nobody@FreeBSD.org  Thu Aug  8 08:47:42 2013
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1])
	(using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
	(No client certificate requested)
	by hub.freebsd.org (Postfix) with ESMTP id A09E9F6A
	for <freebsd-gnats-submit@FreeBSD.org>; Thu,  8 Aug 2013 08:47:42 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from oldred.freebsd.org (oldred.freebsd.org [8.8.178.121])
	(using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))
	(No client certificate requested)
	by mx1.freebsd.org (Postfix) with ESMTPS id 8EE162FFE
	for <freebsd-gnats-submit@FreeBSD.org>; Thu,  8 Aug 2013 08:47:42 +0000 (UTC)
Received: from oldred.freebsd.org ([127.0.1.6])
	by oldred.freebsd.org (8.14.5/8.14.7) with ESMTP id r788lfbj043715
	for <freebsd-gnats-submit@FreeBSD.org>; Thu, 8 Aug 2013 08:47:42 GMT
	(envelope-from nobody@oldred.freebsd.org)
Received: (from nobody@localhost)
	by oldred.freebsd.org (8.14.5/8.14.5/Submit) id r788lfgf043714;
	Thu, 8 Aug 2013 08:47:41 GMT
	(envelope-from nobody)
Message-Id: <201308080847.r788lfgf043714@oldred.freebsd.org>
Date: Thu, 8 Aug 2013 08:47:41 GMT
From: Alexander  <Alexander.Klishin@billing.ru>
To: freebsd-gnats-submit@FreeBSD.org
Subject: sys/dev/netmap patch for Linux compatibility
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         181135
>Category:       kern
>Synopsis:       [netmap] [patch] sys/dev/netmap patch for Linux compatibility
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    luigi
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          update
>Submitter-Id:   current-users
>Arrival-Date:   Thu Aug 08 08:50:00 UTC 2013
>Closed-Date:    
>Last-Modified:  Fri Feb 07 19:08:23 UTC 2014
>Originator:     Alexander
>Release:        
>Organization:
www.billing.ru
>Environment:
>Description:
Linux contain more precise way to locate lock free version of "ioctl" function.

Current implementation is based on kernel version, and does not detect proper "ioctl" version on old kernels (RedHat 6.3, kernel 2.6.32).

Patch is attached.
>How-To-Repeat:

>Fix:


Patch attached with submission follows:

--- netmap/sys/dev/netmap/netmap.c	2013-08-07 13:17:25.000000000 +0400
+++ netmap.ioctl/sys/dev/netmap/netmap.c	2013-08-08 12:39:05.939206484 +0400
@@ -2027,7 +2027,7 @@
 }
 
 
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,37)	// XXX was 38
+#if !defined(HAVE_UNLOCKED_IOCTL)
 #define LIN_IOCTL_NAME	.ioctl
 int
 linux_netmap_ioctl(struct inode *inode, struct file *file, u_int cmd, u_long data /* arg */)


>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->freebsd-net 
Responsible-Changed-By: linimon 
Responsible-Changed-When: Fri Aug 9 01:26:45 UTC 2013 
Responsible-Changed-Why:  
Over to maintainer(s). 

http://www.freebsd.org/cgi/query-pr.cgi?pr=181135 
Responsible-Changed-From-To: freebsd-net->luigi 
Responsible-Changed-By: hiren 
Responsible-Changed-When: Fri Feb 7 19:07:43 UTC 2014 
Responsible-Changed-Why:  
To Luigi for further consideration. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=181135 
>Unformatted:
