NetBSD Problem Report #39034

From anon-netbsd-sendpr@daprile.net  Wed Jun 25 02:26:31 2008
Return-Path: <anon-netbsd-sendpr@daprile.net>
Received: from mail.netbsd.org (mail.netbsd.org [204.152.190.11])
	by narn.NetBSD.org (Postfix) with ESMTP id 5753463B880
	for <gnats-bugs@gnats.netbsd.org>; Wed, 25 Jun 2008 02:26:31 +0000 (UTC)
Message-Id: <1214360789.29851@pinga.daprile.net>
Date: Tue, 24 Jun 2008 21:26:29 -0500
From: "Gianni D'Aprile" <anon-netbsd-sendpr@daprile.net>
To: "gnats bugs" <gnats-bugs@gnats.netbsd.org>
Subject: if_ndis is broken in NetBSD-current with sources from 06/24/2008
X-Send-Pr-Version: gtk-send-pr 0.4.9 
X-GNATS-Notify:

>Number:         39034
>Category:       kern
>Synopsis:       if_ndis is broken in NetBSD-current with sources from 06/24/2008
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    kern-bug-people
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Jun 25 02:30:00 +0000 2008
>Closed-Date:    Sun Aug 02 20:42:22 +0000 2009
>Last-Modified:  Fri Aug 14 21:10:03 +0000 2009
>Originator:     Gianni D'Aprile
>Release:        NetBSD 4.99.65 i386
>Organization:
>Environment:


System: NetBSD 4.99.65 (PINGA) #24: Tue Jun 17 22:11:59 CDT 2008
	toor@pinga.daprile.net:/usr/obj/usr/src/sys/arch/i386/compile/PINGA



>Description:


if_ndis has bitrotted a bit on NetBSD-current with sources from 6/24/2008


>How-To-Repeat:


Try to build a kernel with:

options        COMPAT_NDIS
ndis*   at pci? dev ? function ?

You will also need a valid ndis_driver_data.h produced with ndiscvt in your kernel compile directory.


>Fix:


--- 2008062401_if_ndis.patch begins here ---
Index: sys/dev/if_ndis/if_ndis.c
===================================================================
RCS file: /cvsroot/src/sys/dev/if_ndis/if_ndis.c,v
retrieving revision 1.18
diff -u -r1.18 if_ndis.c
--- sys/dev/if_ndis/if_ndis.c	8 Apr 2008 06:12:21 -0000	1.18
+++ sys/dev/if_ndis/if_ndis.c	25 Jun 2008 01:57:54 -0000
@@ -332,7 +332,7 @@
 		error = ndis_set_info(sc, OID_GEN_CURRENT_PACKET_FILTER,
 		    &sc->ndis_filter, &len);
         if (error) {
-		aprint_error_dev(sc->ndif_dev, "set filter failed: %d\n", 
+		aprint_error_dev(sc->ndis_dev, "set filter failed: %d\n", 
 			     error);
         }
 		return;
@@ -693,7 +693,7 @@
 	}

 	/* Tell the user what version of the API the driver is using. */
-	aprint_normal_dev(&sc->ndis_dev, "NDIS API version: %d.%d\n",
+	aprint_normal_dev(sc->ndis_dev, "NDIS API version: %d.%d\n",
 		      sc->ndis_chars->nmc_version_major,
 		      sc->ndis_chars->nmc_version_minor);

@@ -1184,7 +1184,7 @@
 #endif
 #endif

-	mtx_destroy(&sc->ndis_mtx);
+	/* mtx_destroy(&sc->ndis_mtx); */

 	return(0);
 }
@@ -2599,7 +2599,7 @@
 			error = ifmedia_ioctl(ifp, ifr, &sc->ifmedia, command);
 		break;
 	case SIOCSIFCAP:
-		if ((error = ether_ioctl(ifp, cmd, data)) == ENETRESET) {
+		if ((error = ether_ioctl(ifp, command, data)) == ENETRESET) {
 			ndis_set_offload(sc);
 			error = 0;
 		}
Index: sys/dev/if_ndis/if_ndis_pci.c
===================================================================
RCS file: /cvsroot/src/sys/dev/if_ndis/if_ndis_pci.c,v
retrieving revision 1.10
diff -u -r1.10 if_ndis_pci.c
--- sys/dev/if_ndis/if_ndis_pci.c	8 Apr 2008 06:12:21 -0000	1.10
+++ sys/dev/if_ndis/if_ndis_pci.c	25 Jun 2008 01:57:54 -0000
@@ -653,7 +653,7 @@
 	sc->ndis_rl = rl;
 	sc->ndis_rescnt = rl->cprl_count;

-	kthread_create(ndis_attach, (void *)sc);
+	kthread_create(PRI_NONE, 0, NULL, ndis_attach, (void *)sc, NULL, "ndis_attach");
 }
 #endif /* __NetBSD__ */

--- 2008062401_if_ndis.patch ends here ---



>Release-Note:

>Audit-Trail:
From: Geert Hendrickx <ghen@telenet.be>
To: gnats-bugs@NetBSD.org
Cc: is@netbsd.org
Subject: Re: kern/39034: if_ndis is broken in NetBSD-current with sources
	from 06/24/2008
Date: Thu, 26 Mar 2009 13:09:29 +0100

 --Kj7319i9nmIyA2yE
 Content-Type: text/plain; charset=us-ascii
 Content-Disposition: inline

 Works for me.

 Here is a version of the patch for NetBSD 5.0.

 	Geert


 --Kj7319i9nmIyA2yE
 Content-Type: text/plain; charset=us-ascii
 Content-Disposition: attachment; filename="if_ndis_netbsd5.patch"

 Index: if_ndis.c
 ===================================================================
 RCS file: /cvsroot/src/sys/dev/if_ndis/if_ndis.c,v
 retrieving revision 1.18
 diff -u -r1.18 if_ndis.c
 --- if_ndis.c	8 Apr 2008 06:12:21 -0000	1.18
 +++ if_ndis.c	26 Mar 2009 12:06:59 -0000
 @@ -332,7 +332,7 @@
  		error = ndis_set_info(sc, OID_GEN_CURRENT_PACKET_FILTER,
  		    &sc->ndis_filter, &len);
          if (error) {
 -		aprint_error_dev(sc->ndif_dev, "set filter failed: %d\n", 
 +		aprint_error_dev(sc->ndis_dev, "set filter failed: %d\n", 
  			     error);
          }
  		return;
 @@ -693,7 +693,7 @@
  	}

  	/* Tell the user what version of the API the driver is using. */
 -	aprint_normal_dev(&sc->ndis_dev, "NDIS API version: %d.%d\n",
 +	aprint_normal_dev(sc->ndis_dev, "NDIS API version: %d.%d\n",
  		      sc->ndis_chars->nmc_version_major,
  		      sc->ndis_chars->nmc_version_minor);

 @@ -1184,7 +1184,7 @@
  #endif
  #endif

 -	mtx_destroy(&sc->ndis_mtx);
 +	/* mtx_destroy(&sc->ndis_mtx); */

  	return(0);
  }
 @@ -2599,7 +2599,7 @@
  			error = ifmedia_ioctl(ifp, ifr, &sc->ifmedia, command);
  		break;
  	case SIOCSIFCAP:
 -		if ((error = ether_ioctl(ifp, cmd, data)) == ENETRESET) {
 +		if ((error = ether_ioctl(ifp, command, data)) == ENETRESET) {
  			ndis_set_offload(sc);
  			error = 0;
  		}
 Index: if_ndis_pci.c
 ===================================================================
 RCS file: /cvsroot/src/sys/dev/if_ndis/if_ndis_pci.c,v
 retrieving revision 1.10
 diff -u -r1.10 if_ndis_pci.c
 --- if_ndis_pci.c	8 Apr 2008 06:12:21 -0000	1.10
 +++ if_ndis_pci.c	26 Mar 2009 12:06:59 -0000
 @@ -653,7 +653,7 @@
  	sc->ndis_rl = rl;
  	sc->ndis_rescnt = rl->cprl_count;

 -	kthread_create(ndis_attach, (void *)sc);
 +	kthread_create(PRI_NONE, 0, NULL, ndis_attach, (void *)sc, NULL, "ndis_attach");
  }
  #endif /* __NetBSD__ */


 --Kj7319i9nmIyA2yE--

From: David Laight <dsl@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/39034 CVS commit: src/sys/dev/if_ndis
Date: Sun, 2 Aug 2009 20:22:34 +0000

 Module Name:	src
 Committed By:	dsl
 Date:		Sun Aug  2 20:22:34 UTC 2009

 Modified Files:
 	src/sys/dev/if_ndis: if_ndis.c if_ndis_pci.c

 Log Message:
 Patch from PR/39034 - should make this compile!
 I've not removed the mtx_destroy() since that has to be in there somewhere.
 Patch may apply to netbsd 5.0


 To generate a diff of this commit:
 cvs rdiff -u -r1.27 -r1.28 src/sys/dev/if_ndis/if_ndis.c
 cvs rdiff -u -r1.15 -r1.16 src/sys/dev/if_ndis/if_ndis_pci.c

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

State-Changed-From-To: open->closed
State-Changed-By: dsl@NetBSD.org
State-Changed-When: Sun, 02 Aug 2009 20:42:22 +0000
State-Changed-Why:
patch applied to current, and pullup for netbsd 5 requested.
mutex_destroy not removed though.


From: Soren Jacobsen <snj@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/39034 CVS commit: [netbsd-5-0] src/sys/dev/if_ndis
Date: Fri, 14 Aug 2009 21:04:49 +0000

 Module Name:	src
 Committed By:	snj
 Date:		Fri Aug 14 21:04:49 UTC 2009

 Modified Files:
 	src/sys/dev/if_ndis [netbsd-5-0]: if_ndis.c if_ndis_pci.c

 Log Message:
 Pull up following revision(s) (requested by dsl in ticket #888):
 	sys/dev/if_ndis/if_ndis.c: revision 1.28
 	sys/dev/if_ndis/if_ndis_pci.c: revision 1.16
 Patch from PR/39034 - should make this compile!
 I've not removed the mtx_destroy() since that has to be in there somewhere.


 To generate a diff of this commit:
 cvs rdiff -u -r1.18 -r1.18.16.1 src/sys/dev/if_ndis/if_ndis.c
 cvs rdiff -u -r1.10 -r1.10.16.1 src/sys/dev/if_ndis/if_ndis_pci.c

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

From: Soren Jacobsen <snj@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/39034 CVS commit: [netbsd-5] src/sys/dev/if_ndis
Date: Fri, 14 Aug 2009 21:06:04 +0000

 Module Name:	src
 Committed By:	snj
 Date:		Fri Aug 14 21:06:04 UTC 2009

 Modified Files:
 	src/sys/dev/if_ndis [netbsd-5]: if_ndis.c if_ndis_pci.c

 Log Message:
 Pull up following revision(s) (requested by dsl in ticket #888):
 	sys/dev/if_ndis/if_ndis.c: revision 1.28
 	sys/dev/if_ndis/if_ndis_pci.c: revision 1.16
 Patch from PR/39034 - should make this compile!
 I've not removed the mtx_destroy() since that has to be in there somewhere.


 To generate a diff of this commit:
 cvs rdiff -u -r1.18 -r1.18.14.1 src/sys/dev/if_ndis/if_ndis.c
 cvs rdiff -u -r1.10 -r1.10.14.1 src/sys/dev/if_ndis/if_ndis_pci.c

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.39 2013/11/01 18:47:49 spz Exp $
$NetBSD: gnats_config.sh,v 1.8 2006/05/07 09:23:38 tsutsui Exp $
Copyright © 1994-2007 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.