fedora core 6 1.2949 + vserver 2.2.0
[linux-2.6.git] / drivers / net / fs_enet / mac-scc.c
index a3897fd..afd7fca 100644 (file)
@@ -12,7 +12,6 @@
  * kind, whether express or implied.
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/kernel.h>
 #include <linux/types.h>
@@ -118,15 +117,17 @@ static int do_pd_setup(struct fs_enet_private *fep)
 
        /* Fill out IRQ field */
        fep->interrupt = platform_get_irq_byname(pdev, "interrupt");
+       if (fep->interrupt < 0)
+               return -EINVAL;
 
        r = platform_get_resource_byname(pdev, IORESOURCE_MEM, "regs");
-       fep->scc.sccp = (void *)r->start;
+       fep->scc.sccp = ioremap(r->start, r->end - r->start + 1);
 
        if (fep->scc.sccp == NULL)
                return -EINVAL;
 
        r = platform_get_resource_byname(pdev, IORESOURCE_MEM, "pram");
-       fep->scc.ep = (void *)r->start;
+       fep->scc.ep = ioremap(r->start, r->end - r->start + 1);
 
        if (fep->scc.ep == NULL)
                return -EINVAL;
@@ -368,7 +369,7 @@ static void restart(struct net_device *dev)
        W16(sccp, scc_psmr, SCC_PSMR_ENCRC | SCC_PSMR_NIB22);
 
        /* Set full duplex mode if needed */
-       if (fep->duplex)
+       if (fep->phydev->duplex)
                S16(sccp, scc_psmr, SCC_PSMR_LPB | SCC_PSMR_FDE);
 
        S32(sccp, scc_gsmrl, SCC_GSMRL_ENR | SCC_GSMRL_ENT);
@@ -396,6 +397,7 @@ static void stop(struct net_device *dev)
 
 static void pre_request_irq(struct net_device *dev, int irq)
 {
+#ifndef CONFIG_PPC_MERGE
        immap_t *immap = fs_enet_immap;
        u32 siel;
 
@@ -409,6 +411,7 @@ static void pre_request_irq(struct net_device *dev, int irq)
                        siel &= ~(0x80000000 >> (irq & ~1));
                out_be32(&immap->im_siu_conf.sc_siel, siel);
        }
+#endif
 }
 
 static void post_free_irq(struct net_device *dev, int irq)
@@ -499,6 +502,8 @@ static void tx_restart(struct net_device *dev)
        scc_cr_cmd(fep, CPM_CR_RESTART_TX);
 }
 
+
+
 /*************************************************************************/
 
 const struct fs_ops fs_scc_ops = {