eth.c (404c3bc30cb1361e1b3533643326ab472d24a618) eth.c (2c53040f018b6c36a46eec75b9b937aaa5f78e6d)
1/*
2 * INET An implementation of the TCP/IP protocol suite for the LINUX
3 * operating system. INET is implemented using the BSD Socket
4 * interface as the means of communication with the user level.
5 *
6 * Ethernet-type device handling.
7 *
8 * Version: @(#)eth.c 1.0.7 05/25/93

--- 218 unchanged lines hidden (view full) ---

227}
228EXPORT_SYMBOL(eth_header_parse);
229
230/**
231 * eth_header_cache - fill cache entry from neighbour
232 * @neigh: source neighbour
233 * @hh: destination cache entry
234 * @type: Ethernet type field
1/*
2 * INET An implementation of the TCP/IP protocol suite for the LINUX
3 * operating system. INET is implemented using the BSD Socket
4 * interface as the means of communication with the user level.
5 *
6 * Ethernet-type device handling.
7 *
8 * Version: @(#)eth.c 1.0.7 05/25/93

--- 218 unchanged lines hidden (view full) ---

227}
228EXPORT_SYMBOL(eth_header_parse);
229
230/**
231 * eth_header_cache - fill cache entry from neighbour
232 * @neigh: source neighbour
233 * @hh: destination cache entry
234 * @type: Ethernet type field
235 *
235 * Create an Ethernet header template from the neighbour.
236 */
237int eth_header_cache(const struct neighbour *neigh, struct hh_cache *hh, __be16 type)
238{
239 struct ethhdr *eth;
240 const struct net_device *dev = neigh->dev;
241
242 eth = (struct ethhdr *)

--- 26 unchanged lines hidden (view full) ---

269 haddr, ETH_ALEN);
270}
271EXPORT_SYMBOL(eth_header_cache_update);
272
273/**
274 * eth_mac_addr - set new Ethernet hardware address
275 * @dev: network device
276 * @p: socket address
236 * Create an Ethernet header template from the neighbour.
237 */
238int eth_header_cache(const struct neighbour *neigh, struct hh_cache *hh, __be16 type)
239{
240 struct ethhdr *eth;
241 const struct net_device *dev = neigh->dev;
242
243 eth = (struct ethhdr *)

--- 26 unchanged lines hidden (view full) ---

270 haddr, ETH_ALEN);
271}
272EXPORT_SYMBOL(eth_header_cache_update);
273
274/**
275 * eth_mac_addr - set new Ethernet hardware address
276 * @dev: network device
277 * @p: socket address
278 *
277 * Change hardware address of device.
278 *
279 * This doesn't change hardware matching, so needs to be overridden
280 * for most real devices.
281 */
282int eth_mac_addr(struct net_device *dev, void *p)
283{
284 struct sockaddr *addr = p;
285
279 * Change hardware address of device.
280 *
281 * This doesn't change hardware matching, so needs to be overridden
282 * for most real devices.
283 */
284int eth_mac_addr(struct net_device *dev, void *p)
285{
286 struct sockaddr *addr = p;
287
286 if (netif_running(dev))
288 if (!(dev->priv_flags & IFF_LIVE_ADDR_CHANGE) && netif_running(dev))
287 return -EBUSY;
288 if (!is_valid_ether_addr(addr->sa_data))
289 return -EADDRNOTAVAIL;
290 memcpy(dev->dev_addr, addr->sa_data, ETH_ALEN);
291 /* if device marked as NET_ADDR_RANDOM, reset it */
292 dev->addr_assign_type &= ~NET_ADDR_RANDOM;
293 return 0;
294}

--- 31 unchanged lines hidden (view full) ---

326 .rebuild = eth_rebuild_header,
327 .cache = eth_header_cache,
328 .cache_update = eth_header_cache_update,
329};
330
331/**
332 * ether_setup - setup Ethernet network device
333 * @dev: network device
289 return -EBUSY;
290 if (!is_valid_ether_addr(addr->sa_data))
291 return -EADDRNOTAVAIL;
292 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;
296}

--- 31 unchanged lines hidden (view full) ---

328 .rebuild = eth_rebuild_header,
329 .cache = eth_header_cache,
330 .cache_update = eth_header_cache_update,
331};
332
333/**
334 * ether_setup - setup Ethernet network device
335 * @dev: network device
336 *
334 * Fill in the fields of the device structure with Ethernet-generic values.
335 */
336void ether_setup(struct net_device *dev)
337{
338 dev->header_ops = &eth_header_ops;
339 dev->type = ARPHRD_ETHER;
340 dev->hard_header_len = ETH_HLEN;
341 dev->mtu = ETH_DATA_LEN;

--- 56 unchanged lines hidden ---
337 * Fill in the fields of the device structure with Ethernet-generic values.
338 */
339void ether_setup(struct net_device *dev)
340{
341 dev->header_ops = &eth_header_ops;
342 dev->type = ARPHRD_ETHER;
343 dev->hard_header_len = ETH_HLEN;
344 dev->mtu = ETH_DATA_LEN;

--- 56 unchanged lines hidden ---