Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0 */
0002 /* $Id: scc.h,v 1.29 1997/04/02 14:56:45 jreuter Exp jreuter $ */
0003 #ifndef _SCC_H
0004 #define _SCC_H
0005 
0006 #include <uapi/linux/scc.h>
0007 
0008 
0009 enum {TX_OFF, TX_ON};   /* command for scc_key_trx() */
0010 
0011 /* Vector masks in RR2B */
0012 
0013 #define VECTOR_MASK 0x06
0014 #define TXINT       0x00
0015 #define EXINT       0x02
0016 #define RXINT       0x04
0017 #define SPINT       0x06
0018 
0019 #ifdef CONFIG_SCC_DELAY
0020 #define Inb(port)   inb_p(port)
0021 #define Outb(port, val) outb_p(val, port)
0022 #else
0023 #define Inb(port)   inb(port)
0024 #define Outb(port, val) outb(val, port)
0025 #endif
0026 
0027 /* SCC channel control structure for KISS */
0028 
0029 struct scc_kiss {
0030     unsigned char txdelay;      /* Transmit Delay 10 ms/cnt */
0031     unsigned char persist;      /* Persistence (0-255) as a % */
0032     unsigned char slottime;     /* Delay to wait on persistence hit */
0033     unsigned char tailtime;     /* Delay after last byte written */
0034     unsigned char fulldup;      /* Full Duplex mode 0=CSMA 1=DUP 2=ALWAYS KEYED */
0035     unsigned char waittime;     /* Waittime before any transmit attempt */
0036     unsigned int  maxkeyup;     /* Maximum time to transmit (seconds) */
0037     unsigned int  mintime;      /* Minimal offtime after MAXKEYUP timeout (seconds) */
0038     unsigned int  idletime;     /* Maximum idle time in ALWAYS KEYED mode (seconds) */
0039     unsigned int  maxdefer;     /* Timer for CSMA channel busy limit */
0040     unsigned char tx_inhibit;   /* Transmit is not allowed when set */  
0041     unsigned char group;        /* Group ID for AX.25 TX interlocking */
0042     unsigned char mode;     /* 'normal' or 'hwctrl' mode (unused) */
0043     unsigned char softdcd;      /* Use DPLL instead of DCD pin for carrier detect */
0044 };
0045 
0046 
0047 /* SCC channel structure */
0048 
0049 struct scc_channel {
0050     int init;           /* channel exists? */
0051 
0052     struct net_device *dev;     /* link to device control structure */
0053     struct net_device_stats dev_stat;/* device statistics */
0054 
0055     char brand;         /* manufacturer of the board */
0056     long clock;         /* used clock */
0057 
0058     io_port ctrl;           /* I/O address of CONTROL register */
0059     io_port data;           /* I/O address of DATA register */
0060     io_port special;        /* I/O address of special function port */
0061     int irq;            /* Number of Interrupt */
0062 
0063     char option;
0064     char enhanced;          /* Enhanced SCC support */
0065 
0066     unsigned char wreg[16];     /* Copy of last written value in WRx */
0067     unsigned char status;       /* Copy of R0 at last external interrupt */
0068     unsigned char dcd;      /* DCD status */
0069 
0070         struct scc_kiss kiss;       /* control structure for KISS params */
0071         struct scc_stat stat;       /* statistical information */
0072         struct scc_modem modem;     /* modem information */
0073 
0074         struct sk_buff_head tx_queue;   /* next tx buffer */
0075         struct sk_buff *rx_buff;    /* pointer to frame currently received */
0076         struct sk_buff *tx_buff;    /* pointer to frame currently transmitted */
0077 
0078     /* Timer */
0079     struct timer_list tx_t;     /* tx timer for this channel */
0080     struct timer_list tx_wdog;  /* tx watchdogs */
0081     
0082     /* Channel lock */
0083     spinlock_t  lock;       /* Channel guard lock */
0084 };
0085 
0086 #endif /* defined(_SCC_H) */