if_arcnet.h 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129
  1. /*
  2. * INET An implementation of the TCP/IP protocol suite for the LINUX
  3. * operating system. INET is implemented using the BSD Socket
  4. * interface as the means of communication with the user level.
  5. *
  6. * Global definitions for the ARCnet interface.
  7. *
  8. * Authors: David Woodhouse and Avery Pennarun
  9. *
  10. * This program is free software; you can redistribute it and/or
  11. * modify it under the terms of the GNU General Public License
  12. * as published by the Free Software Foundation; either version
  13. * 2 of the License, or (at your option) any later version.
  14. */
  15. #ifndef _LINUX_IF_ARCNET_H
  16. #define _LINUX_IF_ARCNET_H
  17. #include <linux/types.h>
  18. #include <linux/if_ether.h>
  19. /*
  20. * These are the defined ARCnet Protocol ID's.
  21. */
  22. /* CAP mode */
  23. /* No macro but uses 1-8 */
  24. /* RFC1201 Protocol ID's */
  25. #define ARC_P_IP 212 /* 0xD4 */
  26. #define ARC_P_IPV6 196 /* 0xC4: RFC2497 */
  27. #define ARC_P_ARP 213 /* 0xD5 */
  28. #define ARC_P_RARP 214 /* 0xD6 */
  29. #define ARC_P_IPX 250 /* 0xFA */
  30. #define ARC_P_NOVELL_EC 236 /* 0xEC */
  31. /* Old RFC1051 Protocol ID's */
  32. #define ARC_P_IP_RFC1051 240 /* 0xF0 */
  33. #define ARC_P_ARP_RFC1051 241 /* 0xF1 */
  34. /* MS LanMan/WfWg "NDIS" encapsulation */
  35. #define ARC_P_ETHER 232 /* 0xE8 */
  36. /* Unsupported/indirectly supported protocols */
  37. #define ARC_P_DATAPOINT_BOOT 0 /* very old Datapoint equipment */
  38. #define ARC_P_DATAPOINT_MOUNT 1
  39. #define ARC_P_POWERLAN_BEACON 8 /* Probably ATA-Netbios related */
  40. #define ARC_P_POWERLAN_BEACON2 243 /* 0xF3 */
  41. #define ARC_P_LANSOFT 251 /* 0xFB - what is this? */
  42. #define ARC_P_ATALK 0xDD
  43. /* Hardware address length */
  44. #define ARCNET_ALEN 1
  45. /*
  46. * The RFC1201-specific components of an arcnet packet header.
  47. */
  48. struct arc_rfc1201 {
  49. __u8 proto; /* protocol ID field - varies */
  50. __u8 split_flag; /* for use with split packets */
  51. __be16 sequence; /* sequence number */
  52. __u8 payload[0]; /* space remaining in packet (504 bytes)*/
  53. };
  54. #define RFC1201_HDR_SIZE 4
  55. /*
  56. * The RFC1051-specific components.
  57. */
  58. struct arc_rfc1051 {
  59. __u8 proto; /* ARC_P_RFC1051_ARP/RFC1051_IP */
  60. __u8 payload[0]; /* 507 bytes */
  61. };
  62. #define RFC1051_HDR_SIZE 1
  63. /*
  64. * The ethernet-encap-specific components. We have a real ethernet header
  65. * and some data.
  66. */
  67. struct arc_eth_encap {
  68. __u8 proto; /* Always ARC_P_ETHER */
  69. struct ethhdr eth; /* standard ethernet header (yuck!) */
  70. __u8 payload[0]; /* 493 bytes */
  71. };
  72. #define ETH_ENCAP_HDR_SIZE 14
  73. struct arc_cap {
  74. __u8 proto;
  75. __u8 cookie[sizeof(int)];
  76. /* Actually NOT sent over the network */
  77. union {
  78. __u8 ack;
  79. __u8 raw[0]; /* 507 bytes */
  80. } mes;
  81. };
  82. /*
  83. * The data needed by the actual arcnet hardware.
  84. *
  85. * Now, in the real arcnet hardware, the third and fourth bytes are the
  86. * 'offset' specification instead of the length, and the soft data is at
  87. * the _end_ of the 512-byte buffer. We hide this complexity inside the
  88. * driver.
  89. */
  90. struct arc_hardware {
  91. __u8 source; /* source ARCnet - filled in automagically */
  92. __u8 dest; /* destination ARCnet - 0 for broadcast */
  93. __u8 offset[2]; /* offset bytes (some weird semantics) */
  94. };
  95. #define ARC_HDR_SIZE 4
  96. /*
  97. * This is an ARCnet frame header, as seen by the kernel (and userspace,
  98. * when you do a raw packet capture).
  99. */
  100. struct archdr {
  101. /* hardware requirements */
  102. struct arc_hardware hard;
  103. /* arcnet encapsulation-specific bits */
  104. union {
  105. struct arc_rfc1201 rfc1201;
  106. struct arc_rfc1051 rfc1051;
  107. struct arc_eth_encap eth_encap;
  108. struct arc_cap cap;
  109. __u8 raw[0]; /* 508 bytes */
  110. } soft;
  111. };
  112. #endif /* _LINUX_IF_ARCNET_H */