Lines Matching refs:view
52 struct raw3270_view *view; /* Active view. */
96 * Wait queue for device init/delete, view delete.
127 x = max_t(int, 0, rp->view->cols + x);
129 y = max_t(int, 0, rp->view->rows + y);
130 addr = (y * rp->view->cols) + x;
250 static int __raw3270_start(struct raw3270 *rp, struct raw3270_view *view,
253 rq->view = view;
254 raw3270_get_view(view);
261 raw3270_put_view(view);
269 int raw3270_view_active(struct raw3270_view *view)
271 struct raw3270 *rp = view->dev;
273 return rp && rp->view == view;
276 int raw3270_start(struct raw3270_view *view, struct raw3270_request *rq)
282 spin_lock_irqsave(get_ccwdev_lock(view->dev->cdev), flags);
283 rp = view->dev;
284 if (!rp || rp->view != view)
289 rc = __raw3270_start(rp, view, rq);
290 spin_unlock_irqrestore(get_ccwdev_lock(view->dev->cdev), flags);
295 int raw3270_start_request(struct raw3270_view *view, struct raw3270_request *rq,
307 return raw3270_start(view, rq);
311 int raw3270_start_locked(struct raw3270_view *view, struct raw3270_request *rq)
316 rp = view->dev;
317 if (!rp || rp->view != view)
322 rc = __raw3270_start(rp, view, rq);
327 int raw3270_start_irq(struct raw3270_view *view, struct raw3270_request *rq)
331 rp = view->dev;
332 rq->view = view;
333 raw3270_get_view(view);
345 struct raw3270_view *view;
352 view = rq ? rq->view : rp->view;
369 /* Call interrupt handler of the view */
370 if (view)
371 view->fn->intv(view, rq, irb);
384 raw3270_put_view(view);
402 raw3270_put_view(view);
540 struct raw3270_view *view;
543 list_for_each_entry(view, &rp->view_list, list) {
544 if (view->fn->resize)
545 view->fn->resize(view, rp->model, rp->rows, rp->cols,
551 /* Setup processing done, now activate a view */
552 list_for_each_entry(view, &rp->view_list, list) {
553 rp->view = view;
554 if (view->fn->activate(view) == 0)
556 rp->view = NULL;
562 rp->view = NULL;
569 struct raw3270 *rp = rq->view->dev;
616 struct raw3270 *rp = rq->view->dev;
637 if (rp->init_reset.view)
663 int raw3270_reset(struct raw3270_view *view)
668 rp = view->dev;
669 if (!rp || rp->view != view)
674 rc = raw3270_reset_device(view->dev);
682 struct raw3270_view *view;
685 rp->view = &rp->init_view;
689 view = rq->view;
694 raw3270_put_view(view);
700 static void raw3270_init_irq(struct raw3270_view *view, struct raw3270_request *rq,
715 rp = view->dev;
756 rp->view = &rp->init_view;
882 * view in the panic() context, due to locking restrictions.
884 int raw3270_view_lock_unavailable(struct raw3270_view *view)
886 struct raw3270 *rp = view->dev;
895 static int raw3270_assign_activate_view(struct raw3270 *rp, struct raw3270_view *view)
897 rp->view = view;
898 return view->fn->activate(view);
901 static int __raw3270_activate_view(struct raw3270 *rp, struct raw3270_view *view)
906 if (rp->view == view)
912 if (rp->view && rp->view->fn->deactivate) {
913 oldview = rp->view;
917 rc = raw3270_assign_activate_view(rp, view);
921 /* Didn't work. Try to reactivate the old view. */
928 /* Didn't work as well. Try any other view. */
930 if (nv == view || nv == oldview)
935 rp->view = NULL;
941 * Activate a view.
943 int raw3270_activate_view(struct raw3270_view *view)
949 rp = view->dev;
953 rc = __raw3270_activate_view(rp, view);
960 * Deactivate current view.
962 void raw3270_deactivate_view(struct raw3270_view *view)
967 rp = view->dev;
971 if (rp->view == view) {
972 view->fn->deactivate(view);
973 rp->view = NULL;
974 /* Move deactivated view to end of list. */
975 list_del_init(&view->list);
976 list_add_tail(&view->list, &rp->view_list);
977 /* Try to activate another view. */
979 list_for_each_entry(view, &rp->view_list, list) {
980 rp->view = view;
981 if (view->fn->activate(view) == 0)
983 rp->view = NULL;
992 * Add view to device with minor "minor".
994 int raw3270_add_view(struct raw3270_view *view, struct raw3270_fn *fn,
1009 atomic_set(&view->ref_count, 2);
1010 view->dev = rp;
1011 view->fn = fn;
1012 view->model = rp->model;
1013 view->rows = rp->rows;
1014 view->cols = rp->cols;
1015 view->ascebc = rp->ascebc;
1016 spin_lock_init(&view->lock);
1017 lockdep_set_subclass(&view->lock, subclass);
1018 list_add(&view->list, &rp->view_list);
1029 * Find specific view of device with minor "minor".
1034 struct raw3270_view *view, *tmp;
1038 view = ERR_PTR(-ENODEV);
1046 view = tmp;
1054 return view;
1059 * Remove view from device and free view structure via call to view->fn->free.
1061 void raw3270_del_view(struct raw3270_view *view)
1067 rp = view->dev;
1069 if (rp->view == view) {
1070 view->fn->deactivate(view);
1071 rp->view = NULL;
1073 list_del_init(&view->list);
1074 if (!rp->view && raw3270_state_ready(rp)) {
1075 /* Try to activate another view. */
1078 rp->view = nv;
1085 atomic_dec(&view->ref_count);
1086 wait_event(raw3270_wait_queue, atomic_read(&view->ref_count) == 0);
1087 if (view->fn->free)
1088 view->fn->free(view);
1246 /* Deactivate current view and remove all views. */
1248 if (rp->view) {
1249 if (rp->view->fn->deactivate)
1250 rp->view->fn->deactivate(rp->view);
1251 rp->view = NULL;