Add ioctl_setopmode to change operating mode

Signed-off-by: Alan Carvalho de Assis <acassis@gmail.com>