Visit the LQ Articles and Editorials section
Go Back > Forums > Linux Forums > Linux - Hardware
User Name
Linux - Hardware This forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?


  Search this Thread
Old 06-27-2005, 05:51 AM   #1
LQ Newbie
Registered: Jun 2005
Posts: 1

Rep: Reputation: 0
Angry A curious problem with driver transplant

I have a osprey 560 card with SDI input.But osprey's driver which is based on bttv-0.7.97 is only available for kernel2.4.
Now,I want to transplant the code(related to SDI )to bttv-0.9.15.
I met with a curious problem.When I haved finished the transplant,I make,the errors are as fllowed:

/gpio-osprey.c: In function `do_osprey_firmware_load':
/gpio-osprey.c:794: warning: implicit declaration of function `open'
/gpio-osprey.c:800: warning: implicit declaration of function `lseek'
/gpio-osprey.c:804: warning: implicit declaration of function `sys_close'
/gpio-osprey.c:816: warning: implicit declaration of function `read'
/gpio-osprey.c:824: warning: implicit declaration of function `close'
Building modules, stage 2.
*** Warning: "close" [/bttv-0.9.15/bttv.ko] undefined!
*** Warning: "open" [/bttv-0.9.15/bttv.ko] undefined!
*** Warning: "read" [/bttv-0.9.15/bttv.ko] undefined!
*** Warning: "lseek" [/bttv-0.9.15/bttv.ko] undefined!

The function 'do_osprey_firmware_load' is as such

/* all this because the allowed maximum length is too small */

#include <linux/module.h>
#include <linux/fs.h>
#include <linux/mm.h>
#include <linux/slab.h>
#include <linux/unistd.h>
#include <asm/uaccess.h>

static int errno;
static int do_osprey_firmware_load(const char *fn, char **fp)
int fd;
long l;
char *dp;

fd = open(fn, 0, 0);
if (fd == -1)
printk(KERN_INFO "gpio: Unable to load firmware '%s'.\n", fn);
return 0;
l = lseek(fd, 0L, 2);
if (l <= 0 || l > (256*1024))
printk(KERN_INFO "gpio: Firmware '%s' has bad length %ld\n", fn,l);
return 0;
lseek(fd, 0L, 0);
dp = vmalloc(l);
if (dp == NULL)
printk(KERN_INFO "Out of memory loading firmware '%s'.\n", fn);
return 0;
if (read(fd, dp, l) != l)
printk(KERN_INFO "Failed to read firmware '%s'.\n", fn);
return 0;
*fp = dp;
return (int) l;

What caused the warnings? Is there anyone could help me?
Old 06-27-2005, 10:57 PM   #2
Registered: Nov 2004
Location: San Jose, CA
Distribution: Ubuntu
Posts: 8,507

Rep: Reputation: 122Reputation: 122
Are you porting this to 2.6? Much of the kernel interface for modules has been changed since 2.4.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
transplant OO.o 2.0 beta from KNOPPIX to Ubuntu - is it possible? exit3219 Linux - Software 2 08-25-2005 05:48 AM
Linux Transplant MikeZila Linux - Hardware 2 12-16-2004 12:07 AM
curious problem wrat VectorLinux 11 05-20-2004 07:42 AM
I'm curious (gigabit driver) wombatman Linux - Software 1 08-24-2003 09:33 PM
Curious problem.... Ra_ Slackware 2 06-02-2003 10:44 AM

All times are GMT -5. The time now is 11:21 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration