Lines Matching refs:id
354 struct nvme_id_ctrl *id; in nvmet_execute_identify_ctrl() local
364 id = kzalloc(sizeof(*id), GFP_KERNEL); in nvmet_execute_identify_ctrl()
365 if (!id) { in nvmet_execute_identify_ctrl()
371 id->vid = 0; in nvmet_execute_identify_ctrl()
372 id->ssvid = 0; in nvmet_execute_identify_ctrl()
374 memcpy(id->sn, ctrl->subsys->serial, NVMET_SN_MAX_SIZE); in nvmet_execute_identify_ctrl()
375 memcpy_and_pad(id->mn, sizeof(id->mn), subsys->model_number, in nvmet_execute_identify_ctrl()
377 memcpy_and_pad(id->fr, sizeof(id->fr), in nvmet_execute_identify_ctrl()
380 put_unaligned_le24(subsys->ieee_oui, id->ieee); in nvmet_execute_identify_ctrl()
382 id->rab = 6; in nvmet_execute_identify_ctrl()
385 id->cntrltype = NVME_CTRL_DISC; in nvmet_execute_identify_ctrl()
387 id->cntrltype = NVME_CTRL_IO; in nvmet_execute_identify_ctrl()
390 id->cmic = NVME_CTRL_CMIC_MULTI_PORT | NVME_CTRL_CMIC_MULTI_CTRL | in nvmet_execute_identify_ctrl()
395 id->mdts = ctrl->ops->get_mdts(ctrl); in nvmet_execute_identify_ctrl()
397 id->mdts = 0; in nvmet_execute_identify_ctrl()
399 id->cntlid = cpu_to_le16(ctrl->cntlid); in nvmet_execute_identify_ctrl()
400 id->ver = cpu_to_le32(ctrl->subsys->ver); in nvmet_execute_identify_ctrl()
403 id->oaes = cpu_to_le32(NVMET_AEN_CFG_OPTIONAL); in nvmet_execute_identify_ctrl()
404 id->ctratt = cpu_to_le32(NVME_CTRL_ATTR_HID_128_BIT | in nvmet_execute_identify_ctrl()
407 id->oacs = 0; in nvmet_execute_identify_ctrl()
414 id->acl = 3; in nvmet_execute_identify_ctrl()
416 id->aerl = NVMET_ASYNC_EVENTS - 1; in nvmet_execute_identify_ctrl()
419 id->frmw = (1 << 0) | (1 << 1); in nvmet_execute_identify_ctrl()
420 id->lpa = (1 << 0) | (1 << 1) | (1 << 2); in nvmet_execute_identify_ctrl()
421 id->elpe = NVMET_ERROR_LOG_SLOTS - 1; in nvmet_execute_identify_ctrl()
422 id->npss = 0; in nvmet_execute_identify_ctrl()
425 id->kas = cpu_to_le16(NVMET_KAS); in nvmet_execute_identify_ctrl()
427 id->sqes = (0x6 << 4) | 0x6; in nvmet_execute_identify_ctrl()
428 id->cqes = (0x4 << 4) | 0x4; in nvmet_execute_identify_ctrl()
431 id->maxcmd = cpu_to_le16(NVMET_MAX_CMD); in nvmet_execute_identify_ctrl()
433 id->nn = cpu_to_le32(NVMET_MAX_NAMESPACES); in nvmet_execute_identify_ctrl()
434 id->mnan = cpu_to_le32(NVMET_MAX_NAMESPACES); in nvmet_execute_identify_ctrl()
435 id->oncs = cpu_to_le16(NVME_CTRL_ONCS_DSM | in nvmet_execute_identify_ctrl()
439 id->vwc = NVME_CTRL_VWC_PRESENT; in nvmet_execute_identify_ctrl()
445 id->awun = 0; in nvmet_execute_identify_ctrl()
446 id->awupf = 0; in nvmet_execute_identify_ctrl()
448 id->sgls = cpu_to_le32(1 << 0); /* we always support SGLs */ in nvmet_execute_identify_ctrl()
450 id->sgls |= cpu_to_le32(1 << 2); in nvmet_execute_identify_ctrl()
452 id->sgls |= cpu_to_le32(1 << 20); in nvmet_execute_identify_ctrl()
454 strscpy(id->subnqn, ctrl->subsys->subsysnqn, sizeof(id->subnqn)); in nvmet_execute_identify_ctrl()
463 id->ioccsz = cpu_to_le32(cmd_capsule_size / 16); in nvmet_execute_identify_ctrl()
466 id->iorcsz = cpu_to_le32(sizeof(struct nvme_completion) / 16); in nvmet_execute_identify_ctrl()
468 id->msdbd = ctrl->ops->msdbd; in nvmet_execute_identify_ctrl()
470 id->anacap = (1 << 0) | (1 << 1) | (1 << 2) | (1 << 3) | (1 << 4); in nvmet_execute_identify_ctrl()
471 id->anatt = 10; /* random value */ in nvmet_execute_identify_ctrl()
472 id->anagrpmax = cpu_to_le32(NVMET_MAX_ANAGRPS); in nvmet_execute_identify_ctrl()
473 id->nanagrpid = cpu_to_le32(NVMET_MAX_ANAGRPS); in nvmet_execute_identify_ctrl()
479 id->psd[0].max_power = cpu_to_le16(0x9c4); in nvmet_execute_identify_ctrl()
480 id->psd[0].entry_lat = cpu_to_le32(0x10); in nvmet_execute_identify_ctrl()
481 id->psd[0].exit_lat = cpu_to_le32(0x4); in nvmet_execute_identify_ctrl()
483 id->nwpc = 1 << 0; /* write protect and no write protect */ in nvmet_execute_identify_ctrl()
485 status = nvmet_copy_to_sgl(req, 0, id, sizeof(*id)); in nvmet_execute_identify_ctrl()
487 kfree(id); in nvmet_execute_identify_ctrl()
494 struct nvme_id_ns *id; in nvmet_execute_identify_ns() local
503 id = kzalloc(sizeof(*id), GFP_KERNEL); in nvmet_execute_identify_ns()
504 if (!id) { in nvmet_execute_identify_ns()
526 id->ncap = id->nsze = in nvmet_execute_identify_ns()
533 id->nuse = id->nsze; in nvmet_execute_identify_ns()
538 nvmet_bdev_set_limits(req->ns->bdev, id); in nvmet_execute_identify_ns()
544 id->nlbaf = 0; in nvmet_execute_identify_ns()
545 id->flbas = 0; in nvmet_execute_identify_ns()
551 id->nmic = NVME_NS_NMIC_SHARED; in nvmet_execute_identify_ns()
552 id->anagrpid = cpu_to_le32(req->ns->anagrpid); in nvmet_execute_identify_ns()
554 memcpy(&id->nguid, &req->ns->nguid, sizeof(id->nguid)); in nvmet_execute_identify_ns()
556 id->lbaf[0].ds = req->ns->blksize_shift; in nvmet_execute_identify_ns()
559 id->dpc = NVME_NS_DPC_PI_FIRST | NVME_NS_DPC_PI_LAST | in nvmet_execute_identify_ns()
562 id->mc = NVME_MC_EXTENDED_LBA; in nvmet_execute_identify_ns()
563 id->dps = req->ns->pi_type; in nvmet_execute_identify_ns()
564 id->flbas = NVME_NS_FLBAS_META_EXT; in nvmet_execute_identify_ns()
565 id->lbaf[0].ms = cpu_to_le16(req->ns->metadata_size); in nvmet_execute_identify_ns()
569 id->nsattr |= NVME_NS_ATTR_RO; in nvmet_execute_identify_ns()
572 status = nvmet_copy_to_sgl(req, 0, id, sizeof(*id)); in nvmet_execute_identify_ns()
574 kfree(id); in nvmet_execute_identify_ns()
612 void *id, off_t *off) in nvmet_copy_ns_identifier() argument
625 status = nvmet_copy_to_sgl(req, *off, id, len); in nvmet_copy_ns_identifier()