QQ登录

只需一步,快速开始

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 598|回复: 0

摄像头求助:turbo 10上编译spca5xx失败

[复制链接]
发表于 2005-5-21 15:54:57 | 显示全部楼层 |阅读模式
通天下850的摄像头,Mani="Z-Star Corp.",Vendor=0AC8 ProdID=301B,spca5xx是可以驱动的,可是在turbolinux 10上编译不了。


   Building SPCA5XX driver for 2.5/2.6 kernel.
   Remember: you must have read/write access to your kernel source tree.
make -C /lib/modules/`uname -r`/build SUBDIRS=/usr/src/spca5xx-20050501 modules
make[1]: Entering directory `/usr/src/linux-2.6.0'
*** Warning: Overriding SUBDIRS on the command line can cause
***          inconsistencies
make[2]: “arch/i386/kernel/asm-offsets.s”是最新的。
  CC [M]  /usr/src/spca5xx-20050501/drivers/usb/spca5xx.o
/usr/src/spca5xx-20050501/drivers/usb/spca5xx.c: In function `spca50x_set_packet_size':
/usr/src/spca5xx-20050501/drivers/usb/spca5xx.c:1844: error: `config' undeclared (first use in this function)
/usr/src/spca5xx-20050501/drivers/usb/spca5xx.c:1844: error: (Each undeclared identifier is reported only once
/usr/src/spca5xx-20050501/drivers/usb/spca5xx.c:1844: error: for each function it appears in.)
/usr/src/spca5xx-20050501/drivers/usb/spca5xx.c:1848: error: structure has no member named `wMaxPacketSize'
/usr/src/spca5xx-20050501/drivers/usb/spca5xx.c:1769: warning: unused variable `dev'
/usr/src/spca5xx-20050501/drivers/usb/spca5xx.c:1776: warning: unused variable `intf'
make[2]: *** [/usr/src/spca5xx-20050501/drivers/usb/spca5xx.o] 错误 1
make[1]: *** [/usr/src/spca5xx-20050501] 错误 2
make[1]: Leaving directory `/usr/src/linux-2.6.0'
make: *** [default] 错误 2


这是spca5xx.c中出错提示里的相应内容
static int
spca50x_set_packet_size (struct usb_spca50x *spca50x, int size)
{
  int alt;
        /**********************************************************************/
        /******** Try to find real Packet size from usb struct ****************/
  struct usb_device *dev = spca50x->dev;                                               <-----这是1769行
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)
  struct usb_interface_descriptor *interface = NULL;

  struct usb_config_descriptor *config = dev->actconfig;
#else
  struct usb_host_interface *interface = NULL;
  struct usb_interface *intf;                                                                      <-----这是1776行
#endif
  int mysize = 0;


        /**********************************************************************/

  if (size == 0)
    alt = SPCA50X_ALT_SIZE_0;
  else if (size == 12
    alt = SPCA50X_ALT_SIZE_128;
  else if (size == 256)
    alt = SPCA50X_ALT_SIZE_256;
  else if (size == 384)
    alt = SPCA50X_ALT_SIZE_384;
  else if (size == 512)
    alt = SPCA50X_ALT_SIZE_512;
  else if (size == 640)
    alt = SPCA50X_ALT_SIZE_640;
  else if (size == 76
    alt = SPCA50X_ALT_SIZE_768;
  else if (size == 896)
    alt = SPCA50X_ALT_SIZE_896;
  else if (size ==1000)
    alt = ETOMS_ALT_SIZE_1000;
  else if (size == 1023)
    if (spca50x->bridge == BRIDGE_SONIX ||
            spca50x->bridge == BRIDGE_SN9C102P)
      {
        alt = 8;
      }
    else
      {
        alt = SPCA50X_ALT_SIZE_1023;
      }
  else
    {
      /* if an unrecognised size, default to the minimum */
      PDEBUG (5, "Set packet size: invalid size (%d), defaulting to %d",
              size, SPCA50X_ALT_SIZE_12;
      alt = SPCA50X_ALT_SIZE_128;
    }


  PDEBUG (5, "iface alt: %d %d ", spca50x->iface, alt);
  if (usb_set_interface (spca50x->dev, spca50x->iface, alt) < 0)
    {
      err ("Set packet size: set interface error");
      return -EBUSY;
    }

#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,3)
  intf = usb_ifnum_to_if (dev, spca50x->iface);
  if (intf)
    {
      interface = usb_altnum_to_altsetting (intf, alt);
    }
  else
    {
      PDEBUG (0, "intf not found");
      return -ENXIO;
    }
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,11)
   mysize = le16_to_cpu(interface->endpoint[0].desc.wMaxPacketSize);
#else
   mysize = (interface->endpoint[0].desc.wMaxPacketSize);
#endif
#else
  interface = &config->interface[spca50x->iface].altsetting[alt];                      <-----这是1844行
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,11)
  mysize = le16_to_cpu(interface->endpoint[0].wMaxPacketSize);
#else
  mysize = (interface->endpoint[0].wMaxPacketSize);                             <-----这是1848行
#endif  
#endif
  
  spca50x->packet_size = mysize & 0x03ff;
  spca50x->alt = alt;
  PDEBUG (1, "set real packet size: %d, alt=%d", mysize, alt);
  return 0;
}
您需要登录后才可以回帖 登录 | 注册

本版积分规则

GMT+8, 2024-11-15 09:11 , Processed in 0.046741 second(s), 16 queries .

© 2021 Powered by Discuz! X3.5.

快速回复 返回顶部 返回列表