@pcdesign

Почему не собирается драйвер?

# uname -r
3.16.0-45-generic

# apt-get install linux-headers-3.16.0-45-generic  build-essential
Reading package lists... Done
Building dependency tree       
Reading state information... Done
build-essential is already the newest version.
linux-headers-3.16.0-45-generic is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 321 not upgraded.


Вот этот драйвер с этой страницы.

Результат:

# make
make -C /lib/modules/3.16.0-45-generic/build M=/root/driver
make[1]: Entering directory `/usr/src/linux-headers-3.16.0-45-generic'
  CC [M]  /root/driver/xr_usb_serial_common.o
/root/driver/xr_usb_serial_common.c:142:26: error: ‘usb_serial_probe’ undeclared here (not in a function)
         .probe         = usb_serial_probe,
                          ^
/root/driver/xr_usb_serial_common.c: In function ‘xr_usb_serial_set_termios’:
/root/driver/xr_usb_serial_common.c:247:29: error: invalid type argument of ‘->’ (have ‘struct ktermios’)
         cflag = tty->termios->c_cflag;
                             ^
In file included from include/linux/printk.h:260:0,
                 from include/linux/kernel.h:13,
                 from /root/driver/xr_usb_serial_common.c:40:
/root/driver/xr_usb_serial_common.c: In function ‘xr_usb_serial_out_callback’:
/root/driver/xr_usb_serial_common.c:639:85: error: ‘struct usb_serial_port’ has no member named ‘number’
         if (debug) dev_dbg(&port->serial->dev->dev, "%s - port %d\n", __func__, port->number);
                                                                                     ^
include/linux/dynamic_debug.h:87:9: note: in definition of macro ‘dynamic_dev_dbg’
       ##__VA_ARGS__);  \
         ^
/root/driver/xr_usb_serial_common.c:639:20: note: in expansion of macro ‘dev_dbg’
         if (debug) dev_dbg(&port->serial->dev->dev, "%s - port %d\n", __func__, port->number);
                    ^
/root/driver/xr_usb_serial_common.c: In function ‘xr_usb_serial_write_room’:
/root/driver/xr_usb_serial_common.c:669:56: error: ‘struct usb_serial_port’ has no member named ‘number’
    dev_dbg(&port->dev, "%s - port %d\n", __func__, port->number);
                                                        ^
include/linux/dynamic_debug.h:87:9: note: in definition of macro ‘dynamic_dev_dbg’
       ##__VA_ARGS__);  \
         ^
/root/driver/xr_usb_serial_common.c:669:4: note: in expansion of macro ‘dev_dbg’
    dev_dbg(&port->dev, "%s - port %d\n", __func__, port->number);
    ^
/root/driver/xr_usb_serial_common.c: In function ‘xr_usb_serial_in_callback’:
/root/driver/xr_usb_serial_common.c:836:9: warning: passing argument 1 of ‘tty_buffer_request_room’ from incompatible pointer type [enabled by default]
         room = tty_buffer_request_room(tty, length);
         ^
In file included from /root/driver/xr_usb_serial_common.c:44:0:
include/linux/tty_flip.h:6:12: note: expected ‘struct tty_port *’ but argument is of type ‘struct tty_struct *’
 extern int tty_buffer_request_room(struct tty_port *port, size_t size);
            ^
/root/driver/xr_usb_serial_common.c:885:33: warning: passing argument 1 of ‘tty_insert_flip_char’ from incompatible pointer type [enabled by default]
                                 tty_insert_flip_char(tty, ch, tty_flag);
                                 ^
In file included from /root/driver/xr_usb_serial_common.c:44:0:
include/linux/tty_flip.h:16:19: note: expected ‘struct tty_port *’ but argument is of type ‘struct tty_struct *’
 static inline int tty_insert_flip_char(struct tty_port *port,
                   ^
/root/driver/xr_usb_serial_common.c:888:25: warning: passing argument 1 of ‘tty_insert_flip_string’ from incompatible pointer type [enabled by default]
                         tty_insert_flip_string(tty, transfer_buffer, room);
                         ^
In file included from /root/driver/xr_usb_serial_common.c:44:0:
include/linux/tty_flip.h:32:19: note: expected ‘struct tty_port *’ but argument is of type ‘struct tty_struct *’
 static inline int tty_insert_flip_string(struct tty_port *port,
                   ^
/root/driver/xr_usb_serial_common.c:891:17: warning: passing argument 1 of ‘tty_flip_buffer_push’ from incompatible pointer type [enabled by default]
                 tty_flip_buffer_push(tty);
                 ^
In file included from /root/driver/xr_usb_serial_common.c:44:0:
include/linux/tty_flip.h:13:13: note: expected ‘struct tty_port *’ but argument is of type ‘struct tty_struct *’
 extern void tty_flip_buffer_push(struct tty_port *port);
             ^
/root/driver/xr_usb_serial_common.c: In function ‘xr_usb_serial_open’:
/root/driver/xr_usb_serial_common.c:1051:12: error: ‘struct tty_struct’ has no member named ‘low_latency’
         tty->low_latency = 0;
            ^
/root/driver/xr_usb_serial_common.c: In function ‘xr_usb_serial_disconnect’:
/root/driver/xr_usb_serial_common.c:1473:9: error: implicit declaration of function ‘usb_serial_disconnect’ [-Werror=implicit-function-declaration]
         usb_serial_disconnect(interface);
         ^
/root/driver/xr_usb_serial_common.c: In function ‘xr_usb_serial_init’:
/root/driver/xr_usb_serial_common.c:1565:9: error: implicit declaration of function ‘usb_serial_register’ [-Werror=implicit-function-declaration]
         retval = usb_serial_register(&xr_usb_serial_device);
         ^
/root/driver/xr_usb_serial_common.c:1579:9: error: implicit declaration of function ‘usb_serial_deregister’ [-Werror=implicit-function-declaration]
         usb_serial_deregister(&xr_usb_serial_device);
         ^
In file included from include/linux/module.h:17:0,
                 from /root/driver/xr_usb_serial_common.c:45:
/root/driver/xr_usb_serial_common.c: In function ‘__check_debug’:
include/linux/moduleparam.h:347:61: warning: return from incompatible pointer type [enabled by default]
  static inline type __always_unused *__check_##name(void) { return(p); }
                                                             ^
include/linux/moduleparam.h:393:35: note: in expansion of macro ‘__param_check’
 #define param_check_bool(name, p) __param_check(name, p, bool)
                                   ^
include/linux/moduleparam.h:127:2: note: in expansion of macro ‘param_check_bool’
  param_check_##type(name, &(value));       \
  ^
include/linux/moduleparam.h:113:2: note: in expansion of macro ‘module_param_named’
  module_param_named(name, name, type, perm)
  ^
/root/driver/xr_usb_serial_common.c:1600:1: note: in expansion of macro ‘module_param’
 module_param(debug, bool, S_IRUGO | S_IWUSR);
 ^
cc1: some warnings being treated as errors
make[2]: *** [/root/driver/xr_usb_serial_common.o] Error 1
make[1]: *** [_module_/root/driver] Error 2
make[1]: Leaving directory `/usr/src/linux-headers-3.16.0-45-generic'
make: *** [all] Error 2
  • Вопрос задан
  • 1189 просмотров
Решения вопроса 1
BuriK666
@BuriK666
Компьютерный псих
у Вас ядро слишком новое, там заявлена поддержка Linux 2.6.18 to 3.4.x
Ответ написан
Пригласить эксперта
Ваш ответ на вопрос

Войдите, чтобы написать ответ

Похожие вопросы