diff options
Diffstat (limited to 'meta-openmoko/packages/libgsmd')
10 files changed, 313 insertions, 0 deletions
diff --git a/meta-openmoko/packages/libgsmd/libgsmd/default b/meta-openmoko/packages/libgsmd/libgsmd/default new file mode 100644 index 0000000000..161c97f5fb --- /dev/null +++ b/meta-openmoko/packages/libgsmd/libgsmd/default @@ -0,0 +1,9 @@ +# gsmd This shell script configures for the gsmd init script. + +# If you must specify special options, uncomment and modify the next line +#GSMD_OPTS="-s 115200 -F" + +# If your GSM device needs to be powered up, uncomment and modify the next line +#GSM_POW="/sys/bus/platform/devices/gta01-pm-gsm.0/power_on" + +#GSM_DEV="/dev/ttyS1" diff --git a/meta-openmoko/packages/libgsmd/libgsmd/fic-gta01/default b/meta-openmoko/packages/libgsmd/libgsmd/fic-gta01/default new file mode 100644 index 0000000000..1511376a6c --- /dev/null +++ b/meta-openmoko/packages/libgsmd/libgsmd/fic-gta01/default @@ -0,0 +1,9 @@ +# gsmd This shell script configures for the gsmd init script. + +# If you must specify special options, uncomment and modify the next line +GSMD_OPTS="-s 115200 -F" + +# If your GSM device needs to be powered up, uncomment and modify the next line +GSM_POW="/sys/bus/platform/devices/gta01-pm-gsm.0/power_on" + +GSM_DEV="/dev/ttySAC0" diff --git a/meta-openmoko/packages/libgsmd/libgsmd/getopt-wait-interpreter-ready.patch b/meta-openmoko/packages/libgsmd/libgsmd/getopt-wait-interpreter-ready.patch new file mode 100644 index 0000000000..52b0da1183 --- /dev/null +++ b/meta-openmoko/packages/libgsmd/libgsmd/getopt-wait-interpreter-ready.patch @@ -0,0 +1,57 @@ +Index: gsm/src/gsmd/gsmd.c +=================================================================== +--- gsm.orig/src/gsmd/gsmd.c 2007-06-03 11:57:43.000000000 +0200 ++++ gsm/src/gsmd/gsmd.c 2007-06-03 11:57:45.000000000 +0200 +@@ -311,6 +311,7 @@ + { "leak-report", 0, NULL, 'L' }, + { "vendor", 1, NULL, 'v' }, + { "machine", 1, NULL, 'm' }, ++ { "wait", 1, NULL, 'w' }, + { 0, 0, 0, 0 } + }; + +@@ -333,6 +334,7 @@ + "\t-l file\t--logfile file\tSpecify a logfile to log to\n" + "\t-v\t--vendor v\tSpecify GSM modem vendor plugin\n" + "\t-m\t--machine m\tSpecify GSM modem machine plugin\n" ++ "\t-w\t--wait m\tWait for the AT Interpreter Ready message\n" + ); + } + +@@ -362,6 +364,7 @@ + char *logfile = "syslog"; + char *vendor_name = NULL; + char *machine_name = NULL; ++ int wait = -1; + + signal(SIGTERM, sig_handler); + signal(SIGINT, sig_handler); +@@ -374,7 +377,7 @@ + print_header(); + + /*FIXME: parse commandline, set daemonize, device, ... */ +- while ((argch = getopt_long(argc, argv, "FVLdhp:s:l:v:m:", opts, NULL)) != -1) { ++ while ((argch = getopt_long(argc, argv, "FVLdhp:s:l:v:m:w:", opts, NULL)) != -1) { + switch (argch) { + case 'V': + /* FIXME */ +@@ -411,6 +414,9 @@ + case 'm': + machine_name = optarg; + break; ++ case 'w': ++ wait = atoi(optarg); ++ break; + } + } + +@@ -455,6 +461,9 @@ + exit(1); + } + ++ if (wait >= 0) ++ g.interpreter_ready = !wait; ++ + if (atcmd_init(&g, fd) < 0) { + fprintf(stderr, "can't initialize UART device\n"); + exit(1); diff --git a/meta-openmoko/packages/libgsmd/libgsmd/gsmd b/meta-openmoko/packages/libgsmd/libgsmd/gsmd new file mode 100644 index 0000000000..5c78e8178a --- /dev/null +++ b/meta-openmoko/packages/libgsmd/libgsmd/gsmd @@ -0,0 +1,106 @@ +#!/bin/sh +# +# gsmd This shell script starts and stops gsmd. +# +# chkconfig: 345 90 40 +# description: Gsmd manages access to a serial- or USB-connected GSM +# processname: gsmd + +# Source configuration +. /etc/default/gsmd + +# Source function library. +#. /etc/rc.d/init.d/functions + +RETVAL=0 +prog="gsmd" + +start() { + # Hack for broken uboot and/or kernel on the neo1973 + dmesg -n1 + + if [ -n "${GSM_POW}" ] + then + if [ -e "${GSM_POW}" ] + then + echo -n "Powering up GSM device..." + echo "1" > ${GSM_POW} + sleep 1 + echo "done" + else + echo "GSM device not found. Aborting startup" + return false + fi + fi + # Start daemons. + echo -n "Starting $prog: " + # We don't use the daemon function here because of a known bug + # in initlog -- it spuriously returns a nonzero status when + # starting daemons that fork themselves. See + # http://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=130629 + # for discussion. Fortunately: + # + # 1. gsmd startup can't fail, or at least not in the absence of + # much larger resource-exhaustion problems that would be very obvious. + # + # 2. We don't need all the logging crud that daemon/initlog sets + # up -- gsmd does its own syslog calls. + # + if [ -e "${GSM_DEV}" ] + then + gsmd -p ${GSM_DEV} ${GSMD_OPTS} >/tmp/gsm.log 2>&1 & + echo "success" + else + # User needs to symlink ${GPS_DEV} to the right thing + echo "No ${GSM_DEV} device, aborting gsmd startup." + fi + RETVAL=$? + echo + [ $RETVAL -eq 0 ] && touch /var/lock/subsys/gsmd + return $RETVAL +} + +stop() { + # Stop daemons. + echo -n "Shutting down $prog: " + killall gsmd +# killproc gsmd + RETVAL=$? + echo + if [ $RETVAL -eq 0 ] + then + rm -f /var/lock/subsys/gsmd; + fi + return $RETVAL +} + +# See how we were called. +case "$1" in + start) + start + ;; + stop) + stop + ;; + restart|reload) + stop + start + RETVAL=$? + ;; + condrestart) + if [ -f /var/lock/subsys/gsmd ]; then + stop + start + RETVAL=$? + fi + ;; + status) +# status gsmd +# RETVAL=$? + ;; + *) + echo "Usage: $0 {start|stop|restart|condrestart|status}" + exit 1 +esac + +exit $RETVAL diff --git a/meta-openmoko/packages/libgsmd/libgsmd/htcuniversal/default b/meta-openmoko/packages/libgsmd/libgsmd/htcuniversal/default new file mode 100644 index 0000000000..b09d433d1e --- /dev/null +++ b/meta-openmoko/packages/libgsmd/libgsmd/htcuniversal/default @@ -0,0 +1,10 @@ +# gsmd This shell script configures for the gsmd init script. + +GSMD_OPTS="-s 115200 -F -w 1" + +# If your GSM device needs to be powered up, uncomment and modify the next line +#GSM_POW="/sys/bus/platform/devices/gta01-pm-gsm.0/power_on" + +# this should be in a common /etc/default/serial, together +# with BT_DEV, and IR_DEV +GSM_DEV="/dev/ttyS0" diff --git a/meta-openmoko/packages/libgsmd/libgsmd/magician/default b/meta-openmoko/packages/libgsmd/libgsmd/magician/default new file mode 100644 index 0000000000..523d0b9479 --- /dev/null +++ b/meta-openmoko/packages/libgsmd/libgsmd/magician/default @@ -0,0 +1,10 @@ +# gsmd This shell script configures for the gsmd init script. + +GSMD_OPTS="-s 115200 -F" + +# If your GSM device needs to be powered up, uncomment and modify the next line +#GSM_POW="/sys/bus/platform/devices/gta01-pm-gsm.0/power_on" + +# this should be in a common /etc/default/serial, together +# with BT_DEV, and IR_DEV +GSM_DEV="/dev/ttyS1" diff --git a/meta-openmoko/packages/libgsmd/libgsmd/no-version.patch b/meta-openmoko/packages/libgsmd/libgsmd/no-version.patch new file mode 100644 index 0000000000..1334b32a99 --- /dev/null +++ b/meta-openmoko/packages/libgsmd/libgsmd/no-version.patch @@ -0,0 +1,22 @@ +--- gsm.orig/src/gsmd/Makefil.am 2007-08-01 23:35:03.000000000 +0200 ++++ gsm/src/gsmd/Makefile.am 2007-08-01 23:35:15.000000000 +0200 +20c20 +< libgsmd_machine_generic_la_LDFLAGS = -module +--- +> libgsmd_machine_generic_la_LDFLAGS = -module -avoid-version +22c22 +< libgsmd_machine_tihtc_la_LDFLAGS = -module +--- +> libgsmd_machine_tihtc_la_LDFLAGS = -module -avoid-version +25c25 +< libgsmd_vendor_ti_la_LDFLAGS = -module +--- +> libgsmd_vendor_ti_la_LDFLAGS = -module -avoid-version +27c27 +< libgsmd_vendor_tihtc_la_LDFLAGS = -module +--- +> libgsmd_vendor_tihtc_la_LDFLAGS = -module -avoid-version +29c29 +< libgsmd_vendor_qc_la_LDFLAGS = -module +--- +> libgsmd_vendor_qc_la_LDFLAGS = -module -avoid-version diff --git a/meta-openmoko/packages/libgsmd/libgsmd/tihtc-csq-fix.patch b/meta-openmoko/packages/libgsmd/libgsmd/tihtc-csq-fix.patch new file mode 100644 index 0000000000..3346d85809 --- /dev/null +++ b/meta-openmoko/packages/libgsmd/libgsmd/tihtc-csq-fix.patch @@ -0,0 +1,27 @@ +Index: gsm/src/gsmd/vendor_tihtc.c +=================================================================== +--- gsm.orig/src/gsmd/vendor_tihtc.c 2007-06-03 16:26:39.000000000 +0200 ++++ gsm/src/gsmd/vendor_tihtc.c 2007-06-03 16:26:41.000000000 +0200 +@@ -90,6 +90,8 @@ + struct gsmd_evt_auxdata *aux; + struct gsmd_ucmd *ucmd = usock_build_event(GSMD_MSG_EVENT, GSMD_EVT_SIGNAL, + sizeof(*aux)); ++ static int rssi_table[] = { 0,5,10,15,20,25,99 }; ++ unsigned int i; + + DEBUGP("entering htccsq_parse param=`%s'\n", param); + if (!ucmd) +@@ -98,9 +100,10 @@ + + aux = (struct gsmd_evt_auxdata *) ucmd->buf; + +- /* FIXME: contains values 1-5, should be mapped to 0-31 somehow? */ +- /* 2 --> 11 */ +- aux->u.signal.sigq.rssi = atoi(buf); ++ i = atoi(buf); ++ if (i > 6) ++ i = 6; ++ aux->u.signal.sigq.rssi = rssi_table[atoi(buf)]; + aux->u.signal.sigq.ber = 99; + + DEBUGP("sending EVT_SIGNAL\n"); diff --git a/meta-openmoko/packages/libgsmd/libgsmd/universal-wcdma.patch b/meta-openmoko/packages/libgsmd/libgsmd/universal-wcdma.patch new file mode 100644 index 0000000000..350b6aba4d --- /dev/null +++ b/meta-openmoko/packages/libgsmd/libgsmd/universal-wcdma.patch @@ -0,0 +1,20 @@ +Index: gsm/src/gsmd/vendor_qc.c +=================================================================== +--- gsm.orig/src/gsmd/vendor_qc.c 2007-08-01 23:35:03.000000000 +0200 ++++ gsm/src/gsmd/vendor_qc.c 2007-08-01 23:35:15.000000000 +0200 +@@ -69,8 +69,15 @@ + return -EIO; + } + ++static int wcdma_parse(char *buf, int len, const char *param, ++ struct gsmd *gsmd) ++{ ++ return 0; ++} ++ + static const struct gsmd_unsolicit qc_unsolicit[] = { + { "@HTCCSQ", &htccsq_parse }, /* Signal Quality */ ++ { "[WCDMA]", &wcdma_parse }, /* ignore [WCDMA] messages */ + + /* FIXME: parse the below and generate the respective events */ + diff --git a/meta-openmoko/packages/libgsmd/libgsmd_svn.bb b/meta-openmoko/packages/libgsmd/libgsmd_svn.bb new file mode 100644 index 0000000000..8cc6233aae --- /dev/null +++ b/meta-openmoko/packages/libgsmd/libgsmd_svn.bb @@ -0,0 +1,43 @@ +DESCRIPTION = "GSM libraries and daemons implementing the 07.10 specification" +HOMEPAGE = "http://www.openmoko.org" +LICENSE = "GPL" +SECTION = "libs/gsm" +PROVIDES += "gsmd" +PV = "0.0+svn${SRCDATE}" +PR = "r16" + +SRC_URI = "svn://svn.openmoko.org/trunk/src/target;module=gsm;proto=http \ + file://gsmd \ + file://default \ + file://getopt-wait-interpreter-ready.patch;patch=1 \ + file://tihtc-csq-fix.patch;patch=1 \ + file://universal-wcdma.patch;patch=1 \ + file://no-version.patch;patch=1" + +S = "${WORKDIR}/gsm" + +inherit autotools pkgconfig update-rc.d + +INITSCRIPT_NAME = "gsm" +INITSCRIPT_PARAMS = "defaults 35" + +do_stage() { + autotools_stage_all +} + +do_install_append() { + install -d ${D}/${sysconfdir}/init.d + install -m 0755 ${WORKDIR}/gsmd ${D}/${sysconfdir}/init.d/gsm + install -d ${D}/${sysconfdir}/default + install ${WORKDIR}/default ${D}/${sysconfdir}/default/gsmd +} + +PACKAGES =+ "${PN}-tools gsmd gsmd-plugins" +RDEPENDS_${PN} = "gsmd" +RRECOMMENDS_gsmd = "gsmd-plugins" +FILES_${PN}-tools = "${bindir}/*" +FILES_gsmd = "${sbindir}/gsmd ${sysconfdir}" +FILES_gsmd-plugins = "${libdir}/gsmd/*.so*" +FILES_${PN}-dbg += "${libdir}/gsmd/.debug/*.so" + +PACKAGES_DYNAMIC = "libgsmd* gsmd" |