• Home
  • Raw
  • Download

Lines Matching refs:hSession

161     HSession hSession = hdcServer->MallocSession(true, CONN_USB, this);  in DetectMyNeed()  local
162 if (!hSession) { in DetectMyNeed()
166 hSession->connectKey = hUSB->serialNumber; in DetectMyNeed()
171 hdcServer->FreeSession(hSession->sessionId); in DetectMyNeed()
175 waitTimeDoCmd->data = hSession; in DetectMyNeed()
182 void HdcHostUSB::KickoutZombie(HSession hSession) in KickoutZombie() argument
184 HdcServer *ptrConnect = (HdcServer *)hSession->classInstance; in KickoutZombie()
185 HUSB hUSB = hSession->hUSB; in KickoutZombie()
187 … WRITE_LOG(LOG_WARN, "KickoutZombie devHandle:%p isDead:%d", hUSB->devHandle, hSession->isDead); in KickoutZombie()
194 ptrConnect->FreeSession(hSession->sessionId); in KickoutZombie()
322 void HdcHostUSB::UpdateUSBDaemonInfo(HUSB hUSB, HSession hSession, uint8_t connStatus) in UpdateUSBDaemonInfo() argument
330 di.hSession = hSession; in UpdateUSBDaemonInfo()
436 void HdcHostUSB::CancelUsbIo(HSession hSession) in CancelUsbIo() argument
438 WRITE_LOG(LOG_DEBUG, "HostUSB CancelUsbIo, ref:%u", uint32_t(hSession->ref)); in CancelUsbIo()
439 HUSB hUSB = hSession->hUSB; in CancelUsbIo()
463 HSession hSession = (HSession)stream->data; in UsbToHdcProtocol() local
464 unsigned int fd = hSession->dataFd[STREAM_MAIN]; in UsbToHdcProtocol()
537 int HdcHostUSB::SubmitUsbBio(HSession hSession, bool sendOrRecv, uint8_t *buf, int bufSize) in SubmitUsbBio() argument
539 HUSB hUSB = hSession->hUSB; in SubmitUsbBio()
574 void HdcHostUSB::BeginUsbRead(HSession hSession) in BeginUsbRead() argument
576 HUSB hUSB = hSession->hUSB; in BeginUsbRead()
579 ++hSession->ref; in BeginUsbRead()
581 std::thread([this, hSession, hUSB]() { in BeginUsbRead()
585 while (!hSession->isDead) { in BeginUsbRead()
589 childRet = SubmitUsbBio(hSession, false, hUSB->hostBulkIn.buf, nextReadSize); in BeginUsbRead()
594 …childRet = SendToHdcStream(hSession, reinterpret_cast<uv_stream_t *>(&hSession->dataPipe[STREAM_MA… in BeginUsbRead()
601 --hSession->ref; in BeginUsbRead()
604 server->FreeSession(hSession->sessionId); in BeginUsbRead()
643 int HdcHostUSB::SendUSBRaw(HSession hSession, uint8_t *data, const int length) in SendUSBRaw() argument
646 HdcSessionBase *server = reinterpret_cast<HdcSessionBase *>(hSession->classInstance); in SendUSBRaw()
647 ++hSession->ref; in SendUSBRaw()
648 ret = SubmitUsbBio(hSession, true, data, length); in SendUSBRaw()
651 CancelUsbIo(hSession); in SendUSBRaw()
652 hSession->hUSB->hostBulkOut.isShutdown = true; in SendUSBRaw()
653 server->FreeSession(hSession->sessionId); in SendUSBRaw()
655 --hSession->ref; in SendUSBRaw()
712 bool HdcHostUSB::ReadyForWorkThread(HSession hSession) in ReadyForWorkThread() argument
714 HdcUSBBase::ReadyForWorkThread(hSession); in ReadyForWorkThread()
719 HSession HdcHostUSB::ConnectDetectDaemon(const HSession hSession, const HDaemonInfo pdi) in ConnectDetectDaemon() argument
722 HUSB hUSB = hSession->hUSB; in ConnectDetectDaemon()
726 pServer->FreeSession(hSession->sessionId); in ConnectDetectDaemon()
731 UpdateUSBDaemonInfo(hUSB, hSession, STATUS_CONNECTED); in ConnectDetectDaemon()
732 BeginUsbRead(hSession); in ConnectDetectDaemon()
736 …:StartWorkThread(&pServer->loopMain, pServer->SessionWorkThread, Base::FinishWorkThread, hSession); in ConnectDetectDaemon()
738 while (hSession->childLoop.active_handles == 0) { in ConnectDetectDaemon()
742 Base::SendToPollFd(hSession->ctrlFd[STREAM_MAIN], ctrl.data(), ctrl.size()); in ConnectDetectDaemon()
743 return hSession; in ConnectDetectDaemon()