Driver Problems? Questions? Issues?
Put OSR's experience to work for you! Contact us for assistance with:
  • Creating the right design for your requirements
  • Reviewing your existing driver code
  • Analyzing driver reliability/performance issues
  • Custom training mixed with consulting and focused directly on your specific areas of interest/concern.
Check us out. OSR, the Windows driver experts.

Upcoming OSR Seminars:

Writing WDF Drivers I: Core Concepts, Nashua, NH 30 January-3 February, 2017
Kernel Debugging and Crash Analysis, Nashua, NH 20-24 February, 2017
Windows Internals & Software Driver Development, Dulles, VA 27-31 March, 2017
Writing WDF Drivers II: Advanced Implementation Tech., Nashua, NH 23-26 May, 2017
Kernel Debugging and Crash Analysis, Dulles, VA 26-30 June, 2017
Windows Internals & Software Driver Development, Nashua, NH 24-28 July, 2017


Go Back   OSR Online Lists > ntdev
Welcome, Guest
You must login to post to this list
  Message 1 of 3  
11 Jan 17 03:25
Nguyen The Hung
xxxxxx@yahoo.com.vn
Join Date: 20 Oct 2014
Posts To This List: 11
Data communication between Bus driver and device driver

Hi All, I am new to driver and I need your help for understand about how bus driver and device driver transfer data.I will need to make driver for PCI card with multi-serial so I will ask question related to this specific type but any suggestion or other guide to understand about bus and device driver communication will be also be welcomed. I image the card will have 1 interrupt shared by, let say 8 serial ports, and all UART registers are separated. I have read in OSR and it seems the structure should be : - Bus driver talk PCI downward and Serial upward - Serial drivers for each port. When an interrupt came, i will need to check all registers of all 8 serial ports to verify which Serial generate interrupt. In here I have a questions that if it is possible when i checked, two serial can be marked as both generated interrupt ? If yes i think i will need to keep track of which Serial in 8 ports generated interrupt. And then in DPC, i need to transfer data from bus to serial driver or is there another way to transfer it ? In here i am pretty clueless. Is there any sample or guide i can read about this part ? Thank you all,
  Message 2 of 3  
11 Jan 17 20:31
Tim Roberts
xxxxxx@probo.com
Join Date: 28 Jan 2005
Posts To This List: 11263
Data communication between Bus driver and device driver

On Jan 11, 2017, at 12:23 AM, xxxxx@yahoo.com.vn wrote: > > I am new to driver and I need your help for understand about how bus driver and device driver transfer data.I will need to make driver for PCI card with multi-serial so I will ask question related to this specific type but any suggestion or other guide to understand about bus and device driver communication will be also be welcomed. I image the card will have 1 interrupt shared by, let say 8 serial ports, and all UART registers are separated. I have read in OSR and it seems the structure should be : > - Bus driver talk PCI downward and Serial upward > - Serial drivers for each port. I would expect the bus driver to do little more than arbitrate access to the shared resources. I would expect it to hand control of the UART registers to the individual serial port drivers. So, you'd have some private scheme where the serial drivers register themselves with the bus driver when they are able to handle interrupts. Then, when the bus driver gets an interrupt, it sees which ports have fired, and notifies the responsible port driver(s). The drivers can then operate autonomously. > When an interrupt came, i will need to check all registers of all 8 serial ports to verify which Serial generate interrupt. In here I have a questions that if it is possible when i checked, two serial can be marked as both generated interrupt ? Only you can answer that question. How does your hardware behave? I would assume that it's easily possible for several ports to demand attention before you're able to get around to servicing them. > If yes i think i will need to keep track of which Serial in 8 ports generated interrupt. You would have to do that anyway. > And then in DPC, i need to transfer data from bus to serial driver or is there another way to transfer it ? In here i am pretty clueless. Is there any sample or guide i can read about this part ? I wouldn't do the transfer in the bus driver. Have the bus driver notify the port driver, and let each serial driver think it is the only one in the world. The only difference between this and a normal serial port is the arbitrated access to the shared interrupt. — Tim Roberts, xxxxx@probo.com Providenza & Boekelheide, Inc.
  Message 3 of 3  
11 Jan 17 20:57
Don Burn
xxxxxx@windrvr.com
Join Date: 23 Feb 2011
Posts To This List: 1276
Data communication between Bus driver and device driver

The bus driver will partition the registers, and probably has to hold the interrupt service routine. Assuming you are using an Altera design (I've seen this way too often since they claim a windows compatible design which requires a lot of software work), you will need: To break out the registers for the specific com port Provide an ISR in the bus driver that calls a callback routine that the given com ports function driver registers Support in the bus driver a routine to emulate WdfInterruptSynchronize The simplest way to do this is to have a device interface that the function driver can query to the bus drivers PDO to get the resources. Don't try to use the regular PnP model, it was explained years ago on this list how that can cause interesting bugs. You will also have a bunch of changes you will need to do to the serial port sample to make this all work. I've done this a number of times for clients to the point I now just sell them a license for the code. The first time will take you a few months to get stable, unless you are really fast. Don Burn Windows Driver Consulting Website: http://www.windrvr.com -----Original Message----- From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of xxxxx@yahoo.com.vn Sent: Wednesday, January 11, 2017 3:24 AM To: Windows System Software Devs Interest List <xxxxx@lists.osr.com> Subject: [ntdev] Data communication between Bus driver and device driver Hi All, I am new to driver and I need your help for understand about how bus driver and device driver transfer data.I will need to make driver for PCI card with multi-serial so I will ask question related to this specific type but any suggestion or other guide to understand about bus and device driver communication will be also be welcomed. I image the card will have 1 interrupt shared by, let say 8 serial ports, and all UART registers are separated. I have read in OSR and it seems the structure should be : - Bus driver talk PCI downward and Serial upward - Serial drivers for each port. When an interrupt came, i will need to check all registers of all 8 serial ports to verify which Serial generate interrupt. In here I have a questions that if it is possible when i checked, two serial can be marked as both generated interrupt ? If yes i think i will need to keep track of which Serial in 8 ports generated interrupt. And then in DPC, i need to transfer data from bus to serial driver or is there another way to transfer it ? In here i am pretty clueless. Is there any sample or guide i can read about this part ? Thank you all, --- NTDEV is sponsored by OSR Visit the list online at: <http://www.osronline.com/showlists.cfm?list=ntdev> MONTHLY seminars on crash dump analysis, WDF, Windows internals and software drivers! Details at <http://www.osr.com/seminars> To unsubscribe, visit the List Server section of OSR Online at <http://www.osronline.com/page.cfm?name=ListServer>
Posting Rules  
You may not post new threads
You may not post replies
You may not post attachments
You must login to OSR Online AND be a member of the ntdev list to be able to post.

All times are GMT -5. The time now is 00:38.


Copyright ©2015, OSR Open Systems Resources, Inc.
Based on vBulletin Copyright ©2000 - 2005, Jelsoft Enterprises Ltd.
Modified under license