1 /* SPDX-License-Identifier: GPL-2.0 */ << 2 /* 1 /* >> 2 * 3 * Lan Emulation client header file 3 * Lan Emulation client header file 4 * 4 * 5 * Marko Kiiskila <mkiiskila@yahoo.com> !! 5 * Marko Kiiskila mkiiskila@yahoo.com >> 6 * 6 */ 7 */ 7 8 8 #ifndef _LEC_H_ 9 #ifndef _LEC_H_ 9 #define _LEC_H_ 10 #define _LEC_H_ 10 11 >> 12 #include <linux/config.h> 11 #include <linux/atmdev.h> 13 #include <linux/atmdev.h> 12 #include <linux/netdevice.h> 14 #include <linux/netdevice.h> 13 #include <linux/atmlec.h> 15 #include <linux/atmlec.h> 14 16 >> 17 #if defined (CONFIG_BRIDGE) || defined(CONFIG_BRIDGE_MODULE) >> 18 #include <linux/if_bridge.h> >> 19 extern struct net_bridge_fdb_entry *(*br_fdb_get_hook)(struct net_bridge *br, >> 20 unsigned char *addr); >> 21 extern void (*br_fdb_put_hook)(struct net_bridge_fdb_entry *ent); >> 22 #endif /* defined(CONFIG_BRIDGE) || defined(CONFIG_BRIDGE_MODULE) */ >> 23 15 #define LEC_HEADER_LEN 16 24 #define LEC_HEADER_LEN 16 16 25 17 struct lecdatahdr_8023 { 26 struct lecdatahdr_8023 { 18 __be16 le_header; !! 27 unsigned short le_header; 19 unsigned char h_dest[ETH_ALEN]; !! 28 unsigned char h_dest[ETH_ALEN]; 20 unsigned char h_source[ETH_ALEN]; !! 29 unsigned char h_source[ETH_ALEN]; 21 __be16 h_type; !! 30 unsigned short h_type; 22 }; 31 }; 23 32 24 struct lecdatahdr_8025 { 33 struct lecdatahdr_8025 { 25 __be16 le_header; !! 34 unsigned short le_header; 26 unsigned char ac_pad; !! 35 unsigned char ac_pad; 27 unsigned char fc; !! 36 unsigned char fc; 28 unsigned char h_dest[ETH_ALEN]; !! 37 unsigned char h_dest[ETH_ALEN]; 29 unsigned char h_source[ETH_ALEN]; !! 38 unsigned char h_source[ETH_ALEN]; 30 }; 39 }; 31 40 32 #define LEC_MINIMUM_8023_SIZE 62 41 #define LEC_MINIMUM_8023_SIZE 62 33 #define LEC_MINIMUM_8025_SIZE 16 42 #define LEC_MINIMUM_8025_SIZE 16 34 43 35 /* 44 /* 36 * Operations that LANE2 capable device can do 45 * Operations that LANE2 capable device can do. Two first functions 37 * are used to make the device do things. See 46 * are used to make the device do things. See spec 3.1.3 and 3.1.4. 38 * 47 * 39 * The third function is intended for the MPOA !! 48 * The third function is intented for the MPOA component sitting on 40 * top of the LANE device. The MPOA component 49 * top of the LANE device. The MPOA component assigns it's own function 41 * to (*associate_indicator)() and the LANE de 50 * to (*associate_indicator)() and the LANE device will use that 42 * function to tell about TLVs it sees floatin 51 * function to tell about TLVs it sees floating through. 43 * 52 * 44 */ 53 */ 45 struct lane2_ops { 54 struct lane2_ops { 46 int (*resolve) (struct net_device *dev !! 55 int (*resolve)(struct net_device *dev, u8 *dst_mac, int force, 47 u8 **tlvs, u32 *sizeof !! 56 u8 **tlvs, u32 *sizeoftlvs); 48 int (*associate_req) (struct net_devic !! 57 int (*associate_req)(struct net_device *dev, u8 *lan_dst, 49 const u8 *tlvs, !! 58 u8 *tlvs, u32 sizeoftlvs); 50 void (*associate_indicator) (struct ne !! 59 void (*associate_indicator)(struct net_device *dev, u8 *mac_addr, 51 const u8 !! 60 u8 *tlvs, u32 sizeoftlvs); >> 61 }; >> 62 >> 63 struct atm_lane_ops { >> 64 int (*lecd_attach)(struct atm_vcc *vcc, int arg); >> 65 int (*mcast_attach)(struct atm_vcc *vcc, int arg); >> 66 int (*vcc_attach)(struct atm_vcc *vcc, void *arg); >> 67 struct net_device * (*get_lec)(int itf); >> 68 struct module *owner; 52 }; 69 }; 53 70 54 /* 71 /* 55 * ATM LAN Emulation supports both LLC & Dix E 72 * ATM LAN Emulation supports both LLC & Dix Ethernet EtherType 56 * frames. !! 73 * frames. 57 * << 58 * 1. Dix Ethernet EtherType frames encoded by 74 * 1. Dix Ethernet EtherType frames encoded by placing EtherType 59 * field in h_type field. Data follows imme !! 75 * field in h_type field. Data follows immediatelly after header. 60 * 2. LLC Data frames whose total length, incl 76 * 2. LLC Data frames whose total length, including LLC field and data, 61 * but not padding required to meet the min !! 77 * but not padding required to meet the minimum data frame length, 62 * is less than ETH_P_802_3_MIN MUST be enc !! 78 * is less than 1536(0x0600) MUST be encoded by placing that length 63 * in the h_type field. The LLC field follo !! 79 * in the h_type field. The LLC field follows header immediatelly. 64 * 3. LLC data frames longer than this maximum 80 * 3. LLC data frames longer than this maximum MUST be encoded by placing 65 * the value 0 in the h_type field. 81 * the value 0 in the h_type field. 66 * 82 * 67 */ 83 */ 68 84 69 /* Hash table size */ 85 /* Hash table size */ 70 #define LEC_ARP_TABLE_SIZE 16 86 #define LEC_ARP_TABLE_SIZE 16 71 87 72 struct lec_priv { 88 struct lec_priv { 73 unsigned short lecid; !! 89 struct net_device_stats stats; 74 struct hlist_head lec_arp_empty_ones; !! 90 unsigned short lecid; /* Lecid of this client */ 75 !! 91 struct lec_arp_table *lec_arp_empty_ones; 76 struct hlist_head lec_arp_tables[LEC_A !! 92 /* Used for storing VCC's that don't have a MAC address attached yet */ 77 !! 93 struct lec_arp_table *lec_arp_tables[LEC_ARP_TABLE_SIZE]; 78 struct hlist_head lec_no_forward; !! 94 /* Actual LE ARP table */ 79 !! 95 struct lec_arp_table *lec_no_forward; 80 !! 96 /* Used for storing VCC's (and forward packets from) which are to 81 !! 97 age out by not using them to forward packets. 82 !! 98 This is because to some LE clients there will be 2 VCCs. Only 83 !! 99 one of them gets used. */ 84 !! 100 struct lec_arp_table *mcast_fwds; 85 struct hlist_head mcast_fwds; !! 101 /* With LANEv2 it is possible that BUS (or a special multicast server) 86 !! 102 establishes multiple Multicast Forward VCCs to us. This list 87 !! 103 collects all those VCCs. LANEv1 client has only one item in this 88 !! 104 list. These entries are not aged out. */ 89 !! 105 atomic_t lec_arp_users; 90 !! 106 spinlock_t lec_arp_lock; 91 !! 107 struct atm_vcc *mcast_vcc; /* Default Multicast Send VCC */ 92 spinlock_t lec_arp_lock; !! 108 struct atm_vcc *lecd; 93 struct atm_vcc *mcast_vcc; !! 109 struct timer_list lec_arp_timer; 94 struct atm_vcc *lecd; !! 110 /* C10 */ 95 struct delayed_work lec_arp_work; !! 111 unsigned int maximum_unknown_frame_count; 96 unsigned int maximum_unknown_frame_cou !! 112 /* Within the period of time defined by this variable, the client will send 97 !! 113 no more than C10 frames to BUS for a given unicast destination. (C11) */ 98 !! 114 unsigned long max_unknown_frame_time; 99 !! 115 /* If no traffic has been sent in this vcc for this period of time, 100 !! 116 vcc will be torn down (C12)*/ 101 unsigned long max_unknown_frame_time; !! 117 unsigned long vcc_timeout_period; 102 !! 118 /* An LE Client MUST not retry an LE_ARP_REQUEST for a 103 !! 119 given frame's LAN Destination more than maximum retry count times, 104 !! 120 after the first LEC_ARP_REQUEST (C13)*/ 105 !! 121 unsigned short max_retry_count; 106 unsigned long vcc_timeout_period; !! 122 /* Max time the client will maintain an entry in its arp cache in 107 !! 123 absence of a verification of that relationship (C17)*/ 108 !! 124 unsigned long aging_time; 109 !! 125 /* Max time the client will maintain an entry in cache when 110 !! 126 topology change flag is true (C18) */ 111 !! 127 unsigned long forward_delay_time; 112 unsigned short max_retry_count; !! 128 /* Topology change flag (C19)*/ 113 !! 129 int topology_change; 114 !! 130 /* Max time the client expects an LE_ARP_REQUEST/LE_ARP_RESPONSE 115 !! 131 cycle to take (C20)*/ 116 !! 132 unsigned long arp_response_time; 117 unsigned long aging_time; !! 133 /* Time limit ot wait to receive an LE_FLUSH_RESPONSE after the 118 !! 134 LE_FLUSH_REQUEST has been sent before taking recover action. (C21)*/ 119 !! 135 unsigned long flush_timeout; 120 !! 136 /* The time since sending a frame to the bus after which the 121 !! 137 LE Client may assume that the frame has been either discarded or 122 unsigned long forward_delay_time; !! 138 delivered to the recipient (C22) */ 123 int topology_change; !! 139 unsigned long path_switching_delay; 124 !! 140 125 !! 141 u8 *tlvs; /* LANE2: TLVs are new */ 126 !! 142 u32 sizeoftlvs; /* The size of the tlv array in bytes */ 127 !! 143 int lane_version; /* LANE2 */ 128 unsigned long arp_response_time; !! 144 int itfnum; /* e.g. 2 for lec2, 5 for lec5 */ 129 !! 145 struct lane2_ops *lane2_ops; /* can be NULL for LANE v1 */ 130 !! 146 int is_proxy; /* bridge between ATM and Ethernet */ 131 !! 147 int is_trdev; /* Device type, 0 = Ethernet, 1 = TokenRing */ 132 << 133 unsigned long flush_timeout; << 134 << 135 << 136 << 137 << 138 unsigned long path_switching_delay; << 139 << 140 u8 *tlvs; << 141 u32 sizeoftlvs; << 142 int lane_version; << 143 int itfnum; << 144 struct lane2_ops *lane2_ops; << 145 int is_proxy; << 146 }; 148 }; 147 149 148 struct lec_vcc_priv { !! 150 int lecd_attach(struct atm_vcc *vcc, int arg); 149 void (*old_pop) (struct atm_vcc *vcc, !! 151 int lec_vcc_attach(struct atm_vcc *vcc, void *arg); 150 int xoff; !! 152 int lec_mcast_attach(struct atm_vcc *vcc, int arg); 151 }; !! 153 struct net_device *get_dev_lec(int itf); >> 154 int make_lec(struct atm_vcc *vcc); >> 155 int send_to_lecd(struct lec_priv *priv, >> 156 atmlec_msg_type type, unsigned char *mac_addr, >> 157 unsigned char *atm_addr, struct sk_buff *data); >> 158 void lec_push(struct atm_vcc *vcc, struct sk_buff *skb); >> 159 >> 160 extern struct atm_lane_ops *atm_lane_ops; >> 161 void atm_lane_ops_set(struct atm_lane_ops *hook); >> 162 int try_atm_lane_ops(void); 152 163 153 #define LEC_VCC_PRIV(vcc) ((struct lec_v !! 164 #endif /* _LEC_H_ */ 154 165 155 #endif /* _LEC_H_ */ << 156 166
Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.