Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

help, trying to use IOConnectSetCFProperty (and failing)



Hi all,

I have a PCI device driver with a user client based on Apple's SimpleUserClient example. The driver starts up, I'm also able to get some user-space code to open the user client like so:

kern_result = IOServiceOpen (serviceObject, mach_task_self(), 0, &dataPort);

This seems to work just great. The user client is coming up. Now I'm trying to set a property in the I/O registry. Apple's docs specifically suggest this as a method for downloading firmware (Writing an IOKit Device Driver, PDF, p. 92). I eventually want the user-space code to set up a dictionary of, perhaps, arrays of firmware to be downloaded, and for the kernel driver to see this, map the user-space memory into kernel space, and perform the download. I have a working MacOS 9 driver to port so I'm not starting from scratch; right now the difficult part is the user/kernel boundary.

So far I'm just trying to get a single property to set. I've got:

// create the dictionary's property name
CFStringRef prop_name = CFStringCreateWithCString (NULL, "aardvark_pci_dsp_56301_firmware", kCFStringEncodingASCII);

// should we be using CFStringGetSystemEncoding() or kCFStringEncodingASCII?
CFStringRef prop_value = CFStringCreateWithCString (NULL, "property_value", kCFStringEncodingASCII);

// create the dictionary
kern_result = IOConnectSetCFProperty (dataPort, prop_name, prop_value);

kern_result is always coming back e00002c7.

I've got setOneProperty and setProperties methods implemented in both the user client class and the driver class itself, not knowing for sure which one will be called. it seems neither is.

For kicks I also am trying using the service object instead of the data port:

kern_result = IORegistryEntrySetCFProperty (serviceObject, prop_name, prop_value);

I get the same result.

Apple's book on Writing Device Drivers show how to implement the driver side of this, but not the user-space side. Is there some trick that I'm missing?

Thanks for any help,

Paul R. Potts
_______________________________________________
darwin-drivers mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/darwin-drivers
Do not post admin requests to the list. They will be ignored.



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.