[PATCH v2] Add custom flow control settings for Telit HE910, UE910, UL865

Ben Chan benchan at chromium.org
Thu Mar 12 13:32:21 PDT 2015


Aleksander,

Not sure about UE910 / UL865, we probably want to ignore a few
interfaces on HE910 as these ports aren't responding to AT probe and
don't want to waste extra time probing them. I can rebase my patch
earlier to all the following rules. What do you think?


ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="0021",
ENV{.MM_USBIFNUM}=="02", ENV{ID_MM_PORT_IGNORE}="1"
ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="0021",
ENV{.MM_USBIFNUM}=="04", ENV{ID_MM_PORT_IGNORE}="1"
ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="0021",
ENV{.MM_USBIFNUM}=="08", ENV{ID_MM_PORT_IGNORE}="1"
ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="0021",
ENV{.MM_USBIFNUM}=="0a", ENV{ID_MM_PORT_IGNORE}="1"
ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="0021",
ENV{.MM_USBIFNUM}=="0c", ENV{ID_MM_PORT_IGNORE}="1"


On Thu, Mar 12, 2015 at 4:02 AM, Aleksander Morgado
<aleksander at aleksander.es> wrote:
>
> On Thu, Mar 12, 2015 at 11:33 AM, Daniele Palmas <dnlplm at gmail.com> wrote:
> > Telit HE910, UE910 and UL865 do not support XON/XOFF; defaulting
> > to RTS/CTS
>
> Pushed, thanks.
>
> > ---
> >  plugins/telit/mm-broadband-modem-telit.c | 48 ++++++++++++++++++++++++++++++++
> >  1 file changed, 48 insertions(+)
> >
> > diff --git a/plugins/telit/mm-broadband-modem-telit.c b/plugins/telit/mm-broadband-modem-telit.c
> > index 5e1dbff..2f44a4b 100644
> > --- a/plugins/telit/mm-broadband-modem-telit.c
> > +++ b/plugins/telit/mm-broadband-modem-telit.c
> > @@ -175,6 +175,52 @@ load_access_technologies (MMIfaceModem *self,
> >  }
> >
> >  /*****************************************************************************/
> > +/* Flow control (Modem interface) */
> > +
> > +static gboolean
> > +setup_flow_control_finish (MMIfaceModem *self,
> > +                           GAsyncResult *res,
> > +                           GError **error)
> > +{
> > +    /* Completely ignore errors */
> > +    return TRUE;
> > +}
> > +
> > +static void
> > +setup_flow_control (MMIfaceModem *self,
> > +                    GAsyncReadyCallback callback,
> > +                    gpointer user_data)
> > +{
> > +    GSimpleAsyncResult *result;
> > +    gchar *cmd;
> > +    guint flow_control = 1; /* Default flow control: XON/XOFF */
> > +
> > +    switch (mm_base_modem_get_product_id (MM_BASE_MODEM (self)) & 0xFFFF) {
> > +    case 0x0021:
> > +        flow_control = 2; /* Telit IMC modems support only RTS/CTS mode */
> > +        break;
> > +    default:
> > +        break;
> > +    }
> > +
> > +    cmd = g_strdup_printf ("+IFC=%u,%u", flow_control, flow_control);
> > +    mm_base_modem_at_command (MM_BASE_MODEM (self),
> > +                              cmd,
> > +                              3,
> > +                              FALSE,
> > +                              NULL,
> > +                              NULL);
> > +    result = g_simple_async_result_new (G_OBJECT (self),
> > +                                        callback,
> > +                                        user_data,
> > +                                        setup_flow_control);
> > +    g_simple_async_result_set_op_res_gboolean (result, TRUE);
> > +    g_simple_async_result_complete_in_idle (result);
> > +    g_object_unref (result);
> > +    g_free (cmd);
> > +}
> > +
> > +/*****************************************************************************/
> >
> >  MMBroadbandModemTelit *
> >  mm_broadband_modem_telit_new (const gchar *device,
> > @@ -202,6 +248,8 @@ iface_modem_init (MMIfaceModem *iface)
> >  {
> >      iface->load_access_technologies = load_access_technologies;
> >      iface->load_access_technologies_finish = load_access_technologies_finish;
> > +    iface->setup_flow_control = setup_flow_control;
> > +    iface->setup_flow_control_finish = setup_flow_control_finish;
> >  }
> >
> >  static void
> > --
> > 1.9.1
> >
> > _______________________________________________
> > ModemManager-devel mailing list
> > ModemManager-devel at lists.freedesktop.org
> > http://lists.freedesktop.org/mailman/listinfo/modemmanager-devel
>
>
>
> --
> Aleksander
> https://aleksander.es
> _______________________________________________
> ModemManager-devel mailing list
> ModemManager-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/modemmanager-devel


More information about the ModemManager-devel mailing list