diff options
author | John Crispin <blogic@openwrt.org> | 2015-12-17 09:28:21 +0000 |
---|---|---|
committer | John Crispin <blogic@openwrt.org> | 2015-12-17 09:28:21 +0000 |
commit | 78869a84acacc5c313fe2be9c67df98d9240c893 (patch) | |
tree | 55800fd4a4f268438a3f18840122c144ccbff53a /package/kernel/lantiq/ltq-ptm/src | |
parent | 942bdffc7cf5afb7f660d37b11d2fcd096ba4f88 (diff) | |
download | master-187ad058-78869a84acacc5c313fe2be9c67df98d9240c893.tar.gz master-187ad058-78869a84acacc5c313fe2be9c67df98d9240c893.tar.bz2 master-187ad058-78869a84acacc5c313fe2be9c67df98d9240c893.zip |
lantiq: ltq-ptm: set carrier status
Principal purpose is to prevent the error message
ifxmips_ptm_vdsl.c:281:ptm_hard_start_xmit: not in showtime
which is printed at least once per second to the serial console, if the
ptm interface is not in showtime, but a processes already sends
packages over that interface. This happens for adsl as well as vdsl
over ptm.
It's pppd which sends packages over the ptm device before in showtime.
As far as I can see, pppd is started unconditionally since netif can
not gather the link status of the ptm network interface.
Signed-off-by: Mathias Kresin <openwrt@kresin.me>
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@47917 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'package/kernel/lantiq/ltq-ptm/src')
-rw-r--r-- | package/kernel/lantiq/ltq-ptm/src/ifxmips_ptm_adsl.c | 14 | ||||
-rw-r--r-- | package/kernel/lantiq/ltq-ptm/src/ifxmips_ptm_vdsl.c | 13 |
2 files changed, 27 insertions, 0 deletions
diff --git a/package/kernel/lantiq/ltq-ptm/src/ifxmips_ptm_adsl.c b/package/kernel/lantiq/ltq-ptm/src/ifxmips_ptm_adsl.c index 38001c3171..dc75b12cca 100644 --- a/package/kernel/lantiq/ltq-ptm/src/ifxmips_ptm_adsl.c +++ b/package/kernel/lantiq/ltq-ptm/src/ifxmips_ptm_adsl.c @@ -43,6 +43,7 @@ #include <linux/ioctl.h> #include <linux/etherdevice.h> #include <linux/interrupt.h> +#include <linux/netdevice.h> #include <asm/io.h> /* @@ -277,6 +278,10 @@ static int g_showtime = 0; static void ptm_setup(struct net_device *dev, int ndev) { +#if defined(CONFIG_IFXMIPS_DSL_CPE_MEI) || defined(CONFIG_IFXMIPS_DSL_CPE_MEI_MODULE) + netif_carrier_off(dev); +#endif + /* hook network operations */ dev->netdev_ops = &g_ptm_netdev_ops; netif_napi_add(dev, &g_ptm_priv_data.itf[ndev].napi, ptm_napi_poll, 25); @@ -1384,9 +1389,13 @@ static INLINE void init_tables(void) static int ptm_showtime_enter(struct port_cell_info *port_cell, void *xdata_addr) { + int i; g_showtime = 1; + for ( i = 0; i < ARRAY_SIZE(g_net_dev); i++ ) + netif_carrier_on(g_net_dev[i]); + printk("enter showtime\n"); return 0; @@ -1394,9 +1403,14 @@ static int ptm_showtime_enter(struct port_cell_info *port_cell, void *xdata_addr static int ptm_showtime_exit(void) { + int i; + if ( !g_showtime ) return -1; + for ( i = 0; i < ARRAY_SIZE(g_net_dev); i++ ) + netif_carrier_off(g_net_dev[i]); + g_showtime = 0; printk("leave showtime\n"); diff --git a/package/kernel/lantiq/ltq-ptm/src/ifxmips_ptm_vdsl.c b/package/kernel/lantiq/ltq-ptm/src/ifxmips_ptm_vdsl.c index 9adeba4d00..41464e6c27 100644 --- a/package/kernel/lantiq/ltq-ptm/src/ifxmips_ptm_vdsl.c +++ b/package/kernel/lantiq/ltq-ptm/src/ifxmips_ptm_vdsl.c @@ -32,6 +32,7 @@ #include <linux/ioctl.h> #include <linux/etherdevice.h> #include <linux/interrupt.h> +#include <linux/netdevice.h> #include "ifxmips_ptm_vdsl.h" #include <lantiq_soc.h> @@ -136,6 +137,8 @@ unsigned int ifx_ptm_dbg_enable = DBG_ENABLE_MASK_ERR; static void ptm_setup(struct net_device *dev, int ndev) { + netif_carrier_off(dev); + dev->netdev_ops = &g_ptm_netdev_ops; netif_napi_add(dev, &g_ptm_priv_data.itf[ndev].napi, ptm_napi_poll, 16); dev->watchdog_timeo = ETH_WATCHDOG_TIMEOUT; @@ -888,6 +891,8 @@ static inline void clear_tables(void) static int ptm_showtime_enter(struct port_cell_info *port_cell, void *xdata_addr) { + int i; + ASSERT(port_cell != NULL, "port_cell is NULL"); ASSERT(xdata_addr != NULL, "xdata_addr is NULL"); @@ -896,6 +901,9 @@ static int ptm_showtime_enter(struct port_cell_info *port_cell, void *xdata_addr g_showtime = 1; + for ( i = 0; i < ARRAY_SIZE(g_net_dev); i++ ) + netif_carrier_on(g_net_dev[i]); + IFX_REG_W32(0x0F, UTP_CFG); //#ifdef CONFIG_VR9 @@ -909,6 +917,8 @@ static int ptm_showtime_enter(struct port_cell_info *port_cell, void *xdata_addr static int ptm_showtime_exit(void) { + int i; + if ( !g_showtime ) return -1; @@ -918,6 +928,9 @@ static int ptm_showtime_exit(void) IFX_REG_W32(0x00, UTP_CFG); + for ( i = 0; i < ARRAY_SIZE(g_net_dev); i++ ) + netif_carrier_off(g_net_dev[i]); + g_showtime = 0; // TODO: ReTX clean state |