Home
last modified time | relevance | path

Searched refs:sbuf (Results 1 – 25 of 31) sorted by relevance

12

/drivers/hdf_core/framework/utils/src/
Dhdf_sbuf.c15 #define HDF_SBUF_IMPL_CHECK_RETURN(sbuf, api, retCode) \ argument
17 if ((sbuf) == NULL || (sbuf)->impl == NULL) { \
21 if ((sbuf)->impl->api == NULL) { \
22 HDF_LOGE(#api " is not supported on %u sbuf", (sbuf)->type); \
27 #define HDF_SBUF_IMPL_CHECK_RETURN_VOID(sbuf, api) \ argument
29 if ((sbuf) == NULL || (sbuf)->impl == NULL) { \
33 if ((sbuf)->impl->api == NULL) { \
34 HDF_LOGE(#api " is not supported on %u sbuf", (sbuf)->type); \
75 uint8_t *HdfSbufGetData(const struct HdfSBuf *sbuf) in HdfSbufGetData() argument
77 HDF_SBUF_IMPL_CHECK_RETURN(sbuf, getData, NULL); in HdfSbufGetData()
[all …]
Dhdf_sbuf_impl_raw.c49 struct HdfSBufRaw *sbuf = SBUF_RAW_CAST(impl); in SbufRawImplRecycle() local
50 if (sbuf != NULL) { in SbufRawImplRecycle()
51 if (sbuf->data != NULL && !sbuf->isBind) { in SbufRawImplRecycle()
52 OsalMemFree(sbuf->data); in SbufRawImplRecycle()
54 OsalMemFree(sbuf); in SbufRawImplRecycle()
58 static size_t SbufRawImplGetLeftWriteSize(struct HdfSBufRaw *sbuf) in SbufRawImplGetLeftWriteSize() argument
60 return (sbuf->capacity < sbuf->writePos) ? 0 : (sbuf->capacity - sbuf->writePos); in SbufRawImplGetLeftWriteSize()
63 static size_t SbufRawImplGetLeftReadSize(struct HdfSBufRaw *sbuf) in SbufRawImplGetLeftReadSize() argument
65 return (sbuf->writePos < sbuf->readPos) ? 0 : (sbuf->writePos - sbuf->readPos); in SbufRawImplGetLeftReadSize()
70 struct HdfSBufRaw *sbuf = SBUF_RAW_CAST(impl); in SbufRawImplWriteRollback() local
[all …]
/drivers/hdf_core/framework/utils/include/
Dhdf_sbuf_impl.h26 bool (*writeBuffer)(struct HdfSBufImpl *sbuf, const uint8_t *data, uint32_t writeSize);
27 bool (*writeUnpadBuffer)(struct HdfSBufImpl *sbuf, const uint8_t *data, uint32_t writeSize);
28 bool (*writeUint64)(struct HdfSBufImpl *sbuf, uint64_t value);
29 bool (*writeUint32)(struct HdfSBufImpl *sbuf, uint32_t value);
30 bool (*writeUint16)(struct HdfSBufImpl *sbuf, uint16_t value);
31 bool (*writeUint8)(struct HdfSBufImpl *sbuf, uint8_t value);
32 bool (*writeInt64)(struct HdfSBufImpl *sbuf, int64_t value);
33 bool (*writeInt32)(struct HdfSBufImpl *sbuf, int32_t value);
34 bool (*writeInt16)(struct HdfSBufImpl *sbuf, int16_t value);
35 bool (*writeInt8)(struct HdfSBufImpl *sbuf, int8_t value);
[all …]
/drivers/hdf_core/interfaces/inner_api/utils/
Dhdf_sbuf.h67 bool HdfSbufWriteBuffer(struct HdfSBuf *sbuf, const void *data, uint32_t writeSize);
79 bool HdfSbufWriteUnpadBuffer(struct HdfSBuf *sbuf, const uint8_t *data, uint32_t writeSize);
90 bool HdfSbufWriteUint64(struct HdfSBuf *sbuf, uint64_t value);
101 bool HdfSbufWriteUint32(struct HdfSBuf *sbuf, uint32_t value);
112 bool HdfSbufWriteUint16(struct HdfSBuf *sbuf, uint16_t value);
123 bool HdfSbufWriteUint8(struct HdfSBuf *sbuf, uint8_t value);
134 bool HdfSbufWriteInt64(struct HdfSBuf *sbuf, int64_t value);
145 bool HdfSbufWriteInt32(struct HdfSBuf *sbuf, int32_t value);
156 bool HdfSbufWriteInt16(struct HdfSBuf *sbuf, int16_t value);
167 bool HdfSbufWriteInt8(struct HdfSBuf *sbuf, int8_t value);
[all …]
/drivers/hdf_core/adapter/uhdf2/ipc/src/
Dhdf_sbuf_impl_hipc.cpp52 static bool SbufMParcelImplWriteBuffer(struct HdfSBufImpl *sbuf, const uint8_t *data, uint32_t writ… in SbufMParcelImplWriteBuffer() argument
54 auto parcel = MParcelCast(sbuf); in SbufMParcelImplWriteBuffer()
61 static bool SbufMParcelImplWriteUnpadBuffer(struct HdfSBufImpl *sbuf, const uint8_t *data, uint32_t… in SbufMParcelImplWriteUnpadBuffer() argument
63 return MParcelCast(sbuf)->WriteUnpadBuffer(static_cast<const void *>(data), writeSize); in SbufMParcelImplWriteUnpadBuffer()
66 static bool SbufMParcelImplWriteUint64(struct HdfSBufImpl *sbuf, uint64_t value) in SbufMParcelImplWriteUint64() argument
68 return MParcelCast(sbuf)->WriteUint64(value); in SbufMParcelImplWriteUint64()
71 static bool SbufMParcelImplWriteUint32(struct HdfSBufImpl *sbuf, uint32_t value) in SbufMParcelImplWriteUint32() argument
73 return MParcelCast(sbuf)->WriteUint32(value); in SbufMParcelImplWriteUint32()
76 static bool SbufMParcelImplWriteUint16(struct HdfSBufImpl *sbuf, uint16_t value) in SbufMParcelImplWriteUint16() argument
78 return MParcelCast(sbuf)->WriteUint16(value); in SbufMParcelImplWriteUint16()
[all …]
/drivers/hdf_core/adapter/uhdf2/shared/src/
Ddev_attribute_serialize.c25 bool DeviceAttributeSerialize(const struct HdfDeviceInfo *attribute, struct HdfSBuf *sbuf) in DeviceAttributeSerialize() argument
27 if (attribute == NULL || sbuf == NULL) { in DeviceAttributeSerialize()
31 if (!HdfSbufWriteUint32(sbuf, attribute->deviceId) || in DeviceAttributeSerialize()
32 !HdfSbufWriteUint16(sbuf, attribute->policy) || in DeviceAttributeSerialize()
33 !HdfSbufWriteString(sbuf, attribute->svcName) || in DeviceAttributeSerialize()
34 !HdfSbufWriteString(sbuf, attribute->moduleName) || in DeviceAttributeSerialize()
35 !HdfSbufWriteString(sbuf, attribute->deviceName)) { in DeviceAttributeSerialize()
40 if (!HdfSbufWriteUint32(sbuf, ATTRIBUTE_PRIVATE_DATA_LENGTH_NORMAL) || in DeviceAttributeSerialize()
41 !HdfSbufWriteString(sbuf, attribute->deviceMatchAttr)) { in DeviceAttributeSerialize()
46 if (!HdfSbufWriteUint32(sbuf, ATTRIBUTE_PRIVATE_DATA_LENGTH_NULL)) { in DeviceAttributeSerialize()
[all …]
/drivers/peripheral/wlan/client/
DBUILD.gn22 "src/sbuf/sbuf_cmd_adapter.c",
23 "src/sbuf/sbuf_common_adapter.c",
24 "src/sbuf/sbuf_event_adapter.c",
25 "src/sbuf/sbuf_wpa_cmd_adapter.c",
53 "src/sbuf/sbuf_common_adapter.c",
54 "src/sbuf/sbuf_wpa_cmd_adapter.c",
61 "src/sbuf/sbuf_cmd_adapter.c",
62 "src/sbuf/sbuf_event_adapter.c",
93 "src/sbuf/sbuf_event_adapter.c",
/drivers/hdf_core/adapter/uhdf2/shared/include/
Ddev_attribute_serialize.h26 bool DeviceAttributeSerialize(const struct HdfDeviceInfo *attribute, struct HdfSBuf *sbuf);
27 struct HdfDeviceInfo *DeviceAttributeDeserialize(struct HdfSBuf *sbuf);
/drivers/hdf_core/adapter/uhdf2/osal/src/
Dosal_sysevent.c63 struct HdfSBuf *sbuf = HdfSbufObtain(sizeof(uint64_t)); in FinishEvent() local
65 if (sbuf == NULL) { in FinishEvent()
69 if (!HdfSbufWriteUint64(sbuf, event->syncToken)) { in FinishEvent()
70 HdfSbufRecycle(sbuf); in FinishEvent()
74 int ret = service->dispatcher->Dispatch(&service->object, KEVENT_COMPLETE_EVENT, sbuf, NULL); in FinishEvent()
79 HdfSbufRecycle(sbuf); in FinishEvent()
/drivers/peripheral/light/hal/src/
Dlight_controller.c283 struct HdfSBuf *sbuf = NULL; in OnMultiLights() local
294 sbuf = HdfSbufObtain(sizeof(struct LightColor) * count); in OnMultiLights()
295 if (sbuf == NULL) { in OnMultiLights()
300 if (!HdfSbufWriteInt32(sbuf, lightId)) { in OnMultiLights()
306 if (!HdfSbufWriteInt32(sbuf, LIGHT_OPS_IO_CMD_ENABLE_MULTI_LIGHTS)) { in OnMultiLights()
312 if (!HdfSbufWriteBuffer(sbuf, colors, sizeof(*colors))) { in OnMultiLights()
318 if (!HdfSbufWriteInt32(sbuf, count)) { in OnMultiLights()
324 ret = SendLightMsg(LIGHT_IO_CMD_OPS, sbuf, NULL); in OnMultiLights()
330 HdfSbufRecycle(sbuf); in OnMultiLights()
/drivers/hdf_core/framework/core/manager/test/unittest/common/
Dhdf_sbuf_test.cpp64 bool PushDataSequence(HdfSBuf *sbuf) in PushDataSequence() argument
70 ret = HdfSbufWriteUint8(sbuf, *(uint8_t *)dataTable[type]->data); in PushDataSequence()
73 ret = HdfSbufWriteUint16(sbuf, *(uint16_t *)dataTable[type]->data); in PushDataSequence()
76 ret = HdfSbufWriteUint32(sbuf, *(uint32_t *)dataTable[type]->data); in PushDataSequence()
79 ret = HdfSbufWriteUint64(sbuf, *(uint64_t *)dataTable[type]->data); in PushDataSequence()
82 ret = HdfSbufWriteUint8(sbuf, *(int8_t *)dataTable[type]->data); in PushDataSequence()
85 ret = HdfSbufWriteUint16(sbuf, *(uint16_t *)dataTable[type]->data); in PushDataSequence()
88 ret = HdfSbufWriteUint32(sbuf, *(uint32_t *)dataTable[type]->data); in PushDataSequence()
91 ret = HdfSbufWriteUint64(sbuf, *(uint64_t *)dataTable[type]->data); in PushDataSequence()
94 … ret = HdfSbufWriteBuffer(sbuf, (uint8_t *)dataTable[type]->data, dataTable[type]->size); in PushDataSequence()
[all …]
/drivers/hdf_core/adapter/khdf/liteos/model/usb/host/src/
Dusb_pnp_manager.c40 bool UsbPnpManagerWriteModuleName(struct HdfSBuf *sbuf, const char *moduleName) in UsbPnpManagerWriteModuleName() argument
42 return HdfSbufWriteString(sbuf, moduleName); in UsbPnpManagerWriteModuleName()
/drivers/hdf_core/interfaces/inner_api/ipc/
Dhdf_sbuf_ipc.h64 int32_t SbufToParcel(struct HdfSBuf *sbuf, OHOS::MessageParcel **parcel);
/drivers/peripheral/usb/hdf_usb/include/
Dusb_pnp_manager.h24 bool UsbPnpManagerWriteModuleName(struct HdfSBuf *sbuf, const char *moduleName);
/drivers/hdf_core/framework/model/usb/include/
Dusb_pnp_manager.h24 bool UsbPnpManagerWriteModuleName(struct HdfSBuf *sbuf, const char *moduleName);
/drivers/peripheral/usb/ddk/host/src/
Dusb_pnp_manager.c37 bool UsbPnpManagerWriteModuleName(struct HdfSBuf *sbuf, const char *moduleName) in UsbPnpManagerWriteModuleName() argument
45 return HdfSbufWriteString(sbuf, modName); in UsbPnpManagerWriteModuleName()
/drivers/hdf_core/framework/core/adapter/syscall/src/
Dhdf_syscall_adapter.c95 struct HdfSBuf *sbuf = NULL; in HdfDevEventDispatchLocked() local
98 sbuf = HdfSbufBind(bwr->readBuffer, bwr->readConsumed); in HdfDevEventDispatchLocked()
100 sbuf = HdfSbufObtain(sizeof(int)); in HdfDevEventDispatchLocked()
103 if (sbuf == NULL) { in HdfDevEventDispatchLocked()
112 (void)listener->onReceive(listener, &adapter->super, bwr->cmdCode, sbuf); in HdfDevEventDispatchLocked()
114 (void)listener->callBack(listener->priv, bwr->cmdCode, sbuf); in HdfDevEventDispatchLocked()
116 HdfSbufSetDataSize(sbuf, bwr->readConsumed); in HdfDevEventDispatchLocked()
124 (void)listener->onReceive(listener, &adapter->super, bwr->cmdCode, sbuf); in HdfDevEventDispatchLocked()
126 (void)listener->callBack(listener->priv, bwr->cmdCode, sbuf); in HdfDevEventDispatchLocked()
128 HdfSbufSetDataSize(sbuf, bwr->readConsumed); in HdfDevEventDispatchLocked()
[all …]
/drivers/peripheral/bluetooth/audio/hal/hdi_binder/proxy/
DBUILD.gn51 "$hdf_framework_path/ability/sbuf/include",
53 "$hdf_framework_path/ability/sbuf/include",
/drivers/hdf_core/framework/core/adapter/vnode/src/
Dhdf_vnode_adapter.c142 struct HdfSBuf *sbuf = NULL; in HdfSbufCopyFromUser() local
159 sbuf = HdfSbufBind((uintptr_t)kData, size); in HdfSbufCopyFromUser()
160 if (sbuf == NULL) { in HdfSbufCopyFromUser()
163 HdfSbufTransDataOwnership(sbuf); in HdfSbufCopyFromUser()
165 return sbuf; in HdfSbufCopyFromUser()
168 static int HdfSbufCopyToUser(const struct HdfSBuf *sbuf, void *dstUser, size_t dstUserSize) in HdfSbufCopyToUser() argument
170 size_t sbufSize = HdfSbufGetDataSize(sbuf); in HdfSbufCopyToUser()
179 if (CopyToUser(dstUser, HdfSbufGetData(sbuf), sbufSize) != 0) { in HdfSbufCopyToUser()
/drivers/hdf_core/framework/support/platform/src/i2c/
Di2c_if_u.c71 static int32_t I2cHandleSbufCheckResize(struct HdfSBuf **sbuf) in I2cHandleSbufCheckResize() argument
73 struct HdfSBuf *buf = *sbuf; in I2cHandleSbufCheckResize()
86 *sbuf = buf; in I2cHandleSbufCheckResize()
/drivers/hdf_core/framework/tools/hdf_dev_eco_tool/resources/templates/lite/
DLinux_Makefile.template10 -I$(srctree)/drivers/hdf/framework/ability/sbuf/include \
/drivers/hdf_core/framework/sample/platform/uart/dev/
DBUILD.gn14 "$hdf_framework_path/ability/sbuf/include",
/drivers/hdf_core/framework/sample/platform/uart/dispatch/
DBUILD.gn17 "$hdf_framework_path/ability/sbuf/include",
/drivers/peripheral/audio/test/audio_utils/audio_mixer/
Daudio_mixer_main.c315 char *sbuf = buf; in ParseName() local
329 *sbuf++ = *ptr; in ParseName()
340 *sbuf++ = *ptr; in ParseName()
346 *sbuf = (*ptr == '\0') ? *ptr : '\0'; in ParseName()
/drivers/hdf_core/adapter/khdf/liteos/model/audio/
DBUILD.gn65 "$HDF_FRAMEWORKS_PATH/ability/sbuf/include",

12