git: c27ed49a46f8 - main - iwm: add return status to set/clear prph bits
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Thu, 15 Oct 2026 02:19:07 UTC
The branch main has been updated by adrian:
URL: https://cgit.FreeBSD.org/src/commit/?id=c27ed49a46f8cc4228ed7d420b703b4872ee46d7
commit c27ed49a46f8cc4228ed7d420b703b4872ee46d7
Author: Adrian Chadd <adrian@FreeBSD.org>
AuthorDate: 2026-10-15 01:50:15 +0000
Commit: Adrian Chadd <adrian@FreeBSD.org>
CommitDate: 2026-10-15 01:50:16 +0000
iwm: add return status to set/clear prph bits
This brings these functions inline with OpenBSD
Locally tested:
* 3160, STA mode
* 7260, STA mode
* 8260, STA mode
* 9260, STA mode
Obtained from: OpenBSD a6e25c727a2214219715b51ba6af2221d7e0d674
Reviewed by: emaste
Differential Revision: https://reviews.freebsd.org/D60211
---
sys/dev/iwm/if_iwm_pcie_trans.c | 13 +++++++------
sys/dev/iwm/if_iwm_pcie_trans.h | 6 +++---
2 files changed, 10 insertions(+), 9 deletions(-)
diff --git a/sys/dev/iwm/if_iwm_pcie_trans.c b/sys/dev/iwm/if_iwm_pcie_trans.c
index 39b96f66fbde..8b3d9d98a59b 100644
--- a/sys/dev/iwm/if_iwm_pcie_trans.c
+++ b/sys/dev/iwm/if_iwm_pcie_trans.c
@@ -308,31 +308,32 @@ iwm_nic_unlock(struct iwm_softc *sc)
IWM_CSR_GP_CNTRL_REG_FLAG_MAC_ACCESS_REQ);
}
-void
+int
iwm_set_bits_mask_prph(struct iwm_softc *sc,
uint32_t reg, uint32_t bits, uint32_t mask)
{
uint32_t val;
- /* XXX: no error path? */
if (iwm_nic_lock(sc)) {
val = iwm_read_prph(sc, reg) & mask;
val |= bits;
iwm_write_prph(sc, reg, val);
iwm_nic_unlock(sc);
+ return 0;
}
+ return EBUSY;
}
-void
+int
iwm_set_bits_prph(struct iwm_softc *sc, uint32_t reg, uint32_t bits)
{
- iwm_set_bits_mask_prph(sc, reg, bits, ~0);
+ return iwm_set_bits_mask_prph(sc, reg, bits, ~0);
}
-void
+int
iwm_clear_bits_prph(struct iwm_softc *sc, uint32_t reg, uint32_t bits)
{
- iwm_set_bits_mask_prph(sc, reg, 0, ~bits);
+ return iwm_set_bits_mask_prph(sc, reg, 0, ~bits);
}
/*
diff --git a/sys/dev/iwm/if_iwm_pcie_trans.h b/sys/dev/iwm/if_iwm_pcie_trans.h
index a236009802a6..e313a123d567 100644
--- a/sys/dev/iwm/if_iwm_pcie_trans.h
+++ b/sys/dev/iwm/if_iwm_pcie_trans.h
@@ -117,10 +117,10 @@ extern int iwm_poll_bit(struct iwm_softc *sc, int reg,
uint32_t bits, uint32_t mask, int timo);
extern int iwm_nic_lock(struct iwm_softc *sc);
extern void iwm_nic_unlock(struct iwm_softc *sc);
-extern void iwm_set_bits_mask_prph(struct iwm_softc *sc,
+extern int iwm_set_bits_mask_prph(struct iwm_softc *sc,
uint32_t reg, uint32_t bits, uint32_t mask);
-extern void iwm_set_bits_prph(struct iwm_softc *sc, uint32_t reg, uint32_t bits);
-extern void iwm_clear_bits_prph(struct iwm_softc *sc, uint32_t reg, uint32_t bits);
+extern int iwm_set_bits_prph(struct iwm_softc *sc, uint32_t reg, uint32_t bits);
+extern int iwm_clear_bits_prph(struct iwm_softc *sc, uint32_t reg, uint32_t bits);
extern void iwm_enable_rfkill_int(struct iwm_softc *sc);
extern int iwm_check_rfkill(struct iwm_softc *sc);
extern int iwm_set_hw_ready(struct iwm_softc *sc);