FreeBSD/sys/dev/pms/RefTisa/tisa/sassata/sata/host/sat.c
/*****************************************************************************
*! \brief  satAddSATAIDDevCBCleanup
*
*   This routine cleans up IOs for failed Identify device data
*
*  \param   agRoot:           Handles for this instance of SAS/SATA hardware
*  \param   oneDeviceData:    Pointer to the device data.
*  \param   ioContext:        Pointer to satIOContext_t.
*  \param   tdIORequestBody:  Pointer to the request body
*
*  \return: none
*
*****************************************************************************/
\brief  satAddSATAIDDevCBCleanup
This routine cleans up IOs for failed Identify device data

\param   agRoot:           Handles for this instance of SAS/SATA hardware
\param   oneDeviceData:    Pointer to the device data.
\param   ioContext:        Pointer to satIOContext_t.
\param   tdIORequestBody:  Pointer to the request body

\return: none
\ brief satAddSATAIDDevCBCleanup This routine cleans up IOs for failed Identify device data \ param agRoot : Handles for this instance of SAS / SATA hardware \ param oneDeviceData : Pointer to the device data . \ param ioContext : Pointer to satIOContext_t . \ param tdIORequestBody : Pointer to the request body \ return : none
void satAddSATAIDDevCBCleanup(
                   agsaRoot_t        *agRoot,
                   tdsaDeviceData_t  *oneDeviceData,
                   satIOContext_t    *satIOContext,
                   tdIORequestBody_t *tdIORequestBody
                   )
{
  tdsaRootOsData_t        *osData = (tdsaRootOsData_t *)agRoot->osData;
  tiRoot_t                *tiRoot = (tiRoot_t *)osData->tiRoot;
  tdsaRoot_t              *tdsaRoot        = (tdsaRoot_t *) tiRoot->tdData;
  tdsaContext_t           *tdsaAllShared = (tdsaContext_t *)&tdsaRoot->tdsaAllShared;
  satInternalIo_t         *satIntIo;
  satDeviceData_t         *satDevData;
  bit8                    PhyID;
  TI_DBG2(("satAddSATAIDDevCBCleanup: start\n"));
  satIntIo               = satIOContext->satIntIoContext;
  satDevData             = satIOContext->pSatDevData;
  PhyID                  = oneDeviceData->phyID;
  tdsaAbortAll(tiRoot, agRoot, oneDeviceData);
  osti_memset(&(oneDeviceData->satDevData.satIdentifyData), 0xFF, sizeof(agsaSATAIdentifyData_t));
  TDLIST_DEQUEUE_THIS(&(oneDeviceData->MainLink));
  TDLIST_ENQUEUE_AT_TAIL(&(oneDeviceData->FreeLink), &(tdsaAllShared->FreeDeviceList));
  satDecrementPendingIO(tiRoot, tdsaAllShared, satIOContext);
  satFreeIntIoResource( tiRoot,
                        satDevData,
                        satIntIo);
  ostiFreeMemory(
                 tiRoot,
                 tdIORequestBody->IOType.InitiatorTMIO.osMemHandle,
                 sizeof(tdIORequestBody_t)
                );
  ostiPortEvent (
                 tiRoot,
                 tiPortLinkUp,
                 tiSuccess,
                 (void *)tdsaAllShared->Ports[PhyID].tiPortalContext
                );
#ifdef INITIATOR_DRIVER
  ostiPortEvent(
                tiRoot,
                tiPortDiscoveryReady,
                tiSuccess,
                (void *) tdsaAllShared->Ports[PhyID].tiPortalContext
                );
#endif
  return;
}
void satAddSATAIDDevCBCleanup ( agsaRoot_t * agRoot , tdsaDeviceData_t * oneDeviceData , satIOContext_t * satIOContext , tdIORequestBody_t * tdIORequestBody ) { tdsaRootOsData_t * osData = ( tdsaRootOsData_t * ) agRoot -> osData ; tiRoot_t * tiRoot = ( tiRoot_t * ) osData -> tiRoot ; tdsaRoot_t * tdsaRoot = ( tdsaRoot_t * ) tiRoot -> tdData ; tdsaContext_t * tdsaAllShared = ( tdsaContext_t * ) & tdsaRoot -> tdsaAllShared ; satInternalIo_t * satIntIo ; satDeviceData_t * satDevData ; bit8 PhyID ; TI_DBG2 ( ( " \n " ) ) ; satIntIo = satIOContext -> satIntIoContext ; satDevData = satIOContext -> pSatDevData ; PhyID = oneDeviceData -> phyID ; tdsaAbortAll ( tiRoot , agRoot , oneDeviceData ) ; osti_memset ( & ( oneDeviceData -> satDevData . satIdentifyData ) , 0xFF , sizeof ( agsaSATAIdentifyData_t ) ) ; TDLIST_DEQUEUE_THIS ( & ( oneDeviceData -> MainLink ) ) ; TDLIST_ENQUEUE_AT_TAIL ( & ( oneDeviceData -> FreeLink ) , & ( tdsaAllShared -> FreeDeviceList ) ) ; satDecrementPendingIO ( tiRoot , tdsaAllShared , satIOContext ) ; satFreeIntIoResource ( tiRoot , satDevData , satIntIo ) ; ostiFreeMemory ( tiRoot , tdIORequestBody -> IOType . InitiatorTMIO . osMemHandle , sizeof ( tdIORequestBody_t ) ) ; ostiPortEvent ( tiRoot , tiPortLinkUp , tiSuccess , ( void * ) tdsaAllShared -> Ports [ PhyID ] . tiPortalContext ) ; #ifdef INITIATOR_DRIVER ostiPortEvent ( tiRoot , tiPortDiscoveryReady , tiSuccess , ( void * ) tdsaAllShared -> Ports [ PhyID ] . tiPortalContext ) ; #endif return ; }
\brief  satAddSATAIDDevCBCleanup
This routine cleans up IOs for failed Identify device data
\ brief satAddSATAIDDevCBCleanup This routine cleans up IOs for failed Identify device data
/* put onedevicedata back to free list */ /* clean up TD layer's IORequestBody */ /* notifying link up */ /* triggers discovery */