opnsense-src/sys
Bill Paul c854fc1092 Commit the first cut of Project Evil, also known as the NDISulator.
Yes, it's what you think it is. Yes, you should run away now.

This is a special compatibility module for allowing Windows NDIS
miniport network drivers to be used with FreeBSD/x86. This provides
_binary_ NDIS compatibility (not source): you can run NDIS driver
code, but you can't build it. There are three main parts:

sys/compat/ndis: the NDIS compat API, which provides binary
compatibility functions for many routines in NDIS.SYS, HAL.dll
and ntoskrnl.exe in Windows (these are the three modules that
most NDIS miniport drivers use). The compat module also contains
a small PE relocator/dynalinker which relocates the Windows .SYS
image and then patches in our native routines.

sys/dev/if_ndis: the if_ndis driver wrapper. This module makes
use of the ndis compat API and can be compiled with a specially
prepared binary image file (ndis_driver_data.h) containing the
Windows .SYS image and registry key information parsed out of the
accompanying .INF file. Once if_ndis.ko is built, it can be loaded
and unloaded just like a native FreeBSD kenrel module.

usr.sbin/ndiscvt: a special utility that converts foo.sys and foo.inf
into an ndis_driver_data.h file that can be compiled into if_ndis.o.
Contains an .inf file parser graciously provided by Matt Dodd (and
mercilessly hacked upon by me) that strips out device ID info and
registry key info from a .INF file and packages it up with a binary
image array. The ndiscvt(8) utility also does some manipulation of
the segments within the .sys file to make life easier for the kernel
loader. (Doing the manipulation here saves the kernel code from having
to move things around later, which would waste memory.)

ndiscvt is only built for the i386 arch. Only files.i386 has been
updated, and none of this is turned on in GENERIC. It should probably
work on pc98. I have no idea about amd64 or ia64 at this point.

This is still a work in progress. I estimate it's about %85 done, but
I want it under CVS control so I can track subsequent changes. It has
been tested with exactly three drivers: the LinkSys LNE100TX v4 driver
(Lne100v4.sys), the sample Intel 82559 driver from the Windows DDK
(e100bex.sys) and the Broadcom BCM43xx wireless driver (bcmwl5.sys). It
still needs to have a net80211 stuff added to it. To use it, you would
do something like this:

# cd /sys/modules/ndis
# make; make load
# cd /sys/modules/if_ndis
# ndiscvt -i /path/to/foo.inf -s /path/to/foo.sys -o ndis_driver_data.h
# make; make load
# sysctl -a | grep ndis

All registry keys are mapped to sysctl nodes. Sometimes drivers refer
to registry keys that aren't mentioned in foo.inf. If this happens,
the NDIS API module creates sysctl nodes for these keys on the fly so
you can tweak them.

An example usage of the Broadcom wireless driver would be:

# sysctl hw.ndis0.EnableAutoConnect=1
# sysctl hw.ndis0.SSID="MY_SSID"
# sysctl hw.ndis0.NetworkType=0 (0 for bss, 1 for adhoc)
# ifconfig ndis0 <my ipaddr> netmask 0xffffff00 up

Things to be done:

- get rid of debug messages
- add in ndis80211 support
- defer transmissions until after a status update with
  NDIS_STATUS_CONNECTED occurs
- Create smarter lookaside list support
- Split off if_ndis_pci.c and if_ndis_pccard.c attachments
- Make sure PCMCIA support works
- Fix ndiscvt to properly parse PCMCIA device IDs from INF files
- write ndisapi.9 man page
2003-12-11 22:34:37 +00:00
..
alpha Move the bktr(4) <arch>/include/ioctl_{bt848,meteor}.h files to dev/bktr 2003-12-08 07:22:42 +00:00
amd64 MFi386: remove APIC_IRQ* defines that are no longer used. 2003-12-11 02:48:25 +00:00
arm Add sysentvec->sv_fixlimits() hook so that we can catch cases on 64 bit 2003-09-25 01:10:26 +00:00
boot Properly fix a typo that the previous revision made even worse. 2003-12-11 20:40:12 +00:00
cam Move the ciss quirk to the right section, also update the comment 2003-12-08 06:29:38 +00:00
coda - Implement selwakeuppri() which allows raising the priority of a 2003-11-09 09:17:26 +00:00
compat Commit the first cut of Project Evil, also known as the NDISulator. 2003-12-11 22:34:37 +00:00
conf Commit the first cut of Project Evil, also known as the NDISulator. 2003-12-11 22:34:37 +00:00
contrib Changes to the import script to handle the compiler/debugger import. 2003-12-09 03:13:37 +00:00
crypto avoid module name conflict with opencrypto/rijndael.c. 2003-11-12 04:22:37 +00:00
ddb Reworked rev.1.14. Use the ELF symbol type again to summarily reject 2003-09-28 06:02:33 +00:00
dev Commit the first cut of Project Evil, also known as the NDISulator. 2003-12-11 22:34:37 +00:00
fs Make msdosfs long filenames matching case insensitive again. 2003-12-08 08:32:20 +00:00
geom Correct usage of mtx_init() API. This is not a functional change since 2003-12-07 23:20:53 +00:00
gnu Fixed a reference to a nonexistent variable in previous commit. Renaming 2003-11-05 11:56:58 +00:00
i4b Based on an excellent suggestion from tanimura@ define I4BPRI and use it 2003-11-10 14:20:34 +00:00
i386 - Call mp_topology() after all CPUs have been probed. 2003-12-11 03:49:02 +00:00
ia64 Assimilate ia64 back into the fold with the common freebsd32/ia32 code. 2003-12-11 01:05:09 +00:00
isa Significantly reduce the "jitter" that is typical for PS/2 mice 2003-12-11 11:28:11 +00:00
isofs/cd9660 DuH! 2003-10-18 14:10:28 +00:00
kern - Don't let the pctcpu rate limiter throttle us if we have recorded over 2003-12-11 04:23:39 +00:00
libkern Make msdosfs long filenames matching case insensitive again. 2003-12-08 08:32:20 +00:00
modules Commit the first cut of Project Evil, also known as the NDISulator. 2003-12-11 22:34:37 +00:00
net Declare gre(4) as being of IFT_TUNNEL, Like God Intended. 2003-12-09 06:39:25 +00:00
net80211 o insure the current channel is in a good state before starting an AP scan 2003-11-13 05:23:58 +00:00
netatalk Eliminate a duplicate free when deleting an interface address. This 2003-11-28 04:19:41 +00:00
netatm Introduce a MAC label reference in 'struct inpcb', which caches 2003-11-18 00:39:07 +00:00
netgraph The last argument to mtx_init() should be MTX_DEF, not 0. This is not a 2003-12-08 01:18:04 +00:00
netinet Do not panic when flushing dummynet firewall rules 2003-12-06 09:01:25 +00:00
netinet6 validate the argument for multicast routing socket options 2003-12-10 18:17:05 +00:00
netipsec Introduce a MAC label reference in 'struct inpcb', which caches 2003-11-18 00:39:07 +00:00
netipx Introduce a MAC label reference in 'struct inpcb', which caches 2003-11-18 00:39:07 +00:00
netkey don't touch after free. 2003-12-10 05:01:41 +00:00
netnatm Introduce a MAC label reference in 'struct inpcb', which caches 2003-11-18 00:39:07 +00:00
netncp The present defaults for the open and close for device drivers which 2003-09-27 12:01:01 +00:00
netsmb - Support for multibyte charsets in LIBICONV. 2003-09-26 20:26:25 +00:00
nfs University of Michigan's Citi NFSv4 kernel client code. 2003-11-14 20:54:10 +00:00
nfs4client This patch fixes two little portability (to !GCC compilers) problems: 2003-12-11 11:30:26 +00:00
nfsclient Use function pointers to remove the depenancy cross dependancy on nfs4 2003-11-22 02:21:49 +00:00
nfsserver Update a comment about needing to fix NFS server credential use 2003-11-17 00:56:53 +00:00
opencrypto eliminate an unnecessary 8Kbyte bzero that was being done for each 2003-11-19 22:42:34 +00:00
pc98 The dgb driver is redundant with the digi driver in the tree. It uses 2003-12-07 04:18:52 +00:00
pccard - Implement selwakeuppri() which allows raising the priority of a 2003-11-09 09:17:26 +00:00
pci Don't use caddr_t in mchash(). Also use C99 spellings over BSD ones. 2003-12-08 07:54:15 +00:00
posix4
powerpc imac revA-D and beige G3 OpenFirmware uses the "ide" string for 2003-12-10 08:58:48 +00:00
rpc Change the definition of NULL on ia64 (for LP64 compilations) from 2003-12-07 21:10:06 +00:00
security interpvnodelabel can be NULL in mac_test_execve_transition(). This 2003-12-10 18:48:05 +00:00
sparc64 Fix all users of mp_maxid to use the same semantics, namely: 2003-12-03 14:57:26 +00:00
sys Regen 2003-12-10 22:18:54 +00:00
tools Changes for new SMP-safe kobj method dispatch algorithm. 2003-10-16 13:29:26 +00:00
ufs Set fs_ronly to the correct value in ffs_reload() when reloading the file 2003-12-07 05:16:52 +00:00
vm Remove trailing whitespace. 2003-12-08 02:45:45 +00:00
Makefile