summaryrefslogtreecommitdiffstats
path: root/sys/compat/ndis
Commit message (Collapse)AuthorAgeFilesLines
* MFC r318677:glebius2017-06-082-11/+19
| | | | | | | | | Fix regression in ndis(4) after r286410. This adds a bunch of checks for whether this is a Ethernet or 802.11 device and does proper dereferencing. PR: 213237 Submitted by: <ota j.email.ne.jp> Approved by: re (marius)
* ndis(4): Undo unneeded workarounds in ndis' rand().pfg2016-05-221-2/+0
| | | | | | | | - Revert the change for seed(0) in r300384. I misunderstood the standard and while our random() implementation in libkern may be improved, it handles the seed(0) case fine. Pointed out by: bde, ache
* ndis(4): adjustments for our random() specific implementation.pfg2016-05-221-1/+3
| | | | | | | | | - Revert r300377: The implementation claims to return a value within the range. [1] - Adjust the value for the case of a zero seed, whihc according to standards should be equivalent to a seed of value 1. Pointed out by: cem
* ndis(4): Avoid overflow.pfg2016-05-211-1/+1
| | | | | | | | This is a long standing problem: our random() function returns an unsigned integer but the rand provided by ndis(4) returns an int. Scale it down. MFC after: 2 weeks
* ndis(4): Better mimic the behavior of rand() on Windows.pfg2016-05-211-6/+3
| | | | | | | | | | | | | | | In ndis(4) we expose a rand() function that was constantly reseeding with a time depending function every time it was called. This essentially broke the reasoning behind seeding, and rendered srand() a no-op. Keep it simple, just use random() and srandom() as it's meant to work. It would have been tempting to just go for arc4random() but we want to mimic Microsoft, and we don't need crypto-grade randomness here. PR: 209616 MFC after: 2 weeks
* ndis: spelling fixes in comments.pfg2016-04-306-10/+10
| | | | No functional change.
* ndis(4): it's rather unrealistic to expect a size_t here.pfg2016-04-281-1/+1
| | | | int was actually OK, and u_int is more than enough.
* ndis(4): unsign some indexes to prevent overflows.pfg2016-04-281-5/+5
| | | | | | | | | | The "len" parameter is uint32_t, indexing it with an int may end up in a signed integer overflow. strlen(3) returns an integer of size_t so the corresponding index should have that size. MFC after: 1 week
* sys: extend use of the howmany() macro when available.pfg2016-04-261-1/+1
| | | | | We have a howmany() macro in the <sys/param.h> header that is convenient to re-use as it makes things easier to read.
* Use uintmax_t (typedef'd to rman_res_t type) for rman ranges.jhibbits2016-03-181-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | On some architectures, u_long isn't large enough for resource definitions. Particularly, powerpc and arm allow 36-bit (or larger) physical addresses, but type `long' is only 32-bit. This extends rman's resources to uintmax_t. With this change, any resource can feasibly be placed anywhere in physical memory (within the constraints of the driver). Why uintmax_t and not something machine dependent, or uint64_t? Though it's possible for uintmax_t to grow, it's highly unlikely it will become 128-bit on 32-bit architectures. 64-bit architectures should have plenty of RAM to absorb the increase on resource sizes if and when this occurs, and the number of resources on memory-constrained systems should be sufficiently small as to not pose a drastic overhead. That being said, uintmax_t was chosen for source clarity. If it's specified as uint64_t, all printf()-like calls would either need casts to uintmax_t, or be littered with PRI*64 macros. Casts to uintmax_t aren't horrible, but it would also bake into the API for resource_list_print_type() either a hidden assumption that entries get cast to uintmax_t for printing, or these calls would need the PRI*64 macros. Since source code is meant to be read more often than written, I chose the clearest path of simply using uintmax_t. Tested on a PowerPC p5020-based board, which places all device resources in 0xfxxxxxxxx, and has 8GB RAM. Regression tested on qemu-system-i386 Regression tested on qemu-system-mips (malta profile) Tested PAE and devinfo on virtualbox (live CD) Special thanks to bz for his testing on ARM. Reviewed By: bz, jhb (previous) Relnotes: Yes Sponsored by: Alex Perez/Inertial Computing Differential Revision: https://reviews.freebsd.org/D4544
* Rename P_KTHREAD struct proc p_flag to P_KPROC.kib2016-02-091-1/+1
| | | | | | | | I left as is an apparent bug in ntoskrnl_var.h:AT_PASSIVE_LEVEL() definition. Suggested by: jhb Sponsored by: The FreeBSD Foundation
* Create a dedicated function for ensuring that cdir and rdir are populated.mjg2015-07-111-4/+1
| | | | | | | | Previously several places were doing it on its own, partially incorrectly (e.g. without the filedesc locked) or even actively harmful by populating jdir or assigning rootvnode without vrefing it. Reviewed by: kib
* CALLOUT_MPSAFE has lost its meaning since r141428, i.e., for more than tenjkim2015-05-221-1/+1
| | | | | | | | | | years for head. However, it is continuously misused as the mpsafe argument for callout_init(9). Deprecate the flag and clean up callout_init() calls to make them more consistent. Differential Revision: https://reviews.freebsd.org/D2613 Reviewed by: jhb MFC after: 2 weeks
* Fix multiple incorrect SYSCTL arguments in the kernel:hselasky2014-10-211-17/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | - Wrong integer type was specified. - Wrong or missing "access" specifier. The "access" specifier sometimes included the SYSCTL type, which it should not, except for procedural SYSCTL nodes. - Logical OR where binary OR was expected. - Properly assert the "access" argument passed to all SYSCTL macros, using the CTASSERT macro. This applies to both static- and dynamically created SYSCTLs. - Properly assert the the data type for both static and dynamic SYSCTLs. In the case of static SYSCTLs we only assert that the data pointed to by the SYSCTL data pointer has the correct size, hence there is no easy way to assert types in the C language outside a C-function. - Rewrote some code which doesn't pass a constant "access" specifier when creating dynamic SYSCTL nodes, which is now a requirement. - Updated "EXAMPLES" section in SYSCTL manual page. MFC after: 3 days Sponsored by: Mellanox Technologies
* All mbuf external free functions never fail, so let them be void.glebius2014-07-112-6/+4
| | | | Sponsored by: Nginx, Inc.
* Remove ia64.marcel2014-07-071-2/+0
| | | | | | | | | | | | | | | | | This includes: o All directories named *ia64* o All files named *ia64* o All ia64-specific code guarded by __ia64__ o All ia64-specific makefile logic o Mention of ia64 in comments and documentation This excludes: o Everything under contrib/ o Everything under crypto/ o sys/xen/interface o sys/sys/elf_common.h Discussed at: BSDcan
* Include necessary headers that now are available due to pollutionglebius2013-10-281-0/+1
| | | | | | | via if_var.h. Sponsored by: Netflix Sponsored by: Nginx, Inc.
* The r48589 promised to remove implicit inclusion of if_var.h soon. Prepareglebius2013-10-263-0/+3
| | | | | | | | to this event, adding if_var.h to files that do need it. Also, include all includes that now are included due to implicit pollution via if_var.h Sponsored by: Netflix Sponsored by: Nginx, Inc.
* Give (*ext_free) an int return value allowing for very sophisticatedandre2013-08-252-7/+7
| | | | | | | | external mbuf buffer management capabilities in the future. For now only EXT_FREE_OK is defined with current legacy behavior. Sponsored by: The FreeBSD Foundation
* Replace kernel virtual address space allocation with vmem. This providesjeff2013-08-071-1/+1
| | | | | | | | | | | | | transparent layering and better fragmentation. - Normalize functions that allocate memory to use kmem_* - Those that allocate address space are named kva_* - Those that operate on maps are named kmap_* - Implement recursive allocation handling for kmem_arena in vmem. Reviewed by: alc Tested by: pho Sponsored by: EMC / Isilon Storage Division
* Use m_get/m_gethdr instead of compat macros.glebius2013-03-151-6/+2
| | | | Sponsored by: Nginx, Inc.
* Fix wrong assignment.delphij2013-03-011-1/+1
| | | | | | Submitted by: Sascha Wildner <saw online de> Obtained from: DragonFly rev 9568dd07a22a136e380e6c19a8ea188eb92976d5 MFC after: 2 weeks
* Mechanically substitute flags from historic mbuf allocator withglebius2012-12-051-3/+3
| | | | | | | | | malloc(9) flags within sys. Exceptions: - sys/contrib not touched - sys/mbuf.h edited manually
* Remove the support for using non-mpsafe filesystem modules.kib2012-10-221-10/+3
| | | | | | | | | | | | In particular, do not lock Giant conditionally when calling into the filesystem module, remove the VFS_LOCK_GIANT() and related macros. Stop handling buffers belonging to non-mpsafe filesystems. The VFS_VERSION is bumped to indicate the interface change which does not result in the interface signatures changes. Conducted and reviewed by: attilio Tested by: pho
* Make sure that each va_start has one and only one matching va_end,kevlo2012-05-291-0/+1
| | | | especially in error cases.
* Fix race condition in KfRaiseIrql().brucec2012-03-041-4/+6
| | | | | | | | | | After getting the current irql, if the kthread gets preempted and subsequently runs on a different CPU, the saved irql could be wrong. Also, correct the panic string. PR: kern/165630 Submitted by: Vladislav Movchan <vladislav.movchan at gmail.com>
* Fix found places where uio_resid is truncated to int.kib2012-02-211-1/+2
| | | | | | | | | Add the sysctl debug.iosize_max_clamp, enabled by default. Setting the sysctl to zero allows to perform the SSIZE_MAX-sized i/o requests from the usermode. Discussed with: bde, das (previous versions) MFC after: 1 month
* In sys/compat/ndis/subr_ntoskrnl.c, change the RtlFillMemory functiondim2011-12-301-4/+1
| | | | | | | | definition from K&R to ANSI, to avoid a clang warning about the uint8_t parameter being promoted to int, which is not compatible with the type declared in the earlier prototype. MFC after: 1 week
* Use the cprd_mem field when setting the start and length for a memorybrucec2011-02-231-2/+2
| | | | | | | | | resource - the layout of cprd_port is identical but using cprd_mem makes the code easier to understand. PR: kern/118493 Submitted by: Weongyo Jeong <weongyo.jeong at gmail.com> MFC after: 3 days
* Fix typos - remove duplicate "the".brucec2011-02-211-1/+1
| | | | | | PR: bin/154928 Submitted by: Eitan Adler <lists at eitanadler.com> MFC after: 3 days
* Fix a few more SYSCTL_PROC() that were missing a CTLFLAG type specifier.mdf2011-01-191-2/+3
|
* Merge amd64 and i386 bus.h and move the resulting header to x86. Replacetijl2010-12-201-7/+2
| | | | | | | | | the original amd64 and i386 headers with stubs. Rename (AMD64|I386)_BUS_SPACE_* to X86_BUS_SPACE_* everywhere. Reviewed by: imp (previous version), jhb Approved by: kib (mentor)
* Implement NdisGetRoutineAddress and MmGetSystemRoutineAddress used inbschmidt2010-12-065-0/+40
| | | | | | newer Ralink drivers. Submitted by: Paul B Mahol <onemda at gmail.com>
* Add a dummy for IoOpenDeviceRegistryKey().bschmidt2010-11-291-0/+10
| | | | | | | | With that change the Atheros 9xxx driver is actually usable and does not panic anymore. Submitted by: Paul B Mahol <onemda at gmail.com> MFC after: 2 weeks
* Some drivers rely on the existence of certain keys. The Atheros 9xxxbschmidt2010-11-291-0/+10
| | | | | | | | driver for example requests the NetCfgInstanceId but doesn't check the returned status code and will happily access random memory instead. Submitted by: Paul B Mahol <onemda at gmail.com> MFC after: 2 weeks
* Add prototype for InitializeSListHead().bschmidt2010-11-231-0/+1
|
* Add a few functions used in newer drivers. Fix RtlCompareMemory() whilebschmidt2010-11-233-6/+149
| | | | | | here. Submitted by: Paul B Mahol <onemda@gmail.com>
* Resurrect amd64 support.bschmidt2010-11-224-8/+95
| | | | | | | | | | | | - Many drivers on amd64 are picking system uptime, interrupt time and ticks via global data structure instead of calling functions for performance reasons. For now just patch such address so driver will not trigger page fault when trying to access such data. In future, additional callout may be added to update data in periodic intervals. - On amd64 we need to allocate "shadow space" on stack before calling any function. Submitted by: Paul B Mahol <onemda at gmail.com>
* Prefer pmap_extract() over pmap_kextract() as done in MmIsAddressValid().bschmidt2010-11-221-1/+7
| | | | | | | According to the comment for MmIsAddressValid() there are issues on PAE kernels using pmap_kextract(). Submitted by: Paul B Mahol <onemda at gmail.com>
* Fix a panic on i386 for drivers using MmAllocateContiguousMemory()bschmidt2010-11-171-2/+2
| | | | | | | | | | | | and MmAllocateContiguousMemorySpecifyCache(). Those two functions take 64-bit variable(s) for their arguments. On i386 that takes additional 32-bit variable per argument. This is required so that windrv_wrap() can correctly wrap function that miniport driver calls with stdcall convention. Similar explanation is provided in subr_ndis.c for other functions. Submitted by: Paul B Mahol <onemda at gmail.com>
* Use kmem_alloc_contig() to honour the cache_type variable.bschmidt2010-11-172-6/+41
| | | | Pointed out by: alc
* According to specs for MmAllocateContiguousMemorySpecifyCache() physicallybschmidt2010-11-111-6/+3
| | | | | | contiguous memory with requested restrictions must be allocated. Submitted by: Paul B Mahol <onemda at gmail.com>
* Remove 4.x, 5.x and 6.x compatibility bits.bschmidt2010-11-043-68/+0
| | | | Submitted by: Paul B Mahol <onemda at gmail.com>
* Use the printf-like capability from kproc_create().thompsa2010-10-051-8/+3
| | | | Submitted by: Paul B Mahol
* ANSIfy prototypes in subr_usbd.c.ed2010-06-121-72/+29
| | | | | | | | | | | | | | | | | | | Clang generates the following warnings when building subr_usbd.c: | subr_usbd.c:598:13: warning: promoted type 'int' of K&R function | parameter is not compatible with the parameter type 'uint8_t' (aka | 'unsigned char') declared in a previous prototype | subr_usbd.c:627:13: warning: promoted type 'int' of K&R function | parameter is not compatible with the parameter type 'uint8_t' (aka | 'unsigned char') declared in a previous prototype | subr_usbd.c:649:13: warning: promoted type 'int' of K&R function | parameter is not compatible with the parameter type 'uint8_t' (aka | 'unsigned char') declared in a previous prototype Instead of just ANSIfying these three prototypes, do it for the entire file. Spotted by: clang
* Revert a functional change that snuck in.rpaulo2009-11-021-1/+1
|
* Fix a non-style change that snuck in.rpaulo2009-11-021-1/+1
| | | | Spotted by: danfe
* Big style cleanup. While there remove references to FreeBSD versionsrpaulo2009-11-027-682/+360
| | | | | | older than 6.0. Submitted by: Paul B Mahol <onemda at gmail.com>
* provides a extra write buffer when the NDIS driver want to send aweongyo2009-06-261-2/+3
| | | | | | request whose body has some datas through the default pipe. Tested by: Nikos Vassiliadis <nvass9573 at gmx.com>
* Fix a typeo in the frame len function to unbreak the build, make it shorterthompsa2009-06-231-1/+1
| | | | while I am here.
OpenPOWER on IntegriCloud