Lines Matching refs:sysrq
582 struct sysrq_state *sysrq = in sysrq_reinject_alt_sysrq() local
584 struct input_handle *handle = &sysrq->handle; in sysrq_reinject_alt_sysrq()
585 unsigned int alt_code = sysrq->alt_use; in sysrq_reinject_alt_sysrq()
587 if (sysrq->need_reinject) { in sysrq_reinject_alt_sysrq()
589 sysrq->reinjecting = true; in sysrq_reinject_alt_sysrq()
602 sysrq->reinjecting = false; in sysrq_reinject_alt_sysrq()
609 struct sysrq_state *sysrq = handle->private; in sysrq_filter() local
610 bool was_active = sysrq->active; in sysrq_filter()
617 if (sysrq->reinjecting) in sysrq_filter()
633 if (sysrq->active && code == sysrq->alt_use) in sysrq_filter()
634 sysrq->active = false; in sysrq_filter()
636 sysrq->alt = KEY_RESERVED; in sysrq_filter()
639 sysrq->alt = code; in sysrq_filter()
640 sysrq->need_reinject = false; in sysrq_filter()
645 if (value == 1 && sysrq->alt != KEY_RESERVED) { in sysrq_filter()
646 sysrq->active = true; in sysrq_filter()
647 sysrq->alt_use = sysrq->alt; in sysrq_filter()
652 sysrq->need_reinject = true; in sysrq_filter()
663 if (sysrq->active) in sysrq_filter()
669 if (sysrq->active && value && value != 2) { in sysrq_filter()
670 sysrq->need_reinject = false; in sysrq_filter()
676 suppress = sysrq->active; in sysrq_filter()
678 if (!sysrq->active) { in sysrq_filter()
685 set_bit(code, sysrq->key_down); in sysrq_filter()
687 clear_bit(code, sysrq->key_down); in sysrq_filter()
690 schedule_work(&sysrq->reinject_work); in sysrq_filter()
693 test_and_clear_bit(code, sysrq->key_down)) { in sysrq_filter()
703 suppress = sysrq->active; in sysrq_filter()
714 struct sysrq_state *sysrq; in sysrq_connect() local
717 sysrq = kzalloc(sizeof(struct sysrq_state), GFP_KERNEL); in sysrq_connect()
718 if (!sysrq) in sysrq_connect()
721 INIT_WORK(&sysrq->reinject_work, sysrq_reinject_alt_sysrq); in sysrq_connect()
723 sysrq->handle.dev = dev; in sysrq_connect()
724 sysrq->handle.handler = handler; in sysrq_connect()
725 sysrq->handle.name = "sysrq"; in sysrq_connect()
726 sysrq->handle.private = sysrq; in sysrq_connect()
728 error = input_register_handle(&sysrq->handle); in sysrq_connect()
735 error = input_open_device(&sysrq->handle); in sysrq_connect()
744 input_unregister_handle(&sysrq->handle); in sysrq_connect()
746 kfree(sysrq); in sysrq_connect()
752 struct sysrq_state *sysrq = handle->private; in sysrq_disconnect() local
755 cancel_work_sync(&sysrq->reinject_work); in sysrq_disconnect()
757 kfree(sysrq); in sysrq_disconnect()