diff options
Diffstat (limited to 'drivers/net/pcmcia/ibmtr_cs.c')
-rw-r--r-- | drivers/net/pcmcia/ibmtr_cs.c | 29 |
1 files changed, 11 insertions, 18 deletions
diff --git a/drivers/net/pcmcia/ibmtr_cs.c b/drivers/net/pcmcia/ibmtr_cs.c index 67ee9851a8ed..b0d06a3d962f 100644 --- a/drivers/net/pcmcia/ibmtr_cs.c +++ b/drivers/net/pcmcia/ibmtr_cs.c | |||
@@ -57,7 +57,6 @@ | |||
57 | #include <linux/trdevice.h> | 57 | #include <linux/trdevice.h> |
58 | #include <linux/ibmtr.h> | 58 | #include <linux/ibmtr.h> |
59 | 59 | ||
60 | #include <pcmcia/cs_types.h> | ||
61 | #include <pcmcia/cs.h> | 60 | #include <pcmcia/cs.h> |
62 | #include <pcmcia/cistpl.h> | 61 | #include <pcmcia/cistpl.h> |
63 | #include <pcmcia/ds.h> | 62 | #include <pcmcia/ds.h> |
@@ -152,9 +151,8 @@ static int __devinit ibmtr_attach(struct pcmcia_device *link) | |||
152 | link->priv = info; | 151 | link->priv = info; |
153 | info->ti = netdev_priv(dev); | 152 | info->ti = netdev_priv(dev); |
154 | 153 | ||
155 | link->io.Attributes1 = IO_DATA_PATH_WIDTH_8; | 154 | link->resource[0]->flags |= IO_DATA_PATH_WIDTH_8; |
156 | link->io.NumPorts1 = 4; | 155 | link->resource[0]->end = 4; |
157 | link->io.IOAddrLines = 16; | ||
158 | link->conf.Attributes = CONF_ENABLE_IRQ; | 156 | link->conf.Attributes = CONF_ENABLE_IRQ; |
159 | link->conf.IntType = INT_MEMORY_AND_IO; | 157 | link->conf.IntType = INT_MEMORY_AND_IO; |
160 | link->conf.Present = PRESENT_OPTION; | 158 | link->conf.Present = PRESENT_OPTION; |
@@ -213,26 +211,26 @@ static int __devinit ibmtr_config(struct pcmcia_device *link) | |||
213 | struct net_device *dev = info->dev; | 211 | struct net_device *dev = info->dev; |
214 | struct tok_info *ti = netdev_priv(dev); | 212 | struct tok_info *ti = netdev_priv(dev); |
215 | win_req_t req; | 213 | win_req_t req; |
216 | memreq_t mem; | ||
217 | int i, ret; | 214 | int i, ret; |
218 | 215 | ||
219 | dev_dbg(&link->dev, "ibmtr_config\n"); | 216 | dev_dbg(&link->dev, "ibmtr_config\n"); |
220 | 217 | ||
221 | link->conf.ConfigIndex = 0x61; | 218 | link->conf.ConfigIndex = 0x61; |
219 | link->io_lines = 16; | ||
222 | 220 | ||
223 | /* Determine if this is PRIMARY or ALTERNATE. */ | 221 | /* Determine if this is PRIMARY or ALTERNATE. */ |
224 | 222 | ||
225 | /* Try PRIMARY card at 0xA20-0xA23 */ | 223 | /* Try PRIMARY card at 0xA20-0xA23 */ |
226 | link->io.BasePort1 = 0xA20; | 224 | link->resource[0]->start = 0xA20; |
227 | i = pcmcia_request_io(link, &link->io); | 225 | i = pcmcia_request_io(link); |
228 | if (i != 0) { | 226 | if (i != 0) { |
229 | /* Couldn't get 0xA20-0xA23. Try ALTERNATE at 0xA24-0xA27. */ | 227 | /* Couldn't get 0xA20-0xA23. Try ALTERNATE at 0xA24-0xA27. */ |
230 | link->io.BasePort1 = 0xA24; | 228 | link->resource[0]->start = 0xA24; |
231 | ret = pcmcia_request_io(link, &link->io); | 229 | ret = pcmcia_request_io(link); |
232 | if (ret) | 230 | if (ret) |
233 | goto failed; | 231 | goto failed; |
234 | } | 232 | } |
235 | dev->base_addr = link->io.BasePort1; | 233 | dev->base_addr = link->resource[0]->start; |
236 | 234 | ||
237 | ret = pcmcia_request_exclusive_irq(link, ibmtr_interrupt); | 235 | ret = pcmcia_request_exclusive_irq(link, ibmtr_interrupt); |
238 | if (ret) | 236 | if (ret) |
@@ -251,9 +249,7 @@ static int __devinit ibmtr_config(struct pcmcia_device *link) | |||
251 | if (ret) | 249 | if (ret) |
252 | goto failed; | 250 | goto failed; |
253 | 251 | ||
254 | mem.CardOffset = mmiobase; | 252 | ret = pcmcia_map_mem_page(link, link->win, mmiobase); |
255 | mem.Page = 0; | ||
256 | ret = pcmcia_map_mem_page(link, link->win, &mem); | ||
257 | if (ret) | 253 | if (ret) |
258 | goto failed; | 254 | goto failed; |
259 | ti->mmio = ioremap(req.Base, req.Size); | 255 | ti->mmio = ioremap(req.Base, req.Size); |
@@ -268,13 +264,11 @@ static int __devinit ibmtr_config(struct pcmcia_device *link) | |||
268 | if (ret) | 264 | if (ret) |
269 | goto failed; | 265 | goto failed; |
270 | 266 | ||
271 | mem.CardOffset = srambase; | 267 | ret = pcmcia_map_mem_page(link, info->sram_win_handle, srambase); |
272 | mem.Page = 0; | ||
273 | ret = pcmcia_map_mem_page(link, info->sram_win_handle, &mem); | ||
274 | if (ret) | 268 | if (ret) |
275 | goto failed; | 269 | goto failed; |
276 | 270 | ||
277 | ti->sram_base = mem.CardOffset >> 12; | 271 | ti->sram_base = srambase >> 12; |
278 | ti->sram_virt = ioremap(req.Base, req.Size); | 272 | ti->sram_virt = ioremap(req.Base, req.Size); |
279 | ti->sram_phys = req.Base; | 273 | ti->sram_phys = req.Base; |
280 | 274 | ||
@@ -325,7 +319,6 @@ static void ibmtr_release(struct pcmcia_device *link) | |||
325 | if (link->win) { | 319 | if (link->win) { |
326 | struct tok_info *ti = netdev_priv(dev); | 320 | struct tok_info *ti = netdev_priv(dev); |
327 | iounmap(ti->mmio); | 321 | iounmap(ti->mmio); |
328 | pcmcia_release_window(link, info->sram_win_handle); | ||
329 | } | 322 | } |
330 | pcmcia_disable_device(link); | 323 | pcmcia_disable_device(link); |
331 | } | 324 | } |