For consistency rename LKPI_SCAN_RUNNING adding a LHW_ prefix.
Add a local flag LKPI_LHW_SCAN_HW mirroring the net80211
IEEE80211_FEXT_SCAN_OFFLOAD flag.
Slightly simplify the code.
Overload (*ic_scan_curchan) and (*ic_scan_mindwell) so that we can
call the net80211 implementation in case of software scan but skip it
in case of full-offload scans.
Also add a bandaid to our (*ic_set_channel) implementation to not siwtch
channels if we have an active hw_scan running.
Obtained from: bz/wireless-dev
Sponsored by: The FreeBSD Foundation (partially)
MFC after: 4 days
Implement the mac80211 (*get_antenna) call and after checking any
antenna information present query the current configuration on startup
(both informations should be identical at this point in theory).
Both the wiphy variables and function call report a bitmask not a count.
Count the bits for net80211 for as long as we get away with just a
number in ic_[rt]xstream.
Sponsored by: The FreeBSD Foundation
MFC after: 4 days
Rename TRY_HW_CRYPTO to LKPI_80211_HW_CRYPTO for consitency and make
it compileable again in case someone wants to sit down and make it
work. It's probably not too much to do. Otherwise I might eventually
get around to it.
Obtained from: bz/wireless-dev
Sponsored by: The FreeBSD Foundation
MFC after: 4 days
Going through the Frame (Sub)types the "QOS Data" being called "QOS"
scheme leads to a naming conflict for QOS_CFPOLL and QOS_CFACKPOLL
(if added). Rename QOS* to QOS_DATA* to avoid the conflict and
to also better match the standards name.
No functional changes intended.
Sponsored by: The FreeBSD Foundation
MFC after: 5 days
Reviewed by: hselasky
Differential Revision: https://reviews.freebsd.org/D36409
Enabling other driver code found that the bssid in
struct ieee80211_bss_conf is not an array but expected to be
a const pointer (const, != NULL checks).
Adjust accordingly in the header and in the LinuxKPI compat code.
There initialization now needs to be a static array always present
as we need a value before we will have a BSS (node in scan_to_auth)
as the mac80211 driver (*handlers) are expecting the pointer to be
not NULL (copying without checks).
This is a pre-req to enable d3 (CONFIG_PM[_SLEEP]) in the future.
Tested by: Tomoaki AOKI (junchoon dec.sakura.ne.jp)
Tested by: Berislav Purgar (bpurgar gmail.com)
Sponsored by: The FreeBSD Foundation
MFC after: 3 days
When a freebsd32 caller uses all or most allowed space for control
messages (MCLBYTES == 2K) then the message may no longer fit when
the messages are padded for 64-bit alignment. Historically we've just
shrugged and said there is no ABI guarantee. We ran into this on
CheriBSD where a capsicumized 64-bit nm would fail when called with more
than 64 files.
Fix this by not gratutiously capping size of mbuf data we'll allocate
to MCLBYTES and let m_get2 allocate up to MJUMPAGESIZE (4K or larger).
Instead of hard-coding a length check, let m_get2 do it and check for a
NULL return.
Reviewed by: markj, jhb, emaste
Sponsored by: DARPA, AFRL
Differential Revision: https://reviews.freebsd.org/D36322
This is a joint work with manu.
- fixed conditions in do_i2c_transfer and i2c_transfer as linux_i2cbb
does not set adapter->algo->master_xfer but does set
adapter->algo_data;
- fixed parent bus specification for linux_i2cbb driver module;
- actually implemented iicbb_transfer method;
- added iicbb_pre_xfer and iicbb_post_xfer methods;
- removed unnecessary and harmful delays (and other extra logic) from
iicbb methods as iicbb driver already has them;
- added setting of iicbb speed based on algo_data->udelay, so that iicbb
uses correct delays;
PR: 265920
Fixes: 1961a14a47 linuxkpi: Add i2c support
MFC after: 2 weeks
Sponsored by: Beckhoff Automation GmbH & Co. KG (manu's work)
RB_ROTATE_LEFT (and it symmetric twin) modify the rb-tree, adjusting
pointers so that what started as a proper tree ends up a proper
tree. When two consecutive rotations move the same node up the tree,
some of the pointers changed in the first rotation are immediately
changed again in the second - namely, the pointer from the rising node
to its new parent, and the pointer from that parent back to the rising
node. This change removes from RB_ROTATE macros the responsibility for
managing those two pointers, and leaves it to the code that calls for
rotations to fix up those pointers afterward. That drops a comparison
and a pair of assignments from every INSERT_COLOR or REMOVE_COLOR call
that ends in a double rotation.
A side-effect of this change is that the SWAP_CHILD macro must take as
a parameter a pointer to the node that is changing children, where it
is now computed from the old child. Since this macro is called in a
couple of places besides the RB_ROTATE macros, those calls are also
affected.
Reviewed by: alc
MFC after: 3 weeks
Differential Revision: https://reviews.freebsd.org/D36266
Linux is using 7 bit addressing while FreeBSD uses 8 bit addresses
internally, but i2c(8) uses 7 bit address.
This confused me when originally doing the code and I thought that
0x50 was the 8bit EDID address while it's the 7bit address and since
I did all my testing using this I didn't noticed the problem.
Reported by: avg
PR: 265920 (somewhat)
Rather than defining the same values in two places and having to do
conflict resulution on the name in LKPI, change the defines to an
enum in net80211. In addition to de-duplication this also gives us
value checks in certain cases.
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Reviewed by: adrian
Differential Revision: https://reviews.freebsd.org/D36250
Both are needed by drm-kmod
Obtained from: drm-kmod
Sponsored by: Beckhoff Automation GmbH & Co. KG
Differential Revision: //reviews.freebsd.org/D36212
Those are needed and also included in linux (via polution).
Reviewed by: bz
Sponsored by: Beckhoff Automation GmbH & Co. KG
Differential Revision: https://reviews.freebsd.org/D36111
All those are needed for drm-kmod.
Add them to base in another directory that will be append in the CFLAGS.
Reviewed by: bz
Sponsored by: Beckhoff Automation GmbH & Co. KG
Differential Revision: https://reviews.freebsd.org/D36110
Add needed includes so we can use it.
Reviewed by: bz
Fixes: c3f4f28c63 ("linuxkpi: Add some basic swap functions")
Sponsored by: Beckhoff Automation GmbH & Co. KG
Differential Revision: https://reviews.freebsd.org/D36109
Also fill the boot_cpu_data struct as drm needs it.
Reviewed by: bz
Obtained from: drm-kmod
Sponsored by: Beckhoff Automation GmbH & Co. KG
Differential Revision: https://reviews.freebsd.org/D36107
In Linux this takes a refcount_t argument but in linuxkpi struct kref
uses an atomic_t for the refcount and code in drm directly uses this
function with a kref so use an atomic_t here.
Reviewed by: bz
Sponsored by: Beckhoff Automation GmbH & Co. KG
Differential Revision: https://reviews.freebsd.org/D36099
o Assert that every protosw has pr_attach. Now this structure is
only for socket protocols declarations and nothing else.
o Merge struct pr_usrreqs into struct protosw. This was suggested
in 1996 by wollman@ (see 7b187005d1), and later reiterated
in 2006 by rwatson@ (see 6fbb9cf860).
o Make struct domain hold a variable sized array of protosw pointers.
For most protocols these pointers are initialized statically.
Those domains that may have loadable protocols have spacers. IPv4
and IPv6 have 8 spacers each (andre@ dff3237ee5).
o For inetsw and inet6sw leave a comment noting that many protosw
entries very likely are dead code.
o Refactor pf_proto_[un]register() into protosw_[un]register().
o Isolate pr_*_notsupp() methods into uipc_domain.c
Reviewed by: melifaro
Differential revision: https://reviews.freebsd.org/D36232
Resulting sbuf_len() from proc_getargv() might return 0 if user mangled
ps_strings enough. Also, sbuf_len() API contract is to return -1 if the
buffer overflowed. The later should not occur because get_ps_strings()
checks for catenated length, but check for this subtle detail explicitly
as well to be more resilent.
The end result is that p_comm is used in this situations.
Approved by: so
Security: FreeBSD-SA-22:09.elf
Reported by: Josef 'Jeff' Sipek <jeffpc@josefsipek.net>
Reviewed by: delphij, markj
admbugs: 988
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D35391
Other arches like powerpc* needs it.
Fixes: d387a1b4b1 ("linuxkpi: io.h: Do not include asm/set_memory.h for armv6 and armv7")
Fixes: 789dbdbb48 ("linuxkpi: Add arch_io_{reserve,free}_memtype_wc")
Sponsored by: Beckhoff Automation GmbH & Co. KG
They do not have the same pmap api and this cannot work for those arch.
Fixes: 789dbdbb48 ("linuxkpi: Add arch_io_{reserve,free}_memtype_wc")
Sponsored by: Beckhoff Automation GmbH & Co. KG
By calling the function too early we might still have the td_pflags
value cached from the previous struct thread use. cpu_copy_thread()
depends on correct value for TDP_KTHREAD at least on x86.
Reported, bisected, and tested by: pho
Reviewed by: markj
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D36069
Linux does the same.
Reviewed by: bz, emaste, hselasky
Sponsored by: Beckhoff Automation GmbH & Co. KG
Differential Revision: https://reviews.freebsd.org/D36023
out* arguments are different on Linux and the i915 driver uses them.
Sponsored by: Beckhoff Automation GmbH & Co. KG
Differential Revision: https://reviews.freebsd.org/D35942