Age | Commit message (Collapse) | Author | Files | Lines |
|
This commit restores ability to read write to the
SuperFemto EEPROM.
Use offsetof() instead of casts to pointers when
calculating the address to pass to
eeprom_read() and eeprom_write()
Fixes: 7cf144b27d75fadfb4ec65019985bb10660a066a
Change-Id: Iaa7318387ad7bb248c261b1f428019244039e7d2
|
|
This avoids compiler warnings like
../../src/osmo-bts-sysmo/eeprom.c: In function ‘eeprom_WriteSysInfo’:
../../src/osmo-bts-sysmo/eeprom.c:605:58: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
err = eeprom_write( EEPROM_CFG_START_ADDR + ((uint32_t)&ee.cfg.v1.sysInfo - (uint32_t)&ee), sizeof(ee.cfg.v1.sysInfo), (const char *) &ee.cfg.v1.sysInfo );
Change-Id: Ic748038e6f25ec18ccb4a2f2503ca567fb00a586
|
|
[hfreyther: Accept the mixing of whitespace to ease future
merges]
|
|
91d204e2db8f53a6ae4827ecc4b0ccb0137375d0 while adding checks
to resolve coverity issues. We simply had no one writing to
the eeprom so this was unnoticed for a long time.
|
|
In the perf the ARM EABI ddiv operation showed up in the most
of expensive symbols. It doesn't really make much sense as the
calls should only be done on configuration.
|
|
Fixes: Coverity CID 1047336
|
|
Coverity insists that we should check the return value of the
calls to fseek. In general this is a good idea.
Fixes: Coverity CID 1040770, CID 1040771, CID 1040772
|
|
Calling eeprom_write would either re-use g_file or newly open the
file and set g_file but it will close the file as well. This will
lead to other code using fseek/fread on a closed file.
On top of that the general rule for the eeprom code now is that
read and write may not be mixed (due caching and other bits).
|
|
The current code has 26 fseek/fread. Only the minority really results
in a call to read. Nevertheless the time for reading during the bootstrap
can take up to 7.82 seconds. Caching the header (which is already done
by fopen/fread) will result in one call to fseek/fread and only
consumes 0.784 seconds.
|
|
Close the cached file descriptor once the calibration data is
loaded and applied.
|
|
sysmobts_vty.c: In function 'activate_lchan':
sysmobts_vty.c:373:3: warning: implicit declaration of function 'lchan_activate' [-Wimplicit-function-declaration]
sysmobts_vty.c:375:3: warning: implicit declaration of function 'lchan_deactivate' [-Wimplicit-function-declaration]
eeprom.c: In function 'eeprom_ReadEthAddr':
eeprom.c:305:5: warning: pointer targets in passing argument 3 of 'eeprom_read' differ in signedness [-Wpointer-sign]
eeprom.c:260:12: note: expected 'char *' but argument is of type 'uint8_t *'
|
|
For certain sysmoBTS units, a fixup to the calibration table is needed,
if the firmware is >= 3.3.0.
|
|
This has the advantage that an user application might simply re-define
the PERROR() macro rather than patching the code all over the place.
|
|
|
|
|