1f931551bSRalph Campbell /*
2f931551bSRalph Campbell  * Copyright (c) 2007, 2008 QLogic Corporation. All rights reserved.
3f931551bSRalph Campbell  *
4f931551bSRalph Campbell  * This software is available to you under a choice of one of two
5f931551bSRalph Campbell  * licenses.  You may choose to be licensed under the terms of the GNU
6f931551bSRalph Campbell  * General Public License (GPL) Version 2, available from the file
7f931551bSRalph Campbell  * COPYING in the main directory of this source tree, or the
8f931551bSRalph Campbell  * OpenIB.org BSD license below:
9f931551bSRalph Campbell  *
10f931551bSRalph Campbell  *     Redistribution and use in source and binary forms, with or
11f931551bSRalph Campbell  *     without modification, are permitted provided that the following
12f931551bSRalph Campbell  *     conditions are met:
13f931551bSRalph Campbell  *
14f931551bSRalph Campbell  *      - Redistributions of source code must retain the above
15f931551bSRalph Campbell  *        copyright notice, this list of conditions and the following
16f931551bSRalph Campbell  *        disclaimer.
17f931551bSRalph Campbell  *
18f931551bSRalph Campbell  *      - Redistributions in binary form must reproduce the above
19f931551bSRalph Campbell  *        copyright notice, this list of conditions and the following
20f931551bSRalph Campbell  *        disclaimer in the documentation and/or other materials
21f931551bSRalph Campbell  *        provided with the distribution.
22f931551bSRalph Campbell  *
23f931551bSRalph Campbell  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
24f931551bSRalph Campbell  * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
25f931551bSRalph Campbell  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
26f931551bSRalph Campbell  * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
27f931551bSRalph Campbell  * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
28f931551bSRalph Campbell  * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
29f931551bSRalph Campbell  * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
30f931551bSRalph Campbell  * SOFTWARE.
31f931551bSRalph Campbell  */
32f931551bSRalph Campbell #include <linux/device.h>
33f931551bSRalph Campbell 
34f931551bSRalph Campbell struct qib_user_sdma_queue;
35f931551bSRalph Campbell 
36f931551bSRalph Campbell struct qib_user_sdma_queue *
37f931551bSRalph Campbell qib_user_sdma_queue_create(struct device *dev, int unit, int port, int sport);
38f931551bSRalph Campbell void qib_user_sdma_queue_destroy(struct qib_user_sdma_queue *pq);
39f931551bSRalph Campbell 
40f931551bSRalph Campbell int qib_user_sdma_writev(struct qib_ctxtdata *pd,
41f931551bSRalph Campbell 			 struct qib_user_sdma_queue *pq,
42f931551bSRalph Campbell 			 const struct iovec *iov,
43f931551bSRalph Campbell 			 unsigned long dim);
44f931551bSRalph Campbell 
45f931551bSRalph Campbell int qib_user_sdma_make_progress(struct qib_pportdata *ppd,
46f931551bSRalph Campbell 				struct qib_user_sdma_queue *pq);
47f931551bSRalph Campbell 
48f931551bSRalph Campbell void qib_user_sdma_queue_drain(struct qib_pportdata *ppd,
49f931551bSRalph Campbell 			       struct qib_user_sdma_queue *pq);
50f931551bSRalph Campbell 
51f931551bSRalph Campbell u32 qib_user_sdma_complete_counter(const struct qib_user_sdma_queue *pq);
52f931551bSRalph Campbell u32 qib_user_sdma_inflight_counter(struct qib_user_sdma_queue *pq);
53