[PATCH] Fix "Dialer: Error setting antenna power" failure at startup

andrzej zaborowski balrogg at gmail.com
Fri Sep 28 21:31:02 CEST 2007


Hi,

On 28/09/2007, pHilipp Zabel <philipp.zabel at gmail.com> wrote:
> On 9/28/07, Mike (mwester) <mwester at dls.net> wrote:
> > Current images are crippled because the dailer fails at startup with the
> > message "Dialer: Error setting antenna power".
> >
> > This problem is traced back to a recent change committed to OE that adds
> > error-checking logic to the read/write calls in libgsmd.  Basically,
> > lgsm_send_simple() calls lgsm_send(), and expects the return value to be the
> > number of characters sent.  The recent patch to add error-checking changed
> > lgsm_send() to return a 0 on success, which results in lgsm_send_simple()
> > always returning the error code EIO on success.
> >
> > The patch below restores the old behavior for lgsm_send(), such that it
> > returns the number of characters on succuss.  Arguably it might be better to
> > change the callers behavior such that they all expect the more-standard "0"
> > return value for success.
>
> Comparing with posix send(), I think returning the number of bytes
> sent is the most consistent thing to do.

Yes, on one hand this is consistent with the standard send() but on
the other the caller shouldn't be concerned with the number of bytes
sent now that lgsm_send returns only after all bytes have been sent or
an error occured.

And I should apologise for the confusion, it seems it was me who
caused the breakage.

>
> > (Unless anyone has any strong objections in the next day, I'll commit this
> > simple fix to OE - at least as an interim solution so that we can get
> > current images to function correctly again)
> >
> > Thanks!
> > Mike (mwester)
> >
> > --- gsm/src/libgsmd/libgsmd.c.orig      2007-09-25 00:41:56.000000000 -0500
> > +++ gsm/src/libgsmd/libgsmd.c   2007-09-25 00:43:44.000000000 -0500
> >  -210,7 +210,7 @@
> >                         pos += rc;
> >                 }
> >         }
> > -       return 0;
> > +       return (sizeof(*gmh) + gmh->len);
> >  }
> >
> >  struct gsmd_msg_hdr *lgsm_gmh_fill(int type, int subtype, int payload_len)

Here's the change that I would make in the original patch if I had
noticed that lgsm_send was being used in lgsm_send_simple, but I'm not
insisting on applying this one.

diff --git a/src/libgsmd/libgsmd.c b/src/libgsmd/libgsmd.c
index cc804ed..ee8bd81 100644
--- a/src/libgsmd/libgsmd.c
+++ b/src/libgsmd/libgsmd.c
@@ -238,11 +238,7 @@ int lgsm_send_simple(struct lgsm_handle *lh, int type, int
sub_type)
        if (!gmh)
                return -ENOMEM;
        rc = lgsm_send(lh, gmh);
-       if (rc < gmh->len + sizeof(*gmh)) {
-               lgsm_gmh_free(gmh);
-               return -EIO;
-       }
-       lgsm_gmh_free(gmh);

-       return 0;
+       lgsm_gmh_free(gmh);
+       return rc;
 }

Regards
-------------- next part --------------
A non-text attachment was scrubbed...
Name: lgsm_send_simple-return-rc.patch
Type: text/x-patch
Size: 447 bytes
Desc: not available
Url : http://lists.openmoko.org/pipermail/gsmd-devel/attachments/20070928/06af6bcc/lgsm_send_simple-return-rc.bin


More information about the gsmd-devel mailing list