udev rules messed up?

Aleksander Morgado aleksander at aleksander.es
Sun Jan 26 10:20:06 PST 2014


Hey,

I was just testing with all my devices targeting a 1.2 release, when I
found out that the NDISDUP flags for Huawei devices were not being set
properly. The tag setting logic just goes like this:

SUBSYSTEMS=="usb", ATTRS{bInterfaceClass}=="02",
ATTRS{bInterfaceSubClass}=="06",ATTRS{bInterfaceProtocol}=="00",
ENV{ID_MM_HUAWEI_NDISDUP}="1"

After digging a bit in the issue, I found (using ./test/lsudev net) that
upon receiving the udev "add" event it correctly shows the tag we're
looking for in the net device, but just after that we get a "move"
event, where the tag is gone. See both events here, look for "ID_MM".

Any idea anyone? Why is that second 'move' event happening?


---- (EVENT: add) ----
------------------------------------------------------
Name:     enp0s29u1u7
Type:     (null)
Subsys:   net
Number:   7
Path:
/sys/devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.7/2-1.7:1.0/net/enp0s29u1u7
Driver:   (null)
Action:   add
Seq Num:  2211
Dev File: (null)

Properties:
  ACTION:                         add
  DEVPATH:
/devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.7/2-1.7:1.0/net/enp0s29u1u7
  ID_BUS:                         usb
  ID_MM_CANDIDATE:                1
  ID_MM_HUAWEI_NDISDUP_SUPPORTED: 1
  ID_MODEL:                       HUAWEI_Mobile_Broadband_Module
  ID_MODEL_ENC:                   HUAWEI\x20Mobile\x20Broadband\x20Module
  ID_MODEL_ID:                    1570
  ID_NET_NAME_MAC:                enx022c80139263
  ID_NET_NAME_PATH:               enp0s29u1u7
  ID_REVISION:                    0001
  ID_SERIAL:
Huawei_Technologies_Co.__Ltd._HUAWEI_Mobile_Broadband_Module
  ID_TYPE:                        generic
  ID_USB_CLASS_FROM_DATABASE:     Miscellaneous Device
  ID_USB_DRIVER:                  cdc_ether
  ID_USB_INTERFACES:
:020600:0a0000:ff0201:ff0202:ff0203:020e00:0a0002:ff0205:
  ID_USB_INTERFACE_NUM:           00
  ID_USB_PROTOCOL_FROM_DATABASE:  Interface Association
  ID_VENDOR:                      Huawei_Technologies_Co.__Ltd.
  ID_VENDOR_ENC:                  Huawei\x20Technologies\x20Co.\x2c\x20Ltd.
  ID_VENDOR_FROM_DATABASE:        Huawei Technologies Co., Ltd.
  ID_VENDOR_ID:                   12d1
  IFINDEX:                        11
  INTERFACE:                      enp0s29u1u7
  INTERFACE_OLD:                  usb0
  SEQNUM:                         2211
  SUBSYSTEM:                      net
  SYSTEMD_ALIAS:                  /sys/subsystem/net/devices/enp0s29u1u7
  TAGS:                           :systemd:
  USEC_INITIALIZED:               452336

    ------------------------------------------------------
    Name:     2-1.7:1.0
    Type:     usb_interface
    Subsys:   usb
    Number:   0
    Path:     /sys/devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.7/2-1.7:1.0
    Driver:   cdc_ether
    Action:   (null)
    Seq Num:  0
    Dev File: (null)

    Properties:
      DEVPATH:
/devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.7/2-1.7:1.0
      DEVTYPE:                       usb_interface
      DRIVER:                        cdc_ether
      ID_USB_CLASS_FROM_DATABASE:    Miscellaneous Device
      ID_USB_PROTOCOL_FROM_DATABASE: Interface Association
      ID_VENDOR_FROM_DATABASE:       Huawei Technologies Co., Ltd.
      INTERFACE:                     2/6/0
      MODALIAS:
usb:v12D1p1570d0001dcEFdsc02dp01ic02isc06ip00in00
      PRODUCT:                       12d1/1570/1
      SUBSYSTEM:                     usb
      TYPE:                          239/2/1
      USEC_INITIALIZED:              47451330

        ------------------------------------------------------
        Name:     2-1.7
        Type:     usb_device
        Subsys:   usb
        Number:   7
        Path:     /sys/devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.7
        Driver:   usb
        Action:   (null)
        Seq Num:  0
        Dev File: /dev/bus/usb/002/012

        Properties:
          BUSNUM:                  002
          DEVNAME:                 /dev/bus/usb/002/012
          DEVNUM:                  012
          DEVPATH:
/devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.7
          DEVTYPE:                 usb_device
          DRIVER:                  usb
          ID_BUS:                  usb
          ID_MODEL:                HUAWEI_Mobile_Broadband_Module
          ID_MODEL_ENC:            HUAWEI\x20Mobile\x20Broadband\x20Module
          ID_MODEL_ID:             1570
          ID_REVISION:             0001
          ID_SERIAL:
Huawei_Technologies_Co.__Ltd._HUAWEI_Mobile_Broadband_Module
          ID_USB_INTERFACES:
:020600:0a0000:ff0201:ff0202:ff0203:020e00:0a0002:ff0205:
          ID_VENDOR:               Huawei_Technologies_Co.__Ltd.
          ID_VENDOR_ENC:           Huawei\x20Technologies\x20Co.\x2c\x20Ltd.
          ID_VENDOR_FROM_DATABASE: Huawei Technologies Co., Ltd.
          ID_VENDOR_ID:            12d1
          MAJOR:                   189
          MINOR:                   139
          PRODUCT:                 12d1/1570/1
          SUBSYSTEM:               usb
          TYPE:                    239/2/1
          USEC_INITIALIZED:        1747449717

            ------------------------------------------------------
            Name:     2-1
            Type:     usb_device
            Subsys:   usb
            Number:   1
            Path:     /sys/devices/pci0000:00/0000:00:1d.0/usb2/2-1
            Driver:   usb
            Action:   (null)
            Seq Num:  0
            Dev File: /dev/bus/usb/002/002

            Properties:
              BUSNUM:                  002
              DEVNAME:                 /dev/bus/usb/002/002
              DEVNUM:                  002
              DEVPATH:
/devices/pci0000:00/0000:00:1d.0/usb2/2-1
              DEVTYPE:                 usb_device
              DRIVER:                  usb
              ID_BUS:                  usb
              ID_FOR_SEAT:             usb-pci-0000_00_1d_0-usb-0_1
              ID_MODEL:                0020
              ID_MODEL_ENC:            0020
              ID_MODEL_FROM_DATABASE:  Integrated Rate Matching Hub
              ID_MODEL_ID:             0020
              ID_PATH:                 pci-0000:00:1d.0-usb-0:1
              ID_PATH_TAG:             pci-0000_00_1d_0-usb-0_1
              ID_REVISION:             0000
              ID_SERIAL:               8087_0020
              ID_USB_INTERFACES:       :090000:
              ID_VENDOR:               8087
              ID_VENDOR_ENC:           8087
              ID_VENDOR_FROM_DATABASE: Intel Corp.
              ID_VENDOR_ID:            8087
              MAJOR:                   189
              MINOR:                   129
              PRODUCT:                 8087/20/0
              SUBSYSTEM:               usb
              TAGS:                    :seat:
              TYPE:                    9/0/1
              USEC_INITIALIZED:        448073

                ------------------------------------------------------
                Name:     usb2
                Type:     usb_device
                Subsys:   usb
                Number:   2
                Path:     /sys/devices/pci0000:00/0000:00:1d.0/usb2
                Driver:   usb
                Action:   (null)
                Seq Num:  0
                Dev File: /dev/bus/usb/002/001

                Properties:
                  BUSNUM:                  002
                  DEVNAME:                 /dev/bus/usb/002/001
                  DEVNUM:                  001
                  DEVPATH:
/devices/pci0000:00/0000:00:1d.0/usb2
                  DEVTYPE:                 usb_device
                  DRIVER:                  usb
                  ID_BUS:                  usb
                  ID_FOR_SEAT:             usb-pci-0000_00_1d_0
                  ID_MODEL:                EHCI_Host_Controller
                  ID_MODEL_ENC:            EHCI\x20Host\x20Controller
                  ID_MODEL_FROM_DATABASE:  2.0 root hub
                  ID_MODEL_ID:             0002
                  ID_PATH:                 pci-0000:00:1d.0
                  ID_PATH_TAG:             pci-0000_00_1d_0
                  ID_REVISION:             0312
                  ID_SERIAL:
Linux_3.12.8-1-ARCH_ehci_hcd_EHCI_Host_Controller_0000:00:1d.0
                  ID_SERIAL_SHORT:         0000:00:1d.0
                  ID_USB_INTERFACES:       :090000:
                  ID_VENDOR:               Linux_3.12.8-1-ARCH_ehci_hcd
                  ID_VENDOR_ENC:
Linux\x203.12.8-1-ARCH\x20ehci_hcd
                  ID_VENDOR_FROM_DATABASE: Linux Foundation
                  ID_VENDOR_ID:            1d6b
                  MAJOR:                   189
                  MINOR:                   128
                  PRODUCT:                 1d6b/2/312
                  SUBSYSTEM:               usb
                  TAGS:                    :seat:
                  TYPE:                    9/0/0
                  USEC_INITIALIZED:        448026

                    ------------------------------------------------------
                    Name:     0000:00:1d.0
                    Type:     (null)
                    Subsys:   pci
                    Number:   0
                    Path:     /sys/devices/pci0000:00/0000:00:1d.0
                    Driver:   ehci-pci
                    Action:   (null)
                    Seq Num:  0
                    Dev File: (null)

                    Properties:
                      DEVPATH:
/devices/pci0000:00/0000:00:1d.0
                      DRIVER:                         ehci-pci
                      ID_MODEL_FROM_DATABASE:         5 Series/3400
Series Chipset USB2 Enhanced Host Controller
                      ID_PCI_CLASS_FROM_DATABASE:     Serial bus controller
                      ID_PCI_INTERFACE_FROM_DATABASE: EHCI
                      ID_PCI_SUBCLASS_FROM_DATABASE:  USB controller
                      ID_VENDOR_FROM_DATABASE:        Intel Corporation
                      MODALIAS:
pci:v00008086d00003B34sv0000103Csd00002A90bc0Csc03i20
                      PCI_CLASS:                      C0320
                      PCI_ID:                         8086:3B34
                      PCI_SLOT_NAME:                  0000:00:1d.0
                      PCI_SUBSYS_ID:                  103C:2A90
                      SUBSYSTEM:                      pci
                      USEC_INITIALIZED:               447969


------------------------------------------------------
                        Name:     pci0000:00
                        Type:     (null)
                        Subsys:   (null)
                        Number:   00
                        Path:     /sys/devices/pci0000:00
                        Driver:   (null)
                        Action:   (null)
                        Seq Num:  0
                        Dev File: (null)

                        Properties:
                          DEVPATH: /devices/pci0000:00


---- (EVENT: move) ----
------------------------------------------------------
Name:     enp0s29u1u7
Type:     (null)
Subsys:   net
Number:   7
Path:
/sys/devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.7/2-1.7:1.0/net/enp0s29u1u7
Driver:   (null)
Action:   move
Seq Num:  2224
Dev File: (null)

Properties:
  ACTION:                        move
  DEVPATH:
/devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.7/2-1.7:1.0/net/enp0s29u1u7
  DEVPATH_OLD:
/devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.7/2-1.7:1.0/net/usb0
  ID_BUS:                        usb
  ID_MM_CANDIDATE:               1
  ID_MODEL:                      HUAWEI_Mobile_Broadband_Module
  ID_MODEL_ENC:                  HUAWEI\x20Mobile\x20Broadband\x20Module
  ID_MODEL_ID:                   1570
  ID_NET_NAME_MAC:               enx022c80139263
  ID_NET_NAME_PATH:              enp0s29u1u7
  ID_REVISION:                   0001
  ID_SERIAL:
Huawei_Technologies_Co.__Ltd._HUAWEI_Mobile_Broadband_Module
  ID_TYPE:                       generic
  ID_USB_CLASS_FROM_DATABASE:    Miscellaneous Device
  ID_USB_DRIVER:                 cdc_ether
  ID_USB_INTERFACES:
:020600:0a0000:ff0201:ff0202:ff0203:020e00:0a0002:ff0205:
  ID_USB_INTERFACE_NUM:          00
  ID_USB_PROTOCOL_FROM_DATABASE: Interface Association
  ID_VENDOR:                     Huawei_Technologies_Co.__Ltd.
  ID_VENDOR_ENC:                 Huawei\x20Technologies\x20Co.\x2c\x20Ltd.
  ID_VENDOR_FROM_DATABASE:       Huawei Technologies Co., Ltd.
  ID_VENDOR_ID:                  12d1
  IFINDEX:                       11
  INTERFACE:                     enp0s29u1u7
  SEQNUM:                        2224
  SUBSYSTEM:                     net
  SYSTEMD_ALIAS:                 /sys/subsystem/net/devices/enp0s29u1u7
  TAGS:                          :systemd:
  USEC_INITIALIZED:              452336

    ------------------------------------------------------
    Name:     2-1.7:1.0
    Type:     usb_interface
    Subsys:   usb
    Number:   0
    Path:     /sys/devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.7/2-1.7:1.0
    Driver:   cdc_ether
    Action:   (null)
    Seq Num:  0
    Dev File: (null)

    Properties:
      DEVPATH:
/devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.7/2-1.7:1.0
      DEVTYPE:                       usb_interface
      DRIVER:                        cdc_ether
      ID_USB_CLASS_FROM_DATABASE:    Miscellaneous Device
      ID_USB_PROTOCOL_FROM_DATABASE: Interface Association
      ID_VENDOR_FROM_DATABASE:       Huawei Technologies Co., Ltd.
      INTERFACE:                     2/6/0
      MODALIAS:
usb:v12D1p1570d0001dcEFdsc02dp01ic02isc06ip00in00
      PRODUCT:                       12d1/1570/1
      SUBSYSTEM:                     usb
      TYPE:                          239/2/1
      USEC_INITIALIZED:              47451330

        ------------------------------------------------------
        Name:     2-1.7
        Type:     usb_device
        Subsys:   usb
        Number:   7
        Path:     /sys/devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.7
        Driver:   usb
        Action:   (null)
        Seq Num:  0
        Dev File: /dev/bus/usb/002/012

        Properties:
          BUSNUM:                  002
          DEVNAME:                 /dev/bus/usb/002/012
          DEVNUM:                  012
          DEVPATH:
/devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.7
          DEVTYPE:                 usb_device
          DRIVER:                  usb
          ID_BUS:                  usb
          ID_MODEL:                HUAWEI_Mobile_Broadband_Module
          ID_MODEL_ENC:            HUAWEI\x20Mobile\x20Broadband\x20Module
          ID_MODEL_ID:             1570
          ID_REVISION:             0001
          ID_SERIAL:
Huawei_Technologies_Co.__Ltd._HUAWEI_Mobile_Broadband_Module
          ID_USB_INTERFACES:
:020600:0a0000:ff0201:ff0202:ff0203:020e00:0a0002:ff0205:
          ID_VENDOR:               Huawei_Technologies_Co.__Ltd.
          ID_VENDOR_ENC:           Huawei\x20Technologies\x20Co.\x2c\x20Ltd.
          ID_VENDOR_FROM_DATABASE: Huawei Technologies Co., Ltd.
          ID_VENDOR_ID:            12d1
          MAJOR:                   189
          MINOR:                   139
          PRODUCT:                 12d1/1570/1
          SUBSYSTEM:               usb
          TYPE:                    239/2/1
          USEC_INITIALIZED:        1747449717

            ------------------------------------------------------
            Name:     2-1
            Type:     usb_device
            Subsys:   usb
            Number:   1
            Path:     /sys/devices/pci0000:00/0000:00:1d.0/usb2/2-1
            Driver:   usb
            Action:   (null)
            Seq Num:  0
            Dev File: /dev/bus/usb/002/002

            Properties:
              BUSNUM:                  002
              DEVNAME:                 /dev/bus/usb/002/002
              DEVNUM:                  002
              DEVPATH:
/devices/pci0000:00/0000:00:1d.0/usb2/2-1
              DEVTYPE:                 usb_device
              DRIVER:                  usb
              ID_BUS:                  usb
              ID_FOR_SEAT:             usb-pci-0000_00_1d_0-usb-0_1
              ID_MODEL:                0020
              ID_MODEL_ENC:            0020
              ID_MODEL_FROM_DATABASE:  Integrated Rate Matching Hub
              ID_MODEL_ID:             0020
              ID_PATH:                 pci-0000:00:1d.0-usb-0:1
              ID_PATH_TAG:             pci-0000_00_1d_0-usb-0_1
              ID_REVISION:             0000
              ID_SERIAL:               8087_0020
              ID_USB_INTERFACES:       :090000:
              ID_VENDOR:               8087
              ID_VENDOR_ENC:           8087
              ID_VENDOR_FROM_DATABASE: Intel Corp.
              ID_VENDOR_ID:            8087
              MAJOR:                   189
              MINOR:                   129
              PRODUCT:                 8087/20/0
              SUBSYSTEM:               usb
              TAGS:                    :seat:
              TYPE:                    9/0/1
              USEC_INITIALIZED:        448073

                ------------------------------------------------------
                Name:     usb2
                Type:     usb_device
                Subsys:   usb
                Number:   2
                Path:     /sys/devices/pci0000:00/0000:00:1d.0/usb2
                Driver:   usb
                Action:   (null)
                Seq Num:  0
                Dev File: /dev/bus/usb/002/001

                Properties:
                  BUSNUM:                  002
                  DEVNAME:                 /dev/bus/usb/002/001
                  DEVNUM:                  001
                  DEVPATH:
/devices/pci0000:00/0000:00:1d.0/usb2
                  DEVTYPE:                 usb_device
                  DRIVER:                  usb
                  ID_BUS:                  usb
                  ID_FOR_SEAT:             usb-pci-0000_00_1d_0
                  ID_MODEL:                EHCI_Host_Controller
                  ID_MODEL_ENC:            EHCI\x20Host\x20Controller
                  ID_MODEL_FROM_DATABASE:  2.0 root hub
                  ID_MODEL_ID:             0002
                  ID_PATH:                 pci-0000:00:1d.0
                  ID_PATH_TAG:             pci-0000_00_1d_0
                  ID_REVISION:             0312
                  ID_SERIAL:
Linux_3.12.8-1-ARCH_ehci_hcd_EHCI_Host_Controller_0000:00:1d.0
                  ID_SERIAL_SHORT:         0000:00:1d.0
                  ID_USB_INTERFACES:       :090000:
                  ID_VENDOR:               Linux_3.12.8-1-ARCH_ehci_hcd
                  ID_VENDOR_ENC:
Linux\x203.12.8-1-ARCH\x20ehci_hcd
                  ID_VENDOR_FROM_DATABASE: Linux Foundation
                  ID_VENDOR_ID:            1d6b
                  MAJOR:                   189
                  MINOR:                   128
                  PRODUCT:                 1d6b/2/312
                  SUBSYSTEM:               usb
                  TAGS:                    :seat:
                  TYPE:                    9/0/0
                  USEC_INITIALIZED:        448026

                    ------------------------------------------------------
                    Name:     0000:00:1d.0
                    Type:     (null)
                    Subsys:   pci
                    Number:   0
                    Path:     /sys/devices/pci0000:00/0000:00:1d.0
                    Driver:   ehci-pci
                    Action:   (null)
                    Seq Num:  0
                    Dev File: (null)

                    Properties:
                      DEVPATH:
/devices/pci0000:00/0000:00:1d.0
                      DRIVER:                         ehci-pci
                      ID_MODEL_FROM_DATABASE:         5 Series/3400
Series Chipset USB2 Enhanced Host Controller
                      ID_PCI_CLASS_FROM_DATABASE:     Serial bus controller
                      ID_PCI_INTERFACE_FROM_DATABASE: EHCI
                      ID_PCI_SUBCLASS_FROM_DATABASE:  USB controller
                      ID_VENDOR_FROM_DATABASE:        Intel Corporation
                      MODALIAS:
pci:v00008086d00003B34sv0000103Csd00002A90bc0Csc03i20
                      PCI_CLASS:                      C0320
                      PCI_ID:                         8086:3B34
                      PCI_SLOT_NAME:                  0000:00:1d.0
                      PCI_SUBSYS_ID:                  103C:2A90
                      SUBSYSTEM:                      pci
                      USEC_INITIALIZED:               447969


------------------------------------------------------
                        Name:     pci0000:00
                        Type:     (null)
                        Subsys:   (null)
                        Number:   00
                        Path:     /sys/devices/pci0000:00
                        Driver:   (null)
                        Action:   (null)
                        Seq Num:  0
                        Dev File: (null)

                        Properties:
                          DEVPATH: /devices/pci0000:00



-- 
Aleksander


More information about the ModemManager-devel mailing list