ether_addr_t addr;
int r;
- state.mode = m->DL_MODE;
+ state.mode = m->m_net_netdrv_dl_conf.mode;
atl2_set_mode();
addr.ea_addr[4] = (state.hwaddr[0] >> 8) & 0xff;
addr.ea_addr[5] = state.hwaddr[0] & 0xff;
- memcpy(m->DL_HWADDR, &addr, sizeof(addr));
+ memcpy(m->m_netdrv_net_dl_conf.hw_addr, &addr,
+ sizeof(m->m_netdrv_net_dl_conf.hw_addr));
m->m_type = DL_CONF_REPLY;
- m->DL_STAT = OK;
+ m->m_netdrv_net_dl_conf.stat = OK;
if ((r = ipc_send(m->m_source, m)) != OK)
printf("ATL2: unable to send reply (%d)\n", r);
/* TODO CHECK PROMISC AND MULTI */
dep->de_flags &= NOT(DEF_PROMISC | DEF_MULTI | DEF_BROAD);
- if (mp->DL_MODE & DL_PROMISC_REQ)
+ if (mp->m_net_netdrv_dl_conf.mode & DL_PROMISC_REQ)
dep->de_flags |= DEF_PROMISC | DEF_MULTI | DEF_BROAD;
- if (mp->DL_MODE & DL_MULTI_REQ) dep->de_flags |= DEF_MULTI;
- if (mp->DL_MODE & DL_BROAD_REQ) dep->de_flags |= DEF_BROAD;
+ if (mp->m_net_netdrv_dl_conf.mode & DL_MULTI_REQ)
+ dep->de_flags |= DEF_MULTI;
+ if (mp->m_net_netdrv_dl_conf.mode & DL_BROAD_REQ)
+ dep->de_flags |= DEF_BROAD;
break;
case DEM_SINK:
}
reply_mess.m_type = DL_CONF_REPLY;
- reply_mess.DL_STAT = r;
+ reply_mess.m_netdrv_net_dl_conf.stat = r;
if(r == OK){
- *(ether_addr_t *) reply_mess.DL_HWADDR = dep->de_address;
+ memcpy(reply_mess.m_netdrv_net_dl_conf.hw_addr, dep->de_address.ea_addr,
+ sizeof(reply_mess.m_netdrv_net_dl_conf.hw_addr));
}
if (ipc_send(mp->m_source, &reply_mess) != OK)
if (dep->de_mode == DEM_DISABLED)
{
/* Probe failed, or the device is configured off. */
- reply_mess.m_type= DL_CONF_REPLY;
- reply_mess.DL_STAT= ENXIO;
+ reply_mess.m_type = DL_CONF_REPLY;
+ reply_mess.m_netdrv_net_dl_conf.stat = ENXIO;
mess_reply(mp, &reply_mess);
return;
}
dep->de_address.ea_addr[5] = de_instance;
dp_confaddr(dep);
reply_mess.m_type = DL_CONF_REPLY;
- reply_mess.DL_STAT = OK;
- *(ether_addr_t *) reply_mess.DL_HWADDR = dep->de_address;
+ reply_mess.m_netdrv_net_dl_conf.stat = OK;
+ memcpy(reply_mess.m_netdrv_net_dl_conf.hw_addr,
+ dep->de_address.ea_addr,
+ sizeof(reply_mess.m_netdrv_net_dl_conf.hw_addr));
mess_reply(mp, &reply_mess);
return;
}
dep->de_flags &= ~(DEF_PROMISC | DEF_MULTI | DEF_BROAD);
- if (mp->DL_MODE & DL_PROMISC_REQ)
+ if (mp->m_net_netdrv_dl_conf.mode & DL_PROMISC_REQ)
dep->de_flags |= DEF_PROMISC | DEF_MULTI | DEF_BROAD;
- if (mp->DL_MODE & DL_MULTI_REQ)
+ if (mp->m_net_netdrv_dl_conf.mode & DL_MULTI_REQ)
dep->de_flags |= DEF_MULTI;
- if (mp->DL_MODE & DL_BROAD_REQ)
+ if (mp->m_net_netdrv_dl_conf.mode & DL_BROAD_REQ)
dep->de_flags |= DEF_BROAD;
dp_reinit(dep);
reply_mess.m_type = DL_CONF_REPLY;
- reply_mess.DL_STAT = OK;
- *(ether_addr_t *) reply_mess.DL_HWADDR = dep->de_address;
+ reply_mess.m_netdrv_net_dl_conf.stat = OK;
+
+ memcpy(reply_mess.m_netdrv_net_dl_conf.hw_addr, dep->de_address.ea_addr,
+ sizeof(reply_mess.m_netdrv_net_dl_conf.hw_addr));
mess_reply(mp, &reply_mess);
}
dep->de_flags |= DEF_ENABLED;
}
dep->de_flags &= NOT(DEF_PROMISC | DEF_MULTI | DEF_BROAD);
- if (mp->DL_MODE & DL_PROMISC_REQ)
+ if (mp->m_net_netdrv_dl_conf.mode & DL_PROMISC_REQ)
dep->de_flags |= DEF_PROMISC | DEF_MULTI | DEF_BROAD;
- if (mp->DL_MODE & DL_MULTI_REQ) dep->de_flags |= DEF_MULTI;
- if (mp->DL_MODE & DL_BROAD_REQ) dep->de_flags |= DEF_BROAD;
+ if (mp->m_net_netdrv_dl_conf.mode & DL_MULTI_REQ)
+ dep->de_flags |= DEF_MULTI;
+ if (mp->m_net_netdrv_dl_conf.mode & DL_BROAD_REQ)
+ dep->de_flags |= DEF_BROAD;
(*dep->de_flagsf) (dep);
break;
}
reply_mess.m_type = DL_CONF_REPLY;
- reply_mess.DL_STAT = r;
+ reply_mess.m_netdrv_net_dl_conf.stat = r;
if (r == OK)
- *(ether_addr_t *) reply_mess.DL_HWADDR = dep->de_address;
+ memcpy(reply_mess.m_netdrv_net_dl_conf.hw_addr, dep->de_address.ea_addr,
+ sizeof(reply_mess.m_netdrv_net_dl_conf.hw_addr));
DEBUG(printf("\t reply %d\n", reply_mess.m_type));
if (ipc_send(mp->m_source, &reply_mess) != OK) /* Can't send */
panic(SendErrMsg, mp->m_source);
if (!(e->status & E1000_ENABLED) && !(e1000_init_hw(e)))
{
reply_mess.m_type = DL_CONF_REPLY;
- reply_mess.DL_STAT = ENXIO;
+ reply_mess.m_netdrv_net_dl_conf.stat = ENXIO;
mess_reply(mp, &reply_mess);
return;
}
/* Reply back to INET. */
reply_mess.m_type = DL_CONF_REPLY;
- reply_mess.DL_STAT = OK;
- *(ether_addr_t *) reply_mess.DL_HWADDR = e->address;
+ reply_mess.m_netdrv_net_dl_conf.stat = OK;
+ memcpy(reply_mess.m_netdrv_net_dl_conf.hw_addr, e->address.ea_addr,
+ sizeof(reply_mess.m_netdrv_net_dl_conf.hw_addr));
mess_reply(mp, &reply_mess);
}
{
/* Probe failed, or the device is configured off. */
reply_mess.m_type= DL_CONF_REPLY;
- reply_mess.DL_STAT= ENXIO;
+ reply_mess.m_netdrv_net_dl_conf.stat= ENXIO;
mess_reply(mp, &reply_mess);
return;
}
fp->fxp_flags &= ~(FF_PROMISC | FF_MULTI | FF_BROAD);
- if (mp->DL_MODE & DL_PROMISC_REQ)
+ if (mp->m_net_netdrv_dl_conf.mode & DL_PROMISC_REQ)
fp->fxp_flags |= FF_PROMISC;
- if (mp->DL_MODE & DL_MULTI_REQ)
+ if (mp->m_net_netdrv_dl_conf.mode & DL_MULTI_REQ)
fp->fxp_flags |= FF_MULTI;
- if (mp->DL_MODE & DL_BROAD_REQ)
+ if (mp->m_net_netdrv_dl_conf.mode & DL_BROAD_REQ)
fp->fxp_flags |= FF_BROAD;
fxp_rec_mode(fp);
reply_mess.m_type = DL_CONF_REPLY;
- reply_mess.DL_STAT = OK;
- *(ether_addr_t *) reply_mess.DL_HWADDR = fp->fxp_address;
+ reply_mess.m_netdrv_net_dl_conf.stat = OK;
+ memcpy(reply_mess.m_netdrv_net_dl_conf.hw_addr,
+ fp->fxp_address.ea_addr,
+ sizeof(reply_mess.m_netdrv_net_dl_conf.hw_addr));
mess_reply(mp, &reply_mess);
}
if (!(lan8710a_state.status & LAN8710A_ENABLED) &&
!(lan8710a_init_hw())) {
reply.m_type = DL_CONF_REPLY;
- reply.DL_STAT = ENXIO;
+ reply.m_netdrv_net_dl_conf.stat = ENXIO;
mess_reply(m, &reply);
return;
}
/* Reply back to INET. */
reply.m_type = DL_CONF_REPLY;
- reply.DL_STAT = OK;
- *(ether_addr_t *) reply.DL_HWADDR = lan8710a_state.address;
+ reply.m_netdrv_net_dl_conf.stat = OK;
+ memcpy(reply.m_netdrv_net_dl_conf.hw_addr,
+ lan8710a_state.address,
+ sizeof(reply.m_netdrv_net_dl_conf.hw_addr));
mess_reply(m, &reply);
}
{
/* Probe failed, or the device is configured off. */
reply_mess.m_type= DL_CONF_REPLY;
- reply_mess.DL_STAT = ENXIO;
+ reply_mess.m_netdrv_net_dl_conf.stat = ENXIO;
mess_reply(mp, &reply_mess);
return;
}
ec->mac_address.ea_addr[5] = 0;
ec_confaddr(ec);
reply_mess.m_type = DL_CONF_REPLY;
- reply_mess.DL_STAT = OK;
- *(ether_addr_t *) reply_mess.DL_HWADDR = ec->mac_address;
+ reply_mess.m_netdrv_net_dl_conf.stat = OK;
+ memcpy(reply_mess.m_netdrv_net_dl_conf.hw_addr, ec->mac_address.ea_addr,
+ sizeof(reply_mess.m_netdrv_net_dl_conf.hw_addr));
mess_reply(mp, &reply_mess);
return;
}
ec->flags &= ~(ECF_PROMISC | ECF_MULTI | ECF_BROAD);
- if (mp->DL_MODE & DL_PROMISC_REQ)
+ if (mp->m_net_netdrv_dl_conf.mode & DL_PROMISC_REQ)
ec->flags |= ECF_PROMISC | ECF_MULTI | ECF_BROAD;
- if (mp->DL_MODE & DL_MULTI_REQ)
+ if (mp->m_net_netdrv_dl_conf.mode & DL_MULTI_REQ)
ec->flags |= ECF_MULTI;
- if (mp->DL_MODE & DL_BROAD_REQ)
+ if (mp->m_net_netdrv_dl_conf.mode & DL_BROAD_REQ)
ec->flags |= ECF_BROAD;
ec_reinit(ec);
reply_mess.m_type = DL_CONF_REPLY;
- reply_mess.DL_STAT = OK;
- *(ether_addr_t *) reply_mess.DL_HWADDR = ec->mac_address;
+ reply_mess.m_netdrv_net_dl_conf.stat = OK;
+ memcpy(reply_mess.m_netdrv_net_dl_conf.hw_addr, ec->mac_address.ea_addr,
+ sizeof(reply_mess.m_netdrv_net_dl_conf.hw_addr));
mess_reply(mp, &reply_mess);
}
or_init_struct (orp);
if (orp->or_mode == OR_M_DISABLED) {
reply.m_type = DL_CONF_REPLY;
- reply.DL_STAT = ENXIO;
+ reply.m_netdrv_net_dl_conf.stat = ENXIO;
mess_reply (mp, &reply);
return;
}
* multicasting, promiscuity, broadcasting, depending on the users
* needs */
orp->or_flags &= ~(OR_F_PROMISC | OR_F_MULTI | OR_F_BROAD);
- if (mp->DL_MODE & DL_PROMISC_REQ)
+ if (mp->m_net_netdrv_dl_conf.mode & DL_PROMISC_REQ)
orp->or_flags |= OR_F_PROMISC;
- if (mp->DL_MODE & DL_MULTI_REQ)
+ if (mp->m_net_netdrv_dl_conf.mode & DL_MULTI_REQ)
orp->or_flags |= OR_F_MULTI;
- if (mp->DL_MODE & DL_BROAD_REQ)
+ if (mp->m_net_netdrv_dl_conf.mode & DL_BROAD_REQ)
orp->or_flags |= OR_F_BROAD;
or_rec_mode (orp);
/* reply the caller that the configuration succeeded */
reply.m_type = DL_CONF_REPLY;
- reply.DL_STAT = OK;
- *(ether_addr_t *) reply.DL_HWADDR = orp->or_address;
+ reply.m_netdrv_net_dl_conf.stat = OK;
+ memcpy(reply.m_netdrv_net_dl_conf.hw_addr, orp->or_address.ea_addr,
+ sizeof(reply.m_netdrv_net_dl_conf.hw_addr));
mess_reply (mp, &reply);
}
{
/* Probe failed, or the device is configured off. */
reply_mess.m_type= DL_CONF_REPLY;
- reply_mess.DL_STAT= ENXIO;
+ reply_mess.m_netdrv_net_dl_conf.stat= ENXIO;
mess_reply(mp, &reply_mess);
return;
}
rep->re_flags &= ~(REF_PROMISC | REF_MULTI | REF_BROAD);
- if (mp->DL_MODE & DL_PROMISC_REQ)
+ if (mp->m_net_netdrv_dl_conf.mode & DL_PROMISC_REQ)
rep->re_flags |= REF_PROMISC;
- if (mp->DL_MODE & DL_MULTI_REQ)
+ if (mp->m_net_netdrv_dl_conf.mode & DL_MULTI_REQ)
rep->re_flags |= REF_MULTI;
- if (mp->DL_MODE & DL_BROAD_REQ)
+ if (mp->m_net_netdrv_dl_conf.mode & DL_BROAD_REQ)
rep->re_flags |= REF_BROAD;
rl_rec_mode(rep);
reply_mess.m_type = DL_CONF_REPLY;
- reply_mess.DL_STAT = OK;
- *(ether_addr_t *) reply_mess.DL_HWADDR = rep->re_address;
+ reply_mess.m_netdrv_net_dl_conf.stat = OK;
+ memcpy(reply_mess.m_netdrv_net_dl_conf.hw_addr,
+ rep->re_address.ea_addr,
+ sizeof(reply_mess.m_netdrv_net_dl_conf.hw_addr));
mess_reply(mp, &reply_mess);
}
if (rep->re_mode == REM_DISABLED) {
/* Probe failed, or the device is configured off. */
reply_mess.m_type = DL_CONF_REPLY;
- reply_mess.DL_STAT = ENXIO;
+ reply_mess.m_netdrv_net_dl_conf.stat = ENXIO;
mess_reply(mp, &reply_mess);
return;
}
rep->re_flags &= ~(REF_PROMISC | REF_MULTI | REF_BROAD);
- if (mp->DL_MODE & DL_PROMISC_REQ)
+ if (mp->m_net_netdrv_dl_conf.mode & DL_PROMISC_REQ)
rep->re_flags |= REF_PROMISC;
- if (mp->DL_MODE & DL_MULTI_REQ)
+ if (mp->m_net_netdrv_dl_conf.mode & DL_MULTI_REQ)
rep->re_flags |= REF_MULTI;
- if (mp->DL_MODE & DL_BROAD_REQ)
+ if (mp->m_net_netdrv_dl_conf.mode & DL_BROAD_REQ)
rep->re_flags |= REF_BROAD;
rl_rec_mode(rep);
reply_mess.m_type = DL_CONF_REPLY;
- reply_mess.DL_STAT = OK;
- *(ether_addr_t *) reply_mess.DL_HWADDR = rep->re_address;
+ reply_mess.m_netdrv_net_dl_conf.stat = OK;
+ memcpy(reply_mess.m_netdrv_net_dl_conf.hw_addr,
+ rep->re_address.ea_addr,
+ sizeof(reply_mess.m_netdrv_net_dl_conf.hw_addr));
mess_reply(mp, &reply_mess);
}
}
/* Prepare reply */
- for (i = 0; i < sizeof(virtio_net_mac); i++)
- ((u8_t*)reply.DL_HWADDR)[i] = virtio_net_mac[i];
+ memcpy(reply.m_netdrv_net_dl_conf.hw_addr, virtio_net_mac,
+ sizeof(reply.m_netdrv_net_dl_conf.hw_addr));
reply.m_type = DL_CONF_REPLY;
- reply.DL_STAT = OK;
- reply.DL_COUNT = 0;
+ reply.m_netdrv_net_dl_conf.stat = OK;
if ((r = ipc_send(m->m_source, &reply)) != OK)
panic("%s: ipc_send to %d failed (%d)", name, m->m_source, r);
/* Field names for data link layer messages. */
#define DL_COUNT m2_i3
-#define DL_MODE m2_l1
#define DL_FLAGS m2_l1
#define DL_GRANT m2_l2
#define DL_STAT m3_i1
-#define DL_HWADDR m3_ca1
/* Bits in 'DL_FLAGS' field of DL replies. */
# define DL_NOFLAGS 0x00
} mess_lsys_vfs_mapdriver;
_ASSERT_MSG_SIZE(mess_lsys_vfs_mapdriver);
+typedef struct {
+ int mode;
+
+ uint8_t padding[52];
+} mess_net_netdrv_dl_conf;
+_ASSERT_MSG_SIZE(mess_net_netdrv_dl_conf);
+
+typedef struct {
+ int stat;
+ uint8_t hw_addr[6];
+
+ uint8_t padding[46];
+} mess_netdrv_net_dl_conf;
+_ASSERT_MSG_SIZE(mess_netdrv_net_dl_conf);
+
typedef struct {
uid_t egid;
mess_lsys_vfs_copyfd m_lsys_vfs_copyfd;
mess_lsys_vfs_mapdriver m_lsys_vfs_mapdriver;
+ mess_net_netdrv_dl_conf m_net_netdrv_dl_conf;
+
+ mess_netdrv_net_dl_conf m_netdrv_net_dl_conf;
+
mess_pci_lsys_busc_get_bar m_pci_lsys_busc_get_bar;
mess_pm_lexec_exec_new m_pm_lexec_exec_new;
loc_port->etp_osdep.etp_state= OEPS_IDLE;
loc_port->etp_flags |= EPF_ENABLED;
- loc_port->etp_ethaddr= *(ether_addr_t *)m->DL_HWADDR;
+ memcpy(loc_port->etp_ethaddr.ea_addr,
+ m->m_netdrv_net_dl_conf.hw_addr,
+ sizeof(loc_port->etp_ethaddr.ea_addr));
if (!(loc_port->etp_flags & EPF_GOT_ADDR))
{
loc_port->etp_flags |= EPF_GOT_ADDR;
dl_flags |= DL_PROMISC_REQ;
mess.m_type= DL_CONF;
- mess.DL_MODE= dl_flags;
+ mess.m_net_netdrv_dl_conf.mode = dl_flags;
assert(eth_port->etp_osdep.etp_state == OEPS_IDLE);
r= asynsend(eth_port->etp_osdep.etp_task, &mess);
if (flags & NWEO_EN_PROMISC)
dl_flags |= DL_PROMISC_REQ;
mess.m_type= DL_CONF;
- mess.DL_MODE= dl_flags;
+ mess.m_net_netdrv_dl_conf.mode= dl_flags;
compare(eth_port->etp_osdep.etp_state, ==, OEPS_IDLE);
r= asynsend(eth_port->etp_osdep.etp_task, &mess);
static void nic_up(struct nic * nic, message * m)
{
- memcpy(nic->netif.hwaddr, m->DL_HWADDR, NETIF_MAX_HWADDR_LEN);
+ memcpy(nic->netif.hwaddr, m->m_netdrv_net_dl_conf.hw_addr,
+ sizeof(nic->netif.hwaddr));
debug_print("device %s is up MAC : %02x:%02x:%02x:%02x:%02x:%02x",
nic->name,
/* device capabilities */
netif->flags = NETIF_FLAG_ETHARP;
- m.DL_MODE = DL_NOMODE;
+ m.m_net_netdrv_dl_conf.mode = DL_NOMODE;
if (nic->flags & NWEO_EN_BROAD)
- m.DL_MODE |= DL_BROAD_REQ;
+ m.m_net_netdrv_dl_conf.mode |= DL_BROAD_REQ;
if (nic->flags & NWEO_EN_MULTI)
- m.DL_MODE |= DL_MULTI_REQ;
+ m.m_net_netdrv_dl_conf.mode |= DL_MULTI_REQ;
if (nic->flags & NWEO_EN_PROMISC)
- m.DL_MODE |= DL_PROMISC_REQ;
+ m.m_net_netdrv_dl_conf.mode |= DL_PROMISC_REQ;
m.m_type = DL_CONF;