![并行端口 PCIe 卡不显示为 /dev/parport 并且不工作](https://linux22.com/image/218413/%E5%B9%B6%E8%A1%8C%E7%AB%AF%E5%8F%A3%20PCIe%20%E5%8D%A1%E4%B8%8D%E6%98%BE%E7%A4%BA%E4%B8%BA%20%2Fdev%2Fparport%20%E5%B9%B6%E4%B8%94%E4%B8%8D%E5%B7%A5%E4%BD%9C.png)
我有一个 PCIe ParallelPort 控制器,遗憾的是它不想工作。插入并行端口卡后,它没有像我预期的那样显示/dev/parport0
。正在做:
sudo rmmod parport_pc
sudo modprobe parport_pc io=0x4000
确实显示/dev/parport0
,但卡不起作用。当在数据引脚上发送值时,我没有得到任何电压。并dmesg | grep parport
显示:
scheltie@linux-mathieu:~$ sudo dmesg | grep parport
[ 266.761700] parport 0x4000 (WARNING): CTR: wrote 0x0c, read 0xff
[ 266.761705] parport 0x4000 (WARNING): DATA: wrote 0xaa, read 0xff
[ 266.761705] parport 0x4000: You gave this address, but there is probably no parallel port there!
[ 266.761719] parport0: PC-style at 0x4000, irq 0 [PCSPP,TRISTATE]
输出来自sudo lspci -v
:
0000:01:00.2 Parallel controller: Asix Electronics Corporation AX99100 PCIe to Multi I/O Controller (prog-if 03 [IEEE1284])
Subsystem: Asix Electronics Corporation (Wrong ID) Parallel Port
Flags: fast devsel, IRQ 255
I/O ports at 4008 [disabled] [size=8]
I/O ports at 4000 [disabled] [size=8]
Memory at 74001000 (32-bit, non-prefetchable) [disabled] [size=4K]
Memory at 74000000 (32-bit, non-prefetchable) [disabled] [size=4K]
Capabilities: [50] MSI: Enable- Count=1/8 Maskable- 64bit+
Capabilities: [78] Power Management version 3
Capabilities: [80] Express Legacy Endpoint, MSI 00
Capabilities: [100] Advanced Error Reporting
令我印象深刻的是[disabled]
I/O端口和内存地址后面的标记。知道可能是什么问题以及如何解决它吗?
在 POP_OS 22.04 LTS 上运行,最新。在装有 Windows 的双引导计算机上,该卡可以在 Windows 上运行。因此它在 BIOS 中被启用。
答案1
我也遇到了同样的问题星科PEX1P2PCIe 并行端口。lspci -nnv
表示 I/O 端口被禁用:
06:00.2 Parallel controller [0701]: Asix Electronics Corporation AX99100 PCIe to Multi I/O Controller [125b:9100] (prog-if 03 [IEEE1284])
Subsystem: Asix Electronics Corporation (Wrong ID) Parallel Port [a000:2000]
Flags: fast devsel, IRQ 5
I/O ports at e010 [disabled] [size=8]
I/O ports at e000 [disabled] [size=8]
Memory at fcc01000 (32-bit, non-prefetchable) [disabled] [size=4K]
Memory at fcc00000 (32-bit, non-prefetchable) [disabled] [size=4K]
Capabilities: [50] MSI: Enable- Count=1/8 Maskable- 64bit+
Capabilities: [78] Power Management version 3
Capabilities: [80] Express Legacy Endpoint, MSI 00
Capabilities: [100] Advanced Error Reporting
我通过创建/etc/modprobe.d/parport_pc.conf
以下内容解决了这个问题:
install parport_pc setpci -d 125b:9100 command=101; /sbin/modprobe --ignore-install parport_pc
options parport_pc io=0xe010 irq=auto
请务必替换125b:9100
为第一行的设备 ID lspci -nnv
,并替换0xe010
为第四行的 I/O 端口。现在,当parport_pc
模块加载时(例如使用sudo modprobe parport_pc
),它将同时设置 I/O 端口。
这里有两个关键部分:setpci
命令启用 I/O 端口,并且该options
行告诉驱动程序基本 I/O 地址是什么。请参阅Linux 串口指南的解释setpci
和这个 Arch Linux 表单帖子有关 modprobe.d 命令的解释install
。