diff options
-rw-r--r-- | drivers/net/cassini.c | 16 | ||||
-rw-r--r-- | drivers/net/cassini.h | 3 |
2 files changed, 19 insertions, 0 deletions
diff --git a/drivers/net/cassini.c b/drivers/net/cassini.c index 73502fef8769..7206ab2cbbf8 100644 --- a/drivers/net/cassini.c +++ b/drivers/net/cassini.c | |||
@@ -3203,6 +3203,10 @@ static int cas_get_vpd_info(struct cas *cp, unsigned char *dev_addr, | |||
3203 | int phy_type = CAS_PHY_MII_MDIO0; /* default phy type */ | 3203 | int phy_type = CAS_PHY_MII_MDIO0; /* default phy type */ |
3204 | int mac_off = 0; | 3204 | int mac_off = 0; |
3205 | 3205 | ||
3206 | #if defined(CONFIG_OF) | ||
3207 | const unsigned char *addr; | ||
3208 | #endif | ||
3209 | |||
3206 | /* give us access to the PROM */ | 3210 | /* give us access to the PROM */ |
3207 | writel(BIM_LOCAL_DEV_PROM | BIM_LOCAL_DEV_PAD, | 3211 | writel(BIM_LOCAL_DEV_PROM | BIM_LOCAL_DEV_PAD, |
3208 | cp->regs + REG_BIM_LOCAL_DEV_EN); | 3212 | cp->regs + REG_BIM_LOCAL_DEV_EN); |
@@ -3350,6 +3354,14 @@ use_random_mac_addr: | |||
3350 | if (found & VPD_FOUND_MAC) | 3354 | if (found & VPD_FOUND_MAC) |
3351 | goto done; | 3355 | goto done; |
3352 | 3356 | ||
3357 | #if defined(CONFIG_OF) | ||
3358 | addr = of_get_property(cp->of_node, "local-mac-address", NULL); | ||
3359 | if (addr != NULL) { | ||
3360 | memcpy(dev_addr, addr, 6); | ||
3361 | goto done; | ||
3362 | } | ||
3363 | #endif | ||
3364 | |||
3353 | /* Sun MAC prefix then 3 random bytes. */ | 3365 | /* Sun MAC prefix then 3 random bytes. */ |
3354 | pr_info("MAC address not found in ROM VPD\n"); | 3366 | pr_info("MAC address not found in ROM VPD\n"); |
3355 | dev_addr[0] = 0x08; | 3367 | dev_addr[0] = 0x08; |
@@ -5019,6 +5031,10 @@ static int __devinit cas_init_one(struct pci_dev *pdev, | |||
5019 | cp->msg_enable = (cassini_debug < 0) ? CAS_DEF_MSG_ENABLE : | 5031 | cp->msg_enable = (cassini_debug < 0) ? CAS_DEF_MSG_ENABLE : |
5020 | cassini_debug; | 5032 | cassini_debug; |
5021 | 5033 | ||
5034 | #if defined(CONFIG_OF) | ||
5035 | cp->of_node = pci_device_to_OF_node(pdev); | ||
5036 | #endif | ||
5037 | |||
5022 | cp->link_transition = LINK_TRANSITION_UNKNOWN; | 5038 | cp->link_transition = LINK_TRANSITION_UNKNOWN; |
5023 | cp->link_transition_jiffies_valid = 0; | 5039 | cp->link_transition_jiffies_valid = 0; |
5024 | 5040 | ||
diff --git a/drivers/net/cassini.h b/drivers/net/cassini.h index dbc47878d83b..faf4746a0f3e 100644 --- a/drivers/net/cassini.h +++ b/drivers/net/cassini.h | |||
@@ -2868,6 +2868,9 @@ struct cas { | |||
2868 | dma_addr_t block_dvma, tx_tiny_dvma[N_TX_RINGS]; | 2868 | dma_addr_t block_dvma, tx_tiny_dvma[N_TX_RINGS]; |
2869 | struct pci_dev *pdev; | 2869 | struct pci_dev *pdev; |
2870 | struct net_device *dev; | 2870 | struct net_device *dev; |
2871 | #if defined(CONFIG_OF) | ||
2872 | struct device_node *of_node; | ||
2873 | #endif | ||
2871 | 2874 | ||
2872 | /* Firmware Info */ | 2875 | /* Firmware Info */ |
2873 | u16 fw_load_addr; | 2876 | u16 fw_load_addr; |