![]() |
|
|||
0001 /* SPDX-License-Identifier: GPL-2.0 */ 0002 /* 0003 * Lan Emulation client header file 0004 * 0005 * Marko Kiiskila <mkiiskila@yahoo.com> 0006 */ 0007 0008 #ifndef _LEC_H_ 0009 #define _LEC_H_ 0010 0011 #include <linux/atmdev.h> 0012 #include <linux/netdevice.h> 0013 #include <linux/atmlec.h> 0014 0015 #define LEC_HEADER_LEN 16 0016 0017 struct lecdatahdr_8023 { 0018 __be16 le_header; 0019 unsigned char h_dest[ETH_ALEN]; 0020 unsigned char h_source[ETH_ALEN]; 0021 __be16 h_type; 0022 }; 0023 0024 struct lecdatahdr_8025 { 0025 __be16 le_header; 0026 unsigned char ac_pad; 0027 unsigned char fc; 0028 unsigned char h_dest[ETH_ALEN]; 0029 unsigned char h_source[ETH_ALEN]; 0030 }; 0031 0032 #define LEC_MINIMUM_8023_SIZE 62 0033 #define LEC_MINIMUM_8025_SIZE 16 0034 0035 /* 0036 * Operations that LANE2 capable device can do. Two first functions 0037 * are used to make the device do things. See spec 3.1.3 and 3.1.4. 0038 * 0039 * The third function is intended for the MPOA component sitting on 0040 * top of the LANE device. The MPOA component assigns it's own function 0041 * to (*associate_indicator)() and the LANE device will use that 0042 * function to tell about TLVs it sees floating through. 0043 * 0044 */ 0045 struct lane2_ops { 0046 int (*resolve) (struct net_device *dev, const u8 *dst_mac, int force, 0047 u8 **tlvs, u32 *sizeoftlvs); 0048 int (*associate_req) (struct net_device *dev, const u8 *lan_dst, 0049 const u8 *tlvs, u32 sizeoftlvs); 0050 void (*associate_indicator) (struct net_device *dev, const u8 *mac_addr, 0051 const u8 *tlvs, u32 sizeoftlvs); 0052 }; 0053 0054 /* 0055 * ATM LAN Emulation supports both LLC & Dix Ethernet EtherType 0056 * frames. 0057 * 0058 * 1. Dix Ethernet EtherType frames encoded by placing EtherType 0059 * field in h_type field. Data follows immediately after header. 0060 * 2. LLC Data frames whose total length, including LLC field and data, 0061 * but not padding required to meet the minimum data frame length, 0062 * is less than ETH_P_802_3_MIN MUST be encoded by placing that length 0063 * in the h_type field. The LLC field follows header immediately. 0064 * 3. LLC data frames longer than this maximum MUST be encoded by placing 0065 * the value 0 in the h_type field. 0066 * 0067 */ 0068 0069 /* Hash table size */ 0070 #define LEC_ARP_TABLE_SIZE 16 0071 0072 struct lec_priv { 0073 unsigned short lecid; /* Lecid of this client */ 0074 struct hlist_head lec_arp_empty_ones; 0075 /* Used for storing VCC's that don't have a MAC address attached yet */ 0076 struct hlist_head lec_arp_tables[LEC_ARP_TABLE_SIZE]; 0077 /* Actual LE ARP table */ 0078 struct hlist_head lec_no_forward; 0079 /* 0080 * Used for storing VCC's (and forward packets from) which are to 0081 * age out by not using them to forward packets. 0082 * This is because to some LE clients there will be 2 VCCs. Only 0083 * one of them gets used. 0084 */ 0085 struct hlist_head mcast_fwds; 0086 /* 0087 * With LANEv2 it is possible that BUS (or a special multicast server) 0088 * establishes multiple Multicast Forward VCCs to us. This list 0089 * collects all those VCCs. LANEv1 client has only one item in this 0090 * list. These entries are not aged out. 0091 */ 0092 spinlock_t lec_arp_lock; 0093 struct atm_vcc *mcast_vcc; /* Default Multicast Send VCC */ 0094 struct atm_vcc *lecd; 0095 struct delayed_work lec_arp_work; /* C10 */ 0096 unsigned int maximum_unknown_frame_count; 0097 /* 0098 * Within the period of time defined by this variable, the client will send 0099 * no more than C10 frames to BUS for a given unicast destination. (C11) 0100 */ 0101 unsigned long max_unknown_frame_time; 0102 /* 0103 * If no traffic has been sent in this vcc for this period of time, 0104 * vcc will be torn down (C12) 0105 */ 0106 unsigned long vcc_timeout_period; 0107 /* 0108 * An LE Client MUST not retry an LE_ARP_REQUEST for a 0109 * given frame's LAN Destination more than maximum retry count times, 0110 * after the first LEC_ARP_REQUEST (C13) 0111 */ 0112 unsigned short max_retry_count; 0113 /* 0114 * Max time the client will maintain an entry in its arp cache in 0115 * absence of a verification of that relationship (C17) 0116 */ 0117 unsigned long aging_time; 0118 /* 0119 * Max time the client will maintain an entry in cache when 0120 * topology change flag is true (C18) 0121 */ 0122 unsigned long forward_delay_time; /* Topology change flag (C19) */ 0123 int topology_change; 0124 /* 0125 * Max time the client expects an LE_ARP_REQUEST/LE_ARP_RESPONSE 0126 * cycle to take (C20) 0127 */ 0128 unsigned long arp_response_time; 0129 /* 0130 * Time limit ot wait to receive an LE_FLUSH_RESPONSE after the 0131 * LE_FLUSH_REQUEST has been sent before taking recover action. (C21) 0132 */ 0133 unsigned long flush_timeout; 0134 /* The time since sending a frame to the bus after which the 0135 * LE Client may assume that the frame has been either discarded or 0136 * delivered to the recipient (C22) 0137 */ 0138 unsigned long path_switching_delay; 0139 0140 u8 *tlvs; /* LANE2: TLVs are new */ 0141 u32 sizeoftlvs; /* The size of the tlv array in bytes */ 0142 int lane_version; /* LANE2 */ 0143 int itfnum; /* e.g. 2 for lec2, 5 for lec5 */ 0144 struct lane2_ops *lane2_ops; /* can be NULL for LANE v1 */ 0145 int is_proxy; /* bridge between ATM and Ethernet */ 0146 }; 0147 0148 struct lec_vcc_priv { 0149 void (*old_pop) (struct atm_vcc *vcc, struct sk_buff *skb); 0150 int xoff; 0151 }; 0152 0153 #define LEC_VCC_PRIV(vcc) ((struct lec_vcc_priv *)((vcc)->user_back)) 0154 0155 #endif /* _LEC_H_ */
[ Source navigation ] | [ Diff markup ] | [ Identifier search ] | [ general search ] |
This page was automatically generated by the 2.1.0 LXR engine. The LXR team |
![]() ![]() |