003 File Manager
Current Path:
/usr/src/sys/dev/smartpqi
usr
/
src
/
sys
/
dev
/
smartpqi
/
📁
..
📄
smartpqi_cam.c
(29.76 KB)
📄
smartpqi_cmd.c
(2.58 KB)
📄
smartpqi_defines.h
(33.06 KB)
📄
smartpqi_discovery.c
(49.97 KB)
📄
smartpqi_event.c
(12.03 KB)
📄
smartpqi_helper.c
(8.55 KB)
📄
smartpqi_includes.h
(2.59 KB)
📄
smartpqi_init.c
(25.85 KB)
📄
smartpqi_intr.c
(11.11 KB)
📄
smartpqi_ioctl.c
(11.08 KB)
📄
smartpqi_ioctl.h
(3.99 KB)
📄
smartpqi_main.c
(15.84 KB)
📄
smartpqi_mem.c
(4.56 KB)
📄
smartpqi_misc.c
(4.22 KB)
📄
smartpqi_prototypes.h
(11.24 KB)
📄
smartpqi_queue.c
(28.96 KB)
📄
smartpqi_request.c
(23.1 KB)
📄
smartpqi_response.c
(6.14 KB)
📄
smartpqi_sis.c
(12.28 KB)
📄
smartpqi_structures.h
(29.64 KB)
📄
smartpqi_tag.c
(6.98 KB)
Editing: smartpqi_cmd.c
/*- * Copyright (c) 2018 Microsemi Corporation. * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ /* $FreeBSD$ */ #include "smartpqi_includes.h" /* * Function to submit the request to the adapter. */ int pqisrc_submit_cmnd(pqisrc_softstate_t *softs, ib_queue_t *ib_q, void *req) { char *slot = NULL; uint32_t offset; iu_header_t *hdr = (iu_header_t *)req; uint32_t iu_len = hdr->iu_length + 4 ; /* header size */ int i = 0; DBG_FUNC("IN\n"); PQI_LOCK(&ib_q->lock); /* Check queue full */ if ((ib_q->pi_local + 1) % ib_q->num_elem == *(ib_q->ci_virt_addr)) { DBG_WARN("OUT Q full\n"); PQI_UNLOCK(&ib_q->lock); return PQI_STATUS_QFULL; } /* Get the slot */ offset = ib_q->pi_local * ib_q->elem_size; slot = ib_q->array_virt_addr + offset; /* Copy the IU */ memcpy(slot, req, iu_len); DBG_INFO("IU : \n"); for(i = 0; i< iu_len; i++) DBG_INFO(" IU [ %d ] : %x\n", i, *((unsigned char *)(slot + i))); /* Update the local PI */ ib_q->pi_local = (ib_q->pi_local + 1) % ib_q->num_elem; DBG_INFO("ib_q->pi_local : %x IU size : %d\n", ib_q->pi_local, hdr->iu_length); DBG_INFO("*ib_q->ci_virt_addr: %x\n", *(ib_q->ci_virt_addr)); /* 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); PQI_UNLOCK(&ib_q->lock); DBG_FUNC("OUT\n"); return PQI_STATUS_SUCCESS; }
Upload File
Create Folder