* [PATCH v1 0/5] oFono uBlox SARA R4 QMI support
@ 2021-02-23 4:46 Bing Jupiter
2021-02-23 4:46 ` [PATCH v1 1/5] Change 1: " Bing Jupiter
` (4 more replies)
0 siblings, 5 replies; 7+ messages in thread
From: Bing Jupiter @ 2021-02-23 4:46 UTC (permalink / raw)
To: ofono
[-- Attachment #1: Type: text/plain, Size: 648 bytes --]
Hi Denis,
Fixed taps,hope it satisfies your requirements.
Thank you.
Jupiter (1):
Use tabs as Denis required
Jupiter (4):
Change 1: SARA R4 QMI support
Change 2: Add SARA R4 vendor ID
Change 3: Check SARA R4 vendor ID, need to make it conditional on the
actions being attach and detach
Change 4: Add SARA R4 vendor and enable vendor in gprs create
drivers/atmodem/vendor.h | 1 +
drivers/qmimodem/gprs.c | 15 +++++++++++++++
plugins/gobi.c | 11 ++++++++++-
plugins/udevng.c | 41 ++++++++++++++++++++++++++++++++++++++++
4 files changed, 67 insertions(+), 1 deletion(-)
--
2.25.1
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH v1 1/5] Change 1: SARA R4 QMI support
2021-02-23 4:46 [PATCH v1 0/5] oFono uBlox SARA R4 QMI support Bing Jupiter
@ 2021-02-23 4:46 ` Bing Jupiter
2021-02-23 4:46 ` [PATCH v1 2/5] Change 2: Add SARA R4 vendor ID Bing Jupiter
` (3 subsequent siblings)
4 siblings, 0 replies; 7+ messages in thread
From: Bing Jupiter @ 2021-02-23 4:46 UTC (permalink / raw)
To: ofono
[-- Attachment #1: Type: text/plain, Size: 2255 bytes --]
From: jupiter <jupiter.hce@gmail.com>
---
plugins/udevng.c | 41 +++++++++++++++++++++++++++++++++++++++++
1 file changed, 41 insertions(+)
diff --git a/plugins/udevng.c b/plugins/udevng.c
index 34ac1cc0..63d95055 100644
--- a/plugins/udevng.c
+++ b/plugins/udevng.c
@@ -1194,6 +1194,45 @@ static gboolean setup_ublox(struct modem_info *modem)
return TRUE;
}
+static gboolean setup_ubloxqmi(struct modem_info *modem) {
+ const char *qmi = NULL, *net = NULL, *gps = NULL, *aux = NULL;
+ GSList *list;
+
+ DBG("%s", modem->syspath);
+
+ for (list = modem->devices; list; list = g_slist_next(list)) {
+ struct device_info *info = list->data;
+
+ DBG("%s %s %s %s %s", info->devnode, info->interface,
+ info->number, info->label, info->subsystem);
+
+ if (g_strcmp0(info->interface, "255/255/255") == 0 &&
+ g_strcmp0(info->number, "03") == 0) {
+ if (g_strcmp0(info->subsystem, "net") == 0)
+ net = info->devnode;
+ else if (g_strcmp0(info->subsystem, "usbmisc") == 0)
+ qmi = info->devnode;
+ }
+ }
+
+ DBG("qmi=%s net=%s", qmi, net);
+
+ if (qmi == NULL || net == NULL)
+ return FALSE;
+
+ DBG("qmi=%s net=%s", qmi, net);
+
+ ofono_modem_set_string(modem->modem, "Device", qmi);
+ ofono_modem_set_string(modem->modem, "NetworkInterface", net);
+ ofono_modem_set_string(modem->modem, "Quirk", "SARAR4");
+
+ DBG("gps=%s aux=%s", gps, aux);
+
+ ofono_modem_set_driver(modem->modem, "gobi");
+
+ return TRUE;
+}
+
static gboolean setup_gemalto(struct modem_info* modem)
{
const char *app = NULL, *gps = NULL, *mdm = NULL,
@@ -1441,6 +1480,7 @@ static struct {
{ "quectel", setup_quectel },
{ "quectelqmi", setup_quectelqmi},
{ "ublox", setup_ublox },
+ { "ubloxqmi", setup_ubloxqmi },
{ "gemalto", setup_gemalto },
{ "xmm7xxx", setup_xmm7xxx },
{ "mbim", setup_mbim },
@@ -1850,6 +1890,7 @@ static struct {
{ "ublox", "cdc_ncm", "1546", "110a" },
{ "ublox", "rndis_host", "1546", "1146" },
{ "ublox", "cdc_acm", "1546", "1146" },
+ { "ubloxqmi", "qmi_wwan", "05c6", "90b2" },
{ "gemalto", "option", "1e2d", "0053" },
{ "gemalto", "cdc_wdm", "1e2d", "0053" },
{ "gemalto", "qmi_wwan", "1e2d", "0053" },
--
2.25.1
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH v1 2/5] Change 2: Add SARA R4 vendor ID
2021-02-23 4:46 [PATCH v1 0/5] oFono uBlox SARA R4 QMI support Bing Jupiter
2021-02-23 4:46 ` [PATCH v1 1/5] Change 1: " Bing Jupiter
@ 2021-02-23 4:46 ` Bing Jupiter
2021-02-23 4:46 ` [PATCH v1 3/5] Change 3: Check SARA R4 vendor ID, need to make it conditional on the actions being attach and detach Bing Jupiter
` (2 subsequent siblings)
4 siblings, 0 replies; 7+ messages in thread
From: Bing Jupiter @ 2021-02-23 4:46 UTC (permalink / raw)
To: ofono
[-- Attachment #1: Type: text/plain, Size: 499 bytes --]
From: jupiter <jupiter.hce@gmail.com>
---
drivers/atmodem/vendor.h | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/atmodem/vendor.h b/drivers/atmodem/vendor.h
index 82284e44..38613679 100644
--- a/drivers/atmodem/vendor.h
+++ b/drivers/atmodem/vendor.h
@@ -48,6 +48,7 @@ enum ofono_vendor {
OFONO_VENDOR_QUECTEL_EC2X,
OFONO_VENDOR_QUECTEL_SERIAL,
OFONO_VENDOR_UBLOX,
+ OFONO_VENDOR_UBLOX_SARA_R4,
OFONO_VENDOR_XMM,
OFONO_VENDOR_GEMALTO,
};
--
2.25.1
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH v1 3/5] Change 3: Check SARA R4 vendor ID, need to make it conditional on the actions being attach and detach
2021-02-23 4:46 [PATCH v1 0/5] oFono uBlox SARA R4 QMI support Bing Jupiter
2021-02-23 4:46 ` [PATCH v1 1/5] Change 1: " Bing Jupiter
2021-02-23 4:46 ` [PATCH v1 2/5] Change 2: Add SARA R4 vendor ID Bing Jupiter
@ 2021-02-23 4:46 ` Bing Jupiter
2021-02-23 4:46 ` [PATCH v1 4/5] Change 4: Add SARA R4 vendor and enable vendor in gprs create Bing Jupiter
2021-02-23 4:46 ` [PATCH v1 5/5] Use tabs as Denis required Bing Jupiter
4 siblings, 0 replies; 7+ messages in thread
From: Bing Jupiter @ 2021-02-23 4:46 UTC (permalink / raw)
To: ofono
[-- Attachment #1: Type: text/plain, Size: 1496 bytes --]
From: jupiter <jupiter.hce@gmail.com>
---
drivers/qmimodem/gprs.c | 15 +++++++++++++++
1 file changed, 15 insertions(+)
diff --git a/drivers/qmimodem/gprs.c b/drivers/qmimodem/gprs.c
index 896a9e4c..64d90257 100644
--- a/drivers/qmimodem/gprs.c
+++ b/drivers/qmimodem/gprs.c
@@ -26,6 +26,7 @@
#include <ofono/log.h>
#include <ofono/modem.h>
#include <ofono/gprs.h>
+#include <drivers/atmodem/vendor.h>
#include "qmi.h"
#include "nas.h"
@@ -35,6 +36,7 @@
#include "qmimodem.h"
struct gprs_data {
+ unsigned int vendor;
struct qmi_device *dev;
struct qmi_service *nas;
struct qmi_service *wds;
@@ -284,6 +286,18 @@ static void qmi_set_attached(struct ofono_gprs *gprs, int attached,
DBG("attached %d", attached);
+ if (data->vendor == OFONO_VENDOR_UBLOX_SARA_R4) {
+ /* This assumes neither 'attach' nor 'detach' are
+ * necessary... if 'attach' is required, then you'll
+ * need to make this section conditional on the action
+ * being 'detach'
+ */
+ DBG("Debug vendor = OFONO_VENDOR_UBLOX_SARA_R4");
+ CALLBACK_WITH_SUCCESS(cb, cbd->data);
+ g_free(cbd);
+ return;
+ }
+
if (attached)
action = QMI_NAS_ATTACH_ACTION_ATTACH;
else
@@ -406,6 +420,7 @@ static int qmi_gprs_probe(struct ofono_gprs *gprs,
DBG("");
data = g_new0(struct gprs_data, 1);
+ data->vendor = vendor;
ofono_gprs_set_data(gprs, data);
--
2.25.1
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH v1 4/5] Change 4: Add SARA R4 vendor and enable vendor in gprs create
2021-02-23 4:46 [PATCH v1 0/5] oFono uBlox SARA R4 QMI support Bing Jupiter
` (2 preceding siblings ...)
2021-02-23 4:46 ` [PATCH v1 3/5] Change 3: Check SARA R4 vendor ID, need to make it conditional on the actions being attach and detach Bing Jupiter
@ 2021-02-23 4:46 ` Bing Jupiter
2021-02-23 4:46 ` [PATCH v1 5/5] Use tabs as Denis required Bing Jupiter
4 siblings, 0 replies; 7+ messages in thread
From: Bing Jupiter @ 2021-02-23 4:46 UTC (permalink / raw)
To: ofono
[-- Attachment #1: Type: text/plain, Size: 1525 bytes --]
From: jupiter <jupiter.hce@gmail.com>
---
plugins/gobi.c | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)
diff --git a/plugins/gobi.c b/plugins/gobi.c
index 9b5d7cff..5472dd83 100644
--- a/plugins/gobi.c
+++ b/plugins/gobi.c
@@ -47,6 +47,7 @@
#include <ofono/location-reporting.h>
#include <ofono/log.h>
#include <ofono/message-waiting.h>
+#include <drivers/atmodem/vendor.h>
#include <drivers/qmimodem/qmi.h>
#include <drivers/qmimodem/dms.h>
@@ -496,9 +497,17 @@ static void gobi_post_online(struct ofono_modem *modem)
struct gobi_data *data = ofono_modem_get_data(modem);
struct ofono_gprs *gprs;
struct ofono_gprs_context *gc;
+ const char* quirk;
+ unsigned int vendor = 0;
DBG("%p", modem);
+ quirk = ofono_modem_get_string(modem, "Quirk");
+ if (quirk) {
+ DBG("Debug: vendor = OFONO_VENDOR_UBLOX_SARA_R4");
+ vendor = OFONO_VENDOR_UBLOX_SARA_R4;
+ }
+
if (data->features & GOBI_NAS) {
ofono_netreg_create(modem, 0, "qmimodem", data->device);
ofono_netmon_create(modem, 0, "qmimodem", data->device);
@@ -508,7 +517,7 @@ static void gobi_post_online(struct ofono_modem *modem)
ofono_ussd_create(modem, 0, "qmimodem", data->device);
if (data->features & GOBI_WDS) {
- gprs = ofono_gprs_create(modem, 0, "qmimodem", data->device);
+ gprs = ofono_gprs_create(modem, vendor, "qmimodem", data->device);
gc = ofono_gprs_context_create(modem, 0, "qmimodem",
data->device);
--
2.25.1
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH v1 5/5] Use tabs as Denis required
2021-02-23 4:46 [PATCH v1 0/5] oFono uBlox SARA R4 QMI support Bing Jupiter
` (3 preceding siblings ...)
2021-02-23 4:46 ` [PATCH v1 4/5] Change 4: Add SARA R4 vendor and enable vendor in gprs create Bing Jupiter
@ 2021-02-23 4:46 ` Bing Jupiter
2021-02-23 20:08 ` Denis Kenzior
4 siblings, 1 reply; 7+ messages in thread
From: Bing Jupiter @ 2021-02-23 4:46 UTC (permalink / raw)
To: ofono
[-- Attachment #1: Type: text/plain, Size: 4425 bytes --]
From: Jupiter <jupiter.hce@gmail.com>
---
drivers/atmodem/vendor.h | 2 +-
drivers/qmimodem/gprs.c | 26 +++++++++++++-------------
plugins/gobi.c | 14 +++++++-------
plugins/udevng.c | 6 +++---
4 files changed, 24 insertions(+), 24 deletions(-)
diff --git a/drivers/atmodem/vendor.h b/drivers/atmodem/vendor.h
index 38613679..db9fa263 100644
--- a/drivers/atmodem/vendor.h
+++ b/drivers/atmodem/vendor.h
@@ -48,7 +48,7 @@ enum ofono_vendor {
OFONO_VENDOR_QUECTEL_EC2X,
OFONO_VENDOR_QUECTEL_SERIAL,
OFONO_VENDOR_UBLOX,
- OFONO_VENDOR_UBLOX_SARA_R4,
+ OFONO_VENDOR_UBLOX_SARA_R4,
OFONO_VENDOR_XMM,
OFONO_VENDOR_GEMALTO,
};
diff --git a/drivers/qmimodem/gprs.c b/drivers/qmimodem/gprs.c
index 64d90257..90203dd3 100644
--- a/drivers/qmimodem/gprs.c
+++ b/drivers/qmimodem/gprs.c
@@ -36,7 +36,7 @@
#include "qmimodem.h"
struct gprs_data {
- unsigned int vendor;
+ unsigned int vendor;
struct qmi_device *dev;
struct qmi_service *nas;
struct qmi_service *wds;
@@ -286,17 +286,17 @@ static void qmi_set_attached(struct ofono_gprs *gprs, int attached,
DBG("attached %d", attached);
- if (data->vendor == OFONO_VENDOR_UBLOX_SARA_R4) {
- /* This assumes neither 'attach' nor 'detach' are
- * necessary... if 'attach' is required, then you'll
- * need to make this section conditional on the action
- * being 'detach'
- */
- DBG("Debug vendor = OFONO_VENDOR_UBLOX_SARA_R4");
- CALLBACK_WITH_SUCCESS(cb, cbd->data);
- g_free(cbd);
- return;
- }
+ if (data->vendor == OFONO_VENDOR_UBLOX_SARA_R4) {
+ /* This assumes neither 'attach' nor 'detach' are
+ * necessary... if 'attach' is required, then you'll
+ * need to make this section conditional on the action
+ * being 'detach'
+ */
+ DBG("Debug vendor = OFONO_VENDOR_UBLOX_SARA_R4");
+ CALLBACK_WITH_SUCCESS(cb, cbd->data);
+ g_free(cbd);
+ return;
+ }
if (attached)
action = QMI_NAS_ATTACH_ACTION_ATTACH;
@@ -420,7 +420,7 @@ static int qmi_gprs_probe(struct ofono_gprs *gprs,
DBG("");
data = g_new0(struct gprs_data, 1);
- data->vendor = vendor;
+ data->vendor = vendor;
ofono_gprs_set_data(gprs, data);
diff --git a/plugins/gobi.c b/plugins/gobi.c
index 5472dd83..3ca739d6 100644
--- a/plugins/gobi.c
+++ b/plugins/gobi.c
@@ -497,16 +497,16 @@ static void gobi_post_online(struct ofono_modem *modem)
struct gobi_data *data = ofono_modem_get_data(modem);
struct ofono_gprs *gprs;
struct ofono_gprs_context *gc;
- const char* quirk;
- unsigned int vendor = 0;
+ const char* quirk;
+ unsigned int vendor = 0;
DBG("%p", modem);
- quirk = ofono_modem_get_string(modem, "Quirk");
- if (quirk) {
- DBG("Debug: vendor = OFONO_VENDOR_UBLOX_SARA_R4");
- vendor = OFONO_VENDOR_UBLOX_SARA_R4;
- }
+ quirk = ofono_modem_get_string(modem, "Quirk");
+ if (quirk) {
+ DBG("Debug: vendor = OFONO_VENDOR_UBLOX_SARA_R4");
+ vendor = OFONO_VENDOR_UBLOX_SARA_R4;
+ }
if (data->features & GOBI_NAS) {
ofono_netreg_create(modem, 0, "qmimodem", data->device);
diff --git a/plugins/udevng.c b/plugins/udevng.c
index 63d95055..9941145f 100644
--- a/plugins/udevng.c
+++ b/plugins/udevng.c
@@ -1224,7 +1224,7 @@ static gboolean setup_ubloxqmi(struct modem_info *modem) {
ofono_modem_set_string(modem->modem, "Device", qmi);
ofono_modem_set_string(modem->modem, "NetworkInterface", net);
- ofono_modem_set_string(modem->modem, "Quirk", "SARAR4");
+ ofono_modem_set_string(modem->modem, "Quirk", "SARAR4");
DBG("gps=%s aux=%s", gps, aux);
@@ -1480,7 +1480,7 @@ static struct {
{ "quectel", setup_quectel },
{ "quectelqmi", setup_quectelqmi},
{ "ublox", setup_ublox },
- { "ubloxqmi", setup_ubloxqmi },
+ { "ubloxqmi", setup_ubloxqmi },
{ "gemalto", setup_gemalto },
{ "xmm7xxx", setup_xmm7xxx },
{ "mbim", setup_mbim },
@@ -1890,7 +1890,7 @@ static struct {
{ "ublox", "cdc_ncm", "1546", "110a" },
{ "ublox", "rndis_host", "1546", "1146" },
{ "ublox", "cdc_acm", "1546", "1146" },
- { "ubloxqmi", "qmi_wwan", "05c6", "90b2" },
+ { "ubloxqmi", "qmi_wwan", "05c6", "90b2" },
{ "gemalto", "option", "1e2d", "0053" },
{ "gemalto", "cdc_wdm", "1e2d", "0053" },
{ "gemalto", "qmi_wwan", "1e2d", "0053" },
--
2.25.1
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH v1 5/5] Use tabs as Denis required
2021-02-23 4:46 ` [PATCH v1 5/5] Use tabs as Denis required Bing Jupiter
@ 2021-02-23 20:08 ` Denis Kenzior
0 siblings, 0 replies; 7+ messages in thread
From: Denis Kenzior @ 2021-02-23 20:08 UTC (permalink / raw)
To: ofono
[-- Attachment #1: Type: text/plain, Size: 779 bytes --]
Hi Jupiter,
On 2/22/21 10:46 PM, Bing Jupiter wrote:
> From: Jupiter <jupiter.hce@gmail.com>
Please make sure your authorship information is updated in the commit meta-data
as well for all the patches you're submitting.
>
> ---
> drivers/atmodem/vendor.h | 2 +-
> drivers/qmimodem/gprs.c | 26 +++++++++++++-------------
> plugins/gobi.c | 14 +++++++-------
> plugins/udevng.c | 6 +++---
> 4 files changed, 24 insertions(+), 24 deletions(-)
>
No, please don't do it this way. This patch should not exist. Instead take
the changes from this patch and amend the previous 4 patches. In other words,
the previous 4 patches should be following the coding style as documented in
doc/coding-style.txt.
Regards,
-Denis
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2021-02-23 20:08 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-23 4:46 [PATCH v1 0/5] oFono uBlox SARA R4 QMI support Bing Jupiter
2021-02-23 4:46 ` [PATCH v1 1/5] Change 1: " Bing Jupiter
2021-02-23 4:46 ` [PATCH v1 2/5] Change 2: Add SARA R4 vendor ID Bing Jupiter
2021-02-23 4:46 ` [PATCH v1 3/5] Change 3: Check SARA R4 vendor ID, need to make it conditional on the actions being attach and detach Bing Jupiter
2021-02-23 4:46 ` [PATCH v1 4/5] Change 4: Add SARA R4 vendor and enable vendor in gprs create Bing Jupiter
2021-02-23 4:46 ` [PATCH v1 5/5] Use tabs as Denis required Bing Jupiter
2021-02-23 20:08 ` Denis Kenzior
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).