James Bottomley | 9927c68 | 2008-02-03 15:48:56 -0600 | [diff] [blame] | 1 | /* |
| 2 | * SCSI Enclosure Services |
| 3 | * |
| 4 | * Copyright (C) 2008 James Bottomley <James.Bottomley@HansenPartnership.com> |
| 5 | * |
| 6 | **----------------------------------------------------------------------------- |
| 7 | ** |
| 8 | ** This program is free software; you can redistribute it and/or |
| 9 | ** modify it under the terms of the GNU General Public License |
| 10 | ** version 2 as published by the Free Software Foundation. |
| 11 | ** |
| 12 | ** This program is distributed in the hope that it will be useful, |
| 13 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 14 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 15 | ** GNU General Public License for more details. |
| 16 | ** |
| 17 | ** You should have received a copy of the GNU General Public License |
| 18 | ** along with this program; if not, write to the Free Software |
| 19 | ** Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
| 20 | ** |
| 21 | **----------------------------------------------------------------------------- |
| 22 | */ |
| 23 | |
Tejun Heo | 5a0e3ad | 2010-03-24 17:04:11 +0900 | [diff] [blame] | 24 | #include <linux/slab.h> |
James Bottomley | 9927c68 | 2008-02-03 15:48:56 -0600 | [diff] [blame] | 25 | #include <linux/module.h> |
| 26 | #include <linux/kernel.h> |
| 27 | #include <linux/enclosure.h> |
Hannes Reinecke | c38c007 | 2014-03-15 09:51:51 +0100 | [diff] [blame] | 28 | #include <asm/unaligned.h> |
James Bottomley | 9927c68 | 2008-02-03 15:48:56 -0600 | [diff] [blame] | 29 | |
| 30 | #include <scsi/scsi.h> |
| 31 | #include <scsi/scsi_cmnd.h> |
| 32 | #include <scsi/scsi_dbg.h> |
| 33 | #include <scsi/scsi_device.h> |
| 34 | #include <scsi/scsi_driver.h> |
| 35 | #include <scsi/scsi_host.h> |
| 36 | |
| 37 | struct ses_device { |
Yinghai Lu | 691b477 | 2008-02-13 16:25:16 -0800 | [diff] [blame] | 38 | unsigned char *page1; |
James Bottomley | 8c3adc7 | 2011-03-18 11:24:23 -0400 | [diff] [blame] | 39 | unsigned char *page1_types; |
Yinghai Lu | 691b477 | 2008-02-13 16:25:16 -0800 | [diff] [blame] | 40 | unsigned char *page2; |
| 41 | unsigned char *page10; |
James Bottomley | 9927c68 | 2008-02-03 15:48:56 -0600 | [diff] [blame] | 42 | short page1_len; |
James Bottomley | 8c3adc7 | 2011-03-18 11:24:23 -0400 | [diff] [blame] | 43 | short page1_num_types; |
James Bottomley | 9927c68 | 2008-02-03 15:48:56 -0600 | [diff] [blame] | 44 | short page2_len; |
| 45 | short page10_len; |
| 46 | }; |
| 47 | |
| 48 | struct ses_component { |
| 49 | u64 addr; |
| 50 | unsigned char *desc; |
| 51 | }; |
| 52 | |
| 53 | static int ses_probe(struct device *dev) |
| 54 | { |
| 55 | struct scsi_device *sdev = to_scsi_device(dev); |
| 56 | int err = -ENODEV; |
| 57 | |
| 58 | if (sdev->type != TYPE_ENCLOSURE) |
| 59 | goto out; |
| 60 | |
| 61 | err = 0; |
| 62 | sdev_printk(KERN_NOTICE, sdev, "Attached Enclosure device\n"); |
| 63 | |
| 64 | out: |
| 65 | return err; |
| 66 | } |
| 67 | |
Matthew Wilcox | c95e62c | 2008-06-23 09:14:31 -0600 | [diff] [blame] | 68 | #define SES_TIMEOUT (30 * HZ) |
James Bottomley | 9927c68 | 2008-02-03 15:48:56 -0600 | [diff] [blame] | 69 | #define SES_RETRIES 3 |
| 70 | |
| 71 | static int ses_recv_diag(struct scsi_device *sdev, int page_code, |
| 72 | void *buf, int bufflen) |
| 73 | { |
Yinghai Lu | 691b477 | 2008-02-13 16:25:16 -0800 | [diff] [blame] | 74 | unsigned char cmd[] = { |
James Bottomley | 9927c68 | 2008-02-03 15:48:56 -0600 | [diff] [blame] | 75 | RECEIVE_DIAGNOSTIC, |
| 76 | 1, /* Set PCV bit */ |
| 77 | page_code, |
| 78 | bufflen >> 8, |
| 79 | bufflen & 0xff, |
| 80 | 0 |
| 81 | }; |
| 82 | |
| 83 | return scsi_execute_req(sdev, cmd, DMA_FROM_DEVICE, buf, bufflen, |
FUJITA Tomonori | f4f4e47 | 2008-12-04 14:24:39 +0900 | [diff] [blame] | 84 | NULL, SES_TIMEOUT, SES_RETRIES, NULL); |
James Bottomley | 9927c68 | 2008-02-03 15:48:56 -0600 | [diff] [blame] | 85 | } |
| 86 | |
| 87 | static int ses_send_diag(struct scsi_device *sdev, int page_code, |
| 88 | void *buf, int bufflen) |
| 89 | { |
| 90 | u32 result; |
| 91 | |
Yinghai Lu | 691b477 | 2008-02-13 16:25:16 -0800 | [diff] [blame] | 92 | unsigned char cmd[] = { |
James Bottomley | 9927c68 | 2008-02-03 15:48:56 -0600 | [diff] [blame] | 93 | SEND_DIAGNOSTIC, |
| 94 | 0x10, /* Set PF bit */ |
| 95 | 0, |
| 96 | bufflen >> 8, |
| 97 | bufflen & 0xff, |
| 98 | 0 |
| 99 | }; |
| 100 | |
| 101 | result = scsi_execute_req(sdev, cmd, DMA_TO_DEVICE, buf, bufflen, |
FUJITA Tomonori | f4f4e47 | 2008-12-04 14:24:39 +0900 | [diff] [blame] | 102 | NULL, SES_TIMEOUT, SES_RETRIES, NULL); |
James Bottomley | 9927c68 | 2008-02-03 15:48:56 -0600 | [diff] [blame] | 103 | if (result) |
| 104 | sdev_printk(KERN_ERR, sdev, "SEND DIAGNOSTIC result: %8x\n", |
| 105 | result); |
| 106 | return result; |
| 107 | } |
| 108 | |
| 109 | static int ses_set_page2_descriptor(struct enclosure_device *edev, |
| 110 | struct enclosure_component *ecomp, |
Yinghai Lu | 691b477 | 2008-02-13 16:25:16 -0800 | [diff] [blame] | 111 | unsigned char *desc) |
James Bottomley | 9927c68 | 2008-02-03 15:48:56 -0600 | [diff] [blame] | 112 | { |
| 113 | int i, j, count = 0, descriptor = ecomp->number; |
Tony Jones | ee959b0 | 2008-02-22 00:13:36 +0100 | [diff] [blame] | 114 | struct scsi_device *sdev = to_scsi_device(edev->edev.parent); |
James Bottomley | 9927c68 | 2008-02-03 15:48:56 -0600 | [diff] [blame] | 115 | struct ses_device *ses_dev = edev->scratch; |
James Bottomley | 8c3adc7 | 2011-03-18 11:24:23 -0400 | [diff] [blame] | 116 | unsigned char *type_ptr = ses_dev->page1_types; |
Yinghai Lu | 691b477 | 2008-02-13 16:25:16 -0800 | [diff] [blame] | 117 | unsigned char *desc_ptr = ses_dev->page2 + 8; |
James Bottomley | 9927c68 | 2008-02-03 15:48:56 -0600 | [diff] [blame] | 118 | |
| 119 | /* Clear everything */ |
| 120 | memset(desc_ptr, 0, ses_dev->page2_len - 8); |
James Bottomley | 8c3adc7 | 2011-03-18 11:24:23 -0400 | [diff] [blame] | 121 | for (i = 0; i < ses_dev->page1_num_types; i++, type_ptr += 4) { |
James Bottomley | 9927c68 | 2008-02-03 15:48:56 -0600 | [diff] [blame] | 122 | for (j = 0; j < type_ptr[1]; j++) { |
| 123 | desc_ptr += 4; |
| 124 | if (type_ptr[0] != ENCLOSURE_COMPONENT_DEVICE && |
| 125 | type_ptr[0] != ENCLOSURE_COMPONENT_ARRAY_DEVICE) |
| 126 | continue; |
| 127 | if (count++ == descriptor) { |
| 128 | memcpy(desc_ptr, desc, 4); |
| 129 | /* set select */ |
| 130 | desc_ptr[0] |= 0x80; |
| 131 | /* clear reserved, just in case */ |
| 132 | desc_ptr[0] &= 0xf0; |
| 133 | } |
| 134 | } |
| 135 | } |
| 136 | |
| 137 | return ses_send_diag(sdev, 2, ses_dev->page2, ses_dev->page2_len); |
| 138 | } |
| 139 | |
Yinghai Lu | 691b477 | 2008-02-13 16:25:16 -0800 | [diff] [blame] | 140 | static unsigned char *ses_get_page2_descriptor(struct enclosure_device *edev, |
James Bottomley | 9927c68 | 2008-02-03 15:48:56 -0600 | [diff] [blame] | 141 | struct enclosure_component *ecomp) |
| 142 | { |
| 143 | int i, j, count = 0, descriptor = ecomp->number; |
Tony Jones | ee959b0 | 2008-02-22 00:13:36 +0100 | [diff] [blame] | 144 | struct scsi_device *sdev = to_scsi_device(edev->edev.parent); |
James Bottomley | 9927c68 | 2008-02-03 15:48:56 -0600 | [diff] [blame] | 145 | struct ses_device *ses_dev = edev->scratch; |
James Bottomley | 8c3adc7 | 2011-03-18 11:24:23 -0400 | [diff] [blame] | 146 | unsigned char *type_ptr = ses_dev->page1_types; |
Yinghai Lu | 691b477 | 2008-02-13 16:25:16 -0800 | [diff] [blame] | 147 | unsigned char *desc_ptr = ses_dev->page2 + 8; |
James Bottomley | 9927c68 | 2008-02-03 15:48:56 -0600 | [diff] [blame] | 148 | |
| 149 | ses_recv_diag(sdev, 2, ses_dev->page2, ses_dev->page2_len); |
| 150 | |
James Bottomley | 8c3adc7 | 2011-03-18 11:24:23 -0400 | [diff] [blame] | 151 | for (i = 0; i < ses_dev->page1_num_types; i++, type_ptr += 4) { |
James Bottomley | 9927c68 | 2008-02-03 15:48:56 -0600 | [diff] [blame] | 152 | for (j = 0; j < type_ptr[1]; j++) { |
| 153 | desc_ptr += 4; |
| 154 | if (type_ptr[0] != ENCLOSURE_COMPONENT_DEVICE && |
| 155 | type_ptr[0] != ENCLOSURE_COMPONENT_ARRAY_DEVICE) |
| 156 | continue; |
| 157 | if (count++ == descriptor) |
| 158 | return desc_ptr; |
| 159 | } |
| 160 | } |
| 161 | return NULL; |
| 162 | } |
| 163 | |
Douglas Gilbert | 2a350ca | 2011-06-09 00:27:07 -0400 | [diff] [blame] | 164 | /* For device slot and array device slot elements, byte 3 bit 6 |
| 165 | * is "fault sensed" while byte 3 bit 5 is "fault reqstd". As this |
| 166 | * code stands these bits are shifted 4 positions right so in |
| 167 | * sysfs they will appear as bits 2 and 1 respectively. Strange. */ |
James Bottomley | 9927c68 | 2008-02-03 15:48:56 -0600 | [diff] [blame] | 168 | static void ses_get_fault(struct enclosure_device *edev, |
| 169 | struct enclosure_component *ecomp) |
| 170 | { |
Yinghai Lu | 691b477 | 2008-02-13 16:25:16 -0800 | [diff] [blame] | 171 | unsigned char *desc; |
James Bottomley | 9927c68 | 2008-02-03 15:48:56 -0600 | [diff] [blame] | 172 | |
| 173 | desc = ses_get_page2_descriptor(edev, ecomp); |
Yinghai Lu | 691b477 | 2008-02-13 16:25:16 -0800 | [diff] [blame] | 174 | if (desc) |
| 175 | ecomp->fault = (desc[3] & 0x60) >> 4; |
James Bottomley | 9927c68 | 2008-02-03 15:48:56 -0600 | [diff] [blame] | 176 | } |
| 177 | |
| 178 | static int ses_set_fault(struct enclosure_device *edev, |
| 179 | struct enclosure_component *ecomp, |
| 180 | enum enclosure_component_setting val) |
| 181 | { |
Yinghai Lu | 691b477 | 2008-02-13 16:25:16 -0800 | [diff] [blame] | 182 | unsigned char desc[4] = {0 }; |
James Bottomley | 9927c68 | 2008-02-03 15:48:56 -0600 | [diff] [blame] | 183 | |
| 184 | switch (val) { |
| 185 | case ENCLOSURE_SETTING_DISABLED: |
| 186 | /* zero is disabled */ |
| 187 | break; |
| 188 | case ENCLOSURE_SETTING_ENABLED: |
Douglas Gilbert | 2a350ca | 2011-06-09 00:27:07 -0400 | [diff] [blame] | 189 | desc[3] = 0x20; |
James Bottomley | 9927c68 | 2008-02-03 15:48:56 -0600 | [diff] [blame] | 190 | break; |
| 191 | default: |
| 192 | /* SES doesn't do the SGPIO blink settings */ |
| 193 | return -EINVAL; |
| 194 | } |
| 195 | |
| 196 | return ses_set_page2_descriptor(edev, ecomp, desc); |
| 197 | } |
| 198 | |
| 199 | static void ses_get_status(struct enclosure_device *edev, |
| 200 | struct enclosure_component *ecomp) |
| 201 | { |
Yinghai Lu | 691b477 | 2008-02-13 16:25:16 -0800 | [diff] [blame] | 202 | unsigned char *desc; |
James Bottomley | 9927c68 | 2008-02-03 15:48:56 -0600 | [diff] [blame] | 203 | |
| 204 | desc = ses_get_page2_descriptor(edev, ecomp); |
Yinghai Lu | 691b477 | 2008-02-13 16:25:16 -0800 | [diff] [blame] | 205 | if (desc) |
| 206 | ecomp->status = (desc[0] & 0x0f); |
James Bottomley | 9927c68 | 2008-02-03 15:48:56 -0600 | [diff] [blame] | 207 | } |
| 208 | |
| 209 | static void ses_get_locate(struct enclosure_device *edev, |
| 210 | struct enclosure_component *ecomp) |
| 211 | { |
Yinghai Lu | 691b477 | 2008-02-13 16:25:16 -0800 | [diff] [blame] | 212 | unsigned char *desc; |
James Bottomley | 9927c68 | 2008-02-03 15:48:56 -0600 | [diff] [blame] | 213 | |
| 214 | desc = ses_get_page2_descriptor(edev, ecomp); |
Yinghai Lu | 691b477 | 2008-02-13 16:25:16 -0800 | [diff] [blame] | 215 | if (desc) |
| 216 | ecomp->locate = (desc[2] & 0x02) ? 1 : 0; |
James Bottomley | 9927c68 | 2008-02-03 15:48:56 -0600 | [diff] [blame] | 217 | } |
| 218 | |
| 219 | static int ses_set_locate(struct enclosure_device *edev, |
| 220 | struct enclosure_component *ecomp, |
| 221 | enum enclosure_component_setting val) |
| 222 | { |
Yinghai Lu | 691b477 | 2008-02-13 16:25:16 -0800 | [diff] [blame] | 223 | unsigned char desc[4] = {0 }; |
James Bottomley | 9927c68 | 2008-02-03 15:48:56 -0600 | [diff] [blame] | 224 | |
| 225 | switch (val) { |
| 226 | case ENCLOSURE_SETTING_DISABLED: |
| 227 | /* zero is disabled */ |
| 228 | break; |
| 229 | case ENCLOSURE_SETTING_ENABLED: |
| 230 | desc[2] = 0x02; |
| 231 | break; |
| 232 | default: |
| 233 | /* SES doesn't do the SGPIO blink settings */ |
| 234 | return -EINVAL; |
| 235 | } |
| 236 | return ses_set_page2_descriptor(edev, ecomp, desc); |
| 237 | } |
| 238 | |
| 239 | static int ses_set_active(struct enclosure_device *edev, |
| 240 | struct enclosure_component *ecomp, |
| 241 | enum enclosure_component_setting val) |
| 242 | { |
Yinghai Lu | 691b477 | 2008-02-13 16:25:16 -0800 | [diff] [blame] | 243 | unsigned char desc[4] = {0 }; |
James Bottomley | 9927c68 | 2008-02-03 15:48:56 -0600 | [diff] [blame] | 244 | |
| 245 | switch (val) { |
| 246 | case ENCLOSURE_SETTING_DISABLED: |
| 247 | /* zero is disabled */ |
| 248 | ecomp->active = 0; |
| 249 | break; |
| 250 | case ENCLOSURE_SETTING_ENABLED: |
| 251 | desc[2] = 0x80; |
| 252 | ecomp->active = 1; |
| 253 | break; |
| 254 | default: |
| 255 | /* SES doesn't do the SGPIO blink settings */ |
| 256 | return -EINVAL; |
| 257 | } |
| 258 | return ses_set_page2_descriptor(edev, ecomp, desc); |
| 259 | } |
| 260 | |
Dan Williams | 967f7ba | 2014-12-30 14:46:16 -0800 | [diff] [blame^] | 261 | static int ses_show_id(struct enclosure_device *edev, char *buf) |
| 262 | { |
| 263 | struct ses_device *ses_dev = edev->scratch; |
| 264 | unsigned long long id = get_unaligned_be64(ses_dev->page1+8+4); |
| 265 | |
| 266 | return sprintf(buf, "%#llx\n", id); |
| 267 | } |
| 268 | |
James Bottomley | 9927c68 | 2008-02-03 15:48:56 -0600 | [diff] [blame] | 269 | static struct enclosure_component_callbacks ses_enclosure_callbacks = { |
| 270 | .get_fault = ses_get_fault, |
| 271 | .set_fault = ses_set_fault, |
| 272 | .get_status = ses_get_status, |
| 273 | .get_locate = ses_get_locate, |
| 274 | .set_locate = ses_set_locate, |
| 275 | .set_active = ses_set_active, |
Dan Williams | 967f7ba | 2014-12-30 14:46:16 -0800 | [diff] [blame^] | 276 | .show_id = ses_show_id, |
James Bottomley | 9927c68 | 2008-02-03 15:48:56 -0600 | [diff] [blame] | 277 | }; |
| 278 | |
| 279 | struct ses_host_edev { |
| 280 | struct Scsi_Host *shost; |
| 281 | struct enclosure_device *edev; |
| 282 | }; |
| 283 | |
Adrian Bunk | e0aae1a | 2009-03-04 12:06:05 -0800 | [diff] [blame] | 284 | #if 0 |
James Bottomley | 9927c68 | 2008-02-03 15:48:56 -0600 | [diff] [blame] | 285 | int ses_match_host(struct enclosure_device *edev, void *data) |
| 286 | { |
| 287 | struct ses_host_edev *sed = data; |
| 288 | struct scsi_device *sdev; |
| 289 | |
Tony Jones | ee959b0 | 2008-02-22 00:13:36 +0100 | [diff] [blame] | 290 | if (!scsi_is_sdev_device(edev->edev.parent)) |
James Bottomley | 9927c68 | 2008-02-03 15:48:56 -0600 | [diff] [blame] | 291 | return 0; |
| 292 | |
Tony Jones | ee959b0 | 2008-02-22 00:13:36 +0100 | [diff] [blame] | 293 | sdev = to_scsi_device(edev->edev.parent); |
James Bottomley | 9927c68 | 2008-02-03 15:48:56 -0600 | [diff] [blame] | 294 | |
| 295 | if (sdev->host != sed->shost) |
| 296 | return 0; |
| 297 | |
| 298 | sed->edev = edev; |
| 299 | return 1; |
| 300 | } |
Adrian Bunk | e0aae1a | 2009-03-04 12:06:05 -0800 | [diff] [blame] | 301 | #endif /* 0 */ |
James Bottomley | 9927c68 | 2008-02-03 15:48:56 -0600 | [diff] [blame] | 302 | |
| 303 | static void ses_process_descriptor(struct enclosure_component *ecomp, |
| 304 | unsigned char *desc) |
| 305 | { |
| 306 | int eip = desc[0] & 0x10; |
| 307 | int invalid = desc[0] & 0x80; |
| 308 | enum scsi_protocol proto = desc[0] & 0x0f; |
| 309 | u64 addr = 0; |
| 310 | struct ses_component *scomp = ecomp->scratch; |
| 311 | unsigned char *d; |
| 312 | |
| 313 | scomp->desc = desc; |
| 314 | |
| 315 | if (invalid) |
| 316 | return; |
| 317 | |
| 318 | switch (proto) { |
| 319 | case SCSI_PROTOCOL_SAS: |
| 320 | if (eip) |
| 321 | d = desc + 8; |
| 322 | else |
| 323 | d = desc + 4; |
| 324 | /* only take the phy0 addr */ |
| 325 | addr = (u64)d[12] << 56 | |
| 326 | (u64)d[13] << 48 | |
| 327 | (u64)d[14] << 40 | |
| 328 | (u64)d[15] << 32 | |
| 329 | (u64)d[16] << 24 | |
| 330 | (u64)d[17] << 16 | |
| 331 | (u64)d[18] << 8 | |
| 332 | (u64)d[19]; |
| 333 | break; |
| 334 | default: |
| 335 | /* FIXME: Need to add more protocols than just SAS */ |
| 336 | break; |
| 337 | } |
| 338 | scomp->addr = addr; |
| 339 | } |
| 340 | |
| 341 | struct efd { |
| 342 | u64 addr; |
| 343 | struct device *dev; |
| 344 | }; |
| 345 | |
| 346 | static int ses_enclosure_find_by_addr(struct enclosure_device *edev, |
| 347 | void *data) |
| 348 | { |
| 349 | struct efd *efd = data; |
| 350 | int i; |
| 351 | struct ses_component *scomp; |
| 352 | |
| 353 | if (!edev->component[0].scratch) |
| 354 | return 0; |
| 355 | |
| 356 | for (i = 0; i < edev->components; i++) { |
| 357 | scomp = edev->component[i].scratch; |
| 358 | if (scomp->addr != efd->addr) |
| 359 | continue; |
| 360 | |
Dan Williams | 15a0fbb | 2014-12-30 14:46:15 -0800 | [diff] [blame] | 361 | if (enclosure_add_device(edev, i, efd->dev) == 0) |
| 362 | kobject_uevent(&efd->dev->kobj, KOBJ_CHANGE); |
James Bottomley | 9927c68 | 2008-02-03 15:48:56 -0600 | [diff] [blame] | 363 | return 1; |
| 364 | } |
| 365 | return 0; |
| 366 | } |
| 367 | |
James Bottomley | 21fab1d | 2009-08-01 00:43:59 +0000 | [diff] [blame] | 368 | #define INIT_ALLOC_SIZE 32 |
| 369 | |
| 370 | static void ses_enclosure_data_process(struct enclosure_device *edev, |
| 371 | struct scsi_device *sdev, |
| 372 | int create) |
| 373 | { |
| 374 | u32 result; |
| 375 | unsigned char *buf = NULL, *type_ptr, *desc_ptr, *addl_desc_ptr = NULL; |
| 376 | int i, j, page7_len, len, components; |
| 377 | struct ses_device *ses_dev = edev->scratch; |
James Bottomley | 8c3adc7 | 2011-03-18 11:24:23 -0400 | [diff] [blame] | 378 | int types = ses_dev->page1_num_types; |
James Bottomley | 21fab1d | 2009-08-01 00:43:59 +0000 | [diff] [blame] | 379 | unsigned char *hdr_buf = kzalloc(INIT_ALLOC_SIZE, GFP_KERNEL); |
| 380 | |
| 381 | if (!hdr_buf) |
| 382 | goto simple_populate; |
| 383 | |
| 384 | /* re-read page 10 */ |
| 385 | if (ses_dev->page10) |
| 386 | ses_recv_diag(sdev, 10, ses_dev->page10, ses_dev->page10_len); |
| 387 | /* Page 7 for the descriptors is optional */ |
| 388 | result = ses_recv_diag(sdev, 7, hdr_buf, INIT_ALLOC_SIZE); |
| 389 | if (result) |
| 390 | goto simple_populate; |
| 391 | |
| 392 | page7_len = len = (hdr_buf[2] << 8) + hdr_buf[3] + 4; |
| 393 | /* add 1 for trailing '\0' we'll use */ |
| 394 | buf = kzalloc(len + 1, GFP_KERNEL); |
| 395 | if (!buf) |
| 396 | goto simple_populate; |
| 397 | result = ses_recv_diag(sdev, 7, buf, len); |
| 398 | if (result) { |
| 399 | simple_populate: |
| 400 | kfree(buf); |
| 401 | buf = NULL; |
| 402 | desc_ptr = NULL; |
| 403 | len = 0; |
| 404 | page7_len = 0; |
| 405 | } else { |
| 406 | desc_ptr = buf + 8; |
| 407 | len = (desc_ptr[2] << 8) + desc_ptr[3]; |
| 408 | /* skip past overall descriptor */ |
| 409 | desc_ptr += len + 4; |
James Bottomley | 21fab1d | 2009-08-01 00:43:59 +0000 | [diff] [blame] | 410 | } |
John Hughes | 877a559 | 2009-11-04 19:01:22 +0100 | [diff] [blame] | 411 | if (ses_dev->page10) |
| 412 | addl_desc_ptr = ses_dev->page10 + 8; |
James Bottomley | 8c3adc7 | 2011-03-18 11:24:23 -0400 | [diff] [blame] | 413 | type_ptr = ses_dev->page1_types; |
James Bottomley | 21fab1d | 2009-08-01 00:43:59 +0000 | [diff] [blame] | 414 | components = 0; |
| 415 | for (i = 0; i < types; i++, type_ptr += 4) { |
| 416 | for (j = 0; j < type_ptr[1]; j++) { |
| 417 | char *name = NULL; |
| 418 | struct enclosure_component *ecomp; |
| 419 | |
| 420 | if (desc_ptr) { |
| 421 | if (desc_ptr >= buf + page7_len) { |
| 422 | desc_ptr = NULL; |
| 423 | } else { |
| 424 | len = (desc_ptr[2] << 8) + desc_ptr[3]; |
| 425 | desc_ptr += 4; |
| 426 | /* Add trailing zero - pushes into |
| 427 | * reserved space */ |
| 428 | desc_ptr[len] = '\0'; |
| 429 | name = desc_ptr; |
| 430 | } |
| 431 | } |
| 432 | if (type_ptr[0] == ENCLOSURE_COMPONENT_DEVICE || |
| 433 | type_ptr[0] == ENCLOSURE_COMPONENT_ARRAY_DEVICE) { |
| 434 | |
| 435 | if (create) |
Dan Williams | ed09dcc | 2014-12-30 14:46:14 -0800 | [diff] [blame] | 436 | ecomp = enclosure_component_alloc( |
| 437 | edev, |
| 438 | components++, |
| 439 | type_ptr[0], |
| 440 | name); |
James Bottomley | 21fab1d | 2009-08-01 00:43:59 +0000 | [diff] [blame] | 441 | else |
| 442 | ecomp = &edev->component[components++]; |
| 443 | |
Dan Williams | ed09dcc | 2014-12-30 14:46:14 -0800 | [diff] [blame] | 444 | if (!IS_ERR(ecomp)) { |
| 445 | if (addl_desc_ptr) |
| 446 | ses_process_descriptor( |
| 447 | ecomp, |
| 448 | addl_desc_ptr); |
| 449 | if (create) |
| 450 | enclosure_component_register( |
| 451 | ecomp); |
| 452 | } |
James Bottomley | 21fab1d | 2009-08-01 00:43:59 +0000 | [diff] [blame] | 453 | } |
| 454 | if (desc_ptr) |
| 455 | desc_ptr += len; |
| 456 | |
| 457 | if (addl_desc_ptr) |
| 458 | addl_desc_ptr += addl_desc_ptr[1] + 2; |
| 459 | |
| 460 | } |
| 461 | } |
| 462 | kfree(buf); |
| 463 | kfree(hdr_buf); |
| 464 | } |
| 465 | |
James Bottomley | 9927c68 | 2008-02-03 15:48:56 -0600 | [diff] [blame] | 466 | static void ses_match_to_enclosure(struct enclosure_device *edev, |
| 467 | struct scsi_device *sdev) |
| 468 | { |
James Bottomley | 9927c68 | 2008-02-03 15:48:56 -0600 | [diff] [blame] | 469 | unsigned char *desc; |
James Bottomley | 9927c68 | 2008-02-03 15:48:56 -0600 | [diff] [blame] | 470 | struct efd efd = { |
| 471 | .addr = 0, |
| 472 | }; |
James Bottomley | 9927c68 | 2008-02-03 15:48:56 -0600 | [diff] [blame] | 473 | |
James Bottomley | 21fab1d | 2009-08-01 00:43:59 +0000 | [diff] [blame] | 474 | ses_enclosure_data_process(edev, to_scsi_device(edev->edev.parent), 0); |
| 475 | |
Hannes Reinecke | c38c007 | 2014-03-15 09:51:51 +0100 | [diff] [blame] | 476 | if (!sdev->vpd_pg83_len) |
| 477 | return; |
James Bottomley | 671a99c | 2008-07-29 11:38:25 -0500 | [diff] [blame] | 478 | |
Hannes Reinecke | c38c007 | 2014-03-15 09:51:51 +0100 | [diff] [blame] | 479 | desc = sdev->vpd_pg83 + 4; |
| 480 | while (desc < sdev->vpd_pg83 + sdev->vpd_pg83_len) { |
James Bottomley | 9927c68 | 2008-02-03 15:48:56 -0600 | [diff] [blame] | 481 | enum scsi_protocol proto = desc[0] >> 4; |
| 482 | u8 code_set = desc[0] & 0x0f; |
| 483 | u8 piv = desc[1] & 0x80; |
| 484 | u8 assoc = (desc[1] & 0x30) >> 4; |
| 485 | u8 type = desc[1] & 0x0f; |
| 486 | u8 len = desc[3]; |
| 487 | |
Roel Kluin | b3f1f9a | 2009-02-17 16:59:24 +0100 | [diff] [blame] | 488 | if (piv && code_set == 1 && assoc == 1 |
James Bottomley | 9927c68 | 2008-02-03 15:48:56 -0600 | [diff] [blame] | 489 | && proto == SCSI_PROTOCOL_SAS && type == 3 && len == 8) |
Hannes Reinecke | c38c007 | 2014-03-15 09:51:51 +0100 | [diff] [blame] | 490 | efd.addr = get_unaligned_be64(&desc[4]); |
James Bottomley | 9927c68 | 2008-02-03 15:48:56 -0600 | [diff] [blame] | 491 | |
| 492 | desc += len + 4; |
| 493 | } |
Hannes Reinecke | c38c007 | 2014-03-15 09:51:51 +0100 | [diff] [blame] | 494 | if (efd.addr) { |
| 495 | efd.dev = &sdev->sdev_gendev; |
James Bottomley | 9927c68 | 2008-02-03 15:48:56 -0600 | [diff] [blame] | 496 | |
Hannes Reinecke | c38c007 | 2014-03-15 09:51:51 +0100 | [diff] [blame] | 497 | enclosure_for_each_device(ses_enclosure_find_by_addr, &efd); |
| 498 | } |
James Bottomley | 9927c68 | 2008-02-03 15:48:56 -0600 | [diff] [blame] | 499 | } |
| 500 | |
Tony Jones | ee959b0 | 2008-02-22 00:13:36 +0100 | [diff] [blame] | 501 | static int ses_intf_add(struct device *cdev, |
James Bottomley | 9927c68 | 2008-02-03 15:48:56 -0600 | [diff] [blame] | 502 | struct class_interface *intf) |
| 503 | { |
Tony Jones | ee959b0 | 2008-02-22 00:13:36 +0100 | [diff] [blame] | 504 | struct scsi_device *sdev = to_scsi_device(cdev->parent); |
James Bottomley | 9927c68 | 2008-02-03 15:48:56 -0600 | [diff] [blame] | 505 | struct scsi_device *tmp_sdev; |
James Bottomley | 21fab1d | 2009-08-01 00:43:59 +0000 | [diff] [blame] | 506 | unsigned char *buf = NULL, *hdr_buf, *type_ptr; |
James Bottomley | 9927c68 | 2008-02-03 15:48:56 -0600 | [diff] [blame] | 507 | struct ses_device *ses_dev; |
| 508 | u32 result; |
James Bottomley | 21fab1d | 2009-08-01 00:43:59 +0000 | [diff] [blame] | 509 | int i, types, len, components = 0; |
James Bottomley | 9927c68 | 2008-02-03 15:48:56 -0600 | [diff] [blame] | 510 | int err = -ENOMEM; |
James Bottomley | 8c3adc7 | 2011-03-18 11:24:23 -0400 | [diff] [blame] | 511 | int num_enclosures; |
James Bottomley | 9927c68 | 2008-02-03 15:48:56 -0600 | [diff] [blame] | 512 | struct enclosure_device *edev; |
Yinghai Lu | 7c46c20a | 2008-02-10 23:25:25 -0800 | [diff] [blame] | 513 | struct ses_component *scomp = NULL; |
James Bottomley | 9927c68 | 2008-02-03 15:48:56 -0600 | [diff] [blame] | 514 | |
| 515 | if (!scsi_device_enclosure(sdev)) { |
| 516 | /* not an enclosure, but might be in one */ |
James Bottomley | 163f52b | 2009-08-01 00:39:36 +0000 | [diff] [blame] | 517 | struct enclosure_device *prev = NULL; |
| 518 | |
| 519 | while ((edev = enclosure_find(&sdev->host->shost_gendev, prev)) != NULL) { |
James Bottomley | 9927c68 | 2008-02-03 15:48:56 -0600 | [diff] [blame] | 520 | ses_match_to_enclosure(edev, sdev); |
James Bottomley | 163f52b | 2009-08-01 00:39:36 +0000 | [diff] [blame] | 521 | prev = edev; |
James Bottomley | 9927c68 | 2008-02-03 15:48:56 -0600 | [diff] [blame] | 522 | } |
| 523 | return -ENODEV; |
| 524 | } |
| 525 | |
| 526 | /* TYPE_ENCLOSURE prints a message in probe */ |
| 527 | if (sdev->type != TYPE_ENCLOSURE) |
| 528 | sdev_printk(KERN_NOTICE, sdev, "Embedded Enclosure Device\n"); |
| 529 | |
| 530 | ses_dev = kzalloc(sizeof(*ses_dev), GFP_KERNEL); |
| 531 | hdr_buf = kzalloc(INIT_ALLOC_SIZE, GFP_KERNEL); |
| 532 | if (!hdr_buf || !ses_dev) |
| 533 | goto err_init_free; |
| 534 | |
| 535 | result = ses_recv_diag(sdev, 1, hdr_buf, INIT_ALLOC_SIZE); |
| 536 | if (result) |
| 537 | goto recv_failed; |
| 538 | |
James Bottomley | 9927c68 | 2008-02-03 15:48:56 -0600 | [diff] [blame] | 539 | len = (hdr_buf[2] << 8) + hdr_buf[3] + 4; |
| 540 | buf = kzalloc(len, GFP_KERNEL); |
| 541 | if (!buf) |
| 542 | goto err_free; |
| 543 | |
James Bottomley | 9927c68 | 2008-02-03 15:48:56 -0600 | [diff] [blame] | 544 | result = ses_recv_diag(sdev, 1, buf, len); |
| 545 | if (result) |
| 546 | goto recv_failed; |
| 547 | |
James Bottomley | 8c3adc7 | 2011-03-18 11:24:23 -0400 | [diff] [blame] | 548 | types = 0; |
James Bottomley | 9927c68 | 2008-02-03 15:48:56 -0600 | [diff] [blame] | 549 | |
James Bottomley | 8c3adc7 | 2011-03-18 11:24:23 -0400 | [diff] [blame] | 550 | /* we always have one main enclosure and the rest are referred |
| 551 | * to as secondary subenclosures */ |
| 552 | num_enclosures = buf[1] + 1; |
James Bottomley | 9927c68 | 2008-02-03 15:48:56 -0600 | [diff] [blame] | 553 | |
James Bottomley | 8c3adc7 | 2011-03-18 11:24:23 -0400 | [diff] [blame] | 554 | /* begin at the enclosure descriptor */ |
| 555 | type_ptr = buf + 8; |
| 556 | /* skip all the enclosure descriptors */ |
| 557 | for (i = 0; i < num_enclosures && type_ptr < buf + len; i++) { |
| 558 | types += type_ptr[2]; |
| 559 | type_ptr += type_ptr[3] + 4; |
| 560 | } |
| 561 | |
| 562 | ses_dev->page1_types = type_ptr; |
| 563 | ses_dev->page1_num_types = types; |
| 564 | |
| 565 | for (i = 0; i < types && type_ptr < buf + len; i++, type_ptr += 4) { |
James Bottomley | 9927c68 | 2008-02-03 15:48:56 -0600 | [diff] [blame] | 566 | if (type_ptr[0] == ENCLOSURE_COMPONENT_DEVICE || |
| 567 | type_ptr[0] == ENCLOSURE_COMPONENT_ARRAY_DEVICE) |
| 568 | components += type_ptr[1]; |
| 569 | } |
Yinghai Lu | 7c46c20a | 2008-02-10 23:25:25 -0800 | [diff] [blame] | 570 | ses_dev->page1 = buf; |
| 571 | ses_dev->page1_len = len; |
| 572 | buf = NULL; |
James Bottomley | 9927c68 | 2008-02-03 15:48:56 -0600 | [diff] [blame] | 573 | |
| 574 | result = ses_recv_diag(sdev, 2, hdr_buf, INIT_ALLOC_SIZE); |
| 575 | if (result) |
| 576 | goto recv_failed; |
| 577 | |
| 578 | len = (hdr_buf[2] << 8) + hdr_buf[3] + 4; |
| 579 | buf = kzalloc(len, GFP_KERNEL); |
| 580 | if (!buf) |
| 581 | goto err_free; |
| 582 | |
| 583 | /* make sure getting page 2 actually works */ |
| 584 | result = ses_recv_diag(sdev, 2, buf, len); |
| 585 | if (result) |
| 586 | goto recv_failed; |
| 587 | ses_dev->page2 = buf; |
| 588 | ses_dev->page2_len = len; |
Yinghai Lu | 7c46c20a | 2008-02-10 23:25:25 -0800 | [diff] [blame] | 589 | buf = NULL; |
James Bottomley | 9927c68 | 2008-02-03 15:48:56 -0600 | [diff] [blame] | 590 | |
| 591 | /* The additional information page --- allows us |
| 592 | * to match up the devices */ |
| 593 | result = ses_recv_diag(sdev, 10, hdr_buf, INIT_ALLOC_SIZE); |
Yinghai Lu | 691b477 | 2008-02-13 16:25:16 -0800 | [diff] [blame] | 594 | if (!result) { |
James Bottomley | 9927c68 | 2008-02-03 15:48:56 -0600 | [diff] [blame] | 595 | |
Yinghai Lu | 691b477 | 2008-02-13 16:25:16 -0800 | [diff] [blame] | 596 | len = (hdr_buf[2] << 8) + hdr_buf[3] + 4; |
| 597 | buf = kzalloc(len, GFP_KERNEL); |
| 598 | if (!buf) |
| 599 | goto err_free; |
James Bottomley | 9927c68 | 2008-02-03 15:48:56 -0600 | [diff] [blame] | 600 | |
Yinghai Lu | 691b477 | 2008-02-13 16:25:16 -0800 | [diff] [blame] | 601 | result = ses_recv_diag(sdev, 10, buf, len); |
| 602 | if (result) |
| 603 | goto recv_failed; |
| 604 | ses_dev->page10 = buf; |
| 605 | ses_dev->page10_len = len; |
| 606 | buf = NULL; |
| 607 | } |
Yinghai Lu | 7c46c20a | 2008-02-10 23:25:25 -0800 | [diff] [blame] | 608 | scomp = kzalloc(sizeof(struct ses_component) * components, GFP_KERNEL); |
James Bottomley | 9927c68 | 2008-02-03 15:48:56 -0600 | [diff] [blame] | 609 | if (!scomp) |
Yinghai Lu | 7c46c20a | 2008-02-10 23:25:25 -0800 | [diff] [blame] | 610 | goto err_free; |
James Bottomley | 9927c68 | 2008-02-03 15:48:56 -0600 | [diff] [blame] | 611 | |
Kay Sievers | 71610f5 | 2008-12-03 22:41:36 +0100 | [diff] [blame] | 612 | edev = enclosure_register(cdev->parent, dev_name(&sdev->sdev_gendev), |
James Bottomley | 9927c68 | 2008-02-03 15:48:56 -0600 | [diff] [blame] | 613 | components, &ses_enclosure_callbacks); |
| 614 | if (IS_ERR(edev)) { |
| 615 | err = PTR_ERR(edev); |
| 616 | goto err_free; |
| 617 | } |
| 618 | |
Julia Lawall | 9b3a654 | 2010-03-10 15:20:42 -0800 | [diff] [blame] | 619 | kfree(hdr_buf); |
| 620 | |
James Bottomley | 9927c68 | 2008-02-03 15:48:56 -0600 | [diff] [blame] | 621 | edev->scratch = ses_dev; |
| 622 | for (i = 0; i < components; i++) |
Yinghai Lu | 7c46c20a | 2008-02-10 23:25:25 -0800 | [diff] [blame] | 623 | edev->component[i].scratch = scomp + i; |
James Bottomley | 9927c68 | 2008-02-03 15:48:56 -0600 | [diff] [blame] | 624 | |
James Bottomley | 21fab1d | 2009-08-01 00:43:59 +0000 | [diff] [blame] | 625 | ses_enclosure_data_process(edev, sdev, 1); |
James Bottomley | 9927c68 | 2008-02-03 15:48:56 -0600 | [diff] [blame] | 626 | |
| 627 | /* see if there are any devices matching before |
| 628 | * we found the enclosure */ |
| 629 | shost_for_each_device(tmp_sdev, sdev->host) { |
| 630 | if (tmp_sdev->lun != 0 || scsi_device_enclosure(tmp_sdev)) |
| 631 | continue; |
| 632 | ses_match_to_enclosure(edev, tmp_sdev); |
| 633 | } |
| 634 | |
| 635 | return 0; |
| 636 | |
| 637 | recv_failed: |
| 638 | sdev_printk(KERN_ERR, sdev, "Failed to get diagnostic page 0x%x\n", |
| 639 | result); |
| 640 | err = -ENODEV; |
| 641 | err_free: |
| 642 | kfree(buf); |
Yinghai Lu | 7c46c20a | 2008-02-10 23:25:25 -0800 | [diff] [blame] | 643 | kfree(scomp); |
James Bottomley | 9927c68 | 2008-02-03 15:48:56 -0600 | [diff] [blame] | 644 | kfree(ses_dev->page10); |
| 645 | kfree(ses_dev->page2); |
| 646 | kfree(ses_dev->page1); |
| 647 | err_init_free: |
| 648 | kfree(ses_dev); |
| 649 | kfree(hdr_buf); |
| 650 | sdev_printk(KERN_ERR, sdev, "Failed to bind enclosure %d\n", err); |
| 651 | return err; |
| 652 | } |
| 653 | |
| 654 | static int ses_remove(struct device *dev) |
| 655 | { |
| 656 | return 0; |
| 657 | } |
| 658 | |
James Bottomley | 43d8eb9 | 2009-08-01 00:41:22 +0000 | [diff] [blame] | 659 | static void ses_intf_remove_component(struct scsi_device *sdev) |
James Bottomley | 9927c68 | 2008-02-03 15:48:56 -0600 | [diff] [blame] | 660 | { |
James Bottomley | 43d8eb9 | 2009-08-01 00:41:22 +0000 | [diff] [blame] | 661 | struct enclosure_device *edev, *prev = NULL; |
| 662 | |
| 663 | while ((edev = enclosure_find(&sdev->host->shost_gendev, prev)) != NULL) { |
| 664 | prev = edev; |
| 665 | if (!enclosure_remove_device(edev, &sdev->sdev_gendev)) |
| 666 | break; |
| 667 | } |
| 668 | if (edev) |
| 669 | put_device(&edev->edev); |
| 670 | } |
| 671 | |
| 672 | static void ses_intf_remove_enclosure(struct scsi_device *sdev) |
| 673 | { |
James Bottomley | 9927c68 | 2008-02-03 15:48:56 -0600 | [diff] [blame] | 674 | struct enclosure_device *edev; |
| 675 | struct ses_device *ses_dev; |
| 676 | |
James Bottomley | 163f52b | 2009-08-01 00:39:36 +0000 | [diff] [blame] | 677 | /* exact match to this enclosure */ |
James Bottomley | 43d8eb9 | 2009-08-01 00:41:22 +0000 | [diff] [blame] | 678 | edev = enclosure_find(&sdev->sdev_gendev, NULL); |
James Bottomley | 9927c68 | 2008-02-03 15:48:56 -0600 | [diff] [blame] | 679 | if (!edev) |
| 680 | return; |
| 681 | |
| 682 | ses_dev = edev->scratch; |
| 683 | edev->scratch = NULL; |
| 684 | |
Yinghai Lu | 7c46c20a | 2008-02-10 23:25:25 -0800 | [diff] [blame] | 685 | kfree(ses_dev->page10); |
James Bottomley | 9927c68 | 2008-02-03 15:48:56 -0600 | [diff] [blame] | 686 | kfree(ses_dev->page1); |
| 687 | kfree(ses_dev->page2); |
| 688 | kfree(ses_dev); |
| 689 | |
| 690 | kfree(edev->component[0].scratch); |
| 691 | |
Tony Jones | ee959b0 | 2008-02-22 00:13:36 +0100 | [diff] [blame] | 692 | put_device(&edev->edev); |
James Bottomley | 9927c68 | 2008-02-03 15:48:56 -0600 | [diff] [blame] | 693 | enclosure_unregister(edev); |
| 694 | } |
| 695 | |
James Bottomley | 43d8eb9 | 2009-08-01 00:41:22 +0000 | [diff] [blame] | 696 | static void ses_intf_remove(struct device *cdev, |
| 697 | struct class_interface *intf) |
| 698 | { |
| 699 | struct scsi_device *sdev = to_scsi_device(cdev->parent); |
| 700 | |
| 701 | if (!scsi_device_enclosure(sdev)) |
| 702 | ses_intf_remove_component(sdev); |
| 703 | else |
| 704 | ses_intf_remove_enclosure(sdev); |
| 705 | } |
| 706 | |
James Bottomley | 9927c68 | 2008-02-03 15:48:56 -0600 | [diff] [blame] | 707 | static struct class_interface ses_interface = { |
Tony Jones | ee959b0 | 2008-02-22 00:13:36 +0100 | [diff] [blame] | 708 | .add_dev = ses_intf_add, |
| 709 | .remove_dev = ses_intf_remove, |
James Bottomley | 9927c68 | 2008-02-03 15:48:56 -0600 | [diff] [blame] | 710 | }; |
| 711 | |
| 712 | static struct scsi_driver ses_template = { |
James Bottomley | 9927c68 | 2008-02-03 15:48:56 -0600 | [diff] [blame] | 713 | .gendrv = { |
| 714 | .name = "ses", |
Christoph Hellwig | 3af6b35 | 2014-11-12 18:34:51 +0100 | [diff] [blame] | 715 | .owner = THIS_MODULE, |
James Bottomley | 9927c68 | 2008-02-03 15:48:56 -0600 | [diff] [blame] | 716 | .probe = ses_probe, |
| 717 | .remove = ses_remove, |
| 718 | }, |
| 719 | }; |
| 720 | |
| 721 | static int __init ses_init(void) |
| 722 | { |
| 723 | int err; |
| 724 | |
| 725 | err = scsi_register_interface(&ses_interface); |
| 726 | if (err) |
| 727 | return err; |
| 728 | |
| 729 | err = scsi_register_driver(&ses_template.gendrv); |
| 730 | if (err) |
| 731 | goto out_unreg; |
| 732 | |
| 733 | return 0; |
| 734 | |
| 735 | out_unreg: |
| 736 | scsi_unregister_interface(&ses_interface); |
| 737 | return err; |
| 738 | } |
| 739 | |
| 740 | static void __exit ses_exit(void) |
| 741 | { |
| 742 | scsi_unregister_driver(&ses_template.gendrv); |
| 743 | scsi_unregister_interface(&ses_interface); |
| 744 | } |
| 745 | |
| 746 | module_init(ses_init); |
| 747 | module_exit(ses_exit); |
| 748 | |
| 749 | MODULE_ALIAS_SCSI_DEVICE(TYPE_ENCLOSURE); |
| 750 | |
| 751 | MODULE_AUTHOR("James Bottomley"); |
| 752 | MODULE_DESCRIPTION("SCSI Enclosure Services (ses) driver"); |
| 753 | MODULE_LICENSE("GPL v2"); |