Lines Matching +full:packet +full:- +full:processor

1 // SPDX-License-Identifier: GPL-2.0+
7 * and the service processor on IBM pSeries servers. On these servers, there
9 * console available either. However, the service processor has two standard
10 * serial ports, so this over-complicated protocol allows the OS to control
15 * control a modem attached to the service processor's serial port. Note that
53 * we pass data via two 8-byte registers, so we would like our char arrays
68 /* inbuf is for packet reassembly. leave a little room for leftovers. */
75 atomic_t seqno; /* HVSI packet sequence number */
101 return hp->flags & HVSI_CONSOLE; in is_console()
107 return (hp->state == HVSI_OPEN) in is_open()
108 || (hp->state == HVSI_WAIT_FOR_MCTRL_RESPONSE); in is_open()
122 const char *name = (hp->state < ARRAY_SIZE(state_names)) in print_state()
123 ? state_names[hp->state] : "UNKNOWN"; in print_state()
125 pr_debug("hvsi%i: state = %s\n", hp->index, name); in print_state()
131 hp->state = state; in __set_state()
133 wake_up_all(&hp->stateq); in __set_state()
140 spin_lock_irqsave(&hp->lock, flags); in set_state()
142 spin_unlock_irqrestore(&hp->lock, flags); in set_state()
145 static inline int len_packet(const uint8_t *packet) in len_packet() argument
147 return (int)((struct hvsi_header *)packet)->len; in len_packet()
150 static inline int is_header(const uint8_t *packet) in is_header() argument
152 struct hvsi_header *header = (struct hvsi_header *)packet; in is_header()
153 return header->type >= VS_QUERY_RESPONSE_PACKET_HEADER; in is_header()
156 static inline int got_packet(const struct hvsi_struct *hp, uint8_t *packet) in got_packet() argument
158 if (hp->inbuf_end < packet + sizeof(struct hvsi_header)) in got_packet()
159 return 0; /* don't even have the packet header */ in got_packet()
161 if (hp->inbuf_end < (packet + len_packet(packet))) in got_packet()
162 return 0; /* don't have the rest of the packet */ in got_packet()
170 int remaining = (int)(hp->inbuf_end - read_to); in compact_inbuf()
174 if (read_to != hp->inbuf) in compact_inbuf()
175 memmove(hp->inbuf, read_to, remaining); in compact_inbuf()
177 hp->inbuf_end = hp->inbuf + remaining; in compact_inbuf()
181 #define dbg_dump_packet(packet) dump_packet(packet) argument
184 #define dbg_dump_packet(packet) do { } while (0) argument
206 static void dump_packet(uint8_t *packet) in dump_packet() argument
208 struct hvsi_header *header = (struct hvsi_header *)packet; in dump_packet()
210 printk("type 0x%x, len %i, seqno %i:\n", header->type, header->len, in dump_packet()
211 header->seqno); in dump_packet()
213 dump_hex(packet, header->len); in dump_packet()
220 got = hvc_get_chars(hp->vtermno, buf, count); in hvsi_read()
225 static void hvsi_recv_control(struct hvsi_struct *hp, uint8_t *packet, in hvsi_recv_control() argument
228 struct hvsi_control *header = (struct hvsi_control *)packet; in hvsi_recv_control()
230 switch (be16_to_cpu(header->verb)) { in hvsi_recv_control()
232 if ((be32_to_cpu(header->word) & HVSI_TSCD) == 0) { in hvsi_recv_control()
234 pr_debug("hvsi%i: CD dropped\n", hp->index); in hvsi_recv_control()
235 hp->mctrl &= TIOCM_CD; in hvsi_recv_control()
241 pr_debug("hvsi%i: service processor came back\n", hp->index); in hvsi_recv_control()
242 if (hp->state != HVSI_CLOSED) { in hvsi_recv_control()
247 printk(KERN_WARNING "hvsi%i: unknown HVSI control packet: ", in hvsi_recv_control()
248 hp->index); in hvsi_recv_control()
249 dump_packet(packet); in hvsi_recv_control()
254 static void hvsi_recv_response(struct hvsi_struct *hp, uint8_t *packet) in hvsi_recv_response() argument
256 struct hvsi_query_response *resp = (struct hvsi_query_response *)packet; in hvsi_recv_response()
259 switch (hp->state) { in hvsi_recv_response()
264 hp->mctrl = 0; in hvsi_recv_response()
265 mctrl_word = be32_to_cpu(resp->u.mctrl_word); in hvsi_recv_response()
267 hp->mctrl |= TIOCM_DTR; in hvsi_recv_response()
269 hp->mctrl |= TIOCM_CD; in hvsi_recv_response()
273 printk(KERN_ERR "hvsi%i: unexpected query response: ", hp->index); in hvsi_recv_response()
274 dump_packet(packet); in hvsi_recv_response()
279 /* respond to service processor's version query */
282 struct hvsi_query_response packet __ALIGNED__; in hvsi_version_respond()
285 packet.hdr.type = VS_QUERY_RESPONSE_PACKET_HEADER; in hvsi_version_respond()
286 packet.hdr.len = sizeof(struct hvsi_query_response); in hvsi_version_respond()
287 packet.hdr.seqno = cpu_to_be16(atomic_inc_return(&hp->seqno)); in hvsi_version_respond()
288 packet.verb = cpu_to_be16(VSV_SEND_VERSION_NUMBER); in hvsi_version_respond()
289 packet.u.version = HVSI_VERSION; in hvsi_version_respond()
290 packet.query_seqno = cpu_to_be16(query_seqno+1); in hvsi_version_respond()
292 pr_debug("%s: sending %i bytes\n", __func__, packet.hdr.len); in hvsi_version_respond()
293 dbg_dump_hex((uint8_t*)&packet, packet.hdr.len); in hvsi_version_respond()
295 wrote = hvc_put_chars(hp->vtermno, (char *)&packet, packet.hdr.len); in hvsi_version_respond()
296 if (wrote != packet.hdr.len) { in hvsi_version_respond()
298 hp->index); in hvsi_version_respond()
299 return -EIO; in hvsi_version_respond()
305 static void hvsi_recv_query(struct hvsi_struct *hp, uint8_t *packet) in hvsi_recv_query() argument
307 struct hvsi_query *query = (struct hvsi_query *)packet; in hvsi_recv_query()
309 switch (hp->state) { in hvsi_recv_query()
311 hvsi_version_respond(hp, be16_to_cpu(query->hdr.seqno)); in hvsi_recv_query()
315 printk(KERN_ERR "hvsi%i: unexpected query: ", hp->index); in hvsi_recv_query()
316 dump_packet(packet); in hvsi_recv_query()
329 hp->sysrq = 1; in hvsi_insert_chars()
331 } else if (hp->sysrq) { in hvsi_insert_chars()
333 hp->sysrq = 0; in hvsi_insert_chars()
337 tty_insert_flip_char(&hp->port, c, 0); in hvsi_insert_chars()
350 static bool hvsi_recv_data(struct hvsi_struct *hp, const uint8_t *packet) in hvsi_recv_data() argument
352 const struct hvsi_header *header = (const struct hvsi_header *)packet; in hvsi_recv_data()
353 const uint8_t *data = packet + sizeof(struct hvsi_header); in hvsi_recv_data()
354 int datalen = header->len - sizeof(struct hvsi_header); in hvsi_recv_data()
355 int overflow = datalen - TTY_THRESHOLD_THROTTLE; in hvsi_recv_data()
375 memcpy(hp->throttle_buf, data + TTY_THRESHOLD_THROTTLE, overflow); in hvsi_recv_data()
376 hp->n_throttle = overflow; in hvsi_recv_data()
391 uint8_t *packet = hp->inbuf; in hvsi_load_chunk() local
397 chunklen = hvsi_read(hp, hp->inbuf_end, HVSI_MAX_READ); in hvsi_load_chunk()
399 pr_debug("%s: 0-length read\n", __func__); in hvsi_load_chunk()
404 dbg_dump_hex(hp->inbuf_end, chunklen); in hvsi_load_chunk()
406 hp->inbuf_end += chunklen; in hvsi_load_chunk()
409 while ((packet < hp->inbuf_end) && got_packet(hp, packet)) { in hvsi_load_chunk()
410 struct hvsi_header *header = (struct hvsi_header *)packet; in hvsi_load_chunk()
412 if (!is_header(packet)) { in hvsi_load_chunk()
413 printk(KERN_ERR "hvsi%i: got malformed packet\n", hp->index); in hvsi_load_chunk()
415 while ((packet < hp->inbuf_end) && (!is_header(packet))) in hvsi_load_chunk()
416 packet++; in hvsi_load_chunk()
420 pr_debug("%s: handling %i-byte packet\n", __func__, in hvsi_load_chunk()
421 len_packet(packet)); in hvsi_load_chunk()
422 dbg_dump_packet(packet); in hvsi_load_chunk()
424 switch (header->type) { in hvsi_load_chunk()
428 flip = hvsi_recv_data(hp, packet); in hvsi_load_chunk()
431 hvsi_recv_control(hp, packet, tty, handshake); in hvsi_load_chunk()
434 hvsi_recv_response(hp, packet); in hvsi_load_chunk()
437 hvsi_recv_query(hp, packet); in hvsi_load_chunk()
440 printk(KERN_ERR "hvsi%i: unknown HVSI packet type 0x%x\n", in hvsi_load_chunk()
441 hp->index, header->type); in hvsi_load_chunk()
442 dump_packet(packet); in hvsi_load_chunk()
446 packet += len_packet(packet); in hvsi_load_chunk()
454 compact_inbuf(hp, packet); in hvsi_load_chunk()
457 tty_flip_buffer_push(&hp->port); in hvsi_load_chunk()
465 hp->n_throttle); in hvsi_send_overflow()
467 hvsi_insert_chars(hp, hp->throttle_buf, hp->n_throttle); in hvsi_send_overflow()
468 hp->n_throttle = 0; in hvsi_send_overflow()
472 * must get all pending data because we only get an irq on empty->non-empty
485 tty = tty_port_tty_get(&hp->port); in hvsi_interrupt()
488 spin_lock_irqsave(&hp->lock, flags); in hvsi_interrupt()
490 spin_unlock_irqrestore(&hp->lock, flags); in hvsi_interrupt()
493 pr_debug("hvsi%i: attempting re-handshake\n", handshake->index); in hvsi_interrupt()
494 schedule_work(&handshake->handshaker); in hvsi_interrupt()
498 spin_lock_irqsave(&hp->lock, flags); in hvsi_interrupt()
499 if (tty && hp->n_throttle && !tty_throttled(tty)) { in hvsi_interrupt()
503 tty_flip_buffer_push(&hp->port); in hvsi_interrupt()
505 spin_unlock_irqrestore(&hp->lock, flags); in hvsi_interrupt()
518 hvsi_interrupt(hp->virq, (void *)hp); /* get pending data */ in poll_for_state()
520 if (hp->state == state) in poll_for_state()
525 return -EIO; in poll_for_state()
534 if (!wait_event_timeout(hp->stateq, (hp->state == state), HVSI_TIMEOUT)) in wait_for_state()
535 ret = -EIO; in wait_for_state()
542 struct hvsi_query packet __ALIGNED__; in hvsi_query()
545 packet.hdr.type = VS_QUERY_PACKET_HEADER; in hvsi_query()
546 packet.hdr.len = sizeof(struct hvsi_query); in hvsi_query()
547 packet.hdr.seqno = cpu_to_be16(atomic_inc_return(&hp->seqno)); in hvsi_query()
548 packet.verb = cpu_to_be16(verb); in hvsi_query()
550 pr_debug("%s: sending %i bytes\n", __func__, packet.hdr.len); in hvsi_query()
551 dbg_dump_hex((uint8_t*)&packet, packet.hdr.len); in hvsi_query()
553 wrote = hvc_put_chars(hp->vtermno, (char *)&packet, packet.hdr.len); in hvsi_query()
554 if (wrote != packet.hdr.len) { in hvsi_query()
555 printk(KERN_ERR "hvsi%i: couldn't send query (%i)!\n", hp->index, in hvsi_query()
557 return -EIO; in hvsi_query()
572 printk(KERN_ERR "hvsi%i: didn't get modem flags\n", hp->index); in hvsi_get_mctrl()
577 pr_debug("%s: mctrl 0x%x\n", __func__, hp->mctrl); in hvsi_get_mctrl()
585 struct hvsi_control packet __ALIGNED__; in hvsi_set_mctrl()
588 packet.hdr.type = VS_CONTROL_PACKET_HEADER; in hvsi_set_mctrl()
589 packet.hdr.seqno = cpu_to_be16(atomic_inc_return(&hp->seqno)); in hvsi_set_mctrl()
590 packet.hdr.len = sizeof(struct hvsi_control); in hvsi_set_mctrl()
591 packet.verb = cpu_to_be16(VSV_SET_MODEM_CTL); in hvsi_set_mctrl()
592 packet.mask = cpu_to_be32(HVSI_TSDTR); in hvsi_set_mctrl()
595 packet.word = cpu_to_be32(HVSI_TSDTR); in hvsi_set_mctrl()
597 pr_debug("%s: sending %i bytes\n", __func__, packet.hdr.len); in hvsi_set_mctrl()
598 dbg_dump_hex((uint8_t*)&packet, packet.hdr.len); in hvsi_set_mctrl()
600 wrote = hvc_put_chars(hp->vtermno, (char *)&packet, packet.hdr.len); in hvsi_set_mctrl()
601 if (wrote != packet.hdr.len) { in hvsi_set_mctrl()
602 printk(KERN_ERR "hvsi%i: couldn't set DTR!\n", hp->index); in hvsi_set_mctrl()
603 return -EIO; in hvsi_set_mctrl()
628 * user" and "it was just reset before it saw our handshake packet".) in hvsi_handshake()
635 printk(KERN_ERR "hvsi%i: couldn't send version query\n", hp->index); in hvsi_handshake()
654 printk(KERN_ERR "hvsi%i: re-handshaking failed\n", hp->index); in hvsi_handshaker()
657 * ttys will re-attempt the handshake via hvsi_open, but in hvsi_handshaker()
660 printk(KERN_ERR "hvsi%i: lost console!\n", hp->index); in hvsi_handshaker()
666 struct hvsi_data packet __ALIGNED__; in hvsi_put_chars()
671 packet.hdr.type = VS_DATA_PACKET_HEADER; in hvsi_put_chars()
672 packet.hdr.seqno = cpu_to_be16(atomic_inc_return(&hp->seqno)); in hvsi_put_chars()
673 packet.hdr.len = count + sizeof(struct hvsi_header); in hvsi_put_chars()
674 memcpy(&packet.data, buf, count); in hvsi_put_chars()
676 ret = hvc_put_chars(hp->vtermno, (char *)&packet, packet.hdr.len); in hvsi_put_chars()
677 if (ret == packet.hdr.len) { in hvsi_put_chars()
678 /* return the number of chars written, not the packet length */ in hvsi_put_chars()
686 struct hvsi_control packet __ALIGNED__; in hvsi_close_protocol()
688 packet.hdr.type = VS_CONTROL_PACKET_HEADER; in hvsi_close_protocol()
689 packet.hdr.seqno = cpu_to_be16(atomic_inc_return(&hp->seqno)); in hvsi_close_protocol()
690 packet.hdr.len = 6; in hvsi_close_protocol()
691 packet.verb = cpu_to_be16(VSV_CLOSE_PROTOCOL); in hvsi_close_protocol()
693 pr_debug("%s: sending %i bytes\n", __func__, packet.hdr.len); in hvsi_close_protocol()
694 dbg_dump_hex((uint8_t*)&packet, packet.hdr.len); in hvsi_close_protocol()
696 hvc_put_chars(hp->vtermno, (char *)&packet, packet.hdr.len); in hvsi_close_protocol()
707 hp = &hvsi_ports[tty->index]; in hvsi_open()
709 tty->driver_data = hp; in hvsi_open()
712 if (hp->state == HVSI_FSP_DIED) in hvsi_open()
713 return -EIO; in hvsi_open()
715 tty_port_tty_set(&hp->port, tty); in hvsi_open()
716 spin_lock_irqsave(&hp->lock, flags); in hvsi_open()
717 hp->port.count++; in hvsi_open()
718 atomic_set(&hp->seqno, 0); in hvsi_open()
719 h_vio_signal(hp->vtermno, VIO_IRQ_ENABLE); in hvsi_open()
720 spin_unlock_irqrestore(&hp->lock, flags); in hvsi_open()
727 printk(KERN_ERR "%s: HVSI handshaking failed\n", tty->name); in hvsi_open()
733 printk(KERN_ERR "%s: couldn't get initial modem flags\n", tty->name); in hvsi_open()
737 ret = hvsi_set_mctrl(hp, hp->mctrl | TIOCM_DTR); in hvsi_open()
739 printk(KERN_ERR "%s: couldn't set DTR\n", tty->name); in hvsi_open()
746 /* wait for hvsi_write_worker to empty hp->outbuf */
749 wait_event_timeout(hp->emptyq, (hp->n_outbuf <= 0), HVSI_TIMEOUT); in hvsi_flush_output()
752 cancel_delayed_work_sync(&hp->writer); in hvsi_flush_output()
753 flush_work(&hp->handshaker); in hvsi_flush_output()
759 hp->n_outbuf = 0; in hvsi_flush_output()
764 struct hvsi_struct *hp = tty->driver_data; in hvsi_close()
772 spin_lock_irqsave(&hp->lock, flags); in hvsi_close()
774 if (--hp->port.count == 0) { in hvsi_close()
775 tty_port_tty_set(&hp->port, NULL); in hvsi_close()
776 hp->inbuf_end = hp->inbuf; /* discard remaining partial packets */ in hvsi_close()
780 h_vio_signal(hp->vtermno, VIO_IRQ_DISABLE); /* no more irqs */ in hvsi_close()
786 tty->closing = 1; in hvsi_close()
788 spin_unlock_irqrestore(&hp->lock, flags); in hvsi_close()
791 synchronize_irq(hp->virq); in hvsi_close()
793 /* hvsi_write_worker will re-schedule until outbuf is empty. */ in hvsi_close()
805 spin_lock_irqsave(&hp->lock, flags); in hvsi_close()
807 } else if (hp->port.count < 0) in hvsi_close()
809 hp - hvsi_ports, hp->port.count); in hvsi_close()
811 spin_unlock_irqrestore(&hp->lock, flags); in hvsi_close()
816 struct hvsi_struct *hp = tty->driver_data; in hvsi_hangup()
821 tty_port_tty_set(&hp->port, NULL); in hvsi_hangup()
823 spin_lock_irqsave(&hp->lock, flags); in hvsi_hangup()
824 hp->port.count = 0; in hvsi_hangup()
825 hp->n_outbuf = 0; in hvsi_hangup()
826 spin_unlock_irqrestore(&hp->lock, flags); in hvsi_hangup()
829 /* called with hp->lock held */
834 if (hp->n_outbuf <= 0) in hvsi_push()
837 n = hvsi_put_chars(hp, hp->outbuf, hp->n_outbuf); in hvsi_push()
841 hp->n_outbuf = 0; in hvsi_push()
842 } else if (n == -EIO) { in hvsi_push()
844 printk(KERN_ERR "hvsi%i: service processor died\n", hp->index); in hvsi_push()
861 spin_lock_irqsave(&hp->lock, flags); in hvsi_write_worker()
863 pr_debug("%s: %i chars in buffer\n", __func__, hp->n_outbuf); in hvsi_write_worker()
867 * We could have a non-open connection if the service processor died in hvsi_write_worker()
869 * be minutes before the service processor comes back, so only try in hvsi_write_worker()
872 schedule_delayed_work(&hp->writer, HZ); in hvsi_write_worker()
877 if (hp->n_outbuf > 0) in hvsi_write_worker()
878 schedule_delayed_work(&hp->writer, 10); in hvsi_write_worker()
882 jiffies - start_j); in hvsi_write_worker()
885 wake_up_all(&hp->emptyq); in hvsi_write_worker()
886 tty_port_tty_wakeup(&hp->port); in hvsi_write_worker()
890 spin_unlock_irqrestore(&hp->lock, flags); in hvsi_write_worker()
895 struct hvsi_struct *hp = tty->driver_data; in hvsi_write_room()
897 return N_OUTBUF - hp->n_outbuf; in hvsi_write_room()
902 struct hvsi_struct *hp = tty->driver_data; in hvsi_chars_in_buffer()
904 return hp->n_outbuf; in hvsi_chars_in_buffer()
910 struct hvsi_struct *hp = tty->driver_data; in hvsi_write()
915 spin_lock_irqsave(&hp->lock, flags); in hvsi_write()
917 pr_debug("%s: %i chars in buffer\n", __func__, hp->n_outbuf); in hvsi_write()
926 * when the hypervisor buffer (16K) fills, data will stay in hp->outbuf in hvsi_write()
933 BUG_ON(hp->n_outbuf < 0); in hvsi_write()
934 memcpy(hp->outbuf + hp->n_outbuf, source, chunksize); in hvsi_write()
935 hp->n_outbuf += chunksize; in hvsi_write()
939 count -= chunksize; in hvsi_write()
943 if (hp->n_outbuf > 0) { in hvsi_write()
948 schedule_delayed_work(&hp->writer, 10); in hvsi_write()
952 spin_unlock_irqrestore(&hp->lock, flags); in hvsi_write()
967 struct hvsi_struct *hp = tty->driver_data; in hvsi_throttle()
971 h_vio_signal(hp->vtermno, VIO_IRQ_DISABLE); in hvsi_throttle()
976 struct hvsi_struct *hp = tty->driver_data; in hvsi_unthrottle()
981 spin_lock_irqsave(&hp->lock, flags); in hvsi_unthrottle()
982 if (hp->n_throttle) { in hvsi_unthrottle()
984 tty_flip_buffer_push(&hp->port); in hvsi_unthrottle()
986 spin_unlock_irqrestore(&hp->lock, flags); in hvsi_unthrottle()
989 h_vio_signal(hp->vtermno, VIO_IRQ_ENABLE); in hvsi_unthrottle()
994 struct hvsi_struct *hp = tty->driver_data; in hvsi_tiocmget()
997 return hp->mctrl; in hvsi_tiocmget()
1003 struct hvsi_struct *hp = tty->driver_data; in hvsi_tiocmset()
1011 spin_lock_irqsave(&hp->lock, flags); in hvsi_tiocmset()
1013 new_mctrl = (hp->mctrl & ~clear) | set; in hvsi_tiocmset()
1015 if (hp->mctrl != new_mctrl) { in hvsi_tiocmset()
1017 hp->mctrl = new_mctrl; in hvsi_tiocmset()
1019 spin_unlock_irqrestore(&hp->lock, flags); in hvsi_tiocmset()
1047 driver->driver_name = "hvsi"; in hvsi_init()
1048 driver->name = "hvsi"; in hvsi_init()
1049 driver->major = HVSI_MAJOR; in hvsi_init()
1050 driver->minor_start = HVSI_MINOR; in hvsi_init()
1051 driver->type = TTY_DRIVER_TYPE_SYSTEM; in hvsi_init()
1052 driver->init_termios = tty_std_termios; in hvsi_init()
1053 driver->init_termios.c_cflag = B9600 | CS8 | CREAD | HUPCL; in hvsi_init()
1054 driver->init_termios.c_ispeed = 9600; in hvsi_init()
1055 driver->init_termios.c_ospeed = 9600; in hvsi_init()
1062 tty_port_link_device(&hp->port, driver, i); in hvsi_init()
1064 ret = request_irq(hp->virq, hvsi_interrupt, 0, "hvsi", hp); in hvsi_init()
1067 hp->virq, ret); in hvsi_init()
1087 free_irq(hp->virq, hp); in hvsi_init()
1100 struct hvsi_struct *hp = &hvsi_ports[console->index]; in hvsi_console_print()
1110 * ugh, we have to translate LF -> CRLF ourselves, in place. in hvsi_console_print()
1121 --count; in hvsi_console_print()
1127 i -= ret; in hvsi_console_print()
1135 *index = console->index; in hvsi_console_device()
1144 if (console->index < 0 || console->index >= hvsi_count) in hvsi_console_setup()
1145 return -EINVAL; in hvsi_console_setup()
1146 hp = &hvsi_ports[console->index]; in hvsi_console_setup()
1148 /* give the FSP a chance to change the baud rate when we re-open */ in hvsi_console_setup()
1159 ret = hvsi_set_mctrl(hp, hp->mctrl | TIOCM_DTR); in hvsi_console_setup()
1163 hp->flags |= HVSI_CONSOLE; in hvsi_console_setup()
1174 .index = -1,
1184 for_each_compatible_node(vty, "serial", "hvterm-protocol") { in hvsi_console_init()
1199 INIT_DELAYED_WORK(&hp->writer, hvsi_write_worker); in hvsi_console_init()
1200 INIT_WORK(&hp->handshaker, hvsi_handshaker); in hvsi_console_init()
1201 init_waitqueue_head(&hp->emptyq); in hvsi_console_init()
1202 init_waitqueue_head(&hp->stateq); in hvsi_console_init()
1203 spin_lock_init(&hp->lock); in hvsi_console_init()
1204 tty_port_init(&hp->port); in hvsi_console_init()
1205 hp->index = hvsi_count; in hvsi_console_init()
1206 hp->inbuf_end = hp->inbuf; in hvsi_console_init()
1207 hp->state = HVSI_CLOSED; in hvsi_console_init()
1208 hp->vtermno = be32_to_cpup(vtermno); in hvsi_console_init()
1209 hp->virq = irq_create_mapping(NULL, be32_to_cpup(irq)); in hvsi_console_init()
1210 if (hp->virq == 0) { in hvsi_console_init()
1213 tty_port_destroy(&hp->port); in hvsi_console_init()