Author: kadesai Date: Wed Dec 26 10:39:22 2018 New Revision: 342528 URL: https://svnweb.freebsd.org/changeset/base/342528
Log: Copy back the Sense data at proper location expected by the application typedef struct mps_pass_thru { uint64_t PtrRequest; uint64_t PtrReply; uint64_t PtrData; uint32_t RequestSize; uint32_t ReplySize; uint32_t DataSize; uint32_t DataDirection; uint64_t PtrDataOut; uint32_t DataOutSize; uint32_t Timeout; } mps_pass_thru_t, * ptrmpssas_pass_thru_t; In the above mps_pass_thru structure; Application expects PrtReply buffer should contain both MPI reply followed by sense data. So, updated driver to copy sense data at PtrReply + sizeof(MPI2 reply) location where application wants the driver to copy back the sense data info. Submitted by: Sreekanth Reddy <sreekanth.re...@broadcom.com> Reviewed by: Kashyap Desai <kashyap.de...@broadcom.com> Approved by: ken MFC after: 3 days Sponsored by: Broadcom Inc Modified: head/sys/dev/mpr/mpr_user.c Modified: head/sys/dev/mpr/mpr_user.c ============================================================================== --- head/sys/dev/mpr/mpr_user.c Wed Dec 26 10:38:51 2018 (r342527) +++ head/sys/dev/mpr/mpr_user.c Wed Dec 26 10:39:22 2018 (r342528) @@ -1106,7 +1106,8 @@ mpr_user_pass_thru(struct mpr_softc *sc, mpr_pass_thru SenseCount)), sizeof(struct scsi_sense_data)); mpr_unlock(sc); - copyout(cm->cm_sense, cm->cm_req + 64, + copyout(cm->cm_sense, + (PTRIN(data->PtrReply + sizeof(MPI2_SCSI_IO_REPLY))), sense_len); mpr_lock(sc); } @@ -1140,7 +1141,9 @@ mpr_user_pass_thru(struct mpr_softc *sc, mpr_pass_thru sz = MIN(le32toh(nvme_error_reply->ErrorResponseCount), NVME_ERROR_RESPONSE_SIZE); mpr_unlock(sc); - copyout(cm->cm_sense, cm->nvme_error_response, sz); + copyout(cm->cm_sense, + (PTRIN(data->PtrReply + + sizeof(MPI2_SCSI_IO_REPLY))), sz); mpr_lock(sc); } } _______________________________________________ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"