xref: /OK3568_Linux_fs/kernel/include/net/atmclip.h (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1*4882a593Smuzhiyun /* SPDX-License-Identifier: GPL-2.0 */
2*4882a593Smuzhiyun /* net/atm/atmarp.h - RFC1577 ATM ARP */
3*4882a593Smuzhiyun 
4*4882a593Smuzhiyun /* Written 1995-2000 by Werner Almesberger, EPFL LRC/ICA */
5*4882a593Smuzhiyun 
6*4882a593Smuzhiyun 
7*4882a593Smuzhiyun #ifndef _ATMCLIP_H
8*4882a593Smuzhiyun #define _ATMCLIP_H
9*4882a593Smuzhiyun 
10*4882a593Smuzhiyun #include <linux/netdevice.h>
11*4882a593Smuzhiyun #include <linux/atm.h>
12*4882a593Smuzhiyun #include <linux/atmdev.h>
13*4882a593Smuzhiyun #include <linux/atmarp.h>
14*4882a593Smuzhiyun #include <linux/spinlock.h>
15*4882a593Smuzhiyun #include <net/neighbour.h>
16*4882a593Smuzhiyun 
17*4882a593Smuzhiyun 
18*4882a593Smuzhiyun #define CLIP_VCC(vcc) ((struct clip_vcc *) ((vcc)->user_back))
19*4882a593Smuzhiyun 
20*4882a593Smuzhiyun struct sk_buff;
21*4882a593Smuzhiyun 
22*4882a593Smuzhiyun struct clip_vcc {
23*4882a593Smuzhiyun 	struct atm_vcc	*vcc;		/* VCC descriptor */
24*4882a593Smuzhiyun 	struct atmarp_entry *entry;	/* ATMARP table entry, NULL if IP addr.
25*4882a593Smuzhiyun 					   isn't known yet */
26*4882a593Smuzhiyun 	int		xoff;		/* 1 if send buffer is full */
27*4882a593Smuzhiyun 	unsigned char	encap;		/* 0: NULL, 1: LLC/SNAP */
28*4882a593Smuzhiyun 	unsigned long	last_use;	/* last send or receive operation */
29*4882a593Smuzhiyun 	unsigned long	idle_timeout;	/* keep open idle for so many jiffies*/
30*4882a593Smuzhiyun 	void (*old_push)(struct atm_vcc *vcc,struct sk_buff *skb);
31*4882a593Smuzhiyun 					/* keep old push fn for chaining */
32*4882a593Smuzhiyun 	void (*old_pop)(struct atm_vcc *vcc,struct sk_buff *skb);
33*4882a593Smuzhiyun 					/* keep old pop fn for chaining */
34*4882a593Smuzhiyun 	struct clip_vcc	*next;		/* next VCC */
35*4882a593Smuzhiyun };
36*4882a593Smuzhiyun 
37*4882a593Smuzhiyun 
38*4882a593Smuzhiyun struct atmarp_entry {
39*4882a593Smuzhiyun 	struct clip_vcc	*vccs;		/* active VCCs; NULL if resolution is
40*4882a593Smuzhiyun 					   pending */
41*4882a593Smuzhiyun 	unsigned long	expires;	/* entry expiration time */
42*4882a593Smuzhiyun 	struct neighbour *neigh;	/* neighbour back-pointer */
43*4882a593Smuzhiyun };
44*4882a593Smuzhiyun 
45*4882a593Smuzhiyun #define PRIV(dev) ((struct clip_priv *) netdev_priv(dev))
46*4882a593Smuzhiyun 
47*4882a593Smuzhiyun struct clip_priv {
48*4882a593Smuzhiyun 	int number;			/* for convenience ... */
49*4882a593Smuzhiyun 	spinlock_t xoff_lock;		/* ensures that pop is atomic (SMP) */
50*4882a593Smuzhiyun 	struct net_device *next;	/* next CLIP interface */
51*4882a593Smuzhiyun };
52*4882a593Smuzhiyun 
53*4882a593Smuzhiyun #endif
54