| From 16aca0c3f55b555a9a236180391e3acc3ef389a5 Mon Sep 17 00:00:00 2001 |
| From: Eliot Lee <eliot.lee@intel.corp-partner.google.com> |
| Date: Tue, 28 Feb 2023 19:57:41 -0800 |
| Subject: [PATCH] CHROMIUM: net: wwan: t7xx: Compat for MR2 software |
| |
| Newly enabled info_get ops might not be supported by old modem firmwares. |
| To support older firmwares, the change loopbacks the request to bypass |
| the version checks. |
| This is a WA till google supports MR3 firmware officially. |
| |
| UPSTREAM-TASK=b:278932830 |
| BUG=b:258509032 |
| TEST=Manual connectivity/traffic tests on Brya |
| |
| Signed-off-by: Eliot Lee <eliot.lee@intel.corp-partner.google.com> |
| Signed-off-by: Dinesh Kumar Sharma <dinesh.sharma@intel.corp-partner.google.com> |
| |
| Change-Id: I2fc95f7236c8145abe20b535a2ff980974959751 |
| Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/kernel/+/4369885 |
| Commit-Queue: Daniel Winkler <danielwinkler@google.com> |
| Tested-by: Dinesh Sharma <dinesh.sharma@intel.corp-partner.google.com> |
| Reviewed-by: Madhav <madhavadas@google.com> |
| --- |
| drivers/net/wwan/t7xx/t7xx_port_devlink.c | 30 ++++++++++++++++++++++- |
| 1 file changed, 29 insertions(+), 1 deletion(-) |
| |
| diff --git a/drivers/net/wwan/t7xx/t7xx_port_devlink.c b/drivers/net/wwan/t7xx/t7xx_port_devlink.c |
| index 71256c6f68819e316a3cc65a3509c75e4f08e2a1..8de2ee65fe0cb94bf6dfb476e767ccf831882d92 100644 |
| --- a/drivers/net/wwan/t7xx/t7xx_port_devlink.c |
| +++ b/drivers/net/wwan/t7xx/t7xx_port_devlink.c |
| @@ -502,13 +502,41 @@ static int t7xx_devlink_info_get(struct devlink *devlink, struct devlink_info_re |
| return ret; |
| } |
| |
| +struct devlink_info_req { |
| + struct sk_buff *msg; |
| + void (*version_cb)(const char *version_name, |
| + enum devlink_info_version_type version_type, |
| + void *version_cb_priv); |
| + void *version_cb_priv; |
| +}; |
| + |
| +struct devlink_flash_component_lookup_ctx { |
| + const char *lookup_name; |
| + bool lookup_name_found; |
| +}; |
| + |
| +static int t7xx_devlink_info_get_loopback(struct devlink *devlink, struct devlink_info_req *req, |
| + struct netlink_ext_ack *extack) |
| +{ |
| + struct devlink_flash_component_lookup_ctx *lookup_ctx = req->version_cb_priv; |
| + int ret; |
| + |
| + if (!req) |
| + return t7xx_devlink_info_get(devlink, req, extack); |
| + |
| + ret = devlink_info_version_running_put_ext(req, lookup_ctx->lookup_name, |
| + "1.0", DEVLINK_INFO_VERSION_TYPE_COMPONENT); |
| + |
| + return ret; |
| +} |
| + |
| /* Call back function for devlink ops */ |
| static const struct devlink_ops devlink_flash_ops = { |
| .supported_flash_update_params = DEVLINK_SUPPORT_FLASH_UPDATE_OVERWRITE_MASK, |
| .flash_update = t7xx_devlink_flash_update, |
| .reload_actions = BIT(DEVLINK_RELOAD_ACTION_DRIVER_REINIT) | |
| BIT(DEVLINK_RELOAD_ACTION_FW_ACTIVATE), |
| - .info_get = t7xx_devlink_info_get, |
| + .info_get = t7xx_devlink_info_get_loopback, |
| .reload_down = t7xx_devlink_reload_down, |
| .reload_up = t7xx_devlink_reload_up, |
| }; |
| -- |
| 2.46.0.792.g87dc391469-goog |
| |