1 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-
5 * General defines and such for scsi_id
7 * Copyright (C) IBM Corp. 2003
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.
14 #define MAX_PATH_LEN 512
17 * MAX_ATTR_LEN: maximum length of the result of reading a sysfs
20 #define MAX_ATTR_LEN 256
23 * MAX_SERIAL_LEN: the maximum length of the serial number, including
24 * added prefixes such as vendor and product (model) strings.
26 #define MAX_SERIAL_LEN 256
29 * MAX_BUFFER_LEN: maximum buffer size and line length used while reading
32 #define MAX_BUFFER_LEN 256
34 struct scsi_id_device {
40 char serial[MAX_SERIAL_LEN];
41 char serial_short[MAX_SERIAL_LEN];
44 /* Always from page 0x80 e.g. 'B3G1P8500RWT' - may not be unique */
45 char unit_serial_number[MAX_SERIAL_LEN];
47 /* NULs if not set - otherwise hex encoding using lower-case e.g. '50014ee0016eb572' */
50 /* NULs if not set - otherwise hex encoding using lower-case e.g. '0xe00000d80000' */
51 char wwn_vendor_extension[17];
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);
62 PAGE_83_PRE_SPC3 = -0x83,
63 PAGE_UNSPECIFIED = 0x00,