Lines Matching refs:irq_ptr

91 void qdio_free_queues(struct qdio_irq *irq_ptr)  in qdio_free_queues()  argument
93 __qdio_free_queues(irq_ptr->input_qs, irq_ptr->max_input_qs); in qdio_free_queues()
94 irq_ptr->max_input_qs = 0; in qdio_free_queues()
96 __qdio_free_queues(irq_ptr->output_qs, irq_ptr->max_output_qs); in qdio_free_queues()
97 irq_ptr->max_output_qs = 0; in qdio_free_queues()
123 int qdio_allocate_qs(struct qdio_irq *irq_ptr, int nr_input_qs, int nr_output_qs) in qdio_allocate_qs() argument
127 rc = __qdio_allocate_qs(irq_ptr->input_qs, nr_input_qs); in qdio_allocate_qs()
131 rc = __qdio_allocate_qs(irq_ptr->output_qs, nr_output_qs); in qdio_allocate_qs()
133 __qdio_free_queues(irq_ptr->input_qs, nr_input_qs); in qdio_allocate_qs()
137 irq_ptr->max_input_qs = nr_input_qs; in qdio_allocate_qs()
138 irq_ptr->max_output_qs = nr_output_qs; in qdio_allocate_qs()
142 static void setup_queues_misc(struct qdio_q *q, struct qdio_irq *irq_ptr, in setup_queues_misc() argument
151 q->irq_ptr = irq_ptr; in setup_queues_misc()
157 static void setup_storage_lists(struct qdio_q *q, struct qdio_irq *irq_ptr, in setup_storage_lists() argument
172 prev = (q->is_input_q) ? irq_ptr->input_qs[i - 1] in setup_storage_lists()
173 : irq_ptr->output_qs[i - 1]; in setup_storage_lists()
185 static void setup_queues(struct qdio_irq *irq_ptr, in setup_queues() argument
191 for_each_input_queue(irq_ptr, q, i) { in setup_queues()
193 setup_queues_misc(q, irq_ptr, qdio_init->input_handler, i); in setup_queues()
197 setup_storage_lists(q, irq_ptr, in setup_queues()
201 for_each_output_queue(irq_ptr, q, i) { in setup_queues()
203 setup_queues_misc(q, irq_ptr, qdio_init->output_handler, i); in setup_queues()
206 setup_storage_lists(q, irq_ptr, in setup_queues()
211 static void check_and_setup_qebsm(struct qdio_irq *irq_ptr, in check_and_setup_qebsm() argument
214 if (!(irq_ptr->qib.rflags & QIB_RFLAGS_ENABLE_QEBSM)) in check_and_setup_qebsm()
220 irq_ptr->sch_token = token; in check_and_setup_qebsm()
223 DBF_EVENT("%8lx", irq_ptr->sch_token); in check_and_setup_qebsm()
227 irq_ptr->sch_token = 0; in check_and_setup_qebsm()
228 irq_ptr->qib.rflags &= ~QIB_RFLAGS_ENABLE_QEBSM; in check_and_setup_qebsm()
236 int qdio_setup_get_ssqd(struct qdio_irq *irq_ptr, in qdio_setup_get_ssqd() argument
244 if (!irq_ptr) { in qdio_setup_get_ssqd()
249 ssqd = (struct chsc_ssqd_area *)irq_ptr->chsc_page; in qdio_setup_get_ssqd()
265 if (!irq_ptr) in qdio_setup_get_ssqd()
271 void qdio_setup_ssqd_info(struct qdio_irq *irq_ptr) in qdio_setup_ssqd_info() argument
276 rc = qdio_setup_get_ssqd(irq_ptr, &irq_ptr->schid, &irq_ptr->ssqd_desc); in qdio_setup_ssqd_info()
278 DBF_ERROR("%4x ssqd ERR", irq_ptr->schid.sch_no); in qdio_setup_ssqd_info()
284 qdioac = irq_ptr->ssqd_desc.qdioac1; in qdio_setup_ssqd_info()
286 check_and_setup_qebsm(irq_ptr, qdioac, irq_ptr->ssqd_desc.sch_token); in qdio_setup_ssqd_info()
287 irq_ptr->qdioac1 = qdioac; in qdio_setup_ssqd_info()
288 DBF_EVENT("ac 1:%2x 2:%4x", qdioac, irq_ptr->ssqd_desc.qdioac2); in qdio_setup_ssqd_info()
289 DBF_EVENT("3:%4x qib:%4x", irq_ptr->ssqd_desc.qdioac3, irq_ptr->qib.ac); in qdio_setup_ssqd_info()
304 static void setup_qdr(struct qdio_irq *irq_ptr, in setup_qdr() argument
307 struct qdesfmt0 *desc = &irq_ptr->qdr->qdf0[0]; in setup_qdr()
310 memset(irq_ptr->qdr, 0, sizeof(struct qdr)); in setup_qdr()
312 irq_ptr->qdr->qfmt = qdio_init->q_format; in setup_qdr()
313 irq_ptr->qdr->ac = qdio_init->qdr_ac; in setup_qdr()
314 irq_ptr->qdr->iqdcnt = qdio_init->no_input_qs; in setup_qdr()
315 irq_ptr->qdr->oqdcnt = qdio_init->no_output_qs; in setup_qdr()
316 irq_ptr->qdr->iqdsz = sizeof(struct qdesfmt0) / 4; /* size in words */ in setup_qdr()
317 irq_ptr->qdr->oqdsz = sizeof(struct qdesfmt0) / 4; in setup_qdr()
318 irq_ptr->qdr->qiba = virt_to_phys(&irq_ptr->qib); in setup_qdr()
319 irq_ptr->qdr->qkey = PAGE_DEFAULT_KEY >> 4; in setup_qdr()
322 qdio_fill_qdr_desc(desc++, irq_ptr->input_qs[i]); in setup_qdr()
325 qdio_fill_qdr_desc(desc++, irq_ptr->output_qs[i]); in setup_qdr()
328 static void setup_qib(struct qdio_irq *irq_ptr, in setup_qib() argument
331 memset(&irq_ptr->qib, 0, sizeof(irq_ptr->qib)); in setup_qib()
333 irq_ptr->qib.qfmt = init_data->q_format; in setup_qib()
334 irq_ptr->qib.pfmt = init_data->qib_param_field_format; in setup_qib()
336 irq_ptr->qib.rflags = init_data->qib_rflags; in setup_qib()
338 irq_ptr->qib.rflags |= QIB_RFLAGS_ENABLE_QEBSM; in setup_qib()
341 irq_ptr->qib.isliba = in setup_qib()
342 (unsigned long)(irq_ptr->input_qs[0]->slib); in setup_qib()
344 irq_ptr->qib.osliba = in setup_qib()
345 (unsigned long)(irq_ptr->output_qs[0]->slib); in setup_qib()
346 memcpy(irq_ptr->qib.ebcnam, dev_name(&irq_ptr->cdev->dev), 8); in setup_qib()
347 ASCEBC(irq_ptr->qib.ebcnam, 8); in setup_qib()
350 memcpy(irq_ptr->qib.parm, init_data->qib_param_field, in setup_qib()
351 sizeof(irq_ptr->qib.parm)); in setup_qib()
354 void qdio_setup_irq(struct qdio_irq *irq_ptr, struct qdio_initialize *init_data) in qdio_setup_irq() argument
356 struct ccw_device *cdev = irq_ptr->cdev; in qdio_setup_irq()
358 irq_ptr->qdioac1 = 0; in qdio_setup_irq()
359 memset(&irq_ptr->ssqd_desc, 0, sizeof(irq_ptr->ssqd_desc)); in qdio_setup_irq()
360 memset(&irq_ptr->perf_stat, 0, sizeof(irq_ptr->perf_stat)); in qdio_setup_irq()
362 irq_ptr->debugfs_dev = NULL; in qdio_setup_irq()
363 irq_ptr->sch_token = irq_ptr->perf_stat_enabled = 0; in qdio_setup_irq()
364 irq_ptr->state = QDIO_IRQ_STATE_INACTIVE; in qdio_setup_irq()
365 irq_ptr->error_handler = init_data->input_handler; in qdio_setup_irq()
367 irq_ptr->int_parm = init_data->int_parm; in qdio_setup_irq()
368 irq_ptr->nr_input_qs = init_data->no_input_qs; in qdio_setup_irq()
369 irq_ptr->nr_output_qs = init_data->no_output_qs; in qdio_setup_irq()
370 ccw_device_get_schid(cdev, &irq_ptr->schid); in qdio_setup_irq()
371 setup_queues(irq_ptr, init_data); in qdio_setup_irq()
373 irq_ptr->irq_poll = init_data->irq_poll; in qdio_setup_irq()
374 set_bit(QDIO_IRQ_DISABLED, &irq_ptr->poll_state); in qdio_setup_irq()
376 setup_qib(irq_ptr, init_data); in qdio_setup_irq()
379 setup_qdr(irq_ptr, init_data); in qdio_setup_irq()
385 irq_ptr->orig_handler = cdev->handler; in qdio_setup_irq()
401 void qdio_print_subchannel_info(struct qdio_irq *irq_ptr) in qdio_print_subchannel_info() argument
403 dev_info(&irq_ptr->cdev->dev, in qdio_print_subchannel_info()
405 (irq_ptr->qib.qfmt == QDIO_QETH_QFMT) ? "OSA" : in qdio_print_subchannel_info()
406 ((irq_ptr->qib.qfmt == QDIO_ZFCP_QFMT) ? "ZFCP" : "HS"), in qdio_print_subchannel_info()
407 irq_ptr->schid.sch_no, in qdio_print_subchannel_info()
408 is_thinint_irq(irq_ptr), in qdio_print_subchannel_info()
409 (irq_ptr->sch_token) ? 1 : 0, in qdio_print_subchannel_info()
410 pci_out_supported(irq_ptr) ? 1 : 0, in qdio_print_subchannel_info()
412 qdio_need_siga_in(irq_ptr) ? "R" : " ", in qdio_print_subchannel_info()
413 qdio_need_siga_out(irq_ptr) ? "W" : " ", in qdio_print_subchannel_info()
414 qdio_need_siga_sync(irq_ptr) ? "S" : " "); in qdio_print_subchannel_info()