diff options
author | Marcel Holtmann <marcel@holtmann.org> | 2013-10-14 16:56:16 -0400 |
---|---|---|
committer | Gustavo Padovan <gustavo.padovan@collabora.co.uk> | 2013-10-14 18:31:12 -0400 |
commit | b4cb9fb25e9eae749f456e9e94446650389e736b (patch) | |
tree | 41fd0824bced1503b54963d52da8e29acfb4e16c /net | |
parent | 899e107577a8de67b97a877ed90bbfbfefb1916e (diff) |
Bluetooth: Read number of supported IAC on controller setup
When initializing a controller make sure to read out the number of
supported IAC and store its result. This value is needed to determine
if limited discoverable for BR/EDR can be configured or not.
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
Diffstat (limited to 'net')
-rw-r--r-- | net/bluetooth/hci_core.c | 6 | ||||
-rw-r--r-- | net/bluetooth/hci_event.c | 19 |
2 files changed, 24 insertions, 1 deletions
diff --git a/net/bluetooth/hci_core.c b/net/bluetooth/hci_core.c index 0e05edee0962..b5ef05e66a2d 100644 --- a/net/bluetooth/hci_core.c +++ b/net/bluetooth/hci_core.c | |||
@@ -370,6 +370,9 @@ static void bredr_setup(struct hci_request *req) | |||
370 | /* Read Voice Setting */ | 370 | /* Read Voice Setting */ |
371 | hci_req_add(req, HCI_OP_READ_VOICE_SETTING, 0, NULL); | 371 | hci_req_add(req, HCI_OP_READ_VOICE_SETTING, 0, NULL); |
372 | 372 | ||
373 | /* Read Number of Supported IAC */ | ||
374 | hci_req_add(req, HCI_OP_READ_NUM_SUPPORTED_IAC, 0, NULL); | ||
375 | |||
373 | /* Clear Event Filters */ | 376 | /* Clear Event Filters */ |
374 | flt_type = HCI_FLT_CLEAR_ALL; | 377 | flt_type = HCI_FLT_CLEAR_ALL; |
375 | hci_req_add(req, HCI_OP_SET_EVENT_FLT, 1, &flt_type); | 378 | hci_req_add(req, HCI_OP_SET_EVENT_FLT, 1, &flt_type); |
@@ -2271,7 +2274,8 @@ struct hci_dev *hci_alloc_dev(void) | |||
2271 | hdev->pkt_type = (HCI_DM1 | HCI_DH1 | HCI_HV1); | 2274 | hdev->pkt_type = (HCI_DM1 | HCI_DH1 | HCI_HV1); |
2272 | hdev->esco_type = (ESCO_HV1); | 2275 | hdev->esco_type = (ESCO_HV1); |
2273 | hdev->link_mode = (HCI_LM_ACCEPT); | 2276 | hdev->link_mode = (HCI_LM_ACCEPT); |
2274 | hdev->io_capability = 0x03; /* No Input No Output */ | 2277 | hdev->num_iac = 0x01; /* One IAC support is mandatory */ |
2278 | hdev->io_capability = 0x03; /* No Input No Output */ | ||
2275 | hdev->inq_tx_power = HCI_TX_POWER_INVALID; | 2279 | hdev->inq_tx_power = HCI_TX_POWER_INVALID; |
2276 | hdev->adv_tx_power = HCI_TX_POWER_INVALID; | 2280 | hdev->adv_tx_power = HCI_TX_POWER_INVALID; |
2277 | 2281 | ||
diff --git a/net/bluetooth/hci_event.c b/net/bluetooth/hci_event.c index da2bc3d3d289..5391469ff1a5 100644 --- a/net/bluetooth/hci_event.c +++ b/net/bluetooth/hci_event.c | |||
@@ -418,6 +418,21 @@ static void hci_cc_write_voice_setting(struct hci_dev *hdev, | |||
418 | hdev->notify(hdev, HCI_NOTIFY_VOICE_SETTING); | 418 | hdev->notify(hdev, HCI_NOTIFY_VOICE_SETTING); |
419 | } | 419 | } |
420 | 420 | ||
421 | static void hci_cc_read_num_supported_iac(struct hci_dev *hdev, | ||
422 | struct sk_buff *skb) | ||
423 | { | ||
424 | struct hci_rp_read_num_supported_iac *rp = (void *) skb->data; | ||
425 | |||
426 | BT_DBG("%s status 0x%2.2x", hdev->name, rp->status); | ||
427 | |||
428 | if (rp->status) | ||
429 | return; | ||
430 | |||
431 | hdev->num_iac = rp->num_iac; | ||
432 | |||
433 | BT_DBG("%s num iac %d", hdev->name, hdev->num_iac); | ||
434 | } | ||
435 | |||
421 | static void hci_cc_write_ssp_mode(struct hci_dev *hdev, struct sk_buff *skb) | 436 | static void hci_cc_write_ssp_mode(struct hci_dev *hdev, struct sk_buff *skb) |
422 | { | 437 | { |
423 | __u8 status = *((__u8 *) skb->data); | 438 | __u8 status = *((__u8 *) skb->data); |
@@ -2135,6 +2150,10 @@ static void hci_cmd_complete_evt(struct hci_dev *hdev, struct sk_buff *skb) | |||
2135 | hci_cc_write_voice_setting(hdev, skb); | 2150 | hci_cc_write_voice_setting(hdev, skb); |
2136 | break; | 2151 | break; |
2137 | 2152 | ||
2153 | case HCI_OP_READ_NUM_SUPPORTED_IAC: | ||
2154 | hci_cc_read_num_supported_iac(hdev, skb); | ||
2155 | break; | ||
2156 | |||
2138 | case HCI_OP_WRITE_SSP_MODE: | 2157 | case HCI_OP_WRITE_SSP_MODE: |
2139 | hci_cc_write_ssp_mode(hdev, skb); | 2158 | hci_cc_write_ssp_mode(hdev, skb); |
2140 | break; | 2159 | break; |