flags |= DL_PACK_RECV;
m.m_type = DL_TASK_REPLY;
- m.DL_FLAGS = flags;
- m.DL_COUNT = state.recv_count;
+ m.m_netdrv_net_dl_task.flags = flags;
+ m.m_netdrv_net_dl_task.count = state.recv_count;
ATL2_DEBUG(("ATL2: sending reply, flags %x count %d\n", flags,
- m.DL_COUNT));
+ m.m_netdrv_net_dl_task.count));
if ((r = ipc_send(state.task_endpt, &m)) != OK)
panic("unable to reply: %d", r);
if (dep->de_flags & DEF_ACK_RECV) flags |= DL_PACK_RECV;
reply.m_type = DL_TASK_REPLY;
- reply.DL_FLAGS = flags;
- reply.DL_COUNT = dep->de_read_s;
+ reply.m_netdrv_net_dl_task.flags = flags;
+ reply.m_netdrv_net_dl_task.count = dep->de_read_s;
r = ipc_send(dep->de_client, &reply);
flags |= DL_PACK_RECV;
reply.m_type = DL_TASK_REPLY;
- reply.DL_FLAGS = flags;
- reply.DL_COUNT = dep->de_read_s;
+ reply.m_netdrv_net_dl_task.flags = flags;
+ reply.m_netdrv_net_dl_task.count = dep->de_read_s;
r= ipc_send(dep->de_client, &reply);
if (r < 0)
if (dep->de_flags & DEF_ACK_RECV) flags |= DL_PACK_RECV;
reply.m_type = DL_TASK_REPLY;
- reply.DL_FLAGS = flags;
- reply.DL_COUNT = dep->de_read_s;
+ reply.m_netdrv_net_dl_task.flags = flags;
+ reply.m_netdrv_net_dl_task.count = dep->de_read_s;
- DEBUG(printf("\t reply %d (%lx)\n", reply.m_type, reply.DL_FLAGS));
+ DEBUG(printf("\t reply %d (%lx)\n", reply.m_type,
+ reply.m_netdrv_net_dl_task.flags));
if ((r = ipc_send(dep->de_client, &reply)) != OK)
panic(SendErrMsg, r);
}
/* Construct reply message. */
msg.m_type = DL_TASK_REPLY;
- msg.DL_FLAGS = DL_NOFLAGS;
- msg.DL_COUNT = 0;
+ msg.m_netdrv_net_dl_task.flags = DL_NOFLAGS;
+ msg.m_netdrv_net_dl_task.count = 0;
/* Did we successfully receive packet(s)? */
if (e->status & E1000_READING &&
e->status & E1000_RECEIVED)
{
- msg.DL_FLAGS |= DL_PACK_RECV;
- msg.DL_COUNT = e->rx_size >= ETH_MIN_PACK_SIZE ?
- e->rx_size : ETH_MIN_PACK_SIZE;
+ msg.m_netdrv_net_dl_task.flags |= DL_PACK_RECV;
+ msg.m_netdrv_net_dl_task.count =
+ e->rx_size >= ETH_MIN_PACK_SIZE ?
+ e->rx_size : ETH_MIN_PACK_SIZE;
/* Clear flags. */
e->status &= ~(E1000_READING | E1000_RECEIVED);
if (e->status & E1000_TRANSMIT &&
e->status & E1000_WRITING)
{
- msg.DL_FLAGS |= DL_PACK_SEND;
+ msg.m_netdrv_net_dl_task.flags |= DL_PACK_SEND;
/* Clear flags. */
e->status &= ~(E1000_WRITING | E1000_TRANSMIT);
flags |= DL_PACK_RECV;
reply.m_type = DL_TASK_REPLY;
- reply.DL_FLAGS = flags;
- reply.DL_COUNT = fp->fxp_read_s;
+ reply.m_netdrv_net_dl_task.flags = flags;
+ reply.m_netdrv_net_dl_task.count = fp->fxp_read_s;
r= ipc_send(fp->fxp_client, &reply);
}
/* Construct reply message. */
msg.m_type = DL_TASK_REPLY;
- msg.DL_FLAGS = DL_NOFLAGS;
- msg.DL_COUNT = 0;
+ msg.m_netdrv_net_dl_task.flags = DL_NOFLAGS;
+ msg.m_netdrv_net_dl_task.count = 0;
/* Did we successfully receive packet(s)? */
if (e->status & LAN8710A_READING &&
e->status & LAN8710A_RECEIVED) {
- msg.DL_FLAGS |= DL_PACK_RECV;
- msg.DL_COUNT = e->rx_size >= ETH_MIN_PACK_SIZE ?
- e->rx_size :
- ETH_MIN_PACK_SIZE;
+ msg.m_netdrv_net_dl_task.flags |= DL_PACK_RECV;
+ msg.m_netdrv_net_dl_task.count =
+ e->rx_size >= ETH_MIN_PACK_SIZE ?
+ e->rx_size : ETH_MIN_PACK_SIZE;
/* Clear flags. */
e->status &= ~(LAN8710A_READING | LAN8710A_RECEIVED);
/* Did we successfully transmit packet(s)? */
if (e->status & LAN8710A_TRANSMIT &&
e->status & LAN8710A_WRITING) {
- msg.DL_FLAGS |= DL_PACK_SEND;
+ msg.m_netdrv_net_dl_task.flags |= DL_PACK_SEND;
/* Clear flags. */
e->status &= ~(LAN8710A_WRITING | LAN8710A_TRANSMIT);
flags |= DL_PACK_RECV;
reply.m_type = DL_TASK_REPLY;
- reply.DL_FLAGS = flags;
- reply.DL_COUNT = ec->read_s;
+ reply.m_netdrv_net_dl_task.flags = flags;
+ reply.m_netdrv_net_dl_task.count = ec->read_s;
r = ipc_send(ec->client, &reply);
if (r < 0)
flags |= DL_PACK_RECV;
reply.m_type = DL_TASK_REPLY;
- reply.DL_FLAGS = flags;
- reply.DL_COUNT = orp->or_read_s;
+ reply.m_netdrv_net_dl_task.flags = flags;
+ reply.m_netdrv_net_dl_task.count = orp->or_read_s;
r = ipc_send(orp->or_client, &reply);
flags |= DL_PACK_RECV;
reply.m_type = DL_TASK_REPLY;
- reply.DL_FLAGS = flags;
- reply.DL_COUNT = rep->re_read_s;
+ reply.m_netdrv_net_dl_task.flags = flags;
+ reply.m_netdrv_net_dl_task.count = rep->re_read_s;
r= ipc_send(rep->re_client, &reply);
flags |= DL_PACK_RECV;
reply.m_type = DL_TASK_REPLY;
- reply.DL_FLAGS = flags;
- reply.DL_COUNT = rep->re_read_s;
+ reply.m_netdrv_net_dl_task.flags = flags;
+ reply.m_netdrv_net_dl_task.count = rep->re_read_s;
r = ipc_send(rep->re_client, &reply);
message reply;
reply.m_type = DL_TASK_REPLY;
- reply.DL_FLAGS = DL_NOFLAGS;
- reply.DL_COUNT = 0;
+ reply.m_netdrv_net_dl_task.flags = DL_NOFLAGS;
+ reply.m_netdrv_net_dl_task.count = 0;
/* Pending read and something in recv_list? */
if (!STAILQ_EMPTY(&recv_list) && rx_pending) {
dst = pending_rx_msg.m_source;
- reply.DL_COUNT = virtio_net_cpy_to_user(&pending_rx_msg);
- reply.DL_FLAGS |= DL_PACK_RECV;
+ reply.m_netdrv_net_dl_task.count =
+ virtio_net_cpy_to_user(&pending_rx_msg);
+ reply.m_netdrv_net_dl_task.flags |= DL_PACK_RECV;
rx_pending = 0;
}
if (!STAILQ_EMPTY(&free_list) && tx_pending) {
dst = pending_tx_msg.m_source;
virtio_net_cpy_from_user(&pending_tx_msg);
- reply.DL_FLAGS |= DL_PACK_SEND;
+ reply.m_netdrv_net_dl_task.flags |= DL_PACK_SEND;
tx_pending = 0;
}
/* Only reply if a pending request was handled */
- if (reply.DL_FLAGS != DL_NOFLAGS)
+ if (reply.m_netdrv_net_dl_task.flags != DL_NOFLAGS)
if ((r = ipc_send(dst, &reply)) != OK)
panic("%s: ipc_send to %d failed (%d)", name, dst, r);
}
message reply;
reply.m_type = DL_TASK_REPLY;
- reply.DL_FLAGS = DL_NOFLAGS;
- reply.DL_COUNT = 0;
+ reply.m_netdrv_net_dl_task.flags = DL_NOFLAGS;
+ reply.m_netdrv_net_dl_task.count = 0;
if (!STAILQ_EMPTY(&free_list)) {
/* free_list contains at least one packet, use it */
- reply.DL_COUNT = virtio_net_cpy_from_user(m);
- reply.DL_FLAGS = DL_PACK_SEND;
+ reply.m_netdrv_net_dl_task.count = virtio_net_cpy_from_user(m);
+ reply.m_netdrv_net_dl_task.flags = DL_PACK_SEND;
} else {
pending_tx_msg = *m;
tx_pending = 1;
message reply;
reply.m_type = DL_TASK_REPLY;
- reply.DL_FLAGS = DL_NOFLAGS;
- reply.DL_COUNT = 0;
+ reply.m_netdrv_net_dl_task.flags = DL_NOFLAGS;
+ reply.m_netdrv_net_dl_task.count = 0;
if (!STAILQ_EMPTY(&recv_list)) {
/* recv_list contains at least one packet, copy it */
- reply.DL_COUNT = virtio_net_cpy_to_user(m);
- reply.DL_FLAGS = DL_PACK_RECV;
+ reply.m_netdrv_net_dl_task.count = virtio_net_cpy_to_user(m);
+ reply.m_netdrv_net_dl_task.flags = DL_PACK_RECV;
} else {
rx_pending = 1;
pending_rx_msg = *m;
message reply;
reply.m_type = DL_STAT_REPLY;
- reply.DL_STAT = OK;
- reply.DL_COUNT = 0;
-
r = sys_safecopyto(m->m_source, m->m_net_netdrv_dl_getstat_s.grant, 0,
(vir_bytes)&virtio_net_stats,
/* Field names for data link layer messages. */
#define DL_COUNT m2_i3
-#define DL_FLAGS m2_l1
#define DL_GRANT m2_l2
-#define DL_STAT m3_i1
-/* Bits in 'DL_FLAGS' field of DL replies. */
+/* Bits in 'flags' field of DL replies. */
# define DL_NOFLAGS 0x00
# define DL_PACK_SEND 0x01
# define DL_PACK_RECV 0x02
} mess_net_netdrv_dl_getstat_s;
_ASSERT_MSG_SIZE(mess_net_netdrv_dl_getstat_s);
+typedef struct {
+ int count;
+ uint32_t flags;
+
+ uint8_t padding[48];
+} mess_netdrv_net_dl_task;
+_ASSERT_MSG_SIZE(mess_netdrv_net_dl_task);
+
typedef struct {
uid_t egid;
mess_net_netdrv_dl_getstat_s m_net_netdrv_dl_getstat_s;
mess_netdrv_net_dl_conf m_netdrv_net_dl_conf;
+ mess_netdrv_net_dl_task m_netdrv_net_dl_task;
mess_pci_lsys_busc_get_bar m_pci_lsys_busc_get_bar;
{
if (m_type == DL_TASK_REPLY)
{
- flags= m->DL_FLAGS;
+ flags= m->m_netdrv_net_dl_task.flags;
if (flags & DL_PACK_SEND)
write_int(loc_port);
if (flags & DL_PACK_RECV)
- read_int(loc_port, m->DL_COUNT);
+ read_int(loc_port, m->m_netdrv_net_dl_task.count);
return;
}
return;
}
- r= m->DL_STAT;
+ r= m->m_netdrv_net_dl_conf.stat;
if (r < 0)
{
ip_warning(("eth_rec: DL_CONF returned error %d\n",
{
if (m_type == DL_TASK_REPLY)
{
- flags= m->DL_FLAGS;
+ flags= m->m_netdrv_net_dl_task.flags;
if (flags & DL_PACK_SEND)
write_int(loc_port);
if (flags & DL_PACK_RECV)
- read_int(loc_port, m->DL_COUNT);
+ read_int(loc_port, m->m_netdrv_net_dl_task.count);
return;
}
(printf("etp_state = %d\n", loc_port->etp_osdep.etp_state), 0));
loc_port->etp_osdep.etp_state= OEPS_IDLE;
- flags= m->DL_FLAGS;
+ flags= m->m_netdrv_net_dl_task.flags;
if (flags & DL_PACK_SEND)
write_int(loc_port);
if (flags & DL_PACK_RECV)
- read_int(loc_port, m->DL_COUNT);
+ read_int(loc_port, m->m_netdrv_net_dl_task.count);
if (loc_port->etp_osdep.etp_state == OEPS_IDLE &&
loc_port->etp_osdep.etp_flags & OEPF_NEED_SEND)
switch (m->m_type) {
case DL_CONF_REPLY:
- if (m->DL_STAT == OK)
+ if (m->m_netdrv_net_dl_conf.stat == OK)
nic_up(nic, m);
break;
case DL_TASK_REPLY:
/*
- if (!(m->DL_FLAGS & DL_PACK_SEND) && !(m->DL_FLAGS & DL_PACK_RECV)) {
+ if (!(m->m_netdrv_net_dl_task.flags & DL_PACK_SEND) &&
+ !(m->m_netdrv_net_dl_task.flags & DL_PACK_RECV)) {
printf("void reply from driver\n");
break;
}
*/
- if (m->DL_FLAGS & DL_PACK_SEND)
+ if (m->m_netdrv_net_dl_task.flags & DL_PACK_SEND)
nic_pkt_sent(nic);
- if (m->DL_FLAGS & DL_PACK_RECV)
- nic_pkt_received(nic, m->DL_COUNT);
+ if (m->m_netdrv_net_dl_task.flags & DL_PACK_RECV)
+ nic_pkt_received(nic, m->m_netdrv_net_dl_task.count);
break;
case DL_STAT_REPLY:
break;