Hello.

Please tell me how to add code to com_puc_attach() of
sys/dev/puc/com_puc.c from OpenBSD-5.1 so the kernel
can work with the known UART type without device probing?

Perhaps my way is not quite correct, in this case
please tell me which way to go.

void
com_puc_attach(parent, self, aux)
        struct device *parent, *self;
        void *aux;
{
        struct com_softc *sc = (void *)self;
        struct puc_attach_args *pa = aux;
        const char *intrstr;

        /* Grab a PCI interrupt. */
        intrstr = pa->intr_string(pa);
        sc->sc_ih = pa->intr_establish(pa, IPL_TTY, comintr, sc,
            sc->sc_dev.dv_xname);
        if (sc->sc_ih == NULL) {
                printf(": couldn't establish interrupt");
                if (intrstr != NULL)
                        printf(" at %s", intrstr);
                printf("\n");
                return;
        }
        printf(" %s", intrstr);

        sc->sc_iot = pa->t;
        sc->sc_ioh = pa->h;
        sc->sc_iobase = pa->a;
        if (PUC_IS_COM_MUL(pa->type))
                sc->sc_frequency = COM_FREQ * PUC_COM_GET_MUL(pa->type);
        else
                sc->sc_frequency = COM_FREQ * (1 << PUC_COM_GET_POW2(pa->type));

+        /* If this is a known card, provide the UART type. */
+        if (PCI_VENDOR(?) == PCI_VENDOR_PLX && 
+            PCI_PRODUCT(?) == PCI_PRODUCT_PLX_CRONYX_OMEGA)
+                sc->sc_uarttype = COM_UART_ST16C654;

        com_attach_subr(sc);
}



--
Alexei Malinin


> -------- Original Message --------
> Subject:      Cronyx Omega-PCI (8 port serial)
> Date:         Mon, 13 Aug 2012 15:22:28 +0400
> From:         Alexei Malinin <[email protected]>
> To:   [email protected]
>
>
> Hello.
>
> Recently I tried to use multiport serial card
> "Cronyx Omega-PCI (8 port serial)" with
> i386 OpenBSD-5.1 and noticed that the kernel
> detected serial port chips of this card
> incorrectly as "st16650, 32 byte fifo" (dmesg)
> but not "st16c654, 64 byte fifo" (as it was,
> for example, in OpenBSD-4.2).
>
> I checked the current manual for puc.4
> (http://www.openbsd.org/cgi-bin/cvsweb/src/share/man/man4/puc.4?rev=1.46;content-type=text%2Fplain):
> Cronyx Omega-PCI is supported by OpenBSD.
>
> I checked the current src/sys/dev/pci/puc.c and
> noticed that the appropriate code for "Cronyx Omega-PCI"
> was removed in revision 1.20
> (http://www.openbsd.org/cgi-bin/cvsweb/src/sys/dev/pci/puc.c.diff?r1=1.19;r2=1.20).
>
> Is it possible to recover the removed code?
>
>
> --
> Alexei Malinin

Reply via email to