Thread (24 messages) 24 messages, 4 authors, 2025-09-03

Re: [PATCH net-next v9 4/5] net: rnpgbe: Add basic mbx_fw support

From: Andrew Lunn <andrew@lunn.ch>
Date: 2025-09-03 00:55:38
Also in: linux-doc, linux-hardening, lkml

static int mucse_mbx_get_info(struct mucse_hw *hw)
{
        struct mbx_fw_cmd_reply reply = {};
        struct mbx_fw_cmd_req req = {};
        struct hw_info info = {};
        int err;

        build_get_fw_info_req(&req);
        err = mucse_fw_send_cmd_wait(hw, &req, &reply);
        if (!err) {
                memcpy(&info, &reply.hw_info, sizeof(struct hw_info));
                hw->pfvfnum = le16_to_cpu(info.pfnum) & GENMASK_U16(7, 0);
        }

        return err;
}

/**
 * mucse_mbx_sync_fw - Try to sync with fw
 * @hw: pointer to the HW structure
 *
 * mucse_mbx_sync_fw tries get sync to fw hw.
 * It is only called in probe
 *
 * Return: 0 on success, negative errno on failure
 **/
int mucse_mbx_sync_fw(struct mucse_hw *hw)
{
        int try_cnt = 3;
        int err;

        do {
                err = mucse_mbx_get_info(hw);
                if (err == -ETIMEDOUT)
                        continue;
                break;
        } while (try_cnt--);

        return err;
}
This looks O.K.

     Andrew
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help