Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 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 : map.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 @(#)map.h 1.2 |
| 29 | ** |
| 30 | ** ----------------------------------------------------------------------------- |
| 31 | */ |
| 32 | |
| 33 | #ifndef __rio_map_h__ |
| 34 | #define __rio_map_h__ |
| 35 | |
| 36 | #ifdef SCCS_LABELS |
| 37 | static char *_map_h_sccs_ = "@(#)map.h 1.2"; |
| 38 | #endif |
| 39 | |
| 40 | /* |
| 41 | ** mapping structure passed to and from the config.rio program to |
| 42 | ** determine the current topology of the world |
| 43 | */ |
| 44 | |
| 45 | #define MAX_MAP_ENTRY 17 |
| 46 | #define TOTAL_MAP_ENTRIES (MAX_MAP_ENTRY*RIO_SLOTS) |
| 47 | #define MAX_NAME_LEN 32 |
| 48 | |
Andrew Morton | 8d8706e | 2006-01-11 12:17:49 -0800 | [diff] [blame] | 49 | struct Map { |
Alan Cox | 57c2d60 | 2006-03-24 03:18:31 -0800 | [diff] [blame] | 50 | unsigned int HostUniqueNum; /* Supporting hosts unique number */ |
| 51 | unsigned int RtaUniqueNum; /* Unique number */ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 52 | /* |
Andrew Morton | 8d8706e | 2006-01-11 12:17:49 -0800 | [diff] [blame] | 53 | ** The next two IDs must be swapped on big-endian architectures |
| 54 | ** when using a v2.04 /etc/rio/config with a v3.00 driver (when |
| 55 | ** upgrading for example). |
| 56 | */ |
Alan Cox | 57c2d60 | 2006-03-24 03:18:31 -0800 | [diff] [blame] | 57 | unsigned short ID; /* ID used in the subnet */ |
| 58 | unsigned short ID2; /* ID of 2nd block of 8 for 16 port */ |
| 59 | unsigned long Flags; /* Booted, ID Given, Disconnected */ |
| 60 | unsigned long SysPort; /* First tty mapped to this port */ |
Andrew Morton | 8d8706e | 2006-01-11 12:17:49 -0800 | [diff] [blame] | 61 | struct Top Topology[LINKS_PER_UNIT]; /* ID connected to each link */ |
| 62 | char Name[MAX_NAME_LEN]; /* Cute name by which RTA is known */ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 63 | }; |
| 64 | |
| 65 | /* |
| 66 | ** Flag values: |
| 67 | */ |
| 68 | #define RTA_BOOTED 0x00000001 |
| 69 | #define RTA_NEWBOOT 0x00000010 |
| 70 | #define MSG_DONE 0x00000020 |
| 71 | #define RTA_INTERCONNECT 0x00000040 |
| 72 | #define RTA16_SECOND_SLOT 0x00000080 |
| 73 | #define BEEN_HERE 0x00000100 |
| 74 | #define SLOT_TENTATIVE 0x40000000 |
| 75 | #define SLOT_IN_USE 0x80000000 |
| 76 | |
| 77 | /* |
| 78 | ** HostUniqueNum is the unique number from the host card that this RTA |
| 79 | ** is to be connected to. |
| 80 | ** RtaUniqueNum is the unique number of the RTA concerned. It will be ZERO |
| 81 | ** if the slot in the table is unused. If it is the same as the HostUniqueNum |
| 82 | ** then this slot represents a host card. |
| 83 | ** Flags contains current boot/route state info |
| 84 | ** SysPort is a value in the range 0-504, being the number of the first tty |
| 85 | ** on this RTA. Each RTA supports 8 ports. The SysPort value must be modulo 8. |
| 86 | ** SysPort 0-127 correspond to /dev/ttyr001 to /dev/ttyr128, with minor |
| 87 | ** numbers 0-127. SysPort 128-255 correspond to /dev/ttyr129 to /dev/ttyr256, |
| 88 | ** again with minor numbers 0-127, and so on for SysPorts 256-383 and 384-511 |
| 89 | ** ID will be in the range 0-16 for a `known' RTA. ID will be 0xFFFF for an |
| 90 | ** unused slot/unknown ID etc. |
| 91 | ** The Topology array contains the ID of the unit connected to each of the |
| 92 | ** four links on this unit. The entry will be 0xFFFF if NOTHING is connected |
| 93 | ** to the link, or will be 0xFF00 if an UNKNOWN unit is connected to the link. |
| 94 | ** The Name field is a null-terminated string, upto 31 characters, containing |
| 95 | ** the 'cute' name that the sysadmin/users know the RTA by. It is permissible |
| 96 | ** for this string to contain any character in the range \040 to \176 inclusive. |
| 97 | ** In particular, ctrl sequences and DEL (0x7F, \177) are not allowed. The |
| 98 | ** special character '%' IS allowable, and needs no special action. |
| 99 | ** |
| 100 | */ |
| 101 | |
| 102 | #endif |