diff options
Diffstat (limited to 'drivers/net/s2io.c')
| -rw-r--r-- | drivers/net/s2io.c | 64 |
1 files changed, 56 insertions, 8 deletions
diff --git a/drivers/net/s2io.c b/drivers/net/s2io.c index cac9fdd2e1d5..3defe5d4f7d3 100644 --- a/drivers/net/s2io.c +++ b/drivers/net/s2io.c | |||
| @@ -2627,6 +2627,50 @@ no_rx: | |||
| 2627 | #endif | 2627 | #endif |
| 2628 | 2628 | ||
| 2629 | /** | 2629 | /** |
| 2630 | * s2io_netpoll - Rx interrupt service handler for netpoll support | ||
| 2631 | * @dev : pointer to the device structure. | ||
| 2632 | * Description: | ||
| 2633 | * Polling 'interrupt' - used by things like netconsole to send skbs | ||
| 2634 | * without having to re-enable interrupts. It's not called while | ||
| 2635 | * the interrupt routine is executing. | ||
| 2636 | */ | ||
| 2637 | |||
| 2638 | #ifdef CONFIG_NET_POLL_CONTROLLER | ||
| 2639 | static void s2io_netpoll(struct net_device *dev) | ||
| 2640 | { | ||
| 2641 | nic_t *nic = dev->priv; | ||
| 2642 | mac_info_t *mac_control; | ||
| 2643 | struct config_param *config; | ||
| 2644 | XENA_dev_config_t __iomem *bar0 = nic->bar0; | ||
| 2645 | u64 val64; | ||
| 2646 | int i; | ||
| 2647 | |||
| 2648 | disable_irq(dev->irq); | ||
| 2649 | |||
| 2650 | atomic_inc(&nic->isr_cnt); | ||
| 2651 | mac_control = &nic->mac_control; | ||
| 2652 | config = &nic->config; | ||
| 2653 | |||
| 2654 | val64 = readq(&bar0->rx_traffic_int); | ||
| 2655 | writeq(val64, &bar0->rx_traffic_int); | ||
| 2656 | |||
| 2657 | for (i = 0; i < config->rx_ring_num; i++) | ||
| 2658 | rx_intr_handler(&mac_control->rings[i]); | ||
| 2659 | |||
| 2660 | for (i = 0; i < config->rx_ring_num; i++) { | ||
| 2661 | if (fill_rx_buffers(nic, i) == -ENOMEM) { | ||
| 2662 | DBG_PRINT(ERR_DBG, "%s:Out of memory", dev->name); | ||
| 2663 | DBG_PRINT(ERR_DBG, " in Rx Netpoll!!\n"); | ||
| 2664 | break; | ||
| 2665 | } | ||
| 2666 | } | ||
| 2667 | atomic_dec(&nic->isr_cnt); | ||
| 2668 | enable_irq(dev->irq); | ||
| 2669 | return; | ||
| 2670 | } | ||
| 2671 | #endif | ||
| 2672 | |||
| 2673 | /** | ||
| 2630 | * rx_intr_handler - Rx interrupt handler | 2674 | * rx_intr_handler - Rx interrupt handler |
| 2631 | * @nic: device private variable. | 2675 | * @nic: device private variable. |
| 2632 | * Description: | 2676 | * Description: |
| @@ -3915,8 +3959,8 @@ static int s2io_xmit(struct sk_buff *skb, struct net_device *dev) | |||
| 3915 | txdp->Control_1 = 0; | 3959 | txdp->Control_1 = 0; |
| 3916 | txdp->Control_2 = 0; | 3960 | txdp->Control_2 = 0; |
| 3917 | #ifdef NETIF_F_TSO | 3961 | #ifdef NETIF_F_TSO |
| 3918 | mss = skb_shinfo(skb)->tso_size; | 3962 | mss = skb_shinfo(skb)->gso_size; |
| 3919 | if (mss) { | 3963 | if (skb_shinfo(skb)->gso_type == SKB_GSO_TCPV4) { |
| 3920 | txdp->Control_1 |= TXD_TCP_LSO_EN; | 3964 | txdp->Control_1 |= TXD_TCP_LSO_EN; |
| 3921 | txdp->Control_1 |= TXD_TCP_LSO_MSS(mss); | 3965 | txdp->Control_1 |= TXD_TCP_LSO_MSS(mss); |
| 3922 | } | 3966 | } |
| @@ -3936,10 +3980,10 @@ static int s2io_xmit(struct sk_buff *skb, struct net_device *dev) | |||
| 3936 | } | 3980 | } |
| 3937 | 3981 | ||
| 3938 | frg_len = skb->len - skb->data_len; | 3982 | frg_len = skb->len - skb->data_len; |
| 3939 | if (skb_shinfo(skb)->ufo_size) { | 3983 | if (skb_shinfo(skb)->gso_type == SKB_GSO_UDPV4) { |
| 3940 | int ufo_size; | 3984 | int ufo_size; |
| 3941 | 3985 | ||
| 3942 | ufo_size = skb_shinfo(skb)->ufo_size; | 3986 | ufo_size = skb_shinfo(skb)->gso_size; |
| 3943 | ufo_size &= ~7; | 3987 | ufo_size &= ~7; |
| 3944 | txdp->Control_1 |= TXD_UFO_EN; | 3988 | txdp->Control_1 |= TXD_UFO_EN; |
| 3945 | txdp->Control_1 |= TXD_UFO_MSS(ufo_size); | 3989 | txdp->Control_1 |= TXD_UFO_MSS(ufo_size); |
| @@ -3965,7 +4009,7 @@ static int s2io_xmit(struct sk_buff *skb, struct net_device *dev) | |||
| 3965 | txdp->Host_Control = (unsigned long) skb; | 4009 | txdp->Host_Control = (unsigned long) skb; |
| 3966 | txdp->Control_1 |= TXD_BUFFER0_SIZE(frg_len); | 4010 | txdp->Control_1 |= TXD_BUFFER0_SIZE(frg_len); |
| 3967 | 4011 | ||
| 3968 | if (skb_shinfo(skb)->ufo_size) | 4012 | if (skb_shinfo(skb)->gso_type == SKB_GSO_UDPV4) |
| 3969 | txdp->Control_1 |= TXD_UFO_EN; | 4013 | txdp->Control_1 |= TXD_UFO_EN; |
| 3970 | 4014 | ||
| 3971 | frg_cnt = skb_shinfo(skb)->nr_frags; | 4015 | frg_cnt = skb_shinfo(skb)->nr_frags; |
| @@ -3980,12 +4024,12 @@ static int s2io_xmit(struct sk_buff *skb, struct net_device *dev) | |||
| 3980 | (sp->pdev, frag->page, frag->page_offset, | 4024 | (sp->pdev, frag->page, frag->page_offset, |
| 3981 | frag->size, PCI_DMA_TODEVICE); | 4025 | frag->size, PCI_DMA_TODEVICE); |
| 3982 | txdp->Control_1 = TXD_BUFFER0_SIZE(frag->size); | 4026 | txdp->Control_1 = TXD_BUFFER0_SIZE(frag->size); |
| 3983 | if (skb_shinfo(skb)->ufo_size) | 4027 | if (skb_shinfo(skb)->gso_type == SKB_GSO_UDPV4) |
| 3984 | txdp->Control_1 |= TXD_UFO_EN; | 4028 | txdp->Control_1 |= TXD_UFO_EN; |
| 3985 | } | 4029 | } |
| 3986 | txdp->Control_1 |= TXD_GATHER_CODE_LAST; | 4030 | txdp->Control_1 |= TXD_GATHER_CODE_LAST; |
| 3987 | 4031 | ||
| 3988 | if (skb_shinfo(skb)->ufo_size) | 4032 | if (skb_shinfo(skb)->gso_type == SKB_GSO_UDPV4) |
| 3989 | frg_cnt++; /* as Txd0 was used for inband header */ | 4033 | frg_cnt++; /* as Txd0 was used for inband header */ |
| 3990 | 4034 | ||
| 3991 | tx_fifo = mac_control->tx_FIFO_start[queue]; | 4035 | tx_fifo = mac_control->tx_FIFO_start[queue]; |
| @@ -3999,7 +4043,7 @@ static int s2io_xmit(struct sk_buff *skb, struct net_device *dev) | |||
| 3999 | if (mss) | 4043 | if (mss) |
| 4000 | val64 |= TX_FIFO_SPECIAL_FUNC; | 4044 | val64 |= TX_FIFO_SPECIAL_FUNC; |
| 4001 | #endif | 4045 | #endif |
| 4002 | if (skb_shinfo(skb)->ufo_size) | 4046 | if (skb_shinfo(skb)->gso_type == SKB_GSO_UDPV4) |
| 4003 | val64 |= TX_FIFO_SPECIAL_FUNC; | 4047 | val64 |= TX_FIFO_SPECIAL_FUNC; |
| 4004 | writeq(val64, &tx_fifo->List_Control); | 4048 | writeq(val64, &tx_fifo->List_Control); |
| 4005 | 4049 | ||
| @@ -6967,6 +7011,10 @@ s2io_init_nic(struct pci_dev *pdev, const struct pci_device_id *pre) | |||
| 6967 | dev->weight = 32; | 7011 | dev->weight = 32; |
| 6968 | #endif | 7012 | #endif |
| 6969 | 7013 | ||
| 7014 | #ifdef CONFIG_NET_POLL_CONTROLLER | ||
| 7015 | dev->poll_controller = s2io_netpoll; | ||
| 7016 | #endif | ||
| 7017 | |||
| 6970 | dev->features |= NETIF_F_SG | NETIF_F_IP_CSUM; | 7018 | dev->features |= NETIF_F_SG | NETIF_F_IP_CSUM; |
| 6971 | if (sp->high_dma_flag == TRUE) | 7019 | if (sp->high_dma_flag == TRUE) |
| 6972 | dev->features |= NETIF_F_HIGHDMA; | 7020 | dev->features |= NETIF_F_HIGHDMA; |
