qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH v4 2/2] Add GE IP-Octal 232 IndustryPack emulati


From: Andreas Färber
Subject: Re: [Qemu-devel] [PATCH v4 2/2] Add GE IP-Octal 232 IndustryPack emulation
Date: Tue, 08 Jan 2013 19:08:57 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/17.0 Thunderbird/17.0

Am 08.01.2013 02:10, schrieb Alberto Garcia:
> The GE IP-Octal 232 is an IndustryPack module that implements eight
> RS-232 serial ports, each one of which can be redirected to a
> character device in the host.
> 
> Signed-off-by: Alberto Garcia <address@hidden>
> ---
>  hw/Makefile.objs |    2 +-
>  hw/ipoctal.c     |  614 
> ++++++++++++++++++++++++++++++++++++++++++++++++++++++

On my suggestion you changed the type name from "ipoctal" to
"ipoctal232" - the file name should probably then be updated, too.
For the function prefixes inside the file it shouldn't matter as long as
they're consistent.

[...]
> +typedef struct IPOctalState IPOctalState;
> +typedef struct SCC2698Channel SCC2698Channel;
> +typedef struct SCC2698Block SCC2698Block;
> +
> +struct SCC2698Channel {
> +    IPOctalState *ipoctal;
> +    CharDriverState *dev;
> +    char *devpath;
> +    bool rx_enabled;
> +    uint8_t mr[2];
> +    uint8_t mr_idx;
> +    uint8_t sr;
> +    uint8_t rhr[RX_FIFO_SIZE];
> +    uint8_t rhr_idx;
> +    uint8_t rx_pending;
> +};
> +
> +struct SCC2698Block {
> +    uint8_t imr;
> +    uint8_t isr;
> +};
> +
> +struct IPOctalState {
> +    IPackDevice dev;

By convention:

IPackDevice parent_obj;

SCC2698...

> +    SCC2698Channel ch[N_CHANNELS];
> +    SCC2698Block blk[N_BLOCKS];
> +    uint8_t irq_vector;
> +};

I understand that this device will be used from the command line only,
so the upcoming TYPE_IPOCTAL232 could remain local to this file for the
cast macros (i.e., no ipoctal232.h needed).
But if, as brought up at LinuxCon, you may want to add qtest cases it
may be helpful to move some of the constants above to their own header
file ipoctal232_regs.h as done for RTC or pending for TMP105. That could
be split out in a later step though, once PCI libqos is available.

Regards,
Andreas

P.S. No need to CC address@hidden any longer, you may have noticed. ;)

-- 
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg



reply via email to

[Prev in Thread] Current Thread [Next in Thread]