10 #include <linux/kernel.h>
11 #include <linux/string.h>
12 #include <linux/types.h>
13 #include <linux/errno.h>
15 #include <asm/setup.h>
24 #define SENSE_ID_RETRIES 256
25 #define SENSE_ID_TIMEOUT (10 * HZ)
26 #define SENSE_ID_MIN_LEN 4
27 #define SENSE_ID_BASIC_LEN 7
41 { 0x08, 0x01, 0x3480 },
42 { 0x08, 0x02, 0x3430 },
43 { 0x08, 0x10, 0x3420 },
44 { 0x08, 0x42, 0x3424 },
45 { 0x08, 0x44, 0x9348 },
46 { 0x08, 0x81, 0x3490 },
47 { 0x08, 0x82, 0x3422 },
48 { 0x10, 0x41, 0x1403 },
49 { 0x10, 0x42, 0x3211 },
50 { 0x10, 0x43, 0x3203 },
51 { 0x10, 0x45, 0x3800 },
52 { 0x10, 0x47, 0x3262 },
53 { 0x10, 0x48, 0x3820 },
54 { 0x10, 0x49, 0x3800 },
55 { 0x10, 0x4a, 0x4245 },
56 { 0x10, 0x4b, 0x4248 },
57 { 0x10, 0x4d, 0x3800 },
58 { 0x10, 0x4e, 0x3820 },
59 { 0x10, 0x4f, 0x3820 },
60 { 0x10, 0x82, 0x2540 },
61 { 0x10, 0x84, 0x3525 },
62 { 0x20, 0x81, 0x2501 },
63 { 0x20, 0x82, 0x2540 },
64 { 0x20, 0x84, 0x3505 },
65 { 0x40, 0x01, 0x3278 },
66 { 0x40, 0x04, 0x3277 },
67 { 0x40, 0x80, 0x2250 },
68 { 0x40, 0xc0, 0x5080 },
69 { 0x80, 0x00, 0x3215 },
81 if (diag->
vrdcvcla == vm_devices[i].class &&
82 diag->
vrdcvtyp == vm_devices[i].type) {
83 senseid->
cu_type = vm_devices[
i].cu_type;
105 if (dev_id->
ssid != 0)
107 memset(&diag_data, 0,
sizeof(diag_data));
108 diag_data.vrdcdvno = dev_id->
devno;
109 diag_data.vrdclen =
sizeof(diag_data);
112 CIO_HEX_EVENT(4, &rc,
sizeof(rc));
113 CIO_HEX_EVENT(4, &diag_data,
sizeof(diag_data));
114 if (rc != 0 && rc != 2)
116 if (diag210_to_senseid(senseid, &diag_data))
121 CIO_MSG_EVENT(0,
"snsid: device 0.%x.%04x: unknown diag210 data\n",
125 CIO_MSG_EVENT(0,
"snsid: device 0.%x.%04x: diag210 failed (rc=%d)\n",
133 static void snsid_init(
struct ccw_device *cdev)
137 cdev->
private->senseid.cu_type = 0xffff;
146 int len =
sizeof(
struct senseid) - scsw->
count;
151 if (cdev->
private->senseid.cu_type == 0xffff)
154 if (cdev->
private->senseid.reserved != 0xff)
169 static void snsid_callback(
struct ccw_device *cdev,
void *data,
int rc)
172 struct senseid *senseid = &cdev->
private->senseid;
178 if (diag210_get_dev_info(cdev) == 0) {
184 "%04x/%02x%s\n", id->
ssid, id->
devno, rc,
186 senseid->
dev_model, vm ?
" (diag210)" :
"");
205 CIO_HEX_EVENT(4, &cdev->
private->dev_id,
sizeof(cdev->
private->dev_id));
211 cp->
count =
sizeof(
struct senseid);
214 memset(req, 0,
sizeof(*req));
219 req->
check = snsid_check;