summaryrefslogtreecommitdiff
path: root/sound/firewire/fireworks/fireworks.h
diff options
context:
space:
mode:
authorTakashi Sakamoto <o-takashi@sakamocchi.jp>2014-04-25 17:45:13 +0400
committerTakashi Iwai <tiwai@suse.de>2014-05-26 16:28:58 +0400
commit555e8a8f7f149544eb7d4aa3a6420bc4c3055638 (patch)
tree9d2e78ab890ccb42bb21f9ec4cc3e21183dd81f3 /sound/firewire/fireworks/fireworks.h
parent594ddced821dee39a548efe46d7f834bae013505 (diff)
downloadlinux-555e8a8f7f149544eb7d4aa3a6420bc4c3055638.tar.xz
ALSA: fireworks: Add command/response functionality into hwdep interface
This commit adds two functionality for hwdep interface, adds two parameters for this driver, add a node for proc interface. To receive responses from devices, this driver already allocate own callback into initial memory space in host controller. This means no one can allocate its own callback to the address. So this driver must give a way for user applications to receive responses. This commit adds a functionality to receive responses via hwdep interface. The application can receive responses to read from this interface. To achieve this, this commit adds a buffer to queue responses. The default size of this buffer is 1024 bytes. This size can be changed to give preferrable size to 'resp_buf_size' parameter for this driver. The application should notice rest of space in this buffer because this driver don't push responses when this buffer has no space. Additionaly, this commit adds a functionality to transmit commands via hwdep interface. The application can transmit commands to write into this interface. I note that the application can transmit one command at once, but can receive as many responses as possible untill the user-buffer is full. When using these interfaces, the application must keep maximum number of sequence number in command within the number in firewire.h because this driver uses this number to distinguish the response is against the command by the application or this driver. Usually responses against commands which the application transmits are pushed into this buffer. But to enable 'resp_buf_debug' parameter for this driver, all responses are pushed into the buffer. When using this mode, I reccomend to expand the size of buffer. Finally this commit adds a new node into proc interface to output status of the buffer. Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/firewire/fireworks/fireworks.h')
-rw-r--r--sound/firewire/fireworks/fireworks.h22
1 files changed, 13 insertions, 9 deletions
diff --git a/sound/firewire/fireworks/fireworks.h b/sound/firewire/fireworks/fireworks.h
index 4aaf2dce5ec8..494195bd3296 100644
--- a/sound/firewire/fireworks/fireworks.h
+++ b/sound/firewire/fireworks/fireworks.h
@@ -49,6 +49,9 @@
*/
#define SND_EFW_RESPONSE_MAXIMUM_BYTES 0x200U
+extern unsigned int snd_efw_resp_buf_size;
+extern bool snd_efw_resp_buf_debug;
+
struct snd_efw_phys_grp {
u8 type; /* see enum snd_efw_grp_type */
u8 count;
@@ -97,23 +100,24 @@ struct snd_efw {
int dev_lock_count;
bool dev_lock_changed;
wait_queue_head_t hwdep_wait;
-};
-struct snd_efw_transaction {
- __be32 length;
- __be32 version;
- __be32 seqnum;
- __be32 category;
- __be32 command;
- __be32 status;
- __be32 params[0];
+ /* response queue */
+ u8 *resp_buf;
+ u8 *pull_ptr;
+ u8 *push_ptr;
+ unsigned int resp_queues;
};
+
+int snd_efw_transaction_cmd(struct fw_unit *unit,
+ const void *cmd, unsigned int size);
int snd_efw_transaction_run(struct fw_unit *unit,
const void *cmd, unsigned int cmd_size,
void *resp, unsigned int resp_size);
int snd_efw_transaction_register(void);
void snd_efw_transaction_unregister(void);
void snd_efw_transaction_bus_reset(struct fw_unit *unit);
+void snd_efw_transaction_add_instance(struct snd_efw *efw);
+void snd_efw_transaction_remove_instance(struct snd_efw *efw);
struct snd_efw_hwinfo {
u32 flags;