From e5067d7cd967cb17067de24a162306b79f432b20 Mon Sep 17 00:00:00 2001 From: Ralf Baechle Date: Wed, 24 Jun 2015 04:23:46 +0200 Subject: Import newax25-2.4.3.patch.1.bz2 And cleanup the *.orig and *.rej files and whitespace errors that are part of the original patch. Signed-off-by: Ralf Baechle --- drivers/net/hamradio/6pack.h | 106 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 106 insertions(+) create mode 100644 drivers/net/hamradio/6pack.h (limited to 'drivers/net/hamradio/6pack.h') 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 + * Jens David + * + * This file is derived from slip.h, written by + * Fred N. van Kempen, + */ + +#ifndef _LINUX_6PACK_H +#define _LINUX_6PACK_H + +#include + +#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 */ -- cgit v1.2.3