brcm80211: fmac: register primary net device with device mac address
authorArend van Spriel <arend@broadcom.com>
Wed, 11 Apr 2012 09:52:45 +0000 (11:52 +0200)
committerJohn W. Linville <linville@tuxdriver.com>
Fri, 13 Apr 2012 18:32:52 +0000 (14:32 -0400)
The primary net device was registered with a primary mac address and
upon IFUP it was set to match the actual mac address from the device.
This patch changes that and moves the brcmf_add_if() call to the common
part of the driver.

Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Reviewed-by: Franky (Zhenhui) Lin <frankyl@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/brcm80211/brcmfmac/dhd_linux.c
drivers/net/wireless/brcm80211/brcmfmac/dhd_sdio.c
drivers/net/wireless/brcm80211/brcmfmac/usb.c

index 07836a8521de263ca278eed54a1da9fb24de1ebd..00b62708f22b46711f1d7ddcb25c0e7012d6915c 100644 (file)
@@ -1073,6 +1073,11 @@ int brcmf_bus_start(struct device *dev)
        if (ret < 0)
                return ret;
 
+       /* add primary networking interface */
+       ret = brcmf_add_if(dev, 0, "wlan%d", drvr->mac);
+       if (ret < 0)
+               return ret;
+
        /* signal bus ready */
        bus_if->state = BRCMF_BUS_DATA;
        return 0;
index 2bf5dda292919868a90a9dad3722f0a4991f7024..a83fbea04c046f2d1310442ae4120082334464c1 100644 (file)
@@ -3948,12 +3948,6 @@ void *brcmf_sdbrcm_probe(u32 regsva, struct brcmf_sdio_dev *sdiodev)
                }
        }
 
-       /* add interface and open for business */
-       if (brcmf_add_if(bus->sdiodev->dev, 0, "wlan%d", NULL)) {
-               brcmf_dbg(ERROR, "Add primary net device interface failed!!\n");
-               goto fail;
-       }
-
        return bus;
 
 fail:
index 82364223e81785e0023b0d56136dd2b170cac4eb..1d67ecf681b767b43bd739568435fba67aad7b83 100644 (file)
@@ -1383,14 +1383,6 @@ static int brcmf_usb_probe_cb(struct device *dev, const char *desc,
                goto fail;
        }
 
-       /* add interface and open for business */
-       ret = brcmf_add_if(dev, 0, "wlan%d", NULL);
-       if (ret) {
-               brcmf_dbg(ERROR, "Add primary net device interface failed!!\n");
-               brcmf_detach(dev);
-               goto fail;
-       }
-
        return 0;
 fail:
        /* Release resources in reverse order */