summaryrefslogtreecommitdiffstats
path: root/include/linux/ax25_userdev.h
diff options
context:
space:
mode:
authorRalf Baechle <ralf@linux-mips.org>2015-06-24 04:23:46 +0200
committerRalf Baechle <ralf@linux-mips.org>2015-06-24 10:03:18 +0200
commite5067d7cd967cb17067de24a162306b79f432b20 (patch)
tree541f101762df32a5742bec354009986a96d8e564 /include/linux/ax25_userdev.h
parent86a981e836404006efc35881ebf3d5ae36925e82 (diff)
Import newax25-2.4.3.patch.1.bz2HEADnewax25-2.4.3-1
And cleanup the *.orig and *.rej files and whitespace errors that are part of the original patch. Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Diffstat (limited to 'include/linux/ax25_userdev.h')
-rw-r--r--include/linux/ax25_userdev.h120
1 files changed, 120 insertions, 0 deletions
diff --git a/include/linux/ax25_userdev.h b/include/linux/ax25_userdev.h
new file mode 100644
index 000000000..cc58a3e5e
--- /dev/null
+++ b/include/linux/ax25_userdev.h
@@ -0,0 +1,120 @@
+/*
+ * AX.25 usermode device driver.
+ * Copyright (C) 1999-2000 Maxim Krasnyansky <max_mk@yahoo.com>
+ * Copyright 2001, by Joerg Reuter <jreuter@yaina.de>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ */
+
+#ifndef __IF_AX25_UDEV_H
+#define __IF_AX25_UDEV_H
+
+#define AX25_UDEV_VER "0.1"
+#define AX25_UDEV_DEBUG
+
+/* Uncomment to enable debugging */
+/* #define AX25_UDEV_DEBUG 1 */
+
+#ifdef __KERNEL__
+
+#ifdef AX25_UDEV_DEBUG
+#define DBG if(ax25_udev->debug)printk
+#define DBG1 if(debug==2)printk
+#else
+#define DBG( a... )
+#define DBG1( a... )
+#endif
+
+struct ax25_udev_struct {
+ char name[IFNAMSIZ];
+ unsigned long flags;
+
+ struct fasync_struct *fasync;
+ wait_queue_head_t read_wait;
+
+ struct net_device dev;
+ struct sk_buff_head txq;
+ struct net_device_stats stats;
+ struct ax25_dev ax25_dev;
+
+ struct {
+ int duplex;
+ int arbitration;
+ } capabilities;
+
+ struct {
+ int dcd:1;
+ int cts:1;
+ int rts:1;
+ int ptt:1;
+ } status;
+
+#ifdef AX25_UDEV_DEBUG
+ int debug;
+#endif
+};
+
+#endif /* __KERNEL__ */
+
+/* Number of devices */
+#define AX25_UDEV_MAX_DEV 255
+
+/* TX queue size */
+#define AX25_UDEV_TXQ_SIZE 10
+
+/* Max frame size */
+#define AX25_UDEV_MAX_FRAME 4096
+
+/* AX25_UDEV device flags */
+#define AX25_UDEV_TYPE_MASK 0x000f
+#define AX25_UDEV_FASYNC 0x0010
+#define AX25_UDEV_IFF_SET 0x1000
+
+/* AX25_UDEV IFF ioctl */
+#define AX25_UDEV_SETIFF _IOW(0x25, 0, void *)
+#define AX25_UDEV_SETDEBUG _IOW(0x25, 1, int)
+
+/* Packet layout:
+ *
+ * (int) packet_type
+ * (int) data
+ * ...
+ *
+ * Exception for AX25_UDEV_DATA:
+ * (int) 0
+ * (char) octet
+ * ...
+ *
+ */
+
+typedef enum ax25_user_dev_commands_e {
+ AX25_UDEV_DATA,
+ AX25_UDEV_CAPABILITIES,
+ AX25_UDEV_DCD_STATUS,
+ AX25_UDEV_CTS_STATUS,
+ AX25_UDEV_PTT_STATUS,
+ AX25_UDEV_SET_MAC_VALUE,
+ AX25_UDEV_REQUEST_RTS
+} ax25_user_dev_commands_t;
+
+typedef enum ax25_user_dev_capabilities_e {
+ AX25_UDEV_CAP_HALF_DUPLEX,
+ AX25_UDEV_CAP_FULL_DUPLEX,
+ AX25_UDEV_CAP_ADVANCED_ARBITRATION,
+ AX25_UDEV_CAP_OWN_ARBITRATION,
+ AX25_UDEV_CAP_SIMPLE_ARBITRATION
+} ax25_user_dev_capabilities_t;
+
+typedef int ax25_udev_pt_t;
+typedef int ax25_udev_val_t;
+
+#endif /* __IF_AX25_UDEV_H */