All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrew Lunn <andrew@lunn.ch>
To: Igor Russkikh <igor.russkikh@aquantia.com>
Cc: "David S . Miller" <davem@davemloft.net>,
	netdev@vger.kernel.org, Yana Esina <yana.esina@aquantia.com>,
	Nikita Danilov <nikita.danilov@aquantia.com>
Subject: Re: [PATCH net-next 3/5] net: aquantia: implement WOL support
Date: Wed, 8 Aug 2018 14:16:05 +0200	[thread overview]
Message-ID: <20180808121605.GD18314@lunn.ch> (raw)
In-Reply-To: <4b6c2d73c19dac481fbf2656f7a24da90966130b.1533650064.git.igor.russkikh@aquantia.com>

> --- a/drivers/net/ethernet/aquantia/atlantic/aq_nic.c
> +++ b/drivers/net/ethernet/aquantia/atlantic/aq_nic.c
> @@ -889,11 +889,13 @@ void aq_nic_deinit(struct aq_nic_s *self)
>  		self->aq_vecs > i; ++i, aq_vec = self->aq_vec[i])
>  		aq_vec_deinit(aq_vec);
>  
> -	if (self->power_state == AQ_HW_POWER_STATE_D0) {
> -		(void)self->aq_fw_ops->deinit(self->aq_hw);
> -	} else {
> -		(void)self->aq_hw_ops->hw_set_power(self->aq_hw,
> -						   self->power_state);
> +	(void)self->aq_fw_ops->deinit(self->aq_hw);

These void casts look a bit ugly. Are they needed? Is the compiler
complaining? If it is complaining, it suggests you should not be
casting anyway...

> +	if (wol_enabled) {
> +		rpc_size = sizeof(prpc->msg_id) + sizeof(prpc->msg_wol);
> +
> +		prpc->msg_id = HAL_ATLANTIC_UTILS_FW_MSG_WOL_ADD;
> +		prpc->msg_wol.priority = 0x10000000; /* normal priority */
> +		prpc->msg_wol.pattern_id = 1U;
> +		prpc->msg_wol.wol_packet_type = 2U; /* Magic Packet */

Maybe add #defines for these magic numbers?

> +
> +		ether_addr_copy((u8 *)&prpc->msg_wol.wol_pattern, mac);
> +	} else {
> +		rpc_size = sizeof(prpc->msg_id) + sizeof(prpc->msg_del_id);
> +
> +		prpc->msg_id = HAL_ATLANTIC_UTILS_FW_MSG_WOL_DEL;
> +		prpc->msg_wol.pattern_id = 1U;
> +	}
> +
> +	err = hw_atl_utils_fw_rpc_call(self, rpc_size);
> +
> +err_exit:
> +	return err;
> +}

  Andrew

  reply	other threads:[~2018-08-08 14:35 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-08-08 10:57 [PATCH net-next 0/5] net: aquantia: implement WOL and EEE support Igor Russkikh
2018-08-08 10:57 ` [PATCH net-next 1/5] net: aquantia: fix hw_atl_utils_fw_upload_dwords Igor Russkikh
2018-08-08 12:03   ` Andrew Lunn
2018-08-08 10:57 ` [PATCH net-next 2/5] net: aquantia: definitions for WOL patch Igor Russkikh
2018-08-08 12:06   ` Andrew Lunn
2018-08-08 10:57 ` [PATCH net-next 3/5] net: aquantia: implement WOL support Igor Russkikh
2018-08-08 12:16   ` Andrew Lunn [this message]
2018-08-08 10:57 ` [PATCH net-next 4/5] net: aquantia: implement EEE support Igor Russkikh
2018-08-08 12:27   ` Andrew Lunn
2018-08-08 10:57 ` [PATCH net-next 5/5] net: aquantia: bump driver version Igor Russkikh
2018-08-08 12:32   ` Andrew Lunn
2018-08-09 10:10     ` Igor Russkikh
2018-08-09 19:20       ` Jakub Kicinski
2018-08-12  7:53         ` Igor Russkikh

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180808121605.GD18314@lunn.ch \
    --to=andrew@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=igor.russkikh@aquantia.com \
    --cc=netdev@vger.kernel.org \
    --cc=nikita.danilov@aquantia.com \
    --cc=yana.esina@aquantia.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.