ARPDAS_QNX6 1.0
|
00001 #ifndef SERUSB_H_INCLUDED 00002 #define SERUSB_H_INCLUDED 00003 #include "subbusd_int.h" 00004 00005 /** 00006 SB_SERUSB_MAX_REQUEST is the maximum allowable string 00007 for a serialized command or response over the USB. 00008 The longest request will be for the multi-read 00009 command, and we may see fit to extend this size. 00010 The multi-read response may also be even longer, but 00011 we do not necessarily have to allocate buffer space for 00012 the entire response, since we can process it as it comes 00013 in. 00014 */ 00015 #define SB_SERUSB_MAX_REQUEST 256 00016 00017 typedef struct { 00018 int type; 00019 int status; 00020 int rcvid; 00021 unsigned short n_reads; 00022 char request[SB_SERUSB_MAX_REQUEST]; 00023 } sbd_request_t; 00024 00025 #define SBDR_TYPE_INTERNAL 0 00026 #define SBDR_TYPE_CLIENT 1 00027 #define SBDR_TYPE_MAX 1 00028 #define SBDR_STATUS_QUEUED 0 00029 #define SBDR_STATUS_SENT 1 00030 00031 /* SUBBUSD_MAX_REQUESTS is the size of the request queue, 00032 so it determines the number of simultaneous requests 00033 we can handle. Current usage suggests we will have 00034 a small number of programs accessing the subbus 00035 (col,srvr,idxr,dccc,ana104,card,digital) so 20 is 00036 not an unreasonable upper bound */ 00037 #define SUBBUSD_MAX_REQUESTS 20 00038 00039 extern int int_attach(int rcvid, subbusd_req_t *req, char *sreq); 00040 extern int int_detach(int rcvid, subbusd_req_t *req, char *sreq); 00041 00042 #endif