<div>&nbsp;</div>
<div>Hi</div>
<div>&nbsp;</div>
<div>I am working on hostap-0.4.7 version. I am trying to transfer some information from the driver to a user space code using copy_to_user function.</div>
<div>&nbsp;</div>
<div>I have made a new sub-ioctl which is called from the userspace program. The user space program makes a iwreq structure and makes an ioctl call to this sub-ioctl.</div>
<div>&nbsp;</div>
<div>In the driver, I have made the following changes in prism2_ioctl_priv_get_prism2_param</div>
<div>&nbsp;</div>
<div>...</div>
<div>struct iw_point * data_p = (struct iw_point *) wrqu;</div>
<div>char temp[] = &quot;This data needs to be passed to userspace&quot;;</div>
<div>int bytes_left;</div>
<div>...</div>
<div>...</div>
<div>...</div>
<div>case: MY_SUB_IOCTL:<br clear="all">&nbsp;&nbsp;&nbsp;&nbsp; bytes_left = copy_to_user(data_p-&gt;pointer, temp, 40);</div>
<div>&nbsp;&nbsp;&nbsp;&nbsp; //bytes_left = 40 </div>
<div>&nbsp;</div>
<div>&nbsp;</div>
<div>All the bytes are left out by the copy_to_user . I verified whether data_p-&gt;pointer is a valid place to write using</div>
<div>access_ok(VERIFY_WRITE, data_p-&gt;pointer, 40) which returned 1, meaning its ok to write there.</div>
<div>&nbsp;</div>
<div>Neither I am able to write to the user space .. nor able to read from there.</div>
<div>Am I missing some thing here... Or doing something wrong?</div>
<div>&nbsp;</div>
<div>Could someone please help me out ..</div>
<div>Thnx</div>
<div><br>-- <br>Abhinav Pathak<br>&nbsp;</div>