Lines Matching full:view
50 struct raw3270_view *view; /* Active view. */ member
94 * Wait queue for device init/delete, view delete.
125 x = max_t(int, 0, rp->view->cols + x); in raw3270_buffer_address()
127 y = max_t(int, 0, rp->view->rows + y); in raw3270_buffer_address()
128 addr = (y * rp->view->cols) + x; in raw3270_buffer_address()
248 static int __raw3270_start(struct raw3270 *rp, struct raw3270_view *view, in __raw3270_start() argument
251 rq->view = view; in __raw3270_start()
252 raw3270_get_view(view); in __raw3270_start()
259 raw3270_put_view(view); in __raw3270_start()
267 int raw3270_view_active(struct raw3270_view *view) in raw3270_view_active() argument
269 struct raw3270 *rp = view->dev; in raw3270_view_active()
271 return rp && rp->view == view; in raw3270_view_active()
274 int raw3270_start(struct raw3270_view *view, struct raw3270_request *rq) in raw3270_start() argument
280 spin_lock_irqsave(get_ccwdev_lock(view->dev->cdev), flags); in raw3270_start()
281 rp = view->dev; in raw3270_start()
282 if (!rp || rp->view != view) in raw3270_start()
287 rc = __raw3270_start(rp, view, rq); in raw3270_start()
288 spin_unlock_irqrestore(get_ccwdev_lock(view->dev->cdev), flags); in raw3270_start()
293 int raw3270_start_request(struct raw3270_view *view, struct raw3270_request *rq, in raw3270_start_request() argument
305 return raw3270_start(view, rq); in raw3270_start_request()
309 int raw3270_start_locked(struct raw3270_view *view, struct raw3270_request *rq) in raw3270_start_locked() argument
314 rp = view->dev; in raw3270_start_locked()
315 if (!rp || rp->view != view) in raw3270_start_locked()
320 rc = __raw3270_start(rp, view, rq); in raw3270_start_locked()
325 int raw3270_start_irq(struct raw3270_view *view, struct raw3270_request *rq) in raw3270_start_irq() argument
329 rp = view->dev; in raw3270_start_irq()
330 rq->view = view; in raw3270_start_irq()
331 raw3270_get_view(view); in raw3270_start_irq()
343 struct raw3270_view *view; in raw3270_irq() local
350 view = rq ? rq->view : rp->view; in raw3270_irq()
367 /* Call interrupt handler of the view */ in raw3270_irq()
368 if (view) in raw3270_irq()
369 view->fn->intv(view, rq, irb); in raw3270_irq()
382 raw3270_put_view(view); in raw3270_irq()
400 raw3270_put_view(view); in raw3270_irq()
538 struct raw3270_view *view; in raw3270_resize_work() local
541 list_for_each_entry(view, &rp->view_list, list) { in raw3270_resize_work()
542 if (view->fn->resize) in raw3270_resize_work()
543 view->fn->resize(view, rp->model, rp->rows, rp->cols, in raw3270_resize_work()
549 /* Setup processing done, now activate a view */ in raw3270_resize_work()
550 list_for_each_entry(view, &rp->view_list, list) { in raw3270_resize_work()
551 rp->view = view; in raw3270_resize_work()
552 if (view->fn->activate(view) == 0) in raw3270_resize_work()
554 rp->view = NULL; in raw3270_resize_work()
560 rp->view = NULL; in raw3270_size_device_done()
567 struct raw3270 *rp = rq->view->dev; in raw3270_read_modified_cb()
614 struct raw3270 *rp = rq->view->dev; in raw3270_reset_device_cb()
635 if (rp->init_reset.view) in __raw3270_reset_device()
661 int raw3270_reset(struct raw3270_view *view) in raw3270_reset() argument
666 rp = view->dev; in raw3270_reset()
667 if (!rp || rp->view != view) in raw3270_reset()
672 rc = raw3270_reset_device(view->dev); in raw3270_reset()
680 struct raw3270_view *view; in __raw3270_disconnect() local
683 rp->view = &rp->init_view; in __raw3270_disconnect()
687 view = rq->view; in __raw3270_disconnect()
692 raw3270_put_view(view); in __raw3270_disconnect()
698 static void raw3270_init_irq(struct raw3270_view *view, struct raw3270_request *rq, in raw3270_init_irq() argument
713 rp = view->dev; in raw3270_init_irq()
754 rp->view = &rp->init_view; in raw3270_setup_device()
880 * view in the panic() context, due to locking restrictions.
882 int raw3270_view_lock_unavailable(struct raw3270_view *view) in raw3270_view_lock_unavailable() argument
884 struct raw3270 *rp = view->dev; in raw3270_view_lock_unavailable()
893 static int raw3270_assign_activate_view(struct raw3270 *rp, struct raw3270_view *view) in raw3270_assign_activate_view() argument
895 rp->view = view; in raw3270_assign_activate_view()
896 return view->fn->activate(view); in raw3270_assign_activate_view()
899 static int __raw3270_activate_view(struct raw3270 *rp, struct raw3270_view *view) in __raw3270_activate_view() argument
904 if (rp->view == view) in __raw3270_activate_view()
910 if (rp->view && rp->view->fn->deactivate) { in __raw3270_activate_view()
911 oldview = rp->view; in __raw3270_activate_view()
915 rc = raw3270_assign_activate_view(rp, view); in __raw3270_activate_view()
919 /* Didn't work. Try to reactivate the old view. */ in __raw3270_activate_view()
926 /* Didn't work as well. Try any other view. */ in __raw3270_activate_view()
928 if (nv == view || nv == oldview) in __raw3270_activate_view()
933 rp->view = NULL; in __raw3270_activate_view()
939 * Activate a view.
941 int raw3270_activate_view(struct raw3270_view *view) in raw3270_activate_view() argument
947 rp = view->dev; in raw3270_activate_view()
951 rc = __raw3270_activate_view(rp, view); in raw3270_activate_view()
958 * Deactivate current view.
960 void raw3270_deactivate_view(struct raw3270_view *view) in raw3270_deactivate_view() argument
965 rp = view->dev; in raw3270_deactivate_view()
969 if (rp->view == view) { in raw3270_deactivate_view()
970 view->fn->deactivate(view); in raw3270_deactivate_view()
971 rp->view = NULL; in raw3270_deactivate_view()
972 /* Move deactivated view to end of list. */ in raw3270_deactivate_view()
973 list_del_init(&view->list); in raw3270_deactivate_view()
974 list_add_tail(&view->list, &rp->view_list); in raw3270_deactivate_view()
975 /* Try to activate another view. */ in raw3270_deactivate_view()
977 list_for_each_entry(view, &rp->view_list, list) { in raw3270_deactivate_view()
978 rp->view = view; in raw3270_deactivate_view()
979 if (view->fn->activate(view) == 0) in raw3270_deactivate_view()
981 rp->view = NULL; in raw3270_deactivate_view()
990 * Add view to device with minor "minor".
992 int raw3270_add_view(struct raw3270_view *view, struct raw3270_fn *fn, in raw3270_add_view() argument
1007 atomic_set(&view->ref_count, 2); in raw3270_add_view()
1008 view->dev = rp; in raw3270_add_view()
1009 view->fn = fn; in raw3270_add_view()
1010 view->model = rp->model; in raw3270_add_view()
1011 view->rows = rp->rows; in raw3270_add_view()
1012 view->cols = rp->cols; in raw3270_add_view()
1013 view->ascebc = rp->ascebc; in raw3270_add_view()
1014 spin_lock_init(&view->lock); in raw3270_add_view()
1015 lockdep_set_subclass(&view->lock, subclass); in raw3270_add_view()
1016 list_add(&view->list, &rp->view_list); in raw3270_add_view()
1027 * Find specific view of device with minor "minor".
1032 struct raw3270_view *view, *tmp; in raw3270_find_view() local
1036 view = ERR_PTR(-ENODEV); in raw3270_find_view()
1044 view = tmp; in raw3270_find_view()
1052 return view; in raw3270_find_view()
1057 * Remove view from device and free view structure via call to view->fn->free.
1059 void raw3270_del_view(struct raw3270_view *view) in raw3270_del_view() argument
1065 rp = view->dev; in raw3270_del_view()
1067 if (rp->view == view) { in raw3270_del_view()
1068 view->fn->deactivate(view); in raw3270_del_view()
1069 rp->view = NULL; in raw3270_del_view()
1071 list_del_init(&view->list); in raw3270_del_view()
1072 if (!rp->view && raw3270_state_ready(rp)) { in raw3270_del_view()
1073 /* Try to activate another view. */ in raw3270_del_view()
1076 rp->view = nv; in raw3270_del_view()
1083 atomic_dec(&view->ref_count); in raw3270_del_view()
1084 wait_event(raw3270_wait_queue, atomic_read(&view->ref_count) == 0); in raw3270_del_view()
1085 if (view->fn->free) in raw3270_del_view()
1086 view->fn->free(view); in raw3270_del_view()
1244 /* Deactivate current view and remove all views. */ in raw3270_remove()
1246 if (rp->view) { in raw3270_remove()
1247 if (rp->view->fn->deactivate) in raw3270_remove()
1248 rp->view->fn->deactivate(rp->view); in raw3270_remove()
1249 rp->view = NULL; in raw3270_remove()