Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
scsi_tgt_if.h
Go to the documentation of this file.
1 /*
2  * SCSI target kernel/user interface
3  *
4  * Copyright (C) 2005 FUJITA Tomonori <[email protected]>
5  * Copyright (C) 2005 Mike Christie <[email protected]>
6  *
7  * This program is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU General Public License as
9  * published by the Free Software Foundation; either version 2 of the
10  * License, or (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful, but
13  * WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15  * General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program; if not, write to the Free Software
19  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
20  * 02110-1301 USA
21  */
22 #ifndef __SCSI_TARGET_IF_H
23 #define __SCSI_TARGET_IF_H
24 
25 /* user -> kernel */
26 #define TGT_UEVENT_CMD_RSP 0x0001
27 #define TGT_UEVENT_IT_NEXUS_RSP 0x0002
28 #define TGT_UEVENT_TSK_MGMT_RSP 0x0003
29 
30 /* kernel -> user */
31 #define TGT_KEVENT_CMD_REQ 0x1001
32 #define TGT_KEVENT_CMD_DONE 0x1002
33 #define TGT_KEVENT_IT_NEXUS_REQ 0x1003
34 #define TGT_KEVENT_TSK_MGMT_REQ 0x1004
35 
36 struct tgt_event_hdr {
41 } __attribute__ ((aligned (sizeof(uint64_t))));
42 
43 struct tgt_event {
45 
46  union {
47  /* user-> kernel */
48  struct {
49  int host_no;
50  int result;
58  } cmd_rsp;
59  struct {
60  int host_no;
61  int result;
64  } tsk_mgmt_rsp;
65  struct {
69  __u32 function;
70  } it_nexus_rsp;
71 
72  /* kernel -> user */
73  struct {
74  int host_no;
77  uint8_t scb[16];
79  int attribute;
81  } cmd_req;
82  struct {
83  int host_no;
84  int result;
87  } cmd_done;
88  struct {
89  int host_no;
90  int function;
93  uint8_t lun[8];
95  } tsk_mgmt_req;
96  struct {
97  __s32 host_no;
98  __u32 function;
102  } it_nexus_req;
103  } p;
104 } __attribute__ ((aligned (sizeof(uint64_t))));
106 #define TGT_RING_SIZE (1UL << 16)
107 
108 #endif