Re: Making a kmod
- In reply to: Milan Obuch : "Re: Making a kmod"
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Sat, 18 Oct 2025 21:50:43 UTC
On Sat, 18 Oct 2025 23:39:01 +0200
Milan Obuch <freebsd-hackers@dino.sk> wrote:
> On Sat, 18 Oct 2025 17:26:37 -0400
> Aryeh Friedman <aryeh.friedman@gmail.com> wrote:
>
> > On Sat, Oct 18, 2025 at 5:17 PM Milan Obuch
> > <freebsd-hackers@dino.sk> wrote:
> > >
> > > On Sat, 18 Oct 2025 17:05:00 -0400
> > > Aryeh Friedman <aryeh.friedman@gmail.com> wrote:
> > >
> > > > I need to make a kernel mod that connects to a Vantech 2S1P PCIe
> > > > serial/par. combo card that has a 74LS02 hooked up to in roughly
> > > > the same way that I2C is interfaced to in lpbb(4) is for bit
> > > > banging on the LS02. I got /dev/lpt0, etc. on the bhyve host I
> > > > am used and have passed it through and the guest sees the 2S1P
> > > > but thats where I stand and to farther it appears I neeed a kmod
> > > > since the guest is seeing the device but not attaching a driver:
> > > >
> > > > pci0: <simple comms, UART> at device 3.0 (no driver attached)
> > > > pci0: <simple comms, UART> at device 5.0 (no driver attached)
> > > > pci0: <simple comms, parallel port> at device 6.0 (no driver
> > > > attached)
> > > >
> > > > none0@pci0:0:3:0: class=0x070002 rev=0x00 hdr=0x00
> > > > vendor=0x9710 device=0x9912 subvendor=0xa000 subdevice=0x1000
> > > > vendor = 'MosChip Semiconductor Technology Ltd.'
> > > > device = 'PCIe 9912 Multi-I/O Controller'
> > > > class = simple comms
> > > > subclass = UART
> > > > none1@pci0:0:5:0: class=0x070002 rev=0x00 hdr=0x00
> > > > vendor=0x9710 device=0x9912 subvendor=0xa000 subdevice=0x1000
> > > > vendor = 'MosChip Semiconductor Technology Ltd.'
> > > > device = 'PCIe 9912 Multi-I/O Controller'
> > > > class = simple comms
> > > > subclass = UART
> > > > none2@pci0:0:6:0: class=0x070103 rev=0x00 hdr=0x00
> > > > vendor=0x9710 device=0x9912 subvendor=0xa000 subdevice=0x2000
> > > > vendor = 'MosChip Semiconductor Technology Ltd.'
> > > > device = 'PCIe 9912 Multi-I/O Controller'
> > > > class = simple comms
> > > > subclass = parallel port
> > > >
> > >
> > > Did you looked at puc driver? Off my head, MosChip devices are
> > > there, among other ones, some time ago I was able to add new board
> > > with simple addition of its description. I do not have the details
> > > of the board and necessary modification. I think it is really
> > > worth of some test, puc driver is designed for such cards.
> >
> > Spent most of last night messing around with puc, ppt, etc. and got
> > no where even added this to /usr/src/sys/dev/puc/pucdata.c:
> >
> > { 0x9710, 0x9912, 0, 0, "MosChip Semiconductor Technology Ltd. PCIe
> > 9912 Multi-I/O Controller", PUC_PORT_2S1P, 0, 0, 0 },
> >
>
> What did you see in dmesg with this modification? Was there any change
> in comparison with original kernel without this?
>
> If not, then try 'wildcard match', using modified definition
>
> { 0x9710, 0x9912, 0xffff, 0,
> "MosChip Semiconductor Technology Ltd. PCIe 9912 Multi-I/O
> Controller", PUC_PORT_2S1P, 0, 0, 0 },
>
Looking through my archives, I found following regarding this very card
(named NetMos at the time) - look into mailing list archive at
https://lists.freebsd.org/pipermail/freebsd-hackers/2018-March/052362.html
and other messages in this thread. Maybe something from this helps...
Regards,
Milan