aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/orinoco
diff options
context:
space:
mode:
authorDominik Brodowski <linux@dominikbrodowski.net>2010-07-24 11:23:51 -0400
committerDominik Brodowski <linux@dominikbrodowski.net>2010-08-03 03:04:11 -0400
commit90abdc3b973229bae98dd96649d9f7106cc177a4 (patch)
tree5c1a7a131b65560dd73b5103118d8c7631bd76a4 /drivers/net/wireless/orinoco
parent9a017a910346afd88ec2e065989903bf211a7d37 (diff)
pcmcia: do not use io_req_t when calling pcmcia_request_io()
Instead of io_req_t, drivers are now requested to fill out struct pcmcia_device *p_dev->resource[0,1] for up to two ioport ranges. After a call to pcmcia_request_io(), the ports found there are reserved, after calling pcmcia_request_configuration(), they may be used. CC: netdev@vger.kernel.org CC: linux-wireless@vger.kernel.org CC: linux-ide@vger.kernel.org CC: linux-usb@vger.kernel.org CC: laforge@gnumonks.org CC: linux-mtd@lists.infradead.org CC: alsa-devel@alsa-project.org CC: linux-serial@vger.kernel.org CC: Michael Buesch <mb@bu3sch.de> Acked-by: Marcel Holtmann <marcel@holtmann.org> (for drivers/bluetooth/) Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
Diffstat (limited to 'drivers/net/wireless/orinoco')
-rw-r--r--drivers/net/wireless/orinoco/orinoco_cs.c24
-rw-r--r--drivers/net/wireless/orinoco/spectrum_cs.c24
2 files changed, 22 insertions, 26 deletions
diff --git a/drivers/net/wireless/orinoco/orinoco_cs.c b/drivers/net/wireless/orinoco/orinoco_cs.c
index 6d514b5462fd..ef46a2d88539 100644
--- a/drivers/net/wireless/orinoco/orinoco_cs.c
+++ b/drivers/net/wireless/orinoco/orinoco_cs.c
@@ -191,25 +191,23 @@ static int orinoco_cs_config_check(struct pcmcia_device *p_dev,
191 p_dev->conf.Attributes |= CONF_ENABLE_IRQ; 191 p_dev->conf.Attributes |= CONF_ENABLE_IRQ;
192 192
193 /* IO window settings */ 193 /* IO window settings */
194 p_dev->io.NumPorts1 = p_dev->io.NumPorts2 = 0; 194 p_dev->resource[0]->end = p_dev->resource[1]->end = 0;
195 if ((cfg->io.nwin > 0) || (dflt->io.nwin > 0)) { 195 if ((cfg->io.nwin > 0) || (dflt->io.nwin > 0)) {
196 cistpl_io_t *io = (cfg->io.nwin) ? &cfg->io : &dflt->io; 196 cistpl_io_t *io = (cfg->io.nwin) ? &cfg->io : &dflt->io;
197 p_dev->io.Attributes1 = IO_DATA_PATH_WIDTH_AUTO; 197 p_dev->io_lines = io->flags & CISTPL_IO_LINES_MASK;
198 if (!(io->flags & CISTPL_IO_8BIT)) 198 p_dev->resource[0]->flags &= ~IO_DATA_PATH_WIDTH;
199 p_dev->io.Attributes1 = IO_DATA_PATH_WIDTH_16; 199 p_dev->resource[0]->flags |=
200 if (!(io->flags & CISTPL_IO_16BIT)) 200 pcmcia_io_cfg_data_width(io->flags);
201 p_dev->io.Attributes1 = IO_DATA_PATH_WIDTH_8; 201 p_dev->resource[0]->start = io->win[0].base;
202 p_dev->io.IOAddrLines = io->flags & CISTPL_IO_LINES_MASK; 202 p_dev->resource[0]->end = io->win[0].len;
203 p_dev->io.BasePort1 = io->win[0].base;
204 p_dev->io.NumPorts1 = io->win[0].len;
205 if (io->nwin > 1) { 203 if (io->nwin > 1) {
206 p_dev->io.Attributes2 = p_dev->io.Attributes1; 204 p_dev->resource[1]->flags = p_dev->resource[0]->flags;
207 p_dev->io.BasePort2 = io->win[1].base; 205 p_dev->resource[1]->start = io->win[1].base;
208 p_dev->io.NumPorts2 = io->win[1].len; 206 p_dev->resource[1]->end = io->win[1].len;
209 } 207 }
210 208
211 /* This reserves IO space but doesn't actually enable it */ 209 /* This reserves IO space but doesn't actually enable it */
212 if (pcmcia_request_io(p_dev, &p_dev->io) != 0) 210 if (pcmcia_request_io(p_dev) != 0)
213 goto next_entry; 211 goto next_entry;
214 } 212 }
215 return 0; 213 return 0;
diff --git a/drivers/net/wireless/orinoco/spectrum_cs.c b/drivers/net/wireless/orinoco/spectrum_cs.c
index 4f8f55eab955..873877e17e1b 100644
--- a/drivers/net/wireless/orinoco/spectrum_cs.c
+++ b/drivers/net/wireless/orinoco/spectrum_cs.c
@@ -253,25 +253,23 @@ static int spectrum_cs_config_check(struct pcmcia_device *p_dev,
253 p_dev->conf.Attributes |= CONF_ENABLE_IRQ; 253 p_dev->conf.Attributes |= CONF_ENABLE_IRQ;
254 254
255 /* IO window settings */ 255 /* IO window settings */
256 p_dev->io.NumPorts1 = p_dev->io.NumPorts2 = 0; 256 p_dev->resource[0]->end = p_dev->resource[1]->end = 0;
257 if ((cfg->io.nwin > 0) || (dflt->io.nwin > 0)) { 257 if ((cfg->io.nwin > 0) || (dflt->io.nwin > 0)) {
258 cistpl_io_t *io = (cfg->io.nwin) ? &cfg->io : &dflt->io; 258 cistpl_io_t *io = (cfg->io.nwin) ? &cfg->io : &dflt->io;
259 p_dev->io.Attributes1 = IO_DATA_PATH_WIDTH_AUTO; 259 p_dev->io_lines = io->flags & CISTPL_IO_LINES_MASK;
260 if (!(io->flags & CISTPL_IO_8BIT)) 260 p_dev->resource[0]->flags &= ~IO_DATA_PATH_WIDTH;
261 p_dev->io.Attributes1 = IO_DATA_PATH_WIDTH_16; 261 p_dev->resource[0]->flags |=
262 if (!(io->flags & CISTPL_IO_16BIT)) 262 pcmcia_io_cfg_data_width(io->flags);
263 p_dev->io.Attributes1 = IO_DATA_PATH_WIDTH_8; 263 p_dev->resource[0]->start = io->win[0].base;
264 p_dev->io.IOAddrLines = io->flags & CISTPL_IO_LINES_MASK; 264 p_dev->resource[0]->end = io->win[0].len;
265 p_dev->io.BasePort1 = io->win[0].base;
266 p_dev->io.NumPorts1 = io->win[0].len;
267 if (io->nwin > 1) { 265 if (io->nwin > 1) {
268 p_dev->io.Attributes2 = p_dev->io.Attributes1; 266 p_dev->resource[1]->flags = p_dev->resource[0]->flags;
269 p_dev->io.BasePort2 = io->win[1].base; 267 p_dev->resource[1]->start = io->win[1].base;
270 p_dev->io.NumPorts2 = io->win[1].len; 268 p_dev->resource[1]->end = io->win[1].len;
271 } 269 }
272 270
273 /* This reserves IO space but doesn't actually enable it */ 271 /* This reserves IO space but doesn't actually enable it */
274 if (pcmcia_request_io(p_dev, &p_dev->io) != 0) 272 if (pcmcia_request_io(p_dev) != 0)
275 goto next_entry; 273 goto next_entry;
276 } 274 }
277 return 0; 275 return 0;