From: Joe Perches <joe@perches.com>
To: David Miller <davem@davemloft.net>, linux-kernel@vger.kernel.org
Cc: Johannes Berg <johannes@sipsolutions.net>, netdev@vger.kernel.org
Subject: [PATCH net-next 1/8] etherdevice: Rename random_ether_addr to eth_random_addr
Date: Thu, 12 Jul 2012 22:33:05 -0700 [thread overview]
Message-ID: <de8d9911e9aca6ddd34efcb89c87fc6e33a9cd43.1342157022.git.joe@perches.com> (raw)
In-Reply-To: <1341968967.13724.23.camel@joe2Laptop>
In-Reply-To: <cover.1342157022.git.joe@perches.com>
Add some API symmetry to eth_broadcast_addr and
add a #define to the old name for backward compatibility.
Signed-off-by: Joe Perches <joe@perches.com>
---
include/linux/etherdevice.h | 14 ++++++++------
1 files changed, 8 insertions(+), 6 deletions(-)
diff --git a/include/linux/etherdevice.h b/include/linux/etherdevice.h
index 98a27cc..d426336 100644
--- a/include/linux/etherdevice.h
+++ b/include/linux/etherdevice.h
@@ -124,19 +124,21 @@ 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
@@ -160,7 +162,7 @@ static inline void eth_broadcast_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);
}
/**
--
1.7.8.111.gad25c.dirty
next prev parent reply other threads:[~2012-07-13 5:33 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <1341968967.13724.23.camel@joe2Laptop>
2012-07-13 5:33 ` [PATCH net-next 0/8] " Joe Perches
2012-07-13 5:33 ` Joe Perches [this message]
2012-07-13 5:33 ` [PATCH net-next 2/8] ethernet: Use eth_random_addr Joe Perches
2012-07-13 5:33 ` [PATCH net-next 3/8] net: usb: " Joe Perches
2012-07-13 5:33 ` [PATCH net-next 4/8] wireless: " Joe Perches
2012-07-13 5:54 ` Hin-Tak Leung
2012-07-13 7:15 ` Gertjan van Wingerde
2012-07-13 5:33 ` [PATCH net-next 5/8] drivers/net: " Joe Perches
2012-07-13 5:33 ` [PATCH net-next 6/8] s390: " Joe Perches
2012-07-13 5:33 ` [PATCH net-next 7/8] usb: " Joe Perches
2012-07-16 11:15 ` Felipe Balbi
2012-07-13 5:33 ` [PATCH net-next 8/8] arch: " Joe Perches
2012-07-15 21:51 ` Mike Frysinger
2012-07-16 12:56 ` Mark Salter
2012-07-16 14:20 ` Ralf Baechle
2012-07-16 10:14 ` [PATCH net-next 0/8] etherdevice: Rename random_ether_addr to eth_random_addr Felipe Balbi
2012-07-16 10:29 ` David Miller
2012-07-16 11:12 ` Felipe Balbi
2012-07-16 11:17 ` David Miller
2012-07-17 5:39 ` David Miller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=de8d9911e9aca6ddd34efcb89c87fc6e33a9cd43.1342157022.git.joe@perches.com \
--to=joe@perches.com \
--cc=davem@davemloft.net \
--cc=johannes@sipsolutions.net \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®