in qcom_glink_native.c [1199:1235]
static int qcom_glink_announce_create(struct rpmsg_device *rpdev)
{
struct glink_channel *channel = to_glink_channel(rpdev->ept);
struct device_node *np = rpdev->dev.of_node;
struct qcom_glink *glink = channel->glink;
struct glink_core_rx_intent *intent;
const struct property *prop = NULL;
__be32 defaults[] = { cpu_to_be32(SZ_1K), cpu_to_be32(5) };
int num_intents;
int num_groups = 1;
__be32 *val = defaults;
int size;
if (glink->intentless || !completion_done(&channel->open_ack))
return 0;
prop = of_find_property(np, "qcom,intents", NULL);
if (prop) {
val = prop->value;
num_groups = prop->length / sizeof(u32) / 2;
}
/* Channel is now open, advertise base set of intents */
while (num_groups--) {
size = be32_to_cpup(val++);
num_intents = be32_to_cpup(val++);
while (num_intents--) {
intent = qcom_glink_alloc_intent(glink, channel, size,
true);
if (!intent)
break;
qcom_glink_advertise_intent(glink, channel, intent);
}
}
return 0;
}