I just updated the udc support for g_ether gadget.
This is in 2 parts and I thought it needed some explanation.
Firstly ether gadget support for suspend is added and implemented for the
cdc_subset driver. Suspend in pxa270-speak is where the gadget loses its
host connection for 3ms or more. As the balloon3 has no hardware detection
for cable plug/unplug, this is one reliable way of detecting the cable
being unplugged and thus notifying the ethernet link layer that no more
traffic is possible.
The second part is a horrible hack on the back of the first part. I failed
to get ifpugd to monitor the state of the interface even when ethtool link
detection was routed to netif_carrier. Maybe that could be persuaded to
work and would be a better solution that what follows. I added a usermode
helper that explicitly (yes it should be via an installable proxy but time
etc) calls ifup/down when the carrier is said to come and go. Note that
this will happen in interrupt context so we must defer processing till
later. Also note that there is whole slew if carrier present/absent calls
during connect/disconnect so I run a cumulative timeout to only request one
ifup/down per flurry of activity and then schedule the helper function.
And it seems to work ok too.
Nick Bane