atmlec.h 2.5 KB

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