Revision d0f2c4c6
b/block-migration.c | ||
---|---|---|
33 | 33 |
//#define DEBUG_BLK_MIGRATION |
34 | 34 |
|
35 | 35 |
#ifdef DEBUG_BLK_MIGRATION |
36 |
#define dprintf(fmt, ...) \
|
|
36 |
#define DPRINTF(fmt, ...) \
|
|
37 | 37 |
do { printf("blk_migration: " fmt, ## __VA_ARGS__); } while (0) |
38 | 38 |
#else |
39 |
#define dprintf(fmt, ...) \
|
|
39 |
#define DPRINTF(fmt, ...) \
|
|
40 | 40 |
do { } while (0) |
41 | 41 |
#endif |
42 | 42 |
|
... | ... | |
332 | 332 |
{ |
333 | 333 |
BlkMigBlock *blk; |
334 | 334 |
|
335 |
dprintf("%s Enter submitted %d read_done %d transferred %d\n",
|
|
335 |
DPRINTF("%s Enter submitted %d read_done %d transferred %d\n",
|
|
336 | 336 |
__FUNCTION__, block_mig_state.submitted, block_mig_state.read_done, |
337 | 337 |
block_mig_state.transferred); |
338 | 338 |
|
... | ... | |
355 | 355 |
assert(block_mig_state.read_done >= 0); |
356 | 356 |
} |
357 | 357 |
|
358 |
dprintf("%s Exit submitted %d read_done %d transferred %d\n", __FUNCTION__,
|
|
358 |
DPRINTF("%s Exit submitted %d read_done %d transferred %d\n", __FUNCTION__,
|
|
359 | 359 |
block_mig_state.submitted, block_mig_state.read_done, |
360 | 360 |
block_mig_state.transferred); |
361 | 361 |
} |
... | ... | |
400 | 400 |
|
401 | 401 |
static int block_save_live(Monitor *mon, QEMUFile *f, int stage, void *opaque) |
402 | 402 |
{ |
403 |
dprintf("Enter save live stage %d submitted %d transferred %d\n",
|
|
403 |
DPRINTF("Enter save live stage %d submitted %d transferred %d\n",
|
|
404 | 404 |
stage, block_mig_state.submitted, block_mig_state.transferred); |
405 | 405 |
|
406 | 406 |
if (stage < 0) { |
b/block/curl.c | ||
---|---|---|
29 | 29 |
// #define DEBUG_VERBOSE |
30 | 30 |
|
31 | 31 |
#ifdef DEBUG_CURL |
32 |
#define dprintf(fmt, ...) do { printf(fmt, ## __VA_ARGS__); } while (0)
|
|
32 |
#define DPRINTF(fmt, ...) do { printf(fmt, ## __VA_ARGS__); } while (0)
|
|
33 | 33 |
#else |
34 |
#define dprintf(fmt, ...) do { } while (0)
|
|
34 |
#define DPRINTF(fmt, ...) do { } while (0)
|
|
35 | 35 |
#endif |
36 | 36 |
|
37 | 37 |
#define CURL_NUM_STATES 8 |
... | ... | |
80 | 80 |
static int curl_sock_cb(CURL *curl, curl_socket_t fd, int action, |
81 | 81 |
void *s, void *sp) |
82 | 82 |
{ |
83 |
dprintf("CURL (AIO): Sock action %d on fd %d\n", action, fd);
|
|
83 |
DPRINTF("CURL (AIO): Sock action %d on fd %d\n", action, fd);
|
|
84 | 84 |
switch (action) { |
85 | 85 |
case CURL_POLL_IN: |
86 | 86 |
qemu_aio_set_fd_handler(fd, curl_multi_do, NULL, NULL, NULL, s); |
... | ... | |
118 | 118 |
size_t realsize = size * nmemb; |
119 | 119 |
int i; |
120 | 120 |
|
121 |
dprintf("CURL: Just reading %lld bytes\n", (unsigned long long)realsize);
|
|
121 |
DPRINTF("CURL: Just reading %lld bytes\n", (unsigned long long)realsize);
|
|
122 | 122 |
|
123 | 123 |
if (!s || !s->orig_buf) |
124 | 124 |
goto read_end; |
... | ... | |
349 | 349 |
inited = 1; |
350 | 350 |
} |
351 | 351 |
|
352 |
dprintf("CURL: Opening %s\n", file);
|
|
352 |
DPRINTF("CURL: Opening %s\n", file);
|
|
353 | 353 |
s->url = file; |
354 | 354 |
state = curl_init_state(s); |
355 | 355 |
if (!state) |
... | ... | |
368 | 368 |
s->len = (size_t)d; |
369 | 369 |
else if(!s->len) |
370 | 370 |
goto out; |
371 |
dprintf("CURL: Size = %lld\n", (long long)s->len);
|
|
371 |
DPRINTF("CURL: Size = %lld\n", (long long)s->len);
|
|
372 | 372 |
|
373 | 373 |
curl_clean_state(state); |
374 | 374 |
curl_easy_cleanup(state->curl); |
... | ... | |
451 | 451 |
state->acb[0] = acb; |
452 | 452 |
|
453 | 453 |
snprintf(state->range, 127, "%lld-%lld", (long long)start, (long long)end); |
454 |
dprintf("CURL (AIO): Reading %d at %lld (%s)\n", (nb_sectors * SECTOR_SIZE), start, state->range);
|
|
454 |
DPRINTF("CURL (AIO): Reading %d at %lld (%s)\n", (nb_sectors * SECTOR_SIZE), start, state->range);
|
|
455 | 455 |
curl_easy_setopt(state->curl, CURLOPT_RANGE, state->range); |
456 | 456 |
|
457 | 457 |
curl_multi_add_handle(s->multi, state->curl); |
... | ... | |
465 | 465 |
BDRVCURLState *s = bs->opaque; |
466 | 466 |
int i; |
467 | 467 |
|
468 |
dprintf("CURL: Close\n");
|
|
468 |
DPRINTF("CURL: Close\n");
|
|
469 | 469 |
for (i=0; i<CURL_NUM_STATES; i++) { |
470 | 470 |
if (s->states[i].in_use) |
471 | 471 |
curl_clean_state(&s->states[i]); |
b/buffered_file.c | ||
---|---|---|
39 | 39 |
} QEMUFileBuffered; |
40 | 40 |
|
41 | 41 |
#ifdef DEBUG_BUFFERED_FILE |
42 |
#define dprintf(fmt, ...) \
|
|
42 |
#define DPRINTF(fmt, ...) \
|
|
43 | 43 |
do { printf("buffered-file: " fmt, ## __VA_ARGS__); } while (0) |
44 | 44 |
#else |
45 |
#define dprintf(fmt, ...) \
|
|
45 |
#define DPRINTF(fmt, ...) \
|
|
46 | 46 |
do { } while (0) |
47 | 47 |
#endif |
48 | 48 |
|
... | ... | |
52 | 52 |
if (size > (s->buffer_capacity - s->buffer_size)) { |
53 | 53 |
void *tmp; |
54 | 54 |
|
55 |
dprintf("increasing buffer capacity from %zu by %zu\n",
|
|
55 |
DPRINTF("increasing buffer capacity from %zu by %zu\n",
|
|
56 | 56 |
s->buffer_capacity, size + 1024); |
57 | 57 |
|
58 | 58 |
s->buffer_capacity += size + 1024; |
... | ... | |
75 | 75 |
size_t offset = 0; |
76 | 76 |
|
77 | 77 |
if (s->has_error) { |
78 |
dprintf("flush when error, bailing\n");
|
|
78 |
DPRINTF("flush when error, bailing\n");
|
|
79 | 79 |
return; |
80 | 80 |
} |
81 | 81 |
|
82 |
dprintf("flushing %zu byte(s) of data\n", s->buffer_size);
|
|
82 |
DPRINTF("flushing %zu byte(s) of data\n", s->buffer_size);
|
|
83 | 83 |
|
84 | 84 |
while (offset < s->buffer_size) { |
85 | 85 |
ssize_t ret; |
... | ... | |
87 | 87 |
ret = s->put_buffer(s->opaque, s->buffer + offset, |
88 | 88 |
s->buffer_size - offset); |
89 | 89 |
if (ret == -EAGAIN) { |
90 |
dprintf("backend not ready, freezing\n");
|
|
90 |
DPRINTF("backend not ready, freezing\n");
|
|
91 | 91 |
s->freeze_output = 1; |
92 | 92 |
break; |
93 | 93 |
} |
94 | 94 |
|
95 | 95 |
if (ret <= 0) { |
96 |
dprintf("error flushing data, %zd\n", ret);
|
|
96 |
DPRINTF("error flushing data, %zd\n", ret);
|
|
97 | 97 |
s->has_error = 1; |
98 | 98 |
break; |
99 | 99 |
} else { |
100 |
dprintf("flushed %zd byte(s)\n", ret);
|
|
100 |
DPRINTF("flushed %zd byte(s)\n", ret);
|
|
101 | 101 |
offset += ret; |
102 | 102 |
} |
103 | 103 |
} |
104 | 104 |
|
105 |
dprintf("flushed %zu of %zu byte(s)\n", offset, s->buffer_size);
|
|
105 |
DPRINTF("flushed %zu of %zu byte(s)\n", offset, s->buffer_size);
|
|
106 | 106 |
memmove(s->buffer, s->buffer + offset, s->buffer_size - offset); |
107 | 107 |
s->buffer_size -= offset; |
108 | 108 |
} |
... | ... | |
113 | 113 |
int offset = 0; |
114 | 114 |
ssize_t ret; |
115 | 115 |
|
116 |
dprintf("putting %d bytes at %" PRId64 "\n", size, pos);
|
|
116 |
DPRINTF("putting %d bytes at %" PRId64 "\n", size, pos);
|
|
117 | 117 |
|
118 | 118 |
if (s->has_error) { |
119 |
dprintf("flush when error, bailing\n");
|
|
119 |
DPRINTF("flush when error, bailing\n");
|
|
120 | 120 |
return -EINVAL; |
121 | 121 |
} |
122 | 122 |
|
123 |
dprintf("unfreezing output\n");
|
|
123 |
DPRINTF("unfreezing output\n");
|
|
124 | 124 |
s->freeze_output = 0; |
125 | 125 |
|
126 | 126 |
buffered_flush(s); |
127 | 127 |
|
128 | 128 |
while (!s->freeze_output && offset < size) { |
129 | 129 |
if (s->bytes_xfer > s->xfer_limit) { |
130 |
dprintf("transfer limit exceeded when putting\n");
|
|
130 |
DPRINTF("transfer limit exceeded when putting\n");
|
|
131 | 131 |
break; |
132 | 132 |
} |
133 | 133 |
|
134 | 134 |
ret = s->put_buffer(s->opaque, buf + offset, size - offset); |
135 | 135 |
if (ret == -EAGAIN) { |
136 |
dprintf("backend not ready, freezing\n");
|
|
136 |
DPRINTF("backend not ready, freezing\n");
|
|
137 | 137 |
s->freeze_output = 1; |
138 | 138 |
break; |
139 | 139 |
} |
140 | 140 |
|
141 | 141 |
if (ret <= 0) { |
142 |
dprintf("error putting\n");
|
|
142 |
DPRINTF("error putting\n");
|
|
143 | 143 |
s->has_error = 1; |
144 | 144 |
offset = -EINVAL; |
145 | 145 |
break; |
146 | 146 |
} |
147 | 147 |
|
148 |
dprintf("put %zd byte(s)\n", ret);
|
|
148 |
DPRINTF("put %zd byte(s)\n", ret);
|
|
149 | 149 |
offset += ret; |
150 | 150 |
s->bytes_xfer += ret; |
151 | 151 |
} |
152 | 152 |
|
153 | 153 |
if (offset >= 0) { |
154 |
dprintf("buffering %d bytes\n", size - offset);
|
|
154 |
DPRINTF("buffering %d bytes\n", size - offset);
|
|
155 | 155 |
buffered_append(s, buf + offset, size - offset); |
156 | 156 |
offset = size; |
157 | 157 |
} |
... | ... | |
164 | 164 |
QEMUFileBuffered *s = opaque; |
165 | 165 |
int ret; |
166 | 166 |
|
167 |
dprintf("closing\n");
|
|
167 |
DPRINTF("closing\n");
|
|
168 | 168 |
|
169 | 169 |
while (!s->has_error && s->buffer_size) { |
170 | 170 |
buffered_flush(s); |
b/hw/gt64xxx.c | ||
---|---|---|
31 | 31 |
//#define DEBUG |
32 | 32 |
|
33 | 33 |
#ifdef DEBUG |
34 |
#define dprintf(fmt, ...) fprintf(stderr, "%s: " fmt, __FUNCTION__, ##__VA_ARGS__)
|
|
34 |
#define DPRINTF(fmt, ...) fprintf(stderr, "%s: " fmt, __FUNCTION__, ##__VA_ARGS__)
|
|
35 | 35 |
#else |
36 |
#define dprintf(fmt, ...)
|
|
36 |
#define DPRINTF(fmt, ...)
|
|
37 | 37 |
#endif |
38 | 38 |
|
39 | 39 |
#define GT_REGS (0x1000 >> 2) |
... | ... | |
276 | 276 |
check_reserved_space(&start, &length); |
277 | 277 |
length = 0x1000; |
278 | 278 |
/* Map new address */ |
279 |
dprintf("ISD: %x@%x -> %x@%x, %x\n", s->ISD_length, s->ISD_start,
|
|
279 |
DPRINTF("ISD: %x@%x -> %x@%x, %x\n", s->ISD_length, s->ISD_start,
|
|
280 | 280 |
length, start, s->ISD_handle); |
281 | 281 |
s->ISD_start = start; |
282 | 282 |
s->ISD_length = length; |
... | ... | |
423 | 423 |
case GT_DEV_B3: |
424 | 424 |
case GT_DEV_BOOT: |
425 | 425 |
/* Not implemented */ |
426 |
dprintf ("Unimplemented device register offset 0x%x\n", saddr << 2);
|
|
426 |
DPRINTF ("Unimplemented device register offset 0x%x\n", saddr << 2);
|
|
427 | 427 |
break; |
428 | 428 |
|
429 | 429 |
/* ECC */ |
... | ... | |
457 | 457 |
case GT_DMA2_CUR: |
458 | 458 |
case GT_DMA3_CUR: |
459 | 459 |
/* Not implemented */ |
460 |
dprintf ("Unimplemented DMA register offset 0x%x\n", saddr << 2);
|
|
460 |
DPRINTF ("Unimplemented DMA register offset 0x%x\n", saddr << 2);
|
|
461 | 461 |
break; |
462 | 462 |
|
463 | 463 |
/* DMA Channel Control */ |
... | ... | |
466 | 466 |
case GT_DMA2_CTRL: |
467 | 467 |
case GT_DMA3_CTRL: |
468 | 468 |
/* Not implemented */ |
469 |
dprintf ("Unimplemented DMA register offset 0x%x\n", saddr << 2);
|
|
469 |
DPRINTF ("Unimplemented DMA register offset 0x%x\n", saddr << 2);
|
|
470 | 470 |
break; |
471 | 471 |
|
472 | 472 |
/* DMA Arbiter */ |
473 | 473 |
case GT_DMA_ARB: |
474 | 474 |
/* Not implemented */ |
475 |
dprintf ("Unimplemented DMA register offset 0x%x\n", saddr << 2);
|
|
475 |
DPRINTF ("Unimplemented DMA register offset 0x%x\n", saddr << 2);
|
|
476 | 476 |
break; |
477 | 477 |
|
478 | 478 |
/* Timer/Counter */ |
... | ... | |
482 | 482 |
case GT_TC3: |
483 | 483 |
case GT_TC_CONTROL: |
484 | 484 |
/* Not implemented */ |
485 |
dprintf ("Unimplemented timer register offset 0x%x\n", saddr << 2);
|
|
485 |
DPRINTF ("Unimplemented timer register offset 0x%x\n", saddr << 2);
|
|
486 | 486 |
break; |
487 | 487 |
|
488 | 488 |
/* PCI Internal */ |
... | ... | |
539 | 539 |
/* not really implemented */ |
540 | 540 |
s->regs[saddr] = ~(~(s->regs[saddr]) | ~(val & 0xfffffffe)); |
541 | 541 |
s->regs[saddr] |= !!(s->regs[saddr] & 0xfffffffe); |
542 |
dprintf("INTRCAUSE %x\n", val);
|
|
542 |
DPRINTF("INTRCAUSE %x\n", val);
|
|
543 | 543 |
break; |
544 | 544 |
case GT_INTRMASK: |
545 | 545 |
s->regs[saddr] = val & 0x3c3ffffe; |
546 |
dprintf("INTRMASK %x\n", val);
|
|
546 |
DPRINTF("INTRMASK %x\n", val);
|
|
547 | 547 |
break; |
548 | 548 |
case GT_PCI0_ICMASK: |
549 | 549 |
s->regs[saddr] = val & 0x03fffffe; |
550 |
dprintf("ICMASK %x\n", val);
|
|
550 |
DPRINTF("ICMASK %x\n", val);
|
|
551 | 551 |
break; |
552 | 552 |
case GT_PCI0_SERR0MASK: |
553 | 553 |
s->regs[saddr] = val & 0x0000003f; |
554 |
dprintf("SERR0MASK %x\n", val);
|
|
554 |
DPRINTF("SERR0MASK %x\n", val);
|
|
555 | 555 |
break; |
556 | 556 |
|
557 | 557 |
/* Reserved when only PCI_0 is configured. */ |
... | ... | |
575 | 575 |
break; |
576 | 576 |
|
577 | 577 |
default: |
578 |
dprintf ("Bad register offset 0x%x\n", (int)addr);
|
|
578 |
DPRINTF ("Bad register offset 0x%x\n", (int)addr);
|
|
579 | 579 |
break; |
580 | 580 |
} |
581 | 581 |
} |
... | ... | |
815 | 815 |
/* Interrupts */ |
816 | 816 |
case GT_INTRCAUSE: |
817 | 817 |
val = s->regs[saddr]; |
818 |
dprintf("INTRCAUSE %x\n", val);
|
|
818 |
DPRINTF("INTRCAUSE %x\n", val);
|
|
819 | 819 |
break; |
820 | 820 |
case GT_INTRMASK: |
821 | 821 |
val = s->regs[saddr]; |
822 |
dprintf("INTRMASK %x\n", val);
|
|
822 |
DPRINTF("INTRMASK %x\n", val);
|
|
823 | 823 |
break; |
824 | 824 |
case GT_PCI0_ICMASK: |
825 | 825 |
val = s->regs[saddr]; |
826 |
dprintf("ICMASK %x\n", val);
|
|
826 |
DPRINTF("ICMASK %x\n", val);
|
|
827 | 827 |
break; |
828 | 828 |
case GT_PCI0_SERR0MASK: |
829 | 829 |
val = s->regs[saddr]; |
830 |
dprintf("SERR0MASK %x\n", val);
|
|
830 |
DPRINTF("SERR0MASK %x\n", val);
|
|
831 | 831 |
break; |
832 | 832 |
|
833 | 833 |
/* Reserved when only PCI_0 is configured. */ |
... | ... | |
842 | 842 |
|
843 | 843 |
default: |
844 | 844 |
val = s->regs[saddr]; |
845 |
dprintf ("Bad register offset 0x%x\n", (int)addr);
|
|
845 |
DPRINTF ("Bad register offset 0x%x\n", (int)addr);
|
|
846 | 846 |
break; |
847 | 847 |
} |
848 | 848 |
|
b/hw/hpet.c | ||
---|---|---|
32 | 32 |
|
33 | 33 |
//#define HPET_DEBUG |
34 | 34 |
#ifdef HPET_DEBUG |
35 |
#define dprintf printf
|
|
35 |
#define DPRINTF printf
|
|
36 | 36 |
#else |
37 |
#define dprintf(...)
|
|
37 |
#define DPRINTF(...)
|
|
38 | 38 |
#endif |
39 | 39 |
|
40 | 40 |
static HPETState *hpet_statep; |
... | ... | |
288 | 288 |
HPETState *s = (HPETState *)opaque; |
289 | 289 |
uint64_t cur_tick, index; |
290 | 290 |
|
291 |
dprintf("qemu: Enter hpet_ram_readl at %" PRIx64 "\n", addr);
|
|
291 |
DPRINTF("qemu: Enter hpet_ram_readl at %" PRIx64 "\n", addr);
|
|
292 | 292 |
index = addr; |
293 | 293 |
/*address range of all TN regs*/ |
294 | 294 |
if (index >= 0x100 && index <= 0x3ff) { |
... | ... | |
311 | 311 |
case HPET_TN_ROUTE: |
312 | 312 |
return timer->fsb >> 32; |
313 | 313 |
default: |
314 |
dprintf("qemu: invalid hpet_ram_readl\n");
|
|
314 |
DPRINTF("qemu: invalid hpet_ram_readl\n");
|
|
315 | 315 |
break; |
316 | 316 |
} |
317 | 317 |
} else { |
... | ... | |
323 | 323 |
case HPET_CFG: |
324 | 324 |
return s->config; |
325 | 325 |
case HPET_CFG + 4: |
326 |
dprintf("qemu: invalid HPET_CFG + 4 hpet_ram_readl \n");
|
|
326 |
DPRINTF("qemu: invalid HPET_CFG + 4 hpet_ram_readl \n");
|
|
327 | 327 |
return 0; |
328 | 328 |
case HPET_COUNTER: |
329 | 329 |
if (hpet_enabled()) |
330 | 330 |
cur_tick = hpet_get_ticks(); |
331 | 331 |
else |
332 | 332 |
cur_tick = s->hpet_counter; |
333 |
dprintf("qemu: reading counter = %" PRIx64 "\n", cur_tick);
|
|
333 |
DPRINTF("qemu: reading counter = %" PRIx64 "\n", cur_tick);
|
|
334 | 334 |
return cur_tick; |
335 | 335 |
case HPET_COUNTER + 4: |
336 | 336 |
if (hpet_enabled()) |
337 | 337 |
cur_tick = hpet_get_ticks(); |
338 | 338 |
else |
339 | 339 |
cur_tick = s->hpet_counter; |
340 |
dprintf("qemu: reading counter + 4 = %" PRIx64 "\n", cur_tick);
|
|
340 |
DPRINTF("qemu: reading counter + 4 = %" PRIx64 "\n", cur_tick);
|
|
341 | 341 |
return cur_tick >> 32; |
342 | 342 |
case HPET_STATUS: |
343 | 343 |
return s->isr; |
344 | 344 |
default: |
345 |
dprintf("qemu: invalid hpet_ram_readl\n");
|
|
345 |
DPRINTF("qemu: invalid hpet_ram_readl\n");
|
|
346 | 346 |
break; |
347 | 347 |
} |
348 | 348 |
} |
... | ... | |
372 | 372 |
HPETState *s = (HPETState *)opaque; |
373 | 373 |
uint64_t old_val, new_val, val, index; |
374 | 374 |
|
375 |
dprintf("qemu: Enter hpet_ram_writel at %" PRIx64 " = %#x\n", addr, value);
|
|
375 |
DPRINTF("qemu: Enter hpet_ram_writel at %" PRIx64 " = %#x\n", addr, value);
|
|
376 | 376 |
index = addr; |
377 | 377 |
old_val = hpet_ram_readl(opaque, addr); |
378 | 378 |
new_val = value; |
... | ... | |
380 | 380 |
/*address range of all TN regs*/ |
381 | 381 |
if (index >= 0x100 && index <= 0x3ff) { |
382 | 382 |
uint8_t timer_id = (addr - 0x100) / 0x20; |
383 |
dprintf("qemu: hpet_ram_writel timer_id = %#x \n", timer_id);
|
|
383 |
DPRINTF("qemu: hpet_ram_writel timer_id = %#x \n", timer_id);
|
|
384 | 384 |
HPETTimer *timer = &s->timer[timer_id]; |
385 | 385 |
|
386 | 386 |
switch ((addr - 0x100) % 0x20) { |
387 | 387 |
case HPET_TN_CFG: |
388 |
dprintf("qemu: hpet_ram_writel HPET_TN_CFG\n");
|
|
388 |
DPRINTF("qemu: hpet_ram_writel HPET_TN_CFG\n");
|
|
389 | 389 |
val = hpet_fixup_reg(new_val, old_val, HPET_TN_CFG_WRITE_MASK); |
390 | 390 |
timer->config = (timer->config & 0xffffffff00000000ULL) | val; |
391 | 391 |
if (new_val & HPET_TN_32BIT) { |
... | ... | |
399 | 399 |
|
400 | 400 |
break; |
401 | 401 |
case HPET_TN_CFG + 4: // Interrupt capabilities |
402 |
dprintf("qemu: invalid HPET_TN_CFG+4 write\n");
|
|
402 |
DPRINTF("qemu: invalid HPET_TN_CFG+4 write\n");
|
|
403 | 403 |
break; |
404 | 404 |
case HPET_TN_CMP: // comparator register |
405 |
dprintf("qemu: hpet_ram_writel HPET_TN_CMP \n");
|
|
405 |
DPRINTF("qemu: hpet_ram_writel HPET_TN_CMP \n");
|
|
406 | 406 |
if (timer->config & HPET_TN_32BIT) |
407 | 407 |
new_val = (uint32_t)new_val; |
408 | 408 |
if (!timer_is_periodic(timer) || |
... | ... | |
423 | 423 |
hpet_set_timer(timer); |
424 | 424 |
break; |
425 | 425 |
case HPET_TN_CMP + 4: // comparator register high order |
426 |
dprintf("qemu: hpet_ram_writel HPET_TN_CMP + 4\n");
|
|
426 |
DPRINTF("qemu: hpet_ram_writel HPET_TN_CMP + 4\n");
|
|
427 | 427 |
if (!timer_is_periodic(timer) || |
428 | 428 |
(timer->config & HPET_TN_SETVAL)) |
429 | 429 |
timer->cmp = (timer->cmp & 0xffffffffULL) |
... | ... | |
443 | 443 |
hpet_set_timer(timer); |
444 | 444 |
break; |
445 | 445 |
case HPET_TN_ROUTE + 4: |
446 |
dprintf("qemu: hpet_ram_writel HPET_TN_ROUTE + 4\n");
|
|
446 |
DPRINTF("qemu: hpet_ram_writel HPET_TN_ROUTE + 4\n");
|
|
447 | 447 |
break; |
448 | 448 |
default: |
449 |
dprintf("qemu: invalid hpet_ram_writel\n");
|
|
449 |
DPRINTF("qemu: invalid hpet_ram_writel\n");
|
|
450 | 450 |
break; |
451 | 451 |
} |
452 | 452 |
return; |
... | ... | |
479 | 479 |
} |
480 | 480 |
break; |
481 | 481 |
case HPET_CFG + 4: |
482 |
dprintf("qemu: invalid HPET_CFG+4 write \n");
|
|
482 |
DPRINTF("qemu: invalid HPET_CFG+4 write \n");
|
|
483 | 483 |
break; |
484 | 484 |
case HPET_STATUS: |
485 | 485 |
/* FIXME: need to handle level-triggered interrupts */ |
... | ... | |
489 | 489 |
printf("qemu: Writing counter while HPET enabled!\n"); |
490 | 490 |
s->hpet_counter = (s->hpet_counter & 0xffffffff00000000ULL) |
491 | 491 |
| value; |
492 |
dprintf("qemu: HPET counter written. ctr = %#x -> %" PRIx64 "\n",
|
|
492 |
DPRINTF("qemu: HPET counter written. ctr = %#x -> %" PRIx64 "\n",
|
|
493 | 493 |
value, s->hpet_counter); |
494 | 494 |
break; |
495 | 495 |
case HPET_COUNTER + 4: |
... | ... | |
497 | 497 |
printf("qemu: Writing counter while HPET enabled!\n"); |
498 | 498 |
s->hpet_counter = (s->hpet_counter & 0xffffffffULL) |
499 | 499 |
| (((uint64_t)value) << 32); |
500 |
dprintf("qemu: HPET counter + 4 written. ctr = %#x -> %" PRIx64 "\n",
|
|
500 |
DPRINTF("qemu: HPET counter + 4 written. ctr = %#x -> %" PRIx64 "\n",
|
|
501 | 501 |
value, s->hpet_counter); |
502 | 502 |
break; |
503 | 503 |
default: |
504 |
dprintf("qemu: invalid hpet_ram_writel\n");
|
|
504 |
DPRINTF("qemu: invalid hpet_ram_writel\n");
|
|
505 | 505 |
break; |
506 | 506 |
} |
507 | 507 |
} |
... | ... | |
568 | 568 |
int i, iomemtype; |
569 | 569 |
HPETState *s; |
570 | 570 |
|
571 |
dprintf ("hpet_init\n");
|
|
571 |
DPRINTF ("hpet_init\n");
|
|
572 | 572 |
|
573 | 573 |
s = qemu_mallocz(sizeof(HPETState)); |
574 | 574 |
hpet_statep = s; |
b/hw/usb-ohci.c | ||
---|---|---|
42 | 42 |
//#define OHCI_TIME_WARP 1 |
43 | 43 |
|
44 | 44 |
#ifdef DEBUG_OHCI |
45 |
#define dprintf printf
|
|
45 |
#define DPRINTF printf
|
|
46 | 46 |
#else |
47 |
#define dprintf(...)
|
|
47 |
#define DPRINTF(...)
|
|
48 | 48 |
#endif |
49 | 49 |
|
50 | 50 |
/* Number of Downstream Ports on the root hub. */ |
... | ... | |
355 | 355 |
|
356 | 356 |
/* send the attach message */ |
357 | 357 |
usb_send_msg(dev, USB_MSG_ATTACH); |
358 |
dprintf("usb-ohci: Attached port %d\n", port1->index);
|
|
358 |
DPRINTF("usb-ohci: Attached port %d\n", port1->index);
|
|
359 | 359 |
} else { |
360 | 360 |
/* set connect status */ |
361 | 361 |
if (port->ctrl & OHCI_PORT_CCS) { |
... | ... | |
373 | 373 |
usb_send_msg(dev, USB_MSG_DETACH); |
374 | 374 |
} |
375 | 375 |
port->port.dev = NULL; |
376 |
dprintf("usb-ohci: Detached port %d\n", port1->index);
|
|
376 |
DPRINTF("usb-ohci: Detached port %d\n", port1->index);
|
|
377 | 377 |
} |
378 | 378 |
|
379 | 379 |
if (old_state != port->ctrl) |
... | ... | |
427 | 427 |
usb_cancel_packet(&ohci->usb_packet); |
428 | 428 |
ohci->async_td = 0; |
429 | 429 |
} |
430 |
dprintf("usb-ohci: Reset %s\n", ohci->name);
|
|
430 |
DPRINTF("usb-ohci: Reset %s\n", ohci->name);
|
|
431 | 431 |
} |
432 | 432 |
|
433 | 433 |
/* Get an array of dwords from main memory */ |
... | ... | |
593 | 593 |
{ |
594 | 594 |
OHCIState *ohci = opaque; |
595 | 595 |
#ifdef DEBUG_PACKET |
596 |
dprintf("Async packet complete\n");
|
|
596 |
DPRINTF("Async packet complete\n");
|
|
597 | 597 |
#endif |
598 | 598 |
ohci->async_complete = 1; |
599 | 599 |
ohci_process_lists(ohci, 1); |
... | ... | |
648 | 648 |
#endif |
649 | 649 |
|
650 | 650 |
if (relative_frame_number < 0) { |
651 |
dprintf("usb-ohci: ISO_TD R=%d < 0\n", relative_frame_number);
|
|
651 |
DPRINTF("usb-ohci: ISO_TD R=%d < 0\n", relative_frame_number);
|
|
652 | 652 |
return 1; |
653 | 653 |
} else if (relative_frame_number > frame_count) { |
654 | 654 |
/* ISO TD expired - retire the TD to the Done Queue and continue with |
655 | 655 |
the next ISO TD of the same ED */ |
656 |
dprintf("usb-ohci: ISO_TD R=%d > FC=%d\n", relative_frame_number,
|
|
656 |
DPRINTF("usb-ohci: ISO_TD R=%d > FC=%d\n", relative_frame_number,
|
|
657 | 657 |
frame_count); |
658 | 658 |
OHCI_SET_BM(iso_td.flags, TD_CC, OHCI_CC_DATAOVERRUN); |
659 | 659 |
ed->head &= ~OHCI_DPTR_MASK; |
... | ... | |
856 | 856 |
completion = (addr == ohci->async_td); |
857 | 857 |
if (completion && !ohci->async_complete) { |
858 | 858 |
#ifdef DEBUG_PACKET |
859 |
dprintf("Skipping async TD\n");
|
|
859 |
DPRINTF("Skipping async TD\n");
|
|
860 | 860 |
#endif |
861 | 861 |
return 1; |
862 | 862 |
} |
... | ... | |
907 | 907 |
|
908 | 908 |
flag_r = (td.flags & OHCI_TD_R) != 0; |
909 | 909 |
#ifdef DEBUG_PACKET |
910 |
dprintf(" TD @ 0x%.8x %" PRId64 " bytes %s r=%d cbp=0x%.8x be=0x%.8x\n",
|
|
910 |
DPRINTF(" TD @ 0x%.8x %" PRId64 " bytes %s r=%d cbp=0x%.8x be=0x%.8x\n",
|
|
911 | 911 |
addr, len, str, flag_r, td.cbp, td.be); |
912 | 912 |
|
913 | 913 |
if (len > 0 && dir != OHCI_TD_DIR_IN) { |
914 |
dprintf(" data:");
|
|
914 |
DPRINTF(" data:");
|
|
915 | 915 |
for (i = 0; i < len; i++) |
916 | 916 |
printf(" %.2x", ohci->usb_buf[i]); |
917 |
dprintf("\n");
|
|
917 |
DPRINTF("\n");
|
|
918 | 918 |
} |
919 | 919 |
#endif |
920 | 920 |
if (completion) { |
... | ... | |
935 | 935 |
timely manner. |
936 | 936 |
*/ |
937 | 937 |
#ifdef DEBUG_PACKET |
938 |
dprintf("Too many pending packets\n");
|
|
938 |
DPRINTF("Too many pending packets\n");
|
|
939 | 939 |
#endif |
940 | 940 |
return 1; |
941 | 941 |
} |
... | ... | |
951 | 951 |
break; |
952 | 952 |
} |
953 | 953 |
#ifdef DEBUG_PACKET |
954 |
dprintf("ret=%d\n", ret);
|
|
954 |
DPRINTF("ret=%d\n", ret);
|
|
955 | 955 |
#endif |
956 | 956 |
if (ret == USB_RET_ASYNC) { |
957 | 957 |
ohci->async_td = addr; |
... | ... | |
962 | 962 |
if (dir == OHCI_TD_DIR_IN) { |
963 | 963 |
ohci_copy_td(ohci, &td, ohci->usb_buf, ret, 1); |
964 | 964 |
#ifdef DEBUG_PACKET |
965 |
dprintf(" data:");
|
|
965 |
DPRINTF(" data:");
|
|
966 | 966 |
for (i = 0; i < ret; i++) |
967 | 967 |
printf(" %.2x", ohci->usb_buf[i]); |
968 |
dprintf("\n");
|
|
968 |
DPRINTF("\n");
|
|
969 | 969 |
#endif |
970 | 970 |
} else { |
971 | 971 |
ret = len; |
... | ... | |
994 | 994 |
ed->head |= OHCI_ED_C; |
995 | 995 |
} else { |
996 | 996 |
if (ret >= 0) { |
997 |
dprintf("usb-ohci: Underrun\n");
|
|
997 |
DPRINTF("usb-ohci: Underrun\n");
|
|
998 | 998 |
OHCI_SET_BM(td.flags, TD_CC, OHCI_CC_DATAUNDERRUN); |
999 | 999 |
} else { |
1000 | 1000 |
switch (ret) { |
1001 | 1001 |
case USB_RET_NODEV: |
1002 | 1002 |
OHCI_SET_BM(td.flags, TD_CC, OHCI_CC_DEVICENOTRESPONDING); |
1003 | 1003 |
case USB_RET_NAK: |
1004 |
dprintf("usb-ohci: got NAK\n");
|
|
1004 |
DPRINTF("usb-ohci: got NAK\n");
|
|
1005 | 1005 |
return 1; |
1006 | 1006 |
case USB_RET_STALL: |
1007 |
dprintf("usb-ohci: got STALL\n");
|
|
1007 |
DPRINTF("usb-ohci: got STALL\n");
|
|
1008 | 1008 |
OHCI_SET_BM(td.flags, TD_CC, OHCI_CC_STALL); |
1009 | 1009 |
break; |
1010 | 1010 |
case USB_RET_BABBLE: |
1011 |
dprintf("usb-ohci: got BABBLE\n");
|
|
1011 |
DPRINTF("usb-ohci: got BABBLE\n");
|
|
1012 | 1012 |
OHCI_SET_BM(td.flags, TD_CC, OHCI_CC_DATAOVERRUN); |
1013 | 1013 |
break; |
1014 | 1014 |
default: |
... | ... | |
1067 | 1067 |
|
1068 | 1068 |
while ((ed.head & OHCI_DPTR_MASK) != ed.tail) { |
1069 | 1069 |
#ifdef DEBUG_PACKET |
1070 |
dprintf("ED @ 0x%.8x fa=%u en=%u d=%u s=%u k=%u f=%u mps=%u "
|
|
1070 |
DPRINTF("ED @ 0x%.8x fa=%u en=%u d=%u s=%u k=%u f=%u mps=%u "
|
|
1071 | 1071 |
"h=%u c=%u\n head=0x%.8x tailp=0x%.8x next=0x%.8x\n", cur, |
1072 | 1072 |
OHCI_BM(ed.flags, ED_FA), OHCI_BM(ed.flags, ED_EN), |
1073 | 1073 |
OHCI_BM(ed.flags, ED_D), (ed.flags & OHCI_ED_S)!= 0, |
... | ... | |
1107 | 1107 |
{ |
1108 | 1108 |
if ((ohci->ctl & OHCI_CTL_CLE) && (ohci->status & OHCI_STATUS_CLF)) { |
1109 | 1109 |
if (ohci->ctrl_cur && ohci->ctrl_cur != ohci->ctrl_head) |
1110 |
dprintf("usb-ohci: head %x, cur %x\n",
|
|
1110 |
DPRINTF("usb-ohci: head %x, cur %x\n",
|
|
1111 | 1111 |
ohci->ctrl_head, ohci->ctrl_cur); |
1112 | 1112 |
if (!ohci_service_ed_list(ohci, ohci->ctrl_head, completion)) { |
1113 | 1113 |
ohci->ctrl_cur = 0; |
... | ... | |
1191 | 1191 |
return 0; |
1192 | 1192 |
} |
1193 | 1193 |
|
1194 |
dprintf("usb-ohci: %s: USB Operational\n", ohci->name);
|
|
1194 |
DPRINTF("usb-ohci: %s: USB Operational\n", ohci->name);
|
|
1195 | 1195 |
|
1196 | 1196 |
ohci_sof(ohci); |
1197 | 1197 |
|
... | ... | |
1244 | 1244 |
val &= OHCI_FMI_FI; |
1245 | 1245 |
|
1246 | 1246 |
if (val != ohci->fi) { |
1247 |
dprintf("usb-ohci: %s: FrameInterval = 0x%x (%u)\n",
|
|
1247 |
DPRINTF("usb-ohci: %s: FrameInterval = 0x%x (%u)\n",
|
|
1248 | 1248 |
ohci->name, ohci->fi, ohci->fi); |
1249 | 1249 |
} |
1250 | 1250 |
|
... | ... | |
1283 | 1283 |
break; |
1284 | 1284 |
case OHCI_USB_SUSPEND: |
1285 | 1285 |
ohci_bus_stop(ohci); |
1286 |
dprintf("usb-ohci: %s: USB Suspended\n", ohci->name);
|
|
1286 |
DPRINTF("usb-ohci: %s: USB Suspended\n", ohci->name);
|
|
1287 | 1287 |
break; |
1288 | 1288 |
case OHCI_USB_RESUME: |
1289 |
dprintf("usb-ohci: %s: USB Resume\n", ohci->name);
|
|
1289 |
DPRINTF("usb-ohci: %s: USB Resume\n", ohci->name);
|
|
1290 | 1290 |
break; |
1291 | 1291 |
case OHCI_USB_RESET: |
1292 | 1292 |
ohci_reset(ohci); |
1293 |
dprintf("usb-ohci: %s: USB Reset\n", ohci->name);
|
|
1293 |
DPRINTF("usb-ohci: %s: USB Reset\n", ohci->name);
|
|
1294 | 1294 |
break; |
1295 | 1295 |
} |
1296 | 1296 |
} |
... | ... | |
1335 | 1335 |
|
1336 | 1336 |
for (i = 0; i < ohci->num_ports; i++) |
1337 | 1337 |
ohci_port_power(ohci, i, 0); |
1338 |
dprintf("usb-ohci: powered down all ports\n");
|
|
1338 |
DPRINTF("usb-ohci: powered down all ports\n");
|
|
1339 | 1339 |
} |
1340 | 1340 |
|
1341 | 1341 |
if (val & OHCI_RHS_LPSC) { |
... | ... | |
1343 | 1343 |
|
1344 | 1344 |
for (i = 0; i < ohci->num_ports; i++) |
1345 | 1345 |
ohci_port_power(ohci, i, 1); |
1346 |
dprintf("usb-ohci: powered up all ports\n");
|
|
1346 |
DPRINTF("usb-ohci: powered up all ports\n");
|
|
1347 | 1347 |
} |
1348 | 1348 |
|
1349 | 1349 |
if (val & OHCI_RHS_DRWE) |
... | ... | |
1375 | 1375 |
ohci_port_set_if_connected(ohci, portnum, val & OHCI_PORT_PES); |
1376 | 1376 |
|
1377 | 1377 |
if (ohci_port_set_if_connected(ohci, portnum, val & OHCI_PORT_PSS)) |
1378 |
dprintf("usb-ohci: port %d: SUSPEND\n", portnum);
|
|
1378 |
DPRINTF("usb-ohci: port %d: SUSPEND\n", portnum);
|
|
1379 | 1379 |
|
1380 | 1380 |
if (ohci_port_set_if_connected(ohci, portnum, val & OHCI_PORT_PRS)) { |
1381 |
dprintf("usb-ohci: port %d: RESET\n", portnum);
|
|
1381 |
DPRINTF("usb-ohci: port %d: RESET\n", portnum);
|
|
1382 | 1382 |
usb_send_msg(port->port.dev, USB_MSG_RESET); |
1383 | 1383 |
port->ctrl &= ~OHCI_PORT_PRS; |
1384 | 1384 |
/* ??? Should this also set OHCI_PORT_PESC. */ |
... | ... | |
1680 | 1680 |
usb_bit_time = 1; |
1681 | 1681 |
} |
1682 | 1682 |
#endif |
1683 |
dprintf("usb-ohci: usb_bit_time=%" PRId64 " usb_frame_time=%" PRId64 "\n",
|
|
1683 |
DPRINTF("usb-ohci: usb_bit_time=%" PRId64 " usb_frame_time=%" PRId64 "\n",
|
|
1684 | 1684 |
usb_frame_time, usb_bit_time); |
1685 | 1685 |
} |
1686 | 1686 |
|
b/hw/usb-uhci.c | ||
---|---|---|
71 | 71 |
#define NB_PORTS 2 |
72 | 72 |
|
73 | 73 |
#ifdef DEBUG |
74 |
#define dprintf printf
|
|
74 |
#define DPRINTF printf
|
|
75 | 75 |
|
76 | 76 |
static const char *pid2str(int pid) |
77 | 77 |
{ |
... | ... | |
84 | 84 |
} |
85 | 85 |
|
86 | 86 |
#else |
87 |
#define dprintf(...)
|
|
87 |
#define DPRINTF(...)
|
|
88 | 88 |
#endif |
89 | 89 |
|
90 | 90 |
#ifdef DEBUG_DUMP_DATA |
... | ... | |
198 | 198 |
|
199 | 199 |
static void uhci_async_cancel(UHCIState *s, UHCIAsync *async) |
200 | 200 |
{ |
201 |
dprintf("uhci: cancel td 0x%x token 0x%x done %u\n",
|
|
201 |
DPRINTF("uhci: cancel td 0x%x token 0x%x done %u\n",
|
|
202 | 202 |
async->td, async->token, async->done); |
203 | 203 |
|
204 | 204 |
if (!async->done) |
... | ... | |
329 | 329 |
int i; |
330 | 330 |
UHCIPort *port; |
331 | 331 |
|
332 |
dprintf("uhci: full reset\n");
|
|
332 |
DPRINTF("uhci: full reset\n");
|
|
333 | 333 |
|
334 | 334 |
pci_conf = s->dev.config; |
335 | 335 |
|
... | ... | |
427 | 427 |
UHCIState *s = opaque; |
428 | 428 |
|
429 | 429 |
addr &= 0x1f; |
430 |
dprintf("uhci: writew port=0x%04x val=0x%04x\n", addr, val);
|
|
430 |
DPRINTF("uhci: writew port=0x%04x val=0x%04x\n", addr, val);
|
|
431 | 431 |
|
432 | 432 |
switch(addr) { |
433 | 433 |
case 0x00: |
... | ... | |
538 | 538 |
break; |
539 | 539 |
} |
540 | 540 |
|
541 |
dprintf("uhci: readw port=0x%04x val=0x%04x\n", addr, val);
|
|
541 |
DPRINTF("uhci: readw port=0x%04x val=0x%04x\n", addr, val);
|
|
542 | 542 |
|
543 | 543 |
return val; |
544 | 544 |
} |
... | ... | |
548 | 548 |
UHCIState *s = opaque; |
549 | 549 |
|
550 | 550 |
addr &= 0x1f; |
551 |
dprintf("uhci: writel port=0x%04x val=0x%08x\n", addr, val);
|
|
551 |
DPRINTF("uhci: writel port=0x%04x val=0x%08x\n", addr, val);
|
|
552 | 552 |
|
553 | 553 |
switch(addr) { |
554 | 554 |
case 0x08: |
... | ... | |
639 | 639 |
{ |
640 | 640 |
int i, ret; |
641 | 641 |
|
642 |
dprintf("uhci: packet enter. pid %s addr 0x%02x ep %d len %d\n",
|
|
642 |
DPRINTF("uhci: packet enter. pid %s addr 0x%02x ep %d len %d\n",
|
|
643 | 643 |
pid2str(p->pid), p->devaddr, p->devep, p->len); |
644 | 644 |
if (p->pid == USB_TOKEN_OUT || p->pid == USB_TOKEN_SETUP) |
645 | 645 |
dump_data(p->data, p->len); |
... | ... | |
653 | 653 |
ret = dev->info->handle_packet(dev, p); |
654 | 654 |
} |
655 | 655 |
|
656 |
dprintf("uhci: packet exit. ret %d len %d\n", ret, p->len);
|
|
656 |
DPRINTF("uhci: packet exit. ret %d len %d\n", ret, p->len);
|
|
657 | 657 |
if (p->pid == USB_TOKEN_IN && ret > 0) |
658 | 658 |
dump_data(p->data, ret); |
659 | 659 |
|
... | ... | |
709 | 709 |
if ((td->ctrl & TD_CTRL_SPD) && len < max_len) { |
710 | 710 |
*int_mask |= 0x02; |
711 | 711 |
/* short packet: do not update QH */ |
712 |
dprintf("uhci: short packet. td 0x%x token 0x%x\n", async->td, async->token);
|
|
712 |
DPRINTF("uhci: short packet. td 0x%x token 0x%x\n", async->td, async->token);
|
|
713 | 713 |
return 1; |
714 | 714 |
} |
715 | 715 |
} |
... | ... | |
839 | 839 |
UHCIState *s = opaque; |
840 | 840 |
UHCIAsync *async = (UHCIAsync *) packet; |
841 | 841 |
|
842 |
dprintf("uhci: async complete. td 0x%x token 0x%x\n", async->td, async->token);
|
|
842 |
DPRINTF("uhci: async complete. td 0x%x token 0x%x\n", async->td, async->token);
|
|
843 | 843 |
|
844 | 844 |
async->done = 1; |
845 | 845 |
|
... | ... | |
899 | 899 |
|
900 | 900 |
frame_addr = s->fl_base_addr + ((s->frnum & 0x3ff) << 2); |
901 | 901 |
|
902 |
dprintf("uhci: processing frame %d addr 0x%x\n" , s->frnum, frame_addr);
|
|
902 |
DPRINTF("uhci: processing frame %d addr 0x%x\n" , s->frnum, frame_addr);
|
|
903 | 903 |
|
904 | 904 |
cpu_physical_memory_read(frame_addr, (uint8_t *)&link, 4); |
905 | 905 |
le32_to_cpus(&link); |
... | ... | |
921 | 921 |
* are already done, and async completion handler will re-process |
922 | 922 |
* the frame when something is ready. |
923 | 923 |
*/ |
924 |
dprintf("uhci: detected loop. qh 0x%x\n", link);
|
|
924 |
DPRINTF("uhci: detected loop. qh 0x%x\n", link);
|
|
925 | 925 |
break; |
926 | 926 |
} |
927 | 927 |
|
... | ... | |
929 | 929 |
le32_to_cpus(&qh.link); |
930 | 930 |
le32_to_cpus(&qh.el_link); |
931 | 931 |
|
932 |
dprintf("uhci: QH 0x%x load. link 0x%x elink 0x%x\n",
|
|
932 |
DPRINTF("uhci: QH 0x%x load. link 0x%x elink 0x%x\n",
|
|
933 | 933 |
link, qh.link, qh.el_link); |
934 | 934 |
|
935 | 935 |
if (!is_valid(qh.el_link)) { |
... | ... | |
951 | 951 |
le32_to_cpus(&td.token); |
952 | 952 |
le32_to_cpus(&td.buffer); |
953 | 953 |
|
954 |
dprintf("uhci: TD 0x%x load. link 0x%x ctrl 0x%x token 0x%x qh 0x%x\n",
|
|
954 |
DPRINTF("uhci: TD 0x%x load. link 0x%x ctrl 0x%x token 0x%x qh 0x%x\n",
|
|
955 | 955 |
link, td.link, td.ctrl, td.token, curr_qh); |
956 | 956 |
|
957 | 957 |
old_td_ctrl = td.ctrl; |
... | ... | |
969 | 969 |
} |
970 | 970 |
|
971 | 971 |
if (ret == 2 || ret == 1) { |
972 |
dprintf("uhci: TD 0x%x %s. link 0x%x ctrl 0x%x token 0x%x qh 0x%x\n",
|
|
972 |
DPRINTF("uhci: TD 0x%x %s. link 0x%x ctrl 0x%x token 0x%x qh 0x%x\n",
|
|
973 | 973 |
link, ret == 2 ? "pend" : "skip", |
974 | 974 |
td.link, td.ctrl, td.token, curr_qh); |
975 | 975 |
|
... | ... | |
979 | 979 |
|
980 | 980 |
/* completed TD */ |
981 | 981 |
|
982 |
dprintf("uhci: TD 0x%x done. link 0x%x ctrl 0x%x token 0x%x qh 0x%x\n",
|
|
982 |
DPRINTF("uhci: TD 0x%x done. link 0x%x ctrl 0x%x token 0x%x qh 0x%x\n",
|
|
983 | 983 |
link, td.link, td.ctrl, td.token, curr_qh); |
984 | 984 |
|
985 | 985 |
link = td.link; |
... | ... | |
994 | 994 |
if (!depth_first(link)) { |
995 | 995 |
/* done with this QH */ |
996 | 996 |
|
997 |
dprintf("uhci: QH 0x%x done. link 0x%x elink 0x%x\n",
|
|
997 |
DPRINTF("uhci: QH 0x%x done. link 0x%x elink 0x%x\n",
|
|
998 | 998 |
curr_qh, qh.link, qh.el_link); |
999 | 999 |
|
1000 | 1000 |
curr_qh = 0; |
... | ... | |
1019 | 1019 |
/* set hchalted bit in status - UHCI11D 2.1.2 */ |
1020 | 1020 |
s->status |= UHCI_STS_HCHALTED; |
1021 | 1021 |
|
1022 |
dprintf("uhci: halted\n");
|
|
1022 |
DPRINTF("uhci: halted\n");
|
|
1023 | 1023 |
return; |
1024 | 1024 |
} |
1025 | 1025 |
|
... | ... | |
1033 | 1033 |
/* Start new frame */ |
1034 | 1034 |
s->frnum = (s->frnum + 1) & 0x7ff; |
1035 | 1035 |
|
1036 |
dprintf("uhci: new frame #%u\n" , s->frnum);
|
|
1036 |
DPRINTF("uhci: new frame #%u\n" , s->frnum);
|
|
1037 | 1037 |
|
1038 | 1038 |
uhci_async_validate_begin(s); |
1039 | 1039 |
|
b/migration-exec.c | ||
---|---|---|
24 | 24 |
//#define DEBUG_MIGRATION_EXEC |
25 | 25 |
|
26 | 26 |
#ifdef DEBUG_MIGRATION_EXEC |
27 |
#define dprintf(fmt, ...) \
|
|
27 |
#define DPRINTF(fmt, ...) \
|
|
28 | 28 |
do { printf("migration-exec: " fmt, ## __VA_ARGS__); } while (0) |
29 | 29 |
#else |
30 |
#define dprintf(fmt, ...) \
|
|
30 |
#define DPRINTF(fmt, ...) \
|
|
31 | 31 |
do { } while (0) |
32 | 32 |
#endif |
33 | 33 |
|
... | ... | |
43 | 43 |
|
44 | 44 |
static int exec_close(FdMigrationState *s) |
45 | 45 |
{ |
46 |
dprintf("exec_close\n");
|
|
46 |
DPRINTF("exec_close\n");
|
|
47 | 47 |
if (s->opaque) { |
48 | 48 |
qemu_fclose(s->opaque); |
49 | 49 |
s->opaque = NULL; |
... | ... | |
66 | 66 |
|
67 | 67 |
f = popen(command, "w"); |
68 | 68 |
if (f == NULL) { |
69 |
dprintf("Unable to popen exec target\n");
|
|
69 |
DPRINTF("Unable to popen exec target\n");
|
|
70 | 70 |
goto err_after_alloc; |
71 | 71 |
} |
72 | 72 |
|
73 | 73 |
s->fd = fileno(f); |
74 | 74 |
if (s->fd == -1) { |
75 |
dprintf("Unable to retrieve file descriptor for popen'd handle\n");
|
|
75 |
DPRINTF("Unable to retrieve file descriptor for popen'd handle\n");
|
|
76 | 76 |
goto err_after_open; |
77 | 77 |
} |
78 | 78 |
|
... | ... | |
119 | 119 |
goto err; |
120 | 120 |
} |
121 | 121 |
qemu_announce_self(); |
122 |
dprintf("successfully loaded vm state\n");
|
|
122 |
DPRINTF("successfully loaded vm state\n");
|
|
123 | 123 |
/* we've successfully migrated, close the fd */ |
124 | 124 |
qemu_set_fd_handler2(qemu_stdio_fd(f), NULL, NULL, NULL, NULL); |
125 | 125 |
if (autostart) |
... | ... | |
133 | 133 |
{ |
134 | 134 |
QEMUFile *f; |
135 | 135 |
|
136 |
dprintf("Attempting to start an incoming migration\n");
|
|
136 |
DPRINTF("Attempting to start an incoming migration\n");
|
|
137 | 137 |
f = qemu_popen_cmd(command, "r"); |
138 | 138 |
if(f == NULL) { |
139 |
dprintf("Unable to apply qemu wrapper to popen file\n");
|
|
139 |
DPRINTF("Unable to apply qemu wrapper to popen file\n");
|
|
140 | 140 |
return -errno; |
141 | 141 |
} |
142 | 142 |
|
b/migration-fd.c | ||
---|---|---|
24 | 24 |
//#define DEBUG_MIGRATION_FD |
25 | 25 |
|
26 | 26 |
#ifdef DEBUG_MIGRATION_FD |
27 |
#define dprintf(fmt, ...) \
|
|
27 |
#define DPRINTF(fmt, ...) \
|
|
28 | 28 |
do { printf("migration-fd: " fmt, ## __VA_ARGS__); } while (0) |
29 | 29 |
#else |
30 |
#define dprintf(fmt, ...) \
|
|
30 |
#define DPRINTF(fmt, ...) \
|
|
31 | 31 |
do { } while (0) |
32 | 32 |
#endif |
33 | 33 |
|
... | ... | |
43 | 43 |
|
44 | 44 |
static int fd_close(FdMigrationState *s) |
45 | 45 |
{ |
46 |
dprintf("fd_close\n");
|
|
46 |
DPRINTF("fd_close\n");
|
|
47 | 47 |
if (s->fd != -1) { |
48 | 48 |
close(s->fd); |
49 | 49 |
s->fd = -1; |
... | ... | |
64 | 64 |
|
65 | 65 |
s->fd = monitor_get_fd(mon, fdname); |
66 | 66 |
if (s->fd == -1) { |
67 |
dprintf("fd_migration: invalid file descriptor identifier\n");
|
|
67 |
DPRINTF("fd_migration: invalid file descriptor identifier\n");
|
|
68 | 68 |
goto err_after_alloc; |
69 | 69 |
} |
70 | 70 |
|
71 | 71 |
if (fcntl(s->fd, F_SETFL, O_NONBLOCK) == -1) { |
72 |
dprintf("Unable to set nonblocking mode on file descriptor\n");
|
|
72 |
DPRINTF("Unable to set nonblocking mode on file descriptor\n");
|
|
73 | 73 |
goto err_after_open; |
74 | 74 |
} |
75 | 75 |
|
... | ... | |
112 | 112 |
goto err; |
113 | 113 |
} |
114 | 114 |
qemu_announce_self(); |
115 |
dprintf("successfully loaded vm state\n");
|
|
115 |
DPRINTF("successfully loaded vm state\n");
|
|
116 | 116 |
/* we've successfully migrated, close the fd */ |
117 | 117 |
qemu_set_fd_handler2(qemu_stdio_fd(f), NULL, NULL, NULL, NULL); |
118 | 118 |
if (autostart) |
... | ... | |
127 | 127 |
int fd; |
128 | 128 |
QEMUFile *f; |
129 | 129 |
|
130 |
dprintf("Attempting to start an incoming migration via fd\n");
|
|
130 |
DPRINTF("Attempting to start an incoming migration via fd\n");
|
|
131 | 131 |
|
132 | 132 |
fd = strtol(infd, NULL, 0); |
133 | 133 |
f = qemu_fdopen(fd, "rb"); |
134 | 134 |
if(f == NULL) { |
135 |
dprintf("Unable to apply qemu wrapper to file descriptor\n");
|
|
135 |
DPRINTF("Unable to apply qemu wrapper to file descriptor\n");
|
|
136 | 136 |
return -errno; |
137 | 137 |
} |
138 | 138 |
|
b/migration-tcp.c | ||
---|---|---|
22 | 22 |
//#define DEBUG_MIGRATION_TCP |
23 | 23 |
|
24 | 24 |
#ifdef DEBUG_MIGRATION_TCP |
25 |
#define dprintf(fmt, ...) \
|
|
25 |
#define DPRINTF(fmt, ...) \
|
|
26 | 26 |
do { printf("migration-tcp: " fmt, ## __VA_ARGS__); } while (0) |
27 | 27 |
#else |
28 |
#define dprintf(fmt, ...) \
|
|
28 |
#define DPRINTF(fmt, ...) \
|
|
29 | 29 |
do { } while (0) |
30 | 30 |
#endif |
31 | 31 |
|
... | ... | |
41 | 41 |
|
42 | 42 |
static int tcp_close(FdMigrationState *s) |
43 | 43 |
{ |
44 |
dprintf("tcp_close\n");
|
|
44 |
DPRINTF("tcp_close\n");
|
|
45 | 45 |
if (s->fd != -1) { |
46 | 46 |
close(s->fd); |
47 | 47 |
s->fd = -1; |
... | ... | |
56 | 56 |
int val, ret; |
57 | 57 |
socklen_t valsize = sizeof(val); |
58 | 58 |
|
59 |
dprintf("connect completed\n");
|
|
59 |
DPRINTF("connect completed\n");
|
|
60 | 60 |
do { |
61 | 61 |
ret = getsockopt(s->fd, SOL_SOCKET, SO_ERROR, (void *) &val, &valsize); |
62 | 62 |
} while (ret == -1 && (s->get_error(s)) == EINTR); |
... | ... | |
71 | 71 |
if (val == 0) |
72 | 72 |
migrate_fd_connect(s); |
73 | 73 |
else { |
74 |
dprintf("error connecting %d\n", val);
|
|
74 |
DPRINTF("error connecting %d\n", val);
|
|
75 | 75 |
migrate_fd_error(s); |
76 | 76 |
} |
77 | 77 |
} |
... | ... | |
127 | 127 |
} while (ret == -EINTR); |
128 | 128 |
|
129 | 129 |
if (ret < 0 && ret != -EINPROGRESS && ret != -EWOULDBLOCK) { |
130 |
dprintf("connect failed\n");
|
|
130 |
DPRINTF("connect failed\n");
|
|
131 | 131 |
close(s->fd); |
132 | 132 |
qemu_free(s); |
133 | 133 |
return NULL; |
... | ... | |
149 | 149 |
c = qemu_accept(s, (struct sockaddr *)&addr, &addrlen); |
150 | 150 |
} while (c == -1 && socket_error() == EINTR); |
151 | 151 |
|
152 |
dprintf("accepted migration\n");
|
|
152 |
DPRINTF("accepted migration\n");
|
|
153 | 153 |
|
154 | 154 |
if (c == -1) { |
155 | 155 |
fprintf(stderr, "could not accept migration connection\n"); |
... | ... | |
168 | 168 |
goto out_fopen; |
169 | 169 |
} |
170 | 170 |
qemu_announce_self(); |
171 |
dprintf("successfully loaded vm state\n");
|
|
171 |
DPRINTF("successfully loaded vm state\n");
|
|
172 | 172 |
|
173 | 173 |
/* we've successfully migrated, close the server socket */ |
174 | 174 |
qemu_set_fd_handler2(s, NULL, NULL, NULL, NULL); |
b/migration-unix.c | ||
---|---|---|
22 | 22 |
//#define DEBUG_MIGRATION_UNIX |
23 | 23 |
|
24 | 24 |
#ifdef DEBUG_MIGRATION_UNIX |
25 |
#define dprintf(fmt, ...) \
|
|
25 |
#define DPRINTF(fmt, ...) \
|
|
26 | 26 |
do { printf("migration-unix: " fmt, ## __VA_ARGS__); } while (0) |
27 | 27 |
#else |
28 |
#define dprintf(fmt, ...) \
|
|
28 |
#define DPRINTF(fmt, ...) \
|
|
29 | 29 |
do { } while (0) |
30 | 30 |
#endif |
31 | 31 |
|
... | ... | |
41 | 41 |
|
42 | 42 |
static int unix_close(FdMigrationState *s) |
43 | 43 |
{ |
44 |
dprintf("unix_close\n");
|
|
44 |
DPRINTF("unix_close\n");
|
|
45 | 45 |
if (s->fd != -1) { |
46 | 46 |
close(s->fd); |
47 | 47 |
s->fd = -1; |
... | ... | |
55 | 55 |
int val, ret; |
56 | 56 |
socklen_t valsize = sizeof(val); |
57 | 57 |
|
58 |
dprintf("connect completed\n");
|
|
58 |
DPRINTF("connect completed\n");
|
|
59 | 59 |
do { |
60 | 60 |
ret = getsockopt(s->fd, SOL_SOCKET, SO_ERROR, (void *) &val, &valsize); |
61 | 61 |
} while (ret == -1 && (s->get_error(s)) == EINTR); |
... | ... | |
70 | 70 |
if (val == 0) |
71 | 71 |
migrate_fd_connect(s); |
72 | 72 |
else { |
73 |
dprintf("error connecting %d\n", val);
|
|
73 |
DPRINTF("error connecting %d\n", val);
|
|
74 | 74 |
migrate_fd_error(s); |
75 | 75 |
} |
76 | 76 |
} |
... | ... | |
106 | 106 |
s->bandwidth_limit = bandwidth_limit; |
107 | 107 |
s->fd = qemu_socket(PF_UNIX, SOCK_STREAM, 0); |
108 | 108 |
if (s->fd < 0) { |
109 |
dprintf("Unable to open socket");
|
|
109 |
DPRINTF("Unable to open socket");
|
|
110 | 110 |
goto err_after_alloc; |
111 | 111 |
} |
112 | 112 |
|
... | ... | |
122 | 122 |
} while (ret == -EINTR); |
123 | 123 |
|
124 | 124 |
if (ret < 0 && ret != -EINPROGRESS && ret != -EWOULDBLOCK) { |
125 |
dprintf("connect failed\n");
|
|
125 |
DPRINTF("connect failed\n");
|
|
126 | 126 |
goto err_after_open; |
127 | 127 |
} |
128 | 128 |
|
... | ... | |
155 | 155 |
c = qemu_accept(s, (struct sockaddr *)&addr, &addrlen); |
156 | 156 |
} while (c == -1 && socket_error() == EINTR); |
157 | 157 |
|
158 |
dprintf("accepted migration\n");
|
|
158 |
DPRINTF("accepted migration\n");
|
|
159 | 159 |
|
160 | 160 |
if (c == -1) { |
161 | 161 |
fprintf(stderr, "could not accept migration connection\n"); |
... | ... | |
174 | 174 |
goto out_fopen; |
175 | 175 |
} |
176 | 176 |
qemu_announce_self(); |
177 |
dprintf("successfully loaded vm state\n");
|
|
177 |
DPRINTF("successfully loaded vm state\n");
|
|
178 | 178 |
|
179 | 179 |
/* we've successfully migrated, close the server socket */ |
180 | 180 |
qemu_set_fd_handler2(s, NULL, NULL, NULL, NULL); |
... | ... | |
191 | 191 |
struct sockaddr_un un; |
192 | 192 |
int sock; |
193 | 193 |
|
194 |
dprintf("Attempting to start an incoming migration\n");
|
|
194 |
DPRINTF("Attempting to start an incoming migration\n");
|
|
195 | 195 |
|
196 | 196 |
sock = qemu_socket(PF_UNIX, SOCK_STREAM, 0); |
197 | 197 |
if (sock < 0) { |
b/migration.c | ||
---|---|---|
24 | 24 |
//#define DEBUG_MIGRATION |
25 | 25 |
|
26 | 26 |
#ifdef DEBUG_MIGRATION |
27 |
#define dprintf(fmt, ...) \
|
|
27 |
#define DPRINTF(fmt, ...) \
|
|
28 | 28 |
do { printf("migration: " fmt, ## __VA_ARGS__); } while (0) |
29 | 29 |
#else |
30 |
#define dprintf(fmt, ...) \
|
|
30 |
#define DPRINTF(fmt, ...) \
|
|
31 | 31 |
do { } while (0) |
32 | 32 |
#endif |
33 | 33 |
|
... | ... | |
268 | 268 |
{ |
269 | 269 |
s->mon = mon; |
270 | 270 |
if (monitor_suspend(mon) == 0) { |
271 |
dprintf("suspending monitor\n");
|
|
271 |
DPRINTF("suspending monitor\n");
|
|
272 | 272 |
} else { |
273 | 273 |
monitor_printf(mon, "terminal does not allow synchronous " |
274 | 274 |
"migration, continuing detached\n"); |
... | ... | |
277 | 277 |
|
278 | 278 |
void migrate_fd_error(FdMigrationState *s) |
279 | 279 |
{ |
280 |
dprintf("setting error state\n");
|
|
280 |
DPRINTF("setting error state\n");
|
|
281 | 281 |
s->state = MIG_STATE_ERROR; |
282 | 282 |
migrate_fd_cleanup(s); |
283 | 283 |
} |
... | ... | |
287 | 287 |
qemu_set_fd_handler2(s->fd, NULL, NULL, NULL, NULL); |
288 | 288 |
|
289 | 289 |
if (s->file) { |
290 |
dprintf("closing file\n");
|
|
290 |
DPRINTF("closing file\n");
|
|
291 | 291 |
qemu_fclose(s->file); |
292 | 292 |
s->file = NULL; |
293 | 293 |
} |
... | ... | |
340 | 340 |
migrate_fd_wait_for_unfreeze, |
341 | 341 |
migrate_fd_close); |
342 | 342 |
|
343 |
dprintf("beginning savevm\n");
|
|
343 |
DPRINTF("beginning savevm\n");
|
|
344 | 344 |
ret = qemu_savevm_state_begin(s->mon, s->file, s->mig_state.blk, |
345 | 345 |
s->mig_state.shared); |
346 | 346 |
if (ret < 0) { |
347 |
dprintf("failed, %d\n", ret);
|
|
347 |
DPRINTF("failed, %d\n", ret);
|
|
348 | 348 |
migrate_fd_error(s); |
349 | 349 |
return; |
350 | 350 |
} |
... | ... | |
357 | 357 |
FdMigrationState *s = opaque; |
358 | 358 |
|
359 | 359 |
if (s->state != MIG_STATE_ACTIVE) { |
360 |
dprintf("put_ready returning because of non-active state\n");
|
|
360 |
DPRINTF("put_ready returning because of non-active state\n");
|
|
361 | 361 |
return; |
362 | 362 |
} |
363 | 363 |
|
364 |
dprintf("iterate\n");
|
|
364 |
DPRINTF("iterate\n");
|
|
365 | 365 |
if (qemu_savevm_state_iterate(s->mon, s->file) == 1) { |
366 | 366 |
int state; |
367 | 367 |
int old_vm_running = vm_running; |
368 | 368 |
|
369 |
dprintf("done iterating\n");
|
|
369 |
DPRINTF("done iterating\n");
|
|
370 | 370 |
vm_stop(0); |
371 | 371 |
|
372 | 372 |
qemu_aio_flush(); |
... | ... | |
397 | 397 |
if (s->state != MIG_STATE_ACTIVE) |
398 | 398 |
return; |
399 | 399 |
|
400 |
dprintf("cancelling migration\n");
|
|
400 |
DPRINTF("cancelling migration\n");
|
|
401 | 401 |
|
402 | 402 |
s->state = MIG_STATE_CANCELLED; |
403 | 403 |
qemu_savevm_state_cancel(s->mon, s->file); |
... | ... | |
409 | 409 |
{ |
410 | 410 |
FdMigrationState *s = migrate_to_fms(mig_state); |
411 | 411 |
|
412 |
dprintf("releasing state\n");
|
|
412 |
DPRINTF("releasing state\n");
|
|
413 | 413 |
|
414 | 414 |
if (s->state == MIG_STATE_ACTIVE) { |
415 | 415 |
s->state = MIG_STATE_CANCELLED; |
... | ... | |
423 | 423 |
FdMigrationState *s = opaque; |
424 | 424 |
int ret; |
425 | 425 |
|
426 |
dprintf("wait for unfreeze\n");
|
|
426 |
DPRINTF("wait for unfreeze\n");
|
|
427 | 427 |
if (s->state != MIG_STATE_ACTIVE) |
428 | 428 |
return; |
429 | 429 |
|
b/slirp/bootp.c | ||
---|---|---|
30 | 30 |
static const uint8_t rfc1533_cookie[] = { RFC1533_COOKIE }; |
31 | 31 |
|
32 | 32 |
#ifdef DEBUG |
33 |
#define dprintf(fmt, ...) \
|
|
33 |
#define DPRINTF(fmt, ...) \
|
|
34 | 34 |
do if (slirp_debug & DBG_CALL) { fprintf(dfd, fmt, ## __VA_ARGS__); fflush(dfd); } while (0) |
35 | 35 |
#else |
36 |
#define dprintf(fmt, ...)
|
|
36 |
#define DPRINTF(fmt, ...)
|
|
37 | 37 |
#endif |
38 | 38 |
|
39 | 39 |
static BOOTPClient *get_new_addr(Slirp *slirp, struct in_addr *paddr, |
... | ... | |
116 | 116 |
if (p >= p_end) |
117 | 117 |
break; |
118 | 118 |
len = *p++; |
119 |
dprintf("dhcp: tag=%d len=%d\n", tag, len);
|
|
119 |
DPRINTF("dhcp: tag=%d len=%d\n", tag, len);
|
|
120 | 120 |
|
121 | 121 |
switch(tag) { |
122 | 122 |
case RFC2132_MSG_TYPE: |
... | ... | |
150 | 150 |
|
151 | 151 |
/* extract exact DHCP msg type */ |
152 | 152 |
dhcp_decode(bp, &dhcp_msg_type, &preq_addr); |
153 |
dprintf("bootp packet op=%d msgtype=%d", bp->bp_op, dhcp_msg_type);
|
|
153 |
DPRINTF("bootp packet op=%d msgtype=%d", bp->bp_op, dhcp_msg_type);
|
|
154 | 154 |
if (preq_addr) |
155 |
dprintf(" req_addr=%08x\n", ntohl(preq_addr->s_addr));
|
|
155 |
DPRINTF(" req_addr=%08x\n", ntohl(preq_addr->s_addr));
|
|
156 | 156 |
else |
157 |
dprintf("\n");
|
|
157 |
DPRINTF("\n");
|
|
158 | 158 |
|
159 | 159 |
if (dhcp_msg_type == 0) |
160 | 160 |
dhcp_msg_type = DHCPREQUEST; /* Force reply for old BOOTP clients */ |
... | ... | |
185 | 185 |
new_addr: |
186 | 186 |
bc = get_new_addr(slirp, &daddr.sin_addr, slirp->client_ethaddr); |
187 | 187 |
if (!bc) { |
188 |
dprintf("no address left\n");
|
|
188 |
DPRINTF("no address left\n");
|
|
189 | 189 |
return; |
190 | 190 |
} |
191 | 191 |
} |
... | ... | |
226 | 226 |
q += 4; |
227 | 227 |
|
228 | 228 |
if (bc) { |
229 |
dprintf("%s addr=%08x\n",
|
|
229 |
DPRINTF("%s addr=%08x\n",
|
|
230 | 230 |
(dhcp_msg_type == DHCPDISCOVER) ? "offered" : "ack'ed", |
231 | 231 |
ntohl(daddr.sin_addr.s_addr)); |
232 | 232 |
|
... | ... | |
282 | 282 |
} else { |
283 | 283 |
static const char nak_msg[] = "requested address not available"; |
284 | 284 |
|
285 |
dprintf("nak'ed addr=%08x\n", ntohl(preq_addr->s_addr));
|
|
285 |
DPRINTF("nak'ed addr=%08x\n", ntohl(preq_addr->s_addr));
|
|
286 | 286 |
|
287 | 287 |
*q++ = RFC2132_MSG_TYPE; |
288 | 288 |
*q++ = 1; |
b/usb-linux.c | ||
---|---|---|
68 | 68 |
//#define DEBUG |
69 | 69 |
|
70 | 70 |
#ifdef DEBUG |
71 |
#define dprintf printf
|
|
71 |
#define DPRINTF printf
|
|
72 | 72 |
#else |
73 |
#define dprintf(...)
|
|
73 |
#define DPRINTF(...)
|
|
74 | 74 |
#endif |
75 | 75 |
|
76 | 76 |
#define USBDBG_DEVOPENED "husb: opened %s/devices\n" |
... | ... | |
234 | 234 |
return; |
235 | 235 |
} |
236 | 236 |
|
237 |
dprintf("husb: async. reap urb failed errno %d\n", errno);
|
|
237 |
DPRINTF("husb: async. reap urb failed errno %d\n", errno);
|
|
238 | 238 |
return; |
239 | 239 |
} |
240 | 240 |
|
241 | 241 |
p = aurb->packet; |
242 | 242 |
|
243 |
dprintf("husb: async completed. aurb %p status %d alen %d\n",
|
|
243 |
DPRINTF("husb: async completed. aurb %p status %d alen %d\n",
|
|
244 | 244 |
aurb, aurb->urb.status, aurb->urb.actual_length); |
245 | 245 |
|
246 | 246 |
if (p) { |
... | ... | |
273 | 273 |
AsyncURB *aurb = opaque; |
274 | 274 |
USBHostDevice *s = aurb->hdev; |
275 | 275 |
|
276 |
dprintf("husb: async cancel. aurb %p\n", aurb);
|
|
276 |
DPRINTF("husb: async cancel. aurb %p\n", aurb);
|
|
277 | 277 |
|
278 | 278 |
/* Mark it as dead (see async_complete above) */ |
279 | 279 |
aurb->packet = NULL; |
280 | 280 |
|
281 | 281 |
int r = ioctl(s->fd, USBDEVFS_DISCARDURB, aurb); |
282 | 282 |
if (r < 0) { |
283 |
dprintf("husb: async. discard urb failed errno %d\n", errno);
|
|
283 |
DPRINTF("husb: async. discard urb failed errno %d\n", errno);
|
|
284 | 284 |
} |
285 | 285 |
} |
286 | 286 |
|
... | ... | |
293 | 293 |
if (configuration == 0) /* address state - ignore */ |
294 | 294 |
return 1; |
295 | 295 |
|
296 |
dprintf("husb: claiming interfaces. config %d\n", configuration); |
Also available in: Unified diff