Lines Matching refs:port

133 	struct puc_port *port;
157 * lead to false positives on 8-port boards.
177 port = &sc->sc_port[idx];
178 port->p_ipend = SERDEV_IPEND(port->p_dev);
179 ipend |= port->p_ipend;
196 port = &sc->sc_port[idx];
197 if (!(port->p_ipend & isrc))
199 if (port->p_ihsrc[i] != NULL)
200 (*port->p_ihsrc[i])(port->p_iharg);
214 struct puc_port *port;
247 snprintf(buffer, sizeof(buffer), "%s I/O port mapping",
253 snprintf(buffer, sizeof(buffer), "%s port numbers",
272 port = &sc->sc_port[idx];
273 port->p_nr = idx + 1;
277 port->p_type = res;
286 port->p_bar = bar;
298 port->p_rres = rman_reserve_resource(rm, start + ofs,
300 if (port->p_rres != NULL) {
304 rman_set_bushandle(port->p_rres, bsh);
305 rman_set_bustag(port->p_rres, bst);
307 port->p_ires = rman_reserve_resource(&sc->sc_irq, port->p_nr,
308 port->p_nr, 1, 0, NULL);
309 if (port->p_ires == NULL) {
316 port->p_rclk = res;
318 port->p_dev = device_add_child(dev, NULL, -1);
319 if (port->p_dev != NULL)
320 device_set_ivars(port->p_dev, (void *)port);
356 port = &sc->sc_port[idx];
357 if (port->p_dev == NULL)
359 error = device_probe_and_attach(port->p_dev);
361 device_delete_child(dev, port->p_dev);
362 port->p_dev = NULL;
377 port = &sc->sc_port[idx];
378 if (port->p_dev != NULL)
379 device_delete_child(dev, port->p_dev);
380 if (port->p_rres != NULL)
381 rman_release_resource(port->p_rres);
382 if (port->p_ires != NULL)
383 rman_release_resource(port->p_ires);
405 struct puc_port *port;
414 port = &sc->sc_port[idx];
415 if (port->p_dev == NULL)
417 if (device_detach(port->p_dev) == 0) {
418 device_delete_child(dev, port->p_dev);
419 if (port->p_rres != NULL)
420 rman_release_resource(port->p_rres);
421 if (port->p_ires != NULL)
422 rman_release_resource(port->p_ires);
461 /* We don't attach to single-port serial cards. */
479 struct puc_port *port;
491 port = device_get_ivars(child);
492 KASSERT(port != NULL, ("%s %d", __func__, __LINE__));
501 if (type == port->p_bar->b_type)
502 res = port->p_rres;
504 res = port->p_ires;
533 struct puc_port *port;
543 port = device_get_ivars(child);
544 KASSERT(port != NULL, ("%s %d", __func__, __LINE__));
549 if (type == port->p_bar->b_type) {
550 if (res != port->p_rres)
553 if (res != port->p_ires)
555 if (port->p_hasintr)
572 struct puc_port *port;
582 port = device_get_ivars(child);
583 KASSERT(port != NULL, ("%s %d", __func__, __LINE__));
585 if (type == port->p_bar->b_type)
586 res = port->p_rres;
588 res = port->p_ires;
607 struct puc_port *port;
621 port = device_get_ivars(child);
622 KASSERT(port != NULL, ("%s %d", __func__, __LINE__));
624 if (cookiep == NULL || res != port->p_ires)
627 if (port->p_type == PUC_TYPE_SERIAL && ihand != NULL)
629 if (rman_get_device(port->p_ires) != originator)
638 if (port->p_type == PUC_TYPE_SERIAL) {
641 port->p_ihsrc[i] = SERDEV_IHAND(originator, isrc);
642 if (port->p_ihsrc[i] != NULL)
651 sc->sc_serdevs |= 1UL << (port->p_nr - 1);
653 port->p_hasintr = 1;
654 port->p_iharg = arg;
656 *cookiep = port;
664 struct puc_port *port;
678 port = device_get_ivars(child);
679 KASSERT(port != NULL, ("%s %d", __func__, __LINE__));
681 if (res != port->p_ires)
683 if (rman_get_device(port->p_ires) != originator)
686 if (!port->p_hasintr)
690 if (cookie != port)
693 port->p_hasintr = 0;
694 port->p_iharg = NULL;
697 port->p_ihsrc[i] = NULL;
705 struct puc_port *port;
713 port = device_get_ivars(child);
714 KASSERT(port != NULL, ("%s %d", __func__, __LINE__));
721 *result = port->p_rclk;
724 *result = port->p_type;
735 struct puc_port *port;
738 port = device_get_ivars(child);
742 retval += printf(" at port %d", port->p_nr);
752 struct puc_port *port;
754 port = device_get_ivars(child);
755 snprintf(buf, buflen, "port=%d", port->p_nr);
763 struct puc_port *port;
765 port = device_get_ivars(child);
766 snprintf(buf, buflen, "type=%d", port->p_type);