You can have two types of holes, wood wasp larva that don't go too deep and powder post beetle holes that start on the top and go out the bottom.
Your wood is probably salvageable if you have wood wasp larva as they tend be confined to the sapwood and a couple of rings of heart wood and bore parallel to the grain. The larva are white and about 1/2" long.
If you have pin sized holes from powder post beetles your wood is toast. Powder post beetles go deep and make many branches along the way.
The picture is of a piece of oak I split for firewood that shows the depth of the beetles holes.