diff options
Diffstat (limited to 'include/net')
-rw-r--r-- | include/net/llc.h | 30 | ||||
-rw-r--r-- | include/net/llc_conn.h | 15 | ||||
-rw-r--r-- | include/net/llc_sap.h | 8 |
3 files changed, 44 insertions, 9 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 */ |
diff --git a/include/net/llc_conn.h b/include/net/llc_conn.h index 8ad3bc2c23d7..54852ff6033b 100644 --- a/include/net/llc_conn.h +++ b/include/net/llc_conn.h | |||
@@ -19,14 +19,14 @@ | |||
19 | #define LLC_EVENT 1 | 19 | #define LLC_EVENT 1 |
20 | #define LLC_PACKET 2 | 20 | #define LLC_PACKET 2 |
21 | 21 | ||
22 | #define LLC_P_TIME 2 | 22 | #define LLC2_P_TIME 2 |
23 | #define LLC_ACK_TIME 1 | 23 | #define LLC2_ACK_TIME 1 |
24 | #define LLC_REJ_TIME 3 | 24 | #define LLC2_REJ_TIME 3 |
25 | #define LLC_BUSY_TIME 3 | 25 | #define LLC2_BUSY_TIME 3 |
26 | 26 | ||
27 | struct llc_timer { | 27 | struct llc_timer { |
28 | struct timer_list timer; | 28 | struct timer_list timer; |
29 | u16 expire; /* timer expire time */ | 29 | unsigned long expire; /* timer expire time */ |
30 | }; | 30 | }; |
31 | 31 | ||
32 | struct llc_sock { | 32 | struct llc_sock { |
@@ -38,6 +38,7 @@ struct llc_sock { | |||
38 | struct llc_addr laddr; /* lsap/mac pair */ | 38 | struct llc_addr laddr; /* lsap/mac pair */ |
39 | struct llc_addr daddr; /* dsap/mac pair */ | 39 | struct llc_addr daddr; /* dsap/mac pair */ |
40 | struct net_device *dev; /* device to send to remote */ | 40 | struct net_device *dev; /* device to send to remote */ |
41 | u32 copied_seq; /* head of yet unread data */ | ||
41 | u8 retry_count; /* number of retries */ | 42 | u8 retry_count; /* number of retries */ |
42 | u8 ack_must_be_send; | 43 | u8 ack_must_be_send; |
43 | u8 first_pdu_Ns; | 44 | u8 first_pdu_Ns; |
@@ -92,7 +93,8 @@ static __inline__ char llc_backlog_type(struct sk_buff *skb) | |||
92 | return skb->cb[sizeof(skb->cb) - 1]; | 93 | return skb->cb[sizeof(skb->cb) - 1]; |
93 | } | 94 | } |
94 | 95 | ||
95 | extern struct sock *llc_sk_alloc(int family, int priority, struct proto *prot); | 96 | extern struct sock *llc_sk_alloc(int family, unsigned int __nocast priority, |
97 | struct proto *prot); | ||
96 | extern void llc_sk_free(struct sock *sk); | 98 | extern void llc_sk_free(struct sock *sk); |
97 | 99 | ||
98 | extern void llc_sk_reset(struct sock *sk); | 100 | extern void llc_sk_reset(struct sock *sk); |
@@ -115,5 +117,4 @@ extern void llc_sap_remove_socket(struct llc_sap *sap, struct sock *sk); | |||
115 | 117 | ||
116 | extern u8 llc_data_accept_state(u8 state); | 118 | extern u8 llc_data_accept_state(u8 state); |
117 | extern void llc_build_offset_table(void); | 119 | extern void llc_build_offset_table(void); |
118 | extern int llc_release_sockets(struct llc_sap *sap); | ||
119 | #endif /* LLC_CONN_H */ | 120 | #endif /* LLC_CONN_H */ |
diff --git a/include/net/llc_sap.h b/include/net/llc_sap.h index 353baaa627f3..2c56dbece729 100644 --- a/include/net/llc_sap.h +++ b/include/net/llc_sap.h | |||
@@ -12,11 +12,15 @@ | |||
12 | * See the GNU General Public License for more details. | 12 | * See the GNU General Public License for more details. |
13 | */ | 13 | */ |
14 | struct llc_sap; | 14 | struct llc_sap; |
15 | struct net_device; | ||
15 | struct sk_buff; | 16 | struct sk_buff; |
17 | struct sock; | ||
16 | 18 | ||
17 | extern void llc_sap_rtn_pdu(struct llc_sap *sap, struct sk_buff *skb); | 19 | extern void llc_sap_rtn_pdu(struct llc_sap *sap, struct sk_buff *skb); |
18 | extern void llc_save_primitive(struct sk_buff* skb, unsigned char prim); | 20 | extern void llc_save_primitive(struct sock *sk, struct sk_buff* skb, |
19 | extern struct sk_buff *llc_alloc_frame(void); | 21 | unsigned char prim); |
22 | extern struct sk_buff *llc_alloc_frame(struct sock *sk, | ||
23 | struct net_device *dev); | ||
20 | 24 | ||
21 | extern void llc_build_and_send_test_pkt(struct llc_sap *sap, | 25 | extern void llc_build_and_send_test_pkt(struct llc_sap *sap, |
22 | struct sk_buff *skb, | 26 | struct sk_buff *skb, |