From 1c6efe8d91a429eb24683357145531093de240d4 Mon Sep 17 00:00:00 2001 From: John Crispin Date: Fri, 2 Jul 2021 12:17:30 +0200 Subject: [PATCH] renderer: add mbim support Signed-off-by: John Crispin --- renderer/templates/broadband.uc | 2 +- schema/interface.broad-band.wwan.yml | 2 ++ schemareader.uc | 4 ++-- ucentral.schema.json | 4 +++- 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/renderer/templates/broadband.uc b/renderer/templates/broadband.uc index e113331..c37e539 100644 --- a/renderer/templates/broadband.uc +++ b/renderer/templates/broadband.uc @@ -17,7 +17,7 @@ uplink.role = "upstream"; uplink.vlan = { id: 0 }; uplink.metric = 1; -if (broadband.protocol == "wwan" && broadband['modem-type'] == "qmi") { +if (broadband.protocol == "wwan" && index([ "qmi", "mbim", "wwan" ], broadband['modem-type']) >= 0) { let wwan = { }; wwan.protocol = 'wwan'; diff --git a/schema/interface.broad-band.wwan.yml b/schema/interface.broad-band.wwan.yml index 3deb94d..1931371 100644 --- a/schema/interface.broad-band.wwan.yml +++ b/schema/interface.broad-band.wwan.yml @@ -13,6 +13,8 @@ properties: type: string enum: - qmi + - mbim + - wwan access-point-name: description: Commonly known as APN. The name of a gateway between a mobile network diff --git a/schemareader.uc b/schemareader.uc index 23524f8..71b01f0 100644 --- a/schemareader.uc +++ b/schemareader.uc @@ -1302,8 +1302,8 @@ function instantiateInterfaceBroadBandWwan(location, value, errors) { if (type(value) != "string") push(errors, [ location, "must be of type string" ]); - if (!(value in [ "qmi" ])) - push(errors, [ location, "must be one of \"qmi\"" ]); + if (!(value in [ "qmi", "mbim", "wwan" ])) + push(errors, [ location, "must be one of \"qmi\", \"mbim\" or \"wwan\"" ]); return value; } diff --git a/ucentral.schema.json b/ucentral.schema.json index 591a949..854d363 100644 --- a/ucentral.schema.json +++ b/ucentral.schema.json @@ -562,7 +562,9 @@ "modem-type": { "type": "string", "enum": [ - "qmi" + "qmi", + "mbim", + "wwan" ] }, "access-point-name": {