SISCI API
Documentation
sisci_types.h
Go to the documentation of this file.
1 /* $Id$ */
2 
3 /*******************************************************************************
4  * *
5  * Copyright (C) 1993 - 2019 *
6  * Dolphin Interconnect Solutions AS *
7  * *
8  * This program is free software; you can redistribute it and/or modify *
9  * it under the terms of the GNU General Public License as published by *
10  * the Free Software Foundation; either version 2 of the License, *
11  * or (at your option) any later version. *
12  * *
13  * This program is distributed in the hope that it will be useful, *
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of *
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
16  * GNU General Public License for more details. *
17  * *
18  * You should have received a copy of the GNU General Public License *
19  * along with this program; if not, write to the Free Software *
20  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
21  * *
22  * *
23  *******************************************************************************/
24 
29 #ifndef _SISCI_TYPES_H
30 #define _SISCI_TYPES_H
31 
32 #include "dis_types.h"
33 #include "sisci_error.h"
34 
35 #ifndef IN
36 #define IN
37 #endif
38 
39 #ifndef OUT
40 #define OUT
41 #endif
42 
43 #ifndef IN_OUT
44 #define IN_OUT
45 #endif
46 
47 /* Opaque data types for descriptors/handles */
48 
55 typedef struct sci_desc *sci_desc_t;
56 
63 typedef struct sci_local_segment *sci_local_segment_t;
64 
69 typedef struct sci_remote_segment *sci_remote_segment_t;
70 
77 typedef struct sci_map *sci_map_t;
78 
86 typedef struct sci_sequence *sci_sequence_t;
87 
88 #ifndef _DIS_KERNEL_
89 
96 typedef struct sci_dma_queue *sci_dma_queue_t;
97 #endif
98 
104 typedef struct sci_dma_channel *sci_dma_channel_t;
105 
106 
111 typedef struct sci_remote_interrupt *sci_remote_interrupt_t;
112 
119 typedef struct sci_local_interrupt *sci_local_interrupt_t;
120 
121 
127 typedef struct sci_remote_data_interrupt *sci_remote_data_interrupt_t;
128 
135 typedef struct sci_local_data_interrupt *sci_local_data_interrupt_t;
136 
142 typedef struct sci_smartio_device *sci_smartio_device_t;
143 
144 
145 
152 typedef enum {
178 #ifdef _WIN32
179  SCI_CB_TERMINATE,
180 #endif
183 
184 
185 #define MAX_CB_REASON SCI_CB_FATAL
186 
187 
188 /* dma_queue_states is identical to the dma_queue_state_t in genif.h,
189 they must be consistent.*/
190 
194 typedef enum {
195  SCI_DMAQUEUE_IDLE,
196  SCI_DMAQUEUE_GATHER,
197  SCI_DMAQUEUE_POSTED,
198  SCI_DMAQUEUE_DONE,
199  SCI_DMAQUEUE_ABORTED,
200  SCI_DMAQUEUE_ERROR
202 
203 /* Types of DMA channels that can be requested */
204 typedef enum {
205  SCI_DMA_TYPE_DONTCARE,
206  SCI_DMA_TYPE_ADAPTER,
207  SCI_DMA_TYPE_GLOBAL,
208  SCI_DMA_TYPE_SYSTEM,
209  SCI_DMA_TYPE_TRANSPARENT
210 } sci_dma_type_t;
211 
212 
213 #define DIS_DMA_MAX_VECLEN 256
214 
218 typedef struct {
219  unsigned int size;
220  unsigned int local_offset;
221  unsigned int remote_offset;
222  unsigned int flags;
223 } dis_dma_vec_t;
224 
225 
229 typedef struct {
230  unsigned long long fdid;
231  unsigned short pci_device_id;
232  unsigned short pci_vendor_id;
233  unsigned int pci_class;
234  unsigned short pci_subsystem_device_id;
235  unsigned short pci_subsystem_vendor_id;
236  unsigned long long pci_serial_number;
237  unsigned short remote_bdf;
238  unsigned short local_bdf;
242  unsigned int adapter;
243 
246  unsigned int nodeid;
247 
249  char user_name[64];
250  char uuid[37];
252 
253 
259 typedef enum {
270 
276 typedef struct {
277  /* SCI Address bit 63 - 48 */
278  unsigned short nodeId;
279  /* SCI Address bit 47 - 32 */
280  unsigned short offsHi;
281  /* SCI Address bit 31 - 0 */
282  unsigned int offsLo;
283 } sci_address_t;
284 
285 
286 typedef unsigned long long sci_ioaddr_t;
287 
291 typedef enum {
301 
302 #ifndef _DIS_KERNEL_
303 
322  sci_local_segment_t segment,
324  unsigned int nodeId,
325  unsigned int localAdapterNo,
326  sci_error_t error);
327 
345  sci_remote_segment_t segment,
347  sci_error_t status);
348 
360 typedef sci_callback_action_t (*sci_cb_dma_t)(void IN *arg,
361  sci_dma_queue_t queue,
362  sci_error_t status);
363 
377  sci_local_interrupt_t interrupt,
378  sci_error_t status);
379 
395  sci_local_data_interrupt_t interrupt,
396  void *data,
397  unsigned int length,
398  sci_error_t status);
399 
411  sci_smartio_device_t device,
412  sci_error_t status);
413 
425  sci_smartio_device_t device,
426  sci_error_t status);
427 
428 #endif /* _DIS_KERNEL_ */
429 #endif
430 
431 
sci_callback_action_t(* sci_cb_remote_segment_t)(void *arg, sci_remote_segment_t segment, sci_segment_cb_reason_t reason, sci_error_t status)
Definition: sisci_types.h:344
sci_callback_action_t(* sci_cb_interrupt_t)(void *arg, sci_local_interrupt_t interrupt, sci_error_t status)
Definition: sisci_types.h:376
sci_callback_action_t
Definition: sisci_types.h:291
Definition: sisci_types.h:267
struct sci_smartio_device * sci_smartio_device_t
Definition: sisci_types.h:142
sci_callback_action_t(* sci_cb_device_segment_t)(void *arg, sci_smartio_device_t device, sci_error_t status)
Definition: sisci_types.h:410
Definition: sisci_types.h:181
struct sci_dma_queue * sci_dma_queue_t
Definition: sisci_types.h:96
unsigned long long pci_serial_number
Definition: sisci_types.h:236
unsigned short pci_vendor_id
Definition: sisci_types.h:232
sci_callback_action_t(* sci_cb_local_segment_t)(void *arg, sci_local_segment_t segment, sci_segment_cb_reason_t reason, unsigned int nodeId, unsigned int localAdapterNo, sci_error_t error)
Definition: sisci_types.h:321
Definition: sisci_types.h:168
sci_callback_action_t(* sci_cb_data_interrupt_t)(void *arg, sci_local_data_interrupt_t interrupt, void *data, unsigned int length, sci_error_t status)
Definition: sisci_types.h:394
unsigned int remote_offset
Definition: sisci_types.h:221
struct sci_dma_channel * sci_dma_channel_t
Definition: sisci_types.h:104
unsigned int offsLo
Definition: sisci_types.h:282
unsigned short pci_subsystem_vendor_id
Definition: sisci_types.h:235
struct sci_remote_data_interrupt * sci_remote_data_interrupt_t
Definition: sisci_types.h:127
struct sci_map * sci_map_t
Definition: sisci_types.h:77
sci_segment_cb_reason_t
Definition: sisci_types.h:152
Definition: sisci_types.h:292
unsigned int size
Definition: sisci_types.h:219
sci_callback_action_t(* sci_cb_device_mapping_t)(void *arg, sci_smartio_device_t device, sci_error_t status)
Definition: sisci_types.h:424
struct sci_remote_segment * sci_remote_segment_t
Definition: sisci_types.h:69
Definition: sisci_types.h:153
unsigned short pci_subsystem_device_id
Definition: sisci_types.h:234
Definition: sisci_types.h:229
unsigned short pci_device_id
Definition: sisci_types.h:231
Definition: sisci_types.h:218
struct sci_local_interrupt * sci_local_interrupt_t
Definition: sisci_types.h:119
unsigned int nodeid
Definition: sisci_types.h:246
sci_sequence_status_t
Definition: sisci_types.h:259
Definition: sisci_types.h:264
Definition: sisci_types.h:174
struct sci_local_data_interrupt * sci_local_data_interrupt_t
Definition: sisci_types.h:135
Definition: sisci_types.h:262
unsigned long long fdid
Definition: sisci_types.h:230
Definition: sisci_types.h:172
struct sci_local_segment * sci_local_segment_t
Definition: sisci_types.h:63
unsigned short local_bdf
Definition: sisci_types.h:238
unsigned int pci_class
Definition: sisci_types.h:233
Definition: sisci_types.h:276
struct sci_remote_interrupt * sci_remote_interrupt_t
Definition: sisci_types.h:111
unsigned short remote_bdf
Definition: sisci_types.h:237
Definition: sisci_types.h:260
unsigned int adapter
Definition: sisci_types.h:242
struct sci_sequence * sci_sequence_t
Definition: sisci_types.h:86
sci_error_t
The type sci_error_t represents the error code.
Definition: sisci_error.h:48
int physical_slot
Definition: sisci_types.h:248
unsigned short offsHi
Definition: sisci_types.h:280
struct sci_desc * sci_desc_t
Definition: sisci_types.h:55
sci_callback_action_t(* sci_cb_dma_t)(void IN *arg, sci_dma_queue_t queue, sci_error_t status)
Definition: sisci_types.h:360
sci_dma_queue_state_t
Definition: sisci_types.h:194
Definition: sisci_types.h:160
unsigned int local_offset
Definition: sisci_types.h:220
unsigned short nodeId
Definition: sisci_types.h:278
Definition: sisci_types.h:295