summaryrefslogtreecommitdiff
path: root/include/net
diff options
context:
space:
mode:
authorArnaldo Carvalho de Melo <acme@conectiva.com.br>2002-09-11 07:48:48 -0300
committerArnaldo Carvalho de Melo <acme@conectiva.com.br>2002-09-11 07:48:48 -0300
commit269f04b762fa11f693d3c3167afcdd4ca505fca6 (patch)
treed46f99f4f39506ab6e2c21871a051c651ef93967 /include/net
parentebf9bc772851196b2a5e8daf4eadd609c734501f (diff)
[LLC] use just one struct sock per connection
With this PF_LLC is tightly integrated with the core and that is a good thing 8) . kill llc_ui_opt, the only non-duplicated bit is struct sockaddr_llc and this now lives in llc_opt . remove debug code from llc_sk_alloc/free (previously llc_sock_alloc/free) . the skbs allocated for event processing don't need to have any payload at all, just the skb->cb is enough, so remove the bogus 1 from alloc_skb calls . llc_conn_disc put on death row . llc_process_tmr_ev callers have to hold the socket lock . the request functions in llc_if.c doesn't hold the socket lock anymore its up to its callers on the socket layer (llc_sock.c) . llc_sk_alloc now receives a priority for sk_alloc call and is the only way to alloc a new sock (from llc_mac and llc_sock, bottom and top) . added the traditional struct sock REFCNT_DEBUG support for llc . llc_sock was simplified and is on the zen route to cleanliness, wait for the next patches, it'll shrink a lot when I zap all the crap (as in not needed) list handling, using the existing list maintained in struct llc_sap for that, probably splitting it in two, one for listening sockets and other for (being) established ones. Ah, and the sap->ind and sap->req and friends will die.
Diffstat (limited to 'include/net')
-rw-r--r--include/net/llc_conn.h64
-rw-r--r--include/net/llc_if.h2
2 files changed, 7 insertions, 59 deletions
diff --git a/include/net/llc_conn.h b/include/net/llc_conn.h
index ea7725fa705f..3b2d68e45075 100644
--- a/include/net/llc_conn.h
+++ b/include/net/llc_conn.h
@@ -2,7 +2,7 @@
#define LLC_CONN_H
/*
* Copyright (c) 1997 by Procom Technology, Inc.
- * 2001 by Arnaldo Carvalho de Melo <acme@conectiva.com.br>
+ * 2001, 2002 by Arnaldo Carvalho de Melo <acme@conectiva.com.br>
*
* This program can be redistributed or modified under the terms of the
* GNU General Public License as published by the Free Software Foundation.
@@ -13,8 +13,7 @@
*/
#include <linux/timer.h>
#include <net/llc_if.h>
-
-#define DEBUG_LLC_CONN_ALLOC
+#include <linux/llc.h>
struct llc_timer {
struct timer_list timer;
@@ -25,7 +24,7 @@ struct llc_timer {
struct llc_opt {
struct list_head node; /* entry in sap->sk_list.list */
struct sock *sk; /* sock that has this llc_opt */
- void *handler; /* for upper layers usage */
+ struct sockaddr_llc addr; /* address sock is bound to */
u8 state; /* state of connection */
struct llc_sap *sap; /* pointer to parent SAP */
struct llc_addr laddr; /* lsap/mac pair */
@@ -80,60 +79,11 @@ struct llc_opt {
struct llc_conn_state_ev;
-extern struct sock *__llc_sock_alloc(int family);
-extern void __llc_sock_free(struct sock *sk, u8 free);
-
-#ifdef DEBUG_LLC_CONN_ALLOC
-#define dump_stack() printk(KERN_INFO "call trace: %p, %p, %p\n", \
- __builtin_return_address(0), \
- __builtin_return_address(1), \
- __builtin_return_address(2));
-#define llc_sock_alloc(family) ({ \
- struct sock *__sk = __llc_sock_alloc(family); \
- if (__sk) { \
- llc_sk(__sk)->f_alloc = __FUNCTION__; \
- llc_sk(__sk)->l_alloc = __LINE__; \
- } \
- __sk;})
-#define __llc_sock_assert(__sk) \
- if (llc_sk(__sk)->f_free) { \
- printk(KERN_ERR \
- "%p conn (alloc'd @ %s(%d)) " \
- "already freed @ %s(%d) " \
- "being used again @ %s(%d)\n", \
- llc_sk(__sk), \
- llc_sk(__sk)->f_alloc, llc_sk(__sk)->l_alloc, \
- llc_sk(__sk)->f_free, llc_sk(__sk)->l_free, \
- __FUNCTION__, __LINE__); \
- dump_stack();
-#define llc_sock_free(__sk) \
-{ \
- __llc_sock_assert(__sk) \
- } else { \
- __llc_sock_free(__sk, 0); \
- llc_sk(__sk)->f_free = __FUNCTION__; \
- llc_sk(__sk)->l_free = __LINE__; \
- } \
-}
-#define llc_sock_assert(__sk) \
-{ \
- __llc_sock_assert(__sk); \
- return; } \
-}
-#define llc_sock_assert_ret(__sk, __ret) \
-{ \
- __llc_sock_assert(__sk); \
- return __ret; } \
-}
-#else /* DEBUG_LLC_CONN_ALLOC */
-#define llc_sock_alloc(family) __llc_sock_alloc(family)
-#define llc_sock_free(__sk) __llc_sock_free(__sk, 1)
-#define llc_sock_assert(__sk)
-#define llc_sock_assert_ret(__sk)
-#endif /* DEBUG_LLC_CONN_ALLOC */
+extern struct sock *llc_sk_alloc(int family, int priority);
+extern void llc_sk_free(struct sock *sk);
-extern void llc_sock_reset(struct sock *sk);
-extern int llc_sock_init(struct sock *sk);
+extern void llc_sk_reset(struct sock *sk);
+extern int llc_sk_init(struct sock *sk);
/* Access to a connection */
extern int llc_conn_state_process(struct sock *sk, struct sk_buff *skb);
diff --git a/include/net/llc_if.h b/include/net/llc_if.h
index 975485fc42c0..e294c1d976b1 100644
--- a/include/net/llc_if.h
+++ b/include/net/llc_if.h
@@ -73,8 +73,6 @@ struct llc_prim_conn {
u8 pri; /* service_class */
struct net_device *dev;
struct sock *sk; /* returned from REQUEST */
- void *handler; /* upper layer use,
- stored in llc_opt->handler */
u16 link;
struct sk_buff *skb; /* received SABME */
};