Lines Matching refs:info
187 struct scsi_emul_info *info = &priv->eminfo; in handle_ufi_command() local
192 ret = sb_scsi_emul_command(info, req, len); in handle_ufi_command()
197 offset = os_lseek(priv->fd, info->seek_block * info->block_size, in handle_ufi_command()
214 struct scsi_emul_info *info = &priv->eminfo; in sandbox_flash_bulk() local
219 dev->name, pipe, ep, len, info->phase); in sandbox_flash_bulk()
222 switch (info->phase) { in sandbox_flash_bulk()
224 info->alloc_len = 0; in sandbox_flash_bulk()
225 info->read_len = 0; in sandbox_flash_bulk()
226 info->write_len = 0; in sandbox_flash_bulk()
235 info->transfer_len = cbw->dCBWDataTransferLength; in sandbox_flash_bulk()
241 info->write_len); in sandbox_flash_bulk()
242 info->transfer_len = cbw->dCBWDataTransferLength; in sandbox_flash_bulk()
244 if (!info->write_len) in sandbox_flash_bulk()
253 info->write_len -= len / info->block_size; in sandbox_flash_bulk()
254 if (!info->write_len) in sandbox_flash_bulk()
255 info->phase = SCSIPH_STATUS; in sandbox_flash_bulk()
257 if (info->alloc_len && len > info->alloc_len) in sandbox_flash_bulk()
258 len = info->alloc_len; in sandbox_flash_bulk()
261 memcpy(info->buff, buff, len); in sandbox_flash_bulk()
262 info->phase = SCSIPH_STATUS; in sandbox_flash_bulk()
270 switch (info->phase) { in sandbox_flash_bulk()
273 len, info->alloc_len, info->read_len); in sandbox_flash_bulk()
274 if (info->read_len) { in sandbox_flash_bulk()
283 info->read_len -= len / info->block_size; in sandbox_flash_bulk()
284 if (!info->read_len) in sandbox_flash_bulk()
285 info->phase = SCSIPH_STATUS; in sandbox_flash_bulk()
287 if (info->alloc_len && len > info->alloc_len) in sandbox_flash_bulk()
288 len = info->alloc_len; in sandbox_flash_bulk()
291 memcpy(buff, info->buff, len); in sandbox_flash_bulk()
292 info->phase = SCSIPH_STATUS; in sandbox_flash_bulk()
300 info->phase = SCSIPH_START; in sandbox_flash_bulk()
341 struct scsi_emul_info *info = &priv->eminfo; in sandbox_flash_probe() local
346 ret = os_get_filesize(plat->pathname, &info->file_size); in sandbox_flash_probe()
350 info->buff = malloc(SANDBOX_FLASH_BUF_SIZE); in sandbox_flash_probe()
351 if (!info->buff) in sandbox_flash_probe()
353 info->vendor = plat->flash_strings[STRINGID_MANUFACTURER - 1].s; in sandbox_flash_probe()
354 info->product = plat->flash_strings[STRINGID_PRODUCT - 1].s; in sandbox_flash_probe()
355 info->block_size = SANDBOX_FLASH_BLOCK_LEN; in sandbox_flash_probe()
363 struct scsi_emul_info *info = &priv->eminfo; in sandbox_flash_remove() local
365 free(info->buff); in sandbox_flash_remove()