diff options
Diffstat (limited to 'include/net/llc.h')
-rw-r--r-- | include/net/llc.h | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/include/net/llc.h b/include/net/llc.h index 71769a5aeef3..1adb2ef3f6f7 100644 --- a/include/net/llc.h +++ b/include/net/llc.h | |||
@@ -17,6 +17,8 @@ | |||
17 | #include <linux/list.h> | 17 | #include <linux/list.h> |
18 | #include <linux/spinlock.h> | 18 | #include <linux/spinlock.h> |
19 | 19 | ||
20 | #include <asm/atomic.h> | ||
21 | |||
20 | struct net_device; | 22 | struct net_device; |
21 | struct packet_type; | 23 | struct packet_type; |
22 | struct sk_buff; | 24 | struct sk_buff; |
@@ -44,6 +46,7 @@ struct llc_sap { | |||
44 | unsigned char state; | 46 | unsigned char state; |
45 | unsigned char p_bit; | 47 | unsigned char p_bit; |
46 | unsigned char f_bit; | 48 | unsigned char f_bit; |
49 | atomic_t refcnt; | ||
47 | int (*rcv_func)(struct sk_buff *skb, | 50 | int (*rcv_func)(struct sk_buff *skb, |
48 | struct net_device *dev, | 51 | struct net_device *dev, |
49 | struct packet_type *pt, | 52 | struct packet_type *pt, |
@@ -81,13 +84,27 @@ extern struct llc_sap *llc_sap_open(unsigned char lsap, | |||
81 | struct net_device *dev, | 84 | struct net_device *dev, |
82 | struct packet_type *pt, | 85 | struct packet_type *pt, |
83 | struct net_device *orig_dev)); | 86 | struct net_device *orig_dev)); |
87 | static inline void llc_sap_hold(struct llc_sap *sap) | ||
88 | { | ||
89 | atomic_inc(&sap->refcnt); | ||
90 | } | ||
91 | |||
84 | extern void llc_sap_close(struct llc_sap *sap); | 92 | extern void llc_sap_close(struct llc_sap *sap); |
85 | 93 | ||
94 | static inline void llc_sap_put(struct llc_sap *sap) | ||
95 | { | ||
96 | if (atomic_dec_and_test(&sap->refcnt)) | ||
97 | llc_sap_close(sap); | ||
98 | } | ||
99 | |||
86 | extern struct llc_sap *llc_sap_find(unsigned char sap_value); | 100 | extern struct llc_sap *llc_sap_find(unsigned char sap_value); |
87 | 101 | ||
88 | extern int llc_build_and_send_ui_pkt(struct llc_sap *sap, struct sk_buff *skb, | 102 | extern int llc_build_and_send_ui_pkt(struct llc_sap *sap, struct sk_buff *skb, |
89 | unsigned char *dmac, unsigned char dsap); | 103 | unsigned char *dmac, unsigned char dsap); |
90 | 104 | ||
105 | extern void llc_sap_handler(struct llc_sap *sap, struct sk_buff *skb); | ||
106 | extern void llc_conn_handler(struct llc_sap *sap, struct sk_buff *skb); | ||
107 | |||
91 | extern int llc_station_init(void); | 108 | extern int llc_station_init(void); |
92 | extern void llc_station_exit(void); | 109 | extern void llc_station_exit(void); |
93 | 110 | ||
@@ -98,4 +115,17 @@ extern void llc_proc_exit(void); | |||
98 | #define llc_proc_init() (0) | 115 | #define llc_proc_init() (0) |
99 | #define llc_proc_exit() do { } while(0) | 116 | #define llc_proc_exit() do { } while(0) |
100 | #endif /* CONFIG_PROC_FS */ | 117 | #endif /* CONFIG_PROC_FS */ |
118 | #ifdef CONFIG_SYSCTL | ||
119 | extern int llc_sysctl_init(void); | ||
120 | extern void llc_sysctl_exit(void); | ||
121 | |||
122 | extern int sysctl_llc2_ack_timeout; | ||
123 | extern int sysctl_llc2_busy_timeout; | ||
124 | extern int sysctl_llc2_p_timeout; | ||
125 | extern int sysctl_llc2_rej_timeout; | ||
126 | extern int sysctl_llc_station_ack_timeout; | ||
127 | #else | ||
128 | #define llc_sysctl_init() (0) | ||
129 | #define llc_sysctl_exit() do { } while(0) | ||
130 | #endif /* CONFIG_SYSCTL */ | ||
101 | #endif /* LLC_H */ | 131 | #endif /* LLC_H */ |