It was working fine. Just suddenly can't adjust the aperture or the f stop using the adjustment wheel while in M or A mode. In fact, the adjustment wheel doesn't work for any purpose. Basically the camera won't take a decent picture unless it's in auto.
First, power the camera off and on.
Second, remove the lens and put it back on.
One or both of these might help. That's all I got.
Other things to try:
Remove battery, wait, put it back
Reset to factory settings by pressing the two buttons with a green dot for 2 seconds (see here. The location of the buttons is a bit different on the D5100 but they are there too).
But most likely yes, it's going to the shop.