Merge branch 'for-john' of git://git.kernel.org/pub/scm/linux/kernel/git/jberg/mac80211
[deliverable/linux.git] / include / linux / etherdevice.h
index 3d406e0ede6d831c9a0c9992b444b110e1e13d2d..d426336d92d9e4bb34f5f049bc7f4f05d49303bb 100644 (file)
@@ -124,17 +124,30 @@ static inline bool is_valid_ether_addr(const u8 *addr)
 }
 
 /**
- * random_ether_addr - Generate software assigned random Ethernet address
+ * eth_random_addr - Generate software assigned random Ethernet address
  * @addr: Pointer to a six-byte array containing the Ethernet address
  *
  * Generate a random Ethernet address (MAC) that is not multicast
  * and has the local assigned bit set.
  */
-static inline void random_ether_addr(u8 *addr)
+static inline void eth_random_addr(u8 *addr)
 {
-       get_random_bytes (addr, ETH_ALEN);
-       addr [0] &= 0xfe;       /* clear multicast bit */
-       addr [0] |= 0x02;       /* set local assignment bit (IEEE802) */
+       get_random_bytes(addr, ETH_ALEN);
+       addr[0] &= 0xfe;        /* clear multicast bit */
+       addr[0] |= 0x02;        /* set local assignment bit (IEEE802) */
+}
+
+#define random_ether_addr(addr) eth_random_addr(addr)
+
+/**
+ * eth_broadcast_addr - Assign broadcast address
+ * @addr: Pointer to a six-byte array containing the Ethernet address
+ *
+ * Assign the broadcast address to the given address array.
+ */
+static inline void eth_broadcast_addr(u8 *addr)
+{
+       memset(addr, 0xff, ETH_ALEN);
 }
 
 /**
@@ -149,7 +162,7 @@ static inline void random_ether_addr(u8 *addr)
 static inline void eth_hw_addr_random(struct net_device *dev)
 {
        dev->addr_assign_type |= NET_ADDR_RANDOM;
-       random_ether_addr(dev->dev_addr);
+       eth_random_addr(dev->dev_addr);
 }
 
 /**
This page took 0.026995 seconds and 5 git commands to generate.