Lines Matching refs:view
48 struct raw3270_view *view; /* Active view. */
92 * Wait queue for device init/delete, view delete.
123 x = max_t(int, 0, rp->view->cols + x);
125 y = max_t(int, 0, rp->view->rows + y);
126 addr = (y * rp->view->cols) + x;
244 static int __raw3270_start(struct raw3270 *rp, struct raw3270_view *view,
247 rq->view = view;
248 raw3270_get_view(view);
255 raw3270_put_view(view);
263 int raw3270_view_active(struct raw3270_view *view)
265 struct raw3270 *rp = view->dev;
267 return rp && rp->view == view;
270 int raw3270_start(struct raw3270_view *view, struct raw3270_request *rq)
276 spin_lock_irqsave(get_ccwdev_lock(view->dev->cdev), flags);
277 rp = view->dev;
278 if (!rp || rp->view != view)
283 rc = __raw3270_start(rp, view, rq);
284 spin_unlock_irqrestore(get_ccwdev_lock(view->dev->cdev), flags);
289 int raw3270_start_request(struct raw3270_view *view, struct raw3270_request *rq,
301 return raw3270_start(view, rq);
305 int raw3270_start_locked(struct raw3270_view *view, struct raw3270_request *rq)
310 rp = view->dev;
311 if (!rp || rp->view != view)
316 rc = __raw3270_start(rp, view, rq);
321 int raw3270_start_irq(struct raw3270_view *view, struct raw3270_request *rq)
325 rp = view->dev;
326 rq->view = view;
327 raw3270_get_view(view);
339 struct raw3270_view *view;
346 view = rq ? rq->view : rp->view;
363 /* Call interrupt handler of the view */
364 if (view)
365 view->fn->intv(view, rq, irb);
378 raw3270_put_view(view);
396 raw3270_put_view(view);
534 struct raw3270_view *view;
537 list_for_each_entry(view, &rp->view_list, list) {
538 if (view->fn->resize)
539 view->fn->resize(view, rp->model, rp->rows, rp->cols,
545 /* Setup processing done, now activate a view */
546 list_for_each_entry(view, &rp->view_list, list) {
547 rp->view = view;
548 if (view->fn->activate(view) == 0)
550 rp->view = NULL;
556 rp->view = NULL;
563 struct raw3270 *rp = rq->view->dev;
610 struct raw3270 *rp = rq->view->dev;
631 if (rp->init_reset.view)
657 int raw3270_reset(struct raw3270_view *view)
662 rp = view->dev;
663 if (!rp || rp->view != view)
668 rc = raw3270_reset_device(view->dev);
676 struct raw3270_view *view;
679 rp->view = &rp->init_view;
683 view = rq->view;
688 raw3270_put_view(view);
694 static void raw3270_init_irq(struct raw3270_view *view, struct raw3270_request *rq,
709 rp = view->dev;
750 rp->view = &rp->init_view;
876 * view in the panic() context, due to locking restrictions.
878 int raw3270_view_lock_unavailable(struct raw3270_view *view)
880 struct raw3270 *rp = view->dev;
889 static int raw3270_assign_activate_view(struct raw3270 *rp, struct raw3270_view *view)
891 rp->view = view;
892 return view->fn->activate(view);
895 static int __raw3270_activate_view(struct raw3270 *rp, struct raw3270_view *view)
900 if (rp->view == view)
906 if (rp->view && rp->view->fn->deactivate) {
907 oldview = rp->view;
911 rc = raw3270_assign_activate_view(rp, view);
915 /* Didn't work. Try to reactivate the old view. */
922 /* Didn't work as well. Try any other view. */
924 if (nv == view || nv == oldview)
929 rp->view = NULL;
935 * Activate a view.
937 int raw3270_activate_view(struct raw3270_view *view)
943 rp = view->dev;
947 rc = __raw3270_activate_view(rp, view);
954 * Deactivate current view.
956 void raw3270_deactivate_view(struct raw3270_view *view)
961 rp = view->dev;
965 if (rp->view == view) {
966 view->fn->deactivate(view);
967 rp->view = NULL;
968 /* Move deactivated view to end of list. */
969 list_del_init(&view->list);
970 list_add_tail(&view->list, &rp->view_list);
971 /* Try to activate another view. */
973 list_for_each_entry(view, &rp->view_list, list) {
974 rp->view = view;
975 if (view->fn->activate(view) == 0)
977 rp->view = NULL;
986 * Add view to device with minor "minor".
988 int raw3270_add_view(struct raw3270_view *view, struct raw3270_fn *fn,
1003 atomic_set(&view->ref_count, 2);
1004 view->dev = rp;
1005 view->fn = fn;
1006 view->model = rp->model;
1007 view->rows = rp->rows;
1008 view->cols = rp->cols;
1009 view->ascebc = rp->ascebc;
1010 spin_lock_init(&view->lock);
1011 lockdep_set_subclass(&view->lock, subclass);
1012 list_add(&view->list, &rp->view_list);
1023 * Find specific view of device with minor "minor".
1028 struct raw3270_view *view, *tmp;
1032 view = ERR_PTR(-ENODEV);
1040 view = tmp;
1048 return view;
1053 * Remove view from device and free view structure via call to view->fn->free.
1055 void raw3270_del_view(struct raw3270_view *view)
1061 rp = view->dev;
1063 if (rp->view == view) {
1064 view->fn->deactivate(view);
1065 rp->view = NULL;
1067 list_del_init(&view->list);
1068 if (!rp->view && raw3270_state_ready(rp)) {
1069 /* Try to activate another view. */
1072 rp->view = nv;
1079 atomic_dec(&view->ref_count);
1080 wait_event(raw3270_wait_queue, atomic_read(&view->ref_count) == 0);
1081 if (view->fn->free)
1082 view->fn->free(view);
1240 /* Deactivate current view and remove all views. */
1242 if (rp->view) {
1243 if (rp->view->fn->deactivate)
1244 rp->view->fn->deactivate(rp->view);
1245 rp->view = NULL;