ethernet: Use eth_random_addr
authorJoe Perches <joe@perches.com>
Thu, 12 Jul 2012 19:33:06 +0000 (19:33 +0000)
committerDavid S. Miller <davem@davemloft.net>
Tue, 17 Jul 2012 05:38:27 +0000 (22:38 -0700)
Convert the existing uses of random_ether_addr to
the new eth_random_addr.

Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 files changed:
drivers/net/ethernet/atheros/atl1c/atl1c_hw.c
drivers/net/ethernet/atheros/atlx/atl1.c
drivers/net/ethernet/atheros/atlx/atl2.c
drivers/net/ethernet/ethoc.c
drivers/net/ethernet/intel/igb/igb_main.c
drivers/net/ethernet/intel/ixgbe/ixgbe_sriov.c
drivers/net/ethernet/lantiq_etop.c
drivers/net/ethernet/micrel/ks8851.c
drivers/net/ethernet/micrel/ks8851_mll.c
drivers/net/ethernet/smsc/smsc911x.c
drivers/net/ethernet/ti/cpsw.c
drivers/net/ethernet/tile/tilegx.c
drivers/net/ethernet/wiznet/w5100.c
drivers/net/ethernet/wiznet/w5300.c
drivers/net/ethernet/xilinx/xilinx_axienet_main.c

index 801f012..21e261f 100644 (file)
@@ -199,7 +199,7 @@ int atl1c_read_mac_addr(struct atl1c_hw *hw)
 
        err = atl1c_get_permanent_address(hw);
        if (err)
-               random_ether_addr(hw->perm_mac_addr);
+               eth_random_addr(hw->perm_mac_addr);
 
        memcpy(hw->mac_addr, hw->perm_mac_addr, sizeof(hw->perm_mac_addr));
        return err;
index f2402f3..7bae2ad 100644 (file)
@@ -538,7 +538,7 @@ static s32 atl1_read_mac_addr(struct atl1_hw *hw)
        u16 i;
 
        if (atl1_get_permanent_address(hw)) {
-               random_ether_addr(hw->perm_mac_addr);
+               eth_random_addr(hw->perm_mac_addr);
                ret = 1;
        }
 
index 7c0b7e2..57d64b8 100644 (file)
@@ -2346,7 +2346,7 @@ static s32 atl2_read_mac_addr(struct atl2_hw *hw)
 {
        if (get_permanent_address(hw)) {
                /* for test */
-               /* FIXME: shouldn't we use random_ether_addr() here? */
+               /* FIXME: shouldn't we use eth_random_addr() here? */
                hw->perm_mac_addr[0] = 0x00;
                hw->perm_mac_addr[1] = 0x13;
                hw->perm_mac_addr[2] = 0x74;
index 2029788..94b7bfc 100644 (file)
@@ -1057,7 +1057,7 @@ static int __devinit ethoc_probe(struct platform_device *pdev)
        /* Check the MAC again for validity, if it still isn't choose and
         * program a random one. */
        if (!is_valid_ether_addr(netdev->dev_addr)) {
-               random_ether_addr(netdev->dev_addr);
+               eth_random_addr(netdev->dev_addr);
                random_mac = true;
        }
 
index 60e3075..8adeca9 100644 (file)
@@ -5008,7 +5008,7 @@ static int igb_vf_configure(struct igb_adapter *adapter, int vf)
        unsigned int device_id;
        u16 thisvf_devfn;
 
-       random_ether_addr(mac_addr);
+       eth_random_addr(mac_addr);
        igb_set_vf_mac(adapter, vf, mac_addr);
 
        switch (adapter->hw.mac.type) {
@@ -5417,7 +5417,7 @@ static void igb_vf_reset_event(struct igb_adapter *adapter, u32 vf)
 
        /* generate a new mac address as we were hotplug removed/added */
        if (!(adapter->vf_data[vf].flags & IGB_VF_FLAG_PF_SET_MAC))
-               random_ether_addr(vf_mac);
+               eth_random_addr(vf_mac);
 
        /* process remaining reset events */
        igb_vf_reset(adapter, vf);
index 2d971d1..eb3f67c 100644 (file)
@@ -467,7 +467,7 @@ int ixgbe_vf_configuration(struct pci_dev *pdev, unsigned int event_mask)
        bool enable = ((event_mask & 0x10000000U) != 0);
 
        if (enable) {
-               random_ether_addr(vf_mac_addr);
+               eth_random_addr(vf_mac_addr);
                e_info(probe, "IOV: VF %d is enabled MAC %pM\n",
                       vfn, vf_mac_addr);
                /*
index 9fa39eb..003c5bc 100644 (file)
@@ -645,7 +645,7 @@ ltq_etop_init(struct net_device *dev)
        memcpy(&mac, &priv->pldata->mac, sizeof(struct sockaddr));
        if (!is_valid_ether_addr(mac.sa_data)) {
                pr_warn("etop: invalid MAC, using random\n");
-               random_ether_addr(mac.sa_data);
+               eth_random_addr(mac.sa_data);
                random_mac = true;
        }
 
index 5e313e9..1540ebe 100644 (file)
@@ -422,7 +422,7 @@ static void ks8851_read_mac_addr(struct net_device *dev)
  *
  * Get or create the initial mac address for the device and then set that
  * into the station address register. If there is an EEPROM present, then
- * we try that. If no valid mac address is found we use random_ether_addr()
+ * we try that. If no valid mac address is found we use eth_random_addr()
  * to create a new one.
  */
 static void ks8851_init_mac(struct ks8851_net *ks)
index 59ef568..38529ed 100644 (file)
@@ -1609,7 +1609,7 @@ static int __devinit ks8851_probe(struct platform_device *pdev)
        memcpy(ks->mac_addr, pdata->mac_addr, 6);
        if (!is_valid_ether_addr(ks->mac_addr)) {
                /* Use random MAC address if none passed */
-               random_ether_addr(ks->mac_addr);
+               eth_random_addr(ks->mac_addr);
                netdev_info(netdev, "Using random mac address\n");
        }
        netdev_info(netdev, "Mac address is: %pM\n", ks->mac_addr);
index 54ca99d..62d1baf 100644 (file)
@@ -2488,7 +2488,7 @@ static int __devinit smsc911x_drv_probe(struct platform_device *pdev)
                        eth_hw_addr_random(dev);
                        smsc911x_set_hw_mac_address(pdata, dev->dev_addr);
                        SMSC_TRACE(pdata, probe,
-                                  "MAC Address is set to random_ether_addr");
+                                  "MAC Address is set to eth_random_addr");
                }
        }
 
index 6685bbb..ca381d3 100644 (file)
@@ -748,7 +748,7 @@ static int __devinit cpsw_probe(struct platform_device *pdev)
                memcpy(priv->mac_addr, data->slave_data[0].mac_addr, ETH_ALEN);
                pr_info("Detected MACID = %pM", priv->mac_addr);
        } else {
-               random_ether_addr(priv->mac_addr);
+               eth_random_addr(priv->mac_addr);
                pr_info("Random MACID = %pM", priv->mac_addr);
        }
 
index 83b4b38..7f50028 100644 (file)
@@ -1844,7 +1844,7 @@ static void tile_net_dev_init(const char *name, const uint8_t *mac)
                memcpy(dev->dev_addr, mac, 6);
                dev->addr_len = 6;
        } else {
-               random_ether_addr(dev->dev_addr);
+               eth_random_addr(dev->dev_addr);
        }
 
        /* Register the network device. */
index a75e9ef..a5826a3 100644 (file)
@@ -637,7 +637,7 @@ static int __devinit w5100_hw_probe(struct platform_device *pdev)
        if (data && is_valid_ether_addr(data->mac_addr)) {
                memcpy(ndev->dev_addr, data->mac_addr, ETH_ALEN);
        } else {
-               random_ether_addr(ndev->dev_addr);
+               eth_random_addr(ndev->dev_addr);
                ndev->addr_assign_type |= NET_ADDR_RANDOM;
        }
 
index 3306a20..bdd8891 100644 (file)
@@ -557,7 +557,7 @@ static int __devinit w5300_hw_probe(struct platform_device *pdev)
        if (data && is_valid_ether_addr(data->mac_addr)) {
                memcpy(ndev->dev_addr, data->mac_addr, ETH_ALEN);
        } else {
-               random_ether_addr(ndev->dev_addr);
+               eth_random_addr(ndev->dev_addr);
                ndev->addr_assign_type |= NET_ADDR_RANDOM;
        }
 
index 9c365e1..0793299 100644 (file)
@@ -312,7 +312,7 @@ static void axienet_set_mac_address(struct net_device *ndev, void *address)
        if (address)
                memcpy(ndev->dev_addr, address, ETH_ALEN);
        if (!is_valid_ether_addr(ndev->dev_addr))
-               random_ether_addr(ndev->dev_addr);
+               eth_random_addr(ndev->dev_addr);
 
        /* Set up unicast MAC address filter set its mac address */
        axienet_iow(lp, XAE_UAW0_OFFSET,