Commit 77e9b9cb authored by Vikram Narayanan's avatar Vikram Narayanan

lcd/ixgbe: Enable DMA query during probe

Pass dma_mask and other ref pointer as well
Signed-off-by: Vikram Narayanan's avatarVikram Narayanan <vikram186@gmail.com>
parent 125d6e7e
......@@ -387,6 +387,7 @@ fail_ipc:
/* FIXME: Handle this without extern */
extern struct pci_driver_container ixgbe_driver_container;
u64 dma_mask = 0;
int probe_callee(struct fipc_message *_request,
struct thc_channel *_channel,
......@@ -398,6 +399,8 @@ int probe_callee(struct fipc_message *_request,
unsigned int request_cookie;
int func_ret;
int ret = 0;
cptr_t other_ref;
#ifdef PCI_REGIONS
cptr_t res0_cptr;
gpa_t gpa_addr;
......@@ -407,6 +410,8 @@ int probe_callee(struct fipc_message *_request,
LIBLCD_MSG("%s called", __func__);
request_cookie = thc_get_request_cookie(_request);
dma_mask = fipc_get_reg2(_request);
other_ref.cptr = fipc_get_reg1(_request);
fipc_recv_msg_end(thc_channel_to_fipc(_channel),
_request);
......@@ -427,6 +432,8 @@ int probe_callee(struct fipc_message *_request,
dev_container->pci_dev.dev.kobj.name = "ixgbe_lcd";
dev_container->pci_dev.vendor = 0x8086;
dev_container->pci_dev.device = 0x154D;
dev_container->other_ref = other_ref;
dev_container->pci_dev.dev.dma_mask = &dma_mask;
#ifdef PCI_REGIONS
ret = lcd_cptr_alloc(&res0_cptr);
if (ret) {
......@@ -1567,8 +1574,7 @@ int pci_enable_device_mem(struct pci_dev *dev)
return func_ret;
fail_async:
fail_ipc:
return ret;
return func_ret;
}
int pci_request_selected_regions(struct pci_dev *dev,
......
......@@ -9511,7 +9511,6 @@ static int ixgbe_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
if (err)
return err;
#ifdef LCD_IXGBE_DMA
if (!dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(64))) {
pci_using_dac = 1;
} else {
......@@ -9523,7 +9522,7 @@ static int ixgbe_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
}
pci_using_dac = 0;
}
#endif
err = pci_request_mem_regions(pdev, ixgbe_driver_name);
if (err) {
dev_err(&pdev->dev,
......@@ -9941,9 +9940,7 @@ err_ioremap:
err_alloc_etherdev:
pci_release_mem_regions(pdev);
err_pci_reg:
#ifndef LCD_ISOLATE
err_dma:
#endif
if (!adapter || disable_dev)
pci_disable_device(pdev);
return err;
......
......@@ -502,6 +502,8 @@ int probe(struct pci_dev *dev,
PROBE);
fipc_set_reg1(_request,
dev_container->my_ref.cptr);
fipc_set_reg2(_request,
*dev->dev.dma_mask);
#ifdef PCI_REGIONS
ret = thc_ipc_send_request(hidden_args->async_chnl,
......@@ -1933,4 +1935,4 @@ int trigger_exit_to_lcd(struct thc_channel *_channel)
fail_async:
fail_ipc:
return ret;
}
\ No newline at end of file
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment