]>
Commit | Line | Data |
---|---|---|
52ad194e | 1 | /* SPDX-License-Identifier: GPL-2.0+ */ |
aa27b158 MP |
2 | #pragma once |
3 | ||
663996b3 | 4 | /* |
b012e921 | 5 | * Copyright © IBM Corp. 2003 |
663996b3 MS |
6 | */ |
7 | ||
8 | #define MAX_PATH_LEN 512 | |
9 | ||
10 | /* | |
11 | * MAX_ATTR_LEN: maximum length of the result of reading a sysfs | |
12 | * attribute. | |
13 | */ | |
14 | #define MAX_ATTR_LEN 256 | |
15 | ||
16 | /* | |
17 | * MAX_SERIAL_LEN: the maximum length of the serial number, including | |
18 | * added prefixes such as vendor and product (model) strings. | |
19 | */ | |
20 | #define MAX_SERIAL_LEN 256 | |
21 | ||
22 | /* | |
23 | * MAX_BUFFER_LEN: maximum buffer size and line length used while reading | |
24 | * the config file. | |
25 | */ | |
26 | #define MAX_BUFFER_LEN 256 | |
27 | ||
28 | struct scsi_id_device { | |
29 | char vendor[9]; | |
30 | char model[17]; | |
31 | char revision[5]; | |
32 | char type[33]; | |
33 | char kernel[64]; | |
34 | char serial[MAX_SERIAL_LEN]; | |
35 | char serial_short[MAX_SERIAL_LEN]; | |
36 | int use_sg; | |
37 | ||
38 | /* Always from page 0x80 e.g. 'B3G1P8500RWT' - may not be unique */ | |
39 | char unit_serial_number[MAX_SERIAL_LEN]; | |
40 | ||
41 | /* NULs if not set - otherwise hex encoding using lower-case e.g. '50014ee0016eb572' */ | |
42 | char wwn[17]; | |
43 | ||
44 | /* NULs if not set - otherwise hex encoding using lower-case e.g. '0xe00000d80000' */ | |
45 | char wwn_vendor_extension[17]; | |
46 | ||
47 | /* NULs if not set - otherwise decimal number */ | |
48 | char tgpt_group[8]; | |
49 | }; | |
50 | ||
6e866b33 MB |
51 | int scsi_std_inquiry(struct scsi_id_device *dev_scsi, const char *devname); |
52 | int scsi_get_serial(struct scsi_id_device *dev_scsi, const char *devname, | |
663996b3 MS |
53 | int page_code, int len); |
54 | ||
55 | /* | |
56 | * Page code values. | |
57 | */ | |
58 | enum page_code { | |
60f067b4 JS |
59 | PAGE_83_PRE_SPC3 = -0x83, |
60 | PAGE_UNSPECIFIED = 0x00, | |
61 | PAGE_80 = 0x80, | |
62 | PAGE_83 = 0x83, | |
663996b3 | 63 | }; |