Bjorn Andersson | 835764dd | 2017-08-24 12:51:26 +0530 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (c) 2016-2017, Linaro Ltd |
| 3 | * |
| 4 | * This program is free software; you can redistribute it and/or modify |
| 5 | * it under the terms of the GNU General Public License version 2 and |
| 6 | * only version 2 as published by the Free Software Foundation. |
| 7 | * |
| 8 | * This program is distributed in the hope that it will be useful, |
| 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 11 | * GNU General Public License for more details. |
| 12 | */ |
| 13 | |
| 14 | #ifndef __QCOM_GLINK_NATIVE_H__ |
| 15 | #define __QCOM_GLINK_NATIVE_H__ |
| 16 | |
Sricharan R | d31ad61 | 2017-08-24 12:51:32 +0530 | [diff] [blame] | 17 | #define GLINK_FEATURE_INTENT_REUSE BIT(0) |
| 18 | #define GLINK_FEATURE_MIGRATION BIT(1) |
| 19 | #define GLINK_FEATURE_TRACER_PKT BIT(2) |
| 20 | |
Bjorn Andersson | 835764dd | 2017-08-24 12:51:26 +0530 | [diff] [blame] | 21 | struct qcom_glink_pipe { |
| 22 | size_t length; |
| 23 | |
| 24 | size_t (*avail)(struct qcom_glink_pipe *glink_pipe); |
| 25 | |
| 26 | void (*peak)(struct qcom_glink_pipe *glink_pipe, void *data, |
Bjorn Andersson | b88eee9 | 2017-08-24 12:51:36 +0530 | [diff] [blame^] | 27 | unsigned int offset, size_t count); |
Bjorn Andersson | 835764dd | 2017-08-24 12:51:26 +0530 | [diff] [blame] | 28 | void (*advance)(struct qcom_glink_pipe *glink_pipe, size_t count); |
| 29 | |
| 30 | void (*write)(struct qcom_glink_pipe *glink_pipe, |
| 31 | const void *hdr, size_t hlen, |
| 32 | const void *data, size_t dlen); |
| 33 | }; |
| 34 | |
| 35 | struct qcom_glink; |
| 36 | |
| 37 | struct qcom_glink *qcom_glink_native_probe(struct device *dev, |
Sricharan R | d31ad61 | 2017-08-24 12:51:32 +0530 | [diff] [blame] | 38 | unsigned long features, |
Bjorn Andersson | 835764dd | 2017-08-24 12:51:26 +0530 | [diff] [blame] | 39 | struct qcom_glink_pipe *rx, |
Sricharan R | 933b45d | 2017-08-24 12:51:34 +0530 | [diff] [blame] | 40 | struct qcom_glink_pipe *tx, |
| 41 | bool intentless); |
Bjorn Andersson | 835764dd | 2017-08-24 12:51:26 +0530 | [diff] [blame] | 42 | void qcom_glink_native_remove(struct qcom_glink *glink); |
| 43 | |
Bjorn Andersson | caf989c | 2017-08-24 12:51:30 +0530 | [diff] [blame] | 44 | void qcom_glink_native_unregister(struct qcom_glink *glink); |
Bjorn Andersson | 835764dd | 2017-08-24 12:51:26 +0530 | [diff] [blame] | 45 | #endif |