Re: webcam support

From: <poeml_at_cmdline.net>
Date: Thu, 19 May 2005 14:00:23 +0200
Hi Michel, 

[I took the list into Cc for archival. If you want to get onto the list,
the instructions how to do it are at http://cl20.poeml.de/lists, so
then we could discuss on list. If not, fine, I will just continue to Cc
you / the list if you don't mind.]

On Tue, May 03, 2005 at 09:46:00AM +0200, Peter Poeml wrote:
> On Mon, May 02, 2005 at 02:47:19PM +0200, michel Xhaard wrote:
> > just download the last spca5xx module from http://mxhaard.free.fr
> > install is simple you only need your kernel source installed then make and 
> > make install is enought :)
> 
> I tried it on my G3 Powerbook.
> 
> I'm using 2.4.27, more or less vanilla.
> 
> pte_offset_kernel is not known to my kernel:
> 
> drivers/usb/spca5xx.c: In function `uvirt_to_kva':
> drivers/usb/spca5xx.c:981: warning: implicit declaration of function `pte_offset_kernel'
> drivers/usb/spca5xx.c:981: warning: assignment makes pointer from integer without a cast
> 
> If I build with -Dpte_offset (which is available in my kernel), I get:
> 
> 
> In file included from /lib/modules/2.4.27-3-default/build/include/linux/mm.h:26,
>                  from /lib/modules/2.4.27-3-default/build/include/linux/poll.h:10,
>                  from /lib/modules/2.4.27-3-default/build/include/linux/videodev.h:9,
>                  from drivers/usb/spca5xx.h:12,
>                  from drivers/usb/spcadecoder.h:5,
>                  from drivers/usb/spcadecoder.c:35:
> /lib/modules/2.4.27-3-default/build/include/asm/pgtable.h:608: syntax error before numeric constant
> make: *** [drivers/usb/spcadecoder.o] Error 1
> 
> 
> I don't understand that error -- the function is defined like this in
> 2.4.27:
> 
> /* Find an entry in the third-level page table.. */
> static inline pte_t * pte_offset(pmd_t * dir, unsigned long address)
> {
>         return (pte_t *) pmd_page(*dir) + ((address >> PAGE_SHIFT) & (PTRS_PER_PTE - 1));
> }
> 
> 
> What could be the problem? Do you have any idea?
> 
> Peter

I finally got around having a closer look, and it seems to boil down to
just a missing include. With the following patch the module compiles
fine:

--- a/drivers/usb/spca5xx.c Thu May 19 11:05:58 2005
+++ b/drivers/usb/spca5xx.c Thu May 19 13:32:05 2005
@@ -42,6 +42,7 @@


 #include <linux/fs.h>
+#include <asm/pgtable.h>
 #include <linux/vmalloc.h>
 #include <linux/sched.h>
 #include <linux/slab.h>
@@ -978,7 +979,7 @@
 #ifdef pte_offset
          ptep = pte_offset (pmd, adr);
 #else /* pte_offset */
-         ptep = pte_offset_kernel (pmd, adr);
+         ptep = pte_offset (pmd, adr);
 #endif /* pte_offset */
          pte = *ptep;
          if (pte_present (pte))



(The #ifdef pte_offset seems to be broken.)


FWIW, I used the following compiler flags; -mpreferred-stack-boundary
appears to be unknown to my compiler (gcc-323 on ppc32 linux-2.4.30):

-CFLAGS    += -mpreferred-stack-boundary=2
+CFLAGS    += -I/usr/src/linux-2.4.30-1/include -Wall -Wstrict-prototypes -Wno-trigraphs -O2 -fno-strict-aliasing -fno-common -fomit-frame-pointer -I/usr/src/linux-2.4.30-1/arch/ppc -fsigned-char -msoft-float -pipe -ffixed-r2 -Wno-uninitialized -mmultiple -mstring -nostdinc -iwithprefix include



After loading videodev.o, I can insmod the module, and if I plug in the
camera (and switch it on) the kernel logs this:

May 19 13:23:52 cube kernel: hub.c: connect-debounce failed, port 2 disabled
May 19 13:23:55 cube kernel: hub.c: new USB device 10:18.0-2.1.2, assigned address 6
May 19 13:23:55 cube kernel: drivers/usb/spca5xx.c: USB SPCA5XX camera found. Agfa ephoto CL20 spca500a
May 19 13:23:55 cube kernel: drivers/usb/spca5xx.c: [spca5xx_probe:8175] Camera type JPEG

Promising as this is, :-) I'll build the viewer program next, and see
what happens.

Best regards,
Peter

PS. We have a bird breeding on the balcony since yesterday, so the
webcam needs to get going ;)
-- 
the big can of spam got the tasty can of spam
Received on Thu May 19 2005 - 14:00:25 CEST

This archive was generated by hypermail 2.2.0 : Tue Oct 20 2009 - 17:33:21 CEST