Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 2 Nov 2019 21:41:00 +0100
From:      Milan Obuch <freebsd-hackers@dino.sk>
To:        freebsd-hackers@freebsd.org
Cc:        Oleksandr Tymoshenko <gonzo@bluezbox.com>, Oliver Pinter <oliver.pinter@hardenedbsd.org>
Subject:   Re: UART driver as kld - how?
Message-ID:  <20191102214100.500ba493@zeta.dino.sk>
In-Reply-To: <20191028201952.20a92307@zeta.dino.sk>
References:  <20191027214209.712d62ca@zeta.dino.sk> <CAPQ4ffuoHRFghwo=okFoNVHw9TYdwFw_wgUxa5_rm6FqjsNVsg@mail.gmail.com> <20191027232956.28b11772@zeta.dino.sk> <20191028191005.GA89835@bluezbox.com> <20191028201952.20a92307@zeta.dino.sk>

next in thread | previous in thread | raw e-mail | index | archive | help
On Mon, 28 Oct 2019 20:19:52 +0100
Milan Obuch <freebsd-hackers@dino.sk> wrote:

[ snip ]

> Hi,
> 
> I found uart_dev_snps.c being somewhat near what I need. I am trying
> to extract necessary bits from this and other files (what you wrote is
> just one bit), it seems our docs are lacking in this area.
> 
> Regards,
> Milan
>

After studying other uart_dev_xxx.c files I am able to create working
skeleton uart driver. I can compile it, kldload, and get some console
output. Right now, I hit another problem - uart framework is not
documented well, at least no man page is found in share/man directory.

My probe function is similar to that in uart_dev_snps.c file,
simplified, and I need to know what arguments should uart_bus_probe
function be invoked with. In many device drivers there are mostly
zeros, but this does not work for me.

Currently I am getting error 6, ENXIO, so I am not correctly attaching
my driver to device. Putting some printf here and there, I found test
at line 508, file uart_core.c, fails - sc->sc_class is null. Question
is, now, where and how should this field in this structure be
initialized...

I am sure I need docs/description for other functions as well, so if
anybody knows where good uart framework description could be found,
please advice. Or if somebody already has good understanding of it and
could help me with my issues, it wil be greatly appreciated.

Regards,
Milan



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20191102214100.500ba493>