The spec allows bi-directional commands so let's let a user submit
one. The kernel does not support this at the moment, but maybe it will
someday.
Signed-off-by: Keith Busch <keith.busch@intel.com>
fprintf(stderr, "data direction not given\n");
err = EINVAL;
goto free_and_return;
- }
- if (cfg.read && cfg.write) {
- fprintf(stderr, "command can't be both read and write\n");
- err = EINVAL;
- goto free_and_return;
- }
- if (cfg.write) {
+ } else if (cfg.write) {
if (read(wfd, data, cfg.data_len) < 0) {
fprintf(stderr, "failed to read write buffer\n");
err = EINVAL;