Emulex Logo
OneCoreā„¢ Storage SDK Release 11.2
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
ocs_ramd_thread.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2011-2015, Emulex
3  * All rights reserved.
4  *
5  * Redistribution and use in source and binary forms, with or without
6  * modification, are permitted provided that the following conditions are met:
7  *
8  * 1. Redistributions of source code must retain the above copyright notice,
9  * this list of conditions and the following disclaimer.
10  *
11  * 2. Redistributions in binary form must reproduce the above copyright notice,
12  * this list of conditions and the following disclaimer in the documentation
13  * and/or other materials provided with the distribution.
14  *
15  * 3. Neither the name of the copyright holder nor the names of its contributors
16  * may be used to endorse or promote products derived from this software
17  * without specific prior written permission.
18  *
19  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
20  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
22  * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
23  * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
24  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
25  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
27  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29  * POSSIBILITY OF SUCH DAMAGE.
30  *
31  */
32 
33 /**
34  * @file
35  *
36  */
37 
38 #if !defined(__OCS_RAMD_THREAD_H__)
39 #define __OCS_RAMD_THREAD_H__
40 
41 typedef enum {
48 
49 typedef struct {
50  ocs_io_t *io;
51  uint32_t lun;
52  uint8_t cdb[32]; /* TODO: Need max CDB length? */
53  uint32_t cdb_len;
54  uint32_t flags;
57 
58 typedef struct {
59  ocs_io_t *io;
61  uint32_t flags;
62  void *arg;
64 
65 typedef struct {
66  ocs_io_t *io;
68  uint32_t flags;
69  void *arg;
71 
72 typedef struct {
73  void (*fctn)(void *arg);
74  void *arg;
76 
77 typedef struct {
79  union {
84  } ramd_cmd;
86 
87 typedef struct {
88  ocs_thread_t thread;
89  ocs_cbuf_t *cmd_queue;
90  uint32_t cmd_count[OCS_RAMD_CMD_MAX];
91  uint8_t started:1;
93 
94 
95 extern int32_t ocs_ramd_start_threads(uint32_t threading_mode, uint32_t thread_cmds);
96 extern void ocs_ramd_stop_threads(void);
97 extern void ocs_ramd_thread_ddump(ocs_textbuf_t *textbuf);
98 extern void ocs_ramd_tgt_bounce(void (*fctn)(void *arg), void *arg, uint32_t s_id, uint32_t d_id, uint32_t ox_id);
99 extern uint32_t ocs_ramd_get_enable_ramd_threading(void);
100 #endif // __OCS_RAMD_THREAD_H__
ocs_ramd_cmd_io_cb_t io_cb
ocs_list_t ocs_list_link_t
Definition: ocs_list.h:84
ocs_ramd_cmd_e
void ocs_ramd_tgt_bounce(void(*fctn)(void *arg), void *arg, uint32_t s_id, uint32_t d_id, uint32_t ox_id)
uint32_t ocs_ramd_get_enable_ramd_threading(void)
static uint32_t thread_cmds
ocs_scsi_io_status_e scsi_status
ocs_ramd_cmd_e ramd_cmd_type
void ocs_ramd_stop_threads(void)
void ocs_ramd_thread_ddump(ocs_textbuf_t *textbuf)
int32_t ocs_ramd_start_threads(uint32_t threading_mode, uint32_t arg_thread_cmds)
ocs_thread_t thread
ocs_cbuf_t * cmd_queue
ocs_ramd_cmd_dataphase_cb_t dataphase_cb
ocs_scsi_io_status_e scsi_status
ocs_ramd_cmd_recv_cmd_t recv_cmd
ocs_scsi_io_status_e
Definition: ocs_scsi.h:105
ocs_ramd_cmd_bounce_t bounce