[PATCH] isdn4linux: Siemens Gigaset base driver: fix disconnect handling
[safe/jmp/linux-2.6] / drivers / isdn / gigaset / gigaset.h
index 12153ac..22b9693 100644 (file)
@@ -2,7 +2,7 @@
  * Siemens Gigaset 307x driver
  * Common header file for all connection variants
  *
- * Written by Stefan Eilers <Eilers.Stefan@epost.de>
+ * Written by Stefan Eilers
  *        and Hansjoerg Lipp <hjlipp@web.de>
  *
  * =====================================================================
@@ -55,9 +55,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 +75,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 +141,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 +372,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 +381,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;
@@ -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 */
@@ -778,7 +775,6 @@ struct gigaset_driver *gigaset_initdriver(unsigned minor, unsigned minors,
 /* 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 +820,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);
 }
@@ -852,23 +848,6 @@ static inline void gigaset_bchannel_up(struct bc_state *bcs)
 /* handling routines for sk_buff */
 /* ============================= */
 
-/* private version of __skb_put()
- * append 'len' bytes to the content of 'skb', already knowing that the
- * existing buffer can accomodate them
- * returns a pointer to the location where the new bytes should be copied to
- * This function does not take any locks so it must be called with the
- * appropriate locks held only.
- */
-static inline unsigned char *gigaset_skb_put_quick(struct sk_buff *skb,
-                                                  unsigned int len)
-{
-       unsigned char *tmp = skb->tail;
-       /*SKB_LINEAR_ASSERT(skb);*/             /* not needed here */
-       skb->tail += len;
-       skb->len += len;
-       return tmp;
-}
-
 /* pass received skb to LL
  * Warning: skb must not be accessed anymore!
  */