diff --git a/qdf/inc/qdf_hashtable.h b/qdf/inc/qdf_hashtable.h index 098ee3961c..7bb09b4fd8 100644 --- a/qdf/inc/qdf_hashtable.h +++ b/qdf/inc/qdf_hashtable.h @@ -96,6 +96,18 @@ #define qdf_ht_for_each(table, i, cursor, entry_field) \ __qdf_ht_for_each(table, i, cursor, entry_field) +/** + * qdf_ht_for_each_safe() - iterate all entries in @table safe against removal + * of hash entry. + * @table: a non-pointer qdf_ht instance to iterate + * @i: int type cursor populated with the bucket index + * @tmp: a &struct used for temporary storage + * @cursor: container struct pointer populated with each iteration + * @entry_field: name of the entry field in the entry container struct + */ +#define qdf_ht_for_each_safe(table, i, tmp, cursor, entry_field) \ + __qdf_ht_for_each_safe(table, i, tmp, cursor, entry_field) + /** * qdf_ht_for_each_in_bucket() - iterate entries in the bucket for @key * @table: a non-pointer qdf_ht instance to iterate diff --git a/qdf/linux/src/i_qdf_hashtable.h b/qdf/linux/src/i_qdf_hashtable.h index f1806cbf1d..f9ad3806e7 100644 --- a/qdf/linux/src/i_qdf_hashtable.h +++ b/qdf/linux/src/i_qdf_hashtable.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018 The Linux Foundation. All rights reserved. + * Copyright (c) 2018-2019 The Linux Foundation. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the @@ -47,4 +47,7 @@ do { \ break; \ } while (false) +#define __qdf_ht_for_each_safe(table, i, tmp, cursor, entry_field) \ + hash_for_each_safe(table, i, tmp, cursor, entry_field) + #endif /* __I_QDF_HASHTABLE_H */