Mailing Lists: Apple Mailing Lists

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

Fwd: getOutputQueue always returns 0



I thought the superclass (IONetworkController) had its own methods which would automatically get called when I did super::init() in my start() method to create an IOOutputQueue. It's not getting called, so I overloaded createOutputQueue() like:

IOOutputQueue * com_chuck_iokit_tulip::createOutputQueue()
{
return IOGatedOutputQueue::withTarget( this, getWorkLoop());
}

The behavior remains unchanged unless I replace my call to getOutputQueue(
) with a direct call to createOutputQueue(). When poking through all the samples and the Darwin projects, none of them call createOutputQueue() directly, though several of them override that function like I did. I also overloaded getWorkLoop().

I took a look at WritingKitDrivers.pdf and NetworkDriver.pdf and (of course) the sections on IOOutputQueue have a note saying they'll be written for a future release of the doc. ;-)

cr

On Monday, March 25, 2002, at 11:31 PM, chuck remes wrote:

I've worked out my issues with trying to talk to hardware, so I've set my sights on creating all the other objects an ethernet driver needs to work.

When I call the following code, getOutputQueue always returns zero. This doesn't make sense since this is exactly the same way AppleInteli82557, AppleBMACEthernet, and AppleGMACEthernet all do it. What gives? The docs don't explain what conditions might exist that would cause this failure.

Output is always:
Mar 25 23:18:01 12-247-44-84 mach_kernel: transmitQ is zero

cr

bool com_chuck_iokit_tulip::_initDriverObjects()
{
bool ret = false;

do {
// This driver will allocate and use an IOGatedOutputQueue.
transmitQueue = OSDynamicCast(IOGatedOutputQueue, getOutputQueue(
)
);
if ( ! transmitQueue) { IOLog("transmitQ is zero\n"); break; }

// snipped other code...
} while (false);
return true;
}

bool com_chuck_iokit_tulip::start(IOService *provider)
{
bool ret = false;

do {
IOLog("Starting\n");

pciNub = OSDynamicCast(IOPCIDevice, provider);

if ( !pciNub || !super::start(provider)) break;

pciNub->retain();

if ( ! pciNub->open(this)) break;

if (! _initDriverObjects()) break;

// snipped other code...
} while (false);
return true;
}
_______________________________________________
darwin-development mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/darwin-development
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.