mirror of
https://github.com/linux-msm/qdl.git
synced 2026-02-25 13:12:25 -08:00
Add SPDX-License-Identifier line to each source file that contains license text. More details about SPDX license identifiers can be found at [1]. The scancode-toolkit [2] was used to match license text to the correct SPDX-License-Identifier: $ scancode --license --copyright --html scancode_result.html ./ [1] https://spdx.org/licenses/ [2] https://github.com/nexB/scancode-toolkit Signed-off-by: Igor Opaniuk <igor.opaniuk@oss.qualcomm.com>
50 lines
905 B
C
50 lines
905 B
C
// SPDX-License-Identifier: BSD-3-Clause
|
|
/*
|
|
* Copyright (c) 2025, Qualcomm Innovation Center, Inc. All rights reserved.
|
|
*/
|
|
#include <stdlib.h>
|
|
|
|
#include "qdl.h"
|
|
|
|
struct qdl_device *qdl_init(enum QDL_DEVICE_TYPE type)
|
|
{
|
|
if (type == QDL_DEVICE_USB)
|
|
return usb_init();
|
|
|
|
if (type == QDL_DEVICE_SIM)
|
|
return sim_init();
|
|
|
|
return NULL;
|
|
}
|
|
|
|
void qdl_deinit(struct qdl_device *qdl)
|
|
{
|
|
if (qdl)
|
|
free(qdl);
|
|
}
|
|
|
|
void qdl_set_out_chunk_size(struct qdl_device *qdl, long size)
|
|
{
|
|
qdl->set_out_chunk_size(qdl, size);
|
|
}
|
|
|
|
int qdl_open(struct qdl_device *qdl, const char *serial)
|
|
{
|
|
return qdl->open(qdl, serial);
|
|
}
|
|
|
|
void qdl_close(struct qdl_device *qdl)
|
|
{
|
|
qdl->close(qdl);
|
|
}
|
|
|
|
int qdl_read(struct qdl_device *qdl, void *buf, size_t len, unsigned int timeout)
|
|
{
|
|
return qdl->read(qdl, buf, len, timeout);
|
|
}
|
|
|
|
int qdl_write(struct qdl_device *qdl, const void *buf, size_t len)
|
|
{
|
|
return qdl->write(qdl, buf, len);
|
|
}
|