home *** CD-ROM | disk | FTP | other *** search
/ Columbia Kermit / kermit.zip / archives / packetdrivers.tar.gz / pd.tar / src / ne2100.asm < prev    next >
Assembly Source File  |  1995-06-25  |  3KB  |  90 lines

  1. version    equ    1
  2.  
  3. ; Copyright, 1990-1992, Russell Nelson, Crynwr Software
  4.  
  5. ;   This program is free software; you can redistribute it and/or modify
  6. ;   it under the terms of the GNU General Public License as published by
  7. ;   the Free Software Foundation, version 1.
  8. ;
  9. ;   This program is distributed in the hope that it will be useful,
  10. ;   but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. ;   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  12. ;   GNU General Public License for more details.
  13. ;
  14. ;   You should have received a copy of the GNU General Public License
  15. ;   along with this program; if not, write to the Free Software
  16. ;   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  17.  
  18.  
  19.     .286                ;the NE2100 requires a 286.
  20.  
  21.     include    defs.asm
  22.  
  23. EBASE        equ    0
  24. DATA_REG    equ    10h
  25. ADDR_REG    equ    DATA_REG+2
  26.  
  27. code    segment    para public
  28.     assume    cs:code, ds:code
  29.  
  30.     public    int_no
  31. int_no    db    3,0,0,0            ;must be four bytes long for get_number.
  32. io_addr    dw    300h,0
  33. dma_no    db    5,0,0,0
  34.  
  35.     public    driver_class, driver_type, driver_name, driver_function, parameter_list
  36. driver_class    db    BLUEBOOK, IEEE8023, 0        ;from the packet spec
  37. driver_type    db    97        ;from the packet spec
  38. driver_name    db    'NE2100',0    ;name of the driver.
  39. driver_function    db    2        ;basic, extended
  40. parameter_list    label    byte
  41.     db    1    ;major rev of packet driver
  42.     db    9    ;minor rev of packet driver
  43.     db    14    ;length of parameter list
  44.     db    EADDR_LEN    ;length of MAC-layer address
  45.     dw    GIANT    ;MTU, including MAC headers
  46.     dw    MAX_MULTICAST * EADDR_LEN    ;buffer size of multicast addrs
  47.     dw    RECEIVE_BUF_COUNT-1    ;(# of back-to-back MTU rcvs) - 1
  48.     dw    TRANSMIT_BUF_COUNT-1    ;(# of successive xmits) - 1
  49. int_num    dw    0    ;Interrupt # to hook for post-EOI
  50.             ;processing, 0 == none,
  51.  
  52. reset_lance    macro
  53.     mov    ax,0ff7ch        ;stop LANCE
  54.     outport CSR0            ;should use hardware reset here
  55.     endm
  56.  
  57.     include    lance.asm
  58.  
  59.     public    usage_msg
  60. usage_msg    db    "usage: ne2100 [options] <packet_int_no> <hardware_irq> <io_addr> <dma_no>",CR,LF,'$'
  61. bad_reset_msg    db    "Unable to reset the NE2100.",CR,LF,'$'
  62. bad_init_msg    db    "Unable to initialize the NE2100.",CR,LF,'$'
  63. no_memory_msg    db    "Unable to allocate enough memory, look at end_resident in NE2100.ASM",CR,LF,'$'
  64.  
  65.     public    copyright_msg
  66. copyright_msg    db    "Packet driver for an NE2100, version ",'0'+(majver / 10),'0'+(majver mod 10),".",'0'+lance_version,".",'0'+version,CR,LF
  67.         db    '$'
  68.  
  69.     public    parse_args
  70. parse_args:
  71. ;exit with nc if all went well, cy otherwise.
  72.     assume    ds:code
  73.     mov    di,offset int_no
  74.     call    get_number
  75.     mov    di,offset io_addr
  76.     call    get_number
  77.     mov    di,offset dma_no
  78.     call    get_number
  79.     clc
  80.     ret
  81.  
  82. check_board:
  83.     clc
  84.     ret
  85.  
  86. code    ends
  87.  
  88.     end
  89.  
  90.