Lines Matching refs:hdev
36 struct hci_dev *hdev = file->private_data; \
39 buf[0] = test_bit(__quirk, &hdev->quirks) ? 'Y' : 'N'; \
49 struct hci_dev *hdev = file->private_data; \
54 if (test_bit(HCI_UP, &hdev->flags)) \
64 if (enable == test_bit(__quirk, &hdev->quirks)) \
67 change_bit(__quirk, &hdev->quirks); \
81 struct hci_dev *hdev = f->private; in features_show() local
84 hci_dev_lock(hdev); in features_show()
85 for (p = 0; p < HCI_MAX_PAGES && p <= hdev->max_page; p++) { in features_show()
88 hdev->features[p][0], hdev->features[p][1], in features_show()
89 hdev->features[p][2], hdev->features[p][3], in features_show()
90 hdev->features[p][4], hdev->features[p][5], in features_show()
91 hdev->features[p][6], hdev->features[p][7]); in features_show()
93 if (lmp_le_capable(hdev)) in features_show()
96 hdev->le_features[0], hdev->le_features[1], in features_show()
97 hdev->le_features[2], hdev->le_features[3], in features_show()
98 hdev->le_features[4], hdev->le_features[5], in features_show()
99 hdev->le_features[6], hdev->le_features[7]); in features_show()
100 hci_dev_unlock(hdev); in features_show()
119 struct hci_dev *hdev = f->private; in device_id_show() local
121 hci_dev_lock(hdev); in device_id_show()
122 seq_printf(f, "%4.4x:%4.4x:%4.4x:%4.4x\n", hdev->devid_source, in device_id_show()
123 hdev->devid_vendor, hdev->devid_product, hdev->devid_version); in device_id_show()
124 hci_dev_unlock(hdev); in device_id_show()
143 struct hci_dev *hdev = f->private; in device_list_show() local
147 hci_dev_lock(hdev); in device_list_show()
148 list_for_each_entry(b, &hdev->whitelist, list) in device_list_show()
150 list_for_each_entry(p, &hdev->le_conn_params, list) { in device_list_show()
154 hci_dev_unlock(hdev); in device_list_show()
173 struct hci_dev *hdev = f->private; in blacklist_show() local
176 hci_dev_lock(hdev); in blacklist_show()
177 list_for_each_entry(b, &hdev->blacklist, list) in blacklist_show()
179 hci_dev_unlock(hdev); in blacklist_show()
198 struct hci_dev *hdev = f->private; in uuids_show() local
201 hci_dev_lock(hdev); in uuids_show()
202 list_for_each_entry(uuid, &hdev->uuids, list) { in uuids_show()
214 hci_dev_unlock(hdev); in uuids_show()
233 struct hci_dev *hdev = f->private; in remote_oob_show() local
236 hci_dev_lock(hdev); in remote_oob_show()
237 list_for_each_entry(data, &hdev->remote_oob_data, list) { in remote_oob_show()
243 hci_dev_unlock(hdev); in remote_oob_show()
262 struct hci_dev *hdev = data; in conn_info_min_age_set() local
264 if (val == 0 || val > hdev->conn_info_max_age) in conn_info_min_age_set()
267 hci_dev_lock(hdev); in conn_info_min_age_set()
268 hdev->conn_info_min_age = val; in conn_info_min_age_set()
269 hci_dev_unlock(hdev); in conn_info_min_age_set()
276 struct hci_dev *hdev = data; in conn_info_min_age_get() local
278 hci_dev_lock(hdev); in conn_info_min_age_get()
279 *val = hdev->conn_info_min_age; in conn_info_min_age_get()
280 hci_dev_unlock(hdev); in conn_info_min_age_get()
290 struct hci_dev *hdev = data; in conn_info_max_age_set() local
292 if (val == 0 || val < hdev->conn_info_min_age) in conn_info_max_age_set()
295 hci_dev_lock(hdev); in conn_info_max_age_set()
296 hdev->conn_info_max_age = val; in conn_info_max_age_set()
297 hci_dev_unlock(hdev); in conn_info_max_age_set()
304 struct hci_dev *hdev = data; in conn_info_max_age_get() local
306 hci_dev_lock(hdev); in conn_info_max_age_get()
307 *val = hdev->conn_info_max_age; in conn_info_max_age_get()
308 hci_dev_unlock(hdev); in conn_info_max_age_get()
319 struct hci_dev *hdev = file->private_data; in use_debug_keys_read() local
322 buf[0] = hci_dev_test_flag(hdev, HCI_USE_DEBUG_KEYS) ? 'Y': 'N'; in use_debug_keys_read()
337 struct hci_dev *hdev = file->private_data; in sc_only_mode_read() local
340 buf[0] = hci_dev_test_flag(hdev, HCI_SC_ONLY) ? 'Y': 'N'; in sc_only_mode_read()
352 void hci_debugfs_create_common(struct hci_dev *hdev) in hci_debugfs_create_common() argument
354 debugfs_create_file("features", 0444, hdev->debugfs, hdev, in hci_debugfs_create_common()
356 debugfs_create_u16("manufacturer", 0444, hdev->debugfs, in hci_debugfs_create_common()
357 &hdev->manufacturer); in hci_debugfs_create_common()
358 debugfs_create_u8("hci_version", 0444, hdev->debugfs, &hdev->hci_ver); in hci_debugfs_create_common()
359 debugfs_create_u16("hci_revision", 0444, hdev->debugfs, &hdev->hci_rev); in hci_debugfs_create_common()
360 debugfs_create_u8("hardware_error", 0444, hdev->debugfs, in hci_debugfs_create_common()
361 &hdev->hw_error_code); in hci_debugfs_create_common()
362 debugfs_create_file("device_id", 0444, hdev->debugfs, hdev, in hci_debugfs_create_common()
365 debugfs_create_file("device_list", 0444, hdev->debugfs, hdev, in hci_debugfs_create_common()
367 debugfs_create_file("blacklist", 0444, hdev->debugfs, hdev, in hci_debugfs_create_common()
369 debugfs_create_file("uuids", 0444, hdev->debugfs, hdev, &uuids_fops); in hci_debugfs_create_common()
370 debugfs_create_file("remote_oob", 0400, hdev->debugfs, hdev, in hci_debugfs_create_common()
373 debugfs_create_file("conn_info_min_age", 0644, hdev->debugfs, hdev, in hci_debugfs_create_common()
375 debugfs_create_file("conn_info_max_age", 0644, hdev->debugfs, hdev, in hci_debugfs_create_common()
378 if (lmp_ssp_capable(hdev) || lmp_le_capable(hdev)) in hci_debugfs_create_common()
379 debugfs_create_file("use_debug_keys", 0444, hdev->debugfs, in hci_debugfs_create_common()
380 hdev, &use_debug_keys_fops); in hci_debugfs_create_common()
382 if (lmp_sc_capable(hdev) || lmp_le_capable(hdev)) in hci_debugfs_create_common()
383 debugfs_create_file("sc_only_mode", 0444, hdev->debugfs, in hci_debugfs_create_common()
384 hdev, &sc_only_mode_fops); in hci_debugfs_create_common()
389 struct hci_dev *hdev = f->private; in inquiry_cache_show() local
390 struct discovery_state *cache = &hdev->discovery; in inquiry_cache_show()
393 hci_dev_lock(hdev); in inquiry_cache_show()
406 hci_dev_unlock(hdev); in inquiry_cache_show()
425 struct hci_dev *hdev = f->private; in link_keys_show() local
429 list_for_each_entry_rcu(key, &hdev->link_keys, list) in link_keys_show()
451 struct hci_dev *hdev = f->private; in dev_class_show() local
453 hci_dev_lock(hdev); in dev_class_show()
454 seq_printf(f, "0x%.2x%.2x%.2x\n", hdev->dev_class[2], in dev_class_show()
455 hdev->dev_class[1], hdev->dev_class[0]); in dev_class_show()
456 hci_dev_unlock(hdev); in dev_class_show()
475 struct hci_dev *hdev = data; in voice_setting_get() local
477 hci_dev_lock(hdev); in voice_setting_get()
478 *val = hdev->voice_setting; in voice_setting_get()
479 hci_dev_unlock(hdev); in voice_setting_get()
490 struct hci_dev *hdev = file->private_data; in ssp_debug_mode_read() local
493 buf[0] = hdev->ssp_debug_mode ? 'Y': 'N'; in ssp_debug_mode_read()
507 struct hci_dev *hdev = data; in auto_accept_delay_set() local
509 hci_dev_lock(hdev); in auto_accept_delay_set()
510 hdev->auto_accept_delay = val; in auto_accept_delay_set()
511 hci_dev_unlock(hdev); in auto_accept_delay_set()
518 struct hci_dev *hdev = data; in auto_accept_delay_get() local
520 hci_dev_lock(hdev); in auto_accept_delay_get()
521 *val = hdev->auto_accept_delay; in auto_accept_delay_get()
522 hci_dev_unlock(hdev); in auto_accept_delay_get()
532 struct hci_dev *hdev = data; in idle_timeout_set() local
537 hci_dev_lock(hdev); in idle_timeout_set()
538 hdev->idle_timeout = val; in idle_timeout_set()
539 hci_dev_unlock(hdev); in idle_timeout_set()
546 struct hci_dev *hdev = data; in idle_timeout_get() local
548 hci_dev_lock(hdev); in idle_timeout_get()
549 *val = hdev->idle_timeout; in idle_timeout_get()
550 hci_dev_unlock(hdev); in idle_timeout_get()
560 struct hci_dev *hdev = data; in sniff_min_interval_set() local
562 if (val == 0 || val % 2 || val > hdev->sniff_max_interval) in sniff_min_interval_set()
565 hci_dev_lock(hdev); in sniff_min_interval_set()
566 hdev->sniff_min_interval = val; in sniff_min_interval_set()
567 hci_dev_unlock(hdev); in sniff_min_interval_set()
574 struct hci_dev *hdev = data; in sniff_min_interval_get() local
576 hci_dev_lock(hdev); in sniff_min_interval_get()
577 *val = hdev->sniff_min_interval; in sniff_min_interval_get()
578 hci_dev_unlock(hdev); in sniff_min_interval_get()
588 struct hci_dev *hdev = data; in sniff_max_interval_set() local
590 if (val == 0 || val % 2 || val < hdev->sniff_min_interval) in sniff_max_interval_set()
593 hci_dev_lock(hdev); in sniff_max_interval_set()
594 hdev->sniff_max_interval = val; in sniff_max_interval_set()
595 hci_dev_unlock(hdev); in sniff_max_interval_set()
602 struct hci_dev *hdev = data; in sniff_max_interval_get() local
604 hci_dev_lock(hdev); in sniff_max_interval_get()
605 *val = hdev->sniff_max_interval; in sniff_max_interval_get()
606 hci_dev_unlock(hdev); in sniff_max_interval_get()
614 void hci_debugfs_create_bredr(struct hci_dev *hdev) in hci_debugfs_create_bredr() argument
616 debugfs_create_file("inquiry_cache", 0444, hdev->debugfs, hdev, in hci_debugfs_create_bredr()
618 debugfs_create_file("link_keys", 0400, hdev->debugfs, hdev, in hci_debugfs_create_bredr()
620 debugfs_create_file("dev_class", 0444, hdev->debugfs, hdev, in hci_debugfs_create_bredr()
622 debugfs_create_file("voice_setting", 0444, hdev->debugfs, hdev, in hci_debugfs_create_bredr()
625 if (lmp_ssp_capable(hdev)) { in hci_debugfs_create_bredr()
626 debugfs_create_file("ssp_debug_mode", 0444, hdev->debugfs, in hci_debugfs_create_bredr()
627 hdev, &ssp_debug_mode_fops); in hci_debugfs_create_bredr()
628 debugfs_create_file("auto_accept_delay", 0644, hdev->debugfs, in hci_debugfs_create_bredr()
629 hdev, &auto_accept_delay_fops); in hci_debugfs_create_bredr()
632 if (lmp_sniff_capable(hdev)) { in hci_debugfs_create_bredr()
633 debugfs_create_file("idle_timeout", 0644, hdev->debugfs, in hci_debugfs_create_bredr()
634 hdev, &idle_timeout_fops); in hci_debugfs_create_bredr()
635 debugfs_create_file("sniff_min_interval", 0644, hdev->debugfs, in hci_debugfs_create_bredr()
636 hdev, &sniff_min_interval_fops); in hci_debugfs_create_bredr()
637 debugfs_create_file("sniff_max_interval", 0644, hdev->debugfs, in hci_debugfs_create_bredr()
638 hdev, &sniff_max_interval_fops); in hci_debugfs_create_bredr()
644 struct hci_dev *hdev = f->private; in identity_show() local
648 hci_dev_lock(hdev); in identity_show()
650 hci_copy_identity_address(hdev, &addr, &addr_type); in identity_show()
653 16, hdev->irk, &hdev->rpa); in identity_show()
655 hci_dev_unlock(hdev); in identity_show()
674 struct hci_dev *hdev = data; in rpa_timeout_set() local
682 hci_dev_lock(hdev); in rpa_timeout_set()
683 hdev->rpa_timeout = val; in rpa_timeout_set()
684 hci_dev_unlock(hdev); in rpa_timeout_set()
691 struct hci_dev *hdev = data; in rpa_timeout_get() local
693 hci_dev_lock(hdev); in rpa_timeout_get()
694 *val = hdev->rpa_timeout; in rpa_timeout_get()
695 hci_dev_unlock(hdev); in rpa_timeout_get()
705 struct hci_dev *hdev = f->private; in random_address_show() local
707 hci_dev_lock(hdev); in random_address_show()
708 seq_printf(f, "%pMR\n", &hdev->random_addr); in random_address_show()
709 hci_dev_unlock(hdev); in random_address_show()
728 struct hci_dev *hdev = f->private; in static_address_show() local
730 hci_dev_lock(hdev); in static_address_show()
731 seq_printf(f, "%pMR\n", &hdev->static_addr); in static_address_show()
732 hci_dev_unlock(hdev); in static_address_show()
753 struct hci_dev *hdev = file->private_data; in force_static_address_read() local
756 buf[0] = hci_dev_test_flag(hdev, HCI_FORCE_STATIC_ADDR) ? 'Y': 'N'; in force_static_address_read()
766 struct hci_dev *hdev = file->private_data; in force_static_address_write() local
771 if (test_bit(HCI_UP, &hdev->flags)) in force_static_address_write()
781 if (enable == hci_dev_test_flag(hdev, HCI_FORCE_STATIC_ADDR)) in force_static_address_write()
784 hci_dev_change_flag(hdev, HCI_FORCE_STATIC_ADDR); in force_static_address_write()
798 struct hci_dev *hdev = f->private; in white_list_show() local
801 hci_dev_lock(hdev); in white_list_show()
802 list_for_each_entry(b, &hdev->le_white_list, list) in white_list_show()
804 hci_dev_unlock(hdev); in white_list_show()
823 struct hci_dev *hdev = f->private; in identity_resolving_keys_show() local
827 list_for_each_entry_rcu(irk, &hdev->identity_resolving_keys, list) { in identity_resolving_keys_show()
852 struct hci_dev *hdev = f->private; in long_term_keys_show() local
856 list_for_each_entry_rcu(ltk, &hdev->long_term_keys, list) in long_term_keys_show()
880 struct hci_dev *hdev = data; in conn_min_interval_set() local
882 if (val < 0x0006 || val > 0x0c80 || val > hdev->le_conn_max_interval) in conn_min_interval_set()
885 hci_dev_lock(hdev); in conn_min_interval_set()
886 hdev->le_conn_min_interval = val; in conn_min_interval_set()
887 hci_dev_unlock(hdev); in conn_min_interval_set()
894 struct hci_dev *hdev = data; in conn_min_interval_get() local
896 hci_dev_lock(hdev); in conn_min_interval_get()
897 *val = hdev->le_conn_min_interval; in conn_min_interval_get()
898 hci_dev_unlock(hdev); in conn_min_interval_get()
908 struct hci_dev *hdev = data; in conn_max_interval_set() local
910 if (val < 0x0006 || val > 0x0c80 || val < hdev->le_conn_min_interval) in conn_max_interval_set()
913 hci_dev_lock(hdev); in conn_max_interval_set()
914 hdev->le_conn_max_interval = val; in conn_max_interval_set()
915 hci_dev_unlock(hdev); in conn_max_interval_set()
922 struct hci_dev *hdev = data; in conn_max_interval_get() local
924 hci_dev_lock(hdev); in conn_max_interval_get()
925 *val = hdev->le_conn_max_interval; in conn_max_interval_get()
926 hci_dev_unlock(hdev); in conn_max_interval_get()
936 struct hci_dev *hdev = data; in conn_latency_set() local
941 hci_dev_lock(hdev); in conn_latency_set()
942 hdev->le_conn_latency = val; in conn_latency_set()
943 hci_dev_unlock(hdev); in conn_latency_set()
950 struct hci_dev *hdev = data; in conn_latency_get() local
952 hci_dev_lock(hdev); in conn_latency_get()
953 *val = hdev->le_conn_latency; in conn_latency_get()
954 hci_dev_unlock(hdev); in conn_latency_get()
964 struct hci_dev *hdev = data; in supervision_timeout_set() local
969 hci_dev_lock(hdev); in supervision_timeout_set()
970 hdev->le_supv_timeout = val; in supervision_timeout_set()
971 hci_dev_unlock(hdev); in supervision_timeout_set()
978 struct hci_dev *hdev = data; in supervision_timeout_get() local
980 hci_dev_lock(hdev); in supervision_timeout_get()
981 *val = hdev->le_supv_timeout; in supervision_timeout_get()
982 hci_dev_unlock(hdev); in supervision_timeout_get()
992 struct hci_dev *hdev = data; in adv_channel_map_set() local
997 hci_dev_lock(hdev); in adv_channel_map_set()
998 hdev->le_adv_channel_map = val; in adv_channel_map_set()
999 hci_dev_unlock(hdev); in adv_channel_map_set()
1006 struct hci_dev *hdev = data; in adv_channel_map_get() local
1008 hci_dev_lock(hdev); in adv_channel_map_get()
1009 *val = hdev->le_adv_channel_map; in adv_channel_map_get()
1010 hci_dev_unlock(hdev); in adv_channel_map_get()
1020 struct hci_dev *hdev = data; in adv_min_interval_set() local
1022 if (val < 0x0020 || val > 0x4000 || val > hdev->le_adv_max_interval) in adv_min_interval_set()
1025 hci_dev_lock(hdev); in adv_min_interval_set()
1026 hdev->le_adv_min_interval = val; in adv_min_interval_set()
1027 hci_dev_unlock(hdev); in adv_min_interval_set()
1034 struct hci_dev *hdev = data; in adv_min_interval_get() local
1036 hci_dev_lock(hdev); in adv_min_interval_get()
1037 *val = hdev->le_adv_min_interval; in adv_min_interval_get()
1038 hci_dev_unlock(hdev); in adv_min_interval_get()
1048 struct hci_dev *hdev = data; in adv_max_interval_set() local
1050 if (val < 0x0020 || val > 0x4000 || val < hdev->le_adv_min_interval) in adv_max_interval_set()
1053 hci_dev_lock(hdev); in adv_max_interval_set()
1054 hdev->le_adv_max_interval = val; in adv_max_interval_set()
1055 hci_dev_unlock(hdev); in adv_max_interval_set()
1062 struct hci_dev *hdev = data; in adv_max_interval_get() local
1064 hci_dev_lock(hdev); in adv_max_interval_get()
1065 *val = hdev->le_adv_max_interval; in adv_max_interval_get()
1066 hci_dev_unlock(hdev); in adv_max_interval_get()
1079 void hci_debugfs_create_le(struct hci_dev *hdev) in hci_debugfs_create_le() argument
1081 debugfs_create_file("identity", 0400, hdev->debugfs, hdev, in hci_debugfs_create_le()
1083 debugfs_create_file("rpa_timeout", 0644, hdev->debugfs, hdev, in hci_debugfs_create_le()
1085 debugfs_create_file("random_address", 0444, hdev->debugfs, hdev, in hci_debugfs_create_le()
1087 debugfs_create_file("static_address", 0444, hdev->debugfs, hdev, in hci_debugfs_create_le()
1094 if (bacmp(&hdev->bdaddr, BDADDR_ANY)) in hci_debugfs_create_le()
1096 hdev->debugfs, hdev, in hci_debugfs_create_le()
1099 debugfs_create_u8("white_list_size", 0444, hdev->debugfs, in hci_debugfs_create_le()
1100 &hdev->le_white_list_size); in hci_debugfs_create_le()
1101 debugfs_create_file("white_list", 0444, hdev->debugfs, hdev, in hci_debugfs_create_le()
1103 debugfs_create_file("identity_resolving_keys", 0400, hdev->debugfs, in hci_debugfs_create_le()
1104 hdev, &identity_resolving_keys_fops); in hci_debugfs_create_le()
1105 debugfs_create_file("long_term_keys", 0400, hdev->debugfs, hdev, in hci_debugfs_create_le()
1107 debugfs_create_file("conn_min_interval", 0644, hdev->debugfs, hdev, in hci_debugfs_create_le()
1109 debugfs_create_file("conn_max_interval", 0644, hdev->debugfs, hdev, in hci_debugfs_create_le()
1111 debugfs_create_file("conn_latency", 0644, hdev->debugfs, hdev, in hci_debugfs_create_le()
1113 debugfs_create_file("supervision_timeout", 0644, hdev->debugfs, hdev, in hci_debugfs_create_le()
1115 debugfs_create_file("adv_channel_map", 0644, hdev->debugfs, hdev, in hci_debugfs_create_le()
1117 debugfs_create_file("adv_min_interval", 0644, hdev->debugfs, hdev, in hci_debugfs_create_le()
1119 debugfs_create_file("adv_max_interval", 0644, hdev->debugfs, hdev, in hci_debugfs_create_le()
1121 debugfs_create_u16("discov_interleaved_timeout", 0644, hdev->debugfs, in hci_debugfs_create_le()
1122 &hdev->discov_interleaved_timeout); in hci_debugfs_create_le()
1125 hdev->debugfs, hdev, in hci_debugfs_create_le()
1128 hdev->debugfs, hdev, in hci_debugfs_create_le()
1134 struct hci_dev *hdev = conn->hdev; in hci_debugfs_create_conn() local
1137 if (IS_ERR_OR_NULL(hdev->debugfs)) in hci_debugfs_create_conn()
1141 conn->debugfs = debugfs_create_dir(name, hdev->debugfs); in hci_debugfs_create_conn()