Asynchronous Data Transfer to a PCI Device
Asynchronous Data Transfer to a PCI Device
- Subject: Asynchronous Data Transfer to a PCI Device
- From: "Peter Young" <email@hidden>
- Date: Tue, 30 Apr 2002 17:05:16 +0100
Hi,
I am currently porting a C-based PCI Driver (OS9) to OS X. The driver
controls one of several interface cards sending data to imagesetters. I
have ported most of the control API and Serial comms API and am starting
on the data transfer API.
The OS9 driver code relied on the system to queue pending driver calls
while it handled the current call. Immediate calls were handled directly
by the driver and did not require queueing.
Q1. Does OSX provide an equivalent mechanism, or do I have to provide my
own internal queueing mechanism ?
The OS9 client used the IOParam block and PBWriteAsync() to send data to
the driver and then 'waited' for the driver to change IOParam.ioResult.
What I need to do is to provide an equivalent mechanism under OSX.
Q2. Are there any such samples available, or can someone shed light on
how to do this ?
The PCI DDK OSX v1.0 contains an AppleSamplePCI driver which appears to
show a mechanism for providing this behaviour. The client uses an
io_async_method... call to send data to the driver, and uses a callback
to get notification of completion. The synchronous calls are made using
the IOConnectMethod... set of calls, but there does not appear to be an
equivalent IOAsyncConnectMethod... set. I eventually tracked the
io_async_method... APIs to iokitmig_c.h.
Q4. Do the IOAsyncConnect... APIs exist, and if so where are they in the
IOKit headers ?
Q3. Will the io_async_... APIs be available for some time, or are they,
as the file name iokitmig_c.h suggests, something that is undergoing
change ? I don't want to waste time making it work, if in three
months time the calls are going to disappear.
The driver method uses sendAsyncResult() to trigger the callback, passing
the appropriate return code, and any required parameters. it then returns
kIOReturnSuccess to the original call.
In my case, I must assume that the driver method hands off the data to
another thread to perform the actual transfer and then trigger the
completion routine appropriately, while the method itself returns to the
caller with a suitable completion code. This presupposes that I have a
separate thread running which is holding all the queued calls until the
output thread can process them.
Any assistance gratefully received.
Thanks in advance
Peter Young
Development Engineer, HighWater Designs Ltd.
_______________________________________________
darwin-kernel mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/darwin-kernel
Do not post admin requests to the list. They will be ignored.