MD_GetHsmIndexForSlot

Synopsis
#include <md.h>
MD_RV MD_GetHsmIndexForSlot(CK_SLOT_ID hostP11SlotId, 
			     uint32_t *pHsmIndex); 

For HSMs with FMs enabled, this function translates host PKCS#11 slot ID to the HSM index. Using this function, FM developers can direct FM custom commands to a respective HSM. This function should be used by the host ethsm, only.

Input Requirements  

None

Input Parameters  
hostP11SlotId   Host side slot ID of a PKCS#11 slot.  
pHsmIndex

Pointer to where embedded slot number is returned.  

Output Requirements  

The function returns the following codes:

Function Code Qualification
MDR_OK For successful execution.

 

MDR_HSM_NOT_AVAILABLE

If a host slot does not have its peer in any HSM with FMs enabled.
Any other MD_RV error code to indicate error condition.