;******************************************************************************* ;* ** ;* I N T E L P R O P R I E T A R Y ** ;* ** ;* COPYRIGHT (c) 2000 BY INTEL CORPORATION. ALL RIGHTS RESERVED. NO ** ;* PART OF THIS PROGRAM OR PUBLICATION MAY BE REPRODUCED, TRANSMITTED, ** ;* TRANSCRIBED, STORED IN A RETRIEVAL SYSTEM, OR TRANSLATED INTO ANY ** ;* LANGUAGE OR COMPUTER LANGUAGE IN ANY FORM OR BY ANY MEANS, ELECTRONIC, ** ;* MECHANICAL, MAGNETIC, OPTICAL, CHEMICAL, MANUAL, OR OTHERWISE, WITHOUT ** ;* THE PRIOR WRITTEN PERMISSION OF : ** ;* ** ;* INTEL CORPORATION ** ;* ** ;* 2200 MISSION COLLEGE BLVD ** ;* ** ;* SANTA CLARA, CALIFORNIA 95052-8119 ** ;* ** ;******************************************************************************* ;******************************************************************************* ; Windows NT OEMSETUP.INF for ; ; Intel(R) GD82559ER Fast Ethernet Adapter ; ;******************************************************************************* ; $Revision: 9 $ ;******************************************************************************* ; Define Options ;******************************************************************************* [Options] E100E [OptionsText] E100E = "Intel(R) GD82559ER Fast Ethernet Adapter" [Source Media Descriptions] 1 = "Intel(R) GD82559ER Fast Ethernet Adapter CD-ROM or floppy disk",+ TAGFILE = e100ent.sys ;******************************************************************************* ; Define customizable constants. ;******************************************************************************* [FileConstants] Manufacturer = "Intel" NDIS4 = "e100ent.sys" NDIS4Src = "e100ent.sys" SoftwareName = "E100E" SoftwareTitle = "Intel(R) GD82559ER Fast Ethernet Adapter" SoftwareDescription = "Intel(R) GD82559ER Fast Ethernet Adapter Driver" HardwareTitle = "Intel(R) GD82559ER Fast Ethernet Adapter" HardwareDescription = "Intel(R) GD82559ER Fast Ethernet Adapter" NetEventDLL = "%SystemRoot%\System32\netevent.dll" SoftwareImagePath = "%SystemRoot%\System32\drivers\"$(NDIS4) SoftwareKeyName = "SOFTWARE\"$(Manufacturer)"\"$(SoftwareName)+ "\CurrentVersion" ProCaption = "Windows NT Setup" ProCancel = "Cancel" ProCancelMsg = "Windows NT Networking is not correctly "+ "installed. Are you sure you want to cancel "+ "copying files?" ProCancelCap = "Network Setup Message" ProText1 = "Copying:" ProText2 = "To:" AutoDetect = "Auto Detect" Speed10Mbps = "10 Mbps" Speed100Mbps = "100 Mbps" HalfDuplex = "Half-Duplex" FullDuplex = "Full-Duplex" SpeedList = {$(AutoDetect), $(Speed10Mbps), $(Speed100Mbps)} DuplexList = {$(AutoDetect), $(HalfDuplex), $(FullDuplex)} KeyNull = "" ;******************************************************************************* ; Define Vendor/Device IDs for support adapters. Each support adapter is listed ; in the format {, }. ;******************************************************************************* [VendorDeviceIDs] {32902, 4617} ; 0x8086, 0x1209 {32902, 4649} ; 0x8086, 0x1229 ;******************************************************************************* ; Define miniport instance parameters. This list defines the name of the ; parameter, the registry data type, and the value of the parameter. Each ; parameter is specified in a format ready to be passed into SetRegValue(): ; {, $(NoTitle), , }. ;******************************************************************************* [MiniportParameters] ; HKLM\SYSTEM\CurrentControlSet\Services\[miniport instance]\Parameters {AutoPolarity, $(NoTitle), $(!REG_VT_DWORD), 2} {BusNumber, $(NoTitle), $(!REG_VT_DWORD), $(BusNumber)} {BusType, $(NoTitle), $(!REG_VT_DWORD), 5} {BusTypeLocal, $(NoTitle), $(!REG_VT_DWORD), 5} {Congest, $(NoTitle), $(!REG_VT_DWORD), 0} {Coalesce, $(NoTitle), $(!REG_VT_DWORD), 0} {Connector, $(NoTitle), $(!REG_VT_DWORD), 0} {EQUOFF, $(NoTitle), $(!REG_VT_DWORD), 0} {EnableSelfTest, $(NoTitle), $(!REG_VT_DWORD), 1} {Environment, $(NoTitle), $(!REG_VT_DWORD), 0} {ExtremeCacheAlignment, $(NoTitle), $(!REG_VT_DWORD), 0} {ForceDpx, $(NoTitle), $(!REG_VT_DWORD), 0} {MCWA, $(NoTitle), $(!REG_VT_DWORD), 2} {MWIEnable, $(NoTitle), $(!REG_VT_DWORD), 1} {MediaType, $(NoTitle), $(!REG_VT_DWORD), 1} {NetworkAddress, $(NoTitle), $(!REG_VT_SZ), ""} {NumCoalesce, $(NoTitle), $(!REG_VT_DWORD), 8} {NumRfd, $(NoTitle), $(!REG_VT_DWORD), 16} {NumTbdPerTcb, $(NoTitle), $(!REG_VT_DWORD), 1} {NumTcb, $(NoTitle), $(!REG_VT_DWORD), 8} {PhyAddress, $(NoTitle), $(!REG_VT_DWORD), 255} {RxDmaCount, $(NoTitle), $(!REG_VT_DWORD), 0} {RxFifo, $(NoTitle), $(!REG_VT_DWORD), 8} {SlotNumber, $(NoTitle), $(!REG_VT_DWORD), $(SlotNumber)} {Speed, $(NoTitle), $(!REG_VT_DWORD), 0} {TxDmaCount, $(NoTitle), $(!REG_VT_DWORD), 0} {TxFifo, $(NoTitle), $(!REG_VT_DWORD), 8} {UnderrunRetry, $(NoTitle), $(!REG_VT_DWORD), 1} {UseIo, $(NoTitle), $(!REG_VT_DWORD), 2} {WaitAfterWin, $(NoTitle), $(!REG_VT_DWORD), 0} ;******************************************************************************* ; Define software and hardware component registry settings that are applied ; after calling AddSoftwareComponent() or AddHardwareComponent(). Each ; parameter is specified in a format ready to be passed into SetRegValue(): ; {, $(NoTitle), , }. ;******************************************************************************* [SoftwareCurrentVersion] ; HKLM\SOFTWARE\[Mfg]\[Product]\CurrentVersion {SoftwareType, $(NoTitle), $(!REG_VT_SZ), "driver"} {MajorVersion, $(NoTitle), $(!REG_VT_DWORD), 3} {MinorVersion, $(NoTitle), $(!REG_VT_DWORD), 0} {Title, $(NoTitle), $(!REG_VT_SZ), $(SoftwareTitle)} {Description, $(NoTitle), $(!REG_VT_SZ), $(SoftwareDescription)} {ServiceName, $(NoTitle), $(!REG_VT_SZ), $(SoftwareName)} {InstallDate, $(NoTitle), $(!REG_VT_DWORD), *($(Now),1)} [SoftwareNetBindRules] ; HKLM\SOFTWARE\[Mfg]\[Product]\CurrentVersion\NetRules {type, $(NoTitle), $(!REG_VT_SZ), + $(SoftwareName)"Sys ndisDriver "$(SoftwareName)"Driver"} {use, $(NoTitle), $(!REG_VT_SZ), + "driver"} {bindform, $(NoTitle), $(!REG_VT_SZ), + """"$(SoftwareName)"Sys"" yes no container"} {class, $(NoTitle), $(!REG_VT_MULTI_SZ), + {$(SoftwareName)"Driver basic"}} {bindable, $(NoTitle), $(!REG_VT_MULTI_SZ), + {$(SoftwareName)"Driver "$(SoftwareName)+ "Adapter non exclusive 100"}} {InfOption, $(NoTitle), $(!REG_VT_SZ), + $(Option)} [NetworkCardValues] ; HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\NetworkCards\[x] {Manufacturer, $(NoTitle), $(!REG_VT_SZ), + $(Manufacturer)} {Title, $(NoTitle), $(!REG_VT_SZ), + "["$(AdapterNumber)"] "$(HardwareTitle)} {Description, $(NoTitle), $(!REG_VT_SZ), + $(HardwareDescription)} {ProductName, $(NoTitle), $(!REG_VT_SZ), + $(SoftwareName)} {ServiceName, $(NoTitle), $(!REG_VT_SZ), + $(SoftwareName)$(AdapterNumber)} {InstallDate, $(NoTitle), $(!REG_VT_DWORD), + *($(Now),1)} {OperationsSupport, $(NoTitle), $(!REG_VT_DWORD), + 255} [HardwareNetBindRules] ; HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\NetworkCards\[x]\NetRules {type, $(NoTitle), $(!REG_VT_SZ), + $(SoftwareName)" "$(SoftwareName)"Adapter"} {bindform, $(NoTitle), $(!REG_VT_SZ), + """"$(SoftwareName)$(AdapterNumber)""" yes yes container"} {class, $(NoTitle), $(!REG_VT_MULTI_SZ), + {$(SoftwareName)"Adapter basic"}} {InfOption, $(NoTitle), $(!REG_VT_SZ), + $(Option)} ;******************************************************************************* ; Detect sections. These sections are called using the detect command. ;******************************************************************************* [Date] Now = {} ? $(!LIBHANDLE) GetSystemDate ;******************************************************************************* ; Returns information to Setup about the type of driver or drivers that ; can be installed by this INF file. ;******************************************************************************* [Identify] Return STATUS_SUCCESSFUL NetAdapter "" ;******************************************************************************* ; This section returns information to the Setup program, listing the ; names of any drivers that can be installed by this INF file. It also ; returns the text strings for each driver (in the requested language) ; to be used in the dialog box that asks the user to select the driver ; to install. ;******************************************************************************* [ReturnOptions] Set Status = STATUS_SUCCESSFUL Set OptionList = ^(Options, 1) Set OptionTextList = ^(OptionsText, 1) IfStr(i) $($1) != "" IfContains(i) $($1) not-in "PCI" Set Status = STATUS_NOTSUPPORTED Set OptionList = {} Set OptionTextList = {} EndIf EndIf Return $(Status) $(OptionList) $(OptionTextList) ;******************************************************************************* ; If the [ReturnOptions] section returns successfully, indicating the ; language is supported, Setup displays a dialog box from which the user ; can select a driver to install. If the user proceeds with the ; installation, Setup calls the [InstallOption] section. ;******************************************************************************* [InstallOption] Set Option = $($1) Set SrcDir = $($2) Set AddCopy = $($3) Set DoCopy = $($4) Set DoConfig = $($5) read-syms FileConstants detect Date ;----------------------------------------------------------------------- ; Switch on the install mode option and goto the appropriate sub. ;----------------------------------------------------------------------- IfStr(i) $(!NTN_InstallMode) == deinstall Set StartLabel = RemoveAdapter Else-IfStr(i) $(!NTN_InstallMode) == update Set StartLabel = UpdateAdapter Else-IfStr(i) $(!NTN_InstallMode) == bind return STATUS_USERCANCEL Else-IfStr(i) $(!NTN_InstallMode) == configure Set StartLabel = ConfigureAdapter Else-IfStr(i) $(!NTN_InstallMode) == install Set StartLabel = InstallAdapters EndIf Set from = FatalError Set to = FatalError Goto $(StartLabel) ;******************************************************************************* ; Called when the user clicks the Add button in the NCPA. ;******************************************************************************* InstallAdapters = + ;----------------------------------------------------------------------- ; NT 3.50 & 3.51 are not supported, so give user the bad news ;----------------------------------------------------------------------- OpenRegKey $(!REG_H_LOCAL) "" + "SOFTWARE\Microsoft\Windows NT\CurrentVersion" + $(!REG_KEY_READ) hKeyWinNT GetRegValue $(hKeyWinNT) "CurrentVersion" CurrentVersion Set WinNTVersion = *($(CurrentVersion), 4) CloseRegKey $(hKeyWinNT) ifcontains(i) $(WinNTVersion) in {"3.50", "3.51"} Shell "Subroutn.Inf" SetupMessage $(!STF_LANGUAGE) "STATUS" + "NT 3.50 and NT 3.51 are not supported." return STATUS_USERCANCEL EndIf ;----------------------------------------------------------------------- ; Find Adapter(s) by doing a PCI scan (of registry) with Utility.inf. ; The bus/slot/function of each adapter found are returned in a list ; of lists:{{bus0,slot0,func0},{bus1,slot1,func1},...{busN,slotN,funcN}} ;----------------------------------------------------------------------- ; Since multiple Vendor/DeviceIDs are supported, call GetPCIInformation ; for each set, building the bus/slot/function list. Set BusDevFuncList = {} ForListDo ^(VendorDeviceIDs, 1) Shell "Utility.Inf", GetPCIInformation, *($($), 1), *($($), 2) ForListDo $($R0) Set BusDevFuncList = >($(BusDevFuncList), $($)) EndForListDo EndForListDo ; Check for an empty adapter list and abort with error if empty. IfStr $(BusDevFuncList) == {} Shell "Subroutn.Inf" SetupMessage $(!STF_LANGUAGE) "STATUS" + "No supported adapters were found in the system. "+ "Install the adapter in another PCI slot and try again." return STATUS_USERCANCEL EndIf ;----------------------------------------------------------------------- ; Search through the bus/slot/function list looking for previously ; installed adapters that match. A match is found by searching through ; the installed miniport instances and matching on bus/slot. If a match ; is found, assume that the adapter is already setup and remove the ; adapter from the bus/slot/function list. ;----------------------------------------------------------------------- Set NewBusDevFuncList = {} ForListDo $(BusDevFuncList) Set BusNumber = *($($), 1) Set SlotNumber = *($($), 2) Shell "Utility.Inf", IsNetCardAlreadyInstalled, $(BusNumber), + $(SlotNumber), "", "", "YES" IfStr $($R1) != "YES" Set NewBusDevFuncList = >($(NewBusDevFuncList), $($)) EndIf EndForListDo Set BusDevFuncList = $(NewBusDevFuncList) ; Check for an empty adapter list. If the list is empty, it means that ; all detected adapters already have a NetworkCard entry in the ; registry, or some rogue NetworkCard is pretending to be the software ; key for this adapter. In any case, we're done. The user can remove ; the rogue NetworkCard and reinstall with this software if they want. IfStr $(BusDevFuncList) == {} return STATUS_USERCANCEL EndIf ;----------------------------------------------------------------------- ; Create the software component (service) if it doesn't already exist. ;----------------------------------------------------------------------- OpenRegKey $(!REG_H_LOCAL) "" $(SoftwareKeyName) $(!REG_KEY_READ) hKey IfStr $(hKey) == "" ; The software component didn't exist...Let's create it. Shell "Utility.Inf", AddSoftwareComponent, $(Manufacturer), + $(SoftwareName), $(SoftwareName), $(SoftwareTitle), + $(STF_CONTEXTINFNAME), $(SoftwareImagePath), "kernel", + "NDIS", {}, "", $(NetEventDLL) Set hKeyCurrentVersion = $($R1) Set hKeyNetRule = $($R2) ; Insert other details to the software component's current ; version key. Shell "Utility.Inf", AddValueList, $(hKeyCurrentVersion), + ^(SoftwareCurrentVersion, 1) ; Insert the net bind rules. Shell "Utility.Inf", AddValueList, $(hKeyNetRule), + ^(SoftwareNetBindRules, 1) EndIf CloseRegKey $(hKey) ;----------------------------------------------------------------------- ; For each detected adapter, create a hardware component (miniport ; instance). ;----------------------------------------------------------------------- ForListDo $(BusDevFuncList) ; Get Bus and Slot from PCI device information Set BusNumber = *($($), 1) Set SlotNumber = *($($), 2) ; Create a new miniport instance, AKA hardware component. Shell "Utility.Inf", AddHardwareComponent, $(SoftwareName), + $(STF_CONTEXTINFNAME), $(SoftwareKeyName) Set hKeyNetCard = $($R1) Set hKeyNetRule = $($R2) Set hKeyParameter = $($R3) Set AdapterNumber = $($R4) ; Insert other details to the NetworkCard key. Shell "Utility.Inf", AddValueList, $(hKeyNetCard), + ^(NetworkCardValues, 1) ; Add the miniport parameters. Shell "Utility.Inf", AddValueList, $(hKeyParameter), + ^(MiniportParameters, 1) ; Insert the net bind rules. Shell "Utility.Inf", AddValueList, $(hKeyNetRule), + ^(HardwareNetBindRules, 1) ; Install unattended answer file overrides if running in ; unattended mode. IfStr(i) $(!STF_GUI_UNATTENDED) == "YES" Shell "Utility.Inf", AddDefaultNetCardParameters, + $(hKeyParameter) EndIf EndForListDo ;----------------------------------------------------------------------- ; Install the driver. ;----------------------------------------------------------------------- Install "Install-Option" return STATUS_SUCCESSFUL ;******************************************************************************* ; Called when user clicks the Remove button on the NCPA to remove an ; adapter. ;******************************************************************************* RemoveAdapter = + ;----------------------------------------------------------------------- ; Delete the hardware component (miniport instance). If this is the ; last instance, the software component will be deleted as well. ;----------------------------------------------------------------------- Shell "Utility.Inf", RemoveHardwareComponent, $(Manufacturer), + $(SoftwareName), $(!NTN_RegBase) return STATUS_SUCCESSFUL ;******************************************************************************* ; Called when user clicks the Properties button on the NCPA to modify adapter's ; settings. ;******************************************************************************* ConfigureAdapter = + ;* Retrieve paramters from the registry OpenRegKey $(!REG_H_LOCAL) "" $(!NTN_RegBase) $(!REG_KEY_READ) hNetCardKey Set AdapterDisplayName = "" IfStr(i) $(hNetCardKey) != $(KeyNull) ;* Get ServiceName and AdapterTitle GetRegValue $(hNetCardKey) "ServiceName" ServiceInfo Set ServiceName = *($(ServiceInfo),4) GetRegValue $(hNetCardKey) "Title" AdapterTitle Set AdapterDisplayName = *($(AdapterTitle), 4) OpenRegKey $(!REG_H_LOCAL) "" $(!NTN_ServiceBase)"\"$(ServiceName)"\Parameters" $(!REG_KEY_READ) hParamKey IfStr(i) $(hParamKey) != $(KeyNull) ;* Setup the current value for Speed and Duplex GetRegValue $(hParamKey) "Speed" SpeedInfo Set SpeedIndex = *($(SpeedInfo),4) IfInt $(SpeedIndex) == 10 ; 10 Mbps Set SpeedValue = $(Speed10Mbps) Else-IfInt $(SpeedIndex) == 100 ; 100 Mbps Set SpeedValue = $(Speed100Mbps) Else Set SpeedValue = $(AutoDetect) EndIf GetRegValue $(hParamKey) "ForceDpx" DuplexInfo Set DuplexIndex = *($(DuplexInfo), 4) IfInt $(DuplexIndex) == "1" Set DuplexValue = $(HalfDuplex) Else-IfInt $(DuplexIndex) == "2" Set DuplexValue = $(FullDuplex) Else Set DuplexValue = $(AutoDetect) EndIf CloseRegKey $(hParamKey) Else Set SpeedValue = 0 Set DuplexValue = 0 EndIf CloseRegKey $(hNetCardKey) EndIf IfStr(i) AdapterDisplayName == "" Set AdapterDisplayName = $(HardwareTitle) EndIf read-syms AdapterPropertiesDlg ui start "AdapterProperties" IfStr(i) $(DLGEVENT) == "CONTINUE" Set SpeedValue = $(Combo1Out) Set DuplexValue = $(Combo2Out); ;*** Save Speed setting IfStr $(SpeedValue) == $(AutoDetect) Set CommonSpeed = 0 Else-IfStr $(SpeedValue) == $(Speed10Mbps) Set CommonSpeed = 10 Else Set CommonSpeed = 100 EndIf ;*** Save Duplex setting IfStr $(DuplexValue) == $(AutoDetect) Set CommonDuplex = 0 Else-IfStr $(DuplexValue) == $(HalfDuplex) Set CommonDuplex = 1 Else Set CommonDuplex = 2 EndIf Else return STATUS_USERCANCEL EndIf ; *** Save paramters to the registry OpenRegKey $(!REG_H_LOCAL) "" $(!NTN_RegBase) $(!REG_KEY_READ) hNetCardKey IfStr(i) $(hNetCardKey) != $(KeyNull) GetRegValue $(hNetCardKey) "ServiceName" ServiceInfo Set ServiceName = *($(ServiceInfo),4) OpenRegKey $(!REG_H_LOCAL) "" $(!NTN_ServiceBase)"\"$(ServiceName)"\Parameters" $(!REG_KEY_WRITE) hParamKey IfStr(i) $(hParamKey) != $(KeyNull) SetRegValue $(hParamKey) {Speed, $(NoTitle), $(!REG_VT_DWORD), $(CommonSpeed)} SetRegValue $(hParamKey) {ForceDpx, $(NoTitle), $(!REG_VT_DWORD), $(CommonDuplex)} CloseRegKey $(hParamKey) EndIf CloseRegKey $(hNetCardKey) Else return STATUS_USERCANCEL EndIf return STATUS_SUCCESSFUL ;******************************************************************************* ; Something's busted! The "To" and "From" variables were set to this entry ; point, so any fatal errors would be trapped here. ;******************************************************************************* FatalError = + return STATUS_FAILED ;******************************************************************************* ; Install the Option files. ;******************************************************************************* [Install-Option] Set STF_VITAL = 1 Set STF_OVERWRITE = "VERIFYSOURCEOLDER" AddSectionFilesToCopyList "Files-Option-Drivers-NT4" $(SrcDir) + $(!STF_WINDOWSSYSPATH)\drivers Set !STF_NCPA_FLUSH_COPYLIST = 1 CopyFilesInCopyList Exit [Files-Option-Drivers-NT4] 1, $(NDIS4Src), SIZE=50000, RENAME=$(NDIS4) ;******************************************************************************* ; Adapter Settings Dialog ;******************************************************************************* [AdapterPropertiesDlg] DlgType = "RadioCombination" DlgTemplate = "NE2000" Caption = $(AdapterDisplayName)" Settings" Label1 = "Speed" Label2 = "Duplex" Combo1List = $(SpeedList) Combo1Out = $(SpeedValue) Combo2List = $(DuplexList) Combo2Out = $(DuplexValue) ComboListItemsIn = {Combo1List, Combo2List} ComboListItemsOut = {Combo1Out, Combo2Out} CBOptionsGreyed = {} NotifyFields = {NO, NO} EditTextIn = "" EditTextLim = "" HelpContext = "" Continue = "&OK" Cancel = "&Cancel" Help = "&Help"