aboutsummaryrefslogtreecommitdiff
path: root/sys/compat/ndis
Commit message (Collapse)AuthorAgeFilesLines
* ndis(4): remove as previous announcedBrooks Davis2021-01-2516-17950/+0
| | | | | | | | | | | | | | nids(4) was a clever idea in the early 2000's when the market was flooded with 10/100 NICs with Windows-only drivers, but that hasn't been the case for ages and the driver has had no meaningful maintenance in ages. It only supports Windows-XP era drivers. Also remove: - ndis support from wpa_supplicant - ndiscvt(8) Reviewed By: emaste, bcr (manpages) Differential Revision: https://reviews.freebsd.org/D27609
* compat: clean up empty lines in .c and .h filesMateusz Guzik2020-09-019-26/+1
| | | | Notes: svn path=/head/; revision=365080
* Mark more nodes as CTLFLAG_MPSAFE or CTLFLAG_NEEDGIANT (17 of many)Pawel Biernacki2020-02-261-2/+3
| | | | | | | | | | | | | | | | | | | r357614 added CTLFLAG_NEEDGIANT to make it easier to find nodes that are still not MPSAFE (or already are but aren’t properly marked). Use it in preparation for a general review of all nodes. This is non-functional change that adds annotations to SYSCTL_NODE and SYSCTL_PROC nodes using one of the soon-to-be-required flags. Mark all obvious cases as MPSAFE. All entries that haven't been marked as MPSAFE before are by default marked as NEEDGIANT Approved by: kib (mentor, blanket) Commented by: kib, gallatin, melifaro Differential Revision: https://reviews.freebsd.org/D23718 Notes: svn path=/head/; revision=358333
* Remove comment that no longer describe reality.Gleb Smirnoff2020-01-221-13/+0
| | | | Notes: svn path=/head/; revision=356972
* vfs: drop the mostly unused flags argument from VOP_UNLOCKMateusz Guzik2020-01-031-1/+1
| | | | | | | | | | | Filesystems which want to use it in limited capacity can employ the VOP_UNLOCK_FLAGS macro. Reviewed by: kib (previous version) Differential Revision: https://reviews.freebsd.org/D21427 Notes: svn path=/head/; revision=356337
* random(9): Deprecate random(9), remove meaningless srandom(9)Conrad Meyer2019-12-261-3/+1
| | | | | | | | | | | | | | | | | | | | | | | | srandom(9) is meaningless on SMP systems or any system with, say, interrupts. One could never rely on random(9) to produce a reproducible sequence of outputs on the basis of a specific srandom() seed because the global state was shared by all kernel contexts. As such, removing it is literally indistinguishable to random(9) consumers (as compared with retaining it). Mark random(9) as deprecated and slated for quick removal. This is not to say we intend to remove all fast, non-cryptographic PRNG(s) in the kernel. It/they just won't be random(9), as it exists today, in either name or implementation. Before random(9) is removed, a replacement will be provided and in-tree consumers will be converted. Note that despite the name, the random(9) interface does not bear any resemblance to random(3). Instead, it is the same crummy 1988 Park-Miller LCG used in libc rand(3). Notes: svn path=/head/; revision=356097
* Fix compilation with 'option NDISAPI + device ndis' andAndriy Voskoboinyk2019-01-301-2/+0
| | | | | | | | | | | without 'device pccard' in the kernel config file. PR: 171532 Reported by: Robert Bonomi <bonomi@host128.r-bonomi.com> MFC after: 1 week Notes: svn path=/head/; revision=343574
* [ndis] Fix unregistered use of FPU by NDIS in kernel on amd64Oleksandr Tymoshenko2019-01-222-6/+195
| | | | | | | | | | | | | | | | | | amd64 miniport drivers are allowed to use FPU which triggers "Unregistered use of FPU in kernel" panic. Wrap all variants of MSCALL with fpu_kern_enter/fpu_kern_leave. To reduce amount of allocations/deallocations done via fpu_kern_alloc_ctx/fpu_kern_free_ctx maintain cache of fpu_kern_ctx elements. Based on the patch by Paul B Mahol PR: 165622 Submitted by: Vlad Movchan <vladislav.movchan@gmail.com> MFC after: 1 month Notes: svn path=/head/; revision=343298
* Eliminate kmem_alloc_contig()'s unused arena parameter.Alan Cox2018-08-201-2/+2
| | | | | | | | | Reviewed by: hselasky, kib, markj Discussed with: jeff Differential Revision: https://reviews.freebsd.org/D16799 Notes: svn path=/head/; revision=338107
* Fix build of ndis with base gcc on i386Dimitry Andric2018-06-171-1/+1
| | | | | | | | | | | | | | Casting from rman_res_t to a pointer results in "cast to pointer from integer of different size" warnings with base gcc on i386, so use an intermediate cast to uintptr_t to suppress it. In this case, the I/O port range is effectively limited to the range of 0..65535. Reviewed by: imp MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D15746 Notes: svn path=/head/; revision=335297
* Revert r327828, r327949, r327953, r328016-r328026, r328041:Pedro F. Giffuni2018-01-211-1/+1
| | | | | | | | | | | | | | | | | | Uses of mallocarray(9). The use of mallocarray(9) has rocketed the required swap to build FreeBSD. This is likely caused by the allocation size attributes which put extra pressure on the compiler. Given that most of these checks are superfluous we have to choose better where to use mallocarray(9). We still have more uses of mallocarray(9) but hopefully this is enough to bring swap usage to a reasonable level. Reported by: wosch PR: 225197 Notes: svn path=/head/; revision=328218
* ndis: make some use of mallocarray(9).Pedro F. Giffuni2018-01-151-1/+1
| | | | | | | | | | | | | | | | Focus on code where we are doing multiplications within malloc(9). None of these ire likely to overflow, however the change is still useful as some static checkers can benefit from the allocation attributes we use for mallocarray. This initial sweep only covers malloc(9) calls with M_NOWAIT. No good reason but I started doing the changes before r327796 and at that time it was convenient to make sure the sorrounding code could handle NULL values. X-Differential revision: https://reviews.freebsd.org/D13837 Notes: svn path=/head/; revision=328019
* spdx: initial adoption of licensing ID tags.Pedro F. Giffuni2017-11-1814-0/+28
| | | | | | | | | | | | | | | | | | | | The Software Package Data Exchange (SPDX) group provides a specification to make it easier for automated tools to detect and summarize well known opensource licenses. We are gradually adopting the specification, noting that the tags are considered only advisory and do not, in any way, superceed or replace the license texts. Special thanks to Wind River for providing access to "The Duke of Highlander" tool: an older (2014) run over FreeBSD tree was useful as a starting point. Initially, only tag files that use BSD 4-Clause "Original" license. RelNotes: yes Differential Revision: https://reviews.freebsd.org/D13133 Notes: svn path=/head/; revision=325966
* Shorten list of arguments to mbuf external storage freeing function.Gleb Smirnoff2017-10-092-9/+12
| | | | | | | | | | | | | | | | | | | | All of these arguments are stored in m_ext, so there is no reason to pass them in the argument list. Not all functions need the second argument, some don't even need the first one. The second argument lives in next cache line, so not dereferencing it is a performance gain. This was discovered in sendfile(2), which will be covered by next commits. The second goal of this commit is to bring even more flexibility to m_ext mbufs, allowing to create more fields in m_ext, opaque to the generic mbuf code, and potentially set and dereferenced by subsystems. Reviewed by: gallatin, kbowling Differential Revision: https://reviews.freebsd.org/D12615 Notes: svn path=/head/; revision=324446
* Fix regression in ndis(4) after r286410. This adds a bunch of checks forGleb Smirnoff2017-05-222-11/+19
| | | | | | | | | | | whether this is a Ethernet or 802.11 device and does proper dereferencing. PR: 213237 Submitted by: <ota j.email.ne.jp> MFC after: 2 weeks Notes: svn path=/head/; revision=318677
* ndis(4): Undo unneeded workarounds in ndis' rand().Pedro F. Giffuni2016-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 Notes: svn path=/head/; revision=300422
* ndis(4): adjustments for our random() specific implementation.Pedro F. Giffuni2016-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 Notes: svn path=/head/; revision=300384
* ndis(4): Avoid overflow.Pedro F. Giffuni2016-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 Notes: svn path=/head/; revision=300377
* ndis(4): Better mimic the behavior of rand() on Windows.Pedro F. Giffuni2016-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 Notes: svn path=/head/; revision=300376
* ndis: spelling fixes in comments.Pedro F. Giffuni2016-04-306-10/+10
| | | | | | | No functional change. Notes: svn path=/head/; revision=298828
* ndis(4): it's rather unrealistic to expect a size_t here.Pedro F. Giffuni2016-04-281-1/+1
| | | | | | | int was actually OK, and u_int is more than enough. Notes: svn path=/head/; revision=298734
* ndis(4): unsign some indexes to prevent overflows.Pedro F. Giffuni2016-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 Notes: svn path=/head/; revision=298731
* sys: extend use of the howmany() macro when available.Pedro F. Giffuni2016-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. Notes: svn path=/head/; revision=298649
* Use uintmax_t (typedef'd to rman_res_t type) for rman ranges.Justin Hibbits2016-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 Notes: svn path=/head/; revision=297000
* Rename P_KTHREAD struct proc p_flag to P_KPROC.Konstantin Belousov2016-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 Notes: svn path=/head/; revision=295435
* Create a dedicated function for ensuring that cdir and rdir are populated.Mateusz Guzik2015-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 Notes: svn path=/head/; revision=285391
* CALLOUT_MPSAFE has lost its meaning since r141428, i.e., for more than tenJung-uk Kim2015-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 Notes: svn path=/head/; revision=283291
* Fix multiple incorrect SYSCTL arguments in the kernel:Hans Petter Selasky2014-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 Notes: svn path=/head/; revision=273377
* All mbuf external free functions never fail, so let them be void.Gleb Smirnoff2014-07-112-6/+4
| | | | | | | Sponsored by: Nginx, Inc. Notes: svn path=/head/; revision=268529
* Remove ia64.Marcel Moolenaar2014-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 Notes: svn path=/head/; revision=268351
* Include necessary headers that now are available due to pollutionGleb Smirnoff2013-10-281-0/+1
| | | | | | | | | | via if_var.h. Sponsored by: Netflix Sponsored by: Nginx, Inc. Notes: svn path=/head/; revision=257241
* The r48589 promised to remove implicit inclusion of if_var.h soon. PrepareGleb Smirnoff2013-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. Notes: svn path=/head/; revision=257176
* Give (*ext_free) an int return value allowing for very sophisticatedAndre Oppermann2013-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 Notes: svn path=/head/; revision=254842
* Replace kernel virtual address space allocation with vmem. This providesJeff Roberson2013-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 Notes: svn path=/head/; revision=254025
* Use m_get/m_gethdr instead of compat macros.Gleb Smirnoff2013-03-151-6/+2
| | | | | | | Sponsored by: Nginx, Inc. Notes: svn path=/head/; revision=248324
* Fix wrong assignment.Xin LI2013-03-011-1/+1
| | | | | | | | | Submitted by: Sascha Wildner <saw online de> Obtained from: DragonFly rev 9568dd07a22a136e380e6c19a8ea188eb92976d5 MFC after: 2 weeks Notes: svn path=/head/; revision=247595
* Mechanically substitute flags from historic mbuf allocator withGleb Smirnoff2012-12-051-3/+3
| | | | | | | | | | | | malloc(9) flags within sys. Exceptions: - sys/contrib not touched - sys/mbuf.h edited manually Notes: svn path=/head/; revision=243882
* Remove the support for using non-mpsafe filesystem modules.Konstantin Belousov2012-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 Notes: svn path=/head/; revision=241896
* Make sure that each va_start has one and only one matching va_end,Kevin Lo2012-05-291-0/+1
| | | | | | | especially in error cases. Notes: svn path=/head/; revision=236213
* Fix race condition in KfRaiseIrql().Rebecca Cran2012-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> Notes: svn path=/head/; revision=232509
* Fix found places where uio_resid is truncated to int.Konstantin Belousov2012-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 Notes: svn path=/head/; revision=231949
* In sys/compat/ndis/subr_ntoskrnl.c, change the RtlFillMemory functionDimitry Andric2011-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 Notes: svn path=/head/; revision=229004
* Use the cprd_mem field when setting the start and length for a memoryRebecca Cran2011-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 Notes: svn path=/head/; revision=218985
* Fix typos - remove duplicate "the".Rebecca Cran2011-02-211-1/+1
| | | | | | | | | PR: bin/154928 Submitted by: Eitan Adler <lists at eitanadler.com> MFC after: 3 days Notes: svn path=/head/; revision=218909
* Fix a few more SYSCTL_PROC() that were missing a CTLFLAG type specifier.Matthew D Fleming2011-01-191-2/+3
| | | | Notes: svn path=/head/; revision=217566
* Merge amd64 and i386 bus.h and move the resulting header to x86. ReplaceTijl Coosemans2010-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) Notes: svn path=/head/; revision=216592
* Implement NdisGetRoutineAddress and MmGetSystemRoutineAddress used inBernhard Schmidt2010-12-065-0/+40
| | | | | | | | | newer Ralink drivers. Submitted by: Paul B Mahol <onemda at gmail.com> Notes: svn path=/head/; revision=216242
* Add a dummy for IoOpenDeviceRegistryKey().Bernhard Schmidt2010-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 Notes: svn path=/head/; revision=216050
* Some drivers rely on the existence of certain keys. The Atheros 9xxxBernhard Schmidt2010-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 Notes: svn path=/head/; revision=216049
* Add prototype for InitializeSListHead().Bernhard Schmidt2010-11-231-0/+1
| | | | Notes: svn path=/head/; revision=215782