sync with OpenBSD -current
This commit is contained in:
parent
3af7aba2fd
commit
222e583e28
80 changed files with 1944 additions and 657 deletions
|
@ -1,4 +1,4 @@
|
|||
/* $OpenBSD: acpi_machdep.c,v 1.108 2023/06/07 04:46:09 deraadt Exp $ */
|
||||
/* $OpenBSD: acpi_machdep.c,v 1.109 2024/05/26 13:37:31 kettenis Exp $ */
|
||||
/*
|
||||
* Copyright (c) 2005 Thorsten Lockert <tholo@sigmasoft.com>
|
||||
*
|
||||
|
@ -333,7 +333,8 @@ acpi_attach_machdep(struct acpi_softc *sc)
|
|||
extern void (*cpuresetfn)(void);
|
||||
|
||||
sc->sc_interrupt = isa_intr_establish(NULL, sc->sc_fadt->sci_int,
|
||||
IST_LEVEL, IPL_BIO, acpi_interrupt, sc, sc->sc_dev.dv_xname);
|
||||
IST_LEVEL, IPL_BIO | IPL_WAKEUP, acpi_interrupt,
|
||||
sc, sc->sc_dev.dv_xname);
|
||||
cpuresetfn = acpi_reset;
|
||||
|
||||
#ifndef SMALL_KERNEL
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $OpenBSD: intr.c,v 1.56 2024/01/19 18:38:16 kettenis Exp $ */
|
||||
/* $OpenBSD: intr.c,v 1.57 2024/05/26 13:37:31 kettenis Exp $ */
|
||||
/* $NetBSD: intr.c,v 1.3 2003/03/03 22:16:20 fvdl Exp $ */
|
||||
|
||||
/*
|
||||
|
@ -354,8 +354,8 @@ intr_establish(int legacy_irq, struct pic *pic, int pin, int type, int level,
|
|||
panic("intr_establish: non-legacy IRQ on i8259");
|
||||
#endif
|
||||
|
||||
flags = level & IPL_MPSAFE;
|
||||
level &= ~IPL_MPSAFE;
|
||||
flags = level & (IPL_MPSAFE | IPL_WAKEUP);
|
||||
level &= ~(IPL_MPSAFE | IPL_WAKEUP);
|
||||
|
||||
KASSERT(level <= IPL_TTY || level >= IPL_CLOCK || flags & IPL_MPSAFE);
|
||||
|
||||
|
@ -694,6 +694,52 @@ intr_barrier(void *cookie)
|
|||
sched_barrier(ih->ih_cpu);
|
||||
}
|
||||
|
||||
#ifdef SUSPEND
|
||||
|
||||
void
|
||||
intr_enable_wakeup(void)
|
||||
{
|
||||
struct cpu_info *ci = curcpu();
|
||||
struct pic *pic;
|
||||
int irq, pin;
|
||||
|
||||
for (irq = 0; irq < MAX_INTR_SOURCES; irq++) {
|
||||
if (ci->ci_isources[irq] == NULL)
|
||||
continue;
|
||||
|
||||
if (ci->ci_isources[irq]->is_handlers->ih_flags & IPL_WAKEUP)
|
||||
continue;
|
||||
|
||||
pic = ci->ci_isources[irq]->is_pic;
|
||||
pin = ci->ci_isources[irq]->is_pin;
|
||||
if (pic->pic_hwmask)
|
||||
pic->pic_hwmask(pic, pin);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
intr_disable_wakeup(void)
|
||||
{
|
||||
struct cpu_info *ci = curcpu();
|
||||
struct pic *pic;
|
||||
int irq, pin;
|
||||
|
||||
for (irq = 0; irq < MAX_INTR_SOURCES; irq++) {
|
||||
if (ci->ci_isources[irq] == NULL)
|
||||
continue;
|
||||
|
||||
if (ci->ci_isources[irq]->is_handlers->ih_flags & IPL_WAKEUP)
|
||||
continue;
|
||||
|
||||
pic = ci->ci_isources[irq]->is_pic;
|
||||
pin = ci->ci_isources[irq]->is_pin;
|
||||
if (pic->pic_hwunmask)
|
||||
pic->pic_hwunmask(pic, pin);
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Add a mask to cpl, and return the old value of cpl.
|
||||
*/
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $OpenBSD: intr.h,v 1.33 2021/12/14 18:16:14 deraadt Exp $ */
|
||||
/* $OpenBSD: intr.h,v 1.34 2024/05/26 13:37:31 kettenis Exp $ */
|
||||
/* $NetBSD: intr.h,v 1.2 2003/05/04 22:01:56 fvdl Exp $ */
|
||||
|
||||
/*-
|
||||
|
@ -206,6 +206,8 @@ int intr_handler(struct intrframe *, struct intrhand *);
|
|||
void cpu_intr_init(struct cpu_info *);
|
||||
void intr_printconfig(void);
|
||||
void intr_barrier(void *);
|
||||
void intr_enable_wakeup(void);
|
||||
void intr_disable_wakeup(void);
|
||||
|
||||
#ifdef MULTIPROCESSOR
|
||||
void x86_send_ipi(struct cpu_info *, int);
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $OpenBSD: intrdefs.h,v 1.23 2024/01/04 20:50:43 kettenis Exp $ */
|
||||
/* $OpenBSD: intrdefs.h,v 1.24 2024/05/26 13:37:31 kettenis Exp $ */
|
||||
/* $NetBSD: intrdefs.h,v 1.2 2003/05/04 22:01:56 fvdl Exp $ */
|
||||
|
||||
#ifndef _AMD64_INTRDEFS_H
|
||||
|
@ -36,6 +36,7 @@
|
|||
|
||||
#define IPL_MPFLOOR IPL_TTY
|
||||
#define IPL_MPSAFE 0x100
|
||||
#define IPL_WAKEUP 0x200
|
||||
|
||||
/* Interrupt sharing types. */
|
||||
#define IST_NONE 0 /* none */
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $OpenBSD: cpu.c,v 1.114 2024/04/13 14:19:39 kettenis Exp $ */
|
||||
/* $OpenBSD: cpu.c,v 1.116 2024/05/27 06:20:59 kettenis Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 2016 Dale Rahn <drahn@dalerahn.com>
|
||||
|
@ -742,6 +742,37 @@ cpu_identify(struct cpu_info *ci)
|
|||
*/
|
||||
id = READ_SPECIALREG(id_aa64isar1_el1);
|
||||
|
||||
if (ID_AA64ISAR1_LS64(id) >= ID_AA64ISAR1_LS64_BASE) {
|
||||
printf("%sLS64", sep);
|
||||
sep = ",";
|
||||
}
|
||||
if (ID_AA64ISAR1_LS64(id) >= ID_AA64ISAR1_LS64_V)
|
||||
printf("+V");
|
||||
if (ID_AA64ISAR1_LS64(id) >= ID_AA64ISAR1_LS64_ACCDATA)
|
||||
printf("+ACCDATA");
|
||||
|
||||
if (ID_AA64ISAR1_XS(id) >= ID_AA64ISAR1_XS_IMPL) {
|
||||
printf("%sXS", sep);
|
||||
sep = ",";
|
||||
}
|
||||
|
||||
if (ID_AA64ISAR1_I8MM(id) >= ID_AA64ISAR1_I8MM_IMPL) {
|
||||
printf("%sI8MM", sep);
|
||||
sep = ",";
|
||||
}
|
||||
|
||||
if (ID_AA64ISAR1_DGH(id) >= ID_AA64ISAR1_DGH_IMPL) {
|
||||
printf("%sDGH", sep);
|
||||
sep = ",";
|
||||
}
|
||||
|
||||
if (ID_AA64ISAR1_BF16(id) >= ID_AA64ISAR1_BF16_BASE) {
|
||||
printf("%sBF16", sep);
|
||||
sep = ",";
|
||||
}
|
||||
if (ID_AA64ISAR1_BF16(id) >= ID_AA64ISAR1_BF16_EBF)
|
||||
printf("+EBF");
|
||||
|
||||
if (ID_AA64ISAR1_SPECRES(id) >= ID_AA64ISAR1_SPECRES_IMPL) {
|
||||
printf("%sSPECRES", sep);
|
||||
sep = ",";
|
||||
|
@ -1526,7 +1557,8 @@ cpu_suspend_primary(void)
|
|||
* wake us up by clearing the flag.
|
||||
*/
|
||||
cpu_suspended = 1;
|
||||
intr_enable_wakeup();
|
||||
arm_intr_func.setipl(IPL_NONE);
|
||||
intr_enable();
|
||||
|
||||
while (cpu_suspended) {
|
||||
#if NPSCI > 0
|
||||
|
@ -1542,7 +1574,8 @@ cpu_suspend_primary(void)
|
|||
}
|
||||
|
||||
resume:
|
||||
intr_disable_wakeup();
|
||||
intr_disable();
|
||||
arm_intr_func.setipl(IPL_HIGH);
|
||||
|
||||
/* Unmask clock interrupts. */
|
||||
WRITE_SPECIALREG(cntv_ctl_el0,
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $OpenBSD: intr.c,v 1.27 2022/12/21 22:30:42 kettenis Exp $ */
|
||||
/* $OpenBSD: intr.c,v 1.28 2024/05/26 13:37:31 kettenis Exp $ */
|
||||
/*
|
||||
* Copyright (c) 2011 Dale Rahn <drahn@openbsd.org>
|
||||
*
|
||||
|
@ -888,15 +888,11 @@ intr_enable_wakeup(void)
|
|||
{
|
||||
if (arm_intr_func.enable_wakeup)
|
||||
arm_intr_func.enable_wakeup();
|
||||
arm_intr_func.setipl(IPL_NONE);
|
||||
intr_enable();
|
||||
}
|
||||
|
||||
void
|
||||
intr_disable_wakeup(void)
|
||||
{
|
||||
intr_disable();
|
||||
arm_intr_func.setipl(IPL_HIGH);
|
||||
if (arm_intr_func.disable_wakeup)
|
||||
arm_intr_func.disable_wakeup();
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $OpenBSD: pmap.c,v 1.102 2024/03/27 15:40:50 kurt Exp $ */
|
||||
/* $OpenBSD: pmap.c,v 1.103 2024/05/28 15:16:45 claudio Exp $ */
|
||||
/*
|
||||
* Copyright (c) 2008-2009,2014-2016 Dale Rahn <drahn@dalerahn.com>
|
||||
*
|
||||
|
@ -217,7 +217,7 @@ const uint64_t ap_bits_kern[8] = {
|
|||
int pmap_nasid = (1 << 8);
|
||||
|
||||
uint32_t pmap_asid[PMAP_MAX_NASID / 32];
|
||||
uint64_t pmap_asid_gen = PMAP_MAX_NASID;
|
||||
unsigned long pmap_asid_gen = PMAP_MAX_NASID;
|
||||
struct mutex pmap_asid_mtx = MUTEX_INITIALIZER(IPL_HIGH);
|
||||
|
||||
int
|
||||
|
@ -227,6 +227,8 @@ pmap_find_asid(pmap_t pm)
|
|||
int asid, bit;
|
||||
int retry;
|
||||
|
||||
MUTEX_ASSERT_LOCKED(&pmap_asid_mtx);
|
||||
|
||||
/* Attempt to re-use the old ASID. */
|
||||
asid = pm->pm_asid & PMAP_ASID_MASK;
|
||||
bit = asid & (32 - 1);
|
||||
|
@ -262,23 +264,26 @@ pmap_rollover_asid(pmap_t pm)
|
|||
{
|
||||
struct cpu_info *ci;
|
||||
CPU_INFO_ITERATOR cii;
|
||||
unsigned long gen;
|
||||
int asid, bit;
|
||||
|
||||
SCHED_ASSERT_LOCKED();
|
||||
MUTEX_ASSERT_LOCKED(&pmap_asid_mtx);
|
||||
|
||||
/* Start a new generation. Mark ASID 0 as in-use again. */
|
||||
pmap_asid_gen += PMAP_MAX_NASID;
|
||||
gen = atomic_add_long_nv(&pmap_asid_gen, PMAP_MAX_NASID);
|
||||
memset(pmap_asid, 0, (pmap_nasid / 32) * sizeof(uint32_t));
|
||||
pmap_asid[0] |= (3U << 0);
|
||||
|
||||
/*
|
||||
* Carry over all the ASIDs that are currently active into the
|
||||
* new generation and reserve them.
|
||||
* CPUs in cpu_switchto() will spin in pmap_setttb() waiting for
|
||||
* the mutex. In that case an old ASID will be carried over but
|
||||
* that is not problematic.
|
||||
*/
|
||||
CPU_INFO_FOREACH(cii, ci) {
|
||||
asid = ci->ci_curpm->pm_asid & PMAP_ASID_MASK;
|
||||
ci->ci_curpm->pm_asid = asid | pmap_asid_gen;
|
||||
ci->ci_curpm->pm_asid = asid | gen;
|
||||
bit = (asid & (32 - 1));
|
||||
pmap_asid[asid / 32] |= (3U << bit);
|
||||
}
|
||||
|
@ -286,7 +291,7 @@ pmap_rollover_asid(pmap_t pm)
|
|||
/* Flush the TLBs on all CPUs. */
|
||||
cpu_tlb_flush();
|
||||
|
||||
if ((pm->pm_asid & ~PMAP_ASID_MASK) == pmap_asid_gen)
|
||||
if ((pm->pm_asid & ~PMAP_ASID_MASK) == gen)
|
||||
return pm->pm_asid & PMAP_ASID_MASK;
|
||||
|
||||
return pmap_find_asid(pm);
|
||||
|
@ -1397,13 +1402,9 @@ void
|
|||
pmap_activate(struct proc *p)
|
||||
{
|
||||
pmap_t pm = p->p_vmspace->vm_map.pmap;
|
||||
int s;
|
||||
|
||||
if (p == curproc && pm != curcpu()->ci_curpm) {
|
||||
SCHED_LOCK(s);
|
||||
if (p == curproc && pm != curcpu()->ci_curpm)
|
||||
pmap_setttb(p);
|
||||
SCHED_UNLOCK(s);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -2274,14 +2275,12 @@ pmap_setttb(struct proc *p)
|
|||
struct cpu_info *ci = curcpu();
|
||||
pmap_t pm = p->p_vmspace->vm_map.pmap;
|
||||
|
||||
SCHED_ASSERT_LOCKED();
|
||||
|
||||
/*
|
||||
* If the generation of the ASID for the new pmap doesn't
|
||||
* match the current generation, allocate a new ASID.
|
||||
*/
|
||||
if (pm != pmap_kernel() &&
|
||||
(pm->pm_asid & ~PMAP_ASID_MASK) != pmap_asid_gen)
|
||||
(pm->pm_asid & ~PMAP_ASID_MASK) != READ_ONCE(pmap_asid_gen))
|
||||
pmap_allocate_asid(pm);
|
||||
|
||||
if (pm != pmap_kernel())
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $OpenBSD: apm.c,v 1.24 2023/07/08 14:44:43 tobhe Exp $ */
|
||||
/* $OpenBSD: apm.c,v 1.25 2024/05/28 09:40:40 kettenis Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 2001 Alexander Guy. All rights reserved.
|
||||
|
@ -444,11 +444,6 @@ gosleep(void *v)
|
|||
return cpu_suspend_primary();
|
||||
}
|
||||
|
||||
void
|
||||
sleep_abort(void *v)
|
||||
{
|
||||
}
|
||||
|
||||
int
|
||||
sleep_resume(void *v)
|
||||
{
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $OpenBSD: armreg.h,v 1.33 2024/03/18 18:35:21 kettenis Exp $ */
|
||||
/* $OpenBSD: armreg.h,v 1.34 2024/05/27 06:20:59 kettenis Exp $ */
|
||||
/*-
|
||||
* Copyright (c) 2013, 2014 Andrew Turner
|
||||
* Copyright (c) 2015 The FreeBSD Foundation
|
||||
|
@ -337,7 +337,7 @@
|
|||
#define ID_AA64ISAR0_RNDR_IMPL (0x1ULL << ID_AA64ISAR0_RNDR_SHIFT)
|
||||
|
||||
/* ID_AA64ISAR1_EL1 */
|
||||
#define ID_AA64ISAR1_MASK 0x00000fffffffffffULL
|
||||
#define ID_AA64ISAR1_MASK 0xffffffffffffffffULL
|
||||
#define ID_AA64ISAR1_DPB_SHIFT 0
|
||||
#define ID_AA64ISAR1_DPB_MASK (0xfULL << ID_AA64ISAR1_DPB_SHIFT)
|
||||
#define ID_AA64ISAR1_DPB(x) ((x) & ID_AA64ISAR1_DPB_MASK)
|
||||
|
@ -396,6 +396,34 @@
|
|||
#define ID_AA64ISAR1_SPECRES(x) ((x) & ID_AA64ISAR1_SPECRES_MASK)
|
||||
#define ID_AA64ISAR1_SPECRES_NONE (0x0ULL << ID_AA64ISAR1_SPECRES_SHIFT)
|
||||
#define ID_AA64ISAR1_SPECRES_IMPL (0x1ULL << ID_AA64ISAR1_SPECRES_SHIFT)
|
||||
#define ID_AA64ISAR1_BF16_SHIFT 44
|
||||
#define ID_AA64ISAR1_BF16_MASK (0xfULL << ID_AA64ISAR1_BF16_SHIFT)
|
||||
#define ID_AA64ISAR1_BF16(x) ((x) & ID_AA64ISAR1_BF16_MASK)
|
||||
#define ID_AA64ISAR1_BF16_NONE (0x0ULL << ID_AA64ISAR1_BF16_SHIFT)
|
||||
#define ID_AA64ISAR1_BF16_BASE (0x1ULL << ID_AA64ISAR1_BF16_SHIFT)
|
||||
#define ID_AA64ISAR1_BF16_EBF (0x2ULL << ID_AA64ISAR1_BF16_SHIFT)
|
||||
#define ID_AA64ISAR1_DGH_SHIFT 48
|
||||
#define ID_AA64ISAR1_DGH_MASK (0xfULL << ID_AA64ISAR1_DGH_SHIFT)
|
||||
#define ID_AA64ISAR1_DGH(x) ((x) & ID_AA64ISAR1_DGH_MASK)
|
||||
#define ID_AA64ISAR1_DGH_NONE (0x0ULL << ID_AA64ISAR1_DGH_SHIFT)
|
||||
#define ID_AA64ISAR1_DGH_IMPL (0x1ULL << ID_AA64ISAR1_DGH_SHIFT)
|
||||
#define ID_AA64ISAR1_I8MM_SHIFT 52
|
||||
#define ID_AA64ISAR1_I8MM_MASK (0xfULL << ID_AA64ISAR1_I8MM_SHIFT)
|
||||
#define ID_AA64ISAR1_I8MM(x) ((x) & ID_AA64ISAR1_I8MM_MASK)
|
||||
#define ID_AA64ISAR1_I8MM_NONE (0x0ULL << ID_AA64ISAR1_I8MM_SHIFT)
|
||||
#define ID_AA64ISAR1_I8MM_IMPL (0x1ULL << ID_AA64ISAR1_I8MM_SHIFT)
|
||||
#define ID_AA64ISAR1_XS_SHIFT 56
|
||||
#define ID_AA64ISAR1_XS_MASK (0xfULL << ID_AA64ISAR1_XS_SHIFT)
|
||||
#define ID_AA64ISAR1_XS(x) ((x) & ID_AA64ISAR1_XS_MASK)
|
||||
#define ID_AA64ISAR1_XS_NONE (0x0ULL << ID_AA64ISAR1_XS_SHIFT)
|
||||
#define ID_AA64ISAR1_XS_IMPL (0x1ULL << ID_AA64ISAR1_XS_SHIFT)
|
||||
#define ID_AA64ISAR1_LS64_SHIFT 60
|
||||
#define ID_AA64ISAR1_LS64_MASK (0xfULL << ID_AA64ISAR1_LS64_SHIFT)
|
||||
#define ID_AA64ISAR1_LS64(x) ((x) & ID_AA64ISAR1_LS64_MASK)
|
||||
#define ID_AA64ISAR1_LS64_NONE (0x0ULL << ID_AA64ISAR1_LS64_SHIFT)
|
||||
#define ID_AA64ISAR1_LS64_BASE (0x1ULL << ID_AA64ISAR1_LS64_SHIFT)
|
||||
#define ID_AA64ISAR1_LS64_V (0x2ULL << ID_AA64ISAR1_LS64_SHIFT)
|
||||
#define ID_AA64ISAR1_LS64_ACCDATA (0x3ULL << ID_AA64ISAR1_LS64_SHIFT)
|
||||
|
||||
/* ID_AA64ISAR2_EL1 */
|
||||
#define ID_AA64ISAR2_MASK 0x00000000f0000000ULL
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $OpenBSD: machdep.c,v 1.670 2024/04/29 00:29:48 jsg Exp $ */
|
||||
/* $OpenBSD: machdep.c,v 1.671 2024/05/26 13:37:32 kettenis Exp $ */
|
||||
/* $NetBSD: machdep.c,v 1.214 1996/11/10 03:16:17 thorpej Exp $ */
|
||||
|
||||
/*-
|
||||
|
@ -3966,6 +3966,20 @@ intr_barrier(void *ih)
|
|||
sched_barrier(NULL);
|
||||
}
|
||||
|
||||
#ifdef SUSPEND
|
||||
|
||||
void
|
||||
intr_enable_wakeup(void)
|
||||
{
|
||||
}
|
||||
|
||||
void
|
||||
intr_disable_wakeup(void)
|
||||
{
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
unsigned int
|
||||
cpu_rnd_messybits(void)
|
||||
{
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $OpenBSD: intr.h,v 1.49 2021/12/14 18:16:14 deraadt Exp $ */
|
||||
/* $OpenBSD: intr.h,v 1.50 2024/05/26 13:37:32 kettenis Exp $ */
|
||||
/* $NetBSD: intr.h,v 1.5 1996/05/13 06:11:28 mycroft Exp $ */
|
||||
|
||||
/*
|
||||
|
@ -128,6 +128,8 @@ void splassert_check(int, const char *);
|
|||
struct cpu_info;
|
||||
|
||||
void intr_barrier(void *);
|
||||
void intr_enable_wakeup(void);
|
||||
void intr_disable_wakeup(void);
|
||||
|
||||
#ifdef MULTIPROCESSOR
|
||||
void i386_send_ipi(struct cpu_info *, int);
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $OpenBSD: acpi_x86.c,v 1.18 2024/05/13 19:56:37 kettenis Exp $ */
|
||||
/* $OpenBSD: acpi_x86.c,v 1.20 2024/05/28 09:40:40 kettenis Exp $ */
|
||||
/*
|
||||
* Copyright (c) 2005 Thorsten Lockert <tholo@sigmasoft.com>
|
||||
* Copyright (c) 2005 Jordan Hargrave <jordan@openbsd.org>
|
||||
|
@ -96,19 +96,10 @@ gosleep(void *v)
|
|||
|
||||
ret = acpi_sleep_cpu(sc, sc->sc_state);
|
||||
acpi_resume_cpu(sc, sc->sc_state);
|
||||
sc->sc_state = ACPI_STATE_S0;
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
void
|
||||
sleep_abort(void *v)
|
||||
{
|
||||
struct acpi_softc *sc = v;
|
||||
|
||||
sc->sc_state = ACPI_STATE_S0;
|
||||
}
|
||||
|
||||
int
|
||||
sleep_resume(void *v)
|
||||
{
|
||||
|
@ -119,7 +110,7 @@ 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, sc->sc_state) != 0)
|
||||
if (aml_node_setval(sc, sc->sc_tts, ACPI_STATE_S0) != 0)
|
||||
return (EINVAL);
|
||||
acpi_indicator(sc, ACPI_SST_WAKING); /* blink */
|
||||
return 0;
|
||||
|
@ -147,6 +138,8 @@ suspend_finish(void *v)
|
|||
acpi_record_event(sc, APM_NORMAL_RESUME);
|
||||
acpi_indicator(sc, ACPI_SST_WORKING);
|
||||
|
||||
sc->sc_state = ACPI_STATE_S0;
|
||||
|
||||
/* If we woke up but all the lids are closed, go back to sleep */
|
||||
return checklids(sc);
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $OpenBSD: ata.c,v 1.36 2017/12/30 20:46:59 guenther Exp $ */
|
||||
/* $OpenBSD: ata.c,v 1.37 2024/05/26 10:01:01 jsg Exp $ */
|
||||
/* $NetBSD: ata.c,v 1.9 1999/04/15 09:41:09 bouyer Exp $ */
|
||||
/*
|
||||
* Copyright (c) 1998, 2001 Manuel Bouyer. All rights reserved.
|
||||
|
@ -26,15 +26,8 @@
|
|||
|
||||
#include <sys/param.h>
|
||||
#include <sys/systm.h>
|
||||
#include <sys/kernel.h>
|
||||
#include <sys/stat.h>
|
||||
#include <sys/malloc.h>
|
||||
#include <sys/device.h>
|
||||
#include <sys/syslog.h>
|
||||
#include <sys/pool.h>
|
||||
|
||||
#include <machine/bus.h>
|
||||
|
||||
#include <dev/ata/atareg.h>
|
||||
#include <dev/ata/atavar.h>
|
||||
#include <dev/ic/wdcreg.h>
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $OpenBSD: ata_wdc.c,v 1.52 2018/11/02 09:59:36 fcambus Exp $ */
|
||||
/* $OpenBSD: ata_wdc.c,v 1.53 2024/05/26 10:01:01 jsg Exp $ */
|
||||
/* $NetBSD: ata_wdc.c,v 1.21 1999/08/09 09:43:11 bouyer Exp $ */
|
||||
|
||||
/*
|
||||
|
@ -57,16 +57,12 @@
|
|||
|
||||
#include <sys/param.h>
|
||||
#include <sys/systm.h>
|
||||
#include <sys/kernel.h>
|
||||
#include <sys/stat.h>
|
||||
#include <sys/buf.h>
|
||||
#include <sys/malloc.h>
|
||||
#include <sys/device.h>
|
||||
#include <sys/disklabel.h>
|
||||
#include <sys/disk.h>
|
||||
#include <sys/syslog.h>
|
||||
|
||||
#include <machine/intr.h>
|
||||
#include <machine/bus.h>
|
||||
|
||||
#include <dev/ata/atavar.h>
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $OpenBSD: atascsi.c,v 1.154 2024/05/13 01:15:50 jsg Exp $ */
|
||||
/* $OpenBSD: atascsi.c,v 1.155 2024/05/26 10:01:01 jsg Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 2007 David Gwynne <dlg@openbsd.org>
|
||||
|
@ -20,11 +20,8 @@
|
|||
|
||||
#include <sys/param.h>
|
||||
#include <sys/systm.h>
|
||||
#include <sys/buf.h>
|
||||
#include <sys/kernel.h>
|
||||
#include <sys/malloc.h>
|
||||
#include <sys/device.h>
|
||||
#include <sys/queue.h>
|
||||
#include <sys/pool.h>
|
||||
|
||||
#include <scsi/scsi_all.h>
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $OpenBSD: wd.c,v 1.130 2022/10/23 14:39:19 krw Exp $ */
|
||||
/* $OpenBSD: wd.c,v 1.131 2024/05/26 10:01:01 jsg Exp $ */
|
||||
/* $NetBSD: wd.c,v 1.193 1999/02/28 17:15:27 explorer Exp $ */
|
||||
|
||||
/*
|
||||
|
@ -60,12 +60,9 @@
|
|||
|
||||
#include <sys/param.h>
|
||||
#include <sys/systm.h>
|
||||
#include <sys/kernel.h>
|
||||
#include <sys/conf.h>
|
||||
#include <sys/fcntl.h>
|
||||
#include <sys/stat.h>
|
||||
#include <sys/ioctl.h>
|
||||
#include <sys/mutex.h>
|
||||
#include <sys/buf.h>
|
||||
#include <sys/uio.h>
|
||||
#include <sys/malloc.h>
|
||||
|
@ -74,7 +71,6 @@
|
|||
#include <sys/disk.h>
|
||||
#include <sys/syslog.h>
|
||||
#include <sys/timeout.h>
|
||||
#include <sys/vnode.h>
|
||||
#include <sys/dkio.h>
|
||||
#include <sys/reboot.h>
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $OpenBSD: atapiscsi.c,v 1.120 2022/04/16 19:19:58 naddy Exp $ */
|
||||
/* $OpenBSD: atapiscsi.c,v 1.121 2024/05/26 10:01:01 jsg Exp $ */
|
||||
|
||||
/*
|
||||
* This code is derived from code with the copyright below.
|
||||
|
@ -30,19 +30,12 @@
|
|||
*
|
||||
*/
|
||||
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/systm.h>
|
||||
#include <sys/kernel.h>
|
||||
#include <sys/device.h>
|
||||
#include <sys/buf.h>
|
||||
#include <sys/disklabel.h>
|
||||
#include <sys/malloc.h>
|
||||
#include <sys/reboot.h>
|
||||
#include <sys/ioctl.h>
|
||||
#include <sys/timeout.h>
|
||||
#include <scsi/scsi_all.h>
|
||||
#include <scsi/scsi_disk.h>
|
||||
#include <scsi/scsi_tape.h>
|
||||
#include <scsi/scsiconf.h>
|
||||
|
||||
|
@ -134,9 +127,6 @@ void wdc_atapi_reset_2(struct channel_softc *, struct wdc_xfer *,
|
|||
void wdc_atapi_tape_done(struct channel_softc *, struct wdc_xfer *,
|
||||
int, struct atapi_return_args *);
|
||||
|
||||
struct atapiscsi_softc;
|
||||
struct atapiscsi_xfer;
|
||||
|
||||
int atapiscsi_match(struct device *, void *, void *);
|
||||
void atapiscsi_attach(struct device *, struct device *, void *);
|
||||
int atapiscsi_activate(struct device *, int);
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $OpenBSD: bcm2835_mbox.c,v 1.4 2022/08/27 20:31:45 mglocker Exp $ */
|
||||
/* $OpenBSD: bcm2835_mbox.c,v 1.5 2024/05/28 09:19:04 claudio Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 2020 Tobias Heider <tobhe@openbsd.org>
|
||||
|
@ -153,15 +153,6 @@ bcmmbox_attach(struct device *parent, struct device *self, void *aux)
|
|||
|
||||
printf("\n");
|
||||
|
||||
bcmmbox_write(BCMMBOX_CHANPM, (
|
||||
(1 << VCPROP_POWER_SDCARD) |
|
||||
(1 << VCPROP_POWER_UART0) |
|
||||
(1 << VCPROP_POWER_USB) |
|
||||
(1 << VCPROP_POWER_I2C0) |
|
||||
(1 << VCPROP_POWER_I2C1) |
|
||||
(1 << VCPROP_POWER_SPI) |
|
||||
0) << 4);
|
||||
|
||||
return;
|
||||
|
||||
clean_dmamap:
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $OpenBSD: dwmshc.c,v 1.5 2023/06/20 09:26:36 kettenis Exp $ */
|
||||
/* $OpenBSD: dwmshc.c,v 1.7 2024/05/26 22:04:52 kettenis Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 2023 David Gwynne <dlg@openbsd.org>
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $OpenBSD: fanpwr.c,v 1.8 2023/11/12 12:41:43 patrick Exp $ */
|
||||
/* $OpenBSD: fanpwr.c,v 1.10 2024/05/26 22:04:52 kettenis Exp $ */
|
||||
/*
|
||||
* Copyright (c) 2018 Mark Kettenis <kettenis@openbsd.org>
|
||||
*
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $OpenBSD: rkpmic.c,v 1.15 2024/05/12 20:02:13 kettenis Exp $ */
|
||||
/* $OpenBSD: rkpmic.c,v 1.17 2024/05/26 18:06:21 kettenis Exp $ */
|
||||
/*
|
||||
* Copyright (c) 2017 Mark Kettenis <kettenis@openbsd.org>
|
||||
*
|
||||
|
@ -76,7 +76,8 @@ struct rkpmic_vsel_range {
|
|||
|
||||
struct rkpmic_regdata {
|
||||
const char *name;
|
||||
uint8_t reg, mask;
|
||||
uint8_t vreg, vmask;
|
||||
uint8_t sreg, smask;
|
||||
const struct rkpmic_vsel_range *vsel_range;
|
||||
};
|
||||
|
||||
|
@ -112,12 +113,12 @@ const struct rkpmic_vsel_range rk805_vsel_range3[] = {
|
|||
};
|
||||
|
||||
const struct rkpmic_regdata rk805_regdata[] = {
|
||||
{ "DCDC_REG1", 0x2f, 0x3f, rk805_vsel_range1 },
|
||||
{ "DCDC_REG2", 0x33, 0x3f, rk805_vsel_range1 },
|
||||
{ "DCDC_REG4", 0x38, 0x1f, rk805_vsel_range2 },
|
||||
{ "LDO_REG1", 0x3b, 0x1f, rk805_vsel_range3 },
|
||||
{ "LDO_REG2", 0x3d, 0x1f, rk805_vsel_range3 },
|
||||
{ "LDO_REG3", 0x3f, 0x1f, rk805_vsel_range3 },
|
||||
{ "DCDC_REG1", 0x2f, 0x3f, 0, 0, rk805_vsel_range1 },
|
||||
{ "DCDC_REG2", 0x33, 0x3f, 0, 0, rk805_vsel_range1 },
|
||||
{ "DCDC_REG4", 0x38, 0x1f, 0, 0, rk805_vsel_range2 },
|
||||
{ "LDO_REG1", 0x3b, 0x1f, 0, 0, rk805_vsel_range3 },
|
||||
{ "LDO_REG2", 0x3d, 0x1f, 0, 0, rk805_vsel_range3 },
|
||||
{ "LDO_REG3", 0x3f, 0x1f, 0, 0, rk805_vsel_range3 },
|
||||
{ }
|
||||
};
|
||||
|
||||
|
@ -146,27 +147,27 @@ const struct rkpmic_vsel_range rk806_vsel_range2[] = {
|
|||
};
|
||||
|
||||
const struct rkpmic_regdata rk806_regdata[] = {
|
||||
{ "dcdc-reg1", 0x1a, 0xff, rk806_vsel_range1 },
|
||||
{ "dcdc-reg2", 0x1b, 0xff, rk806_vsel_range1 },
|
||||
{ "dcdc-reg3", 0x1c, 0xff, rk806_vsel_range1 },
|
||||
{ "dcdc-reg4", 0x1d, 0xff, rk806_vsel_range1 },
|
||||
{ "dcdc-reg5", 0x1e, 0xff, rk806_vsel_range1 },
|
||||
{ "dcdc-reg6", 0x1f, 0xff, rk806_vsel_range1 },
|
||||
{ "dcdc-reg7", 0x20, 0xff, rk806_vsel_range1 },
|
||||
{ "dcdc-reg8", 0x21, 0xff, rk806_vsel_range1 },
|
||||
{ "dcdc-reg9", 0x22, 0xff, rk806_vsel_range1 },
|
||||
{ "dcdc-reg10", 0x23, 0xff, rk806_vsel_range1 },
|
||||
{ "nldo-reg1", 0x43, 0xff, rk806_vsel_range2 },
|
||||
{ "nldo-reg2", 0x44, 0xff, rk806_vsel_range2 },
|
||||
{ "nldo-reg3", 0x45, 0xff, rk806_vsel_range2 },
|
||||
{ "nldo-reg4", 0x46, 0xff, rk806_vsel_range2 },
|
||||
{ "nldo-reg5", 0x47, 0xff, rk806_vsel_range2 },
|
||||
{ "pldo-reg1", 0x4e, 0xff, rk806_vsel_range2 },
|
||||
{ "pldo-reg2", 0x4f, 0xff, rk806_vsel_range2 },
|
||||
{ "pldo-reg3", 0x50, 0xff, rk806_vsel_range2 },
|
||||
{ "pldo-reg4", 0x51, 0xff, rk806_vsel_range2 },
|
||||
{ "pldo-reg5", 0x52, 0xff, rk806_vsel_range2 },
|
||||
{ "pldo-reg6", 0x53, 0xff, rk806_vsel_range2 },
|
||||
{ "dcdc-reg1", 0x1a, 0xff, 0, 0, rk806_vsel_range1 },
|
||||
{ "dcdc-reg2", 0x1b, 0xff, 0, 0, rk806_vsel_range1 },
|
||||
{ "dcdc-reg3", 0x1c, 0xff, 0, 0, rk806_vsel_range1 },
|
||||
{ "dcdc-reg4", 0x1d, 0xff, 0, 0, rk806_vsel_range1 },
|
||||
{ "dcdc-reg5", 0x1e, 0xff, 0, 0, rk806_vsel_range1 },
|
||||
{ "dcdc-reg6", 0x1f, 0xff, 0, 0, rk806_vsel_range1 },
|
||||
{ "dcdc-reg7", 0x20, 0xff, 0, 0, rk806_vsel_range1 },
|
||||
{ "dcdc-reg8", 0x21, 0xff, 0, 0, rk806_vsel_range1 },
|
||||
{ "dcdc-reg9", 0x22, 0xff, 0, 0, rk806_vsel_range1 },
|
||||
{ "dcdc-reg10", 0x23, 0xff, 0, 0, rk806_vsel_range1 },
|
||||
{ "nldo-reg1", 0x43, 0xff, 0, 0, rk806_vsel_range2 },
|
||||
{ "nldo-reg2", 0x44, 0xff, 0, 0, rk806_vsel_range2 },
|
||||
{ "nldo-reg3", 0x45, 0xff, 0, 0, rk806_vsel_range2 },
|
||||
{ "nldo-reg4", 0x46, 0xff, 0, 0, rk806_vsel_range2 },
|
||||
{ "nldo-reg5", 0x47, 0xff, 0, 0, rk806_vsel_range2 },
|
||||
{ "pldo-reg1", 0x4e, 0xff, 0, 0, rk806_vsel_range2 },
|
||||
{ "pldo-reg2", 0x4f, 0xff, 0, 0, rk806_vsel_range2 },
|
||||
{ "pldo-reg3", 0x50, 0xff, 0, 0, rk806_vsel_range2 },
|
||||
{ "pldo-reg4", 0x51, 0xff, 0, 0, rk806_vsel_range2 },
|
||||
{ "pldo-reg5", 0x52, 0xff, 0, 0, rk806_vsel_range2 },
|
||||
{ "pldo-reg6", 0x53, 0xff, 0, 0, rk806_vsel_range2 },
|
||||
{ }
|
||||
};
|
||||
|
||||
|
@ -220,17 +221,17 @@ const struct rkpmic_vsel_range rk808_vsel_range5[] = {
|
|||
};
|
||||
|
||||
const struct rkpmic_regdata rk808_regdata[] = {
|
||||
{ "DCDC_REG1", 0x2f, 0x3f, rk808_vsel_range1 },
|
||||
{ "DCDC_REG2", 0x33, 0x3f, rk808_vsel_range1 },
|
||||
{ "DCDC_REG4", 0x38, 0x0f, rk808_vsel_range2 },
|
||||
{ "LDO_REG1", 0x3b, 0x1f, rk808_vsel_range3 },
|
||||
{ "LDO_REG2", 0x3d, 0x1f, rk808_vsel_range3 },
|
||||
{ "LDO_REG3", 0x3f, 0x0f, rk808_vsel_range4 },
|
||||
{ "LDO_REG4", 0x41, 0x1f, rk808_vsel_range3 },
|
||||
{ "LDO_REG5", 0x43, 0x1f, rk808_vsel_range3 },
|
||||
{ "LDO_REG6", 0x45, 0x1f, rk808_vsel_range5 },
|
||||
{ "LDO_REG7", 0x47, 0x1f, rk808_vsel_range5 },
|
||||
{ "LDO_REG8", 0x49, 0x1f, rk808_vsel_range3 },
|
||||
{ "DCDC_REG1", 0x2f, 0x3f, 0, 0, rk808_vsel_range1 },
|
||||
{ "DCDC_REG2", 0x33, 0x3f, 0, 0, rk808_vsel_range1 },
|
||||
{ "DCDC_REG4", 0x38, 0x0f, 0, 0, rk808_vsel_range2 },
|
||||
{ "LDO_REG1", 0x3b, 0x1f, 0, 0, rk808_vsel_range3 },
|
||||
{ "LDO_REG2", 0x3d, 0x1f, 0, 0, rk808_vsel_range3 },
|
||||
{ "LDO_REG3", 0x3f, 0x0f, 0, 0, rk808_vsel_range4 },
|
||||
{ "LDO_REG4", 0x41, 0x1f, 0, 0, rk808_vsel_range3 },
|
||||
{ "LDO_REG5", 0x43, 0x1f, 0, 0, rk808_vsel_range3 },
|
||||
{ "LDO_REG6", 0x45, 0x1f, 0, 0, rk808_vsel_range5 },
|
||||
{ "LDO_REG7", 0x47, 0x1f, 0, 0, rk808_vsel_range5 },
|
||||
{ "LDO_REG8", 0x49, 0x1f, 0, 0, rk808_vsel_range3 },
|
||||
{ }
|
||||
};
|
||||
|
||||
|
@ -281,20 +282,22 @@ const struct rkpmic_vsel_range rk809_vsel_range4[] = {
|
|||
};
|
||||
|
||||
const struct rkpmic_regdata rk809_regdata[] = {
|
||||
{ "DCDC_REG1", 0xbb, 0x7f, rk809_vsel_range1 },
|
||||
{ "DCDC_REG2", 0xbe, 0x7f, rk809_vsel_range1 },
|
||||
{ "DCDC_REG3", 0xc1, 0x7f, rk809_vsel_range1 },
|
||||
{ "DCDC_REG4", 0xc4, 0x7f, rk809_vsel_range2 },
|
||||
{ "DCDC_REG5", 0xde, 0x0f, rk809_vsel_range3},
|
||||
{ "LDO_REG1", 0xcc, 0x7f, rk809_vsel_range4 },
|
||||
{ "LDO_REG2", 0xce, 0x7f, rk809_vsel_range4 },
|
||||
{ "LDO_REG3", 0xd0, 0x7f, rk809_vsel_range4 },
|
||||
{ "LDO_REG4", 0xd2, 0x7f, rk809_vsel_range4 },
|
||||
{ "LDO_REG5", 0xd4, 0x7f, rk809_vsel_range4 },
|
||||
{ "LDO_REG6", 0xd6, 0x7f, rk809_vsel_range4 },
|
||||
{ "LDO_REG7", 0xd8, 0x7f, rk809_vsel_range4 },
|
||||
{ "LDO_REG8", 0xda, 0x7f, rk809_vsel_range4 },
|
||||
{ "LDO_REG9", 0xdc, 0x7f, rk809_vsel_range4 },
|
||||
{ "DCDC_REG1", 0xbb, 0x7f, 0xb5, 0x01, rk809_vsel_range1 },
|
||||
{ "DCDC_REG2", 0xbe, 0x7f, 0xb5, 0x02, rk809_vsel_range1 },
|
||||
{ "DCDC_REG3", 0xc1, 0x7f, 0xb5, 0x04, rk809_vsel_range1 },
|
||||
{ "DCDC_REG4", 0xc4, 0x7f, 0xb5, 0x08, rk809_vsel_range2 },
|
||||
{ "DCDC_REG5", 0xde, 0x0f, 0xb5, 0x20, rk809_vsel_range3 },
|
||||
{ "LDO_REG1", 0xcc, 0x7f, 0xb6, 0x01, rk809_vsel_range4 },
|
||||
{ "LDO_REG2", 0xce, 0x7f, 0xb6, 0x02, rk809_vsel_range4 },
|
||||
{ "LDO_REG3", 0xd0, 0x7f, 0xb6, 0x04, rk809_vsel_range4 },
|
||||
{ "LDO_REG4", 0xd2, 0x7f, 0xb6, 0x08, rk809_vsel_range4 },
|
||||
{ "LDO_REG5", 0xd4, 0x7f, 0xb6, 0x10, rk809_vsel_range4 },
|
||||
{ "LDO_REG6", 0xd6, 0x7f, 0xb6, 0x20, rk809_vsel_range4 },
|
||||
{ "LDO_REG7", 0xd8, 0x7f, 0xb6, 0x40, rk809_vsel_range4 },
|
||||
{ "LDO_REG8", 0xda, 0x7f, 0xb6, 0x80, rk809_vsel_range4 },
|
||||
{ "LDO_REG9", 0xdc, 0x7f, 0xb5, 0x10, rk809_vsel_range4 },
|
||||
{ "SWITCH_REG1", 0, 0, 0xb5, 0x40, NULL },
|
||||
{ "SWITCH_REG2", 0, 0, 0xb5, 0x80, NULL },
|
||||
{ }
|
||||
};
|
||||
|
||||
|
@ -308,20 +311,20 @@ const struct rkpmic_vsel_range rk817_boost_range[] = {
|
|||
};
|
||||
|
||||
const struct rkpmic_regdata rk817_regdata[] = {
|
||||
{ "DCDC_REG1", 0xbb, 0x7f, rk809_vsel_range1 },
|
||||
{ "DCDC_REG2", 0xbe, 0x7f, rk809_vsel_range1 },
|
||||
{ "DCDC_REG3", 0xc1, 0x7f, rk809_vsel_range1 },
|
||||
{ "DCDC_REG4", 0xc4, 0x7f, rk809_vsel_range2 },
|
||||
{ "LDO_REG1", 0xcc, 0x7f, rk809_vsel_range4 },
|
||||
{ "LDO_REG2", 0xce, 0x7f, rk809_vsel_range4 },
|
||||
{ "LDO_REG3", 0xd0, 0x7f, rk809_vsel_range4 },
|
||||
{ "LDO_REG4", 0xd2, 0x7f, rk809_vsel_range4 },
|
||||
{ "LDO_REG5", 0xd4, 0x7f, rk809_vsel_range4 },
|
||||
{ "LDO_REG6", 0xd6, 0x7f, rk809_vsel_range4 },
|
||||
{ "LDO_REG7", 0xd8, 0x7f, rk809_vsel_range4 },
|
||||
{ "LDO_REG8", 0xda, 0x7f, rk809_vsel_range4 },
|
||||
{ "LDO_REG9", 0xdc, 0x7f, rk809_vsel_range4 },
|
||||
{ "BOOST", 0xde, 0x07, rk817_boost_range },
|
||||
{ "DCDC_REG1", 0xbb, 0x7f, 0, 0, rk809_vsel_range1 },
|
||||
{ "DCDC_REG2", 0xbe, 0x7f, 0, 0, rk809_vsel_range1 },
|
||||
{ "DCDC_REG3", 0xc1, 0x7f, 0, 0, rk809_vsel_range1 },
|
||||
{ "DCDC_REG4", 0xc4, 0x7f, 0, 0, rk809_vsel_range2 },
|
||||
{ "LDO_REG1", 0xcc, 0x7f, 0, 0, rk809_vsel_range4 },
|
||||
{ "LDO_REG2", 0xce, 0x7f, 0, 0, rk809_vsel_range4 },
|
||||
{ "LDO_REG3", 0xd0, 0x7f, 0, 0, rk809_vsel_range4 },
|
||||
{ "LDO_REG4", 0xd2, 0x7f, 0, 0, rk809_vsel_range4 },
|
||||
{ "LDO_REG5", 0xd4, 0x7f, 0, 0, rk809_vsel_range4 },
|
||||
{ "LDO_REG6", 0xd6, 0x7f, 0, 0, rk809_vsel_range4 },
|
||||
{ "LDO_REG7", 0xd8, 0x7f, 0, 0, rk809_vsel_range4 },
|
||||
{ "LDO_REG8", 0xda, 0x7f, 0, 0, rk809_vsel_range4 },
|
||||
{ "LDO_REG9", 0xdc, 0x7f, 0, 0, rk809_vsel_range4 },
|
||||
{ "BOOST", 0xde, 0x07, 0, 0, rk817_boost_range },
|
||||
{ }
|
||||
};
|
||||
|
||||
|
@ -531,6 +534,7 @@ rkpmic_activate(struct device *self, int act)
|
|||
val &= ~RK809_PMIC_SYS_CFG3_SLP_FUN_MASK;
|
||||
val |= RK809_PMIC_SYS_CFG3_SLP_FUN_NONE;
|
||||
rkpmic_reg_write(sc, RK809_PMIC_SYS_CFG3, val);
|
||||
rkpmic_reg_write(sc, RK809_PMIC_INT_STS0, 0xff);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
@ -556,7 +560,7 @@ rkpmic_intr(void *arg)
|
|||
struct rkpmic_regulator {
|
||||
struct rkpmic_softc *rr_sc;
|
||||
|
||||
uint8_t rr_reg, rr_mask;
|
||||
uint8_t rr_vreg, rr_vmask;
|
||||
const struct rkpmic_vsel_range *rr_vsel_range;
|
||||
|
||||
struct regulator_device rr_rd;
|
||||
|
@ -564,13 +568,16 @@ struct rkpmic_regulator {
|
|||
|
||||
uint32_t rkpmic_get_voltage(void *);
|
||||
int rkpmic_set_voltage(void *, uint32_t);
|
||||
int rkpmic_do_set_voltage(struct rkpmic_regulator *, uint32_t, int);
|
||||
|
||||
void
|
||||
rkpmic_attach_regulator(struct rkpmic_softc *sc, int node)
|
||||
{
|
||||
struct rkpmic_regulator *rr;
|
||||
char name[32];
|
||||
int i;
|
||||
uint32_t voltage;
|
||||
int i, snode;
|
||||
uint8_t val;
|
||||
|
||||
name[0] = 0;
|
||||
OF_getprop(node, "name", name, sizeof(name));
|
||||
|
@ -585,8 +592,8 @@ rkpmic_attach_regulator(struct rkpmic_softc *sc, int node)
|
|||
rr = malloc(sizeof(*rr), M_DEVBUF, M_WAITOK | M_ZERO);
|
||||
rr->rr_sc = sc;
|
||||
|
||||
rr->rr_reg = sc->sc_regdata[i].reg;
|
||||
rr->rr_mask = sc->sc_regdata[i].mask;
|
||||
rr->rr_vreg = sc->sc_regdata[i].vreg;
|
||||
rr->rr_vmask = sc->sc_regdata[i].vmask;
|
||||
rr->rr_vsel_range = sc->sc_regdata[i].vsel_range;
|
||||
|
||||
rr->rr_rd.rd_node = node;
|
||||
|
@ -594,6 +601,25 @@ rkpmic_attach_regulator(struct rkpmic_softc *sc, int node)
|
|||
rr->rr_rd.rd_get_voltage = rkpmic_get_voltage;
|
||||
rr->rr_rd.rd_set_voltage = rkpmic_set_voltage;
|
||||
regulator_register(&rr->rr_rd);
|
||||
|
||||
if (sc->sc_regdata[i].smask) {
|
||||
snode = OF_getnodebyname(node, "regulator-state-mem");
|
||||
if (snode) {
|
||||
val = rkpmic_reg_read(sc, sc->sc_regdata[i].sreg);
|
||||
if (OF_getpropbool(snode, "regulator-on-in-suspend"))
|
||||
val |= sc->sc_regdata[i].smask;
|
||||
if (OF_getpropbool(snode, "regulator-off-in-suspend"))
|
||||
val &= ~sc->sc_regdata[i].smask;
|
||||
rkpmic_reg_write(sc, sc->sc_regdata[i].sreg, val);
|
||||
|
||||
voltage = OF_getpropint(snode,
|
||||
"regulator-suspend-min-microvolt", 0);
|
||||
voltage = OF_getpropint(snode,
|
||||
"regulator-suspend-microvolt", voltage);
|
||||
if (voltage > 0)
|
||||
rkpmic_do_set_voltage(rr, voltage, 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
uint32_t
|
||||
|
@ -604,7 +630,10 @@ rkpmic_get_voltage(void *cookie)
|
|||
uint8_t vsel;
|
||||
uint32_t ret = 0;
|
||||
|
||||
vsel = rkpmic_reg_read(rr->rr_sc, rr->rr_reg) & rr->rr_mask;
|
||||
if (vsel_range == NULL)
|
||||
return 0;
|
||||
|
||||
vsel = rkpmic_reg_read(rr->rr_sc, rr->rr_vreg) & rr->rr_vmask;
|
||||
|
||||
while (vsel_range->base) {
|
||||
ret = vsel_range->base;
|
||||
|
@ -626,11 +655,19 @@ rkpmic_get_voltage(void *cookie)
|
|||
int
|
||||
rkpmic_set_voltage(void *cookie, uint32_t voltage)
|
||||
{
|
||||
struct rkpmic_regulator *rr = cookie;
|
||||
return rkpmic_do_set_voltage(cookie, voltage, 0);
|
||||
}
|
||||
|
||||
int
|
||||
rkpmic_do_set_voltage(struct rkpmic_regulator *rr, uint32_t voltage, int sleep)
|
||||
{
|
||||
const struct rkpmic_vsel_range *vsel_range = rr->rr_vsel_range;
|
||||
uint32_t vmin, vmax, volt;
|
||||
uint8_t reg, vsel;
|
||||
|
||||
if (vsel_range == NULL)
|
||||
return ENODEV;
|
||||
|
||||
while (vsel_range->base) {
|
||||
vmin = vsel_range->base;
|
||||
vmax = vmin + (vsel_range->vsel_max - vsel_range->vsel_min) *
|
||||
|
@ -658,10 +695,10 @@ rkpmic_set_voltage(void *cookie, uint32_t voltage)
|
|||
if (vsel_range->base == 0)
|
||||
return EINVAL;
|
||||
|
||||
reg = rkpmic_reg_read(rr->rr_sc, rr->rr_reg);
|
||||
reg &= ~rr->rr_mask;
|
||||
reg = rkpmic_reg_read(rr->rr_sc, rr->rr_vreg + sleep);
|
||||
reg &= ~rr->rr_vmask;
|
||||
reg |= vsel;
|
||||
rkpmic_reg_write(rr->rr_sc, rr->rr_reg, reg);
|
||||
rkpmic_reg_write(rr->rr_sc, rr->rr_vreg + sleep, reg);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $OpenBSD: pca9532.c,v 1.4 2022/04/06 18:59:28 naddy Exp $ */
|
||||
/* $OpenBSD: pca9532.c,v 1.5 2024/05/28 13:21:13 jsg Exp $ */
|
||||
/*
|
||||
* Copyright (c) 2006 Dale Rahn <drahn@openbsd.org>
|
||||
*
|
||||
|
@ -48,8 +48,8 @@ struct pcaled_softc {
|
|||
int pcaled_match(struct device *, void *, void *);
|
||||
void pcaled_attach(struct device *, struct device *, void *);
|
||||
int pcaled_gpio_pin_read(void *arg, int pin);
|
||||
void pcaled_gpio_pin_write (void *arg, int pin, int value);
|
||||
void pcaled_gpio_pin_ctl (void *arg, int pin, int flags);
|
||||
void pcaled_gpio_pin_write(void *arg, int pin, int value);
|
||||
void pcaled_gpio_pin_ctl(void *arg, int pin, int flags);
|
||||
|
||||
const struct cfattach pcaled_ca = {
|
||||
sizeof(struct pcaled_softc), pcaled_match, pcaled_attach
|
||||
|
@ -150,7 +150,7 @@ fail:
|
|||
}
|
||||
|
||||
void
|
||||
pcaled_gpio_pin_write (void *arg, int pin, int value)
|
||||
pcaled_gpio_pin_write(void *arg, int pin, int value)
|
||||
{
|
||||
struct pcaled_softc *sc = arg;
|
||||
uint8_t cmd, data;
|
||||
|
@ -177,7 +177,7 @@ fail:
|
|||
}
|
||||
|
||||
void
|
||||
pcaled_gpio_pin_ctl (void *arg, int pin, int flags)
|
||||
pcaled_gpio_pin_ctl(void *arg, int pin, int flags)
|
||||
{
|
||||
/* XXX all pins are inout */
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $OpenBSD: ahci.c,v 1.40 2024/04/23 13:09:21 jsg Exp $ */
|
||||
/* $OpenBSD: ahci.c,v 1.41 2024/05/28 01:37:53 jsg Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 2006 David Gwynne <dlg@openbsd.org>
|
||||
|
@ -2350,9 +2350,9 @@ failall:
|
|||
sizeof(struct ata_fis_d2h));
|
||||
}
|
||||
|
||||
ccb->ccb_done(ccb);
|
||||
|
||||
processed |= 1 << ccb->ccb_slot;
|
||||
|
||||
ccb->ccb_done(ccb);
|
||||
}
|
||||
|
||||
if (need_restart) {
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $OpenBSD: nvme.c,v 1.112 2024/05/24 12:04:07 krw Exp $ */
|
||||
/* $OpenBSD: nvme.c,v 1.115 2024/05/28 00:24:44 jsg Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 2014 David Gwynne <dlg@openbsd.org>
|
||||
|
@ -156,6 +156,7 @@ static const struct nvme_ops nvme_ops = {
|
|||
};
|
||||
|
||||
#define NVME_TIMO_QOP 5000 /* ms to create/delete queue */
|
||||
#define NVME_TIMO_PT 5000 /* ms to complete passthrough */
|
||||
#define NVME_TIMO_IDENT 10000 /* ms to probe/identify */
|
||||
#define NVME_TIMO_DELAYNS 10 /* ns to delay() in poll loop */
|
||||
|
||||
|
@ -978,7 +979,7 @@ nvme_passthrough_cmd(struct nvme_softc *sc, struct nvme_pt_cmd *pt, int dv_unit,
|
|||
nvme_dmamem_sync(sc, mem, BUS_DMASYNC_PREREAD);
|
||||
}
|
||||
|
||||
flags = nvme_poll(sc, sc->sc_admin_q, ccb, nvme_sqe_fill, NVME_TIMO_QOP);
|
||||
flags = nvme_poll(sc, sc->sc_admin_q, ccb, nvme_sqe_fill, NVME_TIMO_PT);
|
||||
|
||||
if (pt->pt_databuflen > 0) {
|
||||
nvme_dmamem_sync(sc, mem, BUS_DMASYNC_POSTREAD);
|
||||
|
@ -1896,12 +1897,12 @@ nvme_bioctl_sdname(const struct nvme_softc *sc, int target)
|
|||
const struct sd_softc *sd;
|
||||
|
||||
link = scsi_get_link(sc->sc_scsibus, target, 0);
|
||||
if (link) {
|
||||
sd = (struct sd_softc *)(link->device_softc);
|
||||
if (ISSET(link->state, SDEV_S_DYING) || sd == NULL ||
|
||||
ISSET(sd->flags, SDF_DYING))
|
||||
return NULL;
|
||||
}
|
||||
if (link == NULL)
|
||||
return NULL;
|
||||
sd = (struct sd_softc *)(link->device_softc);
|
||||
if (ISSET(link->state, SDEV_S_DYING) || sd == NULL ||
|
||||
ISSET(sd->flags, SDF_DYING))
|
||||
return NULL;
|
||||
|
||||
if (nvme_read4(sc, NVME_VS) == 0xffffffff)
|
||||
return NULL;
|
||||
|
|
715
sys/dev/ic/qwx.c
715
sys/dev/ic/qwx.c
|
@ -1,4 +1,4 @@
|
|||
/* $OpenBSD: qwx.c,v 1.59 2024/05/03 14:32:11 stsp Exp $ */
|
||||
/* $OpenBSD: qwx.c,v 1.61 2024/05/28 13:02:45 jsg Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright 2023 Stefan Sperling <stsp@openbsd.org>
|
||||
|
@ -152,6 +152,11 @@ int qwx_dp_tx_send_reo_cmd(struct qwx_softc *, struct dp_rx_tid *,
|
|||
void (*func)(struct qwx_dp *, void *, enum hal_reo_cmd_status));
|
||||
void qwx_dp_rx_deliver_msdu(struct qwx_softc *, struct qwx_rx_msdu *);
|
||||
void qwx_dp_service_mon_ring(void *);
|
||||
void qwx_peer_frags_flush(struct qwx_softc *, struct ath11k_peer *);
|
||||
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);
|
||||
|
||||
int qwx_scan(struct qwx_softc *);
|
||||
void qwx_scan_abort(struct qwx_softc *);
|
||||
|
@ -178,7 +183,7 @@ qwx_init(struct ifnet *ifp)
|
|||
struct ieee80211com *ic = &sc->sc_ic;
|
||||
|
||||
sc->fw_mode = ATH11K_FIRMWARE_MODE_NORMAL;
|
||||
sc->crypto_mode = ATH11K_CRYPT_MODE_SW;
|
||||
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;
|
||||
|
@ -283,6 +288,7 @@ qwx_stop(struct ifnet *ifp)
|
|||
/* Cancel scheduled tasks and let any stale tasks finish up. */
|
||||
task_del(systq, &sc->init_task);
|
||||
qwx_del_task(sc, sc->sc_nswq, &sc->newstate_task);
|
||||
qwx_del_task(sc, systq, &sc->setkey_task);
|
||||
refcnt_finalize(&sc->task_refs, "qwxstop");
|
||||
|
||||
clear_bit(ATH11K_FLAG_CRASH_FLUSH, sc->sc_flags);
|
||||
|
@ -495,6 +501,262 @@ qwx_media_change(struct ifnet *ifp)
|
|||
return err;
|
||||
}
|
||||
|
||||
int
|
||||
qwx_queue_setkey_cmd(struct ieee80211com *ic, struct ieee80211_node *ni,
|
||||
struct ieee80211_key *k, int cmd)
|
||||
{
|
||||
struct qwx_softc *sc = ic->ic_softc;
|
||||
struct qwx_setkey_task_arg *a;
|
||||
|
||||
if (sc->setkey_nkeys >= nitems(sc->setkey_arg) ||
|
||||
k->k_id > WMI_MAX_KEY_INDEX)
|
||||
return ENOSPC;
|
||||
|
||||
a = &sc->setkey_arg[sc->setkey_cur];
|
||||
a->ni = ieee80211_ref_node(ni);
|
||||
a->k = k;
|
||||
a->cmd = cmd;
|
||||
sc->setkey_cur = (sc->setkey_cur + 1) % nitems(sc->setkey_arg);
|
||||
sc->setkey_nkeys++;
|
||||
qwx_add_task(sc, systq, &sc->setkey_task);
|
||||
return EBUSY;
|
||||
}
|
||||
|
||||
int
|
||||
qwx_set_key(struct ieee80211com *ic, struct ieee80211_node *ni,
|
||||
struct ieee80211_key *k)
|
||||
{
|
||||
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))
|
||||
return ieee80211_set_key(ic, ni, k);
|
||||
|
||||
return qwx_queue_setkey_cmd(ic, ni, k, QWX_ADD_KEY);
|
||||
}
|
||||
|
||||
void
|
||||
qwx_delete_key(struct ieee80211com *ic, struct ieee80211_node *ni,
|
||||
struct ieee80211_key *k)
|
||||
{
|
||||
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)) {
|
||||
ieee80211_delete_key(ic, ni, k);
|
||||
return;
|
||||
}
|
||||
|
||||
if (ic->ic_state != IEEE80211_S_RUN) {
|
||||
/* Keys removed implicitly when firmware station is removed. */
|
||||
return;
|
||||
}
|
||||
|
||||
/*
|
||||
* net80211 calls us with a NULL node when deleting group keys,
|
||||
* but firmware expects a MAC address in the command.
|
||||
*/
|
||||
if (ni == NULL)
|
||||
ni = ic->ic_bss;
|
||||
|
||||
qwx_queue_setkey_cmd(ic, ni, k, QWX_DEL_KEY);
|
||||
}
|
||||
|
||||
int
|
||||
qwx_wmi_install_key_cmd(struct qwx_softc *sc, struct qwx_vif *arvif,
|
||||
uint8_t *macaddr, struct ieee80211_key *k, uint32_t flags,
|
||||
int delete_key)
|
||||
{
|
||||
int ret;
|
||||
struct wmi_vdev_install_key_arg arg = {
|
||||
.vdev_id = arvif->vdev_id,
|
||||
.key_idx = k->k_id,
|
||||
.key_len = k->k_len,
|
||||
.key_data = k->k_key,
|
||||
.key_flags = flags,
|
||||
.macaddr = macaddr,
|
||||
};
|
||||
uint8_t pdev_id = 0; /* TODO: derive pdev ID somehow? */
|
||||
#ifdef notyet
|
||||
lockdep_assert_held(&arvif->ar->conf_mutex);
|
||||
|
||||
reinit_completion(&ar->install_key_done);
|
||||
#endif
|
||||
if (test_bit(ATH11K_FLAG_HW_CRYPTO_DISABLED, sc->sc_flags))
|
||||
return 0;
|
||||
|
||||
if (delete_key) {
|
||||
arg.key_cipher = WMI_CIPHER_NONE;
|
||||
arg.key_data = NULL;
|
||||
} else {
|
||||
switch (k->k_cipher) {
|
||||
case IEEE80211_CIPHER_CCMP:
|
||||
arg.key_cipher = WMI_CIPHER_AES_CCM;
|
||||
#if 0
|
||||
/* TODO: Re-check if flag is valid */
|
||||
key->flags |= IEEE80211_KEY_FLAG_GENERATE_IV_MGMT;
|
||||
#endif
|
||||
break;
|
||||
case IEEE80211_CIPHER_TKIP:
|
||||
arg.key_cipher = WMI_CIPHER_TKIP;
|
||||
arg.key_txmic_len = 8;
|
||||
arg.key_rxmic_len = 8;
|
||||
break;
|
||||
#if 0
|
||||
case WLAN_CIPHER_SUITE_CCMP_256:
|
||||
arg.key_cipher = WMI_CIPHER_AES_CCM;
|
||||
break;
|
||||
case WLAN_CIPHER_SUITE_GCMP:
|
||||
case WLAN_CIPHER_SUITE_GCMP_256:
|
||||
arg.key_cipher = WMI_CIPHER_AES_GCM;
|
||||
break;
|
||||
#endif
|
||||
default:
|
||||
printf("%s: cipher %u is not supported\n",
|
||||
sc->sc_dev.dv_xname, k->k_cipher);
|
||||
return EOPNOTSUPP;
|
||||
}
|
||||
#if 0
|
||||
if (test_bit(ATH11K_FLAG_RAW_MODE, &ar->ab->dev_flags))
|
||||
key->flags |= IEEE80211_KEY_FLAG_GENERATE_IV |
|
||||
IEEE80211_KEY_FLAG_RESERVE_TAILROOM;
|
||||
#endif
|
||||
}
|
||||
|
||||
sc->install_key_done = 0;
|
||||
ret = qwx_wmi_vdev_install_key(sc, &arg, pdev_id);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
while (!sc->install_key_done) {
|
||||
ret = tsleep_nsec(&sc->install_key_done, 0, "qwxinstkey",
|
||||
SEC_TO_NSEC(1));
|
||||
if (ret) {
|
||||
printf("%s: install key timeout\n",
|
||||
sc->sc_dev.dv_xname);
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
return sc->install_key_status;
|
||||
}
|
||||
|
||||
int
|
||||
qwx_add_sta_key(struct qwx_softc *sc, struct ieee80211_node *ni,
|
||||
struct ieee80211_key *k)
|
||||
{
|
||||
struct ieee80211com *ic = &sc->sc_ic;
|
||||
struct qwx_node *nq = (struct qwx_node *)ni;
|
||||
struct ath11k_peer *peer = &nq->peer;
|
||||
struct qwx_vif *arvif = TAILQ_FIRST(&sc->vif_list); /* XXX */
|
||||
int ret = 0;
|
||||
uint32_t flags = 0;
|
||||
const int want_keymask = (QWX_NODE_FLAG_HAVE_PAIRWISE_KEY |
|
||||
QWX_NODE_FLAG_HAVE_GROUP_KEY);
|
||||
|
||||
/*
|
||||
* Flush the fragments cache during key (re)install to
|
||||
* ensure all frags in the new frag list belong to the same key.
|
||||
*/
|
||||
qwx_peer_frags_flush(sc, peer);
|
||||
|
||||
if (k->k_flags & IEEE80211_KEY_GROUP)
|
||||
flags |= WMI_KEY_GROUP;
|
||||
else
|
||||
flags |= WMI_KEY_PAIRWISE;
|
||||
|
||||
ret = qwx_wmi_install_key_cmd(sc, arvif, ni->ni_macaddr, k, flags, 0);
|
||||
if (ret) {
|
||||
printf("%s: installing crypto key failed (%d)\n",
|
||||
sc->sc_dev.dv_xname, ret);
|
||||
return ret;
|
||||
}
|
||||
|
||||
ret = qwx_dp_peer_rx_pn_replay_config(sc, arvif, ni, k, 0);
|
||||
if (ret) {
|
||||
printf("%s: failed to offload PN replay detection %d\n",
|
||||
sc->sc_dev.dv_xname, ret);
|
||||
return ret;
|
||||
}
|
||||
|
||||
if (k->k_flags & IEEE80211_KEY_GROUP)
|
||||
nq->flags |= QWX_NODE_FLAG_HAVE_GROUP_KEY;
|
||||
else
|
||||
nq->flags |= QWX_NODE_FLAG_HAVE_PAIRWISE_KEY;
|
||||
|
||||
if ((nq->flags & want_keymask) == want_keymask) {
|
||||
DPRINTF("marking port %s valid\n",
|
||||
ether_sprintf(ni->ni_macaddr));
|
||||
ni->ni_port_valid = 1;
|
||||
ieee80211_set_link_state(ic, LINK_STATE_UP);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int
|
||||
qwx_del_sta_key(struct qwx_softc *sc, struct ieee80211_node *ni,
|
||||
struct ieee80211_key *k)
|
||||
{
|
||||
struct qwx_node *nq = (struct qwx_node *)ni;
|
||||
struct qwx_vif *arvif = TAILQ_FIRST(&sc->vif_list); /* XXX */
|
||||
int ret = 0;
|
||||
|
||||
ret = qwx_wmi_install_key_cmd(sc, arvif, ni->ni_macaddr, k, 0, 1);
|
||||
if (ret) {
|
||||
printf("%s: deleting crypto key failed (%d)\n",
|
||||
sc->sc_dev.dv_xname, ret);
|
||||
return ret;
|
||||
}
|
||||
|
||||
ret = qwx_dp_peer_rx_pn_replay_config(sc, arvif, ni, k, 1);
|
||||
if (ret) {
|
||||
printf("%s: failed to disable PN replay detection %d\n",
|
||||
sc->sc_dev.dv_xname, ret);
|
||||
return ret;
|
||||
}
|
||||
|
||||
if (k->k_flags & IEEE80211_KEY_GROUP)
|
||||
nq->flags &= ~QWX_NODE_FLAG_HAVE_GROUP_KEY;
|
||||
else
|
||||
nq->flags &= ~QWX_NODE_FLAG_HAVE_PAIRWISE_KEY;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
void
|
||||
qwx_setkey_task(void *arg)
|
||||
{
|
||||
struct qwx_softc *sc = arg;
|
||||
struct ieee80211com *ic = &sc->sc_ic;
|
||||
struct qwx_setkey_task_arg *a;
|
||||
int err = 0, s = splnet();
|
||||
|
||||
while (sc->setkey_nkeys > 0) {
|
||||
if (err || test_bit(ATH11K_FLAG_CRASH_FLUSH, sc->sc_flags))
|
||||
break;
|
||||
a = &sc->setkey_arg[sc->setkey_tail];
|
||||
KASSERT(a->cmd == QWX_ADD_KEY || a->cmd == QWX_DEL_KEY);
|
||||
if (ic->ic_state == IEEE80211_S_RUN) {
|
||||
if (a->cmd == QWX_ADD_KEY)
|
||||
err = qwx_add_sta_key(sc, a->ni, a->k);
|
||||
else
|
||||
err = qwx_del_sta_key(sc, a->ni, a->k);
|
||||
}
|
||||
ieee80211_release_node(ic, a->ni);
|
||||
a->ni = NULL;
|
||||
a->k = NULL;
|
||||
sc->setkey_tail = (sc->setkey_tail + 1) %
|
||||
nitems(sc->setkey_arg);
|
||||
sc->setkey_nkeys--;
|
||||
}
|
||||
|
||||
refcnt_rele_wake(&sc->task_refs);
|
||||
splx(s);
|
||||
}
|
||||
|
||||
int
|
||||
qwx_newstate(struct ieee80211com *ic, enum ieee80211_state nstate, int arg)
|
||||
{
|
||||
|
@ -510,15 +772,27 @@ qwx_newstate(struct ieee80211com *ic, enum ieee80211_state nstate, int arg)
|
|||
if (sc->ns_nstate == nstate && nstate != IEEE80211_S_SCAN &&
|
||||
nstate != IEEE80211_S_AUTH)
|
||||
return 0;
|
||||
#if 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;
|
||||
#if 0
|
||||
qwx_del_task(sc, systq, &sc->bgscan_done_task);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
sc->ns_nstate = nstate;
|
||||
sc->ns_arg = arg;
|
||||
|
||||
|
@ -636,7 +910,8 @@ struct cfdriver qwx_cd = {
|
|||
NULL, "qwx", DV_IFNET
|
||||
};
|
||||
|
||||
void qwx_init_wmi_config_qca6390(struct qwx_softc *sc,
|
||||
void
|
||||
qwx_init_wmi_config_qca6390(struct qwx_softc *sc,
|
||||
struct target_resource_config *config)
|
||||
{
|
||||
config->num_vdevs = 4;
|
||||
|
@ -726,7 +1001,8 @@ qwx_hw_ipq8074_reo_setup(struct qwx_softc *sc)
|
|||
FIELD_PREP(HAL_REO_DEST_RING_CTRL_HASH_RING_MAP, ring_hash_map));
|
||||
}
|
||||
|
||||
void qwx_init_wmi_config_ipq8074(struct qwx_softc *sc,
|
||||
void
|
||||
qwx_init_wmi_config_ipq8074(struct qwx_softc *sc,
|
||||
struct target_resource_config *config)
|
||||
{
|
||||
config->num_vdevs = sc->num_radios * TARGET_NUM_VDEVS(sc);
|
||||
|
@ -882,7 +1158,8 @@ qwx_hw_mac_id_to_srng_id_ipq8074(struct ath11k_hw_params *hw, int mac_id)
|
|||
return 0;
|
||||
}
|
||||
|
||||
int qwx_hw_mac_id_to_pdev_id_qca6390(struct ath11k_hw_params *hw, int mac_id)
|
||||
int
|
||||
qwx_hw_mac_id_to_pdev_id_qca6390(struct ath11k_hw_params *hw, int mac_id)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
@ -893,6 +1170,13 @@ qwx_hw_mac_id_to_srng_id_qca6390(struct ath11k_hw_params *hw, int mac_id)
|
|||
return mac_id;
|
||||
}
|
||||
|
||||
int
|
||||
qwx_hw_ipq8074_rx_desc_get_first_msdu(struct hal_rx_desc *desc)
|
||||
{
|
||||
return !!FIELD_GET(RX_MSDU_END_INFO2_FIRST_MSDU,
|
||||
le32toh(desc->u.ipq8074.msdu_end.info2));
|
||||
}
|
||||
|
||||
uint8_t
|
||||
qwx_hw_ipq8074_rx_desc_get_l3_pad_bytes(struct hal_rx_desc *desc)
|
||||
{
|
||||
|
@ -1059,6 +1343,12 @@ qwx_hw_ipq8074_rx_desc_set_msdu_len(struct hal_rx_desc *desc, uint16_t len)
|
|||
desc->u.ipq8074.msdu_start.info1 = htole32(info);
|
||||
}
|
||||
|
||||
int
|
||||
qwx_dp_rx_h_msdu_end_first_msdu(struct qwx_softc *sc, struct hal_rx_desc *desc)
|
||||
{
|
||||
return sc->hw_params.hw_ops->rx_desc_get_first_msdu(desc);
|
||||
}
|
||||
|
||||
int
|
||||
qwx_hw_ipq8074_rx_desc_mac_addr2_valid(struct hal_rx_desc *desc)
|
||||
{
|
||||
|
@ -1503,7 +1793,8 @@ qwx_hw_ipq8074_mac_from_pdev_id(int pdev_idx)
|
|||
}
|
||||
}
|
||||
|
||||
uint8_t qwx_hw_ipq6018_mac_from_pdev_id(int pdev_idx)
|
||||
uint8_t
|
||||
qwx_hw_ipq6018_mac_from_pdev_id(int pdev_idx)
|
||||
{
|
||||
return pdev_idx;
|
||||
}
|
||||
|
@ -1524,7 +1815,9 @@ const struct ath11k_hw_ops ipq8074_ops = {
|
|||
.mac_id_to_srng_id = qwx_hw_mac_id_to_srng_id_ipq8074,
|
||||
#if notyet
|
||||
.tx_mesh_enable = ath11k_hw_ipq8074_tx_mesh_enable,
|
||||
.rx_desc_get_first_msdu = ath11k_hw_ipq8074_rx_desc_get_first_msdu,
|
||||
#endif
|
||||
.rx_desc_get_first_msdu = qwx_hw_ipq8074_rx_desc_get_first_msdu,
|
||||
#if notyet
|
||||
.rx_desc_get_last_msdu = ath11k_hw_ipq8074_rx_desc_get_last_msdu,
|
||||
#endif
|
||||
.rx_desc_get_l3_pad_bytes = qwx_hw_ipq8074_rx_desc_get_l3_pad_bytes,
|
||||
|
@ -1576,7 +1869,9 @@ const struct ath11k_hw_ops ipq6018_ops = {
|
|||
.mac_id_to_srng_id = qwx_hw_mac_id_to_srng_id_ipq8074,
|
||||
#if notyet
|
||||
.tx_mesh_enable = ath11k_hw_ipq8074_tx_mesh_enable,
|
||||
.rx_desc_get_first_msdu = ath11k_hw_ipq8074_rx_desc_get_first_msdu,
|
||||
#endif
|
||||
.rx_desc_get_first_msdu = qwx_hw_ipq8074_rx_desc_get_first_msdu,
|
||||
#if notyet
|
||||
.rx_desc_get_last_msdu = ath11k_hw_ipq8074_rx_desc_get_last_msdu,
|
||||
#endif
|
||||
.rx_desc_get_l3_pad_bytes = qwx_hw_ipq8074_rx_desc_get_l3_pad_bytes,
|
||||
|
@ -1628,7 +1923,9 @@ const struct ath11k_hw_ops qca6390_ops = {
|
|||
.mac_id_to_srng_id = qwx_hw_mac_id_to_srng_id_qca6390,
|
||||
#if notyet
|
||||
.tx_mesh_enable = ath11k_hw_ipq8074_tx_mesh_enable,
|
||||
.rx_desc_get_first_msdu = ath11k_hw_ipq8074_rx_desc_get_first_msdu,
|
||||
#endif
|
||||
.rx_desc_get_first_msdu = qwx_hw_ipq8074_rx_desc_get_first_msdu,
|
||||
#if notyet
|
||||
.rx_desc_get_last_msdu = ath11k_hw_ipq8074_rx_desc_get_last_msdu,
|
||||
#endif
|
||||
.rx_desc_get_l3_pad_bytes = qwx_hw_ipq8074_rx_desc_get_l3_pad_bytes,
|
||||
|
@ -1680,7 +1977,9 @@ const struct ath11k_hw_ops qcn9074_ops = {
|
|||
.mac_id_to_srng_id = qwx_hw_mac_id_to_srng_id_ipq8074,
|
||||
#if notyet
|
||||
.tx_mesh_enable = ath11k_hw_qcn9074_tx_mesh_enable,
|
||||
.rx_desc_get_first_msdu = ath11k_hw_qcn9074_rx_desc_get_first_msdu,
|
||||
#endif
|
||||
.rx_desc_get_first_msdu = qwx_hw_qcn9074_rx_desc_get_first_msdu,
|
||||
#if notyet
|
||||
.rx_desc_get_last_msdu = ath11k_hw_qcn9074_rx_desc_get_last_msdu,
|
||||
#endif
|
||||
.rx_desc_get_l3_pad_bytes = qwx_hw_qcn9074_rx_desc_get_l3_pad_bytes,
|
||||
|
@ -1732,7 +2031,9 @@ const struct ath11k_hw_ops wcn6855_ops = {
|
|||
.mac_id_to_srng_id = qwx_hw_mac_id_to_srng_id_qca6390,
|
||||
#if notyet
|
||||
.tx_mesh_enable = ath11k_hw_wcn6855_tx_mesh_enable,
|
||||
.rx_desc_get_first_msdu = ath11k_hw_wcn6855_rx_desc_get_first_msdu,
|
||||
#endif
|
||||
.rx_desc_get_first_msdu = qwx_hw_wcn6855_rx_desc_get_first_msdu,
|
||||
#if notyet
|
||||
.rx_desc_get_last_msdu = ath11k_hw_wcn6855_rx_desc_get_last_msdu,
|
||||
#endif
|
||||
.rx_desc_get_l3_pad_bytes = qwx_hw_wcn6855_rx_desc_get_l3_pad_bytes,
|
||||
|
@ -1784,7 +2085,9 @@ const struct ath11k_hw_ops wcn6750_ops = {
|
|||
.mac_id_to_srng_id = qwx_hw_mac_id_to_srng_id_qca6390,
|
||||
#if notyet
|
||||
.tx_mesh_enable = ath11k_hw_qcn9074_tx_mesh_enable,
|
||||
.rx_desc_get_first_msdu = ath11k_hw_qcn9074_rx_desc_get_first_msdu,
|
||||
#endif
|
||||
.rx_desc_get_first_msdu = qwx_hw_qcn9074_rx_desc_get_first_msdu,
|
||||
#if notyet
|
||||
.rx_desc_get_last_msdu = ath11k_hw_qcn9074_rx_desc_get_last_msdu,
|
||||
#endif
|
||||
.rx_desc_get_l3_pad_bytes = qwx_hw_qcn9074_rx_desc_get_l3_pad_bytes,
|
||||
|
@ -11826,8 +12129,8 @@ qwx_print_reg_rule(struct qwx_softc *sc, const char *band,
|
|||
}
|
||||
}
|
||||
|
||||
struct cur_reg_rule
|
||||
*qwx_create_reg_rules_from_wmi(uint32_t num_reg_rules,
|
||||
struct cur_reg_rule *
|
||||
qwx_create_reg_rules_from_wmi(uint32_t num_reg_rules,
|
||||
struct wmi_regulatory_rule_struct *wmi_reg_rule)
|
||||
{
|
||||
struct cur_reg_rule *reg_rule_ptr;
|
||||
|
@ -12990,6 +13293,84 @@ qwx_roam_event(struct qwx_softc *sc, struct mbuf *m)
|
|||
}
|
||||
}
|
||||
|
||||
int
|
||||
qwx_pull_vdev_install_key_compl_ev(struct qwx_softc *sc, struct mbuf *m,
|
||||
struct wmi_vdev_install_key_complete_arg *arg)
|
||||
{
|
||||
const void **tb;
|
||||
const struct wmi_vdev_install_key_compl_event *ev;
|
||||
int ret;
|
||||
|
||||
tb = qwx_wmi_tlv_parse_alloc(sc, mtod(m, void *), m->m_pkthdr.len);
|
||||
if (tb == NULL) {
|
||||
ret = ENOMEM;
|
||||
printf("%s: failed to parse tlv: %d\n",
|
||||
sc->sc_dev.dv_xname, ret);
|
||||
return ret;
|
||||
}
|
||||
|
||||
ev = tb[WMI_TAG_VDEV_INSTALL_KEY_COMPLETE_EVENT];
|
||||
if (!ev) {
|
||||
printf("%s: failed to fetch vdev install key compl ev\n",
|
||||
sc->sc_dev.dv_xname);
|
||||
free(tb, M_DEVBUF, WMI_TAG_MAX * sizeof(*tb));
|
||||
return EPROTO;
|
||||
}
|
||||
|
||||
arg->vdev_id = ev->vdev_id;
|
||||
arg->macaddr = ev->peer_macaddr.addr;
|
||||
arg->key_idx = ev->key_idx;
|
||||
arg->key_flags = ev->key_flags;
|
||||
arg->status = ev->status;
|
||||
|
||||
free(tb, M_DEVBUF, WMI_TAG_MAX * sizeof(*tb));
|
||||
return 0;
|
||||
}
|
||||
|
||||
void
|
||||
qwx_vdev_install_key_compl_event(struct qwx_softc *sc, struct mbuf *m)
|
||||
{
|
||||
struct wmi_vdev_install_key_complete_arg install_key_compl = { 0 };
|
||||
struct qwx_vif *arvif;
|
||||
|
||||
if (qwx_pull_vdev_install_key_compl_ev(sc, m,
|
||||
&install_key_compl) != 0) {
|
||||
printf("%s: failed to extract install key compl event\n",
|
||||
sc->sc_dev.dv_xname);
|
||||
return;
|
||||
}
|
||||
|
||||
DNPRINTF(QWX_D_WMI, "%s: event vdev install key ev idx %d flags %08x "
|
||||
"macaddr %s status %d\n", __func__, install_key_compl.key_idx,
|
||||
install_key_compl.key_flags,
|
||||
ether_sprintf((u_char *)install_key_compl.macaddr),
|
||||
install_key_compl.status);
|
||||
|
||||
TAILQ_FOREACH(arvif, &sc->vif_list, entry) {
|
||||
if (arvif->vdev_id == install_key_compl.vdev_id)
|
||||
break;
|
||||
}
|
||||
if (!arvif) {
|
||||
printf("%s: invalid vdev id in install key compl ev %d\n",
|
||||
sc->sc_dev.dv_xname, install_key_compl.vdev_id);
|
||||
return;
|
||||
}
|
||||
|
||||
sc->install_key_status = 0;
|
||||
|
||||
if (install_key_compl.status !=
|
||||
WMI_VDEV_INSTALL_KEY_COMPL_STATUS_SUCCESS) {
|
||||
printf("%s: install key failed for %s status %d\n",
|
||||
sc->sc_dev.dv_xname,
|
||||
ether_sprintf((u_char *)install_key_compl.macaddr),
|
||||
install_key_compl.status);
|
||||
sc->install_key_status = install_key_compl.status;
|
||||
}
|
||||
|
||||
sc->install_key_done = 1;
|
||||
wakeup(&sc->install_key_done);
|
||||
}
|
||||
|
||||
void
|
||||
qwx_wmi_tlv_op_rx(struct qwx_softc *sc, struct mbuf *m)
|
||||
{
|
||||
|
@ -13060,10 +13441,10 @@ qwx_wmi_tlv_op_rx(struct qwx_softc *sc, struct mbuf *m)
|
|||
case WMI_PDEV_BSS_CHAN_INFO_EVENTID:
|
||||
ath11k_pdev_bss_chan_info_event(ab, skb);
|
||||
break;
|
||||
case WMI_VDEV_INSTALL_KEY_COMPLETE_EVENTID:
|
||||
ath11k_vdev_install_key_compl_event(ab, skb);
|
||||
break;
|
||||
#endif
|
||||
case WMI_VDEV_INSTALL_KEY_COMPLETE_EVENTID:
|
||||
qwx_vdev_install_key_compl_event(sc, m);
|
||||
break;
|
||||
case WMI_SERVICE_AVAILABLE_EVENTID:
|
||||
qwx_service_available_event(sc, m);
|
||||
break;
|
||||
|
@ -15813,6 +16194,16 @@ qwx_dp_rx_get_attention(struct qwx_softc *sc, struct hal_rx_desc *desc)
|
|||
return sc->hw_params.hw_ops->rx_desc_get_attention(desc);
|
||||
}
|
||||
|
||||
int
|
||||
qwx_dp_rx_h_attn_is_mcbc(struct qwx_softc *sc, struct hal_rx_desc *desc)
|
||||
{
|
||||
struct rx_attention *attn = qwx_dp_rx_get_attention(sc, desc);
|
||||
|
||||
return qwx_dp_rx_h_msdu_end_first_msdu(sc, desc) &&
|
||||
(!!FIELD_GET(RX_ATTENTION_INFO1_MCAST_BCAST,
|
||||
le32toh(attn->info1)));
|
||||
}
|
||||
|
||||
static inline uint8_t
|
||||
qwx_dp_rx_h_msdu_end_l3pad(struct qwx_softc *sc, struct hal_rx_desc *desc)
|
||||
{
|
||||
|
@ -15873,6 +16264,13 @@ qwx_dp_rx_h_attn_msdu_len_err(struct qwx_softc *sc, struct hal_rx_desc *desc)
|
|||
return errmap & DP_RX_MPDU_ERR_MSDU_LEN;
|
||||
}
|
||||
|
||||
int
|
||||
qwx_dp_rx_h_attn_is_decrypted(struct rx_attention *attn)
|
||||
{
|
||||
return (FIELD_GET(RX_ATTENTION_INFO2_DCRYPT_STATUS_CODE,
|
||||
le32toh(attn->info2)) == RX_DESC_DECRYPT_STATUS_CODE_OK);
|
||||
}
|
||||
|
||||
int
|
||||
qwx_dp_rx_msdu_coalesce(struct qwx_softc *sc, struct qwx_rx_msdu_list *msdu_list,
|
||||
struct qwx_rx_msdu *first, struct qwx_rx_msdu *last, uint8_t l3pad_bytes,
|
||||
|
@ -15908,7 +16306,13 @@ void
|
|||
qwx_dp_rx_h_undecap_nwifi(struct qwx_softc *sc, struct qwx_rx_msdu *msdu,
|
||||
uint8_t *first_hdr, enum hal_encrypt_type enctype)
|
||||
{
|
||||
printf("%s: not implemented\n", __func__);
|
||||
/*
|
||||
* This function will need to do some work once we are receiving
|
||||
* aggregated frames. For now, it needs to do nothing.
|
||||
*/
|
||||
|
||||
if (!msdu->is_first_msdu)
|
||||
printf("%s: not implemented\n", __func__);
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -16034,28 +16438,28 @@ qwx_dp_rx_h_undecap(struct qwx_softc *sc, struct qwx_rx_msdu *msdu,
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
int
|
||||
qwx_dp_rx_h_mpdu(struct qwx_softc *sc, struct qwx_rx_msdu *msdu,
|
||||
struct hal_rx_desc *rx_desc)
|
||||
{
|
||||
#if 0
|
||||
bool fill_crypto_hdr;
|
||||
#endif
|
||||
struct ieee80211com *ic = &sc->sc_ic;
|
||||
int fill_crypto_hdr = 0;
|
||||
enum hal_encrypt_type enctype;
|
||||
int is_decrypted = 0;
|
||||
#if 0
|
||||
struct ath11k_skb_rxcb *rxcb;
|
||||
struct ieee80211_hdr *hdr;
|
||||
#endif
|
||||
struct ieee80211_frame *wh;
|
||||
#if 0
|
||||
struct ath11k_peer *peer;
|
||||
#endif
|
||||
struct rx_attention *rx_attention;
|
||||
u32 err_bitmap;
|
||||
|
||||
/* PN for multicast packets will be checked in mac80211 */
|
||||
rxcb = ATH11K_SKB_RXCB(msdu);
|
||||
fill_crypto_hdr = ath11k_dp_rx_h_attn_is_mcbc(ar->ab, rx_desc);
|
||||
rxcb->is_mcbc = fill_crypto_hdr;
|
||||
uint32_t err_bitmap;
|
||||
|
||||
/* PN for multicast packets will be checked in net80211 */
|
||||
fill_crypto_hdr = qwx_dp_rx_h_attn_is_mcbc(sc, rx_desc);
|
||||
msdu->is_mcbc = fill_crypto_hdr;
|
||||
#if 0
|
||||
if (rxcb->is_mcbc) {
|
||||
rxcb->peer_id = ath11k_dp_rx_h_mpdu_start_peer_id(ar->ab, rx_desc);
|
||||
rxcb->seq_no = ath11k_dp_rx_h_mpdu_start_seq_no(ar->ab, rx_desc);
|
||||
|
@ -16074,12 +16478,12 @@ qwx_dp_rx_h_mpdu(struct qwx_softc *sc, struct qwx_rx_msdu *msdu,
|
|||
#if 0
|
||||
}
|
||||
spin_unlock_bh(&ar->ab->base_lock);
|
||||
|
||||
rx_attention = ath11k_dp_rx_get_attention(ar->ab, rx_desc);
|
||||
err_bitmap = ath11k_dp_rx_h_attn_mpdu_err(rx_attention);
|
||||
#endif
|
||||
rx_attention = qwx_dp_rx_get_attention(sc, rx_desc);
|
||||
err_bitmap = qwx_dp_rx_h_attn_mpdu_err(rx_attention);
|
||||
if (enctype != HAL_ENCRYPT_TYPE_OPEN && !err_bitmap)
|
||||
is_decrypted = ath11k_dp_rx_h_attn_is_decrypted(rx_attention);
|
||||
|
||||
is_decrypted = qwx_dp_rx_h_attn_is_decrypted(rx_attention);
|
||||
#if 0
|
||||
/* Clear per-MPDU flags while leaving per-PPDU flags intact */
|
||||
rx_status->flag &= ~(RX_FLAG_FAILED_FCS_CRC |
|
||||
RX_FLAG_MMIC_ERROR |
|
||||
|
@ -16087,12 +16491,23 @@ qwx_dp_rx_h_mpdu(struct qwx_softc *sc, struct qwx_rx_msdu *msdu,
|
|||
RX_FLAG_IV_STRIPPED |
|
||||
RX_FLAG_MMIC_STRIPPED);
|
||||
|
||||
if (err_bitmap & DP_RX_MPDU_ERR_FCS)
|
||||
rx_status->flag |= RX_FLAG_FAILED_FCS_CRC;
|
||||
#endif
|
||||
if (err_bitmap & DP_RX_MPDU_ERR_FCS) {
|
||||
if (ic->ic_flags & IEEE80211_F_RSNON)
|
||||
ic->ic_stats.is_rx_decryptcrc++;
|
||||
else
|
||||
ic->ic_stats.is_rx_decap++;
|
||||
}
|
||||
|
||||
/* XXX Trusting firmware to handle Michael MIC counter-measures... */
|
||||
if (err_bitmap & DP_RX_MPDU_ERR_TKIP_MIC)
|
||||
rx_status->flag |= RX_FLAG_MMIC_ERROR;
|
||||
ic->ic_stats.is_rx_locmicfail++;
|
||||
|
||||
if (err_bitmap & DP_RX_MPDU_ERR_DECRYPT)
|
||||
ic->ic_stats.is_rx_wepfail++;
|
||||
|
||||
if (is_decrypted) {
|
||||
#if 0
|
||||
rx_status->flag |= RX_FLAG_DECRYPTED | RX_FLAG_MMIC_STRIPPED;
|
||||
|
||||
if (fill_crypto_hdr)
|
||||
|
@ -16101,21 +16516,23 @@ qwx_dp_rx_h_mpdu(struct qwx_softc *sc, struct qwx_rx_msdu *msdu,
|
|||
else
|
||||
rx_status->flag |= RX_FLAG_IV_STRIPPED |
|
||||
RX_FLAG_PN_VALIDATED;
|
||||
#endif
|
||||
msdu->rxi.rxi_flags |= IEEE80211_RXI_HWDEC;
|
||||
}
|
||||
|
||||
#if 0
|
||||
ath11k_dp_rx_h_csum_offload(ar, msdu);
|
||||
#endif
|
||||
qwx_dp_rx_h_undecap(sc, msdu, rx_desc, enctype, is_decrypted);
|
||||
#if 0
|
||||
if (!is_decrypted || fill_crypto_hdr)
|
||||
return;
|
||||
|
||||
if (ath11k_dp_rx_h_msdu_start_decap_type(ar->ab, rx_desc) !=
|
||||
if (is_decrypted && !fill_crypto_hdr &&
|
||||
qwx_dp_rx_h_msdu_start_decap_type(sc, rx_desc) !=
|
||||
DP_RX_DECAP_TYPE_ETHERNET2_DIX) {
|
||||
hdr = (void *)msdu->data;
|
||||
hdr->frame_control &= ~__cpu_to_le16(IEEE80211_FCTL_PROTECTED);
|
||||
/* Hardware has stripped the IV. */
|
||||
wh = mtod(msdu->m, struct ieee80211_frame *);
|
||||
wh->i_fc[1] &= ~IEEE80211_FC1_PROTECTED;
|
||||
}
|
||||
#endif
|
||||
|
||||
return err_bitmap ? EIO : 0;
|
||||
}
|
||||
|
||||
int
|
||||
|
@ -16189,9 +16606,8 @@ qwx_dp_rx_process_msdu(struct qwx_softc *sc, struct qwx_rx_msdu *msdu,
|
|||
|
||||
memset(&msdu->rxi, 0, sizeof(msdu->rxi));
|
||||
qwx_dp_rx_h_ppdu(sc, rx_desc, &msdu->rxi);
|
||||
qwx_dp_rx_h_mpdu(sc, msdu, rx_desc);
|
||||
|
||||
return 0;
|
||||
return qwx_dp_rx_h_mpdu(sc, msdu, rx_desc);
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -18003,6 +18419,65 @@ qwx_wmi_send_peer_delete_cmd(struct qwx_softc *sc, const uint8_t *peer_addr,
|
|||
return 0;
|
||||
}
|
||||
|
||||
int
|
||||
qwx_wmi_vdev_install_key(struct qwx_softc *sc,
|
||||
struct wmi_vdev_install_key_arg *arg, uint8_t pdev_id)
|
||||
{
|
||||
struct qwx_pdev_wmi *wmi = &sc->wmi.wmi[pdev_id];
|
||||
struct wmi_vdev_install_key_cmd *cmd;
|
||||
struct wmi_tlv *tlv;
|
||||
struct mbuf *m;
|
||||
int ret, len;
|
||||
int key_len_aligned = roundup(arg->key_len, sizeof(uint32_t));
|
||||
|
||||
len = sizeof(*cmd) + TLV_HDR_SIZE + key_len_aligned;
|
||||
|
||||
m = qwx_wmi_alloc_mbuf(len);
|
||||
if (m == NULL)
|
||||
return -ENOMEM;
|
||||
|
||||
cmd = (struct wmi_vdev_install_key_cmd *)(mtod(m, uint8_t *) +
|
||||
sizeof(struct ath11k_htc_hdr) + sizeof(struct wmi_cmd_hdr));
|
||||
cmd->tlv_header = FIELD_PREP(WMI_TLV_TAG,
|
||||
WMI_TAG_VDEV_INSTALL_KEY_CMD) |
|
||||
FIELD_PREP(WMI_TLV_LEN, sizeof(*cmd) - TLV_HDR_SIZE);
|
||||
cmd->vdev_id = arg->vdev_id;
|
||||
IEEE80211_ADDR_COPY(cmd->peer_macaddr.addr, arg->macaddr);
|
||||
cmd->key_idx = arg->key_idx;
|
||||
cmd->key_flags = arg->key_flags;
|
||||
cmd->key_cipher = arg->key_cipher;
|
||||
cmd->key_len = arg->key_len;
|
||||
cmd->key_txmic_len = arg->key_txmic_len;
|
||||
cmd->key_rxmic_len = arg->key_rxmic_len;
|
||||
|
||||
if (arg->key_rsc_counter)
|
||||
memcpy(&cmd->key_rsc_counter, &arg->key_rsc_counter,
|
||||
sizeof(struct wmi_key_seq_counter));
|
||||
|
||||
tlv = (struct wmi_tlv *)(mtod(m, uint8_t *) +
|
||||
sizeof(struct ath11k_htc_hdr) + sizeof(struct wmi_cmd_hdr) +
|
||||
sizeof(*cmd));
|
||||
tlv->header = FIELD_PREP(WMI_TLV_TAG, WMI_TAG_ARRAY_BYTE) |
|
||||
FIELD_PREP(WMI_TLV_LEN, key_len_aligned);
|
||||
if (arg->key_data)
|
||||
memcpy(tlv->value, (uint8_t *)arg->key_data,
|
||||
key_len_aligned);
|
||||
|
||||
ret = qwx_wmi_cmd_send(wmi, m, WMI_VDEV_INSTALL_KEY_CMDID);
|
||||
if (ret) {
|
||||
printf("%s: failed to send WMI_VDEV_INSTALL_KEY cmd\n",
|
||||
sc->sc_dev.dv_xname);
|
||||
m_freem(m);
|
||||
return ret;
|
||||
}
|
||||
|
||||
DNPRINTF(QWX_D_WMI,
|
||||
"%s: cmd vdev install key idx %d cipher %d len %d\n",
|
||||
__func__, arg->key_idx, arg->key_cipher, arg->key_len);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
void
|
||||
qwx_wmi_copy_peer_flags(struct wmi_peer_assoc_complete_cmd *cmd,
|
||||
struct peer_assoc_params *param, int hw_crypto_disabled)
|
||||
|
@ -23302,6 +23777,26 @@ qwx_dp_rx_frags_cleanup(struct qwx_softc *sc, struct dp_rx_tid *rx_tid,
|
|||
#endif
|
||||
}
|
||||
|
||||
void
|
||||
qwx_peer_frags_flush(struct qwx_softc *sc, struct ath11k_peer *peer)
|
||||
{
|
||||
struct dp_rx_tid *rx_tid;
|
||||
int i;
|
||||
#ifdef notyet
|
||||
lockdep_assert_held(&ar->ab->base_lock);
|
||||
#endif
|
||||
for (i = 0; i < IEEE80211_NUM_TID; i++) {
|
||||
rx_tid = &peer->rx_tid[i];
|
||||
|
||||
qwx_dp_rx_frags_cleanup(sc, rx_tid, 1);
|
||||
#if 0
|
||||
spin_unlock_bh(&ar->ab->base_lock);
|
||||
del_timer_sync(&rx_tid->frag_timer);
|
||||
spin_lock_bh(&ar->ab->base_lock);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
qwx_peer_rx_tid_cleanup(struct qwx_softc *sc, struct ath11k_peer *peer)
|
||||
{
|
||||
|
@ -23556,6 +24051,70 @@ peer_clean:
|
|||
return ret;
|
||||
}
|
||||
|
||||
int
|
||||
qwx_dp_peer_rx_pn_replay_config(struct qwx_softc *sc, struct qwx_vif *arvif,
|
||||
struct ieee80211_node *ni, struct ieee80211_key *k, int delete_key)
|
||||
{
|
||||
struct ath11k_hal_reo_cmd cmd = {0};
|
||||
struct qwx_node *nq = (struct qwx_node *)ni;
|
||||
struct ath11k_peer *peer = &nq->peer;
|
||||
struct dp_rx_tid *rx_tid;
|
||||
uint8_t tid;
|
||||
int ret = 0;
|
||||
|
||||
/*
|
||||
* NOTE: Enable PN/TSC replay check offload only for unicast frames.
|
||||
* We use net80211 PN/TSC replay check functionality for bcast/mcast
|
||||
* for now.
|
||||
*/
|
||||
if (k->k_flags & IEEE80211_KEY_GROUP)
|
||||
return 0;
|
||||
|
||||
cmd.flag |= HAL_REO_CMD_FLG_NEED_STATUS;
|
||||
cmd.upd0 |= HAL_REO_CMD_UPD0_PN |
|
||||
HAL_REO_CMD_UPD0_PN_SIZE |
|
||||
HAL_REO_CMD_UPD0_PN_VALID |
|
||||
HAL_REO_CMD_UPD0_PN_CHECK |
|
||||
HAL_REO_CMD_UPD0_SVLD;
|
||||
|
||||
switch (k->k_cipher) {
|
||||
case IEEE80211_CIPHER_TKIP:
|
||||
case IEEE80211_CIPHER_CCMP:
|
||||
#if 0
|
||||
case WLAN_CIPHER_SUITE_CCMP_256:
|
||||
case WLAN_CIPHER_SUITE_GCMP:
|
||||
case WLAN_CIPHER_SUITE_GCMP_256:
|
||||
#endif
|
||||
if (!delete_key) {
|
||||
cmd.upd1 |= HAL_REO_CMD_UPD1_PN_CHECK;
|
||||
cmd.pn_size = 48;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
printf("%s: cipher %u is not supported\n",
|
||||
sc->sc_dev.dv_xname, k->k_cipher);
|
||||
return EOPNOTSUPP;
|
||||
}
|
||||
|
||||
for (tid = 0; tid < IEEE80211_NUM_TID; tid++) {
|
||||
rx_tid = &peer->rx_tid[tid];
|
||||
if (!rx_tid->active)
|
||||
continue;
|
||||
cmd.addr_lo = rx_tid->paddr & 0xffffffff;
|
||||
cmd.addr_hi = (rx_tid->paddr >> 32);
|
||||
ret = qwx_dp_tx_send_reo_cmd(sc, rx_tid,
|
||||
HAL_REO_CMD_UPDATE_RX_QUEUE, &cmd, NULL);
|
||||
if (ret) {
|
||||
printf("%s: failed to configure rx tid %d queue "
|
||||
"for pn replay detection %d\n",
|
||||
sc->sc_dev.dv_xname, tid, ret);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
enum hal_tcl_encap_type
|
||||
qwx_dp_tx_get_encap_type(struct qwx_softc *sc)
|
||||
{
|
||||
|
@ -23676,20 +24235,25 @@ qwx_dp_tx(struct qwx_softc *sc, struct qwx_vif *arvif, uint8_t pdev_id,
|
|||
|
||||
ti.meta_data_flags = arvif->tcl_metadata;
|
||||
|
||||
if (ti.encap_type == HAL_TCL_ENCAP_TYPE_RAW) {
|
||||
#if 0
|
||||
if (skb_cb->flags & ATH11K_SKB_CIPHER_SET) {
|
||||
ti.encrypt_type =
|
||||
ath11k_dp_tx_get_encrypt_type(skb_cb->cipher);
|
||||
|
||||
if (ieee80211_has_protected(hdr->frame_control))
|
||||
skb_put(skb, IEEE80211_CCMP_MIC_LEN);
|
||||
} else
|
||||
#endif
|
||||
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. */
|
||||
ti.encrypt_type = HAL_ENCRYPT_TYPE_OPEN;
|
||||
break;
|
||||
}
|
||||
|
||||
if (wh->i_fc[1] & IEEE80211_FC1_PROTECTED) {
|
||||
k = ieee80211_get_txkey(ic, wh, ni);
|
||||
if (ti.encrypt_type == HAL_ENCRYPT_TYPE_OPEN) {
|
||||
if ((m = ieee80211_encrypt(ic, m, k)) == NULL)
|
||||
return ENOBUFS;
|
||||
/* 802.11 header may have moved. */
|
||||
|
@ -24582,6 +25146,25 @@ qwx_peer_assoc_h_basic(struct qwx_softc *sc, struct qwx_vif *arvif,
|
|||
arg->peer_caps = ni->ni_capinfo;
|
||||
}
|
||||
|
||||
void
|
||||
qwx_peer_assoc_h_crypto(struct qwx_softc *sc, struct qwx_vif *arvif,
|
||||
struct ieee80211_node *ni, struct peer_assoc_params *arg)
|
||||
{
|
||||
struct ieee80211com *ic = &sc->sc_ic;
|
||||
|
||||
if (ic->ic_flags & IEEE80211_F_RSNON) {
|
||||
arg->need_ptk_4_way = 1;
|
||||
if (ni->ni_rsnprotos == IEEE80211_PROTO_WPA)
|
||||
arg->need_gtk_2_way = 1;
|
||||
}
|
||||
#if 0
|
||||
if (sta->mfp) {
|
||||
/* TODO: Need to check if FW supports PMF? */
|
||||
arg->is_pmf_enabled = true;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
int
|
||||
qwx_mac_rate_is_cck(uint8_t rate)
|
||||
{
|
||||
|
@ -24641,9 +25224,7 @@ qwx_peer_assoc_prepare(struct qwx_softc *sc, struct qwx_vif *arvif,
|
|||
|
||||
arg->peer_new_assoc = !reassoc;
|
||||
qwx_peer_assoc_h_basic(sc, arvif, ni, arg);
|
||||
#if 0
|
||||
qwx_peer_assoc_h_crypto(sc, arvif, ni, arg);
|
||||
#endif
|
||||
qwx_peer_assoc_h_rates(ni, arg);
|
||||
qwx_peer_assoc_h_phymode(sc, ni, arg);
|
||||
#if 0
|
||||
|
@ -24757,12 +25338,15 @@ qwx_run_stop(struct qwx_softc *sc)
|
|||
struct ieee80211com *ic = &sc->sc_ic;
|
||||
struct qwx_vif *arvif = TAILQ_FIRST(&sc->vif_list); /* XXX */
|
||||
uint8_t pdev_id = 0; /* TODO: derive pdev ID somehow? */
|
||||
struct qwx_node *nq = (void *)ic->ic_bss;
|
||||
int ret;
|
||||
|
||||
sc->ops.irq_disable(sc);
|
||||
|
||||
if (ic->ic_opmode == IEEE80211_M_STA)
|
||||
if (ic->ic_opmode == IEEE80211_M_STA) {
|
||||
ic->ic_bss->ni_txrate = 0;
|
||||
nq->flags = 0;
|
||||
}
|
||||
|
||||
ret = qwx_wmi_vdev_down(sc, arvif->vdev_id, pdev_id);
|
||||
if (ret)
|
||||
|
@ -24801,6 +25385,7 @@ qwx_attach(struct qwx_softc *sc)
|
|||
|
||||
task_set(&sc->init_task, qwx_init_task, sc);
|
||||
task_set(&sc->newstate_task, qwx_newstate_task, sc);
|
||||
task_set(&sc->setkey_task, qwx_setkey_task, sc);
|
||||
timeout_set_proc(&sc->scan.timeout, qwx_scan_timeout, sc);
|
||||
#if NBPFILTER > 0
|
||||
qwx_radiotap_attach(sc);
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $OpenBSD: qwxvar.h,v 1.25 2024/05/13 01:15:50 jsg Exp $ */
|
||||
/* $OpenBSD: qwxvar.h,v 1.26 2024/05/28 08:34:52 stsp Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 2018-2019 The Linux Foundation.
|
||||
|
@ -264,7 +264,9 @@ struct ath11k_hw_ops {
|
|||
#if notyet
|
||||
void (*tx_mesh_enable)(struct ath11k_base *ab,
|
||||
struct hal_tcl_data_cmd *tcl_cmd);
|
||||
bool (*rx_desc_get_first_msdu)(struct hal_rx_desc *desc);
|
||||
#endif
|
||||
int (*rx_desc_get_first_msdu)(struct hal_rx_desc *desc);
|
||||
#if notyet
|
||||
bool (*rx_desc_get_last_msdu)(struct hal_rx_desc *desc);
|
||||
#endif
|
||||
uint8_t (*rx_desc_get_l3_pad_bytes)(struct hal_rx_desc *desc);
|
||||
|
@ -1745,6 +1747,14 @@ struct qwx_tx_radiotap_header {
|
|||
|
||||
#define IWX_TX_RADIOTAP_PRESENT 0 /* TODO add more information */
|
||||
|
||||
struct qwx_setkey_task_arg {
|
||||
struct ieee80211_node *ni;
|
||||
struct ieee80211_key *k;
|
||||
int cmd;
|
||||
#define QWX_ADD_KEY 1
|
||||
#define QWX_DEL_KEY 2
|
||||
};
|
||||
|
||||
struct qwx_softc {
|
||||
struct device sc_dev;
|
||||
struct ieee80211com sc_ic;
|
||||
|
@ -1762,6 +1772,23 @@ struct qwx_softc {
|
|||
enum ieee80211_state ns_nstate;
|
||||
int ns_arg;
|
||||
|
||||
/* Task for setting encryption keys and its arguments. */
|
||||
struct task setkey_task;
|
||||
/*
|
||||
* At present we need to process at most two keys at once:
|
||||
* Our pairwise key and a group key.
|
||||
* When hostap mode is implemented this array needs to grow or
|
||||
* it might become a bottleneck for associations that occur at
|
||||
* roughly the same time.
|
||||
*/
|
||||
struct qwx_setkey_task_arg setkey_arg[2];
|
||||
int setkey_cur;
|
||||
int setkey_tail;
|
||||
int setkey_nkeys;
|
||||
|
||||
int install_key_done;
|
||||
int install_key_status;
|
||||
|
||||
enum ath11k_11d_state state_11d;
|
||||
int completed_11d_scan;
|
||||
uint32_t vdev_id_11d_scan;
|
||||
|
@ -1962,9 +1989,16 @@ struct ath11k_peer {
|
|||
struct qwx_node {
|
||||
struct ieee80211_node ni;
|
||||
struct ath11k_peer peer;
|
||||
unsigned int flags;
|
||||
#define QWX_NODE_FLAG_HAVE_PAIRWISE_KEY 0x01
|
||||
#define QWX_NODE_FLAG_HAVE_GROUP_KEY 0x02
|
||||
};
|
||||
|
||||
struct ieee80211_node *qwx_node_alloc(struct ieee80211com *);
|
||||
int qwx_set_key(struct ieee80211com *, struct ieee80211_node *,
|
||||
struct ieee80211_key *);
|
||||
void qwx_delete_key(struct ieee80211com *, struct ieee80211_node *,
|
||||
struct ieee80211_key *);
|
||||
|
||||
void qwx_qrtr_recv_msg(struct qwx_softc *, struct mbuf *);
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $OpenBSD: ufshci.c,v 1.32 2024/05/24 20:34:06 mglocker Exp $ */
|
||||
/* $OpenBSD: ufshci.c,v 1.33 2024/05/27 10:27:58 mglocker Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 2022 Marcus Glocker <mglocker@openbsd.org>
|
||||
|
@ -62,7 +62,8 @@ void ufshci_dmamem_free(struct ufshci_softc *,
|
|||
int ufshci_init(struct ufshci_softc *);
|
||||
int ufshci_doorbell_read(struct ufshci_softc *);
|
||||
void ufshci_doorbell_write(struct ufshci_softc *, int);
|
||||
int ufshci_doorbell_poll(struct ufshci_softc *, int);
|
||||
int ufshci_doorbell_poll(struct ufshci_softc *, int,
|
||||
uint32_t);
|
||||
int ufshci_utr_cmd_nop(struct ufshci_softc *,
|
||||
struct ufshci_ccb *, struct scsi_xfer *);
|
||||
int ufshci_utr_cmd_lun(struct ufshci_softc *,
|
||||
|
@ -502,20 +503,21 @@ ufshci_doorbell_write(struct ufshci_softc *sc, int slot)
|
|||
}
|
||||
|
||||
int
|
||||
ufshci_doorbell_poll(struct ufshci_softc *sc, int slot)
|
||||
ufshci_doorbell_poll(struct ufshci_softc *sc, int slot, uint32_t timeout_ms)
|
||||
{
|
||||
uint32_t reg;
|
||||
int i, retry = 25;
|
||||
uint64_t timeout_us;
|
||||
|
||||
DPRINTF(3, "%s\n", __func__);
|
||||
|
||||
for (i = 0; i < retry; i++) {
|
||||
for (timeout_us = timeout_ms * 1000; timeout_us != 0;
|
||||
timeout_us -= 1000) {
|
||||
reg = UFSHCI_READ_4(sc, UFSHCI_REG_UTRLDBR);
|
||||
if ((reg & (1U << slot)) == 0)
|
||||
break;
|
||||
delay(10);
|
||||
delay(1000);
|
||||
}
|
||||
if (i == retry) {
|
||||
if (timeout_us == 0) {
|
||||
printf("%s: %s: timeout\n", sc->sc_dev.dv_xname, __func__);
|
||||
return -1;
|
||||
}
|
||||
|
@ -1620,7 +1622,7 @@ ufshci_scsi_inquiry(struct scsi_xfer *xs)
|
|||
goto error2;
|
||||
|
||||
if (ISSET(xs->flags, SCSI_POLL)) {
|
||||
if (ufshci_doorbell_poll(sc, ccb->ccb_slot) == 0) {
|
||||
if (ufshci_doorbell_poll(sc, ccb->ccb_slot, xs->timeout) == 0) {
|
||||
ccb->ccb_done(sc, ccb);
|
||||
return;
|
||||
}
|
||||
|
@ -1675,7 +1677,7 @@ ufshci_scsi_capacity16(struct scsi_xfer *xs)
|
|||
goto error2;
|
||||
|
||||
if (ISSET(xs->flags, SCSI_POLL)) {
|
||||
if (ufshci_doorbell_poll(sc, ccb->ccb_slot) == 0) {
|
||||
if (ufshci_doorbell_poll(sc, ccb->ccb_slot, xs->timeout) == 0) {
|
||||
ccb->ccb_done(sc, ccb);
|
||||
return;
|
||||
}
|
||||
|
@ -1730,7 +1732,7 @@ ufshci_scsi_capacity(struct scsi_xfer *xs)
|
|||
goto error2;
|
||||
|
||||
if (ISSET(xs->flags, SCSI_POLL)) {
|
||||
if (ufshci_doorbell_poll(sc, ccb->ccb_slot) == 0) {
|
||||
if (ufshci_doorbell_poll(sc, ccb->ccb_slot, xs->timeout) == 0) {
|
||||
ccb->ccb_done(sc, ccb);
|
||||
return;
|
||||
}
|
||||
|
@ -1775,7 +1777,7 @@ ufshci_scsi_sync(struct scsi_xfer *xs)
|
|||
goto error;
|
||||
|
||||
if (ISSET(xs->flags, SCSI_POLL)) {
|
||||
if (ufshci_doorbell_poll(sc, ccb->ccb_slot) == 0) {
|
||||
if (ufshci_doorbell_poll(sc, ccb->ccb_slot, xs->timeout) == 0) {
|
||||
ccb->ccb_done(sc, ccb);
|
||||
return;
|
||||
}
|
||||
|
@ -1831,7 +1833,7 @@ ufshci_scsi_io(struct scsi_xfer *xs, int dir)
|
|||
goto error2;
|
||||
|
||||
if (ISSET(xs->flags, SCSI_POLL)) {
|
||||
if (ufshci_doorbell_poll(sc, ccb->ccb_slot) == 0) {
|
||||
if (ufshci_doorbell_poll(sc, ccb->ccb_slot, xs->timeout) == 0) {
|
||||
ccb->ccb_done(sc, ccb);
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $OpenBSD: ad1848.c,v 1.49 2024/04/13 23:44:11 jsg Exp $ */
|
||||
/* $OpenBSD: ad1848.c,v 1.50 2024/05/28 09:27:08 jsg Exp $ */
|
||||
/* $NetBSD: ad1848.c,v 1.45 1998/01/30 02:02:38 augustss Exp $ */
|
||||
|
||||
/*
|
||||
|
@ -89,7 +89,6 @@
|
|||
#include <dev/ic/ad1848reg.h>
|
||||
#include <dev/ic/cs4231reg.h>
|
||||
#include <dev/isa/ad1848var.h>
|
||||
#include <dev/isa/cs4231var.h>
|
||||
|
||||
#ifdef AUDIO_DEBUG
|
||||
#define DPRINTF(x) do { if (ad1848debug) printf x; } while (0);
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $OpenBSD: addcom_isa.c,v 1.7 2022/04/06 18:59:28 naddy Exp $ */
|
||||
/* $OpenBSD: addcom_isa.c,v 1.8 2024/05/28 05:46:32 jsg Exp $ */
|
||||
/* $NetBSD: addcom_isa.c,v 1.2 2000/04/21 20:13:41 explorer Exp $ */
|
||||
|
||||
/*
|
||||
|
@ -120,9 +120,7 @@ struct cfdriver addcom_cd = {
|
|||
};
|
||||
|
||||
int
|
||||
addcomprobe(parent, self, aux)
|
||||
struct device *parent;
|
||||
void *self, *aux;
|
||||
addcomprobe(struct device *parent, void *self, void *aux)
|
||||
{
|
||||
struct isa_attach_args *ia = aux;
|
||||
int iobase = ia->ia_iobase;
|
||||
|
@ -175,9 +173,7 @@ out:
|
|||
}
|
||||
|
||||
int
|
||||
addcomprint(aux, pnp)
|
||||
void *aux;
|
||||
const char *pnp;
|
||||
addcomprint(void *aux, const char *pnp)
|
||||
{
|
||||
struct commulti_attach_args *ca = aux;
|
||||
|
||||
|
@ -188,9 +184,7 @@ addcomprint(aux, pnp)
|
|||
}
|
||||
|
||||
void
|
||||
addcomattach(parent, self, aux)
|
||||
struct device *parent, *self;
|
||||
void *aux;
|
||||
addcomattach(struct device *parent, struct device *self, void *aux)
|
||||
{
|
||||
struct addcom_softc *sc = (void *)self;
|
||||
struct isa_attach_args *ia = aux;
|
||||
|
@ -253,8 +247,7 @@ addcomattach(parent, self, aux)
|
|||
}
|
||||
|
||||
int
|
||||
addcomintr(arg)
|
||||
void *arg;
|
||||
addcomintr(void *arg)
|
||||
{
|
||||
struct addcom_softc *sc = arg;
|
||||
int intrd, r = 0, i;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $OpenBSD: boca.c,v 1.17 2022/04/06 18:59:28 naddy Exp $ */
|
||||
/* $OpenBSD: boca.c,v 1.18 2024/05/28 05:46:32 jsg Exp $ */
|
||||
/* $NetBSD: boca.c,v 1.15 1996/05/12 23:51:50 mycroft Exp $ */
|
||||
|
||||
/*
|
||||
|
@ -74,10 +74,7 @@ struct cfdriver boca_cd = {
|
|||
};
|
||||
|
||||
int
|
||||
bocaprobe(parent, self, aux)
|
||||
struct device *parent;
|
||||
void *self;
|
||||
void *aux;
|
||||
bocaprobe(struct device *parent, void *self, void *aux)
|
||||
{
|
||||
struct isa_attach_args *ia = aux;
|
||||
int iobase = ia->ia_iobase;
|
||||
|
@ -126,9 +123,7 @@ out:
|
|||
}
|
||||
|
||||
int
|
||||
bocaprint(aux, pnp)
|
||||
void *aux;
|
||||
const char *pnp;
|
||||
bocaprint(void *aux, const char *pnp)
|
||||
{
|
||||
struct commulti_attach_args *ca = aux;
|
||||
|
||||
|
@ -139,9 +134,7 @@ bocaprint(aux, pnp)
|
|||
}
|
||||
|
||||
void
|
||||
bocaattach(parent, self, aux)
|
||||
struct device *parent, *self;
|
||||
void *aux;
|
||||
bocaattach(struct device *parent, struct device *self, void *aux)
|
||||
{
|
||||
struct boca_softc *sc = (void *)self;
|
||||
struct isa_attach_args *ia = aux;
|
||||
|
@ -177,8 +170,7 @@ bocaattach(parent, self, aux)
|
|||
}
|
||||
|
||||
int
|
||||
bocaintr(arg)
|
||||
void *arg;
|
||||
bocaintr(void *arg)
|
||||
{
|
||||
struct boca_softc *sc = arg;
|
||||
bus_space_tag_t iot = sc->sc_iot;
|
||||
|
|
|
@ -1,51 +0,0 @@
|
|||
/* $OpenBSD: cs4231var.h,v 1.4 2008/06/26 05:42:16 ray Exp $ */
|
||||
/* $NetBSD: cs4231var.h,v 1.2 1996/02/05 02:21:51 jtc Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1996 The NetBSD Foundation, Inc.
|
||||
* All rights reserved.
|
||||
*
|
||||
* This code is derived from software contributed to The NetBSD Foundation
|
||||
* by Ken Hornstein and John Kohl.
|
||||
*
|
||||
* 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 NETBSD FOUNDATION, INC. 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 REGENTS 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.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Software gunk for CS4231, as used in Gravis UltraSound MAX.
|
||||
*/
|
||||
|
||||
struct cs4231_softc {
|
||||
int in_port; /* which MUX input port? */
|
||||
#define CS4231_MUX_MIXED_IN 0
|
||||
#define CS4231_MUX_MIC_IN 1
|
||||
#define CS4231_MUX_AUX1_IN 2
|
||||
#define CS4231_MUX_LINE_IN 3
|
||||
};
|
||||
|
||||
int cs4231_set_linein_gain(struct ad1848_softc *, struct ad1848_volume *);
|
||||
int cs4231_get_linein_gain(struct ad1848_softc *, struct ad1848_volume *);
|
||||
int cs4231_set_mono_gain(struct ad1848_softc *, struct ad1848_volume *);
|
||||
int cs4231_get_mono_gain(struct ad1848_softc *, struct ad1848_volume *);
|
||||
void cs4231_mute_mono(struct ad1848_softc *, int /* onoff */);
|
||||
void cs4231_mute_line(struct ad1848_softc *, int /* onoff */);
|
||||
void cs4231_mute_monitor(struct ad1848_softc *, int /* onoff */);
|
|
@ -1,4 +1,4 @@
|
|||
/* $OpenBSD: gus.c,v 1.55 2022/11/02 10:41:34 kn Exp $ */
|
||||
/* $OpenBSD: gus.c,v 1.56 2024/05/28 09:27:08 jsg Exp $ */
|
||||
/* $NetBSD: gus.c,v 1.51 1998/01/25 23:48:06 mycroft Exp $ */
|
||||
|
||||
/*-
|
||||
|
@ -115,7 +115,6 @@
|
|||
#include <dev/ic/ad1848reg.h>
|
||||
#include <dev/isa/ics2101var.h>
|
||||
#include <dev/isa/ad1848var.h>
|
||||
#include <dev/isa/cs4231var.h>
|
||||
#include "gusreg.h"
|
||||
#include "gusvar.h"
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $OpenBSD: gus_isa.c,v 1.9 2022/04/06 18:59:28 naddy Exp $ */
|
||||
/* $OpenBSD: gus_isa.c,v 1.10 2024/05/28 09:27:08 jsg Exp $ */
|
||||
/* $NetBSD: gus.c,v 1.51 1998/01/25 23:48:06 mycroft Exp $ */
|
||||
|
||||
/*-
|
||||
|
@ -115,7 +115,6 @@
|
|||
#include <dev/ic/ad1848reg.h>
|
||||
#include <dev/isa/ics2101var.h>
|
||||
#include <dev/isa/ad1848var.h>
|
||||
#include <dev/isa/cs4231var.h>
|
||||
#include "gusreg.h"
|
||||
#include "gusvar.h"
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $OpenBSD: gus_isapnp.c,v 1.10 2022/04/06 18:59:28 naddy Exp $ */
|
||||
/* $OpenBSD: gus_isapnp.c,v 1.11 2024/05/28 09:27:08 jsg Exp $ */
|
||||
/* $NetBSD: gus.c,v 1.51 1998/01/25 23:48:06 mycroft Exp $ */
|
||||
|
||||
/*-
|
||||
|
@ -115,7 +115,6 @@
|
|||
#include <dev/ic/ad1848reg.h>
|
||||
#include <dev/isa/ics2101var.h>
|
||||
#include <dev/isa/ad1848var.h>
|
||||
#include <dev/isa/cs4231var.h>
|
||||
#include "gusreg.h"
|
||||
#include "gusvar.h"
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $OpenBSD: hsq.c,v 1.7 2022/04/06 18:59:28 naddy Exp $ */
|
||||
/* $OpenBSD: hsq.c,v 1.8 2024/05/28 05:46:32 jsg Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1999 Denis A. Doroshenko. All rights reserved.
|
||||
|
@ -120,10 +120,7 @@ struct cfdriver hsq_cd = {
|
|||
};
|
||||
|
||||
int
|
||||
hsqprobe(parent, self, aux)
|
||||
struct device *parent;
|
||||
void *self;
|
||||
void *aux;
|
||||
hsqprobe(struct device *parent, void *self, void *aux)
|
||||
{
|
||||
struct isa_attach_args *ia = aux;
|
||||
int iobase = ia->ia_iobase;
|
||||
|
@ -174,9 +171,7 @@ out:
|
|||
}
|
||||
|
||||
int
|
||||
hsqprint(aux, pnp)
|
||||
void *aux;
|
||||
const char *pnp;
|
||||
hsqprint(void *aux, const char *pnp)
|
||||
{
|
||||
struct commulti_attach_args *ca = aux;
|
||||
|
||||
|
@ -187,9 +182,7 @@ hsqprint(aux, pnp)
|
|||
}
|
||||
|
||||
void
|
||||
hsqattach(parent, self, aux)
|
||||
struct device *parent, *self;
|
||||
void *aux;
|
||||
hsqattach(struct device *parent, struct device *self, void *aux)
|
||||
{
|
||||
struct hsq_softc *sc = (void *)self;
|
||||
struct isa_attach_args *ia = aux;
|
||||
|
@ -225,8 +218,7 @@ hsqattach(parent, self, aux)
|
|||
}
|
||||
|
||||
int
|
||||
hsqintr(arg)
|
||||
void *arg;
|
||||
hsqintr(void *arg)
|
||||
{
|
||||
struct hsq_softc *sc = arg;
|
||||
bus_space_tag_t iot = sc->sc_iot;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $OpenBSD: txphy.c,v 1.13 2023/03/30 09:24:22 kevlo Exp $ */
|
||||
/* $OpenBSD: txphy.c,v 1.14 2024/05/27 03:56:59 jsg Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1999 Jason L. Wright (jason@thought.net)
|
||||
|
@ -38,6 +38,7 @@
|
|||
#include <sys/errno.h>
|
||||
|
||||
#include <net/if.h>
|
||||
#include <net/if_var.h>
|
||||
#include <net/if_media.h>
|
||||
|
||||
#include <dev/mii/mii.h>
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $OpenBSD: xmphy.c,v 1.24 2022/04/06 18:59:29 naddy Exp $ */
|
||||
/* $OpenBSD: xmphy.c,v 1.25 2024/05/27 04:58:43 jsg Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 2000
|
||||
|
@ -54,8 +54,6 @@
|
|||
#include <dev/mii/miivar.h>
|
||||
#include <dev/mii/miidevs.h>
|
||||
|
||||
#include <dev/mii/xmphyreg.h>
|
||||
|
||||
int xmphy_probe(struct device *, void *, void *);
|
||||
void xmphy_attach(struct device *, struct device *, void *);
|
||||
|
||||
|
|
|
@ -1,50 +0,0 @@
|
|||
/* $OpenBSD: xmphyreg.h,v 1.6 2015/07/19 06:28:12 yuo Exp $ */
|
||||
/*
|
||||
* Copyright (c) 2000
|
||||
* Bill Paul <wpaul@ee.columbia.edu>. 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.
|
||||
* 3. All advertising materials mentioning features or use of this software
|
||||
* must display the following acknowledgement:
|
||||
* This product includes software developed by Bill Paul.
|
||||
* 4. Neither the name of the author nor the names of any co-contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY Bill Paul 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 Bill Paul OR THE VOICES IN HIS HEAD
|
||||
* 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.
|
||||
*
|
||||
* $FreeBSD: src/sys/dev/mii/xmphyreg.h,v 1.1 2000/04/22 01:58:18 wpaul Exp $
|
||||
*/
|
||||
|
||||
#ifndef _DEV_MII_XMPHYREG_H_
|
||||
#define _DEV_MII_XMPHYREG_H_
|
||||
|
||||
/*
|
||||
* XaQti XMAC II PHY registers
|
||||
*/
|
||||
|
||||
#define XMPHY_MII_RESAB 0x10 /* Resolved ability */
|
||||
#define XMPHY_RESAB_PAUSEBITS 0x0180 /* Pause bits */
|
||||
#define XMPHY_RESAB_HDX 0x0040 /* Half duplex selected */
|
||||
#define XMPHY_RESAB_FDX 0x0020 /* Full duplex selected */
|
||||
#define XMPHY_RESAB_ABLMIS 0x0010 /* Ability mismatch */
|
||||
#define XMPHY_RESAB_PAUSEMIS 0x0008 /* Pause mismatch */
|
||||
|
||||
#endif /* _DEV_MII_XMPHYREG_H_ */
|
|
@ -1029,6 +1029,9 @@ int amdgpu_ras_query_error_status(struct amdgpu_device *adev,
|
|||
if (!obj)
|
||||
return -EINVAL;
|
||||
|
||||
if (!info || info->head.block == AMDGPU_RAS_BLOCK_COUNT)
|
||||
return -EINVAL;
|
||||
|
||||
if (info->head.block == AMDGPU_RAS_BLOCK__UMC) {
|
||||
amdgpu_ras_get_ecc_info(adev, &err_data);
|
||||
} else {
|
||||
|
|
|
@ -1033,7 +1033,12 @@ static bool setup_dsc_config(
|
|||
if (!is_dsc_possible)
|
||||
goto done;
|
||||
|
||||
dsc_cfg->num_slices_v = pic_height/slice_height;
|
||||
if (slice_height > 0) {
|
||||
dsc_cfg->num_slices_v = pic_height / slice_height;
|
||||
} else {
|
||||
is_dsc_possible = false;
|
||||
goto done;
|
||||
}
|
||||
|
||||
if (target_bandwidth_kbps > 0) {
|
||||
is_dsc_possible = decide_dsc_target_bpp_x16(
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $OpenBSD: if_qwx_pci.c,v 1.16 2024/05/24 06:02:56 jsg Exp $ */
|
||||
/* $OpenBSD: if_qwx_pci.c,v 1.19 2024/05/28 09:26:55 stsp Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright 2023 Stefan Sperling <stsp@openbsd.org>
|
||||
|
@ -96,6 +96,7 @@
|
|||
#include <dev/ic/qwxreg.h>
|
||||
#include <dev/ic/qwxvar.h>
|
||||
|
||||
#ifdef QWX_DEBUG
|
||||
/* Headers needed for RDDM dump */
|
||||
#include <sys/namei.h>
|
||||
#include <sys/pledge.h>
|
||||
|
@ -103,6 +104,7 @@
|
|||
#include <sys/fcntl.h>
|
||||
#include <sys/stat.h>
|
||||
#include <sys/proc.h>
|
||||
#endif
|
||||
|
||||
#define ATH11K_PCI_IRQ_CE0_OFFSET 3
|
||||
#define ATH11K_PCI_IRQ_DP_OFFSET 14
|
||||
|
@ -452,7 +454,9 @@ void qwx_mhi_init_mmio(struct qwx_pci_softc *);
|
|||
int qwx_mhi_fw_load_bhi(struct qwx_pci_softc *, uint8_t *, size_t);
|
||||
int qwx_mhi_fw_load_bhie(struct qwx_pci_softc *, uint8_t *, size_t);
|
||||
void qwx_rddm_prepare(struct qwx_pci_softc *);
|
||||
#ifdef QWX_DEBUG
|
||||
void qwx_rddm_task(void *);
|
||||
#endif
|
||||
void * qwx_pci_event_ring_get_elem(struct qwx_pci_event_ring *, uint64_t);
|
||||
void qwx_pci_intr_ctrl_event_mhi(struct qwx_pci_softc *, uint32_t);
|
||||
void qwx_pci_intr_ctrl_event_ee(struct qwx_pci_softc *, uint32_t);
|
||||
|
@ -1042,8 +1046,9 @@ unsupported_wcn6855_soc:
|
|||
goto err_irq_affinity_cleanup;
|
||||
}
|
||||
#endif
|
||||
#ifdef QWX_DEBUG
|
||||
task_set(&psc->rddm_task, qwx_rddm_task, psc);
|
||||
|
||||
#endif
|
||||
ic->ic_phytype = IEEE80211_T_OFDM; /* not only, but not used */
|
||||
ic->ic_opmode = IEEE80211_M_STA; /* default to BSS mode */
|
||||
ic->ic_state = IEEE80211_S_INIT;
|
||||
|
@ -1086,6 +1091,8 @@ unsupported_wcn6855_soc:
|
|||
/* Override 802.11 state transition machine. */
|
||||
sc->sc_newstate = ic->ic_newstate;
|
||||
ic->ic_newstate = qwx_newstate;
|
||||
ic->ic_set_key = qwx_set_key;
|
||||
ic->ic_delete_key = qwx_delete_key;
|
||||
#if 0
|
||||
ic->ic_updatechan = qwx_updatechan;
|
||||
ic->ic_updateprot = qwx_updateprot;
|
||||
|
@ -3466,6 +3473,7 @@ qwx_rddm_prepare(struct qwx_pci_softc *psc)
|
|||
psc->rddm_vec = vec_adm;
|
||||
}
|
||||
|
||||
#ifdef QWX_DEBUG
|
||||
void
|
||||
qwx_rddm_task(void *arg)
|
||||
{
|
||||
|
@ -3560,6 +3568,7 @@ done:
|
|||
psc->rddm_vec = NULL;
|
||||
DPRINTF("%s: done, error %d\n", __func__, error);
|
||||
}
|
||||
#endif
|
||||
|
||||
void *
|
||||
qwx_pci_event_ring_get_elem(struct qwx_pci_event_ring *ring, uint64_t rp)
|
||||
|
@ -4071,11 +4080,23 @@ qwx_pci_intr(void *arg)
|
|||
sc->sc_dev.dv_xname, psc->bhi_ee, ee, psc->mhi_state, state);
|
||||
|
||||
if (ee == MHI_EE_RDDM) {
|
||||
/* Firmware crash, e.g. due to invalid DMA memory access. */
|
||||
psc->bhi_ee = ee;
|
||||
#ifdef QWX_DEBUG
|
||||
if (!psc->rddm_triggered) {
|
||||
/* Write fw memory dump to root's home directory. */
|
||||
task_add(systq, &psc->rddm_task);
|
||||
psc->rddm_triggered = 1;
|
||||
}
|
||||
#else
|
||||
printf("%s: fatal firmware error\n",
|
||||
sc->sc_dev.dv_xname);
|
||||
if (!test_bit(ATH11K_FLAG_CRASH_FLUSH, sc->sc_flags)) {
|
||||
/* Try to reset the device. */
|
||||
set_bit(ATH11K_FLAG_CRASH_FLUSH, sc->sc_flags);
|
||||
task_add(systq, &sc->init_task);
|
||||
}
|
||||
#endif
|
||||
return 1;
|
||||
} else if (psc->bhi_ee == MHI_EE_PBL || psc->bhi_ee == MHI_EE_SBL) {
|
||||
int new_ee = -1, new_mhi_state = -1;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $OpenBSD: aic_pcmcia.c,v 1.20 2023/09/11 08:41:27 mvs Exp $ */
|
||||
/* $OpenBSD: aic_pcmcia.c,v 1.21 2024/05/26 08:46:28 jsg Exp $ */
|
||||
/* $NetBSD: aic_pcmcia.c,v 1.6 1998/07/19 17:28:15 christos Exp $ */
|
||||
|
||||
/*
|
||||
|
@ -34,7 +34,6 @@
|
|||
#include <sys/systm.h>
|
||||
#include <sys/device.h>
|
||||
|
||||
#include <machine/cpu.h>
|
||||
#include <machine/bus.h>
|
||||
#include <machine/intr.h>
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $OpenBSD: cfxga.c,v 1.33 2022/07/15 17:57:26 kettenis Exp $ */
|
||||
/* $OpenBSD: cfxga.c,v 1.35 2024/05/26 08:46:28 jsg Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 2005, 2006, Matthieu Herrb and Miodrag Vallat
|
||||
|
@ -31,11 +31,9 @@
|
|||
*/
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/kernel.h>
|
||||
#include <sys/device.h>
|
||||
#include <sys/systm.h>
|
||||
#include <sys/malloc.h>
|
||||
#include <sys/conf.h>
|
||||
|
||||
#include <dev/pcmcia/pcmciavar.h>
|
||||
#include <dev/pcmcia/pcmciareg.h>
|
||||
|
@ -324,7 +322,7 @@ cfxga_activate(struct device *dev, int act)
|
|||
pcmcia_function_disable(sc->sc_pf);
|
||||
break;
|
||||
default:
|
||||
rv = config_activate_children(self, act);
|
||||
rv = config_activate_children(dev, act);
|
||||
break;
|
||||
}
|
||||
return (rv);
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $OpenBSD: com_pcmcia.c,v 1.61 2024/05/13 01:15:51 jsg Exp $ */
|
||||
/* $OpenBSD: com_pcmcia.c,v 1.62 2024/05/26 08:46:28 jsg Exp $ */
|
||||
/* $NetBSD: com_pcmcia.c,v 1.15 1998/08/22 17:47:58 msaitoh Exp $ */
|
||||
|
||||
/*
|
||||
|
@ -90,12 +90,7 @@
|
|||
|
||||
#include <sys/param.h>
|
||||
#include <sys/systm.h>
|
||||
#include <sys/ioctl.h>
|
||||
#include <sys/tty.h>
|
||||
#include <sys/conf.h>
|
||||
#include <sys/uio.h>
|
||||
#include <sys/kernel.h>
|
||||
#include <sys/syslog.h>
|
||||
#include <sys/device.h>
|
||||
|
||||
#include <machine/intr.h>
|
||||
|
@ -104,8 +99,6 @@
|
|||
#include <dev/pcmcia/pcmciareg.h>
|
||||
#include <dev/pcmcia/pcmciadevs.h>
|
||||
|
||||
#include "com.h"
|
||||
|
||||
#include <dev/ic/comreg.h>
|
||||
#include <dev/ic/comvar.h>
|
||||
#include <dev/ic/ns16550reg.h>
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $OpenBSD: if_an_pcmcia.c,v 1.27 2022/04/06 18:59:30 naddy Exp $ */
|
||||
/* $OpenBSD: if_an_pcmcia.c,v 1.28 2024/05/26 08:46:28 jsg Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1999 Michael Shalayeff
|
||||
|
@ -29,9 +29,6 @@
|
|||
#include <sys/param.h>
|
||||
#include <sys/systm.h>
|
||||
#include <sys/device.h>
|
||||
#include <sys/timeout.h>
|
||||
#include <sys/socket.h>
|
||||
#include <sys/tree.h>
|
||||
|
||||
#include <net/if.h>
|
||||
#include <net/if_media.h>
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $OpenBSD: if_ep_pcmcia.c,v 1.51 2023/09/11 08:41:27 mvs Exp $ */
|
||||
/* $OpenBSD: if_ep_pcmcia.c,v 1.52 2024/05/26 08:46:28 jsg Exp $ */
|
||||
/* $NetBSD: if_ep_pcmcia.c,v 1.16 1998/08/17 23:20:40 thorpej Exp $ */
|
||||
|
||||
/*-
|
||||
|
@ -60,15 +60,8 @@
|
|||
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#include "bpfilter.h"
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/systm.h>
|
||||
#include <sys/mbuf.h>
|
||||
#include <sys/socket.h>
|
||||
#include <sys/ioctl.h>
|
||||
#include <sys/errno.h>
|
||||
#include <sys/syslog.h>
|
||||
#include <sys/timeout.h>
|
||||
#include <sys/device.h>
|
||||
|
||||
|
@ -78,14 +71,8 @@
|
|||
#include <netinet/in.h>
|
||||
#include <netinet/if_ether.h>
|
||||
|
||||
#if NBPFILTER > 0
|
||||
#include <net/bpf.h>
|
||||
#endif
|
||||
|
||||
#include <machine/cpu.h>
|
||||
#include <machine/bus.h>
|
||||
|
||||
#include <dev/mii/mii.h>
|
||||
#include <dev/mii/miivar.h>
|
||||
|
||||
#include <dev/ic/elink3var.h>
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $OpenBSD: if_malo.c,v 1.99 2022/04/06 18:59:30 naddy Exp $ */
|
||||
/* $OpenBSD: if_malo.c,v 1.100 2024/05/26 08:46:28 jsg Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 2007 Marcus Glocker <mglocker@openbsd.org>
|
||||
|
@ -20,11 +20,8 @@
|
|||
|
||||
#include <sys/param.h>
|
||||
#include <sys/systm.h>
|
||||
#include <sys/kernel.h>
|
||||
#include <sys/device.h>
|
||||
#include <sys/timeout.h>
|
||||
#include <sys/socket.h>
|
||||
#include <sys/tree.h>
|
||||
#include <sys/malloc.h>
|
||||
#include <sys/sockio.h>
|
||||
#include <sys/mbuf.h>
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $OpenBSD: if_ne_pcmcia.c,v 1.102 2023/09/11 08:41:27 mvs Exp $ */
|
||||
/* $OpenBSD: if_ne_pcmcia.c,v 1.103 2024/05/26 08:46:28 jsg Exp $ */
|
||||
/* $NetBSD: if_ne_pcmcia.c,v 1.17 1998/08/15 19:00:04 thorpej Exp $ */
|
||||
|
||||
/*
|
||||
|
@ -33,7 +33,6 @@
|
|||
#include <sys/param.h>
|
||||
#include <sys/systm.h>
|
||||
#include <sys/device.h>
|
||||
#include <sys/socket.h>
|
||||
|
||||
#include <net/if.h>
|
||||
#include <net/if_media.h>
|
||||
|
@ -42,12 +41,10 @@
|
|||
|
||||
#include <machine/bus.h>
|
||||
|
||||
#include <dev/pcmcia/pcmciareg.h>
|
||||
#include <dev/pcmcia/pcmciavar.h>
|
||||
#include <dev/pcmcia/pcmciadevs.h>
|
||||
|
||||
#include <dev/mii/miivar.h>
|
||||
#include <dev/mii/mii_bitbang.h>
|
||||
|
||||
#include <dev/ic/dp8390reg.h>
|
||||
#include <dev/ic/dp8390var.h>
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $OpenBSD: if_sm_pcmcia.c,v 1.40 2023/09/11 08:41:27 mvs Exp $ */
|
||||
/* $OpenBSD: if_sm_pcmcia.c,v 1.41 2024/05/26 08:46:28 jsg Exp $ */
|
||||
/* $NetBSD: if_sm_pcmcia.c,v 1.11 1998/08/15 20:47:32 thorpej Exp $ */
|
||||
|
||||
/*-
|
||||
|
@ -31,15 +31,8 @@
|
|||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#include "bpfilter.h"
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/systm.h>
|
||||
#include <sys/mbuf.h>
|
||||
#include <sys/socket.h>
|
||||
#include <sys/ioctl.h>
|
||||
#include <sys/errno.h>
|
||||
#include <sys/syslog.h>
|
||||
#include <sys/timeout.h>
|
||||
#include <sys/device.h>
|
||||
|
||||
|
@ -49,14 +42,9 @@
|
|||
#include <netinet/in.h>
|
||||
#include <netinet/if_ether.h>
|
||||
|
||||
#if NBPFILTER > 0
|
||||
#include <net/bpf.h>
|
||||
#endif
|
||||
|
||||
#include <machine/intr.h>
|
||||
#include <machine/bus.h>
|
||||
|
||||
#include <dev/mii/mii.h>
|
||||
#include <dev/mii/miivar.h>
|
||||
|
||||
#include <dev/ic/smc91cxxvar.h>
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $OpenBSD: if_wi_pcmcia.c,v 1.76 2022/04/06 18:59:30 naddy Exp $ */
|
||||
/* $OpenBSD: if_wi_pcmcia.c,v 1.77 2024/05/26 08:46:28 jsg Exp $ */
|
||||
/* $NetBSD: if_wi_pcmcia.c,v 1.14 2001/11/26 04:34:56 ichiro Exp $ */
|
||||
|
||||
/*
|
||||
|
@ -46,9 +46,7 @@
|
|||
#include <sys/param.h>
|
||||
#include <sys/systm.h>
|
||||
#include <sys/timeout.h>
|
||||
#include <sys/socket.h>
|
||||
#include <sys/device.h>
|
||||
#include <sys/tree.h>
|
||||
|
||||
#include <net/if.h>
|
||||
#include <net/if_media.h>
|
||||
|
@ -61,7 +59,6 @@
|
|||
|
||||
#include <machine/bus.h>
|
||||
|
||||
#include <dev/pcmcia/pcmciareg.h>
|
||||
#include <dev/pcmcia/pcmciavar.h>
|
||||
#include <dev/pcmcia/pcmciadevs.h>
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $OpenBSD: if_xe.c,v 1.63 2023/05/30 08:30:01 jsg Exp $ */
|
||||
/* $OpenBSD: if_xe.c,v 1.64 2024/05/26 08:46:28 jsg Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1999 Niklas Hallqvist, Brandon Creighton, Job de Haas
|
||||
|
@ -52,8 +52,6 @@
|
|||
#include <sys/ioctl.h>
|
||||
#include <sys/mbuf.h>
|
||||
#include <sys/malloc.h>
|
||||
#include <sys/kernel.h>
|
||||
#include <sys/socket.h>
|
||||
#include <sys/syslog.h>
|
||||
|
||||
#include <net/if.h>
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $OpenBSD: wdc_pcmcia.c,v 1.34 2022/04/06 18:59:30 naddy Exp $ */
|
||||
/* $OpenBSD: wdc_pcmcia.c,v 1.35 2024/05/26 08:46:28 jsg Exp $ */
|
||||
/* $NetBSD: wdc_pcmcia.c,v 1.19 1999/02/19 21:49:43 abs Exp $ */
|
||||
|
||||
/*-
|
||||
|
@ -32,19 +32,8 @@
|
|||
|
||||
#include <sys/param.h>
|
||||
#include <sys/systm.h>
|
||||
#include <sys/kernel.h>
|
||||
#include <sys/conf.h>
|
||||
#include <sys/stat.h>
|
||||
#include <sys/ioctl.h>
|
||||
#include <sys/buf.h>
|
||||
#include <sys/uio.h>
|
||||
#include <sys/malloc.h>
|
||||
#include <sys/device.h>
|
||||
#include <sys/disklabel.h>
|
||||
#include <sys/disk.h>
|
||||
#include <sys/syslog.h>
|
||||
|
||||
#include <machine/cpu.h>
|
||||
#include <machine/intr.h>
|
||||
#include <machine/bus.h>
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $OpenBSD: if_vio.c,v 1.35 2024/05/24 10:05:55 jsg Exp $ */
|
||||
/* $OpenBSD: if_vio.c,v 1.36 2024/05/28 12:11:26 jan Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 2012 Stefan Fritsch, Alexander Fiveg.
|
||||
|
@ -1118,8 +1118,6 @@ vio_rxeof(struct vio_softc *sc)
|
|||
bufs_left = hdr->num_buffers - 1;
|
||||
else
|
||||
bufs_left = 0;
|
||||
if (virtio_has_feature(vsc, VIRTIO_NET_F_GUEST_CSUM))
|
||||
vio_rx_offload(m, hdr);
|
||||
} else {
|
||||
m->m_flags &= ~M_PKTHDR;
|
||||
m0->m_pkthdr.len += m->m_len;
|
||||
|
@ -1129,6 +1127,8 @@ vio_rxeof(struct vio_softc *sc)
|
|||
}
|
||||
|
||||
if (bufs_left == 0) {
|
||||
if (virtio_has_feature(vsc, VIRTIO_NET_F_GUEST_CSUM))
|
||||
vio_rx_offload(m0, hdr);
|
||||
ml_enqueue(&ml, m0);
|
||||
m0 = NULL;
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $OpenBSD: ums.c,v 1.52 2024/05/23 03:21:09 jsg Exp $ */
|
||||
/* $OpenBSD: ums.c,v 1.53 2024/05/26 20:06:27 mglocker Exp $ */
|
||||
/* $NetBSD: ums.c,v 1.60 2003/03/11 16:44:00 augustss Exp $ */
|
||||
|
||||
/*
|
||||
|
@ -178,14 +178,14 @@ ums_attach(struct device *parent, struct device *self, void *aux)
|
|||
ms->sc_loc_btn[2].pos = 2;
|
||||
}
|
||||
|
||||
hidms_attach(ms, &ums_accessops);
|
||||
|
||||
if (sc->sc_quirks & UQ_ALWAYS_OPEN) {
|
||||
/* open uhidev and keep it open */
|
||||
ums_enable(sc);
|
||||
/* but mark the hidms not in use */
|
||||
ums_disable(sc);
|
||||
}
|
||||
|
||||
hidms_attach(ms, &ums_accessops);
|
||||
}
|
||||
|
||||
int
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $OpenBSD: umt.c,v 1.7 2024/05/23 03:21:09 jsg Exp $ */
|
||||
/* $OpenBSD: umt.c,v 1.8 2024/05/26 20:06:27 mglocker Exp $ */
|
||||
/*
|
||||
* USB multitouch touchpad driver for devices conforming to
|
||||
* Windows Precision Touchpad standard
|
||||
|
@ -181,14 +181,14 @@ umt_attach(struct device *parent, struct device *self, void *aux)
|
|||
if (hidmt_setup(self, mt, desc, size) != 0)
|
||||
return;
|
||||
|
||||
hidmt_attach(mt, &umt_accessops);
|
||||
|
||||
if (sc->sc_quirks & UQ_ALWAYS_OPEN) {
|
||||
/* open uhidev and keep it open */
|
||||
umt_enable(sc);
|
||||
/* but mark the hidmt not in use */
|
||||
umt_disable(sc);
|
||||
}
|
||||
|
||||
hidmt_attach(mt, &umt_accessops);
|
||||
}
|
||||
|
||||
int
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $OpenBSD: subr_suspend.c,v 1.16 2023/07/12 18:40:06 cheloha Exp $ */
|
||||
/* $OpenBSD: subr_suspend.c,v 1.18 2024/05/28 09:40:40 kettenis Exp $ */
|
||||
/*
|
||||
* Copyright (c) 2005 Thorsten Lockert <tholo@sigmasoft.com>
|
||||
* Copyright (c) 2005 Jordan Hargrave <jordan@openbsd.org>
|
||||
|
@ -84,7 +84,6 @@ top:
|
|||
uvmpd_hibernate();
|
||||
if (hibernate_alloc()) {
|
||||
printf("failed to allocate hibernate memory\n");
|
||||
sleep_abort(v);
|
||||
error = ENOMEM;
|
||||
goto fail_hiballoc;
|
||||
}
|
||||
|
@ -93,7 +92,6 @@ top:
|
|||
|
||||
sensor_quiesce();
|
||||
if (config_suspend_all(DVACT_QUIESCE)) {
|
||||
sleep_abort(v);
|
||||
error = EIO;
|
||||
goto fail_quiesce;
|
||||
}
|
||||
|
@ -132,15 +130,14 @@ top:
|
|||
s = splhigh();
|
||||
intr_disable(); /* PSL_I for resume; PIC/APIC broken until repair */
|
||||
cold = 2; /* Force other code to delay() instead of tsleep() */
|
||||
intr_enable_wakeup();
|
||||
|
||||
if (config_suspend_all(DVACT_SUSPEND) != 0) {
|
||||
sleep_abort(v);
|
||||
error = EDEADLK;
|
||||
goto fail_suspend;
|
||||
}
|
||||
suspend_randomness();
|
||||
if (sleep_setstate(v)) {
|
||||
sleep_abort(v);
|
||||
error = ENOTBLK;
|
||||
goto fail_pts;
|
||||
}
|
||||
|
@ -172,6 +169,7 @@ fail_pts:
|
|||
config_suspend_all(DVACT_RESUME);
|
||||
|
||||
fail_suspend:
|
||||
intr_disable_wakeup();
|
||||
cold = 0;
|
||||
intr_enable();
|
||||
splx(s);
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $OpenBSD: device.h,v 1.66 2023/07/08 14:44:43 tobhe Exp $ */
|
||||
/* $OpenBSD: device.h,v 1.67 2024/05/28 09:40:40 kettenis Exp $ */
|
||||
/* $NetBSD: device.h,v 1.15 1996/04/09 20:55:24 cgd Exp $ */
|
||||
|
||||
/*
|
||||
|
@ -208,7 +208,6 @@ void resume_mp(void);
|
|||
int sleep_showstate(void *v, int sleepmode);
|
||||
int sleep_setstate(void *v);
|
||||
int sleep_resume(void *v);
|
||||
void sleep_abort(void *v);
|
||||
int gosleep(void *v);
|
||||
int suspend_finish(void *v);
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $OpenBSD: systm.h,v 1.170 2023/10/30 07:04:36 claudio Exp $ */
|
||||
/* $OpenBSD: systm.h,v 1.171 2024/05/28 12:50:23 jsg Exp $ */
|
||||
/* $NetBSD: systm.h,v 1.50 1996/06/09 04:55:09 briggs Exp $ */
|
||||
|
||||
/*-
|
||||
|
@ -91,7 +91,6 @@ extern int ncpusfound; /* number of CPUs found */
|
|||
extern int nblkdev; /* number of entries in bdevsw */
|
||||
extern int nchrdev; /* number of entries in cdevsw */
|
||||
|
||||
extern int maxmem; /* max memory per process */
|
||||
extern int physmem; /* physical memory */
|
||||
|
||||
extern dev_t dumpdev; /* dump device */
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $OpenBSD: uvm_swap_encrypt.h,v 1.11 2024/05/12 09:27:13 jsg Exp $ */
|
||||
/* $OpenBSD: uvm_swap_encrypt.h,v 1.12 2024/05/28 12:31:24 jsg Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright 1999 Niels Provos <provos@citi.umich.edu>
|
||||
|
@ -79,7 +79,6 @@ void swap_key_create(struct swap_key *);
|
|||
void swap_key_delete(struct swap_key *);
|
||||
|
||||
extern int uvm_doswapencrypt; /* swapencrypt enabled/disabled */
|
||||
extern u_int uvm_swpkeyexpire; /* expiry time for keys (tR) */
|
||||
extern int swap_encrypt_initialized;
|
||||
|
||||
#endif /* _UVM_SWAP_ENCRYPT_H */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue