aboutsummaryrefslogtreecommitdiff
path: root/include/net
diff options
context:
space:
mode:
Diffstat (limited to 'include/net')
-rw-r--r--include/net/llc.h30
-rw-r--r--include/net/llc_conn.h15
-rw-r--r--include/net/llc_sap.h8
3 files changed, 44 insertions, 9 deletions
diff --git a/include/net/llc.h b/include/net/llc.h
index 71769a5aeef..1adb2ef3f6f 100644
--- a/include/net/llc.h
+++ b/include/net/llc.h
@@ -17,6 +17,8 @@
#include <linux/list.h>
#include <linux/spinlock.h>
+#include <asm/atomic.h>
+
struct net_device;
struct packet_type;
struct sk_buff;
@@ -44,6 +46,7 @@ struct llc_sap {
unsigned char state;
unsigned char p_bit;
unsigned char f_bit;
+ atomic_t refcnt;
int (*rcv_func)(struct sk_buff *skb,
struct net_device *dev,
struct packet_type *pt,
@@ -81,13 +84,27 @@ extern struct llc_sap *llc_sap_open(unsigned char lsap,
struct net_device *dev,
struct packet_type *pt,
struct net_device *orig_dev));
+static inline void llc_sap_hold(struct llc_sap *sap)
+{
+ atomic_inc(&sap->refcnt);
+}
+
extern void llc_sap_close(struct llc_sap *sap);
+static inline void llc_sap_put(struct llc_sap *sap)
+{
+ if (atomic_dec_and_test(&sap->refcnt))
+ llc_sap_close(sap);
+}
+
extern struct llc_sap *llc_sap_find(unsigned char sap_value);
extern int llc_build_and_send_ui_pkt(struct llc_sap *sap, struct sk_buff *skb,
unsigned char *dmac, unsigned char dsap);
+extern void llc_sap_handler(struct llc_sap *sap, struct sk_buff *skb);
+extern void llc_conn_handler(struct llc_sap *sap, struct sk_buff *skb);
+
extern int llc_station_init(void);
extern void llc_station_exit(void);
@@ -98,4 +115,17 @@ extern void llc_proc_exit(void);
#define llc_proc_init() (0)
#define llc_proc_exit() do { } while(0)
#endif /* CONFIG_PROC_FS */
+#ifdef CONFIG_SYSCTL
+extern int llc_sysctl_init(void);
+extern void llc_sysctl_exit(void);
+
+extern int sysctl_llc2_ack_timeout;
+extern int sysctl_llc2_busy_timeout;
+extern int sysctl_llc2_p_timeout;
+extern int sysctl_llc2_rej_timeout;
+extern int sysctl_llc_station_ack_timeout;
+#else
+#define llc_sysctl_init() (0)
+#define llc_sysctl_exit() do { } while(0)
+#endif /* CONFIG_SYSCTL */
#endif /* LLC_H */
diff --git a/include/net/llc_conn.h b/include/net/llc_conn.h
index 8ad3bc2c23d..54852ff6033 100644
--- a/include/net/llc_conn.h
+++ b/include/net/llc_conn.h
@@ -19,14 +19,14 @@
#define LLC_EVENT 1
#define LLC_PACKET 2
-#define LLC_P_TIME 2
-#define LLC_ACK_TIME 1
-#define LLC_REJ_TIME 3
-#define LLC_BUSY_TIME 3
+#define LLC2_P_TIME 2
+#define LLC2_ACK_TIME 1
+#define LLC2_REJ_TIME 3
+#define LLC2_BUSY_TIME 3
struct llc_timer {
struct timer_list timer;
- u16 expire; /* timer expire time */
+ unsigned long expire; /* timer expire time */
};
struct llc_sock {
@@ -38,6 +38,7 @@ struct llc_sock {
struct llc_addr laddr; /* lsap/mac pair */
struct llc_addr daddr; /* dsap/mac pair */
struct net_device *dev; /* device to send to remote */
+ u32 copied_seq; /* head of yet unread data */
u8 retry_count; /* number of retries */
u8 ack_must_be_send;
u8 first_pdu_Ns;
@@ -92,7 +93,8 @@ static __inline__ char llc_backlog_type(struct sk_buff *skb)
return skb->cb[sizeof(skb->cb) - 1];
}
-extern struct sock *llc_sk_alloc(int family, int priority, struct proto *prot);
+extern struct sock *llc_sk_alloc(int family, unsigned int __nocast priority,
+ struct proto *prot);
extern void llc_sk_free(struct sock *sk);
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);
extern u8 llc_data_accept_state(u8 state);
extern void llc_build_offset_table(void);
-extern int llc_release_sockets(struct llc_sap *sap);
#endif /* LLC_CONN_H */
diff --git a/include/net/llc_sap.h b/include/net/llc_sap.h
index 353baaa627f..2c56dbece72 100644
--- a/include/net/llc_sap.h
+++ b/include/net/llc_sap.h
@@ -12,11 +12,15 @@
* See the GNU General Public License for more details.
*/
struct llc_sap;
+struct net_device;
struct sk_buff;
+struct sock;
extern void llc_sap_rtn_pdu(struct llc_sap *sap, struct sk_buff *skb);
-extern void llc_save_primitive(struct sk_buff* skb, unsigned char prim);
-extern struct sk_buff *llc_alloc_frame(void);
+extern void llc_save_primitive(struct sock *sk, struct sk_buff* skb,
+ unsigned char prim);
+extern struct sk_buff *llc_alloc_frame(struct sock *sk,
+ struct net_device *dev);
extern void llc_build_and_send_test_pkt(struct llc_sap *sap,
struct sk_buff *skb,