aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/atm/he.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/atm/he.c')
-rw-r--r--drivers/atm/he.c34
1 files changed, 22 insertions, 12 deletions
diff --git a/drivers/atm/he.c b/drivers/atm/he.c
index fde9334059af..f2511b42dba2 100644
--- a/drivers/atm/he.c
+++ b/drivers/atm/he.c
@@ -55,7 +55,6 @@
55 55
56 */ 56 */
57 57
58#include <linux/config.h>
59#include <linux/module.h> 58#include <linux/module.h>
60#include <linux/kernel.h> 59#include <linux/kernel.h>
61#include <linux/skbuff.h> 60#include <linux/skbuff.h>
@@ -455,7 +454,7 @@ rate_to_atmf(unsigned rate) /* cps to atm forum format */
455 return (NONZERO | (exp << 9) | (rate & 0x1ff)); 454 return (NONZERO | (exp << 9) | (rate & 0x1ff));
456} 455}
457 456
458static void __init 457static void __devinit
459he_init_rx_lbfp0(struct he_dev *he_dev) 458he_init_rx_lbfp0(struct he_dev *he_dev)
460{ 459{
461 unsigned i, lbm_offset, lbufd_index, lbuf_addr, lbuf_count; 460 unsigned i, lbm_offset, lbufd_index, lbuf_addr, lbuf_count;
@@ -486,7 +485,7 @@ he_init_rx_lbfp0(struct he_dev *he_dev)
486 he_writel(he_dev, he_dev->r0_numbuffs, RLBF0_C); 485 he_writel(he_dev, he_dev->r0_numbuffs, RLBF0_C);
487} 486}
488 487
489static void __init 488static void __devinit
490he_init_rx_lbfp1(struct he_dev *he_dev) 489he_init_rx_lbfp1(struct he_dev *he_dev)
491{ 490{
492 unsigned i, lbm_offset, lbufd_index, lbuf_addr, lbuf_count; 491 unsigned i, lbm_offset, lbufd_index, lbuf_addr, lbuf_count;
@@ -517,7 +516,7 @@ he_init_rx_lbfp1(struct he_dev *he_dev)
517 he_writel(he_dev, he_dev->r1_numbuffs, RLBF1_C); 516 he_writel(he_dev, he_dev->r1_numbuffs, RLBF1_C);
518} 517}
519 518
520static void __init 519static void __devinit
521he_init_tx_lbfp(struct he_dev *he_dev) 520he_init_tx_lbfp(struct he_dev *he_dev)
522{ 521{
523 unsigned i, lbm_offset, lbufd_index, lbuf_addr, lbuf_count; 522 unsigned i, lbm_offset, lbufd_index, lbuf_addr, lbuf_count;
@@ -547,7 +546,7 @@ he_init_tx_lbfp(struct he_dev *he_dev)
547 he_writel(he_dev, lbufd_index - 1, TLBF_T); 546 he_writel(he_dev, lbufd_index - 1, TLBF_T);
548} 547}
549 548
550static int __init 549static int __devinit
551he_init_tpdrq(struct he_dev *he_dev) 550he_init_tpdrq(struct he_dev *he_dev)
552{ 551{
553 he_dev->tpdrq_base = pci_alloc_consistent(he_dev->pci_dev, 552 he_dev->tpdrq_base = pci_alloc_consistent(he_dev->pci_dev,
@@ -569,7 +568,7 @@ he_init_tpdrq(struct he_dev *he_dev)
569 return 0; 568 return 0;
570} 569}
571 570
572static void __init 571static void __devinit
573he_init_cs_block(struct he_dev *he_dev) 572he_init_cs_block(struct he_dev *he_dev)
574{ 573{
575 unsigned clock, rate, delta; 574 unsigned clock, rate, delta;
@@ -665,7 +664,7 @@ he_init_cs_block(struct he_dev *he_dev)
665 664
666} 665}
667 666
668static int __init 667static int __devinit
669he_init_cs_block_rcm(struct he_dev *he_dev) 668he_init_cs_block_rcm(struct he_dev *he_dev)
670{ 669{
671 unsigned (*rategrid)[16][16]; 670 unsigned (*rategrid)[16][16];
@@ -786,7 +785,7 @@ he_init_cs_block_rcm(struct he_dev *he_dev)
786 return 0; 785 return 0;
787} 786}
788 787
789static int __init 788static int __devinit
790he_init_group(struct he_dev *he_dev, int group) 789he_init_group(struct he_dev *he_dev, int group)
791{ 790{
792 int i; 791 int i;
@@ -956,7 +955,7 @@ he_init_group(struct he_dev *he_dev, int group)
956 return 0; 955 return 0;
957} 956}
958 957
959static int __init 958static int __devinit
960he_init_irq(struct he_dev *he_dev) 959he_init_irq(struct he_dev *he_dev)
961{ 960{
962 int i; 961 int i;
@@ -1008,7 +1007,7 @@ he_init_irq(struct he_dev *he_dev)
1008 he_writel(he_dev, 0x0, GRP_54_MAP); 1007 he_writel(he_dev, 0x0, GRP_54_MAP);
1009 he_writel(he_dev, 0x0, GRP_76_MAP); 1008 he_writel(he_dev, 0x0, GRP_76_MAP);
1010 1009
1011 if (request_irq(he_dev->pci_dev->irq, he_irq_handler, SA_INTERRUPT|SA_SHIRQ, DEV_LABEL, he_dev)) { 1010 if (request_irq(he_dev->pci_dev->irq, he_irq_handler, IRQF_DISABLED|IRQF_SHARED, DEV_LABEL, he_dev)) {
1012 hprintk("irq %d already in use\n", he_dev->pci_dev->irq); 1011 hprintk("irq %d already in use\n", he_dev->pci_dev->irq);
1013 return -EINVAL; 1012 return -EINVAL;
1014 } 1013 }
@@ -1018,7 +1017,7 @@ he_init_irq(struct he_dev *he_dev)
1018 return 0; 1017 return 0;
1019} 1018}
1020 1019
1021static int __init 1020static int __devinit
1022he_start(struct atm_dev *dev) 1021he_start(struct atm_dev *dev)
1023{ 1022{
1024 struct he_dev *he_dev; 1023 struct he_dev *he_dev;
@@ -1913,7 +1912,7 @@ he_service_rbrq(struct he_dev *he_dev, int group)
1913 skb->tail = skb->data + skb->len; 1912 skb->tail = skb->data + skb->len;
1914#ifdef USE_CHECKSUM_HW 1913#ifdef USE_CHECKSUM_HW
1915 if (vcc->vpi == 0 && vcc->vci >= ATM_NOT_RSV_VCI) { 1914 if (vcc->vpi == 0 && vcc->vci >= ATM_NOT_RSV_VCI) {
1916 skb->ip_summed = CHECKSUM_HW; 1915 skb->ip_summed = CHECKSUM_COMPLETE;
1917 skb->csum = TCP_CKSUM(skb->data, 1916 skb->csum = TCP_CKSUM(skb->data,
1918 he_vcc->pdu_len); 1917 he_vcc->pdu_len);
1919 } 1918 }
@@ -1929,7 +1928,9 @@ he_service_rbrq(struct he_dev *he_dev, int group)
1929#ifdef notdef 1928#ifdef notdef
1930 ATM_SKB(skb)->vcc = vcc; 1929 ATM_SKB(skb)->vcc = vcc;
1931#endif 1930#endif
1931 spin_unlock(&he_dev->global_lock);
1932 vcc->push(vcc, skb); 1932 vcc->push(vcc, skb);
1933 spin_lock(&he_dev->global_lock);
1933 1934
1934 atomic_inc(&vcc->stats->rx); 1935 atomic_inc(&vcc->stats->rx);
1935 1936
@@ -2283,6 +2284,8 @@ __enqueue_tpd(struct he_dev *he_dev, struct he_tpd *tpd, unsigned cid)
2283 TPDRQ_MASK(he_readl(he_dev, TPDRQ_B_H))); 2284 TPDRQ_MASK(he_readl(he_dev, TPDRQ_B_H)));
2284 2285
2285 if (new_tail == he_dev->tpdrq_head) { 2286 if (new_tail == he_dev->tpdrq_head) {
2287 int slot;
2288
2286 hprintk("tpdrq full (cid 0x%x)\n", cid); 2289 hprintk("tpdrq full (cid 0x%x)\n", cid);
2287 /* 2290 /*
2288 * FIXME 2291 * FIXME
@@ -2290,6 +2293,13 @@ __enqueue_tpd(struct he_dev *he_dev, struct he_tpd *tpd, unsigned cid)
2290 * after service_tbrq, service the backlog 2293 * after service_tbrq, service the backlog
2291 * for now, we just drop the pdu 2294 * for now, we just drop the pdu
2292 */ 2295 */
2296 for (slot = 0; slot < TPD_MAXIOV; ++slot) {
2297 if (tpd->iovec[slot].addr)
2298 pci_unmap_single(he_dev->pci_dev,
2299 tpd->iovec[slot].addr,
2300 tpd->iovec[slot].len & TPD_LEN_MASK,
2301 PCI_DMA_TODEVICE);
2302 }
2293 if (tpd->skb) { 2303 if (tpd->skb) {
2294 if (tpd->vcc->pop) 2304 if (tpd->vcc->pop)
2295 tpd->vcc->pop(tpd->vcc, tpd->skb); 2305 tpd->vcc->pop(tpd->vcc, tpd->skb);