[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Wed, 8 Aug 2018 14:16:05 +0200
From: Andrew Lunn <andrew@...n.ch>
To: Igor Russkikh <igor.russkikh@...antia.com>
Cc: "David S . Miller" <davem@...emloft.net>, netdev@...r.kernel.org,
Yana Esina <yana.esina@...antia.com>,
Nikita Danilov <nikita.danilov@...antia.com>
Subject: Re: [PATCH net-next 3/5] net: aquantia: implement WOL support
> --- 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
Powered by blists - more mailing lists