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