aboutsummaryrefslogtreecommitdiff
path: root/sys/compat
Commit message (Collapse)AuthorAgeFilesLines
* LinuxKPI: 802.11: improve lkpi_ic_vap_delete()Bjoern A. Zeeb47 hours1-1/+5
| | | | | | | | | | | | | | | Changing the order of cleanup in lkpi_ic_vap_delete() will avoid firmware crashes or a direct panic as observed as ieee80211_vap_detach() will do most cleanup for us and get us into the correct state. The solution is not fully developed yet and one may not be able to create a new vap (lkpi_ic_vap_create may fail with error 17) afterwards. It is supposed to be a step towards more stability for now. Sponsored by: The FreeBSD Foundation MFC after: 3 days PR: 269842
* LinuxKPI: 802.11: fix problem removing staBjoern A. Zeeb2 days1-19/+18
| | | | | | | | | | | | | | | | | | | | | | Move the call to lkpi_disassoc() before the state change to IEEE80211_STA_NOTEXIST which will remove the sta (from firmware). Based on a comment it seems that originally we had to do it the other way round. iwlwifi(4) has a check and will silently not remove the sta from the firmware when vif->cfg.assoc is still set (see iwl_mvm_sta_del()). This leads to the LinuxKPI 802.11 code thinking the sta is gone as downward state changes by the mac80211 op (*sta_state)() may not fail. Once we try to assoc with a newly added station later, iwlwifi firmware will run into an assert having two ap_sta set on the same vif. We can observe that problem in iwlwifi(4) having __le32 sta_id = 1 instead of sta_id = 0 in iwl_mvm_sta_cfg_cmd{} on the HCMD. This should fix one of the most seen problems with iwlwifi(4), e.g., when running service netif restart wlan0 or service wpa_supplicant restart wlan0. Sponsored by: The FreeBSD Foundation MFC after: 3 days
* LinuxKPI: 802.11: fill regulatory_hint() with some lifeBjoern A. Zeeb7 days2-2/+28
| | | | | | | | | | Start implementing regulatory_hint() using a .c file based allocation helper function so we could change structures in the future with better chances to keep compatibility. This sets wiphy->regd needed by various LinuxKPI based WiFi drivers. Sponsored by: The FreeBSD Foundation MFC after: 3 days
* LiunxKPI: 802.11: move ieee80211_chanctx_conf into lkpi private structBjoern A. Zeeb7 days3-6/+57
| | | | | | | | | | | Factor out ieee80211_chanctx_conf into struct lkpi_chanctx in order to keep local state as well. In first instance that is added_to_drv only. For now we stay single-chanctx only but this paves the path to make it a list. Use the new information to implement ieee80211_iter_chan_contexts_atomic(). Sponsored by: The FreeBSD Foundation MFC after: 3 days
* LinuxKPI: 802.11: avoid symbol clash on UP to AC mappingBjoern A. Zeeb7 days1-3/+4
| | | | | | | | | | | tid_to_mac80211_ac is an exported symbol in and likely based on iwlwifi, which leads to a symbol clash in NetBSD. Rename our local LinuxKPI copy to a better name and add a comment where to find a copy of the mapping table. Sponsored by: The FreeBSD Foundation MFC after: 3 days Reported by: Phil Nelson (phil netbsd org)
* linux(4): Update syscalls.master to 6.5Dmitry Chagin7 days1-7/+28
| | | | MFC after: 1 week
* LinuxKPI: 802.11: setup a default link[0] and adjust related needsBjoern A. Zeeb11 days1-22/+41
| | | | | | | | | | | | | | | Setup more link_conf/deflink fields for vif/sta as are needed to allow us to work with the KPI bits in a non-MLO configuration. In lkpi_sta_scan_to_auth() set the bss_conf values before calling into the driver for chanctx setup/updates as certain values (e.g., beacon_int) need to be set before; we still call the MO function for the updates after to keep the expected workflow. Deal with the (to be dealt with otherwise later) net80211 ni swaps and update the addresses on the deflink as well as otherwise firmware will hit asserts or things will not work (e.g. indicating the peer is us). Sponsored by: The FreeBSD Foundation MFC after: 3 days
* LinuxKPI: 802.11: inialize tx queue paramsBjoern A. Zeeb11 days1-1/+20
| | | | | | | | | | | | When adding a VAP (vif) initialize its tx queue parameters calling mo_conf_tx(). I could not spot net80211 providing some of the values needed before having a node so currrently we use hard-coded values with a comment with a reference on how to properly calculate the values in the future (e.g., in case of 11b or other cases). Sponsored by: The FreeBSD Foundation MFC after: 3 days
* LinuxKPI: 802.11: change ic_parent() to not call mo_stop()/mo_start()Bjoern A. Zeeb11 days1-0/+8
| | | | | | | | | | | | | Driven by net80211 we may call mac80211 ops stop() and start() mostly when toggling a first VAP. While this is FreeBSD behaviour the firmware based LinuxKPI drivers seem to possibly clear state in the case of stop() triggering further errors down the line. We call mo_start() when starting the VAP and mo_stop() when destroying it now only. In the future (e.g., in multi-VAP setups) we may need to re-address some of this so keep the code under #ifdef. Sponsored by: The FreeBSD Foundation MFC after: 3 days
* LinuxKPI: 802.11: adjust code to new structure layoutBjoern A. Zeeb11 days2-29/+24
| | | | | | | | | | With past commits new structures were added. Now switch over some bss_conf fields into vif->cfg where they got moved to and remove the old fields. This allows drivers to find the expected values in the now expected places and work better. Sponsored by: The FreeBSD Foundation MFC after: 3 days
* LinuxKPI: 802.11: mac80211 ops: distinguish between {bss,link}_info_changedBjoern A. Zeeb11 days1-3/+6
| | | | | | | | | | | With MLO and multi-link setups if avail we want to call link_info_changed whereas for legacy drivers we still need to call bss_info_changed. While we currently do not (yet) support multi-link configurations we still need to drive the correct commands to satisfy firmware requirements. Sponsored by: The FreeBSD Foundation MFC after: 3 days
* LinuxKPI: 802.11: pass non-0/NULL arguments to MO functionsBjoern A. Zeeb11 days3-17/+21
| | | | | | | | | | | | | | | In [1] we updated the KPI for various mac80211 ops functions to deal with MLD code. Newer iwlwifi driver and firmware supports these functions so we need to pass non-dummy (0, NULL) arguments to them. Start extending the internel MO functions by these arguments and pass down values from LinuxKPI 802.11 code. It is assumed that further work will be needed to have all the right fields available to at least work in the lgeacy way of a single link. Sponsored by: The FreeBSD Foundation Improves: 549198b1ab95 (update mac80211 KPI) [1] MFC after: 3 days
* LinuxKPI: 802.11: prepare for iwlwifi driver updatesBjoern A. Zeeb11 days1-15/+1
| | | | | | | | | Unconditionally enable the changes for newer drivers, as needed by iwlwifi (and others). Sposnored by: The FreeBSD Foundation MFC after: 3 days X-Note: breaks build until iwlwifi update (next hash)
* linux(4): On Linux SIGKILL can not be reset to defaultDmitry Chagin14 days1-1/+4
| | | | MFC after: 1 week
* linux(4): Staticize lsiginfo_to_siginfoDmitry Chagin14 days2-4/+2
| | | | | | | It's not used outside of linux_signal.c While here fix the indentation. MFC after: 1 week
* LinuxKPI: 802.11: fix counting the number of supbandsBjoern A. Zeeb2023-09-141-2/+5
| | | | | | | | | | | | | | While the main purpose was to assign an(y) early chandef with the loop, later additions made use of it to also count supbands as well as to initialise max_rates. Due to the main goal we can exit the loop early and not properly count and initialise supbands and max_rates. Move the terminating condition into the loop and make it a continue rather than ending the loop. Fixes: d9945d7821b9b ("improve hw_scan") Sponsored by: The FreeBSD Foundation MFC after: 3 days
* LinuxKPI: 802.11: make sure bssid for scans (probe_req) is setBjoern A. Zeeb2023-09-141-0/+1
| | | | | | | | | | | | In b0f73768220e9 we added bssid[] to struct cfg80211_scan_request likely while working on mt76 and did not need it (yet) back then. iwlwifi started to use the field in Linux f1fec51cda70f (April 2023). Without it set firmware crashes when trying to send probe requests ((empty) SSID also given to hw_scan). For now always set the field to the wildcard BSSID. Sponsored by: The FreeBSD Foundation MFC after: 3 days
* LinuxKPI: skbuff: remove assumption about mac_headerBjoern A. Zeeb2023-09-111-2/+1
| | | | | | | | It seems the mac_header can be set to offset 0 for frames received. Remove the warning splattering messages to the console for each packet. Sponsored by: The FreeBSD Foundation MFC after: 3 days
* kern: Globally define abs64Emmanuel Vadot2023-09-081-6/+0
| | | | | | | | So we can use it in non-linuxkpi sources. Reviewed by: emaste, mmel Differential Revision: https://reviews.freebsd.org/D41767 Sponsored by: Beckhoff Automation GmbH & Co. KG
* linuxkpi: fix iteration in __sg_alloc_table_from_pagesAustin Shafer2023-09-061-4/+10
| | | | | | | | | | | | | | | Commit 3f686532c9b4 tried to fix an issue with not properly starting at the first page in the sg list to prevent a panic. This worked but with the side effect of incrementing "s" during the final iteration causing it to be NULL since the list had ended. In cases non-DEBUG kernels this causes a panic with drm-5.15, since "s" is NULL when we later pass it to sg_mark_end(). This change decouples the iteration sg from the return value so that it is never incremented past the final page in the chain. MFC after: 3 days Reviewed by: manu Differential Revision: https://reviews.freebsd.org/D41574
* timerfd: Relocate 32-bit compat codeJake Freeland2023-09-051-0/+55
| | | | | | | | | | | 32-bit compatibility code is conventionally stored in sys/compat/freebsd32. Move freebsd32_timerfd_gettime() and freebsd32_timerfd_settime() from sys/kern/sys_timerfd.c to sys/compat/freebsd32/freebsd32_misc.c. MFC After: 3 days Reviewed by: imp, markj Differential Revision; https://reviews.freebsd.org/D41640
* iwlwifi/LinuxKPI: 802.11: update ieee80211_request_smps()Bjoern A. Zeeb2023-09-051-11/+2
| | | | | | | | | | | | Update ieee80211_request_smps() to the new number of arguments in LinuxKPI (which was already prepared) and update the one call in the older iwlwifi driver version. This will allow iwlwifi as-is now and rtw88 to compile in case someone else wants to work on the latter in parallel to predominant efforts on the former. Sponsored by: The FreeBSD Foundation MFC after: 20 days
* linux(4): Deduplicate mmap2Dmitry Chagin2023-09-051-0/+17
| | | | | | | To help porting the Linux emulation layer to a new platforms start using Linux names for conditional builds instead of architecture-specific ifdefs. MFC after: 1 week
* linux(4): Deduplicate mprotect, madviseDmitry Chagin2023-09-051-0/+17
| | | | MFC after: 1 week
* linux(4): Convert flags in timerfd_createVico Chen2023-09-052-2/+10
| | | | | | | | | | | The timerfd is introduced in FreeBSD 14, and the Linux ABI timerfd is also moved to FreeBSD native timerfd, but it can't work well as Linux TFD_CLOEXEC and TFD_NONBLOCK haven't been converted to FreeBSD TFD_CLOEXEC and TFD_NONBLOCK. Reviewed by: dchagin, jfree Differential revision: https://reviews.freebsd.org/D41708 MFC after: 1 week
* linux(4): Return ENOTSUP from listxattr instead of EPERMDmitry Chagin2023-09-051-0/+2
| | | | | | | | | | | | | | | | | FreeBSD does not permits manipulating extended attributes in the system namespace by unprivileged accounts, even if account has appropriate privileges to access filesystem object. In Linux the system namespace is used to preserve posix acls. Some Gnu coreutils binaries uses posix acls, eg, install, ls, cp. And fails if we unexpectedly return EPERM error from xattr system calls. In the other hands, in Linux read and write access to the system namespace depend on the policy implemented for each filesystem, so we'll mimics we're a filesystem that prohibits this for unpriveleged accounts. Reported by: zirias Tested by: zirias MFC after: 1 week
* linux(4): Fix listxattr for the case when the size is 0Dmitry Chagin2023-09-051-4/+8
| | | | | | | | If size is specified as zero, these calls return the current size of the list of extended attribute names (and leave list unchanged). Tested by: zirias MFC after: 1 week
* linux(4): Return ENOTSUP from xattr syscalls instead of EPERMDmitry Chagin2023-09-011-3/+13
| | | | | | | | | | | | | | | | | FreeBSD does not permits manipulating extended attributes in the system namespace by unprivileged accounts, even if account has appropriate privileges to access filesystem object. In Linux the system namespace is used to preserve posix acls. Some Gnu coreutils binaries uses posix acls, eg, install, ls. And fails if we unexpectedly return EPERM error from xattr system calls. In the other hands, in Linux read and write access to the system namespace depend on the policy implemented for each filesystem, so we'll mimics we're a filesystem that prohibits this for unpriveleged accounts. Reported by: zirias Tested by: zirias MFC after: 1 week
* linux(4): Merge removexattr for future error recodeDmitry Chagin2023-09-011-17/+37
| | | | | Tested by: zirias MFC after: 1 week
* linux(4): Return ENODATA from getxattr syscalls instead of EPERMDmitry Chagin2023-09-011-1/+1
| | | | | | | | | On Linux ENODATA mean the named attribute does not exist, or the process has no access to this attribute. Reported by: zirias Tested by: zirias MFC after: 1 week
* linux(4): Merge getxattr for future error recodeDmitry Chagin2023-09-011-17/+45
| | | | | Tested by: zirias MFC after: 1 week
* freebsd32: Remove mac_syscall from the unimpl listStephen J. Kiernan2023-08-245-4/+35
| | | | | | | | | | | | The mac_syscall system call works fine as long as any MAC module that provides a mpo_syscall method handles compat32 appropriately. Regenerate system call files for freebsd32. Reviewed by: sjg Obtained from: Juniper Networks, Inc. MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D41575
* timerfd: Move implementation from linux compat to sys/kernJake Freeland2023-08-247-420/+145
| | | | | | | | | | | Move the timerfd impelemntation from linux compat code to sys/kern. Use it to implement the new system calls for timerfd. Add a hook to kern_tc to allow timerfd to know when the system time has stepped. Add kqueue support to timerfd. Adjust a few names to be less Linux centric. RelNotes: YES Reviewed by: markj (on irc), imp, kib (with reservations), jhb (slack) Differential Revision: https://reviews.freebsd.org/D38459
* RegenKonstantin Belousov2023-08-234-1/+34
|
* mt76: update driver from upstreamBjoern A. Zeeb2023-08-211-1/+15
| | | | | | | | | | | | | | | This is a set of updates of the mt76 driver based on wireless-testing (wt-2023-05-11) 711dca0ca3d77414f8f346e564e9c8640147f40d (after v6.4-rc1), This adds support for mt7996 as well. (wt-2023-06-09) 7bd20e011626ccc3ad53e57873452b1716fcfaaa (after v6.4-rc5), (wt-2023-07-24) 62e409149b62a285e89018e49b2e115757fb9022 (after v6.5-rc3), (wt-2023-08-06) 2a220a15be657a24868368892e3e2caba2115283 (after v6.5-rc4). The current version of LinuxKPI lacks support for "page pool" which needs enhancing and updating a decade or so old shortcut mapping struct page directly to struct vm_page. MFC after: 20 days
* LinuxKPI: 802.11: update compat code for updated driversBjoern A. Zeeb2023-08-216-45/+509
| | | | | | | | | | | | | | Adjust and add structs, fields, functions to make more modern versions of LinuxKPI based wireless drivers (based on wireless-testing ( wt-2023-06-09, wt-2023-07-24, and later)) compile. Some of these changes can only be applied once all drivers get updated to not break the old versions currently in the tree. Mark those changes with __FOR_LATER_DRV_UPDATE for now and flip the switch at a later point. Sponsored by: The FreeBSD Foundation MFC after: 20 days
* linux(4): Replace linux32_copyiniov by freebsd32_copyiniovDmitry Chagin2023-08-201-2/+3
| | | | MFC after: 1 month
* linux(4): Replace linux32_copyinuio by freebsd32_copyinuioDmitry Chagin2023-08-201-2/+2
| | | | MFC after: 1 month
* linux(4): Return EAGAIN instead of ENOBUFS for non-blocking sockets in pwriteDmitry Chagin2023-08-201-1/+2
| | | | MFC after: 1 month
* linux(4): Return EAGAIN instead of ENOBUFS for non-blocking sockets in pwritevDmitry Chagin2023-08-201-1/+1
| | | | MFC after: 1 month
* linux(4): Add a dedicated writev syscall wrapperDmitry Chagin2023-08-201-0/+19
| | | | | | | | Adding a writev syscall wrapper is needed due to Linux family of write syscalls doesn't distinguish between in kernel blocking operations and always returns EAGAIN while FreeBSD can return ENOBUFS. MFC after: 1 month
* linux(4): Add a write syscall wrapperDmitry Chagin2023-08-202-0/+32
| | | | | | | | Adding a write syscall wrapper is needed due to Linux family of write syscalls doesn't distinguish between in kernel blocking operations and always returns EAGAIN while FreeBSD can return ENOBUFS. MFC after: 1 month
* linux(4): Fix linker warning about undefined vdso symbolsDmitry Chagin2023-08-191-3/+11
| | | | | Pointed out by: bz MFC after: 3 days
* linux(4): Return EAGAIN instead of ENOBUFS for non-blocking sockets in sendfileDmitry Chagin2023-08-191-0/+2
| | | | MFC after: 1 month
* linux(4): Allow in fd to be a socket in sendfileDmitry Chagin2023-08-191-4/+12
| | | | | | In this case sendfile fallback is used. MFC after: 1 month
* LinuxKPI: skbuff: add skb_cow_head()Bjoern A. Zeeb2023-08-191-0/+8
| | | | | | | Add dummy implementation of skb_cow_head(). Sponsored by: The FreeBSD Foundation MFC after: 10 days
* LinuxKPI: skbuff: fix tracingBjoern A. Zeeb2023-08-191-2/+1
| | | | | | | | Fix arguments to a trace line and remove another trace line until we actually will have the skb to trace along with a future implementation. Sponsored by: The FreeBSD Foundation MFC after: 10 days
* linux(4): Remove include of sys/types.h from linux_vdso.hDmitry Chagin2023-08-181-2/+0
| | | | | Due to sys/param.h includes sys/types.h and the fact that the sys/param.h is included everywhere where linux_vdso.h is needed.
* linux(4): Follow style(9), don't include both sys/param.h and sys/types.hDmitry Chagin2023-08-181-1/+0
|
* linprocfs(5): Follow style(9), sort includesDmitry Chagin2023-08-181-2/+2
|