2008-04-01 02:22:43     "scmd_dev_t" Error

Document created by Aaronwu Employee on Aug 6, 2013
Version 1Show Document
  • View in full screen mode

2008-04-01 02:22:43     "scmd_dev_t" Error

sathish kumar (HAITI)

Message: 53402    hai to all,

                  i have been trying to access the frame data defined in the kernel from the user space using a simple driver by IOCTL command ,  when i try to compile the driver alone  it shows the error looks like 'scmd_dev_t' not defined i searched for it in the full distribution but no clues. My distribution is 2007R1-RC3 in Ezkit BF561.

 

My driver looks like this,

 

static int scmd_ioctl(struct inode* inode , struct file* filp ,               

                                  unsigned int cmd , unsigned long  arg ) {

     int ret;                                                            

     int count;                                                          

     char temp[SCMD_SIZE];                                               

     scmd_dev_t * dev;                                                   

 

     count = SCMD_SIZE;                                                  

     dev = (scmd_dev_t *)filp->private_data;                            

 

 

       if(cmd== SCMD_IOCGETD)                                               

           if(copy_to_user((unsigned char *)arg, dev->data, count))      

               return -EFAULT;                                           

           return 0;                                                     

 

  }     

static struct file_operations scmd_driver_fops ={

       // write:scmd_write,

    // set up the ioctl function

    ioctl:scmd_ioctl

};

 

 

the error out comes is

 

 

[root@localhost uClinux-dist]# make

make ARCH=blackfin CROSS_COMPILE=bfin-uclinux- -j1 -C linux-2.6.x  || exit 1

make[1]: Entering directory `/work_15.12.07/work/uClinux-dist/linux-2.6.x'

  CHK     include/linux/version.h

  CHK     include/linux/utsrelease.h

  CHK     include/linux/compile.h

  CC      drivers/char/bfin_ppi.o

drivers/char/bfin_ppi.c: In function ‘ppi0_open’:

drivers/char/bfin_ppi.c:292: warning: format ‘%x’ expects type ‘unsigned int’, but argument 2 has type ‘volatile short int (*)[450449u]’

drivers/char/bfin_ppi.c:290: warning: unused variable ‘i’

drivers/char/bfin_ppi.c: In function ‘scmd_ioctl’:

drivers/char/bfin_ppi.c:463: error: ‘scmd_dev_t’ undeclared (first use in this function)

drivers/char/bfin_ppi.c:463: error: (Each undeclared identifier is reported only once

drivers/char/bfin_ppi.c:463: error: for each function it appears in.)

drivers/char/bfin_ppi.c:463: error: ‘dev’ undeclared (first use in this function)

drivers/char/bfin_ppi.c:466: error: expected expression before ‘)’ token

drivers/char/bfin_ppi.c:462: warning: unused variable ‘temp’

drivers/char/bfin_ppi.c:460: warning: unused variable ‘ret’

make[3]: *** [drivers/char/bfin_ppi.o] Error 1

make[2]: *** [drivers/char] Error 2

make[1]: *** [drivers] Error 2

make[1]: Leaving directory `/work_15.12.07/work/uClinux-dist/linux-2.6.x'

make: *** [linux] Error 1

 

help me in this regard.

 

sathish.

 

QuoteReplyEditDelete

 

 

2008-04-01 04:58:01     Re: "scmd_dev_t" Error

Yi Li (CHINA)

Message: 53437    are you following : http://docs.blackfin.uclinux.org/doku.php?id=ioctl_functions?

 

The code is just an example.

Attachments

    Outcomes