linux 2.6.16.38 w/ vs2.0.3-rc1
[linux-2.6.git] / include / net / ipx.h
index 064e5f7..0447b3c 100644 (file)
@@ -26,8 +26,8 @@ struct ipx_address {
 #define IPX_MAX_PPROP_HOPS 8
 
 struct ipxhdr {
-       __u16                   ipx_checksum __attribute__ ((packed));
-#define IPX_NO_CHECKSUM        0xFFFF
+       __be16                  ipx_checksum __attribute__ ((packed));
+#define IPX_NO_CHECKSUM        __constant_htons(0xFFFF)
        __u16                   ipx_pktsize __attribute__ ((packed));
        __u8                    ipx_tctrl;
        __u8                    ipx_type;
@@ -90,7 +90,11 @@ struct ipx_cb {
        } last_hop;
 };
 
-struct ipx_opt {
+#include <net/sock.h>
+
+struct ipx_sock {
+       /* struct sock has to be the first member of ipx_sock */
+       struct sock             sk;
        struct ipx_address      dest_addr;
        struct ipx_interface    *intrfc;
        unsigned short          port;
@@ -105,9 +109,14 @@ struct ipx_opt {
        unsigned short          ipx_ncp_conn;
 };
 
-#define ipx_sk(__sk) ((struct ipx_opt *)(__sk)->sk_protinfo)
+static inline struct ipx_sock *ipx_sk(struct sock *sk)
+{
+       return (struct ipx_sock *)sk;
+}
+
 #define IPX_SKB_CB(__skb) ((struct ipx_cb *)&((__skb)->cb[0]))
 #endif
+
 #define IPX_MIN_EPHEMERAL_SOCKET       0x4000
 #define IPX_MAX_EPHEMERAL_SOCKET       0x7fff
 
@@ -139,14 +148,6 @@ static __inline__ void ipxitf_put(struct ipx_interface *intrfc)
                ipxitf_down(intrfc);
 }
 
-extern void __ipxitf_down(struct ipx_interface *intrfc);
-
-static __inline__ void __ipxitf_put(struct ipx_interface *intrfc)
-{
-       if (atomic_dec_and_test(&intrfc->refcnt))
-               __ipxitf_down(intrfc);
-}
-
 static __inline__ void ipxrtr_hold(struct ipx_route *rt)
 {
                atomic_inc(&rt->refcnt);