aboutsummaryrefslogtreecommitdiffstats
path: root/net/ethernet
diff options
context:
space:
mode:
authorJonathan Herman <hermanjl@cs.unc.edu>2013-01-17 16:15:55 -0500
committerJonathan Herman <hermanjl@cs.unc.edu>2013-01-17 16:15:55 -0500
commit8dea78da5cee153b8af9c07a2745f6c55057fe12 (patch)
treea8f4d49d63b1ecc92f2fddceba0655b2472c5bd9 /net/ethernet
parent406089d01562f1e2bf9f089fd7637009ebaad589 (diff)
Patched in Tegra support.
Diffstat (limited to 'net/ethernet')
-rw-r--r--net/ethernet/Makefile2
-rw-r--r--net/ethernet/eth.c15
2 files changed, 7 insertions, 10 deletions
diff --git a/net/ethernet/Makefile b/net/ethernet/Makefile
index 32317750540..7cef1d8ace2 100644
--- a/net/ethernet/Makefile
+++ b/net/ethernet/Makefile
@@ -3,3 +3,5 @@
3# 3#
4 4
5obj-y += eth.o 5obj-y += eth.o
6obj-$(subst m,y,$(CONFIG_IPX)) += pe2.o
7obj-$(subst m,y,$(CONFIG_ATALK)) += pe2.o
diff --git a/net/ethernet/eth.c b/net/ethernet/eth.c
index 4efad533e5f..a2468363978 100644
--- a/net/ethernet/eth.c
+++ b/net/ethernet/eth.c
@@ -59,6 +59,7 @@
59#include <net/ip.h> 59#include <net/ip.h>
60#include <net/dsa.h> 60#include <net/dsa.h>
61#include <asm/uaccess.h> 61#include <asm/uaccess.h>
62#include <asm/system.h>
62 63
63__setup("ether=", netdev_boot_setup); 64__setup("ether=", netdev_boot_setup);
64 65
@@ -77,7 +78,7 @@ __setup("ether=", netdev_boot_setup);
77 */ 78 */
78int eth_header(struct sk_buff *skb, struct net_device *dev, 79int eth_header(struct sk_buff *skb, struct net_device *dev,
79 unsigned short type, 80 unsigned short type,
80 const void *daddr, const void *saddr, unsigned int len) 81 const void *daddr, const void *saddr, unsigned len)
81{ 82{
82 struct ethhdr *eth = (struct ethhdr *)skb_push(skb, ETH_HLEN); 83 struct ethhdr *eth = (struct ethhdr *)skb_push(skb, ETH_HLEN);
83 84
@@ -164,7 +165,7 @@ __be16 eth_type_trans(struct sk_buff *skb, struct net_device *dev)
164 eth = eth_hdr(skb); 165 eth = eth_hdr(skb);
165 166
166 if (unlikely(is_multicast_ether_addr(eth->h_dest))) { 167 if (unlikely(is_multicast_ether_addr(eth->h_dest))) {
167 if (ether_addr_equal_64bits(eth->h_dest, dev->broadcast)) 168 if (!compare_ether_addr_64bits(eth->h_dest, dev->broadcast))
168 skb->pkt_type = PACKET_BROADCAST; 169 skb->pkt_type = PACKET_BROADCAST;
169 else 170 else
170 skb->pkt_type = PACKET_MULTICAST; 171 skb->pkt_type = PACKET_MULTICAST;
@@ -179,8 +180,7 @@ __be16 eth_type_trans(struct sk_buff *skb, struct net_device *dev)
179 */ 180 */
180 181
181 else if (1 /*dev->flags&IFF_PROMISC */ ) { 182 else if (1 /*dev->flags&IFF_PROMISC */ ) {
182 if (unlikely(!ether_addr_equal_64bits(eth->h_dest, 183 if (unlikely(compare_ether_addr_64bits(eth->h_dest, dev->dev_addr)))
183 dev->dev_addr)))
184 skb->pkt_type = PACKET_OTHERHOST; 184 skb->pkt_type = PACKET_OTHERHOST;
185 } 185 }
186 186
@@ -232,7 +232,6 @@ EXPORT_SYMBOL(eth_header_parse);
232 * @neigh: source neighbour 232 * @neigh: source neighbour
233 * @hh: destination cache entry 233 * @hh: destination cache entry
234 * @type: Ethernet type field 234 * @type: Ethernet type field
235 *
236 * Create an Ethernet header template from the neighbour. 235 * Create an Ethernet header template from the neighbour.
237 */ 236 */
238int eth_header_cache(const struct neighbour *neigh, struct hh_cache *hh, __be16 type) 237int eth_header_cache(const struct neighbour *neigh, struct hh_cache *hh, __be16 type)
@@ -275,7 +274,6 @@ EXPORT_SYMBOL(eth_header_cache_update);
275 * eth_mac_addr - set new Ethernet hardware address 274 * eth_mac_addr - set new Ethernet hardware address
276 * @dev: network device 275 * @dev: network device
277 * @p: socket address 276 * @p: socket address
278 *
279 * Change hardware address of device. 277 * Change hardware address of device.
280 * 278 *
281 * This doesn't change hardware matching, so needs to be overridden 279 * This doesn't change hardware matching, so needs to be overridden
@@ -285,13 +283,11 @@ int eth_mac_addr(struct net_device *dev, void *p)
285{ 283{
286 struct sockaddr *addr = p; 284 struct sockaddr *addr = p;
287 285
288 if (!(dev->priv_flags & IFF_LIVE_ADDR_CHANGE) && netif_running(dev)) 286 if (netif_running(dev))
289 return -EBUSY; 287 return -EBUSY;
290 if (!is_valid_ether_addr(addr->sa_data)) 288 if (!is_valid_ether_addr(addr->sa_data))
291 return -EADDRNOTAVAIL; 289 return -EADDRNOTAVAIL;
292 memcpy(dev->dev_addr, addr->sa_data, ETH_ALEN); 290 memcpy(dev->dev_addr, addr->sa_data, ETH_ALEN);
293 /* if device marked as NET_ADDR_RANDOM, reset it */
294 dev->addr_assign_type &= ~NET_ADDR_RANDOM;
295 return 0; 291 return 0;
296} 292}
297EXPORT_SYMBOL(eth_mac_addr); 293EXPORT_SYMBOL(eth_mac_addr);
@@ -333,7 +329,6 @@ const struct header_ops eth_header_ops ____cacheline_aligned = {
333/** 329/**
334 * ether_setup - setup Ethernet network device 330 * ether_setup - setup Ethernet network device
335 * @dev: network device 331 * @dev: network device
336 *
337 * Fill in the fields of the device structure with Ethernet-generic values. 332 * Fill in the fields of the device structure with Ethernet-generic values.
338 */ 333 */
339void ether_setup(struct net_device *dev) 334void ether_setup(struct net_device *dev)