Opcode bits 1:0 indicate the direction of data transfer. These
bits should agree with the read or write flags provided.
Signed-off-by: Kelly Ursenbach <kelly.ursenbach@eideticom.com>
goto free_metadata;
}
+ if (cfg.write && !(cfg.opcode & 0x01)) {
+ fprintf(stderr, "warning: write flag set but write direction bit is not set in the opcode\n");
+ }
+
+ if (cfg.read && !(cfg.opcode & 0x02)) {
+ fprintf(stderr, "warning: read flag set but read direction bit is not set in the opcode\n");
+ }
+
memset(data, cfg.prefill, cfg.data_len);
if (!cfg.read && !cfg.write) {
fprintf(stderr, "data direction not given\n");