![]() ![]() When I try to run my application I can see that the device was opened and immediately closed but can't see any prints from my ioctl function. I can't see any error messages, when the device driver is loaded I get all the prints. Printk("ERROR: copy_from_user in controlLED1_ioctl returned unfinished bytes\n") Result = copy_from_user(sLedControlParam, (struct s_LEDControl *)arg, sizeof(struct s_LEDControl)) Printk("ERROR: Memory allocation failed in controlLED1_ioctl\n") SLedControlParam = (struct s_LEDControl *)kmalloc(sizeof(struct s_LEDControl), GFP_KERNEL) Static int controlLED1_ioctl(unsigned int arg) Static int device_ioctl( struct inode *inode, struct file *filp, unsigned int cmd, unsigned long arg)Ĭase c_controlLED1: controlLED1_ioctl(arg) ĭefault: printk("ERROR: Invalid command %d\n", e_cmd) ![]() ** Assign device functions to file_operation structure */ The above C program is cross compiled to PPC environment.īelow is some part of the driver code MODULE_LICENSE("XXX") I am new to linux and device drivers, any help would be appreciated. Just to check if something was wrong with the file descriptor, I passed a dummy file descriptor to ioctl and I got the correct error number. Printf("ERROR: ioctl failed Reason:%s FD:%d\n", strerror(errno), fDDevice) IoctlReturn = ioctl(fDDevice, c_controlLED1,
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |