Lines Matching refs:cons

871 	struct gs_console *cons = req->context;
880 spin_lock(&cons->lock);
882 schedule_work(&cons->work);
883 spin_unlock(&cons->lock);
893 static void __gs_console_push(struct gs_console *cons)
895 struct usb_request *req = cons->req;
905 ep = cons->console.data;
906 size = kfifo_out(&cons->buf, req->buf, ep->maxpacket);
910 if (cons->missed && ep->maxpacket >= 64) {
914 len = sprintf(buf, "\n[missed %zu bytes]\n", cons->missed);
915 kfifo_in(&cons->buf, buf, len);
916 cons->missed = 0;
921 spin_unlock_irq(&cons->lock);
924 spin_lock_irq(&cons->lock);
929 struct gs_console *cons = container_of(work, struct gs_console, work);
931 spin_lock_irq(&cons->lock);
933 __gs_console_push(cons);
935 spin_unlock_irq(&cons->lock);
941 struct gs_console *cons = container_of(co, struct gs_console, console);
945 spin_lock_irqsave(&cons->lock, flags);
947 n = kfifo_in(&cons->buf, buf, count);
949 cons->missed += count - n;
951 if (cons->req && !cons->req->length)
952 schedule_work(&cons->work);
954 spin_unlock_irqrestore(&cons->lock, flags);
965 struct gs_console *cons = port->console;
969 if (!cons)
977 req->context = cons;
980 spin_lock(&cons->lock);
981 cons->req = req;
982 cons->console.data = ep;
983 spin_unlock(&cons->lock);
987 schedule_work(&cons->work);
994 struct gs_console *cons = port->console;
998 if (!cons)
1001 spin_lock(&cons->lock);
1003 req = cons->req;
1004 ep = cons->console.data;
1005 cons->req = NULL;
1007 spin_unlock(&cons->lock);
1018 struct gs_console *cons;
1024 cons = kzalloc(sizeof(*port->console), GFP_KERNEL);
1025 if (!cons)
1028 strcpy(cons->console.name, "ttyGS");
1029 cons->console.write = gs_console_write;
1030 cons->console.device = gs_console_device;
1031 cons->console.flags = CON_PRINTBUFFER;
1032 cons->console.index = port->port_num;
1034 INIT_WORK(&cons->work, gs_console_work);
1035 spin_lock_init(&cons->lock);
1037 err = kfifo_alloc(&cons->buf, GS_CONSOLE_BUF_SIZE, GFP_KERNEL);
1040 kfree(cons);
1044 port->console = cons;
1045 register_console(&cons->console);
1057 struct gs_console *cons = port->console;
1059 if (!cons)
1062 unregister_console(&cons->console);
1065 if (cons->req)
1069 cancel_work_sync(&cons->work);
1070 kfifo_free(&cons->buf);
1071 kfree(cons);