include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit...
[safe/jmp/linux-2.6] / drivers / isdn / hisax / ipacx.c
index 6485e23..751b25f 100644 (file)
@@ -10,7 +10,7 @@
  *
  */
 #include <linux/kernel.h>
-#include <linux/config.h>
+#include <linux/slab.h>
 #include <linux/init.h>
 #include "hisax_if.h"
 #include "hisax.h"
@@ -36,13 +36,11 @@ static void ph_command(struct IsdnCardState *cs, unsigned int command);
 static inline void cic_int(struct IsdnCardState *cs);
 static void dch_l2l1(struct PStack *st, int pr, void *arg);
 static void dbusy_timer_handler(struct IsdnCardState *cs);
-static void ipacx_new_ph(struct IsdnCardState *cs);
-static void dch_bh(struct IsdnCardState *cs);
 static void dch_empty_fifo(struct IsdnCardState *cs, int count);
 static void dch_fill_fifo(struct IsdnCardState *cs);
 static inline void dch_int(struct IsdnCardState *cs);
-static void __devinit dch_setstack(struct PStack *st, struct IsdnCardState *cs);
-static void __devinit dch_init(struct IsdnCardState *cs);
+static void dch_setstack(struct PStack *st, struct IsdnCardState *cs);
+static void dch_init(struct IsdnCardState *cs);
 static void bch_l2l1(struct PStack *st, int pr, void *arg);
 static void bch_empty_fifo(struct BCState *bcs, int count);
 static void bch_fill_fifo(struct BCState *bcs);
@@ -51,8 +49,8 @@ static void bch_mode(struct BCState *bcs, int mode, int bc);
 static void bch_close_state(struct BCState *bcs);
 static int bch_open_state(struct IsdnCardState *cs, struct BCState *bcs);
 static int bch_setstack(struct PStack *st, struct BCState *bcs);
-static void __devinit bch_init(struct IsdnCardState *cs, int hscx);
-static void __init clear_pending_ints(struct IsdnCardState *cs);
+static void bch_init(struct IsdnCardState *cs, int hscx);
+static void clear_pending_ints(struct IsdnCardState *cs);
 
 //----------------------------------------------------------
 // Issue Layer 1 command to chip
@@ -232,81 +230,6 @@ dbusy_timer_handler(struct IsdnCardState *cs)
 }
 
 //----------------------------------------------------------
-// L1 state machine intermediate layer to isdnl1 module
-//----------------------------------------------------------
-static void
-ipacx_new_ph(struct IsdnCardState *cs)
-{
-       switch (cs->dc.isac.ph_state) {
-               case (IPACX_IND_RES):
-                       ph_command(cs, IPACX_CMD_DI);
-                       l1_msg(cs, HW_RESET | INDICATION, NULL);
-                       break;
-      
-               case (IPACX_IND_DC):
-                       l1_msg(cs, HW_DEACTIVATE | CONFIRM, NULL);
-                       break;
-      
-               case (IPACX_IND_DR):
-                       l1_msg(cs, HW_DEACTIVATE | INDICATION, NULL);
-                       break;
-      
-               case (IPACX_IND_PU):
-                       l1_msg(cs, HW_POWERUP | CONFIRM, NULL);
-                       break;
-
-               case (IPACX_IND_RSY):
-                       l1_msg(cs, HW_RSYNC | INDICATION, NULL);
-                       break;
-
-               case (IPACX_IND_AR):
-                       l1_msg(cs, HW_INFO2 | INDICATION, NULL);
-                       break;
-      
-               case (IPACX_IND_AI8):
-                       l1_msg(cs, HW_INFO4_P8 | INDICATION, NULL);
-                       break;
-      
-               case (IPACX_IND_AI10):
-                       l1_msg(cs, HW_INFO4_P10 | INDICATION, NULL);
-                       break;
-      
-               default:
-                       break;
-       }
-}
-
-//----------------------------------------------------------
-// bottom half handler for D channel
-//----------------------------------------------------------
-static void
-dch_bh(struct IsdnCardState *cs)
-{
-       struct PStack *st;
-       
-       if (!cs) return;
-  
-       if (test_and_clear_bit(D_CLEARBUSY, &cs->event)) {
-               if (cs->debug) debugl1(cs, "D-Channel Busy cleared");
-               for (st = cs->stlist; st; st = st->next) {
-                       st->l1.l1l2(st, PH_PAUSE | CONFIRM, NULL);
-               }
-       }
-  
-       if (test_and_clear_bit(D_RCVBUFREADY, &cs->event)) {
-               DChannel_proc_rcv(cs);
-  }  
-  
-       if (test_and_clear_bit(D_XMTBUFREADY, &cs->event)) {
-               DChannel_proc_xmt(cs);
-  }  
-  
-       if (test_and_clear_bit(D_L1STATECHANGE, &cs->event)) {
-    ipacx_new_ph(cs);
-  }  
-}
-
-//----------------------------------------------------------
 // Fill buffer from receive FIFO
 //----------------------------------------------------------
 static void 
@@ -486,7 +409,7 @@ dch_int(struct IsdnCardState *cs)
 
 //----------------------------------------------------------
 //----------------------------------------------------------
-static void __devinit
+static void
 dch_setstack(struct PStack *st, struct IsdnCardState *cs)
 {
        st->l1.l1hw = dch_l2l1;
@@ -494,7 +417,7 @@ dch_setstack(struct PStack *st, struct IsdnCardState *cs)
 
 //----------------------------------------------------------
 //----------------------------------------------------------
-static void __devinit
+static void
 dch_init(struct IsdnCardState *cs)
 {
        printk(KERN_INFO "HiSax: IPACX ISDN driver v0.1.0\n");
@@ -839,14 +762,10 @@ bch_close_state(struct BCState *bcs)
 {
        bch_mode(bcs, 0, bcs->channel);
        if (test_and_clear_bit(BC_FLG_INIT, &bcs->Flag)) {
-               if (bcs->hw.hscx.rcvbuf) {
-                       kfree(bcs->hw.hscx.rcvbuf);
-                       bcs->hw.hscx.rcvbuf = NULL;
-               }
-               if (bcs->blog) {
-                       kfree(bcs->blog);
-                       bcs->blog = NULL;
-               }
+               kfree(bcs->hw.hscx.rcvbuf);
+               bcs->hw.hscx.rcvbuf = NULL;
+               kfree(bcs->blog);
+               bcs->blog = NULL;
                skb_queue_purge(&bcs->rqueue);
                skb_queue_purge(&bcs->squeue);
                if (bcs->tx_skb) {
@@ -905,7 +824,7 @@ bch_setstack(struct PStack *st, struct BCState *bcs)
 
 //----------------------------------------------------------
 //----------------------------------------------------------
-static void __devinit
+static void
 bch_init(struct IsdnCardState *cs, int hscx)
 {
        cs->bcs[hscx].BC_SetStack   = bch_setstack;
@@ -943,7 +862,7 @@ interrupt_ipacx(struct IsdnCardState *cs)
 //----------------------------------------------------------
 // Clears chip interrupt status
 //----------------------------------------------------------
-static void __init
+static void
 clear_pending_ints(struct IsdnCardState *cs)
 {
        int ista;
@@ -965,7 +884,7 @@ clear_pending_ints(struct IsdnCardState *cs)
 // Does chip configuration work
 // Work to do depends on bit mask in part
 //----------------------------------------------------------
-void __init
+void
 init_ipacx(struct IsdnCardState *cs, int part)
 {
        if (part &1) {  // initialise chip
@@ -991,14 +910,5 @@ init_ipacx(struct IsdnCardState *cs, int part)
        }
 }
 
-
-void __devinit
-setup_ipacx(struct IsdnCardState *cs)
-{
-       INIT_WORK(&cs->tqueue, (void *)(void *) dch_bh, cs);
-       cs->dbusytimer.function = (void *) dbusy_timer_handler;
-       cs->dbusytimer.data = (long) cs;
-       init_timer(&cs->dbusytimer);
-}
 //----------------- end of file -----------------------