Lines Matching refs:dc2c
264 struct devcmd2_controller *dc2c = vdev->devcmd2; in _svnic_dev_cmd2() local
274 fetch_idx = ioread32(&dc2c->wq_ctrl->fetch_index); in _svnic_dev_cmd2()
280 posted = ioread32(&dc2c->wq_ctrl->posted_index); in _svnic_dev_cmd2()
295 dc2c->cmd_ring[posted].cmd = cmd; in _svnic_dev_cmd2()
296 dc2c->cmd_ring[posted].flags = 0; in _svnic_dev_cmd2()
299 dc2c->cmd_ring[posted].flags |= DEVCMD2_FNORESULT; in _svnic_dev_cmd2()
303 dc2c->cmd_ring[posted].args[i] = vdev->args[i]; in _svnic_dev_cmd2()
311 iowrite32(new_posted, &dc2c->wq_ctrl->posted_index); in _svnic_dev_cmd2()
313 if (dc2c->cmd_ring[posted].flags & DEVCMD2_FNORESULT) in _svnic_dev_cmd2()
316 result = dc2c->result + dc2c->next_result; in _svnic_dev_cmd2()
317 color = dc2c->color; in _svnic_dev_cmd2()
323 dc2c->next_result++; in _svnic_dev_cmd2()
324 if (dc2c->next_result == dc2c->result_size) { in _svnic_dev_cmd2()
325 dc2c->next_result = 0; in _svnic_dev_cmd2()
326 dc2c->color = dc2c->color ? 0 : 1; in _svnic_dev_cmd2()
357 struct devcmd2_controller *dc2c = NULL; in svnic_dev_init_devcmd2() local
369 dc2c = kzalloc(sizeof(*dc2c), GFP_ATOMIC); in svnic_dev_init_devcmd2()
370 if (!dc2c) in svnic_dev_init_devcmd2()
373 vdev->devcmd2 = dc2c; in svnic_dev_init_devcmd2()
375 dc2c->color = 1; in svnic_dev_init_devcmd2()
376 dc2c->result_size = DEVCMD2_RING_SIZE; in svnic_dev_init_devcmd2()
379 &dc2c->wq, in svnic_dev_init_devcmd2()
385 fetch_idx = ioread32(&dc2c->wq.ctrl->fetch_index); in svnic_dev_init_devcmd2()
396 vnic_wq_init_start(&dc2c->wq, 0, fetch_idx, fetch_idx, 0, 0); in svnic_dev_init_devcmd2()
397 svnic_wq_enable(&dc2c->wq); in svnic_dev_init_devcmd2()
399 &dc2c->results_ring, in svnic_dev_init_devcmd2()
405 dc2c->result = (struct devcmd2_result *) dc2c->results_ring.descs; in svnic_dev_init_devcmd2()
406 dc2c->cmd_ring = (struct vnic_devcmd2 *) dc2c->wq.ring.descs; in svnic_dev_init_devcmd2()
407 dc2c->wq_ctrl = dc2c->wq.ctrl; in svnic_dev_init_devcmd2()
408 vdev->args[0] = (u64) dc2c->results_ring.base_addr | VNIC_PADDR_TARGET; in svnic_dev_init_devcmd2()
421 svnic_dev_free_desc_ring(vdev, &dc2c->results_ring); in svnic_dev_init_devcmd2()
424 svnic_wq_disable(&dc2c->wq); in svnic_dev_init_devcmd2()
425 svnic_wq_free(&dc2c->wq); in svnic_dev_init_devcmd2()
428 kfree(dc2c); in svnic_dev_init_devcmd2()
436 struct devcmd2_controller *dc2c = vdev->devcmd2; in vnic_dev_deinit_devcmd2() local
441 svnic_dev_free_desc_ring(vdev, &dc2c->results_ring); in vnic_dev_deinit_devcmd2()
442 svnic_wq_disable(&dc2c->wq); in vnic_dev_deinit_devcmd2()
443 svnic_wq_free(&dc2c->wq); in vnic_dev_deinit_devcmd2()
444 kfree(dc2c); in vnic_dev_deinit_devcmd2()