IKC interface changed

This commit is contained in:
Taku Shimosawa
2011-11-13 13:51:16 +09:00
parent d952688263
commit c863f43d01

View File

@@ -3,26 +3,31 @@
#include <aal/debug.h>
#include <aal/ikc.h>
#include <ikc/msg.h>
#include <kmalloc.h>
static struct aal_ikc_channel_desc mchannel;
static struct aal_ikc_channel_desc *mchannel;
static int arch_master_channel_packet_handler(struct aal_ikc_channel_desc *,
void *__packet, void *arg);
void ikc_master_init(void)
{
aal_mc_ikc_init_first(&mchannel, arch_master_channel_packet_handler);
kprintf("done.\n");
mchannel = kmalloc(sizeof(struct aal_ikc_channel_desc) +
sizeof(struct aal_ikc_master_packet), 0);
aal_mc_ikc_init_first(mchannel, arch_master_channel_packet_handler);
}
extern int host_ikc_inited;
static int arch_master_channel_packet_handler(struct aal_ikc_channel_desc *c,
void *__packet, void *arg)
{
struct aal_ikc_master_packet *packet = __packet;
switch (packet->msg) {
case MASTER_PACKET_INIT_ACK:
case AAL_IKC_MASTER_MSG_INIT_ACK:
kprintf("Master channel init acked.\n");
aal_ikc_send(&mchannel, packet, 0);
host_ikc_inited = 1;
break;
}
@@ -31,5 +36,5 @@ static int arch_master_channel_packet_handler(struct aal_ikc_channel_desc *c,
struct aal_ikc_channel_desc *aal_mc_get_master_channel(void)
{
return &mchannel;
return mchannel;
}