diff options
Diffstat (limited to 'drivers/net')
-rw-r--r-- | drivers/net/arm/ixp4xx_eth.c | 26 | ||||
-rw-r--r-- | drivers/net/smc91x.h | 5 | ||||
-rw-r--r-- | drivers/net/wan/ixp4xx_hss.c | 11 |
3 files changed, 23 insertions, 19 deletions
diff --git a/drivers/net/arm/ixp4xx_eth.c b/drivers/net/arm/ixp4xx_eth.c index a740053d3af3..b6d188115caf 100644 --- a/drivers/net/arm/ixp4xx_eth.c +++ b/drivers/net/arm/ixp4xx_eth.c | |||
@@ -456,7 +456,8 @@ static inline void queue_put_desc(unsigned int queue, u32 phys, | |||
456 | debug_desc(phys, desc); | 456 | debug_desc(phys, desc); |
457 | BUG_ON(phys & 0x1F); | 457 | BUG_ON(phys & 0x1F); |
458 | qmgr_put_entry(queue, phys); | 458 | qmgr_put_entry(queue, phys); |
459 | BUG_ON(qmgr_stat_overflow(queue)); | 459 | /* Don't check for queue overflow here, we've allocated sufficient |
460 | length and queues >= 32 don't support this check anyway. */ | ||
460 | } | 461 | } |
461 | 462 | ||
462 | 463 | ||
@@ -512,8 +513,8 @@ static int eth_poll(struct napi_struct *napi, int budget) | |||
512 | #endif | 513 | #endif |
513 | napi_complete(napi); | 514 | napi_complete(napi); |
514 | qmgr_enable_irq(rxq); | 515 | qmgr_enable_irq(rxq); |
515 | if (!qmgr_stat_empty(rxq) && | 516 | if (!qmgr_stat_below_low_watermark(rxq) && |
516 | napi_reschedule(napi)) { | 517 | napi_reschedule(napi)) { /* not empty again */ |
517 | #if DEBUG_RX | 518 | #if DEBUG_RX |
518 | printk(KERN_DEBUG "%s: eth_poll" | 519 | printk(KERN_DEBUG "%s: eth_poll" |
519 | " napi_reschedule successed\n", | 520 | " napi_reschedule successed\n", |
@@ -630,9 +631,9 @@ static void eth_txdone_irq(void *unused) | |||
630 | port->tx_buff_tab[n_desc] = NULL; | 631 | port->tx_buff_tab[n_desc] = NULL; |
631 | } | 632 | } |
632 | 633 | ||
633 | start = qmgr_stat_empty(port->plat->txreadyq); | 634 | start = qmgr_stat_below_low_watermark(port->plat->txreadyq); |
634 | queue_put_desc(port->plat->txreadyq, phys, desc); | 635 | queue_put_desc(port->plat->txreadyq, phys, desc); |
635 | if (start) { | 636 | if (start) { /* TX-ready queue was empty */ |
636 | #if DEBUG_TX | 637 | #if DEBUG_TX |
637 | printk(KERN_DEBUG "%s: eth_txdone_irq xmit ready\n", | 638 | printk(KERN_DEBUG "%s: eth_txdone_irq xmit ready\n", |
638 | port->netdev->name); | 639 | port->netdev->name); |
@@ -708,13 +709,14 @@ static int eth_xmit(struct sk_buff *skb, struct net_device *dev) | |||
708 | queue_put_desc(TX_QUEUE(port->id), tx_desc_phys(port, n), desc); | 709 | queue_put_desc(TX_QUEUE(port->id), tx_desc_phys(port, n), desc); |
709 | dev->trans_start = jiffies; | 710 | dev->trans_start = jiffies; |
710 | 711 | ||
711 | if (qmgr_stat_empty(txreadyq)) { | 712 | if (qmgr_stat_below_low_watermark(txreadyq)) { /* empty */ |
712 | #if DEBUG_TX | 713 | #if DEBUG_TX |
713 | printk(KERN_DEBUG "%s: eth_xmit queue full\n", dev->name); | 714 | printk(KERN_DEBUG "%s: eth_xmit queue full\n", dev->name); |
714 | #endif | 715 | #endif |
715 | netif_stop_queue(dev); | 716 | netif_stop_queue(dev); |
716 | /* we could miss TX ready interrupt */ | 717 | /* we could miss TX ready interrupt */ |
717 | if (!qmgr_stat_empty(txreadyq)) { | 718 | /* really empty in fact */ |
719 | if (!qmgr_stat_below_low_watermark(txreadyq)) { | ||
718 | #if DEBUG_TX | 720 | #if DEBUG_TX |
719 | printk(KERN_DEBUG "%s: eth_xmit ready again\n", | 721 | printk(KERN_DEBUG "%s: eth_xmit ready again\n", |
720 | dev->name); | 722 | dev->name); |
@@ -814,29 +816,29 @@ static int request_queues(struct port *port) | |||
814 | int err; | 816 | int err; |
815 | 817 | ||
816 | err = qmgr_request_queue(RXFREE_QUEUE(port->id), RX_DESCS, 0, 0, | 818 | err = qmgr_request_queue(RXFREE_QUEUE(port->id), RX_DESCS, 0, 0, |
817 | "%s:RX-free", port->netdev->name); | 819 | "%s:RX-free", port->netdev->name); |
818 | if (err) | 820 | if (err) |
819 | return err; | 821 | return err; |
820 | 822 | ||
821 | err = qmgr_request_queue(port->plat->rxq, RX_DESCS, 0, 0, | 823 | err = qmgr_request_queue(port->plat->rxq, RX_DESCS, 0, 0, |
822 | "%s:RX", port->netdev->name); | 824 | "%s:RX", port->netdev->name); |
823 | if (err) | 825 | if (err) |
824 | goto rel_rxfree; | 826 | goto rel_rxfree; |
825 | 827 | ||
826 | err = qmgr_request_queue(TX_QUEUE(port->id), TX_DESCS, 0, 0, | 828 | err = qmgr_request_queue(TX_QUEUE(port->id), TX_DESCS, 0, 0, |
827 | "%s:TX", port->netdev->name); | 829 | "%s:TX", port->netdev->name); |
828 | if (err) | 830 | if (err) |
829 | goto rel_rx; | 831 | goto rel_rx; |
830 | 832 | ||
831 | err = qmgr_request_queue(port->plat->txreadyq, TX_DESCS, 0, 0, | 833 | err = qmgr_request_queue(port->plat->txreadyq, TX_DESCS, 0, 0, |
832 | "%s:TX-ready", port->netdev->name); | 834 | "%s:TX-ready", port->netdev->name); |
833 | if (err) | 835 | if (err) |
834 | goto rel_tx; | 836 | goto rel_tx; |
835 | 837 | ||
836 | /* TX-done queue handles skbs sent out by the NPEs */ | 838 | /* TX-done queue handles skbs sent out by the NPEs */ |
837 | if (!ports_open) { | 839 | if (!ports_open) { |
838 | err = qmgr_request_queue(TXDONE_QUEUE, TXDONE_QUEUE_LEN, 0, 0, | 840 | err = qmgr_request_queue(TXDONE_QUEUE, TXDONE_QUEUE_LEN, 0, 0, |
839 | "%s:TX-done", DRV_NAME); | 841 | "%s:TX-done", DRV_NAME); |
840 | if (err) | 842 | if (err) |
841 | goto rel_txready; | 843 | goto rel_txready; |
842 | } | 844 | } |
diff --git a/drivers/net/smc91x.h b/drivers/net/smc91x.h index 329f890e2903..f1f773b17fe1 100644 --- a/drivers/net/smc91x.h +++ b/drivers/net/smc91x.h | |||
@@ -45,7 +45,8 @@ | |||
45 | defined(CONFIG_MACH_ZYLONITE) ||\ | 45 | defined(CONFIG_MACH_ZYLONITE) ||\ |
46 | defined(CONFIG_MACH_LITTLETON) ||\ | 46 | defined(CONFIG_MACH_LITTLETON) ||\ |
47 | defined(CONFIG_MACH_ZYLONITE2) ||\ | 47 | defined(CONFIG_MACH_ZYLONITE2) ||\ |
48 | defined(CONFIG_ARCH_VIPER) | 48 | defined(CONFIG_ARCH_VIPER) ||\ |
49 | defined(CONFIG_MACH_STARGATE2) | ||
49 | 50 | ||
50 | #include <asm/mach-types.h> | 51 | #include <asm/mach-types.h> |
51 | 52 | ||
@@ -73,7 +74,7 @@ | |||
73 | /* We actually can't write halfwords properly if not word aligned */ | 74 | /* We actually can't write halfwords properly if not word aligned */ |
74 | static inline void SMC_outw(u16 val, void __iomem *ioaddr, int reg) | 75 | static inline void SMC_outw(u16 val, void __iomem *ioaddr, int reg) |
75 | { | 76 | { |
76 | if (machine_is_mainstone() && reg & 2) { | 77 | if ((machine_is_mainstone() || machine_is_stargate2()) && reg & 2) { |
77 | unsigned int v = val << 16; | 78 | unsigned int v = val << 16; |
78 | v |= readl(ioaddr + (reg & ~2)) & 0xffff; | 79 | v |= readl(ioaddr + (reg & ~2)) & 0xffff; |
79 | writel(v, ioaddr + (reg & ~2)); | 80 | writel(v, ioaddr + (reg & ~2)); |
diff --git a/drivers/net/wan/ixp4xx_hss.c b/drivers/net/wan/ixp4xx_hss.c index 765a7f5d6aa4..a6dc317083d3 100644 --- a/drivers/net/wan/ixp4xx_hss.c +++ b/drivers/net/wan/ixp4xx_hss.c | |||
@@ -579,7 +579,8 @@ static inline void queue_put_desc(unsigned int queue, u32 phys, | |||
579 | debug_desc(phys, desc); | 579 | debug_desc(phys, desc); |
580 | BUG_ON(phys & 0x1F); | 580 | BUG_ON(phys & 0x1F); |
581 | qmgr_put_entry(queue, phys); | 581 | qmgr_put_entry(queue, phys); |
582 | BUG_ON(qmgr_stat_overflow(queue)); | 582 | /* Don't check for queue overflow here, we've allocated sufficient |
583 | length and queues >= 32 don't support this check anyway. */ | ||
583 | } | 584 | } |
584 | 585 | ||
585 | 586 | ||
@@ -789,10 +790,10 @@ static void hss_hdlc_txdone_irq(void *pdev) | |||
789 | free_buffer_irq(port->tx_buff_tab[n_desc]); | 790 | free_buffer_irq(port->tx_buff_tab[n_desc]); |
790 | port->tx_buff_tab[n_desc] = NULL; | 791 | port->tx_buff_tab[n_desc] = NULL; |
791 | 792 | ||
792 | start = qmgr_stat_empty(port->plat->txreadyq); | 793 | start = qmgr_stat_below_low_watermark(port->plat->txreadyq); |
793 | queue_put_desc(port->plat->txreadyq, | 794 | queue_put_desc(port->plat->txreadyq, |
794 | tx_desc_phys(port, n_desc), desc); | 795 | tx_desc_phys(port, n_desc), desc); |
795 | if (start) { | 796 | if (start) { /* TX-ready queue was empty */ |
796 | #if DEBUG_TX | 797 | #if DEBUG_TX |
797 | printk(KERN_DEBUG "%s: hss_hdlc_txdone_irq xmit" | 798 | printk(KERN_DEBUG "%s: hss_hdlc_txdone_irq xmit" |
798 | " ready\n", dev->name); | 799 | " ready\n", dev->name); |
@@ -867,13 +868,13 @@ static int hss_hdlc_xmit(struct sk_buff *skb, struct net_device *dev) | |||
867 | queue_put_desc(queue_ids[port->id].tx, tx_desc_phys(port, n), desc); | 868 | queue_put_desc(queue_ids[port->id].tx, tx_desc_phys(port, n), desc); |
868 | dev->trans_start = jiffies; | 869 | dev->trans_start = jiffies; |
869 | 870 | ||
870 | if (qmgr_stat_empty(txreadyq)) { | 871 | if (qmgr_stat_below_low_watermark(txreadyq)) { /* empty */ |
871 | #if DEBUG_TX | 872 | #if DEBUG_TX |
872 | printk(KERN_DEBUG "%s: hss_hdlc_xmit queue full\n", dev->name); | 873 | printk(KERN_DEBUG "%s: hss_hdlc_xmit queue full\n", dev->name); |
873 | #endif | 874 | #endif |
874 | netif_stop_queue(dev); | 875 | netif_stop_queue(dev); |
875 | /* we could miss TX ready interrupt */ | 876 | /* we could miss TX ready interrupt */ |
876 | if (!qmgr_stat_empty(txreadyq)) { | 877 | if (!qmgr_stat_below_low_watermark(txreadyq)) { |
877 | #if DEBUG_TX | 878 | #if DEBUG_TX |
878 | printk(KERN_DEBUG "%s: hss_hdlc_xmit ready again\n", | 879 | printk(KERN_DEBUG "%s: hss_hdlc_xmit ready again\n", |
879 | dev->name); | 880 | dev->name); |