diff options
author | Kashyap, Desai <kashyap.desai@lsi.com> | 2009-09-25 02:14:41 -0400 |
---|---|---|
committer | James Bottomley <James.Bottomley@suse.de> | 2009-10-02 10:47:52 -0400 |
commit | 7b936b02293b2891d899233d3f4bb45295e8c1f9 (patch) | |
tree | 462d97406247680f3e0d49f720bde991a0a97538 /drivers | |
parent | 7725ccfda59715ecf8f99e3b520a0b84cc2ea79e (diff) |
[SCSI] mpt2sas: Update driver to MPI2 REV K headers.
Drivers header are updated to the MPI2 REV K headers.
Renamed VF_ID to msix_index in all call back handlers.
VF_ID is removed from all request descriptor.
Signed-off-by: Kashyap Desai <kashyap.desai@lsi.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/scsi/mpt2sas/mpi/mpi2.h | 103 | ||||
-rw-r--r-- | drivers/scsi/mpt2sas/mpi/mpi2_cnfg.h | 200 | ||||
-rw-r--r-- | drivers/scsi/mpt2sas/mpi/mpi2_init.h | 18 | ||||
-rw-r--r-- | drivers/scsi/mpt2sas/mpi/mpi2_ioc.h | 65 | ||||
-rw-r--r-- | drivers/scsi/mpt2sas/mpi/mpi2_tool.h | 134 | ||||
-rw-r--r-- | drivers/scsi/mpt2sas/mpt2sas_base.c | 100 | ||||
-rw-r--r-- | drivers/scsi/mpt2sas/mpt2sas_base.h | 30 | ||||
-rw-r--r-- | drivers/scsi/mpt2sas/mpt2sas_config.c | 10 | ||||
-rw-r--r-- | drivers/scsi/mpt2sas/mpt2sas_ctl.c | 35 | ||||
-rw-r--r-- | drivers/scsi/mpt2sas/mpt2sas_scsih.c | 152 | ||||
-rw-r--r-- | drivers/scsi/mpt2sas/mpt2sas_transport.c | 12 |
11 files changed, 652 insertions, 207 deletions
diff --git a/drivers/scsi/mpt2sas/mpi/mpi2.h b/drivers/scsi/mpt2sas/mpi/mpi2.h index 7bb2ece8b2e4..f9f6c0839276 100644 --- a/drivers/scsi/mpt2sas/mpi/mpi2.h +++ b/drivers/scsi/mpt2sas/mpi/mpi2.h | |||
@@ -8,7 +8,7 @@ | |||
8 | * scatter/gather formats. | 8 | * scatter/gather formats. |
9 | * Creation Date: June 21, 2006 | 9 | * Creation Date: June 21, 2006 |
10 | * | 10 | * |
11 | * mpi2.h Version: 02.00.11 | 11 | * mpi2.h Version: 02.00.12 |
12 | * | 12 | * |
13 | * Version History | 13 | * Version History |
14 | * --------------- | 14 | * --------------- |
@@ -45,6 +45,13 @@ | |||
45 | * 10-02-08 02.00.10 Bumped MPI2_HEADER_VERSION_UNIT. | 45 | * 10-02-08 02.00.10 Bumped MPI2_HEADER_VERSION_UNIT. |
46 | * Moved LUN field defines from mpi2_init.h. | 46 | * Moved LUN field defines from mpi2_init.h. |
47 | * 01-19-09 02.00.11 Bumped MPI2_HEADER_VERSION_UNIT. | 47 | * 01-19-09 02.00.11 Bumped MPI2_HEADER_VERSION_UNIT. |
48 | * 05-06-09 02.00.12 Bumped MPI2_HEADER_VERSION_UNIT. | ||
49 | * In all request and reply descriptors, replaced VF_ID | ||
50 | * field with MSIxIndex field. | ||
51 | * Removed DevHandle field from | ||
52 | * MPI2_SCSI_IO_SUCCESS_REPLY_DESCRIPTOR and made those | ||
53 | * bytes reserved. | ||
54 | * Added RAID Accelerator functionality. | ||
48 | * -------------------------------------------------------------------------- | 55 | * -------------------------------------------------------------------------- |
49 | */ | 56 | */ |
50 | 57 | ||
@@ -70,7 +77,7 @@ | |||
70 | #define MPI2_VERSION_02_00 (0x0200) | 77 | #define MPI2_VERSION_02_00 (0x0200) |
71 | 78 | ||
72 | /* versioning for this MPI header set */ | 79 | /* versioning for this MPI header set */ |
73 | #define MPI2_HEADER_VERSION_UNIT (0x0B) | 80 | #define MPI2_HEADER_VERSION_UNIT (0x0C) |
74 | #define MPI2_HEADER_VERSION_DEV (0x00) | 81 | #define MPI2_HEADER_VERSION_DEV (0x00) |
75 | #define MPI2_HEADER_VERSION_UNIT_MASK (0xFF00) | 82 | #define MPI2_HEADER_VERSION_UNIT_MASK (0xFF00) |
76 | #define MPI2_HEADER_VERSION_UNIT_SHIFT (8) | 83 | #define MPI2_HEADER_VERSION_UNIT_SHIFT (8) |
@@ -257,7 +264,7 @@ typedef volatile struct _MPI2_SYSTEM_INTERFACE_REGS | |||
257 | typedef struct _MPI2_DEFAULT_REQUEST_DESCRIPTOR | 264 | typedef struct _MPI2_DEFAULT_REQUEST_DESCRIPTOR |
258 | { | 265 | { |
259 | U8 RequestFlags; /* 0x00 */ | 266 | U8 RequestFlags; /* 0x00 */ |
260 | U8 VF_ID; /* 0x01 */ | 267 | U8 MSIxIndex; /* 0x01 */ |
261 | U16 SMID; /* 0x02 */ | 268 | U16 SMID; /* 0x02 */ |
262 | U16 LMID; /* 0x04 */ | 269 | U16 LMID; /* 0x04 */ |
263 | U16 DescriptorTypeDependent; /* 0x06 */ | 270 | U16 DescriptorTypeDependent; /* 0x06 */ |
@@ -271,6 +278,7 @@ typedef struct _MPI2_DEFAULT_REQUEST_DESCRIPTOR | |||
271 | #define MPI2_REQ_DESCRIPT_FLAGS_SCSI_TARGET (0x02) | 278 | #define MPI2_REQ_DESCRIPT_FLAGS_SCSI_TARGET (0x02) |
272 | #define MPI2_REQ_DESCRIPT_FLAGS_HIGH_PRIORITY (0x06) | 279 | #define MPI2_REQ_DESCRIPT_FLAGS_HIGH_PRIORITY (0x06) |
273 | #define MPI2_REQ_DESCRIPT_FLAGS_DEFAULT_TYPE (0x08) | 280 | #define MPI2_REQ_DESCRIPT_FLAGS_DEFAULT_TYPE (0x08) |
281 | #define MPI2_REQ_DESCRIPT_FLAGS_RAID_ACCELERATOR (0x0A) | ||
274 | 282 | ||
275 | #define MPI2_REQ_DESCRIPT_FLAGS_IOC_FIFO_MARKER (0x01) | 283 | #define MPI2_REQ_DESCRIPT_FLAGS_IOC_FIFO_MARKER (0x01) |
276 | 284 | ||
@@ -279,7 +287,7 @@ typedef struct _MPI2_DEFAULT_REQUEST_DESCRIPTOR | |||
279 | typedef struct _MPI2_HIGH_PRIORITY_REQUEST_DESCRIPTOR | 287 | typedef struct _MPI2_HIGH_PRIORITY_REQUEST_DESCRIPTOR |
280 | { | 288 | { |
281 | U8 RequestFlags; /* 0x00 */ | 289 | U8 RequestFlags; /* 0x00 */ |
282 | U8 VF_ID; /* 0x01 */ | 290 | U8 MSIxIndex; /* 0x01 */ |
283 | U16 SMID; /* 0x02 */ | 291 | U16 SMID; /* 0x02 */ |
284 | U16 LMID; /* 0x04 */ | 292 | U16 LMID; /* 0x04 */ |
285 | U16 Reserved1; /* 0x06 */ | 293 | U16 Reserved1; /* 0x06 */ |
@@ -293,7 +301,7 @@ typedef struct _MPI2_HIGH_PRIORITY_REQUEST_DESCRIPTOR | |||
293 | typedef struct _MPI2_SCSI_IO_REQUEST_DESCRIPTOR | 301 | typedef struct _MPI2_SCSI_IO_REQUEST_DESCRIPTOR |
294 | { | 302 | { |
295 | U8 RequestFlags; /* 0x00 */ | 303 | U8 RequestFlags; /* 0x00 */ |
296 | U8 VF_ID; /* 0x01 */ | 304 | U8 MSIxIndex; /* 0x01 */ |
297 | U16 SMID; /* 0x02 */ | 305 | U16 SMID; /* 0x02 */ |
298 | U16 LMID; /* 0x04 */ | 306 | U16 LMID; /* 0x04 */ |
299 | U16 DevHandle; /* 0x06 */ | 307 | U16 DevHandle; /* 0x06 */ |
@@ -306,7 +314,7 @@ typedef struct _MPI2_SCSI_IO_REQUEST_DESCRIPTOR | |||
306 | typedef struct _MPI2_SCSI_TARGET_REQUEST_DESCRIPTOR | 314 | typedef struct _MPI2_SCSI_TARGET_REQUEST_DESCRIPTOR |
307 | { | 315 | { |
308 | U8 RequestFlags; /* 0x00 */ | 316 | U8 RequestFlags; /* 0x00 */ |
309 | U8 VF_ID; /* 0x01 */ | 317 | U8 MSIxIndex; /* 0x01 */ |
310 | U16 SMID; /* 0x02 */ | 318 | U16 SMID; /* 0x02 */ |
311 | U16 LMID; /* 0x04 */ | 319 | U16 LMID; /* 0x04 */ |
312 | U16 IoIndex; /* 0x06 */ | 320 | U16 IoIndex; /* 0x06 */ |
@@ -315,14 +323,29 @@ typedef struct _MPI2_SCSI_TARGET_REQUEST_DESCRIPTOR | |||
315 | Mpi2SCSITargetRequestDescriptor_t, | 323 | Mpi2SCSITargetRequestDescriptor_t, |
316 | MPI2_POINTER pMpi2SCSITargetRequestDescriptor_t; | 324 | MPI2_POINTER pMpi2SCSITargetRequestDescriptor_t; |
317 | 325 | ||
326 | |||
327 | /* RAID Accelerator Request Descriptor */ | ||
328 | typedef struct _MPI2_RAID_ACCEL_REQUEST_DESCRIPTOR { | ||
329 | U8 RequestFlags; /* 0x00 */ | ||
330 | U8 MSIxIndex; /* 0x01 */ | ||
331 | U16 SMID; /* 0x02 */ | ||
332 | U16 LMID; /* 0x04 */ | ||
333 | U16 Reserved; /* 0x06 */ | ||
334 | } MPI2_RAID_ACCEL_REQUEST_DESCRIPTOR, | ||
335 | MPI2_POINTER PTR_MPI2_RAID_ACCEL_REQUEST_DESCRIPTOR, | ||
336 | Mpi2RAIDAcceleratorRequestDescriptor_t, | ||
337 | MPI2_POINTER pMpi2RAIDAcceleratorRequestDescriptor_t; | ||
338 | |||
339 | |||
318 | /* union of Request Descriptors */ | 340 | /* union of Request Descriptors */ |
319 | typedef union _MPI2_REQUEST_DESCRIPTOR_UNION | 341 | typedef union _MPI2_REQUEST_DESCRIPTOR_UNION |
320 | { | 342 | { |
321 | MPI2_DEFAULT_REQUEST_DESCRIPTOR Default; | 343 | MPI2_DEFAULT_REQUEST_DESCRIPTOR Default; |
322 | MPI2_HIGH_PRIORITY_REQUEST_DESCRIPTOR HighPriority; | 344 | MPI2_HIGH_PRIORITY_REQUEST_DESCRIPTOR HighPriority; |
323 | MPI2_SCSI_IO_REQUEST_DESCRIPTOR SCSIIO; | 345 | MPI2_SCSI_IO_REQUEST_DESCRIPTOR SCSIIO; |
324 | MPI2_SCSI_TARGET_REQUEST_DESCRIPTOR SCSITarget; | 346 | MPI2_SCSI_TARGET_REQUEST_DESCRIPTOR SCSITarget; |
325 | U64 Words; | 347 | MPI2_RAID_ACCEL_REQUEST_DESCRIPTOR RAIDAccelerator; |
348 | U64 Words; | ||
326 | } MPI2_REQUEST_DESCRIPTOR_UNION, MPI2_POINTER PTR_MPI2_REQUEST_DESCRIPTOR_UNION, | 349 | } MPI2_REQUEST_DESCRIPTOR_UNION, MPI2_POINTER PTR_MPI2_REQUEST_DESCRIPTOR_UNION, |
327 | Mpi2RequestDescriptorUnion_t, MPI2_POINTER pMpi2RequestDescriptorUnion_t; | 350 | Mpi2RequestDescriptorUnion_t, MPI2_POINTER pMpi2RequestDescriptorUnion_t; |
328 | 351 | ||
@@ -333,19 +356,20 @@ typedef union _MPI2_REQUEST_DESCRIPTOR_UNION | |||
333 | typedef struct _MPI2_DEFAULT_REPLY_DESCRIPTOR | 356 | typedef struct _MPI2_DEFAULT_REPLY_DESCRIPTOR |
334 | { | 357 | { |
335 | U8 ReplyFlags; /* 0x00 */ | 358 | U8 ReplyFlags; /* 0x00 */ |
336 | U8 VF_ID; /* 0x01 */ | 359 | U8 MSIxIndex; /* 0x01 */ |
337 | U16 DescriptorTypeDependent1; /* 0x02 */ | 360 | U16 DescriptorTypeDependent1; /* 0x02 */ |
338 | U32 DescriptorTypeDependent2; /* 0x04 */ | 361 | U32 DescriptorTypeDependent2; /* 0x04 */ |
339 | } MPI2_DEFAULT_REPLY_DESCRIPTOR, MPI2_POINTER PTR_MPI2_DEFAULT_REPLY_DESCRIPTOR, | 362 | } MPI2_DEFAULT_REPLY_DESCRIPTOR, MPI2_POINTER PTR_MPI2_DEFAULT_REPLY_DESCRIPTOR, |
340 | Mpi2DefaultReplyDescriptor_t, MPI2_POINTER pMpi2DefaultReplyDescriptor_t; | 363 | Mpi2DefaultReplyDescriptor_t, MPI2_POINTER pMpi2DefaultReplyDescriptor_t; |
341 | 364 | ||
342 | /* defines for the ReplyFlags field */ | 365 | /* defines for the ReplyFlags field */ |
343 | #define MPI2_RPY_DESCRIPT_FLAGS_TYPE_MASK (0x0F) | 366 | #define MPI2_RPY_DESCRIPT_FLAGS_TYPE_MASK (0x0F) |
344 | #define MPI2_RPY_DESCRIPT_FLAGS_SCSI_IO_SUCCESS (0x00) | 367 | #define MPI2_RPY_DESCRIPT_FLAGS_SCSI_IO_SUCCESS (0x00) |
345 | #define MPI2_RPY_DESCRIPT_FLAGS_ADDRESS_REPLY (0x01) | 368 | #define MPI2_RPY_DESCRIPT_FLAGS_ADDRESS_REPLY (0x01) |
346 | #define MPI2_RPY_DESCRIPT_FLAGS_TARGETASSIST_SUCCESS (0x02) | 369 | #define MPI2_RPY_DESCRIPT_FLAGS_TARGETASSIST_SUCCESS (0x02) |
347 | #define MPI2_RPY_DESCRIPT_FLAGS_TARGET_COMMAND_BUFFER (0x03) | 370 | #define MPI2_RPY_DESCRIPT_FLAGS_TARGET_COMMAND_BUFFER (0x03) |
348 | #define MPI2_RPY_DESCRIPT_FLAGS_UNUSED (0x0F) | 371 | #define MPI2_RPY_DESCRIPT_FLAGS_RAID_ACCELERATOR_SUCCESS (0x05) |
372 | #define MPI2_RPY_DESCRIPT_FLAGS_UNUSED (0x0F) | ||
349 | 373 | ||
350 | /* values for marking a reply descriptor as unused */ | 374 | /* values for marking a reply descriptor as unused */ |
351 | #define MPI2_RPY_DESCRIPT_UNUSED_WORD0_MARK (0xFFFFFFFF) | 375 | #define MPI2_RPY_DESCRIPT_UNUSED_WORD0_MARK (0xFFFFFFFF) |
@@ -355,7 +379,7 @@ typedef struct _MPI2_DEFAULT_REPLY_DESCRIPTOR | |||
355 | typedef struct _MPI2_ADDRESS_REPLY_DESCRIPTOR | 379 | typedef struct _MPI2_ADDRESS_REPLY_DESCRIPTOR |
356 | { | 380 | { |
357 | U8 ReplyFlags; /* 0x00 */ | 381 | U8 ReplyFlags; /* 0x00 */ |
358 | U8 VF_ID; /* 0x01 */ | 382 | U8 MSIxIndex; /* 0x01 */ |
359 | U16 SMID; /* 0x02 */ | 383 | U16 SMID; /* 0x02 */ |
360 | U32 ReplyFrameAddress; /* 0x04 */ | 384 | U32 ReplyFrameAddress; /* 0x04 */ |
361 | } MPI2_ADDRESS_REPLY_DESCRIPTOR, MPI2_POINTER PTR_MPI2_ADDRESS_REPLY_DESCRIPTOR, | 385 | } MPI2_ADDRESS_REPLY_DESCRIPTOR, MPI2_POINTER PTR_MPI2_ADDRESS_REPLY_DESCRIPTOR, |
@@ -368,10 +392,10 @@ typedef struct _MPI2_ADDRESS_REPLY_DESCRIPTOR | |||
368 | typedef struct _MPI2_SCSI_IO_SUCCESS_REPLY_DESCRIPTOR | 392 | typedef struct _MPI2_SCSI_IO_SUCCESS_REPLY_DESCRIPTOR |
369 | { | 393 | { |
370 | U8 ReplyFlags; /* 0x00 */ | 394 | U8 ReplyFlags; /* 0x00 */ |
371 | U8 VF_ID; /* 0x01 */ | 395 | U8 MSIxIndex; /* 0x01 */ |
372 | U16 SMID; /* 0x02 */ | 396 | U16 SMID; /* 0x02 */ |
373 | U16 TaskTag; /* 0x04 */ | 397 | U16 TaskTag; /* 0x04 */ |
374 | U16 DevHandle; /* 0x06 */ | 398 | U16 Reserved1; /* 0x06 */ |
375 | } MPI2_SCSI_IO_SUCCESS_REPLY_DESCRIPTOR, | 399 | } MPI2_SCSI_IO_SUCCESS_REPLY_DESCRIPTOR, |
376 | MPI2_POINTER PTR_MPI2_SCSI_IO_SUCCESS_REPLY_DESCRIPTOR, | 400 | MPI2_POINTER PTR_MPI2_SCSI_IO_SUCCESS_REPLY_DESCRIPTOR, |
377 | Mpi2SCSIIOSuccessReplyDescriptor_t, | 401 | Mpi2SCSIIOSuccessReplyDescriptor_t, |
@@ -382,7 +406,7 @@ typedef struct _MPI2_SCSI_IO_SUCCESS_REPLY_DESCRIPTOR | |||
382 | typedef struct _MPI2_TARGETASSIST_SUCCESS_REPLY_DESCRIPTOR | 406 | typedef struct _MPI2_TARGETASSIST_SUCCESS_REPLY_DESCRIPTOR |
383 | { | 407 | { |
384 | U8 ReplyFlags; /* 0x00 */ | 408 | U8 ReplyFlags; /* 0x00 */ |
385 | U8 VF_ID; /* 0x01 */ | 409 | U8 MSIxIndex; /* 0x01 */ |
386 | U16 SMID; /* 0x02 */ | 410 | U16 SMID; /* 0x02 */ |
387 | U8 SequenceNumber; /* 0x04 */ | 411 | U8 SequenceNumber; /* 0x04 */ |
388 | U8 Reserved1; /* 0x05 */ | 412 | U8 Reserved1; /* 0x05 */ |
@@ -397,7 +421,7 @@ typedef struct _MPI2_TARGETASSIST_SUCCESS_REPLY_DESCRIPTOR | |||
397 | typedef struct _MPI2_TARGET_COMMAND_BUFFER_REPLY_DESCRIPTOR | 421 | typedef struct _MPI2_TARGET_COMMAND_BUFFER_REPLY_DESCRIPTOR |
398 | { | 422 | { |
399 | U8 ReplyFlags; /* 0x00 */ | 423 | U8 ReplyFlags; /* 0x00 */ |
400 | U8 VF_ID; /* 0x01 */ | 424 | U8 MSIxIndex; /* 0x01 */ |
401 | U8 VP_ID; /* 0x02 */ | 425 | U8 VP_ID; /* 0x02 */ |
402 | U8 Flags; /* 0x03 */ | 426 | U8 Flags; /* 0x03 */ |
403 | U16 InitiatorDevHandle; /* 0x04 */ | 427 | U16 InitiatorDevHandle; /* 0x04 */ |
@@ -411,15 +435,28 @@ typedef struct _MPI2_TARGET_COMMAND_BUFFER_REPLY_DESCRIPTOR | |||
411 | #define MPI2_RPY_DESCRIPT_TCB_FLAGS_PHYNUM_MASK (0x3F) | 435 | #define MPI2_RPY_DESCRIPT_TCB_FLAGS_PHYNUM_MASK (0x3F) |
412 | 436 | ||
413 | 437 | ||
438 | /* RAID Accelerator Success Reply Descriptor */ | ||
439 | typedef struct _MPI2_RAID_ACCELERATOR_SUCCESS_REPLY_DESCRIPTOR { | ||
440 | U8 ReplyFlags; /* 0x00 */ | ||
441 | U8 MSIxIndex; /* 0x01 */ | ||
442 | U16 SMID; /* 0x02 */ | ||
443 | U32 Reserved; /* 0x04 */ | ||
444 | } MPI2_RAID_ACCELERATOR_SUCCESS_REPLY_DESCRIPTOR, | ||
445 | MPI2_POINTER PTR_MPI2_RAID_ACCELERATOR_SUCCESS_REPLY_DESCRIPTOR, | ||
446 | Mpi2RAIDAcceleratorSuccessReplyDescriptor_t, | ||
447 | MPI2_POINTER pMpi2RAIDAcceleratorSuccessReplyDescriptor_t; | ||
448 | |||
449 | |||
414 | /* union of Reply Descriptors */ | 450 | /* union of Reply Descriptors */ |
415 | typedef union _MPI2_REPLY_DESCRIPTORS_UNION | 451 | typedef union _MPI2_REPLY_DESCRIPTORS_UNION |
416 | { | 452 | { |
417 | MPI2_DEFAULT_REPLY_DESCRIPTOR Default; | 453 | MPI2_DEFAULT_REPLY_DESCRIPTOR Default; |
418 | MPI2_ADDRESS_REPLY_DESCRIPTOR AddressReply; | 454 | MPI2_ADDRESS_REPLY_DESCRIPTOR AddressReply; |
419 | MPI2_SCSI_IO_SUCCESS_REPLY_DESCRIPTOR SCSIIOSuccess; | 455 | MPI2_SCSI_IO_SUCCESS_REPLY_DESCRIPTOR SCSIIOSuccess; |
420 | MPI2_TARGETASSIST_SUCCESS_REPLY_DESCRIPTOR TargetAssistSuccess; | 456 | MPI2_TARGETASSIST_SUCCESS_REPLY_DESCRIPTOR TargetAssistSuccess; |
421 | MPI2_TARGET_COMMAND_BUFFER_REPLY_DESCRIPTOR TargetCommandBuffer; | 457 | MPI2_TARGET_COMMAND_BUFFER_REPLY_DESCRIPTOR TargetCommandBuffer; |
422 | U64 Words; | 458 | MPI2_RAID_ACCELERATOR_SUCCESS_REPLY_DESCRIPTOR RAIDAcceleratorSuccess; |
459 | U64 Words; | ||
423 | } MPI2_REPLY_DESCRIPTORS_UNION, MPI2_POINTER PTR_MPI2_REPLY_DESCRIPTORS_UNION, | 460 | } MPI2_REPLY_DESCRIPTORS_UNION, MPI2_POINTER PTR_MPI2_REPLY_DESCRIPTORS_UNION, |
424 | Mpi2ReplyDescriptorsUnion_t, MPI2_POINTER pMpi2ReplyDescriptorsUnion_t; | 461 | Mpi2ReplyDescriptorsUnion_t, MPI2_POINTER pMpi2ReplyDescriptorsUnion_t; |
425 | 462 | ||
@@ -458,6 +495,7 @@ typedef union _MPI2_REPLY_DESCRIPTORS_UNION | |||
458 | #define MPI2_FUNCTION_DIAG_RELEASE (0x1E) /* Diagnostic Release */ | 495 | #define MPI2_FUNCTION_DIAG_RELEASE (0x1E) /* Diagnostic Release */ |
459 | #define MPI2_FUNCTION_TARGET_CMD_BUF_BASE_POST (0x24) /* Target Command Buffer Post Base */ | 496 | #define MPI2_FUNCTION_TARGET_CMD_BUF_BASE_POST (0x24) /* Target Command Buffer Post Base */ |
460 | #define MPI2_FUNCTION_TARGET_CMD_BUF_LIST_POST (0x25) /* Target Command Buffer Post List */ | 497 | #define MPI2_FUNCTION_TARGET_CMD_BUF_LIST_POST (0x25) /* Target Command Buffer Post List */ |
498 | #define MPI2_FUNCTION_RAID_ACCELERATOR (0x2C) /* RAID Accelerator*/ | ||
461 | 499 | ||
462 | 500 | ||
463 | 501 | ||
@@ -555,12 +593,17 @@ typedef union _MPI2_REPLY_DESCRIPTORS_UNION | |||
555 | 593 | ||
556 | #define MPI2_IOCSTATUS_DIAGNOSTIC_RELEASED (0x00A0) | 594 | #define MPI2_IOCSTATUS_DIAGNOSTIC_RELEASED (0x00A0) |
557 | 595 | ||
596 | /**************************************************************************** | ||
597 | * RAID Accelerator values | ||
598 | ****************************************************************************/ | ||
599 | |||
600 | #define MPI2_IOCSTATUS_RAID_ACCEL_ERROR (0x00B0) | ||
558 | 601 | ||
559 | /**************************************************************************** | 602 | /**************************************************************************** |
560 | * IOCStatus flag to indicate that log info is available | 603 | * IOCStatus flag to indicate that log info is available |
561 | ****************************************************************************/ | 604 | ****************************************************************************/ |
562 | 605 | ||
563 | #define MPI2_IOCSTATUS_FLAG_LOG_INFO_AVAILABLE (0x8000) | 606 | #define MPI2_IOCSTATUS_FLAG_LOG_INFO_AVAILABLE (0x8000) |
564 | 607 | ||
565 | /**************************************************************************** | 608 | /**************************************************************************** |
566 | * IOCLogInfo Types | 609 | * IOCLogInfo Types |
diff --git a/drivers/scsi/mpt2sas/mpi/mpi2_cnfg.h b/drivers/scsi/mpt2sas/mpi/mpi2_cnfg.h index 2f27cf6d6c65..ab47c4679640 100644 --- a/drivers/scsi/mpt2sas/mpi/mpi2_cnfg.h +++ b/drivers/scsi/mpt2sas/mpi/mpi2_cnfg.h | |||
@@ -6,7 +6,7 @@ | |||
6 | * Title: MPI Configuration messages and pages | 6 | * Title: MPI Configuration messages and pages |
7 | * Creation Date: November 10, 2006 | 7 | * Creation Date: November 10, 2006 |
8 | * | 8 | * |
9 | * mpi2_cnfg.h Version: 02.00.10 | 9 | * mpi2_cnfg.h Version: 02.00.11 |
10 | * | 10 | * |
11 | * Version History | 11 | * Version History |
12 | * --------------- | 12 | * --------------- |
@@ -95,6 +95,11 @@ | |||
95 | * Added MPI2_SAS_DEVICE0_ASTATUS_DEVICE_BLOCKED define. | 95 | * Added MPI2_SAS_DEVICE0_ASTATUS_DEVICE_BLOCKED define. |
96 | * Added PortGroups, DmaGroup, and ControlGroup fields to | 96 | * Added PortGroups, DmaGroup, and ControlGroup fields to |
97 | * SAS Device Page 0. | 97 | * SAS Device Page 0. |
98 | * 05-06-09 02.00.11 Added structures and defines for IO Unit Page 5 and IO | ||
99 | * Unit Page 6. | ||
100 | * Added expander reduced functionality data to SAS | ||
101 | * Expander Page 0. | ||
102 | * Added SAS PHY Page 2 and SAS PHY Page 3. | ||
98 | * -------------------------------------------------------------------------- | 103 | * -------------------------------------------------------------------------- |
99 | */ | 104 | */ |
100 | 105 | ||
@@ -723,6 +728,65 @@ typedef struct _MPI2_CONFIG_PAGE_IO_UNIT_3 | |||
723 | #define MPI2_IOUNITPAGE3_GPIO_SETTING_ON (0x0001) | 728 | #define MPI2_IOUNITPAGE3_GPIO_SETTING_ON (0x0001) |
724 | 729 | ||
725 | 730 | ||
731 | /* IO Unit Page 5 */ | ||
732 | |||
733 | /* | ||
734 | * Upper layer code (drivers, utilities, etc.) should leave this define set to | ||
735 | * one and check Header.PageLength or NumDmaEngines at runtime. | ||
736 | */ | ||
737 | #ifndef MPI2_IOUNITPAGE5_DMAENGINE_ENTRIES | ||
738 | #define MPI2_IOUNITPAGE5_DMAENGINE_ENTRIES (1) | ||
739 | #endif | ||
740 | |||
741 | typedef struct _MPI2_CONFIG_PAGE_IO_UNIT_5 { | ||
742 | MPI2_CONFIG_PAGE_HEADER Header; /* 0x00 */ | ||
743 | U64 RaidAcceleratorBufferBaseAddress; /* 0x04 */ | ||
744 | U64 RaidAcceleratorBufferSize; /* 0x0C */ | ||
745 | U64 RaidAcceleratorControlBaseAddress; /* 0x14 */ | ||
746 | U8 RAControlSize; /* 0x1C */ | ||
747 | U8 NumDmaEngines; /* 0x1D */ | ||
748 | U8 RAMinControlSize; /* 0x1E */ | ||
749 | U8 RAMaxControlSize; /* 0x1F */ | ||
750 | U32 Reserved1; /* 0x20 */ | ||
751 | U32 Reserved2; /* 0x24 */ | ||
752 | U32 Reserved3; /* 0x28 */ | ||
753 | U32 DmaEngineCapabilities | ||
754 | [MPI2_IOUNITPAGE5_DMAENGINE_ENTRIES]; /* 0x2C */ | ||
755 | } MPI2_CONFIG_PAGE_IO_UNIT_5, MPI2_POINTER PTR_MPI2_CONFIG_PAGE_IO_UNIT_5, | ||
756 | Mpi2IOUnitPage5_t, MPI2_POINTER pMpi2IOUnitPage5_t; | ||
757 | |||
758 | #define MPI2_IOUNITPAGE5_PAGEVERSION (0x00) | ||
759 | |||
760 | /* defines for IO Unit Page 5 DmaEngineCapabilities field */ | ||
761 | #define MPI2_IOUNITPAGE5_DMA_CAP_MASK_MAX_REQUESTS (0xFF00) | ||
762 | #define MPI2_IOUNITPAGE5_DMA_CAP_SHIFT_MAX_REQUESTS (16) | ||
763 | |||
764 | #define MPI2_IOUNITPAGE5_DMA_CAP_EEDP (0x0008) | ||
765 | #define MPI2_IOUNITPAGE5_DMA_CAP_PARITY_GENERATION (0x0004) | ||
766 | #define MPI2_IOUNITPAGE5_DMA_CAP_HASHING (0x0002) | ||
767 | #define MPI2_IOUNITPAGE5_DMA_CAP_ENCRYPTION (0x0001) | ||
768 | |||
769 | |||
770 | /* IO Unit Page 6 */ | ||
771 | |||
772 | typedef struct _MPI2_CONFIG_PAGE_IO_UNIT_6 { | ||
773 | MPI2_CONFIG_PAGE_HEADER Header; /* 0x00 */ | ||
774 | U16 Flags; /* 0x04 */ | ||
775 | U8 RAHostControlSize; /* 0x06 */ | ||
776 | U8 Reserved0; /* 0x07 */ | ||
777 | U64 RaidAcceleratorHostControlBaseAddress; /* 0x08 */ | ||
778 | U32 Reserved1; /* 0x10 */ | ||
779 | U32 Reserved2; /* 0x14 */ | ||
780 | U32 Reserved3; /* 0x18 */ | ||
781 | } MPI2_CONFIG_PAGE_IO_UNIT_6, MPI2_POINTER PTR_MPI2_CONFIG_PAGE_IO_UNIT_6, | ||
782 | Mpi2IOUnitPage6_t, MPI2_POINTER pMpi2IOUnitPage6_t; | ||
783 | |||
784 | #define MPI2_IOUNITPAGE6_PAGEVERSION (0x00) | ||
785 | |||
786 | /* defines for IO Unit Page 6 Flags field */ | ||
787 | #define MPI2_IOUNITPAGE6_FLAGS_ENABLE_RAID_ACCELERATOR (0x0001) | ||
788 | |||
789 | |||
726 | /**************************************************************************** | 790 | /**************************************************************************** |
727 | * IOC Config Pages | 791 | * IOC Config Pages |
728 | ****************************************************************************/ | 792 | ****************************************************************************/ |
@@ -1709,10 +1773,14 @@ typedef struct _MPI2_CONFIG_PAGE_EXPANDER_0 | |||
1709 | U64 ActiveZoneManagerSASAddress;/* 0x2C */ | 1773 | U64 ActiveZoneManagerSASAddress;/* 0x2C */ |
1710 | U16 ZoneLockInactivityLimit; /* 0x34 */ | 1774 | U16 ZoneLockInactivityLimit; /* 0x34 */ |
1711 | U16 Reserved1; /* 0x36 */ | 1775 | U16 Reserved1; /* 0x36 */ |
1776 | U8 TimeToReducedFunc; /* 0x38 */ | ||
1777 | U8 InitialTimeToReducedFunc; /* 0x39 */ | ||
1778 | U8 MaxReducedFuncTime; /* 0x3A */ | ||
1779 | U8 Reserved2; /* 0x3B */ | ||
1712 | } MPI2_CONFIG_PAGE_EXPANDER_0, MPI2_POINTER PTR_MPI2_CONFIG_PAGE_EXPANDER_0, | 1780 | } MPI2_CONFIG_PAGE_EXPANDER_0, MPI2_POINTER PTR_MPI2_CONFIG_PAGE_EXPANDER_0, |
1713 | Mpi2ExpanderPage0_t, MPI2_POINTER pMpi2ExpanderPage0_t; | 1781 | Mpi2ExpanderPage0_t, MPI2_POINTER pMpi2ExpanderPage0_t; |
1714 | 1782 | ||
1715 | #define MPI2_SASEXPANDER0_PAGEVERSION (0x05) | 1783 | #define MPI2_SASEXPANDER0_PAGEVERSION (0x06) |
1716 | 1784 | ||
1717 | /* values for SAS Expander Page 0 DiscoveryStatus field */ | 1785 | /* values for SAS Expander Page 0 DiscoveryStatus field */ |
1718 | #define MPI2_SAS_EXPANDER0_DS_MAX_ENCLOSURES_EXCEED (0x80000000) | 1786 | #define MPI2_SAS_EXPANDER0_DS_MAX_ENCLOSURES_EXCEED (0x80000000) |
@@ -1737,6 +1805,7 @@ typedef struct _MPI2_CONFIG_PAGE_EXPANDER_0 | |||
1737 | #define MPI2_SAS_EXPANDER0_DS_LOOP_DETECTED (0x00000001) | 1805 | #define MPI2_SAS_EXPANDER0_DS_LOOP_DETECTED (0x00000001) |
1738 | 1806 | ||
1739 | /* values for SAS Expander Page 0 Flags field */ | 1807 | /* values for SAS Expander Page 0 Flags field */ |
1808 | #define MPI2_SAS_EXPANDER0_FLAGS_REDUCED_FUNCTIONALITY (0x2000) | ||
1740 | #define MPI2_SAS_EXPANDER0_FLAGS_ZONE_LOCKED (0x1000) | 1809 | #define MPI2_SAS_EXPANDER0_FLAGS_ZONE_LOCKED (0x1000) |
1741 | #define MPI2_SAS_EXPANDER0_FLAGS_SUPPORTED_PHYSICAL_PRES (0x0800) | 1810 | #define MPI2_SAS_EXPANDER0_FLAGS_SUPPORTED_PHYSICAL_PRES (0x0800) |
1742 | #define MPI2_SAS_EXPANDER0_FLAGS_ASSERTED_PHYSICAL_PRES (0x0400) | 1811 | #define MPI2_SAS_EXPANDER0_FLAGS_ASSERTED_PHYSICAL_PRES (0x0400) |
@@ -1944,6 +2013,133 @@ typedef struct _MPI2_CONFIG_PAGE_SAS_PHY_1 | |||
1944 | #define MPI2_SASPHY1_PAGEVERSION (0x01) | 2013 | #define MPI2_SASPHY1_PAGEVERSION (0x01) |
1945 | 2014 | ||
1946 | 2015 | ||
2016 | /* SAS PHY Page 2 */ | ||
2017 | |||
2018 | typedef struct _MPI2_SASPHY2_PHY_EVENT { | ||
2019 | U8 PhyEventCode; /* 0x00 */ | ||
2020 | U8 Reserved1; /* 0x01 */ | ||
2021 | U16 Reserved2; /* 0x02 */ | ||
2022 | U32 PhyEventInfo; /* 0x04 */ | ||
2023 | } MPI2_SASPHY2_PHY_EVENT, MPI2_POINTER PTR_MPI2_SASPHY2_PHY_EVENT, | ||
2024 | Mpi2SasPhy2PhyEvent_t, MPI2_POINTER pMpi2SasPhy2PhyEvent_t; | ||
2025 | |||
2026 | /* use MPI2_SASPHY3_EVENT_CODE_ for the PhyEventCode field */ | ||
2027 | |||
2028 | |||
2029 | /* | ||
2030 | * Host code (drivers, BIOS, utilities, etc.) should leave this define set to | ||
2031 | * one and check Header.ExtPageLength or NumPhyEvents at runtime. | ||
2032 | */ | ||
2033 | #ifndef MPI2_SASPHY2_PHY_EVENT_MAX | ||
2034 | #define MPI2_SASPHY2_PHY_EVENT_MAX (1) | ||
2035 | #endif | ||
2036 | |||
2037 | typedef struct _MPI2_CONFIG_PAGE_SAS_PHY_2 { | ||
2038 | MPI2_CONFIG_EXTENDED_PAGE_HEADER Header; /* 0x00 */ | ||
2039 | U32 Reserved1; /* 0x08 */ | ||
2040 | U8 NumPhyEvents; /* 0x0C */ | ||
2041 | U8 Reserved2; /* 0x0D */ | ||
2042 | U16 Reserved3; /* 0x0E */ | ||
2043 | MPI2_SASPHY2_PHY_EVENT PhyEvent[MPI2_SASPHY2_PHY_EVENT_MAX]; | ||
2044 | /* 0x10 */ | ||
2045 | } MPI2_CONFIG_PAGE_SAS_PHY_2, MPI2_POINTER PTR_MPI2_CONFIG_PAGE_SAS_PHY_2, | ||
2046 | Mpi2SasPhyPage2_t, MPI2_POINTER pMpi2SasPhyPage2_t; | ||
2047 | |||
2048 | #define MPI2_SASPHY2_PAGEVERSION (0x00) | ||
2049 | |||
2050 | |||
2051 | /* SAS PHY Page 3 */ | ||
2052 | |||
2053 | typedef struct _MPI2_SASPHY3_PHY_EVENT_CONFIG { | ||
2054 | U8 PhyEventCode; /* 0x00 */ | ||
2055 | U8 Reserved1; /* 0x01 */ | ||
2056 | U16 Reserved2; /* 0x02 */ | ||
2057 | U8 CounterType; /* 0x04 */ | ||
2058 | U8 ThresholdWindow; /* 0x05 */ | ||
2059 | U8 TimeUnits; /* 0x06 */ | ||
2060 | U8 Reserved3; /* 0x07 */ | ||
2061 | U32 EventThreshold; /* 0x08 */ | ||
2062 | U16 ThresholdFlags; /* 0x0C */ | ||
2063 | U16 Reserved4; /* 0x0E */ | ||
2064 | } MPI2_SASPHY3_PHY_EVENT_CONFIG, MPI2_POINTER PTR_MPI2_SASPHY3_PHY_EVENT_CONFIG, | ||
2065 | Mpi2SasPhy3PhyEventConfig_t, MPI2_POINTER pMpi2SasPhy3PhyEventConfig_t; | ||
2066 | |||
2067 | /* values for PhyEventCode field */ | ||
2068 | #define MPI2_SASPHY3_EVENT_CODE_NO_EVENT (0x00) | ||
2069 | #define MPI2_SASPHY3_EVENT_CODE_INVALID_DWORD (0x01) | ||
2070 | #define MPI2_SASPHY3_EVENT_CODE_RUNNING_DISPARITY_ERROR (0x02) | ||
2071 | #define MPI2_SASPHY3_EVENT_CODE_LOSS_DWORD_SYNC (0x03) | ||
2072 | #define MPI2_SASPHY3_EVENT_CODE_PHY_RESET_PROBLEM (0x04) | ||
2073 | #define MPI2_SASPHY3_EVENT_CODE_ELASTICITY_BUF_OVERFLOW (0x05) | ||
2074 | #define MPI2_SASPHY3_EVENT_CODE_RX_ERROR (0x06) | ||
2075 | #define MPI2_SASPHY3_EVENT_CODE_RX_ADDR_FRAME_ERROR (0x20) | ||
2076 | #define MPI2_SASPHY3_EVENT_CODE_TX_AC_OPEN_REJECT (0x21) | ||
2077 | #define MPI2_SASPHY3_EVENT_CODE_RX_AC_OPEN_REJECT (0x22) | ||
2078 | #define MPI2_SASPHY3_EVENT_CODE_TX_RC_OPEN_REJECT (0x23) | ||
2079 | #define MPI2_SASPHY3_EVENT_CODE_RX_RC_OPEN_REJECT (0x24) | ||
2080 | #define MPI2_SASPHY3_EVENT_CODE_RX_AIP_PARTIAL_WAITING_ON (0x25) | ||
2081 | #define MPI2_SASPHY3_EVENT_CODE_RX_AIP_CONNECT_WAITING_ON (0x26) | ||
2082 | #define MPI2_SASPHY3_EVENT_CODE_TX_BREAK (0x27) | ||
2083 | #define MPI2_SASPHY3_EVENT_CODE_RX_BREAK (0x28) | ||
2084 | #define MPI2_SASPHY3_EVENT_CODE_BREAK_TIMEOUT (0x29) | ||
2085 | #define MPI2_SASPHY3_EVENT_CODE_CONNECTION (0x2A) | ||
2086 | #define MPI2_SASPHY3_EVENT_CODE_PEAKTX_PATHWAY_BLOCKED (0x2B) | ||
2087 | #define MPI2_SASPHY3_EVENT_CODE_PEAKTX_ARB_WAIT_TIME (0x2C) | ||
2088 | #define MPI2_SASPHY3_EVENT_CODE_PEAK_ARB_WAIT_TIME (0x2D) | ||
2089 | #define MPI2_SASPHY3_EVENT_CODE_PEAK_CONNECT_TIME (0x2E) | ||
2090 | #define MPI2_SASPHY3_EVENT_CODE_TX_SSP_FRAMES (0x40) | ||
2091 | #define MPI2_SASPHY3_EVENT_CODE_RX_SSP_FRAMES (0x41) | ||
2092 | #define MPI2_SASPHY3_EVENT_CODE_TX_SSP_ERROR_FRAMES (0x42) | ||
2093 | #define MPI2_SASPHY3_EVENT_CODE_RX_SSP_ERROR_FRAMES (0x43) | ||
2094 | #define MPI2_SASPHY3_EVENT_CODE_TX_CREDIT_BLOCKED (0x44) | ||
2095 | #define MPI2_SASPHY3_EVENT_CODE_RX_CREDIT_BLOCKED (0x45) | ||
2096 | #define MPI2_SASPHY3_EVENT_CODE_TX_SATA_FRAMES (0x50) | ||
2097 | #define MPI2_SASPHY3_EVENT_CODE_RX_SATA_FRAMES (0x51) | ||
2098 | #define MPI2_SASPHY3_EVENT_CODE_SATA_OVERFLOW (0x52) | ||
2099 | #define MPI2_SASPHY3_EVENT_CODE_TX_SMP_FRAMES (0x60) | ||
2100 | #define MPI2_SASPHY3_EVENT_CODE_RX_SMP_FRAMES (0x61) | ||
2101 | #define MPI2_SASPHY3_EVENT_CODE_RX_SMP_ERROR_FRAMES (0x63) | ||
2102 | #define MPI2_SASPHY3_EVENT_CODE_HOTPLUG_TIMEOUT (0xD0) | ||
2103 | #define MPI2_SASPHY3_EVENT_CODE_MISALIGNED_MUX_PRIMITIVE (0xD1) | ||
2104 | #define MPI2_SASPHY3_EVENT_CODE_RX_AIP (0xD2) | ||
2105 | |||
2106 | /* values for the CounterType field */ | ||
2107 | #define MPI2_SASPHY3_COUNTER_TYPE_WRAPPING (0x00) | ||
2108 | #define MPI2_SASPHY3_COUNTER_TYPE_SATURATING (0x01) | ||
2109 | #define MPI2_SASPHY3_COUNTER_TYPE_PEAK_VALUE (0x02) | ||
2110 | |||
2111 | /* values for the TimeUnits field */ | ||
2112 | #define MPI2_SASPHY3_TIME_UNITS_10_MICROSECONDS (0x00) | ||
2113 | #define MPI2_SASPHY3_TIME_UNITS_100_MICROSECONDS (0x01) | ||
2114 | #define MPI2_SASPHY3_TIME_UNITS_1_MILLISECOND (0x02) | ||
2115 | #define MPI2_SASPHY3_TIME_UNITS_10_MILLISECONDS (0x03) | ||
2116 | |||
2117 | /* values for the ThresholdFlags field */ | ||
2118 | #define MPI2_SASPHY3_TFLAGS_PHY_RESET (0x0002) | ||
2119 | #define MPI2_SASPHY3_TFLAGS_EVENT_NOTIFY (0x0001) | ||
2120 | |||
2121 | /* | ||
2122 | * Host code (drivers, BIOS, utilities, etc.) should leave this define set to | ||
2123 | * one and check Header.ExtPageLength or NumPhyEvents at runtime. | ||
2124 | */ | ||
2125 | #ifndef MPI2_SASPHY3_PHY_EVENT_MAX | ||
2126 | #define MPI2_SASPHY3_PHY_EVENT_MAX (1) | ||
2127 | #endif | ||
2128 | |||
2129 | typedef struct _MPI2_CONFIG_PAGE_SAS_PHY_3 { | ||
2130 | MPI2_CONFIG_EXTENDED_PAGE_HEADER Header; /* 0x00 */ | ||
2131 | U32 Reserved1; /* 0x08 */ | ||
2132 | U8 NumPhyEvents; /* 0x0C */ | ||
2133 | U8 Reserved2; /* 0x0D */ | ||
2134 | U16 Reserved3; /* 0x0E */ | ||
2135 | MPI2_SASPHY3_PHY_EVENT_CONFIG PhyEventConfig | ||
2136 | [MPI2_SASPHY3_PHY_EVENT_MAX]; /* 0x10 */ | ||
2137 | } MPI2_CONFIG_PAGE_SAS_PHY_3, MPI2_POINTER PTR_MPI2_CONFIG_PAGE_SAS_PHY_3, | ||
2138 | Mpi2SasPhyPage3_t, MPI2_POINTER pMpi2SasPhyPage3_t; | ||
2139 | |||
2140 | #define MPI2_SASPHY3_PAGEVERSION (0x00) | ||
2141 | |||
2142 | |||
1947 | /**************************************************************************** | 2143 | /**************************************************************************** |
1948 | * SAS Port Config Pages | 2144 | * SAS Port Config Pages |
1949 | ****************************************************************************/ | 2145 | ****************************************************************************/ |
diff --git a/drivers/scsi/mpt2sas/mpi/mpi2_init.h b/drivers/scsi/mpt2sas/mpi/mpi2_init.h index f1115f0f0eb2..563e56d2e945 100644 --- a/drivers/scsi/mpt2sas/mpi/mpi2_init.h +++ b/drivers/scsi/mpt2sas/mpi/mpi2_init.h | |||
@@ -1,12 +1,12 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (c) 2000-2008 LSI Corporation. | 2 | * Copyright (c) 2000-2009 LSI Corporation. |
3 | * | 3 | * |
4 | * | 4 | * |
5 | * Name: mpi2_init.h | 5 | * Name: mpi2_init.h |
6 | * Title: MPI SCSI initiator mode messages and structures | 6 | * Title: MPI SCSI initiator mode messages and structures |
7 | * Creation Date: June 23, 2006 | 7 | * Creation Date: June 23, 2006 |
8 | * | 8 | * |
9 | * mpi2_init.h Version: 02.00.06 | 9 | * mpi2_init.h Version: 02.00.07 |
10 | * | 10 | * |
11 | * Version History | 11 | * Version History |
12 | * --------------- | 12 | * --------------- |
@@ -23,6 +23,10 @@ | |||
23 | * Control field Task Attribute flags. | 23 | * Control field Task Attribute flags. |
24 | * Moved LUN field defines to mpi2.h becasue they are | 24 | * Moved LUN field defines to mpi2.h becasue they are |
25 | * common to many structures. | 25 | * common to many structures. |
26 | * 05-06-09 02.00.07 Changed task management type of Query Unit Attention to | ||
27 | * Query Asynchronous Event. | ||
28 | * Defined two new bits in the SlotStatus field of the SCSI | ||
29 | * Enclosure Processor Request and Reply. | ||
26 | * -------------------------------------------------------------------------- | 30 | * -------------------------------------------------------------------------- |
27 | */ | 31 | */ |
28 | 32 | ||
@@ -289,7 +293,11 @@ typedef struct _MPI2_SCSI_TASK_MANAGE_REQUEST | |||
289 | #define MPI2_SCSITASKMGMT_TASKTYPE_QUERY_TASK (0x07) | 293 | #define MPI2_SCSITASKMGMT_TASKTYPE_QUERY_TASK (0x07) |
290 | #define MPI2_SCSITASKMGMT_TASKTYPE_CLR_ACA (0x08) | 294 | #define MPI2_SCSITASKMGMT_TASKTYPE_CLR_ACA (0x08) |
291 | #define MPI2_SCSITASKMGMT_TASKTYPE_QRY_TASK_SET (0x09) | 295 | #define MPI2_SCSITASKMGMT_TASKTYPE_QRY_TASK_SET (0x09) |
292 | #define MPI2_SCSITASKMGMT_TASKTYPE_QRY_UNIT_ATTENTION (0x0A) | 296 | #define MPI2_SCSITASKMGMT_TASKTYPE_QRY_ASYNC_EVENT (0x0A) |
297 | |||
298 | /* obsolete TaskType name */ | ||
299 | #define MPI2_SCSITASKMGMT_TASKTYPE_QRY_UNIT_ATTENTION \ | ||
300 | (MPI2_SCSITASKMGMT_TASKTYPE_QRY_ASYNC_EVENT) | ||
293 | 301 | ||
294 | /* MsgFlags bits */ | 302 | /* MsgFlags bits */ |
295 | 303 | ||
@@ -375,6 +383,8 @@ typedef struct _MPI2_SEP_REQUEST | |||
375 | #define MPI2_SEP_REQ_SLOTSTATUS_HOT_SPARE (0x00000100) | 383 | #define MPI2_SEP_REQ_SLOTSTATUS_HOT_SPARE (0x00000100) |
376 | #define MPI2_SEP_REQ_SLOTSTATUS_UNCONFIGURED (0x00000080) | 384 | #define MPI2_SEP_REQ_SLOTSTATUS_UNCONFIGURED (0x00000080) |
377 | #define MPI2_SEP_REQ_SLOTSTATUS_PREDICTED_FAULT (0x00000040) | 385 | #define MPI2_SEP_REQ_SLOTSTATUS_PREDICTED_FAULT (0x00000040) |
386 | #define MPI2_SEP_REQ_SLOTSTATUS_IN_CRITICAL_ARRAY (0x00000010) | ||
387 | #define MPI2_SEP_REQ_SLOTSTATUS_IN_FAILED_ARRAY (0x00000008) | ||
378 | #define MPI2_SEP_REQ_SLOTSTATUS_DEV_REBUILDING (0x00000004) | 388 | #define MPI2_SEP_REQ_SLOTSTATUS_DEV_REBUILDING (0x00000004) |
379 | #define MPI2_SEP_REQ_SLOTSTATUS_DEV_FAULTY (0x00000002) | 389 | #define MPI2_SEP_REQ_SLOTSTATUS_DEV_FAULTY (0x00000002) |
380 | #define MPI2_SEP_REQ_SLOTSTATUS_NO_ERROR (0x00000001) | 390 | #define MPI2_SEP_REQ_SLOTSTATUS_NO_ERROR (0x00000001) |
@@ -410,6 +420,8 @@ typedef struct _MPI2_SEP_REPLY | |||
410 | #define MPI2_SEP_REPLY_SLOTSTATUS_HOT_SPARE (0x00000100) | 420 | #define MPI2_SEP_REPLY_SLOTSTATUS_HOT_SPARE (0x00000100) |
411 | #define MPI2_SEP_REPLY_SLOTSTATUS_UNCONFIGURED (0x00000080) | 421 | #define MPI2_SEP_REPLY_SLOTSTATUS_UNCONFIGURED (0x00000080) |
412 | #define MPI2_SEP_REPLY_SLOTSTATUS_PREDICTED_FAULT (0x00000040) | 422 | #define MPI2_SEP_REPLY_SLOTSTATUS_PREDICTED_FAULT (0x00000040) |
423 | #define MPI2_SEP_REPLY_SLOTSTATUS_IN_CRITICAL_ARRAY (0x00000010) | ||
424 | #define MPI2_SEP_REPLY_SLOTSTATUS_IN_FAILED_ARRAY (0x00000008) | ||
413 | #define MPI2_SEP_REPLY_SLOTSTATUS_DEV_REBUILDING (0x00000004) | 425 | #define MPI2_SEP_REPLY_SLOTSTATUS_DEV_REBUILDING (0x00000004) |
414 | #define MPI2_SEP_REPLY_SLOTSTATUS_DEV_FAULTY (0x00000002) | 426 | #define MPI2_SEP_REPLY_SLOTSTATUS_DEV_FAULTY (0x00000002) |
415 | #define MPI2_SEP_REPLY_SLOTSTATUS_NO_ERROR (0x00000001) | 427 | #define MPI2_SEP_REPLY_SLOTSTATUS_NO_ERROR (0x00000001) |
diff --git a/drivers/scsi/mpt2sas/mpi/mpi2_ioc.h b/drivers/scsi/mpt2sas/mpi/mpi2_ioc.h index 8c5d81870c03..c294128bdeb4 100644 --- a/drivers/scsi/mpt2sas/mpi/mpi2_ioc.h +++ b/drivers/scsi/mpt2sas/mpi/mpi2_ioc.h | |||
@@ -6,7 +6,7 @@ | |||
6 | * Title: MPI IOC, Port, Event, FW Download, and FW Upload messages | 6 | * Title: MPI IOC, Port, Event, FW Download, and FW Upload messages |
7 | * Creation Date: October 11, 2006 | 7 | * Creation Date: October 11, 2006 |
8 | * | 8 | * |
9 | * mpi2_ioc.h Version: 02.00.10 | 9 | * mpi2_ioc.h Version: 02.00.11 |
10 | * | 10 | * |
11 | * Version History | 11 | * Version History |
12 | * --------------- | 12 | * --------------- |
@@ -79,6 +79,11 @@ | |||
79 | * Added MPI2_EVENT_SAS_DEV_STAT_RC_SATA_INIT_FAILURE | 79 | * Added MPI2_EVENT_SAS_DEV_STAT_RC_SATA_INIT_FAILURE |
80 | * define. | 80 | * define. |
81 | * Removed MPI2_EVENT_SAS_DISC_DS_SATA_INIT_FAILURE define. | 81 | * Removed MPI2_EVENT_SAS_DISC_DS_SATA_INIT_FAILURE define. |
82 | * 05-06-09 02.00.11 Added MPI2_IOCFACTS_CAPABILITY_RAID_ACCELERATOR define. | ||
83 | * Added MPI2_IOCFACTS_CAPABILITY_MSI_X_INDEX define. | ||
84 | * Added two new reason codes for SAS Device Status Change | ||
85 | * Event. | ||
86 | * Added new event: SAS PHY Counter. | ||
82 | * -------------------------------------------------------------------------- | 87 | * -------------------------------------------------------------------------- |
83 | */ | 88 | */ |
84 | 89 | ||
@@ -261,6 +266,8 @@ typedef struct _MPI2_IOC_FACTS_REPLY | |||
261 | /* ProductID field uses MPI2_FW_HEADER_PID_ */ | 266 | /* ProductID field uses MPI2_FW_HEADER_PID_ */ |
262 | 267 | ||
263 | /* IOCCapabilities */ | 268 | /* IOCCapabilities */ |
269 | #define MPI2_IOCFACTS_CAPABILITY_MSI_X_INDEX (0x00008000) | ||
270 | #define MPI2_IOCFACTS_CAPABILITY_RAID_ACCELERATOR (0x00004000) | ||
264 | #define MPI2_IOCFACTS_CAPABILITY_EVENT_REPLAY (0x00002000) | 271 | #define MPI2_IOCFACTS_CAPABILITY_EVENT_REPLAY (0x00002000) |
265 | #define MPI2_IOCFACTS_CAPABILITY_INTEGRATED_RAID (0x00001000) | 272 | #define MPI2_IOCFACTS_CAPABILITY_INTEGRATED_RAID (0x00001000) |
266 | #define MPI2_IOCFACTS_CAPABILITY_TLR (0x00000800) | 273 | #define MPI2_IOCFACTS_CAPABILITY_TLR (0x00000800) |
@@ -440,6 +447,7 @@ typedef struct _MPI2_EVENT_NOTIFICATION_REPLY | |||
440 | #define MPI2_EVENT_IR_PHYSICAL_DISK (0x001F) | 447 | #define MPI2_EVENT_IR_PHYSICAL_DISK (0x001F) |
441 | #define MPI2_EVENT_IR_CONFIGURATION_CHANGE_LIST (0x0020) | 448 | #define MPI2_EVENT_IR_CONFIGURATION_CHANGE_LIST (0x0020) |
442 | #define MPI2_EVENT_LOG_ENTRY_ADDED (0x0021) | 449 | #define MPI2_EVENT_LOG_ENTRY_ADDED (0x0021) |
450 | #define MPI2_EVENT_SAS_PHY_COUNTER (0x0022) | ||
443 | 451 | ||
444 | 452 | ||
445 | /* Log Entry Added Event data */ | 453 | /* Log Entry Added Event data */ |
@@ -502,17 +510,19 @@ typedef struct _MPI2_EVENT_DATA_SAS_DEVICE_STATUS_CHANGE | |||
502 | MPI2_POINTER pMpi2EventDataSasDeviceStatusChange_t; | 510 | MPI2_POINTER pMpi2EventDataSasDeviceStatusChange_t; |
503 | 511 | ||
504 | /* SAS Device Status Change Event data ReasonCode values */ | 512 | /* SAS Device Status Change Event data ReasonCode values */ |
505 | #define MPI2_EVENT_SAS_DEV_STAT_RC_SMART_DATA (0x05) | 513 | #define MPI2_EVENT_SAS_DEV_STAT_RC_SMART_DATA (0x05) |
506 | #define MPI2_EVENT_SAS_DEV_STAT_RC_UNSUPPORTED (0x07) | 514 | #define MPI2_EVENT_SAS_DEV_STAT_RC_UNSUPPORTED (0x07) |
507 | #define MPI2_EVENT_SAS_DEV_STAT_RC_INTERNAL_DEVICE_RESET (0x08) | 515 | #define MPI2_EVENT_SAS_DEV_STAT_RC_INTERNAL_DEVICE_RESET (0x08) |
508 | #define MPI2_EVENT_SAS_DEV_STAT_RC_TASK_ABORT_INTERNAL (0x09) | 516 | #define MPI2_EVENT_SAS_DEV_STAT_RC_TASK_ABORT_INTERNAL (0x09) |
509 | #define MPI2_EVENT_SAS_DEV_STAT_RC_ABORT_TASK_SET_INTERNAL (0x0A) | 517 | #define MPI2_EVENT_SAS_DEV_STAT_RC_ABORT_TASK_SET_INTERNAL (0x0A) |
510 | #define MPI2_EVENT_SAS_DEV_STAT_RC_CLEAR_TASK_SET_INTERNAL (0x0B) | 518 | #define MPI2_EVENT_SAS_DEV_STAT_RC_CLEAR_TASK_SET_INTERNAL (0x0B) |
511 | #define MPI2_EVENT_SAS_DEV_STAT_RC_QUERY_TASK_INTERNAL (0x0C) | 519 | #define MPI2_EVENT_SAS_DEV_STAT_RC_QUERY_TASK_INTERNAL (0x0C) |
512 | #define MPI2_EVENT_SAS_DEV_STAT_RC_ASYNC_NOTIFICATION (0x0D) | 520 | #define MPI2_EVENT_SAS_DEV_STAT_RC_ASYNC_NOTIFICATION (0x0D) |
513 | #define MPI2_EVENT_SAS_DEV_STAT_RC_CMP_INTERNAL_DEV_RESET (0x0E) | 521 | #define MPI2_EVENT_SAS_DEV_STAT_RC_CMP_INTERNAL_DEV_RESET (0x0E) |
514 | #define MPI2_EVENT_SAS_DEV_STAT_RC_CMP_TASK_ABORT_INTERNAL (0x0F) | 522 | #define MPI2_EVENT_SAS_DEV_STAT_RC_CMP_TASK_ABORT_INTERNAL (0x0F) |
515 | #define MPI2_EVENT_SAS_DEV_STAT_RC_SATA_INIT_FAILURE (0x10) | 523 | #define MPI2_EVENT_SAS_DEV_STAT_RC_SATA_INIT_FAILURE (0x10) |
524 | #define MPI2_EVENT_SAS_DEV_STAT_RC_EXPANDER_REDUCED_FUNCTIONALITY (0x11) | ||
525 | #define MPI2_EVENT_SAS_DEV_STAT_RC_CMP_EXPANDER_REDUCED_FUNCTIONALITY (0x12) | ||
516 | 526 | ||
517 | 527 | ||
518 | /* Integrated RAID Operation Status Event data */ | 528 | /* Integrated RAID Operation Status Event data */ |
@@ -822,6 +832,37 @@ typedef struct _MPI2_EVENT_DATA_SAS_ENCL_DEV_STATUS_CHANGE | |||
822 | #define MPI2_EVENT_SAS_ENCL_RC_NOT_RESPONDING (0x02) | 832 | #define MPI2_EVENT_SAS_ENCL_RC_NOT_RESPONDING (0x02) |
823 | 833 | ||
824 | 834 | ||
835 | /* SAS PHY Counter Event data */ | ||
836 | |||
837 | typedef struct _MPI2_EVENT_DATA_SAS_PHY_COUNTER { | ||
838 | U64 TimeStamp; /* 0x00 */ | ||
839 | U32 Reserved1; /* 0x08 */ | ||
840 | U8 PhyEventCode; /* 0x0C */ | ||
841 | U8 PhyNum; /* 0x0D */ | ||
842 | U16 Reserved2; /* 0x0E */ | ||
843 | U32 PhyEventInfo; /* 0x10 */ | ||
844 | U8 CounterType; /* 0x14 */ | ||
845 | U8 ThresholdWindow; /* 0x15 */ | ||
846 | U8 TimeUnits; /* 0x16 */ | ||
847 | U8 Reserved3; /* 0x17 */ | ||
848 | U32 EventThreshold; /* 0x18 */ | ||
849 | U16 ThresholdFlags; /* 0x1C */ | ||
850 | U16 Reserved4; /* 0x1E */ | ||
851 | } MPI2_EVENT_DATA_SAS_PHY_COUNTER, | ||
852 | MPI2_POINTER PTR_MPI2_EVENT_DATA_SAS_PHY_COUNTER, | ||
853 | Mpi2EventDataSasPhyCounter_t, MPI2_POINTER pMpi2EventDataSasPhyCounter_t; | ||
854 | |||
855 | /* use MPI2_SASPHY3_EVENT_CODE_ values from mpi2_cnfg.h for the | ||
856 | * PhyEventCode field | ||
857 | * use MPI2_SASPHY3_COUNTER_TYPE_ values from mpi2_cnfg.h for the | ||
858 | * CounterType field | ||
859 | * use MPI2_SASPHY3_TIME_UNITS_ values from mpi2_cnfg.h for the | ||
860 | * TimeUnits field | ||
861 | * use MPI2_SASPHY3_TFLAGS_ values from mpi2_cnfg.h for the | ||
862 | * ThresholdFlags field | ||
863 | * */ | ||
864 | |||
865 | |||
825 | /**************************************************************************** | 866 | /**************************************************************************** |
826 | * EventAck message | 867 | * EventAck message |
827 | ****************************************************************************/ | 868 | ****************************************************************************/ |
diff --git a/drivers/scsi/mpt2sas/mpi/mpi2_tool.h b/drivers/scsi/mpt2sas/mpi/mpi2_tool.h index 2ff4e936bd39..007e950f7bfa 100644 --- a/drivers/scsi/mpt2sas/mpi/mpi2_tool.h +++ b/drivers/scsi/mpt2sas/mpi/mpi2_tool.h | |||
@@ -1,12 +1,12 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (c) 2000-2008 LSI Corporation. | 2 | * Copyright (c) 2000-2009 LSI Corporation. |
3 | * | 3 | * |
4 | * | 4 | * |
5 | * Name: mpi2_tool.h | 5 | * Name: mpi2_tool.h |
6 | * Title: MPI diagnostic tool structures and definitions | 6 | * Title: MPI diagnostic tool structures and definitions |
7 | * Creation Date: March 26, 2007 | 7 | * Creation Date: March 26, 2007 |
8 | * | 8 | * |
9 | * mpi2_tool.h Version: 02.00.02 | 9 | * mpi2_tool.h Version: 02.00.03 |
10 | * | 10 | * |
11 | * Version History | 11 | * Version History |
12 | * --------------- | 12 | * --------------- |
@@ -17,6 +17,7 @@ | |||
17 | * 12-18-07 02.00.01 Added Diagnostic Buffer Post and Diagnostic Release | 17 | * 12-18-07 02.00.01 Added Diagnostic Buffer Post and Diagnostic Release |
18 | * structures and defines. | 18 | * structures and defines. |
19 | * 02-29-08 02.00.02 Modified various names to make them 32-character unique. | 19 | * 02-29-08 02.00.02 Modified various names to make them 32-character unique. |
20 | * 05-06-09 02.00.03 Added ISTWI Read Write Tool and Diagnostic CLI Tool. | ||
20 | * -------------------------------------------------------------------------- | 21 | * -------------------------------------------------------------------------- |
21 | */ | 22 | */ |
22 | 23 | ||
@@ -32,7 +33,10 @@ | |||
32 | /* defines for the Tools */ | 33 | /* defines for the Tools */ |
33 | #define MPI2_TOOLBOX_CLEAN_TOOL (0x00) | 34 | #define MPI2_TOOLBOX_CLEAN_TOOL (0x00) |
34 | #define MPI2_TOOLBOX_MEMORY_MOVE_TOOL (0x01) | 35 | #define MPI2_TOOLBOX_MEMORY_MOVE_TOOL (0x01) |
36 | #define MPI2_TOOLBOX_ISTWI_READ_WRITE_TOOL (0x03) | ||
35 | #define MPI2_TOOLBOX_BEACON_TOOL (0x05) | 37 | #define MPI2_TOOLBOX_BEACON_TOOL (0x05) |
38 | #define MPI2_TOOLBOX_DIAGNOSTIC_CLI_TOOL (0x06) | ||
39 | |||
36 | 40 | ||
37 | /**************************************************************************** | 41 | /**************************************************************************** |
38 | * Toolbox reply | 42 | * Toolbox reply |
@@ -112,6 +116,77 @@ typedef struct _MPI2_TOOLBOX_MEM_MOVE_REQUEST | |||
112 | 116 | ||
113 | 117 | ||
114 | /**************************************************************************** | 118 | /**************************************************************************** |
119 | * Toolbox ISTWI Read Write Tool | ||
120 | ****************************************************************************/ | ||
121 | |||
122 | /* Toolbox ISTWI Read Write Tool request message */ | ||
123 | typedef struct _MPI2_TOOLBOX_ISTWI_READ_WRITE_REQUEST { | ||
124 | U8 Tool; /* 0x00 */ | ||
125 | U8 Reserved1; /* 0x01 */ | ||
126 | U8 ChainOffset; /* 0x02 */ | ||
127 | U8 Function; /* 0x03 */ | ||
128 | U16 Reserved2; /* 0x04 */ | ||
129 | U8 Reserved3; /* 0x06 */ | ||
130 | U8 MsgFlags; /* 0x07 */ | ||
131 | U8 VP_ID; /* 0x08 */ | ||
132 | U8 VF_ID; /* 0x09 */ | ||
133 | U16 Reserved4; /* 0x0A */ | ||
134 | U32 Reserved5; /* 0x0C */ | ||
135 | U32 Reserved6; /* 0x10 */ | ||
136 | U8 DevIndex; /* 0x14 */ | ||
137 | U8 Action; /* 0x15 */ | ||
138 | U8 SGLFlags; /* 0x16 */ | ||
139 | U8 Reserved7; /* 0x17 */ | ||
140 | U16 TxDataLength; /* 0x18 */ | ||
141 | U16 RxDataLength; /* 0x1A */ | ||
142 | U32 Reserved8; /* 0x1C */ | ||
143 | U32 Reserved9; /* 0x20 */ | ||
144 | U32 Reserved10; /* 0x24 */ | ||
145 | U32 Reserved11; /* 0x28 */ | ||
146 | U32 Reserved12; /* 0x2C */ | ||
147 | MPI2_SGE_SIMPLE_UNION SGL; /* 0x30 */ | ||
148 | } MPI2_TOOLBOX_ISTWI_READ_WRITE_REQUEST, | ||
149 | MPI2_POINTER PTR_MPI2_TOOLBOX_ISTWI_READ_WRITE_REQUEST, | ||
150 | Mpi2ToolboxIstwiReadWriteRequest_t, | ||
151 | MPI2_POINTER pMpi2ToolboxIstwiReadWriteRequest_t; | ||
152 | |||
153 | /* values for the Action field */ | ||
154 | #define MPI2_TOOL_ISTWI_ACTION_READ_DATA (0x01) | ||
155 | #define MPI2_TOOL_ISTWI_ACTION_WRITE_DATA (0x02) | ||
156 | #define MPI2_TOOL_ISTWI_ACTION_SEQUENCE (0x03) | ||
157 | #define MPI2_TOOL_ISTWI_ACTION_RESERVE_BUS (0x10) | ||
158 | #define MPI2_TOOL_ISTWI_ACTION_RELEASE_BUS (0x11) | ||
159 | #define MPI2_TOOL_ISTWI_ACTION_RESET (0x12) | ||
160 | |||
161 | /* values for SGLFlags field are in the SGL section of mpi2.h */ | ||
162 | |||
163 | |||
164 | /* Toolbox ISTWI Read Write Tool reply message */ | ||
165 | typedef struct _MPI2_TOOLBOX_ISTWI_REPLY { | ||
166 | U8 Tool; /* 0x00 */ | ||
167 | U8 Reserved1; /* 0x01 */ | ||
168 | U8 MsgLength; /* 0x02 */ | ||
169 | U8 Function; /* 0x03 */ | ||
170 | U16 Reserved2; /* 0x04 */ | ||
171 | U8 Reserved3; /* 0x06 */ | ||
172 | U8 MsgFlags; /* 0x07 */ | ||
173 | U8 VP_ID; /* 0x08 */ | ||
174 | U8 VF_ID; /* 0x09 */ | ||
175 | U16 Reserved4; /* 0x0A */ | ||
176 | U16 Reserved5; /* 0x0C */ | ||
177 | U16 IOCStatus; /* 0x0E */ | ||
178 | U32 IOCLogInfo; /* 0x10 */ | ||
179 | U8 DevIndex; /* 0x14 */ | ||
180 | U8 Action; /* 0x15 */ | ||
181 | U8 IstwiStatus; /* 0x16 */ | ||
182 | U8 Reserved6; /* 0x17 */ | ||
183 | U16 TxDataCount; /* 0x18 */ | ||
184 | U16 RxDataCount; /* 0x1A */ | ||
185 | } MPI2_TOOLBOX_ISTWI_REPLY, MPI2_POINTER PTR_MPI2_TOOLBOX_ISTWI_REPLY, | ||
186 | Mpi2ToolboxIstwiReply_t, MPI2_POINTER pMpi2ToolboxIstwiReply_t; | ||
187 | |||
188 | |||
189 | /**************************************************************************** | ||
115 | * Toolbox Beacon Tool request | 190 | * Toolbox Beacon Tool request |
116 | ****************************************************************************/ | 191 | ****************************************************************************/ |
117 | 192 | ||
@@ -139,6 +214,61 @@ typedef struct _MPI2_TOOLBOX_BEACON_REQUEST | |||
139 | #define MPI2_TOOLBOX_FLAGS_BEACONMODE_ON (0x01) | 214 | #define MPI2_TOOLBOX_FLAGS_BEACONMODE_ON (0x01) |
140 | 215 | ||
141 | 216 | ||
217 | /**************************************************************************** | ||
218 | * Toolbox Diagnostic CLI Tool | ||
219 | ****************************************************************************/ | ||
220 | |||
221 | #define MPI2_TOOLBOX_DIAG_CLI_CMD_LENGTH (0x5C) | ||
222 | |||
223 | /* Toolbox Diagnostic CLI Tool request message */ | ||
224 | typedef struct _MPI2_TOOLBOX_DIAGNOSTIC_CLI_REQUEST { | ||
225 | U8 Tool; /* 0x00 */ | ||
226 | U8 Reserved1; /* 0x01 */ | ||
227 | U8 ChainOffset; /* 0x02 */ | ||
228 | U8 Function; /* 0x03 */ | ||
229 | U16 Reserved2; /* 0x04 */ | ||
230 | U8 Reserved3; /* 0x06 */ | ||
231 | U8 MsgFlags; /* 0x07 */ | ||
232 | U8 VP_ID; /* 0x08 */ | ||
233 | U8 VF_ID; /* 0x09 */ | ||
234 | U16 Reserved4; /* 0x0A */ | ||
235 | U8 SGLFlags; /* 0x0C */ | ||
236 | U8 Reserved5; /* 0x0D */ | ||
237 | U16 Reserved6; /* 0x0E */ | ||
238 | U32 DataLength; /* 0x10 */ | ||
239 | U8 DiagnosticCliCommand | ||
240 | [MPI2_TOOLBOX_DIAG_CLI_CMD_LENGTH]; /* 0x14 */ | ||
241 | MPI2_SGE_SIMPLE_UNION SGL; /* 0x70 */ | ||
242 | } MPI2_TOOLBOX_DIAGNOSTIC_CLI_REQUEST, | ||
243 | MPI2_POINTER PTR_MPI2_TOOLBOX_DIAGNOSTIC_CLI_REQUEST, | ||
244 | Mpi2ToolboxDiagnosticCliRequest_t, | ||
245 | MPI2_POINTER pMpi2ToolboxDiagnosticCliRequest_t; | ||
246 | |||
247 | /* values for SGLFlags field are in the SGL section of mpi2.h */ | ||
248 | |||
249 | |||
250 | /* Toolbox Diagnostic CLI Tool reply message */ | ||
251 | typedef struct _MPI2_TOOLBOX_DIAGNOSTIC_CLI_REPLY { | ||
252 | U8 Tool; /* 0x00 */ | ||
253 | U8 Reserved1; /* 0x01 */ | ||
254 | U8 MsgLength; /* 0x02 */ | ||
255 | U8 Function; /* 0x03 */ | ||
256 | U16 Reserved2; /* 0x04 */ | ||
257 | U8 Reserved3; /* 0x06 */ | ||
258 | U8 MsgFlags; /* 0x07 */ | ||
259 | U8 VP_ID; /* 0x08 */ | ||
260 | U8 VF_ID; /* 0x09 */ | ||
261 | U16 Reserved4; /* 0x0A */ | ||
262 | U16 Reserved5; /* 0x0C */ | ||
263 | U16 IOCStatus; /* 0x0E */ | ||
264 | U32 IOCLogInfo; /* 0x10 */ | ||
265 | U32 ReturnedDataLength; /* 0x14 */ | ||
266 | } MPI2_TOOLBOX_DIAGNOSTIC_CLI_REPLY, | ||
267 | MPI2_POINTER PTR_MPI2_TOOLBOX_DIAG_CLI_REPLY, | ||
268 | Mpi2ToolboxDiagnosticCliReply_t, | ||
269 | MPI2_POINTER pMpi2ToolboxDiagnosticCliReply_t; | ||
270 | |||
271 | |||
142 | /***************************************************************************** | 272 | /***************************************************************************** |
143 | * | 273 | * |
144 | * Diagnostic Buffer Messages | 274 | * Diagnostic Buffer Messages |
diff --git a/drivers/scsi/mpt2sas/mpt2sas_base.c b/drivers/scsi/mpt2sas/mpt2sas_base.c index d95d2f274cb3..10de370c171e 100644 --- a/drivers/scsi/mpt2sas/mpt2sas_base.c +++ b/drivers/scsi/mpt2sas/mpt2sas_base.c | |||
@@ -543,13 +543,13 @@ mpt2sas_base_fault_info(struct MPT2SAS_ADAPTER *ioc , u16 fault_code) | |||
543 | * _base_display_reply_info - | 543 | * _base_display_reply_info - |
544 | * @ioc: pointer to scsi command object | 544 | * @ioc: pointer to scsi command object |
545 | * @smid: system request message index | 545 | * @smid: system request message index |
546 | * @VF_ID: virtual function id | 546 | * @msix_index: MSIX table index supplied by the OS |
547 | * @reply: reply message frame(lower 32bit addr) | 547 | * @reply: reply message frame(lower 32bit addr) |
548 | * | 548 | * |
549 | * Return nothing. | 549 | * Return nothing. |
550 | */ | 550 | */ |
551 | static void | 551 | static void |
552 | _base_display_reply_info(struct MPT2SAS_ADAPTER *ioc, u16 smid, u8 VF_ID, | 552 | _base_display_reply_info(struct MPT2SAS_ADAPTER *ioc, u16 smid, u8 msix_index, |
553 | u32 reply) | 553 | u32 reply) |
554 | { | 554 | { |
555 | MPI2DefaultReply_t *mpi_reply; | 555 | MPI2DefaultReply_t *mpi_reply; |
@@ -572,13 +572,14 @@ _base_display_reply_info(struct MPT2SAS_ADAPTER *ioc, u16 smid, u8 VF_ID, | |||
572 | * mpt2sas_base_done - base internal command completion routine | 572 | * mpt2sas_base_done - base internal command completion routine |
573 | * @ioc: pointer to scsi command object | 573 | * @ioc: pointer to scsi command object |
574 | * @smid: system request message index | 574 | * @smid: system request message index |
575 | * @VF_ID: virtual function id | 575 | * @msix_index: MSIX table index supplied by the OS |
576 | * @reply: reply message frame(lower 32bit addr) | 576 | * @reply: reply message frame(lower 32bit addr) |
577 | * | 577 | * |
578 | * Return nothing. | 578 | * Return nothing. |
579 | */ | 579 | */ |
580 | void | 580 | void |
581 | mpt2sas_base_done(struct MPT2SAS_ADAPTER *ioc, u16 smid, u8 VF_ID, u32 reply) | 581 | mpt2sas_base_done(struct MPT2SAS_ADAPTER *ioc, u16 smid, u8 msix_index, |
582 | u32 reply) | ||
582 | { | 583 | { |
583 | MPI2DefaultReply_t *mpi_reply; | 584 | MPI2DefaultReply_t *mpi_reply; |
584 | 585 | ||
@@ -601,13 +602,13 @@ mpt2sas_base_done(struct MPT2SAS_ADAPTER *ioc, u16 smid, u8 VF_ID, u32 reply) | |||
601 | /** | 602 | /** |
602 | * _base_async_event - main callback handler for firmware asyn events | 603 | * _base_async_event - main callback handler for firmware asyn events |
603 | * @ioc: pointer to scsi command object | 604 | * @ioc: pointer to scsi command object |
604 | * @VF_ID: virtual function id | 605 | * @msix_index: MSIX table index supplied by the OS |
605 | * @reply: reply message frame(lower 32bit addr) | 606 | * @reply: reply message frame(lower 32bit addr) |
606 | * | 607 | * |
607 | * Return nothing. | 608 | * Return nothing. |
608 | */ | 609 | */ |
609 | static void | 610 | static void |
610 | _base_async_event(struct MPT2SAS_ADAPTER *ioc, u8 VF_ID, u32 reply) | 611 | _base_async_event(struct MPT2SAS_ADAPTER *ioc, u8 msix_index, u32 reply) |
611 | { | 612 | { |
612 | Mpi2EventNotificationReply_t *mpi_reply; | 613 | Mpi2EventNotificationReply_t *mpi_reply; |
613 | Mpi2EventAckRequest_t *ack_request; | 614 | Mpi2EventAckRequest_t *ack_request; |
@@ -635,16 +636,17 @@ _base_async_event(struct MPT2SAS_ADAPTER *ioc, u8 VF_ID, u32 reply) | |||
635 | ack_request->Function = MPI2_FUNCTION_EVENT_ACK; | 636 | ack_request->Function = MPI2_FUNCTION_EVENT_ACK; |
636 | ack_request->Event = mpi_reply->Event; | 637 | ack_request->Event = mpi_reply->Event; |
637 | ack_request->EventContext = mpi_reply->EventContext; | 638 | ack_request->EventContext = mpi_reply->EventContext; |
638 | ack_request->VF_ID = VF_ID; | 639 | ack_request->VF_ID = 0; /* TODO */ |
639 | mpt2sas_base_put_smid_default(ioc, smid, VF_ID); | 640 | ack_request->VP_ID = 0; |
641 | mpt2sas_base_put_smid_default(ioc, smid); | ||
640 | 642 | ||
641 | out: | 643 | out: |
642 | 644 | ||
643 | /* scsih callback handler */ | 645 | /* scsih callback handler */ |
644 | mpt2sas_scsih_event_callback(ioc, VF_ID, reply); | 646 | mpt2sas_scsih_event_callback(ioc, msix_index, reply); |
645 | 647 | ||
646 | /* ctl callback handler */ | 648 | /* ctl callback handler */ |
647 | mpt2sas_ctl_event_callback(ioc, VF_ID, reply); | 649 | mpt2sas_ctl_event_callback(ioc, msix_index, reply); |
648 | } | 650 | } |
649 | 651 | ||
650 | /** | 652 | /** |
@@ -712,7 +714,7 @@ _base_interrupt(int irq, void *bus_id) | |||
712 | u16 smid; | 714 | u16 smid; |
713 | u8 cb_idx; | 715 | u8 cb_idx; |
714 | u32 reply; | 716 | u32 reply; |
715 | u8 VF_ID; | 717 | u8 msix_index; |
716 | struct MPT2SAS_ADAPTER *ioc = bus_id; | 718 | struct MPT2SAS_ADAPTER *ioc = bus_id; |
717 | Mpi2ReplyDescriptorsUnion_t *rpf; | 719 | Mpi2ReplyDescriptorsUnion_t *rpf; |
718 | 720 | ||
@@ -733,7 +735,7 @@ _base_interrupt(int irq, void *bus_id) | |||
733 | reply = 0; | 735 | reply = 0; |
734 | cb_idx = 0xFF; | 736 | cb_idx = 0xFF; |
735 | smid = le16_to_cpu(rpf->Default.DescriptorTypeDependent1); | 737 | smid = le16_to_cpu(rpf->Default.DescriptorTypeDependent1); |
736 | VF_ID = rpf->Default.VF_ID; | 738 | msix_index = rpf->Default.MSIxIndex; |
737 | if (request_desript_type == | 739 | if (request_desript_type == |
738 | MPI2_RPY_DESCRIPT_FLAGS_ADDRESS_REPLY) { | 740 | MPI2_RPY_DESCRIPT_FLAGS_ADDRESS_REPLY) { |
739 | reply = le32_to_cpu | 741 | reply = le32_to_cpu |
@@ -747,14 +749,14 @@ _base_interrupt(int irq, void *bus_id) | |||
747 | if (smid) | 749 | if (smid) |
748 | cb_idx = ioc->scsi_lookup[smid - 1].cb_idx; | 750 | cb_idx = ioc->scsi_lookup[smid - 1].cb_idx; |
749 | if (smid && cb_idx != 0xFF) { | 751 | if (smid && cb_idx != 0xFF) { |
750 | mpt_callbacks[cb_idx](ioc, smid, VF_ID, reply); | 752 | mpt_callbacks[cb_idx](ioc, smid, msix_index, reply); |
751 | if (reply) | 753 | if (reply) |
752 | _base_display_reply_info(ioc, smid, VF_ID, | 754 | _base_display_reply_info(ioc, smid, msix_index, |
753 | reply); | 755 | reply); |
754 | mpt2sas_base_free_smid(ioc, smid); | 756 | mpt2sas_base_free_smid(ioc, smid); |
755 | } | 757 | } |
756 | if (!smid) | 758 | if (!smid) |
757 | _base_async_event(ioc, VF_ID, reply); | 759 | _base_async_event(ioc, msix_index, reply); |
758 | 760 | ||
759 | /* reply free queue handling */ | 761 | /* reply free queue handling */ |
760 | if (reply) { | 762 | if (reply) { |
@@ -1352,21 +1354,19 @@ static inline void _base_writeq(__u64 b, volatile void __iomem *addr, | |||
1352 | * mpt2sas_base_put_smid_scsi_io - send SCSI_IO request to firmware | 1354 | * mpt2sas_base_put_smid_scsi_io - send SCSI_IO request to firmware |
1353 | * @ioc: per adapter object | 1355 | * @ioc: per adapter object |
1354 | * @smid: system request message index | 1356 | * @smid: system request message index |
1355 | * @vf_id: virtual function id | ||
1356 | * @handle: device handle | 1357 | * @handle: device handle |
1357 | * | 1358 | * |
1358 | * Return nothing. | 1359 | * Return nothing. |
1359 | */ | 1360 | */ |
1360 | void | 1361 | void |
1361 | mpt2sas_base_put_smid_scsi_io(struct MPT2SAS_ADAPTER *ioc, u16 smid, u8 vf_id, | 1362 | mpt2sas_base_put_smid_scsi_io(struct MPT2SAS_ADAPTER *ioc, u16 smid, u16 handle) |
1362 | u16 handle) | ||
1363 | { | 1363 | { |
1364 | Mpi2RequestDescriptorUnion_t descriptor; | 1364 | Mpi2RequestDescriptorUnion_t descriptor; |
1365 | u64 *request = (u64 *)&descriptor; | 1365 | u64 *request = (u64 *)&descriptor; |
1366 | 1366 | ||
1367 | 1367 | ||
1368 | descriptor.SCSIIO.RequestFlags = MPI2_REQ_DESCRIPT_FLAGS_SCSI_IO; | 1368 | descriptor.SCSIIO.RequestFlags = MPI2_REQ_DESCRIPT_FLAGS_SCSI_IO; |
1369 | descriptor.SCSIIO.VF_ID = vf_id; | 1369 | descriptor.SCSIIO.MSIxIndex = 0; /* TODO */ |
1370 | descriptor.SCSIIO.SMID = cpu_to_le16(smid); | 1370 | descriptor.SCSIIO.SMID = cpu_to_le16(smid); |
1371 | descriptor.SCSIIO.DevHandle = cpu_to_le16(handle); | 1371 | descriptor.SCSIIO.DevHandle = cpu_to_le16(handle); |
1372 | descriptor.SCSIIO.LMID = 0; | 1372 | descriptor.SCSIIO.LMID = 0; |
@@ -1379,20 +1379,18 @@ mpt2sas_base_put_smid_scsi_io(struct MPT2SAS_ADAPTER *ioc, u16 smid, u8 vf_id, | |||
1379 | * mpt2sas_base_put_smid_hi_priority - send Task Managment request to firmware | 1379 | * mpt2sas_base_put_smid_hi_priority - send Task Managment request to firmware |
1380 | * @ioc: per adapter object | 1380 | * @ioc: per adapter object |
1381 | * @smid: system request message index | 1381 | * @smid: system request message index |
1382 | * @vf_id: virtual function id | ||
1383 | * | 1382 | * |
1384 | * Return nothing. | 1383 | * Return nothing. |
1385 | */ | 1384 | */ |
1386 | void | 1385 | void |
1387 | mpt2sas_base_put_smid_hi_priority(struct MPT2SAS_ADAPTER *ioc, u16 smid, | 1386 | mpt2sas_base_put_smid_hi_priority(struct MPT2SAS_ADAPTER *ioc, u16 smid) |
1388 | u8 vf_id) | ||
1389 | { | 1387 | { |
1390 | Mpi2RequestDescriptorUnion_t descriptor; | 1388 | Mpi2RequestDescriptorUnion_t descriptor; |
1391 | u64 *request = (u64 *)&descriptor; | 1389 | u64 *request = (u64 *)&descriptor; |
1392 | 1390 | ||
1393 | descriptor.HighPriority.RequestFlags = | 1391 | descriptor.HighPriority.RequestFlags = |
1394 | MPI2_REQ_DESCRIPT_FLAGS_HIGH_PRIORITY; | 1392 | MPI2_REQ_DESCRIPT_FLAGS_HIGH_PRIORITY; |
1395 | descriptor.HighPriority.VF_ID = vf_id; | 1393 | descriptor.HighPriority.MSIxIndex = 0; /* TODO */ |
1396 | descriptor.HighPriority.SMID = cpu_to_le16(smid); | 1394 | descriptor.HighPriority.SMID = cpu_to_le16(smid); |
1397 | descriptor.HighPriority.LMID = 0; | 1395 | descriptor.HighPriority.LMID = 0; |
1398 | descriptor.HighPriority.Reserved1 = 0; | 1396 | descriptor.HighPriority.Reserved1 = 0; |
@@ -1404,18 +1402,17 @@ mpt2sas_base_put_smid_hi_priority(struct MPT2SAS_ADAPTER *ioc, u16 smid, | |||
1404 | * mpt2sas_base_put_smid_default - Default, primarily used for config pages | 1402 | * mpt2sas_base_put_smid_default - Default, primarily used for config pages |
1405 | * @ioc: per adapter object | 1403 | * @ioc: per adapter object |
1406 | * @smid: system request message index | 1404 | * @smid: system request message index |
1407 | * @vf_id: virtual function id | ||
1408 | * | 1405 | * |
1409 | * Return nothing. | 1406 | * Return nothing. |
1410 | */ | 1407 | */ |
1411 | void | 1408 | void |
1412 | mpt2sas_base_put_smid_default(struct MPT2SAS_ADAPTER *ioc, u16 smid, u8 vf_id) | 1409 | mpt2sas_base_put_smid_default(struct MPT2SAS_ADAPTER *ioc, u16 smid) |
1413 | { | 1410 | { |
1414 | Mpi2RequestDescriptorUnion_t descriptor; | 1411 | Mpi2RequestDescriptorUnion_t descriptor; |
1415 | u64 *request = (u64 *)&descriptor; | 1412 | u64 *request = (u64 *)&descriptor; |
1416 | 1413 | ||
1417 | descriptor.Default.RequestFlags = MPI2_REQ_DESCRIPT_FLAGS_DEFAULT_TYPE; | 1414 | descriptor.Default.RequestFlags = MPI2_REQ_DESCRIPT_FLAGS_DEFAULT_TYPE; |
1418 | descriptor.Default.VF_ID = vf_id; | 1415 | descriptor.Default.MSIxIndex = 0; /* TODO */ |
1419 | descriptor.Default.SMID = cpu_to_le16(smid); | 1416 | descriptor.Default.SMID = cpu_to_le16(smid); |
1420 | descriptor.Default.LMID = 0; | 1417 | descriptor.Default.LMID = 0; |
1421 | descriptor.Default.DescriptorTypeDependent = 0; | 1418 | descriptor.Default.DescriptorTypeDependent = 0; |
@@ -1427,21 +1424,20 @@ mpt2sas_base_put_smid_default(struct MPT2SAS_ADAPTER *ioc, u16 smid, u8 vf_id) | |||
1427 | * mpt2sas_base_put_smid_target_assist - send Target Assist/Status to firmware | 1424 | * mpt2sas_base_put_smid_target_assist - send Target Assist/Status to firmware |
1428 | * @ioc: per adapter object | 1425 | * @ioc: per adapter object |
1429 | * @smid: system request message index | 1426 | * @smid: system request message index |
1430 | * @vf_id: virtual function id | ||
1431 | * @io_index: value used to track the IO | 1427 | * @io_index: value used to track the IO |
1432 | * | 1428 | * |
1433 | * Return nothing. | 1429 | * Return nothing. |
1434 | */ | 1430 | */ |
1435 | void | 1431 | void |
1436 | mpt2sas_base_put_smid_target_assist(struct MPT2SAS_ADAPTER *ioc, u16 smid, | 1432 | mpt2sas_base_put_smid_target_assist(struct MPT2SAS_ADAPTER *ioc, u16 smid, |
1437 | u8 vf_id, u16 io_index) | 1433 | u16 io_index) |
1438 | { | 1434 | { |
1439 | Mpi2RequestDescriptorUnion_t descriptor; | 1435 | Mpi2RequestDescriptorUnion_t descriptor; |
1440 | u64 *request = (u64 *)&descriptor; | 1436 | u64 *request = (u64 *)&descriptor; |
1441 | 1437 | ||
1442 | descriptor.SCSITarget.RequestFlags = | 1438 | descriptor.SCSITarget.RequestFlags = |
1443 | MPI2_REQ_DESCRIPT_FLAGS_SCSI_TARGET; | 1439 | MPI2_REQ_DESCRIPT_FLAGS_SCSI_TARGET; |
1444 | descriptor.SCSITarget.VF_ID = vf_id; | 1440 | descriptor.SCSITarget.MSIxIndex = 0; /* TODO */ |
1445 | descriptor.SCSITarget.SMID = cpu_to_le16(smid); | 1441 | descriptor.SCSITarget.SMID = cpu_to_le16(smid); |
1446 | descriptor.SCSITarget.LMID = 0; | 1442 | descriptor.SCSITarget.LMID = 0; |
1447 | descriptor.SCSITarget.IoIndex = cpu_to_le16(io_index); | 1443 | descriptor.SCSITarget.IoIndex = cpu_to_le16(io_index); |
@@ -2454,7 +2450,7 @@ mpt2sas_base_sas_iounit_control(struct MPT2SAS_ADAPTER *ioc, | |||
2454 | if (mpi_request->Operation == MPI2_SAS_OP_PHY_HARD_RESET || | 2450 | if (mpi_request->Operation == MPI2_SAS_OP_PHY_HARD_RESET || |
2455 | mpi_request->Operation == MPI2_SAS_OP_PHY_LINK_RESET) | 2451 | mpi_request->Operation == MPI2_SAS_OP_PHY_LINK_RESET) |
2456 | ioc->ioc_link_reset_in_progress = 1; | 2452 | ioc->ioc_link_reset_in_progress = 1; |
2457 | mpt2sas_base_put_smid_default(ioc, smid, mpi_request->VF_ID); | 2453 | mpt2sas_base_put_smid_default(ioc, smid); |
2458 | timeleft = wait_for_completion_timeout(&ioc->base_cmds.done, | 2454 | timeleft = wait_for_completion_timeout(&ioc->base_cmds.done, |
2459 | msecs_to_jiffies(10000)); | 2455 | msecs_to_jiffies(10000)); |
2460 | if ((mpi_request->Operation == MPI2_SAS_OP_PHY_HARD_RESET || | 2456 | if ((mpi_request->Operation == MPI2_SAS_OP_PHY_HARD_RESET || |
@@ -2555,7 +2551,7 @@ mpt2sas_base_scsi_enclosure_processor(struct MPT2SAS_ADAPTER *ioc, | |||
2555 | request = mpt2sas_base_get_msg_frame(ioc, smid); | 2551 | request = mpt2sas_base_get_msg_frame(ioc, smid); |
2556 | ioc->base_cmds.smid = smid; | 2552 | ioc->base_cmds.smid = smid; |
2557 | memcpy(request, mpi_request, sizeof(Mpi2SepReply_t)); | 2553 | memcpy(request, mpi_request, sizeof(Mpi2SepReply_t)); |
2558 | mpt2sas_base_put_smid_default(ioc, smid, mpi_request->VF_ID); | 2554 | mpt2sas_base_put_smid_default(ioc, smid); |
2559 | timeleft = wait_for_completion_timeout(&ioc->base_cmds.done, | 2555 | timeleft = wait_for_completion_timeout(&ioc->base_cmds.done, |
2560 | msecs_to_jiffies(10000)); | 2556 | msecs_to_jiffies(10000)); |
2561 | if (!(ioc->base_cmds.status & MPT2_CMD_COMPLETE)) { | 2557 | if (!(ioc->base_cmds.status & MPT2_CMD_COMPLETE)) { |
@@ -2701,13 +2697,12 @@ _base_get_ioc_facts(struct MPT2SAS_ADAPTER *ioc, int sleep_flag) | |||
2701 | /** | 2697 | /** |
2702 | * _base_send_ioc_init - send ioc_init to firmware | 2698 | * _base_send_ioc_init - send ioc_init to firmware |
2703 | * @ioc: per adapter object | 2699 | * @ioc: per adapter object |
2704 | * @VF_ID: virtual function id | ||
2705 | * @sleep_flag: CAN_SLEEP or NO_SLEEP | 2700 | * @sleep_flag: CAN_SLEEP or NO_SLEEP |
2706 | * | 2701 | * |
2707 | * Returns 0 for success, non-zero for failure. | 2702 | * Returns 0 for success, non-zero for failure. |
2708 | */ | 2703 | */ |
2709 | static int | 2704 | static int |
2710 | _base_send_ioc_init(struct MPT2SAS_ADAPTER *ioc, u8 VF_ID, int sleep_flag) | 2705 | _base_send_ioc_init(struct MPT2SAS_ADAPTER *ioc, int sleep_flag) |
2711 | { | 2706 | { |
2712 | Mpi2IOCInitRequest_t mpi_request; | 2707 | Mpi2IOCInitRequest_t mpi_request; |
2713 | Mpi2IOCInitReply_t mpi_reply; | 2708 | Mpi2IOCInitReply_t mpi_reply; |
@@ -2719,7 +2714,8 @@ _base_send_ioc_init(struct MPT2SAS_ADAPTER *ioc, u8 VF_ID, int sleep_flag) | |||
2719 | memset(&mpi_request, 0, sizeof(Mpi2IOCInitRequest_t)); | 2714 | memset(&mpi_request, 0, sizeof(Mpi2IOCInitRequest_t)); |
2720 | mpi_request.Function = MPI2_FUNCTION_IOC_INIT; | 2715 | mpi_request.Function = MPI2_FUNCTION_IOC_INIT; |
2721 | mpi_request.WhoInit = MPI2_WHOINIT_HOST_DRIVER; | 2716 | mpi_request.WhoInit = MPI2_WHOINIT_HOST_DRIVER; |
2722 | mpi_request.VF_ID = VF_ID; | 2717 | mpi_request.VF_ID = 0; /* TODO */ |
2718 | mpi_request.VP_ID = 0; | ||
2723 | mpi_request.MsgVersion = cpu_to_le16(MPI2_VERSION); | 2719 | mpi_request.MsgVersion = cpu_to_le16(MPI2_VERSION); |
2724 | mpi_request.HeaderVersion = cpu_to_le16(MPI2_HEADER_VERSION); | 2720 | mpi_request.HeaderVersion = cpu_to_le16(MPI2_HEADER_VERSION); |
2725 | 2721 | ||
@@ -2795,13 +2791,12 @@ _base_send_ioc_init(struct MPT2SAS_ADAPTER *ioc, u8 VF_ID, int sleep_flag) | |||
2795 | /** | 2791 | /** |
2796 | * _base_send_port_enable - send port_enable(discovery stuff) to firmware | 2792 | * _base_send_port_enable - send port_enable(discovery stuff) to firmware |
2797 | * @ioc: per adapter object | 2793 | * @ioc: per adapter object |
2798 | * @VF_ID: virtual function id | ||
2799 | * @sleep_flag: CAN_SLEEP or NO_SLEEP | 2794 | * @sleep_flag: CAN_SLEEP or NO_SLEEP |
2800 | * | 2795 | * |
2801 | * Returns 0 for success, non-zero for failure. | 2796 | * Returns 0 for success, non-zero for failure. |
2802 | */ | 2797 | */ |
2803 | static int | 2798 | static int |
2804 | _base_send_port_enable(struct MPT2SAS_ADAPTER *ioc, u8 VF_ID, int sleep_flag) | 2799 | _base_send_port_enable(struct MPT2SAS_ADAPTER *ioc, int sleep_flag) |
2805 | { | 2800 | { |
2806 | Mpi2PortEnableRequest_t *mpi_request; | 2801 | Mpi2PortEnableRequest_t *mpi_request; |
2807 | u32 ioc_state; | 2802 | u32 ioc_state; |
@@ -2829,9 +2824,10 @@ _base_send_port_enable(struct MPT2SAS_ADAPTER *ioc, u8 VF_ID, int sleep_flag) | |||
2829 | ioc->base_cmds.smid = smid; | 2824 | ioc->base_cmds.smid = smid; |
2830 | memset(mpi_request, 0, sizeof(Mpi2PortEnableRequest_t)); | 2825 | memset(mpi_request, 0, sizeof(Mpi2PortEnableRequest_t)); |
2831 | mpi_request->Function = MPI2_FUNCTION_PORT_ENABLE; | 2826 | mpi_request->Function = MPI2_FUNCTION_PORT_ENABLE; |
2832 | mpi_request->VF_ID = VF_ID; | 2827 | mpi_request->VF_ID = 0; /* TODO */ |
2828 | mpi_request->VP_ID = 0; | ||
2833 | 2829 | ||
2834 | mpt2sas_base_put_smid_default(ioc, smid, VF_ID); | 2830 | mpt2sas_base_put_smid_default(ioc, smid); |
2835 | timeleft = wait_for_completion_timeout(&ioc->base_cmds.done, | 2831 | timeleft = wait_for_completion_timeout(&ioc->base_cmds.done, |
2836 | 300*HZ); | 2832 | 300*HZ); |
2837 | if (!(ioc->base_cmds.status & MPT2_CMD_COMPLETE)) { | 2833 | if (!(ioc->base_cmds.status & MPT2_CMD_COMPLETE)) { |
@@ -2892,13 +2888,12 @@ _base_unmask_events(struct MPT2SAS_ADAPTER *ioc, u16 event) | |||
2892 | /** | 2888 | /** |
2893 | * _base_event_notification - send event notification | 2889 | * _base_event_notification - send event notification |
2894 | * @ioc: per adapter object | 2890 | * @ioc: per adapter object |
2895 | * @VF_ID: virtual function id | ||
2896 | * @sleep_flag: CAN_SLEEP or NO_SLEEP | 2891 | * @sleep_flag: CAN_SLEEP or NO_SLEEP |
2897 | * | 2892 | * |
2898 | * Returns 0 for success, non-zero for failure. | 2893 | * Returns 0 for success, non-zero for failure. |
2899 | */ | 2894 | */ |
2900 | static int | 2895 | static int |
2901 | _base_event_notification(struct MPT2SAS_ADAPTER *ioc, u8 VF_ID, int sleep_flag) | 2896 | _base_event_notification(struct MPT2SAS_ADAPTER *ioc, int sleep_flag) |
2902 | { | 2897 | { |
2903 | Mpi2EventNotificationRequest_t *mpi_request; | 2898 | Mpi2EventNotificationRequest_t *mpi_request; |
2904 | unsigned long timeleft; | 2899 | unsigned long timeleft; |
@@ -2926,11 +2921,12 @@ _base_event_notification(struct MPT2SAS_ADAPTER *ioc, u8 VF_ID, int sleep_flag) | |||
2926 | ioc->base_cmds.smid = smid; | 2921 | ioc->base_cmds.smid = smid; |
2927 | memset(mpi_request, 0, sizeof(Mpi2EventNotificationRequest_t)); | 2922 | memset(mpi_request, 0, sizeof(Mpi2EventNotificationRequest_t)); |
2928 | mpi_request->Function = MPI2_FUNCTION_EVENT_NOTIFICATION; | 2923 | mpi_request->Function = MPI2_FUNCTION_EVENT_NOTIFICATION; |
2929 | mpi_request->VF_ID = VF_ID; | 2924 | mpi_request->VF_ID = 0; /* TODO */ |
2925 | mpi_request->VP_ID = 0; | ||
2930 | for (i = 0; i < MPI2_EVENT_NOTIFY_EVENTMASK_WORDS; i++) | 2926 | for (i = 0; i < MPI2_EVENT_NOTIFY_EVENTMASK_WORDS; i++) |
2931 | mpi_request->EventMasks[i] = | 2927 | mpi_request->EventMasks[i] = |
2932 | le32_to_cpu(ioc->event_masks[i]); | 2928 | le32_to_cpu(ioc->event_masks[i]); |
2933 | mpt2sas_base_put_smid_default(ioc, smid, VF_ID); | 2929 | mpt2sas_base_put_smid_default(ioc, smid); |
2934 | timeleft = wait_for_completion_timeout(&ioc->base_cmds.done, 30*HZ); | 2930 | timeleft = wait_for_completion_timeout(&ioc->base_cmds.done, 30*HZ); |
2935 | if (!(ioc->base_cmds.status & MPT2_CMD_COMPLETE)) { | 2931 | if (!(ioc->base_cmds.status & MPT2_CMD_COMPLETE)) { |
2936 | printk(MPT2SAS_ERR_FMT "%s: timeout\n", | 2932 | printk(MPT2SAS_ERR_FMT "%s: timeout\n", |
@@ -2981,7 +2977,7 @@ mpt2sas_base_validate_event_type(struct MPT2SAS_ADAPTER *ioc, u32 *event_type) | |||
2981 | return; | 2977 | return; |
2982 | 2978 | ||
2983 | mutex_lock(&ioc->base_cmds.mutex); | 2979 | mutex_lock(&ioc->base_cmds.mutex); |
2984 | _base_event_notification(ioc, 0, CAN_SLEEP); | 2980 | _base_event_notification(ioc, CAN_SLEEP); |
2985 | mutex_unlock(&ioc->base_cmds.mutex); | 2981 | mutex_unlock(&ioc->base_cmds.mutex); |
2986 | } | 2982 | } |
2987 | 2983 | ||
@@ -3160,14 +3156,12 @@ _base_make_ioc_ready(struct MPT2SAS_ADAPTER *ioc, int sleep_flag, | |||
3160 | /** | 3156 | /** |
3161 | * _base_make_ioc_operational - put controller in OPERATIONAL state | 3157 | * _base_make_ioc_operational - put controller in OPERATIONAL state |
3162 | * @ioc: per adapter object | 3158 | * @ioc: per adapter object |
3163 | * @VF_ID: virtual function id | ||
3164 | * @sleep_flag: CAN_SLEEP or NO_SLEEP | 3159 | * @sleep_flag: CAN_SLEEP or NO_SLEEP |
3165 | * | 3160 | * |
3166 | * Returns 0 for success, non-zero for failure. | 3161 | * Returns 0 for success, non-zero for failure. |
3167 | */ | 3162 | */ |
3168 | static int | 3163 | static int |
3169 | _base_make_ioc_operational(struct MPT2SAS_ADAPTER *ioc, u8 VF_ID, | 3164 | _base_make_ioc_operational(struct MPT2SAS_ADAPTER *ioc, int sleep_flag) |
3170 | int sleep_flag) | ||
3171 | { | 3165 | { |
3172 | int r, i; | 3166 | int r, i; |
3173 | unsigned long flags; | 3167 | unsigned long flags; |
@@ -3196,7 +3190,7 @@ _base_make_ioc_operational(struct MPT2SAS_ADAPTER *ioc, u8 VF_ID, | |||
3196 | for (i = 0; i < ioc->reply_post_queue_depth; i++) | 3190 | for (i = 0; i < ioc->reply_post_queue_depth; i++) |
3197 | ioc->reply_post_free[i].Words = ULLONG_MAX; | 3191 | ioc->reply_post_free[i].Words = ULLONG_MAX; |
3198 | 3192 | ||
3199 | r = _base_send_ioc_init(ioc, VF_ID, sleep_flag); | 3193 | r = _base_send_ioc_init(ioc, sleep_flag); |
3200 | if (r) | 3194 | if (r) |
3201 | return r; | 3195 | return r; |
3202 | 3196 | ||
@@ -3207,14 +3201,14 @@ _base_make_ioc_operational(struct MPT2SAS_ADAPTER *ioc, u8 VF_ID, | |||
3207 | writel(0, &ioc->chip->ReplyPostHostIndex); | 3201 | writel(0, &ioc->chip->ReplyPostHostIndex); |
3208 | 3202 | ||
3209 | _base_unmask_interrupts(ioc); | 3203 | _base_unmask_interrupts(ioc); |
3210 | r = _base_event_notification(ioc, VF_ID, sleep_flag); | 3204 | r = _base_event_notification(ioc, sleep_flag); |
3211 | if (r) | 3205 | if (r) |
3212 | return r; | 3206 | return r; |
3213 | 3207 | ||
3214 | if (sleep_flag == CAN_SLEEP) | 3208 | if (sleep_flag == CAN_SLEEP) |
3215 | _base_static_config_pages(ioc); | 3209 | _base_static_config_pages(ioc); |
3216 | 3210 | ||
3217 | r = _base_send_port_enable(ioc, VF_ID, sleep_flag); | 3211 | r = _base_send_port_enable(ioc, sleep_flag); |
3218 | if (r) | 3212 | if (r) |
3219 | return r; | 3213 | return r; |
3220 | 3214 | ||
@@ -3338,7 +3332,7 @@ mpt2sas_base_attach(struct MPT2SAS_ADAPTER *ioc) | |||
3338 | if (r) | 3332 | if (r) |
3339 | goto out_free_resources; | 3333 | goto out_free_resources; |
3340 | } | 3334 | } |
3341 | r = _base_make_ioc_operational(ioc, 0, CAN_SLEEP); | 3335 | r = _base_make_ioc_operational(ioc, CAN_SLEEP); |
3342 | if (r) | 3336 | if (r) |
3343 | goto out_free_resources; | 3337 | goto out_free_resources; |
3344 | 3338 | ||
@@ -3490,7 +3484,7 @@ int | |||
3490 | mpt2sas_base_hard_reset_handler(struct MPT2SAS_ADAPTER *ioc, int sleep_flag, | 3484 | mpt2sas_base_hard_reset_handler(struct MPT2SAS_ADAPTER *ioc, int sleep_flag, |
3491 | enum reset_type type) | 3485 | enum reset_type type) |
3492 | { | 3486 | { |
3493 | int r, i; | 3487 | int r; |
3494 | unsigned long flags; | 3488 | unsigned long flags; |
3495 | 3489 | ||
3496 | dtmprintk(ioc, printk(MPT2SAS_DEBUG_FMT "%s: enter\n", ioc->name, | 3490 | dtmprintk(ioc, printk(MPT2SAS_DEBUG_FMT "%s: enter\n", ioc->name, |
@@ -3513,9 +3507,7 @@ mpt2sas_base_hard_reset_handler(struct MPT2SAS_ADAPTER *ioc, int sleep_flag, | |||
3513 | if (r) | 3507 | if (r) |
3514 | goto out; | 3508 | goto out; |
3515 | _base_reset_handler(ioc, MPT2_IOC_AFTER_RESET); | 3509 | _base_reset_handler(ioc, MPT2_IOC_AFTER_RESET); |
3516 | for (i = 0 ; i < ioc->facts.NumberOfPorts; i++) | 3510 | r = _base_make_ioc_operational(ioc, sleep_flag); |
3517 | r = _base_make_ioc_operational(ioc, ioc->pfacts[i].VF_ID, | ||
3518 | sleep_flag); | ||
3519 | if (!r) | 3511 | if (!r) |
3520 | _base_reset_handler(ioc, MPT2_IOC_DONE_RESET); | 3512 | _base_reset_handler(ioc, MPT2_IOC_DONE_RESET); |
3521 | out: | 3513 | out: |
diff --git a/drivers/scsi/mpt2sas/mpt2sas_base.h b/drivers/scsi/mpt2sas/mpt2sas_base.h index 2faab1e690e9..39e50e93a83c 100644 --- a/drivers/scsi/mpt2sas/mpt2sas_base.h +++ b/drivers/scsi/mpt2sas/mpt2sas_base.h | |||
@@ -701,8 +701,8 @@ struct MPT2SAS_ADAPTER { | |||
701 | u32 diagnostic_flags[MPI2_DIAG_BUF_TYPE_COUNT]; | 701 | u32 diagnostic_flags[MPI2_DIAG_BUF_TYPE_COUNT]; |
702 | }; | 702 | }; |
703 | 703 | ||
704 | typedef void (*MPT_CALLBACK)(struct MPT2SAS_ADAPTER *ioc, u16 smid, u8 VF_ID, | 704 | typedef void (*MPT_CALLBACK)(struct MPT2SAS_ADAPTER *ioc, u16 smid, |
705 | u32 reply); | 705 | u8 msix_index, u32 reply); |
706 | 706 | ||
707 | 707 | ||
708 | /* base shared API */ | 708 | /* base shared API */ |
@@ -725,17 +725,18 @@ dma_addr_t mpt2sas_base_get_sense_buffer_dma(struct MPT2SAS_ADAPTER *ioc, u16 sm | |||
725 | 725 | ||
726 | u16 mpt2sas_base_get_smid(struct MPT2SAS_ADAPTER *ioc, u8 cb_idx); | 726 | u16 mpt2sas_base_get_smid(struct MPT2SAS_ADAPTER *ioc, u8 cb_idx); |
727 | void mpt2sas_base_free_smid(struct MPT2SAS_ADAPTER *ioc, u16 smid); | 727 | void mpt2sas_base_free_smid(struct MPT2SAS_ADAPTER *ioc, u16 smid); |
728 | void mpt2sas_base_put_smid_scsi_io(struct MPT2SAS_ADAPTER *ioc, u16 smid, u8 vf_id, | 728 | void mpt2sas_base_put_smid_scsi_io(struct MPT2SAS_ADAPTER *ioc, u16 smid, |
729 | u16 handle); | 729 | u16 handle); |
730 | void mpt2sas_base_put_smid_hi_priority(struct MPT2SAS_ADAPTER *ioc, u16 smid, u8 vf_id); | 730 | void mpt2sas_base_put_smid_hi_priority(struct MPT2SAS_ADAPTER *ioc, u16 smid); |
731 | void mpt2sas_base_put_smid_target_assist(struct MPT2SAS_ADAPTER *ioc, u16 smid, | 731 | void mpt2sas_base_put_smid_target_assist(struct MPT2SAS_ADAPTER *ioc, u16 smid, |
732 | u8 vf_id, u16 io_index); | 732 | u16 io_index); |
733 | void mpt2sas_base_put_smid_default(struct MPT2SAS_ADAPTER *ioc, u16 smid, u8 vf_id); | 733 | void mpt2sas_base_put_smid_default(struct MPT2SAS_ADAPTER *ioc, u16 smid); |
734 | void mpt2sas_base_initialize_callback_handler(void); | 734 | void mpt2sas_base_initialize_callback_handler(void); |
735 | u8 mpt2sas_base_register_callback_handler(MPT_CALLBACK cb_func); | 735 | u8 mpt2sas_base_register_callback_handler(MPT_CALLBACK cb_func); |
736 | void mpt2sas_base_release_callback_handler(u8 cb_idx); | 736 | void mpt2sas_base_release_callback_handler(u8 cb_idx); |
737 | 737 | ||
738 | void mpt2sas_base_done(struct MPT2SAS_ADAPTER *ioc, u16 smid, u8 VF_ID, u32 reply); | 738 | void mpt2sas_base_done(struct MPT2SAS_ADAPTER *ioc, u16 smid, u8 msix_index, |
739 | u32 reply); | ||
739 | void *mpt2sas_base_get_reply_virt_addr(struct MPT2SAS_ADAPTER *ioc, u32 phys_addr); | 740 | void *mpt2sas_base_get_reply_virt_addr(struct MPT2SAS_ADAPTER *ioc, u32 phys_addr); |
740 | 741 | ||
741 | u32 mpt2sas_base_get_iocstate(struct MPT2SAS_ADAPTER *ioc, int cooked); | 742 | u32 mpt2sas_base_get_iocstate(struct MPT2SAS_ADAPTER *ioc, int cooked); |
@@ -760,11 +761,13 @@ struct _sas_node *mpt2sas_scsih_expander_find_by_sas_address(struct MPT2SAS_ADAP | |||
760 | struct _sas_device *mpt2sas_scsih_sas_device_find_by_sas_address( | 761 | struct _sas_device *mpt2sas_scsih_sas_device_find_by_sas_address( |
761 | struct MPT2SAS_ADAPTER *ioc, u64 sas_address); | 762 | struct MPT2SAS_ADAPTER *ioc, u64 sas_address); |
762 | 763 | ||
763 | void mpt2sas_scsih_event_callback(struct MPT2SAS_ADAPTER *ioc, u8 VF_ID, u32 reply); | 764 | void mpt2sas_scsih_event_callback(struct MPT2SAS_ADAPTER *ioc, u8 msix_index, |
765 | u32 reply); | ||
764 | void mpt2sas_scsih_reset_handler(struct MPT2SAS_ADAPTER *ioc, int reset_phase); | 766 | void mpt2sas_scsih_reset_handler(struct MPT2SAS_ADAPTER *ioc, int reset_phase); |
765 | 767 | ||
766 | /* config shared API */ | 768 | /* config shared API */ |
767 | void mpt2sas_config_done(struct MPT2SAS_ADAPTER *ioc, u16 smid, u8 VF_ID, u32 reply); | 769 | void mpt2sas_config_done(struct MPT2SAS_ADAPTER *ioc, u16 smid, u8 msix_index, |
770 | u32 reply); | ||
768 | int mpt2sas_config_get_number_hba_phys(struct MPT2SAS_ADAPTER *ioc, u8 *num_phys); | 771 | int mpt2sas_config_get_number_hba_phys(struct MPT2SAS_ADAPTER *ioc, u8 *num_phys); |
769 | int mpt2sas_config_get_manufacturing_pg0(struct MPT2SAS_ADAPTER *ioc, | 772 | int mpt2sas_config_get_manufacturing_pg0(struct MPT2SAS_ADAPTER *ioc, |
770 | Mpi2ConfigReply_t *mpi_reply, Mpi2ManufacturingPage0_t *config_page); | 773 | Mpi2ConfigReply_t *mpi_reply, Mpi2ManufacturingPage0_t *config_page); |
@@ -817,14 +820,17 @@ extern struct device_attribute *mpt2sas_host_attrs[]; | |||
817 | extern struct device_attribute *mpt2sas_dev_attrs[]; | 820 | extern struct device_attribute *mpt2sas_dev_attrs[]; |
818 | void mpt2sas_ctl_init(void); | 821 | void mpt2sas_ctl_init(void); |
819 | void mpt2sas_ctl_exit(void); | 822 | void mpt2sas_ctl_exit(void); |
820 | void mpt2sas_ctl_done(struct MPT2SAS_ADAPTER *ioc, u16 smid, u8 VF_ID, u32 reply); | 823 | void mpt2sas_ctl_done(struct MPT2SAS_ADAPTER *ioc, u16 smid, u8 msix_index, |
824 | u32 reply); | ||
821 | void mpt2sas_ctl_reset_handler(struct MPT2SAS_ADAPTER *ioc, int reset_phase); | 825 | void mpt2sas_ctl_reset_handler(struct MPT2SAS_ADAPTER *ioc, int reset_phase); |
822 | void mpt2sas_ctl_event_callback(struct MPT2SAS_ADAPTER *ioc, u8 VF_ID, u32 reply); | 826 | void mpt2sas_ctl_event_callback(struct MPT2SAS_ADAPTER *ioc, u8 msix_index, |
827 | u32 reply); | ||
823 | void mpt2sas_ctl_add_to_event_log(struct MPT2SAS_ADAPTER *ioc, | 828 | void mpt2sas_ctl_add_to_event_log(struct MPT2SAS_ADAPTER *ioc, |
824 | Mpi2EventNotificationReply_t *mpi_reply); | 829 | Mpi2EventNotificationReply_t *mpi_reply); |
825 | 830 | ||
826 | /* transport shared API */ | 831 | /* transport shared API */ |
827 | void mpt2sas_transport_done(struct MPT2SAS_ADAPTER *ioc, u16 smid, u8 VF_ID, u32 reply); | 832 | void mpt2sas_transport_done(struct MPT2SAS_ADAPTER *ioc, u16 smid, |
833 | u8 msix_index, u32 reply); | ||
828 | struct _sas_port *mpt2sas_transport_port_add(struct MPT2SAS_ADAPTER *ioc, | 834 | struct _sas_port *mpt2sas_transport_port_add(struct MPT2SAS_ADAPTER *ioc, |
829 | u16 handle, u16 parent_handle); | 835 | u16 handle, u16 parent_handle); |
830 | void mpt2sas_transport_port_remove(struct MPT2SAS_ADAPTER *ioc, u64 sas_address, | 836 | void mpt2sas_transport_port_remove(struct MPT2SAS_ADAPTER *ioc, u64 sas_address, |
diff --git a/drivers/scsi/mpt2sas/mpt2sas_config.c b/drivers/scsi/mpt2sas/mpt2sas_config.c index ab8c560865d8..2e018c9f5982 100644 --- a/drivers/scsi/mpt2sas/mpt2sas_config.c +++ b/drivers/scsi/mpt2sas/mpt2sas_config.c | |||
@@ -227,7 +227,7 @@ _config_free_config_dma_memory(struct MPT2SAS_ADAPTER *ioc, | |||
227 | * mpt2sas_config_done - config page completion routine | 227 | * mpt2sas_config_done - config page completion routine |
228 | * @ioc: per adapter object | 228 | * @ioc: per adapter object |
229 | * @smid: system request message index | 229 | * @smid: system request message index |
230 | * @VF_ID: virtual function id | 230 | * @msix_index: MSIX table index supplied by the OS |
231 | * @reply: reply message frame(lower 32bit addr) | 231 | * @reply: reply message frame(lower 32bit addr) |
232 | * Context: none. | 232 | * Context: none. |
233 | * | 233 | * |
@@ -236,7 +236,8 @@ _config_free_config_dma_memory(struct MPT2SAS_ADAPTER *ioc, | |||
236 | * Return nothing. | 236 | * Return nothing. |
237 | */ | 237 | */ |
238 | void | 238 | void |
239 | mpt2sas_config_done(struct MPT2SAS_ADAPTER *ioc, u16 smid, u8 VF_ID, u32 reply) | 239 | mpt2sas_config_done(struct MPT2SAS_ADAPTER *ioc, u16 smid, u8 msix_index, |
240 | u32 reply) | ||
240 | { | 241 | { |
241 | MPI2DefaultReply_t *mpi_reply; | 242 | MPI2DefaultReply_t *mpi_reply; |
242 | 243 | ||
@@ -303,6 +304,9 @@ _config_request(struct MPT2SAS_ADAPTER *ioc, Mpi2ConfigRequest_t | |||
303 | retry_count = 0; | 304 | retry_count = 0; |
304 | memset(&mem, 0, sizeof(struct config_request)); | 305 | memset(&mem, 0, sizeof(struct config_request)); |
305 | 306 | ||
307 | mpi_request->VF_ID = 0; /* TODO */ | ||
308 | mpi_request->VP_ID = 0; | ||
309 | |||
306 | if (config_page) { | 310 | if (config_page) { |
307 | mpi_request->Header.PageVersion = mpi_reply->Header.PageVersion; | 311 | mpi_request->Header.PageVersion = mpi_reply->Header.PageVersion; |
308 | mpi_request->Header.PageNumber = mpi_reply->Header.PageNumber; | 312 | mpi_request->Header.PageNumber = mpi_reply->Header.PageNumber; |
@@ -380,7 +384,7 @@ _config_request(struct MPT2SAS_ADAPTER *ioc, Mpi2ConfigRequest_t | |||
380 | _config_display_some_debug(ioc, smid, "config_request", NULL); | 384 | _config_display_some_debug(ioc, smid, "config_request", NULL); |
381 | #endif | 385 | #endif |
382 | init_completion(&ioc->config_cmds.done); | 386 | init_completion(&ioc->config_cmds.done); |
383 | mpt2sas_base_put_smid_default(ioc, smid, config_request->VF_ID); | 387 | mpt2sas_base_put_smid_default(ioc, smid); |
384 | timeleft = wait_for_completion_timeout(&ioc->config_cmds.done, | 388 | timeleft = wait_for_completion_timeout(&ioc->config_cmds.done, |
385 | timeout*HZ); | 389 | timeout*HZ); |
386 | if (!(ioc->config_cmds.status & MPT2_CMD_COMPLETE)) { | 390 | if (!(ioc->config_cmds.status & MPT2_CMD_COMPLETE)) { |
diff --git a/drivers/scsi/mpt2sas/mpt2sas_ctl.c b/drivers/scsi/mpt2sas/mpt2sas_ctl.c index c2a51018910f..af269268febd 100644 --- a/drivers/scsi/mpt2sas/mpt2sas_ctl.c +++ b/drivers/scsi/mpt2sas/mpt2sas_ctl.c | |||
@@ -219,7 +219,7 @@ _ctl_display_some_debug(struct MPT2SAS_ADAPTER *ioc, u16 smid, | |||
219 | * mpt2sas_ctl_done - ctl module completion routine | 219 | * mpt2sas_ctl_done - ctl module completion routine |
220 | * @ioc: per adapter object | 220 | * @ioc: per adapter object |
221 | * @smid: system request message index | 221 | * @smid: system request message index |
222 | * @VF_ID: virtual function id | 222 | * @msix_index: MSIX table index supplied by the OS |
223 | * @reply: reply message frame(lower 32bit addr) | 223 | * @reply: reply message frame(lower 32bit addr) |
224 | * Context: none. | 224 | * Context: none. |
225 | * | 225 | * |
@@ -228,7 +228,8 @@ _ctl_display_some_debug(struct MPT2SAS_ADAPTER *ioc, u16 smid, | |||
228 | * Return nothing. | 228 | * Return nothing. |
229 | */ | 229 | */ |
230 | void | 230 | void |
231 | mpt2sas_ctl_done(struct MPT2SAS_ADAPTER *ioc, u16 smid, u8 VF_ID, u32 reply) | 231 | mpt2sas_ctl_done(struct MPT2SAS_ADAPTER *ioc, u16 smid, u8 msix_index, |
232 | u32 reply) | ||
232 | { | 233 | { |
233 | MPI2DefaultReply_t *mpi_reply; | 234 | MPI2DefaultReply_t *mpi_reply; |
234 | 235 | ||
@@ -328,7 +329,7 @@ mpt2sas_ctl_add_to_event_log(struct MPT2SAS_ADAPTER *ioc, | |||
328 | /** | 329 | /** |
329 | * mpt2sas_ctl_event_callback - firmware event handler (called at ISR time) | 330 | * mpt2sas_ctl_event_callback - firmware event handler (called at ISR time) |
330 | * @ioc: per adapter object | 331 | * @ioc: per adapter object |
331 | * @VF_ID: virtual function id | 332 | * @msix_index: MSIX table index supplied by the OS |
332 | * @reply: reply message frame(lower 32bit addr) | 333 | * @reply: reply message frame(lower 32bit addr) |
333 | * Context: interrupt. | 334 | * Context: interrupt. |
334 | * | 335 | * |
@@ -338,7 +339,8 @@ mpt2sas_ctl_add_to_event_log(struct MPT2SAS_ADAPTER *ioc, | |||
338 | * Return nothing. | 339 | * Return nothing. |
339 | */ | 340 | */ |
340 | void | 341 | void |
341 | mpt2sas_ctl_event_callback(struct MPT2SAS_ADAPTER *ioc, u8 VF_ID, u32 reply) | 342 | mpt2sas_ctl_event_callback(struct MPT2SAS_ADAPTER *ioc, u8 msix_index, |
343 | u32 reply) | ||
342 | { | 344 | { |
343 | Mpi2EventNotificationReply_t *mpi_reply; | 345 | Mpi2EventNotificationReply_t *mpi_reply; |
344 | 346 | ||
@@ -737,7 +739,7 @@ _ctl_do_mpt_command(struct MPT2SAS_ADAPTER *ioc, | |||
737 | (u32)mpt2sas_base_get_sense_buffer_dma(ioc, smid); | 739 | (u32)mpt2sas_base_get_sense_buffer_dma(ioc, smid); |
738 | priv_sense = mpt2sas_base_get_sense_buffer(ioc, smid); | 740 | priv_sense = mpt2sas_base_get_sense_buffer(ioc, smid); |
739 | memset(priv_sense, 0, SCSI_SENSE_BUFFERSIZE); | 741 | memset(priv_sense, 0, SCSI_SENSE_BUFFERSIZE); |
740 | mpt2sas_base_put_smid_scsi_io(ioc, smid, 0, | 742 | mpt2sas_base_put_smid_scsi_io(ioc, smid, |
741 | le16_to_cpu(mpi_request->FunctionDependent1)); | 743 | le16_to_cpu(mpi_request->FunctionDependent1)); |
742 | break; | 744 | break; |
743 | } | 745 | } |
@@ -759,8 +761,7 @@ _ctl_do_mpt_command(struct MPT2SAS_ADAPTER *ioc, | |||
759 | mutex_lock(&ioc->tm_cmds.mutex); | 761 | mutex_lock(&ioc->tm_cmds.mutex); |
760 | mpt2sas_scsih_set_tm_flag(ioc, le16_to_cpu( | 762 | mpt2sas_scsih_set_tm_flag(ioc, le16_to_cpu( |
761 | tm_request->DevHandle)); | 763 | tm_request->DevHandle)); |
762 | mpt2sas_base_put_smid_hi_priority(ioc, smid, | 764 | mpt2sas_base_put_smid_hi_priority(ioc, smid); |
763 | mpi_request->VF_ID); | ||
764 | break; | 765 | break; |
765 | } | 766 | } |
766 | case MPI2_FUNCTION_SMP_PASSTHROUGH: | 767 | case MPI2_FUNCTION_SMP_PASSTHROUGH: |
@@ -781,7 +782,7 @@ _ctl_do_mpt_command(struct MPT2SAS_ADAPTER *ioc, | |||
781 | ioc->ioc_link_reset_in_progress = 1; | 782 | ioc->ioc_link_reset_in_progress = 1; |
782 | ioc->ignore_loginfos = 1; | 783 | ioc->ignore_loginfos = 1; |
783 | } | 784 | } |
784 | mpt2sas_base_put_smid_default(ioc, smid, mpi_request->VF_ID); | 785 | mpt2sas_base_put_smid_default(ioc, smid); |
785 | break; | 786 | break; |
786 | } | 787 | } |
787 | case MPI2_FUNCTION_SAS_IO_UNIT_CONTROL: | 788 | case MPI2_FUNCTION_SAS_IO_UNIT_CONTROL: |
@@ -795,11 +796,11 @@ _ctl_do_mpt_command(struct MPT2SAS_ADAPTER *ioc, | |||
795 | ioc->ioc_link_reset_in_progress = 1; | 796 | ioc->ioc_link_reset_in_progress = 1; |
796 | ioc->ignore_loginfos = 1; | 797 | ioc->ignore_loginfos = 1; |
797 | } | 798 | } |
798 | mpt2sas_base_put_smid_default(ioc, smid, mpi_request->VF_ID); | 799 | mpt2sas_base_put_smid_default(ioc, smid); |
799 | break; | 800 | break; |
800 | } | 801 | } |
801 | default: | 802 | default: |
802 | mpt2sas_base_put_smid_default(ioc, smid, mpi_request->VF_ID); | 803 | mpt2sas_base_put_smid_default(ioc, smid); |
803 | break; | 804 | break; |
804 | } | 805 | } |
805 | 806 | ||
@@ -1371,6 +1372,8 @@ _ctl_diag_register(void __user *arg, enum block_state state) | |||
1371 | mpi_request->Flags = cpu_to_le32(karg.diagnostic_flags); | 1372 | mpi_request->Flags = cpu_to_le32(karg.diagnostic_flags); |
1372 | mpi_request->BufferAddress = cpu_to_le64(request_data_dma); | 1373 | mpi_request->BufferAddress = cpu_to_le64(request_data_dma); |
1373 | mpi_request->BufferLength = cpu_to_le32(request_data_sz); | 1374 | mpi_request->BufferLength = cpu_to_le32(request_data_sz); |
1375 | mpi_request->VF_ID = 0; /* TODO */ | ||
1376 | mpi_request->VP_ID = 0; | ||
1374 | 1377 | ||
1375 | dctlprintk(ioc, printk(MPT2SAS_DEBUG_FMT "%s: diag_buffer(0x%p), " | 1378 | dctlprintk(ioc, printk(MPT2SAS_DEBUG_FMT "%s: diag_buffer(0x%p), " |
1376 | "dma(0x%llx), sz(%d)\n", ioc->name, __func__, request_data, | 1379 | "dma(0x%llx), sz(%d)\n", ioc->name, __func__, request_data, |
@@ -1380,7 +1383,7 @@ _ctl_diag_register(void __user *arg, enum block_state state) | |||
1380 | mpi_request->ProductSpecific[i] = | 1383 | mpi_request->ProductSpecific[i] = |
1381 | cpu_to_le32(ioc->product_specific[buffer_type][i]); | 1384 | cpu_to_le32(ioc->product_specific[buffer_type][i]); |
1382 | 1385 | ||
1383 | mpt2sas_base_put_smid_default(ioc, smid, mpi_request->VF_ID); | 1386 | mpt2sas_base_put_smid_default(ioc, smid); |
1384 | timeleft = wait_for_completion_timeout(&ioc->ctl_cmds.done, | 1387 | timeleft = wait_for_completion_timeout(&ioc->ctl_cmds.done, |
1385 | MPT2_IOCTL_DEFAULT_TIMEOUT*HZ); | 1388 | MPT2_IOCTL_DEFAULT_TIMEOUT*HZ); |
1386 | 1389 | ||
@@ -1643,8 +1646,10 @@ _ctl_send_release(struct MPT2SAS_ADAPTER *ioc, u8 buffer_type, u8 *issue_reset) | |||
1643 | 1646 | ||
1644 | mpi_request->Function = MPI2_FUNCTION_DIAG_RELEASE; | 1647 | mpi_request->Function = MPI2_FUNCTION_DIAG_RELEASE; |
1645 | mpi_request->BufferType = buffer_type; | 1648 | mpi_request->BufferType = buffer_type; |
1649 | mpi_request->VF_ID = 0; /* TODO */ | ||
1650 | mpi_request->VP_ID = 0; | ||
1646 | 1651 | ||
1647 | mpt2sas_base_put_smid_default(ioc, smid, mpi_request->VF_ID); | 1652 | mpt2sas_base_put_smid_default(ioc, smid); |
1648 | timeleft = wait_for_completion_timeout(&ioc->ctl_cmds.done, | 1653 | timeleft = wait_for_completion_timeout(&ioc->ctl_cmds.done, |
1649 | MPT2_IOCTL_DEFAULT_TIMEOUT*HZ); | 1654 | MPT2_IOCTL_DEFAULT_TIMEOUT*HZ); |
1650 | 1655 | ||
@@ -1902,8 +1907,10 @@ _ctl_diag_read_buffer(void __user *arg, enum block_state state) | |||
1902 | for (i = 0; i < MPT2_PRODUCT_SPECIFIC_DWORDS; i++) | 1907 | for (i = 0; i < MPT2_PRODUCT_SPECIFIC_DWORDS; i++) |
1903 | mpi_request->ProductSpecific[i] = | 1908 | mpi_request->ProductSpecific[i] = |
1904 | cpu_to_le32(ioc->product_specific[buffer_type][i]); | 1909 | cpu_to_le32(ioc->product_specific[buffer_type][i]); |
1910 | mpi_request->VF_ID = 0; /* TODO */ | ||
1911 | mpi_request->VP_ID = 0; | ||
1905 | 1912 | ||
1906 | mpt2sas_base_put_smid_default(ioc, smid, mpi_request->VF_ID); | 1913 | mpt2sas_base_put_smid_default(ioc, smid); |
1907 | timeleft = wait_for_completion_timeout(&ioc->ctl_cmds.done, | 1914 | timeleft = wait_for_completion_timeout(&ioc->ctl_cmds.done, |
1908 | MPT2_IOCTL_DEFAULT_TIMEOUT*HZ); | 1915 | MPT2_IOCTL_DEFAULT_TIMEOUT*HZ); |
1909 | 1916 | ||
@@ -2069,6 +2076,7 @@ static long | |||
2069 | _ctl_ioctl(struct file *file, unsigned int cmd, unsigned long arg) | 2076 | _ctl_ioctl(struct file *file, unsigned int cmd, unsigned long arg) |
2070 | { | 2077 | { |
2071 | long ret; | 2078 | long ret; |
2079 | |||
2072 | lock_kernel(); | 2080 | lock_kernel(); |
2073 | ret = _ctl_ioctl_main(file, cmd, (void __user *)arg); | 2081 | ret = _ctl_ioctl_main(file, cmd, (void __user *)arg); |
2074 | unlock_kernel(); | 2082 | unlock_kernel(); |
@@ -2143,6 +2151,7 @@ static long | |||
2143 | _ctl_ioctl_compat(struct file *file, unsigned cmd, unsigned long arg) | 2151 | _ctl_ioctl_compat(struct file *file, unsigned cmd, unsigned long arg) |
2144 | { | 2152 | { |
2145 | long ret; | 2153 | long ret; |
2154 | |||
2146 | lock_kernel(); | 2155 | lock_kernel(); |
2147 | if (cmd == MPT2COMMAND32) | 2156 | if (cmd == MPT2COMMAND32) |
2148 | ret = _ctl_compat_mpt_command(file, cmd, arg); | 2157 | ret = _ctl_compat_mpt_command(file, cmd, arg); |
diff --git a/drivers/scsi/mpt2sas/mpt2sas_scsih.c b/drivers/scsi/mpt2sas/mpt2sas_scsih.c index 774b34525bba..8277fa366898 100644 --- a/drivers/scsi/mpt2sas/mpt2sas_scsih.c +++ b/drivers/scsi/mpt2sas/mpt2sas_scsih.c | |||
@@ -109,6 +109,7 @@ struct sense_info { | |||
109 | * @work: work object (ioc->fault_reset_work_q) | 109 | * @work: work object (ioc->fault_reset_work_q) |
110 | * @ioc: per adapter object | 110 | * @ioc: per adapter object |
111 | * @VF_ID: virtual function id | 111 | * @VF_ID: virtual function id |
112 | * @VP_ID: virtual port id | ||
112 | * @host_reset_handling: handling events during host reset | 113 | * @host_reset_handling: handling events during host reset |
113 | * @ignore: flag meaning this event has been marked to ignore | 114 | * @ignore: flag meaning this event has been marked to ignore |
114 | * @event: firmware event MPI2_EVENT_XXX defined in mpt2_ioc.h | 115 | * @event: firmware event MPI2_EVENT_XXX defined in mpt2_ioc.h |
@@ -121,6 +122,7 @@ struct fw_event_work { | |||
121 | struct work_struct work; | 122 | struct work_struct work; |
122 | struct MPT2SAS_ADAPTER *ioc; | 123 | struct MPT2SAS_ADAPTER *ioc; |
123 | u8 VF_ID; | 124 | u8 VF_ID; |
125 | u8 VP_ID; | ||
124 | u8 host_reset_handling; | 126 | u8 host_reset_handling; |
125 | u8 ignore; | 127 | u8 ignore; |
126 | u16 event; | 128 | u16 event; |
@@ -138,8 +140,10 @@ struct fw_event_work { | |||
138 | * @lun: lun number | 140 | * @lun: lun number |
139 | * @cdb_length: cdb length | 141 | * @cdb_length: cdb length |
140 | * @cdb: cdb contents | 142 | * @cdb: cdb contents |
141 | * @valid_reply: flag set for reply message | ||
142 | * @timeout: timeout for this command | 143 | * @timeout: timeout for this command |
144 | * @VF_ID: virtual function id | ||
145 | * @VP_ID: virtual port id | ||
146 | * @valid_reply: flag set for reply message | ||
143 | * @sense_length: sense length | 147 | * @sense_length: sense length |
144 | * @ioc_status: ioc status | 148 | * @ioc_status: ioc status |
145 | * @scsi_state: scsi state | 149 | * @scsi_state: scsi state |
@@ -161,6 +165,8 @@ struct _scsi_io_transfer { | |||
161 | u8 cdb_length; | 165 | u8 cdb_length; |
162 | u8 cdb[32]; | 166 | u8 cdb[32]; |
163 | u8 timeout; | 167 | u8 timeout; |
168 | u8 VF_ID; | ||
169 | u8 VP_ID; | ||
164 | u8 valid_reply; | 170 | u8 valid_reply; |
165 | /* the following bits are only valid when 'valid_reply = 1' */ | 171 | /* the following bits are only valid when 'valid_reply = 1' */ |
166 | u32 sense_length; | 172 | u32 sense_length; |
@@ -1679,7 +1685,7 @@ _scsih_response_code(struct MPT2SAS_ADAPTER *ioc, u8 response_code) | |||
1679 | * _scsih_tm_done - tm completion routine | 1685 | * _scsih_tm_done - tm completion routine |
1680 | * @ioc: per adapter object | 1686 | * @ioc: per adapter object |
1681 | * @smid: system request message index | 1687 | * @smid: system request message index |
1682 | * @VF_ID: virtual function id | 1688 | * @msix_index: MSIX table index supplied by the OS |
1683 | * @reply: reply message frame(lower 32bit addr) | 1689 | * @reply: reply message frame(lower 32bit addr) |
1684 | * Context: none. | 1690 | * Context: none. |
1685 | * | 1691 | * |
@@ -1688,7 +1694,7 @@ _scsih_response_code(struct MPT2SAS_ADAPTER *ioc, u8 response_code) | |||
1688 | * Return nothing. | 1694 | * Return nothing. |
1689 | */ | 1695 | */ |
1690 | static void | 1696 | static void |
1691 | _scsih_tm_done(struct MPT2SAS_ADAPTER *ioc, u16 smid, u8 VF_ID, u32 reply) | 1697 | _scsih_tm_done(struct MPT2SAS_ADAPTER *ioc, u16 smid, u8 msix_index, u32 reply) |
1692 | { | 1698 | { |
1693 | MPI2DefaultReply_t *mpi_reply; | 1699 | MPI2DefaultReply_t *mpi_reply; |
1694 | 1700 | ||
@@ -1790,7 +1796,6 @@ mpt2sas_scsih_issue_tm(struct MPT2SAS_ADAPTER *ioc, u16 handle, uint lun, | |||
1790 | u16 smid = 0; | 1796 | u16 smid = 0; |
1791 | u32 ioc_state; | 1797 | u32 ioc_state; |
1792 | unsigned long timeleft; | 1798 | unsigned long timeleft; |
1793 | u8 VF_ID = 0; | ||
1794 | 1799 | ||
1795 | if (ioc->tm_cmds.status != MPT2_CMD_NOT_USED) { | 1800 | if (ioc->tm_cmds.status != MPT2_CMD_NOT_USED) { |
1796 | printk(MPT2SAS_INFO_FMT "%s: tm_cmd busy!!!\n", | 1801 | printk(MPT2SAS_INFO_FMT "%s: tm_cmd busy!!!\n", |
@@ -1834,10 +1839,12 @@ mpt2sas_scsih_issue_tm(struct MPT2SAS_ADAPTER *ioc, u16 handle, uint lun, | |||
1834 | mpi_request->DevHandle = cpu_to_le16(handle); | 1839 | mpi_request->DevHandle = cpu_to_le16(handle); |
1835 | mpi_request->TaskType = type; | 1840 | mpi_request->TaskType = type; |
1836 | mpi_request->TaskMID = cpu_to_le16(smid_task); | 1841 | mpi_request->TaskMID = cpu_to_le16(smid_task); |
1842 | mpi_request->VP_ID = 0; /* TODO */ | ||
1843 | mpi_request->VF_ID = 0; | ||
1837 | int_to_scsilun(lun, (struct scsi_lun *)mpi_request->LUN); | 1844 | int_to_scsilun(lun, (struct scsi_lun *)mpi_request->LUN); |
1838 | mpt2sas_scsih_set_tm_flag(ioc, handle); | 1845 | mpt2sas_scsih_set_tm_flag(ioc, handle); |
1839 | init_completion(&ioc->tm_cmds.done); | 1846 | init_completion(&ioc->tm_cmds.done); |
1840 | mpt2sas_base_put_smid_hi_priority(ioc, smid, VF_ID); | 1847 | mpt2sas_base_put_smid_hi_priority(ioc, smid); |
1841 | timeleft = wait_for_completion_timeout(&ioc->tm_cmds.done, timeout*HZ); | 1848 | timeleft = wait_for_completion_timeout(&ioc->tm_cmds.done, timeout*HZ); |
1842 | mpt2sas_scsih_clear_tm_flag(ioc, handle); | 1849 | mpt2sas_scsih_clear_tm_flag(ioc, handle); |
1843 | if (!(ioc->tm_cmds.status & MPT2_CMD_COMPLETE)) { | 1850 | if (!(ioc->tm_cmds.status & MPT2_CMD_COMPLETE)) { |
@@ -2643,7 +2650,8 @@ _scsih_qcmd(struct scsi_cmnd *scmd, void (*done)(struct scsi_cmnd *)) | |||
2643 | mpi_request->SGLOffset0 = offsetof(Mpi2SCSIIORequest_t, SGL) / 4; | 2650 | mpi_request->SGLOffset0 = offsetof(Mpi2SCSIIORequest_t, SGL) / 4; |
2644 | mpi_request->SGLFlags = cpu_to_le16(MPI2_SCSIIO_SGLFLAGS_TYPE_MPI + | 2651 | mpi_request->SGLFlags = cpu_to_le16(MPI2_SCSIIO_SGLFLAGS_TYPE_MPI + |
2645 | MPI2_SCSIIO_SGLFLAGS_SYSTEM_ADDR); | 2652 | MPI2_SCSIIO_SGLFLAGS_SYSTEM_ADDR); |
2646 | 2653 | mpi_request->VF_ID = 0; /* TODO */ | |
2654 | mpi_request->VP_ID = 0; | ||
2647 | int_to_scsilun(sas_device_priv_data->lun, (struct scsi_lun *) | 2655 | int_to_scsilun(sas_device_priv_data->lun, (struct scsi_lun *) |
2648 | mpi_request->LUN); | 2656 | mpi_request->LUN); |
2649 | memcpy(mpi_request->CDB.CDB32, scmd->cmnd, scmd->cmd_len); | 2657 | memcpy(mpi_request->CDB.CDB32, scmd->cmnd, scmd->cmd_len); |
@@ -2658,7 +2666,7 @@ _scsih_qcmd(struct scsi_cmnd *scmd, void (*done)(struct scsi_cmnd *)) | |||
2658 | } | 2666 | } |
2659 | 2667 | ||
2660 | _scsih_scsi_lookup_set(ioc, smid, scmd); | 2668 | _scsih_scsi_lookup_set(ioc, smid, scmd); |
2661 | mpt2sas_base_put_smid_scsi_io(ioc, smid, 0, | 2669 | mpt2sas_base_put_smid_scsi_io(ioc, smid, |
2662 | sas_device_priv_data->sas_target->handle); | 2670 | sas_device_priv_data->sas_target->handle); |
2663 | return 0; | 2671 | return 0; |
2664 | 2672 | ||
@@ -2954,7 +2962,7 @@ _scsih_smart_predicted_fault(struct MPT2SAS_ADAPTER *ioc, u16 handle) | |||
2954 | * _scsih_io_done - scsi request callback | 2962 | * _scsih_io_done - scsi request callback |
2955 | * @ioc: per adapter object | 2963 | * @ioc: per adapter object |
2956 | * @smid: system request message index | 2964 | * @smid: system request message index |
2957 | * @VF_ID: virtual function id | 2965 | * @msix_index: MSIX table index supplied by the OS |
2958 | * @reply: reply message frame(lower 32bit addr) | 2966 | * @reply: reply message frame(lower 32bit addr) |
2959 | * | 2967 | * |
2960 | * Callback handler when using scsih_qcmd. | 2968 | * Callback handler when using scsih_qcmd. |
@@ -2962,7 +2970,7 @@ _scsih_smart_predicted_fault(struct MPT2SAS_ADAPTER *ioc, u16 handle) | |||
2962 | * Return nothing. | 2970 | * Return nothing. |
2963 | */ | 2971 | */ |
2964 | static void | 2972 | static void |
2965 | _scsih_io_done(struct MPT2SAS_ADAPTER *ioc, u16 smid, u8 VF_ID, u32 reply) | 2973 | _scsih_io_done(struct MPT2SAS_ADAPTER *ioc, u16 smid, u8 msix_index, u32 reply) |
2966 | { | 2974 | { |
2967 | Mpi2SCSIIORequest_t *mpi_request; | 2975 | Mpi2SCSIIORequest_t *mpi_request; |
2968 | Mpi2SCSIIOReply_t *mpi_reply; | 2976 | Mpi2SCSIIOReply_t *mpi_reply; |
@@ -3690,7 +3698,8 @@ _scsih_remove_device(struct MPT2SAS_ADAPTER *ioc, u16 handle) | |||
3690 | mpi_request.Function = MPI2_FUNCTION_SAS_IO_UNIT_CONTROL; | 3698 | mpi_request.Function = MPI2_FUNCTION_SAS_IO_UNIT_CONTROL; |
3691 | mpi_request.Operation = MPI2_SAS_OP_REMOVE_DEVICE; | 3699 | mpi_request.Operation = MPI2_SAS_OP_REMOVE_DEVICE; |
3692 | mpi_request.DevHandle = handle; | 3700 | mpi_request.DevHandle = handle; |
3693 | mpi_request.VF_ID = 0; | 3701 | mpi_request.VF_ID = 0; /* TODO */ |
3702 | mpi_request.VP_ID = 0; | ||
3694 | if ((mpt2sas_base_sas_iounit_control(ioc, &mpi_reply, | 3703 | if ((mpt2sas_base_sas_iounit_control(ioc, &mpi_reply, |
3695 | &mpi_request)) != 0) { | 3704 | &mpi_request)) != 0) { |
3696 | printk(MPT2SAS_ERR_FMT "failure at %s:%d/%s()!\n", | 3705 | printk(MPT2SAS_ERR_FMT "failure at %s:%d/%s()!\n", |
@@ -3800,15 +3809,12 @@ _scsih_sas_topology_change_event_debug(struct MPT2SAS_ADAPTER *ioc, | |||
3800 | /** | 3809 | /** |
3801 | * _scsih_sas_topology_change_event - handle topology changes | 3810 | * _scsih_sas_topology_change_event - handle topology changes |
3802 | * @ioc: per adapter object | 3811 | * @ioc: per adapter object |
3803 | * @VF_ID: | 3812 | * @fw_event: The fw_event_work object |
3804 | * @event_data: event data payload | ||
3805 | * fw_event: | ||
3806 | * Context: user. | 3813 | * Context: user. |
3807 | * | 3814 | * |
3808 | */ | 3815 | */ |
3809 | static void | 3816 | static void |
3810 | _scsih_sas_topology_change_event(struct MPT2SAS_ADAPTER *ioc, u8 VF_ID, | 3817 | _scsih_sas_topology_change_event(struct MPT2SAS_ADAPTER *ioc, |
3811 | Mpi2EventDataSasTopologyChangeList_t *event_data, | ||
3812 | struct fw_event_work *fw_event) | 3818 | struct fw_event_work *fw_event) |
3813 | { | 3819 | { |
3814 | int i; | 3820 | int i; |
@@ -3818,6 +3824,7 @@ _scsih_sas_topology_change_event(struct MPT2SAS_ADAPTER *ioc, u8 VF_ID, | |||
3818 | struct _sas_node *sas_expander; | 3824 | struct _sas_node *sas_expander; |
3819 | unsigned long flags; | 3825 | unsigned long flags; |
3820 | u8 link_rate_; | 3826 | u8 link_rate_; |
3827 | Mpi2EventDataSasTopologyChangeList_t *event_data = fw_event->event_data; | ||
3821 | 3828 | ||
3822 | #ifdef CONFIG_SCSI_MPT2SAS_LOGGING | 3829 | #ifdef CONFIG_SCSI_MPT2SAS_LOGGING |
3823 | if (ioc->logging_level & MPT_DEBUG_EVENT_WORK_TASK) | 3830 | if (ioc->logging_level & MPT_DEBUG_EVENT_WORK_TASK) |
@@ -3971,19 +3978,19 @@ _scsih_sas_device_status_change_event_debug(struct MPT2SAS_ADAPTER *ioc, | |||
3971 | /** | 3978 | /** |
3972 | * _scsih_sas_device_status_change_event - handle device status change | 3979 | * _scsih_sas_device_status_change_event - handle device status change |
3973 | * @ioc: per adapter object | 3980 | * @ioc: per adapter object |
3974 | * @VF_ID: | 3981 | * @fw_event: The fw_event_work object |
3975 | * @event_data: event data payload | ||
3976 | * Context: user. | 3982 | * Context: user. |
3977 | * | 3983 | * |
3978 | * Return nothing. | 3984 | * Return nothing. |
3979 | */ | 3985 | */ |
3980 | static void | 3986 | static void |
3981 | _scsih_sas_device_status_change_event(struct MPT2SAS_ADAPTER *ioc, u8 VF_ID, | 3987 | _scsih_sas_device_status_change_event(struct MPT2SAS_ADAPTER *ioc, |
3982 | Mpi2EventDataSasDeviceStatusChange_t *event_data) | 3988 | struct fw_event_work *fw_event) |
3983 | { | 3989 | { |
3984 | #ifdef CONFIG_SCSI_MPT2SAS_LOGGING | 3990 | #ifdef CONFIG_SCSI_MPT2SAS_LOGGING |
3985 | if (ioc->logging_level & MPT_DEBUG_EVENT_WORK_TASK) | 3991 | if (ioc->logging_level & MPT_DEBUG_EVENT_WORK_TASK) |
3986 | _scsih_sas_device_status_change_event_debug(ioc, event_data); | 3992 | _scsih_sas_device_status_change_event_debug(ioc, |
3993 | fw_event->event_data); | ||
3987 | #endif | 3994 | #endif |
3988 | } | 3995 | } |
3989 | 3996 | ||
@@ -4026,34 +4033,33 @@ _scsih_sas_enclosure_dev_status_change_event_debug(struct MPT2SAS_ADAPTER *ioc, | |||
4026 | /** | 4033 | /** |
4027 | * _scsih_sas_enclosure_dev_status_change_event - handle enclosure events | 4034 | * _scsih_sas_enclosure_dev_status_change_event - handle enclosure events |
4028 | * @ioc: per adapter object | 4035 | * @ioc: per adapter object |
4029 | * @VF_ID: | 4036 | * @fw_event: The fw_event_work object |
4030 | * @event_data: event data payload | ||
4031 | * Context: user. | 4037 | * Context: user. |
4032 | * | 4038 | * |
4033 | * Return nothing. | 4039 | * Return nothing. |
4034 | */ | 4040 | */ |
4035 | static void | 4041 | static void |
4036 | _scsih_sas_enclosure_dev_status_change_event(struct MPT2SAS_ADAPTER *ioc, | 4042 | _scsih_sas_enclosure_dev_status_change_event(struct MPT2SAS_ADAPTER *ioc, |
4037 | u8 VF_ID, Mpi2EventDataSasEnclDevStatusChange_t *event_data) | 4043 | struct fw_event_work *fw_event) |
4038 | { | 4044 | { |
4039 | #ifdef CONFIG_SCSI_MPT2SAS_LOGGING | 4045 | #ifdef CONFIG_SCSI_MPT2SAS_LOGGING |
4040 | if (ioc->logging_level & MPT_DEBUG_EVENT_WORK_TASK) | 4046 | if (ioc->logging_level & MPT_DEBUG_EVENT_WORK_TASK) |
4041 | _scsih_sas_enclosure_dev_status_change_event_debug(ioc, | 4047 | _scsih_sas_enclosure_dev_status_change_event_debug(ioc, |
4042 | event_data); | 4048 | fw_event->event_data); |
4043 | #endif | 4049 | #endif |
4044 | } | 4050 | } |
4045 | 4051 | ||
4046 | /** | 4052 | /** |
4047 | * _scsih_sas_broadcast_primative_event - handle broadcast events | 4053 | * _scsih_sas_broadcast_primative_event - handle broadcast events |
4048 | * @ioc: per adapter object | 4054 | * @ioc: per adapter object |
4049 | * @event_data: event data payload | 4055 | * @fw_event: The fw_event_work object |
4050 | * Context: user. | 4056 | * Context: user. |
4051 | * | 4057 | * |
4052 | * Return nothing. | 4058 | * Return nothing. |
4053 | */ | 4059 | */ |
4054 | static void | 4060 | static void |
4055 | _scsih_sas_broadcast_primative_event(struct MPT2SAS_ADAPTER *ioc, u8 VF_ID, | 4061 | _scsih_sas_broadcast_primative_event(struct MPT2SAS_ADAPTER *ioc, |
4056 | Mpi2EventDataSasBroadcastPrimitive_t *event_data) | 4062 | struct fw_event_work *fw_event) |
4057 | { | 4063 | { |
4058 | struct scsi_cmnd *scmd; | 4064 | struct scsi_cmnd *scmd; |
4059 | u16 smid, handle; | 4065 | u16 smid, handle; |
@@ -4062,11 +4068,12 @@ _scsih_sas_broadcast_primative_event(struct MPT2SAS_ADAPTER *ioc, u8 VF_ID, | |||
4062 | u32 termination_count; | 4068 | u32 termination_count; |
4063 | u32 query_count; | 4069 | u32 query_count; |
4064 | Mpi2SCSITaskManagementReply_t *mpi_reply; | 4070 | Mpi2SCSITaskManagementReply_t *mpi_reply; |
4065 | 4071 | #ifdef CONFIG_SCSI_MPT2SAS_LOGGING | |
4072 | Mpi2EventDataSasBroadcastPrimitive_t *event_data = fw_event->event_data; | ||
4073 | #endif | ||
4066 | dewtprintk(ioc, printk(MPT2SAS_DEBUG_FMT "broadcast primative: " | 4074 | dewtprintk(ioc, printk(MPT2SAS_DEBUG_FMT "broadcast primative: " |
4067 | "phy number(%d), width(%d)\n", ioc->name, event_data->PhyNum, | 4075 | "phy number(%d), width(%d)\n", ioc->name, event_data->PhyNum, |
4068 | event_data->PortWidth)); | 4076 | event_data->PortWidth)); |
4069 | |||
4070 | dtmprintk(ioc, printk(MPT2SAS_DEBUG_FMT "%s: enter\n", ioc->name, | 4077 | dtmprintk(ioc, printk(MPT2SAS_DEBUG_FMT "%s: enter\n", ioc->name, |
4071 | __func__)); | 4078 | __func__)); |
4072 | 4079 | ||
@@ -4121,15 +4128,17 @@ _scsih_sas_broadcast_primative_event(struct MPT2SAS_ADAPTER *ioc, u8 VF_ID, | |||
4121 | /** | 4128 | /** |
4122 | * _scsih_sas_discovery_event - handle discovery events | 4129 | * _scsih_sas_discovery_event - handle discovery events |
4123 | * @ioc: per adapter object | 4130 | * @ioc: per adapter object |
4124 | * @event_data: event data payload | 4131 | * @fw_event: The fw_event_work object |
4125 | * Context: user. | 4132 | * Context: user. |
4126 | * | 4133 | * |
4127 | * Return nothing. | 4134 | * Return nothing. |
4128 | */ | 4135 | */ |
4129 | static void | 4136 | static void |
4130 | _scsih_sas_discovery_event(struct MPT2SAS_ADAPTER *ioc, u8 VF_ID, | 4137 | _scsih_sas_discovery_event(struct MPT2SAS_ADAPTER *ioc, |
4131 | Mpi2EventDataSasDiscovery_t *event_data) | 4138 | struct fw_event_work *fw_event) |
4132 | { | 4139 | { |
4140 | Mpi2EventDataSasDiscovery_t *event_data = fw_event->event_data; | ||
4141 | |||
4133 | #ifdef CONFIG_SCSI_MPT2SAS_LOGGING | 4142 | #ifdef CONFIG_SCSI_MPT2SAS_LOGGING |
4134 | if (ioc->logging_level & MPT_DEBUG_EVENT_WORK_TASK) { | 4143 | if (ioc->logging_level & MPT_DEBUG_EVENT_WORK_TASK) { |
4135 | printk(MPT2SAS_DEBUG_FMT "discovery event: (%s)", ioc->name, | 4144 | printk(MPT2SAS_DEBUG_FMT "discovery event: (%s)", ioc->name, |
@@ -4488,19 +4497,19 @@ _scsih_sas_ir_config_change_event_debug(struct MPT2SAS_ADAPTER *ioc, | |||
4488 | /** | 4497 | /** |
4489 | * _scsih_sas_ir_config_change_event - handle ir configuration change events | 4498 | * _scsih_sas_ir_config_change_event - handle ir configuration change events |
4490 | * @ioc: per adapter object | 4499 | * @ioc: per adapter object |
4491 | * @VF_ID: | 4500 | * @fw_event: The fw_event_work object |
4492 | * @event_data: event data payload | ||
4493 | * Context: user. | 4501 | * Context: user. |
4494 | * | 4502 | * |
4495 | * Return nothing. | 4503 | * Return nothing. |
4496 | */ | 4504 | */ |
4497 | static void | 4505 | static void |
4498 | _scsih_sas_ir_config_change_event(struct MPT2SAS_ADAPTER *ioc, u8 VF_ID, | 4506 | _scsih_sas_ir_config_change_event(struct MPT2SAS_ADAPTER *ioc, |
4499 | Mpi2EventDataIrConfigChangeList_t *event_data) | 4507 | struct fw_event_work *fw_event) |
4500 | { | 4508 | { |
4501 | Mpi2EventIrConfigElement_t *element; | 4509 | Mpi2EventIrConfigElement_t *element; |
4502 | int i; | 4510 | int i; |
4503 | u8 foreign_config; | 4511 | u8 foreign_config; |
4512 | Mpi2EventDataIrConfigChangeList_t *event_data = fw_event->event_data; | ||
4504 | 4513 | ||
4505 | #ifdef CONFIG_SCSI_MPT2SAS_LOGGING | 4514 | #ifdef CONFIG_SCSI_MPT2SAS_LOGGING |
4506 | if (ioc->logging_level & MPT_DEBUG_EVENT_WORK_TASK) | 4515 | if (ioc->logging_level & MPT_DEBUG_EVENT_WORK_TASK) |
@@ -4543,14 +4552,14 @@ _scsih_sas_ir_config_change_event(struct MPT2SAS_ADAPTER *ioc, u8 VF_ID, | |||
4543 | /** | 4552 | /** |
4544 | * _scsih_sas_ir_volume_event - IR volume event | 4553 | * _scsih_sas_ir_volume_event - IR volume event |
4545 | * @ioc: per adapter object | 4554 | * @ioc: per adapter object |
4546 | * @event_data: event data payload | 4555 | * @fw_event: The fw_event_work object |
4547 | * Context: user. | 4556 | * Context: user. |
4548 | * | 4557 | * |
4549 | * Return nothing. | 4558 | * Return nothing. |
4550 | */ | 4559 | */ |
4551 | static void | 4560 | static void |
4552 | _scsih_sas_ir_volume_event(struct MPT2SAS_ADAPTER *ioc, u8 VF_ID, | 4561 | _scsih_sas_ir_volume_event(struct MPT2SAS_ADAPTER *ioc, |
4553 | Mpi2EventDataIrVolume_t *event_data) | 4562 | struct fw_event_work *fw_event) |
4554 | { | 4563 | { |
4555 | u64 wwid; | 4564 | u64 wwid; |
4556 | unsigned long flags; | 4565 | unsigned long flags; |
@@ -4559,6 +4568,7 @@ _scsih_sas_ir_volume_event(struct MPT2SAS_ADAPTER *ioc, u8 VF_ID, | |||
4559 | u32 state; | 4568 | u32 state; |
4560 | int rc; | 4569 | int rc; |
4561 | struct MPT2SAS_TARGET *sas_target_priv_data; | 4570 | struct MPT2SAS_TARGET *sas_target_priv_data; |
4571 | Mpi2EventDataIrVolume_t *event_data = fw_event->event_data; | ||
4562 | 4572 | ||
4563 | if (event_data->ReasonCode != MPI2_EVENT_IR_VOLUME_RC_STATE_CHANGED) | 4573 | if (event_data->ReasonCode != MPI2_EVENT_IR_VOLUME_RC_STATE_CHANGED) |
4564 | return; | 4574 | return; |
@@ -4628,14 +4638,14 @@ _scsih_sas_ir_volume_event(struct MPT2SAS_ADAPTER *ioc, u8 VF_ID, | |||
4628 | /** | 4638 | /** |
4629 | * _scsih_sas_ir_physical_disk_event - PD event | 4639 | * _scsih_sas_ir_physical_disk_event - PD event |
4630 | * @ioc: per adapter object | 4640 | * @ioc: per adapter object |
4631 | * @event_data: event data payload | 4641 | * @fw_event: The fw_event_work object |
4632 | * Context: user. | 4642 | * Context: user. |
4633 | * | 4643 | * |
4634 | * Return nothing. | 4644 | * Return nothing. |
4635 | */ | 4645 | */ |
4636 | static void | 4646 | static void |
4637 | _scsih_sas_ir_physical_disk_event(struct MPT2SAS_ADAPTER *ioc, u8 VF_ID, | 4647 | _scsih_sas_ir_physical_disk_event(struct MPT2SAS_ADAPTER *ioc, |
4638 | Mpi2EventDataIrPhysicalDisk_t *event_data) | 4648 | struct fw_event_work *fw_event) |
4639 | { | 4649 | { |
4640 | u16 handle; | 4650 | u16 handle; |
4641 | u32 state; | 4651 | u32 state; |
@@ -4644,6 +4654,7 @@ _scsih_sas_ir_physical_disk_event(struct MPT2SAS_ADAPTER *ioc, u8 VF_ID, | |||
4644 | Mpi2ConfigReply_t mpi_reply; | 4654 | Mpi2ConfigReply_t mpi_reply; |
4645 | Mpi2SasDevicePage0_t sas_device_pg0; | 4655 | Mpi2SasDevicePage0_t sas_device_pg0; |
4646 | u32 ioc_status; | 4656 | u32 ioc_status; |
4657 | Mpi2EventDataIrPhysicalDisk_t *event_data = fw_event->event_data; | ||
4647 | 4658 | ||
4648 | if (event_data->ReasonCode != MPI2_EVENT_IR_PHYSDISK_RC_STATE_CHANGED) | 4659 | if (event_data->ReasonCode != MPI2_EVENT_IR_PHYSDISK_RC_STATE_CHANGED) |
4649 | return; | 4660 | return; |
@@ -4743,33 +4754,33 @@ _scsih_sas_ir_operation_status_event_debug(struct MPT2SAS_ADAPTER *ioc, | |||
4743 | /** | 4754 | /** |
4744 | * _scsih_sas_ir_operation_status_event - handle RAID operation events | 4755 | * _scsih_sas_ir_operation_status_event - handle RAID operation events |
4745 | * @ioc: per adapter object | 4756 | * @ioc: per adapter object |
4746 | * @VF_ID: | 4757 | * @fw_event: The fw_event_work object |
4747 | * @event_data: event data payload | ||
4748 | * Context: user. | 4758 | * Context: user. |
4749 | * | 4759 | * |
4750 | * Return nothing. | 4760 | * Return nothing. |
4751 | */ | 4761 | */ |
4752 | static void | 4762 | static void |
4753 | _scsih_sas_ir_operation_status_event(struct MPT2SAS_ADAPTER *ioc, u8 VF_ID, | 4763 | _scsih_sas_ir_operation_status_event(struct MPT2SAS_ADAPTER *ioc, |
4754 | Mpi2EventDataIrOperationStatus_t *event_data) | 4764 | struct fw_event_work *fw_event) |
4755 | { | 4765 | { |
4756 | #ifdef CONFIG_SCSI_MPT2SAS_LOGGING | 4766 | #ifdef CONFIG_SCSI_MPT2SAS_LOGGING |
4757 | if (ioc->logging_level & MPT_DEBUG_EVENT_WORK_TASK) | 4767 | if (ioc->logging_level & MPT_DEBUG_EVENT_WORK_TASK) |
4758 | _scsih_sas_ir_operation_status_event_debug(ioc, event_data); | 4768 | _scsih_sas_ir_operation_status_event_debug(ioc, |
4769 | fw_event->event_data); | ||
4759 | #endif | 4770 | #endif |
4760 | } | 4771 | } |
4761 | 4772 | ||
4762 | /** | 4773 | /** |
4763 | * _scsih_task_set_full - handle task set full | 4774 | * _scsih_task_set_full - handle task set full |
4764 | * @ioc: per adapter object | 4775 | * @ioc: per adapter object |
4765 | * @event_data: event data payload | 4776 | * @fw_event: The fw_event_work object |
4766 | * Context: user. | 4777 | * Context: user. |
4767 | * | 4778 | * |
4768 | * Throttle back qdepth. | 4779 | * Throttle back qdepth. |
4769 | */ | 4780 | */ |
4770 | static void | 4781 | static void |
4771 | _scsih_task_set_full(struct MPT2SAS_ADAPTER *ioc, u8 VF_ID, | 4782 | _scsih_task_set_full(struct MPT2SAS_ADAPTER *ioc, struct fw_event_work |
4772 | Mpi2EventDataTaskSetFull_t *event_data) | 4783 | *fw_event) |
4773 | { | 4784 | { |
4774 | unsigned long flags; | 4785 | unsigned long flags; |
4775 | struct _sas_device *sas_device; | 4786 | struct _sas_device *sas_device; |
@@ -4780,6 +4791,7 @@ _scsih_task_set_full(struct MPT2SAS_ADAPTER *ioc, u8 VF_ID, | |||
4780 | u16 handle; | 4791 | u16 handle; |
4781 | int id, channel; | 4792 | int id, channel; |
4782 | u64 sas_address; | 4793 | u64 sas_address; |
4794 | Mpi2EventDataTaskSetFull_t *event_data = fw_event->event_data; | ||
4783 | 4795 | ||
4784 | current_depth = le16_to_cpu(event_data->CurrentDepth); | 4796 | current_depth = le16_to_cpu(event_data->CurrentDepth); |
4785 | handle = le16_to_cpu(event_data->DevHandle); | 4797 | handle = le16_to_cpu(event_data->DevHandle); |
@@ -5227,44 +5239,38 @@ _firmware_event_work(struct work_struct *work) | |||
5227 | 5239 | ||
5228 | switch (fw_event->event) { | 5240 | switch (fw_event->event) { |
5229 | case MPI2_EVENT_SAS_TOPOLOGY_CHANGE_LIST: | 5241 | case MPI2_EVENT_SAS_TOPOLOGY_CHANGE_LIST: |
5230 | _scsih_sas_topology_change_event(ioc, fw_event->VF_ID, | 5242 | _scsih_sas_topology_change_event(ioc, fw_event); |
5231 | fw_event->event_data, fw_event); | ||
5232 | break; | 5243 | break; |
5233 | case MPI2_EVENT_SAS_DEVICE_STATUS_CHANGE: | 5244 | case MPI2_EVENT_SAS_DEVICE_STATUS_CHANGE: |
5234 | _scsih_sas_device_status_change_event(ioc, fw_event->VF_ID, | 5245 | _scsih_sas_device_status_change_event(ioc, |
5235 | fw_event->event_data); | 5246 | fw_event); |
5236 | break; | 5247 | break; |
5237 | case MPI2_EVENT_SAS_DISCOVERY: | 5248 | case MPI2_EVENT_SAS_DISCOVERY: |
5238 | _scsih_sas_discovery_event(ioc, fw_event->VF_ID, | 5249 | _scsih_sas_discovery_event(ioc, |
5239 | fw_event->event_data); | 5250 | fw_event); |
5240 | break; | 5251 | break; |
5241 | case MPI2_EVENT_SAS_BROADCAST_PRIMITIVE: | 5252 | case MPI2_EVENT_SAS_BROADCAST_PRIMITIVE: |
5242 | _scsih_sas_broadcast_primative_event(ioc, fw_event->VF_ID, | 5253 | _scsih_sas_broadcast_primative_event(ioc, |
5243 | fw_event->event_data); | 5254 | fw_event); |
5244 | break; | 5255 | break; |
5245 | case MPI2_EVENT_SAS_ENCL_DEVICE_STATUS_CHANGE: | 5256 | case MPI2_EVENT_SAS_ENCL_DEVICE_STATUS_CHANGE: |
5246 | _scsih_sas_enclosure_dev_status_change_event(ioc, | 5257 | _scsih_sas_enclosure_dev_status_change_event(ioc, |
5247 | fw_event->VF_ID, fw_event->event_data); | 5258 | fw_event); |
5248 | break; | 5259 | break; |
5249 | case MPI2_EVENT_IR_CONFIGURATION_CHANGE_LIST: | 5260 | case MPI2_EVENT_IR_CONFIGURATION_CHANGE_LIST: |
5250 | _scsih_sas_ir_config_change_event(ioc, fw_event->VF_ID, | 5261 | _scsih_sas_ir_config_change_event(ioc, fw_event); |
5251 | fw_event->event_data); | ||
5252 | break; | 5262 | break; |
5253 | case MPI2_EVENT_IR_VOLUME: | 5263 | case MPI2_EVENT_IR_VOLUME: |
5254 | _scsih_sas_ir_volume_event(ioc, fw_event->VF_ID, | 5264 | _scsih_sas_ir_volume_event(ioc, fw_event); |
5255 | fw_event->event_data); | ||
5256 | break; | 5265 | break; |
5257 | case MPI2_EVENT_IR_PHYSICAL_DISK: | 5266 | case MPI2_EVENT_IR_PHYSICAL_DISK: |
5258 | _scsih_sas_ir_physical_disk_event(ioc, fw_event->VF_ID, | 5267 | _scsih_sas_ir_physical_disk_event(ioc, fw_event); |
5259 | fw_event->event_data); | ||
5260 | break; | 5268 | break; |
5261 | case MPI2_EVENT_IR_OPERATION_STATUS: | 5269 | case MPI2_EVENT_IR_OPERATION_STATUS: |
5262 | _scsih_sas_ir_operation_status_event(ioc, fw_event->VF_ID, | 5270 | _scsih_sas_ir_operation_status_event(ioc, fw_event); |
5263 | fw_event->event_data); | ||
5264 | break; | 5271 | break; |
5265 | case MPI2_EVENT_TASK_SET_FULL: | 5272 | case MPI2_EVENT_TASK_SET_FULL: |
5266 | _scsih_task_set_full(ioc, fw_event->VF_ID, | 5273 | _scsih_task_set_full(ioc, fw_event); |
5267 | fw_event->event_data); | ||
5268 | break; | 5274 | break; |
5269 | } | 5275 | } |
5270 | _scsih_fw_event_free(ioc, fw_event); | 5276 | _scsih_fw_event_free(ioc, fw_event); |
@@ -5273,7 +5279,7 @@ _firmware_event_work(struct work_struct *work) | |||
5273 | /** | 5279 | /** |
5274 | * mpt2sas_scsih_event_callback - firmware event handler (called at ISR time) | 5280 | * mpt2sas_scsih_event_callback - firmware event handler (called at ISR time) |
5275 | * @ioc: per adapter object | 5281 | * @ioc: per adapter object |
5276 | * @VF_ID: virtual function id | 5282 | * @msix_index: MSIX table index supplied by the OS |
5277 | * @reply: reply message frame(lower 32bit addr) | 5283 | * @reply: reply message frame(lower 32bit addr) |
5278 | * Context: interrupt. | 5284 | * Context: interrupt. |
5279 | * | 5285 | * |
@@ -5283,7 +5289,8 @@ _firmware_event_work(struct work_struct *work) | |||
5283 | * Return nothing. | 5289 | * Return nothing. |
5284 | */ | 5290 | */ |
5285 | void | 5291 | void |
5286 | mpt2sas_scsih_event_callback(struct MPT2SAS_ADAPTER *ioc, u8 VF_ID, u32 reply) | 5292 | mpt2sas_scsih_event_callback(struct MPT2SAS_ADAPTER *ioc, u8 msix_index, |
5293 | u32 reply) | ||
5287 | { | 5294 | { |
5288 | struct fw_event_work *fw_event; | 5295 | struct fw_event_work *fw_event; |
5289 | Mpi2EventNotificationReply_t *mpi_reply; | 5296 | Mpi2EventNotificationReply_t *mpi_reply; |
@@ -5355,7 +5362,8 @@ mpt2sas_scsih_event_callback(struct MPT2SAS_ADAPTER *ioc, u8 VF_ID, u32 reply) | |||
5355 | memcpy(fw_event->event_data, mpi_reply->EventData, | 5362 | memcpy(fw_event->event_data, mpi_reply->EventData, |
5356 | mpi_reply->EventDataLength*4); | 5363 | mpi_reply->EventDataLength*4); |
5357 | fw_event->ioc = ioc; | 5364 | fw_event->ioc = ioc; |
5358 | fw_event->VF_ID = VF_ID; | 5365 | fw_event->VF_ID = mpi_reply->VF_ID; |
5366 | fw_event->VP_ID = mpi_reply->VP_ID; | ||
5359 | fw_event->event = event; | 5367 | fw_event->event = event; |
5360 | _scsih_fw_event_add(ioc, fw_event); | 5368 | _scsih_fw_event_add(ioc, fw_event); |
5361 | } | 5369 | } |
diff --git a/drivers/scsi/mpt2sas/mpt2sas_transport.c b/drivers/scsi/mpt2sas/mpt2sas_transport.c index 742324a0a11e..4b0e90ee892b 100644 --- a/drivers/scsi/mpt2sas/mpt2sas_transport.c +++ b/drivers/scsi/mpt2sas/mpt2sas_transport.c | |||
@@ -212,7 +212,7 @@ _transport_set_identify(struct MPT2SAS_ADAPTER *ioc, u16 handle, | |||
212 | * mpt2sas_transport_done - internal transport layer callback handler. | 212 | * mpt2sas_transport_done - internal transport layer callback handler. |
213 | * @ioc: per adapter object | 213 | * @ioc: per adapter object |
214 | * @smid: system request message index | 214 | * @smid: system request message index |
215 | * @VF_ID: virtual function id | 215 | * @msix_index: MSIX table index supplied by the OS |
216 | * @reply: reply message frame(lower 32bit addr) | 216 | * @reply: reply message frame(lower 32bit addr) |
217 | * | 217 | * |
218 | * Callback handler when sending internal generated transport cmds. | 218 | * Callback handler when sending internal generated transport cmds. |
@@ -221,7 +221,7 @@ _transport_set_identify(struct MPT2SAS_ADAPTER *ioc, u16 handle, | |||
221 | * Return nothing. | 221 | * Return nothing. |
222 | */ | 222 | */ |
223 | void | 223 | void |
224 | mpt2sas_transport_done(struct MPT2SAS_ADAPTER *ioc, u16 smid, u8 VF_ID, | 224 | mpt2sas_transport_done(struct MPT2SAS_ADAPTER *ioc, u16 smid, u8 msix_index, |
225 | u32 reply) | 225 | u32 reply) |
226 | { | 226 | { |
227 | MPI2DefaultReply_t *mpi_reply; | 227 | MPI2DefaultReply_t *mpi_reply; |
@@ -369,6 +369,8 @@ _transport_expander_report_manufacture(struct MPT2SAS_ADAPTER *ioc, | |||
369 | memset(mpi_request, 0, sizeof(Mpi2SmpPassthroughRequest_t)); | 369 | memset(mpi_request, 0, sizeof(Mpi2SmpPassthroughRequest_t)); |
370 | mpi_request->Function = MPI2_FUNCTION_SMP_PASSTHROUGH; | 370 | mpi_request->Function = MPI2_FUNCTION_SMP_PASSTHROUGH; |
371 | mpi_request->PhysicalPort = 0xFF; | 371 | mpi_request->PhysicalPort = 0xFF; |
372 | mpi_request->VF_ID = 0; /* TODO */ | ||
373 | mpi_request->VP_ID = 0; | ||
372 | sas_address_le = (u64 *)&mpi_request->SASAddress; | 374 | sas_address_le = (u64 *)&mpi_request->SASAddress; |
373 | *sas_address_le = cpu_to_le64(sas_address); | 375 | *sas_address_le = cpu_to_le64(sas_address); |
374 | mpi_request->RequestDataLength = sizeof(struct rep_manu_request); | 376 | mpi_request->RequestDataLength = sizeof(struct rep_manu_request); |
@@ -396,7 +398,7 @@ _transport_expander_report_manufacture(struct MPT2SAS_ADAPTER *ioc, | |||
396 | dtransportprintk(ioc, printk(MPT2SAS_DEBUG_FMT "report_manufacture - " | 398 | dtransportprintk(ioc, printk(MPT2SAS_DEBUG_FMT "report_manufacture - " |
397 | "send to sas_addr(0x%016llx)\n", ioc->name, | 399 | "send to sas_addr(0x%016llx)\n", ioc->name, |
398 | (unsigned long long)sas_address)); | 400 | (unsigned long long)sas_address)); |
399 | mpt2sas_base_put_smid_default(ioc, smid, 0 /* VF_ID */); | 401 | mpt2sas_base_put_smid_default(ioc, smid); |
400 | timeleft = wait_for_completion_timeout(&ioc->transport_cmds.done, | 402 | timeleft = wait_for_completion_timeout(&ioc->transport_cmds.done, |
401 | 10*HZ); | 403 | 10*HZ); |
402 | 404 | ||
@@ -1106,6 +1108,8 @@ _transport_smp_handler(struct Scsi_Host *shost, struct sas_rphy *rphy, | |||
1106 | memset(mpi_request, 0, sizeof(Mpi2SmpPassthroughRequest_t)); | 1108 | memset(mpi_request, 0, sizeof(Mpi2SmpPassthroughRequest_t)); |
1107 | mpi_request->Function = MPI2_FUNCTION_SMP_PASSTHROUGH; | 1109 | mpi_request->Function = MPI2_FUNCTION_SMP_PASSTHROUGH; |
1108 | mpi_request->PhysicalPort = 0xFF; | 1110 | mpi_request->PhysicalPort = 0xFF; |
1111 | mpi_request->VF_ID = 0; /* TODO */ | ||
1112 | mpi_request->VP_ID = 0; | ||
1109 | *((u64 *)&mpi_request->SASAddress) = (rphy) ? | 1113 | *((u64 *)&mpi_request->SASAddress) = (rphy) ? |
1110 | cpu_to_le64(rphy->identify.sas_address) : | 1114 | cpu_to_le64(rphy->identify.sas_address) : |
1111 | cpu_to_le64(ioc->sas_hba.sas_address); | 1115 | cpu_to_le64(ioc->sas_hba.sas_address); |
@@ -1147,7 +1151,7 @@ _transport_smp_handler(struct Scsi_Host *shost, struct sas_rphy *rphy, | |||
1147 | dtransportprintk(ioc, printk(MPT2SAS_DEBUG_FMT "%s - " | 1151 | dtransportprintk(ioc, printk(MPT2SAS_DEBUG_FMT "%s - " |
1148 | "sending smp request\n", ioc->name, __func__)); | 1152 | "sending smp request\n", ioc->name, __func__)); |
1149 | 1153 | ||
1150 | mpt2sas_base_put_smid_default(ioc, smid, 0 /* VF_ID */); | 1154 | mpt2sas_base_put_smid_default(ioc, smid); |
1151 | timeleft = wait_for_completion_timeout(&ioc->transport_cmds.done, | 1155 | timeleft = wait_for_completion_timeout(&ioc->transport_cmds.done, |
1152 | 10*HZ); | 1156 | 10*HZ); |
1153 | 1157 | ||