atmlec.h 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. /*
  2. * ATM Lan Emulation Daemon driver interface
  3. *
  4. * Marko Kiiskila <mkiiskila@yahoo.com>
  5. */
  6. #ifndef _ATMLEC_H_
  7. #define _ATMLEC_H_
  8. #include <linux/atmapi.h>
  9. #include <linux/atmioc.h>
  10. #include <linux/atm.h>
  11. #include <linux/if_ether.h>
  12. #include <linux/types.h>
  13. /* ATM lec daemon control socket */
  14. #define ATMLEC_CTRL _IO('a', ATMIOC_LANE)
  15. #define ATMLEC_DATA _IO('a', ATMIOC_LANE+1)
  16. #define ATMLEC_MCAST _IO('a', ATMIOC_LANE+2)
  17. /* Maximum number of LEC interfaces (tweakable) */
  18. #define MAX_LEC_ITF 48
  19. /*
  20. * From the total of MAX_LEC_ITF, last NUM_TR_DEVS are reserved for Token Ring.
  21. * E.g. if MAX_LEC_ITF = 48 and NUM_TR_DEVS = 8, then lec0-lec39 are for
  22. * Ethernet ELANs and lec40-lec47 are for Token Ring ELANS.
  23. */
  24. #define NUM_TR_DEVS 8
  25. typedef enum {
  26. l_set_mac_addr,
  27. l_del_mac_addr,
  28. l_svc_setup,
  29. l_addr_delete,
  30. l_topology_change,
  31. l_flush_complete,
  32. l_arp_update,
  33. l_narp_req, /* LANE2 mandates the use of this */
  34. l_config,
  35. l_flush_tran_id,
  36. l_set_lecid,
  37. l_arp_xmt,
  38. l_rdesc_arp_xmt,
  39. l_associate_req,
  40. l_should_bridge /* should we bridge this MAC? */
  41. } atmlec_msg_type;
  42. #define ATMLEC_MSG_TYPE_MAX l_should_bridge
  43. struct atmlec_config_msg {
  44. unsigned int maximum_unknown_frame_count;
  45. unsigned int max_unknown_frame_time;
  46. unsigned short max_retry_count;
  47. unsigned int aging_time;
  48. unsigned int forward_delay_time;
  49. unsigned int arp_response_time;
  50. unsigned int flush_timeout;
  51. unsigned int path_switching_delay;
  52. unsigned int lane_version; /* LANE2: 1 for LANEv1, 2 for LANEv2 */
  53. int mtu;
  54. int is_proxy;
  55. };
  56. struct atmlec_msg {
  57. atmlec_msg_type type;
  58. int sizeoftlvs; /* LANE2: if != 0, tlvs follow */
  59. union {
  60. struct {
  61. unsigned char mac_addr[ETH_ALEN];
  62. unsigned char atm_addr[ATM_ESA_LEN];
  63. unsigned int flag; /*
  64. * Topology_change flag,
  65. * remoteflag, permanent flag,
  66. * lecid, transaction id
  67. */
  68. unsigned int targetless_le_arp; /* LANE2 */
  69. unsigned int no_source_le_narp; /* LANE2 */
  70. } normal;
  71. struct atmlec_config_msg config;
  72. struct {
  73. __u16 lec_id; /* requestor lec_id */
  74. __u32 tran_id; /* transaction id */
  75. unsigned char mac_addr[ETH_ALEN]; /* dst mac addr */
  76. unsigned char atm_addr[ATM_ESA_LEN]; /* reqestor ATM addr */
  77. } proxy; /*
  78. * For mapping LE_ARP requests to responses. Filled by
  79. * zeppelin, returned by kernel. Used only when proxying
  80. */
  81. } content;
  82. } __ATM_API_ALIGN;
  83. struct atmlec_ioc {
  84. int dev_num;
  85. unsigned char atm_addr[ATM_ESA_LEN];
  86. unsigned char receive; /* 1= receive vcc, 0 = send vcc */
  87. };
  88. #endif /* _ATMLEC_H_ */