atmlec.h 3.0 KB

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