]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/net/r8169.c
r8169: verbose mac address init
[linux-2.6-omap-h63xx.git] / drivers / net / r8169.c
index bdae2c59a7509020e7759e097935c420b762b324..cd9a21581f569b93fcfa7a8318a35a191dc8cc11 100644 (file)
@@ -1947,11 +1947,11 @@ static void rtl_init_mac_address(struct rtl8169_private *tp,
        u8 cfg1;
        int vpd_cap;
        u8 mac[8];
-       DECLARE_MAC_BUF(buf);
 
        cfg1 = RTL_R8(Config1);
        if (!(cfg1  & VPD)) {
-               dprintk("VPD access not enabled, enabling\n");
+               if (netif_msg_probe(tp))
+                       dev_info(&pdev->dev, "VPD access disabled, enabling\n");
                RTL_W8(Cfg9346, Cfg9346_Unlock);
                RTL_W8(Config1, cfg1 | VPD);
                RTL_W8(Cfg9346, Cfg9346_Lock);
@@ -1969,11 +1969,19 @@ static void rtl_init_mac_address(struct rtl8169_private *tp,
         */
        if (rtl_eeprom_read(pdev, vpd_cap, 0x000e, (__le32*)&mac[0]) < 0 ||
            rtl_eeprom_read(pdev, vpd_cap, 0x0012, (__le32*)&mac[4]) < 0) {
-               dprintk("Reading MAC address from EEPROM failed\n");
+               if (netif_msg_probe(tp)) {
+                       dev_warn(&pdev->dev,
+                                "reading MAC address from EEPROM failed\n");
+               }
                return;
        }
 
-       dprintk("MAC address found in EEPROM: %s\n", print_mac(buf, mac));
+       if (netif_msg_probe(tp)) {
+               DECLARE_MAC_BUF(buf);
+
+               dev_info(&pdev->dev, "MAC address found in EEPROM: %s\n",
+                        print_mac(buf, mac));
+       }
 
        /* Write MAC address */
        rtl_rar_set(tp, mac);
@@ -2154,6 +2162,8 @@ rtl8169_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
 
        spin_lock_init(&tp->lock);
 
+       tp->mmio_addr = ioaddr;
+
        rtl_init_mac_address(tp, ioaddr);
 
        /* Get MAC address */
@@ -2186,7 +2196,6 @@ rtl8169_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
 #endif
 
        tp->intr_mask = 0xffff;
-       tp->mmio_addr = ioaddr;
        tp->align = cfg->align;
        tp->hw_start = cfg->hw_start;
        tp->intr_event = cfg->intr_event;