OpenWrt Forum Archive

Topic: RB450 - using Five Ethernet Ports

The content of this topic has been archived between 6 Feb 2018 and 6 May 2018. Unfortunately there are posts – most likely complete pages – missing.

Hello,

Is there patches for RB493AH IC+ IP178C switch available for kernel 2.6.28 for trunk branch?

Thanks

Edit: Disregard this post, I accidentally booted an old WRT image from the network that has phorn's old ICPlus switch driver. My dmesg looks just like Lorenzo's with no mention of the swtich or switch driver.

I got the IP178c switch recognized but the switch still doesn't appear to be working yet...

br-lan: port 1(eth0) entering forwarding state
roboswitch: Probing device eth0: <3>roboswitch: [/home/rob/kamikaze/build_dir/li
nux-ar71xx/kmod-switch/switch-robo.c:117] SIOCGETCPHYRD failed!
roboswitch: [/home/rob/kamikaze/build_dir/linux-ar71xx/kmod-switch/switch-robo.c
:117] SIOCGETCPHYRD failed!
No Robo switch in managed mode found
roboswitch: Probing device eth1: Invalid phy address (0)
roboswitch: Probing device eth2: No such device
roboswitch: Probing device eth3: No such device
ip175c: Trying netdev eth0... <4>ip175c: Unable to get MII register 0,2: error 1
22
ip175c: Trying netdev eth1... <6> Found a IC+ IP178C switch!
PPP generic driver version 2.4.2

(Last edited by robrob on 15 May 2009, 12:52)

robrob wrote:

I got the IP178c switch recognized but the switch still doesn't appear to be working yet...

br-lan: port 1(eth0) entering forwarding state
roboswitch: Probing device eth0: <3>roboswitch: [/home/rob/kamikaze/build_dir/li
nux-ar71xx/kmod-switch/switch-robo.c:117] SIOCGETCPHYRD failed!
roboswitch: [/home/rob/kamikaze/build_dir/linux-ar71xx/kmod-switch/switch-robo.c
:117] SIOCGETCPHYRD failed!
No Robo switch in managed mode found
roboswitch: Probing device eth1: Invalid phy address (0)
roboswitch: Probing device eth2: No such device
roboswitch: Probing device eth3: No such device
ip175c: Trying netdev eth0... <4>ip175c: Unable to get MII register 0,2: error 1
22
ip175c: Trying netdev eth1... <6> Found a IC+ IP178C switch!
PPP generic driver version 2.4.2

Hi robrob, what's your opwnwrt svn revision and configuration you used?
I'm trying to do the same on an RB450 board but it doesn't recognize the switch..
RB433 and RB450 should have the same hardware for the switch, so if you
would please share your setup in detail maybe I can build a working firmware for my RB450.
Thank you!

Lorenzo,

I was wrong about the new SVN recognizing the switch. I accidentally booted from the network which has an old WRT build with phorn's old switch driver. Like you, I have not been able to get the new driver to recognize the 178c switch--my dmesg looks just like yours.

I have noticed when I plug a computer into the 1st switch port, labeled Eth2 on the case, I get a "eth1: link up" message, but nothing when I plug into any of the other 7 switch ports. I cannot ping anything when connected to the Eth2 port though.

Here's my dmesg with no mention of the IP178c from today's svn with the suggested changes from the previous few posts:

root@OpenWrt:/# dmesg
Linux version 2.6.28.10 (rob@Server) (gcc version 4.1.2) #2 Fri May 15 19:21:55
EDT 2009
prom: fw_arg0=00000007, fw_arg1=a0861c00, fw_arg2=00000000, fw_arg3=00000000
MyLoader: sysp=ffffffff, boardp=ffffffff, parts=ffffffff
console [early0] enabled
CPU revision is: 00019374 (MIPS 24Kc)
Atheros AR7161 rev 2 (id:0xaa), CPU:680.000 MHz, AHB:170.000 MHz, DDR:340.000 MH
z
Determined physical RAM map:
 memory: 08000000 @ 00000000 (usable)
Initrd not found or empty - disabling initrd
Zone PFN ranges:
  Normal   0x00000000 -> 0x00008000
Movable zone start PFN for each node
early_node_map[1] active PFN ranges
    0: 0x00000000 -> 0x00008000
On node 0 totalpages: 32768
free_area_init_node: node 0, pgdat 8029fbe0, node_mem_map 81000000
  Normal zone: 256 pages used for memmap
  Normal zone: 0 pages reserved
  Normal zone: 32512 pages, LIFO batch:7
  Movable zone: 0 pages used for memmap
Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 32512
Kernel command line: rootfstype=squashfs,yaffs,jffs2 noinitrd console=ttyS0,1152
00
Primary instruction cache 64kB, VIPT, 4-way, linesize 32 bytes.
Primary data cache 32kB, 4-way, VIPT, cache aliases, linesize 32 bytes
Writing ErrCtl register=00000800
Readback ErrCtl register=00000800
PID hash table entries: 512 (order: 9, 2048 bytes)
Dentry cache hash table entries: 16384 (order: 4, 65536 bytes)
Inode-cache hash table entries: 8192 (order: 3, 32768 bytes)
Memory: 126820k/131072k available (1972k kernel code, 4068k reserved, 338k data,
 140k init, 0k highmem)
SLUB: Genslabs=6, HWalign=32, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
Calibrating delay loop... 452.19 BogoMIPS (lpj=2260992)
Mount-cache hash table entries: 512
net_namespace: 480 bytes
NET: Registered protocol family 16
MIPS: machine is MikroTik RouterBOARD 493/AH
registering PCI controller with io_map_base unset
pci 0000:00:00.0: reg 10 32bit mmio: [0x000000-0xfffffff]
pci 0000:00:00.0: reg 14 io port: [0x00-0xff]
pci 0000:00:00.0: supports D1 D2
pci 0000:00:00.0: PME# supported from D0 D1 D2 D3hot
pci 0000:00:00.0: PME# disabled
pci 0000:00:12.0: reg 10 32bit mmio: [0x000000-0x00ffff]
pci 0000:00:14.0: reg 10 32bit mmio: [0x000000-0x00ffff]
pci 0000:00:14.0: PME# supported from D0 D3hot
pci 0000:00:14.0: PME# disabled
PCI: mapping irq 32 to pin1@0000:00:12.0
PCI: mapping irq 34 to pin1@0000:00:14.0
NET: Registered protocol family 2
Switched to high resolution mode on CPU 0
IP route cache hash table entries: 1024 (order: 0, 4096 bytes)
TCP established hash table entries: 4096 (order: 3, 32768 bytes)
TCP bind hash table entries: 4096 (order: 2, 16384 bytes)
TCP: Hash tables configured (established 4096 bind 4096)
TCP reno registered
NET: Registered protocol family 1
squashfs: version 3.0 (2006/03/15) Phillip Lougher
Registering mini_fo version $Id$
JFFS2 version 2.2. (NAND) (SUMMARY)  © 2001-2006 Red Hat, Inc.
yaffs May 14 2009 19:30:56 Installing.
msgmni has been set to 248
io scheduler noop registered
io scheduler deadline registered (default)
Serial: 8250/16550 driver1 ports, IRQ sharing disabled
serial8250.0: ttyS0 at MMIO 0x18020000 (irq = 11) is a 16550A
console handover: boot [early0] -> real [ttyS0]
ag71xx_mdio: probed
eth0: Atheros AG71xx at 0xb9000000, irq 4
eth1: Atheros AG71xx at 0xba000000, irq 5
eth1: connected to PHY at 0:00 [uid=02430d80, driver=Generic PHY]
NAND flash driver for RouterBoard 4xx series version 0.1.10
NAND SPI clock 28333 kHz (AHB 170000 kHz / 6)
FLASH SPI clock 28333 kHz (AHB 170000 kHz / 6)
NAND device: Manufacturer ID: 0xad, Chip ID: 0x76 (Hynix NAND 64MiB 3,3V 8-bit)
Scanning device for bad blocks
Creating 3 MTD partitions on "NAND 64MiB 3,3V 8-bit":
0x00000000-0x00040000 : "booter"
0x00040000-0x00400000 : "kernel"
0x00400000-0x04000000 : "rootfs"
mtd: partition "rootfs" set to be root filesystem
split_squashfs: error occured while reading from "NAND 64MiB 3,3V 8-bit"
Atheros AR71xx SPI Controller driver version 0.2.2
Atheros AR71xx hardware watchdog driver version 0.1.0
ar71xx-wdt: timeout=15 secs (max=25)
TCP westwood registered
NET: Registered protocol family 17
802.1Q VLAN Support v1.8 Ben Greear <greearb@candelatech.com>
All bugs added by David S. Miller <davem@redhat.com>
yaffs: dev is 32505858 name is "mtdblock2"
yaffs: passed flags ""
yaffs: Attempting MTD mount on 31.2, "mtdblock2"
yaffs_read_super: isCheckpointed 0
VFS: Mounted root (yaffs filesystem) readonly.
Freeing unused kernel memory: 140k freed
Please be patient, while OpenWrt loads ...
Algorithmics/MIPS FPU Emulator v1.5
save exit: isCheckpointed 0
ar71xx: pll_reg 0xb8050010: 0x1099
eth0: link up (100Mbps/Full duplex)
device eth0 entered promiscuous mode
br-lan: topology change detected, propagating
br-lan: port 1(eth0) entering forwarding state
br-lan: port 1(eth0) entering disabled state
br-lan: topology change detected, propagating
br-lan: port 1(eth0) entering forwarding state
cfg80211: Using static regulatory domain info
cfg80211: Regulatory domain: US
        (start_freq - end_freq @ bandwidth), (max_antenna_gain, max_eirp)
        (2402000 KHz - 2472000 KHz @ 40000 KHz), (600 mBi, 2700 mBm)
        (5170000 KHz - 5190000 KHz @ 40000 KHz), (600 mBi, 2300 mBm)
        (5190000 KHz - 5210000 KHz @ 40000 KHz), (600 mBi, 2300 mBm)
        (5210000 KHz - 5230000 KHz @ 40000 KHz), (600 mBi, 2300 mBm)
        (5230000 KHz - 5330000 KHz @ 40000 KHz), (600 mBi, 2300 mBm)
        (5735000 KHz - 5835000 KHz @ 40000 KHz), (600 mBi, 3000 mBm)
cfg80211: Calling CRDA for country: US
SCSI subsystem initialized
usbcore: registered new interface driver usbfs
usbcore: registered new interface driver hub
usbcore: registered new device driver usb
PCI: Enabling device 0000:00:12.0 (0000 -> 0002)
ath5k 0000:00:12.0: registered as 'phy0'
ath: Country alpha2 being used: US
ath: Regpair detected: 0x3a
phy0: Selected rate control algorithm 'minstrel'
ath5k phy0: Atheros AR5414 chip found (MAC: 0xa5, PHY: 0x61)
cfg80211: Calling CRDA for country: US
PCI: Enabling device 0000:00:14.0 (0000 -> 0002)
ath: Country alpha2 being used: AM
ath: Regpair detected: 0x30
phy1: Selected rate control algorithm 'ath9k_rate_control'
Registered led device: ath9k-phy1::radio
Registered led device: ath9k-phy1::assoc
Registered led device: ath9k-phy1::tx
Registered led device: ath9k-phy1::rx
phy1: Atheros AR9160 MAC/BB Rev:0 AR5133 RF Rev:b0: mem=0xb0010000, irq=34
cfg80211: Calling CRDA for country: AM
PPP generic driver version 2.4.2
ip_tables: (C) 2000-2006 Netfilter Core Team
Driver 'sd' needs updating - please use bus_type methods
ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
nf_conntrack version 0.5.0 (2048 buckets, 8192 max)
CONFIG_NF_CT_ACCT is deprecated and will be removed soon. Please use
nf_conntrack.acct=1 kernel paramater, acct=1 nf_conntrack module option or
sysctl net.netfilter.nf_conntrack_acct=1 to enable it.
IMQ driver loaded successfully.
        Hooking IMQ before NAT on PREROUTING.
        Hooking IMQ after NAT on POSTROUTING.
uhci_hcd: USB Universal Host Controller Interface driver
Initializing USB Mass Storage driver...
usbcore: registered new interface driver usb-storage
USB Mass Storage support registered.
gpio-buttons driver version 0.1.1
input: gpio-buttons as /devices/platform/gpio-buttons/input/input0
ar71xx-wdt: enabling watchdog timer
ar71xx: pll_reg 0xb8050014: 0x1099
eth1: link up (100Mbps/Full duplex)
eth1: link down
ar71xx: pll_reg 0xb8050014: 0x1099
eth1: link up (100Mbps/Full duplex)
eth1: link down
ar71xx: pll_reg 0xb8050014: 0x1099
eth1: link up (100Mbps/Full duplex)
root@OpenWrt:/#

(Last edited by robrob on 16 May 2009, 03:41)

I have the following lines in my /target/linux/ar71xx/config-2.6.28 file but the IP178c switch is not recognised at all. It seems that no switch driver is being loaded. Any suggestions?

CONFIG_ICPLUS_PHY=n
CONFIG_PHYLIB=y
CONFIG_IP175C_PHY=y
CONFIG_SWITCH=y
CONFIG_SWCONFIG=y

Hi,
That config-.2.6.28 looks good.

So I have just been debugging this over email with a RB450 user and it looks like we got it working.  There are a few issues to deal with concerning the ar71xx:

First of all, go to target/linux/ar71xx/files/drivers/net/ag71xx/ag71xx_phy.c.

From lines 229-270 there is a big switch statement. it is flawed, because it only works if the ethernet port is attached to exactly 1 PHY... but in the case of a switch it is attached to several different port. So replace it with this code:

       if (phy_count==0) {
               printk(KERN_ERR "%s: no PHY found with phy_mask=%08x\n",
                       dev->name, pdata->phy_mask);
               ret = -ENODEV;
       } else {
               if (phy_count > 1) {
                       printk(KERN_DEBUG "%s: connected to %d PHYs\n",
                               dev->name, phy_count);
               }

               ag->phy_dev = phy_connect(dev, dev_name(&phydev->dev),
                       &ag71xx_phy_link_adjust, 0, pdata->phy_if_mode);
               if (IS_ERR(ag->phy_dev)) {
                       printk(KERN_ERR "%s: could not connect to PHY at %s\n",
                               dev->name, dev_name(&phydev->dev));
                       return PTR_ERR(ag->phy_dev);
               }
               /* mask with MAC supported features */
               if (pdata->has_gbit)
                       phydev->supported &= PHY_GBIT_FEATURES;
               else
                       phydev->supported &= PHY_BASIC_FEATURES;
               phydev->advertising = phydev->supported;
               printk(KERN_DEBUG "%s: connected to PHY at %s "
                       "[uid=%08x, driver=%s]\n",
                       dev->name, dev_name(&phydev->dev),
                       phydev->phy_id, phydev->drv->name);
               ag->link = 0;
               ag->speed = 0;
               ag->duplex = -1;
               if (phy_count > 1) {
                       ret = ag71xx_phy_connect_fixed(ag);
               }
       }

The other change you have to make is to edit
target/linux/ar71xx/patches-2.6.28/005-ar71xx_mac_driver.patch

This patch is broken in that it makes the ethernet driver load *before* phylib, which means that it will not talk to any phy drivers since they will not have been registered yet.

*Replace* the contents of that patch file with this (Also, do not keep the old one as a backup in the same directory or else they will both apply and the ordering will still not apply--I made this mistake the first time and it confused me):

--- a/drivers/net/Kconfig
+++ b/drivers/net/Kconfig
@@ -2039,6 +2039,8 @@ config ACENIC_OMIT_TIGON_I
 
       The safe and default value for this is N.
 
+source drivers/net/ag71xx/Kconfig
+
 config DL2K
     tristate "DL2000/TC902x-based Gigabit Ethernet support"
     depends on PCI
--- a/drivers/net/Makefile
+++ b/drivers/net/Makefile
@@ -190,6 +190,7 @@
 
 # This is also a 82596 and should probably be merged
 obj-$(CONFIG_LP486E) += lp486e.o
+obj-$(CONFIG_AG71XX) += ag71xx/
 
 obj-$(CONFIG_ETH16I) += eth16i.o
 obj-$(CONFIG_ZORRO8390) += zorro8390.o

After that, it should load the switch. If  it doesn't work, paste your "dmesg" and also try both:
swconfig dev eth0 help
swconfig dev eth1 help
(The RB450 uses eth1, but some others might use eth0)

I'm kind of pasting these together from an email conversation--if it's confusing I can try to format it as a .patch.

Patrick,

I made both changes but no sign of the switch:

root@OpenWrt:/# dmesg
Linux version 2.6.28.10 (rob@Server) (gcc version 4.1.2) #6 Thu May 21 07:39:29
EDT 2009
prom: fw_arg0=00000007, fw_arg1=a0861c00, fw_arg2=00000000, fw_arg3=00000000
MyLoader: sysp=ffffffff, boardp=ffffffff, parts=ffffffff
console [early0] enabled
CPU revision is: 00019374 (MIPS 24Kc)
Atheros AR7161 rev 2 (id:0xaa), CPU:680.000 MHz, AHB:170.000 MHz, DDR:340.000 MH
z
Determined physical RAM map:
 memory: 08000000 @ 00000000 (usable)
Initrd not found or empty - disabling initrd
Zone PFN ranges:
  Normal   0x00000000 -> 0x00008000
Movable zone start PFN for each node
early_node_map[1] active PFN ranges
    0: 0x00000000 -> 0x00008000
On node 0 totalpages: 32768
free_area_init_node: node 0, pgdat 8029fbe0, node_mem_map 81000000
  Normal zone: 256 pages used for memmap
  Normal zone: 0 pages reserved
  Normal zone: 32512 pages, LIFO batch:7
  Movable zone: 0 pages used for memmap
Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 32512
Kernel command line: rootfstype=squashfs,yaffs,jffs2 noinitrd console=ttyS0,1152
00
Primary instruction cache 64kB, VIPT, 4-way, linesize 32 bytes.
Primary data cache 32kB, 4-way, VIPT, cache aliases, linesize 32 bytes
Writing ErrCtl register=00000800
Readback ErrCtl register=00000800
PID hash table entries: 512 (order: 9, 2048 bytes)
Dentry cache hash table entries: 16384 (order: 4, 65536 bytes)
Inode-cache hash table entries: 8192 (order: 3, 32768 bytes)
Memory: 126820k/131072k available (1972k kernel code, 4068k reserved, 338k data,
 140k init, 0k highmem)
SLUB: Genslabs=6, HWalign=32, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
Calibrating delay loop... 452.19 BogoMIPS (lpj=2260992)
Mount-cache hash table entries: 512
net_namespace: 480 bytes
NET: Registered protocol family 16
MIPS: machine is MikroTik RouterBOARD 493/AH
registering PCI controller with io_map_base unset
pci 0000:00:00.0: reg 10 32bit mmio: [0x000000-0xfffffff]
pci 0000:00:00.0: reg 14 io port: [0x00-0xff]
pci 0000:00:00.0: supports D1 D2
pci 0000:00:00.0: PME# supported from D0 D1 D2 D3hot
pci 0000:00:00.0: PME# disabled
pci 0000:00:12.0: reg 10 32bit mmio: [0x000000-0x00ffff]
pci 0000:00:14.0: reg 10 32bit mmio: [0x000000-0x00ffff]
pci 0000:00:14.0: PME# supported from D0 D3hot
pci 0000:00:14.0: PME# disabled
PCI: mapping irq 32 to pin1@0000:00:12.0
PCI: mapping irq 34 to pin1@0000:00:14.0
NET: Registered protocol family 2
Switched to high resolution mode on CPU 0
IP route cache hash table entries: 1024 (order: 0, 4096 bytes)
TCP established hash table entries: 4096 (order: 3, 32768 bytes)
TCP bind hash table entries: 4096 (order: 2, 16384 bytes)
TCP: Hash tables configured (established 4096 bind 4096)
TCP reno registered
NET: Registered protocol family 1
squashfs: version 3.0 (2006/03/15) Phillip Lougher
Registering mini_fo version $Id$
JFFS2 version 2.2. (NAND) (SUMMARY)  © 2001-2006 Red Hat, Inc.
yaffs May 14 2009 19:30:56 Installing.
msgmni has been set to 248
io scheduler noop registered
io scheduler deadline registered (default)
Serial: 8250/16550 driver1 ports, IRQ sharing disabled
serial8250.0: ttyS0 at MMIO 0x18020000 (irq = 11) is a 16550A
console handover: boot [early0] -> real [ttyS0]
ag71xx_mdio: probed
eth0: Atheros AG71xx at 0xb9000000, irq 4
eth1: Atheros AG71xx at 0xba000000, irq 5
eth1: connected to PHY at 0:00 [uid=02430d80, driver=Generic PHY]
NAND flash driver for RouterBoard 4xx series version 0.1.10
NAND SPI clock 28333 kHz (AHB 170000 kHz / 6)
FLASH SPI clock 28333 kHz (AHB 170000 kHz / 6)
NAND device: Manufacturer ID: 0xad, Chip ID: 0x76 (Hynix NAND 64MiB 3,3V 8-bit)
Scanning device for bad blocks
Creating 3 MTD partitions on "NAND 64MiB 3,3V 8-bit":
0x00000000-0x00040000 : "booter"
0x00040000-0x00400000 : "kernel"
0x00400000-0x04000000 : "rootfs"
mtd: partition "rootfs" set to be root filesystem
split_squashfs: error occured while reading from "NAND 64MiB 3,3V 8-bit"
Atheros AR71xx SPI Controller driver version 0.2.2
Atheros AR71xx hardware watchdog driver version 0.1.0
ar71xx-wdt: timeout=15 secs (max=25)
TCP westwood registered
NET: Registered protocol family 17
802.1Q VLAN Support v1.8 Ben Greear <greearb@candelatech.com>
All bugs added by David S. Miller <davem@redhat.com>
yaffs: dev is 32505858 name is "mtdblock2"
yaffs: passed flags ""
yaffs: Attempting MTD mount on 31.2, "mtdblock2"
yaffs_read_super: isCheckpointed 0
VFS: Mounted root (yaffs filesystem) readonly.
Freeing unused kernel memory: 140k freed
Please be patient, while OpenWrt loads ...
Algorithmics/MIPS FPU Emulator v1.5
save exit: isCheckpointed 0
ar71xx: pll_reg 0xb8050010: 0x1099
eth0: link up (100Mbps/Full duplex)
device eth0 entered promiscuous mode
br-lan: topology change detected, propagating
br-lan: port 1(eth0) entering forwarding state
br-lan: port 1(eth0) entering disabled state
br-lan: topology change detected, propagating
br-lan: port 1(eth0) entering forwarding state
cfg80211: Using static regulatory domain info
cfg80211: Regulatory domain: US
        (start_freq - end_freq @ bandwidth), (max_antenna_gain, max_eirp)
        (2402000 KHz - 2472000 KHz @ 40000 KHz), (600 mBi, 2700 mBm)
        (5170000 KHz - 5190000 KHz @ 40000 KHz), (600 mBi, 2300 mBm)
        (5190000 KHz - 5210000 KHz @ 40000 KHz), (600 mBi, 2300 mBm)
        (5210000 KHz - 5230000 KHz @ 40000 KHz), (600 mBi, 2300 mBm)
        (5230000 KHz - 5330000 KHz @ 40000 KHz), (600 mBi, 2300 mBm)
        (5735000 KHz - 5835000 KHz @ 40000 KHz), (600 mBi, 3000 mBm)
cfg80211: Calling CRDA for country: US
SCSI subsystem initialized
ar71xx: pll_reg 0xb8050014: 0x1099
eth1: link up (100Mbps/Full duplex)
usbcore: registered new interface driver usbfs
usbcore: registered new interface driver hub
usbcore: registered new device driver usb
PCI: Enabling device 0000:00:12.0 (0000 -> 0002)
ath5k 0000:00:12.0: registered as 'phy0'
ath: Country alpha2 being used: US
ath: Regpair detected: 0x3a
phy0: Selected rate control algorithm 'minstrel'
ath5k phy0: Atheros AR5414 chip found (MAC: 0xa5, PHY: 0x61)
cfg80211: Calling CRDA for country: US
PCI: Enabling device 0000:00:14.0 (0000 -> 0002)
ath: Country alpha2 being used: AM
ath: Regpair detected: 0x30
phy1: Selected rate control algorithm 'ath9k_rate_control'
Registered led device: ath9k-phy1::radio
Registered led device: ath9k-phy1::assoc
Registered led device: ath9k-phy1::tx
Registered led device: ath9k-phy1::rx
phy1: Atheros AR9160 MAC/BB Rev:0 AR5133 RF Rev:b0: mem=0xb0010000, irq=34
cfg80211: Calling CRDA for country: AM
PPP generic driver version 2.4.2
ip_tables: (C) 2000-2006 Netfilter Core Team
Driver 'sd' needs updating - please use bus_type methods
ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
nf_conntrack version 0.5.0 (2048 buckets, 8192 max)
CONFIG_NF_CT_ACCT is deprecated and will be removed soon. Please use
nf_conntrack.acct=1 kernel paramater, acct=1 nf_conntrack module option or
sysctl net.netfilter.nf_conntrack_acct=1 to enable it.
IMQ driver loaded successfully.
        Hooking IMQ before NAT on PREROUTING.
        Hooking IMQ after NAT on POSTROUTING.
uhci_hcd: USB Universal Host Controller Interface driver
Initializing USB Mass Storage driver...
usbcore: registered new interface driver usb-storage
USB Mass Storage support registered.
gpio-buttons driver version 0.1.1
input: gpio-buttons as /devices/platform/gpio-buttons/input/input0
ar71xx-wdt: enabling watchdog timer
root@OpenWrt:/#

Patrick,

There's no mention of switch anywhere that I can find during "make menuconfig," but I do have "CONFIG_SWITCH=y" in the config-2.6.28 file. The only time I've ever seen a "Switch" selection available in "make menuconfig" is when I installed Patrick's patch from several months ago. It was available for selection in "Kernal Modules/Other Modules."

Are any of you RB450 or RB493 users seeing an option to select "Switch" during menuconfig?

(Last edited by robrob on 21 May 2009, 14:24)

I don't think the "switch" option is useful, but it doesn't do any harm. The configuration you posted should be perfectly fine:

CONFIG_ICPLUS_PHY=n
CONFIG_PHYLIB=y
CONFIG_IP175C_PHY=y
CONFIG_SWITCH=y
CONFIG_SWCONFIG=y

Could you go to the very bottom of target/linux/generic-2.6/files/drivers/net/phy/ip175c.c
And right before the "phy_driver_register()", add a line that says:
printk(KERN_INFO "Registered IP175C driver\n");

Another theory is that the new patches are not being applied because you did not clean out your kernel directory. Could you try removing the "build_dir/linux_ar71xx/linux-2.6.28" or any other linux sources you see.  That way they will be extracted and the patches re-applied.

(Last edited by phorn on 21 May 2009, 20:23)

Patrick,

I made both changes you suggested in the previous  email but I'm getting a compile error:

ux-ar71xx/linux-2.6.28.10/System.map
make -C /home/rob/kamikaze/build_dir/linux-ar71xx/linux-2.6.28.10 CROSS_COMPILE="mips-openwrt-linux-uclibc-" ARCH="mips" KBUILD_HAVE_NLS=no CONFIG_SHELL="/bin/bash" CC="mips-openwrt-linux-uclibc-gcc" modules
make[5]: Entering directory `/home/rob/kamikaze/build_dir/linux-ar71xx/linux-2.6.28.10'
make[5]: *** No rule to make target `modules'.  Stop.
make[5]: Leaving directory `/home/rob/kamikaze/build_dir/linux-ar71xx/linux-2.6.28.10'
make[4]: *** [/home/rob/kamikaze/build_dir/linux-ar71xx/linux-2.6.28.10/.modules] Error 2
make[4]: Leaving directory `/home/rob/kamikaze/target/linux/ar71xx'
make[3]: *** [compile] Error 2
make[3]: Leaving directory `/home/rob/kamikaze/target/linux'
make[2]: *** [target/linux/compile] Error 2
make[2]: Leaving directory `/home/rob/kamikaze'
make[1]: *** [/home/rob/kamikaze/staging_dir/target-mips_uClibc-0.9.29/stamp/.target_compile] Error 2
make[1]: Leaving directory `/home/rob/kamikaze'
make: *** [world] Error 2
rob@Server:~/kamikaze$

I think telling you to remove the kernel directory wasn't exactly right.  I don't remember how I did this last time.

You may be able to do rebuild just the kernel by doing
cd target/linux/ar71xx
TOPDIR=~/kamikaze make clean

If that doesn't work then it may be easiest to run "make clean" from the toplevel and rebuild everything which could take an hour, sorry.

The changes I made should have only affected the drivers/net/Makefile, but you can run "svn diff" from the kamikaze directory to check all of the changes in your local copy.

It should now be able find the IC+ phy instead of "Generic". If not, then the print statement will show if the ordering is still wrong.

I tried the top level "make clean" command but I still can't compile so I'm starting over with a new svn co. I'll make all the edits and let you know what happens. I'm really excited about getting the RB493/AH running with Kamikaze, it's a very powerful box with lots of speed, RAM, storage and 9 ethernet ports.

Patrick,

I loaded a completely new svn but I'm getting the same error. I'm using "make menuconfig" as usual:

make -C /home/rob/kamikaze/build_dir/linux-ar71xx/linux-2.6.28.10 CROSS_COMPILE="mips-openwrt-linux-uclibc-" ARCH="mips" KBUILD_HAVE_NLS=no CONFIG_SHELL="/bin/bash" CC="mips-openwrt-linux-uclibc-gcc" modules
make[5]: Entering directory `/home/rob/kamikaze/build_dir/linux-ar71xx/linux-2.6.28.10'
scripts/kconfig/conf -s arch/mips/Kconfig
file drivers/net/ag71xx/Kconfig already scanned?
make[7]: *** [silentoldconfig] Error 1
make[6]: *** [silentoldconfig] Error 2

The present kernel configuration has modules disabled.
Type 'make config' and enable loadable module support.
Then build a kernel with module support enabled.

make[5]: *** [modules] Error 1
make[5]: Leaving directory `/home/rob/kamikaze/build_dir/linux-ar71xx/linux-2.6.28.10'
make[4]: *** [/home/rob/kamikaze/build_dir/linux-ar71xx/linux-2.6.28.10/.modules] Error 2
make[4]: Leaving directory `/home/rob/kamikaze/target/linux/ar71xx'
make[3]: *** [compile] Error 2
make[3]: Leaving directory `/home/rob/kamikaze/target/linux'
make[2]: *** [target/linux/compile] Error 2
make[2]: Leaving directory `/home/rob/kamikaze'
make[1]: *** [/home/rob/kamikaze/staging_dir/target-mips_uClibc-0.9.29/stamp/.target_compile] Error 2
make[1]: Leaving directory `/home/rob/kamikaze'
make: *** [world] Error 2
rob@Server:~/kamikaze$

(Last edited by robrob on 23 May 2009, 17:18)

I'm still getting the above compile error. I can compile for any target profile but AR7xx.

that is honestly just strange.  I can't reproduce any such error on my computer and it doesn't feel the build would just fail like this unless there was a conflict or failed patch.

What exact changes did you make from a clean SVN?  Can you paste the output of "svn status" and "svn diff"?
If you want you can send me your .config to patrick.horn@gmail.com and I can try on my computer.

In the meantime I'll try to clean out my SVN repository so I can produce a simple ".patch" file that you can apply to the kamikaze source tree directly.

Patrick,

I loaded a new svn and ran your patch. It looks good so far:

root@OpenWrt:/# swconfig dev eth1 help
Switch 1: eth1(eth1), ports: 9, vlans: 16
     --switch
        Attribute 1 (int): enable_vlan (Flag to enable or disable VLANs and tagg
ing)
        Attribute 2 (string): name (Returns the type of IC+ chip.)
        Attribute 3 (int): phy (Direct register access: set phy (0-4, or 29,30,3
1))
        Attribute 4 (int): reg (Direct register access: set mii number (0-31))
        Attribute 5 (int): val (Direct register access: read/write to register (
0-65535))
        Attribute 6 (none): apply (Activate changes in the hardware)
        Attribute 7 (none): reset (Reset the switch)
     --vlan
        Attribute 1 (ports): ports (VLAN port mapping)
     --port
        Attribute 1 (string): status (Returns Detailed port status)
        Attribute 2 (int): link (Link speed. Can write 0 for auto-negotiate, or
10 or 100)
        Attribute 3 (int): tagged (0 = untag, 1 = add tags, 2 = do not alter (Th
is value is reset if vlans are altered))
        Attribute 4 (int): pvid (Primary VLAN ID)
root@OpenWrt:/#
root@OpenWrt:/# demesg
/bin/ash: demesg: not found
root@OpenWrt:/# dmesg
Linux version 2.6.28.10 (rob@Server) (gcc version 4.1.2) #2 Sat May 23 23:37:15
EDT 2009
prom: fw_arg0=00000007, fw_arg1=a0861c00, fw_arg2=00000000, fw_arg3=00000000
MyLoader: sysp=ffffffff, boardp=ffffffff, parts=ffffffff
console [early0] enabled
CPU revision is: 00019374 (MIPS 24Kc)
Atheros AR7161 rev 2 (id:0xaa), CPU:680.000 MHz, AHB:170.000 MHz, DDR:340.000 MH
z
Determined physical RAM map:
 memory: 08000000 @ 00000000 (usable)
Initrd not found or empty - disabling initrd
Zone PFN ranges:
  Normal   0x00000000 -> 0x00008000
Movable zone start PFN for each node
early_node_map[1] active PFN ranges
    0: 0x00000000 -> 0x00008000
On node 0 totalpages: 32768
free_area_init_node: node 0, pgdat 8029bc10, node_mem_map 81000000
  Normal zone: 256 pages used for memmap
  Normal zone: 0 pages reserved
  Normal zone: 32512 pages, LIFO batch:7
  Movable zone: 0 pages used for memmap
Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 32512
Kernel command line: rootfstype=squashfs,yaffs,jffs2 noinitrd console=ttyS0,1152
00
Primary instruction cache 64kB, VIPT, 4-way, linesize 32 bytes.
Primary data cache 32kB, 4-way, VIPT, cache aliases, linesize 32 bytes
Writing ErrCtl register=00000800
Readback ErrCtl register=00000800
PID hash table entries: 512 (order: 9, 2048 bytes)
Dentry cache hash table entries: 16384 (order: 4, 65536 bytes)
Inode-cache hash table entries: 8192 (order: 3, 32768 bytes)
Memory: 126848k/131072k available (1965k kernel code, 4052k reserved, 329k data,
 140k init, 0k highmem)
SLUB: Genslabs=6, HWalign=32, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
Calibrating delay loop... 452.19 BogoMIPS (lpj=2260992)
Mount-cache hash table entries: 512
net_namespace: 480 bytes
NET: Registered protocol family 16
MIPS: machine is MikroTik RouterBOARD 493/AH
registering PCI controller with io_map_base unset
pci 0000:00:00.0: reg 10 32bit mmio: [0x000000-0xfffffff]
pci 0000:00:00.0: reg 14 io port: [0x00-0xff]
pci 0000:00:00.0: supports D1 D2
pci 0000:00:00.0: PME# supported from D0 D1 D2 D3hot
pci 0000:00:00.0: PME# disabled
pci 0000:00:12.0: reg 10 32bit mmio: [0x000000-0x00ffff]
pci 0000:00:14.0: reg 10 32bit mmio: [0x000000-0x00ffff]
pci 0000:00:14.0: PME# supported from D0 D3hot
pci 0000:00:14.0: PME# disabled
PCI: mapping irq 32 to pin1@0000:00:12.0
PCI: mapping irq 34 to pin1@0000:00:14.0
NET: Registered protocol family 2
Switched to high resolution mode on CPU 0
IP route cache hash table entries: 1024 (order: 0, 4096 bytes)
TCP established hash table entries: 4096 (order: 3, 32768 bytes)
TCP bind hash table entries: 4096 (order: 2, 16384 bytes)
TCP: Hash tables configured (established 4096 bind 4096)
TCP reno registered
NET: Registered protocol family 1
squashfs: version 3.0 (2006/03/15) Phillip Lougher
Registering mini_fo version $Id$
JFFS2 version 2.2. (NAND) (SUMMARY)  © 2001-2006 Red Hat, Inc.
yaffs May 23 2009 23:00:52 Installing.
msgmni has been set to 248
io scheduler noop registered
io scheduler deadline registered (default)
Serial: 8250/16550 driver1 ports, IRQ sharing disabled
serial8250.0: ttyS0 at MMIO 0x18020000 (irq = 11) is a 16550A
console handover: boot [early0] -> real [ttyS0]
ag71xx_mdio: probed
eth0: Atheros AG71xx at 0xb9000000, irq 4
eth1: Atheros AG71xx at 0xba000000, irq 5
eth1: connected to PHY at 0:00 [uid=02430d80, driver=IC+ IP175C]
NAND flash driver for RouterBoard 4xx series version 0.1.10
NAND SPI clock 28333 kHz (AHB 170000 kHz / 6)
FLASH SPI clock 28333 kHz (AHB 170000 kHz / 6)
NAND device: Manufacturer ID: 0xad, Chip ID: 0x76 (Hynix NAND 64MiB 3,3V 8-bit)
Scanning device for bad blocks
Creating 3 MTD partitions on "NAND 64MiB 3,3V 8-bit":
0x00000000-0x00040000 : "booter"
0x00040000-0x00400000 : "kernel"
0x00400000-0x04000000 : "rootfs"
mtd: partition "rootfs" set to be root filesystem
split_squashfs: error occured while reading from "NAND 64MiB 3,3V 8-bit"
Atheros AR71xx SPI Controller driver version 0.2.2
Atheros AR71xx hardware watchdog driver version 0.1.0
ar71xx-wdt: timeout=15 secs (max=25)
TCP westwood registered
NET: Registered protocol family 17
802.1Q VLAN Support v1.8 Ben Greear <greearb@candelatech.com>
All bugs added by David S. Miller <davem@redhat.com>
yaffs: dev is 32505858 name is "mtdblock2"
yaffs: passed flags ""
yaffs: Attempting MTD mount on 31.2, "mtdblock2"
yaffs_read_super: isCheckpointed 0
VFS: Mounted root (yaffs filesystem) readonly.
Freeing unused kernel memory: 140k freed
Please be patient, while OpenWrt loads ...
Algorithmics/MIPS FPU Emulator v1.5
save exit: isCheckpointed 0
ar71xx: pll_reg 0xb8050010: 0x1099
eth0: link up (100Mbps/Full duplex)
device eth0 entered promiscuous mode
br-lan: topology change detected, propagating
br-lan: port 1(eth0) entering forwarding state
br-lan: port 1(eth0) entering disabled state
br-lan: topology change detected, propagating
br-lan: port 1(eth0) entering forwarding state
cfg80211: Using static regulatory domain info
cfg80211: Regulatory domain: US
        (start_freq - end_freq @ bandwidth), (max_antenna_gain, max_eirp)
        (2402000 KHz - 2472000 KHz @ 40000 KHz), (600 mBi, 2700 mBm)
        (5170000 KHz - 5190000 KHz @ 40000 KHz), (600 mBi, 2300 mBm)
        (5190000 KHz - 5210000 KHz @ 40000 KHz), (600 mBi, 2300 mBm)
        (5210000 KHz - 5230000 KHz @ 40000 KHz), (600 mBi, 2300 mBm)
        (5230000 KHz - 5330000 KHz @ 40000 KHz), (600 mBi, 2300 mBm)
        (5735000 KHz - 5835000 KHz @ 40000 KHz), (600 mBi, 3000 mBm)
cfg80211: Calling CRDA for country: US
SCSI subsystem initialized
usbcore: registered new interface driver usbfs
usbcore: registered new interface driver hub
usbcore: registered new device driver usb
PCI: Enabling device 0000:00:12.0 (0000 -> 0002)
ath5k 0000:00:12.0: registered as 'phy0'
ath: Country alpha2 being used: US
ath: Regpair detected: 0x3a
phy0: Selected rate control algorithm 'minstrel'
ath5k phy0: Atheros AR5414 chip found (MAC: 0xa5, PHY: 0x61)
cfg80211: Calling CRDA for country: US
PCI: Enabling device 0000:00:14.0 (0000 -> 0002)
ath: Country alpha2 being used: AM
ath: Regpair detected: 0x30
phy1: Selected rate control algorithm 'ath9k_rate_control'
Registered led device: ath9k-phy1::radio
Registered led device: ath9k-phy1::assoc
Registered led device: ath9k-phy1::tx
Registered led device: ath9k-phy1::rx
phy1: Atheros AR9160 MAC/BB Rev:0 AR5133 RF Rev:b0: mem=0xb0010000, irq=34
cfg80211: Calling CRDA for country: AM
PPP generic driver version 2.4.2
ip_tables: (C) 2000-2006 Netfilter Core Team
Driver 'sd' needs updating - please use bus_type methods
ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
nf_conntrack version 0.5.0 (2048 buckets, 8192 max)
CONFIG_NF_CT_ACCT is deprecated and will be removed soon. Please use
nf_conntrack.acct=1 kernel paramater, acct=1 nf_conntrack module option or
sysctl net.netfilter.nf_conntrack_acct=1 to enable it.
IMQ driver loaded successfully.
        Hooking IMQ before NAT on PREROUTING.
        Hooking IMQ after NAT on POSTROUTING.
uhci_hcd: USB Universal Host Controller Interface driver
Initializing USB Mass Storage driver...
usbcore: registered new interface driver usb-storage
USB Mass Storage support registered.
gpio-buttons driver version 0.1.1
input: gpio-buttons as /devices/platform/gpio-buttons/input/input0
ar71xx-wdt: enabling watchdog timer
root@OpenWrt:/#

Patrick,

I'm still unable to ping through the router. As usual, the WAN port can ping out and will respond to ping requests, but all 8 switch ports seem to be dead. Shouldn't the router default to a lan "hub" configuration with all the ports bridged?

All 8 of the switch ports flash in sequence on boot up and again when your driver loads a couple of seconds later, but when I "/etc/init.d/network restart" they don't. Is that an issue?

Rob

root@OpenWrt:/# ifconfig
br-lan    Link encap:Ethernet  HWaddr 00:0C:42:33:2B:86
          inet addr:192.168.1.7  Bcast:192.168.1.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:414 errors:0 dropped:0 overruns:0 frame:0
          TX packets:97 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:105069 (102.6 KiB)  TX bytes:33956 (33.1 KiB)

eth0      Link encap:Ethernet  HWaddr 00:0C:42:33:2B:86
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:414 errors:0 dropped:0 overruns:0 frame:0
          TX packets:97 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:110865 (108.2 KiB)  TX bytes:33956 (33.1 KiB)
          Interrupt:4

eth1      Link encap:Ethernet  HWaddr 00:0C:42:33:2B:87
          UP BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)
          Interrupt:5

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:13 errors:0 dropped:0 overruns:0 frame:0
          TX packets:13 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:1232 (1.2 KiB)  TX bytes:1232 (1.2 KiB)

root@OpenWrt:/#

(Last edited by robrob on 24 May 2009, 17:18)

The way the routerboards work is eth0 is the WAN port, and eth1 is the switch. The two are physically isolated in hardware, so there is no way to combine them except via a software bridge.

According to this, you were only using eth0 to do the test:
eth0 "RX bytes:110865 (108.2 KiB)  TX bytes:33956 (33.1 KiB)"
eth1 has no IP address, which would explain why all the switch ports are dead.
eth1 "RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)"

You need to assign eth1 to part of br-lan (if you want to use all 8 switch ports), or else give it an IP address in /etc/config/network

As to why the switch ports don't flash, "config switch eth1" has a new format now:

config switch eth1
option reset 1
option enable_vlan 1

config switch_vlan
option device eth1
option vlan 1
option ports "0 1 2 3 4 5 8t"

config switch_vlan
option device eth1
option vlan 2
option ports "6 7 8t"

config interface lan1
option ifname "eth1.1"
option proto static
option type bridge
option ipaddr 192.168.1.1
option netmask 255.255.255.0

config interface lan2
option ifname "eth1.2"
option proto static
option ipaddr 192.168.2.1
option netmask 255.255.255.0

config interface wan
option ifname "eth0"
option proto dhcp

Then you will be able to ping out of br-lan, eth1.2 and eth0

If you just want to merge the wan and lan do something like:

config switch eth1
option reset 1
option enable_vlan 0

config interface lan
option ifname "eth0 eth1"
option type bridge
option proto static
option ipaddr 192.168.1.100
option netmask 255.255.255.0

Then you just use br-lan as a bridge between all the ports.

Patrick,

Again, thanks for all the help here. I'm trying to keep it simple until I get the switch to work as a simple hub so this is my /etc/config/network file:

config 'switch' 'eth1'
        option 'reset' '1'
        option 'enable_vlan' '0'

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 eth1"
        option 'type' 'bridge'
        option 'proto' 'static'
        option 'ipaddr' '192.168.1.7'
        option 'netmask' '255.255.255.0'
        option 'dns' '208.67.222.222'
        option 'gateway' '192.168.1.1'

I still cannot ping between two computers connected to the switch, or through the router either way. Only the wan port is functional. I still have no transmission from eth1:

root@OpenWrt:/# ifconfig
br-lan    Link encap:Ethernet  HWaddr 00:0C:42:33:2B:86
          inet addr:192.168.1.7  Bcast:192.168.1.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:131 errors:0 dropped:0 overruns:0 frame:0
          TX packets:40 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:39361 (38.4 KiB)  TX bytes:2064 (2.0 KiB)

eth0      Link encap:Ethernet  HWaddr 00:0C:42:33:2B:86
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:479 errors:0 dropped:0 overruns:0 frame:0
          TX packets:213 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:120502 (117.6 KiB)  TX bytes:132540 (129.4 KiB)
          Interrupt:4

eth1      Link encap:Ethernet  HWaddr 00:0C:42:33:2B:87
          UP BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:64 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:0 (0.0 B)  TX bytes:16029 (15.6 KiB)
          Interrupt:5

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:29 errors:0 dropped:0 overruns:0 frame:0
          TX packets:29 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:3316 (3.2 KiB)  TX bytes:3316 (3.2 KiB)

root@OpenWrt:/#

I loaded this as my network file:

config switch eth1
option reset 1
option enable_vlan 1

config switch_vlan
option device eth1
option vlan 1
option ports "0 1 2 3 4 5 8t"

config switch_vlan
option device eth1
option vlan 2
option ports "6 7 8t"

config interface lan1
option ifname "eth1.1"
option proto static
option type bridge
option ipaddr 192.168.1.7
option netmask 255.255.255.0

config interface lan2
option ifname "eth1.2"
option proto static
option ipaddr 192.168.2.7
option netmask 255.255.255.0

config interface wan
option ifname "eth0"
option proto dhcp

I still can't ping from the switch. Here's the ifconfig:

root@OpenWrt:/# ifconfig
br-lan    Link encap:Ethernet  HWaddr 00:0C:42:33:2B:87
          inet addr:192.168.1.7  Bcast:192.168.1.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:2335 errors:0 dropped:0 overruns:0 frame:0
          TX packets:474 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:687313 (671.2 KiB)  TX bytes:147452 (143.9 KiB)

br-lan1   Link encap:Ethernet  HWaddr 00:0C:42:33:2B:87
          inet addr:192.168.1.7  Bcast:192.168.1.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

eth0      Link encap:Ethernet  HWaddr 00:0C:42:33:2B:86
          inet addr:192.168.1.236  Bcast:192.168.1.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:2901 errors:0 dropped:0 overruns:0 frame:0
          TX packets:562 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:5
          RX bytes:875534 (855.0 KiB)  TX bytes:271175 (264.8 KiB)
          Interrupt:4

eth1      Link encap:Ethernet  HWaddr 00:0C:42:33:2B:87
          UP BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:97 errors:0 dropped:0 overruns:0 frame:0
          TX packets:64 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:9960 (9.7 KiB)  TX bytes:16029 (15.6 KiB)
          Interrupt:5

eth1.1    Link encap:Ethernet  HWaddr 00:0C:42:33:2B:87
          UP BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

eth1.2    Link encap:Ethernet  HWaddr 00:0C:42:33:2B:87
          inet addr:192.168.2.7  Bcast:192.168.2.255  Mask:255.255.255.0
          UP BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

imq0      Link encap:UNSPEC  HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00
-00
          UP RUNNING NOARP  MTU:16000  Metric:1
          RX packets:133 errors:0 dropped:0 overruns:0 frame:0
          TX packets:133 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:5
          RX bytes:49794 (48.6 KiB)  TX bytes:49794 (48.6 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:93 errors:0 dropped:0 overruns:0 frame:0
          TX packets:93 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:9952 (9.7 KiB)  TX bytes:9952 (9.7 KiB)

root@OpenWrt:/#

(Last edited by robrob on 25 May 2009, 03:32)

The bridge thing is weird--it looks like eth1 was receiving no packets so that's a bad sign.

But in your second posting I saw this:

eth1      Link encap:Ethernet  HWaddr 00:0C:42:33:2B:87
          UP BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:97 errors:0 dropped:0 overruns:0 frame:0
          TX packets:64 errors:0 dropped:0 overruns:0 carrier:0

So eth1 is working (both sending and receiving packets).

I think the problem is that when you did "/etc/init.d/network restart", it just left your old br-lan interface around, with the same IP address as br-lan1. So the kernel is sending all packets to the wrong bridge interface. I recommend to just reboot.

Notice that the kernel is neither sending nor receiving on your br-lan1, or eth1.2 interfaces:

br-lan1   Link encap:Ethernet  HWaddr 00:0C:42:33:2B:87
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)
eth1.1    Link encap:Ethernet  HWaddr 00:0C:42:33:2B:87
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)
eth1.2    Link encap:Ethernet  HWaddr 00:0C:42:33:2B:87
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

Also, you may want to call it "lan" instead of "lan1" unless you change the corresponding entry in /etc/config/wireless.  This may be why it is getting confused--it could be creating two bridges with the same ip address.

(Last edited by phorn on 25 May 2009, 07:23)

Patrick,

I went back and tried all the previous network configurations using reboot between changes to no avail. I also compiled a virgin image with no added modules other than swconfig. eth1 is still not receiving any traffic. Keep in mind that this router works fine with the Router OS so it's not a hardware flaw.

When I use a vlan configuration ifconfig shows eth1 receiving and transmitting, but the eth1.1 and 1.2 show no traffic and the switch is inoperative.

root@OpenWrt:/# ifconfig
br-lan    Link encap:Ethernet  HWaddr 00:0C:42:33:2B:87
          inet addr:192.168.1.7  Bcast:192.168.1.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:1 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:0 (0.0 B)  TX bytes:402 (402.0 B)

eth0      Link encap:Ethernet  HWaddr 00:0C:42:33:2B:86
          inet addr:192.168.1.236  Bcast:192.168.1.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:2893 errors:0 dropped:0 overruns:0 frame:0
          TX packets:65 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:1010691 (987.0 KiB)  TX bytes:14494 (14.1 KiB)
          Interrupt:4

eth1      Link encap:Ethernet  HWaddr 00:0C:42:33:2B:87
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:332 errors:0 dropped:0 overruns:0 frame:0
          TX packets:1 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:28926 (28.2 KiB)  TX bytes:406 (406.0 B)
          Interrupt:5

eth1.1    Link encap:Ethernet  HWaddr 00:0C:42:33:2B:87
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:1 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:0 (0.0 B)  TX bytes:406 (406.0 B)

eth1.2    Link encap:Ethernet  HWaddr 00:0C:42:33:2B:87
          inet addr:192.168.2.7  Bcast:192.168.2.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

root@OpenWrt:/#

Has anyone been able to get an RB493 working using this setup?

(Last edited by robrob on 25 May 2009, 17:02)

The bridge thing is weird--it looks like eth1 was receiving no packets so that's a bad sign.

This is the key. A simple bridge that won't pass traffic.

I noticed that the default AR7xx target profile doesn't have the bridge module selected by default. I have tried builds with it and without with the same outcome.

(Last edited by robrob on 25 May 2009, 16:53)