vserver 2.0 rc7
[linux-2.6.git] / include / net / irda / af_irda.h
index 0f6dafa..7a209f6 100644 (file)
 #include <net/irda/irlmp.h>            /* struct lsap_cb */
 #include <net/irda/irttp.h>            /* struct tsap_cb */
 #include <net/irda/discovery.h>                /* struct discovery_t */
+#include <net/sock.h>
 
 /* IrDA Socket */
 struct irda_sock {
+       /* struct sock has to be the first member of irda_sock */
+       struct sock sk;
        __u32 saddr;          /* my local address */
        __u32 daddr;          /* peer address */
 
@@ -69,7 +72,6 @@ struct irda_sock {
 
        int errno;            /* status of the IAS query */
 
-       struct sock *sk;
        wait_queue_head_t query_wait;   /* Wait for the answer to a query */
        struct timer_list watchdog;     /* Timeout for discovery */
 
@@ -77,6 +79,9 @@ struct irda_sock {
        LOCAL_FLOW rx_flow;
 };
 
-#define irda_sk(__sk) ((struct irda_sock *)(__sk)->sk_protinfo)
+static inline struct irda_sock *irda_sk(struct sock *sk)
+{
+       return (struct irda_sock *)sk;
+}
 
 #endif /* AF_IRDA_H */