Date: Thu, 19 May 2005 04:44:26 +0000 (UTC) From: Bill Paul <wpaul@FreeBSD.org> To: src-committers@FreeBSD.org, cvs-src@FreeBSD.org, cvs-all@FreeBSD.org Subject: cvs commit: src/sys/compat/ndis ntoskrnl_var.h subr_ndis.c subr_ntoskrnl.c Message-ID: <200505190444.j4J4iQK9093616@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
wpaul 2005-05-19 04:44:26 UTC FreeBSD src repository Modified files: sys/compat/ndis ntoskrnl_var.h subr_ndis.c subr_ntoskrnl.c Log: Fix some of the things I broke so that the SMC2602W (AMD Am1772) driver works again. This driver uses NdisScheduleWorkItem(), and we have to take special steps to insure that its workitems don't collide with any of the other workitems used by the NDISulator. In particular, if one of the driver's work jobs blocks, it can prevent NdisMAllocateSharedMemoryAsync() from completing when expected. The original hack to fix this was to have NdisMAllocateSharedMemoryAsync() defer its work to the DPC queue instead of the general task queue. To fix it now, I decided to add some additional workitem threads. (There's supposed to be a pool of worker threads in Windows anyway.) Currently, there are 4. There should be at least 2. One is reserved for the legacy ExQueueWorkItem() API, while the others are used in round-robin by the IoQueueWorkItem() API. NdisMAllocateSharedMemoryAsync() uses the latter API while NdisScheduleWorkItem() uses the former, so the deadlock is avoided. Fixed NdisMRegisterDevice()/NdisMDeregisterDevice() to work a little more sensibly with the new driver_object/device_object framework. It doesn't really register a working user-mode interface, but the existing code was completely wrong for the new framework. Fixed a couple of bugs dealing with the cancellation of events and DPCs. When cancelling an event that's still on the timer queue (i.e. hasn't expired yet), reset dh_inserted in its dispatch header to FALSE. Previously, it was left set to TRUE, which would make a cancelled timer appear to have not been cancelled. Also, when removing a DPC from a queue, reset its list pointers, otherwise a cancelled DPC might mistakenly be treated as still pending. Lastly, fix the behavior of ntoskrnl_wakeup() when dealing with objects that have nobody waiting on them: sync event objects get their signalled state reset to FALSE, but notification objects should still be set to TRUE. Revision Changes Path 1.36 +6 -1 src/sys/compat/ndis/ntoskrnl_var.h 1.92 +11 -5 src/sys/compat/ndis/subr_ndis.c 1.69 +81 -26 src/sys/compat/ndis/subr_ntoskrnl.c
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200505190444.j4J4iQK9093616>