diff options
author | Inaky Perez-Gonzalez <inaky@linux.intel.com> | 2009-09-16 21:23:27 -0400 |
---|---|---|
committer | Inaky Perez-Gonzalez <inaky@linux.intel.com> | 2009-10-19 02:56:08 -0400 |
commit | 0856ccf29dfbaf957e4be80dd3eb88d97810b633 (patch) | |
tree | a33cf96b010ce3814747b67eb60743554af2070f /drivers/net/wimax/i2400m/i2400m.h | |
parent | c2315b4ea9ac9c3f8caf03c3511d86fabe4a5fcd (diff) |
wimax/i2400m: introduce i2400m->bus_setup/release
The SDIO subdriver of the i2400m requires certain steps to be done
before we do any acces to the device, even for doing firmware upload.
This lead to a few ugly hacks, which basically involve doing those
steps in probe() before calling i2400m_setup() and undoing them in
disconnect() after claling i2400m_release(); but then, much of those
steps have to be repeated when resetting the device, suspending, etc
(in upcoming pre/post reset support).
Thus, a new pair of optional, bus-specific calls
i2400m->bus_{setup/release} are introduced. These are used to setup
basic infrastructure needed to load firmware onto the device.
This commit also updates the SDIO subdriver to use said calls.
Signed-off-by: Inaky Perez-Gonzalez <inaky@linux.intel.com>
Diffstat (limited to 'drivers/net/wimax/i2400m/i2400m.h')
-rw-r--r-- | drivers/net/wimax/i2400m/i2400m.h | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/drivers/net/wimax/i2400m/i2400m.h b/drivers/net/wimax/i2400m/i2400m.h index fbc156db5bfd..407d0972f2f6 100644 --- a/drivers/net/wimax/i2400m/i2400m.h +++ b/drivers/net/wimax/i2400m/i2400m.h | |||
@@ -123,6 +123,7 @@ | |||
123 | * | 123 | * |
124 | * bus_probe() | 124 | * bus_probe() |
125 | * i2400m_setup() | 125 | * i2400m_setup() |
126 | * i2400m->bus_setup() | ||
126 | * boot rom initialization / read mac addr | 127 | * boot rom initialization / read mac addr |
127 | * network / WiMAX stacks registration | 128 | * network / WiMAX stacks registration |
128 | * i2400m_dev_start() | 129 | * i2400m_dev_start() |
@@ -137,6 +138,7 @@ | |||
137 | * i2400m_dev_shutdown() | 138 | * i2400m_dev_shutdown() |
138 | * i2400m->bus_dev_stop() | 139 | * i2400m->bus_dev_stop() |
139 | * network / WiMAX stack unregistration | 140 | * network / WiMAX stack unregistration |
141 | * i2400m->bus_release() | ||
140 | * | 142 | * |
141 | * At this point, control and data communications are possible. | 143 | * At this point, control and data communications are possible. |
142 | * | 144 | * |
@@ -214,12 +216,35 @@ struct i2400m_barker_db; | |||
214 | * Members marked with [fill] must be filled out/initialized before | 216 | * Members marked with [fill] must be filled out/initialized before |
215 | * calling i2400m_setup(). | 217 | * calling i2400m_setup(). |
216 | * | 218 | * |
219 | * Note the @bus_setup/@bus_release, @bus_dev_start/@bus_dev_release | ||
220 | * call pairs are very much doing almost the same, and depending on | ||
221 | * the underlying bus, some stuff has to be put in one or the | ||
222 | * other. The idea of setup/release is that they setup the minimal | ||
223 | * amount needed for loading firmware, where us dev_start/stop setup | ||
224 | * the rest needed to do full data/control traffic. | ||
225 | * | ||
217 | * @bus_tx_block_size: [fill] SDIO imposes a 256 block size, USB 16, | 226 | * @bus_tx_block_size: [fill] SDIO imposes a 256 block size, USB 16, |
218 | * so we have a tx_blk_size variable that the bus layer sets to | 227 | * so we have a tx_blk_size variable that the bus layer sets to |
219 | * tell the engine how much of that we need. | 228 | * tell the engine how much of that we need. |
220 | * | 229 | * |
221 | * @bus_pl_size_max: [fill] Maximum payload size. | 230 | * @bus_pl_size_max: [fill] Maximum payload size. |
222 | * | 231 | * |
232 | * @bus_setup: [optional fill] Function called by the bus-generic code | ||
233 | * [i2400m_setup()] to setup the basic bus-specific communications | ||
234 | * to the the device needed to load firmware. See LIFE CYCLE above. | ||
235 | * | ||
236 | * NOTE: Doesn't need to upload the firmware, as that is taken | ||
237 | * care of by the bus-generic code. | ||
238 | * | ||
239 | * @bus_release: [optional fill] Function called by the bus-generic | ||
240 | * code [i2400m_release()] to shutdown the basic bus-specific | ||
241 | * communications to the the device needed to load firmware. See | ||
242 | * LIFE CYCLE above. | ||
243 | * | ||
244 | * This function does not need to reset the device, just tear down | ||
245 | * all the host resources created to handle communication with | ||
246 | * the device. | ||
247 | * | ||
223 | * @bus_dev_start: [fill] Function called by the bus-generic code | 248 | * @bus_dev_start: [fill] Function called by the bus-generic code |
224 | * [i2400m_dev_start()] to setup the bus-specific communications | 249 | * [i2400m_dev_start()] to setup the bus-specific communications |
225 | * to the the device. See LIFE CYCLE above. | 250 | * to the the device. See LIFE CYCLE above. |
@@ -490,8 +515,10 @@ struct i2400m { | |||
490 | size_t bus_pl_size_max; | 515 | size_t bus_pl_size_max; |
491 | unsigned bus_bm_retries; | 516 | unsigned bus_bm_retries; |
492 | 517 | ||
518 | int (*bus_setup)(struct i2400m *); | ||
493 | int (*bus_dev_start)(struct i2400m *); | 519 | int (*bus_dev_start)(struct i2400m *); |
494 | void (*bus_dev_stop)(struct i2400m *); | 520 | void (*bus_dev_stop)(struct i2400m *); |
521 | void (*bus_release)(struct i2400m *); | ||
495 | void (*bus_tx_kick)(struct i2400m *); | 522 | void (*bus_tx_kick)(struct i2400m *); |
496 | int (*bus_reset)(struct i2400m *, enum i2400m_reset_type); | 523 | int (*bus_reset)(struct i2400m *, enum i2400m_reset_type); |
497 | ssize_t (*bus_bm_cmd_send)(struct i2400m *, | 524 | ssize_t (*bus_bm_cmd_send)(struct i2400m *, |