Lines Matching refs:xfer
49 return DIV_ROUND_UP(srv->state.xfer.size, in block_count_get()
50 (1U << srv->state.xfer.block_size_log)); in block_count_get()
106 return srv->io->open(srv->io, &srv->state.xfer, BT_MESH_BLOB_WRITE); in io_open()
115 srv->io->close(srv->io, &srv->state.xfer); in io_close()
121 srv->state.xfer.mode == BT_MESH_BLOB_XFER_MODE_PULL ? in reset_timer()
151 BLOB_CHUNK_SDU_LEN(srv->state.xfer.chunk_size), in pull_req_max()
219 srv->state.xfer.mode = BT_MESH_BLOB_XFER_MODE_NONE; in cancel()
223 srv->state.xfer.chunk_size = 0xffff; in cancel()
230 srv->cb->end(srv, srv->state.xfer.id, false); in cancel()
262 srv->cb->end(srv, srv->state.xfer.id, true); in end()
279 return srv->state.xfer.mode == BT_MESH_BLOB_XFER_MODE_PULL && in pull_mode_xfer_complete()
328 (srv->state.xfer.mode << 6))); in xfer_status_rsp()
335 net_buf_simple_add_le64(&buf, srv->state.xfer.id); in xfer_status_rsp()
341 net_buf_simple_add_le32(&buf, srv->state.xfer.size); in xfer_status_rsp()
342 net_buf_simple_add_u8(&buf, srv->state.xfer.block_size_log); in xfer_status_rsp()
373 if (srv->state.xfer.mode == BT_MESH_BLOB_XFER_MODE_PULL) { in block_status_rsp()
387 net_buf_simple_add_le16(&buf, srv->state.xfer.chunk_size); in block_status_rsp()
472 if (srv->state.xfer.id != id) { in handle_xfer_start()
478 LOG_WRN("Expected ID: %s", bt_hex(&srv->state.xfer.id, sizeof(uint64_t))); in handle_xfer_start()
483 if (srv->state.xfer.mode != mode || in handle_xfer_start()
484 srv->state.xfer.size != size || in handle_xfer_start()
485 srv->state.xfer.block_size_log != block_size_log || in handle_xfer_start()
519 srv->state.xfer.id = id; in handle_xfer_start()
520 srv->state.xfer.size = size; in handle_xfer_start()
521 srv->state.xfer.mode = mode; in handle_xfer_start()
522 srv->state.xfer.block_size_log = block_size_log; in handle_xfer_start()
523 srv->state.xfer.chunk_size = 0xffff; in handle_xfer_start()
548 err = srv->cb->start(srv, ctx, &srv->state.xfer); in handle_xfer_start()
583 if (srv->state.xfer.id != id) { in handle_xfer_cancel()
648 chunk_size != srv->state.xfer.chunk_size) { in handle_block_start()
663 (DIV_ROUND_UP((1 << srv->state.xfer.block_size_log), chunk_size) > in handle_block_start()
667 srv->state.xfer.block_size_log, in handle_block_start()
674 srv->state.xfer.size, srv->state.xfer.block_size_log, block_number); in handle_block_start()
677 srv->state.xfer.chunk_size = chunk_size; in handle_block_start()
678 srv->block.offset = block_number * (1UL << srv->state.xfer.block_size_log); in handle_block_start()
700 err = srv->io->block_start(srv->io, &srv->state.xfer, in handle_block_start()
709 if (srv->state.xfer.mode == BT_MESH_BLOB_XFER_MODE_PULL) { in handle_block_start()
734 chunk.offset = idx * srv->state.xfer.chunk_size; in handle_chunk()
744 expected_size = srv->block.size % srv->state.xfer.chunk_size; in handle_chunk()
748 expected_size = srv->state.xfer.chunk_size; in handle_chunk()
760 if (srv->state.xfer.mode == BT_MESH_BLOB_XFER_MODE_PULL) { in handle_chunk()
769 err = srv->io->wr(srv->io, &srv->state.xfer, &srv->block, &chunk); in handle_chunk()
779 if (srv->state.xfer.mode == BT_MESH_BLOB_XFER_MODE_PULL) { in handle_chunk()
784 srv->io->block_end(srv->io, &srv->state.xfer, &srv->block); in handle_chunk()
795 if (srv->state.xfer.mode == BT_MESH_BLOB_XFER_MODE_PULL) { in handle_chunk()
856 srv->state.xfer.chunk_size = 0xffff; in blob_srv_init()
880 srv->state.xfer.chunk_size = 0xffff; in blob_srv_settings_set()
893 LOG_DBG("Transfer (id=%llu) waiting for start", srv->state.xfer.id); in blob_srv_settings_set()
899 srv->state.xfer.id); in blob_srv_settings_set()
916 err = srv->cb->recover(srv, &srv->state.xfer, &srv->io); in blob_srv_start()
925 srv->state.xfer.mode = BT_MESH_BLOB_XFER_MODE_NONE; in blob_srv_start()
938 srv->state.xfer.mode = BT_MESH_BLOB_XFER_MODE_NONE; in blob_srv_reset()
963 srv->state.xfer.id = id; in bt_mesh_blob_srv_recv()
968 srv->state.xfer.chunk_size = 0xffff; in bt_mesh_blob_srv_recv()