diff options
Diffstat (limited to 'src/drivers/net/mlx_ipoib/ib_mt23108.c')
| -rw-r--r-- | src/drivers/net/mlx_ipoib/ib_mt23108.c | 64 |
1 files changed, 18 insertions, 46 deletions
diff --git a/src/drivers/net/mlx_ipoib/ib_mt23108.c b/src/drivers/net/mlx_ipoib/ib_mt23108.c index d9261b9cd..ca3abb10d 100644 --- a/src/drivers/net/mlx_ipoib/ib_mt23108.c +++ b/src/drivers/net/mlx_ipoib/ib_mt23108.c @@ -92,12 +92,7 @@ static int find_mlx_bridge(__u8 hca_bus, __u8 * br_bus_p, __u8 * br_devfn_p) for (bus = 0; bus < 256; ++bus) { for (dev = 0; dev < 32; ++dev) { devfn = (dev << 3); - - struct pci_device tmp; - tmp.bus = bus; - tmp.devfn = devfn; - - rc = pcibios_read_config_word(&tmp, PCI_VENDOR_ID, + rc = pcibios_read_config_word(bus, devfn, PCI_VENDOR_ID, &vendor); if (rc) return rc; @@ -105,7 +100,7 @@ static int find_mlx_bridge(__u8 hca_bus, __u8 * br_bus_p, __u8 * br_devfn_p) if (vendor != MELLANOX_VENDOR_ID) continue; - rc = pcibios_read_config_word(&tmp, PCI_DEVICE_ID, + rc = pcibios_read_config_word(bus, devfn, PCI_DEVICE_ID, &dev_id); if (rc) return rc; @@ -113,7 +108,7 @@ static int find_mlx_bridge(__u8 hca_bus, __u8 * br_bus_p, __u8 * br_devfn_p) if (dev_id != TAVOR_BRIDGE_DEVICE_ID) continue; - rc = pcibios_read_config_byte(&tmp, + rc = pcibios_read_config_byte(bus, devfn, PCI_SECONDARY_BUS, &sec_bus); if (rc) @@ -166,7 +161,7 @@ static int ib_device_init(struct pci_device *dev) tavor_pci_dev.dev.dev = dev; tprintf(""); - if (dev->device == TAVOR_DEVICE_ID) { + if (dev->dev_id == TAVOR_DEVICE_ID) { rc = find_mlx_bridge(dev->bus, &br_bus, &br_devfn); if (rc) { @@ -180,12 +175,7 @@ static int ib_device_init(struct pci_device *dev) tprintf("bus=%d devfn=0x%x", br_bus, br_devfn); /* save config space */ for (i = 0; i < 64; ++i) { - - struct pci_device tmp; - tmp.bus = br_bus; - tmp.devfn = br_devfn; - - rc = pcibios_read_config_dword(&tmp, i << 2, + rc = pcibios_read_config_dword(br_bus, br_devfn, i << 2, &tavor_pci_dev.br. dev_config_space[i]); if (rc) { @@ -213,7 +203,7 @@ static int ib_device_init(struct pci_device *dev) eprintf(""); return -1; } - tprintf("uar_base (pa:va) = 0x%lx %p", + tprintf("uar_base (pa:va) = 0x%lx 0x%lx", tavor_pci_dev.dev.bar[2] + UAR_IDX * 0x1000, tavor_pci_dev.uar); tprintf(""); @@ -235,7 +225,7 @@ static int init_dev_data(void) dev_buffers_p = bus_to_virt(tmp); memreg_size = (__u32) (&memreg_size) - (__u32) dev_buffers_p; - tprintf("src_buf=%p, dev_buffers_p=%p, memreg_size=0x%lx", src_buf, + tprintf("src_buf=0x%lx, dev_buffers_p=0x%lx, memreg_size=0x%x", src_buf, dev_buffers_p, memreg_size); return 0; @@ -246,14 +236,10 @@ static int restore_config(void) int i; int rc; - if (tavor_pci_dev.dev.dev->device == TAVOR_DEVICE_ID) { + if (tavor_pci_dev.dev.dev->dev_id == TAVOR_DEVICE_ID) { for (i = 0; i < 64; ++i) { - - struct pci_device tmp; - tmp.bus = tavor_pci_dev.br.bus; - tmp.devfn = tavor_pci_dev.br.devfn; - - rc = pcibios_write_config_dword(&tmp, + rc = pcibios_write_config_dword(tavor_pci_dev.br.bus, + tavor_pci_dev.br.devfn, i << 2, tavor_pci_dev.br. dev_config_space[i]); @@ -565,9 +551,9 @@ static int setup_hca(__u8 port, void **eq_p) tprintf("fw_rev_major=%d", qfw.fw_rev_major); tprintf("fw_rev_minor=%d", qfw.fw_rev_minor); tprintf("fw_rev_subminor=%d", qfw.fw_rev_subminor); - tprintf("error_buf_start_h=0x%lx", qfw.error_buf_start_h); - tprintf("error_buf_start_l=0x%lx", qfw.error_buf_start_l); - tprintf("error_buf_size=%ld", qfw.error_buf_size); + tprintf("error_buf_start_h=0x%x", qfw.error_buf_start_h); + tprintf("error_buf_start_l=0x%x", qfw.error_buf_start_l); + tprintf("error_buf_size=%d", qfw.error_buf_size); } if (qfw.error_buf_start_h) { @@ -813,20 +799,6 @@ static int setup_hca(__u8 port, void **eq_p) return ret; } - -static int unset_hca(void) -{ - int rc = 0; - - if (!fw_fatal) { - rc = cmd_sys_dis(); - if (rc) - eprintf(""); - } - - return rc; -} - static void *get_inprm_buf(void) { return dev_buffers_p->inprm_buf; @@ -958,7 +930,7 @@ static int post_send_req(void *qph, void *wqeh, __u8 num_gather) __u32 *psrc, *pdst; __u32 nds; - tprintf("snd_wqe=%p, virt_to_bus(snd_wqe)=0x%lx", snd_wqe, + tprintf("snd_wqe=0x%lx, virt_to_bus(snd_wqe)=0x%lx", snd_wqe, virt_to_bus(snd_wqe)); memset(&dbell, 0, sizeof dbell); @@ -1082,7 +1054,7 @@ static int create_ipoib_qp(void **qp_pp, /* update data */ qp->rcv_wq[i].wqe_cont.qp = qp; qp->rcv_bufs[i] = ib_buffers.ipoib_rcv_buf[i]; - tprintf("rcv_buf=%p", qp->rcv_bufs[i]); + tprintf("rcv_buf=%lx", qp->rcv_bufs[i]); } /* init send queue WQEs list */ @@ -1415,7 +1387,7 @@ static int ib_poll_cq(void *cqh, struct ib_cqe_st *ib_cqe_p, u8 * num_cqes) eprintf("syndrome=0x%lx", EX_FLD(cqe.error_cqe, tavorprm_completion_with_error_st, syndrome)); - eprintf("wqe_addr=%p", wqe_p); + eprintf("wqe_addr=0x%lx", wqe_p); eprintf("wqe_size=0x%lx", EX_FLD(cqe.error_cqe, tavorprm_completion_with_error_st, wqe_size)); @@ -1544,7 +1516,7 @@ static struct recv_wqe_st *alloc_rcv_wqe(struct udqp_st *qp) wqe->mpointer[1].lkey = dev_ib_data.mkey; wqe->mpointer[1].byte_count = qp->rcv_buf_sz; - tprintf("rcv_buf=%p\n", qp->rcv_bufs[new_entry]); + tprintf("rcv_buf=%lx\n", qp->rcv_bufs[new_entry]); /* we do it only on the data segment since the control segment is always owned by HW */ @@ -1671,7 +1643,7 @@ static int poll_eq(struct ib_eqe_st *ib_eqe_p, __u8 * num_eqes) struct eq_st *eq = &dev_ib_data.eq; ptr = (__u32 *) (&(eq->eq_buf[eq->cons_idx])); - tprintf("cons)idx=%ld, addr(eqe)=%lx, val=0x%lx", eq->cons_idx, virt_to_bus(ptr), ptr[7]); + tprintf("cons)idx=%d, addr(eqe)=%x, val=0x%x", eq->cons_idx, virt_to_bus(ptr), ptr[7]); owner = (ptr[7] & 0x80000000) ? OWNER_HW : OWNER_SW; if (owner == OWNER_SW) { tprintf("got eqe"); |
