summaryrefslogtreecommitdiff
path: root/drivers/net/ipa/gsi.h
diff options
context:
space:
mode:
authorAlex Elder <elder@linaro.org>2020-11-02 11:53:55 -0600
committerJakub Kicinski <kuba@kernel.org>2020-11-04 16:28:04 -0800
commit1d0c09dee911f49e88de0ba52d1f0e57f6eb4c47 (patch)
treebdc638f54758007354652882e956f2b27b063192 /drivers/net/ipa/gsi.h
parent3fb6928b56f67167406daefa13ca9d2b94d48eb0 (diff)
net: ipa: expose IPA version to the GSI layer
Although GSI is integral to IPA, it is a separate hardware component and the IPA code supporting it has been structured to avoid explicit dependence on IPA details. An example of this is that gsi_init() is passed a number of Boolean flags to indicate special behaviors, whose values are dependent on the IPA hardware version. Looking ahead, newer hardware versions would require even more such special behaviors. For any given version of IPA hardware (like 3.5.1 or 4.2), the GSI hardware version is fixed (in this case, 1.3 and 2.2, respectively). So the IPA version *implies* the GSI version, and the IPA version can be used as effectively the equivalent of the GSI hardware version. Rather than proliferating new special behavior flags, just provide the IPA version to the GSI layer when it is initialized. The GSI code can then use that directly to determine whether special behaviors are required. The IPA version enumerated type is already isolated to its own header file, so the exposure of this IPA detail is very limited. For now, just change gsi_init() to pass the version rather than the Boolean flags, and set the flag values internal to that function. Signed-off-by: Alex Elder <elder@linaro.org> Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'drivers/net/ipa/gsi.h')
-rw-r--r--drivers/net/ipa/gsi.h11
1 files changed, 8 insertions, 3 deletions
diff --git a/drivers/net/ipa/gsi.h b/drivers/net/ipa/gsi.h
index 3f9f29d531c4..2dd8ee78aa8c 100644
--- a/drivers/net/ipa/gsi.h
+++ b/drivers/net/ipa/gsi.h
@@ -20,6 +20,8 @@
/* Maximum TLV FIFO size for a channel; 64 here is arbitrary (and high) */
#define GSI_TLV_MAX 64
+enum ipa_version;
+
struct device;
struct scatterlist;
struct platform_device;
@@ -236,15 +238,18 @@ int gsi_channel_resume(struct gsi *gsi, u32 channel_id, bool start);
* gsi_init() - Initialize the GSI subsystem
* @gsi: Address of GSI structure embedded in an IPA structure
* @pdev: IPA platform device
+ * @version: IPA hardware version (implies GSI version)
+ * @count: Number of entries in the configuration data array
+ * @data: Endpoint and channel configuration data
*
* Return: 0 if successful, or a negative error code
*
* Early stage initialization of the GSI subsystem, performing tasks
* that can be done before the GSI hardware is ready to use.
*/
-int gsi_init(struct gsi *gsi, struct platform_device *pdev, bool prefetch,
- u32 count, const struct ipa_gsi_endpoint_data *data,
- bool modem_alloc);
+int gsi_init(struct gsi *gsi, struct platform_device *pdev,
+ enum ipa_version version, u32 count,
+ const struct ipa_gsi_endpoint_data *data);
/**
* gsi_exit() - Exit the GSI subsystem