+}
+static void process_client_cmd(struct ustcomm_header *recv_header,
+ char *recv_buf, int sock)
+{
+ int result;
+ struct ustcomm_header _reply_header;
+ struct ustcomm_header *reply_header = &_reply_header;
+ char *send_buf = send_buffer;
+
+ memset(reply_header, 0, sizeof(*reply_header));
+ memset(send_buf, 0, sizeof(send_buffer));
+
+ switch(recv_header->command) {
+ case GET_SUBBUF_NUM_SIZE:
+ case SET_SUBBUF_NUM:
+ case SET_SUBBUF_SIZE:
+ {
+ struct ustcomm_channel_info *ch_inf;
+ ch_inf = (struct ustcomm_channel_info *)recv_buf;
+ result = ustcomm_unpack_channel_info(ch_inf);
+ if (result < 0) {
+ ERR("couldn't unpack channel info");
+ reply_header->result = -EINVAL;
+ goto send_response;
+ }
+ process_channel_cmd(sock, recv_header->command, ch_inf);
+ return;
+ }
+ case GET_BUF_SHMID_PIPE_FD:
+ case NOTIFY_BUF_MAPPED:
+ case GET_SUBBUFFER:
+ case PUT_SUBBUFFER:
+ {
+ struct ustcomm_buffer_info *buf_inf;
+ buf_inf = (struct ustcomm_buffer_info *)recv_buf;
+ result = ustcomm_unpack_buffer_info(buf_inf);
+ if (result < 0) {
+ ERR("couldn't unpack buffer info");
+ reply_header->result = -EINVAL;
+ goto send_response;
+ }
+ process_buffer_cmd(sock, recv_header->command, buf_inf);
+ return;
+ }
+ case ENABLE_MARKER:
+ case DISABLE_MARKER:
+ {
+ struct ustcomm_ust_marker_info *ust_marker_inf;
+ ust_marker_inf = (struct ustcomm_ust_marker_info *)recv_buf;
+ result = ustcomm_unpack_ust_marker_info(ust_marker_inf);
+ if (result < 0) {
+ ERR("couldn't unpack ust_marker info");
+ reply_header->result = -EINVAL;
+ goto send_response;