diff options
author | wpaul <wpaul@FreeBSD.org> | 2005-04-24 20:21:22 +0000 |
---|---|---|
committer | wpaul <wpaul@FreeBSD.org> | 2005-04-24 20:21:22 +0000 |
commit | b493dd59e2b39c6ee3f3016ffe21c427b8038eb8 (patch) | |
tree | ba1d66e7b03425d40e2969f60b5568a405137f90 /sys/compat/ndis/ntoskrnl_var.h | |
parent | e669069b43c7e2eed5fff4775fd3c6c18283165d (diff) | |
download | FreeBSD-src-b493dd59e2b39c6ee3f3016ffe21c427b8038eb8.zip FreeBSD-src-b493dd59e2b39c6ee3f3016ffe21c427b8038eb8.tar.gz |
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.
Diffstat (limited to 'sys/compat/ndis/ntoskrnl_var.h')
-rw-r--r-- | sys/compat/ndis/ntoskrnl_var.h | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/sys/compat/ndis/ntoskrnl_var.h b/sys/compat/ndis/ntoskrnl_var.h index 55e3c1e..2ef6915 100644 --- a/sys/compat/ndis/ntoskrnl_var.h +++ b/sys/compat/ndis/ntoskrnl_var.h @@ -1162,14 +1162,25 @@ typedef struct driver_object driver_object; #define WINDRV_WRAP_CDECL 4 #define WINDRV_WRAP_AMD64 5 +struct drvdb_ent { + driver_object *windrv_object; + void *windrv_devlist; + ndis_cfg *windrv_regvals; + interface_type windrv_bustype; + STAILQ_ENTRY(drvdb_ent) link; +}; + extern image_patch_table ntoskrnl_functbl[]; typedef void (*funcptr)(void); +typedef int (*matchfuncptr)(void *, void *); __BEGIN_DECLS extern int windrv_libinit(void); extern int windrv_libfini(void); extern driver_object *windrv_lookup(vm_offset_t, char *); -extern int windrv_load(module_t, vm_offset_t, int); +extern struct drvdb_ent *windrv_match(matchfuncptr, void *); +extern int windrv_load(module_t, vm_offset_t, int, interface_type, + void *, ndis_cfg *); extern int windrv_unload(module_t, vm_offset_t, int); extern int windrv_create_pdo(driver_object *, device_t); extern void windrv_destroy_pdo(driver_object *, device_t); |