Commit Graph

75 Commits

Author SHA1 Message Date
Dustin Brown
a487539d7d qcacmn: Pre-allocate flex-mem segments
Pre-allocate the reduction_limit number of segments during
flex-mem-pool initialization.

Change-Id: I91581e04b94597ee4314ce8691b37a45066c5273
CRs-Fixed: 2241805
2018-05-17 21:39:12 -07:00
Dustin Brown
03a7ac6e19 qcacmn: Add reduction limit to qdf_flex_mem
Add the ability to prevent qdf_flex_mem_pool from freeing memory
segments unless there are more than some minimum number in the pool
already.

Change-Id: I20bde2ed629b97924ea71b4f7f46a2c1fc1bab28
CRs-Fixed: 2229511
2018-05-11 13:23:00 -07:00
Dustin Brown
19911f3a06 qcacmn: Add qdf_flex_mem pool allocator
It often happens that the WLAN driver needs to allocate some pool of
structures to handle bursty operations. The traditional approach is to
statically allocate the maximum number of structures that we want to be
able to handle concurrently. This has the significant down side of
requiring manual tuning for every hardware combination for optimal
behavior, and wasting large amounts of memory during non-burst periods.

Add a new flexible, segmented memory allocator in QDF to help address
such scenarios. A small static buffer segment is used to service the
vast majority of operations, while additional segments are dynamically
allocated as needed to meet demand. Critically, these additional
segments are freed when not in use to reduce memory consumption. The
result is a self-tuning buffer that combines most of the benefits of
pure dynamic allocation with most of the benefits of pure static
allocation.

Change-Id: I5c27ecce72a450826494b5d13d6c9fdebda650a6
CRs-Fixed: 2224534
2018-04-19 14:15:19 -07:00
Amar Singhal
0894f015d8 qcacmn: Use the right index while accessing ipv6 array
Zero comp value if changed; would be 1 to 8. When accessing
ipv6 array, the access can go out of bounds if value is 8 since
the bytes array is of size 16 (0 to 15). Fix that.

Change-Id: I38eb1d3be2840bfbb5fdc9c72606ce51e29cb0ce
CRs-Fixed: 2196076
2018-03-21 17:27:51 -07:00
Rajeev Kumar
88de1dba44 qcacmn: Add common QDF API qdf_is_fw_down() to check fw status
Add common QDF API qdf_is_fw_down() to check if FW is down.

Change-Id: I8215665bec6975c8dd47ae3bb8423eeaaeba159c
CRs-Fixed: 2202731
2018-03-16 10:35:54 -07:00
Rajeev Kumar
e7abced1a1 qcacmn: Register fw down legacy callback with QDF
Register fw down legacy callback with QDF such that new UMAC
components can call QDF API to check if fw is down or not.

Change-Id: I8d68cb7625fd75aa90ba09adfe13955c5418b54f
CRs-Fixed: 2202605
2018-03-12 15:06:24 -07:00
Rajeev Kumar
83953b769c qcacmn: Change return type of fw down callback from void to bool
Change the signature of QDF FW down callback API to return bool
instead of void. Return type true indicates fw is down and return
type false indicates fw is not down.

Change-Id: I2be6f14e5fbdb7b24ccd604244e1314a8f127291
CRs-Fixed: 2196217
2018-03-06 20:10:14 -08:00
Dustin Brown
013ae979a6 qcacmn: Use size_t for qdf_str_len() return type
A recent commit changed the return type for qdf_str_len() to size_t from
int32_t. Update call sites for qdf_str_len() to store the return value
as size_t to match.

Change-Id: Ib8bfad2c1fc7de1f6fc601d1be69e734d3a49dcf
CRs-Fixed: 2196858
2018-02-28 13:22:36 -08:00
Dustin Brown
d1f73fa8ef qcacmn: Add const to qdf_*_parse function parameters
Add const to the 'char *' parameters of the qdf_*_parse family
of functions.

Change-Id: Ia106da9b9832bfe08a594a43926d68b4aa840f1f
CRs-Fixed: 2194529
2018-02-27 01:57:44 -08:00
Dustin Brown
b067d27d61 qcacmn: Add context parameter to qdf_ini_parse()
In order to avoid global state, add a context parameter to
qdf_ini_parse. This parameter will get passed back to consumers via
the existing callbacks.

Change-Id: Icd74a58815701b4603924838bb84c7956058da6b
CRs-Fixed: 2194517
2018-02-26 15:57:53 -08:00
Rajeev Kumar
8b221806ac qcacmn: Create new QDF file qdf_util.c
Create new QDF source file qdf_util.c to keep FW down
APIs inside it.

Change-Id: Ic2a91cf8924d08307b3307d5f214663247125582
CRs-Fixed: 2195157
2018-02-26 12:08:39 -08:00
Dustin Brown
96ad17d131 qcacmn: Fix parse failure in qdf_bool_parse()
qdf_bool_parse() fails to advance the parsing cursor after consuming
valid characters. Advance the cursor after valid input in
qdf_bool_parse() to avoid failing to parse valid boolean expressions.

Change-Id: I904d5eed638e215e9821e140feb5286fffe37b7b
CRs-Fixed: 2194546
2018-02-23 17:45:56 -08:00
Dustin Brown
e50d168ba5 qcacmn: Add qdf_str_dup() API
Add a QDF abstraction for strdup().

Change-Id: I141e625a91e3433c2a66bc75b4e860ed6ef266ac
CRs-Fixed: 2194537
2018-02-23 17:45:52 -08:00
Rajeev Kumar
28dba98f8b qcacmn: Define QDF API to register fw down callback
Define QDF API such that legacy module can register fw down
callback and new components can use QDF API to check if fw
is down or not.

Change-Id: I2f5423943f351ee3a0fd84616c904a27702c10e3
CRs-Fixed: 2194451
2018-02-23 00:37:05 -08:00
Dustin Brown
89a217419e qcacmn: Perform minor cleanup of qdf_*_parse APIs
Perform the following cleanup items for qdf_*_parse() APIs:
 1) Many qdf_*_parse APIs use a custom left-trim function called
    qdf_skip_whitespace(). Recently, qdf_str_left_trim was added,
    so use this function instead.
 2) Remove 'const' from 'const char *' parameters. 'const' protects
    modification of the pointer, which is already duplicated for the
    function call. Since the qdf_*_parse() APIs modify the pointer
    parameter anyway, using const is incorrect (and should have failed
    compilation).
 3) Ensure the public qdf_*_parse APIs are properly exported.

Change-Id: I89725c68cc0d61a66fe95ef02fa2deda110411ac
CRs-Fixed: 2185978
2018-02-13 17:24:13 -08:00
Dustin Brown
6461e566f4 qcacmn: Add int/bool parse functions to QDF
Add the following function implementations to QDF:
 * qdf_bool_parse()
 * qdf_int32_parse()
 * qdf_uint32_parse()
 * qdf_int64_parse()
 * qdf_uint64_parse()

Change-Id: Ic31e3eb70f684799bd6e1e524cfc1cb816ddc01a
CRs-Fixed: 2185282
2018-02-13 13:14:47 -08:00
Dustin Brown
677a261213 qcacmn: Add qdf_file and qdf_parse files to QDF
Add an QDF abstraction for reading a file. Also, add the first consumer,
qdf_ini_parse(), as well. This is pure parsing logic, which offloads the
actual content handling to the caller via callback functions.

Change-Id: Idfca74c5543a5b0da7ddd1bdc6e2ad2be59ed36b
CRs-Fixed: 2184463
2018-02-10 07:15:00 -08:00
Dustin Brown
a4fd883481 qcacmn: Add qdf_str files to QDF
Add files for QDF string APIs. Existing qdf_str_* APIs will be moved as
part of a future change.

Change-Id: If98d41380b2f7f62bbe5de141b6827e9427944ab
CRs-Fixed: 2184462
2018-02-10 07:14:57 -08:00
Dustin Brown
2e93d637cf qcacmn: Add MAC/IPV4/IPV6 address parsing to QDF
Add converged implementations of MAC, IPV4 and IPV6 address parsing to
QDF. This allows for reuse wherever address parsing is done. This also
supports the upcoming configuration component, which will support all
three address types.

Change-Id: I5158e2a40169da979a219363c6d2a25784c5a7e8
CRs-Fixed: 2174072
2018-01-20 01:45:05 -08:00
Dustin Brown
47d702f693 qcacmn: Add qdf memory domain support
In order to support memory leak detection during a specific period of
time, add APIs to allow setting the current memory domain. Each
allocation is tracked against the current memory domain at the time of
allocation. Consumers can then check to ensure the memory domain is
empty before each transition to a different domain.

Change-Id: I3a8d18ea0700122a2425eacb6051c6188b9aa5d6
CRs-Fixed: 2113614
2017-12-20 05:38:45 -08:00
Dustin Brown
9d30d63775 qcacmn: Add qdf debug domain support
In order to support resource leak detection during a specific period of
time, add APIs to allow setting the current debug domain. This allows
for each resource allocation to be tracked against the current debug
domain at the time of allocation. Consumers can then check to ensure
the resources allocated for the current domain are released before
transitioning to a different debug domain.

Change-Id: I1158abbc7e5bd9bd8dc0c47b303386c6229a1b3c
CRs-Fixed: 2144304
2017-11-22 19:21:33 -08:00
Dustin Brown
a145e09541 qcacmn: Free hotplug handler in qdf_cpuhp_unregister
A hotplug handler is allocated by calling qdf_cpuhp_register. However,
qdf_cpuhp_unregister does not free the previously allocated memory. Free
the hotplug handler in qdf_cpuhp_unregister.

Change-Id: I1663f5ea29a8630b42be33abd824135b0fbe4845
CRs-Fixed: 2141119
2017-11-10 02:55:36 -08:00
Dustin Brown
231f929686 qcacmn: Add QDF cpu hotplug APIs
Currently, there are two consumers of the Linux kernel CPU hotplug APIs.
Besides being problematic for not being operating system agnostic,
different versions of the Linux kernel export different CPU hotplug
APIs. In order to consolidate the various abstractions for different
operating systems and API versions, create a CPU hotplug abstraction in
QDF.

Change-Id: Ib17c6e3ed3a87a90a82d909a6c493360cab27855
CRs-Fixed: 2132632
2017-11-07 13:42:43 -08:00
Chouhan, Anurag
5776318d19 qcacmn: Add QDF OS abstraction convergence
Converge ADF and CDF API's and move them to
QDF folder. MCL/WIN driver use this QDF converged
module for OS abstraction.

Change-Id: I1d0cdfd8730a5c021aaa50b7dc8549d491d760b3
CRs-Fixed: 981187
2016-03-16 12:18:26 -07:00
Prakash Dhavali
142cee4bf2 Initial host-common file folder cleanup and moves
Initial host-common file folder cleanup and moves
on top of baseline reference of MCL WLAN driver
SU#5.0.0.160.

Move dp, ht comm, hif, wmi and qdf folders one level up

Change-Id: I2120898024b1eafd5d651c48768dbf48bf05995d
2016-03-03 01:02:02 -08:00