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 for finding Lun nos in Kernel



Hi All,

I am trying to write a driver to support vendorspecific read/writes to a IOSCSIPERIPHERALDeviceType00 with multiple LUN's. For this I am in need to differentiate between the lun's.

1) Is there any way I can set separate Iokit personalities for each LUN under same vendorstring and productstring.?

2) For differentiating the LUN's I am trying to get the lun no as shown below

bool
com_user_VendorSpecificType00::start ( IOService *provider )
{

   OSDictionary *		dict = NULL;
   char *			VendorString = NULL;
   char *			ProductString = NULL;
   SCSITaskIdentifier 		getscsi;
   SCSITask *			scsiRequest;
   UInt8  			LUNno = 0;

   if ( !super::start ( provider ) )
   {
       return false;
   }
   registerService();

dict = GetProtocolCharacteristicsDictionary ( );
if ( dict != NULL )
{
VendorString = GetVendorString ();
ProductString = GetProductString ();
//Checking for Vendor and ProductString to identify the device
if ( ((strcmp ( VendorString, "Generic" )) && (strcmp ( ProductString, "device" ))) == 0 )
{
getscsi = GetSCSITask( );
scsiRequest = OSDynamicCast ( SCSITask, getscsi);
LUNno = scsiRequest->GetLogicalUnitNumber();
STATUS_LOG ( ( " LUN no = %d\n", LUNno) );
//Here is the problem the LUN no returns 0 for all the luns I have.
}


   }
   return true;
}

When I do the above I am getting the LunNo as 0 for all the LUN's I have.

Thanks for your help
Rajagovarthanan.


_________________________________________________________________
The new MSN 8: smart spam protection and 2 months FREE* http://join.msn.com/?page=features/junkmail
_______________________________________________
usb mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/usb
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.