diff options
author | Ross Burton <ross@openedhand.com> | 2007-08-15 13:59:52 +0000 |
---|---|---|
committer | Ross Burton <ross@openedhand.com> | 2007-08-15 13:59:52 +0000 |
commit | 746fa2064973f28f2954338193dc4494d318698b (patch) | |
tree | 7246abef77b8da735827fda2622fc164254d21dc /meta-openmoko | |
parent | e1d82ea5e8e9e2cf2965f11c6a96d961031f709a (diff) | |
download | poky-746fa2064973f28f2954338193dc4494d318698b.tar.gz |
Move libgsmd from meta-extras to meta-openmoko
git-svn-id: https://svn.o-hand.com/repos/poky/trunk@2499 311d38ba-8fff-0310-9ca6-ca027cbcb966
Diffstat (limited to 'meta-openmoko')
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 @@ | |||
1 | # gsmd This shell script configures for the gsmd init script. | ||
2 | |||
3 | # If you must specify special options, uncomment and modify the next line | ||
4 | #GSMD_OPTS="-s 115200 -F" | ||
5 | |||
6 | # If your GSM device needs to be powered up, uncomment and modify the next line | ||
7 | #GSM_POW="/sys/bus/platform/devices/gta01-pm-gsm.0/power_on" | ||
8 | |||
9 | #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 @@ | |||
1 | # gsmd This shell script configures for the gsmd init script. | ||
2 | |||
3 | # If you must specify special options, uncomment and modify the next line | ||
4 | GSMD_OPTS="-s 115200 -F" | ||
5 | |||
6 | # If your GSM device needs to be powered up, uncomment and modify the next line | ||
7 | GSM_POW="/sys/bus/platform/devices/gta01-pm-gsm.0/power_on" | ||
8 | |||
9 | 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 @@ | |||
1 | Index: gsm/src/gsmd/gsmd.c | ||
2 | =================================================================== | ||
3 | --- gsm.orig/src/gsmd/gsmd.c 2007-06-03 11:57:43.000000000 +0200 | ||
4 | +++ gsm/src/gsmd/gsmd.c 2007-06-03 11:57:45.000000000 +0200 | ||
5 | @@ -311,6 +311,7 @@ | ||
6 | { "leak-report", 0, NULL, 'L' }, | ||
7 | { "vendor", 1, NULL, 'v' }, | ||
8 | { "machine", 1, NULL, 'm' }, | ||
9 | + { "wait", 1, NULL, 'w' }, | ||
10 | { 0, 0, 0, 0 } | ||
11 | }; | ||
12 | |||
13 | @@ -333,6 +334,7 @@ | ||
14 | "\t-l file\t--logfile file\tSpecify a logfile to log to\n" | ||
15 | "\t-v\t--vendor v\tSpecify GSM modem vendor plugin\n" | ||
16 | "\t-m\t--machine m\tSpecify GSM modem machine plugin\n" | ||
17 | + "\t-w\t--wait m\tWait for the AT Interpreter Ready message\n" | ||
18 | ); | ||
19 | } | ||
20 | |||
21 | @@ -362,6 +364,7 @@ | ||
22 | char *logfile = "syslog"; | ||
23 | char *vendor_name = NULL; | ||
24 | char *machine_name = NULL; | ||
25 | + int wait = -1; | ||
26 | |||
27 | signal(SIGTERM, sig_handler); | ||
28 | signal(SIGINT, sig_handler); | ||
29 | @@ -374,7 +377,7 @@ | ||
30 | print_header(); | ||
31 | |||
32 | /*FIXME: parse commandline, set daemonize, device, ... */ | ||
33 | - while ((argch = getopt_long(argc, argv, "FVLdhp:s:l:v:m:", opts, NULL)) != -1) { | ||
34 | + while ((argch = getopt_long(argc, argv, "FVLdhp:s:l:v:m:w:", opts, NULL)) != -1) { | ||
35 | switch (argch) { | ||
36 | case 'V': | ||
37 | /* FIXME */ | ||
38 | @@ -411,6 +414,9 @@ | ||
39 | case 'm': | ||
40 | machine_name = optarg; | ||
41 | break; | ||
42 | + case 'w': | ||
43 | + wait = atoi(optarg); | ||
44 | + break; | ||
45 | } | ||
46 | } | ||
47 | |||
48 | @@ -455,6 +461,9 @@ | ||
49 | exit(1); | ||
50 | } | ||
51 | |||
52 | + if (wait >= 0) | ||
53 | + g.interpreter_ready = !wait; | ||
54 | + | ||
55 | if (atcmd_init(&g, fd) < 0) { | ||
56 | fprintf(stderr, "can't initialize UART device\n"); | ||
57 | 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 @@ | |||
1 | #!/bin/sh | ||
2 | # | ||
3 | # gsmd This shell script starts and stops gsmd. | ||
4 | # | ||
5 | # chkconfig: 345 90 40 | ||
6 | # description: Gsmd manages access to a serial- or USB-connected GSM | ||
7 | # processname: gsmd | ||
8 | |||
9 | # Source configuration | ||
10 | . /etc/default/gsmd | ||
11 | |||
12 | # Source function library. | ||
13 | #. /etc/rc.d/init.d/functions | ||
14 | |||
15 | RETVAL=0 | ||
16 | prog="gsmd" | ||
17 | |||
18 | start() { | ||
19 | # Hack for broken uboot and/or kernel on the neo1973 | ||
20 | dmesg -n1 | ||
21 | |||
22 | if [ -n "${GSM_POW}" ] | ||
23 | then | ||
24 | if [ -e "${GSM_POW}" ] | ||
25 | then | ||
26 | echo -n "Powering up GSM device..." | ||
27 | echo "1" > ${GSM_POW} | ||
28 | sleep 1 | ||
29 | echo "done" | ||
30 | else | ||
31 | echo "GSM device not found. Aborting startup" | ||
32 | return false | ||
33 | fi | ||
34 | fi | ||
35 | # Start daemons. | ||
36 | echo -n "Starting $prog: " | ||
37 | # We don't use the daemon function here because of a known bug | ||
38 | # in initlog -- it spuriously returns a nonzero status when | ||
39 | # starting daemons that fork themselves. See | ||
40 | # http://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=130629 | ||
41 | # for discussion. Fortunately: | ||
42 | # | ||
43 | # 1. gsmd startup can't fail, or at least not in the absence of | ||
44 | # much larger resource-exhaustion problems that would be very obvious. | ||
45 | # | ||
46 | # 2. We don't need all the logging crud that daemon/initlog sets | ||
47 | # up -- gsmd does its own syslog calls. | ||
48 | # | ||
49 | if [ -e "${GSM_DEV}" ] | ||
50 | then | ||
51 | gsmd -p ${GSM_DEV} ${GSMD_OPTS} >/tmp/gsm.log 2>&1 & | ||
52 | echo "success" | ||
53 | else | ||
54 | # User needs to symlink ${GPS_DEV} to the right thing | ||
55 | echo "No ${GSM_DEV} device, aborting gsmd startup." | ||
56 | fi | ||
57 | RETVAL=$? | ||
58 | echo | ||
59 | [ $RETVAL -eq 0 ] && touch /var/lock/subsys/gsmd | ||
60 | return $RETVAL | ||
61 | } | ||
62 | |||
63 | stop() { | ||
64 | # Stop daemons. | ||
65 | echo -n "Shutting down $prog: " | ||
66 | killall gsmd | ||
67 | # killproc gsmd | ||
68 | RETVAL=$? | ||
69 | echo | ||
70 | if [ $RETVAL -eq 0 ] | ||
71 | then | ||
72 | rm -f /var/lock/subsys/gsmd; | ||
73 | fi | ||
74 | return $RETVAL | ||
75 | } | ||
76 | |||
77 | # See how we were called. | ||
78 | case "$1" in | ||
79 | start) | ||
80 | start | ||
81 | ;; | ||
82 | stop) | ||
83 | stop | ||
84 | ;; | ||
85 | restart|reload) | ||
86 | stop | ||
87 | start | ||
88 | RETVAL=$? | ||
89 | ;; | ||
90 | condrestart) | ||
91 | if [ -f /var/lock/subsys/gsmd ]; then | ||
92 | stop | ||
93 | start | ||
94 | RETVAL=$? | ||
95 | fi | ||
96 | ;; | ||
97 | status) | ||
98 | # status gsmd | ||
99 | # RETVAL=$? | ||
100 | ;; | ||
101 | *) | ||
102 | echo "Usage: $0 {start|stop|restart|condrestart|status}" | ||
103 | exit 1 | ||
104 | esac | ||
105 | |||
106 | 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 @@ | |||
1 | # gsmd This shell script configures for the gsmd init script. | ||
2 | |||
3 | GSMD_OPTS="-s 115200 -F -w 1" | ||
4 | |||
5 | # If your GSM device needs to be powered up, uncomment and modify the next line | ||
6 | #GSM_POW="/sys/bus/platform/devices/gta01-pm-gsm.0/power_on" | ||
7 | |||
8 | # this should be in a common /etc/default/serial, together | ||
9 | # with BT_DEV, and IR_DEV | ||
10 | 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 @@ | |||
1 | # gsmd This shell script configures for the gsmd init script. | ||
2 | |||
3 | GSMD_OPTS="-s 115200 -F" | ||
4 | |||
5 | # If your GSM device needs to be powered up, uncomment and modify the next line | ||
6 | #GSM_POW="/sys/bus/platform/devices/gta01-pm-gsm.0/power_on" | ||
7 | |||
8 | # this should be in a common /etc/default/serial, together | ||
9 | # with BT_DEV, and IR_DEV | ||
10 | 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 @@ | |||
1 | --- gsm.orig/src/gsmd/Makefil.am 2007-08-01 23:35:03.000000000 +0200 | ||
2 | +++ gsm/src/gsmd/Makefile.am 2007-08-01 23:35:15.000000000 +0200 | ||
3 | 20c20 | ||
4 | < libgsmd_machine_generic_la_LDFLAGS = -module | ||
5 | --- | ||
6 | > libgsmd_machine_generic_la_LDFLAGS = -module -avoid-version | ||
7 | 22c22 | ||
8 | < libgsmd_machine_tihtc_la_LDFLAGS = -module | ||
9 | --- | ||
10 | > libgsmd_machine_tihtc_la_LDFLAGS = -module -avoid-version | ||
11 | 25c25 | ||
12 | < libgsmd_vendor_ti_la_LDFLAGS = -module | ||
13 | --- | ||
14 | > libgsmd_vendor_ti_la_LDFLAGS = -module -avoid-version | ||
15 | 27c27 | ||
16 | < libgsmd_vendor_tihtc_la_LDFLAGS = -module | ||
17 | --- | ||
18 | > libgsmd_vendor_tihtc_la_LDFLAGS = -module -avoid-version | ||
19 | 29c29 | ||
20 | < libgsmd_vendor_qc_la_LDFLAGS = -module | ||
21 | --- | ||
22 | > 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 @@ | |||
1 | Index: gsm/src/gsmd/vendor_tihtc.c | ||
2 | =================================================================== | ||
3 | --- gsm.orig/src/gsmd/vendor_tihtc.c 2007-06-03 16:26:39.000000000 +0200 | ||
4 | +++ gsm/src/gsmd/vendor_tihtc.c 2007-06-03 16:26:41.000000000 +0200 | ||
5 | @@ -90,6 +90,8 @@ | ||
6 | struct gsmd_evt_auxdata *aux; | ||
7 | struct gsmd_ucmd *ucmd = usock_build_event(GSMD_MSG_EVENT, GSMD_EVT_SIGNAL, | ||
8 | sizeof(*aux)); | ||
9 | + static int rssi_table[] = { 0,5,10,15,20,25,99 }; | ||
10 | + unsigned int i; | ||
11 | |||
12 | DEBUGP("entering htccsq_parse param=`%s'\n", param); | ||
13 | if (!ucmd) | ||
14 | @@ -98,9 +100,10 @@ | ||
15 | |||
16 | aux = (struct gsmd_evt_auxdata *) ucmd->buf; | ||
17 | |||
18 | - /* FIXME: contains values 1-5, should be mapped to 0-31 somehow? */ | ||
19 | - /* 2 --> 11 */ | ||
20 | - aux->u.signal.sigq.rssi = atoi(buf); | ||
21 | + i = atoi(buf); | ||
22 | + if (i > 6) | ||
23 | + i = 6; | ||
24 | + aux->u.signal.sigq.rssi = rssi_table[atoi(buf)]; | ||
25 | aux->u.signal.sigq.ber = 99; | ||
26 | |||
27 | 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 @@ | |||
1 | Index: gsm/src/gsmd/vendor_qc.c | ||
2 | =================================================================== | ||
3 | --- gsm.orig/src/gsmd/vendor_qc.c 2007-08-01 23:35:03.000000000 +0200 | ||
4 | +++ gsm/src/gsmd/vendor_qc.c 2007-08-01 23:35:15.000000000 +0200 | ||
5 | @@ -69,8 +69,15 @@ | ||
6 | return -EIO; | ||
7 | } | ||
8 | |||
9 | +static int wcdma_parse(char *buf, int len, const char *param, | ||
10 | + struct gsmd *gsmd) | ||
11 | +{ | ||
12 | + return 0; | ||
13 | +} | ||
14 | + | ||
15 | static const struct gsmd_unsolicit qc_unsolicit[] = { | ||
16 | { "@HTCCSQ", &htccsq_parse }, /* Signal Quality */ | ||
17 | + { "[WCDMA]", &wcdma_parse }, /* ignore [WCDMA] messages */ | ||
18 | |||
19 | /* FIXME: parse the below and generate the respective events */ | ||
20 | |||
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 @@ | |||
1 | DESCRIPTION = "GSM libraries and daemons implementing the 07.10 specification" | ||
2 | HOMEPAGE = "http://www.openmoko.org" | ||
3 | LICENSE = "GPL" | ||
4 | SECTION = "libs/gsm" | ||
5 | PROVIDES += "gsmd" | ||
6 | PV = "0.0+svn${SRCDATE}" | ||
7 | PR = "r16" | ||
8 | |||
9 | SRC_URI = "svn://svn.openmoko.org/trunk/src/target;module=gsm;proto=http \ | ||
10 | file://gsmd \ | ||
11 | file://default \ | ||
12 | file://getopt-wait-interpreter-ready.patch;patch=1 \ | ||
13 | file://tihtc-csq-fix.patch;patch=1 \ | ||
14 | file://universal-wcdma.patch;patch=1 \ | ||
15 | file://no-version.patch;patch=1" | ||
16 | |||
17 | S = "${WORKDIR}/gsm" | ||
18 | |||
19 | inherit autotools pkgconfig update-rc.d | ||
20 | |||
21 | INITSCRIPT_NAME = "gsm" | ||
22 | INITSCRIPT_PARAMS = "defaults 35" | ||
23 | |||
24 | do_stage() { | ||
25 | autotools_stage_all | ||
26 | } | ||
27 | |||
28 | do_install_append() { | ||
29 | install -d ${D}/${sysconfdir}/init.d | ||
30 | install -m 0755 ${WORKDIR}/gsmd ${D}/${sysconfdir}/init.d/gsm | ||
31 | install -d ${D}/${sysconfdir}/default | ||
32 | install ${WORKDIR}/default ${D}/${sysconfdir}/default/gsmd | ||
33 | } | ||
34 | |||
35 | PACKAGES =+ "${PN}-tools gsmd gsmd-plugins" | ||
36 | RDEPENDS_${PN} = "gsmd" | ||
37 | RRECOMMENDS_gsmd = "gsmd-plugins" | ||
38 | FILES_${PN}-tools = "${bindir}/*" | ||
39 | FILES_gsmd = "${sbindir}/gsmd ${sysconfdir}" | ||
40 | FILES_gsmd-plugins = "${libdir}/gsmd/*.so*" | ||
41 | FILES_${PN}-dbg += "${libdir}/gsmd/.debug/*.so" | ||
42 | |||
43 | PACKAGES_DYNAMIC = "libgsmd* gsmd" | ||