Lines Matching +full:i +full:- +full:drive
1 // SPDX-License-Identifier: GPL-2.0
8 #include "ide-disk.h"
10 static int smart_enable(ide_drive_t *drive) in smart_enable() argument
16 tf->feature = ATA_SMART_ENABLE; in smart_enable()
17 tf->lbam = ATA_SMART_LBAM_PASS; in smart_enable()
18 tf->lbah = ATA_SMART_LBAH_PASS; in smart_enable()
19 tf->command = ATA_CMD_SMART; in smart_enable()
23 return ide_no_data_taskfile(drive, &cmd); in smart_enable()
26 static int get_smart_data(ide_drive_t *drive, u8 *buf, u8 sub_cmd) in get_smart_data() argument
32 tf->feature = sub_cmd; in get_smart_data()
33 tf->nsect = 0x01; in get_smart_data()
34 tf->lbam = ATA_SMART_LBAM_PASS; in get_smart_data()
35 tf->lbah = ATA_SMART_LBAH_PASS; in get_smart_data()
36 tf->command = ATA_CMD_SMART; in get_smart_data()
41 return ide_raw_taskfile(drive, &cmd, buf, 1); in get_smart_data()
46 ide_drive_t *drive = (ide_drive_t *) m->private; in idedisk_cache_proc_show() local
48 if (drive->dev_flags & IDE_DFLAG_ID_READ) in idedisk_cache_proc_show()
49 seq_printf(m, "%i\n", drive->id[ATA_ID_BUF_SIZE] / 2); in idedisk_cache_proc_show()
57 ide_drive_t*drive = (ide_drive_t *)m->private; in idedisk_capacity_proc_show() local
59 seq_printf(m, "%llu\n", (long long)ide_gd_capacity(drive)); in idedisk_capacity_proc_show()
63 static int __idedisk_proc_show(struct seq_file *m, ide_drive_t *drive, u8 sub_cmd) in __idedisk_proc_show() argument
69 return -ENOMEM; in __idedisk_proc_show()
71 (void)smart_enable(drive); in __idedisk_proc_show()
73 if (get_smart_data(drive, buf, sub_cmd) == 0) { in __idedisk_proc_show()
75 int i; in __idedisk_proc_show() local
77 for (i = 0; i < SECTOR_SIZE / 2; i++) { in __idedisk_proc_show()
78 seq_printf(m, "%04x%c", le16_to_cpu(val[i]), in __idedisk_proc_show()
79 (i % 8) == 7 ? '\n' : ' '); in __idedisk_proc_show()
88 return __idedisk_proc_show(m, m->private, ATA_SMART_READ_VALUES); in idedisk_sv_proc_show()
93 return __idedisk_proc_show(m, m->private, ATA_SMART_READ_THRESHOLDS); in idedisk_st_proc_show()