chiark / gitweb /
remove a few comments in file headers
[elogind.git] / extras / scsi_id / scsi_id.h
1 /*
2  * Copyright (C) IBM Corp. 2003
3  *
4  *      This program is free software; you can redistribute it and/or modify it
5  *      under the terms of the GNU General Public License as published by the
6  *      Free Software Foundation version 2 of the License.
7  */
8
9 #define MAX_PATH_LEN    512
10
11 /*
12  * MAX_ATTR_LEN: maximum length of the result of reading a sysfs
13  * attribute.
14  */
15 #define MAX_ATTR_LEN    256
16
17 /*
18  * MAX_SERIAL_LEN: the maximum length of the serial number, including
19  * added prefixes such as vendor and product (model) strings.
20  */
21 #define MAX_SERIAL_LEN  256
22
23 /*
24  * MAX_BUFFER_LEN: maximum buffer size and line length used while reading
25  * the config file.
26  */
27 #define MAX_BUFFER_LEN  256
28
29 struct scsi_id_device {
30         char vendor[9];
31         char model[17];
32         char revision[5];
33         char type[33];
34         char kernel[64];
35         char serial[MAX_SERIAL_LEN];
36         char serial_short[MAX_SERIAL_LEN];
37         int use_sg;
38
39         /* Always from page 0x80 e.g. 'B3G1P8500RWT' - may not be unique */
40         char unit_serial_number[MAX_SERIAL_LEN];
41
42         /* NULs if not set - otherwise hex encoding using lower-case e.g. '50014ee0016eb572' */
43         char wwn[17];
44
45         /* NULs if not set - otherwise hex encoding using lower-case e.g. '0xe00000d80000' */
46         char wwn_vendor_extension[17];
47 };
48
49 extern int scsi_std_inquiry(struct udev *udev, struct scsi_id_device *dev_scsi, const char *devname);
50 extern int scsi_get_serial (struct udev *udev, struct scsi_id_device *dev_scsi, const char *devname,
51                             int page_code, int len);
52
53 /*
54  * Page code values.
55  */
56 enum page_code {
57                 PAGE_83_PRE_SPC3 = -0x83,
58                 PAGE_UNSPECIFIED = 0x00,
59                 PAGE_80          = 0x80,
60                 PAGE_83          = 0x83,
61 };
62