annotate rvinterf/include/limits.h @ 1011:6d9b10633f10 default tip

etmsync Pirelli IMEI retrieval: fix poor use of printf() Bug reported by Vadim Yanitskiy <fixeria@osmocom.org>: the construct where a static-allocated string was passed to printf() without any format arguments causes newer compilers to report a security problem. Given that formatted output is not needed here, just fixed string output, change printf() to fputs(), and direct the error message to stderr while at it.
author Mychaela Falconia <falcon@freecalypso.org>
date Thu, 23 May 2024 17:29:57 +0000
parents ca6e969be6ee
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
e7502631a0f9 initial import from freecalypso-sw rev 1033:5ab737ac3ad7
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1 /*
e7502631a0f9 initial import from freecalypso-sw rev 1033:5ab737ac3ad7
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2 * For sizing our buffers etc in the rvinterf suite, including the local
e7502631a0f9 initial import from freecalypso-sw rev 1033:5ab737ac3ad7
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
3 * UNIX domain socket protocol between rvinterf and fc-tmsh etc, we need
e7502631a0f9 initial import from freecalypso-sw rev 1033:5ab737ac3ad7
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
4 * to have some limits on the message sizes in both host->target and
e7502631a0f9 initial import from freecalypso-sw rev 1033:5ab737ac3ad7
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
5 * target->host directions.
e7502631a0f9 initial import from freecalypso-sw rev 1033:5ab737ac3ad7
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
6 *
e7502631a0f9 initial import from freecalypso-sw rev 1033:5ab737ac3ad7
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
7 * For the host->target direction, the choice of message size limit is
e7502631a0f9 initial import from freecalypso-sw rev 1033:5ab737ac3ad7
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
8 * easy: the packet Rx code in RVT on the target side also has a limit
e7502631a0f9 initial import from freecalypso-sw rev 1033:5ab737ac3ad7
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
9 * (quite naturally, as it needs to use a static buffer to reassemble
e7502631a0f9 initial import from freecalypso-sw rev 1033:5ab737ac3ad7
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
10 * incoming packets as they arrive at the UART in unpredictable interrupt-
e7502631a0f9 initial import from freecalypso-sw rev 1033:5ab737ac3ad7
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
11 * sized chunks), so we set our limit to match that in RVT.
e7502631a0f9 initial import from freecalypso-sw rev 1033:5ab737ac3ad7
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
12 */
e7502631a0f9 initial import from freecalypso-sw rev 1033:5ab737ac3ad7
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
13
e7502631a0f9 initial import from freecalypso-sw rev 1033:5ab737ac3ad7
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
14 #define MAX_PKT_TO_TARGET 255
e7502631a0f9 initial import from freecalypso-sw rev 1033:5ab737ac3ad7
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
15
e7502631a0f9 initial import from freecalypso-sw rev 1033:5ab737ac3ad7
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
16 /*
e7502631a0f9 initial import from freecalypso-sw rev 1033:5ab737ac3ad7
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
17 * In the other direction (target->host), there is no fixed limit
e7502631a0f9 initial import from freecalypso-sw rev 1033:5ab737ac3ad7
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
18 * definition easily visible in the target fw code: any fw component
e7502631a0f9 initial import from freecalypso-sw rev 1033:5ab737ac3ad7
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
19 * can call rvt_send_trace_cpy() or rvt_mem_alloc() followed by
e7502631a0f9 initial import from freecalypso-sw rev 1033:5ab737ac3ad7
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
20 * rvt_send_trace_no_cpy(), or some higher-level API that reduces to
e7502631a0f9 initial import from freecalypso-sw rev 1033:5ab737ac3ad7
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
21 * these functions, with a message of any size, subject only to memory
e7502631a0f9 initial import from freecalypso-sw rev 1033:5ab737ac3ad7
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
22 * limits, which obviously aren't as strict as a #define'd maximum
958
ca6e969be6ee rvinterf suite: raise MAX_PKT_FROM_TARGET to 1600
Mychaela Falconia <falcon@freecalypso.org>
parents: 0
diff changeset
23 * message size.
ca6e969be6ee rvinterf suite: raise MAX_PKT_FROM_TARGET to 1600
Mychaela Falconia <falcon@freecalypso.org>
parents: 0
diff changeset
24 *
ca6e969be6ee rvinterf suite: raise MAX_PKT_FROM_TARGET to 1600
Mychaela Falconia <falcon@freecalypso.org>
parents: 0
diff changeset
25 * With current FreeCalypso fw, unchanged from classic TCS211 in this
ca6e969be6ee rvinterf suite: raise MAX_PKT_FROM_TARGET to 1600
Mychaela Falconia <falcon@freecalypso.org>
parents: 0
diff changeset
26 * aspect, the largest RVTMUX packets emitted by the fw are G23M PS
ca6e969be6ee rvinterf suite: raise MAX_PKT_FROM_TARGET to 1600
Mychaela Falconia <falcon@freecalypso.org>
parents: 0
diff changeset
27 * primitives forwarded externally via GPF routing mechanism, and some
ca6e969be6ee rvinterf suite: raise MAX_PKT_FROM_TARGET to 1600
Mychaela Falconia <falcon@freecalypso.org>
parents: 0
diff changeset
28 * of them exceed our previous arbitrary limit of 512 bytes. However,
ca6e969be6ee rvinterf suite: raise MAX_PKT_FROM_TARGET to 1600
Mychaela Falconia <falcon@freecalypso.org>
parents: 0
diff changeset
29 * the largest output packet size that can be generated via this
ca6e969be6ee rvinterf suite: raise MAX_PKT_FROM_TARGET to 1600
Mychaela Falconia <falcon@freecalypso.org>
parents: 0
diff changeset
30 * mechanism equals the largest partition size in GPF partition pool
ca6e969be6ee rvinterf suite: raise MAX_PKT_FROM_TARGET to 1600
Mychaela Falconia <falcon@freecalypso.org>
parents: 0
diff changeset
31 * configuration, and that largest size is 1600 bytes. Hence we have
ca6e969be6ee rvinterf suite: raise MAX_PKT_FROM_TARGET to 1600
Mychaela Falconia <falcon@freecalypso.org>
parents: 0
diff changeset
32 * our answer as to what maximum packet size we need to support.
0
e7502631a0f9 initial import from freecalypso-sw rev 1033:5ab737ac3ad7
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
33 */
e7502631a0f9 initial import from freecalypso-sw rev 1033:5ab737ac3ad7
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
34
958
ca6e969be6ee rvinterf suite: raise MAX_PKT_FROM_TARGET to 1600
Mychaela Falconia <falcon@freecalypso.org>
parents: 0
diff changeset
35 #define MAX_PKT_FROM_TARGET 1600
0
e7502631a0f9 initial import from freecalypso-sw rev 1033:5ab737ac3ad7
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
36
e7502631a0f9 initial import from freecalypso-sw rev 1033:5ab737ac3ad7
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
37 /*
e7502631a0f9 initial import from freecalypso-sw rev 1033:5ab737ac3ad7
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
38 * Both limit definitions above counts all bytes between the opening and
e7502631a0f9 initial import from freecalypso-sw rev 1033:5ab737ac3ad7
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
39 * closing STX flags, but not DLEs inserted for binary transparency.
e7502631a0f9 initial import from freecalypso-sw rev 1033:5ab737ac3ad7
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
40 */