rename some members of bufinfo struct to make output mmaps
authorFrank Mori Hess <fmhess@speakeasy.net>
Sun, 23 Jan 2005 02:45:47 +0000 (02:45 +0000)
committerFrank Mori Hess <fmhess@speakeasy.net>
Sun, 23 Jan 2005 02:45:47 +0000 (02:45 +0000)
workable

comedi/comedi_fops.c
include/linux/comedi.h

index 369218b8b6424481fddaa6adcec6eec769027f39..2d889bada5adc8cff72760199cb973a58cd56591 100644 (file)
@@ -487,10 +487,10 @@ static int do_bufinfo_ioctl(comedi_device *dev,void *arg)
 
        if(!async){
                DPRINTK("subdevice does not have async capability\n");
-               bi.buf_int_ptr = 0;
-               bi.buf_user_ptr = 0;
-               bi.buf_int_count = 0;
-               bi.buf_user_count = 0;
+               bi.buf_write_ptr = 0;
+               bi.buf_read_ptr = 0;
+               bi.buf_write_count = 0;
+               bi.buf_read_count = 0;
                goto copyback;
        }
 
@@ -510,21 +510,15 @@ static int do_bufinfo_ioctl(comedi_device *dev,void *arg)
                comedi_buf_write_free(async, bi.bytes_written);
        }
 
+       bi.buf_write_count = async->buf_write_count;
+       bi.buf_write_ptr = async->buf_write_ptr;
+       bi.buf_read_count = async->buf_read_count;
+       bi.buf_read_ptr = async->buf_read_ptr;
        if(s==dev->read_subdev){
                unsigned int n_munge_bytes;
-
-               bi.buf_int_count = async->buf_write_count;
-               bi.buf_int_ptr = async->buf_write_ptr;
-               bi.buf_user_count = async->buf_read_count;
-               bi.buf_user_ptr = async->buf_read_ptr;
-
-               n_munge_bytes = bi.buf_int_count - s->async->munge_count;
+               
+               n_munge_bytes = bi.buf_write_count - s->async->munge_count;
                comedi_buf_munge(dev, s, n_munge_bytes);
-       }else{
-               bi.buf_int_count = async->buf_read_count;
-               bi.buf_int_ptr = async->buf_read_ptr;
-               bi.buf_user_count = async->buf_write_count;
-               bi.buf_user_ptr = async->buf_write_ptr;
        }
 
 copyback:
index f344656cbb1b0f2a0a22dc860c94bee0a2603918..a22c2b203cef1156f6e383aac2673e5d7a47887b 100644 (file)
@@ -389,10 +389,10 @@ struct comedi_bufinfo_struct{
        unsigned int subdevice;
        unsigned int bytes_read;
 
-       unsigned int buf_int_ptr;
-       unsigned int buf_user_ptr;
-       unsigned int buf_int_count;
-       unsigned int buf_user_count;
+       unsigned int buf_write_ptr;
+       unsigned int buf_read_ptr;
+       unsigned int buf_write_count;
+       unsigned int buf_read_count;
 
        unsigned int bytes_written;