path: root/src/host/osmocon
AgeCommit message (Collapse)AuthorFilesLines
2020-11-11Use osmo_fd_*_{disable,enable}Harald Welte1-14/+14
Change-Id: I65d37821873767e61a7eca029f9b30938a299683 Depends: libosmocore.git Idb89ba7bc7c129a6304a76900d17f47daf54d17d
2020-10-25osmocon: More decoding of tpu_debug (on compal/rffe_dualband)Harald Welte1-1/+61
Let's give a more human-readable decode of the TPU instructions, naming the TSPACT pin names as well as the device_id/strobe. Change-Id: Iac1ac74ac3e41cff9d3d347a167b43af58cc6e59
2020-10-18Use osmo_fd_setup() whenever applicable.Harald Welte1-10/+5
Change-Id: If9b636c295fc6b5349a54c70662f09efa616ee63
2020-10-18Use OSMO_FD_* instead of deprecated BSC_FD_*Harald Welte1-18/+18
Change-Id: Ibf64b18288b9109927035f650d6ef7ad9f15d688
2019-07-21osmocon: Check write() return codeHarald Welte1-0/+2
Change-Id: I61d8f104a4d2558fd5b6fb34c7f2fd6c13354c12 Closes: CID#198567
2019-07-21osmocon: Add missing check for fstat() return valueHarald Welte1-0/+5
Change-Id: Ibef6ee00eb41e16d2ef52931f8c22562090cd1ee Closes: CID#198570
2019-07-21osmocon: Fix file descriptor + mem leak in error pathHarald Welte1-0/+3
Change-Id: I42ceed662889084783dc89f4ca39c3852428d108 Closes: CID#198539
2019-07-21osmocon: Fix fd leak in error path of read_file()Harald Welte1-0/+1
Change-Id: Iaae407658df184277f6e6e07d6a48d8b5c75587b Closes: CID#198552
2019-07-21osmocon: Fix out-of-bounds for partial reads in un_tool_read()Harald Welte1-2/+2
"uint8_t buf[4096]; ... &buf + 1" renders an offset of 4096, and not 1! Change-Id: Ie1407371fe949c3d5746b9fdc32ececc9443692b Closes: CID#198580
2018-11-19osmocon: log error cause for socket openingMax1-1/+2
Change-Id: I2f871cb16e5e1033e42863a9e12459057004782c
2018-10-26Report socket path on errorsMax1-1/+1
Change-Id: Ib63e1205d7b845c8779eb511635f26bae3a18085
2018-09-06osmoload: Use osmo_sock_unix_init_ofd() from libosmocoreHarald Welte1-20/+4
We don't need to hand-code unix domain socket initialization but can simply use our library function for it. As an added benefit, the library code already contains corner case handling for non-NUL terminated unix domain socket path. Change-Id: Iedcec4591cf0fcbd6f956ed022169eae10a9b16e
2018-09-06osmocon: Use osmo_sock_unix_init_ofd() from libosmocoreHarald Welte1-41/+4
We don't need to hand-code unix domain socket initialization but can simply use our library function for it. As an added benefit, the library code already contains corner case handling for non-NUL terminated unix domain socket path. Change-Id: I3ab69a971be555c9f9b5b7a7e5da53008a119504
2018-09-06osmocon: Add --enable-{werror,sanitize} configure flagsHarald Welte1-0/+27
Change-Id: I6a69ca514406fa18684ca2621be45f87ee8d64a4
2018-08-24osmocon: fix read buffer overrun in romload_prepare_block()Stefan Sperling1-1/+1
Address sanitizer triggered when trying to chainload firmware: ==18466==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x631000027850 at pc 0x7f5b94cfb733 bp 0x7ffe33e1ae30 sp 0x7ffe33e1a5d8 READ of size 1014 at 0x631000027850 thread T0 #0 0x7f5b94cfb732 (/usr/lib/x86_64-linux-gnu/ #1 0x563db4293e6e in memcpy /usr/include/x86_64-linux-gnu/bits/string_fortified.h:34 #2 0x563db4293e6e in romload_prepare_block osmocom-bb/src/host/osmocon/osmocon.c:473 #3 0x563db429541f in handle_read_romload osmocom-bb/src/host/osmocon/osmocon.c:959 #4 0x563db429541f in serial_read osmocom-bb/src/host/osmocon/osmocon.c:1168 #5 0x7f5b94722c83 in osmo_fd_disp_fds libosmocore/src/select.c:217 #6 0x7f5b94722f84 in osmo_select_main libosmocore/src/select.c:257 #7 0x563db4293b1c in main osmocom-bb/src/host/osmocon/osmocon.c:1525 #8 0x7f5b942b9b96 in __libc_start_main (/lib/x86_64-linux-gnu/ #9 0x563db4293c79 in _start (prefix/sbin/osmocon+0x1c79) 0x631000027850 is located 0 bytes to the right of 77904-byte region [0x631000014800,0x631000027850) allocated by thread T0 here: #0 0x7f5b94d60b50 in __interceptor_malloc (/usr/lib/x86_64-linux-gnu/ #1 0x563db4294d65 in read_file osmocom-bb/src/host/osmocon/osmocon.c:314 Change-Id: Ie2955e11dd1af75574536774ef7ddf88ddf1fe8b
2018-08-23osmocon: fix use of an initialized variableStefan Sperling1-1/+2
osmocon.c: In function ‘read_file’: osmocon.c:317:3: warning: ‘fd’ may be used uninitialized in this function Change-Id: If07c58d5b55c18c05345607064eace02748935f8
2018-06-13osmoload: Set compiler attr to unused functionPau Espin Pedrol1-1/+1
Function is not removed as documentation of the load process capabilities. Change-Id: I8e838cbb5ae7c9a2f4d0e249fc14f7cbcbc2cb07
2018-06-13osmocon: Set compiler attr to unused variablesPau Espin Pedrol1-2/+2
Variables are not removed as they document the commands of the propietary romloader. Let's mark them as unused to avoid compilation warnings. Change-Id: If4c6814ada85956975e687eb43dcfd4ad70b8b94
2018-06-12osmocon: Fix printf formatPau Espin Pedrol1-1/+1
Fixes compilation warning: osmocon.c:650:21: warning: format ‘%u’ expects argument of type ‘unsigned int’, but argument 3 has type ‘long int’ [-Wformat=] printf("%u bytes (%u/%u)\n", rc, dnload.write_ptr -, ~^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ %lu Change-Id: I1e9e10e756d8a612425ee71f4ac0139b2293d3bb
2018-06-12osmoload: Remove duplicate const keywordPau Espin Pedrol1-1/+1
Fixes compilation warning: warning: duplicate ‘const’ declaration specifier [-Wduplicate-decl-specifier] const uint8_t const *endptr = bufptr + len; ^~~~~ Change-Id: Ibafa439c9d7f7aab6d417eca5ff045766ac27b4f
2018-06-12osmocon: Call osmo_init_ignore_signals at startupPau Espin Pedrol1-0/+3
It disables undesirable signals such as SIGPIPE, which exits the program if the client connected to osmocon closes the connection and osmocon writes to the connection fd. After SIGPIPE is disabled, write returns -EPIPE. This is required to keep osmocon running for BTS_Tests.ttcn TTCN3 tests. Change-Id: Id664ca0fadd3a8b3cf4b78bb868b3d78d2354544
2018-05-22osmocon: Fix build using different pathPau Espin Pedrol1-3/+3
Change-Id: I1a322e364612976f3d797f25e57ccc7c2354bd5e
2017-05-24osmocon.c: strip unused variableVadim Yanitskiy1-3/+2
Change-Id: I295785295c108798e0c235e78bd8fd8f3c585d16
2013-06-19osmocon: Improve performance by handling several serial bytes at a timeAndreas Eversberg1-8/+19
2013-05-23host/osmocon: fix some printf format specifier in handle_write_dnloadBhaskar1-1/+1
From: Bhaskar <> Signed-off-by: Sylvain Munaut <>
2013-05-23osmoload: Fix fall-out from msgb_get() / msgb_pull() transitionBhaskar1-1/+1
Bugfix in Osmoload.c: Assigning correct value to data pointer in LOADER_MEM_READ. Wrong value was introduced in last update when msgb_get() was replaced by msgb_pull() which returns end of data instead of start of data.
2013-04-07osmocon: embed chainloaderSteve Markgraf1-44/+65
This allows to directly load highram-images on compal phones with the commandline-switch -c. Signed-off-by: Steve Markgraf <>
2013-01-05osmocon: make romloader output much less verboseSteve Markgraf1-20/+5
Most of the output was only for debug purposes anyway. Signed-off-by: Steve Markgraf <>
2012-09-08use msgb_pull() to get bytes from start of message, not msgb_get()Harald Welte1-26/+26
msgb_get() is for getting bytes from the end of a message, but it was broken in libosmocore for a long time (until it was fixed today).
2012-02-08host/osmocon: allow uploading of files > 64kb in romload-modeSteve Markgraf1-1/+1
Signed-off-by: Steve Markgraf <>
2011-12-14host/osmocon: correct parsing of -mAlexander Huemer1-2/+3
Written-by: Alexander Huemer <> Signed-off-by: Sylvain Munaut <>
2011-11-06osmocom: Address warning about aliasingHolger Hans Peter Freyther1-1/+2
We alias the uint8_t buf[..] to a uint16_t* which is violating the aliases rule of C. Use an explicit memcpy to copy the first two byte of the buffer. GCC 4.6.2 (debian) is clever enough to use a normal load does not generate a memcpy call. osmocon.c: In function ‘un_tool_read’: osmocon.c:1239:2: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
2011-11-06misc: u_intX -> uintX in the host directoryHolger Hans Peter Freyther1-2/+2
Use C99 stdint.h for the inttypes.
2011-09-05host/osmocon: make auto-reload/reboot feature work in chainloading-modeSteve Markgraf1-2/+17
Signed-off-by: Steve Markgraf <>
2011-09-02host/osmocon: Make use of the libosmcore serial helpersSylvain Munaut1-72/+10
Signed-off-by: Sylvain Munaut <>
2011-07-16osmocon: if we ignore a return value, we don't need to assign it to a variableHarald Welte1-3/+1
2011-07-16osmocon: get rid of some Smash warningsHarald Welte1-6/+6
2011-05-15src: use namespace prefix osmo_* for crc16 functionsPablo Neira Ayuso1-4/+4
Summary of changes: s/crc16_table/osmo_crc16_table/g s/crc16/osmo_crc16/g s/crc16_byte/osmo_crc16_byte/g
2011-05-15src: use namespace prefix osmo_* for utilsPablo Neira Ayuso2-9/+9
Summary of changes: s/bcd2char/osmo_bcd2char/g s/char2bcd/osmo_char2bcd/g s/hexparse/osmo_hexparse/g s/hexdump/osmo_hexdump/g s/hexdump_nospc/osmo_hexdump_nospc/g s/ubit_dump/osmo_ubit_dump/g s/static_assert/osmo_static_assert/g
2011-05-15src: use namespace prefix osmo_fd* and osmo_select*Pablo Neira Ayuso2-17/+17
Summary of changes: s/struct bsc_fd/struct osmo_fd/g s/bsc_register_fd/osmo_fd_register/g s/bsc_unregister_fd/osmo_fd_unregister/g s/bsc_select_main/osmo_select_main/g
2011-05-15src: use namespace prefix osmo_timer*Pablo Neira Ayuso2-13/+13
Summary of changes: s/struct timer_list/struct osmo_timer_list/g s/bsc_add_timer/osmo_timer_add/g s/bsc_schedule_timer/osmo_timer_schedule/g s/bsc_del_timer/osmo_timer_del/g s/bsc_timer_pending/osmo_timer_pending/g s/bsc_nearest_timer/osmo_timers_nearest/g s/bsc_prepare_timers/osmo_timers_prepare/g s/bsc_update_timers/osmo_timers_update/g s/bsc_timer_check/osmo_timers_check/g
2011-04-26src: use new libosmogsm and include/osmocom/[gsm|core] path to headersPablo Neira Ayuso3-18/+18
This patch changes include paths to get osmocom-bb working with the current libosmocore tree. Among all these renames, you can notice several tweaks that I added on purpose, and that require some explanation, they are: * hexdump() in osmocon.c and osmoload.c has been renamed to avoid clashing with hexdump() defined in libosmocore. * gsmmap now depends on libosmogsm. Actually I had to cleanup because I was experiencing weird linking problems, probably due to a bug in the autotools. With the change included in this patch, I got it compiled and linked here correctly. This patch has been tested with the phone Motorola C123 and the following images files: * firmware/board/compal_e88/hello_world.compalram.bin * firmware/board/compal_e88/layer1.compalram.bin Using the osmocon, bcch_scan and mobile tools. Signed-off-by: Pablo Neira Ayuso <>
2010-11-17osmocon: make beacon interval configurable via cmdlineAlex Badea1-10/+16
Beacons with the default 50 mS interval are too far apart to be picked up by the OpenMoko gta0x Calypso chip. Make them configurable via a -i commandline argument. As recommended in the OpenMoko wiki[1], an interval of 13 mS works. [1] (-od fluid argument) Signed-off-by: Alex Badea <>
2010-10-03osmoload.c: Cast to uint8_t from char* to fix a compiler warningHolger Hans Peter Freyther1-2/+2
2010-10-03osmocom.c: rc is not assigned and contains garbage, return 0.Holger Hans Peter Freyther1-2/+2
2010-10-03osmocon.c: Use C99 inttypes instead of u_intX_t.Holger Hans Peter Freyther1-5/+5
2010-09-14misc: update .gitignore filesSylvain Munaut1-2/+28
Signed-off-by: Sylvain Munaut <>
2010-07-20[osmocon] add a chainloading mode for the compal ramloaderSteve Markgraf1-6/+27
The idea is to load a small application to the phone, which activates and executes the Calypso romloader. The payload itself then is loaded with the romloader, bypassing the magic and the resulting size limit on the C139/C140 and J100i. Signed-off-by: Steve Markgraf <>
2010-07-20loader: meaner. now supports address ranges for all relevant flash ↵Ingo Albrecht1-116/+274
operations. reports better.
2010-07-20osmoload: better messageIngo Albrecht1-1/+1