Lines Matching +full:8 +full:- +full:port

1 /*-
2 * SPDX-License-Identifier: BSD-2-Clause
6 * Copyright (c) 2008-2010 Hans Petter Selasky. All rights reserved.
96 struct acpi_uhub_port *port; member
110 if ((devinfo->Valid & ACPI_VALID_ADR) && in acpi_uhub_find_rh_cb()
111 (devinfo->Address == 0)) { in acpi_uhub_find_rh_cb()
124 "USB3-A", "USB3-B", "USB-MicroB", in acpi_uhub_upc_type()
125 "USB3-MicroAB", "USB3-PowerB", in acpi_uhub_upc_type()
126 "TypeC-USB2", "TypeC-Switch", in acpi_uhub_upc_type()
127 "TypeC-nonSwitch"}; in acpi_uhub_upc_type()
142 struct acpi_uhub_port *port = &sc->port[p - 1]; in acpi_uhub_parse_upc() local
156 port->upc = porttypenum; in acpi_uhub_parse_upc()
157 port->upc |= (conn) ? (ACPI_UPC_CONNECTABLE) : 0; in acpi_uhub_parse_upc()
160 device_printf(dev, "Port %u %sconnectable %s\n", in acpi_uhub_parse_upc()
169 SYSCTL_NULL_U32_PTR, port->upc, in acpi_uhub_parse_upc()
179 struct acpi_uhub_port *port = oidp->oid_arg1; in acpi_uhub_port_sysctl() local
184 sbuf_printf(&sb, "Handle %s\n", acpi_name(port->handle)); in acpi_uhub_port_sysctl()
185 if (port->upc == 0xffffffff) { in acpi_uhub_port_sysctl()
190 if (port->upc & ACPI_UPC_CONNECTABLE) { in acpi_uhub_port_sysctl()
193 sbuf_printf(&sb, "%s port\n", acpi_uhub_upc_type(port->upc & 0xff)); in acpi_uhub_port_sysctl()
195 if ((port->pld[0] & 0x80) == 0) { in acpi_uhub_port_sysctl()
198 port->pld[1], port->pld[2], in acpi_uhub_port_sysctl()
199 port->pld[3]); in acpi_uhub_port_sysctl()
202 port->pld[4] | (port->pld[5] << 8), in acpi_uhub_port_sysctl()
203 port->pld[6] | (port->pld[7] << 8)); in acpi_uhub_port_sysctl()
204 if (port->pld[8] & 1) { in acpi_uhub_port_sysctl()
207 if (port->pld[8] & 2) { in acpi_uhub_port_sysctl()
210 if (port->pld[8] & 4) { in acpi_uhub_port_sysctl()
213 int panelpos = (port->pld[8] >> 3) & 7; in acpi_uhub_port_sysctl()
229 posstr[(port->pld[8] >> 6) & 3]); in acpi_uhub_port_sysctl()
231 posstr[(port->pld[9]) & 3]); in acpi_uhub_port_sysctl()
234 shapestr[(port->pld[9] >> 2) & 0xf]); in acpi_uhub_port_sysctl()
236 ((port->pld[9] >> 6) & 1) ? "Vertical" : in acpi_uhub_port_sysctl()
239 ((port->pld[9] >> 7) in acpi_uhub_port_sysctl()
240 | (port->pld[10] << 1)) & 0xff); in acpi_uhub_port_sysctl()
242 ((port->pld[10] >> 7) in acpi_uhub_port_sysctl()
243 | (port->pld[11] << 1)) & 0xff); in acpi_uhub_port_sysctl()
245 (port->pld[11] & 0x80) ? in acpi_uhub_port_sysctl()
247 (port->pld[12] & 1) ? "Eject" : "", in acpi_uhub_port_sysctl()
248 (port->pld[12] & 2) ? "OSPM" : "" in acpi_uhub_port_sysctl()
251 if ((port->pld[0] & 0x7f) >= 2) { in acpi_uhub_port_sysctl()
253 port->pld[16] | (port->pld[17] << 8), in acpi_uhub_port_sysctl()
254 port->pld[18] | (port->pld[19] << 8)); in acpi_uhub_port_sysctl()
268 struct acpi_uhub_port *port = &sc->port[p - 1]; in acpi_uhub_parse_pld() local
280 if (obj->Type == ACPI_TYPE_PACKAGE in acpi_uhub_parse_pld()
281 && obj->Package.Elements[0].Type == ACPI_TYPE_BUFFER) { in acpi_uhub_parse_pld()
284 obj1 = &obj->Package.Elements[0]; in acpi_uhub_parse_pld()
285 len = obj1->Buffer.Length; in acpi_uhub_parse_pld()
286 resbuf = obj1->Buffer.Pointer; in acpi_uhub_parse_pld()
287 } else if (obj->Type == ACPI_TYPE_BUFFER) { in acpi_uhub_parse_pld()
288 len = obj->Buffer.Length; in acpi_uhub_parse_pld()
289 resbuf = obj->Buffer.Pointer; in acpi_uhub_parse_pld()
294 memcpy(port->pld, resbuf, len); in acpi_uhub_parse_pld()
298 port->pld, len, "A", "Raw PLD value"); in acpi_uhub_parse_pld()
310 resbuf[4] | (resbuf[5] << 8), in acpi_uhub_parse_pld()
311 resbuf[6] | (resbuf[7] << 8)); in acpi_uhub_parse_pld()
312 if (resbuf[8] & 1) { in acpi_uhub_parse_pld()
315 if (resbuf[8] & 2) { in acpi_uhub_parse_pld()
318 if (resbuf[8] & 4) { in acpi_uhub_parse_pld()
322 (resbuf[8] >> 3) & 7); in acpi_uhub_parse_pld()
324 (resbuf[8] >> 6) & 3); in acpi_uhub_parse_pld()
337 resbuf[16] | (resbuf[17] << 8), in acpi_uhub_parse_pld()
338 resbuf[18] | (resbuf[19] << 8)); in acpi_uhub_parse_pld()
373 if ((devinfo->Valid & ACPI_VALID_ADR) && in acpi_usb_hub_port_probe_cb()
374 (devinfo->Address > 0) && in acpi_usb_hub_port_probe_cb()
375 (devinfo->Address <= (uint64_t)sc->nports)) { in acpi_usb_hub_port_probe_cb()
381 snprintf(buf, sizeof(buf), "port%ju", in acpi_usb_hub_port_probe_cb()
382 (uintmax_t)devinfo->Address); in acpi_usb_hub_port_probe_cb()
386 NULL, "port nodes"); in acpi_usb_hub_port_probe_cb()
388 sc->port[devinfo->Address - 1].handle = ah; in acpi_usb_hub_port_probe_cb()
389 sc->port[devinfo->Address - 1].upc = 0xffffffff; in acpi_usb_hub_port_probe_cb()
390 acpi_uhub_parse_upc(dev, devinfo->Address, ah, tree); in acpi_usb_hub_port_probe_cb()
391 acpi_uhub_parse_pld(dev, devinfo->Address, ah, tree); in acpi_usb_hub_port_probe_cb()
395 &sc->port[devinfo->Address - 1], 0, in acpi_usb_hub_port_probe_cb()
396 acpi_uhub_port_sysctl, "A", "Port information"); in acpi_usb_hub_port_probe_cb()
424 /* success prior than non-ACPI USB HUB */ in acpi_uhub_root_probe()
443 /* success prior than non-ACPI USB HUB */ in acpi_uhub_probe()
456 uh = sc->usc.sc_udev->hub; in acpi_uhub_attach_common()
457 sc->nports = uh->nports; in acpi_uhub_attach_common()
458 sc->port = malloc(sizeof(struct acpi_uhub_port) * uh->nports, in acpi_uhub_attach_common()
460 status = acpi_usb_hub_port_probe(dev, sc->ah); in acpi_uhub_attach_common()
474 free(sc->port, M_USBDEV); in acpi_uhub_detach()
485 if (ACPI_FAILURE(acpi_uhub_find_rh(dev, &sc->ah)) || in acpi_uhub_root_attach()
486 (sc->ah == NULL)) { in acpi_uhub_root_attach()
505 sc->ah = acpi_get_handle(dev); in acpi_uhub_attach()
507 if (sc->ah == NULL) { in acpi_uhub_attach()
529 uhub_find_iface_index(sc->usc.sc_udev->hub, child, &hres); in acpi_uhub_read_ivar()
534 (hres.portno <= sc->nports) && in acpi_uhub_read_ivar()
535 (ah = sc->port[hres.portno - 1].handle)) { in acpi_uhub_read_ivar()