sync with OpenBSD -current

This commit is contained in:
purplerain 2024-05-30 15:25:45 +00:00
parent 222e583e28
commit 2d58860211
Signed by: purplerain
GPG key ID: F42C07F07E2E35B7
41 changed files with 532 additions and 277 deletions

View file

@ -1,4 +1,4 @@
/* $OpenBSD: acpi_machdep.c,v 1.109 2024/05/26 13:37:31 kettenis Exp $ */
/* $OpenBSD: acpi_machdep.c,v 1.110 2024/05/29 12:21:33 kettenis Exp $ */
/*
* Copyright (c) 2005 Thorsten Lockert <tholo@sigmasoft.com>
*
@ -377,6 +377,9 @@ acpi_attach_machdep(struct acpi_softc *sc)
int
acpi_sleep_cpu(struct acpi_softc *sc, int state)
{
if (state == ACPI_STATE_S0)
return cpu_suspend_primary();
rtcstop();
#if NLAPIC > 0
lapic_disable();
@ -458,6 +461,9 @@ acpi_sleep_cpu(struct acpi_softc *sc, int state)
void
acpi_resume_cpu(struct acpi_softc *sc, int state)
{
if (state == ACPI_STATE_S0)
return;
cpu_init_msrs(&cpu_info_primary);
cpu_fix_msrs(&cpu_info_primary);

View file

@ -1,4 +1,4 @@
/* $OpenBSD: cpu.c,v 1.188 2024/05/14 01:42:07 guenther Exp $ */
/* $OpenBSD: cpu.c,v 1.189 2024/05/29 12:21:33 kettenis Exp $ */
/* $NetBSD: cpu.c,v 1.1 2003/04/26 18:39:26 fvdl Exp $ */
/*-
@ -1461,3 +1461,52 @@ wbinvd_on_all_cpus(void)
return 0;
}
#endif
int cpu_suspended;
#ifdef SUSPEND
void
cpu_suspend_cycle(void)
{
cpu_idle_cycle_fcn();
}
int
cpu_suspend_primary(void)
{
struct cpu_info *ci = curcpu();
int count = 0;
printf("suspend\n");
/* Mask clock interrupts. */
local_pic.pic_hwmask(&local_pic, 0);
/*
* All non-wakeup interrupts should be masked at this point;
* re-enable interrupts such that wakeup interrupts actually
* wake us up. Set a flag such that drivers can tell we're
* suspended and change their behaviour accordingly. They can
* wake us up by clearing the flag.
*/
cpu_suspended = 1;
ci->ci_ilevel = IPL_NONE;
intr_enable();
while (cpu_suspended) {
cpu_suspend_cycle();
count++;
}
intr_disable();
ci->ci_ilevel = IPL_HIGH;
/* Unmask clock interrupts. */
local_pic.pic_hwunmask(&local_pic, 0);
printf("resume %d\n", count);
return 0;
}
#endif

View file

@ -1,4 +1,4 @@
/* $OpenBSD: intr.c,v 1.57 2024/05/26 13:37:31 kettenis Exp $ */
/* $OpenBSD: intr.c,v 1.58 2024/05/29 12:21:33 kettenis Exp $ */
/* $NetBSD: intr.c,v 1.3 2003/03/03 22:16:20 fvdl Exp $ */
/*
@ -524,12 +524,22 @@ intr_disestablish(struct intrhand *ih)
int
intr_handler(struct intrframe *frame, struct intrhand *ih)
{
extern int cpu_suspended;
struct cpu_info *ci = curcpu();
int floor;
int rc;
#ifdef MULTIPROCESSOR
int need_lock;
#endif
/*
* We may not be able to mask MSIs, so block non-wakeup
* interrupts while we're suspended.
*/
if (cpu_suspended && (ih->ih_flags & IPL_WAKEUP) == 0)
return 0;
#ifdef MULTIPROCESSOR
if (ih->ih_flags & IPL_MPSAFE)
need_lock = 0;
else

View file

@ -1,4 +1,4 @@
/* $OpenBSD: cpu.h,v 1.170 2024/05/21 23:16:06 jsg Exp $ */
/* $OpenBSD: cpu.h,v 1.171 2024/05/29 12:21:33 kettenis Exp $ */
/* $NetBSD: cpu.h,v 1.1 2003/04/26 18:39:39 fvdl Exp $ */
/*-
@ -401,6 +401,8 @@ extern int cpu_meltdown;
extern u_int cpu_mwait_size;
extern u_int cpu_mwait_states;
int cpu_suspend_primary(void);
/* cacheinfo.c */
void x86_print_cacheinfo(struct cpu_info *);

View file

@ -1,4 +1,4 @@
/* $OpenBSD: cpu.c,v 1.116 2024/05/27 06:20:59 kettenis Exp $ */
/* $OpenBSD: cpu.c,v 1.117 2024/05/29 15:32:06 jsg Exp $ */
/*
* Copyright (c) 2016 Dale Rahn <drahn@dalerahn.com>
@ -87,6 +87,8 @@
#define CPU_PART_CORTEX_A720 0xd81
#define CPU_PART_CORTEX_X4 0xd82
#define CPU_PART_NEOVERSE_V3 0xd84
#define CPU_PART_CORTEX_X925 0xd85
#define CPU_PART_CORTEX_A725 0xd87
#define CPU_PART_CORTEX_A520AE 0xd88
#define CPU_PART_CORTEX_A720AE 0xd89
#define CPU_PART_NEOVERSE_N3 0xd8e
@ -159,11 +161,13 @@ struct cpu_cores cpu_cores_arm[] = {
{ CPU_PART_CORTEX_A715, "Cortex-A715" },
{ CPU_PART_CORTEX_A720, "Cortex-A720" },
{ CPU_PART_CORTEX_A720AE, "Cortex-A720AE" },
{ CPU_PART_CORTEX_A725, "Cortex-A725" },
{ CPU_PART_CORTEX_X1, "Cortex-X1" },
{ CPU_PART_CORTEX_X1C, "Cortex-X1C" },
{ CPU_PART_CORTEX_X2, "Cortex-X2" },
{ CPU_PART_CORTEX_X3, "Cortex-X3" },
{ CPU_PART_CORTEX_X4, "Cortex-X4" },
{ CPU_PART_CORTEX_X925, "Cortex-X925" },
{ CPU_PART_NEOVERSE_E1, "Neoverse E1" },
{ CPU_PART_NEOVERSE_N1, "Neoverse N1" },
{ CPU_PART_NEOVERSE_N2, "Neoverse N2" },

View file

@ -1,4 +1,4 @@
/* $OpenBSD: cpu.c,v 1.114 2023/10/24 13:20:10 claudio Exp $ */
/* $OpenBSD: cpu.c,v 1.115 2024/05/29 12:21:33 kettenis Exp $ */
/* $NetBSD: cpu.c,v 1.1.2.7 2000/06/26 02:04:05 sommerfeld Exp $ */
/*-
@ -925,3 +925,5 @@ wbinvd_on_all_cpus(void)
return 0;
}
#endif
int cpu_suspended;

View file

@ -1,4 +1,4 @@
# $OpenBSD: files,v 1.731 2024/04/10 13:59:05 naddy Exp $
# $OpenBSD: files,v 1.732 2024/05/29 13:56:49 mglocker Exp $
# $NetBSD: files,v 1.87 1996/05/19 17:17:50 jonathan Exp $
# @(#)files.newconf 7.5 (Berkeley) 5/10/93
@ -551,8 +551,7 @@ device qciic: i2cbus
# UFS HC
device ufshci: scsi
#device ufshci
file dev/ic/ufshci.c ufshci
file dev/ic/ufshci.c ufshci needs-flag
# legitimate pseudo-devices
pseudo-device vnd: disk

View file

@ -1,4 +1,4 @@
/* $OpenBSD: acpi.c,v 1.428 2024/05/13 19:56:37 kettenis Exp $ */
/* $OpenBSD: acpi.c,v 1.429 2024/05/29 12:21:33 kettenis Exp $ */
/*
* Copyright (c) 2005 Thorsten Lockert <tholo@sigmasoft.com>
* Copyright (c) 2005 Jordan Hargrave <jordan@openbsd.org>
@ -2085,6 +2085,7 @@ acpi_powerdown_task(void *arg0, int dummy)
int
acpi_interrupt(void *arg)
{
extern int cpu_suspended;
struct acpi_softc *sc = (struct acpi_softc *)arg;
uint32_t processed = 0, idx, jdx;
uint16_t sts, en;
@ -2137,6 +2138,9 @@ acpi_interrupt(void *arg)
ACPI_PM1_PWRBTN_STS);
sts &= ~ACPI_PM1_PWRBTN_STS;
if (cpu_suspended)
cpu_suspended = 0;
acpi_addtask(sc, acpi_pbtn_task, sc, 0);
}
if (sts & ACPI_PM1_SLPBTN_STS) {

View file

@ -1,4 +1,4 @@
/* $OpenBSD: acpi_x86.c,v 1.20 2024/05/28 09:40:40 kettenis Exp $ */
/* $OpenBSD: acpi_x86.c,v 1.21 2024/05/29 12:21:33 kettenis Exp $ */
/*
* Copyright (c) 2005 Thorsten Lockert <tholo@sigmasoft.com>
* Copyright (c) 2005 Jordan Hargrave <jordan@openbsd.org>
@ -31,13 +31,18 @@ int
sleep_showstate(void *v, int sleepmode)
{
struct acpi_softc *sc = v;
int fallback_state = -1;
switch (sleepmode) {
case SLEEP_SUSPEND:
sc->sc_state = ACPI_STATE_S3;
#ifdef __amd64__
fallback_state = ACPI_STATE_S0; /* No S3, use S0 */
#endif
break;
case SLEEP_HIBERNATE:
sc->sc_state = ACPI_STATE_S4;
fallback_state = ACPI_STATE_S5; /* No S4, use S5 */
break;
default:
return (EOPNOTSUPP);
@ -45,10 +50,10 @@ sleep_showstate(void *v, int sleepmode)
if (sc->sc_sleeptype[sc->sc_state].slp_typa == -1 ||
sc->sc_sleeptype[sc->sc_state].slp_typb == -1) {
if (sc->sc_state == ACPI_STATE_S4) {
sc->sc_state = ACPI_STATE_S5; /* No S4, use S5 */
printf("%s: S4 unavailable, using S5\n",
sc->sc_dev.dv_xname);
if (fallback_state != -1) {
printf("%s: S%d unavailable, using S%d\n",
sc->sc_dev.dv_xname, sc->sc_state, fallback_state);
sc->sc_state = fallback_state;
} else {
printf("%s: state S%d unavailable\n",
sc->sc_dev.dv_xname, sc->sc_state);
@ -57,8 +62,10 @@ sleep_showstate(void *v, int sleepmode)
}
/* 1st suspend AML step: _TTS(tostate) */
if (aml_node_setval(sc, sc->sc_tts, sc->sc_state) != 0)
return (EINVAL);
if (sc->sc_state != ACPI_STATE_S0) {
if (aml_node_setval(sc, sc->sc_tts, sc->sc_state) != 0)
return (EINVAL);
}
acpi_indicator(sc, ACPI_SST_WAKING); /* blink */
return 0;
}
@ -69,8 +76,10 @@ sleep_setstate(void *v)
struct acpi_softc *sc = v;
/* 2nd suspend AML step: _PTS(tostate) */
if (aml_node_setval(sc, sc->sc_pts, sc->sc_state) != 0)
return (EINVAL);
if (sc->sc_state != ACPI_STATE_S0) {
if (aml_node_setval(sc, sc->sc_pts, sc->sc_state) != 0)
return (EINVAL);
}
acpi_indicator(sc, ACPI_SST_WAKING); /* blink */
return 0;
}
@ -85,7 +94,8 @@ gosleep(void *v)
acpi_indicator(sc, ACPI_SST_SLEEPING);
/* 3rd suspend AML step: _GTS(tostate) */
aml_node_setval(sc, sc->sc_gts, sc->sc_state);
if (sc->sc_state != ACPI_STATE_S0)
aml_node_setval(sc, sc->sc_gts, sc->sc_state);
/* Clear fixed event status */
acpi_write_pmreg(sc, ACPIREG_PM1_STS, 0, ACPI_PM1_ALL_STS);
@ -110,8 +120,10 @@ sleep_resume(void *v)
acpibtn_disable_psw(); /* disable _LID for wakeup */
/* 3rd resume AML step: _TTS(runstate) */
if (aml_node_setval(sc, sc->sc_tts, ACPI_STATE_S0) != 0)
return (EINVAL);
if (sc->sc_state != ACPI_STATE_S0) {
if (aml_node_setval(sc, sc->sc_tts, ACPI_STATE_S0) != 0)
return (EINVAL);
}
acpi_indicator(sc, ACPI_SST_WAKING); /* blink */
return 0;
}

View file

@ -1,4 +1,4 @@
/* $OpenBSD: tpm.c,v 1.19 2024/05/13 01:15:50 jsg Exp $ */
/* $OpenBSD: tpm.c,v 1.20 2024/05/29 12:21:33 kettenis Exp $ */
/*
* Minimal interface to Trusted Platform Module chips implementing the
@ -376,6 +376,9 @@ tpm_suspend(struct tpm_softc *sc)
uint8_t *command;
size_t commandlen;
if (sc->sc_acpi->sc_state == ACPI_STATE_S0)
return 0;
DPRINTF(("%s: saving state preparing for suspend\n",
sc->sc_dev.dv_xname));

View file

@ -1,4 +1,4 @@
/* $OpenBSD: acxvar.h,v 1.19 2008/07/21 04:12:21 kevlo Exp $ */
/* $OpenBSD: acxvar.h,v 1.20 2024/05/29 01:11:53 jsg Exp $ */
/*
* Copyright (c) 2006 Jonathan Gray <jsg@openbsd.org>
@ -469,8 +469,6 @@ struct acx_softc {
#define ACX_RADIO_RSSI_RADIA 78 /* 78db */
#define ACX_RADIO_RSSI_UNKN 0 /* unknown radio */
extern const struct ieee80211_rateset acx_rates_11b;
extern const struct ieee80211_rateset acx_rates_11g;
extern int acx_beacon_intvl;
void acx100_set_param(struct acx_softc *);

View file

@ -1,4 +1,4 @@
/* $OpenBSD: aic79xx.h,v 1.30 2022/10/21 17:45:40 kn Exp $ */
/* $OpenBSD: aic79xx.h,v 1.31 2024/05/29 00:48:15 jsg Exp $ */
/*
* Copyright (c) 2004 Milos Urbanek, Kenneth R. Westerback & Marco Peereboom
@ -1329,8 +1329,6 @@ void ahd_unbusy_tcl(struct ahd_softc *ahd, u_int tcl);
/***************************** PCI Front End *********************************/
const struct ahd_pci_identity * ahd_find_pci_device(pcireg_t, pcireg_t);
int ahd_pci_config(struct ahd_softc *,
struct ahd_pci_identity *);
int ahd_pci_test_register_access(struct ahd_softc *);
/************************** SCB and SCB queue management **********************/
@ -1405,10 +1403,6 @@ int ahd_search_qinfifo(struct ahd_softc *ahd, int target,
char channel, int lun, u_int tag,
role_t role, uint32_t status,
ahd_search_action action);
int ahd_search_disc_list(struct ahd_softc *ahd, int target,
char channel, int lun, u_int tag,
int stop_on_first, int remove,
int save_state);
void ahd_freeze_devq(struct ahd_softc *ahd, struct scb *scb);
int ahd_reset_channel(struct ahd_softc *ahd, char channel,
int initiate_reset);

View file

@ -1,4 +1,4 @@
/* $OpenBSD: aic79xx_openbsd.h,v 1.21 2020/07/28 21:33:14 krw Exp $ */
/* $OpenBSD: aic79xx_openbsd.h,v 1.22 2024/05/29 00:48:15 jsg Exp $ */
/*
* Copyright (c) 2004 Milos Urbanek, Kenneth R. Westerback & Marco Peereboom
@ -232,9 +232,6 @@ void aic_platform_scb_free(struct ahd_softc *, struct scb *);
#define aic_get_pci_function(pci) ((pci)->pa_function)
#define aic_get_pci_slot(pci) ((pci)->pa_device)
#define aic_get_pci_bus(pci) ((pci)->pa_bus)
int ahd_pci_map_registers(struct ahd_softc *);
int ahd_pci_map_int(struct ahd_softc *);
/*#endif*/
typedef enum
@ -245,15 +242,11 @@ typedef enum
AHD_POWER_STATE_D3
} ahd_power_state;
void ahd_power_state_change(struct ahd_softc *, ahd_power_state);
/********************************* Debug **************************************/
void ahd_print_path(struct ahd_softc *, struct scb *);
void ahd_platform_dump_card_state(struct ahd_softc *ahd);
/**************************** Transfer Settings *******************************/
void ahd_notify_xfer_settings_change(struct ahd_softc *,
struct ahd_devinfo *);
void ahd_platform_set_tags(struct ahd_softc *, struct ahd_devinfo *,
ahd_queue_alg);

View file

@ -1,4 +1,4 @@
/* $OpenBSD: aic7xxx_openbsd.h,v 1.31 2020/08/13 12:11:15 krw Exp $ */
/* $OpenBSD: aic7xxx_openbsd.h,v 1.32 2024/05/29 00:48:15 jsg Exp $ */
/* $NetBSD: aic7xxx_osm.h,v 1.7 2003/11/02 11:07:44 wiz Exp $ */
/*
@ -357,10 +357,6 @@ typedef enum
void ahc_power_state_change(struct ahc_softc *, ahc_power_state);
#endif
/******************************** VL/EISA *************************************/
int aic7770_map_registers(struct ahc_softc *, u_int);
int aic7770_map_int(struct ahc_softc *, int);
/********************************* Debug **************************************/
static __inline void ahc_print_path(struct ahc_softc *, struct scb *);
static __inline void ahc_platform_dump_card_state(struct ahc_softc *);
@ -379,15 +375,11 @@ ahc_platform_dump_card_state(struct ahc_softc *ahc)
ahc->features, ahc->flags, ahc->chip, ahc->bugs);
}
/**************************** Transfer Settings *******************************/
void ahc_notify_xfer_settings_change(struct ahc_softc *,
struct ahc_devinfo *);
void ahc_platform_set_tags(struct ahc_softc *, struct ahc_devinfo *, int);
/************************* Initialization/Teardown ****************************/
int ahc_map_int(struct ahc_softc *);
int ahc_attach(struct ahc_softc *);
int ahc_softc_comp(struct ahc_softc *, struct ahc_softc *);
int ahc_detach(struct device *, int);
/****************************** Interrupts ************************************/
int ahc_platform_intr(void *);

View file

@ -1,4 +1,4 @@
/* $OpenBSD: aic7xxxvar.h,v 1.38 2022/10/21 17:45:40 kn Exp $ */
/* $OpenBSD: aic7xxxvar.h,v 1.40 2024/05/29 01:11:53 jsg Exp $ */
/*
* Core definitions and data structures shareable across OS platforms.
*
@ -38,7 +38,7 @@
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGES.
*
* $Id: aic7xxxvar.h,v 1.38 2022/10/21 17:45:40 kn Exp $
* $Id: aic7xxxvar.h,v 1.40 2024/05/29 01:11:53 jsg Exp $
*
* $FreeBSD: src/sys/dev/aic7xxx/aic7xxx.h,v 1.50 2003/12/17 00:02:09 gibbs Exp $
*/
@ -1164,15 +1164,6 @@ struct ahc_pci_identity {
extern const struct ahc_pci_identity ahc_pci_ident_table[];
/***************************** VL/EISA Declarations ***************************/
struct aic7770_identity {
uint32_t full_id;
uint32_t id_mask;
const char *name;
ahc_device_setup_t *setup;
};
extern struct aic7770_identity aic7770_ident_table[];
extern const int ahc_num_aic7770_devs;
#define AHC_EISA_SLOT_OFFSET 0xc00
#define AHC_EISA_IOSIZE 0x100
@ -1184,15 +1175,8 @@ void ahc_busy_tcl(struct ahc_softc *, u_int, u_int);
/***************************** PCI Front End *********************************/
const struct ahc_pci_identity *ahc_find_pci_device(pcireg_t, pcireg_t, u_int);
int ahc_pci_config(struct ahc_softc *,
struct ahc_pci_identity *);
int ahc_pci_test_register_access(struct ahc_softc *);
/*************************** EISA/VL Front End ********************************/
struct aic7770_identity *aic7770_find_device(uint32_t);
int aic7770_config(struct ahc_softc *,
struct aic7770_identity *, u_int);
/************************** SCB and SCB queue management **********************/
int ahc_probe_scbs(struct ahc_softc *);
void ahc_run_untagged_queues(struct ahc_softc *ahc);

View file

@ -1,4 +1,4 @@
/* $OpenBSD: comvar.h,v 1.60 2024/05/12 08:42:13 jsg Exp $ */
/* $OpenBSD: comvar.h,v 1.61 2024/05/29 00:48:15 jsg Exp $ */
/* $NetBSD: comvar.h,v 1.5 1996/05/05 19:50:47 christos Exp $ */
/*
@ -147,7 +147,6 @@ void com_resume(struct com_softc *);
void comdiag(void *);
int comspeed(long, long);
u_char com_cflag2lcr(tcflag_t); /* XXX undefined */
int comparam(struct tty *, struct termios *);
void comstart(struct tty *);
void comsoft(void *);

View file

@ -1,4 +1,4 @@
/* $OpenBSD: dp8390var.h,v 1.13 2022/01/09 05:42:38 jsg Exp $ */
/* $OpenBSD: dp8390var.h,v 1.14 2024/05/29 00:48:15 jsg Exp $ */
/* $NetBSD: dp8390var.h,v 1.8 1998/08/12 07:19:09 scottr Exp $ */
/*
@ -173,4 +173,3 @@ void dp8390_rint(struct dp8390_softc *);
void dp8390_getmcaf(struct arpcom *, u_int8_t *);
struct mbuf *dp8390_get(struct dp8390_softc *, int, u_short);
void dp8390_read(struct dp8390_softc *, int, u_short);

View file

@ -1,4 +1,4 @@
/* $OpenBSD: qwx.c,v 1.61 2024/05/28 13:02:45 jsg Exp $ */
/* $OpenBSD: qwx.c,v 1.62 2024/05/29 07:24:26 stsp Exp $ */
/*
* Copyright 2023 Stefan Sperling <stsp@openbsd.org>
@ -157,6 +157,7 @@ int qwx_wmi_vdev_install_key(struct qwx_softc *,
struct wmi_vdev_install_key_arg *, uint8_t);
int qwx_dp_peer_rx_pn_replay_config(struct qwx_softc *, struct qwx_vif *,
struct ieee80211_node *, struct ieee80211_key *, int);
void qwx_setkey_clear(struct qwx_softc *);
int qwx_scan(struct qwx_softc *);
void qwx_scan_abort(struct qwx_softc *);
@ -183,7 +184,45 @@ qwx_init(struct ifnet *ifp)
struct ieee80211com *ic = &sc->sc_ic;
sc->fw_mode = ATH11K_FIRMWARE_MODE_NORMAL;
sc->crypto_mode = ATH11K_CRYPT_MODE_HW;
/*
* There are several known hardware/software crypto issues
* on wcn6855 devices, firmware 0x1106196e. It is unclear
* if these are driver or firmware bugs.
*
* 1) Broadcast/Multicast frames will only be received on
* encrypted networks if hardware crypto is used and a
* CCMP group key is used. Otherwise such frames never
* even trigger an interrupt. This breaks ARP and IPv6.
* This issue is known to affect the Linux ath11k vendor
* driver when software crypto mode is selected.
* Workaround: Use hardware crypto on WPA2 networks.
* However, even with hardware crypto broadcast frames
* are never received if TKIP is used as the WPA2 group
* cipher and we have no workaround for this.
*
* 2) Adding WEP keys for hardware crypto crashes the firmware.
* Presumably, lack of WEP support is deliberate because the
* Linux ath11k vendor driver rejects attempts to install
* WEP keys to hardware.
* Workaround: Use software crypto if WEP is enabled.
* This suffers from the broadcast issues mentioned above.
*
* 3) A WPA1 group key handshake message from the AP is never
* received if hardware crypto is used.
* Workaround: Use software crypto if WPA1 is enabled.
* This suffers from the broadcast issues mentioned above,
* even on WPA2 networks when WPA1 and WPA2 are both enabled.
* On OpenBSD, WPA1 is disabled by default.
*
* The only known fully working configurations are unencrypted
* networks, and WPA2/CCMP-only networks provided WPA1 remains
* disabled.
*/
if ((ic->ic_flags & IEEE80211_F_WEPON) ||
(ic->ic_rsnprotos & IEEE80211_PROTO_WPA))
sc->crypto_mode = ATH11K_CRYPT_MODE_SW;
else
sc->crypto_mode = ATH11K_CRYPT_MODE_HW;
sc->frame_mode = ATH11K_HW_TXRX_NATIVE_WIFI;
ic->ic_state = IEEE80211_S_INIT;
sc->ns_nstate = IEEE80211_S_INIT;
@ -291,6 +330,8 @@ qwx_stop(struct ifnet *ifp)
qwx_del_task(sc, systq, &sc->setkey_task);
refcnt_finalize(&sc->task_refs, "qwxstop");
qwx_setkey_clear(sc);
clear_bit(ATH11K_FLAG_CRASH_FLUSH, sc->sc_flags);
ifp->if_timer = sc->sc_tx_timer = 0;
@ -529,8 +570,8 @@ qwx_set_key(struct ieee80211com *ic, struct ieee80211_node *ni,
struct qwx_softc *sc = ic->ic_softc;
if (test_bit(ATH11K_FLAG_HW_CRYPTO_DISABLED, sc->sc_flags) ||
(k->k_cipher != IEEE80211_CIPHER_CCMP &&
k->k_cipher != IEEE80211_CIPHER_TKIP))
k->k_cipher == IEEE80211_CIPHER_WEP40 ||
k->k_cipher == IEEE80211_CIPHER_WEP104)
return ieee80211_set_key(ic, ni, k);
return qwx_queue_setkey_cmd(ic, ni, k, QWX_ADD_KEY);
@ -543,8 +584,8 @@ qwx_delete_key(struct ieee80211com *ic, struct ieee80211_node *ni,
struct qwx_softc *sc = ic->ic_softc;
if (test_bit(ATH11K_FLAG_HW_CRYPTO_DISABLED, sc->sc_flags) ||
(k->k_cipher != IEEE80211_CIPHER_CCMP &&
k->k_cipher != IEEE80211_CIPHER_TKIP)) {
k->k_cipher == IEEE80211_CIPHER_WEP40 ||
k->k_cipher == IEEE80211_CIPHER_WEP104) {
ieee80211_delete_key(ic, ni, k);
return;
}
@ -757,6 +798,24 @@ qwx_setkey_task(void *arg)
splx(s);
}
void
qwx_setkey_clear(struct qwx_softc *sc)
{
struct ieee80211com *ic = &sc->sc_ic;
struct qwx_setkey_task_arg *a;
while (sc->setkey_nkeys > 0) {
a = &sc->setkey_arg[sc->setkey_tail];
ieee80211_release_node(ic, a->ni);
a->ni = NULL;
sc->setkey_tail = (sc->setkey_tail + 1) %
nitems(sc->setkey_arg);
sc->setkey_nkeys--;
}
memset(sc->setkey_arg, 0, sizeof(sc->setkey_arg));
sc->setkey_cur = sc->setkey_tail = sc->setkey_nkeys = 0;
}
int
qwx_newstate(struct ieee80211com *ic, enum ieee80211_state nstate, int arg)
{
@ -773,21 +832,11 @@ qwx_newstate(struct ieee80211com *ic, enum ieee80211_state nstate, int arg)
nstate != IEEE80211_S_AUTH)
return 0;
if (ic->ic_state == IEEE80211_S_RUN) {
struct qwx_setkey_task_arg *a;
#if 0
qwx_del_task(sc, systq, &sc->ba_task);
#endif
qwx_del_task(sc, systq, &sc->setkey_task);
while (sc->setkey_nkeys > 0) {
a = &sc->setkey_arg[sc->setkey_tail];
ieee80211_release_node(ic, a->ni);
a->ni = NULL;
sc->setkey_tail = (sc->setkey_tail + 1) %
nitems(sc->setkey_arg);
sc->setkey_nkeys--;
}
memset(sc->setkey_arg, 0, sizeof(sc->setkey_arg));
sc->setkey_cur = sc->setkey_tail = sc->setkey_nkeys = 0;
qwx_setkey_clear(sc);
#if 0
qwx_del_task(sc, systq, &sc->bgscan_done_task);
#endif
@ -16021,13 +16070,15 @@ qwx_dp_rx_h_reo_err(struct qwx_softc *sc, struct qwx_rx_msdu *msdu,
int
qwx_dp_rx_h_rxdma_err(struct qwx_softc *sc, struct qwx_rx_msdu *msdu)
{
struct ieee80211com *ic = &sc->sc_ic;
int drop = 0;
#if 0
ar->ab->soc_stats.rxdma_error[rxcb->err_code]++;
#endif
switch (msdu->err_code) {
case HAL_REO_ENTR_RING_RXDMA_ECODE_TKIP_MIC_ERR:
drop = 1; /* OpenBSD uses TKIP in software crypto mode only */
ic->ic_stats.is_rx_locmicfail++;
drop = 1;
break;
default:
/* TODO: Review other rxdma error code to check if anything is
@ -24193,7 +24244,7 @@ qwx_dp_tx(struct qwx_softc *sc, struct qwx_vif *arvif, uint8_t pdev_id,
void *hal_tcl_desc;
uint8_t pool_id;
uint8_t hal_ring_id;
int ret, msdu_id;
int ret, msdu_id, off;
uint32_t ring_selector = 0;
uint8_t ring_map = 0;
@ -24238,22 +24289,34 @@ qwx_dp_tx(struct qwx_softc *sc, struct qwx_vif *arvif, uint8_t pdev_id,
if ((wh->i_fc[1] & IEEE80211_FC1_PROTECTED) &&
ti.encap_type == HAL_TCL_ENCAP_TYPE_RAW) {
k = ieee80211_get_txkey(ic, wh, ni);
switch (k->k_cipher) {
case IEEE80211_CIPHER_CCMP:
ti.encrypt_type = HAL_ENCRYPT_TYPE_CCMP_128;
m->m_pkthdr.len += IEEE80211_CCMP_MICLEN;
break;
case IEEE80211_CIPHER_TKIP:
ti.encrypt_type = HAL_ENCRYPT_TYPE_TKIP_MIC;
m->m_pkthdr.len += IEEE80211_TKIP_MICLEN;
break;
default:
/* Fallback to software crypto for other ciphers. */
if (test_bit(ATH11K_FLAG_HW_CRYPTO_DISABLED, sc->sc_flags)) {
ti.encrypt_type = HAL_ENCRYPT_TYPE_OPEN;
break;
} else {
switch (k->k_cipher) {
case IEEE80211_CIPHER_CCMP:
ti.encrypt_type = HAL_ENCRYPT_TYPE_CCMP_128;
if (m_makespace(m, m->m_pkthdr.len,
IEEE80211_CCMP_MICLEN, &off) == NULL) {
m_freem(m);
return ENOSPC;
}
break;
case IEEE80211_CIPHER_TKIP:
ti.encrypt_type = HAL_ENCRYPT_TYPE_TKIP_MIC;
if (m_makespace(m, m->m_pkthdr.len,
IEEE80211_TKIP_MICLEN, &off) == NULL) {
m_freem(m);
return ENOSPC;
}
break;
default:
ti.encrypt_type = HAL_ENCRYPT_TYPE_OPEN;
break;
}
}
if (ti.encrypt_type == HAL_ENCRYPT_TYPE_OPEN) {
/* Using software crypto. */
if ((m = ieee80211_encrypt(ic, m, k)) == NULL)
return ENOBUFS;
/* 802.11 header may have moved. */

View file

@ -1,4 +1,4 @@
/* $OpenBSD: stivar.h,v 1.27 2021/05/01 20:04:33 kettenis Exp $ */
/* $OpenBSD: stivar.h,v 1.28 2024/05/29 00:48:15 jsg Exp $ */
/*
* Copyright (c) 2000-2003 Michael Shalayeff
@ -138,8 +138,6 @@ struct sti_softc {
int sti_attach_common(struct sti_softc *, bus_space_tag_t, bus_space_tag_t,
bus_space_handle_t, u_int);
int sti_cnattach(struct sti_rom *, struct sti_screen *, bus_space_tag_t,
bus_addr_t *, u_int);
void sti_describe(struct sti_softc *);
void sti_end_attach(void *);
u_int sti_rom_size(bus_space_tag_t, bus_space_handle_t);

View file

@ -1,4 +1,4 @@
/* $OpenBSD: ufshcivar.h,v 1.8 2024/05/24 09:51:14 mglocker Exp $ */
/* $OpenBSD: ufshcivar.h,v 1.9 2024/05/29 00:48:15 jsg Exp $ */
/*
* Copyright (c) 2022 Marcus Glocker <mglocker@openbsd.org>
@ -82,6 +82,5 @@ struct ufshci_softc {
};
int ufshci_intr(void *);
void ufshci_attach_hook(struct device *); /* XXX: Only for testing */
int ufshci_attach(struct ufshci_softc *);
int ufshci_activate(struct ufshci_softc *, int);

View file

@ -1,4 +1,4 @@
/* $OpenBSD: wdcvar.h,v 1.57 2022/01/09 05:42:42 jsg Exp $ */
/* $OpenBSD: wdcvar.h,v 1.58 2024/05/29 00:48:15 jsg Exp $ */
/* $NetBSD: wdcvar.h,v 1.17 1999/04/11 20:50:29 bouyer Exp $ */
/*-
@ -305,7 +305,6 @@ void wdc_delref(struct channel_softc *);
void wdc_disable_intr(struct channel_softc *);
void wdc_enable_intr(struct channel_softc *);
int wdc_select_drive(struct channel_softc *, int, int);
void wdc_set_drive(struct channel_softc *, int drive);
void wdc_output_bytes(struct ata_drive_datas *drvp, void *, unsigned int);
void wdc_input_bytes(struct ata_drive_datas *drvp, void *, unsigned int);

View file

@ -1,4 +1,4 @@
/* $OpenBSD: gusvar.h,v 1.13 2022/11/02 10:41:34 kn Exp $ */
/* $OpenBSD: gusvar.h,v 1.14 2024/05/29 00:48:14 jsg Exp $ */
/* $NetBSD: gus.c,v 1.51 1998/01/25 23:48:06 mycroft Exp $ */
/*-
@ -310,7 +310,6 @@ void gusmax_close(void *);
int gusintr(void *);
int gus_set_in_gain(caddr_t, u_int, u_char);
int gus_get_in_gain(caddr_t);
int gus_set_out_gain(caddr_t, u_int, u_char);
int gus_get_out_gain(caddr_t);
int gus_set_params(void *, int, int, struct audio_params *, struct audio_params *);
int gusmax_set_params(void *, int, int, struct audio_params *, struct audio_params *);

View file

@ -1,4 +1,4 @@
/* $OpenBSD: if_athn_usb.c,v 1.66 2024/05/23 03:21:08 jsg Exp $ */
/* $OpenBSD: if_athn_usb.c,v 1.67 2024/05/29 07:27:33 stsp Exp $ */
/*-
* Copyright (c) 2011 Damien Bergamini <damien.bergamini@free.fr>
@ -1640,6 +1640,11 @@ athn_usb_set_key(struct ieee80211com *ic, struct ieee80211_node *ni,
(IFF_UP | IFF_RUNNING))
return (0);
if (k->k_cipher != IEEE80211_CIPHER_CCMP) {
/* Use software crypto for ciphers other than CCMP. */
return ieee80211_set_key(ic, ni, k);
}
/* Do it in a process context. */
cmd.ni = (ni != NULL) ? ieee80211_ref_node(ni) : NULL;
cmd.key = k;
@ -1682,6 +1687,11 @@ athn_usb_delete_key(struct ieee80211com *ic, struct ieee80211_node *ni,
ic->ic_state != IEEE80211_S_RUN)
return; /* Nothing to do. */
if (k->k_cipher != IEEE80211_CIPHER_CCMP) {
ieee80211_delete_key(ic, ni, k);
return;
}
/* Do it in a process context. */
cmd.ni = (ni != NULL) ? ieee80211_ref_node(ni) : NULL;
cmd.key = k;

View file

@ -1,4 +1,4 @@
$OpenBSD: usbdevs,v 1.765 2024/05/23 08:06:22 kevlo Exp $
$OpenBSD: usbdevs,v 1.766 2024/05/29 06:48:43 jsg Exp $
/* $NetBSD: usbdevs,v 1.322 2003/05/10 17:47:14 hamajima Exp $ */
/*
@ -1023,6 +1023,7 @@ product APPLE IPHONE_4S 0x12a0 iPhone 4S
product APPLE IPHONE_6 0x12a8 iPhone 6
product APPLE ETHERNET 0x1402 Ethernet A1277
product APPLE BLUETOOTH2 0x8205 Bluetooth
product APPLE BLUETOOTH3 0x8207 Bluetooth
product APPLE BLUETOOTH 0x8300 Bluetooth
product APPLE ISIGHT_1 0x8501 iSight
product APPLE ISIGHT 0x8502 iSight

View file

@ -1,10 +1,10 @@
/* $OpenBSD: usbdevs.h,v 1.777 2024/05/23 08:06:45 kevlo Exp $ */
/* $OpenBSD: usbdevs.h,v 1.778 2024/05/29 06:49:38 jsg Exp $ */
/*
* THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT.
*
* generated from:
* OpenBSD: usbdevs,v 1.765 2024/05/23 08:06:22 kevlo Exp
* OpenBSD: usbdevs,v 1.766 2024/05/29 06:48:43 jsg Exp
*/
/* $NetBSD: usbdevs,v 1.322 2003/05/10 17:47:14 hamajima Exp $ */
@ -1030,6 +1030,7 @@
#define USB_PRODUCT_APPLE_IPHONE_6 0x12a8 /* iPhone 6 */
#define USB_PRODUCT_APPLE_ETHERNET 0x1402 /* Ethernet A1277 */
#define USB_PRODUCT_APPLE_BLUETOOTH2 0x8205 /* Bluetooth */
#define USB_PRODUCT_APPLE_BLUETOOTH3 0x8207 /* Bluetooth */
#define USB_PRODUCT_APPLE_BLUETOOTH 0x8300 /* Bluetooth */
#define USB_PRODUCT_APPLE_ISIGHT_1 0x8501 /* iSight */
#define USB_PRODUCT_APPLE_ISIGHT 0x8502 /* iSight */

View file

@ -1,10 +1,10 @@
/* $OpenBSD: usbdevs_data.h,v 1.771 2024/05/23 08:06:45 kevlo Exp $ */
/* $OpenBSD: usbdevs_data.h,v 1.772 2024/05/29 06:49:38 jsg Exp $ */
/*
* THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT.
*
* generated from:
* OpenBSD: usbdevs,v 1.765 2024/05/23 08:06:22 kevlo Exp
* OpenBSD: usbdevs,v 1.766 2024/05/29 06:48:43 jsg Exp
*/
/* $NetBSD: usbdevs,v 1.322 2003/05/10 17:47:14 hamajima Exp $ */
@ -1001,6 +1001,10 @@ const struct usb_known_product usb_known_products[] = {
USB_VENDOR_APPLE, USB_PRODUCT_APPLE_BLUETOOTH2,
"Bluetooth",
},
{
USB_VENDOR_APPLE, USB_PRODUCT_APPLE_BLUETOOTH3,
"Bluetooth",
},
{
USB_VENDOR_APPLE, USB_PRODUCT_APPLE_BLUETOOTH,
"Bluetooth",

View file

@ -1,4 +1,4 @@
/* $OpenBSD: wsmux.c,v 1.57 2024/03/25 13:01:49 mvs Exp $ */
/* $OpenBSD: wsmux.c,v 1.58 2024/05/29 06:39:13 jsg Exp $ */
/* $NetBSD: wsmux.c,v 1.37 2005/04/30 03:47:12 augustss Exp $ */
/*
@ -216,7 +216,7 @@ wsmuxopen(dev_t dev, int flags, int mode, struct proc *p)
error = wsmux_do_open(sc, evar);
if (error)
wsevent_fini(evar);
wsevent_fini(evar);
return (error);
}

View file

@ -1,4 +1,4 @@
/* $OpenBSD: pipex_local.h,v 1.51 2024/01/23 17:57:21 mvs Exp $ */
/* $OpenBSD: pipex_local.h,v 1.52 2024/05/29 00:48:15 jsg Exp $ */
/*
* Copyright (c) 2009 Internet Initiative Japan Inc.
@ -468,7 +468,6 @@ struct mbuf *ip_is_idle_packet (struct mbuf *, int *);
void pipex_session_log (struct pipex_session *, int, const char *, ...) __attribute__((__format__(__printf__,3,4)));
uint32_t pipex_sockaddr_hash_key(struct sockaddr *);
int pipex_sockaddr_compar_addr(struct sockaddr *, struct sockaddr *);
int pipex_ppp_enqueue (struct mbuf *, struct pipex_session *, struct mbuf_queue *);
void pipex_timer_start (void);
void pipex_timer_stop (void);
void pipex_timer (void *);

View file

@ -1,4 +1,4 @@
/* $OpenBSD: ieee80211_proto.h,v 1.48 2022/03/14 15:07:24 stsp Exp $ */
/* $OpenBSD: ieee80211_proto.h,v 1.49 2024/05/29 00:48:15 jsg Exp $ */
/* $NetBSD: ieee80211_proto.h,v 1.3 2003/10/13 04:23:56 dyoung Exp $ */
/*-
@ -119,8 +119,6 @@ extern u_int8_t *ieee80211_add_capinfo(u_int8_t *, struct ieee80211com *,
extern u_int8_t *ieee80211_add_ssid(u_int8_t *, const u_int8_t *, u_int);
extern u_int8_t *ieee80211_add_rates(u_int8_t *,
const struct ieee80211_rateset *);
extern u_int8_t *ieee80211_add_fh_params(u_int8_t *, struct ieee80211com *,
const struct ieee80211_node *);
extern u_int8_t *ieee80211_add_ds_params(u_int8_t *, struct ieee80211com *,
const struct ieee80211_node *);
extern u_int8_t *ieee80211_add_tim(u_int8_t *, struct ieee80211com *);