Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0 */
0002 #ifndef SOUND_FIREWIRE_CMP_H_INCLUDED
0003 #define SOUND_FIREWIRE_CMP_H_INCLUDED
0004 
0005 #include <linux/mutex.h>
0006 #include <linux/types.h>
0007 #include "iso-resources.h"
0008 
0009 struct fw_unit;
0010 
0011 enum cmp_direction {
0012     CMP_INPUT = 0,
0013     CMP_OUTPUT,
0014 };
0015 
0016 /**
0017  * struct cmp_connection - manages an isochronous connection to a device
0018  * @speed: the connection's actual speed
0019  *
0020  * This structure manages (using CMP) an isochronous stream between the local
0021  * computer and a device's input plug (iPCR) and output plug (oPCR).
0022  *
0023  * There is no corresponding oPCR created on the local computer, so it is not
0024  * possible to overlay connections on top of this one.
0025  */
0026 struct cmp_connection {
0027     int speed;
0028     /* private: */
0029     bool connected;
0030     struct mutex mutex;
0031     struct fw_iso_resources resources;
0032     __be32 last_pcr_value;
0033     unsigned int pcr_index;
0034     unsigned int max_speed;
0035     enum cmp_direction direction;
0036 };
0037 
0038 int cmp_connection_init(struct cmp_connection *connection,
0039             struct fw_unit *unit,
0040             enum cmp_direction direction,
0041             unsigned int pcr_index);
0042 int cmp_connection_check_used(struct cmp_connection *connection, bool *used);
0043 void cmp_connection_destroy(struct cmp_connection *connection);
0044 
0045 int cmp_connection_reserve(struct cmp_connection *connection,
0046                unsigned int max_payload);
0047 void cmp_connection_release(struct cmp_connection *connection);
0048 
0049 int cmp_connection_establish(struct cmp_connection *connection);
0050 int cmp_connection_update(struct cmp_connection *connection);
0051 void cmp_connection_break(struct cmp_connection *connection);
0052 
0053 #endif