aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/net/bluetooth/hci_core.h6
-rw-r--r--net/bluetooth/hci_core.c6
-rw-r--r--net/bluetooth/hci_event.c61
3 files changed, 73 insertions, 0 deletions
diff --git a/include/net/bluetooth/hci_core.h b/include/net/bluetooth/hci_core.h
index 79724c87ab00..f20f6bd668bd 100644
--- a/include/net/bluetooth/hci_core.h
+++ b/include/net/bluetooth/hci_core.h
@@ -220,6 +220,12 @@ struct hci_dev {
220 __u16 le_conn_max_interval; 220 __u16 le_conn_max_interval;
221 __u16 le_conn_latency; 221 __u16 le_conn_latency;
222 __u16 le_supv_timeout; 222 __u16 le_supv_timeout;
223 __u16 le_def_tx_len;
224 __u16 le_def_tx_time;
225 __u16 le_max_tx_len;
226 __u16 le_max_tx_time;
227 __u16 le_max_rx_len;
228 __u16 le_max_rx_time;
223 __u16 discov_interleaved_timeout; 229 __u16 discov_interleaved_timeout;
224 __u16 conn_info_min_age; 230 __u16 conn_info_min_age;
225 __u16 conn_info_max_age; 231 __u16 conn_info_max_age;
diff --git a/net/bluetooth/hci_core.c b/net/bluetooth/hci_core.c
index 01e35ef6d201..47f0311d1006 100644
--- a/net/bluetooth/hci_core.c
+++ b/net/bluetooth/hci_core.c
@@ -2896,6 +2896,12 @@ struct hci_dev *hci_alloc_dev(void)
2896 hdev->le_conn_max_interval = 0x0038; 2896 hdev->le_conn_max_interval = 0x0038;
2897 hdev->le_conn_latency = 0x0000; 2897 hdev->le_conn_latency = 0x0000;
2898 hdev->le_supv_timeout = 0x002a; 2898 hdev->le_supv_timeout = 0x002a;
2899 hdev->le_def_tx_len = 0x001b;
2900 hdev->le_def_tx_time = 0x0148;
2901 hdev->le_max_tx_len = 0x001b;
2902 hdev->le_max_tx_time = 0x0148;
2903 hdev->le_max_rx_len = 0x001b;
2904 hdev->le_max_rx_time = 0x0148;
2899 2905
2900 hdev->rpa_timeout = HCI_DEFAULT_RPA_TIMEOUT; 2906 hdev->rpa_timeout = HCI_DEFAULT_RPA_TIMEOUT;
2901 hdev->discov_interleaved_timeout = DISCOV_INTERLEAVED_TIMEOUT; 2907 hdev->discov_interleaved_timeout = DISCOV_INTERLEAVED_TIMEOUT;
diff --git a/net/bluetooth/hci_event.c b/net/bluetooth/hci_event.c
index a412eb1e1f61..a3055e90a5bb 100644
--- a/net/bluetooth/hci_event.c
+++ b/net/bluetooth/hci_event.c
@@ -1280,6 +1280,55 @@ static void hci_cc_le_read_supported_states(struct hci_dev *hdev,
1280 memcpy(hdev->le_states, rp->le_states, 8); 1280 memcpy(hdev->le_states, rp->le_states, 8);
1281} 1281}
1282 1282
1283static void hci_cc_le_read_def_data_len(struct hci_dev *hdev,
1284 struct sk_buff *skb)
1285{
1286 struct hci_rp_le_read_def_data_len *rp = (void *) skb->data;
1287
1288 BT_DBG("%s status 0x%2.2x", hdev->name, rp->status);
1289
1290 if (rp->status)
1291 return;
1292
1293 hdev->le_def_tx_len = le16_to_cpu(rp->tx_len);
1294 hdev->le_def_tx_time = le16_to_cpu(rp->tx_time);
1295}
1296
1297static void hci_cc_le_write_def_data_len(struct hci_dev *hdev,
1298 struct sk_buff *skb)
1299{
1300 struct hci_cp_le_write_def_data_len *sent;
1301 __u8 status = *((__u8 *) skb->data);
1302
1303 BT_DBG("%s status 0x%2.2x", hdev->name, status);
1304
1305 if (status)
1306 return;
1307
1308 sent = hci_sent_cmd_data(hdev, HCI_OP_LE_WRITE_DEF_DATA_LEN);
1309 if (!sent)
1310 return;
1311
1312 hdev->le_def_tx_len = le16_to_cpu(sent->tx_len);
1313 hdev->le_def_tx_time = le16_to_cpu(sent->tx_time);
1314}
1315
1316static void hci_cc_le_read_max_data_len(struct hci_dev *hdev,
1317 struct sk_buff *skb)
1318{
1319 struct hci_rp_le_read_max_data_len *rp = (void *) skb->data;
1320
1321 BT_DBG("%s status 0x%2.2x", hdev->name, rp->status);
1322
1323 if (rp->status)
1324 return;
1325
1326 hdev->le_max_tx_len = le16_to_cpu(rp->tx_len);
1327 hdev->le_max_tx_time = le16_to_cpu(rp->tx_time);
1328 hdev->le_max_rx_len = le16_to_cpu(rp->rx_len);
1329 hdev->le_max_rx_time = le16_to_cpu(rp->rx_time);
1330}
1331
1283static void hci_cc_write_le_host_supported(struct hci_dev *hdev, 1332static void hci_cc_write_le_host_supported(struct hci_dev *hdev,
1284 struct sk_buff *skb) 1333 struct sk_buff *skb)
1285{ 1334{
@@ -2847,6 +2896,18 @@ static void hci_cmd_complete_evt(struct hci_dev *hdev, struct sk_buff *skb)
2847 hci_cc_le_read_supported_states(hdev, skb); 2896 hci_cc_le_read_supported_states(hdev, skb);
2848 break; 2897 break;
2849 2898
2899 case HCI_OP_LE_READ_DEF_DATA_LEN:
2900 hci_cc_le_read_def_data_len(hdev, skb);
2901 break;
2902
2903 case HCI_OP_LE_WRITE_DEF_DATA_LEN:
2904 hci_cc_le_write_def_data_len(hdev, skb);
2905 break;
2906
2907 case HCI_OP_LE_READ_MAX_DATA_LEN:
2908 hci_cc_le_read_max_data_len(hdev, skb);
2909 break;
2910
2850 case HCI_OP_WRITE_LE_HOST_SUPPORTED: 2911 case HCI_OP_WRITE_LE_HOST_SUPPORTED:
2851 hci_cc_write_le_host_supported(hdev, skb); 2912 hci_cc_write_le_host_supported(hdev, skb);
2852 break; 2913 break;