qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Joseph Stewart" <joseph.stewart@gmail.com>
To: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] Printing bogus values in ne2000_asic_ioport_read()/ ne2000_receive()
Date: Wed, 1 Mar 2006 13:47:08 -0500	[thread overview]
Message-ID: <2781f020603011047y28d9d611l6e04d88b8ff03387@mail.gmail.com> (raw)
In-Reply-To: <20060225182908.21386.qmail@web36810.mail.mud.yahoo.com>

[-- Attachment #1: Type: text/plain, Size: 2139 bytes --]

Change the function argument from signed to unsigned and see it printf
handles prints the values correctly. I.E.

static void print_packet(unsigned char *s, int len) ...

-joe

On 2/25/06, Umamaheswararao Karyampudi <kumrao2003@yahoo.com> wrote:
>
> 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
>
>
> _______________________________________________
> Qemu-devel mailing list
> Qemu-devel@nongnu.org
> http://lists.nongnu.org/mailman/listinfo/qemu-devel
>

[-- Attachment #2: Type: text/html, Size: 2871 bytes --]

  reply	other threads:[~2006-03-04 17:19 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-02-25 18:29 [Qemu-devel] Printing bogus values in ne2000_asic_ioport_read()/ ne2000_receive() Umamaheswararao Karyampudi
2006-03-01 18:47 ` Joseph Stewart [this message]
2006-03-01 23:22 ` Chris Wilson
2006-03-02 10:40 ` Alessandro Iurlano
  -- strict thread matches above, loose matches on Subject: below --
2006-03-01 10:06 carlo.andreoli
2006-03-03 22:33 ` Umamaheswararao Karyampudi
2006-02-26 18:01 Umamaheswararao Karyampudi
2006-03-03 19:28 ` Brian Wheeler
2006-02-25  4:13 Umamaheswararao Karyampudi

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=2781f020603011047y28d9d611l6e04d88b8ff03387@mail.gmail.com \
    --to=joseph.stewart@gmail.com \
    --cc=qemu-devel@nongnu.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).