aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless
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
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')
-rw-r--r--drivers/net/wireless/airo_cs.c22
-rw-r--r--drivers/net/wireless/atmel_cs.c22
-rw-r--r--drivers/net/wireless/b43/pcmcia.c4
-rw-r--r--drivers/net/wireless/hostap/hostap_cs.c28
-rw-r--r--drivers/net/wireless/libertas/if_cs.c8
-rw-r--r--drivers/net/wireless/orinoco/orinoco_cs.c24
-rw-r--r--drivers/net/wireless/orinoco/spectrum_cs.c24
-rw-r--r--drivers/net/wireless/ray_cs.c5
-rw-r--r--drivers/net/wireless/wl3501_cs.c12
9 files changed, 65 insertions, 84 deletions
diff --git a/drivers/net/wireless/airo_cs.c b/drivers/net/wireless/airo_cs.c
index b7e7f5054e44..d241b4aed71e 100644
--- a/drivers/net/wireless/airo_cs.c
+++ b/drivers/net/wireless/airo_cs.c
@@ -175,25 +175,23 @@ static int airo_cs_config_check(struct pcmcia_device *p_dev,
175 p_dev->conf.Attributes |= CONF_ENABLE_IRQ; 175 p_dev->conf.Attributes |= CONF_ENABLE_IRQ;
176 176
177 /* IO window settings */ 177 /* IO window settings */
178 p_dev->io.NumPorts1 = p_dev->io.NumPorts2 = 0; 178 p_dev->resource[0]->end = p_dev->resource[1]->end = 0;
179 if ((cfg->io.nwin > 0) || (dflt->io.nwin > 0)) { 179 if ((cfg->io.nwin > 0) || (dflt->io.nwin > 0)) {
180 cistpl_io_t *io = (cfg->io.nwin) ? &cfg->io : &dflt->io; 180 cistpl_io_t *io = (cfg->io.nwin) ? &cfg->io : &dflt->io;
181 p_dev->io.Attributes1 = IO_DATA_PATH_WIDTH_AUTO; 181 p_dev->resource[0]->flags &= ~IO_DATA_PATH_WIDTH;
182 if (!(io->flags & CISTPL_IO_8BIT)) 182 p_dev->resource[0]->flags |=
183 p_dev->io.Attributes1 = IO_DATA_PATH_WIDTH_16; 183 pcmcia_io_cfg_data_width(io->flags);
184 if (!(io->flags & CISTPL_IO_16BIT)) 184 p_dev->resource[0]->start = io->win[0].base;
185 p_dev->io.Attributes1 = IO_DATA_PATH_WIDTH_8; 185 p_dev->resource[0]->end = io->win[0].len;
186 p_dev->io.BasePort1 = io->win[0].base;
187 p_dev->io.NumPorts1 = io->win[0].len;
188 if (io->nwin > 1) { 186 if (io->nwin > 1) {
189 p_dev->io.Attributes2 = p_dev->io.Attributes1; 187 p_dev->resource[1]->flags = p_dev->resource[0]->flags;
190 p_dev->io.BasePort2 = io->win[1].base; 188 p_dev->resource[1]->start = io->win[1].base;
191 p_dev->io.NumPorts2 = io->win[1].len; 189 p_dev->resource[1]->end = io->win[1].len;
192 } 190 }
193 } 191 }
194 192
195 /* This reserves IO space but doesn't actually enable it */ 193 /* This reserves IO space but doesn't actually enable it */
196 if (pcmcia_request_io(p_dev, &p_dev->io) != 0) 194 if (pcmcia_request_io(p_dev) != 0)
197 return -ENODEV; 195 return -ENODEV;
198 196
199 /* 197 /*
diff --git a/drivers/net/wireless/atmel_cs.c b/drivers/net/wireless/atmel_cs.c
index 65b3aed49e58..3b632161c106 100644
--- a/drivers/net/wireless/atmel_cs.c
+++ b/drivers/net/wireless/atmel_cs.c
@@ -190,25 +190,23 @@ static int atmel_config_check(struct pcmcia_device *p_dev,
190 p_dev->conf.Attributes |= CONF_ENABLE_IRQ; 190 p_dev->conf.Attributes |= CONF_ENABLE_IRQ;
191 191
192 /* IO window settings */ 192 /* IO window settings */
193 p_dev->io.NumPorts1 = p_dev->io.NumPorts2 = 0; 193 p_dev->resource[0]->end = p_dev->resource[1]->end = 0;
194 if ((cfg->io.nwin > 0) || (dflt->io.nwin > 0)) { 194 if ((cfg->io.nwin > 0) || (dflt->io.nwin > 0)) {
195 cistpl_io_t *io = (cfg->io.nwin) ? &cfg->io : &dflt->io; 195 cistpl_io_t *io = (cfg->io.nwin) ? &cfg->io : &dflt->io;
196 p_dev->io.Attributes1 = IO_DATA_PATH_WIDTH_AUTO; 196 p_dev->resource[0]->flags &= ~IO_DATA_PATH_WIDTH;
197 if (!(io->flags & CISTPL_IO_8BIT)) 197 p_dev->resource[0]->flags |=
198 p_dev->io.Attributes1 = IO_DATA_PATH_WIDTH_16; 198 pcmcia_io_cfg_data_width(io->flags);
199 if (!(io->flags & CISTPL_IO_16BIT)) 199 p_dev->resource[0]->start = io->win[0].base;
200 p_dev->io.Attributes1 = IO_DATA_PATH_WIDTH_8; 200 p_dev->resource[0]->end = io->win[0].len;
201 p_dev->io.BasePort1 = io->win[0].base;
202 p_dev->io.NumPorts1 = io->win[0].len;
203 if (io->nwin > 1) { 201 if (io->nwin > 1) {
204 p_dev->io.Attributes2 = p_dev->io.Attributes1; 202 p_dev->resource[1]->flags = p_dev->resource[0]->flags;
205 p_dev->io.BasePort2 = io->win[1].base; 203 p_dev->resource[1]->start = io->win[1].base;
206 p_dev->io.NumPorts2 = io->win[1].len; 204 p_dev->resource[1]->end = io->win[1].len;
207 } 205 }
208 } 206 }
209 207
210 /* This reserves IO space but doesn't actually enable it */ 208 /* This reserves IO space but doesn't actually enable it */
211 return pcmcia_request_io(p_dev, &p_dev->io); 209 return pcmcia_request_io(p_dev);
212} 210}
213 211
214static int atmel_config(struct pcmcia_device *link) 212static int atmel_config(struct pcmcia_device *link)
diff --git a/drivers/net/wireless/b43/pcmcia.c b/drivers/net/wireless/b43/pcmcia.c
index f71bc7821378..7c9af82fcf7e 100644
--- a/drivers/net/wireless/b43/pcmcia.c
+++ b/drivers/net/wireless/b43/pcmcia.c
@@ -77,10 +77,6 @@ static int __devinit b43_pcmcia_probe(struct pcmcia_device *dev)
77 dev->conf.Attributes = CONF_ENABLE_IRQ; 77 dev->conf.Attributes = CONF_ENABLE_IRQ;
78 dev->conf.IntType = INT_MEMORY_AND_IO; 78 dev->conf.IntType = INT_MEMORY_AND_IO;
79 79
80 dev->io.BasePort2 = 0;
81 dev->io.NumPorts2 = 0;
82 dev->io.Attributes2 = 0;
83
84 win.Attributes = WIN_ADDR_SPACE_MEM | WIN_MEMORY_TYPE_CM | 80 win.Attributes = WIN_ADDR_SPACE_MEM | WIN_MEMORY_TYPE_CM |
85 WIN_ENABLE | WIN_DATA_WIDTH_16 | 81 WIN_ENABLE | WIN_DATA_WIDTH_16 |
86 WIN_USE_WAIT; 82 WIN_USE_WAIT;
diff --git a/drivers/net/wireless/hostap/hostap_cs.c b/drivers/net/wireless/hostap/hostap_cs.c
index 4e13cedb8235..ba54d1b04d22 100644
--- a/drivers/net/wireless/hostap/hostap_cs.c
+++ b/drivers/net/wireless/hostap/hostap_cs.c
@@ -519,30 +519,24 @@ static int prism2_config_check(struct pcmcia_device *p_dev,
519 PDEBUG(DEBUG_EXTRA, "IO window settings: cfg->io.nwin=%d " 519 PDEBUG(DEBUG_EXTRA, "IO window settings: cfg->io.nwin=%d "
520 "dflt->io.nwin=%d\n", 520 "dflt->io.nwin=%d\n",
521 cfg->io.nwin, dflt->io.nwin); 521 cfg->io.nwin, dflt->io.nwin);
522 p_dev->io.NumPorts1 = p_dev->io.NumPorts2 = 0; 522 p_dev->resource[0]->end = p_dev->resource[1]->end = 0;
523 if ((cfg->io.nwin > 0) || (dflt->io.nwin > 0)) { 523 if ((cfg->io.nwin > 0) || (dflt->io.nwin > 0)) {
524 cistpl_io_t *io = (cfg->io.nwin) ? &cfg->io : &dflt->io; 524 cistpl_io_t *io = (cfg->io.nwin) ? &cfg->io : &dflt->io;
525 p_dev->io.Attributes1 = IO_DATA_PATH_WIDTH_AUTO; 525 p_dev->resource[0]->flags &= ~IO_DATA_PATH_WIDTH;
526 PDEBUG(DEBUG_EXTRA, "io->flags = 0x%04X, " 526 p_dev->resource[0]->flags |=
527 "io.base=0x%04x, len=%d\n", io->flags, 527 pcmcia_io_cfg_data_width(io->flags);
528 io->win[0].base, io->win[0].len); 528 p_dev->io_lines = io->flags & CISTPL_IO_LINES_MASK;
529 if (!(io->flags & CISTPL_IO_8BIT)) 529 p_dev->resource[0]->start = io->win[0].base;
530 p_dev->io.Attributes1 = IO_DATA_PATH_WIDTH_16; 530 p_dev->resource[0]->end = io->win[0].len;
531 if (!(io->flags & CISTPL_IO_16BIT))
532 p_dev->io.Attributes1 = IO_DATA_PATH_WIDTH_8;
533 p_dev->io.IOAddrLines = io->flags &
534 CISTPL_IO_LINES_MASK;
535 p_dev->io.BasePort1 = io->win[0].base;
536 p_dev->io.NumPorts1 = io->win[0].len;
537 if (io->nwin > 1) { 531 if (io->nwin > 1) {
538 p_dev->io.Attributes2 = p_dev->io.Attributes1; 532 p_dev->resource[1]->flags = p_dev->resource[0]->flags;
539 p_dev->io.BasePort2 = io->win[1].base; 533 p_dev->resource[1]->start = io->win[1].base;
540 p_dev->io.NumPorts2 = io->win[1].len; 534 p_dev->resource[1]->end = io->win[1].len;
541 } 535 }
542 } 536 }
543 537
544 /* This reserves IO space but doesn't actually enable it */ 538 /* This reserves IO space but doesn't actually enable it */
545 return pcmcia_request_io(p_dev, &p_dev->io); 539 return pcmcia_request_io(p_dev);
546} 540}
547 541
548static int prism2_config(struct pcmcia_device *link) 542static int prism2_config(struct pcmcia_device *link)
diff --git a/drivers/net/wireless/libertas/if_cs.c b/drivers/net/wireless/libertas/if_cs.c
index be4c47594b59..9c298396be50 100644
--- a/drivers/net/wireless/libertas/if_cs.c
+++ b/drivers/net/wireless/libertas/if_cs.c
@@ -801,9 +801,9 @@ static int if_cs_ioprobe(struct pcmcia_device *p_dev,
801 unsigned int vcc, 801 unsigned int vcc,
802 void *priv_data) 802 void *priv_data)
803{ 803{
804 p_dev->io.Attributes1 = IO_DATA_PATH_WIDTH_AUTO; 804 p_dev->resource[0]->flags |= IO_DATA_PATH_WIDTH_AUTO;
805 p_dev->io.BasePort1 = cfg->io.win[0].base; 805 p_dev->resource[0]->start = cfg->io.win[0].base;
806 p_dev->io.NumPorts1 = cfg->io.win[0].len; 806 p_dev->resource[0]->end = cfg->io.win[0].len;
807 807
808 /* Do we need to allocate an interrupt? */ 808 /* Do we need to allocate an interrupt? */
809 p_dev->conf.Attributes |= CONF_ENABLE_IRQ; 809 p_dev->conf.Attributes |= CONF_ENABLE_IRQ;
@@ -815,7 +815,7 @@ static int if_cs_ioprobe(struct pcmcia_device *p_dev,
815 } 815 }
816 816
817 /* This reserves IO space but doesn't actually enable it */ 817 /* This reserves IO space but doesn't actually enable it */
818 return pcmcia_request_io(p_dev, &p_dev->io); 818 return pcmcia_request_io(p_dev);
819} 819}
820 820
821static int if_cs_probe(struct pcmcia_device *p_dev) 821static int if_cs_probe(struct pcmcia_device *p_dev)
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;
diff --git a/drivers/net/wireless/ray_cs.c b/drivers/net/wireless/ray_cs.c
index 165beb6af849..b83d5ef1dffe 100644
--- a/drivers/net/wireless/ray_cs.c
+++ b/drivers/net/wireless/ray_cs.c
@@ -315,9 +315,8 @@ static int ray_probe(struct pcmcia_device *p_dev)
315 local->finder = p_dev; 315 local->finder = p_dev;
316 316
317 /* The io structure describes IO port mapping. None used here */ 317 /* The io structure describes IO port mapping. None used here */
318 p_dev->io.NumPorts1 = 0; 318 p_dev->resource[0]->end = 0;
319 p_dev->io.Attributes1 = IO_DATA_PATH_WIDTH_8; 319 p_dev->resource[0]->flags |= IO_DATA_PATH_WIDTH_8;
320 p_dev->io.IOAddrLines = 5;
321 320
322 /* General socket configuration */ 321 /* General socket configuration */
323 p_dev->conf.Attributes = CONF_ENABLE_IRQ; 322 p_dev->conf.Attributes = CONF_ENABLE_IRQ;
diff --git a/drivers/net/wireless/wl3501_cs.c b/drivers/net/wireless/wl3501_cs.c
index a32f220648c0..a1cc2d498a1c 100644
--- a/drivers/net/wireless/wl3501_cs.c
+++ b/drivers/net/wireless/wl3501_cs.c
@@ -1884,9 +1884,8 @@ static int wl3501_probe(struct pcmcia_device *p_dev)
1884 struct wl3501_card *this; 1884 struct wl3501_card *this;
1885 1885
1886 /* The io structure describes IO port mapping */ 1886 /* The io structure describes IO port mapping */
1887 p_dev->io.NumPorts1 = 16; 1887 p_dev->resource[0]->end = 16;
1888 p_dev->io.Attributes1 = IO_DATA_PATH_WIDTH_8; 1888 p_dev->resource[0]->flags = IO_DATA_PATH_WIDTH_8;
1889 p_dev->io.IOAddrLines = 5;
1890 1889
1891 /* General socket configuration */ 1890 /* General socket configuration */
1892 p_dev->conf.Attributes = CONF_ENABLE_IRQ; 1891 p_dev->conf.Attributes = CONF_ENABLE_IRQ;
@@ -1932,13 +1931,14 @@ static int wl3501_config(struct pcmcia_device *link)
1932 /* Try allocating IO ports. This tries a few fixed addresses. If you 1931 /* Try allocating IO ports. This tries a few fixed addresses. If you
1933 * want, you can also read the card's config table to pick addresses -- 1932 * want, you can also read the card's config table to pick addresses --
1934 * see the serial driver for an example. */ 1933 * see the serial driver for an example. */
1934 link->io_lines = 5;
1935 1935
1936 for (j = 0x280; j < 0x400; j += 0x20) { 1936 for (j = 0x280; j < 0x400; j += 0x20) {
1937 /* The '^0x300' is so that we probe 0x300-0x3ff first, then 1937 /* The '^0x300' is so that we probe 0x300-0x3ff first, then
1938 * 0x200-0x2ff, and so on, because this seems safer */ 1938 * 0x200-0x2ff, and so on, because this seems safer */
1939 link->io.BasePort1 = j; 1939 link->resource[0]->start = j;
1940 link->io.BasePort2 = link->io.BasePort1 + 0x10; 1940 link->resource[1]->start = link->resource[0]->start + 0x10;
1941 i = pcmcia_request_io(link, &link->io); 1941 i = pcmcia_request_io(link);
1942 if (i == 0) 1942 if (i == 0)
1943 break; 1943 break;
1944 } 1944 }