aboutsummaryrefslogtreecommitdiff
path: root/usr.sbin/ndiscvt
Commit message (Collapse)AuthorAgeFilesLines
* MFC: merge the fix for PR 83477.Bill Paul2005-10-261-2/+2
| | | | | | | PR: kern/83477 Notes: svn path=/stable/5/; revision=151704
* MFC updates from the head:Bill Paul2005-10-203-106/+171
| | | | | | | | | | - install ndisgen.8 man page - fixes for ndisgen.8 man page - fixes for ndisgen.sh script to make it work correctly on amd64 and various documentation cleanups Notes: svn path=/stable/5/; revision=151518
* Merge spelling fixes from CURRENT. The revisions MFC'ed are:Giorgos Keramidas2005-08-181-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Revision Path 1.9 src/lib/libarchive/archive_entry.3 1.20 src/lib/libarchive/archive_read.3 1.9 src/lib/libc/net/inet6_rth_space.3 1.7 src/lib/libc/posix1e/acl_get_entry.3 1.14 src/lib/libc/posix1e/mac.3 1.6 src/lib/libc/posix1e/mac_prepare.3 1.36 src/lib/libc/stdtime/strftime.3 1.15 src/lib/libc/sys/kse.2 1.7 src/lib/libc/sys/uuidgen.2 1.5 src/share/man/man4/man4.i386/acpi_panasonic.4 1.39 src/share/man/man4/man4.i386/ep.4 1.4 src/share/man/man4/man4.i386/snc.4 1.3 src/share/man/man4/man4.sparc64/snd_audiocs.4 1.10 src/share/man/man4/witness.4 1.2 src/share/man/man5/devfs.conf.5 1.50 src/share/man/man9/ifnet.9 1.6 src/share/man/man9/printf.9 1.11 src/usr.bin/file2c/file2c.1 1.26 src/usr.bin/indent/indent.1 1.16 src/usr.bin/lockf/lockf.1 1.89 src/usr.bin/make/make.1 1.44 src/usr.bin/systat/systat.1 1.18 src/usr.bin/truss/truss.1 1.32 src/usr.bin/xinstall/install.1 1.10 src/usr.sbin/bluetooth/rfcomm_pppd/rfcomm_pppd.8 1.3 src/usr.sbin/bluetooth/sdpd/sdpd.8 1.35 src/usr.sbin/i4b/isdnd/isdnd.rc.5 1.52 src/usr.sbin/mtree/mtree.8 1.7 src/usr.sbin/ndiscvt/ndiscvt.8 1.12 src/usr.sbin/ntp/doc/ntpdc.8 1.25 src/usr.sbin/pppd/pppd.8 1.39 src/usr.sbin/syslogd/syslog.conf.5 Notes: svn path=/stable/5/; revision=149237
* Sync everything up with -current, except for the WPA support, whichBill Paul2005-05-222-8/+62
| | | | | | | | | | | won't work with the 5.x version of net80211. This includes all fixes to date, and support for new cards such as the AirGo MIMO and Ralink RT2500. This also includes the new driver configuration/conversion mechanism. Remember that you should use ndisgen(8) to create new drivers now, and if_ndis.ko will always be pre-built. Notes: svn path=/stable/5/; revision=146495
* This commit was manufactured by cvs2svn to create branch 'RELENG_5'.cvs2svn2005-05-101-0/+247
| | | | Notes: svn path=/stable/5/; revision=146069
* This commit was manufactured by cvs2svn to create branch 'RELENG_5'.cvs2svn2005-04-292-0/+582
| | | | Notes: svn path=/stable/5/; revision=145689
* MFC:Christian Brueffer2005-02-271-37/+34
| | | | | | | | | Scheduled mdoc(7) sweep. Original revisions by: ru Notes: svn path=/stable/5/; revision=142657
* Sync with -current.Bill Paul2005-02-231-1/+11
| | | | Notes: svn path=/stable/5/; revision=142305
* MFC all of the recent updates to -current (new framework, amd64Bill Paul2005-02-182-3/+13
| | | | | | | | support), except for the patch to if_ndis.c to do AP scanning with ifconfig (the support for which isn't present in -stable). Notes: svn path=/stable/5/; revision=142049
* Today, RealTek sent me a driver to test which had been compiled withBill Paul2004-08-021-45/+43
| | | | | | | | | | | | | | | | some debug support turned on. It turns out the sections in this driver binary had relative virtual addresses (RVAs) that were different from the raw addresses, and it had a .data section where the virtual size was much larger than the raw size. (Most production binaries produced with the Microsoft DDK have RVA == PA.) There's code in the ndiscvt(8) utility that's supposed to handle the vsize != rsize case, but it turns out it was slightly broken, and it failed to handle the RVA != RA case at all. Hopefully, this commit will fix all that. Notes: svn path=/head/; revision=133026
* Big mess 'o changes:Bill Paul2004-08-012-11/+264
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Give ndiscvt(8) the ability to process a .SYS file directly into a .o file so that we don't have to emit big messy char arrays into the ndis_driver_data.h file. This behavior is currently optional, but may become the default some day. - Give ndiscvt(8) the ability to turn arbitrary files into .ko files so that they can be pre-loaded or kldloaded. (Both this and the previous change involve using objcopy(1)). - Give NdisOpenFile() the ability to 'read' files out of kernel memory that have been kldloaded or pre-loaded, and disallow the use of the normal vn_open() file opening method during bootstrap (when no filesystems have been mounted yet). Some people have reported that kldloading if_ndis.ko works fine when the system is running multiuser but causes a panic when the modile is pre-loaded by /boot/loader. This happens with drivers that need to use NdisOpenFile() to access external files (i.e. firmware images). NdisOpenFile() won't work during kernel bootstrapping because no filesystems have been mounted. To get around this, you can now do the following: o Say you have a firmware file called firmware.img o Do: ndiscvt -f firmware.img -- this creates firmware.img.ko o Put the firmware.img.ko in /boot/kernel o add firmware.img_load="YES" in /boot/loader.conf o add if_ndis_load="YES" and ndis_load="YES" as well Now the loader will suck the additional file into memory as a .ko. The phony .ko has two symbols in it: filename_start and filename_end, which are generated by objcopy(1). ndis_open_file() will traverse each module in the module list looking for these symbols and, if it finds them, it'll use them to generate the file mapping address and length values that the caller of NdisOpenFile() wants. As a bonus, this will even work if the file has been statically linked into the kernel itself, since the "kernel" module is searched too. (ndiscvt(8) will generate both filename.o and filename.ko for you). - Modify the mechanism used to provide make-pretend FASTCALL support. Rather than using inline assembly to yank the first two arguments out of %ecx and %edx, we now use the __regparm__(3) attribute (and the __stdcall__ attribute) and use some macro magic to re-order the arguments and provide dummy arguments as needed so that the arguments passed in registers end up in the right place. Change taken from DragonflyBSD version of the NDISulator. Notes: svn path=/head/; revision=132973
* Assorted markup, grammar, and spelling fixes.Ruslan Ermilov2004-06-131-32/+66
| | | | Notes: svn path=/head/; revision=130420
* Add preliminary support for PCMCIA devices in addition to PCI/cardbus.Bill Paul2004-03-072-9/+159
| | | | | | | | | | | | | | | 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. Notes: svn path=/head/; revision=126706
* style.Makefile(5):Johan Karlsson2004-02-231-1/+1
| | | | | | | Use WARNS?= instead of WARNS=. Notes: svn path=/head/; revision=126178
* Some Windows .INF files are deliberately sabotaged to prevent them fromBill Paul2004-01-271-1/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | loading on a particular version of Windows. For example, a .INF file for a Windows 2000 driver may have an empty [foo.NT.5.1] section which will be ingored on Win2K (whose .INF parser won't look for sections decorated with .NT.5.1) in favor of a [foo] section. Likewise, a WinXP file will have an empty [foo] section which will be ignored in favor of [foo.NT.5.1]. The problem is, we can handle both Win2K and WinXP drivers, and we don't want to exclude either one. As a workaround, we try to pretend we are WinXP by default and search for sections decorated with .NT.5.1, but if we don't turn up any records, we assume that maybe we're being fooled by a sabotaged .INF file and make one more pass looking for undecorated sections instead. This allows us to parse the .INF files for both the Win2K and the WinXP Centrino wireless drivers. I'd give anything for 5 minutes alone in a room with whoever wrote Microsoft's .INF file parser. Just 5 minutes. That's all. Notes: svn path=/head/; revision=125073
* Deal with keys with descriptions that have empty fields in some ofBill Paul2004-01-231-4/+12
| | | | | | | | | | | their lines. Properly discard PCMCIA device declarations. I plan to support PCMCIA cards, but they don't work yet, and it appears some .INF files declare both PCI and PCMCIA device instances. Notes: svn path=/head/; revision=124886
* Yet another inf file handling tweak: when checking for Ndi\Params\fooBill Paul2004-01-131-2/+2
| | | | | | | | | | | keys, don't just do a substring match on "Ndi\Params". Instead, check explicitly for strings that begin with "Ndi\Params". Why? Because it's possible to create your own keys with different paths, like "PROSetNdi\NdiExt\Params" which is what Intel does in their PRO/1000 driver's .INF file. Notes: svn path=/head/; revision=124452
* - Handle doubled double quotes:Matthew N. Dodd2004-01-111-1/+11
| | | | | | | | | | `"""foo"" bar"' -> `"foo" bar' - Handle C++ style comments. Requested by: wpaul Notes: svn path=/head/; revision=124401
* Tweak ndiscvt to support yet another flavor of .INF files (look forBill Paul2004-01-031-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | the NTx86 section decoration). subr_ndis.c: correct the behavior of ndis_query_resources(): if the caller doesn't provide enough space to return the resources, tell it how much it needs to provide and return an error. subr_hal.c & subr_ntoskrnl.c: implement/stub a bunch of new routines; ntoskrnl: KefAcquireSpinLockAtDpcLevel KefReleaseSpinLockFromDpcLevel MmMapLockedPages InterlockedDecrement InterlockedIncrement IoFreeMdl KeInitializeSpinLock HAL: KfReleaseSpinLock KeGetCurrentIrql KfAcquireSpinLock Lastly, correct spelling of "_aullshr" in the ntoskrnl functable. Notes: svn path=/head/; revision=124094
* Fix usage() (-d is really -n).Brian Feldman2004-01-021-1/+1
| | | | Notes: svn path=/head/; revision=124089
* Handle WinNT .inf files with a $windows nt$ signature but no .NT decoratedBill Paul2004-01-022-2/+10
| | | | | | | | | AddReg sections. Also insert extra newline after emitting device name overrides. Notes: svn path=/head/; revision=124085
* Clean up ndiscvt a bit (leaving out the -i flag didn't work) and addBill Paul2004-01-025-8/+115
| | | | | | | | | | | | | | | | | | | | | copyrights to the inf parser files. Add a -n flag to ndiscvt to allow the user to override the default device name of NDIS devices. Instead of "ndis0, ndis1, etc..." you can have "foo0, foo1, etc..." This allows you to have more than one kind of NDIS device in the kernel at the same time. Convert from printf() to device_printf() in if_ndis.c, kern_ndis.c and subr_ndis.c. Create UMA zones for ndis_packet and ndis_buffer structs allocated on transmit. The zones are created and destroyed in the modevent handler in kern_ndis.c. printf() and UMA changes submitted by green@freebsd.org Notes: svn path=/head/; revision=124060
* Remember to use stringcvt() to expand %foo% strings in registry values inBill Paul2003-12-301-1/+1
| | | | | | | | | dump_defaultinfo(). Noticed by: green@freebsd.org Notes: svn path=/head/; revision=123977
* Correct a typo in the text.Bill Paul2003-12-231-9/+2
| | | | | | | | Remove BUGS section since the bug it describes has been fixed. Spell Matt Dodd's name correctly. (Oops.) Notes: svn path=/head/; revision=123775
* Make ndiscvt(8) emit the binary image array as inline assembly code ratherBill Paul2003-12-181-8/+16
| | | | | | | | | | | | | | | | | | | | | | than a char array. Emitting the data as a big char array works fine in the typical case, where a .sys file may be ~50K in size. Unfortunately, some .sys files can be several hundred Kbytes in size, or even several megabytes in size. One extreme case is the Intel centrino wireless driver, which is 2.4MB. This causes us to emit an ndis_driver_data.h file that's on the order of 15MB in size, and gcc consumes enormous amounts of virtual memory while trying to compile it. On my laptop, with 128MB of RAM and 256MB of swap space, gcc consumed all available VM and crashed without being able to compile if_ndis.o. By emitting the array as assembler, we bypass the C compiler and consume much less memory. I was able to easily test compile if_ndis.ko with the centrino driver on my laptop after this change. This is merely a convenience, and should not have any operational effect on the NDISulator itself. Notes: svn path=/head/; revision=123653
* Grrrr. Remove -g flag that snuck in.Bill Paul2003-12-181-1/+1
| | | | Notes: svn path=/head/; revision=123621
* Deal with the duplicate sysctl leaf problem. A .inf file may containBill Paul2003-12-182-33/+27
| | | | | | | | | | | | | | | | | | | | | definitions for more than one device (usually differentiated by the PCI subvendor/subdevice ID). Each device also has its own tree of registry keys. In some cases, each device has the same keys, but sometimes each device has a unique tree but with overlap. Originally, I just had ndiscvt(8) dump out all the keys it could find, and we would try to apply them to every device we could find. Now, each key has an index number that matches it to a device in the device ID list. This lets us create just the keys that apply to a particular device. I also added an extra field to the device list to hold the subvendor and subdevice ID. Some devices are generic, i.e. there is no subsystem definition. If we have a device that doesn't match a specific subsystem value and we have a generic entry, we use the generic entry. Notes: svn path=/head/; revision=123620
* Support yet another variant of WinXP .INF files.Bill Paul2003-12-131-5/+11
| | | | Notes: svn path=/head/; revision=123511
* Attempt to handle WinXP .INF files. Also, in dump_regvals(), handleBill Paul2003-12-121-9/+36
| | | | | | | | | | | | | | | the case where there's an entry in the manufacturer's device list but no corresponding installation section (and hence no AddReg assignments), i.e. if dev = find_assign(sname, "AddReg"); returns NULL, then don't try to dereference dev. There is a fundamental problem with the handling of .INF files that contain definitions for multiple devices: right now we dump all the AddReg sections that we find, but don't distinguish what device they belong to. This often results in duplicate keys. Notes: svn path=/head/; revision=123483
* Fix handling of .INF files with more than one PCI ID defined.Bill Paul2003-12-111-2/+3
| | | | Notes: svn path=/head/; revision=123480
* Fix getopt() string so -o works.Bill Paul2003-12-111-1/+1
| | | | Notes: svn path=/head/; revision=123479
* Grrr. Put the right .PATH statements in the right Makefiles.Bill Paul2003-12-111-1/+1
| | | | Notes: svn path=/head/; revision=123478
* Commit the ndiscvt(8) utility too. (Missed it in the last import.)Bill Paul2003-12-117-0/+1138
Notes: svn path=/head/; revision=123475