stuser 70 drivers/pci/switch/switchtec.c struct switchtec_user *stuser; stuser 72 drivers/pci/switch/switchtec.c stuser = kzalloc(sizeof(*stuser), GFP_KERNEL); stuser 73 drivers/pci/switch/switchtec.c if (!stuser) stuser 77 drivers/pci/switch/switchtec.c stuser->stdev = stdev; stuser 78 drivers/pci/switch/switchtec.c kref_init(&stuser->kref); stuser 79 drivers/pci/switch/switchtec.c INIT_LIST_HEAD(&stuser->list); stuser 80 drivers/pci/switch/switchtec.c init_completion(&stuser->comp); stuser 81 drivers/pci/switch/switchtec.c stuser->event_cnt = atomic_read(&stdev->event_cnt); stuser 83 drivers/pci/switch/switchtec.c dev_dbg(&stdev->dev, "%s: %p\n", __func__, stuser); stuser 85 drivers/pci/switch/switchtec.c return stuser; stuser 90 drivers/pci/switch/switchtec.c struct switchtec_user *stuser; stuser 92 drivers/pci/switch/switchtec.c stuser = container_of(kref, struct switchtec_user, kref); stuser 94 drivers/pci/switch/switchtec.c dev_dbg(&stuser->stdev->dev, "%s: %p\n", __func__, stuser); stuser 96 drivers/pci/switch/switchtec.c put_device(&stuser->stdev->dev); stuser 97 drivers/pci/switch/switchtec.c kfree(stuser); stuser 100 drivers/pci/switch/switchtec.c static void stuser_put(struct switchtec_user *stuser) stuser 102 drivers/pci/switch/switchtec.c kref_put(&stuser->kref, stuser_free); stuser 105 drivers/pci/switch/switchtec.c static void stuser_set_state(struct switchtec_user *stuser, stuser 117 drivers/pci/switch/switchtec.c stuser->state = state; stuser 119 drivers/pci/switch/switchtec.c dev_dbg(&stuser->stdev->dev, "stuser state %p -> %s", stuser 120 drivers/pci/switch/switchtec.c stuser, state_names[state]); stuser 142 drivers/pci/switch/switchtec.c struct switchtec_user *stuser; stuser 150 drivers/pci/switch/switchtec.c stuser = list_entry(stdev->mrpc_queue.next, struct switchtec_user, stuser 158 drivers/pci/switch/switchtec.c stuser_set_state(stuser, MRPC_RUNNING); stuser 161 drivers/pci/switch/switchtec.c stuser->data, stuser->data_len); stuser 163 drivers/pci/switch/switchtec.c iowrite32(stuser->cmd, &stdev->mmio_mrpc->cmd); stuser 169 drivers/pci/switch/switchtec.c static int mrpc_queue_cmd(struct switchtec_user *stuser) stuser 173 drivers/pci/switch/switchtec.c struct switchtec_dev *stdev = stuser->stdev; stuser 175 drivers/pci/switch/switchtec.c kref_get(&stuser->kref); stuser 176 drivers/pci/switch/switchtec.c stuser->read_len = sizeof(stuser->data); stuser 177 drivers/pci/switch/switchtec.c stuser_set_state(stuser, MRPC_QUEUED); stuser 178 drivers/pci/switch/switchtec.c reinit_completion(&stuser->comp); stuser 179 drivers/pci/switch/switchtec.c list_add_tail(&stuser->list, &stdev->mrpc_queue); stuser 189 drivers/pci/switch/switchtec.c struct switchtec_user *stuser; stuser 194 drivers/pci/switch/switchtec.c stuser = list_entry(stdev->mrpc_queue.next, struct switchtec_user, stuser 198 drivers/pci/switch/switchtec.c stuser->status = stdev->dma_mrpc->status; stuser 200 drivers/pci/switch/switchtec.c stuser->status = ioread32(&stdev->mmio_mrpc->status); stuser 202 drivers/pci/switch/switchtec.c if (stuser->status == SWITCHTEC_MRPC_STATUS_INPROGRESS) stuser 205 drivers/pci/switch/switchtec.c stuser_set_state(stuser, MRPC_DONE); stuser 206 drivers/pci/switch/switchtec.c stuser->return_code = 0; stuser 208 drivers/pci/switch/switchtec.c if (stuser->status != SWITCHTEC_MRPC_STATUS_DONE) stuser 212 drivers/pci/switch/switchtec.c stuser->return_code = stdev->dma_mrpc->rtn_code; stuser 214 drivers/pci/switch/switchtec.c stuser->return_code = ioread32(&stdev->mmio_mrpc->ret_value); stuser 215 drivers/pci/switch/switchtec.c if (stuser->return_code != 0) stuser 219 drivers/pci/switch/switchtec.c memcpy(stuser->data, &stdev->dma_mrpc->data, stuser 220 drivers/pci/switch/switchtec.c stuser->read_len); stuser 222 drivers/pci/switch/switchtec.c memcpy_fromio(stuser->data, &stdev->mmio_mrpc->output_data, stuser 223 drivers/pci/switch/switchtec.c stuser->read_len); stuser 225 drivers/pci/switch/switchtec.c complete_all(&stuser->comp); stuser 226 drivers/pci/switch/switchtec.c list_del_init(&stuser->list); stuser 227 drivers/pci/switch/switchtec.c stuser_put(stuser); stuser 388 drivers/pci/switch/switchtec.c struct switchtec_user *stuser; stuser 392 drivers/pci/switch/switchtec.c stuser = stuser_create(stdev); stuser 393 drivers/pci/switch/switchtec.c if (IS_ERR(stuser)) stuser 394 drivers/pci/switch/switchtec.c return PTR_ERR(stuser); stuser 396 drivers/pci/switch/switchtec.c filp->private_data = stuser; stuser 399 drivers/pci/switch/switchtec.c dev_dbg(&stdev->dev, "%s: %p\n", __func__, stuser); stuser 406 drivers/pci/switch/switchtec.c struct switchtec_user *stuser = filp->private_data; stuser 408 drivers/pci/switch/switchtec.c stuser_put(stuser); stuser 429 drivers/pci/switch/switchtec.c struct switchtec_user *stuser = filp->private_data; stuser 430 drivers/pci/switch/switchtec.c struct switchtec_dev *stdev = stuser->stdev; stuser 433 drivers/pci/switch/switchtec.c if (size < sizeof(stuser->cmd) || stuser 434 drivers/pci/switch/switchtec.c size > sizeof(stuser->cmd) + sizeof(stuser->data)) stuser 437 drivers/pci/switch/switchtec.c stuser->data_len = size - sizeof(stuser->cmd); stuser 443 drivers/pci/switch/switchtec.c if (stuser->state != MRPC_IDLE) { stuser 448 drivers/pci/switch/switchtec.c rc = copy_from_user(&stuser->cmd, data, sizeof(stuser->cmd)); stuser 454 drivers/pci/switch/switchtec.c data += sizeof(stuser->cmd); stuser 455 drivers/pci/switch/switchtec.c rc = copy_from_user(&stuser->data, data, size - sizeof(stuser->cmd)); stuser 461 drivers/pci/switch/switchtec.c rc = mrpc_queue_cmd(stuser); stuser 475 drivers/pci/switch/switchtec.c struct switchtec_user *stuser = filp->private_data; stuser 476 drivers/pci/switch/switchtec.c struct switchtec_dev *stdev = stuser->stdev; stuser 479 drivers/pci/switch/switchtec.c if (size < sizeof(stuser->cmd) || stuser 480 drivers/pci/switch/switchtec.c size > sizeof(stuser->cmd) + sizeof(stuser->data)) stuser 487 drivers/pci/switch/switchtec.c if (stuser->state == MRPC_IDLE) { stuser 492 drivers/pci/switch/switchtec.c stuser->read_len = size - sizeof(stuser->return_code); stuser 497 drivers/pci/switch/switchtec.c if (!try_wait_for_completion(&stuser->comp)) stuser 500 drivers/pci/switch/switchtec.c rc = wait_for_completion_interruptible(&stuser->comp); stuser 509 drivers/pci/switch/switchtec.c if (stuser->state != MRPC_DONE) { stuser 514 drivers/pci/switch/switchtec.c rc = copy_to_user(data, &stuser->return_code, stuser 515 drivers/pci/switch/switchtec.c sizeof(stuser->return_code)); stuser 521 drivers/pci/switch/switchtec.c data += sizeof(stuser->return_code); stuser 522 drivers/pci/switch/switchtec.c rc = copy_to_user(data, &stuser->data, stuser 523 drivers/pci/switch/switchtec.c size - sizeof(stuser->return_code)); stuser 529 drivers/pci/switch/switchtec.c stuser_set_state(stuser, MRPC_IDLE); stuser 534 drivers/pci/switch/switchtec.c if (stuser->status == SWITCHTEC_MRPC_STATUS_DONE) stuser 536 drivers/pci/switch/switchtec.c else if (stuser->status == SWITCHTEC_MRPC_STATUS_INTERRUPTED) stuser 544 drivers/pci/switch/switchtec.c struct switchtec_user *stuser = filp->private_data; stuser 545 drivers/pci/switch/switchtec.c struct switchtec_dev *stdev = stuser->stdev; stuser 548 drivers/pci/switch/switchtec.c poll_wait(filp, &stuser->comp.wait, wait); stuser 556 drivers/pci/switch/switchtec.c if (try_wait_for_completion(&stuser->comp)) stuser 559 drivers/pci/switch/switchtec.c if (stuser->event_cnt != atomic_read(&stdev->event_cnt)) stuser 664 drivers/pci/switch/switchtec.c struct switchtec_user *stuser, stuser 700 drivers/pci/switch/switchtec.c stuser->event_cnt = atomic_read(&stdev->event_cnt); stuser 978 drivers/pci/switch/switchtec.c struct switchtec_user *stuser = filp->private_data; stuser 979 drivers/pci/switch/switchtec.c struct switchtec_dev *stdev = stuser->stdev; stuser 995 drivers/pci/switch/switchtec.c rc = ioctl_event_summary(stdev, stuser, argp, stuser 1008 drivers/pci/switch/switchtec.c rc = ioctl_event_summary(stdev, stuser, argp, stuser 1097 drivers/pci/switch/switchtec.c struct switchtec_user *stuser, *tmpuser; stuser 1108 drivers/pci/switch/switchtec.c list_for_each_entry_safe(stuser, tmpuser, &stdev->mrpc_queue, list) { stuser 1109 drivers/pci/switch/switchtec.c complete_all(&stuser->comp); stuser 1110 drivers/pci/switch/switchtec.c list_del_init(&stuser->list); stuser 1111 drivers/pci/switch/switchtec.c stuser_put(stuser);