Lines Matching defs:hdev

633 	int (*open)(struct hci_dev *hdev);
634 int (*close)(struct hci_dev *hdev);
635 int (*flush)(struct hci_dev *hdev);
636 int (*setup)(struct hci_dev *hdev);
637 int (*shutdown)(struct hci_dev *hdev);
638 int (*send)(struct hci_dev *hdev, struct sk_buff *skb);
639 void (*notify)(struct hci_dev *hdev, unsigned int evt);
640 void (*hw_error)(struct hci_dev *hdev, u8 code);
641 int (*post_init)(struct hci_dev *hdev);
642 int (*set_diag)(struct hci_dev *hdev, bool enable);
643 int (*set_bdaddr)(struct hci_dev *hdev, const bdaddr_t *bdaddr);
644 void (*cmd_timeout)(struct hci_dev *hdev);
645 void (*reset)(struct hci_dev *hdev);
646 bool (*wakeup)(struct hci_dev *hdev);
647 int (*set_quality_report)(struct hci_dev *hdev, bool enable);
648 int (*get_data_path_id)(struct hci_dev *hdev, __u8 *data_path);
649 int (*get_codec_config_data)(struct hci_dev *hdev, __u8 type,
748 struct hci_dev *hdev;
803 /* Accessed without hdev->lock: */
813 #define hci_dev_set_flag(hdev, nr) set_bit((nr), (hdev)->dev_flags)
814 #define hci_dev_clear_flag(hdev, nr) clear_bit((nr), (hdev)->dev_flags)
815 #define hci_dev_change_flag(hdev, nr) change_bit((nr), (hdev)->dev_flags)
816 #define hci_dev_test_flag(hdev, nr) test_bit((nr), (hdev)->dev_flags)
817 #define hci_dev_test_and_set_flag(hdev, nr) test_and_set_bit((nr), (hdev)->dev_flags)
818 #define hci_dev_test_and_clear_flag(hdev, nr) test_and_clear_bit((nr), (hdev)->dev_flags)
819 #define hci_dev_test_and_change_flag(hdev, nr) test_and_change_bit((nr), (hdev)->dev_flags)
821 #define hci_dev_clear_volatile_flags(hdev) \
823 hci_dev_clear_flag(hdev, HCI_LE_SCAN); \
824 hci_dev_clear_flag(hdev, HCI_LE_ADV); \
825 hci_dev_clear_flag(hdev, HCI_LL_RPA_RESOLUTION);\
826 hci_dev_clear_flag(hdev, HCI_PERIODIC_INQ); \
827 hci_dev_clear_flag(hdev, HCI_QUALITY_REPORT); \
830 #define hci_dev_le_state_simultaneous(hdev) \
831 (test_bit(HCI_QUIRK_VALID_LE_STATES, &hdev->quirks) && \
832 (hdev->le_states[4] & 0x08) && /* Central */ \
833 (hdev->le_states[4] & 0x40) && /* Peripheral */ \
834 (hdev->le_states[3] & 0x10)) /* Simultaneous */
837 int l2cap_connect_ind(struct hci_dev *hdev, bdaddr_t *bdaddr);
842 int sco_connect_ind(struct hci_dev *hdev, bdaddr_t *bdaddr, __u8 *flags);
845 static inline int sco_connect_ind(struct hci_dev *hdev, bdaddr_t *bdaddr,
857 int iso_connect_ind(struct hci_dev *hdev, bdaddr_t *bdaddr, __u8 *flags);
860 static inline int iso_connect_ind(struct hci_dev *hdev, bdaddr_t *bdaddr,
875 static inline void discovery_init(struct hci_dev *hdev)
877 hdev->discovery.state = DISCOVERY_STOPPED;
878 INIT_LIST_HEAD(&hdev->discovery.all);
879 INIT_LIST_HEAD(&hdev->discovery.unknown);
880 INIT_LIST_HEAD(&hdev->discovery.resolve);
881 hdev->discovery.report_invalid_rssi = true;
882 hdev->discovery.rssi = HCI_RSSI_INVALID;
885 static inline void hci_discovery_filter_clear(struct hci_dev *hdev)
887 hdev->discovery.result_filtering = false;
888 hdev->discovery.report_invalid_rssi = true;
889 hdev->discovery.rssi = HCI_RSSI_INVALID;
890 hdev->discovery.uuid_count = 0;
891 kfree(hdev->discovery.uuids);
892 hdev->discovery.uuids = NULL;
893 hdev->discovery.scan_start = 0;
894 hdev->discovery.scan_duration = 0;
897 bool hci_discovery_active(struct hci_dev *hdev);
899 void hci_discovery_set_state(struct hci_dev *hdev, int state);
901 static inline int inquiry_cache_empty(struct hci_dev *hdev)
903 return list_empty(&hdev->discovery.all);
906 static inline long inquiry_cache_age(struct hci_dev *hdev)
908 struct discovery_state *c = &hdev->discovery;
917 struct inquiry_entry *hci_inquiry_cache_lookup(struct hci_dev *hdev,
919 struct inquiry_entry *hci_inquiry_cache_lookup_unknown(struct hci_dev *hdev,
921 struct inquiry_entry *hci_inquiry_cache_lookup_resolve(struct hci_dev *hdev,
924 void hci_inquiry_cache_update_resolve(struct hci_dev *hdev,
926 u32 hci_inquiry_cache_update(struct hci_dev *hdev, struct inquiry_data *data,
928 void hci_inquiry_cache_flush(struct hci_dev *hdev);
966 struct hci_dev *hdev = conn->hdev;
967 return hci_dev_test_flag(hdev, HCI_SSP_ENABLED) &&
973 struct hci_dev *hdev = conn->hdev;
974 return hci_dev_test_flag(hdev, HCI_SC_ENABLED) &&
978 static inline void hci_conn_hash_add(struct hci_dev *hdev, struct hci_conn *c)
980 struct hci_conn_hash *h = &hdev->conn_hash;
1001 static inline void hci_conn_hash_del(struct hci_dev *hdev, struct hci_conn *c)
1003 struct hci_conn_hash *h = &hdev->conn_hash;
1027 static inline unsigned int hci_conn_num(struct hci_dev *hdev, __u8 type)
1029 struct hci_conn_hash *h = &hdev->conn_hash;
1045 static inline unsigned int hci_conn_count(struct hci_dev *hdev)
1047 struct hci_conn_hash *c = &hdev->conn_hash;
1052 static inline bool hci_conn_valid(struct hci_dev *hdev, struct hci_conn *conn)
1054 struct hci_conn_hash *h = &hdev->conn_hash;
1070 static inline __u8 hci_conn_lookup_type(struct hci_dev *hdev, __u16 handle)
1072 struct hci_conn_hash *h = &hdev->conn_hash;
1090 static inline struct hci_conn *hci_conn_hash_lookup_bis(struct hci_dev *hdev,
1093 struct hci_conn_hash *h = &hdev->conn_hash;
1113 hci_conn_hash_lookup_per_adv_bis(struct hci_dev *hdev,
1117 struct hci_conn_hash *h = &hdev->conn_hash;
1138 static inline struct hci_conn *hci_conn_hash_lookup_handle(struct hci_dev *hdev,
1141 struct hci_conn_hash *h = &hdev->conn_hash;
1157 static inline struct hci_conn *hci_conn_hash_lookup_ba(struct hci_dev *hdev,
1160 struct hci_conn_hash *h = &hdev->conn_hash;
1177 static inline struct hci_conn *hci_conn_hash_lookup_le(struct hci_dev *hdev,
1181 struct hci_conn_hash *h = &hdev->conn_hash;
1201 static inline struct hci_conn *hci_conn_hash_lookup_cis(struct hci_dev *hdev,
1207 struct hci_conn_hash *h = &hdev->conn_hash;
1236 static inline struct hci_conn *hci_conn_hash_lookup_cig(struct hci_dev *hdev,
1239 struct hci_conn_hash *h = &hdev->conn_hash;
1259 static inline struct hci_conn *hci_conn_hash_lookup_big(struct hci_dev *hdev,
1262 struct hci_conn_hash *h = &hdev->conn_hash;
1283 hci_conn_hash_lookup_big_state(struct hci_dev *hdev, __u8 handle, __u16 state)
1285 struct hci_conn_hash *h = &hdev->conn_hash;
1307 hci_conn_hash_lookup_pa_sync_big_handle(struct hci_dev *hdev, __u8 big)
1309 struct hci_conn_hash *h = &hdev->conn_hash;
1330 hci_conn_hash_lookup_pa_sync_handle(struct hci_dev *hdev, __u16 sync_handle)
1332 struct hci_conn_hash *h = &hdev->conn_hash;
1351 static inline struct hci_conn *hci_conn_hash_lookup_state(struct hci_dev *hdev,
1354 struct hci_conn_hash *h = &hdev->conn_hash;
1372 static inline void hci_conn_hash_list_state(struct hci_dev *hdev,
1376 struct hci_conn_hash *h = &hdev->conn_hash;
1392 static inline void hci_conn_hash_list_flag(struct hci_dev *hdev,
1396 struct hci_conn_hash *h = &hdev->conn_hash;
1412 static inline struct hci_conn *hci_lookup_le_connect(struct hci_dev *hdev)
1414 struct hci_conn_hash *h = &hdev->conn_hash;
1433 static inline bool hci_is_le_conn_scanning(struct hci_dev *hdev)
1435 struct hci_conn_hash *h = &hdev->conn_hash;
1457 int hci_le_create_cis_pending(struct hci_dev *hdev);
1460 struct hci_conn *hci_conn_add(struct hci_dev *hdev, int type, bdaddr_t *dst,
1462 struct hci_conn *hci_conn_add_unset(struct hci_dev *hdev, int type,
1465 void hci_conn_hash_flush(struct hci_dev *hdev);
1470 struct hci_chan *hci_chan_lookup_handle(struct hci_dev *hdev, __u16 handle);
1472 struct hci_conn *hci_connect_le_scan(struct hci_dev *hdev, bdaddr_t *dst,
1476 struct hci_conn *hci_connect_le(struct hci_dev *hdev, bdaddr_t *dst,
1480 struct hci_conn *hci_connect_acl(struct hci_dev *hdev, bdaddr_t *dst,
1483 struct hci_conn *hci_connect_sco(struct hci_dev *hdev, int type, bdaddr_t *dst,
1486 struct hci_conn *hci_bind_cis(struct hci_dev *hdev, bdaddr_t *dst,
1488 struct hci_conn *hci_bind_bis(struct hci_dev *hdev, bdaddr_t *dst,
1491 struct hci_conn *hci_connect_cis(struct hci_dev *hdev, bdaddr_t *dst,
1493 struct hci_conn *hci_connect_bis(struct hci_dev *hdev, bdaddr_t *dst,
1496 struct hci_conn *hci_pa_create_sync(struct hci_dev *hdev, bdaddr_t *dst,
1498 int hci_le_big_create_sync(struct hci_dev *hdev, struct hci_conn *hcon,
1580 queue_delayed_work(conn->hdev->workqueue,
1609 static inline void *hci_get_drvdata(struct hci_dev *hdev)
1611 return dev_get_drvdata(&hdev->dev);
1614 static inline void hci_set_drvdata(struct hci_dev *hdev, void *data)
1616 dev_set_drvdata(&hdev->dev, data);
1619 static inline void *hci_get_priv(struct hci_dev *hdev)
1621 return (char *)hdev + sizeof(*hdev);
1634 void hci_free_dev(struct hci_dev *hdev);
1635 int hci_register_dev(struct hci_dev *hdev);
1636 void hci_unregister_dev(struct hci_dev *hdev);
1637 void hci_release_dev(struct hci_dev *hdev);
1638 int hci_register_suspend_notifier(struct hci_dev *hdev);
1639 int hci_unregister_suspend_notifier(struct hci_dev *hdev);
1640 int hci_suspend_dev(struct hci_dev *hdev);
1641 int hci_resume_dev(struct hci_dev *hdev);
1642 int hci_reset_dev(struct hci_dev *hdev);
1643 int hci_recv_frame(struct hci_dev *hdev, struct sk_buff *skb);
1644 int hci_recv_diag(struct hci_dev *hdev, struct sk_buff *skb);
1645 __printf(2, 3) void hci_set_hw_info(struct hci_dev *hdev, const char *fmt, ...);
1646 __printf(2, 3) void hci_set_fw_info(struct hci_dev *hdev, const char *fmt, ...);
1648 static inline void hci_set_msft_opcode(struct hci_dev *hdev, __u16 opcode)
1651 hdev->msft_opcode = opcode;
1655 static inline void hci_set_aosp_capable(struct hci_dev *hdev)
1658 hdev->aosp_capable = true;
1662 static inline void hci_devcd_setup(struct hci_dev *hdev)
1665 INIT_WORK(&hdev->dump.dump_rx, hci_devcd_rx);
1666 INIT_DELAYED_WORK(&hdev->dump.dump_timeout, hci_devcd_timeout);
1667 skb_queue_head_init(&hdev->dump.dump_q);
1673 int hci_dev_do_close(struct hci_dev *hdev);
1680 int hci_get_conn_info(struct hci_dev *hdev, void __user *arg);
1681 int hci_get_auth_info(struct hci_dev *hdev, void __user *arg);
1704 struct hci_conn_params *hci_conn_params_lookup(struct hci_dev *hdev,
1706 struct hci_conn_params *hci_conn_params_add(struct hci_dev *hdev,
1708 void hci_conn_params_del(struct hci_dev *hdev, bdaddr_t *addr, u8 addr_type);
1709 void hci_conn_params_clear_disabled(struct hci_dev *hdev);
1719 void hci_uuids_clear(struct hci_dev *hdev);
1721 void hci_link_keys_clear(struct hci_dev *hdev);
1722 struct link_key *hci_find_link_key(struct hci_dev *hdev, bdaddr_t *bdaddr);
1723 struct link_key *hci_add_link_key(struct hci_dev *hdev, struct hci_conn *conn,
1726 struct smp_ltk *hci_add_ltk(struct hci_dev *hdev, bdaddr_t *bdaddr,
1729 struct smp_ltk *hci_find_ltk(struct hci_dev *hdev, bdaddr_t *bdaddr,
1731 int hci_remove_ltk(struct hci_dev *hdev, bdaddr_t *bdaddr, u8 bdaddr_type);
1732 void hci_smp_ltks_clear(struct hci_dev *hdev);
1733 int hci_remove_link_key(struct hci_dev *hdev, bdaddr_t *bdaddr);
1735 struct smp_irk *hci_find_irk_by_rpa(struct hci_dev *hdev, bdaddr_t *rpa);
1736 struct smp_irk *hci_find_irk_by_addr(struct hci_dev *hdev, bdaddr_t *bdaddr,
1738 struct smp_irk *hci_add_irk(struct hci_dev *hdev, bdaddr_t *bdaddr,
1740 void hci_remove_irk(struct hci_dev *hdev, bdaddr_t *bdaddr, u8 addr_type);
1741 bool hci_is_blocked_key(struct hci_dev *hdev, u8 type, u8 val[16]);
1742 void hci_blocked_keys_clear(struct hci_dev *hdev);
1743 void hci_smp_irks_clear(struct hci_dev *hdev);
1745 bool hci_bdaddr_is_paired(struct hci_dev *hdev, bdaddr_t *bdaddr, u8 type);
1747 void hci_remote_oob_data_clear(struct hci_dev *hdev);
1748 struct oob_data *hci_find_remote_oob_data(struct hci_dev *hdev,
1750 int hci_add_remote_oob_data(struct hci_dev *hdev, bdaddr_t *bdaddr,
1753 int hci_remove_remote_oob_data(struct hci_dev *hdev, bdaddr_t *bdaddr,
1756 void hci_adv_instances_clear(struct hci_dev *hdev);
1757 struct adv_info *hci_find_adv_instance(struct hci_dev *hdev, u8 instance);
1758 struct adv_info *hci_get_next_instance(struct hci_dev *hdev, u8 instance);
1759 struct adv_info *hci_add_adv_instance(struct hci_dev *hdev, u8 instance,
1765 struct adv_info *hci_add_per_instance(struct hci_dev *hdev, u8 instance,
1768 int hci_set_adv_instance_data(struct hci_dev *hdev, u8 instance,
1771 int hci_remove_adv_instance(struct hci_dev *hdev, u8 instance);
1772 void hci_adv_instances_set_rpa_expired(struct hci_dev *hdev, bool rpa_expired);
1773 u32 hci_adv_instance_flags(struct hci_dev *hdev, u8 instance);
1774 bool hci_adv_instance_is_scannable(struct hci_dev *hdev, u8 instance);
1776 void hci_adv_monitors_clear(struct hci_dev *hdev);
1777 void hci_free_adv_monitor(struct hci_dev *hdev, struct adv_monitor *monitor);
1778 int hci_add_adv_monitor(struct hci_dev *hdev, struct adv_monitor *monitor);
1779 int hci_remove_single_adv_monitor(struct hci_dev *hdev, u16 handle);
1780 int hci_remove_all_adv_monitor(struct hci_dev *hdev);
1781 bool hci_is_adv_monitoring(struct hci_dev *hdev);
1782 int hci_get_adv_monitor_offload_ext(struct hci_dev *hdev);
1784 void hci_event_packet(struct hci_dev *hdev, struct sk_buff *skb);
1786 void hci_init_sysfs(struct hci_dev *hdev);
1791 #define SET_HCIDEV_DEV(hdev, pdev) ((hdev)->dev.parent = (pdev))
1792 #define GET_HCIDEV_DEV(hdev) ((hdev)->dev.parent)
1865 (hdev->commands[39] & 0x04))
1869 !test_bit(HCI_QUIRK_BROKEN_READ_ENC_KEY_SIZE, &hdev->quirks))
1921 static inline int hci_proto_connect_ind(struct hci_dev *hdev, bdaddr_t *bdaddr,
1926 return l2cap_connect_ind(hdev, bdaddr);
1930 return sco_connect_ind(hdev, bdaddr, flags);
1933 return iso_connect_ind(hdev, bdaddr, flags);
2102 static inline struct smp_irk *hci_get_irk(struct hci_dev *hdev,
2108 return hci_find_irk_by_rpa(hdev, bdaddr);
2135 int __hci_cmd_send(struct hci_dev *hdev, u16 opcode, u32 plen,
2138 int hci_send_cmd(struct hci_dev *hdev, __u16 opcode, __u32 plen,
2144 void *hci_sent_cmd_data(struct hci_dev *hdev, __u16 opcode);
2145 void *hci_recv_event_data(struct hci_dev *hdev, __u8 event);
2150 void hci_send_to_sock(struct hci_dev *hdev, struct sk_buff *skb);
2153 void hci_send_to_monitor(struct hci_dev *hdev, struct sk_buff *skb);
2154 void hci_send_monitor_ctrl_event(struct hci_dev *hdev, u16 event,
2158 void hci_sock_dev_event(struct hci_dev *hdev, int event);
2167 int (*func) (struct sock *sk, struct hci_dev *hdev, void *data,
2178 void (*hdev_init) (struct sock *sk, struct hci_dev *hdev);
2227 int mgmt_new_settings(struct hci_dev *hdev);
2228 void mgmt_index_added(struct hci_dev *hdev);
2229 void mgmt_index_removed(struct hci_dev *hdev);
2230 void mgmt_set_powered_failed(struct hci_dev *hdev, int err);
2231 void mgmt_power_on(struct hci_dev *hdev, int err);
2232 void __mgmt_power_off(struct hci_dev *hdev);
2233 void mgmt_new_link_key(struct hci_dev *hdev, struct link_key *key,
2235 void mgmt_device_connected(struct hci_dev *hdev, struct hci_conn *conn,
2237 void mgmt_device_disconnected(struct hci_dev *hdev, bdaddr_t *bdaddr,
2240 void mgmt_disconnect_failed(struct hci_dev *hdev, bdaddr_t *bdaddr,
2242 void mgmt_connect_failed(struct hci_dev *hdev, bdaddr_t *bdaddr, u8 link_type,
2244 void mgmt_pin_code_request(struct hci_dev *hdev, bdaddr_t *bdaddr, u8 secure);
2245 void mgmt_pin_code_reply_complete(struct hci_dev *hdev, bdaddr_t *bdaddr,
2247 void mgmt_pin_code_neg_reply_complete(struct hci_dev *hdev, bdaddr_t *bdaddr,
2249 int mgmt_user_confirm_request(struct hci_dev *hdev, bdaddr_t *bdaddr,
2252 int mgmt_user_confirm_reply_complete(struct hci_dev *hdev, bdaddr_t *bdaddr,
2254 int mgmt_user_confirm_neg_reply_complete(struct hci_dev *hdev, bdaddr_t *bdaddr,
2256 int mgmt_user_passkey_request(struct hci_dev *hdev, bdaddr_t *bdaddr,
2258 int mgmt_user_passkey_reply_complete(struct hci_dev *hdev, bdaddr_t *bdaddr,
2260 int mgmt_user_passkey_neg_reply_complete(struct hci_dev *hdev, bdaddr_t *bdaddr,
2262 int mgmt_user_passkey_notify(struct hci_dev *hdev, bdaddr_t *bdaddr,
2266 void mgmt_auth_enable_complete(struct hci_dev *hdev, u8 status);
2267 void mgmt_set_class_of_dev_complete(struct hci_dev *hdev, u8 *dev_class,
2269 void mgmt_set_local_name_complete(struct hci_dev *hdev, u8 *name, u8 status);
2270 void mgmt_start_discovery_complete(struct hci_dev *hdev, u8 status);
2271 void mgmt_stop_discovery_complete(struct hci_dev *hdev, u8 status);
2272 void mgmt_device_found(struct hci_dev *hdev, bdaddr_t *bdaddr, u8 link_type,
2276 void mgmt_remote_name(struct hci_dev *hdev, bdaddr_t *bdaddr, u8 link_type,
2278 void mgmt_discovering(struct hci_dev *hdev, u8 discovering);
2279 void mgmt_suspending(struct hci_dev *hdev, u8 state);
2280 void mgmt_resuming(struct hci_dev *hdev, u8 reason, bdaddr_t *bdaddr,
2282 bool mgmt_powering_down(struct hci_dev *hdev);
2283 void mgmt_new_ltk(struct hci_dev *hdev, struct smp_ltk *key, bool persistent);
2284 void mgmt_new_irk(struct hci_dev *hdev, struct smp_irk *irk, bool persistent);
2285 void mgmt_new_csrk(struct hci_dev *hdev, struct smp_csrk *csrk,
2287 void mgmt_new_conn_param(struct hci_dev *hdev, bdaddr_t *bdaddr,
2291 bool mgmt_get_connectable(struct hci_dev *hdev);
2292 u8 mgmt_get_adv_discov_flags(struct hci_dev *hdev);
2293 void mgmt_advertising_added(struct sock *sk, struct hci_dev *hdev,
2295 void mgmt_advertising_removed(struct sock *sk, struct hci_dev *hdev,
2297 void mgmt_adv_monitor_removed(struct hci_dev *hdev, u16 handle);
2298 int mgmt_phy_configuration_changed(struct hci_dev *hdev, struct sock *skip);
2299 void mgmt_adv_monitor_device_lost(struct hci_dev *hdev, u16 handle,
2308 void hci_copy_identity_address(struct hci_dev *hdev, bdaddr_t *bdaddr,