2 * 6pack.h Define the 6pack device driver interface and constants.
4 * NOTE: THIS FILE WILL BE MOVED TO THE LINUX INCLUDE DIRECTORY
7 * Version: @(#)6pack.h 0.3.0 04/07/98
11 * Author: Andreas Könsgen <ajk@iehk.rwth-aachen.de>
13 * This file is derived from slip.h, written by
14 * Fred N. van Kempen, <waltje@uwalt.nl.mugnet.org>
17 #ifndef _LINUX_6PACK_H
18 #define _LINUX_6PACK_H
20 #define SIXPACK_VERSION "Revision: 0.3.0"
24 /* sixpack priority commands */
25 #define SIXP_SEOF 0x40 /* start and end of a 6pack frame */
26 #define SIXP_TX_URUN 0x48 /* transmit overrun */
27 #define SIXP_RX_ORUN 0x50 /* receive overrun */
28 #define SIXP_RX_BUF_OVL 0x58 /* receive buffer overflow */
30 #define SIXP_CHKSUM 0xFF /* valid checksum of a 6pack frame */
32 /* masks to get certain bits out of the status bytes sent by the TNC */
34 #define SIXP_CMD_MASK 0xC0
35 #define SIXP_CHN_MASK 0x07
36 #define SIXP_PRIO_CMD_MASK 0x80
37 #define SIXP_STD_CMD_MASK 0x40
38 #define SIXP_PRIO_DATA_MASK 0x38
39 #define SIXP_TX_MASK 0x20
40 #define SIXP_RX_MASK 0x10
41 #define SIXP_RX_DCD_MASK 0x18
42 #define SIXP_LEDS_ON 0x78
43 #define SIXP_LEDS_OFF 0x60
47 #define SIXP_FOUND_TNC 0xe9
48 #define SIXP_CON_ON 0x68
49 #define SIXP_DCD_MASK 0x08
50 #define SIXP_DAMA_OFF 0
52 /* default level 2 parameters */
53 #define SIXP_TXDELAY 25 /* in 10 ms */
54 #define SIXP_PERSIST 50 /* in 256ths */
55 #define SIXP_SLOTTIME 10 /* in 10 ms */
56 #define SIXP_INIT_RESYNC_TIMEOUT 150 /* in 10 ms */
57 #define SIXP_RESYNC_TIMEOUT 500 /* in 10 ms */
59 /* 6pack configuration. */
60 #define SIXP_NRUNIT 256 /* MAX number of 6pack channels */
61 #define SIXP_MTU 256 /* Default MTU */
64 SIXPF_INUSE
, /* Channel in use */
65 SIXPF_ERROR
, /* Parity, etc. error */
72 struct tty_struct
*tty
; /* ptr to TTY structure */
73 struct net_device
*dev
; /* easy for intr handling */
75 /* These are pointers to the malloc()ed frame buffers. */
76 unsigned char *rbuff
; /* receiver buffer */
77 int rcount
; /* received chars counter */
78 unsigned char *xbuff
; /* transmitter buffer */
79 unsigned char *xhead
; /* pointer to next byte to XMIT */
80 int xleft
; /* bytes left in XMIT queue */
82 unsigned char raw_buf
[4];
83 unsigned char cooked_buf
[400];
85 unsigned int rx_count
;
86 unsigned int rx_count_cooked
;
88 /* 6pack interface statistics. */
89 unsigned long rx_packets
; /* inbound frames counter */
90 unsigned long tx_packets
; /* outbound frames counter */
91 unsigned long rx_bytes
; /* inbound bytes counter */
92 unsigned long tx_bytes
; /* outboud bytes counter */
93 unsigned long rx_errors
; /* Parity, etc. errors */
94 unsigned long tx_errors
; /* Planned stuff */
95 unsigned long rx_dropped
; /* No memory for skb */
96 unsigned long tx_dropped
; /* When MTU change */
97 unsigned long rx_over_errors
; /* Frame bigger then 6pack buf. */
99 /* Detailed 6pack statistics. */
101 int mtu
; /* Our mtu (to spot changes!) */
102 int buffsize
; /* Max buffers sizes */
104 unsigned char flags
; /* Flag values/ mode etc */
105 unsigned char mode
; /* 6pack mode */
109 unsigned char tx_delay
;
110 unsigned char persistance
;
111 unsigned char slottime
;
112 unsigned char duplex
;
113 unsigned char led_state
;
114 unsigned char status
;
115 unsigned char status1
;
116 unsigned char status2
;
117 unsigned char tx_enable
;
118 unsigned char tnc_ok
;
120 /* unsigned char retval; */
122 struct timer_list tx_t
;
123 struct timer_list resync_t
;
124 }; /* struct sixpack */
127 /* should later be moved to include/net/ax25.h */
128 #define AX25_6PACK_HEADER_LEN 0
129 #define SIXPACK_MAGIC 0x5304
131 extern int sixpack_init(struct net_device
*dev
);
135 #endif /* _LINUX_6PACK.H */