Received: from eggs.gnu.org ([2001:4830:134:3::10]:33323) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Yzk0l-0001zx-8D for qemu-devel@nongnu.org; Tue, 02 Jun 2015 07:05:36 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Yzk0k-0006gs-3l for qemu-devel@nongnu.org; Tue, 02 Jun 2015 07:05:35 -0400 Received: from hall.aurel32.net ([2001:bc8:30d7:101::1]:59837) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Yzk0j-0006ge-VB for qemu-devel@nongnu.org; Tue, 02 Jun 2015 07:05:34 -0400 Date: Tue, 2 Jun 2015 13:05:33 +0200 From: Aurelien Jarno Message-ID: <20150602110533.GP26298@aurel32.net> References: <1432729200-5322-1-git-send-email-hpoussin@reactos.org> <1432729200-5322-17-git-send-email-hpoussin@reactos.org> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable In-Reply-To: <1432729200-5322-17-git-send-email-hpoussin@reactos.org> Sender: Aurelien Jarno Subject: Re: [Qemu-devel] [PATCH v2 16/17] net/dp8393x: repair can_receive() method List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: =?iso-8859-15?Q?Herv=E9?= Poussineau Cc: Leon Alrae , qemu-devel@nongnu.org On 2015-05-27 14:19, Herv=E9 Poussineau wrote: > Datasheet clearly says that RXDIS flag prevents reception, but says > nothing about a required presence of RXEN flag. >=20 > While at it, fix the style of the following if statement. >=20 > Signed-off-by: Herv=E9 Poussineau > --- > hw/net/dp8393x.c | 6 ++++-- > 1 file changed, 4 insertions(+), 2 deletions(-) >=20 > diff --git a/hw/net/dp8393x.c b/hw/net/dp8393x.c > index 95a4d3d..b81036a 100644 > --- a/hw/net/dp8393x.c > +++ b/hw/net/dp8393x.c > @@ -622,10 +622,12 @@ static int dp8393x_can_receive(NetClientState *nc) > { > dp8393xState *s =3D qemu_get_nic_opaque(nc); > =20 > - if (!(s->regs[SONIC_CR] & SONIC_CR_RXEN)) > + if (s->regs[SONIC_CR] & SONIC_CR_RXDIS) { > return 0; > - if (s->regs[SONIC_ISR] & SONIC_ISR_RBE) > + } > + if (s->regs[SONIC_ISR] & SONIC_ISR_RBE) { > return 0; > + } > return 1; > } I don't have the datasheet at hand, but what would be the point of such a RXEN flag if it is ignored? Are you sure it's not because it's enabled by default? --=20 Aurelien Jarno GPG: 4096R/1DDD8C9B aurelien@aurel32.net http://www.aurel32.net