struct msgb *msg = msgb_alloc(MSGB_MAX, "loader");
msgb_put_u8(msg, LOADER_MEM_WRITE);
msgb_put_u8(msg, length);
- msgb_put_u16(msg, crc16(0, data, length));
+ msgb_put_u16(msg, osmo_crc16(0, data, length));
msgb_put_u32(msg, address);
memcpy(msgb_put(msg, length), data, length);
loader_send_request(msg);
int rc;
if(data && length) {
- osmoload.memcrc = crc16(0, data, length);
+ osmoload.memcrc = osmo_crc16(0, data, length);
if(osmoload.memcrc != crc) {
osmoload.memoff -= osmoload.memreq;
printf("\nbad crc %4.4x (not %4.4x) at offset 0x%8.8x", crc, osmoload.memcrc, osmoload.memoff);
uint8_t reqbytes = (rembytes < MEM_MSG_MAX) ? rembytes : MEM_MSG_MAX;
- osmoload.memcrc = crc16(0, (uint8_t *) osmoload.binbuf + osmoload.memoff, reqbytes);
+ osmoload.memcrc = osmo_crc16(0, (uint8_t *) osmoload.binbuf + osmoload.memoff, reqbytes);
osmoload.memreq = reqbytes;
struct msgb *msg = msgb_alloc(MSGB_MAX, "loader");
uint8_t reqbytes = (rembytes < MEM_MSG_MAX) ? rembytes : MEM_MSG_MAX;
- osmoload.memcrc = crc16(0, (uint8_t *) osmoload.binbuf + osmoload.memoff, reqbytes);
+ osmoload.memcrc = osmo_crc16(0, (uint8_t *) osmoload.binbuf + osmoload.memoff, reqbytes);
osmoload.memreq = reqbytes;
struct msgb *msg = msgb_alloc(MSGB_MAX, "loader");
nbytes = msgb_get_u8(msg);
address = msgb_get_u32(msg);
- crc = crc16(0, (void *)address, nbytes);
+ crc = osmo_crc16(0, (void *)address, nbytes);
msgb_put_u8(reply, LOADER_MEM_READ);
msgb_put_u8(reply, nbytes);
data = msgb_get(msg, nbytes);
- mycrc = crc16(0, data, nbytes);
+ mycrc = osmo_crc16(0, data, nbytes);
if (mycrc == crc) {
memcpy((void *)address, data, nbytes);
data = msgb_get(msg, nbytes);
- mycrc = crc16(0, data, nbytes);
+ mycrc = osmo_crc16(0, data, nbytes);
if (mycrc == crc) {
res = flash_program(&the_flash, address, data, nbytes);
nbytes = msgb_get_u8(msg);
address = msgb_get_u32(msg);
- crc = crc16(0, (void *)address, nbytes);
+ crc = osmo_crc16(0, (void *)address, nbytes);
msgb_put_u8(reply, LOADER_MEM_READ);
msgb_put_u8(reply, nbytes);
data = msgb_get(msg, nbytes);
- mycrc = crc16(0, data, nbytes);
+ mycrc = osmo_crc16(0, data, nbytes);
if (mycrc == crc) {
memcpy((void *)address, data, nbytes);
data = msgb_get(msg, nbytes);
- mycrc = crc16(0, data, nbytes);
+ mycrc = osmo_crc16(0, data, nbytes);
if (mycrc == crc) {
res = flash_program(&the_flash, address, data, nbytes);