2082 Commits

Author SHA1 Message Date
Kinsey Moore
89db1bb27c rtemsbsd: Remove old DHCP init prototype
This prototype should have been removed with commit
ac4db4cec5b6b1e0a25e910851e50831afb0749d.
2024-03-27 12:12:24 -05:00
Kinsey Moore
beb423ba5b freebsd/mmcsd: Disable on-device cache usage
This disables any usage of the on-device R/W cache since all device
cache maintenance functions are compiled out under RTEMS leaving no way
to flush the cache before system reset and making data loss possible.
2024-03-05 08:50:46 -06:00
Kinsey Moore
63deac0401 rtemsbsd/rtems: Don't leak memory on error 2024-01-31 14:01:49 -06:00
Kinsey Moore
9b44583908 rtemsbsd/rtems: Check function return values 2024-01-31 14:01:49 -06:00
Kinsey Moore
803bba9580 rtemsbsd/rc-conf: Avoid use after free 2024-01-31 14:01:49 -06:00
Christian Mauderer
e07b74b88a rtemsbsd/sys/arm: Add imxrt1166 USBPHY driver
Adds a driver for the i.MXRT1166 USB PHY and enable USB for the
imxrt11xx BSPs.
2023-08-21 09:17:02 +02:00
Christian Mauderer
3393edcb4b bsp/imxrt: Enable cache handling
The BSP needs the CPU_DATA_CACHE_ALIGNMENT set to enable correct cache
handling in libbsd. Otherwise for example USB doesn't work reliable.
2023-08-21 09:17:02 +02:00
Christian Mauderer
af0fcc35f7 imx: Enable GPIO driver for imxrt too 2023-07-24 14:51:17 +02:00
Christian Mauderer
dfb2144641 ipsec-tools: Fix copying fd_set prior to select
The racoon session code copies an fd_set from one variable into another
prior to calling select. That works well for simple structures.

In libbsd we have to allocate fd_sets instead of using fixed structures
to avoid a problem with file numbers bigger than FD_SETSIZE. The simple
assignment didn't work in that case.

This patch makes sure that a memcpy is used instead.

Update #4913
2023-05-31 08:21:12 +02:00
Aaron Nyholm
16be3a7c7d rtemsbsd/rc_conf: Fixed non-nullterminated string causing crashes 2023-04-13 09:39:22 +10:00
Joel Sherrill
1aa4cb8568 waf: Update to waf 2.0.25
Updates #4860
2023-02-20 10:04:18 -06:00
Sebastian Huber
0051a32cb8 Use FreeBSD Git repository (not obsolete mirror)
Git commit 5d85e12f44ccb0e5728344a002c108ddc105e038.
2023-01-04 10:19:59 +01:00
Stefan Eßer
31808093e1 sys/bitset.h: reduce visibility of BIT_* macros
Add two underscore characters "__" to names of BIT_* and BITSET_*
macros to move them to the implementation name space and to prevent
a name space pollution due to BIT_* macros in 3rd party programs with
conflicting parameter signatures.

These prefixed macro names are used in kernel header files to define
macros in e.g. sched.h, sys/cpuset.h and sys/domainset.h.

If C programs are built with either -D_KERNEL (automatically passed
when building a kernel or kernel modules) or -D_WANT_FREENBSD_BITSET
(or this macros is defined in the source code before including the
bitset macros), then all macros are made visible with their previous
names, too. E.g., both __BIT_SET() and BIT_SET() are visible with
either of _KERNEL or _WANT_FREEBSD_BITSET defined.

The main reason for this change is that some 3rd party sources
including sched.h have been found to contain conflicting BIT_*
macros.

As a work-around, parts of shed.h have been made conditional and
depend on _WITH_CPU_SET_T being set when sched.h is included.
Ports that expect the full functionality provided by sched.h need
to be built with -D_WITH_CPU_SET_T. But this leads to conflicts if
BIT_* macros are defined in that program, too.

This patch set makes all of sched.h visible again without this
parameter being passed and without any name space pollution due
to BIT_* macros becoming visible when sched.h is included.

This patch set will be backported to the STABLE branches, but ports
will need to use -D_WITH_CPU_SET_T as long as there are supported
releases that do not contain these patches.

Reviewed by:	kib, markj
MFC after:	1 month
Relnotes:	yes
Differential Revision:	https://reviews.freebsd.org/D33235
2022-09-28 13:20:55 +02:00
Sebastian Huber
9794487b1f arm/lpc: Add option to customize device probes 2022-09-06 13:26:15 +02:00
Sebastian Huber
b7787bd311 if_lpe.c: Use interface transmit
This avoids the need for a transmit task and transmit interrupts.
2022-09-06 13:26:10 +02:00
Sebastian Huber
8b085f2fcd if_lpe.c: Move transmit initialization
Move the transmit initialization out of the transmit task to be able to
remove the transmit task in the next patch.
2022-09-06 13:26:09 +02:00
Sebastian Huber
192e8d37a3 if_lpe.c: Port to LibBSD 2022-09-06 13:26:08 +02:00
Sebastian Huber
5b031886e1 if_lpe.c: Import legacy LPC Ethernet driver
The standard FreeBSD MII support causes severe problems on the LPC3200
chip family.  If an Ethernet module register is accessed while there is
no clock from the PHY, the chip completely locks up and only an external
watchdog can recover from this state.  The legacy driver had a custom
PHY management code which helped to avoid such issues.  The if_lpe.c
driver is no longer maintained by FreeBSD.
2022-09-06 13:26:06 +02:00
Sebastian Huber
d6b8db2f2f stdio/local.h: Make Newlib config independent 2022-07-24 14:54:03 +02:00
Sebastian Huber
30116094a9 Define IFCAP_NOMAP for Newlib compatibility 2022-07-07 14:23:25 +02:00
Sebastian Huber
2f7103677c Define IN_HISTORICAL_NETS for kernel space
Required by FreeBSD commit:

Author: Mike Karels <karels@FreeBSD.org>
Date:   Tue Oct 26 22:01:09 2021 -0500

    kernel: deprecate Internet Class A/B/C

    Hide historical Class A/B/C macros unless IN_HISTORICAL_NETS is defined;
    define it for user level.  Define IN_MULTICAST separately from IN_CLASSD,
    and use it in pf instead of IN_CLASSD.  Stop using class for setting
    default masks when not specified; instead, define new default mask
    (24 bits).  Warn when an Internet address is set without a mask.

    MFC after:      1 month
    Reviewed by:    cy
    Differential Revision: https://reviews.freebsd.org/D32708
2022-07-07 14:23:25 +02:00
Konstantin Belousov
7974c8b9db Kernel-side infrastructure to implement nvlist-based set/get ifcaps
Reviewed by:	hselasky, jhb, kp (previous version)
Sponsored by:	NVIDIA Networking
MFC after:	3 weeks
Differential revision:	https://reviews.freebsd.org/D32551
2022-07-07 14:23:25 +02:00
Rick Macklem
e86ac20e9f uipc_socket.c: Modify MSG_TLSAPPDATA to only do Alert Records
Without this patch, the MSG_TLSAPPDATA flag would cause
soreceive_generic() to return ENXIO for any non-application
data record in a TLS receive stream.

This works ok for TLS1.2, since Alert records appear to be
the only non-application data records received.
However, for TLS1.3, there can be post-handshake handshake
records, such as NewSessionKey sent to the client from the
server. These handshake records cannot be handled by the
upcall which does an SSL_read() with length == 0.

It appears that the client can simply throw away these
NewSessionKey records, but to do so, it needs to receive
them within the kernel.

This patch modifies the semantics of MSG_TLSAPPDATA slightly,
so that it only applies to Alert records and not Handshake
records. It is needed to allow the krpc to work with KTLS1.3.

Reviewed by:	hselasky
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D35170
2022-07-07 14:23:25 +02:00
Kristof Provost
d9027851bd Widen ifnet_detach_sxlock coverage
Widen the ifnet_detach_sxlock to cover the entire vnet sysuninit code.
This ensures that we can't end up having the vnet_sysuninit free the UDP
pcb while the detach code is running and trying to purge the UDP pcb.

MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D28530
2022-07-07 14:23:25 +02:00
Rick Macklem
4de7ab7e97 Add the MSG_TLSAPPDATA flag to indicate "return ENXIO" for non-application TLS data records.
The kernel RPC cannot process non-application data records when
using TLS. It must to an upcall to a userspace daemon that will
call SSL_read() to process them.

This patch adds a new flag called MSG_TLSAPPDATA that the kernel
RPC can use to tell sorecieve() to return ENXIO instead of a non-application
data record, when that is what is at the top of the receive queue.
I put the code in #ifdef KERN_TLS/#endif, although it will build without
that, so that it is recognized as only useful when KERN_TLS is enabled.
The alternative to doing this is to have the kernel RPC re-queue the
non-application data message after receiving it, but that seems more
complicated and might introduce message ordering issues when there
are multiple non-application data records one after another.

I do not know what, if any, changes will be required to support TLS1.3.

Reviewed by:	glebius
Differential Revision:	https://reviews.freebsd.org/D25923
2022-07-07 14:23:25 +02:00
Sebastian Huber
52ec6ffbc2 CONTRIBUTING.rst: Add FreeBSD baseline update hints 2022-07-07 14:23:25 +02:00
Sebastian Huber
f009252227 user-space: Request FreeBSD bitset API
This is required for recent Newlib versions.

Update #4667.
2022-06-30 17:41:02 +02:00
Sebastian Huber
d94d6157b4 build: Ensure mandatory compiler/linker flags
Make sure the flags are present in all build configurations.
2022-06-23 11:12:40 +02:00
Sebastian Huber
3c2de34cc6 README.rst: Remove RTEMS_POSIX_API from BSP config 2022-06-22 17:33:38 +02:00
Sebastian Huber
d17efd345d build: Do not require RTEMS_POSIX_API 2022-06-22 17:27:11 +02:00
Sebastian Huber
0cd30949fc netstat: Do not use signals 2022-06-22 17:27:11 +02:00
Sebastian Huber
e583f152b4 wlanstats: Do not use signals 2022-06-22 17:27:11 +02:00
Sebastian Huber
217c2e2a8b ping6: Do not use signals 2022-06-22 17:27:09 +02:00
Sebastian Huber
4ca39ca3fc ping: Do not use signals 2022-06-22 17:25:58 +02:00
Sebastian Huber
cdb5ac55c6 openssl: Do not use signals 2022-06-22 17:25:58 +02:00
Sebastian Huber
93519fa764 wpa: Use CONFIG_ELOOP_KQUEUE
This avoids issues with the fd_set size.
2022-06-22 17:25:58 +02:00
Sebastian Huber
dd3f119d3b wpa: Do not use signals 2022-06-22 17:25:58 +02:00
Sebastian Huber
691575801c ipsec-tools: Do not use signals 2022-06-22 17:25:57 +02:00
Sebastian Huber
8952450d88 racoon: Do not rely on <sys/types.h> 2022-06-22 17:25:57 +02:00
Sebastian Huber
9ef5c9a2ff CONTRIBUTING.rst: Warn about white space changes 2022-06-09 08:39:24 +02:00
Christian Mauderer
f5e9bae508 if_ffec: Allow PHY that is connected to other FFEC
The i.MX6UL (and some others from the i.MX family) have shared MDIO
lines for multiple FFECs. This patch allows to use the MDIO interface
from another Ethernet controller.

Note that you have to make sure that the FFECs are initialized in the
right order. Normally that can be done via FDT.
2022-06-07 09:07:15 +02:00
Christian Mauderer
91afe3a020 if_ffec: Reduce buffer size
Typical embedded systems don't have that much memory. Reduce the buffer
size to something more sensible for the usual type of application.
2022-06-07 09:07:08 +02:00
Karel Gardas
508af74f79 if_stmac: fix compilation error (related to crc32_raw move in FreeBSD)
FreeBSD in 2019 moved crc32 function into separate gsb_crc32.h header
file and probably after libbsd sync with this change if_stmac got broken.
2022-06-04 19:54:09 +02:00
Sebastian Huber
d1bfa784b7 Use rtems_task_exit() 2022-06-01 10:36:17 +02:00
Sebastian Huber
9e87868ec2 if_atsam: Recover from receive freezes
Under unknown conditions the receive path ended up in a frozen state.
In this state, the DMA and driver descriptor head were equal and all
receive descriptors had the used bit set.  So, the DMA was unable to
store received frames.  However, the receive daemon was never woken up
to refill the receive buffers.  It seems that the RXUBR interrupt can be
used to recover from this state.

Update #4652.
2022-06-01 09:59:10 +02:00
Sebastian Huber
eea3f0eec3 if_atsam: Shorten sysctl names
Update #4652.
2022-06-01 09:59:10 +02:00
Sebastian Huber
1ed12b8af7 if_atsam: Add tx/rx desc sysctls
Update #4652.
2022-06-01 09:59:10 +02:00
Sebastian Huber
eb58e82197 if_atsam: Add register sysctls
Update #4652.
2022-06-01 09:59:10 +02:00
Sebastian Huber
5650e92685 if_atsam: Allow stats reset via sysctl
Update #4652.
2022-06-01 09:59:09 +02:00
Sebastian Huber
fdb00bbb3d libbsd.txt: Move issues and TODO 2022-05-23 16:28:26 +02:00