Merge git://git.infradead.org/mtd-2.6
[powerpc.git] / drivers / isdn / gigaset / gigaset.h
index 39a883e..884bd72 100644 (file)
@@ -16,7 +16,6 @@
 #ifndef GIGASET_H
 #define GIGASET_H
 
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/compiler.h>
 #include <linux/types.h>
@@ -55,9 +54,6 @@
 #define GIG_RETRYCID
 #define GIG_X75
 
-#define MAX_TIMER_INDEX 1000
-#define MAX_SEQ_INDEX   1000
-
 #define GIG_TICK 100           /* in milliseconds */
 
 /* timeout values (unit: 1 sec) */
@@ -78,7 +74,7 @@ extern int gigaset_debuglevel;        /* "needs" cast to (enum debuglevel) */
  * e.g. 'insmod usb_gigaset.o debug=0x2c' will set DEBUG_OPEN, DEBUG_CMD and
  * DEBUG_INTR.
  */
-enum debuglevel { /* up to 24 bits (atomic_t) */
+enum debuglevel {
        DEBUG_REG         = 0x0002, /* serial port I/O register operations */
        DEBUG_OPEN        = 0x0004, /* open/close serial port */
        DEBUG_INTR        = 0x0008, /* interrupt processing */
@@ -144,7 +140,7 @@ enum debuglevel { /* up to 24 bits (atomic_t) */
                        printk(KERN_DEBUG KBUILD_MODNAME ": " format "\n", \
                               ## arg); \
        } while (0)
-#define DEBUG_DEFAULT (DEBUG_INIT | DEBUG_TRANSCMD | DEBUG_CMD | DEBUG_USBREQ)
+#define DEBUG_DEFAULT (DEBUG_TRANSCMD | DEBUG_CMD | DEBUG_USBREQ)
 
 #else
 
@@ -375,7 +371,7 @@ struct at_state_t {
        struct list_head        list;
        int                     waiting;
        int                     getstring;
-       atomic_t                timer_index;
+       unsigned                timer_index;
        unsigned long           timer_expires;
        int                     timer_active;
        unsigned int            ConState;       /* State of connection */
@@ -384,7 +380,7 @@ struct at_state_t {
        int                     int_var[VAR_NUM];       /* see VAR_XXXX */
        char                    *str_var[STR_NUM];      /* see STR_XXXX */
        unsigned                pending_commands;       /* see PC_XXXX */
-       atomic_t                seq_index;
+       unsigned                seq_index;
 
        struct cardstate        *cs;
        struct bc_state         *bcs;
@@ -448,6 +444,7 @@ struct cardstate {
        struct gigaset_driver *driver;
        unsigned minor_index;
        struct device *dev;
+       struct class_device *class;
 
        const struct gigaset_ops *ops;
 
@@ -484,10 +481,11 @@ struct cardstate {
        unsigned fwver[4];
        int gotfwver;
 
-       atomic_t running;               /* !=0 if events are handled */
-       atomic_t connected;             /* !=0 if hardware is connected */
+       unsigned running;               /* !=0 if events are handled */
+       unsigned connected;             /* !=0 if hardware is connected */
+       unsigned isdn_up;               /* !=0 after ISDN_STAT_RUN */
 
-       atomic_t cidmode;
+       unsigned cidmode;
 
        int myid;                       /* id for communication with LL */
        isdn_if iif;
@@ -528,7 +526,7 @@ struct cardstate {
 
        /* event queue */
        struct event_t events[MAX_EVENTS];
-       atomic_t ev_tail, ev_head;
+       unsigned ev_tail, ev_head;
        spinlock_t ev_lock;
 
        /* current modem response */
@@ -629,8 +627,7 @@ struct gigaset_ops {
        /* Called by gigaset_freecs() for freeing bcs->hw.xxx */
        int (*freebcshw)(struct bc_state *bcs);
 
-       /* Called by gigaset_stop() or gigaset_bchannel_down() for resetting
-          bcs->hw.xxx */
+       /* Called by gigaset_bchannel_down() for resetting bcs->hw.xxx */
        void (*reinitbcshw)(struct bc_state *bcs);
 
        /* Called by gigaset_initcs() for setting up cs->hw.xxx */
@@ -771,14 +768,12 @@ void gigaset_block_channels(struct cardstate *cs);
 struct gigaset_driver *gigaset_initdriver(unsigned minor, unsigned minors,
                                          const char *procname,
                                          const char *devname,
-                                         const char *devfsname,
                                          const struct gigaset_ops *ops,
                                          struct module *owner);
 
 /* Deallocate driver structure. */
 void gigaset_freedriver(struct gigaset_driver *drv);
 void gigaset_debugdrivers(void);
-struct cardstate *gigaset_get_cs_by_minor(unsigned minor);
 struct cardstate *gigaset_get_cs_by_tty(struct tty_struct *tty);
 struct cardstate *gigaset_get_cs_by_id(int id);
 
@@ -824,7 +819,7 @@ static inline void gigaset_schedule_event(struct cardstate *cs)
 {
        unsigned long flags;
        spin_lock_irqsave(&cs->lock, flags);
-       if (atomic_read(&cs->running))
+       if (cs->running)
                tasklet_schedule(&cs->event_tasklet);
        spin_unlock_irqrestore(&cs->lock, flags);
 }
@@ -895,7 +890,7 @@ int gigaset_fill_inbuf(struct inbuf_t *inbuf, const unsigned char *src,
 
 /* initialize interface */
 void gigaset_if_initdriver(struct gigaset_driver *drv, const char *procname,
-                          const char *devname, const char *devfsname);
+                          const char *devname);
 /* release interface */
 void gigaset_if_freedriver(struct gigaset_driver *drv);
 /* add minor */