Hi Sergey,

On 8/15/20 4:43 PM, Sergey Matyukevich wrote:
Some gemalto modems provide USB ethernet interfaces for data path.
Implement gprs-context driver for such modems to send data via
USB ethernet rather than fallback to PPP.

Signed-off-by: Sergey Matyukevich <geoma...@gmail.com>
---
  Makefile.am                         |   3 +-
  drivers/gemaltomodem/gemaltomodem.c |   4 +-
  drivers/gemaltomodem/gemaltomodem.h |   3 +
  drivers/gemaltomodem/gprs-context.c | 280 ++++++++++++++++++++++++++++
  4 files changed, 288 insertions(+), 2 deletions(-)
  create mode 100644 drivers/gemaltomodem/gprs-context.c


This looks fine to me.  My only 2 nitpicks are:

1. We do not use S-o-B, so feel free to drop those in the future or I will just drop them when applying.

+
+static int gemalto_gprs_context_probe(struct ofono_gprs_context *gc,
+                                       unsigned int vendor, void *data)
+{
+       GAtChat *chat = data;
+       struct gprs_context_data *gcd;
+
+       DBG("");
+
+       gcd = g_try_new0(struct gprs_context_data, 1);
+       if (gcd == NULL)
+               return -ENOMEM;
+

2. We now prefer to use g_new0 for small structure allocations as these can't really fail on Linux userspace in practice. Keeps the code shorter as well.

+       gcd->chat = g_at_chat_clone(chat);
+

Regards,
-Denis
_______________________________________________
ofono mailing list -- ofono@ofono.org
To unsubscribe send an email to ofono-le...@ofono.org

Reply via email to