1*6f52b16cSGreg Kroah-Hartman /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */ 2607ca46eSDavid Howells #ifndef _ATMMPC_H_ 3607ca46eSDavid Howells #define _ATMMPC_H_ 4607ca46eSDavid Howells 5607ca46eSDavid Howells #include <linux/atmapi.h> 6607ca46eSDavid Howells #include <linux/atmioc.h> 7607ca46eSDavid Howells #include <linux/atm.h> 8607ca46eSDavid Howells #include <linux/types.h> 9607ca46eSDavid Howells 10607ca46eSDavid Howells #define ATMMPC_CTRL _IO('a', ATMIOC_MPOA) 11607ca46eSDavid Howells #define ATMMPC_DATA _IO('a', ATMIOC_MPOA+1) 12607ca46eSDavid Howells 13607ca46eSDavid Howells #define MPC_SOCKET_INGRESS 1 14607ca46eSDavid Howells #define MPC_SOCKET_EGRESS 2 15607ca46eSDavid Howells 16607ca46eSDavid Howells struct atmmpc_ioc { 17607ca46eSDavid Howells int dev_num; 18607ca46eSDavid Howells __be32 ipaddr; /* the IP address of the shortcut */ 19607ca46eSDavid Howells int type; /* ingress or egress */ 20607ca46eSDavid Howells }; 21607ca46eSDavid Howells 22607ca46eSDavid Howells typedef struct in_ctrl_info { 23607ca46eSDavid Howells __u8 Last_NHRP_CIE_code; 24607ca46eSDavid Howells __u8 Last_Q2931_cause_value; 25607ca46eSDavid Howells __u8 eg_MPC_ATM_addr[ATM_ESA_LEN]; 26607ca46eSDavid Howells __be32 tag; 27607ca46eSDavid Howells __be32 in_dst_ip; /* IP address this ingress MPC sends packets to */ 28607ca46eSDavid Howells __u16 holding_time; 29607ca46eSDavid Howells __u32 request_id; 30607ca46eSDavid Howells } in_ctrl_info; 31607ca46eSDavid Howells 32607ca46eSDavid Howells typedef struct eg_ctrl_info { 33607ca46eSDavid Howells __u8 DLL_header[256]; 34607ca46eSDavid Howells __u8 DH_length; 35607ca46eSDavid Howells __be32 cache_id; 36607ca46eSDavid Howells __be32 tag; 37607ca46eSDavid Howells __be32 mps_ip; 38607ca46eSDavid Howells __be32 eg_dst_ip; /* IP address to which ingress MPC sends packets */ 39607ca46eSDavid Howells __u8 in_MPC_data_ATM_addr[ATM_ESA_LEN]; 40607ca46eSDavid Howells __u16 holding_time; 41607ca46eSDavid Howells } eg_ctrl_info; 42607ca46eSDavid Howells 43607ca46eSDavid Howells struct mpc_parameters { 44607ca46eSDavid Howells __u16 mpc_p1; /* Shortcut-Setup Frame Count */ 45607ca46eSDavid Howells __u16 mpc_p2; /* Shortcut-Setup Frame Time */ 46607ca46eSDavid Howells __u8 mpc_p3[8]; /* Flow-detection Protocols */ 47607ca46eSDavid Howells __u16 mpc_p4; /* MPC Initial Retry Time */ 48607ca46eSDavid Howells __u16 mpc_p5; /* MPC Retry Time Maximum */ 49607ca46eSDavid Howells __u16 mpc_p6; /* Hold Down Time */ 50607ca46eSDavid Howells } ; 51607ca46eSDavid Howells 52607ca46eSDavid Howells struct k_message { 53607ca46eSDavid Howells __u16 type; 54607ca46eSDavid Howells __be32 ip_mask; 55607ca46eSDavid Howells __u8 MPS_ctrl[ATM_ESA_LEN]; 56607ca46eSDavid Howells union { 57607ca46eSDavid Howells in_ctrl_info in_info; 58607ca46eSDavid Howells eg_ctrl_info eg_info; 59607ca46eSDavid Howells struct mpc_parameters params; 60607ca46eSDavid Howells } content; 61607ca46eSDavid Howells struct atm_qos qos; 62607ca46eSDavid Howells } __ATM_API_ALIGN; 63607ca46eSDavid Howells 64607ca46eSDavid Howells struct llc_snap_hdr { 65607ca46eSDavid Howells /* RFC 1483 LLC/SNAP encapsulation for routed IP PDUs */ 66607ca46eSDavid Howells __u8 dsap; /* Destination Service Access Point (0xAA) */ 67607ca46eSDavid Howells __u8 ssap; /* Source Service Access Point (0xAA) */ 68607ca46eSDavid Howells __u8 ui; /* Unnumbered Information (0x03) */ 69607ca46eSDavid Howells __u8 org[3]; /* Organizational identification (0x000000) */ 70607ca46eSDavid Howells __u8 type[2]; /* Ether type (for IP) (0x0800) */ 71607ca46eSDavid Howells }; 72607ca46eSDavid Howells 73607ca46eSDavid Howells /* TLVs this MPC recognizes */ 74607ca46eSDavid Howells #define TLV_MPOA_DEVICE_TYPE 0x00a03e2a 75607ca46eSDavid Howells 76607ca46eSDavid Howells /* MPOA device types in MPOA Device Type TLV */ 77607ca46eSDavid Howells #define NON_MPOA 0 78607ca46eSDavid Howells #define MPS 1 79607ca46eSDavid Howells #define MPC 2 80607ca46eSDavid Howells #define MPS_AND_MPC 3 81607ca46eSDavid Howells 82607ca46eSDavid Howells 83607ca46eSDavid Howells /* MPC parameter defaults */ 84607ca46eSDavid Howells 85607ca46eSDavid Howells #define MPC_P1 10 /* Shortcut-Setup Frame Count */ 86607ca46eSDavid Howells #define MPC_P2 1 /* Shortcut-Setup Frame Time */ 87607ca46eSDavid Howells #define MPC_P3 0 /* Flow-detection Protocols */ 88607ca46eSDavid Howells #define MPC_P4 5 /* MPC Initial Retry Time */ 89607ca46eSDavid Howells #define MPC_P5 40 /* MPC Retry Time Maximum */ 90607ca46eSDavid Howells #define MPC_P6 160 /* Hold Down Time */ 91607ca46eSDavid Howells #define HOLDING_TIME_DEFAULT 1200 /* same as MPS-p7 */ 92607ca46eSDavid Howells 93607ca46eSDavid Howells /* MPC constants */ 94607ca46eSDavid Howells 95607ca46eSDavid Howells #define MPC_C1 2 /* Retry Time Multiplier */ 96607ca46eSDavid Howells #define MPC_C2 60 /* Initial Keep-Alive Lifetime */ 97607ca46eSDavid Howells 98607ca46eSDavid Howells /* Message types - to MPOA daemon */ 99607ca46eSDavid Howells 100607ca46eSDavid Howells #define SND_MPOA_RES_RQST 201 101607ca46eSDavid Howells #define SET_MPS_CTRL_ADDR 202 102607ca46eSDavid Howells #define SND_MPOA_RES_RTRY 203 /* Different type in a retry due to req id */ 103607ca46eSDavid Howells #define STOP_KEEP_ALIVE_SM 204 104607ca46eSDavid Howells #define EGRESS_ENTRY_REMOVED 205 105607ca46eSDavid Howells #define SND_EGRESS_PURGE 206 106607ca46eSDavid Howells #define DIE 207 /* tell the daemon to exit() */ 107607ca46eSDavid Howells #define DATA_PLANE_PURGE 208 /* Data plane purge because of egress cache hit miss or dead MPS */ 108607ca46eSDavid Howells #define OPEN_INGRESS_SVC 209 109607ca46eSDavid Howells 110607ca46eSDavid Howells /* Message types - from MPOA daemon */ 111607ca46eSDavid Howells 112607ca46eSDavid Howells #define MPOA_TRIGGER_RCVD 101 113607ca46eSDavid Howells #define MPOA_RES_REPLY_RCVD 102 114607ca46eSDavid Howells #define INGRESS_PURGE_RCVD 103 115607ca46eSDavid Howells #define EGRESS_PURGE_RCVD 104 116607ca46eSDavid Howells #define MPS_DEATH 105 117607ca46eSDavid Howells #define CACHE_IMPOS_RCVD 106 118607ca46eSDavid Howells #define SET_MPC_CTRL_ADDR 107 /* Our MPC's control ATM address */ 119607ca46eSDavid Howells #define SET_MPS_MAC_ADDR 108 120607ca46eSDavid Howells #define CLEAN_UP_AND_EXIT 109 121607ca46eSDavid Howells #define SET_MPC_PARAMS 110 /* MPC configuration parameters */ 122607ca46eSDavid Howells 123607ca46eSDavid Howells /* Message types - bidirectional */ 124607ca46eSDavid Howells 125607ca46eSDavid Howells #define RELOAD 301 /* kill -HUP the daemon for reload */ 126607ca46eSDavid Howells 127607ca46eSDavid Howells #endif /* _ATMMPC_H_ */ 128