33 #define MSG_TIMEOUT_JIFFIES (400 * HZ) / 1000
35 #define MSG_DESCRIPTOR_SIZE 0x24
36 #define MSG_HEADER_SIZE (MSG_DESCRIPTOR_SIZE + 4)
38 #define MSG_DEFAULT_SIZE 512
40 #define MSG_TYPE_MASK 0x00000003
41 #define MSG_TYPE_NOTIFY 0
42 #define MSG_TYPE_COMMAND 1
43 #define MSG_TYPE_REQUEST 2
44 #define MSG_TYPE_ANSWER 3
45 #define MSG_CANCEL_NOTIFY_MASK 0x80000000
56 if (tailptr == headptr)
76 u32 msg_frame_address )
108 for(i=0; i <
size; i++) {
134 spin_unlock_irqrestore(&mgr->
msg_lock, flags);
150 u32 headptr, tailptr;
151 u32 msg_frame_address;
163 if (tailptr == headptr) {
197 for( i=0; i < msg->
size; i+=4 ) {
211 *msg_event = msg_frame_address;
248 init_waitqueue_entry(&wait,
current);
252 err = send_msg(mgr, request, max_resp_size, 1, &msg_frame);
275 resp.
data = resp_data;
276 resp.
size = max_resp_size;
278 err = get_msg(mgr, &resp, msg_frame);
304 init_waitqueue_entry(&wait,
current);
342 spin_unlock_irqrestore(&mgr->
msg_lock, flags);
362 spin_lock(&mgr->
lock);
377 resp.
data = mixart_msg_data;
378 resp.
size =
sizeof(mixart_msg_data);
379 err = get_msg(mgr, &resp, addr);
390 if(mixart_msg_data[0])
391 snd_printk(
KERN_ERR "tasklet : error MSG_STREAM_ST***_***PUT_STAGE_PACKET status=%x\n", mixart_msg_data[0]);
394 snd_printdd(
"tasklet received mf(%x) : msg_id(%x) uid(%x, %x) size(%zd)\n",
412 spin_unlock(&mgr->
lock);
425 spin_lock(&mgr->
lock);
430 spin_unlock(&mgr->
lock);
445 while (retrieve_msg_frame(mgr, &msg)) {
450 resp.
data = mixart_msg_data;
451 resp.
size =
sizeof(mixart_msg_data);
452 err = get_msg(mgr, &resp, msg & ~MSG_TYPE_MASK);
476 buffer_id, notify->
streams[i].sample_pos_low_part);
488 u64 sample_count = ((
u64)notify->
streams[i].sample_pos_high_part) << 32;
489 sample_count |= notify->
streams[
i].sample_pos_low_part;
494 if (new_elapse_pos > sample_count) {
509 spin_unlock(&mgr->
lock);
511 spin_lock(&mgr->
lock);
522 for(i=0; i<(resp.
size/4); i++) {
523 (mixart_msg_data)[i] =
cpu_to_be32((mixart_msg_data)[
i]);
526 ((
char*)mixart_msg_data)[resp.
size - 1] = 0;
527 snd_printdd(
"MIXART TRACE : %s\n", (
char*)mixart_msg_data);
537 msg &= ~MSG_CANCEL_NOTIFY_MASK;
559 snd_printdd(
"interrupt received request %x\n", msg);
568 spin_unlock(&mgr->
lock);