Searched refs:link (Results 1 - 200 of 2660) sorted by relevance

1234567891011>>

/linux-4.1.27/include/uapi/linux/
H A Dwanrouter.h11 WAN_UNCONFIGURED, /* link/channel is not configured */
12 WAN_DISCONNECTED, /* link/channel is disconnected */
14 WAN_CONNECTED /* link/channel is operational */
H A Dif_bonding.h30 * - Added support for IEEE 802.3ad Dynamic link aggregation mode.
74 /* each slave's link has 4 states */
75 #define BOND_LINK_UP 0 /* link is up and running */
76 #define BOND_LINK_FAIL 1 /* link has just gone down */
77 #define BOND_LINK_DOWN 2 /* link has been down for too long time */
78 #define BOND_LINK_BACK 3 /* link is going back */
81 #define BOND_STATE_ACTIVE 0 /* link is active */
82 #define BOND_STATE_BACKUP 1 /* link is backup */
106 __s8 link; member in struct:ifslave
H A Ddn.h49 #define DSO_LINKINFO 7 /* Set/Get link information */
114 * DECnet logical link information structure
117 __u16 idn_segsize; /* Segment size for link */
118 __u8 idn_linkstate; /* Logical link state */
H A Dip6_tunnel.h24 int link; /* ifindex of underlying L2 interface */ member in struct:ip6_tnl_parm
36 int link; /* ifindex of underlying L2 interface */ member in struct:ip6_tnl_parm2
/linux-4.1.27/drivers/isdn/hisax/
H A Davma1_cs.c41 static int avma1cs_config(struct pcmcia_device *link);
42 static void avma1cs_release(struct pcmcia_device *link);
57 static void avma1cs_detach(struct pcmcia_device *link) avma1cs_detach() argument
59 dev_dbg(&link->dev, "avma1cs_detach(0x%p)\n", link); avma1cs_detach()
60 avma1cs_release(link); avma1cs_detach()
61 kfree(link->priv); avma1cs_detach()
75 static int avma1cs_config(struct pcmcia_device *link) avma1cs_config() argument
82 dev_dbg(&link->dev, "avma1cs_config(0x%p)\n", link); avma1cs_config()
85 if (link->prod_id[1]) avma1cs_config()
86 strlcpy(devname, link->prod_id[1], sizeof(devname)); avma1cs_config()
88 if (pcmcia_loop_config(link, avma1cs_configcheck, NULL)) avma1cs_config()
95 if (!link->irq) { avma1cs_config()
97 pcmcia_disable_device(link); avma1cs_config()
104 i = pcmcia_enable_device(link); avma1cs_config()
106 pcmcia_disable_device(link); avma1cs_config()
114 avma1cs_release(link); avma1cs_config()
118 icard.para[0] = link->irq; avma1cs_config()
119 icard.para[1] = link->resource[0]->start; avma1cs_config()
123 i = hisax_init_pcmcia(link, &busy, &icard); avma1cs_config()
127 (unsigned int) link->resource[0]->start); avma1cs_config()
128 avma1cs_release(link); avma1cs_config()
131 link->priv = (void *) (unsigned long) i; avma1cs_config()
136 static void avma1cs_release(struct pcmcia_device *link) avma1cs_release() argument
138 unsigned long minor = (unsigned long) link->priv; avma1cs_release()
140 dev_dbg(&link->dev, "avma1cs_release(0x%p)\n", link); avma1cs_release()
145 pcmcia_disable_device(link); avma1cs_release()
H A Delsa_cs.c65 static int elsa_cs_config(struct pcmcia_device *link);
66 static void elsa_cs_release(struct pcmcia_device *link);
75 static int elsa_cs_probe(struct pcmcia_device *link) elsa_cs_probe() argument
79 dev_dbg(&link->dev, "elsa_cs_attach()\n"); elsa_cs_probe()
85 local->p_dev = link; elsa_cs_probe()
86 link->priv = local; elsa_cs_probe()
90 return elsa_cs_config(link); elsa_cs_probe()
93 static void elsa_cs_detach(struct pcmcia_device *link) elsa_cs_detach() argument
95 local_info_t *info = link->priv; elsa_cs_detach()
97 dev_dbg(&link->dev, "elsa_cs_detach(0x%p)\n", link); elsa_cs_detach()
100 elsa_cs_release(link); elsa_cs_detach()
129 static int elsa_cs_config(struct pcmcia_device *link) elsa_cs_config() argument
134 dev_dbg(&link->dev, "elsa_config(0x%p)\n", link); elsa_cs_config()
136 link->config_flags |= CONF_ENABLE_IRQ | CONF_AUTO_SET_IO; elsa_cs_config()
138 i = pcmcia_loop_config(link, elsa_cs_configcheck, NULL); elsa_cs_config()
142 if (!link->irq) elsa_cs_config()
145 i = pcmcia_enable_device(link); elsa_cs_config()
149 icard.para[0] = link->irq; elsa_cs_config()
150 icard.para[1] = link->resource[0]->start; elsa_cs_config()
154 i = hisax_init_pcmcia(link, &(((local_info_t *)link->priv)->busy), &icard); elsa_cs_config()
157 "PCMCIA %d with %pR\n", i, link->resource[0]); elsa_cs_config()
158 elsa_cs_release(link); elsa_cs_config()
160 ((local_info_t *)link->priv)->cardnr = i; elsa_cs_config()
164 elsa_cs_release(link); elsa_cs_config()
168 static void elsa_cs_release(struct pcmcia_device *link) elsa_cs_release() argument
170 local_info_t *local = link->priv; elsa_cs_release()
172 dev_dbg(&link->dev, "elsa_cs_release(0x%p)\n", link); elsa_cs_release()
181 pcmcia_disable_device(link); elsa_cs_release()
184 static int elsa_suspend(struct pcmcia_device *link) elsa_suspend() argument
186 local_info_t *dev = link->priv; elsa_suspend()
193 static int elsa_resume(struct pcmcia_device *link) elsa_resume() argument
195 local_info_t *dev = link->priv; elsa_resume()
H A Dteles_cs.c46 static int teles_cs_config(struct pcmcia_device *link);
47 static void teles_cs_release(struct pcmcia_device *link);
56 static int teles_probe(struct pcmcia_device *link) teles_probe() argument
60 dev_dbg(&link->dev, "teles_attach()\n"); teles_probe()
67 local->p_dev = link; teles_probe()
68 link->priv = local; teles_probe()
70 link->config_flags |= CONF_ENABLE_IRQ | CONF_AUTO_SET_IO; teles_probe()
72 return teles_cs_config(link); teles_probe()
75 static void teles_detach(struct pcmcia_device *link) teles_detach() argument
77 local_info_t *info = link->priv; teles_detach()
79 dev_dbg(&link->dev, "teles_detach(0x%p)\n", link); teles_detach()
82 teles_cs_release(link); teles_detach()
111 static int teles_cs_config(struct pcmcia_device *link) teles_cs_config() argument
116 dev_dbg(&link->dev, "teles_config(0x%p)\n", link); teles_cs_config()
118 i = pcmcia_loop_config(link, teles_cs_configcheck, NULL); teles_cs_config()
122 if (!link->irq) teles_cs_config()
125 i = pcmcia_enable_device(link); teles_cs_config()
129 icard.para[0] = link->irq; teles_cs_config()
130 icard.para[1] = link->resource[0]->start; teles_cs_config()
134 i = hisax_init_pcmcia(link, &(((local_info_t *)link->priv)->busy), &icard); teles_cs_config()
137 i, (unsigned int) link->resource[0]->start); teles_cs_config()
138 teles_cs_release(link); teles_cs_config()
142 ((local_info_t *)link->priv)->cardnr = i; teles_cs_config()
146 teles_cs_release(link); teles_cs_config()
150 static void teles_cs_release(struct pcmcia_device *link) teles_cs_release() argument
152 local_info_t *local = link->priv; teles_cs_release()
154 dev_dbg(&link->dev, "teles_cs_release(0x%p)\n", link); teles_cs_release()
163 pcmcia_disable_device(link); teles_cs_release()
166 static int teles_suspend(struct pcmcia_device *link) teles_suspend() argument
168 local_info_t *dev = link->priv; teles_suspend()
175 static int teles_resume(struct pcmcia_device *link) teles_resume() argument
177 local_info_t *dev = link->priv; teles_resume()
H A Dsedlbauer_cs.c65 static int sedlbauer_config(struct pcmcia_device *link);
66 static void sedlbauer_release(struct pcmcia_device *link);
76 static int sedlbauer_probe(struct pcmcia_device *link) sedlbauer_probe() argument
80 dev_dbg(&link->dev, "sedlbauer_attach()\n"); sedlbauer_probe()
87 local->p_dev = link; sedlbauer_probe()
88 link->priv = local; sedlbauer_probe()
90 return sedlbauer_config(link); sedlbauer_probe()
93 static void sedlbauer_detach(struct pcmcia_device *link) sedlbauer_detach() argument
95 dev_dbg(&link->dev, "sedlbauer_detach(0x%p)\n", link); sedlbauer_detach()
97 ((local_info_t *)link->priv)->stop = 1; sedlbauer_detach()
98 sedlbauer_release(link); sedlbauer_detach()
101 kfree(link->priv); sedlbauer_detach()
113 static int sedlbauer_config(struct pcmcia_device *link) sedlbauer_config() argument
118 dev_dbg(&link->dev, "sedlbauer_config(0x%p)\n", link); sedlbauer_config()
120 link->config_flags |= CONF_ENABLE_IRQ | CONF_AUTO_CHECK_VCC | sedlbauer_config()
123 ret = pcmcia_loop_config(link, sedlbauer_config_check, NULL); sedlbauer_config()
127 ret = pcmcia_enable_device(link); sedlbauer_config()
131 icard.para[0] = link->irq; sedlbauer_config()
132 icard.para[1] = link->resource[0]->start; sedlbauer_config()
136 ret = hisax_init_pcmcia(link, sedlbauer_config()
137 &(((local_info_t *)link->priv)->stop), &icard); sedlbauer_config()
140 ret, link->resource[0]); sedlbauer_config()
141 sedlbauer_release(link); sedlbauer_config()
144 ((local_info_t *)link->priv)->cardnr = ret; sedlbauer_config()
149 sedlbauer_release(link); sedlbauer_config()
154 static void sedlbauer_release(struct pcmcia_device *link) sedlbauer_release() argument
156 local_info_t *local = link->priv; sedlbauer_release()
157 dev_dbg(&link->dev, "sedlbauer_release(0x%p)\n", link); sedlbauer_release()
166 pcmcia_disable_device(link); sedlbauer_release()
169 static int sedlbauer_suspend(struct pcmcia_device *link) sedlbauer_suspend() argument
171 local_info_t *dev = link->priv; sedlbauer_suspend()
178 static int sedlbauer_resume(struct pcmcia_device *link) sedlbauer_resume() argument
180 local_info_t *dev = link->priv; sedlbauer_resume()
/linux-4.1.27/tools/firewire/
H A Dlist.h19 list_insert(struct list *link, struct list *new_link) list_insert() argument
21 new_link->prev = link->prev; list_insert()
22 new_link->next = link; list_insert()
40 list_remove(struct list *link) list_remove() argument
42 link->prev->next = link->next; list_remove()
43 link->next->prev = link->prev; list_remove()
46 #define list_entry(link, type, member) \
47 ((type *)((char *)(link)-(unsigned long)(&((type *)0)->member)))
H A Dnosy-dump.c177 list_for_each_entry(t, &pending_transaction_list, link) { link_transaction_lookup()
193 list_append(&pending_transaction_list, &t->link); link_transaction_lookup()
204 sa = list_head(&t->request_list, struct subaction, link); link_transaction_destroy()
205 list_remove(&sa->link); link_transaction_destroy()
209 sa = list_head(&t->response_list, struct subaction, link); link_transaction_destroy()
210 list_remove(&sa->link); link_transaction_destroy()
252 list_for_each_entry(sa, &t->request_list, link) handle_transaction()
254 list_for_each_entry(sa, &t->response_list, link) handle_transaction()
269 struct link_transaction, link); clear_pending_transaction_list()
270 list_remove(&t->link); clear_pending_transaction_list()
508 struct subaction, link); handle_request_packet()
526 list_append(&t->request_list, &sa->link); handle_request_packet()
533 list_remove(&t->link); handle_request_packet()
540 list_remove(&t->link); handle_request_packet()
576 prev = list_tail(&t->response_list, struct subaction, link); handle_response_packet()
591 prev = list_tail(&t->request_list, struct subaction, link); handle_response_packet()
605 list_append(&t->response_list, &sa->link); handle_response_packet()
612 list_remove(&t->link); handle_response_packet()
792 printf("link-on packet, phy_id=%02x", pp->link_on.phy_id); print_packet()
803 printf("self id: phy_id=%02x, link %s, gap_count=%d, speed=%s%s%s", print_packet()
/linux-4.1.27/drivers/acpi/
H A Dpci_link.c27 * 1. Support more than one IRQ resource entry per link device (index).
70 * If a link is initialized, we never change its active and initialized
71 * later even the link is disable. Instead, we just repick the active irq
99 * set context (link) possible list from resource list
104 struct acpi_pci_link *link = context; acpi_pci_link_check_possible() local
128 link->irq.possible[i] = p->interrupts[i]; acpi_pci_link_check_possible()
129 link->irq.possible_count++; acpi_pci_link_check_possible()
131 link->irq.triggering = p->triggering; acpi_pci_link_check_possible()
132 link->irq.polarity = p->polarity; acpi_pci_link_check_possible()
133 link->irq.resource_type = ACPI_RESOURCE_TYPE_IRQ; acpi_pci_link_check_possible()
154 link->irq.possible[i] = p->interrupts[i]; acpi_pci_link_check_possible()
155 link->irq.possible_count++; acpi_pci_link_check_possible()
157 link->irq.triggering = p->triggering; acpi_pci_link_check_possible()
158 link->irq.polarity = p->polarity; acpi_pci_link_check_possible()
159 link->irq.resource_type = ACPI_RESOURCE_TYPE_EXTENDED_IRQ; acpi_pci_link_check_possible()
171 static int acpi_pci_link_get_possible(struct acpi_pci_link *link) acpi_pci_link_get_possible() argument
175 status = acpi_walk_resources(link->device->handle, METHOD_NAME__PRS, acpi_pci_link_get_possible()
176 acpi_pci_link_check_possible, link); acpi_pci_link_get_possible()
184 link->irq.possible_count)); acpi_pci_link_get_possible()
240 * Run _CRS and set link->irq.active
246 static int acpi_pci_link_get_current(struct acpi_pci_link *link) acpi_pci_link_get_current() argument
252 link->irq.active = 0; acpi_pci_link_get_current()
256 /* Query _STA, set link->device->status */ acpi_pci_link_get_current()
257 result = acpi_bus_get_status(link->device); acpi_pci_link_get_current()
263 if (!link->device->status.enabled) { acpi_pci_link_get_current()
273 status = acpi_walk_resources(link->device->handle, METHOD_NAME__CRS, acpi_pci_link_get_current()
286 link->irq.active = irq; acpi_pci_link_get_current()
288 ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Link at IRQ %d \n", link->irq.active)); acpi_pci_link_get_current()
294 static int acpi_pci_link_set(struct acpi_pci_link *link, int irq) acpi_pci_link_set() argument
314 switch (link->irq.resource_type) { acpi_pci_link_set()
318 resource->res.data.irq.triggering = link->irq.triggering; acpi_pci_link_set()
320 link->irq.polarity; acpi_pci_link_set()
321 if (link->irq.triggering == ACPI_EDGE_SENSITIVE) acpi_pci_link_set()
336 link->irq.triggering; acpi_pci_link_set()
338 link->irq.polarity; acpi_pci_link_set()
339 if (link->irq.triggering == ACPI_EDGE_SENSITIVE) acpi_pci_link_set()
349 printk(KERN_ERR PREFIX "Invalid Resource_type %d\n", link->irq.resource_type); acpi_pci_link_set()
358 status = acpi_set_current_resources(link->device->handle, &buffer); acpi_pci_link_set()
368 result = acpi_bus_get_status(link->device); acpi_pci_link_set()
373 if (!link->device->status.enabled) { acpi_pci_link_set()
376 acpi_device_name(link->device), acpi_pci_link_set()
377 acpi_device_bid(link->device)); acpi_pci_link_set()
380 /* Query _CRS, set link->irq.active */ acpi_pci_link_set()
381 result = acpi_pci_link_get_current(link); acpi_pci_link_set()
388 * set link->irq.active acpi_pci_link_set()
390 if (link->irq.active != irq) { acpi_pci_link_set()
397 acpi_device_name(link->device), acpi_pci_link_set()
398 acpi_device_bid(link->device), link->irq.active, irq); acpi_pci_link_set()
399 link->irq.active = irq; acpi_pci_link_set()
402 ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Set IRQ %d\n", link->irq.active)); acpi_pci_link_set()
435 * Since this heuristic can't tell the difference between a link
436 * that no device will attach to, vs. a link which may be shared
476 struct acpi_pci_link *link; acpi_irq_penalty_init() local
482 list_for_each_entry(link, &acpi_link_list, list) { acpi_irq_penalty_init()
488 if (link->irq.possible_count) { acpi_irq_penalty_init()
491 link->irq.possible_count; acpi_irq_penalty_init()
493 for (i = 0; i < link->irq.possible_count; i++) { acpi_irq_penalty_init()
494 if (link->irq.possible[i] < ACPI_MAX_ISA_IRQ) acpi_irq_penalty_init()
495 acpi_irq_penalty[link->irq. acpi_irq_penalty_init()
500 } else if (link->irq.active) { acpi_irq_penalty_init()
501 acpi_irq_penalty[link->irq.active] += acpi_irq_penalty_init()
512 static int acpi_pci_link_allocate(struct acpi_pci_link *link) acpi_pci_link_allocate() argument
517 if (link->irq.initialized) { acpi_pci_link_allocate()
518 if (link->refcnt == 0) acpi_pci_link_allocate()
519 /* This means the link is disabled but initialized */ acpi_pci_link_allocate()
520 acpi_pci_link_set(link, link->irq.active); acpi_pci_link_allocate()
527 for (i = 0; i < link->irq.possible_count; ++i) { acpi_pci_link_allocate()
528 if (link->irq.active == link->irq.possible[i]) acpi_pci_link_allocate()
534 if (i == link->irq.possible_count) { acpi_pci_link_allocate()
537 " in _PRS\n", link->irq.active); acpi_pci_link_allocate()
538 link->irq.active = 0; acpi_pci_link_allocate()
544 if (link->irq.active) acpi_pci_link_allocate()
545 irq = link->irq.active; acpi_pci_link_allocate()
547 irq = link->irq.possible[link->irq.possible_count - 1]; acpi_pci_link_allocate()
549 if (acpi_irq_balance || !link->irq.active) { acpi_pci_link_allocate()
554 for (i = (link->irq.possible_count - 1); i >= 0; i--) { acpi_pci_link_allocate()
556 acpi_irq_penalty[link->irq.possible[i]]) acpi_pci_link_allocate()
557 irq = link->irq.possible[i]; acpi_pci_link_allocate()
561 /* Attempt to enable the link device at this IRQ. */ acpi_pci_link_allocate()
562 if (acpi_pci_link_set(link, irq)) { acpi_pci_link_allocate()
565 acpi_device_name(link->device), acpi_pci_link_allocate()
566 acpi_device_bid(link->device)); acpi_pci_link_allocate()
569 acpi_irq_penalty[link->irq.active] += PIRQ_PENALTY_PCI_USING; acpi_pci_link_allocate()
571 acpi_device_name(link->device), acpi_pci_link_allocate()
572 acpi_device_bid(link->device), link->irq.active); acpi_pci_link_allocate()
575 link->irq.initialized = 1; acpi_pci_link_allocate()
589 struct acpi_pci_link *link; acpi_pci_link_allocate_irq() local
593 printk(KERN_ERR PREFIX "Invalid link device\n"); acpi_pci_link_allocate_irq()
597 link = acpi_driver_data(device); acpi_pci_link_allocate_irq()
598 if (!link) { acpi_pci_link_allocate_irq()
599 printk(KERN_ERR PREFIX "Invalid link context\n"); acpi_pci_link_allocate_irq()
610 if (acpi_pci_link_allocate(link)) { acpi_pci_link_allocate_irq()
615 if (!link->irq.active) { acpi_pci_link_allocate_irq()
620 link->refcnt++; acpi_pci_link_allocate_irq()
624 *triggering = link->irq.triggering; acpi_pci_link_allocate_irq()
626 *polarity = link->irq.polarity; acpi_pci_link_allocate_irq()
628 *name = acpi_device_bid(link->device); acpi_pci_link_allocate_irq()
631 acpi_device_bid(link->device))); acpi_pci_link_allocate_irq()
632 return (link->irq.active); acpi_pci_link_allocate_irq()
636 * We don't change link's irq information here. After it is reenabled, we
642 struct acpi_pci_link *link; acpi_pci_link_free_irq() local
647 printk(KERN_ERR PREFIX "Invalid link device\n"); acpi_pci_link_free_irq()
651 link = acpi_driver_data(device); acpi_pci_link_free_irq()
652 if (!link) { acpi_pci_link_free_irq()
653 printk(KERN_ERR PREFIX "Invalid link context\n"); acpi_pci_link_free_irq()
658 if (!link->irq.initialized) { acpi_pci_link_free_irq()
665 * The Link reference count allows us to _DISable an unused link acpi_pci_link_free_irq()
668 * which blindly restores the link state. acpi_pci_link_free_irq()
673 link->refcnt--; acpi_pci_link_free_irq()
677 acpi_device_bid(link->device))); acpi_pci_link_free_irq()
679 if (link->refcnt == 0) acpi_pci_link_free_irq()
680 acpi_evaluate_object(link->device->handle, "_DIS", NULL, NULL); acpi_pci_link_free_irq()
683 return (link->irq.active); acpi_pci_link_free_irq()
694 struct acpi_pci_link *link; acpi_pci_link_add() local
698 link = kzalloc(sizeof(struct acpi_pci_link), GFP_KERNEL); acpi_pci_link_add()
699 if (!link) acpi_pci_link_add()
702 link->device = device; acpi_pci_link_add()
705 device->driver_data = link; acpi_pci_link_add()
708 result = acpi_pci_link_get_possible(link); acpi_pci_link_add()
712 /* query and set link->irq.active */ acpi_pci_link_add()
713 acpi_pci_link_get_current(link); acpi_pci_link_add()
717 for (i = 0; i < link->irq.possible_count; i++) { acpi_pci_link_add()
718 if (link->irq.active == link->irq.possible[i]) { acpi_pci_link_add()
719 printk(KERN_CONT " *%d", link->irq.possible[i]); acpi_pci_link_add()
722 printk(KERN_CONT " %d", link->irq.possible[i]); acpi_pci_link_add()
728 printk(KERN_CONT " *%d", link->irq.active); acpi_pci_link_add()
730 if (!link->device->status.enabled) acpi_pci_link_add()
735 list_add_tail(&link->list, &acpi_link_list); acpi_pci_link_add()
743 kfree(link); acpi_pci_link_add()
748 static int acpi_pci_link_resume(struct acpi_pci_link *link) acpi_pci_link_resume() argument
750 if (link->refcnt && link->irq.active && link->irq.initialized) acpi_pci_link_resume()
751 return (acpi_pci_link_set(link, link->irq.active)); acpi_pci_link_resume()
758 struct acpi_pci_link *link; irqrouter_resume() local
760 list_for_each_entry(link, &acpi_link_list, list) { irqrouter_resume()
761 acpi_pci_link_resume(link); irqrouter_resume()
767 struct acpi_pci_link *link; acpi_pci_link_remove() local
769 link = acpi_driver_data(device); acpi_pci_link_remove()
772 list_del(&link->list); acpi_pci_link_remove()
775 kfree(link); acpi_pci_link_remove()
H A Dpci_irq.c50 acpi_handle link; member in struct:acpi_prt_entry
51 u32 index; /* GSI, or link _CRS index */
115 * link device, but it is actually connected to the second.
138 /* All current quirks involve link devices, not GSIs */ do_prt_fixups()
194 * The 'source' field specifies the PCI interrupt link device used to acpi_pci_irq_check_entry()
197 * the link device) this interrupt is allocated from. acpi_pci_irq_check_entry()
205 acpi_get_handle(handle, prt->source, &entry->link); acpi_pci_irq_check_entry()
404 char *link = NULL; acpi_pci_irq_enable() local
431 if (entry->link) acpi_pci_irq_enable()
432 gsi = acpi_pci_link_allocate_irq(entry->link, acpi_pci_irq_enable()
435 &link); acpi_pci_irq_enable()
464 if (link) acpi_pci_irq_enable()
465 snprintf(link_desc, sizeof(link_desc), " -> Link[%s]", link); acpi_pci_irq_enable()
500 if (entry->link) acpi_pci_irq_disable()
501 gsi = acpi_pci_link_free_irq(entry->link); acpi_pci_irq_disable()
/linux-4.1.27/drivers/usb/host/
H A Dsl811_cs.c47 static void sl811_cs_release(struct pcmcia_device * link);
106 * initialized already because of the link order dependency created sl811_hc_init()
115 static void sl811_cs_detach(struct pcmcia_device *link) sl811_cs_detach() argument
117 dev_dbg(&link->dev, "sl811_cs_detach\n"); sl811_cs_detach()
119 sl811_cs_release(link); sl811_cs_detach()
122 kfree(link->priv); sl811_cs_detach()
125 static void sl811_cs_release(struct pcmcia_device * link) sl811_cs_release() argument
127 dev_dbg(&link->dev, "sl811_cs_release\n"); sl811_cs_release()
129 pcmcia_disable_device(link); sl811_cs_release()
142 static int sl811_cs_config(struct pcmcia_device *link) sl811_cs_config() argument
144 struct device *parent = &link->dev; sl811_cs_config()
147 dev_dbg(&link->dev, "sl811_cs_config\n"); sl811_cs_config()
149 link->config_flags |= CONF_ENABLE_IRQ | CONF_AUTO_SET_VPP | sl811_cs_config()
152 if (pcmcia_loop_config(link, sl811_cs_config_check, NULL)) sl811_cs_config()
156 if (resource_size(link->resource[0]) < 2) sl811_cs_config()
159 if (!link->irq) sl811_cs_config()
162 ret = pcmcia_enable_device(link); sl811_cs_config()
166 if (sl811_hc_init(parent, link->resource[0]->start, link->irq) sl811_cs_config()
170 sl811_cs_release(link); sl811_cs_config()
176 static int sl811_cs_probe(struct pcmcia_device *link) sl811_cs_probe() argument
183 local->p_dev = link; sl811_cs_probe()
184 link->priv = local; sl811_cs_probe()
186 return sl811_cs_config(link); sl811_cs_probe()
H A Duhci-debug.c50 out += sprintf(out, "%*s[%p] link (%08x) ", space, "", td, uhci_show_td()
51 hc32_to_cpu(uhci, td->link)); uhci_show_td()
180 out += sprintf(out, "%*s[%p] %s QH link (%08x) element (%08x)\n", uhci_show_qh()
182 hc32_to_cpu(uhci, qh->link), uhci_show_qh()
381 __hc32 link; uhci_sprint_schedule() local
420 link = uhci->frame[i]; uhci_sprint_schedule()
426 i, hc32_to_cpu(uhci, link)); uhci_sprint_schedule()
435 if (link != LINK_TO_TD(uhci, td)) { uhci_sprint_schedule()
438 " link does not match list entry!\n"); uhci_sprint_schedule()
450 link = td->link; uhci_sprint_schedule()
455 if (link != qh_dma) { uhci_sprint_schedule()
460 i, hc32_to_cpu(uhci, link)); uhci_sprint_schedule()
464 " link does not match QH (%08x)!\n", uhci_sprint_schedule()
499 link = fsbr_link; uhci_sprint_schedule()
500 if (!link) uhci_sprint_schedule()
501 link = LINK_TO_QH(uhci, uhci->skel_term_qh); uhci_sprint_schedule()
523 link = UHCI_PTR_TERM(uhci); uhci_sprint_schedule()
527 link = LINK_TO_QH(uhci, uhci->skel_async_qh); uhci_sprint_schedule()
531 link = LINK_TO_QH(uhci, uhci->skel_term_qh); uhci_sprint_schedule()
533 if (qh->link != link) uhci_sprint_schedule()
/linux-4.1.27/drivers/isdn/hardware/avm/
H A Davm_cs.c40 static int avmcs_config(struct pcmcia_device *link);
41 static void avmcs_release(struct pcmcia_device *link);
55 static void avmcs_detach(struct pcmcia_device *link) avmcs_detach() argument
57 avmcs_release(link); avmcs_detach()
69 static int avmcs_config(struct pcmcia_device *link) avmcs_config() argument
77 if (link->prod_id[1]) avmcs_config()
78 strlcpy(devname, link->prod_id[1], sizeof(devname)); avmcs_config()
83 if (pcmcia_loop_config(link, avmcs_configcheck, NULL)) avmcs_config()
87 if (!link->irq) { avmcs_config()
89 pcmcia_disable_device(link); avmcs_config()
96 i = pcmcia_enable_device(link); avmcs_config()
98 pcmcia_disable_device(link); avmcs_config()
121 avmcs_release(link); avmcs_config()
132 if ((i = (*addcard)(link->resource[0]->start, link->irq)) < 0) { avmcs_config()
133 dev_err(&link->dev, avmcs_config()
135 (unsigned int) link->resource[0]->start, link->irq); avmcs_config()
136 avmcs_release(link); avmcs_config()
144 static void avmcs_release(struct pcmcia_device *link) avmcs_release() argument
146 b1pcmcia_delcard(link->resource[0]->start, link->irq); avmcs_release()
147 pcmcia_disable_device(link); avmcs_release()
/linux-4.1.27/tools/perf/util/
H A Denvironment.c3 * file, so that programs can link against the config parser
4 * without having to link against all the rest of perf.
/linux-4.1.27/fs/affs/
H A Dsymlink.c17 char *link = kmap(page); affs_symlink_readpage() local
41 link[i++] = c; affs_symlink_readpage()
44 link[i++] = lf->symname[j++]; affs_symlink_readpage()
46 link[i++] = '/'; affs_symlink_readpage()
52 link[i++] = '.'; affs_symlink_readpage()
53 link[i++] = '.'; affs_symlink_readpage()
55 link[i++] = c; affs_symlink_readpage()
59 link[i] = '\0'; affs_symlink_readpage()
/linux-4.1.27/drivers/staging/ft1000/ft1000-pcmcia/
H A Dft1000_cs.c44 static int ft1000_config(struct pcmcia_device *link);
45 static void ft1000_detach(struct pcmcia_device *link);
46 static int ft1000_attach(struct pcmcia_device *link);
52 static void ft1000_reset(struct pcmcia_device *link) ft1000_reset() argument
54 pcmcia_reset_card(link->socket); ft1000_reset()
57 static int ft1000_attach(struct pcmcia_device *link) ft1000_attach() argument
59 link->priv = NULL; ft1000_attach()
60 link->config_flags |= CONF_ENABLE_IRQ | CONF_AUTO_SET_IO; ft1000_attach()
62 return ft1000_config(link); ft1000_attach()
65 static void ft1000_detach(struct pcmcia_device *link) ft1000_detach() argument
67 struct net_device *dev = link->priv; ft1000_detach()
72 pcmcia_disable_device(link); ft1000_detach()
76 static int ft1000_confcheck(struct pcmcia_device *link, void *priv_data) ft1000_confcheck() argument
78 return pcmcia_request_io(link); ft1000_confcheck()
89 static int ft1000_config(struct pcmcia_device *link) ft1000_config() argument
93 dev_dbg(&link->dev, "ft1000_cs: ft1000_config(0x%p)\n", link); ft1000_config()
96 ret = pcmcia_loop_config(link, ft1000_confcheck, NULL); ft1000_config()
98 dev_err(&link->dev, "Could not configure pcmcia\n"); ft1000_config()
103 ret = pcmcia_enable_device(link); ft1000_config()
105 dev_err(&link->dev, "Could not enable pcmcia\n"); ft1000_config()
109 link->priv = init_ft1000_card(link, &ft1000_reset); ft1000_config()
110 if (!link->priv) { ft1000_config()
111 dev_err(&link->dev, "Could not register as network device\n"); ft1000_config()
119 pcmcia_disable_device(link); ft1000_config()
123 static int ft1000_suspend(struct pcmcia_device *link) ft1000_suspend() argument
125 struct net_device *dev = link->priv; ft1000_suspend()
127 if (link->open) ft1000_suspend()
132 static int ft1000_resume(struct pcmcia_device *link) ft1000_resume() argument
/linux-4.1.27/drivers/scsi/pcmcia/
H A Dfdomain_stub.c68 static void fdomain_release(struct pcmcia_device *link);
70 static int fdomain_config(struct pcmcia_device *link);
72 static int fdomain_probe(struct pcmcia_device *link) fdomain_probe() argument
76 dev_dbg(&link->dev, "fdomain_attach()\n"); fdomain_probe()
83 info->p_dev = link; fdomain_probe()
84 link->priv = info; fdomain_probe()
85 link->config_flags |= CONF_ENABLE_IRQ | CONF_AUTO_SET_IO; fdomain_probe()
86 link->config_regs = PRESENT_OPTION; fdomain_probe()
88 return fdomain_config(link); fdomain_probe()
93 static void fdomain_detach(struct pcmcia_device *link) fdomain_detach() argument
95 dev_dbg(&link->dev, "fdomain_detach\n"); fdomain_detach()
97 fdomain_release(link); fdomain_detach()
99 kfree(link->priv); fdomain_detach()
114 static int fdomain_config(struct pcmcia_device *link) fdomain_config() argument
116 scsi_info_t *info = link->priv; fdomain_config()
121 dev_dbg(&link->dev, "fdomain_config\n"); fdomain_config()
123 ret = pcmcia_loop_config(link, fdomain_config_check, NULL); fdomain_config()
127 if (!link->irq) fdomain_config()
129 ret = pcmcia_enable_device(link); fdomain_config()
134 release_region(link->resource[0]->start, resource_size(link->resource[0])); fdomain_config()
137 sprintf(str, "%d,%d", (unsigned int) link->resource[0]->start, link->irq); fdomain_config()
155 fdomain_release(link); fdomain_config()
161 static void fdomain_release(struct pcmcia_device *link) fdomain_release() argument
163 scsi_info_t *info = link->priv; fdomain_release()
165 dev_dbg(&link->dev, "fdomain_release\n"); fdomain_release()
168 pcmcia_disable_device(link); fdomain_release()
174 static int fdomain_resume(struct pcmcia_device *link) fdomain_resume() argument
H A Dqlogic_stub.c87 static void qlogic_release(struct pcmcia_device *link);
89 static int qlogic_config(struct pcmcia_device * link);
92 struct pcmcia_device *link, int qbase, int qlirq) qlogic_detect()
146 static int qlogic_probe(struct pcmcia_device *link) qlogic_probe() argument
150 dev_dbg(&link->dev, "qlogic_attach()\n"); qlogic_probe()
156 info->p_dev = link; qlogic_probe()
157 link->priv = info; qlogic_probe()
158 link->config_flags |= CONF_ENABLE_IRQ | CONF_AUTO_SET_IO; qlogic_probe()
159 link->config_regs = PRESENT_OPTION; qlogic_probe()
161 return qlogic_config(link); qlogic_probe()
166 static void qlogic_detach(struct pcmcia_device *link) qlogic_detach() argument
168 dev_dbg(&link->dev, "qlogic_detach\n"); qlogic_detach()
170 qlogic_release(link); qlogic_detach()
171 kfree(link->priv); qlogic_detach()
189 static int qlogic_config(struct pcmcia_device * link) qlogic_config() argument
191 scsi_info_t *info = link->priv; qlogic_config()
195 dev_dbg(&link->dev, "qlogic_config\n"); qlogic_config()
197 ret = pcmcia_loop_config(link, qlogic_config_check, NULL); qlogic_config()
201 if (!link->irq) qlogic_config()
204 ret = pcmcia_enable_device(link); qlogic_config()
210 outb(0xb4, link->resource[0]->start + 0xd); qlogic_config()
211 outb(0x24, link->resource[0]->start + 0x9); qlogic_config()
212 outb(0x04, link->resource[0]->start + 0xd); qlogic_config()
216 if (resource_size(link->resource[0]) == 32) qlogic_config()
217 host = qlogic_detect(&qlogicfas_driver_template, link, qlogic_config()
218 link->resource[0]->start + 16, link->irq); qlogic_config()
220 host = qlogic_detect(&qlogicfas_driver_template, link, qlogic_config()
221 link->resource[0]->start, link->irq); qlogic_config()
233 pcmcia_disable_device(link); qlogic_config()
239 static void qlogic_release(struct pcmcia_device *link) qlogic_release() argument
241 scsi_info_t *info = link->priv; qlogic_release()
243 dev_dbg(&link->dev, "qlogic_release\n"); qlogic_release()
247 free_irq(link->irq, info->host); qlogic_release()
248 pcmcia_disable_device(link); qlogic_release()
255 static int qlogic_resume(struct pcmcia_device *link) qlogic_resume() argument
257 scsi_info_t *info = link->priv; qlogic_resume()
259 pcmcia_enable_device(link); qlogic_resume()
263 outb(0x80, link->resource[0]->start + 0xd); qlogic_resume()
264 outb(0x24, link->resource[0]->start + 0x9); qlogic_resume()
265 outb(0x04, link->resource[0]->start + 0xd); qlogic_resume()
91 qlogic_detect(struct scsi_host_template *host, struct pcmcia_device *link, int qbase, int qlirq) qlogic_detect() argument
H A Daha152x_stub.c84 static void aha152x_release_cs(struct pcmcia_device *link);
86 static int aha152x_config_cs(struct pcmcia_device *link);
88 static int aha152x_probe(struct pcmcia_device *link) aha152x_probe() argument
92 dev_dbg(&link->dev, "aha152x_attach()\n"); aha152x_probe()
97 info->p_dev = link; aha152x_probe()
98 link->priv = info; aha152x_probe()
100 link->config_flags |= CONF_ENABLE_IRQ | CONF_AUTO_SET_IO; aha152x_probe()
101 link->config_regs = PRESENT_OPTION; aha152x_probe()
103 return aha152x_config_cs(link); aha152x_probe()
108 static void aha152x_detach(struct pcmcia_device *link) aha152x_detach() argument
110 dev_dbg(&link->dev, "aha152x_detach\n"); aha152x_detach()
112 aha152x_release_cs(link); aha152x_detach()
115 kfree(link->priv); aha152x_detach()
140 static int aha152x_config_cs(struct pcmcia_device *link) aha152x_config_cs() argument
142 scsi_info_t *info = link->priv; aha152x_config_cs()
147 dev_dbg(&link->dev, "aha152x_config\n"); aha152x_config_cs()
149 ret = pcmcia_loop_config(link, aha152x_config_check, NULL); aha152x_config_cs()
153 if (!link->irq) aha152x_config_cs()
156 ret = pcmcia_enable_device(link); aha152x_config_cs()
163 s.io_port = link->resource[0]->start; aha152x_config_cs()
164 s.irq = link->irq; aha152x_config_cs()
184 aha152x_release_cs(link); aha152x_config_cs()
188 static void aha152x_release_cs(struct pcmcia_device *link) aha152x_release_cs() argument
190 scsi_info_t *info = link->priv; aha152x_release_cs()
193 pcmcia_disable_device(link); aha152x_release_cs()
196 static int aha152x_resume(struct pcmcia_device *link) aha152x_resume() argument
198 scsi_info_t *info = link->priv; aha152x_resume()
H A Dsym53c500_cs.c509 SYM53C500_release(struct pcmcia_device *link) SYM53C500_release() argument
511 struct scsi_info_t *info = link->priv; SYM53C500_release()
514 dev_dbg(&link->dev, "SYM53C500_release\n"); SYM53C500_release()
530 pcmcia_disable_device(link); SYM53C500_release()
701 SYM53C500_config(struct pcmcia_device *link) SYM53C500_config() argument
703 struct scsi_info_t *info = link->priv; SYM53C500_config()
710 dev_dbg(&link->dev, "SYM53C500_config\n"); SYM53C500_config()
712 info->manf_id = link->manf_id; SYM53C500_config()
714 ret = pcmcia_loop_config(link, SYM53C500_config_check, NULL); SYM53C500_config()
718 if (!link->irq) SYM53C500_config()
721 ret = pcmcia_enable_device(link); SYM53C500_config()
734 outb(0xb4, link->resource[0]->start + 0xd); SYM53C500_config()
735 outb(0x24, link->resource[0]->start + 0x9); SYM53C500_config()
736 outb(0x04, link->resource[0]->start + 0xd); SYM53C500_config()
749 port_base = link->resource[0]->start; SYM53C500_config()
750 irq_level = link->irq; SYM53C500_config()
810 SYM53C500_release(link); SYM53C500_config()
814 static int sym53c500_resume(struct pcmcia_device *link) sym53c500_resume() argument
816 struct scsi_info_t *info = link->priv; sym53c500_resume()
822 outb(0x80, link->resource[0]->start + 0xd); sym53c500_resume()
823 outb(0x24, link->resource[0]->start + 0x9); sym53c500_resume()
824 outb(0x04, link->resource[0]->start + 0xd); sym53c500_resume()
830 SYM53C500_int_host_reset(link->resource[0]->start); sym53c500_resume()
836 SYM53C500_detach(struct pcmcia_device *link) SYM53C500_detach() argument
838 dev_dbg(&link->dev, "SYM53C500_detach\n"); SYM53C500_detach()
840 SYM53C500_release(link); SYM53C500_detach()
842 kfree(link->priv); SYM53C500_detach()
843 link->priv = NULL; SYM53C500_detach()
847 SYM53C500_probe(struct pcmcia_device *link) SYM53C500_probe() argument
851 dev_dbg(&link->dev, "SYM53C500_attach()\n"); SYM53C500_probe()
857 info->p_dev = link; SYM53C500_probe()
858 link->priv = info; SYM53C500_probe()
859 link->config_flags |= CONF_ENABLE_IRQ | CONF_AUTO_SET_IO; SYM53C500_probe()
861 return SYM53C500_config(link); SYM53C500_probe()
H A Dnsp_cs.c1505 static int nsp_cs_probe(struct pcmcia_device *link) nsp_cs_probe() argument
1516 info->p_dev = link; nsp_cs_probe()
1517 link->priv = info; nsp_cs_probe()
1522 ret = nsp_cs_config(link); nsp_cs_probe()
1524 nsp_dbg(NSP_DEBUG_INIT, "link=0x%p", link); nsp_cs_probe()
1529 static void nsp_cs_detach(struct pcmcia_device *link) nsp_cs_detach() argument
1531 nsp_dbg(NSP_DEBUG_INIT, "in, link=0x%p", link); nsp_cs_detach()
1533 ((scsi_info_t *)link->priv)->stop = 1; nsp_cs_detach()
1534 nsp_cs_release(link); nsp_cs_detach()
1536 kfree(link->priv); nsp_cs_detach()
1537 link->priv = NULL; nsp_cs_detach()
1578 static int nsp_cs_config(struct pcmcia_device *link) nsp_cs_config() argument
1581 scsi_info_t *info = link->priv; nsp_cs_config()
1587 link->config_flags |= CONF_ENABLE_IRQ | CONF_AUTO_CHECK_VCC | nsp_cs_config()
1591 ret = pcmcia_loop_config(link, nsp_cs_config_check, data); nsp_cs_config()
1595 if (pcmcia_request_irq(link, nspintr)) nsp_cs_config()
1598 ret = pcmcia_enable_device(link); nsp_cs_config()
1603 if (link->resource[0]) { nsp_cs_config()
1604 release_region(link->resource[0]->start, nsp_cs_config()
1605 resource_size(link->resource[0])); nsp_cs_config()
1607 if (link->resource[1]) { nsp_cs_config()
1608 release_region(link->resource[1]->start, nsp_cs_config()
1609 resource_size(link->resource[1])); nsp_cs_config()
1614 data->BaseAddress = link->resource[0]->start; nsp_cs_config()
1615 data->NumAddress = resource_size(link->resource[0]); nsp_cs_config()
1616 data->IrqNumber = link->irq; nsp_cs_config()
1645 nsp_cs_release(link); nsp_cs_config()
1651 static void nsp_cs_release(struct pcmcia_device *link) nsp_cs_release() argument
1653 scsi_info_t *info = link->priv; nsp_cs_release()
1662 nsp_dbg(NSP_DEBUG_INIT, "link=0x%p", link); nsp_cs_release()
1669 if (resource_size(link->resource[2])) { nsp_cs_release()
1674 pcmcia_disable_device(link); nsp_cs_release()
1681 static int nsp_cs_suspend(struct pcmcia_device *link) nsp_cs_suspend() argument
1683 scsi_info_t *info = link->priv; nsp_cs_suspend()
1701 static int nsp_cs_resume(struct pcmcia_device *link) nsp_cs_resume() argument
1703 scsi_info_t *info = link->priv; nsp_cs_resume()
/linux-4.1.27/drivers/parport/
H A Dparport_cs.c80 static int parport_config(struct pcmcia_device *link);
83 static int parport_probe(struct pcmcia_device *link) parport_probe() argument
87 dev_dbg(&link->dev, "parport_attach()\n"); parport_probe()
92 link->priv = info; parport_probe()
93 info->p_dev = link; parport_probe()
95 link->config_flags |= CONF_ENABLE_IRQ | CONF_AUTO_SET_IO; parport_probe()
97 return parport_config(link); parport_probe()
100 static void parport_detach(struct pcmcia_device *link) parport_detach() argument
102 dev_dbg(&link->dev, "parport_detach\n"); parport_detach()
104 parport_cs_release(link); parport_detach()
106 kfree(link->priv); parport_detach()
119 static int parport_config(struct pcmcia_device *link) parport_config() argument
121 parport_info_t *info = link->priv; parport_config()
125 dev_dbg(&link->dev, "parport_config\n"); parport_config()
128 link->config_index |= FORCE_EPP_MODE; parport_config()
130 ret = pcmcia_loop_config(link, parport_config_check, NULL); parport_config()
134 if (!link->irq) parport_config()
136 ret = pcmcia_enable_device(link); parport_config()
140 p = parport_pc_probe_port(link->resource[0]->start, parport_config()
141 link->resource[1]->start, parport_config()
142 link->irq, PARPORT_DMA_NONE, parport_config()
143 &link->dev, IRQF_SHARED); parport_config()
147 (unsigned int) link->resource[0]->start, parport_config()
148 link->irq); parport_config()
161 parport_cs_release(link); parport_config()
165 static void parport_cs_release(struct pcmcia_device *link) parport_cs_release() argument
167 parport_info_t *info = link->priv; parport_cs_release()
169 dev_dbg(&link->dev, "parport_release\n"); parport_cs_release()
177 pcmcia_disable_device(link); parport_cs_release()
/linux-4.1.27/drivers/net/wireless/rt2x00/
H A Drt2x00link.c21 Abstract: rt2x00 generic link tuning routines.
53 struct link_ant *ant = &rt2x00dev->link.ant; rt2x00link_antenna_get_link_rssi()
55 if (rt2x00dev->link.qual.rx_success) rt2x00link_antenna_get_link_rssi()
63 struct link_ant *ant = &rt2x00dev->link.ant; rt2x00link_antenna_get_rssi_history()
73 struct link_ant *ant = &rt2x00dev->link.ant; rt2x00link_antenna_update_rssi_history()
79 ewma_init(&rt2x00dev->link.ant.rssi_ant, RT2X00_EWMA_FACTOR, rt2x00link_antenna_reset()
85 struct link_ant *ant = &rt2x00dev->link.ant; rt2x00lib_antenna_diversity_sample()
126 struct link_ant *ant = &rt2x00dev->link.ant; rt2x00lib_antenna_diversity_eval()
166 struct link_ant *ant = &rt2x00dev->link.ant; rt2x00lib_antenna_diversity()
187 } else if (rt2x00dev->link.count & 1) { rt2x00lib_antenna_diversity()
199 struct link *link = &rt2x00dev->link; rt2x00link_update_stats() local
200 struct link_qual *qual = &rt2x00dev->link.qual; rt2x00link_update_stats()
201 struct link_ant *ant = &rt2x00dev->link.ant; rt2x00link_update_stats()
228 ewma_add(&link->avg_rssi, -rxdesc->rssi); rt2x00link_update_stats()
238 struct link *link = &rt2x00dev->link; rt2x00link_start_tuner() local
243 * don't need link tuning and monitor mode interfaces rt2x00link_start_tuner()
244 * should never have to work with link tuners. rt2x00link_start_tuner()
250 * While scanning, link tuning is disabled. By default rt2x00link_start_tuner()
262 &link->work, LINK_TUNE_INTERVAL); rt2x00link_start_tuner()
267 cancel_delayed_work_sync(&rt2x00dev->link.work); rt2x00link_stop_tuner()
272 struct link_qual *qual = &rt2x00dev->link.qual; rt2x00link_reset_tuner()
279 * Reset link information. rt2x00link_reset_tuner()
281 * the link tuner counter should be reset. Resetting rt2x00link_reset_tuner()
283 * device should only perform link tuning during the rt2x00link_reset_tuner()
286 rt2x00dev->link.count = 0; rt2x00link_reset_tuner()
288 ewma_init(&rt2x00dev->link.avg_rssi, RT2X00_EWMA_FACTOR, rt2x00link_reset_tuner()
299 * Reset the link tuner. rt2x00link_reset_tuner()
309 struct link_qual *qual = &rt2x00dev->link.qual; rt2x00link_reset_qual()
320 container_of(work, struct rt2x00_dev, link.work.work); rt2x00link_tuner()
321 struct link *link = &rt2x00dev->link; rt2x00link_tuner() local
322 struct link_qual *qual = &rt2x00dev->link.qual; rt2x00link_tuner()
326 * immediately cease all link tuning. rt2x00link_tuner()
339 * Update quality RSSI for link tuning, rt2x00link_tuner()
347 qual->rssi = rt2x00link_get_avg_rssi(&link->avg_rssi); rt2x00link_tuner()
350 * Check if link tuning is supported by the hardware, some hardware rt2x00link_tuner()
351 * do not support link tuning at all, while other devices can disable rt2x00link_tuner()
355 rt2x00dev->ops->lib->link_tuner(rt2x00dev, qual, link->count); rt2x00link_tuner()
371 * Increase tuner counter, and reschedule the next link tuner run. rt2x00link_tuner()
373 link->count++; rt2x00link_tuner()
377 &link->work, LINK_TUNE_INTERVAL); rt2x00link_tuner()
382 struct link *link = &rt2x00dev->link; rt2x00link_start_watchdog() local
387 &link->watchdog_work, rt2x00link_start_watchdog()
393 cancel_delayed_work_sync(&rt2x00dev->link.watchdog_work); rt2x00link_stop_watchdog()
399 container_of(work, struct rt2x00_dev, link.watchdog_work.work); rt2x00link_watchdog()
400 struct link *link = &rt2x00dev->link; rt2x00link_watchdog() local
413 &link->watchdog_work, rt2x00link_watchdog()
419 struct link *link = &rt2x00dev->link; rt2x00link_start_agc() local
424 &link->agc_work, rt2x00link_start_agc()
430 struct link *link = &rt2x00dev->link; rt2x00link_start_vcocal() local
435 &link->vco_work, rt2x00link_start_vcocal()
441 cancel_delayed_work_sync(&rt2x00dev->link.agc_work); rt2x00link_stop_agc()
446 cancel_delayed_work_sync(&rt2x00dev->link.vco_work); rt2x00link_stop_vcocal()
452 container_of(work, struct rt2x00_dev, link.agc_work.work); rt2x00link_agc()
453 struct link *link = &rt2x00dev->link; rt2x00link_agc() local
466 &link->agc_work, rt2x00link_agc()
473 container_of(work, struct rt2x00_dev, link.vco_work.work); rt2x00link_vcocal()
474 struct link *link = &rt2x00dev->link; rt2x00link_vcocal() local
487 &link->vco_work, rt2x00link_vcocal()
493 INIT_DELAYED_WORK(&rt2x00dev->link.agc_work, rt2x00link_agc); rt2x00link_register()
495 INIT_DELAYED_WORK(&rt2x00dev->link.vco_work, rt2x00link_vcocal); rt2x00link_register()
496 INIT_DELAYED_WORK(&rt2x00dev->link.watchdog_work, rt2x00link_watchdog); rt2x00link_register()
497 INIT_DELAYED_WORK(&rt2x00dev->link.work, rt2x00link_tuner); rt2x00link_register()
/linux-4.1.27/drivers/net/arcnet/
H A Dcom20020_cs.c108 static int com20020_config(struct pcmcia_device *link);
109 static void com20020_release(struct pcmcia_device *link);
157 static void com20020_detach(struct pcmcia_device *link) com20020_detach() argument
159 struct com20020_dev *info = link->priv; com20020_detach()
162 dev_dbg(&link->dev, "detach...\n"); com20020_detach()
164 dev_dbg(&link->dev, "com20020_detach\n"); com20020_detach()
166 dev_dbg(&link->dev, "unregister...\n"); com20020_detach()
177 com20020_release(link); com20020_detach()
180 dev_dbg(&link->dev, "unlinking...\n"); com20020_detach()
181 if (link->priv) com20020_detach()
186 dev_dbg(&link->dev, "kfree...\n"); com20020_detach()
189 dev_dbg(&link->dev, "kfree2...\n"); com20020_detach()
195 static int com20020_config(struct pcmcia_device *link) com20020_config() argument
203 info = link->priv; com20020_config()
206 dev_dbg(&link->dev, "config...\n"); com20020_config()
208 dev_dbg(&link->dev, "com20020_config\n"); com20020_config()
210 dev_dbg(&link->dev, "baseport1 is %Xh\n", com20020_config()
211 (unsigned int) link->resource[0]->start); com20020_config()
214 link->io_lines = 16; com20020_config()
216 if (!link->resource[0]->start) com20020_config()
220 link->resource[0]->start = ioaddr; com20020_config()
221 i = pcmcia_request_io(link); com20020_config()
227 i = pcmcia_request_io(link); com20020_config()
231 dev_dbg(&link->dev, "requestIO failed totally!\n"); com20020_config()
235 ioaddr = dev->base_addr = link->resource[0]->start; com20020_config()
236 dev_dbg(&link->dev, "got ioaddr %Xh\n", ioaddr); com20020_config()
238 dev_dbg(&link->dev, "request IRQ %d\n", com20020_config()
239 link->irq); com20020_config()
240 if (!link->irq) com20020_config()
242 dev_dbg(&link->dev, "requestIRQ failed totally!\n"); com20020_config()
246 dev->irq = link->irq; com20020_config()
248 ret = pcmcia_enable_device(link); com20020_config()
262 SET_NETDEV_DEV(dev, &link->dev); com20020_config()
267 dev_notice(&link->dev, com20020_config()
277 dev_dbg(&link->dev, "com20020_config failed...\n"); com20020_config()
278 com20020_release(link); com20020_config()
282 static void com20020_release(struct pcmcia_device *link) com20020_release() argument
284 dev_dbg(&link->dev, "com20020_release\n"); com20020_release()
285 pcmcia_disable_device(link); com20020_release()
288 static int com20020_suspend(struct pcmcia_device *link) com20020_suspend() argument
290 struct com20020_dev *info = link->priv; com20020_suspend()
293 if (link->open) com20020_suspend()
299 static int com20020_resume(struct pcmcia_device *link) com20020_resume() argument
301 struct com20020_dev *info = link->priv; com20020_resume()
304 if (link->open) { com20020_resume()
/linux-4.1.27/arch/arm/kernel/
H A Dinsn.c6 __arm_gen_branch_thumb2(unsigned long pc, unsigned long addr, bool link) __arm_gen_branch_thumb2() argument
29 if (link) __arm_gen_branch_thumb2()
36 __arm_gen_branch_arm(unsigned long pc, unsigned long addr, bool link) __arm_gen_branch_arm() argument
41 if (link) __arm_gen_branch_arm()
56 __arm_gen_branch(unsigned long pc, unsigned long addr, bool link) __arm_gen_branch() argument
59 return __arm_gen_branch_thumb2(pc, addr, link); __arm_gen_branch()
61 return __arm_gen_branch_arm(pc, addr, link); __arm_gen_branch()
/linux-4.1.27/drivers/net/wireless/orinoco/
H A Dspectrum_cs.c63 static int spectrum_cs_config(struct pcmcia_device *link);
64 static void spectrum_cs_release(struct pcmcia_device *link);
77 spectrum_reset(struct pcmcia_device *link, int idle) spectrum_reset() argument
84 if (!pcmcia_dev_present(link)) spectrum_reset()
88 ret = pcmcia_read_config_byte(link, CISREG_COR, &save_cor); spectrum_reset()
93 ret = pcmcia_write_config_byte(link, CISREG_COR, spectrum_reset()
100 ret = pcmcia_read_config_byte(link, CISREG_CCSR, &ccsr); spectrum_reset()
109 ret = pcmcia_write_config_byte(link, CISREG_CCSR, ccsr); spectrum_reset()
115 ret = pcmcia_write_config_byte(link, CISREG_COR, spectrum_reset()
134 struct pcmcia_device *link = card->p_dev; spectrum_cs_hard_reset() local
137 spectrum_reset(link, 0); spectrum_cs_hard_reset()
146 struct pcmcia_device *link = card->p_dev; spectrum_cs_stop_firmware() local
148 return spectrum_reset(link, idle); spectrum_cs_stop_firmware()
156 spectrum_cs_probe(struct pcmcia_device *link) spectrum_cs_probe() argument
161 priv = alloc_orinocodev(sizeof(*card), &link->dev, spectrum_cs_probe()
169 card->p_dev = link; spectrum_cs_probe()
170 link->priv = priv; spectrum_cs_probe()
172 return spectrum_cs_config(link); spectrum_cs_probe()
175 static void spectrum_cs_detach(struct pcmcia_device *link) spectrum_cs_detach() argument
177 struct orinoco_private *priv = link->priv; spectrum_cs_detach()
181 spectrum_cs_release(link); spectrum_cs_detach()
196 spectrum_cs_config(struct pcmcia_device *link) spectrum_cs_config() argument
198 struct orinoco_private *priv = link->priv; spectrum_cs_config()
203 link->config_flags |= CONF_AUTO_SET_VPP | CONF_AUTO_CHECK_VCC | spectrum_cs_config()
206 link->config_flags &= ~CONF_AUTO_CHECK_VCC; spectrum_cs_config()
207 ret = pcmcia_loop_config(link, spectrum_cs_config_check, NULL); spectrum_cs_config()
216 mem = ioport_map(link->resource[0]->start, spectrum_cs_config()
217 resource_size(link->resource[0])); spectrum_cs_config()
227 ret = pcmcia_request_irq(link, orinoco_interrupt); spectrum_cs_config()
231 ret = pcmcia_enable_device(link); spectrum_cs_config()
246 if (orinoco_if_add(priv, link->resource[0]->start, spectrum_cs_config()
247 link->irq, NULL) != 0) { spectrum_cs_config()
255 spectrum_cs_release(link); spectrum_cs_config()
260 spectrum_cs_release(struct pcmcia_device *link) spectrum_cs_release() argument
262 struct orinoco_private *priv = link->priv; spectrum_cs_release()
271 pcmcia_disable_device(link); spectrum_cs_release()
278 spectrum_cs_suspend(struct pcmcia_device *link) spectrum_cs_suspend() argument
280 struct orinoco_private *priv = link->priv; spectrum_cs_suspend()
290 spectrum_cs_resume(struct pcmcia_device *link) spectrum_cs_resume() argument
292 struct orinoco_private *priv = link->priv; spectrum_cs_resume()
H A Dorinoco_cs.c62 static int orinoco_cs_config(struct pcmcia_device *link);
63 static void orinoco_cs_release(struct pcmcia_device *link);
74 struct pcmcia_device *link = card->p_dev; orinoco_cs_hard_reset() local
80 err = pcmcia_reset_card(link->socket); orinoco_cs_hard_reset()
95 orinoco_cs_probe(struct pcmcia_device *link) orinoco_cs_probe() argument
100 priv = alloc_orinocodev(sizeof(*card), &link->dev, orinoco_cs_probe()
107 card->p_dev = link; orinoco_cs_probe()
108 link->priv = priv; orinoco_cs_probe()
110 return orinoco_cs_config(link); orinoco_cs_probe()
113 static void orinoco_cs_detach(struct pcmcia_device *link) orinoco_cs_detach() argument
115 struct orinoco_private *priv = link->priv; orinoco_cs_detach()
119 orinoco_cs_release(link); orinoco_cs_detach()
133 orinoco_cs_config(struct pcmcia_device *link) orinoco_cs_config() argument
135 struct orinoco_private *priv = link->priv; orinoco_cs_config()
140 link->config_flags |= CONF_AUTO_SET_VPP | CONF_AUTO_CHECK_VCC | orinoco_cs_config()
143 link->config_flags &= ~CONF_AUTO_CHECK_VCC; orinoco_cs_config()
144 ret = pcmcia_loop_config(link, orinoco_cs_config_check, NULL); orinoco_cs_config()
153 mem = ioport_map(link->resource[0]->start, orinoco_cs_config()
154 resource_size(link->resource[0])); orinoco_cs_config()
163 ret = pcmcia_request_irq(link, orinoco_interrupt); orinoco_cs_config()
167 ret = pcmcia_enable_device(link); orinoco_cs_config()
178 if (orinoco_if_add(priv, link->resource[0]->start, orinoco_cs_config()
179 link->irq, NULL) != 0) { orinoco_cs_config()
187 orinoco_cs_release(link); orinoco_cs_config()
192 orinoco_cs_release(struct pcmcia_device *link) orinoco_cs_release() argument
194 struct orinoco_private *priv = link->priv; orinoco_cs_release()
203 pcmcia_disable_device(link); orinoco_cs_release()
208 static int orinoco_cs_suspend(struct pcmcia_device *link) orinoco_cs_suspend() argument
210 struct orinoco_private *priv = link->priv; orinoco_cs_suspend()
222 static int orinoco_cs_resume(struct pcmcia_device *link) orinoco_cs_resume() argument
224 struct orinoco_private *priv = link->priv; orinoco_cs_resume()
/linux-4.1.27/drivers/pci/pcie/
H A Daspm.c3 * Enabling PCIe link L0s/L1 state and Clock Power Management
43 struct pcie_link_state *root; /* pointer to the root port link */
46 struct list_head children; /* list of child link states */
47 struct list_head link; /* node in parent's children list */ member in struct:pcie_link_state
96 static int policy_to_aspm_state(struct pcie_link_state *link) policy_to_aspm_state() argument
106 return link->aspm_default; policy_to_aspm_state()
111 static int policy_to_clkpm_state(struct pcie_link_state *link) policy_to_clkpm_state() argument
121 return link->clkpm_default; policy_to_clkpm_state()
126 static void pcie_set_clkpm_nocheck(struct pcie_link_state *link, int enable) pcie_set_clkpm_nocheck() argument
129 struct pci_bus *linkbus = link->pdev->subordinate; pcie_set_clkpm_nocheck()
139 link->clkpm_enabled = !!enable; pcie_set_clkpm_nocheck()
142 static void pcie_set_clkpm(struct pcie_link_state *link, int enable) pcie_set_clkpm() argument
144 /* Don't enable Clock PM if the link is not Clock PM capable */ pcie_set_clkpm()
145 if (!link->clkpm_capable && enable) pcie_set_clkpm()
148 if (link->clkpm_enabled == enable) pcie_set_clkpm()
150 pcie_set_clkpm_nocheck(link, enable); pcie_set_clkpm()
153 static void pcie_clkpm_cap_init(struct pcie_link_state *link, int blacklist) pcie_clkpm_cap_init() argument
159 struct pci_bus *linkbus = link->pdev->subordinate; pcie_clkpm_cap_init()
173 link->clkpm_enabled = enabled; pcie_clkpm_cap_init()
174 link->clkpm_default = enabled; pcie_clkpm_cap_init()
175 link->clkpm_capable = (blacklist) ? 0 : capable; pcie_clkpm_cap_init()
179 * pcie_aspm_configure_common_clock: check if the 2 ends of a link
183 static void pcie_aspm_configure_common_clock(struct pcie_link_state *link) pcie_aspm_configure_common_clock() argument
188 struct pci_dev *child, *parent = link->pdev; pcie_aspm_configure_common_clock()
227 /* Retrain link */ pcie_aspm_configure_common_clock()
231 /* Wait for link training end. Break out after waiting for timeout */ pcie_aspm_configure_common_clock()
309 struct pcie_link_state *link; pcie_aspm_check_latency() local
316 link = endpoint->bus->self->link_state; pcie_aspm_check_latency()
317 acceptable = &link->acceptable[PCI_FUNC(endpoint->devfn)]; pcie_aspm_check_latency()
319 while (link) { pcie_aspm_check_latency()
321 if ((link->aspm_capable & ASPM_STATE_L0S_UP) && pcie_aspm_check_latency()
322 (link->latency_up.l0s > acceptable->l0s)) pcie_aspm_check_latency()
323 link->aspm_capable &= ~ASPM_STATE_L0S_UP; pcie_aspm_check_latency()
326 if ((link->aspm_capable & ASPM_STATE_L0S_DW) && pcie_aspm_check_latency()
327 (link->latency_dw.l0s > acceptable->l0s)) pcie_aspm_check_latency()
328 link->aspm_capable &= ~ASPM_STATE_L0S_DW; pcie_aspm_check_latency()
334 latency = max_t(u32, link->latency_up.l1, link->latency_dw.l1); pcie_aspm_check_latency()
335 if ((link->aspm_capable & ASPM_STATE_L1) && pcie_aspm_check_latency()
337 link->aspm_capable &= ~ASPM_STATE_L1; pcie_aspm_check_latency()
340 link = link->parent; pcie_aspm_check_latency()
344 static void pcie_aspm_cap_init(struct pcie_link_state *link, int blacklist) pcie_aspm_cap_init() argument
346 struct pci_dev *child, *parent = link->pdev; pcie_aspm_cap_init()
352 link->aspm_enabled = ASPM_STATE_ALL; pcie_aspm_cap_init()
353 link->aspm_disable = ASPM_STATE_ALL; pcie_aspm_cap_init()
358 pcie_aspm_configure_common_clock(link); pcie_aspm_cap_init()
369 * given link unless components on both sides of the link each pcie_aspm_cap_init()
373 link->aspm_support |= ASPM_STATE_L0S; pcie_aspm_cap_init()
375 link->aspm_enabled |= ASPM_STATE_L0S_UP; pcie_aspm_cap_init()
377 link->aspm_enabled |= ASPM_STATE_L0S_DW; pcie_aspm_cap_init()
378 link->latency_up.l0s = calc_l0s_latency(upreg.latency_encoding_l0s); pcie_aspm_cap_init()
379 link->latency_dw.l0s = calc_l0s_latency(dwreg.latency_encoding_l0s); pcie_aspm_cap_init()
383 link->aspm_support |= ASPM_STATE_L1; pcie_aspm_cap_init()
385 link->aspm_enabled |= ASPM_STATE_L1; pcie_aspm_cap_init()
386 link->latency_up.l1 = calc_l1_latency(upreg.latency_encoding_l1); pcie_aspm_cap_init()
387 link->latency_dw.l1 = calc_l1_latency(dwreg.latency_encoding_l1); pcie_aspm_cap_init()
390 link->aspm_default = link->aspm_enabled; pcie_aspm_cap_init()
393 link->aspm_capable = link->aspm_support; pcie_aspm_cap_init()
400 link->aspm_disable = ASPM_STATE_ALL; pcie_aspm_cap_init()
409 &link->acceptable[PCI_FUNC(child->devfn)]; pcie_aspm_cap_init()
433 static void pcie_config_aspm_link(struct pcie_link_state *link, u32 state) pcie_config_aspm_link() argument
436 struct pci_dev *child, *parent = link->pdev; pcie_config_aspm_link()
439 /* Nothing to do if the link is already in the requested state */ pcie_config_aspm_link()
440 state &= (link->aspm_capable & ~link->aspm_disable); pcie_config_aspm_link()
441 if (link->aspm_enabled == state) pcie_config_aspm_link()
465 link->aspm_enabled = state; pcie_config_aspm_link()
468 static void pcie_config_aspm_path(struct pcie_link_state *link) pcie_config_aspm_path() argument
470 while (link) { pcie_config_aspm_path()
471 pcie_config_aspm_link(link, policy_to_aspm_state(link)); pcie_config_aspm_path()
472 link = link->parent; pcie_config_aspm_path()
476 static void free_link_state(struct pcie_link_state *link) free_link_state() argument
478 link->pdev->link_state = NULL; free_link_state()
479 kfree(link); free_link_state()
519 struct pcie_link_state *link; alloc_pcie_link_state() local
521 link = kzalloc(sizeof(*link), GFP_KERNEL); alloc_pcie_link_state()
522 if (!link) alloc_pcie_link_state()
524 INIT_LIST_HEAD(&link->sibling); alloc_pcie_link_state()
525 INIT_LIST_HEAD(&link->children); alloc_pcie_link_state()
526 INIT_LIST_HEAD(&link->link); alloc_pcie_link_state()
527 link->pdev = pdev; alloc_pcie_link_state()
532 kfree(link); alloc_pcie_link_state()
535 link->parent = parent; alloc_pcie_link_state()
536 list_add(&link->link, &parent->children); alloc_pcie_link_state()
538 /* Setup a pointer to the root port link */ alloc_pcie_link_state()
539 if (!link->parent) alloc_pcie_link_state()
540 link->root = link; alloc_pcie_link_state()
542 link->root = link->parent->root; alloc_pcie_link_state()
544 list_add(&link->sibling, &link_list); alloc_pcie_link_state()
545 pdev->link_state = link; alloc_pcie_link_state()
546 return link; alloc_pcie_link_state()
550 * pcie_aspm_init_link_state: Initiate PCI express link state.
556 struct pcie_link_state *link; pcie_aspm_init_link_state() local
578 link = alloc_pcie_link_state(pdev); pcie_aspm_init_link_state()
579 if (!link) pcie_aspm_init_link_state()
586 pcie_aspm_cap_init(link, blacklist); pcie_aspm_init_link_state()
589 pcie_clkpm_cap_init(link, blacklist); pcie_aspm_init_link_state()
593 * link policy setting. Enabling ASPM on broken hardware can cripple pcie_aspm_init_link_state()
600 pcie_config_aspm_path(link); pcie_aspm_init_link_state()
601 pcie_set_clkpm(link, policy_to_clkpm_state(link)); pcie_aspm_init_link_state()
613 struct pcie_link_state *link; pcie_update_aspm_capable() local
615 list_for_each_entry(link, &link_list, sibling) { pcie_update_aspm_capable()
616 if (link->root != root) pcie_update_aspm_capable()
618 link->aspm_capable = link->aspm_support; pcie_update_aspm_capable()
620 list_for_each_entry(link, &link_list, sibling) { pcie_update_aspm_capable()
622 struct pci_bus *linkbus = link->pdev->subordinate; pcie_update_aspm_capable()
623 if (link->root != root) pcie_update_aspm_capable()
638 struct pcie_link_state *link, *root, *parent_link; pcie_aspm_exit_link_state() local
652 link = parent->link_state; pcie_aspm_exit_link_state()
653 root = link->root; pcie_aspm_exit_link_state()
654 parent_link = link->parent; pcie_aspm_exit_link_state()
656 /* All functions are removed, so just disable ASPM for the link */ pcie_aspm_exit_link_state()
657 pcie_config_aspm_link(link, 0); pcie_aspm_exit_link_state()
658 list_del(&link->sibling); pcie_aspm_exit_link_state()
659 list_del(&link->link); pcie_aspm_exit_link_state()
661 free_link_state(link); pcie_aspm_exit_link_state()
676 struct pcie_link_state *link = pdev->link_state; pcie_aspm_pm_state_change() local
678 if (aspm_disabled || !pci_is_pcie(pdev) || !link) pcie_aspm_pm_state_change()
689 pcie_update_aspm_capable(link->root); pcie_aspm_pm_state_change()
690 pcie_config_aspm_path(link); pcie_aspm_pm_state_change()
697 struct pcie_link_state *link = pdev->link_state; pcie_aspm_powersave_config_link() local
699 if (aspm_disabled || !pci_is_pcie(pdev) || !link) pcie_aspm_powersave_config_link()
711 pcie_config_aspm_path(link); pcie_aspm_powersave_config_link()
712 pcie_set_clkpm(link, policy_to_clkpm_state(link)); pcie_aspm_powersave_config_link()
721 struct pcie_link_state *link; __pci_disable_link_state() local
748 link = parent->link_state; __pci_disable_link_state()
750 link->aspm_disable |= ASPM_STATE_L0S; __pci_disable_link_state()
752 link->aspm_disable |= ASPM_STATE_L1; __pci_disable_link_state()
753 pcie_config_aspm_link(link, policy_to_aspm_state(link)); __pci_disable_link_state()
756 link->clkpm_capable = 0; __pci_disable_link_state()
757 pcie_set_clkpm(link, 0); __pci_disable_link_state()
771 * pci_disable_link_state - Disable device's link state, so the link will
777 * @state: ASPM link state to disable
788 struct pcie_link_state *link; pcie_aspm_set_policy() local
803 list_for_each_entry(link, &link_list, sibling) { pcie_aspm_set_policy()
804 pcie_config_aspm_link(link, policy_to_aspm_state(link)); pcie_aspm_set_policy()
805 pcie_set_clkpm(link, policy_to_clkpm_state(link)); pcie_aspm_set_policy()
843 struct pcie_link_state *link, *root = pdev->link_state->root; link_state_store() local
862 list_for_each_entry(link, &link_list, sibling) { link_state_store()
863 if (link->root != root) link_state_store()
865 pcie_config_aspm_link(link, state); link_state_store()
/linux-4.1.27/drivers/media/
H A Dmedia-entity.c94 media_entity_other(struct media_entity *entity, struct media_link *link) media_entity_other() argument
96 if (link->source->entity == entity) media_entity_other()
97 return link->sink->entity; media_entity_other()
99 return link->source->entity; media_entity_other()
111 graph->stack[graph->top].link = 0; stack_push()
125 #define link_top(en) ((en)->stack[(en)->top].link)
178 struct media_link *link = &entity->links[link_top(graph)]; media_entity_graph_walk_next() local
181 /* The link is not enabled so we do not follow. */ media_entity_graph_walk_next()
182 if (!(link->flags & MEDIA_LNK_FL_ENABLED)) { media_entity_graph_walk_next()
187 /* Get the entity in the other end of the link . */ media_entity_graph_walk_next()
188 next = media_entity_other(entity, link); media_entity_graph_walk_next()
257 struct media_link *link = &entity->links[i]; media_entity_pipeline_start() local
258 struct media_pad *pad = link->sink->entity == entity media_entity_pipeline_start()
259 ? link->sink : link->source; media_entity_pipeline_start()
261 /* Mark that a pad is connected by a link. */ media_entity_pipeline_start()
266 * are connected through an enabled link are media_entity_pipeline_start()
270 link->flags & MEDIA_LNK_FL_ENABLED) media_entity_pipeline_start()
275 * sink ends of the link that are enabled. media_entity_pipeline_start()
277 if (link->sink != pad || media_entity_pipeline_start()
278 !(link->flags & MEDIA_LNK_FL_ENABLED)) media_entity_pipeline_start()
281 ret = entity->ops->link_validate(link); media_entity_pipeline_start()
284 "link validation failed for \"%s\":%u -> \"%s\":%u, error %d\n", media_entity_pipeline_start()
285 entity->name, link->source->index, media_entity_pipeline_start()
286 link->sink->entity->name, media_entity_pipeline_start()
287 link->sink->index, ret); media_entity_pipeline_start()
298 "\"%s\":%u must be connected by an enabled link\n", media_entity_pipeline_start()
441 struct media_link *link; media_entity_create_link() local
448 link = media_entity_add_link(source); media_entity_create_link()
449 if (link == NULL) media_entity_create_link()
452 link->source = &source->pads[source_pad]; media_entity_create_link()
453 link->sink = &sink->pads[sink_pad]; media_entity_create_link()
454 link->flags = flags; media_entity_create_link()
469 link->reverse = backlink; media_entity_create_link()
470 backlink->reverse = link; media_entity_create_link()
483 struct media_link *link = &entity->links[i]; __media_entity_remove_links() local
487 if (link->source->entity == entity) __media_entity_remove_links()
488 remote = link->sink->entity; __media_entity_remove_links()
490 remote = link->source->entity; __media_entity_remove_links()
495 if (rlink != link->reverse) { __media_entity_remove_links()
500 if (link->source->entity == entity) __media_entity_remove_links()
506 /* Insert last entry in place of the dropped link. */ __media_entity_remove_links()
528 static int __media_entity_setup_link_notify(struct media_link *link, u32 flags) __media_entity_setup_link_notify() argument
533 ret = media_entity_call(link->source->entity, link_setup, __media_entity_setup_link_notify()
534 link->source, link->sink, flags); __media_entity_setup_link_notify()
538 ret = media_entity_call(link->sink->entity, link_setup, __media_entity_setup_link_notify()
539 link->sink, link->source, flags); __media_entity_setup_link_notify()
541 media_entity_call(link->source->entity, link_setup, __media_entity_setup_link_notify()
542 link->source, link->sink, link->flags); __media_entity_setup_link_notify()
546 link->flags = flags; __media_entity_setup_link_notify()
547 link->reverse->flags = link->flags; __media_entity_setup_link_notify()
553 * __media_entity_setup_link - Configure a media link
554 * @link: The link being configured
557 * The bulk of link setup is handled by the two entities connected through the
558 * link. This function notifies both entities of the link configuration change.
560 * If the link is immutable or if the current and new configuration are
563 * The user is expected to hold link->source->parent->mutex. If not,
566 int __media_entity_setup_link(struct media_link *link, u32 flags) __media_entity_setup_link() argument
573 if (link == NULL) __media_entity_setup_link()
576 /* The non-modifiable link flags must not be modified. */ __media_entity_setup_link()
577 if ((link->flags & ~mask) != (flags & ~mask)) __media_entity_setup_link()
580 if (link->flags & MEDIA_LNK_FL_IMMUTABLE) __media_entity_setup_link()
581 return link->flags == flags ? 0 : -EINVAL; __media_entity_setup_link()
583 if (link->flags == flags) __media_entity_setup_link()
586 source = link->source->entity; __media_entity_setup_link()
587 sink = link->sink->entity; __media_entity_setup_link()
589 if (!(link->flags & MEDIA_LNK_FL_DYNAMIC) && __media_entity_setup_link()
596 ret = mdev->link_notify(link, flags, __media_entity_setup_link()
602 ret = __media_entity_setup_link_notify(link, flags); __media_entity_setup_link()
605 mdev->link_notify(link, flags, MEDIA_DEV_NOTIFY_POST_LINK_CH); __media_entity_setup_link()
610 int media_entity_setup_link(struct media_link *link, u32 flags) media_entity_setup_link() argument
614 mutex_lock(&link->source->entity->parent->graph_mutex); media_entity_setup_link()
615 ret = __media_entity_setup_link(link, flags); media_entity_setup_link()
616 mutex_unlock(&link->source->entity->parent->graph_mutex); media_entity_setup_link()
623 * media_entity_find_link - Find a link between two pads
627 * Return a pointer to the link between the two entities. If no such link
633 struct media_link *link; media_entity_find_link() local
637 link = &source->entity->links[i]; media_entity_find_link()
639 if (link->source->entity == source->entity && media_entity_find_link()
640 link->source->index == source->index && media_entity_find_link()
641 link->sink->entity == sink->entity && media_entity_find_link()
642 link->sink->index == sink->index) media_entity_find_link()
643 return link; media_entity_find_link()
651 * media_entity_remote_pad - Find the pad at the remote end of a link
652 * @pad: Pad at the local end of the link
655 * links originating or terminating at that pad until an enabled link is found.
658 * link, or NULL if no enabled link has been found.
665 struct media_link *link = &pad->entity->links[i]; media_entity_remote_pad() local
667 if (!(link->flags & MEDIA_LNK_FL_ENABLED)) media_entity_remote_pad()
670 if (link->source == pad) media_entity_remote_pad()
671 return link->sink; media_entity_remote_pad()
673 if (link->sink == pad) media_entity_remote_pad()
674 return link->source; media_entity_remote_pad()
H A Dmedia-device.c155 struct media_link_desc link; __media_device_enum_links() local
161 memset(&link, 0, sizeof(link)); __media_device_enum_links()
163 &link.source); __media_device_enum_links()
165 &link.sink); __media_device_enum_links()
166 link.flags = entity->links[l].flags; __media_device_enum_links()
167 if (copy_to_user(ulink, &link, sizeof(*ulink))) __media_device_enum_links()
198 struct media_link *link = NULL; media_device_setup_link() local
207 /* Find the source and sink entities and link. media_device_setup_link()
219 link = media_entity_find_link(&source->pads[ulink.source.index], media_device_setup_link()
221 if (link == NULL) media_device_setup_link()
224 /* Setup the link on both entities. */ media_device_setup_link()
225 ret = __media_entity_setup_link(link, ulink.flags); media_device_setup_link()
H A DMakefile15 # Now, let's link-in the media core
/linux-4.1.27/arch/mips/pci/
H A Dmsi-xlp.c63 static inline int nlm_link_msiirq(int link, int msivec) nlm_link_msiirq() argument
65 return NLM_MSI_VEC_BASE + link * XLP_MSIVEC_PER_LINK + msivec; nlm_link_msiirq()
68 /* get the link MSI vector from irq number */ nlm_irq_msivec()
74 /* get the link from the irq number */ nlm_irq_msilink()
86 * and use 8 MSI-X vectors per link - this keeps the allocation and
88 * On XLP 9xx, there are 32 vectors per link, and the interrupts are
91 static inline int nlm_link_msixirq(int link, int bit) nlm_link_msixirq() argument
93 return NLM_MSIX_VEC_BASE + link * XLP_MSIXVEC_PER_LINK + bit; nlm_link_msixirq()
96 /* get the link MSI vector from irq number */ nlm_irq_msixvec()
102 /* get the link from MSIX vec */ nlm_irq_msixlink()
109 * Per link MSI and MSI-X information, set as IRQ handler data for
124 * On XLP, there is a PIC interrupt associated with each PCIe link on the
126 * per link and 128 overall.
128 * When a device connected to the link raises a MSI interrupt, we get a
129 * link interrupt and we then have to look at PCIE_MSI_STATUS register at
169 int link, vec; xlp_msi_mask_ack() local
171 link = nlm_irq_msilink(d->irq); xlp_msi_mask_ack()
197 * We divide the MSI-X vectors to 8 per link and do a per-link allocation
200 * 32 MSI-X vectors are available per link, and the interrupts are not routed
208 int link, msixvec; xlp_msix_mask_ack() local
212 link = nlm_irq_msixlink(msixvec); xlp_msix_mask_ack()
218 status_reg = PCIE_9XX_MSIX_STATUSX(link); xlp_msix_mask_ack()
244 * Setup a PCIe link for MSI. By default, the links are in
291 * Allocate a MSI vector on a link
293 static int xlp_setup_msi(uint64_t lnkbase, int node, int link, xlp_setup_msi() argument
302 /* Get MSI data for the link */ xlp_setup_msi()
303 lirq = PIC_PCIE_LINK_MSI_IRQ(link); xlp_setup_msi()
304 xirq = nlm_irq_to_xirq(node, nlm_link_msiirq(link, 0)); xlp_setup_msi()
306 msiaddr = MSI_LINK_ADDR(node, link); xlp_setup_msi()
311 /* switch the link IRQ to MSI range */ xlp_setup_msi()
313 irt = PIC_9XX_IRT_PCIE_LINK_INDEX(link); xlp_setup_msi()
315 irt = PIC_IRT_PCIE_LINK_INDEX(link); xlp_setup_msi()
344 * Switch a link to MSI-X mode
400 static int xlp_setup_msix(uint64_t lnkbase, int node, int link, xlp_setup_msix() argument
409 /* Get MSI data for the link */ xlp_setup_msix()
410 lirq = PIC_PCIE_MSIX_IRQ(link); xlp_setup_msix()
411 xirq = nlm_irq_to_xirq(node, nlm_link_msixirq(link, 0)); xlp_setup_msix()
413 msixaddr = MSIX_LINK_ADDR(node, link); xlp_setup_msix()
416 /* switch the PCIe link to MSI-X mode at the first alloc */ xlp_setup_msix()
448 int node, link, slot; arch_setup_msi_irq() local
456 link = PCI_FUNC(lnkdev->devfn); arch_setup_msi_irq()
458 lnkbase = nlm_get_pcie_base(node, link); arch_setup_msi_irq()
461 return xlp_setup_msix(lnkbase, node, link, desc); arch_setup_msi_irq()
463 return xlp_setup_msi(lnkbase, node, link, desc); arch_setup_msi_irq()
466 void __init xlp_init_node_msi_irqs(int node, int link) xlp_init_node_msi_irqs() argument
472 pr_info("[%d %d] Init node PCI IRT\n", node, link); xlp_init_node_msi_irqs()
475 /* Alloc an MSI block for the link */ xlp_init_node_msi_irqs()
482 md->lnkbase = nlm_get_pcie_base(node, link); xlp_init_node_msi_irqs()
485 irq = nlm_irq_to_xirq(node, nlm_link_msiirq(link, 0)); xlp_init_node_msi_irqs()
494 PIC_PCIE_MSIX_IRQ(link) << 1 | 0 << 0); xlp_init_node_msi_irqs()
496 (link * XLP_MSIXVEC_PER_LINK)), val); xlp_init_node_msi_irqs()
499 * per link xlp_init_node_msi_irqs()
501 msixvec = link * XLP_MSIXVEC_PER_LINK + i; xlp_init_node_msi_irqs()
504 PIC_PCIE_MSIX_IRQ(link), xlp_init_node_msi_irqs()
508 /* Initialize MSI-X extended irq space for the link */ xlp_init_node_msi_irqs()
509 irq = nlm_irq_to_xirq(node, nlm_link_msixirq(link, i)); xlp_init_node_msi_irqs()
518 int link, i, irqbase; nlm_dispatch_msi() local
521 link = lirq - PIC_PCIE_LINK_MSI_IRQ_BASE; nlm_dispatch_msi()
522 irqbase = nlm_irq_to_xirq(node, nlm_link_msiirq(link, 0)); nlm_dispatch_msi()
537 ack_c0_eirr(PIC_PCIE_LINK_MSI_IRQ(link)); nlm_dispatch_msi()
540 PIC_9XX_IRT_PCIE_LINK_INDEX(link)); nlm_dispatch_msi()
542 nlm_pic_ack(md->node->picbase, PIC_IRT_PCIE_LINK_INDEX(link)); nlm_dispatch_msi()
548 int link, i, irqbase; nlm_dispatch_msix() local
551 link = lirq - PIC_PCIE_MSIX_IRQ_BASE; nlm_dispatch_msix()
552 irqbase = nlm_irq_to_xirq(node, nlm_link_msixirq(link, 0)); nlm_dispatch_msix()
555 status = nlm_read_reg(md->lnkbase, PCIE_9XX_MSIX_STATUSX(link)); nlm_dispatch_msix()
559 /* narrow it down to the MSI-x vectors for our link */ nlm_dispatch_msix()
561 status = (status >> (link * XLP_MSIXVEC_PER_LINK)) & nlm_dispatch_msix()
570 ack_c0_eirr(PIC_PCIE_MSIX_IRQ(link)); nlm_dispatch_msix()
H A Dpci-xlp.c215 * link the device is on to assign interrupts pcibios_map_irq()
239 static void xlp_config_pci_bswap(int node, int link) xlp_config_pci_bswap() argument
245 lnkbase = nlm_get_pcie_base(node, link); xlp_config_pci_bswap()
248 * Enable byte swap in hardware. Program each link's PCIe SWAP regions xlp_config_pci_bswap()
249 * from the link's address ranges. xlp_config_pci_bswap()
253 BRIDGE_9XX_PCIEMEM_BASE0 + link); xlp_config_pci_bswap()
257 BRIDGE_9XX_PCIEMEM_LIMIT0 + link); xlp_config_pci_bswap()
262 BRIDGE_9XX_PCIEIO_BASE0 + link); xlp_config_pci_bswap()
266 BRIDGE_9XX_PCIEIO_LIMIT0 + link); xlp_config_pci_bswap()
270 reg = nlm_read_bridge_reg(nbubase, BRIDGE_PCIEMEM_BASE0 + link); xlp_config_pci_bswap()
274 BRIDGE_PCIEMEM_LIMIT0 + link); xlp_config_pci_bswap()
277 reg = nlm_read_bridge_reg(nbubase, BRIDGE_PCIEIO_BASE0 + link); xlp_config_pci_bswap()
280 reg = nlm_read_bridge_reg(nbubase, BRIDGE_PCIEIO_LIMIT0 + link); xlp_config_pci_bswap()
286 static inline void xlp_config_pci_bswap(int node, int link) {} xlp_config_pci_bswap() argument
292 int link, n; pcibios_init() local
307 for (link = 0; link < PCIE_NLINKS; link++) { pcibios_init()
308 pciebase = nlm_get_pcie_base(n, link); pcibios_init()
311 xlp_config_pci_bswap(n, link); pcibios_init()
312 xlp_init_node_msi_irqs(n, link); pcibios_init()
317 reg |= (1 << 8) | PIC_PCIE_LINK_LEGACY_IRQ(link); pcibios_init()
319 pr_info("XLP PCIe: Link %d-%d initialized.\n", n, link); pcibios_init()
H A Dpci-xlr.c163 * bridges. Given a device, this function finds which link it is
178 static int nlm_pci_link_to_irq(int link) nlm_pci_link_to_irq() argument
180 switch (link) { nlm_pci_link_to_irq()
196 WARN(1, "Unexpected link %d\n", link); nlm_pci_link_to_irq()
203 int link; get_irq_vector() local
212 link = PCI_SLOT(lnk->devfn); get_irq_vector()
213 return nlm_pci_link_to_irq(link); get_irq_vector()
332 int link, irq; pcibios_init() local
360 for (link = 0; link < 4; link++) { pcibios_init()
361 irq = nlm_pci_link_to_irq(link); pcibios_init()
/linux-4.1.27/sound/pcmcia/pdaudiocf/
H A Dpdaudiocf.c59 static int pdacf_config(struct pcmcia_device *link);
62 static void pdacf_release(struct pcmcia_device *link) pdacf_release() argument
64 free_irq(link->irq, link->priv); pdacf_release()
65 pcmcia_disable_device(link); pdacf_release()
73 struct pcmcia_device *link = pdacf->p_dev; snd_pdacf_free() local
75 pdacf_release(link); snd_pdacf_free()
93 static int snd_pdacf_probe(struct pcmcia_device *link) snd_pdacf_probe() argument
116 err = snd_card_new(&link->dev, index[i], id[i], THIS_MODULE, snd_pdacf_probe()
139 pdacf->p_dev = link; snd_pdacf_probe()
140 link->priv = pdacf; snd_pdacf_probe()
142 link->resource[0]->flags |= IO_DATA_PATH_WIDTH_AUTO; snd_pdacf_probe()
143 link->resource[0]->end = 16; snd_pdacf_probe()
145 link->config_flags = CONF_ENABLE_IRQ | CONF_ENABLE_PULSE_IRQ; snd_pdacf_probe()
146 link->config_index = 1; snd_pdacf_probe()
147 link->config_regs = PRESENT_OPTION; snd_pdacf_probe()
149 return pdacf_config(link); snd_pdacf_probe()
196 static void snd_pdacf_detach(struct pcmcia_device *link) snd_pdacf_detach() argument
198 struct snd_pdacf *chip = link->priv; snd_pdacf_detach()
213 static int pdacf_config(struct pcmcia_device *link) pdacf_config() argument
215 struct snd_pdacf *pdacf = link->priv; pdacf_config()
219 link->config_index = 0x5; pdacf_config()
220 link->config_flags |= CONF_ENABLE_IRQ | CONF_ENABLE_PULSE_IRQ; pdacf_config()
222 ret = pcmcia_request_io(link); pdacf_config()
226 ret = request_threaded_irq(link->irq, pdacf_interrupt, pdacf_config()
228 IRQF_SHARED, link->devname, link->priv); pdacf_config()
232 ret = pcmcia_enable_device(link); pdacf_config()
236 if (snd_pdacf_assign_resources(pdacf, link->resource[0]->start, pdacf_config()
237 link->irq) < 0) pdacf_config()
243 free_irq(link->irq, link->priv); pdacf_config()
245 pcmcia_disable_device(link); pdacf_config()
251 static int pdacf_suspend(struct pcmcia_device *link) pdacf_suspend() argument
253 struct snd_pdacf *chip = link->priv; pdacf_suspend()
264 static int pdacf_resume(struct pcmcia_device *link) pdacf_resume() argument
266 struct snd_pdacf *chip = link->priv; pdacf_resume()
269 if (pcmcia_dev_present(link)) { pdacf_resume()
/linux-4.1.27/sound/pcmcia/vx/
H A Dvxpocket.c63 static void vxpocket_release(struct pcmcia_device *link) vxpocket_release() argument
65 free_irq(link->irq, link->priv); vxpocket_release()
66 pcmcia_disable_device(link); vxpocket_release()
136 struct pcmcia_device *link, snd_vxpocket_new()
160 vxp->p_dev = link; snd_vxpocket_new()
161 link->priv = chip; snd_vxpocket_new()
163 link->resource[0]->flags |= IO_DATA_PATH_WIDTH_AUTO; snd_vxpocket_new()
164 link->resource[0]->end = 16; snd_vxpocket_new()
166 link->config_flags |= CONF_ENABLE_IRQ; snd_vxpocket_new()
167 link->config_index = 1; snd_vxpocket_new()
168 link->config_regs = PRESENT_OPTION; snd_vxpocket_new()
212 static int vxpocket_config(struct pcmcia_device *link) vxpocket_config() argument
214 struct vx_core *chip = link->priv; vxpocket_config()
220 if (!strcmp(link->prod_id[1], "VX-POCKET")) { vxpocket_config()
230 ret = pcmcia_request_io(link); vxpocket_config()
234 ret = request_threaded_irq(link->irq, snd_vx_irq_handler, vxpocket_config()
236 IRQF_SHARED, link->devname, link->priv); vxpocket_config()
240 ret = pcmcia_enable_device(link); vxpocket_config()
244 chip->dev = &link->dev; vxpocket_config()
246 if (snd_vxpocket_assign_resources(chip, link->resource[0]->start, vxpocket_config()
247 link->irq) < 0) vxpocket_config()
253 free_irq(link->irq, link->priv); vxpocket_config()
255 pcmcia_disable_device(link); vxpocket_config()
261 static int vxp_suspend(struct pcmcia_device *link) vxp_suspend() argument
263 struct vx_core *chip = link->priv; vxp_suspend()
274 static int vxp_resume(struct pcmcia_device *link) vxp_resume() argument
276 struct vx_core *chip = link->priv; vxp_resume()
279 if (pcmcia_dev_present(link)) { vxp_resume()
337 static void vxpocket_detach(struct pcmcia_device *link) vxpocket_detach() argument
342 if (! link) vxpocket_detach()
345 vxp = link->priv; vxpocket_detach()
351 vxpocket_release(link); vxpocket_detach()
135 snd_vxpocket_new(struct snd_card *card, int ibl, struct pcmcia_device *link, struct snd_vxpocket **chip_ret) snd_vxpocket_new() argument
/linux-4.1.27/drivers/tty/ipwireless/
H A Dmain.c43 static void ipwireless_detach(struct pcmcia_device *link);
66 struct pcmcia_device *link = ipw->link; signalled_reboot_work() local
67 pcmcia_reset_card(link->socket); signalled_reboot_work()
162 struct pcmcia_device *link = ipw->link; config_ipwireless() local
166 link->config_flags |= CONF_AUTO_SET_IO | CONF_AUTO_SET_IOMEM | config_ipwireless()
169 ret = pcmcia_loop_config(link, ipwireless_probe, ipw); config_ipwireless()
175 ipwireless_init_hardware_v1(ipw->hardware, link->resource[0]->start, config_ipwireless()
180 ret = pcmcia_request_irq(link, ipwireless_interrupt); config_ipwireless()
187 ": I/O ports %pR, irq %d\n", link->resource[0], config_ipwireless()
188 (unsigned int) link->irq); config_ipwireless()
192 link->resource[3], config_ipwireless()
193 link->resource[2]); config_ipwireless()
209 ret = pcmcia_enable_device(link); config_ipwireless()
217 release_mem_region(link->resource[2]->start, config_ipwireless()
218 resource_size(link->resource[2])); config_ipwireless()
222 release_mem_region(link->resource[3]->start, config_ipwireless()
223 resource_size(link->resource[3])); config_ipwireless()
226 pcmcia_disable_device(link); config_ipwireless()
232 release_region(ipw->link->resource[0]->start, release_ipwireless()
233 resource_size(ipw->link->resource[0])); release_ipwireless()
235 release_mem_region(ipw->link->resource[2]->start, release_ipwireless()
236 resource_size(ipw->link->resource[2])); release_ipwireless()
240 release_mem_region(ipw->link->resource[3]->start, release_ipwireless()
241 resource_size(ipw->link->resource[3])); release_ipwireless()
244 pcmcia_disable_device(ipw->link); release_ipwireless()
256 static int ipwireless_attach(struct pcmcia_device *link) ipwireless_attach() argument
265 ipw->link = link; ipwireless_attach()
266 link->priv = ipw; ipwireless_attach()
278 ipwireless_detach(link); ipwireless_attach()
291 static void ipwireless_detach(struct pcmcia_device *link) ipwireless_detach() argument
293 struct ipw_dev *ipw = link->priv; ipwireless_detach()
/linux-4.1.27/drivers/net/wireless/
H A Datmel_cs.c64 static int atmel_config(struct pcmcia_device *link);
65 static void atmel_release(struct pcmcia_device *link);
89 static void atmel_detach(struct pcmcia_device *link) atmel_detach() argument
91 dev_dbg(&link->dev, "atmel_detach\n"); atmel_detach()
93 atmel_release(link); atmel_detach()
95 kfree(link->priv); atmel_detach()
102 struct pcmcia_device *link = (struct pcmcia_device *)arg; card_present() local
104 if (pcmcia_dev_present(link)) card_present()
118 static int atmel_config(struct pcmcia_device *link) atmel_config() argument
124 dev = link->priv; atmel_config()
125 did = dev_get_drvdata(&link->dev); atmel_config()
127 dev_dbg(&link->dev, "atmel_config\n"); atmel_config()
129 link->config_flags |= CONF_ENABLE_IRQ | CONF_AUTO_SET_VPP | atmel_config()
132 if (pcmcia_loop_config(link, atmel_config_check, NULL)) atmel_config()
135 if (!link->irq) { atmel_config()
136 dev_err(&link->dev, "atmel: cannot assign IRQ: check that CONFIG_ISA is set in kernel config."); atmel_config()
140 ret = pcmcia_enable_device(link); atmel_config()
144 ((struct local_info *)link->priv)->eth_dev = atmel_config()
145 init_atmel_card(link->irq, atmel_config()
146 link->resource[0]->start, atmel_config()
148 &link->dev, atmel_config()
150 link); atmel_config()
151 if (!((struct local_info *)link->priv)->eth_dev) atmel_config()
158 atmel_release(link); atmel_config()
162 static void atmel_release(struct pcmcia_device *link) atmel_release() argument
164 struct net_device *dev = ((struct local_info *)link->priv)->eth_dev; atmel_release()
166 dev_dbg(&link->dev, "atmel_release\n"); atmel_release()
170 ((struct local_info *)link->priv)->eth_dev = NULL; atmel_release()
172 pcmcia_disable_device(link); atmel_release()
175 static int atmel_suspend(struct pcmcia_device *link) atmel_suspend() argument
177 struct local_info *local = link->priv; atmel_suspend()
184 static int atmel_resume(struct pcmcia_device *link) atmel_resume() argument
186 struct local_info *local = link->priv; atmel_resume()
H A Dairo_cs.c54 static int airo_config(struct pcmcia_device *link);
55 static void airo_release(struct pcmcia_device *link);
79 static void airo_detach(struct pcmcia_device *link) airo_detach() argument
81 dev_dbg(&link->dev, "airo_detach\n"); airo_detach()
83 airo_release(link); airo_detach()
85 if (((struct local_info *)link->priv)->eth_dev) { airo_detach()
86 stop_airo_card(((struct local_info *)link->priv)->eth_dev, airo_detach()
89 ((struct local_info *)link->priv)->eth_dev = NULL; airo_detach()
91 kfree(link->priv); airo_detach()
103 static int airo_config(struct pcmcia_device *link) airo_config() argument
108 dev = link->priv; airo_config()
110 dev_dbg(&link->dev, "airo_config\n"); airo_config()
112 link->config_flags |= CONF_ENABLE_IRQ | CONF_AUTO_SET_VPP | airo_config()
115 ret = pcmcia_loop_config(link, airo_cs_config_check, NULL); airo_config()
119 if (!link->irq) airo_config()
122 ret = pcmcia_enable_device(link); airo_config()
125 ((struct local_info *)link->priv)->eth_dev = airo_config()
126 init_airo_card(link->irq, airo_config()
127 link->resource[0]->start, 1, &link->dev); airo_config()
128 if (!((struct local_info *)link->priv)->eth_dev) airo_config()
134 airo_release(link); airo_config()
138 static void airo_release(struct pcmcia_device *link) airo_release() argument
140 dev_dbg(&link->dev, "airo_release\n"); airo_release()
141 pcmcia_disable_device(link); airo_release()
144 static int airo_suspend(struct pcmcia_device *link) airo_suspend() argument
146 struct local_info *local = link->priv; airo_suspend()
153 static int airo_resume(struct pcmcia_device *link) airo_resume() argument
155 struct local_info *local = link->priv; airo_resume()
157 if (link->open) { airo_resume()
H A Dray_cs.c69 static int ray_config(struct pcmcia_device *link);
70 static void ray_release(struct pcmcia_device *link);
333 static void ray_detach(struct pcmcia_device *link) ray_detach() argument
338 dev_dbg(&link->dev, "ray_detach\n"); ray_detach()
341 dev = link->priv; ray_detach()
343 ray_release(link); ray_detach()
348 if (link->priv) { ray_detach()
352 dev_dbg(&link->dev, "ray_cs ray_detach ending\n"); ray_detach()
356 static int ray_config(struct pcmcia_device *link) ray_config() argument
360 struct net_device *dev = (struct net_device *)link->priv; ray_config()
363 dev_dbg(&link->dev, "ray_config\n"); ray_config()
367 link->prod_id[0] ? link->prod_id[0] : " ", ray_config()
368 link->prod_id[1] ? link->prod_id[1] : " ", ray_config()
369 link->prod_id[2] ? link->prod_id[2] : " ", ray_config()
370 link->prod_id[3] ? link->prod_id[3] : " "); ray_config()
375 ret = pcmcia_request_irq(link, ray_interrupt); ray_config()
378 dev->irq = link->irq; ray_config()
380 ret = pcmcia_enable_device(link); ray_config()
385 link->resource[2]->flags |= WIN_DATA_WIDTH_8 | WIN_MEMORY_TYPE_CM | WIN_ENABLE | WIN_USE_WAIT; ray_config()
386 link->resource[2]->start = 0; ray_config()
387 link->resource[2]->end = 0x8000; ray_config()
388 ret = pcmcia_request_window(link, link->resource[2], ray_mem_speed); ray_config()
391 ret = pcmcia_map_mem_page(link, link->resource[2], 0); ray_config()
394 local->sram = ioremap(link->resource[2]->start, ray_config()
395 resource_size(link->resource[2])); ray_config()
398 link->resource[3]->flags |= ray_config()
400 link->resource[3]->start = 0; ray_config()
401 link->resource[3]->end = 0x4000; ray_config()
402 ret = pcmcia_request_window(link, link->resource[3], ray_mem_speed); ray_config()
405 ret = pcmcia_map_mem_page(link, link->resource[3], 0x8000); ray_config()
408 local->rmem = ioremap(link->resource[3]->start, ray_config()
409 resource_size(link->resource[3])); ray_config()
412 link->resource[4]->flags |= ray_config()
414 link->resource[4]->start = 0; ray_config()
415 link->resource[4]->end = 0x1000; ray_config()
416 ret = pcmcia_request_window(link, link->resource[4], ray_mem_speed); ray_config()
419 ret = pcmcia_map_mem_page(link, link->resource[4], 0); ray_config()
422 local->amem = ioremap(link->resource[4]->start, ray_config()
423 resource_size(link->resource[4])); ray_config()
425 dev_dbg(&link->dev, "ray_config sram=%p\n", local->sram); ray_config()
426 dev_dbg(&link->dev, "ray_config rmem=%p\n", local->rmem); ray_config()
427 dev_dbg(&link->dev, "ray_config amem=%p\n", local->amem); ray_config()
429 ray_release(link); ray_config()
433 SET_NETDEV_DEV(dev, &link->dev); ray_config()
437 ray_release(link); ray_config()
447 ray_release(link); ray_config()
475 struct pcmcia_device *link = local->finder; ray_init() local
476 dev_dbg(&link->dev, "ray_init(0x%p)\n", dev); ray_init()
477 if (!(pcmcia_dev_present(link))) { ray_init()
478 dev_dbg(&link->dev, "ray_init - device not present\n"); ray_init()
500 dev_dbg(&link->dev, "ray_init firmware version %d.%d\n", local->fw_ver, ray_init()
506 dev_dbg(&link->dev, "ray_init tib_length = 0x%02x\n", local->tib_length); ray_init()
525 dev_dbg(&link->dev, "ray_init ending\n"); ray_init()
536 struct pcmcia_device *link = local->finder; dl_startup_params() local
538 dev_dbg(&link->dev, "dl_startup_params entered\n"); dl_startup_params()
539 if (!(pcmcia_dev_present(link))) { dl_startup_params()
540 dev_dbg(&link->dev, "ray_cs dl_startup_params - device not present\n"); dl_startup_params()
558 dev_dbg(&link->dev, "dl_startup_params start ccsindex = %d\n", dl_startup_params()
574 dev_dbg(&link->dev, dl_startup_params()
647 struct pcmcia_device *link = local->finder; verify_dl_startup() local
649 if (!(pcmcia_dev_present(link))) { verify_dl_startup()
650 dev_dbg(&link->dev, "ray_cs verify_dl_startup - device not present\n"); verify_dl_startup()
689 struct pcmcia_device *link = local->finder; start_net() local
690 if (!(pcmcia_dev_present(link))) { start_net()
691 dev_dbg(&link->dev, "ray_cs start_net - device not present\n"); start_net()
702 dev_dbg(&link->dev, "ray start net failed - card not ready for intr\n"); start_net()
717 struct pcmcia_device *link = local->finder; join_net() local
719 if (!(pcmcia_dev_present(link))) { join_net()
720 dev_dbg(&link->dev, "ray_cs join_net - device not present\n"); join_net()
732 dev_dbg(&link->dev, "ray join net failed - card not ready for intr\n"); join_net()
740 static void ray_release(struct pcmcia_device *link) ray_release() argument
742 struct net_device *dev = link->priv; ray_release()
745 dev_dbg(&link->dev, "ray_release\n"); ray_release()
752 pcmcia_disable_device(link); ray_release()
754 dev_dbg(&link->dev, "ray_release ending\n"); ray_release()
757 static int ray_suspend(struct pcmcia_device *link) ray_suspend() argument
759 struct net_device *dev = link->priv; ray_suspend()
761 if (link->open) ray_suspend()
767 static int ray_resume(struct pcmcia_device *link) ray_resume() argument
769 struct net_device *dev = link->priv; ray_resume()
771 if (link->open) { ray_resume()
786 struct pcmcia_device *link = local->finder; ray_dev_init() local
788 dev_dbg(&link->dev, "ray_dev_init(dev=%p)\n", dev); ray_dev_init()
789 if (!(pcmcia_dev_present(link))) { ray_dev_init()
790 dev_dbg(&link->dev, "ray_dev_init - device not present\n"); ray_dev_init()
804 dev_dbg(&link->dev, ray_dev_init()
813 dev_dbg(&link->dev, "ray_dev_init ending\n"); ray_dev_init()
821 struct pcmcia_device *link = local->finder; ray_dev_config() local
823 dev_dbg(&link->dev, "ray_dev_config(dev=%p,ifmap=%p)\n", dev, map); ray_dev_config()
824 if (!(pcmcia_dev_present(link))) { ray_dev_config()
825 dev_dbg(&link->dev, "ray_dev_config - device not present\n"); ray_dev_config()
837 struct pcmcia_device *link = local->finder; ray_dev_start_xmit() local
840 if (!pcmcia_dev_present(link)) { ray_dev_start_xmit()
841 dev_dbg(&link->dev, "ray_dev_start_xmit - device not present\n"); ray_dev_start_xmit()
846 dev_dbg(&link->dev, "ray_dev_start_xmit(skb=%p, dev=%p)\n", skb, dev); ray_dev_start_xmit()
848 dev_dbg(&link->dev, "ray_cs Sending authentication request.\n"); ray_dev_start_xmit()
1401 struct pcmcia_device *link = local->finder; ray_get_wireless_stats() local
1417 if (pcmcia_dev_present(link)) { ray_get_wireless_stats()
1489 struct pcmcia_device *link; ray_open() local
1490 link = local->finder; ray_open()
1492 dev_dbg(&link->dev, "ray_open('%s')\n", dev->name); ray_open()
1494 if (link->open == 0) ray_open()
1496 link->open++; ray_open()
1502 dev_dbg(&link->dev, "ray_open: doing init now !\n"); ray_open()
1518 dev_dbg(&link->dev, "ray_open ending\n"); ray_open()
1526 struct pcmcia_device *link; ray_dev_close() local
1527 link = local->finder; ray_dev_close()
1529 dev_dbg(&link->dev, "ray_dev_close('%s')\n", dev->name); ray_dev_close()
1531 link->open--; ray_dev_close()
1554 struct pcmcia_device *link = local->finder; interrupt_ecf() local
1556 if (!(pcmcia_dev_present(link))) { interrupt_ecf()
1557 dev_dbg(&link->dev, "ray_cs interrupt_ecf - device not present\n"); interrupt_ecf()
1560 dev_dbg(&link->dev, "interrupt_ecf(local=%p, ccs = 0x%x\n", local, ccs); interrupt_ecf()
1567 dev_dbg(&link->dev, "ray_cs interrupt_ecf card not ready for interrupt\n"); interrupt_ecf()
1583 struct pcmcia_device *link = local->finder; get_free_tx_ccs() local
1585 if (!(pcmcia_dev_present(link))) { get_free_tx_ccs()
1586 dev_dbg(&link->dev, "ray_cs get_free_tx_ccs - device not present\n"); get_free_tx_ccs()
1591 dev_dbg(&link->dev, "ray_cs tx_ccs_lock busy\n"); get_free_tx_ccs()
1598 writeb(CCS_END_LIST, &(pccs + i)->link); get_free_tx_ccs()
1604 dev_dbg(&link->dev, "ray_cs ERROR no free tx CCS for raylink card\n"); get_free_tx_ccs()
1615 struct pcmcia_device *link = local->finder; get_free_ccs() local
1617 if (!(pcmcia_dev_present(link))) { get_free_ccs()
1618 dev_dbg(&link->dev, "ray_cs get_free_ccs - device not present\n"); get_free_ccs()
1622 dev_dbg(&link->dev, "ray_cs ccs_lock busy\n"); get_free_ccs()
1629 writeb(CCS_END_LIST, &(pccs + i)->link); get_free_ccs()
1635 dev_dbg(&link->dev, "ray_cs ERROR no free CCS for raylink card\n"); get_free_ccs()
1690 struct pcmcia_device *link = local->finder; ray_get_stats() local
1692 if (!(pcmcia_dev_present(link))) { ray_get_stats()
1693 dev_dbg(&link->dev, "ray_cs net_device_stats - device not present\n"); ray_get_stats()
1720 struct pcmcia_device *link = local->finder; ray_update_parm() local
1725 if (!(pcmcia_dev_present(link))) { ray_update_parm()
1726 dev_dbg(&link->dev, "ray_update_parm - device not present\n"); ray_update_parm()
1731 dev_dbg(&link->dev, "ray_update_parm - No free ccs\n"); ray_update_parm()
1744 dev_dbg(&link->dev, "ray_cs associate failed - ECF not ready for intr\n"); ray_update_parm()
1755 struct pcmcia_device *link = local->finder; ray_update_multi_list() local
1758 if (!(pcmcia_dev_present(link))) { ray_update_multi_list()
1759 dev_dbg(&link->dev, "ray_update_multi_list - device not present\n"); ray_update_multi_list()
1762 dev_dbg(&link->dev, "ray_update_multi_list(%p)\n", dev); ray_update_multi_list()
1764 dev_dbg(&link->dev, "ray_update_multi - No free ccs\n"); ray_update_multi_list()
1780 dev_dbg(&link->dev, "ray_update_multi add addr %pm\n", netdev_for_each_mc_addr()
1788 dev_dbg(&link->dev, "ray_cs update_multi %d addresses in list\n", i);
1793 dev_dbg(&link->dev,
1839 struct pcmcia_device *link; ray_interrupt() local
1856 link = local->finder; ray_interrupt()
1857 if (!pcmcia_dev_present(link)) { ray_interrupt()
1865 dev_dbg(&link->dev, "ray_cs interrupt bad rcsindex = 0x%x\n", rcsindex); ray_interrupt()
1877 dev_dbg(&link->dev, ray_interrupt()
1880 dev_dbg(&link->dev, ray_interrupt()
1885 dev_dbg(&link->dev, "ray_cs interrupt update params done\n"); ray_interrupt()
1890 dev_dbg(&link->dev, ray_interrupt()
1896 dev_dbg(&link->dev, "ray_cs interrupt report params done\n"); ray_interrupt()
1899 dev_dbg(&link->dev, ray_interrupt()
1903 dev_dbg(&link->dev, ray_interrupt()
1916 dev_dbg(&link->dev, ray_interrupt()
1920 dev_dbg(&link->dev, ray_interrupt()
1948 dev_dbg(&link->dev, ray_interrupt()
1953 dev_dbg(&link->dev, ray_interrupt()
1964 dev_dbg(&link->dev, "ray_cs association successful\n"); ray_interrupt()
1966 dev_dbg(&link->dev, "ray_cs association failed,\n"); ray_interrupt()
1973 dev_dbg(&link->dev, ray_interrupt()
1976 dev_dbg(&link->dev, ray_interrupt()
1984 dev_dbg(&link->dev, "ray_cs interrupt mem test done\n"); ray_interrupt()
1987 dev_dbg(&link->dev, ray_interrupt()
1991 dev_dbg(&link->dev, "ray_cs interrupt dump memory done\n"); ray_interrupt()
1994 dev_dbg(&link->dev, ray_interrupt()
1998 dev_dbg(&link->dev, ray_interrupt()
2012 dev_dbg(&link->dev, "ray_cs interrupt rejoin net complete\n"); ray_interrupt()
2022 dev_dbg(&link->dev, "ray_cs new BSSID = %pm\n", ray_interrupt()
2029 dev_dbg(&link->dev, "ray_cs interrupt roaming initiated\n"); ray_interrupt()
2034 dev_dbg(&link->dev, "ray_cs interrupt japan call sign rx\n"); ray_interrupt()
2037 dev_dbg(&link->dev, ray_interrupt()
2122 u_char linksrcaddr[ETH_ALEN]; /* Other end of the wireless link */ rx_data()
2412 struct pcmcia_device *link = local->finder; authenticate() local
2413 dev_dbg(&link->dev, "ray_cs Starting authentication.\n"); authenticate()
2414 if (!(pcmcia_dev_present(link))) { authenticate()
2415 dev_dbg(&link->dev, "ray_cs authenticate - device not present\n"); authenticate()
2483 struct pcmcia_device *link = local->finder; associate() local
2484 struct net_device *dev = link->priv; associate()
2486 if (!(pcmcia_dev_present(link))) { associate()
2487 dev_dbg(&link->dev, "ray_cs associate - device not present\n"); associate()
2493 dev_dbg(&link->dev, "ray_cs associate - No free ccs\n"); associate()
2496 dev_dbg(&link->dev, "ray_cs Starting association with access point\n"); associate()
2502 dev_dbg(&link->dev, "ray_cs associate failed - ECF not ready for intr\n"); associate()
2570 struct pcmcia_device *link; ray_cs_proc_show() local
2577 link = this_device; ray_cs_proc_show()
2578 if (!link) ray_cs_proc_show()
2580 dev = (struct net_device *)link->priv; ray_cs_proc_show()
/linux-4.1.27/drivers/ata/
H A Dlibata-pmp.c27 * @link: link to read PMP register for
39 static unsigned int sata_pmp_read(struct ata_link *link, int reg, u32 *r_val) sata_pmp_read() argument
41 struct ata_port *ap = link->ap; sata_pmp_read()
42 struct ata_device *pmp_dev = ap->link.device; sata_pmp_read()
51 tf.device = link->pmp; sata_pmp_read()
64 * @link: link to write PMP register for
76 static unsigned int sata_pmp_write(struct ata_link *link, int reg, u32 val) sata_pmp_write() argument
78 struct ata_port *ap = link->ap; sata_pmp_write()
79 struct ata_device *pmp_dev = ap->link.device; sata_pmp_write()
87 tf.device = link->pmp; sata_pmp_write()
112 struct ata_link *link = qc->dev->link; sata_pmp_qc_defer_cmd_switch() local
113 struct ata_port *ap = link->ap; sata_pmp_qc_defer_cmd_switch()
115 if (ap->excl_link == NULL || ap->excl_link == link) { sata_pmp_qc_defer_cmd_switch()
116 if (ap->nr_active_links == 0 || ata_link_active(link)) { sata_pmp_qc_defer_cmd_switch()
121 ap->excl_link = link; sata_pmp_qc_defer_cmd_switch()
129 * @link: ATA link to read PSCR for
133 * Read PSCR @reg into @r_val for @link, to be called from
142 int sata_pmp_scr_read(struct ata_link *link, int reg, u32 *r_val) sata_pmp_scr_read() argument
149 err_mask = sata_pmp_read(link, reg, r_val); sata_pmp_scr_read()
151 ata_link_warn(link, "failed to read SCR %d (Emask=0x%x)\n", sata_pmp_scr_read()
160 * @link: ATA link to write PSCR for
164 * Write @val to PSCR @reg for @link, to be called from
173 int sata_pmp_scr_write(struct ata_link *link, int reg, u32 val) sata_pmp_scr_write() argument
180 err_mask = sata_pmp_write(link, reg, val); sata_pmp_scr_write()
182 ata_link_warn(link, "failed to write SCR %d (Emask=0x%x)\n", sata_pmp_scr_write()
190 * sata_pmp_set_lpm - configure LPM for a PMP link
191 * @link: PMP link to configure LPM for
195 * Configure LPM for @link. This function will contain any PMP
204 int sata_pmp_set_lpm(struct ata_link *link, enum ata_lpm_policy policy, sata_pmp_set_lpm() argument
207 return sata_link_scr_lpm(link, policy, true); sata_pmp_set_lpm()
233 err_mask = sata_pmp_read(dev->link, reg, &gscr[reg]); sata_pmp_read_gscr()
261 struct ata_port *ap = dev->link->ap; sata_pmp_configure()
282 err_mask = sata_pmp_write(dev->link, SATA_PMP_GSCR_ERROR_EN, sata_pmp_configure()
299 err_mask = sata_pmp_read(&ap->link, PMP_GSCR_SII_POL, &reg); sata_pmp_configure()
306 err_mask = sata_pmp_write(&ap->link, PMP_GSCR_SII_POL, reg); sata_pmp_configure()
362 struct ata_link *link = &pmp_link[i]; sata_pmp_init_links() local
363 struct ata_eh_context *ehc = &link->eh_context; sata_pmp_init_links()
365 link->flags = 0; sata_pmp_init_links()
381 u32 *gscr = ap->link.device->gscr; sata_pmp_quirks()
384 struct ata_link *link; sata_pmp_quirks() local
388 ata_for_each_link(link, ap, EDGE) { ata_for_each_link()
389 /* link reports offline after LPM */ ata_for_each_link()
390 link->flags |= ATA_LFLAG_NO_LPM; ata_for_each_link()
396 if (link->pmp < 5) ata_for_each_link()
397 link->flags |= ATA_LFLAG_NO_SRST | ata_for_each_link()
401 if (link->pmp == 5) ata_for_each_link()
402 link->flags |= ATA_LFLAG_NO_SRST | ata_for_each_link()
413 ata_for_each_link(link, ap, EDGE)
414 link->flags |= ATA_LFLAG_NO_LPM |
419 ata_for_each_link(link, ap, EDGE) { ata_for_each_link()
420 /* link reports offline after LPM */ ata_for_each_link()
421 link->flags |= ATA_LFLAG_NO_LPM; ata_for_each_link()
428 if (link->pmp <= 5) ata_for_each_link()
429 link->flags |= ATA_LFLAG_NO_SRST | ata_for_each_link()
435 if (link->pmp == 6) ata_for_each_link()
436 link->flags |= ATA_LFLAG_NO_SRST | ata_for_each_link()
455 ata_for_each_link(link, ap, EDGE) { ata_for_each_link()
459 link->flags |= ATA_LFLAG_NO_LPM | ata_for_each_link()
465 ata_for_each_link(link, ap, EDGE) { ata_for_each_link()
467 if (link->pmp == 4) ata_for_each_link()
468 link->flags |= ATA_LFLAG_DISABLED; ata_for_each_link()
488 struct ata_link *link = dev->link; sata_pmp_attach() local
489 struct ata_port *ap = link->ap; sata_pmp_attach()
500 if (!ata_is_host_link(link)) { sata_pmp_attach()
510 WARN_ON(link->pmp != 0); sata_pmp_attach()
511 link->pmp = SATA_PMP_CTRL_PORT; sata_pmp_attach()
546 link->pmp = 0; sata_pmp_attach()
562 struct ata_link *link = dev->link; sata_pmp_detach() local
563 struct ata_port *ap = link->ap; sata_pmp_detach()
569 WARN_ON(!ata_is_host_link(link) || dev->devno || sata_pmp_detach()
570 link->pmp != SATA_PMP_CTRL_PORT); sata_pmp_detach()
580 link->pmp = 0; sata_pmp_detach()
651 struct ata_link *link = dev->link; sata_pmp_revalidate() local
652 struct ata_port *ap = link->ap; sata_pmp_revalidate()
658 ata_eh_about_to_do(link, NULL, ATA_EH_REVALIDATE); sata_pmp_revalidate()
688 ata_eh_done(link, NULL, ATA_EH_REVALIDATE); sata_pmp_revalidate()
716 err_mask = sata_pmp_read(dev->link, SATA_PMP_GSCR_PROD_ID, &prod_id); sata_pmp_revalidate_quick()
756 struct ata_link *link = &ap->link; sata_pmp_eh_recover_pmp() local
757 struct ata_eh_context *ehc = &link->eh_context; sata_pmp_eh_recover_pmp()
758 struct ata_device *dev = link->device; sata_pmp_eh_recover_pmp()
777 rc = ata_eh_reset(link, 0, prereset, softreset, hardreset, sata_pmp_eh_recover_pmp()
780 ata_link_err(link, "failed to reset PMP, giving up\n"); sata_pmp_eh_recover_pmp()
814 sata_down_spd_limit(link, 0);
847 struct ata_link *link; sata_pmp_eh_handle_disabled_links() local
853 ata_for_each_link(link, ap, EDGE) { ata_for_each_link()
854 if (!(link->flags & ATA_LFLAG_DISABLED)) ata_for_each_link()
862 sata_link_hardreset(link, sata_deb_timing_normal, ata_for_each_link()
867 rc = sata_scr_write(link, SCR_ERROR, SERR_PHYRDY_CHG); ata_for_each_link()
869 ata_link_err(link, ata_for_each_link()
883 static int sata_pmp_handle_link_fail(struct ata_link *link, int *link_tries) sata_pmp_handle_link_fail() argument
885 struct ata_port *ap = link->ap; sata_pmp_handle_link_fail()
888 if (link_tries[link->pmp] && --link_tries[link->pmp]) sata_pmp_handle_link_fail()
891 /* disable this link */ sata_pmp_handle_link_fail()
892 if (!(link->flags & ATA_LFLAG_DISABLED)) { sata_pmp_handle_link_fail()
893 ata_link_warn(link, sata_pmp_handle_link_fail()
894 "failed to recover link after %d tries, disabling\n", sata_pmp_handle_link_fail()
898 link->flags |= ATA_LFLAG_DISABLED; sata_pmp_handle_link_fail()
902 ata_dev_disable(link->device); sata_pmp_handle_link_fail()
903 link->eh_context.i.action = 0; sata_pmp_handle_link_fail()
927 struct ata_link *pmp_link = &ap->link; sata_pmp_eh_recover()
931 struct ata_link *link; sata_pmp_eh_recover() local
938 ata_for_each_link(link, ap, EDGE) sata_pmp_eh_recover()
939 link_tries[link->pmp] = ATA_EH_PMP_LINK_TRIES; sata_pmp_eh_recover()
947 ata_for_each_dev(dev, &ap->link, ALL) sata_pmp_eh_recover()
956 ata_for_each_link(link, ap, EDGE) sata_pmp_eh_recover()
957 link_tries[link->pmp] = ATA_EH_PMP_LINK_TRIES; sata_pmp_eh_recover()
991 ops->pmp_hardreset, ops->pmp_postreset, &link); sata_pmp_eh_recover()
996 rc = sata_scr_read(&ap->link, SCR_NOTIFICATION, &sntf); sata_pmp_eh_recover()
998 sata_scr_write(&ap->link, SCR_NOTIFICATION, sntf); sata_pmp_eh_recover()
1004 ata_for_each_link(link, ap, EDGE) ata_for_each_link()
1005 if (link->lpm_policy > ATA_LPM_MAX_POWER) ata_for_each_link()
1040 ata_for_each_link(link, ap, EDGE) { ata_for_each_link()
1041 if (!(gscr_error & (1 << link->pmp))) ata_for_each_link()
1044 if (sata_pmp_handle_link_fail(link, link_tries)) { ata_for_each_link()
1045 ata_ehi_hotplugged(&link->eh_context.i); ata_for_each_link()
1048 ata_link_warn(link, ata_for_each_link()
1050 ata_link_warn(link, ata_for_each_link()
1051 "Manually issue scan to resume this link\n"); ata_for_each_link()
1064 if (sata_pmp_handle_link_fail(link, link_tries)) {
H A Dlibata-transport.h7 int ata_tlink_add(struct ata_link *link);
8 void ata_tlink_delete(struct ata_link *link);
H A Dlibata-core.c129 MODULE_PARM_DESC(force, "Force ATA configurations including cable type, link speed and transfer mode (see Documentation/kernel-parameters.txt for details)");
183 * ata_link_next - link iteration helper
184 * @link: the previous link, NULL to start
192 * Pointer to the next link.
194 struct ata_link *ata_link_next(struct ata_link *link, struct ata_port *ap, ata_link_next() argument
200 /* NULL link indicates start of iteration */ ata_link_next()
201 if (!link) ata_link_next()
209 return &ap->link; ata_link_next()
212 /* we just iterated over the host link, what's next? */ ata_link_next()
213 if (link == &ap->link) ata_link_next()
228 if (unlikely(link == ap->slave_link)) ata_link_next()
231 /* we were over a PMP link */ ata_link_next()
232 if (++link < ap->pmp_link + ap->nr_pmp_links) ata_link_next()
233 return link; ata_link_next()
236 return &ap->link; ata_link_next()
244 * @link: ATA link containing devices to iterate
253 struct ata_device *ata_dev_next(struct ata_device *dev, struct ata_link *link, ata_dev_next() argument
264 dev = link->device; ata_dev_next()
268 dev = link->device + ata_link_max_devices(link) - 1; ata_dev_next()
277 if (++dev < link->device + ata_link_max_devices(link)) ata_dev_next()
282 if (--dev >= link->device) ata_dev_next()
295 * ata_dev_phys_link - find physical link for a device
296 * @dev: ATA device to look up physical link for
298 * Look up physical link which @dev is attached to. Note that
299 * this is different from @dev->link only when @dev is on slave
300 * link. For all other cases, it's the same as @dev->link.
306 * Pointer to the found physical link.
310 struct ata_port *ap = dev->link->ap; ata_dev_phys_link()
313 return dev->link; ata_dev_phys_link()
315 return &ap->link; ata_dev_phys_link()
352 * ata_force_link_limits - force link limits according to libata.force
353 * @link: ATA link of interest
355 * Force link flags and SATA spd limit according to libata.force
358 * the host link and all fan-out ports connected via PMP. If the
360 * first fan-out link not the host link. Device number 15 always
361 * points to the host link whether PMP is attached or not. If the
362 * controller has slave link, device number 16 points to it.
367 static void ata_force_link_limits(struct ata_link *link) ata_force_link_limits() argument
370 int linkno = link->pmp; ata_force_link_limits()
373 if (ata_is_host_link(link)) ata_force_link_limits()
379 if (fe->port != -1 && fe->port != link->ap->print_id) ata_force_link_limits()
387 link->hw_sata_spd_limit = (1 << fe->param.spd_limit) - 1; ata_force_link_limits()
388 ata_link_notice(link, "FORCE: PHY spd limit set to %s\n", ata_force_link_limits()
395 link->flags |= fe->param.lflags; ata_force_link_limits()
396 ata_link_notice(link, ata_force_link_limits()
397 "FORCE: link flag 0x%x forced -> 0x%x\n", ata_force_link_limits()
398 fe->param.lflags, link->flags); ata_force_link_limits()
408 * For consistency with link selection, device number 15 selects
409 * the first device connected to the host link.
416 int devno = dev->link->pmp + dev->devno; ata_force_xfermask()
421 if (ata_is_host_link(dev->link)) ata_force_xfermask()
428 if (fe->port != -1 && fe->port != dev->link->ap->print_id) ata_force_xfermask()
462 * For consistency with link selection, device number 15 selects
463 * the first device connected to the host link.
470 int devno = dev->link->pmp + dev->devno; ata_force_horkage()
475 if (ata_is_host_link(dev->link)) ata_force_horkage()
481 if (fe->port != -1 && fe->port != dev->link->ap->print_id) ata_force_horkage()
665 } else if (lba48 && (dev->link->ap->flags & ATA_FLAG_PIO_LBA48)) { ata_rwcmd_protocol()
1332 struct ata_eh_context *ehc = &dev->link->eh_context; ata_hpa_resize()
1558 struct ata_link *link = dev->link; ata_exec_internal_sg() local
1559 struct ata_port *ap = link->ap; ata_exec_internal_sg()
1599 preempted_tag = link->active_tag; ata_exec_internal_sg()
1600 preempted_sactive = link->sactive; ata_exec_internal_sg()
1603 link->active_tag = ATA_TAG_POISON; ata_exec_internal_sg()
1604 link->sactive = 0; ata_exec_internal_sg()
1704 link->active_tag = preempted_tag; ata_exec_internal_sg()
1705 link->sactive = preempted_sactive; ata_exec_internal_sg()
1768 if (adev->link->ap->pflags & ATA_PFLAG_RESETTING) ata_pio_need_iordy()
1773 if (adev->link->ap->flags & ATA_FLAG_NO_IORDY) ata_pio_need_iordy()
1852 struct ata_port *ap = dev->link->ap; ata_dev_read_id()
2059 /* Request another EH round by returning -EAGAIN if link is ata_do_link_spd_horkage()
2064 ata_dev_info(dev, "applying link speed limit horkage to %s\n", ata_do_link_spd_horkage()
2073 struct ata_port *ap = dev->link->ap; ata_dev_knobble()
2084 struct ata_port *ap = dev->link->ap; ata_dev_config_ncq()
2165 struct ata_port *ap = dev->link->ap; ata_dev_configure()
2166 struct ata_eh_context *ehc = &dev->link->eh_context; ata_dev_configure()
2214 dev->link->ap->target_lpm_policy = ATA_LPM_MAX_POWER; ata_dev_configure()
2400 sata_scr_read(&ap->link, SCR_NOTIFICATION, &sntf) == 0)) { ata_dev_configure()
2585 ata_for_each_dev(dev, &ap->link, ALL) ata_bus_probe()
2589 ata_for_each_dev(dev, &ap->link, ALL) { ata_bus_probe()
2612 ata_for_each_dev(dev, &ap->link, ALL) { ata_bus_probe()
2625 ata_for_each_dev(dev, &ap->link, ALL_REVERSE) { ata_bus_probe()
2645 * of the link the bridge is which is a problem. ata_bus_probe()
2647 ata_for_each_dev(dev, &ap->link, ENABLED) ata_bus_probe()
2654 ata_for_each_dev(dev, &ap->link, ENABLED) { ata_bus_probe()
2655 ap->link.eh_context.i.flags |= ATA_EHI_PRINTINFO; ata_bus_probe()
2657 ap->link.eh_context.i.flags &= ~ATA_EHI_PRINTINFO; ata_bus_probe()
2663 rc = ata_set_mode(&ap->link, &dev); ata_bus_probe()
2667 ata_for_each_dev(dev, &ap->link, ENABLED) ata_bus_probe()
2689 sata_down_spd_limit(&ap->link, 0); ata_bus_probe()
2701 * sata_print_link_status - Print SATA link status
2702 * @link: SATA link to printk link status about
2704 * This function prints link speed and status of a SATA link.
2709 static void sata_print_link_status(struct ata_link *link) sata_print_link_status() argument
2713 if (sata_scr_read(link, SCR_STATUS, &sstatus)) sata_print_link_status()
2715 sata_scr_read(link, SCR_CONTROL, &scontrol); sata_print_link_status()
2717 if (ata_phys_link_online(link)) { sata_print_link_status()
2719 ata_link_info(link, "SATA link up %s (SStatus %X SControl %X)\n", sata_print_link_status()
2722 ata_link_info(link, "SATA link down (SStatus %X SControl %X)\n", sata_print_link_status()
2737 struct ata_link *link = adev->link; ata_dev_pair() local
2738 struct ata_device *pair = &link->device[1 - adev->devno]; ata_dev_pair()
2746 * @link: Link to adjust SATA spd limit for
2749 * Adjust SATA spd limit of @link downward. Note that this
2764 int sata_down_spd_limit(struct ata_link *link, u32 spd_limit) sata_down_spd_limit() argument
2769 if (!sata_scr_valid(link)) sata_down_spd_limit()
2773 * If not, use cached value in link->sata_spd. sata_down_spd_limit()
2775 rc = sata_scr_read(link, SCR_STATUS, &sstatus); sata_down_spd_limit()
2779 spd = link->sata_spd; sata_down_spd_limit()
2781 mask = link->sata_spd_limit; sata_down_spd_limit()
2810 link->sata_spd_limit = mask; sata_down_spd_limit()
2812 ata_link_warn(link, "limiting SATA link speed to %s\n", sata_down_spd_limit()
2818 static int __sata_set_spd_needed(struct ata_link *link, u32 *scontrol) __sata_set_spd_needed() argument
2820 struct ata_link *host_link = &link->ap->link; __sata_set_spd_needed()
2823 limit = link->sata_spd_limit; __sata_set_spd_needed()
2825 /* Don't configure downstream link faster than upstream link. __sata_set_spd_needed()
2829 if (!ata_is_host_link(link) && host_link->sata_spd) __sata_set_spd_needed()
2845 * @link: Link in question
2848 * @link->sata_spd_limit. This function is used to determine
2858 static int sata_set_spd_needed(struct ata_link *link) sata_set_spd_needed() argument
2862 if (sata_scr_read(link, SCR_CONTROL, &scontrol)) sata_set_spd_needed()
2865 return __sata_set_spd_needed(link, &scontrol); sata_set_spd_needed()
2870 * @link: Link to set SATA spd for
2872 * Set SATA spd of @link according to sata_spd_limit.
2881 int sata_set_spd(struct ata_link *link) sata_set_spd() argument
2886 if ((rc = sata_scr_read(link, SCR_CONTROL, &scontrol))) sata_set_spd()
2889 if (!__sata_set_spd_needed(link, &scontrol)) sata_set_spd()
2892 if ((rc = sata_scr_write(link, SCR_CONTROL, scontrol))) sata_set_spd()
3205 struct ata_port *ap = dev->link->ap; ata_dev_set_mode()
3206 struct ata_eh_context *ehc = &dev->link->eh_context; ata_dev_set_mode()
3286 * @link: link on which timings will be programmed
3301 int ata_do_set_mode(struct ata_link *link, struct ata_device **r_failed_dev) ata_do_set_mode() argument
3303 struct ata_port *ap = link->ap; ata_do_set_mode()
3308 ata_for_each_dev(dev, link, ENABLED) { ata_for_each_dev()
3340 ata_for_each_dev(dev, link, ENABLED) { ata_for_each_dev()
3354 ata_for_each_dev(dev, link, ENABLED) { ata_for_each_dev()
3365 ata_for_each_dev(dev, link, ENABLED) { ata_for_each_dev()
3384 * ata_wait_ready - wait for link to become ready
3385 * @link: link to be waited on
3387 * @check_ready: callback to check link readiness
3389 * Wait for @link to become ready. @check_ready should return
3390 * positive number if @link is ready, 0 if it isn't, -ENODEV if
3391 * link doesn't seem to be occupied, other errno for other error
3403 int ata_wait_ready(struct ata_link *link, unsigned long deadline, ata_wait_ready() argument
3404 int (*check_ready)(struct ata_link *link)) ata_wait_ready()
3411 if (link->ap->host->flags & ATA_HOST_PARALLEL_SCAN) ata_wait_ready()
3420 WARN_ON(link == link->ap->slave_link); ata_wait_ready()
3429 ready = tmp = check_ready(link); ata_wait_ready()
3434 * -ENODEV could be transient. Ignore -ENODEV if link ata_wait_ready()
3437 * ATA_TMOUT_FF_WAIT[_LONG] on -ENODEV if link isn't ata_wait_ready()
3445 if (ata_link_online(link)) ata_wait_ready()
3447 else if ((link->ap->flags & ATA_FLAG_SATA) && ata_wait_ready()
3448 !ata_link_offline(link) && ata_wait_ready()
3460 ata_link_warn(link, ata_wait_ready()
3461 "link is slow to respond, please be patient " ata_wait_ready()
3466 ata_msleep(link->ap, 50); ata_wait_ready()
3471 * ata_wait_after_reset - wait for link to become ready after reset
3472 * @link: link to be waited on
3474 * @check_ready: callback to check link readiness
3476 * Wait for @link to become ready after reset.
3484 int ata_wait_after_reset(struct ata_link *link, unsigned long deadline, ata_wait_after_reset() argument
3485 int (*check_ready)(struct ata_link *link)) ata_wait_after_reset()
3487 ata_msleep(link->ap, ATA_WAIT_AFTER_RESET); ata_wait_after_reset()
3489 return ata_wait_ready(link, deadline, check_ready); ata_wait_after_reset()
3494 * @link: ATA link to debounce SATA phy status for
3498 * Make sure SStatus of @link reaches stable state, determined by
3514 int sata_link_debounce(struct ata_link *link, const unsigned long *params, sata_link_debounce() argument
3527 if ((rc = sata_scr_read(link, SCR_STATUS, &cur))) sata_link_debounce()
3535 ata_msleep(link->ap, interval); sata_link_debounce()
3536 if ((rc = sata_scr_read(link, SCR_STATUS, &cur))) sata_link_debounce()
3555 * -EPIPE to tell upper layer to lower link speed. sata_link_debounce()
3563 * sata_link_resume - resume SATA link
3564 * @link: ATA link to resume SATA
3568 * Resume SATA phy @link and debounce it.
3576 int sata_link_resume(struct ata_link *link, const unsigned long *params, sata_link_resume() argument
3583 if ((rc = sata_scr_read(link, SCR_CONTROL, &scontrol))) sata_link_resume()
3593 if ((rc = sata_scr_write(link, SCR_CONTROL, scontrol))) sata_link_resume()
3600 ata_msleep(link->ap, 200); sata_link_resume()
3603 if ((rc = sata_scr_read(link, SCR_CONTROL, &scontrol))) sata_link_resume()
3608 ata_link_warn(link, "failed to resume link (SControl %X)\n", sata_link_resume()
3614 ata_link_warn(link, "link resume succeeded after %d retries\n", sata_link_resume()
3617 if ((rc = sata_link_debounce(link, params, deadline))) sata_link_resume()
3621 if (!(rc = sata_scr_read(link, SCR_ERROR, &serror))) sata_link_resume()
3622 rc = sata_scr_write(link, SCR_ERROR, serror); sata_link_resume()
3629 * @link: ATA link to manipulate SControl for
3633 * Manipulate the IPM field of the SControl register of @link
3636 * the link. This function also clears PHYRDY_CHG before
3645 int sata_link_scr_lpm(struct ata_link *link, enum ata_lpm_policy policy, sata_link_scr_lpm() argument
3648 struct ata_eh_context *ehc = &link->eh_context; sata_link_scr_lpm()
3653 rc = sata_scr_read(link, SCR_CONTROL, &scontrol); sata_link_scr_lpm()
3673 if (ata_link_nr_enabled(link) > 0) sata_link_scr_lpm()
3686 rc = sata_scr_write(link, SCR_CONTROL, scontrol); sata_link_scr_lpm()
3690 /* give the link time to transit out of LPM state */ sata_link_scr_lpm()
3696 return sata_scr_write(link, SCR_ERROR, SERR_PHYRDY_CHG); sata_link_scr_lpm()
3701 * @link: ATA link to be reset
3704 * @link is about to be reset. Initialize it. Failure from
3716 int ata_std_prereset(struct ata_link *link, unsigned long deadline) ata_std_prereset() argument
3718 struct ata_port *ap = link->ap; ata_std_prereset()
3719 struct ata_eh_context *ehc = &link->eh_context; ata_std_prereset()
3727 /* if SATA, resume link */ ata_std_prereset()
3729 rc = sata_link_resume(link, timing, deadline); ata_std_prereset()
3732 ata_link_warn(link, ata_std_prereset()
3733 "failed to resume link for reset (errno=%d)\n", ata_std_prereset()
3737 /* no point in trying softreset on offline link */ ata_std_prereset()
3738 if (ata_phys_link_offline(link)) ata_std_prereset()
3745 * sata_link_hardreset - reset link via SATA phy reset
3746 * @link: link to reset
3749 * @online: optional out parameter indicating link onlineness
3750 * @check_ready: optional callback to check link readiness
3752 * SATA phy-reset @link using DET bits of SControl register.
3753 * After hardreset, link readiness is waited upon using
3759 * *@online is set to one iff reset succeeded and @link is online
3768 int sata_link_hardreset(struct ata_link *link, const unsigned long *timing, sata_link_hardreset() argument
3780 if (sata_set_spd_needed(link)) { sata_link_hardreset()
3786 if ((rc = sata_scr_read(link, SCR_CONTROL, &scontrol))) sata_link_hardreset()
3791 if ((rc = sata_scr_write(link, SCR_CONTROL, scontrol))) sata_link_hardreset()
3794 sata_set_spd(link); sata_link_hardreset()
3798 if ((rc = sata_scr_read(link, SCR_CONTROL, &scontrol))) sata_link_hardreset()
3803 if ((rc = sata_scr_write_flush(link, SCR_CONTROL, scontrol))) sata_link_hardreset()
3809 ata_msleep(link->ap, 1); sata_link_hardreset()
3811 /* bring link back */ sata_link_hardreset()
3812 rc = sata_link_resume(link, timing, deadline); sata_link_hardreset()
3815 /* if link is offline nothing more to do */ sata_link_hardreset()
3816 if (ata_phys_link_offline(link)) sata_link_hardreset()
3823 if (sata_pmp_supported(link->ap) && ata_is_host_link(link)) { sata_link_hardreset()
3836 ata_wait_ready(link, pmp_deadline, check_ready); sata_link_hardreset()
3844 rc = ata_wait_ready(link, deadline, check_ready); sata_link_hardreset()
3847 /* online is set iff link is online && reset succeeded */ sata_link_hardreset()
3850 ata_link_err(link, "COMRESET failed (errno=%d)\n", rc); sata_link_hardreset()
3858 * @link: link to reset
3868 * 0 if link offline, -EAGAIN if link online, -errno on errors.
3870 int sata_std_hardreset(struct ata_link *link, unsigned int *class, sata_std_hardreset() argument
3873 const unsigned long *timing = sata_ehc_deb_timing(&link->eh_context); sata_std_hardreset()
3878 rc = sata_link_hardreset(link, timing, deadline, &online, NULL); sata_std_hardreset()
3884 * @link: the target ata_link
3894 void ata_std_postreset(struct ata_link *link, unsigned int *classes) ata_std_postreset() argument
3901 if (!sata_scr_read(link, SCR_ERROR, &serror)) ata_std_postreset()
3902 sata_scr_write(link, SCR_ERROR, serror); ata_std_postreset()
3904 /* print link status */ ata_std_postreset()
3905 sata_print_link_status(link); ata_std_postreset()
3976 u16 *id = (void *)dev->link->ap->sector_buf; ata_dev_reread_id()
4206 /* Devices which aren't very happy with higher link speeds */
4266 * Some WD SATA-I drives spin up and down erratically when the link
4313 if ((dev->link->ap->flags & ATA_FLAG_PIO_POLLING) && ata_dma_blacklisted()
4349 struct ata_link *link; cable_is_40wire() local
4376 ata_for_each_link(link, ap, EDGE) { ata_for_each_dev()
4377 ata_for_each_dev(dev, link, ENABLED) { ata_for_each_dev()
4399 struct ata_link *link = dev->link; ata_dev_xfermask() local
4400 struct ata_port *ap = link->ap; ata_dev_xfermask()
4663 struct ata_link *link = qc->dev->link; ata_std_qc_defer() local
4666 if (!ata_tag_valid(link->active_tag)) ata_std_qc_defer()
4669 if (!ata_tag_valid(link->active_tag) && !link->sactive) ata_std_qc_defer()
4763 struct ata_port *ap = dev->link->ap; ata_qc_new_init()
4818 struct ata_link *link; __ata_qc_complete() local
4823 link = qc->dev->link; __ata_qc_complete()
4830 link->sactive &= ~(1 << qc->tag); __ata_qc_complete()
4831 if (!link->sactive) __ata_qc_complete()
4834 link->active_tag = ATA_TAG_POISON; __ata_qc_complete()
4840 ap->excl_link == link)) __ata_qc_complete()
4909 struct ata_eh_info *ehi = &dev->link->eh_info; ata_qc_complete()
5043 struct ata_link *link = qc->dev->link; ata_qc_issue() local
5050 WARN_ON_ONCE(ap->ops->error_handler && ata_tag_valid(link->active_tag)); ata_qc_issue()
5053 WARN_ON_ONCE(link->sactive & (1 << qc->tag)); ata_qc_issue()
5055 if (!link->sactive) ata_qc_issue()
5057 link->sactive |= 1 << qc->tag; ata_qc_issue()
5059 WARN_ON_ONCE(link->sactive); ata_qc_issue()
5062 link->active_tag = qc->tag; ata_qc_issue()
5081 /* if device is sleeping, schedule reset and abort the link */ ata_qc_issue()
5083 link->eh_info.action |= ATA_EH_RESET; ata_qc_issue()
5084 ata_ehi_push_desc(&link->eh_info, "waking up from sleep"); ata_qc_issue()
5085 ata_link_abort(link); ata_qc_issue()
5104 * @link: ATA link to test SCR accessibility for
5106 * Test whether SCRs are accessible for @link.
5114 int sata_scr_valid(struct ata_link *link) sata_scr_valid() argument
5116 struct ata_port *ap = link->ap; sata_scr_valid()
5123 * @link: ATA link to read SCR for
5127 * Read SCR register @reg of @link into *@val. This function is
5128 * guaranteed to succeed if @link is ap->link, the cable type of
5132 * None if @link is ap->link. Kernel thread context otherwise.
5137 int sata_scr_read(struct ata_link *link, int reg, u32 *val) sata_scr_read() argument
5139 if (ata_is_host_link(link)) { sata_scr_read()
5140 if (sata_scr_valid(link)) sata_scr_read()
5141 return link->ap->ops->scr_read(link, reg, val); sata_scr_read()
5145 return sata_pmp_scr_read(link, reg, val); sata_scr_read()
5150 * @link: ATA link to write SCR for
5154 * Write @val to SCR register @reg of @link. This function is
5155 * guaranteed to succeed if @link is ap->link, the cable type of
5159 * None if @link is ap->link. Kernel thread context otherwise.
5164 int sata_scr_write(struct ata_link *link, int reg, u32 val) sata_scr_write() argument
5166 if (ata_is_host_link(link)) { sata_scr_write()
5167 if (sata_scr_valid(link)) sata_scr_write()
5168 return link->ap->ops->scr_write(link, reg, val); sata_scr_write()
5172 return sata_pmp_scr_write(link, reg, val); sata_scr_write()
5177 * @link: ATA link to write SCR for
5185 * None if @link is ap->link. Kernel thread context otherwise.
5190 int sata_scr_write_flush(struct ata_link *link, int reg, u32 val) sata_scr_write_flush() argument
5192 if (ata_is_host_link(link)) { sata_scr_write_flush()
5195 if (sata_scr_valid(link)) { sata_scr_write_flush()
5196 rc = link->ap->ops->scr_write(link, reg, val); sata_scr_write_flush()
5198 rc = link->ap->ops->scr_read(link, reg, &val); sata_scr_write_flush()
5204 return sata_pmp_scr_write(link, reg, val); sata_scr_write_flush()
5208 * ata_phys_link_online - test whether the given link is online
5209 * @link: ATA link to test
5211 * Test whether @link is online. Note that this function returns
5212 * 0 if online status of @link cannot be obtained, so
5213 * ata_link_online(link) != !ata_link_offline(link).
5221 bool ata_phys_link_online(struct ata_link *link) ata_phys_link_online() argument
5225 if (sata_scr_read(link, SCR_STATUS, &sstatus) == 0 && ata_phys_link_online()
5232 * ata_phys_link_offline - test whether the given link is offline
5233 * @link: ATA link to test
5235 * Test whether @link is offline. Note that this function
5236 * returns 0 if offline status of @link cannot be obtained, so
5237 * ata_link_online(link) != !ata_link_offline(link).
5245 bool ata_phys_link_offline(struct ata_link *link) ata_phys_link_offline() argument
5249 if (sata_scr_read(link, SCR_STATUS, &sstatus) == 0 && ata_phys_link_offline()
5256 * ata_link_online - test whether the given link is online
5257 * @link: ATA link to test
5259 * Test whether @link is online. This is identical to
5260 * ata_phys_link_online() when there's no slave link. When
5261 * there's a slave link, this function should only be called on
5262 * the master link and will return true if any of M/S links is
5271 bool ata_link_online(struct ata_link *link) ata_link_online() argument
5273 struct ata_link *slave = link->ap->slave_link; ata_link_online()
5275 WARN_ON(link == slave); /* shouldn't be called on slave link */ ata_link_online()
5277 return ata_phys_link_online(link) || ata_link_online()
5282 * ata_link_offline - test whether the given link is offline
5283 * @link: ATA link to test
5285 * Test whether @link is offline. This is identical to
5286 * ata_phys_link_offline() when there's no slave link. When
5287 * there's a slave link, this function should only be called on
5288 * the master link and will return true if both M/S links are
5297 bool ata_link_offline(struct ata_link *link) ata_link_offline() argument
5299 struct ata_link *slave = link->ap->slave_link; ata_link_offline()
5301 WARN_ON(link == slave); /* shouldn't be called on slave link */ ata_link_offline()
5303 return ata_phys_link_offline(link) && ata_link_offline()
5312 struct ata_link *link; ata_port_request_pm() local
5328 ata_for_each_link(link, ap, HOST_FIRST) { ata_for_each_link()
5329 link->eh_info.action |= action; ata_for_each_link()
5330 link->eh_info.flags |= ehi_flags; ata_for_each_link()
5425 struct ata_link *link; ata_port_runtime_idle() local
5428 ata_for_each_link(link, ap, HOST_FIRST) { ata_for_each_link()
5429 ata_for_each_dev(adev, link, ENABLED) ata_for_each_link()
5523 struct ata_link *link = ata_dev_phys_link(dev); ata_dev_init() local
5524 struct ata_port *ap = link->ap; ata_dev_init()
5528 link->sata_spd_limit = link->hw_sata_spd_limit; ata_dev_init()
5529 link->sata_spd = 0; ata_dev_init()
5549 * @ap: ATA port link is attached to
5550 * @link: Link structure to initialize
5553 * Initialize @link.
5558 void ata_link_init(struct ata_port *ap, struct ata_link *link, int pmp) ata_link_init() argument
5563 memset((void *)link + ATA_LINK_CLEAR_BEGIN, 0, ata_link_init()
5566 link->ap = ap; ata_link_init()
5567 link->pmp = pmp; ata_link_init()
5568 link->active_tag = ATA_TAG_POISON; ata_link_init()
5569 link->hw_sata_spd_limit = UINT_MAX; ata_link_init()
5573 struct ata_device *dev = &link->device[i]; ata_link_init()
5575 dev->link = link; ata_link_init()
5576 dev->devno = dev - link->device; ata_link_init()
5585 * sata_link_init_spd - Initialize link->sata_spd_limit
5586 * @link: Link to configure sata_spd_limit for
5588 * Initialize @link->[hw_]sata_spd_limit to the currently
5597 int sata_link_init_spd(struct ata_link *link) sata_link_init_spd() argument
5602 rc = sata_scr_read(link, SCR_CONTROL, &link->saved_scontrol); sata_link_init_spd()
5606 spd = (link->saved_scontrol >> 4) & 0xf; sata_link_init_spd()
5608 link->hw_sata_spd_limit &= (1 << spd) - 1; sata_link_init_spd()
5610 ata_force_link_limits(link); sata_link_init_spd()
5612 link->sata_spd_limit = link->hw_sata_spd_limit; sata_link_init_spd()
5667 ata_link_init(ap, &ap->link, 0); ata_port_alloc()
5805 ap->link.flags |= pi->link_flags; ata_host_alloc_pinfo()
5816 * ata_slave_link_init - initialize slave link
5817 * @ap: port to initialize slave link for
5819 * Create and initialize slave link for @ap. This enables slave
5820 * link handling on the port.
5822 * In libata, a port contains links and a link contains devices.
5823 * There is single host link but if a PMP is attached to it,
5825 * a single device connected to a link but PATA and SATA
5833 * need separate links for physical link handling
5834 * (e.g. onlineness, link speed) but should be treated like a
5840 * anything other than physical link handling, the default host
5841 * link is used for both master and slave. For physical link
5845 * called once more for the slave link, so the reset sequence
5863 struct ata_link *link; ata_slave_link_init() local
5868 link = kzalloc(sizeof(*link), GFP_KERNEL); ata_slave_link_init()
5869 if (!link) ata_slave_link_init()
5872 ata_link_init(ap, link, 1); ata_slave_link_init()
5873 ap->slave_link = link; ata_slave_link_init()
6044 struct ata_eh_info *ehi = &ap->link.eh_info; __ata_port_probe()
6163 sata_link_init_spd(&ap->link); ata_host_register()
6175 ap->link.eh_info.desc); ata_host_register()
6176 ata_ehi_clear_desc(&ap->link.eh_info); ata_host_register()
6266 struct ata_link *link; ata_port_detach() local
6288 ata_for_each_link(link, ap, HOST_FIRST) { ata_for_each_dev()
6289 ata_for_each_dev(dev, link, ALL) { ata_for_each_dev()
6556 *reason = "invalid port/link"; ata_parse_force_one()
6756 * @link: Link receiving the event
6766 bool sata_lpm_ignore_phy_events(struct ata_link *link) sata_lpm_ignore_phy_events() argument
6768 unsigned long lpm_timeout = link->last_lpm_change + sata_lpm_ignore_phy_events()
6772 if (link->lpm_policy > ATA_LPM_MAX_POWER) sata_lpm_ignore_phy_events()
6778 if ((link->flags & ATA_LFLAG_CHANGED) && sata_lpm_ignore_phy_events()
6831 void ata_link_printk(const struct ata_link *link, const char *level, ata_link_printk() argument
6842 if (sata_pmp_attached(link->ap) || link->ap->slave_link) ata_link_printk()
6844 level, link->ap->print_id, link->pmp, &vaf); ata_link_printk()
6847 level, link->ap->print_id, &vaf); ata_link_printk()
6865 level, dev->link->ap->print_id, dev->link->pmp + dev->devno, ata_dev_printk()
H A Dlibata-eh.c262 if (ap->link.eh_info.desc_len) ata_port_desc()
263 __ata_ehi_push_desc(&ap->link.eh_info, " "); ata_port_desc()
266 __ata_ehi_pushv_desc(&ap->link.eh_info, fmt, args); ata_port_desc()
341 struct ata_eh_context *ehc = &dev->link->eh_context; ata_internal_cmd_timeout()
366 struct ata_eh_context *ehc = &dev->link->eh_context; ata_internal_cmd_timed_out()
437 struct ata_eh_context *ehc = &dev->link->eh_context; ata_eh_dev_action()
442 static void ata_eh_clear_action(struct ata_link *link, struct ata_device *dev, ata_eh_clear_action() argument
449 ata_for_each_dev(tdev, link, ALL) ata_eh_clear_action()
457 ata_for_each_dev(tdev, link, ALL) ata_eh_clear_action()
539 qc = ata_qc_from_tag(ap, ap->link.active_tag); ata_scsi_timed_out()
555 struct ata_link *link; ata_eh_unload() local
562 ata_for_each_link(link, ap, PMP_FIRST) { ata_for_each_link()
563 sata_scr_write(link, SCR_CONTROL, link->saved_scontrol & 0xff0); ata_for_each_link()
564 ata_for_each_dev(dev, link, ALL) ata_for_each_link()
726 struct ata_link *link; ata_scsi_port_error_handler() local
740 ata_for_each_link(link, ap, HOST_FIRST) { ata_for_each_link()
741 struct ata_eh_context *ehc = &link->eh_context; ata_for_each_link()
744 memset(&link->eh_context, 0, sizeof(link->eh_context)); ata_for_each_link()
745 link->eh_context.i = link->eh_info; ata_for_each_link()
746 memset(&link->eh_info, 0, sizeof(link->eh_info)); ata_for_each_link()
748 ata_for_each_dev(dev, link, ENABLED) { ata_for_each_dev()
795 ata_for_each_link(link, ap, HOST_FIRST)
796 memset(&link->eh_info, 0, sizeof(link->eh_info));
808 WARN_ON(ata_qc_from_tag(ap, ap->link.active_tag) == NULL);
1048 static int ata_do_link_abort(struct ata_port *ap, struct ata_link *link) ata_do_link_abort() argument
1060 if (qc && (!link || qc->dev->link == link)) { ata_do_link_abort()
1074 * ata_link_abort - abort all qc's on the link
1075 * @link: ATA link to abort qc's for
1077 * Abort all active qc's active on @link and schedule EH.
1085 int ata_link_abort(struct ata_link *link) ata_link_abort() argument
1087 return ata_do_link_abort(link->ap, link); ata_link_abort()
1184 rc = sata_scr_read(&ap->link, SCR_NOTIFICATION, &sntf); sata_async_notification()
1186 sata_scr_write(&ap->link, SCR_NOTIFICATION, sntf); sata_async_notification()
1195 struct ata_device *dev = ap->link.device; sata_async_notification()
1212 struct ata_link *link; sata_async_notification() local
1215 ata_for_each_link(link, ap, EDGE) { ata_for_each_link()
1216 if (!(sntf & (1 << link->pmp))) ata_for_each_link()
1219 if ((link->device->class == ATA_DEV_ATAPI) && ata_for_each_link()
1220 (link->device->flags & ATA_DFLAG_AN)) ata_for_each_link()
1221 ata_scsi_media_change_notify(link->device); ata_for_each_link()
1352 if (ata_msg_drv(dev->link->ap)) ata_dev_disable()
1375 struct ata_link *link = dev->link; ata_eh_detach_dev() local
1376 struct ata_port *ap = link->ap; ata_eh_detach_dev()
1377 struct ata_eh_context *ehc = &link->eh_context; ata_eh_detach_dev()
1392 ata_eh_clear_action(link, dev, &link->eh_info, ATA_EH_PERDEV_MASK); ata_eh_detach_dev()
1393 ata_eh_clear_action(link, dev, &link->eh_context.i, ATA_EH_PERDEV_MASK); ata_eh_detach_dev()
1402 * @link: target ATA link
1407 * in @link->eh_info such that eh actions are not unnecessarily
1413 void ata_eh_about_to_do(struct ata_link *link, struct ata_device *dev, ata_eh_about_to_do() argument
1416 struct ata_port *ap = link->ap; ata_eh_about_to_do()
1417 struct ata_eh_info *ehi = &link->eh_info; ata_eh_about_to_do()
1418 struct ata_eh_context *ehc = &link->eh_context; ata_eh_about_to_do()
1423 ata_eh_clear_action(link, dev, ehi, action); ata_eh_about_to_do()
1428 if (!(ehc->i.flags & ATA_EHI_QUIET) && link != ap->slave_link) ata_eh_about_to_do()
1441 * in @link->eh_context.
1446 void ata_eh_done(struct ata_link *link, struct ata_device *dev, ata_eh_done() argument
1449 struct ata_eh_context *ehc = &link->eh_context; ata_eh_done()
1451 ata_eh_clear_action(link, dev, &ehc->i, action); ata_eh_done()
1563 u8 *buf = dev->link->ap->sector_buf; ata_eh_read_log_10h()
1650 struct ata_port *ap = dev->link->ap; atapi_eh_request_sense()
1685 * @link: ATA link to analyze SError for
1693 static void ata_eh_analyze_serror(struct ata_link *link) ata_eh_analyze_serror() argument
1695 struct ata_eh_context *ehc = &link->eh_context; ata_eh_analyze_serror()
1716 * considered as X bit is left at 1 for link plugging. ata_eh_analyze_serror()
1718 if (link->lpm_policy > ATA_LPM_MAX_POWER) ata_eh_analyze_serror()
1720 else if (!(link->flags & ATA_LFLAG_DISABLED) || ata_is_host_link(link)) ata_eh_analyze_serror()
1734 * @link: ATA link to analyze NCQ error for
1744 void ata_eh_analyze_ncq_error(struct ata_link *link) ata_eh_analyze_ncq_error() argument
1746 struct ata_port *ap = link->ap; ata_eh_analyze_ncq_error()
1747 struct ata_eh_context *ehc = &link->eh_context; ata_eh_analyze_ncq_error()
1748 struct ata_device *dev = link->device; ata_eh_analyze_ncq_error()
1758 if (!link->sactive || !(ehc->i.err_mask & AC_ERR_DEV)) ata_eh_analyze_ncq_error()
1776 ata_link_err(link, "failed to read log page 10h (errno=%d)\n", ata_eh_analyze_ncq_error()
1781 if (!(link->sactive & (1 << tag))) { ata_eh_analyze_ncq_error()
1782 ata_link_err(link, "log page 10h reported inactive tag %d\n", ata_eh_analyze_ncq_error()
2031 struct ata_link *link = ata_dev_phys_link(dev); ata_eh_speed_down() local
2055 /* speed down SATA link speed if possible */ ata_eh_speed_down()
2056 if (sata_down_spd_limit(link, 0) == 0) { ata_eh_speed_down()
2087 (link->ap->cbl != ATA_CBL_SATA || dev->class == ATA_DEV_ATAPI) && ata_eh_speed_down()
2126 * @link: host link to perform autopsy on
2128 * Analyze why @link failed and determine which recovery actions
2135 static void ata_eh_link_autopsy(struct ata_link *link) ata_eh_link_autopsy() argument
2137 struct ata_port *ap = link->ap; ata_eh_link_autopsy()
2138 struct ata_eh_context *ehc = &link->eh_context; ata_eh_link_autopsy()
2151 rc = sata_scr_read(link, SCR_ERROR, &serror); ata_eh_link_autopsy()
2154 ata_eh_analyze_serror(link); ata_eh_link_autopsy()
2163 ata_eh_analyze_ncq_error(link); ata_eh_link_autopsy()
2175 ata_dev_phys_link(qc->dev) != link) ata_eh_link_autopsy()
2226 /* propagate timeout to host link */ ata_eh_link_autopsy()
2227 if ((all_err_mask & AC_ERR_TIMEOUT) && !ata_is_host_link(link)) ata_eh_link_autopsy()
2228 ap->link.eh_context.i.err_mask |= AC_ERR_TIMEOUT; ata_eh_link_autopsy()
2232 if (!dev && ((ata_link_max_devices(link) == 1 && ata_eh_link_autopsy()
2233 ata_dev_enabled(link->device)))) ata_eh_link_autopsy()
2234 dev = link->device; ata_eh_link_autopsy()
2257 struct ata_link *link; ata_eh_autopsy() local
2259 ata_for_each_link(link, ap, EDGE) ata_for_each_link()
2260 ata_eh_link_autopsy(link); ata_for_each_link()
2262 /* Handle the frigging slave link. Autopsy is done similarly ata_for_each_link()
2264 * link and handled from there. ata_for_each_link()
2267 struct ata_eh_context *mehc = &ap->link.eh_context; ata_for_each_link()
2273 /* perform autopsy on the slave link */ ata_for_each_link()
2284 /* Autopsy of fanout ports can affect host link autopsy.
2285 * Perform host link autopsy last.
2288 ata_eh_link_autopsy(&ap->link);
2413 * @link: ATA link EH is going on
2420 static void ata_eh_link_report(struct ata_link *link) ata_eh_link_report() argument
2422 struct ata_port *ap = link->ap; ata_eh_link_report()
2423 struct ata_eh_context *ehc = &link->eh_context; ata_eh_link_report()
2439 ata_dev_phys_link(qc->dev) != link || ata_eh_link_report()
2463 ehc->i.err_mask, link->sactive, ehc->i.serror, ata_eh_link_report()
2468 ata_link_err(link, "exception Emask 0x%x " ata_eh_link_report()
2470 ehc->i.err_mask, link->sactive, ehc->i.serror, ata_eh_link_report()
2473 ata_link_err(link, "%s\n", desc); ata_eh_link_report()
2478 ata_link_err(link, ata_eh_link_report()
2506 ata_dev_phys_link(qc->dev) != link || !qc->err_mask) ata_eh_link_report()
2599 struct ata_link *link; ata_eh_report() local
2601 ata_for_each_link(link, ap, HOST_FIRST) ata_eh_report()
2602 ata_eh_link_report(link); ata_eh_report()
2605 static int ata_do_reset(struct ata_link *link, ata_reset_fn_t reset, ata_do_reset() argument
2612 ata_for_each_dev(dev, link, ALL) ata_do_reset()
2615 return reset(link, classes, deadline); ata_do_reset()
2618 static int ata_eh_followup_srst_needed(struct ata_link *link, int rc) ata_eh_followup_srst_needed() argument
2620 if ((link->flags & ATA_LFLAG_NO_SRST) || ata_link_offline(link)) ata_eh_followup_srst_needed()
2624 if (sata_pmp_supported(link->ap) && ata_is_host_link(link)) ata_eh_followup_srst_needed()
2629 int ata_eh_reset(struct ata_link *link, int classify, ata_eh_reset() argument
2633 struct ata_port *ap = link->ap; ata_eh_reset()
2635 struct ata_eh_context *ehc = &link->eh_context; ata_eh_reset()
2638 unsigned int lflags = link->flags; ata_eh_reset()
2654 if (link->flags & ATA_LFLAG_RST_ONCE) ata_eh_reset()
2656 if (link->flags & ATA_LFLAG_NO_HRST) ata_eh_reset()
2658 if (link->flags & ATA_LFLAG_NO_SRST) ata_eh_reset()
2675 ata_eh_about_to_do(link, NULL, ATA_EH_RESET); ata_eh_reset()
2677 ata_for_each_dev(dev, link, ALL) { ata_for_each_dev()
2717 rc = prereset(link, deadline);
2719 /* If present, do prereset on slave link too. Reset
2735 ata_link_dbg(link, "port disabled--ignoring\n");
2738 ata_for_each_dev(dev, link, ALL)
2743 ata_link_err(link,
2753 ata_for_each_dev(dev, link, ALL)
2756 ata_is_host_link(link))
2767 if (ata_is_host_link(link))
2774 ata_link_info(link, "%s resetting link\n",
2784 rc = ata_do_reset(link, reset, classes, deadline, true);
2786 failed_link = link;
2790 /* hardreset slave link if existent */
2795 ata_link_info(slave, "hard resetting link\n");
2814 ata_eh_followup_srst_needed(link, rc)) {
2818 ata_link_err(link,
2820 failed_link = link;
2825 ata_eh_about_to_do(link, NULL, ATA_EH_RESET);
2826 rc = ata_do_reset(link, reset, classes, deadline, true);
2828 failed_link = link;
2834 ata_link_info(link,
2843 ata_for_each_dev(dev, link, ALL) { ata_for_each_dev()
2861 /* record current link speed */
2862 if (sata_scr_read(link, SCR_STATUS, &sstatus) == 0)
2863 link->sata_spd = (sstatus >> 4) & 0xf;
2868 if (ata_is_host_link(link))
2872 * is cleared during link resume, clearing SError here is
2876 * link onlineness and classification result later.
2879 postreset(link, classes);
2888 * final recovery action and we cross check link onlineness against
2891 spin_lock_irqsave(link->ap->lock, flags);
2892 memset(&link->eh_info, 0, sizeof(link->eh_info));
2894 memset(&slave->eh_info, 0, sizeof(link->eh_info));
2896 spin_unlock_irqrestore(link->ap->lock, flags);
2906 * link on/offlineness and classification result, those
2910 ata_for_each_dev(dev, link, ALL) { ata_for_each_dev()
2913 ata_dev_dbg(dev, "link online but device misclassified\n"); ata_for_each_dev()
2920 "link offline, clearing class %d to NONE\n", ata_for_each_dev()
2925 "link status unknown, clearing UNKNOWN to NONE\n"); ata_for_each_dev()
2932 ata_link_warn(link,
2933 "link online but %d devices misclassified, retrying\n",
2935 failed_link = link;
2939 ata_link_warn(link,
2940 "link online but %d devices misclassified, "
2945 ata_eh_done(link, NULL, ATA_EH_RESET);
2950 link->lpm_policy = ATA_LPM_UNKNOWN; /* reset LPM state */
2967 if (!ata_is_host_link(link) &&
2968 sata_scr_read(link, SCR_STATUS, &sstatus))
2978 if (ata_is_host_link(link))
3002 if (ata_is_host_link(link))
3008 sata_down_spd_limit(link, 0);
3021 struct ata_link *link; ata_eh_pull_park_action() local
3053 ata_for_each_link(link, ap, EDGE) { ata_for_each_dev()
3054 ata_for_each_dev(dev, link, ALL) { ata_for_each_dev()
3055 struct ata_eh_info *ehi = &link->eh_info; ata_for_each_dev()
3057 link->eh_context.i.dev_action[dev->devno] |= ata_for_each_dev()
3059 ata_eh_clear_action(link, dev, ehi, ATA_EH_PARK); ata_for_each_dev()
3067 struct ata_eh_context *ehc = &dev->link->eh_context; ata_eh_park_issue_cmd()
3093 static int ata_eh_revalidate_and_attach(struct ata_link *link, ata_eh_revalidate_and_attach() argument
3096 struct ata_port *ap = link->ap; ata_eh_revalidate_and_attach()
3097 struct ata_eh_context *ehc = &link->eh_context; ata_eh_revalidate_and_attach()
3109 ata_for_each_dev(dev, link, ALL_REVERSE) { ata_for_each_dev()
3124 ata_eh_about_to_do(link, dev, ATA_EH_REVALIDATE); ata_for_each_dev()
3130 ata_eh_done(link, dev, ATA_EH_REVALIDATE); ata_for_each_dev()
3180 if ((ehc->i.flags & ATA_EHI_DID_RESET) && ata_is_host_link(link)) {
3189 ata_for_each_dev(dev, link, ALL) { ata_for_each_dev()
3224 * @link: link on which timings will be programmed
3237 int ata_set_mode(struct ata_link *link, struct ata_device **r_failed_dev) ata_set_mode() argument
3239 struct ata_port *ap = link->ap; ata_set_mode()
3244 ata_for_each_dev(dev, link, ENABLED) { ata_for_each_dev()
3256 rc = ap->ops->set_mode(link, r_failed_dev);
3258 rc = ata_do_set_mode(link, r_failed_dev);
3261 ata_for_each_dev(dev, link, ENABLED) { ata_for_each_dev()
3262 struct ata_eh_context *ehc = &link->eh_context; ata_for_each_dev()
3293 u8 *sense_buffer = dev->link->ap->sector_buf; atapi_eh_clear_ua()
3341 struct ata_link *link = dev->link; ata_eh_maybe_retry_flush() local
3342 struct ata_port *ap = link->ap; ata_eh_maybe_retry_flush()
3349 if (!ata_tag_valid(link->active_tag)) ata_eh_maybe_retry_flush()
3352 qc = __ata_qc_from_tag(ap, link->active_tag); ata_eh_maybe_retry_flush()
3400 * @link: link to configure power management
3401 * @policy: the link power management policy
3415 static int ata_eh_set_lpm(struct ata_link *link, enum ata_lpm_policy policy, ata_eh_set_lpm() argument
3418 struct ata_port *ap = ata_is_host_link(link) ? link->ap : NULL; ata_eh_set_lpm()
3419 struct ata_eh_context *ehc = &link->eh_context; ata_eh_set_lpm()
3421 enum ata_lpm_policy old_policy = link->lpm_policy; ata_eh_set_lpm()
3422 bool no_dipm = link->ap->flags & ATA_FLAG_NO_DIPM; ata_eh_set_lpm()
3427 /* if the link or host doesn't do LPM, noop */ ata_eh_set_lpm()
3428 if ((link->flags & ATA_LFLAG_NO_LPM) || (ap && !ap->ops->set_lpm)) ata_eh_set_lpm()
3434 * device and link configurations such that the host always ata_eh_set_lpm()
3437 ata_for_each_dev(dev, link, ENABLED) { ata_for_each_dev()
3452 /* disable DIPM before changing link config */ ata_for_each_dev()
3467 rc = ap->ops->set_lpm(link, policy, hints);
3471 rc = sata_pmp_set_lpm(link, policy, hints);
3474 * Attribute link config failure to the first (LPM) enabled
3475 * device on the link.
3479 link->flags |= ATA_LFLAG_NO_LPM;
3490 link->lpm_policy = policy;
3495 ata_for_each_dev(dev, link, ENABLED) { ata_for_each_dev()
3510 link->last_lpm_change = jiffies;
3511 link->flags |= ATA_LFLAG_CHANGED;
3517 link->lpm_policy = old_policy;
3523 ata_link_warn(link, "disabling LPM on the link\n");
3524 link->flags |= ATA_LFLAG_NO_LPM;
3531 int ata_link_nr_enabled(struct ata_link *link) ata_link_nr_enabled() argument
3536 ata_for_each_dev(dev, link, ENABLED) ata_link_nr_enabled()
3541 static int ata_link_nr_vacant(struct ata_link *link) ata_link_nr_vacant() argument
3546 ata_for_each_dev(dev, link, ALL) ata_link_nr_vacant()
3552 static int ata_eh_skip_recovery(struct ata_link *link) ata_eh_skip_recovery() argument
3554 struct ata_port *ap = link->ap; ata_eh_skip_recovery()
3555 struct ata_eh_context *ehc = &link->eh_context; ata_eh_skip_recovery()
3559 if (link->flags & ATA_LFLAG_DISABLED) ata_eh_skip_recovery()
3567 if ((ap->pflags & ATA_PFLAG_FROZEN) || ata_link_nr_enabled(link)) ata_eh_skip_recovery()
3576 ata_for_each_dev(dev, link, ALL) { ata_for_each_dev()
3601 struct ata_eh_context *ehc = &dev->link->eh_context; ata_eh_schedule_probe()
3602 struct ata_link *link = ata_dev_phys_link(dev); ata_eh_schedule_probe() local
3616 /* the link maybe in a deep sleep, wake it up */ ata_eh_schedule_probe()
3617 if (link->lpm_policy > ATA_LPM_MAX_POWER) { ata_eh_schedule_probe()
3618 if (ata_is_host_link(link)) ata_eh_schedule_probe()
3619 link->ap->ops->set_lpm(link, ATA_LPM_MAX_POWER, ata_eh_schedule_probe()
3622 sata_pmp_set_lpm(link, ATA_LPM_MAX_POWER, ata_eh_schedule_probe()
3632 * in the last ATA_EH_PROBE_TRIAL_INTERVAL, link speed is ata_eh_schedule_probe()
3635 * This is to work around cases where failed link speed ata_eh_schedule_probe()
3643 sata_down_spd_limit(link, 1); ata_eh_schedule_probe()
3650 struct ata_eh_context *ehc = &dev->link->eh_context; ata_eh_handle_dev_fail()
3705 * @r_failed_link: out parameter for failed link
3709 * recover each link and hotplug requests are recorded in the
3710 * link's eh_context. This function executes all the operations
3725 struct ata_link *link; ata_eh_recover() local
3733 ata_for_each_link(link, ap, EDGE) { ata_for_each_link()
3734 struct ata_eh_context *ehc = &link->eh_context; ata_for_each_link()
3736 /* re-enable link? */ ata_for_each_link()
3738 ata_eh_about_to_do(link, NULL, ATA_EH_ENABLE_LINK); ata_for_each_link()
3740 link->flags &= ~ATA_LFLAG_DISABLED; ata_for_each_link()
3742 ata_eh_done(link, NULL, ATA_EH_ENABLE_LINK); ata_for_each_link()
3745 ata_for_each_dev(dev, link, ALL) { ata_for_each_dev()
3746 if (link->flags & ATA_LFLAG_NO_RETRY) ata_for_each_dev()
3774 ata_for_each_link(link, ap, EDGE) { ata_for_each_link()
3775 struct ata_eh_context *ehc = &link->eh_context; ata_for_each_link()
3778 if (ata_eh_skip_recovery(link)) ata_for_each_link()
3781 ata_for_each_dev(dev, link, ALL) ata_for_each_link()
3786 ata_for_each_link(link, ap, EDGE) { ata_for_each_link()
3787 struct ata_eh_context *ehc = &link->eh_context; ata_for_each_link()
3792 rc = ata_eh_reset(link, ata_link_nr_vacant(link), ata_for_each_link()
3795 ata_link_err(link, "reset failed, giving up\n"); ata_for_each_link()
3810 ata_for_each_link(link, ap, EDGE) { ata_for_each_dev()
3811 ata_for_each_dev(dev, link, ALL) { ata_for_each_dev()
3812 struct ata_eh_context *ehc = &link->eh_context; ata_for_each_dev()
3842 ata_for_each_link(link, ap, EDGE) { ata_for_each_dev()
3843 ata_for_each_dev(dev, link, ALL) { ata_for_each_dev()
3844 if (!(link->eh_context.unloaded_mask & ata_for_each_dev()
3849 ata_eh_done(link, dev, ATA_EH_PARK); ata_for_each_dev()
3855 ata_for_each_link(link, ap, PMP_FIRST) { ata_for_each_link()
3856 struct ata_eh_context *ehc = &link->eh_context; ata_for_each_link()
3858 if (sata_pmp_attached(ap) && ata_is_host_link(link)) ata_for_each_link()
3862 rc = ata_eh_revalidate_and_attach(link, &dev); ata_for_each_link()
3867 if (link->device->class == ATA_DEV_PMP) { ata_for_each_link()
3874 rc = ata_set_mode(link, &dev); ata_for_each_link()
3884 ata_for_each_dev(dev, link, ALL) { ata_for_each_dev()
3896 ata_for_each_dev(dev, link, ALL) { ata_for_each_dev()
3906 /* configure link power saving */
3907 if (link->lpm_policy != ap->target_lpm_policy) {
3908 rc = ata_eh_set_lpm(link, ap->target_lpm_policy, &dev);
3913 /* this link is okay now */
3937 *r_failed_link = link;
4016 ata_for_each_dev(dev, &ap->link, ALL) ata_do_eh()
4038 if (hardreset == sata_std_hardreset && !sata_scr_valid(&ap->link)) ata_std_error_handler()
4077 ata_for_each_dev(dev, &ap->link, ENABLED) { ata_eh_handle_port_suspend()
4121 struct ata_link *link; ata_eh_handle_port_resume() local
4144 ata_for_each_link(link, ap, HOST_FIRST) ata_eh_handle_port_resume()
4145 ata_for_each_dev(dev, link, ALL) ata_eh_handle_port_resume()
H A Dsata_sis.c66 static int sis_scr_read(struct ata_link *link, unsigned int sc_reg, u32 *val);
67 static int sis_scr_write(struct ata_link *link, unsigned int sc_reg, u32 val);
115 static unsigned int get_scr_cfg_addr(struct ata_link *link, unsigned int sc_reg) get_scr_cfg_addr() argument
117 struct ata_port *ap = link->ap; get_scr_cfg_addr()
138 if (link->pmp) get_scr_cfg_addr()
144 static u32 sis_scr_cfg_read(struct ata_link *link, sis_scr_cfg_read() argument
147 struct pci_dev *pdev = to_pci_dev(link->ap->host->dev); sis_scr_cfg_read()
148 unsigned int cfg_addr = get_scr_cfg_addr(link, sc_reg); sis_scr_cfg_read()
157 static int sis_scr_cfg_write(struct ata_link *link, sis_scr_cfg_write() argument
160 struct pci_dev *pdev = to_pci_dev(link->ap->host->dev); sis_scr_cfg_write()
161 unsigned int cfg_addr = get_scr_cfg_addr(link, sc_reg); sis_scr_cfg_write()
167 static int sis_scr_read(struct ata_link *link, unsigned int sc_reg, u32 *val) sis_scr_read() argument
169 struct ata_port *ap = link->ap; sis_scr_read()
170 void __iomem *base = ap->ioaddr.scr_addr + link->pmp * 0x10; sis_scr_read()
176 return sis_scr_cfg_read(link, sc_reg, val); sis_scr_read()
182 static int sis_scr_write(struct ata_link *link, unsigned int sc_reg, u32 val) sis_scr_write() argument
184 struct ata_port *ap = link->ap; sis_scr_write()
185 void __iomem *base = ap->ioaddr.scr_addr + link->pmp * 0x10; sis_scr_write()
191 return sis_scr_cfg_write(link, sc_reg, val); sis_scr_write()
H A Dlibahci.c59 static int ahci_set_lpm(struct ata_link *link, enum ata_lpm_policy policy,
69 static int ahci_scr_read(struct ata_link *link, unsigned int sc_reg, u32 *val);
70 static int ahci_scr_write(struct ata_link *link, unsigned int sc_reg, u32 val);
83 static int ahci_softreset(struct ata_link *link, unsigned int *class,
85 static int ahci_pmp_retry_softreset(struct ata_link *link, unsigned int *class,
87 static int ahci_hardreset(struct ata_link *link, unsigned int *class,
89 static void ahci_postreset(struct ata_link *link, unsigned int *class);
98 static void ahci_init_sw_activity(struct ata_link *link);
556 static int ahci_scr_read(struct ata_link *link, unsigned int sc_reg, u32 *val) ahci_scr_read() argument
558 void __iomem *port_mmio = ahci_port_base(link->ap); ahci_scr_read()
559 int offset = ahci_scr_offset(link->ap, sc_reg); ahci_scr_read()
568 static int ahci_scr_write(struct ata_link *link, unsigned int sc_reg, u32 val) ahci_scr_write() argument
570 void __iomem *port_mmio = ahci_port_base(link->ap); ahci_scr_write()
571 int offset = ahci_scr_offset(link->ap, sc_reg); ahci_scr_write()
679 /* wake up link */ ahci_power_up()
683 static int ahci_set_lpm(struct ata_link *link, enum ata_lpm_policy policy, ahci_set_lpm() argument
686 struct ata_port *ap = link->ap; ahci_set_lpm()
700 sata_link_scr_lpm(link, policy, false); ahci_set_lpm()
728 (link->device->flags & ATA_DFLAG_DEVSLP)) { ahci_set_lpm()
736 sata_link_scr_lpm(link, policy, false); ahci_set_lpm()
772 struct ata_link *link; ahci_start_port() local
786 ata_for_each_link(link, ap, EDGE) { ata_for_each_link()
787 emp = &pp->em_priv[link->pmp]; ata_for_each_link()
811 ata_for_each_link(link, ap, EDGE)
812 ahci_init_sw_activity(link);
885 static void ahci_sw_activity(struct ata_link *link) ahci_sw_activity() argument
887 struct ata_port *ap = link->ap; ahci_sw_activity()
889 struct ahci_em_priv *emp = &pp->em_priv[link->pmp]; ahci_sw_activity()
891 if (!(link->flags & ATA_LFLAG_SW_ACTIVITY)) ahci_sw_activity()
901 struct ata_link *link = (struct ata_link *)arg; ahci_sw_activity_blink() local
902 struct ata_port *ap = link->ap; ahci_sw_activity_blink()
904 struct ahci_em_priv *emp = &pp->em_priv[link->pmp]; ahci_sw_activity_blink()
910 led_message |= ap->port_no | (link->pmp << 8); ahci_sw_activity_blink()
943 static void ahci_init_sw_activity(struct ata_link *link) ahci_init_sw_activity() argument
945 struct ata_port *ap = link->ap; ahci_init_sw_activity()
947 struct ahci_em_priv *emp = &pp->em_priv[link->pmp]; ahci_init_sw_activity()
951 setup_timer(&emp->timer, ahci_sw_activity_blink, (unsigned long)link); ahci_init_sw_activity()
953 /* check our blink policy and set flag for link if it's enabled */ ahci_init_sw_activity()
955 link->flags |= ATA_LFLAG_SW_ACTIVITY; ahci_init_sw_activity()
1034 struct ata_link *link; ahci_led_show() local
1038 ata_for_each_link(link, ap, EDGE) { ata_for_each_link()
1039 emp = &pp->em_priv[link->pmp]; ata_for_each_link()
1075 struct ata_link *link = dev->link; ahci_activity_store() local
1076 struct ata_port *ap = link->ap; ahci_activity_store()
1078 struct ahci_em_priv *emp = &pp->em_priv[link->pmp]; ahci_activity_store()
1084 link->flags &= ~(ATA_LFLAG_SW_ACTIVITY); ahci_activity_store()
1088 port_led_state |= (ap->port_no | (link->pmp << 8)); ahci_activity_store()
1091 link->flags |= ATA_LFLAG_SW_ACTIVITY; ahci_activity_store()
1095 port_led_state |= (ap->port_no | (link->pmp << 8)); ahci_activity_store()
1106 struct ata_link *link = dev->link; ahci_activity_show() local
1107 struct ata_port *ap = link->ap; ahci_activity_show()
1109 struct ahci_em_priv *emp = &pp->em_priv[link->pmp]; ahci_activity_show()
1172 struct ahci_host_priv *hpriv = dev->link->ap->host->private_data; ahci_dev_config()
1286 int ahci_do_softreset(struct ata_link *link, unsigned int *class, ahci_do_softreset() argument
1288 int (*check_ready)(struct ata_link *link)) ahci_do_softreset()
1290 struct ata_port *ap = link->ap; ahci_do_softreset()
1304 ata_link_warn(link, "failed to reset engine (errno=%d)\n", rc); ahci_do_softreset()
1311 if (!ata_is_host_link(link) && pp->fbs_enabled) { ahci_do_softreset()
1316 ata_tf_init(link->device, &tf); ahci_do_softreset()
1339 /* wait for link to become ready */ ahci_do_softreset()
1340 rc = ata_wait_after_reset(link, deadline, check_ready); ahci_do_softreset()
1343 * Workaround for cases where link online status can't ahci_do_softreset()
1344 * be trusted. Treat device readiness timeout as link ahci_do_softreset()
1347 ata_link_info(link, "device not ready, treating as offline\n"); ahci_do_softreset()
1350 /* link occupied, -ENODEV too is an error */ ahci_do_softreset()
1364 ata_link_err(link, "softreset failed (%s)\n", reason); ahci_do_softreset()
1368 int ahci_check_ready(struct ata_link *link) ahci_check_ready() argument
1370 void __iomem *port_mmio = ahci_port_base(link->ap); ahci_check_ready()
1377 static int ahci_softreset(struct ata_link *link, unsigned int *class, ahci_softreset() argument
1380 int pmp = sata_srst_pmp(link); ahci_softreset()
1384 return ahci_do_softreset(link, class, pmp, deadline, ahci_check_ready); ahci_softreset()
1388 static int ahci_bad_pmp_check_ready(struct ata_link *link) ahci_bad_pmp_check_ready() argument
1390 void __iomem *port_mmio = ahci_port_base(link->ap); ahci_bad_pmp_check_ready()
1404 static int ahci_pmp_retry_softreset(struct ata_link *link, unsigned int *class, ahci_pmp_retry_softreset() argument
1407 struct ata_port *ap = link->ap; ahci_pmp_retry_softreset()
1409 int pmp = sata_srst_pmp(link); ahci_pmp_retry_softreset()
1415 rc = ahci_do_softreset(link, class, pmp, deadline, ahci_pmp_retry_softreset()
1426 ata_link_warn(link, ahci_pmp_retry_softreset()
1429 rc = ahci_do_softreset(link, class, 0, deadline, ahci_pmp_retry_softreset()
1437 static int ahci_hardreset(struct ata_link *link, unsigned int *class, ahci_hardreset() argument
1440 const unsigned long *timing = sata_ehc_deb_timing(&link->eh_context); ahci_hardreset()
1441 struct ata_port *ap = link->ap; ahci_hardreset()
1454 ata_tf_init(link->device, &tf); ahci_hardreset()
1458 rc = sata_link_hardreset(link, timing, deadline, &online, ahci_hardreset()
1470 static void ahci_postreset(struct ata_link *link, unsigned int *class) ahci_postreset() argument
1472 struct ata_port *ap = link->ap; ahci_postreset()
1476 ata_std_postreset(link, class); ahci_postreset()
1540 ata_tf_to_fis(&qc->tf, qc->dev->link->pmp, 1, cmd_tbl); ahci_qc_prep()
1553 opts = cmd_fis_len | n_elem << 16 | (qc->dev->link->pmp << 12); ahci_qc_prep()
1590 struct ata_eh_info *host_ehi = &ap->link.eh_info; ahci_error_intr()
1591 struct ata_link *link = NULL; ahci_error_intr() local
1597 /* determine active link with error */ ahci_error_intr()
1604 link = &ap->pmp_link[pmp]; ahci_error_intr()
1609 ata_for_each_link(link, ap, EDGE) ahci_error_intr()
1610 if (ata_link_active(link)) ahci_error_intr()
1613 if (!link) ahci_error_intr()
1614 link = &ap->link; ahci_error_intr()
1616 active_qc = ata_qc_from_tag(ap, link->active_tag); ahci_error_intr()
1617 active_ehi = &link->eh_info; ahci_error_intr()
1624 ahci_scr_read(&ap->link, SCR_ERROR, &serror); ahci_error_intr()
1625 ahci_scr_write(&ap->link, SCR_ERROR, serror); ahci_error_intr()
1634 * link. There's no active qc on NCQ errors. It will ahci_error_intr()
1691 ata_link_abort(link); ahci_error_intr()
1700 struct ata_eh_info *ehi = &ap->link.eh_info; ahci_handle_port_interrupt()
1711 if (sata_lpm_ignore_phy_events(&ap->link)) { ahci_handle_port_interrupt()
1713 ahci_scr_write(&ap->link, SCR_ERROR, SERR_PHYRDY_CHG); ahci_handle_port_interrupt()
1895 /* Keep track of the currently active link. It will be used ahci_qc_issue()
1899 pp->active_link = qc->dev->link; ahci_qc_issue()
1904 if (pp->fbs_enabled && pp->fbs_last_dev != qc->dev->link->pmp) { ahci_qc_issue()
1907 fbs |= qc->dev->link->pmp << PORT_FBS_DEV_OFFSET; ahci_qc_issue()
1909 pp->fbs_last_dev = qc->dev->link->pmp; ahci_qc_issue()
1914 ahci_sw_activity(qc->dev->link); ahci_qc_issue()
1926 rx_fis += qc->dev->link->pmp * AHCI_RX_FIS_SZ; ahci_qc_fill_rtf()
1981 if (!ata_dev_enabled(ap->link.device)) ahci_error_handler()
1999 struct ata_device *dev = ap->link.device; ahci_set_aggressive_devslp()
H A Dlibata.h79 extern int ata_wait_ready(struct ata_link *link, unsigned long deadline,
80 int (*check_ready)(struct ata_link *link));
87 extern int sata_down_spd_limit(struct ata_link *link, u32 spd_limit);
97 extern bool ata_phys_link_online(struct ata_link *link);
98 extern bool ata_phys_link_offline(struct ata_link *link);
100 extern void ata_link_init(struct ata_port *ap, struct ata_link *link, int pmp);
101 extern int sata_link_init_spd(struct ata_link *link);
162 extern void ata_eh_about_to_do(struct ata_link *link, struct ata_device *dev, ata_acpi_bind_dev()
164 extern void ata_eh_done(struct ata_link *link, struct ata_device *dev, ata_acpi_bind_dev()
171 extern int ata_eh_reset(struct ata_link *link, int classify, ata_acpi_bind_dev()
174 extern int ata_set_mode(struct ata_link *link, struct ata_device **r_failed_dev); ata_acpi_bind_dev()
189 extern int sata_pmp_scr_read(struct ata_link *link, int reg, u32 *val); ata_acpi_bind_dev()
190 extern int sata_pmp_scr_write(struct ata_link *link, int reg, u32 val); ata_acpi_bind_dev()
191 extern int sata_pmp_set_lpm(struct ata_link *link, enum ata_lpm_policy policy, ata_acpi_bind_dev()
195 static inline int sata_pmp_scr_read(struct ata_link *link, int reg, u32 *val) sata_pmp_scr_read() argument
200 static inline int sata_pmp_scr_write(struct ata_link *link, int reg, u32 val) sata_pmp_scr_write() argument
205 static inline int sata_pmp_set_lpm(struct ata_link *link, sata_pmp_set_lpm() argument
H A Dsata_sil24.c336 static int sil24_scr_read(struct ata_link *link, unsigned sc_reg, u32 *val);
337 static int sil24_scr_write(struct ata_link *link, unsigned sc_reg, u32 val);
346 static int sil24_softreset(struct ata_link *link, unsigned int *class,
348 static int sil24_hardreset(struct ata_link *link, unsigned int *class,
350 static int sil24_pmp_hardreset(struct ata_link *link, unsigned int *class,
481 void __iomem *port = sil24_port_base(dev->link->ap); sil24_dev_config()
507 static int sil24_scr_read(struct ata_link *link, unsigned sc_reg, u32 *val) sil24_scr_read() argument
509 void __iomem *scr_addr = sil24_port_base(link->ap) + PORT_SCONTROL; sil24_scr_read()
518 static int sil24_scr_write(struct ata_link *link, unsigned sc_reg, u32 val) sil24_scr_write() argument
520 void __iomem *scr_addr = sil24_port_base(link->ap) + PORT_SCONTROL; sil24_scr_write()
597 ap->link.eh_context.i.action |= ATA_EH_RESET; sil24_init_port()
656 static int sil24_softreset(struct ata_link *link, unsigned int *class, sil24_softreset() argument
659 struct ata_port *ap = link->ap; sil24_softreset()
660 int pmp = sata_srst_pmp(link); sil24_softreset()
678 ata_tf_init(link->device, &tf); /* doesn't really matter */ sil24_softreset()
696 ata_link_err(link, "softreset failed (%s)\n", reason); sil24_softreset()
700 static int sil24_hardreset(struct ata_link *link, unsigned int *class, sil24_hardreset() argument
703 struct ata_port *ap = link->ap; sil24_hardreset()
734 sata_set_spd(link); sil24_hardreset()
737 if (ata_link_online(link)) sil24_hardreset()
748 rc = sata_link_debounce(link, sata_deb_timing_long, deadline); sil24_hardreset()
755 if (ata_link_offline(link)) sil24_hardreset()
757 reason = "link not ready"; sil24_hardreset()
775 ata_link_err(link, "hardreset failed (%s)\n", reason); sil24_hardreset()
800 struct ata_link *link = qc->dev->link; sil24_qc_defer() local
801 struct ata_port *ap = link->ap; sil24_qc_defer()
827 if (link == ap->excl_link) { sil24_qc_defer()
834 ap->excl_link = link; sil24_qc_defer()
883 ata_tf_to_fis(&qc->tf, qc->dev->link->pmp, 1, prb->fis); sil24_qc_prep()
920 u32 *gscr = ap->link.device->gscr; sil24_pmp_attach()
941 static int sil24_pmp_hardreset(struct ata_link *link, unsigned int *class, sil24_pmp_hardreset() argument
946 rc = sil24_init_port(link->ap); sil24_pmp_hardreset()
948 ata_link_err(link, "hardreset failed (port not ready)\n"); sil24_pmp_hardreset()
952 return sata_std_hardreset(link, class, deadline); sil24_pmp_hardreset()
983 struct ata_link *link; sil24_error_intr() local
993 link = &ap->link; sil24_error_intr()
994 ehi = &link->eh_info; sil24_error_intr()
1041 /* find out the offending link and qc */ sil24_error_intr()
1047 link = &ap->pmp_link[pmp]; sil24_error_intr()
1048 ehi = &link->eh_info; sil24_error_intr()
1049 qc = ata_qc_from_tag(ap, link->active_tag); sil24_error_intr()
1060 qc = ata_qc_from_tag(ap, link->active_tag); sil24_error_intr()
1099 ata_link_abort(qc->dev->link); sil24_error_intr()
1133 struct ata_eh_info *ehi = &ap->link.eh_info; sil24_host_intr()
1144 slot_stat, ap->link.active_tag, ap->link.sactive); sil24_host_intr()
1279 /* cause link error if sil24_cmd_block is sized wrongly */ sil24_init_one()
H A Dlibata-transport.c16 * Each port has a link object. Each link can have up to two devices for PATA
84 /* Device objects are always created whit link objects */
254 * Removes the specified ATA PORT. Remove the associated link as well.
260 ata_tlink_delete(&ap->link); ata_tport_delete()
305 error = ata_tlink_add(&ap->link); ata_tport_add()
323 * ATA link attributes
332 struct ata_link *link = transport_class_to_link(dev); \ noop()
334 return sprintf(buf, "%s\n", sata_spd_string(format(link->field))); \ noop()
355 * ata_is_link -- check if a struct device represents a ATA link
359 * %1 if the device represents a ATA link, %0 else
381 void ata_tlink_delete(struct ata_link *link) ata_tlink_delete() argument
383 struct device *dev = &link->tdev; ata_tlink_delete()
386 ata_for_each_dev(ata_dev, link, ALL) { ata_for_each_dev()
397 * ata_tlink_add -- initialize a transport ATA link structure
398 * @link: allocated ata_link structure.
405 int ata_tlink_add(struct ata_link *link) ata_tlink_add() argument
407 struct device *dev = &link->tdev; ata_tlink_add()
408 struct ata_port *ap = link->ap; ata_tlink_add()
415 if (ata_is_host_link(link)) ata_tlink_add()
416 dev_set_name(dev, "link%d", ap->print_id); ata_tlink_add()
418 dev_set_name(dev, "link%d.%d", ap->print_id, link->pmp); ata_tlink_add()
430 ata_for_each_dev(ata_dev, link, ALL) { ata_for_each_dev()
438 while (--ata_dev >= link->device) {
659 struct ata_link *link = ata_dev->link; ata_tdev_add() local
660 struct ata_port *ap = link->ap; ata_tdev_add()
664 dev->parent = get_device(&link->tdev); ata_tdev_add()
666 if (ata_is_host_link(link)) ata_tdev_add()
669 dev_set_name(dev, "dev%d.%d.0", ap->print_id, link->pmp); ata_tdev_add()
H A Dsata_via.c77 static int svia_scr_read(struct ata_link *link, unsigned int sc_reg, u32 *val);
78 static int svia_scr_write(struct ata_link *link, unsigned int sc_reg, u32 val);
79 static int vt8251_scr_read(struct ata_link *link, unsigned int scr, u32 *val);
80 static int vt8251_scr_write(struct ata_link *link, unsigned int scr, u32 val);
83 static int vt6420_prereset(struct ata_link *link, unsigned long deadline);
187 static int svia_scr_read(struct ata_link *link, unsigned int sc_reg, u32 *val) svia_scr_read() argument
191 *val = ioread32(link->ap->ioaddr.scr_addr + (4 * sc_reg)); svia_scr_read()
195 static int svia_scr_write(struct ata_link *link, unsigned int sc_reg, u32 val) svia_scr_write() argument
199 iowrite32(val, link->ap->ioaddr.scr_addr + (4 * sc_reg)); svia_scr_write()
203 static int vt8251_scr_read(struct ata_link *link, unsigned int scr, u32 *val) vt8251_scr_read() argument
206 struct pci_dev *pdev = to_pci_dev(link->ap->host->dev); vt8251_scr_read()
207 int slot = 2 * link->ap->port_no + link->pmp; vt8251_scr_read()
252 static int vt8251_scr_write(struct ata_link *link, unsigned int scr, u32 val) vt8251_scr_write() argument
254 struct pci_dev *pdev = to_pci_dev(link->ap->host->dev); vt8251_scr_write()
255 int slot = 2 * link->ap->port_no + link->pmp; vt8251_scr_write()
314 * @link: target ATA link
332 static int vt6420_prereset(struct ata_link *link, unsigned long deadline) vt6420_prereset() argument
334 struct ata_port *ap = link->ap; vt6420_prereset()
335 struct ata_eh_context *ehc = &ap->link.eh_context; vt6420_prereset()
345 svia_scr_write(link, SCR_CONTROL, 0x300); vt6420_prereset()
346 svia_scr_read(link, SCR_CONTROL, &scontrol); /* flush */ vt6420_prereset()
350 ata_msleep(link->ap, 200); vt6420_prereset()
351 svia_scr_read(link, SCR_STATUS, &sstatus); vt6420_prereset()
357 svia_scr_read(link, SCR_STATUS, &sstatus); vt6420_prereset()
358 svia_scr_read(link, SCR_CONTROL, &scontrol); vt6420_prereset()
363 "SATA link %s 1.5 Gbps (SStatus %X SControl %X)\n", vt6420_prereset()
367 svia_scr_read(link, SCR_STATUS, &sstatus); vt6420_prereset()
377 ata_sff_wait_ready(link, deadline); vt6420_prereset()
H A Dsata_uli.c60 static int uli_scr_read(struct ata_link *link, unsigned int sc_reg, u32 *val);
61 static int uli_scr_write(struct ata_link *link, unsigned int sc_reg, u32 val);
109 static u32 uli_scr_cfg_read(struct ata_link *link, unsigned int sc_reg) uli_scr_cfg_read() argument
111 struct pci_dev *pdev = to_pci_dev(link->ap->host->dev); uli_scr_cfg_read()
112 unsigned int cfg_addr = get_scr_cfg_addr(link->ap, sc_reg); uli_scr_cfg_read()
119 static void uli_scr_cfg_write(struct ata_link *link, unsigned int scr, u32 val) uli_scr_cfg_write() argument
121 struct pci_dev *pdev = to_pci_dev(link->ap->host->dev); uli_scr_cfg_write()
122 unsigned int cfg_addr = get_scr_cfg_addr(link->ap, scr); uli_scr_cfg_write()
127 static int uli_scr_read(struct ata_link *link, unsigned int sc_reg, u32 *val) uli_scr_read() argument
132 *val = uli_scr_cfg_read(link, sc_reg); uli_scr_read()
136 static int uli_scr_write(struct ata_link *link, unsigned int sc_reg, u32 val) uli_scr_write() argument
141 uli_scr_cfg_write(link, sc_reg, val); uli_scr_write()
H A Dpata_rz1000.c28 * @link: ATA link
36 static int rz1000_set_mode(struct ata_link *link, struct ata_device **unused) rz1000_set_mode() argument
40 ata_for_each_dev(dev, link, ENABLED) { ata_for_each_dev()
H A Dsata_dwc_460ex.c282 tag = ap->link.active_tag; dma_dwc_xfer_done()
345 static int sata_dwc_scr_read(struct ata_link *link, unsigned int scr, u32 *val) sata_dwc_scr_read() argument
348 dev_err(link->ap->dev, "%s: Incorrect SCR offset 0x%02x\n", sata_dwc_scr_read()
353 *val = in_le32(link->ap->ioaddr.scr_addr + (scr * 4)); sata_dwc_scr_read()
354 dev_dbg(link->ap->dev, "%s: id=%d reg=%d val=val=0x%08x\n", sata_dwc_scr_read()
355 __func__, link->ap->print_id, scr, *val); sata_dwc_scr_read()
360 static int sata_dwc_scr_write(struct ata_link *link, unsigned int scr, u32 val) sata_dwc_scr_write() argument
362 dev_dbg(link->ap->dev, "%s: id=%d reg=%d val=val=0x%08x\n", sata_dwc_scr_write()
363 __func__, link->ap->print_id, scr, val); sata_dwc_scr_write()
365 dev_err(link->ap->dev, "%s: Incorrect SCR offset 0x%02x\n", sata_dwc_scr_write()
369 out_le32(link->ap->ioaddr.scr_addr + (scr * 4), val); sata_dwc_scr_write()
407 struct ata_eh_info *ehi = &ap->link.eh_info; sata_dwc_error_intr()
418 tag = ap->link.active_tag; sata_dwc_error_intr()
476 ap->link.active_tag); sata_dwc_isr()
502 qc->ap->link.active_tag = tag; sata_dwc_isr()
513 if (ap->link.active_tag == ATA_TAG_POISON) sata_dwc_isr()
516 tag = ap->link.active_tag; sata_dwc_isr()
530 qc->ap->link.active_tag = tag; sata_dwc_isr()
617 qc->ap->link.active_tag = tag; sata_dwc_isr()
705 tag = ap->link.active_tag; sata_dwc_dma_xfer_complete()
733 ap->link.active_tag = ATA_TAG_POISON; sata_dwc_dma_xfer_complete()
957 dev_dbg(qc->ap->dev, "%s: ap->link.sactive=0x%08x tag=%d\n", sata_dwc_bmdma_setup()
958 __func__, qc->ap->link.sactive, tag); sata_dwc_bmdma_setup()
1019 dev_dbg(qc->ap->dev, "%s: ap->link.sactive=0x%08x tag=%d\n", sata_dwc_bmdma_start()
1020 __func__, qc->ap->link.sactive, tag); sata_dwc_bmdma_start()
1060 if (qc->tag > 0 || ap->link.sactive > 1) sata_dwc_qc_issue()
1066 ap->link.active_tag, ap->link.sactive); sata_dwc_qc_issue()
1079 "%s: tag=%d ap->link.sactive = 0x%08x sactive=0x%08x\n", sata_dwc_qc_issue()
1080 __func__, tag, qc->ap->link.sactive, sactive); sata_dwc_qc_issue()
1106 __func__, qc->tag, qc->ap->link.active_tag); sata_dwc_qc_prep()
1117 static int sata_dwc_hardreset(struct ata_link *link, unsigned int *class, sata_dwc_hardreset() argument
1120 struct sata_dwc_device *hsdev = HSDEV_FROM_AP(link->ap); sata_dwc_hardreset()
1123 ret = sata_sff_hardreset(link, class, deadline); sata_dwc_hardreset()
H A Dahci_xgene.c84 /* Max retry for link down */
212 port_fbs |= qc->dev->link->pmp << PORT_FBS_DEV_OFFSET; xgene_ahci_qc_issue()
312 * @link: link to reset
322 * reboot cycle regression, sometimes the PHY reports link down even if the
324 * the COMRESET to get the link up. The following algorithm is followed to
330 * 3. If no link, go to Alg Part 3
331 * 4. If link up, determine if the negotiated speed matches the PHY
339 * 1. On link up, if there are any SERR_DISPARITY and SERR_10B_8B_ERR error
345 * communication establishment failed and maximum link down attempts are
357 static int xgene_ahci_do_hardreset(struct ata_link *link, xgene_ahci_do_hardreset() argument
360 const unsigned long *timing = sata_ehc_deb_timing(&link->eh_context); xgene_ahci_do_hardreset()
361 struct ata_port *ap = link->ap; xgene_ahci_do_hardreset()
374 ata_tf_init(link->device, &tf); xgene_ahci_do_hardreset()
377 rc = sata_link_hardreset(link, timing, deadline, online, xgene_ahci_do_hardreset()
382 dev_warn(ctx->dev, "link has error\n"); xgene_ahci_do_hardreset()
386 sata_scr_read(link, SCR_STATUS, &sstatus); xgene_ahci_do_hardreset()
397 static int xgene_ahci_hardreset(struct ata_link *link, unsigned int *class, xgene_ahci_hardreset() argument
400 struct ata_port *ap = link->ap; xgene_ahci_hardreset()
420 rc = xgene_ahci_do_hardreset(link, deadline, &online); xgene_ahci_hardreset()
447 * @link: link to reset
458 static int xgene_ahci_pmp_softreset(struct ata_link *link, unsigned int *class, xgene_ahci_pmp_softreset() argument
461 int pmp = sata_srst_pmp(link); xgene_ahci_pmp_softreset()
462 struct ata_port *ap = link->ap; xgene_ahci_pmp_softreset()
476 rc = ahci_do_softreset(link, class, pmp, deadline, ahci_check_ready); xgene_ahci_pmp_softreset()
483 * @link: link to reset
502 static int xgene_ahci_softreset(struct ata_link *link, unsigned int *class, xgene_ahci_softreset() argument
505 int pmp = sata_srst_pmp(link); xgene_ahci_softreset()
506 struct ata_port *ap = link->ap; xgene_ahci_softreset()
527 rc = ahci_do_softreset(link, class, pmp, xgene_ahci_softreset()
H A Dpata_jmicron.c31 * @link: ATA link
41 static int jmicron_pre_reset(struct ata_link *link, unsigned long deadline) jmicron_pre_reset() argument
43 struct ata_port *ap = link->ap; jmicron_pre_reset()
104 return ata_sff_prereset(link, deadline); jmicron_pre_reset()
H A Dpata_marvell.c61 * @link: link
67 static int marvell_pre_reset(struct ata_link *link, unsigned long deadline) marvell_pre_reset() argument
69 struct ata_port *ap = link->ap; marvell_pre_reset()
76 return ata_sff_prereset(link, deadline); marvell_pre_reset()
H A Dpata_ns87410.c33 * @link: ATA link
39 static int ns87410_pre_reset(struct ata_link *link, unsigned long deadline) ns87410_pre_reset() argument
41 struct ata_port *ap = link->ap; ns87410_pre_reset()
51 return ata_sff_prereset(link, deadline); ns87410_pre_reset()
H A Dpata_opti.c47 * @link: ATA link
53 static int opti_pre_reset(struct ata_link *link, unsigned long deadline) opti_pre_reset() argument
55 struct ata_port *ap = link->ap; opti_pre_reset()
65 return ata_sff_prereset(link, deadline); opti_pre_reset()
H A Dsata_sil.c119 static int sil_scr_read(struct ata_link *link, unsigned int sc_reg, u32 *val);
120 static int sil_scr_write(struct ata_link *link, unsigned int sc_reg, u32 val);
121 static int sil_set_mode(struct ata_link *link, struct ata_device **r_failed);
353 * @link: link to set up
360 static int sil_set_mode(struct ata_link *link, struct ata_device **r_failed) sil_set_mode() argument
362 struct ata_port *ap = link->ap; sil_set_mode()
369 rc = ata_do_set_mode(link, r_failed); sil_set_mode()
373 ata_for_each_dev(dev, link, ALL) { ata_for_each_dev()
412 static int sil_scr_read(struct ata_link *link, unsigned int sc_reg, u32 *val) sil_scr_read() argument
414 void __iomem *mmio = sil_scr_addr(link->ap, sc_reg); sil_scr_read()
423 static int sil_scr_write(struct ata_link *link, unsigned int sc_reg, u32 val) sil_scr_write() argument
425 void __iomem *mmio = sil_scr_addr(link->ap, sc_reg); sil_scr_write()
436 struct ata_eh_info *ehi = &ap->link.eh_info; sil_host_intr()
437 struct ata_queued_cmd *qc = ata_qc_from_tag(ap, ap->link.active_tag); sil_host_intr()
447 sil_scr_read(&ap->link, SCR_ERROR, &serror); sil_host_intr()
448 sil_scr_write(&ap->link, SCR_ERROR, serror); sil_host_intr()
454 ap->link.eh_info.serror |= serror; sil_host_intr()
628 struct ata_port *ap = dev->link->ap; sil_dev_config()
629 int print_info = ap->link.eh_context.i.flags & ATA_EHI_PRINTINFO; sil_dev_config()
H A Dlibata-sff.c256 static int ata_sff_check_ready(struct ata_link *link) ata_sff_check_ready() argument
258 u8 status = link->ap->ops->sff_check_status(link->ap); ata_sff_check_ready()
265 * @link: SFF link to wait ready status for
277 int ata_sff_wait_ready(struct ata_link *link, unsigned long deadline) ata_sff_wait_ready() argument
279 return ata_wait_ready(link, deadline, ata_sff_check_ready); ata_sff_wait_ready()
363 if (can_sleep && ap->link.device[device].class == ATA_DEV_ATAPI) ata_dev_select()
561 struct ata_port *ap = dev->link->ap; ata_sff_data_xfer()
616 struct ata_port *ap = dev->link->ap; ata_sff_data_xfer32()
833 struct ata_eh_info *ehi = &dev->link->eh_info; __atapi_pio_bytes()
915 struct ata_eh_info *ehi = &dev->link->eh_info; atapi_pio_bytes()
1042 struct ata_link *link = qc->dev->link; ata_sff_hsm_move() local
1043 struct ata_eh_info *ehi = &link->eh_info; ata_sff_hsm_move()
1301 void ata_sff_queue_pio_task(struct ata_link *link, unsigned long delay) ata_sff_queue_pio_task() argument
1303 struct ata_port *ap = link->ap; ata_sff_queue_pio_task()
1306 (ap->sff_pio_task_link != link)); ata_sff_queue_pio_task()
1307 ap->sff_pio_task_link = link; ata_sff_queue_pio_task()
1342 struct ata_link *link = ap->sff_pio_task_link; ata_sff_pio_task() local
1351 qc = ata_qc_from_tag(ap, link->active_tag); ata_sff_pio_task()
1375 ata_sff_queue_pio_task(link, ATA_SHORT_PAUSE); ata_sff_pio_task()
1382 * clean the link beforehand. ata_sff_pio_task()
1413 struct ata_link *link = qc->dev->link; ata_sff_qc_issue() local
1434 ata_sff_queue_pio_task(link, 0); ata_sff_qc_issue()
1447 ata_sff_queue_pio_task(link, 0); ata_sff_qc_issue()
1457 ata_sff_queue_pio_task(link, 0); ata_sff_qc_issue()
1479 ata_sff_queue_pio_task(link, 0); ata_sff_qc_issue()
1613 qc = ata_qc_from_tag(ap, ap->link.active_tag); __ata_sff_interrupt()
1706 qc = ata_qc_from_tag(ap, ap->link.active_tag); ata_sff_lost_interrupt()
1774 * ata_sff_prereset - prepare SFF link for reset
1775 * @link: SFF link to be reset
1778 * SFF link @link is about to be reset. Initialize it. It first
1788 int ata_sff_prereset(struct ata_link *link, unsigned long deadline) ata_sff_prereset() argument
1790 struct ata_eh_context *ehc = &link->eh_context; ata_sff_prereset()
1793 rc = ata_std_prereset(link, deadline); ata_sff_prereset()
1802 if (!ata_link_offline(link)) { ata_sff_prereset()
1803 rc = ata_sff_wait_ready(link, deadline); ata_sff_prereset()
1805 ata_link_warn(link, ata_sff_prereset()
1882 struct ata_port *ap = dev->link->ap; ata_sff_dev_classify()
1931 * @link: SFF link which is just reset
1935 * Wait devices attached to SFF @link to become ready after
1946 int ata_sff_wait_after_reset(struct ata_link *link, unsigned int devmask, ata_sff_wait_after_reset() argument
1949 struct ata_port *ap = link->ap; ata_sff_wait_after_reset()
1958 rc = ata_sff_wait_ready(link, deadline); ata_sff_wait_after_reset()
1987 rc = ata_sff_wait_ready(link, deadline); ata_sff_wait_after_reset()
2024 return ata_sff_wait_after_reset(&ap->link, devmask, deadline); ata_bus_softreset()
2029 * @link: ATA link to reset
2041 int ata_sff_softreset(struct ata_link *link, unsigned int *classes, ata_sff_softreset() argument
2044 struct ata_port *ap = link->ap; ata_sff_softreset()
2064 /* if link is occupied, -ENODEV too is an error */ ata_sff_softreset()
2065 if (rc && (rc != -ENODEV || sata_scr_valid(link))) { ata_sff_softreset()
2066 ata_link_err(link, "SRST failed (errno=%d)\n", rc); ata_sff_softreset()
2071 classes[0] = ata_sff_dev_classify(&link->device[0], ata_sff_softreset()
2074 classes[1] = ata_sff_dev_classify(&link->device[1], ata_sff_softreset()
2084 * @link: link to reset
2097 int sata_sff_hardreset(struct ata_link *link, unsigned int *class, sata_sff_hardreset() argument
2100 struct ata_eh_context *ehc = &link->eh_context; sata_sff_hardreset()
2105 rc = sata_link_hardreset(link, timing, deadline, &online, sata_sff_hardreset()
2108 *class = ata_sff_dev_classify(link->device, 1, NULL); sata_sff_hardreset()
2117 * @link: the target SFF ata_link
2127 void ata_sff_postreset(struct ata_link *link, unsigned int *classes) ata_sff_postreset() argument
2129 struct ata_port *ap = link->ap; ata_sff_postreset()
2131 ata_std_postreset(link, classes); ata_sff_postreset()
2204 qc = __ata_qc_from_tag(ap, ap->link.active_tag); ata_sff_error_handler()
2224 hardreset == sata_sff_hardreset) && !sata_scr_valid(&ap->link)) ata_sff_error_handler()
2783 struct ata_link *link = qc->dev->link; ata_bmdma_qc_issue() local
2812 ata_sff_queue_pio_task(link, 0); ata_bmdma_qc_issue()
2839 struct ata_eh_info *ehi = &ap->link.eh_info; ata_bmdma_port_intr()
2911 qc = __ata_qc_from_tag(ap, ap->link.active_tag); ata_bmdma_error_handler()
/linux-4.1.27/drivers/usb/gadget/function/
H A Du_ether.h2 * u_ether.h -- interface to USB gadget "ethernet link" utilities
48 * This represents the USB side of an "ethernet" link, managed by a USB
50 * in different configurations could share the same ethernet link/netdev,
53 * There is a current limitation that only one instance of this link may
101 /* gether_setup - initialize one ethernet-over-usb link
104 * host side of the link is recorded
107 * This sets up the single network link that may be exported by a
108 * gadget driver using this framework. The link layer addresses are
130 * Registers the net device associated with this ethernet-over-usb link
135 /* gether_setup_default - initialize one ethernet-over-usb link
138 * This sets up the single network link that may be exported by a
139 * gadget driver using this framework. The link layer addresses
150 * gether_set_gadget - initialize one ethernet-over-usb link with a gadget
151 * @net: device representing this link
154 * This associates one ethernet-over-usb link with a gadget.
159 * gether_set_dev_addr - initialize an ethernet-over-usb link with eth address
160 * @net: device representing this link
163 * This sets the device-side Ethernet address of this ethernet-over-usb link
170 * gether_get_dev_addr - get an ethernet-over-usb link eth address
171 * @net: device representing this link
175 * This gets the device-side Ethernet address of this ethernet-over-usb link.
181 * gether_set_host_addr - initialize an ethernet-over-usb link with host address
182 * @net: device representing this link
185 * This sets the host-side Ethernet address of this ethernet-over-usb link
192 * gether_get_host_addr - get an ethernet-over-usb link host address
193 * @net: device representing this link
197 * This gets the host-side Ethernet address of this ethernet-over-usb link.
203 * gether_get_host_addr_cdc - get an ethernet-over-usb link host address
204 * @net: device representing this link
209 * ethernet-over-usb link.
215 * gether_get_host_addr_u8 - get an ethernet-over-usb link host address
216 * @net: device representing this link
220 * ethernet-over-usb link.
225 * gether_set_qmult - initialize an ethernet-over-usb link with a multiplier
226 * @net: device representing this link
229 * This sets the queue length multiplier of this ethernet-over-usb link.
235 * gether_get_qmult - get an ethernet-over-usb link multiplier
236 * @net: device representing this link
238 * This gets the queue length multiplier of this ethernet-over-usb link.
243 * gether_get_ifname - get an ethernet-over-usb link interface name
244 * @net: device representing this link
248 * This gets the interface name of this ethernet-over-usb link.
H A Du_ether.c2 * u_ether.c -- Ethernet-over-USB link layer utilities for Gadget stack
29 * This component encapsulates the Ethernet link glue needed to provide
30 * one (!) network link through the USB gadget stack, normally "usb0".
38 * parameters; if no such parameters are provided, random link level
39 * addresses are used. Each end of the link uses one address. The
43 * The driver which assembles each configuration using such a link is
45 * instance of is network link. (The network layer provides ways for
46 * this single "physical" link to be used by multiple virtual links.)
145 /* don't change MTU on "live" link (peer won't know) */ ueth_change_mtu()
394 static int alloc_requests(struct eth_dev *dev, struct gether *link, unsigned n) alloc_requests() argument
399 status = prealloc(&dev->tx_reqs, link->in_ep, n); alloc_requests()
402 status = prealloc(&dev->rx_reqs, link->out_ep, n); alloc_requests()
640 struct gether *link; eth_open() local
647 link = dev->port_usb; eth_open()
648 if (link && link->open) eth_open()
649 link->open(link); eth_open()
671 struct gether *link = dev->port_usb; eth_stop() local
675 if (link->close) eth_stop()
676 link->close(link); eth_stop()
687 in = link->in_ep->desc; eth_stop()
688 out = link->out_ep->desc; eth_stop()
689 usb_ep_disable(link->in_ep); eth_stop()
690 usb_ep_disable(link->out_ep); eth_stop()
693 link->in_ep->desc = in; eth_stop()
694 link->out_ep->desc = out; eth_stop()
695 usb_ep_enable(link->in_ep); eth_stop()
696 usb_ep_enable(link->out_ep); eth_stop()
750 * gether_setup_name - initialize one ethernet-over-usb link
753 * host side of the link is recorded
757 * This sets up the single network link that may be exported by a
758 * gadget driver using this framework. The link layer addresses are
1025 * gether_connect - notify network layer that USB link is active
1026 * @link: the USB link, set up with endpoints, descriptors matching
1040 struct net_device *gether_connect(struct gether *link) gether_connect() argument
1042 struct eth_dev *dev = link->ioport; gether_connect()
1048 link->in_ep->driver_data = dev; gether_connect()
1049 result = usb_ep_enable(link->in_ep); gether_connect()
1052 link->in_ep->name, result); gether_connect()
1056 link->out_ep->driver_data = dev; gether_connect()
1057 result = usb_ep_enable(link->out_ep); gether_connect()
1060 link->out_ep->name, result); gether_connect()
1065 result = alloc_requests(dev, link, qlen(dev->gadget, gether_connect()
1069 dev->zlp = link->is_zlp_ok; gether_connect()
1072 dev->header_len = link->header_len; gether_connect()
1073 dev->unwrap = link->unwrap; gether_connect()
1074 dev->wrap = link->wrap; gether_connect()
1077 dev->port_usb = link; gether_connect()
1079 if (link->open) gether_connect()
1080 link->open(link); gether_connect()
1082 if (link->close) gether_connect()
1083 link->close(link); gether_connect()
1093 (void) usb_ep_disable(link->out_ep); gether_connect()
1095 (void) usb_ep_disable(link->in_ep); gether_connect()
1106 * gether_disconnect - notify network layer that USB link is inactive
1107 * @link: the USB link, on which gether_connect() was called
1117 void gether_disconnect(struct gether *link) gether_disconnect() argument
1119 struct eth_dev *dev = link->ioport; gether_disconnect()
1135 usb_ep_disable(link->in_ep); gether_disconnect()
1143 usb_ep_free_request(link->in_ep, req); gether_disconnect()
1147 link->in_ep->driver_data = NULL; gether_disconnect()
1148 link->in_ep->desc = NULL; gether_disconnect()
1150 usb_ep_disable(link->out_ep); gether_disconnect()
1158 usb_ep_free_request(link->out_ep, req); gether_disconnect()
1162 link->out_ep->driver_data = NULL; gether_disconnect()
1163 link->out_ep->desc = NULL; gether_disconnect()
1165 /* finish forgetting about this USB link episode */ gether_disconnect()
/linux-4.1.27/net/tipc/
H A Dlink.c2 * net/tipc/link.c: TIPC link code
39 #include "link.h"
52 static const char *link_rst_msg = "Resetting link ";
53 static const char *link_unk_evt = "Unknown link event ";
71 /* Properties valid for media, bearar and link */
80 * Out-of-range value for link session numbers
87 #define STARTING_EVT 856384768 /* link processing trigger */
89 #define TIMEOUT_EVT 560817u /* link timer expired */
96 static void link_handle_out_of_seq_msg(struct tipc_link *link,
98 static void tipc_link_proto_rcv(struct tipc_link *link,
110 * Simple link routines
140 * Simple non-static link routines (i.e. referenced outside this file)
156 * link_timeout - handle expiration of link timer
157 * @l_ptr: pointer to link
199 /* do all other link processing performed on a periodic basis */ link_timeout()
209 static void link_set_timer(struct tipc_link *link, unsigned long time) link_set_timer() argument
211 if (!mod_timer(&link->timer, jiffies + time)) link_set_timer()
212 tipc_link_get(link); link_set_timer()
216 * tipc_link_create - create a new link
219 * @media_addr: media address to use when sending messages over link
221 * Returns pointer to link.
236 pr_err("Attempt to establish %uth link to %s. Max %u allowed.\n", tipc_link_create()
243 pr_err("Attempt to establish second link on <%s> to %s\n", tipc_link_create()
299 * tipc_link_delete - Delete a link
300 * @l: link to be deleted
308 /* Delete link now, or when timer is finished: */ tipc_link_delete()
318 struct tipc_link *link; tipc_link_delete_list() local
324 link = node->links[bearer_id]; tipc_link_delete_list()
325 if (link) tipc_link_delete_list()
326 tipc_link_delete(link); tipc_link_delete_list()
334 * @link: congested link
339 static int link_schedule_user(struct tipc_link *link, struct sk_buff_head *list) link_schedule_user() argument
344 u32 addr = link_own_addr(link); link_schedule_user()
349 pr_warn("%s<%s>, send queue full", link_rst_msg, link->name); link_schedule_user()
350 tipc_link_reset(link); link_schedule_user()
364 skb_queue_tail(&link->wakeupq, skb); link_schedule_user()
365 link->stats.link_congs++; link_schedule_user()
374 * @link: congested link
376 * the send queue, from link wait queue to node wait queue for wakeup
398 * tipc_link_reset_fragments - purge link's inbound message fragments queue
399 * @l_ptr: pointer to link
418 * tipc_link_purge_queues - purge all pkt queues associated with link
419 * @l_ptr: pointer to link
496 static void link_activate(struct tipc_link *link) link_activate() argument
498 struct tipc_node *node = link->owner; link_activate()
500 link->next_in_no = 1; link_activate()
501 link->stats.recv_info = 1; link_activate()
502 tipc_node_link_up(node, link); link_activate()
503 tipc_bearer_add_dest(node->net, link->bearer_id, link->addr); link_activate()
507 * link_state_event - link finite state machine
508 * @l_ptr: pointer to link
685 pr_err("Unknown link state %u/%u\n", l_ptr->state, event); link_state_event()
691 * @link: link to use
699 int __tipc_link_xmit(struct net *net, struct tipc_link *link, __tipc_link_xmit() argument
703 unsigned int maxwin = link->window; __tipc_link_xmit()
705 uint mtu = link->mtu; __tipc_link_xmit()
706 uint ack = mod(link->next_in_no - 1); __tipc_link_xmit()
707 uint seqno = link->next_out_no; __tipc_link_xmit()
708 uint bc_last_in = link->owner->bclink.last_in; __tipc_link_xmit()
709 struct tipc_media_addr *addr = &link->media_addr; __tipc_link_xmit()
710 struct sk_buff_head *transmq = &link->transmq; __tipc_link_xmit()
711 struct sk_buff_head *backlogq = &link->backlogq; __tipc_link_xmit()
715 if (unlikely(link->backlog[imp].len >= link->backlog[imp].limit)) __tipc_link_xmit()
716 return link_schedule_user(link, list); __tipc_link_xmit()
732 tipc_bearer_send(net, link->bearer_id, skb, addr); skb_queue_walk_safe()
733 link->rcv_unacked = 0; skb_queue_walk_safe()
738 link->stats.sent_bundled++; skb_queue_walk_safe()
741 if (tipc_msg_make_bundle(&skb, mtu, link->addr)) { skb_queue_walk_safe()
742 link->stats.sent_bundled++; skb_queue_walk_safe()
743 link->stats.sent_bundles++; skb_queue_walk_safe()
747 link->backlog[imp].len++; skb_queue_walk_safe()
750 link->next_out_no = seqno;
760 static int __tipc_link_xmit_skb(struct tipc_link *link, struct sk_buff *skb) __tipc_link_xmit_skb() argument
765 return __tipc_link_xmit(link->owner->net, link, &head); __tipc_link_xmit_skb()
790 * tipc_link_xmit() is the general link level function for message sending
795 * @selector: a number used for deterministic link selection
802 struct tipc_link *link = NULL; tipc_link_xmit() local
809 link = node->active_links[selector & 1]; tipc_link_xmit()
810 if (link) tipc_link_xmit()
811 rc = __tipc_link_xmit(net, link, list); tipc_link_xmit()
815 if (link) tipc_link_xmit()
828 * tipc_link_sync_xmit - synchronize broadcast link endpoints.
835 static void tipc_link_sync_xmit(struct tipc_link *link) tipc_link_sync_xmit() argument
845 tipc_msg_init(link_own_addr(link), msg, BCAST_PROTOCOL, STATE_MSG, tipc_link_sync_xmit()
846 INT_H_SIZE, link->addr); tipc_link_sync_xmit()
847 msg_set_last_bcast(msg, link->owner->bclink.acked); tipc_link_sync_xmit()
848 __tipc_link_xmit_skb(link, skb); tipc_link_sync_xmit()
852 * tipc_link_sync_rcv - synchronize broadcast link endpoints.
871 * Push out the unsent messages of a link where congestion
876 void tipc_link_push_packets(struct tipc_link *link) tipc_link_push_packets() argument
880 unsigned int ack = mod(link->next_in_no - 1); tipc_link_push_packets()
882 while (skb_queue_len(&link->transmq) < link->window) { tipc_link_push_packets()
883 skb = __skb_dequeue(&link->backlogq); tipc_link_push_packets()
887 link->backlog[msg_importance(msg)].len--; tipc_link_push_packets()
889 msg_set_bcast_ack(msg, link->owner->bclink.last_in); tipc_link_push_packets()
890 link->rcv_unacked = 0; tipc_link_push_packets()
891 __skb_queue_tail(&link->transmq, skb); tipc_link_push_packets()
892 tipc_bearer_send(link->owner->net, link->bearer_id, tipc_link_push_packets()
893 skb, &link->media_addr); tipc_link_push_packets()
909 link_print(node->links[i], "Resetting link\n"); tipc_link_reset_all()
923 pr_warn("Retransmission failure on link <%s>\n", l_ptr->name); link_retransmit_failure()
926 /* Handle failure on standard link */ link_retransmit_failure()
927 link_print(l_ptr, "Resetting link\n"); link_retransmit_failure()
931 /* Handle failure on broadcast link */ link_retransmit_failure()
942 pr_info("Broadcast link info for %s\n", addr_string); link_retransmit_failure()
1016 static void link_retrieve_defq(struct tipc_link *link, link_retrieve_defq() argument
1021 if (skb_queue_empty(&link->deferdq)) link_retrieve_defq()
1024 seq_no = buf_seqno(skb_peek(&link->deferdq)); link_retrieve_defq()
1025 if (seq_no == mod(link->next_in_no)) link_retrieve_defq()
1026 skb_queue_splice_tail_init(&link->deferdq, list); link_retrieve_defq()
1057 /* Handle arrival of a non-unicast link message */ tipc_rcv()
1067 /* Discard unicast link messages destined for another node */ tipc_rcv()
1078 /* Locate unicast link endpoint that should handle message */ tipc_rcv()
1111 /* Try sending any messages link endpoint has pending */ tipc_rcv()
1127 /* Traffic message. Conditionally activate link */ tipc_rcv()
1146 /* Synchronize with parallel link if applicable */ tipc_rcv()
1174 static bool tipc_data_input(struct tipc_link *link, struct sk_buff *skb) tipc_data_input() argument
1176 struct tipc_node *node = link->owner; tipc_data_input()
1186 if (tipc_skb_queue_tail(&link->inputq, skb, dport)) { tipc_data_input()
1187 node->inputq = &link->inputq; tipc_data_input()
1193 node->namedq = &link->namedq; tipc_data_input()
1194 skb_queue_tail(&link->namedq, skb); tipc_data_input()
1195 if (skb_queue_len(&link->namedq) == 1) tipc_data_input()
1210 /* tipc_link_input - process packet that has passed link protocol check
1215 static void tipc_link_input(struct tipc_link *link, struct sk_buff *skb) tipc_link_input() argument
1217 struct tipc_node *node = link->owner; tipc_link_input()
1222 if (likely(tipc_data_input(link, skb))) tipc_link_input()
1228 link->flags |= LINK_SYNCHING; tipc_link_input()
1229 link->synch_point = msg_seqno(msg_get_wrapped(msg)); tipc_link_input()
1233 if (!tipc_link_failover_rcv(link, &skb)) tipc_link_input()
1236 tipc_data_input(link, skb); tipc_link_input()
1240 link->stats.recv_bundles++; tipc_link_input()
1241 link->stats.recv_bundled += msg_msgcnt(msg); tipc_link_input()
1244 tipc_data_input(link, iskb); tipc_link_input()
1247 link->stats.recv_fragments++; tipc_link_input()
1248 if (tipc_buf_append(&link->reasm_buf, &skb)) { tipc_link_input()
1249 link->stats.recv_fragmented++; tipc_link_input()
1250 tipc_data_input(link, skb); tipc_link_input()
1251 } else if (!link->reasm_buf) { tipc_link_input()
1252 tipc_link_reset(link); tipc_link_input()
1348 /* Don't send protocol message during link failover */ tipc_link_proto_xmit()
1455 /* Update link settings according other endpoint's values */ tipc_link_proto_rcv()
1468 /* Synchronize broadcast link info, if not done previously */ tipc_link_proto_rcv()
1535 /* tipc_link_tunnel_xmit(): Tunnel one packet via a link belonging to
1549 pr_warn("%stunnel link no longer available\n", link_co_err); tipc_link_tunnel_xmit()
1564 /* tipc_link_failover_send_queue(): A link has gone down, but a second
1565 * link is still active. We can do failover. Tunnel the failing link's
1566 * whole send queue via the remaining link. This way, we don't lose
1568 * sent over the remaining link. Owner node is locked.
1627 /* tipc_link_dup_queue_xmit(): A second link has become active. Tunnel a
1628 * duplicate of the first link's send queue via the new link. This way, we
1631 * new link. The last arriving copy of each duplicate packet is dropped at
1636 void tipc_link_dup_queue_xmit(struct tipc_link *link, tipc_link_dup_queue_xmit() argument
1641 struct sk_buff_head *queue = &link->transmq; tipc_link_dup_queue_xmit()
1644 tipc_msg_init(link_own_addr(link), &tnl_hdr, TUNNEL_PROTOCOL, tipc_link_dup_queue_xmit()
1645 SYNCH_MSG, INT_H_SIZE, link->addr); tipc_link_dup_queue_xmit()
1646 mcnt = skb_queue_len(&link->transmq) + skb_queue_len(&link->backlogq); tipc_link_dup_queue_xmit()
1648 msg_set_bearer_id(&tnl_hdr, link->peer_bearer_id); tipc_link_dup_queue_xmit()
1656 msg_set_ack(msg, mod(link->next_in_no - 1)); skb_queue_walk()
1657 msg_set_bcast_ack(msg, link->owner->bclink.last_in); skb_queue_walk()
1669 if (!tipc_link_is_up(link)) skb_queue_walk()
1672 if (queue == &link->backlogq)
1674 queue = &link->backlogq;
1681 static bool tipc_link_failover_rcv(struct tipc_link *link, tipc_link_failover_rcv() argument
1697 if (bearer_id == link->bearer_id) tipc_link_failover_rcv()
1700 pl = link->owner->links[bearer_id]; tipc_link_failover_rcv()
1704 if (link->failover_pkts == FIRST_FAILOVER) tipc_link_failover_rcv()
1705 link->failover_pkts = msg_msgcnt(msg); tipc_link_failover_rcv()
1708 if (!link->failover_pkts) tipc_link_failover_rcv()
1716 link->failover_pkts--; tipc_link_failover_rcv()
1720 if (less(buf_seqno(iskb), link->failover_checkpt)) { tipc_link_failover_rcv()
1726 link->stats.recv_fragments++; tipc_link_failover_rcv()
1727 tipc_buf_append(&link->failover_skb, &iskb); tipc_link_failover_rcv()
1730 if (!link->failover_pkts && pl) tipc_link_failover_rcv()
1761 /* tipc_link_find_owner - locate owner node of link by link's name
1763 * @name: pointer to link name string
1764 * @bearer_id: pointer to index in 'node->links' array where the link was found.
1766 * Returns pointer to node owning the link, or 0 if no matching link is found.
1800 * link_reset_statistics - reset link statistics
1801 * @l_ptr: pointer to link
1833 /* Parse and validate nested (link) properties valid for media, bearer and link
1877 struct tipc_link *link; tipc_nl_link_set() local
1902 link = node->links[bearer_id]; tipc_nl_link_set()
1903 if (!link) { tipc_nl_link_set()
1922 link_set_supervision_props(link, tol); tipc_nl_link_set()
1923 tipc_link_proto_xmit(link, STATE_MSG, 0, 0, tol, 0); tipc_nl_link_set()
1929 link->priority = prio; tipc_nl_link_set()
1930 tipc_link_proto_xmit(link, STATE_MSG, 0, 0, 0, prio); tipc_nl_link_set()
1936 tipc_link_set_queue_limits(link, win); tipc_nl_link_set()
2011 /* Caller should hold appropriate locks to protect the link */ __tipc_nl_add_link()
2013 struct tipc_link *link, int nlflags) __tipc_nl_add_link()
2030 if (nla_put_string(msg->skb, TIPC_NLA_LINK_NAME, link->name)) __tipc_nl_add_link()
2035 if (nla_put_u32(msg->skb, TIPC_NLA_LINK_MTU, link->mtu)) __tipc_nl_add_link()
2037 if (nla_put_u32(msg->skb, TIPC_NLA_LINK_RX, link->next_in_no)) __tipc_nl_add_link()
2039 if (nla_put_u32(msg->skb, TIPC_NLA_LINK_TX, link->next_out_no)) __tipc_nl_add_link()
2042 if (tipc_link_is_up(link)) __tipc_nl_add_link()
2045 if (tipc_link_is_active(link)) __tipc_nl_add_link()
2052 if (nla_put_u32(msg->skb, TIPC_NLA_PROP_PRIO, link->priority)) __tipc_nl_add_link()
2054 if (nla_put_u32(msg->skb, TIPC_NLA_PROP_TOL, link->tolerance)) __tipc_nl_add_link()
2057 link->window)) __tipc_nl_add_link()
2059 if (nla_put_u32(msg->skb, TIPC_NLA_PROP_PRIO, link->priority)) __tipc_nl_add_link()
2063 err = __tipc_nl_add_stats(msg->skb, &link->stats); __tipc_nl_add_link()
2180 struct tipc_link *link; tipc_nl_link_get() local
2203 link = node->links[bearer_id]; tipc_nl_link_get()
2204 if (!link) { tipc_nl_link_get()
2209 err = __tipc_nl_add_link(net, &msg, link, 0); tipc_nl_link_get()
2229 struct tipc_link *link; tipc_nl_link_reset_stats() local
2261 link = node->links[bearer_id]; tipc_nl_link_reset_stats()
2262 if (!link) { tipc_nl_link_reset_stats()
2267 link_reset_statistics(link); tipc_nl_link_reset_stats()
2012 __tipc_nl_add_link(struct net *net, struct tipc_nl_msg *msg, struct tipc_link *link, int nlflags) __tipc_nl_add_link() argument
H A Dlink.h2 * net/tipc/link.h: Include file for TIPC link code
46 #define ELINKCONG EAGAIN /* link congestion <=> resource unavailable */
48 /* Out-of-range value for link sequence numbers
102 * struct tipc_link - TIPC link data structure
103 * @addr: network address of link's peer node
104 * @name: link name character string
105 * @media_addr: media address to use when sending messages over link
106 * @timer: link timer
109 * @flags: execution state flags for link endpoint instance
110 * @checkpoint: reference point for triggering link continuity checking
111 * @peer_session: link session # being used by peer end of link
112 * @peer_bearer_id: bearer id used by link's peer endpoint
113 * @bearer_id: local bearer id used by link
114 * @tolerance: minimum link continuity loss needed to reset link [in ms]
115 * @cont_intv: link continuity testing interval
116 * @abort_limit: # of unacknowledged continuity probes needed to reset link
117 * @state: current state of link FSM
118 * @fsm_msg_cnt: # of protocol messages link FSM has sent in current state
119 * @proto_msg: template for control messages generated by link
121 * @priority: current link priority
122 * @net_plane: current link network plane ('A' through 'H')
124 * @exp_msg_count: # of tunnelled messages expected during link changeover
125 * @reset_checkpoint: seq # of last acknowledged message at time of link reset
126 * @mtu: current maximum packet size for this link
127 * @advertised_mtu: advertised own mtu when link is being established
139 * @wakeupq: linked list of wakeup msgs waiting for link congestion to abate
142 * @stats: collects statistics regarding link activity
152 /* Management and link supervision data */
215 void tipc_link_delete(struct tipc_link *link);
231 int __tipc_link_xmit(struct net *net, struct tipc_link *link,
H A Ddiscover.c38 #include "link.h"
51 * struct tipc_link_req - information about an ongoing link setup request
56 * @num_nodes: number of nodes currently discovered (i.e. with an active link)
75 * tipc_disc_init_msg - initialize a link setup message
128 struct tipc_link *link; tipc_disc_rcv() local
173 link = node->links[bearer->identity]; tipc_disc_rcv()
177 addr_match = link && !memcmp(&link->media_addr, &maddr, sizeof(maddr)); tipc_disc_rcv()
178 link_up = link && tipc_link_is_up(link); tipc_disc_rcv()
186 /* Respond. The link will come up in due time */ tipc_disc_rcv()
190 * If so, the link will reset soon, and the next tipc_disc_rcv()
195 * Ignore requests until the link goes down, if ever. tipc_disc_rcv()
199 /* Peer link has changed i/f address without rebooting. tipc_disc_rcv()
208 * - Delayed re-discovery; this link endpoint has already tipc_disc_rcv()
214 * reset the link, since there can be no working link tipc_disc_rcv()
215 * endpoint at the peer end, and the link will re-establish. tipc_disc_rcv()
227 * Ignore until the link goes down, if ever. tipc_disc_rcv()
243 if (!link) tipc_disc_rcv()
244 link = tipc_link_create(node, bearer, &maddr); tipc_disc_rcv()
245 if (link) { tipc_disc_rcv()
246 memcpy(&link->media_addr, &maddr, sizeof(maddr)); tipc_disc_rcv()
247 tipc_link_reset(link); tipc_disc_rcv()
267 * disc_update - update frequency of periodic link setup requests
268 * @req: ptr to link request structure
286 * @req: ptr to link request structure
297 * @req: ptr to link request structure
308 * disc_timeout - send a periodic link setup request
309 * @data: ptr to link request structure
311 * Called whenever a link setup request timer associated with a bearer expires.
350 * tipc_disc_create - create object to send periodic link setup requests
388 * tipc_disc_delete - destroy object sending periodic link setup requests
389 * @req: ptr to link request structure
399 * tipc_disc_reset - reset object to send periodic link setup requests
H A Dbcast.h41 #include "link.h"
45 * struct tipc_bcbearer_pair - a pair of bearers used by broadcast link
61 * struct tipc_bcbearer - bearer used by broadcast link
84 * struct tipc_bclink - link used for broadcast messages
86 * @link: (non-standard) broadcast link structure
87 * @node: (non-standard) node structure representing b'cast link's peer node
95 struct tipc_link link; member in struct:tipc_bclink
H A Dnode.c38 #include "link.h"
222 * tipc_node_link_up - handle addition of link
234 pr_debug("Established link <%s> on network plane %c\n", tipc_node_link_up()
243 pr_debug("New link <%s> becomes standby\n", l_ptr->name); tipc_node_link_up()
251 pr_debug("Old link <%s> becomes standby\n", active[0]->name); tipc_node_link_up()
253 pr_debug("Old link <%s> becomes standby\n", active[1]->name); tipc_node_link_up()
262 * node_select_active_links - select active link
289 * tipc_node_link_down - handle loss of link
301 pr_debug("Lost standby link <%s> on network plane %c\n", tipc_node_link_down()
305 pr_debug("Lost link <%s> on network plane %c\n", tipc_node_link_down()
326 /* Loopback link went down? No fragmentation needed from now on. */ tipc_node_link_down()
381 /* Flush broadcast link info associated with lost node */ node_lost_contact()
396 /* Abort any ongoing link failover */ node_lost_contact()
433 * tipc_node_get_linkname - get the name of a link
437 * @linkname: link name output buffer
444 struct tipc_link *link; tipc_node_get_linkname() local
455 link = node->links[bearer_id]; tipc_node_get_linkname()
456 if (link) { tipc_node_get_linkname()
457 strncpy(linkname, link->name, len); tipc_node_get_linkname()
/linux-4.1.27/drivers/ide/
H A Dide-cs.c73 static int ide_probe(struct pcmcia_device *link) ide_probe() argument
77 dev_dbg(&link->dev, "ide_attach()\n"); ide_probe()
84 info->p_dev = link; ide_probe()
85 link->priv = info; ide_probe()
87 link->config_flags |= CONF_ENABLE_IRQ | CONF_AUTO_SET_IO | ide_probe()
90 return ide_config(link); ide_probe()
93 static void ide_detach(struct pcmcia_device *link) ide_detach() argument
95 ide_info_t *info = link->priv; ide_detach()
97 dev_dbg(&link->dev, "ide_detach(0x%p)\n", link); ide_detach()
99 ide_release(link); ide_detach()
189 static int ide_config(struct pcmcia_device *link) ide_config() argument
191 ide_info_t *info = link->priv; ide_config()
196 dev_dbg(&link->dev, "ide_config(0x%p)\n", link); ide_config()
198 is_kme = ((link->manf_id == MANFID_KME) && ide_config()
199 ((link->card_id == PRODID_KME_KXLC005_A) || ide_config()
200 (link->card_id == PRODID_KME_KXLC005_B))); ide_config()
202 if (pcmcia_loop_config(link, pcmcia_check_one_config, &is_kme)) { ide_config()
203 link->config_flags &= ~CONF_AUTO_CHECK_VCC; ide_config()
204 if (pcmcia_loop_config(link, pcmcia_check_one_config, &is_kme)) ide_config()
207 io_base = link->resource[0]->start; ide_config()
208 if (link->resource[1]->end) ide_config()
209 ctl_base = link->resource[1]->start; ide_config()
211 ctl_base = link->resource[0]->start + 0x0e; ide_config()
213 if (!link->irq) ide_config()
216 ret = pcmcia_enable_device(link); ide_config()
227 host = idecs_register(io_base, ctl_base, link->irq, link); ide_config()
228 if (host == NULL && resource_size(link->resource[0]) == 0x20) { ide_config()
231 link->irq, link); ide_config()
239 dev_info(&link->dev, "ide-cs: hd%c: Vpp = %d.%d\n", ide_config()
241 link->vpp / 10, link->vpp % 10); ide_config()
246 ide_release(link); ide_config()
250 static void ide_release(struct pcmcia_device *link) ide_release() argument
252 ide_info_t *info = link->priv; ide_release()
255 dev_dbg(&link->dev, "ide_release(0x%p)\n", link); ide_release()
271 pcmcia_disable_device(link); ide_release()
/linux-4.1.27/fs/efs/
H A Dsymlink.c16 char *link = kmap(page); efs_symlink_readpage() local
26 /* read first 512 bytes of link target */ efs_symlink_readpage()
31 memcpy(link, bh->b_data, (size > EFS_BLOCKSIZE) ? EFS_BLOCKSIZE : size); efs_symlink_readpage()
37 memcpy(link + EFS_BLOCKSIZE, bh->b_data, size - EFS_BLOCKSIZE); efs_symlink_readpage()
40 link[size] = '\0'; efs_symlink_readpage()
/linux-4.1.27/drivers/media/platform/xilinx/
H A Dxilinx-vipp.c77 struct v4l2_of_link link; xvip_graph_build_one() local
85 /* Get the next endpoint and parse its link. */ xvip_graph_build_one()
95 ret = v4l2_of_parse_link(ep, &link); xvip_graph_build_one()
97 dev_err(xdev->dev, "failed to parse link for %s\n", xvip_graph_build_one()
103 * the link. xvip_graph_build_one()
105 if (link.local_port >= local->num_pads) { xvip_graph_build_one()
107 link.local_port, link.local_node->full_name); xvip_graph_build_one()
108 v4l2_of_put_link(&link); xvip_graph_build_one()
113 local_pad = &local->pads[link.local_port]; xvip_graph_build_one()
117 link.local_node->full_name, link.local_port); xvip_graph_build_one()
118 v4l2_of_put_link(&link); xvip_graph_build_one()
123 if (link.remote_node == xdev->dev->of_node) { xvip_graph_build_one()
125 link.local_node->full_name, link.local_port); xvip_graph_build_one()
126 v4l2_of_put_link(&link); xvip_graph_build_one()
131 ent = xvip_graph_find_entity(xdev, link.remote_node); xvip_graph_build_one()
134 link.remote_node->full_name); xvip_graph_build_one()
135 v4l2_of_put_link(&link); xvip_graph_build_one()
142 if (link.remote_port >= remote->num_pads) { xvip_graph_build_one()
144 link.remote_port, link.remote_node->full_name); xvip_graph_build_one()
145 v4l2_of_put_link(&link); xvip_graph_build_one()
150 remote_pad = &remote->pads[link.remote_port]; xvip_graph_build_one()
152 v4l2_of_put_link(&link); xvip_graph_build_one()
154 /* Create the media link. */ xvip_graph_build_one()
155 dev_dbg(xdev->dev, "creating %s:%u -> %s:%u link\n", xvip_graph_build_one()
164 "failed to create %s:%u -> %s:%u link\n", xvip_graph_build_one()
197 struct v4l2_of_link link; xvip_graph_build_dma() local
206 /* Get the next endpoint and parse its link. */ xvip_graph_build_dma()
216 ret = v4l2_of_parse_link(ep, &link); xvip_graph_build_dma()
218 dev_err(xdev->dev, "failed to parse link for %s\n", xvip_graph_build_dma()
224 dma = xvip_graph_find_dma(xdev, link.local_port); xvip_graph_build_dma()
227 link.local_port); xvip_graph_build_dma()
228 v4l2_of_put_link(&link); xvip_graph_build_dma()
233 dev_dbg(xdev->dev, "creating link for DMA engine %s\n", xvip_graph_build_dma()
237 ent = xvip_graph_find_entity(xdev, link.remote_node); xvip_graph_build_dma()
240 link.remote_node->full_name); xvip_graph_build_dma()
241 v4l2_of_put_link(&link); xvip_graph_build_dma()
246 if (link.remote_port >= ent->entity->num_pads) { xvip_graph_build_dma()
248 link.remote_port, link.remote_node->full_name); xvip_graph_build_dma()
249 v4l2_of_put_link(&link); xvip_graph_build_dma()
258 sink_pad = &sink->pads[link.remote_port]; xvip_graph_build_dma()
261 source_pad = &source->pads[link.remote_port]; xvip_graph_build_dma()
266 v4l2_of_put_link(&link); xvip_graph_build_dma()
268 /* Create the media link. */ xvip_graph_build_dma()
269 dev_dbg(xdev->dev, "creating %s:%u -> %s:%u link\n", xvip_graph_build_dma()
278 "failed to create %s:%u -> %s:%u link\n", xvip_graph_build_dma()
/linux-4.1.27/include/linux/
H A Dsmc91x.h19 #define RPC_LED_100_10 (0x00) /* LED = 100Mbps OR's with 10Mbps link detect */
21 #define RPC_LED_10 (0x02) /* LED = 10Mbps link detect */
24 #define RPC_LED_100 (0x05) /* LED = 100Mbps link detect */
H A Dlibata.h203 ATA_LFLAG_NO_RETRY = (1 << 5), /* don't retry this link */
204 ATA_LFLAG_DISABLED = (1 << 6), /* link is disabled */
206 ATA_LFLAG_NO_LPM = (1 << 8), /* disable LPM on this link */
208 ATA_LFLAG_CHANGED = (1 << 10), /* LPM state changed on this link */
386 /* mask of flags to transfer *to* the slave link */
392 /* sometimes resuming a link requires several retries */
538 typedef int (*ata_prereset_fn_t)(struct ata_link *link, unsigned long deadline);
539 typedef int (*ata_reset_fn_t)(struct ata_link *link, unsigned int *classes,
541 typedef void (*ata_postreset_fn_t)(struct ata_link *link, unsigned int *classes);
677 struct ata_link *link; member in struct:ata_device
784 unsigned int active_tag; /* active tag on this link */
824 struct ata_link* sff_pio_task_link; /* link currently used */
843 struct ata_link link; /* host default link */ member in struct:ata_port
907 int (*set_mode)(struct ata_link *link, struct ata_device **r_failed_dev);
931 int (*scr_read)(struct ata_link *link, unsigned int sc_reg, u32 *val);
932 int (*scr_write)(struct ata_link *link, unsigned int sc_reg, u32 val);
935 int (*set_lpm)(struct ata_link *link, enum ata_lpm_policy policy,
1106 extern int sata_set_spd(struct ata_link *link);
1107 extern int ata_std_prereset(struct ata_link *link, unsigned long deadline);
1108 extern int ata_wait_after_reset(struct ata_link *link, unsigned long deadline,
1109 int (*check_ready)(struct ata_link *link));
1110 extern int sata_link_debounce(struct ata_link *link,
1112 extern int sata_link_resume(struct ata_link *link, const unsigned long *params,
1114 extern int sata_link_scr_lpm(struct ata_link *link, enum ata_lpm_policy policy,
1116 extern int sata_link_hardreset(struct ata_link *link,
1119 extern int sata_std_hardreset(struct ata_link *link, unsigned int *class,
1121 extern void ata_std_postreset(struct ata_link *link, unsigned int *classes);
1150 extern int sata_scr_valid(struct ata_link *link);
1151 extern int sata_scr_read(struct ata_link *link, int reg, u32 *val);
1152 extern int sata_scr_write(struct ata_link *link, int reg, u32 val);
1153 extern int sata_scr_write_flush(struct ata_link *link, int reg, u32 val);
1154 extern bool ata_link_online(struct ata_link *link);
1155 extern bool ata_link_offline(struct ata_link *link);
1213 extern int ata_do_set_mode(struct ata_link *link, struct ata_device **r_failed_dev);
1216 extern bool sata_lpm_ignore_phy_events(struct ata_link *link);
1311 extern int ata_link_abort(struct ata_link *link);
1321 extern void ata_eh_analyze_ncq_error(struct ata_link *link);
1329 extern int ata_link_nr_enabled(struct ata_link *link);
1398 static inline int ata_is_host_link(const struct ata_link *link) ata_is_host_link() argument
1400 return link == &link->ap->link || link == link->ap->slave_link; ata_is_host_link()
1413 static inline int ata_is_host_link(const struct ata_link *link) ata_is_host_link() argument
1419 static inline int sata_srst_pmp(struct ata_link *link) sata_srst_pmp() argument
1421 if (sata_pmp_supported(link->ap) && ata_is_host_link(link)) sata_srst_pmp()
1423 return link->pmp; sata_srst_pmp()
1433 void ata_link_printk(const struct ata_link *link, const char *level,
1450 #define ata_link_err(link, fmt, ...) \
1451 ata_link_printk(link, KERN_ERR, fmt, ##__VA_ARGS__)
1452 #define ata_link_warn(link, fmt, ...) \
1453 ata_link_printk(link, KERN_WARNING, fmt, ##__VA_ARGS__)
1454 #define ata_link_notice(link, fmt, ...) \
1455 ata_link_printk(link, KERN_NOTICE, fmt, ##__VA_ARGS__)
1456 #define ata_link_info(link, fmt, ...) \
1457 ata_link_printk(link, KERN_INFO, fmt, ##__VA_ARGS__)
1458 #define ata_link_dbg(link, fmt, ...) \
1459 ata_link_printk(link, KERN_DEBUG, fmt, ##__VA_ARGS__)
1548 * link helpers
1550 static inline int ata_link_max_devices(const struct ata_link *link) ata_link_max_devices() argument
1552 if (ata_is_host_link(link) && link->ap->flags & ATA_FLAG_SLAVE_POSS) ata_link_max_devices()
1557 static inline int ata_link_active(struct ata_link *link) ata_link_active() argument
1559 return ata_tag_valid(link->active_tag) || link->sactive; ata_link_active()
1565 * ATA_LITER_* constants are used to select link iteration mode and
1568 * For a custom iteration directly using ata_{link|dev}_next(), if
1569 * @link or @dev, respectively, is NULL, the first element is
1570 * returned. @dev and @link can be any valid device or link and the
1576 * host link. no slave link */
1577 ATA_LITER_HOST_FIRST, /* host link followed by PMP or slave links */
1578 ATA_LITER_PMP_FIRST, /* PMP links followed by host link,
1579 * slave link still comes after host link */
1589 extern struct ata_link *ata_link_next(struct ata_link *link,
1594 struct ata_link *link,
1600 * ata_for_each_link() iterates over each link of @ap according to
1601 * @mode. @link points to the current link in the loop. @link is
1603 * except that it iterates over each device of @link.
1611 #define ata_for_each_link(link, ap, mode) \
1612 for ((link) = ata_link_next(NULL, (ap), ATA_LITER_##mode); (link); \
1613 (link) = ata_link_next((link), (ap), ATA_LITER_##mode))
1615 #define ata_for_each_dev(dev, link, mode) \
1616 for ((dev) = ata_dev_next(NULL, (link), ATA_DITER_##mode); (dev); \
1617 (dev) = ata_dev_next((dev), (link), ATA_DITER_##mode))
1680 tf->ctl = dev->link->ap->ctl; ata_tf_init()
1818 extern int ata_sff_wait_ready(struct ata_link *link, unsigned long deadline);
1836 extern void ata_sff_queue_pio_task(struct ata_link *link, unsigned long delay);
1845 extern int ata_sff_prereset(struct ata_link *link, unsigned long deadline);
1848 extern int ata_sff_wait_after_reset(struct ata_link *link, unsigned int devmask,
1850 extern int ata_sff_softreset(struct ata_link *link, unsigned int *classes,
1852 extern int sata_sff_hardreset(struct ata_link *link, unsigned int *class,
1854 extern void ata_sff_postreset(struct ata_link *link, unsigned int *classes);
H A Duser-return-notifier.h11 struct hlist_node link; member in struct:user_return_notifier
/linux-4.1.27/drivers/net/ethernet/fujitsu/
H A Dfmvj18x_cs.c78 static int fmvj18x_config(struct pcmcia_device *link);
79 static int fmvj18x_get_hwinfo(struct pcmcia_device *link, u_char *node_id);
80 static int fmvj18x_setup_mfc(struct pcmcia_device *link);
81 static void fmvj18x_release(struct pcmcia_device *link);
233 static int fmvj18x_probe(struct pcmcia_device *link) fmvj18x_probe() argument
238 dev_dbg(&link->dev, "fmvj18x_attach()\n"); fmvj18x_probe()
245 link->priv = dev; fmvj18x_probe()
246 lp->p_dev = link; fmvj18x_probe()
250 link->resource[0]->end = 32; fmvj18x_probe()
251 link->resource[0]->flags |= IO_DATA_PATH_WIDTH_AUTO; fmvj18x_probe()
254 link->config_flags |= CONF_ENABLE_IRQ; fmvj18x_probe()
261 return fmvj18x_config(link); fmvj18x_probe()
266 static void fmvj18x_detach(struct pcmcia_device *link) fmvj18x_detach() argument
268 struct net_device *dev = link->priv; fmvj18x_detach()
270 dev_dbg(&link->dev, "fmvj18x_detach\n"); fmvj18x_detach()
274 fmvj18x_release(link); fmvj18x_detach()
281 static int mfc_try_io_port(struct pcmcia_device *link) mfc_try_io_port() argument
288 link->resource[1]->start = serial_base[i]; mfc_try_io_port()
289 link->resource[1]->flags |= IO_DATA_PATH_WIDTH_8; mfc_try_io_port()
290 if (link->resource[1]->start == 0) { mfc_try_io_port()
291 link->resource[1]->end = 0; mfc_try_io_port()
294 ret = pcmcia_request_io(link); mfc_try_io_port()
301 static int ungermann_try_io_port(struct pcmcia_device *link) ungermann_try_io_port() argument
310 link->resource[0]->start = ioaddr; ungermann_try_io_port()
311 ret = pcmcia_request_io(link); ungermann_try_io_port()
314 link->config_index = ungermann_try_io_port()
315 ((link->resource[0]->start & 0x0f0) >> 3) | 0x22; ungermann_try_io_port()
327 static int fmvj18x_config(struct pcmcia_device *link) fmvj18x_config() argument
329 struct net_device *dev = link->priv; fmvj18x_config()
339 dev_dbg(&link->dev, "fmvj18x_config\n"); fmvj18x_config()
341 link->io_lines = 5; fmvj18x_config()
343 len = pcmcia_get_tuple(link, CISTPL_FUNCE, &buf); fmvj18x_config()
348 ret = pcmcia_loop_config(link, fmvj18x_ioprobe, NULL); fmvj18x_config()
352 switch (link->manf_id) { fmvj18x_config()
355 if (link->card_id == PRODID_TDK_GN3410 || fmvj18x_config()
356 link->card_id == PRODID_TDK_NP9610 || fmvj18x_config()
357 link->card_id == PRODID_TDK_MN3200) { fmvj18x_config()
359 link->config_base = 0x800; fmvj18x_config()
360 link->config_index = 0x47; fmvj18x_config()
361 link->resource[1]->end = 8; fmvj18x_config()
366 link->config_base = 0x800; fmvj18x_config()
367 link->config_index = 0x47; fmvj18x_config()
368 link->resource[1]->end = 8; fmvj18x_config()
372 link->config_base = 0x800; fmvj18x_config()
373 link->config_index = 0x47; fmvj18x_config()
374 link->resource[1]->end = 8; fmvj18x_config()
380 if (link->config_base == 0x0fe0) fmvj18x_config()
382 else if (link->card_id == PRODID_FUJITSU_MBH10302) fmvj18x_config()
386 else if (link->card_id == PRODID_FUJITSU_MBH10304) fmvj18x_config()
396 switch (link->manf_id) { fmvj18x_config()
398 if (link->card_id == PRODID_FUJITSU_MBH10304) { fmvj18x_config()
400 link->config_index = 0x20; fmvj18x_config()
403 link->config_index = 1; fmvj18x_config()
411 link->config_index = 1; fmvj18x_config()
415 if (link->resource[1]->end != 0) { fmvj18x_config()
416 ret = mfc_try_io_port(link); fmvj18x_config()
419 ret = ungermann_try_io_port(link); fmvj18x_config()
422 ret = pcmcia_request_io(link); fmvj18x_config()
426 ret = pcmcia_request_irq(link, fjn_interrupt); fmvj18x_config()
429 ret = pcmcia_enable_device(link); fmvj18x_config()
433 dev->irq = link->irq; fmvj18x_config()
434 dev->base_addr = link->resource[0]->start; fmvj18x_config()
436 if (resource_size(link->resource[1]) != 0) { fmvj18x_config()
437 ret = fmvj18x_setup_mfc(link); fmvj18x_config()
466 len = pcmcia_get_tuple(link, CISTPL_FUNCE, &buf); fmvj18x_config()
476 if (pcmcia_get_mac_from_cis(link, dev)) fmvj18x_config()
499 if (fmvj18x_get_hwinfo(link, buggybuf) == -1) { fmvj18x_config()
518 SET_NETDEV_DEV(dev, &link->dev); fmvj18x_config()
533 fmvj18x_release(link); fmvj18x_config()
538 static int fmvj18x_get_hwinfo(struct pcmcia_device *link, u_char *node_id) fmvj18x_get_hwinfo() argument
544 link->resource[2]->flags |= WIN_DATA_WIDTH_8|WIN_MEMORY_TYPE_AM|WIN_ENABLE; fmvj18x_get_hwinfo()
545 link->resource[2]->start = 0; link->resource[2]->end = 0; fmvj18x_get_hwinfo()
546 i = pcmcia_request_window(link, link->resource[2], 0); fmvj18x_get_hwinfo()
550 base = ioremap(link->resource[2]->start, resource_size(link->resource[2])); fmvj18x_get_hwinfo()
551 pcmcia_map_mem_page(link, link->resource[2], 0); fmvj18x_get_hwinfo()
576 j = pcmcia_release_window(link, link->resource[2]); fmvj18x_get_hwinfo()
582 static int fmvj18x_setup_mfc(struct pcmcia_device *link) fmvj18x_setup_mfc() argument
585 struct net_device *dev = link->priv; fmvj18x_setup_mfc()
590 link->resource[3]->flags = WIN_DATA_WIDTH_8|WIN_MEMORY_TYPE_AM|WIN_ENABLE; fmvj18x_setup_mfc()
591 link->resource[3]->start = link->resource[3]->end = 0; fmvj18x_setup_mfc()
592 i = pcmcia_request_window(link, link->resource[3], 0); fmvj18x_setup_mfc()
596 lp->base = ioremap(link->resource[3]->start, fmvj18x_setup_mfc()
597 resource_size(link->resource[3])); fmvj18x_setup_mfc()
603 i = pcmcia_map_mem_page(link, link->resource[3], 0); fmvj18x_setup_mfc()
625 static void fmvj18x_release(struct pcmcia_device *link) fmvj18x_release() argument
628 struct net_device *dev = link->priv; fmvj18x_release()
632 dev_dbg(&link->dev, "fmvj18x_release\n"); fmvj18x_release()
640 pcmcia_disable_device(link); fmvj18x_release()
644 static int fmvj18x_suspend(struct pcmcia_device *link) fmvj18x_suspend() argument
646 struct net_device *dev = link->priv; fmvj18x_suspend()
648 if (link->open) fmvj18x_suspend()
654 static int fmvj18x_resume(struct pcmcia_device *link) fmvj18x_resume() argument
656 struct net_device *dev = link->priv; fmvj18x_resume()
658 if (link->open) { fmvj18x_resume()
1062 struct pcmcia_device *link = lp->p_dev; fjn_open() local
1066 if (!pcmcia_dev_present(link)) fjn_open()
1069 link->open++; fjn_open()
1087 struct pcmcia_device *link = lp->p_dev; fjn_close() local
1110 link->open--; fjn_close()
/linux-4.1.27/drivers/staging/comedi/
H A Dcomedi_pcmcia.c34 static int comedi_pcmcia_conf_check(struct pcmcia_device *link, comedi_pcmcia_conf_check() argument
37 if (link->config_index == 0) comedi_pcmcia_conf_check()
40 return pcmcia_request_io(link); comedi_pcmcia_conf_check()
48 * The comedi PCMCIA driver needs to set the link->config_flags, as
55 struct pcmcia_device *link = comedi_to_pcmcia_dev(dev); comedi_pcmcia_enable() local
58 if (!link) comedi_pcmcia_enable()
64 ret = pcmcia_loop_config(link, conf_check, NULL); comedi_pcmcia_enable()
68 return pcmcia_enable_device(link); comedi_pcmcia_enable()
78 struct pcmcia_device *link = comedi_to_pcmcia_dev(dev); comedi_pcmcia_disable() local
80 if (link) comedi_pcmcia_disable()
81 pcmcia_disable_device(link); comedi_pcmcia_disable()
87 * @link: pcmcia_device struct
92 int comedi_pcmcia_auto_config(struct pcmcia_device *link, comedi_pcmcia_auto_config() argument
95 return comedi_auto_config(&link->dev, driver, 0); comedi_pcmcia_auto_config()
101 * @link: pcmcia_device struct
105 void comedi_pcmcia_auto_unconfig(struct pcmcia_device *link) comedi_pcmcia_auto_unconfig() argument
107 comedi_auto_unconfig(&link->dev); comedi_pcmcia_auto_unconfig()
/linux-4.1.27/Documentation/DocBook/media/
H A DMakefile175 -e "s/\(enum *\)v4l2_mpeg_cx2341x_video_\([a-z]*_spatial_filter_type\)/\1<link linkend=\"\2\">v4l2_mpeg_cx2341x_video_\2<\/link>/g" \
176 -e "s/\(\(enum\|struct\) *\)\(v4l2_[a-zA-Z0-9_]*\)/\1<link linkend=\"\3\">\3<\/link>/g" \
177 -e "s/\(V4L2_PIX_FMT_[A-Z0-9_]\+\)\(\s\+v4l2_fourcc\)/<link linkend=\"\1\">\1<\/link>\2/g" \
183 -e "s,\(struct\s\+\)\([a-z0-9_]\+\)\(\s\+{\),\1\<link linkend=\"\2\">\2\<\/link\>\3,g" \
184 -e "s,\(}\s\+\)\([a-z0-9_]\+_t\+\),\1\<link linkend=\"\2\">\2\<\/link\>,g" \
185 -e "s,\(define\s\+\)\(DTV_[A-Z0-9_]\+\)\(\s\+[0-9]\+\),\1\<link linkend=\"\2\">\2\<\/link\>\3,g" \
186 -e "s,<link\s\+linkend=\".*\">\(DTV_IOCTL_MAX_MSGS\|dtv_cmds_h\|__.*_old\)<\/link>,\1,g" \
190 -e "s,\(define\s\+\)\([A-Z0-9_]\+\)\(\s\+_IO\),\1\<link linkend=\"\2\">\2\<\/link\>\3,g" \
191 -e "s,<link\s\+linkend=\".*\">\(__.*_OLD\)<\/link>,\1,g" \
294 echo "<!ENTITY func-$$entity \"<link" \
295 "linkend='func-$$entity'><function>$$ident()</function></link>\">" \
304 echo "<!ENTITY $$entity \"<link" \
305 "linkend='$$id'><constant>$$ident</constant></link>\">" \
313 echo "<!ENTITY $$entity \"<link" \
314 "linkend='$$entity'>$$ident</link>\">" >>$@ ; \
321 echo "<!ENTITY $$entity \"enum&nbsp;<link" \
322 "linkend='$$entity'>$$ident</link>\">" >>$@ ; \
329 echo "<!ENTITY $$entity \"struct&nbsp;<link" \
330 "linkend='$$entity'>$$ident</link>\">" >>$@ ; \
371 echo "<indexentry><primaryie><link" \
372 "linkend='$$id'>$$ident</link></primaryie></indexentry>" >>$@ ; \
377 echo "<indexentry><primaryie>enum&nbsp;<link" \
378 "linkend='$$id'>$$ident</link></primaryie></indexentry>" >>$@ ; \
383 echo "<indexentry><primaryie>struct&nbsp;<link" \
384 "linkend='$$id'>$$ident</link></primaryie></indexentry>" >>$@ ; \
/linux-4.1.27/drivers/net/wireless/hostap/
H A Dhostap_cs.c39 struct pcmcia_device *link; member in struct:hostap_cs_priv
201 static int prism2_config(struct pcmcia_device *link);
207 if (hw_priv != NULL && hw_priv->link != NULL && pcmcia_dev_present(hw_priv->link)) prism2_pccard_card_present()
227 res = pcmcia_write_config_byte(hw_priv->link, 0x10, sandisk_set_iobase()
228 hw_priv->link->resource[0]->start & 0x00ff); sandisk_set_iobase()
235 res = pcmcia_write_config_byte(hw_priv->link, 0x12, sandisk_set_iobase()
236 (hw_priv->link->resource[0]->start >> 8) & 0x00ff); sandisk_set_iobase()
266 if (resource_size(hw_priv->link->resource[0]) < 0x42) { sandisk_enable_wireless()
272 if (hw_priv->link->manf_id != 0xd601 || hw_priv->link->card_id != 0x0101) { sandisk_enable_wireless()
278 if (hw_priv->link->socket->functions < 2) { sandisk_enable_wireless()
288 res = pcmcia_write_config_byte(hw_priv->link, CISREG_COR, sandisk_enable_wireless()
301 res = pcmcia_write_config_byte(hw_priv->link, CISREG_COR, sandisk_enable_wireless()
332 res = pcmcia_read_config_byte(hw_priv->link, CISREG_COR, &val); prism2_pccard_cor_sreset()
342 res = pcmcia_write_config_byte(hw_priv->link, CISREG_COR, val); prism2_pccard_cor_sreset()
354 res = pcmcia_write_config_byte(hw_priv->link, CISREG_COR, val); prism2_pccard_cor_sreset()
382 res = pcmcia_read_config_byte(hw_priv->link, CISREG_COR, &old_cor); prism2_pccard_genesis_reset()
389 res = pcmcia_write_config_byte(hw_priv->link, CISREG_COR, prism2_pccard_genesis_reset()
399 res = pcmcia_write_config_byte(hw_priv->link, CISREG_CCSR, hcr); prism2_pccard_genesis_reset()
406 res = pcmcia_write_config_byte(hw_priv->link, CISREG_COR, prism2_pccard_genesis_reset()
443 static void prism2_detach(struct pcmcia_device *link) prism2_detach() argument
447 prism2_release((u_long)link); prism2_detach()
450 if (link->priv) { prism2_detach()
454 dev = link->priv; prism2_detach()
471 static int prism2_config(struct pcmcia_device *link) prism2_config() argument
489 link->config_flags |= CONF_AUTO_SET_VPP | CONF_AUTO_AUDIO | prism2_config()
492 link->config_flags &= ~CONF_AUTO_CHECK_VCC; prism2_config()
493 ret = pcmcia_loop_config(link, prism2_config_check, NULL); prism2_config()
504 &link->dev); prism2_config()
507 link->priv = dev; prism2_config()
512 hw_priv->link = link; prism2_config()
519 ret = pcmcia_request_irq(link, prism2_interrupt); prism2_config()
523 ret = pcmcia_enable_device(link); prism2_config()
528 dev->irq = link->irq; prism2_config()
529 dev->base_addr = link->resource[0]->start; prism2_config()
544 prism2_release((u_long)link); prism2_config()
551 struct pcmcia_device *link = (struct pcmcia_device *)arg; prism2_release() local
555 if (link->priv) { prism2_release()
556 struct net_device *dev = link->priv; prism2_release()
564 pcmcia_disable_device(link); prism2_release()
568 static int hostap_cs_suspend(struct pcmcia_device *link) hostap_cs_suspend() argument
570 struct net_device *dev = (struct net_device *) link->priv; hostap_cs_suspend()
591 static int hostap_cs_resume(struct pcmcia_device *link) hostap_cs_resume() argument
593 struct net_device *dev = (struct net_device *) link->priv; hostap_cs_resume()
/linux-4.1.27/drivers/isdn/hardware/eicon/
H A Dadapter.h9 struct list_head link; member in struct:_diva_um_idi_adapter
H A Dentity.h13 struct list_head link; member in struct:_divas_um_idi_entity
/linux-4.1.27/arch/x86/pci/
H A Dbus_numa.h18 int link; member in struct:pci_root_info
23 int node, int link);
H A Damd_bus.c41 static struct pci_root_info __init *find_pci_root_info(int node, int link) find_pci_root_info() argument
47 if (info->node == node && info->link == link) find_pci_root_info()
65 int link; early_root_info_init() local
125 link = (reg >> 8) & 0x03; early_root_info_init()
127 info = alloc_pci_root_info(min_bus, max_bus, node, link); early_root_info_init()
141 /* get the default node and link for left over res */ early_root_info_init()
158 link = (reg >> 4) & 0x03; early_root_info_init()
161 info = find_pci_root_info(node, link); early_root_info_init()
165 printk(KERN_DEBUG "node %d link %d: io port [%llx, %llx]\n", early_root_info_init()
166 node, link, start, end); early_root_info_init()
174 /* add left over io port range to def node/link, [0, 0xffff] */ early_root_info_init()
225 link = (reg >> 4) & 0x03; early_root_info_init()
230 info = find_pci_root_info(node, link); early_root_info_init()
235 printk(KERN_DEBUG "node %d link %d: mmio [%llx, %llx]", early_root_info_init()
236 node, link, start, end); early_root_info_init()
298 * add left over mmio range to def node/link ? early_root_info_init()
318 printk(KERN_DEBUG "bus: %pR on node %x link %x\n", early_root_info_init()
319 &info->busn, info->node, info->link); early_root_info_init()
/linux-4.1.27/drivers/tty/serial/8250/
H A Dserial_cs.c107 static void quirk_setup_brainboxes_0104(struct pcmcia_device *link, struct uart_8250_port *uart) quirk_setup_brainboxes_0104() argument
112 static int quirk_post_ibm(struct pcmcia_device *link) quirk_post_ibm() argument
117 ret = pcmcia_read_config_byte(link, 0x800, &val); quirk_post_ibm()
121 ret = pcmcia_write_config_byte(link, 0x800, val | 1); quirk_post_ibm()
134 static void quirk_config_nokia(struct pcmcia_device *link) quirk_config_nokia() argument
136 struct serial_info *info = link->priv; quirk_config_nokia()
142 static void quirk_wakeup_oxsemi(struct pcmcia_device *link) quirk_wakeup_oxsemi() argument
144 struct serial_info *info = link->priv; quirk_wakeup_oxsemi()
156 static void quirk_wakeup_possio_gcc(struct pcmcia_device *link) quirk_wakeup_possio_gcc() argument
158 struct serial_info *info = link->priv; quirk_wakeup_possio_gcc()
179 static void quirk_config_socket(struct pcmcia_device *link) quirk_config_socket() argument
181 struct serial_info *info = link->priv; quirk_config_socket()
184 link->config_flags |= CONF_ENABLE_ESR; quirk_config_socket()
260 static int serial_config(struct pcmcia_device * link);
263 static void serial_remove(struct pcmcia_device *link) serial_remove() argument
265 struct serial_info *info = link->priv; serial_remove()
268 dev_dbg(&link->dev, "serial_release\n"); serial_remove()
277 pcmcia_disable_device(link); serial_remove()
280 static int serial_suspend(struct pcmcia_device *link) serial_suspend() argument
282 struct serial_info *info = link->priv; serial_suspend()
291 static int serial_resume(struct pcmcia_device *link) serial_resume() argument
293 struct serial_info *info = link->priv; serial_resume()
300 info->quirk->wakeup(link); serial_resume()
305 static int serial_probe(struct pcmcia_device *link) serial_probe() argument
309 dev_dbg(&link->dev, "serial_attach()\n"); serial_probe()
315 info->p_dev = link; serial_probe()
316 link->priv = info; serial_probe()
318 link->config_flags |= CONF_ENABLE_IRQ | CONF_AUTO_SET_IO; serial_probe()
320 link->config_flags |= CONF_ENABLE_SPKR; serial_probe()
322 return serial_config(link); serial_probe()
325 static void serial_detach(struct pcmcia_device *link) serial_detach() argument
327 struct serial_info *info = link->priv; serial_detach()
329 dev_dbg(&link->dev, "serial_detach\n"); serial_detach()
334 serial_remove(link); serial_detach()
439 static int simple_config(struct pcmcia_device *link) simple_config() argument
441 struct serial_info *info = link->priv; simple_config()
446 link->config_flags |= CONF_AUTO_SET_VPP; simple_config()
448 if (!pcmcia_loop_config(link, simple_config_check, &try)) simple_config()
454 if (!pcmcia_loop_config(link, simple_config_check_notpicky, NULL)) simple_config()
457 dev_warn(&link->dev, "no usable port range found, giving up\n"); simple_config()
462 link->config_index &= ~(0x08); simple_config()
468 info->quirk->config(link); simple_config()
470 i = pcmcia_enable_device(link); simple_config()
473 return setup_serial(link, info, link->resource[0]->start, link->irq); simple_config()
517 static int multi_config(struct pcmcia_device *link) multi_config() argument
519 struct serial_info *info = link->priv; multi_config()
523 if (!pcmcia_loop_config(link, multi_config_check, &info->multi)) multi_config()
524 base2 = link->resource[0]->start + 8; multi_config()
528 if (pcmcia_loop_config(link, multi_config_check_notpicky, multi_config()
530 dev_warn(&link->dev, "no usable port range " multi_config()
536 if (!link->irq) multi_config()
537 dev_warn(&link->dev, "no usable IRQ found, continuing...\n"); multi_config()
543 info->quirk->config(link); multi_config()
545 i = pcmcia_enable_device(link); multi_config()
557 if (link->config_index == 1 || multi_config()
558 link->config_index == 3) { multi_config()
559 err = setup_serial(link, info, base2, multi_config()
560 link->irq); multi_config()
561 base2 = link->resource[0]->start; multi_config()
563 err = setup_serial(link, info, link->resource[0]->start, multi_config()
564 link->irq); multi_config()
573 info->quirk->wakeup(link); multi_config()
578 setup_serial(link, info, link->resource[0]->start, link->irq); multi_config()
580 setup_serial(link, info, base2 + (8 * i), multi_config()
581 link->irq); multi_config()
603 static int serial_config(struct pcmcia_device * link) serial_config() argument
605 struct serial_info *info = link->priv; serial_config()
608 dev_dbg(&link->dev, "serial_config\n"); serial_config()
611 info->multi = (link->socket->functions > 1); serial_config()
614 info->manfid = link->manf_id; serial_config()
615 info->prodid = link->card_id; serial_config()
629 (link->has_func_id) && serial_config()
630 (link->socket->pcmcia_pfc == 0) && serial_config()
631 ((link->func_id == CISTPL_FUNCID_MULTI) || serial_config()
632 (link->func_id == CISTPL_FUNCID_SERIAL))) serial_config()
633 pcmcia_loop_config(link, serial_check_for_multi, info); serial_config()
641 dev_info(&link->dev, serial_config()
643 link->manf_id, link->card_id, serial_config()
644 link->socket->pcmcia_pfc, info->multi, info->quirk); serial_config()
645 if (link->socket->pcmcia_pfc) serial_config()
646 i = pfc_config(link); serial_config()
648 i = multi_config(link); serial_config()
650 i = simple_config(link); serial_config()
660 if (info->quirk->post(link)) serial_config()
666 dev_warn(&link->dev, "failed to initialize\n"); serial_config()
667 serial_remove(link); serial_config()
/linux-4.1.27/drivers/iommu/
H A Diommu-sysfs.c103 * this interface. A link to the device will be created in the "devices"
104 * directory of the IOMMU device in sysfs and an "iommu" link will be
107 int iommu_device_link(struct device *dev, struct device *link) iommu_device_link() argument
115 &link->kobj, dev_name(link)); iommu_device_link()
119 ret = sysfs_create_link_nowarn(&link->kobj, &dev->kobj, "iommu"); iommu_device_link()
122 dev_name(link)); iommu_device_link()
127 void iommu_device_unlink(struct device *dev, struct device *link) iommu_device_unlink() argument
132 sysfs_remove_link(&link->kobj, "iommu"); iommu_device_unlink()
133 sysfs_remove_link_from_group(&dev->kobj, "devices", dev_name(link)); iommu_device_unlink()
/linux-4.1.27/drivers/media/v4l2-core/
H A Dv4l2-of.c170 * v4l2_of_parse_link() - parse a link between two endpoints
171 * @node: pointer to the endpoint at the local end of the link
172 * @link: pointer to the V4L2 OF link data structure
174 * Fill the link structure with the local and remote nodes and port numbers.
181 * v4l2_of_put_link() to drop the references when done with the link.
186 struct v4l2_of_link *link) v4l2_of_parse_link()
190 memset(link, 0, sizeof(*link)); v4l2_of_parse_link()
193 of_property_read_u32(np, "reg", &link->local_port); v4l2_of_parse_link()
197 link->local_node = np; v4l2_of_parse_link()
201 of_node_put(link->local_node); v4l2_of_parse_link()
206 of_property_read_u32(np, "reg", &link->remote_port); v4l2_of_parse_link()
210 link->remote_node = np; v4l2_of_parse_link()
217 * v4l2_of_put_link() - drop references to nodes in a link
218 * @link: pointer to the V4L2 OF link data structure
220 * Drop references to the local and remote nodes in the link. This function must
221 * be called on every link parsed with v4l2_of_parse_link().
223 void v4l2_of_put_link(struct v4l2_of_link *link) v4l2_of_put_link() argument
225 of_node_put(link->local_node); v4l2_of_put_link()
226 of_node_put(link->remote_node); v4l2_of_put_link()
185 v4l2_of_parse_link(const struct device_node *node, struct v4l2_of_link *link) v4l2_of_parse_link() argument
/linux-4.1.27/drivers/mtd/maps/
H A Dpcmciamtd.c302 struct pcmcia_device *link = dev->p_dev; pcmciamtd_set_vpp() local
309 pcmcia_fixup_vpp(link, dev->vpp); pcmciamtd_set_vpp()
312 pcmcia_fixup_vpp(link, 0); pcmciamtd_set_vpp()
318 static void pcmciamtd_release(struct pcmcia_device *link) pcmciamtd_release() argument
320 struct pcmciamtd_dev *dev = link->priv; pcmciamtd_release()
322 pr_debug("link = 0x%p\n", link); pcmciamtd_release()
324 if (link->resource[2]->end) { pcmciamtd_release()
330 pcmcia_disable_device(link); pcmciamtd_release()
463 static int pcmciamtd_config(struct pcmcia_device *link) pcmciamtd_config() argument
465 struct pcmciamtd_dev *dev = link->priv; pcmciamtd_config()
472 pr_debug("link=0x%p\n", link); pcmciamtd_config()
474 card_settings(dev, link, &new_name); pcmciamtd_config()
495 link->resource[2]->flags |= WIN_MEMORY_TYPE_CM | WIN_ENABLE; pcmciamtd_config()
496 link->resource[2]->flags |= (dev->pcmcia_map.bankwidth == 1) ? pcmciamtd_config()
498 link->resource[2]->start = 0; pcmciamtd_config()
499 link->resource[2]->end = (force_size) ? force_size << 20 : pcmciamtd_config()
506 (unsigned long) resource_size(link->resource[2]) >> 10, pcmciamtd_config()
508 ret = pcmcia_request_window(link, link->resource[2], mem_speed); pcmciamtd_config()
512 link->resource[2]->start = 0; pcmciamtd_config()
513 link->resource[2]->end = (force_size) ? pcmciamtd_config()
515 link->resource[2]->end >>= j; pcmciamtd_config()
518 resource_size(link->resource[2]) >> 10); pcmciamtd_config()
519 dev->win_size = resource_size(link->resource[2]); pcmciamtd_config()
522 } while (link->resource[2]->end >= 0x1000); pcmciamtd_config()
528 pcmciamtd_release(link); pcmciamtd_config()
534 dev->win_base = ioremap(link->resource[2]->start, pcmciamtd_config()
535 resource_size(link->resource[2])); pcmciamtd_config()
538 link->resource[2]); pcmciamtd_config()
539 pcmciamtd_release(link); pcmciamtd_config()
543 dev, link->resource[2], dev->win_base); pcmciamtd_config()
547 dev->pcmcia_map.map_priv_2 = (unsigned long)link->resource[2]; pcmciamtd_config()
549 dev->vpp = (vpp) ? vpp : link->socket->socket.Vpp; pcmciamtd_config()
551 link->vpp = dev->vpp; pcmciamtd_config()
553 link->vpp = 0; pcmciamtd_config()
556 link->config_index = 0; pcmciamtd_config()
558 ret = pcmcia_enable_device(link); pcmciamtd_config()
584 pcmciamtd_release(link); pcmciamtd_config()
628 pcmciamtd_release(link); pcmciamtd_config()
640 /* get_lock(link); */ pcmciamtd_suspend()
649 /* free_lock(link); */ pcmciamtd_resume()
655 static void pcmciamtd_detach(struct pcmcia_device *link) pcmciamtd_detach() argument
657 struct pcmciamtd_dev *dev = link->priv; pcmciamtd_detach()
659 pr_debug("link=0x%p\n", link); pcmciamtd_detach()
668 pcmciamtd_release(link); pcmciamtd_detach()
672 static int pcmciamtd_probe(struct pcmcia_device *link) pcmciamtd_probe() argument
681 dev->p_dev = link; pcmciamtd_probe()
682 link->priv = dev; pcmciamtd_probe()
684 return pcmciamtd_config(link); pcmciamtd_probe()
/linux-4.1.27/drivers/char/pcmcia/
H A Dcm4040_cs.c62 static void reader_release(struct pcmcia_device *link);
438 struct pcmcia_device *link;
446 link = dev_table[minor];
447 if (link == NULL || !pcmcia_dev_present(link)) {
452 if (link->open) {
457 dev = link->priv;
466 link->open = 1;
481 struct pcmcia_device *link;
490 link = dev_table[minor];
491 if (link == NULL)
496 link->open = 0;
503 static void cm4040_reader_release(struct pcmcia_device *link)
505 struct reader_dev *dev = link->priv;
508 while (link->open) {
511 wait_event(dev->devq, (link->open == 0));
523 static int reader_config(struct pcmcia_device *link, int devno)
528 link->config_flags |= CONF_AUTO_SET_IO;
530 if (pcmcia_loop_config(link, cm4040_config_check, NULL))
533 fail_rc = pcmcia_enable_device(link);
535 dev_printk(KERN_INFO, &link->dev,
541 dev = link->priv;
544 link->resource[0]);
550 reader_release(link);
554 static void reader_release(struct pcmcia_device *link)
556 cm4040_reader_release(link);
557 pcmcia_disable_device(link);
560 static int reader_probe(struct pcmcia_device *link)
580 link->priv = dev;
581 dev->p_dev = link;
583 dev_table[i] = link;
591 ret = reader_config(link, i);
603 static void reader_detach(struct pcmcia_device *link)
605 struct reader_dev *dev = link->priv;
610 if (dev_table[devno] == link)
616 reader_release(link);
H A Dcm4000_cs.c67 static void cm4000_release(struct pcmcia_device *link);
1404 struct pcmcia_device *link;
1422 link = dev_table[iminor(inode)];
1423 if (!pcmcia_dev_present(link)) {
1635 struct pcmcia_device *link;
1643 link = dev_table[minor];
1644 if (link == NULL || !pcmcia_dev_present(link)) {
1649 if (link->open) {
1654 dev = link->priv;
1682 link->open = 1; /* only one open per device */
1694 struct pcmcia_device *link;
1700 link = dev_table[minor];
1701 if (link == NULL)
1704 dev = link->priv;
1713 link->open = 0; /* only one open per device */
1720 static void cmm_cm4000_release(struct pcmcia_device * link)
1722 struct cm4000_dev *dev = link->priv;
1728 while (link->open) {
1735 wait_event(dev->devq, (link->open == 0));
1749 static int cm4000_config(struct pcmcia_device * link, int devno)
1753 link->config_flags |= CONF_AUTO_SET_IO;
1756 if (pcmcia_loop_config(link, cm4000_config_check, NULL))
1759 if (pcmcia_enable_device(link))
1762 dev = link->priv;
1767 cm4000_release(link);
1771 static int cm4000_suspend(struct pcmcia_device *link)
1775 dev = link->priv;
1781 static int cm4000_resume(struct pcmcia_device *link)
1785 dev = link->priv;
1786 if (link->open)
1792 static void cm4000_release(struct pcmcia_device *link)
1794 cmm_cm4000_release(link); /* delay release until device closed */
1795 pcmcia_disable_device(link);
1798 static int cm4000_probe(struct pcmcia_device *link)
1817 dev->p_dev = link;
1818 link->priv = dev;
1819 dev_table[i] = link;
1826 ret = cm4000_config(link, i);
1838 static void cm4000_detach(struct pcmcia_device *link)
1840 struct cm4000_dev *dev = link->priv;
1845 if (dev_table[devno] == link)
1852 cm4000_release(link);
/linux-4.1.27/drivers/net/ethernet/8390/
H A Dpcnet_cs.c96 static int pcnet_config(struct pcmcia_device *link);
97 static void pcnet_release(struct pcmcia_device *link);
105 static int setup_shmem_window(struct pcmcia_device *link, int start_pg,
107 static int setup_dma_config(struct pcmcia_device *link, int start_pg,
238 static int pcnet_probe(struct pcmcia_device *link) pcnet_probe() argument
243 dev_dbg(&link->dev, "pcnet_attach()\n"); pcnet_probe()
249 info->p_dev = link; pcnet_probe()
250 link->priv = dev; pcnet_probe()
252 link->config_flags |= CONF_ENABLE_IRQ | CONF_AUTO_SET_IO; pcnet_probe()
256 return pcnet_config(link); pcnet_probe()
259 static void pcnet_detach(struct pcmcia_device *link) pcnet_detach() argument
261 struct net_device *dev = link->priv; pcnet_detach()
263 dev_dbg(&link->dev, "pcnet_detach\n"); pcnet_detach()
267 pcnet_release(link); pcnet_detach()
279 static struct hw_info *get_hwinfo(struct pcmcia_device *link) get_hwinfo() argument
281 struct net_device *dev = link->priv; get_hwinfo()
286 link->resource[2]->flags |= WIN_DATA_WIDTH_8|WIN_MEMORY_TYPE_AM|WIN_ENABLE; get_hwinfo()
287 link->resource[2]->start = 0; link->resource[2]->end = 0; get_hwinfo()
288 i = pcmcia_request_window(link, link->resource[2], 0); get_hwinfo()
292 virt = ioremap(link->resource[2]->start, get_hwinfo()
293 resource_size(link->resource[2])); get_hwinfo()
295 pcmcia_map_mem_page(link, link->resource[2], get_hwinfo()
296 hw_info[i].offset & ~(resource_size(link->resource[2])-1)); get_hwinfo()
297 base = &virt[hw_info[i].offset & (resource_size(link->resource[2])-1)]; get_hwinfo()
308 j = pcmcia_release_window(link, link->resource[2]); get_hwinfo()
320 static struct hw_info *get_prom(struct pcmcia_device *link) get_prom() argument
322 struct net_device *dev = link->priv; get_prom()
374 static struct hw_info *get_dl10019(struct pcmcia_device *link) get_dl10019() argument
376 struct net_device *dev = link->priv; get_dl10019()
396 static struct hw_info *get_ax88190(struct pcmcia_device *link) get_ax88190() argument
398 struct net_device *dev = link->priv; get_ax88190()
403 if (link->config_base != 0x03c0) get_ax88190()
427 static struct hw_info *get_hwired(struct pcmcia_device *link) get_hwired() argument
429 struct net_device *dev = link->priv; get_hwired()
443 static int try_io_port(struct pcmcia_device *link) try_io_port() argument
446 link->resource[0]->flags &= ~IO_DATA_PATH_WIDTH; try_io_port()
447 link->resource[1]->flags &= ~IO_DATA_PATH_WIDTH; try_io_port()
448 if (link->resource[0]->end == 32) { try_io_port()
449 link->resource[0]->flags |= IO_DATA_PATH_WIDTH_AUTO; try_io_port()
450 if (link->resource[1]->end > 0) { try_io_port()
452 link->resource[1]->flags |= IO_DATA_PATH_WIDTH_8; try_io_port()
456 link->resource[0]->flags |= IO_DATA_PATH_WIDTH_8; try_io_port()
457 link->resource[1]->flags |= IO_DATA_PATH_WIDTH_16; try_io_port()
459 if (link->resource[0]->start == 0) { try_io_port()
461 link->resource[0]->start = j ^ 0x300; try_io_port()
462 link->resource[1]->start = (j ^ 0x300) + 0x10; try_io_port()
463 link->io_lines = 16; try_io_port()
464 ret = pcmcia_request_io(link); try_io_port()
470 return pcmcia_request_io(link); try_io_port()
492 static struct hw_info *pcnet_try_config(struct pcmcia_device *link, pcnet_try_config() argument
495 struct net_device *dev = link->priv; pcnet_try_config()
501 ret = pcmcia_loop_config(link, pcnet_confcheck, &priv); pcnet_try_config()
503 dev_warn(&link->dev, "no useable port range found\n"); pcnet_try_config()
508 if (!link->irq) pcnet_try_config()
511 if (resource_size(link->resource[1]) == 8) pcnet_try_config()
512 link->config_flags |= CONF_ENABLE_SPKR; pcnet_try_config()
514 if ((link->manf_id == MANFID_IBM) && pcnet_try_config()
515 (link->card_id == PRODID_IBM_HOME_AND_AWAY)) pcnet_try_config()
516 link->config_index |= 0x10; pcnet_try_config()
518 ret = pcmcia_enable_device(link); pcnet_try_config()
522 dev->irq = link->irq; pcnet_try_config()
523 dev->base_addr = link->resource[0]->start; pcnet_try_config()
529 dev_notice(&link->dev, "invalid if_port requested\n"); pcnet_try_config()
533 if ((link->config_base == 0x03c0) && pcnet_try_config()
534 (link->manf_id == 0x149) && (link->card_id == 0xc1ab)) { pcnet_try_config()
535 dev_info(&link->dev, pcnet_try_config()
540 local_hw_info = get_hwinfo(link); pcnet_try_config()
542 local_hw_info = get_prom(link); pcnet_try_config()
544 local_hw_info = get_dl10019(link); pcnet_try_config()
546 local_hw_info = get_ax88190(link); pcnet_try_config()
548 local_hw_info = get_hwired(link); pcnet_try_config()
553 static int pcnet_config(struct pcmcia_device *link) pcnet_config() argument
555 struct net_device *dev = link->priv; pcnet_config()
562 dev_dbg(&link->dev, "pcnet_config\n"); pcnet_config()
564 local_hw_info = pcnet_try_config(link, &has_shmem, 0); pcnet_config()
567 pcmcia_disable_device(link); pcnet_config()
568 local_hw_info = pcnet_try_config(link, &has_shmem, 1); pcnet_config()
570 dev_notice(&link->dev, "unable to read hardware net" pcnet_config()
579 if ((link->manf_id == MANFID_SOCKET) && pcnet_config()
580 ((link->card_id == PRODID_SOCKET_LPE) || pcnet_config()
581 (link->card_id == PRODID_SOCKET_LPE_CF) || pcnet_config()
582 (link->card_id == PRODID_SOCKET_EIO))) pcnet_config()
599 (setup_shmem_window(link, start_pg, stop_pg, cm_offset) != 0)) pcnet_config()
600 setup_dma_config(link, start_pg, stop_pg); pcnet_config()
609 SET_NETDEV_DEV(dev, &link->dev); pcnet_config()
636 pcnet_release(link); pcnet_config()
640 static void pcnet_release(struct pcmcia_device *link) pcnet_release() argument
642 struct pcnet_dev *info = PRIV(link->priv); pcnet_release()
644 dev_dbg(&link->dev, "pcnet_release\n"); pcnet_release()
649 pcmcia_disable_device(link); pcnet_release()
652 static int pcnet_suspend(struct pcmcia_device *link) pcnet_suspend() argument
654 struct net_device *dev = link->priv; pcnet_suspend()
656 if (link->open) pcnet_suspend()
662 static int pcnet_resume(struct pcmcia_device *link) pcnet_resume() argument
664 struct net_device *dev = link->priv; pcnet_resume()
666 if (link->open) { pcnet_resume()
902 struct pcmcia_device *link = info->p_dev; pcnet_open() local
905 dev_dbg(&link->dev, "pcnet_open('%s')\n", dev->name); pcnet_open()
907 if (!pcmcia_dev_present(link)) pcnet_open()
917 link->open++; pcnet_open()
932 struct pcmcia_device *link = info->p_dev; pcnet_close() local
934 dev_dbg(&link->dev, "pcnet_close('%s')\n", dev->name); pcnet_close()
939 link->open--; pcnet_close()
1016 u_short link; ei_watchdog() local
1039 link = mdio_read(mii_addr, info->phy_id, 1); ei_watchdog()
1040 if (!link || (link == 0xffff)) { ei_watchdog()
1050 link &= 0x0004; ei_watchdog()
1051 if (link != info->link_status) { ei_watchdog()
1053 netdev_info(dev, "%s link beat\n", link ? "found" : "lost"); ei_watchdog()
1054 if (link && (info->flags & IS_DL10022)) { ei_watchdog()
1057 } else if (link && (info->flags & IS_DL10019)) { ei_watchdog()
1061 if (link) { ei_watchdog()
1069 netdev_info(dev, "link partner did not autonegotiate\n"); ei_watchdog()
1073 info->link_status = link; ei_watchdog()
1076 link = mdio_read(mii_addr, info->eth_phy, 1) & 0x0004; ei_watchdog()
1077 if (((info->phy_id == info->pna_phy) && link) || ei_watchdog()
1078 ((info->phy_id != info->pna_phy) && !link)) { ei_watchdog()
1296 static int setup_dma_config(struct pcmcia_device *link, int start_pg, setup_dma_config() argument
1299 struct net_device *dev = link->priv; setup_dma_config()
1399 static int setup_shmem_window(struct pcmcia_device *link, int start_pg, setup_shmem_window() argument
1402 struct net_device *dev = link->priv; setup_shmem_window()
1414 link->resource[3]->flags |= WIN_DATA_WIDTH_16|WIN_MEMORY_TYPE_CM|WIN_ENABLE; setup_shmem_window()
1415 link->resource[3]->flags |= WIN_USE_WAIT; setup_shmem_window()
1416 link->resource[3]->start = 0; link->resource[3]->end = window_size; setup_shmem_window()
1417 ret = pcmcia_request_window(link, link->resource[3], mem_speed); setup_shmem_window()
1423 ret = pcmcia_map_mem_page(link, link->resource[3], offset); setup_shmem_window()
1428 info->base = ioremap(link->resource[3]->start, setup_shmem_window()
1429 resource_size(link->resource[3])); setup_shmem_window()
1438 pcmcia_release_window(link, link->resource[3]); setup_shmem_window()
1444 ei_status.priv = resource_size(link->resource[3]); setup_shmem_window()
1446 dev->mem_end = dev->mem_start + resource_size(link->resource[3]); setup_shmem_window()
1451 (resource_size(link->resource[3]) - offset) >> 8); setup_shmem_window()
H A Daxnet_cs.c77 static int axnet_config(struct pcmcia_device *link);
78 static void axnet_release(struct pcmcia_device *link);
142 static int axnet_probe(struct pcmcia_device *link) axnet_probe() argument
148 dev_dbg(&link->dev, "axnet_attach()\n"); axnet_probe()
159 info->p_dev = link; axnet_probe()
160 link->priv = dev; axnet_probe()
161 link->config_flags |= CONF_ENABLE_IRQ; axnet_probe()
167 return axnet_config(link); axnet_probe()
170 static void axnet_detach(struct pcmcia_device *link) axnet_detach() argument
172 struct net_device *dev = link->priv; axnet_detach()
174 dev_dbg(&link->dev, "axnet_detach(0x%p)\n", link); axnet_detach()
178 axnet_release(link); axnet_detach()
189 static int get_prom(struct pcmcia_device *link) get_prom() argument
191 struct net_device *dev = link->priv; get_prom()
215 if (link->config_base != 0x03c0) get_prom()
232 static int try_io_port(struct pcmcia_device *link) try_io_port() argument
235 link->resource[0]->flags &= ~IO_DATA_PATH_WIDTH; try_io_port()
236 link->resource[1]->flags &= ~IO_DATA_PATH_WIDTH; try_io_port()
237 if (link->resource[0]->end == 32) { try_io_port()
238 link->resource[0]->flags |= IO_DATA_PATH_WIDTH_AUTO; try_io_port()
240 if (link->resource[1]->end > 0) try_io_port()
241 link->resource[1]->flags |= IO_DATA_PATH_WIDTH_8; try_io_port()
244 link->resource[0]->flags |= IO_DATA_PATH_WIDTH_8; try_io_port()
245 link->resource[1]->flags |= IO_DATA_PATH_WIDTH_16; try_io_port()
247 if (link->resource[0]->start == 0) { try_io_port()
249 link->resource[0]->start = j ^ 0x300; try_io_port()
250 link->resource[1]->start = (j ^ 0x300) + 0x10; try_io_port()
251 link->io_lines = 16; try_io_port()
252 ret = pcmcia_request_io(link); try_io_port()
258 return pcmcia_request_io(link); try_io_port()
274 static int axnet_config(struct pcmcia_device *link) axnet_config() argument
276 struct net_device *dev = link->priv; axnet_config()
280 dev_dbg(&link->dev, "axnet_config(0x%p)\n", link); axnet_config()
283 link->config_regs = 0x63; axnet_config()
284 link->config_flags |= CONF_ENABLE_IRQ | CONF_AUTO_SET_IO; axnet_config()
285 ret = pcmcia_loop_config(link, axnet_configcheck, NULL); axnet_config()
289 if (!link->irq) axnet_config()
292 if (resource_size(link->resource[1]) == 8) axnet_config()
293 link->config_flags |= CONF_ENABLE_SPKR; axnet_config()
295 ret = pcmcia_enable_device(link); axnet_config()
299 dev->irq = link->irq; axnet_config()
300 dev->base_addr = link->resource[0]->start; axnet_config()
302 if (!get_prom(link)) { axnet_config()
338 pcmcia_write_config_byte(link, CISREG_CCSR, 0x04); axnet_config()
351 SET_NETDEV_DEV(dev, &link->dev); axnet_config()
370 axnet_release(link); axnet_config()
374 static void axnet_release(struct pcmcia_device *link) axnet_release() argument
376 pcmcia_disable_device(link); axnet_release()
379 static int axnet_suspend(struct pcmcia_device *link) axnet_suspend() argument
381 struct net_device *dev = link->priv; axnet_suspend()
383 if (link->open) axnet_suspend()
389 static int axnet_resume(struct pcmcia_device *link) axnet_resume() argument
391 struct net_device *dev = link->priv; axnet_resume()
394 if (link->open) { axnet_resume()
396 pcmcia_write_config_byte(link, CISREG_CCSR, 0x04); axnet_resume()
471 struct pcmcia_device *link = info->p_dev; axnet_open() local
474 dev_dbg(&link->dev, "axnet_open('%s')\n", dev->name); axnet_open()
476 if (!pcmcia_dev_present(link)) axnet_open()
484 link->open++; axnet_open()
498 struct pcmcia_device *link = info->p_dev; axnet_close() local
500 dev_dbg(&link->dev, "axnet_close('%s')\n", dev->name); axnet_close()
505 link->open--; axnet_close()
557 u_short link; ei_watchdog() local
578 link = mdio_read(mii_addr, info->phy_id, 1); ei_watchdog()
579 if (!link || (link == 0xffff)) { ei_watchdog()
585 link &= 0x0004; ei_watchdog()
586 if (link != info->link_status) { ei_watchdog()
588 netdev_info(dev, "%s link beat\n", link ? "found" : "lost"); ei_watchdog()
589 if (link) { ei_watchdog()
595 netdev_info(dev, "link partner did not autonegotiate\n"); ei_watchdog()
598 info->link_status = link; ei_watchdog()
/linux-4.1.27/arch/tile/include/hv/
H A Ddrv_mpipe_intf.h170 /** Maximum number of characters in a link name. */
174 /** Structure holding a link name. Only needed, and only typedef'ed,
210 * receive packets -- on the specified link. Other processes may also
211 * request shared data permission on the same link.
219 /** Do not request data permission on the specified link.
228 * receive packets -- on the specified link. No other processes may
229 * request data permission on this link, and if any process already has
239 * registers which contain link statistics, and to get link attributes --
240 * on the specified link. Other processes may also request shared stats
241 * permission on the same link.
249 /** Do not request stats permission on the specified link.
258 * write registers which contain link statistics, and to get link
259 * attributes -- on the specified link. No other processes may request
260 * stats permission on this link, and if any process already
265 * link. Applications should only do this if they use MAC statistics
275 /** Request shared control permission -- that is, the ability to modify link
277 * specified link. Other processes may also request shared control
278 * permission on the same link.
286 /** Do not request control permission on the specified link.
295 * link attributes, and read and write MAC and MDIO registers -- on the
296 * specified link. No other processes may request control permission on
297 * this link, and if any process already has control permission on it,
301 * it prevents programs like mpipe-link from configuring the link.
309 /** Set the desired state of the link to up, allowing any speeds which are
310 * supported by the link hardware, as part of this open operation; do not
311 * change the desired state of the link when it is closed or the process
319 /** Set the desired state of the link to up, allowing any speeds which are
320 * supported by the link hardware, as part of this open operation; when the
321 * link is closed or this process exits, if no other process has the link
322 * open, set the desired state of the link to down. No more than one of
330 /** Do not change the desired state of the link as part of the open
331 * operation; when the link is closed or this process exits, if no other
332 * process has the link open, set the desired state of the link to down.
340 /** Do not change the desired state of the link as part of the open
341 * operation; do not change the desired state of the link when it is
350 /** Request that this open call not complete until the network link is up.
352 * applications which wish to abandon waiting for the link after a
353 * specific time period should not specify this flag when opening a link,
354 * but should instead call gxio_mpipe_link_wait() afterward. The link
356 * does not change the desired link state; if other open flags or previous
357 * link state changes have not requested a desired state of up, the open
365 * Note: link attributes must fit in 24 bits, since we use the top 8 bits
375 /** Determine whether to send pause frames on this link if the mPIPE packet
392 * If the value is nonzero, mPIPE shim will suspend output on the link's
413 /** Determine whether to discard egress packets on link down. If this value
414 * is nonzero, packets sent on this link while the link is down will be
415 * discarded. If this value is zero, no packets will be sent on this link
419 /** Possible link state. The value is a combination of link state flags,
420 * ORed together, that indicate link modes which are actually supported by
425 /** Current link state. The value is a combination of link state flags,
427 * link is down, the value ANDed with ::GXIO_MPIPE_LINK_SPEED will be zero;
428 * if the link is up, the value ANDed with ::GXIO_MPIPE_LINK_SPEED will
434 /** Desired link state. The value is a conbination of flags, which specify
435 * the desired state for the link. With gxio_mpipe_link_set_attr(), this
436 * will, in the background, attempt to bring up the link using whichever of
437 * the requested flags are reasonable, or take down the link if the flags
438 * are zero. The actual link up or down operation may happen after this
439 * call completes. If the link state changes in the future, the system
440 * will continue to try to get back to the desired link state; for
441 * instance, if the link is brought up successfully, and then the network
442 * cable is disconnected, the link will go down. However, the desired
443 * state of the link is still up, so if the cable is reconnected, the link
447 * for the link, as set with a previous gxio_mpipe_link_set_attr() call,
448 * or implicitly by a gxio_mpipe_link_open() or link close operation.
449 * This may not reflect the current state of the link; to get that, use
477 /** Link should run at the highest speed supported by the link and by
478 * the device connected to the link. Only usable as a value for
479 * the link's desired state; never returned as a value for the current
483 /** All legal link speeds. This value is provided for use in extracting
484 * the speed-related subset of the link state flags; it is not intended
486 * attributes. A link is up or is requested to be up if its current or
H A Ddrv_trio_intf.h42 /** If true, the link can be configured in PCIe root complex mode. */
45 /** If true, the link can be configured in PCIe endpoint mode. */
48 /** If true, the link can be configured in StreamIO mode. */
51 /** If true, the link is allowed to support 1-lane operation. Software
52 * will not consider it an error if the link comes up as a x1 link. */
55 /** If true, the link is allowed to support 2-lane operation. Software
56 * will not consider it an error if the link comes up as a x2 link. */
59 /** If true, the link is allowed to support 4-lane operation. Software
60 * will not consider it an error if the link comes up as a x4 link. */
63 /** If true, the link is allowed to support 8-lane operation. Software
64 * will not consider it an error if the link comes up as a x8 link. */
67 /** If true, this link is connected to a device which may or may not
/linux-4.1.27/drivers/net/ethernet/smsc/
H A Dsmc91c92_cs.c267 static int smc91c92_config(struct pcmcia_device *link);
268 static void smc91c92_release(struct pcmcia_device *link);
302 static int smc91c92_probe(struct pcmcia_device *link) smc91c92_probe() argument
307 dev_dbg(&link->dev, "smc91c92_attach()\n"); smc91c92_probe()
314 smc->p_dev = link; smc91c92_probe()
315 link->priv = dev; smc91c92_probe()
330 return smc91c92_config(link); smc91c92_probe()
333 static void smc91c92_detach(struct pcmcia_device *link) smc91c92_detach() argument
335 struct net_device *dev = link->priv; smc91c92_detach()
337 dev_dbg(&link->dev, "smc91c92_detach\n"); smc91c92_detach()
341 smc91c92_release(link); smc91c92_detach()
378 static int mhz_3288_power(struct pcmcia_device *link) mhz_3288_power() argument
380 struct net_device *dev = link->priv; mhz_3288_power()
393 tmp = readb(smc->base + link->config_base + CISREG_COR); mhz_3288_power()
395 writeb(tmp, smc->base + link->config_base + CISREG_COR); mhz_3288_power()
421 static int mhz_mfc_config(struct pcmcia_device *link) mhz_mfc_config() argument
423 struct net_device *dev = link->priv; mhz_mfc_config()
428 link->config_flags |= CONF_ENABLE_SPKR | CONF_ENABLE_IRQ | mhz_mfc_config()
433 if (pcmcia_loop_config(link, mhz_mfc_config_check, NULL)) mhz_mfc_config()
436 dev->base_addr = link->resource[0]->start; mhz_mfc_config()
439 link->resource[2]->flags = WIN_DATA_WIDTH_8|WIN_MEMORY_TYPE_AM|WIN_ENABLE; mhz_mfc_config()
440 link->resource[2]->start = link->resource[2]->end = 0; mhz_mfc_config()
441 i = pcmcia_request_window(link, link->resource[2], 0); mhz_mfc_config()
445 smc->base = ioremap(link->resource[2]->start, mhz_mfc_config()
446 resource_size(link->resource[2])); mhz_mfc_config()
447 offset = (smc->manfid == MANFID_MOTOROLA) ? link->config_base : 0; mhz_mfc_config()
448 i = pcmcia_map_mem_page(link, link->resource[2], offset); mhz_mfc_config()
452 mhz_3288_power(link); mhz_mfc_config()
476 static int mhz_setup(struct pcmcia_device *link) mhz_setup() argument
478 struct net_device *dev = link->priv; mhz_setup()
485 if ((link->prod_id[3]) && mhz_setup()
486 (cvt_ascii_address(dev, link->prod_id[3]) == 0)) mhz_setup()
491 if (!pcmcia_loop_tuple(link, CISTPL_VERS_1, pcmcia_get_versmac, dev)) mhz_setup()
496 len = pcmcia_get_tuple(link, 0x81, &buf); mhz_setup()
516 static void mot_config(struct pcmcia_device *link) mot_config() argument
518 struct net_device *dev = link->priv; mot_config()
521 unsigned int iouart = link->resource[1]->start; mot_config()
537 static int mot_setup(struct pcmcia_device *link) mot_setup() argument
539 struct net_device *dev = link->priv; mot_setup()
580 static int smc_config(struct pcmcia_device *link) smc_config() argument
582 struct net_device *dev = link->priv; smc_config()
585 link->config_flags |= CONF_ENABLE_IRQ | CONF_AUTO_SET_IO; smc_config()
587 i = pcmcia_loop_config(link, smc_configcheck, NULL); smc_config()
589 dev->base_addr = link->resource[0]->start; smc_config()
595 static int smc_setup(struct pcmcia_device *link) smc_setup() argument
597 struct net_device *dev = link->priv; smc_setup()
600 if (!pcmcia_get_mac_from_cis(link, dev)) smc_setup()
604 if (link->prod_id[2]) { smc_setup()
605 if (cvt_ascii_address(dev, link->prod_id[2]) == 0) smc_setup()
613 static int osi_config(struct pcmcia_device *link) osi_config() argument
615 struct net_device *dev = link->priv; osi_config()
619 link->config_flags |= CONF_ENABLE_SPKR | CONF_ENABLE_IRQ; osi_config()
620 link->resource[0]->end = 64; osi_config()
621 link->resource[1]->flags |= IO_DATA_PATH_WIDTH_8; osi_config()
622 link->resource[1]->end = 8; osi_config()
625 link->io_lines = 16; osi_config()
626 link->config_index = 0x23; osi_config()
629 link->resource[1]->start = com[j]; osi_config()
630 i = pcmcia_request_io(link); osi_config()
636 link->config_index = 0x03; osi_config()
637 link->resource[1]->end = 0; osi_config()
638 i = pcmcia_request_io(link); osi_config()
640 dev->base_addr = link->resource[0]->start + 0x10; osi_config()
644 static int osi_load_firmware(struct pcmcia_device *link) osi_load_firmware() argument
649 err = request_firmware(&fw, FIRMWARE_NAME, &link->dev); osi_load_firmware()
657 outb(fw->data[i], link->resource[0]->start + 2); osi_load_firmware()
681 static int osi_setup(struct pcmcia_device *link, u_short manfid, u_short cardid) osi_setup() argument
683 struct net_device *dev = link->priv; osi_setup()
687 if (pcmcia_loop_tuple(link, 0x90, pcmcia_osi_mac, dev)) osi_setup()
694 rc = osi_load_firmware(link); osi_setup()
699 set_bits(0x300, link->resource[0]->start + OSITECH_AUI_PWR); osi_setup()
701 set_bits(0x300, link->resource[0]->start + OSITECH_RESET_ISR); osi_setup()
702 dev_dbg(&link->dev, "AUI/PWR: %4.4x RESET/ISR: %4.4x\n", osi_setup()
703 inw(link->resource[0]->start + OSITECH_AUI_PWR), osi_setup()
704 inw(link->resource[0]->start + OSITECH_RESET_ISR)); osi_setup()
709 static int smc91c92_suspend(struct pcmcia_device *link) smc91c92_suspend() argument
711 struct net_device *dev = link->priv; smc91c92_suspend()
713 if (link->open) smc91c92_suspend()
719 static int smc91c92_resume(struct pcmcia_device *link) smc91c92_resume() argument
721 struct net_device *dev = link->priv; smc91c92_resume()
727 mhz_3288_power(link); smc91c92_resume()
729 mot_config(link); smc91c92_resume()
740 i = osi_load_firmware(link); smc91c92_resume()
746 if (link->open) { smc91c92_resume()
762 static int check_sig(struct pcmcia_device *link) check_sig() argument
764 struct net_device *dev = link->priv; check_sig()
777 width = (link->resource[0]->flags == IO_DATA_PATH_WIDTH_AUTO); check_sig()
797 smc91c92_suspend(link); check_sig()
798 pcmcia_fixup_iowidth(link); check_sig()
799 smc91c92_resume(link); check_sig()
800 return check_sig(link); check_sig()
805 static int smc91c92_config(struct pcmcia_device *link) smc91c92_config() argument
807 struct net_device *dev = link->priv; smc91c92_config()
814 dev_dbg(&link->dev, "smc91c92_config\n"); smc91c92_config()
816 smc->manfid = link->manf_id; smc91c92_config()
817 smc->cardid = link->card_id; smc91c92_config()
821 i = osi_config(link); smc91c92_config()
826 i = mhz_mfc_config(link); smc91c92_config()
828 i = smc_config(link); smc91c92_config()
833 i = pcmcia_request_irq(link, smc_interrupt); smc91c92_config()
836 i = pcmcia_enable_device(link); smc91c92_config()
841 mot_config(link); smc91c92_config()
843 dev->irq = link->irq; smc91c92_config()
848 dev_notice(&link->dev, "invalid if_port requested\n"); smc91c92_config()
853 i = osi_setup(link, smc->manfid, smc->cardid); break; smc91c92_config()
856 i = smc_setup(link); break; smc91c92_config()
859 i = mhz_setup(link); break; smc91c92_config()
862 i = mot_setup(link); break; smc91c92_config()
866 dev_notice(&link->dev, "Unable to find hardware address.\n"); smc91c92_config()
873 rev = check_sig(link); smc91c92_config()
916 SET_NETDEV_DEV(dev, &link->dev); smc91c92_config()
919 dev_err(&link->dev, "register_netdev() failed\n"); smc91c92_config()
948 smc91c92_release(link); smc91c92_config()
953 static void smc91c92_release(struct pcmcia_device *link) smc91c92_release() argument
955 dev_dbg(&link->dev, "smc91c92_release\n"); smc91c92_release()
956 if (link->resource[2]->end) { smc91c92_release()
957 struct net_device *dev = link->priv; smc91c92_release()
961 pcmcia_disable_device(link); smc91c92_release()
1050 struct pcmcia_device *link = smc->p_dev; smc_open() local
1052 dev_dbg(&link->dev, "%s: smc_open(%p), ID/Window %4.4x.\n", smc_open()
1059 if (!pcmcia_dev_present(link)) smc_open()
1062 if (check_sig(link) < 0) { smc_open()
1066 link->open++; smc_open()
1084 struct pcmcia_device *link = smc->p_dev; smc_close() local
1087 dev_dbg(&link->dev, "%s: smc_close(), status %4.4x.\n", smc_close()
1104 link->open--; smc_close()
1331 /* Clear a link error interrupt. */ smc_eph_irq()
1658 Accept link errors, counter and Tx error interrupts. */ smc_reset()
1716 u_short link; media_check() local
1768 link = mdio_read(dev, smc->mii_if.phy_id, 1); media_check()
1769 if (!link || (link == 0xffff)) { media_check()
1775 link &= 0x0004; media_check()
1776 if (link != smc->link_status) { media_check()
1778 netdev_info(dev, "%s link beat\n", link ? "found" : "lost"); media_check()
1781 if (link) { media_check()
1788 smc->link_status = link; media_check()
1803 netdev_info(dev, "%s link beat\n", media_check()
/linux-4.1.27/kernel/
H A Duser-return-notifier.c17 hlist_add_head(&urn->link, this_cpu_ptr(&return_notifier_list)); user_return_notifier_register()
27 hlist_del(&urn->link); user_return_notifier_unregister()
41 hlist_for_each_entry_safe(urn, tmp2, head, link) fire_user_return_notifiers()
/linux-4.1.27/drivers/pnp/
H A Dcard.c65 drv->link.remove = &card_remove; card_remove_first()
323 * @clink: pointer to the card link, cannot be NULL
358 dev->dev.driver = &drv->link.driver; pnp_request_card_device()
380 drv->link.remove = &card_remove; pnp_release_card_device()
382 drv->link.remove = &card_remove_first; pnp_release_card_device()
390 struct pnp_card_link *link = dev->card_link; card_suspend() local
392 if (link->pm_state.event == state.event) card_suspend()
394 link->pm_state = state; card_suspend()
395 return link->driver->suspend(link, state); card_suspend()
400 struct pnp_card_link *link = dev->card_link; card_resume() local
402 if (link->pm_state.event == PM_EVENT_ON) card_resume()
404 link->pm_state = PMSG_ON; card_resume()
405 link->driver->resume(link); card_resume()
418 drv->link.name = drv->name; pnp_register_card_driver()
419 drv->link.id_table = NULL; /* this will disable auto matching */ pnp_register_card_driver()
420 drv->link.flags = drv->flags; pnp_register_card_driver()
421 drv->link.probe = NULL; pnp_register_card_driver()
422 drv->link.remove = &card_remove_first; pnp_register_card_driver()
423 drv->link.suspend = drv->suspend ? card_suspend : NULL; pnp_register_card_driver()
424 drv->link.resume = drv->resume ? card_resume : NULL; pnp_register_card_driver()
426 error = pnp_register_driver(&drv->link); pnp_register_card_driver()
451 pnp_unregister_driver(&drv->link); pnp_unregister_card_driver()
/linux-4.1.27/drivers/tty/
H A Dtty_mutex.c39 if (tty && tty != tty->link) tty_lock_slave()
45 if (tty && tty != tty->link) tty_unlock_slave()
H A Dpty.c54 if (!tty->link) pty_close()
56 set_bit(TTY_OTHER_CLOSED, &tty->link->flags); pty_close()
57 wake_up_interruptible(&tty->link->read_wait); pty_close()
58 wake_up_interruptible(&tty->link->write_wait); pty_close()
64 if (tty->link->driver_data) pty_close()
65 devpts_pty_kill(tty->link->driver_data); pty_close()
69 tty_vhangup(tty->link); pty_close()
85 tty_wakeup(tty->link); pty_unthrottle()
97 * end of the link as if we were an IRQ handler receiving stuff for
103 struct tty_struct *to = tty->link; pty_write()
130 return tty_buffer_space_avail(tty->link->port); pty_write_room()
176 tty->link->ctrl_status = 0; pty_set_pktmode()
202 if (tty->link) { pty_signal()
203 pgrp = tty_get_pgrp(tty->link); pty_signal()
213 struct tty_struct *to = tty->link; pty_flush_buffer()
234 if (!tty || !tty->link) pty_open()
239 if (test_bit(TTY_PTY_LOCK, &tty->link->flags)) pty_open()
241 if (tty->driver->subtype == PTY_TYPE_SLAVE && tty->link->count != 1) pty_open()
245 clear_bit(TTY_OTHER_CLOSED, &tty->link->flags); pty_open()
258 if (tty->link && tty->link->packet) { pty_set_termios()
279 wake_up_interruptible(&tty->link->read_wait); pty_set_termios()
299 struct tty_struct *pty = tty->link; pty_resize()
339 if (tty->link && tty->link->packet) { pty_start()
344 wake_up_interruptible_poll(&tty->link->read_wait, POLLIN); pty_start()
352 if (tty->link && tty->link->packet) { pty_stop()
357 wake_up_interruptible_poll(&tty->link->read_wait, POLLIN); pty_stop()
424 tty->link = o_tty; pty_common_install()
425 o_tty->link = tty; pty_common_install()
469 struct tty_struct *pair = tty->link; pty_remove()
678 ptmx_inode = tty->link->driver_data; pty_unix98_shutdown()
788 tty->link); ptmx_open()
793 tty->link->driver_data = slave_inode; ptmx_open()
/linux-4.1.27/arch/arm/xen/
H A Dp2m.c33 struct rb_node **link = &phys_to_mach.rb_node; xen_add_phys_to_mach_entry() local
38 while (*link) { xen_add_phys_to_mach_entry()
39 parent = *link; xen_add_phys_to_mach_entry()
46 link = &(*link)->rb_left; xen_add_phys_to_mach_entry()
48 link = &(*link)->rb_right; xen_add_phys_to_mach_entry()
50 rb_link_node(&new->rbnode_phys, parent, link); xen_add_phys_to_mach_entry()
/linux-4.1.27/net/netfilter/
H A Dxt_comment.c4 * 2003-05-13 Brad Fisher (brad@info-link.net)
12 MODULE_AUTHOR("Brad Fisher <brad@info-link.net>");
/linux-4.1.27/drivers/staging/comedi/drivers/
H A Dni_mio_cs.c128 struct pcmcia_device *link) ni_getboardtype()
135 if (board->device_id == link->card_id) ni_getboardtype()
160 struct pcmcia_device *link = comedi_to_pcmcia_dev(dev); mio_cs_auto_attach() local
164 board = ni_getboardtype(dev, link); mio_cs_auto_attach()
170 link->config_flags |= CONF_AUTO_SET_IO | CONF_ENABLE_IRQ; mio_cs_auto_attach()
174 dev->iobase = link->resource[0]->start; mio_cs_auto_attach()
176 link->priv = dev; mio_cs_auto_attach()
177 ret = pcmcia_request_irq(link, ni_E_interrupt); mio_cs_auto_attach()
180 dev->irq = link->irq; mio_cs_auto_attach()
202 static int cs_attach(struct pcmcia_device *link) cs_attach() argument
204 return comedi_pcmcia_auto_config(link, &driver_ni_mio_cs); cs_attach()
127 ni_getboardtype(struct comedi_device *dev, struct pcmcia_device *link) ni_getboardtype() argument
H A Dni_labpc_cs.c74 struct pcmcia_device *link = comedi_to_pcmcia_dev(dev); labpc_cs_auto_attach() local
80 link->config_flags |= CONF_AUTO_SET_IO | labpc_cs_auto_attach()
85 dev->iobase = link->resource[0]->start; labpc_cs_auto_attach()
87 if (!link->irq) labpc_cs_auto_attach()
90 return labpc_common_attach(dev, link->irq, IRQF_SHARED); labpc_cs_auto_attach()
106 static int labpc_cs_attach(struct pcmcia_device *link) labpc_cs_attach() argument
108 return comedi_pcmcia_auto_config(link, &driver_labpc_cs); labpc_cs_attach()
H A Dni_daq_dio24.c42 struct pcmcia_device *link = comedi_to_pcmcia_dev(dev); dio24_auto_attach() local
46 link->config_flags |= CONF_AUTO_SET_IO; dio24_auto_attach()
50 dev->iobase = link->resource[0]->start; dio24_auto_attach()
72 static int dio24_cs_attach(struct pcmcia_device *link) dio24_cs_attach() argument
74 return comedi_pcmcia_auto_config(link, &driver_dio24); dio24_cs_attach()
H A Ddas08_cs.c63 struct pcmcia_device *link = comedi_to_pcmcia_dev(dev); das08_cs_auto_attach() local
71 link->config_flags |= CONF_AUTO_SET_IO; das08_cs_auto_attach()
75 iobase = link->resource[0]->start; das08_cs_auto_attach()
91 static int das08_pcmcia_attach(struct pcmcia_device *link) das08_pcmcia_attach() argument
93 return comedi_pcmcia_auto_config(link, &driver_das08_cs); das08_pcmcia_attach()
H A Dcb_das16_cs.c235 struct pcmcia_device *link) das16cs_find_boardinfo()
242 if (board->device_id == link->card_id) das16cs_find_boardinfo()
252 struct pcmcia_device *link = comedi_to_pcmcia_dev(dev); das16cs_auto_attach() local
258 board = das16cs_find_boardinfo(dev, link); das16cs_auto_attach()
264 link->config_flags |= CONF_AUTO_SET_IO | CONF_ENABLE_IRQ; das16cs_auto_attach()
268 dev->iobase = link->resource[0]->start; das16cs_auto_attach()
270 link->priv = dev; das16cs_auto_attach()
332 static int das16cs_pcmcia_attach(struct pcmcia_device *link) das16cs_pcmcia_attach() argument
334 return comedi_pcmcia_auto_config(link, &driver_das16cs); das16cs_pcmcia_attach()
234 das16cs_find_boardinfo(struct comedi_device *dev, struct pcmcia_device *link) das16cs_find_boardinfo() argument
/linux-4.1.27/net/unix/
H A Dgarbage.c129 BUG_ON(!list_empty(&u->link)); unix_inflight()
130 list_add_tail(&u->link, &gc_inflight_list); unix_inflight()
132 BUG_ON(list_empty(&u->link)); unix_inflight()
149 BUG_ON(list_empty(&u->link)); unix_notinflight()
152 list_del_init(&u->link); unix_notinflight()
220 * to use the list link. scan_children()
222 BUG_ON(!list_empty(&u->link)); scan_children()
223 list_add_tail(&u->link, &embryos); scan_children()
228 u = list_entry(embryos.next, struct unix_sock, link); scan_children()
230 list_del_init(&u->link); scan_children()
253 list_move_tail(&u->link, &gc_candidates); inc_inflight_move_tail()
300 list_for_each_entry_safe(u, next, &gc_inflight_list, link) { unix_gc()
310 list_move_tail(&u->link, &gc_candidates); unix_gc()
319 list_for_each_entry(u, &gc_candidates, link) unix_gc()
326 * Use a "cursor" link, to make the list traversal safe, even unix_gc()
331 u = list_entry(cursor.next, struct unix_sock, link); unix_gc()
334 list_move(&cursor, &u->link); unix_gc()
337 list_move_tail(&u->link, &not_cycle_list); unix_gc()
348 u = list_entry(not_cycle_list.next, struct unix_sock, link); unix_gc()
350 list_move_tail(&u->link, &gc_inflight_list); unix_gc()
358 list_for_each_entry(u, &gc_candidates, link) unix_gc()
/linux-4.1.27/fs/cifs/
H A DMakefile7 link.o misc.o netmisc.o smbencrypt.o transport.o asn1.o \
/linux-4.1.27/include/sound/
H A Dsoc-dpcm.h31 * Dynamic PCM Frontend -> Backend link management states.
34 SND_SOC_DPCM_LINK_STATE_NEW = 0, /* newly created link */
35 SND_SOC_DPCM_LINK_STATE_FREE, /* link to be dismantled */
39 * Dynamic PCM Frontend -> Backend link PCM states.
68 * Dynamic PCM link
69 * This links together a FE and BE DAI at runtime and stores the link
77 /* link state */
80 /* list of BE and FE for this DPCM link */
84 /* hw params for this link - may be different for each link */
/linux-4.1.27/drivers/net/ethernet/3com/
H A D3c589_cs.c127 #define MEDIA_TP 0x00C0 /* Enable link beat and jabber for 10baseT. */
128 #define MEDIA_LED 0x0001 /* Enable link light on 3C589E cards. */
161 static int tc589_config(struct pcmcia_device *link);
162 static void tc589_release(struct pcmcia_device *link);
196 static int tc589_probe(struct pcmcia_device *link) tc589_probe() argument
201 dev_dbg(&link->dev, "3c589_attach()\n"); tc589_probe()
208 link->priv = dev; tc589_probe()
209 lp->p_dev = link; tc589_probe()
212 link->resource[0]->end = 16; tc589_probe()
213 link->resource[0]->flags |= IO_DATA_PATH_WIDTH_16; tc589_probe()
215 link->config_flags |= CONF_ENABLE_IRQ; tc589_probe()
216 link->config_index = 1; tc589_probe()
223 return tc589_config(link); tc589_probe()
226 static void tc589_detach(struct pcmcia_device *link) tc589_detach() argument
228 struct net_device *dev = link->priv; tc589_detach()
230 dev_dbg(&link->dev, "3c589_detach\n"); tc589_detach()
234 tc589_release(link); tc589_detach()
239 static int tc589_config(struct pcmcia_device *link) tc589_config() argument
241 struct net_device *dev = link->priv; tc589_config()
249 dev_dbg(&link->dev, "3c589_config\n"); tc589_config()
253 if (link->manf_id != MANFID_3COM) tc589_config()
254 dev_info(&link->dev, "hmmm, is this really a 3Com card??\n"); tc589_config()
255 multi = (link->card_id == PRODID_3COM_3C562); tc589_config()
257 link->io_lines = 16; tc589_config()
263 link->resource[0]->start = j ^ 0x300; tc589_config()
264 i = pcmcia_request_io(link); tc589_config()
271 ret = pcmcia_request_irq(link, el3_interrupt); tc589_config()
275 ret = pcmcia_enable_device(link); tc589_config()
279 dev->irq = link->irq; tc589_config()
280 dev->base_addr = link->resource[0]->start; tc589_config()
287 len = pcmcia_get_tuple(link, 0x88, &buf); tc589_config()
297 dev_err(&link->dev, "IO port conflict at 0x%03lx-0x%03lx\n", tc589_config()
314 dev_err(&link->dev, "invalid if_port requested\n"); tc589_config()
316 SET_NETDEV_DEV(dev, &link->dev); tc589_config()
319 dev_err(&link->dev, "register_netdev() failed\n"); tc589_config()
332 tc589_release(link); tc589_config()
336 static void tc589_release(struct pcmcia_device *link) tc589_release() argument
338 pcmcia_disable_device(link); tc589_release()
341 static int tc589_suspend(struct pcmcia_device *link) tc589_suspend() argument
343 struct net_device *dev = link->priv; tc589_suspend()
345 if (link->open) tc589_suspend()
351 static int tc589_resume(struct pcmcia_device *link) tc589_resume() argument
353 struct net_device *dev = link->priv; tc589_resume()
355 if (link->open) { tc589_resume()
417 /* 10baseT interface, enable link beat and jabber check. */ tc589_set_xcvr()
512 struct pcmcia_device *link = lp->p_dev; el3_open() local
514 if (!pcmcia_dev_present(link)) el3_open()
517 link->open++; el3_open()
524 dev_dbg(&link->dev, "%s: opened, status %4.4x.\n", el3_open()
737 netdev_info(dev, "%s link beat\n", media_check()
771 struct pcmcia_device *link = lp->p_dev; el3_get_stats() local
773 if (pcmcia_dev_present(link)) { el3_get_stats()
909 struct pcmcia_device *link = lp->p_dev; el3_close() local
912 dev_dbg(&link->dev, "%s: shutting down ethercard.\n", dev->name); el3_close()
914 if (pcmcia_dev_present(link)) { el3_close()
926 /* Disable link beat and jabber */ el3_close()
941 link->open--; el3_close()
H A D3c574_cs.c114 /* Autodetect link polarity reversal? */
195 #define MEDIA_TP 0x00C0 /* Enable link beat and jabber for 10baseT. */
217 static int tc574_config(struct pcmcia_device *link);
218 static void tc574_release(struct pcmcia_device *link);
262 static int tc574_probe(struct pcmcia_device *link) tc574_probe() argument
267 dev_dbg(&link->dev, "3c574_attach()\n"); tc574_probe()
274 link->priv = dev; tc574_probe()
275 lp->p_dev = link; tc574_probe()
278 link->resource[0]->end = 32; tc574_probe()
279 link->resource[0]->flags |= IO_DATA_PATH_WIDTH_16; tc574_probe()
280 link->config_flags |= CONF_ENABLE_IRQ; tc574_probe()
281 link->config_index = 1; tc574_probe()
286 return tc574_config(link); tc574_probe()
289 static void tc574_detach(struct pcmcia_device *link) tc574_detach() argument
291 struct net_device *dev = link->priv; tc574_detach()
293 dev_dbg(&link->dev, "3c574_detach()\n"); tc574_detach()
297 tc574_release(link); tc574_detach()
304 static int tc574_config(struct pcmcia_device *link) tc574_config() argument
306 struct net_device *dev = link->priv; tc574_config()
318 dev_dbg(&link->dev, "3c574_config()\n"); tc574_config()
320 link->io_lines = 16; tc574_config()
323 link->resource[0]->start = j ^ 0x300; tc574_config()
324 i = pcmcia_request_io(link); tc574_config()
331 ret = pcmcia_request_irq(link, el3_interrupt); tc574_config()
335 ret = pcmcia_enable_device(link); tc574_config()
339 dev->irq = link->irq; tc574_config()
340 dev->base_addr = link->resource[0]->start; tc574_config()
348 len = pcmcia_get_tuple(link, 0x88, &buf); tc574_config()
364 if (link->prod_id[1]) tc574_config()
365 cardname = link->prod_id[1]; tc574_config()
402 dev_dbg(&link->dev, " MII transceiver at " tc574_config()
424 SET_NETDEV_DEV(dev, &link->dev); tc574_config()
441 tc574_release(link); tc574_config()
446 static void tc574_release(struct pcmcia_device *link) tc574_release() argument
448 pcmcia_disable_device(link); tc574_release()
451 static int tc574_suspend(struct pcmcia_device *link) tc574_suspend() argument
453 struct net_device *dev = link->priv; tc574_suspend()
455 if (link->open) tc574_suspend()
461 static int tc574_resume(struct pcmcia_device *link) tc574_resume() argument
463 struct net_device *dev = link->priv; tc574_resume()
465 if (link->open) { tc574_resume()
676 struct pcmcia_device *link = lp->p_dev; el3_open() local
678 if (!pcmcia_dev_present(link)) el3_open()
681 link->open++; el3_open()
690 dev_dbg(&link->dev, "%s: opened, status %4.4x.\n", el3_open()
901 netdev_info(dev, "%s link beat\n", media_check()
915 netdev_info(dev, "link partner did not autonegotiate\n"); media_check()
1120 struct pcmcia_device *link = lp->p_dev; el3_close() local
1122 dev_dbg(&link->dev, "%s: shutting down ethercard.\n", dev->name); el3_close()
1124 if (pcmcia_dev_present(link)) { el3_close()
1144 link->open--; el3_close()
/linux-4.1.27/drivers/infiniband/hw/usnic/
H A Dusnic_uiom_interval_tree.c40 #define MARK_FOR_ADD(node, list) (list_add_tail(&node->link, list))
75 node_a = list_entry(a, struct usnic_uiom_interval_node, link); interval_cmp()
76 node_b = list_entry(b, struct usnic_uiom_interval_node, link); interval_cmp()
99 list_add_tail(&node->link, list); find_intervals_intersection_sorted()
119 list_for_each_entry(interval, &intersection_set, link) { usnic_uiom_get_intervals_diff()
148 list_for_each_entry_safe(interval, tmp, diff_set, link) { list_for_each_entry_safe()
149 list_del(&interval->link); list_for_each_entry_safe()
159 list_for_each_entry_safe(interval, tmp, intervals, link) usnic_uiom_put_interval_set()
177 list_for_each_entry(interval, &intersection_set, link) { usnic_uiom_insert_interval()
217 list_for_each_entry_safe(interval, tmp, &intersection_set, link) { usnic_uiom_insert_interval()
222 list_for_each_entry(interval, &to_add, link) usnic_uiom_insert_interval()
228 list_for_each_entry_safe(interval, tmp, &to_add, link) usnic_uiom_insert_interval()
245 list_add_tail(&interval->link, removed); usnic_uiom_remove_interval()
248 list_for_each_entry(interval, removed, link) usnic_uiom_remove_interval()
/linux-4.1.27/arch/mips/include/asm/octeon/
H A Dcvmx-helper-rgmii.h68 * Return the link state of an IPD/PKO port as returned by
70 * Octeon's link config if auto negotiation has changed since
80 * Configure an IPD/PKO port for the specified link state. This
82 * The passed link state must always match the link state returned
87 * @link_info: The new link state
H A Dcvmx-helper-sgmii.h62 * Return the link state of an IPD/PKO port as returned by
64 * Octeon's link config if auto negotiation has changed since
74 * Configure an IPD/PKO port for the specified link state. This
76 * The passed link state must always match the link state returned
81 * @link_info: The new link state
H A Dcvmx-helper-spi.h59 * Return the link state of an IPD/PKO port as returned by
61 * Octeon's link config if auto negotiation has changed since
71 * Configure an IPD/PKO port for the specified link state. This
73 * The passed link state must always match the link state returned
78 * @link_info: The new link state
H A Dcvmx-helper-xaui.h62 * Return the link state of an IPD/PKO port as returned by
64 * Octeon's link config if auto negotiation has changed since
74 * Configure an IPD/PKO port for the specified link state. This
76 * The passed link state must always match the link state returned
81 * @link_info: The new link state
H A Dcvmx-helper.h58 uint64_t link_up:1; /**< Is the physical link up? */
59 uint64_t full_duplex:1; /**< 1 if the link is full duplex */
60 uint64_t speed:18; /**< Speed of the link in Mbps */
159 * Auto configure an IPD/PKO port link state and speed. This
170 * Return the link state of an IPD/PKO port as returned by
172 * Octeon's link config if auto negotiation has changed since
182 * Configure an IPD/PKO port for the specified link state. This
184 * The passed link state must always match the link state returned
189 * @link_info: The new link state
/linux-4.1.27/include/media/
H A Dv4l2-of.h73 * struct v4l2_of_link - a link between two endpoints
90 struct v4l2_of_link *link);
91 void v4l2_of_put_link(struct v4l2_of_link *link);
95 struct v4l2_of_endpoint *link) v4l2_of_parse_endpoint()
101 struct v4l2_of_link *link) v4l2_of_parse_link()
106 static inline void v4l2_of_put_link(struct v4l2_of_link *link) v4l2_of_put_link() argument
94 v4l2_of_parse_endpoint(const struct device_node *node, struct v4l2_of_endpoint *link) v4l2_of_parse_endpoint() argument
100 v4l2_of_parse_link(const struct device_node *node, struct v4l2_of_link *link) v4l2_of_parse_link() argument
H A Dmedia-entity.h49 * @link_setup: Notify the entity of link changes. The operation can
50 * return an error, in which case link setup will be
52 * @link_validate: Return whether a link is valid from the entity point of
60 int (*link_validate)(struct media_link *link);
122 int link; member in struct:media_entity_graph::__anon12568
138 int __media_entity_setup_link(struct media_link *link, u32 flags);
139 int media_entity_setup_link(struct media_link *link, u32 flags);
/linux-4.1.27/drivers/gpu/drm/nouveau/nvkm/subdev/mxm/
H A Dnv50.c68 * connection enum values to SOR/link mxm_match_dcb()
72 u8 link = mxm_sor_map(bios, ctx->desc.dig_conn); mxm_match_dcb() local
73 if ((ctx->outp[0] & 0x0f000000) != (link & 0x0f) << 24) mxm_match_dcb()
76 /* check dcb entry has a compatible link field */ mxm_match_dcb()
77 link = (link & 0x30) >> 4; mxm_match_dcb()
78 if ((link & ((ctx->outp[1] & 0x00000030) >> 4)) != link) mxm_match_dcb()
103 u8 type, i2cidx, link, ver, len; mxm_dcb_sanitise_entry() local
131 /* override dcb sorconf.link, based on what mxm data says */ mxm_dcb_sanitise_entry()
137 link = mxm_sor_map(bios, ctx.desc.dig_conn) & 0x30; mxm_dcb_sanitise_entry()
139 ctx.outp[1] |= link; mxm_dcb_sanitise_entry()
156 /* XXX: modify default link width in LVDS table */ mxm_dcb_sanitise_entry()
/linux-4.1.27/security/apparmor/
H A Dfile.c312 * @link: link permission set
315 * test target x permissions are equal OR a subset of link x permissions
321 static inline bool xindex_is_subset(u32 link, u32 target) xindex_is_subset() argument
323 if (((link & ~AA_X_UNSAFE) != (target & ~AA_X_UNSAFE)) || xindex_is_subset()
324 ((link & AA_X_UNSAFE) && !(target & AA_X_UNSAFE))) xindex_is_subset()
331 * aa_path_link - Handle hard link permission check
334 * @new_dir: directory the new link will be created in (NOT NULL)
335 * @new_dentry: the link being created (NOT NULL)
337 * Handle the permission test for a link & target pair. Permission
338 * is encoded as a pair where the link permission is determined
340 * is done from the point of the link match (not start of DFA)
341 * making the target permission dependent on the link permission match.
344 * on link are a subset of the permission granted to target.
351 struct path link = { new_dir->mnt, new_dentry }; aa_path_link() local
367 error = aa_path_name(&link, profile->path_flags, &buffer, &lname, aa_path_link()
386 /* test to see if target can be paired with link */ aa_path_link()
390 /* force audit/quiet masks for link are stored in the second entry aa_path_link()
391 * in the link pair. aa_path_link()
402 /* done if link subset test is not required */ aa_path_link()
406 /* Do link perm subset test requiring allowed permission on link are a aa_path_link()
423 info = "link not subset of target"; aa_path_link()
/linux-4.1.27/drivers/net/wireless/ti/wl18xx/
H A Dwl18xx.h86 /* number of packets to queue up for a link in PS */
89 /* number of packet to queue up for a suspended link */
93 * link to qualify as high priority link
98 * link to qualify as high priority link
103 * link before we stop queuing up packets for it.
108 * link before we stop queuing up packets for it.
/linux-4.1.27/drivers/gpu/drm/
H A Ddrm_dp_helper.c42 /* Helpers for DP link training */ dp_link_status()
270 * drm_dp_dpcd_read_link_status() - read DPCD link status (bytes 0x202-0x207)
272 * @status: buffer to store the link status in (must be at least 6 bytes)
286 * drm_dp_link_probe() - probe a DisplayPort link for capabilities
288 * @link: pointer to structure in which to return link capabilities
292 * configure the link based on the link's capabilities.
296 int drm_dp_link_probe(struct drm_dp_aux *aux, struct drm_dp_link *link) drm_dp_link_probe() argument
301 memset(link, 0, sizeof(*link)); drm_dp_link_probe()
307 link->revision = values[0]; drm_dp_link_probe()
308 link->rate = drm_dp_bw_code_to_link_rate(values[1]); drm_dp_link_probe()
309 link->num_lanes = values[2] & DP_MAX_LANE_COUNT_MASK; drm_dp_link_probe()
312 link->capabilities |= DP_LINK_CAP_ENHANCED_FRAMING; drm_dp_link_probe()
319 * drm_dp_link_power_up() - power up a DisplayPort link
321 * @link: pointer to a structure containing the link configuration
325 int drm_dp_link_power_up(struct drm_dp_aux *aux, struct drm_dp_link *link) drm_dp_link_power_up() argument
331 if (link->revision < 0x11) drm_dp_link_power_up()
357 * drm_dp_link_power_down() - power down a DisplayPort link
359 * @link: pointer to a structure containing the link configuration
363 int drm_dp_link_power_down(struct drm_dp_aux *aux, struct drm_dp_link *link) drm_dp_link_power_down() argument
369 if (link->revision < 0x11) drm_dp_link_power_down()
388 * drm_dp_link_configure() - configure a DisplayPort link
390 * @link: pointer to a structure containing the link configuration
394 int drm_dp_link_configure(struct drm_dp_aux *aux, struct drm_dp_link *link) drm_dp_link_configure() argument
399 values[0] = drm_dp_link_rate_to_bw_code(link->rate); drm_dp_link_configure()
400 values[1] = link->num_lanes; drm_dp_link_configure()
402 if (link->capabilities & DP_LINK_CAP_ENHANCED_FRAMING) drm_dp_link_configure()
/linux-4.1.27/drivers/gpu/drm/nouveau/include/nvkm/subdev/bios/
H A Ddcb.h25 uint8_t link; member in struct:dcb_output
30 int link; member in struct:dcb_output::__anon4113::sor_conf
H A Dvmap.h12 u8 link; member in struct:nvbios_vmap_entry
/linux-4.1.27/fs/ncpfs/
H A Dsymlink.c7 * the file to make sure we don't accidentally use a non-link file
8 * as a link.
40 /* ----- read a symbolic link ------------------------------------------ */
46 char *link, *rawlink; ncp_symlink_readpage() local
71 link = rawlink + 8; ncp_symlink_readpage()
74 link = rawlink; ncp_symlink_readpage()
78 error = ncp_vol2io(NCP_SERVER(inode), buf, &len, link, length, 0); ncp_symlink_readpage()
104 /* ----- create a new symbolic link -------------------------------------- */
/linux-4.1.27/arch/powerpc/sysdev/
H A Dfsl_soc.h27 FSL_DIU_PORT_LVDS, /* Single-link LVDS */ get_baudrate()
28 FSL_DIU_PORT_DLVDS /* Dual-link LVDS */ get_baudrate()
/linux-4.1.27/sound/soc/fsl/
H A Dfsl_dma.h17 __be32 eclndar; /* Current link descriptor extended addr reg */
18 __be32 clndar; /* Current link descriptor address register */
24 __be32 enlndar; /* Next link descriptor extended address reg */
25 __be32 nlndar; /* Next link descriptor address register */
103 * list descriptor points to a linked-list of link Descriptors.
107 __be64 first_link; /* Address of first link descriptor */
116 * A Link Descriptor points to a single DMA buffer. Each link descriptor
124 __be64 next; /* Address of next link descriptor */
H A Dfsl_dma.c79 * The link[] array is first because it needs to be aligned on a 32-byte
83 * @link[]: array of link descriptors
89 * @current_link: index into link[] of the link currently being processed
97 struct fsl_dma_link_descriptor link[NUM_DMA_LINKS]; member in struct:fsl_dma_private
123 * Since each link descriptor has a 32-bit byte count field, we set
160 * As each period is completed, this function changes the the link
165 struct fsl_dma_link_descriptor *link = fsl_dma_update_pointers() local
166 &dma_private->link[dma_private->current_link]; fsl_dma_update_pointers()
168 /* Update our link descriptors to point to the next period. On a 36-bit fsl_dma_update_pointers()
173 link->source_addr = cpu_to_be32(dma_private->dma_buf_next); fsl_dma_update_pointers()
175 link->source_attr = cpu_to_be32(CCSR_DMA_ATR_SNOOP | fsl_dma_update_pointers()
179 link->dest_addr = cpu_to_be32(dma_private->dma_buf_next); fsl_dma_update_pointers()
181 link->dest_attr = cpu_to_be32(CCSR_DMA_ATR_SNOOP | fsl_dma_update_pointers()
247 * Update our link descriptors to point to the next period. We fsl_dma_isr()
328 * ALSA divides the DMA buffer into N periods. We create NUM_DMA_LINKS link
330 * there are six periods and two link descriptors, this is how they look
333 * The last link descriptor
365 * The first link descriptor now points to the third period. The DMA
375 * controller can generate an interrupt at the end of every link transfer
378 * 3. By creating only two link descriptors, regardless of the number of
379 * periods, we do not need to reallocate the link descriptors if the
383 * contiguous parts, and creating a link descriptor for each one.
395 u64 temp_link; /* Pointer to next link descriptor */ fsl_dma_open()
462 dma_private->link[i].next = cpu_to_be64(temp_link); fsl_dma_open()
466 /* The last link descriptor points to the first */ fsl_dma_open()
467 dma_private->link[i - 1].next = cpu_to_be64(dma_private->ld_buf_phys); fsl_dma_open()
469 /* Tell the DMA controller where the first link descriptor is */ fsl_dma_open()
492 * an interrupt at the end of each segment (each link descriptor fsl_dma_open()
644 struct fsl_dma_link_descriptor *link = &dma_private->link[i]; fsl_dma_hw_params() local
646 link->count = cpu_to_be32(period_size); fsl_dma_hw_params()
666 link->source_addr = cpu_to_be32(temp_addr); fsl_dma_hw_params()
667 link->source_attr = cpu_to_be32(CCSR_DMA_ATR_SNOOP | fsl_dma_hw_params()
670 link->dest_addr = cpu_to_be32(ssi_sxx_phys); fsl_dma_hw_params()
671 link->dest_attr = cpu_to_be32(CCSR_DMA_ATR_NOSNOOP | fsl_dma_hw_params()
674 link->source_addr = cpu_to_be32(ssi_sxx_phys); fsl_dma_hw_params()
675 link->source_attr = cpu_to_be32(CCSR_DMA_ATR_NOSNOOP | fsl_dma_hw_params()
678 link->dest_addr = cpu_to_be32(temp_addr); fsl_dma_hw_params()
679 link->dest_attr = cpu_to_be32(CCSR_DMA_ATR_SNOOP | fsl_dma_hw_params()
699 * first link descriptor.
/linux-4.1.27/arch/mips/cavium-octeon/executive/
H A Dcvmx-helper-sgmii.c119 pcsx_sgmx_an_adv_reg.s.link = 1; __cvmx_helper_sgmii_hardware_init_one_time()
133 * Initialize the SERTES link for the first time or after a loss
134 * of link.
182 * isn't an ethernet link, but a link between Octeon and the __cvmx_helper_sgmii_hardware_init_link()
189 /* cvmx_dprintf("SGMII%d: Port %d link timeout\n", interface, index); */ __cvmx_helper_sgmii_hardware_init_link()
196 * Configure an SGMII link to the specified speed after the SERTES
197 * link is up.
244 * Use GMXENO to force the link down if the status we get says __cvmx_helper_sgmii_hardware_init_link_speed()
249 /* Only change the duplex setting if the link is up */ __cvmx_helper_sgmii_hardware_init_link_speed()
321 * proper link state. In the simulator there is no __cvmx_helper_sgmii_hardware_init()
322 * link state polling and hence it is set from __cvmx_helper_sgmii_hardware_init()
392 * Return the link state of an IPD/PKO port as returned by
394 * Octeon's link config if auto negotiation has changed since
412 /* The simulator gives you a simulated 1Gbps full duplex link */ __cvmx_helper_sgmii_link_get()
422 /* Force 1Gbps full duplex link for internal loopback */ __cvmx_helper_sgmii_link_get()
445 * level link is down __cvmx_helper_sgmii_link_get()
487 * complete. Return link down. __cvmx_helper_sgmii_link_get()
501 * Configure an IPD/PKO port for the specified link state. This
503 * The passed link state must always match the link state returned
508 * @link_info: The new link state
H A Dcvmx-helper-spi.c136 * Return the link state of an IPD/PKO port as returned by
138 * Octeon's link config if auto negotiation has changed since
153 /* The simulator gives you a simulated full duplex link */ __cvmx_helper_spi_link_get()
178 /* For generic SPI we can't determine the link, just return some __cvmx_helper_spi_link_get()
188 * Configure an IPD/PKO port for the specified link state. This
190 * The passed link state must always match the link state returned
195 * @link_info: The new link state
202 by cvmx_spi4000_check_speed(). If not then there isn't any link __cvmx_helper_spi_link_set()
H A Dcvmx-helper-xaui.c207 /* Wait for receive link */ __cvmx_helper_xaui_enable()
246 * Return the link state of an IPD/PKO port as returned by
248 * Octeon's link config if auto negotiation has changed since
269 /* Only return a link if both RX and TX are happy */ __cvmx_helper_xaui_link_get()
285 * Configure an IPD/PKO port for the specified link state. This
287 * The passed link state must always match the link state returned
292 * @link_info: The new link state
305 /* If the link shouldn't be up, then just return */ __cvmx_helper_xaui_link_set()
313 /* Bring the link up */ __cvmx_helper_xaui_link_set()
352 /* Take the link through a reset */ __cvmx_helper_xaui_configure_loopback()
/linux-4.1.27/arch/x86/boot/
H A Dstring.h15 * do "undef memcpy" in .c file and link against right string.c
/linux-4.1.27/fs/ocfs2/
H A Dsymlink.c63 const char *link; ocfs2_fast_symlink_readpage() local
73 link = (char *) fe->id2.i_symlink; ocfs2_fast_symlink_readpage()
75 len = strnlen(link, ocfs2_fast_symlink_chars(inode->i_sb)); ocfs2_fast_symlink_readpage()
77 memcpy(kaddr, link, len + 1); ocfs2_fast_symlink_readpage()
/linux-4.1.27/fs/isofs/
H A Drock.h51 struct SL_component link; member in struct:RR_SL_s
117 #define RR_SL 4 /* Symbolic link */
119 #define RR_CL 16 /* Child link */
120 #define RR_PL 32 /* Parent link */
/linux-4.1.27/include/net/caif/
H A Dcfcnfg.h57 * @dev: Pointer to link layer device
60 * @pref: The phy (link layer) preference.
61 * @link_support: Protocol implementation for link layer specific protocol.
63 * @head_room: Head space needed by link specific protocol.
/linux-4.1.27/arch/ia64/include/asm/
H A Dftrace.h11 /* In IA64, MCOUNT_ADDR is set in link time, so it's not a constant at compile time */
/linux-4.1.27/arch/arm/include/asm/
H A Dinsn.h15 __arm_gen_branch(unsigned long pc, unsigned long addr, bool link);
/linux-4.1.27/fs/fscache/
H A Dnetfs.c29 INIT_LIST_HEAD(&netfs->link); __fscache_register_netfs()
60 list_for_each_entry(ptr, &fscache_netfs_list, link) { __fscache_register_netfs()
65 list_add(&netfs->link, &fscache_netfs_list); __fscache_register_netfs()
94 list_del(&netfs->link); __fscache_unregister_netfs()
/linux-4.1.27/mm/
H A Dinterval_tree.c33 struct rb_node **link; vma_interval_tree_insert_after() local
41 link = &prev->shared.rb.rb_right; vma_interval_tree_insert_after()
53 link = &parent->shared.rb.rb_left; vma_interval_tree_insert_after()
57 rb_link_node(&node->shared.rb, &parent->shared.rb, link); vma_interval_tree_insert_after()
/linux-4.1.27/drivers/staging/ozwpan/
H A Dozeltbuf.c47 INIT_LIST_HEAD(&ei->link); oz_elt_info_alloc()
71 list_for_each_entry_safe(ei, n, list->next, link) oz_elt_info_free_chain()
90 list_add_tail(&st->link, &buf->stream_list); oz_elt_stream_create()
103 st = list_entry(e, struct oz_elt_stream, link); oz_elt_stream_delete()
116 list_entry(e, struct oz_elt_info, link); oz_elt_stream_delete()
117 list_del_init(&ei->link); oz_elt_stream_delete()
156 st = list_entry(e, struct oz_elt_stream, link); oz_queue_elt_info()
186 list_add_tail(&ei->link, &st->elt_list); oz_queue_elt_info()
195 struct oz_elt_info, link); oz_queue_elt_info()
196 list_del_init(&ei2->link); oz_queue_elt_info()
229 list_del(&ei->link); list_for_each_entry_safe()
239 list_add_tail(&ei->link, list); list_for_each_entry_safe()
H A Dozpd.h35 struct list_head link; member in struct:oz_tx_frame
43 struct list_head link; member in struct:oz_isoc_stream
53 struct list_head link; member in struct:oz_farewell
63 struct list_head link; member in struct:oz_pd
H A Dozpd.c155 oz_isoc_stream_free(list_entry(e, struct oz_isoc_stream, link)); oz_pd_free()
158 struct oz_tx_frame *f = list_entry(e, struct oz_tx_frame, link); oz_pd_free()
168 kfree(list_entry(e, struct oz_farewell, link)); oz_pd_free()
280 list_del(&pd->link); oz_pd_stop()
325 INIT_LIST_HEAD(&f->link); oz_tx_frame_alloc()
337 list_del_init(&f->link); oz_tx_isoc_free()
399 list_add_tail(&f->link, &pd->tx_queue); oz_prepare_frame()
439 list_for_each_entry(ei, &f->elt_list, link) { oz_build_frame()
456 list_for_each_entry_safe(ei, n, &f->elt_list, link) { oz_retire_frame()
457 list_del_init(&ei->link); oz_retire_frame()
482 f = list_entry(e, struct oz_tx_frame, link); oz_send_next_queued_frame()
597 list_for_each_entry(ei, &list, link) { oz_send_isoc_frame()
618 list_for_each_entry(f, &pd->tx_queue, link) { oz_retire_tx_frames()
629 list_cut_position(&list, &pd->tx_queue, &tmp->link); oz_retire_tx_frames()
633 list_for_each_entry_safe(f, tmp, &list, link) oz_retire_tx_frames()
645 list_for_each_entry(st, &pd->stream_list, link) { pd_stream_find()
665 list_add(&st->link, &pd->stream_list); oz_isoc_stream_create()
692 list_del(&st->link); oz_isoc_stream_delete()
790 list_for_each_entry(f, &pd->tx_queue, link) { oz_send_isoc_unit()
804 list_add_tail(&isoc_unit->link, &pd->tx_queue); oz_send_isoc_unit()
879 struct oz_farewell, link); oz_pd_indicate_farewells()
880 list_del(&f->link); oz_pd_indicate_farewells()
H A Dozeltbuf.h17 struct list_head link; member in struct:oz_elt_stream
28 struct list_head link; member in struct:oz_elt_info
/linux-4.1.27/arch/tile/include/arch/
H A Dtrio_pcie_intfc.h47 /* Determines how link is trained. */
54 * during link training. When 0, RX Lane0 must be wired to the link
57 * NOT have to be wired to the link partner.
63 * during link training. When 0, TX Lane0 must be wired to the link
66 * NOT have to be wired to the link partner.
117 * Indicates the number of times the link has gone down. Clears on read.
192 * initial credit value from the link partner is smaller than this value
193 * when the link comes up, the value will be reset to the initial credit
202 * initial credit value from the link partner is smaller than this value
203 * when the link comes up, the value will be reset to the initial credit
/linux-4.1.27/drivers/gpu/drm/nouveau/nvkm/engine/disp/
H A Doutpdp.c38 u8 link[2], stat[3]; nvkm_output_dp_train() local
42 /* check that the link is trained at a high enough rate */ nvkm_output_dp_train()
43 ret = nv_rdaux(outp->base.edid, DPCD_LC00_LINK_BW_SET, link, 2); nvkm_output_dp_train()
45 DBG("failed to read link config, assuming no sink\n"); nvkm_output_dp_train()
49 linkrate = link[0] * 27000 * (link[1] & DPCD_LC01_LANE_COUNT_SET); nvkm_output_dp_train()
53 DBG("link not trained at sufficient rate\n"); nvkm_output_dp_train()
57 /* check that link is still trained */ nvkm_output_dp_train()
60 DBG("failed to read link status, assuming no sink\n"); nvkm_output_dp_train()
65 for (i = 0; i < (link[1] & DPCD_LC01_LANE_COUNT_SET); i++) { nvkm_output_dp_train()
250 /* link training */ nvkm_output_dp_create_()
255 /* link maintenance */ nvkm_output_dp_create_()
H A Ddport.c35 * link training
69 /* set desired link configuration on the source */ dp_set_link_config()
95 /* set desired link configuration on the sink */ dp_set_link_config()
347 /* restrict link config to the lowest required rate, if requested */ nvkm_dp_train()
355 /* disable link interrupt handling during link training */ nvkm_dp_train()
369 /* program selected link configuration */ nvkm_dp_train()
372 /* attempt to train the link at this configuration */ nvkm_dp_train()
386 /* finish link training and execute post-train script from vbios */ nvkm_dp_train()
389 ERR("link training failed\n"); nvkm_dp_train()
393 /* signal completion and enable link interrupt handling */ nvkm_dp_train()
/linux-4.1.27/drivers/net/ethernet/intel/e1000e/
H A Dmac.c407 * e1000e_check_for_copper_link - Check for link (Copper)
410 * Checks to see of the link status of the hardware has changed. If a
411 * change in link status has been detected, then we read the PHY registers
412 * to get the current speed/duplex if link exists.
418 bool link; e1000e_check_for_copper_link() local
421 * has completed and/or if our link status has changed. The e1000e_check_for_copper_link()
429 * link. If so, then we want to get the current speed/duplex e1000e_check_for_copper_link()
432 ret_val = e1000e_phy_has_link_generic(hw, 1, 0, &link); e1000e_check_for_copper_link()
436 if (!link) e1000e_check_for_copper_link()
437 return 0; /* No link detected */ e1000e_check_for_copper_link()
442 * immediately after link-up e1000e_check_for_copper_link()
447 * we have already determined whether we have link or not. e1000e_check_for_copper_link()
461 * different link partner. e1000e_check_for_copper_link()
471 * e1000e_check_for_fiber_link - Check for link (Fiber)
474 * Checks for link up on the hardware. If link is not up and we have
475 * a signal, then we need to force link up.
489 /* If we don't have link (auto-negotiation failed or link partner e1000e_check_for_fiber_link()
491 * and our link partner is not trying to auto-negotiate with us (we e1000e_check_for_fiber_link()
492 * are receiving idles or data), we need to force link up. We also e1000e_check_for_fiber_link()
503 e_dbg("NOT Rx'ing /C/, disable AutoNeg and force link.\n"); e1000e_check_for_fiber_link()
508 /* Force link-up and also force full-duplex. */ e1000e_check_for_fiber_link()
513 /* Configure Flow Control after forcing link up. */ e1000e_check_for_fiber_link()
520 /* If we are forcing link and we are receiving /C/ ordered e1000e_check_for_fiber_link()
522 * and disable forced link in the Device Control register e1000e_check_for_fiber_link()
523 * in an attempt to auto-negotiate with our link partner. e1000e_check_for_fiber_link()
525 e_dbg("Rx'ing /C/, enable AutoNeg and stop forcing link.\n"); e1000e_check_for_fiber_link()
536 * e1000e_check_for_serdes_link - Check for link (Serdes)
539 * Checks for link up on the hardware. If link is not up and we have
540 * a signal, then we need to force link up.
554 /* If we don't have link (auto-negotiation failed or link partner e1000e_check_for_serdes_link()
555 * cannot auto-negotiate), and our link partner is not trying to e1000e_check_for_serdes_link()
557 * we need to force link up. We also need to give auto-negotiation e1000e_check_for_serdes_link()
566 e_dbg("NOT Rx'ing /C/, disable AutoNeg and force link.\n"); e1000e_check_for_serdes_link()
571 /* Force link-up and also force full-duplex. */ e1000e_check_for_serdes_link()
576 /* Configure Flow Control after forcing link up. */ e1000e_check_for_serdes_link()
583 /* If we are forcing link and we are receiving /C/ ordered e1000e_check_for_serdes_link()
585 * and disable forced link in the Device Control register e1000e_check_for_serdes_link()
586 * in an attempt to auto-negotiate with our link partner. e1000e_check_for_serdes_link()
588 e_dbg("Rx'ing /C/, enable AutoNeg and stop forcing link.\n"); e1000e_check_for_serdes_link()
594 /* If we force link for non-auto-negotiation switch, check e1000e_check_for_serdes_link()
595 * link status based on MAC synchronization for internal e1000e_check_for_serdes_link()
677 * e1000e_setup_link_generic - Setup flow control and link settings
681 * control. Calls the appropriate media-specific link configuration
682 * function. Assuming the adapter has a valid link partner, a valid link
690 /* In the case of the phy reset being blocked, we already have a link. e1000e_setup_link_generic()
706 * on the link partner's capabilities, we may or may not use this mode. e1000e_setup_link_generic()
712 /* Call the necessary media_type subroutine to configure the link. */ e1000e_setup_link_generic()
799 * e1000_poll_fiber_serdes_link_generic - Poll for link up
802 * Polls for link up by reading the status register, if link fails to come
803 * up with auto-negotiation, then the link is forced if a signal is detected.
813 * Status Register. Time-out if a link isn't seen in 500 milliseconds e1000_poll_fiber_serdes_link_generic()
824 e_dbg("Never got a valid link from auto-neg!!!\n"); e1000_poll_fiber_serdes_link_generic()
826 /* AutoNeg failed to achieve a link, so we'll call e1000_poll_fiber_serdes_link_generic()
828 * link up if we detect a signal. This will allow us to e1000_poll_fiber_serdes_link_generic()
829 * communicate with non-autonegotiating link partners. e1000_poll_fiber_serdes_link_generic()
833 e_dbg("Error while checking for link\n"); e1000_poll_fiber_serdes_link_generic()
846 * e1000e_setup_fiber_serdes_link - Setup link for fiber/serdes
850 * links. Upon successful setup, poll for link.
859 /* Take the link out of reset */ e1000e_setup_fiber_serdes_link()
868 /* Since auto-negotiation is enabled, take the link out of reset (the e1000e_setup_fiber_serdes_link()
869 * link will be in reset, because we previously reset the chip). This e1000e_setup_fiber_serdes_link()
871 * then the link-up status bit will be set and the flow control enable e1000e_setup_fiber_serdes_link()
899 * during link setup.
957 * also configure these bits when link is forced on a fiber connection.
965 /* Because we didn't get link via the internal auto-negotiation e1000e_force_mac_fc()
966 * mechanism (we either forced link or we got link via PHY e1000e_force_mac_fc()
1010 * e1000e_config_fc_after_link_up - Configures flow control after link
1013 * Checks the status of auto-negotiation after link up to ensure that the
1014 * speed and duplex were not forced. If the link needed to be forced, then
1016 * and did not fail, then we configure flow control based on our link
1028 * so we had to force link. In this case, we need to force the e1000e_config_fc_after_link_up()
1047 * has completed, and if so, how the PHY and link partner has e1000e_config_fc_after_link_up()
1083 * for both the PHY and the link partner. The following e1000e_config_fc_after_link_up()
1170 e_dbg("Error getting link speed and duplex\n"); e1000e_config_fc_after_link_up()
1189 * has completed, and if so, how the PHY and link partner has e1000e_config_fc_after_link_up()
1216 * for both the PHY and the link partner. The following e1000e_config_fc_after_link_up()
H A Dphy.c637 * e1000_copper_link_setup_82577 - Setup 82577 PHY for copper link
690 * e1000e_copper_link_setup_m88 - Setup m88 PHY's for copper link
836 * e1000e_copper_link_setup_igp - Setup igp PHY's for copper link
1078 * e1000_copper_link_autoneg - Setup/Enable autoneg for copper link
1083 * and restart the negotiation process between the link partner. If
1140 * e1000e_setup_copper_link - Configure copper link settings
1143 * Calls the appropriate function to configure the link for auto-neg or forced
1144 * speed and duplex. Then we check for link, once link is established calls
1145 * to configure collision distance and flow control are called. If link is
1151 bool link; e1000e_setup_copper_link() local
1172 /* Check link status. Wait up to 100 microseconds for link to become e1000e_setup_copper_link()
1176 &link); e1000e_setup_copper_link()
1180 if (link) { e1000e_setup_copper_link()
1181 e_dbg("Valid link established!!!\n"); e1000e_setup_copper_link()
1185 e_dbg("Unable to establish link!!!\n"); e1000e_setup_copper_link()
1196 * auto-crossover to force MDI manually. Waits for link and returns
1197 * successful if link up is successful, else -E1000_ERR_PHY (-2).
1204 bool link; e1000e_phy_force_speed_duplex_igp() local
1235 e_dbg("Waiting for forced speed/duplex link on IGP phy.\n"); e1000e_phy_force_speed_duplex_igp()
1238 100000, &link); e1000e_phy_force_speed_duplex_igp()
1242 if (!link) e1000e_phy_force_speed_duplex_igp()
1247 100000, &link); e1000e_phy_force_speed_duplex_igp()
1259 * changes. If time expires while waiting for link up, we reset the DSP.
1268 bool link; e1000e_phy_force_speed_duplex_m88() local
1302 e_dbg("Waiting for forced speed/duplex link on M88 phy.\n"); e1000e_phy_force_speed_duplex_m88()
1305 100000, &link); e1000e_phy_force_speed_duplex_m88()
1309 if (!link) { e1000e_phy_force_speed_duplex_m88()
1313 /* We didn't get link. e1000e_phy_force_speed_duplex_m88()
1328 100000, &link); e1000e_phy_force_speed_duplex_m88()
1375 bool link; e1000_phy_force_speed_duplex_ife() local
1404 e_dbg("Waiting for forced speed/duplex link on IFE phy.\n"); e1000_phy_force_speed_duplex_ife()
1407 100000, &link); e1000_phy_force_speed_duplex_ife()
1411 if (!link) e1000_phy_force_speed_duplex_ife()
1416 100000, &link); e1000_phy_force_speed_duplex_ife()
1484 * e1000e_set_d3_lplu_state - Sets low power link up state for D3
1490 * The low power link up (lplu) state is set to the power management level D3
1566 * A downshift is detected by querying the PHY link health.
1733 * e1000e_phy_has_link_generic - Polls PHY for link
1735 * @iterations: number of times to poll for link
1739 * Polls the PHY status register for link, 'iterations' number of times.
1749 * twice due to the link bit being sticky. No harm doing e1000e_phy_has_link_generic()
1892 * to verify that link is up. Read the PHY special control register to
1902 bool link; e1000e_get_phy_info_m88() local
1909 ret_val = e1000e_phy_has_link_generic(hw, 1, 0, &link); e1000e_get_phy_info_m88()
1913 if (!link) { e1000e_get_phy_info_m88()
1914 e_dbg("Phy info is only valid if link is up\n"); e1000e_get_phy_info_m88()
1963 * Read PHY status to determine if link is up. If link is up, then
1973 bool link; e1000e_get_phy_info_igp() local
1975 ret_val = e1000e_phy_has_link_generic(hw, 1, 0, &link); e1000e_get_phy_info_igp()
1979 if (!link) { e1000e_get_phy_info_igp()
1980 e_dbg("Phy info is only valid if link is up\n"); e1000e_get_phy_info_igp()
2031 bool link; e1000_get_phy_info_ife() local
2033 ret_val = e1000e_phy_has_link_generic(hw, 1, 0, &link); e1000_get_phy_info_ife()
2037 if (!link) { e1000_get_phy_info_ife()
2038 e_dbg("Phy info is only valid if link is up\n"); e1000_get_phy_info_ife()
2706 * e1000_power_up_phy_copper - Restore copper link in case of PHY power down
2709 * In the case of a PHY power down to save power, or to turn off link during a
2710 * driver unload, or wake on lan is not enabled, restore the link to previous
2724 * e1000_power_down_phy_copper - Restore copper link in case of PHY power down
2727 * In the case of a PHY power down to save power, or to turn off link during a
2728 * driver unload, or wake on lan is not enabled, restore the link to previous
3038 * This function works around a Si bug where the link partner can get
3039 * a link up indication before the PHY does. If small packets are sent
3040 * by the link partner they can be placed in the packet buffer without
3043 * packet buffer after the PHY detects link up.
3058 /* check if link is up and at 1Gbps */ e1000_link_stall_workaround_hv()
3117 bool link; e1000_phy_force_speed_duplex_82577() local
3132 e_dbg("Waiting for forced speed/duplex link on 82577 phy\n"); e1000_phy_force_speed_duplex_82577()
3135 100000, &link); e1000_phy_force_speed_duplex_82577()
3139 if (!link) e1000_phy_force_speed_duplex_82577()
3144 100000, &link); e1000_phy_force_speed_duplex_82577()
3154 * Read PHY status to determine if link is up. If link is up, then
3164 bool link; e1000_get_phy_info_82577() local
3166 ret_val = e1000e_phy_has_link_generic(hw, 1, 0, &link); e1000_get_phy_info_82577()
3170 if (!link) { e1000_get_phy_info_82577()
3171 e_dbg("Phy info is only valid if link is up\n"); e1000_get_phy_info_82577()
/linux-4.1.27/drivers/net/ethernet/xircom/
H A Dxirc2ps_cs.c159 DisableLinkPulse = 0x20, /* disable link pulse generation */
262 static int has_ce2_string(struct pcmcia_device * link);
263 static int xirc2ps_config(struct pcmcia_device * link);
264 static void xirc2ps_release(struct pcmcia_device * link);
295 static int set_card_type(struct pcmcia_device *link);
475 xirc2ps_probe(struct pcmcia_device *link) xirc2ps_probe() argument
480 dev_dbg(&link->dev, "attach()\n"); xirc2ps_probe()
488 local->p_dev = link; xirc2ps_probe()
489 link->priv = dev; xirc2ps_probe()
492 link->config_index = 1; xirc2ps_probe()
500 return xirc2ps_config(link); xirc2ps_probe()
504 xirc2ps_detach(struct pcmcia_device *link) xirc2ps_detach() argument
506 struct net_device *dev = link->priv; xirc2ps_detach()
508 dev_dbg(&link->dev, "detach\n"); xirc2ps_detach()
512 xirc2ps_release(link); xirc2ps_detach()
536 set_card_type(struct pcmcia_device *link) set_card_type() argument
538 struct net_device *dev = link->priv; set_card_type()
544 len = pcmcia_get_tuple(link, CISTPL_MANFID, &buf); set_card_type()
546 dev_err(&link->dev, "invalid CIS -- sorry\n"); set_card_type()
554 dev_dbg(&link->dev, "cisrev=%02x mediaid=%02x prodid=%02x\n", set_card_type()
588 case 1: local->card_type = has_ce2_string(link)? XIR_CE2 : XIR_CE ; set_card_type()
690 xirc2ps_config(struct pcmcia_device * link) xirc2ps_config() argument
692 struct net_device *dev = link->priv; xirc2ps_config()
701 dev_dbg(&link->dev, "config\n"); xirc2ps_config()
704 if (link->has_manf_id == 0) { xirc2ps_config()
709 switch (link->manf_id) { xirc2ps_config()
728 (unsigned)link->manf_id); xirc2ps_config()
731 dev_dbg(&link->dev, "found %s card\n", local->manf_str); xirc2ps_config()
733 if (!set_card_type(link)) { xirc2ps_config()
739 err = pcmcia_get_mac_from_cis(link, dev); xirc2ps_config()
743 len = pcmcia_get_tuple(link, 0x89, &buf); xirc2ps_config()
757 err = pcmcia_loop_tuple(link, CISTPL_FUNCE, pcmcia_get_mac_ce, dev); xirc2ps_config()
766 link->config_flags |= CONF_AUTO_SET_IO; xirc2ps_config()
771 if (!pcmcia_loop_config(link, xirc2ps_config_modem, NULL)) xirc2ps_config()
780 if (!pcmcia_loop_config(link, xirc2ps_config_check, xirc2ps_config()
789 link->io_lines = 10; xirc2ps_config()
790 link->resource[0]->end = 16; xirc2ps_config()
791 link->resource[0]->flags |= IO_DATA_PATH_WIDTH_16; xirc2ps_config()
793 link->resource[0]->start = ioaddr; xirc2ps_config()
794 if (!(err = pcmcia_request_io(link))) xirc2ps_config()
797 link->resource[0]->start = 0; /* let CS decide */ xirc2ps_config()
798 if ((err = pcmcia_request_io(link))) xirc2ps_config()
809 if ((err=pcmcia_request_irq(link, xirc2ps_interrupt))) xirc2ps_config()
812 link->config_flags |= CONF_ENABLE_IRQ; xirc2ps_config()
814 link->config_flags |= CONF_ENABLE_SPKR; xirc2ps_config()
816 if ((err = pcmcia_enable_device(link))) xirc2ps_config()
825 err = pcmcia_write_config_byte(link, CISREG_IOBASE_0, (u8) xirc2ps_config()
826 link->resource[1]->start & 0xff); xirc2ps_config()
830 err = pcmcia_write_config_byte(link, CISREG_IOBASE_1, xirc2ps_config()
831 (link->resource[1]->start >> 8) & 0xff); xirc2ps_config()
839 link->resource[2]->flags = WIN_DATA_WIDTH_8 | WIN_MEMORY_TYPE_AM | xirc2ps_config()
841 link->resource[2]->start = link->resource[2]->end = 0; xirc2ps_config()
842 if ((err = pcmcia_request_window(link, link->resource[2], 0))) xirc2ps_config()
845 local->dingo_ccr = ioremap(link->resource[2]->start, 0x1000) + 0x0800; xirc2ps_config()
846 if ((err = pcmcia_map_mem_page(link, link->resource[2], 0))) xirc2ps_config()
853 ioaddr = link->resource[0]->start; xirc2ps_config()
899 dev->irq = link->irq; xirc2ps_config()
900 dev->base_addr = link->resource[0]->start; xirc2ps_config()
905 SET_NETDEV_DEV(dev, &link->dev); xirc2ps_config()
920 xirc2ps_release(link); xirc2ps_config()
928 xirc2ps_release(struct pcmcia_device *link) xirc2ps_release() argument
930 dev_dbg(&link->dev, "release\n"); xirc2ps_release()
932 if (link->resource[2]->end) { xirc2ps_release()
933 struct net_device *dev = link->priv; xirc2ps_release()
938 pcmcia_disable_device(link); xirc2ps_release()
944 static int xirc2ps_suspend(struct pcmcia_device *link) xirc2ps_suspend() argument
946 struct net_device *dev = link->priv; xirc2ps_suspend()
948 if (link->open) { xirc2ps_suspend()
956 static int xirc2ps_resume(struct pcmcia_device *link) xirc2ps_resume() argument
958 struct net_device *dev = link->priv; xirc2ps_resume()
960 if (link->open) { xirc2ps_resume()
1391 struct pcmcia_device *link = lp->p_dev; do_open() local
1393 dev_dbg(&link->dev, "do_open(%p)\n", dev); do_open()
1397 if (!pcmcia_dev_present(link)) do_open()
1401 link->open++; do_open()
1690 netdev_info(dev, "MII link partner: %04x\n", linkpartner); init_mii()
1719 struct pcmcia_device *link = lp->p_dev; do_stop() local
1721 dev_dbg(&link->dev, "do_stop(%p)\n", dev); do_stop()
1723 if (!link) do_stop()
1736 link->open--; do_stop()
/linux-4.1.27/drivers/dma/ppc4xx/
H A Dxor.h27 #define XOR_CBCR_LNK_BIT (1<<31) /* link present */
77 u32 cblah; /* link address high */
78 u32 cblal; /* link address low */
97 u32 cblahr; /* CB link address high register */
98 u32 cblalr; /* CB link address low register */
/linux-4.1.27/drivers/bluetooth/
H A Dbt3c_cs.c86 static int bt3c_config(struct pcmcia_device *link);
87 static void bt3c_release(struct pcmcia_device *link);
619 static int bt3c_probe(struct pcmcia_device *link) bt3c_probe() argument
624 info = devm_kzalloc(&link->dev, sizeof(*info), GFP_KERNEL); bt3c_probe()
628 info->p_dev = link; bt3c_probe()
629 link->priv = info; bt3c_probe()
631 link->config_flags |= CONF_ENABLE_IRQ | CONF_AUTO_SET_VPP | bt3c_probe()
634 return bt3c_config(link); bt3c_probe()
638 static void bt3c_detach(struct pcmcia_device *link) bt3c_detach() argument
640 bt3c_release(link); bt3c_detach()
682 static int bt3c_config(struct pcmcia_device *link) bt3c_config() argument
684 struct bt3c_info *info = link->priv; bt3c_config()
691 if (!pcmcia_loop_config(link, bt3c_check_config, (void *) try)) bt3c_config()
697 if (!pcmcia_loop_config(link, bt3c_check_config_notpicky, NULL)) bt3c_config()
704 i = pcmcia_request_irq(link, &bt3c_interrupt); bt3c_config()
708 i = pcmcia_enable_device(link); bt3c_config()
718 bt3c_release(link); bt3c_config()
723 static void bt3c_release(struct pcmcia_device *link) bt3c_release() argument
725 struct bt3c_info *info = link->priv; bt3c_release()
729 pcmcia_disable_device(link); bt3c_release()
H A Dbtuart_cs.c81 static int btuart_config(struct pcmcia_device *link);
82 static void btuart_release(struct pcmcia_device *link);
552 static int btuart_probe(struct pcmcia_device *link) btuart_probe() argument
557 info = devm_kzalloc(&link->dev, sizeof(*info), GFP_KERNEL); btuart_probe()
561 info->p_dev = link; btuart_probe()
562 link->priv = info; btuart_probe()
564 link->config_flags |= CONF_ENABLE_IRQ | CONF_AUTO_SET_VPP | btuart_probe()
567 return btuart_config(link); btuart_probe()
571 static void btuart_detach(struct pcmcia_device *link) btuart_detach() argument
573 btuart_release(link); btuart_detach()
615 static int btuart_config(struct pcmcia_device *link) btuart_config() argument
617 struct btuart_info *info = link->priv; btuart_config()
624 if (!pcmcia_loop_config(link, btuart_check_config, &try)) btuart_config()
630 if (!pcmcia_loop_config(link, btuart_check_config_notpicky, NULL)) btuart_config()
637 i = pcmcia_request_irq(link, btuart_interrupt); btuart_config()
641 i = pcmcia_enable_device(link); btuart_config()
651 btuart_release(link); btuart_config()
656 static void btuart_release(struct pcmcia_device *link) btuart_release() argument
658 struct btuart_info *info = link->priv; btuart_release()
662 pcmcia_disable_device(link); btuart_release()
H A Ddtl1_cs.c84 static int dtl1_config(struct pcmcia_device *link);
535 static int dtl1_probe(struct pcmcia_device *link) dtl1_probe() argument
540 info = devm_kzalloc(&link->dev, sizeof(*info), GFP_KERNEL); dtl1_probe()
544 info->p_dev = link; dtl1_probe()
545 link->priv = info; dtl1_probe()
547 link->config_flags |= CONF_ENABLE_IRQ | CONF_AUTO_SET_IO; dtl1_probe()
549 return dtl1_config(link); dtl1_probe()
553 static void dtl1_detach(struct pcmcia_device *link) dtl1_detach() argument
555 struct dtl1_info *info = link->priv; dtl1_detach()
558 pcmcia_disable_device(link); dtl1_detach()
572 static int dtl1_config(struct pcmcia_device *link) dtl1_config() argument
574 struct dtl1_info *info = link->priv; dtl1_config()
578 link->resource[0]->end = 8; dtl1_config()
579 ret = pcmcia_loop_config(link, dtl1_confcheck, NULL); dtl1_config()
583 ret = pcmcia_request_irq(link, dtl1_interrupt); dtl1_config()
587 ret = pcmcia_enable_device(link); dtl1_config()
598 dtl1_detach(link); dtl1_config()
H A Dbluecard_cs.c84 static int bluecard_config(struct pcmcia_device *link);
85 static void bluecard_release(struct pcmcia_device *link);
835 static int bluecard_probe(struct pcmcia_device *link) bluecard_probe() argument
840 info = devm_kzalloc(&link->dev, sizeof(*info), GFP_KERNEL); bluecard_probe()
844 info->p_dev = link; bluecard_probe()
845 link->priv = info; bluecard_probe()
847 link->config_flags |= CONF_ENABLE_IRQ; bluecard_probe()
849 return bluecard_config(link); bluecard_probe()
853 static void bluecard_detach(struct pcmcia_device *link) bluecard_detach() argument
855 bluecard_release(link); bluecard_detach()
859 static int bluecard_config(struct pcmcia_device *link) bluecard_config() argument
861 struct bluecard_info *info = link->priv; bluecard_config()
864 link->config_index = 0x20; bluecard_config()
866 link->resource[0]->flags |= IO_DATA_PATH_WIDTH_8; bluecard_config()
867 link->resource[0]->end = 64; bluecard_config()
868 link->io_lines = 6; bluecard_config()
871 link->resource[0]->start = n ^ 0x300; bluecard_config()
872 i = pcmcia_request_io(link); bluecard_config()
880 i = pcmcia_request_irq(link, bluecard_interrupt); bluecard_config()
884 i = pcmcia_enable_device(link); bluecard_config()
894 bluecard_release(link); bluecard_config()
899 static void bluecard_release(struct pcmcia_device *link) bluecard_release() argument
901 struct bluecard_info *info = link->priv; bluecard_release()
907 pcmcia_disable_device(link); bluecard_release()
/linux-4.1.27/drivers/net/ethernet/dec/tulip/
H A D21142.c62 if (csr12 & 2) { /* No 100mbps link beat, revert to 10mbps. */ t21142_media_task()
65 "No 21143 100baseTx link beat, %08x, trying NWay\n", t21142_media_task()
76 if (!(csr12 & 4)) { /* 10mbps link beat good. */ t21142_media_task()
84 /* Select 100mbps port to check for link beat. */ t21142_media_task()
151 "21143 link status interrupt %08x, CSR5 %x, %08x\n", t21142_lnk_change()
176 "Switching to %s based on link negotiation %04x & %04x = %04x\n", t21142_lnk_change()
182 "Autonegotiation failed, using %s, link beat status %04x\n", t21142_lnk_change()
225 dev_info(&dev->dev, "21143 %s link beat %s\n", t21142_lnk_change()
237 dev_info(&dev->dev, "21143 10baseT link beat good\n"); t21142_lnk_change()
238 } else if (!(csr12 & 4)) { /* 10mbps link beat good. */ t21142_lnk_change()
246 } else { /* 100mbps link beat good. */ t21142_lnk_change()
H A Dpnic2.c58 * Bit 2 - LS10B - link state of 10baseT 0 - good, 1 - failed
59 * Bit 1 - LS100B - link state of 100baseT 0 - good, 1 - failed
181 "PNIC2 link status interrupt %08x, CSR5 %x, %08x\n", pnic2_lnk_change()
195 /* get the link partners reply and mask out all but pnic2_lnk_change()
218 /* so check if 100baseTx link state is okay */ pnic2_lnk_change()
231 "Switching to %s based on link negotiation %04x & %04x = %04x\n", pnic2_lnk_change()
284 "Autonegotiation failed, using %s, link beat status %04x\n", pnic2_lnk_change()
337 /* we are at 100mb and a potential link change occurred */ pnic2_lnk_change()
340 dev_info(&dev->dev, "PNIC2 %s link beat %s\n", pnic2_lnk_change()
344 /* check 100 link beat */ pnic2_lnk_change()
362 /* we are at 10mb and a potential link change occurred */ pnic2_lnk_change()
365 dev_info(&dev->dev, "PNIC2 %s link beat %s\n", pnic2_lnk_change()
H A Dpnic.c59 netdev_dbg(dev, "PNIC link changed state %08x, CSR5 %08x\n", pnic_lnk_change()
98 * his link partner. pnic_timer()
117 if (phy_reg & 0x04000000) { /* Remote link fault */ pnic_timer()
124 } else if (csr5 & TPLnkFail) { /* 100baseTx link beat */ pnic_timer()
126 netdev_dbg(dev, "%s link beat failed, CSR12 %04x, CSR5 %08x, PHY %03x\n", pnic_timer()
/linux-4.1.27/drivers/pcmcia/
H A Dcistpl.c479 u_char link[5]; follow_link() local
484 /* Get indirect link from the MFC tuple */ follow_link()
486 tuple->LinkOffset, 5, link); follow_link()
489 ofs = get_unaligned_le32(link + 1); follow_link()
490 SPACE(tuple->Flags) = (link[0] == CISTPL_MFC_ATTR); follow_link()
491 /* Move to the next indirect link */ follow_link()
503 link offset incorrectly, so we check the right spot... */ follow_link()
504 ret = read_cis_cache(s, SPACE(tuple->Flags), ofs, 5, link); follow_link()
507 if ((link[0] == CISTPL_LINKTARGET) && (link[1] >= 3) && follow_link()
508 (strncmp(link+2, "CIS", 3) == 0)) follow_link()
514 ret = read_cis_cache(s, SPACE(tuple->Flags), ofs, 5, link); follow_link()
517 if ((link[0] == CISTPL_LINKTARGET) && (link[1] >= 3) && follow_link()
518 (strncmp(link+2, "CIS", 3) == 0)) follow_link()
527 u_char link[2], tmp; pccard_get_next_tuple() local
536 link[1] = tuple->TupleLink; pccard_get_next_tuple()
541 if (link[1] == 0xff) pccard_get_next_tuple()
542 link[0] = CISTPL_END; pccard_get_next_tuple()
544 ret = read_cis_cache(s, attr, ofs, 2, link); pccard_get_next_tuple()
547 if (link[0] == CISTPL_NULL) { pccard_get_next_tuple()
553 /* End of chain? Follow long link if possible */ pccard_get_next_tuple()
554 if (link[0] == CISTPL_END) { pccard_get_next_tuple()
559 ret = read_cis_cache(s, attr, ofs, 2, link); pccard_get_next_tuple()
564 /* Is this a link tuple? Make a note of it */ pccard_get_next_tuple()
565 if ((link[0] == CISTPL_LONGLINK_A) || pccard_get_next_tuple()
566 (link[0] == CISTPL_LONGLINK_C) || pccard_get_next_tuple()
567 (link[0] == CISTPL_LONGLINK_MFC) || pccard_get_next_tuple()
568 (link[0] == CISTPL_LINKTARGET) || pccard_get_next_tuple()
569 (link[0] == CISTPL_INDIRECT) || pccard_get_next_tuple()
570 (link[0] == CISTPL_NO_LINK)) { pccard_get_next_tuple()
571 switch (link[0]) { pccard_get_next_tuple()
621 if (link[0] == tuple->DesiredTuple) pccard_get_next_tuple()
623 ofs += link[1] + 2; pccard_get_next_tuple()
630 tuple->TupleCode = link[0]; pccard_get_next_tuple()
631 tuple->TupleLink = link[1]; pccard_get_next_tuple()
736 static int parse_longlink(tuple_t *tuple, cistpl_longlink_t *link) parse_longlink() argument
740 link->addr = get_unaligned_le32(tuple->TupleData); parse_longlink()
745 static int parse_longlink_mfc(tuple_t *tuple, cistpl_longlink_mfc_t *link) parse_longlink_mfc() argument
752 link->nfn = *p; p++; parse_longlink_mfc()
753 if (tuple->TupleDataLen <= link->nfn*5) parse_longlink_mfc()
755 for (i = 0; i < link->nfn; i++) { parse_longlink_mfc()
756 link->fn[i].space = *p; p++; parse_longlink_mfc()
757 link->fn[i].addr = get_unaligned_le32(p); parse_longlink_mfc()
/linux-4.1.27/arch/x86/kernel/
H A Damd_nb.c65 struct pci_dev *misc, *link; amd_cache_northbridges() local
84 link = misc = NULL; amd_cache_northbridges()
88 node_to_amd_nb(i)->link = link = amd_cache_northbridges()
89 next_northbridge(link, amd_nb_link_ids); amd_cache_northbridges()
173 struct pci_dev *link = node_to_amd_nb(amd_get_nb_id(cpu))->link; amd_get_subcaches() local
180 pci_read_config_dword(link, 0x1d4, &mask); amd_get_subcaches()
198 pci_read_config_dword(nb->link, 0x1d4, &reset); amd_set_subcaches()
213 pci_write_config_dword(nb->link, 0x1d4, mask); amd_set_subcaches()
216 pci_read_config_dword(nb->link, 0x1d4, &reg); amd_set_subcaches()
/linux-4.1.27/drivers/isdn/sc/
H A Dmessage.c62 "link:%d stat:0x%x\n", receivemessage()
88 unsigned int link, sendmessage()
122 sndmsg.phy_link_no = link; sendmessage()
154 "link:%d\n ", sendmessage()
173 unsigned char link, send_and_receive()
188 retval = sendmessage(card, procid, type, class, code, link, send_and_receive()
211 (sc_adapter[card]->async_msg.phy_link_no == link)) { send_and_receive()
83 sendmessage(int card, unsigned int procid, unsigned int type, unsigned int class, unsigned int code, unsigned int link, unsigned int data_len, unsigned int *data) sendmessage() argument
168 send_and_receive(int card, unsigned int procid, unsigned char type, unsigned char class, unsigned char code, unsigned char link, unsigned char data_len, unsigned char *data, RspMessage *mesgdata, int timeout) send_and_receive() argument
/linux-4.1.27/drivers/net/phy/
H A Dsmsc.c94 * The LAN8710/LAN8720 requires a minimum of 2 link pulses within 64ms of each
95 * other in order to set the ENERGYON bit and exit EDPD mode. If a link partner
100 * in order to generate link test pulses if the link is down. If a link partner
108 if (!phydev->link) { lan87xx_read_status()
119 /* Sleep 64 ms to allow ~5 link test pulses to be sent */ lan87xx_read_status()
/linux-4.1.27/drivers/pci/host/
H A Dpci-imx6.c223 * If the bootloader already enabled the link we need some special imx6_pcie_assert_core_reset()
231 * indication that the bootloader activated the link. imx6_pcie_assert_core_reset()
345 dev_err(pp->dev, "phy link never came up\n"); imx6_pcie_wait_for_link()
369 * Force Gen1 operation when starting the link. In case the link is imx6_pcie_start_link()
386 /* Allow Gen2 mode after the link is up. */ imx6_pcie_start_link()
393 * Start Directed Speed Change so the best possible speed both link imx6_pcie_start_link()
409 /* Make sure link training is finished as well! */ imx6_pcie_start_link()
416 dev_err(pp->dev, "Failed to bring link up!\n"); imx6_pcie_start_link()
464 * Test if the PHY reports that the link is up and also that the LTSSM imx6_pcie_link_up()
465 * training finished. There are three possible states of the link when imx6_pcie_link_up()
467 * 1) The link is DOWN (unlikely) imx6_pcie_link_up()
468 * The link didn't come up yet for some reason. This usually means imx6_pcie_link_up()
471 * 2) The link is UP, but still in LTSSM training imx6_pcie_link_up()
475 * the link is up and operating correctly. imx6_pcie_link_up()
476 * 3) The link is UP and no longer in LTSSM training imx6_pcie_link_up()
477 * The link is up and operating correctly. imx6_pcie_link_up()
489 * Wait a little bit, then re-check if the link finished imx6_pcie_link_up()
634 /* bring down link, so bootloader gets clean state in case of reboot */ imx6_pcie_shutdown()
/linux-4.1.27/drivers/gpu/drm/tegra/
H A Dsor.c85 struct drm_dp_link *link) tegra_sor_dp_train_fast()
136 for (i = 0, value = 0; i < link->num_lanes; i++) { tegra_sor_dp_train_fast()
147 err = tegra_dpaux_train(sor->dpaux, link, pattern); tegra_sor_dp_train_fast()
157 for (i = 0, value = 0; i < link->num_lanes; i++) { tegra_sor_dp_train_fast()
168 err = tegra_dpaux_train(sor->dpaux, link, pattern); tegra_sor_dp_train_fast()
172 for (i = 0, value = 0; i < link->num_lanes; i++) { tegra_sor_dp_train_fast()
183 err = tegra_dpaux_train(sor->dpaux, link, pattern); tegra_sor_dp_train_fast()
305 /* number of link clocks per line */
390 struct drm_dp_link *link) tegra_sor_calc_config()
392 const u64 f = 100000, link_rate = link->rate * 1000; tegra_sor_calc_config()
399 if (!link_rate || !link->num_lanes || !pclk || !config->bits_per_pixel) tegra_sor_calc_config()
402 output = link_rate * 8 * link->num_lanes; tegra_sor_calc_config()
446 (link->num_lanes * 8); tegra_sor_calc_config()
463 if (link->capabilities & DP_LINK_CAP_ENHANCED_FRAMING) tegra_sor_calc_config()
466 config->hblank_symbols -= 12 / link->num_lanes; tegra_sor_calc_config()
471 config->vblank_symbols -= 36 / link->num_lanes + 4; tegra_sor_calc_config()
950 struct drm_dp_link link; tegra_sor_encoder_mode_set() local
977 err = drm_dp_link_probe(aux, &link); tegra_sor_encoder_mode_set()
979 dev_err(sor->dev, "failed to probe eDP link: %d\n", tegra_sor_encoder_mode_set()
992 err = tegra_sor_calc_config(sor, mode, &config, &link); tegra_sor_encoder_mode_set()
994 dev_err(sor->dev, "failed to compute link configuration: %d\n", tegra_sor_encoder_mode_set()
1041 /* set safe link bandwidth (1.62 Gbps) */ tegra_sor_encoder_mode_set()
1102 if (link.num_lanes <= 2) tegra_sor_encoder_mode_set()
1107 if (link.num_lanes <= 1) tegra_sor_encoder_mode_set()
1112 if (link.num_lanes == 0) tegra_sor_encoder_mode_set()
1121 value |= SOR_DP_LINKCTL_LANE_COUNT(link.num_lanes); tegra_sor_encoder_mode_set()
1137 /* set link bandwidth */ tegra_sor_encoder_mode_set()
1140 value |= drm_dp_link_rate_to_bw_code(link.rate) << 2; tegra_sor_encoder_mode_set()
1199 err = drm_dp_link_probe(aux, &link); tegra_sor_encoder_mode_set()
1201 dev_err(sor->dev, "failed to probe eDP link: %d\n", tegra_sor_encoder_mode_set()
1206 err = drm_dp_link_power_up(aux, &link); tegra_sor_encoder_mode_set()
1208 dev_err(sor->dev, "failed to power up eDP link: %d\n", tegra_sor_encoder_mode_set()
1213 err = drm_dp_link_configure(aux, &link); tegra_sor_encoder_mode_set()
1215 dev_err(sor->dev, "failed to configure eDP link: %d\n", tegra_sor_encoder_mode_set()
1220 rate = drm_dp_link_rate_to_bw_code(link.rate); tegra_sor_encoder_mode_set()
1221 lanes = link.num_lanes; tegra_sor_encoder_mode_set()
1232 if (link.capabilities & DP_LINK_CAP_ENHANCED_FRAMING) tegra_sor_encoder_mode_set()
1239 for (i = 0; i < link.num_lanes; i++) { tegra_sor_encoder_mode_set()
1248 err = tegra_sor_dp_train_fast(sor, &link); tegra_sor_encoder_mode_set()
1250 dev_err(sor->dev, "DP fast link training failed: %d\n", tegra_sor_encoder_mode_set()
1255 dev_dbg(sor->dev, "fast link training succeeded\n"); tegra_sor_encoder_mode_set()
1326 /* CSTM (LVDS, link A/B, upper) */ tegra_sor_encoder_mode_set()
84 tegra_sor_dp_train_fast(struct tegra_sor *sor, struct drm_dp_link *link) tegra_sor_dp_train_fast() argument
387 tegra_sor_calc_config(struct tegra_sor *sor, struct drm_display_mode *mode, struct tegra_sor_config *config, struct drm_dp_link *link) tegra_sor_calc_config() argument
/linux-4.1.27/net/sched/
H A Dsch_atm.c62 struct atm_flow_data link; /* unclassified skbs go here */ member in struct:atm_qdisc_data
63 struct list_head flows; /* NB: "link" is also on this
154 if (flow != &p->link) atm_tc_put()
157 * If flow == &p->link, the qdisc no longer works at this point and atm_tc_put()
291 list_add(&flow->list, &p->link.list); atm_tc_change()
314 if (rcu_access_pointer(flow->filter_list) || flow == &p->link) atm_tc_delete()
355 return flow ? &flow->filter_list : &p->link.filter_list; atm_tc_find_tcf()
392 flow = &p->link; atm_tc_enqueue()
435 if (flow == &p->link) { atm_tc_enqueue()
459 if (flow == &p->link) sch_atm_dequeue()
507 skb = qdisc_dequeue_peeked(p->link.q); atm_tc_dequeue()
519 return p->link.q->ops->peek(p->link.q); atm_tc_peek()
542 INIT_LIST_HEAD(&p->link.list); atm_tc_init()
543 list_add(&p->link.list, &p->flows); atm_tc_init()
544 p->link.q = qdisc_create_dflt(sch->dev_queue, atm_tc_init()
546 if (!p->link.q) atm_tc_init()
547 p->link.q = &noop_qdisc; atm_tc_init()
548 pr_debug("atm_tc_init: link (%p) qdisc %p\n", &p->link, p->link.q); atm_tc_init()
549 RCU_INIT_POINTER(p->link.filter_list, NULL); atm_tc_init()
550 p->link.vcc = NULL; atm_tc_init()
551 p->link.sock = NULL; atm_tc_init()
552 p->link.classid = sch->handle; atm_tc_init()
553 p->link.ref = 1; atm_tc_init()
H A Dcls_basic.c36 struct list_head link; member in struct:basic_filter
47 list_for_each_entry_rcu(f, &head->flist, link) { basic_classify()
68 list_for_each_entry(f, &head->flist, link) { basic_get()
107 list_for_each_entry_safe(f, n, &head->flist, link) { basic_destroy()
108 list_del_rcu(&f->link); basic_destroy()
121 list_del_rcu(&f->link); basic_delete()
220 list_replace_rcu(&fold->link, &fnew->link); basic_change()
224 list_add_rcu(&fnew->link, &head->flist); basic_change()
238 list_for_each_entry(f, &head->flist, link) { basic_walk()
H A Dsch_cbq.c68 internal device queueing, but on a permanently loaded link it is true.
149 struct cbq_class link; member in struct:cbq_sched_data
207 * it allows us to combine link sharing and priority scheduling
210 * Namely, you can put link sharing rules (f.e. route based) at root of CBQ,
220 struct cbq_class *head = &q->link; cbq_classify()
274 * Step 3+n. If classifier selected a link sharing class, cbq_classify()
705 now = q->now + L2T(&q->link, len); cbq_update()
762 idle -= L2T(&q->link, len); cbq_update()
799 * only if link is completely congested. cbq_under_limit()
986 q->link.undertime == PSCHED_PASTPERFECT) cbq_dequeue()
990 q->link.undertime = PSCHED_PASTPERFECT; cbq_dequeue()
1359 if ((q->link.R_tab = qdisc_get_rtab(r, tb[TCA_CBQ_RTAB])) == NULL) cbq_init()
1366 q->link.refcnt = 1; cbq_init()
1367 q->link.sibling = &q->link; cbq_init()
1368 q->link.common.classid = sch->handle; cbq_init()
1369 q->link.qdisc = sch; cbq_init()
1370 q->link.q = qdisc_create_dflt(sch->dev_queue, &pfifo_qdisc_ops, cbq_init()
1372 if (!q->link.q) cbq_init()
1373 q->link.q = &noop_qdisc; cbq_init()
1375 q->link.priority = TC_CBQ_MAXPRIO - 1; cbq_init()
1376 q->link.priority2 = TC_CBQ_MAXPRIO - 1; cbq_init()
1377 q->link.cpriority = TC_CBQ_MAXPRIO - 1; cbq_init()
1378 q->link.ovl_strategy = TC_CBQ_OVL_CLASSIC; cbq_init()
1379 q->link.overlimit = cbq_ovl_classic; cbq_init()
1380 q->link.allot = psched_mtu(qdisc_dev(sch)); cbq_init()
1381 q->link.quantum = q->link.allot; cbq_init()
1382 q->link.weight = q->link.R_tab->rate.rate; cbq_init()
1384 q->link.ewma_log = TC_CBQ_DEF_EWMA; cbq_init()
1385 q->link.avpkt = q->link.allot/2; cbq_init()
1386 q->link.minidle = -0x7FFFFFFF; cbq_init()
1394 cbq_link_class(&q->link); cbq_init()
1397 cbq_set_lss(&q->link, nla_data(tb[TCA_CBQ_LSSOPT])); cbq_init()
1399 cbq_addprio(q, &q->link); cbq_init()
1403 qdisc_put_rtab(q->link.R_tab); cbq_init()
1546 if (cbq_dump_attr(skb, &q->link) < 0) cbq_dump()
1560 q->link.xstats.avgidle = q->link.avgidle; cbq_dump_stats()
1561 return gnet_stats_copy_app(d, &q->link.xstats, sizeof(q->link.xstats)); cbq_dump_stats()
1674 if (cl != &q->link) cbq_destroy_class()
1841 parent = &q->link; cbq_change_class()
1880 if (cl->tparent != &q->link) cbq_change_class()
1887 cl->ewma_log = q->link.ewma_log; cbq_change_class()
1889 cl->maxidle = q->link.maxidle; cbq_change_class()
1891 cl->avpkt = q->link.avpkt; cbq_change_class()
1919 if (cl->filters || cl->children || cl == &q->link) cbq_delete()
1966 cl = &q->link; cbq_find_tcf()
H A Dem_cmp.c81 .link = LIST_HEAD_INIT(em_cmp_ops.link)
H A Dem_nbyte.c62 .link = LIST_HEAD_INIT(em_nbyte_ops.link)
H A Dem_u32.c46 .link = LIST_HEAD_INIT(em_u32_ops.link)
H A Dcls_bpf.c39 struct list_head link; member in struct:cls_bpf_prog
74 list_for_each_entry_rcu(prog, &head->plist, link) { cls_bpf_classify()
139 list_del_rcu(&prog->link); cls_bpf_delete()
154 list_for_each_entry_safe(prog, tmp, &head->plist, link) { cls_bpf_destroy()
155 list_del_rcu(&prog->link); cls_bpf_destroy()
174 list_for_each_entry(prog, &head->plist, link) { cls_bpf_get()
367 list_replace_rcu(&oldprog->link, &prog->link); cls_bpf_change()
371 list_add_rcu(&prog->link, &head->plist); cls_bpf_change()
459 list_for_each_entry(prog, &head->plist, link) { cls_bpf_walk()
/linux-4.1.27/drivers/net/ethernet/amd/
H A Dnmclan_cs.c402 static int nmclan_config(struct pcmcia_device *link);
403 static void nmclan_release(struct pcmcia_device *link);
435 static int nmclan_probe(struct pcmcia_device *link) nmclan_probe() argument
440 dev_dbg(&link->dev, "nmclan_attach()\n"); nmclan_probe()
447 lp->p_dev = link; nmclan_probe()
448 link->priv = dev; nmclan_probe()
451 link->resource[0]->end = 32; nmclan_probe()
452 link->resource[0]->flags |= IO_DATA_PATH_WIDTH_AUTO; nmclan_probe()
453 link->config_flags |= CONF_ENABLE_IRQ; nmclan_probe()
454 link->config_index = 1; nmclan_probe()
455 link->config_regs = PRESENT_OPTION; nmclan_probe()
463 return nmclan_config(link); nmclan_probe()
466 static void nmclan_detach(struct pcmcia_device *link) nmclan_detach() argument
468 struct net_device *dev = link->priv; nmclan_detach()
470 dev_dbg(&link->dev, "nmclan_detach\n"); nmclan_detach()
474 nmclan_release(link); nmclan_detach()
609 static int nmclan_config(struct pcmcia_device *link) nmclan_config() argument
611 struct net_device *dev = link->priv; nmclan_config()
618 dev_dbg(&link->dev, "nmclan_config\n"); nmclan_config()
620 link->io_lines = 5; nmclan_config()
621 ret = pcmcia_request_io(link); nmclan_config()
624 ret = pcmcia_request_irq(link, mace_interrupt); nmclan_config()
627 ret = pcmcia_enable_device(link); nmclan_config()
631 dev->irq = link->irq; nmclan_config()
632 dev->base_addr = link->resource[0]->start; nmclan_config()
637 len = pcmcia_get_tuple(link, 0x80, &buf); nmclan_config()
652 dev_dbg(&link->dev, "nmclan_cs configured: mace id=%x %x\n", nmclan_config()
670 SET_NETDEV_DEV(dev, &link->dev); nmclan_config()
683 nmclan_release(link); nmclan_config()
687 static void nmclan_release(struct pcmcia_device *link) nmclan_release() argument
689 dev_dbg(&link->dev, "nmclan_release\n"); nmclan_release()
690 pcmcia_disable_device(link); nmclan_release()
693 static int nmclan_suspend(struct pcmcia_device *link) nmclan_suspend() argument
695 struct net_device *dev = link->priv; nmclan_suspend()
697 if (link->open) nmclan_suspend()
703 static int nmclan_resume(struct pcmcia_device *link) nmclan_resume() argument
705 struct net_device *dev = link->priv; nmclan_resume()
707 if (link->open) { nmclan_resume()
725 struct pcmcia_device *link = &lp->link; nmclan_reset() local
729 pcmcia_read_config_byte(link, CISREG_COR, &OrigCorValue); nmclan_reset()
732 dev_dbg(&link->dev, "nmclan_reset: OrigCorValue=0x%x, resetting...\n", nmclan_reset()
734 pcmcia_write_config_byte(link, CISREG_COR, COR_SOFT_RESET); nmclan_reset()
738 pcmcia_write_config_byte(link, CISREG_COR, nmclan_reset()
782 struct pcmcia_device *link = lp->p_dev; mace_open() local
784 if (!pcmcia_dev_present(link)) mace_open()
787 link->open++; mace_open()
805 struct pcmcia_device *link = lp->p_dev; mace_close() local
807 dev_dbg(&link->dev, "%s: shutting down ethercard.\n", dev->name); mace_close()
812 link->open--; mace_close()
845 struct pcmcia_device *link = lp->p_dev; mace_tx_timeout() local
850 pcmcia_reset_card(link->socket); mace_tx_timeout()
/linux-4.1.27/include/net/
H A Ddn_nsp.h54 #define NSP_REASON_EA 9 /* End user has aborted the link */
57 #define NSP_REASON_LL 32 /* Node lacks logical-link resources */
58 #define NSP_REASON_LE 33 /* End user lacks logical-link resources */
61 #define NSP_REASON_TM 38 /* End user timed out logical link */
63 #define NSP_REASON_NL 41 /* No-link message */
74 /* Data Messages (data segment/interrupt/link service) */
/linux-4.1.27/virt/kvm/
H A Dasync_pf.c87 list_add_tail(&apf->link, &vcpu->async_pf.done); async_pf_execute()
128 typeof(*work), link); kvm_clear_async_pf_completion_queue()
129 list_del(&work->link); kvm_clear_async_pf_completion_queue()
145 link); kvm_check_async_pf_completion()
146 list_del(&work->link); kvm_check_async_pf_completion()
220 list_add_tail(&work->link, &vcpu->async_pf.done); kvm_async_pf_wakeup_all()
/linux-4.1.27/arch/tile/include/gxio/
H A Dmpipe.h1600 * Opening a link (with gxio_mpipe_link_open()) requests a set of link
1601 * permissions, which control what may be done with the link, and potentially
1604 * Data permission allows the process to receive packets from the link by
1605 * specifying the link's channel number in mPIPE packet distribution rules,
1606 * and to send packets to the link by using the link's channel number as
1609 * Stats permission allows the process to retrieve link attributes (such as
1611 * to read and write certain statistics-related registers in the link's MAC.
1613 * Control permission allows the process to retrieve and modify link attributes
1614 * (so that it may, for example, bring the link up and take it down), and
1615 * read and write many registers in the link's MAC and PHY.
1623 * applications request an exclusive permission on the same link, the one
1634 * ilk0/12 are all possible link names. The correspondence between
1635 * the link name and an mPIPE instance number or mPIPE channel number is
1637 * of numbers used for a particular link type may not start at zero and may
1640 * to determine which mPIPE controls a particular link.
1650 * The mPIPE link management model revolves around three different states,
1651 * which are maintained for each link:
1653 * 1. The <em>current</em> link state: is the link up now, and if so, at
1656 * 2. The <em>desired</em> link state: what do we want the link state to be?
1658 * thus, if the desired state is up, and the link is down, we'll be
1661 * 3. The <em>possible</em> link state: what speeds are valid for this
1662 * particular link? Or, in other words, what are the capabilities of
1663 * the link hardware?
1665 * These link states are not, strictly speaking, related to application
1666 * state; they may be manipulated at any time, whether or not the link
1669 * can affect the link state. These implicit link management operations
1670 * may be modified or disabled by the use of link open flags.
1673 * and gxio_mpipe_link_set_attr() to manipulate the link states.
1675 * gets you the possible link state. gxio_mpipe_link_get_attr() with
1676 * ::GXIO_MPIPE_LINK_CURRENT_STATE gets you the current link state.
1679 * the desired link state.
1681 * If you want to manage a link from a part of your application which isn't
1683 * flags on a gxio_mpipe_link_open() call. This opens the link, but does
1686 * gxio_mpipe_link_get_attr() and gxio_mpipe_link_set_attr() on this link
1687 * object to bring up or take down the link.
1689 * Some links support link state bits which support various loopback
1699 * physical link, and packets received on the physical link will be ignored.
1701 * Note that loopback operation requires that the link be brought up using
1702 * one or more of the GXIO_MPIPE_LINK_SPEED_xxx link state bits.
1705 * will notice significant similarities between the NetIO link management
1706 * model and the mPIPE link management model. However, the NetIO model
1712 * different choices in the mPIPE link management API. Thus, please read
1713 * this documentation carefully before assuming that mPIPE link management
1717 /* An object used to manage mPIPE link state and resources. */
1722 /* The channel number used by this link. */
1725 /* The MAC index used by this link. */
1729 /* Translate a link name to the instance number of the mPIPE shim which is
1730 * connected to that link. This call does not verify whether the link is
1731 * currently available, and does not reserve any link resources;
1734 * Typically applications will call this function to translate a link name
1737 * gxio_mpipe_link_open(), passing it the same link name plus the mPIPE
1738 * context, to configure the link.
1740 * @param link_name Name of the link; see @ref gxio_mpipe_link_names.
1742 * link, or a negative error code (::GXIO_ERR_NO_DEVICE) if the link does
1747 /* Retrieve one of this system's legal link names, and its MAC address.
1749 * @param index Link name index. If a system supports N legal link names,
1751 * those names. Thus, to retrieve all of a system's legal link names,
1755 * link name. The buffer should contain space for at least
1760 * @return Zero if a link name was successfully retrieved; -1 if one was
1766 /* Open an mPIPE link.
1768 * A link must be opened before it may be used to send or receive packets,
1770 * link's intended use, one or more link permissions may be requested via
1772 * may request that the link's state be modified at open time. See @ref
1775 * @param link A link state object, which will be initialized if this
1778 * @param link_name Name of the link.
1780 * @return 0 if the link was successfully opened, or a negative error code.
1783 extern int gxio_mpipe_link_open(gxio_mpipe_link_t *link,
1787 /* Close an mPIPE link.
1789 * Closing a link makes it available for use by other processes. Once
1790 * a link has been closed, packets may no longer be sent on or received
1791 * from the link, and its state may not be examined or changed.
1793 * @param link A link state object, which will no longer be initialized
1795 * @return 0 if the link was successfully closed, or a negative error code.
1798 extern int gxio_mpipe_link_close(gxio_mpipe_link_t *link);
1800 /* Return a link's channel number.
1802 * @param link A properly initialized link state object.
1803 * @return The channel number for the link.
1805 static inline int gxio_mpipe_link_channel(gxio_mpipe_link_t *link) gxio_mpipe_link_channel() argument
1807 return link->channel; gxio_mpipe_link_channel()
1810 /* Set a link attribute.
1812 * @param link A properly initialized link state object.
1818 extern int gxio_mpipe_link_set_attr(gxio_mpipe_link_t *link, uint32_t attr,
/linux-4.1.27/drivers/net/ethernet/ti/
H A Dnetcp_sgmii.c62 u32 status = 0, link = 0; netcp_sgmii_get_port_link() local
66 link = 1; netcp_sgmii_get_port_link()
67 return link; netcp_sgmii_get_port_link()
/linux-4.1.27/drivers/crypto/caam/
H A Dsg_sw_sec4.h11 * convert single dma address to h/w link table format
29 * convert scatterlist to h/w link table format
47 * convert scatterlist to h/w link table format
/linux-4.1.27/include/uapi/scsi/fc/
H A Dfc_fs.h82 FC_RCTL_ELS_REQ = 0x22, /* extended link services request */
83 FC_RCTL_ELS_REP = 0x23, /* extended link services reply */
95 FC_RCTL_BA_NOP = 0x80, /* basic link service NOP */
96 FC_RCTL_BA_ABTS = 0x81, /* basic link service abort */
110 FC_RCTL_F_BSYL = 0xc6, /* fabric busy to link control frame */
111 FC_RCTL_LCR = 0xc7, /* link credit reset */
145 [FC_RCTL_F_BSYL] = "LC fabric busy to link control frame",\
146 [FC_RCTL_LCR] = "LC link credit reset", \
187 FC_TYPE_BLS = 0x00, /* basic link service */
188 FC_TYPE_ELS = 0x01, /* extended link service */
192 FC_TYPE_ILS = 0x22, /* internal link service */
312 FC_RJT_LINK_CTL = 0x08, /* invalid link control */
/linux-4.1.27/arch/powerpc/kernel/
H A Dreloc_64.S59 * cur_offset [r7] = rela.run [r9] - rela.link [r7]
60 * _stext.link [r10] = _stext.run [r10] - cur_offset [r7]
61 * final_offset [r3] = _stext.final [r3] - _stext.link [r10]
/linux-4.1.27/drivers/net/ethernet/intel/ixgbe/
H A Dixgbe_82599.c343 * ixgbe_get_link_capabilities_82599 - Determines link capabilities
345 * @speed: pointer to link speed
348 * Determines the link capabilities by reading the AUTOC register.
356 /* Determine 1G link capabilities off of SFP+ type */ ixgbe_get_link_capabilities_82599()
369 * Determine link capabilities based on the stored value of AUTOC, ixgbe_get_link_capabilities_82599()
499 * ixgbe_stop_mac_link_on_d3_82599 - Disables link on D3
502 * Disables link, should be called during D3 power down sequence.
525 * ixgbe_start_mac_link_82599 - Setup MAC link settings
529 * Configures link settings based on values in the ixgbe_hw struct.
530 * Restarts the link. Performs autonegotiation if needed.
550 /* Restart link */ ixgbe_start_mac_link_82599()
579 /* Add delay to filter out noises during initial link setup */ ixgbe_start_mac_link_82599()
591 * laser on the PHY, effectively halting physical link.
614 * laser on the PHY, effectively starting physical link.
631 * When the driver changes the link speeds that it can support,
633 * initiate a new autotry session with the link partner. To do
635 * alert the link partner that it also needs to restart autotry on its
653 * ixgbe_setup_mac_link_multispeed_fiber - Set MAC link speed
655 * @speed: new link speed
658 * Set the link speed in the AUTOC register and restarts link.
689 /* If we already have link at this speed, just jump out */ ixgbe_setup_mac_link_multispeed_fiber()
698 /* Set the module link speed */ ixgbe_setup_mac_link_multispeed_fiber()
706 /* QSFP module automatically detects MAC link speed */ ixgbe_setup_mac_link_multispeed_fiber()
727 * Wait for the controller to acquire link. Per IEEE 802.3ap, ixgbe_setup_mac_link_multispeed_fiber()
732 /* Wait for the link partner to also set speed */ ixgbe_setup_mac_link_multispeed_fiber()
735 /* If we have link, just jump out */ ixgbe_setup_mac_link_multispeed_fiber()
751 /* If we already have link at this speed, just jump out */ ixgbe_setup_mac_link_multispeed_fiber()
760 /* Set the module link speed */ ixgbe_setup_mac_link_multispeed_fiber()
769 /* QSFP module automatically detects MAC link speed */ ixgbe_setup_mac_link_multispeed_fiber()
789 /* Wait for the link partner to also set speed */ ixgbe_setup_mac_link_multispeed_fiber()
792 /* If we have link, just jump out */ ixgbe_setup_mac_link_multispeed_fiber()
803 * We didn't get link. Configure back to the highest speed we tried, ixgbe_setup_mac_link_multispeed_fiber()
813 /* Set autoneg_advertised value based on input link speed */ ixgbe_setup_mac_link_multispeed_fiber()
826 * ixgbe_setup_mac_link_smartspeed - Set MAC link speed using SmartSpeed
828 * @speed: new link speed
843 /* Set autoneg_advertised value based on input link speed */ ixgbe_setup_mac_link_smartspeed()
857 * autoneg advertisement if link is unable to be established at the ixgbe_setup_mac_link_smartspeed()
862 /* First, try to get link with full advertisement */ ixgbe_setup_mac_link_smartspeed()
871 * Wait for the controller to acquire link. Per IEEE 802.3ap, ixgbe_setup_mac_link_smartspeed()
879 /* If we have link, just jump out */ ixgbe_setup_mac_link_smartspeed()
891 * We didn't get link. If we advertised KR plus one of KX4/KX ixgbe_setup_mac_link_smartspeed()
906 * Wait for the controller to acquire link. 600ms will allow for ixgbe_setup_mac_link_smartspeed()
914 /* If we have link, just jump out */ ixgbe_setup_mac_link_smartspeed()
924 /* We didn't get link. Turn SmartSpeed back off. */ ixgbe_setup_mac_link_smartspeed()
931 hw_dbg(hw, "Smartspeed has downgraded the link speed from the maximum advertised\n"); ixgbe_setup_mac_link_smartspeed()
936 * ixgbe_setup_mac_link_82599 - Set MAC link speed
938 * @speed: new link speed
941 * Set the link speed in the AUTOC register and restarts link.
1018 /* Restart link */ ixgbe_setup_mac_link_82599()
1044 /* Add delay to filter out noises during initial link setup */ ixgbe_setup_mac_link_82599()
1054 * @speed: new link speed
1057 * Restarts link on PHY and MAC based on settings passed in.
1079 * and clears all interrupts, perform a PHY reset, and perform a link (MAC)
1124 * Issue global reset to the MAC. Needs to be SW reset if link is up. ixgbe_reset_hw_82599()
1125 * If link reset is used when link is up, it might reset the PHY when ixgbe_reset_hw_82599()
1126 * mng is using it. If link is down or the flag to force full link ixgbe_reset_hw_82599()
1127 * reset is set, then perform link reset. ixgbe_reset_hw_82599()
1173 /* Enable link if disabled in NVM */ ixgbe_reset_hw_82599()
1920 /* We need to run link autotry after the driver loads */ ixgbe_start_hw_82599()
2147 /* Enable link if disabled in NVM */ ixgbe_reset_pipeline_82599()
H A Dixgbe_82598.c131 /* Overwrite the link function pointers if copper PHY */ ixgbe_init_phy_ops_82598()
215 * ixgbe_get_link_capabilities_82598 - Determines link capabilities
217 * @speed: pointer to link speed
220 * Determines the link capabilities by reading the AUTOC register.
229 * Determine link capabilities based on the stored value of AUTOC, ixgbe_get_link_capabilities_82598()
456 * ixgbe_start_mac_link_82598 - Configures MAC link settings
459 * Configures link settings based on values in the ixgbe_hw struct.
460 * Restarts the link. Performs autonegotiation if needed.
470 /* Restart link */ ixgbe_start_mac_link_82598()
495 /* Add delay to filter out noises during initial link setup */ ixgbe_start_mac_link_82598()
502 * ixgbe_validate_link_ready - Function looks for phy link
505 * Function indicates success when phy link is available. If phy is not ready
506 * within 5 seconds of MAC indicating link, the function returns error.
528 hw_dbg(hw, "Link was indicated but link is down\n"); ixgbe_validate_link_ready()
536 * ixgbe_check_mac_link_82598 - Get link/speed status
538 * @speed: pointer to link speed
539 * @link_up: true is link is up, false otherwise
540 * @link_up_wait_to_complete: bool used to wait for link up or not
542 * Reads the links register to determine if link is up and the current speed
553 * SERDES PHY requires us to read link status from register 0xC79F. ixgbe_check_mac_link_82598()
554 * Bit 0 set indicates link is up/ready; clear indicates link down. ixgbe_check_mac_link_82598()
623 * ixgbe_setup_mac_link_82598 - Set MAC link speed
625 * @speed: new link speed
628 * Set the link speed in the AUTOC register and restarts link.
659 /* Setup and restart the link based on the new values in ixgbe_setup_mac_link_82598()
670 * @speed: new link speed
673 * Sets the link speed in the AUTOC register in the MAC and restarts link.
695 * clears all interrupts, performing a PHY reset, and performing a link (MAC)
763 * If link reset is used, it might reset the MAC when mng is using it ixgbe_reset_hw_82598()
/linux-4.1.27/drivers/net/wireless/ath/ath9k/
H A DMakefile7 link.o \
/linux-4.1.27/drivers/of/
H A Dof_mdio.c258 * - the old DT binding, where 'fixed-link' was a property with 5
260 * - the new DT binding, where 'fixed-link' is a sub-node of the
270 dn = of_get_child_by_name(np, "fixed-link"); of_phy_is_fixed_link()
281 if (of_get_property(np, "fixed-link", &len) && of_phy_is_fixed_link()
301 /* status is zeroed, namely its .link member */ of_phy_register_fixed_link()
308 fixed_link_node = of_get_child_by_name(np, "fixed-link"); of_phy_register_fixed_link()
310 status.link = 1; of_phy_register_fixed_link()
324 fixed_link_prop = of_get_property(np, "fixed-link", &len); of_phy_register_fixed_link()
326 status.link = 1; of_phy_register_fixed_link()
/linux-4.1.27/drivers/net/ethernet/broadcom/genet/
H A Dbcmmii.c78 /* setup netdev link state when PHY link status change and
79 * update UMAC and RGMII block when link up
88 if (priv->old_link != phydev->link) { bcmgenet_mii_setup()
90 priv->old_link = phydev->link; bcmgenet_mii_setup()
93 if (phydev->link) { bcmgenet_mii_setup()
133 * link speed, duplex, and pause. The speed set in bcmgenet_mii_setup()
154 /* needed for MoCA fixed PHY to reflect correct link status */ bcmgenet_mii_setup()
336 /* Initialize link state variables that bcmgenet_mii_setup() uses */ bcmgenet_mii_probe()
392 /* The internal PHY has its link interrupts routed to the bcmgenet_mii_probe()
465 /* Get the link mode */ bcmgenet_mii_of_init()
475 status->link = dev->phydev->link; bcmgenet_fixed_phy_link_update()
516 * Use fixed PHY to represent the link layer. bcmgenet_mii_pd_init()
519 .link = 1, bcmgenet_mii_pd_init()
536 phydev->link = 0; bcmgenet_mii_pd_init()
/linux-4.1.27/drivers/uwb/
H A Dpal.c47 /* create a link to the uwb_rc in the PAL device's directory. */ uwb_pal_register()
52 /* create a link to the PAL in the UWB device's directory. */ uwb_pal_register()
120 /* remove link to the PAL in the UWB device's directory. */ uwb_pal_unregister()
124 /* remove link to uwb_rc in the PAL device's directory. */ uwb_pal_unregister()
/linux-4.1.27/net/rxrpc/
H A Dar-transport.c46 INIT_LIST_HEAD(&trans->link); rxrpc_alloc_transport()
94 list_for_each_entry(trans, &rxrpc_transports, link) { rxrpc_get_transport()
110 list_for_each_entry(trans, &rxrpc_transports, link) { rxrpc_get_transport()
122 list_add_tail(&trans->link, &rxrpc_transports); rxrpc_get_transport()
167 list_for_each_entry(trans, &rxrpc_transports, link) { rxrpc_find_transport()
234 list_for_each_entry_safe(trans, _p, &rxrpc_transports, link) { rxrpc_transport_reaper()
244 list_move_tail(&trans->link, &graveyard); rxrpc_transport_reaper()
260 link); rxrpc_transport_reaper()
261 list_del_init(&trans->link); rxrpc_transport_reaper()
/linux-4.1.27/fs/afs/
H A Dflock.c87 list_move_tail(&fl->fl_u.afs.link, &vnode->granted_locks); afs_grant_locks()
90 fl_u.afs.link) { afs_grant_locks()
93 list_move_tail(&p->fl_u.afs.link, afs_grant_locks()
145 struct file_lock, fl_u.afs.link); afs_lock_work()
179 struct file_lock, fl_u.afs.link); afs_lock_work()
203 struct file_lock, fl_u.afs.link) == fl) { afs_lock_work()
208 list_del_init(&fl->fl_u.afs.link); afs_lock_work()
272 INIT_LIST_HEAD(&fl->fl_u.afs.link); afs_do_setlk()
314 list_add_tail(&fl->fl_u.afs.link, &vnode->pending_locks); afs_do_setlk()
329 &fl->fl_u.afs.link); afs_do_setlk()
333 list_del_init(&fl->fl_u.afs.link); afs_do_setlk()
341 list_add_tail(&fl->fl_u.afs.link, &vnode->pending_locks); afs_do_setlk()
383 vnode->pending_locks.next == &fl->fl_u.afs.link) { afs_do_setlk()
384 if (vnode->pending_locks.prev != &fl->fl_u.afs.link) { afs_do_setlk()
386 list_del_init(&fl->fl_u.afs.link); afs_do_setlk()
390 list_del_init(&fl->fl_u.afs.link); afs_do_setlk()
407 list_move_tail(&fl->fl_u.afs.link, &vnode->granted_locks); afs_do_setlk()
432 list_del_init(&fl->fl_u.afs.link); afs_do_setlk()
454 INIT_LIST_HEAD(&fl->fl_u.afs.link); afs_do_unlk()
573 list_add(&new->fl_u.afs.link, &fl->fl_u.afs.link); afs_fl_copy_lock()
584 list_del_init(&fl->fl_u.afs.link); afs_fl_release_private()
/linux-4.1.27/drivers/s390/cio/
H A Dchsc.c90 u16 fla[8]; /* full link addresses 0-7 */
227 struct chp_link link; chsc_chp_offline() local
234 memset(&link, 0, sizeof(struct chp_link)); chsc_chp_offline()
235 link.chpid = chpid; chsc_chp_offline()
238 for_each_subchannel_staged(s390_subchannel_remove_chpid, NULL, &link); chsc_chp_offline()
251 static void s390_process_res_acc(struct chp_link *link) s390_process_res_acc() argument
255 sprintf(dbf_txt, "accpr%x.%02x", link->chpid.cssid, s390_process_res_acc()
256 link->chpid.id); s390_process_res_acc()
258 if (link->fla != 0) { s390_process_res_acc()
259 sprintf(dbf_txt, "fla%x", link->fla); s390_process_res_acc()
271 for_each_subchannel_staged(__s390_process_res_acc, NULL, link); s390_process_res_acc()
292 /* NULL link incident record */ __get_chpid_from_lir()
310 u16 fla; /* full link address */
314 /* ccdf has to be big enough for a link-incident record */
349 CIO_CRW_EVENT(4, "chsc: link incident (rs=%02x, rs_id=%04x)\n", chsc_process_sei_link_incident()
355 CIO_CRW_EVENT(4, "chsc: link incident - invalid LIR\n"); chsc_process_sei_link_incident()
365 struct chp_link link; chsc_process_sei_res_acc() local
381 memset(&link, 0, sizeof(struct chp_link)); chsc_process_sei_res_acc()
382 link.chpid = chpid; chsc_process_sei_res_acc()
384 link.fla = sei_area->fla; chsc_process_sei_res_acc()
386 /* full link address */ chsc_process_sei_res_acc()
387 link.fla_mask = 0xffff; chsc_process_sei_res_acc()
389 /* link address */ chsc_process_sei_res_acc()
390 link.fla_mask = 0xff00; chsc_process_sei_res_acc()
392 s390_process_res_acc(&link); chsc_process_sei_res_acc()
511 case 1: /* link incident*/ chsc_process_sei_nt0()
613 struct chp_link link; chsc_chp_online() local
619 memset(&link, 0, sizeof(struct chp_link)); chsc_chp_online()
620 link.chpid = chpid; chsc_chp_online()
624 &link); chsc_chp_online()
633 struct chp_link link; __s390_subchannel_vary_chpid() local
635 memset(&link, 0, sizeof(struct chp_link)); __s390_subchannel_vary_chpid()
636 link.chpid = chpid; __s390_subchannel_vary_chpid()
639 sch->driver->chp_event(sch, &link, __s390_subchannel_vary_chpid()
/linux-4.1.27/drivers/firewire/
H A Dcore-topology.c128 INIT_LIST_HEAD(&node->link); fw_node_create()
173 return list_entry(l, struct fw_node, link); fw_node()
274 child = fw_node(child->link.next); build_tree()
293 list_add_tail(&node->link, &stack); build_tree()
335 list_add_tail(&root->link, &list); for_each_fw_node()
337 list_for_each_entry(node, &list, link) { for_each_fw_node()
348 list_add_tail(&child->link, &list); for_each_fw_node()
355 list_for_each_entry_safe(node, next, &list, link) for_each_fw_node()
429 list_add_tail(&card->local_node->link, &list0); update_tree()
431 list_add_tail(&root->link, &list1); update_tree()
436 while (&node0->link != &list0) { update_tree()
470 list_add_tail(&node0->ports[i]->link, &list0); update_tree()
471 list_add_tail(&node1->ports[i]->link, &list1); update_tree()
496 node0 = fw_node(node0->link.next); update_tree()
497 next1 = fw_node(node1->link.next); update_tree()
/linux-4.1.27/drivers/net/
H A Dmii.c248 * mii_link_ok - is link status up/ok
251 * Returns 1 if the MII reports link status up/ok, 0 otherwise.
286 * mii_check_link - check MII link status
289 * If the link status changed (previous != current), call
290 * netif_carrier_on() if current link status is Up or call
291 * netif_carrier_off() if current link status is Down.
307 * @ok_to_print: OK to print link up/down messages
321 /* check current and old link status */ mii_check_media()
335 netdev_info(mii->dev, "link down\n"); mii_check_media()
346 netdev_info(mii->dev, "link up\n"); mii_check_media()
368 netdev_info(mii->dev, "link up, %uMbps, %s-duplex, lpa 0x%04X\n", mii_check_media()
/linux-4.1.27/drivers/staging/lustre/lustre/obdclass/
H A Dcl_io.c378 struct cl_io_lock_link *link) cl_lockset_lock_one()
383 lock = cl_lock_request(env, io, &link->cill_descr, "io", io); cl_lockset_lock_one()
386 link->cill_lock = lock; cl_lockset_lock_one()
387 list_move(&link->cill_linkage, &set->cls_curr); cl_lockset_lock_one()
388 if (!(link->cill_descr.cld_enq_flags & CEF_ASYNC)) { cl_lockset_lock_one()
391 list_move(&link->cill_linkage, cl_lockset_lock_one()
401 struct cl_io_lock_link *link) cl_lock_link_fini()
403 struct cl_lock *lock = link->cill_lock; cl_lock_link_fini()
405 list_del_init(&link->cill_linkage); cl_lock_link_fini()
408 link->cill_lock = NULL; cl_lock_link_fini()
410 if (link->cill_fini != NULL) cl_lock_link_fini()
411 link->cill_fini(env, link); cl_lock_link_fini()
417 struct cl_io_lock_link *link; cl_lockset_lock() local
423 list_for_each_entry_safe(link, temp, &set->cls_todo, cill_linkage) { cl_lockset_lock()
424 if (!cl_lockset_match(set, &link->cill_descr)) { cl_lockset_lock()
427 result = cl_lockset_lock_one(env, io, set, link); cl_lockset_lock()
431 cl_lock_link_fini(env, io, link); cl_lockset_lock()
434 list_for_each_entry_safe(link, temp, cl_lockset_lock()
436 lock = link->cill_lock; cl_lockset_lock()
439 list_move(&link->cill_linkage, cl_lockset_lock()
489 struct cl_io_lock_link *link; cl_io_unlock() local
499 list_for_each_entry_safe(link, temp, &set->cls_todo, cill_linkage) cl_io_unlock()
500 cl_lock_link_fini(env, io, link); cl_io_unlock()
502 list_for_each_entry_safe(link, temp, &set->cls_curr, cill_linkage) cl_io_unlock()
503 cl_lock_link_fini(env, io, link); cl_io_unlock()
505 list_for_each_entry_safe(link, temp, &set->cls_done, cill_linkage) { cl_io_unlock()
506 cl_unuse(env, link->cill_lock); cl_io_unlock()
507 cl_lock_link_fini(env, io, link); cl_io_unlock()
598 struct cl_io_lock_link *link) cl_io_lock_add()
602 if (cl_lockset_merge(&io->ci_lockset, &link->cill_descr)) cl_io_lock_add()
605 list_add(&link->cill_linkage, &io->ci_lockset.cls_todo); cl_io_lock_add()
613 struct cl_io_lock_link *link) cl_free_io_lock_link()
615 OBD_FREE_PTR(link); cl_free_io_lock_link()
619 * Allocates new lock link, and uses it to add a lock to a lockset.
624 struct cl_io_lock_link *link; cl_io_lock_alloc_add() local
627 OBD_ALLOC_PTR(link); cl_io_lock_alloc_add()
628 if (link != NULL) { cl_io_lock_alloc_add()
629 link->cill_descr = *descr; cl_io_lock_alloc_add()
630 link->cill_fini = cl_free_io_lock_link; cl_io_lock_alloc_add()
631 result = cl_io_lock_add(env, io, link); cl_io_lock_alloc_add()
633 link->cill_fini(env, link); cl_io_lock_alloc_add()
376 cl_lockset_lock_one(const struct lu_env *env, struct cl_io *io, struct cl_lockset *set, struct cl_io_lock_link *link) cl_lockset_lock_one() argument
400 cl_lock_link_fini(const struct lu_env *env, struct cl_io *io, struct cl_io_lock_link *link) cl_lock_link_fini() argument
597 cl_io_lock_add(const struct lu_env *env, struct cl_io *io, struct cl_io_lock_link *link) cl_io_lock_add() argument
612 cl_free_io_lock_link(const struct lu_env *env, struct cl_io_lock_link *link) cl_free_io_lock_link() argument
/linux-4.1.27/arch/x86/platform/uv/
H A Duv_irq.c54 struct rb_node **link = &uv_irq_root.rb_node; uv_set_irq_2_mmr_info() local
70 while (*link) { uv_set_irq_2_mmr_info()
71 parent = *link; uv_set_irq_2_mmr_info()
84 link = &(*link)->rb_left; uv_set_irq_2_mmr_info()
86 link = &(*link)->rb_right; uv_set_irq_2_mmr_info()
90 rb_link_node(&n->list, parent, link); uv_set_irq_2_mmr_info()
/linux-4.1.27/arch/powerpc/include/asm/
H A Dkgdb.h42 * 32 gpr, 32 fpr, nip, msr, link, ctr
55 /* 32 GPRs (8 bytes), nip, msr, ccr, link, ctr, xer, acc (8 bytes), spefscr*/
/linux-4.1.27/net/802/
H A Dp8023.c2 * NET3: 802.3 data link hooks used for IPX 802.3
9 * 802.3 isn't really a protocol data link layer. Some old IPX stuff
/linux-4.1.27/scripts/kconfig/lxdialog/
H A Dcheck-lxdialog.sh4 # What library to link
46 # Check if we can link to ncurses
/linux-4.1.27/sound/soc/codecs/
H A Dbt-sco.c2 * Driver for generic Bluetooth SCO link
89 MODULE_DESCRIPTION("ASoC generic bluetooth sco link driver");
/linux-4.1.27/arch/um/
H A DMakefile22 # We require bash because the vmlinux link and loader script cpp use bash
60 # only get link-time error, luckily.
106 echo ' compatibility only, this creates a hard link to the'
135 # Used by link-vmlinux.sh which has special support for um link
/linux-4.1.27/include/uapi/linux/caif/
H A Dcaif_socket.h21 * CAIF Link Layers can register their link properties.
60 * @CAIFPROTO_DEBUG: Debug link
113 * @u.at.type: Type of AT link to set up (enum caif_at_type).
170 * link can be selected (CAIF_LINK_HIGH_BANDW) or
171 * or a low latency link (CAIF_LINK_LOW_LATENCY).
/linux-4.1.27/drivers/macintosh/
H A Dwindfarm_core.c216 list_for_each_entry(ct, &wf_controls, link) { wf_register_control()
225 list_add(&new_ct->link, &wf_controls); wf_register_control()
249 list_del(&ct->link); wf_unregister_control()
263 list_for_each_entry(ct, &wf_controls, link) { wf_find_control()
329 list_for_each_entry(sr, &wf_sensors, link) { wf_register_sensor()
338 list_add(&new_sr->link, &wf_sensors); wf_register_sensor()
362 list_del(&sr->link); wf_unregister_sensor()
376 list_for_each_entry(sr, &wf_sensors, link) { wf_find_sensor()
422 list_for_each_entry(ct, &wf_controls, link) wf_register_client()
424 list_for_each_entry(sr, &wf_sensors, link) wf_register_client()
/linux-4.1.27/drivers/edac/
H A Damd8131_edac.c108 /* Clear CRC Error flag on link side A */ amd8131_pcix_init()
113 /* Clear CRC Error flag on link side B */ amd8131_pcix_init()
133 /* Setup CRC Flood Enable for link side A */ amd8131_pcix_init()
138 /* Setup CRC Flood Enable for link side B */ amd8131_pcix_init()
159 /* Disable CRC Sync Flood on link side A */ amd8131_pcix_exit()
164 /* Disable CRC Sync Flood on link side B */ amd8131_pcix_exit()
209 /* Check if CRC error happens on link side A */ amd8131_pcix_check()
212 printk(KERN_INFO "Error(s) in link conf and control register " amd8131_pcix_check()
222 /* Check if CRC error happens on link side B */ amd8131_pcix_check()
225 printk(KERN_INFO "Error(s) in link conf and control register " amd8131_pcix_check()
/linux-4.1.27/drivers/scsi/libsas/
H A Dsas_ata.c104 struct ata_link *link; sas_ata_task_done() local
122 link = &ap->link; sas_ata_task_done()
144 if (!link->sactive) { sas_ata_task_done()
147 link->eh_info.err_mask |= ac_err_mask(dev->sata_dev.fis[2]); sas_ata_task_done()
148 if (unlikely(link->eh_info.err_mask)) sas_ata_task_done()
157 if (!link->sactive) { sas_ata_task_done()
160 link->eh_info.err_mask |= AC_ERR_DEV; sas_ata_task_done()
213 ata_tf_to_fis(&qc->tf, qc->dev->link->pmp, 1, (u8 *)&task->ata_task.fis); sas_ata_qc_issue()
323 static int smp_ata_check_ready(struct ata_link *link) smp_ata_check_ready() argument
326 struct ata_port *ap = link->ap; smp_ata_check_ready()
354 static int local_ata_check_ready(struct ata_link *link) local_ata_check_ready() argument
356 struct ata_port *ap = link->ap; local_ata_check_ready()
393 static int sas_ata_hard_reset(struct ata_link *link, unsigned int *class, sas_ata_hard_reset() argument
398 struct ata_port *ap = link->ap; sas_ata_hard_reset()
399 int (*check_ready)(struct ata_link *link); sas_ata_hard_reset()
417 ret = ata_wait_after_reset(link, deadline, check_ready); sas_ata_hard_reset()
644 /* if libata could not bring the link up, don't surface sas_probe_sata()
846 ehi = &ap->link.eh_info; sas_ata_schedule_reset()

Completed in 7165 milliseconds

1234567891011>>