ionic_dev_cmd_comp(struct ionic_dev *idev, void *mem)
{
union ionic_dev_cmd_comp *comp = mem;
- unsigned int i;
- uint32_t comp_size = sizeof(comp->words) /
- sizeof(comp->words[0]);
+ uint32_t comp_size = RTE_DIM(comp->words);
+ uint32_t i;
for (i = 0; i < comp_size; i++)
comp->words[i] = ioread32(&idev->dev_cmd->comp.words[i]);
void
ionic_dev_cmd_go(struct ionic_dev *idev, union ionic_dev_cmd *cmd)
{
- unsigned int i;
- uint32_t cmd_size = sizeof(cmd->words) /
- sizeof(cmd->words[0]);
+ uint32_t cmd_size = RTE_DIM(cmd->words);
+ uint32_t i;
IONIC_PRINT(DEBUG, "Sending %s (%d) via dev_cmd",
ionic_opcode_to_str(cmd->cmd.opcode), cmd->cmd.opcode);
struct ionic_dev *idev = &adapter->idev;
struct ionic_identity *ident = &adapter->ident;
union ionic_lif_config *cfg = &ident->lif.eth.config;
+ uint32_t lif_words = RTE_DIM(ident->lif.words);
+ uint32_t cmd_words = RTE_DIM(idev->dev_cmd->data);
+ uint32_t i, nwords;
int err;
- unsigned int i;
- unsigned int lif_words = sizeof(ident->lif.words) /
- sizeof(ident->lif.words[0]);
- unsigned int cmd_words = sizeof(idev->dev_cmd->data) /
- sizeof(idev->dev_cmd->data[0]);
- unsigned int nwords;
ionic_dev_cmd_lif_identify(idev, IONIC_LIF_TYPE_CLASSIC,
IONIC_IDENTITY_VERSION_1);
{
struct ionic_dev *idev = &adapter->idev;
struct ionic_identity *ident = &adapter->ident;
- int err = 0;
- uint32_t i;
- unsigned int nwords;
- uint32_t drv_size = sizeof(ident->drv.words) /
- sizeof(ident->drv.words[0]);
- uint32_t cmd_size = sizeof(idev->dev_cmd->data) /
- sizeof(idev->dev_cmd->data[0]);
- uint32_t dev_size = sizeof(ident->dev.words) /
- sizeof(ident->dev.words[0]);
+ uint32_t drv_size = RTE_DIM(ident->drv.words);
+ uint32_t cmd_size = RTE_DIM(idev->dev_cmd->data);
+ uint32_t dev_size = RTE_DIM(ident->dev.words);
+ uint32_t i, nwords;
+ int err;
memset(ident, 0, sizeof(*ident));
{
struct ionic_dev *idev = &adapter->idev;
struct ionic_identity *ident = &adapter->ident;
- unsigned int port_words = sizeof(ident->port.words) /
- sizeof(ident->port.words[0]);
- unsigned int cmd_words = sizeof(idev->dev_cmd->data) /
- sizeof(idev->dev_cmd->data[0]);
- unsigned int i;
- unsigned int nwords;
+ uint32_t port_words = RTE_DIM(ident->port.words);
+ uint32_t cmd_words = RTE_DIM(idev->dev_cmd->data);
+ uint32_t i, nwords;
int err;
ionic_dev_cmd_port_identify(idev);
struct ionic_dev *idev = &adapter->idev;
struct ionic_identity *ident = &adapter->ident;
char z_name[RTE_MEMZONE_NAMESIZE];
- unsigned int config_words = sizeof(ident->port.config.words) /
- sizeof(ident->port.config.words[0]);
- unsigned int cmd_words = sizeof(idev->dev_cmd->data) /
- sizeof(idev->dev_cmd->data[0]);
- unsigned int nwords;
- unsigned int i;
+ uint32_t config_words = RTE_DIM(ident->port.config.words);
+ uint32_t cmd_words = RTE_DIM(idev->dev_cmd->data);
+ uint32_t i, nwords;
int err;
if (idev->port_info)