driver: fix some bugs and still have some ring buffer bugs