On Tue, Sep 2, 2008 at 9:17 AM, Richard <[EMAIL PROTECTED]> wrote: > [...] > /home/richard/tmp/m560x-driver/m560x/trunk/km_m560x/m560x_core.c: In > function 'usb_m560x_probe': > /home/richard/tmp/m560x-driver/m560x/trunk/km_m560x/m560x_core.c:2831: > error: 'struct video_device' has no member named 'hardware'
O erro está aí. Este driver só é compatível até o kernel 2.6.23, pois o membro "hardware" da struct video_device foi removida nas versões posteriores. Ou seja, o projeto deste driver está bem devagar, pois o 2.6.23 saiu em outubro de 2007.... Como você está utilizando o kernel que vem no Slackware (2.6.24.5), você tem duas saidas: 1) Dar um passo pra trás e usar o kernel 2.6.23 (pra quem usa notebook pode não ser legal). Pelo menos na teoria deve compilar, não cheguei a testar, pois do jeito que o projeto está bagunçado, podem aparecer outros problemas. 2) Editar o arquivo m560x_core.c e remover ou comentar a linha 2831: cam->vdev->hardware = VID_HARDWARE_M560X; Essa segunda opção é a que eu recomendo. Deve funcionar. Pelo menos não deve dar erro de compilação. Aí é cruzar os dedos e carregar o modulo para testar. O problema das duas soluções acima é que você ficará preso sempre a kernels antigos. Ao sair a nova versão do Slackware por exemplo, o kernel certamente não será o 2.6.24.5, e aí você terá mais problemas para compilar, já que o pessoal do driver parou no tempo. Estou usando o 2.6.26.x e deu muitos mais erros aqui. Então estou anexando no e-mail um pequeno patch para compilar no 2.6.26.x. Como não tenho esta webcam aqui, não deu pra testar. Será útlil também para aquelas pessoas que costumam utilizar kernels novos e possui este tipo de webcam. Obs: salve o conteúdo abaixo em um arquivo e aplique o patch dentro do dir do módulo com: patch -p1 < nome-arq -- []'s Rodrigo Luiz GUS-MG ~ http://www.gus-mg.org Grupo de Usuários Slackware de Minas Gerais diff -U 3 -pr km_m560x.old/m560x_core.c km_m560x/m560x_core.c --- km_m560x.old/m560x_core.c 2008-09-02 11:15:12.000000000 -0300 +++ km_m560x/m560x_core.c 2008-09-02 11:58:58.000000000 -0300 @@ -1604,13 +1604,13 @@ static int m560x_stream_interrupt(struct * sysfs ***************************************************************************/ #define m560x_file(name, variable, field) \ -static ssize_t show_##name(struct class_device *class_dev, char *buf) \ +static ssize_t show_##name(struct device *class_dev, char *buf) \ { \ struct video_device *vdev = to_video_device(class_dev); \ struct m560x_camera *cam = video_get_drvdata(vdev); \ return sprintf(buf, field, cam->variable); \ } \ -static CLASS_DEVICE_ATTR(name, S_IRUGO, show_##name, NULL); +static DEVICE_ATTR(name, S_IRUGO, show_##name, NULL); m560x_file(model, name, "%s\n"); m560x_file(in_use, user, "%d\n"); @@ -1623,26 +1623,26 @@ m560x_file(decoding_errors, error, "%d\n static void m560x_create_sysfs_files(struct video_device *vdev) { - video_device_create_file(vdev, &class_device_attr_model); - video_device_create_file(vdev, &class_device_attr_in_use); - video_device_create_file(vdev, &class_device_attr_streaming); - video_device_create_file(vdev, &class_device_attr_palette); - video_device_create_file(vdev, &class_device_attr_frames_total); - video_device_create_file(vdev, &class_device_attr_frames_read); - video_device_create_file(vdev, &class_device_attr_packets_dropped); - video_device_create_file(vdev, &class_device_attr_decoding_errors); + video_device_create_file(vdev, &dev_attr_model); + video_device_create_file(vdev, &dev_attr_in_use); + video_device_create_file(vdev, &dev_attr_streaming); + video_device_create_file(vdev, &dev_attr_palette); + video_device_create_file(vdev, &dev_attr_frames_total); + video_device_create_file(vdev, &dev_attr_frames_read); + video_device_create_file(vdev, &dev_attr_packets_dropped); + video_device_create_file(vdev, &dev_attr_decoding_errors); } static void m560x_remove_sysfs_files(struct video_device *vdev) { - video_device_remove_file(vdev, &class_device_attr_model); - video_device_remove_file(vdev, &class_device_attr_in_use); - video_device_remove_file(vdev, &class_device_attr_streaming); - video_device_remove_file(vdev, &class_device_attr_palette); - video_device_remove_file(vdev, &class_device_attr_frames_total); - video_device_remove_file(vdev, &class_device_attr_frames_read); - video_device_remove_file(vdev, &class_device_attr_packets_dropped); - video_device_remove_file(vdev, &class_device_attr_decoding_errors); + video_device_remove_file(vdev, &dev_attr_model); + video_device_remove_file(vdev, &dev_attr_in_use); + video_device_remove_file(vdev, &dev_attr_streaming); + video_device_remove_file(vdev, &dev_attr_palette); + video_device_remove_file(vdev, &dev_attr_frames_total); + video_device_remove_file(vdev, &dev_attr_frames_read); + video_device_remove_file(vdev, &dev_attr_packets_dropped); + video_device_remove_file(vdev, &dev_attr_decoding_errors); } /* * --------------------------------------------------------------------------- @@ -2828,7 +2828,6 @@ static int usb_m560x_probe(struct usb_in strcpy(cam->vdev->name, "Ali M560x-based USB Camera"); cam->vdev->owner = THIS_MODULE; cam->vdev->type = VID_TYPE_CAPTURE; - cam->vdev->hardware = VID_HARDWARE_M560X; cam->vdev->fops = &v4l_m560x_fops; cam->vdev->release = video_device_release; cam->vdev->minor = -1; --~--~---------~--~----~------------~-------~--~----~ GUS-BR - Grupo de Usuários de Slackware Brasil http://www.slackwarebrasil.org/ http://groups.google.com/group/slack-users-br -~----------~----~----~----~------~----~------~--~---

