summaryrefslogtreecommitdiff
path: root/include/linux/if_ec.h
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@ppc970.osdl.org>2005-04-16 15:20:36 -0700
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-04-16 15:20:36 -0700
commit1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 (patch)
tree0bba044c4ce775e45a88a51686b5d9f90697ea9d /include/linux/if_ec.h
Linux-2.6.12-rc2v2.6.12-rc2
Initial git repository build. I'm not bothering with the full history, even though we have it. We can create a separate "historical" git archive of that later if we want to, and in the meantime it's about 3.2GB when imported into git - space that would just make the early git days unnecessarily complicated, when we don't have a lot of good infrastructure for it. Let it rip!
Diffstat (limited to 'include/linux/if_ec.h')
-rw-r--r--include/linux/if_ec.h72
1 files changed, 72 insertions, 0 deletions
diff --git a/include/linux/if_ec.h b/include/linux/if_ec.h
new file mode 100644
index 000000000000..e7499aa79783
--- /dev/null
+++ b/include/linux/if_ec.h
@@ -0,0 +1,72 @@
+/* Definitions for Econet sockets. */
+
+#ifndef __LINUX_IF_EC
+#define __LINUX_IF_EC
+
+/* User visible stuff. Glibc provides its own but libc5 folk will use these */
+
+struct ec_addr
+{
+ unsigned char station; /* Station number. */
+ unsigned char net; /* Network number. */
+};
+
+struct sockaddr_ec
+{
+ unsigned short sec_family;
+ unsigned char port; /* Port number. */
+ unsigned char cb; /* Control/flag byte. */
+ unsigned char type; /* Type of message. */
+ struct ec_addr addr;
+ unsigned long cookie;
+};
+
+#define ECTYPE_PACKET_RECEIVED 0 /* Packet received */
+#define ECTYPE_TRANSMIT_STATUS 0x10 /* Transmit completed,
+ low nibble holds status */
+
+#define ECTYPE_TRANSMIT_OK 1
+#define ECTYPE_TRANSMIT_NOT_LISTENING 2
+#define ECTYPE_TRANSMIT_NET_ERROR 3
+#define ECTYPE_TRANSMIT_NO_CLOCK 4
+#define ECTYPE_TRANSMIT_LINE_JAMMED 5
+#define ECTYPE_TRANSMIT_NOT_PRESENT 6
+
+#ifdef __KERNEL__
+
+#define EC_HLEN 6
+
+/* This is what an Econet frame looks like on the wire. */
+struct ec_framehdr
+{
+ unsigned char dst_stn;
+ unsigned char dst_net;
+ unsigned char src_stn;
+ unsigned char src_net;
+ unsigned char cb;
+ unsigned char port;
+};
+
+struct econet_sock {
+ /* struct sock has to be the first member of econet_sock */
+ struct sock sk;
+ unsigned char cb;
+ unsigned char port;
+ unsigned char station;
+ unsigned char net;
+ unsigned short num;
+};
+
+static inline struct econet_sock *ec_sk(const struct sock *sk)
+{
+ return (struct econet_sock *)sk;
+}
+
+struct ec_device
+{
+ unsigned char station, net; /* Econet protocol address */
+};
+
+#endif
+
+#endif