Modify *run_ioctl* function

Make *run_ioctl* a simple wrapper for *ioctl* function.
*run_ioctl_retry* is old *run_ioctl* function.

Signed-off-by: Slawomir Jankowski <slawomir.jankowski@intel.com>
This commit is contained in:
Slawomir Jankowski 2020-04-09 09:37:29 +02:00
parent 606c4ea8f6
commit 0d1730af37
2 changed files with 13 additions and 1 deletions

View File

@ -469,12 +469,23 @@ int run_ioctl_interruptible(int fd, int command, void *cmd,
} }
/* /*
* @brief ioctl wrapper that retries ioctl attempts within one second timeouts * @brief ioctl wrapper
* @param[in] fd as for IOCTL(2) * @param[in] fd as for IOCTL(2)
* @param[in] command as for IOCTL(2) * @param[in] command as for IOCTL(2)
* @param[inout] cmd_info as for IOCTL(2) * @param[inout] cmd_info as for IOCTL(2)
*/ */
int run_ioctl(int fd, int command, void *cmd) int run_ioctl(int fd, int command, void *cmd)
{
return ioctl(fd, command, cmd);
}
/*
* @brief ioctl wrapper that retries ioctl attempts within one second timeouts
* @param[in] fd as for IOCTL(2)
* @param[in] command as for IOCTL(2)
* @param[inout] cmd_info as for IOCTL(2)
*/
int run_ioctl_retry(int fd, int command, void *cmd)
{ {
int i, ret; int i, ret;
struct timespec timeout = { struct timespec timeout = {

View File

@ -28,6 +28,7 @@ struct progress_status {
void init_progress_bar(struct progress_status *ps); void init_progress_bar(struct progress_status *ps);
void print_progress_bar_or_indicator(float prog, struct progress_status *ps); void print_progress_bar_or_indicator(float prog, struct progress_status *ps);
int run_ioctl(int fd, int command, void *cmd); int run_ioctl(int fd, int command, void *cmd);
int run_ioctl_retry(int fd, int command, void *cmd);
int run_ioctl_interruptible(int fd, int command, void *cmd, int run_ioctl_interruptible(int fd, int command, void *cmd,
char *friendly_name, int cache_id, int core_id); char *friendly_name, int cache_id, int core_id);
int open_ctrl_device(); int open_ctrl_device();