1 /* SPDX-License-Identifier: GPL-2.0 */ 2 /* 3 * Copyright (c) 2022 Huawei Device Co., Ltd. 4 */ 5 6 #ifndef _BTDEV_USER_H_ 7 #define _BTDEV_USER_H_ 8 9 #include <linux/if.h> 10 #include <linux/ioctl.h> 11 12 #define BT_VIRNET_NAME_PREFIX "btn" 13 #define BT_DEV_NAME_PREFIX "btdev" 14 #define BT_DEV_PATH_PREFIX "/dev/" BT_DEV_NAME_PREFIX 15 16 #define bt_dev_path(idx) (BT_DEV_PATH_PREFIX#idx) 17 #define bt_dev_name(idx) (BT_DEV_NAME_PREFIX#idx) 18 19 #define BT_DEV_NAME_MNG_FILE bt_dev_name(0) 20 #define BT_DEV_PATH_MNG_FILE bt_dev_path(0) 21 #define bt_dev_name_to_file(idx) bt_dev_name(idx) 22 #define bt_dev_path_to_file(idx) bt_dev_path(idx) 23 #define bt_virnet_name(idx) (BT_VIRNET_NAME_PREFIX#idx) 24 25 #define BT_VIRNET_MAX_NUM 16 26 #define BT_VIRNET_DATA_HEAD_LEN 2 27 28 /** 29 * ioctl cmd 30 */ 31 #define BT_IOC_CREATE _IO('b', 1) 32 #define BT_IOC_DELETE _IO('b', 2) 33 #define BT_IOC_CHANGE_MTU _IO('b', 3) 34 #define BT_IOC_QUERY_ALL _IO('b', 4) 35 #define BT_IOC_DELETE_ALL _IO('b', 5) 36 #define BT_IOC_ENABLE _IO('b', 6) 37 #define BT_IOC_DISABLE _IO('b', 7) 38 #define BT_IOC_PEEK_PACKET _IO('b', 8) 39 40 /** 41 * user space ioctl arguments 42 */ 43 struct bt_uioc_args { 44 char ifa_name[IFNAMSIZ]; 45 char cfile_name[IFNAMSIZ]; 46 }; 47 48 #endif 49