chromiumos/platform/libqmi.git
2 years agoUpdate .gitignore 85/19985/3 factory-2268.16.B factory-2305.B factory-2338.B factory-2368.B factory-2394.B factory-2460.B factory-2475.B factory-2569.B factory-2717.B factory-2723.14.B firmware-butterfly-2788.B firmware-link-2348.B firmware-link-2695.2.B firmware-link-2695.B firmware-parrot-2685.B firmware-snow-2695.90.B firmware-snow-2695.B firmware-stout-2817.B master release-R20-2268.B release-R21-2465.B release-R22-2723.B stabilize stabilize2
ttuttle [Tue, 10 Apr 2012 21:31:45 +0000 (17:31 -0400)]
Update .gitignore

BUG=None
TEST=make, git status shows no junk

Change-Id: Ibf4a7bde3294b41a4c52cb4363bd0f1da44b97b9

2 years agoMerge "Enforce no declarations after statements"
Gerrit [Tue, 17 Apr 2012 18:36:35 +0000 (11:36 -0700)]
Merge "Enforce no declarations after statements"

2 years agoMerge "qmiwds: Add service and initial methods"
Gerrit [Tue, 17 Apr 2012 18:36:35 +0000 (11:36 -0700)]
Merge "qmiwds: Add service and initial methods"

2 years agoMerge "Redesign requests, add callbacks, add power callback"
Gerrit [Mon, 16 Apr 2012 22:43:38 +0000 (15:43 -0700)]
Merge "Redesign requests, add callbacks, add power callback"

2 years agoEnforce no declarations after statements 84/19984/2
ttuttle [Tue, 10 Apr 2012 21:25:51 +0000 (17:25 -0400)]
Enforce no declarations after statements

BUG=None
TEST=still compiles

Change-Id: I1518552b80a25c8619fb70f4d8c2af76f5983dc5

2 years agoqmiwds: Add service and initial methods 62/19762/3
ttuttle [Fri, 6 Apr 2012 17:43:17 +0000 (13:43 -0400)]
qmiwds: Add service and initial methods

Add qmiwds, with packet status callback and start/stop network calls.

Rewrite listeners to be tied to a client and to allow things outside
qmidev to listen for things.

Fix a bug in hexdump (negative numbers printed as ffffffxx).

Add power_stress_test and start_network_stress_test.

BUG=chromium-os:28021
TEST=start_network_stress_test

Change-Id: I8b305892741df4126b77474bf42f683892793b12

2 years agoRedesign requests, add callbacks, add power callback 65/19465/2
ttuttle [Mon, 2 Apr 2012 15:54:03 +0000 (11:54 -0400)]
Redesign requests, add callbacks, add power callback

First, redesign clients and requests to have more state stored in
the qmidev.  This gives us a way to cancel them later (although we
don't yet) and gives us a place to register for event messages.

Add a way to register for event messages on a client.

Add the power callback, and a test for it.

BUG=chromium-os:28018,chromium-os:28019
TEST=power_test

Change-Id: Ie120327fa56ea4edeac7df3d291242701efd17f0

2 years ago[libqmi] add OWNERS 52/19752/2
Elly Jones [Fri, 6 Apr 2012 17:22:20 +0000 (13:22 -0400)]
[libqmi] add OWNERS

BUG=chromium-os:22007
TEST=None

Change-Id: I0de76a4120c9982a6cf614212be1b6237bae4c5a
Signed-off-by: Elly Jones <ellyjones@chromium.org>
2 years agoqmidev: add void requests 81/19181/3 release-R19-2046.B
ttuttle [Tue, 27 Mar 2012 21:00:28 +0000 (17:00 -0400)]
qmidev: add void requests

Add a shortcut for making requests that don't return anything but a
result code.

BUG=None
TEST=still work

Change-Id: I4c291c087c377aec39f1a44004df4cd594915f17

2 years agoqmidms: get/set operating mode ("power") requests 19/19119/3
ttuttle [Mon, 26 Mar 2012 21:18:50 +0000 (17:18 -0400)]
qmidms: get/set operating mode ("power") requests

Implement requests to get and set the device's operating mode.

BUG=chromium-os:28019
TEST=manual, works

Change-Id: I24a42ad8e8c270dfa64eeb560856cdeb0eb555b9

2 years agolibqmi: error cleanup 13/19113/2
ttuttle [Mon, 26 Mar 2012 19:35:34 +0000 (15:35 -0400)]
libqmi: error cleanup

Start putting together a set of actual errors instead of using the errno
ones.  Return them when it makes sense.

BUG=chromium-os:28024
TEST=on-device tests still work

Change-Id: Ibb86956eaad074c53f25eb382d90f9d4151a7879

2 years agoqmiinfo: add qmiinfo to test get_ids 90/18890/5
ttuttle [Thu, 22 Mar 2012 19:56:48 +0000 (15:56 -0400)]
qmiinfo: add qmiinfo to test get_ids

qmiinfo is a quick program that, right now, connects to the modem,
gets and displays the ESN, IMEI, and MEID, and disconnects.

Over time, I'll add more of the "get information from the card" calls
to it as a test (both for my own sake and as a debugging utility).

BUG=chromium-os:27303
TEST=will come later

Change-Id: I9a506b26fcdaa3f9099c2c97d27e55512ba5edcb

2 years agoqmidms: add DMS, with first call (get_ids) 89/18889/5
ttuttle [Thu, 22 Mar 2012 19:56:35 +0000 (15:56 -0400)]
qmidms: add DMS, with first call (get_ids)

BUG=chromium-os:27303
TEST=will come later

Change-Id: Ia85cc4873889e624deeb3267bc08c1e676485260

2 years agoqmimsg: make qmimsg_tlv_get return length if called with NULL value 88/18888/2
ttuttle [Thu, 22 Mar 2012 19:53:46 +0000 (15:53 -0400)]
qmimsg: make qmimsg_tlv_get return length if called with NULL value

BUG=chromium-os:27303
TEST=will come later

Change-Id: I1d1d204af8825aca8e6be5faae40389c409cfcad

2 years agoqmi: add qmi_tlv_strdup 87/18887/2
ttuttle [Thu, 22 Mar 2012 19:53:26 +0000 (15:53 -0400)]
qmi: add qmi_tlv_strdup

Add a function to copy a string out of a TLV, adding a \0 at the end.

BUG=chromium-os:27303
TEST=will come later

Change-Id: Ica7496ba4dd77599f37bb67069ea0fc0c2b55cce

2 years agoqmictl: Port to new request API 86/18886/2
ttuttle [Fri, 16 Mar 2012 23:47:50 +0000 (19:47 -0400)]
qmictl: Port to new request API

Port the two calls in CTL to the new request API.

BUG=chromium-os:27301
TEST=connect_disconnect_test and get_cid_stress_test pass

Change-Id: I3417590c08264580c334296b7e7a739b6aac6b39

2 years agoqmidev: New request API 85/18885/2
ttuttle [Fri, 16 Mar 2012 23:44:42 +0000 (19:44 -0400)]
qmidev: New request API

Add qmidev_{make,send}_request, which make sending a request to the card
simpler, and fill in real, incrementing transaction IDs.

BUG=chromium-os:27301
TEST=no code calls this yet; next commit will use and test it

Change-Id: I0fd6bbe1ca93d19a63ba742379b1caec250ec98a

2 years agoqmidev: Get and release clients on connect and disconnect 93/18393/2
ttuttle [Fri, 16 Mar 2012 15:58:01 +0000 (11:58 -0400)]
qmidev: Get and release clients on connect and disconnect

In preparation for being able to make requests on services other than CTL,
try to get client IDs for all the services when we connect, and release
them (at least, the ones we successfully got) when we disconnect.

Also, add a connect/disconnect test.

BUG=None
TEST=connect_disconnect_test, passes

Change-Id: Ie376f6ff75a4f628749b85f30e977b289e406647

2 years agoqmi: Move constants into qmi.h 92/18392/1 factory-1987.B
ttuttle [Thu, 15 Mar 2012 20:20:36 +0000 (16:20 -0400)]
qmi: Move constants into qmi.h

Start collecting QMI-related constants in qmi.h.

BUG=None
TEST=Still builds

Change-Id: I2f96d1ecf88ec895318f128f85b1098addc56ef5

2 years agolibqmi: make some qmi stuff more generic 44/18244/4
ttuttle [Thu, 15 Mar 2012 18:56:26 +0000 (14:56 -0400)]
libqmi: make some qmi stuff more generic

Make a generic qmi_result function to get the result code from a QMI
response, and factor out some common functionality in qmictl.

BUG=chromium-os:27301
TEST=qmidev_unittest

Change-Id: Ia973741c59e135dcc94a2c1c596f04e11f5e8b04

2 years agolibqmi: switch to glib for lists and malloc 54/18154/6
ttuttle [Thu, 15 Mar 2012 18:55:46 +0000 (14:55 -0400)]
libqmi: switch to glib for lists and malloc

glib has a linked list and malloc wrappers.  Use them.

BUG=None
TEST=qmidev_unittest still passes

Change-Id: I978bb24d16b10a8b1d8c7c386c677772fbebb5d8

2 years agolibqmi: get_cid_stress_test 93/17993/7
ttuttle [Thu, 15 Mar 2012 14:55:29 +0000 (10:55 -0400)]
libqmi: get_cid_stress_test

Write a stress test that connects to a device, gets and releases a
client ID on service 0x01 (WDS), and disconnects.

BUG=None
TEST=is one, passes

Change-Id: Icb177d5612482742ac80d64eccd72a79efa737cf

2 years agolibqmi: Add install rule to Makefile 92/17992/6
ttuttle [Wed, 14 Mar 2012 19:39:48 +0000 (15:39 -0400)]
libqmi: Add install rule to Makefile

BUG=None
TEST=modified ebuild installs properly

Change-Id: Ia0541696d894033d9e7903296cd455f2f60cc4f3

2 years agolibqmi: fail on positive errors in qmidev_{dis,}connect 91/17991/3
ttuttle [Tue, 13 Mar 2012 16:43:05 +0000 (12:43 -0400)]
libqmi: fail on positive errors in qmidev_{dis,}connect

dev_open can return positive errors, but qmidev_connect was only failing
on negative errors.

BUG=None
TEST=get_cid_stress_test (to come) no longer hangs

Change-Id: Ia038a0394326fd1806d23f5d60c2f2f5401cfcac

2 years agolibqmi: Build functionality of qrbs into qmidev. 90/17990/3
ttuttle [Mon, 12 Mar 2012 21:05:07 +0000 (17:05 -0400)]
libqmi: Build functionality of qrbs into qmidev.

The functionality that qrbs offer is annoyingly separate from the qmidev
object.  This patch gets rid of the separate object, moves the criteria
and callback into the arguments to qmidev_listen, and uses the return
value of the callback to implement persistence.

BUG=chromium-os:27299
TEST=test program still works

Change-Id: Ifca97090424209af0d96e31a6c939fc8743cfbe1

2 years agolibqmi: add .gitignore 36/17836/5
ttuttle [Mon, 12 Mar 2012 15:48:17 +0000 (11:48 -0400)]
libqmi: add .gitignore

BUG=None
TEST=make && make test, git status shows nothing to add

Change-Id: I2b3dcb9697c0385fd6d487d8c6357da1252f413a

2 years agolibqmi: new qmidev_unittest 35/17835/5
ttuttle [Tue, 13 Mar 2012 19:53:51 +0000 (15:53 -0400)]
libqmi: new qmidev_unittest

Write a new version of qmidev_unittest that tests connect and disconnect
callbacks, makes sure they're called from qmidev_process, and also uses
the mock device (since I can't just use /dev/null, because epoll won't add
it).

BUG=None
TEST=is a unittest, passes

Change-Id: Idb0c92ff48cc783c8f62d732d30264170a300b29

2 years agolibqmi: mock_open: mark device as open 34/17834/5
ttuttle [Mon, 12 Mar 2012 15:42:07 +0000 (11:42 -0400)]
libqmi: mock_open: mark device as open

We accidentally forgot to mark the mock device as open when we opened it.
This was tripping an assert failure when we tried to close it and thought
it was already closed.

BUG=None
TEST=New version of qmidev_unittest fails better

Change-Id: Ibb3d5f735847f2c416df264532ec76aeefb3c029

2 years agolibqmi: file_open: fail if qmidev_set_dev_fd fails 33/17833/5
ttuttle [Mon, 12 Mar 2012 15:40:24 +0000 (11:40 -0400)]
libqmi: file_open: fail if qmidev_set_dev_fd fails

We accidentally weren't checking the return value of qmidev_set_dev_fs.
It turns out that you can't add /dev/null to an epoll, but this tripped
an assert failure because we eventually called qmidev_clear_dev_fd without
having set the fd successfully.  With this patch, dev_open fails as it
should.

BUG=None
TEST=new version of qmidev_unittest fails better

Change-Id: Ic5746c976a3f74cb264c06a43a8846f97fd20219

2 years agolibqmi: poller: wait 0 instead of forever 32/17832/5
ttuttle [Mon, 12 Mar 2012 15:39:36 +0000 (11:39 -0400)]
libqmi: poller: wait 0 instead of forever

Don't wait forever for epoll if no events are available -- we should only
be epolling if something's already happened.

BUG=None
TEST=qmidev_process still works

Change-Id: I1253ba3524d5669baefb0a05f2c4af471111cbbc

2 years agolibqmi: Call connect and disconnect callbacks from qmidev_process 31/17831/5
ttuttle [Mon, 12 Mar 2012 14:31:00 +0000 (10:31 -0400)]
libqmi: Call connect and disconnect callbacks from qmidev_process

Use the new callback queue to call the result callbacks for connect and
disconnect from outside the initial call stack.

BUG=chromium-os:27559
TEST=qmidev_unittest still works

Change-Id: I045c52af046eb9686a19772e468fb6d6315323a2

2 years agolibqmi: Add a list of callbacks, and call them 26/17726/5
ttuttle [Fri, 9 Mar 2012 22:11:38 +0000 (17:11 -0500)]
libqmi: Add a list of callbacks, and call them

Add a list of callbacks to a qmidev, add a function to add one, and add a
function to call them.  Call them in qmidev_process.

This does not yet cause qmidev_process to be called when a callback is
added.  That will require some hackery with a pipe.

BUG=chromium-os:27559
TEST=qmidev_unittest :)  (only tests callbacks for now)

Change-Id: I627b19644d6236f1af0cc809a0286bb052181570

2 years agolibqmi: Generic linked list 06/17706/6
ttuttle [Fri, 9 Mar 2012 18:24:13 +0000 (13:24 -0500)]
libqmi: Generic linked list

Implement a generic linked list.

BUG=chromium-os:27558
TEST=list_unittest :)

Change-Id: Id4659936d4ba47dd353f3ce964e6bafcdfb42b39

2 years agolibqmi: Make qmimsg_tlv_get expect exact length. 07/17607/6
ttuttle [Thu, 8 Mar 2012 20:46:53 +0000 (15:46 -0500)]
libqmi: Make qmimsg_tlv_get expect exact length.

Since the most common case is that we know the exact size of a TLV we are
retrieving, and the message is invalid if the length is shorter, make
qmimsg_tlv_get take the exact size and return -EINVAL if the TLV found in
the message has a different length.

Add qmimsg_tlv_get_varlen that still takes a pointer to the length and
replaces it with the actual length of the TLV, or returns -ENOSPC if the
provided buffer was too *short*.

BUG=chromium-os:27443
TEST=my (as yet unpublished) test program still works

Change-Id: I98bbfefd41d4fd2f61c8c448a55db4e7ba87d11b

2 years agolibqmi: Initial commit 50/17350/11
ttuttle [Thu, 8 Mar 2012 20:46:21 +0000 (15:46 -0500)]
libqmi: Initial commit

This can send and receive QMI messages, and knows how to get and release
client IDs.  There's nothing useful of the public interface implemented
yet (you can create a qmidev, but not do anything with it).

BUG=chromium-os:27332
TEST=cros_workon_make works

Change-Id: I89462b48fa40f22023fe527611f476afd4c9c55e

2 years agolibqmi: add external header file 27/16727/3
ttuttle [Fri, 24 Feb 2012 18:57:35 +0000 (13:57 -0500)]
libqmi: add external header file

Change-Id: I116a25eb2b9013016e5443cc94e2651fc6140cf0