qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Anthony Liguori <anthony@codemonkey.ws>
To: Matthew Iselin <matthew@theiselins.net>
Cc: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [RFC] [PATCH] 3C90X Emulation
Date: Sat, 11 Jul 2009 09:10:46 -0500	[thread overview]
Message-ID: <4A589D66.6070007@codemonkey.ws> (raw)
In-Reply-To: <1247320357-7928-1-git-send-email-matthew@theiselins.net>

Matthew Iselin wrote:
> This patch adds a basic 3C90X emulation to QEMU.
>
> I have tested this with Linux kernels 2.4 and 2.6 (DSL and Ubuntu), and
> Pedigree.
>
> This has been ported from the PearPC 3C90X emulation, with significant
> modifications to enable it to work on 2.6 kernels.
>
> Signed-off-by: Matthew Iselin <matthew@theiselins.net>
> ---
>  Makefile.target |    1 +
>  hw/3c90x.c      | 2421 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
>  hw/pci.c        |    2 +
>  hw/pci_ids.h    |    3 +
>  4 files changed, 2427 insertions(+), 0 deletions(-)
>  create mode 100644 hw/3c90x.c
>
> diff --git a/Makefile.target b/Makefile.target
> index 1a71f3a..9f3dd58 100644
> --- a/Makefile.target
> +++ b/Makefile.target
> @@ -556,6 +556,7 @@ obj-y += eepro100.o
>  obj-y += ne2000.o
>  obj-y += pcnet.o
>  obj-y += rtl8139.o
> +obj-y += 3c90x.o
>  obj-y += e1000.o
>  
>  # Generic watchdog support and some watchdog devices
> diff --git a/hw/3c90x.c b/hw/3c90x.c
> new file mode 100644
> index 0000000..dc242dc
> --- /dev/null
> +++ b/hw/3c90x.c
> @@ -0,0 +1,2421 @@
> +/**
> + * QEMU 3C90X Emulation
> + *
> + * Copyright (c) 2009 Matthew Iselin (QEMU VERSION)
> + * Copyright (C) 2004 John Kelley (pearpc@kelley.ca) (PEARPC VERSION)
> + * Copyright (C) 2003 Stefan Weyergraf (PEARPC VERSION)
> + *
> + * Permission is hereby granted, free of charge, to any person obtaining a copy
> + * of this software and associated documentation files (the "Software"), to deal
> + * in the Software without restriction, including without limitation the rights
> + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
> + * copies of the Software, and to permit persons to whom the Software is
> + * furnished to do so, subject to the following conditions:
> + *
> + * The above copyright notice and this permission notice shall be included in
> + * all copies or substantial portions of the Software.
> + *
> + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
> + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
> + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
> + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
> + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
> + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
> + * THE SOFTWARE.
> +
> + * Modifications:
> + *  (none)
> + */
> +
> +/**
> + * TODO:
> + *  - Still a lot of unimplemented functionality
> + *  - savevm functions
> + * TESTED ON:
> + *  - Damn Small Linux (4.4.10) - Linux 2.4
> + *  - Damn Small Linux N - Linux 2.6
> + *  - Ubuntu (8.10, 5.10)
> + *  - Pedigree
> + */
> +
> +#include "hw.h"
> +#include "pci.h"
> +#include "pc.h"
> +#include "qemu-timer.h"
> +#include "net.h"
> +
> +// Should we inspect incoming frames and print extra debugging information about them?
> +//#define DEBUG_3C90X_ANALYSE_FRAMES          0
> +
> +#ifdef DEBUG_3C90X_ANALYSE_FRAMES
> +#define __FAVOR_BSD
> +#include <netinet/ip.h>
> +#include <netinet/tcp.h>
> +#include <netinet/udp.h>
> +#endif
> +
> +#define PACKED      __attribute__((packed));
> +#define ALIGNED     __attribute__((aligned));
> +#define PACKED8     __attribute__((aligned(8)));
> +#define PACKED16    __attribute__((aligned(16)));
> +#define PACKED32    __attribute__((aligned(32)));
> +
>   
Besides being poorly formatted, the PACKED structures is a good 
indicator that this file is not endian safe and it doesn't appear to be.

It needs some refactoring to make it work for qemu I think.

Regards,

Anthony Liguori

  reply	other threads:[~2009-07-11 14:10 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-07-11 13:52 [Qemu-devel] [RFC] [PATCH] 3C90X Emulation Matthew Iselin
2009-07-11 14:10 ` Anthony Liguori [this message]
2009-07-19 19:10 ` [Qemu-devel] " Sebastian Herbszt

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=4A589D66.6070007@codemonkey.ws \
    --to=anthony@codemonkey.ws \
    --cc=matthew@theiselins.net \
    --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).