Re: How can I get PCI card Slot Number in my WDM driver?

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: Gary G. Little (gary.g.little.nospam_at_seagate.com)
Date: 06/02/04


Date: Wed, 02 Jun 2004 13:25:31 GMT

It's a WDM driver and HalGetBusData is deprecated in 2000 and above. The
next question he's going to ask is why slot number in an XYZ motherboard is
not the same as the slot number on an ABC motherboard. Slot number in WDM
drivers is not needed since you get your resources in IRP_MN_START_DEVICE.
Typical bad assumptions assosicated with this is that the number by the PCI
adapter is not the same as the number assigned by the BIOS. Slot number is
an archaic hold over from NT4.

-- 
Gary G. Little
Seagate Technologies, LLC
"paullee" <paullee@iei.com.tw> wrote in message
news:b308514d.0406020443.4df4792@posting.google.com...
> Hi
>
> struct
>     {
> USHORT VendorID;
> USHORT DeviceID;
> USHORT Command;
> USHORT Status;
> UCHAR RevisionID;
> UCHAR filler1[7];
> ULONG Bar0;
> ULONG Bar1;
> ULONG Bar2;
> ULONG filler2[4];
> USHORT SubsystemVendorID;
> USHORT SubsystemID;
> ULONG filler3[3];
> UCHAR InterruptLine;
> UCHAR InterruptPin;
> UCHAR Max_Gnt;
> UCHAR Max_Lat;
> UCHAR TRDY_Timeout;
> UCHAR Retry_Timeout;
> UCHAR filler4[0x9a];
> UCHAR CapabilityID;
> UCHAR NextItemPtr;
> USHORT PowerMgtCapability;
> USHORT PowerMgtCSR;
>     }PciConfigData;
>
> int slot;
> int bus;
> for(bus=0; bus<13; bus++)
> {
> for(slot=0; slot<255; slot++)
> {
> // To save time, only read the first two words
> HalGetBusData(PCIConfiguration, bus, slot, &PciConfigData, sizeof(USHORT)
* 2);
> if ((PciConfigData.VendorID == VENDOR_ID) && (PciConfigData.DeviceID ==
DEVICE_ID ))
> { get your card}
> }
> }
>
> you also can see
>     Q253232 HOWTO: Get Configuration and Location Information of PCI
Device
>
> I also work for Advantech In taiwan^^
> ==========================================================================


Relevant Pages

  • Re: WAOAOAOJIIIIPPPPPPIIIIIIII
    ... UCHAR Chs1; ... ULONG Start; ... USHORT ReservedSectors; ... PVOID MapAddress(PVOID DeviceExtension, ULONG Address, ULONG Size) ...
    (microsoft.public.windowsxp.embedded)
  • Re: hid.lib for WindowsCE
    ... USHORT InputReportByteLength; ... USHORT NumberLinkCollectionNodes; ... UCHAR bDescriptorType; ... BOOLEAN __stdcall HidD_GetPreparsedData (IN HANDLE HidDeviceObject, ...
    (microsoft.public.windowsce.app.development)
  • Re: Converting #ifdef and #ifndef to C#
    ... UCHAR status_type; ... USHORT data_size; ... internal struct TIME_64 ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Size of structs containing unions
    ... Avoid nonstandard typenames in postings. ... If ULONG, USHORT, and UCHAR are in fact unsigned long, unsigned short, and unsigned char, why not use the real typenames? ...
    (comp.lang.c)
  • Re: usb transfer between PC and de2 board
    ... This is the coding from HAL4D13.c ... USHORT Hal4D13_ReadEndpoint(UCHAR bEPIndex, UCHAR *buf, USHORT len) ...
    (comp.arch.embedded)