iwlwifi: Add iwl_write8()
authorBen Cahill <ben.m.cahill@intel.com>
Fri, 20 Nov 2009 20:04:52 +0000 (12:04 -0800)
committerJohn W. Linville <linville@tuxdriver.com>
Mon, 23 Nov 2009 22:05:30 +0000 (17:05 -0500)
To support byte writes to CSR_INT_COALESCING and CSR_INT_PERIODIC registers,
add iwl_write8(), including debug/trace support.

Signed-off-by: Ben Cahill <ben.m.cahill@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/iwlwifi/iwl-devtrace.c
drivers/net/wireless/iwlwifi/iwl-devtrace.h
drivers/net/wireless/iwlwifi/iwl-io.h

index 4ef5acaa556dbf159a18f3411aaccf0e43f3603e..e7d88d1da15d9d5e2c49d11f7b07d1d4ed1f6363 100644 (file)
@@ -5,6 +5,7 @@
 #define CREATE_TRACE_POINTS
 #include "iwl-devtrace.h"
 
+EXPORT_TRACEPOINT_SYMBOL(iwlwifi_dev_iowrite8);
 EXPORT_TRACEPOINT_SYMBOL(iwlwifi_dev_ioread32);
 EXPORT_TRACEPOINT_SYMBOL(iwlwifi_dev_iowrite32);
 EXPORT_TRACEPOINT_SYMBOL(iwlwifi_dev_rx);
index 8c7159208da1ea0601d3941ab538855a29fdd210..f2d4b01ba4661f0fd8b39ba696c6b2c1694c99dd 100644 (file)
@@ -32,6 +32,22 @@ TRACE_EVENT(iwlwifi_dev_ioread32,
        TP_printk("[%p] read io[%#x] = %#x", __entry->priv, __entry->offs, __entry->val)
 );
 
+TRACE_EVENT(iwlwifi_dev_iowrite8,
+       TP_PROTO(struct iwl_priv *priv, u32 offs, u8 val),
+       TP_ARGS(priv, offs, val),
+       TP_STRUCT__entry(
+               PRIV_ENTRY
+               __field(u32, offs)
+               __field(u8, val)
+       ),
+       TP_fast_assign(
+               PRIV_ASSIGN;
+               __entry->offs = offs;
+               __entry->val = val;
+       ),
+       TP_printk("[%p] write io[%#x] = %#x)", __entry->priv, __entry->offs, __entry->val)
+);
+
 TRACE_EVENT(iwlwifi_dev_iowrite32,
        TP_PROTO(struct iwl_priv *priv, u32 offs, u32 val),
        TP_ARGS(priv, offs, val),
index d0a358c9d96b48f5ba5620e23160b23a9e83ac73..e552d4c4bdbe0e31ea34a160373b87ccd191a8ab 100644 (file)
  *
  */
 
+static inline void _iwl_write8(struct iwl_priv *priv, u32 ofs, u8 val)
+{
+       trace_iwlwifi_dev_iowrite8(priv, ofs, val);
+       iowrite8(val, priv->hw_base + ofs);
+}
+
+#ifdef CONFIG_IWLWIFI_DEBUG
+static inline void __iwl_write8(const char *f, u32 l, struct iwl_priv *priv,
+                                u32 ofs, u8 val)
+{
+       IWL_DEBUG_IO(priv, "write8(0x%08X, 0x%02X) - %s %d\n", ofs, val, f, l);
+       _iwl_write8(priv, ofs, val);
+}
+#define iwl_write8(priv, ofs, val) \
+       __iwl_write8(__FILE__, __LINE__, priv, ofs, val)
+#else
+#define iwl_write8(priv, ofs, val) _iwl_write8(priv, ofs, val)
+#endif
+
+
 static inline void _iwl_write32(struct iwl_priv *priv, u32 ofs, u32 val)
 {
        trace_iwlwifi_dev_iowrite32(priv, ofs, val);