summaryrefslogtreecommitdiffstats
path: root/drivers/net/hamradio/6pack.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 /drivers/net/hamradio/6pack.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 'drivers/net/hamradio/6pack.h')
-rw-r--r--drivers/net/hamradio/6pack.h106
1 files changed, 106 insertions, 0 deletions
diff --git a/drivers/net/hamradio/6pack.h b/drivers/net/hamradio/6pack.h
new file mode 100644
index 000000000..ac4ad0052
--- /dev/null
+++ b/drivers/net/hamradio/6pack.h
@@ -0,0 +1,106 @@
+/*
+ * 6pack.h Define the 6pack device driver interface and constants.
+ *
+ * Version: @(#)6pack.h 0.4.0 03/05/2000
+ *
+ * Author: Andreas Könsgen <ajk@iehk.rwth-aachen.de>
+ * Jens David <dg1kjd@afthd.tu-darmstadt.de>
+ *
+ * This file is derived from slip.h, written by
+ * Fred N. van Kempen, <waltje@uwalt.nl.mugnet.org>
+ */
+
+#ifndef _LINUX_6PACK_H
+#define _LINUX_6PACK_H
+
+#include <net/ax25dev.h>
+
+#define SIXPACK_VERSION "Revision: 0.4.0"
+
+#ifdef __KERNEL__
+
+/* sixpack priority commands */
+#define SIXP_SEOF 0x40 /* start and end of a 6pack frame */
+#define SIXP_TX_URUN 0x48 /* transmit overrun */
+#define SIXP_RX_ORUN 0x50 /* receive overrun */
+#define SIXP_RX_BUF_OVL 0x58 /* receive buffer overflow */
+#define SIXP_CHKSUM 0xFF /* valid checksum of a 6pack frame */
+
+/* masks to get certain bits out of the status bytes sent by the TNC */
+#define SIXP_CMD_MASK 0xC0
+#define SIXP_CHN_MASK 0x07
+#define SIXP_PRIO_CMD_MASK 0x80
+#define SIXP_STD_CMD_MASK 0x40
+#define SIXP_PRIO_DATA_MASK 0x38
+#define SIXP_TX_MASK 0x20
+#define SIXP_RX_MASK 0x10
+#define SIXP_RX_DCD_MASK 0x18
+#define SIXP_LEDS_ON 0x78
+#define SIXP_LEDS_OFF 0x60
+#define SIXP_CON 0x08
+#define SIXP_STA 0x10
+#define SIXP_FOUND_TNC 0xe9
+#define SIXP_CON_ON 0x68
+#define SIXP_DCD_MASK 0x08
+#define SIXP_DAMA_OFF 0
+
+/* default level 2 parameters */
+#define SIXP_TXDELAY 250 /* in ms */
+#define SIXP_INIT_RESYNC_TIMEOUT 1500 /* in ms */
+#define SIXP_RESYNC_TIMEOUT 5000 /* in ms */
+
+/* 6pack configuration. */
+#define SIXP_NRUNIT 256 /* MAX number of 6pack channels */
+#define SIXP_MTU (256+MAX_HEADER)
+
+struct sixpack {
+ struct tty_struct *tty; /* ptr to TTY structure */
+ struct net_device *dev; /* easy for intr handling */
+ struct ax25_dev ax25dev; /* AX.25 control structure */
+ struct net_device_stats stats; /* statistics */
+
+ spinlock_t lock;
+
+ /* These are pointers to the malloc()ed frame buffers. */
+ unsigned char *rbuff; /* receiver buffer */
+ int rcount; /* received chars counter */
+ unsigned char *xbuff; /* transmitter buffer */
+ unsigned char *xhead; /* pointer to next byte to XMIT */
+ int xleft; /* bytes left in XMIT queue */
+
+ unsigned char raw_buf[4];
+ unsigned char cooked_buf[400];
+
+ unsigned int rx_count;
+ unsigned int rx_count_cooked;
+
+ int mtu; /* Our mtu (to spot changes!) */
+ int buffsize; /* Max buffers sizes */
+
+ struct {
+ int in_use:1;
+ int error:1;
+ } flags;
+
+ unsigned char mode; /* 6pack mode */
+
+ /* 6pack stuff */
+ unsigned char led_state;
+ unsigned char status;
+ unsigned char status1;
+ unsigned char status2;
+ int tx_counter; /* counts "unack'ed" TX packets */
+ unsigned char tx_enable;
+ unsigned char tnc_ok;
+
+ struct timer_list resync_t;
+};
+
+struct sixpack_ctrl_t {
+ char if_name[8]; /* "sp0\0" .. "sp99999\0" */
+ struct sixpack ctrl; /* 6pack things */
+ struct net_device dev; /* the device */
+};
+
+#endif /* __KERNEL__ */
+#endif /* _LINUX_6PACK.H */