Changeset 47917


Ignore:
Timestamp:
2015-12-17T10:28:21+01:00 (2 years ago)
Author:
blogic
Message:

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@…>

Location:
trunk/package/kernel/lantiq/ltq-ptm/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/package/kernel/lantiq/ltq-ptm/src/ifxmips_ptm_adsl.c

    r46218 r47917  
    4444#include <linux/etherdevice.h> 
    4545#include <linux/interrupt.h> 
     46#include <linux/netdevice.h> 
    4647#include <asm/io.h> 
    4748 
     
    278279static void ptm_setup(struct net_device *dev, int ndev) 
    279280{ 
     281#if defined(CONFIG_IFXMIPS_DSL_CPE_MEI) || defined(CONFIG_IFXMIPS_DSL_CPE_MEI_MODULE) 
     282    netif_carrier_off(dev); 
     283#endif 
     284 
    280285    /*  hook network operations */ 
    281286    dev->netdev_ops      = &g_ptm_netdev_ops; 
     
    13851390static int ptm_showtime_enter(struct port_cell_info *port_cell, void *xdata_addr) 
    13861391{ 
     1392    int i; 
    13871393 
    13881394    g_showtime = 1; 
    13891395 
     1396    for ( i = 0; i < ARRAY_SIZE(g_net_dev); i++ ) 
     1397        netif_carrier_on(g_net_dev[i]); 
     1398 
    13901399    printk("enter showtime\n"); 
    13911400 
     
    13951404static int ptm_showtime_exit(void) 
    13961405{ 
     1406    int i; 
     1407 
    13971408    if ( !g_showtime ) 
    13981409        return -1; 
     1410 
     1411    for ( i = 0; i < ARRAY_SIZE(g_net_dev); i++ ) 
     1412        netif_carrier_off(g_net_dev[i]); 
    13991413 
    14001414    g_showtime = 0; 
  • trunk/package/kernel/lantiq/ltq-ptm/src/ifxmips_ptm_vdsl.c

    r46218 r47917  
    3333#include <linux/etherdevice.h> 
    3434#include <linux/interrupt.h> 
     35#include <linux/netdevice.h> 
    3536 
    3637#include "ifxmips_ptm_vdsl.h" 
     
    137138static void ptm_setup(struct net_device *dev, int ndev) 
    138139{ 
     140    netif_carrier_off(dev); 
     141 
    139142    dev->netdev_ops      = &g_ptm_netdev_ops; 
    140143    netif_napi_add(dev, &g_ptm_priv_data.itf[ndev].napi, ptm_napi_poll, 16); 
     
    889892static int ptm_showtime_enter(struct port_cell_info *port_cell, void *xdata_addr) 
    890893{ 
     894        int i; 
     895 
    891896        ASSERT(port_cell != NULL, "port_cell is NULL"); 
    892897        ASSERT(xdata_addr != NULL, "xdata_addr is NULL"); 
     
    896901 
    897902        g_showtime = 1; 
     903 
     904        for ( i = 0; i < ARRAY_SIZE(g_net_dev); i++ ) 
     905                netif_carrier_on(g_net_dev[i]); 
    898906 
    899907        IFX_REG_W32(0x0F, UTP_CFG); 
     
    910918static int ptm_showtime_exit(void) 
    911919{ 
     920        int i; 
     921 
    912922        if ( !g_showtime ) 
    913923                return -1; 
     
    918928 
    919929        IFX_REG_W32(0x00, UTP_CFG); 
     930 
     931        for ( i = 0; i < ARRAY_SIZE(g_net_dev); i++ ) 
     932                netif_carrier_off(g_net_dev[i]); 
    920933 
    921934        g_showtime = 0; 
Note: See TracChangeset for help on using the changeset viewer.