public inbox for gentoo-user@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-user] Net problems
@ 2015-05-14  3:45 Meino.Cramer
  2015-05-14  5:53 ` Mick
  0 siblings, 1 reply; 4+ messages in thread
From: Meino.Cramer @ 2015-05-14  3:45 UTC (permalink / raw
  To: Gentoo

Hi,

I have a problem with some kind of a lokal net connection (ethernet
over USB):

Current handling is as follows:
I boot my Gentoo-Linux PC, which connects to my Fritz!Box, collect 
EMail etc...works fine so far.
Then I connect an embedded system (Arietta G25
www.acmesystems.it/arietta) to the usb port and wait until this
little thing has booted.
On my Linux PC I do the following then (as root):

ifconfig usb0 192.168.10.1 up
echo 1 >! /proc/sys/net/ipv4/ip_forward
iptables -A FORWARD -i eth1 -j ACCEPT
modprobe ip_tables
modprobe ip_conntrack
iptables -t nat -A POSTROUTING -o eth1 -j MASQUERADE
ssh -t root@ariettaa abduco -A root

(I real life I have two Ariettas which I connect to the
PC the same time with two different IP-addresses and two
different USB-ports)

This connects me finally to the Arietta, which do ethernet over USB.
I put the commands into a script, so not too much hassle here.

But!
On the Arietta I also installed Gentoo. An update, especially
when it includes gcc can take up to three days (I tried
crosscompilation and some other construction and I am currently
most happiest (sounds a litte too much like 'german english'...;)
with this).
So I first fetch all needed files and then restart the update
and detach from the terminal.

Now the problem:
When I shutdown the PC, which needs not to run all the time, and
restart it later again I am no longer able to connect to the Arietta
with the steps described above. All needed modules are loaded while
booting the PC and ifplugd is installed on the Arietta.

Unfortunately I have not found any differences of the USB interface,
which would make it possible to handle the Ariettas via udev.

How can I make a reconnect after rebooting my PC possible every time?

Thank you very much in advance for any help!
Best regards,
Meino







^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [gentoo-user] Net problems
  2015-05-14  3:45 [gentoo-user] Net problems Meino.Cramer
@ 2015-05-14  5:53 ` Mick
  2015-05-14  6:34   ` Meino.Cramer
  0 siblings, 1 reply; 4+ messages in thread
From: Mick @ 2015-05-14  5:53 UTC (permalink / raw
  To: gentoo-user

[-- Attachment #1: Type: Text/Plain, Size: 2477 bytes --]

On Thursday 14 May 2015 04:45:38 Meino.Cramer@gmx.de wrote:
> Hi,
> 
> I have a problem with some kind of a lokal net connection (ethernet
> over USB):

I think that the problem is not network related, but USB rules related.  
Please see below.


> Current handling is as follows:
> I boot my Gentoo-Linux PC, which connects to my Fritz!Box, collect
> EMail etc...works fine so far.
> Then I connect an embedded system (Arietta G25
> www.acmesystems.it/arietta) to the usb port and wait until this
> little thing has booted.
> On my Linux PC I do the following then (as root):
> 
> ifconfig usb0 192.168.10.1 up
> echo 1 >! /proc/sys/net/ipv4/ip_forward
> iptables -A FORWARD -i eth1 -j ACCEPT
> modprobe ip_tables
> modprobe ip_conntrack
> iptables -t nat -A POSTROUTING -o eth1 -j MASQUERADE
> ssh -t root@ariettaa abduco -A root
> 
> (I real life I have two Ariettas which I connect to the
> PC the same time with two different IP-addresses and two
> different USB-ports)
> 
> This connects me finally to the Arietta, which do ethernet over USB.
> I put the commands into a script, so not too much hassle here.
> 
> But!
> On the Arietta I also installed Gentoo. An update, especially
> when it includes gcc can take up to three days (I tried
> crosscompilation and some other construction and I am currently
> most happiest (sounds a litte too much like 'german english'...;)
> with this).
> So I first fetch all needed files and then restart the update
> and detach from the terminal.
> 
> Now the problem:
> When I shutdown the PC, which needs not to run all the time, and
> restart it later again I am no longer able to connect to the Arietta
> with the steps described above. All needed modules are loaded while
> booting the PC and ifplugd is installed on the Arietta.
> 
> Unfortunately I have not found any differences of the USB interface,
> which would make it possible to handle the Ariettas via udev.

Have you used 'udevadm monitor' to check how your USB device is recognised?  
Each time it will be a different host & target and this is your problem.
 

> How can I make a reconnect after rebooting my PC possible every time?

I think that the solution is to create a udev rule which will identify your 
arietta interface when plugged in the PC and run the necessary script from 
there on.

Have a look here for persistent device naming:

https://wiki.gentoo.org/wiki/Udev

-- 
Regards,
Mick

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 473 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [gentoo-user] Net problems
  2015-05-14  5:53 ` Mick
@ 2015-05-14  6:34   ` Meino.Cramer
  2015-05-15 22:25     ` Mick
  0 siblings, 1 reply; 4+ messages in thread
From: Meino.Cramer @ 2015-05-14  6:34 UTC (permalink / raw
  To: gentoo-user

Mick <michaelkintzios@gmail.com> [15-05-14 08:00]:
> On Thursday 14 May 2015 04:45:38 Meino.Cramer@gmx.de wrote:
> > Hi,
> > 
> > I have a problem with some kind of a lokal net connection (ethernet
> > over USB):
> 
> I think that the problem is not network related, but USB rules related.  
> Please see below.
> 
> 
> > Current handling is as follows:
> > I boot my Gentoo-Linux PC, which connects to my Fritz!Box, collect
> > EMail etc...works fine so far.
> > Then I connect an embedded system (Arietta G25
> > www.acmesystems.it/arietta) to the usb port and wait until this
> > little thing has booted.
> > On my Linux PC I do the following then (as root):
> > 
> > ifconfig usb0 192.168.10.1 up
> > echo 1 >! /proc/sys/net/ipv4/ip_forward
> > iptables -A FORWARD -i eth1 -j ACCEPT
> > modprobe ip_tables
> > modprobe ip_conntrack
> > iptables -t nat -A POSTROUTING -o eth1 -j MASQUERADE
> > ssh -t root@ariettaa abduco -A root
> > 
> > (I real life I have two Ariettas which I connect to the
> > PC the same time with two different IP-addresses and two
> > different USB-ports)
> > 
> > This connects me finally to the Arietta, which do ethernet over USB.
> > I put the commands into a script, so not too much hassle here.
> > 
> > But!
> > On the Arietta I also installed Gentoo. An update, especially
> > when it includes gcc can take up to three days (I tried
> > crosscompilation and some other construction and I am currently
> > most happiest (sounds a litte too much like 'german english'...;)
> > with this).
> > So I first fetch all needed files and then restart the update
> > and detach from the terminal.
> > 
> > Now the problem:
> > When I shutdown the PC, which needs not to run all the time, and
> > restart it later again I am no longer able to connect to the Arietta
> > with the steps described above. All needed modules are loaded while
> > booting the PC and ifplugd is installed on the Arietta.
> > 
> > Unfortunately I have not found any differences of the USB interface,
> > which would make it possible to handle the Ariettas via udev.
> 
> Have you used 'udevadm monitor' to check how your USB device is recognised?  
> Each time it will be a different host & target and this is your problem.
>  
> 
> > How can I make a reconnect after rebooting my PC possible every time?
> 
> I think that the solution is to create a udev rule which will identify your 
> arietta interface when plugged in the PC and run the necessary script from 
> there on.
> 
> Have a look here for persistent device naming:
> 
> https://wiki.gentoo.org/wiki/Udev
> 
> -- 
> Regards,
> Mick

Hi Mick,

This is what udevadm monitor prints, when I unplug both Ariettas 
simultanously:
solfire:/home/mccramer>udevadm monitor
monitor will print the received events for:
UDEV - the event which udev sends out after rule processing
KERNEL - the kernel uevent

KERNEL[13781.884965] remove   /devices/pci0000:00/0000:00:13.2/usb4/4-4/4-4:1.0/net/usb1/queues/rx-0 (queues)
KERNEL[13781.885027] remove   /devices/pci0000:00/0000:00:13.2/usb4/4-4/4-4:1.0/net/usb1/queues/tx-0 (queues)
KERNEL[13781.885067] remove   /devices/pci0000:00/0000:00:13.2/usb4/4-4/4-4:1.0/net/usb1 (net)
UDEV  [13781.886418] remove   /devices/pci0000:00/0000:00:13.2/usb4/4-4/4-4:1.0/net/usb1/queues/rx-0 (queues)
KERNEL[13781.889122] remove   /devices/pci0000:00/0000:00:13.2/usb4/4-4/4-4:1.0 (usb)
KERNEL[13781.889194] remove   /devices/pci0000:00/0000:00:13.2/usb4/4-4 (usb)
UDEV  [13781.902185] remove   /devices/pci0000:00/0000:00:13.2/usb4/4-4/4-4:1.0/net/usb1/queues/tx-0 (queues)
UDEV  [13781.908021] remove   /devices/pci0000:00/0000:00:13.2/usb4/4-4/4-4:1.0/net/usb1 (net)
UDEV  [13781.908429] remove   /devices/pci0000:00/0000:00:13.2/usb4/4-4/4-4:1.0 (usb)
UDEV  [13781.919474] remove   /devices/pci0000:00/0000:00:13.2/usb4/4-4 (usb)
KERNEL[13781.993142] remove   /devices/pci0000:00/0000:00:13.2/usb4/4-5/4-5:1.0/net/usb0/queues/rx-0 (queues)
KERNEL[13781.993182] remove   /devices/pci0000:00/0000:00:13.2/usb4/4-5/4-5:1.0/net/usb0/queues/tx-0 (queues)
KERNEL[13781.993211] remove   /devices/pci0000:00/0000:00:13.2/usb4/4-5/4-5:1.0/net/usb0 (net)
UDEV  [13781.993928] remove   /devices/pci0000:00/0000:00:13.2/usb4/4-5/4-5:1.0/net/usb0/queues/rx-0 (queues)
UDEV  [13781.994215] remove   /devices/pci0000:00/0000:00:13.2/usb4/4-5/4-5:1.0/net/usb0/queues/tx-0 (queues)
KERNEL[13781.998111] remove   /devices/pci0000:00/0000:00:13.2/usb4/4-5/4-5:1.0 (usb)
KERNEL[13781.998170] remove   /devices/pci0000:00/0000:00:13.2/usb4/4-5 (usb)
UDEV  [13782.000177] remove   /devices/pci0000:00/0000:00:13.2/usb4/4-5/4-5:1.0/net/usb0 (net)
UDEV  [13782.000767] remove   /devices/pci0000:00/0000:00:13.2/usb4/4-5/4-5:1.0 (usb)
UDEV  [13782.013093] remove   /devices/pci0000:00/0000:00:13.2/usb4/4-5 (usb)


This is printed, when I connect the first Arietta to the PC:

monitor will print the received events for:
UDEV - the event which udev sends out after rule processing
KERNEL - the kernel uevent

KERNEL[14000.140611] add      /devices/pci0000:00/0000:00:13.2/usb4/4-5 (usb)
KERNEL[14000.141572] add      /devices/pci0000:00/0000:00:13.2/usb4/4-5/4-5:1.0 (usb)
KERNEL[14000.141967] add      /devices/pci0000:00/0000:00:13.2/usb4/4-5/4-5:1.0/net/usb0 (net)
KERNEL[14000.142000] add      /devices/pci0000:00/0000:00:13.2/usb4/4-5/4-5:1.0/net/usb0/queues/rx-0 (queues)
KERNEL[14000.142046] add      /devices/pci0000:00/0000:00:13.2/usb4/4-5/4-5:1.0/net/usb0/queues/tx-0 (queues)
UDEV  [14000.162311] add      /devices/pci0000:00/0000:00:13.2/usb4/4-5 (usb)
UDEV  [14000.163727] add      /devices/pci0000:00/0000:00:13.2/usb4/4-5/4-5:1.0 (usb)
UDEV  [14000.170206] add      /devices/pci0000:00/0000:00:13.2/usb4/4-5/4-5:1.0/net/usb0 (net)
UDEV  [14000.170572] add      /devices/pci0000:00/0000:00:13.2/usb4/4-5/4-5:1.0/net/usb0/queues/rx-0 (queues)
UDEV  [14000.185482] add      /devices/pci0000:00/0000:00:13.2/usb4/4-5/4-5:1.0/net/usb0/queues/tx-0 (queues


This is printed, when I connect the second Arietta to the PC:

monitor will print the received events for:
UDEV - the event which udev sends out after rule processing
KERNEL - the kernel uevent

KERNEL[14108.192714] add      /devices/pci0000:00/0000:00:13.2/usb4/4-4 (usb)
KERNEL[14108.193781] add      /devices/pci0000:00/0000:00:13.2/usb4/4-4/4-4:1.0 (usb)
KERNEL[14108.194211] add      /devices/pci0000:00/0000:00:13.2/usb4/4-4/4-4:1.0/net/usb1 (net)
KERNEL[14108.194247] add      /devices/pci0000:00/0000:00:13.2/usb4/4-4/4-4:1.0/net/usb1/queues/rx-0 (queues)
KERNEL[14108.194269] add      /devices/pci0000:00/0000:00:13.2/usb4/4-4/4-4:1.0/net/usb1/queues/tx-0 (queues)
UDEV  [14108.211967] add      /devices/pci0000:00/0000:00:13.2/usb4/4-4 (usb)
UDEV  [14108.213327] add      /devices/pci0000:00/0000:00:13.2/usb4/4-4/4-4:1.0 (usb)
UDEV  [14108.217344] add      /devices/pci0000:00/0000:00:13.2/usb4/4-4/4-4:1.0/net/usb1 (net)
UDEV  [14108.217615] add      /devices/pci0000:00/0000:00:13.2/usb4/4-4/4-4:1.0/net/usb1/queues/rx-0 (queues)
UDEV  [14108.237237] add      /devices/pci0000:00/0000:00:13.2/usb4/4-4/4-4:1.0/net/usb1/queues/tx-0 (queues)


The assigment to certain USB ports may vary from time to time.


This is what lsusb prints for both devices


Bus 004 Device 007: ID 0525:a4a2 Netchip Technology, Inc. Linux-USB Ethernet/RNDIS Gadget
Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               2.00
  bDeviceClass            2 Communications
  bDeviceSubClass         0 
  bDeviceProtocol         0 
  bMaxPacketSize0        64
  idVendor           0x0525 Netchip Technology, Inc.
  idProduct          0xa4a2 Linux-USB Ethernet/RNDIS Gadget
  bcdDevice            4.00
  iManufacturer           1 Linux 4.0.1-20150414.001 with atmel_usba_udc
  iProduct                2 RNDIS/Ethernet Gadget
  iSerial                 0 
  bNumConfigurations      2
  Configuration Descriptor:
    bLength                 9
    bDescriptorType         2
    wTotalLength           75
    bNumInterfaces          2
    bConfigurationValue     2
    iConfiguration          0 
    bmAttributes         0xc0
      Self Powered
    MaxPower                2mA
    Interface Association:
      bLength                 8
      bDescriptorType        11
      bFirstInterface         0
      bInterfaceCount         2
      bFunctionClass          2 Communications
      bFunctionSubClass       6 Ethernet Networking
      bFunctionProtocol       0 
      iFunction               6 RNDIS
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        0
      bAlternateSetting       0
      bNumEndpoints           1
      bInterfaceClass         2 Communications
      bInterfaceSubClass      2 Abstract (modem)
      bInterfaceProtocol    255 Vendor Specific (MSFT RNDIS?)
      iInterface              4 RNDIS Communications Control
      CDC Header:
        bcdCDC               1.10
      CDC Call Management:
        bmCapabilities       0x00
        bDataInterface          1
      CDC ACM:
        bmCapabilities       0x00
      CDC Union:
        bMasterInterface        0
        bSlaveInterface         1 
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x83  EP 3 IN
        bmAttributes            3
          Transfer Type            Interrupt
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0008  1x 8 bytes
        bInterval              32
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        1
      bAlternateSetting       0
      bNumEndpoints           2
      bInterfaceClass        10 CDC Data
      bInterfaceSubClass      0 
      bInterfaceProtocol      0 
      iInterface              5 RNDIS Ethernet Data
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x81  EP 1 IN
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0040  1x 64 bytes
        bInterval               0
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x02  EP 2 OUT
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0040  1x 64 bytes
        bInterval               0
  Configuration Descriptor:
    bLength                 9
    bDescriptorType         2
    wTotalLength           32
    bNumInterfaces          1
    bConfigurationValue     1
    iConfiguration          0 
    bmAttributes         0xc0
      Self Powered
    MaxPower                2mA
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        0
      bAlternateSetting       0
      bNumEndpoints           2
      bInterfaceClass         2 Communications
      bInterfaceSubClass     12 Ethernet Emulation
      bInterfaceProtocol      7 Ethernet Emulation (EEM)
      iInterface              8 CDC Ethernet Emulation Model (EEM)
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x81  EP 1 IN
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0040  1x 64 bytes
        bInterval               0
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x02  EP 2 OUT
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0040  1x 64 bytes
        bInterval               0
Device Qualifier (for other device speed):
  bLength                10
  bDescriptorType         6
  bcdUSB               2.00
  bDeviceClass            2 Communications
  bDeviceSubClass         0 
  bDeviceProtocol         0 
  bMaxPacketSize0        64
  bNumConfigurations      2
Device Status:     0x0001
  Self Powered

Bus 004 Device 008: ID 0525:a4a2 Netchip Technology, Inc. Linux-USB Ethernet/RNDIS Gadget
Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               2.00
  bDeviceClass            2 Communications
  bDeviceSubClass         0 
  bDeviceProtocol         0 
  bMaxPacketSize0        64
  idVendor           0x0525 Netchip Technology, Inc.
  idProduct          0xa4a2 Linux-USB Ethernet/RNDIS Gadget
  bcdDevice            4.00
  iManufacturer           1 Linux 4.0.1-20150414.001 with atmel_usba_udc
  iProduct                2 RNDIS/Ethernet Gadget
  iSerial                 0 
  bNumConfigurations      2
  Configuration Descriptor:
    bLength                 9
    bDescriptorType         2
    wTotalLength           75
    bNumInterfaces          2
    bConfigurationValue     2
    iConfiguration          0 
    bmAttributes         0xc0
      Self Powered
    MaxPower                2mA
    Interface Association:
      bLength                 8
      bDescriptorType        11
      bFirstInterface         0
      bInterfaceCount         2
      bFunctionClass          2 Communications
      bFunctionSubClass       6 Ethernet Networking
      bFunctionProtocol       0 
      iFunction               6 RNDIS
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        0
      bAlternateSetting       0
      bNumEndpoints           1
      bInterfaceClass         2 Communications
      bInterfaceSubClass      2 Abstract (modem)
      bInterfaceProtocol    255 Vendor Specific (MSFT RNDIS?)
      iInterface              4 RNDIS Communications Control
      CDC Header:
        bcdCDC               1.10
      CDC Call Management:
        bmCapabilities       0x00
        bDataInterface          1
      CDC ACM:
        bmCapabilities       0x00
      CDC Union:
        bMasterInterface        0
        bSlaveInterface         1 
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x83  EP 3 IN
        bmAttributes            3
          Transfer Type            Interrupt
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0008  1x 8 bytes
        bInterval              32
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        1
      bAlternateSetting       0
      bNumEndpoints           2
      bInterfaceClass        10 CDC Data
      bInterfaceSubClass      0 
      bInterfaceProtocol      0 
      iInterface              5 RNDIS Ethernet Data
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x81  EP 1 IN
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0040  1x 64 bytes
        bInterval               0
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x02  EP 2 OUT
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0040  1x 64 bytes
        bInterval               0
  Configuration Descriptor:
    bLength                 9
    bDescriptorType         2
    wTotalLength           32
    bNumInterfaces          1
    bConfigurationValue     1
    iConfiguration          0 
    bmAttributes         0xc0
      Self Powered
    MaxPower                2mA
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        0
      bAlternateSetting       0
      bNumEndpoints           2
      bInterfaceClass         2 Communications
      bInterfaceSubClass     12 Ethernet Emulation
      bInterfaceProtocol      7 Ethernet Emulation (EEM)
      iInterface              8 CDC Ethernet Emulation Model (EEM)
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x81  EP 1 IN
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0040  1x 64 bytes
        bInterval               0
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x02  EP 2 OUT
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0040  1x 64 bytes
        bInterval               0
Device Qualifier (for other device speed):
  bLength                10
  bDescriptorType         6
  bcdUSB               2.00
  bDeviceClass            2 Communications
  bDeviceSubClass         0 
  bDeviceProtocol         0 
  bMaxPacketSize0        64
  bNumConfigurations      2
Device Status:     0x0001
  Self Powered


As I wrote in my initial mail:
I see no difference in both, which may offer a possibilty to act upon
when plugging in the one or the other (or both) devices/Ariettas.

Before I mailed to the group I read the documentation you linked, but
may be I missed something which reveals the solution to this
problem...
But what did I miss?

Best regards,
Meino





^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [gentoo-user] Net problems
  2015-05-14  6:34   ` Meino.Cramer
@ 2015-05-15 22:25     ` Mick
  0 siblings, 0 replies; 4+ messages in thread
From: Mick @ 2015-05-15 22:25 UTC (permalink / raw
  To: gentoo-user

[-- Attachment #1: Type: Text/Plain, Size: 17116 bytes --]

On Thursday 14 May 2015 07:34:41 Meino.Cramer@gmx.de wrote:

> This is what udevadm monitor prints, when I unplug both Ariettas
> simultanously:
> solfire:/home/mccramer>udevadm monitor
> monitor will print the received events for:
> UDEV - the event which udev sends out after rule processing
> KERNEL - the kernel uevent
> 
> KERNEL[13781.884965] remove  
> /devices/pci0000:00/0000:00:13.2/usb4/4-4/4-4:1.0/net/usb1/queues/rx-0
> (queues) KERNEL[13781.885027] remove  
> /devices/pci0000:00/0000:00:13.2/usb4/4-4/4-4:1.0/net/usb1/queues/tx-0
> (queues) KERNEL[13781.885067] remove  
> /devices/pci0000:00/0000:00:13.2/usb4/4-4/4-4:1.0/net/usb1 (net) UDEV 
> [13781.886418] remove  
> /devices/pci0000:00/0000:00:13.2/usb4/4-4/4-4:1.0/net/usb1/queues/rx-0
> (queues) KERNEL[13781.889122] remove  
> /devices/pci0000:00/0000:00:13.2/usb4/4-4/4-4:1.0 (usb)
> KERNEL[13781.889194] remove   /devices/pci0000:00/0000:00:13.2/usb4/4-4
> (usb) UDEV  [13781.902185] remove  
> /devices/pci0000:00/0000:00:13.2/usb4/4-4/4-4:1.0/net/usb1/queues/tx-0
> (queues) UDEV  [13781.908021] remove  
> /devices/pci0000:00/0000:00:13.2/usb4/4-4/4-4:1.0/net/usb1 (net) UDEV 
> [13781.908429] remove   /devices/pci0000:00/0000:00:13.2/usb4/4-4/4-4:1.0
> (usb) UDEV  [13781.919474] remove  
> /devices/pci0000:00/0000:00:13.2/usb4/4-4 (usb) KERNEL[13781.993142]
> remove  
> /devices/pci0000:00/0000:00:13.2/usb4/4-5/4-5:1.0/net/usb0/queues/rx-0
> (queues) KERNEL[13781.993182] remove  
> /devices/pci0000:00/0000:00:13.2/usb4/4-5/4-5:1.0/net/usb0/queues/tx-0
> (queues) KERNEL[13781.993211] remove  
> /devices/pci0000:00/0000:00:13.2/usb4/4-5/4-5:1.0/net/usb0 (net) UDEV 
> [13781.993928] remove  
> /devices/pci0000:00/0000:00:13.2/usb4/4-5/4-5:1.0/net/usb0/queues/rx-0
> (queues) UDEV  [13781.994215] remove  
> /devices/pci0000:00/0000:00:13.2/usb4/4-5/4-5:1.0/net/usb0/queues/tx-0
> (queues) KERNEL[13781.998111] remove  
> /devices/pci0000:00/0000:00:13.2/usb4/4-5/4-5:1.0 (usb)
> KERNEL[13781.998170] remove   /devices/pci0000:00/0000:00:13.2/usb4/4-5
> (usb) UDEV  [13782.000177] remove  
> /devices/pci0000:00/0000:00:13.2/usb4/4-5/4-5:1.0/net/usb0 (net) UDEV 
> [13782.000767] remove   /devices/pci0000:00/0000:00:13.2/usb4/4-5/4-5:1.0
> (usb) UDEV  [13782.013093] remove  
> /devices/pci0000:00/0000:00:13.2/usb4/4-5 (usb)
> 
> 
> This is printed, when I connect the first Arietta to the PC:
> 
> monitor will print the received events for:
> UDEV - the event which udev sends out after rule processing
> KERNEL - the kernel uevent
> 
> KERNEL[14000.140611] add      /devices/pci0000:00/0000:00:13.2/usb4/4-5
> (usb) KERNEL[14000.141572] add     
> /devices/pci0000:00/0000:00:13.2/usb4/4-5/4-5:1.0 (usb)
> KERNEL[14000.141967] add     
> /devices/pci0000:00/0000:00:13.2/usb4/4-5/4-5:1.0/net/usb0 (net)
> KERNEL[14000.142000] add     
> /devices/pci0000:00/0000:00:13.2/usb4/4-5/4-5:1.0/net/usb0/queues/rx-0
> (queues) KERNEL[14000.142046] add     
> /devices/pci0000:00/0000:00:13.2/usb4/4-5/4-5:1.0/net/usb0/queues/tx-0
> (queues) UDEV  [14000.162311] add     
> /devices/pci0000:00/0000:00:13.2/usb4/4-5 (usb) UDEV  [14000.163727] add  
>    /devices/pci0000:00/0000:00:13.2/usb4/4-5/4-5:1.0 (usb) UDEV 
> [14000.170206] add     
> /devices/pci0000:00/0000:00:13.2/usb4/4-5/4-5:1.0/net/usb0 (net) UDEV 
> [14000.170572] add     
> /devices/pci0000:00/0000:00:13.2/usb4/4-5/4-5:1.0/net/usb0/queues/rx-0
> (queues) UDEV  [14000.185482] add     
> /devices/pci0000:00/0000:00:13.2/usb4/4-5/4-5:1.0/net/usb0/queues/tx-0
> (queues
> 
> 
> This is printed, when I connect the second Arietta to the PC:
> 
> monitor will print the received events for:
> UDEV - the event which udev sends out after rule processing
> KERNEL - the kernel uevent
> 
> KERNEL[14108.192714] add      /devices/pci0000:00/0000:00:13.2/usb4/4-4
> (usb) KERNEL[14108.193781] add     
> /devices/pci0000:00/0000:00:13.2/usb4/4-4/4-4:1.0 (usb)
> KERNEL[14108.194211] add     
> /devices/pci0000:00/0000:00:13.2/usb4/4-4/4-4:1.0/net/usb1 (net)
> KERNEL[14108.194247] add     
> /devices/pci0000:00/0000:00:13.2/usb4/4-4/4-4:1.0/net/usb1/queues/rx-0
> (queues) KERNEL[14108.194269] add     
> /devices/pci0000:00/0000:00:13.2/usb4/4-4/4-4:1.0/net/usb1/queues/tx-0
> (queues) UDEV  [14108.211967] add     
> /devices/pci0000:00/0000:00:13.2/usb4/4-4 (usb) UDEV  [14108.213327] add  
>    /devices/pci0000:00/0000:00:13.2/usb4/4-4/4-4:1.0 (usb) UDEV 
> [14108.217344] add     
> /devices/pci0000:00/0000:00:13.2/usb4/4-4/4-4:1.0/net/usb1 (net) UDEV 
> [14108.217615] add     
> /devices/pci0000:00/0000:00:13.2/usb4/4-4/4-4:1.0/net/usb1/queues/rx-0
> (queues) UDEV  [14108.237237] add     
> /devices/pci0000:00/0000:00:13.2/usb4/4-4/4-4:1.0/net/usb1/queues/tx-0
> (queues)
> 
> 
> The assigment to certain USB ports may vary from time to time.
> 
> 
> This is what lsusb prints for both devices
> 
> 
> Bus 004 Device 007: ID 0525:a4a2 Netchip Technology, Inc. Linux-USB
> Ethernet/RNDIS Gadget Device Descriptor:
>   bLength                18
>   bDescriptorType         1
>   bcdUSB               2.00
>   bDeviceClass            2 Communications
>   bDeviceSubClass         0
>   bDeviceProtocol         0
>   bMaxPacketSize0        64
>   idVendor           0x0525 Netchip Technology, Inc.
>   idProduct          0xa4a2 Linux-USB Ethernet/RNDIS Gadget
>   bcdDevice            4.00
>   iManufacturer           1 Linux 4.0.1-20150414.001 with atmel_usba_udc
>   iProduct                2 RNDIS/Ethernet Gadget
>   iSerial                 0
>   bNumConfigurations      2
>   Configuration Descriptor:
>     bLength                 9
>     bDescriptorType         2
>     wTotalLength           75
>     bNumInterfaces          2
>     bConfigurationValue     2
>     iConfiguration          0
>     bmAttributes         0xc0
>       Self Powered
>     MaxPower                2mA
>     Interface Association:
>       bLength                 8
>       bDescriptorType        11
>       bFirstInterface         0
>       bInterfaceCount         2
>       bFunctionClass          2 Communications
>       bFunctionSubClass       6 Ethernet Networking
>       bFunctionProtocol       0
>       iFunction               6 RNDIS
>     Interface Descriptor:
>       bLength                 9
>       bDescriptorType         4
>       bInterfaceNumber        0
>       bAlternateSetting       0
>       bNumEndpoints           1
>       bInterfaceClass         2 Communications
>       bInterfaceSubClass      2 Abstract (modem)
>       bInterfaceProtocol    255 Vendor Specific (MSFT RNDIS?)
>       iInterface              4 RNDIS Communications Control
>       CDC Header:
>         bcdCDC               1.10
>       CDC Call Management:
>         bmCapabilities       0x00
>         bDataInterface          1
>       CDC ACM:
>         bmCapabilities       0x00
>       CDC Union:
>         bMasterInterface        0
>         bSlaveInterface         1
>       Endpoint Descriptor:
>         bLength                 7
>         bDescriptorType         5
>         bEndpointAddress     0x83  EP 3 IN
>         bmAttributes            3
>           Transfer Type            Interrupt
>           Synch Type               None
>           Usage Type               Data
>         wMaxPacketSize     0x0008  1x 8 bytes
>         bInterval              32
>     Interface Descriptor:
>       bLength                 9
>       bDescriptorType         4
>       bInterfaceNumber        1
>       bAlternateSetting       0
>       bNumEndpoints           2
>       bInterfaceClass        10 CDC Data
>       bInterfaceSubClass      0
>       bInterfaceProtocol      0
>       iInterface              5 RNDIS Ethernet Data
>       Endpoint Descriptor:
>         bLength                 7
>         bDescriptorType         5
>         bEndpointAddress     0x81  EP 1 IN
>         bmAttributes            2
>           Transfer Type            Bulk
>           Synch Type               None
>           Usage Type               Data
>         wMaxPacketSize     0x0040  1x 64 bytes
>         bInterval               0
>       Endpoint Descriptor:
>         bLength                 7
>         bDescriptorType         5
>         bEndpointAddress     0x02  EP 2 OUT
>         bmAttributes            2
>           Transfer Type            Bulk
>           Synch Type               None
>           Usage Type               Data
>         wMaxPacketSize     0x0040  1x 64 bytes
>         bInterval               0
>   Configuration Descriptor:
>     bLength                 9
>     bDescriptorType         2
>     wTotalLength           32
>     bNumInterfaces          1
>     bConfigurationValue     1
>     iConfiguration          0
>     bmAttributes         0xc0
>       Self Powered
>     MaxPower                2mA
>     Interface Descriptor:
>       bLength                 9
>       bDescriptorType         4
>       bInterfaceNumber        0
>       bAlternateSetting       0
>       bNumEndpoints           2
>       bInterfaceClass         2 Communications
>       bInterfaceSubClass     12 Ethernet Emulation
>       bInterfaceProtocol      7 Ethernet Emulation (EEM)
>       iInterface              8 CDC Ethernet Emulation Model (EEM)
>       Endpoint Descriptor:
>         bLength                 7
>         bDescriptorType         5
>         bEndpointAddress     0x81  EP 1 IN
>         bmAttributes            2
>           Transfer Type            Bulk
>           Synch Type               None
>           Usage Type               Data
>         wMaxPacketSize     0x0040  1x 64 bytes
>         bInterval               0
>       Endpoint Descriptor:
>         bLength                 7
>         bDescriptorType         5
>         bEndpointAddress     0x02  EP 2 OUT
>         bmAttributes            2
>           Transfer Type            Bulk
>           Synch Type               None
>           Usage Type               Data
>         wMaxPacketSize     0x0040  1x 64 bytes
>         bInterval               0
> Device Qualifier (for other device speed):
>   bLength                10
>   bDescriptorType         6
>   bcdUSB               2.00
>   bDeviceClass            2 Communications
>   bDeviceSubClass         0
>   bDeviceProtocol         0
>   bMaxPacketSize0        64
>   bNumConfigurations      2
> Device Status:     0x0001
>   Self Powered
> 
> Bus 004 Device 008: ID 0525:a4a2 Netchip Technology, Inc. Linux-USB
> Ethernet/RNDIS Gadget Device Descriptor:
>   bLength                18
>   bDescriptorType         1
>   bcdUSB               2.00
>   bDeviceClass            2 Communications
>   bDeviceSubClass         0
>   bDeviceProtocol         0
>   bMaxPacketSize0        64
>   idVendor           0x0525 Netchip Technology, Inc.
>   idProduct          0xa4a2 Linux-USB Ethernet/RNDIS Gadget
>   bcdDevice            4.00
>   iManufacturer           1 Linux 4.0.1-20150414.001 with atmel_usba_udc
>   iProduct                2 RNDIS/Ethernet Gadget
>   iSerial                 0
>   bNumConfigurations      2
>   Configuration Descriptor:
>     bLength                 9
>     bDescriptorType         2
>     wTotalLength           75
>     bNumInterfaces          2
>     bConfigurationValue     2
>     iConfiguration          0
>     bmAttributes         0xc0
>       Self Powered
>     MaxPower                2mA
>     Interface Association:
>       bLength                 8
>       bDescriptorType        11
>       bFirstInterface         0
>       bInterfaceCount         2
>       bFunctionClass          2 Communications
>       bFunctionSubClass       6 Ethernet Networking
>       bFunctionProtocol       0
>       iFunction               6 RNDIS
>     Interface Descriptor:
>       bLength                 9
>       bDescriptorType         4
>       bInterfaceNumber        0
>       bAlternateSetting       0
>       bNumEndpoints           1
>       bInterfaceClass         2 Communications
>       bInterfaceSubClass      2 Abstract (modem)
>       bInterfaceProtocol    255 Vendor Specific (MSFT RNDIS?)
>       iInterface              4 RNDIS Communications Control
>       CDC Header:
>         bcdCDC               1.10
>       CDC Call Management:
>         bmCapabilities       0x00
>         bDataInterface          1
>       CDC ACM:
>         bmCapabilities       0x00
>       CDC Union:
>         bMasterInterface        0
>         bSlaveInterface         1
>       Endpoint Descriptor:
>         bLength                 7
>         bDescriptorType         5
>         bEndpointAddress     0x83  EP 3 IN
>         bmAttributes            3
>           Transfer Type            Interrupt
>           Synch Type               None
>           Usage Type               Data
>         wMaxPacketSize     0x0008  1x 8 bytes
>         bInterval              32
>     Interface Descriptor:
>       bLength                 9
>       bDescriptorType         4
>       bInterfaceNumber        1
>       bAlternateSetting       0
>       bNumEndpoints           2
>       bInterfaceClass        10 CDC Data
>       bInterfaceSubClass      0
>       bInterfaceProtocol      0
>       iInterface              5 RNDIS Ethernet Data
>       Endpoint Descriptor:
>         bLength                 7
>         bDescriptorType         5
>         bEndpointAddress     0x81  EP 1 IN
>         bmAttributes            2
>           Transfer Type            Bulk
>           Synch Type               None
>           Usage Type               Data
>         wMaxPacketSize     0x0040  1x 64 bytes
>         bInterval               0
>       Endpoint Descriptor:
>         bLength                 7
>         bDescriptorType         5
>         bEndpointAddress     0x02  EP 2 OUT
>         bmAttributes            2
>           Transfer Type            Bulk
>           Synch Type               None
>           Usage Type               Data
>         wMaxPacketSize     0x0040  1x 64 bytes
>         bInterval               0
>   Configuration Descriptor:
>     bLength                 9
>     bDescriptorType         2
>     wTotalLength           32
>     bNumInterfaces          1
>     bConfigurationValue     1
>     iConfiguration          0
>     bmAttributes         0xc0
>       Self Powered
>     MaxPower                2mA
>     Interface Descriptor:
>       bLength                 9
>       bDescriptorType         4
>       bInterfaceNumber        0
>       bAlternateSetting       0
>       bNumEndpoints           2
>       bInterfaceClass         2 Communications
>       bInterfaceSubClass     12 Ethernet Emulation
>       bInterfaceProtocol      7 Ethernet Emulation (EEM)
>       iInterface              8 CDC Ethernet Emulation Model (EEM)
>       Endpoint Descriptor:
>         bLength                 7
>         bDescriptorType         5
>         bEndpointAddress     0x81  EP 1 IN
>         bmAttributes            2
>           Transfer Type            Bulk
>           Synch Type               None
>           Usage Type               Data
>         wMaxPacketSize     0x0040  1x 64 bytes
>         bInterval               0
>       Endpoint Descriptor:
>         bLength                 7
>         bDescriptorType         5
>         bEndpointAddress     0x02  EP 2 OUT
>         bmAttributes            2
>           Transfer Type            Bulk
>           Synch Type               None
>           Usage Type               Data
>         wMaxPacketSize     0x0040  1x 64 bytes
>         bInterval               0
> Device Qualifier (for other device speed):
>   bLength                10
>   bDescriptorType         6
>   bcdUSB               2.00
>   bDeviceClass            2 Communications
>   bDeviceSubClass         0
>   bDeviceProtocol         0
>   bMaxPacketSize0        64
>   bNumConfigurations      2
> Device Status:     0x0001
>   Self Powered
> 
> 
> As I wrote in my initial mail:
> I see no difference in both, which may offer a possibilty to act upon
> when plugging in the one or the other (or both) devices/Ariettas.
> 
> Before I mailed to the group I read the documentation you linked, but
> may be I missed something which reveals the solution to this
> problem...
> But what did I miss?

Not sure you missed anything, but did you try to set up your own udev rules to 
invoke your script?  I'm not particularly knowledgeable on writing udev rules, 
but something like this could work if you experiment with it:


KERNEL=="usb[0-9]*", ATTR{idVendor}=="0525", ATTR{idProduct}=="a4a2", 
NAME="Arietta/%n", SUBSYSTEM=="net", ACTION=="add", RUN+="my_script %k start"

KERNEL=="usb[0-9]*", ATTR{idVendor}=="0525", ATTR{idProduct}=="a4a2", 
NAME="Arietta/%n", SUBSYSTEM=="net", ACTION=="remove", RUN+="my_script %k 
stop"

-- 
Regards,
Mick

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 473 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2015-05-15 22:25 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-05-14  3:45 [gentoo-user] Net problems Meino.Cramer
2015-05-14  5:53 ` Mick
2015-05-14  6:34   ` Meino.Cramer
2015-05-15 22:25     ` Mick

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox