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