Changeset View
Changeset View
Standalone View
Standalone View
sys/dev/smartpqi/smartpqi_cmd.c
/*- | /*- | ||||
* Copyright (c) 2018 Microsemi Corporation. | * Copyright (c) 2016-2019 Microsemi Corporation. | ||||
* Copyright (c) 2020 Microchip Technology Inc. and it's subsidiaries. | |||||
* | |||||
* All rights reserved. | * All rights reserved. | ||||
* | * | ||||
* Redistribution and use in source and binary forms, with or without | * Redistribution and use in source and binary forms, with or without | ||||
Context not available. | |||||
* Function to submit the request to the adapter. | * Function to submit the request to the adapter. | ||||
*/ | */ | ||||
int pqisrc_submit_cmnd(pqisrc_softstate_t *softs, | int pqisrc_submit_cmnd(pqisrc_softstate_t *softs, | ||||
ib_queue_t *ib_q, void *req) | ib_queue_t *ib_q, void *req) | ||||
{ | { | ||||
char *slot = NULL; | char *slot = NULL; | ||||
Context not available. | |||||
DBG_FUNC("IN\n"); | DBG_FUNC("IN\n"); | ||||
PQI_LOCK(&ib_q->lock); | PQI_LOCK(&ib_q->lock); | ||||
/* Check queue full */ | /* Check queue full */ | ||||
if ((ib_q->pi_local + 1) % ib_q->num_elem == *(ib_q->ci_virt_addr)) { | if ((ib_q->pi_local + 1) % ib_q->num_elem == *(ib_q->ci_virt_addr)) { | ||||
DBG_WARN("OUT Q full\n"); | DBG_WARN("OUT Q full\n"); | ||||
PQI_UNLOCK(&ib_q->lock); | PQI_UNLOCK(&ib_q->lock); | ||||
return PQI_STATUS_QFULL; | return PQI_STATUS_QFULL; | ||||
} | } | ||||
Context not available. | |||||
/* Inform the fw about the new IU */ | /* Inform the fw about the new IU */ | ||||
PCI_MEM_PUT32(softs, ib_q->pi_register_abs, ib_q->pi_register_offset, ib_q->pi_local); | PCI_MEM_PUT32(softs, ib_q->pi_register_abs, ib_q->pi_register_offset, ib_q->pi_local); | ||||
PQI_UNLOCK(&ib_q->lock); | PQI_UNLOCK(&ib_q->lock); | ||||
DBG_FUNC("OUT\n"); | DBG_FUNC("OUT\n"); | ||||
return PQI_STATUS_SUCCESS; | return PQI_STATUS_SUCCESS; | ||||
} | } | ||||
Context not available. |