Lines Matching defs: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;
246 static int __raw3270_start(struct raw3270 *rp, struct raw3270_view *view,
249 rq->view = view;
250 raw3270_get_view(view);
257 raw3270_put_view(view);
265 int raw3270_view_active(struct raw3270_view *view)
267 struct raw3270 *rp = view->dev;
269 return rp && rp->view == view;
272 int raw3270_start(struct raw3270_view *view, struct raw3270_request *rq)
278 spin_lock_irqsave(get_ccwdev_lock(view->dev->cdev), flags);
279 rp = view->dev;
280 if (!rp || rp->view != view)
285 rc = __raw3270_start(rp, view, rq);
286 spin_unlock_irqrestore(get_ccwdev_lock(view->dev->cdev), flags);
291 int raw3270_start_request(struct raw3270_view *view, struct raw3270_request *rq,
303 return raw3270_start(view, rq);
307 int raw3270_start_locked(struct raw3270_view *view, struct raw3270_request *rq)
312 rp = view->dev;
313 if (!rp || rp->view != view)
318 rc = __raw3270_start(rp, view, rq);
323 int raw3270_start_irq(struct raw3270_view *view, struct raw3270_request *rq)
327 rp = view->dev;
328 rq->view = view;
329 raw3270_get_view(view);
341 struct raw3270_view *view;
348 view = rq ? rq->view : rp->view;
365 /* Call interrupt handler of the view */
366 if (view)
367 view->fn->intv(view, rq, irb);
380 raw3270_put_view(view);
398 raw3270_put_view(view);
536 struct raw3270_view *view;
539 list_for_each_entry(view, &rp->view_list, list) {
540 if (view->fn->resize)
541 view->fn->resize(view, rp->model, rp->rows, rp->cols,
547 /* Setup processing done, now activate a view */
548 list_for_each_entry(view, &rp->view_list, list) {
549 rp->view = view;
550 if (view->fn->activate(view) == 0)
552 rp->view = NULL;
558 rp->view = NULL;
565 struct raw3270 *rp = rq->view->dev;
612 struct raw3270 *rp = rq->view->dev;
633 if (rp->init_reset.view)
659 int raw3270_reset(struct raw3270_view *view)
664 rp = view->dev;
665 if (!rp || rp->view != view)
670 rc = raw3270_reset_device(view->dev);
678 struct raw3270_view *view;
681 rp->view = &rp->init_view;
685 view = rq->view;
690 raw3270_put_view(view);
696 static void raw3270_init_irq(struct raw3270_view *view, struct raw3270_request *rq,
711 rp = view->dev;
752 rp->view = &rp->init_view;
878 * view in the panic() context, due to locking restrictions.
880 int raw3270_view_lock_unavailable(struct raw3270_view *view)
882 struct raw3270 *rp = view->dev;
891 static int raw3270_assign_activate_view(struct raw3270 *rp, struct raw3270_view *view)
893 rp->view = view;
894 return view->fn->activate(view);
897 static int __raw3270_activate_view(struct raw3270 *rp, struct raw3270_view *view)
902 if (rp->view == view)
908 if (rp->view && rp->view->fn->deactivate) {
909 oldview = rp->view;
913 rc = raw3270_assign_activate_view(rp, view);
917 /* Didn't work. Try to reactivate the old view. */
924 /* Didn't work as well. Try any other view. */
926 if (nv == view || nv == oldview)
931 rp->view = NULL;
937 * Activate a view.
939 int raw3270_activate_view(struct raw3270_view *view)
945 rp = view->dev;
949 rc = __raw3270_activate_view(rp, view);
956 * Deactivate current view.
958 void raw3270_deactivate_view(struct raw3270_view *view)
963 rp = view->dev;
967 if (rp->view == view) {
968 view->fn->deactivate(view);
969 rp->view = NULL;
970 /* Move deactivated view to end of list. */
971 list_del_init(&view->list);
972 list_add_tail(&view->list, &rp->view_list);
973 /* Try to activate another view. */
975 list_for_each_entry(view, &rp->view_list, list) {
976 rp->view = view;
977 if (view->fn->activate(view) == 0)
979 rp->view = NULL;
988 * Add view to device with minor "minor".
990 int raw3270_add_view(struct raw3270_view *view, struct raw3270_fn *fn,
1005 atomic_set(&view->ref_count, 2);
1006 view->dev = rp;
1007 view->fn = fn;
1008 view->model = rp->model;
1009 view->rows = rp->rows;
1010 view->cols = rp->cols;
1011 view->ascebc = rp->ascebc;
1012 spin_lock_init(&view->lock);
1013 lockdep_set_subclass(&view->lock, subclass);
1014 list_add(&view->list, &rp->view_list);
1025 * Find specific view of device with minor "minor".
1030 struct raw3270_view *view, *tmp;
1034 view = ERR_PTR(-ENODEV);
1042 view = tmp;
1050 return view;
1055 * Remove view from device and free view structure via call to view->fn->free.
1057 void raw3270_del_view(struct raw3270_view *view)
1063 rp = view->dev;
1065 if (rp->view == view) {
1066 view->fn->deactivate(view);
1067 rp->view = NULL;
1069 list_del_init(&view->list);
1070 if (!rp->view && raw3270_state_ready(rp)) {
1071 /* Try to activate another view. */
1074 rp->view = nv;
1081 atomic_dec(&view->ref_count);
1082 wait_event(raw3270_wait_queue, atomic_read(&view->ref_count) == 0);
1083 if (view->fn->free)
1084 view->fn->free(view);
1242 /* Deactivate current view and remove all views. */
1244 if (rp->view) {
1245 if (rp->view->fn->deactivate)
1246 rp->view->fn->deactivate(rp->view);
1247 rp->view = NULL;