Home
last modified time | relevance | path

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

12345678910>>...12

/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 == %{public}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 void HosV4L2Control::V4L2VidiocSCtrl (int fd, int ret, struct v4l2_ext_control* cList, int count) in V4L2VidiocSCtrl() argument
30 ret = ioctl(fd, VIDIOC_S_CTRL, &ctrl); in V4L2VidiocSCtrl()
39 RetCode HosV4L2Control::V4L2SetCtrls (int fd, std::vector<DeviceControl>& control, const int numCon… in V4L2SetCtrls() argument
43 CAMERA_LOGI("HosV4L2Control::V4L2SetCtrls in fd %{public}d\n", fd); in V4L2SetCtrls()
65 ret = ioctl(fd, VIDIOC_S_EXT_CTRLS, &ctrls); in V4L2SetCtrls()
67 V4L2VidiocSCtrl(fd, ret, cList, count); in V4L2SetCtrls()
71 CAMERA_LOGI("HosV4L2Control::V4L2SetCtrls out fd %{public}d\n", fd); in V4L2SetCtrls()
75 void HosV4L2Control::V4L2VidiocGExtCtrls (int fd, int ret, int &count, in V4L2VidiocGExtCtrls() argument
84 ret = ioctl(fd, VIDIOC_G_CTRL, &ctrl); in V4L2VidiocGExtCtrls()
100 RetCode HosV4L2Control::V4L2GetCtrls (int fd, std::vector<DeviceControl>& control, const int numCon… in V4L2GetCtrls() argument
[all …]
Dv4l2_fileformat.cpp24 void HosFileFormat::V4L2GetCurrentFormat(int fd, std::vector<DeviceFormat>& fmtDesc, in V4L2GetCurrentFormat() argument
34 if (ioctl(fd, VIDIOC_ENUM_FRAMEINTERVALS, &fraMival) < 0) { in V4L2GetCurrentFormat()
53 RetCode HosFileFormat::V4L2SearchFormat(int fd, std::vector<DeviceFormat>& fmtDesc) in V4L2SearchFormat() argument
64 if (ioctl(fd, VIDIOC_ENUM_FMT, &enumFmtDesc) < 0) { in V4L2SearchFormat()
73 if (ioctl(fd, VIDIOC_ENUM_FRAMESIZES, &frmSize) < 0) { in V4L2SearchFormat()
82 V4L2GetCurrentFormat(fd, fmtDesc, frmSize, enumFmtDesc); in V4L2SearchFormat()
94 RetCode HosFileFormat::V4L2GetFmtDescs(int fd, std::vector<DeviceFormat>& fmtDesc) in V4L2GetFmtDescs() argument
100 if (fd < 0) { in V4L2GetFmtDescs()
105 V4L2SearchBufType(fd); in V4L2GetFmtDescs()
111 rc = V4L2SearchFormat(fd, fmtDesc); in V4L2GetFmtDescs()
[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()
Dv4l2_buffer.cpp36 RetCode ioctlWrapper(int fd, uint32_t buffCont, uint32_t buffType, uint32_t memoryType) in ioctlWrapper() argument
47 if (ioctl(fd, VIDIOC_REQBUFS, &req) < 0) { in ioctlWrapper()
60 if (ioctl(fd, VIDIOC_REQBUFS, &req) < 0) { in ioctlWrapper()
76 RetCode HosV4L2Buffers::V4L2ReqBuffers(int fd, int unsigned buffCont) in V4L2ReqBuffers() argument
80 auto executeRet = executor.Execute(result, fd, buffCont, bufferType_, memoryType_); in V4L2ReqBuffers()
91 RetCode HosV4L2Buffers::V4L2QueueBuffer(int fd, const std::shared_ptr<FrameSpec>& frameSpec) in V4L2QueueBuffer() argument
95 CAMERA_LOGI("HosV4L2Buffers V4L2QueueBuffer in fd: %{public}d\n", fd); in V4L2QueueBuffer()
107 int rc = ioctl(fd, VIDIOC_QBUF, &buf); in V4L2QueueBuffer()
113 auto itr = queueBuffers_.find(fd); in V4L2QueueBuffer()
116 CAMERA_LOGI("insert frameMap fd = %{public}d buf.index = %{public}d\n", fd, buf.index); in V4L2QueueBuffer()
[all …]
/drivers/peripheral/camera/vdi_base/common/adapter/platform/v4l2/src/driver_adapter/include/
Dv4l2_control.h35 void V4L2VidiocSCtrl (int fd, int ret, struct v4l2_ext_control* cList, int count);
36 RetCode V4L2GetCtrl(int fd, unsigned int id, int& value);
37 RetCode V4L2SetCtrl(int fd, unsigned int id, int value);
38 RetCode V4L2GetControls(int fd, std::vector<DeviceControl>& control);
39 RetCode V4L2SetCtrls(int fd, std::vector<DeviceControl>& control, const int numControls);
40 void V4L2VidiocGExtCtrls (int fd, int ret, int &count,
42 RetCode V4L2GetCtrls(int fd, std::vector<DeviceControl>& control, const int numControls);
45 void V4L2SetValue(int fd, std::vector<DeviceControl>& control, DeviceControl& ctrl,
47 int ExtControl(int fd, struct v4l2_queryctrl *ctrl);
48 void V4L2EnumExtControl(int fd, v4l2_queryctrl &qCtrl, DeviceControl &ctrl);
[all …]
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, const std::string& cameraId);
51 void V4L2GetCurrentFormat(int fd, std::vector<DeviceFormat>& fmtDesc,
[all …]
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/interface/display/composer/hdifd_parcelable/
Dhdifd_parcelable.cpp37 HdifdParcelable::HdifdParcelable(int32_t fd) in HdifdParcelable() argument
38 : isOwner_(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()
102 int fd = descriptor->GetFd(); in ReadFileDescriptor() local
103 if (fd < 0) { in ReadFileDescriptor()
[all …]
/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/peripheral/display/composer/vdi_base/src/
Dhdi_netlink_monitor.cpp51 int fd = -1; in ThreadInit() local
59 fd = socket(PF_NETLINK, SOCK_DGRAM, NETLINK_KOBJECT_UEVENT); in ThreadInit()
60 DISPLAY_CHK_RETURN(fd < 0, DISPLAY_FAILURE, DISPLAY_LOGE("socket fail")); in ThreadInit()
61 ret = setsockopt(fd, SOL_SOCKET, SO_RCVBUF, &bufferSize, sizeof(bufferSize)); in ThreadInit()
64 close(fd); in ThreadInit()
67 ret = bind(fd, reinterpret_cast<struct sockaddr *>(&snl), sizeof(struct sockaddr_nl)); in ThreadInit()
70 close(fd); in ThreadInit()
73 return fd; in ThreadInit()
97 int fd = -1; in MonitorThread() local
99 fd = ThreadInit(); in MonitorThread()
[all …]
/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.cpp77 int32_t PartitionSlotManager::WriteSlot(int fd, int32_t slot, off_t offset, off_t size) in WriteSlot() argument
79 if (lseek(fd, offset, SEEK_SET) < 0) { in WriteSlot()
84 if (write(fd, &slot, size) != size) { in WriteSlot()
93 int fd = open(MISC_DEVICE_NODE, O_RDWR | O_CLOEXEC, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH); in ReadMisc() local
94 if (fd < 0) { in ReadMisc()
97 if (lseek(fd, offset, SEEK_SET) < 0) { in ReadMisc()
99 close(fd); in ReadMisc()
103 if (read(fd, &slot, size) != size) { in ReadMisc()
105 close(fd); in ReadMisc()
109 close(fd); in ReadMisc()
[all …]
/drivers/peripheral/bluetooth/hci/hdi_service/implement/
Dh4_protocol.cpp33 …int fd, HciDataCallback onAclReceive, HciDataCallback onScoReceive, HciDataCallback onEventReceive) in H4Protocol() argument
34 …: hciFd_(fd), onAclReceive_(onAclReceive), onScoReceive_(onScoReceive), onEventReceive_(onEventRec… in H4Protocol()
59 void H4Protocol::ReadData(int fd) in ReadData() argument
65 readLen = Read(fd, &packetType_, sizeof(packetType_)); in ReadData()
67 HDF_LOGE("read fd[%d]", fd); in ReadData()
70 HDF_LOGE("read fd[%d] readLen = 0.", fd); in ReadData()
78 readLen = Read(fd, hciPacket_.data() + readLength_, hciPacket_.size() - readLength_); in ReadData()
81 HDF_LOGE("read fd[%d] err:%s", fd, buf); in ReadData()
84 HDF_LOGE("read fd[%d] readLen = 0.", fd); in ReadData()
97 readLen = Read(fd, hciPacket_.data() + readLength_, hciPacket_.size() - readLength_); in ReadData()
[all …]
Dmct_protocol.cpp56 void MctProtocol::ReadEventData(int fd) in ReadEventData() argument
62 …readLen = Read(fd, eventPacket_.data() + eventReadLength_, eventPacket_.size() - eventReadLength_); in ReadEventData()
65 HDF_LOGE("read fd[%d] err:%s", fd, buf); in ReadEventData()
68 HDF_LOGE("read fd[%d] readLen = 0.", fd); in ReadEventData()
79 …readLen = Read(fd, eventPacket_.data() + eventReadLength_, eventPacket_.size() - eventReadLength_); in ReadEventData()
82 HDF_LOGE("read fd[%d] err:%s", fd, buf); in ReadEventData()
85 HDF_LOGE("read fd[%d] readLen = 0.", fd); in ReadEventData()
102 void MctProtocol::ReadAclData(int fd) in ReadAclData() argument
108 readLen = Read(fd, aclPacket_.data() + aclReadLength_, aclPacket_.size() - aclReadLength_); in ReadAclData()
111 HDF_LOGE("read fd[%d] err:%s", fd, buf); in ReadAclData()
[all …]
Dhci_watcher.cpp41 bool HciWatcher::AddFdToWatcher(int fd, HciDataCallback callback) in AddFdToWatcher() argument
44 fds_[fd] = callback; in AddFdToWatcher()
49 bool HciWatcher::RemoveFdToWatcher(int fd) in RemoveFdToWatcher() argument
52 fds_.erase(fd); in RemoveFdToWatcher()
123 for (auto &&fd : fds_) { in WatcherThread()
124 FD_SET(fd.first, &readFds); in WatcherThread()
125 nfds = std::max(fd.first, nfds); in WatcherThread()
156 for (auto &&fd : fds_) { in WatcherThread()
157 if (FD_ISSET(fd.first, &readFds)) { in WatcherThread()
158 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()
/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/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/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/peripheral/input/libinput/src/
Dinput_interface_device_info.cpp75 int32_t fd; in __anon3f83c6760102() local
77 fd = open(realPath, flags); in __anon3f83c6760102()
78 if (fd >= 0) { in __anon3f83c6760102()
84 …_LOGI("Libinput .open_restricted path:%{public}s,fd:%{public}d,errno:%{public}d", path, fd, errNo); in __anon3f83c6760102()
85 return fd < 0 ? -1 : fd; in __anon3f83c6760102()
87 .close_restricted = [](int32_t fd, void *user_data)
89 HDF_LOGI("Libinput .close_restricted fd:%{public}d", fd); in __anon3f83c6760202()
90 close(fd); in __anon3f83c6760202()
112 int32_t fd = open(path.c_str(), O_RDWR); in IsDeviceSupported() local
113 if (fd < 0) { in IsDeviceSupported()
[all …]

12345678910>>...12