5 * Tunable parameters first
8 /* How many different OSM's are we allowing */
9 #define MAX_I2O_MODULES 64
10 /* How many controllers are we allowing */
11 #define MAX_I2O_CONTROLLERS 32
13 #include <linux/ioctl.h>
16 * I2O Control IOCTLs and structures
18 #define I2O_MAGIC_NUMBER 'i'
19 #define I2OGETIOPS _IOR(I2O_MAGIC_NUMBER,0,u8[MAX_I2O_CONTROLLERS])
20 #define I2OHRTGET _IOWR(I2O_MAGIC_NUMBER,1,struct i2o_cmd_hrtlct)
21 #define I2OLCTGET _IOWR(I2O_MAGIC_NUMBER,2,struct i2o_cmd_hrtlct)
22 #define I2OPARMSET _IOWR(I2O_MAGIC_NUMBER,3,struct i2o_cmd_psetget)
23 #define I2OPARMGET _IOWR(I2O_MAGIC_NUMBER,4,struct i2o_cmd_psetget)
24 #define I2OSWDL _IOWR(I2O_MAGIC_NUMBER,5,struct i2o_sw_xfer)
25 #define I2OSWUL _IOWR(I2O_MAGIC_NUMBER,6,struct i2o_sw_xfer)
26 #define I2OSWDEL _IOWR(I2O_MAGIC_NUMBER,7,struct i2o_sw_xfer)
27 #define I2OVALIDATE _IOR(I2O_MAGIC_NUMBER,8,u32)
28 #define I2OHTML _IOWR(I2O_MAGIC_NUMBER,9,struct i2o_html)
30 /* On hold until we figure this out
31 #define I2OEVTREG _IO(I2O_MAGIC_NUMBER,10)
32 #define I2OEVTCLR _IO(I2O_MAGIC_NUMBER,11)
33 #define I2OEVTGET _IO(I2O_MAGIC_NUMBER,12)
38 unsigned int iop
; /* IOP unit number */
39 void *resbuf
; /* Buffer for result */
40 unsigned int *reslen
; /* Buffer length in bytes */
43 struct i2o_cmd_psetget
45 unsigned int iop
; /* IOP unit number */
46 unsigned int tid
; /* Target device TID */
47 void *opbuf
; /* Operation List buffer */
48 unsigned int oplen
; /* Operation List buffer length in bytes */
49 void *resbuf
; /* Result List buffer */
50 unsigned int *reslen
; /* Result List buffer length in bytes */
55 unsigned int iop
; /* IOP unit number */
56 unsigned char flags
; /* Flags field */
57 unsigned char sw_type
; /* Software type */
58 unsigned int sw_id
; /* Software ID */
59 void *buf
; /* Pointer to software buffer */
60 unsigned int *swlen
; /* Length of software data */
61 unsigned int *maxfrag
; /* Maximum fragment count */
62 unsigned int *curfrag
; /* Current fragment count */
67 unsigned int iop
; /* IOP unit number */
68 unsigned int tid
; /* Target device ID */
69 unsigned int page
; /* HTML page */
70 void *resbuf
; /* Buffer for reply HTML page */
71 unsigned int *reslen
; /* Length in bytes of reply buffer */
72 void *qbuf
; /* Pointer to HTTP query string */
73 unsigned int qlen
; /* Length in bytes of query string buffer */
77 /**************************************************************************
78 * HRT related constants and structures
79 **************************************************************************/
80 #define I2O_BUS_LOCAL 0
82 #define I2O_BUS_EISA 2
85 #define I2O_BUS_PCMCIA 5
86 #define I2O_BUS_NUBUS 6
87 #define I2O_BUS_CARDBUS 7
88 #define I2O_BUS_UNKNOWN 0x80
91 typedef unsigned char u8
;
92 typedef unsigned short u16
;
93 typedef unsigned int u32
;
94 #endif /* __KERNEL__ */
96 typedef struct _i2o_pci_bus
{
103 } i2o_pci_bus
, *pi2o_pci_bus
;
105 typedef struct _i2o_local_bus
{
108 u32 LbBaseMemoryAddress
;
109 } i2o_local_bus
, *pi2o_local_bus
;
111 typedef struct _i2o_isa_bus
{
115 u32 IsaBaseMemoryAddress
;
116 } i2o_isa_bus
, *pi2o_isa_bus
;
118 typedef struct _i2o_eisa_bus_info
{
122 u32 EisaBaseMemoryAddress
;
123 } i2o_eisa_bus
, *pi2o_eisa_bus
;
125 typedef struct _i2o_mca_bus
{
129 u32 McaBaseMemoryAddress
;
130 } i2o_mca_bus
, *pi2o_mca_bus
;
132 typedef struct _i2o_other_bus
{
135 u32 BaseMemoryAddress
;
136 } i2o_other_bus
, *pi2o_other_bus
;
138 typedef struct _i2o_hrt_entry
{
146 i2o_local_bus local_bus
;
148 i2o_eisa_bus eisa_bus
;
150 i2o_other_bus other_bus
;
152 } i2o_hrt_entry
, *pi2o_hrt_entry
;
154 typedef struct _i2o_hrt
{
159 i2o_hrt_entry hrt_entry
[1];
160 } i2o_hrt
, *pi2o_hrt
;
162 typedef struct _i2o_lct_entry
{
176 u32 event_capabilities
;
177 } i2o_lct_entry
, *pi2o_lct_entry
;
179 typedef struct _i2o_lct
{
184 u32 current_change_ind
;
185 i2o_lct_entry lct_entry
[1];
186 } i2o_lct
, *pi2o_lct
;
188 typedef struct _i2o_status_block
{
194 u16 segment_number
:12;
198 u16 inbound_frame_size
;
201 u32 max_inbound_frames
;
202 u32 max_outbound_frames
;
204 u32 expected_lct_size
;
205 u32 iop_capabilities
;
206 u32 desired_mem_size
;
207 u32 current_mem_size
;
208 u32 current_mem_base
;
214 } i2o_status_block
, *pi2o_status_block
;
218 #ifdef __KERNEL__ /* ioctl stuff only thing exported to users */
220 #define I2O_MAX_MANAGERS 4
223 * I2O Interface Objects
226 #include <linux/config.h>
227 #include <linux/notifier.h>
228 #include <asm/atomic.h>
238 u32 initiator_context
;
243 * Each I2O device entity has one or more of these. There is one
244 * per device. *FIXME* how to handle multiple types on one unit.
249 pi2o_lct_entry lct_data
;/* Device LCT information */
251 int i2oversion
; /* I2O version supported. Actually there
252 * should be high and low version */
254 struct proc_dir_entry
* proc_entry
; /* /proc dir */
257 struct i2o_handler
*owner
;
259 /* Management users */
260 struct i2o_handler
*managers
[I2O_MAX_MANAGERS
];
263 struct i2o_controller
*controller
; /* Controlling IOP */
264 struct i2o_device
*next
; /* Chain */
265 char dev_name
[8]; /* linux /dev name if available */
269 * Resource data for each PCI I2O controller
281 * Each I2O controller has one of these objects
284 struct i2o_controller
290 #define I2O_TYPE_PCI 0x01 /* PCI I2O controller */
292 struct notifier_block
*event_notifer
; /* Events */
294 struct i2o_device
*devices
; /* I2O device chain */
295 struct i2o_controller
*next
; /* Controller chain */
296 volatile u32
*post_port
; /* Messaging ports */
297 volatile u32
*reply_port
;
298 volatile u32
*irq_mask
; /* Interrupt port */
300 pi2o_status_block status_block
; /* IOP status block */
304 u32 mem_offset
; /* MFA offset */
305 u32 mem_phys
; /* MFA physical */
312 struct proc_dir_entry
* proc_entry
; /* /proc dir */
315 { /* Bus information */
318 /* Bus specific destructor */
319 void (*destructor
)(struct i2o_controller
*);
320 /* Bus specific attach/detach */
321 int (*bind
)(struct i2o_controller
*, struct i2o_device
*);
322 /* Bus specific initiator */
323 int (*unbind
)(struct i2o_controller
*, struct i2o_device
*);
324 /* Bus specific enable/disable */
325 void (*bus_enable
)(struct i2o_controller
*c
);
326 void (*bus_disable
)(struct i2o_controller
*c
);
328 void *page_frame
; /* Message buffers */
329 int inbound_size
; /* Inbound queue size */
334 void (*reply
)(struct i2o_handler
*, struct i2o_controller
*, struct i2o_message
*);
336 int context
; /* Low 8 bits of the transaction info */
337 u32
class; /* I2O classes that this driver handles */
338 /* User data follows */
343 * Used by bus specific modules to communicate with the core
345 * This is needed because the bus modules cannot make direct
346 * calls to the core as this results in the i2o_bus_specific_module
347 * being dependent on the core, not the otherway around.
348 * In that case, a 'modprobe i2o_lan' loads i2o_core & i2o_lan,
349 * but _not_ i2o_pci...which makes the whole thing pretty useless :)
352 struct i2o_core_func_table
354 int (*install
)(struct i2o_controller
*);
355 int (*activate
)(struct i2o_controller
*);
356 struct i2o_controller
* (*find
)(int);
357 void (*unlock
)(struct i2o_controller
*);
358 void (*run_queue
)(struct i2o_controller
*c
);
359 int (*delete)(struct i2o_controller
*);
364 * I2O System table entry
366 struct i2o_sys_tbl_entry
379 u32 iop_capabilities
;
392 struct i2o_sys_tbl_entry iops
[0];
398 extern inline u32
I2O_POST_READ32(struct i2o_controller
*c
)
400 return *c
->post_port
;
403 extern inline void I2O_POST_WRITE32(struct i2o_controller
*c
, u32 Val
)
409 extern inline u32
I2O_REPLY_READ32(struct i2o_controller
*c
)
411 return *c
->reply_port
;
414 extern inline void I2O_REPLY_WRITE32(struct i2o_controller
*c
, u32 Val
)
420 extern inline u32
I2O_IRQ_READ32(struct i2o_controller
*c
)
425 extern inline void I2O_IRQ_WRITE32(struct i2o_controller
*c
, u32 Val
)
431 extern inline void i2o_post_message(struct i2o_controller
*c
, u32 m
)
433 /* The second line isnt spurious - thats forcing PCI posting */
434 I2O_POST_WRITE32(c
,m
);
435 (void) I2O_IRQ_READ32(c
);
438 extern inline void i2o_flush_reply(struct i2o_controller
*c
, u32 m
)
440 I2O_REPLY_WRITE32(c
,m
);
444 struct i2o_controller
*i2o_controller_chain
;
446 extern int i2o_quiesce_controller(struct i2o_controller
*);
447 extern int i2o_clear_controller(struct i2o_controller
*);
448 extern int i2o_install_controller(struct i2o_controller
*);
449 extern int i2o_delete_controller(struct i2o_controller
*);
450 extern int i2o_activate_controller(struct i2o_controller
*);
451 extern void i2o_unlock_controller(struct i2o_controller
*);
452 extern struct i2o_controller
*i2o_find_controller(int);
453 extern int i2o_status_get(struct i2o_controller
*);
454 extern int i2o_num_controllers
;
456 extern int i2o_install_handler(struct i2o_handler
*);
457 extern int i2o_remove_handler(struct i2o_handler
*);
459 extern int i2o_install_device(struct i2o_controller
*, struct i2o_device
*);
460 extern int i2o_delete_device(struct i2o_device
*);
461 extern int i2o_claim_device(struct i2o_device
*, struct i2o_handler
*, u32
);
462 extern int i2o_release_device(struct i2o_device
*, struct i2o_handler
*, u32
);
464 extern int i2o_post_this(struct i2o_controller
*, u32
*, int);
465 extern int i2o_post_wait(struct i2o_controller
*, u32
*, int, int);
466 extern int i2o_issue_claim(struct i2o_controller
*, int, int, int, int *, u32
);
467 extern int i2o_issue_params(int, struct i2o_controller
*, int, void *,
470 extern int i2o_query_scalar(struct i2o_controller
*, int, int, int,
472 extern int i2o_set_scalar(struct i2o_controller
*, int, int, int,
475 extern int i2o_query_table(int, struct i2o_controller
*, int, int, int,
476 void *, int, void *, int);
477 extern int i2o_clear_table(struct i2o_controller
*, int, int);
478 extern int i2o_row_add_table(struct i2o_controller
*, int, int, int,
480 extern int i2o_row_delete_table(struct i2o_controller
*, int, int, int,
483 extern void i2o_run_queue(struct i2o_controller
*);
484 extern void i2o_report_status(const char *, const char *, u32
*);
486 extern const char *i2o_get_class_name(int);
490 * I2O classes / subclasses
493 /* Class ID and Code Assignments
494 * (LCT.ClassID.Version field)
496 #define I2O_CLASS_VERSION_10 0x00
497 #define I2O_CLASS_VERSION_11 0x01
500 * (from v1.5 Table 6-1 Class Code Assignments.)
503 #define I2O_CLASS_EXECUTIVE 0x000
504 #define I2O_CLASS_DDM 0x001
505 #define I2O_CLASS_RANDOM_BLOCK_STORAGE 0x010
506 #define I2O_CLASS_SEQUENTIAL_STORAGE 0x011
507 #define I2O_CLASS_LAN 0x020
508 #define I2O_CLASS_WAN 0x030
509 #define I2O_CLASS_FIBRE_CHANNEL_PORT 0x040
510 #define I2O_CLASS_FIBRE_CHANNEL_PERIPHERAL 0x041
511 #define I2O_CLASS_SCSI_PERIPHERAL 0x051
512 #define I2O_CLASS_ATE_PORT 0x060
513 #define I2O_CLASS_ATE_PERIPHERAL 0x061
514 #define I2O_CLASS_FLOPPY_CONTROLLER 0x070
515 #define I2O_CLASS_FLOPPY_DEVICE 0x071
516 #define I2O_CLASS_BUS_ADAPTER_PORT 0x080
517 #define I2O_CLASS_PEER_TRANSPORT_AGENT 0x090
518 #define I2O_CLASS_PEER_TRANSPORT 0x091
520 /* Rest of 0x092 - 0x09f reserved for peer-to-peer classes
523 #define I2O_CLASS_MATCH_ANYCLASS 0xffffffff
528 #define I2O_SUBCLASS_i960 0x001
529 #define I2O_SUBCLASS_HDM 0x020
530 #define I2O_SUBCLASS_ISM 0x021
532 /* Operation functions */
534 #define I2O_PARAMS_FIELD_GET 0x0001
535 #define I2O_PARAMS_LIST_GET 0x0002
536 #define I2O_PARAMS_MORE_GET 0x0003
537 #define I2O_PARAMS_SIZE_GET 0x0004
538 #define I2O_PARAMS_TABLE_GET 0x0005
539 #define I2O_PARAMS_FIELD_SET 0x0006
540 #define I2O_PARAMS_LIST_SET 0x0007
541 #define I2O_PARAMS_ROW_ADD 0x0008
542 #define I2O_PARAMS_ROW_DELETE 0x0009
543 #define I2O_PARAMS_TABLE_CLEAR 0x000A
546 * I2O serial number conventions / formats
550 #define I2O_SNFORMAT_UNKNOWN 0
551 #define I2O_SNFORMAT_BINARY 1
552 #define I2O_SNFORMAT_ASCII 2
553 #define I2O_SNFORMAT_UNICODE 3
554 #define I2O_SNFORMAT_LAN48_MAC 4
555 #define I2O_SNFORMAT_WAN 5
557 /* Plus new in v2.0 (Yellowstone pdf doc)
560 #define I2O_SNFORMAT_LAN64_MAC 6
561 #define I2O_SNFORMAT_DDM 7
562 #define I2O_SNFORMAT_IEEE_REG64 8
563 #define I2O_SNFORMAT_IEEE_REG128 9
564 #define I2O_SNFORMAT_UNKNOWN2 0xff
566 /* Transaction Reply Lists (TRL) Control Word structure */
568 #define TRL_SINGLE_FIXED_LENGTH 0x00
569 #define TRL_SINGLE_VARIABLE_LENGTH 0x40
570 #define TRL_MULTIPLE_FIXED_LENGTH 0x80
573 * Messaging API values
576 #define I2O_CMD_ADAPTER_ASSIGN 0xB3
577 #define I2O_CMD_ADAPTER_READ 0xB2
578 #define I2O_CMD_ADAPTER_RELEASE 0xB5
579 #define I2O_CMD_BIOS_INFO_SET 0xA5
580 #define I2O_CMD_BOOT_DEVICE_SET 0xA7
581 #define I2O_CMD_CONFIG_VALIDATE 0xBB
582 #define I2O_CMD_CONN_SETUP 0xCA
583 #define I2O_CMD_DDM_DESTROY 0xB1
584 #define I2O_CMD_DDM_ENABLE 0xD5
585 #define I2O_CMD_DDM_QUIESCE 0xC7
586 #define I2O_CMD_DDM_RESET 0xD9
587 #define I2O_CMD_DDM_SUSPEND 0xAF
588 #define I2O_CMD_DEVICE_ASSIGN 0xB7
589 #define I2O_CMD_DEVICE_RELEASE 0xB9
590 #define I2O_CMD_HRT_GET 0xA8
591 #define I2O_CMD_ADAPTER_CLEAR 0xBE
592 #define I2O_CMD_ADAPTER_CONNECT 0xC9
593 #define I2O_CMD_ADAPTER_RESET 0xBD
594 #define I2O_CMD_LCT_NOTIFY 0xA2
595 #define I2O_CMD_OUTBOUND_INIT 0xA1
596 #define I2O_CMD_PATH_ENABLE 0xD3
597 #define I2O_CMD_PATH_QUIESCE 0xC5
598 #define I2O_CMD_PATH_RESET 0xD7
599 #define I2O_CMD_STATIC_MF_CREATE 0xDD
600 #define I2O_CMD_STATIC_MF_RELEASE 0xDF
601 #define I2O_CMD_STATUS_GET 0xA0
602 #define I2O_CMD_SW_DOWNLOAD 0xA9
603 #define I2O_CMD_SW_UPLOAD 0xAB
604 #define I2O_CMD_SW_REMOVE 0xAD
605 #define I2O_CMD_SYS_ENABLE 0xD1
606 #define I2O_CMD_SYS_MODIFY 0xC1
607 #define I2O_CMD_SYS_QUIESCE 0xC3
608 #define I2O_CMD_SYS_TAB_SET 0xA3
610 #define I2O_CMD_UTIL_NOP 0x00
611 #define I2O_CMD_UTIL_ABORT 0x01
612 #define I2O_CMD_UTIL_CLAIM 0x09
613 #define I2O_CMD_UTIL_RELEASE 0x0B
614 #define I2O_CMD_UTIL_PARAMS_GET 0x06
615 #define I2O_CMD_UTIL_PARAMS_SET 0x05
616 #define I2O_CMD_UTIL_EVT_REGISTER 0x13
617 #define I2O_CMD_UTIL_ACK 0x14
618 #define I2O_CMD_UTIL_CONFIG_DIALOG 0x10
619 #define I2O_CMD_UTIL_DEVICE_RESERVE 0x0D
620 #define I2O_CMD_UTIL_DEVICE_RELEASE 0x0F
621 #define I2O_CMD_UTIL_LOCK 0x17
622 #define I2O_CMD_UTIL_LOCK_RELEASE 0x19
623 #define I2O_CMD_UTIL_REPLY_FAULT_NOTIFY 0x15
625 #define I2O_CMD_SCSI_EXEC 0x81
626 #define I2O_CMD_SCSI_ABORT 0x83
627 #define I2O_CMD_SCSI_BUSRESET 0x27
629 #define I2O_CMD_BLOCK_READ 0x30
630 #define I2O_CMD_BLOCK_WRITE 0x31
631 #define I2O_CMD_BLOCK_CFLUSH 0x37
632 #define I2O_CMD_BLOCK_MLOCK 0x49
633 #define I2O_CMD_BLOCK_MUNLOCK 0x4B
634 #define I2O_CMD_BLOCK_MMOUNT 0x41
635 #define I2O_CMD_BLOCK_MEJECT 0x43
637 #define I2O_PRIVATE_MSG 0xFF
640 * Init Outbound Q status
643 #define I2O_CMD_OUTBOUND_INIT_IN_PROGRESS 0x01
644 #define I2O_CMD_OUTBOUND_INIT_REJECTED 0x02
645 #define I2O_CMD_OUTBOUND_INIT_FAILED 0x03
646 #define I2O_CMD_OUTBOUND_INIT_COMPLETE 0x04
649 * I2O Get Status State values
652 #define ADAPTER_STATE_INITIALIZING 0x01
653 #define ADAPTER_STATE_RESET 0x02
654 #define ADAPTER_STATE_HOLD 0x04
655 #define ADAPTER_STATE_READY 0x05
656 #define ADAPTER_STATE_OPERATIONAL 0x08
657 #define ADAPTER_STATE_FAILED 0x10
658 #define ADAPTER_STATE_FAULTED 0x11
660 /* I2O API function return values */
662 #define I2O_RTN_NO_ERROR 0
663 #define I2O_RTN_NOT_INIT 1
664 #define I2O_RTN_FREE_Q_EMPTY 2
665 #define I2O_RTN_TCB_ERROR 3
666 #define I2O_RTN_TRANSACTION_ERROR 4
667 #define I2O_RTN_ADAPTER_ALREADY_INIT 5
668 #define I2O_RTN_MALLOC_ERROR 6
669 #define I2O_RTN_ADPTR_NOT_REGISTERED 7
670 #define I2O_RTN_MSG_REPLY_TIMEOUT 8
671 #define I2O_RTN_NO_STATUS 9
672 #define I2O_RTN_NO_FIRM_VER 10
673 #define I2O_RTN_NO_LINK_SPEED 11
675 /* Reply message status defines for all messages */
677 #define I2O_REPLY_STATUS_SUCCESS 0x00
678 #define I2O_REPLY_STATUS_ABORT_DIRTY 0x01
679 #define I2O_REPLY_STATUS_ABORT_NO_DATA_TRANSFER 0x02
680 #define I2O_REPLY_STATUS_ABORT_PARTIAL_TRANSFER 0x03
681 #define I2O_REPLY_STATUS_ERROR_DIRTY 0x04
682 #define I2O_REPLY_STATUS_ERROR_NO_DATA_TRANSFER 0x05
683 #define I2O_REPLY_STATUS_ERROR_PARTIAL_TRANSFER 0x06
684 #define I2O_REPLY_STATUS_PROCESS_ABORT_DIRTY 0x08
685 #define I2O_REPLY_STATUS_PROCESS_ABORT_NO_DATA_TRANSFER 0x09
686 #define I2O_REPLY_STATUS_PROCESS_ABORT_PARTIAL_TRANSFER 0x0A
687 #define I2O_REPLY_STATUS_TRANSACTION_ERROR 0x0B
688 #define I2O_REPLY_STATUS_PROGRESS_REPORT 0x80
690 /* Status codes and Error Information for Parameter functions */
692 #define I2O_PARAMS_STATUS_SUCCESS 0x00
693 #define I2O_PARAMS_STATUS_BAD_KEY_ABORT 0x01
694 #define I2O_PARAMS_STATUS_BAD_KEY_CONTINUE 0x02
695 #define I2O_PARAMS_STATUS_BUFFER_FULL 0x03
696 #define I2O_PARAMS_STATUS_BUFFER_TOO_SMALL 0x04
697 #define I2O_PARAMS_STATUS_FIELD_UNREADABLE 0x05
698 #define I2O_PARAMS_STATUS_FIELD_UNWRITEABLE 0x06
699 #define I2O_PARAMS_STATUS_INSUFFICIENT_FIELDS 0x07
700 #define I2O_PARAMS_STATUS_INVALID_GROUP_ID 0x08
701 #define I2O_PARAMS_STATUS_INVALID_OPERATION 0x09
702 #define I2O_PARAMS_STATUS_NO_KEY_FIELD 0x0A
703 #define I2O_PARAMS_STATUS_NO_SUCH_FIELD 0x0B
704 #define I2O_PARAMS_STATUS_NON_DYNAMIC_GROUP 0x0C
705 #define I2O_PARAMS_STATUS_OPERATION_ERROR 0x0D
706 #define I2O_PARAMS_STATUS_SCALAR_ERROR 0x0E
707 #define I2O_PARAMS_STATUS_TABLE_ERROR 0x0F
708 #define I2O_PARAMS_STATUS_WRONG_GROUP_TYPE 0x10
710 /* DetailedStatusCode defines for Executive, DDM, Util and Transaction error
711 * messages: Table 3-2 Detailed Status Codes.*/
713 #define I2O_DSC_SUCCESS 0x0000
714 #define I2O_DSC_BAD_KEY 0x0002
715 #define I2O_DSC_TCL_ERROR 0x0003
716 #define I2O_DSC_REPLY_BUFFER_FULL 0x0004
717 #define I2O_DSC_NO_SUCH_PAGE 0x0005
718 #define I2O_DSC_INSUFFICIENT_RESOURCE_SOFT 0x0006
719 #define I2O_DSC_INSUFFICIENT_RESOURCE_HARD 0x0007
720 #define I2O_DSC_CHAIN_BUFFER_TOO_LARGE 0x0009
721 #define I2O_DSC_UNSUPPORTED_FUNCTION 0x000A
722 #define I2O_DSC_DEVICE_LOCKED 0x000B
723 #define I2O_DSC_DEVICE_RESET 0x000C
724 #define I2O_DSC_INAPPROPRIATE_FUNCTION 0x000D
725 #define I2O_DSC_INVALID_INITIATOR_ADDRESS 0x000E
726 #define I2O_DSC_INVALID_MESSAGE_FLAGS 0x000F
727 #define I2O_DSC_INVALID_OFFSET 0x0010
728 #define I2O_DSC_INVALID_PARAMETER 0x0011
729 #define I2O_DSC_INVALID_REQUEST 0x0012
730 #define I2O_DSC_INVALID_TARGET_ADDRESS 0x0013
731 #define I2O_DSC_MESSAGE_TOO_LARGE 0x0014
732 #define I2O_DSC_MESSAGE_TOO_SMALL 0x0015
733 #define I2O_DSC_MISSING_PARAMETER 0x0016
734 #define I2O_DSC_TIMEOUT 0x0017
735 #define I2O_DSC_UNKNOWN_ERROR 0x0018
736 #define I2O_DSC_UNKNOWN_FUNCTION 0x0019
737 #define I2O_DSC_UNSUPPORTED_VERSION 0x001A
738 #define I2O_DSC_DEVICE_BUSY 0x001B
739 #define I2O_DSC_DEVICE_NOT_AVAILABLE 0x001C
741 /* Device Claim Types */
742 #define I2O_CLAIM_PRIMARY 0x01000000
743 #define I2O_CLAIM_MANAGEMENT 0x02000000
744 #define I2O_CLAIM_AUTHORIZED 0x03000000
745 #define I2O_CLAIM_SECONDARY 0x04000000
747 /* Message header defines for VersionOffset */
748 #define I2OVER15 0x0001
749 #define I2OVER20 0x0002
750 /* Default is 1.5, FIXME: Need support for both 1.5 and 2.0 */
751 #define I2OVERSION I2OVER15
752 #define SGL_OFFSET_0 I2OVERSION
753 #define SGL_OFFSET_4 (0x0040 | I2OVERSION)
754 #define SGL_OFFSET_5 (0x0050 | I2OVERSION)
755 #define SGL_OFFSET_6 (0x0060 | I2OVERSION)
756 #define SGL_OFFSET_7 (0x0070 | I2OVERSION)
757 #define SGL_OFFSET_8 (0x0080 | I2OVERSION)
758 #define SGL_OFFSET_9 (0x0090 | I2OVERSION)
759 #define SGL_OFFSET_10 (0x00A0 | I2OVERSION)
761 #define TRL_OFFSET_5 (0x0050 | I2OVERSION)
762 #define TRL_OFFSET_6 (0x0060 | I2OVERSION)
764 /* msg header defines for MsgFlags */
765 #define MSG_STATIC 0x0100
766 #define MSG_64BIT_CNTXT 0x0200
767 #define MSG_MULTI_TRANS 0x1000
768 #define MSG_FAIL 0x2000
769 #define MSG_LAST 0x4000
770 #define MSG_REPLY 0x8000
772 /* minimum size msg */
773 #define THREE_WORD_MSG_SIZE 0x00030000
774 #define FOUR_WORD_MSG_SIZE 0x00040000
775 #define FIVE_WORD_MSG_SIZE 0x00050000
776 #define SIX_WORD_MSG_SIZE 0x00060000
777 #define SEVEN_WORD_MSG_SIZE 0x00070000
778 #define EIGHT_WORD_MSG_SIZE 0x00080000
779 #define NINE_WORD_MSG_SIZE 0x00090000
780 #define TEN_WORD_MSG_SIZE 0x000A0000
781 #define I2O_MESSAGE_SIZE(x) ((x)<<16)
784 /* Special TID Assignments */
786 #define ADAPTER_TID 0
789 #define MSG_FRAME_SIZE 128
790 #define NMBR_MSG_FRAMES 128
792 #define MSG_POOL_SIZE 16384
794 #define I2O_POST_WAIT_OK 0
795 #define I2O_POST_WAIT_TIMEOUT -ETIMEDOUT
797 #endif /* __KERNEL__ */