~ubuntu-branches/ubuntu/precise/linux-ti-omap4/precise

« back to all changes in this revision

Viewing changes to drivers/char/rio/port.h

  • Committer: Bazaar Package Importer
  • Author(s): Paolo Pisati
  • Date: 2011-06-29 15:23:51 UTC
  • mfrom: (26.1.1 natty-proposed)
  • Revision ID: james.westby@ubuntu.com-20110629152351-xs96tm303d95rpbk
Tags: 3.0.0-1200.2
* Rebased against 3.0.0-6.7
* BSP from TI based on 3.0.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/*
2
 
** -----------------------------------------------------------------------------
3
 
**
4
 
**  Perle Specialix driver for Linux
5
 
**  Ported from existing RIO Driver for SCO sources.
6
 
 *
7
 
 *  (C) 1990 - 2000 Specialix International Ltd., Byfleet, Surrey, UK.
8
 
 *
9
 
 *      This program is free software; you can redistribute it and/or modify
10
 
 *      it under the terms of the GNU General Public License as published by
11
 
 *      the Free Software Foundation; either version 2 of the License, or
12
 
 *      (at your option) any later version.
13
 
 *
14
 
 *      This program is distributed in the hope that it will be useful,
15
 
 *      but WITHOUT ANY WARRANTY; without even the implied warranty of
16
 
 *      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17
 
 *      GNU General Public License for more details.
18
 
 *
19
 
 *      You should have received a copy of the GNU General Public License
20
 
 *      along with this program; if not, write to the Free Software
21
 
 *      Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
22
 
**
23
 
**      Module          : port.h
24
 
**      SID             : 1.3
25
 
**      Last Modified   : 11/6/98 11:34:12
26
 
**      Retrieved       : 11/6/98 11:34:21
27
 
**
28
 
**  ident @(#)port.h    1.3
29
 
**
30
 
** -----------------------------------------------------------------------------
31
 
*/
32
 
 
33
 
#ifndef __rio_port_h__
34
 
#define __rio_port_h__
35
 
 
36
 
/*
37
 
**      Port data structure
38
 
*/
39
 
struct Port {
40
 
        struct gs_port gs;
41
 
        int PortNum;                    /* RIO port no., 0-511 */
42
 
        struct Host *HostP;
43
 
        void __iomem *Caddr;
44
 
        unsigned short HostPort;        /* Port number on host card */
45
 
        unsigned char RupNum;           /* Number of RUP for port */
46
 
        unsigned char ID2;              /* Second ID of RTA for port */
47
 
        unsigned long State;            /* FLAGS for open & xopen */
48
 
#define RIO_LOPEN       0x00001         /* Local open */
49
 
#define RIO_MOPEN       0x00002         /* Modem open */
50
 
#define RIO_WOPEN       0x00004         /* Waiting for open */
51
 
#define RIO_CLOSING     0x00008         /* The port is being close */
52
 
#define RIO_XPBUSY      0x00010         /* Transparent printer busy */
53
 
#define RIO_BREAKING    0x00020         /* Break in progress */
54
 
#define RIO_DIRECT      0x00040         /* Doing Direct output */
55
 
#define RIO_EXCLUSIVE   0x00080         /* Stream open for exclusive use */
56
 
#define RIO_NDELAY      0x00100         /* Stream is open FNDELAY */
57
 
#define RIO_CARR_ON     0x00200         /* Stream has carrier present */
58
 
#define RIO_XPWANTR     0x00400         /* Stream wanted by Xprint */
59
 
#define RIO_RBLK        0x00800         /* Stream is read-blocked */
60
 
#define RIO_BUSY        0x01000         /* Stream is BUSY for write */
61
 
#define RIO_TIMEOUT     0x02000         /* Stream timeout in progress */
62
 
#define RIO_TXSTOP      0x04000         /* Stream output is stopped */
63
 
#define RIO_WAITFLUSH   0x08000         /* Stream waiting for flush */
64
 
#define RIO_DYNOROD     0x10000         /* Drain failed */
65
 
#define RIO_DELETED     0x20000         /* RTA has been deleted */
66
 
#define RIO_ISSCANCODE  0x40000         /* This line is in scancode mode */
67
 
#define RIO_USING_EUC   0x100000        /* Using extended Unix chars */
68
 
#define RIO_CAN_COOK    0x200000        /* This line can do cooking */
69
 
#define RIO_TRIAD_MODE  0x400000        /* Enable TRIAD special ops. */
70
 
#define RIO_TRIAD_BLOCK 0x800000        /* Next read will block */
71
 
#define RIO_TRIAD_FUNC  0x1000000       /* Seen a function key coming in */
72
 
#define RIO_THROTTLE_RX 0x2000000       /* RX needs to be throttled. */
73
 
 
74
 
        unsigned long Config;           /* FLAGS for NOREAD.... */
75
 
#define RIO_NOREAD      0x0001          /* Are not allowed to read port */
76
 
#define RIO_NOWRITE     0x0002          /* Are not allowed to write port */
77
 
#define RIO_NOXPRINT    0x0004          /* Are not allowed to xprint port */
78
 
#define RIO_NOMASK      0x0007          /* All not allowed things */
79
 
#define RIO_IXANY       0x0008          /* Port is allowed ixany */
80
 
#define RIO_MODEM       0x0010          /* Stream is a modem device */
81
 
#define RIO_IXON        0x0020          /* Port is allowed ixon */
82
 
#define RIO_WAITDRAIN   0x0040          /* Wait for port to completely drain */
83
 
#define RIO_MAP_50_TO_50        0x0080  /* Map 50 baud to 50 baud */
84
 
#define RIO_MAP_110_TO_110      0x0100  /* Map 110 baud to 110 baud */
85
 
 
86
 
/*
87
 
** 15.10.1998 ARG - ESIL 0761 prt fix
88
 
** As LynxOS does not appear to support Hardware Flow Control .....
89
 
** Define our own flow control flags in 'Config'.
90
 
*/
91
 
#define RIO_CTSFLOW     0x0200          /* RIO's own CTSFLOW flag */
92
 
#define RIO_RTSFLOW     0x0400          /* RIO's own RTSFLOW flag */
93
 
 
94
 
 
95
 
        struct PHB __iomem *PhbP;       /* pointer to PHB for port */
96
 
        u16 __iomem *TxAdd;             /* Add packets here */
97
 
        u16 __iomem *TxStart;           /* Start of add array */
98
 
        u16 __iomem *TxEnd;             /* End of add array */
99
 
        u16 __iomem *RxRemove;          /* Remove packets here */
100
 
        u16 __iomem *RxStart;           /* Start of remove array */
101
 
        u16 __iomem *RxEnd;             /* End of remove array */
102
 
        unsigned int RtaUniqueNum;      /* Unique number of RTA */
103
 
        unsigned short PortState;       /* status of port */
104
 
        unsigned short ModemState;      /* status of modem lines */
105
 
        unsigned long ModemLines;       /* Modem bits sent to RTA */
106
 
        unsigned char CookMode;         /* who expands CR/LF? */
107
 
        unsigned char ParamSem;         /* Prevent write during param */
108
 
        unsigned char Mapped;           /* if port mapped onto host */
109
 
        unsigned char SecondBlock;      /* if port belongs to 2nd block
110
 
                                                of 16 port RTA */
111
 
        unsigned char InUse;            /* how many pre-emptive cmds */
112
 
        unsigned char Lock;             /* if params locked */
113
 
        unsigned char Store;            /* if params stored across closes */
114
 
        unsigned char FirstOpen;        /* TRUE if first time port opened */
115
 
        unsigned char FlushCmdBodge;    /* if doing a (non)flush */
116
 
        unsigned char MagicFlags;       /* require intr processing */
117
 
#define MAGIC_FLUSH     0x01            /* mirror of WflushFlag */
118
 
#define MAGIC_REBOOT    0x02            /* RTA re-booted, re-open ports */
119
 
#define MORE_OUTPUT_EYGOR 0x04          /* riotproc failed to empty clists */
120
 
        unsigned char WflushFlag;       /* 1 How many WFLUSHs active */
121
 
/*
122
 
** Transparent print stuff
123
 
*/
124
 
        struct Xprint {
125
 
#ifndef MAX_XP_CTRL_LEN
126
 
#define MAX_XP_CTRL_LEN         16      /* ALSO IN DAEMON.H */
127
 
#endif
128
 
                unsigned int XpCps;
129
 
                char XpOn[MAX_XP_CTRL_LEN];
130
 
                char XpOff[MAX_XP_CTRL_LEN];
131
 
                unsigned short XpLen;   /* strlen(XpOn)+strlen(XpOff) */
132
 
                unsigned char XpActive;
133
 
                unsigned char XpLastTickOk;     /* TRUE if we can process */
134
 
#define XP_OPEN         00001
135
 
#define XP_RUNABLE      00002
136
 
                struct ttystatics *XttyP;
137
 
        } Xprint;
138
 
        unsigned char RxDataStart;
139
 
        unsigned char Cor2Copy;         /* copy of COR2 */
140
 
        char *Name;                     /* points to the Rta's name */
141
 
        char *TxRingBuffer;
142
 
        unsigned short TxBufferIn;      /* New data arrives here */
143
 
        unsigned short TxBufferOut;     /* Intr removes data here */
144
 
        unsigned short OldTxBufferOut;  /* Indicates if draining */
145
 
        int TimeoutId;                  /* Timeout ID */
146
 
        unsigned int Debug;
147
 
        unsigned char WaitUntilBooted;  /* True if open should block */
148
 
        unsigned int statsGather;       /* True if gathering stats */
149
 
        unsigned long txchars;          /* Chars transmitted */
150
 
        unsigned long rxchars;          /* Chars received */
151
 
        unsigned long opens;            /* port open count */
152
 
        unsigned long closes;           /* port close count */
153
 
        unsigned long ioctls;           /* ioctl count */
154
 
        unsigned char LastRxTgl;        /* Last state of rx toggle bit */
155
 
        spinlock_t portSem;             /* Lock using this sem */
156
 
        int MonitorTstate;              /* Monitoring ? */
157
 
        int timeout_id;                 /* For calling 100 ms delays */
158
 
        int timeout_sem;                /* For calling 100 ms delays */
159
 
        int firstOpen;                  /* First time open ? */
160
 
        char *p;                        /* save the global struc here .. */
161
 
};
162
 
 
163
 
struct ModuleInfo {
164
 
        char *Name;
165
 
        unsigned int Flags[4];          /* one per port on a module */
166
 
};
167
 
 
168
 
/*
169
 
** This struct is required because trying to grab an entire Port structure
170
 
** runs into problems with differing struct sizes between driver and config.
171
 
*/
172
 
struct PortParams {
173
 
        unsigned int Port;
174
 
        unsigned long Config;
175
 
        unsigned long State;
176
 
        struct ttystatics *TtyP;
177
 
};
178
 
 
179
 
#endif