From fa0879e37b59e8e3f130a30a9e6fa515717c5bdd Mon Sep 17 00:00:00 2001 From: Stefan Hajnoczi Date: Mon, 21 Jan 2013 01:17:22 +0000 Subject: net: split eth_mac_addr for better error handling When we set mac address, software mac address in system and hardware mac address all need to be updated. Current eth_mac_addr() doesn't allow callers to implement error handling nicely. This patch split eth_mac_addr() to prepare part and real commit part, then we can prepare first, and try to change hardware address, then do the real commit if hardware address is set successfully. Signed-off-by: Stefan Hajnoczi Signed-off-by: Amos Kong Signed-off-by: David S. Miller --- include/linux/etherdevice.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'include/linux/etherdevice.h') diff --git a/include/linux/etherdevice.h b/include/linux/etherdevice.h index 1a43e1b4f7ad..c623861964e4 100644 --- a/include/linux/etherdevice.h +++ b/include/linux/etherdevice.h @@ -40,6 +40,8 @@ extern int eth_header_cache(const struct neighbour *neigh, struct hh_cache *hh, extern void eth_header_cache_update(struct hh_cache *hh, const struct net_device *dev, const unsigned char *haddr); +extern int eth_prepare_mac_addr_change(struct net_device *dev, void *p); +extern void eth_commit_mac_addr_change(struct net_device *dev, void *p); extern int eth_mac_addr(struct net_device *dev, void *p); extern int eth_change_mtu(struct net_device *dev, int new_mtu); extern int eth_validate_addr(struct net_device *dev); -- cgit v1.2.3-59-g8ed1b