[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 3/5] ide/atapi: Use table instead of switch for
From: |
Amit Shah |
Subject: |
Re: [Qemu-devel] [PATCH 3/5] ide/atapi: Use table instead of switch for commands |
Date: |
Tue, 19 Apr 2011 18:50:20 +0530 |
User-agent: |
Mutt/1.5.21 (2010-09-15) |
On (Tue) 19 Apr 2011 [14:36:41], Kevin Wolf wrote:
> +struct {
> + void (*handler)(IDEState *s, uint8_t *buf);
> + int flags;
> +} atapi_cmd_table[0x100] = {
> + [ 0x00 ] = { cmd_test_unit_ready, 0 },
> + [ 0x03 ] = { cmd_request_sense, ALLOW_UA },
> + [ 0x12 ] = { cmd_inquiry, ALLOW_UA },
> + [ 0x1a ] = { cmd_mode_sense, /* (6) */ 0 },
> + [ 0x1b ] = { cmd_start_stop_unit, 0 },
> + [ 0x1e ] = { cmd_prevent_allow_medium_removal, 0 },
> + [ 0x25 ] = { cmd_read_cdvd_capacity, 0 },
> + [ 0x28 ] = { cmd_read, /* (10) */ 0 },
> + [ 0x2b ] = { cmd_seek, 0 },
> + [ 0x43 ] = { cmd_read_toc_pma_atip, 0 },
> + [ 0x46 ] = { cmd_get_configuration, ALLOW_UA },
> + [ 0x4a ] = { cmd_get_event_status_notification, ALLOW_UA },
> + [ 0x5a ] = { cmd_mode_sense, /* (10) */ 0 },
> + [ 0xa8 ] = { cmd_read, /* (12) */ 0 },
> + [ 0xad ] = { cmd_read_dvd_structure, 0 },
> + [ 0xbb ] = { cmd_set_speed, 0 },
> + [ 0xbd ] = { cmd_mechanism_status, 0 },
> + [ 0xbe ] = { cmd_read_cd, 0 },
> +};
I'd prefer to use the GPCMD_TEST_UNIT_READY, etc., defines we already
have in internal.h instead of using the command numbers here.
Amit
- [Qemu-devel] [PATCH 0/5] atapi: Some code restructuring, Kevin Wolf, 2011/04/19
- [Qemu-devel] [PATCH 3/5] ide/atapi: Use table instead of switch for commands, Kevin Wolf, 2011/04/19
- Re: [Qemu-devel] [PATCH 3/5] ide/atapi: Use table instead of switch for commands,
Amit Shah <=
- [Qemu-devel] [PATCH 4/5] ide/atapi: Replace bdrv_get_geometry calls by s->nb_sectors, Kevin Wolf, 2011/04/19
- [Qemu-devel] [PATCH 2/5] ide/atapi: Factor some commands out, Kevin Wolf, 2011/04/19
- [Qemu-devel] [PATCH 5/5] ide/atapi: Introduce NEED_DISK flag for commands, Kevin Wolf, 2011/04/19
- [Qemu-devel] [PATCH 1/5] ide: Split atapi.c out, Kevin Wolf, 2011/04/19
- Re: [Qemu-devel] [PATCH 0/5] atapi: Some code restructuring, Amit Shah, 2011/04/19