Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/main'
Browse files Browse the repository at this point in the history
  • Loading branch information
mszoek committed May 8, 2024
2 parents 54cfdb6 + 8c2f6c3 commit 8bf2d14
Show file tree
Hide file tree
Showing 59 changed files with 2,667 additions and 173 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@
#
# Once you have installed the necessary cross toolchain, simply pass
# CROSS_TOOLCHAIN=${TARGET_ARCH}-gccN while building with the above steps,
# e.g., `make buildworld CROSS_TOOLCHAIN=amd64-gcc6`.
# e.g., `make buildworld CROSS_TOOLCHAIN=amd64-gcc13`.
#
# The ${TARGET_ARCH}-gccN packages are provided as flavors of the
# devel/freebsd-gccN ports.
Expand Down
12 changes: 0 additions & 12 deletions contrib/wpa/src/drivers/driver_bsd.c
Original file line number Diff line number Diff line change
Expand Up @@ -1557,17 +1557,6 @@ static int wpa_driver_bsd_capa(struct bsd_driver_data *drv)
if (devcaps.dc_drivercaps & IEEE80211_C_WPA2)
drv->capa.key_mgmt = WPA_DRIVER_CAPA_KEY_MGMT_WPA2 |
WPA_DRIVER_CAPA_KEY_MGMT_WPA2_PSK;
#ifdef __FreeBSD__
drv->capa.enc |= WPA_DRIVER_CAPA_ENC_WEP40 |
WPA_DRIVER_CAPA_ENC_WEP104 |
WPA_DRIVER_CAPA_ENC_TKIP |
WPA_DRIVER_CAPA_ENC_CCMP;
#else
/*
* XXX
* FreeBSD exports hardware cryptocaps. These have no meaning for wpa
* since net80211 performs software crypto.
*/

if (devcaps.dc_cryptocaps & IEEE80211_CRYPTO_WEP)
drv->capa.enc |= WPA_DRIVER_CAPA_ENC_WEP40 |
Expand All @@ -1576,7 +1565,6 @@ static int wpa_driver_bsd_capa(struct bsd_driver_data *drv)
drv->capa.enc |= WPA_DRIVER_CAPA_ENC_TKIP;
if (devcaps.dc_cryptocaps & IEEE80211_CRYPTO_AES_CCM)
drv->capa.enc |= WPA_DRIVER_CAPA_ENC_CCMP;
#endif

if (devcaps.dc_drivercaps & IEEE80211_C_HOSTAP)
drv->capa.flags |= WPA_DRIVER_FLAGS_AP;
Expand Down
30 changes: 22 additions & 8 deletions lib/libpfctl/libpfctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -1336,22 +1336,20 @@ static struct snl_field_parser fp_getrules[] = {
SNL_DECLARE_PARSER(getrules_parser, struct genlmsghdr, fp_getrules, ap_getrules);

int
pfctl_get_rules_info(int dev __unused, struct pfctl_rules_info *rules, uint32_t ruleset,
pfctl_get_rules_info_h(struct pfctl_handle *h, struct pfctl_rules_info *rules, uint32_t ruleset,
const char *path)
{
struct snl_state ss = {};
struct snl_errmsg_data e = {};
struct nlmsghdr *hdr;
struct snl_writer nw;
uint32_t seq_id;
int family_id;

snl_init(&ss, NETLINK_GENERIC);
family_id = snl_get_genl_family(&ss, PFNL_FAMILY_NAME);
family_id = snl_get_genl_family(&h->ss, PFNL_FAMILY_NAME);
if (family_id == 0)
return (ENOTSUP);

snl_init_writer(&ss, &nw);
snl_init_writer(&h->ss, &nw);
hdr = snl_create_genl_msg_request(&nw, family_id, PFNL_CMD_GETRULES);
hdr->nlmsg_flags |= NLM_F_DUMP;

Expand All @@ -1363,17 +1361,33 @@ pfctl_get_rules_info(int dev __unused, struct pfctl_rules_info *rules, uint32_t
return (ENOMEM);

seq_id = hdr->nlmsg_seq;
if (! snl_send_message(&ss, hdr))
if (! snl_send_message(&h->ss, hdr))
return (ENXIO);

while ((hdr = snl_read_reply_multi(&ss, seq_id, &e)) != NULL) {
if (! snl_parse_nlmsg(&ss, hdr, &getrules_parser, rules))
while ((hdr = snl_read_reply_multi(&h->ss, seq_id, &e)) != NULL) {
if (! snl_parse_nlmsg(&h->ss, hdr, &getrules_parser, rules))
continue;
}

return (e.error);
}

int
pfctl_get_rules_info(int dev __unused, struct pfctl_rules_info *rules, uint32_t ruleset,
const char *path)
{
struct pfctl_handle *h;
int error;

h = pfctl_open(PF_DEVICE);
if (h == NULL)
return (ENOTSUP);
error = pfctl_get_rules_info_h(h, rules, ruleset, path);
pfctl_close(h);

return (error);
}

int
pfctl_get_rule(int dev, uint32_t nr, uint32_t ticket, const char *anchor,
uint32_t ruleset, struct pfctl_rule *rule, char *anchor_call)
Expand Down
3 changes: 3 additions & 0 deletions lib/libpfctl/libpfctl.h
Original file line number Diff line number Diff line change
Expand Up @@ -412,6 +412,9 @@ int pfctl_get_eth_rule(int dev, uint32_t nr, uint32_t ticket,
char *anchor_call);
int pfctl_add_eth_rule(int dev, const struct pfctl_eth_rule *r,
const char *anchor, const char *anchor_call, uint32_t ticket);
int pfctl_get_rules_info_h(struct pfctl_handle *h,
struct pfctl_rules_info *rules, uint32_t ruleset,
const char *path);
int pfctl_get_rules_info(int dev, struct pfctl_rules_info *rules,
uint32_t ruleset, const char *path);
int pfctl_get_rule(int dev, uint32_t nr, uint32_t ticket,
Expand Down
10 changes: 6 additions & 4 deletions release/Makefile.vm
Original file line number Diff line number Diff line change
Expand Up @@ -223,14 +223,16 @@ vm-install:
${DESTDIR}/vmimages/CHECKSUM.SHA256
.endif

vm-release:
.if defined(WITH_VMIMAGES) && !empty(WITH_VMIMAGES)
${MAKE} -C ${.CURDIR} ${.MAKEFLAGS} ${VMTARGETS}
vm-release: ${VMTARGETS}
.else
vm-release:
.endif

cloudware-release:
.if defined(WITH_CLOUDWARE) && !empty(WITH_CLOUDWARE) && !empty(CLOUDWARE)
${MAKE} -C ${.CURDIR} ${.MAKEFLAGS} ${CLOUDTARGETS}
cloudware-release: ${CLOUDTARGETS}
.else
cloudware-release:
.endif

.include "${.CURDIR}/Makefile.azure"
Expand Down
9 changes: 5 additions & 4 deletions sbin/pfctl/pfctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -1283,14 +1283,14 @@ pfctl_show_rules(int dev, char *path, int opts, enum pfctl_show format,
}

if (opts & PF_OPT_SHOWALL) {
ret = pfctl_get_rules_info(dev, &ri, PF_PASS, path);
ret = pfctl_get_rules_info_h(pfh, &ri, PF_PASS, path);
if (ret != 0) {
warn("DIOCGETRULES");
goto error;
}
header++;
}
ret = pfctl_get_rules_info(dev, &ri, PF_SCRUB, path);
ret = pfctl_get_rules_info_h(pfh, &ri, PF_SCRUB, path);
if (ret != 0) {
warn("DIOCGETRULES");
goto error;
Expand Down Expand Up @@ -1328,7 +1328,7 @@ pfctl_show_rules(int dev, char *path, int opts, enum pfctl_show format,
}
pfctl_clear_pool(&rule.rpool);
}
ret = pfctl_get_rules_info(dev, &ri, PF_PASS, path);
ret = pfctl_get_rules_info_h(pfh, &ri, PF_PASS, path);
if (ret != 0) {
warn("DIOCGETRULES");
goto error;
Expand Down Expand Up @@ -1435,7 +1435,7 @@ pfctl_show_nat(int dev, char *path, int opts, char *anchorname, int depth)
snprintf(&path[len], MAXPATHLEN - len, "%s", anchorname);

for (i = 0; i < 3; i++) {
ret = pfctl_get_rules_info(dev, &ri, nattype[i], path);
ret = pfctl_get_rules_info_h(pfh, &ri, nattype[i], path);
if (ret != 0) {
warn("DIOCGETRULES");
return (-1);
Expand Down Expand Up @@ -2130,6 +2130,7 @@ pfctl_rules(int dev, char *filename, int opts, int optimize,
sizeof(trs.pfrt_anchor)) >= sizeof(trs.pfrt_anchor))
ERRX("pfctl_rules: strlcpy");
pf.dev = dev;
pf.h = pfh;
pf.opts = opts;
pf.optimize = optimize;
pf.loadopt = loadopt;
Expand Down
2 changes: 1 addition & 1 deletion sbin/pfctl/pfctl_optimize.c
Original file line number Diff line number Diff line change
Expand Up @@ -889,7 +889,7 @@ load_feedback_profile(struct pfctl *pf, struct superblocks *superblocks)
TAILQ_INIT(&queue);
TAILQ_INIT(&prof_superblocks);

if (pfctl_get_rules_info(pf->dev, &rules, PF_PASS, "")) {
if (pfctl_get_rules_info_h(pf->h, &rules, PF_PASS, "")) {
warn("DIOCGETRULES");
return (1);
}
Expand Down
1 change: 1 addition & 0 deletions sbin/pfctl/pfctl_parser.h
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ struct pfr_buffer; /* forward definition */

struct pfctl {
int dev;
struct pfctl_handle *h;
int opts;
int optimize;
int loadopt;
Expand Down
1 change: 1 addition & 0 deletions share/man/man4/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -519,6 +519,7 @@ MAN= aac.4 \
snd_es137x.4 \
snd_fm801.4 \
snd_hda.4 \
snd_hdsp.4 \
snd_hdspe.4 \
snd_ich.4 \
snd_maestro3.4 \
Expand Down
3 changes: 3 additions & 0 deletions share/man/man4/pcm.4
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,8 @@ The following bridge device drivers are available:
.It
.Xr snd_hda 4 (enabled by default on amd64, i386)
.It
.Xr snd_hdsp 4
.It
.Xr snd_hdspe 4
.It
.Xr snd_ich 4 (enabled by default on amd64, i386)
Expand Down Expand Up @@ -609,6 +611,7 @@ A device node is not created properly.
.Xr snd_es137x 4 ,
.Xr snd_fm801 4 ,
.Xr snd_hda 4 ,
.Xr snd_hdsp 4 ,
.Xr snd_hdspe 4 ,
.Xr snd_ich 4 ,
.Xr snd_maestro3 4 ,
Expand Down
154 changes: 154 additions & 0 deletions share/man/man4/snd_hdsp.4
Original file line number Diff line number Diff line change
@@ -0,0 +1,154 @@
.\" Copyright (c) 2012 Ruslan Bukin <[email protected]>
.\" Copyright (c) 2024 Florian Walpen <[email protected]>
.\" All rights reserved.
.\"
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions
.\" are met:
.\" 1. Redistributions of source code must retain the above copyright
.\" notice, this list of conditions and the following disclaimer.
.\" 2. Redistributions in binary form must reproduce the above copyright
.\" notice, this list of conditions and the following disclaimer in the
.\" documentation and/or other materials provided with the distribution.
.\"
.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
.Dd May 1, 2024
.Dt SND_HDSP 4
.Os
.Sh NAME
.Nm snd_hdsp
.Nd "RME HDSP bridge device driver"
.Sh SYNOPSIS
To compile this driver into the kernel, place the following lines in your
kernel configuration file:
.Bd -ragged -offset indent
.Cd "device sound"
.Cd "device snd_hdsp"
.Ed
.Pp
Alternatively, to load the driver as a module at boot time, place the
following line in
.Xr loader.conf 5 :
.Bd -literal -offset indent
snd_hdsp_load="YES"
.Ed
.Sh DESCRIPTION
The
.Nm
bridge driver allows the generic audio driver
.Xr sound 4
to attach to RME HDSP audio devices.
.Sh HARDWARE
The
.Nm
driver supports the following audio devices:
.Pp
.Bl -bullet -compact
.It
RME HDSP 9632
.It
RME HDSP 9652
.El
.Pp
By default, each
.Xr pcm 4
device corresponds to a physical port on the sound card.
For ADAT ports, 8 channel, 4 channel and 2 channel formats are supported.
The effective number of ADAT channels is 8 channels at single speed
(32kHz-48kHz) and 4 channels at double speed (64kHz-96kHz).
Only the HDSP 9632 can operate at quad speed (128kHz-192kHz), ADAT is
disabled in this mode.
Depending on sample rate and channel format selected, not all pcm channels can
be mapped to ADAT channels and vice versa.
.Sh LOADER TUNABLES
These settings can be entered at the
.Xr loader 8
prompt or in
.Xr loader.conf 5 .
.Bl -tag -width indent
.It Va hw.hdsp.unified_pcm
If set to 1, all physical ports are combined into one unified pcm device.
When opened in multi-channel audio software, this makes all ports available
at the same time, and fully synchronized.
For resulting channel numbers consult the following table:
.El
.Bl -column "Sound Card" "Single Speed" "Double Speed" "Quad Speed"
.Sy "Sound Card" Ta Sy "Single Speed" Ta Sy "Double Speed" Ta Sy "Quad Speed"
.It "" Ta "Play | Rec" Ta "Play | Rec" Ta "Play | Rec"
.It HDSP 9632 Ta " 12 | 12" Ta " 8 | 8" Ta " 4 | 4"
.It HDSP 9652 Ta " 26 | 26" Ta " 14 | 14" Ta " - | -"
.El
.Sh SYSCTL TUNABLES
These settings and informational values can be accessed at runtime with the
.Xr sysctl 8
command.
If multiple RME HDSP sound cards are installed, each device has a separate
configuration.
To adjust the following sysctl identifiers for a specific sound card, insert
the respective device number in place of
.Ql 0 .
.Bl -tag -width indent
.It Va dev.hdsp.0.sample_rate
Set a fixed sample rate from 32000, 44100, 48000, up to 192000.
This is usually required for digital connections (AES, S/PDIF, ADAT).
The default value of 0 adjusts the sample rate according to pcm device settings.
.It Va dev.hdsp.0.period
The number of samples processed per interrupt, from 32, 64, 128, up to 4096.
Setting a lower value here results in less latency, but increases system load
due to frequent interrupt processing.
Extreme values may cause audio gaps and glitches.
.It Va dev.hdsp.0.clock_list
Lists possible clock sources to sync with, depending on the hardware model.
This includes internal and external master clocks as well as incoming digital
audio signals like AES, S/PDIF and ADAT.
.It Va dev.hdsp.0.clock_preference
Select a preferred clock source from the clock list.
HDSP cards will sync to this clock source when available, but fall back to
auto-sync with any other digital clock signal they receive.
Set this to
.Ql internal
if the HDSP card should act as master clock.
.It Va dev.hdsp.0.clock_source
Shows the actual clock source in use (read only).
This differs from what is set as clock preference when in auto-sync mode.
.It Va dev.hdsp.0.sync_status
Display the current sync status of all external clock sources.
Status indications are
.Ql none
for no signal at all,
.Ql lock
for when a valid signal is present, and
.Ql sync
for accurately synchronized signals (required for recording digital
audio).
.El
.Pp
Where appropriate these sysctl values are modeled after official RME software on
other platforms, and adopt their terminology.
Consult the RME user manuals for additional information.
.Sh SEE ALSO
.Xr sound 4
.Sh HISTORY
The
.Nm
device driver first appeared in
.Fx 15.0 .
.Sh AUTHORS
.An -nosplit
Based on
.Xr snd_hdspe 4
originally written by
.An Ruslan Bukin <[email protected]> .
All adaptation to HDSP cards by
.An Florian Walpen <[email protected]> .
4 changes: 3 additions & 1 deletion share/man/man9/ieee80211.9
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
.Dd January 26, 2021
.Dd April 24, 2024
.Dt IEEE80211 9
.Os
.Sh NAME
Expand Down Expand Up @@ -514,6 +514,8 @@ General capabilities are specified by
.Vt ic_caps .
Hardware cryptographic capabilities are specified by
.Vt ic_cryptocaps .
Software cryptographic capabilities are specified by
.Vt ic_sw_cryptocaps .
802.11n capabilities, if any, are specified by
.Vt ic_htcaps .
The
Expand Down
Loading

0 comments on commit 8bf2d14

Please sign in to comment.