aboutsummaryrefslogtreecommitdiff
path: root/lib
AgeCommit message (Collapse)AuthorFilesLines
2019-10-03libmuser: add default noop_cb for config regionFelipe Franciosi1-1/+8
This got broken at some point and we missed it. If a device doesn't add capabilities then reading from the config region returns short and fails. Signed-off-by: Felipe Franciosi <felipe@nutanix.com>
2019-09-27merge FIXME commentsThanos Makatos1-2/+0
Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com>
2019-09-27update comment regading using local variableThanos Makatos1-1/+1
Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com>
2019-09-27use local variable for clarityThanos Makatos1-6/+6
Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com>
2019-09-27fix typosThanos Makatos2-3/+4
Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com>
2019-09-27clarify usage of lm_irq_triggerThanos Makatos1-2/+5
Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com>
2019-09-27don't omit number of bytes read from the standard PCI header when returning ↵Thanos Makatos1-17/+22
total number of bytes read Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com>
2019-09-27don't fail reads for capabilities that do not existThanos Makatos1-1/+1
Previously we failed reads for capabilities that do not exist, that is any read in region 0x40 and 0x100. It is s perfectly legitimate to read that part of the PCI config space even if there's nothing there, we just return zeros. Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com>
2019-09-27don't trigger INTx IRQ if it's disabledThanos Makatos1-0/+15
Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com>
2019-09-27print offset of bad access to capabilities using hexThanos Makatos1-1/+1
All other prints for offset use hex, so let's make it consistent. Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com>
2019-09-27make debug logging more configurableThanos Makatos3-0/+20
Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com>
2019-09-27add more debug messages when handling interruptsThanos Makatos1-0/+21
Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com>
2019-09-27add MSI-X capability headerThanos Makatos1-0/+70
Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com>
2019-09-27add some function documentationThanos Makatos2-0/+14
Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com>
2019-09-27fix order of MSI capability id and nextThanos Makatos1-1/+1
Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com>
2019-09-27add FIXME commentThanos Makatos1-0/+4
Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com>
2019-09-20remove unnecessary initialization of global pointerThanos Makatos1-1/+1
Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com>
2019-09-20stylistic correctionsThanos Makatos1-5/+4
Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com>
2019-09-20remove unused includeThanos Makatos1-1/+0
Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com>
2019-09-20remove unnecessary space around double #Thanos Makatos1-1/+1
Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com>
2019-09-20fix coding style violation rergarding curly bracketThanos Makatos1-34/+17
Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com>
2019-09-20don't unnecessarily initialize global variables to 0Thanos Makatos1-2/+2
Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com>
2019-09-20fix header orderThanos Makatos1-1/+2
Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com>
2019-09-20add license headerThanos Makatos1-0/+29
Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com>
2019-09-20add license header to files related to Python bindingsThanos Makatos2-0/+61
Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com>
2019-09-20experimental support for Python bindings plus sampleThanos Makatos4-0/+265
This patch introduces experimental support for Python bindings, plus the GPIO sample in Python. There are many issues with extending Python (from module stuff to error handling), the most important one is the inability to modify the buf argument to the region access callbacks when a region is read from. For now I've resorted to returning the value since in libmuser we limit accesses to 8 bytes (maybe we should consider that for the C API as well?). Also, the fact that we don't pass the region being accessed as an argument to a region access callback results in clunky code (see the REGION_WRAP macro). Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com>
2019-09-05Minor style fixesFelipe Franciosi3-23/+23
2019-09-05Clarifications around mucmd_mmapFelipe Franciosi1-44/+34
2019-09-05remove unnecessary loop for retrieving regionThanos Makatos4-27/+24
Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com>
2019-09-05destory context in lm_ctx_runThanos Makatos1-3/+7
Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com>
2019-09-05don't hardcode default PCI config space sizeThanos Makatos1-1/+1
Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com>
2019-09-05fix typoThanos Makatos1-1/+1
Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com>
2019-09-05don't hardcode region shiftThanos Makatos1-1/+3
Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com>
2019-09-05use default values for PCI config region if none specifiedThanos Makatos1-0/+12
Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com>
2019-09-05fix offset to (region ID) * (1 << 40)Thanos Makatos4-11/+16
Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com>
2019-09-05set IPIN if interrupts are used in dev_infoThanos Makatos1-2/+5
Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com>
2019-09-05introduce convenience function lm_ctx_runThanos Makatos2-6/+16
Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com>
2019-09-05log debug message when reset called w/o callbackThanos Makatos1-0/+2
Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com>
2019-09-05specify subsystem and subsystem vendor ID in dev_infoThanos Makatos2-6/+9
Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com>
2019-09-05log debug messages when configuring IRQ failsThanos Makatos1-2/+15
Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com>
2019-09-05log debug message when ILINE is modifiedThanos Makatos1-0/+1
Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com>
2019-09-05fix offset and size argument order in failed accessThanos Makatos1-2/+2
Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com>
2019-09-05log error message when region w/o callback is accessedThanos Makatos1-0/+2
Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com>
2019-09-05fix error message for bad readThanos Makatos1-1/+1
Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com>
2019-09-05muser, libmuser: make libmuser_{read,write} consistentSwapnil Ingle1-14/+7
Currently muser/libmuser_write() expects mucmd as buffer, while muser/libmuser_read() expects data buffer. We arleady have the mucmd in mudev->pending, so make muser/libmuser_write() to take data buffer instead of mucmd. This way libmuser_{read,write} are consistent and we do not use mucmd sent by user. Signed-off-by: Swapnil Ingle <swapnil.ingle@nutanix.com>
2019-09-05make doc re: error return val more readableThanos Makatos1-3/+3
Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com>
2019-09-05rename dma_scattergather_t to dma_sg_t to improve readabilityThanos Makatos4-16/+16
Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com>
2019-09-05remove redundant whitespaceThanos Makatos1-1/+1
Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com>
2019-09-05fix typosThanos Makatos1-2/+2
Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com>
2019-09-05move LM_DEV_XXX_IRQ_IDX closer to lm_pci_info_tThanos Makatos1-7/+7
Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com>