]> bbs.cooldavid.org Git - net-next-2.6.git/blobdiff - drivers/net/stmmac/stmmac.h
stmmac: rewiew platform data
[net-next-2.6.git] / drivers / net / stmmac / stmmac.h
index 6d2eae3040e51ab027181c3d476f4c2b3aa418ab..0d5529fa579a5544f4a75abeb787c4ab91e4acba 100644 (file)
@@ -21,6 +21,7 @@
 *******************************************************************************/
 
 #define DRV_MODULE_VERSION     "Oct_09"
+#include <linux/stmmac.h>
 
 #if defined(CONFIG_VLAN_8021Q) || defined(CONFIG_VLAN_8021Q_MODULE)
 #define STMMAC_VLAN_TAG_USED
@@ -69,6 +70,7 @@ struct stmmac_priv {
        int phy_mask;
        int (*phy_reset) (void *priv);
        void (*fix_mac_speed) (void *priv, unsigned int speed);
+       void (*bus_setup)(unsigned long ioaddr);
        void *bsp_priv;
 
        int phy_irq;
@@ -93,6 +95,28 @@ struct stmmac_priv {
 #endif
 };
 
+#ifdef CONFIG_STM_DRIVERS
+#include <linux/stm/pad.h>
+static inline int stmmac_claim_resource(struct platform_device *pdev)
+{
+       int ret = 0;
+       struct plat_stmmacenet_data *plat_dat = pdev->dev.platform_data;
+
+       /* Pad routing setup */
+       if (IS_ERR(devm_stm_pad_claim(&pdev->dev, plat_dat->pad_config,
+                       dev_name(&pdev->dev)))) {
+               printk(KERN_ERR "%s: Failed to request pads!\n", __func__);
+               ret = -ENODEV;
+       }
+       return ret;
+}
+#else
+static inline int stmmac_claim_resource(struct platform_device *pdev)
+{
+       return 0;
+}
+#endif
+
 extern int stmmac_mdio_unregister(struct net_device *ndev);
 extern int stmmac_mdio_register(struct net_device *ndev);
 extern void stmmac_set_ethtool_ops(struct net_device *netdev);