def ecio_quality_rating(value, unit):
    """
    ECIO (Ec/Io) - Energy to Interference Ratio (3G, CDMA/UMTS/EV-DO)
    """

    if unit != "dBm":
        raise ValueError("Unsupported unit '{:}'".format(unit))

    rating = 0
    if value > -2:
        rating = 4
    elif -2 >= value > -5:
        rating = 3
    elif -5 >= value > -10:
        rating = 2
    elif value <= -10:
        rating = 1

    return rating