# do not edit this file, it will be overwritten on update
ACTION!="add|change|move|bind", GOTO="mm_rolling_port_types_end"
SUBSYSTEMS=="usb", ATTRS{idVendor}=="33f8", GOTO="mm_rolling_port_types"
GOTO="mm_rolling_port_types_end"

LABEL="mm_rolling_port_types"

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

# Rolling RW101-GL (QMI in iface #4, ADB in iface #5)
#  ttyUSB0 (if #0): QCDM port
#  ttyUSB1 (if #1): AT port
#  ttyUSB2 (if #2): AT port
#  ttyUSB3 (if #3): GNSS data
ATTRS{idVendor}=="33f8", ATTRS{idProduct}=="0104", ENV{.MM_USBIFNUM}=="00", SUBSYSTEM=="tty", ENV{ID_MM_PORT_TYPE_QCDM}="1"
ATTRS{idVendor}=="33f8", ATTRS{idProduct}=="0104", ENV{.MM_USBIFNUM}=="01", SUBSYSTEM=="tty", ENV{ID_MM_PORT_TYPE_AT_PRIMARY}="1"
ATTRS{idVendor}=="33f8", ATTRS{idProduct}=="0104", ENV{.MM_USBIFNUM}=="02", SUBSYSTEM=="tty", ENV{ID_MM_PORT_TYPE_AT_SECONDARY}="1"
ATTRS{idVendor}=="33f8", ATTRS{idProduct}=="0104", ENV{.MM_USBIFNUM}=="03", SUBSYSTEM=="tty", ENV{ID_MM_PORT_TYPE_GPS}="1"
# No ID_MM_FIBOCOM_FASTBOOT because there is no custom QMI modem implementation using it.

# Rolling RW101-GL (MBIM in iface #0, 2 AT ports)
#  ttyUSB0 (if #2): AT port
#  ttyUSB1 (if #3): AT port
#  ttyUSB2 (if #4): QCDM port
#  ttyUSB3 (if #5): GNSS data
ATTRS{idVendor}=="33f8", ATTRS{idProduct}=="01a2", ENV{.MM_USBIFNUM}=="02", SUBSYSTEM=="tty", ENV{ID_MM_PORT_TYPE_AT_PRIMARY}="1"
ATTRS{idVendor}=="33f8", ATTRS{idProduct}=="01a2", ENV{.MM_USBIFNUM}=="03", SUBSYSTEM=="tty", ENV{ID_MM_PORT_IGNORE}="1"
ATTRS{idVendor}=="33f8", ATTRS{idProduct}=="01a2", ENV{.MM_USBIFNUM}=="04", SUBSYSTEM=="tty", ENV{ID_MM_PORT_TYPE_QCDM}="1"
ATTRS{idVendor}=="33f8", ATTRS{idProduct}=="01a2", ENV{.MM_USBIFNUM}=="05", SUBSYSTEM=="tty", ENV{ID_MM_PORT_TYPE_GPS}="1"
# Firmware interface implementation comes from the Fibocom shared utils.
ATTRS{idVendor}=="33f8", ATTRS{idProduct}=="01a2", ENV{.MM_USBIFNUM}=="02", SUBSYSTEM=="tty", ENV{ID_MM_FIBOCOM_FASTBOOT}="1"

# Rolling RW101-GL (MBIM in iface #0)
#  ttyUSB0 (if #2): GNSS data
ATTRS{idVendor}=="33f8", ATTRS{idProduct}=="01a3", ENV{.MM_USBIFNUM}=="02", SUBSYSTEM=="tty", ENV{ID_MM_PORT_TYPE_GPS}="1"

# Rolling RW101-GL (MBIM in iface #0, ADB in iface #4)
#  ttyUSB0 (if #2): QCDM port
#  ttyUSB1 (if #3): AT port
#  ttyUSB2 (if #5): GNSS data
#  ttyUSB3 (if #6): GNSS data
ATTRS{idVendor}=="33f8", ATTRS{idProduct}=="01a4", ENV{.MM_USBIFNUM}=="02", SUBSYSTEM=="tty", ENV{ID_MM_PORT_TYPE_QCDM}="1"
ATTRS{idVendor}=="33f8", ATTRS{idProduct}=="01a4", ENV{.MM_USBIFNUM}=="03", SUBSYSTEM=="tty", ENV{ID_MM_PORT_TYPE_AT_PRIMARY}="1"
ATTRS{idVendor}=="33f8", ATTRS{idProduct}=="01a4", ENV{.MM_USBIFNUM}=="05", SUBSYSTEM=="tty", ENV{ID_MM_PORT_TYPE_GPS}="1"
ATTRS{idVendor}=="33f8", ATTRS{idProduct}=="01a4", ENV{.MM_USBIFNUM}=="06", SUBSYSTEM=="tty", ENV{ID_MM_PORT_TYPE_GPS}="1"
# Firmware interface implementation comes from the Fibocom shared utils.
ATTRS{idVendor}=="33f8", ATTRS{idProduct}=="01a4", ENV{.MM_USBIFNUM}=="03", SUBSYSTEM=="tty", ENV{ID_MM_FIBOCOM_FASTBOOT}="1"

# Rolling RW135 (MBIM in iface #0, ADB in iface #5)
#  ttyUSB0 (if #2): GNSS data
#  ttyUSB1 (if #3): QCDM port
#  ttyUSB2 (if #4): AT port
ATTRS{idVendor}=="33f8", ATTRS{idProduct}=="0115", ENV{.MM_USBIFNUM}=="02", SUBSYSTEM=="tty", ENV{ID_MM_PORT_TYPE_GPS}="1"
ATTRS{idVendor}=="33f8", ATTRS{idProduct}=="0115", ENV{.MM_USBIFNUM}=="03", SUBSYSTEM=="tty", ENV{ID_MM_PORT_TYPE_QCDM}="1"
ATTRS{idVendor}=="33f8", ATTRS{idProduct}=="0115", ENV{.MM_USBIFNUM}=="04", SUBSYSTEM=="tty", ENV{ID_MM_PORT_TYPE_AT_PRIMARY}="1"

LABEL="mm_rolling_port_types_end"
