X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=drivers%2Fatm%2Fiphase.c;h=5c28ca7380ff6fa0683599178cbd17af6109e8d4;hb=bda0c0afa7a694bb1459fd023515aca681e4d79a;hp=a3b605a0ca17a47e106359e4299d5db2e70515df;hpb=e030dbf91a87da7e8be3be3ca781558695bea683;p=linux-2.6 diff --git a/drivers/atm/iphase.c b/drivers/atm/iphase.c index a3b605a0ca..5c28ca7380 100644 --- a/drivers/atm/iphase.c +++ b/drivers/atm/iphase.c @@ -60,7 +60,8 @@ #include #include #include -#include +#include +#include #include "iphase.h" #include "suni.h" #define swap(x) (((x & 0xff) << 8) | ((x & 0xff00) >> 8)) @@ -189,7 +190,7 @@ static u16 get_desc (IADEV *dev, struct ia_vcc *iavcc) { int ltimeout; ia_hack_tcq (dev); - if(((jiffies - timer)>50)||((dev->ffL.tcq_rd==dev->host_tcq_wr))){ + if((time_after(jiffies,timer+50)) || ((dev->ffL.tcq_rd==dev->host_tcq_wr))) { timer = jiffies; i=0; while (i < dev->num_tx_desc) { @@ -958,6 +959,7 @@ static void ia_suni_pm7345_init (IADEV *iadev) /***************************** IA_LIB END *****************************/ +#ifdef CONFIG_ATM_IA_DEBUG static int tcnter = 0; static void xdump( u_char* cp, int length, char* prefix ) { @@ -992,6 +994,7 @@ static void xdump( u_char* cp, int length, char* prefix ) } } /* close xdump(... */ +#endif /* CONFIG_ATM_IA_DEBUG */ static struct atm_dev *ia_boards = NULL; @@ -1223,7 +1226,7 @@ static void rx_intr(struct atm_dev *dev) iadev->rx_tmp_jif = jiffies; iadev->rxing = 0; } - else if (((jiffies - iadev->rx_tmp_jif) > 50) && + else if ((time_after(jiffies, iadev->rx_tmp_jif + 50)) && ((iadev->rx_pkt_cnt - iadev->rx_tmp_cnt) == 0)) { for (i = 1; i <= iadev->num_rx_desc; i++) free_desc(dev, i); @@ -1601,14 +1604,14 @@ static int rx_init(struct atm_dev *dev) skb_queue_head_init(&iadev->rx_dma_q); iadev->rx_free_desc_qhead = NULL; - iadev->rx_open = kmalloc(4*iadev->num_vc,GFP_KERNEL); - if (!iadev->rx_open) - { + + iadev->rx_open = kzalloc(4 * iadev->num_vc, GFP_KERNEL); + if (!iadev->rx_open) { printk(KERN_ERR DEV_LABEL "itf %d couldn't get free page\n", dev->number); goto err_free_dle; } - memset(iadev->rx_open, 0, 4*iadev->num_vc); + iadev->rxing = 1; iadev->rx_pkt_cnt = 0; /* Mode Register */ @@ -3171,12 +3174,12 @@ static int __devinit ia_init_one(struct pci_dev *pdev, unsigned long flags; int ret; - iadev = kmalloc(sizeof(*iadev), GFP_KERNEL); + iadev = kzalloc(sizeof(*iadev), GFP_KERNEL); if (!iadev) { ret = -ENOMEM; goto err_out; } - memset(iadev, 0, sizeof(*iadev)); + iadev->pci = pdev; IF_INIT(printk("ia detected at bus:%d dev: %d function:%d\n",