Changeset 37596 in vbox for trunk/src/VBox/Devices/USB/linux
- Timestamp:
- Jun 22, 2011 7:30:06 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/USB/linux/USBProxyDevice-linux.cpp
r35346 r37596 137 137 { 138 138 /** The open file. */ 139 RTFILE File;139 RTFILE hFile; 140 140 /** Critical section protecting the two lists. */ 141 141 RTCRITSECT CritSect; … … 194 194 do 195 195 { 196 rc = ioctl( pDevLnx->File, iCmd, pvArg);196 rc = ioctl(RTFileToNative(pDevLnx->hFile), iCmd, pvArg); 197 197 if (rc >= 0) 198 198 return rc; … … 236 236 pUrbLnx = pUrbLnx->pNext; 237 237 238 ioctl( pDevLnx->File, USBDEVFS_DISCARDURB, &pCur->KUrb); /* not sure if this is required.. */238 ioctl(RTFileToNative(pDevLnx->hFile), USBDEVFS_DISCARDURB, &pCur->KUrb); /* not sure if this is required.. */ 239 239 if (!pCur->KUrb.status) 240 240 pCur->KUrb.status = -ENODEV; … … 596 596 { 597 597 PUSBPROXYDEVLNX pDevLnx = (PUSBPROXYDEVLNX)pProxyDev->Backend.pv; 598 AssertReturn(pDevLnx-> File != NIL_RTFILE, -1);599 return pDevLnx->File;598 AssertReturn(pDevLnx->hFile != NIL_RTFILE, -1); 599 return RTFileToNative(pDevLnx->hFile); 600 600 } 601 601 … … 653 653 * Try open the device node. 654 654 */ 655 RTFILE File;656 int rc = RTFileOpen(& File, pszDevNode, RTFILE_O_READWRITE | RTFILE_O_OPEN | RTFILE_O_DENY_NONE);655 RTFILE hFile; 656 int rc = RTFileOpen(&hFile, pszDevNode, RTFILE_O_READWRITE | RTFILE_O_OPEN | RTFILE_O_DENY_NONE); 657 657 if (RT_SUCCESS(rc)) 658 658 { … … 666 666 memcpy(&pDevLnx->szPath[0], pszPath, cchPath); 667 667 pDevLnx->szPath[cchPath] = '\0'; 668 pDevLnx-> File =File;668 pDevLnx->hFile = hFile; 669 669 rc = RTCritSectInit(&pDevLnx->CritSect); 670 670 if (RT_SUCCESS(rc)) … … 672 672 pProxyDev->Backend.pv = pDevLnx; 673 673 674 LogFlow(("usbProxyLinuxOpen(%p, %s): returns successfully File=% diActiveCfg=%d\n",675 pProxyDev, pszAddress, pDevLnx-> File, pProxyDev->iActiveCfg));674 LogFlow(("usbProxyLinuxOpen(%p, %s): returns successfully File=%RTfile iActiveCfg=%d\n", 675 pProxyDev, pszAddress, pDevLnx->hFile, pProxyDev->iActiveCfg)); 676 676 677 677 return VINF_SUCCESS; … … 682 682 else 683 683 rc = VERR_NO_MEMORY; 684 RTFileClose( File);684 RTFileClose(hFile); 685 685 } 686 686 else if (rc == VERR_ACCESS_DENIED) … … 812 812 } 813 813 814 RTFileClose(pDevLnx-> File);815 pDevLnx-> File = NIL_RTFILE;814 RTFileClose(pDevLnx->hFile); 815 pDevLnx->hFile = NIL_RTFILE; 816 816 817 817 RTMemFree(pDevLnx); … … 1278 1278 unsigned cTries = 0; 1279 1279 1280 while (ioctl( pDevLnx->File, USBDEVFS_SUBMITURB, &pCur->KUrb))1280 while (ioctl(RTFileToNative(pDevLnx->hFile), USBDEVFS_SUBMITURB, &pCur->KUrb)) 1281 1281 { 1282 1282 if (errno == EINTR) … … 1516 1516 */ 1517 1517 cTries = 0; 1518 while (ioctl( pDevLnx->File, USBDEVFS_SUBMITURB, &pUrbLnx->KUrb))1518 while (ioctl(RTFileToNative(pDevLnx->hFile), USBDEVFS_SUBMITURB, &pUrbLnx->KUrb)) 1519 1519 { 1520 1520 if (errno == EINTR) … … 1760 1760 { 1761 1761 struct pollfd pfd; 1762 int rc; 1763 1764 pfd.fd = pDevLnx->File; 1762 pfd.fd = RTFileToNative(pDevLnx->hFile); 1765 1763 pfd.events = POLLOUT | POLLWRNORM /* completed async */ 1766 1764 | POLLERR | POLLHUP /* disconnected */; 1767 1765 pfd.revents = 0; 1768 rc = poll(&pfd, 1, cMillies);1766 int rc = poll(&pfd, 1, cMillies); 1769 1767 Log(("usbProxyLinuxUrbReap: poll rc = %d\n", rc)); 1770 1768 if (rc >= 1) … … 1790 1788 { 1791 1789 struct usbdevfs_urb *pKUrb; 1792 while (ioctl( pDevLnx->File, USBDEVFS_REAPURBNDELAY, &pKUrb))1790 while (ioctl(RTFileToNative(pDevLnx->hFile), USBDEVFS_REAPURBNDELAY, &pKUrb)) 1793 1791 if (errno != EINTR) 1794 1792 {
Note:
See TracChangeset
for help on using the changeset viewer.