aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net
diff options
context:
space:
mode:
authorInaky Perez-Gonzalez <inaky@linux.intel.com>2008-12-20 19:57:54 -0500
committerGreg Kroah-Hartman <gregkh@suse.de>2009-01-07 13:00:22 -0500
commit17d559af963995e483a51ec26697034431bcf2b9 (patch)
tree330d6544e2bc1c2bac0c5a38c5393b6fb4e99191 /drivers/net
parenta8ebf98f541463107bb9544a1b611981dc2477e7 (diff)
i2400m/SDIO: header for the SDIO subdriver
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> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/wimax/i2400m/i2400m-sdio.h132
-rw-r--r--drivers/net/wimax/i2400m/sdio-debug-levels.h22
2 files changed, 154 insertions, 0 deletions
diff --git a/drivers/net/wimax/i2400m/i2400m-sdio.h b/drivers/net/wimax/i2400m/i2400m-sdio.h
new file mode 100644
index 000000000000..08c2fb739234
--- /dev/null
+++ b/drivers/net/wimax/i2400m/i2400m-sdio.h
@@ -0,0 +1,132 @@
1/*
2 * Intel Wireless WiMAX Connection 2400m
3 * SDIO-specific i2400m driver definitions
4 *
5 *
6 * Copyright (C) 2007-2008 Intel Corporation. All rights reserved.
7 *
8 * Redistribution and use in source and binary forms, with or without
9 * modification, are permitted provided that the following conditions
10 * are met:
11 *
12 * * Redistributions of source code must retain the above copyright
13 * notice, this list of conditions and the following disclaimer.
14 * * Redistributions in binary form must reproduce the above copyright
15 * notice, this list of conditions and the following disclaimer in
16 * the documentation and/or other materials provided with the
17 * distribution.
18 * * Neither the name of Intel Corporation nor the names of its
19 * contributors may be used to endorse or promote products derived
20 * from this software without specific prior written permission.
21 *
22 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
23 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
24 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
25 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
26 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
27 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
28 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
29 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
30 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
31 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
32 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33 *
34 *
35 * Intel Corporation <linux-wimax@intel.com>
36 * Brian Bian <brian.bian@intel.com>
37 * Dirk Brandewie <dirk.j.brandewie@intel.com>
38 * Inaky Perez-Gonzalez <inaky.perez-gonzalez@intel.com>
39 * Yanir Lubetkin <yanirx.lubetkin@intel.com>
40 * - Initial implementation
41 *
42 *
43 * This driver implements the bus-specific part of the i2400m for
44 * SDIO. Check i2400m.h for a generic driver description.
45 *
46 * ARCHITECTURE
47 *
48 * This driver sits under the bus-generic i2400m driver, providing the
49 * connection to the device.
50 *
51 * When probed, all the function pointers are setup and then the
52 * bus-generic code called. The generic driver will then use the
53 * provided pointers for uploading firmware (i2400ms_bus_bm*() in
54 * sdio-fw.c) and then setting up the device (i2400ms_dev_*() in
55 * sdio.c).
56 *
57 * Once firmware is uploaded, TX functions (sdio-tx.c) are called when
58 * data is ready for transmission in the TX fifo; then the SDIO IRQ is
59 * fired and data is available (sdio-rx.c), it is sent to the generic
60 * driver for processing with i2400m_rx.
61 */
62
63#ifndef __I2400M_SDIO_H__
64#define __I2400M_SDIO_H__
65
66#include "i2400m.h"
67
68/* Host-Device interface for SDIO */
69enum {
70 I2400MS_BLK_SIZE = 256,
71 I2400MS_PL_SIZE_MAX = 0x3E00,
72
73 I2400MS_DATA_ADDR = 0x0,
74 I2400MS_INTR_STATUS_ADDR = 0x13,
75 I2400MS_INTR_CLEAR_ADDR = 0x13,
76 I2400MS_INTR_ENABLE_ADDR = 0x14,
77 I2400MS_INTR_GET_SIZE_ADDR = 0x2C,
78 /* The number of ticks to wait for the device to signal that
79 * it is ready */
80 I2400MS_INIT_SLEEP_INTERVAL = 10,
81};
82
83
84/**
85 * struct i2400ms - descriptor for a SDIO connected i2400m
86 *
87 * @i2400m: bus-generic i2400m implementation; has to be first (see
88 * it's documentation in i2400m.h).
89 *
90 * @func: pointer to our SDIO function
91 *
92 * @tx_worker: workqueue struct used to TX data when the bus-generic
93 * code signals packets are pending for transmission to the device.
94 *
95 * @tx_workqueue: workqeueue used for data TX; we don't use the
96 * system's workqueue as that might cause deadlocks with code in
97 * the bus-generic driver.
98 */
99struct i2400ms {
100 struct i2400m i2400m; /* FIRST! See doc */
101 struct sdio_func *func;
102
103 struct work_struct tx_worker;
104 struct workqueue_struct *tx_workqueue;
105 char tx_wq_name[32];
106
107 struct dentry *debugfs_dentry;
108};
109
110
111static inline
112void i2400ms_init(struct i2400ms *i2400ms)
113{
114 i2400m_init(&i2400ms->i2400m);
115}
116
117
118extern int i2400ms_rx_setup(struct i2400ms *);
119extern void i2400ms_rx_release(struct i2400ms *);
120extern ssize_t __i2400ms_rx_get_size(struct i2400ms *);
121
122extern int i2400ms_tx_setup(struct i2400ms *);
123extern void i2400ms_tx_release(struct i2400ms *);
124extern void i2400ms_bus_tx_kick(struct i2400m *);
125
126extern ssize_t i2400ms_bus_bm_cmd_send(struct i2400m *,
127 const struct i2400m_bootrom_header *,
128 size_t, int);
129extern ssize_t i2400ms_bus_bm_wait_for_ack(struct i2400m *,
130 struct i2400m_bootrom_header *,
131 size_t);
132#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 000000000000..c51998741301
--- /dev/null
+++ b/drivers/net/wimax/i2400m/sdio-debug-levels.h
@@ -0,0 +1,22 @@
1/*
2 * debug levels control file for the i2400m module's
3 */
4#ifndef __debug_levels__h__
5#define __debug_levels__h__
6
7/* Maximum compile and run time debug level for all submodules */
8#define D_MODULENAME i2400m_sdio
9#define D_MASTER CONFIG_WIMAX_I2400M_DEBUG_LEVEL
10
11#include <linux/wimax/debug.h>
12
13/* List of all the enabled modules */
14enum d_module {
15 D_SUBMODULE_DECLARE(main),
16 D_SUBMODULE_DECLARE(tx),
17 D_SUBMODULE_DECLARE(rx),
18 D_SUBMODULE_DECLARE(fw)
19};
20
21
22#endif /* #ifndef __debug_levels__h__ */