Пример #1
0
int chsc_determine_base_channel_path_desc(struct chp_id chpid,
					  struct channel_path_desc *desc)
{
	struct chsc_response_struct *chsc_resp;
	int ret;

	chsc_resp = kzalloc(sizeof(*chsc_resp), GFP_KERNEL);
	if (!chsc_resp)
		return -ENOMEM;
	ret = chsc_determine_channel_path_desc(chpid, 0, 0, 0, 0, chsc_resp);
	if (ret)
		goto out_free;
	memcpy(desc, &chsc_resp->data, chsc_resp->length);
out_free:
	kfree(chsc_resp);
	return ret;
}
Пример #2
0
int chsc_determine_fmt1_channel_path_desc(struct chp_id chpid,
        struct channel_path_desc_fmt1 *desc)
{
    struct chsc_response_struct *chsc_resp;
    struct chsc_scpd *scpd_area;
    int ret;

    spin_lock_irq(&chsc_page_lock);
    scpd_area = chsc_page;
    ret = chsc_determine_channel_path_desc(chpid, 0, 0, 1, 0, scpd_area);
    if (ret)
        goto out;
    chsc_resp = (void *)&scpd_area->response;
    memcpy(desc, &chsc_resp->data, sizeof(*desc));
out:
    spin_unlock_irq(&chsc_page_lock);
    return ret;
}
Пример #3
0
int chsc_determine_base_channel_path_desc(struct chp_id chpid,
        struct channel_path_desc *desc)
{
    struct chsc_response_struct *chsc_resp;
    struct chsc_scpd *scpd_area;
    unsigned long flags;
    int ret;

    spin_lock_irqsave(&chsc_page_lock, flags);
    scpd_area = chsc_page;
    ret = chsc_determine_channel_path_desc(chpid, 0, 0, 0, 0, scpd_area);
    if (ret)
        goto out;
    chsc_resp = (void *)&scpd_area->response;
    memcpy(desc, &chsc_resp->data, sizeof(*desc));
out:
    spin_unlock_irqrestore(&chsc_page_lock, flags);
    return ret;
}