diff options
-rw-r--r-- | include/net/bluetooth/hci_core.h | 1 | ||||
-rw-r--r-- | net/bluetooth/hci_conn.c | 1 | ||||
-rw-r--r-- | net/bluetooth/hci_event.c | 12 |
3 files changed, 13 insertions, 1 deletions
diff --git a/include/net/bluetooth/hci_core.h b/include/net/bluetooth/hci_core.h index cbbab6327621..b386bf17e6c2 100644 --- a/include/net/bluetooth/hci_core.h +++ b/include/net/bluetooth/hci_core.h | |||
@@ -382,6 +382,7 @@ struct hci_conn { | |||
382 | __u16 le_conn_max_interval; | 382 | __u16 le_conn_max_interval; |
383 | __s8 rssi; | 383 | __s8 rssi; |
384 | __s8 tx_power; | 384 | __s8 tx_power; |
385 | __s8 max_tx_power; | ||
385 | unsigned long flags; | 386 | unsigned long flags; |
386 | 387 | ||
387 | unsigned long conn_info_timestamp; | 388 | unsigned long conn_info_timestamp; |
diff --git a/net/bluetooth/hci_conn.c b/net/bluetooth/hci_conn.c index 74b368bfe102..a987e7def025 100644 --- a/net/bluetooth/hci_conn.c +++ b/net/bluetooth/hci_conn.c | |||
@@ -408,6 +408,7 @@ struct hci_conn *hci_conn_add(struct hci_dev *hdev, int type, bdaddr_t *dst) | |||
408 | conn->remote_auth = 0xff; | 408 | conn->remote_auth = 0xff; |
409 | conn->key_type = 0xff; | 409 | conn->key_type = 0xff; |
410 | conn->tx_power = HCI_TX_POWER_INVALID; | 410 | conn->tx_power = HCI_TX_POWER_INVALID; |
411 | conn->max_tx_power = HCI_TX_POWER_INVALID; | ||
411 | 412 | ||
412 | set_bit(HCI_CONN_POWER_SAVE, &conn->flags); | 413 | set_bit(HCI_CONN_POWER_SAVE, &conn->flags); |
413 | conn->disc_timeout = HCI_DISCONN_TIMEOUT; | 414 | conn->disc_timeout = HCI_DISCONN_TIMEOUT; |
diff --git a/net/bluetooth/hci_event.c b/net/bluetooth/hci_event.c index fa614e3430a7..492d8d5071c7 100644 --- a/net/bluetooth/hci_event.c +++ b/net/bluetooth/hci_event.c | |||
@@ -1282,9 +1282,19 @@ static void hci_cc_read_tx_power(struct hci_dev *hdev, struct sk_buff *skb) | |||
1282 | hci_dev_lock(hdev); | 1282 | hci_dev_lock(hdev); |
1283 | 1283 | ||
1284 | conn = hci_conn_hash_lookup_handle(hdev, __le16_to_cpu(rp->handle)); | 1284 | conn = hci_conn_hash_lookup_handle(hdev, __le16_to_cpu(rp->handle)); |
1285 | if (conn && sent->type == 0x00) | 1285 | if (!conn) |
1286 | goto unlock; | ||
1287 | |||
1288 | switch (sent->type) { | ||
1289 | case 0x00: | ||
1286 | conn->tx_power = rp->tx_power; | 1290 | conn->tx_power = rp->tx_power; |
1291 | break; | ||
1292 | case 0x01: | ||
1293 | conn->max_tx_power = rp->tx_power; | ||
1294 | break; | ||
1295 | } | ||
1287 | 1296 | ||
1297 | unlock: | ||
1288 | hci_dev_unlock(hdev); | 1298 | hci_dev_unlock(hdev); |
1289 | } | 1299 | } |
1290 | 1300 | ||