1 diff -urN linux-2.6.19.1/include/linux/atm.h linux-2.6.19.1.new/include/linux/atm.h
2 --- linux-2.6.19.1/include/linux/atm.h 2006-12-11 20:32:53.000000000 +0100
3 +++ linux-2.6.19.1.new/include/linux/atm.h 2007-01-07 18:38:50.000000000 +0100
5 #define ATM_AAL2 2 /* AAL2 (VBR) */
6 #define ATM_AAL34 3 /* AAL3/4 (data) */
7 #define ATM_AAL5 5 /* AAL5 (data) */
8 +#if defined(CONFIG_MIPS_BCM963XX)
9 +#define ATM_BCM_AAL0 14 /* "raw" ATM cells */
13 * socket option name coding functions
14 diff -urN linux-2.6.19.1/include/linux/atmbr2684.h linux-2.6.19.1.new/include/linux/atmbr2684.h
15 --- linux-2.6.19.1/include/linux/atmbr2684.h 2006-12-11 20:32:53.000000000 +0100
16 +++ linux-2.6.19.1.new/include/linux/atmbr2684.h 2007-01-07 18:24:01.000000000 +0100
19 int send_padding; /* unsupported */
20 int min_size; /* we will pad smaller packets than this */
21 +#if defined(CONFIG_MIPS_BCM963XX)
22 +#define FILTER_PPPOE 1
23 + int proto_filter; /* protocol filter flag, current only PPPoE */
28 diff -urN linux-2.6.19.1/include/linux/atmdev.h linux-2.6.19.1.new/include/linux/atmdev.h
29 --- linux-2.6.19.1/include/linux/atmdev.h 2006-12-11 20:32:53.000000000 +0100
30 +++ linux-2.6.19.1.new/include/linux/atmdev.h 2007-01-07 18:37:34.000000000 +0100
32 #define ATM_DS3_PCR (8000*12)
33 /* DS3: 12 cells in a 125 usec time slot */
35 +#if defined(CONFIG_MIPS_BCM963XX)
36 +#define atm_sk(__sk) ((struct atm_vcc *)(__sk)->sk_protinfo)
37 +#define ATM_SD(s) (atm_sk((s)->sk))
40 #define __AAL_STAT_ITEMS \
41 __HANDLE_ITEM(tx); /* TX okay */ \
43 #define ATM_BACKEND_RAW 0
44 #define ATM_BACKEND_PPP 1 /* PPPoATM - RFC2364 */
45 #define ATM_BACKEND_BR2684 2 /* Bridged RFC1483/2684 */
46 +#if defined(CONFIG_MIPS_BCM963XX)
47 +#define ATM_BACKEND_RT2684 3 /* Routed RFC1483/2684 */
51 #define ATM_ITFTYP_LEN 8 /* maximum length of interface type name */
56 +#if defined(CONFIG_MIPS_BCM963XX)
57 + ATM_DF_CLOSE, /* close device when last VCC is closed */
59 ATM_DF_REMOVED, /* device was removed from atm_devs list */
63 #define ATM_ATMOPT_CLP 1 /* set CLP bit */
66 +#if !defined(CONFIG_MIPS_BCM963XX)
67 /* struct sock has to be the first member of atm_vcc */
70 unsigned long flags; /* VCC flags (ATM_VF_*) */
71 short vpi; /* VPI and VCI (types must be equal */
74 void *dev_data; /* per-device data */
75 void *proto_data; /* per-protocol data */
76 struct k_atm_aal_stats *stats; /* pointer to AAL stats group */
77 +#if defined(CONFIG_MIPS_BCM963XX)
78 + struct sock *sk; /* socket backpointer */
80 /* SVC part --- may move later ------------------------------------- */
81 short itf; /* interface number */
82 struct sockaddr_atmsvc local;
86 struct sockaddr_atmsvc addr; /* ATM address */
87 +#if defined(CONFIG_MIPS_BCM963XX)
88 + struct atm_dev_addr *next; /* next address */
90 struct list_head entry; /* next address */
94 enum atm_addr_type_t { ATM_ADDR_LOCAL, ATM_ADDR_LECS };
96 void *dev_data; /* per-device data */
97 void *phy_data; /* private PHY date */
98 unsigned long flags; /* device flags (ATM_DF_*) */
99 +#if defined(CONFIG_MIPS_BCM963XX)
100 + struct atm_dev_addr *local; /* local ATM addresses */
102 struct list_head local; /* local ATM addresses */
103 struct list_head lecs; /* LECS ATM addresses learned via ILMI */
105 unsigned char esi[ESI_LEN]; /* ESI ("MAC" addr) */
106 struct atm_cirange ci_range; /* VPI/VCI range */
107 struct k_atm_dev_stats stats; /* statistics */
109 struct proc_dir_entry *proc_entry; /* proc entry */
110 char *proc_name; /* proc entry name */
112 +#if !defined(CONFIG_MIPS_BCM963XX)
113 struct class_device class_dev; /* sysfs class device */
115 struct list_head dev_list; /* linkage */
119 int number,unsigned long *flags); /* number == -1: pick first available */
120 struct atm_dev *atm_dev_lookup(int number);
121 void atm_dev_deregister(struct atm_dev *dev);
122 +#if defined(CONFIG_MIPS_BCM963XX)
123 +void shutdown_atm_dev(struct atm_dev *dev);
125 void vcc_insert_socket(struct sock *sk);
126 +#if defined(CONFIG_MIPS_BCM963XX)
127 +void vcc_remove_socket(struct sock *sk);
132 @@ -432,20 +463,33 @@
134 static inline void atm_force_charge(struct atm_vcc *vcc,int truesize)
136 +#if defined(CONFIG_MIPS_BCM963XX)
137 + atomic_add(truesize, &vcc->sk->sk_rmem_alloc);
139 atomic_add(truesize, &sk_atm(vcc)->sk_rmem_alloc);
144 static inline void atm_return(struct atm_vcc *vcc,int truesize)
146 +#if defined(CONFIG_MIPS_BCM963XX)
147 + atomic_sub(truesize, &vcc->sk->sk_rmem_alloc);
149 atomic_sub(truesize, &sk_atm(vcc)->sk_rmem_alloc);
154 static inline int atm_may_send(struct atm_vcc *vcc,unsigned int size)
156 +#if defined(CONFIG_MIPS_BCM963XX)
157 + return (size + atomic_read(&vcc->sk->sk_wmem_alloc)) <
158 + vcc->sk->sk_sndbuf;
160 return (size + atomic_read(&sk_atm(vcc)->sk_wmem_alloc)) <
161 sk_atm(vcc)->sk_sndbuf;
166 @@ -457,12 +501,20 @@
168 static inline void atm_dev_put(struct atm_dev *dev)
170 +#if defined(CONFIG_MIPS_BCM963XX)
171 + atomic_dec(&dev->refcnt);
173 + if ((atomic_read(&dev->refcnt) == 1) &&
174 + test_bit(ATM_DF_CLOSE,&dev->flags))
175 + shutdown_atm_dev(dev);
177 if (atomic_dec_and_test(&dev->refcnt)) {
178 BUG_ON(!test_bit(ATM_DF_REMOVED, &dev->flags));
179 if (dev->ops->dev_close)
180 dev->ops->dev_close(dev);
181 class_device_put(&dev->class_dev);
187 diff -urN linux-2.6.19.1/include/linux/atmrt2684.h linux-2.6.19.1.new/include/linux/atmrt2684.h
188 --- linux-2.6.19.1/include/linux/atmrt2684.h 1970-01-01 01:00:00.000000000 +0100
189 +++ linux-2.6.19.1.new/include/linux/atmrt2684.h 2007-01-07 18:40:39.000000000 +0100
191 +#ifndef _LINUX_ATMRT2684_H
192 +#define _LINUX_ATMRT2684_H
194 +#include <linux/atm.h>
195 +#include <linux/if.h> /* For IFNAMSIZ */
197 +#define RT2684_ENCAPS_NULL (0) /* VC-mux */
198 +#define RT2684_ENCAPS_LLC (1)
199 +#define RT2684_ENCAPS_AUTODETECT (2) /* Unsuported */
202 + * This is for the ATM_NEWBACKENDIF call - these are like socket families:
203 + * the first element of the structure is the backend number and the rest
204 + * is per-backend specific
206 +struct atm_newif_rt2684 {
207 + atm_backend_t backend_num; /* ATM_BACKEND_RT2684 */
208 + char ifname[IFNAMSIZ];
212 + * This structure is used to specify a rt2684 interface - either by a
213 + * positive integer (returned by ATM_NEWBACKENDIF) or the interfaces name
215 +#define RT2684_FIND_BYNOTHING (0)
216 +#define RT2684_FIND_BYNUM (1)
217 +#define RT2684_FIND_BYIFNAME (2)
218 +struct rt2684_if_spec {
219 + int method; /* RT2684_FIND_* */
221 + char ifname[IFNAMSIZ];
227 + * This is for the ATM_SETBACKEND call - these are like socket families:
228 + * the first element of the structure is the backend number and the rest
229 + * is per-backend specific
231 +struct atm_backend_rt2684 {
232 + atm_backend_t backend_num; /* ATM_BACKEND_RT2684 */
233 + struct rt2684_if_spec ifspec;
234 + unsigned char encaps; /* RT2684_ENCAPS_* */
238 +#endif /* _LINUX_ATMRT2684_H */