on early-init
    mkdir /mnt/vendor/cpefs 0771 radio system

on init
    symlink /dev/block/platform/13500000.dwmmc0/by-name/radio /dev/mbin0
    restorecon /dev/mbin0

    write /proc/sys/net/core/netdev_max_backlog 5000

    write /sys/class/net/rmnet0/queues/rx-0/rps_cpus 6
    write /sys/class/net/rmnet1/queues/rx-0/rps_cpus 6
    write /sys/class/net/rmnet2/queues/rx-0/rps_cpus 6
    write /sys/class/net/rmnet3/queues/rx-0/rps_cpus 6
    write /sys/class/net/rmnet4/queues/rx-0/rps_cpus 6
    write /sys/class/net/rmnet5/queues/rx-0/rps_cpus 6
    write /sys/class/net/rmnet6/queues/rx-0/rps_cpus 6
    write /sys/class/net/rmnet7/queues/rx-0/rps_cpus 6

on fs && property:ro.boot.cpefs_wp=0
    wait /dev/block/platform/13500000.dwmmc0/by-name/cpefs
    mount ext4 /dev/block/platform/13500000.dwmmc0/by-name/cpefs /mnt/vendor/cpefs nosuid nodev noatime noauto_da_alloc,discard,journal_checksum,data=ordered,errors=panic
    mount none /mnt/vendor/cpefs /cpefs bind
    restorecon_recursive /mnt/vendor/cpefs
    chown radio system /mnt/vendor/cpefs
    chmod 0771 /mnt/vendor/cpefs

on fs && property:ro.boot.cpefs_wp=1
    wait /dev/block/platform/13500000.dwmmc0/by-name/cpefs
    mount ext4 /dev/block/platform/13500000.dwmmc0/by-name/cpefs /mnt/vendor/cpefs ro nosuid nodev noatime noauto_da_alloc,discard,journal_checksum,data=ordered,errors=panic
    mount none /mnt/vendor/cpefs /cpefs bind
    restorecon_recursive /mnt/vendor/cpefs
    chown radio system /mnt/vendor/cpefs
    chmod 0771 /mnt/vendor/cpefs

on post-fs-data
    chown radio radio sys/devices/virtual/misc/multipdp/waketime
    chmod 0660 /sys/devices/virtual/misc/umts_dm0/dm_state
    chown radio system /sys/devices/virtual/misc/umts_dm0/dm_state

    # /efs/factory.prop for Dual / Single SIM settings
    chown radio radio /mnt/vendor/efs/factory.prop
    chmod 0600 /mnt/vendor/efs/factory.prop

# Modem boot daemon
service cpboot-daemon /vendor/bin/cbd -d -tss310 -bm -mm -P platform/13500000.dwmmc0/by-name/radio
    class main
    user root
    group radio cache inet misc audio sdcard_rw log sdcard_r shell system
    seclabel u:r:cbd:s0

on property:ril.clatd.v4-rmnet0=up
    write /sys/class/net/rmnet0/queues/rx-0/rps_cpus 4
    write /sys/class/net/v4-rmnet0/queues/rx-0/rps_cpus 2

on property:ril.clatd.v4-rmnet1=up
    write /sys/class/net/rmnet1/queues/rx-0/rps_cpus 4
    write /sys/class/net/v4-rmnet1/queues/rx-0/rps_cpus 2

on property:ril.clatd.v4-rmnet2=up
    write /sys/class/net/rmnet2/queues/rx-0/rps_cpus 4
    write /sys/class/net/v4-rmnet2/queues/rx-0/rps_cpus 2

on property:ril.clatd.v4-rmnet3=up
    write /sys/class/net/rmnet3/queues/rx-0/rps_cpus 4
    write /sys/class/net/v4-rmnet3/queues/rx-0/rps_cpus 2

on property:ril.clatd.v4-rmnet4=up
    write /sys/class/net/rmnet4/queues/rx-0/rps_cpus 4
    write /sys/class/net/v4-rmnet4/queues/rx-0/rps_cpus 2

on property:ril.clatd.v4-rmnet5=up
    write /sys/class/net/rmnet5/queues/rx-0/rps_cpus 4
    write /sys/class/net/v4-rmnet5/queues/rx-0/rps_cpus 2

on property:ril.clatd.v4-rmnet6=up
    write /sys/class/net/rmnet6/queues/rx-0/rps_cpus 4
    write /sys/class/net/v4-rmnet6/queues/rx-0/rps_cpus 2

on property:ril.clatd.v4-rmnet7=up
    write /sys/class/net/rmnet7/queues/rx-0/rps_cpus 4
    write /sys/class/net/v4-rmnet7/queues/rx-0/rps_cpus 2

# SS/DS configuration
on property:ro.vendor.multisim.simslotcount=*
   write /sys/module/modem_ctrl_ss310ap/parameters/ds_detect ${ro.vendor.multisim.simslotcount}

on property:ro.vendor.multisim.simslotcount=1
    setprop persist.radio.multisim.config ss

on property:ro.vendor.multisim.simslotcount=2
    setprop persist.radio.multisim.config dsds

