head	1.8;
access;
symbols
	RELENG_8_4:1.8.0.2
	RELENG_9_1_0_RELEASE:1.7.4.1.4.2
	RELENG_9_1:1.7.4.1.0.4
	RELENG_9_1_BP:1.7.4.1
	RELENG_8_3_0_RELEASE:1.7.2.1.8.1
	RELENG_8_3:1.7.2.1.0.8
	RELENG_8_3_BP:1.7.2.1
	RELENG_9_0_0_RELEASE:1.7.4.1.2.1
	RELENG_9_0:1.7.4.1.0.2
	RELENG_9_0_BP:1.7.4.1
	RELENG_9:1.7.0.4
	RELENG_9_BP:1.7
	RELENG_7_4_0_RELEASE:1.6.12.1
	RELENG_8_2_0_RELEASE:1.7.2.1.6.1
	RELENG_7_4:1.6.0.12
	RELENG_7_4_BP:1.6
	RELENG_8_2:1.7.2.1.0.6
	RELENG_8_2_BP:1.7.2.1
	RELENG_8_1_0_RELEASE:1.7.2.1.4.1
	RELENG_8_1:1.7.2.1.0.4
	RELENG_8_1_BP:1.7.2.1
	RELENG_7_3_0_RELEASE:1.6.10.1
	RELENG_7_3:1.6.0.10
	RELENG_7_3_BP:1.6
	RELENG_8_0_0_RELEASE:1.7.2.1.2.1
	RELENG_8_0:1.7.2.1.0.2
	RELENG_8_0_BP:1.7.2.1
	RELENG_8:1.7.0.2
	RELENG_8_BP:1.7
	RELENG_7_2_0_RELEASE:1.6.8.1
	RELENG_7_2:1.6.0.8
	RELENG_7_2_BP:1.6
	RELENG_7_1_0_RELEASE:1.6.6.1
	RELENG_6_4_0_RELEASE:1.5.12.1
	RELENG_7_1:1.6.0.6
	RELENG_7_1_BP:1.6
	RELENG_6_4:1.5.0.12
	RELENG_6_4_BP:1.5
	RELENG_7_0_0_RELEASE:1.6
	RELENG_6_3_0_RELEASE:1.5
	RELENG_7_0:1.6.0.4
	RELENG_7_0_BP:1.6
	RELENG_6_3:1.5.0.10
	RELENG_6_3_BP:1.5
	RELENG_7:1.6.0.2
	RELENG_7_BP:1.6
	RELENG_6_2_0_RELEASE:1.5
	RELENG_6_2:1.5.0.8
	RELENG_6_2_BP:1.5
	RELENG_5_5_0_RELEASE:1.4.2.2
	RELENG_5_5:1.4.2.2.0.4
	RELENG_5_5_BP:1.4.2.2
	RELENG_6_1_0_RELEASE:1.5
	RELENG_6_1:1.5.0.6
	RELENG_6_1_BP:1.5
	RELENG_6_0_0_RELEASE:1.5
	RELENG_6_0:1.5.0.4
	RELENG_6_0_BP:1.5
	RELENG_6:1.5.0.2
	RELENG_6_BP:1.5
	RELENG_5_4_0_RELEASE:1.4.2.2
	RELENG_5_4:1.4.2.2.0.2
	RELENG_5_4_BP:1.4.2.2
	RELENG_5_3_0_RELEASE:1.4
	RELENG_5_3:1.4.0.4
	RELENG_5_3_BP:1.4
	RELENG_5:1.4.0.2
	RELENG_5_BP:1.4;
locks; strict;
comment	@# @;


1.8
date	2012.11.17.01.52.56;	author svnexp;	state Exp;
branches
	1.8.2.1;
next	1.7;

1.7
date	2009.03.07.07.26.22;	author weongyo;	state Exp;
branches
	1.7.2.1
	1.7.4.1;
next	1.6;

1.6
date	2005.09.27.18.10.35;	author mlaier;	state Exp;
branches
	1.6.2.1
	1.6.6.1
	1.6.8.1
	1.6.10.1
	1.6.12.1;
next	1.5;

1.5
date	2005.04.24.20.21.22;	author wpaul;	state Exp;
branches
	1.5.2.1
	1.5.12.1;
next	1.4;

1.4
date	2004.05.26.00.53.04;	author imp;	state Exp;
branches
	1.4.2.1;
next	1.3;

1.3
date	2004.03.07.02.49.06;	author wpaul;	state Exp;
branches;
next	1.2;

1.2
date	2003.12.11.23.22.44;	author wpaul;	state Exp;
branches;
next	1.1;

1.1
date	2003.12.11.22.34.36;	author wpaul;	state Exp;
branches;
next	;

1.8.2.1
date	2012.11.17.01.52.56;	author svnexp;	state dead;
branches;
next	1.8.2.2;

1.8.2.2
date	2013.03.28.13.05.20;	author svnexp;	state Exp;
branches;
next	;

1.7.2.1
date	2009.08.03.08.13.06;	author kensmith;	state Exp;
branches
	1.7.2.1.2.1
	1.7.2.1.4.1
	1.7.2.1.6.1
	1.7.2.1.8.1;
next	1.7.2.2;

1.7.2.2
date	2012.11.17.10.36.56;	author svnexp;	state Exp;
branches;
next	;

1.7.2.1.2.1
date	2009.10.25.01.10.29;	author kensmith;	state Exp;
branches;
next	;

1.7.2.1.4.1
date	2010.06.14.02.09.06;	author kensmith;	state Exp;
branches;
next	;

1.7.2.1.6.1
date	2010.12.21.17.09.25;	author kensmith;	state Exp;
branches;
next	;

1.7.2.1.8.1
date	2012.03.03.06.15.13;	author kensmith;	state Exp;
branches;
next	1.7.2.1.8.2;

1.7.2.1.8.2
date	2012.11.17.08.25.33;	author svnexp;	state Exp;
branches;
next	;

1.7.4.1
date	2011.09.23.00.51.37;	author kensmith;	state Exp;
branches
	1.7.4.1.2.1
	1.7.4.1.4.1;
next	1.7.4.2;

1.7.4.2
date	2012.11.17.11.37.17;	author svnexp;	state Exp;
branches;
next	;

1.7.4.1.2.1
date	2011.11.11.04.20.22;	author kensmith;	state Exp;
branches;
next	1.7.4.1.2.2;

1.7.4.1.2.2
date	2012.11.17.08.37.13;	author svnexp;	state Exp;
branches;
next	;

1.7.4.1.4.1
date	2012.08.05.23.54.33;	author kensmith;	state Exp;
branches;
next	1.7.4.1.4.2;

1.7.4.1.4.2
date	2012.11.17.08.48.04;	author svnexp;	state Exp;
branches;
next	;

1.6.2.1
date	2012.11.17.08.06.49;	author svnexp;	state Exp;
branches;
next	;

1.6.6.1
date	2008.11.25.02.59.29;	author kensmith;	state Exp;
branches;
next	;

1.6.8.1
date	2009.04.15.03.14.26;	author kensmith;	state Exp;
branches;
next	;

1.6.10.1
date	2010.02.10.00.26.20;	author kensmith;	state Exp;
branches;
next	;

1.6.12.1
date	2010.12.21.17.10.29;	author kensmith;	state Exp;
branches;
next	1.6.12.2;

1.6.12.2
date	2012.11.17.08.17.27;	author svnexp;	state Exp;
branches;
next	;

1.5.2.1
date	2012.11.17.07.44.19;	author svnexp;	state Exp;
branches;
next	;

1.5.12.1
date	2008.10.02.02.57.24;	author kensmith;	state Exp;
branches;
next	;

1.4.2.1
date	2005.03.31.04.24.36;	author wpaul;	state Exp;
branches;
next	1.4.2.2;

1.4.2.2
date	2005.03.31.04.27.38;	author wpaul;	state Exp;
branches;
next	;


desc
@@


1.8
log
@Switching exporter and resync
@
text
@# $FreeBSD: head/sys/modules/if_ndis/Makefile 189488 2009-03-07 07:26:22Z weongyo $

.PATH: ${.CURDIR}/../../dev/if_ndis

KMOD=	if_ndis
SRCS=	if_ndis.c if_ndis_pci.c if_ndis_pccard.c if_ndis_usb.c
SRCS+=	device_if.h bus_if.h pci_if.h card_if.h pccarddevs.h
SRCS+=	opt_bus.h opt_usb.h usb_if.h usbdevs.h

.include <bsd.kmod.mk>
@


1.8.2.1
log
@file Makefile was added on branch RELENG_8_4 on 2013-03-28 13:05:20 +0000
@
text
@d1 10
@


1.8.2.2
log
@## SVN ## Exported commit - http://svnweb.freebsd.org/changeset/base/248810
## SVN ## CVS IS DEPRECATED: http://wiki.freebsd.org/CvsIsDeprecated
@
text
@a0 10
# $FreeBSD: releng/8.4/sys/modules/if_ndis/Makefile 189488 2009-03-07 07:26:22Z weongyo $

.PATH: ${.CURDIR}/../../dev/if_ndis

KMOD=	if_ndis
SRCS=	if_ndis.c if_ndis_pci.c if_ndis_pccard.c if_ndis_usb.c
SRCS+=	device_if.h bus_if.h pci_if.h card_if.h pccarddevs.h
SRCS+=	opt_bus.h opt_usb.h usb_if.h usbdevs.h

.include <bsd.kmod.mk>
@


1.7
log
@SVN rev 189488 on 2009-03-07 07:26:22Z by weongyo

o port NDIS USB support from USB1 to the new usb(USB2).
o implement URB_FUNCTION_ABORT_PIPE handling.
o remove unused code related with canceling the timer list for USB
  drivers.
o whitespace cleanup and style(9)

Obtained from:	hps's original patch
@
text
@d1 1
a1 1
# $FreeBSD$
@


1.7.4.1
log
@SVN rev 225736 on 2011-09-23 00:51:37Z by kensmith

Copy head to stable/9 as part of 9.0-RELEASE release cycle.

Approved by:	re (implicit)
@
text
@@


1.7.4.2
log
@## SVN ##
## SVN ## Exported commit - http://svnweb.freebsd.org/changeset/base/ 242902
## SVN ## CVS IS DEPRECATED: http://wiki.freebsd.org/CvsIsDeprecated
## SVN ##
## SVN ## ------------------------------------------------------------------------
## SVN ## r242902 | dteske | 2012-11-11 23:29:45 +0000 (Sun, 11 Nov 2012) | 10 lines
## SVN ##
## SVN ## Fix a regression introduced by SVN r211417 that saw the breakage of a feature
## SVN ## documented in usr.sbin/sysinstall/help/shortcuts.hlp (reproduced below):
## SVN ##
## SVN ## If /usr/sbin/sysinstall is linked to another filename, say
## SVN ## `/usr/local/bin/configPackages', then the basename will be used
## SVN ## as an implicit command name.
## SVN ##
## SVN ## Reviewed by:	adrian (co-mentor)
## SVN ## Approved by:	adrian (co-mentor)
## SVN ##
## SVN ## ------------------------------------------------------------------------
## SVN ##
@
text
@d1 1
a1 1
# $FreeBSD: stable/9/sys/modules/if_ndis/Makefile 189488 2009-03-07 07:26:22Z weongyo $
@


1.7.4.1.4.1
log
@SVN rev 239080 on 2012-08-05 23:54:33Z by kensmith

Copy stable/9 to releng/9.1 as part of the 9.1-RELEASE release process.

Approved by:	re (implicit)
@
text
@@


1.7.4.1.4.2
log
@Switch importer
@
text
@d1 1
a1 1
# $FreeBSD: releng/9.1/sys/modules/if_ndis/Makefile 189488 2009-03-07 07:26:22Z weongyo $
@


1.7.4.1.2.1
log
@SVN rev 227445 on 2011-11-11 04:20:22Z by kensmith

Copy stable/9 to releng/9.0 as part of the FreeBSD 9.0-RELEASE release
cycle.

Approved by:	re (implicit)
@
text
@@


1.7.4.1.2.2
log
@Switch importer
@
text
@d1 1
a1 1
# $FreeBSD: releng/9.0/sys/modules/if_ndis/Makefile 189488 2009-03-07 07:26:22Z weongyo $
@


1.7.2.1
log
@SVN rev 196045 on 2009-08-03 08:13:06Z by kensmith

Copy head to stable/8 as part of 8.0 Release cycle.

Approved by:	re (Implicit)
@
text
@@


1.7.2.2
log
@## SVN ##
## SVN ## Exported commit - http://svnweb.freebsd.org/changeset/base/ 242909
## SVN ## CVS IS DEPRECATED: http://wiki.freebsd.org/CvsIsDeprecated
## SVN ##
## SVN ## ------------------------------------------------------------------------
## SVN ## r242909 | dim | 2012-11-12 07:47:19 +0000 (Mon, 12 Nov 2012) | 20 lines
## SVN ##
## SVN ## MFC r242625:
## SVN ##
## SVN ## Remove duplicate const specifiers in many drivers (I hope I got all of
## SVN ## them, please let me know if not).  Most of these are of the form:
## SVN ##
## SVN ## static const struct bzzt_type {
## SVN ##       [...list of members...]
## SVN ## } const bzzt_devs[] = {
## SVN ##       [...list of initializers...]
## SVN ## };
## SVN ##
## SVN ## The second const is unnecessary, as arrays cannot be modified anyway,
## SVN ## and if the elements are const, the whole thing is const automatically
## SVN ## (e.g. it is placed in .rodata).
## SVN ##
## SVN ## I have verified this does not change the binary output of a full kernel
## SVN ## build (except for build timestamps embedded in the object files).
## SVN ##
## SVN ## Reviewed by:	yongari, marius
## SVN ##
## SVN ## ------------------------------------------------------------------------
## SVN ##
@
text
@d1 1
a1 1
# $FreeBSD: stable/8/sys/modules/if_ndis/Makefile 189488 2009-03-07 07:26:22Z weongyo $
@


1.7.2.1.8.1
log
@SVN rev 232438 on 2012-03-03 06:15:13Z by kensmith

Copy stable/8 to releng/8.3 as part of 8.3-RELEASE release cycle.

Approved by:	re (implicit)
@
text
@@


1.7.2.1.8.2
log
@Switch importer
@
text
@d1 1
a1 1
# $FreeBSD: releng/8.3/sys/modules/if_ndis/Makefile 189488 2009-03-07 07:26:22Z weongyo $
@


1.7.2.1.6.1
log
@SVN rev 216617 on 2010-12-21 17:09:25Z by kensmith

Copy stable/8 to releng/8.2 in preparation for FreeBSD-8.2 release.

Approved by:	re (implicit)
@
text
@@


1.7.2.1.4.1
log
@SVN rev 209145 on 2010-06-14 02:09:06Z by kensmith

Copy stable/8 to releng/8.1 in preparation for 8.1-RC1.

Approved by:	re (implicit)
@
text
@@


1.7.2.1.2.1
log
@SVN rev 198460 on 2009-10-25 01:10:29Z by kensmith

Copy stable/8 to releng/8.0 as part of 8.0-RELEASE release procedure.

Approved by:	re (implicit)
@
text
@@


1.6
log
@Remove bridge(4) from the tree.  if_bridge(4) is a full functional
replacement and has additional features which make it superior.

Discussed on:	-arch
Reviewed by:	thompsa
X-MFC-after:	never (RELENG_6 as transition period)
@
text
@d8 1
a8 1
SRCS+=	opt_usb.h usbdevs.h
@


1.6.2.1
log
@Switch importer
@
text
@d1 1
a1 1
# $FreeBSD: stable/7/sys/modules/if_ndis/Makefile 150636 2005-09-27 18:10:43Z mlaier $
@


1.6.12.1
log
@SVN rev 216618 on 2010-12-21 17:10:29Z by kensmith

Copy stable/7 to releng/7.4 in preparation for FreeBSD-7.4 release.

Approved by:	re (implicit)
@
text
@@


1.6.12.2
log
@Switch importer
@
text
@d1 1
a1 1
# $FreeBSD: releng/7.4/sys/modules/if_ndis/Makefile 150636 2005-09-27 18:10:43Z mlaier $
@


1.6.10.1
log
@SVN rev 203736 on 2010-02-10 00:26:20Z by kensmith

Copy stable/7 to releng/7.3 as part of the 7.3-RELEASE process.

Approved by:	re (implicit)
@
text
@@


1.6.8.1
log
@SVN rev 191087 on 2009-04-15 03:14:26Z by kensmith

Create releng/7.2 from stable/7 in preparation for 7.2-RELEASE.

Approved by:	re (implicit)
@
text
@@


1.6.6.1
log
@SVN rev 185281 on 2008-11-25 02:59:29Z by kensmith

Create releng/7.1 in preparation for moving into RC phase of 7.1 release
cycle.

Approved by:	re (implicit)
@
text
@@


1.5
log
@Throw the switch on the new driver generation/loading mechanism. From
here on in, if_ndis.ko will be pre-built as a module, and can be built
into a static kernel (though it's not part of GENERIC). Drivers are
created using the new ndisgen(8) script, which uses ndiscvt(8) under
the covers, along with a few other tools. The result is a driver module
that can be kldloaded into the kernel.

A driver with foo.inf and foo.sys files will be converted into
foo_sys.ko (and foo_sys.o, for those who want/need to make static
kernels). This module contains all of the necessary info from the
.INF file and the driver binary image, converted into an ELF module.
You can kldload this module (or add it to /boot/loader.conf) to have
it loaded automatically. Any required firmware files can be bundled
into the module as well (or converted/loaded separately).

Also, add a workaround for a problem in NdisMSleep(). During system
bootstrap (cold == 1), msleep() always returns 0 without actually
sleeping. The Intel 2200BG driver uses NdisMSleep() to wait for
the NIC's firmware to come to life, and fails to load if NdisMSleep()
doesn't actually delay. As a workaround, if msleep() (and hence
ndis_thsuspend()) returns 0, use a hard DELAY() to sleep instead).
This is not really the right thing to do, but we can't really do much
else. At the very least, this makes the Intel driver happy.

There are probably other drivers that fail in this way during bootstrap.
Unfortunately, the only workaround for those is to avoid pre-loading
them and kldload them once the system is running instead.
@
text
@d7 1
a7 1
SRCS+=	opt_bdg.h device_if.h bus_if.h pci_if.h card_if.h pccarddevs.h
@


1.5.2.1
log
@Switch importer
@
text
@d1 1
a1 1
# $FreeBSD: stable/6/sys/modules/if_ndis/Makefile 145485 2005-04-24 20:21:22Z wpaul $
@


1.5.12.1
log
@SVN rev 183531 on 2008-10-02 02:57:24Z by kensmith

Create releng/6.4 from stable/6 in preparation for 6.4-RC1.

Approved by:	re (implicit)
@
text
@@


1.4
log
@Move to generating pccarddevs.h on the fly, both for the kernel and
the modules.

Also generate usbdevs.h automatically now, but a non-kernel file is
stopping that at the moment.
@
text
@d6 1
a6 1
SRCS=	if_ndis.c if_ndis_pci.c if_ndis_pccard.c
d8 1
@


1.4.2.1
log
@MFC all of the recent enhancements and bug fixes from the head to
RELENG_5. This includes almost everything, except for if_ndis_usb.c,
which is just a stub at the moment and won't be ready in time for
5.4, and for the patches to enable "ifconfig ndis0 scan" to work,
since net80211 in RELENG_5 doesn't support it.

Also turn on ndiscvt(8) for the amd64 platform.

Approved by:	re
@
text
@d6 1
a6 1
SRCS=	if_ndis.c if_ndis_pci.c if_ndis_pccard.c if_ndis_usb.c
@


1.4.2.2
log
@Grrr. I said no if_ndis_usb.c, and I meant it.

Approved by:	re
@
text
@d6 1
a6 1
SRCS=	if_ndis.c if_ndis_pci.c if_ndis_pccard.c
@


1.3
log
@Add preliminary support for PCMCIA devices in addition to PCI/cardbus.
if_ndis.c has been split into if_ndis_pci.c and if_ndis_pccard.c.
The ndiscvt(8) utility should be able to parse device info for PCMCIA
devices now. The ndis_alloc_amem() has moved from kern_ndis.c to
if_ndis_pccard.c so that kern_ndis.c no longer depends on pccard.

NOTE: this stuff is not guaranteed to work 100% correctly yet. So
far I have been able to load/init my PCMCIA Cisco Aironet 340 card,
but it crashes in the interrupt handler. The existing support for
PCI/cardbus devices should still work as before.
@
text
@d7 1
a7 1
SRCS+=	opt_bdg.h device_if.h bus_if.h pci_if.h card_if.h
@


1.2
log
@Grrr. Put the right .PATH statements in the right Makefiles.
@
text
@d6 1
a6 1
SRCS=	if_ndis.c
@


1.1
log
@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
@
text
@d3 1
a3 1
.PATH: ${.CURDIR}/../../compat/ndis
@

