serial/uart/h4: add ioctl interface

Signed-off-by: chengkai <chengkai@xiaomi.com>
This commit is contained in:
chengkai 2022-08-11 15:50:07 +08:00 committed by Xiang Xiao
parent 841d8f5b37
commit d78ffeca71
2 changed files with 14 additions and 1 deletions

View File

@ -351,7 +351,15 @@ out:
static int uart_bth4_ioctl(FAR struct file *filep, int cmd,
unsigned long arg)
{
return OK;
FAR struct inode *inode = filep->f_inode;
FAR struct uart_bth4_s *dev = inode->i_private;
if (!dev->drv->ioctl)
{
return -ENOTTY;
}
return dev->drv->ioctl(dev->drv, cmd, arg);
}
static int uart_bth4_poll(FAR struct file *filep, FAR struct pollfd *fds,

View File

@ -79,6 +79,11 @@ struct bt_driver_s
enum bt_buf_type_e type,
FAR void *data, size_t len);
/* Lower-half logic may support platform-specific ioctl commands */
CODE int (*ioctl)(FAR struct bt_driver_s *btdev, int cmd,
unsigned long arg);
/* Filled by register function, shouldn't be touched by bt_driver_s */
FAR void *priv;