# puc0 help



## pboehmer (Jan 26, 2009)

I am trying to get a dual-port serial card (the Abit AN8 motherboard I am using does not have onboard serial) to get serial connectivity to a connected box.  I compiled the puc driver in the kernel and it appears that it is being detected:

puc0: <SIIG Cyber Serial Dual PCI 16C550 (20x family)> port 0x9c00-0x9c07,0x9800-0x9807 irq 16 at device 8.0 on pci5

I am a little confused as to which additional drivers I am supposed to use with the puc driver.  Do I use uart or the sio?  Is the COM_MULTIPORT option still relevant? 

In my testing of the various options, I think I mucked things up by putting both sio and uart options in the kernel and ended up shooting myself in the foot.  Can someone shed some light for me?     

I currently have the following options in my kernel config:

------------- snip-------------------
# Serial (COM) ports
options         COM_MULTIPORT
device          sio             # 8250, 16[45]50 based serial ports
device          uart            # Generic UART driver
device         puc
-------------- snip -----------------

and my dmesg (relevant parts):

puc0: <SIIG Cyber Serial Dual PCI 16C550 (20x family)> port 0x9c00-0x9c07,0x9800-0x9807 irq 16 at device 8.0 on pci5
puc0: [FILTER]
uart0: <16550 or compatible> on puc0
uart0: [FILTER]
uart1: <16550 or compatible> on puc0
uart1: [FILTER]

and the relevant part of device.hints:

hint.sio.0.at="isa"
hint.sio.0.port="0x3F8"
hint.sio.0.flags="0x10"
hint.sio.0.disabled="1"
hint.sio.1.at="isa"
hint.sio.1.port="0x2F8"
hint.sio.2.at="isa"
hint.sio.2.disabled="1"
hint.sio.2.port="0x3E8"
hint.sio.2.irq="5"
hint.sio.3.at="isa"
hint.sio.3.disabled="1"
hint.sio.3.port="0x2E8"
hint.sio.3.irq="9"
hint.uart.0.disabled="0"
hint.uart.0.baud="38400"
hint.uart.0.port="0x3f8"
hint.uart.0.flags="0x10"

I am using the following command to get access to the remote box:
cu -s 38400 -l /dev/cuau0 (or cuau1)

Thanks in advance!


----------



## trev (Jan 27, 2009)

# If you've got a "dumb" serial or parallel PCI card that is
# supported by the puc(4) glue driver, uncomment the following
# line to enable it (connects to the sio, uart and/or ppc drivers):
device          puc

Seems you can use either. sio works for me:


```
puc0: <Avlab Low Profile PCI IO 4S-850 Serial> port 0xd400-0xd407,0xd800-0xd807,0xdc00-0xdc07,0xe000-0xe007 irq 5 at device 15.0 on pci0
sio2: <Avlab Low Profile PCI IO 4S-850 Serial> on puc0
sio2: type 16550A
sio2: unable to activate interrupt in fast mode - using normal mode
sio3: <Avlab Low Profile PCI IO 4S-850 Serial> on puc0
sio3: type 16550A
sio3: unable to activate interrupt in fast mode - using normal mode
sio4: <Avlab Low Profile PCI IO 4S-850 Serial> on puc0
sio4: type 16550A
sio4: unable to activate interrupt in fast mode - using normal mode
sio5: <Avlab Low Profile PCI IO 4S-850 Serial> on puc0
sio5: type 16550A
sio5: unable to activate interrupt in fast mode - using normal mode
sio0: <16550A-compatible COM port> port 0x3f8-0x3ff irq 4 flags 0x10 on acpi0
sio0: type 16550A
sio1: <16550A-compatible COM port> port 0x2f8-0x2ff irq 3 on acpi0
sio1: type 16550A
```


----------



## pboehmer (Jan 27, 2009)

I have puc, sio, and uart in my kernel config and puc is being utilized:


```
puc0: <SIIG Cyber Serial Dual PCI 16C550 (20x family)> port 0x9c00-0x9c07,0x9800-0x9807 irq 16 at device 8.0 on pci5
puc0: [FILTER]
uart0: <16550 or compatible> on puc0
uart0: [FILTER]
uart1: <16550 or compatible> on puc0
uart1: [FILTER]
```

But I am unable to get either port to work.  What exactly does FILTER mean?


----------



## trev (Jan 28, 2009)

pboehmer said:
			
		

> I am using the following command to get access to the remote box:
> cu -s 38400 -l /dev/cuau0 (or cuau1)



Shouldn't you be using /dev/cuad0 or /dev/cuad1 ?


----------



## pboehmer (Jan 28, 2009)

If I use sio in the kernel and comment out uart, then cuad0 is created (still does not work).  If uart is in the kernel with or without sio, then the device cuau0 is created, which also does not seem to work.


----------



## trev (Jan 28, 2009)

Is this a known working card? Does it work in Windows/DOS?


----------



## pboehmer (Jan 30, 2009)

*[Solved]*

The card does work, but moving the card to another box made it easier to test (thanks Trev!).  

I was able to get serial communications to work with between two systems using cu (apparently had this ability the whole time, but was too focused on getting the logon prompt), but still could not get a logon prompt.  In the end, my problem turned out to be the device entries in /etc/ttys and not a hardware problem at all.

The fix was to change the ttyd0 entry to cuau0 (I thought they needed to be ttyu0) and now I have serial access.  Not sure how/why this works, but it does.

Thanks again.


----------



## trev (Jan 31, 2009)

Glad to have been of some help, and thanks for posting the solution for future hapless users.


----------



## silicium (Aug 30, 2010)

Is there a multiport option for parallel ports ?
FreeBSD 8.1-release can't attach drivers to my NetMos 9815 dual parallel card after compiling with puc enabled.
Tried on two PIII motherboards, SuperMicro 370-DE6 and Abit BE6.
The card is known to work. It was pulled from a Windows box using a second printer. OpenBSD's dmesg shows lpt3 and lpt4.
Since the card has two ports, why is ppc1 probed twice instead of ppc2 ?
I don't need an interrrupt handler, polling will be fine. How to hack the source to cleanly disable interrupt handler registration ?

```
puc0: <NetMos NM9815 Dual 1284 Printer port> port 0xb400-0xb407,0xb800-0xb807,0xbc00-0xbc07,0xc000-0xc007,0xc400-0xc407,0xc800-0xc80f irq 12 at device 17.0 on pci0
puc0: [FILTER]
ppc1: <Parallel port> on puc0
ppc1: SMC-like chipset (ECP/EPP/PS2/NIBBLE) in COMPATIBLE mode
ppc1: FIFO with 16/16/12 bytes threshold
ppc1: failed to register interrupt handler: 6
device_attach: ppc1 attach returned 6
ppc1: <Parallel port> on puc0
ppc1: SMC-like chipset (ECP/EPP/PS2/NIBBLE) in COMPATIBLE mode
ppc1: FIFO with 16/16/12 bytes threshold
ppc1: failed to register interrupt handler: 6
device_attach: ppc1 attach returned 6
ppc0: <Standard parallel printer port> at port 0x378-0x37f irq 7 pnpid PNP0400 on isa0
ppc0: Generic chipset (EPP/NIBBLE) in COMPATIBLE mode
ppc0: [ITHREAD]
```


----------



## silicium (Aug 31, 2010)

Update to NetMos 9815 2P card: probably solved by downgrading to 6.4-RELEASE, just edit old pucdata.c that came without data for it, build, install, add 
	
	



```
puc_load="YES"
```
 to /boot/loader.conf and reboot, then puc0/ppc0/ppc1 appear without error message.


----------

