首页 文章

错误:'usb_serial_probe'未声明,linux 3.10在设备驱动程序中

提问于
浏览
0

我正在尝试编译一个Linux驱动USB转串口设备并获得错误

/root/moxa_usb_to_serial/mxu11x0/driver/mxu11x0.c:307: error: ‘usb_serial_probe’ undeclared here (not in a function)
 /root/moxa_usb_to_serial/mxu11x0/driver/mxu11x0.c:308: error: ‘usb_serial_disconnect’ undeclared here (not in a function)

我有linux

Linux host 3.10.33-rt32.34.el6rt.x86_64 #1 SMP PREEMPT RT Wed May 28 09:57:12 CEST 2014 x86_64 x86_64 x86_64 GNU/Linux

司机制造商实际上警告说,3.4以上的驱动程序可能不是可分隔的 . 然而,驱动程序本身相当小,我相信我可以做一些微不足道的修复 . 怎么解决这个问题?

2 回答

  • -1

    司机制造商实际警告说,3.4以上的驱动程序可能不是可分隔的 .

    快速检查一个符号表示内核USB串行接口的这一方面已发生变化 . 在3.10中 usb_serial_probe() 被设为静态(参见其3.10 cross reference),所以's no longer part of the kernel USB interface. There' s无需寻找要包含的"proper"头文件 .
    关于制作"some trivial fixes"的假设可能很仓促 .

    您需要获取3.4 Linux源代码树并找到USB串行接口的示例 .
    Here's a list of the 3.4 drivers that use usb_serial_probe() .
    您需要找到一个类似于您尝试移植的驱动程序的3.4驱动程序,例如使用 usb_serial_probe()usb_serial_disconnect() ,例如usb/serial/generic.c .
    然后在3.10源代码中找到该驱动程序的版本,并查看该驱动程序自3.4以来的演变情况(使用 diffsdiff ) .
    这些更改将指导您的驱动程序中必须修改的内容 .

  • 5

    我在一个名为usb-serial.h的文件中定义了符号,在另一个接口的驱动程序中 . 但它给我的印象是你没有包含正确的头文件来编译你的驱动程序 .

    因此,我建议您在驱动程序目录中的所有.h文件中进行搜索,并查找名为usb_serial_probe的函数 . 如果找到它,请检查是否在编译命令中正确添加了该文件 .

    您使用的是制造商提供的Makefile吗?

相关问题