svn commit: r354499 - head/sys/dev/iwm

Mark Johnston markj at FreeBSD.org
Thu Nov 7 23:34:29 UTC 2019


Author: markj
Date: Thu Nov  7 23:34:28 2019
New Revision: 354499
URL: https://svnweb.freebsd.org/changeset/base/354499

Log:
  iwm: Add a few _prph functions needed for 9000-series chips.
  
  MFC after:	2 weeks
  Sponsored by:	The FreeBSD Foundation

Modified:
  head/sys/dev/iwm/if_iwm_pcie_trans.c
  head/sys/dev/iwm/if_iwm_pcie_trans.h

Modified: head/sys/dev/iwm/if_iwm_pcie_trans.c
==============================================================================
--- head/sys/dev/iwm/if_iwm_pcie_trans.c	Thu Nov  7 23:34:12 2019	(r354498)
+++ head/sys/dev/iwm/if_iwm_pcie_trans.c	Thu Nov  7 23:34:28 2019	(r354499)
@@ -185,6 +185,27 @@ iwm_write_prph(struct iwm_softc *sc, uint32_t addr, ui
 	IWM_WRITE(sc, IWM_HBUS_TARG_PRPH_WDAT, val);
 }
 
+void
+iwm_write_prph64(struct iwm_softc *sc, uint64_t addr, uint64_t val)
+{
+	iwm_write_prph(sc, (uint32_t)addr, val & 0xffffffff);
+	iwm_write_prph(sc, (uint32_t)addr + 4, val >> 32);
+}
+
+int
+iwm_poll_prph(struct iwm_softc *sc, uint32_t addr, uint32_t bits, uint32_t mask,
+    int timeout)
+{
+	do {
+		if ((iwm_read_prph(sc, addr) & mask) == (bits & mask))
+			return (0);
+		DELAY(10);
+		timeout -= 10;
+	} while (timeout > 0);
+
+	return (ETIMEDOUT);
+}
+
 #ifdef IWM_DEBUG
 /* iwlwifi: pcie/trans.c */
 int

Modified: head/sys/dev/iwm/if_iwm_pcie_trans.h
==============================================================================
--- head/sys/dev/iwm/if_iwm_pcie_trans.h	Thu Nov  7 23:34:12 2019	(r354498)
+++ head/sys/dev/iwm/if_iwm_pcie_trans.h	Thu Nov  7 23:34:28 2019	(r354499)
@@ -106,6 +106,10 @@
 
 extern	uint32_t iwm_read_prph(struct iwm_softc *sc, uint32_t addr);
 extern	void iwm_write_prph(struct iwm_softc *sc, uint32_t addr, uint32_t val);
+extern	void iwm_write_prph64(struct iwm_softc *sc, uint64_t addr,
+    uint64_t val);
+extern	int iwm_poll_prph(struct iwm_softc *sc, uint32_t addr, uint32_t bits,
+    uint32_t mask, int timeout);
 extern	int iwm_read_mem(struct iwm_softc *sc, uint32_t addr, void *buf, int dwords);
 extern	int iwm_write_mem(struct iwm_softc *sc, uint32_t addr, const void *buf,
 		int dwords);


More information about the svn-src-head mailing list