aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/skge.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/skge.c')
-rw-r--r--drivers/net/skge.c32
1 files changed, 16 insertions, 16 deletions
diff --git a/drivers/net/skge.c b/drivers/net/skge.c
index 8f5414348e86..379a3dc00163 100644
--- a/drivers/net/skge.c
+++ b/drivers/net/skge.c
@@ -238,8 +238,8 @@ static int skge_set_wol(struct net_device *dev, struct ethtool_wolinfo *wol)
238 struct skge_port *skge = netdev_priv(dev); 238 struct skge_port *skge = netdev_priv(dev);
239 struct skge_hw *hw = skge->hw; 239 struct skge_hw *hw = skge->hw;
240 240
241 if ((wol->wolopts & ~wol_supported(hw)) 241 if ((wol->wolopts & ~wol_supported(hw)) ||
242 || !device_can_wakeup(&hw->pdev->dev)) 242 !device_can_wakeup(&hw->pdev->dev))
243 return -EOPNOTSUPP; 243 return -EOPNOTSUPP;
244 244
245 skge->wol = wol->wolopts; 245 skge->wol = wol->wolopts;
@@ -576,9 +576,10 @@ static void skge_get_pauseparam(struct net_device *dev,
576{ 576{
577 struct skge_port *skge = netdev_priv(dev); 577 struct skge_port *skge = netdev_priv(dev);
578 578
579 ecmd->rx_pause = (skge->flow_control == FLOW_MODE_SYMMETRIC) 579 ecmd->rx_pause = ((skge->flow_control == FLOW_MODE_SYMMETRIC) ||
580 || (skge->flow_control == FLOW_MODE_SYM_OR_REM); 580 (skge->flow_control == FLOW_MODE_SYM_OR_REM));
581 ecmd->tx_pause = ecmd->rx_pause || (skge->flow_control == FLOW_MODE_LOC_SEND); 581 ecmd->tx_pause = (ecmd->rx_pause ||
582 (skge->flow_control == FLOW_MODE_LOC_SEND));
582 583
583 ecmd->autoneg = ecmd->rx_pause || ecmd->tx_pause; 584 ecmd->autoneg = ecmd->rx_pause || ecmd->tx_pause;
584} 585}
@@ -2779,8 +2780,8 @@ static netdev_tx_t skge_xmit_frame(struct sk_buff *skb,
2779 /* This seems backwards, but it is what the sk98lin 2780 /* This seems backwards, but it is what the sk98lin
2780 * does. Looks like hardware is wrong? 2781 * does. Looks like hardware is wrong?
2781 */ 2782 */
2782 if (ipip_hdr(skb)->protocol == IPPROTO_UDP 2783 if (ipip_hdr(skb)->protocol == IPPROTO_UDP &&
2783 && hw->chip_rev == 0 && hw->chip_id == CHIP_ID_YUKON) 2784 hw->chip_rev == 0 && hw->chip_id == CHIP_ID_YUKON)
2784 control = BMU_TCP_CHECK; 2785 control = BMU_TCP_CHECK;
2785 else 2786 else
2786 control = BMU_UDP_CHECK; 2787 control = BMU_UDP_CHECK;
@@ -2948,8 +2949,8 @@ static void genesis_set_multicast(struct net_device *dev)
2948 else { 2949 else {
2949 memset(filter, 0, sizeof(filter)); 2950 memset(filter, 0, sizeof(filter));
2950 2951
2951 if (skge->flow_status == FLOW_STAT_REM_SEND 2952 if (skge->flow_status == FLOW_STAT_REM_SEND ||
2952 || skge->flow_status == FLOW_STAT_SYMMETRIC) 2953 skge->flow_status == FLOW_STAT_SYMMETRIC)
2953 genesis_add_filter(filter, pause_mc_addr); 2954 genesis_add_filter(filter, pause_mc_addr);
2954 2955
2955 for (i = 0; list && i < count; i++, list = list->next) 2956 for (i = 0; list && i < count; i++, list = list->next)
@@ -2972,8 +2973,8 @@ static void yukon_set_multicast(struct net_device *dev)
2972 struct skge_hw *hw = skge->hw; 2973 struct skge_hw *hw = skge->hw;
2973 int port = skge->port; 2974 int port = skge->port;
2974 struct dev_mc_list *list = dev->mc_list; 2975 struct dev_mc_list *list = dev->mc_list;
2975 int rx_pause = (skge->flow_status == FLOW_STAT_REM_SEND 2976 int rx_pause = (skge->flow_status == FLOW_STAT_REM_SEND ||
2976 || skge->flow_status == FLOW_STAT_SYMMETRIC); 2977 skge->flow_status == FLOW_STAT_SYMMETRIC);
2977 u16 reg; 2978 u16 reg;
2978 u8 filter[8]; 2979 u8 filter[8];
2979 2980
@@ -3071,11 +3072,10 @@ static struct sk_buff *skge_rx_get(struct net_device *dev,
3071 goto error; 3072 goto error;
3072 3073
3073 if (len < RX_COPY_THRESHOLD) { 3074 if (len < RX_COPY_THRESHOLD) {
3074 skb = netdev_alloc_skb(dev, len + 2); 3075 skb = netdev_alloc_skb_ip_align(dev, len);
3075 if (!skb) 3076 if (!skb)
3076 goto resubmit; 3077 goto resubmit;
3077 3078
3078 skb_reserve(skb, 2);
3079 pci_dma_sync_single_for_cpu(skge->hw->pdev, 3079 pci_dma_sync_single_for_cpu(skge->hw->pdev,
3080 pci_unmap_addr(e, mapaddr), 3080 pci_unmap_addr(e, mapaddr),
3081 len, PCI_DMA_FROMDEVICE); 3081 len, PCI_DMA_FROMDEVICE);
@@ -3086,11 +3086,11 @@ static struct sk_buff *skge_rx_get(struct net_device *dev,
3086 skge_rx_reuse(e, skge->rx_buf_size); 3086 skge_rx_reuse(e, skge->rx_buf_size);
3087 } else { 3087 } else {
3088 struct sk_buff *nskb; 3088 struct sk_buff *nskb;
3089 nskb = netdev_alloc_skb(dev, skge->rx_buf_size + NET_IP_ALIGN); 3089
3090 nskb = netdev_alloc_skb_ip_align(dev, skge->rx_buf_size);
3090 if (!nskb) 3091 if (!nskb)
3091 goto resubmit; 3092 goto resubmit;
3092 3093
3093 skb_reserve(nskb, NET_IP_ALIGN);
3094 pci_unmap_single(skge->hw->pdev, 3094 pci_unmap_single(skge->hw->pdev,
3095 pci_unmap_addr(e, mapaddr), 3095 pci_unmap_addr(e, mapaddr),
3096 pci_unmap_len(e, maplen), 3096 pci_unmap_len(e, maplen),
@@ -3948,7 +3948,7 @@ static int __devinit skge_probe(struct pci_dev *pdev,
3948 hw->pdev = pdev; 3948 hw->pdev = pdev;
3949 spin_lock_init(&hw->hw_lock); 3949 spin_lock_init(&hw->hw_lock);
3950 spin_lock_init(&hw->phy_lock); 3950 spin_lock_init(&hw->phy_lock);
3951 tasklet_init(&hw->phy_task, &skge_extirq, (unsigned long) hw); 3951 tasklet_init(&hw->phy_task, skge_extirq, (unsigned long) hw);
3952 3952
3953 hw->regs = ioremap_nocache(pci_resource_start(pdev, 0), 0x4000); 3953 hw->regs = ioremap_nocache(pci_resource_start(pdev, 0), 0x4000);
3954 if (!hw->regs) { 3954 if (!hw->regs) {