[Avila] Fw: GW2345 and Openwrt ethernet no worky

Chris Lang clang at gateworks.com
Mon Nov 19 00:41:11 EST 2007


----- Original Message ----- 
From: "Chris Lang" <clang at gateworks.com>
To: "Avila" <avila at lists.unixstudios.net>
Sent: Friday, November 02, 2007 8:09 PM
Subject: Re: [Avila] GW2345 and Openwrt ethernet no worky


> Mark,
>
> That is great that you have "some" success, hopefully I will be able to 
> help you further. To answer the question about the eeprom address, this 
> can be a little confusing as to the address, however, it is because it is 
> using the lm_sensors layer, instead of accessing the hardware directly, 
> like we do with the IAL. For some reason, unknown to me, lm_sensors maps 
> eeprom's to 0x50, with each address accessing 256 bytes, thus 0x51 would 
> be at the 257 byte of the eeprom (hence eeprom address 0x100, which is 
> where we store the mac address's). So this mapping is correct.
>
> As far as needing to have a cable plugged into port 1 of the gang in order 
> to use the gang, I understand this problem, and the proper way to address 
> this issue is when you check to see if there is a link on eth0, you would 
> check phy 1-4 to see if there is a link (I have a patch for this in the 
> IAL, and it was fairly simple). I have looked at the code for the 
> opensource driver, and it doesn't appear that it will be that easy to 
> check the link on all of the phy's, however, I have attached a work around 
> that basiclly returns that there is always a link, this will just cause 
> the kernel to send packets to the phy, wether there is a link or not, 
> which really doesn't matter that much.
>
> Here is the simple patch. This is an untested patch, and comes with no 
> warranty.   :)
>
> Chris Lang
>
>
> diff -Nur linux-2.6.19.2/drivers/net/ixp4xx/mac_driver.c 
> linux-2.6.19.2-owrt/drivers/net/ixp4xx/mac_driver.c
> --- linux-2.6.19.2/drivers/net/ixp4xx/mac_driver.c 2007-04-15 
> 14:26:54.000000000 +0200
> +++ linux-2.6.19.2-owrt/drivers/net/ixp4xx/mac_driver.c 2007-04-15 
> 14:33:44.000000000 +0200
> @@ -503,12 +524,18 @@
> static int ixmac_nway_reset(struct net_device *dev)
> {
>  struct mac_info *mac = netdev_priv(dev);
>  return mii_nway_restart(&mac->mii);
> }
>
> static u32 ixmac_get_link(struct net_device *dev)
> {
>  struct mac_info *mac = netdev_priv(dev);
> + if ( mac->mii.phy_id == 1 ) {
> +  return 1;
> + }
>  return mii_link_ok(&mac->mii);
> }
>
>
> ----- Original Message ----- 
> From: "Mark Kelly" <mark.kelly at cadre5.com>
> To: "Avila" <avila at lists.unixstudios.net>
> Sent: Friday, November 02, 2007 9:04 AM
> Subject: RE: [Avila] GW2345 and Openwrt ethernet no worky
>
>
>> Ok, I have success at least to a point.
>>
>> Hope this helps someone else out, but here's how I have it configured:
>>
>>
>> eth0      Link encap:Ethernet  HWaddr 00:D0:12:03:72:67
>>          inet addr:192.168.1.1  Bcast:192.168.1.255  Mask:255.255.255.0
>>          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
>>          RX packets:5192 errors:0 dropped:0 overruns:0 frame:0
>>          TX packets:145 errors:0 dropped:0 overruns:0 carrier:0
>>          collisions:0 txqueuelen:100
>>          RX bytes:325733 (318.0 KiB)  TX bytes:13552 (13.2 KiB)
>>
>> eth1      Link encap:Ethernet  HWaddr 00:D0:12:13:72:67
>>          inet addr:192.168.3.2  Bcast:192.168.3.255  Mask:255.255.255.0
>>          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
>>          RX packets:711 errors:0 dropped:0 overruns:0 frame:0
>>          TX packets:88 errors:0 dropped:0 overruns:0 carrier:0
>>          collisions:0 txqueuelen:100
>>          RX bytes:44151 (43.1 KiB)  TX bytes:8355 (8.1 KiB)
>>
>> lo        Link encap:Local Loopback
>>          inet addr:127.0.0.1  Mask:255.0.0.0
>>          UP LOOPBACK RUNNING  MTU:16436  Metric:1
>>          RX packets:222 errors:0 dropped:0 overruns:0 frame:0
>>          TX packets:222 errors:0 dropped:0 overruns:0 carrier:0
>>          collisions:0 txqueuelen:0
>>          RX bytes:13257 (12.9 KiB)  TX bytes:13257 (12.9 KiB)
>>
>> For some reason both eth's get the same MAC address, I manually changed 
>> the 2nd one at one point, but to do it before I posted again :)
>>
>> My /etc/config/network:
>>
>> config interface loopback
>>      option ifname   lo
>>      option proto    static
>>      option ipaddr   127.0.0.1
>>      option netmask  255.0.0.0
>>
>> config interface lan
>>      option ifname   eth0
>>      option proto    static
>>      option ipaddr   192.168.1.1
>>      option netmask  255.255.255.0
>>      option dns      '192.168.1.1'
>>      option gateway  '192.168.1.1'
>>
>> config interface wan
>>        option ifname   eth1
>>        option proto    static
>>        option ipaddr   192.168.3.2
>>        option netmask  255.255.255.0
>> option gateway  192.168.3.1
>>
>> config interface wlan0
>>      option ifname   ath1
>>      option proto    dhcp
>>
>> my kernel routing table looks like this:
>>
>> root at OpenWrt:/$ route
>> Kernel IP routing table
>> Destination     Gateway         Genmask         Flags Metric Ref    Use 
>> Iface
>> 192.168.3.0     *               255.255.255.0   U     0      0        0 
>> eth1
>> 192.168.1.0     *               255.255.255.0   U     0      0        0 
>> eth0
>> 192.168.1.0     *               255.255.255.0   U     0      0        0 
>> ath0
>> 172.28.2.0      *               255.255.255.0   U     0      0        0 
>> ath1
>> default         172.28.2.1      0.0.0.0         UG    0      0        0 
>> ath1
>> default         192.168.3.1     0.0.0.0         UG    0      0        0 
>> eth1
>> default         192.168.1.1     0.0.0.0         UG    0      0        0 
>> eth0
>>
>>
>>
>> As Chris said in his email earlier, the kendin switch is not detected 
>> correctly, so in order to use the gang ports I have to have something 
>> with an active link in the first port, then they all work :)  So until I 
>> can get the switch up and running or the Openwrt guys beat me to it, I 
>> can live with this.
>>
>> I've got the changes I made to the avila openwrt patch files if anyone 
>> needs them.  I basically only changed the PHY id's but that did the 
>> trick. I'm still confused on the EEPROM reading from openwrt.  The 
>> addresses do not match what's in my EEPROM map from Avila, but it appears 
>> to work or at least for one MAC it does :)
>>
>>
>>
> 




More information about the Avila mailing list