aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/sunhme.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/sunhme.c')
-rw-r--r--drivers/net/sunhme.c35
1 files changed, 12 insertions, 23 deletions
diff --git a/drivers/net/sunhme.c b/drivers/net/sunhme.c
index ef671739cfea..51c3fe2108a3 100644
--- a/drivers/net/sunhme.c
+++ b/drivers/net/sunhme.c
@@ -55,9 +55,6 @@
55 55
56#ifdef CONFIG_PCI 56#ifdef CONFIG_PCI
57#include <linux/pci.h> 57#include <linux/pci.h>
58#ifdef CONFIG_SPARC
59#include <asm/pbm.h>
60#endif
61#endif 58#endif
62 59
63#include "sunhme.h" 60#include "sunhme.h"
@@ -2058,11 +2055,10 @@ static void happy_meal_rx(struct happy_meal *hp, struct net_device *dev)
2058 goto drop_it; 2055 goto drop_it;
2059 } 2056 }
2060 2057
2061 copy_skb->dev = dev;
2062 skb_reserve(copy_skb, 2); 2058 skb_reserve(copy_skb, 2);
2063 skb_put(copy_skb, len); 2059 skb_put(copy_skb, len);
2064 hme_dma_sync_for_cpu(hp, dma_addr, len, DMA_FROMDEVICE); 2060 hme_dma_sync_for_cpu(hp, dma_addr, len, DMA_FROMDEVICE);
2065 memcpy(copy_skb->data, skb->data, len); 2061 skb_copy_from_linear_data(skb, copy_skb->data, len);
2066 hme_dma_sync_for_device(hp, dma_addr, len, DMA_FROMDEVICE); 2062 hme_dma_sync_for_device(hp, dma_addr, len, DMA_FROMDEVICE);
2067 2063
2068 /* Reuse original ring buffer. */ 2064 /* Reuse original ring buffer. */
@@ -2270,10 +2266,8 @@ static int happy_meal_start_xmit(struct sk_buff *skb, struct net_device *dev)
2270 2266
2271 tx_flags = TXFLAG_OWN; 2267 tx_flags = TXFLAG_OWN;
2272 if (skb->ip_summed == CHECKSUM_PARTIAL) { 2268 if (skb->ip_summed == CHECKSUM_PARTIAL) {
2273 u32 csum_start_off, csum_stuff_off; 2269 const u32 csum_start_off = skb_transport_offset(skb);
2274 2270 const u32 csum_stuff_off = csum_start_off + skb->csum_offset;
2275 csum_start_off = (u32) (skb->h.raw - skb->data);
2276 csum_stuff_off = csum_start_off + skb->csum_offset;
2277 2271
2278 tx_flags = (TXFLAG_OWN | TXFLAG_CSENABLE | 2272 tx_flags = (TXFLAG_OWN | TXFLAG_CSENABLE |
2279 ((csum_start_off << 14) & TXFLAG_CSBUFBEGIN) | 2273 ((csum_start_off << 14) & TXFLAG_CSBUFBEGIN) |
@@ -2704,7 +2698,7 @@ static int __devinit happy_meal_sbus_probe_one(struct sbus_dev *sdev, int is_qfe
2704 dev->dev_addr[i] = macaddr[i]; 2698 dev->dev_addr[i] = macaddr[i];
2705 macaddr[5]++; 2699 macaddr[5]++;
2706 } else { 2700 } else {
2707 unsigned char *addr; 2701 const unsigned char *addr;
2708 int len; 2702 int len;
2709 2703
2710 addr = of_get_property(dp, "local-mac-address", &len); 2704 addr = of_get_property(dp, "local-mac-address", &len);
@@ -2986,7 +2980,7 @@ static int __devinit happy_meal_pci_probe(struct pci_dev *pdev,
2986{ 2980{
2987 struct quattro *qp = NULL; 2981 struct quattro *qp = NULL;
2988#ifdef CONFIG_SPARC 2982#ifdef CONFIG_SPARC
2989 struct pcidev_cookie *pcp; 2983 struct device_node *dp;
2990#endif 2984#endif
2991 struct happy_meal *hp; 2985 struct happy_meal *hp;
2992 struct net_device *dev; 2986 struct net_device *dev;
@@ -2998,13 +2992,8 @@ static int __devinit happy_meal_pci_probe(struct pci_dev *pdev,
2998 2992
2999 /* Now make sure pci_dev cookie is there. */ 2993 /* Now make sure pci_dev cookie is there. */
3000#ifdef CONFIG_SPARC 2994#ifdef CONFIG_SPARC
3001 pcp = pdev->sysdata; 2995 dp = pci_device_to_OF_node(pdev);
3002 if (pcp == NULL) { 2996 strcpy(prom_name, dp->name);
3003 printk(KERN_ERR "happymeal(PCI): Some PCI device info missing\n");
3004 return -ENODEV;
3005 }
3006
3007 strcpy(prom_name, pcp->prom_node->name);
3008#else 2997#else
3009 if (is_quattro_p(pdev)) 2998 if (is_quattro_p(pdev))
3010 strcpy(prom_name, "SUNW,qfe"); 2999 strcpy(prom_name, "SUNW,qfe");
@@ -3081,11 +3070,11 @@ static int __devinit happy_meal_pci_probe(struct pci_dev *pdev,
3081 macaddr[5]++; 3070 macaddr[5]++;
3082 } else { 3071 } else {
3083#ifdef CONFIG_SPARC 3072#ifdef CONFIG_SPARC
3084 unsigned char *addr; 3073 const unsigned char *addr;
3085 int len; 3074 int len;
3086 3075
3087 if (qfe_slot != -1 && 3076 if (qfe_slot != -1 &&
3088 (addr = of_get_property(pcp->prom_node, 3077 (addr = of_get_property(dp,
3089 "local-mac-address", &len)) != NULL 3078 "local-mac-address", &len)) != NULL
3090 && len == 6) { 3079 && len == 6) {
3091 memcpy(dev->dev_addr, addr, 6); 3080 memcpy(dev->dev_addr, addr, 6);
@@ -3105,7 +3094,7 @@ static int __devinit happy_meal_pci_probe(struct pci_dev *pdev,
3105 hp->tcvregs = (hpreg_base + 0x7000UL); 3094 hp->tcvregs = (hpreg_base + 0x7000UL);
3106 3095
3107#ifdef CONFIG_SPARC 3096#ifdef CONFIG_SPARC
3108 hp->hm_revision = of_getintprop_default(pcp->prom_node, "hm-rev", 0xff); 3097 hp->hm_revision = of_getintprop_default(dp, "hm-rev", 0xff);
3109 if (hp->hm_revision == 0xff) { 3098 if (hp->hm_revision == 0xff) {
3110 unsigned char prev; 3099 unsigned char prev;
3111 3100
@@ -3300,7 +3289,7 @@ static int __devinit hme_sbus_probe(struct of_device *dev, const struct of_devic
3300{ 3289{
3301 struct sbus_dev *sdev = to_sbus_device(&dev->dev); 3290 struct sbus_dev *sdev = to_sbus_device(&dev->dev);
3302 struct device_node *dp = dev->node; 3291 struct device_node *dp = dev->node;
3303 char *model = of_get_property(dp, "model", NULL); 3292 const char *model = of_get_property(dp, "model", NULL);
3304 int is_qfe = (match->data != NULL); 3293 int is_qfe = (match->data != NULL);
3305 3294
3306 if (!is_qfe && model && !strcmp(model, "SUNW,sbus-qfe")) 3295 if (!is_qfe && model && !strcmp(model, "SUNW,sbus-qfe"))
@@ -3314,7 +3303,7 @@ static int __devexit hme_sbus_remove(struct of_device *dev)
3314 struct happy_meal *hp = dev_get_drvdata(&dev->dev); 3303 struct happy_meal *hp = dev_get_drvdata(&dev->dev);
3315 struct net_device *net_dev = hp->dev; 3304 struct net_device *net_dev = hp->dev;
3316 3305
3317 unregister_netdevice(net_dev); 3306 unregister_netdev(net_dev);
3318 3307
3319 /* XXX qfe parent interrupt... */ 3308 /* XXX qfe parent interrupt... */
3320 3309