From owner-cvs-src@FreeBSD.ORG Sun Apr 24 20:21:24 2005 Return-Path: Delivered-To: cvs-src@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id DF97216A4CE; Sun, 24 Apr 2005 20:21:23 +0000 (GMT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 9236E43D5C; Sun, 24 Apr 2005 20:21:23 +0000 (GMT) (envelope-from wpaul@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.1/8.13.1) with ESMTP id j3OKLNOe013963; Sun, 24 Apr 2005 20:21:23 GMT (envelope-from wpaul@repoman.freebsd.org) Received: (from wpaul@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id j3OKLN6r013958; Sun, 24 Apr 2005 20:21:23 GMT (envelope-from wpaul) Message-Id: <200504242021.j3OKLN6r013958@repoman.freebsd.org> From: Bill Paul Date: Sun, 24 Apr 2005 20:21:22 +0000 (UTC) To: src-committers@FreeBSD.org, cvs-src@FreeBSD.org, cvs-all@FreeBSD.org X-FreeBSD-CVS-Branch: HEAD Subject: cvs commit: src/sys/modules Makefile src/sys/compat/ndis kern_ndis.c kern_windrv.c ntoskrnl_var.h subr_hal.c subr_ndis.c subr_ntoskrnl.c src/sys/dev/if_ndis if_ndis.c if_ndis_pccard.c... X-BeenThere: cvs-src@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: CVS commit messages for the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 24 Apr 2005 20:21:24 -0000 wpaul 2005-04-24 20:21:22 UTC FreeBSD src repository Modified files: sys/modules Makefile sys/compat/ndis kern_ndis.c kern_windrv.c ntoskrnl_var.h subr_hal.c subr_ndis.c subr_ntoskrnl.c sys/dev/if_ndis if_ndis.c if_ndis_pccard.c if_ndis_pci.c if_ndis_usb.c if_ndisvar.h sys/modules/if_ndis Makefile sys/conf files.amd64 files.i386 usr.sbin/ndiscvt Makefile Added files: usr.sbin/ndiscvt ndisgen.8 ndisgen.sh windrv_stub.c Log: Throw the switch on the new driver generation/loading mechanism. From here on in, if_ndis.ko will be pre-built as a module, and can be built into a static kernel (though it's not part of GENERIC). Drivers are created using the new ndisgen(8) script, which uses ndiscvt(8) under the covers, along with a few other tools. The result is a driver module that can be kldloaded into the kernel. A driver with foo.inf and foo.sys files will be converted into foo_sys.ko (and foo_sys.o, for those who want/need to make static kernels). This module contains all of the necessary info from the .INF file and the driver binary image, converted into an ELF module. You can kldload this module (or add it to /boot/loader.conf) to have it loaded automatically. Any required firmware files can be bundled into the module as well (or converted/loaded separately). Also, add a workaround for a problem in NdisMSleep(). During system bootstrap (cold == 1), msleep() always returns 0 without actually sleeping. The Intel 2200BG driver uses NdisMSleep() to wait for the NIC's firmware to come to life, and fails to load if NdisMSleep() doesn't actually delay. As a workaround, if msleep() (and hence ndis_thsuspend()) returns 0, use a hard DELAY() to sleep instead). This is not really the right thing to do, but we can't really do much else. At the very least, this makes the Intel driver happy. There are probably other drivers that fail in this way during bootstrap. Unfortunately, the only workaround for those is to avoid pre-loading them and kldload them once the system is running instead. Revision Changes Path 1.78 +1 -1 src/sys/compat/ndis/kern_ndis.c 1.8 +80 -28 src/sys/compat/ndis/kern_windrv.c 1.33 +12 -1 src/sys/compat/ndis/ntoskrnl_var.h 1.21 +2 -0 src/sys/compat/ndis/subr_hal.c 1.85 +13 -6 src/sys/compat/ndis/subr_ndis.c 1.65 +2 -3 src/sys/compat/ndis/subr_ntoskrnl.c 1.64 +1 -0 src/sys/conf/files.amd64 1.530 +1 -0 src/sys/conf/files.i386 1.89 +7 -23 src/sys/dev/if_ndis/if_ndis.c 1.11 +40 -51 src/sys/dev/if_ndis/if_ndis_pccard.c 1.15 +38 -52 src/sys/dev/if_ndis/if_ndis_pci.c 1.5 +6 -23 src/sys/dev/if_ndis/if_ndis_usb.c 1.20 +1 -0 src/sys/dev/if_ndis/if_ndisvar.h 1.444 +3 -0 src/sys/modules/Makefile 1.5 +2 -1 src/sys/modules/if_ndis/Makefile 1.7 +7 -0 src/usr.sbin/ndiscvt/Makefile 1.1 +82 -0 src/usr.sbin/ndiscvt/ndisgen.8 (new) 1.1 +500 -0 src/usr.sbin/ndiscvt/ndisgen.sh (new) 1.1 +245 -0 src/usr.sbin/ndiscvt/windrv_stub.c (new)