Replace BSD queue functions with NuttX queue functions