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

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

 



> +/**
> + * mucse_mbx_powerup - Echo fw to powerup
> + * @hw: pointer to the HW structure
> + * @is_powerup: true for powerup, false for powerdown
> + *
> + * mucse_mbx_powerup echo fw to change working frequency
> + * to normal after received true, and reduce working frequency
> + * if false.
> + *
> + * Return: 0 on success, negative errno on failure
> + **/
> +int mucse_mbx_powerup(struct mucse_hw *hw, bool is_powerup)
> +{
> +	struct mbx_fw_cmd_req req = {};
> +	int len;
> +	int err;
> +
> +	build_powerup(&req, is_powerup);
> +	len = le16_to_cpu(req.datalen);
> +	mutex_lock(&hw->mbx.lock);
> +
> +	if (is_powerup) {
> +		err = mucse_write_posted_mbx(hw, (u32 *)&req,
> +					     len);
> +	} else {
> +		err = mucse_write_mbx_pf(hw, (u32 *)&req,
> +					 len);
> +	}

It looks odd that this is asymmetric. Why is a different low level
function used between power up and power down?

> +int mucse_mbx_reset_hw(struct mucse_hw *hw)
> +{
> +	struct mbx_fw_cmd_reply reply = {};
> +	struct mbx_fw_cmd_req req = {};
> +
> +	build_reset_hw_req(&req);
> +	return mucse_fw_send_cmd_wait(hw, &req, &reply);
> +}

And this uses a third low level API different to power up and power
down?

	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