16f52b16cSGreg Kroah-Hartman /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */ 2607ca46eSDavid Howells #ifndef _LINUX_ATMBR2684_H 3607ca46eSDavid Howells #define _LINUX_ATMBR2684_H 4607ca46eSDavid Howells 5607ca46eSDavid Howells #include <linux/types.h> 6607ca46eSDavid Howells #include <linux/atm.h> 7607ca46eSDavid Howells #include <linux/if.h> /* For IFNAMSIZ */ 8607ca46eSDavid Howells 9607ca46eSDavid Howells /* 10607ca46eSDavid Howells * Type of media we're bridging (ethernet, token ring, etc) Currently only 11607ca46eSDavid Howells * ethernet is supported 12607ca46eSDavid Howells */ 13607ca46eSDavid Howells #define BR2684_MEDIA_ETHERNET (0) /* 802.3 */ 14607ca46eSDavid Howells #define BR2684_MEDIA_802_4 (1) /* 802.4 */ 15607ca46eSDavid Howells #define BR2684_MEDIA_TR (2) /* 802.5 - token ring */ 16607ca46eSDavid Howells #define BR2684_MEDIA_FDDI (3) 17607ca46eSDavid Howells #define BR2684_MEDIA_802_6 (4) /* 802.6 */ 18607ca46eSDavid Howells 19607ca46eSDavid Howells /* used only at device creation: */ 20607ca46eSDavid Howells #define BR2684_FLAG_ROUTED (1<<16) /* payload is routed, not bridged */ 21607ca46eSDavid Howells 22607ca46eSDavid Howells /* 23607ca46eSDavid Howells * Is there FCS inbound on this VC? This currently isn't supported. 24607ca46eSDavid Howells */ 25607ca46eSDavid Howells #define BR2684_FCSIN_NO (0) 26607ca46eSDavid Howells #define BR2684_FCSIN_IGNORE (1) 27607ca46eSDavid Howells #define BR2684_FCSIN_VERIFY (2) 28607ca46eSDavid Howells 29607ca46eSDavid Howells /* 30607ca46eSDavid Howells * Is there FCS outbound on this VC? This currently isn't supported. 31607ca46eSDavid Howells */ 32607ca46eSDavid Howells #define BR2684_FCSOUT_NO (0) 33607ca46eSDavid Howells #define BR2684_FCSOUT_SENDZERO (1) 34607ca46eSDavid Howells #define BR2684_FCSOUT_GENERATE (2) 35607ca46eSDavid Howells 36607ca46eSDavid Howells /* 37607ca46eSDavid Howells * Does this VC include LLC encapsulation? 38607ca46eSDavid Howells */ 39607ca46eSDavid Howells #define BR2684_ENCAPS_VC (0) /* VC-mux */ 40607ca46eSDavid Howells #define BR2684_ENCAPS_LLC (1) 41*7fac54b9SRong Tao #define BR2684_ENCAPS_AUTODETECT (2) /* Unsupported */ 42607ca46eSDavid Howells 43607ca46eSDavid Howells /* 44607ca46eSDavid Howells * Is this VC bridged or routed? 45607ca46eSDavid Howells */ 46607ca46eSDavid Howells 47607ca46eSDavid Howells #define BR2684_PAYLOAD_ROUTED (0) 48607ca46eSDavid Howells #define BR2684_PAYLOAD_BRIDGED (1) 49607ca46eSDavid Howells 50607ca46eSDavid Howells /* 51607ca46eSDavid Howells * This is for the ATM_NEWBACKENDIF call - these are like socket families: 52607ca46eSDavid Howells * the first element of the structure is the backend number and the rest 53607ca46eSDavid Howells * is per-backend specific 54607ca46eSDavid Howells */ 55607ca46eSDavid Howells struct atm_newif_br2684 { 56607ca46eSDavid Howells atm_backend_t backend_num; /* ATM_BACKEND_BR2684 */ 57607ca46eSDavid Howells int media; /* BR2684_MEDIA_*, flags in upper bits */ 58607ca46eSDavid Howells char ifname[IFNAMSIZ]; 59607ca46eSDavid Howells int mtu; 60607ca46eSDavid Howells }; 61607ca46eSDavid Howells 62607ca46eSDavid Howells /* 63607ca46eSDavid Howells * This structure is used to specify a br2684 interface - either by a 64607ca46eSDavid Howells * positive integer (returned by ATM_NEWBACKENDIF) or the interfaces name 65607ca46eSDavid Howells */ 66607ca46eSDavid Howells #define BR2684_FIND_BYNOTHING (0) 67607ca46eSDavid Howells #define BR2684_FIND_BYNUM (1) 68607ca46eSDavid Howells #define BR2684_FIND_BYIFNAME (2) 69607ca46eSDavid Howells struct br2684_if_spec { 70607ca46eSDavid Howells int method; /* BR2684_FIND_* */ 71607ca46eSDavid Howells union { 72607ca46eSDavid Howells char ifname[IFNAMSIZ]; 73607ca46eSDavid Howells int devnum; 74607ca46eSDavid Howells } spec; 75607ca46eSDavid Howells }; 76607ca46eSDavid Howells 77607ca46eSDavid Howells /* 78607ca46eSDavid Howells * This is for the ATM_SETBACKEND call - these are like socket families: 79607ca46eSDavid Howells * the first element of the structure is the backend number and the rest 80607ca46eSDavid Howells * is per-backend specific 81607ca46eSDavid Howells */ 82607ca46eSDavid Howells struct atm_backend_br2684 { 83607ca46eSDavid Howells atm_backend_t backend_num; /* ATM_BACKEND_BR2684 */ 84607ca46eSDavid Howells struct br2684_if_spec ifspec; 85607ca46eSDavid Howells int fcs_in; /* BR2684_FCSIN_* */ 86607ca46eSDavid Howells int fcs_out; /* BR2684_FCSOUT_* */ 87607ca46eSDavid Howells int fcs_auto; /* 1: fcs_{in,out} disabled if no FCS rx'ed */ 88607ca46eSDavid Howells int encaps; /* BR2684_ENCAPS_* */ 89607ca46eSDavid Howells int has_vpiid; /* 1: use vpn_id - Unsupported */ 90607ca46eSDavid Howells __u8 vpn_id[7]; 91607ca46eSDavid Howells int send_padding; /* unsupported */ 92607ca46eSDavid Howells int min_size; /* we will pad smaller packets than this */ 93607ca46eSDavid Howells }; 94607ca46eSDavid Howells 95607ca46eSDavid Howells /* 96607ca46eSDavid Howells * The BR2684_SETFILT ioctl is an experimental mechanism for folks 97607ca46eSDavid Howells * terminating a large number of IP-only vcc's. When netfilter allows 98607ca46eSDavid Howells * efficient per-if in/out filters, this support will be removed 99607ca46eSDavid Howells */ 100607ca46eSDavid Howells struct br2684_filter { 101607ca46eSDavid Howells __be32 prefix; /* network byte order */ 102607ca46eSDavid Howells __be32 netmask; /* 0 = disable filter */ 103607ca46eSDavid Howells }; 104607ca46eSDavid Howells 105607ca46eSDavid Howells struct br2684_filter_set { 106607ca46eSDavid Howells struct br2684_if_spec ifspec; 107607ca46eSDavid Howells struct br2684_filter filter; 108607ca46eSDavid Howells }; 109607ca46eSDavid Howells 110607ca46eSDavid Howells enum br2684_payload { 111607ca46eSDavid Howells p_routed = BR2684_PAYLOAD_ROUTED, 112607ca46eSDavid Howells p_bridged = BR2684_PAYLOAD_BRIDGED, 113607ca46eSDavid Howells }; 114607ca46eSDavid Howells 115607ca46eSDavid Howells #define BR2684_SETFILT _IOW( 'a', ATMIOC_BACKEND + 0, \ 116607ca46eSDavid Howells struct br2684_filter_set) 117607ca46eSDavid Howells 118607ca46eSDavid Howells #endif /* _LINUX_ATMBR2684_H */ 119