]> xenbits.xensource.com Git - people/julieng/freebsd.git/commitdiff
NTB: Add ntb_mw_clear_trans() missed in r289546
authorcem <cem@FreeBSD.org>
Mon, 19 Oct 2015 17:41:22 +0000 (17:41 +0000)
committercem <cem@FreeBSD.org>
Mon, 19 Oct 2015 17:41:22 +0000 (17:41 +0000)
It is just a trivial wrapper around ntb_mw_set_trans().

Authored by: Allen Hubbe
Obtained from: Linux (Dual BSD/GPL driver)
Sponsored by: EMC / Isilon Storage Division

sys/dev/ntb/ntb_hw/ntb_hw.c

index 9a3e189b974d087266d5e8be795f4d87aec5e99a..bf2a3073da9dbde4ae88e7138e81fd76508a7499 100644 (file)
@@ -2117,6 +2117,23 @@ ntb_mw_set_trans(struct ntb_softc *ntb, unsigned idx, bus_addr_t addr,
        return (0);
 }
 
+/*
+ * ntb_mw_clear_trans() - clear the translation of a memory window
+ * @ntb:       NTB device context
+ * @idx:       Memory window number
+ *
+ * Clear the translation of a memory window.  The peer may no longer access
+ * local memory through the window.
+ *
+ * Return: Zero on success, otherwise an error number.
+ */
+int
+ntb_mw_clear_trans(struct ntb_softc *ntb, unsigned mw_idx)
+{
+
+       return (ntb_mw_set_trans(ntb, mw_idx, 0, 0));
+}
+
 /**
  * ntb_peer_db_set() - Set the doorbell on the secondary/external side
  * @ntb: pointer to ntb_softc instance