diff options
Diffstat (limited to 'net/bluetooth_mgmt')
-rw-r--r-- | net/bluetooth_mgmt/Kconfig | 2 | ||||
-rw-r--r-- | net/bluetooth_mgmt/af_bluetooth.c | 6 | ||||
-rw-r--r-- | net/bluetooth_mgmt/hci_core.c | 31 | ||||
-rw-r--r-- | net/bluetooth_mgmt/hci_event.c | 19 | ||||
-rw-r--r-- | net/bluetooth_mgmt/sco.c | 5 |
5 files changed, 46 insertions, 17 deletions
diff --git a/net/bluetooth_mgmt/Kconfig b/net/bluetooth_mgmt/Kconfig index 002b302..c1fc90c 100644 --- a/net/bluetooth_mgmt/Kconfig +++ b/net/bluetooth_mgmt/Kconfig @@ -3,7 +3,7 @@ # menuconfig BT - tristate "Bluetooth subsystem support" + tristate "Bluetooth subsystem support(Android)" depends on NET && !S390 depends on RFKILL || !RFKILL select CRYPTO diff --git a/net/bluetooth_mgmt/af_bluetooth.c b/net/bluetooth_mgmt/af_bluetooth.c index 7c73a10..c3afcd2 100644 --- a/net/bluetooth_mgmt/af_bluetooth.c +++ b/net/bluetooth_mgmt/af_bluetooth.c @@ -224,8 +224,10 @@ void bt_accept_unlink(struct sock *sk) BT_DBG("sk %p state %d", sk, sk->sk_state); list_del_init(&bt_sk(sk)->accept_q); - bt_sk(sk)->parent->sk_ack_backlog--; - bt_sk(sk)->parent = NULL; + if (bt_sk(sk)->parent != NULL) { + bt_sk(sk)->parent->sk_ack_backlog--; + bt_sk(sk)->parent = NULL; + } sock_put(sk); } EXPORT_SYMBOL(bt_accept_unlink); diff --git a/net/bluetooth_mgmt/hci_core.c b/net/bluetooth_mgmt/hci_core.c index a68c91e..d695b16 100644 --- a/net/bluetooth_mgmt/hci_core.c +++ b/net/bluetooth_mgmt/hci_core.c @@ -45,7 +45,6 @@ #include <linux/timer.h> #include <linux/crypto.h> #include <net/sock.h> -#include <linux/gpio.h> #include <asm/system.h> #include <linux/uaccess.h> @@ -219,6 +218,7 @@ static void hci_init_req(struct hci_dev *hdev, unsigned long opt) if (!test_bit(HCI_QUIRK_NO_RESET, &hdev->quirks)) { set_bit(HCI_RESET, &hdev->flags); hci_send_cmd(hdev, HCI_OP_RESET, 0, NULL); + memset(hdev->eir, 0, sizeof(hdev->eir)); } /* Read Local Supported Features */ @@ -773,6 +773,7 @@ static int hci_dev_do_close(struct hci_dev *hdev) set_bit(HCI_INIT, &hdev->flags); __hci_request(hdev, hci_reset_req, 0, msecs_to_jiffies(250)); + memset(hdev->eir, 0, sizeof(hdev->eir)); clear_bit(HCI_INIT, &hdev->flags); } @@ -1417,18 +1418,7 @@ int hci_remove_ltk(struct hci_dev *hdev, bdaddr_t *bdaddr) static void hci_cmd_timer(unsigned long arg) { struct hci_dev *hdev = (void *) arg; -#ifdef CONFIG_MACH_M0 - int rx_pin = gpio_get_value(GPIO_BT_RXD); - int tx_pin = gpio_get_value(GPIO_BT_TXD); - int cts_pin = gpio_get_value(GPIO_BT_CTS); - int rts_pin = gpio_get_value(GPIO_BT_RTS); - - int bt_host_wake_pin = gpio_get_value(GPIO_BT_HOST_WAKE); - int bt_wake_pin = gpio_get_value(GPIO_BT_WAKE); - int bt_en = gpio_get_value(GPIO_BT_EN); - BT_ERR("rx: %d, tx: %d, cts: %d, rts: %d", rx_pin, tx_pin, cts_pin, rts_pin); - BT_ERR("host_wake: %d, bt_wake: %d, en: %d", bt_host_wake_pin, bt_wake_pin, bt_en); -#endif + BT_ERR("%s command tx timeout", hdev->name); atomic_set(&hdev->cmd_cnt, 1); tasklet_schedule(&hdev->cmd_task); @@ -2298,6 +2288,21 @@ void *hci_sent_cmd_data(struct hci_dev *hdev, __u16 opcode) { struct hci_command_hdr *hdr; + /* SS_BLUETOOTH(is80.hwang) 2012.05.16 */ + /*Check null pointer and opcode */ + #if defined(CONFIG_BT_CSR8811) + if (hdev == NULL) { + BT_ERR("hci_sent_cmd_opcode:: hdev=NULL, opcode=0x%x", opcode); + return NULL; + } + + if (hdev->sent_cmd->data == NULL) { + BT_ERR("hci_sent_cmd_opcode:: hdev->sent_cmd->data=NULL opcode=0x%x", opcode); + return NULL; + } + #endif + /* SS_BLUEZ_BT(is80.hwang) End */ + if (!hdev->sent_cmd) return NULL; diff --git a/net/bluetooth_mgmt/hci_event.c b/net/bluetooth_mgmt/hci_event.c index 7dc2018..9a3e6a6 100644 --- a/net/bluetooth_mgmt/hci_event.c +++ b/net/bluetooth_mgmt/hci_event.c @@ -1111,8 +1111,13 @@ static inline void hci_cs_inquiry(struct hci_dev *hdev, __u8 status) hci_req_complete(hdev, HCI_OP_INQUIRY, status); hci_conn_check_pending(hdev); hci_dev_lock(hdev); - if (test_bit(HCI_MGMT, &hdev->dev_flags)) + if (test_bit(HCI_MGMT, &hdev->dev_flags)) { + /* [GGSM/sc47.yun] P120828-6815. Discovery fail issue */ + BT_ERR("Discovery can't be done with other commands"); + hci_discovery_set_state(hdev, DISCOVERY_STOPPING); + mgmt_start_discovery_failed(hdev, status); + } hci_dev_unlock(hdev); return; } @@ -1899,6 +1904,18 @@ static inline void hci_auth_complete_evt(struct hci_dev *hdev, struct sk_buff *s return; } + /* SS_BLUETOOTH(is80.hwang) 2012.05.18 */ + /* for pin code request issue */ +#if defined(CONFIG_BT_CSR8811) + if (ev->status == 0x06 ) { + BT_ERR("Pin or key missing !!!"); + hci_remove_link_key(hdev, &conn->dst); + hci_dev_unlock(hdev); + return ; + } +#endif + /* SS_BLUEZ_BT(is80.hwang) End */ + if (!ev->status) { if (!(conn->ssp_mode > 0 && hdev->ssp_mode > 0) && test_bit(HCI_CONN_REAUTH_PEND, &conn->flags)) { diff --git a/net/bluetooth_mgmt/sco.c b/net/bluetooth_mgmt/sco.c index 20d7cb7..5e0104c 100644 --- a/net/bluetooth_mgmt/sco.c +++ b/net/bluetooth_mgmt/sco.c @@ -905,6 +905,11 @@ static void sco_conn_ready(struct sco_conn *conn) bacpy(&bt_sk(sk)->src, conn->src); bacpy(&bt_sk(sk)->dst, conn->dst); + if (!conn->hcon) { + BT_ERR("conn->hcon = NULL"); + /* to do */ + } + hci_conn_hold(conn->hcon); __sco_chan_add(conn, sk, parent); |