@@ -2524,9 +2524,7 @@ static void hci_check_pending_name(struct hci_dev *hdev, struct hci_conn *conn,
2524
2524
* Only those in BT_CONFIG or BT_CONNECTED states can be
2525
2525
* considered connected.
2526
2526
*/
2527
- if (conn &&
2528
- (conn -> state == BT_CONFIG || conn -> state == BT_CONNECTED ) &&
2529
- !test_and_set_bit (HCI_CONN_MGMT_CONNECTED , & conn -> flags ))
2527
+ if (conn && (conn -> state == BT_CONFIG || conn -> state == BT_CONNECTED ))
2530
2528
mgmt_device_connected (hdev , conn , name , name_len );
2531
2529
2532
2530
if (discov -> state == DISCOVERY_STOPPED )
@@ -3758,8 +3756,9 @@ static void hci_remote_features_evt(struct hci_dev *hdev, void *data,
3758
3756
bacpy (& cp .bdaddr , & conn -> dst );
3759
3757
cp .pscan_rep_mode = 0x02 ;
3760
3758
hci_send_cmd (hdev , HCI_OP_REMOTE_NAME_REQ , sizeof (cp ), & cp );
3761
- } else if (! test_and_set_bit ( HCI_CONN_MGMT_CONNECTED , & conn -> flags ))
3759
+ } else {
3762
3760
mgmt_device_connected (hdev , conn , NULL , 0 );
3761
+ }
3763
3762
3764
3763
if (!hci_outgoing_auth_needed (hdev , conn )) {
3765
3764
conn -> state = BT_CONNECTED ;
@@ -3932,6 +3931,11 @@ static u8 hci_cc_le_setup_iso_path(struct hci_dev *hdev, void *data,
3932
3931
* last.
3933
3932
*/
3934
3933
hci_connect_cfm (conn , rp -> status );
3934
+
3935
+ /* Notify device connected in case it is a BIG Sync */
3936
+ if (!rp -> status && test_bit (HCI_CONN_BIG_SYNC , & conn -> flags ))
3937
+ mgmt_device_connected (hdev , conn , NULL , 0 );
3938
+
3935
3939
break ;
3936
3940
}
3937
3941
@@ -5006,8 +5010,9 @@ static void hci_remote_ext_features_evt(struct hci_dev *hdev, void *data,
5006
5010
bacpy (& cp .bdaddr , & conn -> dst );
5007
5011
cp .pscan_rep_mode = 0x02 ;
5008
5012
hci_send_cmd (hdev , HCI_OP_REMOTE_NAME_REQ , sizeof (cp ), & cp );
5009
- } else if (! test_and_set_bit ( HCI_CONN_MGMT_CONNECTED , & conn -> flags ))
5013
+ } else {
5010
5014
mgmt_device_connected (hdev , conn , NULL , 0 );
5015
+ }
5011
5016
5012
5017
if (!hci_outgoing_auth_needed (hdev , conn )) {
5013
5018
conn -> state = BT_CONNECTED ;
@@ -5980,8 +5985,7 @@ static void le_conn_complete_evt(struct hci_dev *hdev, u8 status,
5980
5985
goto unlock ;
5981
5986
}
5982
5987
5983
- if (!test_and_set_bit (HCI_CONN_MGMT_CONNECTED , & conn -> flags ))
5984
- mgmt_device_connected (hdev , conn , NULL , 0 );
5988
+ mgmt_device_connected (hdev , conn , NULL , 0 );
5985
5989
5986
5990
conn -> sec_level = BT_SECURITY_LOW ;
5987
5991
conn -> state = BT_CONFIG ;
@@ -7210,6 +7214,9 @@ static void hci_le_big_info_adv_report_evt(struct hci_dev *hdev, void *data,
7210
7214
/* Notify iso layer */
7211
7215
hci_connect_cfm (pa_sync , 0x00 );
7212
7216
7217
+ /* Notify MGMT layer */
7218
+ mgmt_device_connected (hdev , pa_sync , NULL , 0 );
7219
+
7213
7220
unlock :
7214
7221
hci_dev_unlock (hdev );
7215
7222
}
0 commit comments