NT NDIS problem in IO port registering

Hi, people

Yesterday I sent an e-mail asking for help to my problem
with the IO Port registering.
Probably no one responsed me because it´s a very basic
question. I also agree with this, but I spent almost one week
trying to solve the problem and had no progress.
Let me try to present more information about my case.
I´m developing a NT4.0 NDIS driver to a specific ISA
card that my company designed. I finished my miniport description
and started the tests. I needed to study a lot about setup files
for NT system in order to create a specific INF file for my
driver.
I can already install, update NT registry and get this
information using my drive (bus type, IO address, memory base
address). I think it´s Ok.
However when I try register my IO access(it´s necessary
in NDIS drivers) using NdisMRegisterIoPortRange I receive the
error status NDIS_STATUS_FAILURE.
Before using this function I call NdisMSetAttributes (I
tryed also call NdisMSetAttributesEx) like it´s documented.
I´ve tested my variables and everything looks OK. I have a
specific adapter structure create to store driver´s internal
variables that I pass to the NdisSetAttributes function in
the parameter MiniportAdapterContext. The parameter of
AdapterType is set to NdisInterfaceIsa, because I have a
ISA card. I don´t receive any status from NdisMSetAttributes,
but I think it´s Ok.
In the NdisMRegisterIoPortRange I set values also
normal for ISA access: address 0x200 to the InitialPort
parameter and 0x10 to NumberOfPorts.
My questions: Is there some necessary value to set
in my driver or my adapter structure before call the function
NdisMSetAttributes? (I don´t think so)
Is there some special configuration in the setup
(INF) file to be done before registering IO access in NDIS
drivers?
Could this problem be caused by hardware? I´ve
tested in two computers and using differents IO addresses.
It´s really necessary to have my card present in the
machine to call NdisMRegisterIoPortRange? In both
situations: with and without card I had the same problem.
Well, now I hope someone in the list could help
me. Someone have a simple driver that make IO access to
send me? Then I could test if the problem is my machine
or my driver…
Thank in advance,

Ronaldo Husemann

Hallo, people

I´m new in this list.
I´m developing in my work a NT4.0 NDIS miniport driver for
a ISA card. In the last week I studied and create a setup (INF)
file specific to my driver that I believe is Ok. I can write
information in the NT registry using my INF file and read it
from my driver.
Unfortunately I´m having problems, when I try to registry
the driver´s I/O Port address in the NDIS library. I call
NdisMSetAttributes before call NdisMRegisterIoPortRange, like
is indicated in the DDK document, but I always receive
NDIS_STATUS_FAILURE as response.
I make a lot of tests but until now I couldn´t solve
this initial problem. It´s very strange.
Someone here have already developed a NDIS NT driver to
a ISA card or have similar problems in the first implementation?
Any information about this could be useful.
Thanks in advance,

Ronaldo Husemann


You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com

Did you try ‘NdisMMapIoSpace’ ?

Guido

-----Urspr?ngliche Nachricht-----
Von: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com]Im Auftrag von Ronaldo Husemann
Gesendet: Freitag, 7. Dezember 2001 00:00
An: NT Developers Interest List
Betreff: [ntdev] NT NDIS problem in IO port registering

Hi, people

Yesterday I sent an e-mail asking for help to my problem
with the IO Port registering.
Probably no one responsed me because it?s a very basic
question. I also agree with this, but I spent almost one week
trying to solve the problem and had no progress.
Let me try to present more information about my case.
I?m developing a NT4.0 NDIS driver to a specific ISA
card that my company designed. I finished my miniport description
and started the tests. I needed to study a lot about setup files
for NT system in order to create a specific INF file for my
driver.
I can already install, update NT registry and get this
information using my drive (bus type, IO address, memory base
address). I think it?s Ok.
However when I try register my IO access(it?s necessary
in NDIS drivers) using NdisMRegisterIoPortRange I receive the
error status NDIS_STATUS_FAILURE.
Before using this function I call NdisMSetAttributes (I
tryed also call NdisMSetAttributesEx) like it?s documented.
I?ve tested my variables and everything looks OK. I have a
specific adapter structure create to store driver?s internal
variables that I pass to the NdisSetAttributes function in
the parameter MiniportAdapterContext. The parameter of
AdapterType is set to NdisInterfaceIsa, because I have a
ISA card. I don?t receive any status from NdisMSetAttributes,
but I think it?s Ok.
In the NdisMRegisterIoPortRange I set values also
normal for ISA access: address 0x200 to the InitialPort
parameter and 0x10 to NumberOfPorts.
My questions: Is there some necessary value to set
in my driver or my adapter structure before call the function
NdisMSetAttributes? (I don?t think so)
Is there some special configuration in the setup
(INF) file to be done before registering IO access in NDIS
drivers?
Could this problem be caused by hardware? I?ve
tested in two computers and using differents IO addresses.
It?s really necessary to have my card present in the
machine to call NdisMRegisterIoPortRange? In both
situations: with and without card I had the same problem.
Well, now I hope someone in the list could help
me. Someone have a simple driver that make IO access to
send me? Then I could test if the problem is my machine
or my driver…
Thank in advance,

Ronaldo Husemann

Hallo, people

I?m new in this list.
I?m developing in my work a NT4.0 NDIS miniport driver for
a ISA card. In the last week I studied and create a setup (INF)
file specific to my driver that I believe is Ok. I can write
information in the NT registry using my INF file and read it
from my driver.
Unfortunately I?m having problems, when I try to registry
the driver?s I/O Port address in the NDIS library. I call
NdisMSetAttributes before call NdisMRegisterIoPortRange, like
is indicated in the DDK document, but I always receive
NDIS_STATUS_FAILURE as response.
I make a lot of tests but until now I couldn?t solve
this initial problem. It?s very strange.
Someone here have already developed a NDIS NT driver to
a ISA card or have similar problems in the first implementation?
Any information about this could be useful.
Thanks in advance,

Ronaldo Husemann


You are currently subscribed to ntdev as: xxxxx@technotrend.de
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com


You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com

No, it?s my second task in the hardware access test. I?ll try
it now to check if the problem is related with my hardware or not.
Thanks,

Ronaldo
----- Original Message -----
From: “Guido Richardt”
To: “NT Developers Interest List”
Sent: Friday, December 07, 2001 10:31 AM
Subject: [ntdev] Re: NT NDIS problem in IO port registering

> Did you try ‘NdisMMapIoSpace’ ?
>
> Guido
>
>
> -----Urspr?ngliche Nachricht-----
> Von: xxxxx@lists.osr.com
> [mailto:xxxxx@lists.osr.com]Im Auftrag von Ronaldo Husemann
> Gesendet: Freitag, 7. Dezember 2001 00:00
> An: NT Developers Interest List
> Betreff: [ntdev] NT NDIS problem in IO port registering
>
>
> Hi, people
>
> Yesterday I sent an e-mail asking for help to my problem
> with the IO Port registering.
> Probably no one responsed me because it?s a very basic
> question. I also agree with this, but I spent almost one week
> trying to solve the problem and had no progress.
> Let me try to present more information about my case.
> I?m developing a NT4.0 NDIS driver to a specific ISA
> card that my company designed. I finished my miniport description
> and started the tests. I needed to study a lot about setup files
> for NT system in order to create a specific INF file for my
> driver.
> I can already install, update NT registry and get this
> information using my drive (bus type, IO address, memory base
> address). I think it?s Ok.
> However when I try register my IO access(it?s necessary
> in NDIS drivers) using NdisMRegisterIoPortRange I receive the
> error status NDIS_STATUS_FAILURE.
> Before using this function I call NdisMSetAttributes (I
> tryed also call NdisMSetAttributesEx) like it?s documented.
> I?ve tested my variables and everything looks OK. I have a
> specific adapter structure create to store driver?s internal
> variables that I pass to the NdisSetAttributes function in
> the parameter MiniportAdapterContext. The parameter of
> AdapterType is set to NdisInterfaceIsa, because I have a
> ISA card. I don?t receive any status from NdisMSetAttributes,
> but I think it?s Ok.
> In the NdisMRegisterIoPortRange I set values also
> normal for ISA access: address 0x200 to the InitialPort
> parameter and 0x10 to NumberOfPorts.
> My questions: Is there some necessary value to set
> in my driver or my adapter structure before call the function
> NdisMSetAttributes? (I don?t think so)
> Is there some special configuration in the setup
> (INF) file to be done before registering IO access in NDIS
> drivers?
> Could this problem be caused by hardware? I?ve
> tested in two computers and using differents IO addresses.
> It?s really necessary to have my card present in the
> machine to call NdisMRegisterIoPortRange? In both
> situations: with and without card I had the same problem.
> Well, now I hope someone in the list could help
> me. Someone have a simple driver that make IO access to
> send me? Then I could test if the problem is my machine
> or my driver…
> Thank in advance,
>
> Ronaldo Husemann
>
> > Hallo, people
> >
> >
> > I?m new in this list.
> > I?m developing in my work a NT4.0 NDIS miniport driver for
> > a ISA card. In the last week I studied and create a setup (INF)
> > file specific to my driver that I believe is Ok. I can write
> > information in the NT registry using my INF file and read it
> > from my driver.
> > Unfortunately I?m having problems, when I try to registry
> > the driver?s I/O Port address in the NDIS library. I call
> > NdisMSetAttributes before call NdisMRegisterIoPortRange, like
> > is indicated in the DDK document, but I always receive
> > NDIS_STATUS_FAILURE as response.
> > I make a lot of tests but until now I couldn?t solve
> > this initial problem. It?s very strange.
> > Someone here have already developed a NDIS NT driver to
> > a ISA card or have similar problems in the first implementation?
> > Any information about this could be useful.
> > Thanks in advance,
> >
> > Ronaldo Husemann
> >
>
> —
> You are currently subscribed to ntdev as: xxxxx@technotrend.de
> To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com
>
> —
> You are currently subscribed to ntdev as: xxxxx@ifak.fhg.de
> To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com


You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com

Only to inform:

I received the same error code trying to register my
memory access.
I used to convert my memory address to physical address
the procedure used in the NE2000 DDK source code.

PUCHAR pAttributeWindow;
NDIS_PHYSICAL_ADDRESS AttributePhysicalAddress;

NdisSetPhysicalAddressHigh(AttributePhysicalAddress, 0);
NdisSetPhysicalAddressLow(
AttributePhysicalAddress,
Adapter->AttributeMemoryAddress
);

Status = NdisMMapIoSpace(
(PVOID *)&pAttributeWindow,
MiniportAdapterHandle,
AttributePhysicalAddress,
0x8000
);

I believe this procedure is correct.
Please some suggestion be free to recommend me.

Ronaldo
----- Original Message -----
From: “Ronaldo H?semann”
To: “NT Developers Interest List”
Sent: Friday, December 07, 2001 12:47 PM
Subject: [ntdev] Re: NT NDIS problem in IO port registering

> No, it?s my second task in the hardware access test. I?ll try
> it now to check if the problem is related with my hardware or not.
> Thanks,
>
> Ronaldo
> ----- Original Message -----
> From: “Guido Richardt”
> To: “NT Developers Interest List”
> Sent: Friday, December 07, 2001 10:31 AM
> Subject: [ntdev] Re: NT NDIS problem in IO port registering
>
>
> > Did you try ‘NdisMMapIoSpace’ ?
> >
> > Guido
> >
> >
> > -----Urspr?ngliche Nachricht-----
> > Von: xxxxx@lists.osr.com
> > [mailto:xxxxx@lists.osr.com]Im Auftrag von Ronaldo Husemann
> > Gesendet: Freitag, 7. Dezember 2001 00:00
> > An: NT Developers Interest List
> > Betreff: [ntdev] NT NDIS problem in IO port registering
> >
> >
> > Hi, people
> >
> > Yesterday I sent an e-mail asking for help to my problem
> > with the IO Port registering.
> > Probably no one responsed me because it?s a very basic
> > question. I also agree with this, but I spent almost one week
> > trying to solve the problem and had no progress.
> > Let me try to present more information about my case.
> > I?m developing a NT4.0 NDIS driver to a specific ISA
> > card that my company designed. I finished my miniport description
> > and started the tests. I needed to study a lot about setup files
> > for NT system in order to create a specific INF file for my
> > driver.
> > I can already install, update NT registry and get this
> > information using my drive (bus type, IO address, memory base
> > address). I think it?s Ok.
> > However when I try register my IO access(it?s necessary
> > in NDIS drivers) using NdisMRegisterIoPortRange I receive the
> > error status NDIS_STATUS_FAILURE.
> > Before using this function I call NdisMSetAttributes (I
> > tryed also call NdisMSetAttributesEx) like it?s documented.
> > I?ve tested my variables and everything looks OK. I have a
> > specific adapter structure create to store driver?s internal
> > variables that I pass to the NdisSetAttributes function in
> > the parameter MiniportAdapterContext. The parameter of
> > AdapterType is set to NdisInterfaceIsa, because I have a
> > ISA card. I don?t receive any status from NdisMSetAttributes,
> > but I think it?s Ok.
> > In the NdisMRegisterIoPortRange I set values also
> > normal for ISA access: address 0x200 to the InitialPort
> > parameter and 0x10 to NumberOfPorts.
> > My questions: Is there some necessary value to set
> > in my driver or my adapter structure before call the function
> > NdisMSetAttributes? (I don?t think so)
> > Is there some special configuration in the setup
> > (INF) file to be done before registering IO access in NDIS
> > drivers?
> > Could this problem be caused by hardware? I?ve
> > tested in two computers and using differents IO addresses.
> > It?s really necessary to have my card present in the
> > machine to call NdisMRegisterIoPortRange? In both
> > situations: with and without card I had the same problem.
> > Well, now I hope someone in the list could help
> > me. Someone have a simple driver that make IO access to
> > send me? Then I could test if the problem is my machine
> > or my driver…
> > Thank in advance,
> >
> > Ronaldo Husemann
> >
> > > Hallo, people
> > >
> > >
> > > I?m new in this list.
> > > I?m developing in my work a NT4.0 NDIS miniport driver for
> > > a ISA card. In the last week I studied and create a setup (INF)
> > > file specific to my driver that I believe is Ok. I can write
> > > information in the NT registry using my INF file and read it
> > > from my driver.
> > > Unfortunately I?m having problems, when I try to registry
> > > the driver?s I/O Port address in the NDIS library. I call
> > > NdisMSetAttributes before call NdisMRegisterIoPortRange, like
> > > is indicated in the DDK document, but I always receive
> > > NDIS_STATUS_FAILURE as response.
> > > I make a lot of tests but until now I couldn?t solve
> > > this initial problem. It?s very strange.
> > > Someone here have already developed a NDIS NT driver to
> > > a ISA card or have similar problems in the first implementation?
> > > Any information about this could be useful.
> > > Thanks in advance,
> > >
> > > Ronaldo Husemann
> > >
> >
> > —
> > You are currently subscribed to ntdev as: xxxxx@technotrend.de
> > To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com
> >
> > —
> > You are currently subscribed to ntdev as: xxxxx@ifak.fhg.de
> > To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com
>
>
> —
> You are currently subscribed to ntdev as: xxxxx@ifak.fhg.de
> To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com


You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com

Let’s try NdisImmediateReadPortUchar to access your device
from Miniportinitialize.
Did you call NdisMInitializeWrapper and NdisMRegisterMiniport
from DriverEntry with success?

Guido

-----Urspr?ngliche Nachricht-----
Von: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com]Im Auftrag von Ronaldo H?semann
Gesendet: Freitag, 7. Dezember 2001 14:16
An: NT Developers Interest List
Betreff: [ntdev] Re: NT NDIS problem in IO port registering

Only to inform:

I received the same error code trying to register my
memory access.
I used to convert my memory address to physical address
the procedure used in the NE2000 DDK source code.

PUCHAR pAttributeWindow;
NDIS_PHYSICAL_ADDRESS AttributePhysicalAddress;

NdisSetPhysicalAddressHigh(AttributePhysicalAddress, 0);
NdisSetPhysicalAddressLow(
AttributePhysicalAddress,
Adapter->AttributeMemoryAddress
);

Status = NdisMMapIoSpace(
(PVOID *)&pAttributeWindow,
MiniportAdapterHandle,
AttributePhysicalAddress,
0x8000
);

I believe this procedure is correct.
Please some suggestion be free to recommend me.

Ronaldo
----- Original Message -----
From: “Ronaldo H?semann”
To: “NT Developers Interest List”
Sent: Friday, December 07, 2001 12:47 PM
Subject: [ntdev] Re: NT NDIS problem in IO port registering

> No, it?s my second task in the hardware access test. I?ll try
> it now to check if the problem is related with my hardware or not.
> Thanks,
>
> Ronaldo
> ----- Original Message -----
> From: “Guido Richardt”
> To: “NT Developers Interest List”
> Sent: Friday, December 07, 2001 10:31 AM
> Subject: [ntdev] Re: NT NDIS problem in IO port registering
>
>
> > Did you try ‘NdisMMapIoSpace’ ?
> >
> > Guido
> >
> >
> > -----Urspr?ngliche Nachricht-----
> > Von: xxxxx@lists.osr.com
> > [mailto:xxxxx@lists.osr.com]Im Auftrag von Ronaldo
Husemann
> > Gesendet: Freitag, 7. Dezember 2001 00:00
> > An: NT Developers Interest List
> > Betreff: [ntdev] NT NDIS problem in IO port registering
> >
> >
> > Hi, people
> >
> > Yesterday I sent an e-mail asking for help to my problem
> > with the IO Port registering.
> > Probably no one responsed me because it?s a very basic
> > question. I also agree with this, but I spent almost one week
> > trying to solve the problem and had no progress.
> > Let me try to present more information about my case.
> > I?m developing a NT4.0 NDIS driver to a specific ISA
> > card that my company designed. I finished my miniport description
> > and started the tests. I needed to study a lot about setup files
> > for NT system in order to create a specific INF file for my
> > driver.
> > I can already install, update NT registry and get this
> > information using my drive (bus type, IO address, memory base
> > address). I think it?s Ok.
> > However when I try register my IO access(it?s necessary
> > in NDIS drivers) using NdisMRegisterIoPortRange I receive the
> > error status NDIS_STATUS_FAILURE.
> > Before using this function I call NdisMSetAttributes (I
> > tryed also call NdisMSetAttributesEx) like it?s documented.
> > I?ve tested my variables and everything looks OK. I have a
> > specific adapter structure create to store driver?s internal
> > variables that I pass to the NdisSetAttributes function in
> > the parameter MiniportAdapterContext. The parameter of
> > AdapterType is set to NdisInterfaceIsa, because I have a
> > ISA card. I don?t receive any status from NdisMSetAttributes,
> > but I think it?s Ok.
> > In the NdisMRegisterIoPortRange I set values also
> > normal for ISA access: address 0x200 to the InitialPort
> > parameter and 0x10 to NumberOfPorts.
> > My questions: Is there some necessary value to set
> > in my driver or my adapter structure before call the function
> > NdisMSetAttributes? (I don?t think so)
> > Is there some special configuration in the setup
> > (INF) file to be done before registering IO access in NDIS
> > drivers?
> > Could this problem be caused by hardware? I?ve
> > tested in two computers and using differents IO addresses.
> > It?s really necessary to have my card present in the
> > machine to call NdisMRegisterIoPortRange? In both
> > situations: with and without card I had the same problem.
> > Well, now I hope someone in the list could help
> > me. Someone have a simple driver that make IO access to
> > send me? Then I could test if the problem is my machine
> > or my driver…
> > Thank in advance,
> >
> > Ronaldo Husemann
> >
> > > Hallo, people
> > >
> > >
> > > I?m new in this list.
> > > I?m developing in my work a NT4.0 NDIS miniport driver for
> > > a ISA card. In the last week I studied and create a setup (INF)
> > > file specific to my driver that I believe is Ok. I can write
> > > information in the NT registry using my INF file and read it
> > > from my driver.
> > > Unfortunately I?m having problems, when I try to registry
> > > the driver?s I/O Port address in the NDIS library. I call
> > > NdisMSetAttributes before call NdisMRegisterIoPortRange, like
> > > is indicated in the DDK document, but I always receive
> > > NDIS_STATUS_FAILURE as response.
> > > I make a lot of tests but until now I couldn?t solve
> > > this initial problem. It?s very strange.
> > > Someone here have already developed a NDIS NT driver to
> > > a ISA card or have similar problems in the first implementation?
> > > Any information about this could be useful.
> > > Thanks in advance,
> > >
> > > Ronaldo Husemann
> > >
> >
> > —
> > You are currently subscribed to ntdev as:
xxxxx@technotrend.de
> > To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com
> >
> > —
> > You are currently subscribed to ntdev as: xxxxx@ifak.fhg.de
> > To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com
>
>
> —
> You are currently subscribed to ntdev as: xxxxx@ifak.fhg.de
> To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com


You are currently subscribed to ntdev as: xxxxx@technotrend.de
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com


You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com

> Let’s try NdisImmediateReadPortUchar to access your device

from Miniportinitialize.

Oh. I forgot to tell about this.
I?ve tryed to call NdisImmediateReadPortUchar and my machine
crashed!
Very strange…

Did you call NdisMInitializeWrapper and NdisMRegisterMiniport
from DriverEntry with success?

By NdisMInitializeWrapper my driver passes without problem.
For NdisMRegisterMiniport my driver doesn?t pass, because
before register the miniport it?s executed the MiniportInitialize
function. Like I return from it NDIS_STATUS_FAILURE (my
IO initialization is failing) the system doesn?t register my driver.
If I return NDIS_STATUS_SUCCESS, my driver starts,
but it isn?t my interest when I can?t access memory and IO.
Also looking for a solution,
Thanks

Ronaldo


You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com

Do you pass the right handle to NdisImmediateReadPortUchar?

Guido

-----Urspr?ngliche Nachricht-----
Von: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com]Im Auftrag von Ronaldo H?semann
Gesendet: Freitag, 7. Dezember 2001 16:47
An: NT Developers Interest List
Betreff: [ntdev] Re: NT NDIS problem in IO port registering

Let’s try NdisImmediateReadPortUchar to access your device
from Miniportinitialize.

Oh. I forgot to tell about this.
I?ve tryed to call NdisImmediateReadPortUchar and my machine
crashed!
Very strange…

Did you call NdisMInitializeWrapper and NdisMRegisterMiniport
from DriverEntry with success?

By NdisMInitializeWrapper my driver passes without problem.
For NdisMRegisterMiniport my driver doesn?t pass, because
before register the miniport it?s executed the MiniportInitialize
function. Like I return from it NDIS_STATUS_FAILURE (my
IO initialization is failing) the system doesn?t register my driver.
If I return NDIS_STATUS_SUCCESS, my driver starts,
but it isn?t my interest when I can?t access memory and IO.
Also looking for a solution,
Thanks

Ronaldo


You are currently subscribed to ntdev as: xxxxx@technotrend.de
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com


You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com

On 12/07/01, “=?iso-8859-1?Q?Ronaldo_H=FCsemann?= ”
wrote:

> By NdisMInitializeWrapper my driver passes without problem.
> For NdisMRegisterMiniport my driver doesn=B4t pass, because
> before register the miniport it=B4s executed the MiniportInitialize
> function. Like I return from it NDIS_STATUS_FAILURE (my
> IO initialization is failing) the system doesn=B4t register my driver.
> If I return NDIS_STATUS_SUCCESS, my driver starts,
> but it isn=B4t my interest when I can=B4t access memory and IO.

Sorry, this doesn’t make much sense. NDIS doesn’t know where your
MiniportInitialize is until AFTER you call NdisMRegisterMiniport! You
specify MiniportInitialize in the NDIS_MINIPORT_CHARACTERISTICS block
that gets passed to NdisMRegisterMiniport.

What I’m assuming you meant is that you can initialize the wrapper and
register the miniport successfuly, because your MiniportInitialize gets
called.
And then, once you’re in MiniportInitialize, everything fails.

Scott


You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com

Hi Guido

I?m sorry. I?m just answering now.

Do you pass the right handle to NdisImmediateReadPortUchar?

Guido

I think so.
For example this function should put 0x80 in the address of IO
indicated by IoBaseAddr, without previous NdisMSetAttributes
calling

NdisImmediateWritePortUchar(
MiniportAdapterHandle,
(ULONG)IoBaseAddr,
0x80
);

But I crashes my machine. I don?t understand because everything
looks ok in my project until the point I try to access hardware.
Could you send a simple example of miniport driver that could be
installed in my machine to test IO access? May be the problem is
my machine or my INF file… I couldn?t discover until now.
Thanks in advance,

Ronaldo Husemann

-----Urspr?ngliche Nachricht-----
Von: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com]Im Auftrag von Ronaldo H?semann
Gesendet: Freitag, 7. Dezember 2001 16:47
An: NT Developers Interest List
Betreff: [ntdev] Re: NT NDIS problem in IO port registering

> Let’s try NdisImmediateReadPortUchar to access your device
> from Miniportinitialize.

Oh. I forgot to tell about this.
I?ve tryed to call NdisImmediateReadPortUchar and my machine
crashed!
Very strange…

> Did you call NdisMInitializeWrapper and NdisMRegisterMiniport
> from DriverEntry with success?
>

By NdisMInitializeWrapper my driver passes without problem.
For NdisMRegisterMiniport my driver doesn?t pass, because
before register the miniport it?s executed the MiniportInitialize
function. Like I return from it NDIS_STATUS_FAILURE (my
IO initialization is failing) the system doesn?t register my driver.
If I return NDIS_STATUS_SUCCESS, my driver starts,
but it isn?t my interest when I can?t access memory and IO.
Also looking for a solution,
Thanks

Ronaldo


You are currently subscribed to ntdev as: xxxxx@technotrend.de
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com


You are currently subscribed to ntdev as: xxxxx@ifak.fhg.de
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com


You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com

Hi, Scott

Let me try explain it better.

> By NdisMInitializeWrapper my driver passes without problem.
> For NdisMRegisterMiniport my driver doesn=B4t pass, because
> before register the miniport it=B4s executed the MiniportInitialize
> function. Like I return from it NDIS_STATUS_FAILURE (my
> IO initialization is failing) the system doesn=B4t register my driver.
> If I return NDIS_STATUS_SUCCESS, my driver starts,
> but it isn=B4t my interest when I can=B4t access memory and IO.

Sorry, this doesn’t make much sense. NDIS doesn’t know where your
MiniportInitialize is until AFTER you call NdisMRegisterMiniport! You
specify MiniportInitialize in the NDIS_MINIPORT_CHARACTERISTICS block
that gets passed to NdisMRegisterMiniport.

What I’m assuming you meant is that you can initialize the wrapper and
register the miniport successfuly, because your MiniportInitialize gets
called.
And then, once you’re in MiniportInitialize, everything fails.

Scott

When we create a DriverEntry function, we use NdisMInitializeWrapper
to receive a wrapper handle and NdisMRegisterMiniport to define the
characteristics and other entries of our driver. After it our driver is
registered and ready to be used. It?s clear for us.
The thing that I noted is: When we can NdisMRegisterMiniport it isn?t
executed directly, registering our entry pointers in the Ndis library and
returning success. When we call NdisMRegisterMiniport it causes execution
of our MiniportInitialize routine and according the result of this routine
the NdisMRegisterMiniport function will return success or failure. It
looks strange but it works in this way. Try to put debug messages inside
these functions.
I made tests now. If I return NDIS_STATUS_SUCCESS from my
MiniportInitialize routine the NdisMRegisterMiniport that was waiting
that return is finished successfully. If I return NDIS_STATUS_FAILURE from
my MiniportInitialize routine the NdisMRegisterMiniport finishes
with error (NDIS_STATUS_FAILURE ).
It makes no sense? May be, but for me my problem with hardware
access really makes no sense.
If you have any suggestion for my problem, please send me.

Ronaldo Husemann


You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com

If I remember right (I have no documentation here at the moment)
the handle to NdisImmediateWritePortUchar is the Wrapper-Handle
not the Miniport-Handle!

Guido

Do you pass the right handle to NdisImmediateReadPortUchar?

Guido

I think so.
For example this function should put 0x80 in the address of IO
indicated by IoBaseAddr, without previous NdisMSetAttributes
calling
NdisImmediateWritePortUchar(
MiniportAdapterHandle,
(ULONG)IoBaseAddr,
0x80
);
But I crashes my machine. I don?t understand because everything
looks ok in my project until the point I try to access hardware.
Could you send a simple example of miniport driver that could be
installed in my machine to test IO access? May be the problem is
my machine or my INF file… I couldn?t discover until now.
Thanks in advance,
Ronaldo Husemann

-----Urspr?ngliche Nachricht-----
Von: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com]Im Auftrag von Ronaldo
H?semann
Gesendet: Freitag, 7. Dezember 2001 16:47
An: NT Developers Interest List
Betreff: [ntdev] Re: NT NDIS problem in IO port registering

> Let’s try NdisImmediateReadPortUchar to access your device
> from Miniportinitialize.

Oh. I forgot to tell about this.
I?ve tryed to call NdisImmediateReadPortUchar and my machine
crashed!
Very strange…

> Did you call NdisMInitializeWrapper and NdisMRegisterMiniport
> from DriverEntry with success?
>

By NdisMInitializeWrapper my driver passes without problem.
For NdisMRegisterMiniport my driver doesn?t pass, because
before register the miniport it?s executed the MiniportInitialize
function. Like I return from it NDIS_STATUS_FAILURE (my
IO initialization is failing) the system doesn?t register my driver.
If I return NDIS_STATUS_SUCCESS, my driver starts,
but it isn?t my interest when I can?t access memory and IO.
Also looking for a solution,
Thanks

Ronaldo


You are currently subscribed to ntdev as:
xxxxx@technotrend.de
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com


You are currently subscribed to ntdev as: xxxxx@ifak.fhg.de
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com


You are currently subscribed to ntdev as: xxxxx@technotrend.de


You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com

Guido

I tried to change this parameter without success. What is the
correct parameter? I don?t receive the Wrapper-Handle pointer
in the MiniportInitialize routine.
However this solution isn?t recommended. The right way to access hardware
in NDIS drivers is by using NdisMRegisterIoPortRange
and NdisRawWritePortUchar.
I?ll ask again. Have you some example of NDIS driver with
hardware accesses running ok that I could use to test? If you have
a NT INF file for NE2000 source code I could test in my machine.
May be my problem is caused by some INF file parameter that I set
wrongly or missing. I don?t know.
Best regards

Ronaldo

----- Original Message -----
From: “Guido Richardt”
To: “NT Developers Interest List”
Sent: Tuesday, December 11, 2001 8:37 AM
Subject: [ntdev] Re: NT NDIS problem in IO port registering

>
> If I remember right (I have no documentation here at the moment)
> the handle to NdisImmediateWritePortUchar is the Wrapper-Handle
> not the Miniport-Handle!
>
> Guido
>
>
> > Do you pass the right handle to NdisImmediateReadPortUchar?
> >
> > Guido
> >
> >
> I think so.
> For example this function should put 0x80 in the address of IO
> indicated by IoBaseAddr, without previous NdisMSetAttributes
> calling
> NdisImmediateWritePortUchar(
> MiniportAdapterHandle,
> (ULONG)IoBaseAddr,
> 0x80
> );
> But I crashes my machine. I don?t understand because everything
> looks ok in my project until the point I try to access hardware.
> Could you send a simple example of miniport driver that could be
> installed in my machine to test IO access? May be the problem is
> my machine or my INF file… I couldn?t discover until now.
> Thanks in advance,
> Ronaldo Husemann
>


You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com