MODULOS:
Ahora que ya hemos instalado OpenWRT en nuestro router, ¿ Por que no cargamos los modulos del firmware original y vemos que se puede hacer?
Primero, debereis localizar (y copiar) los modulos del firmware original. No voy a explicarlo aqui, deberia ser facil para cualquiera. Eso si, una vez copiados hay que renombrarlos de .o a .ko. Entonces ya se podran cargar.
Este es el orden descendiente de carga:
kleds_mod.ko
fusivlib_lkm.ko
peri_ap_lkm.ko
bmdriver_lkm.ko
sysutil.ko
timers_lkm.ko
ethdriver_lkm.ko
uart2.ko
atmdriver_lkm.ko
btn160.ko
kstart_leds_lums_mod.ko
wlan.ko
wlan_acl.ko
wlan_scan_ap.ko
wlan_tkip.ko
wlan_wep.ko
wlan_xauth.ko
wlan_ccmp.ko
ath_hal.ko
ath_dfs.ko
ath_rate_atheros.ko
ath_pci.ko
ath_pktlog.ko
log_chardev.ko
rg_fastpath.ko
ethsw160.ko —> Este es la CLAVE de todo!!!!!! (Ver mas abajo)
igmp_proxy_mod.ko
rg_fastpath_bridge.ko
rg_bridge.ko
tcp_mss.ko
mod_fuwredirect.ko
frag_cache_mod.ko
rg_dhcp_pktfil.ko
rg_ipv4.ko
pppoe_relay.ko
be_pppoa_mod.ko
hci_uart.ko
qos_ingress.ko
clip_mod.ko
dspvoice.ko
genVoice.ko
relay.ko
slash_proc_mod.ko
sagem_dect_upper.ko
extended_hid.ko
sagem_dect_ctrl.ko
hard_watchdog_module.ko
Bueno, como podeis ver, todos cargan menos el ethsw160.ko. Este es el driver para el switch Marvell 88E6061. Si os fijais en el intento de carga, os dareis cuenta que indica “card_id=768″ (correcto) y “switch_id=0xfff” (incorrecto, deberia ser 0×61). No se porque ocurre esto, y desgraciadamente tampoco he podido arreglarlo. Pero kernels mas modernos TIENEN un driver para este switch. Descargaros cualquier kernel superior a la version 2.6.27 y vereis en net/dsa:
dsa.c Kconfig mv88e6060.c mv88e6131.c mv88e6xxx.h tag_dsa.c tag_trailer.c dsa_priv.h Makefile mv88e6123_61_65.c mv88e6xxx.c slave.c tag_edsa.c
Estos mv88e6xxx.c y .h prometen, eh? Si claro… pero intentad hacerlo funcionar en nuestro kernel 2.6.15 y vereis que es practicamente imposible. La unica solucion seria portar la arquitectura de este router a un kernel mas moderno (ver mas abajo).
La mala noticia es que sin poder cargar este driver, no hay mucho que podamos hacer con nuestro router.
GPIO:
Se pueden controlar la mayoria de los botones y leds del router a voluntad. Simplemente echad un ojo a /proc/driver/gpio/bits
root@OpenWrt:/proc/driver/gpio# cat bits bit24=-1 () bit23=-1 () bit22=-1 () bit21=-1 () bit20=-1 () bit1f=1 (12: Reset Hub Usb (active High) (out)) bit1e=1 (30: Reboot gateway: short press=reboot, long press= On/Off (in)) bit1d=0 (29: Command Power Off (active low) (out)) bit1c=0 (28: Ethernet Switch Reset (active low) (out)) bit1b=0 (24: Default Config Button (Active low) (in)) bit1a=0 (26: Wifi association button (in)) bit19=0 (25: Power fall warning for dying gasp function (active low /in)) bit18=1 (23: Dedicated MII2 Interface) bit17=1 (22: Dedicated MII2 Interface) bit16=1 (21: Dedicated MII2 Interface) bit15=1 (20: Dedicated MII2 Interface) bit14=1 (17: Overcurrent detection on VUSBH (in)) bit13=1 (16: AFE reset (active low) (out)) bit12=1 (18: USB Host 2 Power Enable (Active High) (out)) bit11=1 (15: USB Host Power Enable (Active High) (out)) bit10=1 (14: Line 2 relay (Active low) (out)) bitf=0 (19: Line 1 relay (Active low) (out)) bite=1 (13: Load command for CLIP (out)) bitd=0 (27: WAN Led Green (in/out)) bitc=0 (10: WAN Led Red (in/out)) bitb=0 (31: Update Blue Led (in/out)) bita=1 (11: Power On Led (in/out)) bit9=0 (9: Lan Led (in/out)) bit8=0 (8: Phone Led (in/out)) bit7=1 (7: Wifi Led (in/out)) bit6=1 (6: Config Bit 3 (in)) bit5=1 (5: Config Bit 2 (in)) bit4=1 (4: Config Bit 1 (in)) bit3=0 (2: FXO Chip Select (Active low) (out)) bit2=0 (1: FXS SPI Chip Select (Active low) (out)) bit1=0 (3: FXSs, FXO devices reset (Active low) (out)) bit0=-1 ()
Usad el tipico echo valor > bits, por ejemplo:
root@OpenWrt:/proc/driver/gpio# echo "bitb=1" > bits
encendera el led azul (que suele significar una actualizacion de firmware, pero no en este caso
)
Para mas detalles, mirad los fuentes en arch/mips/adi-fusiv/.
KERNEL VARIOS:
Yo he intentado portar la arquitectura del router a un kernel moderno. No fui capaz. Pero si hay algun valiente con los conocimientos necesarios, esta es la informacion que le puedo proporcionar sobre los ficheros que hay que copiar/modificar para ello.
include/asm-mips/mach-adi_fusiv/*
include/vendor/*
arch/mips/kernel/cpu-probe.c
arch/mips/kernel/lx4189.c
arch/mips/kernel/proc.c
arch/mips/kernel/gdb-low.S
arch/mips/kernel/gdb-stub.c
arch/mips/kernel/process.c
arch/mips/kernel/traps.c
arch/mips/mm/cache.c
arch/mips/mm/c-lx4189.c
arch/mips/mm/tlbex.c
include/uart2/uart2_wrapper.h
drivers/uart2/uart2_wrapper.c
drivers/usb/host/ehci-hcd.c
drivers/usb/host/ohci-hcd.c
drivers/usb/host/ehci-vox160.c
drivers/usb/host/ohci-vox160.c
drivers/usb/gadget/epautoconf.c
drivers/usb/gadget/ether.c
drivers/usb/gadget/gadget_chips.h
include/linux/sbi_defs.h
include/linux/sbi_ioctl.h
include/linux/sbi_k_160.h
include/linux/sbi_k_200.h
include/linux/sbi_k.h
include/linux/if_vlan.h
include/linux/pci_ids.h
include/main/sbi_u.h
include/main/init_sbi_ioctl.h
include/rg_os.h
include/igmp_proxy_consts.h
include/kos_chardev_id.h
include/openssl/opensslv.h
include/dyn_field.h
include/adi6843.h
include/timer.h
include/asm-mips/cpu-features.h
include/asm-mips/cpu.h
include/asm-mips/isadep.h
include/asm-mips/mmu_context.h
include/asm-mips/module.h
include/asm-mips/pgtable-32.h
include/asm-mips/pgtable-bits.h
include/asm-mips/pgtable.h
include/asm-mips/stackframe.h
include/asm-mips/string.h
include/net/route.h
include/openssl/opensslv.h
net/core/dev.c
net/core/skbuff.c
net/ipv4/route.c
Pues eso, todos estos mas los correspondientes Kconfigs, Makefiles, etc. No parece una tarea facil, verdad? Ademas, estos son los que yo encontre. Seguro que hay mas …..
Alguien se atreve?