Mailing Lists: Apple Mailing Lists
Image of Mac OS face in stamp
FW: what does IOPCIDevice class represent?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

FW: what does IOPCIDevice class represent?



Great Guide.
In our design only 1 class has to handle both functions,
and VENDOR_ID, DEVICE_ID is also same.
So, Info.plist dictionary will have only one entry representing IOPCIMatch.

Let me explain my driver design.
Driver class has to maintain the linked list of each IOPCIDevice function,
and associated parameters, So driver does traverse the IOReg. for this,
driver locally has to do it.
What I did is, there is one linked list structure that represents the
PCIDevice function.
Driver has to handle multiple cards, so linked list also need to contain the
instance of this structure.

I want to share code with you,

class com_einfochips_driver_dspBoard :: IOService
{
struct pciDspFunc {
struct pciDspFunc* next;
IOPCIDevice* nub;
IOMemoryMap* map;
.........
};

Confusion is:
1. Which method is called only once per card?
So that I can put my linked initialization and card specific initialization
in that method
and pci function specific code and adding the pciDspFunc instance in the
other method.

what I understood is init(),probe(),start() method is called on publication
and matching of
each IOPCIDevice function. So start() code look like this:

start()
{
IOPCIDevice * nub = OSDynamicCast( IOPCIDevice, provider);
if (nub == NULL) return false;

pciDspFunc* pciFunc = new pciDspFunc();
add_to_linkedList(pciFunc);
return true;
}

pseudo code look like:

single_method_per_driver()
{
init_func_linkedList();
init_driver_parameters();
}

start()
{
super::start();
init_pci_func();
add_pointer_to_linkedlist();
}

Now where to initialize this linked list, that is called once per driver?

Thanks in advance,

Regards,
Parav Pandit
einfochips Inc.


{P^/
1/6/2004
Parav Pandit

To:
John Dalgliesh
Nice example.
Happy to have such great ,quick help from you.

btw, My dsp PCI card contain either 2 audio functions or can have 1st
audio,2nd video encoder.
It may differ from BT878 in functionality, but driver architecture could be
same.

Thanks a lot,
Regards,
Parav
_______________________________________________
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 © 2011 Apple Inc. All rights reserved.