mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-08-04 16:25:34 +00:00

What ipa_table_valid() (and ipa_table_valid_one(), which it calls) does is ensure that the memory regions that hold routing and filter tables have reasonable size. Specifically, it checks that the size of a region is sufficient (or rather, exactly the right size) to hold the maximum number of entries supported by the driver. (There is an additional check that's erroneous, but in practice it is never reached.) Recently ipa_table_mem_valid() was added, which is called by ipa_table_init(). That function verifies that all table memory regions are of sufficient size, and requires hashed tables to have zero size if hashing is not supported. It only ensures the filter table is large enough to hold the number of endpoints that support filtering, but that is adequate. Therefore everything that ipa_table_valid() does is redundant, so get rid of it. Signed-off-by: Alex Elder <elder@linaro.org> Signed-off-by: Paolo Abeni <pabeni@redhat.com>
81 lines
2 KiB
C
81 lines
2 KiB
C
/* SPDX-License-Identifier: GPL-2.0 */
|
|
|
|
/* Copyright (c) 2012-2018, The Linux Foundation. All rights reserved.
|
|
* Copyright (C) 2019-2022 Linaro Ltd.
|
|
*/
|
|
#ifndef _IPA_TABLE_H_
|
|
#define _IPA_TABLE_H_
|
|
|
|
#include <linux/types.h>
|
|
|
|
struct ipa;
|
|
|
|
/* The maximum number of filter table entries (IPv4, IPv6; hashed or not) */
|
|
#define IPA_FILTER_COUNT_MAX 14
|
|
|
|
/* The number of route table entries allotted to the modem */
|
|
#define IPA_ROUTE_MODEM_COUNT 8
|
|
|
|
/* The maximum number of route table entries (IPv4, IPv6; hashed or not) */
|
|
#define IPA_ROUTE_COUNT_MAX 15
|
|
|
|
/**
|
|
* ipa_filter_map_valid() - Validate a filter table endpoint bitmap
|
|
* @ipa: IPA pointer
|
|
* @filter_mask: Filter table endpoint bitmap to check
|
|
*
|
|
* Return: true if all regions are valid, false otherwise
|
|
*/
|
|
bool ipa_filter_map_valid(struct ipa *ipa, u32 filter_mask);
|
|
|
|
/**
|
|
* ipa_table_hash_support() - Return true if hashed tables are supported
|
|
* @ipa: IPA pointer
|
|
*/
|
|
static inline bool ipa_table_hash_support(struct ipa *ipa)
|
|
{
|
|
return ipa->version != IPA_VERSION_4_2;
|
|
}
|
|
|
|
/**
|
|
* ipa_table_reset() - Reset filter and route tables entries to "none"
|
|
* @ipa: IPA pointer
|
|
* @modem: Whether to reset modem or AP entries
|
|
*/
|
|
void ipa_table_reset(struct ipa *ipa, bool modem);
|
|
|
|
/**
|
|
* ipa_table_hash_flush() - Synchronize hashed filter and route updates
|
|
* @ipa: IPA pointer
|
|
*/
|
|
int ipa_table_hash_flush(struct ipa *ipa);
|
|
|
|
/**
|
|
* ipa_table_setup() - Set up filter and route tables
|
|
* @ipa: IPA pointer
|
|
*
|
|
* There is no need for a matching ipa_table_teardown() function.
|
|
*/
|
|
int ipa_table_setup(struct ipa *ipa);
|
|
|
|
/**
|
|
* ipa_table_config() - Configure filter and route tables
|
|
* @ipa: IPA pointer
|
|
*
|
|
* There is no need for a matching ipa_table_deconfig() function.
|
|
*/
|
|
void ipa_table_config(struct ipa *ipa);
|
|
|
|
/**
|
|
* ipa_table_init() - Do early initialization of filter and route tables
|
|
* @ipa: IPA pointer
|
|
*/
|
|
int ipa_table_init(struct ipa *ipa);
|
|
|
|
/**
|
|
* ipa_table_exit() - Inverse of ipa_table_init()
|
|
* @ipa: IPA pointer
|
|
*/
|
|
void ipa_table_exit(struct ipa *ipa);
|
|
|
|
#endif /* _IPA_TABLE_H_ */
|