qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] hw/ufs: add basic info of query response upiu
       [not found] <CGME20240802051902epcms2p319bc095a15eaef8de4e6955f6718371d@epcms2p3>
@ 2024-08-02  5:19 ` Kyoungrul Kim
  2024-08-04  0:44   ` Minwoo Im
  0 siblings, 1 reply; 3+ messages in thread
From: Kyoungrul Kim @ 2024-08-02  5:19 UTC (permalink / raw)
  To: Jeuk Kim; +Cc: qemu-devel@nongnu.org, Kyoungrul Kim, Minwoo Im, SSDR Gost Dev

Modify to fill the opcode, idn, index, selector information of
all Query Response UPIU. because attr and flag operation of query
response upiu need these information too.

Signed-off-by: KyoungrulKim <k831.kim@samsung.com>
---
 hw/ufs/ufs.c | 13 +++++++++----
 hw/ufs/ufs.h |  1 +
 2 files changed, 10 insertions(+), 4 deletions(-)

diff --git a/hw/ufs/ufs.c b/hw/ufs/ufs.c
index 945a0ea127..ce2c96aeea 100644
--- a/hw/ufs/ufs.c
+++ b/hw/ufs/ufs.c
@@ -851,6 +851,14 @@ void ufs_build_upiu_header(UfsRequest *req, uint8_t trans_type, uint8_t flags,
     req->rsp_upiu.header.data_segment_length = cpu_to_be16(data_segment_length);
 }
 
+void ufs_build_query_response(UfsRequest *req)
+{
+    req->rsp_upiu.qr.opcode = req->req_upiu.qr.opcode;
+    req->rsp_upiu.qr.idn = req->req_upiu.qr.idn;
+    req->rsp_upiu.qr.index = req->req_upiu.qr.index;
+    req->rsp_upiu.qr.selector = req->req_upiu.qr.selector;
+}
+
 static UfsReqResult ufs_exec_scsi_cmd(UfsRequest *req)
 {
     UfsHc *u = req->hc;
@@ -1327,10 +1335,6 @@ static QueryRespCode ufs_read_desc(UfsRequest *req)
     if (length > req->rsp_upiu.qr.data[0]) {
         length = req->rsp_upiu.qr.data[0];
     }
-    req->rsp_upiu.qr.opcode = req->req_upiu.qr.opcode;
-    req->rsp_upiu.qr.idn = req->req_upiu.qr.idn;
-    req->rsp_upiu.qr.index = req->req_upiu.qr.index;
-    req->rsp_upiu.qr.selector = req->req_upiu.qr.selector;
     req->rsp_upiu.qr.length = cpu_to_be16(length);
 
     return status;
@@ -1411,6 +1415,7 @@ static UfsReqResult ufs_exec_query_cmd(UfsRequest *req)
     data_segment_length = be16_to_cpu(req->rsp_upiu.qr.length);
     ufs_build_upiu_header(req, UFS_UPIU_TRANSACTION_QUERY_RSP, 0, status, 0,
                           data_segment_length);
+    ufs_build_query_response(req);
 
     if (status != UFS_QUERY_RESULT_SUCCESS) {
         return UFS_REQUEST_FAIL;
diff --git a/hw/ufs/ufs.h b/hw/ufs/ufs.h
index 6c9382cbc4..4bcc41f53a 100644
--- a/hw/ufs/ufs.h
+++ b/hw/ufs/ufs.h
@@ -228,6 +228,7 @@ static inline bool is_wlun(uint8_t lun)
 void ufs_build_upiu_header(UfsRequest *req, uint8_t trans_type, uint8_t flags,
                            uint8_t response, uint8_t scsi_status,
                            uint16_t data_segment_length);
+void ufs_build_query_response(UfsRequest *req);
 void ufs_complete_req(UfsRequest *req, UfsReqResult req_result);
 void ufs_init_wlu(UfsLu *wlu, uint8_t wlun);
 #endif /* HW_UFS_UFS_H */
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] hw/ufs: add basic info of query response upiu
  2024-08-02  5:19 ` [PATCH] hw/ufs: add basic info of query response upiu Kyoungrul Kim
@ 2024-08-04  0:44   ` Minwoo Im
  2024-08-06  0:24     ` Jeuk Kim
  0 siblings, 1 reply; 3+ messages in thread
From: Minwoo Im @ 2024-08-04  0:44 UTC (permalink / raw)
  To: Kyoungrul Kim; +Cc: Jeuk Kim, qemu-devel@nongnu.org, SSDR Gost Dev, minwoo.im

[-- Attachment #1: Type: text/plain, Size: 312 bytes --]

On 08/02, Kyoungrul Kim wrote:
> Modify to fill the opcode, idn, index, selector information of
> all Query Response UPIU. because attr and flag operation of query
> response upiu need these information too.
> 
> Signed-off-by: KyoungrulKim <k831.kim@samsung.com>

Reviewed-by: Minwoo Im <minwoo.im@samsung.com>

[-- Attachment #2: Type: text/plain, Size: 0 bytes --]



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] hw/ufs: add basic info of query response upiu
  2024-08-04  0:44   ` Minwoo Im
@ 2024-08-06  0:24     ` Jeuk Kim
  0 siblings, 0 replies; 3+ messages in thread
From: Jeuk Kim @ 2024-08-06  0:24 UTC (permalink / raw)
  To: Minwoo Im, Kyoungrul Kim; +Cc: Jeuk Kim, qemu-devel@nongnu.org, SSDR Gost Dev

On 8/4/2024 9:44 AM, Minwoo Im wrote:
> On 08/02, Kyoungrul Kim wrote:
>> Modify to fill the opcode, idn, index, selector information of
>> all Query Response UPIU. because attr and flag operation of query
>> response upiu need these information too.
>>
>> Signed-off-by: KyoungrulKim <k831.kim@samsung.com>
> Reviewed-by: Minwoo Im <minwoo.im@samsung.com>
>

Thank you for your contribution.


Reviewed-by:Jeuk Kim <jeuk20.kim@samsung.com>



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2024-08-06  0:25 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <CGME20240802051902epcms2p319bc095a15eaef8de4e6955f6718371d@epcms2p3>
2024-08-02  5:19 ` [PATCH] hw/ufs: add basic info of query response upiu Kyoungrul Kim
2024-08-04  0:44   ` Minwoo Im
2024-08-06  0:24     ` Jeuk Kim

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).