Annotation of ntddk/src/setup/inf/ndis/ncparam.inf, revision 1.1.1.1

1.1       root        1: ;============================================================================
                      2: ;============================================================================
                      3: ;
                      4: ;  NCPARAM.INF   Netcard Detection Parameter handling routines
                      5: ;
                      6: ;============================================================================
                      7: ;   SECTION 1:  Overview and description of variables.
                      8: ;============================================================================
                      9: ;
                     10: ;   This file is "shelled" to by OEMNxxyy.INF files to facilitate
                     11: ;   and generalize the handling of netcard detection, defaulted
                     12: ;   and detected parameter handling and parameter verification.
                     13: ;
                     14: ;   These routines are based upon several precursors.  This section
                     15: ;   documents all key information about netcard detection and
                     16: ;   the requirements necessary to use the routines in this file.
                     17: ;
                     18: ;       1) The document NCDETECT.DOC describes the detection
                     19: ;          driver, DLLs and the interfaces provided by them.
                     20: ;
                     21: ;       2) Netcard detection DLLs are registered in the Registry
                     22: ;          under HKEY_LOCAL_MACHINE\System\Setup, NetcardDlls,
                     23: ;          which is a REG_MULTI_SZ.  The standard Microsoft DLL,
                     24: ;          MSNCDET.DLL, should be first in this list.
                     25: ;
                     26: ;       3) The netcard detection driver, NETDTECT.SYS, is installed
                     27: ;          as the NETDETECT service. he driver interface DLL,
                     28: ;          NETDTECT.DLL, interfaces to the driver.
                     29: ;
                     30: ;       4) The file NETDTECT.INF installs the NETDETECT service
                     31: ;          and updates the "NetcardDlls" value.  In other words,
                     32: ;          it performs steps 3 and 4 above.
                     33: ;
                     34: ;          The files MSNCDET.DLL, NETDETCT.DLL and NETDETCT.SYS
                     35: ;          must be in the minimum boot tree during main installation.
                     36: ;
                     37: ;       5) During main installation, NTLANMAN.INF shells to NETDTECT.INF
                     38: ;          to install the NETDETECT service, which it then starts.
                     39: ;
                     40: ;       6) During main installation, NTLANMAN.INF shells to OEMHOOK.INF
                     41: ;          so that additional OEM netcard detection DLLs can be
                     42: ;          properly registred.
                     43: ;
                     44: ;       7) NCPA.CPL exports wrapper functions through the generic
                     45: ;          SETUP-to-NCPA function CPlSetup().  These functions are:
                     46: ;
                     47: ;               DTSTART         Activate the NETDETECT service
                     48: ;                               and instantiate the C++ objects
                     49: ;                               required for support of detection.
                     50: ;
                     51: ;               DTEND           Stop detection and discard the objects.
                     52: ;                               The NETDETECT service is not stopped.
                     53: ;
                     54: ;               DTRESET         Reset enumeration across buses, etc.
                     55: ;                               Also discards all previous detected
                     56: ;                               netcard information.
                     57: ;
                     58: ;               DTPARAMS        Return netcard parameter information about
                     59: ;                               a particular netcard option.
                     60: ;
                     61: ;               DTCARD          Attempt to detect a card.  This is a
                     62: ;                               first-next enumeration routine.  After
                     63: ;                               it reports failure, it calls DTRESET
                     64: ;                               internally to restart enumeration.  If
                     65: ;                               successful, it returns the option name
                     66: ;                               of the detected card and a numeric
                     67: ;                               index representing the card.
                     68: ;
                     69: ;               DTQUERY         Return detected parameters from a netcard
                     70: ;                               reported by DTCARD.
                     71: ;
                     72: ;               DTVERIFY        Validate chosen netcard parameteres for a
                     73: ;                               netcard reported by DTCARD.
                     74: ;
                     75: ;
                     76: ;       8) Several new global INF variables are used for netcard
                     77: ;          detection:
                     78: ;
                     79: ;               STF_NCDETECT  =  {YES|NO}
                     80: ;
                     81: ;                               This controls the use of detection in
                     82: ;                               NTLANMAN.INF and all other INFs.  If
                     83: ;                               "NO", no use of the detection
                     84: ;                               services is made.
                     85: ;
                     86: ;               STF_INSTALL_MODE = {CUSTOM|EXPRESS}
                     87: ;
                     88: ;                               This is not new a new variable, but is
                     89: ;                               a key factor in the UI presented.
                     90: ;
                     91: ;               STF_NCDETCARD  = 0,1,2, etc.
                     92: ;
                     93: ;                               This is an integer representing a
                     94: ;                               detected card.  The actual structures
                     95: ;                               are maintained by ncpa!CPlSetup().
                     96: ;
                     97: ;               STF_NCOPTION  = OPTIONNAME (e.g., DE201)
                     98: ;
                     99: ;                               This is the name of the netcard option
                    100: ;                               which has been detected.
                    101: ;
                    102: ;               STF_NCDETINFO = INF list containing data about the
                    103: ;                               detected card; it has the form:
                    104: ;
                    105: ;                               { OPTIONNAME,
                    106: ;                                 <card index>,
                    107: ;                                 <numeric card type>,
                    108: ;                                 <detection confidence level>,
                    109: ;                                 <bus interface type>,
                    110: ;                                 <bus number>
                    111: ;                               }
                    112: ;
                    113: ;                               All values except OPTIONNAME are numeric.
                    114: ;                               See NCDETECT.DOC for further details.
                    115: ;
                    116: ;               STF_NC_PARAMS = INF list describing netcard parameters; it has
                    117: ;                               the form:
                    118: ;
                    119: ;                               {  {PARAMETER_1_NAME,
                    120: ;                                    <setting control>,
                    121: ;                                    <confidence>,
                    122: ;                                    {v1,v2,v3,...} },
                    123: ;                                  {PARAMETER_2_NAME,
                    124: ;                                    <setting control>,
                    125: ;                                    <confidence>,
                    126: ;                                       {v1,v2,v3,...} },
                    127: ;                                  ...
                    128: ;                               }
                    129: ;
                    130: ;                               where PARAMETER_1_NAME might be IRQ;
                    131: ;                               <setting control> determines whether the
                    132: ;                               parameter is controllable through software;
                    133: ;                               <confidence> is a number [0..100] representing
                    134: ;                               the confidence with which the parameter can
                    135: ;                               be detected. The nested list {v1,v2...}
                    136: ;                               enumerates the possible numeric settings
                    137: ;                               which the parameter can take.
                    138: ;
                    139: ;                               Each netcard INF must create this list
                    140: ;                               and populate it with the hard-coded default
                    141: ;                               values from its tables.
                    142: ;
                    143: ;                               This variable is set by [Param_BuildTypeLists].
                    144: ;
                    145: ;               STF_NC_PNAMES = An INF list of the form:
                    146: ;
                    147: ;                               {  { PARAMETER_1_NAME,
                    148: ;                                     <name of variable>,
                    149: ;                                     <default value> },
                    150: ;                                  { PARAMETER_2_NAME,
                    151: ;                                     <name of variable>,
                    152: ;                                     <default value> },
                    153: ;                                  ...
                    154: ;                               }
                    155: ;
                    156: ;                               The <name of variable> is the name of the
                    157: ;                               variable in the context level of the INF
                    158: ;                               file which contains the current setting
                    159: ;                               of the parameter.
                    160: ;
                    161: ;                               This variable is set by [Param_BuildTypeLists].
                    162: ;
                    163: ;
                    164: ;       9) During main installation, NTLANMAN.INF runs the detection
                    165: ;          algorithm.  If successful, and the netcard option returned
                    166: ;          maps to a known INF file, the variables STF_NCDETCARD
                    167: ;          and STF_NCOPTION are set.
                    168: ;
                    169: ;          Then the INF is called.  Note that the installation mode
                    170: ;          may be CUSTOM or EXPRESS.  It will always be CUSTOM for
                    171: ;          post-installation usage from the NCPA.
                    172: ;
                    173: ;          NTLANMAN.INF will set STF_NCOPTION to "" (empty string)
                    174: ;          if the card was merely chosen and not detected.  This will
                    175: ;          always be the case in post-installation usage.
                    176: ;
                    177: ;          An INF can therefore tell if the card was detected by
                    178: ;          first checking $(!STF_NCDETECT) == YES, and then comparing
                    179: ;          the option is was given to !STF_NCOPTION.  If it's different,
                    180: ;          then the option was chosen, not detected, and no detection
                    181: ;          should be used.
                    182: ;
                    183: ;      10) The INF must instantiate the variables !STF_NC_PARAMS and
                    184: ;          !STF_NC_PNAMES.  See OEMNADD2.INF, section
                    185: ;          [Param_BuildTypeList] for an example of this.
                    186: ;
                    187: ;      11) The routines in this file are used to interface between the
                    188: ;          netcard INF, the global variables, and the wrapper functions
                    189: ;          in NCPA.CPL.
                    190: ;
                    191: ;          It is critical to note that the sections [Param_SetDefaults]
                    192: ;          and [Param_VerifyCard] access and/or modify variables
                    193: ;          in the calling INF through the use of the "!p:" syntax.
                    194: ;
                    195: ;          THIS MEANS THAT THE NETCARD INF MUST BE THE IMMEDIATE PARENT!
                    196: ;
                    197: ;          No "indirection" from another INF or a auxilliary section
                    198: ;          in the netcard INF can be allowed.  This would cause the
                    199: ;          variables to be set in the caller's context, and then discarded
                    200: ;          when that context was discarded to return to the netcard INF>
                    201: ;
                    202: ;      12) Every attempt has been made to document the routines in this
                    203: ;          file throughly.  Refer to their commentary for more details.
                    204: ;
                    205: ;===========================================================================
                    206: ;   SECTION 2:  Behavior of NTLANMAN.INF.
                    207: ;===========================================================================
                    208: ;
                    209: ;STEP 1:  Installation of the detection sofware
                    210: ;
                    211: ;     !STF_NCDETECT is set to "NO"
                    212: ;
                    213: ;     *  NETDTECT.INF is run by NTLANMAN.INF
                    214: ;
                    215: ;     *  OEMHOOK.INF  is run by NTLANMAN.INF
                    216: ;
                    217: ;     *  NCPA's wrapper is used to start the NETDETECT service
                    218: ;          If successful, !STF_NCDETECT is set to "YES"
                    219: ;
                    220: ;
                    221: ;STEP 2:  Allow bypassing of detection
                    222: ;
                    223: ;     *  If EXPRESS, this step is skipped.
                    224: ;     *  If CUSTOM, present a dialog:
                    225: ;
                    226: ;             +--------------------------------------------+
                    227: ;             | Setup is about to attempt to detect your   |
                    228: ;             | netcard.  If this is OK, click Continue.   |
                    229: ;             |                                            |
                    230: ;             |    [Continue]   [Bypass]   [Help]          |
                    231: ;             +--------------------------------------------+
                    232: ;
                    233: ;     *  If "Bypass", set !STF_NCDETECT to NO
                    234: ;
                    235: ;
                    236: ;STEP 3: Detect the netcard
                    237: ;
                    238: ;     *  If !STF_NCDETECT == NO, skip this step
                    239: ;
                    240: ;     *  Call  NCPA!CPlSetup( DTSTART )
                    241: ;
                    242: ;          This creates the DETECTION_CONTROL object in NCPA.CPL.
                    243: ;          If it fails, set !STF_DETECT to NO, display error
                    244: ;          accordingly, and go to STEP 4.
                    245: ;
                    246: ;    *   do..while
                    247: ;
                    248: ;          *  Call NCPA!CPlSetup( DTCARD ) -- detect a card
                    249: ;
                    250: ;          *  If success && EXPRESS
                    251: ;                save card index into !STF_NCDETCARD
                    252: ;                save card option name into !STF_NCOPTION
                    253: ;                Go to STEP 4.
                    254: ;
                    255: ;          *  If failed to find a card, do warning popup
                    256: ;
                    257: ;             +--------------------------------------------+
                    258: ;             | Setup was unable to determine the type     |
                    259: ;             | of network card in this machine.           |
                    260: ;             |                                            |
                    261: ;             |        [Continue]    [Try Again]           |
                    262: ;             +--------------------------------------------+
                    263: ;
                    264: ;             If Continue,
                    265: ;                set !STF_NCDETECT = NO, go to STEP 4
                    266: ;             else,
                    267: ;                call NCPA!CPlSetup( DTRESET ) (to reset
                    268: ;                enumeration), then go to do..while.
                    269: ;
                    270: ;          *  If success, do popup:
                    271: ;
                    272: ;             +--------------------------------------------+
                    273: ;             | Setup found the following netcard in your  |
                    274: ;             | machine.  If OK, click Accept, otherwise   |
                    275: ;             | you may stop detection or try again.       |
                    276: ;             |                                            |
                    277: ;             |    [  Displayable name of netcard    ]     |
                    278: ;             |                                            |
                    279: ;             |  [Accept]  [Try Again]  [Stop]  [Help]     |
                    280: ;             +--------------------------------------------+
                    281: ;
                    282: ;             If Try Again, go to do..while.
                    283: ;
                    284: ;             If Stop, set !STF_NCDETECT = NO, go to STEP 4.
                    285: ;
                    286: ;             If Accept,
                    287: ;                save card index into !STF_NCDETCARD
                    288: ;                save card option name into !STF_NCOPTION
                    289: ;                go to STEP 4.
                    290: ;
                    291: ;
                    292: ;STEP 4:  Display netcard choice list if necessary
                    293: ;
                    294: ;     *  If !STF_NCDETECT == YES, go to STEP 5.
                    295: ;
                    296: ;     *  Present standard netcard listbox.
                    297: ;
                    298: ;
                    299: ;STEP 5:  Run netcard INF file.
                    300: ;
                    301: ;     *  Each netcard INF file is aware of the following
                    302: ;        global variables:
                    303: ;
                    304: ;          !STF_INSTALL_MODE == {CUSTOM|EXPRESS}
                    305: ;          !STF_NCDETECT     == {YES|NO}
                    306: ;          !STF_NCDETCARD    == 0,1,2, etc.
                    307: ;          !STF_NCOPTION     == OPTIONNAME
                    308: ;
                    309: ;        If !STF_NCDETECT == NO, no calls will be made to
                    310: ;           NCPA!CPlSetup() to query or verify the card's configuration.
                    311: ;
                    312: ;        !STF_NCDETCARD is the CARD_REFERENCE index maintained internally
                    313: ;        by the code in NCPASETP.CXX.
                    314: ;
                    315: ;
                    316: ;STEP 6:  Terminate detection
                    317: ;
                    318: ;     *  If !STF_NCDETECT == YES, call NCPA!CPlSetup( DTEND ).
                    319: ;
                    320: ;        This terminates all detection and discards all memory associated
                    321: ;        with netcard handling.
                    322: ;
                    323: ;
                    324: ;============================================================================
                    325: ;    SECTION 3:  Behavior of typical netcard INF
                    326: ;
                    327: ;            (OEMNADD2.INF will be the exemplar)
                    328: ;============================================================================
                    329: ;
                    330: ;General Behavior:
                    331: ;
                    332: ;     *  If !STF_DETECT == NO, no interaction with the netcard detection software
                    333: ;        will be attempted.
                    334: ;
                    335: ;     *  If !STF_DETECT == YES:
                    336: ;
                    337: ;            *  Detectable parameters are queried.
                    338: ;
                    339: ;            *  Overall confidence level is obtained.
                    340: ;
                    341: ;            *  If (  EXPRESS mode
                    342: ;                    and confidence >= 70
                    343: ;                    and no required parameters are undetected ),
                    344: ;                    parameters detect are verified so that IRQ conflicts
                    345: ;                    can be determined.  If verification succeeds,
                    346: ;                    installation is performed silently.
                    347: ;
                    348: ;            *  Initial settings for controls are based upon the detected
                    349: ;               settings.
                    350: ;
                    351: ;     *  If configuration dialog must be displayed, it is displayed.
                    352: ;
                    353: ;     *  On OK, verification is performed.  If it fails, a popup appears:
                    354: ;
                    355: ;             +--------------------------------------------+
                    356: ;             | The <nnn> parameter appears to be in       |
                    357: ;             | conflict with another device.  To reenter  |
                    358: ;             | new values, click Configure.  If you click |
                    359: ;             | Override, the parameters you entered will  |
                    360: ;             | be used as specified.                      |
                    361: ;             |                                            |
                    362: ;             |    [Configure]   [Override]   [Help]       |
                    363: ;             +--------------------------------------------+
                    364: ;
                    365: ;        This cycle continues until satisfied.
                    366: ;
                    367: ;============================================================================
                    368: ;============================================================================
                    369: ;============================================================================
                    370: 
                    371: [InitGlobals]
                    372: !STF_NCDETECT         = "NO"
                    373: !STF_NCOPTION         = ""
                    374: !STF_NCDETCARD        = 0
                    375: !STF_NCDETINFO        = {}
                    376: 
                    377: [Param_SetGlobals]
                    378:    Read-syms InitGlobals
                    379:    return
                    380: 
                    381: ;-----------------------------------------------------------------------
                    382: ;
                    383: ; ROUTINE:      Param_ControlDetection
                    384: ;
                    385: ; DESCRIPTION:  Control netcard detection; invoke parameterless
                    386: ;               wrapper functions
                    387: ;
                    388: ; INPUTS:       $0:  DTSTART   --   start detection
                    389: ;                    DTEND     --   end detection
                    390: ;                    DTRESET   --   discard old results, restart iteration
                    391: ;
                    392: ; OUTPUTS:      $R0: STATUS_SUCCESSFUL if Ok
                    393: ;
                    394: ;------------------------------------------------------------------------
                    395: [Param_ControlDetection]
                    396: 
                    397:     Set DtMode = $($0)
                    398: 
                    399:     Debug-Output "NCPARAM.INF: calling "$(DtMode)" wrapper"
                    400: 
                    401:     Set FLibraryErrCtl = 1
                    402:     LibraryProcedure StartResult $(!NCPA_HANDLE), CPlSetup $(!STF_HWND), $(DtMode)
                    403:     Set FLibraryErrCtl = 0
                    404: 
                    405:     Set StartStatus = *($(StartResult),1)
                    406:     Debug-Output "NCPARAM.INF: "$(DtMode)" status was: "$(StartStatus)
                    407: 
                    408:     Ifint $(StartStatus) == 0
                    409:         Set ReturnStatus = STATUS_SUCCESSFUL
                    410:     Else
                    411:         Set ReturnStatus = STATUS_FAILED
                    412:     Endif
                    413: 
                    414:     Return $(ReturnStatus)
                    415: 
                    416: ;-----------------------------------------------------------------------
                    417: ;
                    418: ; ROUTINE:      Param_DetectCard
                    419: ;
                    420: ; DESCRIPTION:  Perform netcard detection. DTSTART must have
                    421: ;               already been called.
                    422: ;
                    423: ; INPUTS:       Nothing
                    424: ;
                    425: ;
                    426: ; OUTPUTS:      $R0:  Result list from NCPA wrapper:
                    427: ;
                    428: ;                  { <error code>,
                    429: ;                    OPTIONNAME,
                    430: ;                    <card index>,
                    431: ;                    <numeric card type code>,
                    432: ;                    <detection confidence level>,
                    433: ;                    <bus interface type>,
                    434: ;                    <bus number>
                    435: ;                  }
                    436: ;
                    437: ;------------------------------------------------------------------------
                    438: [Param_DetectCard]
                    439: 
                    440:     Debug-Output "NCPARAM.INF: calling DTCARD wrapper"
                    441: 
                    442:     Set FLibraryErrCtl = 1
                    443:     LibraryProcedure DetectResult $(!NCPA_HANDLE), CPlSetup $(!STF_HWND), DTCARD
                    444:     Set FLibraryErrCtl = 0
                    445: 
                    446:     Set Status = *($(DetectResult),1)
                    447:     Debug-Output "NCPARAM.INF: DTCARD status was: "$(Status)
                    448: 
                    449:     Ifint $(DetectStatus) == 0
                    450:         Set DtOption  = *($(DetectResult),2)
                    451:         Set DtIndex   = *($(DetectResult),3)
                    452:         Debug-Output "NCPARAM.INF: card found is type "$(DtOption)", index "$(DtIndex)
                    453:     Endif
                    454: 
                    455:     Return $(DetectResult)
                    456: 
                    457: 
                    458: ;-----------------------------------------------------------------------
                    459: ;
                    460: ; ROUTINE:      Param_BuildTypeLists
                    461: ;
                    462: ; DESCRIPTION:  Run the DTPARAMS wrapper for the given netcard option
                    463: ;               and merge the results with the list given.
                    464: ;
                    465: ; INPUTS:       $0:  Name of netcard option
                    466: :               $1:  Parameter control list of the form:
                    467: ;
                    468: ;                   {  { <parameter name>,
                    469: ;                        <name of choice list var | NONE>,
                    470: ;                        <name of default var | NONE> },
                    471: ;                      ...
                    472: ;                   }
                    473: ;
                    474: ; OUTPUTS:      $R0: STATUS_SUCCESSFUL if OK; if OK, then:
                    475: ;
                    476: ;               !STF_NC_PARAMS is set to a list formatted as:
                    477: ;
                    478: ;               {  {PARAMETER_1_NAME,<setting control>,<confidence>,
                    479: ;                       {v1,v2,v3,...} },
                    480: ;                  {PARAMETER_2_NAME,<setting control>,<confidence>,
                    481: ;                       {v1,v2,v3,...} },
                    482: ;                  ...
                    483: ;               }
                    484: ;
                    485: ;               !STF_NC_PNAMES is set to a list formatted as:
                    486: ;
                    487: ;               { {PARAMETER_1_NAME, <param variable name>, <param current value> },
                    488: ;                 {PARAMETER_2_NAME, <param variable name>, <param current value> },
                    489: ;                 ...
                    490: ;               }
                    491: ;
                    492: ;
                    493: ;               Also, the parameter choice list variables named in the
                    494: ;               input list (if not "NONE") are created with values from the DLL.
                    495: ;
                    496: ;------------------------------------------------------------------------
                    497: [Param_BuildTypeLists]
                    498: 
                    499:     Set Option = $($0)
                    500:     Set OptList = $($1)
                    501:     Set Result1 = {}
                    502:     Set Result2 = {}
                    503:     Set !STF_NC_PARAMS = {}
                    504:     Set !STF_NC_PNAMES = {}
                    505:     Set Status = STATUS_FAILED
                    506: 
                    507:     ;  Get parameter info from the detection DLLs for this card option
                    508: 
                    509:     Debug-Output "NCPARAM.INF: Querying parameters for netcard type: "$(Option)
                    510: 
                    511:     Set FLibraryErrCtl = 1  ;  Report DLL errors back to INF code
                    512:     LibraryProcedure NcpaResult $(!NCPA_HANDLE), CPlSetup $(!STF_HWND), DTPARAMS, $(Option)
                    513:     Set FLibraryErrCtl = 0
                    514: 
                    515:     Set ErrorStatus = *($(NcpaResult),1)
                    516:     Debug-Output "NCPARAM.INF: DTPARAMS status was: "$(ErrorStatus)
                    517: 
                    518:     ;  If error, return the input list
                    519: 
                    520:     Ifint $(ErrorStatus) != 0
                    521:         Goto PMTL_Return
                    522:     Endif
                    523: 
                    524:     Set DllList = *($(NcpaResult),2)
                    525:     Debug-Output "NCPARAM.INF: DLL param type list is: "$(DllList)
                    526: 
                    527:     ;  For each element in the input list, try to find its
                    528:     ;  corresponding element in the DLL's list.  If found,
                    529:     ;  set the corresponding parameter choice list variable
                    530:     ;  and parameter default setting variable in the parent context.
                    531: 
                    532:     Set NbrOptions = 0
                    533:     Set NbrFound = 0
                    534: 
                    535:     ForListDo $(OptList)
                    536:         Set-add NbrOptions = $(NbrOptions),1
                    537:         Set Found = 0
                    538:         Set Plist = $($)
                    539:         Set Pname = *($(Plist),1)
                    540:         Set PlistVar = *($(Plist),2)
                    541:         Set Pvar = *($(Plist),3)
                    542:         Set Dentry = {}
                    543: 
                    544:         ForListDo $(DllList)
                    545:             Set Dlist = $($)
                    546:             Set Dname = *($(Dlist),1)
                    547:             Set Dvlist = *($(Dlist),4)
                    548:             Ifstr(i) $(Dname) == $(Pname)
                    549:                 Set Found = 1
                    550:                 Set Dvalue = *($(Dvlist),1)
                    551:                 Set Dentry = $(Dlist)
                    552:                 ;  Set parameter choice list var value
                    553:                 Ifstr(i) $(PlistVar) != NONE
                    554:                     Set !p:$(PlistVar) = $(Dvlist)
                    555:                     Debug-Output "NCPARAM.INF: DLL param "$(Pname)" list var "$(PlistVar)" set"
                    556:                 Endif
                    557:             Endif
                    558:         EndForListDo
                    559: 
                    560:         Set-add NbrFound = $(NbrFound),$(Found)
                    561:         Ifint $(Found) == 1
                    562:             Set Result1 = >($(Result1),$(Dentry))
                    563:             Set Result2 = >($(Result2),{$(Pname),$(Pvar),$(Dvalue)})
                    564:         Else
                    565:             Debug-Output "NCPARAM.INF: parameter "$(Pname)" not in DLL for "$(Option)
                    566:         Endif
                    567: 
                    568:     EndForListDo
                    569: 
                    570:     Ifint $(NbrOptions) == $(NbrFound)
                    571:         Set Status = STATUS_SUCCESSFUL
                    572:         Set !STF_NC_PARAMS = $(Result1)
                    573:         Set !STF_NC_PNAMES = $(Result2)
                    574:         Debug-Output "NCPARAM.INF: Netcard list STF_NC_PARAMS for "$(Option)" is: "$(Result1)
                    575:         Debug-Output "NCPARAM.INF: Netcard list STF_NC_PNAMES for "$(Option)" is: "$(Result2)
                    576:     Endif
                    577: 
                    578: PMTL_Return =+
                    579:     Return $(Status)
                    580: 
                    581: ;*************************************************************************
                    582: ;
                    583: ;     ROUTINE:   Param_SaveValues
                    584: ;
                    585: ; DESCRIPTION:   Create a list containing the current values
                    586: ;                of the netcard's parameters.
                    587: ;
                    588: ;      INPUTS:   !STF_NC_PNAMES
                    589: ;
                    590: ;
                    591: ;     OUTPUTS:   $R0: list identical in form to STF_NC_PNAMES, but
                    592: ;                     containing the current values of each parameter.
                    593: ;
                    594: ;                Parameters with no corresponding variable name (e.g., NONE)
                    595: ;                are not included.
                    596: ;
                    597: ;*************************************************************************
                    598: [Param_SaveValues]
                    599:    Set Plist = {}
                    600: 
                    601:    ForListDo $(!STF_NC_PNAMES)
                    602:        Set Pelem = $($)
                    603:        Set Name = *($(Pelem),1)
                    604:        Set Qvar = *($(Pelem),2)
                    605:        Set Qvalue = *($(Pelem),3)
                    606: 
                    607:        Ifstr(i) $(Qvar) != "NONE"
                    608:            Set Qvalue = $(!p:$(Qvar))
                    609:            Set Plist = >($(Plist),{$(Name),$(Qvar),$(Qvalue)})
                    610:        Endif
                    611:    EndForListDo
                    612: 
                    613:    Return $(Plist)
                    614: 
                    615: ;*************************************************************************
                    616: ;
                    617: ;     ROUTINE:   Param_DiffValues
                    618: ;
                    619: ; DESCRIPTION:   Given a list of the STF_NC_PNAMES form, produce a new
                    620: ;                list containing only those parameters whose values are
                    621: ;                different from those in the input list.
                    622: ;
                    623: ;      INPUTS:   $0:  list of the !STF_NC_PNAMES form;
                    624: ;                      (see [Param_SaveValues])
                    625: ;
                    626: ;     OUTPUTS:   $R0: list identical in form to STF_NC_PNAMES, but
                    627: ;                     containing the current values of each parameter.
                    628: ;
                    629: ;                Parameters with no corresponding variable name (e.g., NONE)
                    630: ;                are not included.
                    631: ;
                    632: ;*************************************************************************
                    633: [Param_DiffValues]
                    634: 
                    635:    Set Plist = {}
                    636: 
                    637:    ForListDo $($0)
                    638:        Set Pelem = $($)
                    639:        Set Name = *($(Pelem),1)
                    640:        Set Qvar = *($(Pelem),2)
                    641:        Set Qvalue = *($(Pelem),3)
                    642: 
                    643:        Ifstr(i) $(Qvar) != "NONE"
                    644:            Set QnewValue = $(!p:$(Qvar))
                    645:            Ifint $(QnewValue) != $(Qvalue)
                    646:                Debug-Output "NCPARAM.INF: Param_DiffValues: param "$(Name)" value has changed"
                    647:                Set Plist = >($(Plist),{$(Name),$(Qvar),$(QnewValue)})
                    648:            Endif
                    649:        Endif
                    650:    EndForListDo
                    651: 
                    652:    Return $(Plist)
                    653: 
                    654: ;-----------------------------------------------------------------------
                    655: ;
                    656: ; ROUTINE:      Param_SetDefaults
                    657: ;
                    658: ; DESCRIPTION:  Given the (possibly empty) set of results of a
                    659: ;               call to Query Netcard Parameters (DTQUERY), set the default
                    660: ;               value variables.  First choice is to a detected value;
                    661: ;               second choice is the hard-coded default in [ParamSettings].
                    662: ;
                    663: ; INPUTS:       $0:  List returned by [Param_QueryCard] section below or
                    664: ;                    an empty list, {}.
                    665: ;
                    666: ;               !STF_NC_PNAMES list created by INF file.
                    667: ;
                    668: ; OUTPUTS:      Variables named in !STF_NC_PNAMES are set.
                    669: ;
                    670: ;------------------------------------------------------------------------
                    671: [Param_SetDefaults]
                    672: 
                    673:    Set QueryList = $($0)
                    674:    Debug-Output "NCPARAM.INF: Param_SetDefaults, QueryList = "$(QueryList)
                    675: 
                    676:    ;  Iterate the name list; find the corresponding value in the
                    677:    ;  QueryList, if any.
                    678: 
                    679:    ForListDo $(!STF_NC_PNAMES)
                    680:        Set Pelem = $($)
                    681:        Set Name = *($(Pelem),1)
                    682:        Set Qvar = *($(Pelem),2)
                    683:        Set Qvalue = *($(Pelem),3)
                    684: 
                    685:        ForListDo $(QueryList)
                    686:            Set Qname = *($($),1)
                    687:            Ifstr(i) $(Qname) == $(Name)
                    688:                ;  Found a matching value from QueryList
                    689:                Debug-Output "NCPARAM.INF: Param_SetDefaults: default override for param "$(Qname)
                    690:                Set Qvalue = *($($),2)
                    691:            Endif
                    692:        EndForListDo
                    693: 
                    694:        ; If the name of the value-containing variable is not "NONE",
                    695:        ;  set it IN THE PARENT CONTEXT!
                    696: 
                    697:        Ifstr(i) $(Qvar) != "NONE"
                    698:            Debug-Output "NCPARAM.INF: Param_SetDefaults: setting "$(Qvar)" to "$(Qvalue)
                    699:            Set !p:$(Qvar) = $(Qvalue)
                    700:        Endif
                    701: 
                    702:    EndForListDo
                    703: 
                    704:    Return
                    705: 
                    706: 
                    707: ;-----------------------------------------------------------------------
                    708: ;
                    709: ; ROUTINE:      Param_QueryCard
                    710: ;
                    711: ; DESCRIPTION:  Call the NCPA's QueryConfiguration wrapper.  Return
                    712: ;               the list or the error.
                    713: ;
                    714: ; INPUTS:       $0:  integer detected card index
                    715: ;
                    716: ; OUTPUTS:      $R0: STATUS_SUCCESSFUL if OK
                    717: ;               $R1: QueryList; format:
                    718: ;
                    719: ;               {  {PARAMETER_1_NAME, <detected value> },
                    720: ;                  {PARAMETER_2_NAME, <detected value> },
                    721: ;                  ...
                    722: ;               }
                    723: ;
                    724: ;------------------------------------------------------------------------
                    725: [Param_QueryCard]
                    726:     Set CardIndex = $($0)
                    727:     Set Status = STATUS_SUCCESSFUL
                    728:     Set ResultList = {}
                    729: 
                    730:     Debug-Output "OEMNADDE.INF: Querying parameters for netcard "$(CardIndex)
                    731: 
                    732:     Set FLibraryErrCtl = 1  ;  Report DLL errors back to INF code
                    733:     LibraryProcedure NcpaResult $(!NCPA_HANDLE), CPlSetup $(!STF_HWND), DTQUERY, $(CardIndex)
                    734:     Set FLibraryErrCtl = 0
                    735: 
                    736:     Set ErrorStatus = *($(NcpaResult),1)
                    737:     Debug-Output "NCPARAM.INF: DTQUERY status was: "$(ErrorStatus)
                    738: 
                    739:     Ifint $(ErrorStatus) != 0
                    740:         Set Status = STATUS_FAILED
                    741:     Else
                    742:         Set ResultList = *($(NcpaResult),2)
                    743:     Endif
                    744: 
                    745:     Return $(Status) $(ResultList)
                    746: 
                    747: ;-----------------------------------------------------------------------
                    748: ;
                    749: ; ROUTINE:      Param_VerifyCard
                    750: ;
                    751: ; DESCRIPTION:  Call the NCPA's VerifyConfiguration wrapper.  Return
                    752: ;               the result.  Current settings must be in the variables
                    753: ;               named as default variables in the [ParamSettings]
                    754: ;               section.
                    755: ;
                    756: ; INPUTS:       $0:  integer detected card index
                    757: ;
                    758: ;               !STF_NC_PNAMES list
                    759: ;
                    760: ; OUTPUTS:      $R0: STATUS_SUCCESSFUL if OK
                    761: ;
                    762: ; NOTES:        The [ParamSettings] section is used to build up
                    763: ;               a list of the following form:
                    764: ;
                    765: ;               {  {PARAMETER_1_NAME, <chosen value> },
                    766: ;                  {PARAMETER_2_NAME, <chosen value> },
                    767: ;                  ...
                    768: ;               }
                    769: ;
                    770: ;------------------------------------------------------------------------
                    771: [Param_VerifyCard]
                    772:     Set CardIndex = $($0)
                    773: 
                    774:     Set Status = STATUS_FAILED
                    775:     Set VerifyList = {}
                    776: 
                    777:     ;  Build up the list of parameters using the default value
                    778:     ;  variable from the PARENT CONTEXT.  Ignore empty variables.
                    779: 
                    780:     ForListDo $(!STF_NC_PNAMES)
                    781:         Set Pelem = $($)
                    782:         Set Name = *($(Pelem),1)
                    783:         Set Qvar = *($(Pelem),2)
                    784:         Set Qvalue = $(!p:$(Qvar))
                    785:         Ifstr(i) $(Qvalue) != ""
                    786:             Debug-Output "NCPARAM.INF: VerifyCard: "$(Qvar)" = "$(Qvalue)
                    787:             Set VerifyList = >($(VerifyList),{$(Name),$(Qvalue)})
                    788:         Endif
                    789:     EndForListDo
                    790: 
                    791:     ;  Verify the parameters.
                    792: 
                    793:     Debug-Output "NCPARAM.INF: Verifying parameters for netcard "$(CardIndex)
                    794:     Debug-Output "NCPARAM.INF: Parameters are: "$(VerifyList)
                    795: 
                    796:     Set FLibraryErrCtl = 1  ;  Report DLL errors back to INF code
                    797:     LibraryProcedure NcpaResult $(!NCPA_HANDLE), CPlSetup $(!STF_HWND), DTVERIFY, $(CardIndex), $(VerifyList)
                    798:     Set FLibraryErrCtl = 0
                    799: 
                    800:     Set ErrorStatus = *($(NcpaResult),1)
                    801:     Debug-Output "NCPARAM.INF: DTVERIFY status was: "$(ErrorStatus)
                    802: 
                    803:     Ifint $(ErrorStatus) == 0
                    804:         Set Status = STATUS_SUCCESSFUL
                    805:     Endif
                    806: 
                    807:     Return $(Status)
                    808: 
                    809: ;-----------------------------------------------------------------------
                    810: ;
                    811: ; ROUTINE:      Param_VerifyResources
                    812: ;
                    813: ; DESCRIPTION:  Call the NCPA's VerifyConfiguration wrapper for
                    814: ;               and existing card.  This routine "diffs" the current
                    815: ;               parameter settings and attempts to "claim" the new
                    816: ;               parameters at the NT level.   See [Param_SaveValues]
                    817: ;               and [Param_DiffValues] for list construction details.
                    818: ;
                    819: ; INPUTS:       $0:  parameter difference list produced by [Param_DiffValues]
                    820: ;
                    821: ; OUTPUTS:      $R0: STATUS_SUCCESSFUL if OK
                    822: ;
                    823: ; NOTES:        If $0 is the empty list, STATUS_SUCCESSFUL is returned.
                    824: ;
                    825: ;               A list of the following form is constructed for DTVERIFY:
                    826: ;
                    827: ;               {  {PARAMETER_1_NAME, <chosen value> },
                    828: ;                  {PARAMETER_2_NAME, <chosen value> },
                    829: ;                  ...
                    830: ;               }
                    831: ;
                    832: ;------------------------------------------------------------------------
                    833: [Param_VerifyResources]
                    834:     Set DiffParamList = $($0)
                    835: 
                    836:     ;  See if the difference list is empty
                    837: 
                    838:     Ifstr(i) $(DiffParamList) == {}
                    839:         Set Status = STATUS_SUCCESSFUL
                    840:         Goto PVR_Return
                    841:     Endif
                    842: 
                    843:     Set Status = STATUS_FAILED
                    844: 
                    845:     ;  Build up the list of parameters which have changed.
                    846: 
                    847:     Set VerifyList = {}
                    848:     ForListDo $(DiffParamList)
                    849:         Set Pelem = $($)
                    850:         Set Name = *($(Pelem),1)
                    851:         Set Qvar = *($(Pelem),2)
                    852:         Set Qvalue = $(!p:$(Qvar))
                    853:         Ifstr(i) $(Qvalue) != ""
                    854:             Debug-Output "NCPARAM.INF: VerifyResources: "$(Qvar)" = "$(Qvalue)
                    855:             Set VerifyList = >($(VerifyList),{$(Name),$(Qvalue)})
                    856:         Endif
                    857:     EndForListDo
                    858: 
                    859:     ;  Claim the resource delta.
                    860: 
                    861:     Debug-Output "NCPARAM.INF: VerifyResources: Claiming changed resource parameter values"
                    862:     Debug-Output "NCPARAM.INF: Parameters are: "$(VerifyList)
                    863: 
                    864:     Set FLibraryErrCtl = 1  ;  Report DLL errors back to INF code
                    865:     LibraryProcedure NcpaResult $(!NCPA_HANDLE), CPlSetup $(!STF_HWND), DTCLAIM, $(VerifyList)
                    866:     Set FLibraryErrCtl = 0
                    867: 
                    868:     Set ErrorStatus = *($(NcpaResult),1)
                    869:     Debug-Output "NCPARAM.INF: DTCLAIM status was: "$(ErrorStatus)
                    870: 
                    871:     Ifint $(ErrorStatus) == 0
                    872:         Set Status = STATUS_SUCCESSFUL
                    873:     Endif
                    874: 
                    875: PVR_Return = +
                    876:     Return $(Status)
                    877: 
                    878: ;-----------------------------------------------------------------------
                    879: ;
                    880: ; ROUTINE:      Param_ParameterConfidence
                    881: ;
                    882: ; DESCRIPTION:  Return TRUE if the netcard's required parameters are
                    883: ;               detectable.
                    884: ;
                    885: ;               Iterate over STF_NC_PARAMS; check that all the type
                    886: ;               0 and 1 parameters have a detection confidence
                    887: ;               factor greater than 70.
                    888: ;
                    889: ; INPUTS:       None
                    890: ;
                    891: ; OUTPUTS:      $R0: STATUS_SUCCESSFUL or STATUS_FAILED
                    892: ;
                    893: ;------------------------------------------------------------------------
                    894: [Param_ParameterConfidence]
                    895: 
                    896:     Set LowestConf = 100
                    897:     Set Status = STATUS_SUCCESSFUL
                    898:     Set LowestParam = ""
                    899: 
                    900:     ForListDo $(!STF_NC_PARAMS)
                    901:         Set Ptype = *($($),2)
                    902:         Set Pconf = *($($),3)
                    903:         Ifint $(Ptype) < 2
                    904:             Ifint $(Pconf) < $(LowestConf)
                    905:                 Set LowestConf = $(Pconf)
                    906:                 Set LowestParam = *($($),1)
                    907:             Endif
                    908:         Endif
                    909:     EndForListDo
                    910: 
                    911:     Ifint $(LowestConf) < 70
                    912:         Set Status = STATUS_FAILED
                    913:         Debug-Output "NCPARAM.INF: parameter "$(LowestParam)" cannot be adequately detected"
                    914:     Endif
                    915: 
                    916:     Return $(Status)
                    917: 
                    918: ;-----------------------------------------------------------------------
                    919: ;
                    920: ; ROUTINE:      HexListFromDecList
                    921: ;
                    922: ; DESCRIPTION:  Return a list of hex values from a list of decimal values
                    923: ;
                    924: ; INPUTS:       $0:  the input list of decimal numbers
                    925: ;
                    926: ; OUTPUTS:      $R0: the result list of hex values
                    927: ;
                    928: ;------------------------------------------------------------------------
                    929: [HexListFromDecList]
                    930: 
                    931:     Set HexList = {}
                    932: 
                    933:     ForListDo $($0)
                    934:         Set-DecToHex HexValue = $($)
                    935:         Set HexList = >($(HexList),$(HexValue))
                    936:     EndForListDo
                    937: 
                    938:     Return $(HexList)
                    939: 
                    940: ;-----------------------------------------------------------------------
                    941: ;
                    942: ;  End of NCPARAM.INF
                    943: ;
                    944: ;-----------------------------------------------------------------------
                    945: 

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.