aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi
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/scsi
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/scsi')
-rw-r--r--drivers/scsi/pcmcia/aha152x_stub.c14
-rw-r--r--drivers/scsi/pcmcia/fdomain_stub.c10
-rw-r--r--drivers/scsi/pcmcia/nsp_cs.c30
-rw-r--r--drivers/scsi/pcmcia/qlogic_stub.c14
-rw-r--r--drivers/scsi/pcmcia/sym53c500_cs.c14
5 files changed, 40 insertions, 42 deletions
diff --git a/drivers/scsi/pcmcia/aha152x_stub.c b/drivers/scsi/pcmcia/aha152x_stub.c
index 3e040f503afa..61f49bdcc0c2 100644
--- a/drivers/scsi/pcmcia/aha152x_stub.c
+++ b/drivers/scsi/pcmcia/aha152x_stub.c
@@ -100,9 +100,8 @@ static int aha152x_probe(struct pcmcia_device *link)
100 info->p_dev = link; 100 info->p_dev = link;
101 link->priv = info; 101 link->priv = info;
102 102
103 link->io.NumPorts1 = 0x20; 103 link->resource[0]->end = 0x20;
104 link->io.Attributes1 = IO_DATA_PATH_WIDTH_AUTO; 104 link->resource[0]->flags |= IO_DATA_PATH_WIDTH_AUTO;
105 link->io.IOAddrLines = 10;
106 link->conf.Attributes = CONF_ENABLE_IRQ; 105 link->conf.Attributes = CONF_ENABLE_IRQ;
107 link->conf.IntType = INT_MEMORY_AND_IO; 106 link->conf.IntType = INT_MEMORY_AND_IO;
108 link->conf.Present = PRESENT_OPTION; 107 link->conf.Present = PRESENT_OPTION;
@@ -130,15 +129,16 @@ static int aha152x_config_check(struct pcmcia_device *p_dev,
130 unsigned int vcc, 129 unsigned int vcc,
131 void *priv_data) 130 void *priv_data)
132{ 131{
132 p_dev->io_lines = 10;
133 /* For New Media T&J, look for a SCSI window */ 133 /* For New Media T&J, look for a SCSI window */
134 if (cfg->io.win[0].len >= 0x20) 134 if (cfg->io.win[0].len >= 0x20)
135 p_dev->io.BasePort1 = cfg->io.win[0].base; 135 p_dev->resource[0]->start = cfg->io.win[0].base;
136 else if ((cfg->io.nwin > 1) && 136 else if ((cfg->io.nwin > 1) &&
137 (cfg->io.win[1].len >= 0x20)) 137 (cfg->io.win[1].len >= 0x20))
138 p_dev->io.BasePort1 = cfg->io.win[1].base; 138 p_dev->resource[0]->start = cfg->io.win[1].base;
139 if ((cfg->io.nwin > 0) && 139 if ((cfg->io.nwin > 0) &&
140 (p_dev->io.BasePort1 < 0xffff)) { 140 (p_dev->resource[0]->start < 0xffff)) {
141 if (!pcmcia_request_io(p_dev, &p_dev->io)) 141 if (!pcmcia_request_io(p_dev))
142 return 0; 142 return 0;
143 } 143 }
144 return -EINVAL; 144 return -EINVAL;
diff --git a/drivers/scsi/pcmcia/fdomain_stub.c b/drivers/scsi/pcmcia/fdomain_stub.c
index 49a9a0a60c82..13dbe5c48492 100644
--- a/drivers/scsi/pcmcia/fdomain_stub.c
+++ b/drivers/scsi/pcmcia/fdomain_stub.c
@@ -83,9 +83,8 @@ static int fdomain_probe(struct pcmcia_device *link)
83 83
84 info->p_dev = link; 84 info->p_dev = link;
85 link->priv = info; 85 link->priv = info;
86 link->io.NumPorts1 = 0x10; 86 link->resource[0]->end = 0x10;
87 link->io.Attributes1 = IO_DATA_PATH_WIDTH_AUTO; 87 link->resource[0]->flags |= IO_DATA_PATH_WIDTH_AUTO;
88 link->io.IOAddrLines = 10;
89 link->conf.Attributes = CONF_ENABLE_IRQ; 88 link->conf.Attributes = CONF_ENABLE_IRQ;
90 link->conf.IntType = INT_MEMORY_AND_IO; 89 link->conf.IntType = INT_MEMORY_AND_IO;
91 link->conf.Present = PRESENT_OPTION; 90 link->conf.Present = PRESENT_OPTION;
@@ -112,8 +111,9 @@ static int fdomain_config_check(struct pcmcia_device *p_dev,
112 unsigned int vcc, 111 unsigned int vcc,
113 void *priv_data) 112 void *priv_data)
114{ 113{
115 p_dev->io.BasePort1 = cfg->io.win[0].base; 114 p_dev->io_lines = 10;
116 return pcmcia_request_io(p_dev, &p_dev->io); 115 p_dev->resource[0]->start = cfg->io.win[0].base;
116 return pcmcia_request_io(p_dev);
117} 117}
118 118
119 119
diff --git a/drivers/scsi/pcmcia/nsp_cs.c b/drivers/scsi/pcmcia/nsp_cs.c
index d929891809ab..8bb598bb440d 100644
--- a/drivers/scsi/pcmcia/nsp_cs.c
+++ b/drivers/scsi/pcmcia/nsp_cs.c
@@ -1558,9 +1558,8 @@ static int nsp_cs_probe(struct pcmcia_device *link)
1558 nsp_dbg(NSP_DEBUG_INIT, "info=0x%p", info); 1558 nsp_dbg(NSP_DEBUG_INIT, "info=0x%p", info);
1559 1559
1560 /* The io structure describes IO port mapping */ 1560 /* The io structure describes IO port mapping */
1561 link->io.NumPorts1 = 0x10; 1561 link->resource[0]->end = 0x10;
1562 link->io.Attributes1 = IO_DATA_PATH_WIDTH_AUTO; 1562 link->resource[0]->flags = IO_DATA_PATH_WIDTH_AUTO;
1563 link->io.IOAddrLines = 10; /* not used */
1564 1563
1565 /* General socket configuration */ 1564 /* General socket configuration */
1566 link->conf.Attributes = CONF_ENABLE_IRQ; 1565 link->conf.Attributes = CONF_ENABLE_IRQ;
@@ -1641,24 +1640,23 @@ static int nsp_cs_config_check(struct pcmcia_device *p_dev,
1641 p_dev->conf.Attributes |= CONF_ENABLE_IRQ; 1640 p_dev->conf.Attributes |= CONF_ENABLE_IRQ;
1642 1641
1643 /* IO window settings */ 1642 /* IO window settings */
1644 p_dev->io.NumPorts1 = p_dev->io.NumPorts2 = 0; 1643 p_dev->resource[0]->end = p_dev->resource[1]->end = 0;
1645 if ((cfg->io.nwin > 0) || (dflt->io.nwin > 0)) { 1644 if ((cfg->io.nwin > 0) || (dflt->io.nwin > 0)) {
1646 cistpl_io_t *io = (cfg->io.nwin) ? &cfg->io : &dflt->io; 1645 cistpl_io_t *io = (cfg->io.nwin) ? &cfg->io : &dflt->io;
1647 p_dev->io.Attributes1 = IO_DATA_PATH_WIDTH_AUTO; 1646 p_dev->io_lines = io->flags & CISTPL_IO_LINES_MASK;
1648 if (!(io->flags & CISTPL_IO_8BIT)) 1647 p_dev->resource[0]->flags &= ~IO_DATA_PATH_WIDTH;
1649 p_dev->io.Attributes1 = IO_DATA_PATH_WIDTH_16; 1648 p_dev->resource[0]->flags |=
1650 if (!(io->flags & CISTPL_IO_16BIT)) 1649 pcmcia_io_cfg_data_width(io->flags);
1651 p_dev->io.Attributes1 = IO_DATA_PATH_WIDTH_8; 1650 p_dev->resource[0]->start = io->win[0].base;
1652 p_dev->io.IOAddrLines = io->flags & CISTPL_IO_LINES_MASK; 1651 p_dev->resource[0]->end = io->win[0].len;
1653 p_dev->io.BasePort1 = io->win[0].base;
1654 p_dev->io.NumPorts1 = io->win[0].len;
1655 if (io->nwin > 1) { 1652 if (io->nwin > 1) {
1656 p_dev->io.Attributes2 = p_dev->io.Attributes1; 1653 p_dev->resource[1]->flags =
1657 p_dev->io.BasePort2 = io->win[1].base; 1654 p_dev->resource[0]->flags;
1658 p_dev->io.NumPorts2 = io->win[1].len; 1655 p_dev->resource[1]->start = io->win[1].base;
1656 p_dev->resource[1]->end = io->win[1].len;
1659 } 1657 }
1660 /* This reserves IO space but doesn't actually enable it */ 1658 /* This reserves IO space but doesn't actually enable it */
1661 if (pcmcia_request_io(p_dev, &p_dev->io) != 0) 1659 if (pcmcia_request_io(p_dev) != 0)
1662 goto next_entry; 1660 goto next_entry;
1663 } 1661 }
1664 1662
diff --git a/drivers/scsi/pcmcia/qlogic_stub.c b/drivers/scsi/pcmcia/qlogic_stub.c
index 4e2b83f26232..eb775f1a523c 100644
--- a/drivers/scsi/pcmcia/qlogic_stub.c
+++ b/drivers/scsi/pcmcia/qlogic_stub.c
@@ -156,9 +156,8 @@ static int qlogic_probe(struct pcmcia_device *link)
156 return -ENOMEM; 156 return -ENOMEM;
157 info->p_dev = link; 157 info->p_dev = link;
158 link->priv = info; 158 link->priv = info;
159 link->io.NumPorts1 = 16; 159 link->resource[0]->end = 16;
160 link->io.Attributes1 = IO_DATA_PATH_WIDTH_AUTO; 160 link->resource[0]->flags |= IO_DATA_PATH_WIDTH_AUTO;
161 link->io.IOAddrLines = 10;
162 link->conf.Attributes = CONF_ENABLE_IRQ; 161 link->conf.Attributes = CONF_ENABLE_IRQ;
163 link->conf.IntType = INT_MEMORY_AND_IO; 162 link->conf.IntType = INT_MEMORY_AND_IO;
164 link->conf.Present = PRESENT_OPTION; 163 link->conf.Present = PRESENT_OPTION;
@@ -185,13 +184,14 @@ static int qlogic_config_check(struct pcmcia_device *p_dev,
185 unsigned int vcc, 184 unsigned int vcc,
186 void *priv_data) 185 void *priv_data)
187{ 186{
188 p_dev->io.BasePort1 = cfg->io.win[0].base; 187 p_dev->io_lines = 10;
189 p_dev->io.NumPorts1 = cfg->io.win[0].len; 188 p_dev->resource[0]->start = cfg->io.win[0].base;
189 p_dev->resource[0]->end = cfg->io.win[0].len;
190 190
191 if (p_dev->io.BasePort1 == 0) 191 if (p_dev->resource[0]->start == 0)
192 return -ENODEV; 192 return -ENODEV;
193 193
194 return pcmcia_request_io(p_dev, &p_dev->io); 194 return pcmcia_request_io(p_dev);
195} 195}
196 196
197static int qlogic_config(struct pcmcia_device * link) 197static int qlogic_config(struct pcmcia_device * link)
diff --git a/drivers/scsi/pcmcia/sym53c500_cs.c b/drivers/scsi/pcmcia/sym53c500_cs.c
index d99c0cbad2de..321e390c9120 100644
--- a/drivers/scsi/pcmcia/sym53c500_cs.c
+++ b/drivers/scsi/pcmcia/sym53c500_cs.c
@@ -690,13 +690,14 @@ static int SYM53C500_config_check(struct pcmcia_device *p_dev,
690 unsigned int vcc, 690 unsigned int vcc,
691 void *priv_data) 691 void *priv_data)
692{ 692{
693 p_dev->io.BasePort1 = cfg->io.win[0].base; 693 p_dev->io_lines = 10;
694 p_dev->io.NumPorts1 = cfg->io.win[0].len; 694 p_dev->resource[0]->start = cfg->io.win[0].base;
695 p_dev->resource[0]->end = cfg->io.win[0].len;
695 696
696 if (p_dev->io.BasePort1 == 0) 697 if (p_dev->resource[0]->start == 0)
697 return -ENODEV; 698 return -ENODEV;
698 699
699 return pcmcia_request_io(p_dev, &p_dev->io); 700 return pcmcia_request_io(p_dev);
700} 701}
701 702
702static int 703static int
@@ -858,9 +859,8 @@ SYM53C500_probe(struct pcmcia_device *link)
858 return -ENOMEM; 859 return -ENOMEM;
859 info->p_dev = link; 860 info->p_dev = link;
860 link->priv = info; 861 link->priv = info;
861 link->io.NumPorts1 = 16; 862 link->resource[0]->end = 16;
862 link->io.Attributes1 = IO_DATA_PATH_WIDTH_AUTO; 863 link->resource[0]->flags |= IO_DATA_PATH_WIDTH_AUTO;
863 link->io.IOAddrLines = 10;
864 link->conf.Attributes = CONF_ENABLE_IRQ; 864 link->conf.Attributes = CONF_ENABLE_IRQ;
865 link->conf.IntType = INT_MEMORY_AND_IO; 865 link->conf.IntType = INT_MEMORY_AND_IO;
866 866