Using the IFADAP.EXE Utility 
============================  
                                             CSS  1.0(0), January 1996 
                                             -------------------------

**********************************************************************
NOTE: Note that IFADAP for OS/2 is not supported in release 1.0(0)  of 
      the CardBus Support Software.
********************************************************************** 


Summary 
-------
The IFADAP program detects network adapters attached to a computer and 
allows  the  selective  loading of device drivers depending upon which 
adapter is present.  The program can be run as a  device  driver  from 
CONFIG.SYS, from a batch file, or from the command line. 

This file includes the following sections: 

   1) Using IFADAP.EXE for DOS from CONFIG.SYS
   2) Using IFADAP.EXE for DOS from the command line
   3) IFADAP Options
   4) Errorlevels (COMMAND LINE only)
   5) Environment Variables (COMMAND LINE only)
   6) Valid parameters


1) Using IFADAP for DOS from CONFIG.SYS
---------------------------------------

device=IFADAP.EXE CARD=<card> [options] <DDname> [DDoptions]   

For valid [options], see the "Options" section below.

The meaning of this device line is that IFADAP will install the device 
driver <DDname> if the program finds the specified network card.

A sample line is as follows:

  device=ifadap.exe CARD=IBM dxmc0mod.sys

This line loads DXMC0MOD.SYS, if there is an IBM adapter card  in  the 
computer.

Any  parameters  which the specified device driver takes can be placed 
after the device name. For example:

  device=ifadap.exe CARD=SMT16/4 ifadap.exe CARD=IBM dd.sys /a /b

This  example  shows  how  to  load  dd.sys  with  the  /a and /b 
parameters if a Madge Smart 16/4  Ringnode  AND  an  IBM  adapter  
are present.
 

2) Using IFADAP for DOS from the command line
---------------------------------------------

IFADAP [options]

For valid [options], see the "Options" section below.

If you run IFADAP without specifying any options, the program searches 
for an adapter of any type that it knows about. To  make  the  program 
search  for  a  particular  adapter,  use the CARD= option. Along with 
this, you can also use the RAM=, IO=,  and/or  SLOT=  options.   These 
options  enable  you  to  describe  precisely the adapter you want the 
program to find. If you use these options, IFADAP  only  searches  for 
adapters  of the type you specify, with the amount of RAM you specify, 
that are using the I/O location or SLOT number you specify.

If you run IFADAP from the command line, it sets environment variables 
and returns system error levels for each different Madge adapter. This 
allows you to write AUTOEXEC.BAT files that, for example, load drivers 
from a particular  Madge  software  release  for  one  type  of  Madge 
adapter,  and  from another Madge software release for another type of 
Madge  adapter.  (IFADAP  returns  system  error  levels   for   other 
manufacturers' adapters too.) 

IFADAP  does  not  report  multiple  adapters to the screen unless you 
specify the /MULTI option.


3) IFADAP Options
-----------------

CARD=<card>
-----------
Only search for adapters of type <card>.

RAM=<ram>
---------
Only report adapters with amount <ram> of RAM

IO=<io>
-------
Only report adapters at IO location <io>

      
SLOT=<slot>
-----------
Only report adapters at Slot location <slot>
      

BUS=<bus type> BID=<bus identifier> (IFADAP for DOS only)
---------------------------------------------------------

**********************************************************************
NOTE: The BUS= and BID= options do not support CardBus adapters. 
**********************************************************************

These two arguments must  be  used  together  and  without  any  other 
adapter  specifiers.   That  is,  without  the  CARD,  IO, RAM or SLOT 
options. You can, however, use the 'DD =' argument to  load  a  device 
driver.  

To  find out which values to specify for the BUS= options and the BID= 
option, you must run the WHATADAP.EXE utility. For  information  about 
this utility, see the WHATADAP.TXT file.

The  <bus type> that you specify must be one of MCA, EISA, PNP, PCI or 
PCMCIA.  The format of the <bus identifier> depends on the <bus  type> 
you specify:

<bus> <bus identifier>
----- ----------------
 MCA     AAAA/B         AAAA is up to 4 hex digits (MCA POS ID)
                        B is a single decimal digit (Slot number)
 EISA    AAAA/BBB/C     AAAA is up to 4 hex digits (Manuf'r ID) 
                        BBB is up to 3 hex digits  (Product ID) 
                        C is a single hex digit (Slot number) 
 PCI     AAAA/BBBB      AAAA is up to 4 digits (Vendor ID) 
                        BBBB is up to 4 digits (Device ID) 
 PNP     AAAA/BBBB      AAAA is up to 4 digits (Manufacturer ID) 
                        BBBB is up to 4 digits (Device ID)
 PCMCIA  AAAA/BBBB/CCCC AAAA is up to 4 digits (Manufacturer ID)
                        BBBB is up to 4 digits (Device ID)
                        CCCC is up to 4 digits (Socket number) 

You can use the BUS= and BID= options to specify any type  of  adapter 
on a bus (except the CardBus adapter). If the program finds an adapter 
with  the  bus  identifier you specify, it returns error levels in the 
same way as for the other adapters. That is, it returns 1  for  found, 
or 0 for not found.

Use  the  WHATADAP.EXE  utility  to  display a list of the BUS and BID 
values you can specify on the IFADAP command line. Do not attempt to 
use bus information generated by utilities other than WHATADAP.EXE.

You can use WHATADAP and IFADAP when you are  configuring  any  device 
driver.  You  do not have to reserve them for use with network adapter 
drivers.


 ~ 
---
You  can  use  the  tilde (~) on device lines (that is, in CONFIG.SYS) 
only.  It reverses the normal meaning of the IFADAP device  line.   In 
other  words,  if  the program finds NO adapter of the specified type, 
then it loads the device driver specified on the command  line.   And, 
if  the program DOES find the adapter specified, then it DOES NOT load 
the device driver.


/DD="<DDname> [DDoptions]" (IFADAP for DOS, CONFIG.SYS only)
------------------------------------------------------------
This  option  is  for  CONFIG.SYS only. It gives you an alternative to 
specifying the device driver (and its  options)  at  the  end  of  the 
device=ifadap.exe  ...  line.  You can put the /DD= option anywhere on 
the device line.  If the device driver you wish to load has parameters 
that include quote characters, you must use a slash before each  quote 
character (for example, \").  This enables IFADAP to differentiate the 
quote character from the one which terminates the / DD="..." option.

Example:
     device = testdrv.sys "test"
     device = ifadap.exe /dd="testdrv.sys \"test\" " card=ibm

/RF[=<name>] 
------------
This option writes adapter information  to  a  file.  The  information 
appears in the same format as it appears on the screen.  If you do not 
give a file name, the program uses the default file name, IFADAP.OUT.

/Q or /QUIET
------------
Quiet option. This parameter  prevents  the  program  from  displaying 
adapter information on the screen. 

/?
--
Displays help text.

/XIBM 
-----
If you specify this parameter and you have not used the CARD=  option, 
then IFADAP displays the full names of any IBM or Madge IBM-compatible 
adapters  in the computer. These full names are instead of the generic 
"Madge Blue/IBM Token Ring" label. The /XIBM option also causes IFADAP 
to  report  detailed  error  level  information  for  IBM  and   Madge 
IBM-compatible adapters (see the see the "Errorlevels" section).  

/ECS 
----

Use this option if you want IFADAP to find PCMCIA or CardBus adapters, 
but  you do not have Card Services loaded. The option causes IFADAP to 
attempt to install its own Card Services functionality so that it  can 
communicate with PC Cards. (ECS stands for Emulate Card Services).  If 
you  do  not  specify a memory address by using the CSMEM= option (see 
below), IFADAP searches memory for a free block to use.


CSMEM=<address>
---------------

This  option is for use with the /ECS option (see above).  The address 
that you specify is the address in upper memory (that is, memory above 
640K and below 1MB) that you want the IFADAP card services emulator to 
try to use. You can specify any 4K block in the address range A000  to 
EF00  so long as that block is not being used by a memory manager (for 
example, EMM386.SYS) or a device driver. IFADAP tries  to  check  that 
nothing  else is using the memory before it uses it, but conflicts can 
still occur. If IFADAP does detect another  device  driver  using  the 
memory  you  specify, it prints an error message and continues to run, 
but it does not load its card services emulator.   

QUESTION[="<question>"] 
-----------------------

If QUESTION is given on the command line then a  default  question  is 
asked  of  the  user  (unless  overriden  by specifying an alternative 
<question>) if IFADAP finds a specified adapter.  The  user  is  asked 
whether he wants to load network drivers and may reply either yes (F1) 
or  no  (F2). If the user replies "no" then the result is as if IFADAP 
failed to find an adapter (environment variables are cleared,  or,  if 
run as a device driver, no subsequent driver is loaded).

/MULTI
------
If  you  specify  the  /MULTI  option on the command line, then IFADAP 
reports all the adapters it recognizes  which  conform  to  the  other 
parameters  on  the command line.  Without the / MULTI parameter, only 
the first adapter found is reported.  The errorlevel  and  environment 
variables  are  set  to reflect the first adapter found. If you use no 
other parameter except /MULTI, then IFADAP reports all the adapters it 
recognizes.

/ALTERR
-------
If  you  specify  /ALTERR, then IFADAP returns a different error level 
for each type of Madge adapter, rather than grouping them according to 
RAM size.  See the "Error levels" section for more details. Note  that 
/ALTERR  reports  IBM and Madge Blue adapters as error level 1 ("Madge 
Blue/IBM Token Ring Adapter") even if you also specify /XIBM.


4) Errorlevels (COMMAND LINE only)
----------------------------------

When IFADAP.EXE terminates it returns an error level  to  the  command 
shell.   An  error  level  is  an  integer  value  that can be used to 
determine the outcome of an operation.  IFADAP uses  error  levels  to 
indicate the type of adapter in the machine.

When you run IFADAP  with  card  details  (CARD=  etc)  specified,  it 
returns  an  errorlevel  of  0  if it finds the specified card, and an 
errorlevel of 1 if not.          

When you run IFADAP with no card details  (CARD=  etc)  specified,  it 
returns  an error level that depends upon the type of adapter it finds 
first.  The error levels returned by IFADAP are as follows:

Errorlevel 0 - no adapter found
           1 - Madge Blue / IBM Token Ring adapter found
           2 - 128K Madge Smart 16/4 Ringnode found
           3 - 256K Madge Smart 16/4 Ringnode found
           4 - 512K Madge Smart 16/4 Ringnode found
           5 - Madge Smart 16/4 Ringnode found (RAM unknown)
           6 - Madge Smart 100 Ringnode found      
           7 - Madge Smart 16/4 Pocket Ringnode found
           8 - Xircom Pocket Token-Ring adapter found
           9 - Madge Smart 16/4 PCMCIA Ringnode found
          10 - Madge Four Megabit Adapter
          11 - IBM PCMCIA Token Ring Adapter
          12 - IBM PCI LanStreamer Token Ring Adapter
          13 - Madge 16/4 CardBus Adapter

If /XIBM is specified, the following errorlevels are 
returned instead of errorlevel 1:

          41 - IBM Token Ring Adapter
          42 - IBM Auto ISA Token Ring Adapter
          43 - IBM Auto ISA Plug And Play Adapter
          44 - Madge Straight Blue Adapter
          45 - Madge Blue Plus Adapter
          46 - 3COM Token Ring adapter (IBM compatible)

If /ALTERR is specified, the following errorlevels are 
returned instead of errorlevel 2,3,4 or 5:

          20 - Madge Smart 16/4 AT Ringnode
          21 - Madge Smart 16/4 PC Ringnode
          22 - Madge Smart 16/4 MAXY Ringnode
          23 - Madge Smart 16/4 AT Fiber Ringnode
          24 - Madge Smart 16/4 AT Bridgenode
          25 - Madge Smart 16/4 ISA Client Ringnode
          26 - Madge Smart 16/4 AT Plus Ringnode (AT mode)
          27 - Madge Smart 16/4 AT Plus Ringnode 
          28 - Madge Smart 16/4 ISA Client Plus Ringnode
          30 - Madge Smart 16/4 MC Ringnode
          31 - Madge Smart 16/4 MC16 Ringnode
          32 - Madge Smart 16/4 EISA Ringnode (Mk.1) 
          33 - Madge Smart 16/4 EISA Ringnode (Mk.2) 
          34 - Madge Smart 16/4 EISA Bridgenode 
          35 - Madge Smart 16/4 MC32 Ringnode 
          36 - Madge Smart 16/4 MC32 Bridgenode
          37 - Madge Smart 16/4 PCI Ringnode
          38 - Madge Smart 16/4 PCI Ringnode (BM)
          39 - Madge Smart 16/4 ISA Client PnP Ringnode
          40 - Madge Smart 16 Ringnode

6) Environment Variables (COMMAND LINE only)
--------------------------------------------

When  you run IFADAP from the command line, IFADAP sets the CARD, RAM, 
SLOT, DMA, IRQ, BUS and IO environment variables are set even  if  you 
do  not  specify any parameters. These variables are determined by the 
first adapter the program finds. They therefore describe that adapter. 
If the program returns "Adapter not found", then  it  clears  all  the 
environment variables. 

Example :-

        C:\>ifadap CARD=SMT16/4

This example sets the following environment variables if a Madge Smart 
16/4 Ringnode is found:

        CARD=SMT16/4            / card type
        RAM=<ram>               / amount of adapter ram
        IO=<io>                 / IO base address
        SLOT=<slot>             / slot number (if applicable)
        IRQ=<irq>               / IRQ number
        DMA=<dma>               / DMA channel (if applicable)
        BUS=<bus>               / Bus architecture 

If the program had, in this instance, failed to find a Madge  adapter, 
then  it would have cleared these environment variables. If particular 
environment variables are not relevant to the particular adapter  that 
IFADAP has found (for example, the RAM= and IO= variables for a Xircom 
adapter), then the porgram clears these variables. 


7) Valid parameter values
-------------------------

This section lists the values you can use  for  the  different  IFADAP 
configuration  options.  However, for information about the values you 
can use for the BUS= and BID= parameters,  run  the  WHATADAP  utility 
(see WHATADAP.TXT).

Note : Card & Socket Services must be loaded for IFADAP to be able  to 
detect PCMCIA adapters.

// Madge 4Mbit adapter
<card>  =   FOURMEG
  <io>  =   0A20, 1A20, 2A20, 3A20

// Madge Blue / IBM adapter
<card>  =   IBM, IBM_STD, IBM_AUTO_PNP, IBM_AUTO,
            MDG_STRAIGHT_BLUE, MDG_BLUE_PLUS
  <io>  =   0A20, 0A24  

// IBM PCI LanStreamer Token Ring adapter
<card>  =   IBM_PCI
  <io>  =   any

// IBM PCMCIA Token Ring adapter
<card>  =   IBM_PCMCIA
  <io>  =   any

// Madge Smart 16/4 PCMCIA Ringnode
<card>  =   PCMCIA
  <ram> =   512
  <io>  =   any
  <slot>=   0 - 15

// Madge Smart 16/4 Pocket Ringnode
<card>  =   POCKET

// Madge Smart 16/4 Ringnode
<card>  =   SMT16/4
  <ram> =   128, 256, 512
  <io>  =   920,  940,  960,  980
            A20,  A40,  A60,  A80,
            B20,  B40,  B60,  B80,
            1A20, 2A20, 3A20, 4A20,
            E20,  1E20, 2E20, 3E20,
            1000, 2000, 3000, 4000, 
            5000, 6000, 7000, 8000,
            9000, A000, B000, C000,
            D000, E000, F000,  + xx00 for PCI adapters
  <slot>=   0 - 15

// Madge Smart 100 Ringnode
<card>  =   SMT100
  <ram> =   * no valid values *
  <io>  =   1C80, 2C80, 3C80, 4C80,
            5C80, 6C80, 7C80, 8C80,
            9C80, AC80, BC80, CC80,
            DC80, EC80, FC80
  <slot>=   1 - 15

// Xircom Pocket Token-Ring adapter
<card>  =   XIRCOM


                ******  End of IFADAP.TXT  ******
