Lines Matching full:view
46 struct raw3270_view *view; /* Active view. */ member
89 * Wait queue for device init/delete, view delete.
238 __raw3270_start(struct raw3270 *rp, struct raw3270_view *view, in __raw3270_start() argument
241 rq->view = view; in __raw3270_start()
242 raw3270_get_view(view); in __raw3270_start()
249 raw3270_put_view(view); in __raw3270_start()
258 raw3270_view_active(struct raw3270_view *view) in raw3270_view_active() argument
260 struct raw3270 *rp = view->dev; in raw3270_view_active()
262 return rp && rp->view == view; in raw3270_view_active()
266 raw3270_start(struct raw3270_view *view, struct raw3270_request *rq) in raw3270_start() argument
272 spin_lock_irqsave(get_ccwdev_lock(view->dev->cdev), flags); in raw3270_start()
273 rp = view->dev; in raw3270_start()
274 if (!rp || rp->view != view) in raw3270_start()
279 rc = __raw3270_start(rp, view, rq); in raw3270_start()
280 spin_unlock_irqrestore(get_ccwdev_lock(view->dev->cdev), flags); in raw3270_start()
285 raw3270_start_locked(struct raw3270_view *view, struct raw3270_request *rq) in raw3270_start_locked() argument
290 rp = view->dev; in raw3270_start_locked()
291 if (!rp || rp->view != view) in raw3270_start_locked()
296 rc = __raw3270_start(rp, view, rq); in raw3270_start_locked()
301 raw3270_start_irq(struct raw3270_view *view, struct raw3270_request *rq) in raw3270_start_irq() argument
305 rp = view->dev; in raw3270_start_irq()
306 rq->view = view; in raw3270_start_irq()
307 raw3270_get_view(view); in raw3270_start_irq()
319 struct raw3270_view *view; in raw3270_irq() local
326 view = rq ? rq->view : rp->view; in raw3270_irq()
343 /* Call interrupt handler of the view */ in raw3270_irq()
344 if (view) in raw3270_irq()
345 view->fn->intv(view, rq, irb); in raw3270_irq()
358 raw3270_put_view(view); in raw3270_irq()
376 raw3270_put_view(view); in raw3270_irq()
506 struct raw3270_view *view; in raw3270_size_device_done() local
508 rp->view = NULL; in raw3270_size_device_done()
511 list_for_each_entry(view, &rp->view_list, list) in raw3270_size_device_done()
512 if (view->fn->resize) in raw3270_size_device_done()
513 view->fn->resize(view, rp->model, rp->rows, rp->cols); in raw3270_size_device_done()
514 /* Setup processing done, now activate a view */ in raw3270_size_device_done()
515 list_for_each_entry(view, &rp->view_list, list) { in raw3270_size_device_done()
516 rp->view = view; in raw3270_size_device_done()
517 if (view->fn->activate(view) == 0) in raw3270_size_device_done()
519 rp->view = NULL; in raw3270_size_device_done()
526 struct raw3270 *rp = rq->view->dev; in raw3270_read_modified_cb()
573 struct raw3270 *rp = rq->view->dev; in raw3270_reset_device_cb()
594 if (rp->init_reset.view) in __raw3270_reset_device()
622 raw3270_reset(struct raw3270_view *view) in raw3270_reset() argument
627 rp = view->dev; in raw3270_reset()
628 if (!rp || rp->view != view) in raw3270_reset()
633 rc = raw3270_reset_device(view->dev); in raw3270_reset()
641 struct raw3270_view *view; in __raw3270_disconnect() local
644 rp->view = &rp->init_view; in __raw3270_disconnect()
648 view = rq->view; in __raw3270_disconnect()
653 raw3270_put_view(view); in __raw3270_disconnect()
660 raw3270_init_irq(struct raw3270_view *view, struct raw3270_request *rq, in raw3270_init_irq() argument
675 rp = view->dev; in raw3270_init_irq()
714 rp->view = &rp->init_view; in raw3270_setup_device()
835 * view in the panic() context, due to locking restrictions.
837 int raw3270_view_lock_unavailable(struct raw3270_view *view) in raw3270_view_lock_unavailable() argument
839 struct raw3270 *rp = view->dev; in raw3270_view_lock_unavailable()
849 * Activate a view.
852 raw3270_activate_view(struct raw3270_view *view) in raw3270_activate_view() argument
859 rp = view->dev; in raw3270_activate_view()
863 if (rp->view == view) in raw3270_activate_view()
869 if (rp->view && rp->view->fn->deactivate) { in raw3270_activate_view()
870 oldview = rp->view; in raw3270_activate_view()
873 rp->view = view; in raw3270_activate_view()
874 rc = view->fn->activate(view); in raw3270_activate_view()
876 /* Didn't work. Try to reactivate the old view. */ in raw3270_activate_view()
877 rp->view = oldview; in raw3270_activate_view()
879 /* Didn't work as well. Try any other view. */ in raw3270_activate_view()
881 if (nv != view && nv != oldview) { in raw3270_activate_view()
882 rp->view = nv; in raw3270_activate_view()
885 rp->view = NULL; in raw3270_activate_view()
895 * Deactivate current view.
898 raw3270_deactivate_view(struct raw3270_view *view) in raw3270_deactivate_view() argument
903 rp = view->dev; in raw3270_deactivate_view()
907 if (rp->view == view) { in raw3270_deactivate_view()
908 view->fn->deactivate(view); in raw3270_deactivate_view()
909 rp->view = NULL; in raw3270_deactivate_view()
910 /* Move deactivated view to end of list. */ in raw3270_deactivate_view()
911 list_del_init(&view->list); in raw3270_deactivate_view()
912 list_add_tail(&view->list, &rp->view_list); in raw3270_deactivate_view()
913 /* Try to activate another view. */ in raw3270_deactivate_view()
915 list_for_each_entry(view, &rp->view_list, list) { in raw3270_deactivate_view()
916 rp->view = view; in raw3270_deactivate_view()
917 if (view->fn->activate(view) == 0) in raw3270_deactivate_view()
919 rp->view = NULL; in raw3270_deactivate_view()
927 * Add view to device with minor "minor".
930 raw3270_add_view(struct raw3270_view *view, struct raw3270_fn *fn, int minor, int subclass) in raw3270_add_view() argument
944 atomic_set(&view->ref_count, 2); in raw3270_add_view()
945 view->dev = rp; in raw3270_add_view()
946 view->fn = fn; in raw3270_add_view()
947 view->model = rp->model; in raw3270_add_view()
948 view->rows = rp->rows; in raw3270_add_view()
949 view->cols = rp->cols; in raw3270_add_view()
950 view->ascebc = rp->ascebc; in raw3270_add_view()
951 spin_lock_init(&view->lock); in raw3270_add_view()
952 lockdep_set_subclass(&view->lock, subclass); in raw3270_add_view()
953 list_add(&view->list, &rp->view_list); in raw3270_add_view()
963 * Find specific view of device with minor "minor".
969 struct raw3270_view *view, *tmp; in raw3270_find_view() local
973 view = ERR_PTR(-ENODEV); in raw3270_find_view()
981 view = tmp; in raw3270_find_view()
989 return view; in raw3270_find_view()
993 * Remove view from device and free view structure via call to view->fn->free.
996 raw3270_del_view(struct raw3270_view *view) in raw3270_del_view() argument
1002 rp = view->dev; in raw3270_del_view()
1004 if (rp->view == view) { in raw3270_del_view()
1005 view->fn->deactivate(view); in raw3270_del_view()
1006 rp->view = NULL; in raw3270_del_view()
1008 list_del_init(&view->list); in raw3270_del_view()
1009 if (!rp->view && raw3270_state_ready(rp)) { in raw3270_del_view()
1010 /* Try to activate another view. */ in raw3270_del_view()
1013 rp->view = nv; in raw3270_del_view()
1020 atomic_dec(&view->ref_count); in raw3270_del_view()
1021 wait_event(raw3270_wait_queue, atomic_read(&view->ref_count) == 0); in raw3270_del_view()
1022 if (view->fn->free) in raw3270_del_view()
1023 view->fn->free(view); in raw3270_del_view()
1181 /* Deactivate current view and remove all views. */ in raw3270_remove()
1183 if (rp->view) { in raw3270_remove()
1184 if (rp->view->fn->deactivate) in raw3270_remove()
1185 rp->view->fn->deactivate(rp->view); in raw3270_remove()
1186 rp->view = NULL; in raw3270_remove()