home *** CD-ROM | disk | FTP | other *** search
/ Power-Programmierung / CD1.mdf / lan / drivrs30 / generic.asm < prev    next >
Assembly Source File  |  1989-06-08  |  2KB  |  102 lines

  1. version    equ    0
  2.  
  3.     include    defs.asm
  4.  
  5. code    segment    byte public
  6.     assume    cs:code, ds:code
  7.  
  8.     public    int_no
  9. int_no    db    0,0,0,0            ;must be four bytes long for get_number.
  10.  
  11.     public    driver_class, driver_type, driver_name
  12. driver_class    db    0        ;from the packet spec
  13. driver_type    db    0        ;from the packet spec
  14. driver_name    db    'generic',0    ;name of the driver.
  15.  
  16.     public    send_pkt
  17. send_pkt:
  18. ;enter with ds:si -> packet, cx = packet length.
  19. ;exit with nc if ok, or else cy if error, dh set to error number.
  20.     assume    ds:nothing
  21.     ret
  22.  
  23.  
  24.     public    get_address
  25. get_address:
  26. ;get the address of the interface.
  27. ;enter with es:di -> place to get the address, cx = size of address buffer.
  28. ;exit with nc, cx = actual size of address, or cy if buffer not big enough.
  29.     assume    ds:code
  30.     ret
  31.  
  32.  
  33.     public    set_address
  34. set_address:
  35. ;enter with ds:si -> Ethernet address, CX = length of address.
  36. ;exit with nc if okay, or cy, dh=error if any errors.
  37.     assume    ds:nothing
  38.     ret
  39.  
  40.  
  41.     public    reset_interface
  42. reset_interface:
  43. ;reset the interface.
  44.     assume    ds:code
  45.     ret
  46.  
  47.  
  48. ;called when we want to determine what to do with a received packet.
  49. ;enter with cx = packet length, es:di -> packet type.
  50.     extrn    recv_find: near
  51.  
  52. ;called after we have copied the packet into the buffer.
  53. ;enter with ds:si ->the packet, cx = length of the packet.
  54.     extrn    recv_copy: near
  55.  
  56.     extrn    count_in_err: near
  57.     extrn    count_out_err: near
  58.  
  59.     public    recv
  60. recv:
  61. ;called from the recv isr.  All registers have been saved, and ds=cs.
  62. ;Upon exit, the interrupt will be acknowledged.
  63.     assume    ds:code
  64.     ret
  65.  
  66.  
  67. ;any code after this will not be kept after initialization.
  68. end_resident    label    byte
  69.  
  70.  
  71.     public    usage_msg
  72. usage_msg    db    "usage: generic <packet_int_no>",CR,LF,'$'
  73.  
  74.     public    copyright_msg
  75. copyright_msg    db    "Packet driver for a generic device, version ",'0'+version,CR,LF,'$'
  76.         db    "Portions Copyright 19xx, J. Random Hacker",CR,LF,'$'
  77.  
  78.     extrn    set_recv_isr: near
  79.  
  80. ;enter with si -> argument string, di -> wword to store.
  81. ;if there is no number, don't change the number.
  82.     extrn    get_number: near
  83.  
  84.     public    parse_args
  85. parse_args:
  86.     ret
  87.  
  88.  
  89.     public    etopen
  90. etopen:
  91. ;if all is okay,
  92.     mov    dx,offset end_resident
  93.     clc
  94.     ret
  95. ;if we got an error,
  96.     stc
  97.     ret
  98.  
  99. code    ends
  100.  
  101.     end
  102.