qcacmn: Add qdf_slist

For memory savings it is sometimes desirable to use a single-linked list
instead of a double-linked list. However, the Linux kernel does not
provide a default implementation of a single-linked list.

Add a very simple single-linked list implementation to WLAN for general
use.

Change-Id: I2959f34649a0d8e0b312d9d67c81de17753b9b6c
CRs-Fixed: 2418493
This commit is contained in:
Dustin Brown
2019-02-15 12:58:25 -08:00
zatwierdzone przez nshrivas
rodzic f35d79a22b
commit b52a362e62
3 zmienionych plików z 362 dodań i 0 usunięć

37
qdf/test/qdf_slist_test.h Normal file
Wyświetl plik

@@ -0,0 +1,37 @@
/*
* Copyright (c) 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
* above copyright notice and this permission notice appear in all
* copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
* WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
* AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
* DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
* PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
* TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
* PERFORMANCE OF THIS SOFTWARE.
*/
#ifndef __QDF_SLIST_TEST_H
#define __QDF_SLIST_TEST_H
#ifdef WLAN_SLIST_TEST
/**
* qdf_slist_unit_test() - run the qdf slist unit test suite
*
* Return: number of failed test cases
*/
uint32_t qdf_slist_unit_test(void);
#else
static inline uint32_t qdf_slist_unit_test(void)
{
return 0;
}
#endif /* WLAN_SLIST_TEST */
#endif /* __QDF_SLIST_TEST_H */