+int carlusb_cmd_async(struct carlu *ar, struct carl9170_cmd *cmd,
+ const bool free_buf)
+{
+ struct libusb_transfer *urb;
+ int ret, send;
+
+ if (cmd->hdr.len > (CARL9170_MAX_CMD_LEN - 4)) {
+ err("|-> too much payload\n");
+ ret = -EINVAL;
+ goto out;
+ }
+
+ if (cmd->hdr.len % 4) {
+ err("|-> invalid command length\n");
+ ret = -EINVAL;
+ goto out;
+ }
+
+ ret = libusb_interrupt_transfer(ar->dev, AR9170_EP_CMD, (void *) cmd, cmd->hdr.len + 4, &send, 32);
+ if (ret != 0) {
+ err("OID:0x%.2x failed due to (%d) (%d).\n", cmd->hdr.cmd, ret, send);
+ print_hex_dump_bytes(ERROR, "CMD:", cmd, cmd->hdr.len);
+ }
+
+out:
+ if (free_buf)
+ free((void *)cmd);
+
+ return ret;
+}
+
+int carlusb_cmd(struct carlu *ar, uint8_t oid,