Code W means that the amount in Box 12 represents nontaxable contributions to your Health Savings Account. This amount includes both your contributions and your employer's.
When you have Code W, you will also have form 8889. If you used your HSA to pay for anything, you will have received a form 1099-SA, which lists the amount of your distributions. When you prepare form 8889, one of the questions will be whether you used this distribution for qualified medical expenses. If you answer yes, there will be no tax on the amount withdrawn; if you answer no, there will be tax and penalties.