Using the IFADAP.EXE Utility 
============================  
                                              LSS  5.0(0), August 1996 
                                              ------------------------

Summary 
-------

The IFADAP program detects network adapters attached to a computer and 
allows the selective loading of device drivers depending upon  whether 
a  particular  adapter is present. It is intended to be used to create 
boot configurations which will load drivers depending on  the  adapter 
hardware  located  in the computer. The program can be run as a device 
driver  from  config.sys  or  from  the  command  line/batch file. Two  
versions  of IFADAP.EXE are provided, one for DOS and one for OS/2.

This file has the following sections: 

   1) Using IFADAP.EXE for DOS from config.sys
   2) Using IFADAP.EXE for DOS from the command line
   3) Using IFADAP.EXE for OS/2
   4) IFADAP Options
   5) Errorlevels (COMMAND LINE only)
   6) Environment Variables (COMMAND LINE only)
   7) 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.

This will install the device driver <DDname> if the specified 
network adapter is found.

Example :-

  device=ifadap.exe CARD=IBM dxmc0mod.sys

This will load dxmc0mod.sys, if an IBM adapter card is present.

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


  device=ifadap.exe CARD=IBM EMM386.EXE X=CC00-CDFF

This example loads EMM386.EXE with a certain range of memory  excluded
if IFADAP finds an IBM adapter in the PC.

 

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

IFADAP [options]

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

If IFADAP is run with no options then it will search for an adapter of 
any  known  type.  A particular type of adapter may be specified using 
the CARD= option along with the RAM=, IO= and SLOT= options, in  which 
case IFADAP will only search for and report this type of adapter.

When  run  from the command line, environment variables are set and an 
errorlevel  returned  to  reflect  any  adapter  found.    Environment 
variables and errorlevels set by IFADAP may be tested in a batch file. 
If  multiple  adapters  are present then environment variables and the 
errorlevel are set to reflect the first adapter IFADAP locates.

Multiple adapters will not be reported to the screen unless the /MULTI 
option is supplied.


3) Using IFADAP.EXE for OS/2
----------------------------

Since an OS/2 application is  unable  to  perform  certain  operations 
necessary  to  locate  some  classes of adapter (interfacing with Card 
Services to locate PCMCIA adapters,  for  example),  a  helper  device 
driver  is  required.  This  device driver, MDGHLP.SYS, is loaded from 
config.sys. If this device driver is not loaded, the functionality  of 
IFADAP  will  be  restricted  to  locating adapters which can be found 
without the aid of MDGHLP.SYS and adapters with  software  running  on 
them.

When   IFADAP  is  run,  if  MDGHLP.SYS  is  not  detected  or  is  an 
incompatible version, a warning message is displayed.

Example:

In config.sys:

  device=<path>MDGHLP.SYS

(Where <path> is the location of the MDGHLP.SYS file, eg. C:\OS2\)

Command line (batch file) usage:

  ifadap [options]

Note: Using IFADAP for OS/2 with software running on adapters
--------------------------------------------------------------

LSS 5.0(0) and later OS/2 network drivers for  Madge  Smart  Ringnodes 
can  be  detected  by IFADAP when they are running on an adapter. When 
IFADAP detects an adapter with software running, it avoids probing the 
adapter hardware since  this  may  cause  the  adapter  to  be  reset. 
Adapters   located   with  software  running  are  reported  as  such. 
IFADAP.EXE for OS/2 is unable to detect pre-LSS 5.0(0) drivers running 
on an adapter. It is therefore recommended that IFADAP is not  run  if 
the computer  contains  Madge  adapters  with  pre-LSS  5.0(0) drivers 
running.


4) 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)
---------------------------------------------------------
These two arguments must be used together without  any  other  adapter 
specifiers,  ie.   no  CARD,  IO, RAM or SLOT options may be used with 
them. They may be used with the 'DD  ='  argument  to  load  a  device 
driver.   <bus type> must be one of MCA, EISA, PNP, PCI or PCMCIA. The 
format of the <bus identifier> depends on the  <bus  type>,  as  shown 
below:

<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) 

Taken  together,  the two arguments may be used to specify any type of 
adapter card on a bus. If the card is found the errorlevels are set as 
for the other card specifiers above, ie. 1 for found,  or  0  for  not 
found.

The  utility  WHATADAP.EXE  is  used  to display a list of BUS and BID 
values for a machine. Users are cautioned against trying  to  generate 
their  own  sets of bus information from any other source than running 
the WHATADAP.EXE utility. The use of WHATADAP.EXE and the BUS and  BID 
options  to  IFADAP.EXE provide a general method of configuring device 
drivers for any type of card, not just network adapters. (See the file 
WHATADAP.TXT for more details on using WHATADAP.EXE)

~   (IFDAP for DOS, CONFIG.SYS only)
------------------------------------

This negates the logic of IFADAP, ie if NO adapter  of  the  specified 
type was found then the device driver specified on the command line IS 
loaded. Conversely, if the adapter specified WAS found then the device 
driver IS NOT loaded.

/DD="<DDname> [DDoptions]" (IFADAP for DOS, CONFIG.SYS only)
------------------------------------------------------------

This  is  an  alternative to specifying the device driver to be loaded 
and its options at the  end  of  the  device=ifadap.exe  ...  line  in 
config.sys. This option may be placed anywhere on the command line. If 
the  DDoptions  include  an option enclosed in quotes, \" must be used 
rather than " so that IFADAP can differentiate this quote from the one 
which terminates the /DD="..." option.

e.g  device = testdrv.sys "test"
     device = ifadap.exe /dd="testdrv.sys \"test\" " card=ibm

/RF[=<name>] (IFADAP for DOS only)
----------------------------------

Write adapter information to a file. This information is in  the  same 
format  as  that displayed on the screen if an adapter is found. If no 
<name> is specified then the default ifadap.out is used.

/Q or /QUIET
------------

Quiet option - don't display adapter information to the screen.

/?
--

Display help text.

/XIBM (IFADAP for DOS only)
---------------------------

If a CARD=<card> parameter is not specified, then display verbose  IBM 
or  Madge  IBM compatible (Straight Blue and Blue Plus) card names, as 
opposed to the generic "Madge Blue / IBM Token Ring" label. This  will
also report detailed errorlevels for IBM / Madge IBM compatible cards,
see the "Errorlevels" section.  

/ECS (IFADAP for DOS only)
--------------------------

If  no  PCMCIA  Card  Services  are  loaded,  emulate  Card   Services 
functions.  IFADAP  attempts  to  install  an  internal  Card Services 
library so that it can interrogate any PCMCIA cards found. This allows 
IFADAP to find Madge PCMCIA cards on machines with  no  Card  Services 
loaded.  If  no  memory  address is specified ( see the CSMEM section, 
below ) IFADAP searches memory to try and find a free block to use.

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

Only relevant if the  /ECS  option  is  also  specified.  The  address 
specified  is  the  address in the upper memory block ( above 640K and 
below 1 MB ) which the IFADAP card services emulator will try and use. 
Valid addresses are any 4K memory block in the address range  A000  to 
EF00  that is not in use by a memory device driver (eg. EMM386.SYS) or 
other installed hardware. IFADAP tries to verify that nothing else  is 
using  the  memory  before it uses it, but there may be cases where it 
does conflict with other devices, possibly causing a system  crash  or 
hang. If IFADAP detects another user of the specified memory it prints 
an error message and continues without loading its card services.   

QUESTION[="<question>"] (IFADAP for DOS only)
---------------------------------------------

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 /MULTI is specified on the command line then IFADAP will report the 
presence  of  ALL  recognized adapters in the machine which conform to 
the parameters given 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 
no other parameters are given ("IFADAP /MULTI") then all  adapters  in 
the machine will be reported.

/ALTERR
-------

If /ALTERR is specified then IFADAP returns a different errorlevel for 
each type of Madge Smart Ringnode, rather than grouping them according 
to RAM size. See the "Errorlevels" section for more details. Note that 
/ALTERR does not imply /XIBM, ie. IBM and Madge Blue cards will  still
be reported as errorlevel 1 (Madge Blue / IBM Token Ring Adapter).

5) Errorlevels (COMMAND LINE only)
----------------------------------

When IFADAP.EXE terminates it returns an  errorlevel  to  the  command 
shell.   An  errorlevel  is  an  integer  value  which  can be used to 
determine the success of an  operation.  IFADAP  uses  errorlevels  to 
indicate the type of adapter located in the machine.

If IFADAP is run with card details (CARD=  etc.)  specified,  then  an 
errorlevel  of  0  is  returned  if the specified card is found and an 
errorlevel of 1 is returned if it is not.          

If IFADAP is run with no card details (CARD= etc.) specified, then  an 
errorlevel is returned based on the type of the first adapter found:

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 Token-Ring Adapter
          14 - Madge PCI Presto Token-Ring 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)
--------------------------------------------

The CARD, RAM, SLOT,  DMA,  IRQ,  NODEADDR,  BUS  and  IO  environment 
variables are set when IFADAP is run from the command line, regardless 
of whether any parameters were specified.  They give the attributes of 
the first adapter found, or are cleared if IFADAP returns "Adapter not 
found". 

Example :-

        C:\>ifadap CARD=SMT16/4

If  a  Madge  Smart  16/4  Ringnode is found the following environment 
variables will be set if they are known and appropriate:

        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 
        NODEADDR=<bia>          / Burnt-In Node Address

If a Madge adapter wasn't found then these environment variables would 
be cleared. If multiple adapters are found (using the  /MULTI  command 
line  switch) the environment variables will reflect the first adapter 
only. If particular environment  variables  aren't  relevant  for  the 
adapter  found,  eg  RAM=  and IO= for a Xircom adapter, then they are 
cleared (see below). 


7) Valid parameters
-------------------

The  valid  <io>, <slot> and <ram> parameters depend upon which <card> 
is specified. When IFADAP is run from the command line, the CARD, RAM, 
IO, IRQ, SLOT and DMA environment variables are set  to  the  relevant 
values  from  those  given  below.  If there are no valid values for a 
particular attribute then that environment variable is cleared.


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

See Also
--------
Further details of using WHATADAP.EXE to provide data for IFADAP.EXE
can be found in WHATADAP.TXT

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