[PATCH 3/10] CardServices() removal from pcmcia net drivers
From: Andres Salomon
Date: Mon Dec 22 2003 - 01:22:38 EST
Part 3 of 10
Revision: linux--mainline--2.6--patch-12
Archive: dilinger@xxxxxxxxxxxxxxxxxxxxxx
Creator: Andres Salomon <dilinger@xxxxxxxxx>
Date: Sun Dec 21 17:30:58 EST 2003
Standard-date: 2003-12-21 22:30:58 GMT
Modified-files: drivers/net/pcmcia/nmclan_cs.c
New-patches: dilinger@xxxxxxxxxxxxxxxxxxxxxx/linux--mainline--2.6--patch-12
Summary: CardServices() removal, pt. 3.
Keywords:
Remove calls to CardServices(), part 3; nmclan_cs.c.
* added files
{arch}/linux/linux--mainline/linux--mainline--2.6/dilinger@xxxxxxxxxxxxxxxxxxxxxx/patch-log/patch-12
* modified files
--- orig/drivers/net/pcmcia/nmclan_cs.c
+++ mod/drivers/net/pcmcia/nmclan_cs.c
@@ -520,7 +520,7 @@
client_reg.event_handler = &nmclan_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);
nmclan_detach(link);
@@ -558,7 +558,7 @@
}
if (link->handle)
- CardServices(DeregisterClient, link->handle);
+ pcmcia_deregister_client(link->handle);
/* Unlink device structure, free bits */
*linkp = link->next;
@@ -706,8 +706,8 @@
ethernet device available to the system.
---------------------------------------------------------------------------- */
-#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 nmclan_config(dev_link_t *link)
{
@@ -727,17 +727,17 @@
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 */
link->state |= DEV_CONFIG;
- CS_CHECK(RequestIO, handle, &link->io);
- CS_CHECK(RequestIRQ, handle, &link->irq);
- CS_CHECK(RequestConfiguration, handle, &link->conf);
+ CS_CHECK(RequestIO, pcmcia_request_io(handle, &link->io));
+ CS_CHECK(RequestIRQ, pcmcia_request_irq(handle, &link->irq));
+ CS_CHECK(RequestConfiguration, pcmcia_request_configuration(handle, &link->conf));
dev->irq = link->irq.AssignedIRQ;
dev->base_addr = link->io.BasePort1;
i = register_netdev(dev);
@@ -753,8 +753,8 @@
tuple.TupleData = buf;
tuple.TupleDataMax = 64;
tuple.TupleOffset = 0;
- CS_CHECK(GetFirstTuple, handle, &tuple);
- CS_CHECK(GetTupleData, handle, &tuple);
+ CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(handle, &tuple));
+ CS_CHECK(GetTupleData, pcmcia_get_tuple_data(handle, &tuple));
memcpy(dev->dev_addr, tuple.TupleData, ETHER_ADDR_LEN);
/* Verify configuration by reading the MACE ID. */
@@ -819,9 +819,9 @@
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);
link->state &= ~DEV_CONFIG;
@@ -863,7 +863,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:
@@ -871,7 +871,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) {
nmclan_reset(dev);
netif_device_attach(dev);
@@ -903,7 +903,7 @@
reg.Action = CS_READ;
reg.Offset = CISREG_COR;
reg.Value = 0;
- CardServices(AccessConfigurationRegister, link->handle, ®);
+ pcmcia_access_configuration_register(link->handle, ®);
OrigCorValue = reg.Value;
/* Reset Xilinx */
@@ -912,12 +912,12 @@
DEBUG(1, "nmclan_reset: OrigCorValue=0x%lX, resetting...\n",
OrigCorValue);
reg.Value = COR_SOFT_RESET;
- CardServices(AccessConfigurationRegister, link->handle, ®);
+ pcmcia_access_configuration_register(link->handle, ®);
/* Need to wait for 20 ms for PCMCIA to finish reset. */
/* Restore original COR configuration index */
reg.Value = COR_LEVEL_REQ | (OrigCorValue & COR_CONFIG_MASK);
- CardServices(AccessConfigurationRegister, link->handle, ®);
+ pcmcia_access_configuration_register(link->handle, ®);
/* Xilinx is now completely reset along with the MACE chip. */
lp->tx_free_frames=AM2150_MAX_TX_FRAMES;
@@ -1046,7 +1046,7 @@
printk(KERN_NOTICE "%s: transmit timed out -- ", dev->name);
#if RESET_ON_TIMEOUT
printk("resetting card\n");
- CardServices(ResetCard, link->handle);
+ pcmcia_reset_card(link->handle, NULL);
#else /* #if RESET_ON_TIMEOUT */
printk("NOT resetting card\n");
#endif /* #if RESET_ON_TIMEOUT */
Attachment:
signature.asc
Description: This is a digitally signed message part