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