summaryrefslogtreecommitdiff
path: root/drivers/ide/ide-disk.c
diff options
context:
space:
mode:
authorMartin Dalecki <dalecki@evision-ventures.com>2002-05-05 20:54:03 -0700
committerJens Axboe <axboe@suse.de>2002-05-05 20:54:03 -0700
commitfb0bbfdafe47104437b7e3c238f2d5d7e2b596dc (patch)
treebceb40657ac84c45b6a50d71bcf0c484cb6fa4b4 /drivers/ide/ide-disk.c
parent45bfe840f66e37f585eb173bb6a52cc296b0dd01 (diff)
[PATCH] 2.5.14 IDE 55
- Update HPT374 driver carried over from 2.4.xx series by Andrew Morton. Resync it with the recent host chip driver changes, or better the introduction of an API at all. - Consolidate the handling of device ID byte order in one place. This was spotted and patched by Bartomiej onierkiewicz. - Eliminate CONFIG_BLK_DEV_IDEPCI - it's duplicating the functionality of the already present and fine CONFIG_PCI flag and if we are a PCI host, we are indeed very likely to need host chip support anyway. - Remove some redundant info about the model and channel number from /proc/ide. Remove the binary entries not helpful to the user, and not used by any program and redundant to corresponding ioctls. - Properly return udma_read and udma_write values in taskfile. - Only initialize XXX_udma to the default handlers if it has not been initialized by the host chip initialization. I have enabled spin lock debugging and can see that on device flush the spin locks get wrong counts... no problems elsewher ethus far. I will re check them next time around.
Diffstat (limited to 'drivers/ide/ide-disk.c')
-rw-r--r--drivers/ide/ide-disk.c108
1 files changed, 2 insertions, 106 deletions
diff --git a/drivers/ide/ide-disk.c b/drivers/ide/ide-disk.c
index c2da3dc7f6a1..9903a107daf8 100644
--- a/drivers/ide/ide-disk.c
+++ b/drivers/ide/ide-disk.c
@@ -490,106 +490,6 @@ static void idedisk_pre_reset(struct ata_device *drive)
#ifdef CONFIG_PROC_FS
-static int smart_enable(struct ata_device *drive)
-{
- struct ata_taskfile args;
-
- memset(&args, 0, sizeof(args));
- args.taskfile.feature = SMART_ENABLE;
- args.taskfile.low_cylinder = SMART_LCYL_PASS;
- args.taskfile.high_cylinder = SMART_HCYL_PASS;
- args.taskfile.command = WIN_SMART;
- ide_cmd_type_parser(&args);
-
- return ide_raw_taskfile(drive, &args, NULL);
-}
-
-static int get_smart_values(struct ata_device *drive, u8 *buf)
-{
- struct ata_taskfile args;
-
- memset(&args, 0, sizeof(args));
- args.taskfile.feature = SMART_READ_VALUES;
- args.taskfile.sector_count = 0x01;
- args.taskfile.low_cylinder = SMART_LCYL_PASS;
- args.taskfile.high_cylinder = SMART_HCYL_PASS;
- args.taskfile.command = WIN_SMART;
- ide_cmd_type_parser(&args);
-
- smart_enable(drive);
-
- return ide_raw_taskfile(drive, &args, buf);
-}
-
-static int get_smart_thresholds(struct ata_device *drive, u8 *buf)
-{
- struct ata_taskfile args;
-
- memset(&args, 0, sizeof(args));
- args.taskfile.feature = SMART_READ_THRESHOLDS;
- args.taskfile.sector_count = 0x01;
- args.taskfile.low_cylinder = SMART_LCYL_PASS;
- args.taskfile.high_cylinder = SMART_HCYL_PASS;
- args.taskfile.command = WIN_SMART;
- ide_cmd_type_parser(&args);
-
- smart_enable(drive);
-
- return ide_raw_taskfile(drive, &args, buf);
-}
-
-static int proc_idedisk_read_cache
- (char *page, char **start, off_t off, int count, int *eof, void *data)
-{
- struct ata_device *drive = (struct ata_device *) data;
- char *out = page;
- int len;
-
- if (drive->id)
- len = sprintf(out,"%i\n", drive->id->buf_size / 2);
- else
- len = sprintf(out,"(none)\n");
- PROC_IDE_READ_RETURN(page,start,off,count,eof,len);
-}
-
-static int proc_idedisk_read_smart_thresholds
- (char *page, char **start, off_t off, int count, int *eof, void *data)
-{
- struct ata_device *drive = (struct ata_device *)data;
- int len = 0, i = 0;
-
- if (!get_smart_thresholds(drive, page)) {
- unsigned short *val = (unsigned short *) page;
- char *out = ((char *)val) + (SECTOR_WORDS * 4);
- page = out;
- do {
- out += sprintf(out, "%04x%c", le16_to_cpu(*val), (++i & 7) ? ' ' : '\n');
- val += 1;
- } while (i < (SECTOR_WORDS * 2));
- len = out - page;
- }
- PROC_IDE_READ_RETURN(page,start,off,count,eof,len);
-}
-
-static int proc_idedisk_read_smart_values
- (char *page, char **start, off_t off, int count, int *eof, void *data)
-{
- struct ata_device *drive = (struct ata_device *)data;
- int len = 0, i = 0;
-
- if (!get_smart_values(drive, page)) {
- unsigned short *val = (unsigned short *) page;
- char *out = ((char *)val) + (SECTOR_WORDS * 4);
- page = out;
- do {
- out += sprintf(out, "%04x%c", le16_to_cpu(*val), (++i & 7) ? ' ' : '\n');
- val += 1;
- } while (i < (SECTOR_WORDS * 2));
- len = out - page;
- }
- PROC_IDE_READ_RETURN(page,start,off,count,eof,len);
-}
-
#ifdef CONFIG_BLK_DEV_IDE_TCQ
static int proc_idedisk_read_tcq
(char *page, char **start, off_t off, int count, int *eof, void *data)
@@ -638,10 +538,6 @@ static int proc_idedisk_read_tcq
#endif
static ide_proc_entry_t idedisk_proc[] = {
- { "cache", S_IFREG|S_IRUGO, proc_idedisk_read_cache, NULL },
- { "geometry", S_IFREG|S_IRUGO, proc_ide_read_geometry, NULL },
- { "smart_values", S_IFREG|S_IRUSR, proc_idedisk_read_smart_values, NULL },
- { "smart_thresholds", S_IFREG|S_IRUSR, proc_idedisk_read_smart_thresholds, NULL },
#ifdef CONFIG_BLK_DEV_IDE_TCQ
{ "tcq", S_IFREG|S_IRUSR, proc_idedisk_read_tcq, NULL },
#endif
@@ -650,9 +546,9 @@ static ide_proc_entry_t idedisk_proc[] = {
#else
-#define idedisk_proc NULL
+# define idedisk_proc NULL
-#endif /* CONFIG_PROC_FS */
+#endif
/*
* This is tightly woven into the driver->special can not touch.