B doesn’t get C’s device object. Whatever tool you are using is not
showing everything that is happening. In the HID stack, the hid mapper
(mouhid or kbdhid) continuously sends IRP_MJ_READs to the HID enumerated
PDO. HID completes these reads when there is data. In turn HIDCLASS
continuously sends reads to its own PDO. In the USB HID cases, these
are URBs. These reads are always pending and the usb bus completes them
when there is data.
On protocol buses, you generally have to send a read request to be
pended to get your data. When you send it is up to the data protocol
that your device has. For some devices you would always have a read
pending, for others you would only send a read after a certain event has
occurred (like a write).
d
-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of fearow
Sent: Saturday, October 08, 2005 8:01 PM
To: Windows System Software Devs Interest List
Subject: Re:[ntdev] Question about bus driver
I agree with that USB disk don’t send the data upward. But how about
mouse
and other HID devices? I used USB monitor (from www.hhdsoftware.com) to
capture the URBs between mouse driver and hub driver. When I moved the
mouse
I only see the URBs from hub driver to mouse driver. Which means URBs
been
sent from lower to upper driver. So the question is: If the driver stack
form lower to upper looks like following:
A <- B <- C (A is the lowest driver)
How does driver B get driver C’s DeviceObject?
Fearow
“David J. Craig” wrote in message
news:xxxxx@ntdev…
> You still have it backwards. A USB disk does not just decide to
suddenly
> ‘send’ data upward. It only does so in response to a request. Read
> Walter Oney’s 2nd Edition WDM book. Experiment and use windbg. You
can
> also use the learning hardware available on osronline. Just don’t use
> their drivers until you understand what’s going on. If you can’t get
a
> handle on it without using their drivers, you will need to spend at
least
> a solid week with the hardware, drivers, and windbg until you have
seen
> every routine being invoked.
>
> “fearow” wrote in message news:xxxxx@ntdev…
>> Thanks for your reply! I know USB device driver sends URB to bus
driver
>> to Tx data and I think bus driver also uses URB to deliver data to
upper
>> driver. The question is how does upper driver know that there is data
>> waiting in bus driver and then issues URB to read the data? Or does
bus
>> driver send URB to deliver data to upper driver as soon as data
received?
>> If bus driver initiates URB, how does bus driver find upper driver’s
>> DeviceObject? Can any kernel API do that? Thanks!
>>
>> Fearow
>>
>> “Mark Roddy” wrote in message
news:xxxxx@ntdev…
>>> The details of how data is transferred between the bus driver
managed IO
>>> bus
>>> and the function drivers for devices on that bus are specific to the
bus
>>> and
>>> not defined by the PnP architecture. Consequently the answer to your
>>> question is ‘it depends’.
>>>
>>> Consider the PCI bus driver. Each function driver manages its own
>>> hardware
>>> resources on the PCI bus its device is attached to and does not
interact
>>> with the PCI bus driver at all as far as data transfer operations
are
>>> concerned. If the function driver needs to access PCI configuration
>>> space,
>>> then it interacts with the PCI bus driver through a device
interface, or
>>> through specific PnP IRPs for configuration read/write operations.
>>>
>>> At the other end of the spectrum, consider a scsi bus driver (or a
usb
>>> bus
>>> driver.) All data transfers are managed by the bus driver, and the
bus
>>> driver defines a protocol and message format (SRB or URB) for
>>> transfering
>>> both data and configuration IO requests between function driver and
bus
>>> driver. In both cases the function driver sends IRPs to bus driver
PDO
>>> device objects and receives IRP completion request callback events
to
>>> continue processing of those requests.
>>>
>>> =====================
>>> Mark Roddy DDK MVP
>>> Windows 2003/XP/2000 Consulting
>>> Hollis Technology Solutions 603-321-1032
>>> www.hollistech.com
>>>
>>>> -----Original Message-----
>>>> From: xxxxx@lists.osr.com
>>>> [mailto:xxxxx@lists.osr.com] On Behalf Of fearow
>>>> Sent: Saturday, October 08, 2005 2:01 AM
>>>> To: Windows System Software Devs Interest List
>>>> Subject: [ntdev] Question about bus driver
>>>>
>>>> Hi All,
>>>>
>>>> I am new to WDM. When studied the Toaster sample code, I
>>>> couldn’t find any thing about sending the data to upper
>>>> driver object. I only can find the code about sending IRP
>>>> from upper driver to bus driver to R/W data. What happen if
>>>> BUS driver receive data and like to deliver to upper device
>>>> object? Is there anyway let bus driver acknowledge upper
>>>> device object send IRP to bus driver to read data? Thanks!
>>>>
>>>> Fearow
>>>>
>>>>
>>>>
>>>> —
>>>> Questions? First check the Kernel Driver FAQ at
>>>> http://www.osronline.com/article.cfm?id=256
>>>>
>>>> You are currently subscribed to ntdev as:
>>>> xxxxx@hollistech.com To unsubscribe send a blank email to
>>>> xxxxx@lists.osr.com
>>>>
>>>
>>>
>>>
>>
>>
>>
>
>
>
—
Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256
You are currently subscribed to ntdev as: xxxxx@microsoft.com
To unsubscribe send a blank email to xxxxx@lists.osr.com