Lines Matching defs:port
60 static int fill_message(struct snd_fw_async_midi_port *port,
68 label = port->buf;
69 msg = port->buf + 1;
76 if (port->on_sysex) {
80 port->on_sysex = false;
86 if (!port->on_sysex) {
102 port->on_sysex = true;
107 status = port->running_status;
125 msg[0] = port->running_status;
132 port->running_status = msg[0];
149 struct snd_fw_async_midi_port *port = callback_data;
150 struct snd_rawmidi_substream *substream = READ_ONCE(port->substream);
152 /* This port is closed. */
157 snd_rawmidi_transmit_ack(substream, port->consume_bytes);
160 port->next_ktime = 0;
163 port->error = true;
165 port->idling = true;
168 schedule_work(&port->work);
173 struct snd_fw_async_midi_port *port =
175 struct snd_rawmidi_substream *substream = READ_ONCE(port->substream);
179 if (!port->idling || port->error)
187 if (ktime_after(port->next_ktime, ktime_get())) {
188 schedule_work(&port->work);
196 memset(port->buf, 0, 4);
197 port->consume_bytes = fill_message(port, substream);
198 if (port->consume_bytes <= 0) {
200 if (port->consume_bytes == 0) {
201 port->next_ktime = 0;
202 schedule_work(&port->work);
205 port->error = true;
211 port->next_ktime = ktime_add_ns(ktime_get(),
212 port->consume_bytes * 8 * (NSEC_PER_SEC / 31250));
215 port->idling = false;
225 generation = port->parent->generation;
228 fw_send_request(port->parent->card, &port->transaction,
230 port->parent->node_id, generation,
231 port->parent->max_speed,
233 port->buf, 4, async_midi_port_callback,
234 port);
237 void snd_fw_async_midi_port_init(struct snd_fw_async_midi_port *port)
239 port->idling = true;
240 port->error = false;
241 port->running_status = 0;
242 port->on_sysex = false;
254 unsigned int port;
266 port = b[0] >> 4;
268 if (port >= tscm->spec->midi_capture_ports)
284 substream = READ_ONCE(tscm->tx_midi_substreams[port]);