home *** CD-ROM | disk | FTP | other *** search
/ Garbo / Garbo.cdr / mac / source / kboot22.zoo / kboot22.2 / cmdidx.h < prev    next >
C/C++ Source or Header  |  1991-02-22  |  9KB  |  296 lines

  1. /*
  2.  * Copyright (c) 1985, 1986 Kinetics, Inc.
  3.  *
  4.  * $Header: /usr/fp/include/fp/RCS/cmdidx.h,v 1.6 86/02/20 19:54:20 root Exp $
  5.  *
  6.  *    Indices into the jump table for PROM routines.
  7.  *    Also, the command numbers for the routines when invoked
  8.  *    from Kinetics LAP type command packets.
  9.  *    The values of these constants are actually determined by
  10.  *    their position in the jump table in .../proms/kfpx.s.
  11.  *    See cmdmacro.h for the actual calls through the jump table.
  12.  *    After the indices are defined, structure definitions for
  13.  *    each call's pointer parameter are also defined..
  14.  */
  15.  
  16. #define    X_VERSION     0
  17. #define    X_EXECUTE     1
  18. #define    X_ACK         2
  19. #define    X_REBOOT     3
  20. #define    X_SET68         4
  21. #define    X_SET86         5
  22. #define    X_ATINIT     6
  23. #define    X_ATWRITE     7
  24. #define    X_WAIT         8
  25. #define    X_WHEREIS     9
  26. #define    X_GETMEM    10
  27. #define    X_PROTECT    11
  28. #define    X_COPYMEM    12
  29. #define    X_CLRMEM    13
  30. #define    X_PROMRAM    14
  31. #define    X_RESET        15
  32. #define    X_USER0        16
  33. #define    X_USER1        17
  34. #define    X_USER2        18
  35. #define    X_USER3        19
  36. #define    X_USER4        20
  37. #define    X_USER5        21
  38. #define    X_USER6        22
  39. #define    X_USER7        23
  40. #define    X_BUFINIT    24
  41. #define    X_BUFGET    25
  42. #define    X_BUFFREE    26
  43. #define    X_BUFENQ    27
  44. #define    X_BUFDEQ    28
  45. #define    X_ERR        29
  46. #define    X_IDLE        30
  47. #define    X_KLAP        31
  48. #define    X_WHO        32
  49. #define    X_CA86        33
  50. #define    X_RES86        34
  51. #define    X_CLRINT    35
  52. #define    X_RCSID        36
  53. #define    X_EXPROM    37
  54. #define    X_INIPROM    38
  55. #define    X_RES8530    39
  56. #define    X_DMTSERV    40
  57. #define    X_SREC        41
  58. #define    X_SPL        42
  59. #define    X_NOTIMP    43
  60.  
  61. /* structures for the above commands */
  62.  
  63. /* X_VERSION */
  64. struct fp_version {
  65.     short    fpv_entries;        /* number of valid entries in jump table */
  66.     short    fpv_version;        /* version of the prom code */
  67.     long    fpv_model;        /* "KFPS", "KFPQ", or "KFPM" */
  68. };
  69.  
  70. /* X_EXECUTE */
  71. /* no parameters */
  72.  
  73. /* X_ACK */
  74. /* no parameters */
  75.  
  76. /* X_REBOOT */
  77. /* no parameters */
  78.  
  79. /* X_SET68 */
  80. /* no parameters */
  81.  
  82. /* X_SET86 */
  83. /* this structure is really defined in ie.h, but it should look like this */
  84. #ifdef    NEVER
  85. struct scb {
  86.     unsigned short    sc_status;    /* status */
  87.     unsigned short    sc_cmd;        /* command */
  88.     unsigned short    sc_clist;    /* command list */
  89.     unsigned short    sc_rlist;    /* receive frame list */
  90.     unsigned short    sc_crcerrs;    /* crc errors */
  91.     unsigned short    sc_alnerrs;    /* alignment errors */
  92.     unsigned short    sc_rscerrs;    /* resource errors (lack of rfd/rbd's) */
  93.     unsigned short    sc_ovrnerrs;    /* overrun errors (mem bus not avail) */
  94. };
  95. #endif    NEVER
  96.  
  97. /* X_ATINIT */
  98. /* The parameter is a pointer to a short which is filled in with
  99.    the node number chosen by the AppleTalk initialization sequence */
  100.  
  101. /* X_ATWRITE */
  102. struct fp_atwrite {
  103.     short    fpw_length;    /* number of bytes in hte following string */
  104.     unsigned char *fpw_str;    /* string to be output onto the network */
  105. };
  106.  
  107. /* X_WAIT */
  108. /* The parameter is a long integer which indicates
  109.    the number of milliseconds to delay */
  110.  
  111. /* X_WHEREIS */
  112. struct fp_whereis {
  113.     char    *fpw_rom0;    /* first address of 1st ROM */
  114.     char    *fpw_rom1;    /* first address of 2nd ROM */
  115.     char    *fpw_8530;    /* address of Zilog 8530 chip */
  116.     char    *fpw_0port;    /* address of 1st 8-bit port */
  117.     char    *fpw_1port;    /* address of 2nd 8-bit port */
  118.     char    *fpw_ram2;    /* address of 1st RAM location */
  119.     char    *fpw_ramtop;    /* address of last RAM location */
  120. };
  121.  
  122. /* X_GETMEM and X_CLRMEM and X_BUFINIT */
  123. struct fp_mem {
  124.     short    fpm_count;    /* number of bytes */
  125.     char    *fpm_memp;    /* addr of allocated or to be cleared memory */
  126. };
  127.  
  128. /* X_PROTECT */
  129. struct fp_proelem {        /* protection array element */
  130.     short    fpp_count;    /* number of bytes to protect */
  131.     char    *fpp_memp;    /* address of memory to protect */
  132.     short    fpp_chksum;    /* checksum of protected memory */
  133. };
  134.  
  135. struct fp_protect {
  136.     short    fpt_oper;    /* type of protection operation and result */
  137.     short    fpt_count;    /* number of elements in protection array */
  138.     struct fp_proelem *fpt_elem; /* addr 1st element in protection array */
  139. };
  140.  
  141. /* fpt_oper operations */
  142. #define    PR_FAIL        -1    /* result: check of checksums failed */
  143. #define    PR_PASS        0    /* result: check of checksums passed */
  144. #define    PR_PROTECT    1    /* operation: start protect via elem array */
  145. #define    PR_CHECK    2    /* operation: verify protect via elem array */
  146. #define    PR_CANCEL    3    /* operation: cancel protect via elem array */
  147.  
  148. /* X_COPYMEM */
  149. struct fp_copy {
  150.     char    *fpc_from;    /* location to copy bytes from */
  151.     char    *fpc_to;    /* location to copy bytes to */
  152.     short    fpc_count;    /* number of bytes to copy */
  153. };
  154.  
  155. /* X_PROMRAM */
  156. struct fp_bufinfo {
  157.     struct pbuf **fpb_pfree;/* beginning of the free list */
  158.     struct pqueue *fpb_pq;    /* received buffers queue (both networks) */
  159.     struct pqueue *fpb_sendq;/* Ethernet transmit queue */
  160.     short    fpb_bsize;    /* size of a buffer including header */
  161.     short    fpb_pbnfree;    /* pbufs on our free list */
  162.     short    fpb_pbndrops;    /* times failed to find space */
  163.     short    fpb_pbntypes[16];/* type specific pbuf allocations */
  164. };
  165.  
  166. struct fp_state {
  167.     unsigned short    fps_atnet;  /* current net number for AppleTalk side */
  168.     unsigned short    fps_etnet;  /* current net number for Ethernet side */
  169.     unsigned char    fps_valid;  /* following AppleTalk node number valid */
  170.     unsigned char    fps_node;   /* current AppleTalk LAP node number */
  171.     unsigned char    fps_netw;   /* network number (not used) */
  172.     unsigned char    fps_bridge; /* last known bridge num on net if any */
  173.     unsigned char    fps_ether[6]; /* current ethernet address */
  174. #define    SNAMESIZE    21        /* extra char for null at end */
  175.     char    fps_name[SNAMESIZE];/* ascii name of the gateway */
  176.     char    fps_file[SNAMESIZE];/* ascii name of srec file last loaded */
  177.     unsigned char    fps_pforce; /* non-zero forces execution of prom loop */
  178.     unsigned char    fps_reserve;
  179.     unsigned char    fps_unused[70];
  180. };
  181.  
  182. struct fp_abstats {
  183.     int    fpa_interrupts;    /* Appletalk interrupts */
  184.     int    fpa_ipackets;    /* packets received */
  185.     int    fpa_opackets;    /* packets transmitted */
  186.     int    fpa_crc;    /* crc errors */
  187.     int    fpa_ovr;    /* receive overrun errors */
  188.     int    fpa_iund;    /* receive underrun errors */
  189.     int    fpa_xx;
  190.     int    fpa_yy;
  191.     int    fpa_bad;    /* bad packets received */
  192.     int    fpa_coll;    /* collisions */
  193.     int    fpa_defer;    /* times deferred to other packets */
  194.     int    fpa_idleto;    /* packets that timed out waiting for the end */
  195.     int    fpa_zz;
  196.     int    fpa_nodata;    /* packets without data (nothing after rts) */
  197.     int    fpa_ound;    /* transmit underrun errors */
  198.     int    fpa_badddp;    /* bad ddp packets */
  199.     int    fpa_spur;    /* spurrious interrupts */
  200. };
  201.  
  202. struct fp_iestats {
  203.     struct scb *fpi_scbptr;    /* status control block */
  204.     int    fpi_ipackets;    /* input packets */
  205.     int    fpi_opackets;    /* output packets */
  206.     int    fpi_ierrors;    /* input errors */
  207.     int    fpi_oerrors;    /* output errors */
  208.     int    fpi_cmdbusy;    /* busy waits */
  209. };
  210.  
  211. struct fp_promram {
  212.     short    fpr_count;            /* number of valid ptrs that follow */
  213.     char    *fpr_jtable;            /* jump table */
  214.     struct fp_bufinfo *fpr_bufs;    /* buffer manager vector */
  215.     struct fp_state *fpr_state;    /* Prompt program's state vector */
  216.     struct fp_abstats *fpr_abstats;    /* AppleTalk statistics vector */
  217.     struct fp_iestats *fpr_iestats;    /* Ethernet statistics vector */
  218.     char    *fpr_1debug;            /* first level debug flag */
  219.     char    *fpr_2debug;            /* second level debug flag */
  220.     char    *fpr_3debug;            /* third level debug flag */
  221.     char    *fpr_unused[24];        /* remaining ptrs are not defined yet */
  222. };
  223.  
  224. /* X_RESET */
  225. /* no parameters */
  226.  
  227. /* X_USER0, X_USER1, X_USER2, X_USER3, X_USER4, X_USER5, X_USER6, X_USER7 */
  228. /* parameters (if any) defined by user */
  229.  
  230. /* X_BUFGET */
  231. struct fp_bget {
  232.     struct pbuf *fpg_buf;    /* address of buffer returned */
  233.     short    fpg_type;    /* type of buffer to be "gotten" */
  234. };
  235.  
  236. /* X_BUFFREE */
  237. struct fp_bfree {
  238.     struct pbuf *fpf_buf;    /* address of buffer to be freed */
  239.     struct pbuf *fpf_nxt;    /* the freed buffer's link before it was freed*/
  240. };
  241.  
  242. /* X_BUFENQ and  X_BUFDEQ */
  243. struct fp_bqueue {
  244.     struct pqueue *fpq_q;    /* addr of queue to enqueue to / dequeue from */
  245.     struct pbuf *fpq_buf;    /* addr of buffer to be enqueued or dequeued */
  246. };
  247.  
  248. /* X_ERR */
  249. /* no parameters */
  250.  
  251. /* X_IDLE */
  252. /* no parameters */
  253.  
  254. /* X_KLAP */
  255. /* The parameter is the address of a pbuf structure. See pbuf.h. */
  256.  
  257. /* X_WHO */
  258. /* no parameters */
  259.  
  260. /* X_CA86 */
  261. /* no parameters */
  262.  
  263. /* X_RES86 */
  264. /* no parameters */
  265.  
  266. /* X_CLRINT */
  267. /* no parameters */
  268.  
  269. /* X_RCSID */
  270. /* The parameter is the address of a character array which is filled
  271.    in with the current RCS identification string of this PROM version. */
  272.  
  273. /* X_EXPROM */
  274. /* no parameters */
  275.  
  276. /* X_INIPROM */
  277. /* no parameters */
  278.  
  279. /* X_RES8530 */
  280. /* no parameters */
  281.  
  282. /* X_DMTSERV */
  283. /* no parameters */
  284.  
  285. /* X_SREC */
  286. /* The parameter is the address of a character array which contains
  287.    the S-record to be interpreted and used by the gateway */
  288.  
  289. /* X_SPL */
  290. /* The parameter is the address short which becomes the next processor priority
  291.    level. The previous priority level is returned at the same location */
  292.  
  293. /* X_NOTIMP */
  294. /* no parameters */
  295.  
  296.