ar71xx: enable sysupgrade on the AP96 and DB120 boards
[openwrt/svn-archive/archive.git] / target / linux / brcm47xx / patches-3.0 / 0022-bcma-use-randoom-mac-address-as-long-as-reading-it-o.patch
1 From 6dd27601bee9b3c26cdb67246b6da51dd696ac34 Mon Sep 17 00:00:00 2001
2 From: Hauke Mehrtens <hauke@hauke-m.de>
3 Date: Fri, 22 Jul 2011 17:11:51 +0200
4 Subject: [PATCH 22/22] bcma: use randoom mac address as long as reading it out does not work
5
6
7 Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
8 ---
9 drivers/bcma/sprom.c | 5 ++++-
10 1 files changed, 4 insertions(+), 1 deletions(-)
11
12 --- a/drivers/bcma/sprom.c
13 +++ b/drivers/bcma/sprom.c
14 @@ -13,6 +13,7 @@
15 #include <linux/io.h>
16 #include <linux/dma-mapping.h>
17 #include <linux/slab.h>
18 +#include <linux/etherdevice.h>
19
20 #define SPOFF(offset) ((offset) / sizeof(u16))
21
22 @@ -144,8 +145,10 @@ int bcma_sprom_get(struct bcma_bus *bus)
23 if (!bus->drv_cc.core)
24 return -EOPNOTSUPP;
25
26 - if (!(bus->drv_cc.capabilities & BCMA_CC_CAP_SPROM))
27 + if (!(bus->drv_cc.capabilities & BCMA_CC_CAP_SPROM)) {
28 + random_ether_addr(bus->sprom.il0mac);
29 return -ENOENT;
30 + }
31
32 sprom = kcalloc(SSB_SPROMSIZE_WORDS_R4, sizeof(u16),
33 GFP_KERNEL);