[PATCH 4/10] CardServices() removal from pcmcia net drivers
From: Andres Salomon
Date: Mon Dec 22 2003 - 01:24:06 EST
Part 4 of 10
Revision: linux--mainline--2.6--patch-13
Archive: dilinger@xxxxxxxxxxxxxxxxxxxxxx
Creator: Andres Salomon <dilinger@xxxxxxxxx>
Date: Sun Dec 21 17:51:19 EST 2003
Standard-date: 2003-12-21 22:51:19 GMT
Modified-files: drivers/net/pcmcia/ibmtr_cs.c
New-patches: dilinger@xxxxxxxxxxxxxxxxxxxxxx/linux--mainline--2.6--patch-13
Summary: CardServices removal, pt. 4
Keywords:
Remove calls to CardServices(), part 4; ibmtr_cs.c.
* added files
{arch}/linux/linux--mainline/linux--mainline--2.6/dilinger@xxxxxxxxxxxxxxxxxxxxxx/patch-log/patch-13
* modified files
--- orig/drivers/net/pcmcia/ibmtr_cs.c
+++ mod/drivers/net/pcmcia/ibmtr_cs.c
@@ -214,7 +214,7 @@
client_reg.event_handler = &ibmtr_event;
client_reg.Version = 0x0210;
client_reg.event_callback_args.client_data = link;
- ret = CardServices(RegisterClient, &link->handle, &client_reg);
+ ret = pcmcia_register_client(&link->handle, &client_reg);
if (ret != 0) {
cs_error(link->handle, RegisterClient, ret);
goto out_detach;
@@ -264,7 +264,7 @@
}
if (link->handle)
- CardServices(DeregisterClient, link->handle);
+ pcmcia_deregister_client(link->handle);
/* Unlink device structure, free bits */
*linkp = link->next;
@@ -281,8 +281,8 @@
======================================================================*/
-#define CS_CHECK(fn, args...) \
-while ((last_ret=CardServices(last_fn=(fn), args))!=0) goto cs_failed
+#define CS_CHECK(fn, ret) \
+do { last_fn = (fn); if ((last_ret = (ret)) != 0) goto cs_failed; } while (0)
static void ibmtr_config(dev_link_t *link)
{
@@ -304,9 +304,9 @@
tuple.TupleDataMax = 64;
tuple.TupleOffset = 0;
tuple.DesiredTuple = CISTPL_CONFIG;
- CS_CHECK(GetFirstTuple, handle, &tuple);
- CS_CHECK(GetTupleData, handle, &tuple);
- CS_CHECK(ParseTuple, handle, &tuple, &parse);
+ CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(handle, &tuple));
+ CS_CHECK(GetTupleData, pcmcia_get_tuple_data(handle, &tuple));
+ CS_CHECK(ParseTuple, pcmcia_parse_tuple(handle, &tuple, &parse));
link->conf.ConfigBase = parse.config.base;
/* Configure card */
@@ -318,18 +318,18 @@
/* Try PRIMARY card at 0xA20-0xA23 */
link->io.BasePort1 = 0xA20;
- i = CardServices(RequestIO, link->handle, &link->io);
+ i = pcmcia_request_io(link->handle, &link->io);
if (i == CS_SUCCESS) {
memcpy(info->node.dev_name, "tr0\0", 4);
} else {
/* Couldn't get 0xA20-0xA23. Try ALTERNATE at 0xA24-0xA27. */
link->io.BasePort1 = 0xA24;
- CS_CHECK(RequestIO, link->handle, &link->io);
+ CS_CHECK(RequestIO, pcmcia_request_io(link->handle, &link->io));
memcpy(info->node.dev_name, "tr1\0", 4);
}
dev->base_addr = link->io.BasePort1;
- CS_CHECK(RequestIRQ, link->handle, &link->irq);
+ CS_CHECK(RequestIRQ, pcmcia_request_irq(link->handle, &link->irq));
dev->irq = link->irq.AssignedIRQ;
ti->irq = link->irq.AssignedIRQ;
ti->global_int_enable=GLOBAL_INT_ENABLE+((dev->irq==9) ? 2 : dev->irq);
@@ -340,12 +340,11 @@
req.Base = 0;
req.Size = 0x2000;
req.AccessSpeed = 250;
- link->win = (window_handle_t)link->handle;
- CS_CHECK(RequestWindow, &link->win, &req);
+ CS_CHECK(RequestWindow, pcmcia_request_window(&link->handle, &req, &link->win));
mem.CardOffset = mmiobase;
mem.Page = 0;
- CS_CHECK(MapMemPage, link->win, &mem);
+ CS_CHECK(MapMemPage, pcmcia_map_mem_page(link->win, &mem));
ti->mmio = ioremap(req.Base, req.Size);
/* Allocate the SRAM memory window */
@@ -354,17 +353,16 @@
req.Base = 0;
req.Size = sramsize * 1024;
req.AccessSpeed = 250;
- info->sram_win_handle = (window_handle_t)link->handle;
- CS_CHECK(RequestWindow, &info->sram_win_handle, &req);
+ CS_CHECK(RequestWindow, pcmcia_request_window(&link->handle, &req, &info->sram_win_handle));
mem.CardOffset = srambase;
mem.Page = 0;
- CS_CHECK(MapMemPage, info->sram_win_handle, &mem);
+ CS_CHECK(MapMemPage, pcmcia_map_mem_page(info->sram_win_handle, &mem));
ti->sram_base = mem.CardOffset >> 12;
ti->sram_virt = (u_long)ioremap(req.Base, req.Size);
- CS_CHECK(RequestConfiguration, link->handle, &link->conf);
+ CS_CHECK(RequestConfiguration, pcmcia_request_configuration(link->handle, &link->conf));
/* Set up the Token-Ring Controller Configuration Register and
turn on the card. Check the "Local Area Network Credit Card
@@ -419,14 +417,14 @@
return;
}
- CardServices(ReleaseConfiguration, link->handle);
- CardServices(ReleaseIO, link->handle, &link->io);
- CardServices(ReleaseIRQ, link->handle, &link->irq);
+ pcmcia_release_configuration(link->handle);
+ pcmcia_release_io(link->handle, &link->io);
+ pcmcia_release_irq(link->handle, &link->irq);
if (link->win) {
struct tok_info *ti = dev->priv;
iounmap((void *)ti->mmio);
- CardServices(ReleaseWindow, link->win);
- CardServices(ReleaseWindow, info->sram_win_handle);
+ pcmcia_release_window(link->win);
+ pcmcia_release_window(info->sram_win_handle);
}
link->state &= ~DEV_CONFIG;
@@ -474,7 +472,7 @@
if (link->state & DEV_CONFIG) {
if (link->open)
netif_device_detach(dev);
- CardServices(ReleaseConfiguration, link->handle);
+ pcmcia_release_configuration(link->handle);
}
break;
case CS_EVENT_PM_RESUME:
@@ -482,7 +480,7 @@
/* Fall through... */
case CS_EVENT_CARD_RESET:
if (link->state & DEV_CONFIG) {
- CardServices(RequestConfiguration, link->handle, &link->conf);
+ pcmcia_request_configuration(link->handle, &link->conf);
if (link->open) {
(dev->init)(dev);
netif_device_attach(dev);
Attachment:
signature.asc
Description: This is a digitally signed message part