]>
Commit | Line | Data |
---|---|---|
2874c5fd | 1 | /* SPDX-License-Identifier: GPL-2.0-or-later */ |
1da177e4 LT |
2 | /* |
3 | * DLCI/FRAD Definitions for Frame Relay Access Devices. DLCI devices are | |
4 | * created for each DLCI associated with a FRAD. The FRAD driver | |
5 | * is not truly a network device, but the lower level device | |
6 | * handler. This allows other FRAD manufacturers to use the DLCI | |
7 | * code, including its RFC1490 encapsulation alongside the current | |
8 | * implementation for the Sangoma cards. | |
9 | * | |
10 | * Version: @(#)if_ifrad.h 0.15 31 Mar 96 | |
11 | * | |
12 | * Author: Mike McLagan <mike.mclagan@linux.org> | |
13 | * | |
14 | * Changes: | |
15 | * 0.15 Mike McLagan changed structure defs (packed) | |
16 | * re-arranged flags | |
17 | * added DLCI_RET vars | |
1da177e4 | 18 | */ |
1da177e4 LT |
19 | #ifndef _FRAD_H_ |
20 | #define _FRAD_H_ | |
21 | ||
607ca46e | 22 | #include <uapi/linux/if_frad.h> |
1da177e4 | 23 | |
1da177e4 | 24 | |
3121a48d KH |
25 | #if defined(CONFIG_DLCI) || defined(CONFIG_DLCI_MODULE) |
26 | ||
1da177e4 LT |
27 | /* these are the fields of an RFC 1490 header */ |
28 | struct frhdr | |
29 | { | |
6a878184 | 30 | unsigned char control; |
1da177e4 LT |
31 | |
32 | /* for IP packets, this can be the NLPID */ | |
6a878184 | 33 | unsigned char pad; |
1da177e4 | 34 | |
6a878184 JB |
35 | unsigned char NLPID; |
36 | unsigned char OUI[3]; | |
90458401 | 37 | __be16 PID; |
1da177e4 LT |
38 | |
39 | #define IP_NLPID pad | |
bc10502d | 40 | } __packed; |
1da177e4 LT |
41 | |
42 | /* see RFC 1490 for the definition of the following */ | |
43 | #define FRAD_I_UI 0x03 | |
44 | ||
45 | #define FRAD_P_PADDING 0x00 | |
46 | #define FRAD_P_Q933 0x08 | |
47 | #define FRAD_P_SNAP 0x80 | |
48 | #define FRAD_P_CLNP 0x81 | |
49 | #define FRAD_P_IP 0xCC | |
50 | ||
51 | struct dlci_local | |
52 | { | |
1da177e4 LT |
53 | struct net_device *master; |
54 | struct net_device *slave; | |
55 | struct dlci_conf config; | |
56 | int configured; | |
57 | struct list_head list; | |
58 | ||
59 | /* callback function */ | |
60 | void (*receive)(struct sk_buff *skb, struct net_device *); | |
61 | }; | |
62 | ||
63 | struct frad_local | |
64 | { | |
1da177e4 LT |
65 | /* devices which this FRAD is slaved to */ |
66 | struct net_device *master[CONFIG_DLCI_MAX]; | |
67 | short dlci[CONFIG_DLCI_MAX]; | |
68 | ||
69 | struct frad_conf config; | |
70 | int configured; /* has this device been configured */ | |
71 | int initialized; /* mem_start, port, irq set ? */ | |
72 | ||
73 | /* callback functions */ | |
74 | int (*activate)(struct net_device *, struct net_device *); | |
75 | int (*deactivate)(struct net_device *, struct net_device *); | |
76 | int (*assoc)(struct net_device *, struct net_device *); | |
77 | int (*deassoc)(struct net_device *, struct net_device *); | |
78 | int (*dlci_conf)(struct net_device *, struct net_device *, int get); | |
79 | ||
80 | /* fields that are used by the Sangoma SDLA cards */ | |
81 | struct timer_list timer; | |
032cfd66 | 82 | struct net_device *dev; |
1da177e4 LT |
83 | int type; /* adapter type */ |
84 | int state; /* state of the S502/8 control latch */ | |
85 | int buffer; /* current buffer for S508 firmware */ | |
86 | }; | |
87 | ||
1da177e4 LT |
88 | #endif /* CONFIG_DLCI || CONFIG_DLCI_MODULE */ |
89 | ||
20380731 | 90 | extern void dlci_ioctl_set(int (*hook)(unsigned int, void __user *)); |
3121a48d | 91 | |
1da177e4 | 92 | #endif |