]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/net/ibm_newemac/core.h
drivers/net: Use linux/of_{device,platform}.h instead of asm
[linux-2.6-omap-h63xx.git] / drivers / net / ibm_newemac / core.h
index 4011803117caae85be457cc5b6774b351c097fb1..223090466760c1bf0fc3786b178939ae9e8b583e 100644 (file)
@@ -3,6 +3,11 @@
  *
  * Driver for PowerPC 4xx on-chip ethernet controller.
  *
+ * Copyright 2007 Benjamin Herrenschmidt, IBM Corp.
+ *                <benh@kernel.crashing.org>
+ *
+ * Based on the arch/ppc version of the driver:
+ *
  * Copyright (c) 2004, 2005 Zultys Technologies.
  * Eugene Surovegin <eugene.surovegin@zultys.com> or <ebs@ebshome.net>
  *
@@ -28,8 +33,8 @@
 #include <linux/netdevice.h>
 #include <linux/dma-mapping.h>
 #include <linux/spinlock.h>
+#include <linux/of_platform.h>
 
-#include <asm/of_platform.h>
 #include <asm/io.h>
 #include <asm/dcr.h>
 
@@ -258,6 +263,7 @@ struct emac_instance {
        int                             stop_timeout;   /* in us */
        int                             no_mcast;
        int                             mcast_pending;
+       int                             opened;
        struct work_struct              reset_work;
        spinlock_t                      lock;
 };
@@ -292,9 +298,17 @@ struct emac_instance {
  */
 #define EMAC_FTR_HAS_RGMII             0x00000020
 /*
- * Set if we have axon-type STACR
+ * Set if we have new type STACR with STAOPC
+ */
+#define EMAC_FTR_HAS_NEW_STACR         0x00000040
+/*
+ * Set if we need phy clock workaround for 440gx
+ */
+#define EMAC_FTR_440GX_PHY_CLK_FIX     0x00000080
+/*
+ * Set if we need phy clock workaround for 440ep or 440gr
  */
-#define EMAC_FTR_HAS_AXON_STACR                0x00000040
+#define EMAC_FTR_440EP_PHY_CLK_FIX     0x00000100
 
 
 /* Right now, we don't quite handle the always/possible masks on the
@@ -306,8 +320,8 @@ enum {
 
        EMAC_FTRS_POSSIBLE      =
 #ifdef CONFIG_IBM_NEW_EMAC_EMAC4
-           EMAC_FTR_EMAC4      | EMAC_FTR_HAS_AXON_STACR       |
-           EMAC_FTR_STACR_OC_INVERT    |
+           EMAC_FTR_EMAC4 | EMAC_FTR_HAS_NEW_STACR |
+           EMAC_FTR_STACR_OC_INVERT | EMAC_FTR_440GX_PHY_CLK_FIX |
 #endif
 #ifdef CONFIG_IBM_NEW_EMAC_TAH
            EMAC_FTR_HAS_TAH    |
@@ -318,7 +332,7 @@ enum {
 #ifdef CONFIG_IBM_NEW_EMAC_RGMII
            EMAC_FTR_HAS_RGMII  |
 #endif
-           0,
+       EMAC_FTR_440EP_PHY_CLK_FIX,
 };
 
 static inline int emac_has_feature(struct emac_instance *dev,