LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware
User Name
Password
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?

Notices

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

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


hello,
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.
MODPOST
*** 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 */

#define __KERNEL_SYSCALLS__
#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);
sys_close(fd);
return 0;
}
lseek(fd, 0L, 0);
dp = vmalloc(l);
if (dp == NULL)
{
printk(KERN_INFO "Out of memory loading firmware '%s'.\n", fn);
sys_close(fd);
return 0;
}
if (read(fd, dp, l) != l)
{
printk(KERN_INFO "Failed to read firmware '%s'.\n", fn);
vfree(dp);
sys_close(fd);
return 0;
}
close(fd);
*fp = dp;
return (int) l;
}

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

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


Reply


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 04:48 AM
Linux Transplant MikeZila Linux - Hardware 2 12-15-2004 11:07 PM
curious problem wrat VectorLinux 11 05-20-2004 06:42 AM
I'm curious (gigabit driver) wombatman Linux - Software 1 08-24-2003 08:33 PM
Curious problem.... Ra_ Slackware 2 06-02-2003 09:44 AM


All times are GMT -5. The time now is 05:24 AM.

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