@@ -768,7 +768,7 @@ static bool ltk_derive_link_key_allowed(struct bt_smp *smp)
768768 }
769769
770770 /* Check whether it is has been bonded */
771- link_key = bt_keys_find_link_key (& conn -> le .dst .a );
771+ link_key = bt_keys_find_link_key (conn -> hdev , & conn -> le .dst .a );
772772 if (link_key == NULL ) {
773773 return true;
774774 }
@@ -810,9 +810,9 @@ static void sc_derive_link_key(struct bt_smp *smp)
810810 }
811811
812812 /* Remove the bonding information */
813- link_key = bt_keys_find_link_key (& conn -> le .dst .a );
813+ link_key = bt_keys_find_link_key (conn -> hdev , & conn -> le .dst .a );
814814 if (link_key != NULL ) {
815- bt_keys_link_key_clear (link_key );
815+ bt_keys_link_key_clear (conn -> hdev , link_key );
816816 }
817817
818818 /*
@@ -863,7 +863,7 @@ static void sc_derive_link_key(struct bt_smp *smp)
863863
864864 if (atomic_test_bit (smp -> flags , SMP_FLAG_BOND )) {
865865 /* Store the link key */
866- bt_keys_link_key_store (link_key );
866+ bt_keys_link_key_store (conn -> hdev , link_key );
867867 }
868868}
869869
@@ -892,16 +892,16 @@ static void smp_br_reset(struct bt_smp_br *smp)
892892 atomic_set_bit (smp -> allowed_cmds , BT_SMP_CMD_PAIRING_REQ );
893893}
894894
895- static void smp_br_id_add_replace (struct bt_keys * keys )
895+ static void smp_br_id_add_replace (struct bt_dev * hdev , struct bt_keys * keys )
896896{
897897 struct bt_keys * conflict ;
898898
899899 /* Check whether key has been added to resolving list. */
900900 if (keys -> state & BT_KEYS_ID_ADDED ) {
901- bt_id_del (keys );
901+ bt_id_del (hdev , keys );
902902 }
903903
904- conflict = bt_id_find_conflict (keys );
904+ conflict = bt_id_find_conflict (hdev , keys );
905905 if (conflict != NULL ) {
906906 int err ;
907907
@@ -911,8 +911,8 @@ static void smp_br_id_add_replace(struct bt_keys *keys)
911911 __ASSERT_NO_MSG (!err );
912912 }
913913
914- __ASSERT_NO_MSG (!bt_id_find_conflict (keys ));
915- bt_id_add (keys );
914+ __ASSERT_NO_MSG (!bt_id_find_conflict (hdev , keys ));
915+ bt_id_add (hdev , keys );
916916}
917917
918918static void smp_pairing_br_complete (struct bt_smp_br * smp , uint8_t status )
@@ -949,7 +949,7 @@ static void smp_pairing_br_complete(struct bt_smp_br *smp, uint8_t status)
949949 struct bt_conn_auth_info_cb * listener , * next ;
950950
951951 if (keys ) {
952- smp_br_id_add_replace (keys );
952+ smp_br_id_add_replace (conn -> hdev , keys );
953953 }
954954
955955 if (bond_flag && keys ) {
@@ -1074,10 +1074,10 @@ static void smp_br_derive_ltk(struct bt_smp_br *smp)
10741074 bt_addr_copy (& addr .a , & conn -> br .dst );
10751075 addr .type = BT_ADDR_LE_PUBLIC ;
10761076
1077- keys = bt_keys_find_addr (conn -> id , & addr );
1077+ keys = bt_keys_find_addr (conn -> hdev , conn -> id , & addr );
10781078 if (keys != NULL ) {
10791079 LOG_DBG ("Clear the current keys for %s" , bt_addr_le_str (& addr ));
1080- bt_keys_clear (keys );
1080+ bt_keys_clear (conn -> hdev , keys );
10811081 }
10821082
10831083 keys = bt_keys_get_type (conn -> hdev , BT_KEYS_LTK_P256 , conn -> id , & addr );
@@ -1266,9 +1266,9 @@ static bool smp_br_pairing_allowed(struct bt_smp_br *smp)
12661266
12671267 addr .type = BT_ADDR_LE_PUBLIC ;
12681268 bt_addr_copy (& addr .a , & conn -> br .dst );
1269- le_keys = bt_keys_find_addr (BT_ID_DEFAULT , & addr );
1269+ le_keys = bt_keys_find_addr (conn -> hdev , BT_ID_DEFAULT , & addr );
12701270
1271- key = bt_keys_find_link_key (& conn -> br .dst );
1271+ key = bt_keys_find_link_key (conn -> hdev , & conn -> br .dst );
12721272 if (!key ) {
12731273 return false;
12741274 }
@@ -1524,7 +1524,7 @@ static void convert_to_id_on_irk_match(struct bt_conn *conn, void *data)
15241524
15251525 if (bt_rpa_irk_matches (keys -> irk .val , & conn -> le .dst .a )) {
15261526 if (conn -> le .keys != NULL && conn -> le .keys != keys ) {
1527- bt_keys_clear (conn -> le .keys );
1527+ bt_keys_clear (conn -> hdev , conn -> le .keys );
15281528 }
15291529
15301530 conn -> le .keys = keys ;
@@ -1564,7 +1564,7 @@ static uint8_t smp_br_ident_addr_info(struct bt_smp_br *smp,
15641564 }
15651565
15661566 /* Check the BLE connections that has RPA matched with this IRK */
1567- keys = bt_keys_get_type (BT_KEYS_IRK , conn -> id , & addr );
1567+ keys = bt_keys_get_type (conn -> hdev , BT_KEYS_IRK , conn -> id , & addr );
15681568 if (keys ) {
15691569 bt_conn_foreach (BT_CONN_TYPE_LE , convert_to_id_on_irk_match , keys );
15701570 } else {
0 commit comments