Mac Developer Library

Developer

IOFireWireSerialBusProtocolTransport Class Reference

Options
Deployment Target:

On This Page

IOFireWireSerialBusProtocolTransport

SCSI Protocol Driver Family for FireWire SBP2 Devices.

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.

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

    Declaration

    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.

  • Allocate Resources.

    Declaration

    virtual IOReturn AllocateResources ( void );

    Discussion

    Called from start method to allocate needed resources.

  • cleanUp is called to tear down IOFireWireSerialBusProtocolTransport.

    Declaration

    virtual void cleanUp ( void );

    Discussion

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

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

    Declaration

    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.

  • accessor function for fORB.

    Declaration

    IOFireWireSBP2ORB * CommandORBAccessor ( void );

    Discussion

    xxx.

  • This qualifies and sets appropriate data then calls CommandCompleted.

    Declaration

    virtual void CompleteSCSITask ( IOFireWireSBP2ORB *orb );

    Discussion

    See IOSCSIProtocolServices.h for more details regarding CommandCompleted.

  • xxx.

    Declaration

    void CriticalOrbSubmission ( IOFireWireSBP2ORB *orb, SCSITaskIdentifier request );

    Return Value

    none.

    Discussion

    xxx.

  • Deallocate Resources.

    Declaration

    virtual void DeallocateResources ( void );

    Discussion

    Called from cleanUp method to deallocate resources.

  • See IOService for discussion.

    Declaration

    virtual bool finalize ( IOOptionBits options );

    Return Value

    Returns true.

  • Declaration

    virtual void free ( void );

    Return Value

    none.

    Discussion

    See IOService for discussion.

  • Handle specified feature supported by the protocol layer.

    Declaration

    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.

  • See IOService for discussion.

    Declaration

    bool init ( OSDictionary *propTable );

    Discussion

    Setup and prime class into known state.

  • Determine is specified feature is supported by the protocol layer.

    Declaration

    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.

  • Completion routine for login complete.

    Declaration

    virtual void LoginCompletion ( FWSBP2LoginCompleteParams *params );

    Discussion

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

  • Completion routine for logout complete.

    Declaration

    virtual void LogoutCompletion ( FWSBP2LogoutCompleteParams *params );

    Discussion

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

  • Callback to submit Fetch Agent Reset.

    Declaration

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

    Discussion

    See IOFireWireSBP2Lib.h for details regarding the submitFetchAgentReset method.

  • accessor function for fLogin.

    Declaration

    IOFireWireSBP2Login * SBP2LoginAccessor ( void );

    Discussion

    xxx.

  • Prepare and send a SCSI command to the device.

    Declaration

    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.

  • Method to set orb's buffers.

    Declaration

    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.

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

    Declaration

    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.

  • Declaration

    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.

  • This is our handler for status.

    Declaration

    virtual void StatusNotify ( FWSBP2NotifyParams *params );

    Discussion

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

  • This is our handler for unsolicited status.

    Declaration

    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.

Data Types

  • Declaration

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

    Discussion

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

    Import Statement