Long-range interactions of ions with atoms having partially filled p subshells