Home
last modified time | relevance | path

Searched refs:fd (Results 1 – 25 of 236) sorted by relevance

12345678910

/drivers/peripheral/camera/vdi_base/common/adapter/platform/v4l2/src/driver_adapter/src/
Dv4l2_dev.cpp43 int fd; in start() local
62 fd = myFileFormat_->V4L2OpenDevice(devName); in start()
63 if (fd < 0) { in start()
64 CAMERA_LOGE("error:myFileFormat_->V4L2OpenDevice fail fd == %d\n", fd); in start()
68 bufferType_ = static_cast<enum v4l2_buf_type>(myFileFormat_->V4L2SearchBufType(fd)); in start()
75 HosV4L2Dev::fdMatch.insert(std::make_pair(cameraID, fd)); in start()
82 int fd; in stop() local
97 fd = itr->second; in stop()
98 if (fd < 0) { in stop()
99 CAMERA_LOGE("HosV4L2Dev::stop fd error = %d\n", fd); in stop()
[all …]
Dv4l2_control.cpp22 RetCode HosV4L2Control::V4L2SetCtrls (int fd, std::vector<DeviceControl>& control, const int numCon… in V4L2SetCtrls() argument
48 ret = ioctl(fd, VIDIOC_S_EXT_CTRLS, &ctrls); in V4L2SetCtrls()
56 ret = ioctl(fd, VIDIOC_S_CTRL, &ctrl); in V4L2SetCtrls()
71 RetCode HosV4L2Control::V4L2GetCtrls (int fd, std::vector<DeviceControl>& control, const int numCon… in V4L2GetCtrls() argument
98 ret = ioctl(fd, VIDIOC_G_EXT_CTRLS, &ctrls); in V4L2GetCtrls()
104 ret = ioctl(fd, VIDIOC_G_CTRL, &ctrl); in V4L2GetCtrls()
126 RetCode HosV4L2Control::V4L2GetCtrl(int fd, unsigned int id, int& value) in V4L2GetCtrl() argument
133 rc = ioctl(fd, VIDIOC_G_CTRL, &ctrl); in V4L2GetCtrl()
144 RetCode HosV4L2Control::V4L2SetCtrl(int fd, unsigned int id, int value) in V4L2SetCtrl() argument
154 rc = ioctl(fd, VIDIOC_S_CTRL, &ctrl); in V4L2SetCtrl()
[all …]
Dv4l2_fileformat.cpp24 RetCode HosFileFormat::V4L2SearchFormat(int fd, std::vector<DeviceFormat>& fmtDesc) in V4L2SearchFormat() argument
35 if (ioctl(fd, VIDIOC_ENUM_FMT, &enumFmtDesc) < 0) { in V4L2SearchFormat()
44 if (ioctl(fd, VIDIOC_ENUM_FRAMESIZES, &frmSize) < 0) { in V4L2SearchFormat()
58 if (ioctl(fd, VIDIOC_ENUM_FRAMEINTERVALS, &fraMival) < 0) { in V4L2SearchFormat()
85 RetCode HosFileFormat::V4L2GetFmtDescs(int fd, std::vector<DeviceFormat>& fmtDesc) in V4L2GetFmtDescs() argument
91 if (fd < 0) { in V4L2GetFmtDescs()
96 V4L2SearchBufType(fd); in V4L2GetFmtDescs()
102 rc = V4L2SearchFormat(fd, fmtDesc); in V4L2GetFmtDescs()
110 RetCode HosFileFormat::V4L2GetCapability(int fd, const std::string& devName, std::string& cameraId) in V4L2GetCapability() argument
114 int rc = ioctl(fd, VIDIOC_QUERYCAP, &cap); in V4L2GetCapability()
[all …]
Dv4l2_stream.cpp30 RetCode HosV4L2Streams::V4L2StreamOn(int fd) in V4L2StreamOn() argument
37 rc = ioctl(fd, VIDIOC_STREAMON, &buf_type); in V4L2StreamOn()
46 RetCode HosV4L2Streams::V4L2StreamOff(int fd) in V4L2StreamOff() argument
53 rc = ioctl(fd, VIDIOC_STREAMOFF, &buf_type); in V4L2StreamOff()
62 RetCode HosV4L2Streams::V4L2StreamFPSGet(int fd, DeviceFormat& format) in V4L2StreamFPSGet() argument
69 rc = ioctl(fd, VIDIOC_G_PARM, &Stream_Parm); in V4L2StreamFPSGet()
81 RetCode HosV4L2Streams::V4L2StreamFPSSet(int fd, DeviceFormat& format) in V4L2StreamFPSSet() argument
91 rc = ioctl(fd, VIDIOC_S_PARM, &Stream_Parm); in V4L2StreamFPSSet()
/drivers/peripheral/codec/hal/v1.0/share_mem/src/
Dashmem_wrapper.cpp38 int32_t fd = AshmemCreate(name, size); in AshmemCreateFd() local
39 if (fd < 0) { in AshmemCreateFd()
40 HDF_LOGE("%{public}s: Failed to create fd = %{public}d", __func__, fd); in AshmemCreateFd()
42 return fd; in AshmemCreateFd()
45 uint8_t* MapAshmemFd(int32_t fd, int32_t size) in MapAshmemFd() argument
47 if (fd < 0) { in MapAshmemFd()
48 HDF_LOGE("%{public}s: Failed to map invalid fd: %{public}d", __func__, fd); in MapAshmemFd()
55 …8_t *addr = static_cast<uint8_t *>(mmap(nullptr, size, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0)); in MapAshmemFd()
68 int32_t CloseAshmemFd(int32_t fd) in CloseAshmemFd() argument
70 return close(fd); in CloseAshmemFd()
Dshare_mem.c29 int32_t fd = AshmemCreateFd("", shareMemory->size); in CreateFdShareMemory() local
30 if (fd < 0) { in CreateFdShareMemory()
34 shareMemory->fd = fd; in CreateFdShareMemory()
35 shareMemory->virAddr = MapAshmemFd(fd, shareMemory->size); in CreateFdShareMemory()
47 if (shareMemory == NULL || shareMemory->fd < 0) { in OpenFdShareMemory()
51 shareMemory->virAddr = MapAshmemFd(shareMemory->fd, shareMemory->size); in OpenFdShareMemory()
68 CloseAshmemFd(shareMemory->fd); in ReleaseFdShareMemory()
/drivers/interface/display/composer/hdifd_parcelable/
Dhdifd_parcelable.cpp37 HdifdParcelable::HdifdParcelable(int32_t fd) in HdifdParcelable() argument
38 : init_(true), hdiFd_(fd) in HdifdParcelable()
49 bool HdifdParcelable::Init(int32_t fd) in Init() argument
57 if (fd < 0) { in Init()
60 hdiFd_ = dup(fd); in Init()
71 bool HdifdParcelable::WriteFileDescriptor(const int fd, Parcel& parcel) in WriteFileDescriptor() argument
73 if (fd < 0) { in WriteFileDescriptor()
76 int dupFd = dup(fd); in WriteFileDescriptor()
95 int fd = descriptor->GetFd(); in ReadFileDescriptor() local
96 if (fd < 0) { in ReadFileDescriptor()
[all …]
/drivers/peripheral/camera/vdi_base/common/adapter/platform/v4l2/src/driver_adapter/include/
Dv4l2_control.h35 RetCode V4L2GetCtrl(int fd, unsigned int id, int& value);
36 RetCode V4L2SetCtrl(int fd, unsigned int id, int value);
37 RetCode V4L2GetControls(int fd, std::vector<DeviceControl>& control);
38 RetCode V4L2SetCtrls(int fd, std::vector<DeviceControl>& control, const int numControls);
39 RetCode V4L2GetCtrls(int fd, std::vector<DeviceControl>& control, const int numControls);
42 void V4L2SetValue(int fd, std::vector<DeviceControl>& control, DeviceControl& ctrl,
44 int ExtControl(int fd, struct v4l2_queryctrl *ctrl);
45 void V4L2EnumExtControls(int fd, std::vector<DeviceControl>& control);
46 void V4L2EnumControls(int fd, std::vector<DeviceControl>& control);
47 int V4L2GetControl(int fd, std::vector<DeviceControl>& control, unsigned int id);
Dv4l2_fileformat.h38 RetCode V4L2GetFmt(int fd, DeviceFormat& format);
39 RetCode V4L2SetFmt(int fd, DeviceFormat& format);
40 RetCode V4L2GetCrop(int fd, DeviceFormat& format);
41 RetCode V4L2SetCrop(int fd, DeviceFormat& format);
42 RetCode V4L2GetCropCap(int fd, DeviceFormat& format);
43 RetCode V4L2GetFmtDescs(int fd, std::vector<DeviceFormat>& fmtDesc);
45 void V4L2CloseDevice(int fd);
47 int V4L2SearchBufType(int fd);
50 RetCode V4L2GetCapability(int fd, const std::string& dev_name, std::string& cameraId);
51 RetCode V4L2SearchFormat(int fd, std::vector<DeviceFormat>& fmtDesc);
Dv4l2_buffer.h46 RetCode V4L2ReqBuffers(int fd, int unsigned buffCont);
47 RetCode V4L2ReleaseBuffers(int fd);
49 RetCode V4L2QueueBuffer(int fd, const std::shared_ptr<FrameSpec>& frameSpec);
50 RetCode V4L2DequeueBuffer(int fd);
52 RetCode V4L2AllocBuffer(int fd, const std::shared_ptr<FrameSpec>& frameSpec);
56 RetCode Flush(int fd);
59 …RetCode SetAdapterBuffer(int fd, struct v4l2_buffer &buf, const std::shared_ptr<FrameSpec>& frameS…
Dv4l2_stream.h32 RetCode V4L2StreamOn(int fd);
33 RetCode V4L2StreamOff(int fd);
34 RetCode V4L2StreamFPSGet(int fd, DeviceFormat& format);
35 RetCode V4L2StreamFPSSet(int fd, DeviceFormat& format);
/drivers/hdf_core/framework/sample/platform/uart/dev/
Dhello_uart_dev.c20 int fd; in main() local
23 fd = open("/dev/uartdev-5", O_RDWR); in main()
24 if (fd < 0) { in main()
25 HDF_LOGE("uartdev-5 open failed %d", fd); in main()
28 ret = write(fd, info, INFO_SIZE); in main()
32 ret = close(fd); in main()
34 HDF_LOGE("uartdev-5 close failed %d", fd); in main()
/drivers/peripheral/partitionslot/hal/src/
Dpartitionslot_manager.cpp73 int32_t PartitionSlotManager::WriteSlot(int fd, int32_t slot, off_t offset, off_t size) in WriteSlot() argument
75 if (lseek(fd, offset, SEEK_SET) < 0) { in WriteSlot()
80 if (write(fd, &slot, size) != size) { in WriteSlot()
89 int fd = open(MISC_DEVICE_NODE, O_RDWR | O_CLOEXEC, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH); in ReadMisc() local
90 if (fd < 0) { in ReadMisc()
93 if (lseek(fd, offset, SEEK_SET) < 0) { in ReadMisc()
95 close(fd); in ReadMisc()
99 if (read(fd, &slot, size) != size) { in ReadMisc()
101 close(fd); in ReadMisc()
105 close(fd); in ReadMisc()
[all …]
/drivers/peripheral/bluetooth/hci/hdi_service/implement/
Dmct_protocol.cpp51 void MctProtocol::ReadEventData(int fd) in ReadEventData() argument
57 …readLen = Read(fd, eventPacket_.data() + eventReadLength_, eventPacket_.size() - eventReadLength_); in ReadEventData()
60 HDF_LOGE("read fd[%d] err:%s", fd, buf); in ReadEventData()
63 HDF_LOGE("read fd[%d] readLen = 0.", fd); in ReadEventData()
74 …readLen = Read(fd, eventPacket_.data() + eventReadLength_, eventPacket_.size() - eventReadLength_); in ReadEventData()
77 HDF_LOGE("read fd[%d] err:%s", fd, buf); in ReadEventData()
80 HDF_LOGE("read fd[%d] readLen = 0.", fd); in ReadEventData()
97 void MctProtocol::ReadAclData(int fd) in ReadAclData() argument
103 readLen = Read(fd, aclPacket_.data() + aclReadLength_, aclPacket_.size() - aclReadLength_); in ReadAclData()
106 HDF_LOGE("read fd[%d] err:%s", fd, buf); in ReadAclData()
[all …]
Dh4_protocol.cpp28 …int fd, HciDataCallback onAclReceive, HciDataCallback onScoReceive, HciDataCallback onEventReceive) in H4Protocol() argument
29 …: hciFd_(fd), onAclReceive_(onAclReceive), onScoReceive_(onScoReceive), onEventReceive_(onEventRec… in H4Protocol()
54 void H4Protocol::ReadData(int fd) in ReadData() argument
60 readLen = Read(fd, &packetType_, sizeof(packetType_)); in ReadData()
62 HDF_LOGE("read fd[%d]", fd); in ReadData()
65 HDF_LOGE("read fd[%d] readLen = 0.", fd); in ReadData()
73 readLen = Read(fd, hciPacket_.data() + readLength_, hciPacket_.size() - readLength_); in ReadData()
76 HDF_LOGE("read fd[%d] err:%s", fd, buf); in ReadData()
79 HDF_LOGE("read fd[%d] readLen = 0.", fd); in ReadData()
92 readLen = Read(fd, hciPacket_.data() + readLength_, hciPacket_.size() - readLength_); in ReadData()
[all …]
Dhci_watcher.cpp36 bool HciWatcher::AddFdToWatcher(int fd, HciDataCallback callback) in AddFdToWatcher() argument
39 fds_[fd] = callback; in AddFdToWatcher()
44 bool HciWatcher::RemoveFdToWatcher(int fd) in RemoveFdToWatcher() argument
47 fds_.erase(fd); in RemoveFdToWatcher()
118 for (auto &&fd : fds_) { in WatcherThread()
119 FD_SET(fd.first, &readFds); in WatcherThread()
120 nfds = std::max(fd.first, nfds); in WatcherThread()
151 for (auto &&fd : fds_) { in WatcherThread()
152 if (FD_ISSET(fd.first, &readFds)) { in WatcherThread()
153 fd.second(fd.first); in WatcherThread()
/drivers/hdf_core/adapter/khdf/liteos/osal/src/
Dosal_firmware.c43 int32_t fd; member
55 int32_t fd = -1; in OsalRequestFirmware() local
71 fd = open(path, O_RDONLY, S_IREAD); in OsalRequestFirmware()
72 if (fd == -1) { in OsalRequestFirmware()
77 if (fstat(fd, &fwStat) == -1) { in OsalRequestFirmware()
79 close(fd); in OsalRequestFirmware()
86 close(fd); in OsalRequestFirmware()
91 fw->fd = fd; in OsalRequestFirmware()
149 if (fw->fd == -1) { in OsalReadFirmware()
154 readOffset = (uint32_t)lseek(fw->fd, fw->offset, SEEK_SET); in OsalReadFirmware()
[all …]
/drivers/peripheral/battery/interfaces/hdi_service/test/unittest/src/
Dhdi_service_test.cpp224 int fd = open(sysBattTemPath.c_str(), O_RDONLY); in ReadTemperatureSysfs() local
225 if (fd < NUM_ZERO) { in ReadTemperatureSysfs()
230 readSize = read(fd, buf, sizeof(buf) - 1); in ReadTemperatureSysfs()
233 close(fd); in ReadTemperatureSysfs()
243 close(fd); in ReadTemperatureSysfs()
261 int fd = open(sysBattVolPath.c_str(), O_RDONLY); in ReadVoltageSysfs() local
262 if (fd < NUM_ZERO) { in ReadVoltageSysfs()
267 readSize = read(fd, buf, sizeof(buf) - 1); in ReadVoltageSysfs()
270 close(fd); in ReadVoltageSysfs()
280 close(fd); in ReadVoltageSysfs()
[all …]
/drivers/peripheral/display/hal/default_standard/src/display_device/core/
Dhdi_netlink_monitor.cpp31 int fd; in Init() local
36 fd = socket(PF_NETLINK, SOCK_DGRAM, NETLINK_KOBJECT_UEVENT); in Init()
37 DISPLAY_CHK_RETURN((fd < 0), DISPLAY_FAILURE, DISPLAY_LOGE("socket create failed")); in Init()
38 setsockopt(fd, SOL_SOCKET, SO_RCVBUF, &bufferSize, sizeof(bufferSize)); in Init()
39 ret = bind(fd, (struct sockaddr *)&snl, sizeof(struct sockaddr_nl)); in Init()
46 mScoketFd = fd; in Init()
Dhdi_fd.h31 explicit HdiFd(int fd) : mFd(fd) in HdiFd() argument
40 HdiFd &operator = (int fd)
45 mFd = fd;
/drivers/hdf_core/adapter/uhdf2/utils/src/
Dshared_mem.cpp24 int SharedMemSetProt(int fd, int prot) in SharedMemSetProt() argument
26 return OHOS::AshmemSetProt(fd, prot); in SharedMemSetProt()
29 int SharedMemGetSize(int fd) in SharedMemGetSize() argument
31 return OHOS::AshmemGetSize(fd); in SharedMemGetSize()
/drivers/peripheral/audio/test/fuzztest/audio_config_fuzzer/audiocardconfig_fuzzer/
Daudiocardconfig_fuzzer.cpp35 int fd = mkstemp(tmpfile); in DoSomethingInterestingWithMyAPI() local
36 if (fd < 0) { in DoSomethingInterestingWithMyAPI()
39 write(fd, rawData, size); in DoSomethingInterestingWithMyAPI()
40 close(fd); in DoSomethingInterestingWithMyAPI()
/drivers/hdf_core/adapter/uhdf2/hdi/src/
Dbuffer_util.c34 handle->fd = -1; in AllocateNativeBufferHandle()
59 if (other->fd == -1) { in CloneNativeBufferHandle()
60 handle->fd = other->fd; in CloneNativeBufferHandle()
62 handle->fd = dup(other->fd); in CloneNativeBufferHandle()
63 if (handle->fd == -1) { in CloneNativeBufferHandle()
105 if (handle->fd != -1) { in FreeNativeBufferHandle()
106 close(handle->fd); in FreeNativeBufferHandle()
107 handle->fd = -1; in FreeNativeBufferHandle()
139 bool validFd = (handle->fd >= 0); in HdfSbufWriteNativeBufferHandle()
144 if (validFd && !HdfSbufWriteFileDescriptor(data, handle->fd)) { in HdfSbufWriteNativeBufferHandle()
[all …]
/drivers/peripheral/display/hdi_service/device/src/util/
Ddisplay_device_common.cpp240 bool DisplayDeviceWriteFileDescriptor(MessageParcel *parcel, const int32_t fd) in DisplayDeviceWriteFileDescriptor() argument
242 bool validFd = (fd >= 0); in DisplayDeviceWriteFileDescriptor()
247 if (validFd && !parcel->WriteFileDescriptor(fd)) { in DisplayDeviceWriteFileDescriptor()
257 bool DisplayDeviceReadFileDescriptor(int32_t *fd, MessageParcel *parcel) in DisplayDeviceReadFileDescriptor() argument
265 *fd = parcel->ReadFileDescriptor(); in DisplayDeviceReadFileDescriptor()
266 if (*fd == -1) { in DisplayDeviceReadFileDescriptor()
271 *fd = -1; in DisplayDeviceReadFileDescriptor()
277 bool DisplayDeviceWriteFileDescriptorArray(MessageParcel *parcel, const int *fd, uint32_t num) in DisplayDeviceWriteFileDescriptorArray() argument
280 DISPLAY_LOG("%{public}s(%{public}d), fence fd:%{public}d", __func__, __LINE__, fd[i]); in DisplayDeviceWriteFileDescriptorArray()
281 if (!DisplayDeviceWriteFileDescriptor(parcel, fd[i])) { in DisplayDeviceWriteFileDescriptorArray()
[all …]
/drivers/peripheral/audio/test/fuzztest/audio_config_fuzzer/pathselectconfig_fuzzer/
Dpathselectconfig_fuzzer.cpp39 int fd = mkstemp(tmpfile); in DoSomethingInterestingWithMyAPI() local
40 if (fd < 0) { in DoSomethingInterestingWithMyAPI()
43 write(fd, rawData, size); in DoSomethingInterestingWithMyAPI()
44 close(fd); in DoSomethingInterestingWithMyAPI()

12345678910