34#ifdef SA_ENABLE_TRACE_FUNCTIONS
38#define siTraceFileID 'C'
94 bit32 deviceid, portid;
97 OS_ASSERT(agDevHandle !=
agNULL,
"saDeregisterDeviceHandle agDevHandle is NULL");
109 OS_ASSERT(pDevice !=
agNULL,
"saDeregisterDeviceHandle pDevice is NULL");
120 pPort = pDevice->
pPort;
124 SA_DBG3((
"saDeregisterDeviceHandle: start DeviceHandle %p\n", agDevHandle));
125 SA_DBG1((
"saDeregisterDeviceHandle: deviceId 0x%x Device Context %p\n", deviceid, pDevice));
130 SA_DBG1((
"saDeregisterDeviceHandle: Not match failure\n"));
172 SA_DBG1((
"siRemoveDevHandle: pDevice is NULL \n"));
197 pPort = pDevice->
pPort;
206 SA_DBG3((
"siRemoveDevHandle: remove device context %p\n", pDevice));
212 SA_DBG1((
"siRemoveDevHandle: switch. Not calling siPortDeviceRemove %d\n", pDevice->
deviceType));
219 SA_DBG1((
"siRemoveDevHandle: else. Not caling siPortDeviceRemove\n"));
264 SA_DBG1((
"saGetDeviceHandles: pPort is NULL \n"));
269 SA_DBG1((
"saGetDeviceHandles: start portId %d\n", pPort->
portId));
272 for (i = 0; i < MaxDevs; i ++)
278 portIndex = pPort->
portId;
308 bit16 hostAssignedDeviceId
317 bit32 i, phyId, sDTypeRate;
326 SA_DBG1((
"saRegisterNewDevice: saRoot == agNULL\n"));
333 SA_DBG1((
"saRegisterNewDevice: pPort is NULL \n"));
338 SA_DBG2((
"saRegisterNewDevice: start portId %d Port Context %p\n", pPort->
portId, agPortContext));
344 SA_DBG2((
"saRegisterNewDevice: flag 0x%x\n", agDeviceInfo->
flag));
345 SA_DBG2((
"saRegisterNewDevice: hostAssignedDeviceId 0x%x\n",hostAssignedDeviceId ));
346 SA_DBG2((
"saRegisterNewDevice: Addr 0x%02x%02x%02x%02x 0x%02x%02x%02x%02x\n",
375 SA_DBG1((
"saRegisterNewDevice, using saRoot->freeReservedRequests\n"));
379 SA_DBG1((
"saRegisterNewDevice, No request from free list Not using saRoot->freeReservedRequests\n"));
429 SA_DBG1((
"saRegisterNewDevice: Device Context %p, TypeRate 0x%x\n", pDevice, agDeviceInfo->
devType_S_Rate));
435 sDTypeRate |= (agDeviceInfo->
flag & 0x01);
437 sDTypeRate |= (agDeviceInfo->
flag & 0x02) << 1;
440 if ( hostAssignedDeviceId != 0 )
443 SA_DBG3((
"saRegisterNewDevice:hostAssignedDeviceId 0x%x sDTypeRate 0x%x\n",hostAssignedDeviceId,sDTypeRate ));
463 SA_DBG1((
"saRegisterNewDevice: sflag XFER_RDY_PRIORTY_DEVICE_FLAG sDTypeRate 0x%x\n",sDTypeRate ));
465#ifdef CCFLAG_FORCE_AWT_ON
466 sDTypeRate |= (1 <<
SHIFT2);
467 SA_DBG1((
"saRegisterNewDevice: Force AWT_DEVICE_FLAG sDTypeRate 0x%x\n",sDTypeRate ));
473 SA_DBG2((
"saRegisterNewDevice,flag 0x%08X\n",agDeviceInfo->
flag));
479 phyId = (agDeviceInfo->
flag & 0xF0);
483 phyId = (agDeviceInfo->
flag & 0xF0) <<
SHIFT4;
534 SA_DBG1((
"saRegisterNewDevice: saving pRequest (%p) for later use\n", pRequest));
543 SA_DBG1((
"saRegisterNewDevice, sending IOMB failed\n" ));
545 SA_DBG3((
"saRegisterNewDevice: end\n"));
568 bit32 eventSourceType,
575 SA_DBG3((
"saRegisterEventCallback: start\n"));
576 switch (eventSourceType)
587 SA_DBG1((
"saRegisterEventCallback: not allowed case %d\n", eventSourceType));
627 SA_DBG1((
"saGetDeviceInfo: pDevice is NULL \n"));
634 SA_DBG3((
"saGetDeviceInfo: start pDevice %p, deviceId %d\n", pDevice, deviceid));
640 SA_DBG1((
"saGetDeviceInfo: Not match failure or device not exist\n"));
649 SA_DBG3((
"saGetDeviceInfo: end\n"));
690 SA_DBG2((
"saSetDeviceInfo: start pDevice %p, option=0x%x param=0x0%x\n", pDevice, option, param));
701 pDevice->
param = param;
703 SA_DBG3((
"saSetDeviceInfo: deviceId %d\n", deviceid));
709 SA_DBG1((
"saSetDeviceInfo: Not match failure or device not exist\n"));
718 SA_DBG3((
"saSetDeviceInfo: end\n"));
756 SA_DBG1((
"saGetDeviceState: pDevice is NULL \n"));
761 SA_DBG3((
"saGetDeviceState: start pDevice %p\n", pDevice));
770 SA_DBG1((
"saGetDeviceState: Not match failure or device not exist\n"));
779 SA_DBG3((
"saGetDeviceState: end\n"));
819 SA_DBG1((
"saSetDeviceState: saRoot is NULL\n"));
823 OS_ASSERT(agDevHandle !=
agNULL,
"saSetDeviceState agDevHandle is NULL");
827 if(agDevHandle ==
agNULL )
829 SA_DBG1((
"saSetDeviceState: agDevHandle is NULL\n"));
838 SA_DBG3((
"saSetDeviceState: start pDevice %p\n", pDevice));
842 SA_DBG1((
"saSetDeviceState: pDevice is NULL\n"));
853 SA_DBG1((
"saSetDeviceState: Not match failure or device not exist\n"));
861 SA_DBG3((
"saSetDeviceState: end\n"));
#define ATAPI_DEVICE_FLAG
#define smTraceFuncEnter(L, I)
#define smTraceFuncExit(L, S, I)
#define OS_ASSERT(expr, message)
#define DEV_INFO_IR_SHIFT
#define XFER_RDY_PRIORTY_DEVICE_FLAG
#define SA_RESERVED_REQUEST_COUNT
#define OSSA_OFFSET_OF(STRUCT_TYPE, FEILD)
void(* ossaDeviceRegistrationCB_t)(agsaRoot_t *agRoot, agsaContext_t *agContext, bit32 status, agsaDevHandle_t *agDevHandle, bit32 deviceID)
Callback definition for .ossaDeviceRegistration.
void(* ossaDeregisterDeviceHandleCB_t)(agsaRoot_t *agRoot, agsaContext_t *agContext, agsaDevHandle_t *agDevHandle, bit32 status)
Callback definition for.
#define OSSA_EVENT_SOURCE_DEVICE_HANDLE_ADDED
void(* ossaGenericCB_t)(void)
Callback definition for.
#define OSSA_EVENT_SOURCE_DEVICE_HANDLE_REMOVED
#define MAX_IO_DEVICE_ENTRIES
#define DEV_INFO_MCN_SHIFT
void(* ossaSetDeviceInfoCB_t)(agsaRoot_t *agRoot, agsaContext_t *agContext, agsaDevHandle_t *agDevHandle, bit32 status, bit32 option, bit32 param)
Callback definition for.
#define LL_IOREQ_LOCKEQ_LOCK
#define DIRECT_SATA_DEVICE
GLOBAL bit32 siRemoveDevHandle(agsaRoot_t *agRoot, agsaDevHandle_t *agDevHandle)
Function for target to remove stale initiator device handle.
GLOBAL bit32 saRegisterEventCallback(agsaRoot_t *agRoot, bit32 eventSourceType, ossaGenericCB_t callbackPtr)
Register a callback for a specific event.
GLOBAL bit32 saSetDeviceInfo(agsaRoot_t *agRoot, agsaContext_t *agContext, bit32 queueNum, agsaDevHandle_t *agDevHandle, bit32 option, bit32 param, ossaSetDeviceInfoCB_t agCB)
Set Device Information.
GLOBAL bit32 saGetDeviceInfo(agsaRoot_t *agRoot, agsaContext_t *agContext, bit32 option, bit32 queueNum, agsaDevHandle_t *agDevHandle)
Get Device Information.
GLOBAL bit32 saSetDeviceState(agsaRoot_t *agRoot, agsaContext_t *agContext, bit32 queueNum, agsaDevHandle_t *agDevHandle, bit32 newDeviceState)
Set Device State.
GLOBAL bit32 saDeregisterDeviceHandle(agsaRoot_t *agRoot, agsaContext_t *agContext, agsaDevHandle_t *agDevHandle, bit32 queueNum)
Function for target to remove stale initiator device handle.
GLOBAL bit32 saRegisterNewDevice(agsaRoot_t *agRoot, agsaContext_t *agContext, bit32 queueNum, agsaDeviceInfo_t *agDeviceInfo, agsaPortContext_t *agPortContext, bit16 hostAssignedDeviceId)
Register New Device from a specific local port.
GLOBAL bit32 saDiscover(agsaRoot_t *agRoot, agsaPortContext_t *agPortContext, bit32 type, bit32 option)
Start/Abort SAS/SATA discovery.
GLOBAL bit32 saGetDeviceState(agsaRoot_t *agRoot, agsaContext_t *agContext, bit32 queueNum, agsaDevHandle_t *agDevHandle)
Get Device State.
GLOBAL bit32 saGetDeviceHandles(agsaRoot_t *agRoot, agsaContext_t *agContext, bit32 queueNum, agsaPortContext_t *agPortContext, bit32 flags, agsaDevHandle_t *agDev[], bit32 skipCount, bit32 MaxDevs)
Get Device Handles from a specific local port.
This file defines global types.
#define saLlistIOAdd(pList, pLink)
#define saLlistIORemove(pList, pLink)
#define saLlistIOGetHead(pList)
#define saLlistIOGetCount(pList)
GLOBAL bit32 mpiSetDeviceStateCmd(agsaRoot_t *agRoot, agsaContext_t *agContext, bit32 deviceId, bit32 nds, bit32 queueNum)
Set Device State command.
GLOBAL bit32 mpiGetDeviceInfoCmd(agsaRoot_t *agRoot, agsaContext_t *agContext, bit32 deviceid, bit32 option, bit32 queueNum)
Get Device Information Command.
GLOBAL bit32 mpiGetDeviceHandleCmd(agsaRoot_t *agRoot, agsaContext_t *agContext, bit32 portId, bit32 flags, bit32 maxDevs, bit32 queueNum, bit32 skipCount)
SPC MPI Get Device Handle Command.
GLOBAL bit32 mpiSetDeviceInfoCmd(agsaRoot_t *agRoot, agsaContext_t *agContext, bit32 deviceid, bit32 option, bit32 queueNum, bit32 param, ossaSetDeviceInfoCB_t agCB)
Set Device Information Command.
GLOBAL bit32 mpiGetDeviceStateCmd(agsaRoot_t *agRoot, agsaContext_t *agContext, bit32 deviceId, bit32 queueNum)
Get Device State command.
GLOBAL bit32 mpiDeregDevHandleCmd(agsaRoot_t *agRoot, agsaContext_t *agContext, agsaDeviceDesc_t *pDevice, bit32 deviceId, bit32 portId, bit32 queueNum)
SPC MPI Deregister Device Handle Command.
GLOBAL bit32 mpiBuildCmd(agsaRoot_t *agRoot, bit32 *payload, mpiMsgCategory_t category, bit16 opcode, bit16 size, bit32 queueNum)
Build a IOMB command and send to SPC.
#define OPC_INB_SPC_REG_DEV
GLOBAL FORCEINLINE void ossaSingleThreadedEnter(agsaRoot_t *agRoot, bit32 syncLockId)
ossaSingleThreadedEnter
GLOBAL FORCEINLINE void ossaSingleThreadedLeave(agsaRoot_t *agRoot, bit32 syncLockId)
ossaSingleThreadedLeave
GLOBAL void siPortDeviceRemove(agsaRoot_t *agRoot, agsaPort_t *pPort, agsaDeviceDesc_t *pDevice, bit32 unmap)
The function to remove a device descriptor.
GLOBAL agsaDeviceDesc_t * siPortSATADeviceAdd(agsaRoot_t *agRoot, agsaPort_t *pPort, agsaDeviceDesc_t *pSTPBridge, bit8 *pSignature, bit8 pm, bit8 pmField, bit32 smpReqTimeout, bit32 itNexusTimeout, bit32 firstBurstSize, bit8 dTypeSRate, bit32 flag)
Add a SATA device to the discovery list of the port.
GLOBAL agsaDeviceDesc_t * siPortSASDeviceAdd(agsaRoot_t *agRoot, agsaPort_t *pPort, agsaSASIdentify_t sasIdentify, bit32 sasInitiator, bit32 smpTimeout, bit32 itNexusTimeout, bit32 firstBurstSize, bit8 dTypeSRate, bit32 flag)
Add a SAS device to the discovery list of the port.
GLOBAL bit32 smIS_SPC(agsaRoot_t *agRoot)
GLOBAL FORCEINLINE void * si_memset(void *s, int c, bit32 n)
memset
data structure stores OS specific and LL specific context