aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux
diff options
context:
space:
mode:
authorBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2008-01-25 16:17:06 -0500
committerBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2008-01-25 16:17:06 -0500
commit650d841d9e053a618dd8ce753422f91b493cf2f6 (patch)
tree70f81acbf856e4a4d8126bdf6d60144b374cc1a9 /include/linux
parentcd2a2d969761c26542095c01324201ca0b3ee896 (diff)
ide: add struct ide_taskfile (take 2)
* 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. v2: * Add missing newlines. (Noticed by Sergei) * Use ~ATA_LBA instead of 0xBF. (Noticed by Sergei) * Use unnamed unions for error/feature and status/command. (Suggested by Sergei). There should be no functionality changes caused by this patch. Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com> Cc: Tejun Heo <htejun@gmail.com> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/hdreg.h4
-rw-r--r--include/linux/ide.h43
2 files changed, 36 insertions, 11 deletions
diff --git a/include/linux/hdreg.h b/include/linux/hdreg.h
index 3bcb88560418..df17bf767d98 100644
--- a/include/linux/hdreg.h
+++ b/include/linux/hdreg.h
@@ -117,7 +117,7 @@ typedef union ide_reg_valid_s {
117 117
118typedef struct ide_task_request_s { 118typedef struct ide_task_request_s {
119 __u8 io_ports[8]; 119 __u8 io_ports[8];
120 __u8 hob_ports[8]; 120 __u8 hob_ports[8]; /* bytes 6 and 7 are unused */
121 ide_reg_valid_t out_flags; 121 ide_reg_valid_t out_flags;
122 ide_reg_valid_t in_flags; 122 ide_reg_valid_t in_flags;
123 int data_phase; 123 int data_phase;
@@ -139,6 +139,7 @@ struct hd_drive_cmd_hdr {
139 __u8 sector_count; 139 __u8 sector_count;
140}; 140};
141 141
142#ifndef __KERNEL__
142typedef struct hd_drive_task_hdr { 143typedef struct hd_drive_task_hdr {
143 __u8 data; 144 __u8 data;
144 __u8 feature; 145 __u8 feature;
@@ -160,6 +161,7 @@ typedef struct hd_drive_hob_hdr {
160 __u8 device_head; 161 __u8 device_head;
161 __u8 control; 162 __u8 control;
162} hob_struct_t; 163} hob_struct_t;
164#endif
163 165
164#define TASKFILE_INVALID 0x7fff 166#define TASKFILE_INVALID 0x7fff
165#define TASKFILE_48 0x8000 167#define TASKFILE_48 0x8000
diff --git a/include/linux/ide.h b/include/linux/ide.h
index 66a38f101175..69b78bb39caf 100644
--- a/include/linux/ide.h
+++ b/include/linux/ide.h
@@ -103,8 +103,6 @@ typedef unsigned char byte; /* used everywhere */
103#define IDE_FEATURE_OFFSET IDE_ERROR_OFFSET 103#define IDE_FEATURE_OFFSET IDE_ERROR_OFFSET
104#define IDE_COMMAND_OFFSET IDE_STATUS_OFFSET 104#define IDE_COMMAND_OFFSET IDE_STATUS_OFFSET
105 105
106#define IDE_CONTROL_OFFSET_HOB (7)
107
108#define IDE_DATA_REG (HWIF(drive)->io_ports[IDE_DATA_OFFSET]) 106#define IDE_DATA_REG (HWIF(drive)->io_ports[IDE_DATA_OFFSET])
109#define IDE_ERROR_REG (HWIF(drive)->io_ports[IDE_ERROR_OFFSET]) 107#define IDE_ERROR_REG (HWIF(drive)->io_ports[IDE_ERROR_OFFSET])
110#define IDE_NSECTOR_REG (HWIF(drive)->io_ports[IDE_NSECTOR_OFFSET]) 108#define IDE_NSECTOR_REG (HWIF(drive)->io_ports[IDE_NSECTOR_OFFSET])
@@ -1062,15 +1060,40 @@ extern void ide_end_drive_cmd(ide_drive_t *, u8, u8);
1062 */ 1060 */
1063extern int ide_wait_cmd(ide_drive_t *, u8, u8, u8, u8, u8 *); 1061extern int ide_wait_cmd(ide_drive_t *, u8, u8, u8, u8, u8 *);
1064 1062
1063struct ide_taskfile {
1064 u8 hob_data; /* 0: high data byte (for TASKFILE IOCTL) */
1065
1066 u8 hob_feature; /* 1-5: additional data to support LBA48 */
1067 u8 hob_nsect;
1068 u8 hob_lbal;
1069 u8 hob_lbam;
1070 u8 hob_lbah;
1071
1072 u8 data; /* 6: low data byte (for TASKFILE IOCTL) */
1073
1074 union { /*  7: */
1075 u8 error; /* read: error */
1076 u8 feature; /* write: feature */
1077 };
1078
1079 u8 nsect; /* 8: number of sectors */
1080 u8 lbal; /* 9: LBA low */
1081 u8 lbam; /* 10: LBA mid */
1082 u8 lbah; /* 11: LBA high */
1083
1084 u8 device; /* 12: device select */
1085
1086 union { /* 13: */
1087 u8 status; /*  read: status  */
1088 u8 command; /* write: command */
1089 };
1090};
1091
1065typedef struct ide_task_s { 1092typedef struct ide_task_s {
1066/* 1093 union {
1067 * struct hd_drive_task_hdr tf; 1094 struct ide_taskfile tf;
1068 * task_struct_t tf; 1095 u8 tf_array[14];
1069 * struct hd_drive_hob_hdr hobf; 1096 };
1070 * hob_struct_t hobf;
1071 */
1072 u8 tfRegister[8];
1073 u8 hobRegister[8];
1074 ide_reg_valid_t tf_out_flags; 1097 ide_reg_valid_t tf_out_flags;
1075 ide_reg_valid_t tf_in_flags; 1098 ide_reg_valid_t tf_in_flags;
1076 int data_phase; 1099 int data_phase;