home *** CD-ROM | disk | FTP | other *** search
/ Frozen Fish 1: Amiga / FrozenFish-Apr94.iso / bbs / alib / d5xx / d540 / sana.lha / SANA / sana2packetmagic.i < prev    next >
Text File  |  1991-08-27  |  2KB  |  90 lines

  1.     IFND    SANA2_SANA2PACKETMAGIC_I
  2. SANA2_SANA2PACKETMAGIC_I    SET    1
  3. **
  4. **    $Filename: sana2packetmagic.i $
  5. **    $Release: Developer Information$
  6. **    $Revision: 1.2 $
  7. **    $Date: 91/05/08 $
  8. **
  9. **    Defined types of magic for the Sana2PacketType structure.
  10. **
  11. **    (C) Copyright 1991 Commodore-Amiga Inc.
  12. **        All Rights Reserved
  13. **
  14.  
  15. **
  16. ** Contributions from:
  17. **    Raymond S. Brand,   rsbx@cbmvax.commodore.com,  (215) 431-9100
  18. **    Martin Hunt,      martin@cbmvax.commodore.com,  (215) 431-9100
  19. **    Perry Kivolowitz,           ASDG Incorporated,  (608) 273-6585
  20. **
  21.  
  22.     IFND    SANA2_SANA2DEVICE_I
  23.     INCLUDE    "sana2/sana2device.i"
  24.     ENDC    !SANA2_SANA2DEVICE_I
  25.  
  26.  
  27. ;
  28. ; The SANA-II Sana2PacketType structure Magic value is an unsigned 32
  29. ; number. The upper 16 bits identify the type of network wire to which
  30. ; the Magic value applies and the lower 16 bits identify the particular
  31. ; type of magic.
  32. ;
  33.  
  34.  
  35. ;
  36. ; defined types of ethernet magic
  37. ;
  38.  
  39. S2MAGIC_ETHERNET_E2    EQU    ((((S2WIRETYPE_ETHERNET)&$ffff)<<16)|$0000)
  40. ;
  41. ; For ethernet, this is the default case. Mask is ignored, Length is 2,
  42. ; Match points to a UWORD to match against the type field of the packet.
  43. ;
  44.  
  45. S2MAGIC_ETHERNET_8023    EQU    ((((S2WIRETYPE_ETHERNET)&$ffff)<<16)|$0001)
  46. ;
  47. ; The caller is declaring his intent to receive any of the valid 802.3
  48. ; ethernet packet types. The Match and Mask fields are ignored, Length
  49. ; is 0.
  50. ;
  51. ; SANA-II ethernet driver writers need to support a read queue for 802.3
  52. ; packets separate from packets of any non-802.3 type.
  53. ;
  54. ; A possible flow through an ethernet driver's read interrupt routine
  55. ; might look like the following:
  56. ;
  57. ;     ...
  58. ;
  59. ;     sniff packet type...
  60. ;
  61. ;     if (NoSpecificReadWaiting())
  62. ;         {
  63. ;         if (IsAn802() && 802ReadWaiting())
  64. ;             {
  65. ;             Return802();
  66. ;             }
  67. ;         else
  68. ;             {
  69. ;             if (OrphanReadWaiting())
  70. ;                 {
  71. ;                 ReturnOrphan();
  72. ;                 }
  73. ;             else
  74. ;                 {
  75. ;                 DropPacket();
  76. ;                 }
  77. ;             }
  78. ;         }
  79. ;     else
  80. ;         {
  81. ;         ReturnSpecificPacket();
  82. ;         }
  83. ;
  84. ;    ...
  85. ;
  86. ;
  87.  
  88.  
  89.     ENDC    SANA2_SANA2PACKETMAGIC_I
  90.