mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Andres Salomon <dilinger@voxel.net>
To: Andrew Morton <akpm@osdl.org>
Cc: linux-kernel@vger.kernel.org, linux-pcmcia@lists.infradead.org
Subject: [PATCH 1/7] more CardServices() removals (drivers/net/wireless)
Date: Tue, 23 Dec 2003 20:42:23 -0500	[thread overview]
Message-ID: <1072226717.5300.11.camel@spiral.internal> (raw)


[-- Attachment #1.1: Type: text/plain, Size: 268 bytes --]

This wraps up drivers/net/wireless.  Still remaining:

- sound/pcmcia/vx
- drivers/{bluetooth,isdn,parport,telephony}
- drivers/mtd/maps
- drivers/scsi/pcmcia
- drivers/char/pcmcia/synclink_cs.c

If you've already done any of the above, please let me know.


[-- Attachment #1.2: 101-cs_remove.patch --]
[-- Type: text/x-patch, Size: 5912 bytes --]

Revision: linux--mainline--2.6--patch-30
Archive: dilinger@voxel.net--2003-spiral
Creator: Andres Salomon <dilinger@voxel.net>
Date: Tue Dec 23 18:28:13 EST 2003
Standard-date: 2003-12-23 23:28:13 GMT
Modified-files: drivers/net/wireless/airo_cs.c
New-patches: dilinger@voxel.net--2003-spiral/linux--mainline--2.6--patch-30
Summary: CardServices() removal, act 2, pt. 1.
Keywords: 

Remove calls to CardServices(), act 2, part 1; airo_cs.c.

* added files

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

* modified files

--- orig/drivers/net/wireless/airo_cs.c
+++ mod/drivers/net/wireless/airo_cs.c
@@ -233,7 +233,7 @@
 	client_reg.event_handler = &airo_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);
 		airo_detach(link);
@@ -277,7 +277,7 @@
 	
 	/* Break the link with Card Services */
 	if (link->handle)
-		CardServices(DeregisterClient, link->handle);
+		pcmcia_deregister_client(link->handle);
 	
 	
 	
@@ -298,11 +298,8 @@
   
   ======================================================================*/
 
-#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 airo_config(dev_link_t *link)
 {
@@ -329,9 +326,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];
 	
@@ -351,12 +348,13 @@
 	  will only use the CIS to fill in 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 dflt = { 0 };
 		cistpl_cftable_entry_t *cfg = &(parse.cftable_entry);
-		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;
 		if (cfg->index == 0) goto next_entry;
@@ -405,7 +403,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;
 		
 		/*
 		  Now set up a common memory window, if needed.  There is room
@@ -425,16 +424,17 @@
 			req.Base = mem->win[0].host_addr;
 			req.Size = mem->win[0].len;
 			req.AccessSpeed = 0;
-			link->win = (window_handle_t)link->handle;
-			CFG_CHECK(RequestWindow, &link->win, &req);
+			if (pcmcia_request_window(&link->handle, &req, &link->win) != 0)
+				goto next_entry;
 			map.Page = 0; map.CardOffset = mem->win[0].card_addr;
-			CFG_CHECK(MapMemPage, link->win, &map);
+			if (pcmcia_map_mem_page(link->win, &map) != 0)
+				goto next_entry;
 		}
 		/* If we got this far, we're cool! */
 		break;
 		
 	next_entry:
-		CS_CHECK(GetNextTuple, handle, &tuple);
+		CS_CHECK(GetNextTuple, pcmcia_get_next_tuple(handle, &tuple));
 	}
 	
     /*
@@ -443,14 +443,14 @@
       irq structure is initialized.
     */
 	if (link->conf.Attributes & CONF_ENABLE_IRQ)
-		CS_CHECK(RequestIRQ, link->handle, &link->irq);
+		CS_CHECK(RequestIRQ, pcmcia_request_irq(link->handle, &link->irq));
 	
 	/*
 	  This actually configures the PCMCIA socket -- setting up
 	  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));
 	((local_info_t*)link->priv)->eth_dev = 
 		init_airo_card( link->irq.AssignedIRQ,
 				link->io.BasePort1, 1 );
@@ -526,12 +526,12 @@
 	
 	/* Don't bother checking to see if these succeed or not */
 	if (link->win)
-		CardServices(ReleaseWindow, link->win);
-	CardServices(ReleaseConfiguration, link->handle);
+		pcmcia_release_window(link->win);
+	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;
 
 	if (link->state & DEV_STALE_CONFIG)
@@ -576,7 +576,7 @@
 	case CS_EVENT_RESET_PHYSICAL:
 		if (link->state & DEV_CONFIG) {
 			netif_device_detach(local->eth_dev);
-			CardServices(ReleaseConfiguration, link->handle);
+			pcmcia_release_configuration(link->handle);
 		}
 		break;
 	case CS_EVENT_PM_RESUME:
@@ -584,7 +584,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);
 			reset_airo_card(local->eth_dev);
 			netif_device_attach(local->eth_dev);
 		}




[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

                 reply	other threads:[~2003-12-24  1:42 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1072226717.5300.11.camel@spiral.internal \
    --to=dilinger@voxel.net \
    --cc=akpm@osdl.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pcmcia@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®