Changeset View
Changeset View
Standalone View
Standalone View
head/sys/dev/smartpqi/smartpqi_queue.c
Show First 20 Lines • Show All 194 Lines • ▼ Show 20 Lines | int pqisrc_allocate_and_init_adminq(pqisrc_softstate_t *softs) | ||||
/* OB PI */ | /* OB PI */ | ||||
softs->admin_ob_queue.pi_virt_addr = | softs->admin_ob_queue.pi_virt_addr = | ||||
(uint32_t*)((uint8_t*)(softs->admin_ib_queue.ci_virt_addr) + | (uint32_t*)((uint8_t*)(softs->admin_ib_queue.ci_virt_addr) + | ||||
PQI_ADDR_ALIGN_MASK_64 + 1); | PQI_ADDR_ALIGN_MASK_64 + 1); | ||||
softs->admin_ob_queue.pi_dma_addr = | softs->admin_ob_queue.pi_dma_addr = | ||||
(dma_addr_t)((uint8_t*)(softs->admin_ib_queue.ci_dma_addr) + | (dma_addr_t)((uint8_t*)(softs->admin_ib_queue.ci_dma_addr) + | ||||
PQI_ADDR_ALIGN_MASK_64 + 1); | PQI_ADDR_ALIGN_MASK_64 + 1); | ||||
DBG_INFO("softs->admin_ib_queue.ci_dma_addr : %p,softs->admin_ob_queue.pi_dma_addr :%p\n", | DBG_INIT("softs->admin_ib_queue.ci_dma_addr : %p,softs->admin_ob_queue.pi_dma_addr :%p\n", | ||||
(void*)softs->admin_ib_queue.ci_dma_addr, (void*)softs->admin_ob_queue.pi_dma_addr ); | (void*)softs->admin_ib_queue.ci_dma_addr, (void*)softs->admin_ob_queue.pi_dma_addr ); | ||||
/* Verify alignment */ | /* Verify alignment */ | ||||
ASSERT(!(softs->admin_ib_queue.array_dma_addr & | ASSERT(!(softs->admin_ib_queue.array_dma_addr & | ||||
PQI_ADDR_ALIGN_MASK_64)); | PQI_ADDR_ALIGN_MASK_64)); | ||||
ASSERT(!(softs->admin_ib_queue.ci_dma_addr & | ASSERT(!(softs->admin_ib_queue.ci_dma_addr & | ||||
PQI_ADDR_ALIGN_MASK_64)); | PQI_ADDR_ALIGN_MASK_64)); | ||||
ASSERT(!(softs->admin_ob_queue.array_dma_addr & | ASSERT(!(softs->admin_ob_queue.array_dma_addr & | ||||
▲ Show 20 Lines • Show All 137 Lines • ▼ Show 20 Lines | /* Admin queue created, get ci,pi offset */ | ||||
os_strlcpy(softs->admin_ib_queue.lockname, "admin_ibqlock", LOCKNAME_SIZE); | os_strlcpy(softs->admin_ib_queue.lockname, "admin_ibqlock", LOCKNAME_SIZE); | ||||
ret =OS_INIT_PQILOCK(softs, &softs->admin_ib_queue.lock, | ret =OS_INIT_PQILOCK(softs, &softs->admin_ib_queue.lock, | ||||
softs->admin_ib_queue.lockname); | softs->admin_ib_queue.lockname); | ||||
if(ret){ | if(ret){ | ||||
DBG_ERR("Admin spinlock initialization failed\n"); | DBG_ERR("Admin spinlock initialization failed\n"); | ||||
softs->admin_ib_queue.lockcreated = false; | softs->admin_ib_queue.lockcreated = false; | ||||
goto err_out; | goto err_lock; | ||||
} | } | ||||
softs->admin_ib_queue.lockcreated = true; | softs->admin_ib_queue.lockcreated = true; | ||||
/* Print admin q config details */ | /* Print admin q config details */ | ||||
pqisrc_print_adminq_config(softs); | pqisrc_print_adminq_config(softs); | ||||
DBG_FUNC("OUT\n"); | DBG_FUNC("OUT\n"); | ||||
return ret; | return ret; | ||||
err_lock: | |||||
err_q_create: | err_q_create: | ||||
os_dma_mem_free(softs, &softs->admin_queue_dma_mem); | os_dma_mem_free(softs, &softs->admin_queue_dma_mem); | ||||
err_out: | err_out: | ||||
DBG_FUNC("failed OUT\n"); | DBG_FUNC("failed OUT\n"); | ||||
return ret; | return ret; | ||||
} | } | ||||
/* | /* | ||||
▲ Show 20 Lines • Show All 621 Lines • Show Last 20 Lines |