From: Andres Salomon Replace the various CardServices() calls w/ their pcmcia_* function. The pcmcia functions fit better with kernel conventions, and don't have the nasty var args stuff. These patches also fix a few places where the args supplied to CardServices were either not supplied, or dealt with in non-obvious ways. drivers/net/pcmcia/3c574_cs.c | 40 ++++++++++---------- drivers/net/pcmcia/3c589_cs.c | 38 +++++++++---------- drivers/net/pcmcia/axnet_cs.c | 47 +++++++++++------------- drivers/net/pcmcia/com20020_cs.c | 32 ++++++++-------- drivers/net/pcmcia/fmvj18x_cs.c | 76 ++++++++++++++++++--------------------- drivers/net/pcmcia/ibmtr_cs.c | 46 +++++++++++------------ drivers/net/pcmcia/nmclan_cs.c | 42 ++++++++++----------- drivers/net/pcmcia/pcnet_cs.c | 69 ++++++++++++++++------------------- drivers/net/pcmcia/smc91c92_cs.c | 75 +++++++++++++++++++++----------------- drivers/net/pcmcia/xirc2ps_cs.c | 66 +++++++++++++++------------------ 10 files changed, 260 insertions(+), 271 deletions(-) diff -puN drivers/net/pcmcia/3c574_cs.c~remove-CardServices-from-pcmcia-net-drivers drivers/net/pcmcia/3c574_cs.c --- 25/drivers/net/pcmcia/3c574_cs.c~remove-CardServices-from-pcmcia-net-drivers 2003-12-29 23:25:59.000000000 -0800 +++ 25-akpm/drivers/net/pcmcia/3c574_cs.c 2003-12-29 23:25:59.000000000 -0800 @@ -330,7 +330,7 @@ static dev_link_t *tc574_attach(void) client_reg.event_handler = &tc574_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); tc574_detach(link); @@ -366,7 +366,7 @@ static void tc574_detach(dev_link_t *lin tc574_release(link); if (link->handle) - CardServices(DeregisterClient, link->handle); + pcmcia_deregister_client(link->handle); /* Unlink device structure, free bits */ *linkp = link->next; @@ -381,8 +381,8 @@ static void tc574_detach(dev_link_t *lin 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 tc574_config(dev_link_t *link) { @@ -403,12 +403,12 @@ static void tc574_config(dev_link_t *lin tuple.Attributes = 0; tuple.DesiredTuple = CISTPL_CONFIG; - CS_CHECK(GetFirstTuple, handle, &tuple); + CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(handle, &tuple)); tuple.TupleData = (cisdata_t *)buf; tuple.TupleDataMax = 64; tuple.TupleOffset = 0; - CS_CHECK(GetTupleData, handle, &tuple); - CS_CHECK(ParseTuple, handle, &tuple, &parse); + CS_CHECK(GetTupleData, pcmcia_get_tuple_data(handle, &tuple)); + CS_CHECK(ParseTuple, pcmcia_parse_tuple(handle, &tuple, &parse)); link->conf.ConfigBase = parse.config.base; link->conf.Present = parse.config.rmask[0]; @@ -418,15 +418,15 @@ static void tc574_config(dev_link_t *lin link->io.IOAddrLines = 16; for (i = j = 0; j < 0x400; j += 0x20) { link->io.BasePort1 = j ^ 0x300; - i = CardServices(RequestIO, link->handle, &link->io); + i = pcmcia_request_io(link->handle, &link->io); if (i == CS_SUCCESS) break; } if (i != CS_SUCCESS) { cs_error(link->handle, RequestIO, i); goto failed; } - CS_CHECK(RequestIRQ, link->handle, &link->irq); - CS_CHECK(RequestConfiguration, link->handle, &link->conf); + CS_CHECK(RequestIRQ, pcmcia_request_irq(link->handle, &link->irq)); + CS_CHECK(RequestConfiguration, pcmcia_request_configuration(link->handle, &link->conf)); dev->irq = link->irq.AssignedIRQ; dev->base_addr = link->io.BasePort1; @@ -445,8 +445,8 @@ static void tc574_config(dev_link_t *lin the hardware address. The future products may include a modem chip and put the address in the CIS. */ tuple.DesiredTuple = 0x88; - if (CardServices(GetFirstTuple, handle, &tuple) == CS_SUCCESS) { - CardServices(GetTupleData, handle, &tuple); + if (pcmcia_get_first_tuple(handle, &tuple) == CS_SUCCESS) { + pcmcia_get_tuple_data(handle, &tuple); for (i = 0; i < 3; i++) phys_addr[i] = htons(buf[i]); } else { @@ -460,9 +460,9 @@ static void tc574_config(dev_link_t *lin } } tuple.DesiredTuple = CISTPL_VERS_1; - if (CardServices(GetFirstTuple, handle, &tuple) == CS_SUCCESS && - CardServices(GetTupleData, handle, &tuple) == CS_SUCCESS && - CardServices(ParseTuple, handle, &tuple, &parse) == CS_SUCCESS) { + if (pcmcia_get_first_tuple(handle, &tuple) == CS_SUCCESS && + pcmcia_get_tuple_data(handle, &tuple) == CS_SUCCESS && + pcmcia_parse_tuple(handle, &tuple, &parse) == CS_SUCCESS) { cardname = parse.version_1.str + parse.version_1.ofs[1]; } else cardname = "3Com 3c574"; @@ -551,9 +551,9 @@ static void tc574_release(dev_link_t *li { DEBUG(0, "3c574_release(0x%p)\n", link); - 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; } @@ -592,7 +592,7 @@ static int tc574_event(event_t event, in 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: @@ -600,7 +600,7 @@ static int tc574_event(event_t event, in /* 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) { tc574_reset(dev); netif_device_attach(dev); diff -puN drivers/net/pcmcia/3c589_cs.c~remove-CardServices-from-pcmcia-net-drivers drivers/net/pcmcia/3c589_cs.c --- 25/drivers/net/pcmcia/3c589_cs.c~remove-CardServices-from-pcmcia-net-drivers 2003-12-29 23:25:59.000000000 -0800 +++ 25-akpm/drivers/net/pcmcia/3c589_cs.c 2003-12-29 23:25:59.000000000 -0800 @@ -244,7 +244,7 @@ static dev_link_t *tc589_attach(void) client_reg.event_handler = &tc589_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); tc589_detach(link); @@ -280,7 +280,7 @@ static void tc589_detach(dev_link_t *lin tc589_release(link); if (link->handle) - CardServices(DeregisterClient, link->handle); + pcmcia_deregister_client(link->handle); /* Unlink device structure, free bits */ *linkp = link->next; @@ -297,8 +297,8 @@ static void tc589_detach(dev_link_t *lin ======================================================================*/ -#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 tc589_config(dev_link_t *link) { @@ -317,20 +317,20 @@ static void tc589_config(dev_link_t *lin phys_addr = (u16 *)dev->dev_addr; tuple.Attributes = 0; tuple.DesiredTuple = CISTPL_CONFIG; - CS_CHECK(GetFirstTuple, handle, &tuple); + CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(handle, &tuple)); tuple.TupleData = (cisdata_t *)buf; tuple.TupleDataMax = sizeof(buf); tuple.TupleOffset = 0; - CS_CHECK(GetTupleData, handle, &tuple); - CS_CHECK(ParseTuple, handle, &tuple, &parse); + CS_CHECK(GetTupleData, pcmcia_get_tuple_data(handle, &tuple)); + CS_CHECK(ParseTuple, pcmcia_parse_tuple(handle, &tuple, &parse)); link->conf.ConfigBase = parse.config.base; link->conf.Present = parse.config.rmask[0]; /* Is this a 3c562? */ tuple.DesiredTuple = CISTPL_MANFID; tuple.Attributes = TUPLE_RETURN_COMMON; - if ((CardServices(GetFirstTuple, handle, &tuple) == CS_SUCCESS) && - (CardServices(GetTupleData, handle, &tuple) == CS_SUCCESS)) { + if ((pcmcia_get_first_tuple(handle, &tuple) == CS_SUCCESS) && + (pcmcia_get_tuple_data(handle, &tuple) == CS_SUCCESS)) { if (le16_to_cpu(buf[0]) != MANFID_3COM) printk(KERN_INFO "3c589_cs: hmmm, is this really a " "3Com card??\n"); @@ -345,15 +345,15 @@ static void tc589_config(dev_link_t *lin for (i = j = 0; j < 0x400; j += 0x10) { if (multi && (j & 0x80)) continue; link->io.BasePort1 = j ^ 0x300; - i = CardServices(RequestIO, link->handle, &link->io); + i = pcmcia_request_io(link->handle, &link->io); if (i == CS_SUCCESS) break; } if (i != CS_SUCCESS) { cs_error(link->handle, RequestIO, i); goto failed; } - CS_CHECK(RequestIRQ, link->handle, &link->irq); - CS_CHECK(RequestConfiguration, link->handle, &link->conf); + CS_CHECK(RequestIRQ, pcmcia_request_irq(link->handle, &link->irq)); + CS_CHECK(RequestConfiguration, pcmcia_request_configuration(link->handle, &link->conf)); dev->irq = link->irq.AssignedIRQ; dev->base_addr = link->io.BasePort1; @@ -368,8 +368,8 @@ static void tc589_config(dev_link_t *lin /* The 3c589 has an extra EEPROM for configuration info, including the hardware address. The 3c562 puts the address in the CIS. */ tuple.DesiredTuple = 0x88; - if (CardServices(GetFirstTuple, handle, &tuple) == CS_SUCCESS) { - CardServices(GetTupleData, handle, &tuple); + if (pcmcia_get_first_tuple(handle, &tuple) == CS_SUCCESS) { + pcmcia_get_tuple_data(handle, &tuple); for (i = 0; i < 3; i++) phys_addr[i] = htons(buf[i]); } else { @@ -427,9 +427,9 @@ static void tc589_release(dev_link_t *li { DEBUG(0, "3c589_release(0x%p)\n", link); - 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; } @@ -470,7 +470,7 @@ static int tc589_event(event_t event, in 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: @@ -478,7 +478,7 @@ static int tc589_event(event_t event, in /* 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) { tc589_reset(dev); netif_device_attach(dev); diff -puN drivers/net/pcmcia/axnet_cs.c~remove-CardServices-from-pcmcia-net-drivers drivers/net/pcmcia/axnet_cs.c --- 25/drivers/net/pcmcia/axnet_cs.c~remove-CardServices-from-pcmcia-net-drivers 2003-12-29 23:25:59.000000000 -0800 +++ 25-akpm/drivers/net/pcmcia/axnet_cs.c 2003-12-29 23:25:59.000000000 -0800 @@ -199,7 +199,7 @@ static dev_link_t *axnet_attach(void) client_reg.event_handler = &axnet_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 != CS_SUCCESS) { cs_error(link->handle, RegisterClient, ret); axnet_detach(link); @@ -235,7 +235,7 @@ static void axnet_detach(dev_link_t *lin axnet_release(link); if (link->handle) - CardServices(DeregisterClient, link->handle); + pcmcia_deregister_client(link->handle); /* Unlink device structure, free bits */ *linkp = link->next; @@ -301,11 +301,8 @@ static int get_prom(dev_link_t *link) ======================================================================*/ -#define CS_CHECK(fn, args...) \ -while ((last_ret=CardServices(last_fn=(fn), args))!=0) goto cs_failed - -#define CFG_CHECK(fn, args...) \ -if (CardServices(fn, args) != 0) goto next_entry +#define CS_CHECK(fn, ret) \ +do { last_fn = (fn); if ((last_ret = (ret)) != 0) goto cs_failed; } while (0) static int try_io_port(dev_link_t *link) { @@ -328,12 +325,12 @@ static int try_io_port(dev_link_t *link) for (j = 0; j < 0x400; j += 0x20) { link->io.BasePort1 = j ^ 0x300; link->io.BasePort2 = (j ^ 0x300) + 0x10; - ret = CardServices(RequestIO, link->handle, &link->io); + ret = pcmcia_request_io(link->handle, &link->io); if (ret == CS_SUCCESS) return ret; } return ret; } else { - return CardServices(RequestIO, link->handle, &link->io); + return pcmcia_request_io(link->handle, &link->io); } } @@ -355,9 +352,9 @@ static void axnet_config(dev_link_t *lin tuple.TupleDataMax = sizeof(buf); 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; /* don't trust the CIS on this; Linksys got it wrong */ link->conf.Present = 0x63; @@ -366,19 +363,19 @@ static void axnet_config(dev_link_t *lin link->state |= DEV_CONFIG; /* Look up current Vcc */ - CS_CHECK(GetConfigurationInfo, handle, &conf); + CS_CHECK(GetConfigurationInfo, pcmcia_get_configuration_info(handle, &conf)); link->conf.Vcc = conf.Vcc; tuple.DesiredTuple = CISTPL_CFTABLE_ENTRY; tuple.Attributes = 0; - CS_CHECK(GetFirstTuple, handle, &tuple); + CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(handle, &tuple)); while (last_ret == CS_SUCCESS) { cistpl_cftable_entry_t *cfg = &(parse.cftable_entry); cistpl_io_t *io = &(parse.cftable_entry.io); - CFG_CHECK(GetTupleData, handle, &tuple); - CFG_CHECK(ParseTuple, handle, &tuple, &parse); - if ((cfg->index == 0) || (cfg->io.nwin == 0)) + if (pcmcia_get_tuple_data(handle, &tuple) != 0 || + pcmcia_parse_tuple(handle, &tuple, &parse) != 0 || + cfg->index == 0 || cfg->io.nwin == 0) goto next_entry; link->conf.ConfigIndex = 0x05; @@ -399,21 +396,21 @@ static void axnet_config(dev_link_t *lin if (last_ret == CS_SUCCESS) break; } next_entry: - last_ret = CardServices(GetNextTuple, handle, &tuple); + last_ret = pcmcia_get_next_tuple(handle, &tuple); } if (last_ret != CS_SUCCESS) { cs_error(handle, RequestIO, last_ret); goto failed; } - CS_CHECK(RequestIRQ, handle, &link->irq); + CS_CHECK(RequestIRQ, pcmcia_request_irq(handle, &link->irq)); if (link->io.NumPorts2 == 8) { link->conf.Attributes |= CONF_ENABLE_SPKR; link->conf.Status = CCSR_AUDIO_ENA; } - CS_CHECK(RequestConfiguration, handle, &link->conf); + CS_CHECK(RequestConfiguration, pcmcia_request_configuration(handle, &link->conf)); dev->irq = link->irq.AssignedIRQ; dev->base_addr = link->io.BasePort1; @@ -458,7 +455,7 @@ static void axnet_config(dev_link_t *lin Bit 2 of CCSR is active low. */ if (i == 32) { conf_reg_t reg = { 0, CS_WRITE, CISREG_CCSR, 0x04 }; - CardServices(AccessConfigurationRegister, link->handle, ®); + pcmcia_access_configuration_register(link->handle, ®); for (i = 0; i < 32; i++) { j = mdio_read(dev->base_addr + AXNET_MII_EEP, i, 1); if ((j != 0) && (j != 0xffff)) break; @@ -501,9 +498,9 @@ static void axnet_release(dev_link_t *li { DEBUG(0, "axnet_release(0x%p)\n", link); - 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; } @@ -552,7 +549,7 @@ static int axnet_event(event_t event, in /* 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) { axnet_reset_8390(dev); AX88190_init(dev, 1); diff -puN drivers/net/pcmcia/com20020_cs.c~remove-CardServices-from-pcmcia-net-drivers drivers/net/pcmcia/com20020_cs.c --- 25/drivers/net/pcmcia/com20020_cs.c~remove-CardServices-from-pcmcia-net-drivers 2003-12-29 23:25:59.000000000 -0800 +++ 25-akpm/drivers/net/pcmcia/com20020_cs.c 2003-12-29 23:25:59.000000000 -0800 @@ -220,7 +220,7 @@ static dev_link_t *com20020_attach(void) client_reg.event_handler = &com20020_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); com20020_detach(link); @@ -267,7 +267,7 @@ static void com20020_detach(dev_link_t * com20020_release(link); if (link->handle) - CardServices(DeregisterClient, link->handle); + pcmcia_deregister_client(link->handle); /* Unlink device structure, free bits */ DEBUG(1,"unlinking...\n"); @@ -314,8 +314,8 @@ static void com20020_detach(dev_link_t * ======================================================================*/ -#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 com20020_config(dev_link_t *link) { @@ -342,9 +342,9 @@ static void com20020_config(dev_link_t * 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 */ @@ -357,13 +357,13 @@ static void com20020_config(dev_link_t * for (ioaddr = 0x100; ioaddr < 0x400; ioaddr += 0x10) { link->io.BasePort1 = ioaddr; - i = CardServices(RequestIO, link->handle, &link->io); + i = pcmcia_request_io(link->handle, &link->io); if (i == CS_SUCCESS) break; } } else - i = CardServices(RequestIO, link->handle, &link->io); + i = pcmcia_request_io(link->handle, &link->io); if (i != CS_SUCCESS) { @@ -377,7 +377,7 @@ static void com20020_config(dev_link_t * DEBUG(1,"arcnet: request IRQ %d (%Xh/%Xh)\n", link->irq.AssignedIRQ, link->irq.IRQInfo1, link->irq.IRQInfo2); - i = CardServices(RequestIRQ, link->handle, &link->irq); + i = pcmcia_request_irq(link->handle, &link->irq); if (i != CS_SUCCESS) { DEBUG(1,"arcnet: requestIRQ failed totally!\n"); @@ -386,7 +386,7 @@ static void com20020_config(dev_link_t * dev->irq = link->irq.AssignedIRQ; - CS_CHECK(RequestConfiguration, link->handle, &link->conf); + CS_CHECK(RequestConfiguration, pcmcia_request_configuration(link->handle, &link->conf)); if (com20020_check(dev)) { @@ -436,9 +436,9 @@ static void com20020_release(dev_link_t DEBUG(0, "com20020_release(0x%p)\n", link); - 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 | DEV_RELEASE_PENDING); } @@ -481,7 +481,7 @@ static int com20020_event(event_t event, if (link->open) { netif_device_detach(dev); } - CardServices(ReleaseConfiguration, link->handle); + pcmcia_release_configuration(link->handle); } break; case CS_EVENT_PM_RESUME: @@ -489,7 +489,7 @@ static int com20020_event(event_t event, /* 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) { int ioaddr = dev->base_addr; struct arcnet_local *lp = (struct arcnet_local *)dev->priv; diff -puN drivers/net/pcmcia/fmvj18x_cs.c~remove-CardServices-from-pcmcia-net-drivers drivers/net/pcmcia/fmvj18x_cs.c --- 25/drivers/net/pcmcia/fmvj18x_cs.c~remove-CardServices-from-pcmcia-net-drivers 2003-12-29 23:25:59.000000000 -0800 +++ 25-akpm/drivers/net/pcmcia/fmvj18x_cs.c 2003-12-29 23:25:59.000000000 -0800 @@ -307,7 +307,7 @@ static dev_link_t *fmvj18x_attach(void) client_reg.event_handler = &fmvj18x_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); fmvj18x_detach(link); @@ -337,7 +337,7 @@ static void fmvj18x_detach(dev_link_t *l /* Break the link with Card Services */ if (link->handle) - CardServices(DeregisterClient, link->handle); + pcmcia_deregister_client(link->handle); /* Unlink device structure, free pieces */ *linkp = link->next; @@ -348,8 +348,8 @@ static void fmvj18x_detach(dev_link_t *l /*====================================================================*/ -#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 int mfc_try_io_port(dev_link_t *link) { @@ -363,7 +363,7 @@ static int mfc_try_io_port(dev_link_t *l link->io.NumPorts2 = 0; printk(KERN_NOTICE "fmvj18x_cs: out of resource for serial\n"); } - ret = CardServices(RequestIO, link->handle, &link->io); + ret = pcmcia_request_io(link->handle, &link->io); if (ret == CS_SUCCESS) return ret; } return ret; @@ -379,7 +379,7 @@ static int ungermann_try_io_port(dev_lin */ for (ioaddr = 0x300; ioaddr < 0x3e0; ioaddr += 0x20) { link->io.BasePort1 = ioaddr; - ret = CardServices(RequestIO, link->handle, &link->io); + ret = pcmcia_request_io(link->handle, &link->io); if (ret == CS_SUCCESS) { /* calculate ConfigIndex value */ link->conf.ConfigIndex = @@ -411,12 +411,12 @@ static void fmvj18x_config(dev_link_t *l registers. */ tuple.DesiredTuple = CISTPL_CONFIG; - CS_CHECK(GetFirstTuple, handle, &tuple); + CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(handle, &tuple)); tuple.TupleData = (u_char *)buf; tuple.TupleDataMax = 64; tuple.TupleOffset = 0; - CS_CHECK(GetTupleData, handle, &tuple); - CS_CHECK(ParseTuple, handle, &tuple, &parse); + CS_CHECK(GetTupleData, pcmcia_get_tuple_data(handle, &tuple)); + CS_CHECK(ParseTuple, pcmcia_parse_tuple(handle, &tuple, &parse)); /* Configure card */ link->state |= DEV_CONFIG; @@ -426,16 +426,16 @@ static void fmvj18x_config(dev_link_t *l tuple.DesiredTuple = CISTPL_FUNCE; tuple.TupleOffset = 0; - if (CardServices(GetFirstTuple, handle, &tuple) == CS_SUCCESS) { + if (pcmcia_get_first_tuple(handle, &tuple) == CS_SUCCESS) { /* Yes, I have CISTPL_FUNCE. Let's check CISTPL_MANFID */ tuple.DesiredTuple = CISTPL_CFTABLE_ENTRY; - 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.ConfigIndex = parse.cftable_entry.index; tuple.DesiredTuple = CISTPL_MANFID; - if (CardServices(GetFirstTuple, handle, &tuple) == CS_SUCCESS) - CS_CHECK(GetTupleData, handle, &tuple); + if (pcmcia_get_first_tuple(handle, &tuple) == CS_SUCCESS) + CS_CHECK(GetTupleData, pcmcia_get_tuple_data(handle, &tuple)); else buf[0] = 0xffff; switch (le16_to_cpu(buf[0])) { @@ -443,7 +443,7 @@ static void fmvj18x_config(dev_link_t *l cardtype = TDK; if (le16_to_cpu(buf[1]) == PRODID_TDK_CF010) { cs_status_t status; - CardServices(GetStatus, handle, &status); + pcmcia_get_status(handle, &status); if (status.CardState & CS_EVENT_3VCARD) link->conf.Vcc = 33; /* inserted in 3.3V slot */ } else if (le16_to_cpu(buf[1]) == PRODID_TDK_GN3410) { @@ -472,8 +472,8 @@ static void fmvj18x_config(dev_link_t *l } else { /* old type card */ tuple.DesiredTuple = CISTPL_MANFID; - if (CardServices(GetFirstTuple, handle, &tuple) == CS_SUCCESS) - CS_CHECK(GetTupleData, handle, &tuple); + if (pcmcia_get_first_tuple(handle, &tuple) == CS_SUCCESS) + CS_CHECK(GetTupleData, pcmcia_get_tuple_data(handle, &tuple)); else buf[0] = 0xffff; switch (le16_to_cpu(buf[0])) { @@ -504,10 +504,10 @@ static void fmvj18x_config(dev_link_t *l ret = ungermann_try_io_port(link); if (ret != CS_SUCCESS) goto cs_failed; } else { - CS_CHECK(RequestIO, link->handle, &link->io); + CS_CHECK(RequestIO, pcmcia_request_io(link->handle, &link->io)); } - CS_CHECK(RequestIRQ, link->handle, &link->irq); - CS_CHECK(RequestConfiguration, link->handle, &link->conf); + CS_CHECK(RequestIRQ, pcmcia_request_irq(link->handle, &link->irq)); + CS_CHECK(RequestConfiguration, pcmcia_request_configuration(link->handle, &link->conf)); dev->irq = link->irq.AssignedIRQ; dev->base_addr = link->io.BasePort1; if (register_netdev(dev) != 0) { @@ -540,17 +540,17 @@ static void fmvj18x_config(dev_link_t *l case CONTEC: tuple.DesiredTuple = CISTPL_FUNCE; tuple.TupleOffset = 0; - CS_CHECK(GetFirstTuple, handle, &tuple); + CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(handle, &tuple)); tuple.TupleOffset = 0; - CS_CHECK(GetTupleData, handle, &tuple); + CS_CHECK(GetTupleData, pcmcia_get_tuple_data(handle, &tuple)); if (cardtype == MBH10304) { /* MBH10304's CIS_FUNCE is corrupted */ node_id = &(tuple.TupleData[5]); card_name = "FMV-J182"; } else { while (tuple.TupleData[0] != CISTPL_FUNCE_LAN_NODE_ID ) { - CS_CHECK(GetNextTuple, handle, &tuple) ; - CS_CHECK(GetTupleData, handle, &tuple) ; + CS_CHECK(GetNextTuple, pcmcia_get_next_tuple(handle, &tuple)); + CS_CHECK(GetTupleData, pcmcia_get_tuple_data(handle, &tuple)); } node_id = &(tuple.TupleData[2]); if( cardtype == TDK ) { @@ -627,8 +627,7 @@ static int fmvj18x_get_hwinfo(dev_link_t req.Attributes = WIN_DATA_WIDTH_8|WIN_MEMORY_TYPE_AM|WIN_ENABLE; req.Base = 0; req.Size = 0; req.AccessSpeed = 0; - link->win = (window_handle_t)link->handle; - i = CardServices(RequestWindow, &link->win, &req); + i = pcmcia_request_window(&link->handle, &req, &link->win); if (i != CS_SUCCESS) { cs_error(link->handle, RequestWindow, i); return -1; @@ -637,7 +636,7 @@ static int fmvj18x_get_hwinfo(dev_link_t base = ioremap(req.Base, req.Size); mem.Page = 0; mem.CardOffset = 0; - CardServices(MapMemPage, link->win, &mem); + pcmcia_map_mem_page(link->win, &mem); /* * MBH10304 CISTPL_FUNCE_LAN_NODE_ID format @@ -662,7 +661,7 @@ static int fmvj18x_get_hwinfo(dev_link_t } iounmap(base); - j = CardServices(ReleaseWindow, link->win); + j = pcmcia_release_window(link->win); if (j != CS_SUCCESS) cs_error(link->handle, ReleaseWindow, j); return (i != 0x200) ? 0 : -1; @@ -683,8 +682,7 @@ static int fmvj18x_setup_mfc(dev_link_t req.Attributes = WIN_DATA_WIDTH_8|WIN_MEMORY_TYPE_AM|WIN_ENABLE; req.Base = 0; req.Size = 0; req.AccessSpeed = 0; - link->win = (window_handle_t)link->handle; - i = CardServices(RequestWindow, &link->win, &req); + i = pcmcia_request_window(&link->handle, &req, &link->win); if (i != CS_SUCCESS) { cs_error(link->handle, RequestWindow, i); return -1; @@ -693,7 +691,7 @@ static int fmvj18x_setup_mfc(dev_link_t base = ioremap(req.Base, req.Size); mem.Page = 0; mem.CardOffset = 0; - CardServices(MapMemPage, link->win, &mem); + pcmcia_map_mem_page(link->win, &mem); ioaddr = dev->base_addr; writeb(0x47, base+0x800); /* Config Option Register of LAN */ @@ -706,7 +704,7 @@ static int fmvj18x_setup_mfc(dev_link_t writeb(0x8, base+0x822); /* Config and Status Register */ iounmap(base); - j = CardServices(ReleaseWindow, link->win); + j = pcmcia_release_window(link->win); if (j != CS_SUCCESS) cs_error(link->handle, ReleaseWindow, j); return 0; @@ -720,10 +718,10 @@ static void fmvj18x_release(dev_link_t * DEBUG(0, "fmvj18x_release(0x%p)\n", link); /* Don't bother checking to see if these succeed or not */ - CardServices(ReleaseWindow, link->win); - CardServices(ReleaseConfiguration, link->handle); - CardServices(ReleaseIO, link->handle, &link->io); - CardServices(ReleaseIRQ, link->handle, &link->irq); + pcmcia_release_window(link->win); + pcmcia_release_configuration(link->handle); + pcmcia_release_io(link->handle, &link->io); + pcmcia_release_irq(link->handle, &link->irq); link->state &= ~DEV_CONFIG; } @@ -757,7 +755,7 @@ static int fmvj18x_event(event_t event, 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: @@ -765,7 +763,7 @@ static int fmvj18x_event(event_t event, /* 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) { fjn_reset(dev); netif_device_attach(dev); diff -puN drivers/net/pcmcia/ibmtr_cs.c~remove-CardServices-from-pcmcia-net-drivers drivers/net/pcmcia/ibmtr_cs.c --- 25/drivers/net/pcmcia/ibmtr_cs.c~remove-CardServices-from-pcmcia-net-drivers 2003-12-29 23:25:59.000000000 -0800 +++ 25-akpm/drivers/net/pcmcia/ibmtr_cs.c 2003-12-29 23:25:59.000000000 -0800 @@ -212,7 +212,7 @@ static dev_link_t *ibmtr_attach(void) 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; @@ -263,7 +263,7 @@ static void ibmtr_detach(dev_link_t *lin ibmtr_release(link); if (link->handle) - CardServices(DeregisterClient, link->handle); + pcmcia_deregister_client(link->handle); /* Unlink device structure, free bits */ *linkp = link->next; @@ -279,8 +279,8 @@ static void ibmtr_detach(dev_link_t *lin ======================================================================*/ -#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) { @@ -302,9 +302,9 @@ static void ibmtr_config(dev_link_t *lin 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 */ @@ -316,18 +316,18 @@ static void ibmtr_config(dev_link_t *lin /* 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); @@ -338,12 +338,11 @@ static void ibmtr_config(dev_link_t *lin 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 */ @@ -352,17 +351,16 @@ static void ibmtr_config(dev_link_t *lin 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 @@ -410,14 +408,14 @@ static void ibmtr_release(dev_link_t *li DEBUG(0, "ibmtr_release(0x%p)\n", link); - 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; @@ -462,7 +460,7 @@ static int ibmtr_event(event_t event, in 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: @@ -470,7 +468,7 @@ static int ibmtr_event(event_t event, in /* 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) { ibmtr_probe(dev); /* really? */ netif_device_attach(dev); diff -puN drivers/net/pcmcia/nmclan_cs.c~remove-CardServices-from-pcmcia-net-drivers drivers/net/pcmcia/nmclan_cs.c --- 25/drivers/net/pcmcia/nmclan_cs.c~remove-CardServices-from-pcmcia-net-drivers 2003-12-29 23:25:59.000000000 -0800 +++ 25-akpm/drivers/net/pcmcia/nmclan_cs.c 2003-12-29 23:25:59.000000000 -0800 @@ -520,7 +520,7 @@ static dev_link_t *nmclan_attach(void) 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); @@ -555,7 +555,7 @@ static void nmclan_detach(dev_link_t *li nmclan_release(link); if (link->handle) - CardServices(DeregisterClient, link->handle); + pcmcia_deregister_client(link->handle); /* Unlink device structure, free bits */ *linkp = link->next; @@ -700,8 +700,8 @@ nmclan_config 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) { @@ -721,17 +721,17 @@ static void nmclan_config(dev_link_t *li 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); @@ -747,8 +747,8 @@ static void nmclan_config(dev_link_t *li 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. */ @@ -806,9 +806,9 @@ static void nmclan_release(dev_link_t *l DEBUG(0, "nmclan_release(0x%p)\n", link); - 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; } @@ -847,7 +847,7 @@ static int nmclan_event(event_t event, i 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: @@ -855,7 +855,7 @@ static int nmclan_event(event_t event, i /* 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); @@ -887,7 +887,7 @@ static void nmclan_reset(struct net_devi 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 */ @@ -896,12 +896,12 @@ static void nmclan_reset(struct net_devi 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; @@ -1028,7 +1028,7 @@ static void mace_tx_timeout(struct net_d 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 */ diff -puN drivers/net/pcmcia/pcnet_cs.c~remove-CardServices-from-pcmcia-net-drivers drivers/net/pcmcia/pcnet_cs.c --- 25/drivers/net/pcmcia/pcnet_cs.c~remove-CardServices-from-pcmcia-net-drivers 2003-12-29 23:25:59.000000000 -0800 +++ 25-akpm/drivers/net/pcmcia/pcnet_cs.c 2003-12-29 23:25:59.000000000 -0800 @@ -294,7 +294,7 @@ static dev_link_t *pcnet_attach(void) client_reg.event_handler = &pcnet_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 != CS_SUCCESS) { cs_error(link->handle, RegisterClient, ret); pcnet_detach(link); @@ -330,7 +330,7 @@ static void pcnet_detach(dev_link_t *lin pcnet_release(link); if (link->handle) - CardServices(DeregisterClient, link->handle); + pcmcia_deregister_client(link->handle); /* Unlink device structure, free bits */ *linkp = link->next; @@ -358,8 +358,7 @@ static hw_info_t *get_hwinfo(dev_link_t req.Attributes = WIN_DATA_WIDTH_8|WIN_MEMORY_TYPE_AM|WIN_ENABLE; req.Base = 0; req.Size = 0; req.AccessSpeed = 0; - link->win = (window_handle_t)link->handle; - i = CardServices(RequestWindow, &link->win, &req); + i = pcmcia_request_window(&link->handle, &req, &link->win); if (i != CS_SUCCESS) { cs_error(link->handle, RequestWindow, i); return NULL; @@ -369,7 +368,7 @@ static hw_info_t *get_hwinfo(dev_link_t mem.Page = 0; for (i = 0; i < NR_INFO; i++) { mem.CardOffset = hw_info[i].offset & ~(req.Size-1); - CardServices(MapMemPage, link->win, &mem); + pcmcia_map_mem_page(link->win, &mem); base = &virt[hw_info[i].offset & (req.Size-1)]; if ((readb(base+0) == hw_info[i].a0) && (readb(base+2) == hw_info[i].a1) && @@ -382,7 +381,7 @@ static hw_info_t *get_hwinfo(dev_link_t } iounmap(virt); - j = CardServices(ReleaseWindow, link->win); + j = pcmcia_release_window(link->win); if (j != CS_SUCCESS) cs_error(link->handle, ReleaseWindow, j); return (i < NR_INFO) ? hw_info+i : NULL; @@ -529,11 +528,8 @@ static hw_info_t *get_hwired(dev_link_t ======================================================================*/ -#define CS_CHECK(fn, args...) \ -while ((last_ret=CardServices(last_fn=(fn), args))!=0) goto cs_failed - -#define CFG_CHECK(fn, args...) \ -if (CardServices(fn, args) != 0) goto next_entry +#define CS_CHECK(fn, ret) \ +do { last_fn = (fn); if ((last_ret = (ret)) != 0) goto cs_failed; } while (0) static int try_io_port(dev_link_t *link) { @@ -556,12 +552,12 @@ static int try_io_port(dev_link_t *link) for (j = 0; j < 0x400; j += 0x20) { link->io.BasePort1 = j ^ 0x300; link->io.BasePort2 = (j ^ 0x300) + 0x10; - ret = CardServices(RequestIO, link->handle, &link->io); + ret = pcmcia_request_io(link->handle, &link->io); if (ret == CS_SUCCESS) return ret; } return ret; } else { - return CardServices(RequestIO, link->handle, &link->io); + return pcmcia_request_io(link->handle, &link->io); } } @@ -585,9 +581,9 @@ static void pcnet_config(dev_link_t *lin tuple.TupleDataMax = sizeof(buf); 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; link->conf.Present = parse.config.rmask[0]; @@ -595,28 +591,28 @@ static void pcnet_config(dev_link_t *lin link->state |= DEV_CONFIG; /* Look up current Vcc */ - CS_CHECK(GetConfigurationInfo, handle, &conf); + CS_CHECK(GetConfigurationInfo, pcmcia_get_configuration_info(handle, &conf)); link->conf.Vcc = conf.Vcc; tuple.DesiredTuple = CISTPL_MANFID; tuple.Attributes = TUPLE_RETURN_COMMON; - if ((CardServices(GetFirstTuple, handle, &tuple) == CS_SUCCESS) && - (CardServices(GetTupleData, handle, &tuple) == CS_SUCCESS)) { + if ((pcmcia_get_first_tuple(handle, &tuple) == CS_SUCCESS) && + (pcmcia_get_tuple_data(handle, &tuple) == CS_SUCCESS)) { manfid = le16_to_cpu(buf[0]); prodid = le16_to_cpu(buf[1]); } tuple.DesiredTuple = CISTPL_CFTABLE_ENTRY; tuple.Attributes = 0; - CS_CHECK(GetFirstTuple, handle, &tuple); + CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(handle, &tuple)); while (last_ret == CS_SUCCESS) { cistpl_cftable_entry_t *cfg = &(parse.cftable_entry); cistpl_io_t *io = &(parse.cftable_entry.io); - CFG_CHECK(GetTupleData, handle, &tuple); - CFG_CHECK(ParseTuple, handle, &tuple, &parse); - if ((cfg->index == 0) || (cfg->io.nwin == 0)) - goto next_entry; + if (pcmcia_get_tuple_data(handle, &tuple) != 0 || + pcmcia_parse_tuple(handle, &tuple, &parse) != 0 || + cfg->index == 0 || cfg->io.nwin == 0) + goto next_entry; link->conf.ConfigIndex = cfg->index; /* For multifunction cards, by convention, we configure the @@ -638,14 +634,14 @@ static void pcnet_config(dev_link_t *lin if (last_ret == CS_SUCCESS) break; } next_entry: - last_ret = CardServices(GetNextTuple, handle, &tuple); + last_ret = pcmcia_get_next_tuple(handle, &tuple); } if (last_ret != CS_SUCCESS) { cs_error(handle, RequestIO, last_ret); goto failed; } - CS_CHECK(RequestIRQ, handle, &link->irq); + CS_CHECK(RequestIRQ, pcmcia_request_irq(handle, &link->irq)); if (link->io.NumPorts2 == 8) { link->conf.Attributes |= CONF_ENABLE_SPKR; @@ -655,7 +651,7 @@ static void pcnet_config(dev_link_t *lin (prodid == PRODID_IBM_HOME_AND_AWAY)) link->conf.ConfigIndex |= 0x10; - CS_CHECK(RequestConfiguration, handle, &link->conf); + CS_CHECK(RequestConfiguration, pcmcia_request_configuration(handle, &link->conf)); dev->irq = link->irq.AssignedIRQ; dev->base_addr = link->io.BasePort1; if (info->flags & HAS_MISC_REG) { @@ -777,11 +773,11 @@ static void pcnet_release(dev_link_t *li if (info->flags & USE_SHMEM) { iounmap(info->base); - CardServices(ReleaseWindow, link->win); + pcmcia_release_window(link->win); } - 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; } @@ -822,7 +818,7 @@ static int pcnet_event(event_t event, in 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: @@ -830,7 +826,7 @@ static int pcnet_event(event_t event, in /* 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) { pcnet_reset_8390(dev); NS8390_init(dev, 1); @@ -1594,14 +1590,13 @@ static int setup_shmem_window(dev_link_t req.Attributes |= WIN_USE_WAIT; req.Base = 0; req.Size = window_size; req.AccessSpeed = mem_speed; - 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 = (start_pg << 8) + cm_offset; offset = mem.CardOffset % window_size; mem.CardOffset -= offset; mem.Page = 0; - CS_CHECK(MapMemPage, link->win, &mem); + CS_CHECK(MapMemPage, pcmcia_map_mem_page(link->win, &mem)); /* Try scribbling on the buffer */ info->base = ioremap(req.Base, window_size); @@ -1613,7 +1608,7 @@ static int setup_shmem_window(dev_link_t pcnet_reset_8390(dev); if (i != (TX_PAGES<<8)) { iounmap(info->base); - CardServices(ReleaseWindow, link->win); + pcmcia_release_window(link->win); info->base = NULL; link->win = NULL; goto failed; } diff -puN drivers/net/pcmcia/smc91c92_cs.c~remove-CardServices-from-pcmcia-net-drivers drivers/net/pcmcia/smc91c92_cs.c --- 25/drivers/net/pcmcia/smc91c92_cs.c~remove-CardServices-from-pcmcia-net-drivers 2003-12-29 23:25:59.000000000 -0800 +++ 25-akpm/drivers/net/pcmcia/smc91c92_cs.c 2003-12-29 23:25:59.000000000 -0800 @@ -379,7 +379,7 @@ static dev_link_t *smc91c92_attach(void) client_reg.event_handler = &smc91c92_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); smc91c92_detach(link); @@ -415,7 +415,7 @@ static void smc91c92_detach(dev_link_t * smc91c92_release(link); if (link->handle) - CardServices(DeregisterClient, link->handle); + pcmcia_deregister_client(link->handle); /* Unlink device structure, free bits */ *linkp = link->next; @@ -447,19 +447,27 @@ static int cvt_ascii_address(struct net_ /*====================================================================*/ -static int get_tuple(int fn, client_handle_t handle, tuple_t *tuple, - cisparse_t *parse) +static int first_tuple(client_handle_t handle, tuple_t *tuple, + cisparse_t *parse) { - int i; - i = CardServices(fn, handle, tuple); - if (i != CS_SUCCESS) return i; - i = CardServices(GetTupleData, handle, tuple); - if (i != CS_SUCCESS) return i; - return CardServices(ParseTuple, handle, tuple, parse); + int i; + + if ((i = pcmcia_get_first_tuple(handle, tuple)) != CS_SUCCESS || + (i = pcmcia_get_tuple_data(handle, tuple)) != CS_SUCCESS) + return i; + return pcmcia_parse_tuple(handle, tuple, parse); } -#define first_tuple(a, b, c) get_tuple(GetFirstTuple, a, b, c) -#define next_tuple(a, b, c) get_tuple(GetNextTuple, a, b, c) +static int next_tuple(client_handle_t handle, tuple_t *tuple, + cisparse_t *parse) +{ + int i; + + if ((i = pcmcia_get_next_tuple(handle, tuple)) != CS_SUCCESS || + (i = pcmcia_get_tuple_data(handle, tuple)) != CS_SUCCESS) + return i; + return pcmcia_parse_tuple(handle, tuple, parse); +} /*====================================================================== @@ -528,7 +536,7 @@ static int mhz_mfc_config(dev_link_t *li for (k = 0; k < 0x400; k += 0x10) { if (k & 0x80) continue; link->io.BasePort1 = k ^ 0x300; - i = CardServices(RequestIO, link->handle, &link->io); + i = pcmcia_request_io(link->handle, &link->io); if (i == CS_SUCCESS) break; } if (i == CS_SUCCESS) break; @@ -542,15 +550,14 @@ static int mhz_mfc_config(dev_link_t *li req.Attributes = WIN_DATA_WIDTH_8|WIN_MEMORY_TYPE_AM|WIN_ENABLE; req.Base = req.Size = 0; req.AccessSpeed = 0; - link->win = (window_handle_t)link->handle; - i = CardServices(RequestWindow, &link->win, &req); + i = pcmcia_request_window(&link->handle, &req, &link->win); if (i != CS_SUCCESS) return i; smc->base = ioremap(req.Base, req.Size); mem.CardOffset = mem.Page = 0; if (smc->manfid == MANFID_MOTOROLA) mem.CardOffset = link->conf.ConfigBase; - i = CardServices(MapMemPage, link->win, &mem); + i = pcmcia_map_mem_page(link->win, &mem); if ((i == CS_SUCCESS) && (smc->manfid == MANFID_MEGAHERTZ) @@ -588,9 +595,9 @@ static int mhz_setup(dev_link_t *link) /* Another possibility: for the EM3288, in a special tuple */ tuple.DesiredTuple = 0x81; - if (CardServices(GetFirstTuple, handle, &tuple) != CS_SUCCESS) + if (pcmcia_get_first_tuple(handle, &tuple) != CS_SUCCESS) return -1; - if (CardServices(GetTupleData, handle, &tuple) != CS_SUCCESS) + if (pcmcia_get_tuple_data(handle, &tuple) != CS_SUCCESS) return -1; buf[12] = '\0'; if (cvt_ascii_address(dev, buf) == 0) @@ -684,7 +691,7 @@ static int smc_config(dev_link_t *link) link->conf.ConfigIndex = cf->index; link->io.BasePort1 = cf->io.win[0].base; link->io.IOAddrLines = cf->io.flags & CISTPL_IO_LINES_MASK; - i = CardServices(RequestIO, link->handle, &link->io); + i = pcmcia_request_io(link->handle, &link->io); if (i == CS_SUCCESS) break; } i = next_tuple(link->handle, &tuple, &parse); @@ -757,14 +764,14 @@ static int osi_config(dev_link_t *link) for (i = j = 0; j < 4; j++) { link->io.BasePort2 = com[j]; - i = CardServices(RequestIO, link->handle, &link->io); + i = pcmcia_request_io(link->handle, &link->io); if (i == CS_SUCCESS) break; } if (i != CS_SUCCESS) { /* Fallback: turn off hard decode */ link->conf.ConfigIndex = 0x03; link->io.NumPorts2 = 0; - i = CardServices(RequestIO, link->handle, &link->io); + i = pcmcia_request_io(link->handle, &link->io); } dev->base_addr = link->io.BasePort1 + 0x10; return i; @@ -785,12 +792,12 @@ static int osi_setup(dev_link_t *link, u /* Read the station address from tuple 0x90, subtuple 0x04 */ tuple.DesiredTuple = 0x90; - i = CardServices(GetFirstTuple, handle, &tuple); + i = pcmcia_get_first_tuple(handle, &tuple); while (i == CS_SUCCESS) { - i = CardServices(GetTupleData, handle, &tuple); + i = pcmcia_get_tuple_data(handle, &tuple); if ((i != CS_SUCCESS) || (buf[0] == 0x04)) break; - i = CardServices(GetNextTuple, handle, &tuple); + i = pcmcia_get_next_tuple(handle, &tuple); } if (i != CS_SUCCESS) return -1; @@ -863,9 +870,9 @@ static int check_sig(dev_link_t *link) printk(KERN_INFO "smc91c92_cs: using 8-bit IO window.\n"); args.client_data = link; smc91c92_event(CS_EVENT_RESET_PHYSICAL, 0, &args); - CardServices(ReleaseIO, link->handle, &link->io); + pcmcia_release_io(link->handle, &link->io); link->io.Attributes1 = IO_DATA_PATH_WIDTH_8; - CardServices(RequestIO, link->handle, &link->io); + pcmcia_request_io(link->handle, &link->io); smc91c92_event(CS_EVENT_CARD_RESET, 0, &args); return check_sig(link); } @@ -930,9 +937,9 @@ static void smc91c92_config(dev_link_t * } CS_EXIT_TEST(i, RequestIO, config_failed); - i = CardServices(RequestIRQ, link->handle, &link->irq); + i = pcmcia_request_irq(link->handle, &link->irq); CS_EXIT_TEST(i, RequestIRQ, config_failed); - i = CardServices(RequestConfiguration, link->handle, &link->conf); + i = pcmcia_request_configuration(link->handle, &link->conf); CS_EXIT_TEST(i, RequestConfiguration, config_failed); if (smc->manfid == MANFID_MOTOROLA) @@ -1057,14 +1064,14 @@ static void smc91c92_release(dev_link_t DEBUG(0, "smc91c92_release(0x%p)\n", link); - 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 net_device *dev = link->priv; struct smc_private *smc = dev->priv; iounmap(smc->base); - CardServices(ReleaseWindow, link->win); + pcmcia_release_window(link->win); } link->state &= ~DEV_CONFIG; @@ -1108,7 +1115,7 @@ static int smc91c92_event(event_t event, 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: @@ -1119,7 +1126,7 @@ static int smc91c92_event(event_t event, if ((smc->manfid == MANFID_MEGAHERTZ) && (smc->cardid == PRODID_MEGAHERTZ_EM3288)) mhz_3288_power(link); - CardServices(RequestConfiguration, link->handle, &link->conf); + pcmcia_request_configuration(link->handle, &link->conf); if (smc->manfid == MANFID_MOTOROLA) mot_config(link); if ((smc->manfid == MANFID_OSITECH) && diff -puN drivers/net/pcmcia/xirc2ps_cs.c~remove-CardServices-from-pcmcia-net-drivers drivers/net/pcmcia/xirc2ps_cs.c --- 25/drivers/net/pcmcia/xirc2ps_cs.c~remove-CardServices-from-pcmcia-net-drivers 2003-12-29 23:25:59.000000000 -0800 +++ 25-akpm/drivers/net/pcmcia/xirc2ps_cs.c 2003-12-29 23:25:59.000000000 -0800 @@ -391,28 +391,27 @@ static int do_stop(struct net_device *de /*=============== Helper functions =========================*/ static int -get_tuple_data(int fn, client_handle_t handle, tuple_t *tuple) +first_tuple(client_handle_t handle, tuple_t *tuple, cisparse_t *parse) { - int err; + int err; - if ((err=CardServices(fn, handle, tuple))) + if ((err = pcmcia_get_first_tuple(handle, tuple)) == 0 && + (err = pcmcia_get_tuple_data(handle, tuple)) == 0) + err = pcmcia_parse_tuple(handle, tuple, parse); return err; - return CardServices(GetTupleData, handle, tuple); } static int -get_tuple(int fn, client_handle_t handle, tuple_t *tuple, cisparse_t *parse) +next_tuple(client_handle_t handle, tuple_t *tuple, cisparse_t *parse) { - int err; + int err; - if ((err=get_tuple_data(fn, handle, tuple))) + if ((err = pcmcia_get_next_tuple(handle, tuple)) == 0 && + (err = pcmcia_get_tuple_data(handle, tuple)) == 0) + err = pcmcia_parse_tuple(handle, tuple, parse); return err; - return CardServices(ParseTuple, handle, tuple, parse); } -#define first_tuple(a, b, c) get_tuple(GetFirstTuple, a, b, c) -#define next_tuple(a, b, c) get_tuple(GetNextTuple, a, b, c) - #define SelectPage(pgnr) outb((pgnr), ioaddr + XIRCREG_PR) #define GetByte(reg) ((unsigned)inb(ioaddr + (reg))) #define GetWord(reg) ((unsigned)inw(ioaddr + (reg))) @@ -636,7 +635,7 @@ xirc2ps_attach(void) client_reg.event_handler = &xirc2ps_event; client_reg.Version = 0x0210; client_reg.event_callback_args.client_data = link; - if ((err = CardServices(RegisterClient, &link->handle, &client_reg))) { + if ((err = pcmcia_register_client(&link->handle, &client_reg))) { cs_error(link->handle, RegisterClient, err); xirc2ps_detach(link); return NULL; @@ -680,7 +679,7 @@ xirc2ps_detach(dev_link_t * link) /* Break the link with Card Services */ if (link->handle) - CardServices(DeregisterClient, link->handle); + pcmcia_deregister_client(link->handle); /* Unlink device structure, free it */ *linkp = link->next; @@ -884,7 +883,8 @@ xirc2ps_config(dev_link_t * link) } if (err) { /* not found: try to get the node-id from tuple 0x89 */ tuple.DesiredTuple = 0x89; /* data layout looks like tuple 0x22 */ - if (!(err = get_tuple_data(GetFirstTuple, handle, &tuple))) { + if ((err = pcmcia_get_first_tuple(handle, &tuple)) == 0 && + (err = pcmcia_get_tuple_data(handle, &tuple)) == 0) { if (tuple.TupleDataLen == 8 && *buf == CISTPL_FUNCE_LAN_NODE_ID) memcpy(&parse, buf, 8); else @@ -950,8 +950,7 @@ xirc2ps_config(dev_link_t * link) link->conf.ConfigIndex = cf->index ; link->io.BasePort2 = cf->io.win[0].base; link->io.BasePort1 = ioaddr; - if (!(err=CardServices(RequestIO, link->handle, - &link->io))) + if (!(err=pcmcia_request_io(link->handle, &link->io))) goto port_found; } } @@ -973,8 +972,7 @@ xirc2ps_config(dev_link_t * link) link->io.BasePort1 = link->io.BasePort2 + (pass ? (cf->index & 0x20 ? -24:8) : (cf->index & 0x20 ? 8:-24)); - if (!(err=CardServices(RequestIO, link->handle, - &link->io))) + if (!(err=pcmcia_request_io(link->handle, &link->io))) goto port_found; } } @@ -989,11 +987,11 @@ xirc2ps_config(dev_link_t * link) link->io.NumPorts1 = 16; for (ioaddr = 0x300; ioaddr < 0x400; ioaddr += 0x10) { link->io.BasePort1 = ioaddr; - if (!(err=CardServices(RequestIO, link->handle, &link->io))) + if (!(err=pcmcia_request_io(link->handle, &link->io))) goto port_found; } link->io.BasePort1 = 0; /* let CS decide */ - if ((err=CardServices(RequestIO, link->handle, &link->io))) { + if ((err=pcmcia_request_io(link->handle, &link->io))) { cs_error(link->handle, RequestIO, err); goto config_error; } @@ -1006,7 +1004,7 @@ xirc2ps_config(dev_link_t * link) * Now allocate an interrupt line. Note that this does not * actually assign a handler to the interrupt. */ - if ((err=CardServices(RequestIRQ, link->handle, &link->irq))) { + if ((err=pcmcia_request_irq(link->handle, &link->irq))) { cs_error(link->handle, RequestIRQ, err); goto config_error; } @@ -1015,8 +1013,7 @@ xirc2ps_config(dev_link_t * link) * This actually configures the PCMCIA socket -- setting up * the I/O windows and the interrupt mapping. */ - if ((err=CardServices(RequestConfiguration, - link->handle, &link->conf))) { + if ((err=pcmcia_request_configuration(link->handle, &link->conf))) { cs_error(link->handle, RequestConfiguration, err); goto config_error; } @@ -1034,16 +1031,14 @@ xirc2ps_config(dev_link_t * link) reg.Action = CS_WRITE; reg.Offset = CISREG_IOBASE_0; reg.Value = link->io.BasePort2 & 0xff; - if ((err = CardServices(AccessConfigurationRegister, link->handle, - ®))) { + if ((err = pcmcia_access_configuration_register(link->handle, ®))) { cs_error(link->handle, AccessConfigurationRegister, err); goto config_error; } reg.Action = CS_WRITE; reg.Offset = CISREG_IOBASE_1; reg.Value = (link->io.BasePort2 >> 8) & 0xff; - if ((err = CardServices(AccessConfigurationRegister, link->handle, - ®))) { + if ((err = pcmcia_access_configuration_register(link->handle, ®))) { cs_error(link->handle, AccessConfigurationRegister, err); goto config_error; } @@ -1055,15 +1050,14 @@ xirc2ps_config(dev_link_t * link) req.Attributes = WIN_DATA_WIDTH_8|WIN_MEMORY_TYPE_AM|WIN_ENABLE; req.Base = req.Size = 0; req.AccessSpeed = 0; - link->win = (window_handle_t)link->handle; - if ((err = CardServices(RequestWindow, &link->win, &req))) { + if ((err = pcmcia_request_window(&link->handle, &req, &link->win))) { cs_error(link->handle, RequestWindow, err); goto config_error; } local->dingo_ccr = ioremap(req.Base,0x1000) + 0x0800; mem.CardOffset = 0x0; mem.Page = 0; - if ((err = CardServices(MapMemPage, link->win, &mem))) { + if ((err = pcmcia_map_mem_page(link->win, &mem))) { cs_error(link->handle, MapMemPage, err); goto config_error; } @@ -1168,11 +1162,11 @@ xirc2ps_release(dev_link_t *link) local_info_t *local = dev->priv; if (local->dingo) iounmap(local->dingo_ccr - 0x0800); - CardServices(ReleaseWindow, link->win); + pcmcia_release_window(link->win); } - 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; } /* xirc2ps_release */ @@ -1224,7 +1218,7 @@ xirc2ps_event(event_t event, int priorit netif_device_detach(dev); do_powerdown(dev); } - CardServices(ReleaseConfiguration, link->handle); + pcmcia_release_configuration(link->handle); } break; case CS_EVENT_PM_RESUME: @@ -1232,7 +1226,7 @@ xirc2ps_event(event_t event, int priorit /* 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) { do_reset(dev,1); netif_device_attach(dev); _