Finite p-groups all of whose maximal subgroups either are metacyclic or have a derived subgroup of order ≤ p