aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/orinoco_cs.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/wireless/orinoco_cs.c')
-rw-r--r--drivers/net/wireless/orinoco_cs.c18
1 files changed, 8 insertions, 10 deletions
diff --git a/drivers/net/wireless/orinoco_cs.c b/drivers/net/wireless/orinoco_cs.c
index 67a172dfb2db..8a367f96db37 100644
--- a/drivers/net/wireless/orinoco_cs.c
+++ b/drivers/net/wireless/orinoco_cs.c
@@ -165,18 +165,16 @@ static void orinoco_cs_detach(struct pcmcia_device *link)
165 } while (0) 165 } while (0)
166 166
167struct orinoco_cs_config_data { 167struct orinoco_cs_config_data {
168 cistpl_cftable_entry_t dflt;
169 config_info_t conf; 168 config_info_t conf;
170}; 169};
171 170
172static int orinoco_cs_config_check(struct pcmcia_device *p_dev, 171static int orinoco_cs_config_check(struct pcmcia_device *p_dev,
173 cistpl_cftable_entry_t *cfg, 172 cistpl_cftable_entry_t *cfg,
173 cistpl_cftable_entry_t *dflt,
174 void *priv_data) 174 void *priv_data)
175{ 175{
176 struct orinoco_cs_config_data *cfg_mem = priv_data; 176 struct orinoco_cs_config_data *cfg_mem = priv_data;
177 177
178 if (cfg->flags & CISTPL_CFTABLE_DEFAULT)
179 cfg_mem->dflt = *cfg;
180 if (cfg->index == 0) 178 if (cfg->index == 0)
181 goto next_entry; 179 goto next_entry;
182 180
@@ -188,9 +186,9 @@ static int orinoco_cs_config_check(struct pcmcia_device *p_dev,
188 if (!ignore_cis_vcc) 186 if (!ignore_cis_vcc)
189 goto next_entry; 187 goto next_entry;
190 } 188 }
191 } else if (cfg_mem->dflt.vcc.present & (1 << CISTPL_POWER_VNOM)) { 189 } else if (dflt->vcc.present & (1 << CISTPL_POWER_VNOM)) {
192 if (cfg_mem->conf.Vcc != cfg_mem->dflt.vcc.param[CISTPL_POWER_VNOM] / 10000) { 190 if (cfg_mem->conf.Vcc != dflt->vcc.param[CISTPL_POWER_VNOM] / 10000) {
193 DEBUG(2, "spectrum_cs_config: Vcc mismatch (cfg_mem->conf.Vcc = %d, CIS = %d)\n", cfg_mem->conf.Vcc, cfg_mem->dflt.vcc.param[CISTPL_POWER_VNOM] / 10000); 191 DEBUG(2, "spectrum_cs_config: Vcc mismatch (cfg_mem->conf.Vcc = %d, CIS = %d)\n", cfg_mem->conf.Vcc, dflt->vcc.param[CISTPL_POWER_VNOM] / 10000);
194 if (!ignore_cis_vcc) 192 if (!ignore_cis_vcc)
195 goto next_entry; 193 goto next_entry;
196 } 194 }
@@ -199,17 +197,17 @@ static int orinoco_cs_config_check(struct pcmcia_device *p_dev,
199 if (cfg->vpp1.present & (1 << CISTPL_POWER_VNOM)) 197 if (cfg->vpp1.present & (1 << CISTPL_POWER_VNOM))
200 p_dev->conf.Vpp = 198 p_dev->conf.Vpp =
201 cfg->vpp1.param[CISTPL_POWER_VNOM] / 10000; 199 cfg->vpp1.param[CISTPL_POWER_VNOM] / 10000;
202 else if (cfg_mem->dflt.vpp1.present & (1 << CISTPL_POWER_VNOM)) 200 else if (dflt->vpp1.present & (1 << CISTPL_POWER_VNOM))
203 p_dev->conf.Vpp = 201 p_dev->conf.Vpp =
204 cfg_mem->dflt.vpp1.param[CISTPL_POWER_VNOM] / 10000; 202 dflt->vpp1.param[CISTPL_POWER_VNOM] / 10000;
205 203
206 /* Do we need to allocate an interrupt? */ 204 /* Do we need to allocate an interrupt? */
207 p_dev->conf.Attributes |= CONF_ENABLE_IRQ; 205 p_dev->conf.Attributes |= CONF_ENABLE_IRQ;
208 206
209 /* IO window settings */ 207 /* IO window settings */
210 p_dev->io.NumPorts1 = p_dev->io.NumPorts2 = 0; 208 p_dev->io.NumPorts1 = p_dev->io.NumPorts2 = 0;
211 if ((cfg->io.nwin > 0) || (cfg_mem->dflt.io.nwin > 0)) { 209 if ((cfg->io.nwin > 0) || (dflt->io.nwin > 0)) {
212 cistpl_io_t *io = (cfg->io.nwin) ? &cfg->io : &cfg_mem->dflt.io; 210 cistpl_io_t *io = (cfg->io.nwin) ? &cfg->io : &dflt->io;
213 p_dev->io.Attributes1 = IO_DATA_PATH_WIDTH_AUTO; 211 p_dev->io.Attributes1 = IO_DATA_PATH_WIDTH_AUTO;
214 if (!(io->flags & CISTPL_IO_8BIT)) 212 if (!(io->flags & CISTPL_IO_8BIT))
215 p_dev->io.Attributes1 = IO_DATA_PATH_WIDTH_16; 213 p_dev->io.Attributes1 = IO_DATA_PATH_WIDTH_16;