string: factorize skip_spaces and export it to be generally available
[safe/jmp/linux-2.6] / include / linux / cyclades.h
index 06b2725..a5049ea 100644 (file)
@@ -82,9 +82,9 @@ struct cyclades_monitor {
  * open)
  */
 struct cyclades_idle_stats {
-    time_t        in_use;      /* Time device has been in use (secs) */
-    time_t        recv_idle;   /* Time since last char received (secs) */
-    time_t        xmit_idle;   /* Time since last char transmitted (secs) */
+    __kernel_time_t in_use;    /* Time device has been in use (secs) */
+    __kernel_time_t recv_idle; /* Time since last char received (secs) */
+    __kernel_time_t xmit_idle; /* Time since last char transmitted (secs) */
     unsigned long  recv_bytes; /* Bytes received */
     unsigned long  xmit_bytes; /* Bytes transmitted */
     unsigned long  overruns;   /* Input overruns */
@@ -142,21 +142,6 @@ struct CYZ_BOOT_CTRL {
 
 
 #ifndef DP_WINDOW_SIZE
-/* #include "cyclomz.h" */
-/****************** ****************** *******************/
-/*
- *     The data types defined below are used in all ZFIRM interface
- *     data structures. They accomodate differences between HW
- *     architectures and compilers.
- */
-
-#include <asm/types.h>
-
-typedef __u64  ucdouble;               /* 64 bits, unsigned */
-typedef __u32  uclong;                 /* 32 bits, unsigned */
-typedef __u16  ucshort;                /* 16 bits, unsigned */
-typedef __u8   ucchar;                 /* 8 bits, unsigned */
-
 /*
  *     Memory Window Sizes
  */
@@ -177,7 +162,7 @@ struct      CUSTOM_REG {
        __u32   fpga_version;           /* FPGA Version Number Register */
        __u32   cpu_start;              /* CPU start Register (write) */
        __u32   cpu_stop;               /* CPU stop Register (write) */
-       __u32   misc_reg;               /* Miscelaneous Register */
+       __u32   misc_reg;               /* Miscellaneous Register */
        __u32   idt_mode;               /* IDT mode Register */
        __u32   uart_irq_status;        /* UART IRQ status Register */
        __u32   clear_timer0_irq;       /* Clear timer interrupt Register */
@@ -509,16 +494,21 @@ struct ZFW_CTRL {
 
 /* Per card data structure */
 struct cyclades_card {
-    void __iomem *base_addr;
-    void __iomem *ctl_addr;
-    int irq;
-    int num_chips;     /* 0 if card absent, -1 if Z/PCI, else Y */
-    int first_line;    /* minor number of first channel on card */
-    int nports;                /* Number of ports in the card */
-    int bus_index;     /* address shift - 0 for ISA, 1 for PCI */
-    int        intr_enabled;   /* FW Interrupt flag - 0 disabled, 1 enabled */
-    spinlock_t card_lock;
-    struct cyclades_port *ports;
+       void __iomem *base_addr;
+       union {
+               void __iomem *p9050;
+               struct RUNTIME_9060 __iomem *p9060;
+       } ctl_addr;
+       struct BOARD_CTRL __iomem *board_ctrl;  /* cyz specific */
+       int irq;
+       unsigned int num_chips; /* 0 if card absent, -1 if Z/PCI, else Y */
+       unsigned int first_line;        /* minor number of first channel on card */
+       unsigned int nports;    /* Number of ports in the card */
+       int bus_index;          /* address shift - 0 for ISA, 1 for PCI */
+       int intr_enabled;               /* FW Interrupt flag - 0 disabled, 1 enabled */
+       u32 hw_ver;
+       spinlock_t card_lock;
+       struct cyclades_port *ports;
 };
 
 /***************************************
@@ -550,11 +540,20 @@ struct cyclades_icount {
 
 struct cyclades_port {
        int                     magic;
+       struct tty_port         port;
        struct cyclades_card    *card;
+       union {
+               struct {
+                       void __iomem *base_addr;
+               } cyy;
+               struct {
+                       struct CH_CTRL __iomem  *ch_ctrl;
+                       struct BUF_CTRL __iomem *buf_ctrl;
+               } cyz;
+       } u;
        int                     line;
        int                     flags;          /* defined in tty.h */
        int                     type;           /* UART type */
-       struct tty_struct       *tty;
        int                     read_status_mask;
        int                     ignore_status_mask;
        int                     timeout;
@@ -566,14 +565,9 @@ struct cyclades_port {
        int                     rtsdtr_inv;
        int                     chip_rev;
        int                     custom_divisor;
-       int                     x_char; /* to be pushed out ASAP */
-       int                     close_delay;
-       unsigned short          closing_wait;
-       int                     count;  /* # of fd on device */
+       u8                      x_char; /* to be pushed out ASAP */
        int                     breakon;
        int                     breakoff;
-       int                     blocked_open; /* # of blocked opens */
-       unsigned char           *xmit_buf;
        int                     xmit_head;
        int                     xmit_tail;
        int                     xmit_cnt;
@@ -583,16 +577,13 @@ struct cyclades_port {
        struct cyclades_monitor mon;
        struct cyclades_idle_stats      idle_stats;
        struct cyclades_icount  icount;
-       wait_queue_head_t       open_wait;
-       wait_queue_head_t       close_wait;
        struct completion       shutdown_wait;
-       wait_queue_head_t       delta_msr_wait;
        int throttle;
 };
 
 #define        CLOSING_WAIT_DELAY      30*HZ
-#define CY_CLOSING_WAIT_NONE   65535
-#define CY_CLOSING_WAIT_INF    0
+#define CY_CLOSING_WAIT_NONE   ASYNC_CLOSING_WAIT_NONE
+#define CY_CLOSING_WAIT_INF    ASYNC_CLOSING_WAIT_INF
 
 
 #define CyMAX_CHIPS_PER_CARD   8