Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

dm9000: Support MAC address setting through platform data.

The dm9000 driver reads the chip's MAC address from the attached EEPROM. When
no EEPROM is present, or when the MAC address is invalid, it falls back to
reading the address from the chip.

This patch lets platform code set the desired MAC address through platform
data.

Signed-off-by: Laurent Pinchart <laurentp@cse-semaphore.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>

authored by

Laurent Pinchart and committed by
Jeff Garzik
fe414248 9a5d3414

+6
+5
drivers/net/dm9000.c
··· 1374 1374 for (i = 0; i < 6; i += 2) 1375 1375 dm9000_read_eeprom(db, i / 2, ndev->dev_addr+i); 1376 1376 1377 + if (!is_valid_ether_addr(ndev->dev_addr) && pdata != NULL) { 1378 + mac_src = "platform data"; 1379 + memcpy(ndev->dev_addr, pdata->dev_addr, 6); 1380 + } 1381 + 1377 1382 if (!is_valid_ether_addr(ndev->dev_addr)) { 1378 1383 /* try reading from mac */ 1379 1384
+1
include/linux/dm9000.h
··· 27 27 28 28 struct dm9000_plat_data { 29 29 unsigned int flags; 30 + unsigned char dev_addr[6]; 30 31 31 32 /* allow replacement IO routines */ 32 33