Hi , I'm using blooking read call to get some asyn. event from kerne space, as some one suggested previously.
I have tried to use charater driver and /proc files system. The one with c driver seems works fine. I got some problem with /proc/ when the application tries read data.
See my proc_read function bellow. This function will be waked up by interrupt service routine. It appears that appcation has problem with consecutive reads. First ready gets the same number of bytes, after that I can see the folowing function return number of bytes, while the user application's read returns always 0.
The same piece code is used in a charactor driver's read function, that one works OK.
Any suggestions?
static int proc_read_foo(char *page, char **start, off_t off, int count, int *eof, void *data) { int len; if (data_ready) { interruptibe_sleep_on(wait_queue); } memcpy(page, dada_buf, MAX_BUF_LEN); data_ready=0;
return MAX_BUF_LEN; }