From 3026b93e266558671bd361b6c07546f8174974bc Mon Sep 17 00:00:00 2001 From: laforge Date: Sat, 10 Mar 2007 22:05:17 +0000 Subject: * include stdio from talloc.h * add new generic extended-response parser * add operator cache, using ext-resp-parser * add proper detection of supported %CPI modes and select highest available one * add %CTZV to vendor_ti init string git-svn-id: http://svn.openmoko.org/trunk/src/target/gsm@1316 99fdad57-331a-0410-800a-d7fa5415bdb3 --- include/gsmd/extrsp.h | 45 +++++++++++++++++++++++++++++++++++++++++++++ include/gsmd/gsmd.h | 2 ++ include/gsmd/talloc.h | 1 + 3 files changed, 48 insertions(+) create mode 100644 include/gsmd/extrsp.h (limited to 'include/gsmd') diff --git a/include/gsmd/extrsp.h b/include/gsmd/extrsp.h new file mode 100644 index 0000000..1f6e6a5 --- /dev/null +++ b/include/gsmd/extrsp.h @@ -0,0 +1,45 @@ +#ifndef _GSMD_EXTRSP_H +#define _GSMD_EXTRSP_H + +/* how many tokens (CSV items) can an extended response have, max */ +#define GSM_EXTRSP_MAX_TOKENS 16 + +/* how many individual sub-ranges can one range contain */ +#define GSM_EXTRSP_MAX_RANGES 16 + + +struct gsm_extrsp_range_item { + int min; + int max; +}; + +enum gsm_extrsp_tok_type { + GSMD_ECMD_RTT_NONE, + GSMD_ECMD_RTT_EMPTY, + GSMD_ECMD_RTT_NUMERIC, + GSMD_ECMD_RTT_STRING, + GSMD_ECMD_RTT_RANGE, +}; + +struct gsm_extrsp_tok { + enum gsm_extrsp_tok_type type; + union { + struct { + struct gsm_extrsp_range_item item[GSM_EXTRSP_MAX_RANGES]; + int num_items; + } range; + char string[64]; + int numeric; + } u; +}; + +struct gsm_extrsp { + unsigned int num_tokens; + struct gsm_extrsp_tok tokens[GSM_EXTRSP_MAX_TOKENS]; +}; + +extern int extrsp_supports(const struct gsm_extrsp *er, int index, int value); +extern struct gsm_extrsp *extrsp_parse(const void *ctx, const char *input); +extern void extrsp_dump(const struct gsm_extrsp *er); + +#endif diff --git a/include/gsmd/gsmd.h b/include/gsmd/gsmd.h index 9f865a0..044f65d 100644 --- a/include/gsmd/gsmd.h +++ b/include/gsmd/gsmd.h @@ -66,6 +66,8 @@ struct gsmd { struct llist_head busy_atcmds; /* our busy gsmd_atcmds */ struct gsmd_vendor_plugin *vendorpl; struct gsmd_device_state dev_state; + + struct llist_head operators; /* cached list of operator names */ }; struct gsmd_user { diff --git a/include/gsmd/talloc.h b/include/gsmd/talloc.h index 2cfd61a..7f4e925 100644 --- a/include/gsmd/talloc.h +++ b/include/gsmd/talloc.h @@ -26,6 +26,7 @@ /* nfsim additions */ #include +#include /* this is only needed for compatibility with the old talloc */ typedef void TALLOC_CTX; -- cgit v1.2.3