Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1FEzFj-0001aH-Lu for qemu-devel@nongnu.org; Thu, 02 Mar 2006 20:38:43 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1FDQCz-0002OM-4L for qemu-devel@nongnu.org; Sun, 26 Feb 2006 13:01:45 -0500 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1FDQCr-0002Lh-Er for qemu-devel@nongnu.org; Sun, 26 Feb 2006 13:01:17 -0500 Received: from [209.191.85.65] (helo=web36814.mail.mud.yahoo.com) by monty-python.gnu.org with smtp (Exim 4.52) id 1FDQDN-0000DA-KG for qemu-devel@nongnu.org; Sun, 26 Feb 2006 13:01:49 -0500 Message-ID: <20060226180110.89640.qmail@web36814.mail.mud.yahoo.com> Date: Sun, 26 Feb 2006 10:01:09 -0800 (PST) From: Umamaheswararao Karyampudi MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="0-699816622-1140976869=:89433" Content-Transfer-Encoding: 8bit Subject: [Qemu-devel] Printing bogus values in ne2000_asic_ioport_read()/ ne2000_receive() Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org --0-699816622-1140976869=:89433 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Hi, I am using QEMU in one of my research projects. I landed in a problem where I see bogus numbers being printed when I printed the packet/each word that is received from ne2000. In ne2000_receive(), I copied the packet received to a static char [] and printed the packet using static void print_packet(char *s, int len) { int i,j; for (i=0;i instead of just the last byte. For eg: 52 54 00 12 34 56 00 ffffffff 4f 0a 46 05 08 00 45 00 00 ffffff80 00 00 40 00 40 01 ffffffbc 2b ffffffc0 ffffffa8 fffffffe fffffffe ffffffc0 ffffffa8 ff Similarly in ne2000_asic_ioport_read(), I print each word that is read from NetDriverState.s->mem using the following - printf("\n %02x %02x", (char)(ret &0xff), (char) ( (ret >> 8) && 0xff)); And occasionally I see the 4 bytes printed instead of 1 byte for each value. Any reason why it happens? Also, ne2000_asic_ioport_read(), reads 6 bytes before reading actual packet? I can think of 4 bytes for CRC but not for the remaining 2 bytes - eg - If pak is - 52 54 00 12 34 56 00 ffffffff 4f 0a 46 05 08 00 45 00 00 ffffff80 00 00 40 00 40 01 ffffffbc 2b In asic_ioport_read() - rdw 01 59 rdw 92 00 rdw 52 54 rdw 52 54 rdw 00 12 rdw 34 56 Anyhelp is greatly appreciated. Thanks Uma __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com --0-699816622-1140976869=:89433 Content-Type: text/html; charset=iso-8859-1 Content-Transfer-Encoding: 8bit
Hi,
I am using QEMU in one of my research projects. I
landed in a problem where I see bogus numbers being
printed when I printed the packet/each word that is
received from ne2000.

In ne2000_receive(), I copied the packet received to a
static char [] and printed the packet using
static void print_packet(char *s, int len)
{
int i,j;
for (i=0;i<len;i++) {
if (i%20 == 0)
printf("\n");
printf("%02x ", s[i]);
}
printf("\n");
}
And some bytes it prints as fffffffff<last byte>
instead of just the last byte.
For eg:
52 54 00 12 34 56 00 ffffffff 4f 0a 46 05 08 00 45 00
00 ffffff80 00 00
40 00 40 01 ffffffbc 2b ffffffc0 ffffffa8 fffffffe
fffffffe ffffffc0 ffffffa8 ff

Similarly in ne2000_asic_ioport_read(), I print each
word that is read from NetDriverState.s->mem using the
following -
printf("\n %02x %02x", (char)(ret &0xff), (char) (
(ret >> 8) && 0xff));
And occasionally I see the 4 bytes printed instead of
1 byte for each value.

Any reason why it happens? Also,
ne2000_asic_ioport_read(), reads 6 bytes before
reading actual packet? I can think of 4 bytes for CRC
but not for the remaining 2 bytes - eg - If pak is -
52 54 00 12 34 56 00 ffffffff 4f 0a 46 05 08 00 45 00
00 ffffff80 00 00
40 00 40 01 ffffffbc 2b
In asic_ioport_read() -
rdw 01 59
rdw 92 00
rdw 52 54
rdw 52 54
rdw 00 12
rdw 34 56

Anyhelp is greatly appreciated.

Thanks
Uma

__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com --0-699816622-1140976869=:89433--