777 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
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
Aaron Nyholm
16be3a7c7d rtemsbsd/rc_conf: Fixed non-nullterminated string causing crashes 2023-04-13 09:39:22 +10: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
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
f009252227 user-space: Request FreeBSD bitset API
This is required for recent Newlib versions.

Update #4667.
2022-06-30 17:41:02 +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
c6212520ab Add program destructor support
Update #4650.
2022-05-12 07:48:02 +02:00
Sebastian Huber
38e1610af2 if_atsam: Fix interface stop
Close #4652.
2022-05-11 16:05:46 +02:00
Sebastian Huber
8039d70d94 if_atsam: Support transmit bpf
Update #4652.
2022-05-11 16:05:26 +02:00
Sebastian Huber
5c4ac7a917 if_atsam: Do not use rtems_bsdnet_newproc()
Update #4652.
2022-05-11 16:05:26 +02:00
Sebastian Huber
202502a397 if_atsam: Support IFCAP_VLAN_HWTAGGING
This is required to enable checksum offload for vlan interfaces.

Update #4652.
2022-05-11 16:05:26 +02:00
Sebastian Huber
62fc2b6a03 if_atsam: Optimize receive
Do not use the interface mutex in the receive loop.  Avoid multiple
reads of DMA descriptor words.  Use a compile-time constant for the
receive DMA descriptor count to simplify calculations.

Update #4652.
2022-05-11 16:05:26 +02:00
Sebastian Huber
6be24bd16a if_atsam: Optimize transmit
Use the transmit interface handler to avoid a transmit task/interrupt.
Use a compile-time constant for the transmit DMA descriptor count to
simplify calculations.

Update #4652.
2022-05-11 16:05:26 +02:00
Sebastian Huber
3150b37022 if_atsam: Add multicast support
Update #4652.
2022-05-11 16:05:26 +02:00
Sebastian Huber
f4efcbfda5 if_atsam: Fix start/stop of interface
Update #4652.
2022-05-11 16:05:26 +02:00
Sebastian Huber
339ba3dd9f if_atsam: Fix interrupt setup
The interrupt is enabled by rtems_interrupt_handler_install().

Update #4652.
2022-05-11 16:05:26 +02:00
Sebastian Huber
5b62a8bfa1 if_atsam: Do not disable the Ethernet CRC
The Ethernet CRC and padding must be always generated by the MAC.

Update #4652.
2022-05-11 16:05:26 +02:00
Sebastian Huber
c58bb6095a if_atsam: Enable all capabilities
Update #4652.
2022-05-11 16:05:25 +02:00
Sebastian Huber
73c764a70e if_atsam: Fix warnings
Update #4652.
2022-05-11 16:05:25 +02:00
Heinz Junkes
878713ba45 if_mve: Add MV643XX Ethernet driver
Close #4345.
2022-03-07 10:53:16 +01:00
Sebastian Huber
1b6529ee94 rtems-bsd-program.h: Remove stray ';' 2022-02-23 15:57:30 +01:00
Christian Mauderer
0b883f311e ppp: Fix transmitting data
The pppstart expected that a driver write would somehow magically
process all data passed to the write function. Because ppp disables all
buffering that originally has been in termios, that assumption is not
true for all but polled drivers.

With this patch, the pppstart now gets and processes the feedback that
is returned from the driver via rtems_termios_dequeue_characters.

Update #4493
2022-02-10 09:15:58 +01:00
Gedare Bloom
8f870a3593 aarch64/nexus: add GEM definitions for Versal 2021-06-25 13:02:38 -06:00
Sebastian Huber
df8f5fc876 EPOCH(9): Fix epoch call and drain
Since the epoch call callbacks may lock/unlock a mutex the callbacks must be
called from within thread context with thread dispatching enabled.  Use thread
pinning to ensure that the calling thread stays on the right processor.  Use
the interrupt server to ensure the thread context for the epoch drain.
2021-06-11 08:39:26 +02:00
Sebastian Huber
fb6a312bd6 EPOCH(9): Use PER_CPU_DATA_NEED_INITIALIZATION()
Use the PER_CPU_DATA_NEED_INITIALIZATION() macro if necessary to request an
initialization of the per-CPU data.
2021-06-10 10:07:57 +02:00
Jan Sommer
5b82fcf06a i386: Remove unneeded include header files 2021-06-07 10:39:46 +02:00
Ryan Long
5e7ef1252b libbsd nfs.c: Change filesystem utime_h handler to utimens_h
Changed nfs_utime() to nfs_utimens(), changed the arguments to use
a timespec array instead of individual variables for access and
modified time.

Updates #4400
2021-05-28 14:28:20 -05:00
G S Niteesh Babu
5251e0c816 iicbus/rtems-i2c.c: Add rtems,path as an additional bus path
Adds "rtems,path" as an additional bus path for the i2c driver.
Previously the bus path was provided in "rtems,i2c-path" property
only.
2021-04-22 18:45:50 +02:00
Christian Mauderer
829afafbcb st-sdmmc: Handle short not cache aligned buffers
Possible data sources for SD driver:

- mmc_sd_switch():
    - length: 64 byte;
    - buffer on stack
- mmc_test_bus_width():
    - length: 4 or 8 byte
    - buffer in program memory or on stack
- mmc_app_send_scr():
    - length: 8 byte
    - buffer from device ivar structure
- mmc_app_sd_status():
    - length: 64 byte
    - buffer from device ivar structure
- mmc_send_ext_csd():
    - length: MMC_EXTCSD_SIZE = 512
    - buffer from device ivar structure
- rtems_bsd_mmcsd_disk_read_write():
    - length: depends on read
    - buffer from rtems_blkdev buffer -> already aligned
- mmcsd_ioctl_cmd():
    - length: depends on call
    - buffer malloced, not aligned -> patched in RTEMS

So the problematic buffers are only the ones up to 512 bytes. Copy these data
into a buffer to avoid that problem.
2021-04-19 09:03:40 +02:00