]> git.proxmox.com Git - mirror_ubuntu-zesty-kernel.git/blobdiff - drivers/scsi/aacraid/src.c
scsi: aacraid: Added support to abort cmd and reset lun
[mirror_ubuntu-zesty-kernel.git] / drivers / scsi / aacraid / src.c
index 946a010e46dfb8065ee6626382f88a917415bb9e..1dd62a4aad2c31ce12b4a6ee8a34b9ffaa19ac2f 100644 (file)
@@ -497,10 +497,35 @@ static int aac_src_deliver_message(struct fib *fib)
                        vector_no = fib->vector_no;
 
                if (native_hba) {
-                       ((struct aac_hba_cmd_req *)fib->hw_fib_va)->reply_qid
-                               = vector_no;
-                       ((struct aac_hba_cmd_req *)fib->hw_fib_va)->request_id
-                               += (vector_no << 16);
+                       if (fib->flags & FIB_CONTEXT_FLAG_NATIVE_HBA_TMF) {
+                               struct aac_hba_tm_req *tm_req;
+
+                               tm_req = (struct aac_hba_tm_req *)
+                                               fib->hw_fib_va;
+                               if (tm_req->iu_type ==
+                                       HBA_IU_TYPE_SCSI_TM_REQ) {
+                                       ((struct aac_hba_tm_req *)
+                                               fib->hw_fib_va)->reply_qid
+                                                       = vector_no;
+                                       ((struct aac_hba_tm_req *)
+                                               fib->hw_fib_va)->request_id
+                                                       += (vector_no << 16);
+                               } else {
+                                       ((struct aac_hba_reset_req *)
+                                               fib->hw_fib_va)->reply_qid
+                                                       = vector_no;
+                                       ((struct aac_hba_reset_req *)
+                                               fib->hw_fib_va)->request_id
+                                                       += (vector_no << 16);
+                               }
+                       } else {
+                               ((struct aac_hba_cmd_req *)
+                                       fib->hw_fib_va)->reply_qid
+                                               = vector_no;
+                               ((struct aac_hba_cmd_req *)
+                                       fib->hw_fib_va)->request_id
+                                               += (vector_no << 16);
+                       }
                } else {
                        fib->hw_fib_va->header.Handle += (vector_no << 16);
                }