From owner-freebsd-hackers Tue Jan 23 18:32:53 1996 Return-Path: owner-hackers Received: (from root@localhost) by freefall.freebsd.org (8.7.3/8.7.3) id SAA09480 for hackers-outgoing; Tue, 23 Jan 1996 18:32:53 -0800 (PST) Received: from frig.mt.cs.keio.ac.jp (frig.mt.cs.keio.ac.jp [131.113.32.7]) by freefall.freebsd.org (8.7.3/8.7.3) with SMTP id SAA09458 for ; Tue, 23 Jan 1996 18:32:47 -0800 (PST) Received: (from hosokawa@localhost) by frig.mt.cs.keio.ac.jp (8.6.12+2.4W/3.4Wbeta3) id LAA25873; Wed, 24 Jan 1996 11:32:10 +0900 Date: Wed, 24 Jan 1996 11:32:10 +0900 Message-Id: <199601240232.LAA25873@frig.mt.cs.keio.ac.jp> To: jkh@freefall.freebsd.org Cc: hackers@freebsd.org, hosokawa@mt.cs.keio.ac.jp Subject: Re: PCMCIA stuff. In-Reply-To: Your message of Tue, 23 Jan 1996 14:11:53 -0800 (PST). <199601232211.OAA22552@freefall.freebsd.org> From: hosokawa@mt.cs.keio.ac.jp (HOSOKAWA Tatsumi) X-Mailer: mnews [version 1.18PL3] 1994-08/01(Mon) Sender: owner-hackers@freebsd.org Precedence: bulk In article <199601232211.OAA22552@freefall.freebsd.org> jkh@freefall.freebsd.org writes: >> The workings of `pccardsetup' need to be re-thought somewhat. Of course. >> Another problem I ran into was that it wasn't clear just which drivers >> were now obsolete and which weren't. You should document, for example, >> the fact that your former ze0 device (for example) will be ed0 under >> the new system. ze0 and zp0 is obsolete on my system. >> Finally, I was unable to have the pccard stuff recognise my US Robotics >> 14.4K Fax modem card and the almost complete lack of documentation on the >> format of the pccard database file pretty much prevents me from crafting >> one that works. I've tried all the obvious stuff, cloning the >> USR 28.8K entry and adjusting the mfr and model strings to match >> my card, but I still get `unknown type 209' on startup and am >> also somewhat unsure as to how to get it to configure itself as sio1 >> (I have only one built-in serial port on the laptop). Any clues >> would be most appreciated as this is the modem I'd like to use from my >> Hotel room at USENIX! :-) Okay, for example, the case you plug in the Megahertz XJ2144 FAX/Data Modem into your laptop: PCMCIA cards has its configuration information in its ROM, named "CIS" (The Card Information Structure). You can read these parameters by using 'pccardc' command. Type # pccardc dumpcis and you get, ----------------------------------------------------------------------- Code 128 not found Code 128 not found code Unknown ignored Configuration data for card in slot 0 Tuple #1, code = 0x1 (Common memory descriptor), length = 3 000: 00 00 ff Common memory device information: Device number 1, type No device, WPS = OFF Speed = No speed, Memory block size = 512b, 1 units Tuple #2, code = 0x15 (Version 1 info), length = 36 000: 04 01 4d 45 47 41 48 45 52 54 5a 00 58 4a 32 31 010: 34 34 00 41 35 00 50 43 4d 43 49 41 20 4d 4f 44 020: 45 4d 00 ff Version = 4.1, Manuf = [MEGAHERTZ],card vers = [XJ2144] Addit. info = [A5],[PCMCIA MODEM] Tuple #3, code = 0x20 (Manufacturer ID), length = 4 000: 02 01 05 00 PCMCIA ID = 0x102, OEM ID = 0x5 Tuple #4, code = 0x21 (Functional ID), length = 2 000: 02 01 Serial port/modem - POST initialize Tuple #5, code = 0x1a (Configuration map), length = 5 000: 01 23 00 02 01 Reg len = 2, config register addr = 0x200, last config = 0x23 Registers: X------- Tuple #6, code = 0x1b (Configuration entry), length = 16 000: e0 01 1d 48 6d 2d fc 14 a0 60 f8 03 07 30 3c 00 Config index = 0x20(default) Interface byte = 0x1 (I/O) Vcc pwr: Continuous supply current: 7 x 10mA Power down supply current: 2.5 x 10mA Wait scale Speed = 1.2 x 10 us Card decodes 20 address lines IRQ modes: IRQs: BERR 2 4 13 15 Tuple #7, code = 0x1b (Configuration entry), length = 7 000: 21 08 a0 60 f8 02 07 Config index = 0x21 Card provides address decode, 8 Bit I/O only I/O address # 1: block start = 0x2f8 block length = 0x8 Tuple #8, code = 0x1b (Configuration entry), length = 7 000: 22 08 a0 60 e8 03 07 Config index = 0x22 Card provides address decode, 8 Bit I/O only I/O address # 1: block start = 0x3e8 block length = 0x8 Tuple #9, code = 0x1b (Configuration entry), length = 7 000: 23 08 a0 60 e8 02 07 Config index = 0x23 Card provides address decode, 8 Bit I/O only I/O address # 1: block start = 0x2e8 block length = 0x8 Tuple #10, code = 0x22 (Functional EXT), length = 4 000: 00 02 0f 7f Serial interface extension: 16550 UART, Parity - Space,Mark,Odd,Even, Tuple #11, code = 0x22 (Functional EXT), length = 9 000: 01 1f 09 00 03 00 00 03 00 Modem interface capabilities: Tuple #12, code = 0x22 (Functional EXT), length = 12 000: 02 03 00 3f 1e 03 03 08 03 00 00 b5 Data modem services available: Tuple #13, code = 0x22 (Functional EXT), length = 8 000: 13 03 00 0f 00 02 00 b5 Tuple #14, code = 0x22 (Functional EXT), length = 8 000: 23 03 00 0f 00 02 00 b5 Tuple #15, code = 0x14 (No link), length = 0 Tuple #16, code = 0x0 (Null tuple), length = 2 000: 01 00 Tuple #17, code = 0xff (Terminator), length = 0 2 slots found ----------------------------------------------------------------------- At first, ----------------------------------------------------------------------- Tuple #2, code = 0x15 (Version 1 info), length = 36 000: 04 01 4d 45 47 41 48 45 52 54 5a 00 58 4a 32 31 010: 34 34 00 41 35 00 50 43 4d 43 49 41 20 4d 4f 44 020: 45 4d 00 ff Version = 4.1, Manuf = [MEGAHERTZ],card vers = [XJ2144] Addit. info = [A5],[PCMCIA MODEM] ----------------------------------------------------------------------- this CIS tupple describes the name of the card. Currently, pccardd uses only "Manuf", and "card vers" for identifying the cards. So, you must create a new entry ----------------------------------------------------------------------- card "MEGAHERTZ" "XJ2144" ----------------------------------------------------------------------- in '/etc/pccard.conf'. And next step, you must check the 'config index' CIS tupples. ----------------------------------------------------------------------- Tuple #6, code = 0x1b (Configuration entry), length = 16 000: e0 01 1d 48 6d 2d fc 14 a0 60 f8 03 07 30 3c 00 Config index = 0x20(default) Interface byte = 0x1 (I/O) Vcc pwr: Continuous supply current: 7 x 10mA Power down supply current: 2.5 x 10mA Wait scale Speed = 1.2 x 10 us Card decodes 20 address lines IRQ modes: IRQs: BERR 2 4 13 15 Tuple #7, code = 0x1b (Configuration entry), length = 7 000: 21 08 a0 60 f8 02 07 Config index = 0x21 Card provides address decode, 8 Bit I/O only I/O address # 1: block start = 0x2f8 block length = 0x8 Tuple #8, code = 0x1b (Configuration entry), length = 7 000: 22 08 a0 60 e8 03 07 Config index = 0x22 Card provides address decode, 8 Bit I/O only I/O address # 1: block start = 0x3e8 block length = 0x8 Tuple #9, code = 0x1b (Configuration entry), length = 7 000: 23 08 a0 60 e8 02 07 Config index = 0x23 Card provides address decode, 8 Bit I/O only I/O address # 1: block start = 0x2e8 block length = 0x8 ----------------------------------------------------------------------- In this case, 0x20 is the "default" configuration index. Default configuration index defines the common configuration parameters of all configuration indecies. Valid IRQs are defined in this tupple, but this parameter of some cards are unreliable. Actually, XJ2144 can use IRQ 10 and IRQ 11 though abobe example says that only 2, 4, 13, and 15 are allowed. I assume that you uses IRQ 10 for this card in the following example. In the above instance, the configuration indices 0x21, 0x22, and 0x23 are correspond to COM2, COM3 and COM4 respectively (see the I/O address window of these CIS tupples). If your machine has no sio1 (COM2) interface, you can prefer configuration index 0x21. So, card "MEGAHERTZ" "XJ2144" config 0x21 "sio1" 10 It means, "If the card is identified as 'XJ2144' of 'MEGAHERTZ', I want to map 0x21 configuration tupple onto "sio1" and allocate IRQ 10 for this interface." If your laptop has already had "sio1" interface (for example, IrDA or Serial Mouse) on board, you can't use 0x21 index. So you must use 0x22 or 0x23 indices and "sio2" or "sio3" (or "sio4"...., if configured) interfaces. This is the reason why I used 0x23 and "sio2" in 'pccard.conf.sample'. Most laptop machine has only two interfaces at most. 'insert' and 'remove' options are not necessary. It enables automatic ifconfig, DHCP invocation, Virtual IP address allocation, etc. Don Anderson "PCMCIA System Architecture" (Addison Wesley, 1995) ISBN 0-201-40991-7 is good introduction to the PCMCIA architecture. -- HOSOKAWA, Tatsumi E-mail: hosokawa@mt.cs.keio.ac.jp WWW homepage: http://www.mt.cs.keio.ac.jp/person/hosokawa.html Department of Computer Science, Keio University, Yokohama, Japan