Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1 | #ifndef _LINUX_ATMBR2684_H |
| 2 | #define _LINUX_ATMBR2684_H |
| 3 | |
| 4 | #include <linux/atm.h> |
| 5 | #include <linux/if.h> /* For IFNAMSIZ */ |
| 6 | |
| 7 | /* |
| 8 | * Type of media we're bridging (ethernet, token ring, etc) Currently only |
| 9 | * ethernet is supported |
| 10 | */ |
| 11 | #define BR2684_MEDIA_ETHERNET (0) /* 802.3 */ |
| 12 | #define BR2684_MEDIA_802_4 (1) /* 802.4 */ |
| 13 | #define BR2684_MEDIA_TR (2) /* 802.5 - token ring */ |
| 14 | #define BR2684_MEDIA_FDDI (3) |
| 15 | #define BR2684_MEDIA_802_6 (4) /* 802.6 */ |
| 16 | |
Eric Kinzie | 097b19a | 2007-12-30 23:17:53 -0800 | [diff] [blame] | 17 | /* used only at device creation: */ |
Chas Williams | fb64c73 | 2007-12-30 23:18:29 -0800 | [diff] [blame] | 18 | #define BR2684_FLAG_ROUTED (1<<16) /* payload is routed, not bridged */ |
Eric Kinzie | 097b19a | 2007-12-30 23:17:53 -0800 | [diff] [blame] | 19 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 20 | /* |
| 21 | * Is there FCS inbound on this VC? This currently isn't supported. |
| 22 | */ |
| 23 | #define BR2684_FCSIN_NO (0) |
| 24 | #define BR2684_FCSIN_IGNORE (1) |
| 25 | #define BR2684_FCSIN_VERIFY (2) |
| 26 | |
| 27 | /* |
| 28 | * Is there FCS outbound on this VC? This currently isn't supported. |
| 29 | */ |
| 30 | #define BR2684_FCSOUT_NO (0) |
| 31 | #define BR2684_FCSOUT_SENDZERO (1) |
| 32 | #define BR2684_FCSOUT_GENERATE (2) |
| 33 | |
| 34 | /* |
| 35 | * Does this VC include LLC encapsulation? |
| 36 | */ |
| 37 | #define BR2684_ENCAPS_VC (0) /* VC-mux */ |
| 38 | #define BR2684_ENCAPS_LLC (1) |
| 39 | #define BR2684_ENCAPS_AUTODETECT (2) /* Unsuported */ |
| 40 | |
| 41 | /* |
Eric Kinzie | 097b19a | 2007-12-30 23:17:53 -0800 | [diff] [blame] | 42 | * Is this VC bridged or routed? |
| 43 | */ |
| 44 | |
| 45 | #define BR2684_PAYLOAD_ROUTED (0) |
| 46 | #define BR2684_PAYLOAD_BRIDGED (1) |
| 47 | |
Eric Kinzie | 097b19a | 2007-12-30 23:17:53 -0800 | [diff] [blame] | 48 | /* |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 49 | * This is for the ATM_NEWBACKENDIF call - these are like socket families: |
| 50 | * the first element of the structure is the backend number and the rest |
| 51 | * is per-backend specific |
| 52 | */ |
| 53 | struct atm_newif_br2684 { |
Chas Williams | fb64c73 | 2007-12-30 23:18:29 -0800 | [diff] [blame] | 54 | atm_backend_t backend_num; /* ATM_BACKEND_BR2684 */ |
| 55 | int media; /* BR2684_MEDIA_*, flags in upper bits */ |
| 56 | char ifname[IFNAMSIZ]; |
| 57 | int mtu; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 58 | }; |
| 59 | |
| 60 | /* |
| 61 | * This structure is used to specify a br2684 interface - either by a |
| 62 | * positive integer (returned by ATM_NEWBACKENDIF) or the interfaces name |
| 63 | */ |
| 64 | #define BR2684_FIND_BYNOTHING (0) |
| 65 | #define BR2684_FIND_BYNUM (1) |
| 66 | #define BR2684_FIND_BYIFNAME (2) |
| 67 | struct br2684_if_spec { |
Chas Williams | fb64c73 | 2007-12-30 23:18:29 -0800 | [diff] [blame] | 68 | int method; /* BR2684_FIND_* */ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 69 | union { |
Chas Williams | fb64c73 | 2007-12-30 23:18:29 -0800 | [diff] [blame] | 70 | char ifname[IFNAMSIZ]; |
| 71 | int devnum; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 72 | } spec; |
| 73 | }; |
| 74 | |
| 75 | /* |
| 76 | * This is for the ATM_SETBACKEND call - these are like socket families: |
| 77 | * the first element of the structure is the backend number and the rest |
| 78 | * is per-backend specific |
| 79 | */ |
| 80 | struct atm_backend_br2684 { |
Chas Williams | fb64c73 | 2007-12-30 23:18:29 -0800 | [diff] [blame] | 81 | atm_backend_t backend_num; /* ATM_BACKEND_BR2684 */ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 82 | struct br2684_if_spec ifspec; |
Chas Williams | fb64c73 | 2007-12-30 23:18:29 -0800 | [diff] [blame] | 83 | int fcs_in; /* BR2684_FCSIN_* */ |
| 84 | int fcs_out; /* BR2684_FCSOUT_* */ |
| 85 | int fcs_auto; /* 1: fcs_{in,out} disabled if no FCS rx'ed */ |
| 86 | int encaps; /* BR2684_ENCAPS_* */ |
| 87 | int has_vpiid; /* 1: use vpn_id - Unsupported */ |
| 88 | __u8 vpn_id[7]; |
| 89 | int send_padding; /* unsupported */ |
| 90 | int min_size; /* we will pad smaller packets than this */ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 91 | }; |
| 92 | |
| 93 | /* |
| 94 | * The BR2684_SETFILT ioctl is an experimental mechanism for folks |
| 95 | * terminating a large number of IP-only vcc's. When netfilter allows |
| 96 | * efficient per-if in/out filters, this support will be removed |
| 97 | */ |
| 98 | struct br2684_filter { |
Chas Williams | fb64c73 | 2007-12-30 23:18:29 -0800 | [diff] [blame] | 99 | __be32 prefix; /* network byte order */ |
| 100 | __be32 netmask; /* 0 = disable filter */ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 101 | }; |
| 102 | |
| 103 | struct br2684_filter_set { |
| 104 | struct br2684_if_spec ifspec; |
| 105 | struct br2684_filter filter; |
| 106 | }; |
| 107 | |
Eric Kinzie | 097b19a | 2007-12-30 23:17:53 -0800 | [diff] [blame] | 108 | enum br2684_payload { |
Chas Williams | fb64c73 | 2007-12-30 23:18:29 -0800 | [diff] [blame] | 109 | p_routed = BR2684_PAYLOAD_ROUTED, |
| 110 | p_bridged = BR2684_PAYLOAD_BRIDGED, |
Eric Kinzie | 097b19a | 2007-12-30 23:17:53 -0800 | [diff] [blame] | 111 | }; |
| 112 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 113 | #define BR2684_SETFILT _IOW( 'a', ATMIOC_BACKEND + 0, \ |
| 114 | struct br2684_filter_set) |
| 115 | |
| 116 | #endif /* _LINUX_ATMBR2684_H */ |