Ericsson plans to cut around 3,900 jobs in Sweden, ditching most manufacturing as it grapples with a shrinking market for network equipment.