Revision 42741212
b/hw/scsi-disk.c | ||
---|---|---|
269 | 269 |
} |
270 | 270 |
} |
271 | 271 |
|
272 |
static int scsi_write_data(SCSIRequest *req)
|
|
272 |
static void scsi_write_data(SCSIRequest *req)
|
|
273 | 273 |
{ |
274 | 274 |
SCSIDiskReq *r = DO_UPCAST(SCSIDiskReq, req, req); |
275 | 275 |
SCSIDiskState *s = DO_UPCAST(SCSIDiskState, qdev, r->req.dev); |
... | ... | |
281 | 281 |
if (r->req.cmd.mode != SCSI_XFER_TO_DEV) { |
282 | 282 |
DPRINTF("Data transfer direction invalid\n"); |
283 | 283 |
scsi_write_complete(r, -EINVAL); |
284 |
return 0;
|
|
284 |
return; |
|
285 | 285 |
} |
286 | 286 |
|
287 | 287 |
n = r->iov.iov_len / 512; |
... | ... | |
296 | 296 |
/* Invoke completion routine to fetch data from host. */ |
297 | 297 |
scsi_write_complete(r, 0); |
298 | 298 |
} |
299 |
|
|
300 |
return 0; |
|
301 | 299 |
} |
302 | 300 |
|
303 | 301 |
static void scsi_dma_restart_bh(void *opaque) |
b/hw/scsi-generic.c | ||
---|---|---|
277 | 277 |
|
278 | 278 |
/* Write data to a scsi device. Returns nonzero on failure. |
279 | 279 |
The transfer may complete asynchronously. */ |
280 |
static int scsi_write_data(SCSIRequest *req)
|
|
280 |
static void scsi_write_data(SCSIRequest *req)
|
|
281 | 281 |
{ |
282 | 282 |
SCSIGenericState *s = DO_UPCAST(SCSIGenericState, qdev, req->dev); |
283 | 283 |
SCSIGenericReq *r = DO_UPCAST(SCSIGenericReq, req, req); |
... | ... | |
287 | 287 |
if (r->len == 0) { |
288 | 288 |
r->len = r->buflen; |
289 | 289 |
scsi_req_data(&r->req, r->len); |
290 |
return 0;
|
|
290 |
return; |
|
291 | 291 |
} |
292 | 292 |
|
293 | 293 |
ret = execute_command(s->bs, r, SG_DXFER_TO_DEV, scsi_write_complete); |
294 | 294 |
if (ret < 0) { |
295 | 295 |
scsi_command_complete(r, ret); |
296 |
return 1; |
|
297 | 296 |
} |
298 |
|
|
299 |
return 0; |
|
300 | 297 |
} |
301 | 298 |
|
302 | 299 |
/* Return a pointer to the data buffer. */ |
b/hw/scsi.h | ||
---|---|---|
77 | 77 |
void (*free_req)(SCSIRequest *req); |
78 | 78 |
int32_t (*send_command)(SCSIRequest *req, uint8_t *buf); |
79 | 79 |
void (*read_data)(SCSIRequest *req); |
80 |
int (*write_data)(SCSIRequest *req);
|
|
80 |
void (*write_data)(SCSIRequest *req);
|
|
81 | 81 |
void (*cancel_io)(SCSIRequest *req); |
82 | 82 |
uint8_t *(*get_buf)(SCSIRequest *req); |
83 | 83 |
int (*get_sense)(SCSIRequest *req, uint8_t *buf, int len); |
Also available in: Unified diff