Lines Matching refs:serport

31 struct serport {  struct
46 struct serport *serport = serio->port_data; in serport_serio_write() argument
47 return -(serport->tty->ops->write(serport->tty, &data, 1) != 1); in serport_serio_write()
52 struct serport *serport = serio->port_data; in serport_serio_open() local
55 spin_lock_irqsave(&serport->lock, flags); in serport_serio_open()
56 set_bit(SERPORT_ACTIVE, &serport->flags); in serport_serio_open()
57 spin_unlock_irqrestore(&serport->lock, flags); in serport_serio_open()
65 struct serport *serport = serio->port_data; in serport_serio_close() local
68 spin_lock_irqsave(&serport->lock, flags); in serport_serio_close()
69 clear_bit(SERPORT_ACTIVE, &serport->flags); in serport_serio_close()
70 spin_unlock_irqrestore(&serport->lock, flags); in serport_serio_close()
80 struct serport *serport; in serport_ldisc_open() local
85 serport = kzalloc(sizeof(struct serport), GFP_KERNEL); in serport_ldisc_open()
86 if (!serport) in serport_ldisc_open()
89 serport->tty = tty; in serport_ldisc_open()
90 spin_lock_init(&serport->lock); in serport_ldisc_open()
91 init_waitqueue_head(&serport->wait); in serport_ldisc_open()
93 tty->disc_data = serport; in serport_ldisc_open()
106 struct serport *serport = tty->disc_data; in serport_ldisc_close() local
108 kfree(serport); in serport_ldisc_close()
120 struct serport *serport = tty->disc_data; in serport_ldisc_receive() local
125 spin_lock_irqsave(&serport->lock, flags); in serport_ldisc_receive()
127 if (!test_bit(SERPORT_ACTIVE, &serport->flags)) in serport_ldisc_receive()
147 serio_interrupt(serport->serio, cp[i], ch_flags); in serport_ldisc_receive()
151 spin_unlock_irqrestore(&serport->lock, flags); in serport_ldisc_receive()
164 struct serport *serport = tty->disc_data; in serport_ldisc_read() local
167 if (test_and_set_bit(SERPORT_BUSY, &serport->flags)) in serport_ldisc_read()
170 serport->serio = serio = kzalloc(sizeof(struct serio), GFP_KERNEL); in serport_ldisc_read()
176 serio->id = serport->id; in serport_ldisc_read()
181 serio->port_data = serport; in serport_ldisc_read()
184 serio_register_port(serport->serio); in serport_ldisc_read()
187 wait_event_interruptible(serport->wait, test_bit(SERPORT_DEAD, &serport->flags)); in serport_ldisc_read()
188 serio_unregister_port(serport->serio); in serport_ldisc_read()
189 serport->serio = NULL; in serport_ldisc_read()
191 clear_bit(SERPORT_DEAD, &serport->flags); in serport_ldisc_read()
192 clear_bit(SERPORT_BUSY, &serport->flags); in serport_ldisc_read()
199 struct serport *serport = tty->disc_data; in serport_set_type() local
201 serport->id.proto = type & 0x000000ff; in serport_set_type()
202 serport->id.id = (type & 0x0000ff00) >> 8; in serport_set_type()
203 serport->id.extra = (type & 0x00ff0000) >> 16; in serport_set_type()
248 struct serport *serport = tty->disc_data; in serport_ldisc_hangup() local
251 spin_lock_irqsave(&serport->lock, flags); in serport_ldisc_hangup()
252 set_bit(SERPORT_DEAD, &serport->flags); in serport_ldisc_hangup()
253 spin_unlock_irqrestore(&serport->lock, flags); in serport_ldisc_hangup()
255 wake_up_interruptible(&serport->wait); in serport_ldisc_hangup()
260 struct serport *serport = tty->disc_data; in serport_ldisc_write_wakeup() local
263 spin_lock_irqsave(&serport->lock, flags); in serport_ldisc_write_wakeup()
264 if (test_bit(SERPORT_ACTIVE, &serport->flags)) in serport_ldisc_write_wakeup()
265 serio_drv_write_wakeup(serport->serio); in serport_ldisc_write_wakeup()
266 spin_unlock_irqrestore(&serport->lock, flags); in serport_ldisc_write_wakeup()