summaryrefslogtreecommitdiffstats
path: root/include/linux/ssb
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2013-02-07 23:48:33 -0500
committerDavid S. Miller <davem@davemloft.net>2013-02-07 23:48:33 -0500
commitb285109dde7b873b5dc671ef1b3ae3090f4bc72f (patch)
tree695331432f2d422efa6c71ad3b35b281b17a81c8 /include/linux/ssb
parent241448c2b84ff02a46ce88199e05fdeb55bad449 (diff)
parent7e6c63f03d94278135753fef7ffcc5b03e34282e (diff)
Merge branch 'tg3'
Attention linux-next maintainer, you will hit a merge conflict between this merge and the mips tree, the resolution is to preserve the removal of uses of nvram_geenv() and nvram_parse_macaddr() from the net-next side. Hauke Mehrtens says: ==================== These patches are adding support for the Ethernet core found in the BCM4705/BCM4785 SoC. This is based on current master of davem/net-next.git. v4: * move setting of DMA_RWCTRL_ONE_DMA v3: * combined first two patches into one patch v2: * use of struct sprom in ssb_gige_get_macaddr() instead of accessing the nvram directly * add return value to ssb_gige_get_macaddr() * try to read the mac address from ssb core before accessing the own registers. * fix two checkpatch warnings ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/linux/ssb')
-rw-r--r--include/linux/ssb/ssb_driver_gige.h23
1 files changed, 11 insertions, 12 deletions
diff --git a/include/linux/ssb/ssb_driver_gige.h b/include/linux/ssb/ssb_driver_gige.h
index 6b05dcd927f..86a12b0cb23 100644
--- a/include/linux/ssb/ssb_driver_gige.h
+++ b/include/linux/ssb/ssb_driver_gige.h
@@ -97,21 +97,16 @@ static inline bool ssb_gige_must_flush_posted_writes(struct pci_dev *pdev)
return 0;
}
-#ifdef CONFIG_BCM47XX
-#include <asm/mach-bcm47xx/nvram.h>
/* Get the device MAC address */
-static inline void ssb_gige_get_macaddr(struct pci_dev *pdev, u8 *macaddr)
-{
- char buf[20];
- if (nvram_getenv("et0macaddr", buf, sizeof(buf)) < 0)
- return;
- nvram_parse_macaddr(buf, macaddr);
-}
-#else
-static inline void ssb_gige_get_macaddr(struct pci_dev *pdev, u8 *macaddr)
+static inline int ssb_gige_get_macaddr(struct pci_dev *pdev, u8 *macaddr)
{
+ struct ssb_gige *dev = pdev_to_ssb_gige(pdev);
+ if (!dev)
+ return -ENODEV;
+
+ memcpy(macaddr, dev->dev->bus->sprom.et0mac, 6);
+ return 0;
}
-#endif
extern int ssb_gige_pcibios_plat_dev_init(struct ssb_device *sdev,
struct pci_dev *pdev);
@@ -175,6 +170,10 @@ static inline bool ssb_gige_must_flush_posted_writes(struct pci_dev *pdev)
{
return 0;
}
+static inline int ssb_gige_get_macaddr(struct pci_dev *pdev, u8 *macaddr)
+{
+ return -ENODEV;
+}
#endif /* CONFIG_SSB_DRIVER_GIGE */
#endif /* LINUX_SSB_DRIVER_GIGE_H_ */