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