Commit ae70c9ae authored by Pat Gefre's avatar Pat Gefre Committed by David Mosberger

[PATCH] ia64: add "platform_data" to struct pci_controller, update SN2 accordingly

Here's a small mod for Altix. It breaks up our 'pci fixup' function and
has some other smallish clean ups.

For the ia64 crowd I've added 'platform_data' to struct pci_controller.
parent 30c21ff9
This diff is collapsed.
......@@ -127,7 +127,7 @@ sn_pci_alloc_consistent(struct pci_dev *hwdev, size_t size, dma_addr_t *dma_hand
/*
* Get hwgraph vertex for the device
*/
device_sysdata = (struct sn_device_sysdata *) hwdev->sysdata;
device_sysdata = SN_DEVICE_SYSDATA(hwdev);
vhdl = device_sysdata->vhdl;
/*
......@@ -240,7 +240,7 @@ sn_pci_map_sg(struct pci_dev *hwdev, struct scatterlist *sg, int nents, int dire
/*
* Get the hwgraph vertex for the device
*/
device_sysdata = (struct sn_device_sysdata *) hwdev->sysdata;
device_sysdata = SN_DEVICE_SYSDATA(hwdev);
vhdl = device_sysdata->vhdl;
/*
......@@ -367,7 +367,7 @@ sn_pci_map_single(struct pci_dev *hwdev, void *ptr, size_t size, int direction)
/*
* find vertex for the device
*/
device_sysdata = (struct sn_device_sysdata *)hwdev->sysdata;
device_sysdata = SN_DEVICE_SYSDATA(hwdev);
vhdl = device_sysdata->vhdl;
/*
......
......@@ -90,10 +90,15 @@ pic_bus1_widget_info_dup(vertex_hdl_t conn_v, vertex_hdl_t peer_conn_v,
peer_widget_info->w_efunc = 0;
peer_widget_info->w_einfo = 0;
peer_widget_info->w_name = kmalloc(strlen(peer_path) + 1, GFP_KERNEL);
if (!peer_widget_info->w_name) {
kfree(peer_widget_info);
return -ENOMEM;
}
strcpy(peer_widget_info->w_name, peer_path);
if (hwgraph_info_add_LBL(peer_conn_v, INFO_LBL_XWIDGET,
(arbitrary_info_t)peer_widget_info) != GRAPH_SUCCESS) {
kfree(peer_widget_info->w_name);
kfree(peer_widget_info);
return 0;
}
......@@ -359,6 +364,9 @@ pic_attach2(vertex_hdl_t xconn_vhdl, void *bridge,
s = dev_to_name(pcibr_vhdl, devnm, MAXDEVNAME);
pcibr_soft->bs_name = kmalloc(strlen(s) + 1, GFP_KERNEL);
if (!pcibr_soft->bs_name)
return -ENOMEM;
strcpy(pcibr_soft->bs_name, s);
pcibr_soft->bs_conn = xconn_vhdl;
......
......@@ -97,6 +97,8 @@ struct pci_controller {
unsigned int windows;
struct pci_window *window;
void *platform_data;
};
#define PCI_CONTROLLER(busdev) ((struct pci_controller *) busdev->sysdata)
......
......@@ -31,22 +31,26 @@
#define MAX_PCI_XWIDGET 256
#define MAX_ATE_MAPS 1024
#define SN_DEVICE_SYSDATA(dev) \
((struct sn_device_sysdata *) \
(((struct pci_controller *) ((dev)->sysdata))->platform_data))
#define IS_PCI32G(dev) ((dev)->dma_mask >= 0xffffffff)
#define IS_PCI32L(dev) ((dev)->dma_mask < 0xffffffff)
#define PCIDEV_VERTEX(pci_dev) \
(((struct sn_device_sysdata *)((pci_dev)->sysdata))->vhdl)
#define PCIBUS_VERTEX(pci_bus) \
(((struct sn_widget_sysdata *)((pci_bus)->sysdata))->vhdl)
((SN_DEVICE_SYSDATA(pci_dev))->vhdl)
struct sn_widget_sysdata {
vertex_hdl_t vhdl;
};
struct sn_device_sysdata {
vertex_hdl_t vhdl;
vertex_hdl_t vhdl;
pciio_provider_t *pci_provider;
pciio_intr_t intr_handle;
struct sn_flush_device_list *dma_flush_list;
pciio_piomap_t pio_map[PCI_ROM_RESOURCE];
};
struct ioports_to_tlbs_s {
......
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