On 03/03/2012 04:56 AM, Nathan Hintz wrote:
> On Fri, 2012-03-02 at 21:13 +0100, Hauke Mehrtens wrote:
>> On 03/02/2012 06:01 AM, Nathan Hintz wrote:
>>> The SPROM is initialized in bcm47xx_fill_sprom, so move the call to 
>>> bcm47xx_fill_sprom_ethernet after it.
>>>
>>> Signed-off-by: Nathan Hintz <nlhi...@hotmail.com>
>>>
>>> Index: 
>>> target/linux/brcm47xx/patches-3.2/199-MIPS-BCM47XX-provide-sprom-to-bcma-bus.patch
>>> ===================================================================
>>> --- 
>>> target/linux/brcm47xx/patches-3.2/199-MIPS-BCM47XX-provide-sprom-to-bcma-bus.patch
>>>       (revision 30770)
>>> +++ 
>>> target/linux/brcm47xx/patches-3.2/199-MIPS-BCM47XX-provide-sprom-to-bcma-bus.patch
>>>       (working copy)
>>> @@ -66,13 +66,13 @@
>>>  +          bcm47xx_fill_sprom(out, prefix);
>>>  +          return 0;
>>>  +  } else if (bus->hosttype == BCMA_HOSTTYPE_SOC) {
>>> -+          bcm47xx_fill_sprom_ethernet(out, NULL);
>>>  +          core = bcma_find_core(bus, BCMA_CORE_80211);
>>>  +          if (core) {
>>>  +                  snprintf(prefix, sizeof(prefix), "sb/%u/",
>>>  +                           core->core_index);
>>>  +                  bcm47xx_fill_sprom(out, prefix);
>>>  +          }
>>> ++          bcm47xx_fill_sprom_ethernet(out, NULL);
>>>  +          return 0;
>>>  +  } else {
>>>  +          printk(KERN_WARNING "bcm47xx: unable to fill SPROM for given 
>>> bustype.\n");
>>
>> Why do you want to move this call? If there is a mac address stored with
>> the prefix (sb/1/) for this core we should take it in favor of the
>> general mac address without a prefix. In my device both addresses are
>> the same so it would not make a difference, but I haven't looked into
>> all nvrams.
>>
>> Hauke
>>
> Hi Hauke,
> 
> I'm sorry for not being clear.  The problem I was trying to address was
> that the first thing "bcm47xx_fill_sprom" does is to zero fill the
> entire sprom, effectively wiping out anything that might have been
> filled in by the previous call to "bcm47xx_fill_sprom_ethernet".  For
> Linksys E3000, et0macaddr and et0phyaddr don't have a prefix in NVRAM,
> and therefore ended up not being set.  I've attached an NVRAM dump.  How
> would you like to proceed?
> 
> Thanks,
> 
> Nathan

Hi Nathan,

Thanks for the clarification. I would more like the memset being moved
to the functions calling bcm47xx_fill_sprom() then change the order of
the functions being called. I do not think it is even needed in most
cases, as struct ssb_sprom should be already been set to zero.

Hauke
_______________________________________________
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel

Reply via email to