util.h (963B)
1/* SPDX-License-Identifier: GPL-2.0+ */ 2/* Copyright (c) 2015 Quantenna Communications. All rights reserved. */ 3 4#ifndef QTNFMAC_UTIL_H 5#define QTNFMAC_UTIL_H 6 7#include <linux/kernel.h> 8#include "core.h" 9 10const char *qtnf_chipid_to_string(unsigned long chip_id); 11 12void qtnf_sta_list_init(struct qtnf_sta_list *list); 13 14struct qtnf_sta_node *qtnf_sta_list_lookup(struct qtnf_sta_list *list, 15 const u8 *mac); 16struct qtnf_sta_node *qtnf_sta_list_lookup_index(struct qtnf_sta_list *list, 17 size_t index); 18struct qtnf_sta_node *qtnf_sta_list_add(struct qtnf_vif *vif, 19 const u8 *mac); 20bool qtnf_sta_list_del(struct qtnf_vif *vif, const u8 *mac); 21 22void qtnf_sta_list_free(struct qtnf_sta_list *list); 23 24static inline size_t qtnf_sta_list_size(const struct qtnf_sta_list *list) 25{ 26 return atomic_read(&list->size); 27} 28 29static inline bool qtnf_sta_list_empty(const struct qtnf_sta_list *list) 30{ 31 return list_empty(&list->head); 32} 33 34#endif /* QTNFMAC_UTIL_H */