svn commit: r293111 - head/sys/dev/ath

Adrian Chadd adrian at FreeBSD.org
Sun Jan 3 17:58:12 UTC 2016


Author: adrian
Date: Sun Jan  3 17:58:11 2016
New Revision: 293111
URL: https://svnweb.freebsd.org/changeset/base/293111

Log:
  [ath] remove the inline version of the register access macros.
  
  These are going to be much more efficient on low end embedded systems
  but unfortunately they make it .. less convenient to implement correct
  bus barriers and debugging.  They also didn't implement the register
  serialisation workaround required for Owl (AR5416.)
  
  So, just remove them for now.  Later on I'll just inline the routines
  from ah_osdep.c.

Modified:
  head/sys/dev/ath/ah_osdep.c
  head/sys/dev/ath/ah_osdep.h

Modified: head/sys/dev/ath/ah_osdep.c
==============================================================================
--- head/sys/dev/ath/ah_osdep.c	Sun Jan  3 17:23:16 2016	(r293110)
+++ head/sys/dev/ath/ah_osdep.c	Sun Jan  3 17:58:11 2016	(r293111)
@@ -270,12 +270,14 @@ ath_hal_reg_write(struct ath_hal *ah, u_
 	bus_space_tag_t tag = BUSTAG(ah);
 	bus_space_handle_t h = ah->ah_sh;
 
+#ifdef	AH_DEBUG
 	/* Debug - complain if we haven't fully waken things up */
 	if (! ath_hal_reg_whilst_asleep(ah, reg) &&
 	    ah->ah_powerMode != HAL_PM_AWAKE) {
 		ath_hal_printf(ah, "%s: reg=0x%08x, val=0x%08x, pm=%d\n",
 		    __func__, reg, val, ah->ah_powerMode);
 	}
+#endif
 
 	if (ath_hal_alq) {
 		struct ale *ale = ath_hal_alq_get(ah);
@@ -303,12 +305,14 @@ ath_hal_reg_read(struct ath_hal *ah, u_i
 	bus_space_handle_t h = ah->ah_sh;
 	u_int32_t val;
 
+#ifdef	AH_DEBUG
 	/* Debug - complain if we haven't fully waken things up */
 	if (! ath_hal_reg_whilst_asleep(ah, reg) &&
 	    ah->ah_powerMode != HAL_PM_AWAKE) {
 		ath_hal_printf(ah, "%s: reg=0x%08x, pm=%d\n",
 		    __func__, reg, ah->ah_powerMode);
 	}
+#endif
 
 	if (ah->ah_config.ah_serialise_reg_war)
 		mtx_lock_spin(&ah_regser_mtx);
@@ -345,7 +349,8 @@ OS_MARK(struct ath_hal *ah, u_int id, u_
 		}
 	}
 }
-#elif defined(AH_DEBUG) || defined(AH_REGOPS_FUNC)
+#else /* AH_DEBUG_ALQ */
+
 /*
  * Memory-mapped device register read/write.  These are here
  * as routines when debugging support is enabled and/or when
@@ -363,12 +368,14 @@ ath_hal_reg_write(struct ath_hal *ah, u_
 	bus_space_tag_t tag = BUSTAG(ah);
 	bus_space_handle_t h = ah->ah_sh;
 
+#ifdef	AH_DEBUG
 	/* Debug - complain if we haven't fully waken things up */
 	if (! ath_hal_reg_whilst_asleep(ah, reg) &&
 	    ah->ah_powerMode != HAL_PM_AWAKE) {
 		ath_hal_printf(ah, "%s: reg=0x%08x, val=0x%08x, pm=%d\n",
 		    __func__, reg, val, ah->ah_powerMode);
 	}
+#endif
 
 	if (ah->ah_config.ah_serialise_reg_war)
 		mtx_lock_spin(&ah_regser_mtx);
@@ -385,12 +392,14 @@ ath_hal_reg_read(struct ath_hal *ah, u_i
 	bus_space_handle_t h = ah->ah_sh;
 	u_int32_t val;
 
+#ifdef	AH_DEBUG
 	/* Debug - complain if we haven't fully waken things up */
 	if (! ath_hal_reg_whilst_asleep(ah, reg) &&
 	    ah->ah_powerMode != HAL_PM_AWAKE) {
 		ath_hal_printf(ah, "%s: reg=0x%08x, pm=%d\n",
 		    __func__, reg, ah->ah_powerMode);
 	}
+#endif
 
 	if (ah->ah_config.ah_serialise_reg_war)
 		mtx_lock_spin(&ah_regser_mtx);
@@ -400,7 +409,7 @@ ath_hal_reg_read(struct ath_hal *ah, u_i
 		mtx_unlock_spin(&ah_regser_mtx);
 	return val;
 }
-#endif /* AH_DEBUG || AH_REGOPS_FUNC */
+#endif /* AH_DEBUG_ALQ */
 
 #ifdef AH_ASSERT
 void

Modified: head/sys/dev/ath/ah_osdep.h
==============================================================================
--- head/sys/dev/ath/ah_osdep.h	Sun Jan  3 17:23:16 2016	(r293110)
+++ head/sys/dev/ath/ah_osdep.h	Sun Jan  3 17:58:11 2016	(r293111)
@@ -131,26 +131,14 @@ struct ath_hal;
 	OS_BUS_BARRIER((_ah), (_reg), 4, (_t))
 
 /*
- * Register read/write operations are either handled through
- * platform-dependent routines (or when debugging is enabled
- * with AH_DEBUG); or they are inline expanded using the macros
- * defined below.
+ * Register read/write operations are handled through
+ * platform-dependent routines.
  */
-#if defined(AH_DEBUG) || defined(AH_REGOPS_FUNC) || defined(AH_DEBUG_ALQ)
 #define	OS_REG_WRITE(_ah, _reg, _val)	ath_hal_reg_write(_ah, _reg, _val)
 #define	OS_REG_READ(_ah, _reg)		ath_hal_reg_read(_ah, _reg)
 
 extern	void ath_hal_reg_write(struct ath_hal *ah, u_int reg, u_int32_t val);
 extern	u_int32_t ath_hal_reg_read(struct ath_hal *ah, u_int reg);
-#else
-/* XXX TODO: enforce barriers */
-#define	OS_REG_WRITE(_ah, _reg, _val)					\
-	bus_space_write_4((bus_space_tag_t)(_ah)->ah_st,		\
-	    (bus_space_handle_t)(_ah)->ah_sh, (_reg), (_val))
-#define	OS_REG_READ(_ah, _reg)						\
-	bus_space_read_4((bus_space_tag_t)(_ah)->ah_st,			\
-	    (bus_space_handle_t)(_ah)->ah_sh, (_reg))
-#endif
 
 #ifdef AH_DEBUG_ALQ
 extern	void OS_MARK(struct ath_hal *, u_int id, u_int32_t value);


More information about the svn-src-all mailing list