Lines Matching refs:link
106 dev_link_t *link, *next; in flush_stale_links() local
107 for (link = dev_list; link; link = next) { in flush_stale_links()
108 next = link->next; in flush_stale_links()
109 if (link->state & DEV_STALE_LINK) in flush_stale_links()
110 awc_detach(link); in flush_stale_links()
128 dev_link_t *link; in awc_pcmcia_open() local
131 for (link = dev_list; link; link = link->next) in awc_pcmcia_open()
132 if (link->priv == dev) break; in awc_pcmcia_open()
133 if (!DEV_OK(link)) in awc_pcmcia_open()
139 link->open++; in awc_pcmcia_open()
147 dev_link_t *link; in awc_pcmcia_close() local
150 for (link = dev_list; link; link = link->next) in awc_pcmcia_close()
151 if (link->priv == dev) break; in awc_pcmcia_close()
152 if (link == NULL) in awc_pcmcia_close()
157 link->open--; in awc_pcmcia_close()
160 if (link->state & DEV_STALE_CONFIG) { in awc_pcmcia_close()
161 link->release.expires = RUN_AT( HZ/20 ); in awc_pcmcia_close()
162 link->state |= DEV_RELEASE_PENDING; in awc_pcmcia_close()
163 add_timer(&link->release); in awc_pcmcia_close()
205 dev_link_t *link = NULL; in awc_attach() local
213 link = kmalloc(sizeof(struct dev_link_t), GFP_KERNEL); in awc_attach()
214 if (!link) in awc_attach()
216 memset(link, 0, sizeof(struct dev_link_t)); in awc_attach()
218 link->dev = kmalloc(sizeof(struct dev_node_t), GFP_KERNEL); in awc_attach()
219 if (!link->dev) { in awc_attach()
220 kfree(link); in awc_attach()
224 memset(link->dev, 0, sizeof(struct dev_node_t)); in awc_attach()
226 link->release.function = &awc_release; in awc_attach()
227 link->release.data = (u_long)link; in awc_attach()
229 link->io.Attributes1 = IO_DATA_PATH_WIDTH_16; in awc_attach()
231 link->irq.Attributes = IRQ_HANDLE_PRESENT ; // |IRQ_TYPE_EXCLUSIVE ; in awc_attach()
232 link->irq.IRQInfo1 = IRQ_INFO2_VALID|IRQ_LEVEL_ID; in awc_attach()
233 link->irq.IRQInfo2 = irq_mask; in awc_attach()
234 link->irq.Handler = &awc_interrupt; in awc_attach()
235 link->conf.Attributes = CONF_ENABLE_IRQ; in awc_attach()
236 link->conf.Vcc = 50; in awc_attach()
237 link->conf.IntType = INT_MEMORY_AND_IO; in awc_attach()
238 link->conf.ConfigIndex = 1; in awc_attach()
239 link->conf.Present = PRESENT_OPTION; in awc_attach()
247 kfree(link->dev); in awc_attach()
248 kfree(link); in awc_attach()
277 link->priv = dev; in awc_attach()
279 link->irq.Instance = dev; in awc_attach()
283 link->next = dev_list; in awc_attach()
284 dev_list = link; in awc_attach()
295 client_reg.event_callback_args.client_data = link; in awc_attach()
296 ret = CardServices(RegisterClient, &link->handle, &client_reg); in awc_attach()
298 cs_error(link->handle, RegisterClient, ret); in awc_attach()
299 awc_detach(link); in awc_attach()
303 return link; in awc_attach()
315 static void awc_detach(dev_link_t *link) in awc_detach() argument
321 DEBUG(0, "awc_detach(0x%p)\n", link); in awc_detach()
325 if (*linkp == link) break; in awc_detach()
331 if (link->state & DEV_RELEASE_PENDING) { in awc_detach()
332 del_timer(&link->release); in awc_detach()
333 link->state &= ~DEV_RELEASE_PENDING; in awc_detach()
337 if (link->state & DEV_CONFIG) { in awc_detach()
338 awc_release((u_long)link); in awc_detach()
339 if (link->state & DEV_STALE_CONFIG) { in awc_detach()
340 link->state |= DEV_STALE_LINK; in awc_detach()
345 if (link->handle) in awc_detach()
346 CardServices(DeregisterClient, link->handle); in awc_detach()
349 *linkp = link->next; in awc_detach()
355 if (aironet4500_devices[i] == link->priv){ in awc_detach()
364 if (link->priv) { in awc_detach()
368 kfree(link->priv); in awc_detach()
370 kfree(link->dev); in awc_detach()
371 kfree(link); in awc_detach()
386 static void awc_pcmcia_config(dev_link_t *link) in awc_pcmcia_config() argument
400 handle = link->handle; in awc_pcmcia_config()
401 dev = link->priv; in awc_pcmcia_config()
404 PC_DEBUG(0, "awc_pcmcia_config(0x%p)\n", link); in awc_pcmcia_config()
414 link->conf.ConfigBase = parse.config.base; in awc_pcmcia_config()
415 link->conf.Present = parse.config.rmask[0]; in awc_pcmcia_config()
419 link->state |= DEV_CONFIG; in awc_pcmcia_config()
432 link->conf.ConfigIndex = cfg->index; in awc_pcmcia_config()
437 link->conf.Vcc = cfg->vcc.param[CISTPL_POWER_VNOM]/10000; in awc_pcmcia_config()
439 link->conf.Vcc = dflt.vcc.param[CISTPL_POWER_VNOM]/10000; in awc_pcmcia_config()
442 link->conf.Vpp1 = link->conf.Vpp2 = in awc_pcmcia_config()
445 link->conf.Vpp1 = link->conf.Vpp2 = in awc_pcmcia_config()
450 link->conf.Attributes |= CONF_ENABLE_IRQ; in awc_pcmcia_config()
453 link->io.NumPorts1 = link->io.NumPorts2 = 0; in awc_pcmcia_config()
456 link->io.Attributes1 = IO_DATA_PATH_WIDTH_AUTO; in awc_pcmcia_config()
458 link->io.Attributes1 = IO_DATA_PATH_WIDTH_16; in awc_pcmcia_config()
461 link->io.Attributes1 = IO_DATA_PATH_WIDTH_8; in awc_pcmcia_config()
464 link->io.BasePort1 = io->win[0].base; in awc_pcmcia_config()
466 link->io.NumPorts1 = io->win[0].len; in awc_pcmcia_config()
468 link->io.Attributes2 = link->io.Attributes1; in awc_pcmcia_config()
469 link->io.BasePort2 = io->win[1].base; in awc_pcmcia_config()
470 link->io.NumPorts2 = io->win[1].len; in awc_pcmcia_config()
475 while ((last_ret = CardServices(RequestIO, link->handle, &link->io)) ){ in awc_pcmcia_config()
479 link->io.BasePort1 = awc_ports[ii]; in awc_pcmcia_config()
491 if (link->conf.Attributes & CONF_ENABLE_IRQ){ in awc_pcmcia_config()
494 while ((last_ret = CardServices(RequestIRQ, link->handle, &link->irq)) ){ in awc_pcmcia_config()
499 link->irq.IRQInfo2 = 1 << ii; in awc_pcmcia_config()
503 printk("trying irq %d , mask %x \n",ii, link->irq.IRQInfo2); in awc_pcmcia_config()
508 CS_CHECK(RequestConfiguration, link->handle, &link->conf); in awc_pcmcia_config()
511 dev->irq = link->irq.AssignedIRQ; in awc_pcmcia_config()
512 dev->base_addr = link->io.BasePort1; in awc_pcmcia_config()
536 link->state &= ~DEV_CONFIG_PENDING; in awc_pcmcia_config()
545 cs_error(link->handle, last_fn, last_ret); in awc_pcmcia_config()
546 link->dev=NULL; in awc_pcmcia_config()
549 awc_release((u_long)link); in awc_pcmcia_config()
563 dev_link_t *link = (dev_link_t *)arg; in awc_release() local
564 struct net_device *dev = link->priv; in awc_release()
566 DEBUG(0, "awc_release(0x%p)\n", link); in awc_release()
568 if (link->open) { in awc_release()
570 link->dev->dev_name); in awc_release()
571 link->state |= DEV_STALE_CONFIG; in awc_release()
575 CardServices(ReleaseConfiguration, link->handle); in awc_release()
576 CardServices(ReleaseIO, link->handle, &link->io); in awc_release()
577 CardServices(ReleaseIRQ, link->handle, &link->irq); in awc_release()
579 CardServices(ReleaseWindow, link->win); in awc_release()
580 if (link->dev) in awc_release()
584 link->state &= ~DEV_CONFIG; in awc_release()
585 if (link->state & DEV_STALE_LINK) in awc_release()
586 awc_detach(link); in awc_release()
601 dev_link_t *link = args->client_data; in awc_event() local
602 struct net_device *dev = link->priv; in awc_event()
608 link->state &= ~DEV_PRESENT; in awc_event()
609 if (link->state & DEV_CONFIG) { in awc_event()
611 link->release.expires = RUN_AT( HZ/20 ); in awc_event()
612 add_timer(&link->release); in awc_event()
616 link->state |= DEV_PRESENT | DEV_CONFIG_PENDING; in awc_event()
617 awc_pcmcia_config(link); in awc_event()
620 link->state |= DEV_SUSPEND; in awc_event()
623 if (link->state & DEV_CONFIG) { in awc_event()
624 if (link->open) in awc_event()
627 CardServices(ReleaseConfiguration, link->handle); in awc_event()
631 link->state &= ~DEV_SUSPEND; in awc_event()
634 if (link->state & DEV_CONFIG) { in awc_event()
635 CardServices(RequestConfiguration, link->handle, &link->conf); in awc_event()
636 if (link->open) { in awc_event()