def METHOD_NAME(handle):
    """ Get max number of lanes in port according to chip type
    Args:
        handle (sx_api_handle_t): SDK handle
    Returns:
        int: max lanes in port
    """
    # Get chip type
    chip_type = sx_get_chip_type(handle)
    limits = rm_resources_t()
    modes = rm_modes_t()
    rc = rm_chip_limits_get(chip_type, limits)
    sx_check_rc(rc)
    max_width = limits.port_map_width_max
    # SPC2 ports have 8 lanes but SONiC is using 4
    if chip_type == SX_CHIP_TYPE_SPECTRUM2:
        max_width = 4
    return max_width