USB设备驱动开发详解
1. 遥测卡数据传输
在USB设备驱动开发中,遥测卡的数据传输是一个重要的部分。以下是相关的代码和操作流程。
首先是提交URB(USB请求块)的代码:
/* Submit the URB */
usb_submit_urb(tele_device->ctrl_urb, GFP_ATOMIC);
/* Wait until the callback returns indicating that the telemetry
configuration register has been successfully initialized */
wait_for_completion(&tele_config_done);
/* Release our reference to the URB */
usb_free_urb(urb);
kfree(tmp);
/* Save the device-specific object to the file’s private_data
so that you can directly retrieve it from other entry points
such as tele_read() and tele_write() */
file->private_data = tele_device;
/* Return the URB transfer status */
return(tele_device->ctrl_urb->status);
这里使用了异步方式提交
超级会员免费看
订阅专栏 解锁全文
1014

被折叠的 条评论
为什么被折叠?



