Re: [OpenWrt-Devel] [PATCH] BCMA - Reorder SPROM fill

2012-03-03 Thread Hauke Mehrtens
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 
>>>
>>> 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


Re: [OpenWrt-Devel] [PATCH] BCMA - Reorder SPROM fill

2012-03-02 Thread Nathan Hintz
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 
> > 
> > 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


accounts_info=
action_service=
action_service_bottom=
all_partitions_share=1
auth_exemption_list=
autofw_port0=
blank_disk_info=
block_activex=0
block_cookie=0
block_java=0
block_loopback=0
block_proxy=0
block_wan=1
boardflags=0x1310
boardflags2=0x402
boardnum=42
boardrev=0x1216
boardtype=0x04cf
boot_hw_model=E300
boot_hw_ver=1.0
bootnv_ver=19
boot_ok=ok
boot_ver=v4.2
boot_wait=on
charset=unicode
cifs_master_enable=enabled
cifs_msdfs_enable=enabled
clkfreq=480,240,120
console_loglevel=1
cthwver=xe
ct_modules=
daylight_time=1
ddns_backmx=NO
ddns_cache=
ddns_change=
ddns_enable=0
ddns_enable_buf=
ddns_hostname=
ddns_hostname_2=
ddns_hostname_buf=
ddns_interval=60
ddns_mx=
ddns_passwd=
ddns_passwd_2=
ddns_passwd_buf=
ddns_service=dyndns
ddns_status=
ddns_username=
ddns_username_2=
ddns_username_buf=
ddns_wildcard=OFF
def_hwaddr=00:00:00:00:00:00
detect_charset=unicode
detect_lang=en
device_view_type=0
dhcp_domain=wan
dhcp_lease=0
dhcp_num=50
dhcp_start=100
dhcp_start_conflict=0
dhcp_statics=
dhcp_wins=wan
dir_list=/foreign_shares
dmz_dst_ip=1
dmz_enable=0
dmz_ipaddr=0
dmz_mac=00:00:00:00:00:00
dmz_src_any=1
dmz_src_ip=0.0.0.0 0
domadmins_gid=40206
dr_lan_rx=0
dr_lan_tx=0
dr_setting=0
dr_wan_rx=0
dr_wan_tx=0
EC_Server=1
emf_enable=0
emf_entry=
emf_rtport_entry=
emf_uffp_entry=
enable_game=0
et0macaddr=68:7F:74:xx:xx:xB
et0phyaddr=30
ezc_enable=1
ezc_version=2
filter_dport_grp1=
filter_dport_grp10=
filter_dport_grp2=
filter_dport_grp3=
filter_dport_grp4=
filter_dport_grp5=
filter_dport_grp6=
filter_dport_grp7=
filter_dport_grp8=
filter_dport_grp9=
filter_id=1
filter_ip_grp1=
filter_ip_grp10=
filter_ip_grp2=
filter_ip_grp3=
filter_ip_grp4=
filter_ip_grp5=
filter_ip_grp6=
filter_ip_grp7=
filter_ip_grp8=
filter_ip_grp9=
filter_mac_grp1=
filter_mac_grp10=
filter_mac_grp2=
filter_mac_grp3=
filter_mac_grp4=
filter_mac_grp5=
filter_mac_grp6=
filter_mac_grp7=
filter_mac_grp8=
filter_mac_grp9=
filter=on
filter_port=
filter_port_grp1=
filter_port_grp10=
filter_port_grp2=
filter_port_grp3=
filter_port_grp4=
filter_port_grp5=
filter_port_grp6=
filter_port_grp7=
filter_port_grp8=
filter_port_grp9=
filter_rule1=
filter_rule10=
filter_rule2=
filter_rule3=
filter_rule4=
filter_rule5=
filter_rule6=
filter_rule7=
filter_rule8=
filter_rule9=
filter_services=$NAME:003:DNS$PROT:003:udp$PORT:005:53:53< >$NAME:004:Ping$PROT:004:icmp$PORT:003:0:0< >$NAME:004:HTTP$PROT>
filter_tod1=
filter_tod10=
filter_tod2=
filter_tod3=
filter_tod4=
filter_tod5=
filter_tod6=
filter_tod7=
filter_tod8=
filter_tod9=
filter_tod_buf1=
filter_tod_buf10=
filter_tod_buf2=
filter_tod_buf3=
filter_tod_buf4=
filter_tod_buf5=
filter_tod_buf6=
filter_tod_buf7=
filter_tod_buf8=
filter_tod_buf9=
filter_web_host1=
filter_web_host10=
filter_web_host2=
filter_web_host3=
filter_web_host4=
filter_web_host5=
filter_web_host6=
filter_web_host7=
filter_

Re: [OpenWrt-Devel] [PATCH] BCMA - Reorder SPROM fill

2012-03-02 Thread Hauke Mehrtens
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 
> 
> 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
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH] BCMA - Reorder SPROM fill

2012-03-01 Thread Nathan Hintz
The SPROM is initialized in bcm47xx_fill_sprom, so move the call to 
bcm47xx_fill_sprom_ethernet after it.

Signed-off-by: Nathan Hintz 

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");


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