dgrs_bcomm.h 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148
  1. /*
  2. * The bios low-memory structure
  3. *
  4. * Some of the variables in here can be used to set parameters that
  5. * are stored in NVRAM and will retain their old values the next time
  6. * the card is brought up. To use the values stored in NVRAM, the
  7. * parameter should be set to "all ones". This tells the firmware to
  8. * use the NVRAM value or a suitable default. The value that is used
  9. * will be stored back into this structure by the firmware. If the
  10. * value of the variable is not "all ones", then that value will be
  11. * used and will be stored into NVRAM if it isn't already there.
  12. * The variables this applies to are the following:
  13. * Variable Set to: Gets default of:
  14. * bc_hashexpire -1 300 (5 minutes)
  15. * bc_spantree -1 1 (spanning tree on)
  16. * bc_ipaddr FF:FF:FF:FF 0 (no SNMP IP address)
  17. * bc_ipxnet FF:FF:FF:FF 0 (no SNMP IPX net)
  18. * bc_iptrap FF:FF:FF:FF 0 (no SNMP IP trap address)
  19. *
  20. * Some variables MUST have their value set after the firmware
  21. * is loaded onto the board, but before the processor is released.
  22. * These are:
  23. * bc_host 0 means no host "port", run as standalone switch.
  24. * 1 means run as a switch, with a host port. (normal)
  25. * 2 means run as multiple NICs, not as a switch.
  26. * -1 means run in diagnostics mode.
  27. * bc_nowait
  28. * bc_hostarea_len
  29. * bc_filter_len
  30. *
  31. */
  32. BEGIN_STRUCT(bios_comm)
  33. S4(ulong, bc_intflag) /* Count of all interrupts */
  34. S4(ulong, bc_lbolt) /* Count of timer interrupts */
  35. S4(ulong, bc_maincnt) /* Count of main loops */
  36. S4(ulong, bc_hashcnt) /* Count of entries in hash table */
  37. S4A(ulong, bc_cnt, 8) /* Misc counters, for debugging */
  38. S4A(ulong, bc_flag, 8) /* Misc flags, for debugging */
  39. S4(ulong, bc_memsize) /* Size of memory */
  40. S4(ulong, bc_dcache) /* Size of working dcache */
  41. S4(ulong, bc_icache) /* Size of working icache */
  42. S4(long, bc_status) /* Firmware status */
  43. S1A(char, bc_file, 8) /* File name of assertion failure */
  44. S4(ulong, bc_line) /* Line # of assertion failure */
  45. S4(uchar *, bc_ramstart)
  46. S4(uchar *, bc_ramend)
  47. S4(uchar *, bc_heapstart) /* Start of heap (end of loaded memory) */
  48. S4(uchar *, bc_heapend) /* End of heap */
  49. /* Configurable Parameters */
  50. S4(long, bc_host) /* 1=Host Port, 0=No Host Port, -1=Test Mode */
  51. S4(long, bc_nowait) /* Don't wait for 2host circ buffer to empty*/
  52. S4(long, bc_150ohm) /* 0 == 100 ohm UTP, 1 == 150 ohm STP */
  53. S4(long, bc_squelch) /* 0 == normal squelch, 1 == reduced squelch */
  54. S4(ulong, bc_hashexpire) /* Expiry time in seconds for hash table */
  55. S4(long, bc_spantree) /* 1 == enable IEEE spanning tree */
  56. S2A(ushort, bc_eaddr, 3) /* New ether address */
  57. S2(ushort, bc_dummy1) /* padding for DOS compilers */
  58. /* Various debugging aids */
  59. S4(long, bc_debug) /* Debugging is turned on */
  60. S4(long, bc_spew) /* Spew data on port 4 for bs_spew seconds */
  61. S4(long, bc_spewlen) /* Length of spewed data packets */
  62. S4(long, bc_maxrfd) /* If != 0, max number of RFD's to allocate */
  63. S4(long, bc_maxrbd) /* If != 0, max number of RBD's to allocate */
  64. /* Circular buffers for messages to/from host */
  65. S4(ulong, bc_2host_head)
  66. S4(ulong, bc_2host_tail)
  67. S4(ulong, bc_2host_mask)
  68. S1A(char, bc_2host, 0x200) /* Circ buff to host */
  69. S4(ulong, bc_2idt_head)
  70. S4(ulong, bc_2idt_tail)
  71. S4(ulong, bc_2idt_mask)
  72. S1A(char, bc_2idt, 0x200) /* Circ buff to idt */
  73. /* Pointers to structures for driver access */
  74. S4(uchar *, bc_port) /* pointer to Port[] structures */
  75. S4(long, bc_nports) /* Number of ports */
  76. S4(long, bc_portlen) /* sizeof(PORT) */
  77. S4(uchar *, bc_hash) /* Pointer to hash table */
  78. S4(long, bc_hashlen) /* sizeof(Table) */
  79. /* SNMP agent addresses */
  80. S1A(uchar, bc_ipaddr, 4) /* IP address for SNMP */
  81. S1A(uchar, bc_ipxnet, 4) /* IPX net address for SNMP */
  82. S4(long, bc_nohostintr) /* Do not cause periodic host interrupts */
  83. S4(uchar *, bc_dmaaddr) /* Physical addr of host DMA buf for diags */
  84. S4(ulong, bc_dmalen) /* Length of DMA buffer 0..2048 */
  85. /*
  86. * Board memory allocated on startup for use by host, usually
  87. * for the purposes of creating DMA chain descriptors. The
  88. * "len" must be set before the processor is released. The
  89. * address of the area is returned in bc_hostarea. The area
  90. * is guaranteed to be aligned on a 16 byte boundary.
  91. */
  92. S4(ulong, bc_hostarea_len) /* RW: Number of bytes to allocate */
  93. S4(uchar *, bc_hostarea) /* RO: Address of allocated memory */
  94. /*
  95. * Variables for communicating filters into the board
  96. */
  97. S4(ulong *, bc_filter_area) /* RO: Space to put filter into */
  98. S4(ulong, bc_filter_area_len) /* RO: Length of area, in bytes */
  99. S4(long, bc_filter_cmd) /* RW: Filter command, see below */
  100. S4(ulong, bc_filter_len) /* RW: Actual length of filter */
  101. S4(ulong, bc_filter_port) /* RW: Port # for filter 0..6 */
  102. S4(ulong, bc_filter_num) /* RW: Filter #, 0=input, 1=output */
  103. /* more SNMP agent addresses */
  104. S1A(uchar, bc_iptrap, 4) /* IP address for SNMP */
  105. S4A(long, bc_spare, 2) /* spares */
  106. END_STRUCT(bios_comm)
  107. #define bc VMO(struct bios_comm, 0xa3000100)
  108. /*
  109. * bc_status values
  110. */
  111. #define BC_INIT 0
  112. #define BC_RUN 100
  113. /*
  114. * bc_host values
  115. */
  116. #define BC_DIAGS -1
  117. #define BC_SASWITCH 0
  118. #define BC_SWITCH 1
  119. #define BC_MULTINIC 2
  120. /*
  121. * Values for spew (debugging)
  122. */
  123. #define BC_SPEW_ENABLE 0x80000000
  124. /*
  125. * filter commands
  126. */
  127. #define BC_FILTER_ERR -1
  128. #define BC_FILTER_OK 0
  129. #define BC_FILTER_SET 1
  130. #define BC_FILTER_CLR 2