From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53577) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W4ZYf-00006C-P8 for qemu-devel@nongnu.org; Sat, 18 Jan 2014 12:19:46 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1W4ZYe-0002Pw-LU for qemu-devel@nongnu.org; Sat, 18 Jan 2014 12:19:45 -0500 Received: from mail-qe0-x229.google.com ([2607:f8b0:400d:c02::229]:39578) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W4ZYe-0002Ps-GF for qemu-devel@nongnu.org; Sat, 18 Jan 2014 12:19:44 -0500 Received: by mail-qe0-f41.google.com with SMTP id gc15so1827965qeb.0 for ; Sat, 18 Jan 2014 09:19:44 -0800 (PST) MIME-Version: 1.0 In-Reply-To: <20140116062921.GB14680@stefanha-thinkpad> References: <20140116062921.GB14680@stefanha-thinkpad> Date: Sat, 18 Jan 2014 09:19:43 -0800 Message-ID: From: rajan pathak Content-Type: multipart/alternative; boundary=001a11c1707e57b91f04f041dd04 Subject: Re: [Qemu-devel] Simulate different network card vendors List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Stefan Hajnoczi Cc: qemu-devel@nongnu.org --001a11c1707e57b91f04f041dd04 Content-Type: text/plain; charset=ISO-8859-1 Thanks Stefan for your kind response. I am OK with C programming and wrote couple of LKM related to FPGA device. But my understanding of QEMU is very limited. Let me ask some specific question on what I wanted to do. I am looking forward to emulate single-chip Ethernet controller. I can find some of its source code online and it has two main part Ethernet PHY (any 1GB SGMII compatible) and Ethernet MAC . So ,DO I need to simply put the corresponding source files of PHY and MAC in hw/net directory of QEMU? Also ,do I need to take care of underlying Ethernet controller(of my machine where I am trying to do this) from Broadcom in any way? Thanks Rajan On Wed, Jan 15, 2014 at 10:29 PM, Stefan Hajnoczi wrote: > On Wed, Jan 15, 2014 at 01:27:41PM +0530, rajan pathak wrote: > > I am new QEMU development and wanted to Simulate Atheros Network > controller. > > > > > > I am Running QEMU on x86 machine with underlaying network controller from > > Broadcom and > > compiled linux kernel based on ARM having Atheros driver support. > > > > I guess there must be mapping at QEMU level calls for Atheros driver maps > > to Broadcom. > > Have no idea where to start looking in to QEMU code and what files to > look > > into. > > > > Can anyone let me know how in general mapping mapping between two > different > > network vendors takes plave at QEMU level. > > QEMU emulates hardware (network cards, graphics cards, sound cards, > etc). What you are asking about is adding a new emulated device for an > Atheros NIC. > > Usually that involves reviewing the datasheet from the hardware vendor > to understand the programming interface that the hardware provides (e.g. > hardware registers accessible over PCI). > > In some cases no datasheet is available so you have to look at existing > open source drivers to understand how the device is supposed to behave. > > Then you can implement the device in QEMU. See the hw/net/ directory. > > If you're not already familiar with device drivers/device emulation and > C programming then this can be a big undertaking. The main requirement > is to understand how the hardware is supposed to behave, it can be very > difficult if the vendor does not provide a datasheet. > > Perhaps you can modify your guest to use one of the NICs that QEMU > already has support for (rtl8139, e1000, virtio-net, etc)? > > Stefan > --001a11c1707e57b91f04f041dd04 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
Tha= nks Stefan for your kind response.

I am OK with C programming = and wrote couple of LKM related to FPGA device.

But my underst= anding of QEMU is very limited.

Let me ask some specific question on what I wanted to do.

=
I am looking forward to emulate single-chip Ethernet controller.
<= br>
I can find some of its source code online and it has two main part= Ethernet PHY (any 1GB SGMII compatible)
and Ethernet MAC .

So ,DO I need to simply put the corre= sponding source files of PHY and MAC in hw/net directory of QEMU?

Also ,do I need to take care of underlying Ethernet controller(of my ma= chine where I am trying to do this) from
Broadcom in any way?

Thanks
Rajan

=A0

<= /div>
<= br>
On Wed, Jan 15, 2014 at 10:29 PM, Stefan Haj= noczi <stefanha@gmail.com> wrote:
On Wed, Jan 15, 2014 at 01:27:41PM = +0530, rajan pathak wrote:
> I am new QEMU development and wanted to Simulate Atheros Network contr= oller.
>
>
> I am Running QEMU on x86 machine with underlaying network controller f= rom
> Broadcom and
> =A0compiled linux kernel based on ARM having Atheros driver support. >
> I guess there must be mapping at QEMU level calls for Atheros driver m= aps
> to Broadcom.
> Have no idea where to start looking in to QEMU code and what files to = look
> into.
>
> Can anyone let me know how in general mapping mapping between two diff= erent
> network vendors takes plave at QEMU level.

QEMU emulates hardware (network cards, graphics cards, sound ca= rds,
etc). =A0What you are asking about is adding a new emulated device for an Atheros NIC.

Usually that involves reviewing the datasheet from the hardware vendor
to understand the programming interface that the hardware provides (e.g. hardware registers accessible over PCI).

In some cases no datasheet is available so you have to look at existing
open source drivers to understand how the device is supposed to behave.

Then you can implement the device in QEMU. =A0See the hw/net/ directory.
If you're not already familiar with device drivers/device emulation and=
C programming then this can be a big undertaking. =A0The main requirement is to understand how the hardware is supposed to behave, it can be very
difficult if the vendor does not provide a datasheet.

Perhaps you can modify your guest to use one of the NICs that QEMU
already has support for (rtl8139, e1000, virtio-net, etc)?

Stefan

--001a11c1707e57b91f04f041dd04--