00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012 #ifndef _ICCP_H_
00013 #define _ICCP_H_
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039 #include "iccp2k.h"
00040
00041 typedef unsigned int uint ;
00042 typedef unsigned short ushort ;
00043 typedef unsigned char uchar ;
00044 typedef char byte ;
00045
00046 typedef unsigned char UINT8;
00047 typedef unsigned short UINT16;
00048 typedef unsigned int UINT32;
00049 typedef unsigned long long int UINT64;
00050
00051 #if USE_64BITS == 1
00052 typedef unsigned long long int UINTPTR;
00053 #else
00054 typedef unsigned int UINTPTR;
00055 #endif
00056
00057 #ifndef vxworks
00058 #include <stdlib.h>
00059 #endif
00060
00061 #define IC_MSG_LEN 120
00062
00063 #include "cmds.h"
00064 #include "tasks.h"
00065 #include "status.h"
00066
00067
00068
00069 #define L3_DEFINES 0
00070 #define L3_GL3_ONLY 1
00071 #define L3_GL3_SL3 2
00072 #define L3_GL3_COMPRESSED 3
00073 #define L3_GL3_SL3_COMPRESSED 4
00074
00075
00076
00077 #define MEZZANINE_DEFINES 0
00078 #define RAW 1
00079 #define RAW_COMPRESSED 2
00080 #define ZERO_SUPPRESSED 3
00081 #define ZERO_SUPPRESSED_COMPRESSED 4
00082
00083
00084
00085 #define SB_TOKEN_UNKNOWN 0
00086 #define SB_CLUSTER_FINDER_STARTED 1
00087 #define SB_CLUSTER_FINDER_DONE 2
00088 #define SB_L3_SUMMARY_REPORTED 3
00089 #define SB_FORMATTING_STARTED 4
00090 #define SB_FORMATTING_DONE 5
00091 #define SB_EVENT_CANCELLED_BY_TRG 6
00092
00093
00094
00095 #define EVB_TOKEN_UNKNOWN 0
00096 #define EVB_FORMATTING 1
00097 #define EVB_BUILDING 2
00098 #define EVB_TAPING 3
00099 #define EVB_NET_FEED 4
00100 #define EVB_EVENT_CANCELLED_BY_TRG 5
00101
00102
00103
00104 #define GL3_TOKEN_UNKNOWN 0
00105 #define GL3_WAITING_SB_ANNOUNCE 1
00106 #define GL3_BUILDING_SL3 2
00107 #define GL3_PROCESSING 3
00108 #define GL3_REJECT 4
00109 #define GL3_PASSED_TO_EVB 5
00110 #define GL3_EVENT_CANCELLED_BY_TRG 6
00111
00112
00113
00114
00115 #define ZERO_DOMAIN 0
00116 #define ETHERNET_DOMAIN 1
00117 #define VME_DOMAIN 2
00118 #define MYRI_DOMAIN 3
00119
00120 #define LOCAL_DOMAIN 4
00121 #define EVB_LOCAL_DOMAIN 4
00122
00123 #define SB_LOCAL_DOMAIN 5
00124 #define MZ_LOCAL_DOMAIN 6
00125 #define SECTOR_DOMAIN 7
00126 #define SCI_SL3_SB_DOMAIN 8
00127 #define SCI_ICCP_DOMAIN 9
00128
00129 #define ETHDOOR_DOMAIN 10
00130
00131
00132 #define SCI_TRANSPORT 0xF
00133 #define LOCAL_TRANSPORT 0
00134
00135
00136
00137
00138
00139
00140
00141
00142
00143
00144
00145 struct ic_cmd_ping { uint dummy;};
00146 struct ic_cmd_response { uint transaction ;};
00147 struct ic_cmd_ack { uint transaction ;};
00148 struct ic_cmd_cancel { uint transaction ;};
00149 struct ic_cmd_req_stat { uint dummy ;};
00150 struct ic_cmd_release_token { uint dummy ; };
00151 struct ic_cmd_confirm_release{ uint dummy ;};
00152 struct ic_cmd_confirm_formatted_data{ uint dummy ;};
00153 struct ic_confirm_send { uint dummy ; };
00154
00155 struct ic_evb_stat { uint dummy ;};
00156 struct ic_evb_format_data{ uchar cs ; uchar res ; ushort format ;} ;
00157 struct ic_evb_send_data
00158 {
00159 uint haddr;
00160 uint laddr;
00161 uint det_evt_id;
00162 uint evb_evt_id;
00163 } ;
00164 struct ic_det_announce_data {
00165 uint words;
00166 uint evt_id;
00167 uint task;
00168 };
00169 struct ic_eth_announce {
00170 uint words;
00171 uint ptr;
00172 };
00173
00174 struct ic_rts_write_counters {
00175 int readoutPeriod;
00176 };
00177 struct ic_evb_tape_request {
00178 int run;
00179 int size;
00180 int offset;
00181 int event;
00182 int type;
00183 int token;
00184 int evp_type;
00185 int n_evp_type;
00186 int buffer;
00187 int flags;
00188 };
00189 struct ic_evbx_tape_request {
00190 int size;
00191 int token;
00192 int buffer;
00193 int flags;
00194 };
00195 struct ic_spool_write_event {
00196 int offset;
00197 int size;
00198 int disk;
00199 char name[20];
00200 int run;
00201 int streamIdx;
00202 int fileIdx;
00203 int buffer;
00204 int stream;
00205 };
00206
00207 struct ic_spool_event_written {
00208 int offset;
00209 int size;
00210 int buffer;
00211 int stream;
00212 int disk;
00213 };
00214
00215 struct ic_evb_announce_memcpy2 {
00216 uint buff;
00217 uint words;
00218 uint node;
00219 };
00220
00221
00222
00223 struct ic_evbx_spool_write_event {
00224 int size;
00225 int disk;
00226 char name[20];
00227 int run;
00228 int streamIdx;
00229 int fileIdx;
00230 int eventIdx;
00231 int stream;
00232 };
00233
00234 struct ic_evbx_spool_event_written {
00235 int size;
00236 int eventIdx;
00237 int stream;
00238 int disk;
00239 };
00240
00241
00242
00243 struct ic_taper_done {
00244 int run;
00245 int size;
00246 int offset;
00247 int buffer;
00248 };
00249
00250 struct ic_spool_write_list { int listIdx; };
00251
00252 struct ic_spool_list_written { int listIdx; };
00253
00254
00255 struct ic_daq_run_start{ uint dummy ;} ;
00256 struct ic_daq_run_stop
00257 {
00258 int run_number;
00259 int num_files;
00260 int num_events;
00261 int junk;
00262 } ;
00263 struct ic_daq_run_pause{ uint run_number ;} ;
00264 struct ic_daq_run_resume
00265 {
00266 uint run_number;
00267 uint num_triggers;
00268 } ;
00269 struct ic_daq_send_config { uint port; uint handler_id; };
00270 struct ic_daq_flush_tokens { uint run_number; };
00271 struct ic_reboot { uint system; };
00272 struct ic_drc_run_start
00273 {
00274 uint run_number;
00275 uint num_triggers;
00276 };
00277 struct ic_drc_run_stop
00278 {
00279 uint run_number;
00280 uint junk;
00281 };
00282 struct ic_drc_run_pause
00283 {
00284 uint run_number;
00285 };
00286 struct ic_drc_run_resume
00287 {
00288 uint run_number;
00289 uint num_triggers;
00290 };
00291 struct ic_drc_get_config
00292 {
00293 uint dummy;
00294 };
00295 struct ic_drc_set_config
00296 {
00297 uint dummy;
00298 };
00299 struct ic_drc_send_config
00300 {
00301 uint dummy;
00302 };
00303 struct ic_drc_flush_tokens
00304 {
00305 uint run_number;
00306 uint type;
00307 };
00308 struct ic_mz_emul_fiber
00309 {
00310 uint ntriggers;
00311 };
00312 struct ic_drc_query_tokens
00313 {
00314 uint num_tokens;
00315 uint state;
00316 uint rb[12];
00317 };
00318
00319
00320
00321 struct ic_gl3_build
00322 {
00323 uint bxm ; uint bxl ;
00324 ushort trg_cmd ; ushort trg_word ;
00325 ushort res ; unsigned trg_type :4 ; unsigned trg_token :12 ;
00326 } ;
00327
00328 struct ic_gb_build
00329 {
00330 ushort gl3Node ;
00331 uchar accept;
00332 uchar build ;
00333 uint eventDesc[10] ;
00334 uint L3summ[4] ;
00335 uint L2summary[2];
00336 uint L1summary[2];
00337 uint rtsDetMask ;
00338 uint eventNumber;
00339 uint sec;
00340 uint usec;
00341 uint flags;
00342 } ;
00343
00344
00345 struct ic_gl3_stat { uint dummy ;};
00346 struct ic_gl3_announce_data
00347 {
00348 uint size_L3_header ;
00349 uint size_TRG_data ;
00350 uint size_L3_data[11] ;
00351 };
00352
00353
00354 struct ic_sb_announce_sl3{ uint size_of_header ; uint size_of_clusters ; uint size_of_tracks ; uint size_of_debug ; } ;
00355 struct ic_sb_announce_formatted_data
00356 {
00357 uint size_header ;
00358 uint size_data[12] ;
00359 } ;
00360 struct ic_rcv_stat{ uchar res ; uchar mz_A ;uchar mz_B ;uchar mz_C ;};
00361 struct ic_sb_stat { ic_rcv_stat rcv[12] ; } ;
00362
00363 struct ic_sb_confirm_sl3 { uint dummy ;};
00364
00365
00366
00367
00368
00369
00370
00371
00372
00373
00374 struct ic_bb_send_data {
00375 uint buffer;
00376 uint addr_hi;
00377 uint addr_lo;
00378 };
00379
00380
00381
00382
00383
00384
00385
00386
00387
00388
00389
00390
00391
00392
00393
00394
00395
00396
00397
00398
00399
00400
00401
00402
00403
00404
00405
00406
00407
00408
00409
00410
00411
00412
00413
00414
00415
00416
00417
00418
00419
00420
00421
00422
00423
00424
00425
00426
00427 struct ic_evp_req_event {
00428 int type;
00429 };
00430 struct ic_evp_announce_event {
00431 int size;
00432 int type;
00433 int run;
00434 int evts_of_type;
00435 int evts;
00436 int addr;
00437 };
00438 struct ic_evp_send_event {
00439 int addr_hi;
00440 int addr_lo;
00441 };
00442 struct ic_evp_confirm_event {
00443 int dummy;
00444 };
00445 struct ic_evp_event_done {
00446 int dummy;
00447 };
00448
00449
00450
00451
00452
00453
00454
00455
00456
00457
00458 struct ic_rcf_writer_flush {
00459 uint dummy;
00460 };
00461
00462
00463
00464 struct ic_vx_request_file {
00465 uint direction;
00466 uint addr_hi;
00467 uint addr_lo;
00468 uint size;
00469 char filename[92];
00470 };
00471
00472
00473
00474
00475
00476
00477
00478
00479 struct ic_rcf_get_file
00480 {
00481 int dummy;
00482 };
00483 struct ic_rcf_write_file
00484 {
00485 int disk;
00486 char filename[100];
00487 };
00488 struct ic_rcf_release_file
00489 {
00490 int disk;
00491 char filename[100];
00492 };
00493 struct ic_spool_get_disk
00494 {
00495 int run;
00496 int seq;
00497 };
00498 struct ic_spool_use_disk
00499 {
00500 int disk;
00501 int throttleRate;
00502 };
00503 struct ic_spool_free_disk
00504 {
00505 int disk;
00506 int run;
00507 int seq;
00508 };
00509
00510
00511 union ic_load
00512 {
00513 uint dword[27] ;
00514 ushort word[54] ;
00515 uchar byte[108] ;
00516 #if !(defined(NOT_DAQ) || defined(alpha))
00517 ic_cmd_ping cmd_ping ;
00518 ic_cmd_response cmd_rsp ;
00519 ic_cmd_ack cmd_ack ;
00520 ic_cmd_cancel cmd_cancel ;
00521 ic_cmd_req_stat cmd_req_stat ;
00522 ic_cmd_release_token cmd_release_token;
00523 ic_cmd_confirm_release cmd_confirm_release ;
00524 ic_cmd_confirm_formatted_data cmd_confirm_data ;
00525 ic_confirm_send confirm_send;
00526
00527 ic_evb_stat evb_stat;
00528 ic_evb_format_data evb_format ;
00529 ic_evb_send_data evb_send_data;
00530 ic_det_announce_data det_announce_data;
00531
00532 ic_evb_announce_memcpy2 evb_announce_memcpy2;
00533 ic_rts_write_counters rts_write_counters ;
00534
00535 ic_evb_tape_request evb_tape_request ;
00536 ic_spool_event_written spool_event_written ;
00537 ic_spool_write_event spool_write_event;
00538
00539 ic_taper_done taper_done ;
00540
00541 ic_evbx_tape_request evbx_tape_request ;
00542 ic_evbx_spool_event_written evbx_spool_event_written ;
00543 ic_evbx_spool_write_event evbx_spool_write_event;
00544
00545
00546 ic_daq_run_start daq_run_start ;
00547 ic_daq_run_stop daq_run_stop ;
00548 ic_daq_run_pause daq_run_pause ;
00549 ic_daq_run_resume daq_run_resume ;
00550 ic_daq_send_config daq_send_config ;
00551 ic_daq_flush_tokens daq_flush_tokens;
00552
00553 ic_reboot reboot ;
00554 ic_drc_run_start drc_run_start ;
00555 ic_drc_run_stop drc_run_stop ;
00556 ic_drc_run_pause drc_run_pause ;
00557 ic_drc_run_resume drc_run_resume ;
00558 ic_drc_get_config drc_get_config ;
00559 ic_drc_set_config drc_set_config ;
00560 ic_drc_send_config drc_send_config ;
00561 ic_drc_flush_tokens drc_flush_tokens ;
00562 ic_drc_query_tokens drc_query_tokens ;
00563 ic_mz_emul_fiber mz_emul_fiber ;
00564
00565 ic_gb_build gb_build ;
00566
00567 ic_gl3_build gl3_build ;
00568
00569
00570
00571 ic_gl3_stat gl3_stat ;
00572 ic_gl3_announce_data gl3_announce_data ;
00573
00574
00575 ic_sb_announce_sl3 sb_announce_sl3 ;
00576 ic_sb_announce_formatted_data sb_announce_data ;
00577 ic_sb_stat sb_stat ;
00578 ic_sb_confirm_sl3 sb_confirm_sl3 ;
00579
00580
00581 ic_bb_send_data bb_send_data;
00582
00583
00584 ic_rcf_writer_flush rcf_writer_flush;
00585
00586
00587
00588
00589
00590
00591
00592
00593
00594
00595 ic_evp_req_event evp_req_event;
00596 ic_evp_announce_event evp_announce_event;
00597 ic_evp_send_event evp_send_event;
00598 ic_evp_confirm_event evp_confirm_event;
00599 ic_evp_event_done evp_event_done;
00600
00601 ic_vx_request_file vx_request_file;
00602
00603 ic_spool_list_written spool_list_written;
00604 ic_spool_write_list spool_write_list;
00605
00606 ic_rcf_get_file rcf_get_file;
00607 ic_rcf_write_file rcf_write_file;
00608 ic_rcf_release_file rcf_release_file;
00609 ic_spool_get_disk spool_get_disk;
00610 ic_spool_use_disk spool_use_disk;
00611 ic_spool_free_disk spool_free_disk;
00612
00613 ic_eth_announce eth_announce;
00614
00615 #endif
00616
00617
00618 };
00619
00620 #include "iccpHeader.h"
00621 struct ic_msg
00622 {
00623 ic_msg_head head ;
00624 ic_load ld ;
00625 } ;
00626
00627
00628 #include "rtsSystems.h"
00629
00630 #endif