Bug 74360 - [patch] ndiscvt(8) generates a driver which doesn't match any hardware
Summary: [patch] ndiscvt(8) generates a driver which doesn't match any hardware
Status: Open
Alias: None
Product: Base System
Classification: Unclassified
Component: bin (show other bugs)
Version: 5.3-RELEASE
Hardware: Any Any
: Normal Affects Only Me
Assignee: freebsd-bugs mailing list
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-11-25 08:20 UTC by bel
Modified: 2017-12-31 22:36 UTC (History)
0 users

See Also:


Attachments
ndiscvt.patch (2.11 KB, patch)
2004-11-25 08:20 UTC, bel
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description bel 2004-11-25 08:20:32 UTC
	Some Windows(R) drivers cause ndiscvt to generate a driver which
does not match any hardware if INF file use string assigment in vendor/device
IDs. For example, see [Agere Systems.NT.5.1] section and %C08% device
identificator.

Fix: Try following patch:
How-To-Repeat: 
$ ndiscvt -i WLAGSALL.INF -s WLAGS48D.SYS -o ndis_driver_data.h

Generated ndis_driver_data.h does not have "#define NDIS_PCMCIA_DEV_TABLE".

--- WLAGSALL.INF begins here ---
;
; Copyright 2003, Agere Systems Inc
;

[Version]
Signature="$CHICAGO$"
Class=Net
Provider="Agere Systems"
DriverVer=08/25/2003, 7.82.0.542
ClassGUID={4d36e972-e325-11ce-bfc1-08002be10318}
Compatible=1
Catalogfile.NT=wlags2x.cat

[Manufacturer]
Agere="Agere Systems", NT.5.1

[ControlFlags]
ExcludeFromSelect = *

[Agere Systems]
%N08%=D08,PCMCIA\Agere_Systems-Wireless_PC_Card_Model_0110-C4ED

[Agere Systems.NT.5.1]
%N08%=DXP08,%C08%

[D08]
AddReg=AC,A98,A98P2,A98A,A9808
CopyFiles=C98DP2,C98SP2

[A9808]
HKR,,VendorDescription,,%N08%
HKR,Ndi,DeviceID,,%C08%

[D08.NT]
AddReg=AC,A2K,A2KP2,A2K08
CopyFiles=C2KDP2,C2KSP2
Characteristics=0x84
BusType=8

[D08.NT.Services]
AddService=wlags48d,2,SP2,EP2

[D08.NT.CoInstallers]
CopyFiles=CCIP2
AddReg=ACIP2

[A2K08]
HKR,,VendorDescription,,%N08%

[DXP08]
AddReg=AC,AXP,AXPP2,AXP08
DelReg=DRXPV
CopyFiles=CXPDP2,CXPSP2
Characteristics=0x84
BusType=8

[DXP08.Services]
AddService=wlags48d,2,SP2,EP2

[DXP08.CoInstallers]
CopyFiles=CCIP2
AddReg=ACIP2

[AXP08]
HKR,,VendorDescription,,%N08%

[S]
HKR,,Silent,,"0"

[AC]
HKR,,DriverMajor,,"7"
HKR,,DriverMinor,,"82"
HKR,,DriverEnable,,"1"
HKR,,Configured,,"1"
HKR,,DesiredSSID,,"Agere Systems"
HKR,Ndi\Interfaces,LowerRange,0,"ethernet"

[A98]
HKR,,LoadVxD,,1
HKR,,EnumPropPages,,"netdi.dll,EnumPropPages"
HKR,,IOBaseAddress,1,02,00,00,00
HKR,,InterruptNumber,1,04,00,00,00
HKR,,EnableIRQSharing,1,01,00,00,00
HKR,,OSType,,"2"
HKR,Ndi\Interfaces,DefLower,0,"ethernet"
HKR,Ndis,MajorNdisVersion,1,03
HKR,Ndis,MinorNdisVersion,1,0A

[A98P2]
HKR,,DriverVariant,,"3"
HKR,,DevLoader,,*ndis
HKR,,DeviceVxDs,,wlags48c.sys
HKR,Ndi\Interfaces,DefUpper,0,"ndis3"
HKR,Ndi\Interfaces,UpperRange,0,"ndis3"
HKR,Ndi,NdiInstaller,,"wiags48c.dll,WV41NdiProc"
HKR,Ndis,LogDriverName,,"wlags48c"

[A98A]
HKR,,BusType,,8
HKR,Ndi,CardType,,"PCMCIA"

[A2K]
HKR,Ndi\Interfaces,UpperRange,0,"ndis5"
HKR,,NDT,,"1"
HKR,,OSType,,"8"

[A2KP2]
HKR,,DriverVariant,,"4"
HKR,Ndi,Service,0,"wlags48d"

[AXP]
HKR,,NDT,,"1"
HKR,,OSType,,"32"
HKR,Ndi\Interfaces,UpperRange,0,"ndis5"
HKR,Ndi\params\OwnChannel,ParamDesc,0,%1CH%
HKR,Ndi\params\OwnChannel,Type,0,enum
HKR,Ndi\params\OwnChannel,Default,0, 0
HKR,Ndi\params\OwnChannel\enum,0,0,%UD%
HKR,Ndi\params\OwnChannel\enum,1,0,"01"
HKR,Ndi\params\OwnChannel\enum,2,0,"02"
HKR,Ndi\params\OwnChannel\enum,3,0,"03"
HKR,Ndi\params\OwnChannel\enum,4,0,"04"
HKR,Ndi\params\OwnChannel\enum,5,0,"05"
HKR,Ndi\params\OwnChannel\enum,6,0,"06"
HKR,Ndi\params\OwnChannel\enum,7,0,"07"
HKR,Ndi\params\OwnChannel\enum,8,0,"08"
HKR,Ndi\params\OwnChannel\enum,9,0,"09"
HKR,Ndi\params\OwnChannel\enum,10,0,"10"
HKR,Ndi\params\OwnChannel\enum,11,0,"11"
HKR,Ndi\params\OwnChannel\enum,12,0,"12"
HKR,Ndi\params\OwnChannel\enum,13,0,"13"
HKR,Ndi\params\OwnChannel\enum,14,0,"14"
HKR,Ndi\params\PowerMode,ParamDesc,0,%2PM%
HKR,Ndi\params\PowerMode,Type,0,enum
HKR,Ndi\params\PowerMode,Default,0,0
HKR,Ndi\params\PowerMode\enum,2,0,%AUTO%
HKR,Ndi\params\PowerMode\enum,1,0,%ON%
HKR,Ndi\params\PowerMode\enum,0,0,%OFF%

[AXPP2]
HKR,,DriverVariant,,"4"
HKR,Ndi,Service,0,"wlags48d"

[C98DP2]
wlags48c.sys

[C2KDP2]
wlags48d.sys

[CXPDP2]
wlags48d.sys

[C98SP2]
wnags48c.cpl
wcags48c.exe
waags48c.dll
wnags.hlp
wnags.cnt
wuags48c.vxd
wiags48c.dll

[C2KSP2]
wnags48d.cpl
wcags48d.exe
waags48d.dll
wnags.hlp
wnags.cnt

[CXPSP2]
wnags48d.cpl
wcags48d.exe
waags48d.dll
wnags.hlp
wnags.cnt

[CCIP]
wdags48b.dll

[ACIP2]
HKR,,CoInstallers32,0x00010000,"wdags48d.dll,WLDeviceCoInstaller"

[CCIP2]
wdags48d.dll

[DRXPV]
HKR,Ndi\params

[SP2]
DisplayName=%SDP2%
ServiceType=1
StartType=3
ErrorControl=1
ServiceBinary=%12%\wlags48d.sys
LoadOrderGroup=NDIS

[EP2]
AddReg=ALP2

[ALP2]
HKR,,EventMessageFile,0x00020000,"%%SystemRoot%%\System32\netevent.dll;%%SystemRoot%%\System32\drivers\wlags48d.sys"
HKR,,TypesSupported,0x00010001,7

[DestinationDirs]
DefaultDestDir=11
C98DP2=11
C2KDP2=12
CXPDP2=12
CCIP2=11
CCIP=11

[SourceDisksNames]
1 = %DISKID%,,,

[SourceDisksFiles]
wlags48.sys=1
wlags48b.sys=1
wcags48.exe=1
wcags48b.exe=1
waags48.dll=1
waags48b.dll=1
wdags48b.dll=1
wnags48.cpl=1
wnags48b.cpl=1
wuags48.vxd=1
wiags48.dll=1
wfags48b.sys=1
wlags51.sys=1
wlags51b.sys=1
wcags51.exe=1
wcags51b.exe=1
waags51.dll=1
waags51b.dll=1
wdags51b.dll=1
wnags51.cpl=1
wnags51b.cpl=1
wuags51.vxd=1
wiags51.dll=1
wlags48c.sys=1
wlags48d.sys=1
wcags48c.exe=1
wcags48d.exe=1
waags48c.dll=1
waags48d.dll=1
wdags48d.dll=1
wnags48c.cpl=1
wnags48d.cpl=1
wuags48c.vxd=1
wiags48c.dll=1
wnags.hlp=1
wnags.cnt=1

[Strings]
1CH="1. Channel"
2PM="2. Card Power Management"
UD="Use default channel"
OFF="Off"
ON="On"
AUTO="Auto"

DISKID="Wireless Disk"

N08="Wireless PC Card Model 0110"

C08="PCMCIA\Agere_Systems-Wireless_PC_Card_Model_0110-C4ED"

SDP2="Agere Wireless PCCard Service"
--- WLAGSALL.INF ends here ---
Comment 1 bel 2005-03-28 10:18:42 UTC
Sorry, ndiscvt does not processing some .INF files with my first version of the patch.
Corrected version of patch.

--- ndiscvt.patch begins here ---
--- usr.sbin/ndiscvt/inf.c.orig	Sun Mar  7 05:49:06 2004
+++ usr.sbin/ndiscvt/inf.c	Mon Mar  7 20:16:11 2005
@@ -233,7 +233,8 @@ dump_pci_id(const char *s)
  static void
  dump_deviceids_pci()
  {
-	struct assign *manf, *dev;
+	struct assign *manf, *dev, *devid;
+	const char *p;
  	struct section *sec;
  	struct assign *assign;
  	char xpsec[256];
@@ -258,8 +259,9 @@ dump_deviceids_pci()

  	TAILQ_FOREACH(assign, &ah, link) {
  		if (assign->section == sec) {
-			dev = find_assign("strings", assign->key);
-			if (strcasestr(assign->vals[1], "PCI") != NULL) {
+			devid = find_assign("strings", assign->vals[1]);
+			p = (devid == NULL) ? assign->vals[1] : devid->vals[0];
+			if (strcasestr(p, "PCI") != NULL) {
  				found++;
  				break;
  			}
@@ -285,9 +287,11 @@ retry:
  	TAILQ_FOREACH(assign, &ah, link) {
  		if (assign->section == sec) {
  			dev = find_assign("strings", assign->key);
+			devid = find_assign("strings", assign->vals[1]);
+			p = (devid == NULL) ? assign->vals[1] : devid->vals[0];
  			/* Emit device IDs. */
-			if (strcasestr(assign->vals[1], "PCI") != NULL)
-				dump_pci_id(assign->vals[1]);
+			if (strcasestr(p, "PCI") != NULL)
+				dump_pci_id(p);
  			else
  				continue;
  			/* Emit device description */
@@ -312,7 +316,8 @@ retry:
  static void
  dump_deviceids_pcmcia()
  {
-	struct assign *manf, *dev;
+	struct assign *manf, *dev, *devid;
+	const char *p;
  	struct section *sec;
  	struct assign *assign;
  	char xpsec[256];
@@ -337,8 +342,9 @@ dump_deviceids_pcmcia()

  	TAILQ_FOREACH(assign, &ah, link) {
  		if (assign->section == sec) {
-			dev = find_assign("strings", assign->key);
-			if (strcasestr(assign->vals[1], "PCMCIA") != NULL) {
+			devid = find_assign("strings", assign->vals[1]);
+			p = (devid == NULL) ? assign->vals[1] : devid->vals[0];
+			if (strcasestr(p, "PCMCIA") != NULL) {
  				found++;
  				break;
  			}
@@ -364,9 +370,11 @@ retry:
  	TAILQ_FOREACH(assign, &ah, link) {
  		if (assign->section == sec) {
  			dev = find_assign("strings", assign->key);
+			devid = find_assign("strings", assign->vals[1]);
+			p = (devid == NULL) ? assign->vals[1] : devid->vals[0];
  			/* Emit device IDs. */
-			if (strcasestr(assign->vals[1], "PCMCIA") != NULL)
-				dump_pcmcia_id(assign->vals[1]);
+			if (strcasestr(p, "PCMCIA") != NULL)
+				dump_pcmcia_id(p);
  			else
  				continue;
  			/* Emit device description */
--- ndiscvt.patch ends here ---
Comment 2 Eitan Adler freebsd_committer freebsd_triage 2017-12-31 07:59:48 UTC
For bugs matching the following criteria:

Status: In Progress Changed: (is less than) 2014-06-01

Reset to default assignee and clear in-progress tags.

Mail being skipped