feat(cellular): add datapath validation and reject unimplemented BAM transport
Offline project checks / check (push) Canceled after 0s
Offline project checks / check (push) Canceled after 0s
This commit is contained in:
+61
@@ -0,0 +1,61 @@
|
||||
From: Platina Linux contributors
|
||||
Subject: [PATCH] net: ipa: reject the unimplemented v2 BAM data transport
|
||||
|
||||
The experimental v2.6 integration skips endpoint initialization and has no
|
||||
BAM TX/RX backend. Do not publish a successful probe or count discarded
|
||||
packets as successful transmissions. Reject legacy hardware before touching
|
||||
registers; in particular, its BAM region must not be treated as shared SRAM
|
||||
and its registers cannot use the v3.1 layout.
|
||||
|
||||
Keep this guard until a real v2.6L transport is implemented and qualified.
|
||||
This patch does not add cellular data support.
|
||||
|
||||
--- a/drivers/net/ipa/ipa_main.c
|
||||
+++ b/drivers/net/ipa/ipa_main.c
|
||||
@@ -840,10 +840,11 @@ static int ipa_probe(struct platform_device *pdev)
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
if (data->version < IPA_VERSION_3_0)
|
||||
- loader = IPA_LOADER_SKIP;
|
||||
- else
|
||||
- loader = ipa_firmware_loader(dev);
|
||||
+ return dev_err_probe(dev, -EOPNOTSUPP,
|
||||
+ "IPA v2.6L BAM data transport is not implemented\n");
|
||||
+
|
||||
+ loader = ipa_firmware_loader(dev);
|
||||
if (loader == IPA_LOADER_INVALID)
|
||||
return -EINVAL;
|
||||
if (loader == IPA_LOADER_DEFER)
|
||||
--- a/drivers/net/ipa/ipa_endpoint.c
|
||||
+++ b/drivers/net/ipa/ipa_endpoint.c
|
||||
@@ -1242,10 +1242,8 @@ int ipa_endpoint_skb_tx(struct ipa_endpoint *endpoint, struct sk_buff *skb)
|
||||
u32 nr_frags;
|
||||
int ret;
|
||||
|
||||
- if (endpoint->ipa->version < IPA_VERSION_3_0) {
|
||||
- dev_kfree_skb_any(skb);
|
||||
- return 0;
|
||||
- }
|
||||
+ if (endpoint->ipa->version < IPA_VERSION_3_0)
|
||||
+ return -EOPNOTSUPP;
|
||||
|
||||
/* Make sure source endpoint's TLV FIFO has enough entries to
|
||||
* hold the linear portion of the skb and all its fragments.
|
||||
--- a/drivers/net/ipa/ipa_modem.c
|
||||
+++ b/drivers/net/ipa/ipa_modem.c
|
||||
@@ -139,12 +139,8 @@ ipa_start_xmit(struct sk_buff *skb, struct net_device *netdev)
|
||||
goto err_drop_skb;
|
||||
|
||||
endpoint = ipa->name_map[IPA_ENDPOINT_AP_MODEM_TX];
|
||||
- if (!endpoint) {
|
||||
- dev_kfree_skb_any(skb);
|
||||
- stats->tx_packets++;
|
||||
- stats->tx_bytes += skb_len;
|
||||
- return NETDEV_TX_OK;
|
||||
- }
|
||||
+ if (!endpoint)
|
||||
+ goto err_drop_skb;
|
||||
if (endpoint->config.qmap && skb->protocol != htons(ETH_P_MAP))
|
||||
goto err_drop_skb;
|
||||
|
||||
@@ -3,7 +3,7 @@ maintainer="Alexey Minnekhanov <alexeymin@minlexx.ru>"
|
||||
_flavor="postmarketos-qcom-sdm660"
|
||||
pkgname=linux-$_flavor
|
||||
pkgver=7.2.12
|
||||
pkgrel=21
|
||||
pkgrel=22
|
||||
pkgdesc="Close to mainline linux kernel for Qualcomm Snapdragon 660 SoC"
|
||||
arch="aarch64"
|
||||
url="https://kernel.org/"
|
||||
@@ -80,6 +80,7 @@ source="
|
||||
stable-7.2.11-12.patch
|
||||
0042-arm64-dts-sdm660-add-ipa-v2-node.patch
|
||||
0043-net-ipa-add-support-for-ipa-v2.6-and-sdm660.patch
|
||||
0044-net-ipa-reject-unimplemented-bam-transport.patch
|
||||
"
|
||||
|
||||
_carch="arm64"
|
||||
@@ -179,4 +180,5 @@ d2449e4c02bf11835d20bd9c841a3b0db78ba14ebe2effaec04d98db63ea4dc41a552d23db8ae72e
|
||||
eb3b89ac99648776f193ee3c9d96d257f7d2e6ba5200a526e63c97e7dc4982e4b2985f15481aa4314dc54ca5f0bafb395b4f4fc375ed4fba2b8d9ca23124cd31 stable-7.2.11-12.patch
|
||||
d1e47d1003ec8e46febd4e980a527f48a5865f07d8e7abe27fedfbee145890b6d49ad6849950c7c611ccd75cd60722c532973cab4b650edb7602541d1df98e73 0042-arm64-dts-sdm660-add-ipa-v2-node.patch
|
||||
e2980a3b86521f452d042399812b8b5dd03af1193143313833e3608a8079763d4cc5c8d6c8530203db062c3df5ce40800e63567026239e6b19cdf6be07e3b199 0043-net-ipa-add-support-for-ipa-v2.6-and-sdm660.patch
|
||||
feac1f55375dd9560e2e0d0e15ce1c3a916c75bea7195ff7fe9e85f6175b2e97625c0a5e6a95d0906ffbc334cfbcb609032cb9d467131fae8c8158559a319585 0044-net-ipa-reject-unimplemented-bam-transport.patch
|
||||
"
|
||||
|
||||
Reference in New Issue
Block a user