/* This routine initializes or updates the adapter's device database entry for the specified device. It also triggers a login for the specified device. Therefore, it may also be used as a secondary login routine when a NULL pointer is specified for the fw_ddb_entry.  */
int qla4xxx_set_ddb_entry(struct scsi_qla_host *ha, uint16_t fw_ddb_index, dma_addr_t fw_ddb_entry_dma)
/* This routine initializes or updates the adapter's device database entry for the specified device. It also triggers a login for the specified device. Therefore, it may also be used as a secondary login routine when a NULL pointer is specified for the fw_ddb_entry.  */
int qla4xxx_set_ddb_entry(struct scsi_qla_host *ha, uint16_t fw_ddb_index, dma_addr_t fw_ddb_entry_dma)
{
	uint32_t mbox_cmd[MBOX_REG_COUNT];
	uint32_t mbox_sts[MBOX_REG_COUNT];
	memset(&mbox_cmd, 0, sizeof(mbox_cmd));
	memset(&mbox_sts, 0, sizeof(mbox_sts));
	mbox_cmd[0] = MBOX_CMD_SET_DATABASE_ENTRY;
	mbox_cmd[1] = (uint32_t) fw_ddb_index;
	mbox_cmd[2] = LSDW(fw_ddb_entry_dma);
	mbox_cmd[3] = MSDW(fw_ddb_entry_dma);
	mbox_cmd[4] = sizeof(struct dev_db_entry);
	return qla4xxx_mailbox_command(ha, MBOX_REG_COUNT, 1, &mbox_cmd[0], &mbox_sts[0]);
}