Add changes from the Linux-2.6 tree.
[linux-2.6.git] / drivers / isdn / hisax / hfc4s8s_l1.c
index ba1d028..a2fa4ec 100644 (file)
@@ -22,7 +22,6 @@
 
 #include <linux/module.h>
 #include <linux/init.h>
-#include <linux/config.h>
 #include <linux/pci.h>
 #include <linux/interrupt.h>
 #include <linux/delay.h>
@@ -312,7 +311,7 @@ wait_busy(hfc4s8s_hw * a)
 /* function to read critical counter registers that   */
 /* may be udpated by the chip during read             */
 /******************************************************/
-static volatile u_char
+static u_char
 Read_hfc8_stable(hfc4s8s_hw * hw, int reg)
 {
        u_char ref8;
@@ -324,7 +323,7 @@ Read_hfc8_stable(hfc4s8s_hw * hw, int reg)
        return in8;
 }
 
-static volatile int
+static int
 Read_hfc16_stable(hfc4s8s_hw * hw, int reg)
 {
        int ref16;
@@ -425,7 +424,7 @@ bch_l2l1(struct hisax_if *ifc, int pr, void *arg)
        struct hfc4s8s_btype *bch = ifc->priv;
        struct hfc4s8s_l1 *l1 = bch->l1p;
        struct sk_buff *skb = (struct sk_buff *) arg;
-       int mode = (int) arg;
+       long mode = (long) arg;
        u_long flags;
 
        switch (pr) {
@@ -915,7 +914,7 @@ tx_d_frame(struct hfc4s8s_l1 *l1p)
        struct sk_buff *skb;
        u_char f1, f2;
        u_char *cp;
-       int cnt;
+       long cnt;
 
        if (l1p->l1_state != 7)
                return;
@@ -981,7 +980,8 @@ tx_b_frame(struct hfc4s8s_btype *bch)
        struct sk_buff *skb;
        struct hfc4s8s_l1 *l1 = bch->l1p;
        u_char *cp;
-       int cnt, max, hdlc_num, ack_len = 0;
+       int cnt, max, hdlc_num;
+       long ack_len = 0;
 
        if (!l1->enabled || (bch->mode == L1_MODE_NULL))
                return;
@@ -1063,7 +1063,7 @@ tx_b_frame(struct hfc4s8s_btype *bch)
                                Write_hfc8(l1->hw, A_INC_RES_FIFO, 1);
                        }
                        ack_len += skb->truesize;
-                       bch->tx_skb = 0;
+                       bch->tx_skb = NULL;
                        bch->tx_cnt = 0;
                        dev_kfree_skb(skb);
                } else
@@ -1083,8 +1083,9 @@ tx_b_frame(struct hfc4s8s_btype *bch)
 /* bottom half handler for interrupt */
 /*************************************/
 static void
-hfc4s8s_bh(hfc4s8s_hw * hw)
+hfc4s8s_bh(struct work_struct *work)
 {
+       hfc4s8s_hw *hw = container_of(work, hfc4s8s_hw, tqueue);
        u_char b;
        struct hfc4s8s_l1 *l1p;
        volatile u_char *fifo_stat;
@@ -1268,7 +1269,7 @@ hfc4s8s_bh(hfc4s8s_hw * hw)
 /* interrupt handler */
 /*********************/
 static irqreturn_t
-hfc4s8s_interrupt(int intno, void *dev_id, struct pt_regs *regs)
+hfc4s8s_interrupt(int intno, void *dev_id)
 {
        hfc4s8s_hw *hw = dev_id;
        u_char b, ovr;
@@ -1358,7 +1359,7 @@ chipreset(hfc4s8s_hw * hw)
 /********************************************/
 /* disable/enable hardware in nt or te mode */
 /********************************************/
-void
+static void
 hfc_hardware_enable(hfc4s8s_hw * hw, int enable, int nt_mode)
 {
        u_long flags;
@@ -1465,7 +1466,7 @@ hfc_hardware_enable(hfc4s8s_hw * hw, int enable, int nt_mode)
 /******************************************/
 /* disable memory mapped ports / io ports */
 /******************************************/
-void
+static void
 release_pci_ports(hfc4s8s_hw * hw)
 {
        pci_write_config_word(hw->pdev, PCI_COMMAND, 0);
@@ -1481,7 +1482,7 @@ release_pci_ports(hfc4s8s_hw * hw)
 /*****************************************/
 /* enable memory mapped ports / io ports */
 /*****************************************/
-void
+static void
 enable_pci_ports(hfc4s8s_hw * hw)
 {
 #ifdef CONFIG_HISAX_HFC4S8S_PCIMEM
@@ -1550,10 +1551,10 @@ setup_instance(hfc4s8s_hw * hw)
                goto out;
        }
 
-       INIT_WORK(&hw->tqueue, (void *) (void *) hfc4s8s_bh, hw);
+       INIT_WORK(&hw->tqueue, hfc4s8s_bh);
 
        if (request_irq
-           (hw->irq, hfc4s8s_interrupt, SA_SHIRQ, hw->card_name, hw)) {
+           (hw->irq, hfc4s8s_interrupt, IRQF_SHARED, hw->card_name, hw)) {
                printk(KERN_INFO
                       "HFC-4S/8S: unable to alloc irq %d, card ignored\n",
                       hw->irq);
@@ -1590,11 +1591,10 @@ hfc4s8s_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
        hfc4s8s_param *driver_data = (hfc4s8s_param *) ent->driver_data;
        hfc4s8s_hw *hw;
 
-       if (!(hw = kmalloc(sizeof(hfc4s8s_hw), GFP_ATOMIC))) {
+       if (!(hw = kzalloc(sizeof(hfc4s8s_hw), GFP_ATOMIC))) {
                printk(KERN_ERR "No kmem for HFC-4S/8S card\n");
                return (err);
        }
-       memset(hw, 0, sizeof(hfc4s8s_hw));
 
        hw->pdev = pdev;
        err = pci_enable_device(pdev);
@@ -1659,10 +1659,10 @@ hfc4s8s_remove(struct pci_dev *pdev)
 }
 
 static struct pci_driver hfc4s8s_driver = {
-      name:"hfc4s8s_l1",
-      probe:hfc4s8s_probe,
-      remove:__devexit_p(hfc4s8s_remove),
-      id_table:hfc4s8s_ids,
+      .name    = "hfc4s8s_l1",
+      .probe   = hfc4s8s_probe,
+      .remove  = __devexit_p(hfc4s8s_remove),
+      .id_table        = hfc4s8s_ids,
 };
 
 /**********************/
@@ -1704,7 +1704,7 @@ hfc4s8s_module_init(void)
 /* driver module exit :              */
 /* release the HFC-4s/8s hardware    */
 /*************************************/
-static void
+static void __exit
 hfc4s8s_module_exit(void)
 {
        pci_unregister_driver(&hfc4s8s_driver);