Additional information: Board is down and ethernet unplugged. Board is switched on, I wait for end of boot then I plug ethernet cable, here; hotplug is call ACTION=ifup Then I unplug, no hotplug call, then I plug, no hotplug call. I don't understand why it is called only if I boot without ethernet
2016-07-19 15:35 GMT+02:00 Baptiste Clenet <bapcle...@gmail.com>: > Hi, > > I added two scripts in hotplug /etc/htoplug.d/net and /iface to check > when the interface eth0 is up or down or even link up/down. > Each time I plug the cable, Kernel driver says: > [ 1376.480000] rt305x-esw 10110000.esw: link changed 0x01 > and unplug: > [ 1373.490000] rt305x-esw 10110000.esw: link changed 0x00 > > Nevertheless, it seems that no ACTION is raised on hotplug so I can't > detect if eth0 is link up or down. > Thing is, I would like, every time I unplug the ethernet cable, that the > interface is set down. > > The ethernet driver for this part is the irq handler: > static irqreturn_t esw_interrupt(int irq, void *_esw) > { > struct rt305x_esw *esw = (struct rt305x_esw *) _esw; > u32 status; > > status = esw_r32(esw, RT305X_ESW_REG_ISR); > if (status & RT305X_ESW_PORT_ST_CHG) { > u32 link = esw_r32(esw, RT305X_ESW_REG_POA); > link >>= RT305X_ESW_POA_LINK_SHIFT; > link &= RT305X_ESW_POA_LINK_MASK; > dev_info(esw->dev, "link changed 0x%02X\n", link); > } > esw_w32(esw, status, RT305X_ESW_REG_ISR); > > return IRQ_HANDLED; > } > > It does not seem to send a SIGNAL to kernel for a LINK UP/DOWN. Is > that normal and how can I detect that ethernet is plug/unplug? > > Cheers, > > -- > Baptiste -- Baptiste _______________________________________________ Lede-dev mailing list Lede-dev@lists.infradead.org http://lists.infradead.org/mailman/listinfo/lede-dev