Merge ~alfonsosanchezbeato/snappy-hwe-snaps/+git/modem-manager:hl7588-dell-workaround-v2 into ~snappy-hwe-team/snappy-hwe-snaps/+git/modem-manager:modem-manager/xenial/1.6.2

Proposed by Alfonso Sanchez-Beato
Status: Merged
Approved by: Roberto Mier Escandon
Approved revision: d5a5d0362c828d018484dff652655b4d7a10c87e
Merged at revision: 3cb43334de966bedb0a5b13c8e5da448ac5a6ac7
Proposed branch: ~alfonsosanchezbeato/snappy-hwe-snaps/+git/modem-manager:hl7588-dell-workaround-v2
Merge into: ~snappy-hwe-team/snappy-hwe-snaps/+git/modem-manager:modem-manager/xenial/1.6.2
Diff against target: 113 lines (+51/-11)
2 files modified
src/mm-bearer-mbim.c (+33/-7)
src/mm-broadband-modem-mbim.c (+18/-4)
Reviewer Review Type Date Requested Status
System Enablement Bot continuous-integration Approve
Roberto Mier Escandon (community) Approve
Simon Fels Approve
Review via email: mp+333121@code.launchpad.net

Description of the change

Run HL7588 workarounds for Dell VID/PID

The workarounds for Sierra HL7588 were executed only for Sierra VID/PID.
Make sure to apply them also for rebranded Dell modem with VID=0x1519
and PID=0x0443. An additional twist is needed, as Dell reused same
VID/PID for a Telit modem, so we additionally check the output of
AT+CGMM.

To post a comment you must log in.
Revision history for this message
Simon Fels (morphis) wrote :

LGTM

review: Approve
Revision history for this message
Roberto Mier Escandon (rmescandon) :
review: Approve
Revision history for this message
System Enablement Bot (system-enablement-ci-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
System Enablement Bot (system-enablement-ci-bot) wrote :
review: Approve (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/src/mm-bearer-mbim.c b/src/mm-bearer-mbim.c
2index af5dd20..4298349 100644
3--- a/src/mm-bearer-mbim.c
4+++ b/src/mm-bearer-mbim.c
5@@ -35,6 +35,8 @@
6
7 #define VID_SIERRA_HL7588 0x413C
8 #define PID_SIERRA_HL7588 0x81C8
9+#define VID_SIERRA_HL7588_DELL 0x1519
10+#define PID_SIERRA_HL7588_DELL 0x0443
11
12 G_DEFINE_TYPE (MMBearerMbim, mm_bearer_mbim, MM_TYPE_BASE_BEARER)
13
14@@ -777,6 +779,31 @@ workaround_done (MMBaseModem *modem,
15 connect_context_step (ctx);
16 }
17
18+static void
19+check_model_id_done (MMBaseModem *modem,
20+ GAsyncResult *res,
21+ ConnectContext *ctx)
22+{
23+ const gchar *response;
24+ GError *error = NULL;
25+
26+ response = mm_base_modem_at_command_finish (modem, res, &error);
27+ if (!error && g_strcmp0 ("HL7588", response) == 0) {
28+ mm_dbg ("Sending workaround AT command for Sierra HL7588...");
29+ mm_base_modem_at_command (modem,
30+ "AT+CGACT=1,3",
31+ 10,
32+ FALSE,
33+ (GAsyncReadyCallback)workaround_done,
34+ ctx);
35+ return;
36+ }
37+
38+ /* Keep on */
39+ ctx->step++;
40+ connect_context_step (ctx);
41+}
42+
43 static unsigned
44 get_uint_property (GObject *obj, const gchar *property_name)
45 {
46@@ -821,14 +848,13 @@ connect_context_step (ConnectContext *ctx)
47
48 mm_dbg ("Checking if Sierra HL7588: %x:%x", vid, pid);
49
50- if (vid == VID_SIERRA_HL7588 && pid == PID_SIERRA_HL7588) {
51-
52- mm_dbg ("Sending workaround AT command for Sierra HL7588...");
53+ if ((vid == VID_SIERRA_HL7588 && pid == PID_SIERRA_HL7588) ||
54+ (vid == VID_SIERRA_HL7588_DELL && pid == PID_SIERRA_HL7588_DELL)) {
55 mm_base_modem_at_command (modem,
56- "AT+CGACT=1,3",
57- 10,
58- FALSE,
59- (GAsyncReadyCallback)workaround_done,
60+ "AT+CGMM",
61+ 3,
62+ TRUE,
63+ (GAsyncReadyCallback)check_model_id_done,
64 ctx);
65 g_object_unref (modem);
66 return;
67diff --git a/src/mm-broadband-modem-mbim.c b/src/mm-broadband-modem-mbim.c
68index 49d0643..d6975a9 100644
69--- a/src/mm-broadband-modem-mbim.c
70+++ b/src/mm-broadband-modem-mbim.c
71@@ -2271,6 +2271,8 @@ device_notification_cb (MbimDevice *device,
72
73 #define VID_SIERRA_HL7588 0x413C
74 #define PID_SIERRA_HL7588 0x81C8
75+#define VID_SIERRA_HL7588_DELL 0x1519
76+#define PID_SIERRA_HL7588_DELL 0x0443
77
78 static unsigned
79 get_uint_property (GObject *obj, const gchar *property_name)
80@@ -2282,6 +2284,21 @@ get_uint_property (GObject *obj, const gchar *property_name)
81 return g_value_get_uint (&value);
82 }
83
84+static gboolean
85+check_is_hl7588 (MMBroadbandModemMbim *self)
86+{
87+ unsigned vid, pid;
88+
89+ vid = get_uint_property (G_OBJECT (self), MM_BASE_MODEM_VENDOR_ID);
90+ pid = get_uint_property (G_OBJECT (self), MM_BASE_MODEM_PRODUCT_ID);
91+
92+ if ((VID_SIERRA_HL7588 == vid && PID_SIERRA_HL7588 == pid) ||
93+ (VID_SIERRA_HL7588_DELL == vid && PID_SIERRA_HL7588_DELL == pid))
94+ return TRUE;
95+
96+ return FALSE;
97+}
98+
99 static void
100 function_error_cb (MbimDevice *device,
101 GError *function_error,
102@@ -2296,10 +2313,7 @@ function_error_cb (MbimDevice *device,
103 */
104 if (g_error_matches (function_error,
105 MBIM_PROTOCOL_ERROR, MBIM_PROTOCOL_ERROR_NOT_OPENED)
106- && VID_SIERRA_HL7588 == get_uint_property (G_OBJECT (self),
107- MM_BASE_MODEM_VENDOR_ID)
108- && PID_SIERRA_HL7588 == get_uint_property (G_OBJECT (self),
109- MM_BASE_MODEM_PRODUCT_ID)) {
110+ && check_is_hl7588 (self)) {
111 int fd;
112 ssize_t written;
113 const char reset_cmd[] = "AT+CFUN=16\r";

Subscribers

People subscribed via source and target branches