home *** CD-ROM | disk | FTP | other *** search
/ PC World Komputer 1999 March B / SCO_CASTOR4RRT.iso / nics / root.2 / etc / inst / nd / mdi / smpw / Space.c / Space.c
Encoding:
C/C++ Source or Header  |  1998-08-19  |  27.2 KB  |  797 lines

  1. /*
  2. ** Copyright (C) 1994-1997 by
  3. ** Digital Equipment Corporation, All rights reserved.
  4. **
  5. ** This software is furnished under a license and may be used and copied
  6. ** only  in  accordance  with  the  terms  of such  license and with the
  7. ** inclusion of the above copyright notice. This software or  any  other
  8. ** copies thereof may not be provided or otherwise made available to any
  9. ** other person. No title to and ownership of  the  software  is  hereby
  10. ** transferred.
  11. **
  12. ** The information in this software is subject to change without  notice
  13. ** and  should  not be  construed  as  a commitment by Digital Equipment
  14. ** Corporation.
  15. **
  16. ** Digital assumes no responsibility for the use or  reliability  of its
  17. ** software on equipment which is not supplied by Digital.
  18. **
  19. */
  20.  
  21. #include "sys/types.h"
  22. #ifdef REMOVE_ME_LATER /* app for LLI/MDI */
  23. #include "config.h"
  24. #endif
  25. #ifndef GEMINI_INTERFACE
  26. #define GEMINI_INTERFACE 1
  27. #endif
  28.  
  29.  
  30. #ifdef MDI_INTERFACE  /*ANTANT ditto in src_space.h */
  31. #include "sys/pci.h"
  32. #endif
  33.  
  34. #define XXX_MAX_MEDIA_TABLE              SMPW_MAX_MEDIA_TABLE
  35. #define XXX_media_types_t                SMPW_media_types_t
  36. #define XXX_burst_length_t               SMPW_burst_length_t
  37. #define XXX_CACHE_ILLEGAL                SMPW_CACHE_ILLEGAL
  38. #define XXX_cache_alignment_t            SMPW_cache_alignment_t
  39. #define XXX_10MB_threshold_t             SMPW_10MB_threshold_t
  40. #define XXX_crc_calc_t                   SMPW_crc_calc_t
  41. #define xxx_turbo                        smpw_turbo
  42. #define XXX_board_config_t               SMPW_board_config_t
  43. #define XXX_pci_devinfo_t                SMPW_pci_devinfo_t
  44. #define XXX_info                         smpw_info
  45. #define xxx_debug                        smpw_debug
  46. #define xxx_max_boards                   smpw_max_boards
  47. #define xxx_Boards_table                 smpw_Boards_table
  48. #define xxxinit                          smpwinit
  49. #define xxxintr                          smpwintr
  50. #define xxx1intr                         smpw1intr
  51. #define xxx2intr                         smpw2intr
  52. #define xxx3intr                         smpw3intr
  53. #define xxxpoll                          smpwpoll
  54. #define xxx1poll                         smpw1poll
  55. #define xxx2poll                         smpw2poll
  56. #define xxx3poll                         smpw3poll
  57. #define xxx_start_adapter                smpw_start_adapter
  58. #define xxx_stop_adapter                 smpw_stop_adapter
  59. #define xxx_broken_adapter               smpw_broken_adapter
  60. #define xxx_init_cntrs                   smpw_init_cntrs
  61.  
  62. #define xxx_init_sia_regs                smpw_init_sia_regs
  63. /*
  64. #define xxx_initialize_gep_register      smpw_initialize_gep_register */
  65. #define xxx_WriteCSR6                     smpw_WriteCSR6
  66.  
  67. #define xxx_ptok                         smpw_ptok
  68. #define xxx_ktop                         smpw_ktop
  69. #define xxxpoll_disabled                 smpwpoll_disabled
  70. #define xxxpoll_prev                     smpwpoll_prev
  71. #define xxx_crctable                     smpw_crctable
  72. #define xxx_macioc_setmca                smpw_macioc_setmca
  73. #define xxx_macioc_delmca                smpw_macioc_delmca
  74. #define xxx_macioc_getmca                smpw_macioc_getmca
  75. #define xxx_macioc_getaddr               smpw_macioc_getaddr
  76. #define xxx_macioc_setaddr               smpw_macioc_setaddr
  77. #define xxx_macioc_promisc               smpw_macioc_promisc
  78. #define xxx_macioc_getmcsiz              smpw_macioc_getmcsiz
  79. #define xxx_handle_rx_filter_mode        smpw_handle_rx_filter_mode
  80. #define xxx_update_csr6                  smpw_update_csr6
  81. #define xxx_create_setupacket            smpw_create_setupacket
  82. #define xxx_poll_on_setupacket           smpw_poll_on_setupacket
  83. #define xxx_find_addr_in_board_table     smpw_find_addr_in_board_table
  84. #define xxx_setupacket_handler           smpw_setupacket_handler
  85. #define xxx_compare_addrs                smpw_compare_addrs
  86. #define xxx_m_data                       smpw_m_data
  87. #define xxx_process_rx_pkts              smpw_process_rx_pkts
  88. #define xxx_alloc_rx_bufs                smpw_alloc_rx_bufs
  89. #define xxx_bufcall_rx_bufs              smpw_bufcall_rx_bufs
  90. #define xxx_proc_and_free_tx_bufs        smpw_proc_and_free_tx_bufs
  91. #define xxx_check_ioctl_message          smpw_check_ioctl_message
  92. #define xxx_iocblk_ack                   smpw_iocblk_ack
  93. #define xxx_flush_handler                smpw_flush_handler
  94. #define xxx_ioctl_handler                smpw_ioctl_handler
  95. #define xxx_proto_pcproto_handler        smpw_proto_pcproto_handler
  96. #define xxx_mac_hwfail_ind               smpw_mac_hwfail_ind
  97. #define xxx_check_pci_bus                smpw_check_pci_bus
  98. #define xxx_parse_srom                   smpw_parse_srom
  99. #define xxx_calculate_checksum           smpw_calculate_checksum
  100. #define xxx_check_if_board_in_system     smpw_check_if_board_in_system
  101. #define xxx_init_board                   smpw_init_board
  102. #define xxx_handle_pci_turbo             smpw_handle_pci_turbo
  103. #define xxx_autosense_intr_handler       smpw_autosense_intr_handler
  104. #define xxx_dc21041_dynamic_autosense    smpw_dc21041_dynamic_autosense
  105. #define xxx_dc21140_dynamic_autosense    smpw_dc21140_dynamic_autosense
  106. #define xxx_autodetection                smpw_autodetection
  107. #define xxx_free_rx_resources            smpw_free_rx_resources
  108. #define xxx_free_tx_resources            smpw_free_tx_resources
  109. #define xxx_alloc_rx_list                smpw_alloc_rx_list
  110. #define xxx_alloc_tx_list                smpw_alloc_tx_list
  111. #define xxx_alloc_setup_buf              smpw_alloc_setup_buf
  112. #define xxx_alloc_dummy_pkt              smpw_alloc_dummy_pkt
  113. #define xxx_init_config_reg_vals         smpw_init_config_reg_vals
  114. #define xxx_init_config_regs_map         smpw_init_config_regs_map
  115. #define xxx_init_regs_map                smpw_init_regs_map
  116. #define xxx_init_ctrl_reg_vals           smpw_init_ctrl_reg_vals
  117. #define XXX_100MB_threshold_t            SMPW_100MB_threshold_t
  118. #define XXX_module_prefix         SMPW_module_prefix
  119.  
  120. #define SMPW_0_PCI_BUS -1
  121. #define SMPW_0_PCI_DEV -1
  122. #define SMPW_0_PCI_FUNC -1
  123.  
  124. #define SMPW_1_PCI_BUS -1
  125. #define SMPW_1_PCI_DEV -1
  126. #define SMPW_1_PCI_FUNC -1
  127.  
  128. #define SMPW_2_PCI_BUS -1
  129. #define SMPW_2_PCI_DEV -1
  130. #define SMPW_2_PCI_FUNC -1
  131.  
  132. #define SMPW_3_PCI_BUS -1
  133. #define SMPW_3_PCI_DEV -1
  134. #define SMPW_3_PCI_FUNC -1
  135.  
  136.  
  137. #define SMPW_0_MEDIA     ((ushort)-1)
  138. #define SMPW_1_MEDIA     ((ushort)-1) 
  139. #define SMPW_2_MEDIA     ((ushort)-1) 
  140. #define SMPW_3_MEDIA     ((ushort)-1)
  141.     
  142. #define XXX_TRUE     1
  143. #define XXX_FALSE    0
  144.  
  145.  
  146. /*
  147. ** DC21X4 debug's level
  148. */
  149.  
  150. typedef enum
  151.     {
  152.     XXX_LEVEL_0,
  153.     XXX_LEVEL_1,
  154.     XXX_LEVEL_2,
  155.     XXX_LEVEL_3
  156.     } XXX_debug_level;
  157.  
  158.  
  159.  
  160. /*
  161. ** Media types for DC21040, DC2104, DC21140 and DC21142
  162. */
  163.  
  164. typedef enum
  165.     {
  166.     XXX_TP,
  167.     XXX_BNC,
  168.     XXX_AUI,
  169.     XXX_100TX,
  170.     XXX_TP_FDX,
  171.     XXX_100TX_FDX,
  172.     XXX_100T4,
  173.     XXX_100FX,
  174.     XXX_100FX_FDX,
  175.     XXX_MAX_MEDIA_TABLE
  176.     } XXX_media_types_t;
  177.  
  178.  
  179.  
  180. /* Phy  Mediums */
  181.  
  182. #define XXX_MII_TP                  0x0009
  183. #define XXX_MII_TP_FDX              0x000A
  184. #define XXX_MII_BNC                 0x000B
  185. #define XXX_MII_AUI                 0x000C
  186. #define XXX_MII_100TX               0x000D
  187. #define XXX_MII_100TX_FDX           0x000E
  188. #define XXX_MII_100T4               0x000F
  189. #define XXX_MII_100FX               0x0010
  190. #define XXX_MII_100FX_FDX           0x0011
  191.  
  192.  
  193. #define XXX_NWAY           0x100
  194. #define XXX_FULL_DUPLEX    0x200
  195. #define XXX_LINK_DISABLE   0x400
  196. #define XXX_AUTOSENSE      0x800
  197.  
  198.  
  199. /*
  200. ** DC21X4 - SIA/serial modes
  201. */
  202.  
  203. #define XXX_TP_FULL_DUPLEX              (XXX_TP_FDX | XXX_FULL_DUPLEX)
  204.  
  205.  
  206. /*
  207. ** DC2104X - added SIA modes
  208. */
  209.  
  210. #define XXX_TP_LINK_DISABLE             (XXX_TP | XXX_LINK_DISABLE)
  211. /* #if LLI_INTERFACE
  212. #define XXX_DC2104X_DEF_SERIAL_MODE     0xFFFE
  213. !!!   #endif
  214.  */
  215.  
  216.  
  217. /*
  218. ** DC2114X - added serial modes
  219. */
  220.  
  221. #define XXX_100TX_FULL_DUPLEX          (XXX_100TX_FDX | XXX_FULL_DUPLEX)
  222. #define XXX_100FX_FULL_DUPLEX          (XXX_100FX_FDX | XXX_FULL_DUPLEX)
  223. /* #if LLI_INTERFACE
  224. #define XXX_DC2114X_DEF_SERIAL_MODE     0xFFFE
  225.  !!!  #endif
  226.  */
  227.  
  228. #define XXX_MII_TP_FULL_DUPLEX      (XXX_MII_TP_FDX | XXX_FULL_DUPLEX)
  229. #define XXX_MII_100TX_FULL_DUPLEX   (XXX_MII_100TX_FDX | XXX_FULL_DUPLEX)
  230. #define XXX_MII_100FX_FULL_DUPLEX   (XXX_MII_100FX_FDX | XXX_FULL_DUPLEX)
  231. #define XXX_MII_AUTOSENSE           (XXX_MII_TP | XXX_AUTOSENSE)
  232.  
  233. /* #if MDI_INTERFACE */
  234. #define XXX_DC21X4_DEF_SERIAL_MODE      0xFFFE
  235. /* #endif */
  236.  
  237.  
  238. /*
  239. ** Burst Length
  240. */
  241.  
  242. typedef enum
  243.     {
  244.     XXX_PBL_0  = 0,
  245.     XXX_PBL_1  = 1,
  246.     XXX_PBL_2  = 2,
  247.     XXX_PBL_4  = 4,
  248.     XXX_PBL_8  = 8,
  249.     XXX_PBL_16 = 16,
  250.     XXX_PBL_32 = 32,
  251.     XXX_PBL_DEFAULT = 0xFF
  252.     } XXX_burst_length_t;
  253.  
  254.  
  255. /*
  256. ** Cache Alignment
  257. */
  258.  
  259. typedef enum
  260.     {
  261.     XXX_CACHE_ILLEGAL = 0,
  262.     XXX_CACHE_8 = 1,
  263.     XXX_CACHE_16 = 2,
  264.     XXX_CACHE_32 = 3,
  265.     XXX_CACHE_DEFAULT = 0xFF
  266.     } XXX_cache_alignment_t;
  267.  
  268. /*
  269. ** TX FIFO Threshold for 10MB
  270. */
  271.  
  272. typedef enum
  273.     {
  274.     XXX_10MB_THRESHOLD_72 = 0,
  275.     XXX_10MB_THRESHOLD_96,
  276.     XXX_10MB_THRESHOLD_128,
  277.     XXX_10MB_THRESHOLD_160
  278.     } XXX_10MB_threshold_t;
  279.  
  280.  
  281. /*
  282. ** TX FIFO Threshold for 100MB
  283. */
  284.  
  285. typedef enum
  286.     {
  287.     XXX_100MB_THRESHOLD_128 = 0,
  288.     XXX_100MB_THRESHOLD_256,
  289.     XXX_100MB_THRESHOLD_512,
  290.     XXX_100MB_THRESHOLD_1024,
  291.     XXX_100MB_THRESHOLD_FULL = 0xFFFF
  292.     } XXX_100MB_threshold_t;
  293.  
  294.  
  295.  
  296.  
  297. /*
  298. ** HW/SW CRC calculation
  299. */
  300.  
  301. typedef enum
  302.     {
  303.     XXX_SW_CRC_ALWAYS = 0,
  304.     XXX_SW_CRC_NEVER
  305.     } XXX_crc_calc_t;
  306.  
  307.  
  308. /*
  309. ** DC2114X's general purpose register - use the default vale
  310. */
  311.  
  312. #define XXX_GPR_DEFAULT      0xFFFF
  313.  
  314. /*
  315. **  This is to emulate the MDI's PCI API scheme
  316. **  These slotnum, funcnum, busnum are filled when ...find_d21x4_board ()
  317. **  is called.
  318. **  Once SCO implement these APIs in GEMINI then it can be removed
  319. */
  320.  
  321. typedef struct pci_devinfo_tag
  322.    {
  323.     short slotnum;
  324.     short funcnum;
  325.     short busnum;
  326.    }XXX_pci_devinfo_t;
  327.  
  328.  
  329. typedef struct
  330.    {
  331.    ulong                     board_num;
  332.    char                      *board_id;
  333.    uint                      vector;
  334.    ulong                     iobase;
  335.    ulong                     ioend;
  336.    int                       pci_bus;
  337.    int                       pci_dev;
  338.    int                       pci_fun;
  339.    uint                      rx_bufs_to_post;
  340. /* #if MDI_INTERFACE */
  341.    ushort                    DC21X4_serial_mode;
  342. /* #endif */
  343.    uint                      bus_arbitration;
  344.    XXX_burst_length_t        burst_length;
  345.    XXX_cache_alignment_t     cache_alignment;
  346.    uint                      pass_bad_frames;
  347.    uint                      backoff_cntr;
  348.    XXX_10MB_threshold_t      threshold;
  349.    XXX_100MB_threshold_t     threshold_100;
  350.    uint                      parity_error_response;
  351.    uint                      latency_timer;
  352. #ifdef MDI_INTERFACE  /*ANTANT ditto in src_space.h */
  353.    struct pci_devinfo        pci_device_info;
  354. #endif
  355. #ifdef GEMINI_INTERFACE  /*ANTANT need to put in src_space.h and space.c*/
  356.    XXX_pci_devinfo_t        pci_device_info; /* need slotnum to CreateNIC */
  357. #endif
  358.    XXX_crc_calc_t            crc_calc;
  359.    uint                      dc2114x_gpr_ctrl;
  360.    uint                      dc2114x_gpr_data;
  361.    uint                      xxx_turbo;
  362.    uint                      snooze_mode;
  363.    unchar                     mwi_key;
  364.    unchar                     mrm_key;
  365.    unchar                     mrl_key;
  366.    unchar                    mac_addr[6];
  367. #ifdef GEMINI_INTERFACE  /*ANTANT need to put in src_space.h and space.c*/
  368.    char                      pci_id_string[11];
  369. #endif
  370.    } XXX_board_config_t;
  371.  
  372. /*
  373. ** Enable/disable diagnostic messages. Allowed values are:
  374. **    XXX_LEVEL_3  - enable debug message in level 1,2,3.
  375. **    XXX_LEVEL_2  - enable debug message in level 1,2.
  376. **    XXX_LEVEL_1  - enable debug message in level 1.
  377. **    XXX_LEVEL_0 - disable debug message
  378. */
  379. #define XXX_DEBUG      XXX_LEVEL_0
  380.  
  381.  
  382. #ifdef REMOVE_ME_LATER
  383. #define XXX_HW_ACCESSES  XXX_USE_PCI_BIOS
  384. #endif
  385. /*
  386. ** Highest vector number supported. Needed to allocate large enough array
  387. ** Should NOT be modified
  388. */
  389. #define XXX_MAX_VECTOR_NUMS            16
  390.  
  391. /*
  392. ** Number of buffers pre-allocated on the receive list
  393. */
  394. #define XXX_RX_BUFS_TO_POST            6
  395.  
  396.  
  397.  
  398. /*
  399. ** Serial mode for All boards ! . Can have one of the
  400. ** following values:
  401. ** for DC21040 and DC21041 :
  402. **     XXX_TP                          - 10 MB/sec TP connection
  403. **     XXX_BNC                         - 10 MB/sec BNC connection
  404. **     XXX_AUI                         - 10 MB/sec AUI connection
  405. **     XXX_TP_FULL_DUPLEX              - point to point full duplex, 10 MB/sec
  406. **                                       TP connection
  407. **     XXX_TP_LINK_DISABLE             - Twisted pair connection with linkfail
  408. **                                       test ignore & set polarity plus
  409. **     XXX_DC21X4_DEF_SERIAL_MODE     - choose the value that was read from
  410. **                                       the SROM if read, else choose the
  411. **                                       AUTOSENSE mode
  412. **
  413. **
  414. ** for DC21140 and DC21142 :
  415. **     XXX_TP                          - 10 MB/sec TP connection
  416. **     XXX_BNC                         - 10 MB/sec BNC connection
  417. **     XXX_AUI                         - 10 MB/sec AUI connection
  418. **     XXX_TP_FULL_DUPLEX              - point to point full duplex, 10 MB/sec
  419. **                                       TP connection
  420. **     XXX_TP_LINK_DISABLE             - Twisted pair connection with linkfail
  421. **                                       test ignore & set polarity plus - for
  422. **                                       DC21142 only !
  423. **     XXX_100TX                       - 100TX MB/sec mode
  424. **     XXX_100TX_FULL_DUPLEX           - point to point full duplex, 100TX MB/sec
  425. **                                       mode
  426. **     XXX_100FX                       - 100 MB/sec FX mode
  427. **     XXX_100FX_FULL_DUPLEX           - point to point full duplex, 100 MB/sec
  428. **                                       FX mode
  429. **     XXX_100T4                       - 100T4 MB/sec mode
  430. **     XXX_AUTOSENSE                   - Automatic detection between all
  431. **                                       supported media (except FULL DUPLEX).
  432. **     XXX_DC21X4_DEF_SERIAL_MODE     - choose the value that was read from
  433. **                                       the SROM if read, else choose the
  434. **                                       AUTOSENSE mode
  435. **
  436. ** Important Note!
  437. ** This definition is a global definition for all installed boards.
  438. ** If you want to set a different mode for each board, please modify
  439. ** the 'DC21X4_serial_mode' field in the appropriate part of the XXX_info
  440. ** structure below (the values to use are those listed above).
  441. */
  442. #define XXX_DC21X4_SERIAL_MODE          XXX_AUTOSENSE
  443.  
  444. /*
  445. ** Selects internal bus arbitration between the receive and transmit
  446. ** processing. Allowed values:
  447. **    XXX_TRUE  - round robin arbitration, equal sharing
  448. **    XXX_FALSE - receive process has priority over the transmit process
  449. **                (default)
  450. */
  451. #define XXX_BUS_ARBITRATION   XXX_FALSE
  452.  
  453. /*
  454. ** Maximum number of longwords transferred in a DMA transaction.
  455. ** Allowed values are:
  456. **     XXX_PBL_0 (0),
  457. **     XXX_PBL_1 (1),
  458. **     XXX_PBL_2 (2),
  459. **     XXX_PBL_4 (4),
  460. **     XXX_PBL_8 (8),
  461. **     XXX_PBL_16 (16),
  462. **     XXX_PBL_32 (32),
  463. **     XXX_PBL_DEFAULT (32 for DC21140/DC21142 and 16 for DC21040/DC21041).
  464. ** NOTE : Burst length of XXX_PBL_0 means the only limit is the amount
  465. **        of data stored.
  466. ** NOTE : Burst length of XXX_PBL_0 or XXX_PBL_32 are not supported in
  467. **        21040/21041 boards due to chips' limitation. If the user
  468. **        will choose one of those values, the driver will change the
  469. **        burst length to 16. No warning is issued about this.
  470. **
  471. ** NOTE : When the driver is working on a PCI machine with the CDC chip
  472. **        (rev 3) or with the CDC chip (rev 2) it initializes the DC21X4 burst
  473. **        length to XXX_PBL_8 and ignores the value that is given by the user
  474. **        in space.c . No warning is issued about this (SCO Unix boot info
  475. **        limitations)
  476. */
  477. #define XXX_BURST_LENGTH      XXX_PBL_DEFAULT
  478.  
  479. /*
  480. ** Address boundary for data burst stop. Allowed values are:
  481. **    XXX_CACHE_8
  482. **    XXX_CACHE_16
  483. **    XXX_CACHE_32
  484. **    XXX_CACHE_DEFAULT (will be the same as the burst length)
  485. */
  486. #define XXX_CACHE_ALIGNMENT   XXX_CACHE_DEFAULT
  487.  
  488. /*
  489. ** Enable/disable passing of bad frames (runt frames, truncated frames,
  490. ** collided frames) from the adapter to the driver.
  491. **    XXX_TRUE  - enables passing of bad frames
  492. **    XXX_FALSE - disable passingof bad frames (default)
  493. */
  494. #define XXX_PASS_BAD_FRAMES   XXX_FALSE
  495.  
  496. /*
  497. ** Backoff counter algorithm.
  498. **    XXX_TRUE  - stop counter when any carrier activity is detected
  499. **    XXX_FALSE - backoff counter is not affected by the carrier activity
  500. **                (default)
  501. */
  502. #define XXX_BACKOFF_CNTR      XXX_FALSE
  503.  
  504. /*
  505. ** Transmit FIFO threshold for starting packet transmission to line (for
  506. ** 10MB mode).
  507. ** Allowed values are:
  508. **    XXX_10MB_THRESHOLD_72
  509. **    XXX_10MB_THRESHOLD_96 (default)
  510. **    XXX_10MB_THRESHOLD_128
  511. **    XXX_10MB_THRESHOLD_160
  512. */
  513. #define XXX_10MB_THRESHOLD         XXX_10MB_THRESHOLD_96
  514.  
  515. /*
  516. ** Transmit FIFO threshold for starting packet transmission to line (for
  517. ** 100MB mode).
  518. ** Allowed values are:
  519. **    XXX_100MB_THRESHOLD_128
  520. **    XXX_100MB_THRESHOLD_256
  521. **    XXX_100MB_THRESHOLD_512
  522. **    XXX_100MB_THRESHOLD_1024
  523. **    XXX_100MB_THRESHOLD_FULL (default) - full packet
  524. */
  525. #define XXX_100MB_THRESHOLD         XXX_100MB_THRESHOLD_FULL
  526.  
  527. /*
  528. ** Enable/disable parity checking on PCI bus
  529. **    XXX_TRUE  - enable parity checking
  530. **    XXX_FALSE - disable parity checking (default)
  531. */
  532. #define XXX_PARITY_ERROR_RESPONSE XXX_FALSE
  533.  
  534. /*
  535. ** DC21040/DC21140/DC21041/DC21142 PCI Latency Timer, in units of PCI bus
  536. ** clocks. Default is 50h
  537. **
  538. ** Note : If the user chooses a value for the PCI Latency Timer that is < 50h
  539. **        the driver changes this value to 50h, since the driver works with
  540. **        the minimum value - 50h.
  541. */
  542. #define XXX_LATENCY_TIMER     0x50
  543.  
  544. /*
  545. ** Enable/Disable SW's CRC calculation (in transmit packets)
  546. **    XXX_SW_CRC_ALWAYS - CRC will be calculated by the software for every
  547. **                        transmit packet longer than the threshold, for
  548. **                        transmit packets shorter than the threshold the HW
  549. **                        will calculate the CRC
  550. **    XXX_SW_CRC_NEVER  - CRC will be calculated by the hardware for every
  551. **                        transmit packet
  552. */
  553. #define XXX_CRC_CALC          XXX_SW_CRC_ALWAYS
  554.  
  555. /*
  556. ** The control and data values to be written to the DC21140/DC21142 general
  557. ** purpose register.
  558. **    XXX_GPR_DEFAULT - use the value found in the SROM. If no value
  559. **                      is found in the SROM the driver uses its default
  560. **                      values.
  561. ** The user can override the SROM default by setting specific values to
  562. ** XXX_DC2114X_CTRL/DATA.
  563. **
  564. ** NOTE: The SROM values can't be over-ridden if the XXX_DC2114X_SERIAL_MODE
  565. **       parameter is set to AUTOSENSE (or if it is set to use the SROM
  566. **       default and the SROM value is AUTOSENSE). In this case these values
  567. **       are ignored and no message is given.
  568. */
  569. #define XXX_DC2114X_GPR_CTRL  XXX_GPR_DEFAULT
  570. #define XXX_DC2114X_GPR_DATA  XXX_GPR_DEFAULT
  571.  
  572.  
  573. /*
  574. ** This constant is used to enable/disable PCI priority over EISA.
  575. **
  576. ** XXX_TRUE  - PCI has priority over EISA
  577. ** XXX_FALSE - EISA has priority over PCI
  578. **
  579. */
  580.  
  581. #define XXX_TURBO             XXX_TRUE
  582.  
  583.  
  584. /*
  585. ** Enable/disable snooze mode.
  586. **    XXX_TRUE  - enable snooze mode
  587. **    XXX_FALSE - disable snooze mode (default)
  588. */
  589. #define XXX_SNOOZE            XXX_FALSE
  590.  
  591.  
  592. #define XXX_UNDEF_USER        0xFF
  593.  
  594. /* 
  595. ** Enable/disable Extended PCI command Memory Write Invalidate (MWI)
  596. **    XXX_TRUE  - enable the use of MWI commnad
  597. **    XXX_FALSE - disable the use of MWI command
  598. **
  599. **    XXX_UNDEF_USER - (default)
  600. */
  601. #define XXX_MWI                XXX_UNDEF_USER
  602.  
  603. /* 
  604. ** Enable/disable Extended PCI command Memory Read Multiple (MRM)
  605. **    XXX_TRUE  - enable the use of MRM commnad
  606. **    XXX_FALSE - disable the use of MRM command
  607. **
  608. **    XXX_UNDEF_USER - (default)
  609. */
  610. #define XXX_MRM                XXX_UNDEF_USER
  611.  
  612. /* 
  613. ** Enable/disable Extended PCI command Memory Read Line (MRL)
  614. **    XXX_TRUE  - enable the use of MRL commnad
  615. **    XXX_FALSE - disable the use of MRL command
  616. **
  617. **    XXX_UNDEF_USER - (default)
  618. */
  619. #define XXX_MRL                XXX_UNDEF_USER
  620.  
  621.  
  622. /*
  623. ** Enable to change the default MAC address.
  624. ** If the address is 00-00-00-00-00-00 then the mac address is taken from the
  625. ** SROM else it taken from here
  626. */
  627. #define XXX_0_MAC_ADDR  0x00,0x00,0x00,0x00,0x00,0x00
  628. #define XXX_1_MAC_ADDR  0x00,0x00,0x00,0x00,0x00,0x00
  629. #define XXX_2_MAC_ADDR  0x00,0x00,0x00,0x00,0x00,0x00
  630. #define XXX_3_MAC_ADDR  0x00,0x00,0x00,0x00,0x00,0x00
  631. #ifdef GEMINI_INTERFACE        /* ANTANT */
  632. #define XXX_MAX_BOARDS        4
  633. #endif
  634.  
  635.  
  636. XXX_board_config_t XXX_info[XXX_MAX_BOARDS] =
  637. {
  638.    {
  639.    0,                            /* board_num */
  640.    "smpw0",                      /* board_id */
  641.    0,                   /* vector */
  642.    0,                   /* iobase */
  643.    0,                   /* ioend */
  644.    SMPW_0_PCI_BUS,               /* PCI bus number */
  645.    SMPW_0_PCI_DEV,               /* PCI device number */
  646.    SMPW_0_PCI_FUNC,              /* PCI function number */
  647.    XXX_RX_BUFS_TO_POST,          /* rx_bufs_to_post */
  648.    SMPW_0_MEDIA,                 /* DC21X4_serial_mode */
  649.    XXX_BUS_ARBITRATION,          /* bus_arbitration */
  650.    XXX_BURST_LENGTH,             /* burst_length */
  651.    XXX_CACHE_ALIGNMENT,          /* cache_alignment */
  652.    XXX_PASS_BAD_FRAMES,          /* pass_bad_frames */
  653.    XXX_BACKOFF_CNTR,             /* backoff_cntr */
  654.    XXX_10MB_THRESHOLD,           /* threshold */
  655.    XXX_100MB_THRESHOLD,          /* threshold_100 */
  656.    XXX_PARITY_ERROR_RESPONSE,    /* parity_error_response */
  657.    XXX_LATENCY_TIMER,            /* latency_timer */
  658.    {SMPW_0_PCI_DEV, SMPW_0_PCI_FUNC, SMPW_0_PCI_BUS},  /* PCI device info */
  659.    XXX_CRC_CALC,                 /* SW/HW CRC calculation */
  660.    XXX_DC2114X_GPR_CTRL,         /* DC2114X's general purpose register control
  661.                                     value */
  662.    XXX_DC2114X_GPR_DATA,         /* DC2114X's general purpose register data
  663.                                     value */
  664.    XXX_TURBO,                    /* Enable/disable PCI priority over EISA */
  665.    XXX_SNOOZE,                   /* snooze_mode */
  666.    XXX_MWI,                         /* Enable/Disable MWI extended PCI command */
  667.    XXX_MRM,                         /* Enable/Disable MRM extended PCI command */
  668.    XXX_MRL,                         /* Enable/Disable MRL extended PCI command */
  669.    XXX_0_MAC_ADDR                /* Mac address */
  670.    }
  671.  
  672.  
  673.  
  674.    ,{
  675.    1,                            /* board_num */
  676.    "smpw1",                      /* board_id */
  677.    0,                   /* vector */
  678.    0,                   /* iobase */
  679.    0,                   /* ioend */
  680.    SMPW_1_PCI_BUS,               /* PCI bus number */
  681.    SMPW_1_PCI_DEV,               /* PCI device number */
  682.    SMPW_1_PCI_FUNC,              /* PCI function number */
  683.    XXX_RX_BUFS_TO_POST,          /* rx_bufs_to_post */
  684.    SMPW_1_MEDIA,                 /* DC21X4_serial_mode */
  685.    XXX_BUS_ARBITRATION,          /* bus_arbitration */
  686.    XXX_BURST_LENGTH,             /* burst_length */
  687.    XXX_CACHE_ALIGNMENT,          /* cache_alignment */
  688.    XXX_PASS_BAD_FRAMES,          /* pass_bad_frames */
  689.    XXX_BACKOFF_CNTR,             /* backoff_cntr */
  690.    XXX_10MB_THRESHOLD,           /* threshold */
  691.    XXX_100MB_THRESHOLD,          /* threshold_100 */
  692.    XXX_PARITY_ERROR_RESPONSE,    /* parity_error_response */
  693.    XXX_LATENCY_TIMER,            /* latency_timer */
  694.    {SMPW_1_PCI_DEV, SMPW_1_PCI_FUNC, SMPW_1_PCI_BUS},  /* PCI device info */
  695.    XXX_CRC_CALC,                 /* SW/HW CRC calculation */
  696.    XXX_DC2114X_GPR_CTRL,         /* DC2114X's general purpose register control
  697.                                     value */
  698.    XXX_DC2114X_GPR_DATA,         /* DC2114X's general purpose register data
  699.                                     value */
  700.    XXX_TURBO,                    /* Enable/disable PCI priority over EISA */
  701.    XXX_SNOOZE,                   /* snooze_mode */
  702.    XXX_MWI,                         /* Enable/Disable MWI extended PCI command */
  703.    XXX_MRM,                         /* Enable/Disable MRM extended PCI command */
  704.    XXX_MRL,                         /* Enable/Disable MRL extended PCI command */
  705.    XXX_1_MAC_ADDR                /* Mac address */
  706.    }
  707.  
  708.  
  709.  
  710.  
  711.  
  712.    ,{
  713.    2,                            /* board_num */
  714.    "smpw2",                      /* board_id */
  715.    0,                   /* vector */
  716.    0,                   /* iobase */
  717.    0,                   /* ioend */
  718.    SMPW_2_PCI_BUS,               /* PCI bus number */
  719.    SMPW_2_PCI_DEV,               /* PCI device number */
  720.    SMPW_2_PCI_FUNC,              /* PCI function number */
  721.    XXX_RX_BUFS_TO_POST,          /* rx_bufs_to_post */
  722.    SMPW_2_MEDIA,                 /* DC21X4_serial_mode */
  723.    XXX_BUS_ARBITRATION,          /* bus_arbitration */
  724.    XXX_BURST_LENGTH,             /* burst_length */
  725.    XXX_CACHE_ALIGNMENT,          /* cache_alignment */
  726.    XXX_PASS_BAD_FRAMES,          /* pass_bad_frames */
  727.    XXX_BACKOFF_CNTR,             /* backoff_cntr */
  728.    XXX_10MB_THRESHOLD,           /* threshold */
  729.    XXX_100MB_THRESHOLD,          /* threshold_100 */
  730.    XXX_PARITY_ERROR_RESPONSE,    /* parity_error_response */
  731.    XXX_LATENCY_TIMER,            /* latency_timer */
  732.    {SMPW_2_PCI_DEV, SMPW_2_PCI_FUNC, SMPW_2_PCI_BUS},  /* PCI device info */
  733.    XXX_CRC_CALC,                 /* SW/HW CRC calculation */
  734.    XXX_DC2114X_GPR_CTRL,         /* DC2114X's general purpose register control
  735.                                     value */
  736.    XXX_DC2114X_GPR_DATA,         /* DC2114X's general purpose register data
  737.                                     value */
  738.    XXX_TURBO,                    /* Enable/disable PCI priority over EISA */
  739.    XXX_SNOOZE,                  /* snooze_mode */
  740.    XXX_MWI,                         /* Enable/Disable MWI extended PCI command */
  741.    XXX_MRM,                         /* Enable/Disable MRM extended PCI command */
  742.    XXX_MRL,                         /* Enable/Disable MRL extended PCI command */
  743.    XXX_2_MAC_ADDR                /* Mac address */
  744.    }
  745.  
  746.  
  747.  
  748.  
  749.  
  750.  
  751.  
  752.  
  753.    ,{
  754.    3,                            /* board_num */
  755.    "smpw3",                      /* board_id */
  756.    0,                   /* vector */
  757.    0,                   /* iobase */
  758.    0,                   /* ioend */
  759.    SMPW_3_PCI_BUS,               /* PCI bus number */
  760.    SMPW_3_PCI_DEV,               /* PCI device number */
  761.    SMPW_3_PCI_FUNC,              /* PCI function number */
  762.    XXX_RX_BUFS_TO_POST,          /* rx_bufs_to_post */
  763.    SMPW_3_MEDIA,                 /* DC21X4_serial_mode */
  764.    XXX_BUS_ARBITRATION,          /* bus_arbitration */
  765.    XXX_BURST_LENGTH,             /* burst_length */
  766.    XXX_CACHE_ALIGNMENT,          /* cache_alignment */
  767.    XXX_PASS_BAD_FRAMES,          /* pass_bad_frames */
  768.    XXX_BACKOFF_CNTR,             /* backoff_cntr */
  769.    XXX_10MB_THRESHOLD,           /* threshold */
  770.    XXX_100MB_THRESHOLD,          /* threshold_100 */
  771.    XXX_PARITY_ERROR_RESPONSE,    /* parity_error_response */
  772.    XXX_LATENCY_TIMER,            /* latency_timer */
  773.    {SMPW_3_PCI_DEV, SMPW_3_PCI_FUNC, SMPW_3_PCI_BUS},  /* PCI device info */
  774.    XXX_CRC_CALC,                 /* SW/HW CRC calculation */
  775.    XXX_DC2114X_GPR_CTRL,         /* DC2114X's general purpose register control
  776.                                     value */
  777.    XXX_DC2114X_GPR_DATA,         /* DC2114X's general purpose register data
  778.                                     value */
  779.    XXX_TURBO,                    /* Enable/disable PCI priority over EISA */
  780.    XXX_SNOOZE,                   /* snooze_mode */
  781.    XXX_MWI,                         /* Enable/Disable MWI extended PCI command */
  782.    XXX_MRM,                         /* Enable/Disable MRM extended PCI command */
  783.    XXX_MRL,                         /* Enable/Disable MRL extended PCI command */
  784.    XXX_3_MAC_ADDR                /* Mac address */
  785.    },
  786.  
  787.  
  788.  
  789.  
  790.  
  791. };
  792.  
  793. unchar          xxx_debug       = XXX_DEBUG;
  794. uint            xxx_max_boards  = XXX_MAX_BOARDS;
  795. void            *xxx_Boards_table[XXX_MAX_BOARDS];
  796.  
  797.