lkml.org 
[lkml]   [2003]   [Dec]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Subject[PATCH 4/7] more CardServices() removals (drivers/net/wireless)
From
Date
Part 4 of 7.
Revision: linux--mainline--2.6--patch-33
Archive: dilinger@voxel.net--2003-spiral
Creator: Andres Salomon <dilinger@voxel.net>
Date: Tue Dec 23 18:56:31 EST 2003
Standard-date: 2003-12-23 23:56:31 GMT
Modified-files: drivers/net/wireless/orinoco_cs.c
New-patches: dilinger@voxel.net--2003-spiral/linux--mainline--2.6--patch-33
Summary: CardServices() removal, act 2, pt. 4.
Keywords:

Remove calls to CardServices(), act 2, part 4; orinoco_cs.c.

* added files

{arch}/linux/linux--mainline/linux--mainline--2.6/dilinger@voxel.net--2003-spiral/patch-log/patch-33

* modified files

--- orig/drivers/net/wireless/orinoco_cs.c
+++ mod/drivers/net/wireless/orinoco_cs.c
@@ -131,7 +131,7 @@
/* We need atomic ops here, because we're not holding the lock */
set_bit(0, &card->hard_reset_in_progress);

- err = CardServices(ResetCard, link->handle, NULL);
+ err = pcmcia_reset_card(link->handle, NULL);
if (err)
return err;

@@ -150,7 +150,7 @@
orinoco_cs_error(client_handle_t handle, int func, int ret)
{
error_info_t err = { func, ret };
- CardServices(ReportError, handle, &err);
+ pcmcia_report_error(handle, &err);
}

/*
@@ -214,7 +214,7 @@
client_reg.Version = 0x0210; /* FIXME: what does this mean? */
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) {
orinoco_cs_error(link->handle, RegisterClient, ret);
orinoco_cs_detach(link);
@@ -250,7 +250,7 @@

/* Break the link with Card Services */
if (link->handle)
- CardServices(DeregisterClient, link->handle);
+ pcmcia_deregister_client(link->handle);

/* Unlink device structure, and free it */
*linkp = link->next;
@@ -269,11 +269,8 @@
* device available to the system.
*/

-#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 void
orinoco_cs_config(dev_link_t *link)
@@ -290,7 +287,7 @@
tuple_t tuple;
cisparse_t parse;

- CS_CHECK(ValidateCIS, handle, &info);
+ CS_CHECK(ValidateCIS, pcmcia_validate_cis(handle, &info));

/*
* This reads the card's CONFIG tuple to find its
@@ -301,9 +298,9 @@
tuple.TupleData = buf;
tuple.TupleDataMax = sizeof(buf);
tuple.TupleOffset = 0;
- 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];

@@ -311,7 +308,7 @@
link->state |= DEV_CONFIG;

/* Look up the current Vcc */
- CS_CHECK(GetConfigurationInfo, handle, &conf);
+ CS_CHECK(GetConfigurationInfo, pcmcia_get_configuration_info(handle, &conf));
link->conf.Vcc = conf.Vcc;

/*
@@ -329,13 +326,14 @@
* implementation-defined details.
*/
tuple.DesiredTuple = CISTPL_CFTABLE_ENTRY;
- CS_CHECK(GetFirstTuple, handle, &tuple);
+ CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(handle, &tuple));
while (1) {
cistpl_cftable_entry_t *cfg = &(parse.cftable_entry);
cistpl_cftable_entry_t dflt = { .index = 0 };

- CFG_CHECK(GetTupleData, handle, &tuple);
- CFG_CHECK(ParseTuple, handle, &tuple, &parse);
+ if (pcmcia_get_tuple_data(handle, &tuple) != 0 ||
+ pcmcia_parse_tuple(handle, &tuple, &parse) != 0)
+ goto next_entry;

if (cfg->flags & CISTPL_CFTABLE_DEFAULT)
dflt = *cfg;
@@ -400,7 +398,8 @@
}

/* This reserves IO space but doesn't actually enable it */
- CFG_CHECK(RequestIO, link->handle, &link->io);
+ if (pcmcia_request_io(link->handle, &link->io) != 0)
+ goto next_entry;
}


@@ -410,8 +409,8 @@

next_entry:
if (link->io.NumPorts1)
- CardServices(ReleaseIO, link->handle, &link->io);
- last_ret = CardServices(GetNextTuple, handle, &tuple);
+ pcmcia_release_io(link->handle, &link->io);
+ last_ret = pcmcia_get_next_tuple(handle, &tuple);
if (last_ret == CS_NO_MORE_ITEMS) {
printk(KERN_ERR "GetNextTuple(). No matching CIS configuration, "
"maybe you need the ignore_cis_vcc=1 parameter.\n");
@@ -438,7 +437,7 @@
link->irq.Handler = orinoco_interrupt;
link->irq.Instance = dev;

- CS_CHECK(RequestIRQ, link->handle, &link->irq);
+ CS_CHECK(RequestIRQ, pcmcia_request_irq(link->handle, &link->irq));
}

/* We initialize the hermes structure before completing PCMCIA
@@ -452,7 +451,7 @@
* the I/O windows and the interrupt mapping, and putting the
* card and host interface into "Memory and IO" mode.
*/
- CS_CHECK(RequestConfiguration, link->handle, &link->conf);
+ CS_CHECK(RequestConfiguration, pcmcia_request_configuration(link->handle, &link->conf));

/* Ok, we have the configuration, prepare to register the netdev */
dev->base_addr = link->io.BasePort1;
@@ -521,11 +520,11 @@
spin_unlock_irqrestore(&priv->lock, flags);

/* Don't bother checking to see if these succeed or not */
- CardServices(ReleaseConfiguration, link->handle);
+ pcmcia_release_configuration(link->handle);
if (link->io.NumPorts1)
- CardServices(ReleaseIO, link->handle, &link->io);
+ pcmcia_release_io(link->handle, &link->io);
if (link->irq.AssignedIRQ)
- CardServices(ReleaseIRQ, link->handle, &link->irq);
+ pcmcia_release_irq(link->handle, &link->irq);
link->state &= ~DEV_CONFIG;
} /* orinoco_cs_release */

@@ -587,7 +586,7 @@
spin_unlock_irqrestore(&priv->lock, flags);
}

- CardServices(ReleaseConfiguration, link->handle);
+ pcmcia_release_configuration(link->handle);
}
break;

@@ -598,8 +597,7 @@
if (link->state & DEV_CONFIG) {
/* FIXME: should we double check that this is
* the same card as we had before */
- CardServices(RequestConfiguration, link->handle,
- &link->conf);
+ pcmcia_request_configuration(link->handle, &link->conf);

if (! test_bit(0, &card->hard_reset_in_progress)) {
err = orinoco_reinit_firmware(dev);


[unhandled content-type:application/pgp-signature]
\
 
 \ /
  Last update: 2005-03-22 13:59    [W:0.028 / U:0.296 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site