Lines Matching refs:session
562 struct vbg_session *session, in vbg_set_session_event_filter() argument
581 previous = session->event_filter; in vbg_set_session_event_filter()
582 session->event_filter |= or_mask; in vbg_set_session_event_filter()
583 session->event_filter &= ~not_mask; in vbg_set_session_event_filter()
586 changed = previous ^ session->event_filter; in vbg_set_session_event_filter()
609 session->event_filter); in vbg_set_session_event_filter()
610 session->event_filter = previous; in vbg_set_session_event_filter()
657 struct vbg_session *session, in vbg_set_session_capabilities() argument
676 previous = session->guest_caps; in vbg_set_session_capabilities()
677 session->guest_caps |= or_mask; in vbg_set_session_capabilities()
678 session->guest_caps &= ~not_mask; in vbg_set_session_capabilities()
681 changed = previous ^ session->guest_caps; in vbg_set_session_capabilities()
704 session->guest_caps); in vbg_set_session_capabilities()
705 session->guest_caps = previous; in vbg_set_session_capabilities()
899 struct vbg_session *session; in vbg_core_open_session() local
901 session = kzalloc(sizeof(*session), GFP_KERNEL); in vbg_core_open_session()
902 if (!session) in vbg_core_open_session()
905 session->gdev = gdev; in vbg_core_open_session()
906 session->user_session = user; in vbg_core_open_session()
908 return session; in vbg_core_open_session()
915 void vbg_core_close_session(struct vbg_session *session) in vbg_core_close_session() argument
917 struct vbg_dev *gdev = session->gdev; in vbg_core_close_session()
920 vbg_set_session_capabilities(gdev, session, 0, U32_MAX, true); in vbg_core_close_session()
921 vbg_set_session_event_filter(gdev, session, 0, U32_MAX, true); in vbg_core_close_session()
923 for (i = 0; i < ARRAY_SIZE(session->hgcm_client_ids); i++) { in vbg_core_close_session()
924 if (!session->hgcm_client_ids[i]) in vbg_core_close_session()
927 vbg_hgcm_disconnect(gdev, session->hgcm_client_ids[i], &rc); in vbg_core_close_session()
930 kfree(session); in vbg_core_close_session()
976 struct vbg_session *session, in vbg_wait_event_cond() argument
986 wakeup = events || session->cancel_waiters; in vbg_wait_event_cond()
995 struct vbg_session *session, in vbg_consume_events_locked() argument
1005 struct vbg_session *session, in vbg_ioctl_wait_for_events() argument
1026 vbg_wait_event_cond(gdev, session, event_mask), in vbg_ioctl_wait_for_events()
1031 if (timeout < 0 || session->cancel_waiters) { in vbg_ioctl_wait_for_events()
1037 vbg_consume_events_locked(gdev, session, event_mask); in vbg_ioctl_wait_for_events()
1052 struct vbg_session *session, in vbg_ioctl_interrupt_all_wait_events() argument
1061 session->cancel_waiters = true; in vbg_ioctl_interrupt_all_wait_events()
1076 static int vbg_req_allowed(struct vbg_dev *gdev, struct vbg_session *session, in vbg_req_allowed() argument
1155 if (trusted_apps_only && session->user_session) { in vbg_req_allowed()
1165 struct vbg_session *session, void *data) in vbg_ioctl_vmmrequest() argument
1179 ret = vbg_req_allowed(gdev, session, data); in vbg_ioctl_vmmrequest()
1190 struct vbg_session *session, in vbg_ioctl_hgcm_connect() argument
1201 for (i = 0; i < ARRAY_SIZE(session->hgcm_client_ids); i++) { in vbg_ioctl_hgcm_connect()
1202 if (!session->hgcm_client_ids[i]) { in vbg_ioctl_hgcm_connect()
1203 session->hgcm_client_ids[i] = U32_MAX; in vbg_ioctl_hgcm_connect()
1209 if (i >= ARRAY_SIZE(session->hgcm_client_ids)) in vbg_ioctl_hgcm_connect()
1218 session->hgcm_client_ids[i] = client_id; in vbg_ioctl_hgcm_connect()
1221 session->hgcm_client_ids[i] = 0; in vbg_ioctl_hgcm_connect()
1229 struct vbg_session *session, in vbg_ioctl_hgcm_disconnect() argument
1243 for (i = 0; i < ARRAY_SIZE(session->hgcm_client_ids); i++) { in vbg_ioctl_hgcm_disconnect()
1244 if (session->hgcm_client_ids[i] == client_id) { in vbg_ioctl_hgcm_disconnect()
1245 session->hgcm_client_ids[i] = U32_MAX; in vbg_ioctl_hgcm_disconnect()
1251 if (i >= ARRAY_SIZE(session->hgcm_client_ids)) in vbg_ioctl_hgcm_disconnect()
1258 session->hgcm_client_ids[i] = 0; in vbg_ioctl_hgcm_disconnect()
1260 session->hgcm_client_ids[i] = client_id; in vbg_ioctl_hgcm_disconnect()
1281 struct vbg_session *session, bool f32bit, in vbg_ioctl_hgcm_call() argument
1336 for (i = 0; i < ARRAY_SIZE(session->hgcm_client_ids); i++) in vbg_ioctl_hgcm_call()
1337 if (session->hgcm_client_ids[i] == client_id) in vbg_ioctl_hgcm_call()
1340 if (i >= ARRAY_SIZE(session->hgcm_client_ids)) { in vbg_ioctl_hgcm_call()
1381 struct vbg_session *session, in vbg_ioctl_change_filter_mask() argument
1395 return vbg_set_session_event_filter(gdev, session, or_mask, not_mask, in vbg_ioctl_change_filter_mask()
1400 struct vbg_session *session, struct vbg_ioctl_set_guest_caps *caps) in vbg_ioctl_change_guest_capabilities() argument
1414 ret = vbg_set_session_capabilities(gdev, session, or_mask, not_mask, in vbg_ioctl_change_guest_capabilities()
1419 caps->u.out.session_caps = session->guest_caps; in vbg_ioctl_change_guest_capabilities()
1467 int vbg_core_ioctl(struct vbg_session *session, unsigned int req, void *data) in vbg_core_ioctl() argument
1470 struct vbg_dev *gdev = session->gdev; in vbg_core_ioctl()
1487 return vbg_ioctl_vmmrequest(gdev, session, data); in vbg_core_ioctl()
1497 return vbg_ioctl_hgcm_connect(gdev, session, data); in vbg_core_ioctl()
1499 return vbg_ioctl_hgcm_disconnect(gdev, session, data); in vbg_core_ioctl()
1501 return vbg_ioctl_wait_for_events(gdev, session, data); in vbg_core_ioctl()
1503 return vbg_ioctl_interrupt_all_wait_events(gdev, session, data); in vbg_core_ioctl()
1505 return vbg_ioctl_change_filter_mask(gdev, session, data); in vbg_core_ioctl()
1507 return vbg_ioctl_change_guest_capabilities(gdev, session, data); in vbg_core_ioctl()
1522 return vbg_ioctl_hgcm_call(gdev, session, f32bit, data); in vbg_core_ioctl()