percpu, module: implement and use is_kernel/module_percpu_address()
[safe/jmp/linux-2.6] / include / linux / phonet.h
index f921852..e5126cf 100644 (file)
@@ -23,6 +23,8 @@
 #ifndef LINUX_PHONET_H
 #define LINUX_PHONET_H
 
+#include <linux/types.h>
+
 /* Automatic protocol selection */
 #define PN_PROTO_TRANSPORT     0
 /* Phonet datagram socket */
 #define PN_PROTO_PIPE          2
 #define PHONET_NPROTO          3
 
+/* Socket options for SOL_PNPIPE level */
+#define PNPIPE_ENCAP           1
+#define PNPIPE_IFINDEX         2
+
 #define PNADDR_ANY             0
+#define PNADDR_BROADCAST       0xFC
 #define PNPORT_RESOURCE_ROUTING        0
 
+/* Values for PNPIPE_ENCAP option */
+#define PNPIPE_ENCAP_NONE      0
+#define PNPIPE_ENCAP_IP                1
+
 /* ioctls */
 #define SIOCPNGETOBJECT                (SIOCPROTOPRIVATE + 0)
 
@@ -64,6 +75,7 @@ struct phonetmsg {
        } pn_msg_u;
 };
 #define PN_COMMON_MESSAGE      0xF0
+#define PN_COMMGR              0x10
 #define PN_PREFIX              0xE0 /* resource for extended messages */
 #define pn_submsg_id           pn_msg_u.base.pn_submsg_id
 #define pn_e_submsg_id         pn_msg_u.ext.pn_e_submsg_id
@@ -88,6 +100,9 @@ struct sockaddr_pn {
        __u8 spn_zero[sizeof(struct sockaddr) - sizeof(sa_family_t) - 3];
 } __attribute__ ((packed));
 
+/* Well known address */
+#define PN_DEV_PC      0x10
+
 static inline __u16 pn_object(__u8 addr, __u16 port)
 {
        return (addr << 8) | (port & 0x3ff);
@@ -159,4 +174,21 @@ static inline __u8 pn_sockaddr_get_resource(const struct sockaddr_pn *spn)
        return spn->spn_resource;
 }
 
+/* Phonet device ioctl requests */
+#ifdef __KERNEL__
+#define SIOCPNGAUTOCONF                (SIOCDEVPRIVATE + 0)
+
+struct if_phonet_autoconf {
+       uint8_t device;
+};
+
+struct if_phonet_req {
+       char ifr_phonet_name[16];
+       union {
+               struct if_phonet_autoconf ifru_phonet_autoconf;
+       } ifr_ifru;
+};
+#define ifr_phonet_autoconf ifr_ifru.ifru_phonet_autoconf
+#endif /* __KERNEL__ */
+
 #endif