/*1* Lan Emulation client header file2*3* Marko Kiiskila <[email protected]>4*/56#ifndef _LEC_H_7#define _LEC_H_89#include <linux/atmdev.h>10#include <linux/netdevice.h>11#include <linux/atmlec.h>1213#define LEC_HEADER_LEN 161415struct lecdatahdr_8023 {16__be16 le_header;17unsigned char h_dest[ETH_ALEN];18unsigned char h_source[ETH_ALEN];19__be16 h_type;20};2122struct lecdatahdr_8025 {23__be16 le_header;24unsigned char ac_pad;25unsigned char fc;26unsigned char h_dest[ETH_ALEN];27unsigned char h_source[ETH_ALEN];28};2930#define LEC_MINIMUM_8023_SIZE 6231#define LEC_MINIMUM_8025_SIZE 163233/*34* Operations that LANE2 capable device can do. Two first functions35* are used to make the device do things. See spec 3.1.3 and 3.1.4.36*37* The third function is intended for the MPOA component sitting on38* top of the LANE device. The MPOA component assigns it's own function39* to (*associate_indicator)() and the LANE device will use that40* function to tell about TLVs it sees floating through.41*42*/43struct lane2_ops {44int (*resolve) (struct net_device *dev, const u8 *dst_mac, int force,45u8 **tlvs, u32 *sizeoftlvs);46int (*associate_req) (struct net_device *dev, const u8 *lan_dst,47const u8 *tlvs, u32 sizeoftlvs);48void (*associate_indicator) (struct net_device *dev, const u8 *mac_addr,49const u8 *tlvs, u32 sizeoftlvs);50};5152/*53* ATM LAN Emulation supports both LLC & Dix Ethernet EtherType54* frames.55*56* 1. Dix Ethernet EtherType frames encoded by placing EtherType57* field in h_type field. Data follows immediatelly after header.58* 2. LLC Data frames whose total length, including LLC field and data,59* but not padding required to meet the minimum data frame length,60* is less than 1536(0x0600) MUST be encoded by placing that length61* in the h_type field. The LLC field follows header immediatelly.62* 3. LLC data frames longer than this maximum MUST be encoded by placing63* the value 0 in the h_type field.64*65*/6667/* Hash table size */68#define LEC_ARP_TABLE_SIZE 166970struct lec_priv {71unsigned short lecid; /* Lecid of this client */72struct hlist_head lec_arp_empty_ones;73/* Used for storing VCC's that don't have a MAC address attached yet */74struct hlist_head lec_arp_tables[LEC_ARP_TABLE_SIZE];75/* Actual LE ARP table */76struct hlist_head lec_no_forward;77/*78* Used for storing VCC's (and forward packets from) which are to79* age out by not using them to forward packets.80* This is because to some LE clients there will be 2 VCCs. Only81* one of them gets used.82*/83struct hlist_head mcast_fwds;84/*85* With LANEv2 it is possible that BUS (or a special multicast server)86* establishes multiple Multicast Forward VCCs to us. This list87* collects all those VCCs. LANEv1 client has only one item in this88* list. These entries are not aged out.89*/90spinlock_t lec_arp_lock;91struct atm_vcc *mcast_vcc; /* Default Multicast Send VCC */92struct atm_vcc *lecd;93struct delayed_work lec_arp_work; /* C10 */94unsigned int maximum_unknown_frame_count;95/*96* Within the period of time defined by this variable, the client will send97* no more than C10 frames to BUS for a given unicast destination. (C11)98*/99unsigned long max_unknown_frame_time;100/*101* If no traffic has been sent in this vcc for this period of time,102* vcc will be torn down (C12)103*/104unsigned long vcc_timeout_period;105/*106* An LE Client MUST not retry an LE_ARP_REQUEST for a107* given frame's LAN Destination more than maximum retry count times,108* after the first LEC_ARP_REQUEST (C13)109*/110unsigned short max_retry_count;111/*112* Max time the client will maintain an entry in its arp cache in113* absence of a verification of that relationship (C17)114*/115unsigned long aging_time;116/*117* Max time the client will maintain an entry in cache when118* topology change flag is true (C18)119*/120unsigned long forward_delay_time; /* Topology change flag (C19) */121int topology_change;122/*123* Max time the client expects an LE_ARP_REQUEST/LE_ARP_RESPONSE124* cycle to take (C20)125*/126unsigned long arp_response_time;127/*128* Time limit ot wait to receive an LE_FLUSH_RESPONSE after the129* LE_FLUSH_REQUEST has been sent before taking recover action. (C21)130*/131unsigned long flush_timeout;132/* The time since sending a frame to the bus after which the133* LE Client may assume that the frame has been either discarded or134* delivered to the recipient (C22)135*/136unsigned long path_switching_delay;137138u8 *tlvs; /* LANE2: TLVs are new */139u32 sizeoftlvs; /* The size of the tlv array in bytes */140int lane_version; /* LANE2 */141int itfnum; /* e.g. 2 for lec2, 5 for lec5 */142struct lane2_ops *lane2_ops; /* can be NULL for LANE v1 */143int is_proxy; /* bridge between ATM and Ethernet */144int is_trdev; /* Device type, 0 = Ethernet, 1 = TokenRing */145};146147struct lec_vcc_priv {148void (*old_pop) (struct atm_vcc *vcc, struct sk_buff *skb);149int xoff;150};151152#define LEC_VCC_PRIV(vcc) ((struct lec_vcc_priv *)((vcc)->user_back))153154#endif /* _LEC_H_ */155156157