The Discovery Controller Type (dctype) is a new attribute defined
in TP8010. This new attribute, as well as the existing Controller
Type (cntrltype) attributes will now be exposed through the sysfs
starting with kernel 5.18. For older kernels, the cntrltype and
dctype must be retrieved by performing a Identify command.
Signed-off-by: Martin Belanger <martin.belanger@dell.com>
[dwagner: Removed nvme_fetch_cntrltype_dctype_from_id]
Signed-off-by: Daniel Wagner <dwagner@suse.de>
char *traddr;
char *trsvcid;
char *dhchap_key;
+ char *cntrltype;
+ char *dctype;
bool discovery_ctrl;
bool discovered;
bool persistent;
FREE_CTRL_ATTR(c->serial);
FREE_CTRL_ATTR(c->sqsize);
FREE_CTRL_ATTR(c->address);
+ FREE_CTRL_ATTR(c->dctype);
+ FREE_CTRL_ATTR(c->cntrltype);
}
int nvme_disconnect_ctrl(nvme_ctrl_t c)
free(c->dhchap_key);
c->dhchap_key = NULL;
}
+ c->cntrltype = nvme_get_ctrl_attr(c, "cntrltype");
+ c->dctype = nvme_get_ctrl_attr(c, "dctype");
+
return 0;
}