00001 #ifndef cramdef_h 00002 #define cramdef_h 00003 00004 #define CRAM_M_IN_USE 0x1 00005 #define CRAM_M_DER 0x2 00006 #define CRAM_M_CMD_VAL 0x3FFFFFFF 00007 #define CRAM_M_CMD_BRIDGE 0x40000000 00008 #define CRAM_M_CMD_WRITE 0x80000000 00009 #define CRAM_M_MBX_DONE 0x1 00010 #define CRAM_M_MBX_ERROR 0x2 00011 #define CRAM_K_LENGTH 128 00012 #define CRAM_S_CRAMDEF 128 00013 00014 #define CRAMCMD_K_RDQUAD32 1 00015 #define CRAMCMD_K_RDLONG32 2 00016 #define CRAMCMD_K_RDWORD32 3 00017 #define CRAMCMD_K_RDBYTE32 4 00018 #define CRAMCMD_K_WTQUAD32 5 00019 #define CRAMCMD_K_WTLONG32 6 00020 #define CRAMCMD_K_WTWORD32 7 00021 #define CRAMCMD_K_WTBYTE32 8 00022 #define CRAMCMD_K_RDQUAD64 9 00023 #define CRAMCMD_K_RDLONG64 10 00024 #define CRAMCMD_K_RDWORD64 11 00025 #define CRAMCMD_K_RDBYTE64 12 00026 #define CRAMCMD_K_WTQUAD64 13 00027 #define CRAMCMD_K_WTLONG64 14 00028 #define CRAMCMD_K_WTWORD64 15 00029 #define CRAMCMD_K_WTBYTE64 16 00030 #define CRAMCMD_K_RDTRIBYTE32 17 00031 #define CRAMCMD_K_WTTRIBYTE32 18 00032 #define CRAMCMD_K_RDTRIBYTE64 19 00033 #define CRAMCMD_K_WTTRIBYTE64 20 00034 #define CRAMCMD_K_MININDEX 1 00035 #define CRAMCMD_K_MAXINDEX 20 00036 00037 #define HW_CRAM_M_MBX_DONE 0x1 00038 #define HW_CRAM_M_MBX_ERROR 0x2 00039 00040 #define HW_CRAM_K_LENGTH 64 00041 #define HW_CRAM_S_HW_CRAMDEF 64 00042 00043 #define CMDTABLEHEADER_K_LENGTH 12 00044 00045 #define CMDTABLE_K_LENGTH 96 00046 #define CMDTABLE_S_CMDTABLEDEF 96 00047 00048 struct _cram { 00049 struct _cram *cram_l_flink; 00050 struct _cram *cram_l_blink; 00051 unsigned short int cram_w_size; 00052 unsigned char cram_b_type; 00053 unsigned char cram_b_subtype; 00054 void *cram_l_mbpr; 00055 unsigned long long cram_q_hw_mbx; 00056 unsigned long long cram_q_queue_time; 00057 unsigned long long cram_q_wait_time; 00058 unsigned int cram_l_driver; 00059 struct _idb *cram_l_idb; 00060 struct _ucb *cram_l_ucb; 00061 union { 00062 union { 00063 unsigned int cram_l_cram_flags; 00064 struct { 00065 unsigned cram_v_in_use : 1; 00066 unsigned cram_v_der : 1; 00067 unsigned cram_v_fill_6_ : 6; 00068 }; 00069 }; 00070 }; 00071 struct _adp *cram_l_adp; 00072 char cram_b_filler1 [4]; 00073 00074 union { 00075 unsigned int cram_l_command; 00076 union { 00077 unsigned int cram_l_cmd_bits; 00078 struct { 00079 unsigned cram_v_cmd_val : 30; 00080 unsigned cram_v_cmd_bridge : 1; 00081 unsigned cram_v_cmd_write : 1; 00082 }; 00083 }; 00084 }; 00085 unsigned char cram_b_byte_mask; 00086 unsigned char cram_b_filler2; 00087 unsigned char cram_b_hose; 00088 unsigned char cram_b_filler3; 00089 unsigned long long cram_q_rbadr; 00090 union { 00091 unsigned long long cram_q_wdata; 00092 unsigned int cram_l_wdata; 00093 unsigned short int cram_w_wdata; 00094 unsigned char cram_b_wdata; 00095 }; 00096 unsigned long long cram_q_filler4; 00097 union { 00098 unsigned long long cram_q_rdata; 00099 unsigned int cram_l_rdata; 00100 unsigned short int cram_w_rdata; 00101 unsigned char cram_b_rdata; 00102 }; 00103 union { 00104 union { 00105 unsigned short int cram_w_mbx_flags; 00106 struct { 00107 unsigned cram_v_mbx_done : 1; 00108 unsigned cram_v_mbx_error : 1; 00109 unsigned cram_v_fill_7_ : 6; 00110 }; 00111 }; 00112 }; 00113 unsigned short int cram_w_error_bits [3]; 00114 unsigned long long cram_q_filler5 [2]; 00115 }; 00116 00117 struct _hw_cram { 00118 unsigned int hw_cram_l_command; 00119 unsigned char hw_cram_b_byte_mask; 00120 unsigned char hw_cram_b_filler6; 00121 unsigned char hw_cram_b_hose; 00122 unsigned char hw_cram_b_filler7; 00123 unsigned long long hw_cram_q_rbadr; 00124 unsigned long long hw_cram_q_wdata; 00125 unsigned long long hw_cram_q_filler8; 00126 unsigned long long hw_cram_q_rdata; 00127 union { 00128 union { 00129 unsigned short int hw_cram_w_mbx_flags; 00130 struct { 00131 unsigned hw_cram_v_mbx_done : 1; 00132 unsigned hw_cram_v_mbx_error : 1; 00133 unsigned hw_cram_v_fill_10_ : 6; 00134 }; 00135 }; 00136 }; 00137 unsigned short int hw_cram_w_error_bits [3]; 00138 unsigned long long hw_cram_q_filler9 [2]; 00139 }; 00140 00141 struct _cmdtable { 00142 struct _adp *cmdtable_ps_adp; 00143 unsigned int cmdtable_l_bus_type; 00144 unsigned short int cmdtable_w_size; 00145 unsigned char cmdtable_b_type; 00146 unsigned char cmdtable_b_subtype; 00147 // char cmdtable_l_cmd_vector[]; 00148 #define cmdtable_l_cmd_vector cmdtable$r_cmdarray 00149 struct { 00150 unsigned int cramcmd_l_fill2; 00151 unsigned int cramcmd_l_rdquad32; 00152 unsigned int cramcmd_l_rdlong32; 00153 unsigned int cramcmd_l_rdword32; 00154 unsigned int cramcmd_l_rdbyte32; 00155 unsigned int cramcmd_l_wtquad32; 00156 unsigned int cramcmd_l_wtlong32; 00157 unsigned int cramcmd_l_wtword32; 00158 unsigned int cramcmd_l_wtbyte32; 00159 unsigned int cramcmd_l_rdquad64; 00160 unsigned int cramcmd_l_rdlong64; 00161 unsigned int cramcmd_l_rdword64; 00162 unsigned int cramcmd_l_rdbyte64; 00163 unsigned int cramcmd_l_wtquad64; 00164 unsigned int cramcmd_l_wtlong64; 00165 unsigned int cramcmd_l_wtword64; 00166 unsigned int cramcmd_l_wtbyte64; 00167 unsigned int cramcmd_l_rdtribyte32; 00168 unsigned int cramcmd_l_wttribyte32; 00169 unsigned int cramcmd_l_rdtribyte64; 00170 unsigned int cramcmd_l_wttribyte64; 00171 } cmdtable_r_cmdarray;; 00172 }; 00173 00174 #endif 00175 00176