Changeset 6280 in vbox for trunk/src/VBox/Additions/linux/module
- Timestamp:
- Jan 8, 2008 2:19:00 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/linux/module/vboxmod.c
r6279 r6280 313 313 314 314 /** 315 * IOCtl handler. Control the interrupt filter mask to specify which VMMDev interrupts 316 * we know how to handle. 317 * 318 * @returns iprt status code 319 * @param pInfo kernel space pointer to the filter mask change info 320 */ 321 static int vboxadd_control_filter_mask(VBoxGuestFilterMaskInfo *pInfo) 322 { 323 VMMDevCtlGuestFilterMask *pReq; 324 int rc = VbglGRAlloc((VMMDevRequestHeader **)&pReq, sizeof(*pReq), VMMDevReq_CtlGuestFilterMask); 325 if (RT_FAILURE(rc)) 326 { 327 Log(("VBoxGuestCommonIOCtl: CTL_FILTER_MASK: failed to allocate %u (%#x) bytes to cache the request. rc=%d!!\n", 328 sizeof(*pReq), sizeof(*pReq), rc)); 329 return rc; 330 } 331 332 pReq->u32OrMask = pInfo->u32OrMask; 333 pReq->u32NotMask = pInfo->u32NotMask; 334 335 rc = VbglGRPerform(&pReq->header); 336 if (RT_FAILURE(rc)) 337 Log(("VBoxGuestCommonIOCtl: CTL_FILTER_MASK: VbglGRPerform failed, rc=%Rrc!\n", rc)); 338 else if (RT_FAILURE(pReq->header.rc)) 339 { 340 Log(("VBoxGuestCommonIOCtl: CTL_FILTER_MASK: The request failed; VMMDev rc=%Rrc!\n", pReq->header.rc)); 341 rc = pReq->header.rc; 342 } 343 344 VbglGRFree(&pReq->header); 345 return rc; 346 } 347 348 /** 315 349 * IOCTL handler 316 350 * … … 446 480 break; 447 481 482 case VBOXGUEST_IOCTL_CTL_FILTER_MASK: 483 { 484 VBoxGuestFilterMaskInfo info; 485 if (copy_to_user((void*)arg, (void*)&info, sizeof(info))) 486 { 487 LogRelFunc(("VBOXGUEST_IOCTL_CTL_FILTER_MASK: error getting parameters from user space!\n")); 488 rc = -EFAULT; 489 break; 490 } 491 rc = -RTErrConvertToErrno(vboxadd_control_filter_mask(&info)); 492 break; 493 } 448 494 default: 449 495 LogRelFunc(("unknown command: %x\n", cmd));
Note:
See TracChangeset
for help on using the changeset viewer.