ADC Home > Reference Library > Reference > Darwin > Kernel Framework Reference

 


IOFireWireSerialBusProtocolTransport

Inherits from:
IOSCSIProtocolServices
Declared In:

Overview

SCSI Protocol Driver Family for FireWire SBP2 Devices.

Discussion

IOFireWireSerialBusProtocolTransport contains all the bus specific support for FireWire SBP2 compliant devices. To add vendor specific features or workarounds you will sub-class the appropriate methods of this family.



Functions

AbortSCSICommand

This method is intended to abort an in progress SCSI Task.

AllocateResources

Allocate Resources.

cleanUp

cleanUp is called to tear down IOFireWireSerialBusProtocolTransport.

close

See IOService for discussion.

CoalesceSenseData

CoalesceSenseData convert a SBP-2 status block into a SPC-2 sense block.

CommandORBAccessor

accessor function for fORB.

CompleteSCSITask

This qualifies and sets appropriate data then calls CommandCompleted.

CriticalOrbSubmission

xxx.

DeallocateResources

Deallocate Resources.

finalize

See IOService for discussion.

free
HandleProtocolServiceFeature

Handle specified feature supported by the protocol layer.

init

See IOService for discussion.

IsProtocolServiceSupported

Determine is specified feature is supported by the protocol layer.

LoginCompletion

Completion routine for login complete.

LogoutCompletion

Completion routine for logout complete.

LunResetComplete

Callback to submit Fetch Agent Reset.

SBP2LoginAccessor

accessor function for fLogin.

SendSCSICommand

Prepare and send a SCSI command to the device.

SetCommandBuffers

Method to set orb's buffers.

SetValidAutoSenseData

Set the auto sense data that was returned for a given SCSI Task.

start
StatusNotify

This is our handler for status.

UnsolicitedStatusNotify

This is our handler for unsolicited status.


AbortSCSICommand


This method is intended to abort an in progress SCSI Task.

protected

virtual SCSIServiceResponse AbortSCSICommand ( SCSITaskIdentifier request );
Return Value

See SCSITask.h for SCSIServiceResponse codes.

Discussion

Currently not implemented in super class. This is a stub method for adding the abort command in the near future.


AllocateResources


Allocate Resources.

protected

virtual IOReturn AllocateResources ( void );
Discussion

Called from start method to allocate needed resources.


cleanUp


cleanUp is called to tear down IOFireWireSerialBusProtocolTransport.

public

virtual void cleanUp ( void );
Discussion

cleanUp is called when we receive a kIOFWMessageServiceIsRequestingClose message or if we fail our initialization.


close


See IOService for discussion.

public

virtual void close ( IOService *provider, IOOptionBits options );
Return Value

none.


CoalesceSenseData


CoalesceSenseData convert a SBP-2 status block into a SPC-2 sense block.

private

SCSITaskStatus CoalesceSenseData ( FWSBP2StatusBlock *sourceData, UInt8 quadletCount, SCSI_Sense_Data *targetData );
Discussion

CoalesceSenseData pulls the appropriate bits out of the SBP2 sense block as defined in SBP-2 Annex B section B.2 and dynamically builds a sense data block as defined in SPC-2 section 7.23.2.


CommandORBAccessor


accessor function for fORB.

protected

IOFireWireSBP2ORB * CommandORBAccessor ( void );
Discussion

xxx.


CompleteSCSITask


This qualifies and sets appropriate data then calls CommandCompleted.

protected

virtual void CompleteSCSITask ( IOFireWireSBP2ORB *orb );
Discussion

See IOSCSIProtocolServices.h for more details regarding CommandCompleted.


CriticalOrbSubmission


xxx.

protected

void CriticalOrbSubmission ( IOFireWireSBP2ORB *orb, SCSITaskIdentifier request );
Return Value

none.

Discussion

xxx.


DeallocateResources


Deallocate Resources.

protected

virtual void DeallocateResources ( void );
Discussion

Called from cleanUp method to deallocate resources.


finalize


See IOService for discussion.

public

virtual bool finalize ( IOOptionBits options );
Return Value

Returns true.


free


public

virtual void free ( void );
Return Value

none.

Discussion

See IOService for discussion.


HandleProtocolServiceFeature


Handle specified feature supported by the protocol layer.

protected

virtual bool HandleProtocolServiceFeature ( SCSIProtocolFeature feature, void *serviceValue );
Return Value

Will return true if the specified feature is supported by the protocol layer.

Discussion

See IOSCSIProtocolServices.h for more details regarding HandleProtocolServiceFeature.


init


See IOService for discussion.

public

bool init ( OSDictionary *propTable );
Discussion

Setup and prime class into known state.


IsProtocolServiceSupported


Determine is specified feature is supported by the protocol layer.

protected

virtual bool IsProtocolServiceSupported ( SCSIProtocolFeature feature, void *serviceValue );
Return Value

Will return true if the specified feature is supported by the protocol layer.

Discussion

If the service has a value that must be returned, it will be returned in the serviceValue output parameter. See IOSCSIProtocolServices.h for more details regarding IsProtocolServiceSupported.


LoginCompletion


Completion routine for login complete.

protected

virtual void LoginCompletion ( FWSBP2LoginCompleteParams *params );
Discussion

See IOFireWireSBP2Lib.h for details regarding the FWSBP2LogoutCompleteParams structure that is passed in to the completion.


LogoutCompletion


Completion routine for logout complete.

protected

virtual void LogoutCompletion ( FWSBP2LogoutCompleteParams *params );
Discussion

See IOFireWireSBP2Lib.h for details regarding the FWSBP2LogoutCompleteParams structure that is passed in to the completion.


LunResetComplete


Callback to submit Fetch Agent Reset.

protected

virtual void LunResetComplete ( IOReturn status, IOFireWireSBP2ManagementORB *orb );
Discussion

See IOFireWireSBP2Lib.h for details regarding the submitFetchAgentReset method.


SBP2LoginAccessor


accessor function for fLogin.

protected

IOFireWireSBP2Login * SBP2LoginAccessor ( void );
Discussion

xxx.


SendSCSICommand


Prepare and send a SCSI command to the device.

protected

virtual bool SendSCSICommand ( SCSITaskIdentifier request, SCSIServiceResponse *serviceResponse, SCSITaskStatus *taskStatus );
Return Value

If the command was sent to the device and is pending completion, the subclass should return true and return back the kSCSIServiceResponse_Request_In_Process response. If the command completes immediately with an error, the subclass will return true and return back the appropriate status. If the subclass is currently processing all the commands it can, the subclass will return false and the command will be resent next time CommandCompleted is called.

Discussion

The incoming SCSITaskIdentifier gets turned into a IOFireWireSBP2ORB and is submitted to the SBP2 layer. See IOSCSIProtocolServices.h for more details regarding SendSCSICommand. Also see IOFireWireSBP2Lib.h for details regarding the IOFireWireSBP2ORB structure and the submitORB method.


SetCommandBuffers


Method to set orb's buffers.

protected

virtual IOReturn SetCommandBuffers ( IOFireWireSBP2ORB *orb, SCSITaskIdentifier request );
Return Value

xxx.

Discussion

This method was added so that subclasses can override and massage buffers as needed. The default simply calls setCommandBuffers. See IOFireWireSBP2Lib.h for details regarding the setCommandBuffers method.


SetValidAutoSenseData


Set the auto sense data that was returned for a given SCSI Task.

protected

void SetValidAutoSenseData ( SBP2ClientOrbData *clientData, FWSBP2StatusBlock *statusBlock, SCSI_Sense_Data *targetData );
Discussion

SetValidAutoSenseData is called to qualify sense data that is copied to the client via the SetAutoSenseData method. See IOSCSIProtocolServices.h for more details regarding SetAutoSenseData.


start


public

virtual bool start ( IOService *provider );
Return Value

Return true if the start was successful, false otherwise ( which will cause the instance to be detached and usually freed ).

Discussion

See IOService for discussion.


StatusNotify


This is our handler for status.

protected

virtual void StatusNotify ( FWSBP2NotifyParams *params );
Discussion

See IOFireWireSBP2Lib.h for details regarding the FWSBP2NotifyParams structure that is passed in to the completion..


UnsolicitedStatusNotify


This is our handler for unsolicited status.

protected

virtual void UnsolicitedStatusNotify ( FWSBP2NotifyParamsPtr params );
Discussion

After we have parsed and handled the unsolicited status we call enableUnsolicitedStatus. See IOFireWireSBP2Lib.h for details regarding the enableUnsolicitedStatus method.

Typedefs


SBP2ClientOrbData


protected

typedef struct { IOFireWireSBP2ORB *orb; SCSITaskIdentifier scsiTask; SCSIServiceResponse serviceResponse; SCSITaskStatus taskStatus; } SBP2ClientOrbData;
Fields
orb

IOFireWireSBP2ORB for request.

scsiTask

SCSITaskIdentifier of request.

serviceResponse

SCSIServiceResponse of request.

taskStatus

SCSITaskStatus of request.

Discussion

This structure is stuffed into the refcon so we can associate which IOFireWireSBP2ORB and SCSITaskIdentifier is completing.


Did this document help you?
Yes: Tell us what works for you.
It’s good, but: Report typos, inaccuracies, and so forth.
It wasn’t helpful: Tell us what would have helped.

 

Last Updated: 2008-12-19