diff options
Diffstat (limited to 'include/net')
-rw-r--r-- | include/net/llc.h | 16 | ||||
-rw-r--r-- | include/net/llc_conn.h | 1 |
2 files changed, 15 insertions, 2 deletions
diff --git a/include/net/llc.h b/include/net/llc.h index 8b8e2be289b1..93e5b443a9a7 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,7 +84,18 @@ 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)); |
84 | extern void llc_sap_close(struct llc_sap *sap); | 87 | static inline void llc_sap_hold(struct llc_sap *sap) |
88 | { | ||
89 | atomic_inc(&sap->refcnt); | ||
90 | } | ||
91 | |||
92 | static inline void llc_sap_put(struct llc_sap *sap) | ||
93 | { | ||
94 | extern void llc_sap_close(struct llc_sap *sap); | ||
95 | |||
96 | if (atomic_dec_and_test(&sap->refcnt)) | ||
97 | llc_sap_close(sap); | ||
98 | } | ||
85 | 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 | ||
diff --git a/include/net/llc_conn.h b/include/net/llc_conn.h index 8a8ff4810135..b2889218c76a 100644 --- a/include/net/llc_conn.h +++ b/include/net/llc_conn.h | |||
@@ -115,5 +115,4 @@ extern void llc_sap_remove_socket(struct llc_sap *sap, struct sock *sk); | |||
115 | 115 | ||
116 | extern u8 llc_data_accept_state(u8 state); | 116 | extern u8 llc_data_accept_state(u8 state); |
117 | extern void llc_build_offset_table(void); | 117 | extern void llc_build_offset_table(void); |
118 | extern int llc_release_sockets(struct llc_sap *sap); | ||
119 | #endif /* LLC_CONN_H */ | 118 | #endif /* LLC_CONN_H */ |