Revision bc24a225

b/console.h
35 35
void kbd_mouse_event(int dx, int dy, int dz, int buttons_state);
36 36
int kbd_mouse_is_absolute(void);
37 37

  
38
struct mouse_transform_info_s {
38
struct MouseTransformInfo {
39 39
    /* Touchscreen resolution */
40 40
    int x;
41 41
    int y;
b/hw/ads7846.c
11 11
#include "devices.h"
12 12
#include "console.h"
13 13

  
14
struct ads7846_state_s {
14
struct ADS7846State {
15 15
    qemu_irq interrupt;
16 16

  
17 17
    int input[8];
......
46 46
#define ADS_Z1POS(x, y)	600
47 47
#define ADS_Z2POS(x, y)	(600 + 6000 / ADS_XPOS(x, y))
48 48

  
49
static void ads7846_int_update(struct ads7846_state_s *s)
49
static void ads7846_int_update(ADS7846State *s)
50 50
{
51 51
    if (s->interrupt)
52 52
        qemu_set_irq(s->interrupt, s->pressure == 0);
......
54 54

  
55 55
uint32_t ads7846_read(void *opaque)
56 56
{
57
    struct ads7846_state_s *s = (struct ads7846_state_s *) opaque;
57
    ADS7846State *s = (ADS7846State *) opaque;
58 58

  
59 59
    return s->output;
60 60
}
61 61

  
62 62
void ads7846_write(void *opaque, uint32_t value)
63 63
{
64
    struct ads7846_state_s *s = (struct ads7846_state_s *) opaque;
64
    ADS7846State *s = (ADS7846State *) opaque;
65 65

  
66 66
    switch (s->cycle ++) {
67 67
    case 0:
......
94 94
static void ads7846_ts_event(void *opaque,
95 95
                int x, int y, int z, int buttons_state)
96 96
{
97
    struct ads7846_state_s *s = opaque;
97
    ADS7846State *s = opaque;
98 98

  
99 99
    if (buttons_state) {
100 100
        x = 0x7fff - x;
......
113 113

  
114 114
static void ads7846_save(QEMUFile *f, void *opaque)
115 115
{
116
    struct ads7846_state_s *s = (struct ads7846_state_s *) opaque;
116
    ADS7846State *s = (ADS7846State *) opaque;
117 117
    int i;
118 118

  
119 119
    for (i = 0; i < 8; i ++)
......
125 125

  
126 126
static int ads7846_load(QEMUFile *f, void *opaque, int version_id)
127 127
{
128
    struct ads7846_state_s *s = (struct ads7846_state_s *) opaque;
128
    ADS7846State *s = (ADS7846State *) opaque;
129 129
    int i;
130 130

  
131 131
    for (i = 0; i < 8; i ++)
......
140 140
    return 0;
141 141
}
142 142

  
143
struct ads7846_state_s *ads7846_init(qemu_irq penirq)
143
ADS7846State *ads7846_init(qemu_irq penirq)
144 144
{
145
    struct ads7846_state_s *s;
146
    s = (struct ads7846_state_s *)
147
            qemu_mallocz(sizeof(struct ads7846_state_s));
148
    memset(s, 0, sizeof(struct ads7846_state_s));
145
    ADS7846State *s;
146
    s = (ADS7846State *)
147
            qemu_mallocz(sizeof(ADS7846State));
148
    memset(s, 0, sizeof(ADS7846State));
149 149

  
150 150
    s->interrupt = penirq;
151 151

  
b/hw/axis_dev88.c
37 37

  
38 38
struct nand_state_t
39 39
{
40
    struct nand_flash_s *nand;
40
    NANDFlashState *nand;
41 41
    unsigned int rdy:1;
42 42
    unsigned int ale:1;
43 43
    unsigned int cle:1;
b/hw/blizzard.c
28 28

  
29 29
typedef void (*blizzard_fn_t)(uint8_t *, const uint8_t *, unsigned int);
30 30

  
31
struct blizzard_s {
31
typedef struct {
32 32
    uint8_t reg;
33 33
    uint32_t addr;
34 34
    int swallow;
......
120 120
        int pitch;
121 121
        blizzard_fn_t line_fn;
122 122
    } data;
123
};
123
} BlizzardState;
124 124

  
125 125
/* Bytes(!) per pixel */
126 126
static const int blizzard_iformat_bpp[0x10] = {
......
144 144
    *v = 0x80 + ((0xe0e * r - 0x0bc7 * g - 0x247 * b) >> 13);
145 145
}
146 146

  
147
static void blizzard_window(struct blizzard_s *s)
147
static void blizzard_window(BlizzardState *s)
148 148
{
149 149
    uint8_t *src, *dst;
150 150
    int bypp[2];
......
175 175
        fn(dst, src, bypl[2]);
176 176
}
177 177

  
178
static int blizzard_transfer_setup(struct blizzard_s *s)
178
static int blizzard_transfer_setup(BlizzardState *s)
179 179
{
180 180
    if (s->source > 3 || !s->bpp ||
181 181
                    s->ix[1] < s->ix[0] || s->iy[1] < s->iy[0])
......
199 199
    return 1;
200 200
}
201 201

  
202
static void blizzard_reset(struct blizzard_s *s)
202
static void blizzard_reset(BlizzardState *s)
203 203
{
204 204
    s->reg = 0;
205 205
    s->swallow = 0;
......
280 280
}
281 281

  
282 282
static inline void blizzard_invalidate_display(void *opaque) {
283
    struct blizzard_s *s = (struct blizzard_s *) opaque;
283
    BlizzardState *s = (BlizzardState *) opaque;
284 284

  
285 285
    s->invalidate = 1;
286 286
}
287 287

  
288 288
static uint16_t blizzard_reg_read(void *opaque, uint8_t reg)
289 289
{
290
    struct blizzard_s *s = (struct blizzard_s *) opaque;
290
    BlizzardState *s = (BlizzardState *) opaque;
291 291

  
292 292
    switch (reg) {
293 293
    case 0x00:	/* Revision Code */
......
490 490

  
491 491
static void blizzard_reg_write(void *opaque, uint8_t reg, uint16_t value)
492 492
{
493
    struct blizzard_s *s = (struct blizzard_s *) opaque;
493
    BlizzardState *s = (BlizzardState *) opaque;
494 494

  
495 495
    switch (reg) {
496 496
    case 0x04:	/* PLL M-Divider */
......
831 831

  
832 832
uint16_t s1d13745_read(void *opaque, int dc)
833 833
{
834
    struct blizzard_s *s = (struct blizzard_s *) opaque;
834
    BlizzardState *s = (BlizzardState *) opaque;
835 835
    uint16_t value = blizzard_reg_read(s, s->reg);
836 836

  
837 837
    if (s->swallow -- > 0)
......
844 844

  
845 845
void s1d13745_write(void *opaque, int dc, uint16_t value)
846 846
{
847
    struct blizzard_s *s = (struct blizzard_s *) opaque;
847
    BlizzardState *s = (BlizzardState *) opaque;
848 848

  
849 849
    if (s->swallow -- > 0)
850 850
        return;
......
860 860
void s1d13745_write_block(void *opaque, int dc,
861 861
                void *buf, size_t len, int pitch)
862 862
{
863
    struct blizzard_s *s = (struct blizzard_s *) opaque;
863
    BlizzardState *s = (BlizzardState *) opaque;
864 864

  
865 865
    while (len > 0) {
866 866
        if (s->reg == 0x90 && dc &&
......
886 886

  
887 887
static void blizzard_update_display(void *opaque)
888 888
{
889
    struct blizzard_s *s = (struct blizzard_s *) opaque;
889
    BlizzardState *s = (BlizzardState *) opaque;
890 890
    int y, bypp, bypl, bwidth;
891 891
    uint8_t *src, *dst;
892 892

  
......
935 935
}
936 936

  
937 937
static void blizzard_screen_dump(void *opaque, const char *filename) {
938
    struct blizzard_s *s = (struct blizzard_s *) opaque;
938
    BlizzardState *s = (BlizzardState *) opaque;
939 939

  
940 940
    blizzard_update_display(opaque);
941 941
    if (s && ds_get_data(s->state))
......
955 955

  
956 956
void *s1d13745_init(qemu_irq gpio_int)
957 957
{
958
    struct blizzard_s *s = (struct blizzard_s *) qemu_mallocz(sizeof(*s));
958
    BlizzardState *s = (BlizzardState *) qemu_mallocz(sizeof(*s));
959 959

  
960 960
    s->fb = qemu_malloc(0x180000);
961 961

  
b/hw/cbus.c
28 28

  
29 29
//#define DEBUG
30 30

  
31
struct cbus_slave_s;
32
struct cbus_priv_s {
33
    struct cbus_s cbus;
31
typedef struct {
32
    void *opaque;
33
    void (*io)(void *opaque, int rw, int reg, uint16_t *val);
34
    int addr;
35
} CBusSlave;
36

  
37
typedef struct {
38
    CBus cbus;
34 39

  
35 40
    int sel;
36 41
    int dat;
......
48 53
        cbus_value,
49 54
    } cycle;
50 55

  
51
    struct cbus_slave_s *slave[8];
52
};
53

  
54
struct cbus_slave_s {
55
    void *opaque;
56
    void (*io)(void *opaque, int rw, int reg, uint16_t *val);
57
    int addr;
58
};
56
    CBusSlave *slave[8];
57
} CBusPriv;
59 58

  
60
static void cbus_io(struct cbus_priv_s *s)
59
static void cbus_io(CBusPriv *s)
61 60
{
62 61
    if (s->slave[s->addr])
63 62
        s->slave[s->addr]->io(s->slave[s->addr]->opaque,
......
66 65
        hw_error("%s: bad slave address %i\n", __FUNCTION__, s->addr);
67 66
}
68 67

  
69
static void cbus_cycle(struct cbus_priv_s *s)
68
static void cbus_cycle(CBusPriv *s)
70 69
{
71 70
    switch (s->cycle) {
72 71
    case cbus_address:
......
97 96

  
98 97
static void cbus_clk(void *opaque, int line, int level)
99 98
{
100
    struct cbus_priv_s *s = (struct cbus_priv_s *) opaque;
99
    CBusPriv *s = (CBusPriv *) opaque;
101 100

  
102 101
    if (!s->sel && level && !s->clk) {
103 102
        if (s->dir)
......
114 113

  
115 114
static void cbus_dat(void *opaque, int line, int level)
116 115
{
117
    struct cbus_priv_s *s = (struct cbus_priv_s *) opaque;
116
    CBusPriv *s = (CBusPriv *) opaque;
118 117

  
119 118
    s->dat = level;
120 119
}
121 120

  
122 121
static void cbus_sel(void *opaque, int line, int level)
123 122
{
124
    struct cbus_priv_s *s = (struct cbus_priv_s *) opaque;
123
    CBusPriv *s = (CBusPriv *) opaque;
125 124

  
126 125
    if (!level) {
127 126
        s->dir = 1;
......
132 131
    s->sel = level;
133 132
}
134 133

  
135
struct cbus_s *cbus_init(qemu_irq dat)
134
CBus *cbus_init(qemu_irq dat)
136 135
{
137
    struct cbus_priv_s *s = (struct cbus_priv_s *) qemu_mallocz(sizeof(*s));
136
    CBusPriv *s = (CBusPriv *) qemu_mallocz(sizeof(*s));
138 137

  
139 138
    s->dat_out = dat;
140 139
    s->cbus.clk = qemu_allocate_irqs(cbus_clk, s, 1)[0];
......
148 147
    return &s->cbus;
149 148
}
150 149

  
151
void cbus_attach(struct cbus_s *bus, void *slave_opaque)
150
void cbus_attach(CBus *bus, void *slave_opaque)
152 151
{
153
    struct cbus_slave_s *slave = (struct cbus_slave_s *) slave_opaque;
154
    struct cbus_priv_s *s = (struct cbus_priv_s *) bus;
152
    CBusSlave *slave = (CBusSlave *) slave_opaque;
153
    CBusPriv *s = (CBusPriv *) bus;
155 154

  
156 155
    s->slave[slave->addr] = slave;
157 156
}
158 157

  
159 158
/* Retu/Vilma */
160
struct cbus_retu_s {
159
typedef struct {
161 160
    uint16_t irqst;
162 161
    uint16_t irqen;
163 162
    uint16_t cc[2];
......
172 171

  
173 172
    int is_vilma;
174 173
    qemu_irq irq;
175
    struct cbus_slave_s cbus;
176
};
174
    CBusSlave cbus;
175
} CBusRetu;
177 176

  
178
static void retu_interrupt_update(struct cbus_retu_s *s)
177
static void retu_interrupt_update(CBusRetu *s)
179 178
{
180 179
    qemu_set_irq(s->irq, s->irqst & ~s->irqen);
181 180
}
......
237 236
    retu_adc_self_temp	= 13,	/* RETU temperature */
238 237
};
239 238

  
240
static inline uint16_t retu_read(struct cbus_retu_s *s, int reg)
239
static inline uint16_t retu_read(CBusRetu *s, int reg)
241 240
{
242 241
#ifdef DEBUG
243 242
    printf("RETU read at %02x\n", reg);
......
304 303
    }
305 304
}
306 305

  
307
static inline void retu_write(struct cbus_retu_s *s, int reg, uint16_t val)
306
static inline void retu_write(CBusRetu *s, int reg, uint16_t val)
308 307
{
309 308
#ifdef DEBUG
310 309
    printf("RETU write of %04x at %02x\n", val, reg);
......
379 378

  
380 379
static void retu_io(void *opaque, int rw, int reg, uint16_t *val)
381 380
{
382
    struct cbus_retu_s *s = (struct cbus_retu_s *) opaque;
381
    CBusRetu *s = (CBusRetu *) opaque;
383 382

  
384 383
    if (rw)
385 384
        *val = retu_read(s, reg);
......
389 388

  
390 389
void *retu_init(qemu_irq irq, int vilma)
391 390
{
392
    struct cbus_retu_s *s = (struct cbus_retu_s *) qemu_mallocz(sizeof(*s));
391
    CBusRetu *s = (CBusRetu *) qemu_mallocz(sizeof(*s));
393 392

  
394 393
    s->irq = irq;
395 394
    s->irqen = 0xffff;
......
419 418

  
420 419
void retu_key_event(void *retu, int state)
421 420
{
422
    struct cbus_slave_s *slave = (struct cbus_slave_s *) retu;
423
    struct cbus_retu_s *s = (struct cbus_retu_s *) slave->opaque;
421
    CBusSlave *slave = (CBusSlave *) retu;
422
    CBusRetu *s = (CBusRetu *) slave->opaque;
424 423

  
425 424
    s->irqst |= 1 << retu_int_pwr;
426 425
    retu_interrupt_update(s);
......
434 433
#if 0
435 434
static void retu_head_event(void *retu, int state)
436 435
{
437
    struct cbus_slave_s *slave = (struct cbus_slave_s *) retu;
438
    struct cbus_retu_s *s = (struct cbus_retu_s *) slave->opaque;
436
    CBusSlave *slave = (CBusSlave *) retu;
437
    CBusRetu *s = (CBusRetu *) slave->opaque;
439 438

  
440 439
    if ((s->cc[0] & 0x500) == 0x500) {	/* TODO: Which bits? */
441 440
        /* TODO: reissue the interrupt every 100ms or so.  */
......
451 450

  
452 451
static void retu_hook_event(void *retu, int state)
453 452
{
454
    struct cbus_slave_s *slave = (struct cbus_slave_s *) retu;
455
    struct cbus_retu_s *s = (struct cbus_retu_s *) slave->opaque;
453
    CBusSlave *slave = (CBusSlave *) retu;
454
    CBusRetu *s = (CBusRetu *) slave->opaque;
456 455

  
457 456
    if ((s->cc[0] & 0x500) == 0x500) {
458 457
        /* TODO: reissue the interrupt every 100ms or so.  */
......
468 467
#endif
469 468

  
470 469
/* Tahvo/Betty */
471
struct cbus_tahvo_s {
470
typedef struct {
472 471
    uint16_t irqst;
473 472
    uint16_t irqen;
474 473
    uint8_t charger;
......
478 477

  
479 478
    int is_betty;
480 479
    qemu_irq irq;
481
    struct cbus_slave_s cbus;
482
};
480
    CBusSlave cbus;
481
} CBusTahvo;
483 482

  
484
static void tahvo_interrupt_update(struct cbus_tahvo_s *s)
483
static void tahvo_interrupt_update(CBusTahvo *s)
485 484
{
486 485
    qemu_set_irq(s->irq, s->irqst & ~s->irqen);
487 486
}
......
501 500
#define TAHVO_REG_NOPR		0x0c	/* (RW) Number of periods */
502 501
#define TAHVO_REG_FRR		0x0d	/* (RO) FR */
503 502

  
504
static inline uint16_t tahvo_read(struct cbus_tahvo_s *s, int reg)
503
static inline uint16_t tahvo_read(CBusTahvo *s, int reg)
505 504
{
506 505
#ifdef DEBUG
507 506
    printf("TAHVO read at %02x\n", reg);
......
543 542
    }
544 543
}
545 544

  
546
static inline void tahvo_write(struct cbus_tahvo_s *s, int reg, uint16_t val)
545
static inline void tahvo_write(CBusTahvo *s, int reg, uint16_t val)
547 546
{
548 547
#ifdef DEBUG
549 548
    printf("TAHVO write of %04x at %02x\n", val, reg);
......
595 594

  
596 595
static void tahvo_io(void *opaque, int rw, int reg, uint16_t *val)
597 596
{
598
    struct cbus_tahvo_s *s = (struct cbus_tahvo_s *) opaque;
597
    CBusTahvo *s = (CBusTahvo *) opaque;
599 598

  
600 599
    if (rw)
601 600
        *val = tahvo_read(s, reg);
......
605 604

  
606 605
void *tahvo_init(qemu_irq irq, int betty)
607 606
{
608
    struct cbus_tahvo_s *s = (struct cbus_tahvo_s *) qemu_mallocz(sizeof(*s));
607
    CBusTahvo *s = (CBusTahvo *) qemu_mallocz(sizeof(*s));
609 608

  
610 609
    s->irq = irq;
611 610
    s->irqen = 0xffff;
b/hw/devices.h
11 11
void *ssd0323_init(qemu_irq *cmd_p);
12 12

  
13 13
/* ads7846.c */
14
struct ads7846_state_s;
14
typedef struct ADS7846State ADS7846State;
15 15
uint32_t ads7846_read(void *opaque);
16 16
void ads7846_write(void *opaque, uint32_t value);
17
struct ads7846_state_s *ads7846_init(qemu_irq penirq);
17
ADS7846State *ads7846_init(qemu_irq penirq);
18 18

  
19 19
/* tsc210x.c */
20
struct uwire_slave_s;
21
struct mouse_transform_info_s;
22
struct uwire_slave_s *tsc2102_init(qemu_irq pint, AudioState *audio);
23
struct uwire_slave_s *tsc2301_init(qemu_irq penirq, qemu_irq kbirq,
20
uWireSlave *tsc2102_init(qemu_irq pint, AudioState *audio);
21
uWireSlave *tsc2301_init(qemu_irq penirq, qemu_irq kbirq,
24 22
                qemu_irq dav, AudioState *audio);
25
struct i2s_codec_s *tsc210x_codec(struct uwire_slave_s *chip);
23
I2SCodec *tsc210x_codec(uWireSlave *chip);
26 24
uint32_t tsc210x_txrx(void *opaque, uint32_t value, int len);
27
void tsc210x_set_transform(struct uwire_slave_s *chip,
28
                struct mouse_transform_info_s *info);
29
void tsc210x_key_event(struct uwire_slave_s *chip, int key, int down);
25
void tsc210x_set_transform(uWireSlave *chip,
26
                MouseTransformInfo *info);
27
void tsc210x_key_event(uWireSlave *chip, int key, int down);
30 28

  
31 29
/* tsc2005.c */
32 30
void *tsc2005_init(qemu_irq pintdav);
33 31
uint32_t tsc2005_txrx(void *opaque, uint32_t value, int len);
34
void tsc2005_set_transform(void *opaque, struct mouse_transform_info_s *info);
32
void tsc2005_set_transform(void *opaque, MouseTransformInfo *info);
35 33

  
36 34
/* stellaris_input.c */
37 35
void stellaris_gamepad_init(int n, qemu_irq *irq, const int *keycode);
......
44 42
uint16_t s1d13745_read(void *opaque, int dc);
45 43

  
46 44
/* cbus.c */
47
struct cbus_s {
45
typedef struct {
48 46
    qemu_irq clk;
49 47
    qemu_irq dat;
50 48
    qemu_irq sel;
51
};
52
struct cbus_s *cbus_init(qemu_irq dat_out);
53
void cbus_attach(struct cbus_s *bus, void *slave_opaque);
49
} CBus;
50
CBus *cbus_init(qemu_irq dat_out);
51
void cbus_attach(CBus *bus, void *slave_opaque);
54 52

  
55 53
void *retu_init(qemu_irq irq, int vilma);
56 54
void *tahvo_init(qemu_irq irq, int betty);
......
58 56
void retu_key_event(void *retu, int state);
59 57

  
60 58
/* tusb6010.c */
61
struct tusb_s;
62
struct tusb_s *tusb6010_init(qemu_irq intr);
63
int tusb6010_sync_io(struct tusb_s *s);
64
int tusb6010_async_io(struct tusb_s *s);
65
void tusb6010_power(struct tusb_s *s, int on);
59
typedef struct TUSBState TUSBState;
60
TUSBState *tusb6010_init(qemu_irq intr);
61
int tusb6010_sync_io(TUSBState *s);
62
int tusb6010_async_io(TUSBState *s);
63
void tusb6010_power(TUSBState *s, int on);
66 64

  
67 65
/* tc6393xb.c */
68
struct tc6393xb_s;
66
typedef struct TC6393xbState TC6393xbState;
69 67
#define TC6393XB_RAM	0x110000 /* amount of ram for Video and USB */
70
struct tc6393xb_s *tc6393xb_init(uint32_t base, qemu_irq irq);
71
void tc6393xb_gpio_out_set(struct tc6393xb_s *s, int line,
68
TC6393xbState *tc6393xb_init(uint32_t base, qemu_irq irq);
69
void tc6393xb_gpio_out_set(TC6393xbState *s, int line,
72 70
                    qemu_irq handler);
73
qemu_irq *tc6393xb_gpio_in_get(struct tc6393xb_s *s);
74
qemu_irq tc6393xb_l3v_get(struct tc6393xb_s *s);
71
qemu_irq *tc6393xb_gpio_in_get(TC6393xbState *s);
72
qemu_irq tc6393xb_l3v_get(TC6393xbState *s);
75 73

  
76 74
/* sm501.c */
77 75
void sm501_init(uint32_t base, uint32_t local_mem_bytes, qemu_irq irq,
b/hw/ecc.c
50 50
};
51 51

  
52 52
/* Update ECC parity count.  */
53
uint8_t ecc_digest(struct ecc_state_s *s, uint8_t sample)
53
uint8_t ecc_digest(ECCState *s, uint8_t sample)
54 54
{
55 55
    uint8_t idx = nand_ecc_precalc_table[sample];
56 56

  
......
65 65
}
66 66

  
67 67
/* Reinitialise the counters.  */
68
void ecc_reset(struct ecc_state_s *s)
68
void ecc_reset(ECCState *s)
69 69
{
70 70
    s->lp[0] = 0x0000;
71 71
    s->lp[1] = 0x0000;
......
74 74
}
75 75

  
76 76
/* Save/restore */
77
void ecc_put(QEMUFile *f, struct ecc_state_s *s)
77
void ecc_put(QEMUFile *f, ECCState *s)
78 78
{
79 79
    qemu_put_8s(f, &s->cp);
80 80
    qemu_put_be16s(f, &s->lp[0]);
......
82 82
    qemu_put_be16s(f, &s->count);
83 83
}
84 84

  
85
void ecc_get(QEMUFile *f, struct ecc_state_s *s)
85
void ecc_get(QEMUFile *f, ECCState *s)
86 86
{
87 87
    qemu_get_8s(f, &s->cp);
88 88
    qemu_get_be16s(f, &s->lp[0]);
b/hw/flash.h
17 17
                                uint16_t unlock_addr0, uint16_t unlock_addr1);
18 18

  
19 19
/* nand.c */
20
struct nand_flash_s;
21
struct nand_flash_s *nand_init(int manf_id, int chip_id);
22
void nand_done(struct nand_flash_s *s);
23
void nand_setpins(struct nand_flash_s *s,
20
typedef struct NANDFlashState NANDFlashState;
21
NANDFlashState *nand_init(int manf_id, int chip_id);
22
void nand_done(NANDFlashState *s);
23
void nand_setpins(NANDFlashState *s,
24 24
                int cle, int ale, int ce, int wp, int gnd);
25
void nand_getpins(struct nand_flash_s *s, int *rb);
26
void nand_setio(struct nand_flash_s *s, uint8_t value);
27
uint8_t nand_getio(struct nand_flash_s *s);
25
void nand_getpins(NANDFlashState *s, int *rb);
26
void nand_setio(NANDFlashState *s, uint8_t value);
27
uint8_t nand_getio(NANDFlashState *s);
28 28

  
29 29
#define NAND_MFR_TOSHIBA	0x98
30 30
#define NAND_MFR_SAMSUNG	0xec
......
42 42
void *onenand_raw_otp(void *opaque);
43 43

  
44 44
/* ecc.c */
45
struct ecc_state_s {
45
typedef struct {
46 46
    uint8_t cp;		/* Column parity */
47 47
    uint16_t lp[2];	/* Line parity */
48 48
    uint16_t count;
49
};
49
} ECCState;
50 50

  
51
uint8_t ecc_digest(struct ecc_state_s *s, uint8_t sample);
52
void ecc_reset(struct ecc_state_s *s);
53
void ecc_put(QEMUFile *f, struct ecc_state_s *s);
54
void ecc_get(QEMUFile *f, struct ecc_state_s *s);
51
uint8_t ecc_digest(ECCState *s, uint8_t sample);
52
void ecc_reset(ECCState *s);
53
void ecc_put(QEMUFile *f, ECCState *s);
54
void ecc_get(QEMUFile *f, ECCState *s);
b/hw/gumstix.c
46 46
                const char *kernel_filename, const char *kernel_cmdline,
47 47
                const char *initrd_filename, const char *cpu_model)
48 48
{
49
    struct pxa2xx_state_s *cpu;
49
    PXA2xxState *cpu;
50 50
    int index;
51 51

  
52 52
    uint32_t connex_rom = 0x01000000;
......
80 80
                const char *kernel_filename, const char *kernel_cmdline,
81 81
                const char *initrd_filename, const char *cpu_model)
82 82
{
83
    struct pxa2xx_state_s *cpu;
83
    PXA2xxState *cpu;
84 84
    int index;
85 85

  
86 86
    uint32_t verdex_rom = 0x02000000;
b/hw/i2c.h
46 46
void i2c_slave_load(QEMUFile *f, i2c_slave *dev);
47 47

  
48 48
/* max111x.c */
49
struct max111x_s;
49
typedef struct MAX111xState MAX111xState;
50 50
uint32_t max111x_read(void *opaque);
51 51
void max111x_write(void *opaque, uint32_t value);
52
struct max111x_s *max1110_init(qemu_irq cb);
53
struct max111x_s *max1111_init(qemu_irq cb);
54
void max111x_set_input(struct max111x_s *s, int line, uint8_t value);
52
MAX111xState *max1110_init(qemu_irq cb);
53
MAX111xState *max1111_init(qemu_irq cb);
54
void max111x_set_input(MAX111xState *s, int line, uint8_t value);
55 55

  
56 56
/* max7310.c */
57 57
i2c_slave *max7310_init(i2c_bus *bus);
b/hw/ide.c
3859 3859
#define METADATA_SIZE	0x20
3860 3860

  
3861 3861
/* DSCM-1XXXX Microdrive hard disk with CF+ II / PCMCIA interface.  */
3862
struct md_s {
3862
typedef struct {
3863 3863
    IDEState ide[2];
3864
    struct pcmcia_card_s card;
3864
    PCMCIACardState card;
3865 3865
    uint32_t attr_base;
3866 3866
    uint32_t io_base;
3867 3867

  
......
3873 3873
    uint8_t ctrl;
3874 3874
    uint16_t io;
3875 3875
    int cycle;
3876
};
3876
} MicroDriveState;
3877 3877

  
3878 3878
/* Register bitfields */
3879 3879
enum md_opt {
......
3902 3902
    CTRL_SRST		= 0x04,
3903 3903
};
3904 3904

  
3905
static inline void md_interrupt_update(struct md_s *s)
3905
static inline void md_interrupt_update(MicroDriveState *s)
3906 3906
{
3907 3907
    if (!s->card.slot)
3908 3908
        return;
......
3915 3915

  
3916 3916
static void md_set_irq(void *opaque, int irq, int level)
3917 3917
{
3918
    struct md_s *s = (struct md_s *) opaque;
3918
    MicroDriveState *s = (MicroDriveState *) opaque;
3919 3919
    if (level)
3920 3920
        s->stat |= STAT_INT;
3921 3921
    else
......
3924 3924
    md_interrupt_update(s);
3925 3925
}
3926 3926

  
3927
static void md_reset(struct md_s *s)
3927
static void md_reset(MicroDriveState *s)
3928 3928
{
3929 3929
    s->opt = OPT_MODE_MMAP;
3930 3930
    s->stat = 0;
......
3936 3936

  
3937 3937
static uint8_t md_attr_read(void *opaque, uint32_t at)
3938 3938
{
3939
    struct md_s *s = (struct md_s *) opaque;
3939
    MicroDriveState *s = (MicroDriveState *) opaque;
3940 3940
    if (at < s->attr_base) {
3941 3941
        if (at < s->card.cis_len)
3942 3942
            return s->card.cis[at];
......
3969 3969

  
3970 3970
static void md_attr_write(void *opaque, uint32_t at, uint8_t value)
3971 3971
{
3972
    struct md_s *s = (struct md_s *) opaque;
3972
    MicroDriveState *s = (MicroDriveState *) opaque;
3973 3973
    at -= s->attr_base;
3974 3974

  
3975 3975
    switch (at) {
......
4000 4000

  
4001 4001
static uint16_t md_common_read(void *opaque, uint32_t at)
4002 4002
{
4003
    struct md_s *s = (struct md_s *) opaque;
4003
    MicroDriveState *s = (MicroDriveState *) opaque;
4004 4004
    uint16_t ret;
4005 4005
    at -= s->io_base;
4006 4006

  
......
4059 4059

  
4060 4060
static void md_common_write(void *opaque, uint32_t at, uint16_t value)
4061 4061
{
4062
    struct md_s *s = (struct md_s *) opaque;
4062
    MicroDriveState *s = (MicroDriveState *) opaque;
4063 4063
    at -= s->io_base;
4064 4064

  
4065 4065
    switch (s->opt & OPT_MODE) {
......
4120 4120

  
4121 4121
static void md_save(QEMUFile *f, void *opaque)
4122 4122
{
4123
    struct md_s *s = (struct md_s *) opaque;
4123
    MicroDriveState *s = (MicroDriveState *) opaque;
4124 4124
    int i;
4125 4125
    uint8_t drive1_selected;
4126 4126

  
......
4142 4142

  
4143 4143
static int md_load(QEMUFile *f, void *opaque, int version_id)
4144 4144
{
4145
    struct md_s *s = (struct md_s *) opaque;
4145
    MicroDriveState *s = (MicroDriveState *) opaque;
4146 4146
    int i;
4147 4147
    uint8_t drive1_selected;
4148 4148

  
......
4351 4351

  
4352 4352
static int dscm1xxxx_attach(void *opaque)
4353 4353
{
4354
    struct md_s *md = (struct md_s *) opaque;
4354
    MicroDriveState *md = (MicroDriveState *) opaque;
4355 4355
    md->card.attr_read = md_attr_read;
4356 4356
    md->card.attr_write = md_attr_write;
4357 4357
    md->card.common_read = md_common_read;
......
4371 4371

  
4372 4372
static int dscm1xxxx_detach(void *opaque)
4373 4373
{
4374
    struct md_s *md = (struct md_s *) opaque;
4374
    MicroDriveState *md = (MicroDriveState *) opaque;
4375 4375
    md_reset(md);
4376 4376
    return 0;
4377 4377
}
4378 4378

  
4379
struct pcmcia_card_s *dscm1xxxx_init(BlockDriverState *bdrv)
4379
PCMCIACardState *dscm1xxxx_init(BlockDriverState *bdrv)
4380 4380
{
4381
    struct md_s *md = (struct md_s *) qemu_mallocz(sizeof(struct md_s));
4381
    MicroDriveState *md = (MicroDriveState *) qemu_mallocz(sizeof(MicroDriveState));
4382 4382
    md->card.state = md;
4383 4383
    md->card.attach = dscm1xxxx_attach;
4384 4384
    md->card.detach = dscm1xxxx_detach;
b/hw/lm832x.c
24 24
#include "qemu-timer.h"
25 25
#include "console.h"
26 26

  
27
struct lm_kbd_s {
27
typedef struct {
28 28
    i2c_slave i2c;
29 29
    int i2c_dir;
30 30
    int i2c_cycle;
......
66 66
        uint8_t addr[3];
67 67
        QEMUTimer *tm[3];
68 68
    } pwm;
69
};
69
} LM823KbdState;
70 70

  
71 71
#define INT_KEYPAD		(1 << 0)
72 72
#define INT_ERROR		(1 << 3)
......
78 78
#define ERR_KEYOVR		(1 << 2)
79 79
#define ERR_FIFOOVR		(1 << 6)
80 80

  
81
static void lm_kbd_irq_update(struct lm_kbd_s *s)
81
static void lm_kbd_irq_update(LM823KbdState *s)
82 82
{
83 83
    qemu_set_irq(s->nirq, !s->status);
84 84
}
85 85

  
86
static void lm_kbd_gpio_update(struct lm_kbd_s *s)
86
static void lm_kbd_gpio_update(LM823KbdState *s)
87 87
{
88 88
}
89 89

  
90
static void lm_kbd_reset(struct lm_kbd_s *s)
90
static void lm_kbd_reset(LM823KbdState *s)
91 91
{
92 92
    s->config = 0x80;
93 93
    s->status = INT_NOINIT;
......
100 100
    lm_kbd_gpio_update(s);
101 101
}
102 102

  
103
static void lm_kbd_error(struct lm_kbd_s *s, int err)
103
static void lm_kbd_error(LM823KbdState *s, int err)
104 104
{
105 105
    s->error |= err;
106 106
    s->status |= INT_ERROR;
107 107
    lm_kbd_irq_update(s);
108 108
}
109 109

  
110
static void lm_kbd_pwm_tick(struct lm_kbd_s *s, int line)
110
static void lm_kbd_pwm_tick(LM823KbdState *s, int line)
111 111
{
112 112
}
113 113

  
114
static void lm_kbd_pwm_start(struct lm_kbd_s *s, int line)
114
static void lm_kbd_pwm_start(LM823KbdState *s, int line)
115 115
{
116 116
    lm_kbd_pwm_tick(s, line);
117 117
}
......
158 158
#define LM832x_MAX_KPX		8
159 159
#define LM832x_MAX_KPY		12
160 160

  
161
static uint8_t lm_kbd_read(struct lm_kbd_s *s, int reg, int byte)
161
static uint8_t lm_kbd_read(LM823KbdState *s, int reg, int byte)
162 162
{
163 163
    int ret;
164 164

  
......
239 239
    return ret >> (byte << 3);
240 240
}
241 241

  
242
static void lm_kbd_write(struct lm_kbd_s *s, int reg, int byte, uint8_t value)
242
static void lm_kbd_write(LM823KbdState *s, int reg, int byte, uint8_t value)
243 243
{
244 244
    switch (reg) {
245 245
    case LM832x_CMD_WRITE_CFG:
......
378 378

  
379 379
static void lm_i2c_event(i2c_slave *i2c, enum i2c_event event)
380 380
{
381
    struct lm_kbd_s *s = (struct lm_kbd_s *) i2c;
381
    LM823KbdState *s = (LM823KbdState *) i2c;
382 382

  
383 383
    switch (event) {
384 384
    case I2C_START_RECV:
......
394 394

  
395 395
static int lm_i2c_rx(i2c_slave *i2c)
396 396
{
397
    struct lm_kbd_s *s = (struct lm_kbd_s *) i2c;
397
    LM823KbdState *s = (LM823KbdState *) i2c;
398 398

  
399 399
    return lm_kbd_read(s, s->reg, s->i2c_cycle ++);
400 400
}
401 401

  
402 402
static int lm_i2c_tx(i2c_slave *i2c, uint8_t data)
403 403
{
404
    struct lm_kbd_s *s = (struct lm_kbd_s *) i2c;
404
    LM823KbdState *s = (LM823KbdState *) i2c;
405 405

  
406 406
    if (!s->i2c_cycle)
407 407
        s->reg = data;
......
414 414

  
415 415
static void lm_kbd_save(QEMUFile *f, void *opaque)
416 416
{
417
    struct lm_kbd_s *s = (struct lm_kbd_s *) opaque;
417
    LM823KbdState *s = (LM823KbdState *) opaque;
418 418
    int i;
419 419

  
420 420
    i2c_slave_save(f, &s->i2c);
......
450 450

  
451 451
static int lm_kbd_load(QEMUFile *f, void *opaque, int version_id)
452 452
{
453
    struct lm_kbd_s *s = (struct lm_kbd_s *) opaque;
453
    LM823KbdState *s = (LM823KbdState *) opaque;
454 454
    int i;
455 455

  
456 456
    i2c_slave_load(f, &s->i2c);
......
489 489
    return 0;
490 490
}
491 491

  
492
struct i2c_slave *lm8323_init(i2c_bus *bus, qemu_irq nirq)
492
i2c_slave *lm8323_init(i2c_bus *bus, qemu_irq nirq)
493 493
{
494
    struct lm_kbd_s *s;
494
    LM823KbdState *s;
495 495

  
496
    s = (struct lm_kbd_s *) i2c_slave_init(bus, 0, sizeof(struct lm_kbd_s));
496
    s = (LM823KbdState *) i2c_slave_init(bus, 0, sizeof(LM823KbdState));
497 497
    s->model = 0x8323;
498 498
    s->pwm.tm[0] = qemu_new_timer(vm_clock, lm_kbd_pwm0_tick, s);
499 499
    s->pwm.tm[1] = qemu_new_timer(vm_clock, lm_kbd_pwm1_tick, s);
......
514 514

  
515 515
void lm832x_key_event(struct i2c_slave *i2c, int key, int state)
516 516
{
517
    struct lm_kbd_s *s = (struct lm_kbd_s *) i2c;
517
    LM823KbdState *s = (LM823KbdState *) i2c;
518 518

  
519 519
    if ((s->status & INT_ERROR) && (s->error & ERR_FIFOOVR))
520 520
        return;
b/hw/mainstone.c
75 75
{
76 76
    uint32_t sector_len = 256 * 1024;
77 77
    target_phys_addr_t mainstone_flash_base[] = { MST_FLASH_0, MST_FLASH_1 };
78
    struct pxa2xx_state_s *cpu;
78
    PXA2xxState *cpu;
79 79
    qemu_irq *mst_irq;
80 80
    int i, index;
81 81

  
b/hw/mainstone.h
33 33
#define S1_IRQ        15
34 34

  
35 35
extern qemu_irq
36
*mst_irq_init(struct pxa2xx_state_s *cpu, uint32_t base, int irq);
36
*mst_irq_init(PXA2xxState *cpu, uint32_t base, int irq);
37 37

  
38 38
#endif /* __MAINSTONE_H__ */
b/hw/max111x.c
10 10
#include "hw.h"
11 11
#include "i2c.h"
12 12

  
13
struct max111x_s {
13
struct MAX111xState {
14 14
    qemu_irq interrupt;
15 15
    uint8_t tb1, rb2, rb3;
16 16
    int cycle;
......
36 36

  
37 37
uint32_t max111x_read(void *opaque)
38 38
{
39
    struct max111x_s *s = (struct max111x_s *) opaque;
39
    MAX111xState *s = (MAX111xState *) opaque;
40 40

  
41 41
    if (!s->tb1)
42 42
        return 0;
......
54 54
/* Interpret a control-byte */
55 55
void max111x_write(void *opaque, uint32_t value)
56 56
{
57
    struct max111x_s *s = (struct max111x_s *) opaque;
57
    MAX111xState *s = (MAX111xState *) opaque;
58 58
    int measure, chan;
59 59

  
60 60
    /* Ignore the value if START bit is zero */
......
92 92

  
93 93
static void max111x_save(QEMUFile *f, void *opaque)
94 94
{
95
    struct max111x_s *s = (struct max111x_s *) opaque;
95
    MAX111xState *s = (MAX111xState *) opaque;
96 96
    int i;
97 97

  
98 98
    qemu_put_8s(f, &s->tb1);
......
106 106

  
107 107
static int max111x_load(QEMUFile *f, void *opaque, int version_id)
108 108
{
109
    struct max111x_s *s = (struct max111x_s *) opaque;
109
    MAX111xState *s = (MAX111xState *) opaque;
110 110
    int i;
111 111

  
112 112
    qemu_get_8s(f, &s->tb1);
......
121 121
    return 0;
122 122
}
123 123

  
124
static struct max111x_s *max111x_init(qemu_irq cb)
124
static MAX111xState *max111x_init(qemu_irq cb)
125 125
{
126
    struct max111x_s *s;
127
    s = (struct max111x_s *)
128
            qemu_mallocz(sizeof(struct max111x_s));
129
    memset(s, 0, sizeof(struct max111x_s));
126
    MAX111xState *s;
127
    s = (MAX111xState *)
128
            qemu_mallocz(sizeof(MAX111xState));
129
    memset(s, 0, sizeof(MAX111xState));
130 130

  
131 131
    s->interrupt = cb;
132 132

  
......
146 146
    return s;
147 147
}
148 148

  
149
struct max111x_s *max1110_init(qemu_irq cb)
149
MAX111xState *max1110_init(qemu_irq cb)
150 150
{
151
    struct max111x_s *s = max111x_init(cb);
151
    MAX111xState *s = max111x_init(cb);
152 152
    s->inputs = 8;
153 153
    return s;
154 154
}
155 155

  
156
struct max111x_s *max1111_init(qemu_irq cb)
156
MAX111xState *max1111_init(qemu_irq cb)
157 157
{
158
    struct max111x_s *s = max111x_init(cb);
158
    MAX111xState *s = max111x_init(cb);
159 159
    s->inputs = 4;
160 160
    return s;
161 161
}
162 162

  
163
void max111x_set_input(struct max111x_s *s, int line, uint8_t value)
163
void max111x_set_input(MAX111xState *s, int line, uint8_t value)
164 164
{
165 165
    if (line >= s->inputs) {
166 166
        printf("%s: There's no input %i\n", __FUNCTION__, line);
b/hw/max7310.c
10 10
#include "hw.h"
11 11
#include "i2c.h"
12 12

  
13
struct max7310_s {
13
typedef struct {
14 14
    i2c_slave i2c;
15 15
    int i2c_command_byte;
16 16
    int len;
......
22 22
    uint8_t command;
23 23
    qemu_irq handler[8];
24 24
    qemu_irq *gpio_in;
25
};
25
} MAX7310State;
26 26

  
27 27
void max7310_reset(i2c_slave *i2c)
28 28
{
29
    struct max7310_s *s = (struct max7310_s *) i2c;
29
    MAX7310State *s = (MAX7310State *) i2c;
30 30
    s->level &= s->direction;
31 31
    s->direction = 0xff;
32 32
    s->polarity = 0xf0;
......
36 36

  
37 37
static int max7310_rx(i2c_slave *i2c)
38 38
{
39
    struct max7310_s *s = (struct max7310_s *) i2c;
39
    MAX7310State *s = (MAX7310State *) i2c;
40 40

  
41 41
    switch (s->command) {
42 42
    case 0x00:	/* Input port */
......
71 71

  
72 72
static int max7310_tx(i2c_slave *i2c, uint8_t data)
73 73
{
74
    struct max7310_s *s = (struct max7310_s *) i2c;
74
    MAX7310State *s = (MAX7310State *) i2c;
75 75
    uint8_t diff;
76 76
    int line;
77 77

  
......
126 126

  
127 127
static void max7310_event(i2c_slave *i2c, enum i2c_event event)
128 128
{
129
    struct max7310_s *s = (struct max7310_s *) i2c;
129
    MAX7310State *s = (MAX7310State *) i2c;
130 130
    s->len = 0;
131 131

  
132 132
    switch (event) {
......
146 146

  
147 147
static void max7310_save(QEMUFile *f, void *opaque)
148 148
{
149
    struct max7310_s *s = (struct max7310_s *) opaque;
149
    MAX7310State *s = (MAX7310State *) opaque;
150 150

  
151 151
    qemu_put_be32(f, s->i2c_command_byte);
152 152
    qemu_put_be32(f, s->len);
......
162 162

  
163 163
static int max7310_load(QEMUFile *f, void *opaque, int version_id)
164 164
{
165
    struct max7310_s *s = (struct max7310_s *) opaque;
165
    MAX7310State *s = (MAX7310State *) opaque;
166 166

  
167 167
    s->i2c_command_byte = qemu_get_be32(f);
168 168
    s->len = qemu_get_be32(f);
......
179 179

  
180 180
static void max7310_gpio_set(void *opaque, int line, int level)
181 181
{
182
    struct max7310_s *s = (struct max7310_s *) opaque;
182
    MAX7310State *s = (MAX7310State *) opaque;
183 183
    if (line >= ARRAY_SIZE(s->handler) || line  < 0)
184 184
        hw_error("bad GPIO line");
185 185

  
......
191 191

  
192 192
/* MAX7310 is SMBus-compatible (can be used with only SMBus protocols),
193 193
 * but also accepts sequences that are not SMBus so return an I2C device.  */
194
struct i2c_slave *max7310_init(i2c_bus *bus)
194
i2c_slave *max7310_init(i2c_bus *bus)
195 195
{
196
    struct max7310_s *s = (struct max7310_s *)
197
            i2c_slave_init(bus, 0, sizeof(struct max7310_s));
196
    MAX7310State *s = (MAX7310State *)
197
            i2c_slave_init(bus, 0, sizeof(MAX7310State));
198 198
    s->i2c.event = max7310_event;
199 199
    s->i2c.recv = max7310_rx;
200 200
    s->i2c.send = max7310_tx;
......
210 210

  
211 211
qemu_irq *max7310_gpio_in_get(i2c_slave *i2c)
212 212
{
213
    struct max7310_s *s = (struct max7310_s *) i2c;
213
    MAX7310State *s = (MAX7310State *) i2c;
214 214
    return s->gpio_in;
215 215
}
216 216

  
217 217
void max7310_gpio_out_set(i2c_slave *i2c, int line, qemu_irq handler)
218 218
{
219
    struct max7310_s *s = (struct max7310_s *) i2c;
219
    MAX7310State *s = (MAX7310State *) i2c;
220 220
    if (line >= ARRAY_SIZE(s->handler) || line  < 0)
221 221
        hw_error("bad GPIO line");
222 222

  
b/hw/mst_fpga.c
216 216
	return 0;
217 217
}
218 218

  
219
qemu_irq *mst_irq_init(struct pxa2xx_state_s *cpu, uint32_t base, int irq)
219
qemu_irq *mst_irq_init(PXA2xxState *cpu, uint32_t base, int irq)
220 220
{
221 221
	mst_irq_state *s;
222 222
	int iomemtype;
b/hw/nand.c
45 45
# define MAX_PAGE		0x800
46 46
# define MAX_OOB		0x40
47 47

  
48
struct nand_flash_s {
48
struct NANDFlashState {
49 49
    uint8_t manf_id, chip_id;
50 50
    int size, pages;
51 51
    int page_shift, oob_shift, erase_shift, addr_shift;
......
64 64
    int status;
65 65
    int offset;
66 66

  
67
    void (*blk_write)(struct nand_flash_s *s);
68
    void (*blk_erase)(struct nand_flash_s *s);
69
    void (*blk_load)(struct nand_flash_s *s, uint32_t addr, int offset);
67
    void (*blk_write)(NANDFlashState *s);
68
    void (*blk_erase)(NANDFlashState *s);
69
    void (*blk_load)(NANDFlashState *s, uint32_t addr, int offset);
70 70
};
71 71

  
72 72
# define NAND_NO_AUTOINCR	0x00000001
......
106 106
# include "nand.c"
107 107

  
108 108
/* Information based on Linux drivers/mtd/nand/nand_ids.c */
109
static const struct nand_info_s {
109
static const struct {
110 110
    int size;
111 111
    int width;
112 112
    int page_shift;
......
200 200
    [0xc5] = { 2048,	16,	0, 0, LP_OPTIONS16 },
201 201
};
202 202

  
203
static void nand_reset(struct nand_flash_s *s)
203
static void nand_reset(NANDFlashState *s)
204 204
{
205 205
    s->cmd = NAND_CMD_READ0;
206 206
    s->addr = 0;
......
210 210
    s->status &= NAND_IOSTATUS_UNPROTCT;
211 211
}
212 212

  
213
static void nand_command(struct nand_flash_s *s)
213
static void nand_command(NANDFlashState *s)
214 214
{
215 215
    switch (s->cmd) {
216 216
    case NAND_CMD_READ0:
......
279 279

  
280 280
static void nand_save(QEMUFile *f, void *opaque)
281 281
{
282
    struct nand_flash_s *s = (struct nand_flash_s *) opaque;
282
    NANDFlashState *s = (NANDFlashState *) opaque;
283 283
    qemu_put_byte(f, s->cle);
284 284
    qemu_put_byte(f, s->ale);
285 285
    qemu_put_byte(f, s->ce);
......
299 299

  
300 300
static int nand_load(QEMUFile *f, void *opaque, int version_id)
301 301
{
302
    struct nand_flash_s *s = (struct nand_flash_s *) opaque;
302
    NANDFlashState *s = (NANDFlashState *) opaque;
303 303
    s->cle = qemu_get_byte(f);
304 304
    s->ale = qemu_get_byte(f);
305 305
    s->ce = qemu_get_byte(f);
......
325 325
 *
326 326
 * CE, WP and R/B are active low.
327 327
 */
328
void nand_setpins(struct nand_flash_s *s,
328
void nand_setpins(NANDFlashState *s,
329 329
                int cle, int ale, int ce, int wp, int gnd)
330 330
{
331 331
    s->cle = cle;
......
339 339
        s->status &= ~NAND_IOSTATUS_UNPROTCT;
340 340
}
341 341

  
342
void nand_getpins(struct nand_flash_s *s, int *rb)
342
void nand_getpins(NANDFlashState *s, int *rb)
343 343
{
344 344
    *rb = 1;
345 345
}
346 346

  
347
void nand_setio(struct nand_flash_s *s, uint8_t value)
347
void nand_setio(NANDFlashState *s, uint8_t value)
348 348
{
349 349
    if (!s->ce && s->cle) {
350 350
        if (nand_flash_ids[s->chip_id].options & NAND_SAMSUNG_LP) {
......
415 415
    }
416 416
}
417 417

  
418
uint8_t nand_getio(struct nand_flash_s *s)
418
uint8_t nand_getio(NANDFlashState *s)
419 419
{
420 420
    int offset;
421 421

  
......
438 438
    return *(s->ioaddr ++);
439 439
}
440 440

  
441
struct nand_flash_s *nand_init(int manf_id, int chip_id)
441
NANDFlashState *nand_init(int manf_id, int chip_id)
442 442
{
443 443
    int pagesize;
444
    struct nand_flash_s *s;
444
    NANDFlashState *s;
445 445
    int index;
446 446

  
447 447
    if (nand_flash_ids[chip_id].size == 0) {
448 448
        hw_error("%s: Unsupported NAND chip ID.\n", __FUNCTION__);
449 449
    }
450 450

  
451
    s = (struct nand_flash_s *) qemu_mallocz(sizeof(struct nand_flash_s));
451
    s = (NANDFlashState *) qemu_mallocz(sizeof(NANDFlashState));
452 452
    index = drive_get_index(IF_MTD, 0, 0);
453 453
    if (index != -1)
454 454
        s->bdrv = drives_table[index].bdrv;
......
499 499
    return s;
500 500
}
501 501

  
502
void nand_done(struct nand_flash_s *s)
502
void nand_done(NANDFlashState *s)
503 503
{
504 504
    if (s->bdrv) {
505 505
        bdrv_close(s->bdrv);
......
515 515
#else
516 516

  
517 517
/* Program a single page */
518
static void glue(nand_blk_write_, PAGE_SIZE)(struct nand_flash_s *s)
518
static void glue(nand_blk_write_, PAGE_SIZE)(NANDFlashState *s)
519 519
{
520 520
    uint32_t off, page, sector, soff;
521 521
    uint8_t iobuf[(PAGE_SECTORS + 2) * 0x200];
......
561 561
}
562 562

  
563 563
/* Erase a single block */
564
static void glue(nand_blk_erase_, PAGE_SIZE)(struct nand_flash_s *s)
564
static void glue(nand_blk_erase_, PAGE_SIZE)(NANDFlashState *s)
565 565
{
566 566
    uint32_t i, page, addr;
567 567
    uint8_t iobuf[0x200] = { [0 ... 0x1ff] = 0xff, };
......
606 606
    }
607 607
}
608 608

  
609
static void glue(nand_blk_load_, PAGE_SIZE)(struct nand_flash_s *s,
609
static void glue(nand_blk_load_, PAGE_SIZE)(NANDFlashState *s,
610 610
                uint32_t addr, int offset)
611 611
{
612 612
    if (PAGE(addr) >= s->pages)
......
638 638
    s->addr += PAGE_SIZE;
639 639
}
640 640

  
641
static void glue(nand_init_, PAGE_SIZE)(struct nand_flash_s *s)
641
static void glue(nand_init_, PAGE_SIZE)(NANDFlashState *s)
642 642
{
643 643
    s->oob_shift = PAGE_SHIFT - 5;
644 644
    s->pages = s->size >> PAGE_SHIFT;
b/hw/nseries.c
40 40
    struct {
41 41
        void *opaque;
42 42
        uint32_t (*txrx)(void *opaque, uint32_t value, int len);
43
        struct uwire_slave_s *chip;
43
        uWireSlave *chip;
44 44
    } ts;
45 45
    i2c_bus *i2c;
46 46

  
47 47
    int keymap[0x80];
48 48
    i2c_slave *kbd;
49 49

  
50
    struct tusb_s *usb;
50
    TUSBState *usb;
51 51
    void *retu;
52 52
    void *tahvo;
53 53
    void *nand;
......
195 195
}
196 196

  
197 197
/* Touchscreen and keypad controller */
198
static struct mouse_transform_info_s n800_pointercal = {
198
static MouseTransformInfo n800_pointercal = {
199 199
    .x = 800,
200 200
    .y = 480,
201 201
    .a = { 14560, -68, -3455208, -39, -9621, 35152972, 65536 },
202 202
};
203 203

  
204
static struct mouse_transform_info_s n810_pointercal = {
204
static MouseTransformInfo n810_pointercal = {
205 205
    .x = 800,
206 206
    .y = 480,
207 207
    .a = { 15041, 148, -4731056, 171, -10238, 35933380, 65536 },
......
729 729
    qemu_irq retu_irq = omap2_gpio_in_get(s->cpu->gpif, N8X0_RETU_GPIO)[0];
730 730
    qemu_irq tahvo_irq = omap2_gpio_in_get(s->cpu->gpif, N8X0_TAHVO_GPIO)[0];
731 731

  
732
    struct cbus_s *cbus = cbus_init(dat_out);
732
    CBus *cbus = cbus_init(dat_out);
733 733

  
734 734
    omap2_gpio_out_set(s->cpu->gpif, N8X0_CBUS_CLK_GPIO, cbus->clk);
735 735
    omap2_gpio_out_set(s->cpu->gpif, N8X0_CBUS_DAT_GPIO, cbus->dat);
......
764 764
{
765 765
    qemu_irq tusb_irq = omap2_gpio_in_get(s->cpu->gpif, N8X0_TUSB_INT_GPIO)[0];
766 766
    qemu_irq tusb_pwr = qemu_allocate_irqs(n8x0_usb_power_cb, s, 1)[0];
767
    struct tusb_s *tusb = tusb6010_init(tusb_irq);
767
    TUSBState *tusb = tusb6010_init(tusb_irq);
768 768

  
769 769
    /* Using the NOR interface */
770 770
    omap_gpmc_attach(s->cpu->gpmc, N8X0_USB_ASYNC_CS,
b/hw/omap.h
681 681
qemu_irq *omap2_gpio_in_get(struct omap_gpif_s *s, int start);
682 682
void omap2_gpio_out_set(struct omap_gpif_s *s, int line, qemu_irq handler);
683 683

  
684
struct uwire_slave_s {
684
struct uWireSlave {
685 685
    uint16_t (*receive)(void *opaque);
686 686
    void (*send)(void *opaque, uint16_t data);
687 687
    void *opaque;
......
690 690
struct omap_uwire_s *omap_uwire_init(target_phys_addr_t base,
691 691
                qemu_irq *irq, qemu_irq dma, omap_clk clk);
692 692
void omap_uwire_attach(struct omap_uwire_s *s,
693
                struct uwire_slave_s *slave, int chipselect);
693
                uWireSlave *slave, int chipselect);
694 694

  
695 695
struct omap_mcspi_s;
696 696
struct omap_mcspi_s *omap_mcspi_init(struct omap_target_agent_s *ta, int chnum,
......
703 703
struct omap_rtc_s *omap_rtc_init(target_phys_addr_t base,
704 704
                qemu_irq *irq, omap_clk clk);
705 705

  
706
struct i2s_codec_s {
706
struct I2SCodec {
707 707
    void *opaque;
708 708

  
... This diff was truncated because it exceeds the maximum size that can be displayed.

Also available in: Unified diff