6 #define MPTSAS_NUM_PORTS 8
7 #define MPTSAS_MAX_FRAMES 2048 /* Firmware limit at 65535 */
9 #define MPTSAS_REQUEST_QUEUE_DEPTH 128
10 #define MPTSAS_REPLY_QUEUE_DEPTH 128
12 #define MPTSAS_MAXIMUM_CHAIN_DEPTH 0x22
14 typedef struct MPTSASState MPTSASState
;
15 typedef struct MPTSASRequest MPTSASRequest
;
36 /* Doorbell register */
39 uint8_t doorbell_state
;
41 /* Buffer for requests that are sent through the doorbell register. */
42 uint32_t doorbell_msg
[256];
46 uint16_t doorbell_reply
[256];
47 int doorbell_reply_idx
;
48 int doorbell_reply_size
;
51 uint8_t diagnostic_idx
;
57 uint32_t request_post
[MPTSAS_REQUEST_QUEUE_DEPTH
+ 1];
58 uint16_t request_post_head
;
59 uint16_t request_post_tail
;
61 uint32_t reply_post
[MPTSAS_REPLY_QUEUE_DEPTH
+ 1];
62 uint16_t reply_post_head
;
63 uint16_t reply_post_tail
;
65 uint32_t reply_free
[MPTSAS_REPLY_QUEUE_DEPTH
+ 1];
66 uint16_t reply_free_head
;
67 uint16_t reply_free_tail
;
70 hwaddr host_mfa_high_addr
;
71 hwaddr sense_buffer_high_addr
;
74 uint16_t reply_frame_size
;
77 QTAILQ_HEAD(, MPTSASRequest
) pending
;
80 void mptsas_fix_scsi_io_endianness(MPIMsgSCSIIORequest
*req
);
81 void mptsas_fix_scsi_io_reply_endianness(MPIMsgSCSIIOReply
*reply
);
82 void mptsas_fix_scsi_task_mgmt_endianness(MPIMsgSCSITaskMgmt
*req
);
83 void mptsas_fix_scsi_task_mgmt_reply_endianness(MPIMsgSCSITaskMgmtReply
*reply
);
84 void mptsas_fix_ioc_init_endianness(MPIMsgIOCInit
*req
);
85 void mptsas_fix_ioc_init_reply_endianness(MPIMsgIOCInitReply
*reply
);
86 void mptsas_fix_ioc_facts_endianness(MPIMsgIOCFacts
*req
);
87 void mptsas_fix_ioc_facts_reply_endianness(MPIMsgIOCFactsReply
*reply
);
88 void mptsas_fix_config_endianness(MPIMsgConfig
*req
);
89 void mptsas_fix_config_reply_endianness(MPIMsgConfigReply
*reply
);
90 void mptsas_fix_port_facts_endianness(MPIMsgPortFacts
*req
);
91 void mptsas_fix_port_facts_reply_endianness(MPIMsgPortFactsReply
*reply
);
92 void mptsas_fix_port_enable_endianness(MPIMsgPortEnable
*req
);
93 void mptsas_fix_port_enable_reply_endianness(MPIMsgPortEnableReply
*reply
);
94 void mptsas_fix_event_notification_endianness(MPIMsgEventNotify
*req
);
95 void mptsas_fix_event_notification_reply_endianness(MPIMsgEventNotifyReply
*reply
);
97 void mptsas_reply(MPTSASState
*s
, MPIDefaultReply
*reply
);
99 void mptsas_process_config(MPTSASState
*s
, MPIMsgConfig
*req
);
101 #endif /* MPTSAS_H */