1
0
mirror of https://github.com/djhackersdev/bemanitools.git synced 2025-02-21 04:48:42 +01:00

aciodrv: add method to get product type of node

some devices share product codes (KFCA->RVOL), we really should be using type to differentiate them.
This commit is contained in:
Will Xyen 2021-09-12 19:07:26 -07:00 committed by 6fe20d9b80a9661a09ef66dfd58832d49592386b
parent 3acbc7f251
commit d3bf381a4f
2 changed files with 19 additions and 0 deletions

View File

@ -300,6 +300,7 @@ static bool aciodrv_device_get_version(struct aciodrv_device_ctx *device, uint8_
msg.cmd.version.time);
memcpy(version->product, msg.cmd.version.product_code, ACIO_NODE_PRODUCT_CODE_LEN);
version->type = ac_io_u32(msg.cmd.version.type);
version->major = msg.cmd.version.major;
version->minor = msg.cmd.version.minor;
version->revision = msg.cmd.version.revision;
@ -392,6 +393,14 @@ bool aciodrv_device_get_node_product_ident(struct aciodrv_device_ctx *device, ui
memcpy(product, device->node_versions[node_id].product, ACIO_NODE_PRODUCT_CODE_LEN);
return true;
}
uint32_t aciodrv_device_get_node_product_type(struct aciodrv_device_ctx *device, uint8_t node_id)
{
if (device->node_count == 0 || node_id > device->node_count) {
return 0;
}
return device->node_versions[node_id].type;
}
const struct aciodrv_device_node_version *aciodrv_device_get_node_product_version(struct aciodrv_device_ctx *device, uint8_t node_id)
{

View File

@ -13,6 +13,7 @@ struct aciodrv_device_ctx;
struct aciodrv_device_node_version {
char product[ACIO_NODE_PRODUCT_CODE_LEN];
uint32_t type;
uint8_t major;
uint8_t minor;
uint8_t revision;
@ -52,6 +53,15 @@ uint8_t aciodrv_device_get_node_count(struct aciodrv_device_ctx *device);
*/
bool aciodrv_device_get_node_product_ident(struct aciodrv_device_ctx *device, uint8_t node_id, char product[ACIO_NODE_PRODUCT_CODE_LEN]);
/**
* Get the product identifier of an enumerated node.
*
* @param device Context of opened device
* @param node_id Id of the node. Needs to be in range of the total node count.
* @return product type ID on success, or 0 on failure
*/
uint32_t aciodrv_device_get_node_product_type(struct aciodrv_device_ctx *device, uint8_t node_id);
/**
* Get the product version of an enumerated node.
*