# do not edit this file, it will be overwritten on update
ACTION!="add|change|move|bind", GOTO="mm_netprisma_end"
SUBSYSTEMS=="usb", ATTRS{idVendor}=="3731", GOTO="mm_netprisma_usb"
SUBSYSTEMS=="pci", ATTRS{vendor}=="0x203e", GOTO="mm_netprisma_pci"
GOTO="mm_netprisma_end"

LABEL="mm_netprisma_usb"

SUBSYSTEMS=="usb", ATTRS{bInterfaceNumber}=="?*", ENV{.MM_USBIFNUM}="$attr{bInterfaceNumber}"

# Netprisma LCUK54-WWD (MBIM)
#  ttyUSB0 (if #3): QCDM/DIAG port
#  ttyUSB1 (if #4): GPS data port
#  ttyUSB2 (if #5): AT port
ATTRS{idVendor}=="3731", ATTRS{idProduct}=="0100", ENV{.MM_USBIFNUM}=="03", SUBSYSTEM=="tty", ENV{ID_MM_PORT_TYPE_QCDM}="1"
ATTRS{idVendor}=="3731", ATTRS{idProduct}=="0100", ENV{.MM_USBIFNUM}=="04", SUBSYSTEM=="tty", ENV{ID_MM_PORT_TYPE_GPS}="1"
ATTRS{idVendor}=="3731", ATTRS{idProduct}=="0100", ENV{.MM_USBIFNUM}=="05", SUBSYSTEM=="tty", ENV{ID_MM_PORT_TYPE_AT_PRIMARY}="1"
ATTRS{idVendor}=="3731", ATTRS{idProduct}=="010b", ENV{.MM_USBIFNUM}=="03", SUBSYSTEM=="tty", ENV{ID_MM_PORT_TYPE_QCDM}="1"
ATTRS{idVendor}=="3731", ATTRS{idProduct}=="010b", ENV{.MM_USBIFNUM}=="04", SUBSYSTEM=="tty", ENV{ID_MM_PORT_TYPE_GPS}="1"
ATTRS{idVendor}=="3731", ATTRS{idProduct}=="010b", ENV{.MM_USBIFNUM}=="05", SUBSYSTEM=="tty", ENV{ID_MM_PORT_TYPE_AT_PRIMARY}="1"
ATTRS{idVendor}=="3731", ATTRS{idProduct}=="010d", ENV{.MM_USBIFNUM}=="03", SUBSYSTEM=="tty", ENV{ID_MM_PORT_TYPE_QCDM}="1"
ATTRS{idVendor}=="3731", ATTRS{idProduct}=="010d", ENV{.MM_USBIFNUM}=="04", SUBSYSTEM=="tty", ENV{ID_MM_PORT_TYPE_GPS}="1"
ATTRS{idVendor}=="3731", ATTRS{idProduct}=="010d", ENV{.MM_USBIFNUM}=="05", SUBSYSTEM=="tty", ENV{ID_MM_PORT_TYPE_AT_PRIMARY}="1"
ATTRS{idVendor}=="3731", ATTRS{idProduct}=="0111", ENV{.MM_USBIFNUM}=="03", SUBSYSTEM=="tty", ENV{ID_MM_PORT_TYPE_QCDM}="1"
ATTRS{idVendor}=="3731", ATTRS{idProduct}=="0111", ENV{.MM_USBIFNUM}=="04", SUBSYSTEM=="tty", ENV{ID_MM_PORT_TYPE_GPS}="1"
ATTRS{idVendor}=="3731", ATTRS{idProduct}=="0111", ENV{.MM_USBIFNUM}=="05", SUBSYSTEM=="tty", ENV{ID_MM_PORT_TYPE_AT_PRIMARY}="1"
ATTRS{idVendor}=="3731", ATTRS{idProduct}=="0112", ENV{.MM_USBIFNUM}=="03", SUBSYSTEM=="tty", ENV{ID_MM_PORT_TYPE_QCDM}="1"
ATTRS{idVendor}=="3731", ATTRS{idProduct}=="0112", ENV{.MM_USBIFNUM}=="04", SUBSYSTEM=="tty", ENV{ID_MM_PORT_TYPE_GPS}="1"
ATTRS{idVendor}=="3731", ATTRS{idProduct}=="0112", ENV{.MM_USBIFNUM}=="05", SUBSYSTEM=="tty", ENV{ID_MM_PORT_TYPE_AT_PRIMARY}="1"
ATTRS{idVendor}=="3731", ATTRS{idProduct}=="0113", ENV{.MM_USBIFNUM}=="03", SUBSYSTEM=="tty", ENV{ID_MM_PORT_TYPE_QCDM}="1"
ATTRS{idVendor}=="3731", ATTRS{idProduct}=="0113", ENV{.MM_USBIFNUM}=="04", SUBSYSTEM=="tty", ENV{ID_MM_PORT_TYPE_GPS}="1"
ATTRS{idVendor}=="3731", ATTRS{idProduct}=="0113", ENV{.MM_USBIFNUM}=="05", SUBSYSTEM=="tty", ENV{ID_MM_PORT_TYPE_AT_PRIMARY}="1"
ATTRS{idVendor}=="3731", ATTRS{idProduct}=="0115", ENV{.MM_USBIFNUM}=="03", SUBSYSTEM=="tty", ENV{ID_MM_PORT_TYPE_QCDM}="1"
ATTRS{idVendor}=="3731", ATTRS{idProduct}=="0115", ENV{.MM_USBIFNUM}=="04", SUBSYSTEM=="tty", ENV{ID_MM_PORT_TYPE_GPS}="1"
ATTRS{idVendor}=="3731", ATTRS{idProduct}=="0115", ENV{.MM_USBIFNUM}=="05", SUBSYSTEM=="tty", ENV{ID_MM_PORT_TYPE_AT_PRIMARY}="1"
ATTRS{idVendor}=="3731", ATTRS{idProduct}=="0116", ENV{.MM_USBIFNUM}=="03", SUBSYSTEM=="tty", ENV{ID_MM_PORT_TYPE_QCDM}="1"
ATTRS{idVendor}=="3731", ATTRS{idProduct}=="0116", ENV{.MM_USBIFNUM}=="04", SUBSYSTEM=="tty", ENV{ID_MM_PORT_TYPE_GPS}="1"
ATTRS{idVendor}=="3731", ATTRS{idProduct}=="0116", ENV{.MM_USBIFNUM}=="05", SUBSYSTEM=="tty", ENV{ID_MM_PORT_TYPE_AT_PRIMARY}="1"

# Netprisma LCUK54-WRD (MBIM)
#  ttyUSB0 (if #3): QCDM/DIAG port
#  ttyUSB1 (if #4): GPS data port
#  ttyUSB2 (if #5): AT port
ATTRS{idVendor}=="3731", ATTRS{idProduct}=="0101", ENV{.MM_USBIFNUM}=="03", SUBSYSTEM=="tty", ENV{ID_MM_PORT_TYPE_QCDM}="1"
ATTRS{idVendor}=="3731", ATTRS{idProduct}=="0101", ENV{.MM_USBIFNUM}=="04", SUBSYSTEM=="tty", ENV{ID_MM_PORT_TYPE_GPS}="1"
ATTRS{idVendor}=="3731", ATTRS{idProduct}=="0101", ENV{.MM_USBIFNUM}=="05", SUBSYSTEM=="tty", ENV{ID_MM_PORT_TYPE_AT_PRIMARY}="1"
ATTRS{idVendor}=="3731", ATTRS{idProduct}=="0106", ENV{.MM_USBIFNUM}=="03", SUBSYSTEM=="tty", ENV{ID_MM_PORT_TYPE_QCDM}="1"
ATTRS{idVendor}=="3731", ATTRS{idProduct}=="0106", ENV{.MM_USBIFNUM}=="04", SUBSYSTEM=="tty", ENV{ID_MM_PORT_TYPE_GPS}="1"
ATTRS{idVendor}=="3731", ATTRS{idProduct}=="0106", ENV{.MM_USBIFNUM}=="05", SUBSYSTEM=="tty", ENV{ID_MM_PORT_TYPE_AT_PRIMARY}="1"
ATTRS{idVendor}=="3731", ATTRS{idProduct}=="010a", ENV{.MM_USBIFNUM}=="03", SUBSYSTEM=="tty", ENV{ID_MM_PORT_TYPE_QCDM}="1"
ATTRS{idVendor}=="3731", ATTRS{idProduct}=="010a", ENV{.MM_USBIFNUM}=="04", SUBSYSTEM=="tty", ENV{ID_MM_PORT_TYPE_GPS}="1"
ATTRS{idVendor}=="3731", ATTRS{idProduct}=="010a", ENV{.MM_USBIFNUM}=="05", SUBSYSTEM=="tty", ENV{ID_MM_PORT_TYPE_AT_PRIMARY}="1"
ATTRS{idVendor}=="3731", ATTRS{idProduct}=="010c", ENV{.MM_USBIFNUM}=="03", SUBSYSTEM=="tty", ENV{ID_MM_PORT_TYPE_QCDM}="1"
ATTRS{idVendor}=="3731", ATTRS{idProduct}=="010c", ENV{.MM_USBIFNUM}=="04", SUBSYSTEM=="tty", ENV{ID_MM_PORT_TYPE_GPS}="1"
ATTRS{idVendor}=="3731", ATTRS{idProduct}=="010c", ENV{.MM_USBIFNUM}=="05", SUBSYSTEM=="tty", ENV{ID_MM_PORT_TYPE_AT_PRIMARY}="1"

# Netprisma LCUK54-WWD variants with Sahara-Firehose support:
ATTRS{idVendor}=="3731", ATTRS{idProduct}=="0100", ENV{ID_MM_QUALCOMM_FIREHOSE}="1"
ATTRS{idVendor}=="3731", ATTRS{idProduct}=="0100", ENV{ID_MM_QUALCOMM_SAHARA}="1"
ATTRS{idVendor}=="3731", ATTRS{idProduct}=="010b", ENV{ID_MM_QUALCOMM_FIREHOSE}="1"
ATTRS{idVendor}=="3731", ATTRS{idProduct}=="010b", ENV{ID_MM_QUALCOMM_SAHARA}="1"
ATTRS{idVendor}=="3731", ATTRS{idProduct}=="010d", ENV{ID_MM_QUALCOMM_FIREHOSE}="1"
ATTRS{idVendor}=="3731", ATTRS{idProduct}=="010d", ENV{ID_MM_QUALCOMM_SAHARA}="1"
ATTRS{idVendor}=="3731", ATTRS{idProduct}=="0111", ENV{ID_MM_QUALCOMM_FIREHOSE}="1"
ATTRS{idVendor}=="3731", ATTRS{idProduct}=="0111", ENV{ID_MM_QUALCOMM_SAHARA}="1"
ATTRS{idVendor}=="3731", ATTRS{idProduct}=="0112", ENV{ID_MM_QUALCOMM_FIREHOSE}="1"
ATTRS{idVendor}=="3731", ATTRS{idProduct}=="0112", ENV{ID_MM_QUALCOMM_SAHARA}="1"
ATTRS{idVendor}=="3731", ATTRS{idProduct}=="0113", ENV{ID_MM_QUALCOMM_FIREHOSE}="1"
ATTRS{idVendor}=="3731", ATTRS{idProduct}=="0113", ENV{ID_MM_QUALCOMM_SAHARA}="1"
ATTRS{idVendor}=="3731", ATTRS{idProduct}=="0115", ENV{ID_MM_QUALCOMM_FIREHOSE}="1"
ATTRS{idVendor}=="3731", ATTRS{idProduct}=="0115", ENV{ID_MM_QUALCOMM_SAHARA}="1"
ATTRS{idVendor}=="3731", ATTRS{idProduct}=="0116", ENV{ID_MM_QUALCOMM_FIREHOSE}="1"
ATTRS{idVendor}=="3731", ATTRS{idProduct}=="0116", ENV{ID_MM_QUALCOMM_SAHARA}="1"

# Netprisma LCUK54-WWD variants with Sahara-Firehose support:
ATTRS{idVendor}=="3731", ATTRS{idProduct}=="0101", ENV{ID_MM_QUALCOMM_FIREHOSE}="1"
ATTRS{idVendor}=="3731", ATTRS{idProduct}=="0101", ENV{ID_MM_QUALCOMM_SAHARA}="1"
ATTRS{idVendor}=="3731", ATTRS{idProduct}=="0106", ENV{ID_MM_QUALCOMM_FIREHOSE}="1"
ATTRS{idVendor}=="3731", ATTRS{idProduct}=="0106", ENV{ID_MM_QUALCOMM_SAHARA}="1"
ATTRS{idVendor}=="3731", ATTRS{idProduct}=="010a", ENV{ID_MM_QUALCOMM_FIREHOSE}="1"
ATTRS{idVendor}=="3731", ATTRS{idProduct}=="010a", ENV{ID_MM_QUALCOMM_SAHARA}="1"
ATTRS{idVendor}=="3731", ATTRS{idProduct}=="010c", ENV{ID_MM_QUALCOMM_FIREHOSE}="1"
ATTRS{idVendor}=="3731", ATTRS{idProduct}=="010c", ENV{ID_MM_QUALCOMM_SAHARA}="1"

GOTO="mm_netprisma_end"

LABEL="mm_netprisma_pci"

# Netprisma LCUR57-WWD with firehose support
ATTRS{vendor}=="0x203e", ATTRS{device}=="0x1000", ENV{ID_MM_QUALCOMM_FIREHOSE}="1"

# Netprisma CFUN69-WWD with firehose support
ATTRS{vendor}=="0x203e", ATTRS{device}=="0x1001", ENV{ID_MM_QUALCOMM_FIREHOSE}="1"

LABEL="mm_netprisma_end"
