X-Git-Url: https://git.rohieb.name/openwrt.git/blobdiff_plain/ddefa678f669b4b68a05e4278b4e892825c0fb39..7e450a1c869a5b227e3c91c4e71049059f1193e6:/package/switch/src/switch-adm.c diff --git a/package/switch/src/switch-adm.c b/package/switch/src/switch-adm.c index 921ad50a4..85805f6b3 100644 --- a/package/switch/src/switch-adm.c +++ b/package/switch/src/switch-adm.c @@ -26,7 +26,7 @@ * 02110-1301, USA. */ -#include +#include #include #include #include @@ -49,7 +49,7 @@ static int force = 0; MODULE_AUTHOR("Felix Fietkau "); MODULE_LICENSE("GPL"); -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,17) +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,52) module_param(eecs, int, 0); module_param(eesk, int, 0); module_param(eedi, int, 0); @@ -223,7 +223,7 @@ static __u32 adm_rreg(__u8 table, __u8 addr) __u8 bits[6] = { 0xFF, 0xFF, 0xFF, 0xFF, (0x06 << 4) | ((table & 0x01) << 3 | (addr&64)>>6), - ((addr&62)<<2) + ((addr&63)<<2) }; __u8 rbits[4]; @@ -498,8 +498,17 @@ static int detect_adm(void) #if defined(BCMGPIO2) || defined(BCMGPIO) int boardflags = atoi(nvram_get("boardflags")); + int boardnum = atoi(nvram_get("boardnum")); - if ((boardflags & 0x80) || force) { + if (boardnum == 44) { /* Trendware TEW-411BRP+ */ + ret = 1; + + eecs = getgpiopin("adm_eecs", 2); + eesk = getgpiopin("adm_eesk", 3); + eedi = getgpiopin("adm_eedi", 4); + eerc = getgpiopin("adm_rc", 5); + + } else if ((boardflags & 0x80) || force) { ret = 1; eecs = getgpiopin("adm_eecs", 2);