Lines Matching defs:hdev

39 	struct hci_dev *hdev = file->private_data;			      \
42 buf[0] = test_bit(__quirk, &hdev->quirks) ? 'Y' : 'N'; \
52 struct hci_dev *hdev = file->private_data; \
56 if (test_bit(HCI_UP, &hdev->flags)) \
63 if (enable == test_bit(__quirk, &hdev->quirks)) \
66 change_bit(__quirk, &hdev->quirks); \
81 struct hci_dev *hdev = f->private; \
83 hci_dev_lock(hdev); \
84 seq_printf(f, "%s\n", hdev->__field ? : ""); \
85 hci_dev_unlock(hdev); \
94 struct hci_dev *hdev = f->private;
97 hci_dev_lock(hdev);
98 for (p = 0; p < HCI_MAX_PAGES && p <= hdev->max_page; p++)
99 seq_printf(f, "%2u: %8ph\n", p, hdev->features[p]);
100 if (lmp_le_capable(hdev))
101 seq_printf(f, "LE: %8ph\n", hdev->le_features);
102 hci_dev_unlock(hdev);
111 struct hci_dev *hdev = f->private;
113 hci_dev_lock(hdev);
114 seq_printf(f, "%4.4x:%4.4x:%4.4x:%4.4x\n", hdev->devid_source,
115 hdev->devid_vendor, hdev->devid_product, hdev->devid_version);
116 hci_dev_unlock(hdev);
125 struct hci_dev *hdev = f->private;
129 hci_dev_lock(hdev);
130 list_for_each_entry(b, &hdev->accept_list, list)
132 list_for_each_entry(p, &hdev->le_conn_params, list) {
136 hci_dev_unlock(hdev);
145 struct hci_dev *hdev = f->private;
148 hci_dev_lock(hdev);
149 list_for_each_entry(b, &hdev->reject_list, list)
151 hci_dev_unlock(hdev);
160 struct hci_dev *hdev = f->private;
164 list_for_each_entry_rcu(key, &hdev->blocked_keys, list)
175 struct hci_dev *hdev = f->private;
178 hci_dev_lock(hdev);
179 list_for_each_entry(uuid, &hdev->uuids, list) {
191 hci_dev_unlock(hdev);
200 struct hci_dev *hdev = f->private;
203 hci_dev_lock(hdev);
204 list_for_each_entry(data, &hdev->remote_oob_data, list) {
210 hci_dev_unlock(hdev);
219 struct hci_dev *hdev = data;
221 hci_dev_lock(hdev);
222 if (val == 0 || val > hdev->conn_info_max_age) {
223 hci_dev_unlock(hdev);
227 hdev->conn_info_min_age = val;
228 hci_dev_unlock(hdev);
235 struct hci_dev *hdev = data;
237 hci_dev_lock(hdev);
238 *val = hdev->conn_info_min_age;
239 hci_dev_unlock(hdev);
249 struct hci_dev *hdev = data;
251 hci_dev_lock(hdev);
252 if (val == 0 || val < hdev->conn_info_min_age) {
253 hci_dev_unlock(hdev);
257 hdev->conn_info_max_age = val;
258 hci_dev_unlock(hdev);
265 struct hci_dev *hdev = data;
267 hci_dev_lock(hdev);
268 *val = hdev->conn_info_max_age;
269 hci_dev_unlock(hdev);
280 struct hci_dev *hdev = file->private_data;
283 buf[0] = hci_dev_test_flag(hdev, HCI_USE_DEBUG_KEYS) ? 'Y' : 'N';
298 struct hci_dev *hdev = file->private_data;
301 buf[0] = hci_dev_test_flag(hdev, HCI_SC_ONLY) ? 'Y' : 'N';
316 void hci_debugfs_create_common(struct hci_dev *hdev)
318 debugfs_create_file("features", 0444, hdev->debugfs, hdev,
320 debugfs_create_u16("manufacturer", 0444, hdev->debugfs,
321 &hdev->manufacturer);
322 debugfs_create_u8("hci_version", 0444, hdev->debugfs, &hdev->hci_ver);
323 debugfs_create_u16("hci_revision", 0444, hdev->debugfs, &hdev->hci_rev);
324 debugfs_create_u8("hardware_error", 0444, hdev->debugfs,
325 &hdev->hw_error_code);
326 debugfs_create_file("device_id", 0444, hdev->debugfs, hdev,
329 debugfs_create_file("device_list", 0444, hdev->debugfs, hdev,
331 debugfs_create_file("blacklist", 0444, hdev->debugfs, hdev,
333 debugfs_create_file("blocked_keys", 0444, hdev->debugfs, hdev,
335 debugfs_create_file("uuids", 0444, hdev->debugfs, hdev, &uuids_fops);
336 debugfs_create_file("remote_oob", 0400, hdev->debugfs, hdev,
339 debugfs_create_file("conn_info_min_age", 0644, hdev->debugfs, hdev,
341 debugfs_create_file("conn_info_max_age", 0644, hdev->debugfs, hdev,
344 if (lmp_ssp_capable(hdev) || lmp_le_capable(hdev))
345 debugfs_create_file("use_debug_keys", 0444, hdev->debugfs,
346 hdev, &use_debug_keys_fops);
348 if (lmp_sc_capable(hdev) || lmp_le_capable(hdev))
349 debugfs_create_file("sc_only_mode", 0444, hdev->debugfs,
350 hdev, &sc_only_mode_fops);
352 if (hdev->hw_info)
353 debugfs_create_file("hardware_info", 0444, hdev->debugfs,
354 hdev, &hardware_info_fops);
356 if (hdev->fw_info)
357 debugfs_create_file("firmware_info", 0444, hdev->debugfs,
358 hdev, &firmware_info_fops);
363 struct hci_dev *hdev = f->private;
364 struct discovery_state *cache = &hdev->discovery;
367 hci_dev_lock(hdev);
380 hci_dev_unlock(hdev);
389 struct hci_dev *hdev = f->private;
393 list_for_each_entry_rcu(key, &hdev->link_keys, list)
405 struct hci_dev *hdev = f->private;
407 hci_dev_lock(hdev);
408 seq_printf(f, "0x%.2x%.2x%.2x\n", hdev->dev_class[2],
409 hdev->dev_class[1], hdev->dev_class[0]);
410 hci_dev_unlock(hdev);
419 struct hci_dev *hdev = data;
421 hci_dev_lock(hdev);
422 *val = hdev->voice_setting;
423 hci_dev_unlock(hdev);
434 struct hci_dev *hdev = file->private_data;
437 buf[0] = hdev->ssp_debug_mode ? 'Y' : 'N';
451 struct hci_dev *hdev = data;
453 hci_dev_lock(hdev);
454 hdev->auto_accept_delay = val;
455 hci_dev_unlock(hdev);
462 struct hci_dev *hdev = data;
467 hci_dev_lock(hdev);
468 hdev->min_enc_key_size = val;
469 hci_dev_unlock(hdev);
476 struct hci_dev *hdev = data;
478 hci_dev_lock(hdev);
479 *val = hdev->min_enc_key_size;
480 hci_dev_unlock(hdev);
491 struct hci_dev *hdev = data;
493 hci_dev_lock(hdev);
494 *val = hdev->auto_accept_delay;
495 hci_dev_unlock(hdev);
507 struct hci_dev *hdev = file->private_data;
510 buf[0] = hci_dev_test_flag(hdev, HCI_FORCE_BREDR_SMP) ? 'Y' : 'N';
520 struct hci_dev *hdev = file->private_data;
528 err = smp_force_bredr(hdev, enable);
544 struct hci_dev *hdev = data;
549 hci_dev_lock(hdev);
550 hdev->idle_timeout = val;
551 hci_dev_unlock(hdev);
558 struct hci_dev *hdev = data;
560 hci_dev_lock(hdev);
561 *val = hdev->idle_timeout;
562 hci_dev_unlock(hdev);
572 struct hci_dev *hdev = data;
574 hci_dev_lock(hdev);
575 if (val == 0 || val % 2 || val > hdev->sniff_max_interval) {
576 hci_dev_unlock(hdev);
580 hdev->sniff_min_interval = val;
581 hci_dev_unlock(hdev);
588 struct hci_dev *hdev = data;
590 hci_dev_lock(hdev);
591 *val = hdev->sniff_min_interval;
592 hci_dev_unlock(hdev);
602 struct hci_dev *hdev = data;
604 hci_dev_lock(hdev);
605 if (val == 0 || val % 2 || val < hdev->sniff_min_interval) {
606 hci_dev_unlock(hdev);
610 hdev->sniff_max_interval = val;
611 hci_dev_unlock(hdev);
618 struct hci_dev *hdev = data;
620 hci_dev_lock(hdev);
621 *val = hdev->sniff_max_interval;
622 hci_dev_unlock(hdev);
630 void hci_debugfs_create_bredr(struct hci_dev *hdev)
632 debugfs_create_file("inquiry_cache", 0444, hdev->debugfs, hdev,
634 debugfs_create_file("link_keys", 0400, hdev->debugfs, hdev,
636 debugfs_create_file("dev_class", 0444, hdev->debugfs, hdev,
638 debugfs_create_file("voice_setting", 0444, hdev->debugfs, hdev,
648 if (!lmp_sc_capable(hdev))
649 debugfs_create_file("force_bredr_smp", 0644, hdev->debugfs,
650 hdev, &force_bredr_smp_fops);
652 if (lmp_ssp_capable(hdev)) {
653 debugfs_create_file("ssp_debug_mode", 0444, hdev->debugfs,
654 hdev, &ssp_debug_mode_fops);
655 debugfs_create_file("min_encrypt_key_size", 0644, hdev->debugfs,
656 hdev, &min_encrypt_key_size_fops);
657 debugfs_create_file("auto_accept_delay", 0644, hdev->debugfs,
658 hdev, &auto_accept_delay_fops);
661 if (lmp_sniff_capable(hdev)) {
662 debugfs_create_file("idle_timeout", 0644, hdev->debugfs,
663 hdev, &idle_timeout_fops);
664 debugfs_create_file("sniff_min_interval", 0644, hdev->debugfs,
665 hdev, &sniff_min_interval_fops);
666 debugfs_create_file("sniff_max_interval", 0644, hdev->debugfs,
667 hdev, &sniff_max_interval_fops);
673 struct hci_dev *hdev = f->private;
677 hci_dev_lock(hdev);
679 hci_copy_identity_address(hdev, &addr, &addr_type);
682 16, hdev->irk, &hdev->rpa);
684 hci_dev_unlock(hdev);
693 struct hci_dev *hdev = data;
701 hci_dev_lock(hdev);
702 hdev->rpa_timeout = val;
703 hci_dev_unlock(hdev);
710 struct hci_dev *hdev = data;
712 hci_dev_lock(hdev);
713 *val = hdev->rpa_timeout;
714 hci_dev_unlock(hdev);
724 struct hci_dev *hdev = f->private;
726 hci_dev_lock(hdev);
727 seq_printf(f, "%pMR\n", &hdev->random_addr);
728 hci_dev_unlock(hdev);
737 struct hci_dev *hdev = f->private;
739 hci_dev_lock(hdev);
740 seq_printf(f, "%pMR\n", &hdev->static_addr);
741 hci_dev_unlock(hdev);
752 struct hci_dev *hdev = file->private_data;
755 buf[0] = hci_dev_test_flag(hdev, HCI_FORCE_STATIC_ADDR) ? 'Y' : 'N';
765 struct hci_dev *hdev = file->private_data;
769 if (hdev_is_powered(hdev))
776 if (enable == hci_dev_test_flag(hdev, HCI_FORCE_STATIC_ADDR))
779 hci_dev_change_flag(hdev, HCI_FORCE_STATIC_ADDR);
793 struct hci_dev *hdev = f->private;
796 hci_dev_lock(hdev);
797 list_for_each_entry(b, &hdev->le_accept_list, list)
799 hci_dev_unlock(hdev);
808 struct hci_dev *hdev = f->private;
811 hci_dev_lock(hdev);
812 list_for_each_entry(b, &hdev->le_resolv_list, list)
814 hci_dev_unlock(hdev);
823 struct hci_dev *hdev = f->private;
827 list_for_each_entry_rcu(irk, &hdev->identity_resolving_keys, list) {
841 struct hci_dev *hdev = f->private;
845 list_for_each_entry_rcu(ltk, &hdev->long_term_keys, list)
859 struct hci_dev *hdev = data;
861 hci_dev_lock(hdev);
862 if (val < 0x0006 || val > 0x0c80 || val > hdev->le_conn_max_interval) {
863 hci_dev_unlock(hdev);
867 hdev->le_conn_min_interval = val;
868 hci_dev_unlock(hdev);
875 struct hci_dev *hdev = data;
877 hci_dev_lock(hdev);
878 *val = hdev->le_conn_min_interval;
879 hci_dev_unlock(hdev);
889 struct hci_dev *hdev = data;
891 hci_dev_lock(hdev);
892 if (val < 0x0006 || val > 0x0c80 || val < hdev->le_conn_min_interval) {
893 hci_dev_unlock(hdev);
897 hdev->le_conn_max_interval = val;
898 hci_dev_unlock(hdev);
905 struct hci_dev *hdev = data;
907 hci_dev_lock(hdev);
908 *val = hdev->le_conn_max_interval;
909 hci_dev_unlock(hdev);
919 struct hci_dev *hdev = data;
924 hci_dev_lock(hdev);
925 hdev->le_conn_latency = val;
926 hci_dev_unlock(hdev);
933 struct hci_dev *hdev = data;
935 hci_dev_lock(hdev);
936 *val = hdev->le_conn_latency;
937 hci_dev_unlock(hdev);
947 struct hci_dev *hdev = data;
952 hci_dev_lock(hdev);
953 hdev->le_supv_timeout = val;
954 hci_dev_unlock(hdev);
961 struct hci_dev *hdev = data;
963 hci_dev_lock(hdev);
964 *val = hdev->le_supv_timeout;
965 hci_dev_unlock(hdev);
975 struct hci_dev *hdev = data;
980 hci_dev_lock(hdev);
981 hdev->le_adv_channel_map = val;
982 hci_dev_unlock(hdev);
989 struct hci_dev *hdev = data;
991 hci_dev_lock(hdev);
992 *val = hdev->le_adv_channel_map;
993 hci_dev_unlock(hdev);
1003 struct hci_dev *hdev = data;
1005 hci_dev_lock(hdev);
1006 if (val < 0x0020 || val > 0x4000 || val > hdev->le_adv_max_interval) {
1007 hci_dev_unlock(hdev);
1011 hdev->le_adv_min_interval = val;
1012 hci_dev_unlock(hdev);
1019 struct hci_dev *hdev = data;
1021 hci_dev_lock(hdev);
1022 *val = hdev->le_adv_min_interval;
1023 hci_dev_unlock(hdev);
1033 struct hci_dev *hdev = data;
1035 hci_dev_lock(hdev);
1036 if (val < 0x0020 || val > 0x4000 || val < hdev->le_adv_min_interval) {
1037 hci_dev_unlock(hdev);
1041 hdev->le_adv_max_interval = val;
1042 hci_dev_unlock(hdev);
1049 struct hci_dev *hdev = data;
1051 hci_dev_lock(hdev);
1052 *val = hdev->le_adv_max_interval;
1053 hci_dev_unlock(hdev);
1063 struct hci_dev *hdev = data;
1065 hci_dev_lock(hdev);
1066 if (val > hdev->le_max_key_size || val < SMP_MIN_ENC_KEY_SIZE) {
1067 hci_dev_unlock(hdev);
1071 hdev->le_min_key_size = val;
1072 hci_dev_unlock(hdev);
1079 struct hci_dev *hdev = data;
1081 hci_dev_lock(hdev);
1082 *val = hdev->le_min_key_size;
1083 hci_dev_unlock(hdev);
1093 struct hci_dev *hdev = data;
1095 hci_dev_lock(hdev);
1096 if (val > SMP_MAX_ENC_KEY_SIZE || val < hdev->le_min_key_size) {
1097 hci_dev_unlock(hdev);
1101 hdev->le_max_key_size = val;
1102 hci_dev_unlock(hdev);
1109 struct hci_dev *hdev = data;
1111 hci_dev_lock(hdev);
1112 *val = hdev->le_max_key_size;
1113 hci_dev_unlock(hdev);
1123 struct hci_dev *hdev = data;
1128 hci_dev_lock(hdev);
1129 hdev->auth_payload_timeout = val;
1130 hci_dev_unlock(hdev);
1137 struct hci_dev *hdev = data;
1139 hci_dev_lock(hdev);
1140 *val = hdev->auth_payload_timeout;
1141 hci_dev_unlock(hdev);
1154 struct hci_dev *hdev = file->private_data;
1157 buf[0] = hci_dev_test_flag(hdev, HCI_FORCE_NO_MITM) ? 'Y' : 'N';
1167 struct hci_dev *hdev = file->private_data;
1179 if (enable == hci_dev_test_flag(hdev, HCI_FORCE_NO_MITM))
1182 hci_dev_change_flag(hdev, HCI_FORCE_NO_MITM);
1199 void hci_debugfs_create_le(struct hci_dev *hdev)
1201 debugfs_create_file("identity", 0400, hdev->debugfs, hdev,
1203 debugfs_create_file("rpa_timeout", 0644, hdev->debugfs, hdev,
1205 debugfs_create_file("random_address", 0444, hdev->debugfs, hdev,
1207 debugfs_create_file("static_address", 0444, hdev->debugfs, hdev,
1214 if (bacmp(&hdev->bdaddr, BDADDR_ANY))
1216 hdev->debugfs, hdev,
1219 debugfs_create_u8("white_list_size", 0444, hdev->debugfs,
1220 &hdev->le_accept_list_size);
1221 debugfs_create_file("white_list", 0444, hdev->debugfs, hdev,
1223 debugfs_create_u8("resolv_list_size", 0444, hdev->debugfs,
1224 &hdev->le_resolv_list_size);
1225 debugfs_create_file("resolv_list", 0444, hdev->debugfs, hdev,
1227 debugfs_create_file("identity_resolving_keys", 0400, hdev->debugfs,
1228 hdev, &identity_resolving_keys_fops);
1229 debugfs_create_file("long_term_keys", 0400, hdev->debugfs, hdev,
1231 debugfs_create_file("conn_min_interval", 0644, hdev->debugfs, hdev,
1233 debugfs_create_file("conn_max_interval", 0644, hdev->debugfs, hdev,
1235 debugfs_create_file("conn_latency", 0644, hdev->debugfs, hdev,
1237 debugfs_create_file("supervision_timeout", 0644, hdev->debugfs, hdev,
1239 debugfs_create_file("adv_channel_map", 0644, hdev->debugfs, hdev,
1241 debugfs_create_file("adv_min_interval", 0644, hdev->debugfs, hdev,
1243 debugfs_create_file("adv_max_interval", 0644, hdev->debugfs, hdev,
1245 debugfs_create_u16("discov_interleaved_timeout", 0644, hdev->debugfs,
1246 &hdev->discov_interleaved_timeout);
1247 debugfs_create_file("min_key_size", 0644, hdev->debugfs, hdev,
1249 debugfs_create_file("max_key_size", 0644, hdev->debugfs, hdev,
1251 debugfs_create_file("auth_payload_timeout", 0644, hdev->debugfs, hdev,
1253 debugfs_create_file("force_no_mitm", 0644, hdev->debugfs, hdev,
1257 hdev->debugfs, hdev,
1260 hdev->debugfs, hdev,
1266 struct hci_dev *hdev = conn->hdev;
1269 if (IS_ERR_OR_NULL(hdev->debugfs) || conn->debugfs)
1273 conn->debugfs = debugfs_create_dir(name, hdev->debugfs);
1279 struct hci_dev *hdev = file->private_data;
1282 buf[0] = hci_dev_test_flag(hdev, HCI_DUT_MODE) ? 'Y' : 'N';
1291 struct hci_dev *hdev = file->private_data;
1296 if (!test_bit(HCI_UP, &hdev->flags))
1303 if (enable == hci_dev_test_flag(hdev, HCI_DUT_MODE))
1306 hci_req_sync_lock(hdev);
1308 skb = __hci_cmd_sync(hdev, HCI_OP_ENABLE_DUT_MODE, 0, NULL,
1311 skb = __hci_cmd_sync(hdev, HCI_OP_RESET, 0, NULL,
1313 hci_req_sync_unlock(hdev);
1320 hci_dev_change_flag(hdev, HCI_DUT_MODE);
1335 struct hci_dev *hdev = file->private_data;
1338 buf[0] = hci_dev_test_flag(hdev, HCI_VENDOR_DIAG) ? 'Y' : 'N';
1347 struct hci_dev *hdev = file->private_data;
1360 if (test_bit(HCI_QUIRK_NON_PERSISTENT_DIAG, &hdev->quirks) &&
1361 (!test_bit(HCI_RUNNING, &hdev->flags) ||
1362 hci_dev_test_flag(hdev, HCI_USER_CHANNEL)))
1365 hci_req_sync_lock(hdev);
1366 err = hdev->set_diag(hdev, enable);
1367 hci_req_sync_unlock(hdev);
1374 hci_dev_set_flag(hdev, HCI_VENDOR_DIAG);
1376 hci_dev_clear_flag(hdev, HCI_VENDOR_DIAG);
1388 void hci_debugfs_create_basic(struct hci_dev *hdev)
1390 debugfs_create_file("dut_mode", 0644, hdev->debugfs, hdev,
1393 if (hdev->set_diag)
1394 debugfs_create_file("vendor_diag", 0644, hdev->debugfs, hdev,