Commit 571277e3 authored by Maksim Krasnyanskiy's avatar Maksim Krasnyanskiy

Consistent naming for Bluetooth HCI events, commands and parameters.

Cleanup unused HCI stuff.
Optimize HCI receive path.
parent 26872595
......@@ -167,7 +167,7 @@ enum {
#define OGF_INFO_PARAM 0x04
#define OCF_READ_LOCAL_VERSION 0x0001
struct read_local_version_rp {
struct hci_rp_read_loc_version {
__u8 status;
__u8 hci_ver;
__u16 hci_rev;
......@@ -177,13 +177,13 @@ struct read_local_version_rp {
} __attribute__ ((packed));
#define OCF_READ_LOCAL_FEATURES 0x0003
struct read_local_features_rp {
struct hci_rp_read_loc_features {
__u8 status;
__u8 features[8];
} __attribute__ ((packed));
#define OCF_READ_BUFFER_SIZE 0x0005
struct read_buffer_size_rp {
struct hci_rp_read_buffer_size {
__u8 status;
__u16 acl_mtu;
__u8 sco_mtu;
......@@ -192,7 +192,7 @@ struct read_buffer_size_rp {
} __attribute__ ((packed));
#define OCF_READ_BD_ADDR 0x0009
struct read_bd_addr_rp {
struct hci_rp_read_bd_addr {
__u8 status;
bdaddr_t bdaddr;
} __attribute__ ((packed));
......@@ -220,39 +220,39 @@ struct read_bd_addr_rp {
#define SCAN_PAGE 0x02
#define OCF_SET_EVENT_FLT 0x0005
struct set_event_flt_cp {
struct hci_cp_set_event_flt {
__u8 flt_type;
__u8 cond_type;
__u8 condition[0];
} __attribute__ ((packed));
/* Filter types */
#define FLT_CLEAR_ALL 0x00
#define FLT_INQ_RESULT 0x01
#define FLT_CONN_SETUP 0x02
#define HCI_FLT_CLEAR_ALL 0x00
#define HCI_FLT_INQ_RESULT 0x01
#define HCI_FLT_CONN_SETUP 0x02
/* CONN_SETUP Condition types */
#define CONN_SETUP_ALLOW_ALL 0x00
#define CONN_SETUP_ALLOW_CLASS 0x01
#define CONN_SETUP_ALLOW_BDADDR 0x02
#define HCI_CONN_SETUP_ALLOW_ALL 0x00
#define HCI_CONN_SETUP_ALLOW_CLASS 0x01
#define HCI_CONN_SETUP_ALLOW_BDADDR 0x02
/* CONN_SETUP Conditions */
#define CONN_SETUP_AUTO_OFF 0x01
#define CONN_SETUP_AUTO_ON 0x02
#define HCI_CONN_SETUP_AUTO_OFF 0x01
#define HCI_CONN_SETUP_AUTO_ON 0x02
#define OCF_READ_CLASS_OF_DEV 0x0023
struct read_class_of_dev_rp {
struct hci_rp_read_dev_class {
__u8 status;
__u8 dev_class[3];
} __attribute__ ((packed));
#define OCF_WRITE_CLASS_OF_DEV 0x0024
struct write_class_of_dev_cp {
struct hci_cp_write_dev_class {
__u8 dev_class[3];
} __attribute__ ((packed));
#define OCF_HOST_BUFFER_SIZE 0x0033
struct host_buffer_size_cp {
struct hci_cp_host_buffer_size {
__u16 acl_mtu;
__u8 sco_mtu;
__u16 acl_max_pkt;
......@@ -262,7 +262,7 @@ struct host_buffer_size_cp {
/* Link Control */
#define OGF_LINK_CTL 0x01
#define OCF_CREATE_CONN 0x0005
struct create_conn_cp {
struct hci_cp_create_conn {
bdaddr_t bdaddr;
__u16 pkt_type;
__u8 pscan_rep_mode;
......@@ -272,31 +272,31 @@ struct create_conn_cp {
} __attribute__ ((packed));
#define OCF_ACCEPT_CONN_REQ 0x0009
struct accept_conn_req_cp {
struct hci_cp_accept_conn_req {
bdaddr_t bdaddr;
__u8 role;
} __attribute__ ((packed));
#define OCF_REJECT_CONN_REQ 0x000a
struct reject_conn_req_cp {
struct hci_cp_reject_conn_req {
bdaddr_t bdaddr;
__u8 reason;
} __attribute__ ((packed));
#define OCF_DISCONNECT 0x0006
struct disconnect_cp {
struct hci_cp_disconnect {
__u16 handle;
__u8 reason;
} __attribute__ ((packed));
#define OCF_ADD_SCO 0x0007
struct add_sco_cp {
struct hci_cp_add_sco {
__u16 handle;
__u16 pkt_type;
} __attribute__ ((packed));
#define OCF_INQUIRY 0x0001
struct inquiry_cp {
struct hci_cp_inquiry {
__u8 lap[3];
__u8 length;
__u8 num_rsp;
......@@ -304,80 +304,80 @@ struct inquiry_cp {
#define OCF_LINK_KEY_REPLY 0x000B
#define OCF_LINK_KEY_NEG_REPLY 0x000C
struct link_key_reply_cp {
struct hci_cp_link_key_reply {
bdaddr_t bdaddr;
__u8 link_key[16];
} __attribute__ ((packed));
#define OCF_PIN_CODE_REPLY 0x000D
#define OCF_PIN_CODE_NEG_REPLY 0x000E
struct pin_code_reply_cp {
struct hci_cp_pin_code_reply {
bdaddr_t bdaddr;
__u8 pin_len;
__u8 pin_code[16];
} __attribute__ ((packed));
#define OCF_CHANGE_CONN_PTYPE 0x000F
struct change_conn_ptype_cp {
struct hci_cp_change_conn_ptype {
__u16 handle;
__u16 pkt_type;
} __attribute__ ((packed));
#define OCF_AUTH_REQUESTED 0x0011
struct auth_requested_cp {
struct hci_cp_auth_requested {
__u16 handle;
} __attribute__ ((packed));
#define OCF_SET_CONN_ENCRYPT 0x0013
struct set_conn_encrypt_cp {
struct hci_cp_set_conn_encrypt {
__u16 handle;
__u8 encrypt;
} __attribute__ ((packed));
#define OCF_READ_REMOTE_FEATURES 0x001B
struct read_remote_features_cp {
struct hci_cp_read_rmt_features {
__u16 handle;
} __attribute__ ((packed));
#define OCF_READ_REMOTE_VERSION 0x001D
struct read_remote_version_cp {
struct hci_cp_read_rmt_version {
__u16 handle;
} __attribute__ ((packed));
/* Link Policy */
#define OGF_LINK_POLICY 0x02
#define OCF_ROLE_DISCOVERY 0x0009
struct role_discovery_cp {
struct hci_cp_role_discovery {
__u16 handle;
} __attribute__ ((packed));
struct role_discovery_rp {
struct hci_rp_role_discovery {
__u8 status;
__u16 handle;
__u8 role;
} __attribute__ ((packed));
#define OCF_READ_LINK_POLICY 0x000C
struct read_link_policy_cp {
struct hci_cp_read_link_policy {
__u16 handle;
} __attribute__ ((packed));
struct read_link_policy_rp {
struct hci_rp_read_link_policy {
__u8 status;
__u16 handle;
__u16 policy;
} __attribute__ ((packed));
#define OCF_SWITCH_ROLE 0x000B
struct switch_role_cp {
struct hci_cp_switch_role {
bdaddr_t bdaddr;
__u8 role;
} __attribute__ ((packed));
#define OCF_WRITE_LINK_POLICY 0x000D
struct write_link_policy_cp {
struct hci_cp_write_link_policy {
__u16 handle;
__u16 policy;
} __attribute__ ((packed));
struct write_link_policy_rp {
struct hci_rp_write_link_policy {
__u8 status;
__u16 handle;
} __attribute__ ((packed));
......@@ -386,9 +386,9 @@ struct write_link_policy_rp {
#define OGF_STATUS_PARAM 0x05
/* ---- HCI Events ---- */
#define EVT_INQUIRY_COMPLETE 0x01
#define HCI_EV_INQUIRY_COMPLETE 0x01
#define EVT_INQUIRY_RESULT 0x02
#define HCI_EV_INQUIRY_RESULT 0x02
struct inquiry_info {
bdaddr_t bdaddr;
__u8 pscan_rep_mode;
......@@ -398,8 +398,8 @@ struct inquiry_info {
__u16 clock_offset;
} __attribute__ ((packed));
#define EVT_CONN_COMPLETE 0x03
struct evt_conn_complete {
#define HCI_EV_CONN_COMPLETE 0x03
struct hci_ev_conn_complete {
__u8 status;
__u16 handle;
bdaddr_t bdaddr;
......@@ -407,34 +407,34 @@ struct evt_conn_complete {
__u8 encr_mode;
} __attribute__ ((packed));
#define EVT_CONN_REQUEST 0x04
struct evt_conn_request {
#define HCI_EV_CONN_REQUEST 0x04
struct hci_ev_conn_request {
bdaddr_t bdaddr;
__u8 dev_class[3];
__u8 link_type;
} __attribute__ ((packed));
#define EVT_DISCONN_COMPLETE 0x05
struct evt_disconn_complete {
#define HCI_EV_DISCONN_COMPLETE 0x05
struct hci_ev_disconn_complete {
__u8 status;
__u16 handle;
__u8 reason;
} __attribute__ ((packed));
#define EVT_AUTH_COMPLETE 0x06
struct evt_auth_complete {
#define HCI_EV_AUTH_COMPLETE 0x06
struct hci_ev_auth_complete {
__u8 status;
__u16 handle;
} __attribute__ ((packed));
#define EVT_ENCRYPT_CHANGE 0x08
struct evt_encrypt_change {
#define HCI_EV_ENCRYPT_CHANGE 0x08
struct hci_ev_encrypt_change {
__u8 status;
__u16 handle;
__u8 encrypt;
} __attribute__ ((packed));
#define EVT_QOS_SETUP_COMPLETE 0x0D
#define HCI_EV_QOS_SETUP_COMPLETE 0x0D
struct hci_qos {
__u8 service_type;
__u32 token_rate;
......@@ -442,64 +442,64 @@ struct hci_qos {
__u32 latency;
__u32 delay_variation;
} __attribute__ ((packed));
struct evt_qos_setup_complete {
struct hci_ev_qos_setup_complete {
__u8 status;
__u16 handle;
struct hci_qos qos;
} __attribute__ ((packed));
#define EVT_CMD_COMPLETE 0x0e
struct evt_cmd_complete {
#define HCI_EV_CMD_COMPLETE 0x0E
struct hci_ev_cmd_complete {
__u8 ncmd;
__u16 opcode;
} __attribute__ ((packed));
#define EVT_CMD_STATUS 0x0f
struct evt_cmd_status {
#define HCI_EV_CMD_STATUS 0x0F
struct hci_ev_cmd_status {
__u8 status;
__u8 ncmd;
__u16 opcode;
} __attribute__ ((packed));
#define EVT_NUM_COMP_PKTS 0x13
struct evt_num_comp_pkts {
#define HCI_EV_NUM_COMP_PKTS 0x13
struct hci_ev_num_comp_pkts {
__u8 num_hndl;
/* variable length part */
} __attribute__ ((packed));
#define EVT_ROLE_CHANGE 0x12
struct evt_role_change {
#define HCI_EV_ROLE_CHANGE 0x12
struct hci_ev_role_change {
__u8 status;
bdaddr_t bdaddr;
__u8 role;
} __attribute__ ((packed));
#define EVT_PIN_CODE_REQ 0x16
struct evt_pin_code_req {
#define HCI_EV_PIN_CODE_REQ 0x16
struct hci_ev_pin_code_req {
bdaddr_t bdaddr;
} __attribute__ ((packed));
#define EVT_LINK_KEY_REQ 0x17
struct evt_link_key_req {
#define HCI_EV_LINK_KEY_REQ 0x17
struct hci_ev_link_key_req {
bdaddr_t bdaddr;
} __attribute__ ((packed));
#define EVT_LINK_KEY_NOTIFY 0x18
struct evt_link_key_notify {
#define HCI_EV_LINK_KEY_NOTIFY 0x18
struct hci_ev_link_key_notify {
bdaddr_t bdaddr;
__u8 link_key[16];
__u8 key_type;
} __attribute__ ((packed));
#define EVT_READ_REMOTE_FEATURES_COMPLETE 0x0B
struct evt_read_remote_features_complete {
#define HCI_EV_RMT_FEATURES 0x0B
struct hci_ev_rmt_features {
__u8 status;
__u16 handle;
__u8 features[8];
} __attribute__ ((packed));
#define EVT_READ_REMOTE_VERSION_COMPLETE 0x0C
struct evt_read_remote_version_complete {
#define HCI_EV_RMT_VERSION 0x0C
struct hci_ev_rmt_version {
__u8 status;
__u16 handle;
__u8 lmp_ver;
......@@ -508,20 +508,20 @@ struct evt_read_remote_version_complete {
} __attribute__ ((packed));
/* Internal events generated by Bluetooth stack */
#define EVT_STACK_INTERNAL 0xfd
struct evt_stack_internal {
#define HCI_EV_STACK_INTERNAL 0xFD
struct hci_ev_stack_internal {
__u16 type;
__u8 data[0];
} __attribute__ ((packed));
#define EVT_SI_DEVICE 0x01
struct evt_si_device {
#define HCI_EV_SI_DEVICE 0x01
struct hci_ev_si_device {
__u16 event;
__u16 dev_id;
} __attribute__ ((packed));
#define EVT_SI_SECURITY 0x02
struct evt_si_security {
#define HCI_EV_SI_SECURITY 0x02
struct hci_ev_si_security {
__u16 event;
__u16 proto;
__u16 subproto;
......@@ -555,14 +555,14 @@ struct hci_sco_hdr {
} __attribute__ ((packed));
/* Command opcode pack/unpack */
#define cmd_opcode_pack(ogf, ocf) (__u16)((ocf & 0x03ff)|(ogf << 10))
#define cmd_opcode_ogf(op) (op >> 10)
#define cmd_opcode_ocf(op) (op & 0x03ff)
#define hci_opcode_pack(ogf, ocf) (__u16)((ocf & 0x03ff)|(ogf << 10))
#define hci_opcode_ogf(op) (op >> 10)
#define hci_opcode_ocf(op) (op & 0x03ff)
/* ACL handle and flags pack/unpack */
#define acl_handle_pack(h, f) (__u16)((h & 0x0fff)|(f << 12))
#define acl_handle(h) (h & 0x0fff)
#define acl_flags(h) (h >> 12)
#define hci_handle_pack(h, f) (__u16)((h & 0x0fff)|(f << 12))
#define hci_handle(h) (h & 0x0fff)
#define hci_flags(h) (h >> 12)
/* ---- HCI Sockets ---- */
......
......@@ -51,7 +51,7 @@ struct inquiry_cache {
struct inquiry_entry *list;
};
struct conn_hash {
struct hci_conn_hash {
struct list_head list;
spinlock_t lock;
unsigned int num;
......@@ -102,7 +102,7 @@ struct hci_dev {
__u32 req_result;
struct inquiry_cache inq_cache;
struct conn_hash conn_hash;
struct hci_conn_hash conn_hash;
struct hci_dev_stats stat;
......@@ -189,44 +189,34 @@ enum {
HCI_CONN_ENCRYPT_PEND
};
#define hci_conn_lock(c) spin_lock(&c->lock)
#define hci_conn_unlock(c) spin_unlock(&c->lock)
#define hci_conn_lock_bh(c) spin_lock_bh(&c->lock)
#define hci_conn_unlock_bh(c) spin_unlock_bh(&c->lock)
#define conn_hash_lock(d) spin_lock(&d->conn_hash->lock)
#define conn_hash_unlock(d) spin_unlock(&d->conn_hash->lock)
#define conn_hash_lock_bh(d) spin_lock_bh(&d->conn_hash->lock)
#define conn_hash_unlock_bh(d) spin_unlock_bh(&d->conn_hash->lock)
static inline void conn_hash_init(struct hci_dev *hdev)
static inline void hci_conn_hash_init(struct hci_dev *hdev)
{
struct conn_hash *h = &hdev->conn_hash;
struct hci_conn_hash *h = &hdev->conn_hash;
INIT_LIST_HEAD(&h->list);
spin_lock_init(&h->lock);
h->num = 0;
}
static inline void conn_hash_add(struct hci_dev *hdev, struct hci_conn *c)
static inline void hci_conn_hash_add(struct hci_dev *hdev, struct hci_conn *c)
{
struct conn_hash *h = &hdev->conn_hash;
struct hci_conn_hash *h = &hdev->conn_hash;
list_add(&c->list, &h->list);
h->num++;
}
static inline void conn_hash_del(struct hci_dev *hdev, struct hci_conn *c)
static inline void hci_conn_hash_del(struct hci_dev *hdev, struct hci_conn *c)
{
struct conn_hash *h = &hdev->conn_hash;
struct hci_conn_hash *h = &hdev->conn_hash;
list_del(&c->list);
h->num--;
}
static inline struct hci_conn *conn_hash_lookup_handle(struct hci_dev *hdev,
static inline struct hci_conn *hci_conn_hash_lookup_handle(struct hci_dev *hdev,
__u16 handle)
{
register struct conn_hash *h = &hdev->conn_hash;
register struct list_head *p;
register struct hci_conn *c;
struct hci_conn_hash *h = &hdev->conn_hash;
struct list_head *p;
struct hci_conn *c;
list_for_each(p, &h->list) {
c = list_entry(p, struct hci_conn, list);
......@@ -236,12 +226,12 @@ static inline struct hci_conn *conn_hash_lookup_handle(struct hci_dev *hdev,
return NULL;
}
static inline struct hci_conn *conn_hash_lookup_ba(struct hci_dev *hdev,
static inline struct hci_conn *hci_conn_hash_lookup_ba(struct hci_dev *hdev,
__u8 type, bdaddr_t *ba)
{
register struct conn_hash *h = &hdev->conn_hash;
register struct list_head *p;
register struct hci_conn *c;
struct hci_conn_hash *h = &hdev->conn_hash;
struct list_head *p;
struct hci_conn *c;
list_for_each(p, &h->list) {
c = list_entry(p, struct hci_conn, list);
......@@ -285,6 +275,22 @@ static inline void hci_conn_put(struct hci_conn *conn)
hci_conn_set_timer(conn, HCI_DISCONN_TIMEOUT);
}
/* ----- HCI tasks ----- */
static inline void hci_sched_cmd(struct hci_dev *hdev)
{
tasklet_schedule(&hdev->cmd_task);
}
static inline void hci_sched_rx(struct hci_dev *hdev)
{
tasklet_schedule(&hdev->rx_task);
}
static inline void hci_sched_tx(struct hci_dev *hdev)
{
tasklet_schedule(&hdev->tx_task);
}
/* ----- HCI Devices ----- */
static inline void hci_dev_put(struct hci_dev *d)
{
......@@ -315,29 +321,34 @@ int hci_get_conn_list(unsigned long arg);
int hci_get_conn_info(struct hci_dev *hdev, unsigned long arg);
int hci_inquiry(unsigned long arg);
int hci_recv_frame(struct sk_buff *skb);
void hci_event_packet(struct hci_dev *hdev, struct sk_buff *skb);
/* ----- LMP capabilities ----- */
#define lmp_rswitch_capable(dev) (dev->features[0] & LMP_RSWITCH)
#define lmp_encrypt_capable(dev) (dev->features[0] & LMP_ENCRYPT)
/* ----- HCI tasks ----- */
static inline void hci_sched_cmd(struct hci_dev *hdev)
/* Receive frame from HCI drivers */
static inline int hci_recv_frame(struct sk_buff *skb)
{
tasklet_schedule(&hdev->cmd_task);
}
struct hci_dev *hdev = (struct hci_dev *) skb->dev;
if (!hdev || (!test_bit(HCI_UP, &hdev->flags)
&& !test_bit(HCI_INIT, &hdev->flags))) {
kfree_skb(skb);
return -ENXIO;
}
static inline void hci_sched_rx(struct hci_dev *hdev)
{
tasklet_schedule(&hdev->rx_task);
}
/* Incomming skb */
bt_cb(skb)->incoming = 1;
static inline void hci_sched_tx(struct hci_dev *hdev)
{
tasklet_schedule(&hdev->tx_task);
/* Time stamp */
do_gettimeofday(&skb->stamp);
/* Queue frame for rx task */
skb_queue_tail(&hdev->rx_q, skb);
hci_sched_rx(hdev);
return 0;
}
/* ----- LMP capabilities ----- */
#define lmp_rswitch_capable(dev) (dev->features[0] & LMP_RSWITCH)
#define lmp_encrypt_capable(dev) (dev->features[0] & LMP_ENCRYPT)
/* ----- HCI protocols ----- */
struct hci_proto {
char *name;
......
......@@ -61,7 +61,7 @@ void hci_acl_connect(struct hci_conn *conn)
{
struct hci_dev *hdev = conn->hdev;
struct inquiry_entry *ie;
struct create_conn_cp cp;
struct hci_cp_create_conn cp;
BT_DBG("%p", conn);
......@@ -90,7 +90,7 @@ void hci_acl_connect(struct hci_conn *conn)
void hci_acl_disconn(struct hci_conn *conn, __u8 reason)
{
struct disconnect_cp cp;
struct hci_cp_disconnect cp;
BT_DBG("%p", conn);
......@@ -104,7 +104,7 @@ void hci_acl_disconn(struct hci_conn *conn, __u8 reason)
void hci_add_sco(struct hci_conn *conn, __u16 handle)
{
struct hci_dev *hdev = conn->hdev;
struct add_sco_cp cp;
struct hci_cp_add_sco cp;
BT_DBG("%p", conn);
......@@ -166,7 +166,7 @@ struct hci_conn *hci_conn_add(struct hci_dev *hdev, int type, bdaddr_t *dst)
hci_dev_hold(hdev);
tasklet_disable(&hdev->tx_task);
conn_hash_add(hdev, conn);
hci_conn_hash_add(hdev, conn);
tasklet_enable(&hdev->tx_task);
return conn;
......@@ -196,7 +196,7 @@ int hci_conn_del(struct hci_conn *conn)
}
tasklet_disable(&hdev->tx_task);
conn_hash_del(hdev, conn);
hci_conn_hash_del(hdev, conn);
tasklet_enable(&hdev->tx_task);
skb_queue_purge(&conn->data_q);
......@@ -255,7 +255,7 @@ struct hci_conn * hci_connect(struct hci_dev *hdev, int type, bdaddr_t *dst)
BT_DBG("%s dst %s", hdev->name, batostr(dst));
if (!(acl = conn_hash_lookup_ba(hdev, ACL_LINK, dst))) {
if (!(acl = hci_conn_hash_lookup_ba(hdev, ACL_LINK, dst))) {
if (!(acl = hci_conn_add(hdev, ACL_LINK, dst)))
return NULL;
}
......@@ -268,7 +268,7 @@ struct hci_conn * hci_connect(struct hci_dev *hdev, int type, bdaddr_t *dst)
if (type == SCO_LINK) {
struct hci_conn *sco;
if (!(sco = conn_hash_lookup_ba(hdev, SCO_LINK, dst))) {
if (!(sco = hci_conn_hash_lookup_ba(hdev, SCO_LINK, dst))) {
if (!(sco = hci_conn_add(hdev, SCO_LINK, dst))) {
hci_conn_put(acl);
return NULL;
......@@ -298,7 +298,7 @@ int hci_conn_auth(struct hci_conn *conn)
return 1;
if (!test_and_set_bit(HCI_CONN_AUTH_PEND, &conn->pend)) {
struct auth_requested_cp cp;
struct hci_cp_auth_requested cp;
cp.handle = __cpu_to_le16(conn->handle);
hci_send_cmd(conn->hdev, OGF_LINK_CTL, OCF_AUTH_REQUESTED, sizeof(cp), &cp);
}
......@@ -317,7 +317,7 @@ int hci_conn_encrypt(struct hci_conn *conn)
return 0;
if (hci_conn_auth(conn)) {
struct set_conn_encrypt_cp cp;
struct hci_cp_set_conn_encrypt cp;
cp.handle = __cpu_to_le16(conn->handle);
cp.encrypt = 1;
hci_send_cmd(conn->hdev, OGF_LINK_CTL, OCF_SET_CONN_ENCRYPT, sizeof(cp), &cp);
......@@ -328,7 +328,7 @@ int hci_conn_encrypt(struct hci_conn *conn)
/* Drop all connection on the device */
void hci_conn_hash_flush(struct hci_dev *hdev)
{
struct conn_hash *h = &hdev->conn_hash;
struct hci_conn_hash *h = &hdev->conn_hash;
struct list_head *p;
BT_DBG("hdev %s", hdev->name);
......@@ -411,7 +411,7 @@ int hci_get_conn_info(struct hci_dev *hdev, unsigned long arg)
return -EFAULT;
hci_dev_lock_bh(hdev);
conn = conn_hash_lookup_ba(hdev, req.type, &req.bdaddr);
conn = hci_conn_hash_lookup_ba(hdev, req.type, &req.bdaddr);
if (conn) {
bacpy(&ci.bdaddr, &conn->dst);
ci.handle = conn->handle;
......
......@@ -145,7 +145,8 @@ void hci_req_cancel(struct hci_dev *hdev, int err)
}
/* Execute request and wait for completion. */
static int __hci_request(struct hci_dev *hdev, void (*req)(struct hci_dev *hdev, unsigned long opt), unsigned long opt, __u32 timeout)
static int __hci_request(struct hci_dev *hdev, void (*req)(struct hci_dev *hdev, unsigned long opt),
unsigned long opt, __u32 timeout)
{
DECLARE_WAITQUEUE(wait, current);
int err = 0;
......@@ -225,7 +226,7 @@ static void hci_init_req(struct hci_dev *hdev, unsigned long opt)
#if 0
/* Host buffer size */
{
struct host_buffer_size_cp cp;
struct hci_cp_host_buffer_size cp;
cp.acl_mtu = __cpu_to_le16(HCI_MAX_ACL_SIZE);
cp.sco_mtu = HCI_MAX_SCO_SIZE;
cp.acl_max_pkt = __cpu_to_le16(0xffff);
......@@ -241,8 +242,8 @@ static void hci_init_req(struct hci_dev *hdev, unsigned long opt)
/* Clear Event Filters */
{
struct set_event_flt_cp cp;
cp.flt_type = FLT_CLEAR_ALL;
struct hci_cp_set_event_flt cp;
cp.flt_type = HCI_FLT_CLEAR_ALL;
hci_send_cmd(hdev, OGF_HOST_CTL, OCF_SET_EVENT_FLT, sizeof(cp), &cp);
}
......@@ -377,7 +378,7 @@ int inquiry_cache_dump(struct hci_dev *hdev, int num, __u8 *buf)
static void hci_inq_req(struct hci_dev *hdev, unsigned long opt)
{
struct hci_inquiry_req *ir = (struct hci_inquiry_req *) opt;
struct inquiry_cp cp;
struct hci_cp_inquiry cp;
BT_DBG("%s", hdev->name);
......@@ -781,7 +782,6 @@ int hci_get_dev_info(unsigned long arg)
return err;
}
/* ---- Interface to HCI drivers ---- */
/* Register HCI device */
......@@ -828,7 +828,7 @@ int hci_register_dev(struct hci_dev *hdev)
inquiry_cache_init(hdev);
conn_hash_init(hdev);
hci_conn_hash_init(hdev);
memset(&hdev->stat, 0, sizeof(struct hci_dev_stats));
......@@ -880,31 +880,6 @@ int hci_resume_dev(struct hci_dev *hdev)
return 0;
}
/* Receive frame from HCI drivers */
int hci_recv_frame(struct sk_buff *skb)
{
struct hci_dev *hdev = (struct hci_dev *) skb->dev;
if (!hdev || (!test_bit(HCI_UP, &hdev->flags) &&
!test_bit(HCI_INIT, &hdev->flags)) ) {
kfree_skb(skb);
return -1;
}
BT_DBG("%s type %d len %d", hdev->name, skb->pkt_type, skb->len);
/* Incomming skb */
bt_cb(skb)->incoming = 1;
/* Time stamp */
do_gettimeofday(&skb->stamp);
/* Queue frame for rx task */
skb_queue_tail(&hdev->rx_q, skb);
hci_sched_rx(hdev);
return 0;
}
/* ---- Interface to upper protocols ---- */
/* Register/Unregister protocols.
......@@ -1025,7 +1000,7 @@ int hci_send_cmd(struct hci_dev *hdev, __u16 ogf, __u16 ocf, __u32 plen, void *p
}
hdr = (struct hci_command_hdr *) skb_put(skb, HCI_COMMAND_HDR_SIZE);
hdr->opcode = __cpu_to_le16(cmd_opcode_pack(ogf, ocf));
hdr->opcode = __cpu_to_le16(hci_opcode_pack(ogf, ocf));
hdr->plen = plen;
if (plen)
......@@ -1051,7 +1026,7 @@ void *hci_sent_cmd_data(struct hci_dev *hdev, __u16 ogf, __u16 ocf)
hdr = (void *) hdev->sent_cmd->data;
if (hdr->opcode != __cpu_to_le16(cmd_opcode_pack(ogf, ocf)))
if (hdr->opcode != __cpu_to_le16(hci_opcode_pack(ogf, ocf)))
return NULL;
BT_DBG("%s ogf 0x%x ocf 0x%x", hdev->name, ogf, ocf);
......@@ -1066,7 +1041,7 @@ static void hci_add_acl_hdr(struct sk_buff *skb, __u16 handle, __u16 flags)
int len = skb->len;
hdr = (struct hci_acl_hdr *) skb_push(skb, HCI_ACL_HDR_SIZE);
hdr->handle = __cpu_to_le16(acl_handle_pack(handle, flags));
hdr->handle = __cpu_to_le16(hci_handle_pack(handle, flags));
hdr->dlen = __cpu_to_le16(len);
skb->h.raw = (void *) hdr;
......@@ -1148,7 +1123,7 @@ int hci_send_sco(struct hci_conn *conn, struct sk_buff *skb)
/* HCI Connection scheduler */
static inline struct hci_conn *hci_low_sent(struct hci_dev *hdev, __u8 type, int *quote)
{
struct conn_hash *h = &hdev->conn_hash;
struct hci_conn_hash *h = &hdev->conn_hash;
struct hci_conn *conn = NULL;
int num = 0, min = ~0;
struct list_head *p;
......@@ -1183,7 +1158,7 @@ static inline struct hci_conn *hci_low_sent(struct hci_dev *hdev, __u8 type, int
static inline void hci_acl_tx_to(struct hci_dev *hdev)
{
struct conn_hash *h = &hdev->conn_hash;
struct hci_conn_hash *h = &hdev->conn_hash;
struct list_head *p;
struct hci_conn *c;
......@@ -1280,15 +1255,15 @@ static inline void hci_acldata_packet(struct hci_dev *hdev, struct sk_buff *skb)
skb_pull(skb, HCI_ACL_HDR_SIZE);
handle = __le16_to_cpu(hdr->handle);
flags = acl_flags(handle);
handle = acl_handle(handle);
flags = hci_flags(handle);
handle = hci_handle(handle);
BT_DBG("%s len %d handle 0x%x flags 0x%x", hdev->name, skb->len, handle, flags);
hdev->stat.acl_rx++;
hci_dev_lock(hdev);
conn = conn_hash_lookup_handle(hdev, handle);
conn = hci_conn_hash_lookup_handle(hdev, handle);
hci_dev_unlock(hdev);
if (conn) {
......@@ -1323,7 +1298,7 @@ static inline void hci_scodata_packet(struct hci_dev *hdev, struct sk_buff *skb)
hdev->stat.sco_rx++;
hci_dev_lock(hdev);
conn = conn_hash_lookup_handle(hdev, handle);
conn = hci_conn_hash_lookup_handle(hdev, handle);
hci_dev_unlock(hdev);
if (conn) {
......
......@@ -75,7 +75,7 @@ static void hci_cc_link_ctl(struct hci_dev *hdev, __u16 ocf, struct sk_buff *skb
static void hci_cc_link_policy(struct hci_dev *hdev, __u16 ocf, struct sk_buff *skb)
{
struct hci_conn *conn;
struct role_discovery_rp *rd;
struct hci_rp_role_discovery *rd;
BT_DBG("%s ocf 0x%x", hdev->name, ocf);
......@@ -88,7 +88,7 @@ static void hci_cc_link_policy(struct hci_dev *hdev, __u16 ocf, struct sk_buff *
hci_dev_lock(hdev);
conn = conn_hash_lookup_handle(hdev, __le16_to_cpu(rd->handle));
conn = hci_conn_hash_lookup_handle(hdev, __le16_to_cpu(rd->handle));
if (conn) {
if (rd->role)
conn->link_mode &= ~HCI_LM_MASTER;
......@@ -219,15 +219,15 @@ static void hci_cc_host_ctl(struct hci_dev *hdev, __u16 ocf, struct sk_buff *skb
/* Command Complete OGF INFO_PARAM */
static void hci_cc_info_param(struct hci_dev *hdev, __u16 ocf, struct sk_buff *skb)
{
struct read_local_features_rp *lf;
struct read_buffer_size_rp *bs;
struct read_bd_addr_rp *ba;
struct hci_rp_read_loc_features *lf;
struct hci_rp_read_buffer_size *bs;
struct hci_rp_read_bd_addr *ba;
BT_DBG("%s ocf 0x%x", hdev->name, ocf);
switch (ocf) {
case OCF_READ_LOCAL_FEATURES:
lf = (struct read_local_features_rp *) skb->data;
lf = (struct hci_rp_read_loc_features *) skb->data;
if (lf->status) {
BT_DBG("%s READ_LOCAL_FEATURES failed %d", hdev->name, lf->status);
......@@ -255,7 +255,7 @@ static void hci_cc_info_param(struct hci_dev *hdev, __u16 ocf, struct sk_buff *s
break;
case OCF_READ_BUFFER_SIZE:
bs = (struct read_buffer_size_rp *) skb->data;
bs = (struct hci_rp_read_buffer_size *) skb->data;
if (bs->status) {
BT_DBG("%s READ_BUFFER_SIZE failed %d", hdev->name, bs->status);
......@@ -273,7 +273,7 @@ static void hci_cc_info_param(struct hci_dev *hdev, __u16 ocf, struct sk_buff *s
break;
case OCF_READ_BD_ADDR:
ba = (struct read_bd_addr_rp *) skb->data;
ba = (struct hci_rp_read_bd_addr *) skb->data;
if (!ba->status) {
bacpy(&hdev->bdaddr, &ba->bdaddr);
......@@ -294,14 +294,14 @@ static void hci_cc_info_param(struct hci_dev *hdev, __u16 ocf, struct sk_buff *s
static inline void hci_cs_create_conn(struct hci_dev *hdev, __u8 status)
{
struct hci_conn *conn;
struct create_conn_cp *cp = hci_sent_cmd_data(hdev, OGF_LINK_CTL, OCF_CREATE_CONN);
struct hci_cp_create_conn *cp = hci_sent_cmd_data(hdev, OGF_LINK_CTL, OCF_CREATE_CONN);
if (!cp)
return;
hci_dev_lock(hdev);
conn = conn_hash_lookup_ba(hdev, ACL_LINK, &cp->bdaddr);
conn = hci_conn_hash_lookup_ba(hdev, ACL_LINK, &cp->bdaddr);
BT_DBG("%s status 0x%x bdaddr %s conn %p", hdev->name,
status, batostr(&cc->bdaddr), conn);
......@@ -338,7 +338,7 @@ static void hci_cs_link_ctl(struct hci_dev *hdev, __u16 ocf, __u8 status)
case OCF_ADD_SCO:
if (status) {
struct hci_conn *acl, *sco;
struct add_sco_cp *cp = hci_sent_cmd_data(hdev, OGF_LINK_CTL, OCF_ADD_SCO);
struct hci_cp_add_sco *cp = hci_sent_cmd_data(hdev, OGF_LINK_CTL, OCF_ADD_SCO);
__u16 handle;
if (!cp)
......@@ -350,7 +350,7 @@ static void hci_cs_link_ctl(struct hci_dev *hdev, __u16 ocf, __u8 status)
hci_dev_lock(hdev);
acl = conn_hash_lookup_handle(hdev, handle);
acl = hci_conn_hash_lookup_handle(hdev, handle);
if (acl && (sco = acl->link)) {
sco->state = BT_CLOSED;
......@@ -442,7 +442,7 @@ static inline void hci_inquiry_result_evt(struct hci_dev *hdev, struct sk_buff *
/* Connect Request */
static inline void hci_conn_request_evt(struct hci_dev *hdev, struct sk_buff *skb)
{
struct evt_conn_request *ev = (struct evt_conn_request *) skb->data;
struct hci_ev_conn_request *ev = (struct hci_ev_conn_request *) skb->data;
int mask = hdev->link_mode;
BT_DBG("%s Connection request: %s type 0x%x", hdev->name,
......@@ -453,10 +453,10 @@ static inline void hci_conn_request_evt(struct hci_dev *hdev, struct sk_buff *sk
if (mask & HCI_LM_ACCEPT) {
/* Connection accepted */
struct hci_conn *conn;
struct accept_conn_req_cp cp;
struct hci_cp_accept_conn_req cp;
hci_dev_lock(hdev);
conn = conn_hash_lookup_ba(hdev, ev->link_type, &ev->bdaddr);
conn = hci_conn_hash_lookup_ba(hdev, ev->link_type, &ev->bdaddr);
if (!conn) {
if (!(conn = hci_conn_add(hdev, ev->link_type, &ev->bdaddr))) {
BT_ERR("No memmory for new connection");
......@@ -477,7 +477,7 @@ static inline void hci_conn_request_evt(struct hci_dev *hdev, struct sk_buff *sk
hci_send_cmd(hdev, OGF_LINK_CTL, OCF_ACCEPT_CONN_REQ, sizeof(cp), &cp);
} else {
/* Connection rejected */
struct reject_conn_req_cp cp;
struct hci_cp_reject_conn_req cp;
bacpy(&cp.bdaddr, &ev->bdaddr);
cp.reason = 0x0f;
......@@ -488,14 +488,14 @@ static inline void hci_conn_request_evt(struct hci_dev *hdev, struct sk_buff *sk
/* Connect Complete */
static inline void hci_conn_complete_evt(struct hci_dev *hdev, struct sk_buff *skb)
{
struct evt_conn_complete *ev = (struct evt_conn_complete *) skb->data;
struct hci_ev_conn_complete *ev = (struct hci_ev_conn_complete *) skb->data;
struct hci_conn *conn = NULL;
BT_DBG("%s", hdev->name);
hci_dev_lock(hdev);
conn = conn_hash_lookup_ba(hdev, ev->link_type, &ev->bdaddr);
conn = hci_conn_hash_lookup_ba(hdev, ev->link_type, &ev->bdaddr);
if (!conn) {
hci_dev_unlock(hdev);
return;
......@@ -514,7 +514,7 @@ static inline void hci_conn_complete_evt(struct hci_dev *hdev, struct sk_buff *s
/* Set link policy */
if (conn->type == ACL_LINK && hdev->link_policy) {
struct write_link_policy_cp cp;
struct hci_cp_write_link_policy cp;
cp.handle = ev->handle;
cp.policy = __cpu_to_le16(hdev->link_policy);
hci_send_cmd(hdev, OGF_LINK_POLICY, OCF_WRITE_LINK_POLICY, sizeof(cp), &cp);
......@@ -522,7 +522,7 @@ static inline void hci_conn_complete_evt(struct hci_dev *hdev, struct sk_buff *s
/* Set packet type for incomming connection */
if (!conn->out) {
struct change_conn_ptype_cp cp;
struct hci_cp_change_conn_ptype cp;
cp.handle = ev->handle;
cp.pkt_type = (conn->type == ACL_LINK) ?
__cpu_to_le16(hdev->pkt_type & ACL_PTYPE_MASK):
......@@ -555,7 +555,7 @@ static inline void hci_conn_complete_evt(struct hci_dev *hdev, struct sk_buff *s
/* Disconnect Complete */
static inline void hci_disconn_complete_evt(struct hci_dev *hdev, struct sk_buff *skb)
{
struct evt_disconn_complete *ev = (struct evt_disconn_complete *) skb->data;
struct hci_ev_disconn_complete *ev = (struct hci_ev_disconn_complete *) skb->data;
struct hci_conn *conn = NULL;
__u16 handle = __le16_to_cpu(ev->handle);
......@@ -566,7 +566,7 @@ static inline void hci_disconn_complete_evt(struct hci_dev *hdev, struct sk_buff
hci_dev_lock(hdev);
conn = conn_hash_lookup_handle(hdev, handle);
conn = hci_conn_hash_lookup_handle(hdev, handle);
if (conn) {
conn->state = BT_CLOSED;
hci_proto_disconn_ind(conn, ev->reason);
......@@ -579,7 +579,7 @@ static inline void hci_disconn_complete_evt(struct hci_dev *hdev, struct sk_buff
/* Number of completed packets */
static inline void hci_num_comp_pkts_evt(struct hci_dev *hdev, struct sk_buff *skb)
{
struct evt_num_comp_pkts *ev = (struct evt_num_comp_pkts *) skb->data;
struct hci_ev_num_comp_pkts *ev = (struct hci_ev_num_comp_pkts *) skb->data;
__u16 *ptr;
int i;
......@@ -601,7 +601,7 @@ static inline void hci_num_comp_pkts_evt(struct hci_dev *hdev, struct sk_buff *s
handle = __le16_to_cpu(get_unaligned(ptr++));
count = __le16_to_cpu(get_unaligned(ptr++));
conn = conn_hash_lookup_handle(hdev, handle);
conn = hci_conn_hash_lookup_handle(hdev, handle);
if (conn) {
conn->sent -= count;
......@@ -622,7 +622,7 @@ static inline void hci_num_comp_pkts_evt(struct hci_dev *hdev, struct sk_buff *s
/* Role Change */
static inline void hci_role_change_evt(struct hci_dev *hdev, struct sk_buff *skb)
{
struct evt_role_change *ev = (struct evt_role_change *) skb->data;
struct hci_ev_role_change *ev = (struct hci_ev_role_change *) skb->data;
struct hci_conn *conn = NULL;
BT_DBG("%s status %d", hdev->name, ev->status);
......@@ -632,7 +632,7 @@ static inline void hci_role_change_evt(struct hci_dev *hdev, struct sk_buff *skb
hci_dev_lock(hdev);
conn = conn_hash_lookup_ba(hdev, ACL_LINK, &ev->bdaddr);
conn = hci_conn_hash_lookup_ba(hdev, ACL_LINK, &ev->bdaddr);
if (conn) {
if (ev->role)
conn->link_mode &= ~HCI_LM_MASTER;
......@@ -646,7 +646,7 @@ static inline void hci_role_change_evt(struct hci_dev *hdev, struct sk_buff *skb
/* Authentication Complete */
static inline void hci_auth_complete_evt(struct hci_dev *hdev, struct sk_buff *skb)
{
struct evt_auth_complete *ev = (struct evt_auth_complete *) skb->data;
struct hci_ev_auth_complete *ev = (struct hci_ev_auth_complete *) skb->data;
struct hci_conn *conn = NULL;
__u16 handle = __le16_to_cpu(ev->handle);
......@@ -654,7 +654,7 @@ static inline void hci_auth_complete_evt(struct hci_dev *hdev, struct sk_buff *s
hci_dev_lock(hdev);
conn = conn_hash_lookup_handle(hdev, handle);
conn = hci_conn_hash_lookup_handle(hdev, handle);
if (conn) {
if (!ev->status)
conn->link_mode |= HCI_LM_AUTH;
......@@ -664,7 +664,7 @@ static inline void hci_auth_complete_evt(struct hci_dev *hdev, struct sk_buff *s
if (test_bit(HCI_CONN_ENCRYPT_PEND, &conn->pend)) {
if (!ev->status) {
struct set_conn_encrypt_cp cp;
struct hci_cp_set_conn_encrypt cp;
cp.handle = __cpu_to_le16(conn->handle);
cp.encrypt = 1;
hci_send_cmd(conn->hdev, OGF_LINK_CTL,
......@@ -683,7 +683,7 @@ static inline void hci_auth_complete_evt(struct hci_dev *hdev, struct sk_buff *s
/* Encryption Change */
static inline void hci_encrypt_change_evt(struct hci_dev *hdev, struct sk_buff *skb)
{
struct evt_encrypt_change *ev = (struct evt_encrypt_change *) skb->data;
struct hci_ev_encrypt_change *ev = (struct hci_ev_encrypt_change *) skb->data;
struct hci_conn *conn = NULL;
__u16 handle = __le16_to_cpu(ev->handle);
......@@ -691,7 +691,7 @@ static inline void hci_encrypt_change_evt(struct hci_dev *hdev, struct sk_buff *
hci_dev_lock(hdev);
conn = conn_hash_lookup_handle(hdev, handle);
conn = hci_conn_hash_lookup_handle(hdev, handle);
if (conn) {
if (!ev->status) {
if (ev->encrypt)
......@@ -710,8 +710,8 @@ static inline void hci_encrypt_change_evt(struct hci_dev *hdev, struct sk_buff *
void hci_event_packet(struct hci_dev *hdev, struct sk_buff *skb)
{
struct hci_event_hdr *hdr = (struct hci_event_hdr *) skb->data;
struct evt_cmd_complete *ec;
struct evt_cmd_status *cs;
struct hci_ev_cmd_complete *ec;
struct hci_ev_cmd_status *cs;
u16 opcode, ocf, ogf;
skb_pull(skb, HCI_EVENT_HDR_SIZE);
......@@ -719,49 +719,49 @@ void hci_event_packet(struct hci_dev *hdev, struct sk_buff *skb)
BT_DBG("%s evt 0x%x", hdev->name, hdr->evt);
switch (hdr->evt) {
case EVT_NUM_COMP_PKTS:
case HCI_EV_NUM_COMP_PKTS:
hci_num_comp_pkts_evt(hdev, skb);
break;
case EVT_INQUIRY_COMPLETE:
case HCI_EV_INQUIRY_COMPLETE:
hci_inquiry_complete_evt(hdev, skb);
break;
case EVT_INQUIRY_RESULT:
case HCI_EV_INQUIRY_RESULT:
hci_inquiry_result_evt(hdev, skb);
break;
case EVT_CONN_REQUEST:
case HCI_EV_CONN_REQUEST:
hci_conn_request_evt(hdev, skb);
break;
case EVT_CONN_COMPLETE:
case HCI_EV_CONN_COMPLETE:
hci_conn_complete_evt(hdev, skb);
break;
case EVT_DISCONN_COMPLETE:
case HCI_EV_DISCONN_COMPLETE:
hci_disconn_complete_evt(hdev, skb);
break;
case EVT_ROLE_CHANGE:
case HCI_EV_ROLE_CHANGE:
hci_role_change_evt(hdev, skb);
break;
case EVT_AUTH_COMPLETE:
case HCI_EV_AUTH_COMPLETE:
hci_auth_complete_evt(hdev, skb);
break;
case EVT_ENCRYPT_CHANGE:
case HCI_EV_ENCRYPT_CHANGE:
hci_encrypt_change_evt(hdev, skb);
break;
case EVT_CMD_STATUS:
cs = (struct evt_cmd_status *) skb->data;
case HCI_EV_CMD_STATUS:
cs = (struct hci_ev_cmd_status *) skb->data;
skb_pull(skb, sizeof(cs));
opcode = __le16_to_cpu(cs->opcode);
ogf = cmd_opcode_ogf(opcode);
ocf = cmd_opcode_ocf(opcode);
ogf = hci_opcode_ogf(opcode);
ocf = hci_opcode_ocf(opcode);
switch (ogf) {
case OGF_INFO_PARAM:
......@@ -792,13 +792,13 @@ void hci_event_packet(struct hci_dev *hdev, struct sk_buff *skb)
}
break;
case EVT_CMD_COMPLETE:
ec = (struct evt_cmd_complete *) skb->data;
case HCI_EV_CMD_COMPLETE:
ec = (struct hci_ev_cmd_complete *) skb->data;
skb_pull(skb, sizeof(*ec));
opcode = __le16_to_cpu(ec->opcode);
ogf = cmd_opcode_ogf(opcode);
ocf = cmd_opcode_ocf(opcode);
ogf = hci_opcode_ogf(opcode);
ocf = hci_opcode_ocf(opcode);
switch (ogf) {
case OGF_INFO_PARAM:
......@@ -838,7 +838,7 @@ void hci_event_packet(struct hci_dev *hdev, struct sk_buff *skb)
void hci_si_event(struct hci_dev *hdev, int type, int dlen, void *data)
{
struct hci_event_hdr *hdr;
struct evt_stack_internal *ev;
struct hci_ev_stack_internal *ev;
struct sk_buff *skb;
skb = bt_skb_alloc(HCI_EVENT_HDR_SIZE + sizeof(*ev) + dlen, GFP_ATOMIC);
......@@ -846,7 +846,7 @@ void hci_si_event(struct hci_dev *hdev, int type, int dlen, void *data)
return;
hdr = (void *) skb_put(skb, HCI_EVENT_HDR_SIZE);
hdr->evt = EVT_STACK_INTERNAL;
hdr->evt = HCI_EV_STACK_INTERNAL;
hdr->plen = sizeof(*ev) + dlen;
ev = (void *) skb_put(skb, sizeof(*ev) + dlen);
......
......@@ -114,9 +114,9 @@ void hci_send_to_sock(struct hci_dev *hdev, struct sk_buff *skb)
if (!test_bit(evt, flt->event_mask))
continue;
if (flt->opcode && ((evt == EVT_CMD_COMPLETE &&
if (flt->opcode && ((evt == HCI_EV_CMD_COMPLETE &&
flt->opcode != *(__u16 *)(skb->data + 3)) ||
(evt == EVT_CMD_STATUS &&
(evt == HCI_EV_CMD_STATUS &&
flt->opcode != *(__u16 *)(skb->data + 4))))
continue;
}
......@@ -394,8 +394,8 @@ static int hci_sock_sendmsg(struct kiocb *iocb, struct socket *sock, struct msgh
if (skb->pkt_type == HCI_COMMAND_PKT) {
u16 opcode = __le16_to_cpu(*(__u16 *)skb->data);
u16 ogf = cmd_opcode_ogf(opcode) - 1;
u16 ocf = cmd_opcode_ocf(opcode) & HCI_FLT_OCF_BITS;
u16 ogf = hci_opcode_ogf(opcode) - 1;
u16 ocf = hci_opcode_ocf(opcode) & HCI_FLT_OCF_BITS;
if (ogf > HCI_SFLT_MAX_OGF ||
!test_bit(ocf, hci_sec_filter.ocf_mask[ogf]))
......@@ -584,14 +584,14 @@ static int hci_sock_create(struct socket *sock, int protocol)
static int hci_sock_dev_event(struct notifier_block *this, unsigned long event, void *ptr)
{
struct hci_dev *hdev = (struct hci_dev *) ptr;
struct evt_si_device ev;
struct hci_ev_si_device ev;
BT_DBG("hdev %s event %ld", hdev->name, event);
/* Send event to sockets */
ev.event = event;
ev.dev_id = hdev->id;
hci_si_event(NULL, EVT_SI_DEVICE, sizeof(ev), &ev);
hci_si_event(NULL, HCI_EV_SI_DEVICE, sizeof(ev), &ev);
if (event == HCI_DEV_UNREG) {
struct sock *sk;
......
......@@ -56,7 +56,6 @@ EXPORT_SYMBOL(hci_dev_get);
EXPORT_SYMBOL(hci_conn_auth);
EXPORT_SYMBOL(hci_conn_encrypt);
EXPORT_SYMBOL(hci_recv_frame);
EXPORT_SYMBOL(hci_send_acl);
EXPORT_SYMBOL(hci_send_sco);
EXPORT_SYMBOL(hci_send_raw);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment