| .. | .. |
|---|
| 27 | 27 | #undef DEBUG /* Don't want a garbled console */ |
|---|
| 28 | 28 | #endif |
|---|
| 29 | 29 | |
|---|
| 30 | | -#ifdef DEBUG |
|---|
| 31 | | -#define DPRINTK(stuff...) printk (stuff) |
|---|
| 32 | | -#else |
|---|
| 33 | | -#define DPRINTK(stuff...) |
|---|
| 34 | | -#endif |
|---|
| 35 | | - |
|---|
| 36 | 30 | /*** * |
|---|
| 37 | 31 | * One-way data transfer functions. * |
|---|
| 38 | 32 | * ***/ |
|---|
| .. | .. |
|---|
| 115 | 109 | if (signal_pending (current)) |
|---|
| 116 | 110 | break; |
|---|
| 117 | 111 | |
|---|
| 118 | | - DPRINTK (KERN_DEBUG "%s: Timed out\n", port->name); |
|---|
| 112 | + pr_debug("%s: Timed out\n", port->name); |
|---|
| 119 | 113 | break; |
|---|
| 120 | 114 | |
|---|
| 121 | 115 | ready: |
|---|
| .. | .. |
|---|
| 178 | 172 | if (parport_wait_peripheral (port, |
|---|
| 179 | 173 | PARPORT_STATUS_ACK, 0)) { |
|---|
| 180 | 174 | /* Timeout -- no more data? */ |
|---|
| 181 | | - DPRINTK (KERN_DEBUG |
|---|
| 182 | | - "%s: Nibble timeout at event 9 (%d bytes)\n", |
|---|
| 183 | | - port->name, i/2); |
|---|
| 175 | + pr_debug("%s: Nibble timeout at event 9 (%d bytes)\n", |
|---|
| 176 | + port->name, i / 2); |
|---|
| 184 | 177 | parport_frob_control (port, PARPORT_CONTROL_AUTOFD, 0); |
|---|
| 185 | 178 | break; |
|---|
| 186 | 179 | } |
|---|
| .. | .. |
|---|
| 201 | 194 | PARPORT_STATUS_ACK, |
|---|
| 202 | 195 | PARPORT_STATUS_ACK)) { |
|---|
| 203 | 196 | /* Timeout -- no more data? */ |
|---|
| 204 | | - DPRINTK (KERN_DEBUG |
|---|
| 205 | | - "%s: Nibble timeout at event 11\n", |
|---|
| 197 | + pr_debug("%s: Nibble timeout at event 11\n", |
|---|
| 206 | 198 | port->name); |
|---|
| 207 | 199 | break; |
|---|
| 208 | 200 | } |
|---|
| .. | .. |
|---|
| 219 | 211 | /* Read the last nibble without checking data avail. */ |
|---|
| 220 | 212 | if (parport_read_status (port) & PARPORT_STATUS_ERROR) { |
|---|
| 221 | 213 | end_of_data: |
|---|
| 222 | | - DPRINTK (KERN_DEBUG |
|---|
| 223 | | - "%s: No more nibble data (%d bytes)\n", |
|---|
| 224 | | - port->name, i/2); |
|---|
| 214 | + pr_debug("%s: No more nibble data (%d bytes)\n", |
|---|
| 215 | + port->name, i / 2); |
|---|
| 225 | 216 | |
|---|
| 226 | 217 | /* Go to reverse idle phase. */ |
|---|
| 227 | 218 | parport_frob_control (port, |
|---|
| .. | .. |
|---|
| 272 | 263 | /* Timeout -- no more data? */ |
|---|
| 273 | 264 | parport_frob_control (port, PARPORT_CONTROL_AUTOFD, |
|---|
| 274 | 265 | 0); |
|---|
| 275 | | - DPRINTK (KERN_DEBUG "%s: Byte timeout at event 9\n", |
|---|
| 276 | | - port->name); |
|---|
| 266 | + pr_debug("%s: Byte timeout at event 9\n", port->name); |
|---|
| 277 | 267 | break; |
|---|
| 278 | 268 | } |
|---|
| 279 | 269 | |
|---|
| .. | .. |
|---|
| 288 | 278 | PARPORT_STATUS_ACK, |
|---|
| 289 | 279 | PARPORT_STATUS_ACK)) { |
|---|
| 290 | 280 | /* Timeout -- no more data? */ |
|---|
| 291 | | - DPRINTK (KERN_DEBUG "%s: Byte timeout at event 11\n", |
|---|
| 292 | | - port->name); |
|---|
| 281 | + pr_debug("%s: Byte timeout at event 11\n", port->name); |
|---|
| 293 | 282 | break; |
|---|
| 294 | 283 | } |
|---|
| 295 | 284 | |
|---|
| .. | .. |
|---|
| 307 | 296 | /* Read the last byte without checking data avail. */ |
|---|
| 308 | 297 | if (parport_read_status (port) & PARPORT_STATUS_ERROR) { |
|---|
| 309 | 298 | end_of_data: |
|---|
| 310 | | - DPRINTK (KERN_DEBUG |
|---|
| 311 | | - "%s: No more byte data (%zd bytes)\n", |
|---|
| 299 | + pr_debug("%s: No more byte data (%zd bytes)\n", |
|---|
| 312 | 300 | port->name, count); |
|---|
| 313 | 301 | |
|---|
| 314 | 302 | /* Go to reverse idle phase. */ |
|---|
| .. | .. |
|---|
| 353 | 341 | PARPORT_STATUS_PAPEROUT, 0); |
|---|
| 354 | 342 | |
|---|
| 355 | 343 | if (!retval) { |
|---|
| 356 | | - DPRINTK (KERN_DEBUG "%s: ECP direction: reverse\n", |
|---|
| 357 | | - port->name); |
|---|
| 344 | + pr_debug("%s: ECP direction: reverse\n", port->name); |
|---|
| 358 | 345 | port->ieee1284.phase = IEEE1284_PH_REV_IDLE; |
|---|
| 359 | 346 | } else { |
|---|
| 360 | | - DPRINTK (KERN_DEBUG "%s: ECP direction: failed to reverse\n", |
|---|
| 361 | | - port->name); |
|---|
| 347 | + pr_debug("%s: ECP direction: failed to reverse\n", port->name); |
|---|
| 362 | 348 | port->ieee1284.phase = IEEE1284_PH_ECP_DIR_UNKNOWN; |
|---|
| 363 | 349 | } |
|---|
| 364 | 350 | |
|---|
| .. | .. |
|---|
| 384 | 370 | |
|---|
| 385 | 371 | if (!retval) { |
|---|
| 386 | 372 | parport_data_forward (port); |
|---|
| 387 | | - DPRINTK (KERN_DEBUG "%s: ECP direction: forward\n", |
|---|
| 388 | | - port->name); |
|---|
| 373 | + pr_debug("%s: ECP direction: forward\n", port->name); |
|---|
| 389 | 374 | port->ieee1284.phase = IEEE1284_PH_FWD_IDLE; |
|---|
| 390 | 375 | } else { |
|---|
| 391 | | - DPRINTK (KERN_DEBUG |
|---|
| 392 | | - "%s: ECP direction: failed to switch forward\n", |
|---|
| 376 | + pr_debug("%s: ECP direction: failed to switch forward\n", |
|---|
| 393 | 377 | port->name); |
|---|
| 394 | 378 | port->ieee1284.phase = IEEE1284_PH_ECP_DIR_UNKNOWN; |
|---|
| 395 | 379 | } |
|---|
| .. | .. |
|---|
| 450 | 434 | } |
|---|
| 451 | 435 | |
|---|
| 452 | 436 | /* Time for Host Transfer Recovery (page 41 of IEEE1284) */ |
|---|
| 453 | | - DPRINTK (KERN_DEBUG "%s: ECP transfer stalled!\n", port->name); |
|---|
| 437 | + pr_debug("%s: ECP transfer stalled!\n", port->name); |
|---|
| 454 | 438 | |
|---|
| 455 | 439 | parport_frob_control (port, PARPORT_CONTROL_INIT, |
|---|
| 456 | 440 | PARPORT_CONTROL_INIT); |
|---|
| .. | .. |
|---|
| 466 | 450 | if (!(parport_read_status (port) & PARPORT_STATUS_PAPEROUT)) |
|---|
| 467 | 451 | break; |
|---|
| 468 | 452 | |
|---|
| 469 | | - DPRINTK (KERN_DEBUG "%s: Host transfer recovered\n", |
|---|
| 470 | | - port->name); |
|---|
| 453 | + pr_debug("%s: Host transfer recovered\n", port->name); |
|---|
| 471 | 454 | |
|---|
| 472 | 455 | if (time_after_eq (jiffies, expire)) break; |
|---|
| 473 | 456 | goto try_again; |
|---|
| .. | .. |
|---|
| 565 | 548 | command or a normal data byte, don't accept it. */ |
|---|
| 566 | 549 | if (command) { |
|---|
| 567 | 550 | if (byte & 0x80) { |
|---|
| 568 | | - DPRINTK (KERN_DEBUG "%s: stopping short at " |
|---|
| 569 | | - "channel command (%02x)\n", |
|---|
| 551 | + pr_debug("%s: stopping short at channel command (%02x)\n", |
|---|
| 570 | 552 | port->name, byte); |
|---|
| 571 | 553 | goto out; |
|---|
| 572 | 554 | } |
|---|
| 573 | 555 | else if (port->ieee1284.mode != IEEE1284_MODE_ECPRLE) |
|---|
| 574 | | - DPRINTK (KERN_DEBUG "%s: device illegally " |
|---|
| 575 | | - "using RLE; accepting anyway\n", |
|---|
| 556 | + pr_debug("%s: device illegally using RLE; accepting anyway\n", |
|---|
| 576 | 557 | port->name); |
|---|
| 577 | 558 | |
|---|
| 578 | 559 | rle_count = byte + 1; |
|---|
| 579 | 560 | |
|---|
| 580 | 561 | /* Are we allowed to read that many bytes? */ |
|---|
| 581 | 562 | if (rle_count > (len - count)) { |
|---|
| 582 | | - DPRINTK (KERN_DEBUG "%s: leaving %d RLE bytes " |
|---|
| 583 | | - "for next time\n", port->name, |
|---|
| 584 | | - rle_count); |
|---|
| 563 | + pr_debug("%s: leaving %d RLE bytes for next time\n", |
|---|
| 564 | + port->name, rle_count); |
|---|
| 585 | 565 | break; |
|---|
| 586 | 566 | } |
|---|
| 587 | 567 | |
|---|
| .. | .. |
|---|
| 596 | 576 | PARPORT_STATUS_ACK)) { |
|---|
| 597 | 577 | /* It's gone wrong. Return what data we have |
|---|
| 598 | 578 | to the caller. */ |
|---|
| 599 | | - DPRINTK (KERN_DEBUG "ECP read timed out at 45\n"); |
|---|
| 579 | + pr_debug("ECP read timed out at 45\n"); |
|---|
| 600 | 580 | |
|---|
| 601 | 581 | if (command) |
|---|
| 602 | | - printk (KERN_WARNING |
|---|
| 603 | | - "%s: command ignored (%02x)\n", |
|---|
| 582 | + pr_warn("%s: command ignored (%02x)\n", |
|---|
| 604 | 583 | port->name, byte); |
|---|
| 605 | 584 | |
|---|
| 606 | 585 | break; |
|---|
| .. | .. |
|---|
| 620 | 599 | memset (buf, byte, rle_count); |
|---|
| 621 | 600 | buf += rle_count; |
|---|
| 622 | 601 | count += rle_count; |
|---|
| 623 | | - DPRINTK (KERN_DEBUG "%s: decompressed to %d bytes\n", |
|---|
| 602 | + pr_debug("%s: decompressed to %d bytes\n", |
|---|
| 624 | 603 | port->name, rle_count); |
|---|
| 625 | 604 | } else { |
|---|
| 626 | 605 | /* Normal data byte. */ |
|---|
| .. | .. |
|---|
| 686 | 665 | } |
|---|
| 687 | 666 | |
|---|
| 688 | 667 | /* Time for Host Transfer Recovery (page 41 of IEEE1284) */ |
|---|
| 689 | | - DPRINTK (KERN_DEBUG "%s: ECP transfer stalled!\n", port->name); |
|---|
| 668 | + pr_debug("%s: ECP transfer stalled!\n", port->name); |
|---|
| 690 | 669 | |
|---|
| 691 | 670 | parport_frob_control (port, PARPORT_CONTROL_INIT, |
|---|
| 692 | 671 | PARPORT_CONTROL_INIT); |
|---|
| .. | .. |
|---|
| 702 | 681 | if (!(parport_read_status (port) & PARPORT_STATUS_PAPEROUT)) |
|---|
| 703 | 682 | break; |
|---|
| 704 | 683 | |
|---|
| 705 | | - DPRINTK (KERN_DEBUG "%s: Host transfer recovered\n", |
|---|
| 706 | | - port->name); |
|---|
| 684 | + pr_debug("%s: Host transfer recovered\n", port->name); |
|---|
| 707 | 685 | |
|---|
| 708 | 686 | if (time_after_eq (jiffies, expire)) break; |
|---|
| 709 | 687 | goto try_again; |
|---|