Lines Matching refs:cons

874 	struct gs_console *cons = req->context;
883 spin_lock(&cons->lock);
885 schedule_work(&cons->work);
886 spin_unlock(&cons->lock);
896 static void __gs_console_push(struct gs_console *cons)
898 struct usb_request *req = cons->req;
908 ep = cons->console.data;
909 size = kfifo_out(&cons->buf, req->buf, ep->maxpacket);
913 if (cons->missed && ep->maxpacket >= 64) {
917 len = sprintf(buf, "\n[missed %zu bytes]\n", cons->missed);
918 kfifo_in(&cons->buf, buf, len);
919 cons->missed = 0;
924 spin_unlock_irq(&cons->lock);
927 spin_lock_irq(&cons->lock);
932 struct gs_console *cons = container_of(work, struct gs_console, work);
934 spin_lock_irq(&cons->lock);
936 __gs_console_push(cons);
938 spin_unlock_irq(&cons->lock);
944 struct gs_console *cons = container_of(co, struct gs_console, console);
948 spin_lock_irqsave(&cons->lock, flags);
950 n = kfifo_in(&cons->buf, buf, count);
952 cons->missed += count - n;
954 if (cons->req && !cons->req->length)
955 schedule_work(&cons->work);
957 spin_unlock_irqrestore(&cons->lock, flags);
968 struct gs_console *cons = port->console;
972 if (!cons)
980 req->context = cons;
983 spin_lock(&cons->lock);
984 cons->req = req;
985 cons->console.data = ep;
986 spin_unlock(&cons->lock);
990 schedule_work(&cons->work);
997 struct gs_console *cons = port->console;
1001 if (!cons)
1004 spin_lock(&cons->lock);
1006 req = cons->req;
1007 ep = cons->console.data;
1008 cons->req = NULL;
1010 spin_unlock(&cons->lock);
1021 struct gs_console *cons;
1027 cons = kzalloc(sizeof(*port->console), GFP_KERNEL);
1028 if (!cons)
1031 strcpy(cons->console.name, "ttyGS");
1032 cons->console.write = gs_console_write;
1033 cons->console.device = gs_console_device;
1034 cons->console.flags = CON_PRINTBUFFER;
1035 cons->console.index = port->port_num;
1037 INIT_WORK(&cons->work, gs_console_work);
1038 spin_lock_init(&cons->lock);
1040 err = kfifo_alloc(&cons->buf, GS_CONSOLE_BUF_SIZE, GFP_KERNEL);
1043 kfree(cons);
1047 port->console = cons;
1048 register_console(&cons->console);
1060 struct gs_console *cons = port->console;
1062 if (!cons)
1065 unregister_console(&cons->console);
1068 if (cons->req)
1072 cancel_work_sync(&cons->work);
1073 kfifo_free(&cons->buf);
1074 kfree(cons);