Lines Matching refs:view

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