Eu instalei uma placa serial PCI de 8 portas do Sunix no meu PC Ubuntu.
Um teste por lspci -v
mostra o seguinte:
03:02.0 Multiport serial controller: SUNIX Co., Ltd. Multiport serial controller
Subsystem: SUNIX Co., Ltd. Multiport serial controller
Flags: medium devsel, IRQ 18
I/O ports at 2100 [size=32]
I/O ports at 2000 [size=256]
I/O ports at 2120 [size=16]
Capabilities: <access denied>
Kernel driver in use: serial
Além disso, o seguinte é a saída de ls /dev/ttyS*
:
/dev/ttyS0 /dev/ttyS11 /dev/ttyS14 /dev/ttyS17 /dev/ttyS2 /dev/ttyS22 /dev/ttyS25 /dev/ttyS28 /dev/ttyS30 /dev/ttyS5 /dev/ttyS8
/dev/ttyS1 /dev/ttyS12 /dev/ttyS15 /dev/ttyS18 /dev/ttyS20 /dev/ttyS23 /dev/ttyS26 /dev/ttyS29 /dev/ttyS31 /dev/ttyS6 /dev/ttyS9
/dev/ttyS10 /dev/ttyS13 /dev/ttyS16 /dev/ttyS19 /dev/ttyS21 /dev/ttyS24 /dev/ttyS27 /dev/ttyS3 /dev/ttyS4 /dev/ttyS7
Agora, eu esperava que qualquer um dos 8 acima fosse meus dispositivos de porta serial e configurasse para descobrir qual usando o utilitário udevadm
da seguinte forma:
udevadm info -a -p $(udevadm info -q path -n /dev/ttyS<0-31>)
E, estranhamente, não há 8, mas apenas uma única porta ( /dev/ttyS5
) que pode ser acessada. Apenas 2 entre os 32 (0-31, sim, eu realmente sondou cada um deles!) Foram detectados com um atributo SUBSYSTEMS=="pci"
; udevadm info -a -p $(udevadm info -q path -n /dev/ttyS4)
fornece a seguinte saída:
looking at device '/devices/pci0000:00/0000:00:16.3/tty/ttyS4':
KERNEL=="ttyS4"
SUBSYSTEM=="tty"
DRIVER==""
looking at parent device '/devices/pci0000:00/0000:00:16.3':
KERNELS=="0000:00:16.3"
SUBSYSTEMS=="pci"
DRIVERS=="serial"
ATTRS{broken_parity_status}=="0"
ATTRS{class}=="0x070002"
ATTRS{consistent_dma_mask_bits}=="32"
ATTRS{d3cold_allowed}=="1"
ATTRS{device}=="0x1c3d"
ATTRS{dma_mask_bits}=="32"
ATTRS{driver_override}=="(null)"
ATTRS{enable}=="1"
ATTRS{irq}=="17"
ATTRS{local_cpulist}=="0-7"
ATTRS{local_cpus}=="00ff"
ATTRS{msi_bus}=="1"
ATTRS{numa_node}=="-1"
ATTRS{subsystem_device}=="0x047e"
ATTRS{subsystem_vendor}=="0x1028"
ATTRS{vendor}=="0x8086"
looking at parent device '/devices/pci0000:00':
KERNELS=="pci0000:00"
SUBSYSTEMS==""
DRIVERS==""
e udevadm info -a -p $(udevadm info -q path -n /dev/ttyS5)
fornecem a seguinte saída:
looking at device '/devices/pci0000:00/0000:00:1e.0/0000:03:02.0/tty/ttyS5':
KERNEL=="ttyS5"
SUBSYSTEM=="tty"
DRIVER==""
looking at parent device '/devices/pci0000:00/0000:00:1e.0/0000:03:02.0':
KERNELS=="0000:03:02.0"
SUBSYSTEMS=="pci"
DRIVERS=="serial"
ATTRS{broken_parity_status}=="0"
ATTRS{class}=="0x070200"
ATTRS{consistent_dma_mask_bits}=="32"
ATTRS{d3cold_allowed}=="1"
ATTRS{device}=="0x1999"
ATTRS{dma_mask_bits}=="32"
ATTRS{driver_override}=="(null)"
ATTRS{enable}=="1"
ATTRS{irq}=="18"
ATTRS{local_cpulist}=="0-7"
ATTRS{local_cpus}=="00ff"
ATTRS{msi_bus}=="1"
ATTRS{numa_node}=="-1"
ATTRS{subsystem_device}=="0x0008"
ATTRS{subsystem_vendor}=="0x1fd4"
ATTRS{vendor}=="0x1fd4"
looking at parent device '/devices/pci0000:00/0000:00:1e.0':
KERNELS=="0000:00:1e.0"
SUBSYSTEMS=="pci"
DRIVERS==""
ATTRS{broken_parity_status}=="0"
ATTRS{class}=="0x060401"
ATTRS{consistent_dma_mask_bits}=="32"
ATTRS{d3cold_allowed}=="0"
ATTRS{device}=="0x244e"
ATTRS{dma_mask_bits}=="32"
ATTRS{driver_override}=="(null)"
ATTRS{enable}=="1"
ATTRS{irq}=="0"
ATTRS{local_cpulist}=="0-7"
ATTRS{local_cpus}=="00ff"
ATTRS{msi_bus}=="1"
ATTRS{numa_node}=="-1"
ATTRS{subsystem_device}=="0x047e"
ATTRS{subsystem_vendor}=="0x1028"
ATTRS{vendor}=="0x8086"
looking at parent device '/devices/pci0000:00':
KERNELS=="pci0000:00"
SUBSYSTEMS==""
DRIVERS==""
Além disso, verifiquei a saída de sudo setserial -g /dev/ttyS[0123456789]
também:
/dev/ttyS0, UART: 16550A, Port: 0x03f8, IRQ: 4
/dev/ttyS1, UART: unknown, Port: 0x02f8, IRQ: 3
/dev/ttyS2, UART: unknown, Port: 0x03e8, IRQ: 4
/dev/ttyS3, UART: unknown, Port: 0x02e8, IRQ: 3
/dev/ttyS4, UART: 16550A, Port: 0x4140, IRQ: 17
/dev/ttyS5, UART: 16550A, Port: 0x2100, IRQ: 18
/dev/ttyS6, UART: unknown, Port: 0x0000, IRQ: 0
/dev/ttyS7, UART: unknown, Port: 0x0000, IRQ: 0
/dev/ttyS8, UART: unknown, Port: 0x0000, IRQ: 0
/dev/ttyS9, UART: unknown, Port: 0x0000, IRQ: 0
As 22 portas / dispositivos restantes retornaram um resultado semelhante /dev/ttyS31, UART: unknown, Port: 0x0000, IRQ: 0
também.
O dmesg
me fornece as seguintes impressões (tomei logs relacionados somente ao dispositivo PCI):
[ 0.147241] pci 0000:03:02.0: [1fd4:1999] type 00 class 0x070200
[ 0.147261] pci 0000:03:02.0: reg 0x10: [io 0x2100-0x211f]
[ 0.147269] pci 0000:03:02.0: reg 0x14: [io 0x2000-0x20ff]
[ 0.147285] pci 0000:03:02.0: reg 0x1c: [io 0x2120-0x212f]
[ 0.147326] pci 0000:03:02.0: PME# supported from D3hot
[ 0.644260] 0000:03:02.0: ttyS5 at I/O 0x2100 (irq = 18, base_baud = 921600) is a 16550A
Outra pista que recebi (da resposta abaixo) é que ttyS5
é o único listado sob o dispositivo PCI /sys/devices/pci0000:00/0000:00:16.3
no meu PC (Observe que essa placa PCI em particular estava funcionando bem quando foi instalada em um PC baseado no Windows 7). A seguir, a saída de find /sys/devices/ -type d -name ttyS*
:
/sys/devices/pnp0/00:04/tty/ttyS0
/sys/devices/pci0000:00/0000:00:16.3/tty/ttyS4
/sys/devices/pci0000:00/0000:00:1e.0/0000:03:02.0/tty/ttyS5
/sys/devices/platform/serial8250/tty/ttyS1
/sys/devices/platform/serial8250/tty/ttyS2
/sys/devices/platform/serial8250/tty/ttyS3
/sys/devices/platform/serial8250/tty/ttyS6
/sys/devices/platform/serial8250/tty/ttyS7
/sys/devices/platform/serial8250/tty/ttyS8
/sys/devices/platform/serial8250/tty/ttyS9
/sys/devices/platform/serial8250/tty/ttyS10
/sys/devices/platform/serial8250/tty/ttyS11
/sys/devices/platform/serial8250/tty/ttyS12
/sys/devices/platform/serial8250/tty/ttyS13
/sys/devices/platform/serial8250/tty/ttyS14
/sys/devices/platform/serial8250/tty/ttyS15
/sys/devices/platform/serial8250/tty/ttyS16
/sys/devices/platform/serial8250/tty/ttyS17
/sys/devices/platform/serial8250/tty/ttyS18
/sys/devices/platform/serial8250/tty/ttyS19
/sys/devices/platform/serial8250/tty/ttyS20
/sys/devices/platform/serial8250/tty/ttyS21
/sys/devices/platform/serial8250/tty/ttyS22
/sys/devices/platform/serial8250/tty/ttyS23
/sys/devices/platform/serial8250/tty/ttyS24
/sys/devices/platform/serial8250/tty/ttyS25
/sys/devices/platform/serial8250/tty/ttyS26
/sys/devices/platform/serial8250/tty/ttyS27
/sys/devices/platform/serial8250/tty/ttyS28
/sys/devices/platform/serial8250/tty/ttyS29
/sys/devices/platform/serial8250/tty/ttyS30
/sys/devices/platform/serial8250/tty/ttyS31
Gostaria de entender e saber por que apenas minha porta rotulada 1
no meu Sunix é acessível e como / onde posso obter acesso às 7 portas restantes?