aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/isdn
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2010-08-06 15:25:06 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2010-08-06 15:25:06 -0400
commit1685e633b396b0f3dabbc9fa5d65dfefe6435250 (patch)
treeee83e26e2468ca1518a1b065c690159e12c8def9 /drivers/isdn
parent1cfd2bda8c486ae0e7a8005354758ebb68172bca (diff)
parent127c03cdbad9bd5af5d7f33bd31a1015a90cb77f (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/brodo/pcmcia-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/brodo/pcmcia-2.6: pcmcia: avoid buffer overflow in pcmcia_setup_isa_irq pcmcia: do not request windows if you don't need to pcmcia: insert PCMCIA device resources into resource tree pcmcia: export resource information to sysfs pcmcia: use struct resource for PCMCIA devices, part 2 pcmcia: remove memreq_t pcmcia: move local definitions out of include/pcmcia/cs.h pcmcia: do not use io_req_t when calling pcmcia_request_io() pcmcia: do not use io_req_t after call to pcmcia_request_io() pcmcia: use struct resource for PCMCIA devices pcmcia: clean up cs.h pcmcia: use pcmica_{read,write}_config_byte pcmcia: remove cs_types.h pcmcia: remove unused flag, simplify headers pcmcia: remove obsolete CS_EVENT_ definitions pcmcia: split up central event handler pcmcia: simplify event callback pcmcia: remove obsolete ioctl Conflicts in: - drivers/staging/comedi/drivers/* - drivers/staging/wlags49_h2/wl_cs.c due to dev_info_t and whitespace changes
Diffstat (limited to 'drivers/isdn')
-rw-r--r--drivers/isdn/hardware/avm/avm_cs.c25
-rw-r--r--drivers/isdn/hisax/avma1_cs.c29
-rw-r--r--drivers/isdn/hisax/elsa_cs.c32
-rw-r--r--drivers/isdn/hisax/sedlbauer_cs.c83
-rw-r--r--drivers/isdn/hisax/teles_cs.c30
5 files changed, 73 insertions, 126 deletions
diff --git a/drivers/isdn/hardware/avm/avm_cs.c b/drivers/isdn/hardware/avm/avm_cs.c
index f410d0eb2fef..09b1795516f4 100644
--- a/drivers/isdn/hardware/avm/avm_cs.c
+++ b/drivers/isdn/hardware/avm/avm_cs.c
@@ -20,7 +20,6 @@
20#include <asm/io.h> 20#include <asm/io.h>
21#include <asm/system.h> 21#include <asm/system.h>
22 22
23#include <pcmcia/cs_types.h>
24#include <pcmcia/cs.h> 23#include <pcmcia/cs.h>
25#include <pcmcia/cistpl.h> 24#include <pcmcia/cistpl.h>
26#include <pcmcia/ciscode.h> 25#include <pcmcia/ciscode.h>
@@ -76,9 +75,8 @@ static int avmcs_probe(struct pcmcia_device *p_dev)
76{ 75{
77 76
78 /* The io structure describes IO port mapping */ 77 /* The io structure describes IO port mapping */
79 p_dev->io.NumPorts1 = 16; 78 p_dev->resource[0]->end = 16;
80 p_dev->io.Attributes1 = IO_DATA_PATH_WIDTH_8; 79 p_dev->resource[0]->flags |= IO_DATA_PATH_WIDTH_8;
81 p_dev->io.NumPorts2 = 0;
82 80
83 /* General socket configuration */ 81 /* General socket configuration */
84 p_dev->conf.Attributes = CONF_ENABLE_IRQ; 82 p_dev->conf.Attributes = CONF_ENABLE_IRQ;
@@ -120,13 +118,9 @@ static int avmcs_configcheck(struct pcmcia_device *p_dev,
120 if (cf->io.nwin <= 0) 118 if (cf->io.nwin <= 0)
121 return -ENODEV; 119 return -ENODEV;
122 120
123 p_dev->io.BasePort1 = cf->io.win[0].base; 121 p_dev->resource[0]->start = cf->io.win[0].base;
124 p_dev->io.NumPorts1 = cf->io.win[0].len; 122 p_dev->resource[0]->end = cf->io.win[0].len;
125 p_dev->io.NumPorts2 = 0; 123 return pcmcia_request_io(p_dev);
126 printk(KERN_INFO "avm_cs: testing i/o %#x-%#x\n",
127 p_dev->io.BasePort1,
128 p_dev->io.BasePort1+p_dev->io.NumPorts1-1);
129 return pcmcia_request_io(p_dev, &p_dev->io);
130} 124}
131 125
132static int avmcs_config(struct pcmcia_device *link) 126static int avmcs_config(struct pcmcia_device *link)
@@ -192,9 +186,10 @@ static int avmcs_config(struct pcmcia_device *link)
192 default: 186 default:
193 case AVM_CARDTYPE_B1: addcard = b1pcmcia_addcard_b1; break; 187 case AVM_CARDTYPE_B1: addcard = b1pcmcia_addcard_b1; break;
194 } 188 }
195 if ((i = (*addcard)(link->io.BasePort1, link->irq)) < 0) { 189 if ((i = (*addcard)(link->resource[0]->start, link->irq)) < 0) {
196 dev_err(&link->dev, "avm_cs: failed to add AVM-Controller at i/o %#x, irq %d\n", 190 dev_err(&link->dev,
197 link->io.BasePort1, link->irq); 191 "avm_cs: failed to add AVM-Controller at i/o %#x, irq %d\n",
192 (unsigned int) link->resource[0]->start, link->irq);
198 avmcs_release(link); 193 avmcs_release(link);
199 return -ENODEV; 194 return -ENODEV;
200 } 195 }
@@ -212,7 +207,7 @@ static int avmcs_config(struct pcmcia_device *link)
212 207
213static void avmcs_release(struct pcmcia_device *link) 208static void avmcs_release(struct pcmcia_device *link)
214{ 209{
215 b1pcmcia_delcard(link->io.BasePort1, link->irq); 210 b1pcmcia_delcard(link->resource[0]->start, link->irq);
216 pcmcia_disable_device(link); 211 pcmcia_disable_device(link);
217} /* avmcs_release */ 212} /* avmcs_release */
218 213
diff --git a/drivers/isdn/hisax/avma1_cs.c b/drivers/isdn/hisax/avma1_cs.c
index a80a7617f16f..94263c22b874 100644
--- a/drivers/isdn/hisax/avma1_cs.c
+++ b/drivers/isdn/hisax/avma1_cs.c
@@ -20,7 +20,6 @@
20#include <asm/io.h> 20#include <asm/io.h>
21#include <asm/system.h> 21#include <asm/system.h>
22 22
23#include <pcmcia/cs_types.h>
24#include <pcmcia/cs.h> 23#include <pcmcia/cs.h>
25#include <pcmcia/cistpl.h> 24#include <pcmcia/cistpl.h>
26#include <pcmcia/ds.h> 25#include <pcmcia/ds.h>
@@ -79,11 +78,10 @@ static int __devinit avma1cs_probe(struct pcmcia_device *p_dev)
79 dev_dbg(&p_dev->dev, "avma1cs_attach()\n"); 78 dev_dbg(&p_dev->dev, "avma1cs_attach()\n");
80 79
81 /* The io structure describes IO port mapping */ 80 /* The io structure describes IO port mapping */
82 p_dev->io.NumPorts1 = 16; 81 p_dev->resource[0]->end = 16;
83 p_dev->io.Attributes1 = IO_DATA_PATH_WIDTH_8; 82 p_dev->resource[0]->flags |= IO_DATA_PATH_WIDTH_8;
84 p_dev->io.NumPorts2 = 16; 83 p_dev->resource[1]->end = 16;
85 p_dev->io.Attributes2 = IO_DATA_PATH_WIDTH_16; 84 p_dev->resource[1]->flags |= IO_DATA_PATH_WIDTH_16;
86 p_dev->io.IOAddrLines = 5;
87 85
88 /* General socket configuration */ 86 /* General socket configuration */
89 p_dev->conf.Attributes = CONF_ENABLE_IRQ; 87 p_dev->conf.Attributes = CONF_ENABLE_IRQ;
@@ -127,13 +125,10 @@ static int avma1cs_configcheck(struct pcmcia_device *p_dev,
127 if (cf->io.nwin <= 0) 125 if (cf->io.nwin <= 0)
128 return -ENODEV; 126 return -ENODEV;
129 127
130 p_dev->io.BasePort1 = cf->io.win[0].base; 128 p_dev->resource[0]->start = cf->io.win[0].base;
131 p_dev->io.NumPorts1 = cf->io.win[0].len; 129 p_dev->resource[0]->end = cf->io.win[0].len;
132 p_dev->io.NumPorts2 = 0; 130 p_dev->io_lines = 5;
133 printk(KERN_INFO "avma1_cs: testing i/o %#x-%#x\n", 131 return pcmcia_request_io(p_dev);
134 p_dev->io.BasePort1,
135 p_dev->io.BasePort1+p_dev->io.NumPorts1-1);
136 return pcmcia_request_io(p_dev, &p_dev->io);
137} 132}
138 133
139 134
@@ -181,16 +176,18 @@ static int __devinit avma1cs_config(struct pcmcia_device *link)
181 } 176 }
182 177
183 printk(KERN_NOTICE "avma1_cs: checking at i/o %#x, irq %d\n", 178 printk(KERN_NOTICE "avma1_cs: checking at i/o %#x, irq %d\n",
184 link->io.BasePort1, link->irq); 179 (unsigned int) link->resource[0]->start, link->irq);
185 180
186 icard.para[0] = link->irq; 181 icard.para[0] = link->irq;
187 icard.para[1] = link->io.BasePort1; 182 icard.para[1] = link->resource[0]->start;
188 icard.protocol = isdnprot; 183 icard.protocol = isdnprot;
189 icard.typ = ISDN_CTYPE_A1_PCMCIA; 184 icard.typ = ISDN_CTYPE_A1_PCMCIA;
190 185
191 i = hisax_init_pcmcia(link, &busy, &icard); 186 i = hisax_init_pcmcia(link, &busy, &icard);
192 if (i < 0) { 187 if (i < 0) {
193 printk(KERN_ERR "avma1_cs: failed to initialize AVM A1 PCMCIA %d at i/o %#x\n", i, link->io.BasePort1); 188 printk(KERN_ERR "avma1_cs: failed to initialize AVM A1 "
189 "PCMCIA %d at i/o %#x\n", i,
190 (unsigned int) link->resource[0]->start);
194 avma1cs_release(link); 191 avma1cs_release(link);
195 return -ENODEV; 192 return -ENODEV;
196 } 193 }
diff --git a/drivers/isdn/hisax/elsa_cs.c b/drivers/isdn/hisax/elsa_cs.c
index 218927e3a4ea..b3c08aaf41c4 100644
--- a/drivers/isdn/hisax/elsa_cs.c
+++ b/drivers/isdn/hisax/elsa_cs.c
@@ -46,7 +46,6 @@
46#include <asm/io.h> 46#include <asm/io.h>
47#include <asm/system.h> 47#include <asm/system.h>
48 48
49#include <pcmcia/cs_types.h>
50#include <pcmcia/cs.h> 49#include <pcmcia/cs.h>
51#include <pcmcia/cistpl.h> 50#include <pcmcia/cistpl.h>
52#include <pcmcia/cisreg.h> 51#include <pcmcia/cisreg.h>
@@ -127,9 +126,8 @@ static int __devinit elsa_cs_probe(struct pcmcia_device *link)
127 and attributes of IO windows) are fixed by the nature of the 126 and attributes of IO windows) are fixed by the nature of the
128 device, and can be hard-wired here. 127 device, and can be hard-wired here.
129 */ 128 */
130 link->io.NumPorts1 = 8; 129 link->resource[0]->end = 8;
131 link->io.Attributes1 = IO_DATA_PATH_WIDTH_AUTO; 130 link->resource[0]->flags |= IO_DATA_PATH_WIDTH_AUTO;
132 link->io.IOAddrLines = 3;
133 131
134 link->conf.Attributes = CONF_ENABLE_IRQ; 132 link->conf.Attributes = CONF_ENABLE_IRQ;
135 link->conf.IntType = INT_MEMORY_AND_IO; 133 link->conf.IntType = INT_MEMORY_AND_IO;
@@ -174,16 +172,18 @@ static int elsa_cs_configcheck(struct pcmcia_device *p_dev,
174{ 172{
175 int j; 173 int j;
176 174
175 p_dev->io_lines = 3;
176
177 if ((cf->io.nwin > 0) && cf->io.win[0].base) { 177 if ((cf->io.nwin > 0) && cf->io.win[0].base) {
178 printk(KERN_INFO "(elsa_cs: looks like the 96 model)\n"); 178 printk(KERN_INFO "(elsa_cs: looks like the 96 model)\n");
179 p_dev->io.BasePort1 = cf->io.win[0].base; 179 p_dev->resource[0]->start = cf->io.win[0].base;
180 if (!pcmcia_request_io(p_dev, &p_dev->io)) 180 if (!pcmcia_request_io(p_dev))
181 return 0; 181 return 0;
182 } else { 182 } else {
183 printk(KERN_INFO "(elsa_cs: looks like the 97 model)\n"); 183 printk(KERN_INFO "(elsa_cs: looks like the 97 model)\n");
184 for (j = 0x2f0; j > 0x100; j -= 0x10) { 184 for (j = 0x2f0; j > 0x100; j -= 0x10) {
185 p_dev->io.BasePort1 = j; 185 p_dev->resource[0]->start = j;
186 if (!pcmcia_request_io(p_dev, &p_dev->io)) 186 if (!pcmcia_request_io(p_dev))
187 return 0; 187 return 0;
188 } 188 }
189 } 189 }
@@ -215,23 +215,21 @@ static int __devinit elsa_cs_config(struct pcmcia_device *link)
215 link->conf.ConfigIndex); 215 link->conf.ConfigIndex);
216 if (link->conf.Attributes & CONF_ENABLE_IRQ) 216 if (link->conf.Attributes & CONF_ENABLE_IRQ)
217 printk(", irq %d", link->irq); 217 printk(", irq %d", link->irq);
218 if (link->io.NumPorts1) 218 if (link->resource[0])
219 printk(", io 0x%04x-0x%04x", link->io.BasePort1, 219 printk(" & %pR", link->resource[0]);
220 link->io.BasePort1+link->io.NumPorts1-1); 220 if (link->resource[1])
221 if (link->io.NumPorts2) 221 printk(" & %pR", link->resource[1]);
222 printk(" & 0x%04x-0x%04x", link->io.BasePort2,
223 link->io.BasePort2+link->io.NumPorts2-1);
224 printk("\n"); 222 printk("\n");
225 223
226 icard.para[0] = link->irq; 224 icard.para[0] = link->irq;
227 icard.para[1] = link->io.BasePort1; 225 icard.para[1] = link->resource[0]->start;
228 icard.protocol = protocol; 226 icard.protocol = protocol;
229 icard.typ = ISDN_CTYPE_ELSA_PCMCIA; 227 icard.typ = ISDN_CTYPE_ELSA_PCMCIA;
230 228
231 i = hisax_init_pcmcia(link, &(((local_info_t*)link->priv)->busy), &icard); 229 i = hisax_init_pcmcia(link, &(((local_info_t*)link->priv)->busy), &icard);
232 if (i < 0) { 230 if (i < 0) {
233 printk(KERN_ERR "elsa_cs: failed to initialize Elsa PCMCIA %d at i/o %#x\n", 231 printk(KERN_ERR "elsa_cs: failed to initialize Elsa "
234 i, link->io.BasePort1); 232 "PCMCIA %d with %pR\n", i, link->resource[0]);
235 elsa_cs_release(link); 233 elsa_cs_release(link);
236 } else 234 } else
237 ((local_info_t*)link->priv)->cardnr = i; 235 ((local_info_t*)link->priv)->cardnr = i;
diff --git a/drivers/isdn/hisax/sedlbauer_cs.c b/drivers/isdn/hisax/sedlbauer_cs.c
index 1f4feaab21af..a024192b672a 100644
--- a/drivers/isdn/hisax/sedlbauer_cs.c
+++ b/drivers/isdn/hisax/sedlbauer_cs.c
@@ -46,7 +46,6 @@
46#include <asm/io.h> 46#include <asm/io.h>
47#include <asm/system.h> 47#include <asm/system.h>
48 48
49#include <pcmcia/cs_types.h>
50#include <pcmcia/cs.h> 49#include <pcmcia/cs.h>
51#include <pcmcia/cistpl.h> 50#include <pcmcia/cistpl.h>
52#include <pcmcia/cisreg.h> 51#include <pcmcia/cisreg.h>
@@ -130,9 +129,8 @@ static int __devinit sedlbauer_probe(struct pcmcia_device *link)
130 /* from old sedl_cs 129 /* from old sedl_cs
131 */ 130 */
132 /* The io structure describes IO port mapping */ 131 /* The io structure describes IO port mapping */
133 link->io.NumPorts1 = 8; 132 link->resource[0]->end = 8;
134 link->io.Attributes1 = IO_DATA_PATH_WIDTH_8; 133 link->resource[0]->flags |= IO_DATA_PATH_WIDTH_8;
135 link->io.IOAddrLines = 3;
136 134
137 link->conf.Attributes = 0; 135 link->conf.Attributes = 0;
138 link->conf.IntType = INT_MEMORY_AND_IO; 136 link->conf.IntType = INT_MEMORY_AND_IO;
@@ -173,8 +171,6 @@ static int sedlbauer_config_check(struct pcmcia_device *p_dev,
173 unsigned int vcc, 171 unsigned int vcc,
174 void *priv_data) 172 void *priv_data)
175{ 173{
176 win_req_t *req = priv_data;
177
178 if (cfg->index == 0) 174 if (cfg->index == 0)
179 return -ENODEV; 175 return -ENODEV;
180 176
@@ -202,52 +198,25 @@ static int sedlbauer_config_check(struct pcmcia_device *p_dev,
202 p_dev->conf.Attributes |= CONF_ENABLE_IRQ; 198 p_dev->conf.Attributes |= CONF_ENABLE_IRQ;
203 199
204 /* IO window settings */ 200 /* IO window settings */
205 p_dev->io.NumPorts1 = p_dev->io.NumPorts2 = 0; 201 p_dev->resource[0]->end = p_dev->resource[1]->end = 0;
206 if ((cfg->io.nwin > 0) || (dflt->io.nwin > 0)) { 202 if ((cfg->io.nwin > 0) || (dflt->io.nwin > 0)) {
207 cistpl_io_t *io = (cfg->io.nwin) ? &cfg->io : &dflt->io; 203 cistpl_io_t *io = (cfg->io.nwin) ? &cfg->io : &dflt->io;
208 p_dev->io.Attributes1 = IO_DATA_PATH_WIDTH_AUTO; 204 p_dev->resource[0]->start = io->win[0].base;
209 if (!(io->flags & CISTPL_IO_8BIT)) 205 p_dev->resource[0]->end = io->win[0].len;
210 p_dev->io.Attributes1 = IO_DATA_PATH_WIDTH_16; 206 p_dev->resource[0]->flags &= ~IO_DATA_PATH_WIDTH;
211 if (!(io->flags & CISTPL_IO_16BIT)) 207 p_dev->resource[0]->flags |=
212 p_dev->io.Attributes1 = IO_DATA_PATH_WIDTH_8; 208 pcmcia_io_cfg_data_width(io->flags);
213 p_dev->io.BasePort1 = io->win[0].base;
214 p_dev->io.NumPorts1 = io->win[0].len;
215 if (io->nwin > 1) { 209 if (io->nwin > 1) {
216 p_dev->io.Attributes2 = p_dev->io.Attributes1; 210 p_dev->resource[1]->flags = p_dev->resource[0]->flags;
217 p_dev->io.BasePort2 = io->win[1].base; 211 p_dev->resource[1]->start = io->win[1].base;
218 p_dev->io.NumPorts2 = io->win[1].len; 212 p_dev->resource[1]->end = io->win[1].len;
219 } 213 }
220 /* This reserves IO space but doesn't actually enable it */ 214 /* This reserves IO space but doesn't actually enable it */
221 if (pcmcia_request_io(p_dev, &p_dev->io) != 0) 215 p_dev->io_lines = 3;
216 if (pcmcia_request_io(p_dev) != 0)
222 return -ENODEV; 217 return -ENODEV;
223 } 218 }
224 219
225 /*
226 Now set up a common memory window, if needed. There is room
227 in the struct pcmcia_device structure for one memory window handle,
228 but if the base addresses need to be saved, or if multiple
229 windows are needed, the info should go in the private data
230 structure for this device.
231
232 Note that the memory window base is a physical address, and
233 needs to be mapped to virtual space with ioremap() before it
234 is used.
235 */
236 if ((cfg->mem.nwin > 0) || (dflt->mem.nwin > 0)) {
237 cistpl_mem_t *mem = (cfg->mem.nwin) ? &cfg->mem : &dflt->mem;
238 memreq_t map;
239 req->Attributes = WIN_DATA_WIDTH_16|WIN_MEMORY_TYPE_CM;
240 req->Attributes |= WIN_ENABLE;
241 req->Base = mem->win[0].host_addr;
242 req->Size = mem->win[0].len;
243 req->AccessSpeed = 0;
244 if (pcmcia_request_window(p_dev, req, &p_dev->win) != 0)
245 return -ENODEV;
246 map.Page = 0;
247 map.CardOffset = mem->win[0].card_addr;
248 if (pcmcia_map_mem_page(p_dev, p_dev->win, &map) != 0)
249 return -ENODEV;
250 }
251 return 0; 220 return 0;
252} 221}
253 222
@@ -255,16 +224,11 @@ static int sedlbauer_config_check(struct pcmcia_device *p_dev,
255 224
256static int __devinit sedlbauer_config(struct pcmcia_device *link) 225static int __devinit sedlbauer_config(struct pcmcia_device *link)
257{ 226{
258 win_req_t *req;
259 int ret; 227 int ret;
260 IsdnCard_t icard; 228 IsdnCard_t icard;
261 229
262 dev_dbg(&link->dev, "sedlbauer_config(0x%p)\n", link); 230 dev_dbg(&link->dev, "sedlbauer_config(0x%p)\n", link);
263 231
264 req = kzalloc(sizeof(win_req_t), GFP_KERNEL);
265 if (!req)
266 return -ENOMEM;
267
268 /* 232 /*
269 In this loop, we scan the CIS for configuration table entries, 233 In this loop, we scan the CIS for configuration table entries,
270 each of which describes a valid card configuration, including 234 each of which describes a valid card configuration, including
@@ -277,7 +241,7 @@ static int __devinit sedlbauer_config(struct pcmcia_device *link)
277 these things without consulting the CIS, and most client drivers 241 these things without consulting the CIS, and most client drivers
278 will only use the CIS to fill in implementation-defined details. 242 will only use the CIS to fill in implementation-defined details.
279 */ 243 */
280 ret = pcmcia_loop_config(link, sedlbauer_config_check, req); 244 ret = pcmcia_loop_config(link, sedlbauer_config_check, NULL);
281 if (ret) 245 if (ret)
282 goto failed; 246 goto failed;
283 247
@@ -297,27 +261,22 @@ static int __devinit sedlbauer_config(struct pcmcia_device *link)
297 printk(", Vpp %d.%d", link->conf.Vpp/10, link->conf.Vpp%10); 261 printk(", Vpp %d.%d", link->conf.Vpp/10, link->conf.Vpp%10);
298 if (link->conf.Attributes & CONF_ENABLE_IRQ) 262 if (link->conf.Attributes & CONF_ENABLE_IRQ)
299 printk(", irq %d", link->irq); 263 printk(", irq %d", link->irq);
300 if (link->io.NumPorts1) 264 if (link->resource[0])
301 printk(", io 0x%04x-0x%04x", link->io.BasePort1, 265 printk(" & %pR", link->resource[0]);
302 link->io.BasePort1+link->io.NumPorts1-1); 266 if (link->resource[1])
303 if (link->io.NumPorts2) 267 printk(" & %pR", link->resource[1]);
304 printk(" & 0x%04x-0x%04x", link->io.BasePort2,
305 link->io.BasePort2+link->io.NumPorts2-1);
306 if (link->win)
307 printk(", mem 0x%06lx-0x%06lx", req->Base,
308 req->Base+req->Size-1);
309 printk("\n"); 268 printk("\n");
310 269
311 icard.para[0] = link->irq; 270 icard.para[0] = link->irq;
312 icard.para[1] = link->io.BasePort1; 271 icard.para[1] = link->resource[0]->start;
313 icard.protocol = protocol; 272 icard.protocol = protocol;
314 icard.typ = ISDN_CTYPE_SEDLBAUER_PCMCIA; 273 icard.typ = ISDN_CTYPE_SEDLBAUER_PCMCIA;
315 274
316 ret = hisax_init_pcmcia(link, 275 ret = hisax_init_pcmcia(link,
317 &(((local_info_t *)link->priv)->stop), &icard); 276 &(((local_info_t *)link->priv)->stop), &icard);
318 if (ret < 0) { 277 if (ret < 0) {
319 printk(KERN_ERR "sedlbauer_cs: failed to initialize SEDLBAUER PCMCIA %d at i/o %#x\n", 278 printk(KERN_ERR "sedlbauer_cs: failed to initialize SEDLBAUER PCMCIA %d with %pR\n",
320 ret, link->io.BasePort1); 279 ret, link->resource[0]);
321 sedlbauer_release(link); 280 sedlbauer_release(link);
322 return -ENODEV; 281 return -ENODEV;
323 } else 282 } else
diff --git a/drivers/isdn/hisax/teles_cs.c b/drivers/isdn/hisax/teles_cs.c
index 5771955cc532..7296102ca255 100644
--- a/drivers/isdn/hisax/teles_cs.c
+++ b/drivers/isdn/hisax/teles_cs.c
@@ -27,7 +27,6 @@
27#include <asm/io.h> 27#include <asm/io.h>
28#include <asm/system.h> 28#include <asm/system.h>
29 29
30#include <pcmcia/cs_types.h>
31#include <pcmcia/cs.h> 30#include <pcmcia/cs.h>
32#include <pcmcia/cistpl.h> 31#include <pcmcia/cistpl.h>
33#include <pcmcia/cisreg.h> 32#include <pcmcia/cisreg.h>
@@ -107,9 +106,8 @@ static int __devinit teles_probe(struct pcmcia_device *link)
107 and attributes of IO windows) are fixed by the nature of the 106 and attributes of IO windows) are fixed by the nature of the
108 device, and can be hard-wired here. 107 device, and can be hard-wired here.
109 */ 108 */
110 link->io.NumPorts1 = 96; 109 link->resource[0]->end = 96;
111 link->io.Attributes1 = IO_DATA_PATH_WIDTH_AUTO; 110 link->resource[0]->flags |= IO_DATA_PATH_WIDTH_AUTO;
112 link->io.IOAddrLines = 5;
113 111
114 link->conf.Attributes = CONF_ENABLE_IRQ; 112 link->conf.Attributes = CONF_ENABLE_IRQ;
115 link->conf.IntType = INT_MEMORY_AND_IO; 113 link->conf.IntType = INT_MEMORY_AND_IO;
@@ -154,16 +152,18 @@ static int teles_cs_configcheck(struct pcmcia_device *p_dev,
154{ 152{
155 int j; 153 int j;
156 154
155 p_dev->io_lines = 5;
156
157 if ((cf->io.nwin > 0) && cf->io.win[0].base) { 157 if ((cf->io.nwin > 0) && cf->io.win[0].base) {
158 printk(KERN_INFO "(teles_cs: looks like the 96 model)\n"); 158 printk(KERN_INFO "(teles_cs: looks like the 96 model)\n");
159 p_dev->io.BasePort1 = cf->io.win[0].base; 159 p_dev->resource[0]->start = cf->io.win[0].base;
160 if (!pcmcia_request_io(p_dev, &p_dev->io)) 160 if (!pcmcia_request_io(p_dev))
161 return 0; 161 return 0;
162 } else { 162 } else {
163 printk(KERN_INFO "(teles_cs: looks like the 97 model)\n"); 163 printk(KERN_INFO "(teles_cs: looks like the 97 model)\n");
164 for (j = 0x2f0; j > 0x100; j -= 0x10) { 164 for (j = 0x2f0; j > 0x100; j -= 0x10) {
165 p_dev->io.BasePort1 = j; 165 p_dev->resource[0]->start = j;
166 if (!pcmcia_request_io(p_dev, &p_dev->io)) 166 if (!pcmcia_request_io(p_dev))
167 return 0; 167 return 0;
168 } 168 }
169 } 169 }
@@ -195,23 +195,21 @@ static int __devinit teles_cs_config(struct pcmcia_device *link)
195 link->conf.ConfigIndex); 195 link->conf.ConfigIndex);
196 if (link->conf.Attributes & CONF_ENABLE_IRQ) 196 if (link->conf.Attributes & CONF_ENABLE_IRQ)
197 printk(", irq %d", link->irq); 197 printk(", irq %d", link->irq);
198 if (link->io.NumPorts1) 198 if (link->resource[0])
199 printk(", io 0x%04x-0x%04x", link->io.BasePort1, 199 printk(" & %pR", link->resource[0]);
200 link->io.BasePort1+link->io.NumPorts1-1); 200 if (link->resource[1])
201 if (link->io.NumPorts2) 201 printk(" & %pR", link->resource[1]);
202 printk(" & 0x%04x-0x%04x", link->io.BasePort2,
203 link->io.BasePort2+link->io.NumPorts2-1);
204 printk("\n"); 202 printk("\n");
205 203
206 icard.para[0] = link->irq; 204 icard.para[0] = link->irq;
207 icard.para[1] = link->io.BasePort1; 205 icard.para[1] = link->resource[0]->start;
208 icard.protocol = protocol; 206 icard.protocol = protocol;
209 icard.typ = ISDN_CTYPE_TELESPCMCIA; 207 icard.typ = ISDN_CTYPE_TELESPCMCIA;
210 208
211 i = hisax_init_pcmcia(link, &(((local_info_t*)link->priv)->busy), &icard); 209 i = hisax_init_pcmcia(link, &(((local_info_t*)link->priv)->busy), &icard);
212 if (i < 0) { 210 if (i < 0) {
213 printk(KERN_ERR "teles_cs: failed to initialize Teles PCMCIA %d at i/o %#x\n", 211 printk(KERN_ERR "teles_cs: failed to initialize Teles PCMCIA %d at i/o %#x\n",
214 i, link->io.BasePort1); 212 i, (unsigned int) link->resource[0]->start);
215 teles_cs_release(link); 213 teles_cs_release(link);
216 return -ENODEV; 214 return -ENODEV;
217 } 215 }