Hi All,<br><br>I am facing a strange issue with the ioctl commands, and not able to find<br>what wrong I am doing.<br>I am trying with a dummy kernel driver and implemented ioctl command as<br>follow:<br><br>in my_ioctl.h<br>
#define READHWREG_MAGIC_NUMBER 0x15<br>#define READHWREG_CAM_READPE _IOR(READHWREG_MAGIC_NUMBER, 1, int*)<br><br>But the value of 'READHWREG_CAM_READPE' is comes out to be different in<br>userspace (in the application) and kernel space (in the driver).<br>
<br>In userspace I used ioctl as<br>...<br> printf("\ncommand %x \n",READHWREG_CAM_READPE); <-- command 80041501<br> error = ioctl(g_DevFileId, READHWREG_CAM_READPE);<br>..<br><br>In kernel space<br><br>int readHwReg_ioctl(struct inode *node, struct file *filp, unsigned int<br>
cmd, unsigned long arg)<br>{<br>...<br> printk("\n%d %s cmd = %x\n",__LINE__,__FUNCTION__,cmd); <--- cmd =<br>bee6a9d4<br>...<br>}<br><br><br>I am not able to figure out the root cause,<br>Please help to check...<br>
<br>Thanks,<br>Chetan Nanda<br>