Subject: Porting FreeBSD NDIS to NetBSD/nmb_fddirxindicate_func()
To: None <wpaul@windriver.com>
From: Alan Ritter <rittera@cc.wwu.edu>
List: tech-kern
Date: 08/02/2005 16:26:16
Hi, I'm trying to port the FreeBSD NDIS code to NetBSD as part of Google's
"Summer of Code" project (http://code.google.com/summerofcode.html).

I'm having a little problem right now, when the attach function calls
ndis_init_nic(), which calls the MiniportInitalize() function from the
binary Windows driver for my network card (I got this working on FreeBSD)
it blows up on the following instruction:

call   DWORD PTR [eax+380]

After playing around with the debugger a bit I'm quite certain that eax is
a pointer to the ndis_miniport_block, and 380 is the offset of the
nmb_fddirxindicate_func() field within it.  All there is at this address,
however is 0x0:

(gdb) x/8a $eax + 380
0xc15b2d7c:     0x0     0x0     0x0     0x0
0xc15b2d8c:     0xc0745955 <ndis_status_func>   0xc07459ad
<ndis_statusdone_func>       0x0     0xc0745a32 <ndis_getdone_func>

I'm assuming that this should have been initialized somewhere, but I can't
find any place in the code where nmb_fddirxindicate_func() is referenced. 
Maybe it is supposed to be initialized inside the binary Windows driver?

I also tried jumping past the offending instruction, and there appeared to
be more calls to uninitialized functions in the ndis_miniport_block().

Anyway, I just thought I'd check and see if you knew more about the
nmb_fddirxindicate_func() member of the ndis_miniport_block structure.

Thanks.

P.S. here's some pointers to more information:
My blog for the project:
http://ndis-netbsd.blogspot.com/
Links to my sources online:
http://cvs.sourceforge.net/viewcvs.py/netbsd-soc/ndis/
The project's webpage:
http://netbsd-soc.sourceforge.net/projects/ndis/