From owner-cvs-all@FreeBSD.ORG Thu Feb 24 21:49:15 2005 Return-Path: Delivered-To: cvs-all@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 4E9B716A4E1; Thu, 24 Feb 2005 21:49:15 +0000 (GMT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 02D7E43D46; Thu, 24 Feb 2005 21:49:15 +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 j1OLnEib093588; Thu, 24 Feb 2005 21:49:14 GMT (envelope-from wpaul@repoman.freebsd.org) Received: (from wpaul@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id j1OLnEIO093587; Thu, 24 Feb 2005 21:49:14 GMT (envelope-from wpaul) Message-Id: <200502242149.j1OLnEIO093587@repoman.freebsd.org> From: Bill Paul Date: Thu, 24 Feb 2005 21:49:14 +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/conf files.amd64 files.i386 src/sys/modules/ndis Makefile src/sys/compat/ndis kern_ndis.c kern_windrv.c ntoskrnl_var.h subr_usbd.c usbd_var.h src/sys/dev/if_ndis if_ndis.c if_ndis_pccard.c if_ndis_pci.c ... X-BeenThere: cvs-all@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: CVS commit messages for the entire tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Feb 2005 21:49:15 -0000 wpaul 2005-02-24 21:49:14 UTC FreeBSD src repository Modified files: sys/conf files.amd64 files.i386 sys/modules/ndis Makefile sys/compat/ndis kern_ndis.c kern_windrv.c ntoskrnl_var.h sys/dev/if_ndis if_ndis.c if_ndis_pccard.c if_ndis_pci.c Added files: sys/compat/ndis subr_usbd.c usbd_var.h sys/dev/if_ndis if_ndis_usb.c Log: - Correct one aspect of the driver_object/device_object/IRP framework: when we create a PDO, the driver_object associated with it is that of the parent driver, not the driver we're trying to attach. For example, if we attach a PCI device, the PDO we pass to the NdisAddDevice() function should contain a pointer to fake_pci_driver, not to the NDIS driver itself. For PCI or PCMCIA devices this doesn't matter because the child never needs to talk to the parent bus driver, but for USB, the child needs to be able to send IRPs to the parent USB bus driver, and for that to work the parent USB bus driver has to be hung off the PDO. This involves modifying windrv_lookup() so that we can search for bus drivers by name, if necessary. Our fake bus drivers attach themselves as "PCI Bus," "PCCARD Bus" and "USB Bus," so we can search for them using those names. The individual attachment stubs now create and attach PDOs to the parent bus drivers instead of hanging them off the NDIS driver's object, and in if_ndis.c, we now search for the correct driver object depending on the bus type, and use that to find the correct PDO. With this fix, I can get my sample USB ethernet driver to deliver an IRP to my fake parent USB bus driver's dispatch routines. - Add stub modules for USB support: subr_usbd.c, usbd_var.h and if_ndis_usb.c. The subr_usbd.c module is hooked up the build but currently doesn't do very much. It provides the stub USB parent driver object and a dispatch routine for IRM_MJ_INTERNAL_DEVICE_CONTROL. The only exported function at the moment is USBD_GetUSBDIVersion(). The if_ndis_usb.c stub compiles, but is not hooked up to the build yet. I'm putting these here so I can keep them under source code control as I flesh them out. Revision Changes Path 1.67 +4 -0 src/sys/compat/ndis/kern_ndis.c 1.4 +20 -5 src/sys/compat/ndis/kern_windrv.c 1.26 +1 -1 src/sys/compat/ndis/ntoskrnl_var.h 1.1 +156 -0 src/sys/compat/ndis/subr_usbd.c (new) 1.1 +56 -0 src/sys/compat/ndis/usbd_var.h (new) 1.56 +1 -0 src/sys/conf/files.amd64 1.519 +1 -0 src/sys/conf/files.i386 1.80 +32 -11 src/sys/dev/if_ndis/if_ndis.c 1.9 +2 -4 src/sys/dev/if_ndis/if_ndis_pccard.c 1.11 +1 -3 src/sys/dev/if_ndis/if_ndis_pci.c 1.1 +176 -0 src/sys/dev/if_ndis/if_ndis_usb.c (new) 1.9 +1 -1 src/sys/modules/ndis/Makefile