Hi Joseph, Thank you for the patch! Yet something to improve: [auto build test ERROR on bluetooth-next/master] [also build test ERROR on next-20210813] [cannot apply to bluetooth/master v5.14-rc5] [If your patch is applied to the wrong git tree, kindly drop us a note. And when submitting patch, we suggest to use '--base' as documented in https://git-scm.com/docs/git-format-patch] url: https://github.com/0day-ci/linux/commits/Joseph-Hwang/Bluetooth-btusb-disable-Intel-link-statistics-telemetry-events/20210814-005423 base: https://git.kernel.org/pub/scm/linux/kernel/git/bluetooth/bluetooth-next.git master config: m68k-allmodconfig (attached as .config) compiler: m68k-linux-gcc (GCC) 11.2.0 reproduce (this is a W=1 build): wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross # https://github.com/0day-ci/linux/commit/7a3d3d918d33f8f8796cb27e1f137c56c2afaeac git remote add linux-review https://github.com/0day-ci/linux git fetch --no-tags linux-review Joseph-Hwang/Bluetooth-btusb-disable-Intel-link-statistics-telemetry-events/20210814-005423 git checkout 7a3d3d918d33f8f8796cb27e1f137c56c2afaeac # save the attached .config to linux build tree mkdir build_dir COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross O=build_dir ARCH=m68k SHELL=/bin/bash net/bluetooth/ If you fix the issue, kindly add following tag as appropriate Reported-by: kernel test robot <lkp@xxxxxxxxx> All error/warnings (new ones prefixed by >>): net/bluetooth/mgmt.c: In function 'set_exp_feature': >> net/bluetooth/mgmt.c:4084:12: error: invalid storage class for function 'get_device_flags' 4084 | static int get_device_flags(struct sock *sk, struct hci_dev *hdev, void *data, | ^~~~~~~~~~~~~~~~ >> net/bluetooth/mgmt.c:4084:1: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement] 4084 | static int get_device_flags(struct sock *sk, struct hci_dev *hdev, void *data, | ^~~~~~ >> net/bluetooth/mgmt.c:4134:13: error: invalid storage class for function 'device_flags_changed' 4134 | static void device_flags_changed(struct sock *sk, struct hci_dev *hdev, | ^~~~~~~~~~~~~~~~~~~~ >> net/bluetooth/mgmt.c:4148:12: error: invalid storage class for function 'set_device_flags' 4148 | static int set_device_flags(struct sock *sk, struct hci_dev *hdev, void *data, | ^~~~~~~~~~~~~~~~ >> net/bluetooth/mgmt.c:4206:13: error: invalid storage class for function 'mgmt_adv_monitor_added' 4206 | static void mgmt_adv_monitor_added(struct sock *sk, struct hci_dev *hdev, | ^~~~~~~~~~~~~~~~~~~~~~ >> net/bluetooth/mgmt.c:4236:12: error: invalid storage class for function 'read_adv_mon_features' 4236 | static int read_adv_mon_features(struct sock *sk, struct hci_dev *hdev, | ^~~~~~~~~~~~~~~~~~~~~ >> net/bluetooth/mgmt.c:4324:12: error: invalid storage class for function '__add_adv_patterns_monitor' 4324 | static int __add_adv_patterns_monitor(struct sock *sk, struct hci_dev *hdev, | ^~~~~~~~~~~~~~~~~~~~~~~~~~ >> net/bluetooth/mgmt.c:4388:13: error: invalid storage class for function 'parse_adv_monitor_rssi' 4388 | static void parse_adv_monitor_rssi(struct adv_monitor *m, | ^~~~~~~~~~~~~~~~~~~~~~ >> net/bluetooth/mgmt.c:4413:11: error: invalid storage class for function 'parse_adv_monitor_pattern' 4413 | static u8 parse_adv_monitor_pattern(struct adv_monitor *m, u8 pattern_count, | ^~~~~~~~~~~~~~~~~~~~~~~~~ >> net/bluetooth/mgmt.c:4444:12: error: invalid storage class for function 'add_adv_patterns_monitor' 4444 | static int add_adv_patterns_monitor(struct sock *sk, struct hci_dev *hdev, | ^~~~~~~~~~~~~~~~~~~~~~~~ >> net/bluetooth/mgmt.c:4481:12: error: invalid storage class for function 'add_adv_patterns_monitor_rssi' 4481 | static int add_adv_patterns_monitor_rssi(struct sock *sk, struct hci_dev *hdev, | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~ >> net/bluetooth/mgmt.c:4549:12: error: invalid storage class for function 'remove_adv_monitor' 4549 | static int remove_adv_monitor(struct sock *sk, struct hci_dev *hdev, | ^~~~~~~~~~~~~~~~~~ >> net/bluetooth/mgmt.c:4614:13: error: invalid storage class for function 'read_local_oob_data_complete' 4614 | static void read_local_oob_data_complete(struct hci_dev *hdev, u8 status, | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ >> net/bluetooth/mgmt.c:4673:12: error: invalid storage class for function 'read_local_oob_data' 4673 | static int read_local_oob_data(struct sock *sk, struct hci_dev *hdev, | ^~~~~~~~~~~~~~~~~~~ >> net/bluetooth/mgmt.c:4724:12: error: invalid storage class for function 'add_remote_oob_data' 4724 | static int add_remote_oob_data(struct sock *sk, struct hci_dev *hdev, | ^~~~~~~~~~~~~~~~~~~ >> net/bluetooth/mgmt.c:4832:12: error: invalid storage class for function 'remove_remote_oob_data' 4832 | static int remove_remote_oob_data(struct sock *sk, struct hci_dev *hdev, | ^~~~~~~~~~~~~~~~~~~~~~ >> net/bluetooth/mgmt.c:4899:13: error: invalid storage class for function 'discovery_type_is_valid' 4899 | static bool discovery_type_is_valid(struct hci_dev *hdev, uint8_t type, | ^~~~~~~~~~~~~~~~~~~~~~~ >> net/bluetooth/mgmt.c:4926:12: error: invalid storage class for function 'start_discovery_internal' 4926 | static int start_discovery_internal(struct sock *sk, struct hci_dev *hdev, | ^~~~~~~~~~~~~~~~~~~~~~~~ >> net/bluetooth/mgmt.c:4994:12: error: invalid storage class for function 'start_discovery' 4994 | static int start_discovery(struct sock *sk, struct hci_dev *hdev, | ^~~~~~~~~~~~~~~ >> net/bluetooth/mgmt.c:5001:12: error: invalid storage class for function 'start_limited_discovery' 5001 | static int start_limited_discovery(struct sock *sk, struct hci_dev *hdev, | ^~~~~~~~~~~~~~~~~~~~~~~ net/bluetooth/mgmt.c:5009:12: error: invalid storage class for function 'service_discovery_cmd_complete' 5009 | static int service_discovery_cmd_complete(struct mgmt_pending_cmd *cmd, | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ net/bluetooth/mgmt.c:5016:12: error: invalid storage class for function 'start_service_discovery' 5016 | static int start_service_discovery(struct sock *sk, struct hci_dev *hdev, | ^~~~~~~~~~~~~~~~~~~~~~~ net/bluetooth/mgmt.c:5148:12: error: invalid storage class for function 'stop_discovery' 5148 | static int stop_discovery(struct sock *sk, struct hci_dev *hdev, void *data, | ^~~~~~~~~~~~~~ net/bluetooth/mgmt.c:5190:12: error: invalid storage class for function 'confirm_name' 5190 | static int confirm_name(struct sock *sk, struct hci_dev *hdev, void *data, | ^~~~~~~~~~~~ net/bluetooth/mgmt.c:5232:12: error: invalid storage class for function 'block_device' 5232 | static int block_device(struct sock *sk, struct hci_dev *hdev, void *data, | ^~~~~~~~~~~~ net/bluetooth/mgmt.c:5268:12: error: invalid storage class for function 'unblock_device' 5268 | static int unblock_device(struct sock *sk, struct hci_dev *hdev, void *data, | ^~~~~~~~~~~~~~ net/bluetooth/mgmt.c:5304:12: error: invalid storage class for function 'set_device_id' 5304 | static int set_device_id(struct sock *sk, struct hci_dev *hdev, void *data, | ^~~~~~~~~~~~~ net/bluetooth/mgmt.c:5339:13: error: invalid storage class for function 'enable_advertising_instance' 5339 | static void enable_advertising_instance(struct hci_dev *hdev, u8 status, | ^~~~~~~~~~~~~~~~~~~~~~~~~~~ net/bluetooth/mgmt.c:5345:13: error: invalid storage class for function 'set_advertising_complete' 5345 | static void set_advertising_complete(struct hci_dev *hdev, u8 status, | ^~~~~~~~~~~~~~~~~~~~~~~~ net/bluetooth/mgmt.c:5419:12: error: invalid storage class for function 'set_advertising' 5419 | static int set_advertising(struct sock *sk, struct hci_dev *hdev, void *data, | ^~~~~~~~~~~~~~~ net/bluetooth/mgmt.c:5538:12: error: invalid storage class for function 'set_static_address' 5538 | static int set_static_address(struct sock *sk, struct hci_dev *hdev, | ^~~~~~~~~~~~~~~~~~ net/bluetooth/mgmt.c:5582:12: error: invalid storage class for function 'set_scan_params' 5582 | static int set_scan_params(struct sock *sk, struct hci_dev *hdev, | ^~~~~~~~~~~~~~~ net/bluetooth/mgmt.c:5639:13: error: invalid storage class for function 'fast_connectable_complete' 5639 | static void fast_connectable_complete(struct hci_dev *hdev, u8 status, | ^~~~~~~~~~~~~~~~~~~~~~~~~ net/bluetooth/mgmt.c:5673:12: error: invalid storage class for function 'set_fast_connectable' 5673 | static int set_fast_connectable(struct sock *sk, struct hci_dev *hdev, | ^~~~~~~~~~~~~~~~~~~~ net/bluetooth/mgmt.c:5738:13: error: invalid storage class for function 'set_bredr_complete' 5738 | static void set_bredr_complete(struct hci_dev *hdev, u8 status, u16 opcode) | ^~~~~~~~~~~~~~~~~~ net/bluetooth/mgmt.c:5770:12: error: invalid storage class for function 'set_bredr' 5770 | static int set_bredr(struct sock *sk, struct hci_dev *hdev, void *data, u16 len) | ^~~~~~~~~ net/bluetooth/mgmt.c:5882:13: error: invalid storage class for function 'sc_enable_complete' 5882 | static void sc_enable_complete(struct hci_dev *hdev, u8 status, u16 opcode) | ^~~~~~~~~~~~~~~~~~ net/bluetooth/mgmt.c:5927:12: error: invalid storage class for function 'set_secure_conn' 5927 | static int set_secure_conn(struct sock *sk, struct hci_dev *hdev, | ^~~~~~~~~~~~~~~ net/bluetooth/mgmt.c:6015:12: error: invalid storage class for function 'set_debug_keys' 6015 | static int set_debug_keys(struct sock *sk, struct hci_dev *hdev, | ^~~~~~~~~~~~~~ net/bluetooth/mgmt.c:6062:12: error: invalid storage class for function 'set_privacy' 6062 | static int set_privacy(struct sock *sk, struct hci_dev *hdev, void *cp_data, | ^~~~~~~~~~~ net/bluetooth/mgmt.c:6119:13: error: invalid storage class for function 'irk_is_valid' 6119 | static bool irk_is_valid(struct mgmt_irk_info *irk) | ^~~~~~~~~~~~ net/bluetooth/mgmt.c:6135:12: error: invalid storage class for function 'load_irks' 6135 | static int load_irks(struct sock *sk, struct hci_dev *hdev, void *cp_data, | ^~~~~~~~~ net/bluetooth/mgmt.c:6206:13: error: invalid storage class for function 'ltk_is_valid' 6206 | static bool ltk_is_valid(struct mgmt_ltk_info *key) | ^~~~~~~~~~~~ net/bluetooth/mgmt.c:6225:12: error: invalid storage class for function 'load_long_term_keys' 6225 | static int load_long_term_keys(struct sock *sk, struct hci_dev *hdev, | ^~~~~~~~~~~~~~~~~~~ net/bluetooth/mgmt.c:6321:12: error: invalid storage class for function 'conn_info_cmd_complete' 6321 | static int conn_info_cmd_complete(struct mgmt_pending_cmd *cmd, u8 status) | ^~~~~~~~~~~~~~~~~~~~~~ net/bluetooth/mgmt.c:6348:13: error: invalid storage class for function 'conn_info_refresh_complete' 6348 | static void conn_info_refresh_complete(struct hci_dev *hdev, u8 hci_status, | ^~~~~~~~~~~~~~~~~~~~~~~~~~ net/bluetooth/mgmt.c:6402:12: error: invalid storage class for function 'get_conn_info' 6402 | static int get_conn_info(struct sock *sk, struct hci_dev *hdev, void *data, | ^~~~~~~~~~~~~ net/bluetooth/mgmt.c:6523:12: error: invalid storage class for function 'clock_info_cmd_complete' 6523 | static int clock_info_cmd_complete(struct mgmt_pending_cmd *cmd, u8 status) | ^~~~~~~~~~~~~~~~~~~~~~~ net/bluetooth/mgmt.c:6559:13: error: invalid storage class for function 'get_clock_info_complete' 6559 | static void get_clock_info_complete(struct hci_dev *hdev, u8 status, u16 opcode) | ^~~~~~~~~~~~~~~~~~~~~~~ net/bluetooth/mgmt.c:6591:12: error: invalid storage class for function 'get_clock_info' 6591 | static int get_clock_info(struct sock *sk, struct hci_dev *hdev, void *data, | ^~~~~~~~~~~~~~ net/bluetooth/mgmt.c:6667:13: error: invalid storage class for function 'is_connected' 6667 | static bool is_connected(struct hci_dev *hdev, bdaddr_t *addr, u8 type) | ^~~~~~~~~~~~ net/bluetooth/mgmt.c:6685:12: error: invalid storage class for function 'hci_conn_params_set' 6685 | static int hci_conn_params_set(struct hci_dev *hdev, bdaddr_t *addr, | ^~~~~~~~~~~~~~~~~~~ net/bluetooth/mgmt.c:6729:13: error: invalid storage class for function 'device_added' 6729 | static void device_added(struct sock *sk, struct hci_dev *hdev, vim +/get_device_flags +4084 net/bluetooth/mgmt.c 4c54bf2b093bb2 Abhishek Pandit-Subedi 2020-06-17 4083 4c54bf2b093bb2 Abhishek Pandit-Subedi 2020-06-17 @4084 static int get_device_flags(struct sock *sk, struct hci_dev *hdev, void *data, 4c54bf2b093bb2 Abhishek Pandit-Subedi 2020-06-17 4085 u16 data_len) 4c54bf2b093bb2 Abhishek Pandit-Subedi 2020-06-17 4086 { 4c54bf2b093bb2 Abhishek Pandit-Subedi 2020-06-17 4087 struct mgmt_cp_get_device_flags *cp = data; 4c54bf2b093bb2 Abhishek Pandit-Subedi 2020-06-17 4088 struct mgmt_rp_get_device_flags rp; 4c54bf2b093bb2 Abhishek Pandit-Subedi 2020-06-17 4089 struct bdaddr_list_with_flags *br_params; 4c54bf2b093bb2 Abhishek Pandit-Subedi 2020-06-17 4090 struct hci_conn_params *params; 4c54bf2b093bb2 Abhishek Pandit-Subedi 2020-06-17 4091 u32 supported_flags = SUPPORTED_DEVICE_FLAGS(); 4c54bf2b093bb2 Abhishek Pandit-Subedi 2020-06-17 4092 u32 current_flags = 0; 4c54bf2b093bb2 Abhishek Pandit-Subedi 2020-06-17 4093 u8 status = MGMT_STATUS_INVALID_PARAMS; 4c54bf2b093bb2 Abhishek Pandit-Subedi 2020-06-17 4094 4c54bf2b093bb2 Abhishek Pandit-Subedi 2020-06-17 4095 bt_dev_dbg(hdev, "Get device flags %pMR (type 0x%x)\n", 4c54bf2b093bb2 Abhishek Pandit-Subedi 2020-06-17 4096 &cp->addr.bdaddr, cp->addr.type); 4c54bf2b093bb2 Abhishek Pandit-Subedi 2020-06-17 4097 3ca33e3fb4f919 Abhishek Pandit-Subedi 2020-06-19 4098 hci_dev_lock(hdev); 3ca33e3fb4f919 Abhishek Pandit-Subedi 2020-06-19 4099 02ce2c2c24024a Tedd Ho-Jeong An 2021-05-26 4100 memset(&rp, 0, sizeof(rp)); 02ce2c2c24024a Tedd Ho-Jeong An 2021-05-26 4101 4c54bf2b093bb2 Abhishek Pandit-Subedi 2020-06-17 4102 if (cp->addr.type == BDADDR_BREDR) { 3d4f9c00492b4e Archie Pusaka 2021-06-04 4103 br_params = hci_bdaddr_list_lookup_with_flags(&hdev->accept_list, 4c54bf2b093bb2 Abhishek Pandit-Subedi 2020-06-17 4104 &cp->addr.bdaddr, 4c54bf2b093bb2 Abhishek Pandit-Subedi 2020-06-17 4105 cp->addr.type); 4c54bf2b093bb2 Abhishek Pandit-Subedi 2020-06-17 4106 if (!br_params) 4c54bf2b093bb2 Abhishek Pandit-Subedi 2020-06-17 4107 goto done; 4c54bf2b093bb2 Abhishek Pandit-Subedi 2020-06-17 4108 4c54bf2b093bb2 Abhishek Pandit-Subedi 2020-06-17 4109 current_flags = br_params->current_flags; 4c54bf2b093bb2 Abhishek Pandit-Subedi 2020-06-17 4110 } else { 4c54bf2b093bb2 Abhishek Pandit-Subedi 2020-06-17 4111 params = hci_conn_params_lookup(hdev, &cp->addr.bdaddr, 4c54bf2b093bb2 Abhishek Pandit-Subedi 2020-06-17 4112 le_addr_type(cp->addr.type)); 4c54bf2b093bb2 Abhishek Pandit-Subedi 2020-06-17 4113 4c54bf2b093bb2 Abhishek Pandit-Subedi 2020-06-17 4114 if (!params) 4c54bf2b093bb2 Abhishek Pandit-Subedi 2020-06-17 4115 goto done; 4c54bf2b093bb2 Abhishek Pandit-Subedi 2020-06-17 4116 4c54bf2b093bb2 Abhishek Pandit-Subedi 2020-06-17 4117 current_flags = params->current_flags; 4c54bf2b093bb2 Abhishek Pandit-Subedi 2020-06-17 4118 } 4c54bf2b093bb2 Abhishek Pandit-Subedi 2020-06-17 4119 4c54bf2b093bb2 Abhishek Pandit-Subedi 2020-06-17 4120 bacpy(&rp.addr.bdaddr, &cp->addr.bdaddr); 4c54bf2b093bb2 Abhishek Pandit-Subedi 2020-06-17 4121 rp.addr.type = cp->addr.type; 4c54bf2b093bb2 Abhishek Pandit-Subedi 2020-06-17 4122 rp.supported_flags = cpu_to_le32(supported_flags); 4c54bf2b093bb2 Abhishek Pandit-Subedi 2020-06-17 4123 rp.current_flags = cpu_to_le32(current_flags); 4c54bf2b093bb2 Abhishek Pandit-Subedi 2020-06-17 4124 4c54bf2b093bb2 Abhishek Pandit-Subedi 2020-06-17 4125 status = MGMT_STATUS_SUCCESS; 4c54bf2b093bb2 Abhishek Pandit-Subedi 2020-06-17 4126 4c54bf2b093bb2 Abhishek Pandit-Subedi 2020-06-17 4127 done: 3ca33e3fb4f919 Abhishek Pandit-Subedi 2020-06-19 4128 hci_dev_unlock(hdev); 3ca33e3fb4f919 Abhishek Pandit-Subedi 2020-06-19 4129 4c54bf2b093bb2 Abhishek Pandit-Subedi 2020-06-17 4130 return mgmt_cmd_complete(sk, hdev->id, MGMT_OP_GET_DEVICE_FLAGS, status, 4c54bf2b093bb2 Abhishek Pandit-Subedi 2020-06-17 4131 &rp, sizeof(rp)); 4c54bf2b093bb2 Abhishek Pandit-Subedi 2020-06-17 4132 } 4c54bf2b093bb2 Abhishek Pandit-Subedi 2020-06-17 4133 4c54bf2b093bb2 Abhishek Pandit-Subedi 2020-06-17 @4134 static void device_flags_changed(struct sock *sk, struct hci_dev *hdev, 4c54bf2b093bb2 Abhishek Pandit-Subedi 2020-06-17 4135 bdaddr_t *bdaddr, u8 bdaddr_type, 4c54bf2b093bb2 Abhishek Pandit-Subedi 2020-06-17 4136 u32 supported_flags, u32 current_flags) 4c54bf2b093bb2 Abhishek Pandit-Subedi 2020-06-17 4137 { 4c54bf2b093bb2 Abhishek Pandit-Subedi 2020-06-17 4138 struct mgmt_ev_device_flags_changed ev; 4c54bf2b093bb2 Abhishek Pandit-Subedi 2020-06-17 4139 4c54bf2b093bb2 Abhishek Pandit-Subedi 2020-06-17 4140 bacpy(&ev.addr.bdaddr, bdaddr); 4c54bf2b093bb2 Abhishek Pandit-Subedi 2020-06-17 4141 ev.addr.type = bdaddr_type; 4c54bf2b093bb2 Abhishek Pandit-Subedi 2020-06-17 4142 ev.supported_flags = cpu_to_le32(supported_flags); 4c54bf2b093bb2 Abhishek Pandit-Subedi 2020-06-17 4143 ev.current_flags = cpu_to_le32(current_flags); 4c54bf2b093bb2 Abhishek Pandit-Subedi 2020-06-17 4144 4c54bf2b093bb2 Abhishek Pandit-Subedi 2020-06-17 4145 mgmt_event(MGMT_EV_DEVICE_FLAGS_CHANGED, hdev, &ev, sizeof(ev), sk); 4c54bf2b093bb2 Abhishek Pandit-Subedi 2020-06-17 4146 } 4c54bf2b093bb2 Abhishek Pandit-Subedi 2020-06-17 4147 4c54bf2b093bb2 Abhishek Pandit-Subedi 2020-06-17 @4148 static int set_device_flags(struct sock *sk, struct hci_dev *hdev, void *data, 4c54bf2b093bb2 Abhishek Pandit-Subedi 2020-06-17 4149 u16 len) 4c54bf2b093bb2 Abhishek Pandit-Subedi 2020-06-17 4150 { 4c54bf2b093bb2 Abhishek Pandit-Subedi 2020-06-17 4151 struct mgmt_cp_set_device_flags *cp = data; 4c54bf2b093bb2 Abhishek Pandit-Subedi 2020-06-17 4152 struct bdaddr_list_with_flags *br_params; 4c54bf2b093bb2 Abhishek Pandit-Subedi 2020-06-17 4153 struct hci_conn_params *params; 4c54bf2b093bb2 Abhishek Pandit-Subedi 2020-06-17 4154 u8 status = MGMT_STATUS_INVALID_PARAMS; 4c54bf2b093bb2 Abhishek Pandit-Subedi 2020-06-17 4155 u32 supported_flags = SUPPORTED_DEVICE_FLAGS(); 4c54bf2b093bb2 Abhishek Pandit-Subedi 2020-06-17 4156 u32 current_flags = __le32_to_cpu(cp->current_flags); 4c54bf2b093bb2 Abhishek Pandit-Subedi 2020-06-17 4157 4c54bf2b093bb2 Abhishek Pandit-Subedi 2020-06-17 4158 bt_dev_dbg(hdev, "Set device flags %pMR (type 0x%x) = 0x%x", 4c54bf2b093bb2 Abhishek Pandit-Subedi 2020-06-17 4159 &cp->addr.bdaddr, cp->addr.type, 4c54bf2b093bb2 Abhishek Pandit-Subedi 2020-06-17 4160 __le32_to_cpu(current_flags)); 4c54bf2b093bb2 Abhishek Pandit-Subedi 2020-06-17 4161 4c54bf2b093bb2 Abhishek Pandit-Subedi 2020-06-17 4162 if ((supported_flags | current_flags) != supported_flags) { 4c54bf2b093bb2 Abhishek Pandit-Subedi 2020-06-17 4163 bt_dev_warn(hdev, "Bad flag given (0x%x) vs supported (0x%0x)", 4c54bf2b093bb2 Abhishek Pandit-Subedi 2020-06-17 4164 current_flags, supported_flags); 4c54bf2b093bb2 Abhishek Pandit-Subedi 2020-06-17 4165 goto done; 4c54bf2b093bb2 Abhishek Pandit-Subedi 2020-06-17 4166 } 4c54bf2b093bb2 Abhishek Pandit-Subedi 2020-06-17 4167 3ca33e3fb4f919 Abhishek Pandit-Subedi 2020-06-19 4168 hci_dev_lock(hdev); 3ca33e3fb4f919 Abhishek Pandit-Subedi 2020-06-19 4169 4c54bf2b093bb2 Abhishek Pandit-Subedi 2020-06-17 4170 if (cp->addr.type == BDADDR_BREDR) { 3d4f9c00492b4e Archie Pusaka 2021-06-04 4171 br_params = hci_bdaddr_list_lookup_with_flags(&hdev->accept_list, 4c54bf2b093bb2 Abhishek Pandit-Subedi 2020-06-17 4172 &cp->addr.bdaddr, 4c54bf2b093bb2 Abhishek Pandit-Subedi 2020-06-17 4173 cp->addr.type); 4c54bf2b093bb2 Abhishek Pandit-Subedi 2020-06-17 4174 4c54bf2b093bb2 Abhishek Pandit-Subedi 2020-06-17 4175 if (br_params) { 4c54bf2b093bb2 Abhishek Pandit-Subedi 2020-06-17 4176 br_params->current_flags = current_flags; 4c54bf2b093bb2 Abhishek Pandit-Subedi 2020-06-17 4177 status = MGMT_STATUS_SUCCESS; 4c54bf2b093bb2 Abhishek Pandit-Subedi 2020-06-17 4178 } else { 4c54bf2b093bb2 Abhishek Pandit-Subedi 2020-06-17 4179 bt_dev_warn(hdev, "No such BR/EDR device %pMR (0x%x)", 4c54bf2b093bb2 Abhishek Pandit-Subedi 2020-06-17 4180 &cp->addr.bdaddr, cp->addr.type); 4c54bf2b093bb2 Abhishek Pandit-Subedi 2020-06-17 4181 } 4c54bf2b093bb2 Abhishek Pandit-Subedi 2020-06-17 4182 } else { 4c54bf2b093bb2 Abhishek Pandit-Subedi 2020-06-17 4183 params = hci_conn_params_lookup(hdev, &cp->addr.bdaddr, 4c54bf2b093bb2 Abhishek Pandit-Subedi 2020-06-17 4184 le_addr_type(cp->addr.type)); 4c54bf2b093bb2 Abhishek Pandit-Subedi 2020-06-17 4185 if (params) { 4c54bf2b093bb2 Abhishek Pandit-Subedi 2020-06-17 4186 params->current_flags = current_flags; 4c54bf2b093bb2 Abhishek Pandit-Subedi 2020-06-17 4187 status = MGMT_STATUS_SUCCESS; 4c54bf2b093bb2 Abhishek Pandit-Subedi 2020-06-17 4188 } else { 4c54bf2b093bb2 Abhishek Pandit-Subedi 2020-06-17 4189 bt_dev_warn(hdev, "No such LE device %pMR (0x%x)", 4c54bf2b093bb2 Abhishek Pandit-Subedi 2020-06-17 4190 &cp->addr.bdaddr, 4c54bf2b093bb2 Abhishek Pandit-Subedi 2020-06-17 4191 le_addr_type(cp->addr.type)); 4c54bf2b093bb2 Abhishek Pandit-Subedi 2020-06-17 4192 } 4c54bf2b093bb2 Abhishek Pandit-Subedi 2020-06-17 4193 } 4c54bf2b093bb2 Abhishek Pandit-Subedi 2020-06-17 4194 4c54bf2b093bb2 Abhishek Pandit-Subedi 2020-06-17 4195 done: 3ca33e3fb4f919 Abhishek Pandit-Subedi 2020-06-19 4196 hci_dev_unlock(hdev); 3ca33e3fb4f919 Abhishek Pandit-Subedi 2020-06-19 4197 4c54bf2b093bb2 Abhishek Pandit-Subedi 2020-06-17 4198 if (status == MGMT_STATUS_SUCCESS) 4c54bf2b093bb2 Abhishek Pandit-Subedi 2020-06-17 4199 device_flags_changed(sk, hdev, &cp->addr.bdaddr, cp->addr.type, 4c54bf2b093bb2 Abhishek Pandit-Subedi 2020-06-17 4200 supported_flags, current_flags); 4c54bf2b093bb2 Abhishek Pandit-Subedi 2020-06-17 4201 4c54bf2b093bb2 Abhishek Pandit-Subedi 2020-06-17 4202 return mgmt_cmd_complete(sk, hdev->id, MGMT_OP_SET_DEVICE_FLAGS, status, 4c54bf2b093bb2 Abhishek Pandit-Subedi 2020-06-17 4203 &cp->addr, sizeof(cp->addr)); 4c54bf2b093bb2 Abhishek Pandit-Subedi 2020-06-17 4204 } 4c54bf2b093bb2 Abhishek Pandit-Subedi 2020-06-17 4205 b52729f27b1e39 Miao-chen Chou 2020-06-17 @4206 static void mgmt_adv_monitor_added(struct sock *sk, struct hci_dev *hdev, b52729f27b1e39 Miao-chen Chou 2020-06-17 4207 u16 handle) b52729f27b1e39 Miao-chen Chou 2020-06-17 4208 { b52729f27b1e39 Miao-chen Chou 2020-06-17 4209 struct mgmt_ev_adv_monitor_added ev; b52729f27b1e39 Miao-chen Chou 2020-06-17 4210 b52729f27b1e39 Miao-chen Chou 2020-06-17 4211 ev.monitor_handle = cpu_to_le16(handle); b52729f27b1e39 Miao-chen Chou 2020-06-17 4212 b52729f27b1e39 Miao-chen Chou 2020-06-17 4213 mgmt_event(MGMT_EV_ADV_MONITOR_ADDED, hdev, &ev, sizeof(ev), sk); b52729f27b1e39 Miao-chen Chou 2020-06-17 4214 } b52729f27b1e39 Miao-chen Chou 2020-06-17 4215 66bd095ab5d408 Archie Pusaka 2021-01-22 4216 void mgmt_adv_monitor_removed(struct hci_dev *hdev, u16 handle) cdde92e230719f Miao-chen Chou 2020-06-17 4217 { 66bd095ab5d408 Archie Pusaka 2021-01-22 4218 struct mgmt_ev_adv_monitor_removed ev; 66bd095ab5d408 Archie Pusaka 2021-01-22 4219 struct mgmt_pending_cmd *cmd; 66bd095ab5d408 Archie Pusaka 2021-01-22 4220 struct sock *sk_skip = NULL; 66bd095ab5d408 Archie Pusaka 2021-01-22 4221 struct mgmt_cp_remove_adv_monitor *cp; 66bd095ab5d408 Archie Pusaka 2021-01-22 4222 66bd095ab5d408 Archie Pusaka 2021-01-22 4223 cmd = pending_find(MGMT_OP_REMOVE_ADV_MONITOR, hdev); 66bd095ab5d408 Archie Pusaka 2021-01-22 4224 if (cmd) { 66bd095ab5d408 Archie Pusaka 2021-01-22 4225 cp = cmd->param; 66bd095ab5d408 Archie Pusaka 2021-01-22 4226 66bd095ab5d408 Archie Pusaka 2021-01-22 4227 if (cp->monitor_handle) 66bd095ab5d408 Archie Pusaka 2021-01-22 4228 sk_skip = cmd->sk; 66bd095ab5d408 Archie Pusaka 2021-01-22 4229 } cdde92e230719f Miao-chen Chou 2020-06-17 4230 cdde92e230719f Miao-chen Chou 2020-06-17 4231 ev.monitor_handle = cpu_to_le16(handle); cdde92e230719f Miao-chen Chou 2020-06-17 4232 66bd095ab5d408 Archie Pusaka 2021-01-22 4233 mgmt_event(MGMT_EV_ADV_MONITOR_REMOVED, hdev, &ev, sizeof(ev), sk_skip); cdde92e230719f Miao-chen Chou 2020-06-17 4234 } cdde92e230719f Miao-chen Chou 2020-06-17 4235 e5e1e7fd470ccf Miao-chen Chou 2020-06-17 @4236 static int read_adv_mon_features(struct sock *sk, struct hci_dev *hdev, e5e1e7fd470ccf Miao-chen Chou 2020-06-17 4237 void *data, u16 len) e5e1e7fd470ccf Miao-chen Chou 2020-06-17 4238 { e5e1e7fd470ccf Miao-chen Chou 2020-06-17 4239 struct adv_monitor *monitor = NULL; e5e1e7fd470ccf Miao-chen Chou 2020-06-17 4240 struct mgmt_rp_read_adv_monitor_features *rp = NULL; cafd472a10ff3b Peilin Ye 2020-09-09 4241 int handle, err; e5e1e7fd470ccf Miao-chen Chou 2020-06-17 4242 size_t rp_size = 0; e5e1e7fd470ccf Miao-chen Chou 2020-06-17 4243 __u32 supported = 0; a2a4dedf88ab2f Archie Pusaka 2021-01-22 4244 __u32 enabled = 0; e5e1e7fd470ccf Miao-chen Chou 2020-06-17 4245 __u16 num_handles = 0; e5e1e7fd470ccf Miao-chen Chou 2020-06-17 4246 __u16 handles[HCI_MAX_ADV_MONITOR_NUM_HANDLES]; e5e1e7fd470ccf Miao-chen Chou 2020-06-17 4247 e5e1e7fd470ccf Miao-chen Chou 2020-06-17 4248 BT_DBG("request for %s", hdev->name); e5e1e7fd470ccf Miao-chen Chou 2020-06-17 4249 e5e1e7fd470ccf Miao-chen Chou 2020-06-17 4250 hci_dev_lock(hdev); e5e1e7fd470ccf Miao-chen Chou 2020-06-17 4251 a2a4dedf88ab2f Archie Pusaka 2021-01-22 4252 if (msft_monitor_supported(hdev)) e5e1e7fd470ccf Miao-chen Chou 2020-06-17 4253 supported |= MGMT_ADV_MONITOR_FEATURE_MASK_OR_PATTERNS; e5e1e7fd470ccf Miao-chen Chou 2020-06-17 4254 a2a4dedf88ab2f Archie Pusaka 2021-01-22 4255 idr_for_each_entry(&hdev->adv_monitors_idr, monitor, handle) e5e1e7fd470ccf Miao-chen Chou 2020-06-17 4256 handles[num_handles++] = monitor->handle; e5e1e7fd470ccf Miao-chen Chou 2020-06-17 4257 e5e1e7fd470ccf Miao-chen Chou 2020-06-17 4258 hci_dev_unlock(hdev); e5e1e7fd470ccf Miao-chen Chou 2020-06-17 4259 e5e1e7fd470ccf Miao-chen Chou 2020-06-17 4260 rp_size = sizeof(*rp) + (num_handles * sizeof(u16)); e5e1e7fd470ccf Miao-chen Chou 2020-06-17 4261 rp = kmalloc(rp_size, GFP_KERNEL); e5e1e7fd470ccf Miao-chen Chou 2020-06-17 4262 if (!rp) e5e1e7fd470ccf Miao-chen Chou 2020-06-17 4263 return -ENOMEM; e5e1e7fd470ccf Miao-chen Chou 2020-06-17 4264 a2a4dedf88ab2f Archie Pusaka 2021-01-22 4265 /* All supported features are currently enabled */ a2a4dedf88ab2f Archie Pusaka 2021-01-22 4266 enabled = supported; a2a4dedf88ab2f Archie Pusaka 2021-01-22 4267 e5e1e7fd470ccf Miao-chen Chou 2020-06-17 4268 rp->supported_features = cpu_to_le32(supported); a2a4dedf88ab2f Archie Pusaka 2021-01-22 4269 rp->enabled_features = cpu_to_le32(enabled); e5e1e7fd470ccf Miao-chen Chou 2020-06-17 4270 rp->max_num_handles = cpu_to_le16(HCI_MAX_ADV_MONITOR_NUM_HANDLES); e5e1e7fd470ccf Miao-chen Chou 2020-06-17 4271 rp->max_num_patterns = HCI_MAX_ADV_MONITOR_NUM_PATTERNS; e5e1e7fd470ccf Miao-chen Chou 2020-06-17 4272 rp->num_handles = cpu_to_le16(num_handles); e5e1e7fd470ccf Miao-chen Chou 2020-06-17 4273 if (num_handles) e5e1e7fd470ccf Miao-chen Chou 2020-06-17 4274 memcpy(&rp->handles, &handles, (num_handles * sizeof(u16))); e5e1e7fd470ccf Miao-chen Chou 2020-06-17 4275 cafd472a10ff3b Peilin Ye 2020-09-09 4276 err = mgmt_cmd_complete(sk, hdev->id, e5e1e7fd470ccf Miao-chen Chou 2020-06-17 4277 MGMT_OP_READ_ADV_MONITOR_FEATURES, e5e1e7fd470ccf Miao-chen Chou 2020-06-17 4278 MGMT_STATUS_SUCCESS, rp, rp_size); cafd472a10ff3b Peilin Ye 2020-09-09 4279 cafd472a10ff3b Peilin Ye 2020-09-09 4280 kfree(rp); cafd472a10ff3b Peilin Ye 2020-09-09 4281 cafd472a10ff3b Peilin Ye 2020-09-09 4282 return err; e5e1e7fd470ccf Miao-chen Chou 2020-06-17 4283 } e5e1e7fd470ccf Miao-chen Chou 2020-06-17 4284 --- 0-DAY CI Kernel Test Service, Intel Corporation https://lists.01.org/hyperkitty/list/kbuild-all@xxxxxxxxxxxx
Attachment:
.config.gz
Description: application/gzip