[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 03/35] atapi: move GESN definitions to scsi-defs
From: |
Kevin Wolf |
Subject: |
Re: [Qemu-devel] [PATCH 03/35] atapi: move GESN definitions to scsi-defs.h |
Date: |
Mon, 17 Oct 2011 15:41:13 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:7.0) Gecko/20110927 Thunderbird/7.0 |
Am 13.10.2011 13:03, schrieb Paolo Bonzini:
> As a complement to the previous patch, move definitions for GET EVENT
> STATUS NOTIFICATION from the two functions to scsi-defs.h.
>
> The NCR_* constants are just bit values corresponding to the ENC_*
> values, with no offsets even, so keep just one copy.
>
> Signed-off-by: Paolo Bonzini <address@hidden>
I'm not sure about the NCR_* constants. They happen to be shifted
values, but the spec doesn't define them as such but has two separate
tables for them.
> ---
> hw/ide/atapi.c | 43 ++++++-------------------------------------
> hw/scsi-defs.h | 21 +++++++++++++++++++++
> 2 files changed, 27 insertions(+), 37 deletions(-)
> diff --git a/hw/scsi-defs.h b/hw/scsi-defs.h
> index dfa3095..8094698 100644
> --- a/hw/scsi-defs.h
> +++ b/hw/scsi-defs.h
> @@ -203,6 +203,27 @@
> * of MODE_PAGE_SENSE_POWER */
> #define MODE_PAGE_CDROM 0x0d
>
> +/* Event notification classes for GET EVENT STATUS NOTIFICATION */
> +#define GESN_NO_EVENTS 0
> +#define GESN_OPERATIONAL_CHANGE 1
> +#define GESN_POWER_MANAGEMENT 2
> +#define GESN_EXTERNAL_REQUEST 3
> +#define GESN_MEDIA 4
> +#define GESN_MULTIPLE_HOSTS 5
> +#define GESN_DEVICE_BUSY 6
> +
> +/* Event codes for MEDIA event status notification */
> +#define MEC_NO_CHANGE 0
> +#define MEC_EJECT_REQUESTED 1
> +#define MEC_NEW_MEDIA 2
> +#define MEC_MEDIA_REMOVAL 3 /* only for media changers */
> +#define MEC_MEDIA_CHANGED 4 /* only for media changers */
> +#define MEC_BG_FORMAT_COMPLETED 5 /* MRW or DVD+RW b/g format completed
> */
> +#define MEC_BG_FORMAT_RESTARTED 6 /* MRW or DVD+RW b/g format restarted
> */
> +
> +#define MS_TRAY_OPEN 1
> +#define MS_MEDIA_PRESENT 2
This should be spaces instead of tabs, the alignment is completely
broken for me.
Now that I looked for them I see that patch 2 has some tabs as well,
even though they are just moved. You could fix them anyway while
touching the code.
Kevin
- [Qemu-devel] [PULL 00/35] SCSI uber-patch, Paolo Bonzini, 2011/10/13
- [Qemu-devel] [PATCH 04/35] atapi: fill in AUDIO_CTL page correctly, Paolo Bonzini, 2011/10/13
- [Qemu-devel] [PATCH 03/35] atapi: move GESN definitions to scsi-defs.h, Paolo Bonzini, 2011/10/13
- Re: [Qemu-devel] [PATCH 03/35] atapi: move GESN definitions to scsi-defs.h,
Kevin Wolf <=
- [Qemu-devel] [PATCH 02/35] atapi/scsi: unify definitions for MMC, Paolo Bonzini, 2011/10/13
- [Qemu-devel] [PATCH 06/35] scsi-disk: report media changed via unit attention sense codes, Paolo Bonzini, 2011/10/13
- [Qemu-devel] [PATCH 05/35] scsi: notify the device when unit attention is reported, Paolo Bonzini, 2011/10/13
- [Qemu-devel] [PATCH 09/35] atapi/scsi-disk: make mode page values coherent between the two, Paolo Bonzini, 2011/10/13
- [Qemu-devel] [PATCH 08/35] scsi-disk: store valid mode pages in a table, Paolo Bonzini, 2011/10/13
- [Qemu-devel] [PATCH 07/35] scsi-disk: add stubs for more MMC commands, Paolo Bonzini, 2011/10/13