11926Swollman/*	$NetBSD: nma.c,v 1.5 2009/10/20 00:51:13 snj Exp $	*/
21926Swollman
31926Swollman/*
41926Swollman * Copyright (c) 1995 Mats O Jansson.  All rights reserved.
51926Swollman *
61926Swollman * Redistribution and use in source and binary forms, with or without
71926Swollman * modification, are permitted provided that the following conditions
81926Swollman * are met:
91926Swollman * 1. Redistributions of source code must retain the above copyright
101926Swollman *    notice, this list of conditions and the following disclaimer.
111926Swollman * 2. Redistributions in binary form must reproduce the above copyright
121926Swollman *    notice, this list of conditions and the following disclaimer in the
131926Swollman *    documentation and/or other materials provided with the distribution.
141926Swollman *
151926Swollman * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
161926Swollman * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
171926Swollman * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
181926Swollman * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
191926Swollman * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
201926Swollman * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
211926Swollman * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
221926Swollman * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
231926Swollman * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
241926Swollman * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
251926Swollman */
261926Swollman
271926Swollman#include <sys/cdefs.h>
281926Swollman#ifndef lint
291926Swollman__RCSID("$NetBSD: nma.c,v 1.5 2009/10/20 00:51:13 snj Exp $");
301926Swollman#endif
3190039Sobrien
321926Swollman#include "os.h"
3390039Sobrien#include "nma.h"
3490039Sobrien#include "nmadef.h"
351926Swollman
361926Swollmanstruct commDev {
371926Swollman	int		val;
381926Swollman	const char	*sname;
3917145Swollman	const char	*name;
4017145Swollman};
4117145Swollman
421926Swollmanstruct commDev nmaCommDev[] = {
431926Swollman	{ NMA_C_SOFD_DP , "DP ", "DP11-DA" },
441926Swollman	{ NMA_C_SOFD_UNA, "UNA", "DEUNA" },
451926Swollman	{ NMA_C_SOFD_DU , "DU ", "DU11-DA" },
461926Swollman	{ NMA_C_SOFD_CNA, "CNA", "DECNA" },
471926Swollman	{ NMA_C_SOFD_DL , "DL ", "DL11-C, -E, or -WA" },
481926Swollman	{ NMA_C_SOFD_QNA, "QNA", "DEQNA" },
491926Swollman	{ NMA_C_SOFD_DQ , "DQ ", "DQ11-DA" },
5017282Swollman	{ NMA_C_SOFD_CI , "CI ", "Computer Interconnect" },
511926Swollman	{ NMA_C_SOFD_DA , "DA ", "DA11-B or -AL" },
521926Swollman	{ NMA_C_SOFD_PCL, "PCL", "PCL11-B" },
531926Swollman	{ NMA_C_SOFD_DUP, "DUP", "DUP11-DA" },
541926Swollman	{ NMA_C_SOFD_LUA, "LUA", "DELUA" },
551926Swollman	{ NMA_C_SOFD_DMC, "DMC", "DMC11-DA/AR, -FA/AR, -MA/AL or -MD/AL" },
56	{ NMA_C_SOFD_LNA, "LNA", "MicroServer Lance" },
57	{ NMA_C_SOFD_DN , "DN ", "DN11-BA or -AA" },
58	{ NMA_C_SOFD_DLV, "DLV", "DLV11-E, -F, -J, MXV11-A or -B" },
59	{ NMA_C_SOFD_LCS, "LCS", "DECServer 100" },
60	{ NMA_C_SOFD_DMP, "DMP", "DMP11" },
61	{ NMA_C_SOFD_AMB, "AMB", "AMBER" },
62	{ NMA_C_SOFD_DTE, "DTE", "DTE20" },
63	{ NMA_C_SOFD_DBT, "DBT", "DEBET" },
64	{ NMA_C_SOFD_DV , "DV ", "DV11-AA/BA" },
65	{ NMA_C_SOFD_BNA, "BNA", "DEBNA" },
66	{ NMA_C_SOFD_BNT, "BNT", "DEBNT" },
67	{ NMA_C_SOFD_DZ , "DZ ", "DZ11-A, -B, -C, -D" },
68	{ NMA_C_SOFD_LPC, "LPC", "PCXX" },
69	{ NMA_C_SOFD_DSV, "DSV", "DSV11" },
70	{ NMA_C_SOFD_CEC, "CEC", "3-COM/IBM-PC" },
71	{ NMA_C_SOFD_KDP, "KDP", "KMC11/DUP11-DA" },
72	{ NMA_C_SOFD_IEC, "IEC", "Interlan/IBM-PC" },
73	{ NMA_C_SOFD_KDZ, "KDZ", "KMC11/DZ11-A, -B, -C, or -D" },
74	{ NMA_C_SOFD_UEC, "UEC", "Univation/RAINBOW-100" },
75	{ NMA_C_SOFD_KL8, "KL8", "KL8-J" },
76	{ NMA_C_SOFD_DS2, "DS2", "DECServer 200" },
77	{ NMA_C_SOFD_DMV, "DMV", "DMV11" },
78	{ NMA_C_SOFD_DS5, "DS5", "DECServer 500" },
79	{ NMA_C_SOFD_DPV, "DPV", "DPV11" },
80	{ NMA_C_SOFD_LQA, "LQA", "DELQA" },
81	{ NMA_C_SOFD_DMF, "DMF", "DMF32" },
82	{ NMA_C_SOFD_SVA, "SVA", "DESVA" },
83	{ NMA_C_SOFD_DMR, "DMR", "DMR11-AA, -AB, -AC, or -AE" },
84	{ NMA_C_SOFD_MUX, "MUX", "MUXserver" },
85	{ NMA_C_SOFD_KMY, "KMY", "KMS11-PX" },
86	{ NMA_C_SOFD_DEP, "DEP", "DEPCA PCSG/IBM-PC" },
87	{ NMA_C_SOFD_KMX, "KMX", "KMS11-BD/BE" },
88	{ NMA_C_SOFD_LTM, "LTM", "LTM Ethernet monitor" },
89	{ NMA_C_SOFD_DMB, "DMB", "DMB-32" },
90	{ NMA_C_SOFD_DES, "DES", "DESNC" },
91	{ NMA_C_SOFD_KCP, "KCP", "KCP" },
92	{ NMA_C_SOFD_MX3, "MX3", "MUXServer 300" },
93	{ NMA_C_SOFD_SYN, "SYN", "MicroServer" },
94	{ NMA_C_SOFD_MEB, "MEB", "DEMEB" },
95	{ NMA_C_SOFD_DSB, "DSB", "DSB32" },
96	{ NMA_C_SOFD_BAM, "BAM", "DEBAM LANBridge-200" },
97	{ NMA_C_SOFD_DST, "DST", "DST-32 TEAMmate" },
98	{ NMA_C_SOFD_FAT, "FAT", "DEFAT" },
99	{ NMA_C_SOFD_RSM, "RSM", "DERSM - Remote Segment Monitor" },
100	{ NMA_C_SOFD_RES, "RES", "DERES - Remote Environmental Sensor" },
101	{ NMA_C_SOFD_3C2, "3C2", "3COM Etherlink II (3C503)" },
102	{ NMA_C_SOFD_3CM, "3CM", "3COM Etherlink/MC (3C523)" },
103	{ NMA_C_SOFD_DS3, "DS3", "DECServer 300" },
104	{ NMA_C_SOFD_MF2, "MF2", "Mayfair-2" },
105	{ NMA_C_SOFD_MMR, "MMR", "DEMMR" },
106	{ NMA_C_SOFD_VIT, "VIT", "Vitalink TransLAN III/IV (NP3A) Bridge " },
107	{ NMA_C_SOFD_VT5, "VT5", "Vitalink TransLAN 350 (NPC25) Bridge " },
108	{ NMA_C_SOFD_BNI, "BNI", "DEBNI" },
109	{ NMA_C_SOFD_MNA, "MNA", "DEMNA" },
110	{ NMA_C_SOFD_PMX, "PMX", "PMAX (KN01)" },
111	{ NMA_C_SOFD_NI5, "NI5", "Interlan NI5210-8" },
112	{ NMA_C_SOFD_NI9, "NI9", "Interlan NI9210" },
113	{ NMA_C_SOFD_KMK, "KMK", "KMS11-K" },
114	{ NMA_C_SOFD_3CP, "3CP", "3COM Etherlink Plus (3C505) " },
115	{ NMA_C_SOFD_DP2, "DP2", "DPNserver-200" },
116	{ NMA_C_SOFD_ISA, "ISA", "SGEC" },
117	{ NMA_C_SOFD_DIV, "DIV", "DIV-32 DEC WAN controller-100" },
118	{ NMA_C_SOFD_QTA, "QTA", "DEQTA" },
119	{ NMA_C_SOFD_B15, "B15", "LANbridge-150" },
120	{ NMA_C_SOFD_WD8, "WD8", "WD8003 Family" },
121	{ NMA_C_SOFD_ILA, "ILA", "BICC ISOLAN 4110-2" },
122	{ NMA_C_SOFD_ILM, "ILM", "BICC ISOLAN 4110-3" },
123	{ NMA_C_SOFD_APR, "APR", "Apricot Xen-S and Qi" },
124	{ NMA_C_SOFD_ASN, "ASN", "AST EtherNode" },
125	{ NMA_C_SOFD_ASE, "ASE", "AST Ethernet" },
126	{ NMA_C_SOFD_TRW, "TRW", "TRW HC-2001" },
127	{ NMA_C_SOFD_EDX, "EDX", "Ethernet-XT/AT" },
128	{ NMA_C_SOFD_EDA, "EDA", "Ethernet-AT" },
129	{ NMA_C_SOFD_DR2, "DR2", "DECrouter-250" },
130	{ NMA_C_SOFD_SCC, "SCC", "DECrouter-250 DUSCC" },
131	{ NMA_C_SOFD_DCA, "DCA", "DCA Series 300" },
132	{ NMA_C_SOFD_TIA, "TIA", "LANcard/E" },
133	{ NMA_C_SOFD_FBN, "FBN", "DEFEB DECbridge-500" },
134	{ NMA_C_SOFD_FEB, "FEB", "DEFEB DECbridge-500 FDDI" },
135	{ NMA_C_SOFD_FCN, "FCN", "DEFCN DECconcentrator-500" },
136	{ NMA_C_SOFD_MFA, "MFA", "DEMFA" },
137	{ NMA_C_SOFD_MXE, "MXE", "MIPS workstation family" },
138	{ NMA_C_SOFD_CED, "CED", "Cabletron Ethernet Desktop" },
139	{ NMA_C_SOFD_C20, "C20", "3Com CS/200" },
140	{ NMA_C_SOFD_CS1, "CS1", "3Com CS/1" },
141	{ NMA_C_SOFD_C2M, "C2M", "3Com CS/210, CS/2000, CS/2100" },
142	{ NMA_C_SOFD_ACA, "ACA", "ACA/32000 system" },
143	{ NMA_C_SOFD_GSM, "GSM", "Gandalf StarMaster" },
144	{ NMA_C_SOFD_DSF, "DSF", "DSF32" },
145	{ NMA_C_SOFD_CS5, "CS5", "3Com CS/50" },
146	{ NMA_C_SOFD_XIR, "XIR", "XIRCOM PE10B2" },
147	{ NMA_C_SOFD_KFE, "KFE", "KFE52" },
148	{ NMA_C_SOFD_RT3, "RT3", "rtVAX-300" },
149	{ NMA_C_SOFD_SPI, "SPI", "Spiderport M250" },
150	{ NMA_C_SOFD_FOR, "FOR", "LAT gateway" },
151	{ NMA_C_SOFD_MER, "MER", "Meridian" },
152	{ NMA_C_SOFD_PER, "PER", "Persoft" },
153	{ NMA_C_SOFD_STR, "STR", "AT&T StarLan-10" },
154	{ NMA_C_SOFD_MPS, "MPS", "MIPSfair" },
155	{ NMA_C_SOFD_L20, "L20", "LPS20 print server" },
156	{ NMA_C_SOFD_VT2, "VT2", "Vitalink TransLAN 320 Bridge" },
157	{ NMA_C_SOFD_DWT, "DWT", "VT-1000" },
158	{ NMA_C_SOFD_WGB, "WGB", "DEWGB" },
159	{ NMA_C_SOFD_ZEN, "ZEN", "Zenith Z-LAN4000, Z-LAN" },
160	{ NMA_C_SOFD_TSS, "TSS", "Thursby Software Systems" },
161	{ NMA_C_SOFD_MNE, "MNE", "3MIN (KN02-BA)" },
162	{ NMA_C_SOFD_FZA, "FZA", "DEFZA" },
163	{ NMA_C_SOFD_90L, "90L", "DS90L" },
164	{ NMA_C_SOFD_CIS, "CIS", "Cisco Systems" },
165	{ NMA_C_SOFD_STC, "STC", "STRTC" },
166	{ NMA_C_SOFD_UBE, "UBE", "Ungermann-Bass PC2030, PC3030" },
167	{ NMA_C_SOFD_DW2, "DW2", "DECwindows terminal II" },
168	{ NMA_C_SOFD_FUE, "FUE", "Fujitsu Etherstar MB86950" },
169	{ NMA_C_SOFD_M38, "M38", "MUXServer 380" },
170	{ NMA_C_SOFD_NTI, "NTI", "NTI Group PC Ethernet Card" },
171	{ NMA_C_SOFD_RAD, "RAD", "RADLINX LAN Gateway" },
172	{ NMA_C_SOFD_INF, "INF", "Infotron Commix" },
173	{ NMA_C_SOFD_XMX, "XMX", "Xyplex MAXserver" },
174	{ NMA_C_SOFD_NDI, "NDI", "NDIS data link driver for MS/DOS systems" },
175	{ NMA_C_SOFD_ND2, "ND2", "NDIS data link driver for OS/2 systems" },
176	{ NMA_C_SOFD_TRN, "TRN", "DEC LANcontroller 520" },
177	{ NMA_C_SOFD_DEV, "DEV", "Develcon Electronics Ltd. LAT gateway" },
178	{ NMA_C_SOFD_ACE, "ACE", "Acer 5220, 5270 adapter" },
179	{ NMA_C_SOFD_PNT, "PNT", "ProNet-4/18 #1390" },
180	{ NMA_C_SOFD_ISE, "ISE", "Network Integration Server 600" },
181	{ NMA_C_SOFD_IST, "IST", "Network Integration Server 600 T1" },
182	{ NMA_C_SOFD_ISH, "ISH", "Network Integration Server 64 kb HDLC" },
183	{ NMA_C_SOFD_ISF, "ISF", "Network Integration Server 600 FDDI" },
184	{ NMA_C_SOFD_DSW, "DSW", "DSW-21" },
185	{ NMA_C_SOFD_DW4, "DW4", "DSW-41/42" },
186	{ NMA_C_SOFD_TRA, "TRA", "DETRA-AA" },
187	{ 0, 0, 0 },
188};
189
190const char *
191nmaGetShort(int devno)
192{
193	struct commDev *current;
194
195	current = nmaCommDev;
196
197	while (current->sname != NULL) {
198		if (current->val == devno)
199			break;
200		current++;
201	}
202
203	return(current->sname);
204}
205
206const char *
207nmaGetDevice(int devno)
208{
209	struct commDev *current;
210
211	current = nmaCommDev;
212
213	while (current->name != NULL) {
214		if (current->val == devno)
215			break;
216		current++;
217	}
218
219	return(current->name);
220}
221