Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 237353
b: refs/heads/master
c: 09db47b
h: refs/heads/master
i:
  237351: 021fbd0
v: v3
  • Loading branch information
John W. Linville committed Feb 9, 2011
1 parent f88a83a commit b36bb1d
Show file tree
Hide file tree
Showing 22 changed files with 3,669 additions and 1,515 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 72c2d9e511846a4f2759389b38ed8a5553579eb3
refs/heads/master: 09db47b08a9b54f59ee1cfed80837fa2cae87bd1
10 changes: 5 additions & 5 deletions trunk/drivers/bluetooth/ath3k.c
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ static struct usb_device_id ath3k_table[] = {
/* Atheros AR3011 with sflash firmware*/
{ USB_DEVICE(0x0CF3, 0x3002) },

/* Atheros AR9285 Malbec with sflash firmware */
{ USB_DEVICE(0x03F0, 0x311D) },
{ } /* Terminating entry */
};

Expand Down Expand Up @@ -106,6 +108,7 @@ static int ath3k_probe(struct usb_interface *intf,
{
const struct firmware *firmware;
struct usb_device *udev = interface_to_usbdev(intf);
int ret;

BT_DBG("intf %p id %p", intf, id);

Expand All @@ -116,13 +119,10 @@ static int ath3k_probe(struct usb_interface *intf,
return -EIO;
}

if (ath3k_load_firmware(udev, firmware)) {
release_firmware(firmware);
return -EIO;
}
ret = ath3k_load_firmware(udev, firmware);
release_firmware(firmware);

return 0;
return ret;
}

static void ath3k_disconnect(struct usb_interface *intf)
Expand Down
3 changes: 3 additions & 0 deletions trunk/drivers/bluetooth/btusb.c
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,9 @@ static struct usb_device_id blacklist_table[] = {
/* Atheros 3011 with sflash firmware */
{ USB_DEVICE(0x0cf3, 0x3002), .driver_info = BTUSB_IGNORE },

/* Atheros AR9285 Malbec with sflash firmware */
{ USB_DEVICE(0x03f0, 0x311d), .driver_info = BTUSB_IGNORE },

/* Broadcom BCM2035 */
{ USB_DEVICE(0x0a5c, 0x2035), .driver_info = BTUSB_WRONG_SCO_MTU },
{ USB_DEVICE(0x0a5c, 0x200a), .driver_info = BTUSB_WRONG_SCO_MTU },
Expand Down
5 changes: 5 additions & 0 deletions trunk/include/net/bluetooth/bluetooth.h
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,11 @@ struct bt_security {

#define BT_DEFER_SETUP 7

#define BT_FLUSHABLE 8

#define BT_FLUSHABLE_OFF 0
#define BT_FLUSHABLE_ON 1

#define BT_INFO(fmt, arg...) printk(KERN_INFO "Bluetooth: " fmt "\n" , ## arg)
#define BT_ERR(fmt, arg...) printk(KERN_ERR "%s: " fmt "\n" , __func__ , ## arg)
#define BT_DBG(fmt, arg...) pr_debug("%s: " fmt "\n" , __func__ , ## arg)
Expand Down
57 changes: 57 additions & 0 deletions trunk/include/net/bluetooth/hci.h
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,14 @@ enum {
HCI_INQUIRY,

HCI_RAW,

HCI_SETUP,
HCI_AUTO_OFF,
HCI_MGMT,
HCI_PAIRABLE,
HCI_SERVICE_CACHE,
HCI_LINK_KEYS,
HCI_DEBUG_KEYS,
};

/* HCI ioctl defines */
Expand Down Expand Up @@ -150,6 +158,7 @@ enum {
#define EDR_ESCO_MASK (ESCO_2EV3 | ESCO_3EV3 | ESCO_2EV5 | ESCO_3EV5)

/* ACL flags */
#define ACL_START_NO_FLUSH 0x00
#define ACL_CONT 0x01
#define ACL_START 0x02
#define ACL_ACTIVE_BCAST 0x04
Expand Down Expand Up @@ -183,17 +192,25 @@ enum {
#define LMP_PSCHEME 0x02
#define LMP_PCONTROL 0x04

#define LMP_RSSI_INQ 0x40
#define LMP_ESCO 0x80

#define LMP_EV4 0x01
#define LMP_EV5 0x02
#define LMP_LE 0x40

#define LMP_SNIFF_SUBR 0x02
#define LMP_PAUSE_ENC 0x04
#define LMP_EDR_ESCO_2M 0x20
#define LMP_EDR_ESCO_3M 0x40
#define LMP_EDR_3S_ESCO 0x80

#define LMP_EXT_INQ 0x01
#define LMP_SIMPLE_PAIR 0x08
#define LMP_NO_FLUSH 0x40

#define LMP_LSTO 0x01
#define LMP_INQ_TX_PWR 0x02

/* Connection modes */
#define HCI_CM_ACTIVE 0x0000
Expand Down Expand Up @@ -292,11 +309,19 @@ struct hci_cp_pin_code_reply {
__u8 pin_len;
__u8 pin_code[16];
} __packed;
struct hci_rp_pin_code_reply {
__u8 status;
bdaddr_t bdaddr;
} __packed;

#define HCI_OP_PIN_CODE_NEG_REPLY 0x040e
struct hci_cp_pin_code_neg_reply {
bdaddr_t bdaddr;
} __packed;
struct hci_rp_pin_code_neg_reply {
__u8 status;
bdaddr_t bdaddr;
} __packed;

#define HCI_OP_CHANGE_CONN_PTYPE 0x040f
struct hci_cp_change_conn_ptype {
Expand Down Expand Up @@ -377,6 +402,20 @@ struct hci_cp_reject_sync_conn_req {
__u8 reason;
} __packed;

#define HCI_OP_IO_CAPABILITY_REPLY 0x042b
struct hci_cp_io_capability_reply {
bdaddr_t bdaddr;
__u8 capability;
__u8 oob_data;
__u8 authentication;
} __packed;

#define HCI_OP_IO_CAPABILITY_NEG_REPLY 0x0434
struct hci_cp_io_capability_neg_reply {
bdaddr_t bdaddr;
__u8 reason;
} __packed;

#define HCI_OP_SNIFF_MODE 0x0803
struct hci_cp_sniff_mode {
__le16 handle;
Expand Down Expand Up @@ -474,6 +513,12 @@ struct hci_cp_set_event_flt {
#define HCI_CONN_SETUP_AUTO_OFF 0x01
#define HCI_CONN_SETUP_AUTO_ON 0x02

#define HCI_OP_DELETE_STORED_LINK_KEY 0x0c12
struct hci_cp_delete_stored_link_key {
bdaddr_t bdaddr;
__u8 delete_all;
} __packed;

#define HCI_OP_WRITE_LOCAL_NAME 0x0c13
struct hci_cp_write_local_name {
__u8 name[248];
Expand Down Expand Up @@ -537,6 +582,8 @@ struct hci_cp_host_buffer_size {
__le16 sco_max_pkt;
} __packed;

#define HCI_OP_WRITE_INQUIRY_MODE 0x0c45

#define HCI_OP_READ_SSP_MODE 0x0c55
struct hci_rp_read_ssp_mode {
__u8 status;
Expand All @@ -548,6 +595,8 @@ struct hci_cp_write_ssp_mode {
__u8 mode;
} __packed;

#define HCI_OP_READ_INQ_RSP_TX_POWER 0x0c58

#define HCI_OP_READ_LOCAL_VERSION 0x1001
struct hci_rp_read_local_version {
__u8 status;
Expand Down Expand Up @@ -833,6 +882,14 @@ struct hci_ev_io_capa_request {
bdaddr_t bdaddr;
} __packed;

#define HCI_EV_IO_CAPA_REPLY 0x32
struct hci_ev_io_capa_reply {
bdaddr_t bdaddr;
__u8 capability;
__u8 oob_data;
__u8 authentication;
} __packed;

#define HCI_EV_SIMPLE_PAIR_COMPLETE 0x36
struct hci_ev_simple_pair_complete {
__u8 status;
Expand Down
62 changes: 60 additions & 2 deletions trunk/include/net/bluetooth/hci_core.h
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,21 @@ struct bdaddr_list {
struct list_head list;
bdaddr_t bdaddr;
};

struct bt_uuid {
struct list_head list;
u8 uuid[16];
u8 svc_hint;
};

struct link_key {
struct list_head list;
bdaddr_t bdaddr;
u8 type;
u8 val[16];
u8 pin_len;
};

#define NUM_REASSEMBLY 4
struct hci_dev {
struct list_head list;
Expand All @@ -80,13 +95,18 @@ struct hci_dev {
bdaddr_t bdaddr;
__u8 dev_name[248];
__u8 dev_class[3];
__u8 major_class;
__u8 minor_class;
__u8 features[8];
__u8 commands[64];
__u8 ssp_mode;
__u8 hci_ver;
__u16 hci_rev;
__u8 lmp_ver;
__u16 manufacturer;
__le16 lmp_subver;
__u16 voice_setting;
__u8 io_capability;

__u16 pkt_type;
__u16 esco_type;
Expand Down Expand Up @@ -114,6 +134,10 @@ struct hci_dev {

struct workqueue_struct *workqueue;

struct work_struct power_on;
struct work_struct power_off;
struct timer_list off_timer;

struct tasklet_struct cmd_task;
struct tasklet_struct rx_task;
struct tasklet_struct tx_task;
Expand All @@ -129,12 +153,17 @@ struct hci_dev {
wait_queue_head_t req_wait_q;
__u32 req_status;
__u32 req_result;
__u16 req_last_cmd;

__u16 init_last_cmd;

struct inquiry_cache inq_cache;
struct hci_conn_hash conn_hash;
struct list_head blacklist;

struct list_head uuids;

struct list_head link_keys;

struct hci_dev_stats stat;

struct sk_buff_head driver_init;
Expand Down Expand Up @@ -185,10 +214,16 @@ struct hci_conn {
__u8 auth_type;
__u8 sec_level;
__u8 pending_sec_level;
__u8 pin_length;
__u8 io_capability;
__u8 power_save;
__u16 disc_timeout;
unsigned long pend;

__u8 remote_cap;
__u8 remote_oob;
__u8 remote_auth;

unsigned int sent;

struct sk_buff_head data_q;
Expand Down Expand Up @@ -437,6 +472,16 @@ int hci_inquiry(void __user *arg);
struct bdaddr_list *hci_blacklist_lookup(struct hci_dev *hdev, bdaddr_t *bdaddr);
int hci_blacklist_clear(struct hci_dev *hdev);

int hci_uuids_clear(struct hci_dev *hdev);

int hci_link_keys_clear(struct hci_dev *hdev);
struct link_key *hci_find_link_key(struct hci_dev *hdev, bdaddr_t *bdaddr);
int hci_add_link_key(struct hci_dev *hdev, int new_key, bdaddr_t *bdaddr,
u8 *key, u8 type, u8 pin_len);
int hci_remove_link_key(struct hci_dev *hdev, bdaddr_t *bdaddr);

void hci_del_off_timer(struct hci_dev *hdev);

void hci_event_packet(struct hci_dev *hdev, struct sk_buff *skb);

int hci_recv_frame(struct sk_buff *skb);
Expand All @@ -458,6 +503,7 @@ void hci_conn_del_sysfs(struct hci_conn *conn);
#define lmp_sniffsubr_capable(dev) ((dev)->features[5] & LMP_SNIFF_SUBR)
#define lmp_esco_capable(dev) ((dev)->features[3] & LMP_ESCO)
#define lmp_ssp_capable(dev) ((dev)->features[6] & LMP_SIMPLE_PAIR)
#define lmp_no_flush_capable(dev) ((dev)->features[6] & LMP_NO_FLUSH)

/* ----- HCI protocols ----- */
struct hci_proto {
Expand Down Expand Up @@ -660,12 +706,24 @@ void *hci_sent_cmd_data(struct hci_dev *hdev, __u16 opcode);
void hci_si_event(struct hci_dev *hdev, int type, int dlen, void *data);

/* ----- HCI Sockets ----- */
void hci_send_to_sock(struct hci_dev *hdev, struct sk_buff *skb);
void hci_send_to_sock(struct hci_dev *hdev, struct sk_buff *skb,
struct sock *skip_sk);

/* Management interface */
int mgmt_control(struct sock *sk, struct msghdr *msg, size_t len);
int mgmt_index_added(u16 index);
int mgmt_index_removed(u16 index);
int mgmt_powered(u16 index, u8 powered);
int mgmt_discoverable(u16 index, u8 discoverable);
int mgmt_connectable(u16 index, u8 connectable);
int mgmt_new_key(u16 index, struct link_key *key, u8 old_key_type);
int mgmt_connected(u16 index, bdaddr_t *bdaddr);
int mgmt_disconnected(u16 index, bdaddr_t *bdaddr);
int mgmt_disconnect_failed(u16 index);
int mgmt_connect_failed(u16 index, bdaddr_t *bdaddr, u8 status);
int mgmt_pin_code_request(u16 index, bdaddr_t *bdaddr);
int mgmt_pin_code_reply_complete(u16 index, bdaddr_t *bdaddr, u8 status);
int mgmt_pin_code_neg_reply_complete(u16 index, bdaddr_t *bdaddr, u8 status);

/* HCI info for socket */
#define hci_pi(sk) ((struct hci_pinfo *) sk)
Expand Down
32 changes: 32 additions & 0 deletions trunk/include/net/bluetooth/l2cap.h
Original file line number Diff line number Diff line change
Expand Up @@ -327,6 +327,7 @@ struct l2cap_pinfo {
__u8 sec_level;
__u8 role_switch;
__u8 force_reliable;
__u8 flushable;

__u8 conf_req[64];
__u8 conf_len;
Expand Down Expand Up @@ -423,6 +424,37 @@ static inline int l2cap_tx_window_full(struct sock *sk)
#define __is_sframe(ctrl) ((ctrl) & L2CAP_CTRL_FRAME_TYPE)
#define __is_sar_start(ctrl) (((ctrl) & L2CAP_CTRL_SAR) == L2CAP_SDU_START)

extern int disable_ertm;
extern const struct proto_ops l2cap_sock_ops;
extern struct bt_sock_list l2cap_sk_list;

int l2cap_init_sockets(void);
void l2cap_cleanup_sockets(void);

u8 l2cap_get_ident(struct l2cap_conn *conn);
void l2cap_send_cmd(struct l2cap_conn *conn, u8 ident, u8 code, u16 len, void *data);
int l2cap_build_conf_req(struct sock *sk, void *data);
int __l2cap_wait_ack(struct sock *sk);

struct sk_buff *l2cap_create_connless_pdu(struct sock *sk, struct msghdr *msg, size_t len);
struct sk_buff *l2cap_create_basic_pdu(struct sock *sk, struct msghdr *msg, size_t len);
struct sk_buff *l2cap_create_iframe_pdu(struct sock *sk, struct msghdr *msg, size_t len, u16 control, u16 sdulen);
int l2cap_sar_segment_sdu(struct sock *sk, struct msghdr *msg, size_t len);
void l2cap_do_send(struct sock *sk, struct sk_buff *skb);
void l2cap_streaming_send(struct sock *sk);
int l2cap_ertm_send(struct sock *sk);

void l2cap_sock_set_timer(struct sock *sk, long timeout);
void l2cap_sock_clear_timer(struct sock *sk);
void __l2cap_sock_close(struct sock *sk, int reason);
void l2cap_sock_kill(struct sock *sk);
void l2cap_sock_init(struct sock *sk, struct sock *parent);
struct sock *l2cap_sock_alloc(struct net *net, struct socket *sock,
int proto, gfp_t prio);
void l2cap_send_disconn_req(struct l2cap_conn *conn, struct sock *sk, int err);
void l2cap_chan_del(struct sock *sk, int err);
int l2cap_do_connect(struct sock *sk);

void l2cap_load(void);

#endif /* __L2CAP_H */
Loading

0 comments on commit b36bb1d

Please sign in to comment.