linux-ide.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Sergei Shtylyov <sshtylyov@ru.mvista.com>
To: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Cc: linux-ide@vger.kernel.org, Tejun Heo <htejun@gmail.com>
Subject: Re: [PATCH 6/12] ide: add struct ide_taskfile
Date: Fri, 19 Oct 2007 20:47:22 +0400	[thread overview]
Message-ID: <4718DF9A.8010605@ru.mvista.com> (raw)
In-Reply-To: <200710082311.10925.bzolnier@gmail.com>

Hello.

Bartlomiej Zolnierkiewicz wrote:

> * Don't set write-only ide_task_t.hobRegister[6] and ide_task_t.hobRegister[7]
>   in idedisk_set_max_address_ext().

> * Add struct ide_taskfile and use it in ide_task_t instead of tfRegister[]
>   and hobRegister[].

> * Remove no longer needed IDE_CONTROL_OFFSET_HOB define.

> * Add #ifndef/#endif __KERNEL__ around definitions of {task,hob}_struct_t.

> While at it:

> * Use ATA_LBA define for LBA bit (0x40) as suggested by Tejun Heo.

> There should be no functionality changes caused by this patch.

    There's some idea too...

> Index: b/include/linux/ide.h
> ===================================================================
> --- a/include/linux/ide.h
> +++ b/include/linux/ide.h
[...]
> @@ -1072,15 +1070,33 @@ extern void ide_end_drive_cmd(ide_drive_
>   */
>  extern int ide_wait_cmd(ide_drive_t *, u8, u8, u8, u8, u8 *);
>  
> +struct ide_taskfile {
> +	u8	hob_data;	/*  0: high data byte (for TASKFILE IOCTL) */
> +
> +	u8	hob_feature;	/*  1-5: additional data to support LBA48 */
> +	u8	hob_nsect;
> +	u8	hob_lbal;
> +	u8	hob_lbam;
> +	u8	hob_lbah;
> +
> +	u8	data;		/*  6: low data byte (for TASKFILE IOCTL) */
> +
> +	u8	feature;

    Why not use unnamed union like this:

	union {				/*  7: feature */
		u8	error;		/*  read: error   */
		u8	feature;	/* write: feature */
	};

> +	u8	command;	/* 13: command */

	union {				/* 13 */
		u8	status;		/*  read: status  */
		u8	command;	/* write: command */
	};

    This should qualify some places where you have to check for command 
register for the ERR bit, etc...

> +};

MBR, Sergei

      parent reply	other threads:[~2007-10-19 16:47 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-10-08 21:11 [PATCH 6/12] ide: add struct ide_taskfile Bartlomiej Zolnierkiewicz
2007-10-17 17:38 ` Sergei Shtylyov
2007-10-24 22:16   ` Bartlomiej Zolnierkiewicz
2007-10-25 16:37     ` Sergei Shtylyov
2007-10-19 16:47 ` Sergei Shtylyov [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4718DF9A.8010605@ru.mvista.com \
    --to=sshtylyov@ru.mvista.com \
    --cc=bzolnier@gmail.com \
    --cc=htejun@gmail.com \
    --cc=linux-ide@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).