@@ -1681,6 +1681,10 @@ struct hci_cp_le_set_default_phy {
#define HCI_LE_SET_PHY_2M 0x02
#define HCI_LE_SET_PHY_CODED 0x04
+#define HCI_LE_READ_PHY_1M 0x01
+#define HCI_LE_READ_PHY_2M 0x02
+#define HCI_LE_READ_PHY_CODED 0x03
+
#define HCI_OP_LE_SET_EXT_SCAN_PARAMS 0x2041
struct hci_cp_le_set_ext_scan_params {
__u8 own_addr_type;
@@ -1915,22 +1915,19 @@ u32 hci_conn_get_phy(struct hci_conn *conn)
break;
case LE_LINK:
- if (conn->le_tx_phy & HCI_LE_SET_PHY_1M)
- phys |= BT_PHY_LE_1M_TX;
-
- if (conn->le_rx_phy & HCI_LE_SET_PHY_1M)
- phys |= BT_PHY_LE_1M_RX;
- if (conn->le_tx_phy & HCI_LE_SET_PHY_2M)
+ if (conn->le_tx_phy == HCI_LE_READ_PHY_1M)
+ phys |= BT_PHY_LE_1M_TX;
+ else if (conn->le_tx_phy == HCI_LE_READ_PHY_2M)
phys |= BT_PHY_LE_2M_TX;
-
- if (conn->le_rx_phy & HCI_LE_SET_PHY_2M)
- phys |= BT_PHY_LE_2M_RX;
-
- if (conn->le_tx_phy & HCI_LE_SET_PHY_CODED)
+ else if (conn->le_tx_phy == HCI_LE_READ_PHY_CODED)
phys |= BT_PHY_LE_CODED_TX;
- if (conn->le_rx_phy & HCI_LE_SET_PHY_CODED)
+ if (conn->le_rx_phy == HCI_LE_READ_PHY_1M)
+ phys |= BT_PHY_LE_1M_RX;
+ else if (conn->le_rx_phy == HCI_LE_READ_PHY_2M)
+ phys |= BT_PHY_LE_2M_RX;
+ else if (conn->le_rx_phy == HCI_LE_READ_PHY_CODED)
phys |= BT_PHY_LE_CODED_RX;
break;