Sunday, January 26, 2014
When you open the android wifi, automatically load module is how to achieve
When the younger brother wanted to achieve a functional, open android camera, in the form of modules loaded camera driver, thought the punch when wifi is also automatically load the module, so along with the code found in. / Hardware / libhardware_legacy / wifi / wifi.c This file has a loadable module for the corresponding function implementation insmod, rmmod, I too camera's hal layer Riga code:
extern int init_module (void *, unsigned long, const char *);
extern int delete_module (const char *, unsigned int);
static int insmod (const char * filename, const char * args)
{
void * module;
unsigned int size;
int ret;
module = load_file (filename, & size);
if (! module)
return -1;
ret = init_module (module, size, args);
free (module);
return ret;
}
static int rmmod (const char * modname)
{
int ret = -1;
int maxtry = 10;
while (maxtry -> 0) {
ret = delete_module (modname, O_NONBLOCK | O_EXCL);
if (ret <0 && errno == EAGAIN)
usleep (500000);
else
break;
}
if (ret! = 0)
LOGD ("Unable to unload driver module \"% s \ ":% s \ n",
modname, strerror (errno));
return ret;
}
Then add the header files and wifi.c inside the same, but when the report compiled init_module, delete_module not defined, this is extern, should be linked to a library, I see. / Hardware / libhardware_legacy / wifi / Android. Inside mk LOCAL_SHARED_LIBRARIES + = libnetutils on this one dynamic link library, I also added but still reported no definition init_module, delete_module!
Seek expert help ah ~ ~
Reply:
Oh ~ ~ ~ ~
init_module, delete_module is under bionic correspond under three platforms: assembly arm sh x86 implementations are defined.
Reply:
You search for the next, to see if there are header files. H contains the definitions of these two functions, include in.
Reply:
I say this is 555555555555555. S the impossible. H
Reply:
Useless, I wifi.c inside the header files include come, or not defined
Reply:
Well, I grep for a moment, are found in the. S which is the system call it? So why wifi.c compile time can be linked to it, which I did not write anything in Android.mk in particular, how can I do to compile before? Expert help ah ~ ~ ~
Reply:
Reply:
Encountered the same problem
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment