diff options
author | Jiri Slaby <jirislaby@gmail.com> | 2008-04-30 03:53:54 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-04-30 11:29:44 -0400 |
commit | cf1c63c3e68679dcac1cc6a37e619d9106ebc0ca (patch) | |
tree | d34d5ad3a81310fbdcf60b70e4abb1d046544dc6 /drivers/char/ip2/i2ellis.h | |
parent | 83e422b7649267067975cbb17a878b5f9dfd2de3 (diff) |
Char: ip2, macros cleanup
- remove i2os.h -- there was only macro to macro renaming or useless
stuff
- remove another uselless stuf (NULLFUNC, NULLPTR, YES, NO)
- use outb/inb directly
- use locking functions directly
- don't define another ROUNDUP, use roundup(x, 2) instead
- some comments and whitespace cleanup
- remove some commented crap
- prepend the rest by I2 prefix to not collide with rest of the world
like in following output (pointed out by akpm)
In file included from drivers/char/ip2/ip2main.c:128:
drivers/char/ip2/i2ellis.h:608:1: warning: "COMPLETE" redefined
In file included from include/net/netns/ipv4.h:8,
from include/net/net_namespace.h:13,
from include/linux/seq_file.h:7,
from include/asm/machdep.h:12,
from include/asm/pci.h:17,
from include/linux/pci.h:951,
from drivers/char/ip2/ip2main.c:95:
include/net/inet_frag.h:28:1: warning: this is the location of the previous definition
Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/char/ip2/i2ellis.h')
-rw-r--r-- | drivers/char/ip2/i2ellis.h | 58 |
1 files changed, 6 insertions, 52 deletions
diff --git a/drivers/char/ip2/i2ellis.h b/drivers/char/ip2/i2ellis.h index 433305062fb8..c88a64e527aa 100644 --- a/drivers/char/ip2/i2ellis.h +++ b/drivers/char/ip2/i2ellis.h | |||
@@ -185,10 +185,6 @@ typedef struct _i2eBordStr | |||
185 | // The highest allowable IRQ, based on the | 185 | // The highest allowable IRQ, based on the |
186 | // slot size. | 186 | // slot size. |
187 | 187 | ||
188 | unsigned char i2eChangeIrq; | ||
189 | // Whether tis valid to change IRQ's | ||
190 | // ISA = ok, EISA, MicroChannel, no | ||
191 | |||
192 | // Accelerators for various addresses on the board | 188 | // Accelerators for various addresses on the board |
193 | int i2eBase; // I/O Address of the Board | 189 | int i2eBase; // I/O Address of the Board |
194 | int i2eData; // From here data transfers happen | 190 | int i2eData; // From here data transfers happen |
@@ -431,12 +427,6 @@ typedef struct _i2eBordStr | |||
431 | // Manifests for i2eBordStr: | 427 | // Manifests for i2eBordStr: |
432 | //------------------------------------------- | 428 | //------------------------------------------- |
433 | 429 | ||
434 | #define YES 1 | ||
435 | #define NO 0 | ||
436 | |||
437 | #define NULLFUNC (void (*)(void))0 | ||
438 | #define NULLPTR (void *)0 | ||
439 | |||
440 | typedef void (*delayFunc_t)(unsigned int); | 430 | typedef void (*delayFunc_t)(unsigned int); |
441 | 431 | ||
442 | // i2eValid | 432 | // i2eValid |
@@ -494,8 +484,8 @@ typedef void (*delayFunc_t)(unsigned int); | |||
494 | 484 | ||
495 | // i2eUsingIrq | 485 | // i2eUsingIrq |
496 | // | 486 | // |
497 | #define IRQ_UNDEFINED 0x1352 // No valid irq (or polling = 0) can ever | 487 | #define I2_IRQ_UNDEFINED 0x1352 /* No valid irq (or polling = 0) can |
498 | // promote to this! | 488 | * ever promote to this! */ |
499 | //------------------------------------------ | 489 | //------------------------------------------ |
500 | // Handy Macros for i2ellis.c and others | 490 | // Handy Macros for i2ellis.c and others |
501 | // Note these are common to -II and -IIEX | 491 | // Note these are common to -II and -IIEX |
@@ -504,41 +494,14 @@ typedef void (*delayFunc_t)(unsigned int); | |||
504 | // Given a pointer to the board structure, does the input FIFO have any data or | 494 | // Given a pointer to the board structure, does the input FIFO have any data or |
505 | // not? | 495 | // not? |
506 | // | 496 | // |
507 | #define HAS_INPUT(pB) !(INB(pB->i2eStatus) & ST_IN_EMPTY) | 497 | #define I2_HAS_INPUT(pB) !(inb(pB->i2eStatus) & ST_IN_EMPTY) |
508 | #define HAS_NO_INPUT(pB) (INB(pB->i2eStatus) & ST_IN_EMPTY) | ||
509 | |||
510 | // Given a pointer to board structure, read a byte or word from the fifo | ||
511 | // | ||
512 | #define BYTE_FROM(pB) (unsigned char)INB(pB->i2eData) | ||
513 | #define WORD_FROM(pB) (unsigned short)INW(pB->i2eData) | ||
514 | |||
515 | // Given a pointer to board structure, is there room for any data to be written | ||
516 | // to the data fifo? | ||
517 | // | ||
518 | #define HAS_OUTROOM(pB) !(INB(pB->i2eStatus) & ST_OUT_FULL) | ||
519 | #define HAS_NO_OUTROOM(pB) (INB(pB->i2eStatus) & ST_OUT_FULL) | ||
520 | |||
521 | // Given a pointer to board structure, write a single byte to the fifo | ||
522 | // structure. Note that for 16-bit interfaces, the high order byte is undefined | ||
523 | // and unknown. | ||
524 | // | ||
525 | #define BYTE_TO(pB, c) OUTB(pB->i2eData,(c)) | ||
526 | |||
527 | // Write a word to the fifo structure. For 8-bit interfaces, this may have | ||
528 | // unknown results. | ||
529 | // | ||
530 | #define WORD_TO(pB, c) OUTW(pB->i2eData,(c)) | ||
531 | 498 | ||
532 | // Given a pointer to the board structure, is there anything in the incoming | 499 | // Given a pointer to the board structure, is there anything in the incoming |
533 | // mailbox? | 500 | // mailbox? |
534 | // | 501 | // |
535 | #define HAS_MAIL(pB) (INB(pB->i2eStatus) & ST_IN_MAIL) | 502 | #define I2_HAS_MAIL(pB) (inb(pB->i2eStatus) & ST_IN_MAIL) |
536 | 503 | ||
537 | #define UPDATE_FIFO_ROOM(pB) (pB)->i2eFifoRemains=(pB)->i2eFifoSize | 504 | #define I2_UPDATE_FIFO_ROOM(pB) ((pB)->i2eFifoRemains = (pB)->i2eFifoSize) |
538 | |||
539 | // Handy macro to round up a number (like the buffer write and read routines do) | ||
540 | // | ||
541 | #define ROUNDUP(number) (((number)+1) & (~1)) | ||
542 | 505 | ||
543 | //------------------------------------------ | 506 | //------------------------------------------ |
544 | // Function Declarations for i2ellis.c | 507 | // Function Declarations for i2ellis.c |
@@ -593,20 +556,11 @@ static int iiDownloadBlock(i2eBordStrPtr, loadHdrStrPtr, int); | |||
593 | // | 556 | // |
594 | static int iiDownloadAll(i2eBordStrPtr, loadHdrStrPtr, int, int); | 557 | static int iiDownloadAll(i2eBordStrPtr, loadHdrStrPtr, int, int); |
595 | 558 | ||
596 | // Called indirectly always. Needed externally so the routine might be | ||
597 | // SPECIFIED as an argument to iiReset() | ||
598 | // | ||
599 | //static void ii2DelayIO(unsigned int); // N-millisecond delay using | ||
600 | //hardware spin | ||
601 | //static void ii2DelayTimer(unsigned int); // N-millisecond delay using Linux | ||
602 | //timer | ||
603 | |||
604 | // Many functions defined here return True if good, False otherwise, with an | 559 | // Many functions defined here return True if good, False otherwise, with an |
605 | // error code in i2eError field. Here is a handy macro for setting the error | 560 | // error code in i2eError field. Here is a handy macro for setting the error |
606 | // code and returning. | 561 | // code and returning. |
607 | // | 562 | // |
608 | #define COMPLETE(pB,code) \ | 563 | #define I2_COMPLETE(pB,code) do { \ |
609 | do { \ | ||
610 | pB->i2eError = code; \ | 564 | pB->i2eError = code; \ |
611 | return (code == I2EE_GOOD);\ | 565 | return (code == I2EE_GOOD);\ |
612 | } while (0) | 566 | } while (0) |