[PATCH 0/1] Patch Description
Sometimes we need to know the version of phonesim via a command. This patch is to add this support. By the way, oFono introduces a file named version.h.in for the macro OFONO_VERSION. Can we use VERSION directly so that this file can be removed? Yang Gu (1): Add option to support version Makefile.am |2 +- bootstrap|2 +- configure.ac |1 + src/main.cpp | 11 +-- 4 files changed, 12 insertions(+), 4 deletions(-) -- 1.7.2.3 ___ ofono mailing list ofono@ofono.org http://lists.ofono.org/listinfo/ofono
[PATCH 1/1] Add option to support version
--- Makefile.am |2 +- bootstrap|2 +- configure.ac |1 + src/main.cpp | 11 +-- 4 files changed, 12 insertions(+), 4 deletions(-) diff --git a/Makefile.am b/Makefile.am index f124b08..dd54c42 100644 --- a/Makefile.am +++ b/Makefile.am @@ -50,7 +50,7 @@ dist_pkgdata_DATA = src/default.xml EXTRA_DIST = src/controlbase.ui src/GSMSpecification.xml MAINTAINERCLEANFILES = Makefile.in \ - aclocal.m4 configure depcomp missing install-sh + aclocal.m4 configure config.h.in depcomp missing install-sh $(src_phonesim_OBJECTS): src/ui_controlbase.h diff --git a/bootstrap b/bootstrap index 562c115..05eee20 100755 --- a/bootstrap +++ b/bootstrap @@ -1,3 +1,3 @@ #!/bin/sh -aclocal automake --add-missing --copy autoconf +aclocal autoheader automake --add-missing --copy autoconf diff --git a/configure.ac b/configure.ac index 725ae7e..445a11c 100644 --- a/configure.ac +++ b/configure.ac @@ -2,6 +2,7 @@ AC_PREREQ(2.60) AC_INIT(phonesim, 1.8) AM_INIT_AUTOMAKE([foreign subdir-objects]) +AM_CONFIG_HEADER(config.h) m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])]) diff --git a/src/main.cpp b/src/main.cpp index d7de416..6a00cb5 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -17,6 +17,10 @@ ** / +#ifdef HAVE_CONFIG_H +#include config.h +#endif + #include server.h #include control.h #include qapplication.h @@ -28,7 +32,7 @@ static void usage() { qWarning() Usage: QFileInfo(QCoreApplication::instance()-applicationFilePath()).fileName().toLocal8Bit().constData() -[-p port] [-gui] filename; +[-v] [-p port] [-gui] filename; exit(-1); } @@ -43,7 +47,10 @@ int main(int argc, char **argv) // Parse the command-line. index = 1; for (index = 1; index argc; index++) { -if (strcmp(argv[index],-p) == 0) { +if (strcmp(argv[index],-v) == 0) { +qWarning() VERSION; +exit(0); +} else if (strcmp(argv[index],-p) == 0) { index++; if (index = argc) { qWarning() ERROR: Got -p but missing port number; -- 1.7.2.3 ___ ofono mailing list ofono@ofono.org http://lists.ofono.org/listinfo/ofono
Re: [PATCH 1/1] Add option to support version
Hi Yang, Makefile.am |2 +- bootstrap|2 +- configure.ac |1 + src/main.cpp | 11 +-- 4 files changed, 12 insertions(+), 4 deletions(-) diff --git a/Makefile.am b/Makefile.am index f124b08..dd54c42 100644 --- a/Makefile.am +++ b/Makefile.am @@ -50,7 +50,7 @@ dist_pkgdata_DATA = src/default.xml EXTRA_DIST = src/controlbase.ui src/GSMSpecification.xml MAINTAINERCLEANFILES = Makefile.in \ - aclocal.m4 configure depcomp missing install-sh + aclocal.m4 configure config.h.in depcomp missing install-sh $(src_phonesim_OBJECTS): src/ui_controlbase.h diff --git a/bootstrap b/bootstrap index 562c115..05eee20 100755 --- a/bootstrap +++ b/bootstrap @@ -1,3 +1,3 @@ #!/bin/sh -aclocal automake --add-missing --copy autoconf +aclocal autoheader automake --add-missing --copy autoconf diff --git a/configure.ac b/configure.ac index 725ae7e..445a11c 100644 --- a/configure.ac +++ b/configure.ac @@ -2,6 +2,7 @@ AC_PREREQ(2.60) AC_INIT(phonesim, 1.8) AM_INIT_AUTOMAKE([foreign subdir-objects]) +AM_CONFIG_HEADER(config.h) m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])]) diff --git a/src/main.cpp b/src/main.cpp index d7de416..6a00cb5 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -17,6 +17,10 @@ ** / +#ifdef HAVE_CONFIG_H +#include config.h +#endif + this is not how this works actually. Either you do that in every single file or you better don't do it at all. Run make V=1 and you see what are the actual parameters. depbase=`echo src/main.o | sed 's|[^/]*$|.deps/|;s|\.o$||'`;\ g++ -DPACKAGE_NAME=\phonesim\ -DPACKAGE_TARNAME=\phonesim\ -DPACKAGE_VERSION=\1.8\ -DPACKAGE_STRING=\phonesim\ 1.8\ -DPACKAGE_BUGREPORT=\\ -DPACKAGE_URL=\\ -DPACKAGE=\phonesim\ -DVERSION=\1.8\ -I. -I./src -I./src -Wall -DQT_SHARED -I/usr/include/QtCore -I/usr/include/QtGui -I/usr/include/QtXml -I/usr/include/QtNetwork -I/usr/include/QtScript -I/usr/include/QtDBus -g -O2 -MT src/main.o -MD -MP -MF $depbase.Tpo -c -o src/main.o src/main.cpp \ mv -f $depbase.Tpo $depbase.Po As you can see that it nicely does -DVERSION=\1.8\ actually. #include server.h #include control.h #include qapplication.h @@ -28,7 +32,7 @@ static void usage() { qWarning() Usage: QFileInfo(QCoreApplication::instance()-applicationFilePath()).fileName().toLocal8Bit().constData() -[-p port] [-gui] filename; +[-v] [-p port] [-gui] filename; exit(-1); } @@ -43,7 +47,10 @@ int main(int argc, char **argv) // Parse the command-line. index = 1; for (index = 1; index argc; index++) { -if (strcmp(argv[index],-p) == 0) { +if (strcmp(argv[index],-v) == 0) { +qWarning() VERSION; +exit(0); +} else if (strcmp(argv[index],-p) == 0) { index++; if (index = argc) { qWarning() ERROR: Got -p but missing port number; So this is all you need. And nothing more. Regards Marcel ___ ofono mailing list ofono@ofono.org http://lists.ofono.org/listinfo/ofono
Re: [RFC] [CHANGE 1/2] Addidng initial documentation for basic assisted gps
Hi Robertino, This is first attempt to send out RFC for a-gps dbus documentation. It fill be followed by RFC for Infineon modem API implementation. Thank you for your comments in advance. :-) as explained in the other email, some general rules on submission needs to be fulfilled. Use git format-patch to create your patch series and use the cover/summary template for the introduction email. Which is essentially [PATCH 0/x] in most cases. And then use git send-email to send them and it will do this magically proper for you. You can just point it to linux.intel.com mailserver and no damage to the email will be done. Please drop the CHANGE keyword. I don't really understand what that means. It should be [PATCH 1/2] or [RFC 1/2] etc. In case of revision I prefer that you indicated [RFC v2 1/2] etc. So that we can easily track patches and to what series they belong and don't accidentally look at outdated patches. Also you need proper prefix: in it. This for example would be doc: So overall this email subject should read [RFC v2 1/2] doc: Adding ... In case of IFX modem plugin it should be prefixed with ifx: and in case of the modem driver with ifxmodem: or atmodem: if it is the generic one. Changes to the core should have proper prefixes like sms:, gprs: etc. And then please keep the subject line short. Something around 50 chars is a good indication. And then fill the rest of the commit message with proper explanations. Cutoff line should 72 chars per line. I would also what out for spelling mistakes in the subject and commit message. Regards Marcel ___ ofono mailing list ofono@ofono.org http://lists.ofono.org/listinfo/ofono
Re: [RFC] [CHANGE 2/2] ifxmodem: adding modem API to support agps
Hi Robertino, This patch is RFC for Infenion modem API to support agps implementation of ofono. same rules as in the other email apply here. drivers/ifxmodem/agps.c | 438 +++ include/agps.h | 157 + 2 files changed, 595 insertions(+), 0 deletions(-) create mode 100644 drivers/ifxmodem/agps.c create mode 100644 include/agps.h As I explained, we don't intermix core changes with modem plugin changes. So include/ and src/ directories are core directories. If you wanna add anything there, then you need to submit that as a separate patch. And I want to see an initial patch that updates the TODO file with at minium ownership if an entry already exists. Regards Marcel ___ ofono mailing list ofono@ofono.org http://lists.ofono.org/listinfo/ofono
[PATCH v2] Add option to support version
--- src/main.cpp |7 +-- 1 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index d7de416..d601ac2 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -28,7 +28,7 @@ static void usage() { qWarning() Usage: QFileInfo(QCoreApplication::instance()-applicationFilePath()).fileName().toLocal8Bit().constData() -[-p port] [-gui] filename; +[-v] [-p port] [-gui] filename; exit(-1); } @@ -43,7 +43,10 @@ int main(int argc, char **argv) // Parse the command-line. index = 1; for (index = 1; index argc; index++) { -if (strcmp(argv[index],-p) == 0) { +if (strcmp(argv[index],-v) == 0) { +qWarning() VERSION; +exit(0); +} else if (strcmp(argv[index],-p) == 0) { index++; if (index = argc) { qWarning() ERROR: Got -p but missing port number; -- 1.7.2.3 ___ ofono mailing list ofono@ofono.org http://lists.ofono.org/listinfo/ofono
Re: [RFC] AGPS Support
Hi Marcel. On positioning framework side, XML containers encoding/decoding does not seem to be yet widely used, while the support of RRC and RRLP framing is common, thanks to the support of SUPL. Using XML and 27.007 format would be great as long as long as ofono is not obliged to interpret the XML containers. Denis, is this something you would consider as an option, to transport both ASN.1 coded RRC / RRLP frames and XML transparently over the oFono API ? can some just quickly summarize for me what kind of different data type representation we actually have here. And what the different modems and standard suggest on how to encode them. The RRLP, RRC and LPP standards all use ASN.1 to specify the data that is transferred, this encoded using packed en coding rules. The data is represented as SEQUENCES of INTEGER and ENUMERATED data types. A lot of items are subject to interesting scaling algorithms to get them into an integral format. A handful of items (locations and required assistance data) are effectively octet strings from other 3gpp standards. Most of the data is assistance data describing reference location, reference time, satellite orbits, expected doppler and code phase. The UE calculates the location and returns this as a GAD shape which is basically an ellipse with uncertainty, the coordinates scaled to be integral values. And then really who needs to transcode what in to what standard if we would be going for XML as format? The STE-Ericsson modem is doing the transcoding to XML on the modem side, using the 27.007 AT commands defined for AGPS. For other modems sending the raw RRC/RRLP frames I guess the transcoding to XML would need to happen in the ofono driver or in ofono core if you want to expose an oFono XML API. Regards, Sjur and Simon ___ ofono mailing list ofono@ofono.org http://lists.ofono.org/listinfo/ofono
Re: [RFC] AGPS Support
Hi Sjur, On positioning framework side, XML containers encoding/decoding does not seem to be yet widely used, while the support of RRC and RRLP framing is common, thanks to the support of SUPL. Using XML and 27.007 format would be great as long as long as ofono is not obliged to interpret the XML containers. Denis, is this something you would consider as an option, to transport both ASN.1 coded RRC / RRLP frames and XML transparently over the oFono API ? can some just quickly summarize for me what kind of different data type representation we actually have here. And what the different modems and standard suggest on how to encode them. The RRLP, RRC and LPP standards all use ASN.1 to specify the data that is transferred, this encoded using packed en coding rules. The data is represented as SEQUENCES of INTEGER and ENUMERATED data types. A lot of items are subject to interesting scaling algorithms to get them into an integral format. A handful of items (locations and required assistance data) are effectively octet strings from other 3gpp standards. Most of the data is assistance data describing reference location, reference time, satellite orbits, expected doppler and code phase. The UE calculates the location and returns this as a GAD shape which is basically an ellipse with uncertainty, the coordinates scaled to be integral values. And then really who needs to transcode what in to what standard if we would be going for XML as format? The STE-Ericsson modem is doing the transcoding to XML on the modem side, using the 27.007 AT commands defined for AGPS. For other modems sending the raw RRC/RRLP frames I guess the transcoding to XML would need to happen in the ofono driver or in ofono core if you want to expose an oFono XML API. so here is my take on XML. If we have to parse it, then in general that is a bad idea. Creating XML is just fine. It is not something totally horrible, but nevertheless it is something that I would like to avoid. If we can assume that we can use GMarkup (and its restrictions) for it, then it mitigates this a little bit. That said, I am with Denis here. If XML is defined in 27.007, then it does make sense to do it. And as long as the core just sees it as a stream of bytes, I am fine with this. This of course means that the modems that don't use XML native for this have to do some transcoding here. That is then up to the modem driver. No on the other hand ASN.1 description of packets is also fine to me. However same rule applies that oFono core should not need to look into the data. It should just hand them off. Or do we expect oFono core to do something with this data? I am under the impression that oFono core is just a pipe here. And in conclusion we have XML and ASN.1 adding some overhead to the actual data that is encoded. None of them is coming for free. If we wanna look at this not from the 27.007 standard angle, then we have to look at what the users of this D-Bus are talking and what would be easiest for them. Regards Marcel ___ ofono mailing list ofono@ofono.org http://lists.ofono.org/listinfo/ofono
RE: [PATCHv2 1/2] stemodem: Add RTNL functionality managing CAIF Network Interfaces.
Hi Marcel. +static GSList *pending_requests; +static GIOChannel *channel; +static guint32 rtnl_seqnr; +static guint rtnl_watch; To be fair, you don't need both, the GIOChannel and the watch. You can just add the watch and then unref the GIOChannel and set it to close on unref. That way when the watch gets removed or you remove it, the GIOChannel and the underlaying socket will be automatically closed as well. As described above. Just unref the GIOChannel and forget about it. And then you can make the GIOChannel a local variable. I think I have to keep the channel, because I do need the file descriptor derived from the channel when doing sendto. You don't really have to play this append/remove game. You can just append it after send_rtnl_req succeed. The read goes via the mainloop anyway and we are a single threaded program. So the order is guaranteed. ... You don't need to append it first, send the message, check error and in case of an error remove it again. OK, thanks - now I get what your after. I completely misunderstood your previous comment, my bad. And while we are at it. Essentially you also need to use asynchronous and non-blocking watch driven sending of your message in the first place. I did forget to check if you open the RTNL socket non-blocking, but you should be doing that. So I'll add something like this then: fl = fcntl(sk, F_GETFL); fcntl(sk, F_SETFL, fl | O_NONBLOCK); + } + + g_slist_free(pending_requests); + pending_requests = NULL; No need to set pending_requests to NULL here. But I will have to move this to the caif_rtnl_init function then, I think pending_requests needs to be NULL before using it. I am not really sold on this param stuct thingy btw. Why do you need them? Just proper input params and output params for the callback handler would do them same. Won't they? Yes, I could do that. But in that case I would prefer to typedef the response function to simplify create function's signature. Otherwise I think the create function's signature gets too complex. typedef for function callbacks are just fine. I have no problem with that at all. I got rid of the structs and typedef'ed response function - I agree this better. snip typedef void (*rtnl_create_cb_t) (int result, gpointer user_data, char *ifname, int ifindex); extern int caif_rtnl_create_interface(gpointer user_data, int type, int connid, gboolean loop, rtnl_create_cb_t cb); Hoping to get the next patch out later today. Regards, Sjur ___ ofono mailing list ofono@ofono.org http://lists.ofono.org/listinfo/ofono
Re: [RFC] AGPS Support
Hi Denis, What are the possible reasons as to why oFono might need to peek inside the XML? I was previously under the false impression that you wanted oFono API to export AGPS functionality using dbus types only. Piping the AGPS XML (or ASN.1 coded data) through oFono certainly makes the oFono implementation much simpler. I'm all for that :-) Regards, Sjur ___ ofono mailing list ofono@ofono.org http://lists.ofono.org/listinfo/ofono
Re: [PATCH] atmodem: Remove at_pin_send_puk_cb, and use at_pin_send_cb instead.
Hi Marit, When adding the use of pin event *EPEV also to at_pin_send_puk_cb, it becomes identical to at_pin_send_cb, and can be removed. --- drivers/atmodem/sim.c | 44 +--- 1 files changed, 1 insertions(+), 43 deletions(-) I am fine with this patch, but I have let Denis have a second look. Since getting this right for IFX took me three attempts. Most likely that was my own stupidity, but just in case ;) Regards Marcel ___ ofono mailing list ofono@ofono.org http://lists.ofono.org/listinfo/ofono
RE: [PATCHv2 1/2] stemodem: Add RTNL functionality managing CAIF Network Interfaces.
Hi Sjur, +static GSList *pending_requests; +static GIOChannel *channel; +static guint32 rtnl_seqnr; +static guint rtnl_watch; To be fair, you don't need both, the GIOChannel and the watch. You can just add the watch and then unref the GIOChannel and set it to close on unref. That way when the watch gets removed or you remove it, the GIOChannel and the underlaying socket will be automatically closed as well. As described above. Just unref the GIOChannel and forget about it. And then you can make the GIOChannel a local variable. I think I have to keep the channel, because I do need the file descriptor derived from the channel when doing sendto. fair enough. Anything wrong with just using g_io_channel_write_chars and setting the channel to not-buffered and no-encoding? You don't really have to play this append/remove game. You can just append it after send_rtnl_req succeed. The read goes via the mainloop anyway and we are a single threaded program. So the order is guaranteed. ... You don't need to append it first, send the message, check error and in case of an error remove it again. OK, thanks - now I get what your after. I completely misunderstood your previous comment, my bad. That is what I figured. I think that I wasn't clear enough here. And while we are at it. Essentially you also need to use asynchronous and non-blocking watch driven sending of your message in the first place. I did forget to check if you open the RTNL socket non-blocking, but you should be doing that. So I'll add something like this then: fl = fcntl(sk, F_GETFL); fcntl(sk, F_SETFL, fl | O_NONBLOCK); You can also just use the one from GIOChannel to do this since you wrap it into a GIOChannel right away anyway. + } + + g_slist_free(pending_requests); + pending_requests = NULL; No need to set pending_requests to NULL here. But I will have to move this to the caif_rtnl_init function then, I think pending_requests needs to be NULL before using it. That is given by the fact that it is a global static variable. And when the exit gets called, we are ending the ofonod. Not a big thing. Just a minor nitpick. And if you look you will find cases where even I kept doing it ;) I am not really sold on this param stuct thingy btw. Why do you need them? Just proper input params and output params for the callback handler would do them same. Won't they? Yes, I could do that. But in that case I would prefer to typedef the response function to simplify create function's signature. Otherwise I think the create function's signature gets too complex. typedef for function callbacks are just fine. I have no problem with that at all. I got rid of the structs and typedef'ed response function - I agree this better. snip typedef void (*rtnl_create_cb_t) (int result, gpointer user_data, char *ifname, int ifindex); extern int caif_rtnl_create_interface(gpointer user_data, int type, int connid, gboolean loop, rtnl_create_cb_t cb); Hoping to get the next patch out later today. Please don't use rtnl_ prefix. That is not your namespace. So it should be caif_rtnl_create_cb. Regards Marcel ___ ofono mailing list ofono@ofono.org http://lists.ofono.org/listinfo/ofono
Re: [PATCH] atmodem: Remove at_pin_send_puk_cb, and use at_pin_send_cb instead.
Hi Marit, On 11/03/2010 07:06 AM, Marit Henriksen wrote: From: Marit Henriksen marit.henrik...@stericsson.com When adding the use of pin event *EPEV also to at_pin_send_puk_cb, it becomes identical to at_pin_send_cb, and can be removed. --- drivers/atmodem/sim.c | 44 +--- 1 files changed, 1 insertions(+), 43 deletions(-) diff --git a/drivers/atmodem/sim.c b/drivers/atmodem/sim.c index 3abd1d8..9cfdc65 100644 --- a/drivers/atmodem/sim.c +++ b/drivers/atmodem/sim.c @@ -647,48 +647,6 @@ error: CALLBACK_WITH_FAILURE(cb, data); } -static void at_pin_send_puk_cb(gboolean ok, GAtResult *result, - gpointer user_data) -{ - struct cb_data *cbd = user_data; - struct sim_data *sd = cbd-user; - ofono_sim_lock_unlock_cb_t cb = cbd-cb; - struct ofono_error error; - - decode_at_error(error, g_at_result_final_response(result)); - - if (!ok) - goto done; - - switch (sd-vendor) { - case OFONO_VENDOR_IFX: - /* - * On the IFX modem, AT+CPIN? can return READY too - * early and so use +XSIM notification to detect - * the ready state of the SIM. - */ - sd-ready_id = g_at_chat_register(sd-chat, +XSIM, - at_xsim_notify, - FALSE, cbd, g_free); - return; - case OFONO_VENDOR_MBM: - /* - * On the MBM modem, AT+CPIN? keeps returning SIM PIN - * for a moment after successful AT+CPIN=.., but then - * sends *EPEV when that changes. - */ - sd-ready_id = g_at_chat_register(sd-chat, *EPEV, - at_epev_notify, - FALSE, cbd, g_free); - return; - } I'm fine with this patch but do note that it does not apply. I guess that is because the OFONO_VENDOR_MBM part is not in the upstream repository. Applying: atmodem: Remove at_pin_send_puk_cb, and use at_pin_send_cb instead. fatal: sha1 information is lacking or useless (drivers/atmodem/sim.c). Repository lacks necessary blobs to fall back on 3-way merge. Cannot fall back to three-way merge. Patch failed at 0001 atmodem: Remove at_pin_send_puk_cb, and use at_pin_send_cb instead. When you have resolved this problem run git am -3 --resolved. If you would prefer to skip this patch, instead run git am -3 --skip. To restore the original branch and stop patching run git am -3 --abort. - -done: - cb(error, cbd-data); - - g_free(cbd); -} - static void at_pin_send_puk(struct ofono_sim *sim, const char *puk, const char *passwd, ofono_sim_lock_unlock_cb_t cb, void *data) @@ -706,7 +664,7 @@ static void at_pin_send_puk(struct ofono_sim *sim, const char *puk, snprintf(buf, sizeof(buf), AT+CPIN=\%s\,\%s\, puk, passwd); ret = g_at_chat_send(sd-chat, buf, none_prefix, - at_pin_send_puk_cb, cbd, NULL); + at_pin_send_cb, cbd, NULL); memset(buf, 0, sizeof(buf)); Regards, -Denis ___ ofono mailing list ofono@ofono.org http://lists.ofono.org/listinfo/ofono
[PATCH] TODO: Update Read/Write EFcfis description
--- TODO |4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/TODO b/TODO index 5968c08..ad4a19a 100644 --- a/TODO +++ b/TODO @@ -1,4 +1,4 @@ -Background +pBackground == - Priority scale: High, Medium and Low @@ -114,7 +114,7 @@ SIM / SIM File system - Read / Write EFcfis. Call forwarding settings can be bootstrapped on the SIM for faster notification of the user that call forwarding is active. These settings are stored in EFcfis. oFono should read these settings and - update the call history atom appropriately. + update the call forwarding atom appropriately. Priority: Low Complexity: C2 -- 1.7.0.4 ___ ofono mailing list ofono@ofono.org http://lists.ofono.org/listinfo/ofono
Re: [PATCH] TODO: Update Read/Write EFcfis description
Hi Jeevaka, TODO |4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) patch has been applied. Thanks. Regards Marcel ___ ofono mailing list ofono@ofono.org http://lists.ofono.org/listinfo/ofono
Re: [PATCH] atmodem: Remove at_pin_send_puk_cb, and use at_pin_send_cb instead.
Hi Marit, When adding the use of pin event *EPEV also to at_pin_send_puk_cb, it becomes identical to at_pin_send_cb, and can be removed. --- New patch, this one should apply:) please also do [PATCH v2] so we know which version it is. git am will strip these nicely away from us. drivers/atmodem/sim.c | 44 +--- 1 files changed, 1 insertions(+), 43 deletions(-) Applying: atmodem: Remove at_pin_send_puk_cb, and use at_pin_send_cb instead. error: patch failed: drivers/atmodem/sim.c:647 error: drivers/atmodem/sim.c: patch does not apply Patch failed at 0001 atmodem: Remove at_pin_send_puk_cb, and use at_pin_send_cb instead. It does not apply. Regards Marcel ___ ofono mailing list ofono@ofono.org http://lists.ofono.org/listinfo/ofono
Re: [RFC] AGPS Support
Hi, 2010/11/3 Sjur Brændeland sjurb...@gmail.com: I was previously under the false impression that you wanted oFono API to export AGPS functionality using dbus types only. Piping the AGPS XML (or ASN.1 coded data) through oFono certainly makes the oFono implementation much simpler. I'm all for that :-) I think it has been the working assumption to just forward raw data over D-Bus; PDU as an array of bytes. I believe the ISI modem interface exposes raw ASN.1 PDUs directly. Obviously we need to pick one format for the D-Bus interface, but I'm a little wary of transcoding between the two formats, be it in the core or in the drivers. Cheers, Aki ___ ofono mailing list ofono@ofono.org http://lists.ofono.org/listinfo/ofono
Re: [RFC] AGPS Support
Hi Aki, On 11/03/2010 12:40 PM, Aki Niemi wrote: Hi, 2010/11/3 Sjur Brændeland sjurb...@gmail.com: I was previously under the false impression that you wanted oFono API to export AGPS functionality using dbus types only. Piping the AGPS XML (or ASN.1 coded data) through oFono certainly makes the oFono implementation much simpler. I'm all for that :-) I think it has been the working assumption to just forward raw data over D-Bus; PDU as an array of bytes. I believe the ISI modem interface exposes raw ASN.1 PDUs directly. Obviously we need to pick one format for the D-Bus interface, but I'm a little wary of transcoding between the two formats, be it in the core or in the drivers. Oh I can definitely see that no matter which one we pick it will be inconvenient for some vendors. But I think we're all interested in picking one 'standard' one to avoid fragmentation. Are all vendors utilizing the same ASN.1 binary encoding format, or is that also variable between vendors? We already have a disaster with CAT spec using C-TLVs and BER-TLVs and it is a really bad idea to expose upper layers to these details. Can someone perform due diligence into what it would take to convert ASN.1 into XML? If the amount of work is not large, then it is another point for the XML / 27.007 approach. Regards, -Denis ___ ofono mailing list ofono@ofono.org http://lists.ofono.org/listinfo/ofono
[PATCH] isigen: increase offline timeout
From: Pekka Pessi pekka.pe...@nokia.com The modem deregisters from network before response to MTC_STATE_REQ is returned. Deregistering can take at least 8 seconds. --- plugins/isigen.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/plugins/isigen.c b/plugins/isigen.c index 493d926..014456f 100644 --- a/plugins/isigen.c +++ b/plugins/isigen.c @@ -373,7 +373,7 @@ static void isigen_online(struct ofono_modem *modem, ofono_bool_t online, isi-online = online; - if (g_isi_send(isi-client, req, sizeof(req), MTC_TIMEOUT, + if (g_isi_send(isi-client, req, sizeof(req), 8 + MTC_TIMEOUT, mtc_state_cb, cbd, NULL)) return; -- 1.7.1 ___ ofono mailing list ofono@ofono.org http://lists.ofono.org/listinfo/ofono
Re: [PATCH] isigen: increase offline timeout
Hi Pekka, The modem deregisters from network before response to MTC_STATE_REQ is returned. Deregistering can take at least 8 seconds. --- plugins/isigen.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/plugins/isigen.c b/plugins/isigen.c index 493d926..014456f 100644 --- a/plugins/isigen.c +++ b/plugins/isigen.c @@ -373,7 +373,7 @@ static void isigen_online(struct ofono_modem *modem, ofono_bool_t online, isi-online = online; - if (g_isi_send(isi-client, req, sizeof(req), MTC_TIMEOUT, + if (g_isi_send(isi-client, req, sizeof(req), 8 + MTC_TIMEOUT, mtc_state_cb, cbd, NULL)) return; are you sure you just wanna hardcode it like this and not use a proper constant for it? Regards Marcel ___ ofono mailing list ofono@ofono.org http://lists.ofono.org/listinfo/ofono
Re: [PATCH] isigen: increase offline timeout
Hi Marcel, 2010/11/3 Marcel Holtmann mar...@holtmann.org: The modem deregisters from network before response to MTC_STATE_REQ is returned. Deregistering can take at least 8 seconds. --- plugins/isigen.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/plugins/isigen.c b/plugins/isigen.c index 493d926..014456f 100644 --- a/plugins/isigen.c +++ b/plugins/isigen.c @@ -373,7 +373,7 @@ static void isigen_online(struct ofono_modem *modem, ofono_bool_t online, isi-online = online; - if (g_isi_send(isi-client, req, sizeof(req), MTC_TIMEOUT, + if (g_isi_send(isi-client, req, sizeof(req), 8 + MTC_TIMEOUT, mtc_state_cb, cbd, NULL)) return; are you sure you just wanna hardcode it like this and not use a proper constant for it? I'm not sure. It might depend on modem. Aki? -- Pekka.Pessi mail at nokia.com ___ ofono mailing list ofono@ofono.org http://lists.ofono.org/listinfo/ofono
[PATCH v3 1/2] stemodem: Add RTNL functionality managing CAIF Network Interfaces.
From: Sjur Brændeland sjur.brandel...@stericsson.com --- Hi Marcel. I hope I have closed most of your review comments so far. I had a go at using g_io_chanel_write_chars, but couldn't make it work, and I (stubbornly ;-) do g_caif_devices = NULL, just in case someone choose to call caif_rtnl_init more than once. Makefile.am |2 + drivers/stemodem/caif_rtnl.c | 382 ++ drivers/stemodem/caif_rtnl.h | 29 3 files changed, 413 insertions(+), 0 deletions(-) create mode 100644 drivers/stemodem/caif_rtnl.c create mode 100644 drivers/stemodem/caif_rtnl.h diff --git a/Makefile.am b/Makefile.am index cd17fa2..aea91ce 100644 --- a/Makefile.am +++ b/Makefile.am @@ -226,6 +226,8 @@ builtin_sources += drivers/atmodem/atutil.h \ drivers/stemodem/stemodem.c \ drivers/stemodem/voicecall.c \ drivers/stemodem/radio-settings.c \ + drivers/stemodem/caif_rtnl.c \ + drivers/stemodem/caif_rtnl.h \ drivers/stemodem/gprs-context.c \ drivers/stemodem/caif_socket.h \ drivers/stemodem/if_caif.h diff --git a/drivers/stemodem/caif_rtnl.c b/drivers/stemodem/caif_rtnl.c new file mode 100644 index 000..82740ba --- /dev/null +++ b/drivers/stemodem/caif_rtnl.c @@ -0,0 +1,382 @@ +/* + * + * oFono - Open Source Telephony + * + * Copyright (C) 2010 ST-Ericsson AB. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + * + */ + +#ifdef HAVE_CONFIG_H +#include config.h +#endif + +#include string.h +#include unistd.h +#include errno.h +#include net/if.h +#include net/if_arp.h +#include fcntl.h +#include linux/rtnetlink.h + +#include glib.h + +#include ofono/log.h + +#include if_caif.h +#include caif_rtnl.h + +#define NLMSG_TAIL(nmsg) \ + ((struct rtattr *) (((void *) (nmsg)) + NLMSG_ALIGN((nmsg)-nlmsg_len))) + +struct iplink_req { + struct nlmsghdr n; + struct ifinfomsg i; + char pad[1024]; + + int request_id; + int type; + int conn_id; + gpointer user_data; + gboolean loop_enabled; + + char ifname[IF_NAMESIZE]; + int ifindex; + caif_rtnl_create_cb_t callback; +}; + +static GSList *pending_requests; +static guint32 rtnl_seqnr; +static guint rtnl_watch; +static GIOChannel *channel; + +static gboolean get_ifname(struct ifinfomsg *msg, int bytes, + const char **ifname) +{ + struct rtattr *attr; + + for (attr = IFLA_RTA(msg); RTA_OK(attr, bytes); + attr = RTA_NEXT(attr, bytes)) { + + if (attr-rta_type == IFLA_IFNAME + ifname != NULL) { + + *ifname = RTA_DATA(attr); + return TRUE; + } + } + + return FALSE; +} + +static void store_newlink_param(struct iplink_req *req, unsigned short type, + int index, unsigned flags, + unsigned change, struct ifinfomsg *msg, + int bytes) +{ + const char *ifname = NULL; + + get_ifname(msg, bytes, ifname); + strncpy(req-ifname, ifname, + sizeof(req-ifname)); + req-ifname[sizeof(req-ifname)-1] = '\0'; + req-ifindex = index; +} + +static int send_rtnl_req(struct iplink_req *req) +{ + struct sockaddr_nl addr; + int sk = g_io_channel_unix_get_fd(channel); + + memset(addr, 0, sizeof(addr)); + addr.nl_family = AF_NETLINK; + + return sendto(sk, req, req-n.nlmsg_len, 0, + (struct sockaddr *) addr, sizeof(addr)); +} + +static struct iplink_req *find_request(guint32 seq) +{ + GSList *list; + + for (list = pending_requests; list; list = list-next) { + struct iplink_req *req = list-data; + + if (req-n.nlmsg_seq == seq) + return req; + } + + return NULL; +} + +static void rtnl_client_response(struct iplink_req *req, int result) +{ + + if (req-callback req-n.nlmsg_type == RTM_NEWLINK) + req-callback(result, req-user_data, + req-ifname, req-ifindex); + + pending_requests =
[PATCH v3 2/2] stemodem: Update gprs-context to use rtnl to create/remove interfaces.
From: Sjur Brændeland sjur.brandel...@stericsson.com --- drivers/stemodem/gprs-context.c | 207 +-- 1 files changed, 135 insertions(+), 72 deletions(-) diff --git a/drivers/stemodem/gprs-context.c b/drivers/stemodem/gprs-context.c index 9f59579..4260d31 100644 --- a/drivers/stemodem/gprs-context.c +++ b/drivers/stemodem/gprs-context.c @@ -28,6 +28,7 @@ #include string.h #include stdlib.h #include stdio.h +#include errno.h #include glib.h @@ -46,10 +47,11 @@ #include stemodem.h #include caif_socket.h #include if_caif.h +#include caif_rtnl.h -#define MAX_CAIF_DEVICES 7 +#define MAX_CAIF_DEVICES 4 #define MAX_DNS 2 -#define MAX_ELEM 20 +#define IP_ADDR_LEN 20 #define AUTH_BUF_LENGTH (OFONO_GPRS_MAX_USERNAME_LENGTH + \ OFONO_GPRS_MAX_PASSWORD_LENGTH + 128) @@ -65,21 +67,29 @@ struct gprs_context_data { }; struct conn_info { + /* +* cid is allocated in oFono Core and is identifying +* the Account. cid = 0 indicates that it is currently unused. +*/ unsigned int cid; - unsigned int device; + /* Id used by CAIF and EPPSD to identify the CAIF channel*/ unsigned int channel_id; - char interface[10]; + /* Linux Interface Id */ + unsigned int ifindex; + /* Linux Interface name */ + char interface[IF_NAMESIZE]; + gboolean created; }; struct eppsd_response { char *current; - char ip_address[MAX_ELEM]; - char subnet_mask[MAX_ELEM]; - char mtu[MAX_ELEM]; - char default_gateway[MAX_ELEM]; - char dns_server1[MAX_ELEM]; - char dns_server2[MAX_ELEM]; - char p_cscf_server[MAX_ELEM]; + char ip_address[IP_ADDR_LEN]; + char subnet_mask[IP_ADDR_LEN]; + char mtu[IP_ADDR_LEN]; + char default_gateway[IP_ADDR_LEN]; + char dns_server1[IP_ADDR_LEN]; + char dns_server2[IP_ADDR_LEN]; + char p_cscf_server[IP_ADDR_LEN]; }; static void start_element_handler(GMarkupParseContext *context, @@ -122,8 +132,8 @@ static void text_handler(GMarkupParseContext *context, struct eppsd_response *rsp = user_data; if (rsp-current) { - strncpy(rsp-current, text, MAX_ELEM); - rsp-current[MAX_ELEM] = 0; + strncpy(rsp-current, text, IP_ADDR_LEN); + rsp-current[IP_ADDR_LEN] = 0; } } @@ -153,8 +163,7 @@ static gint conn_compare_by_cid(gconstpointer a, gconstpointer b) return 0; } -static struct conn_info *conn_info_create(unsigned int device, - unsigned int channel_id) +static struct conn_info *conn_info_create(unsigned int channel_id) { struct conn_info *connection = g_try_new0(struct conn_info, 1); @@ -162,26 +171,61 @@ static struct conn_info *conn_info_create(unsigned int device, return NULL; connection-cid = 0; - connection-device = device; connection-channel_id = channel_id; return connection; } +static void rtnl_callback(int result, gpointer user_data, + char *ifname, int ifindex) +{ + struct conn_info *conn = user_data; + + strncpy(conn-interface, ifname, sizeof(conn-interface)); + conn-ifindex = ifindex; + + if (result == 0) + conn-created = TRUE; + else { + conn-created = FALSE; + DBG(Could not create CAIF Interface); + } +} + /* * Creates a new IP interface for CAIF. */ -static gboolean caif_if_create(const char *interface, unsigned int connid) +static gboolean caif_if_create(struct conn_info *conn) { - return FALSE; + int err; + + err = caif_rtnl_create_interface(conn, IFLA_CAIF_IPV4_CONNID, + conn-channel_id, FALSE, rtnl_callback); + if (err 0) { + DBG(Failed to create IP interface for CAIF); + return FALSE; + } + + return TRUE; } /* * Removes IP interface for CAIF. */ -static gboolean caif_if_remove(const char *interface, unsigned int connid) +static void caif_if_remove(struct conn_info *conn) { - return FALSE; + if (!conn-created) + return; + + if (caif_rtnl_delete_interface(conn-ifindex) 0) { + ofono_error(Failed to delete caif interface %s, + conn-interface); + return; + } + + DBG(removed CAIF interface ch:%d ifname:%s ifindex:%d\n, + conn-channel_id, conn-interface, conn-ifindex); + return; } static void ste_eppsd_down_cb(gboolean ok, GAtResult *result, @@ -192,11 +236,14 @@ static void ste_eppsd_down_cb(gboolean ok, GAtResult *result, struct ofono_gprs_context *gc = cbd-user; struct gprs_context_data *gcd = ofono_gprs_context_get_data(gc); struct ofono_error error; - struct conn_info *conn; + struct
RE: [RFC] AGPS Support
For other modems sending the raw RRC/RRLP frames I guess the transcoding to XML would need to happen in the ofono driver or in ofono core if you want to expose an oFono XML API. so here is my take on XML. If we have to parse it, then in general that is a bad idea. Creating XML is just fine. You need both as it's not only a matter of converting the raw RRC/RRLP frames from the modem to XML, but the responses from the GPS engine are presumably in XML format as well then and the modem driver would need to parse that and re-create RRC/RRLP frames again (for modem that expects raw RRC/RRLP frames). See the tables in section 8.55 of 27.007 for the XML schemas. It refers to the ASN.1 syntax for the definition of the value ranges. Cheers, Waldo ___ ofono mailing list ofono@ofono.org http://lists.ofono.org/listinfo/ofono
[PATCH] Added implementation for ReportVoiceCall, ReportTextMessage, Release methods and related code.Please take a look and give me feedback on the code quality , thinks that need to be changed
--- Makefile.am |6 + plugins/history.c | 438 + plugins/history_agent.c | 453 +++ plugins/history_agent.h | 103 +++ 4 files changed, 1000 insertions(+), 0 deletions(-) create mode 100755 plugins/history.c create mode 100644 plugins/history_agent.c create mode 100644 plugins/history_agent.h diff --git a/Makefile.am b/Makefile.am index cd17fa2..530c2de 100644 --- a/Makefile.am +++ b/Makefile.am @@ -286,6 +286,12 @@ builtin_sources += plugins/ste.c builtin_modules += caif builtin_sources += plugins/caif.c + + +builtin_modules += history +builtin_sources += plugins/history_agent.h +builtin_sources += plugins/history_agent.c +builtin_sources += plugins/history.c endif if MAINTAINER_MODE diff --git a/plugins/history.c b/plugins/history.c new file mode 100755 index 000..f5d4ba0 --- /dev/null +++ b/plugins/history.c @@ -0,0 +1,438 @@ +/* + * + * oFono - Open Source Telephony + * + * Copyright (C) 2008-2010 Intel Corporation. All rights reserved. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + * + */ + +#ifdef HAVE_CONFIG_H +#include config.h +#endif + +#define OFONO_API_SUBJECT_TO_CHANGE +#include errno.h + +#include gdbus/gdbus.h +#include ofono/history.h +#include plugins/history_agent.h +#include src/common.h + +#define HISTORY_FILE_PATH /var/cache/ofonohistory/ +#define HISTORY_FILE HISTORY_FILE_PATHofonohistorydata +#define OFONO_MANAGER_PATH / +#define OFONO_HISTORY_INTERFACE com.meego.TelephonyHistory + +struct ofono_history { + struct history_agent *current_agent; + int timeout; +} *history; + + +static int history_plugin_probe(struct ofono_history_context *context) +{ + DBG(History Probe for modem: %p, context-modem); + return 0; +} + +static void history_plugin_remove(struct ofono_history_context *context) +{ + DBG(History Remove for modem: %p, context-modem); +} + +/** + * history_call_ended: + * ofono calls this method with the call information + */ + +static void history_plugin_call_ended(struct ofono_history_context *context, + const struct ofono_call *call, + time_t start, + time_t end) +{ + struct ofono_modem *modem; + const char *path; + struct history *v = g_try_new0(struct history, 1); + if (!v) + return; + + v-data.voice.type = VOICE; + + strcpy(v-data.voice.lineid, Unknown); + + if (call-type != 0) + return; + + DBG(Voice Call, %s, call-direction ? Incoming : Outgoing); + v-data.voice.type = call-direction; + + if (call-clip_validity == 0) + strcpy(v-data.voice.lineid, + phone_number_to_string(call-phone_number)); + + v-data.voice.start_time = start; + v-data.voice.end_time = end; + + DBG(Call Ended on modem: %p, context-modem); + modem = context-modem; + path = ofono_modem_get_path(modem); + + v-data.voice.modem_path = g_try_malloc0(strlen(path) + 1); + if (v-data.voice.modem_path) + strcpy(v-data.voice.modem_path, path); + + if (!history) { + g_free(v); + return; + } + + history_agent_report_voicecall(v, history-current_agent, + history-timeout); +} + +/** + * history_call_missed: + * ofono calls this method with the call information + */ + +static void history_plugin_call_missed(struct ofono_history_context *context, + const struct ofono_call *call, + time_t when) +{ + struct ofono_modem *modem; + const char *modem_path; + + struct history *v = g_try_new0(struct history, 1); + if (!v) + return; + v-type = VOICE; + + strcpy(v-data.voice.lineid, Unknown); + + if (call-type != 0) + return; + + v-type = MISSED; + + if (call-clip_validity == 0) + strcpy(v-data.voice.lineid, + phone_number_to_string(call-phone_number)); + + v-data.voice.start_time = when; + + v-data.voice.end_time = when; + + DBG(Call Missed on modem: