aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/atmel_cs.c
diff options
context:
space:
mode:
authorDominik Brodowski <linux@dominikbrodowski.net>2006-03-31 10:21:06 -0500
committerDominik Brodowski <linux@dominikbrodowski.net>2006-03-31 10:21:06 -0500
commitfba395eee7d3f342ca739c20f5b3ee635d0420a0 (patch)
tree5a73f68d3514aa795b0d8c500e4d72170651d762 /drivers/net/wireless/atmel_cs.c
parentfd238232cd0ff4840ae6946bb338502154096d88 (diff)
[PATCH] pcmcia: remove dev_link_t and client_handle_t indirection
dev_link_t * and client_handle_t both mean struct pcmcai_device * by now. Therefore, remove all such indirections. Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
Diffstat (limited to 'drivers/net/wireless/atmel_cs.c')
-rw-r--r--drivers/net/wireless/atmel_cs.c56
1 files changed, 25 insertions, 31 deletions
diff --git a/drivers/net/wireless/atmel_cs.c b/drivers/net/wireless/atmel_cs.c
index 522bbed47a05..843dd1a036d2 100644
--- a/drivers/net/wireless/atmel_cs.c
+++ b/drivers/net/wireless/atmel_cs.c
@@ -91,8 +91,8 @@ MODULE_SUPPORTED_DEVICE("Atmel at76c50x PCMCIA cards");
91 event handler. 91 event handler.
92*/ 92*/
93 93
94static void atmel_config(dev_link_t *link); 94static void atmel_config(struct pcmcia_device *link);
95static void atmel_release(dev_link_t *link); 95static void atmel_release(struct pcmcia_device *link);
96 96
97/* 97/*
98 The attach() and detach() entry points are used to create and destroy 98 The attach() and detach() entry points are used to create and destroy
@@ -112,10 +112,10 @@ static void atmel_detach(struct pcmcia_device *p_dev);
112/* 112/*
113 A linked list of "instances" of the atmelnet device. Each actual 113 A linked list of "instances" of the atmelnet device. Each actual
114 PCMCIA card corresponds to one device instance, and is described 114 PCMCIA card corresponds to one device instance, and is described
115 by one dev_link_t structure (defined in ds.h). 115 by one struct pcmcia_device structure (defined in ds.h).
116 116
117 You may not want to use a linked list for this -- for example, the 117 You may not want to use a linked list for this -- for example, the
118 memory card driver uses an array of dev_link_t pointers, where minor 118 memory card driver uses an array of struct pcmcia_device pointers, where minor
119 device numbers are used to derive the corresponding array index. 119 device numbers are used to derive the corresponding array index.
120*/ 120*/
121 121
@@ -125,7 +125,7 @@ static void atmel_detach(struct pcmcia_device *p_dev);
125 example, ethernet cards, modems). In other cases, there may be 125 example, ethernet cards, modems). In other cases, there may be
126 many actual or logical devices (SCSI adapters, memory cards with 126 many actual or logical devices (SCSI adapters, memory cards with
127 multiple partitions). The dev_node_t structures need to be kept 127 multiple partitions). The dev_node_t structures need to be kept
128 in a linked list starting at the 'dev' field of a dev_link_t 128 in a linked list starting at the 'dev' field of a struct pcmcia_device
129 structure. We allocate them in the card's private data structure, 129 structure. We allocate them in the card's private data structure,
130 because they generally shouldn't be allocated dynamically. 130 because they generally shouldn't be allocated dynamically.
131 131
@@ -196,10 +196,8 @@ static int atmel_attach(struct pcmcia_device *p_dev)
196 196
197 ======================================================================*/ 197 ======================================================================*/
198 198
199static void atmel_detach(struct pcmcia_device *p_dev) 199static void atmel_detach(struct pcmcia_device *link)
200{ 200{
201 dev_link_t *link = dev_to_instance(p_dev);
202
203 DEBUG(0, "atmel_detach(0x%p)\n", link); 201 DEBUG(0, "atmel_detach(0x%p)\n", link);
204 202
205 if (link->state & DEV_CONFIG) 203 if (link->state & DEV_CONFIG)
@@ -223,7 +221,7 @@ do { last_fn = (fn); if ((last_ret = (ret)) != 0) goto cs_failed; } while (0)
223 about the current existance of the card */ 221 about the current existance of the card */
224static int card_present(void *arg) 222static int card_present(void *arg)
225{ 223{
226 dev_link_t *link = (dev_link_t *)arg; 224 struct pcmcia_device *link = (struct pcmcia_device *)arg;
227 if (link->state & DEV_SUSPEND) 225 if (link->state & DEV_SUSPEND)
228 return 0; 226 return 0;
229 else if (link->state & DEV_PRESENT) 227 else if (link->state & DEV_PRESENT)
@@ -232,9 +230,8 @@ static int card_present(void *arg)
232 return 0; 230 return 0;
233} 231}
234 232
235static void atmel_config(dev_link_t *link) 233static void atmel_config(struct pcmcia_device *link)
236{ 234{
237 client_handle_t handle;
238 tuple_t tuple; 235 tuple_t tuple;
239 cisparse_t parse; 236 cisparse_t parse;
240 local_info_t *dev; 237 local_info_t *dev;
@@ -242,9 +239,8 @@ static void atmel_config(dev_link_t *link)
242 u_char buf[64]; 239 u_char buf[64];
243 struct pcmcia_device_id *did; 240 struct pcmcia_device_id *did;
244 241
245 handle = link->handle;
246 dev = link->priv; 242 dev = link->priv;
247 did = handle_to_dev(handle).driver_data; 243 did = handle_to_dev(link).driver_data;
248 244
249 DEBUG(0, "atmel_config(0x%p)\n", link); 245 DEBUG(0, "atmel_config(0x%p)\n", link);
250 246
@@ -258,9 +254,9 @@ static void atmel_config(dev_link_t *link)
258 registers. 254 registers.
259 */ 255 */
260 tuple.DesiredTuple = CISTPL_CONFIG; 256 tuple.DesiredTuple = CISTPL_CONFIG;
261 CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(handle, &tuple)); 257 CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(link, &tuple));
262 CS_CHECK(GetTupleData, pcmcia_get_tuple_data(handle, &tuple)); 258 CS_CHECK(GetTupleData, pcmcia_get_tuple_data(link, &tuple));
263 CS_CHECK(ParseTuple, pcmcia_parse_tuple(handle, &tuple, &parse)); 259 CS_CHECK(ParseTuple, pcmcia_parse_tuple(link, &tuple, &parse));
264 link->conf.ConfigBase = parse.config.base; 260 link->conf.ConfigBase = parse.config.base;
265 link->conf.Present = parse.config.rmask[0]; 261 link->conf.Present = parse.config.rmask[0];
266 262
@@ -280,12 +276,12 @@ static void atmel_config(dev_link_t *link)
280 will only use the CIS to fill in implementation-defined details. 276 will only use the CIS to fill in implementation-defined details.
281 */ 277 */
282 tuple.DesiredTuple = CISTPL_CFTABLE_ENTRY; 278 tuple.DesiredTuple = CISTPL_CFTABLE_ENTRY;
283 CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(handle, &tuple)); 279 CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(link, &tuple));
284 while (1) { 280 while (1) {
285 cistpl_cftable_entry_t dflt = { 0 }; 281 cistpl_cftable_entry_t dflt = { 0 };
286 cistpl_cftable_entry_t *cfg = &(parse.cftable_entry); 282 cistpl_cftable_entry_t *cfg = &(parse.cftable_entry);
287 if (pcmcia_get_tuple_data(handle, &tuple) != 0 || 283 if (pcmcia_get_tuple_data(link, &tuple) != 0 ||
288 pcmcia_parse_tuple(handle, &tuple, &parse) != 0) 284 pcmcia_parse_tuple(link, &tuple, &parse) != 0)
289 goto next_entry; 285 goto next_entry;
290 286
291 if (cfg->flags & CISTPL_CFTABLE_DEFAULT) dflt = *cfg; 287 if (cfg->flags & CISTPL_CFTABLE_DEFAULT) dflt = *cfg;
@@ -330,14 +326,14 @@ static void atmel_config(dev_link_t *link)
330 } 326 }
331 327
332 /* This reserves IO space but doesn't actually enable it */ 328 /* This reserves IO space but doesn't actually enable it */
333 if (pcmcia_request_io(link->handle, &link->io) != 0) 329 if (pcmcia_request_io(link, &link->io) != 0)
334 goto next_entry; 330 goto next_entry;
335 331
336 /* If we got this far, we're cool! */ 332 /* If we got this far, we're cool! */
337 break; 333 break;
338 334
339 next_entry: 335 next_entry:
340 CS_CHECK(GetNextTuple, pcmcia_get_next_tuple(handle, &tuple)); 336 CS_CHECK(GetNextTuple, pcmcia_get_next_tuple(link, &tuple));
341 } 337 }
342 338
343 /* 339 /*
@@ -346,14 +342,14 @@ static void atmel_config(dev_link_t *link)
346 irq structure is initialized. 342 irq structure is initialized.
347 */ 343 */
348 if (link->conf.Attributes & CONF_ENABLE_IRQ) 344 if (link->conf.Attributes & CONF_ENABLE_IRQ)
349 CS_CHECK(RequestIRQ, pcmcia_request_irq(link->handle, &link->irq)); 345 CS_CHECK(RequestIRQ, pcmcia_request_irq(link, &link->irq));
350 346
351 /* 347 /*
352 This actually configures the PCMCIA socket -- setting up 348 This actually configures the PCMCIA socket -- setting up
353 the I/O windows and the interrupt mapping, and putting the 349 the I/O windows and the interrupt mapping, and putting the
354 card and host interface into "Memory and IO" mode. 350 card and host interface into "Memory and IO" mode.
355 */ 351 */
356 CS_CHECK(RequestConfiguration, pcmcia_request_configuration(link->handle, &link->conf)); 352 CS_CHECK(RequestConfiguration, pcmcia_request_configuration(link, &link->conf));
357 353
358 if (link->irq.AssignedIRQ == 0) { 354 if (link->irq.AssignedIRQ == 0) {
359 printk(KERN_ALERT 355 printk(KERN_ALERT
@@ -365,7 +361,7 @@ static void atmel_config(dev_link_t *link)
365 init_atmel_card(link->irq.AssignedIRQ, 361 init_atmel_card(link->irq.AssignedIRQ,
366 link->io.BasePort1, 362 link->io.BasePort1,
367 did ? did->driver_info : ATMEL_FW_TYPE_NONE, 363 did ? did->driver_info : ATMEL_FW_TYPE_NONE,
368 &handle_to_dev(handle), 364 &handle_to_dev(link),
369 card_present, 365 card_present,
370 link); 366 link);
371 if (!((local_info_t*)link->priv)->eth_dev) 367 if (!((local_info_t*)link->priv)->eth_dev)
@@ -384,7 +380,7 @@ static void atmel_config(dev_link_t *link)
384 return; 380 return;
385 381
386 cs_failed: 382 cs_failed:
387 cs_error(link->handle, last_fn, last_ret); 383 cs_error(link, last_fn, last_ret);
388 atmel_release(link); 384 atmel_release(link);
389} 385}
390 386
@@ -396,7 +392,7 @@ static void atmel_config(dev_link_t *link)
396 392
397 ======================================================================*/ 393 ======================================================================*/
398 394
399static void atmel_release(dev_link_t *link) 395static void atmel_release(struct pcmcia_device *link)
400{ 396{
401 struct net_device *dev = ((local_info_t*)link->priv)->eth_dev; 397 struct net_device *dev = ((local_info_t*)link->priv)->eth_dev;
402 398
@@ -406,12 +402,11 @@ static void atmel_release(dev_link_t *link)
406 stop_atmel_card(dev); 402 stop_atmel_card(dev);
407 ((local_info_t*)link->priv)->eth_dev = NULL; 403 ((local_info_t*)link->priv)->eth_dev = NULL;
408 404
409 pcmcia_disable_device(link->handle); 405 pcmcia_disable_device(link);
410} 406}
411 407
412static int atmel_suspend(struct pcmcia_device *dev) 408static int atmel_suspend(struct pcmcia_device *link)
413{ 409{
414 dev_link_t *link = dev_to_instance(dev);
415 local_info_t *local = link->priv; 410 local_info_t *local = link->priv;
416 411
417 if (link->state & DEV_CONFIG) 412 if (link->state & DEV_CONFIG)
@@ -420,9 +415,8 @@ static int atmel_suspend(struct pcmcia_device *dev)
420 return 0; 415 return 0;
421} 416}
422 417
423static int atmel_resume(struct pcmcia_device *dev) 418static int atmel_resume(struct pcmcia_device *link)
424{ 419{
425 dev_link_t *link = dev_to_instance(dev);
426 local_info_t *local = link->priv; 420 local_info_t *local = link->priv;
427 421
428 if (link->state & DEV_CONFIG) { 422 if (link->state & DEV_CONFIG) {