move ioctl to generic ffifunctions