Lines Matching refs:dfu
16 static int dfu_transfer_medium_ram(enum dfu_op op, struct dfu_entity *dfu, in dfu_transfer_medium_ram() argument
19 if (dfu->layout != DFU_RAM_ADDR) { in dfu_transfer_medium_ram()
20 pr_err("unsupported layout: %s\n", dfu_get_layout(dfu->layout)); in dfu_transfer_medium_ram()
24 if (offset > dfu->data.ram.size) { in dfu_transfer_medium_ram()
30 memcpy(dfu->data.ram.start + offset, buf, *len); in dfu_transfer_medium_ram()
32 memcpy(buf, dfu->data.ram.start + offset, *len); in dfu_transfer_medium_ram()
37 static int dfu_write_medium_ram(struct dfu_entity *dfu, u64 offset, in dfu_write_medium_ram() argument
40 return dfu_transfer_medium_ram(DFU_OP_WRITE, dfu, offset, buf, len); in dfu_write_medium_ram()
43 int dfu_get_medium_size_ram(struct dfu_entity *dfu, u64 *size) in dfu_get_medium_size_ram() argument
45 *size = dfu->data.ram.size; in dfu_get_medium_size_ram()
50 static int dfu_read_medium_ram(struct dfu_entity *dfu, u64 offset, in dfu_read_medium_ram() argument
53 return dfu_transfer_medium_ram(DFU_OP_READ, dfu, offset, buf, len); in dfu_read_medium_ram()
56 int dfu_fill_entity_ram(struct dfu_entity *dfu, char *devstr, char *s) in dfu_fill_entity_ram() argument
69 dfu->dev_type = DFU_DEV_RAM; in dfu_fill_entity_ram()
75 dfu->layout = DFU_RAM_ADDR; in dfu_fill_entity_ram()
76 dfu->data.ram.start = (void *)simple_strtoul(argv[1], NULL, 16); in dfu_fill_entity_ram()
77 dfu->data.ram.size = simple_strtoul(argv[2], NULL, 16); in dfu_fill_entity_ram()
79 dfu->write_medium = dfu_write_medium_ram; in dfu_fill_entity_ram()
80 dfu->get_medium_size = dfu_get_medium_size_ram; in dfu_fill_entity_ram()
81 dfu->read_medium = dfu_read_medium_ram; in dfu_fill_entity_ram()
83 dfu->inited = 0; in dfu_fill_entity_ram()