Re: NDIS miniport driver question

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

From: Don Burn (burn_at_stopspam.acm.org)
Date: 05/14/04


Date: Fri, 14 May 2004 17:17:38 -0400

Well, NDIS does wrap things but some of the wrappers are quite thin, for
example

#define NdisWritePortUchar(Handle,Port,Data)
\

WRITE_PORT_UCHAR((PUCHAR)(NDIS_PORT_TO_PORT(Handle,Port)),(UCHAR)(Data))

#define NdisStallExecution(MicroSecondsToStall)
KeStallExecutionProcessor(MicroSecondsToStall)

So you can see how the driver calls the HAL even if the names are different.
Things get more confusing if the driver is an NDIS WDM driver where all of
the normal WDM calls are available.

Good news is that in the future the network support (and other miniports for
that matter) will become integrated into the new WDF model in a cleaner
fashion. There will only be one name for a function, and the miniport stuff
will provide environment specific support, not generic stuff such as locking
they currently do.

-- 
Don Burn (MVP, Windows DDK)
Windows 2k/XP/2k3 Filesystem and Driver Consulting
Remove StopSpam from the email to reply
"Gary Chapman" <none@none.no> wrote in message
news:opr70chhyl2p1re9@netech...
>
> I have a question about NDIS miniport drivers (The actual vendor supplied
> NIC driver)
>
> In most of the documentation about NDIS it looks as though the NIC driver
> communicates with the network card via the NDIS wrapper.  In other
> documentation it would appear that the NIC driver has to go via the NDIS
> hook driver, the NDIS wrapper and then the NDIS hook driver again to reach
> the NIC.
>
> I have looked at my own driver on Win2k, and another driver on Win98, with
> a dependency checker.  Both appear to call the following functions
> exported from HAL.DLL:
>
> KeStallExecutionProcessor()
> READ_PORT_UCHAR()
> READ_PORT_ULONG()
> READ_PORT_USHORT()
> WRITE_PORT_UCHAR()
> WRITE_PORT_ULONG()
> WRITE_PORT_USHORT()
>
> This leaves me a little bit confused as it would seem that the NIC driver
> uses HAL.DLL to talk to the hardware, rather than going back through
> NDIS.SYS.
>
> So, my question:
>
> Is it true that NDIS completely wraps the NIC driver at both the upper and
> lower edge (As indicated by various architecture diagrams from microsoft,
> PCAUSA, etc.)  Or does the NIC driver call the READ_PORT, WRITE_PORT
> functions of HAL.DLL who in turn talks to the hardware without ever going
> back through the NDIS wrapper or NDIS-hooking filters.
>
> To see an example of the architecture diagrams that are confusing me
> please check out the image at the following link:
> http://www.ndis.com/images/netkernel.gif
>
> Any help or pointers on this would be appreciated.
>
> Many thanks in advance,
>
> GC
> -- 
> Using Opera's revolutionary e-mail client: http://www.opera.com/m2/


Relevant Pages

  • Re: Incorrect server name
    ... There is no primary WINS server defined for this adapter. ... Broadcom BCM5708C NetXtreme II GigE (NDIS VBD Client) ... Network Monitor Driver ...
    (microsoft.public.windows.server.general)
  • Re: Question about FILE_OBJECT
    ... NDIS IM is a driver that fully conforms to the model, ... I.E. every time they allocated a new context object they ...
    (microsoft.public.win32.programmer.kernel)
  • Re: Linux Wifi laptop guidance requested.
    ... do you lnow if it is running a 'native' driver or the NDIS ... > wrapper. ... Xterasys card in the machine. ...
    (alt.internet.wireless)
  • Re: NDIS miniport driver question
    ... NDIS has originally been defined to be platform-independent from both ... Properly written NDIS driver must not use any system-specific ... the "Windows on x86" platform defines some of the NdisXxx ... >In most of the documentation about NDIS it looks as though the NIC driver ...
    (microsoft.public.development.device.drivers)
  • Re: Running NDISTest on Vista with an NDIS IM Driver
    ... I had a quick look at the ndistest stuff in the WLK1.0c, ... actually some ndis driver in the ... I tried using the version that comes with WLK/DTM on PassThru (NDIS IM ...
    (microsoft.public.development.device.drivers)