Add a new field "direction" to snd_seq_port_info for allowing a client to tell the expected direction of the port access. A port might still allow subscriptions for read/write (e.g. for MIDI-CI) even if the primary usage of the port is a single direction (either input or output only). This new "direction" field can help to indicate such cases. When the direction is unspecified at creating a port and the port has either read or write capability, the corresponding direction bits are set automatically as default.
Showing the changes to include/uapi (1 of 7 files). Show all
Unified · Split
| @@ -455,6 +455,12 @@ struct snd_seq_remove_events { · 454 unmodified lines | ||
| 455 | 455 | #define SNDRV_SEQ_PORT_FLG_TIMESTAMP (1<<1) |
| 456 | 456 | #define SNDRV_SEQ_PORT_FLG_TIME_REAL (1<<2) |
| 457 | 457 | |
| 458 | +/* port direction */ | |
| 459 | +#define SNDRV_SEQ_PORT_DIR_UNKNOWN 0 | |
| 460 | +#define SNDRV_SEQ_PORT_DIR_INPUT 1 | |
| 461 | +#define SNDRV_SEQ_PORT_DIR_OUTPUT 2 | |
| 462 | +#define SNDRV_SEQ_PORT_DIR_BIDIRECTION 3 | |
| 463 | + | |
| 458 | 464 | struct snd_seq_port_info { |
| 459 | 465 | struct snd_seq_addr addr; /* client/port numbers */ |
| 460 | 466 | char name[64]; /* port name */ |
| @@ -471,7 +477,8 @@ struct snd_seq_port_info { · 10 unmodified lines | ||
| 471 | 477 | void *kernel; /* reserved for kernel use (must be NULL) */ |
| 472 | 478 | unsigned int flags; /* misc. conditioning */ |
| 473 | 479 | unsigned char time_queue; /* queue # for timestamping */ |
| 474 | − char reserved[59]; /* for future use */ | |
| 480 | + unsigned char direction; /* port usage direction (r/w/bidir) */ | |
| 481 | + char reserved[58]; /* for future use */ | |
| 475 | 482 | }; |
| 476 | 483 | |
| 477 | 484 | |