NdisMQueryAdapterResources with Serial Port

I’m working on a NDIS Miniport driver for a Motorola radio using serial
port.
My problem is when i call NdisMQueryAdapterResources to get the bus
configuration everytime i get the error 0xC0000001.

1 - Why this function “NdisMQueryAdapterResources” return this error ?

2- What is the best way to communicate with the serial port in a NDIS
Miniport driver ?

Thanks for your help.

1 - are you installing your driver as a root enumerated device? Or are
you installing your driver against the HW ID for your device? If you
are just installing off of a ROOT ID, then this could explain the error.
Also, open up device manager, is your driver listed as having assigned
resources (or at least ranges)?

2 - assuming your radio is a 16550 UART device, or at least exposes
itself as one, is to install serial.sys as a lower filter for your
device. You then do not handle any resources, you just communicate to
serial.sys using IRPs. This is what modem.sys does. This would
require writing an NDIS-WDM driver.

d

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Francky
Sent: Monday, April 04, 2005 4:24 PM
To: Windows System Software Devs Interest List
Subject: [ntdev] NdisMQueryAdapterResources with Serial Port

I’m working on a NDIS Miniport driver for a Motorola radio using serial
port.
My problem is when i call NdisMQueryAdapterResources to get the bus
configuration everytime i get the error 0xC0000001.

1 - Why this function “NdisMQueryAdapterResources” return this error ?

2- What is the best way to communicate with the serial port in a NDIS
Miniport driver ?

Thanks for your help.


Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

You are currently subscribed to ntdev as: xxxxx@windows.microsoft.com
To unsubscribe send a blank email to xxxxx@lists.osr.com

My driver will be for a specific Motorola Radio. There is nothing in the
device Manager about my device.
I my driver in the “MiniportInitialize” function i added code to get
information about the bus like this :

This code should return something in resourceLength but i always get an
error :

resourceList = NULL;
NdisMQueryAdapterResources(
&status,
WrapperConfigurationContext,
NULL,
&resourceLength
);

Do i need to configure something about that in the INF file ?

Should i use the serial.sys for my Motorola driver ?
The idea is if i use the serial.sys i will need to pool the driver to know
if there is data available .
May be if i can use the interrupt instead of pooling the COM port i will get
better performance.

“Doron Holan” wrote in message
news:xxxxx@ntdev…
1 - are you installing your driver as a root enumerated device? Or are
you installing your driver against the HW ID for your device? If you
are just installing off of a ROOT ID, then this could explain the error.
Also, open up device manager, is your driver listed as having assigned
resources (or at least ranges)?

2 - assuming your radio is a 16550 UART device, or at least exposes
itself as one, is to install serial.sys as a lower filter for your
device. You then do not handle any resources, you just communicate to
serial.sys using IRPs. This is what modem.sys does. This would
require writing an NDIS-WDM driver.

d

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Francky
Sent: Monday, April 04, 2005 4:24 PM
To: Windows System Software Devs Interest List
Subject: [ntdev] NdisMQueryAdapterResources with Serial Port

I’m working on a NDIS Miniport driver for a Motorola radio using serial
port.
My problem is when i call NdisMQueryAdapterResources to get the bus
configuration everytime i get the error 0xC0000001.

1 - Why this function “NdisMQueryAdapterResources” return this error ?

2- What is the best way to communicate with the serial port in a NDIS
Miniport driver ?

Thanks for your help.


Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

You are currently subscribed to ntdev as: xxxxx@windows.microsoft.com
To unsubscribe send a blank email to xxxxx@lists.osr.com

If there is nothing in device manager that is specific to a Motorola
radio, how is your device discovered? Is it a PCI device? USB? PCCARD?
If the OS can’t find your device, there is no way it can assign you
resources in any reasonable fashion.

As for an interrupt vs sending PIRPs, if you just pend a read irp, it is
just as fast as the interrupt itself since you must queue a DPC to
report the data to NDIS anyways. Let serial handle all the HW issues
and you can deal with just retrieving the data.

d

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Francky
Sent: Monday, April 04, 2005 5:16 PM
To: Windows System Software Devs Interest List
Subject: Re:[ntdev] NdisMQueryAdapterResources with Serial Port

My driver will be for a specific Motorola Radio. There is nothing in the
device Manager about my device.
I my driver in the “MiniportInitialize” function i added code to get
information about the bus like this :

This code should return something in resourceLength but i always get an
error :

resourceList = NULL;
NdisMQueryAdapterResources(
&status,
WrapperConfigurationContext,
NULL,
&resourceLength
);

Do i need to configure something about that in the INF file ?

Should i use the serial.sys for my Motorola driver ?
The idea is if i use the serial.sys i will need to pool the driver to
know
if there is data available .
May be if i can use the interrupt instead of pooling the COM port i will
get
better performance.

“Doron Holan” wrote in message
news:xxxxx@ntdev…
1 - are you installing your driver as a root enumerated device? Or are
you installing your driver against the HW ID for your device? If you
are just installing off of a ROOT ID, then this could explain the error.
Also, open up device manager, is your driver listed as having assigned
resources (or at least ranges)?

2 - assuming your radio is a 16550 UART device, or at least exposes
itself as one, is to install serial.sys as a lower filter for your
device. You then do not handle any resources, you just communicate to
serial.sys using IRPs. This is what modem.sys does. This would
require writing an NDIS-WDM driver.

d

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Francky
Sent: Monday, April 04, 2005 4:24 PM
To: Windows System Software Devs Interest List
Subject: [ntdev] NdisMQueryAdapterResources with Serial Port

I’m working on a NDIS Miniport driver for a Motorola radio using serial
port.
My problem is when i call NdisMQueryAdapterResources to get the bus
configuration everytime i get the error 0xC0000001.

1 - Why this function “NdisMQueryAdapterResources” return this error ?

2- What is the best way to communicate with the serial port in a NDIS
Miniport driver ?

Thanks for your help.


Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

You are currently subscribed to ntdev as: xxxxx@windows.microsoft.com
To unsubscribe send a blank email to xxxxx@lists.osr.com


Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

You are currently subscribed to ntdev as: xxxxx@windows.microsoft.com
To unsubscribe send a blank email to xxxxx@lists.osr.com

Thanks Doron for your help.

I will follow your idea and i will use the serial.sys

“Doron Holan” wrote in message
news:xxxxx@ntdev…
If there is nothing in device manager that is specific to a Motorola
radio, how is your device discovered? Is it a PCI device? USB? PCCARD?
If the OS can’t find your device, there is no way it can assign you
resources in any reasonable fashion.

As for an interrupt vs sending PIRPs, if you just pend a read irp, it is
just as fast as the interrupt itself since you must queue a DPC to
report the data to NDIS anyways. Let serial handle all the HW issues
and you can deal with just retrieving the data.

d

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Francky
Sent: Monday, April 04, 2005 5:16 PM
To: Windows System Software Devs Interest List
Subject: Re:[ntdev] NdisMQueryAdapterResources with Serial Port

My driver will be for a specific Motorola Radio. There is nothing in the
device Manager about my device.
I my driver in the “MiniportInitialize” function i added code to get
information about the bus like this :

This code should return something in resourceLength but i always get an
error :

resourceList = NULL;
NdisMQueryAdapterResources(
&status,
WrapperConfigurationContext,
NULL,
&resourceLength
);

Do i need to configure something about that in the INF file ?

Should i use the serial.sys for my Motorola driver ?
The idea is if i use the serial.sys i will need to pool the driver to
know
if there is data available .
May be if i can use the interrupt instead of pooling the COM port i will
get
better performance.

“Doron Holan” wrote in message
news:xxxxx@ntdev…
1 - are you installing your driver as a root enumerated device? Or are
you installing your driver against the HW ID for your device? If you
are just installing off of a ROOT ID, then this could explain the error.
Also, open up device manager, is your driver listed as having assigned
resources (or at least ranges)?

2 - assuming your radio is a 16550 UART device, or at least exposes
itself as one, is to install serial.sys as a lower filter for your
device. You then do not handle any resources, you just communicate to
serial.sys using IRPs. This is what modem.sys does. This would
require writing an NDIS-WDM driver.

d

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Francky
Sent: Monday, April 04, 2005 4:24 PM
To: Windows System Software Devs Interest List
Subject: [ntdev] NdisMQueryAdapterResources with Serial Port

I’m working on a NDIS Miniport driver for a Motorola radio using serial
port.
My problem is when i call NdisMQueryAdapterResources to get the bus
configuration everytime i get the error 0xC0000001.

1 - Why this function “NdisMQueryAdapterResources” return this error ?

2- What is the best way to communicate with the serial port in a NDIS
Miniport driver ?

Thanks for your help.


Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

You are currently subscribed to ntdev as: xxxxx@windows.microsoft.com
To unsubscribe send a blank email to xxxxx@lists.osr.com


Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

You are currently subscribed to ntdev as: xxxxx@windows.microsoft.com
To unsubscribe send a blank email to xxxxx@lists.osr.com

> resourceList = NULL;

NdisMQueryAdapterResources(

This function is only for the “directly attached hardware” drivers. Since your
device is serial-attached, it is not “directly attached hardware”, has no
hardware resources and must not use this function. SERIAL does all harware work
for you.

It is a very good idea for your device to respond to serial PnP protocol. In
this case, your driver will be automatically loaded by PnP as a functional
driver on top of SERENUM’s PDO. Just send the serial IRPs down the stack - and
that is all.

Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
xxxxx@storagecraft.com
http://www.storagecraft.com

Thanks for the Pnp idea.

Can you just give me more detail about the “serial PnP protocol” ?

Which IRPs are sent for the PnP ?

Thanks.

“Maxim S. Shatskih” wrote in message
news:xxxxx@ntdev…
> > resourceList = NULL;
> > NdisMQueryAdapterResources(
>
> This function is only for the “directly attached hardware” drivers. Since
your
> device is serial-attached, it is not “directly attached hardware”, has no
> hardware resources and must not use this function. SERIAL does all harware
work
> for you.
>
> It is a very good idea for your device to respond to serial PnP protocol.
In
> this case, your driver will be automatically loaded by PnP as a functional
> driver on top of SERENUM’s PDO. Just send the serial IRPs down the stack -
and
> that is all.
>
> Maxim Shatskih, Windows DDK MVP
> StorageCraft Corporation
> xxxxx@storagecraft.com
> http://www.storagecraft.com
>
>

> Can you just give me more detail about the “serial PnP protocol” ?

SERENUM source is in the DDK IIRC. The protocol is a hardware protocol - the
device must write the device PnP ID as a string to a COM port after some
sequence of COM wire state changes.

Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
xxxxx@storagecraft.com
http://www.storagecraft.com

See http://www.microsoft.com/whdc/resources/respec/specs/pnpcom.mspx for the
serial enumeration spec.

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Francky
Sent: Tuesday, April 05, 2005 9:10 AM
To: Windows System Software Devs Interest List
Subject: Re:[ntdev] Re:NdisMQueryAdapterResources with Serial Port

Thanks for the Pnp idea.

Can you just give me more detail about the “serial PnP protocol” ?

Which IRPs are sent for the PnP ?

Thanks.

“Maxim S. Shatskih” wrote in message
news:xxxxx@ntdev…
> > resourceList = NULL;
> > NdisMQueryAdapterResources(
>
> This function is only for the “directly attached hardware” drivers. Since
your
> device is serial-attached, it is not “directly attached hardware”, has no
> hardware resources and must not use this function. SERIAL does all harware
work
> for you.
>
> It is a very good idea for your device to respond to serial PnP protocol.
In
> this case, your driver will be automatically loaded by PnP as a functional
> driver on top of SERENUM’s PDO. Just send the serial IRPs down the stack -
and
> that is all.
>
> Maxim Shatskih, Windows DDK MVP
> StorageCraft Corporation
> xxxxx@storagecraft.com
> http://www.storagecraft.com
>
>


Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

You are currently subscribed to ntdev as: xxxxx@stratus.com
To unsubscribe send a blank email to xxxxx@lists.osr.com

Specifically, there is a driver (SERENUM) which performs the protocol,
your driver does not implement the detection protocol.

d

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Graham, Simon
Sent: Tuesday, April 05, 2005 8:00 AM
To: Windows System Software Devs Interest List
Subject: RE: [ntdev] Re:NdisMQueryAdapterResources with Serial Port

See http://www.microsoft.com/whdc/resources/respec/specs/pnpcom.mspx for
the
serial enumeration spec.

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Francky
Sent: Tuesday, April 05, 2005 9:10 AM
To: Windows System Software Devs Interest List
Subject: Re:[ntdev] Re:NdisMQueryAdapterResources with Serial Port

Thanks for the Pnp idea.

Can you just give me more detail about the “serial PnP protocol” ?

Which IRPs are sent for the PnP ?

Thanks.

“Maxim S. Shatskih” wrote in message
news:xxxxx@ntdev…
> > resourceList = NULL;
> > NdisMQueryAdapterResources(
>
> This function is only for the “directly attached hardware” drivers.
Since
your
> device is serial-attached, it is not “directly attached hardware”, has
no
> hardware resources and must not use this function. SERIAL does all
harware
work
> for you.
>
> It is a very good idea for your device to respond to serial PnP
protocol.
In
> this case, your driver will be automatically loaded by PnP as a
functional
> driver on top of SERENUM’s PDO. Just send the serial IRPs down the
stack -
and
> that is all.
>
> Maxim Shatskih, Windows DDK MVP
> StorageCraft Corporation
> xxxxx@storagecraft.com
> http://www.storagecraft.com
>
>


Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

You are currently subscribed to ntdev as: xxxxx@stratus.com
To unsubscribe send a blank email to xxxxx@lists.osr.com


Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

You are currently subscribed to ntdev as: xxxxx@windows.microsoft.com
To unsubscribe send a blank email to xxxxx@lists.osr.com

I will open the SERENUM to analyze that.

Thanks.

“Maxim S. Shatskih” wrote in message
news:xxxxx@ntdev…
> > Can you just give me more detail about the “serial PnP protocol” ?
>
> SERENUM source is in the DDK IIRC. The protocol is a hardware protocol -
the
> device must write the device PnP ID as a string to a COM port after some
> sequence of COM wire state changes.
>
> Maxim Shatskih, Windows DDK MVP
> StorageCraft Corporation
> xxxxx@storagecraft.com
> http://www.storagecraft.com
>
>