]> git.proxmox.com Git - mirror_smartmontools-debian.git/blob - knowndrives.h
Imported Upstream version 5.39.1+svn3060
[mirror_smartmontools-debian.git] / knowndrives.h
1 /*
2 * knowndrives.h
3 *
4 * Home page of code is: http://smartmontools.sourceforge.net
5 * Address of support mailing list: smartmontools-support@lists.sourceforge.net
6 *
7 * Copyright (C) 2003-9 Philip Williams, Bruce Allen
8 * Copyright (C) 2008-9 Christian Franke <smartmontools-support@lists.sourceforge.net>
9 *
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License as published by
12 * the Free Software Foundation; either version 2, or (at your option)
13 * any later version.
14 *
15 * You should have received a copy of the GNU General Public License
16 * (for example COPYING); if not, write to the Free
17 * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
18 *
19 */
20
21 #ifndef KNOWNDRIVES_H_
22 #define KNOWNDRIVES_H_
23
24 #define KNOWNDRIVES_H_CVSID "$Id: knowndrives.h 2998 2009-12-11 22:51:04Z chrfranke $\n"
25
26 // Structure to store drive database entries, see drivedb.h for a description.
27 struct drive_settings {
28 const char * modelfamily;
29 const char * modelregexp;
30 const char * firmwareregexp;
31 const char * warningmsg;
32 const char * presets;
33 };
34
35 // Searches knowndrives[] for a drive with the given model number and firmware
36 // string.
37 const drive_settings * lookup_drive(const char * model, const char * firmware);
38
39 // Shows the presets (if any) that are available for the given drive.
40 void show_presets(const ata_identify_device * drive, bool fix_swapped_id);
41
42 // Shows all presets for drives in knowndrives[].
43 // Returns #syntax errors.
44 int showallpresets();
45
46 // Shows all matching presets for a drive in knowndrives[].
47 // Returns # matching entries.
48 int showmatchingpresets(const char *model, const char *firmware);
49
50 // Sets preset vendor attribute options in opts by finding the entry
51 // (if any) for the given drive in knowndrives[]. Values that have
52 // already been set in opts will not be changed. Also sets options in
53 // con. Returns false if drive not recognized.
54 bool apply_presets(const ata_identify_device * drive, ata_vendor_attr_defs & defs,
55 unsigned char & fix_firmwarebug, bool fix_swapped_id);
56
57 // Read drive database from file.
58 bool read_drive_database(const char * path);
59
60 // Read drive databases from standard places.
61 bool read_default_drive_databases();
62
63 #endif