All of lore.kernel.org
 help / color / mirror / Atom feed
From: Inaky Perez-Gonzalez <inaky@linux.intel.com>
To: netdev@vger.kernel.org
Cc: greg@kroah.com, wimax@linuxwimax.org
Subject: [PATCH 23/29] i2400m/SDIO: header for the SDIO subdriver
Date: Mon,  8 Dec 2008 11:09:38 -0800	[thread overview]
Message-ID: <43bc16543bf995bd7ebbf81e45563eb75eb08929.1228759689.git.inaky@linux.intel.com> (raw)
In-Reply-To: <cover.1228759689.git.inaky@linux.intel.com>

This contains the common function declaration and constants for the
SDIO driver for the 2400m Wireless WiMAX Connection and it's debug
level settings.

Signed-off-by: Inaky Perez-Gonzalez <inaky@linux.intel.com>
---
 drivers/net/wimax/i2400m/i2400m-sdio.h       |  132 ++++++++++++++++++++++++++
 drivers/net/wimax/i2400m/sdio-debug-levels.h |   22 +++++
 2 files changed, 154 insertions(+), 0 deletions(-)
 create mode 100644 drivers/net/wimax/i2400m/i2400m-sdio.h
 create mode 100644 drivers/net/wimax/i2400m/sdio-debug-levels.h

diff --git a/drivers/net/wimax/i2400m/i2400m-sdio.h b/drivers/net/wimax/i2400m/i2400m-sdio.h
new file mode 100644
index 0000000..08c2fb7
--- /dev/null
+++ b/drivers/net/wimax/i2400m/i2400m-sdio.h
@@ -0,0 +1,132 @@
+/*
+ * Intel Wireless WiMAX Connection 2400m
+ * SDIO-specific i2400m driver definitions
+ *
+ *
+ * Copyright (C) 2007-2008 Intel Corporation. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ *   * Redistributions of source code must retain the above copyright
+ *     notice, this list of conditions and the following disclaimer.
+ *   * 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.
+ *   * Neither the name of Intel Corporation nor the names of its
+ *     contributors may be used to endorse or promote products derived
+ *     from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS 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 COPYRIGHT
+ * OWNER 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.
+ *
+ *
+ * Intel Corporation <linux-wimax@intel.com>
+ * Brian Bian <brian.bian@intel.com>
+ * Dirk Brandewie <dirk.j.brandewie@intel.com>
+ * Inaky Perez-Gonzalez <inaky.perez-gonzalez@intel.com>
+ * Yanir Lubetkin <yanirx.lubetkin@intel.com>
+ *  - Initial implementation
+ *
+ *
+ * This driver implements the bus-specific part of the i2400m for
+ * SDIO. Check i2400m.h for a generic driver description.
+ *
+ * ARCHITECTURE
+ *
+ * This driver sits under the bus-generic i2400m driver, providing the
+ * connection to the device.
+ *
+ * When probed, all the function pointers are setup and then the
+ * bus-generic code called. The generic driver will then use the
+ * provided pointers for uploading firmware (i2400ms_bus_bm*() in
+ * sdio-fw.c) and then setting up the device (i2400ms_dev_*() in
+ * sdio.c).
+ *
+ * Once firmware is uploaded, TX functions (sdio-tx.c) are called when
+ * data is ready for transmission in the TX fifo; then the SDIO IRQ is
+ * fired and data is available (sdio-rx.c), it is sent to the generic
+ * driver for processing with i2400m_rx.
+ */
+
+#ifndef __I2400M_SDIO_H__
+#define __I2400M_SDIO_H__
+
+#include "i2400m.h"
+
+/* Host-Device interface for SDIO */
+enum {
+	I2400MS_BLK_SIZE = 256,
+	I2400MS_PL_SIZE_MAX = 0x3E00,
+
+	I2400MS_DATA_ADDR = 0x0,
+	I2400MS_INTR_STATUS_ADDR = 0x13,
+	I2400MS_INTR_CLEAR_ADDR = 0x13,
+	I2400MS_INTR_ENABLE_ADDR = 0x14,
+	I2400MS_INTR_GET_SIZE_ADDR = 0x2C,
+	/* The number of ticks to wait for the device to signal that
+	 * it is ready */
+	I2400MS_INIT_SLEEP_INTERVAL = 10,
+};
+
+
+/**
+ * struct i2400ms - descriptor for a SDIO connected i2400m
+ *
+ * @i2400m: bus-generic i2400m implementation; has to be first (see
+ *     it's documentation in i2400m.h).
+ *
+ * @func: pointer to our SDIO function
+ *
+ * @tx_worker: workqueue struct used to TX data when the bus-generic
+ *     code signals packets are pending for transmission to the device.
+ *
+ * @tx_workqueue: workqeueue used for data TX; we don't use the
+ *     system's workqueue as that might cause deadlocks with code in
+ *     the bus-generic driver.
+ */
+struct i2400ms {
+	struct i2400m i2400m;		/* FIRST! See doc */
+	struct sdio_func *func;
+
+	struct work_struct tx_worker;
+	struct workqueue_struct *tx_workqueue;
+	char tx_wq_name[32];
+
+	struct dentry *debugfs_dentry;
+};
+
+
+static inline
+void i2400ms_init(struct i2400ms *i2400ms)
+{
+	i2400m_init(&i2400ms->i2400m);
+}
+
+
+extern int i2400ms_rx_setup(struct i2400ms *);
+extern void i2400ms_rx_release(struct i2400ms *);
+extern ssize_t __i2400ms_rx_get_size(struct i2400ms *);
+
+extern int i2400ms_tx_setup(struct i2400ms *);
+extern void i2400ms_tx_release(struct i2400ms *);
+extern void i2400ms_bus_tx_kick(struct i2400m *);
+
+extern ssize_t i2400ms_bus_bm_cmd_send(struct i2400m *,
+				       const struct i2400m_bootrom_header *,
+				       size_t, int);
+extern ssize_t i2400ms_bus_bm_wait_for_ack(struct i2400m *,
+					   struct i2400m_bootrom_header *,
+					   size_t);
+#endif /* #ifndef __I2400M_SDIO_H__ */
diff --git a/drivers/net/wimax/i2400m/sdio-debug-levels.h b/drivers/net/wimax/i2400m/sdio-debug-levels.h
new file mode 100644
index 0000000..c519987
--- /dev/null
+++ b/drivers/net/wimax/i2400m/sdio-debug-levels.h
@@ -0,0 +1,22 @@
+/*
+ * debug levels control file for the i2400m module's
+ */
+#ifndef __debug_levels__h__
+#define __debug_levels__h__
+
+/* Maximum compile and run time debug level for all submodules */
+#define D_MODULENAME i2400m_sdio
+#define D_MASTER CONFIG_WIMAX_I2400M_DEBUG_LEVEL
+
+#include <linux/wimax/debug.h>
+
+/* List of all the enabled modules */
+enum d_module {
+	D_SUBMODULE_DECLARE(main),
+	D_SUBMODULE_DECLARE(tx),
+	D_SUBMODULE_DECLARE(rx),
+	D_SUBMODULE_DECLARE(fw)
+};
+
+
+#endif /* #ifndef __debug_levels__h__ */
-- 
1.5.6.5

  parent reply	other threads:[~2008-12-08 19:09 UTC|newest]

Thread overview: 39+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-12-08 19:09 [PATCH 00/29] merge request for WiMAX kernel stack and i2400m driver v3 Inaky Perez-Gonzalez
2008-12-08 19:09 ` [PATCH 01/29] wimax: documentation for the stack Inaky Perez-Gonzalez
2008-12-08 19:09 ` [PATCH 02/29] wimax: headers for kernel API and user space interaction Inaky Perez-Gonzalez
2008-12-08 20:05   ` Johannes Berg
2008-12-08 21:22     ` Inaky Perez-Gonzalez
2008-12-08 23:29       ` Johannes Berg
2008-12-08 19:09 ` [PATCH 03/29] wimax: internal API for the kernel space WiMAX stack Inaky Perez-Gonzalez
2008-12-08 19:09 ` [PATCH 04/29] wimax: debug macros and debug settings for the " Inaky Perez-Gonzalez
2008-12-08 19:09 ` [PATCH 05/29] wimax: generic device management (registration, deregistration, lookup) Inaky Perez-Gonzalez
2008-12-08 19:09 ` [PATCH 06/29] genetlink: export genl_unregister_mc_group() Inaky Perez-Gonzalez
2008-12-08 19:09 ` [PATCH 07/29] wimax: basic API: kernel/user messaging, rfkill and reset Inaky Perez-Gonzalez
2008-12-08 20:01   ` Johannes Berg
2008-12-08 21:24     ` Inaky Perez-Gonzalez
2008-12-08 19:09 ` [PATCH 08/29] debugfs: add helpers for exporting a size_t simple value Inaky Perez-Gonzalez
2008-12-08 19:09 ` [PATCH 09/29] wimax: debugfs controls Inaky Perez-Gonzalez
2008-12-08 19:09 ` [PATCH 10/29] wimax: Makefile, Kconfig and docbook linkage for the stack Inaky Perez-Gonzalez
2008-12-08 19:09 ` [PATCH 11/29] i2400m: documentation and instructions for usage Inaky Perez-Gonzalez
2008-12-08 19:09 ` [PATCH 12/29] i2400m: host/device procotol and core driver definitions Inaky Perez-Gonzalez
2008-12-08 19:09 ` [PATCH 13/29] i2400m: Generic probe/disconnect, reset and message passing Inaky Perez-Gonzalez
2008-12-08 19:09 ` [PATCH 14/29] i2400m: linkage to the networking stack Inaky Perez-Gonzalez
2008-12-08 19:09 ` [PATCH 15/29] i2400m: firmware loading and bootrom initialization Inaky Perez-Gonzalez
2008-12-08 19:09 ` [PATCH 16/29] i2400m: RX and TX data/control paths Inaky Perez-Gonzalez
2008-12-08 19:09 ` [PATCH 17/29] i2400m: various functions for device management Inaky Perez-Gonzalez
2008-12-08 19:09 ` [PATCH 18/29] i2400m: debugfs controls Inaky Perez-Gonzalez
2008-12-08 19:09 ` [PATCH 19/29] i2400m/USB: header for the USB bus driver Inaky Perez-Gonzalez
2008-12-08 19:09 ` [PATCH 20/29] i2400m/USB: probe/disconnect, dev init/shutdown and reset backends Inaky Perez-Gonzalez
2008-12-08 19:09 ` [PATCH 21/29] i2400m/USB: firmware upload backend Inaky Perez-Gonzalez
2008-12-08 19:09 ` [PATCH 22/29] i2400m/USB: TX and RX path backends Inaky Perez-Gonzalez
2008-12-08 19:09 ` Inaky Perez-Gonzalez [this message]
2008-12-08 19:09 ` [PATCH 24/29] i2400m/SDIO: probe/disconnect, dev init/shutdown and reset backends Inaky Perez-Gonzalez
2008-12-08 19:09 ` [PATCH 25/29] i2400m/SDIO: firmware upload backend Inaky Perez-Gonzalez
2008-12-08 19:09 ` [PATCH 26/29] i2400m/SDIO: TX and RX path backends Inaky Perez-Gonzalez
2008-12-08 19:09 ` [PATCH 27/29] i2400m: Makefile and Kconfig Inaky Perez-Gonzalez
2008-12-08 19:09 ` [PATCH 28/29] wimax: export linux/wimax.h and linux/wimax/i2400m.h with headers_install Inaky Perez-Gonzalez
2008-12-08 19:09 ` [PATCH 29/29] wimax/i2400m: add CREDITS and MAINTAINERS entries Inaky Perez-Gonzalez
2008-12-15 11:37 ` [PATCH 00/29] merge request for WiMAX kernel stack and i2400m driver v3 Thomas Graf
2008-12-10 23:12 [PATCH 00/29] merge request for WiMAX kernel stack and i2400m driver v4 Inaky Perez-Gonzalez
2008-12-10 23:13 ` [PATCH 23/29] i2400m/SDIO: header for the SDIO subdriver Inaky Perez-Gonzalez
2008-12-15 12:57 [PATCH 00/29] merge request for WiMAX kernel stack and i2400m driver v6 Inaky Perez-Gonzalez
2008-12-15 12:58 ` [PATCH 23/29] i2400m/SDIO: header for the SDIO subdriver Inaky Perez-Gonzalez
2008-12-21  0:57 [PATCH 00/29] merge request for WiMAX kernel stack and i2400m driver v7 Inaky Perez-Gonzalez
2008-12-21  0:57 ` [PATCH 23/29] i2400m/SDIO: header for the SDIO subdriver Inaky Perez-Gonzalez

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=43bc16543bf995bd7ebbf81e45563eb75eb08929.1228759689.git.inaky@linux.intel.com \
    --to=inaky@linux.intel.com \
    --cc=greg@kroah.com \
    --cc=netdev@vger.kernel.org \
    --cc=wimax@linuxwimax.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.