Lines Matching refs:zdev

39 static int zpci_set_airq(struct zpci_dev *zdev)  in zpci_set_airq()  argument
41 u64 req = ZPCI_CREATE_REQ(zdev->fh, 0, ZPCI_MOD_FC_REG_INT); in zpci_set_airq()
47 fib.fmt0.noi = airq_iv_end(zdev->aibv); in zpci_set_airq()
48 fib.fmt0.aibv = (unsigned long) zdev->aibv->vector; in zpci_set_airq()
50 fib.fmt0.aisb = (unsigned long) zpci_sbv->vector + (zdev->aisb/64)*8; in zpci_set_airq()
51 fib.fmt0.aisbo = zdev->aisb & 63; in zpci_set_airq()
57 static int zpci_clear_airq(struct zpci_dev *zdev) in zpci_clear_airq() argument
59 u64 req = ZPCI_CREATE_REQ(zdev->fh, 0, ZPCI_MOD_FC_DEREG_INT); in zpci_clear_airq()
72 static int zpci_set_directed_irq(struct zpci_dev *zdev) in zpci_set_directed_irq() argument
74 u64 req = ZPCI_CREATE_REQ(zdev->fh, 0, ZPCI_MOD_FC_REG_INT_D); in zpci_set_directed_irq()
79 fib.fmt1.noi = zdev->msi_nr_irqs; in zpci_set_directed_irq()
80 fib.fmt1.dibvo = zdev->msi_first_bit; in zpci_set_directed_irq()
86 static int zpci_clear_directed_irq(struct zpci_dev *zdev) in zpci_clear_directed_irq() argument
88 u64 req = ZPCI_CREATE_REQ(zdev->fh, 0, ZPCI_MOD_FC_DEREG_INT_D); in zpci_clear_directed_irq()
237 struct zpci_dev *zdev = to_zpci(pdev); in arch_setup_msi_irqs() local
245 zdev->aisb = -1UL; in arch_setup_msi_irqs()
246 zdev->msi_first_bit = -1U; in arch_setup_msi_irqs()
249 msi_vecs = min_t(unsigned int, nvec, zdev->max_msi); in arch_setup_msi_irqs()
261 zdev->aisb = bit; in arch_setup_msi_irqs()
264 zdev->aibv = airq_iv_create(msi_vecs, AIRQ_IV_DATA | AIRQ_IV_BITLOCK); in arch_setup_msi_irqs()
265 if (!zdev->aibv) in arch_setup_msi_irqs()
269 zpci_ibv[bit] = zdev->aibv; in arch_setup_msi_irqs()
298 msg.address_lo = zdev->msi_addr & 0xff0000ff; in arch_setup_msi_irqs()
305 msg.address_lo = zdev->msi_addr & 0xffffffff; in arch_setup_msi_irqs()
306 airq_iv_set_data(zdev->aibv, hwirq, irq); in arch_setup_msi_irqs()
308 msg.address_hi = zdev->msi_addr >> 32; in arch_setup_msi_irqs()
313 zdev->msi_first_bit = bit; in arch_setup_msi_irqs()
314 zdev->msi_nr_irqs = msi_vecs; in arch_setup_msi_irqs()
317 rc = zpci_set_directed_irq(zdev); in arch_setup_msi_irqs()
319 rc = zpci_set_airq(zdev); in arch_setup_msi_irqs()
328 struct zpci_dev *zdev = to_zpci(pdev); in arch_teardown_msi_irqs() local
334 rc = zpci_clear_directed_irq(zdev); in arch_teardown_msi_irqs()
336 rc = zpci_clear_airq(zdev); in arch_teardown_msi_irqs()
356 if (zdev->aisb != -1UL) { in arch_teardown_msi_irqs()
357 zpci_ibv[zdev->aisb] = NULL; in arch_teardown_msi_irqs()
358 airq_iv_free_bit(zpci_sbv, zdev->aisb); in arch_teardown_msi_irqs()
359 zdev->aisb = -1UL; in arch_teardown_msi_irqs()
361 if (zdev->aibv) { in arch_teardown_msi_irqs()
362 airq_iv_release(zdev->aibv); in arch_teardown_msi_irqs()
363 zdev->aibv = NULL; in arch_teardown_msi_irqs()
366 if ((irq_delivery == DIRECTED) && zdev->msi_first_bit != -1U) in arch_teardown_msi_irqs()
367 airq_iv_free(zpci_ibv[0], zdev->msi_first_bit, zdev->msi_nr_irqs); in arch_teardown_msi_irqs()