@@ -89,6 +89,7 @@ static void nvmet_execute_get_supported_log_pages(struct nvmet_req *req)
89
89
logs -> lids [NVME_LOG_CHANGED_NS ] = cpu_to_le32 (NVME_LIDS_LSUPP );
90
90
logs -> lids [NVME_LOG_CMD_EFFECTS ] = cpu_to_le32 (NVME_LIDS_LSUPP );
91
91
logs -> lids [NVME_LOG_ANA ] = cpu_to_le32 (NVME_LIDS_LSUPP );
92
+ logs -> lids [NVME_LOG_FEATURES ] = cpu_to_le32 (NVME_LIDS_LSUPP );
92
93
logs -> lids [NVME_LOG_RESERVATION ] = cpu_to_le32 (NVME_LIDS_LSUPP );
93
94
94
95
status = nvmet_copy_to_sgl (req , 0 , logs , sizeof (* logs ));
@@ -347,6 +348,36 @@ static void nvmet_execute_get_log_page_ana(struct nvmet_req *req)
347
348
nvmet_req_complete (req , status );
348
349
}
349
350
351
+ static void nvmet_execute_get_log_page_features (struct nvmet_req * req )
352
+ {
353
+ struct nvme_supported_features_log * features ;
354
+ u16 status ;
355
+
356
+ features = kzalloc (sizeof (* features ), GFP_KERNEL );
357
+ if (!features ) {
358
+ status = NVME_SC_INTERNAL ;
359
+ goto out ;
360
+ }
361
+
362
+ features -> fis [NVME_FEAT_NUM_QUEUES ] =
363
+ cpu_to_le32 (NVME_FIS_FSUPP | NVME_FIS_CSCPE );
364
+ features -> fis [NVME_FEAT_KATO ] =
365
+ cpu_to_le32 (NVME_FIS_FSUPP | NVME_FIS_CSCPE );
366
+ features -> fis [NVME_FEAT_ASYNC_EVENT ] =
367
+ cpu_to_le32 (NVME_FIS_FSUPP | NVME_FIS_CSCPE );
368
+ features -> fis [NVME_FEAT_HOST_ID ] =
369
+ cpu_to_le32 (NVME_FIS_FSUPP | NVME_FIS_CSCPE );
370
+ features -> fis [NVME_FEAT_WRITE_PROTECT ] =
371
+ cpu_to_le32 (NVME_FIS_FSUPP | NVME_FIS_NSCPE );
372
+ features -> fis [NVME_FEAT_RESV_MASK ] =
373
+ cpu_to_le32 (NVME_FIS_FSUPP | NVME_FIS_NSCPE );
374
+
375
+ status = nvmet_copy_to_sgl (req , 0 , features , sizeof (* features ));
376
+ kfree (features );
377
+ out :
378
+ nvmet_req_complete (req , status );
379
+ }
380
+
350
381
static void nvmet_execute_get_log_page (struct nvmet_req * req )
351
382
{
352
383
if (!nvmet_check_transfer_len (req , nvmet_get_log_page_len (req -> cmd )))
@@ -372,6 +403,8 @@ static void nvmet_execute_get_log_page(struct nvmet_req *req)
372
403
return nvmet_execute_get_log_cmd_effects_ns (req );
373
404
case NVME_LOG_ANA :
374
405
return nvmet_execute_get_log_page_ana (req );
406
+ case NVME_LOG_FEATURES :
407
+ return nvmet_execute_get_log_page_features (req );
375
408
case NVME_LOG_RESERVATION :
376
409
return nvmet_execute_get_log_page_resv (req );
377
410
}
0 commit comments