diff options
Diffstat (limited to 'drivers/char')
35 files changed, 2 insertions, 5126 deletions
diff --git a/drivers/char/esp.c b/drivers/char/esp.c index dd5dc8fa490d..3f3ac039f4d9 100644 --- a/drivers/char/esp.c +++ b/drivers/char/esp.c | |||
| @@ -2492,6 +2492,7 @@ static int __init espserial_init(void) | |||
| 2492 | } | 2492 | } |
| 2493 | 2493 | ||
| 2494 | memset((void *)info, 0, sizeof(struct esp_struct)); | 2494 | memset((void *)info, 0, sizeof(struct esp_struct)); |
| 2495 | spin_lock_init(&info->lock); | ||
| 2495 | /* rx_trigger, tx_trigger are needed by autoconfig */ | 2496 | /* rx_trigger, tx_trigger are needed by autoconfig */ |
| 2496 | info->config.rx_trigger = rx_trigger; | 2497 | info->config.rx_trigger = rx_trigger; |
| 2497 | info->config.tx_trigger = tx_trigger; | 2498 | info->config.tx_trigger = tx_trigger; |
| @@ -2528,7 +2529,6 @@ static int __init espserial_init(void) | |||
| 2528 | init_waitqueue_head(&info->close_wait); | 2529 | init_waitqueue_head(&info->close_wait); |
| 2529 | init_waitqueue_head(&info->delta_msr_wait); | 2530 | init_waitqueue_head(&info->delta_msr_wait); |
| 2530 | init_waitqueue_head(&info->break_wait); | 2531 | init_waitqueue_head(&info->break_wait); |
| 2531 | spin_lock_init(&info->lock); | ||
| 2532 | ports = info; | 2532 | ports = info; |
| 2533 | printk(KERN_INFO "ttyP%d at 0x%04x (irq = %d) is an ESP ", | 2533 | printk(KERN_INFO "ttyP%d at 0x%04x (irq = %d) is an ESP ", |
| 2534 | info->line, info->port, info->irq); | 2534 | info->line, info->port, info->irq); |
diff --git a/drivers/char/rio/brates.h b/drivers/char/rio/brates.h deleted file mode 100644 index dd686d58fd66..000000000000 --- a/drivers/char/rio/brates.h +++ /dev/null | |||
| @@ -1,106 +0,0 @@ | |||
| 1 | /**************************************************************************** | ||
| 2 | ******* ******* | ||
| 3 | ******* BRATES.H ******* | ||
| 4 | ******* ******* | ||
| 5 | **************************************************************************** | ||
| 6 | |||
| 7 | Author : Jeremy Rolls | ||
| 8 | Date : 1 Nov 1990 | ||
| 9 | |||
| 10 | * | ||
| 11 | * (C) 1990 - 2000 Specialix International Ltd., Byfleet, Surrey, UK. | ||
| 12 | * | ||
| 13 | * This program is free software; you can redistribute it and/or modify | ||
| 14 | * it under the terms of the GNU General Public License as published by | ||
| 15 | * the Free Software Foundation; either version 2 of the License, or | ||
| 16 | * (at your option) any later version. | ||
| 17 | * | ||
| 18 | * This program is distributed in the hope that it will be useful, | ||
| 19 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 20 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 21 | * GNU General Public License for more details. | ||
| 22 | * | ||
| 23 | * You should have received a copy of the GNU General Public License | ||
| 24 | * along with this program; if not, write to the Free Software | ||
| 25 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | ||
| 26 | |||
| 27 | Version : 0.01 | ||
| 28 | |||
| 29 | |||
| 30 | Mods | ||
| 31 | ---------------------------------------------------------------------------- | ||
| 32 | Date By Description | ||
| 33 | ---------------------------------------------------------------------------- | ||
| 34 | |||
| 35 | ***************************************************************************/ | ||
| 36 | |||
| 37 | #ifndef _brates_h | ||
| 38 | #ifndef lint | ||
| 39 | /* static char * _brates_h_sccs = "@(#)brates.h 1.4"; */ | ||
| 40 | #endif | ||
| 41 | #define _brates_h 1 | ||
| 42 | /* List of baud rate defines. Most are borrowed from /usr/include/sys/termio.h | ||
| 43 | */ | ||
| 44 | #ifndef INKERNEL | ||
| 45 | |||
| 46 | #define B0 0x00 | ||
| 47 | #define B50 0x01 | ||
| 48 | #define B75 0x02 | ||
| 49 | #define B110 0x03 | ||
| 50 | #define B134 0x04 | ||
| 51 | #define B150 0x05 | ||
| 52 | #define B200 0x06 | ||
| 53 | #define B300 0x07 | ||
| 54 | #define B600 0x08 | ||
| 55 | #define B1200 0x09 | ||
| 56 | #define B1800 0x0a | ||
| 57 | #define B2400 0x0b | ||
| 58 | #define B4800 0x0c | ||
| 59 | #define B9600 0x0d | ||
| 60 | #define B19200 0x0e | ||
| 61 | #define B38400 0x0f | ||
| 62 | |||
| 63 | #endif | ||
| 64 | |||
| 65 | /* | ||
| 66 | ** The following baudrates may or may not be defined | ||
| 67 | ** on various UNIX systems. | ||
| 68 | ** If they are not then we define them. | ||
| 69 | ** If they are then we do not define them ;-) | ||
| 70 | ** | ||
| 71 | ** This is appalling that we use same definitions as UNIX | ||
| 72 | ** for our own download code as there is no garuntee that | ||
| 73 | ** B57600 will be defined as 0x11 by a UNIX system.... | ||
| 74 | ** Arghhhhh!!!!!!!!!!!!!! | ||
| 75 | */ | ||
| 76 | #if !defined(B56000) | ||
| 77 | #define B56000 0x10 | ||
| 78 | #endif | ||
| 79 | |||
| 80 | #if !defined(B57600) | ||
| 81 | #define B57600 0x11 | ||
| 82 | #endif | ||
| 83 | |||
| 84 | #if !defined(B64000) | ||
| 85 | #define B64000 0x12 | ||
| 86 | #endif | ||
| 87 | |||
| 88 | #if !defined(B115200) | ||
| 89 | #define B115200 0x13 | ||
| 90 | #endif | ||
| 91 | |||
| 92 | |||
| 93 | #if !defined(B2000) | ||
| 94 | #define B2000 0x14 | ||
| 95 | #endif | ||
| 96 | |||
| 97 | |||
| 98 | #define MAX_RATE B2000 | ||
| 99 | |||
| 100 | struct baud_rate { /* Tag for baud rates */ | ||
| 101 | /* short host_rate, *//* As passed by the driver */ | ||
| 102 | short divisor, /* The divisor */ | ||
| 103 | prescaler; /* The pre-scaler */ | ||
| 104 | }; | ||
| 105 | |||
| 106 | #endif | ||
diff --git a/drivers/char/rio/chan.h b/drivers/char/rio/chan.h deleted file mode 100644 index af14311f9b66..000000000000 --- a/drivers/char/rio/chan.h +++ /dev/null | |||
| @@ -1,33 +0,0 @@ | |||
| 1 | /* | ||
| 2 | * | ||
| 3 | * (C) 1990 - 2000 Specialix International Ltd., Byfleet, Surrey, UK. | ||
| 4 | * | ||
| 5 | * This program is free software; you can redistribute it and/or modify | ||
| 6 | * it under the terms of the GNU General Public License as published by | ||
| 7 | * the Free Software Foundation; either version 2 of the License, or | ||
| 8 | * (at your option) any later version. | ||
| 9 | * | ||
| 10 | * This program is distributed in the hope that it will be useful, | ||
| 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 13 | * GNU General Public License for more details. | ||
| 14 | * | ||
| 15 | * You should have received a copy of the GNU General Public License | ||
| 16 | * along with this program; if not, write to the Free Software | ||
| 17 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | ||
| 18 | */ | ||
| 19 | #ifndef _chan_h | ||
| 20 | #define _chan_h | ||
| 21 | |||
| 22 | #ifndef lint | ||
| 23 | #ifdef SCCS | ||
| 24 | static char *_rio_chan_h_sccs = "@(#)chan.h 1.1"; | ||
| 25 | #endif | ||
| 26 | #endif | ||
| 27 | |||
| 28 | #define Link0 0 | ||
| 29 | #define Link1 1 | ||
| 30 | #define Link2 2 | ||
| 31 | #define Link3 3 | ||
| 32 | |||
| 33 | #endif | ||
diff --git a/drivers/char/rio/cmd.h b/drivers/char/rio/cmd.h deleted file mode 100644 index 797b62400c91..000000000000 --- a/drivers/char/rio/cmd.h +++ /dev/null | |||
| @@ -1,83 +0,0 @@ | |||
| 1 | |||
| 2 | |||
| 3 | /**************************************************************************** | ||
| 4 | ******* ******* | ||
| 5 | ******* C O M M A N D P A C K E T H E A D E R S | ||
| 6 | ******* ******* | ||
| 7 | **************************************************************************** | ||
| 8 | |||
| 9 | Author : Ian Nandhra | ||
| 10 | Date : | ||
| 11 | |||
| 12 | * | ||
| 13 | * (C) 1990 - 2000 Specialix International Ltd., Byfleet, Surrey, UK. | ||
| 14 | * | ||
| 15 | * This program is free software; you can redistribute it and/or modify | ||
| 16 | * it under the terms of the GNU General Public License as published by | ||
| 17 | * the Free Software Foundation; either version 2 of the License, or | ||
| 18 | * (at your option) any later version. | ||
| 19 | * | ||
| 20 | * This program is distributed in the hope that it will be useful, | ||
| 21 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 22 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 23 | * GNU General Public License for more details. | ||
| 24 | * | ||
| 25 | * You should have received a copy of the GNU General Public License | ||
| 26 | * along with this program; if not, write to the Free Software | ||
| 27 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | ||
| 28 | |||
| 29 | Version : 0.01 | ||
| 30 | |||
| 31 | |||
| 32 | Mods | ||
| 33 | ---------------------------------------------------------------------------- | ||
| 34 | Date By Description | ||
| 35 | ---------------------------------------------------------------------------- | ||
| 36 | |||
| 37 | ***************************************************************************/ | ||
| 38 | |||
| 39 | |||
| 40 | #ifndef _cmd_h | ||
| 41 | #define _cmd_h | ||
| 42 | |||
| 43 | #ifndef lint | ||
| 44 | #ifdef SCCS | ||
| 45 | static char *_rio_cmd_h_sccs = "@(#)cmd.h 1.1"; | ||
| 46 | #endif | ||
| 47 | #endif | ||
| 48 | |||
| 49 | |||
| 50 | #define PRE_EMPTIVE_CMD 0x80 | ||
| 51 | #define INLINE_CMD ~PRE_EMPTIVE_CMD | ||
| 52 | |||
| 53 | #define CMD_IGNORE_PKT ( (ushort) 0) | ||
| 54 | #define CMD_STATUS_REQ ( (ushort) 1) | ||
| 55 | #define CMD_UNIT_STATUS_REQ ( (ushort) 2) /* Is this needed ??? */ | ||
| 56 | #define CMD_CONF_PORT ( (ushort) 3) | ||
| 57 | #define CMD_CONF_UNIT ( (ushort) 4) | ||
| 58 | #define CMD_ROUTE_MAP_REQ ( (ushort) 5) | ||
| 59 | #define CMD_FLUSH_TX ( (ushort) 6) | ||
| 60 | #define CMD_FLUSH_RX ( (ushort) 7) | ||
| 61 | #define CMD_PARTION_PORT ( (ushort) 8) | ||
| 62 | #define CMD_RESET_PORT ( (ushort) 0x0a) | ||
| 63 | #define CMD_BOOT_UNIT ( (ushort) 0x0b) | ||
| 64 | #define CMD_FOUND_UNIT ( (ushort) 0x0c) | ||
| 65 | #define CMD_ATTACHED_RTA_2 ( (ushort) 0x0d) | ||
| 66 | #define CMD_PROVIDE_BOOT ( (ushort) 0x0e) | ||
| 67 | #define CMD_CIRRUS ( (ushort) 0x0f) | ||
| 68 | |||
| 69 | #define FORM_STATUS_PKT ( (ushort) 1 ) | ||
| 70 | #define FORM_POLL_PKT ( (ushort) 2 ) | ||
| 71 | #define FORM_LINK_STATUS_PKT ( (ushort) 3 ) | ||
| 72 | |||
| 73 | |||
| 74 | #define CMD_DATA_PORT ( (ushort) 1 ) | ||
| 75 | #define CMD_DATA ( (ushort) 2 ) | ||
| 76 | |||
| 77 | #define CMD_TX_PART ( (ushort) 2 ) | ||
| 78 | #define CMD_RX_PART ( (ushort) 3 ) | ||
| 79 | #define CMD_RX_LIMIT ( (ushort) 4 ) | ||
| 80 | |||
| 81 | #endif | ||
| 82 | |||
| 83 | /*********** end of file ***********/ | ||
diff --git a/drivers/char/rio/data.h b/drivers/char/rio/data.h deleted file mode 100644 index dabc2d1fa40f..000000000000 --- a/drivers/char/rio/data.h +++ /dev/null | |||
| @@ -1,40 +0,0 @@ | |||
| 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 : data.h | ||
| 24 | ** SID : 1.2 | ||
| 25 | ** Last Modified : 11/6/98 11:34:09 | ||
| 26 | ** Retrieved : 11/6/98 11:34:21 | ||
| 27 | ** | ||
| 28 | ** ident @(#)data.h 1.2 | ||
| 29 | ** | ||
| 30 | ** ----------------------------------------------------------------------------- | ||
| 31 | */ | ||
| 32 | |||
| 33 | #ifndef __rio_datadex__ | ||
| 34 | #define __rio_datadex__ | ||
| 35 | |||
| 36 | #ifndef lint | ||
| 37 | static char *_data_h_sccs_ = "@(#)data.h 1.2"; | ||
| 38 | #endif | ||
| 39 | |||
| 40 | #endif | ||
diff --git a/drivers/char/rio/debug.h b/drivers/char/rio/debug.h deleted file mode 100644 index 6ae95c00db4a..000000000000 --- a/drivers/char/rio/debug.h +++ /dev/null | |||
| @@ -1,39 +0,0 @@ | |||
| 1 | /* | ||
| 2 | ** File: debug.h | ||
| 3 | ** | ||
| 4 | ** Author: David Dix | ||
| 5 | ** | ||
| 6 | ** Created: 12th March 1993 | ||
| 7 | ** | ||
| 8 | ** Last modified: 93/04/27 | ||
| 9 | ** | ||
| 10 | * | ||
| 11 | * (C) 1990 - 2000 Specialix International Ltd., Byfleet, Surrey, UK. | ||
| 12 | * | ||
| 13 | * This program is free software; you can redistribute it and/or modify | ||
| 14 | * it under the terms of the GNU General Public License as published by | ||
| 15 | * the Free Software Foundation; either version 2 of the License, or | ||
| 16 | * (at your option) any later version. | ||
| 17 | * | ||
| 18 | * This program is distributed in the hope that it will be useful, | ||
| 19 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 20 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 21 | * GNU General Public License for more details. | ||
| 22 | * | ||
| 23 | * You should have received a copy of the GNU General Public License | ||
| 24 | * along with this program; if not, write to the Free Software | ||
| 25 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | ||
| 26 | */ | ||
| 27 | |||
| 28 | #ifndef _debug_h_ | ||
| 29 | #define _debug_h_ | ||
| 30 | |||
| 31 | |||
| 32 | #if defined(DCIRRUS) | ||
| 33 | #define DBPACKET(pkt, opt, str, chn) debug_packet((pkt), (opt), (str), (chn)) | ||
| 34 | #else | ||
| 35 | #define DBPACKET(pkt, opt, str, c) | ||
| 36 | #endif /* DCIRRUS */ | ||
| 37 | |||
| 38 | |||
| 39 | #endif /* _debug_h_ */ | ||
diff --git a/drivers/char/rio/eisa.h b/drivers/char/rio/eisa.h deleted file mode 100644 index c2abaf0eab04..000000000000 --- a/drivers/char/rio/eisa.h +++ /dev/null | |||
| @@ -1,104 +0,0 @@ | |||
| 1 | /* | ||
| 2 | ** ----------------------------------------------------------------------------- | ||
| 3 | ** | ||
| 4 | ** Perle Specialix driver for Linux | ||
| 5 | ** Ported from existing RIO Driver for SCO sources. | ||
| 6 | |||
| 7 | * | ||
| 8 | * (C) 1990 - 2000 Specialix International Ltd., Byfleet, Surrey, UK. | ||
| 9 | * | ||
| 10 | * This program is free software; you can redistribute it and/or modify | ||
| 11 | * it under the terms of the GNU General Public License as published by | ||
| 12 | * the Free Software Foundation; either version 2 of the License, or | ||
| 13 | * (at your option) any later version. | ||
| 14 | * | ||
| 15 | * This program is distributed in the hope that it will be useful, | ||
| 16 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 17 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 18 | * GNU General Public License for more details. | ||
| 19 | * | ||
| 20 | * You should have received a copy of the GNU General Public License | ||
| 21 | * along with this program; if not, write to the Free Software | ||
| 22 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | ||
| 23 | ** | ||
| 24 | ** Module : eisa.h | ||
| 25 | ** SID : 1.2 | ||
| 26 | ** Last Modified : 11/6/98 11:34:10 | ||
| 27 | ** Retrieved : 11/6/98 11:34:21 | ||
| 28 | ** | ||
| 29 | ** ident @(#)eisa.h 1.2 | ||
| 30 | ** | ||
| 31 | ** ----------------------------------------------------------------------------- | ||
| 32 | */ | ||
| 33 | |||
| 34 | #ifndef __rio_eisa_h__ | ||
| 35 | #define __rio_eisa_h__ | ||
| 36 | |||
| 37 | #ifdef SCCS_LABELS | ||
| 38 | #ifndef lint | ||
| 39 | static char *_eisa_h_sccs_ = "@(#)eisa.h 1.2"; | ||
| 40 | #endif | ||
| 41 | #endif | ||
| 42 | |||
| 43 | /* | ||
| 44 | ** things to do with the EISA bus | ||
| 45 | */ | ||
| 46 | |||
| 47 | #define RIO_EISA_STRING_ADDRESS 0xfffd9 /* where EISA is stored */ | ||
| 48 | |||
| 49 | #define RIO_MAX_EISA_SLOTS 16 /* how many EISA slots? */ | ||
| 50 | |||
| 51 | #define RIO_EISA_IDENT 0x984D /* Specialix */ | ||
| 52 | #define RIO_EISA_PRODUCT_CODE 0x14 /* Code 14 */ | ||
| 53 | #define RIO_EISA_ENABLE_BIT 0x01 /* To enable card */ | ||
| 54 | |||
| 55 | #define EISA_MEMORY_BASE_LO 0xC00 /* A16-A23 */ | ||
| 56 | #define EISA_MEMORY_BASE_HI 0xC01 /* A24-A31 */ | ||
| 57 | #define EISA_INTERRUPT_VEC 0xC02 /* see below */ | ||
| 58 | #define EISA_CONTROL_PORT 0xC02 /* see below */ | ||
| 59 | #define EISA_INTERRUPT_RESET 0xC03 /* read to clear IRQ */ | ||
| 60 | |||
| 61 | #define EISA_PRODUCT_IDENT_LO 0xC80 /* where RIO_EISA_IDENT is */ | ||
| 62 | #define EISA_PRODUCT_IDENT_HI 0xC81 | ||
| 63 | #define EISA_PRODUCT_NUMBER 0xC82 /* where PROD_CODE is */ | ||
| 64 | #define EISA_REVISION_NUMBER 0xC83 /* revision (1dp) */ | ||
| 65 | #define EISA_ENABLE 0xC84 /* set LSB to enable card */ | ||
| 66 | #define EISA_UNIQUE_NUM_0 0xC88 /* vomit */ | ||
| 67 | #define EISA_UNIQUE_NUM_1 0xC8A | ||
| 68 | #define EISA_UNIQUE_NUM_2 0xC90 /* bit strangely arranged */ | ||
| 69 | #define EISA_UNIQUE_NUM_3 0xC92 | ||
| 70 | #define EISA_MANUF_YEAR 0xC98 /* when */ | ||
| 71 | #define EISA_MANUF_WEEK 0xC9A /* more when */ | ||
| 72 | |||
| 73 | #define EISA_TP_BOOT_FROM_RAM 0x01 | ||
| 74 | #define EISA_TP_BOOT_FROM_LINK 0x00 | ||
| 75 | #define EISA_TP_FAST_LINKS 0x02 | ||
| 76 | #define EISA_TP_SLOW_LINKS 0x00 | ||
| 77 | #define EISA_TP_BUS_ENABLE 0x04 | ||
| 78 | #define EISA_TP_BUS_DISABLE 0x00 | ||
| 79 | #define EISA_TP_RUN 0x08 | ||
| 80 | #define EISA_TP_RESET 0x00 | ||
| 81 | #define EISA_POLLED 0x00 | ||
| 82 | #define EISA_IRQ_3 0x30 | ||
| 83 | #define EISA_IRQ_4 0x40 | ||
| 84 | #define EISA_IRQ_5 0x50 | ||
| 85 | #define EISA_IRQ_6 0x60 | ||
| 86 | #define EISA_IRQ_7 0x70 | ||
| 87 | #define EISA_IRQ_9 0x90 | ||
| 88 | #define EISA_IRQ_10 0xA0 | ||
| 89 | #define EISA_IRQ_11 0xB0 | ||
| 90 | #define EISA_IRQ_12 0xC0 | ||
| 91 | #define EISA_IRQ_14 0xE0 | ||
| 92 | #define EISA_IRQ_15 0xF0 | ||
| 93 | |||
| 94 | #define EISA_INTERRUPT_MASK 0xF0 | ||
| 95 | #define EISA_CONTROL_MASK 0x0F | ||
| 96 | |||
| 97 | #define RIO_EISA_DEFAULT_MODE EISA_TP_SLOW_LINKS | ||
| 98 | |||
| 99 | #define RIOEisaToIvec(X) (uchar )((uchar)((X) & EISA_INTERRUPT_MASK)>>4) | ||
| 100 | |||
| 101 | #define INBZ(z,x) inb(((z)<<12) | (x)) | ||
| 102 | #define OUTBZ(z,x,y) outb((((z)<<12) | (x)), y) | ||
| 103 | |||
| 104 | #endif /* __rio_eisa_h__ */ | ||
diff --git a/drivers/char/rio/enable.h b/drivers/char/rio/enable.h deleted file mode 100644 index e06673fa48cf..000000000000 --- a/drivers/char/rio/enable.h +++ /dev/null | |||
| @@ -1,48 +0,0 @@ | |||
| 1 | /**************************************************************************** | ||
| 2 | ******* ******* | ||
| 3 | ******* E N A B L E H E A D E R S | ||
| 4 | ******* ******* | ||
| 5 | **************************************************************************** | ||
| 6 | |||
| 7 | Author : Ian Nandhra | ||
| 8 | Date : | ||
| 9 | |||
| 10 | * | ||
| 11 | * (C) 1990 - 2000 Specialix International Ltd., Byfleet, Surrey, UK. | ||
| 12 | * | ||
| 13 | * This program is free software; you can redistribute it and/or modify | ||
| 14 | * it under the terms of the GNU General Public License as published by | ||
| 15 | * the Free Software Foundation; either version 2 of the License, or | ||
| 16 | * (at your option) any later version. | ||
| 17 | * | ||
| 18 | * This program is distributed in the hope that it will be useful, | ||
| 19 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 20 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 21 | * GNU General Public License for more details. | ||
| 22 | * | ||
| 23 | * You should have received a copy of the GNU General Public License | ||
| 24 | * along with this program; if not, write to the Free Software | ||
| 25 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | ||
| 26 | |||
| 27 | Version : 0.01 | ||
| 28 | |||
| 29 | |||
| 30 | Mods | ||
| 31 | ---------------------------------------------------------------------------- | ||
| 32 | Date By Description | ||
| 33 | ---------------------------------------------------------------------------- | ||
| 34 | |||
| 35 | ***************************************************************************/ | ||
| 36 | |||
| 37 | #ifndef lint | ||
| 38 | #ifdef SCCS | ||
| 39 | static char *_rio_enable_h_sccs = "@(#)enable.h 1.1"; | ||
| 40 | #endif | ||
| 41 | #endif | ||
| 42 | |||
| 43 | |||
| 44 | #define ENABLE_LTT TRUE | ||
| 45 | #define ENABLE_LRT TRUE | ||
| 46 | |||
| 47 | |||
| 48 | /*********** end of file ***********/ | ||
diff --git a/drivers/char/rio/formpkt.h b/drivers/char/rio/formpkt.h deleted file mode 100644 index 3c7c91ace3ee..000000000000 --- a/drivers/char/rio/formpkt.h +++ /dev/null | |||
| @@ -1,153 +0,0 @@ | |||
| 1 | |||
| 2 | |||
| 3 | /**************************************************************************** | ||
| 4 | ******* ******* | ||
| 5 | ******* F O R M P A C K E T H E A D E R F I L E | ||
| 6 | ******* ******* | ||
| 7 | **************************************************************************** | ||
| 8 | |||
| 9 | Author : Ian Nandhra | ||
| 10 | Date : | ||
| 11 | |||
| 12 | * | ||
| 13 | * (C) 1990 - 2000 Specialix International Ltd., Byfleet, Surrey, UK. | ||
| 14 | * | ||
| 15 | * This program is free software; you can redistribute it and/or modify | ||
| 16 | * it under the terms of the GNU General Public License as published by | ||
| 17 | * the Free Software Foundation; either version 2 of the License, or | ||
| 18 | * (at your option) any later version. | ||
| 19 | * | ||
| 20 | * This program is distributed in the hope that it will be useful, | ||
| 21 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 22 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 23 | * GNU General Public License for more details. | ||
| 24 | * | ||
| 25 | * You should have received a copy of the GNU General Public License | ||
| 26 | * along with this program; if not, write to the Free Software | ||
| 27 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | ||
| 28 | |||
| 29 | Version : 0.01 | ||
| 30 | |||
| 31 | |||
| 32 | Mods | ||
| 33 | ---------------------------------------------------------------------------- | ||
| 34 | Date By Description | ||
| 35 | ---------------------------------------------------------------------------- | ||
| 36 | |||
| 37 | ***************************************************************************/ | ||
| 38 | |||
| 39 | #ifndef _formpkt_h | ||
| 40 | #define _formpkt_h 1 | ||
| 41 | |||
| 42 | #ifndef lint | ||
| 43 | #ifdef SCCS | ||
| 44 | static char *_rio_formpkt_h_sccs = "@(#)formpkt.h 1.1"; | ||
| 45 | #endif | ||
| 46 | #endif | ||
| 47 | |||
| 48 | typedef struct FORM_BOOT_PKT_1 FORM_BOOT_PKT_1; | ||
| 49 | struct FORM_BOOT_PKT_1 { | ||
| 50 | ushort pkt_number; | ||
| 51 | ushort pkt_total; | ||
| 52 | ushort boot_top; | ||
| 53 | }; | ||
| 54 | |||
| 55 | typedef struct FORM_BOOT_PKT_2 FORM_BOOT_PKT_2; | ||
| 56 | struct FORM_BOOT_PKT_2 { | ||
| 57 | ushort pkt_number; | ||
| 58 | char boot_data[10]; | ||
| 59 | }; | ||
| 60 | |||
| 61 | |||
| 62 | typedef struct FORM_ATTACH_RTA FORM_ATTACH_RTA; | ||
| 63 | struct FORM_ATTACH_RTA { | ||
| 64 | char cmd_code; | ||
| 65 | char booter_serial[4]; | ||
| 66 | char booter_link; | ||
| 67 | char bootee_serial[4]; | ||
| 68 | char bootee_link; | ||
| 69 | }; | ||
| 70 | |||
| 71 | |||
| 72 | typedef struct FORM_BOOT_ID FORM_BOOT_ID; | ||
| 73 | struct FORM_BOOT_ID { | ||
| 74 | char cmd_code; | ||
| 75 | char bootee_serial[4]; | ||
| 76 | char bootee_prod_id; | ||
| 77 | char bootee_link; | ||
| 78 | }; | ||
| 79 | |||
| 80 | |||
| 81 | |||
| 82 | typedef struct FORM_ROUTE_1 FORM_ROUTE_1; | ||
| 83 | struct FORM_ROUTE_1 { | ||
| 84 | char cmd_code; | ||
| 85 | char pkt_number; | ||
| 86 | char total_in_sequence; | ||
| 87 | char unit_id; | ||
| 88 | char host_unit_id; | ||
| 89 | }; | ||
| 90 | |||
| 91 | typedef struct FORM_ROUTE_2 FORM_ROUTE_2; | ||
| 92 | struct FORM_ROUTE_2 { | ||
| 93 | char cmd_code; | ||
| 94 | char pkt_number; | ||
| 95 | char total_in_sequence; | ||
| 96 | char route_data[9]; | ||
| 97 | }; | ||
| 98 | |||
| 99 | typedef struct FORM_ROUTE_REQ FORM_ROUTE_REQ; | ||
| 100 | struct FORM_ROUTE_REQ { | ||
| 101 | char cmd_code; | ||
| 102 | char pkt_number; | ||
| 103 | char total_in_sequence; | ||
| 104 | char route_data[10]; | ||
| 105 | }; | ||
| 106 | |||
| 107 | |||
| 108 | typedef struct FORM_ERROR FORM_ERROR; | ||
| 109 | struct FORM_ERROR { | ||
| 110 | char cmd_code; | ||
| 111 | char error_code; | ||
| 112 | |||
| 113 | }; | ||
| 114 | |||
| 115 | typedef struct FORM_STATUS FORM_STATUS; | ||
| 116 | struct FORM_STATUS { | ||
| 117 | char cmd_code; | ||
| 118 | char status_code; | ||
| 119 | char last_packet_valid; | ||
| 120 | char tx_buffer; | ||
| 121 | char rx_buffer; | ||
| 122 | char port_status; | ||
| 123 | char phb_status; | ||
| 124 | }; | ||
| 125 | |||
| 126 | |||
| 127 | typedef struct FORM_LINK_STATUS FORM_LINK_STATUS; | ||
| 128 | struct FORM_LINK_STATUS { | ||
| 129 | char cmd_code; | ||
| 130 | char status_code; | ||
| 131 | char link_number; | ||
| 132 | ushort rx_errors; | ||
| 133 | ushort tx_errors; | ||
| 134 | ushort csum_errors; | ||
| 135 | ushort disconnects; | ||
| 136 | }; | ||
| 137 | |||
| 138 | |||
| 139 | |||
| 140 | typedef struct FORM_PARTITION FORM_PARTITION; | ||
| 141 | struct FORM_PARTITION { | ||
| 142 | char cmd_code; | ||
| 143 | char status_code; | ||
| 144 | char port_number; | ||
| 145 | char tx_max; | ||
| 146 | char rx_max; | ||
| 147 | char rx_limit; | ||
| 148 | }; | ||
| 149 | |||
| 150 | |||
| 151 | #endif | ||
| 152 | |||
| 153 | /*********** end of file ***********/ | ||
diff --git a/drivers/char/rio/hosthw.h b/drivers/char/rio/hosthw.h deleted file mode 100644 index 6281fe47f4e9..000000000000 --- a/drivers/char/rio/hosthw.h +++ /dev/null | |||
| @@ -1,55 +0,0 @@ | |||
| 1 | /**************************************************************************** | ||
| 2 | ******* ******* | ||
| 3 | ******* H O S T H A R D W A R E | ||
| 4 | ******* ******* | ||
| 5 | **************************************************************************** | ||
| 6 | |||
| 7 | Author : Ian Nandhra / Jeremy Rolls | ||
| 8 | Date : | ||
| 9 | |||
| 10 | * | ||
| 11 | * (C) 1990 - 2000 Specialix International Ltd., Byfleet, Surrey, UK. | ||
| 12 | * | ||
| 13 | * This program is free software; you can redistribute it and/or modify | ||
| 14 | * it under the terms of the GNU General Public License as published by | ||
| 15 | * the Free Software Foundation; either version 2 of the License, or | ||
| 16 | * (at your option) any later version. | ||
| 17 | * | ||
| 18 | * This program is distributed in the hope that it will be useful, | ||
| 19 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 20 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 21 | * GNU General Public License for more details. | ||
| 22 | * | ||
| 23 | * You should have received a copy of the GNU General Public License | ||
| 24 | * along with this program; if not, write to the Free Software | ||
| 25 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | ||
| 26 | |||
| 27 | Version : 0.01 | ||
| 28 | |||
| 29 | |||
| 30 | Mods | ||
| 31 | ---------------------------------------------------------------------------- | ||
| 32 | Date By Description | ||
| 33 | ---------------------------------------------------------------------------- | ||
| 34 | |||
| 35 | ***************************************************************************/ | ||
| 36 | |||
| 37 | |||
| 38 | #ifndef lint | ||
| 39 | #ifdef SCCS_LABELS | ||
| 40 | static char *_rio_hosthw_h_sccs = "@(#)hosthw.h 1.2"; | ||
| 41 | #endif | ||
| 42 | #endif | ||
| 43 | |||
| 44 | #define SET_OTHER_INTERRUPT ( (volatile u_short *) 0x7c80 ) | ||
| 45 | #define SET_EISA_INTERRUPT ( (volatile u_short *) 0x7ef0 ) | ||
| 46 | |||
| 47 | #define EISA_HOST 0x30 | ||
| 48 | #define AT_HOST 0xa0 | ||
| 49 | #define MCA_HOST 0xb0 | ||
| 50 | #define PCI_HOST 0xd0 | ||
| 51 | |||
| 52 | #define PRODUCT_MASK 0xf0 | ||
| 53 | |||
| 54 | |||
| 55 | /*********** end of file ***********/ | ||
diff --git a/drivers/char/rio/lrt.h b/drivers/char/rio/lrt.h deleted file mode 100644 index b41764d7a22a..000000000000 --- a/drivers/char/rio/lrt.h +++ /dev/null | |||
| @@ -1,52 +0,0 @@ | |||
| 1 | /**************************************************************************** | ||
| 2 | ******* ******* | ||
| 3 | ******* L R T | ||
| 4 | ******* ******* | ||
| 5 | **************************************************************************** | ||
| 6 | |||
| 7 | Author : Ian Nandhra / Jeremy Rolls | ||
| 8 | Date : | ||
| 9 | |||
| 10 | * | ||
| 11 | * (C) 1990 - 2000 Specialix International Ltd., Byfleet, Surrey, UK. | ||
| 12 | * | ||
| 13 | * This program is free software; you can redistribute it and/or modify | ||
| 14 | * it under the terms of the GNU General Public License as published by | ||
| 15 | * the Free Software Foundation; either version 2 of the License, or | ||
| 16 | * (at your option) any later version. | ||
| 17 | * | ||
| 18 | * This program is distributed in the hope that it will be useful, | ||
| 19 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 20 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 21 | * GNU General Public License for more details. | ||
| 22 | * | ||
| 23 | * You should have received a copy of the GNU General Public License | ||
| 24 | * along with this program; if not, write to the Free Software | ||
| 25 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | ||
| 26 | |||
| 27 | Version : 0.01 | ||
| 28 | |||
| 29 | |||
| 30 | Mods | ||
| 31 | ---------------------------------------------------------------------------- | ||
| 32 | Date By Description | ||
| 33 | ---------------------------------------------------------------------------- | ||
| 34 | |||
| 35 | ***************************************************************************/ | ||
| 36 | |||
| 37 | #ifndef lint | ||
| 38 | #ifdef SCCS_LABELS | ||
| 39 | static char *_rio_lrt_h_sccs = "@(#)lrt.h 1.1"; | ||
| 40 | #endif | ||
| 41 | #endif | ||
| 42 | |||
| 43 | |||
| 44 | #ifdef DCIRRUS | ||
| 45 | #define LRT_STACK (unsigned short) 600 | ||
| 46 | #else | ||
| 47 | #define LRT_STACK (ushort) 200 | ||
| 48 | #endif | ||
| 49 | |||
| 50 | |||
| 51 | |||
| 52 | /*********** end of file ***********/ | ||
diff --git a/drivers/char/rio/ltt.h b/drivers/char/rio/ltt.h deleted file mode 100644 index ab04004d4048..000000000000 --- a/drivers/char/rio/ltt.h +++ /dev/null | |||
| @@ -1,52 +0,0 @@ | |||
| 1 | /**************************************************************************** | ||
| 2 | ******* ******* | ||
| 3 | ******* L T T | ||
| 4 | ******* ******* | ||
| 5 | **************************************************************************** | ||
| 6 | |||
| 7 | Author : Ian Nandhra / Jeremy Rolls | ||
| 8 | Date : | ||
| 9 | |||
| 10 | * | ||
| 11 | * (C) 1990 - 2000 Specialix International Ltd., Byfleet, Surrey, UK. | ||
| 12 | * | ||
| 13 | * This program is free software; you can redistribute it and/or modify | ||
| 14 | * it under the terms of the GNU General Public License as published by | ||
| 15 | * the Free Software Foundation; either version 2 of the License, or | ||
| 16 | * (at your option) any later version. | ||
| 17 | * | ||
| 18 | * This program is distributed in the hope that it will be useful, | ||
| 19 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 20 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 21 | * GNU General Public License for more details. | ||
| 22 | * | ||
| 23 | * You should have received a copy of the GNU General Public License | ||
| 24 | * along with this program; if not, write to the Free Software | ||
| 25 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | ||
| 26 | |||
| 27 | Version : 0.01 | ||
| 28 | |||
| 29 | |||
| 30 | Mods | ||
| 31 | ---------------------------------------------------------------------------- | ||
| 32 | Date By Description | ||
| 33 | ---------------------------------------------------------------------------- | ||
| 34 | |||
| 35 | ***************************************************************************/ | ||
| 36 | |||
| 37 | #ifndef lint | ||
| 38 | #ifdef SCCS_LABELS | ||
| 39 | static char *_rio_ltt_h_sccs = "@(#)ltt.h 1.1"; | ||
| 40 | #endif | ||
| 41 | #endif | ||
| 42 | |||
| 43 | #ifdef DCIRRUS | ||
| 44 | #define LTT_STACK (unsigned short) 600 | ||
| 45 | #else | ||
| 46 | #define LTT_STACK (ushort) 200 | ||
| 47 | #endif | ||
| 48 | |||
| 49 | |||
| 50 | |||
| 51 | |||
| 52 | /*********** end of file ***********/ | ||
diff --git a/drivers/char/rio/lttwake.h b/drivers/char/rio/lttwake.h deleted file mode 100644 index fdf0c1f250ab..000000000000 --- a/drivers/char/rio/lttwake.h +++ /dev/null | |||
| @@ -1,50 +0,0 @@ | |||
| 1 | |||
| 2 | |||
| 3 | |||
| 4 | /**************************************************************************** | ||
| 5 | ******* ******* | ||
| 6 | ******* L T T W A K E U P H E A D E R | ||
| 7 | ******* ******* | ||
| 8 | **************************************************************************** | ||
| 9 | |||
| 10 | Author : Ian Nandhra | ||
| 11 | Date : | ||
| 12 | |||
| 13 | * | ||
| 14 | * (C) 1990 - 2000 Specialix International Ltd., Byfleet, Surrey, UK. | ||
| 15 | * | ||
| 16 | * This program is free software; you can redistribute it and/or modify | ||
| 17 | * it under the terms of the GNU General Public License as published by | ||
| 18 | * the Free Software Foundation; either version 2 of the License, or | ||
| 19 | * (at your option) any later version. | ||
| 20 | * | ||
| 21 | * This program is distributed in the hope that it will be useful, | ||
| 22 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 23 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 24 | * GNU General Public License for more details. | ||
| 25 | * | ||
| 26 | * You should have received a copy of the GNU General Public License | ||
| 27 | * along with this program; if not, write to the Free Software | ||
| 28 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | ||
| 29 | |||
| 30 | Version : 0.01 | ||
| 31 | |||
| 32 | |||
| 33 | Mods | ||
| 34 | ---------------------------------------------------------------------------- | ||
| 35 | Date By Description | ||
| 36 | ---------------------------------------------------------------------------- | ||
| 37 | |||
| 38 | ***************************************************************************/ | ||
| 39 | |||
| 40 | #ifndef lint | ||
| 41 | #ifdef SCCS_LABELS | ||
| 42 | static char *_rio_lttwake_h_sccs = "@(#)lttwake.h 1.1"; | ||
| 43 | #endif | ||
| 44 | #endif | ||
| 45 | |||
| 46 | #define LTT_WAKEUP_STACK 500 | ||
| 47 | #define LTT_WAKEUP_INTERVAL (int) (500 * MILLISECOND) | ||
| 48 | |||
| 49 | |||
| 50 | /*********** end of file ***********/ | ||
diff --git a/drivers/char/rio/mca.h b/drivers/char/rio/mca.h deleted file mode 100644 index d01e76be7a17..000000000000 --- a/drivers/char/rio/mca.h +++ /dev/null | |||
| @@ -1,73 +0,0 @@ | |||
| 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 : mca.h | ||
| 24 | ** SID : 1.2 | ||
| 25 | ** Last Modified : 11/6/98 11:34:11 | ||
| 26 | ** Retrieved : 11/6/98 11:34:21 | ||
| 27 | ** | ||
| 28 | ** ident @(#)mca.h 1.2 | ||
| 29 | ** | ||
| 30 | ** ----------------------------------------------------------------------------- | ||
| 31 | */ | ||
| 32 | |||
| 33 | #ifndef __rio_mca_h__ | ||
| 34 | #define __rio_mca_h__ | ||
| 35 | |||
| 36 | #ifdef SCCS_LABELS | ||
| 37 | static char *_mca_h_sccs_ = "@(#)mca.h 1.2"; | ||
| 38 | #endif | ||
| 39 | |||
| 40 | /* | ||
| 41 | ** Micro Channel stuff | ||
| 42 | */ | ||
| 43 | |||
| 44 | #define McaMaxSlots 8 | ||
| 45 | #define McaSlotSelect 0x96 | ||
| 46 | #define McaSlotEnable 0x08 | ||
| 47 | #define McaIdLow 0x100 | ||
| 48 | #define McaIdHigh 0x101 | ||
| 49 | #define McaIrqEnable 0x102 | ||
| 50 | #define McaMemory 0x103 | ||
| 51 | #define McaRIOId 0x6a5c | ||
| 52 | #define McaIrq9 0x00 | ||
| 53 | #define McaIrq3 0x02 | ||
| 54 | #define McaIrq4 0x04 | ||
| 55 | #define McaIrq7 0x06 | ||
| 56 | #define McaIrq10 0x08 | ||
| 57 | #define McaIrq11 0x0A | ||
| 58 | #define McaIrq12 0x0C | ||
| 59 | #define McaIrq15 0x0E | ||
| 60 | #define McaIrqMask 0x0E | ||
| 61 | #define McaCardEnable 0x01 | ||
| 62 | #define McaAddress(X) (((X)&0xFF)<<16) | ||
| 63 | |||
| 64 | #define McaTpFastLinks 0x40 | ||
| 65 | #define McaTpSlowLinks 0x00 | ||
| 66 | #define McaTpBootFromRam 0x01 | ||
| 67 | #define McaTpBootFromLink 0x00 | ||
| 68 | #define McaTpBusEnable 0x02 | ||
| 69 | #define McaTpBusDisable 0x00 | ||
| 70 | |||
| 71 | #define RIO_MCA_DEFAULT_MODE SLOW_LINKS | ||
| 72 | |||
| 73 | #endif /* __rio_mca_h__ */ | ||
diff --git a/drivers/char/rio/mesg.h b/drivers/char/rio/mesg.h deleted file mode 100644 index dd9be586ec6f..000000000000 --- a/drivers/char/rio/mesg.h +++ /dev/null | |||
| @@ -1,41 +0,0 @@ | |||
| 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 : mesg.h | ||
| 24 | ** SID : 1.2 | ||
| 25 | ** Last Modified : 11/6/98 11:34:12 | ||
| 26 | ** Retrieved : 11/6/98 11:34:21 | ||
| 27 | ** | ||
| 28 | ** ident @(#)mesg.h 1.2 | ||
| 29 | ** | ||
| 30 | ** ----------------------------------------------------------------------------- | ||
| 31 | */ | ||
| 32 | |||
| 33 | #ifndef __rio_mesg_h__ | ||
| 34 | #define __rio_mesg_h__ | ||
| 35 | |||
| 36 | #ifdef SCCS_LABELS | ||
| 37 | static char *_mesg_h_sccs_ = "@(#)mesg.h 1.2"; | ||
| 38 | #endif | ||
| 39 | |||
| 40 | |||
| 41 | #endif /* __rio_mesg_h__ */ | ||
diff --git a/drivers/char/rio/poll.h b/drivers/char/rio/poll.h deleted file mode 100644 index 9616ee4c6cd5..000000000000 --- a/drivers/char/rio/poll.h +++ /dev/null | |||
| @@ -1,73 +0,0 @@ | |||
| 1 | /**************************************************************************** | ||
| 2 | ******* ******* | ||
| 3 | ******* P O L L | ||
| 4 | ******* ******* | ||
| 5 | **************************************************************************** | ||
| 6 | |||
| 7 | Author : Ian Nandhra / Jeremy Rolls | ||
| 8 | Date : | ||
| 9 | |||
| 10 | * | ||
| 11 | * (C) 1990 - 2000 Specialix International Ltd., Byfleet, Surrey, UK. | ||
| 12 | * | ||
| 13 | * This program is free software; you can redistribute it and/or modify | ||
| 14 | * it under the terms of the GNU General Public License as published by | ||
| 15 | * the Free Software Foundation; either version 2 of the License, or | ||
| 16 | * (at your option) any later version. | ||
| 17 | * | ||
| 18 | * This program is distributed in the hope that it will be useful, | ||
| 19 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 20 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 21 | * GNU General Public License for more details. | ||
| 22 | * | ||
| 23 | * You should have received a copy of the GNU General Public License | ||
| 24 | * along with this program; if not, write to the Free Software | ||
| 25 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | ||
| 26 | |||
| 27 | Version : 0.01 | ||
| 28 | |||
| 29 | |||
| 30 | Mods | ||
| 31 | ---------------------------------------------------------------------------- | ||
| 32 | Date By Description | ||
| 33 | ---------------------------------------------------------------------------- | ||
| 34 | |||
| 35 | ***************************************************************************/ | ||
| 36 | |||
| 37 | #ifndef _poll_h | ||
| 38 | #define _poll_h | ||
| 39 | |||
| 40 | #ifndef lint | ||
| 41 | #ifdef SCCS_LABELS | ||
| 42 | static char *_rio_poll_h_sccs = "@(#)poll.h 1.2"; | ||
| 43 | #endif | ||
| 44 | #endif | ||
| 45 | |||
| 46 | |||
| 47 | #ifdef HOST | ||
| 48 | #define POLL_STACK 100 | ||
| 49 | #endif | ||
| 50 | #ifdef RTA | ||
| 51 | #define POLL_STACK 200 | ||
| 52 | #endif | ||
| 53 | |||
| 54 | #define POLL_PERIOD (int) SECOND | ||
| 55 | |||
| 56 | /* The various poll commands */ | ||
| 57 | #define POLL_POLL 0 /* We are connected and happy.. */ | ||
| 58 | #define POLL_INTRO 1 /* Introduction packet */ | ||
| 59 | #define POLL_TOPOLOGY 2 /* Topology update */ | ||
| 60 | #define POLL_ASSIGN 3 /* ID assign */ | ||
| 61 | #define POLL_FOAD 4 /* F*** Off And Die */ | ||
| 62 | #define POLL_LMD 5 /* Let Me Die */ | ||
| 63 | #define POLL_DYB 6 /* Die You Ba***** */ | ||
| 64 | |||
| 65 | /* The way data fields are split up for POLL packets */ | ||
| 66 | #define POLL_HOST_SERIAL 2 /* Host who booted me */ | ||
| 67 | #define POLL_MY_SERIAL 6 /* My serial number */ | ||
| 68 | #define POLL_YOUR_ID 1 /* Your ID number */ | ||
| 69 | #define POLL_TOPOLOGY_FIELDS 2 /* Topology maps */ | ||
| 70 | |||
| 71 | #endif | ||
| 72 | |||
| 73 | /*********** end of file ***********/ | ||
diff --git a/drivers/char/rio/proto.h b/drivers/char/rio/proto.h deleted file mode 100644 index f9a3376333e5..000000000000 --- a/drivers/char/rio/proto.h +++ /dev/null | |||
| @@ -1,244 +0,0 @@ | |||
| 1 | /* | ||
| 2 | * | ||
| 3 | * (C) 1990 - 2000 Specialix International Ltd., Byfleet, Surrey, UK. | ||
| 4 | * | ||
| 5 | * This program is free software; you can redistribute it and/or modify | ||
| 6 | * it under the terms of the GNU General Public License as published by | ||
| 7 | * the Free Software Foundation; either version 2 of the License, or | ||
| 8 | * (at your option) any later version. | ||
| 9 | * | ||
| 10 | * This program is distributed in the hope that it will be useful, | ||
| 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 13 | * GNU General Public License for more details. | ||
| 14 | * | ||
| 15 | * You should have received a copy of the GNU General Public License | ||
| 16 | * along with this program; if not, write to the Free Software | ||
| 17 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | ||
| 18 | */ | ||
| 19 | #ifndef _prototypes_h | ||
| 20 | #define _prototypes_h | ||
| 21 | |||
| 22 | |||
| 23 | /* | ||
| 24 | ** boot.c | ||
| 25 | */ | ||
| 26 | void init_boot(char *p, short stage); | ||
| 27 | |||
| 28 | /* | ||
| 29 | ** disconct.c | ||
| 30 | */ | ||
| 31 | void kill_boot(LPB * link); | ||
| 32 | void disconnected(LPB * link); | ||
| 33 | short boot_3(LPB * link, PKT * pkt); | ||
| 34 | short send_3_pkt(LPB * link, PKT * pkt); | ||
| 35 | |||
| 36 | /* | ||
| 37 | ** error.c | ||
| 38 | */ | ||
| 39 | void du_error(void); | ||
| 40 | |||
| 41 | /* | ||
| 42 | ** formpkt.c | ||
| 43 | */ | ||
| 44 | ushort sum_it(PKT * pkt); | ||
| 45 | void form_rup_pkt(RUP * form_rup, PKT * pkt); | ||
| 46 | void form_poll_pkt(int type, LPB * link, int node); | ||
| 47 | void form_route_pkt(int type, PKT * pkt, LPB * link); | ||
| 48 | |||
| 49 | /* | ||
| 50 | ** idle.c | ||
| 51 | */ | ||
| 52 | void idle(Process * idle_p); | ||
| 53 | |||
| 54 | /* | ||
| 55 | ** init.c | ||
| 56 | */ | ||
| 57 | void general_init(void); | ||
| 58 | void mem_halt(int error); | ||
| 59 | |||
| 60 | /* | ||
| 61 | ** linkinit.c | ||
| 62 | */ | ||
| 63 | void initlink(u_short number, LPB * link); | ||
| 64 | void runlink(LPB * link); | ||
| 65 | |||
| 66 | /* | ||
| 67 | ** list.c | ||
| 68 | */ | ||
| 69 | PKT *get_free_start(void); | ||
| 70 | void put_free_start(PKT * pkt); | ||
| 71 | |||
| 72 | #ifdef HOST | ||
| 73 | int can_remove_transmit(PKT ** pkt, PKT * pointer); | ||
| 74 | #endif | ||
| 75 | |||
| 76 | #ifdef RTA | ||
| 77 | int spl7(void); | ||
| 78 | int spl0(void); | ||
| 79 | Q_BUF *get_free_q(void); | ||
| 80 | PKT *get_free_end(void); | ||
| 81 | int add_end(PKT * pkt, PHB * phb, int type); | ||
| 82 | unsigned short free_packets(PHB * phb, int type); | ||
| 83 | int can_remove_start(PKT ** pkt, PHB * phb, int type); | ||
| 84 | int can_add_start(PHB * phb, int type); | ||
| 85 | int can_add_end(PHB * phb, int type); | ||
| 86 | void put_free_end(PKT * pkt); | ||
| 87 | int remove_start(PKT ** pkt, PHB * phb, int type); | ||
| 88 | #endif | ||
| 89 | |||
| 90 | /* | ||
| 91 | ** Lrt.c | ||
| 92 | */ | ||
| 93 | void lrt(Process * lrt_p, LPB * link); | ||
| 94 | |||
| 95 | #ifdef RTA | ||
| 96 | void set_led_red(LPB * link); | ||
| 97 | #endif | ||
| 98 | |||
| 99 | /* | ||
| 100 | ** ltt.c | ||
| 101 | */ | ||
| 102 | void ltt(Process * ltt_p, LPB * link, PHB * phb_ptr[]); | ||
| 103 | void send_poll(LPB * link); | ||
| 104 | void request_id(LPB * link); | ||
| 105 | void send_topology_update(LPB * link); | ||
| 106 | void send_topology(LPB * link); | ||
| 107 | void supply_id(LPB * link); | ||
| 108 | |||
| 109 | #ifdef RTA | ||
| 110 | void redirect_queue(LPB * link, ushort flush); | ||
| 111 | int obtain_rup(int rup_number, PKT ** pkt_address, LPB * link); | ||
| 112 | #endif | ||
| 113 | |||
| 114 | #ifdef TESTING_PERF | ||
| 115 | int consume_cpu(void); | ||
| 116 | #endif | ||
| 117 | |||
| 118 | /* | ||
| 119 | ** lttwake.c | ||
| 120 | */ | ||
| 121 | #ifdef HOST | ||
| 122 | void ltt_wakeup(Process * ltt_wakeup_p); | ||
| 123 | #endif | ||
| 124 | |||
| 125 | /* | ||
| 126 | ** mapgen.c | ||
| 127 | */ | ||
| 128 | void generate_id_map(short mapping, ROUTE_STR route[]); | ||
| 129 | void gen_map(int mapping, int looking_at, int come_from, ROUTE_STR route[], int link, int *ttl); | ||
| 130 | void adjust_ttl(int mapping, int looking_at, int come_from, ROUTE_STR route[], int link, int *ttl); | ||
| 131 | void init_sys_map(void); | ||
| 132 | |||
| 133 | /* | ||
| 134 | ** mmu.c | ||
| 135 | */ | ||
| 136 | char *rio_malloc(unsigned int amount); | ||
| 137 | char *rio_calloc(unsigned int num, unsigned int size); | ||
| 138 | ERROR rio_mmu_init(uint total_mem); | ||
| 139 | |||
| 140 | /* | ||
| 141 | ** partn.c | ||
| 142 | */ | ||
| 143 | void partition_tx(struct PHB *phb, u_short tx_size, u_short rx_size, u_short rx_limit); | ||
| 144 | |||
| 145 | /* | ||
| 146 | ** poll.c | ||
| 147 | */ | ||
| 148 | void tx_poll(Process * tx_poll_p); | ||
| 149 | |||
| 150 | /* | ||
| 151 | ** process.c | ||
| 152 | */ | ||
| 153 | int get_proc_space(Process ** pd, int **pws, int wssize); | ||
| 154 | |||
| 155 | /* | ||
| 156 | ** readrom.c | ||
| 157 | */ | ||
| 158 | void read_serial_number(char *buf); | ||
| 159 | |||
| 160 | /* | ||
| 161 | ** rio.c | ||
| 162 | */ | ||
| 163 | int main(void); | ||
| 164 | |||
| 165 | /* | ||
| 166 | ** route.c | ||
| 167 | */ | ||
| 168 | void route_update(PKT * pkt, LPB * link); | ||
| 169 | |||
| 170 | /* | ||
| 171 | ** rtainit.c | ||
| 172 | */ | ||
| 173 | #if defined(RTA) | ||
| 174 | void rta_init(ushort RtaType); | ||
| 175 | #endif /* defined(RTA) */ | ||
| 176 | |||
| 177 | /* | ||
| 178 | ** rupboot.c | ||
| 179 | */ | ||
| 180 | void rup_boot(PKT * pkt, RUP * this_rup, LPB * link); | ||
| 181 | |||
| 182 | #ifdef RTA | ||
| 183 | void kill_your_neighbour(int link_to_kill); | ||
| 184 | #endif | ||
| 185 | |||
| 186 | /* | ||
| 187 | ** rupcmd.c | ||
| 188 | */ | ||
| 189 | void rup_command(PKT * pkt, struct RUP *this_rup, LPB * link); | ||
| 190 | |||
| 191 | /* | ||
| 192 | ** ruperr.c | ||
| 193 | */ | ||
| 194 | void rup_error(PKT * pkt, RUP * this_rup, LPB * link); | ||
| 195 | void illegal_cmd(PKT * src_pkt); | ||
| 196 | |||
| 197 | /* | ||
| 198 | ** ruppoll.c | ||
| 199 | */ | ||
| 200 | void rup_poll(PKT * pkt, RUP * this_rup, LPB * link); | ||
| 201 | |||
| 202 | /* | ||
| 203 | ** ruppower.c | ||
| 204 | */ | ||
| 205 | void rup_power(PKT * pkt, RUP * this_rup, LPB * link); | ||
| 206 | |||
| 207 | /* | ||
| 208 | ** ruprm.c | ||
| 209 | */ | ||
| 210 | void rup_route_map(PKT * pkt, RUP * this_rup, LPB * link); | ||
| 211 | |||
| 212 | /* | ||
| 213 | ** rupstat.c | ||
| 214 | */ | ||
| 215 | void rup_status(PKT * pkt, RUP * this_rup, LPB * link); | ||
| 216 | |||
| 217 | /* | ||
| 218 | ** rupsync.c | ||
| 219 | */ | ||
| 220 | void rup_sync(PKT * pkt); | ||
| 221 | |||
| 222 | /* | ||
| 223 | ** rxpkt.c | ||
| 224 | */ | ||
| 225 | ERROR rx_pkt(PKT_ptr_ptr pkt_address, LPB * link); | ||
| 226 | |||
| 227 | /* | ||
| 228 | ** sendsts.c | ||
| 229 | */ | ||
| 230 | void send_status(PKT * requesting_pkt, RUP * this_rup); | ||
| 231 | |||
| 232 | /* | ||
| 233 | ** serial.c | ||
| 234 | */ | ||
| 235 | void assign_serial(char *ser_in, char *ser_out); | ||
| 236 | int cmp_serial(char *ser_1, char *ser_2); | ||
| 237 | |||
| 238 | /* | ||
| 239 | ** txpkt.c | ||
| 240 | */ | ||
| 241 | ERROR tx_pkt(PKT * pkt, LPB * link); | ||
| 242 | short send_sync(LPB * link); | ||
| 243 | |||
| 244 | #endif /* _prototypes_h */ | ||
diff --git a/drivers/char/rio/rio_linux.c b/drivers/char/rio/rio_linux.c index 8825bd61b7d0..c9af283a811d 100644 --- a/drivers/char/rio/rio_linux.c +++ b/drivers/char/rio/rio_linux.c | |||
| @@ -132,16 +132,6 @@ more than 512 ports.... */ | |||
| 132 | */ | 132 | */ |
| 133 | #define IRQ_RATE_LIMIT 200 | 133 | #define IRQ_RATE_LIMIT 200 |
| 134 | 134 | ||
| 135 | #if 0 | ||
| 136 | /* Not implemented */ | ||
| 137 | /* | ||
| 138 | * The following defines are mostly for testing purposes. But if you need | ||
| 139 | * some nice reporting in your syslog, you can define them also. | ||
| 140 | */ | ||
| 141 | #define RIO_REPORT_FIFO | ||
| 142 | #define RIO_REPORT_OVERRUN | ||
| 143 | #endif | ||
| 144 | |||
| 145 | 135 | ||
| 146 | /* These constants are derived from SCO Source */ | 136 | /* These constants are derived from SCO Source */ |
| 147 | static struct Conf | 137 | static struct Conf |
| @@ -573,21 +563,6 @@ static void rio_shutdown_port(void *ptr) | |||
| 573 | 563 | ||
| 574 | PortP = (struct Port *) ptr; | 564 | PortP = (struct Port *) ptr; |
| 575 | PortP->gs.tty = NULL; | 565 | PortP->gs.tty = NULL; |
| 576 | #if 0 | ||
| 577 | port->gs.flags &= ~GS_ACTIVE; | ||
| 578 | if (!port->gs.tty) { | ||
| 579 | rio_dprintk(RIO_DBUG_TTY, "No tty.\n"); | ||
| 580 | return; | ||
| 581 | } | ||
| 582 | if (!port->gs.tty->termios) { | ||
| 583 | rio_dprintk(RIO_DEBUG_TTY, "No termios.\n"); | ||
| 584 | return; | ||
| 585 | } | ||
| 586 | if (port->gs.tty->termios->c_cflag & HUPCL) { | ||
| 587 | rio_setsignals(port, 0, 0); | ||
| 588 | } | ||
| 589 | #endif | ||
| 590 | |||
| 591 | func_exit(); | 566 | func_exit(); |
| 592 | } | 567 | } |
| 593 | 568 | ||
| @@ -663,11 +638,6 @@ static int rio_ioctl(struct tty_struct *tty, struct file *filp, unsigned int cmd | |||
| 663 | 638 | ||
| 664 | rc = 0; | 639 | rc = 0; |
| 665 | switch (cmd) { | 640 | switch (cmd) { |
| 666 | #if 0 | ||
| 667 | case TIOCGSOFTCAR: | ||
| 668 | rc = put_user(((tty->termios->c_cflag & CLOCAL) ? 1 : 0), (unsigned int *) arg); | ||
| 669 | break; | ||
| 670 | #endif | ||
| 671 | case TIOCSSOFTCAR: | 641 | case TIOCSSOFTCAR: |
| 672 | if ((rc = get_user(ival, (unsigned int *) arg)) == 0) { | 642 | if ((rc = get_user(ival, (unsigned int *) arg)) == 0) { |
| 673 | tty->termios->c_cflag = (tty->termios->c_cflag & ~CLOCAL) | (ival ? CLOCAL : 0); | 643 | tty->termios->c_cflag = (tty->termios->c_cflag & ~CLOCAL) | (ival ? CLOCAL : 0); |
| @@ -709,36 +679,6 @@ static int rio_ioctl(struct tty_struct *tty, struct file *filp, unsigned int cmd | |||
| 709 | if (access_ok(VERIFY_READ, (void *) arg, sizeof(struct serial_struct))) | 679 | if (access_ok(VERIFY_READ, (void *) arg, sizeof(struct serial_struct))) |
| 710 | rc = gs_setserial(&PortP->gs, (struct serial_struct *) arg); | 680 | rc = gs_setserial(&PortP->gs, (struct serial_struct *) arg); |
| 711 | break; | 681 | break; |
| 712 | #if 0 | ||
| 713 | /* | ||
| 714 | * note: these IOCTLs no longer reach here. Use | ||
| 715 | * tiocmset/tiocmget driver methods instead. The | ||
| 716 | * #if 0 disablement predates this comment. | ||
| 717 | */ | ||
| 718 | case TIOCMGET: | ||
| 719 | rc = -EFAULT; | ||
| 720 | if (access_ok(VERIFY_WRITE, (void *) arg, sizeof(unsigned int))) { | ||
| 721 | rc = 0; | ||
| 722 | ival = rio_getsignals(port); | ||
| 723 | put_user(ival, (unsigned int *) arg); | ||
| 724 | } | ||
| 725 | break; | ||
| 726 | case TIOCMBIS: | ||
| 727 | if ((rc = get_user(ival, (unsigned int *) arg)) == 0) { | ||
| 728 | rio_setsignals(port, ((ival & TIOCM_DTR) ? 1 : -1), ((ival & TIOCM_RTS) ? 1 : -1)); | ||
| 729 | } | ||
| 730 | break; | ||
| 731 | case TIOCMBIC: | ||
| 732 | if ((rc = get_user(ival, (unsigned int *) arg)) == 0) { | ||
| 733 | rio_setsignals(port, ((ival & TIOCM_DTR) ? 0 : -1), ((ival & TIOCM_RTS) ? 0 : -1)); | ||
| 734 | } | ||
| 735 | break; | ||
| 736 | case TIOCMSET: | ||
| 737 | if ((rc = get_user(ival, (unsigned int *) arg)) == 0) { | ||
| 738 | rio_setsignals(port, ((ival & TIOCM_DTR) ? 1 : 0), ((ival & TIOCM_RTS) ? 1 : 0)); | ||
| 739 | } | ||
| 740 | break; | ||
| 741 | #endif | ||
| 742 | default: | 682 | default: |
| 743 | rc = -ENOIOCTLCMD; | 683 | rc = -ENOIOCTLCMD; |
| 744 | break; | 684 | break; |
diff --git a/drivers/char/rio/rioboot.c b/drivers/char/rio/rioboot.c index 34cbb13aad4b..92df43552f15 100644 --- a/drivers/char/rio/rioboot.c +++ b/drivers/char/rio/rioboot.c | |||
| @@ -665,13 +665,6 @@ struct PKT *PacketP; | |||
| 665 | struct CmdBlk *CmdBlkP; | 665 | struct CmdBlk *CmdBlkP; |
| 666 | uint sequence; | 666 | uint sequence; |
| 667 | 667 | ||
| 668 | #ifdef CHECK | ||
| 669 | CheckHost(Host); | ||
| 670 | CheckRup(Rup); | ||
| 671 | CheckHostP(HostP); | ||
| 672 | CheckPacketP(PacketP); | ||
| 673 | #endif | ||
| 674 | |||
| 675 | /* | 668 | /* |
| 676 | ** If we haven't been told what to boot, we can't boot it. | 669 | ** If we haven't been told what to boot, we can't boot it. |
| 677 | */ | 670 | */ |
| @@ -956,11 +949,6 @@ static int RIOBootComplete( struct rio_info *p, struct Host *HostP, uint Rup, st | |||
| 956 | MyType = "RTA"; | 949 | MyType = "RTA"; |
| 957 | MyName = HostP->Mapping[Rup].Name; | 950 | MyName = HostP->Mapping[Rup].Name; |
| 958 | } | 951 | } |
| 959 | #ifdef CHECK | ||
| 960 | CheckString(MyType); | ||
| 961 | CheckString(MyName); | ||
| 962 | #endif | ||
| 963 | |||
| 964 | MyLink = RBYTE(PktCmdP->LinkNum); | 952 | MyLink = RBYTE(PktCmdP->LinkNum); |
| 965 | 953 | ||
| 966 | /* | 954 | /* |
| @@ -1309,52 +1297,3 @@ struct Host *HostP; | |||
| 1309 | } | 1297 | } |
| 1310 | } | 1298 | } |
| 1311 | 1299 | ||
| 1312 | #if 0 | ||
| 1313 | /* | ||
| 1314 | Function: This function is to disable the disk interrupt | ||
| 1315 | Returns : Nothing | ||
| 1316 | */ | ||
| 1317 | void | ||
| 1318 | disable_interrupt(vector) | ||
| 1319 | int vector; | ||
| 1320 | { | ||
| 1321 | int ps; | ||
| 1322 | int val; | ||
| 1323 | |||
| 1324 | disable(ps); | ||
| 1325 | if (vector > 40) { | ||
| 1326 | val = 1 << (vector - 40); | ||
| 1327 | __outb(S8259+1, __inb(S8259+1) | val); | ||
| 1328 | } | ||
| 1329 | else { | ||
| 1330 | val = 1 << (vector - 32); | ||
| 1331 | __outb(M8259+1, __inb(M8259+1) | val); | ||
| 1332 | } | ||
| 1333 | restore(ps); | ||
| 1334 | } | ||
| 1335 | |||
| 1336 | /* | ||
| 1337 | Function: This function is to enable the disk interrupt | ||
| 1338 | Returns : Nothing | ||
| 1339 | */ | ||
| 1340 | void | ||
| 1341 | enable_interrupt(vector) | ||
| 1342 | int vector; | ||
| 1343 | { | ||
| 1344 | int ps; | ||
| 1345 | int val; | ||
| 1346 | |||
| 1347 | disable(ps); | ||
| 1348 | if (vector > 40) { | ||
| 1349 | val = 1 << (vector - 40); | ||
| 1350 | val = ~val; | ||
| 1351 | __outb(S8259+1, __inb(S8259+1) & val); | ||
| 1352 | } | ||
| 1353 | else { | ||
| 1354 | val = 1 << (vector - 32); | ||
| 1355 | val = ~val; | ||
| 1356 | __outb(M8259+1, __inb(M8259+1) & val); | ||
| 1357 | } | ||
| 1358 | restore(ps); | ||
| 1359 | } | ||
| 1360 | #endif | ||
diff --git a/drivers/char/rio/riocmd.c b/drivers/char/rio/riocmd.c index b97dd9fdb6ba..694bfb9d9378 100644 --- a/drivers/char/rio/riocmd.c +++ b/drivers/char/rio/riocmd.c | |||
| @@ -387,12 +387,6 @@ static int RIOCommandRup(struct rio_info *p, uint Rup, struct Host *HostP, PKT * | |||
| 387 | 387 | ||
| 388 | func_enter(); | 388 | func_enter(); |
| 389 | 389 | ||
| 390 | #ifdef CHECK | ||
| 391 | CheckHost(Host); | ||
| 392 | CheckHostP(HostP); | ||
| 393 | CheckPacketP(PacketP); | ||
| 394 | #endif | ||
| 395 | |||
| 396 | /* | 390 | /* |
| 397 | ** 16 port RTA note: | 391 | ** 16 port RTA note: |
| 398 | ** Command rup packets coming from the RTA will have pkt->data[1] (which | 392 | ** Command rup packets coming from the RTA will have pkt->data[1] (which |
| @@ -406,10 +400,6 @@ static int RIOCommandRup(struct rio_info *p, uint Rup, struct Host *HostP, PKT * | |||
| 406 | SysPort = UnixRupP->BaseSysPort + (RBYTE(PktCmdP->PhbNum) % (ushort) PORTS_PER_RTA); | 400 | SysPort = UnixRupP->BaseSysPort + (RBYTE(PktCmdP->PhbNum) % (ushort) PORTS_PER_RTA); |
| 407 | rio_dprintk(RIO_DEBUG_CMD, "Command on rup %d, port %d\n", rup, SysPort); | 401 | rio_dprintk(RIO_DEBUG_CMD, "Command on rup %d, port %d\n", rup, SysPort); |
| 408 | 402 | ||
| 409 | #ifdef CHECK | ||
| 410 | CheckRup(rup); | ||
| 411 | CheckUnixRupP(UnixRupP); | ||
| 412 | #endif | ||
| 413 | if (UnixRupP->BaseSysPort == NO_PORT) { | 403 | if (UnixRupP->BaseSysPort == NO_PORT) { |
| 414 | rio_dprintk(RIO_DEBUG_CMD, "OBSCURE ERROR!\n"); | 404 | rio_dprintk(RIO_DEBUG_CMD, "OBSCURE ERROR!\n"); |
| 415 | rio_dprintk(RIO_DEBUG_CMD, "Diagnostics follow. Please WRITE THESE DOWN and report them to Specialix Technical Support\n"); | 405 | rio_dprintk(RIO_DEBUG_CMD, "Diagnostics follow. Please WRITE THESE DOWN and report them to Specialix Technical Support\n"); |
| @@ -429,9 +419,6 @@ static int RIOCommandRup(struct rio_info *p, uint Rup, struct Host *HostP, PKT * | |||
| 429 | rio_dprintk(RIO_DEBUG_CMD, "COMMAND information: Host Port Number 0x%x, " "Command Code 0x%x\n", PktCmdP->PhbNum, PktCmdP->Command); | 419 | rio_dprintk(RIO_DEBUG_CMD, "COMMAND information: Host Port Number 0x%x, " "Command Code 0x%x\n", PktCmdP->PhbNum, PktCmdP->Command); |
| 430 | return TRUE; | 420 | return TRUE; |
| 431 | } | 421 | } |
| 432 | #ifdef CHECK | ||
| 433 | CheckSysPort(SysPort); | ||
| 434 | #endif | ||
| 435 | PortP = p->RIOPortp[SysPort]; | 422 | PortP = p->RIOPortp[SysPort]; |
| 436 | rio_spin_lock_irqsave(&PortP->portSem, flags); | 423 | rio_spin_lock_irqsave(&PortP->portSem, flags); |
| 437 | switch (RBYTE(PktCmdP->Command)) { | 424 | switch (RBYTE(PktCmdP->Command)) { |
| @@ -604,11 +591,6 @@ int RIOQueueCmdBlk(struct Host *HostP, uint Rup, struct CmdBlk *CmdBlkP) | |||
| 604 | struct UnixRup *UnixRupP; | 591 | struct UnixRup *UnixRupP; |
| 605 | unsigned long flags; | 592 | unsigned long flags; |
| 606 | 593 | ||
| 607 | #ifdef CHECK | ||
| 608 | CheckHostP(HostP); | ||
| 609 | CheckRup(Rup); | ||
| 610 | CheckCmdBlkP(CmdBlkP); | ||
| 611 | #endif | ||
| 612 | if (Rup >= (ushort) (MAX_RUP + LINKS_PER_UNIT)) { | 594 | if (Rup >= (ushort) (MAX_RUP + LINKS_PER_UNIT)) { |
| 613 | rio_dprintk(RIO_DEBUG_CMD, "Illegal rup number %d in RIOQueueCmdBlk\n", Rup); | 595 | rio_dprintk(RIO_DEBUG_CMD, "Illegal rup number %d in RIOQueueCmdBlk\n", Rup); |
| 614 | RIOFreeCmdBlk(CmdBlkP); | 596 | RIOFreeCmdBlk(CmdBlkP); |
| @@ -806,9 +788,6 @@ void RIOPollHostCommands(struct rio_info *p, struct Host *HostP) | |||
| 806 | ** If it returns RIO_FAIL then don't | 788 | ** If it returns RIO_FAIL then don't |
| 807 | ** send this command yet! | 789 | ** send this command yet! |
| 808 | */ | 790 | */ |
| 809 | #ifdef CHECK | ||
| 810 | CheckCmdBlkP(CmdBlkP); | ||
| 811 | #endif | ||
| 812 | if (!(CmdBlkP->PreFuncP ? (*CmdBlkP->PreFuncP) (CmdBlkP->PreArg, CmdBlkP) : TRUE)) { | 791 | if (!(CmdBlkP->PreFuncP ? (*CmdBlkP->PreFuncP) (CmdBlkP->PreArg, CmdBlkP) : TRUE)) { |
| 813 | rio_dprintk(RIO_DEBUG_CMD, "Not ready to start command 0x%x\n", (int) CmdBlkP); | 792 | rio_dprintk(RIO_DEBUG_CMD, "Not ready to start command 0x%x\n", (int) CmdBlkP); |
| 814 | } else { | 793 | } else { |
| @@ -816,9 +795,6 @@ void RIOPollHostCommands(struct rio_info *p, struct Host *HostP) | |||
| 816 | /* | 795 | /* |
| 817 | ** Whammy! blat that pack! | 796 | ** Whammy! blat that pack! |
| 818 | */ | 797 | */ |
| 819 | #ifdef CHECK | ||
| 820 | CheckPacketP((PKT *) RIO_PTR(HostP->Caddr, UnixRupP->RupP->txpkt)); | ||
| 821 | #endif | ||
| 822 | HostP->Copy((caddr_t) & CmdBlkP->Packet, RIO_PTR(HostP->Caddr, UnixRupP->RupP->txpkt), sizeof(PKT)); | 798 | HostP->Copy((caddr_t) & CmdBlkP->Packet, RIO_PTR(HostP->Caddr, UnixRupP->RupP->txpkt), sizeof(PKT)); |
| 823 | 799 | ||
| 824 | /* | 800 | /* |
| @@ -852,9 +828,6 @@ int RIOWFlushMark(int iPortP, struct CmdBlk *CmdBlkP) | |||
| 852 | unsigned long flags; | 828 | unsigned long flags; |
| 853 | 829 | ||
| 854 | rio_spin_lock_irqsave(&PortP->portSem, flags); | 830 | rio_spin_lock_irqsave(&PortP->portSem, flags); |
| 855 | #ifdef CHECK | ||
| 856 | CheckPortP(PortP); | ||
| 857 | #endif | ||
| 858 | PortP->WflushFlag++; | 831 | PortP->WflushFlag++; |
| 859 | PortP->MagicFlags |= MAGIC_FLUSH; | 832 | PortP->MagicFlags |= MAGIC_FLUSH; |
| 860 | rio_spin_unlock_irqrestore(&PortP->portSem, flags); | 833 | rio_spin_unlock_irqrestore(&PortP->portSem, flags); |
| @@ -894,9 +867,6 @@ int RIOUnUse(int iPortP, struct CmdBlk *CmdBlkP) | |||
| 894 | 867 | ||
| 895 | rio_spin_lock_irqsave(&PortP->portSem, flags); | 868 | rio_spin_lock_irqsave(&PortP->portSem, flags); |
| 896 | 869 | ||
| 897 | #ifdef CHECK | ||
| 898 | CheckPortP(PortP); | ||
| 899 | #endif | ||
| 900 | rio_dprintk(RIO_DEBUG_CMD, "Decrement in use count for port\n"); | 870 | rio_dprintk(RIO_DEBUG_CMD, "Decrement in use count for port\n"); |
| 901 | 871 | ||
| 902 | if (PortP->InUse) { | 872 | if (PortP->InUse) { |
diff --git a/drivers/char/rio/rioctrl.c b/drivers/char/rio/rioctrl.c index 0b7700d2f049..fcf18a061228 100644 --- a/drivers/char/rio/rioctrl.c +++ b/drivers/char/rio/rioctrl.c | |||
| @@ -308,12 +308,7 @@ int su; | |||
| 308 | } | 308 | } |
| 309 | 309 | ||
| 310 | case RIO_DEBUG_MEM: | 310 | case RIO_DEBUG_MEM: |
| 311 | #ifdef DEBUG_MEM_SUPPORT | 311 | return -EPERM; |
| 312 | RIO_DEBUG_CTRL, if (su) | ||
| 313 | return rio_RIODebugMemory(RIO_DEBUG_CTRL, arg); | ||
| 314 | else | ||
| 315 | #endif | ||
| 316 | return -EPERM; | ||
| 317 | 312 | ||
| 318 | case RIO_ALL_MODEM: | 313 | case RIO_ALL_MODEM: |
| 319 | rio_dprintk(RIO_DEBUG_CTRL, "RIO_ALL_MODEM\n"); | 314 | rio_dprintk(RIO_DEBUG_CTRL, "RIO_ALL_MODEM\n"); |
| @@ -591,12 +586,7 @@ int su; | |||
| 591 | 586 | ||
| 592 | case RIO_GET_LOG: | 587 | case RIO_GET_LOG: |
| 593 | rio_dprintk(RIO_DEBUG_CTRL, "RIO_GET_LOG\n"); | 588 | rio_dprintk(RIO_DEBUG_CTRL, "RIO_GET_LOG\n"); |
| 594 | #ifdef LOGGING | ||
| 595 | RIOGetLog(arg); | ||
| 596 | return 0; | ||
| 597 | #else | ||
| 598 | return -EINVAL; | 589 | return -EINVAL; |
| 599 | #endif | ||
| 600 | 590 | ||
| 601 | case RIO_GET_MODTYPE: | 591 | case RIO_GET_MODTYPE: |
| 602 | if (copyin((int) arg, (caddr_t) & port, sizeof(uint)) == COPYFAIL) { | 592 | if (copyin((int) arg, (caddr_t) & port, sizeof(uint)) == COPYFAIL) { |
| @@ -684,52 +674,6 @@ int su; | |||
| 684 | rio_dprintk(RIO_DEBUG_CTRL, "entering loop (%d %d)!\n", PortSetup.From, PortSetup.To); | 674 | rio_dprintk(RIO_DEBUG_CTRL, "entering loop (%d %d)!\n", PortSetup.From, PortSetup.To); |
| 685 | for (loop = PortSetup.From; loop <= PortSetup.To; loop++) { | 675 | for (loop = PortSetup.From; loop <= PortSetup.To; loop++) { |
| 686 | rio_dprintk(RIO_DEBUG_CTRL, "in loop (%d)!\n", loop); | 676 | rio_dprintk(RIO_DEBUG_CTRL, "in loop (%d)!\n", loop); |
| 687 | #if 0 | ||
| 688 | PortP = p->RIOPortp[loop]; | ||
| 689 | if (!PortP->TtyP) | ||
| 690 | PortP->TtyP = &p->channel[loop]; | ||
| 691 | |||
| 692 | rio_spin_lock_irqsave(&PortP->portSem, flags); | ||
| 693 | if (PortSetup.IxAny) | ||
| 694 | PortP->Config |= RIO_IXANY; | ||
| 695 | else | ||
| 696 | PortP->Config &= ~RIO_IXANY; | ||
| 697 | if (PortSetup.IxOn) | ||
| 698 | PortP->Config |= RIO_IXON; | ||
| 699 | else | ||
| 700 | PortP->Config &= ~RIO_IXON; | ||
| 701 | |||
| 702 | /* | ||
| 703 | ** If the port needs to wait for all a processes output | ||
| 704 | ** to drain before closing then this flag will be set. | ||
| 705 | */ | ||
| 706 | if (PortSetup.Drain) { | ||
| 707 | PortP->Config |= RIO_WAITDRAIN; | ||
| 708 | } else { | ||
| 709 | PortP->Config &= ~RIO_WAITDRAIN; | ||
| 710 | } | ||
| 711 | /* | ||
| 712 | ** Store settings if locking or unlocking port or if the | ||
| 713 | ** port is not locked, when setting the store option. | ||
| 714 | */ | ||
| 715 | if (PortP->Mapped && ((PortSetup.Lock && !PortP->Lock) || (!PortP->Lock && (PortSetup.Store && !PortP->Store)))) { | ||
| 716 | PortP->StoredTty.iflag = PortP->TtyP->tm.c_iflag; | ||
| 717 | PortP->StoredTty.oflag = PortP->TtyP->tm.c_oflag; | ||
| 718 | PortP->StoredTty.cflag = PortP->TtyP->tm.c_cflag; | ||
| 719 | PortP->StoredTty.lflag = PortP->TtyP->tm.c_lflag; | ||
| 720 | PortP->StoredTty.line = PortP->TtyP->tm.c_line; | ||
| 721 | bcopy(PortP->TtyP->tm.c_cc, PortP->StoredTty.cc, NCC + 5); | ||
| 722 | } | ||
| 723 | PortP->Lock = PortSetup.Lock; | ||
| 724 | PortP->Store = PortSetup.Store; | ||
| 725 | PortP->Xprint.XpCps = PortSetup.XpCps; | ||
| 726 | bcopy(PortSetup.XpOn, PortP->Xprint.XpOn, MAX_XP_CTRL_LEN); | ||
| 727 | bcopy(PortSetup.XpOff, PortP->Xprint.XpOff, MAX_XP_CTRL_LEN); | ||
| 728 | PortP->Xprint.XpOn[MAX_XP_CTRL_LEN - 1] = '\0'; | ||
| 729 | PortP->Xprint.XpOff[MAX_XP_CTRL_LEN - 1] = '\0'; | ||
| 730 | PortP->Xprint.XpLen = RIOStrlen(PortP->Xprint.XpOn) + RIOStrlen(PortP->Xprint.XpOff); | ||
| 731 | rio_spin_unlock_irqrestore(&PortP->portSem, flags); | ||
| 732 | #endif | ||
| 733 | } | 677 | } |
| 734 | rio_dprintk(RIO_DEBUG_CTRL, "after loop (%d)!\n", loop); | 678 | rio_dprintk(RIO_DEBUG_CTRL, "after loop (%d)!\n", loop); |
| 735 | rio_dprintk(RIO_DEBUG_CTRL, "Retval:%x\n", retval); | 679 | rio_dprintk(RIO_DEBUG_CTRL, "Retval:%x\n", retval); |
| @@ -801,12 +745,6 @@ int su; | |||
| 801 | 745 | ||
| 802 | rio_dprintk(RIO_DEBUG_CTRL, "Port %d\n", PortTty.port); | 746 | rio_dprintk(RIO_DEBUG_CTRL, "Port %d\n", PortTty.port); |
| 803 | PortP = (p->RIOPortp[PortTty.port]); | 747 | PortP = (p->RIOPortp[PortTty.port]); |
| 804 | #if 0 | ||
| 805 | PortTty.Tty.tm.c_iflag = PortP->TtyP->tm.c_iflag; | ||
| 806 | PortTty.Tty.tm.c_oflag = PortP->TtyP->tm.c_oflag; | ||
| 807 | PortTty.Tty.tm.c_cflag = PortP->TtyP->tm.c_cflag; | ||
| 808 | PortTty.Tty.tm.c_lflag = PortP->TtyP->tm.c_lflag; | ||
| 809 | #endif | ||
| 810 | if (copyout((caddr_t) & PortTty, (int) arg, sizeof(struct PortTty)) == COPYFAIL) { | 748 | if (copyout((caddr_t) & PortTty, (int) arg, sizeof(struct PortTty)) == COPYFAIL) { |
| 811 | p->RIOError.Error = COPYOUT_FAILED; | 749 | p->RIOError.Error = COPYOUT_FAILED; |
| 812 | return -EFAULT; | 750 | return -EFAULT; |
| @@ -824,15 +762,6 @@ int su; | |||
| 824 | return -ENXIO; | 762 | return -ENXIO; |
| 825 | } | 763 | } |
| 826 | PortP = (p->RIOPortp[PortTty.port]); | 764 | PortP = (p->RIOPortp[PortTty.port]); |
| 827 | #if 0 | ||
| 828 | rio_spin_lock_irqsave(&PortP->portSem, flags); | ||
| 829 | PortP->TtyP->tm.c_iflag = PortTty.Tty.tm.c_iflag; | ||
| 830 | PortP->TtyP->tm.c_oflag = PortTty.Tty.tm.c_oflag; | ||
| 831 | PortP->TtyP->tm.c_cflag = PortTty.Tty.tm.c_cflag; | ||
| 832 | PortP->TtyP->tm.c_lflag = PortTty.Tty.tm.c_lflag; | ||
| 833 | rio_spin_unlock_irqrestore(&PortP->portSem, flags); | ||
| 834 | #endif | ||
| 835 | |||
| 836 | RIOParam(PortP, CONFIG, PortP->State & RIO_MODEM, OK_TO_SLEEP); | 765 | RIOParam(PortP, CONFIG, PortP->State & RIO_MODEM, OK_TO_SLEEP); |
| 837 | return retval; | 766 | return retval; |
| 838 | 767 | ||
| @@ -909,23 +838,6 @@ int su; | |||
| 909 | rio_spin_unlock_irqrestore(&PortP->portSem, flags); | 838 | rio_spin_unlock_irqrestore(&PortP->portSem, flags); |
| 910 | return retval; | 839 | return retval; |
| 911 | 840 | ||
| 912 | #ifdef DEBUG_SUPPORTED | ||
| 913 | case RIO_READ_LEVELS: | ||
| 914 | { | ||
| 915 | int num; | ||
| 916 | rio_dprintk(RIO_DEBUG_CTRL, "RIO_READ_LEVELS\n"); | ||
| 917 | for (num = 0; RIODbInf[num].Flag; num++); | ||
| 918 | rio_dprintk(RIO_DEBUG_CTRL, "%d levels to copy\n", num); | ||
| 919 | if (copyout((caddr_t) RIODbInf, (int) arg, sizeof(struct DbInf) * (num + 1)) == COPYFAIL) { | ||
| 920 | rio_dprintk(RIO_DEBUG_CTRL, "ReadLevels Copy failed\n"); | ||
| 921 | p->RIOError.Error = COPYOUT_FAILED; | ||
| 922 | return -EFAULT; | ||
| 923 | } | ||
| 924 | rio_dprintk(RIO_DEBUG_CTRL, "%d levels to copied\n", num); | ||
| 925 | return retval; | ||
| 926 | } | ||
| 927 | #endif | ||
| 928 | |||
| 929 | case RIO_READ_CONFIG: | 841 | case RIO_READ_CONFIG: |
| 930 | rio_dprintk(RIO_DEBUG_CTRL, "RIO_READ_CONFIG\n"); | 842 | rio_dprintk(RIO_DEBUG_CTRL, "RIO_READ_CONFIG\n"); |
| 931 | if (copyout((caddr_t) & p->RIOConf, (int) arg, sizeof(struct Conf)) == COPYFAIL) { | 843 | if (copyout((caddr_t) & p->RIOConf, (int) arg, sizeof(struct Conf)) == COPYFAIL) { |
| @@ -1084,30 +996,13 @@ int su; | |||
| 1084 | (void) RIOBoardTest(p->RIOHosts[Host].PaddrP, p->RIOHosts[Host].Caddr, p->RIOHosts[Host].Type, p->RIOHosts[Host].Slot); | 996 | (void) RIOBoardTest(p->RIOHosts[Host].PaddrP, p->RIOHosts[Host].Caddr, p->RIOHosts[Host].Type, p->RIOHosts[Host].Slot); |
| 1085 | bzero((caddr_t) & p->RIOHosts[Host].Flags, ((int) &p->RIOHosts[Host].____end_marker____) - ((int) &p->RIOHosts[Host].Flags)); | 997 | bzero((caddr_t) & p->RIOHosts[Host].Flags, ((int) &p->RIOHosts[Host].____end_marker____) - ((int) &p->RIOHosts[Host].Flags)); |
| 1086 | p->RIOHosts[Host].Flags = RC_WAITING; | 998 | p->RIOHosts[Host].Flags = RC_WAITING; |
| 1087 | #if 0 | ||
| 1088 | RIOSetupDataStructs(p); | ||
| 1089 | #endif | ||
| 1090 | } | 999 | } |
| 1091 | RIOFoadWakeup(p); | 1000 | RIOFoadWakeup(p); |
| 1092 | p->RIONumBootPkts = 0; | 1001 | p->RIONumBootPkts = 0; |
| 1093 | p->RIOBooting = 0; | 1002 | p->RIOBooting = 0; |
| 1094 | |||
| 1095 | #ifdef RINGBUFFER_SUPPORT | ||
| 1096 | for (loop = 0; loop < RIO_PORTS; loop++) | ||
| 1097 | if (p->RIOPortp[loop]->TxRingBuffer) | ||
| 1098 | sysfree((void *) p->RIOPortp[loop]->TxRingBuffer, RIOBufferSize); | ||
| 1099 | #endif | ||
| 1100 | #if 0 | ||
| 1101 | bzero((caddr_t) & p->RIOPortp[0], RIO_PORTS * sizeof(struct Port)); | ||
| 1102 | #else | ||
| 1103 | printk("HEEEEELP!\n"); | 1003 | printk("HEEEEELP!\n"); |
| 1104 | #endif | ||
| 1105 | 1004 | ||
| 1106 | for (loop = 0; loop < RIO_PORTS; loop++) { | 1005 | for (loop = 0; loop < RIO_PORTS; loop++) { |
| 1107 | #if 0 | ||
| 1108 | p->RIOPortp[loop]->TtyP = &p->channel[loop]; | ||
| 1109 | #endif | ||
| 1110 | |||
| 1111 | spin_lock_init(&p->RIOPortp[loop]->portSem); | 1006 | spin_lock_init(&p->RIOPortp[loop]->portSem); |
| 1112 | p->RIOPortp[loop]->InUse = NOT_INUSE; | 1007 | p->RIOPortp[loop]->InUse = NOT_INUSE; |
| 1113 | } | 1008 | } |
| @@ -1653,10 +1548,6 @@ uchar Cmd; | |||
| 1653 | ushort rup; | 1548 | ushort rup; |
| 1654 | int port; | 1549 | int port; |
| 1655 | 1550 | ||
| 1656 | #ifdef CHECK | ||
| 1657 | CheckPortP(PortP); | ||
| 1658 | #endif | ||
| 1659 | |||
| 1660 | if (PortP->State & RIO_DELETED) { | 1551 | if (PortP->State & RIO_DELETED) { |
| 1661 | rio_dprintk(RIO_DEBUG_CTRL, "Preemptive command to deleted RTA ignored\n"); | 1552 | rio_dprintk(RIO_DEBUG_CTRL, "Preemptive command to deleted RTA ignored\n"); |
| 1662 | return RIO_FAIL; | 1553 | return RIO_FAIL; |
diff --git a/drivers/char/rio/rioinit.c b/drivers/char/rio/rioinit.c index 898a126ae3e6..0d44ef464e6b 100644 --- a/drivers/char/rio/rioinit.c +++ b/drivers/char/rio/rioinit.c | |||
| @@ -87,222 +87,8 @@ static char *_rioinit_c_sccs_ = "@(#)rioinit.c 1.3"; | |||
| 87 | 87 | ||
| 88 | int RIOPCIinit(struct rio_info *p, int Mode); | 88 | int RIOPCIinit(struct rio_info *p, int Mode); |
| 89 | 89 | ||
| 90 | #if 0 | ||
| 91 | static void RIOAllocateInterrupts(struct rio_info *); | ||
| 92 | static int RIOReport(struct rio_info *); | ||
| 93 | static void RIOStopInterrupts(struct rio_info *, int, int); | ||
| 94 | #endif | ||
| 95 | |||
| 96 | static int RIOScrub(int, BYTE *, int); | 90 | static int RIOScrub(int, BYTE *, int); |
| 97 | 91 | ||
| 98 | #if 0 | ||
| 99 | extern int rio_intr(); | ||
| 100 | |||
| 101 | /* | ||
| 102 | ** Init time code. | ||
| 103 | */ | ||
| 104 | void | ||
| 105 | rioinit( p, info ) | ||
| 106 | struct rio_info * p; | ||
| 107 | struct RioHostInfo * info; | ||
| 108 | { | ||
| 109 | /* | ||
| 110 | ** Multi-Host card support - taking the easy way out - sorry ! | ||
| 111 | ** We allocate and set up the Host and Port structs when the | ||
| 112 | ** driver is called to 'install' the first host. | ||
| 113 | ** We check for this first 'call' by testing the RIOPortp pointer. | ||
| 114 | */ | ||
| 115 | if ( !p->RIOPortp ) | ||
| 116 | { | ||
| 117 | rio_dprintk (RIO_DEBUG_INIT, "Allocating and setting up driver data structures\n"); | ||
| 118 | |||
| 119 | RIOAllocDataStructs(p); /* allocate host/port structs */ | ||
| 120 | RIOSetupDataStructs(p); /* setup topology structs */ | ||
| 121 | } | ||
| 122 | |||
| 123 | RIOInitHosts( p, info ); /* hunt down the hardware */ | ||
| 124 | |||
| 125 | RIOAllocateInterrupts(p); /* allocate interrupts */ | ||
| 126 | RIOReport(p); /* show what we found */ | ||
| 127 | } | ||
| 128 | |||
| 129 | /* | ||
| 130 | ** Initialise the Cards | ||
| 131 | */ | ||
| 132 | void | ||
| 133 | RIOInitHosts(p, info) | ||
| 134 | struct rio_info * p; | ||
| 135 | struct RioHostInfo * info; | ||
| 136 | { | ||
| 137 | /* | ||
| 138 | ** 15.10.1998 ARG - ESIL 0762 part fix | ||
| 139 | ** If there is no ISA card definition - we always look for PCI cards. | ||
| 140 | ** As we currently only support one host card this lets an ISA card | ||
| 141 | ** definition take precedence over PLUG and PLAY. | ||
| 142 | ** No ISA card - we are PLUG and PLAY with PCI. | ||
| 143 | */ | ||
| 144 | |||
| 145 | /* | ||
| 146 | ** Note - for PCI both these will be zero, that's okay because | ||
| 147 | ** RIOPCIInit() fills them in if a card is found. | ||
| 148 | */ | ||
| 149 | p->RIOHosts[p->RIONumHosts].Ivec = info->vector; | ||
| 150 | p->RIOHosts[p->RIONumHosts].PaddrP = info->location; | ||
| 151 | |||
| 152 | /* | ||
| 153 | ** Check that we are able to accommodate another host | ||
| 154 | */ | ||
| 155 | if ( p->RIONumHosts >= RIO_HOSTS ) | ||
| 156 | { | ||
| 157 | p->RIOFailed++; | ||
| 158 | return; | ||
| 159 | } | ||
| 160 | |||
| 161 | if ( info->bus & ISA_BUS ) | ||
| 162 | { | ||
| 163 | rio_dprintk (RIO_DEBUG_INIT, "initialising card %d (ISA)\n", p->RIONumHosts); | ||
| 164 | RIOISAinit(p, p->mode); | ||
| 165 | } | ||
| 166 | else | ||
| 167 | { | ||
| 168 | rio_dprintk (RIO_DEBUG_INIT, "initialising card %d (PCI)\n", p->RIONumHosts); | ||
| 169 | RIOPCIinit(p, RIO_PCI_DEFAULT_MODE); | ||
| 170 | } | ||
| 171 | |||
| 172 | rio_dprintk (RIO_DEBUG_INIT, "Total hosts initialised so far : %d\n", p->RIONumHosts); | ||
| 173 | |||
| 174 | |||
| 175 | #ifdef FUTURE_RELEASE | ||
| 176 | if (p->bus & EISA_BUS) | ||
| 177 | /* EISA card */ | ||
| 178 | RIOEISAinit(p, RIO_EISA_DEFAULT_MODE); | ||
| 179 | |||
| 180 | if (p->bus & MCA_BUS) | ||
| 181 | /* MCA card */ | ||
| 182 | RIOMCAinit(p, RIO_MCA_DEFAULT_MODE); | ||
| 183 | #endif | ||
| 184 | } | ||
| 185 | |||
| 186 | /* | ||
| 187 | ** go through memory for an AT host that we pass in the device info | ||
| 188 | ** structure and initialise | ||
| 189 | */ | ||
| 190 | void | ||
| 191 | RIOISAinit(p, mode) | ||
| 192 | struct rio_info * p; | ||
| 193 | int mode; | ||
| 194 | { | ||
| 195 | |||
| 196 | /* XXX Need to implement this. */ | ||
| 197 | #if 0 | ||
| 198 | p->intr_tid = iointset(p->RIOHosts[p->RIONumHosts].Ivec, | ||
| 199 | (int (*)())rio_intr, (char*)p->RIONumHosts); | ||
| 200 | |||
| 201 | rio_dprintk (RIO_DEBUG_INIT, "Set interrupt handler, intr_tid = 0x%x\n", p->intr_tid ); | ||
| 202 | |||
| 203 | if (RIODoAT(p, p->RIOHosts[p->RIONumHosts].PaddrP, mode)) { | ||
| 204 | return; | ||
| 205 | } | ||
| 206 | else { | ||
| 207 | rio_dprintk (RIO_DEBUG_INIT, "RIODoAT failed\n"); | ||
| 208 | p->RIOFailed++; | ||
| 209 | } | ||
| 210 | #endif | ||
| 211 | |||
| 212 | } | ||
| 213 | |||
| 214 | /* | ||
| 215 | ** RIODoAT : | ||
| 216 | ** | ||
| 217 | ** Map in a boards physical address, check that the board is there, | ||
| 218 | ** test the board and if everything is okay assign the board an entry | ||
| 219 | ** in the Rio Hosts structure. | ||
| 220 | */ | ||
| 221 | int | ||
| 222 | RIODoAT(p, Base, mode) | ||
| 223 | struct rio_info * p; | ||
| 224 | int Base; | ||
| 225 | int mode; | ||
| 226 | { | ||
| 227 | #define FOUND 1 | ||
| 228 | #define NOT_FOUND 0 | ||
| 229 | |||
| 230 | caddr_t cardAddr; | ||
| 231 | |||
| 232 | /* | ||
| 233 | ** Check to see if we actually have a board at this physical address. | ||
| 234 | */ | ||
| 235 | if ((cardAddr = RIOCheckForATCard(Base)) != 0) { | ||
| 236 | /* | ||
| 237 | ** Now test the board to see if it is working. | ||
| 238 | */ | ||
| 239 | if (RIOBoardTest(Base, cardAddr, RIO_AT, 0) == RIO_SUCCESS) { | ||
| 240 | /* | ||
| 241 | ** Fill out a slot in the Rio host structure. | ||
| 242 | */ | ||
| 243 | if (RIOAssignAT(p, Base, cardAddr, mode)) { | ||
| 244 | return(FOUND); | ||
| 245 | } | ||
| 246 | } | ||
| 247 | RIOMapout(Base, RIO_AT_MEM_SIZE, cardAddr); | ||
| 248 | } | ||
| 249 | return(NOT_FOUND); | ||
| 250 | } | ||
| 251 | |||
| 252 | caddr_t | ||
| 253 | RIOCheckForATCard(Base) | ||
| 254 | int Base; | ||
| 255 | { | ||
| 256 | int off; | ||
| 257 | struct DpRam *cardp; /* (Points at the host) */ | ||
| 258 | caddr_t virtAddr; | ||
| 259 | unsigned char RIOSigTab[24]; | ||
| 260 | /* | ||
| 261 | ** Table of values to search for as prom signature of a host card | ||
| 262 | */ | ||
| 263 | strcpy(RIOSigTab, "JBJGPGGHINSMJPJR"); | ||
| 264 | |||
| 265 | /* | ||
| 266 | ** Hey! Yes, You reading this code! Yo, grab a load a this: | ||
| 267 | ** | ||
| 268 | ** IF the card is using WORD MODE rather than BYTE MODE | ||
| 269 | ** then it will occupy 128K of PHYSICAL memory area. So, | ||
| 270 | ** you might think that the following Mapin is wrong. Well, | ||
| 271 | ** it isn't, because the SECOND 64K of occupied space is an | ||
| 272 | ** EXACT COPY of the FIRST 64K. (good?), so, we need only | ||
| 273 | ** map it in in one 64K block. | ||
| 274 | */ | ||
| 275 | if (RIOMapin(Base, RIO_AT_MEM_SIZE, &virtAddr) == -1) { | ||
| 276 | rio_dprintk (RIO_DEBUG_INIT, "RIO-init: Couldn't map the board in!\n"); | ||
| 277 | return((caddr_t)0); | ||
| 278 | } | ||
| 279 | |||
| 280 | /* | ||
| 281 | ** virtAddr points to the DP ram of the system. | ||
| 282 | ** We now cast this to a pointer to a RIO Host, | ||
| 283 | ** and have a rummage about in the PROM. | ||
| 284 | */ | ||
| 285 | cardp = (struct DpRam *)virtAddr; | ||
| 286 | |||
| 287 | for (off=0; RIOSigTab[off]; off++) { | ||
| 288 | if ((RBYTE(cardp->DpSignature[off]) & 0xFF) != RIOSigTab[off]) { | ||
| 289 | /* | ||
| 290 | ** Signature mismatch - card not at this address | ||
| 291 | */ | ||
| 292 | RIOMapout(Base, RIO_AT_MEM_SIZE, virtAddr); | ||
| 293 | rio_dprintk (RIO_DEBUG_INIT, "RIO-init: Couldn't match the signature 0x%x 0x%x!\n", | ||
| 294 | (int)cardp, off); | ||
| 295 | return((caddr_t)0); | ||
| 296 | } | ||
| 297 | } | ||
| 298 | |||
| 299 | /* | ||
| 300 | ** If we get here then we must have found a valid board so return | ||
| 301 | ** its virtual address. | ||
| 302 | */ | ||
| 303 | return(virtAddr); | ||
| 304 | } | ||
| 305 | #endif | ||
| 306 | 92 | ||
| 307 | /** | 93 | /** |
| 308 | ** RIOAssignAT : | 94 | ** RIOAssignAT : |
| @@ -367,667 +153,6 @@ int mode; | |||
| 367 | rio_dprintk (RIO_DEBUG_INIT, "RIO-init: Tests Passed at 0x%x\n", Base); | 153 | rio_dprintk (RIO_DEBUG_INIT, "RIO-init: Tests Passed at 0x%x\n", Base); |
| 368 | return(1); | 154 | return(1); |
| 369 | } | 155 | } |
| 370 | #if 0 | ||
| 371 | #ifdef FUTURE_RELEASE | ||
| 372 | int RIOMCAinit(int Mode) | ||
| 373 | { | ||
| 374 | uchar SlotNumber; | ||
| 375 | caddr_t Caddr; | ||
| 376 | uint Paddr; | ||
| 377 | uint Ivec; | ||
| 378 | int Handle; | ||
| 379 | int ret = 0; | ||
| 380 | |||
| 381 | /* | ||
| 382 | ** Valid mode information for MCA cards | ||
| 383 | ** is only FAST LINKS | ||
| 384 | */ | ||
| 385 | Mode = (Mode & FAST_LINKS) ? McaTpFastLinks : McaTpSlowLinks; | ||
| 386 | rio_dprintk (RIO_DEBUG_INIT, "RIOMCAinit(%d)\n",Mode); | ||
| 387 | |||
| 388 | |||
| 389 | /* | ||
| 390 | ** Check out each of the slots | ||
| 391 | */ | ||
| 392 | for (SlotNumber = 0; SlotNumber < McaMaxSlots; SlotNumber++) { | ||
| 393 | /* | ||
| 394 | ** Enable the slot we want to talk to | ||
| 395 | */ | ||
| 396 | outb( McaSlotSelect, SlotNumber | McaSlotEnable ); | ||
| 397 | |||
| 398 | /* | ||
| 399 | ** Read the ID word from the slot | ||
| 400 | */ | ||
| 401 | if (((inb(McaIdHigh)<< 8)|inb(McaIdLow)) == McaRIOId) | ||
| 402 | { | ||
| 403 | rio_dprintk (RIO_DEBUG_INIT, "Potential MCA card in slot %d\n", SlotNumber); | ||
| 404 | |||
| 405 | /* | ||
| 406 | ** Card appears to be a RIO MCA card! | ||
| 407 | */ | ||
| 408 | RIOMachineType |= (1<<RIO_MCA); | ||
| 409 | |||
| 410 | /* | ||
| 411 | ** Just check we haven't found too many wonderful objects | ||
| 412 | */ | ||
| 413 | if ( RIONumHosts >= RIO_HOSTS ) | ||
| 414 | { | ||
| 415 | Rprintf(RIOMesgTooManyCards); | ||
| 416 | return(ret); | ||
| 417 | } | ||
| 418 | |||
| 419 | /* | ||
| 420 | ** McaIrqEnable contains the interrupt vector, and a card | ||
| 421 | ** enable bit. | ||
| 422 | */ | ||
| 423 | Ivec = inb(McaIrqEnable); | ||
| 424 | |||
| 425 | rio_dprintk (RIO_DEBUG_INIT, "Ivec is %x\n", Ivec); | ||
| 426 | |||
| 427 | switch ( Ivec & McaIrqMask ) | ||
| 428 | { | ||
| 429 | case McaIrq9: | ||
| 430 | rio_dprintk (RIO_DEBUG_INIT, "IRQ9\n"); | ||
| 431 | break; | ||
| 432 | case McaIrq3: | ||
| 433 | rio_dprintk (RIO_DEBUG_INIT, "IRQ3\n"); | ||
| 434 | break; | ||
| 435 | case McaIrq4: | ||
| 436 | rio_dprintk (RIO_DEBUG_INIT, "IRQ4\n"); | ||
| 437 | break; | ||
| 438 | case McaIrq7: | ||
| 439 | rio_dprintk (RIO_DEBUG_INIT, "IRQ7\n"); | ||
| 440 | break; | ||
| 441 | case McaIrq10: | ||
| 442 | rio_dprintk (RIO_DEBUG_INIT, "IRQ10\n"); | ||
| 443 | break; | ||
| 444 | case McaIrq11: | ||
| 445 | rio_dprintk (RIO_DEBUG_INIT, "IRQ11\n"); | ||
| 446 | break; | ||
| 447 | case McaIrq12: | ||
| 448 | rio_dprintk (RIO_DEBUG_INIT, "IRQ12\n"); | ||
| 449 | break; | ||
| 450 | case McaIrq15: | ||
| 451 | rio_dprintk (RIO_DEBUG_INIT, "IRQ15\n"); | ||
| 452 | break; | ||
| 453 | } | ||
| 454 | |||
| 455 | /* | ||
| 456 | ** If the card enable bit isn't set, then set it! | ||
| 457 | */ | ||
| 458 | if ((Ivec & McaCardEnable) != McaCardEnable) { | ||
| 459 | rio_dprintk (RIO_DEBUG_INIT, "McaCardEnable not set - setting!\n"); | ||
| 460 | outb(McaIrqEnable,Ivec|McaCardEnable); | ||
| 461 | } else | ||
| 462 | rio_dprintk (RIO_DEBUG_INIT, "McaCardEnable already set\n"); | ||
| 463 | |||
| 464 | /* | ||
| 465 | ** Convert the IRQ enable mask into something useful | ||
| 466 | */ | ||
| 467 | Ivec = RIOMcaToIvec[Ivec & McaIrqMask]; | ||
| 468 | |||
| 469 | /* | ||
| 470 | ** Find the physical address | ||
| 471 | */ | ||
| 472 | rio_dprintk (RIO_DEBUG_INIT, "inb(McaMemory) is %x\n", inb(McaMemory)); | ||
| 473 | Paddr = McaAddress(inb(McaMemory)); | ||
| 474 | |||
| 475 | rio_dprintk (RIO_DEBUG_INIT, "MCA card has Ivec %d Addr %x\n", Ivec, Paddr); | ||
| 476 | |||
| 477 | if ( Paddr != 0 ) | ||
| 478 | { | ||
| 479 | |||
| 480 | /* | ||
| 481 | ** Tell the memory mapper that we want to talk to it | ||
| 482 | */ | ||
| 483 | Handle = RIOMapin( Paddr, RIO_MCA_MEM_SIZE, &Caddr ); | ||
| 484 | |||
| 485 | if ( Handle == -1 ) { | ||
| 486 | rio_dprintk (RIO_DEBUG_INIT, "Couldn't map %d bytes at %x\n", RIO_MCA_MEM_SIZE, Paddr; | ||
| 487 | continue; | ||
| 488 | } | ||
| 489 | |||
| 490 | rio_dprintk (RIO_DEBUG_INIT, "Board mapped to vaddr 0x%x\n", Caddr); | ||
| 491 | |||
| 492 | /* | ||
| 493 | ** And check that it is actually there! | ||
| 494 | */ | ||
| 495 | if ( RIOBoardTest( Paddr,Caddr,RIO_MCA,SlotNumber ) == RIO_SUCCESS ) | ||
| 496 | { | ||
| 497 | rio_dprintk (RIO_DEBUG_INIT, "Board has passed test\n"); | ||
| 498 | rio_dprintk (RIO_DEBUG_INIT, "Slot %d. Type %d. Paddr 0x%x. Caddr 0x%x. Mode 0x%x.\n", | ||
| 499 | SlotNumber, RIO_MCA, Paddr, Caddr, Mode); | ||
| 500 | |||
| 501 | /* | ||
| 502 | ** Board has passed its scrub test. Fill in all the | ||
| 503 | ** transient stuff. | ||
| 504 | */ | ||
| 505 | p->RIOHosts[RIONumHosts].Slot = SlotNumber; | ||
| 506 | p->RIOHosts[RIONumHosts].Ivec = Ivec; | ||
| 507 | p->RIOHosts[RIONumHosts].Type = RIO_MCA; | ||
| 508 | p->RIOHosts[RIONumHosts].Copy = bcopy; | ||
| 509 | p->RIOHosts[RIONumHosts].PaddrP = Paddr; | ||
| 510 | p->RIOHosts[RIONumHosts].Caddr = Caddr; | ||
| 511 | p->RIOHosts[RIONumHosts].CardP = (struct DpRam *)Caddr; | ||
| 512 | p->RIOHosts[RIONumHosts].Mode = Mode; | ||
| 513 | WBYTE(p->RIOHosts[p->RIONumHosts].ResetInt , 0xff); | ||
| 514 | p->RIOHosts[RIONumHosts].UniqueNum = | ||
| 515 | ((RBYTE(p->RIOHosts[RIONumHosts].Unique[0])&0xFF)<<0)| | ||
| 516 | ((RBYTE(p->RIOHosts[RIONumHosts].Unique[1])&0xFF)<<8)| | ||
| 517 | ((RBYTE(p->RIOHosts[RIONumHosts].Unique[2])&0xFF)<<16)| | ||
| 518 | ((RBYTE(p->RIOHosts[RIONumHosts].Unique[3])&0xFF)<<24); | ||
| 519 | RIONumHosts++; | ||
| 520 | ret++; | ||
| 521 | } | ||
| 522 | else | ||
| 523 | { | ||
| 524 | /* | ||
| 525 | ** It failed the test, so ignore it. | ||
| 526 | */ | ||
| 527 | rio_dprintk (RIO_DEBUG_INIT, "TEST FAILED\n"); | ||
| 528 | RIOMapout(Paddr, RIO_MCA_MEM_SIZE, Caddr ); | ||
| 529 | } | ||
| 530 | } | ||
| 531 | else | ||
| 532 | { | ||
| 533 | rio_dprintk (RIO_DEBUG_INIT, "Slot %d - Paddr zero!\n", SlotNumber); | ||
| 534 | } | ||
| 535 | } | ||
| 536 | else | ||
| 537 | { | ||
| 538 | rio_dprintk (RIO_DEBUG_INIT, "Slot %d NOT RIO\n", SlotNumber); | ||
| 539 | } | ||
| 540 | } | ||
| 541 | /* | ||
| 542 | ** Now we have checked all the slots, turn off the MCA slot selector | ||
| 543 | */ | ||
| 544 | outb(McaSlotSelect,0); | ||
| 545 | rio_dprintk (RIO_DEBUG_INIT, "Slot %d NOT RIO\n", SlotNumber); | ||
| 546 | return ret; | ||
| 547 | } | ||
| 548 | |||
| 549 | int RIOEISAinit( int Mode ) | ||
| 550 | { | ||
| 551 | static int EISADone = 0; | ||
| 552 | uint Paddr; | ||
| 553 | int PollIntMixMsgDone = 0; | ||
| 554 | caddr_t Caddr; | ||
| 555 | ushort Ident; | ||
| 556 | uchar EisaSlot; | ||
| 557 | uchar Ivec; | ||
| 558 | int ret = 0; | ||
| 559 | |||
| 560 | /* | ||
| 561 | ** The only valid mode information for EISA hosts is fast or slow | ||
| 562 | ** links. | ||
| 563 | */ | ||
| 564 | Mode = (Mode & FAST_LINKS) ? EISA_TP_FAST_LINKS : EISA_TP_SLOW_LINKS; | ||
| 565 | |||
| 566 | if ( EISADone ) | ||
| 567 | { | ||
| 568 | rio_dprintk (RIO_DEBUG_INIT, "RIOEISAinit() - already done, return.\n"); | ||
| 569 | return(0); | ||
| 570 | } | ||
| 571 | |||
| 572 | EISADone++; | ||
| 573 | |||
| 574 | rio_dprintk (RIO_DEBUG_INIT, "RIOEISAinit()\n"); | ||
| 575 | |||
| 576 | |||
| 577 | /* | ||
| 578 | ** First check all cards to see if ANY are set for polled mode operation. | ||
| 579 | ** If so, set ALL to polled. | ||
| 580 | */ | ||
| 581 | |||
| 582 | for ( EisaSlot=1; EisaSlot<=RIO_MAX_EISA_SLOTS; EisaSlot++ ) | ||
| 583 | { | ||
| 584 | Ident = (INBZ(EisaSlot,EISA_PRODUCT_IDENT_HI)<<8) | | ||
| 585 | INBZ(EisaSlot,EISA_PRODUCT_IDENT_LO); | ||
| 586 | |||
| 587 | if ( Ident == RIO_EISA_IDENT ) | ||
| 588 | { | ||
| 589 | rio_dprintk (RIO_DEBUG_INIT, "Found Specialix product\n"); | ||
| 590 | |||
| 591 | if ( INBZ(EisaSlot,EISA_PRODUCT_NUMBER) != RIO_EISA_PRODUCT_CODE ) | ||
| 592 | { | ||
| 593 | rio_dprintk (RIO_DEBUG_INIT, "Not Specialix RIO - Product number %x\n", | ||
| 594 | INBZ(EisaSlot, EISA_PRODUCT_NUMBER)); | ||
| 595 | continue; /* next slot */ | ||
| 596 | } | ||
| 597 | /* | ||
| 598 | ** Its a Specialix RIO! | ||
| 599 | */ | ||
| 600 | rio_dprintk (RIO_DEBUG_INIT, "RIO Revision %d\n", | ||
| 601 | INBZ(EisaSlot, EISA_REVISION_NUMBER)); | ||
| 602 | |||
| 603 | RIOMachineType |= (1<<RIO_EISA); | ||
| 604 | |||
| 605 | /* | ||
| 606 | ** Just check we haven't found too many wonderful objects | ||
| 607 | */ | ||
| 608 | if ( RIONumHosts >= RIO_HOSTS ) | ||
| 609 | { | ||
| 610 | Rprintf(RIOMesgTooManyCards); | ||
| 611 | return 0; | ||
| 612 | } | ||
| 613 | |||
| 614 | /* | ||
| 615 | ** Ensure that the enable bit is set! | ||
| 616 | */ | ||
| 617 | OUTBZ( EisaSlot, EISA_ENABLE, RIO_EISA_ENABLE_BIT ); | ||
| 618 | |||
| 619 | /* | ||
| 620 | ** EISA_INTERRUPT_VEC contains the interrupt vector. | ||
| 621 | */ | ||
| 622 | Ivec = INBZ(EisaSlot,EISA_INTERRUPT_VEC); | ||
| 623 | |||
| 624 | #ifdef RIODEBUG | ||
| 625 | switch ( Ivec & EISA_INTERRUPT_MASK ) | ||
| 626 | { | ||
| 627 | case EISA_IRQ_3: | ||
| 628 | rio_dprintk (RIO_DEBUG_INIT, "EISA IRQ 3\n"); | ||
| 629 | break; | ||
| 630 | case EISA_IRQ_4: | ||
| 631 | rio_dprintk (RIO_DEBUG_INIT, "EISA IRQ 4\n"); | ||
| 632 | break; | ||
| 633 | case EISA_IRQ_5: | ||
| 634 | rio_dprintk (RIO_DEBUG_INIT, "EISA IRQ 5\n"); | ||
| 635 | break; | ||
| 636 | case EISA_IRQ_6: | ||
| 637 | rio_dprintk (RIO_DEBUG_INIT, "EISA IRQ 6\n"); | ||
| 638 | break; | ||
| 639 | case EISA_IRQ_7: | ||
| 640 | rio_dprintk (RIO_DEBUG_INIT, "EISA IRQ 7\n"); | ||
| 641 | break; | ||
| 642 | case EISA_IRQ_9: | ||
| 643 | rio_dprintk (RIO_DEBUG_INIT, "EISA IRQ 9\n"); | ||
| 644 | break; | ||
| 645 | case EISA_IRQ_10: | ||
| 646 | rio_dprintk (RIO_DEBUG_INIT, "EISA IRQ 10\n"); | ||
| 647 | break; | ||
| 648 | case EISA_IRQ_11: | ||
| 649 | rio_dprintk (RIO_DEBUG_INIT, "EISA IRQ 11\n"); | ||
| 650 | break; | ||
| 651 | case EISA_IRQ_12: | ||
| 652 | rio_dprintk (RIO_DEBUG_INIT, "EISA IRQ 12\n"); | ||
| 653 | break; | ||
| 654 | case EISA_IRQ_14: | ||
| 655 | rio_dprintk (RIO_DEBUG_INIT, "EISA IRQ 14\n"); | ||
| 656 | break; | ||
| 657 | case EISA_IRQ_15: | ||
| 658 | rio_dprintk (RIO_DEBUG_INIT, "EISA IRQ 15\n"); | ||
| 659 | break; | ||
| 660 | case EISA_POLLED: | ||
| 661 | rio_dprintk (RIO_DEBUG_INIT, "EISA POLLED\n"); | ||
| 662 | break; | ||
| 663 | default: | ||
| 664 | rio_dprintk (RIO_DEBUG_INIT, NULL,DBG_INIT|DBG_FAIL,"Shagged interrupt number!\n"); | ||
| 665 | Ivec &= EISA_CONTROL_MASK; | ||
| 666 | } | ||
| 667 | #endif | ||
| 668 | |||
| 669 | if ( (Ivec & EISA_INTERRUPT_MASK) == | ||
| 670 | EISA_POLLED ) | ||
| 671 | { | ||
| 672 | RIOWillPoll = 1; | ||
| 673 | break; /* From EisaSlot loop */ | ||
| 674 | } | ||
| 675 | } | ||
| 676 | } | ||
| 677 | |||
| 678 | /* | ||
| 679 | ** Do it all again now we know whether to change all cards to polled | ||
| 680 | ** mode or not | ||
| 681 | */ | ||
| 682 | |||
| 683 | for ( EisaSlot=1; EisaSlot<=RIO_MAX_EISA_SLOTS; EisaSlot++ ) | ||
| 684 | { | ||
| 685 | Ident = (INBZ(EisaSlot,EISA_PRODUCT_IDENT_HI)<<8) | | ||
| 686 | INBZ(EisaSlot,EISA_PRODUCT_IDENT_LO); | ||
| 687 | |||
| 688 | if ( Ident == RIO_EISA_IDENT ) | ||
| 689 | { | ||
| 690 | if ( INBZ(EisaSlot,EISA_PRODUCT_NUMBER) != RIO_EISA_PRODUCT_CODE ) | ||
| 691 | continue; /* next slot */ | ||
| 692 | |||
| 693 | /* | ||
| 694 | ** Its a Specialix RIO! | ||
| 695 | */ | ||
| 696 | |||
| 697 | /* | ||
| 698 | ** Ensure that the enable bit is set! | ||
| 699 | */ | ||
| 700 | OUTBZ( EisaSlot, EISA_ENABLE, RIO_EISA_ENABLE_BIT ); | ||
| 701 | |||
| 702 | /* | ||
| 703 | ** EISA_INTERRUPT_VEC contains the interrupt vector. | ||
| 704 | */ | ||
| 705 | Ivec = INBZ(EisaSlot,EISA_INTERRUPT_VEC); | ||
| 706 | |||
| 707 | if ( RIOWillPoll ) | ||
| 708 | { | ||
| 709 | /* | ||
| 710 | ** If we are going to operate in polled mode, but this | ||
| 711 | ** board is configured to be interrupt driven, display | ||
| 712 | ** the message explaining the situation to the punter, | ||
| 713 | ** assuming we haven't already done so. | ||
| 714 | */ | ||
| 715 | |||
| 716 | if ( !PollIntMixMsgDone && | ||
| 717 | (Ivec & EISA_INTERRUPT_MASK) != EISA_POLLED ) | ||
| 718 | { | ||
| 719 | Rprintf(RIOMesgAllPolled); | ||
| 720 | PollIntMixMsgDone = 1; | ||
| 721 | } | ||
| 722 | |||
| 723 | /* | ||
| 724 | ** Ungraciously ignore whatever the board reports as its | ||
| 725 | ** interrupt vector... | ||
| 726 | */ | ||
| 727 | |||
| 728 | Ivec &= ~EISA_INTERRUPT_MASK; | ||
| 729 | |||
| 730 | /* | ||
| 731 | ** ...and force it to dance to the poll tune. | ||
| 732 | */ | ||
| 733 | |||
| 734 | Ivec |= EISA_POLLED; | ||
| 735 | } | ||
| 736 | |||
| 737 | /* | ||
| 738 | ** Convert the IRQ enable mask into something useful (0-15) | ||
| 739 | */ | ||
| 740 | Ivec = RIOEisaToIvec(Ivec); | ||
| 741 | |||
| 742 | rio_dprintk (RIO_DEBUG_INIT, "EISA host in slot %d has Ivec 0x%x\n", | ||
| 743 | EisaSlot, Ivec); | ||
| 744 | |||
| 745 | /* | ||
| 746 | ** Find the physical address | ||
| 747 | */ | ||
| 748 | Paddr = (INBZ(EisaSlot,EISA_MEMORY_BASE_HI)<<24) | | ||
| 749 | (INBZ(EisaSlot,EISA_MEMORY_BASE_LO)<<16); | ||
| 750 | |||
| 751 | rio_dprintk (RIO_DEBUG_INIT, "EISA card has Ivec %d Addr %x\n", Ivec, Paddr); | ||
| 752 | |||
| 753 | if ( Paddr == 0 ) | ||
| 754 | { | ||
| 755 | rio_dprintk (RIO_DEBUG_INIT, | ||
| 756 | "Board in slot %d configured for address zero!\n", EisaSlot); | ||
| 757 | continue; | ||
| 758 | } | ||
| 759 | |||
| 760 | /* | ||
| 761 | ** Tell the memory mapper that we want to talk to it | ||
| 762 | */ | ||
| 763 | rio_dprintk (RIO_DEBUG_INIT, "About to map EISA card \n"); | ||
| 764 | |||
| 765 | if (RIOMapin( Paddr, RIO_EISA_MEM_SIZE, &Caddr) == -1) { | ||
| 766 | rio_dprintk (RIO_DEBUG_INIT, "Couldn't map %d bytes at %x\n", | ||
| 767 | RIO_EISA_MEM_SIZE,Paddr); | ||
| 768 | continue; | ||
| 769 | } | ||
| 770 | |||
| 771 | rio_dprintk (RIO_DEBUG_INIT, "Board mapped to vaddr 0x%x\n", Caddr); | ||
| 772 | |||
| 773 | /* | ||
| 774 | ** And check that it is actually there! | ||
| 775 | */ | ||
| 776 | if ( RIOBoardTest( Paddr,Caddr,RIO_EISA,EisaSlot) == RIO_SUCCESS ) | ||
| 777 | { | ||
| 778 | rio_dprintk (RIO_DEBUG_INIT, "Board has passed test\n"); | ||
| 779 | rio_dprintk (RIO_DEBUG_INIT, | ||
| 780 | "Slot %d. Ivec %d. Type %d. Paddr 0x%x. Caddr 0x%x. Mode 0x%x.\n", | ||
| 781 | EisaSlot,Ivec,RIO_EISA,Paddr,Caddr,Mode); | ||
| 782 | |||
| 783 | /* | ||
| 784 | ** Board has passed its scrub test. Fill in all the | ||
| 785 | ** transient stuff. | ||
| 786 | */ | ||
| 787 | p->RIOHosts[RIONumHosts].Slot = EisaSlot; | ||
| 788 | p->RIOHosts[RIONumHosts].Ivec = Ivec; | ||
| 789 | p->RIOHosts[RIONumHosts].Type = RIO_EISA; | ||
| 790 | p->RIOHosts[RIONumHosts].Copy = bcopy; | ||
| 791 | p->RIOHosts[RIONumHosts].PaddrP = Paddr; | ||
| 792 | p->RIOHosts[RIONumHosts].Caddr = Caddr; | ||
| 793 | p->RIOHosts[RIONumHosts].CardP = (struct DpRam *)Caddr; | ||
| 794 | p->RIOHosts[RIONumHosts].Mode = Mode; | ||
| 795 | /* | ||
| 796 | ** because the EISA prom is mapped into IO space, we | ||
| 797 | ** need to copy the unqiue number into the memory area | ||
| 798 | ** that it would have occupied, so that the download | ||
| 799 | ** code can determine its ID and card type. | ||
| 800 | */ | ||
| 801 | WBYTE(p->RIOHosts[RIONumHosts].Unique[0],INBZ(EisaSlot,EISA_UNIQUE_NUM_0)); | ||
| 802 | WBYTE(p->RIOHosts[RIONumHosts].Unique[1],INBZ(EisaSlot,EISA_UNIQUE_NUM_1)); | ||
| 803 | WBYTE(p->RIOHosts[RIONumHosts].Unique[2],INBZ(EisaSlot,EISA_UNIQUE_NUM_2)); | ||
| 804 | WBYTE(p->RIOHosts[RIONumHosts].Unique[3],INBZ(EisaSlot,EISA_UNIQUE_NUM_3)); | ||
| 805 | p->RIOHosts[RIONumHosts].UniqueNum = | ||
| 806 | ((RBYTE(p->RIOHosts[RIONumHosts].Unique[0])&0xFF)<<0)| | ||
| 807 | ((RBYTE(p->RIOHosts[RIONumHosts].Unique[1])&0xFF)<<8)| | ||
| 808 | ((RBYTE(p->RIOHosts[RIONumHosts].Unique[2])&0xFF)<<16)| | ||
| 809 | ((RBYTE(p->RIOHosts[RIONumHosts].Unique[3])&0xFF)<<24); | ||
| 810 | INBZ(EisaSlot,EISA_INTERRUPT_RESET); | ||
| 811 | RIONumHosts++; | ||
| 812 | ret++; | ||
| 813 | } | ||
| 814 | else | ||
| 815 | { | ||
| 816 | /* | ||
| 817 | ** It failed the test, so ignore it. | ||
| 818 | */ | ||
| 819 | rio_dprintk (RIO_DEBUG_INIT, "TEST FAILED\n"); | ||
| 820 | |||
| 821 | RIOMapout(Paddr, RIO_EISA_MEM_SIZE, Caddr ); | ||
| 822 | } | ||
| 823 | } | ||
| 824 | } | ||
| 825 | if (RIOMachineType & RIO_EISA) | ||
| 826 | return ret+1; | ||
| 827 | return ret; | ||
| 828 | } | ||
| 829 | #endif | ||
| 830 | |||
| 831 | |||
| 832 | #ifndef linux | ||
| 833 | |||
| 834 | #define CONFIG_ADDRESS 0xcf8 | ||
| 835 | #define CONFIG_DATA 0xcfc | ||
| 836 | #define FORWARD_REG 0xcfa | ||
| 837 | |||
| 838 | |||
| 839 | static int | ||
| 840 | read_config(int bus_number, int device_num, int r_number) | ||
| 841 | { | ||
| 842 | unsigned int cav; | ||
| 843 | unsigned int val; | ||
| 844 | |||
| 845 | /* | ||
| 846 | Build config_address_value: | ||
| 847 | |||
| 848 | 31 24 23 16 15 11 10 8 7 0 | ||
| 849 | ------------------------------------------------------ | ||
| 850 | |1| 0000000 | bus_number | device # | 000 | register | | ||
| 851 | ------------------------------------------------------ | ||
| 852 | */ | ||
| 853 | |||
| 854 | cav = r_number & 0xff; | ||
| 855 | cav |= ((device_num & 0x1f) << 11); | ||
| 856 | cav |= ((bus_number & 0xff) << 16); | ||
| 857 | cav |= 0x80000000; /* Enable bit */ | ||
| 858 | outpd(CONFIG_ADDRESS,cav); | ||
| 859 | val = inpd(CONFIG_DATA); | ||
| 860 | outpd(CONFIG_ADDRESS,0); | ||
| 861 | return val; | ||
| 862 | } | ||
| 863 | |||
| 864 | static | ||
| 865 | write_config(bus_number,device_num,r_number,val) | ||
| 866 | { | ||
| 867 | unsigned int cav; | ||
| 868 | |||
| 869 | /* | ||
| 870 | Build config_address_value: | ||
| 871 | |||
| 872 | 31 24 23 16 15 11 10 8 7 0 | ||
| 873 | ------------------------------------------------------ | ||
| 874 | |1| 0000000 | bus_number | device # | 000 | register | | ||
| 875 | ------------------------------------------------------ | ||
| 876 | */ | ||
| 877 | |||
| 878 | cav = r_number & 0xff; | ||
| 879 | cav |= ((device_num & 0x1f) << 11); | ||
| 880 | cav |= ((bus_number & 0xff) << 16); | ||
| 881 | cav |= 0x80000000; /* Enable bit */ | ||
| 882 | outpd(CONFIG_ADDRESS, cav); | ||
| 883 | outpd(CONFIG_DATA, val); | ||
| 884 | outpd(CONFIG_ADDRESS, 0); | ||
| 885 | return val; | ||
| 886 | } | ||
| 887 | #else | ||
| 888 | /* XXX Implement these... */ | ||
| 889 | static int | ||
| 890 | read_config(int bus_number, int device_num, int r_number) | ||
| 891 | { | ||
| 892 | return 0; | ||
| 893 | } | ||
| 894 | |||
| 895 | static int | ||
| 896 | write_config(int bus_number, int device_num, int r_number) | ||
| 897 | { | ||
| 898 | return 0; | ||
| 899 | } | ||
| 900 | |||
| 901 | #endif | ||
| 902 | |||
| 903 | int | ||
| 904 | RIOPCIinit(p, Mode) | ||
| 905 | struct rio_info *p; | ||
| 906 | int Mode; | ||
| 907 | { | ||
| 908 | #define MAX_PCI_SLOT 32 | ||
| 909 | #define RIO_PCI_JET_CARD 0x200011CB | ||
| 910 | |||
| 911 | static int slot; /* count of machine's PCI slots searched so far */ | ||
| 912 | caddr_t Caddr; /* Virtual address of the current PCI host card. */ | ||
| 913 | unsigned char Ivec; /* interrupt vector for the current PCI host */ | ||
| 914 | unsigned long Paddr; /* Physical address for the current PCI host */ | ||
| 915 | int Handle; /* Handle to Virtual memory allocated for current PCI host */ | ||
| 916 | |||
| 917 | |||
| 918 | rio_dprintk (RIO_DEBUG_INIT, "Search for a RIO PCI card - start at slot %d\n", slot); | ||
| 919 | |||
| 920 | /* | ||
| 921 | ** Initialise the search status | ||
| 922 | */ | ||
| 923 | p->RIOLastPCISearch = RIO_FAIL; | ||
| 924 | |||
| 925 | while ( (slot < MAX_PCI_SLOT) & (p->RIOLastPCISearch != RIO_SUCCESS) ) | ||
| 926 | { | ||
| 927 | rio_dprintk (RIO_DEBUG_INIT, "Currently testing slot %d\n", slot); | ||
| 928 | |||
| 929 | if (read_config(0,slot,0) == RIO_PCI_JET_CARD) { | ||
| 930 | p->RIOHosts[p->RIONumHosts].Ivec = 0; | ||
| 931 | Paddr = read_config(0,slot,0x18); | ||
| 932 | Paddr = Paddr - (Paddr & 0x1); /* Mask off the io bit */ | ||
| 933 | |||
| 934 | if ( (Paddr == 0) || ((Paddr & 0xffff0000) == 0xffff0000) ) { | ||
| 935 | rio_dprintk (RIO_DEBUG_INIT, "Goofed up slot\n"); /* what! */ | ||
| 936 | slot++; | ||
| 937 | continue; | ||
| 938 | } | ||
| 939 | |||
| 940 | p->RIOHosts[p->RIONumHosts].PaddrP = Paddr; | ||
| 941 | Ivec = (read_config(0,slot,0x3c) & 0xff); | ||
| 942 | |||
| 943 | rio_dprintk (RIO_DEBUG_INIT, "PCI Host at 0x%x, Intr %d\n", (int)Paddr, Ivec); | ||
| 944 | |||
| 945 | Handle = RIOMapin( Paddr, RIO_PCI_MEM_SIZE, &Caddr ); | ||
| 946 | if (Handle == -1) { | ||
| 947 | rio_dprintk (RIO_DEBUG_INIT, "Couldn't map %d bytes at 0x%x\n", RIO_PCI_MEM_SIZE, (int)Paddr); | ||
| 948 | slot++; | ||
| 949 | continue; | ||
| 950 | } | ||
| 951 | p->RIOHosts[p->RIONumHosts].Ivec = Ivec + 32; | ||
| 952 | p->intr_tid = iointset(p->RIOHosts[p->RIONumHosts].Ivec, | ||
| 953 | (int (*)())rio_intr, (char *)p->RIONumHosts); | ||
| 954 | if (RIOBoardTest( Paddr, Caddr, RIO_PCI, 0 ) == RIO_SUCCESS) { | ||
| 955 | rio_dprintk (RIO_DEBUG_INIT, ("Board has passed test\n"); | ||
| 956 | rio_dprintk (RIO_DEBUG_INIT, ("Paddr 0x%x. Caddr 0x%x. Mode 0x%x.\n", Paddr, Caddr, Mode); | ||
| 957 | |||
| 958 | /* | ||
| 959 | ** Board has passed its scrub test. Fill in all the | ||
| 960 | ** transient stuff. | ||
| 961 | */ | ||
| 962 | p->RIOHosts[p->RIONumHosts].Slot = 0; | ||
| 963 | p->RIOHosts[p->RIONumHosts].Ivec = Ivec + 32; | ||
| 964 | p->RIOHosts[p->RIONumHosts].Type = RIO_PCI; | ||
| 965 | p->RIOHosts[p->RIONumHosts].Copy = rio_pcicopy; | ||
| 966 | p->RIOHosts[p->RIONumHosts].PaddrP = Paddr; | ||
| 967 | p->RIOHosts[p->RIONumHosts].Caddr = Caddr; | ||
| 968 | p->RIOHosts[p->RIONumHosts].CardP = (struct DpRam *)Caddr; | ||
| 969 | p->RIOHosts[p->RIONumHosts].Mode = Mode; | ||
| 970 | |||
| 971 | #if 0 | ||
| 972 | WBYTE(p->RIOHosts[p->RIONumHosts].Control, | ||
| 973 | BOOT_FROM_RAM | EXTERNAL_BUS_OFF | | ||
| 974 | p->RIOHosts[p->RIONumHosts].Mode | | ||
| 975 | INTERRUPT_DISABLE ); | ||
| 976 | WBYTE(p->RIOHosts[p->RIONumHosts].ResetInt,0xff); | ||
| 977 | WBYTE(p->RIOHosts[p->RIONumHosts].Control, | ||
| 978 | BOOT_FROM_RAM | EXTERNAL_BUS_OFF | | ||
| 979 | p->RIOHosts[p->RIONumHosts].Mode | | ||
| 980 | INTERRUPT_DISABLE ); | ||
| 981 | WBYTE(p->RIOHosts[p->RIONumHosts].ResetInt,0xff); | ||
| 982 | #else | ||
| 983 | WBYTE(p->RIOHosts[p->RIONumHosts].ResetInt, 0xff); | ||
| 984 | #endif | ||
| 985 | p->RIOHosts[p->RIONumHosts].UniqueNum = | ||
| 986 | ((RBYTE(p->RIOHosts[p->RIONumHosts].Unique[0])&0xFF)<<0)| | ||
| 987 | ((RBYTE(p->RIOHosts[p->RIONumHosts].Unique[1])&0xFF)<<8)| | ||
| 988 | ((RBYTE(p->RIOHosts[p->RIONumHosts].Unique[2])&0xFF)<<16)| | ||
| 989 | ((RBYTE(p->RIOHosts[p->RIONumHosts].Unique[3])&0xFF)<<24); | ||
| 990 | |||
| 991 | rio_dprintk (RIO_DEBUG_INIT, "Unique no 0x%x.\n", | ||
| 992 | p->RIOHosts[p->RIONumHosts].UniqueNum); | ||
| 993 | |||
| 994 | p->RIOLastPCISearch = RIO_SUCCESS; | ||
| 995 | p->RIONumHosts++; | ||
| 996 | } | ||
| 997 | } | ||
| 998 | slot++; | ||
| 999 | } | ||
| 1000 | |||
| 1001 | if ( slot >= MAX_PCI_SLOT ) { | ||
| 1002 | rio_dprintk (RIO_DEBUG_INIT, "All %d PCI slots have tested for RIO cards !!!\n", | ||
| 1003 | MAX_PCI_SLOT); | ||
| 1004 | } | ||
| 1005 | |||
| 1006 | |||
| 1007 | /* | ||
| 1008 | ** I don't think we want to do this anymore | ||
| 1009 | ** | ||
| 1010 | |||
| 1011 | if (!p->RIOLastPCISearch == RIO_FAIL ) { | ||
| 1012 | p->RIOFailed++; | ||
| 1013 | } | ||
| 1014 | |||
| 1015 | ** | ||
| 1016 | */ | ||
| 1017 | } | ||
| 1018 | |||
| 1019 | #ifdef FUTURE_RELEASE | ||
| 1020 | void riohalt( void ) | ||
| 1021 | { | ||
| 1022 | int host; | ||
| 1023 | for ( host=0; host<p->RIONumHosts; host++ ) | ||
| 1024 | { | ||
| 1025 | rio_dprintk (RIO_DEBUG_INIT, "Stop host %d\n", host); | ||
| 1026 | (void)RIOBoardTest( p->RIOHosts[host].PaddrP, p->RIOHosts[host].Caddr, p->RIOHosts[host].Type,p->RIOHosts[host].Slot ); | ||
| 1027 | } | ||
| 1028 | } | ||
| 1029 | #endif | ||
| 1030 | #endif | ||
| 1031 | 156 | ||
| 1032 | static uchar val[] = { | 157 | static uchar val[] = { |
| 1033 | #ifdef VERY_LONG_TEST | 158 | #ifdef VERY_LONG_TEST |
| @@ -1262,200 +387,6 @@ int size; | |||
| 1262 | return RIO_SUCCESS; | 387 | return RIO_SUCCESS; |
| 1263 | } | 388 | } |
| 1264 | 389 | ||
| 1265 | /* | ||
| 1266 | ** try to ensure that every host is either in polled mode | ||
| 1267 | ** or is in interrupt mode. Only allow interrupt mode if | ||
| 1268 | ** all hosts can interrupt (why?) | ||
| 1269 | ** and force into polled mode if told to. Patch up the | ||
| 1270 | ** interrupt vector & salute The Queen when you've done. | ||
| 1271 | */ | ||
| 1272 | #if 0 | ||
| 1273 | static void | ||
| 1274 | RIOAllocateInterrupts(p) | ||
| 1275 | struct rio_info * p; | ||
| 1276 | { | ||
| 1277 | int Host; | ||
| 1278 | |||
| 1279 | /* | ||
| 1280 | ** Easy case - if we have been told to poll, then we poll. | ||
| 1281 | */ | ||
| 1282 | if (p->mode & POLLED_MODE) { | ||
| 1283 | RIOStopInterrupts(p, 0, 0); | ||
| 1284 | return; | ||
| 1285 | } | ||
| 1286 | |||
| 1287 | /* | ||
| 1288 | ** check - if any host has been set to polled mode, then all must be. | ||
| 1289 | */ | ||
| 1290 | for (Host=0; Host<p->RIONumHosts; Host++) { | ||
| 1291 | if ( (p->RIOHosts[Host].Type != RIO_AT) && | ||
| 1292 | (p->RIOHosts[Host].Ivec == POLLED) ) { | ||
| 1293 | RIOStopInterrupts(p, 1, Host ); | ||
| 1294 | return; | ||
| 1295 | } | ||
| 1296 | } | ||
| 1297 | for (Host=0; Host<p->RIONumHosts; Host++) { | ||
| 1298 | if (p->RIOHosts[Host].Type == RIO_AT) { | ||
| 1299 | if ( (p->RIOHosts[Host].Ivec - 32) == 0) { | ||
| 1300 | RIOStopInterrupts(p, 2, Host ); | ||
| 1301 | return; | ||
| 1302 | } | ||
| 1303 | } | ||
| 1304 | } | ||
| 1305 | } | ||
| 1306 | |||
| 1307 | /* | ||
| 1308 | ** something has decided that we can't be doing with these | ||
| 1309 | ** new-fangled interrupt thingies. Set everything up to just | ||
| 1310 | ** poll. | ||
| 1311 | */ | ||
| 1312 | static void | ||
| 1313 | RIOStopInterrupts(p, Reason, Host) | ||
| 1314 | struct rio_info * p; | ||
| 1315 | int Reason; | ||
| 1316 | int Host; | ||
| 1317 | { | ||
| 1318 | #ifdef FUTURE_RELEASE | ||
| 1319 | switch (Reason) { | ||
| 1320 | case 0: /* forced into polling by rio_polled */ | ||
| 1321 | break; | ||
| 1322 | case 1: /* SCU has set 'Host' into polled mode */ | ||
| 1323 | break; | ||
| 1324 | case 2: /* there aren't enough interrupt vectors for 'Host' */ | ||
| 1325 | break; | ||
| 1326 | } | ||
| 1327 | #endif | ||
| 1328 | |||
| 1329 | for (Host=0; Host<p->RIONumHosts; Host++ ) { | ||
| 1330 | struct Host *HostP = &p->RIOHosts[Host]; | ||
| 1331 | |||
| 1332 | switch (HostP->Type) { | ||
| 1333 | case RIO_AT: | ||
| 1334 | /* | ||
| 1335 | ** The AT host has it's interrupts disabled by clearing the | ||
| 1336 | ** int_enable bit. | ||
| 1337 | */ | ||
| 1338 | HostP->Mode &= ~INTERRUPT_ENABLE; | ||
| 1339 | HostP->Ivec = POLLED; | ||
| 1340 | break; | ||
| 1341 | #ifdef FUTURE_RELEASE | ||
| 1342 | case RIO_EISA: | ||
| 1343 | /* | ||
| 1344 | ** The EISA host has it's interrupts disabled by setting the | ||
| 1345 | ** Ivec to zero | ||
| 1346 | */ | ||
| 1347 | HostP->Ivec = POLLED; | ||
| 1348 | break; | ||
| 1349 | #endif | ||
| 1350 | case RIO_PCI: | ||
| 1351 | /* | ||
| 1352 | ** The PCI host has it's interrupts disabled by clearing the | ||
| 1353 | ** int_enable bit, like a regular host card. | ||
| 1354 | */ | ||
| 1355 | HostP->Mode &= ~RIO_PCI_INT_ENABLE; | ||
| 1356 | HostP->Ivec = POLLED; | ||
| 1357 | break; | ||
| 1358 | #ifdef FUTURE_RELEASE | ||
| 1359 | case RIO_MCA: | ||
| 1360 | /* | ||
| 1361 | ** There's always one, isn't there? | ||
| 1362 | ** The MCA host card cannot have it's interrupts disabled. | ||
| 1363 | */ | ||
| 1364 | RIOPatchVec(HostP); | ||
| 1365 | break; | ||
| 1366 | #endif | ||
| 1367 | } | ||
| 1368 | } | ||
| 1369 | } | ||
| 1370 | |||
| 1371 | /* | ||
| 1372 | ** This function is called at init time to setup the data structures. | ||
| 1373 | */ | ||
| 1374 | void | ||
| 1375 | RIOAllocDataStructs(p) | ||
| 1376 | struct rio_info * p; | ||
| 1377 | { | ||
| 1378 | int port, | ||
| 1379 | host, | ||
| 1380 | tm; | ||
| 1381 | |||
| 1382 | p->RIOPortp = (struct Port *)sysbrk(RIO_PORTS * sizeof(struct Port)); | ||
| 1383 | if (!p->RIOPortp) { | ||
| 1384 | rio_dprintk (RIO_DEBUG_INIT, "RIO-init: No memory for port structures\n"); | ||
| 1385 | p->RIOFailed++; | ||
| 1386 | return; | ||
| 1387 | } | ||
| 1388 | bzero( p->RIOPortp, sizeof(struct Port) * RIO_PORTS ); | ||
| 1389 | rio_dprintk (RIO_DEBUG_INIT, "RIO-init: allocated and cleared memory for port structs\n"); | ||
| 1390 | rio_dprintk (RIO_DEBUG_INIT, "First RIO port struct @0x%x, size=0x%x bytes\n", | ||
| 1391 | (int)p->RIOPortp, sizeof(struct Port)); | ||
| 1392 | |||
| 1393 | for( port=0; port<RIO_PORTS; port++ ) { | ||
| 1394 | p->RIOPortp[port].PortNum = port; | ||
| 1395 | p->RIOPortp[port].TtyP = &p->channel[port]; | ||
| 1396 | sreset (p->RIOPortp[port].InUse); /* Let the first guy uses it */ | ||
| 1397 | p->RIOPortp[port].portSem = -1; /* Let the first guy takes it */ | ||
| 1398 | p->RIOPortp[port].ParamSem = -1; /* Let the first guy takes it */ | ||
| 1399 | p->RIOPortp[port].timeout_id = 0; /* Let the first guy takes it */ | ||
| 1400 | } | ||
| 1401 | |||
| 1402 | p->RIOHosts = (struct Host *)sysbrk(RIO_HOSTS * sizeof(struct Host)); | ||
| 1403 | if (!p->RIOHosts) { | ||
| 1404 | rio_dprintk (RIO_DEBUG_INIT, "RIO-init: No memory for host structures\n"); | ||
| 1405 | p->RIOFailed++; | ||
| 1406 | return; | ||
| 1407 | } | ||
| 1408 | bzero(p->RIOHosts, sizeof(struct Host)*RIO_HOSTS); | ||
| 1409 | rio_dprintk (RIO_DEBUG_INIT, "RIO-init: allocated and cleared memory for host structs\n"); | ||
| 1410 | rio_dprintk (RIO_DEBUG_INIT, "First RIO host struct @0x%x, size=0x%x bytes\n", | ||
| 1411 | (int)p->RIOHosts, sizeof(struct Host)); | ||
| 1412 | |||
| 1413 | for( host=0; host<RIO_HOSTS; host++ ) { | ||
| 1414 | spin_lock_init (&p->RIOHosts[host].HostLock); | ||
| 1415 | p->RIOHosts[host].timeout_id = 0; /* Let the first guy takes it */ | ||
| 1416 | } | ||
| 1417 | /* | ||
| 1418 | ** check that the buffer size is valid, round down to the next power of | ||
| 1419 | ** two if necessary; if the result is zero, then, hey, no double buffers. | ||
| 1420 | */ | ||
| 1421 | for ( tm = 1; tm && tm <= p->RIOConf.BufferSize; tm <<= 1 ) | ||
| 1422 | ; | ||
| 1423 | tm >>= 1; | ||
| 1424 | p->RIOBufferSize = tm; | ||
| 1425 | p->RIOBufferMask = tm ? tm - 1 : 0; | ||
| 1426 | } | ||
| 1427 | |||
| 1428 | /* | ||
| 1429 | ** this function gets called whenever the data structures need to be | ||
| 1430 | ** re-setup, for example, after a riohalt (why did I ever invent it?) | ||
| 1431 | */ | ||
| 1432 | void | ||
| 1433 | RIOSetupDataStructs(p) | ||
| 1434 | struct rio_info * p; | ||
| 1435 | { | ||
| 1436 | int host, entry, rup; | ||
| 1437 | |||
| 1438 | for ( host=0; host<RIO_HOSTS; host++ ) { | ||
| 1439 | struct Host *HostP = &p->RIOHosts[host]; | ||
| 1440 | for ( entry=0; entry<LINKS_PER_UNIT; entry++ ) { | ||
| 1441 | HostP->Topology[entry].Unit = ROUTE_DISCONNECT; | ||
| 1442 | HostP->Topology[entry].Link = NO_LINK; | ||
| 1443 | } | ||
| 1444 | bcopy("HOST X", HostP->Name, 7); | ||
| 1445 | HostP->Name[5] = '1'+host; | ||
| 1446 | for (rup=0; rup<(MAX_RUP + LINKS_PER_UNIT); rup++) { | ||
| 1447 | if (rup < MAX_RUP) { | ||
| 1448 | for (entry=0; entry<LINKS_PER_UNIT; entry++ ) { | ||
| 1449 | HostP->Mapping[rup].Topology[entry].Unit = ROUTE_DISCONNECT; | ||
| 1450 | HostP->Mapping[rup].Topology[entry].Link = NO_LINK; | ||
| 1451 | } | ||
| 1452 | RIODefaultName(p, HostP, rup); | ||
| 1453 | } | ||
| 1454 | spin_lock_init(&HostP->UnixRups[rup].RupLock); | ||
| 1455 | } | ||
| 1456 | } | ||
| 1457 | } | ||
| 1458 | #endif | ||
| 1459 | 390 | ||
| 1460 | int | 391 | int |
| 1461 | RIODefaultName(p, HostP, UnitId) | 392 | RIODefaultName(p, HostP, UnitId) |
| @@ -1463,10 +394,6 @@ struct rio_info * p; | |||
| 1463 | struct Host * HostP; | 394 | struct Host * HostP; |
| 1464 | uint UnitId; | 395 | uint UnitId; |
| 1465 | { | 396 | { |
| 1466 | #ifdef CHECK | ||
| 1467 | CheckHost( Host ); | ||
| 1468 | CheckUnitId( UnitId ); | ||
| 1469 | #endif | ||
| 1470 | bcopy("UNKNOWN RTA X-XX",HostP->Mapping[UnitId].Name,17); | 397 | bcopy("UNKNOWN RTA X-XX",HostP->Mapping[UnitId].Name,17); |
| 1471 | HostP->Mapping[UnitId].Name[12]='1'+(HostP-p->RIOHosts); | 398 | HostP->Mapping[UnitId].Name[12]='1'+(HostP-p->RIOHosts); |
| 1472 | if ((UnitId+1) > 9) { | 399 | if ((UnitId+1) > 9) { |
| @@ -1483,33 +410,6 @@ uint UnitId; | |||
| 1483 | #define RIO_RELEASE "Linux" | 410 | #define RIO_RELEASE "Linux" |
| 1484 | #define RELEASE_ID "1.0" | 411 | #define RELEASE_ID "1.0" |
| 1485 | 412 | ||
| 1486 | #if 0 | ||
| 1487 | static int | ||
| 1488 | RIOReport(p) | ||
| 1489 | struct rio_info * p; | ||
| 1490 | { | ||
| 1491 | char * RIORelease = RIO_RELEASE; | ||
| 1492 | char * RIORelID = RELEASE_ID; | ||
| 1493 | int host; | ||
| 1494 | |||
| 1495 | rio_dprintk (RIO_DEBUG_INIT, "RIO : Release: %s ID: %s\n", RIORelease, RIORelID); | ||
| 1496 | |||
| 1497 | if ( p->RIONumHosts==0 ) { | ||
| 1498 | rio_dprintk (RIO_DEBUG_INIT, "\nNo Hosts configured\n"); | ||
| 1499 | return(0); | ||
| 1500 | } | ||
| 1501 | |||
| 1502 | for ( host=0; host < p->RIONumHosts; host++ ) { | ||
| 1503 | struct Host *HostP = &p->RIOHosts[host]; | ||
| 1504 | switch ( HostP->Type ) { | ||
| 1505 | case RIO_AT: | ||
| 1506 | rio_dprintk (RIO_DEBUG_INIT, "AT BUS : found the card at 0x%x\n", HostP->PaddrP); | ||
| 1507 | } | ||
| 1508 | } | ||
| 1509 | return 0; | ||
| 1510 | } | ||
| 1511 | #endif | ||
| 1512 | |||
| 1513 | static struct rioVersion stVersion; | 413 | static struct rioVersion stVersion; |
| 1514 | 414 | ||
| 1515 | struct rioVersion * | 415 | struct rioVersion * |
| @@ -1523,27 +423,6 @@ RIOVersid(void) | |||
| 1523 | return &stVersion; | 423 | return &stVersion; |
| 1524 | } | 424 | } |
| 1525 | 425 | ||
| 1526 | #if 0 | ||
| 1527 | int | ||
| 1528 | RIOMapin(paddr, size, vaddr) | ||
| 1529 | paddr_t paddr; | ||
| 1530 | int size; | ||
| 1531 | caddr_t * vaddr; | ||
| 1532 | { | ||
| 1533 | *vaddr = (caddr_t)permap( (long)paddr, size); | ||
| 1534 | return ((int)*vaddr); | ||
| 1535 | } | ||
| 1536 | |||
| 1537 | void | ||
| 1538 | RIOMapout(paddr, size, vaddr) | ||
| 1539 | paddr_t paddr; | ||
| 1540 | long size; | ||
| 1541 | caddr_t vaddr; | ||
| 1542 | { | ||
| 1543 | } | ||
| 1544 | #endif | ||
| 1545 | |||
| 1546 | |||
| 1547 | void | 426 | void |
| 1548 | RIOHostReset(Type, DpRamP, Slot) | 427 | RIOHostReset(Type, DpRamP, Slot) |
| 1549 | uint Type; | 428 | uint Type; |
| @@ -1570,31 +449,6 @@ uint Slot; | |||
| 1570 | WBYTE(DpRamP->DpResetTpu, 0xFF); | 449 | WBYTE(DpRamP->DpResetTpu, 0xFF); |
| 1571 | udelay(3); | 450 | udelay(3); |
| 1572 | break; | 451 | break; |
| 1573 | #ifdef FUTURE_RELEASE | ||
| 1574 | case RIO_EISA: | ||
| 1575 | /* | ||
| 1576 | ** Bet this doesn't work! | ||
| 1577 | */ | ||
| 1578 | OUTBZ( Slot, EISA_CONTROL_PORT, | ||
| 1579 | EISA_TP_RUN | EISA_TP_BUS_DISABLE | | ||
| 1580 | EISA_TP_SLOW_LINKS | EISA_TP_BOOT_FROM_RAM ); | ||
| 1581 | OUTBZ( Slot, EISA_CONTROL_PORT, | ||
| 1582 | EISA_TP_RESET | EISA_TP_BUS_DISABLE | | ||
| 1583 | EISA_TP_SLOW_LINKS | EISA_TP_BOOT_FROM_RAM ); | ||
| 1584 | suspend( 3 ); | ||
| 1585 | OUTBZ( Slot, EISA_CONTROL_PORT, | ||
| 1586 | EISA_TP_RUN | EISA_TP_BUS_DISABLE | | ||
| 1587 | EISA_TP_SLOW_LINKS | EISA_TP_BOOT_FROM_RAM ); | ||
| 1588 | break; | ||
| 1589 | case RIO_MCA: | ||
| 1590 | WBYTE(DpRamP->DpControl , McaTpBootFromRam | McaTpBusDisable ); | ||
| 1591 | WBYTE(DpRamP->DpResetTpu , 0xFF ); | ||
| 1592 | suspend( 3 ); | ||
| 1593 | WBYTE(DpRamP->DpControl , McaTpBootFromRam | McaTpBusDisable ); | ||
| 1594 | WBYTE(DpRamP->DpResetTpu , 0xFF ); | ||
| 1595 | suspend( 3 ); | ||
| 1596 | break; | ||
| 1597 | #endif | ||
| 1598 | case RIO_PCI: | 452 | case RIO_PCI: |
| 1599 | rio_dprintk (RIO_DEBUG_INIT, " (RIO_PCI)\n"); | 453 | rio_dprintk (RIO_DEBUG_INIT, " (RIO_PCI)\n"); |
| 1600 | DpRamP->DpControl = RIO_PCI_BOOT_FROM_RAM; | 454 | DpRamP->DpControl = RIO_PCI_BOOT_FROM_RAM; |
| @@ -1604,12 +458,6 @@ uint Slot; | |||
| 1604 | /* for (i=0; i<6000; i++); */ | 458 | /* for (i=0; i<6000; i++); */ |
| 1605 | /* suspend( 3 ); */ | 459 | /* suspend( 3 ); */ |
| 1606 | break; | 460 | break; |
| 1607 | #ifdef FUTURE_RELEASE | ||
| 1608 | default: | ||
| 1609 | Rprintf(RIOMesgNoSupport,Type,DpRamP,Slot); | ||
| 1610 | return; | ||
| 1611 | #endif | ||
| 1612 | |||
| 1613 | default: | 461 | default: |
| 1614 | rio_dprintk (RIO_DEBUG_INIT, " (UNKNOWN)\n"); | 462 | rio_dprintk (RIO_DEBUG_INIT, " (UNKNOWN)\n"); |
| 1615 | break; | 463 | break; |
diff --git a/drivers/char/rio/riolocks.h b/drivers/char/rio/riolocks.h deleted file mode 100644 index 0e0cdacebe0b..000000000000 --- a/drivers/char/rio/riolocks.h +++ /dev/null | |||
| @@ -1,43 +0,0 @@ | |||
| 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 : riolocks.h | ||
| 24 | ** SID : 1.2 | ||
| 25 | ** Last Modified : 11/6/98 11:34:13 | ||
| 26 | ** Retrieved : 11/6/98 11:34:22 | ||
| 27 | ** | ||
| 28 | ** ident @(#)riolocks.h 1.2 | ||
| 29 | ** | ||
| 30 | ** ----------------------------------------------------------------------------- | ||
| 31 | */ | ||
| 32 | |||
| 33 | #ifndef __rio_riolocks_h__ | ||
| 34 | #define __rio_riolocks_h__ | ||
| 35 | |||
| 36 | #ifdef SCCS_LABELS | ||
| 37 | static char *_riolocks_h_sccs_ = "@(#)riolocks.h 1.2"; | ||
| 38 | #endif | ||
| 39 | |||
| 40 | #define LOCKB(lk) lockb(lk); | ||
| 41 | #define UNLOCKB(lk, oldspl) unlockb(lk, oldspl); | ||
| 42 | |||
| 43 | #endif | ||
diff --git a/drivers/char/rio/rioparam.c b/drivers/char/rio/rioparam.c index 4cc7f4942bfc..c622f46d6d77 100644 --- a/drivers/char/rio/rioparam.c +++ b/drivers/char/rio/rioparam.c | |||
| @@ -195,27 +195,6 @@ int SleepFlag; | |||
| 195 | ** paramed with OPEN, we want to restore the saved port termio, but | 195 | ** paramed with OPEN, we want to restore the saved port termio, but |
| 196 | ** only if StoredTermio has been saved, i.e. NOT 1st open after reboot. | 196 | ** only if StoredTermio has been saved, i.e. NOT 1st open after reboot. |
| 197 | */ | 197 | */ |
| 198 | #if 0 | ||
| 199 | if (PortP->FirstOpen) { | ||
| 200 | PortP->StoredTty.iflag = TtyP->tm.c_iflag; | ||
| 201 | PortP->StoredTty.oflag = TtyP->tm.c_oflag; | ||
| 202 | PortP->StoredTty.cflag = TtyP->tm.c_cflag; | ||
| 203 | PortP->StoredTty.lflag = TtyP->tm.c_lflag; | ||
| 204 | PortP->StoredTty.line = TtyP->tm.c_line; | ||
| 205 | for (i = 0; i < NCC + 5; i++) | ||
| 206 | PortP->StoredTty.cc[i] = TtyP->tm.c_cc[i]; | ||
| 207 | PortP->FirstOpen = 0; | ||
| 208 | } else if (PortP->Store || PortP->Lock) { | ||
| 209 | rio_dprintk(RIO_DEBUG_PARAM, "OPEN: Restoring stored/locked params\n"); | ||
| 210 | TtyP->tm.c_iflag = PortP->StoredTty.iflag; | ||
| 211 | TtyP->tm.c_oflag = PortP->StoredTty.oflag; | ||
| 212 | TtyP->tm.c_cflag = PortP->StoredTty.cflag; | ||
| 213 | TtyP->tm.c_lflag = PortP->StoredTty.lflag; | ||
| 214 | TtyP->tm.c_line = PortP->StoredTty.line; | ||
| 215 | for (i = 0; i < NCC + 5; i++) | ||
| 216 | TtyP->tm.c_cc[i] = PortP->StoredTty.cc[i]; | ||
| 217 | } | ||
| 218 | #endif | ||
| 219 | } | 198 | } |
| 220 | 199 | ||
| 221 | /* | 200 | /* |
| @@ -273,16 +252,6 @@ int SleepFlag; | |||
| 273 | phb_param_ptr = (struct phb_param *) PacketP->data; | 252 | phb_param_ptr = (struct phb_param *) PacketP->data; |
| 274 | 253 | ||
| 275 | 254 | ||
| 276 | #if 0 | ||
| 277 | /* | ||
| 278 | ** COR 1 | ||
| 279 | */ | ||
| 280 | if (TtyP->tm.c_iflag & INPCK) { | ||
| 281 | rio_dprintk(RIO_DEBUG_PARAM, "Parity checking on input enabled\n"); | ||
| 282 | Cor1 |= COR1_INPCK; | ||
| 283 | } | ||
| 284 | #endif | ||
| 285 | |||
| 286 | switch (TtyP->termios->c_cflag & CSIZE) { | 255 | switch (TtyP->termios->c_cflag & CSIZE) { |
| 287 | case CS5: | 256 | case CS5: |
| 288 | { | 257 | { |
| @@ -524,10 +493,6 @@ int SleepFlag; | |||
| 524 | if (TtyP->termios->c_cflag & XMT1EN) | 493 | if (TtyP->termios->c_cflag & XMT1EN) |
| 525 | rio_dprintk(RIO_DEBUG_PARAM, "XMT1EN (?)\n"); | 494 | rio_dprintk(RIO_DEBUG_PARAM, "XMT1EN (?)\n"); |
| 526 | #endif | 495 | #endif |
| 527 | #if 0 | ||
| 528 | if (TtyP->termios->c_cflag & LOBLK) | ||
| 529 | rio_dprintk(RIO_DEBUG_PARAM, "LOBLK - JCL output blocks when not current\n"); | ||
| 530 | #endif | ||
| 531 | if (TtyP->termios->c_lflag & ISIG) | 496 | if (TtyP->termios->c_lflag & ISIG) |
| 532 | rio_dprintk(RIO_DEBUG_PARAM, "Input character signal generating enabled\n"); | 497 | rio_dprintk(RIO_DEBUG_PARAM, "Input character signal generating enabled\n"); |
| 533 | if (TtyP->termios->c_lflag & ICANON) | 498 | if (TtyP->termios->c_lflag & ICANON) |
| @@ -572,14 +537,6 @@ int SleepFlag; | |||
| 572 | rio_dprintk(RIO_DEBUG_PARAM, "Carriage return delay set\n"); | 537 | rio_dprintk(RIO_DEBUG_PARAM, "Carriage return delay set\n"); |
| 573 | if (TtyP->termios->c_oflag & TABDLY) | 538 | if (TtyP->termios->c_oflag & TABDLY) |
| 574 | rio_dprintk(RIO_DEBUG_PARAM, "Tab delay set\n"); | 539 | rio_dprintk(RIO_DEBUG_PARAM, "Tab delay set\n"); |
| 575 | #if 0 | ||
| 576 | if (TtyP->termios->c_oflag & BSDLY) | ||
| 577 | rio_dprintk(RIO_DEBUG_PARAM, "Back-space delay set\n"); | ||
| 578 | if (TtyP->termios->c_oflag & VTDLY) | ||
| 579 | rio_dprintk(RIO_DEBUG_PARAM, "Vertical tab delay set\n"); | ||
| 580 | if (TtyP->termios->c_oflag & FFDLY) | ||
| 581 | rio_dprintk(RIO_DEBUG_PARAM, "Form-feed delay set\n"); | ||
| 582 | #endif | ||
| 583 | /* | 540 | /* |
| 584 | ** These things are kind of useful in a later life! | 541 | ** These things are kind of useful in a later life! |
| 585 | */ | 542 | */ |
diff --git a/drivers/char/rio/rioroute.c b/drivers/char/rio/rioroute.c index 0f4cd33ba641..f98888f52659 100644 --- a/drivers/char/rio/rioroute.c +++ b/drivers/char/rio/rioroute.c | |||
| @@ -112,15 +112,6 @@ int RIORouteRup(struct rio_info *p, uint Rup, struct Host *HostP, PKT * PacketP) | |||
| 112 | int Lies; | 112 | int Lies; |
| 113 | unsigned long flags; | 113 | unsigned long flags; |
| 114 | 114 | ||
| 115 | #ifdef STACK | ||
| 116 | RIOStackCheck("RIORouteRup"); | ||
| 117 | #endif | ||
| 118 | #ifdef CHECK | ||
| 119 | CheckPacketP(PacketP); | ||
| 120 | CheckHostP(HostP); | ||
| 121 | CheckRup(Rup); | ||
| 122 | CheckHost(Host); | ||
| 123 | #endif | ||
| 124 | /* | 115 | /* |
| 125 | ** Is this unit telling us it's current link topology? | 116 | ** Is this unit telling us it's current link topology? |
| 126 | */ | 117 | */ |
| @@ -540,9 +531,6 @@ uint unit; | |||
| 540 | 531 | ||
| 541 | for (port = 0; port < PORTS_PER_RTA; port++, PortN++) { | 532 | for (port = 0; port < PORTS_PER_RTA; port++, PortN++) { |
| 542 | ushort dest_port = port + 8; | 533 | ushort dest_port = port + 8; |
| 543 | #if 0 | ||
| 544 | uint PktInt; | ||
| 545 | #endif | ||
| 546 | WORD *TxPktP; | 534 | WORD *TxPktP; |
| 547 | PKT *Pkt; | 535 | PKT *Pkt; |
| 548 | 536 | ||
| @@ -623,10 +611,6 @@ uint UnitId; | |||
| 623 | unsigned long flags; | 611 | unsigned long flags; |
| 624 | rio_spin_lock_irqsave(&HostP->HostLock, flags); | 612 | rio_spin_lock_irqsave(&HostP->HostLock, flags); |
| 625 | 613 | ||
| 626 | #ifdef CHECK | ||
| 627 | CheckHostP(HostP); | ||
| 628 | CheckUnitId(UnitId); | ||
| 629 | #endif | ||
| 630 | if (RIOCheck(HostP, UnitId)) { | 614 | if (RIOCheck(HostP, UnitId)) { |
| 631 | rio_dprintk(RIO_DEBUG_ROUTE, "Unit %d is NOT isolated\n", UnitId); | 615 | rio_dprintk(RIO_DEBUG_ROUTE, "Unit %d is NOT isolated\n", UnitId); |
| 632 | rio_spin_unlock_irqrestore(&HostP->HostLock, flags); | 616 | rio_spin_unlock_irqrestore(&HostP->HostLock, flags); |
| @@ -651,10 +635,6 @@ uint UnitId; | |||
| 651 | { | 635 | { |
| 652 | uint link, unit; | 636 | uint link, unit; |
| 653 | 637 | ||
| 654 | #ifdef CHECK | ||
| 655 | CheckHostP(HostP); | ||
| 656 | CheckUnitId(UnitId); | ||
| 657 | #endif | ||
| 658 | UnitId--; /* this trick relies on the Unit Id being UNSIGNED! */ | 638 | UnitId--; /* this trick relies on the Unit Id being UNSIGNED! */ |
| 659 | 639 | ||
| 660 | if (UnitId >= MAX_RUP) /* dontcha just lurv unsigned maths! */ | 640 | if (UnitId >= MAX_RUP) /* dontcha just lurv unsigned maths! */ |
| @@ -684,10 +664,6 @@ uint UnitId; | |||
| 684 | { | 664 | { |
| 685 | unsigned char link; | 665 | unsigned char link; |
| 686 | 666 | ||
| 687 | #ifdef CHECK | ||
| 688 | CheckHostP(HostP); | ||
| 689 | CheckUnitId(UnitId); | ||
| 690 | #endif | ||
| 691 | /* rio_dprint(RIO_DEBUG_ROUTE, ("Check to see if unit %d has a route to the host\n",UnitId)); */ | 667 | /* rio_dprint(RIO_DEBUG_ROUTE, ("Check to see if unit %d has a route to the host\n",UnitId)); */ |
| 692 | rio_dprintk(RIO_DEBUG_ROUTE, "RIOCheck : UnitID = %d\n", UnitId); | 668 | rio_dprintk(RIO_DEBUG_ROUTE, "RIOCheck : UnitID = %d\n", UnitId); |
| 693 | 669 | ||
diff --git a/drivers/char/rio/riotable.c b/drivers/char/rio/riotable.c index 42c3dffcbbb2..a86b216ab653 100644 --- a/drivers/char/rio/riotable.c +++ b/drivers/char/rio/riotable.c | |||
| @@ -754,11 +754,6 @@ struct Map *HostMapP; | |||
| 754 | ushort RtaType; | 754 | ushort RtaType; |
| 755 | unsigned long flags; | 755 | unsigned long flags; |
| 756 | 756 | ||
| 757 | #ifdef CHECK | ||
| 758 | CheckHostP(HostP); | ||
| 759 | CheckHostMapP(HostMapP); | ||
| 760 | #endif | ||
| 761 | |||
| 762 | rio_dprintk(RIO_DEBUG_TABLE, "Mapping sysport %d to id %d\n", (int) HostMapP->SysPort, HostMapP->ID); | 757 | rio_dprintk(RIO_DEBUG_TABLE, "Mapping sysport %d to id %d\n", (int) HostMapP->SysPort, HostMapP->ID); |
| 763 | 758 | ||
| 764 | /* | 759 | /* |
| @@ -784,9 +779,6 @@ struct Map *HostMapP; | |||
| 784 | 779 | ||
| 785 | rio_dprintk(RIO_DEBUG_TABLE, "c1 p = %p, p->rioPortp = %p\n", p, p->RIOPortp); | 780 | rio_dprintk(RIO_DEBUG_TABLE, "c1 p = %p, p->rioPortp = %p\n", p, p->RIOPortp); |
| 786 | PortP = p->RIOPortp[SysPort]; | 781 | PortP = p->RIOPortp[SysPort]; |
| 787 | #if 0 | ||
| 788 | PortP->TtyP = &p->channel[SysPort]; | ||
| 789 | #endif | ||
| 790 | rio_dprintk(RIO_DEBUG_TABLE, "Map port\n"); | 782 | rio_dprintk(RIO_DEBUG_TABLE, "Map port\n"); |
| 791 | 783 | ||
| 792 | /* | 784 | /* |
diff --git a/drivers/char/rio/riotime.h b/drivers/char/rio/riotime.h deleted file mode 100644 index 35e01cd103d0..000000000000 --- a/drivers/char/rio/riotime.h +++ /dev/null | |||
| @@ -1,63 +0,0 @@ | |||
| 1 | /**************************************************************************** | ||
| 2 | ******* ******* | ||
| 3 | ******* T I M E | ||
| 4 | ******* ******* | ||
| 5 | **************************************************************************** | ||
| 6 | |||
| 7 | Author : Jeremy Rolls | ||
| 8 | Date : | ||
| 9 | |||
| 10 | * | ||
| 11 | * (C) 1990 - 2000 Specialix International Ltd., Byfleet, Surrey, UK. | ||
| 12 | * | ||
| 13 | |||
| 14 | * This program is free software; you can redistribute it and/or modify | ||
| 15 | * it under the terms of the GNU General Public License as published by | ||
| 16 | * the Free Software Foundation; either version 2 of the License, or | ||
| 17 | * (at your option) any later version. | ||
| 18 | * | ||
| 19 | * This program is distributed in the hope that it will be useful, | ||
| 20 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 21 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 22 | * GNU General Public License for more details. | ||
| 23 | * | ||
| 24 | * You should have received a copy of the GNU General Public License | ||
| 25 | * along with this program; if not, write to the Free Software | ||
| 26 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | ||
| 27 | |||
| 28 | Version : 0.01 | ||
| 29 | |||
| 30 | |||
| 31 | Mods | ||
| 32 | ---------------------------------------------------------------------------- | ||
| 33 | Date By Description | ||
| 34 | ---------------------------------------------------------------------------- | ||
| 35 | |||
| 36 | ***************************************************************************/ | ||
| 37 | |||
| 38 | #ifndef _riotime_h | ||
| 39 | #define _riotime_h 1 | ||
| 40 | |||
| 41 | #ifndef lint | ||
| 42 | #ifdef SCCS | ||
| 43 | static char *_rio_riotime_h_sccs = "@(#)riotime.h 1.1"; | ||
| 44 | #endif | ||
| 45 | #endif | ||
| 46 | |||
| 47 | #define TWO_POWER_FIFTEEN (ushort)32768 | ||
| 48 | #define RioTime() riotime | ||
| 49 | #define RioTimeAfter(time1,time2) ((ushort)time1 - (ushort)time2) < TWO_POWER_FIFTEEN | ||
| 50 | #define RioTimePlus(time1,time2) ((ushort)time1 + (ushort)time2) | ||
| 51 | |||
| 52 | /************************************** | ||
| 53 | * Convert a RIO tick (1/10th second) | ||
| 54 | * into transputer low priority ticks | ||
| 55 | *************************************/ | ||
| 56 | #define RioTimeToLow(time) (time*(100000 / 64)) | ||
| 57 | #define RioLowToTime(time) ((time*64)/100000) | ||
| 58 | |||
| 59 | #define RIOTENTHSECOND (ushort)1 | ||
| 60 | #define RIOSECOND (ushort)(RIOTENTHSECOND * 10) | ||
| 61 | #endif | ||
| 62 | |||
| 63 | /*********** end of file ***********/ | ||
diff --git a/drivers/char/rio/riotty.c b/drivers/char/rio/riotty.c index 5894a25b0113..6379816ed173 100644 --- a/drivers/char/rio/riotty.c +++ b/drivers/char/rio/riotty.c | |||
| @@ -89,16 +89,9 @@ static char *_riotty_c_sccs_ = "@(#)riotty.c 1.3"; | |||
| 89 | #include "list.h" | 89 | #include "list.h" |
| 90 | #include "sam.h" | 90 | #include "sam.h" |
| 91 | 91 | ||
| 92 | #if 0 | ||
| 93 | static void ttyseth_pv(struct Port *, struct ttystatics *, struct termios *sg, int); | ||
| 94 | #endif | ||
| 95 | |||
| 96 | static void RIOClearUp(struct Port *PortP); | 92 | static void RIOClearUp(struct Port *PortP); |
| 97 | int RIOShortCommand(struct rio_info *p, struct Port *PortP, int command, int len, int arg); | 93 | int RIOShortCommand(struct rio_info *p, struct Port *PortP, int command, int len, int arg); |
| 98 | 94 | ||
| 99 | #if 0 | ||
| 100 | static int RIOCookMode(struct ttystatics *); | ||
| 101 | #endif | ||
| 102 | 95 | ||
| 103 | extern int conv_vb[]; /* now defined in ttymgr.c */ | 96 | extern int conv_vb[]; /* now defined in ttymgr.c */ |
| 104 | extern int conv_bv[]; /* now defined in ttymgr.c */ | 97 | extern int conv_bv[]; /* now defined in ttymgr.c */ |
| @@ -226,33 +219,6 @@ int riotopen(struct tty_struct *tty, struct file *filp) | |||
| 226 | ** until the RTA is present then we must spin here waiting for | 219 | ** until the RTA is present then we must spin here waiting for |
| 227 | ** the RTA to boot. | 220 | ** the RTA to boot. |
| 228 | */ | 221 | */ |
| 229 | #if 0 | ||
| 230 | if (!(PortP->HostP->Mapping[PortP->RupNum].Flags & RTA_BOOTED)) { | ||
| 231 | if (PortP->WaitUntilBooted) { | ||
| 232 | rio_dprintk(RIO_DEBUG_TTY, "Waiting for RTA to boot\n"); | ||
| 233 | do { | ||
| 234 | if (RIODelay(PortP, HUNDRED_MS) == RIO_FAIL) { | ||
| 235 | rio_dprintk(RIO_DEBUG_TTY, "RTA EINTR in delay \n"); | ||
| 236 | func_exit(); | ||
| 237 | return -EINTR; | ||
| 238 | } | ||
| 239 | if (repeat_this-- <= 0) { | ||
| 240 | rio_dprintk(RIO_DEBUG_TTY, "Waiting for RTA to boot timeout\n"); | ||
| 241 | RIOPreemptiveCmd(p, PortP, FCLOSE); | ||
| 242 | pseterr(EINTR); | ||
| 243 | func_exit(); | ||
| 244 | return -EIO; | ||
| 245 | } | ||
| 246 | } while (!(PortP->HostP->Mapping[PortP->RupNum].Flags & RTA_BOOTED)); | ||
| 247 | rio_dprintk(RIO_DEBUG_TTY, "RTA has been booted\n"); | ||
| 248 | } else { | ||
| 249 | rio_dprintk(RIO_DEBUG_TTY, "RTA never booted\n"); | ||
| 250 | pseterr(ENXIO); | ||
| 251 | func_exit(); | ||
| 252 | return 0; | ||
| 253 | } | ||
| 254 | } | ||
| 255 | #else | ||
| 256 | /* I find the above code a bit hairy. I find the below code | 222 | /* I find the above code a bit hairy. I find the below code |
| 257 | easier to read and shorter. Now, if it works too that would | 223 | easier to read and shorter. Now, if it works too that would |
| 258 | be great... -- REW | 224 | be great... -- REW |
| @@ -281,21 +247,10 @@ int riotopen(struct tty_struct *tty, struct file *filp) | |||
| 281 | } | 247 | } |
| 282 | } | 248 | } |
| 283 | rio_dprintk(RIO_DEBUG_TTY, "RTA has been booted\n"); | 249 | rio_dprintk(RIO_DEBUG_TTY, "RTA has been booted\n"); |
| 284 | #endif | ||
| 285 | #if 0 | ||
| 286 | tp = PortP->TtyP; /* get tty struct */ | ||
| 287 | #endif | ||
| 288 | rio_spin_lock_irqsave(&PortP->portSem, flags); | 250 | rio_spin_lock_irqsave(&PortP->portSem, flags); |
| 289 | if (p->RIOHalted) { | 251 | if (p->RIOHalted) { |
| 290 | goto bombout; | 252 | goto bombout; |
| 291 | } | 253 | } |
| 292 | #if 0 | ||
| 293 | retval = gs_init_port(&PortP->gs); | ||
| 294 | if (retval) { | ||
| 295 | func_exit(); | ||
| 296 | return retval; | ||
| 297 | } | ||
| 298 | #endif | ||
| 299 | 254 | ||
| 300 | /* | 255 | /* |
| 301 | ** If the port is in the final throws of being closed, | 256 | ** If the port is in the final throws of being closed, |
| @@ -363,11 +318,6 @@ int riotopen(struct tty_struct *tty, struct file *filp) | |||
| 363 | command piggybacks the parameters immediately. | 318 | command piggybacks the parameters immediately. |
| 364 | -- REW */ | 319 | -- REW */ |
| 365 | RIOParam(PortP, OPEN, Modem, OK_TO_SLEEP); /* Open the port */ | 320 | RIOParam(PortP, OPEN, Modem, OK_TO_SLEEP); /* Open the port */ |
| 366 | #if 0 | ||
| 367 | /* This delay of 1 second was annoying. I removed it. -- REW */ | ||
| 368 | RIODelay(PortP, HUNDRED_MS * 10); | ||
| 369 | RIOParam(PortP, CONFIG, Modem, OK_TO_SLEEP); /* Config the port */ | ||
| 370 | #endif | ||
| 371 | rio_spin_lock_irqsave(&PortP->portSem, flags); | 321 | rio_spin_lock_irqsave(&PortP->portSem, flags); |
| 372 | 322 | ||
| 373 | /* | 323 | /* |
| @@ -439,9 +389,6 @@ int riotopen(struct tty_struct *tty, struct file *filp) | |||
| 439 | PortP->State |= RIO_WOPEN; | 389 | PortP->State |= RIO_WOPEN; |
| 440 | rio_spin_unlock_irqrestore(&PortP->portSem, flags); | 390 | rio_spin_unlock_irqrestore(&PortP->portSem, flags); |
| 441 | if (RIODelay(PortP, HUNDRED_MS) == RIO_FAIL) | 391 | if (RIODelay(PortP, HUNDRED_MS) == RIO_FAIL) |
| 442 | #if 0 | ||
| 443 | if (sleep((caddr_t) & tp->tm.c_canqo, TTIPRI | PCATCH)) | ||
| 444 | #endif | ||
| 445 | { | 392 | { |
| 446 | /* | 393 | /* |
| 447 | ** ACTION: verify that this is a good thing | 394 | ** ACTION: verify that this is a good thing |
| @@ -505,10 +452,6 @@ int riotopen(struct tty_struct *tty, struct file *filp) | |||
| 505 | */ | 452 | */ |
| 506 | int riotclose(void *ptr) | 453 | int riotclose(void *ptr) |
| 507 | { | 454 | { |
| 508 | #if 0 | ||
| 509 | register uint SysPort = dev; | ||
| 510 | struct ttystatics *tp; /* pointer to our ttystruct */ | ||
| 511 | #endif | ||
| 512 | struct Port *PortP = ptr; /* pointer to the port structure */ | 455 | struct Port *PortP = ptr; /* pointer to the port structure */ |
| 513 | int deleted = 0; | 456 | int deleted = 0; |
| 514 | int try = -1; /* Disable the timeouts by setting them to -1 */ | 457 | int try = -1; /* Disable the timeouts by setting them to -1 */ |
| @@ -534,13 +477,6 @@ int riotclose(void *ptr) | |||
| 534 | end_time = jiffies + MAX_SCHEDULE_TIMEOUT; | 477 | end_time = jiffies + MAX_SCHEDULE_TIMEOUT; |
| 535 | 478 | ||
| 536 | Modem = rio_ismodem(tty); | 479 | Modem = rio_ismodem(tty); |
| 537 | #if 0 | ||
| 538 | /* What F.CKING cache? Even then, a higly idle multiprocessor, | ||
| 539 | system with large caches this won't work . Better find out when | ||
| 540 | this doesn't work asap, and fix the cause. -- REW */ | ||
| 541 | |||
| 542 | RIODelay(PortP, HUNDRED_MS * 10); /* To flush the cache */ | ||
| 543 | #endif | ||
| 544 | rio_spin_lock_irqsave(&PortP->portSem, flags); | 480 | rio_spin_lock_irqsave(&PortP->portSem, flags); |
| 545 | 481 | ||
| 546 | /* | 482 | /* |
| @@ -703,45 +639,6 @@ int riotclose(void *ptr) | |||
| 703 | } | 639 | } |
| 704 | 640 | ||
| 705 | 641 | ||
| 706 | /* | ||
| 707 | ** decide if we need to use the line discipline. | ||
| 708 | ** This routine can return one of three values: | ||
| 709 | ** COOK_RAW if no processing has to be done by the line discipline or the card | ||
| 710 | ** COOK_WELL if the line discipline must be used to do the processing | ||
| 711 | ** COOK_MEDIUM if the card can do all the processing necessary. | ||
| 712 | */ | ||
| 713 | #if 0 | ||
| 714 | static int RIOCookMode(struct ttystatics *tp) | ||
| 715 | { | ||
| 716 | /* | ||
| 717 | ** We can't handle tm.c_mstate != 0 on SCO | ||
| 718 | ** We can't handle mapping | ||
| 719 | ** We can't handle non-ttwrite line disc. | ||
| 720 | ** We can't handle lflag XCASE | ||
| 721 | ** We can handle oflag OPOST & (OCRNL, ONLCR, TAB3) | ||
| 722 | */ | ||
| 723 | |||
| 724 | #ifdef CHECK | ||
| 725 | CheckTtyP(tp); | ||
| 726 | #endif | ||
| 727 | if (!(tp->tm.c_oflag & OPOST)) /* No post processing */ | ||
| 728 | return COOK_RAW; /* Raw mode o/p */ | ||
| 729 | |||
| 730 | if (tp->tm.c_lflag & XCASE) | ||
| 731 | return COOK_WELL; /* Use line disc */ | ||
| 732 | |||
| 733 | if (tp->tm.c_oflag & ~(OPOST | ONLCR | OCRNL | TAB3)) | ||
| 734 | return COOK_WELL; /* Use line disc for strange modes */ | ||
| 735 | |||
| 736 | if (tp->tm.c_oflag == OPOST) /* If only OPOST is set, do RAW */ | ||
| 737 | return COOK_RAW; | ||
| 738 | |||
| 739 | /* | ||
| 740 | ** So, we need to output process! | ||
| 741 | */ | ||
| 742 | return COOK_MEDIUM; | ||
| 743 | } | ||
| 744 | #endif | ||
| 745 | 642 | ||
| 746 | static void RIOClearUp(PortP) | 643 | static void RIOClearUp(PortP) |
| 747 | struct Port *PortP; | 644 | struct Port *PortP; |
| @@ -776,11 +673,6 @@ int RIOShortCommand(struct rio_info *p, struct Port *PortP, int command, int len | |||
| 776 | unsigned long flags; | 673 | unsigned long flags; |
| 777 | 674 | ||
| 778 | rio_dprintk(RIO_DEBUG_TTY, "entering shortcommand.\n"); | 675 | rio_dprintk(RIO_DEBUG_TTY, "entering shortcommand.\n"); |
| 779 | #ifdef CHECK | ||
| 780 | CheckPortP(PortP); | ||
| 781 | if (len < 1 || len > 2) | ||
| 782 | cprintf(("STUPID LENGTH %d\n", len)); | ||
| 783 | #endif | ||
| 784 | 676 | ||
| 785 | if (PortP->State & RIO_DELETED) { | 677 | if (PortP->State & RIO_DELETED) { |
| 786 | rio_dprintk(RIO_DEBUG_TTY, "Short command to deleted RTA ignored\n"); | 678 | rio_dprintk(RIO_DEBUG_TTY, "Short command to deleted RTA ignored\n"); |
| @@ -852,478 +744,3 @@ int RIOShortCommand(struct rio_info *p, struct Port *PortP, int command, int len | |||
| 852 | } | 744 | } |
| 853 | 745 | ||
| 854 | 746 | ||
| 855 | #if 0 | ||
| 856 | /* | ||
| 857 | ** This is an ioctl interface. This is the twentieth century. You know what | ||
| 858 | ** its all about. | ||
| 859 | */ | ||
| 860 | int riotioctl(struct rio_info *p, struct tty_struct *tty, int cmd, caddr_t arg) | ||
| 861 | { | ||
| 862 | register struct Port *PortP; | ||
| 863 | register struct ttystatics *tp; | ||
| 864 | int current; | ||
| 865 | int ParamSemIncremented = 0; | ||
| 866 | int old_oflag, old_cflag, old_iflag, changed, oldcook; | ||
| 867 | int i; | ||
| 868 | unsigned char sio_regs[5]; /* Here be magic */ | ||
| 869 | short vpix_cflag; | ||
| 870 | short divisor; | ||
| 871 | int baud; | ||
| 872 | uint SysPort = rio_minor(tty); | ||
| 873 | int Modem = rio_ismodem(tty); | ||
| 874 | int ioctl_processed; | ||
| 875 | |||
| 876 | rio_dprintk(RIO_DEBUG_TTY, "port ioctl SysPort %d command 0x%x argument 0x%x %s\n", SysPort, cmd, arg, Modem ? "Modem" : "tty"); | ||
| 877 | |||
| 878 | if (SysPort >= RIO_PORTS) { | ||
| 879 | rio_dprintk(RIO_DEBUG_TTY, "Bad port number %d\n", SysPort); | ||
| 880 | return -ENXIO; | ||
| 881 | } | ||
| 882 | |||
| 883 | PortP = p->RIOPortp[SysPort]; | ||
| 884 | tp = PortP->TtyP; | ||
| 885 | |||
| 886 | rio_spin_lock_irqsave(&PortP->portSem, flags); | ||
| 887 | |||
| 888 | #ifdef STATS | ||
| 889 | PortP->Stat.IoctlCnt++; | ||
| 890 | #endif | ||
| 891 | |||
| 892 | if (PortP->State & RIO_DELETED) { | ||
| 893 | rio_spin_unlock_irqrestore(&PortP->portSem, flags); | ||
| 894 | return -EIO; | ||
| 895 | } | ||
| 896 | |||
| 897 | |||
| 898 | if (p->RIOHalted) { | ||
| 899 | RIOClearUp(PortP); | ||
| 900 | rio_spin_unlock_irqrestore(&PortP->portSem, flags); | ||
| 901 | return -EIO; | ||
| 902 | } | ||
| 903 | |||
| 904 | /* | ||
| 905 | ** Count ioctls for port statistics reporting | ||
| 906 | */ | ||
| 907 | if (PortP->statsGather) | ||
| 908 | PortP->ioctls++; | ||
| 909 | |||
| 910 | /* | ||
| 911 | ** Specialix RIO Ioctl calls | ||
| 912 | */ | ||
| 913 | switch (cmd) { | ||
| 914 | |||
| 915 | case TCRIOTRIAD: | ||
| 916 | if (arg) | ||
| 917 | PortP->State |= RIO_TRIAD_MODE; | ||
| 918 | else | ||
| 919 | PortP->State &= ~RIO_TRIAD_MODE; | ||
| 920 | /* | ||
| 921 | ** Normally, when istrip is set on a port, a config is | ||
| 922 | ** sent to the RTA instructing the CD1400 to do the | ||
| 923 | ** stripping. In TRIAD mode, the interrupt receive routine | ||
| 924 | ** must do the stripping instead, since it has to detect | ||
| 925 | ** an 8 bit function key sequence. If istrip is set with | ||
| 926 | ** TRIAD mode on(off), and 8 bit data is being read by | ||
| 927 | ** the port, the user then turns TRIAD mode off(on), the RTA | ||
| 928 | ** must be reconfigured (not) to do the stripping. | ||
| 929 | ** Hence we call RIOParam here. | ||
| 930 | */ | ||
| 931 | rio_spin_unlock_irqrestore(&PortP->portSem, flags); | ||
| 932 | RIOParam(PortP, CONFIG, Modem, OK_TO_SLEEP); | ||
| 933 | return 0; | ||
| 934 | |||
| 935 | case TCRIOTSTATE: | ||
| 936 | rio_dprintk(RIO_DEBUG_TTY, "tbusy/tstop monitoring %sabled\n", arg ? "en" : "dis"); | ||
| 937 | /* MonitorTstate = 0 ; */ | ||
| 938 | rio_spin_unlock_irqrestore(&PortP->portSem, flags); | ||
| 939 | RIOParam(PortP, CONFIG, Modem, OK_TO_SLEEP); | ||
| 940 | return 0; | ||
| 941 | |||
| 942 | case TCRIOSTATE: /* current state of Modem input pins */ | ||
| 943 | rio_dprintk(RIO_DEBUG_TTY, "TCRIOSTATE\n"); | ||
| 944 | if (RIOPreemptiveCmd(p, PortP, MGET) == RIO_FAIL) | ||
| 945 | rio_dprintk(RIO_DEBUG_TTY, "TCRIOSTATE command failed\n"); | ||
| 946 | PortP->State |= RIO_BUSY; | ||
| 947 | current = PortP->ModemState; | ||
| 948 | if (copyout((caddr_t) & current, (int) arg, sizeof(current)) == COPYFAIL) { | ||
| 949 | rio_dprintk(RIO_DEBUG_TTY, "Copyout failed\n"); | ||
| 950 | rio_spin_unlock_irqrestore(&PortP->portSem, flags); | ||
| 951 | pseterr(EFAULT); | ||
| 952 | } | ||
| 953 | rio_spin_unlock_irqrestore(&PortP->portSem, flags); | ||
| 954 | return 0; | ||
| 955 | |||
| 956 | case TCRIOMBIS: /* Set modem lines */ | ||
| 957 | case TCRIOMBIC: /* Clear modem lines */ | ||
| 958 | rio_dprintk(RIO_DEBUG_TTY, "TCRIOMBIS/TCRIOMBIC\n"); | ||
| 959 | if (cmd == TCRIOMBIS) { | ||
| 960 | uint state; | ||
| 961 | state = (uint) arg; | ||
| 962 | PortP->ModemState |= (ushort) state; | ||
| 963 | PortP->ModemLines = (ulong) arg; | ||
| 964 | if (RIOPreemptiveCmd(p, PortP, MBIS) == RIO_FAIL) | ||
| 965 | rio_dprintk(RIO_DEBUG_TTY, "TCRIOMBIS command failed\n"); | ||
| 966 | } else { | ||
| 967 | uint state; | ||
| 968 | |||
| 969 | state = (uint) arg; | ||
| 970 | PortP->ModemState &= ~(ushort) state; | ||
| 971 | PortP->ModemLines = (ulong) arg; | ||
| 972 | if (RIOPreemptiveCmd(p, PortP, MBIC) == RIO_FAIL) | ||
| 973 | rio_dprintk(RIO_DEBUG_TTY, "TCRIOMBIC command failed\n"); | ||
| 974 | } | ||
| 975 | PortP->State |= RIO_BUSY; | ||
| 976 | rio_spin_unlock_irqrestore(&PortP->portSem, flags); | ||
| 977 | return 0; | ||
| 978 | |||
| 979 | case TCRIOXPON: /* set Xprint ON string */ | ||
| 980 | rio_dprintk(RIO_DEBUG_TTY, "TCRIOXPON\n"); | ||
| 981 | if (copyin((int) arg, (caddr_t) PortP->Xprint.XpOn, MAX_XP_CTRL_LEN) == COPYFAIL) { | ||
| 982 | rio_dprintk(RIO_DEBUG_TTY, "Copyin failed\n"); | ||
| 983 | PortP->Xprint.XpOn[0] = '\0'; | ||
| 984 | rio_spin_unlock_irqrestore(&PortP->portSem, flags); | ||
| 985 | pseterr(EFAULT); | ||
| 986 | } | ||
| 987 | PortP->Xprint.XpOn[MAX_XP_CTRL_LEN - 1] = '\0'; | ||
| 988 | PortP->Xprint.XpLen = strlen(PortP->Xprint.XpOn) + strlen(PortP->Xprint.XpOff); | ||
| 989 | rio_spin_unlock_irqrestore(&PortP->portSem, flags); | ||
| 990 | return 0; | ||
| 991 | |||
| 992 | case TCRIOXPOFF: /* set Xprint OFF string */ | ||
| 993 | rio_dprintk(RIO_DEBUG_TTY, "TCRIOXPOFF\n"); | ||
| 994 | if (copyin((int) arg, (caddr_t) PortP->Xprint.XpOff, MAX_XP_CTRL_LEN) == COPYFAIL) { | ||
| 995 | rio_dprintk(RIO_DEBUG_TTY, "Copyin failed\n"); | ||
| 996 | PortP->Xprint.XpOff[0] = '\0'; | ||
| 997 | rio_spin_unlock_irqrestore(&PortP->portSem, flags); | ||
| 998 | pseterr(EFAULT); | ||
| 999 | } | ||
| 1000 | PortP->Xprint.XpOff[MAX_XP_CTRL_LEN - 1] = '\0'; | ||
| 1001 | PortP->Xprint.XpLen = strlen(PortP->Xprint.XpOn) + strlen(PortP->Xprint.XpOff); | ||
| 1002 | rio_spin_unlock_irqrestore(&PortP->portSem, flags); | ||
| 1003 | return 0; | ||
| 1004 | |||
| 1005 | case TCRIOXPCPS: /* set Xprint CPS string */ | ||
| 1006 | rio_dprintk(RIO_DEBUG_TTY, "TCRIOXPCPS\n"); | ||
| 1007 | if ((uint) arg > p->RIOConf.MaxXpCps || (uint) arg < p->RIOConf.MinXpCps) { | ||
| 1008 | rio_dprintk(RIO_DEBUG_TTY, "%d CPS out of range\n", arg); | ||
| 1009 | rio_spin_unlock_irqrestore(&PortP->portSem, flags); | ||
| 1010 | pseterr(EINVAL); | ||
| 1011 | return 0; | ||
| 1012 | } | ||
| 1013 | PortP->Xprint.XpCps = (uint) arg; | ||
| 1014 | rio_spin_unlock_irqrestore(&PortP->portSem, flags); | ||
| 1015 | return 0; | ||
| 1016 | |||
| 1017 | case TCRIOXPRINT: | ||
| 1018 | rio_dprintk(RIO_DEBUG_TTY, "TCRIOXPRINT\n"); | ||
| 1019 | if (copyout((caddr_t) & PortP->Xprint, (int) arg, sizeof(struct Xprint)) == COPYFAIL) { | ||
| 1020 | rio_spin_unlock_irqrestore(&PortP->portSem, flags); | ||
| 1021 | pseterr(EFAULT); | ||
| 1022 | } | ||
| 1023 | rio_spin_unlock_irqrestore(&PortP->portSem, flags); | ||
| 1024 | return 0; | ||
| 1025 | |||
| 1026 | case TCRIOIXANYON: | ||
| 1027 | rio_dprintk(RIO_DEBUG_TTY, "TCRIOIXANYON\n"); | ||
| 1028 | PortP->Config |= RIO_IXANY; | ||
| 1029 | rio_spin_unlock_irqrestore(&PortP->portSem, flags); | ||
| 1030 | return 0; | ||
| 1031 | |||
| 1032 | case TCRIOIXANYOFF: | ||
| 1033 | rio_dprintk(RIO_DEBUG_TTY, "TCRIOIXANYOFF\n"); | ||
| 1034 | PortP->Config &= ~RIO_IXANY; | ||
| 1035 | rio_spin_unlock_irqrestore(&PortP->portSem, flags); | ||
| 1036 | return 0; | ||
| 1037 | |||
| 1038 | case TCRIOIXONON: | ||
| 1039 | rio_dprintk(RIO_DEBUG_TTY, "TCRIOIXONON\n"); | ||
| 1040 | PortP->Config |= RIO_IXON; | ||
| 1041 | rio_spin_unlock_irqrestore(&PortP->portSem, flags); | ||
| 1042 | return 0; | ||
| 1043 | |||
| 1044 | case TCRIOIXONOFF: | ||
| 1045 | rio_dprintk(RIO_DEBUG_TTY, "TCRIOIXONOFF\n"); | ||
| 1046 | PortP->Config &= ~RIO_IXON; | ||
| 1047 | rio_spin_unlock_irqrestore(&PortP->portSem, flags); | ||
| 1048 | return 0; | ||
| 1049 | |||
| 1050 | /* | ||
| 1051 | ** 15.10.1998 ARG - ESIL 0761 part fix | ||
| 1052 | ** Added support for CTS and RTS flow control ioctls : | ||
| 1053 | */ | ||
| 1054 | case TCRIOCTSFLOWEN: | ||
| 1055 | rio_dprintk(RIO_DEBUG_TTY, "TCRIOCTSFLOWEN\n"); | ||
| 1056 | PortP->Config |= RIO_CTSFLOW; | ||
| 1057 | rio_spin_unlock_irqrestore(&PortP->portSem, flags); | ||
| 1058 | RIOParam(PortP, CONFIG, Modem, OK_TO_SLEEP); | ||
| 1059 | return 0; | ||
| 1060 | |||
| 1061 | case TCRIOCTSFLOWDIS: | ||
| 1062 | rio_dprintk(RIO_DEBUG_TTY, "TCRIOCTSFLOWDIS\n"); | ||
| 1063 | PortP->Config &= ~RIO_CTSFLOW; | ||
| 1064 | rio_spin_unlock_irqrestore(&PortP->portSem, flags); | ||
| 1065 | RIOParam(PortP, CONFIG, Modem, OK_TO_SLEEP); | ||
| 1066 | return 0; | ||
| 1067 | |||
| 1068 | case TCRIORTSFLOWEN: | ||
| 1069 | rio_dprintk(RIO_DEBUG_TTY, "TCRIORTSFLOWEN\n"); | ||
| 1070 | PortP->Config |= RIO_RTSFLOW; | ||
| 1071 | rio_spin_unlock_irqrestore(&PortP->portSem, flags); | ||
| 1072 | RIOParam(PortP, CONFIG, Modem, OK_TO_SLEEP); | ||
| 1073 | return 0; | ||
| 1074 | |||
| 1075 | case TCRIORTSFLOWDIS: | ||
| 1076 | rio_dprintk(RIO_DEBUG_TTY, "TCRIORTSFLOWDIS\n"); | ||
| 1077 | PortP->Config &= ~RIO_RTSFLOW; | ||
| 1078 | rio_spin_unlock_irqrestore(&PortP->portSem, flags); | ||
| 1079 | RIOParam(PortP, CONFIG, Modem, OK_TO_SLEEP); | ||
| 1080 | return 0; | ||
| 1081 | |||
| 1082 | /* end ESIL 0761 part fix */ | ||
| 1083 | |||
| 1084 | } | ||
| 1085 | |||
| 1086 | |||
| 1087 | /* Lynx IOCTLS */ | ||
| 1088 | switch (cmd) { | ||
| 1089 | case TIOCSETP: | ||
| 1090 | case TIOCSETN: | ||
| 1091 | case OTIOCSETP: | ||
| 1092 | case OTIOCSETN: | ||
| 1093 | ioctl_processed++; | ||
| 1094 | ttyseth(PortP, tp, (struct old_sgttyb *) arg); | ||
| 1095 | break; | ||
| 1096 | case TCSETA: | ||
| 1097 | case TCSETAW: | ||
| 1098 | case TCSETAF: | ||
| 1099 | ioctl_processed++; | ||
| 1100 | rio_dprintk(RIO_DEBUG_TTY, "NON POSIX ioctl\n"); | ||
| 1101 | ttyseth_pv(PortP, tp, (struct termios *) arg, 0); | ||
| 1102 | break; | ||
| 1103 | case TCSETAP: /* posix tcsetattr() */ | ||
| 1104 | case TCSETAWP: /* posix tcsetattr() */ | ||
| 1105 | case TCSETAFP: /* posix tcsetattr() */ | ||
| 1106 | rio_dprintk(RIO_DEBUG_TTY, "NON POSIX SYSV ioctl\n"); | ||
| 1107 | ttyseth_pv(PortP, tp, (struct termios *) arg, 1); | ||
| 1108 | ioctl_processed++; | ||
| 1109 | break; | ||
| 1110 | } | ||
| 1111 | |||
| 1112 | /* | ||
| 1113 | ** If its any of the commands that require the port to be in the | ||
| 1114 | ** non-busy state wait until all output has drained | ||
| 1115 | */ | ||
| 1116 | if (!ioctl_processed) | ||
| 1117 | switch (cmd) { | ||
| 1118 | case TCSETAW: | ||
| 1119 | case TCSETAF: | ||
| 1120 | case TCSETA: | ||
| 1121 | case TCSBRK: | ||
| 1122 | #define OLD_POSIX ('x' << 8) | ||
| 1123 | #define OLD_POSIX_SETA (OLD_POSIX | 2) | ||
| 1124 | #define OLD_POSIX_SETAW (OLD_POSIX | 3) | ||
| 1125 | #define OLD_POSIX_SETAF (OLD_POSIX | 4) | ||
| 1126 | #define NEW_POSIX (('i' << 24) | ('X' << 16)) | ||
| 1127 | #define NEW_POSIX_SETA (NEW_POSIX | 2) | ||
| 1128 | #define NEW_POSIX_SETAW (NEW_POSIX | 3) | ||
| 1129 | #define NEW_POSIX_SETAF (NEW_POSIX | 4) | ||
| 1130 | case OLD_POSIX_SETA: | ||
| 1131 | case OLD_POSIX_SETAW: | ||
| 1132 | case OLD_POSIX_SETAF: | ||
| 1133 | case NEW_POSIX_SETA: | ||
| 1134 | case NEW_POSIX_SETAW: | ||
| 1135 | case NEW_POSIX_SETAF: | ||
| 1136 | #ifdef TIOCSETP | ||
| 1137 | case TIOCSETP: | ||
| 1138 | #endif | ||
| 1139 | case TIOCSETD: | ||
| 1140 | case TIOCSETN: | ||
| 1141 | rio_dprintk(RIO_DEBUG_TTY, "wait for non-BUSY, semaphore set\n"); | ||
| 1142 | /* | ||
| 1143 | ** Wait for drain here, at least as far as the double buffer | ||
| 1144 | ** being empty. | ||
| 1145 | */ | ||
| 1146 | /* XXX Does the above comment mean that this has | ||
| 1147 | still to be implemented? -- REW */ | ||
| 1148 | /* XXX Is the locking OK together with locking | ||
| 1149 | in txenable? (Deadlock?) -- REW */ | ||
| 1150 | |||
| 1151 | RIOTxEnable((char *) PortP); | ||
| 1152 | break; | ||
| 1153 | default: | ||
| 1154 | break; | ||
| 1155 | } | ||
| 1156 | |||
| 1157 | old_cflag = tp->tm.c_cflag; | ||
| 1158 | old_iflag = tp->tm.c_iflag; | ||
| 1159 | old_oflag = tp->tm.c_oflag; | ||
| 1160 | oldcook = PortP->CookMode; | ||
| 1161 | |||
| 1162 | if (p->RIOHalted) { | ||
| 1163 | RIOClearUp(PortP); | ||
| 1164 | rio_spin_unlock_irqrestore(&PortP->portSem, flags); | ||
| 1165 | pseterr(EIO); | ||
| 1166 | return 0; | ||
| 1167 | } | ||
| 1168 | |||
| 1169 | PortP->FlushCmdBodge = 0; | ||
| 1170 | |||
| 1171 | /* | ||
| 1172 | ** If the port is locked, and it is reconfigured, we want | ||
| 1173 | ** to restore the state of the tty structure so the change is NOT | ||
| 1174 | ** made. | ||
| 1175 | */ | ||
| 1176 | if (PortP->Lock) { | ||
| 1177 | tp->tm.c_iflag = PortP->StoredTty.iflag; | ||
| 1178 | tp->tm.c_oflag = PortP->StoredTty.oflag; | ||
| 1179 | tp->tm.c_cflag = PortP->StoredTty.cflag; | ||
| 1180 | tp->tm.c_lflag = PortP->StoredTty.lflag; | ||
| 1181 | tp->tm.c_line = PortP->StoredTty.line; | ||
| 1182 | for (i = 0; i < NCC + 1; i++) | ||
| 1183 | tp->tm.c_cc[i] = PortP->StoredTty.cc[i]; | ||
| 1184 | } else { | ||
| 1185 | /* | ||
| 1186 | ** If the port is set to store the parameters, and it is | ||
| 1187 | ** reconfigured, we want to save the current tty struct so it | ||
| 1188 | ** may be restored on the next open. | ||
| 1189 | */ | ||
| 1190 | if (PortP->Store) { | ||
| 1191 | PortP->StoredTty.iflag = tp->tm.c_iflag; | ||
| 1192 | PortP->StoredTty.oflag = tp->tm.c_oflag; | ||
| 1193 | PortP->StoredTty.cflag = tp->tm.c_cflag; | ||
| 1194 | PortP->StoredTty.lflag = tp->tm.c_lflag; | ||
| 1195 | PortP->StoredTty.line = tp->tm.c_line; | ||
| 1196 | for (i = 0; i < NCC + 1; i++) | ||
| 1197 | PortP->StoredTty.cc[i] = tp->tm.c_cc[i]; | ||
| 1198 | } | ||
| 1199 | } | ||
| 1200 | |||
| 1201 | changed = (tp->tm.c_cflag != old_cflag) || (tp->tm.c_iflag != old_iflag) || (tp->tm.c_oflag != old_oflag); | ||
| 1202 | |||
| 1203 | PortP->CookMode = RIOCookMode(tp); /* Set new cooking mode */ | ||
| 1204 | |||
| 1205 | rio_dprintk(RIO_DEBUG_TTY, "RIOIoctl changed %d newcook %d oldcook %d\n", changed, PortP->CookMode, oldcook); | ||
| 1206 | |||
| 1207 | #ifdef MODEM_SUPPORT | ||
| 1208 | /* | ||
| 1209 | ** kludge to force CARR_ON if CLOCAL set | ||
| 1210 | */ | ||
| 1211 | if ((tp->tm.c_cflag & CLOCAL) || (PortP->ModemState & MSVR1_CD)) { | ||
| 1212 | tp->tm.c_state |= CARR_ON; | ||
| 1213 | wakeup((caddr_t) & tp->tm.c_canq); | ||
| 1214 | } | ||
| 1215 | #endif | ||
| 1216 | |||
| 1217 | if (p->RIOHalted) { | ||
| 1218 | RIOClearUp(PortP); | ||
| 1219 | rio_spin_unlock_irqrestore(&PortP->portSem, flags); | ||
| 1220 | pseterr(EIO); | ||
| 1221 | return 0; | ||
| 1222 | } | ||
| 1223 | /* | ||
| 1224 | ** Re-configure if modes or cooking have changed | ||
| 1225 | */ | ||
| 1226 | if (changed || oldcook != PortP->CookMode || (ioctl_processed)) { | ||
| 1227 | rio_spin_unlock_irqrestore(&PortP->portSem, flags); | ||
| 1228 | rio_dprintk(RIO_DEBUG_TTY, "Ioctl changing the PORT settings\n"); | ||
| 1229 | RIOParam(PortP, CONFIG, Modem, OK_TO_SLEEP); | ||
| 1230 | rio_spin_lock_irqsave(&PortP->portSem, flags); | ||
| 1231 | } | ||
| 1232 | |||
| 1233 | if (p->RIOHalted) { | ||
| 1234 | rio_spin_unlock_irqrestore(&PortP->portSem, flags); | ||
| 1235 | RIOClearUp(PortP); | ||
| 1236 | pseterr(EIO); | ||
| 1237 | return 0; | ||
| 1238 | } | ||
| 1239 | rio_spin_unlock_irqrestore(&PortP->portSem, flags); | ||
| 1240 | return 0; | ||
| 1241 | } | ||
| 1242 | |||
| 1243 | /* | ||
| 1244 | ttyseth -- set hardware dependent tty settings | ||
| 1245 | */ | ||
| 1246 | void ttyseth(PortP, s, sg) | ||
| 1247 | struct Port *PortP; | ||
| 1248 | struct ttystatics *s; | ||
| 1249 | struct old_sgttyb *sg; | ||
| 1250 | { | ||
| 1251 | struct old_sgttyb *tsg; | ||
| 1252 | struct termios *tp = &s->tm; | ||
| 1253 | |||
| 1254 | tsg = &s->sg; | ||
| 1255 | |||
| 1256 | if (sg->sg_flags & (EVENP | ODDP)) { | ||
| 1257 | tp->c_cflag &= PARENB; | ||
| 1258 | if (sg->sg_flags & EVENP) { | ||
| 1259 | if (sg->sg_flags & ODDP) { | ||
| 1260 | tp->c_cflag &= V_CS7; | ||
| 1261 | tp->c_cflag &= ~PARENB; | ||
| 1262 | } else { | ||
| 1263 | tp->c_cflag &= V_CS7; | ||
| 1264 | tp->c_cflag &= PARENB; | ||
| 1265 | tp->c_cflag &= PARODD; | ||
| 1266 | } | ||
| 1267 | } else if (sg->sg_flags & ODDP) { | ||
| 1268 | tp->c_cflag &= V_CS7; | ||
| 1269 | tp->c_cflag &= PARENB; | ||
| 1270 | tp->c_cflag &= PARODD; | ||
| 1271 | } else { | ||
| 1272 | tp->c_cflag &= V_CS7; | ||
| 1273 | tp->c_cflag &= PARENB; | ||
| 1274 | } | ||
| 1275 | } | ||
| 1276 | /* | ||
| 1277 | * Use ispeed as the desired speed. Most implementations don't handle | ||
| 1278 | * separate input and output speeds very well. If the RIO handles this, | ||
| 1279 | * I will have to use separate sets of flags to store them in the | ||
| 1280 | * Port structure. | ||
| 1281 | */ | ||
| 1282 | if (!sg->sg_ospeed) | ||
| 1283 | sg->sg_ospeed = sg->sg_ispeed; | ||
| 1284 | else | ||
| 1285 | sg->sg_ispeed = sg->sg_ospeed; | ||
| 1286 | if (sg->sg_ispeed > V_EXTB) | ||
| 1287 | sg->sg_ispeed = V_EXTB; | ||
| 1288 | if (sg->sg_ispeed < V_B0) | ||
| 1289 | sg->sg_ispeed = V_B0; | ||
| 1290 | *tsg = *sg; | ||
| 1291 | tp->c_cflag = (tp->c_cflag & ~V_CBAUD) | conv_bv[(int) sg->sg_ispeed]; | ||
| 1292 | } | ||
| 1293 | |||
| 1294 | /* | ||
| 1295 | ttyseth_pv -- set hardware dependent tty settings using either the | ||
| 1296 | POSIX termios structure or the System V termio structure. | ||
| 1297 | sysv = 0 => (POSIX): struct termios *sg | ||
| 1298 | sysv != 0 => (System V): struct termio *sg | ||
| 1299 | */ | ||
| 1300 | static void ttyseth_pv(PortP, s, sg, sysv) | ||
| 1301 | struct Port *PortP; | ||
| 1302 | struct ttystatics *s; | ||
| 1303 | struct termios *sg; | ||
| 1304 | int sysv; | ||
| 1305 | { | ||
| 1306 | int speed; | ||
| 1307 | unsigned char csize; | ||
| 1308 | unsigned char cread; | ||
| 1309 | unsigned int lcr_flags; | ||
| 1310 | int ps; | ||
| 1311 | |||
| 1312 | if (sysv) { | ||
| 1313 | /* sg points to a System V termio structure */ | ||
| 1314 | csize = ((struct termio *) sg)->c_cflag & CSIZE; | ||
| 1315 | cread = ((struct termio *) sg)->c_cflag & CREAD; | ||
| 1316 | speed = conv_vb[((struct termio *) sg)->c_cflag & V_CBAUD]; | ||
| 1317 | } else { | ||
| 1318 | /* sg points to a POSIX termios structure */ | ||
| 1319 | csize = sg->c_cflag & CSIZE; | ||
| 1320 | cread = sg->c_cflag & CREAD; | ||
| 1321 | speed = conv_vb[sg->c_cflag & V_CBAUD]; | ||
| 1322 | } | ||
| 1323 | if (s->sg.sg_ispeed != speed || s->sg.sg_ospeed != speed) { | ||
| 1324 | s->sg.sg_ispeed = speed; | ||
| 1325 | s->sg.sg_ospeed = speed; | ||
| 1326 | s->tm.c_cflag = (s->tm.c_cflag & ~V_CBAUD) | conv_bv[(int) s->sg.sg_ispeed]; | ||
| 1327 | } | ||
| 1328 | } | ||
| 1329 | #endif | ||
diff --git a/drivers/char/rio/riowinif.h b/drivers/char/rio/riowinif.h deleted file mode 100644 index f802d7593b80..000000000000 --- a/drivers/char/rio/riowinif.h +++ /dev/null | |||
| @@ -1,1329 +0,0 @@ | |||
| 1 | /************************************************************************/ | ||
| 2 | /* */ | ||
| 3 | /* Title : RIO Shared Memory Window Inteface */ | ||
| 4 | /* */ | ||
| 5 | /* Author : N.P.Vassallo */ | ||
| 6 | /* */ | ||
| 7 | /* Creation : 7th June 1999 */ | ||
| 8 | /* */ | ||
| 9 | /* Version : 1.0.0 */ | ||
| 10 | /* */ | ||
| 11 | /* Copyright : (c) Specialix International Ltd. 1999 * | ||
| 12 | * This program is free software; you can redistribute it and/or modify | ||
| 13 | * it under the terms of the GNU General Public License as published by | ||
| 14 | * the Free Software Foundation; either version 2 of the License, or | ||
| 15 | * (at your option) any later version. | ||
| 16 | * | ||
| 17 | * This program is distributed in the hope that it will be useful, | ||
| 18 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 19 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 20 | * GNU General Public License for more details. | ||
| 21 | * | ||
| 22 | * You should have received a copy of the GNU General Public License | ||
| 23 | * along with this program; if not, write to the Free Software | ||
| 24 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | ||
| 25 | * */ | ||
| 26 | /* Description : Prototypes, structures and definitions */ | ||
| 27 | /* describing RIO host card shared memory */ | ||
| 28 | /* window interface structures: */ | ||
| 29 | /* PARMMAP */ | ||
| 30 | /* RUP */ | ||
| 31 | /* PHB */ | ||
| 32 | /* LPB */ | ||
| 33 | /* PKT */ | ||
| 34 | /* */ | ||
| 35 | /************************************************************************/ | ||
| 36 | |||
| 37 | /* History... | ||
| 38 | |||
| 39 | 1.0.0 07/06/99 NPV Creation. (based on PARMMAP.H) | ||
| 40 | |||
| 41 | */ | ||
| 42 | |||
| 43 | #ifndef _riowinif_h /* If RIOWINDIF.H not already defined */ | ||
| 44 | #define _riowinif_h 1 | ||
| 45 | |||
| 46 | /***************************************************************************** | ||
| 47 | ******************************** ********************************* | ||
| 48 | ******************************** General ********************************* | ||
| 49 | ******************************** ********************************* | ||
| 50 | *****************************************************************************/ | ||
| 51 | |||
| 52 | #define TPNULL ((_u16)(0x8000)) | ||
| 53 | |||
| 54 | /***************************************************************************** | ||
| 55 | ******************************** ******************************** | ||
| 56 | ******************************** PARM_MAP ******************************** | ||
| 57 | ******************************** ******************************** | ||
| 58 | *****************************************************************************/ | ||
| 59 | |||
| 60 | /* The PARM_MAP structure defines global values relating to the Host Card / RTA | ||
| 61 | and is the main structure from which all other structures are referenced. */ | ||
| 62 | |||
| 63 | typedef struct _PARM_MAP { | ||
| 64 | _u16 phb_ptr; /* 0x00 Pointer to the PHB array */ | ||
| 65 | _u16 phb_num_ptr; /* 0x02 Ptr to Number of PHB's */ | ||
| 66 | _u16 free_list; /* 0x04 Free List pointer */ | ||
| 67 | _u16 free_list_end; /* 0x06 Free List End pointer */ | ||
| 68 | _u16 q_free_list_ptr; /* 0x08 Ptr to Q_BUF variable */ | ||
| 69 | _u16 unit_id_ptr; /* 0x0A Unit Id */ | ||
| 70 | _u16 link_str_ptr; /* 0x0C Link Structure Array */ | ||
| 71 | _u16 bootloader_1; /* 0x0E 1st Stage Boot Loader */ | ||
| 72 | _u16 bootloader_2; /* 0x10 2nd Stage Boot Loader */ | ||
| 73 | _u16 port_route_map_ptr; /* 0x12 Port Route Map */ | ||
| 74 | _u16 route_ptr; /* 0x14 Route Map */ | ||
| 75 | _u16 map_present; /* 0x16 Route Map present */ | ||
| 76 | _u16 pkt_num; /* 0x18 Total number of packets */ | ||
| 77 | _u16 q_num; /* 0x1A Total number of Q packets */ | ||
| 78 | _u16 buffers_per_port; /* 0x1C Number of buffers per port */ | ||
| 79 | _u16 heap_size; /* 0x1E Initial size of heap */ | ||
| 80 | _u16 heap_left; /* 0x20 Current Heap left */ | ||
| 81 | _u16 error; /* 0x22 Error code */ | ||
| 82 | _u16 tx_max; /* 0x24 Max number of tx pkts per phb */ | ||
| 83 | _u16 rx_max; /* 0x26 Max number of rx pkts per phb */ | ||
| 84 | _u16 rx_limit; /* 0x28 For high / low watermarks */ | ||
| 85 | _u16 links; /* 0x2A Links to use */ | ||
| 86 | _u16 timer; /* 0x2C Interrupts per second */ | ||
| 87 | _u16 rups; /* 0x2E Pointer to the RUPs */ | ||
| 88 | _u16 max_phb; /* 0x30 Mostly for debugging */ | ||
| 89 | _u16 living; /* 0x32 Just increments!! */ | ||
| 90 | _u16 init_done; /* 0x34 Initialisation over */ | ||
| 91 | _u16 booting_link; /* 0x36 */ | ||
| 92 | _u16 idle_count; /* 0x38 Idle time counter */ | ||
| 93 | _u16 busy_count; /* 0x3A Busy counter */ | ||
| 94 | _u16 idle_control; /* 0x3C Control Idle Process */ | ||
| 95 | _u16 tx_intr; /* 0x3E TX interrupt pending */ | ||
| 96 | _u16 rx_intr; /* 0x40 RX interrupt pending */ | ||
| 97 | _u16 rup_intr; /* 0x42 RUP interrupt pending */ | ||
| 98 | |||
| 99 | } PARM_MAP; | ||
| 100 | |||
| 101 | /* Same thing again, but defined as offsets... */ | ||
| 102 | |||
| 103 | #define PM_phb_ptr 0x00 /* 0x00 Pointer to the PHB array */ | ||
| 104 | #define PM_phb_num_ptr 0x02 /* 0x02 Ptr to Number of PHB's */ | ||
| 105 | #define PM_free_list 0x04 /* 0x04 Free List pointer */ | ||
| 106 | #define PM_free_list_end 0x06 /* 0x06 Free List End pointer */ | ||
| 107 | #define PM_q_free_list_ptr 0x08 /* 0x08 Ptr to Q_BUF variable */ | ||
| 108 | #define PM_unit_id_ptr 0x0A /* 0x0A Unit Id */ | ||
| 109 | #define PM_link_str_ptr 0x0C /* 0x0C Link Structure Array */ | ||
| 110 | #define PM_bootloader_1 0x0E /* 0x0E 1st Stage Boot Loader */ | ||
| 111 | #define PM_bootloader_2 0x10 /* 0x10 2nd Stage Boot Loader */ | ||
| 112 | #define PM_port_route_map_ptr 0x12 /* 0x12 Port Route Map */ | ||
| 113 | #define PM_route_ptr 0x14 /* 0x14 Route Map */ | ||
| 114 | #define PM_map_present 0x16 /* 0x16 Route Map present */ | ||
| 115 | #define PM_pkt_num 0x18 /* 0x18 Total number of packets */ | ||
| 116 | #define PM_q_num 0x1A /* 0x1A Total number of Q packets */ | ||
| 117 | #define PM_buffers_per_port 0x1C /* 0x1C Number of buffers per port */ | ||
| 118 | #define PM_heap_size 0x1E /* 0x1E Initial size of heap */ | ||
| 119 | #define PM_heap_left 0x20 /* 0x20 Current Heap left */ | ||
| 120 | #define PM_error 0x22 /* 0x22 Error code */ | ||
| 121 | #define PM_tx_max 0x24 /* 0x24 Max number of tx pkts per phb */ | ||
| 122 | #define PM_rx_max 0x26 /* 0x26 Max number of rx pkts per phb */ | ||
| 123 | #define PM_rx_limit 0x28 /* 0x28 For high / low watermarks */ | ||
| 124 | #define PM_links 0x2A /* 0x2A Links to use */ | ||
| 125 | #define PM_timer 0x2C /* 0x2C Interrupts per second */ | ||
| 126 | #define PM_rups 0x2E /* 0x2E Pointer to the RUPs */ | ||
| 127 | #define PM_max_phb 0x30 /* 0x30 Mostly for debugging */ | ||
| 128 | #define PM_living 0x32 /* 0x32 Just increments!! */ | ||
| 129 | #define PM_init_done 0x34 /* 0x34 Initialisation over */ | ||
| 130 | #define PM_booting_link 0x36 /* 0x36 */ | ||
| 131 | #define PM_idle_count 0x38 /* 0x38 Idle time counter */ | ||
| 132 | #define PM_busy_count 0x3A /* 0x3A Busy counter */ | ||
| 133 | #define PM_idle_control 0x3C /* 0x3C Control Idle Process */ | ||
| 134 | #define PM_tx_intr 0x3E /* 0x4E TX interrupt pending */ | ||
| 135 | #define PM_rx_intr 0x40 /* 0x40 RX interrupt pending */ | ||
| 136 | #define PM_rup_intr 0x42 /* 0x42 RUP interrupt pending */ | ||
| 137 | #define sizeof_PARM_MAP 0x44 /* structure size = 0x44 */ | ||
| 138 | |||
| 139 | /* PARM_MAP.error definitions... */ | ||
| 140 | #define E_NO_ERROR 0x00 | ||
| 141 | #define E_PROCESS_NOT_INIT 0x01 | ||
| 142 | #define E_LINK_TIMEOUT 0x02 | ||
| 143 | #define E_NO_ROUTE 0x03 | ||
| 144 | #define E_CONFUSED 0x04 | ||
| 145 | #define E_HOME 0x05 | ||
| 146 | #define E_CSUM_FAIL 0x06 | ||
| 147 | #define E_DISCONNECTED 0x07 | ||
| 148 | #define E_BAD_RUP 0x08 | ||
| 149 | #define E_NO_VIRGIN 0x09 | ||
| 150 | #define E_BOOT_RUP_BUSY 0x10 | ||
| 151 | #define E_CHANALLOC 0x80 | ||
| 152 | #define E_POLL_ALLOC 0x81 | ||
| 153 | #define E_LTTWAKE 0x82 | ||
| 154 | #define E_LTT_ALLOC 0x83 | ||
| 155 | #define E_LRT_ALLOC 0x84 | ||
| 156 | #define E_CIRRUS 0x85 | ||
| 157 | #define E_MONITOR 0x86 | ||
| 158 | #define E_PHB_ALLOC 0x87 | ||
| 159 | #define E_ARRAY_ALLOC 0x88 | ||
| 160 | #define E_QBUF_ALLOC 0x89 | ||
| 161 | #define E_PKT_ALLOC 0x8a | ||
| 162 | #define E_GET_TX_Q_BUF 0x8b | ||
| 163 | #define E_GET_RX_Q_BUF 0x8c | ||
| 164 | #define E_MEM_OUT 0x8d | ||
| 165 | #define E_MMU_INIT 0x8e | ||
| 166 | #define E_LTT_INIT 0x8f | ||
| 167 | #define E_LRT_INIT 0x90 | ||
| 168 | #define E_LINK_RUN 0x91 | ||
| 169 | #define E_MONITOR_ALLOC 0x92 | ||
| 170 | #define E_MONITOR_INIT 0x93 | ||
| 171 | #define E_POLL_INIT 0x94 | ||
| 172 | |||
| 173 | /* PARM_MAP.links definitions... */ | ||
| 174 | #define RIO_LINK_ENABLE 0x80FF | ||
| 175 | |||
| 176 | /***************************************************************************** | ||
| 177 | ********************************** *********************************** | ||
| 178 | ********************************** RUP *********************************** | ||
| 179 | ********************************** *********************************** | ||
| 180 | *****************************************************************************/ | ||
| 181 | |||
| 182 | /* The RUP (Remote Unit Port) structure relates to the Remote Terminal Adapters | ||
| 183 | attached to the system and there is normally an array of MAX_RUPS (=16) structures | ||
| 184 | in a host card, defined by PARM_MAP->rup. */ | ||
| 185 | |||
| 186 | typedef struct _RUP { | ||
| 187 | _u16 txpkt; /* 0x00 Outgoing packet */ | ||
| 188 | _u16 rxpkt; /* 0x02 ncoming packet */ | ||
| 189 | _u16 link; /* 0x04 Which link to send packet down ? */ | ||
| 190 | _u8 rup_dest_unit[2]; /* 0x06 Destination Unit */ | ||
| 191 | _u16 handshake; /* 0x08 Handshaking */ | ||
| 192 | _u16 timeout; /* 0x0A Timeout */ | ||
| 193 | _u16 status; /* 0x0C Status */ | ||
| 194 | _u16 txcontrol; /* 0x0E Transmit control */ | ||
| 195 | _u16 rxcontrol; /* 0x10 Receive control */ | ||
| 196 | |||
| 197 | } RUP; | ||
| 198 | |||
| 199 | /* Same thing again, but defined as offsets... */ | ||
| 200 | |||
| 201 | #define RUP_txpkt 0x00 /* 0x00 Outgoing packet */ | ||
| 202 | #define RUP_rxpkt 0x02 /* 0x02 Incoming packet */ | ||
| 203 | #define RUP_link 0x04 /* 0x04 Which link to send packet down ? */ | ||
| 204 | #define RUP_rup_dest_unit 0x06 /* 0x06 Destination Unit */ | ||
| 205 | #define RUP_handshake 0x08 /* 0x08 Handshaking */ | ||
| 206 | #define RUP_timeout 0x0A /* 0x0A Timeout */ | ||
| 207 | #define RUP_status 0x0C /* 0x0C Status */ | ||
| 208 | #define RUP_txcontrol 0x0E /* 0x0E Transmit control */ | ||
| 209 | #define RUP_rxcontrol 0x10 /* 0x10 Receive control */ | ||
| 210 | #define sizeof_RUP 0x12 /* structure size = 0x12 */ | ||
| 211 | |||
| 212 | #define MAX_RUP 16 | ||
| 213 | |||
| 214 | /* RUP.txcontrol definitions... */ | ||
| 215 | #define TX_RUP_INACTIVE 0 /* Nothing to transmit */ | ||
| 216 | #define TX_PACKET_READY 1 /* Transmit packet ready */ | ||
| 217 | #define TX_LOCK_RUP 2 /* Transmit side locked */ | ||
| 218 | |||
| 219 | /* RUP.txcontrol definitions... */ | ||
| 220 | #define RX_RUP_INACTIVE 0 /* Nothing received */ | ||
| 221 | #define RX_PACKET_READY 1 /* Packet received */ | ||
| 222 | |||
| 223 | #define RUP_NO_OWNER 0xFF /* RUP not owned by any process */ | ||
| 224 | |||
| 225 | /***************************************************************************** | ||
| 226 | ********************************** *********************************** | ||
| 227 | ********************************** PHB *********************************** | ||
| 228 | ********************************** *********************************** | ||
| 229 | *****************************************************************************/ | ||
| 230 | |||
| 231 | /* The PHB (Port Header Block) structure relates to the serial ports attached | ||
| 232 | to the system and there is normally an array of MAX_PHBS (=128) structures | ||
| 233 | in a host card, defined by PARM_MAP->phb_ptr and PARM_MAP->phb_num_ptr. */ | ||
| 234 | |||
| 235 | typedef struct _PHB { | ||
| 236 | _u16 source; /* 0x00 Location of the PHB in the host card */ | ||
| 237 | _u16 handshake; /* 0x02 Used to manage receive packet flow control */ | ||
| 238 | _u16 status; /* 0x04 Internal port transmit/receive status */ | ||
| 239 | _u16 timeout; /* 0x06 Time period to wait for an ACK */ | ||
| 240 | _u16 link; /* 0x08 The host link associated with the PHB */ | ||
| 241 | _u16 destination; /* 0x0A Location of the remote port on the network */ | ||
| 242 | |||
| 243 | _u16 tx_start; /* 0x0C first entry in the packet array for transmit packets */ | ||
| 244 | _u16 tx_end; /* 0x0E last entry in the packet array for transmit packets */ | ||
| 245 | _u16 tx_add; /* 0x10 position in the packet array for new transmit packets */ | ||
| 246 | _u16 tx_remove; /* 0x12 current position in the packet pointer array */ | ||
| 247 | |||
| 248 | _u16 rx_start; /* 0x14 first entry in the packet array for receive packets */ | ||
| 249 | _u16 rx_end; /* 0x16 last entry in the packet array for receive packets */ | ||
| 250 | _u16 rx_add; /* 0x18 position in the packet array for new receive packets */ | ||
| 251 | _u16 rx_remove; /* 0x1A current position in the packet pointer array */ | ||
| 252 | |||
| 253 | } PHB; | ||
| 254 | |||
| 255 | /* Same thing again, but defined as offsets... */ | ||
| 256 | |||
| 257 | #define PHB_source 0x00 /* 0x00 Location of the PHB in the host card */ | ||
| 258 | #define PHB_handshake 0x02 /* 0x02 Used to manage receive packet flow control */ | ||
| 259 | #define PHB_status 0x04 /* 0x04 Internal port transmit/receive status */ | ||
| 260 | #define PHB_timeout 0x06 /* 0x06 Time period to wait for an ACK */ | ||
| 261 | #define PHB_link 0x08 /* 0x08 The host link associated with the PHB */ | ||
| 262 | #define PHB_destination 0x0A /* 0x0A Location of the remote port on the network */ | ||
| 263 | #define PHB_tx_start 0x0C /* 0x0C first entry in the packet array for transmit packets */ | ||
| 264 | #define PHB_tx_end 0x0E /* 0x0E last entry in the packet array for transmit packets */ | ||
| 265 | #define PHB_tx_add 0x10 /* 0x10 position in the packet array for new transmit packets */ | ||
| 266 | #define PHB_tx_remove 0x12 /* 0x12 current position in the packet pointer array */ | ||
| 267 | #define PHB_rx_start 0x14 /* 0x14 first entry in the packet array for receive packets */ | ||
| 268 | #define PHB_rx_end 0x16 /* 0x16 last entry in the packet array for receive packets */ | ||
| 269 | #define PHB_rx_add 0x18 /* 0x18 position in the packet array for new receive packets */ | ||
| 270 | #define PHB_rx_remove 0x1A /* 0x1A current position in the packet pointer array */ | ||
| 271 | #define sizeof_PHB 0x1C /* structure size = 0x1C */ | ||
| 272 | |||
| 273 | /* PHB.handshake definitions... */ | ||
| 274 | #define PHB_HANDSHAKE_SET 0x0001 /* Set by LRT */ | ||
| 275 | #define PHB_HANDSHAKE_RESET 0x0002 /* Set by ISR / driver */ | ||
| 276 | #define PHB_HANDSHAKE_FLAGS (PHB_HANDSHAKE_RESET|PHB_HANDSHAKE_SET) | ||
| 277 | /* Reset by ltt */ | ||
| 278 | |||
| 279 | #define MAX_PHB 128 /* range 0-127 */ | ||
| 280 | |||
| 281 | /***************************************************************************** | ||
| 282 | ********************************** *********************************** | ||
| 283 | ********************************** LPB *********************************** | ||
| 284 | ********************************** *********************************** | ||
| 285 | *****************************************************************************/ | ||
| 286 | |||
| 287 | /* The LPB (Link Parameter Block) structure relates to a RIO Network Link | ||
| 288 | and there is normally an array of MAX_LINKS (=4) structures in a host card, | ||
| 289 | defined by PARM_MAP->link_str_ptr. */ | ||
| 290 | |||
| 291 | typedef struct _LPB { | ||
| 292 | _u16 link_number; /* 0x00 Link Number */ | ||
| 293 | _u16 in_ch; /* 0x02 Link In Channel */ | ||
| 294 | _u16 out_ch; /* 0x04 Link Out Channel */ | ||
| 295 | _u8 attached_serial[4]; /* 0x06 Attached serial number */ | ||
| 296 | _u8 attached_host_serial[4]; /* 0x0A Serial number of Host who booted other end */ | ||
| 297 | _u16 descheduled; /* 0x0E Currently Descheduled */ | ||
| 298 | _u16 state; /* 0x10 Current state */ | ||
| 299 | _u16 send_poll; /* 0x12 Send a Poll Packet */ | ||
| 300 | _u16 ltt_p; /* 0x14 Process Descriptor */ | ||
| 301 | _u16 lrt_p; /* 0x16 Process Descriptor */ | ||
| 302 | _u16 lrt_status; /* 0x18 Current lrt status */ | ||
| 303 | _u16 ltt_status; /* 0x1A Current ltt status */ | ||
| 304 | _u16 timeout; /* 0x1C Timeout value */ | ||
| 305 | _u16 topology; /* 0x1E Topology bits */ | ||
| 306 | _u16 mon_ltt; /* 0x20 */ | ||
| 307 | _u16 mon_lrt; /* 0x22 */ | ||
| 308 | _u16 num_pkts; /* 0x24 */ | ||
| 309 | _u16 add_packet_list; /* 0x26 Add packets to here */ | ||
| 310 | _u16 remove_packet_list; /* 0x28 Send packets from here */ | ||
| 311 | |||
| 312 | _u16 lrt_fail_chan; /* 0x2A Lrt's failure channel */ | ||
| 313 | _u16 ltt_fail_chan; /* 0x2C Ltt's failure channel */ | ||
| 314 | |||
| 315 | RUP rup; /* 0x2E RUP structure for HOST to driver comms */ | ||
| 316 | RUP link_rup; /* 0x40 RUP for the link (POLL, topology etc.) */ | ||
| 317 | _u16 attached_link; /* 0x52 Number of attached link */ | ||
| 318 | _u16 csum_errors; /* 0x54 csum errors */ | ||
| 319 | _u16 num_disconnects; /* 0x56 number of disconnects */ | ||
| 320 | _u16 num_sync_rcvd; /* 0x58 # sync's received */ | ||
| 321 | _u16 num_sync_rqst; /* 0x5A # sync requests */ | ||
| 322 | _u16 num_tx; /* 0x5C Num pkts sent */ | ||
| 323 | _u16 num_rx; /* 0x5E Num pkts received */ | ||
| 324 | _u16 module_attached; /* 0x60 Module tpyes of attached */ | ||
| 325 | _u16 led_timeout; /* 0x62 LED timeout */ | ||
| 326 | _u16 first_port; /* 0x64 First port to service */ | ||
| 327 | _u16 last_port; /* 0x66 Last port to service */ | ||
| 328 | |||
| 329 | } LPB; | ||
| 330 | |||
| 331 | /* Same thing again, but defined as offsets... */ | ||
| 332 | |||
| 333 | #define LPB_link_number 0x00 /* 0x00 Link Number */ | ||
| 334 | #define LPB_in_ch 0x02 /* 0x02 Link In Channel */ | ||
| 335 | #define LPB_out_ch 0x04 /* 0x04 Link Out Channel */ | ||
| 336 | #define LPB_attached_serial 0x06 /* 0x06 Attached serial number */ | ||
| 337 | #define LPB_attached_host_serial 0x0A /* 0x0A Serial number of Host who booted other end */ | ||
| 338 | #define LPB_descheduled 0x0E /* 0x0E Currently Descheduled */ | ||
| 339 | #define LPB_state 0x10 /* 0x10 Current state */ | ||
| 340 | #define LPB_send_poll 0x12 /* 0x12 Send a Poll Packet */ | ||
| 341 | #define LPB_ltt_p 0x14 /* 0x14 Process Descriptor */ | ||
| 342 | #define LPB_lrt_p 0x16 /* 0x16 Process Descriptor */ | ||
| 343 | #define LPB_lrt_status 0x18 /* 0x18 Current lrt status */ | ||
| 344 | #define LPB_ltt_status 0x1A /* 0x1A Current ltt status */ | ||
| 345 | #define LPB_timeout 0x1C /* 0x1C Timeout value */ | ||
| 346 | #define LPB_topology 0x1E /* 0x1E Topology bits */ | ||
| 347 | #define LPB_mon_ltt 0x20 /* 0x20 */ | ||
| 348 | #define LPB_mon_lrt 0x22 /* 0x22 */ | ||
| 349 | #define LPB_num_pkts 0x24 /* 0x24 */ | ||
| 350 | #define LPB_add_packet_list 0x26 /* 0x26 Add packets to here */ | ||
| 351 | #define LPB_remove_packet_list 0x28 /* 0x28 Send packets from here */ | ||
| 352 | #define LPB_lrt_fail_chan 0x2A /* 0x2A Lrt's failure channel */ | ||
| 353 | #define LPB_ltt_fail_chan 0x2C /* 0x2C Ltt's failure channel */ | ||
| 354 | #define LPB_rup 0x2E /* 0x2E RUP structure for HOST to driver comms */ | ||
| 355 | #define LPB_link_rup 0x40 /* 0x40 RUP for the link (POLL, topology etc.) */ | ||
| 356 | #define LPB_attached_link 0x52 /* 0x52 Number of attached link */ | ||
| 357 | #define LPB_csum_errors 0x54 /* 0x54 csum errors */ | ||
| 358 | #define LPB_num_disconnects 0x56 /* 0x56 number of disconnects */ | ||
| 359 | #define LPB_num_sync_rcvd 0x58 /* 0x58 # sync's received */ | ||
| 360 | #define LPB_num_sync_rqst 0x5A /* 0x5A # sync requests */ | ||
| 361 | #define LPB_num_tx 0x5C /* 0x5C Num pkts sent */ | ||
| 362 | #define LPB_num_rx 0x5E /* 0x5E Num pkts received */ | ||
| 363 | #define LPB_module_attached 0x60 /* 0x60 Module tpyes of attached */ | ||
| 364 | #define LPB_led_timeout 0x62 /* 0x62 LED timeout */ | ||
| 365 | #define LPB_first_port 0x64 /* 0x64 First port to service */ | ||
| 366 | #define LPB_last_port 0x66 /* 0x66 Last port to service */ | ||
| 367 | #define sizeof_LPB 0x68 /* structure size = 0x68 */ | ||
| 368 | |||
| 369 | #define LINKS_PER_UNIT 4 /* number of links from a host */ | ||
| 370 | |||
| 371 | /***************************************************************************** | ||
| 372 | ******************************** ******************************* | ||
| 373 | ******************************** FREE_LIST ******************************* | ||
| 374 | ******************************** ******************************* | ||
| 375 | *****************************************************************************/ | ||
| 376 | |||
| 377 | /* Used to overlay packet headers when allocating/freeing packets from the free list */ | ||
| 378 | |||
| 379 | typedef struct _FREE_LIST { | ||
| 380 | _u16 next; /* 0x00 offset of next list item */ | ||
| 381 | _u16 prev; /* 0x02 offset of previous list item */ | ||
| 382 | |||
| 383 | } FREE_LIST; | ||
| 384 | |||
| 385 | /* Same thing again, but defined as offsets... */ | ||
| 386 | |||
| 387 | #define FL_next 0x00 /* 0x00 offset of next list item */ | ||
| 388 | #define FL_prev 0x02 /* 0x02 offset of previous list item */ | ||
| 389 | |||
| 390 | /***************************************************************************** | ||
| 391 | ********************************** *********************************** | ||
| 392 | ********************************** PKT *********************************** | ||
| 393 | ********************************** *********************************** | ||
| 394 | *****************************************************************************/ | ||
| 395 | |||
| 396 | /* The PKT is the main unit of communication between Host Cards and RTAs across | ||
| 397 | the RIO network. */ | ||
| 398 | |||
| 399 | #define PKT_MAX_DATA_LEN 72 /* Size of packet data */ | ||
| 400 | |||
| 401 | typedef struct _PKT { | ||
| 402 | _u8 dest_unit; /* 0x00 Destination Unit Id */ | ||
| 403 | _u8 dest_port; /* 0x01 Destination Port */ | ||
| 404 | _u8 src_unit; /* 0x02 Source Unit Id */ | ||
| 405 | _u8 src_port; /* 0x03 Source Port */ | ||
| 406 | _u8 len; /* 0x04 Length (in bytes) of data field */ | ||
| 407 | _u8 control; /* 0x05 */ | ||
| 408 | _u8 data[PKT_MAX_DATA_LEN]; /* 0x06 Actual data */ | ||
| 409 | _u16 csum; /* 0x4E C-SUM */ | ||
| 410 | |||
| 411 | } PKT; | ||
| 412 | |||
| 413 | /* Same thing again, but defined as offsets... */ | ||
| 414 | |||
| 415 | #define PKT_dest_unit 0x00 /* 0x00 Destination Unit Id */ | ||
| 416 | #define PKT_dest_port 0x01 /* 0x01 Destination Port */ | ||
| 417 | #define PKT_src_unit 0x02 /* 0x02 Source Unit Id */ | ||
| 418 | #define PKT_src_port 0x03 /* 0x03 Source Port */ | ||
| 419 | #define PKT_len 0x04 /* 0x04 Length (in bytes) of data field */ | ||
| 420 | #define PKT_control 0x05 /* 0x05 */ | ||
| 421 | #define PKT_data 0x06 /* 0x06 Actual data */ | ||
| 422 | #define PKT_csum 0x4E /* 0x4E C-SUM */ | ||
| 423 | #define sizeof_PKT 0x50 /* structure size = 0x50 */ | ||
| 424 | |||
| 425 | /* PKT.len definitions... */ | ||
| 426 | #define PKT_CMD_BIT 0x80 | ||
| 427 | #define PKT_CMD_DATA 0x80 | ||
| 428 | #define PKT_LEN_MASK 0x7F | ||
| 429 | |||
| 430 | /* PKT.control definitions... */ | ||
| 431 | #define PKT_ACK 0x40 | ||
| 432 | #define PKT_TGL 0x20 | ||
| 433 | #define DATA_WNDW 0x10 | ||
| 434 | #define PKT_TTL_MASK 0x0F | ||
| 435 | #define MAX_TTL 0x0F | ||
| 436 | |||
| 437 | /***************************************************************************** | ||
| 438 | ***************************** **************************** | ||
| 439 | ***************************** Control Packets **************************** | ||
| 440 | ***************************** **************************** | ||
| 441 | *****************************************************************************/ | ||
| 442 | |||
| 443 | /* The following definitions and structures define the control packets sent | ||
| 444 | between the driver and RIO Ports, RTAs and Host Cards. */ | ||
| 445 | |||
| 446 | #define PRE_EMPTIVE 0x80 /* Pre-emptive command (sent via port's RUP) */ | ||
| 447 | |||
| 448 | /* "in-band" and "pre-emptive" port commands... */ | ||
| 449 | #define OPEN 0x00 /* Driver->RIO Open a port */ | ||
| 450 | #define CONFIG 0x01 /* Driver->RIO Configure a port */ | ||
| 451 | #define MOPEN 0x02 /* Driver->RIO Modem open (wait for DCD) */ | ||
| 452 | #define CLOSE 0x03 /* Driver->RIO Close a port */ | ||
| 453 | #define WFLUSH (0x04|PRE_EMPTIVE) /* Driver->RIO Write flush */ | ||
| 454 | #define RFLUSH (0x05|PRE_EMPTIVE) /* Driver->RIO Read flush */ | ||
| 455 | #define RESUME (0x06|PRE_EMPTIVE) /* Driver->RIO Behave as if XON received */ | ||
| 456 | #define SBREAK 0x07 /* Driver->RIO Start break */ | ||
| 457 | #define EBREAK 0x08 /* Driver->RIO End break */ | ||
| 458 | #define SUSPEND (0x09|PRE_EMPTIVE) /* Driver->RIO Behave as if XOFF received */ | ||
| 459 | #define FCLOSE (0x0A|PRE_EMPTIVE) /* Driver->RIO Force close */ | ||
| 460 | #define XPRINT 0x0B /* Driver->RIO Xprint packet */ | ||
| 461 | #define MBIS (0x0C|PRE_EMPTIVE) /* Driver->RIO Set modem lines */ | ||
| 462 | #define MBIC (0x0D|PRE_EMPTIVE) /* Driver->RIO Clear modem lines */ | ||
| 463 | #define MSET (0x0E|PRE_EMPTIVE) /* Driver->RIO Set modem lines */ | ||
| 464 | #define PCLOSE 0x0F /* Driver->RIO Pseudo close */ | ||
| 465 | #define MGET (0x10|PRE_EMPTIVE) /* Driver->RIO Force update of modem status */ | ||
| 466 | #define MEMDUMP (0x11|PRE_EMPTIVE) /* Driver->RIO DEBUG request for RTA memory */ | ||
| 467 | #define READ_REGISTER (0x12|PRE_EMPTIVE) /* Driver->RIO DEBUG read CD1400 register */ | ||
| 468 | |||
| 469 | /* Remote Unit Port (RUP) packet definitions... (specified in PKT.dest_unit and PKT.src_unit) */ | ||
| 470 | #define SYNC_RUP 0xFF /* Download internal */ | ||
| 471 | #define COMMAND_RUP 0xFE /* Command ack/status */ | ||
| 472 | #define ERROR_RUP 0xFD /* Download internal */ | ||
| 473 | #define POLL_RUP 0xFC /* Download internal */ | ||
| 474 | #define BOOT_RUP 0xFB /* Used to boot RTAs */ | ||
| 475 | #define ROUTE_RUP 0xFA /* Used to specify routing/topology */ | ||
| 476 | #define STATUS_RUP 0xF9 /* Not used */ | ||
| 477 | #define POWER_RUP 0xF8 /* Download internal */ | ||
| 478 | |||
| 479 | /* COMMAND_RUP definitions... */ | ||
| 480 | #define COMPLETE (0x20|PRE_EMPTIVE) /* RIO->Driver Command complete */ | ||
| 481 | #define BREAK_RECEIVED (0x21|PRE_EMPTIVE) /* RIO->Driver Break received */ | ||
| 482 | #define MODEM_STATUS (0x22|PRE_EMPTIVE) /* RIO->Driver Modem status change */ | ||
| 483 | |||
| 484 | /* BOOT_RUP definitions... */ | ||
| 485 | #define BOOT_REQUEST 0x00 /* RIO->Driver Request for boot */ | ||
| 486 | #define BOOT_ABORT 0x01 /* Driver->RIO Abort a boot */ | ||
| 487 | #define BOOT_SEQUENCE 0x02 /* Driver->RIO Packet with firmware details */ | ||
| 488 | #define BOOT_COMPLETED 0x03 /* RIO->Driver Boot completed */ | ||
| 489 | #define IFOAD 0x2F /* Driver->RIO Shutdown/Reboot RTA (Fall Over And Die) */ | ||
| 490 | #define IDENTIFY 0x30 /* Driver->RIO Identify RTA */ | ||
| 491 | #define ZOMBIE 0x31 /* Driver->RIO Shutdown/Flash LEDs */ | ||
| 492 | #define UFOAD 0x32 /* Driver->RIO Shutdown/Reboot neighbouring RTA */ | ||
| 493 | #define IWAIT 0x33 /* Driver->RIO Pause booting process */ | ||
| 494 | |||
| 495 | /* ROUTE_RUP definitions... */ | ||
| 496 | #define ROUTE_REQUEST 0x00 /* RIO->Driver Request an ID */ | ||
| 497 | #define ROUTE_FOAD 0x01 /* Driver->RIO Shutdown/reboot RTA */ | ||
| 498 | #define ROUTE_ALREADY 0x02 /* Driver->RIO Not used */ | ||
| 499 | #define ROUTE_USED 0x03 /* Driver->RIO Not used */ | ||
| 500 | #define ROUTE_ALLOCATE 0x04 /* Driver->RIO Allocate RTA RUP numbers */ | ||
| 501 | #define ROUTE_REQ_TOP 0x05 /* Driver->RIO Not used */ | ||
| 502 | #define ROUTE_TOPOLOGY 0x06 /* RIO->Driver Route/Topology status */ | ||
| 503 | |||
| 504 | /***************************************************************************** | ||
| 505 | ********************************** ********************************** | ||
| 506 | ********************************** OPEN ********************************** | ||
| 507 | ********************************** ********************************** | ||
| 508 | *****************************************************************************/ | ||
| 509 | |||
| 510 | /* (Driver->RIO,in-band) | ||
| 511 | |||
| 512 | Sent to open a port. | ||
| 513 | Structure of configuration info used with OPEN, CONFIG and MOPEN packets... */ | ||
| 514 | |||
| 515 | #define PKT_Cmd (PKT_Data+0) /* Command code */ | ||
| 516 | #define PKT_Cor1 (PKT_Data+1) /* Channel Option Register 1 */ | ||
| 517 | #define PKT_Cor2 (PKT_Data+2) /* Channel Option Register 2 */ | ||
| 518 | #define PKT_Cor4 (PKT_Data+3) /* Channel Option Register 4 */ | ||
| 519 | #define PKT_Cor5 (PKT_Data+4) /* Channel Option Register 5 */ | ||
| 520 | #define PKT_TxXon (PKT_Data+5) /* Transmit XON character */ | ||
| 521 | #define PKT_TxXoff (PKT_Data+6) /* Transmit XOFF character */ | ||
| 522 | #define PKT_RxXon (PKT_Data+7) /* Receive XON character */ | ||
| 523 | #define PKT_RxXoff (PKT_Data+8) /* Receive XOFF character */ | ||
| 524 | #define PKT_Lnext (PKT_Data+9) /* Lnext character */ | ||
| 525 | #define PKT_TxBaud (PKT_Data+10) /* Transmit baud rate */ | ||
| 526 | #define PKT_RxBaud (PKT_Data+11) /* Receive baud rate */ | ||
| 527 | |||
| 528 | /* COR1 definitions... */ | ||
| 529 | #define COR1_PARITY 0xE0 /* Parity mask */ | ||
| 530 | #define COR1_NONE 0x00 /* No parity */ | ||
| 531 | #define COR1_SPACE 0x20 /* Space parity */ | ||
| 532 | #define COR1_EVEN 0x40 /* Even parity */ | ||
| 533 | #define COR1_MARK 0xA0 /* Mark parity */ | ||
| 534 | #define COR1_ODD 0xC0 /* Odd parity */ | ||
| 535 | |||
| 536 | #define COR1_STOPBITS 0x0C /* Stop bits mask */ | ||
| 537 | #define COR1_STOP1 0x00 /* 1 stop bit */ | ||
| 538 | #define COR1_STOP1_5 0x04 /* 1.5 stop bits */ | ||
| 539 | #define COR1_STOP2 0x08 /* 2 stop bits */ | ||
| 540 | |||
| 541 | #define COR1_DATABITS 0x03 /* Data bits mask */ | ||
| 542 | #define COR1_DATA5 0x00 /* 5 data bits */ | ||
| 543 | #define COR1_DATA6 0x01 /* 6 data bits */ | ||
| 544 | #define COR1_DATA7 0x02 /* 7 data bits */ | ||
| 545 | #define COR1_DATA8 0x03 /* 8 data bits */ | ||
| 546 | |||
| 547 | /* COR2 definitions... */ | ||
| 548 | #define COR2_XON_TXFLOW 0x40 /* XON/XOFF Transmit Flow */ | ||
| 549 | #define COR2_XANY_TXFLOW 0xC0 /* XON/XANY Transmit Flow */ | ||
| 550 | #define COR2_HUPCL 0x20 /* Hang Up On Close */ | ||
| 551 | #define COR2_DSR_TXFLOW 0x08 /* DSR Transmit Flow Control */ | ||
| 552 | #define COR2_RTS_RXFLOW 0x04 /* RTS Receive Flow Control */ | ||
| 553 | #define COR2_CTS_TXFLOW 0x02 /* CTS Transmit Flow Control */ | ||
| 554 | #define COR2_XON_RXFLOW 0x01 /* XON/XOFF Receive Flow */ | ||
| 555 | |||
| 556 | /* COR4 definition... */ | ||
| 557 | #define COR4_IGNCR 0x80 /* Discard received CR */ | ||
| 558 | #define COR4_ICRNL 0x40 /* Map received CR -> NL */ | ||
| 559 | #define COR4_INLCR 0x20 /* Map received NL -> CR */ | ||
| 560 | #define COR4_IGNBRK 0x10 /* Ignore Received Break */ | ||
| 561 | #define COR4_NBRKINT 0x08 /* No interrupt on rx Break */ | ||
| 562 | #define COR4_IGNPAR 0x04 /* ignore rx parity error chars */ | ||
| 563 | #define COR4_PARMRK 0x02 /* Mark rx parity error chars */ | ||
| 564 | #define COR4_RAISEMOD 0x01 /* Raise modem lines on !0 baud */ | ||
| 565 | |||
| 566 | /* COR5 definitions... */ | ||
| 567 | #define COR5_ISTRIP 0x80 /* Strip input chars to 7 bits */ | ||
| 568 | #define COR5_LNE 0x40 /* Enable LNEXT processing */ | ||
| 569 | #define COR5_CMOE 0x20 /* Match good & error characters */ | ||
| 570 | #define COR5_TAB3 0x10 /* TAB3 mode */ | ||
| 571 | #define COR5_TSTATE_ON 0x08 /* Enable tbusy/tstop monitoring */ | ||
| 572 | #define COR5_TSTATE_OFF 0x04 /* Disable tbusy/tstop monitoring */ | ||
| 573 | #define COR5_ONLCR 0x02 /* NL -> CR NL on output */ | ||
| 574 | #define COR5_OCRNL 0x01 /* CR -> NL on output */ | ||
| 575 | |||
| 576 | /* RxBaud and TxBaud definitions... */ | ||
| 577 | #define RIO_B0 0x00 /* RTS / DTR signals dropped */ | ||
| 578 | #define RIO_B50 0x01 /* 50 baud */ | ||
| 579 | #define RIO_B75 0x02 /* 75 baud */ | ||
| 580 | #define RIO_B110 0x03 /* 110 baud */ | ||
| 581 | #define RIO_B134 0x04 /* 134.5 baud */ | ||
| 582 | #define RIO_B150 0x05 /* 150 baud */ | ||
| 583 | #define RIO_B200 0x06 /* 200 baud */ | ||
| 584 | #define RIO_B300 0x07 /* 300 baud */ | ||
| 585 | #define RIO_B600 0x08 /* 600 baud */ | ||
| 586 | #define RIO_B1200 0x09 /* 1200 baud */ | ||
| 587 | #define RIO_B1800 0x0A /* 1800 baud */ | ||
| 588 | #define RIO_B2400 0x0B /* 2400 baud */ | ||
| 589 | #define RIO_B4800 0x0C /* 4800 baud */ | ||
| 590 | #define RIO_B9600 0x0D /* 9600 baud */ | ||
| 591 | #define RIO_B19200 0x0E /* 19200 baud */ | ||
| 592 | #define RIO_B38400 0x0F /* 38400 baud */ | ||
| 593 | #define RIO_B56000 0x10 /* 56000 baud */ | ||
| 594 | #define RIO_B57600 0x11 /* 57600 baud */ | ||
| 595 | #define RIO_B64000 0x12 /* 64000 baud */ | ||
| 596 | #define RIO_B115200 0x13 /* 115200 baud */ | ||
| 597 | #define RIO_B2000 0x14 /* 2000 baud */ | ||
| 598 | |||
| 599 | /***************************************************************************** | ||
| 600 | ********************************* ********************************* | ||
| 601 | ********************************* CONFIG ********************************* | ||
| 602 | ********************************* ********************************* | ||
| 603 | *****************************************************************************/ | ||
| 604 | |||
| 605 | /* (Driver->RIO,in-band) | ||
| 606 | |||
| 607 | CONFIG is sent from the driver to configure an already opened port. | ||
| 608 | Packet structure is same as OPEN. */ | ||
| 609 | |||
| 610 | /***************************************************************************** | ||
| 611 | ********************************* ********************************** | ||
| 612 | ********************************* MOPEN ********************************** | ||
| 613 | ********************************* ********************************** | ||
| 614 | *****************************************************************************/ | ||
| 615 | |||
| 616 | /* (Driver->RIO,in-band) | ||
| 617 | |||
| 618 | MOPEN is sent from the driver to open a port attached to a modem. (in-band) | ||
| 619 | Packet structure is same as OPEN. */ | ||
| 620 | |||
| 621 | /***************************************************************************** | ||
| 622 | ********************************* ********************************** | ||
| 623 | ********************************* CLOSE ********************************** | ||
| 624 | ********************************* ********************************** | ||
| 625 | *****************************************************************************/ | ||
| 626 | |||
| 627 | /* (Driver->RIO,in-band) | ||
| 628 | |||
| 629 | CLOSE is sent from the driver to close a previously opened port. | ||
| 630 | No parameters. | ||
| 631 | */ | ||
| 632 | #if 0 | ||
| 633 | #define PKT_Cmd (PKT_Data+0) /* Command code */ | ||
| 634 | #endif | ||
| 635 | /***************************************************************************** | ||
| 636 | ********************************* ********************************* | ||
| 637 | ********************************* WFLUSH ********************************* | ||
| 638 | ********************************* ********************************* | ||
| 639 | *****************************************************************************/ | ||
| 640 | |||
| 641 | /* (Driver->RIO,pre-emptive) | ||
| 642 | |||
| 643 | WFLUSH is sent pre-emptively from the driver to flush the write buffers and | ||
| 644 | packets of a port. (pre-emptive) | ||
| 645 | |||
| 646 | WFLUSH is also sent in-band from the driver to a port as a marker to end | ||
| 647 | write flushing previously started by a pre-emptive WFLUSH packet. (in-band) | ||
| 648 | */ | ||
| 649 | #if 0 | ||
| 650 | #define PKT_Cmd (PKT_Data+0) /* Command code */ | ||
| 651 | #endif | ||
| 652 | #define PKT_PhbNum (PKT_Data+1) /* Port number wrt RTA */ | ||
| 653 | |||
| 654 | /***************************************************************************** | ||
| 655 | ********************************* ********************************* | ||
| 656 | ********************************* RFLUSH ********************************* | ||
| 657 | ********************************* ********************************* | ||
| 658 | *****************************************************************************/ | ||
| 659 | |||
| 660 | /* (Driver->RIO,pre-emptive) | ||
| 661 | |||
| 662 | RFLUSH is sent pre-emptively from the driver to flush the read buffers and | ||
| 663 | packets of a port. | ||
| 664 | */ | ||
| 665 | #if 0 | ||
| 666 | #define PKT_Cmd (PKT_Data+0) /* Command code */ | ||
| 667 | #define PKT_PhbNum (PKT_Data+1) /* Port number wrt RTA */ | ||
| 668 | #endif | ||
| 669 | |||
| 670 | /***************************************************************************** | ||
| 671 | ********************************* ********************************* | ||
| 672 | ********************************* RESUME ********************************* | ||
| 673 | ********************************* ********************************* | ||
| 674 | *****************************************************************************/ | ||
| 675 | |||
| 676 | /* (Driver->RIO,pre-emptive) | ||
| 677 | |||
| 678 | RESUME is sent pre-emptively from the driver to cause a port to resume | ||
| 679 | transmission of data if blocked by XOFF. (as if XON had been received) | ||
| 680 | */ | ||
| 681 | #if 0 | ||
| 682 | #define PKT_Cmd (PKT_Data+0) /* Command code */ | ||
| 683 | #define PKT_PhbNum (PKT_Data+1) /* Port number wrt RTA */ | ||
| 684 | #endif | ||
| 685 | |||
| 686 | /***************************************************************************** | ||
| 687 | ********************************* ********************************* | ||
| 688 | ********************************* SBREAK ********************************* | ||
| 689 | ********************************* ********************************* | ||
| 690 | *****************************************************************************/ | ||
| 691 | |||
| 692 | /* (Driver->RIO,in-band) | ||
| 693 | |||
| 694 | SBREAK is sent in-band from the driver to a port to suspend data and start | ||
| 695 | break signal transmission. | ||
| 696 | |||
| 697 | If the break delay is 0, the break signal will be acknowledged with a | ||
| 698 | RUP_COMMAND, COMPLETE packet and continue until an EBREAK packet is received. | ||
| 699 | |||
| 700 | Otherwise, there is no acknowledgement and the break signal will last for the | ||
| 701 | specified number of mS. | ||
| 702 | */ | ||
| 703 | #if 0 | ||
| 704 | #define PKT_Cmd (PKT_Data+0) /* Command code */ | ||
| 705 | #endif | ||
| 706 | #define PKT_BreakDelay (PKT_Data+1) /* Break delay in mS */ | ||
| 707 | |||
| 708 | /***************************************************************************** | ||
| 709 | ********************************* ********************************* | ||
| 710 | ********************************* EBREAK ********************************* | ||
| 711 | ********************************* ********************************* | ||
| 712 | *****************************************************************************/ | ||
| 713 | |||
| 714 | /* (Driver->RIO,in-band) | ||
| 715 | |||
| 716 | EBREAK is sent in-band from the driver to a port to stop transmission of a | ||
| 717 | break signal. | ||
| 718 | |||
| 719 | No parameters. */ | ||
| 720 | |||
| 721 | /***************************************************************************** | ||
| 722 | ********************************* ******************************** | ||
| 723 | ********************************* SUSPEND ******************************** | ||
| 724 | ********************************* ******************************** | ||
| 725 | *****************************************************************************/ | ||
| 726 | |||
| 727 | /* (Driver->RIO,pre-emptive) | ||
| 728 | |||
| 729 | SUSPEND is sent pre-emptively from the driver to cause a port to suspend | ||
| 730 | transmission of data. (as if XOFF had been received) | ||
| 731 | */ | ||
| 732 | #if 0 | ||
| 733 | #define PKT_Cmd (PKT_Data+0) /* Command code */ | ||
| 734 | #define PKT_PhbNum (PKT_Data+1) /* Port number wrt RTA */ | ||
| 735 | #endif | ||
| 736 | |||
| 737 | /***************************************************************************** | ||
| 738 | ********************************* ********************************* | ||
| 739 | ********************************* FCLOSE ********************************* | ||
| 740 | ********************************* ********************************* | ||
| 741 | *****************************************************************************/ | ||
| 742 | |||
| 743 | /* (Driver->RIO,pre-emptive) | ||
| 744 | |||
| 745 | FCLOSE is sent pre-emptively from the driver to force close a port. | ||
| 746 | A force close flushes receive and transmit queues, and also lowers all output | ||
| 747 | modem signals if the COR5_HUPCL (Hang Up On Close) flag is set. | ||
| 748 | */ | ||
| 749 | #if 0 | ||
| 750 | #define PKT_Cmd (PKT_Data+0) /* Command code */ | ||
| 751 | #define PKT_PhbNum (PKT_Data+1) /* Port number wrt RTA */ | ||
| 752 | #endif | ||
| 753 | |||
| 754 | /***************************************************************************** | ||
| 755 | ********************************* ********************************* | ||
| 756 | ********************************* XPRINT ********************************* | ||
| 757 | ********************************* ********************************* | ||
| 758 | *****************************************************************************/ | ||
| 759 | |||
| 760 | /* (Driver->RIO,in-band) | ||
| 761 | |||
| 762 | XPRINT is sent as a normal I/O data packet except that the PKT_CMD_BIT of | ||
| 763 | the "len" field is set, and the first "data" byte is XPRINT. | ||
| 764 | |||
| 765 | The I/O data in the XPRINT packet will contain the following: | ||
| 766 | - Transparent Print Start Sequence | ||
| 767 | - Transparent Print Data | ||
| 768 | - Transparent Print Stop Sequence. | ||
| 769 | */ | ||
| 770 | #if 0 | ||
| 771 | #define PKT_Cmd (PKT_Data+0) /* Command code */ | ||
| 772 | #define PKT_PhbNum (PKT_Data+1) /* Port number wrt RTA */ | ||
| 773 | #endif | ||
| 774 | |||
| 775 | /***************************************************************************** | ||
| 776 | ********************************** ********************************** | ||
| 777 | ********************************** MBIS ********************************** | ||
| 778 | ********************************** ********************************** | ||
| 779 | *****************************************************************************/ | ||
| 780 | |||
| 781 | /* (Driver->RIO,pre-emptive) | ||
| 782 | |||
| 783 | MBIS is sent pre-emptively from the driver to set a port's modem signals. | ||
| 784 | */ | ||
| 785 | #if 0 | ||
| 786 | #define PKT_Cmd (PKT_Data+0) /* Command code */ | ||
| 787 | #define PKT_PhbNum (PKT_Data+1) /* Port number wrt RTA */ | ||
| 788 | #endif | ||
| 789 | #define PKT_ModemSet (PKT_Data+4) /* Modem set signals mask */ | ||
| 790 | |||
| 791 | /* ModemSet definitions... */ | ||
| 792 | #define MBIS_RTS 0x01 /* RTS modem signal */ | ||
| 793 | #define MBIS_DTR 0x02 /* DTR modem signal */ | ||
| 794 | |||
| 795 | /***************************************************************************** | ||
| 796 | ********************************** ********************************** | ||
| 797 | ********************************** MBIC ********************************** | ||
| 798 | ********************************** ********************************** | ||
| 799 | *****************************************************************************/ | ||
| 800 | |||
| 801 | /* (Driver->RIO,pre-emptive) | ||
| 802 | |||
| 803 | MBIC is sent pre-emptively from the driver to clear a port's modem signals. | ||
| 804 | */ | ||
| 805 | #if 0 | ||
| 806 | #define PKT_Cmd (PKT_Data+0) /* Command code */ | ||
| 807 | #define PKT_PhbNum (PKT_Data+1) /* Port number wrt RTA */ | ||
| 808 | #endif | ||
| 809 | |||
| 810 | #define PKT_ModemClear (PKT_Data+4) /* Modem clear signals mask */ | ||
| 811 | |||
| 812 | /* ModemClear definitions... */ | ||
| 813 | #define MBIC_RTS 0x01 /* RTS modem signal */ | ||
| 814 | #define MBIC_DTR 0x02 /* DTR modem signal */ | ||
| 815 | |||
| 816 | /***************************************************************************** | ||
| 817 | ********************************** ********************************** | ||
| 818 | ********************************** MSET ********************************** | ||
| 819 | ********************************** ********************************** | ||
| 820 | *****************************************************************************/ | ||
| 821 | |||
| 822 | /* (Driver->RIO,pre-emptive) | ||
| 823 | |||
| 824 | MSET is sent pre-emptively from the driver to set/clear a port's modem signals. */ | ||
| 825 | #if 0 | ||
| 826 | #define PKT_Cmd (PKT_Data+0) /* Command code */ | ||
| 827 | #define PKT_PhbNum (PKT_Data+1) /* Port number wrt RTA */ | ||
| 828 | #endif | ||
| 829 | |||
| 830 | #define PKT_ModemSet (PKT_Data+4) /* Modem set signals mask */ | ||
| 831 | |||
| 832 | /* ModemSet definitions... */ | ||
| 833 | #define MSET_RTS 0x01 /* RTS modem signal */ | ||
| 834 | #define MSET_DTR 0x02 /* DTR modem signal */ | ||
| 835 | |||
| 836 | /***************************************************************************** | ||
| 837 | ********************************* ********************************* | ||
| 838 | ********************************* PCLOSE ********************************* | ||
| 839 | ********************************* ********************************* | ||
| 840 | *****************************************************************************/ | ||
| 841 | |||
| 842 | /* (Driver->RIO,in-band) | ||
| 843 | |||
| 844 | PCLOSE is sent from the driver to pseudo close a previously opened port. | ||
| 845 | |||
| 846 | The port will close when all data has been sent/received, however, the | ||
| 847 | port's transmit / receive and modem signals will be left enabled and the | ||
| 848 | port marked internally as Pseudo Closed. */ | ||
| 849 | |||
| 850 | #define PKT_Cmd (PKT_Data+0) /* Command code */ | ||
| 851 | |||
| 852 | /***************************************************************************** | ||
| 853 | ********************************** ********************************** | ||
| 854 | ********************************** MGET ********************************** | ||
| 855 | ********************************** ********************************** | ||
| 856 | *****************************************************************************/ | ||
| 857 | |||
| 858 | /* (Driver->RIO,pre-emptive) | ||
| 859 | |||
| 860 | MGET is sent pre-emptively from the driver to request the port's current modem signals. */ | ||
| 861 | |||
| 862 | #define PKT_Cmd (PKT_Data+0) /* Command code */ | ||
| 863 | #define PKT_PhbNum (PKT_Data+1) /* Port number wrt RTA */ | ||
| 864 | |||
| 865 | /***************************************************************************** | ||
| 866 | ********************************* ******************************** | ||
| 867 | ********************************* MEMDUMP ******************************** | ||
| 868 | ********************************* ******************************** | ||
| 869 | *****************************************************************************/ | ||
| 870 | |||
| 871 | /* (Driver->RIO,pre-emptive) | ||
| 872 | |||
| 873 | MEMDUMP is sent pre-emptively from the driver to request a dump of 32 bytes | ||
| 874 | of the specified port's RTA address space. | ||
| 875 | */ | ||
| 876 | #if 0 | ||
| 877 | #define PKT_Cmd (PKT_Data+0) /* Command code */ | ||
| 878 | #endif | ||
| 879 | #define PKT_PhbNum (PKT_Data+1) /* Port number wrt RTA */ | ||
| 880 | #define PKT_SubCmd (PKT_Data+5) /* Sub Command */ | ||
| 881 | #define PKT_Address (PKT_Data+6) /* Requested address */ | ||
| 882 | |||
| 883 | /***************************************************************************** | ||
| 884 | ****************************** ***************************** | ||
| 885 | ****************************** READ_REGISTER ***************************** | ||
| 886 | ****************************** ***************************** | ||
| 887 | *****************************************************************************/ | ||
| 888 | |||
| 889 | /* (Driver->RIO,pre-emptive) | ||
| 890 | |||
| 891 | READ_REGISTER is sent pre-emptively from the driver to request the contents | ||
| 892 | of the CD1400 register specified in address. | ||
| 893 | */ | ||
| 894 | #if 0 | ||
| 895 | #define PKT_Cmd (PKT_Data+0) /* Command code */ | ||
| 896 | #endif | ||
| 897 | #define PKT_PhbNum (PKT_Data+1) /* Port number wrt RTA */ | ||
| 898 | #define PKT_SubCmd (PKT_Data+5) /* Sub Command */ | ||
| 899 | #define PKT_Address (PKT_Data+6) /* Requested address */ | ||
| 900 | |||
| 901 | /***************************************************************************** | ||
| 902 | ************************ ************************** | ||
| 903 | ************************ COMMAND_RUP - COMPLETE ************************** | ||
| 904 | ************************ ************************** | ||
| 905 | *****************************************************************************/ | ||
| 906 | |||
| 907 | /* (RIO->Driver,pre-emptive) | ||
| 908 | |||
| 909 | COMMAND_RUP - COMPLETE is sent in response to all port I/O control command | ||
| 910 | packets, except MEMDUMP and READ_REGISTER. | ||
| 911 | */ | ||
| 912 | #if 0 | ||
| 913 | #define PKT_Cmd (PKT_Data+0) /* Command code */ | ||
| 914 | #endif | ||
| 915 | #define PKT_PhbNum (PKT_Data+1) /* Port number wrt RTA */ | ||
| 916 | #define PKT_Cmd2 (PKT_Data+2) /* Command code copy */ | ||
| 917 | #define PKT_ModemStatus (PKT_Data+3) /* Modem signal status */ | ||
| 918 | #define PKT_PortStatus (PKT_Data+4) /* Port signal status */ | ||
| 919 | #define PKT_SubCmd (PKT_Data+5) /* Sub Command */ | ||
| 920 | |||
| 921 | /* ModemStatus definitions... */ | ||
| 922 | #define MODEM_DSR 0x80 /* Data Set Ready modem state */ | ||
| 923 | #define MODEM_CTS 0x40 /* Clear To Send modem state */ | ||
| 924 | #define MODEM_RI 0x20 /* Ring Indicate modem state */ | ||
| 925 | #define MODEM_CD 0x10 /* Carrier Detect modem state */ | ||
| 926 | #define MODEM_TSTOP 0x08 /* Transmit Stopped state */ | ||
| 927 | #define MODEM_TEMPTY 0x04 /* Transmit Empty state */ | ||
| 928 | #define MODEM_DTR 0x02 /* DTR modem output state */ | ||
| 929 | #define MODEM_RTS 0x01 /* RTS modem output state */ | ||
| 930 | |||
| 931 | /* PortStatus definitions... */ | ||
| 932 | #define PORT_ISOPEN 0x01 /* Port open ? */ | ||
| 933 | #define PORT_HUPCL 0x02 /* Hangup on close? */ | ||
| 934 | #define PORT_MOPENPEND 0x04 /* Modem open pending */ | ||
| 935 | #define PORT_ISPARALLEL 0x08 /* Parallel port */ | ||
| 936 | #define PORT_BREAK 0x10 /* Port on break */ | ||
| 937 | #define PORT_STATUSPEND 0020 /* Status packet pending */ | ||
| 938 | #define PORT_BREAKPEND 0x40 /* Break packet pending */ | ||
| 939 | #define PORT_MODEMPEND 0x80 /* Modem status packet pending */ | ||
| 940 | |||
| 941 | /***************************************************************************** | ||
| 942 | ************************ ************************** | ||
| 943 | ************************ COMMAND_RUP - COMPLETE ************************** | ||
| 944 | ************************ ************************** | ||
| 945 | *****************************************************************************/ | ||
| 946 | |||
| 947 | /* (RIO->Driver,pre-emptive) | ||
| 948 | |||
| 949 | COMMAND_RUP - COMPLETE is sent in response to all port I/O control command | ||
| 950 | packets, except MEMDUMP and READ_REGISTER. | ||
| 951 | */ | ||
| 952 | #if 0 | ||
| 953 | #define PKT_Cmd (PKT_Data+0) /* Command code */ | ||
| 954 | #define PKT_PhbNum (PKT_Data+1) /* Port number wrt RTA */ | ||
| 955 | #define PKT_Cmd2 (PKT_Data+2) /* Command code copy */ | ||
| 956 | #endif | ||
| 957 | #define PKT_ModemStatus (PKT_Data+3) /* Modem signal status */ | ||
| 958 | #define PKT_PortStatus (PKT_Data+4) /* Port signal status */ | ||
| 959 | #if 0 | ||
| 960 | #define PKT_SubCmd (PKT_Data+5) /* Sub Command */ | ||
| 961 | #endif | ||
| 962 | |||
| 963 | /* ModemStatus definitions... */ | ||
| 964 | #define MODEM_DSR 0x80 /* Data Set Ready modem state */ | ||
| 965 | #define MODEM_CTS 0x40 /* Clear To Send modem state */ | ||
| 966 | #define MODEM_RI 0x20 /* Ring Indicate modem state */ | ||
| 967 | #define MODEM_CD 0x10 /* Carrier Detect modem state */ | ||
| 968 | #define MODEM_TSTOP 0x08 /* Transmit Stopped state */ | ||
| 969 | #define MODEM_TEMPTY 0x04 /* Transmit Empty state */ | ||
| 970 | #define MODEM_DTR 0x02 /* DTR modem output state */ | ||
| 971 | #define MODEM_RTS 0x01 /* RTS modem output state */ | ||
| 972 | |||
| 973 | /* PortStatus definitions... */ | ||
| 974 | #define PORT_ISOPEN 0x01 /* Port open ? */ | ||
| 975 | #define PORT_HUPCL 0x02 /* Hangup on close? */ | ||
| 976 | #define PORT_MOPENPEND 0x04 /* Modem open pending */ | ||
| 977 | #define PORT_ISPARALLEL 0x08 /* Parallel port */ | ||
| 978 | #define PORT_BREAK 0x10 /* Port on break */ | ||
| 979 | #define PORT_STATUSPEND 0020 /* Status packet pending */ | ||
| 980 | #define PORT_BREAKPEND 0x40 /* Break packet pending */ | ||
| 981 | #define PORT_MODEMPEND 0x80 /* Modem status packet pending */ | ||
| 982 | |||
| 983 | /***************************************************************************** | ||
| 984 | ******************** ******************** | ||
| 985 | ******************** COMMAND_RUP - COMPLETE - MEMDUMP ******************** | ||
| 986 | ******************** ******************** | ||
| 987 | *****************************************************************************/ | ||
| 988 | |||
| 989 | /* (RIO->Driver,pre-emptive) | ||
| 990 | |||
| 991 | COMMAND_RUP - COMPLETE - MEMDUMP is sent as an acknowledgement for a MEMDUMP | ||
| 992 | port I/O control command packet. | ||
| 993 | */ | ||
| 994 | #if 0 | ||
| 995 | #define PKT_Cmd (PKT_Data+0) /* Command code */ | ||
| 996 | #define PKT_PhbNum (PKT_Data+1) /* Port number wrt RTA */ | ||
| 997 | #define PKT_Cmd2 (PKT_Data+2) /* Command code copy */ | ||
| 998 | #define PKT_ModemStatus (PKT_Data+3) /* Modem signal status */ | ||
| 999 | #define PKT_PortStatus (PKT_Data+4) /* Port signal status */ | ||
| 1000 | #define PKT_SubCmd (PKT_Data+5) /* Sub Command */ | ||
| 1001 | #define PKT_Address (PKT_Data+6) /* Requested address */ | ||
| 1002 | #endif | ||
| 1003 | #define PKT_Dump (PKT_Data+8) /* 32bytes of requested dump data */ | ||
| 1004 | |||
| 1005 | /***************************************************************************** | ||
| 1006 | ***************** ***************** | ||
| 1007 | ***************** COMMAND_RUP - COMPLETE - READ_REGISTER ***************** | ||
| 1008 | ***************** ***************** | ||
| 1009 | *****************************************************************************/ | ||
| 1010 | |||
| 1011 | /* (RIO->Driver,pre-emptive) | ||
| 1012 | |||
| 1013 | COMMAND_RUP - COMPLETE - READ_REGISTER is sent as an acknowledgement for a | ||
| 1014 | READ_REGISTER port I/O control command packet. | ||
| 1015 | */ | ||
| 1016 | #if 0 | ||
| 1017 | #define PKT_Cmd (PKT_Data+0) /*Command code */ | ||
| 1018 | #define PKT_PhbNum (PKT_Data+1) /*Port number wrt RTA */ | ||
| 1019 | #define PKT_Cmd2 (PKT_Data+2) /* Command code copy */ | ||
| 1020 | #endif | ||
| 1021 | #define PKT_RegisterValue (PKT_Data+3) /* Modem signal status */ | ||
| 1022 | #if 0 | ||
| 1023 | #define PKT_PortStatus (PKT_Data+4) /* Port signal status */ | ||
| 1024 | #define PKT_SubCmd (PKT_Data+5) /* Sub Command */ | ||
| 1025 | #endif | ||
| 1026 | |||
| 1027 | /***************************************************************************** | ||
| 1028 | ********************* *********************** | ||
| 1029 | ********************* COMMAND_RUP - BREAK_RECEIVED *********************** | ||
| 1030 | ********************* *********************** | ||
| 1031 | *****************************************************************************/ | ||
| 1032 | |||
| 1033 | /* (RIO->Driver,pre-emptive) | ||
| 1034 | |||
| 1035 | COMMAND_RUP - BREAK_RECEIVED packets are sent when the port detects a receive BREAK signal. | ||
| 1036 | */ | ||
| 1037 | #if 0 | ||
| 1038 | #define PKT_Cmd (PKT_Data+0) /* Command code */ | ||
| 1039 | #define PKT_PhbNum (PKT_Data+1) /* Port number wrt RTA */ | ||
| 1040 | #define PKT_Cmd2 (PKT_Data+2) /* Command code copy */ | ||
| 1041 | #endif | ||
| 1042 | |||
| 1043 | /***************************************************************************** | ||
| 1044 | ********************* ************************* | ||
| 1045 | ********************* COMMAND_RUP - MODEM_STATUS ************************* | ||
| 1046 | ********************* ************************* | ||
| 1047 | *****************************************************************************/ | ||
| 1048 | |||
| 1049 | /* (RIO->Driver,pre-emptive) | ||
| 1050 | |||
| 1051 | COMMAND_RUP - MODEM_STATUS packets are sent whenever the port detects a | ||
| 1052 | change in the input modem signal states. | ||
| 1053 | |||
| 1054 | */ | ||
| 1055 | #if 0 | ||
| 1056 | #define PKT_Cmd (PKT_Data+0) /* Command code */ | ||
| 1057 | #define PKT_PhbNum (PKT_Data+1) /* Port number wrt RTA */ | ||
| 1058 | #define PKT_Cmd2 (PKT_Data+2) /* Command code copy */ | ||
| 1059 | #define PKT_ModemStatus (PKT_Data+3) /* Modem signal status */ | ||
| 1060 | #endif | ||
| 1061 | |||
| 1062 | /***************************************************************************** | ||
| 1063 | ************************ ************************* | ||
| 1064 | ************************ BOOT_RUP - BOOT_REQUEST ************************* | ||
| 1065 | ************************ ************************* | ||
| 1066 | *****************************************************************************/ | ||
| 1067 | |||
| 1068 | /* (RIO->Driver,pre-emptive) | ||
| 1069 | |||
| 1070 | BOOT_RUP - BOOT_REQUEST packets are sent to the Driver from RIO to request | ||
| 1071 | firmware code to load onto attached RTAs. | ||
| 1072 | */ | ||
| 1073 | #if 0 | ||
| 1074 | #define PKT_Cmd (PKT_Data+0) /* Command code */ | ||
| 1075 | #endif | ||
| 1076 | |||
| 1077 | /***************************************************************************** | ||
| 1078 | ************************ ************************ | ||
| 1079 | ************************ BOOT_RUP - BOOT_SEQUENCE ************************ | ||
| 1080 | ************************ ************************ | ||
| 1081 | *****************************************************************************/ | ||
| 1082 | |||
| 1083 | /* (Driver->RIO,pre-emptive) | ||
| 1084 | |||
| 1085 | BOOT_RUP - BOOT_SEQUENCE packets are sent from the Driver to RIO in response | ||
| 1086 | to a BOOT_RUP - BOOT_REQUEST packet. | ||
| 1087 | */ | ||
| 1088 | #if 0 | ||
| 1089 | #define PKT_Cmd (PKT_Data+0) /* Command code */ | ||
| 1090 | #endif | ||
| 1091 | #define PKT_NumPackets (PKT_Data+2) /* Packets required to load firmware */ | ||
| 1092 | #define PKT_LoadBase (PKT_Data+4) /* RTA firmware load address */ | ||
| 1093 | #define PKT_CodeSize (PKT_Data+6) /* Size of firmware in bytes */ | ||
| 1094 | #define PKT_CmdString (PKT_Data+8) /* Command string */ | ||
| 1095 | |||
| 1096 | /***************************************************************************** | ||
| 1097 | ************************ *********************** | ||
| 1098 | ************************ BOOT_RUP - BOOT_COMPLETED *********************** | ||
| 1099 | ************************ *********************** | ||
| 1100 | *****************************************************************************/ | ||
| 1101 | |||
| 1102 | /* (RIO->Driver,pre-emptive) | ||
| 1103 | |||
| 1104 | BOOT_RUP - BOOT_COMPLETE is sent to the Driver from RIO when downloading of | ||
| 1105 | RTA firmware has completed. | ||
| 1106 | */ | ||
| 1107 | #if 0 | ||
| 1108 | #define PKT_Cmd (PKT_Data+0) /* Command code */ | ||
| 1109 | #endif | ||
| 1110 | #define PKT_LinkNumber (PKT_Data+1) /* Link number RTA booted on */ | ||
| 1111 | #define PKT_SerialNumber (PKT_Data+2) /* 4 byte serial number */ | ||
| 1112 | |||
| 1113 | /***************************************************************************** | ||
| 1114 | ************************ *********************** | ||
| 1115 | ************************ BOOT_RUP - Packet Request *********************** | ||
| 1116 | ************************ *********************** | ||
| 1117 | *****************************************************************************/ | ||
| 1118 | |||
| 1119 | /* (RIO->Driver,pre-emptive) | ||
| 1120 | |||
| 1121 | BOOT_RUP packet without the PKT_CMD_BIT set in the PKT->len field is sent | ||
| 1122 | from RIO to the Driver as a request for a firmware boot packet. */ | ||
| 1123 | |||
| 1124 | #define PKT_SequenceNumber (PKT_Data+0) /* Packet sequence number */ | ||
| 1125 | |||
| 1126 | /***************************************************************************** | ||
| 1127 | *********************** *********************** | ||
| 1128 | *********************** BOOT_RUP - Packet Response *********************** | ||
| 1129 | *********************** *********************** | ||
| 1130 | *****************************************************************************/ | ||
| 1131 | |||
| 1132 | /* (Driver->RIO,pre-emptive) | ||
| 1133 | |||
| 1134 | In response to a BOOT_RUP boot packet request, the driver fills out the response | ||
| 1135 | packet with the 70 bytes of the requested sequence. | ||
| 1136 | */ | ||
| 1137 | #if 0 | ||
| 1138 | #define PKT_SequenceNumber (PKT_Data+0) /* Packet sequence number */ | ||
| 1139 | #endif | ||
| 1140 | #define PKT_FirmwarePacket (PKT_Data+2) /* Firmware packet */ | ||
| 1141 | |||
| 1142 | /***************************************************************************** | ||
| 1143 | **************************** **************************** | ||
| 1144 | **************************** BOOT_RUP - IFOAD **************************** | ||
| 1145 | **************************** **************************** | ||
| 1146 | *****************************************************************************/ | ||
| 1147 | |||
| 1148 | /* (Driver->RIO,pre-emptive) | ||
| 1149 | |||
| 1150 | BOOT_RUP - IFOAD packets are sent from the Driver to an RTA to cause the | ||
| 1151 | RTA to shut down and reboot. | ||
| 1152 | */ | ||
| 1153 | #if 0 | ||
| 1154 | #define PKT_Cmd (PKT_Data+0) /* Command code */ | ||
| 1155 | #endif | ||
| 1156 | #define PKT_IfoadId1 (PKT_Data+2) /* IFOAD Id 1 */ | ||
| 1157 | #define PKT_IfoadId2 (PKT_Data+3) /* IFOAD Id 2 */ | ||
| 1158 | |||
| 1159 | #define IFOADID1 0xAD | ||
| 1160 | #define IFOADID2 0xF0 | ||
| 1161 | |||
| 1162 | /***************************************************************************** | ||
| 1163 | ************************** *************************** | ||
| 1164 | ************************** BOOT_RUP - IDENTIFY *************************** | ||
| 1165 | ************************** *************************** | ||
| 1166 | *****************************************************************************/ | ||
| 1167 | |||
| 1168 | /* (Driver->RIO,pre-emptive) | ||
| 1169 | |||
| 1170 | BOOT_RUP - IDENTIFY packets are sent from the Driver to an RTA to cause the | ||
| 1171 | RTA to flash its LEDs for a period of time. | ||
| 1172 | */ | ||
| 1173 | #if 0 | ||
| 1174 | #define PKT_Cmd (PKT_Data+0) /* Command code */ | ||
| 1175 | #endif | ||
| 1176 | #define PKT_IdentifyId (PKT_Data+2) /* defines pattern to flash */ | ||
| 1177 | |||
| 1178 | /***************************************************************************** | ||
| 1179 | **************************** *************************** | ||
| 1180 | **************************** BOOT_RUP - ZOMBIE *************************** | ||
| 1181 | **************************** *************************** | ||
| 1182 | *****************************************************************************/ | ||
| 1183 | |||
| 1184 | /* (Driver->RIO,pre-emptive) | ||
| 1185 | |||
| 1186 | BOOT_RUP - ZOMBIE packets are sent from the Driver to an RTA to cause the | ||
| 1187 | RTA to shut down and flash it's LEDs. | ||
| 1188 | */ | ||
| 1189 | #if 0 | ||
| 1190 | #define PKT_Cmd (PKT_Data+0) /* Command code */ | ||
| 1191 | #endif | ||
| 1192 | #define PKT_ZombieId1 (PKT_Data+2) /* ZOMBIE Id 1 */ | ||
| 1193 | #define PKT_ZombieId2 (PKT_Data+3) /* ZOMBIE Id 2 */ | ||
| 1194 | |||
| 1195 | #define ZOMBIEID1 0x52 | ||
| 1196 | #define ZOMBIEID2 0x21 | ||
| 1197 | |||
| 1198 | /***************************************************************************** | ||
| 1199 | **************************** **************************** | ||
| 1200 | **************************** BOOT_RUP - UFOAD **************************** | ||
| 1201 | **************************** **************************** | ||
| 1202 | *****************************************************************************/ | ||
| 1203 | |||
| 1204 | /* (Driver->RIO,pre-emptive) | ||
| 1205 | |||
| 1206 | BOOT_RUP - UFOAD packets are sent from the Driver to an RTA to cause the RTA | ||
| 1207 | to ask it's neighbouring RTA to shut down and reboot. | ||
| 1208 | */ | ||
| 1209 | #if 0 | ||
| 1210 | #define PKT_Cmd (PKT_Data+0) /* Command code */ | ||
| 1211 | #define PKT_LinkNumber (PKT_Data+1) /* Link number of RTA to UFOAD */ | ||
| 1212 | #endif | ||
| 1213 | #define PKT_UfoadId1 (PKT_Data+2) /* UFOAD Id 1 */ | ||
| 1214 | #define PKT_UfoadId2 (PKT_Data+3) /* UFOAD Id 2 */ | ||
| 1215 | |||
| 1216 | #define UFOADID1 0x1E | ||
| 1217 | #define UFOADID2 0x0D | ||
| 1218 | |||
| 1219 | /***************************************************************************** | ||
| 1220 | **************************** **************************** | ||
| 1221 | **************************** BOOT_RUP - IWAIT **************************** | ||
| 1222 | **************************** **************************** | ||
| 1223 | *****************************************************************************/ | ||
| 1224 | |||
| 1225 | /* (Driver->RIO,pre-emptive) | ||
| 1226 | |||
| 1227 | BOOT_RUP - IWAIT packets are sent from the Driver to an RTA to cause the RTA | ||
| 1228 | to pause booting on the specified link for 30 seconds. | ||
| 1229 | */ | ||
| 1230 | #if 0 | ||
| 1231 | #define PKT_Cmd (PKT_Data+0) /* Command code */ | ||
| 1232 | #define PKT_LinkNumber (PKT_Data+1) /* Link number of RTA to UFOAD */ | ||
| 1233 | #endif | ||
| 1234 | #define PKT_IwaitId1 (PKT_Data+2) /* IWAIT Id 1 */ | ||
| 1235 | #define PKT_IwaitId2 (PKT_Data+3) /* IWAIT Id 2 */ | ||
| 1236 | |||
| 1237 | #define IWAITID1 0xDE | ||
| 1238 | #define IWAITID2 0xB1 | ||
| 1239 | |||
| 1240 | /***************************************************************************** | ||
| 1241 | ************************ *********************** | ||
| 1242 | ************************ ROUTE_RUP - ROUTE_REQUEST *********************** | ||
| 1243 | ************************ *********************** | ||
| 1244 | *****************************************************************************/ | ||
| 1245 | |||
| 1246 | /* (RIO->Driver,pre-emptive) | ||
| 1247 | |||
| 1248 | ROUTE_RUP - ROUTE_REQUEST packets are sent from a newly booted or connected | ||
| 1249 | RTA to a Driver to request an ID (RUP or unit number). | ||
| 1250 | */ | ||
| 1251 | #if 0 | ||
| 1252 | #define PKT_Cmd (PKT_Data+0) /* Command code */ | ||
| 1253 | #endif | ||
| 1254 | #define PKT_SerialNumber (PKT_Data+2) /* 4 byte serial number */ | ||
| 1255 | #define PKT_ModuleTypes (PKT_Data+6) /* RTA Module types */ | ||
| 1256 | |||
| 1257 | /* ModuleTypes definitions... */ | ||
| 1258 | #define MOD_BLANK 0x0F /* Blank plate attached */ | ||
| 1259 | #define MOD_RS232DB25 0x00 /* RS232 DB25 connector */ | ||
| 1260 | #define MOD_RS232RJ45 0x01 /* RS232 RJ45 connector */ | ||
| 1261 | #define MOD_RS422DB25 0x02 /* RS422 DB25 connector */ | ||
| 1262 | #define MOD_RS485DB25 0x03 /* RS485 DB25 connector */ | ||
| 1263 | #define MOD_PARALLEL 0x04 /* Centronics parallel */ | ||
| 1264 | |||
| 1265 | #define MOD2 0x08 /* Set to indicate Rev2 module */ | ||
| 1266 | |||
| 1267 | /***************************************************************************** | ||
| 1268 | ************************* ************************* | ||
| 1269 | ************************* ROUTE_RUP - ROUTE_FOAD ************************* | ||
| 1270 | ************************* ************************* | ||
| 1271 | *****************************************************************************/ | ||
| 1272 | |||
| 1273 | /* (Driver->RIO,pre-emptive) | ||
| 1274 | |||
| 1275 | ROUTE_RUP - ROUTE_FOAD packet is sent as a response to a ROUTE_RUP - ROUTE_REQUEST | ||
| 1276 | packet to cause the RTA to "Fall Over And Die"., i.e. shutdown and reboot. | ||
| 1277 | */ | ||
| 1278 | #if 0 | ||
| 1279 | #define PKT_Cmd (PKT_Data+0) /* Command code */ | ||
| 1280 | #endif | ||
| 1281 | #define PKT_RouteCmdString (PKT_Data+2) /* Command string */ | ||
| 1282 | |||
| 1283 | /***************************************************************************** | ||
| 1284 | *********************** *********************** | ||
| 1285 | *********************** ROUTE_RUP - ROUTE_ALLOCATE *********************** | ||
| 1286 | *********************** *********************** | ||
| 1287 | *****************************************************************************/ | ||
| 1288 | |||
| 1289 | /* (Driver->RIO,pre-emptive) | ||
| 1290 | |||
| 1291 | ROUTE_RUP - ROUTE_ALLOCATE packet is sent as a response to a ROUTE_RUP - ROUTE_REQUEST | ||
| 1292 | packet to allocate the RTA's Id number (RUP number 1..16) | ||
| 1293 | */ | ||
| 1294 | #if 0 | ||
| 1295 | #define PKT_Cmd (PKT_Data+0) /* Command code */ | ||
| 1296 | #endif | ||
| 1297 | #define PKT_IdNum (PKT_Data+1) /* RUP number for ports 1..8 */ | ||
| 1298 | #if 0 | ||
| 1299 | #define PKT_RouteCmdString (PKT_Data+2) /* Command string */ | ||
| 1300 | #endif | ||
| 1301 | #define PKT_IdNum2 (PKT_Data+0x17) /* RUP number for ports 9..16 */ | ||
| 1302 | |||
| 1303 | /***************************************************************************** | ||
| 1304 | *********************** *********************** | ||
| 1305 | *********************** ROUTE_RUP - ROUTE_TOPOLOGY *********************** | ||
| 1306 | *********************** *********************** | ||
| 1307 | *****************************************************************************/ | ||
| 1308 | |||
| 1309 | /* (RIO->Driver,pre-emptive) | ||
| 1310 | |||
| 1311 | ROUTE_RUP - ROUTE_TOPOLOGY packet is sent to inform the driver of an RTA's | ||
| 1312 | current link status. | ||
| 1313 | */ | ||
| 1314 | #if 0 | ||
| 1315 | #define PKT_Cmd (PKT_Data+0) /* Command code */ | ||
| 1316 | #endif | ||
| 1317 | #define PKT_Link1Rup (PKT_Data+2) /* Link 1 RUP number */ | ||
| 1318 | #define PKT_Link1Link (PKT_Data+3) /* Link 1 link number */ | ||
| 1319 | #define PKT_Link2Rup (PKT_Data+4) /* Link 2 RUP number */ | ||
| 1320 | #define PKT_Link2Link (PKT_Data+5) /* Link 2 link number */ | ||
| 1321 | #define PKT_Link3Rup (PKT_Data+6) /* Link 3 RUP number */ | ||
| 1322 | #define PKT_Link3Link (PKT_Data+7) /* Link 3 link number */ | ||
| 1323 | #define PKT_Link4Rup (PKT_Data+8) /* Link 4 RUP number */ | ||
| 1324 | #define PKT_Link4Link (PKT_Data+9) /* Link 4 link number */ | ||
| 1325 | #define PKT_RtaVpdProm (PKT_Data+10) /* 32 bytes of RTA VPD PROM Contents */ | ||
| 1326 | |||
| 1327 | #endif /* _sxwinif_h */ | ||
| 1328 | |||
| 1329 | /* End of RIOWINIF.H */ | ||
diff --git a/drivers/char/rio/riscos.h b/drivers/char/rio/riscos.h deleted file mode 100644 index 60d66d0056ae..000000000000 --- a/drivers/char/rio/riscos.h +++ /dev/null | |||
| @@ -1,63 +0,0 @@ | |||
| 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 : riscos.h | ||
| 24 | ** SID : 1.2 | ||
| 25 | ** Last Modified : 11/6/98 11:34:19 | ||
| 26 | ** Retrieved : 11/6/98 11:34:22 | ||
| 27 | ** | ||
| 28 | ** ident @(#)riscos.h 1.2 | ||
| 29 | ** | ||
| 30 | ** ----------------------------------------------------------------------------- | ||
| 31 | */ | ||
| 32 | |||
| 33 | #ifndef __rio_riscos_h__ | ||
| 34 | #define __rio_riscos_h__ | ||
| 35 | |||
| 36 | #ifdef SCCS_LABELS | ||
| 37 | static char *_riscos_h_sccs_ = "@(#)riscos.h 1.2"; | ||
| 38 | #endif | ||
| 39 | |||
| 40 | /* | ||
| 41 | ** This module used to define all those little itsy bits required for RISC/OS | ||
| 42 | ** now it's full of null macros. | ||
| 43 | */ | ||
| 44 | |||
| 45 | /* | ||
| 46 | ** RBYTE reads a byte from a location. | ||
| 47 | ** RWORD reads a word from a location. | ||
| 48 | ** WBYTE writes a byte to a location. | ||
| 49 | ** WWORD writes a word to a location. | ||
| 50 | ** RINDW reads a word through a pointer. | ||
| 51 | ** WINDW writes a word through a pointer. | ||
| 52 | ** RIOSWAB swaps the two bytes of a word, if needed. | ||
| 53 | */ | ||
| 54 | |||
| 55 | #define RIOSWAB(N) (N) | ||
| 56 | #define WBYTE(A,V) (A)=(uchar)(V) | ||
| 57 | #define WWORD(A,V) (A)=(ushort)(V) | ||
| 58 | #define RBYTE(A) (uchar)(A) | ||
| 59 | #define RWORD(A) (ushort)(A) | ||
| 60 | #define RINDW(A) (*(ushort *)(A)) | ||
| 61 | #define WINDW(A,V) (*(ushort *)(A)=(ushort)(V)) | ||
| 62 | |||
| 63 | #endif /* __rio_riscos_h__ */ | ||
diff --git a/drivers/char/rio/rtahw.h b/drivers/char/rio/rtahw.h deleted file mode 100644 index e6c2cdfd3a1f..000000000000 --- a/drivers/char/rio/rtahw.h +++ /dev/null | |||
| @@ -1,75 +0,0 @@ | |||
| 1 | |||
| 2 | /**************************************************************************** | ||
| 3 | ******* ******* | ||
| 4 | ******* R T A H A R D W A R E | ||
| 5 | ******* ******* | ||
| 6 | **************************************************************************** | ||
| 7 | |||
| 8 | Author : Ian Nandhra | ||
| 9 | Date : | ||
| 10 | |||
| 11 | * | ||
| 12 | * (C) 1990 - 2000 Specialix International Ltd., Byfleet, Surrey, UK. | ||
| 13 | * | ||
| 14 | * This program is free software; you can redistribute it and/or modify | ||
| 15 | * it under the terms of the GNU General Public License as published by | ||
| 16 | * the Free Software Foundation; either version 2 of the License, or | ||
| 17 | * (at your option) any later version. | ||
| 18 | * | ||
| 19 | * This program is distributed in the hope that it will be useful, | ||
| 20 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 21 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 22 | * GNU General Public License for more details. | ||
| 23 | * | ||
| 24 | * You should have received a copy of the GNU General Public License | ||
| 25 | * along with this program; if not, write to the Free Software | ||
| 26 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | ||
| 27 | |||
| 28 | Version : 0.01 | ||
| 29 | |||
| 30 | |||
| 31 | Mods | ||
| 32 | ---------------------------------------------------------------------------- | ||
| 33 | Date By Description | ||
| 34 | ---------------------------------------------------------------------------- | ||
| 35 | |||
| 36 | ***************************************************************************/ | ||
| 37 | |||
| 38 | #ifndef lint | ||
| 39 | #ifdef SCCS_LABELS | ||
| 40 | static char *_rio_rtahw_h_sccs = "@(#)rtahw.h 1.5"; | ||
| 41 | #endif | ||
| 42 | #endif | ||
| 43 | |||
| 44 | #define WATCHDOG_ADDR ((unsigned short *)0x7a00) | ||
| 45 | #define RTA_LED_ADDR ((unsigned short *)0x7c00) | ||
| 46 | #define SERIALNUM_ADDR ((unsigned char *)0x7809) | ||
| 47 | #define LATCH_ADDR ((unsigned char *)0x7800) | ||
| 48 | |||
| 49 | /* | ||
| 50 | ** Here we define where the cd1400 chips are in memory. | ||
| 51 | */ | ||
| 52 | #define CD1400_ONE_ADDR (0x7300) | ||
| 53 | #define CD1400_TWO_ADDR (0x7200) | ||
| 54 | #define CD1400_THREE_ADDR (0x7100) | ||
| 55 | #define CD1400_FOUR_ADDR (0x7000) | ||
| 56 | |||
| 57 | /* | ||
| 58 | ** Define the different types of modules we can have | ||
| 59 | */ | ||
| 60 | enum module { | ||
| 61 | MOD_BLANK = 0x0f, /* Blank plate attached */ | ||
| 62 | MOD_RS232DB25 = 0x00, /* RS232 DB25 connector */ | ||
| 63 | MOD_RS232RJ45 = 0x01, /* RS232 RJ45 connector */ | ||
| 64 | MOD_RS422DB25 = 0x02, /* RS422 DB25 connector */ | ||
| 65 | MOD_RS485DB25 = 0x03, /* RS485 DB25 connector */ | ||
| 66 | MOD_PARALLEL = 0x04 /* Centronics parallel */ | ||
| 67 | }; | ||
| 68 | |||
| 69 | #define TYPE_HOST 0 | ||
| 70 | #define TYPE_RTA8 1 | ||
| 71 | #define TYPE_RTA16 2 | ||
| 72 | |||
| 73 | #define WATCH_DOG WATCHDOG_ADDR | ||
| 74 | |||
| 75 | /*********** end of file ***********/ | ||
diff --git a/drivers/char/rio/rupstat.h b/drivers/char/rio/rupstat.h deleted file mode 100644 index 56d828c63d28..000000000000 --- a/drivers/char/rio/rupstat.h +++ /dev/null | |||
| @@ -1,50 +0,0 @@ | |||
| 1 | /**************************************************************************** | ||
| 2 | ******* ******* | ||
| 3 | ******* RUPSTAT | ||
| 4 | ******* ******* | ||
| 5 | **************************************************************************** | ||
| 6 | |||
| 7 | Author : Jeremy Rolls | ||
| 8 | Date : | ||
| 9 | |||
| 10 | * | ||
| 11 | * (C) 1990 - 2000 Specialix International Ltd., Byfleet, Surrey, UK. | ||
| 12 | * | ||
| 13 | * This program is free software; you can redistribute it and/or modify | ||
| 14 | * it under the terms of the GNU General Public License as published by | ||
| 15 | * the Free Software Foundation; either version 2 of the License, or | ||
| 16 | * (at your option) any later version. | ||
| 17 | * | ||
| 18 | * This program is distributed in the hope that it will be useful, | ||
| 19 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 20 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 21 | * GNU General Public License for more details. | ||
| 22 | * | ||
| 23 | * You should have received a copy of the GNU General Public License | ||
| 24 | * along with this program; if not, write to the Free Software | ||
| 25 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | ||
| 26 | |||
| 27 | Version : 0.01 | ||
| 28 | |||
| 29 | |||
| 30 | Mods | ||
| 31 | ---------------------------------------------------------------------------- | ||
| 32 | Date By Description | ||
| 33 | ---------------------------------------------------------------------------- | ||
| 34 | |||
| 35 | ***************************************************************************/ | ||
| 36 | |||
| 37 | #ifndef _rupstat_h | ||
| 38 | #define _rupstat_h | ||
| 39 | |||
| 40 | #ifndef lint | ||
| 41 | #ifdef SCCS_LABELS | ||
| 42 | static char *_rio_rupstat_h_sccs = "@(#)rupstat.h 1.1"; | ||
| 43 | #endif | ||
| 44 | #endif | ||
| 45 | |||
| 46 | #define STATUS_SYNC 0 | ||
| 47 | #define STATUS_REQ_TOP 1 | ||
| 48 | #define STATUS_TOPOLOGY 2 | ||
| 49 | |||
| 50 | #endif | ||
diff --git a/drivers/char/rio/selftest.h b/drivers/char/rio/selftest.h deleted file mode 100644 index 7a3dba352323..000000000000 --- a/drivers/char/rio/selftest.h +++ /dev/null | |||
| @@ -1,73 +0,0 @@ | |||
| 1 | /* | ||
| 2 | ** File: selftest.h | ||
| 3 | ** | ||
| 4 | ** Author: David Dix | ||
| 5 | ** | ||
| 6 | ** Created: 15th March 1993 | ||
| 7 | ** | ||
| 8 | ** Last modified: 94/06/14 | ||
| 9 | ** | ||
| 10 | * | ||
| 11 | * (C) 1990 - 2000 Specialix International Ltd., Byfleet, Surrey, UK. | ||
| 12 | * | ||
| 13 | * This program is free software; you can redistribute it and/or modify | ||
| 14 | * it under the terms of the GNU General Public License as published by | ||
| 15 | * the Free Software Foundation; either version 2 of the License, or | ||
| 16 | * (at your option) any later version. | ||
| 17 | * | ||
| 18 | * This program is distributed in the hope that it will be useful, | ||
| 19 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 20 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 21 | * GNU General Public License for more details. | ||
| 22 | * | ||
| 23 | * You should have received a copy of the GNU General Public License | ||
| 24 | * along with this program; if not, write to the Free Software | ||
| 25 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | ||
| 26 | */ | ||
| 27 | |||
| 28 | #ifndef _selftests_h_ | ||
| 29 | #define _selftests_h_ | ||
| 30 | |||
| 31 | /* | ||
| 32 | ** Selftest identifier... | ||
| 33 | */ | ||
| 34 | #define SELFTEST_MAGIC 0x5a5a | ||
| 35 | |||
| 36 | /* | ||
| 37 | ** This is the structure of the packet that is sent back after each | ||
| 38 | ** selftest on a booting RTA. | ||
| 39 | */ | ||
| 40 | typedef struct { | ||
| 41 | short magic; /* Identifies packet type */ | ||
| 42 | int test; /* Test number, see below */ | ||
| 43 | unsigned int result; /* Result value */ | ||
| 44 | unsigned int dataIn; | ||
| 45 | unsigned int dataOut; | ||
| 46 | } selftestStruct; | ||
| 47 | |||
| 48 | /* | ||
| 49 | ** The different tests are identified by the following data values. | ||
| 50 | */ | ||
| 51 | enum test { | ||
| 52 | TESTS_COMPLETE = 0x00, | ||
| 53 | MEMTEST_ADDR = 0x01, | ||
| 54 | MEMTEST_BIT = 0x02, | ||
| 55 | MEMTEST_FILL = 0x03, | ||
| 56 | MEMTEST_DATABUS = 0x04, | ||
| 57 | MEMTEST_ADDRBUS = 0x05, | ||
| 58 | CD1400_INIT = 0x10, | ||
| 59 | CD1400_LOOP = 0x11, | ||
| 60 | CD1400_INTERRUPT = 0x12 | ||
| 61 | }; | ||
| 62 | |||
| 63 | enum result { | ||
| 64 | E_PORT = 0x10, | ||
| 65 | E_TX = 0x11, | ||
| 66 | E_RX = 0x12, | ||
| 67 | E_EXCEPT = 0x13, | ||
| 68 | E_COMPARE = 0x14, | ||
| 69 | E_MODEM = 0x15, | ||
| 70 | E_TIMEOUT = 0x16, | ||
| 71 | E_INTERRUPT = 0x17 | ||
| 72 | }; | ||
| 73 | #endif /* _selftests_h_ */ | ||
diff --git a/drivers/char/rio/sysmap.h b/drivers/char/rio/sysmap.h deleted file mode 100644 index e1c6f1160dff..000000000000 --- a/drivers/char/rio/sysmap.h +++ /dev/null | |||
| @@ -1,62 +0,0 @@ | |||
| 1 | |||
| 2 | /**************************************************************************** | ||
| 3 | ******* ******* | ||
| 4 | ******* S Y S T E M M A P H E A D E R | ||
| 5 | ******* ******* | ||
| 6 | **************************************************************************** | ||
| 7 | |||
| 8 | Author : Ian Nandhra | ||
| 9 | Date : | ||
| 10 | |||
| 11 | * | ||
| 12 | * (C) 1990 - 2000 Specialix International Ltd., Byfleet, Surrey, UK. | ||
| 13 | * | ||
| 14 | * This program is free software; you can redistribute it and/or modify | ||
| 15 | * it under the terms of the GNU General Public License as published by | ||
| 16 | * the Free Software Foundation; either version 2 of the License, or | ||
| 17 | * (at your option) any later version. | ||
| 18 | * | ||
| 19 | * This program is distributed in the hope that it will be useful, | ||
| 20 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 21 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 22 | * GNU General Public License for more details. | ||
| 23 | * | ||
| 24 | * You should have received a copy of the GNU General Public License | ||
| 25 | * along with this program; if not, write to the Free Software | ||
| 26 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | ||
| 27 | |||
| 28 | Version : 0.01 | ||
| 29 | |||
| 30 | |||
| 31 | Mods | ||
| 32 | ---------------------------------------------------------------------------- | ||
| 33 | Date By Description | ||
| 34 | ---------------------------------------------------------------------------- | ||
| 35 | |||
| 36 | ***************************************************************************/ | ||
| 37 | |||
| 38 | #ifndef lint | ||
| 39 | #ifdef SCCS_LABELS | ||
| 40 | static char *_rio_sysmap_h_sccs = "@(#)sysmap.h 1.1"; | ||
| 41 | #endif | ||
| 42 | #endif | ||
| 43 | |||
| 44 | #define SYSTEM_MAP_LEN 64 /* Len of System Map array */ | ||
| 45 | |||
| 46 | |||
| 47 | typedef struct SYS_MAP SYS_MAP; | ||
| 48 | typedef struct SYS_MAP_LINK SYS_MAP_LINK; | ||
| 49 | |||
| 50 | struct SYS_MAP_LINK { | ||
| 51 | short id; /* Unit Id */ | ||
| 52 | short link; /* Id's Link */ | ||
| 53 | short been_here; /* Used by map_gen */ | ||
| 54 | }; | ||
| 55 | |||
| 56 | struct SYS_MAP { | ||
| 57 | char serial_num[4]; | ||
| 58 | SYS_MAP_LINK link[4]; | ||
| 59 | }; | ||
| 60 | |||
| 61 | |||
| 62 | /*********** end of file ***********/ | ||
diff --git a/drivers/char/rio/timeouts.h b/drivers/char/rio/timeouts.h deleted file mode 100644 index a8b5be3ca9bf..000000000000 --- a/drivers/char/rio/timeouts.h +++ /dev/null | |||
| @@ -1,50 +0,0 @@ | |||
| 1 | |||
| 2 | /**************************************************************************** | ||
| 3 | ******* ******* | ||
| 4 | ******* T I M E O U T S | ||
| 5 | ******* ******* | ||
| 6 | **************************************************************************** | ||
| 7 | |||
| 8 | Author : Ian Nandhra | ||
| 9 | Date : | ||
| 10 | |||
| 11 | * | ||
| 12 | * (C) 1990 - 2000 Specialix International Ltd., Byfleet, Surrey, UK. | ||
| 13 | * | ||
| 14 | * This program is free software; you can redistribute it and/or modify | ||
| 15 | * it under the terms of the GNU General Public License as published by | ||
| 16 | * the Free Software Foundation; either version 2 of the License, or | ||
| 17 | * (at your option) any later version. | ||
| 18 | * | ||
| 19 | * This program is distributed in the hope that it will be useful, | ||
| 20 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 21 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 22 | * GNU General Public License for more details. | ||
| 23 | * | ||
| 24 | * You should have received a copy of the GNU General Public License | ||
| 25 | * along with this program; if not, write to the Free Software | ||
| 26 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | ||
| 27 | |||
| 28 | Version : 0.01 | ||
| 29 | |||
| 30 | |||
| 31 | Mods | ||
| 32 | ---------------------------------------------------------------------------- | ||
| 33 | Date By Description | ||
| 34 | ---------------------------------------------------------------------------- | ||
| 35 | |||
| 36 | ***************************************************************************/ | ||
| 37 | |||
| 38 | #ifndef lint | ||
| 39 | #ifdef SCCS_LABELS | ||
| 40 | static char *_rio_defaults_h_sccs = "@(#)timeouts.h 1.3"; | ||
| 41 | #endif | ||
| 42 | #endif | ||
| 43 | |||
| 44 | #define MILLISECOND (int) (1000/64) /* 15.625 low ticks */ | ||
| 45 | #define SECOND (int) 15625 /* Low priority ticks */ | ||
| 46 | |||
| 47 | #define TX_TIMEOUT (int) (200 * MILLISECOND) | ||
| 48 | |||
| 49 | |||
| 50 | /*********** end of file ***********/ | ||
