Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1 | #ifndef _ATMMPC_H_ |
| 2 | #define _ATMMPC_H_ |
| 3 | |
| 4 | #include <linux/atmapi.h> |
| 5 | #include <linux/atmioc.h> |
| 6 | #include <linux/atm.h> |
Arnd Bergmann | 9adfbfb | 2009-02-26 00:51:40 +0100 | [diff] [blame^] | 7 | #include <linux/types.h> |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 8 | |
| 9 | #define ATMMPC_CTRL _IO('a', ATMIOC_MPOA) |
| 10 | #define ATMMPC_DATA _IO('a', ATMIOC_MPOA+1) |
| 11 | |
| 12 | #define MPC_SOCKET_INGRESS 1 |
| 13 | #define MPC_SOCKET_EGRESS 2 |
| 14 | |
| 15 | struct atmmpc_ioc { |
| 16 | int dev_num; |
Al Viro | 30d492d | 2006-11-14 21:11:29 -0800 | [diff] [blame] | 17 | __be32 ipaddr; /* the IP address of the shortcut */ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 18 | int type; /* ingress or egress */ |
| 19 | }; |
| 20 | |
| 21 | typedef struct in_ctrl_info { |
Arnd Bergmann | 9adfbfb | 2009-02-26 00:51:40 +0100 | [diff] [blame^] | 22 | __u8 Last_NHRP_CIE_code; |
| 23 | __u8 Last_Q2931_cause_value; |
| 24 | __u8 eg_MPC_ATM_addr[ATM_ESA_LEN]; |
Al Viro | 30d492d | 2006-11-14 21:11:29 -0800 | [diff] [blame] | 25 | __be32 tag; |
| 26 | __be32 in_dst_ip; /* IP address this ingress MPC sends packets to */ |
Arnd Bergmann | 9adfbfb | 2009-02-26 00:51:40 +0100 | [diff] [blame^] | 27 | __u16 holding_time; |
| 28 | __u32 request_id; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 29 | } in_ctrl_info; |
| 30 | |
| 31 | typedef struct eg_ctrl_info { |
Arnd Bergmann | 9adfbfb | 2009-02-26 00:51:40 +0100 | [diff] [blame^] | 32 | __u8 DLL_header[256]; |
| 33 | __u8 DH_length; |
Al Viro | 30d492d | 2006-11-14 21:11:29 -0800 | [diff] [blame] | 34 | __be32 cache_id; |
| 35 | __be32 tag; |
| 36 | __be32 mps_ip; |
| 37 | __be32 eg_dst_ip; /* IP address to which ingress MPC sends packets */ |
Arnd Bergmann | 9adfbfb | 2009-02-26 00:51:40 +0100 | [diff] [blame^] | 38 | __u8 in_MPC_data_ATM_addr[ATM_ESA_LEN]; |
| 39 | __u16 holding_time; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 40 | } eg_ctrl_info; |
| 41 | |
| 42 | struct mpc_parameters { |
Arnd Bergmann | 9adfbfb | 2009-02-26 00:51:40 +0100 | [diff] [blame^] | 43 | __u16 mpc_p1; /* Shortcut-Setup Frame Count */ |
| 44 | __u16 mpc_p2; /* Shortcut-Setup Frame Time */ |
| 45 | __u8 mpc_p3[8]; /* Flow-detection Protocols */ |
| 46 | __u16 mpc_p4; /* MPC Initial Retry Time */ |
| 47 | __u16 mpc_p5; /* MPC Retry Time Maximum */ |
| 48 | __u16 mpc_p6; /* Hold Down Time */ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 49 | } ; |
| 50 | |
| 51 | struct k_message { |
Arnd Bergmann | 9adfbfb | 2009-02-26 00:51:40 +0100 | [diff] [blame^] | 52 | __u16 type; |
Al Viro | 30d492d | 2006-11-14 21:11:29 -0800 | [diff] [blame] | 53 | __be32 ip_mask; |
Arnd Bergmann | 9adfbfb | 2009-02-26 00:51:40 +0100 | [diff] [blame^] | 54 | __u8 MPS_ctrl[ATM_ESA_LEN]; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 55 | union { |
| 56 | in_ctrl_info in_info; |
| 57 | eg_ctrl_info eg_info; |
| 58 | struct mpc_parameters params; |
| 59 | } content; |
| 60 | struct atm_qos qos; |
| 61 | } __ATM_API_ALIGN; |
| 62 | |
| 63 | struct llc_snap_hdr { |
| 64 | /* RFC 1483 LLC/SNAP encapsulation for routed IP PDUs */ |
Arnd Bergmann | 9adfbfb | 2009-02-26 00:51:40 +0100 | [diff] [blame^] | 65 | __u8 dsap; /* Destination Service Access Point (0xAA) */ |
| 66 | __u8 ssap; /* Source Service Access Point (0xAA) */ |
| 67 | __u8 ui; /* Unnumbered Information (0x03) */ |
| 68 | __u8 org[3]; /* Organizational identification (0x000000) */ |
| 69 | __u8 type[2]; /* Ether type (for IP) (0x0800) */ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 70 | }; |
| 71 | |
| 72 | /* TLVs this MPC recognizes */ |
| 73 | #define TLV_MPOA_DEVICE_TYPE 0x00a03e2a |
| 74 | |
| 75 | /* MPOA device types in MPOA Device Type TLV */ |
| 76 | #define NON_MPOA 0 |
| 77 | #define MPS 1 |
| 78 | #define MPC 2 |
| 79 | #define MPS_AND_MPC 3 |
| 80 | |
| 81 | |
| 82 | /* MPC parameter defaults */ |
| 83 | |
| 84 | #define MPC_P1 10 /* Shortcut-Setup Frame Count */ |
| 85 | #define MPC_P2 1 /* Shortcut-Setup Frame Time */ |
| 86 | #define MPC_P3 0 /* Flow-detection Protocols */ |
| 87 | #define MPC_P4 5 /* MPC Initial Retry Time */ |
| 88 | #define MPC_P5 40 /* MPC Retry Time Maximum */ |
| 89 | #define MPC_P6 160 /* Hold Down Time */ |
| 90 | #define HOLDING_TIME_DEFAULT 1200 /* same as MPS-p7 */ |
| 91 | |
| 92 | /* MPC constants */ |
| 93 | |
| 94 | #define MPC_C1 2 /* Retry Time Multiplier */ |
| 95 | #define MPC_C2 60 /* Initial Keep-Alive Lifetime */ |
| 96 | |
| 97 | /* Message types - to MPOA daemon */ |
| 98 | |
| 99 | #define SND_MPOA_RES_RQST 201 |
| 100 | #define SET_MPS_CTRL_ADDR 202 |
| 101 | #define SND_MPOA_RES_RTRY 203 /* Different type in a retry due to req id */ |
| 102 | #define STOP_KEEP_ALIVE_SM 204 |
| 103 | #define EGRESS_ENTRY_REMOVED 205 |
| 104 | #define SND_EGRESS_PURGE 206 |
| 105 | #define DIE 207 /* tell the daemon to exit() */ |
| 106 | #define DATA_PLANE_PURGE 208 /* Data plane purge because of egress cache hit miss or dead MPS */ |
| 107 | #define OPEN_INGRESS_SVC 209 |
| 108 | |
| 109 | /* Message types - from MPOA daemon */ |
| 110 | |
| 111 | #define MPOA_TRIGGER_RCVD 101 |
| 112 | #define MPOA_RES_REPLY_RCVD 102 |
| 113 | #define INGRESS_PURGE_RCVD 103 |
| 114 | #define EGRESS_PURGE_RCVD 104 |
| 115 | #define MPS_DEATH 105 |
| 116 | #define CACHE_IMPOS_RCVD 106 |
| 117 | #define SET_MPC_CTRL_ADDR 107 /* Our MPC's control ATM address */ |
| 118 | #define SET_MPS_MAC_ADDR 108 |
| 119 | #define CLEAN_UP_AND_EXIT 109 |
| 120 | #define SET_MPC_PARAMS 110 /* MPC configuration parameters */ |
| 121 | |
| 122 | /* Message types - bidirectional */ |
| 123 | |
| 124 | #define RELOAD 301 /* kill -HUP the daemon for reload */ |
| 125 | |
| 126 | #endif /* _ATMMPC_H_ */ |