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 if (val == 0 || val > hdev->conn_info_max_age)
224 hci_dev_lock(hdev);
225 hdev->conn_info_min_age = val;
226 hci_dev_unlock(hdev);
233 struct hci_dev *hdev = data;
235 hci_dev_lock(hdev);
236 *val = hdev->conn_info_min_age;
237 hci_dev_unlock(hdev);
247 struct hci_dev *hdev = data;
249 if (val == 0 || val < hdev->conn_info_min_age)
252 hci_dev_lock(hdev);
253 hdev->conn_info_max_age = val;
254 hci_dev_unlock(hdev);
261 struct hci_dev *hdev = data;
263 hci_dev_lock(hdev);
264 *val = hdev->conn_info_max_age;
265 hci_dev_unlock(hdev);
276 struct hci_dev *hdev = file->private_data;
279 buf[0] = hci_dev_test_flag(hdev, HCI_USE_DEBUG_KEYS) ? 'Y' : 'N';
294 struct hci_dev *hdev = file->private_data;
297 buf[0] = hci_dev_test_flag(hdev, HCI_SC_ONLY) ? 'Y' : 'N';
312 void hci_debugfs_create_common(struct hci_dev *hdev)
314 debugfs_create_file("features", 0444, hdev->debugfs, hdev,
316 debugfs_create_u16("manufacturer", 0444, hdev->debugfs,
317 &hdev->manufacturer);
318 debugfs_create_u8("hci_version", 0444, hdev->debugfs, &hdev->hci_ver);
319 debugfs_create_u16("hci_revision", 0444, hdev->debugfs, &hdev->hci_rev);
320 debugfs_create_u8("hardware_error", 0444, hdev->debugfs,
321 &hdev->hw_error_code);
322 debugfs_create_file("device_id", 0444, hdev->debugfs, hdev,
325 debugfs_create_file("device_list", 0444, hdev->debugfs, hdev,
327 debugfs_create_file("blacklist", 0444, hdev->debugfs, hdev,
329 debugfs_create_file("blocked_keys", 0444, hdev->debugfs, hdev,
331 debugfs_create_file("uuids", 0444, hdev->debugfs, hdev, &uuids_fops);
332 debugfs_create_file("remote_oob", 0400, hdev->debugfs, hdev,
335 debugfs_create_file("conn_info_min_age", 0644, hdev->debugfs, hdev,
337 debugfs_create_file("conn_info_max_age", 0644, hdev->debugfs, hdev,
340 if (lmp_ssp_capable(hdev) || lmp_le_capable(hdev))
341 debugfs_create_file("use_debug_keys", 0444, hdev->debugfs,
342 hdev, &use_debug_keys_fops);
344 if (lmp_sc_capable(hdev) || lmp_le_capable(hdev))
345 debugfs_create_file("sc_only_mode", 0444, hdev->debugfs,
346 hdev, &sc_only_mode_fops);
348 if (hdev->hw_info)
349 debugfs_create_file("hardware_info", 0444, hdev->debugfs,
350 hdev, &hardware_info_fops);
352 if (hdev->fw_info)
353 debugfs_create_file("firmware_info", 0444, hdev->debugfs,
354 hdev, &firmware_info_fops);
359 struct hci_dev *hdev = f->private;
360 struct discovery_state *cache = &hdev->discovery;
363 hci_dev_lock(hdev);
376 hci_dev_unlock(hdev);
385 struct hci_dev *hdev = f->private;
389 list_for_each_entry_rcu(key, &hdev->link_keys, list)
401 struct hci_dev *hdev = f->private;
403 hci_dev_lock(hdev);
404 seq_printf(f, "0x%.2x%.2x%.2x\n", hdev->dev_class[2],
405 hdev->dev_class[1], hdev->dev_class[0]);
406 hci_dev_unlock(hdev);
415 struct hci_dev *hdev = data;
417 hci_dev_lock(hdev);
418 *val = hdev->voice_setting;
419 hci_dev_unlock(hdev);
430 struct hci_dev *hdev = file->private_data;
433 buf[0] = hdev->ssp_debug_mode ? 'Y' : 'N';
447 struct hci_dev *hdev = data;
449 hci_dev_lock(hdev);
450 hdev->auto_accept_delay = val;
451 hci_dev_unlock(hdev);
458 struct hci_dev *hdev = data;
463 hci_dev_lock(hdev);
464 hdev->min_enc_key_size = val;
465 hci_dev_unlock(hdev);
472 struct hci_dev *hdev = data;
474 hci_dev_lock(hdev);
475 *val = hdev->min_enc_key_size;
476 hci_dev_unlock(hdev);
487 struct hci_dev *hdev = data;
489 hci_dev_lock(hdev);
490 *val = hdev->auto_accept_delay;
491 hci_dev_unlock(hdev);
503 struct hci_dev *hdev = file->private_data;
506 buf[0] = hci_dev_test_flag(hdev, HCI_FORCE_BREDR_SMP) ? 'Y' : 'N';
516 struct hci_dev *hdev = file->private_data;
524 err = smp_force_bredr(hdev, enable);
540 struct hci_dev *hdev = data;
545 hci_dev_lock(hdev);
546 hdev->idle_timeout = val;
547 hci_dev_unlock(hdev);
554 struct hci_dev *hdev = data;
556 hci_dev_lock(hdev);
557 *val = hdev->idle_timeout;
558 hci_dev_unlock(hdev);
568 struct hci_dev *hdev = data;
570 if (val == 0 || val % 2 || val > hdev->sniff_max_interval)
573 hci_dev_lock(hdev);
574 hdev->sniff_min_interval = val;
575 hci_dev_unlock(hdev);
582 struct hci_dev *hdev = data;
584 hci_dev_lock(hdev);
585 *val = hdev->sniff_min_interval;
586 hci_dev_unlock(hdev);
596 struct hci_dev *hdev = data;
598 if (val == 0 || val % 2 || val < hdev->sniff_min_interval)
601 hci_dev_lock(hdev);
602 hdev->sniff_max_interval = val;
603 hci_dev_unlock(hdev);
610 struct hci_dev *hdev = data;
612 hci_dev_lock(hdev);
613 *val = hdev->sniff_max_interval;
614 hci_dev_unlock(hdev);
622 void hci_debugfs_create_bredr(struct hci_dev *hdev)
624 debugfs_create_file("inquiry_cache", 0444, hdev->debugfs, hdev,
626 debugfs_create_file("link_keys", 0400, hdev->debugfs, hdev,
628 debugfs_create_file("dev_class", 0444, hdev->debugfs, hdev,
630 debugfs_create_file("voice_setting", 0444, hdev->debugfs, hdev,
640 if (!lmp_sc_capable(hdev))
641 debugfs_create_file("force_bredr_smp", 0644, hdev->debugfs,
642 hdev, &force_bredr_smp_fops);
644 if (lmp_ssp_capable(hdev)) {
645 debugfs_create_file("ssp_debug_mode", 0444, hdev->debugfs,
646 hdev, &ssp_debug_mode_fops);
647 debugfs_create_file("min_encrypt_key_size", 0644, hdev->debugfs,
648 hdev, &min_encrypt_key_size_fops);
649 debugfs_create_file("auto_accept_delay", 0644, hdev->debugfs,
650 hdev, &auto_accept_delay_fops);
653 if (lmp_sniff_capable(hdev)) {
654 debugfs_create_file("idle_timeout", 0644, hdev->debugfs,
655 hdev, &idle_timeout_fops);
656 debugfs_create_file("sniff_min_interval", 0644, hdev->debugfs,
657 hdev, &sniff_min_interval_fops);
658 debugfs_create_file("sniff_max_interval", 0644, hdev->debugfs,
659 hdev, &sniff_max_interval_fops);
665 struct hci_dev *hdev = f->private;
669 hci_dev_lock(hdev);
671 hci_copy_identity_address(hdev, &addr, &addr_type);
674 16, hdev->irk, &hdev->rpa);
676 hci_dev_unlock(hdev);
685 struct hci_dev *hdev = data;
693 hci_dev_lock(hdev);
694 hdev->rpa_timeout = val;
695 hci_dev_unlock(hdev);
702 struct hci_dev *hdev = data;
704 hci_dev_lock(hdev);
705 *val = hdev->rpa_timeout;
706 hci_dev_unlock(hdev);
716 struct hci_dev *hdev = f->private;
718 hci_dev_lock(hdev);
719 seq_printf(f, "%pMR\n", &hdev->random_addr);
720 hci_dev_unlock(hdev);
729 struct hci_dev *hdev = f->private;
731 hci_dev_lock(hdev);
732 seq_printf(f, "%pMR\n", &hdev->static_addr);
733 hci_dev_unlock(hdev);
744 struct hci_dev *hdev = file->private_data;
747 buf[0] = hci_dev_test_flag(hdev, HCI_FORCE_STATIC_ADDR) ? 'Y' : 'N';
757 struct hci_dev *hdev = file->private_data;
761 if (hdev_is_powered(hdev))
768 if (enable == hci_dev_test_flag(hdev, HCI_FORCE_STATIC_ADDR))
771 hci_dev_change_flag(hdev, HCI_FORCE_STATIC_ADDR);
785 struct hci_dev *hdev = f->private;
788 hci_dev_lock(hdev);
789 list_for_each_entry(b, &hdev->le_accept_list, list)
791 hci_dev_unlock(hdev);
800 struct hci_dev *hdev = f->private;
803 hci_dev_lock(hdev);
804 list_for_each_entry(b, &hdev->le_resolv_list, list)
806 hci_dev_unlock(hdev);
815 struct hci_dev *hdev = f->private;
819 list_for_each_entry_rcu(irk, &hdev->identity_resolving_keys, list) {
833 struct hci_dev *hdev = f->private;
837 list_for_each_entry_rcu(ltk, &hdev->long_term_keys, list)
851 struct hci_dev *hdev = data;
853 if (val < 0x0006 || val > 0x0c80 || val > hdev->le_conn_max_interval)
856 hci_dev_lock(hdev);
857 hdev->le_conn_min_interval = val;
858 hci_dev_unlock(hdev);
865 struct hci_dev *hdev = data;
867 hci_dev_lock(hdev);
868 *val = hdev->le_conn_min_interval;
869 hci_dev_unlock(hdev);
879 struct hci_dev *hdev = data;
881 if (val < 0x0006 || val > 0x0c80 || val < hdev->le_conn_min_interval)
884 hci_dev_lock(hdev);
885 hdev->le_conn_max_interval = val;
886 hci_dev_unlock(hdev);
893 struct hci_dev *hdev = data;
895 hci_dev_lock(hdev);
896 *val = hdev->le_conn_max_interval;
897 hci_dev_unlock(hdev);
907 struct hci_dev *hdev = data;
912 hci_dev_lock(hdev);
913 hdev->le_conn_latency = val;
914 hci_dev_unlock(hdev);
921 struct hci_dev *hdev = data;
923 hci_dev_lock(hdev);
924 *val = hdev->le_conn_latency;
925 hci_dev_unlock(hdev);
935 struct hci_dev *hdev = data;
940 hci_dev_lock(hdev);
941 hdev->le_supv_timeout = val;
942 hci_dev_unlock(hdev);
949 struct hci_dev *hdev = data;
951 hci_dev_lock(hdev);
952 *val = hdev->le_supv_timeout;
953 hci_dev_unlock(hdev);
963 struct hci_dev *hdev = data;
968 hci_dev_lock(hdev);
969 hdev->le_adv_channel_map = val;
970 hci_dev_unlock(hdev);
977 struct hci_dev *hdev = data;
979 hci_dev_lock(hdev);
980 *val = hdev->le_adv_channel_map;
981 hci_dev_unlock(hdev);
991 struct hci_dev *hdev = data;
993 if (val < 0x0020 || val > 0x4000 || val > hdev->le_adv_max_interval)
996 hci_dev_lock(hdev);
997 hdev->le_adv_min_interval = val;
998 hci_dev_unlock(hdev);
1005 struct hci_dev *hdev = data;
1007 hci_dev_lock(hdev);
1008 *val = hdev->le_adv_min_interval;
1009 hci_dev_unlock(hdev);
1019 struct hci_dev *hdev = data;
1021 if (val < 0x0020 || val > 0x4000 || val < hdev->le_adv_min_interval)
1024 hci_dev_lock(hdev);
1025 hdev->le_adv_max_interval = val;
1026 hci_dev_unlock(hdev);
1033 struct hci_dev *hdev = data;
1035 hci_dev_lock(hdev);
1036 *val = hdev->le_adv_max_interval;
1037 hci_dev_unlock(hdev);
1047 struct hci_dev *hdev = data;
1049 hci_dev_lock(hdev);
1050 if (val > hdev->le_max_key_size || val < SMP_MIN_ENC_KEY_SIZE) {
1051 hci_dev_unlock(hdev);
1055 hdev->le_min_key_size = val;
1056 hci_dev_unlock(hdev);
1063 struct hci_dev *hdev = data;
1065 hci_dev_lock(hdev);
1066 *val = hdev->le_min_key_size;
1067 hci_dev_unlock(hdev);
1077 struct hci_dev *hdev = data;
1079 hci_dev_lock(hdev);
1080 if (val > SMP_MAX_ENC_KEY_SIZE || val < hdev->le_min_key_size) {
1081 hci_dev_unlock(hdev);
1085 hdev->le_max_key_size = val;
1086 hci_dev_unlock(hdev);
1093 struct hci_dev *hdev = data;
1095 hci_dev_lock(hdev);
1096 *val = hdev->le_max_key_size;
1097 hci_dev_unlock(hdev);
1107 struct hci_dev *hdev = data;
1112 hci_dev_lock(hdev);
1113 hdev->auth_payload_timeout = val;
1114 hci_dev_unlock(hdev);
1121 struct hci_dev *hdev = data;
1123 hci_dev_lock(hdev);
1124 *val = hdev->auth_payload_timeout;
1125 hci_dev_unlock(hdev);
1138 struct hci_dev *hdev = file->private_data;
1141 buf[0] = hci_dev_test_flag(hdev, HCI_FORCE_NO_MITM) ? 'Y' : 'N';
1151 struct hci_dev *hdev = file->private_data;
1163 if (enable == hci_dev_test_flag(hdev, HCI_FORCE_NO_MITM))
1166 hci_dev_change_flag(hdev, HCI_FORCE_NO_MITM);
1183 void hci_debugfs_create_le(struct hci_dev *hdev)
1185 debugfs_create_file("identity", 0400, hdev->debugfs, hdev,
1187 debugfs_create_file("rpa_timeout", 0644, hdev->debugfs, hdev,
1189 debugfs_create_file("random_address", 0444, hdev->debugfs, hdev,
1191 debugfs_create_file("static_address", 0444, hdev->debugfs, hdev,
1198 if (bacmp(&hdev->bdaddr, BDADDR_ANY))
1200 hdev->debugfs, hdev,
1203 debugfs_create_u8("white_list_size", 0444, hdev->debugfs,
1204 &hdev->le_accept_list_size);
1205 debugfs_create_file("white_list", 0444, hdev->debugfs, hdev,
1207 debugfs_create_u8("resolv_list_size", 0444, hdev->debugfs,
1208 &hdev->le_resolv_list_size);
1209 debugfs_create_file("resolv_list", 0444, hdev->debugfs, hdev,
1211 debugfs_create_file("identity_resolving_keys", 0400, hdev->debugfs,
1212 hdev, &identity_resolving_keys_fops);
1213 debugfs_create_file("long_term_keys", 0400, hdev->debugfs, hdev,
1215 debugfs_create_file("conn_min_interval", 0644, hdev->debugfs, hdev,
1217 debugfs_create_file("conn_max_interval", 0644, hdev->debugfs, hdev,
1219 debugfs_create_file("conn_latency", 0644, hdev->debugfs, hdev,
1221 debugfs_create_file("supervision_timeout", 0644, hdev->debugfs, hdev,
1223 debugfs_create_file("adv_channel_map", 0644, hdev->debugfs, hdev,
1225 debugfs_create_file("adv_min_interval", 0644, hdev->debugfs, hdev,
1227 debugfs_create_file("adv_max_interval", 0644, hdev->debugfs, hdev,
1229 debugfs_create_u16("discov_interleaved_timeout", 0644, hdev->debugfs,
1230 &hdev->discov_interleaved_timeout);
1231 debugfs_create_file("min_key_size", 0644, hdev->debugfs, hdev,
1233 debugfs_create_file("max_key_size", 0644, hdev->debugfs, hdev,
1235 debugfs_create_file("auth_payload_timeout", 0644, hdev->debugfs, hdev,
1237 debugfs_create_file("force_no_mitm", 0644, hdev->debugfs, hdev,
1241 hdev->debugfs, hdev,
1244 hdev->debugfs, hdev,
1250 struct hci_dev *hdev = conn->hdev;
1253 if (IS_ERR_OR_NULL(hdev->debugfs) || conn->debugfs)
1257 conn->debugfs = debugfs_create_dir(name, hdev->debugfs);
1263 struct hci_dev *hdev = file->private_data;
1266 buf[0] = hci_dev_test_flag(hdev, HCI_DUT_MODE) ? 'Y' : 'N';
1275 struct hci_dev *hdev = file->private_data;
1280 if (!test_bit(HCI_UP, &hdev->flags))
1287 if (enable == hci_dev_test_flag(hdev, HCI_DUT_MODE))
1290 hci_req_sync_lock(hdev);
1292 skb = __hci_cmd_sync(hdev, HCI_OP_ENABLE_DUT_MODE, 0, NULL,
1295 skb = __hci_cmd_sync(hdev, HCI_OP_RESET, 0, NULL,
1297 hci_req_sync_unlock(hdev);
1304 hci_dev_change_flag(hdev, HCI_DUT_MODE);
1319 struct hci_dev *hdev = file->private_data;
1322 buf[0] = hci_dev_test_flag(hdev, HCI_VENDOR_DIAG) ? 'Y' : 'N';
1331 struct hci_dev *hdev = file->private_data;
1344 if (test_bit(HCI_QUIRK_NON_PERSISTENT_DIAG, &hdev->quirks) &&
1345 (!test_bit(HCI_RUNNING, &hdev->flags) ||
1346 hci_dev_test_flag(hdev, HCI_USER_CHANNEL)))
1349 hci_req_sync_lock(hdev);
1350 err = hdev->set_diag(hdev, enable);
1351 hci_req_sync_unlock(hdev);
1358 hci_dev_set_flag(hdev, HCI_VENDOR_DIAG);
1360 hci_dev_clear_flag(hdev, HCI_VENDOR_DIAG);
1372 void hci_debugfs_create_basic(struct hci_dev *hdev)
1374 debugfs_create_file("dut_mode", 0644, hdev->debugfs, hdev,
1377 if (hdev->set_diag)
1378 debugfs_create_file("vendor_diag", 0644, hdev->debugfs, hdev,