~ubuntu-branches/ubuntu/trusty/seabios/trusty

« back to all changes in this revision

Viewing changes to src/block.c

  • Committer: Package Import Robot
  • Author(s): Michael Tokarev
  • Date: 2012-04-17 14:22:01 UTC
  • mfrom: (1.1.4)
  • Revision ID: package-import@ubuntu.com-20120417142201-txx8sj6ne70gt3iz
Tags: 1.7.0-1
* new upstream release (1.7.0), featuring vgabios.
* drop 1.6.3.1 patch
* do not require root in clean target
* split build procedure into several targets, move bios.bin
  out of out/ directory (preparing for the next change), and
  change clean target accordingly
* build and ship vgabios-{cirrus,stdvga,vmware,qxl,isavga}.bin
* patches/fix-==-in-shell.patch -- fix build error with dash
* move all optionrom files taken from qemu into debian/optionrom,
  instead of having them as patches in debian/patches.  While at
  it, update optionroms from current qemu (1.1) and add
  vapic.bin => kvmvapic.bin compatibility symlink.
* add myself to uploaders
* bump Standards-Version to 3.9.3 (no changes needed)

Show diffs side-by-side

added added

removed removed

Lines of Context:
11
11
#include "util.h" // dprintf
12
12
#include "ata.h" // process_ata_op
13
13
#include "ahci.h" // process_ahci_op
14
 
#include "usb-msc.h" // process_usb_op
15
 
#include "virtio-blk.h" // process_virtio_op
 
14
#include "virtio-blk.h" // process_virtio_blk_op
 
15
#include "blockcmd.h" // cdb_*
16
16
 
17
17
u8 FloppyCount VAR16VISIBLE;
18
18
u8 CDCount;
276
276
 * 16bit calling interface
277
277
 ****************************************************************/
278
278
 
 
279
static int
 
280
process_scsi_op(struct disk_op_s *op)
 
281
{
 
282
    if (!CONFIG_VIRTIO_SCSI && !CONFIG_USB_MSC)
 
283
        return 0;
 
284
    switch (op->command) {
 
285
    case CMD_READ:
 
286
        return cdb_read(op);
 
287
    case CMD_WRITE:
 
288
        return cdb_write(op);
 
289
    case CMD_FORMAT:
 
290
    case CMD_RESET:
 
291
    case CMD_ISREADY:
 
292
    case CMD_VERIFY:
 
293
    case CMD_SEEK:
 
294
        return DISK_RET_SUCCESS;
 
295
    default:
 
296
        op->count = 0;
 
297
        return DISK_RET_EPARAM;
 
298
    }
 
299
}
 
300
 
279
301
// Execute a disk_op request.
280
302
int
281
303
process_op(struct disk_op_s *op)
293
315
        return process_ramdisk_op(op);
294
316
    case DTYPE_CDEMU:
295
317
        return process_cdemu_op(op);
 
318
    case DTYPE_VIRTIO_BLK:
 
319
        return process_virtio_blk_op(op);
 
320
    case DTYPE_AHCI:
 
321
        return process_ahci_op(op);
296
322
    case DTYPE_USB:
297
 
        return process_usb_op(op);
298
 
    case DTYPE_VIRTIO:
299
 
        return process_virtio_op(op);
300
 
    case DTYPE_AHCI:
301
 
        return process_ahci_op(op);
 
323
    case DTYPE_VIRTIO_SCSI:
 
324
        return process_scsi_op(op);
302
325
    default:
303
326
        op->count = 0;
304
327
        return DISK_RET_EPARAM;