aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ide/ide-disk_proc.c
diff options
context:
space:
mode:
authorLen Brown <len.brown@intel.com>2009-04-05 02:14:15 -0400
committerLen Brown <len.brown@intel.com>2009-04-05 02:14:15 -0400
commit478c6a43fcbc6c11609f8cee7c7b57223907754f (patch)
treea7f7952099da60d33032aed6de9c0c56c9f8779e /drivers/ide/ide-disk_proc.c
parent8a3f257c704e02aee9869decd069a806b45be3f1 (diff)
parent6bb597507f9839b13498781e481f5458aea33620 (diff)
Merge branch 'linus' into release
Conflicts: arch/x86/kernel/cpu/cpufreq/longhaul.c Signed-off-by: Len Brown <len.brown@intel.com>
Diffstat (limited to 'drivers/ide/ide-disk_proc.c')
-rw-r--r--drivers/ide/ide-disk_proc.c28
1 files changed, 15 insertions, 13 deletions
diff --git a/drivers/ide/ide-disk_proc.c b/drivers/ide/ide-disk_proc.c
index 1f86dcbd2b1c..eaea3bef2073 100644
--- a/drivers/ide/ide-disk_proc.c
+++ b/drivers/ide/ide-disk_proc.c
@@ -1,38 +1,38 @@
1#include <linux/kernel.h> 1#include <linux/kernel.h>
2#include <linux/ide.h> 2#include <linux/ide.h>
3#include <linux/hdreg.h>
4 3
5#include "ide-disk.h" 4#include "ide-disk.h"
6 5
7static int smart_enable(ide_drive_t *drive) 6static int smart_enable(ide_drive_t *drive)
8{ 7{
9 ide_task_t args; 8 struct ide_cmd cmd;
10 struct ide_taskfile *tf = &args.tf; 9 struct ide_taskfile *tf = &cmd.tf;
11 10
12 memset(&args, 0, sizeof(ide_task_t)); 11 memset(&cmd, 0, sizeof(cmd));
13 tf->feature = ATA_SMART_ENABLE; 12 tf->feature = ATA_SMART_ENABLE;
14 tf->lbam = ATA_SMART_LBAM_PASS; 13 tf->lbam = ATA_SMART_LBAM_PASS;
15 tf->lbah = ATA_SMART_LBAH_PASS; 14 tf->lbah = ATA_SMART_LBAH_PASS;
16 tf->command = ATA_CMD_SMART; 15 tf->command = ATA_CMD_SMART;
17 args.tf_flags = IDE_TFLAG_TF | IDE_TFLAG_DEVICE; 16 cmd.tf_flags = IDE_TFLAG_TF | IDE_TFLAG_DEVICE;
18 return ide_no_data_taskfile(drive, &args); 17
18 return ide_no_data_taskfile(drive, &cmd);
19} 19}
20 20
21static int get_smart_data(ide_drive_t *drive, u8 *buf, u8 sub_cmd) 21static int get_smart_data(ide_drive_t *drive, u8 *buf, u8 sub_cmd)
22{ 22{
23 ide_task_t args; 23 struct ide_cmd cmd;
24 struct ide_taskfile *tf = &args.tf; 24 struct ide_taskfile *tf = &cmd.tf;
25 25
26 memset(&args, 0, sizeof(ide_task_t)); 26 memset(&cmd, 0, sizeof(cmd));
27 tf->feature = sub_cmd; 27 tf->feature = sub_cmd;
28 tf->nsect = 0x01; 28 tf->nsect = 0x01;
29 tf->lbam = ATA_SMART_LBAM_PASS; 29 tf->lbam = ATA_SMART_LBAM_PASS;
30 tf->lbah = ATA_SMART_LBAH_PASS; 30 tf->lbah = ATA_SMART_LBAH_PASS;
31 tf->command = ATA_CMD_SMART; 31 tf->command = ATA_CMD_SMART;
32 args.tf_flags = IDE_TFLAG_TF | IDE_TFLAG_DEVICE; 32 cmd.tf_flags = IDE_TFLAG_TF | IDE_TFLAG_DEVICE;
33 args.data_phase = TASKFILE_IN; 33 cmd.protocol = ATA_PROT_PIO;
34 (void) smart_enable(drive); 34
35 return ide_raw_taskfile(drive, &args, buf, 1); 35 return ide_raw_taskfile(drive, &cmd, buf, 1);
36} 36}
37 37
38static int proc_idedisk_read_cache 38static int proc_idedisk_read_cache
@@ -67,6 +67,8 @@ static int proc_idedisk_read_smart(char *page, char **start, off_t off,
67 ide_drive_t *drive = (ide_drive_t *)data; 67 ide_drive_t *drive = (ide_drive_t *)data;
68 int len = 0, i = 0; 68 int len = 0, i = 0;
69 69
70 (void)smart_enable(drive);
71
70 if (get_smart_data(drive, page, sub_cmd) == 0) { 72 if (get_smart_data(drive, page, sub_cmd) == 0) {
71 unsigned short *val = (unsigned short *) page; 73 unsigned short *val = (unsigned short *) page;
72 char *out = (char *)val + SECTOR_SIZE; 74 char *out = (char *)val + SECTOR_SIZE;