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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> 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




[Index of Archives]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Linux FS]     [Yosemite Forum]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]     [Linux Resources]

  Powered by Linux