[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCHv4 09/13] lance: move TYPE_LANCE and SysBusPCNetS
From: |
Mark Cave-Ayland |
Subject: |
Re: [Qemu-devel] [PATCHv4 09/13] lance: move TYPE_LANCE and SysBusPCNetState from lance.c to lance.h |
Date: |
Mon, 30 Oct 2017 19:08:19 +0000 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.3.0 |
On 30/10/17 18:45, Philippe Mathieu-Daudé wrote:
>>>>>>> +/*
>>>>>>> + * QEMU AMD PC-Net II (Am79C970A) emulation
>>>>>>
>>>>>> Filename says this is Lance ethernet, but the comment says it's PC-Net ?
>>>>>
>>>>> According to the datasheet for Am79C970A, the original Lance is an
>>>>> Am7990 device and the Am79C970A aka PCNet-PCI II as emulated by QEMU is
>>>>> register-compatible with it.
>>>>>
>>>>> I guess the comment above is more technically correct, but I'm happy to
>>>>> adjust it in my local tree if you still feel it needs to change?
>>>
>>> I think we should have a comment that says what the file is
>>> for. Since this is a different file from pcnet.h, we should
>>> have a comment that isn't the same as the pcnet.h one.
>>> I don't particularly mind what it says, as long as it briefly
>>> explains what's in the file (and by implication what distinguishes
>>> things in this file from things in the other).
>>
>> Okay then how about something along the lines of:
>>
>> * QEMU Lance (Am7990) device emulation
>> *
>> * Copyright (c) 2004 Antony T Curtis
>> * Copyright (c) 2017 Mark Cave-Ayland
>> *
>> * This represents the Sparc32 lance (Am7990) ethernet device which is
>> * an earlier register-compatible member of the AMD PC-Net II
>> * (Am79C970A) family.
>>
>> In reality pcnet.c/pcnet.h are just the inner workings of the pcnet-pci
>> and lance devices. The comments in pcnet-pci.c and lance.c are identical
>> except for the Sparc32 reference and it was the same header from
>> pcnet-pci.c that I used as the basis for my last patch.
>
> You are right the PCnet family is based on the Lance one, but it seems
> nobody remembers the Lance origin, the "PC-Net" took over.
>
> Maybe we can agree with the different families having an unique
> "hw/net/pcnet_lance.h" header with all Lance/PC-Net related XXX_TYPEs,
> what do you think?
This is definitely a good idea in principle, however the lance device in
its current form cannot work for anything other than SPARC32 because of
the the word-size byte swaps for FIFO transfers which occur for DMA
transfers (see the code for ledma_memory_read/ledma_memory_write).
I think in its current form the patch allows for someone to potentially
implement this later for other architectures (e.g x86) so while I don't
want to disallow this in future, it isn't really within the scope of
this particular patchset.
ATB,
Mark.
- Re: [Qemu-devel] [PATCHv4 01/13] sparc32_dma: rename SPARC32_DMA type to SPARC32_DMA_DEVICE, (continued)
- [Qemu-devel] [PATCHv4 04/13] sun4m: move DMA device wiring from sparc32_dma_init() to sun4m_hw_init(), Mark Cave-Ayland, 2017/10/25
- [Qemu-devel] [PATCHv4 09/13] lance: move TYPE_LANCE and SysBusPCNetState from lance.c to lance.h, Mark Cave-Ayland, 2017/10/25
- Re: [Qemu-devel] [PATCHv4 09/13] lance: move TYPE_LANCE and SysBusPCNetState from lance.c to lance.h, Peter Maydell, 2017/10/25
- Re: [Qemu-devel] [PATCHv4 09/13] lance: move TYPE_LANCE and SysBusPCNetState from lance.c to lance.h, Mark Cave-Ayland, 2017/10/26
- Re: [Qemu-devel] [PATCHv4 09/13] lance: move TYPE_LANCE and SysBusPCNetState from lance.c to lance.h, Mark Cave-Ayland, 2017/10/30
- Re: [Qemu-devel] [PATCHv4 09/13] lance: move TYPE_LANCE and SysBusPCNetState from lance.c to lance.h, Peter Maydell, 2017/10/30
- Re: [Qemu-devel] [PATCHv4 09/13] lance: move TYPE_LANCE and SysBusPCNetState from lance.c to lance.h, Mark Cave-Ayland, 2017/10/30
- Re: [Qemu-devel] [PATCHv4 09/13] lance: move TYPE_LANCE and SysBusPCNetState from lance.c to lance.h, Philippe Mathieu-Daudé, 2017/10/30
- Re: [Qemu-devel] [PATCHv4 09/13] lance: move TYPE_LANCE and SysBusPCNetState from lance.c to lance.h,
Mark Cave-Ayland <=
Re: [Qemu-devel] [PATCHv4 09/13] lance: move TYPE_LANCE and SysBusPCNetState from lance.c to lance.h, Philippe Mathieu-Daudé, 2017/10/27
[Qemu-devel] [PATCHv4 06/13] sparc32_dma: use object link instead of qdev property to pass IOMMU reference, Mark Cave-Ayland, 2017/10/25
[Qemu-devel] [PATCHv4 03/13] sparc32_dma: move type declarations from sparc32_dma.c to sparc32_dma.h, Mark Cave-Ayland, 2017/10/25
[Qemu-devel] [PATCHv4 08/13] sparc32_dma: make esp device child of espdma device, Mark Cave-Ayland, 2017/10/25
[Qemu-devel] [PATCHv4 12/13] sparc32_dma: remove is_ledma hack and replace with memory region alias, Mark Cave-Ayland, 2017/10/25
[Qemu-devel] [PATCHv4 10/13] sparc32_dma: make lance device child of ledma device, Mark Cave-Ayland, 2017/10/25