1507
* Host queue pair support for earlier kernels temporarily
1508
* disabled. See bug 365496.
1511
ASSERT_NOT_IMPLEMENTED(FALSE);
1513
attach->produceIoBuf = VMCI_AllocKernelMem(sizeof *attach->produceIoBuf,
1514
VMCI_MEMORY_NORMAL);
1515
if (attach->produceIoBuf == NULL) {
1516
return VMCI_ERROR_NO_MEM;
1519
attach->consumeIoBuf = VMCI_AllocKernelMem(sizeof *attach->consumeIoBuf,
1520
VMCI_MEMORY_NORMAL);
1521
if (attach->consumeIoBuf == NULL) {
1522
VMCI_FreeKernelMem(attach->produceIoBuf,
1523
sizeof *attach->produceIoBuf);
1524
return VMCI_ERROR_NO_MEM;
1527
retval = map_user_kiobuf(WRITE, attach->produceIoBuf,
1528
(VA)attach->produceBuffer,
1529
attach->numProducePages * PAGE_SIZE);
1531
err = VMCI_ERROR_NO_ACCESS;
1535
retval = map_user_kiobuf(WRITE, attach->consumeIoBuf,
1536
(VA)attach->consumeBuffer,
1537
attach->numConsumePages * PAGE_SIZE);
1539
unmap_kiobuf(attach->produceIoBuf);
1540
err = VMCI_ERROR_NO_ACCESS;
1543
if (err == VMCI_SUCCESS) {
1544
produceQ->queueHeaderPtr = kmap(attach->produceIoBuf->maplist[0]);
1545
produceQ->page = &attach->produceIoBuf->maplist[1];
1546
consumeQ->queueHeaderPtr = kmap(attach->consumeIoBuf->maplist[0]);
1547
consumeQ->page = &attach->consumeIoBuf->maplist[1];
1552
if (err < VMCI_SUCCESS) {
1553
if (attach->produceIoBuf != NULL) {
1554
VMCI_FreeKernelMem(attach->produceIoBuf,
1555
sizeof *attach->produceIoBuf);
1557
if (attach->consumeIoBuf != NULL) {
1558
VMCI_FreeKernelMem(attach->consumeIoBuf,
1559
sizeof *attach->consumeIoBuf);
1564
#else // 0 -- Instead just return FALSE
1567
#endif // Linux version >= 2.6.0
1590
1529
VMCIQueue *produceQ, // OUT
1591
1530
VMCIQueue *consumeQ) // OUT
1594
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 0)
1597
1534
ASSERT(attach->producePages);
1620
1557
VMCI_FreeKernelMem(attach->consumePages,
1621
1558
attach->numConsumePages *
1622
1559
sizeof attach->consumePages[0]);
1625
* Host queue pair support for earlier kernels temporarily
1626
* disabled. See bug 365496.
1629
ASSERT_NOT_IMPLEMENTED(FALSE);
1631
kunmap(attach->produceIoBuf->maplist[0]);
1632
kunmap(attach->consumeIoBuf->maplist[0]);
1634
mark_dirty_kiobuf(attach->produceIoBuf,
1635
attach->numProducePages * PAGE_SIZE);
1636
unmap_kiobuf(attach->produceIoBuf);
1638
mark_dirty_kiobuf(attach->consumeIoBuf,
1639
attach->numConsumePages * PAGE_SIZE);
1640
unmap_kiobuf(attach->consumeIoBuf);
1642
VMCI_FreeKernelMem(attach->produceIoBuf,
1643
sizeof *attach->produceIoBuf);
1644
VMCI_FreeKernelMem(attach->consumeIoBuf,
1645
sizeof *attach->consumeIoBuf);
1562
#endif /* Host only code */