Title |
Configuring a PCMCIA card in QNX4 |
Ref. No. |
QNX.000009484 |
Category(ies) |
PCMCIA, Network, Filesystem, Configuration, Character I/O |
Issue |
How do you configure a PCMCIA card? |
Solution |
{Getting Started}
This readme gives quick information on how to install and configure the PCMCIA package. For more detailed information refer to the PCMCIA technote in /etc/readme/technotes/pcmcia on your 4.23A or later system.
{Installing the Archive}
If you are installing the package from a downloaded archive use:
install -u <filename>
Where <filename> is the name of the downloaded archive. If you are installing from a floppy disk use:
install [<drive>]
Where <drive> is the name of the floppy device. If <drive> is not specified the program will install from '/dev/fd0'.
Examples:
install -u /updates/qnx42/940615.tar.F install /dev/fd0
{Configuring Resources}
After installing the archive you should copy the file /etc/config/pcmcia.cfg to /etc/config/pcmcia.NODE (where NODE is replaced by your node number). The default configuration has the following resources available for PCMCIA cards:
memory from 0xd4000 to 0xd5fff ports 0x320 to 0x33f, 0x2e8 to 0x2ef, 0x3e8 to 0x3ef, 0x170 to 0x17f and 0x376 to 0x377 irqs 5, 7, 11 and 12
These resources should be sufficient to allow PCMCIA memory cards, modems, hard disks and network cards to operate. If any of these resources conflict with hardware installed in your machine you should edit the file to reflect the resources available.
{Selecting and Starting the Server}
You must determine the type of PCMCIA host adapter that is installed in your machine. The simplest way is to run the 'pcmciatrap' utility. It will examine the ports that PCMCIA adapters normally use and attempt to determine the type of adapter installed. The utility will then display a command line to start the appropriate server. The server can be automatically started by typing 'pcmciatrap start'.
If your adapter is at a non-standard address the 'pcmciatrap' utility will not detect it and you must start the correct server manually. The servers and the PCMCIA adapter chips they support are listed below.
/bin/Pcmcia.365sl Intel 82356SL and 82365SL DF and Vadem VG-365, VG-465, VG-468 and VG-469 /bin/Pcmcia.cirrus Cirrus CL-PD6710, CL-PD6720 and CL-PD6722
If started without any arguments the servers will look for adapters at the following addresses:
Pcmcia.365sl 0x3e0 Pcmcia.cirrus 0x3e0
If your adapter is at a non-standard address you will have to supply the address to the server using the '-a' option. For example:
Pcmcia.365sl -a3e2
For an Intel 82365SL at location 0x3e2.
You need not explicitly run the server in the background with the '&' syntax, the servers will automatically do this.
If the server displays an error and will not start it may be due to several reasons:
x09x09You get an 'Operation not permitted' message when trying to start the server. The server directly accesses hardware resources and must be started from a root account.
x09x09Your resource file etc/config/pcmcia.NODE does not have sufficient resources for the server. The servers all require at least a 4k memory window and a single irq.
The adapter is not located at the standard port address and/or you have incorrectly specified the address to the server. Run the PcmciaDetect utility to verify the adapter type and location.
Once the server is running, try typing 'pin'. You should see a display something like the following:
Sock Win Type Flags PID Base Size IRQ Base2 Size2 DMA 1 Unknown ----MF--------- None 2 Unknown ----MF--------- None
This indicates that the server is running and no cards are inserted into any sockets.
{Using a modem card}
The supplied configuration files have entries for several different PCMCIA modems, try plugging your modem into a socket. Type 'pin' and you may see something like the following:
Sock Win Type Flags PID Base Size IRQ Base2 Size2 DMA 1 0 Serial C---I-+-------- None 0x3e8 8 7 2 Unknown ----MF--------- None
This indicates that a modem is plugged into socket 1 and that it has been configured to use io ports 0x3e8-0x3ef and irq 7. If instead you see something like:
Sock Win Type Flags PID Base Size IRQ Base2 Size2 DMA 1 Unknown C---MF--------- None 2 Unknown ----MF--------- None
It indicates that the server detected a card being inserted (the 'C' flag) but was unable to determine the type of card. You will have to create a configuration entry for the card (see the section {Creating a Configuration Entry for a New Card}).
In order to access the modem you will need to start Dev.ser. The exact options to start Dev.ser will depend upon the other serial ports you have installed in your machine. Here is an example for a machine that has two serial ports at the standard locations and a PCMCIA modem in socket 1 or 2:
Dev.ser 3f8,4 2f8,3 p1,2 &
This will create the following character special devices:
/dev/ser1 (port 3f8, irq 4) /dev/ser2 (port 2f8, irq 3) /dev/ser3 (PCMCIA modem in socket 1 or 2)
NOTE: if Dev.ser was already running you should slay it first. You should now be able to type:
qtalk -m /dev/ser3
and access your modem.
{Creating a Configuration Entry for a New Card}
If you receive a new card that does not have an existing entry in the /etc/config/pcmcia.cards file you will have to create one. This is best done semi-automatically by typing something like:
pin config >tmpfile
NOTE: the 'pin config' command will attempt to generate configuration entries for every card inserted in a socket. Insert only the card you wish to generate an entry for.
This will place the configuration entry into a temporary file, where it can be edited before being added to the /etc/config/pcmcia.cards file. Here is an example where an entry is created for the USRobotics WorldPort 14400 Fax/Data Modem (the one with the RJ-11 jack enclosed in a box attached to the modem).
NOTE: the configuration file already contains an entry for this version of the modem. Unfortunately an older version of the modem with different configuration parameters reports identical product and version strings. If you are using the older modem you should delete the existing entry and create a new entry.
This example is useful because it shows some of the areas where the automatic configuration can fail, and manual editing is required.
# pin config >tmpfile pin: unknown or missing card type # cat tmpfile ; socket 1 [device] manufacturer = "Intel" product = "MODEM 2400+" info1 = "iNC110US" info2 = "A-0" regbase = 0x100 config = 0x01, 0xffff, irq 3|4|5|7|9|10|15, io 0x3f8-0x3ff (width=8) config = 0x02, 0xffff, irq 3|4|5|7|9|10|15, io 0x2f8-0x2ff (width=8) config = 0x03, 0xffff, irq 3|4|5|7|9|10|15, io 0x3e8-0x3ef (width=8) config = 0x04, 0xffff, irq 2|3|4|5|6|7|10|12, io 0x2e8-0x2ef (width=8) register = 0, 0x40, 0x40 ; level mode interrupts
The first thing to note is that the 'pin config' command reported that the card type was missing or invalid. This means that the program was unable todetermine the actual type of the card. This is reflected in the fact that the type field of the 'config' lines contains 0xffff. For a modem this field should contain 0x201. For a complete list of card types see the technote. Each of the 'config' lines should have '0xffff' replaced with '0x0201'.
The next thing to examine is the irqs that are requested in the 'config' lines. In this case the card is requesting specific interrupts and is not using the generic 'irq any' resource. As long as the driver for the card (in this case Dev.ser) can be configured to use any interrupt there is no need to request specific irq resources. Changing the irq resources to be 'irq any' will give the server more flexibility in finding suitable resources.
The 'pin config' command also generated a line to configure the card for level interrupt mode. In most cases this is appropriate, but this particular card will not function correctly when configured this way. The 'register' line should be removed.
This particular modem has one other interesting misfeature: the Vpp line must be set to 12 volts in order for the modem to operate. This is accomplished with the line 'vpp = 12.0'.
Here is the completed configuration entry, ready to be appended to the /etc/config/pcmcia.cards file. The socket comment has been removed.
[device] manufacturer = "Intel" product = "MODEM 2400+" info1 = "iNC110US" info2 = "A-0" regbase = 0x100 config = 0x01, 0x0201, irq any, io 0x3f8-0x3ff (width=8) config = 0x02, 0x0201, irq any, io 0x2f8-0x2ff (width=8) config = 0x03, 0x0201, irq any, io 0x3e8-0x3ef (width=8) config = 0x04, 0x0201, irq any, io 0x2e8-0x2ef (width=8) vpp = 12.0
If you encounter a card that does not have an entry in the supplied /etc/config/pcmcia.cards file please email the output of the 'pin cis' command along with your working configuration entry to hw@qnx.com. QSSL will attempt to keep the /etc/config/pcmcia.cards file as up to date as possible, and to make new entries available for other users to download. qnx.com/cgi-bin/go.pl |
|