Sean Boudreau(deleted)
|
Re: problem in transfering data between application and driver
|
Sean Boudreau(deleted)
03/20/2008 12:15 PM
post6012
|
Re: problem in transfering data between application and driver
On Thu, Mar 20, 2008 at 12:03:37PM -0400, Arun Hegde wrote:
> Hi,
>
> I am working on WLAN driver which follows io-net framework. I have an application, which looks as follows:
>
>
> struct mystruct{
> int count;
> char *data;
> };
> uint8_t buf[SCAN_MAX_DATA];
>
> struct mystruct var;
> var.data = buf;
>
> and i am calling devctl as follows.
>
> if(devctl(fd,cmd,&var,sizeof(var),NULL) >= 0)
> {
> }
>
>
> I am filling up this data( var. data which is pointing to buf in application) in my driver. But in my appliction when
i read the buffer i am not able get the data which is filled by the driver.
> My doubt is as both application and driver runs as separate processes, the buf from the application is not being
copied to derivers process space.
> How do i get the correct datain application which is modified by my driver?
That's the problem exactly. You can't pass pointers
between processes (io-net isn't a monolithic kernel).
Change mystruct to:
struct mystruct{
int count;
char data[SCAN_MAX_DATA];
};
-seanb
|
|
|