diff options
author | Inaky Perez-Gonzalez <inaky@linux.intel.com> | 2009-10-23 20:45:07 -0400 |
---|---|---|
committer | Inaky Perez-Gonzalez <inaky@linux.intel.com> | 2009-11-03 15:49:38 -0500 |
commit | 02eb41ef2a8631022fd90e096c57562dec9e7a9a (patch) | |
tree | 65280a03f80a15214f715510739bf9a983ecea5b /drivers/net/wimax | |
parent | 296bd4bdd0a43c5e56ee310bcb9b4722e5d52db8 (diff) |
wimax/i2400m: correctly identify all iwmc3200-based SKUs
Different paths of the i2400m SDIO driver need to take care of a few
SKU-specific quirks. For the ones that are common to to all the
iwmc3200 based devices, introduce i2400ms->iwmc3200 [set in
i2400ms_probe()], so it doesn't have to check against the list of
iwmc3200 SKU IDs on each quirk site.
Signed-off-by: Inaky Perez-Gonzalez <inaky@linux.intel.com>
Diffstat (limited to 'drivers/net/wimax')
-rw-r--r-- | drivers/net/wimax/i2400m/i2400m-sdio.h | 3 | ||||
-rw-r--r-- | drivers/net/wimax/i2400m/sdio.c | 16 |
2 files changed, 16 insertions, 3 deletions
diff --git a/drivers/net/wimax/i2400m/i2400m-sdio.h b/drivers/net/wimax/i2400m/i2400m-sdio.h index 18218a24a8f8..fba482c08d66 100644 --- a/drivers/net/wimax/i2400m/i2400m-sdio.h +++ b/drivers/net/wimax/i2400m/i2400m-sdio.h | |||
@@ -114,6 +114,9 @@ struct i2400ms { | |||
114 | wait_queue_head_t bm_wfa_wq; | 114 | wait_queue_head_t bm_wfa_wq; |
115 | int bm_wait_result; | 115 | int bm_wait_result; |
116 | size_t bm_ack_size; | 116 | size_t bm_ack_size; |
117 | |||
118 | /* Device is any of the iwmc3200 SKUs */ | ||
119 | unsigned iwmc3200:1; | ||
117 | }; | 120 | }; |
118 | 121 | ||
119 | 122 | ||
diff --git a/drivers/net/wimax/i2400m/sdio.c b/drivers/net/wimax/i2400m/sdio.c index 20ab22ec291b..079f900e9ae5 100644 --- a/drivers/net/wimax/i2400m/sdio.c +++ b/drivers/net/wimax/i2400m/sdio.c | |||
@@ -105,8 +105,9 @@ static const struct i2400m_poke_table i2400ms_pokes[] = { | |||
105 | * error (-ENODEV when it was unable to enable the function). | 105 | * error (-ENODEV when it was unable to enable the function). |
106 | */ | 106 | */ |
107 | static | 107 | static |
108 | int i2400ms_enable_function(struct sdio_func *func, unsigned maxtries) | 108 | int i2400ms_enable_function(struct i2400ms *i2400ms, unsigned maxtries) |
109 | { | 109 | { |
110 | struct sdio_func *func = i2400ms->func; | ||
110 | u64 timeout; | 111 | u64 timeout; |
111 | int err; | 112 | int err; |
112 | struct device *dev = &func->dev; | 113 | struct device *dev = &func->dev; |
@@ -126,7 +127,7 @@ int i2400ms_enable_function(struct sdio_func *func, unsigned maxtries) | |||
126 | * platforms (system hang). We explicitly overwrite | 127 | * platforms (system hang). We explicitly overwrite |
127 | * func->enable_timeout here to work around the issue. | 128 | * func->enable_timeout here to work around the issue. |
128 | */ | 129 | */ |
129 | if (func->device == SDIO_DEVICE_ID_INTEL_IWMC3200WIMAX) | 130 | if (i2400ms->iwmc3200) |
130 | func->enable_timeout = IWMC3200_IOR_TIMEOUT; | 131 | func->enable_timeout = IWMC3200_IOR_TIMEOUT; |
131 | err = sdio_enable_func(func); | 132 | err = sdio_enable_func(func); |
132 | if (0 == err) { | 133 | if (0 == err) { |
@@ -176,7 +177,7 @@ int i2400ms_bus_setup(struct i2400m *i2400m) | |||
176 | goto error_set_blk_size; | 177 | goto error_set_blk_size; |
177 | } | 178 | } |
178 | 179 | ||
179 | result = i2400ms_enable_function(func, 1); | 180 | result = i2400ms_enable_function(i2400ms, 1); |
180 | if (result < 0) { | 181 | if (result < 0) { |
181 | dev_err(dev, "Cannot enable SDIO function: %d\n", result); | 182 | dev_err(dev, "Cannot enable SDIO function: %d\n", result); |
182 | goto error_func_enable; | 183 | goto error_func_enable; |
@@ -487,6 +488,15 @@ int i2400ms_probe(struct sdio_func *func, | |||
487 | i2400m->bus_bm_mac_addr_impaired = 1; | 488 | i2400m->bus_bm_mac_addr_impaired = 1; |
488 | i2400m->bus_bm_pokes_table = &i2400ms_pokes[0]; | 489 | i2400m->bus_bm_pokes_table = &i2400ms_pokes[0]; |
489 | 490 | ||
491 | switch (func->device) { | ||
492 | case SDIO_DEVICE_ID_INTEL_IWMC3200WIMAX: | ||
493 | case SDIO_DEVICE_ID_INTEL_IWMC3200WIMAX_2G5: | ||
494 | i2400ms->iwmc3200 = 1; | ||
495 | break; | ||
496 | default: | ||
497 | i2400ms->iwmc3200 = 0; | ||
498 | } | ||
499 | |||
490 | result = i2400m_setup(i2400m, I2400M_BRI_NO_REBOOT); | 500 | result = i2400m_setup(i2400m, I2400M_BRI_NO_REBOOT); |
491 | if (result < 0) { | 501 | if (result < 0) { |
492 | dev_err(dev, "cannot setup device: %d\n", result); | 502 | dev_err(dev, "cannot setup device: %d\n", result); |