OEMSETUP.INF Driver File Contents (nk1000t32bit.zip)

;*******************************************************************************
; Module Description:
;    Oemsetup.inf for Altima Gigabit Ethernet.
;
; History:
;    06/03/00 Hav Khauv         Inception.
;*******************************************************************************

[Identification]
    OptionType = NetAdapter


[Options]
    A1KNT4


[PlatformsSupported]
    PCI


[LanguagesSupported]
    ENG, English


[RequestedMediaTypeA1KNT4]
    "Auto",                                 0
    "10 Mb Half",                           3
    "10 Mb Full",                           4
    "100 Mb Half",                          5
    "100 Mb Full",                          6
;    "1 Gb Half",                            7
;    "1 Gb Full",                            8


[FlowControlCapA1KNT4]
    "Disable",                              0
    "Rx Pause",                             1
    "Tx Pause",                             2
    "Rx/Tx Pause",                          3
    "Auto",                                 2147483648


[RxMtuA1KNT4]
    "1500",                                 1500
    "2000",                                 2000
    "2500",                                 2500
    "3000",                                 3000
    "3500",                                 3500
    "4000",                                 4000
; Altima max frame size supported is 4000
;    "4500",                                 4500
;    "5000",                                 5000
;    "5500",                                 5500
;    "6000",                                 6000
;    "6500",                                 6500
;    "7000",                                 7000
;    "7500",                                 7500
;    "8000",                                 8000
;    "8500",                                 8500
;    "9000",                                 9000


[OptionsTextENG]
    A1KNT4 = "Altima Gigabit Ethernet Controller"


[FileConstants]
    UtilityInf      = "UTILITY.INF"
    SubroutineInf   = "SUBROUTN.INF"

    MAXIMUM_ALLOWED = 33554432
    NoTitle         = 0

    Manufacturer        = "Altima"
    ProductMajorVersion = "2"
    ProductMinorVersion = "93"
    ProductVersion      = $(ProductMajorVersion)"."$(ProductMinorVersion)

    NetEventDll              = "%SystemRoot%\System32\netevent.dll;%SystemRoot%\System32\drivers\A1KNT4.sys"
    ProductSoftwareImagePath = "\SystemRoot\System32\drivers\A1KNT4.sys"
    A1KdtectDll              = "a1kdtect.dll"

    MiniportProductName              = "A1KNT4"
    MiniportProductKeyName           = $(!NTN_SoftwareBase)"\"$(Manufacturer)+
                                       "\"$(MiniportProductName)+
                                       "\CurrentVersion"
    MiniportSoftwareType             = "driver"

    MiniportNetRuleSoftwareUse       = $(MiniportSoftwareType)
    MiniportNetRuleSoftwareClass     = {"A1KNT4Driver basic"}
    MiniportNetRuleSoftwareType      = "A1KNT4Sys ndisDriver A1KNT4Driver"
    MiniportNetRuleSoftwareBindForm  = """A1KNT4Sys"" yes no container"
    MiniportNetRuleSoftwareBindable  = {"A1KNT4Driver A1KNT4Adapter non "+
                                        "exclusive 100"}

    MiniportNetRuleHardwareType      = "A1KNT4 A1KNT4Adapter"
    MiniportNetRuleHardwareBindForm  = " yes yes container"
    MiniportNetRuleHardwareClass     = {"A1KNT4Adapter basic"}

    ServiceKeyName                   = "SYSTEM\CurrentControlSet\Services"

    A1KNT4HelpId                     = 100
    A1KNT4HelpFile                   = "a1knt4.hlp"

;    IBM_HPP_ServiceKey               = "SYSTEM\CurrentControlSet\Services\"+
;        "HotSrv\SupportedDevices\173B-03E8-173B-03E8"
;    CPQ_HPP_Key                      = "SOFTWARE\Compaq\Cpqrcmc\ClassDLLs\"+
;        "NicMiniPort"


[FileConstantsENG]
    FunctionA1KNT4Title = "Altima Gigabit Ethernet Controller"

    MiniportProductSoftwareTitle       = $(FunctionA1KNT4Title)
    MiniportProductSoftwareDisplayName = "Altima Gigabit Ethernet Controller"

    MiniportA1KNT4HardwareTitle = "Altima Gigabit Ethernet Controller"
    MiniportA1KNT4Description   = "Altima Gigabit Ethernet NDIS 4.0 Driver "+
        "Version "$(ProductVersion)"."

    MsgShellErrorTitle  = "Error: "$(Function$(OptionId)Title)
    MsgShellErrorText   = "Shell Code Error."
    MsgRegistryKeyDoesNotExist = "Open registry key failed."
    MsgNoAdapterFound = "Network card is not present in the system."
    MsgDowngrade = "Cannot downgrade to an older driver.  To downgrade, "+
        "you must uninstall first and then re-install the older driver."
    MsgUpdateDone = "Driver update will take effect on the next reboot."
    MsgCannotFindA1KdtectDll = "Cannot load A1Kdtect.dll file."


[DialogConstantsENG]
    Help        = "&Help"
    Exit        = "C&ancel"
    OK          = "&OK"
    HelpContext = ""
    Continue    = "&Continue"
    Cancel      = "C&ancel"


[RequestedMediaTypeDlgENG]
    DlgText     = "Select the line speed and duplex mode to connect "+
                  "to the network.  The recommended selection is 'Auto' "+
                  "which sets up the adapter to auto detect the optimal "+
                  "connection."
    DlgTemplate = "WD"
    DlgType     = "Combination"
    Caption     = "Configurable Driver Parameters."
    Combo1Label = "&Speed && Duplex:"
    Combo1List  = $(ConnectionList)
    Combo1Out   = $(ConnectionValue)
    Combo2Label = "&Flow Control:"
    Combo2List  = $(FlowControlCapList)
    Combo2Out   = $(FlowControlCapValue)
    Combo3Label = "&Jumbo Mtu:"
    Combo3List  = $(RxMtuList)
    Combo3Out   = $(RxMtuValue)
    ComboListItemsIn  = { Combo1List, Combo2List, Combo3List }
    ComboListItemsOut = { Combo1Out, Combo2Out, Combo3Out }
    EditTextLim = ""
    CBOptionsGreyed = {}
    MinHelpId = 100
    MaxHelpId = 1000
    HelpContext = $($(OptionId)HelpId)


[DebugControl]
    !DebugOutputControl = 0


[CurrentDate]
    Now = {} ? $(!LIBHANDLE) GetSystemDate


[Source Media Descriptions]
    1 = "Altima Driver Installation Disk", TAGFILE = a1knt4.sys


[Files-A1KNT4Driver]
    1, a1knt4.sys, SIZE=999


[Files-A1KNT4Help]
    1, a1knt4.hlp, SIZE=999


[Files-Other]
    1, a1kdtect.dll, SIZE=65



;*******************************************************************************
; Description:
;    
; Input:
;    None.
;
; Output:
;    None.
;*******************************************************************************
[OemDriverInfo]
    ; Driver Information Entries
    ; These items will be set by IHV...
    Set DriverMfgr = "Altima"                   ; IHV name
    Set DriverVersionID = "2.5"                  ; The IHV driver package version
    Set BaseDriverFileVersion = $(ProductVersion) ; Version in Key file
    Set BaseDriverFileName = "a1knt4.sys"         ; Key file for version check

    ; These items will be set to VENDOR values, and then set to OEM-specific by OEM
    Set DriverOEM = "Altima"                                          ; name of the OEM
    Set DriverFamily = "NIC"                                        ; device family (NIC, Storage, Video...)
    Set DriverProduct = "AC1000"                                   ; Specific Name of device (chipset, for example)
    Set DriverDescription = "Altima Gigabit Ethernet Controller"  ; Description of device (product name, OS or system supported)
    Set DriverOEMVersion = "A00"                                    ; OEM-specified version

    ; This section is added to all INFs to add registry entries for Driver Info.
    set DriverInfoRegList = { "InstalledOptions",$(DriverOEM),$(DriverFamily),$(DriverMfgr),$(DriverProduct) }
    set DriverInfoKey = "SOFTWARE"
    OpenRegKey $(!REG_H_LOCAL) "" $(DriverInfoKey) $(!REG_KEY_CREATE_SUB_KEY) DriverInfoOldKeyHandle
    ifstr $(DriverInfoOldKeyHandle) == ""
        shell "subroutn.inf" SetupMessage $(!STF_LANGUAGE) "NONFATAL" "DriverInfo registry failed. Could not open HKLM\Software ("$(RegLastError)")"
        set DriverInfoFailed = "FAIL"
    else
        ForListDo $(DriverInfoRegList)
            Set NewDriverInfoKey = $(DriverInfoKey)"\"$($)
            OpenRegKey $(!REG_H_LOCAL) "" $(NewDriverInfoKey) $(!REG_KEY_ALL_ACCESS) DriverInfoKeyHandle
            ifstr(i) $(DriverInfoKeyHandle) == ""
                CreateRegKey $(DriverInfoOldKeyHandle) {$($),0,GenericClass} "" $(!REG_KEY_ALL_ACCESS) "" DriverInfoKeyHandle
                ifstr $(DriverInfoKeyHandle) == ""
                    shell "subroutn.inf" SetupMessage $(!STF_LANGUAGE) "NONFATAL" "DriverInfo registry failed. Could not create key:"$($)" ("$(RegLastError)")"
                    set DriverInfoFailed = "FAIL"
                endif
            endif
            CloseRegKey $(DriverInfoOldKeyHandle)
            set DriverInfoOldKeyHandle = $(DriverInfoKeyHandle)
            set DriverInfoKey = $(NewDriverInfoKey)
        EndForListDo
    endif

    ifstr $(DriverInfoFailed) != "FAIL"
        SetRegValue $(DriverInfoKeyHandle) {"Description",0,$(!REG_VT_SZ),$(DriverDescription)}
        SetRegValue $(DriverInfoKeyHandle) {"CurrentVer",0,$(!REG_VT_SZ),$(DriverOEMVersion)}
        SetRegValue $(DriverInfoKeyHandle) {"Ver_"$(DriverOEMVersion),0,$(!REG_VT_SZ),$(DriverVersionID)}
        SetRegValue $(DriverInfoKeyHandle) {"BaseDriverFileName",0,$(!REG_VT_SZ),$( BaseDriverFileName)}
        SetRegValue $(DriverInfoKeyHandle) {"BaseDriverFileVersion",0,$(!REG_VT_SZ),$(BaseDriverFileVersion)}

        CloseRegKey $(DriverInfoKeyHandle)
    endif

    return






;*******************************************************************************
; Description:
;    
; Input:
;    None.
;
; Output:
;    None.
;*******************************************************************************
[ShowShellErrorMessage]
    read-syms DebugControl
    debug-output "### ShowShellErrorMessage"

    read-syms FileConstants
    read-syms FileConstants$(!STF_LANGUAGE)

    set DlgType      = "MessageBox"
    set STF_MB_TITLE = $(MsgShellErrorTitle)
    set STF_MB_TEXT  = $(MsgShellErrorText)
    set STF_MB_TYPE  = 1
    set STF_MB_ICON  = 3
    set STF_MB_DEF   = 1

    ui start "Error Message"

    return



;*******************************************************************************
; Description:
;    
; Input:
;    $($0) = "WARNING", "FATAL", "NONFATAL", or "STATUS"
;    $($1) = Registery fatal text code.
;
; Output:
;    STATUS_FAILED
;    STATUS_SUCCESSFUL
;*******************************************************************************
[ShowRegistryErrorMessage]
    read-syms DebugControl
    debug-output "### ShowRegistryErrorMessage"

    read-syms FileConstants
    read-syms FileConstants$(!STF_LANGUAGE)

    set Severity = $($0)
    set RegStrCode = $($1)

    shell $(UtilityInf) RegistryErrorString $(RegStrCode)
    ifint $($ShellCode) != $(!SHELL_CODE_OK)
        shell "" ShowShellErrorMessage
        return STATUS_FAILED
    endif

    set RegText = $($R0)

    shell $(SubroutineInf) SetupMessage $(!STF_LANGUAGE) $(Severity) $(RegText)

    return STATUS_SUCCESSFUL



;*******************************************************************************
; Description:
;    Displays shell error message.
;    
; Input:
;    $($0) = "WARNING", "FATAL", "NONFATAL", or "STATUS"
;    $($1) = Fatal text string.
;
; Output:
;    None.
;*******************************************************************************
[ShowErrorMessage]
    read-syms DebugControl
    debug-output "### ShowErrorMessage"

    read-syms FileConstants

    shell $(SubroutineInf) SetupMessage $(!STF_LANGUAGE) $($0) $($1)
    ifint $($ShellCode) != $(!SHELL_CODE_OK)
        shell "" ShowShellErrorMessage
    endif

    return



;*******************************************************************************
; Description:
;    
; Input:
;
; Output:
;*******************************************************************************
[Install-Help]
    debug-output "### Install-Help"

    set STF_VITAL = ""
    set STF_OVERWRITE = "VERIFYSOURCEOLDER"

    AddSectionFilesToCopyList Files-$(OptionId)Help $(SrcDir) +
        $(!STF_WINDOWSSYSPATH)

    set !STF_OVERWRITE = TRUE
    set !STF_NCPA_FLUSH_COPYLIST = TRUE

    CopyFilesInCopyList

    exit



;*******************************************************************************
; Description:
;    
; Input:
;
; Output:
;*******************************************************************************
[Install-Update]
    debug-output "### Install-Update"

    set STF_VITAL     = ""
    set STF_OVERWRITE = "VERIFYSOURCEOLDER"

    AddSectionFilesToCopyList Files-$(OptionId)Driver $(SrcDir) +
        $(!STF_WINDOWSSYSPATH)\drivers
    AddSectionFilesToCopyList Files-$(OptionId)Help $(SrcDir) +
        $(!STF_WINDOWSSYSPATH)

    set !STF_NCPA_FLUSH_COPYLIST = TRUE

    CopyFilesInCopyList

    exit



;*******************************************************************************
; Description:
;    
; Input:
;    None.
;
; Output:
;    None.
;*******************************************************************************
[Install-Option]
    debug-output "### Install-Option"

    ; Copy files.
    set STF_VITAL = ""
    ifstr(i) $(AddCopy) == "YES"
        debug-output "Add driver file to copy list."
        AddSectionFilesToCopyList Files-$(OptionId)Driver $(SrcDir) +
            $(!STF_WINDOWSSYSPATH)\drivers
    endif

    ifstr(i) $(DoCopy) == "YES"
        debug-output "copy files in copy list."
        set !STF_NCPA_FLUSH_COPYLIST = TRUE
        CopyFilesInCopyList
    endif

    exit



;*******************************************************************************
; Description:
;    
; Input:
;    None.
;
; Output:
;    $($R0): STATUS: STATUS_SUCCESSFUL
;    $($R1): Option Type (COMPUTER ...)
;    $($R2): Diskette description
;*******************************************************************************
[Identify]
    read-syms DebugControl
    debug-output "### Identify"

    read-syms Identification

    set Status     = STATUS_SUCCESSFUL
    set Identifier = $(OptionType)
    set Media      = #("Source Media Descriptions", 1, 1)

    return $(Status) $(Identifier) $(Media)



;*******************************************************************************
; Description:
;
; Input:
;    $($0):  Language used.  (ENG|FRN|...)
;
; Output:
;    $($R0): STATUS: STATUS_SUCCESSFUL
;                    STATUS_NOLANGUAGE
;                    STATUS_FAILED
;                    STATUS_NOTSUPPORTED
;
;    $($R1): Option List
;    $($R2): Option Text List
;*******************************************************************************
[ReturnOptions]
    read-syms DebugControl
    debug-output "### ReturnOptions"

    set OptionList     = {}
    set OptionTextList = {}
    set LanguageList   = ^(LanguagesSupported, 1)

    ifcontains(i) $($0) in $(LanguageList)
        set Status         = STATUS_SUCCESSFUL
        set OptionList     = ^(Options, 1)
        set OptionTextList = ^(OptionsText$($0), 1)

        ifstr(i) $($1) != ""
            set PlatformList = ^(PlatformsSupported, 1)
            ifcontains(i) $($1) not-in $(PlatformList)
                debug-output "Unknown platform:  "$($1)
                set Status = STATUS_NOLANGUAGE
            endif
        endif
    else
        debug-output "Language not supported."
        set Status = STATUS_NOLANGUAGE
    endif

    return $(Status) $(OptionList) $(OptionTextList)



;*******************************************************************************
; Description:
;    This section performs the following tasks:
;       Copy files representing Options.
;       Configure the installed option.
;       Update the registry for the installed option
;
; Input:
;    $($0):  Language to use
;    $($1):  OptionID to install
;    $($2):  SourceDirectory
;    $($3):  AddCopy  (YES | NO)
;    $($4):  DoCopy   (YES | NO)
;    $($5):  DoConfig (YES | NO)
;
; Output:
;    $($R0): STATUS: STATUS_SUCCESSFUL |
;                    STATUS_NOLANGUAGE |
;                    STATUS_USERCANCEL |
;                    STATUS_FAILED
;*******************************************************************************
[InstallOption]
    read-syms DebugControl
    debug-output "### InstallOption"

    Set LanguageList = ^(LanguagesSupported, 1)
    ifcontains(i) $($0) not-in $(LanguageList)
        return STATUS_NOLANGUAGE
    endif

    set OptionId = $($1)
    set SrcDir = $($2)

    read-syms FileConstants$(!STF_LANGUAGE)
    read-syms FileConstants

    set-title $(Function$(OptionId)Title)

    ifstr(i) $(!NTN_InstallMode) == Deinstall
        shell "" RemoveSection $(OptionId)
    else-ifstr(i) $(!NTN_InstallMode) == Update
        shell "" UpdateSection $(OptionId) $(SrcDir)
    else-ifstr(i) $(!NTN_InstallMode) == Bind
        shell "" BindSection $(OptionId)
    else-ifstr(i) $(!NTN_InstallMode) == Configure
        shell "" ConfigureSection $(OptionId)
    else
        startwait
        shell "" InstallSection $($1) $($2) $($3) $($4) $($5)
        endwait

        ifstr(i) $($R0) != STATUS_SUCCESSFUL
            shell "" RemoveSection
            return STATUS_FAILED
        endif
    endif

    debug-output "Final status: "$($R0)

    return $($R0)



;*******************************************************************************
; Description:
;    
; Input:
;    $($0): OptionId
;
; Output:
;    $($R0) Status
;*******************************************************************************
[RemoveSection]
    read-syms DebugControl
    debug-output "### RemoveSection"

    set OptionId = $($0)

    read-syms FileConstants
    read-syms FileConstants$(!STF_LANGUAGE)

    ifstr(i) $(MiniportProductKeyName) == $(!NTN_RegBase)
        debug-output "Removing software component."
        shell $(UtilityInf), RemoveSoftwareComponent, $(Manufacturer), +
            $(MiniportProductName)
    else
        debug-output "Removing hardware component."
        shell $(UtilityInf), RemoveHardwareComponent, $(Manufacturer), +
            $(MiniportProductName), $(!NTN_RegBase)
    endif

    return STATUS_SUCCESSFUL



;*******************************************************************************
; Description:
;    
; Input:
;    $($0):  OptionId
;    $($1):  SourceDirectory
;
; Output:
;    $($R0) Status
;*******************************************************************************
[UpdateSection]
    read-syms DebugControl
    debug-output "### UpdateSection"

    set OptionId = $($0)
    set SrcDir = $($1)

    read-syms FileConstants
    read-syms FileConstants$(!STF_LANGUAGE)

    openregkey $(!REG_H_LOCAL) "" $(MiniportProductKeyName) $(MAXIMUM_ALLOWED) +
        ProductKey
    ifstr $(ProductKey) == ""
        debug-output "Cannot get registry key."
        shell "" ShowErrorMessage "FATAL" $(MsgRegistryKeyDoesNotExist)
        return STATUS_FAILED
    endif

    getregvalue $(ProductKey), "MajorVersion", VersionInfo
    set MajorVersion = *($(VersionInfo), 4)
    debug-output "Major version: "$(MajorVersion)
    getregvalue $(ProductKey), "MinorVersion", VersionInfo
    set MinorVersion = *($(VersionInfo), 4)
    debug-output "Minor version: "$(MinorVersion)

    set-mul OldVersion = $(MajorVersion), 1000
    set-add OldVersion = $(OldVersion), $(MinorVersion)

    set-mul NewVersion = $(ProductMajorVersion), 1000
    set-add NewVersion = $(NewVersion), $(ProductMinorVersion)

    ifint $(OldVersion) > $(NewVersion)
        debug-output "Oldversion: "$(OldVersion)",   NewVersion: "$(NewVersion)
        shell "" ShowErrorMessage "FATAL" $(MsgDowngrade)
        return STATUS_USERCANCEL
    endif

    install "Install-Update"

    setregvalue $(ProductKey) { MajorVersion, $(NoTitle), $(!REG_VT_SZ), +
        $(ProductMajorVersion) }
    setregvalue $(ProductKey) { MinorVersion, $(NoTitle), $(!REG_VT_SZ), +
        $(ProductMinorVersion) }

    closeregkey $(ProductKey)

    ; Enumerate all netcards installed of this type and update them
    set iSearch = 1     ; start of search.

    nextnetcard = +
        shell $(UtilityInf), FindNextNetworkCard, $(MiniportProductName), +
            $(iSearch)
        set KeyNetcard = $($R0)
        set iSearch = $($R1)

        ifstr $(KeyNetcard) != $(KeyNull)
            setregvalue $(KeyNetcard) { Description, $(NoTitle), +
                $(!REG_VT_SZ), $(Miniport$(OptionId)Description) }
            closeregkey $(KeyNetcard)
            goto nextnetcard
        Endif

    
    shell "" ShowErrorMessage "NONFATAL" $(MsgUpdateDone)

    return STATUS_SUCCESSFUL



;*******************************************************************************
; Description:
;    
; Input:
;    $($0):  OptionId
;
; Output:
;    $($R0) Status
;*******************************************************************************
[BindSection]
    read-syms DebugControl
    debug-output "### BindSection"

    set OptionId = $($0)

    return STATUS_SUCCESSFUL



;*******************************************************************************
; Description:
;    
; Input:
;    None
;
; Output:
;    None
;*******************************************************************************
[Install-OTHER]
    set STF_VITAL = ""
    set STF_OVERWRITE = "VERIFYSOURCEOLDER"
    AddSectionFilesToCopyList Files-Other $(SrcDir) $(!STF_WINDOWSSYSPATH)
    set !STF_NCPA_FLUSH_COPYLIST = TRUE
    CopyFilesInCopyList
    Exit



;*******************************************************************************
; Description:
;    
; Input:
;    None
;
; Output:
;    None
;*******************************************************************************
[Install-ChangeDefaults]
    debug-output "### Install-ChangeDefaults"

    ; BusNum, DeviceNum, and FunctionNum must be initialized before calling
    ; this section.

    ; Load A1Kdtect dll so we can read PCI configuration registers mainly to
    ; get the PCI IDs.
    LoadLibrary $(MsgCannotFindA1KdtectDll) $(!STF_WINDOWSSYSPATH)"\"+
        $(A1KdtectDll) HwdtectDll

    ; Get subvendor ID.
    LibraryProcedure SVID $(HwdtectDll) A1KdtectPortIo "PciRd16" +
        $(BusNum) $(DeviceNum) $(FunctionNum) "0x2c"
    debug-output "SVID: "$(SVID)

    ; Get the subsystem id.
    LibraryProcedure SSID $(HwdtectDll) A1KdtectPortIo "PciRd16" +
        $(BusNum) $(DeviceNum) $(FunctionNum) "0x2e"
    debug-output "SSID: "$(SSID)

    set MiniportA1KNT4Description   = "Altima Gigabit Ethernet Controller "+
        "NDIS 4.0 Driver Version "$(ProductVersion)"."

    ; Customize the title and description of displayed Adapter.
    ifstr(i) $(SVID) == "0x173b"
        ifstr(i) $(SSID) == "0x0003"
            set MiniportA1KNT4HardwareTitle = "Altima Gigabit Ethernet "+
                "(Fibre)"
            set ConnectionList = { "Auto", "1 Gb Full" }
            set ConnectionValueList = { 0, 8 }
		    debug-output "Set AdapterHardwareTitle to Altima G E Fibre"
        endif
    endif

    ifstr(i) $(SVID) == "0x173b"
        ifstr(i) $(SSID) == "0x03e8"
            set MiniportA1KNT4HardwareTitle = "Altima Gigabit Ethernet "+
                "(Copper)"
		    debug-output "Set AdapterHardwareTitle to Altima G E Copper"
        endif
    endif

    ifstr(i) $(SVID) == "0x173b"
        ifstr(i) $(SSID) == "0x0001"
            set MiniportA1KNT4HardwareTitle = "Altima Gigabit Ethernet "+
                "(Integrated Copper)"
		    debug-output "Set AdapterHardwareTitle to Altima G E IntegratedCopper"
        endif
    endif

    Exit



;*******************************************************************************
; Description:
;    
; Input:
;    $($0):  OptionId
;
; Output:
;    $($R0)  STATUS_FAILED or STATUS_SUCCESSFUL
;*******************************************************************************
[ConfigureSection]
    read-syms DebugControl
    debug-output "### ConfigureSection"

    set OptionId = $($0)

    read-syms FileConstants
    read-syms FileConstants$(!STF_LANGUAGE)

    openregkey $(!REG_H_LOCAL) "" $(!NTN_RegBase) $(MAXIMUM_ALLOWED) ProductKey
    ifstr $(ProductKey) == ""
        debug-output "Component not installed."
        shell "" ShowRegistryErrorMessage "FATAL" CANNOT_FIND_COMPONENT_SERVICE
        return STATUS_FAILED
    Endif

    shell $(UtilityInf) FindService $(ProductKey)
    ifstr(i) $($R0) != NO_ERROR
        debug-output "Canot not find the component."
        closeregkey $(ProductKey)
        shell "" ShowRegistryErrorMessage "FATAL" $($R0)
        return STATUS_FAILED
    endif

    closeregkey $($R1)
    closeregkey $(ProductKey)

    set ParameterKey = $($R2)

    ifstr $(ParameterKey) == ""
        shell "" ShowRegistryErrorMessage "FATAL" CANNOT_FIND_COMPONENT_SERVICE
        return STATUS_FAILED
    endif

    EnumRegValue $(ParameterKey) ValueList

    set ConnectionIndex = 0
    set FlowControlCapIndex = 0
    set RxMtuIndex = 1500
    ForListDo $(ValueList)
        set ValueItem = $($)
        set ValueName = *($(ValueItem), 1)
        set ValueData = *($(ValueItem), 4)
        ifstr(i) $(ValueName) == "RequestedMediaType"
            set ConnectionIndex = $(ValueData)
        endif

        ifstr(i) $(ValueName) == "FlowControlCap"
            set FlowControlCapIndex = $(ValueData)
        endif

        ifstr(i) $(ValueName) == "RxMtu"
            set RxMtuIndex = $(ValueData)
        endif

        ifstr(i) $(ValueName) == "BusNumber"
            set BusNum = $(ValueData)
        endif

        ifstr(i) $(ValueName) == "SlotNumber"
            set DeviceNum = $(ValueData)
        endif

        ifstr(i) $(ValueName) == "FunctionNumber"
            set FunctionNum = $(ValueData)
        endif
    EndForListDo

    set OldConnectionValue = $(ConnectionIndex)
    set OldFlowControlCapValue = $(FlowControlCapIndex)
    set OldRxMtuValue = $(RxMtuIndex)

    set ConnectionList = ^(RequestedMediaType$(OptionId), 1)
    set ConnectionValueList = ^(RequestedMediaType$(OptionId), 2)
    debug-output "ConnectionList: "$(ConnectionList)
    debug-output "ConnectionValueList: "$(ConnectionValueList)

    set FlowControlCapList = ^(FlowControlCap$(OptionId), 1)
    set FlowControlCapValueList = ^(FlowControlCap$(OptionId), 2)
    debug-output "FlowControlCapList: "$(FlowControlCapList)
    debug-output "FlowControlCapValueList: "$(FlowControlCapValueList)

    set RxMtuList = ^(RxMtu$(OptionId), 1)
    set RxMtuValueList = ^(RxMtu$(OptionId), 2)
    debug-output "RxMtuList: "$(RxMtuList)
    debug-output "RxMtuValueList: "$(RxMtuValueList)

    ; Get the bus, device, and function number are initialized above.
    install "Install-ChangeDefaults"
    debug-output "New connection list: "$(ConnectionList)
    debug-output "New connection value list: "$(ConnectionValueList)

    set ConnectionValue = *($(ConnectionList), ~($(ConnectionValueList), +
        $(ConnectionIndex)))
    ifstr(i) $(ConnectionValue) == ""
        set ConnectionValue = *($(ConnectionList), 1)
    endif

    set FlowControlCapValue = *($(FlowControlCapList), ~($(FlowControlCapValueList), +
        $(FlowControlCapIndex)))
    ifstr(i) $(FlowControlCapValue) == ""
        set FlowControlCapValue = *($(FlowControlCapList), 1)
    endif

    set RxMtuValue = *($(RxMtuList), ~($(RxMtuValueList), $(RxMtuIndex)))
    ifstr(i) $(RxMtuValue) == ""
        set RxMtuValue = *($(RxMtuList), 1)
    endif

    read-syms DialogConstants$(!STF_LANGUAGE)
    read-syms RequestedMediaTypeDlg$(!STF_LANGUAGE)

    debug-output "HelpContext = "$(HelpContext)
    sethelpfile $(!STF_WINDOWSSYSPATH)"\"$($(OptionId)HelpFile) +
        $(MinHelpId) $(MaxHelpId) $($(OptionId)HelpId)

    set ConnectionIndex = *($(ConnectionList), 1)
    set FlowControlCapIndex = *($(FlowControlCapList), 1)
    set RxMtuIndex = *($(RxMtuList), 1)

    set RetStatus = STATUS_SUCCESSFUL

    ui start "Config"
    ifstr(i) $(DLGEVENT) == "CONTINUE"
        set ConnectionIndex = $(Combo1Out)
        set FlowControlCapIndex = $(Combo2Out)
        set RxMtuIndex = $(Combo3Out)
    else-ifstr(i) $(DLGEVENT) == "BACK"
        set RetStatus = STATUS_USERCANCEL
    endif
    ui pop 1

    set NewConnectionValue = *($(ConnectionValueList), +
        ~($(ConnectionList), $(ConnectionIndex)))
    set NewFlowControlCapValue = *($(FlowControlCapValueList), +
        ~($(FlowControlCapList), $(FlowControlCapIndex)))
    set NewRxMtuValue = *($(RxMtuValueList), +
        ~($(RxMtuList), $(RxMtuIndex)))
    debug-output "New Connection value = "$(NewConnectionValue)
    debug-output "Old Connection value = "$(OldConnectionValue)
    debug-output "New FlowControlCap value = "$(NewFlowControlCapValue)
    debug-output "Old FlowControlCap value = "$(OldFlowControlCapValue)
    debug-output "New RxMtu value = "$(NewRxMtuValue)
    debug-output "Old RxMtu value = "$(OldRxMtuValue)

    ifstr(i) $(NewConnectionValue) == $(OldConnectionValue)
        ifstr(i) $(NewFlowControlCapValue) == $(OldFlowControlCapValue)
            ifstr(i) $(NewRxMtuValue) == $(OldRxMtuValue)
                set RetStatus = STATUS_USERCANCEL
            endif
        endif
    endif

    ifstr(i) $(RetStatus) == "STATUS_SUCCESSFUL"
        set NewValueList = {                                        +
            { RequestedMediaType, $(NoTitle), $(!REG_VT_DWORD),     +
                $(NewConnectionValue)},                             +
            { FlowControlCap, $(NoTitle), $(!REG_VT_DWORD),         +
                $(NewFlowControlCapValue)},                         +
            { RxMtu, $(NoTitle), $(!REG_VT_DWORD),                  +
                $(NewRxMtuValue)} }
        shell $(UtilityInf), AddValueList, $(ParameterKey), $(NewValueList)
    endif

    closeregkey $(ParameterKey)

    return $(RetStatus)



;*******************************************************************************
; Description:
;    
; Input:
;    $($0): PciIdList
;
; Output:
;    $($R0) Adapter list.
;*******************************************************************************
[BuildAdapterList]
    read-syms DebugControl
    read-syms FileConstants

    debug-output "### BuildAdapterList"

    set PciIdList = $($0)
    debug-output "PciIdList: "$(PciIdList)

    ; Load A1Kdtect dll so we can get the PCI sub vendor id.
    LoadLibrary $(MsgCannotFindA1KdtectDll) $(!STF_WINDOWSSYSPATH)"\"+
        $(A1KdtectDll) HwdtectDll

    set AllAdapterList = {}

    forlistdo $(PciIdList)
        set VID = *($($), 1)
        set DID = *($($), 2)
        debug-output "VID: "$(VID)"  DID: "$(DID)

        shell $(UtilityInf), GetPCIInformation, $(VID) $(DID)
        ifint $($ShellCode) == $(!SHELL_CODE_OK)
            set AdapterList = $($R0)
            debug-output "AdapterList: "$(AdapterList)

            forlistdo $(AdapterList)
                set Adapter = $($)
                set BusNum = *($(Adapter), 1)
                set DeviceNum = *($(Adapter), 2)
                set FunctionNum = *($(Adapter), 3)

                ; Get subvendor ID.
                LibraryProcedure SVID $(HwdtectDll) A1KdtectPortIo "PciRd16" +
                    $(BusNum) $(DeviceNum) $(FunctionNum) "0x2c"
                debug-output "SVID: "$(SVID)

                ; Get the subsystem id.
                LibraryProcedure SSID $(HwdtectDll) A1KdtectPortIo "PciRd16" +
                    $(BusNum) $(DeviceNum) $(FunctionNum) "0x2e"
                debug-output "SSID: "$(SSID)

                set AllAdapterList = >($(AllAdapterList), $(Adapter))
            endforlistdo
        endif
    endforlistdo

    FreeLibrary $(HwdtectDll)

    debug-output "AllAdapterList: "$(AllAdapterList)

    return $(AllAdapterList)



;*******************************************************************************
; Description:
;    
; Input:
;    $($0):  OptionId
;    $($1):  SourceDirectory
;    $($2):  AddCopy  (YES | NO)
;    $($3):  DoCopy   (YES | NO)
;    $($4):  DoConfig (YES | NO)
;
; Output:
;    $($R0)  STATUS_FAILED or STATUS_SUCCESSFUL
;*******************************************************************************
[InstallSection]
    read-syms DebugControl
    debug-output "### InstallSection"

    set OptionId = $($0)
    set SrcDir   = $($1)
    set AddCopy  = $($2)
    set DoCopy   = $($3)
    set DoConfig = $($4)

    read-syms FileConstants
    read-syms FileConstants$(!STF_LANGUAGE)

    detect CurrentDate

    ; Get installation source directory.
    ifstr(i) $(DoCopy) == "YES"
        debug-output "DoCopy"

        shell $(UtilityInf) DoAskSource $(!STF_CWDDIR) $(SrcDir) YES
        ifint $($ShellCode) != $(!SHELL_CODE_OK)
            shell "" ShowShellErrorMessage
            return STATUS_FAILED
        else-ifstr(i) $($R0) == STATUS_FAILED
            shell "" ShowRegistryErrorMessage "FATAL" ASK_SOURCE_FAIL
            return STATUS_FAILED
        else-ifstr(i) $($R0) == STATUS_USERCANCEL
            debug-output "User cancelled."
            return STATUS_USERCANCEL
        endif

        set SrcDir = $($R1)
    endif

    ; Default line setting.
    set ConnectionList = ^(RequestedMediaType$(OptionId), 1)
    set ConnectionValueList = ^(RequestedMediaType$(OptionId), 2)
    debug-output "ConnectionList = "$(ConnectionList)
    debug-output "ConnectionValueList = "$(ConnectionValueList)

    set FlowControlCapList = ^(FlowControlCap$(OptionId), 1)
    set FlowControlCapValueList = ^(FlowControlCap$(OptionId), 2)
    debug-output "FlowControlCapList: "$(FlowControlCapList)
    debug-output "FlowControlCapValueList: "$(FlowControlCapValueList)

    set RxMtuList = ^(RxMtu$(OptionId), 1)
    set RxMtuValueList = ^(RxMtu$(OptionId), 2)
    debug-output "RxMtuList: "$(RxMtuList)
    debug-output "RxMtuValueList: "$(RxMtuValueList)

    set ConnectionIndex = 0
    set FlowControlCapIndex = 0
    set RxMtuIndex = 1500

    set ConnectionValue = *($(ConnectionList), +
            ~($(ConnectionValueList), $(ConnectionIndex)))
    set FlowControlCapValue = *($(FlowControlCapList), +
            ~($(FlowControlCapValueList), $(FlowControlCapIndex)))
    set RxMtuValue = *($(RxMtuList), ~($(RxMtuValueList), +
            $(RxMtuIndex)))
    set ConnectionIndex = $(ConnectionValue)
    set FlowControlCapIndex = $(FlowControlCapValue)
    set RxMtuIndex = $(RxMtuValue)

    ; First time installation -- we need to install the software component.
    openregkey $(!REG_H_LOCAL) "" $(MiniportProductKeyName) $(MAXIMUM_ALLOWED) +
        ProductKey
    ifstr $(ProductKey) == ""
        debug-output "First time installation"

        install "Install-Help"
        install "Install-OTHER"

;        ; Pop up a GUI to allow the user to configure the line setting.
;        ifstr(i) $(!STF_GUI_UNATTENDED) != "YES"
;            read-syms DialogConstants$(!STF_LANGUAGE)
;            read-syms RequestedMediaTypeDlg$(!STF_LANGUAGE)
;
;            sethelpfile $(!STF_WINDOWSSYSPATH)"\"$($(OptionId)HelpFile) +
;                $(MinHelpId) $(MaxHelpId) $($(OptionId)HelpId)
;
;            ui start "Config"
;
;            ifstr(i) $(DLGEVENT) == "CONTINUE"
;                set ConnectionIndex = $(Combo1Out)
;                set FlowControlCapIndex = $(Combo2Out)
;                set RxMtuIndex = $(Combo3Out)
;                debug-output "Connection Index = "$(ConnectionIndex)
;                debug-output "FlowControlCap Index = "$(FlowControlCapIndex)
;                debug-output "RxMtu Index = "$(RxMtuIndex)
;            else-ifstr(i) $(DLGEVENT) == "BACK"
;                debug-output "gui cancelled"
;                ui pop 1
;                return STATUS_USERCANCEL
;            endif
;            ui pop 1
;        endif
;
        ifstr(i) $(STF_INSTALL_OUTCOME) != STF_SUCCESS
            debug-output "Copy file failed."
            shell "" ShowRegistryErrorMessage "FATAL" UNABLE_COPY_FILE
            return STATUS_FAILED
        endif

        install "Install-Option"

        debug-output "Create the software component."

        shell $(UtilityInf), AddSoftwareComponent, $(Manufacturer), +
            $(MiniportProductName), $(MiniportProductName), +
            $(MiniportProductSoftwareDisplayName), $(STF_CONTEXTINFNAME), +
            $(ProductSoftwareImagePath), "kernel", "NDIS", {}, "", +
            $(NetEventDll)
        ifstr(i) $($R0) != NO_ERROR
            debug-output "Add miniport software component failed."

            closeregkey $($R1)
            closeregkey $($R2)
            closeregkey $($R3)
            closeregkey $($R4)
            closeregkey $($R5)

            shell "" ShowRegistryErrorMessage "FATAL" $($R0)
            return STATUS_FAILED
        endif

        ; $R1 contains handle to "SOFTWARE\Altima\CurrentVersion".
        ; $R2 contains handle to "SOFTWARE\Altima\CurrentVersion\NetRules".
        ; $R3 contains handle to "SYSTEM\CurrentControlSet\Blfp".
        ; $R4 contains handle to "SYSTEM\CurrentControlSet\Blfp\Parameters".
        ; $R5 contains handle to "SYSTEM\CurrentControlSet\Blfp\Linkage".

        set ProductKey   = $($R1)
        set NetRuleKey   = $($R2)
        set ServiceKey   = $($R3)
        set ParameterKey = $($R4)
        set LinkageKey   = $($R5)

        set NewValueList = {                                +
            { SoftwareType, $(NoTitle), $(!REG_VT_SZ),      +
                $(MiniportSoftwareType) },                  +
            { MajorVersion, $(NoTitle), $(!REG_VT_DWORD),   +
                $(ProductMajorVersion) },                   +
            { MinorVersion, $(NoTitle), $(!REG_VT_DWORD),   +
                $(ProductMinorVersion) },                   +
            { Title,        $(NoTitle), $(!REG_VT_SZ),      +
                $(MiniportProductSoftwareTitle) },          +
            { Description,  $(NoTitle), $(!REG_VT_SZ),      +
                $(MiniportProductDescription) },            +
            { ServiceName,  $(NoTitle), $(!REG_VT_SZ),      +
                $(MiniportProductName) },                   +
            { InstallDate,  $(NoTitle), $(!REG_VT_DWORD),   +
                *($(Now),1) } }

        shell $(UtilityInf), AddValueList, $(ProductKey), $(NewValueList)
        ifstr(i) $($R0) != NO_ERROR
            debug-output "Cannot create miniport software key."

            closeregkey $(ProductKey)
            closeregkey $(NetRuleKey)
            closeregkey $(ServiceKey)
            closeregkey $(ParameterKey)
            closeregkey $(LinkageKey)

            shell "" ShowRegistryErrorMessage "FATAL" $($R0)
            return STATUS_FAILED
        endif

        set NewValueList = {                                                +
            { type,         $(NoTitle), $(!REG_VT_SZ),                      +
                $(MiniportNetRuleSoftwareType) },                           +
            { use,          $(NoTitle), $(!REG_VT_SZ),                      +
                $(MiniportNetRuleSoftwareUse) },                            +
            { bindform,     $(NoTitle), $(!REG_VT_SZ),                      +
                $(MiniportNetRuleSoftwareBindForm) },                       +
            { class,        $(NoTitle), $(!REG_VT_MULTI_SZ),                +
                $(MiniportNetRuleSoftwareClass) },                          +
            { bindable,     $(NoTitle), $(!REG_VT_MULTI_SZ),                +
                $(MiniportNetRuleSoftwareBindable) },                       +
            { InfOption,    $(NoTitle), $(!REG_VT_SZ), $(OptionId) } }

        shell $(UtilityInf), AddValueList, $(NetRuleKey), $(NewValueList)
        ifstr(i) $($R0) != NO_ERROR
            debug-output "### Cannot create the miniport netrules."

            closeregkey $(ProductKey)
            closeregkey $(NetRuleKey)
            closeregkey $(ServiceKey)
            closeregkey $(ParameterKey)
            closeregkey $(LinkageKey)

            shell "" ShowRegistryErrorMessage "FATAL" $($R0)
            return STATUS_FAILED
        endif

        closeregkey $(NetRuleKey)
        closeregkey $(ServiceKey)
        closeregkey $(ParameterKey)
        closeregkey $(LinkageKey)
    endif
    closeregkey $(ProductKey)

    ; Get the adapter list.			 PcidList format:  { VID , DID } , ........ 
    set PciIdList = { { 5947, 1000 }, { 5947, 1001 } , { 5947, 1002 },  { 5947, 1003 }}
    shell "" BuildAdapterList $(PciIdList)
    set AdapterList = $($R0)

    ifstr(i) $(AdapterList) == {}
        shell "" ShowErrorMessage "NONFATAL" $(MsgNoAdapterFound)
        return STATUS_FAILED
    endif

    ; Load A1Kdtect dll so we can get the PCI sub vendor id.
    LoadLibrary $(MsgCannotFindA1KdtectDll) $(!STF_WINDOWSSYSPATH)"\"+
        $(A1KdtectDll) HwdtectDll

    debug-output "======== Install adapters: "$(AdapterList)
    forlistdo $(AdapterList)
        debug-output "***** Installing adapter "$($)"."
        set BusNum = *($($), 1)
        set DeviceNum = *($($), 2)
        set FunctionNum = *($($), 3)

        ; Change the default parameters according to the subsystem id.
        install "Install-ChangeDefaults"

        shell $(UtilityInf), IsNetCardAlreadyInstalled, $(BusNum), +
            $(DeviceNum), $(Miniport$(OptionId)Description), +
            $(MiniportProductName), "YES"
        ifstr $($R0) != NO_ERROR
            debug-output "IsNetCardAlreadyInstalled returned error."
            shell "" ShowRegistryErrorMessage "FATAL" $($R0)
            return STATUS_FAILED
        endif

        ifstr(i) $($R1) != "YES"
            debug-output "add hardware component."

            shell $(UtilityInf), AddHardwareComponent, $(MiniportProductName), +
                $(STF_CONTEXTINFNAME), $(MiniportProductKeyName)
            ifstr(i) $($R0) != NO_ERROR
                debug-output "### Add hardware component error."

                closeregkey $($R1)
                closeregkey $($R2)
                closeregkey $($R3)

                shell "" ShowRegistryErrorMessage "FATAL" $($R0)
                return STATUS_FAILED
            endif

            set HardNetCardKey   = $($R1)
            set HardNetRuleKey   = $($R2)
            set HardParameterKey = $($R3)

            set AdapterNumber    = $($R4)

            set NewValueList = { +
                { Manufacturer, $(NoTitle), $(!REG_VT_SZ), $(Manufacturer) }, +
                { Title, $(NoTitle), $(!REG_VT_SZ), +
                    "["$($R4)"] "$(Miniport$(OptionId)HardwareTitle)" "+
                    "(Bus "$(BusNum)", Slot "$(DeviceNum)")." }, +
                { Description, $(NoTitle), $(!REG_VT_SZ), +
                    $(Miniport$(OptionId)Description) }, +
                { ProductName, $(NoTitle), $(!REG_VT_SZ), +
                    $(MiniportProductName) }, +
                { ServiceName, $(NoTitle), $(!REG_VT_SZ), $($R5) }, +
                { InstallDate, $(NoTitle), $(!REG_VT_DWORD), *($(Now), 1) } }

            shell $(UtilityInf), AddValueList, $(HardNetCardKey), +
                $(NewValueList)
            ifstr(i) $($R0) != NO_ERROR
                closeregkey $(HardNetCardKey)
                closeregkey $(HardNetRuleKey)
                closeregkey $(HardParameterKey)

                shell "" ShowRegistryErrorMessage "FATAL" $($R0)

                return STATUS_FAILED
            endif

            set ConnectionValue = *($(ConnectionValueList), +
                    ~($(ConnectionList), $(ConnectionIndex)))
            set FlowControlCapValue = *($(FlowControlCapValueList), +
                    ~($(FlowControlCapList), $(FlowControlCapIndex)))
            set RxMtuValue = *($(RxMtuValueList), ~($(RxMtuList), +
                    $(RxMtuIndex)))
            debug-output "Connection value = "$(ConnectionValue)
            debug-output "FlowControlCap value = "$(FlowControlCapValue)
            debug-output "RxMtu value = "$(RxMtuValue)

            set DeviceId = ""
            LibraryProcedure DeviceId $(HwdtectDll) A1KdtectPortIo "PciRd16" +
                $(BusNum) $(DeviceNum) $(FunctionNum) "0x02"
            debug-output "Device Id: "$(DeviceId)

            ifstr(i) $(DeviceId) == "0x1645"
                set NewValueList = { +
                    { BusType,              $(NoTitle), $(!REG_VT_DWORD), 5   }, +
                    { BusNumber,            $(NoTitle), $(!REG_VT_DWORD), $(BusNum) }, +
                    { SlotNumber,           $(NoTitle), $(!REG_VT_DWORD), $(DeviceNum) }, +
                    { FunctionNumber,       $(NoTitle), $(!REG_VT_DWORD), $(FunctionNum) }, +
                    { MediaType,            $(NoTitle), $(!REG_VT_DWORD), 1   }, +
                    { TxPacketDescCnt,      $(NoTitle), $(!REG_VT_DWORD), 200 }, +
                    { RxStdDescCnt,         $(NoTitle), $(!REG_VT_DWORD), 200 }, +
                    { RxCoalescingTicks,    $(NoTitle), $(!REG_VT_DWORD), 10  }, +
                    { TxCoalescingTicks,    $(NoTitle), $(!REG_VT_DWORD), 30 }, +
                    { RxMaxCoalescedFrames, $(NoTitle), $(!REG_VT_DWORD), 5   }, +
                    { TxMaxCoalescedFrames, $(NoTitle), $(!REG_VT_DWORD), 200 }, +
                    { FlowControlCap,       $(NoTitle), $(!REG_VT_DWORD), $(FlowControlCapValue) }, +
                    { RequestedMediaType,   $(NoTitle), $(!REG_VT_DWORD), $(ConnectionValue) } }
            else
                set NewValueList = { +
                    { BusType,              $(NoTitle), $(!REG_VT_DWORD), 5   }, +
                    { BusNumber,            $(NoTitle), $(!REG_VT_DWORD), $(BusNum) }, +
                    { SlotNumber,           $(NoTitle), $(!REG_VT_DWORD), $(DeviceNum) }, +
                    { FunctionNumber,       $(NoTitle), $(!REG_VT_DWORD), $(FunctionNum) }, +
                    { MediaType,            $(NoTitle), $(!REG_VT_DWORD), 1   }, +
                    { TxPacketDescCnt,      $(NoTitle), $(!REG_VT_DWORD), 200 }, +
                    { RxStdDescCnt,         $(NoTitle), $(!REG_VT_DWORD), 200 }, +
                    { RxCoalescingTicks,    $(NoTitle), $(!REG_VT_DWORD), 360 }, +
                    { TxCoalescingTicks,    $(NoTitle), $(!REG_VT_DWORD), 360 }, +
                    { RxMaxCoalescedFrames, $(NoTitle), $(!REG_VT_DWORD), 15  }, +
                    { TxMaxCoalescedFrames, $(NoTitle), $(!REG_VT_DWORD), 75  }, +
                    { FlowControlCap,       $(NoTitle), $(!REG_VT_DWORD), $(FlowControlCapValue) }, +
                    { RequestedMediaType,   $(NoTitle), $(!REG_VT_DWORD), $(ConnectionValue) } }
            endif

            debug-output "Write driver params."
            shell $(UtilityInf), AddValueList, $(HardParameterKey), +
                $(NewValueList)
            ifstr(i) $($R0) != NO_ERROR
                debug-output "### Add parameter shell error."

                closeregkey $(HardNetCardKey)
                closeregkey $(HardNetRuleKey)
                closeregkey $(HardParameterKey)

                shell "" ShowRegistryErrorMessage "FATAL" $($R0)

                return STATUS_FAILED
            endif

            set TempProdName = """"$(MiniportProductName)$(AdapterNumber)""""
            set TempBindForm = $(TempProdName)$(MiniportNetRuleHardwareBindForm)

            debug-output "updating netrules."
            set NewValueList = {                                           +
                { type,      $(NoTitle), $(!REG_VT_SZ),                    +
                    $(MiniportNetRuleHardwareType) },                      +
                { bindform,  $(NoTitle), $(!REG_VT_SZ), $(TempBindForm) }, +
                { class,     $(NoTitle), $(!REG_VT_MULTI_SZ),              +
                    $(MiniportNetRuleHardwareClass) },                     +
                { InfOption, $(NoTitle), $(!REG_VT_SZ), $(OptionId)} }

            shell $(UtilityInf), AddValueList, $(HardNetRuleKey), +
                $(NewValueList)
            ifstr(i) $($R0) != NO_ERROR
                debug-output "### Add hardware component error."

                closeregkey $(HardNetCardKey)
                closeregkey $(HardNetRuleKey)
                closeregkey $(HardParameterKey)

                shell "" ShowRegistryErrorMessage "FATAL" $($R0)

                return STATUS_FAILED
            endif

            closeregkey $(HardNetCardKey)
            closeregkey $(HardNetRuleKey)

            ifstr(i) $(!STF_GUI_UNATTENDED) == "YES"
                Shell $(UtilityInf), AddDefaultNetCardParameters, +
                    $(HardParameterKey)
            endif

            closeregkey $(HardParameterKey)
        else
            debug-output "Adapter Already Installed ? : R1 = "$($R1)
        endif

        debug-output ""
    endforlistdo

    FreeLibrary $(HwdtectDll)

    ; Create IBM hot plug PCI service key.
    createregkey $(!REG_H_LOCAL) { $(IBM_HPP_ServiceKey), $(NoTitle), +
        GenericClass } "" $(MAXIMUM_ALLOWED) "" HppKey 
    ifstr(i) $(HppKey) != ""
        set NewValueList = {                                            +
            { DriverServices, $(NoTitle), $(!REG_VT_SZ),                +
                $(MiniportProductName) },                               +
            { FriendlyName,   $(NoTitle), $(!REG_VT_SZ),                +
                $(MiniportProductSoftwareDisplayName) } }

        shell $(UtilityInf), AddValueList, $(HppKey), $(NewValueList)

        closeregkey $(HppKey)
    endif

    ; Create Compaq hot plug PCI key.
    openregkey $(!REG_H_LOCAL) "" $(CPQ_HPP_Key) $(MAXIMUM_ALLOWED) HppKey
    ifstr $(HppKey) == ""
        createregkey $(!REG_H_LOCAL) { $(CPQ_HPP_Key), $(NoTitle), +
            GenericClass } "" $(MAXIMUM_ALLOWED) "" HppKey 

        set NewValueList = {                                            +
            { ClassID, $(NoTitle), $(!REG_VT_SZ), 0 },                  +
            { DLLName,   $(NoTitle), $(!REG_VT_SZ), "CQRNICMN.DLL" } }

        shell $(UtilityInf), AddValueList, $(HppKey), $(NewValueList)
    endif
    closeregkey $(HppKey)

    createregkey $(!REG_H_LOCAL) { $(CPQ_HPP_Key)"\"$(MiniportProductName), +
        $(NoTitle), GenericClass } "" $(MAXIMUM_ALLOWED) "" HppKey 

    set NewValueList = {                                                +
        { BaseOIDAddress, $(NoTitle), $(!REG_VT_DWORD), 4278322176 },   +
        { SetOIDAddress,  $(NoTitle), $(!REG_VT_DWORD), 4278321933 } }

    shell $(UtilityInf), AddValueList, $(HppKey), $(NewValueList)

    closeregkey $(HppKey)

    return STATUS_SUCCESSFUL

Download Driver Pack

How To Update Drivers Manually

After your driver has been downloaded, follow these simple steps to install it.

  • Expand the archive file (if the download file is in zip or rar format).

  • If the expanded file has an .exe extension, double click it and follow the installation instructions.

  • Otherwise, open Device Manager by right-clicking the Start menu and selecting Device Manager.

  • Find the device and model you want to update in the device list.

  • Double-click on it to open the Properties dialog box.

  • From the Properties dialog box, select the Driver tab.

  • Click the Update Driver button, then follow the instructions.

Very important: You must reboot your system to ensure that any driver updates have taken effect.

For more help, visit our Driver Support section for step-by-step videos on how to install drivers for every file type.

server: web2, load: 0.86