Message type for DL_GETSTAT_S

Change-Id: Ia5c2bf7a3d796a6a0463af70059e82fddd43d69c
This commit is contained in:
Lionel Sambuc 2014-05-19 19:40:12 +02:00
parent 50ab3b569d
commit 079646e056
14 changed files with 31 additions and 23 deletions

View file

@ -1056,7 +1056,7 @@ static void atl2_getstat(message *m)
*/
int r;
sys_safecopyto(m->m_source, m->DL_GRANT, 0,
sys_safecopyto(m->m_source, m->m_net_netdrv_dl_getstat_s.grant, 0,
(vir_bytes) &state.stat, sizeof(state.stat));
m->m_type = DL_STAT_REPLY;

View file

@ -176,9 +176,8 @@ static void do_get_stat_s(message * mp)
dep = &de_state;
if ((rc = sys_safecopyto(mp->m_source, mp->DL_GRANT, 0UL,
(vir_bytes)&dep->de_stat,
sizeof(dep->de_stat))) != OK)
if ((rc = sys_safecopyto(mp->m_source, mp->m_net_netdrv_dl_getstat_s.grant,
0, (vir_bytes)&dep->de_stat, sizeof(dep->de_stat))) != OK)
panic("%s %d", str_CopyErrMsg, rc);
mp->m_type = DL_STAT_REPLY;

View file

@ -582,7 +582,8 @@ message *mp;
if (dep->de_mode == DEM_SINK)
{
put_userdata_s(mp->m_source, (vir_bytes) mp->DL_GRANT,
put_userdata_s(mp->m_source,
mp->m_net_netdrv_dl_getstat_s.grant,
(vir_bytes) sizeof(dep->de_stat), &dep->de_stat);
mp->m_type= DL_STAT_REPLY;
@ -598,7 +599,7 @@ message *mp;
dep->de_stat.ets_frameAll += inb_reg0(dep, DP_CNTR1);
dep->de_stat.ets_missedP += inb_reg0(dep, DP_CNTR2);
put_userdata_s(mp->m_source, mp->DL_GRANT,
put_userdata_s(mp->m_source, mp->m_net_netdrv_dl_getstat_s.grant,
sizeof(dep->de_stat), &dep->de_stat);
mp->m_type= DL_STAT_REPLY;

View file

@ -434,9 +434,9 @@ static void do_getstat_s(const message * mp)
dep = &de_state;
if (dep->de_mode == DEM_ENABLED) (*dep->de_getstatsf) (dep);
if ((rc = sys_safecopyto(mp->m_source, mp->DL_GRANT, 0,
if ((rc = sys_safecopyto(mp->m_source, mp->m_net_netdrv_dl_getstat_s.grant, 0,
(vir_bytes)&dep->de_stat,
(vir_bytes) sizeof(dep->de_stat))) != OK)
(vir_bytes)sizeof(dep->de_stat))) != OK)
panic(CopyErrMsg, rc);
reply_mess.m_type = DL_STAT_REPLY;

View file

@ -791,8 +791,8 @@ message *mp;
stats.ets_CDheartbeat = 0;
stats.ets_OWC = 0;
sys_safecopyto(mp->m_source, mp->DL_GRANT, 0, (vir_bytes)&stats,
sizeof(stats));
sys_safecopyto(mp->m_source, mp->m_net_netdrv_dl_getstat_s.grant, 0,
(vir_bytes)&stats, sizeof(stats));
mp->m_type = DL_STAT_REPLY;
if((r=ipc_send(mp->m_source, mp)) != OK)
panic("e1000_getstat: ipc_send() failed: %d", r);

View file

@ -1429,8 +1429,8 @@ static void fxp_getstat_s(message *mp)
stats.ets_CDheartbeat= 0;
stats.ets_OWC= fp->fxp_stat.sc_tx_latecol;
r= sys_safecopyto(mp->m_source, mp->DL_GRANT, 0, (vir_bytes)&stats,
sizeof(stats));
r= sys_safecopyto(mp->m_source, mp->m_net_netdrv_dl_getstat_s.grant, 0,
(vir_bytes)&stats, sizeof(stats));
if (r != OK)
panic("fxp_getstat_s: sys_safecopyto failed: %d", r);

View file

@ -438,8 +438,8 @@ message *mp;
stats.ets_CDheartbeat = 0;
stats.ets_OWC = 0;
sys_safecopyto(mp->m_source, mp->DL_GRANT, 0, (vir_bytes)&stats,
sizeof(stats));
sys_safecopyto(mp->m_source, mp->m_net_netdrv_dl_getstat_s.grant, 0,
(vir_bytes)&stats, sizeof(stats));
mp->m_type = DL_STAT_REPLY;
if ((r=ipc_send(mp->m_source, mp)) != OK) {

View file

@ -1311,7 +1311,7 @@ message *mp;
ec= &ec_state;
r = sys_safecopyto(mp->m_source, mp->DL_GRANT, 0,
r = sys_safecopyto(mp->m_source, mp->m_net_netdrv_dl_getstat_s.grant, 0,
(vir_bytes)&ec->eth_stat, sizeof(ec->eth_stat));
if (r != OK)

View file

@ -1780,8 +1780,8 @@ static void or_getstat_s (message * mp) {
stats = orp->or_stat;
r = sys_safecopyto(mp->m_source, mp->DL_GRANT, 0,
(vir_bytes) &stats, sizeof(stats));
r = sys_safecopyto(mp->m_source, mp->m_net_netdrv_dl_getstat_s.grant,
0, (vir_bytes) &stats, sizeof(stats));
if(r != OK) {
panic("or_getstat_s: sys_safecopyto failed: %d", r);
}

View file

@ -1532,8 +1532,8 @@ message *mp;
stats= rep->re_stat;
r = sys_safecopyto(mp->m_source, mp->DL_GRANT, 0,
(vir_bytes) &stats, sizeof(stats));
r = sys_safecopyto(mp->m_source, mp->m_net_netdrv_dl_getstat_s.grant,
0, (vir_bytes) &stats, sizeof(stats));
if (r != OK)
panic("rl_getstat_s: sys_safecopyto failed: %d", r);

View file

@ -1531,8 +1531,8 @@ message *mp;
stats = rep->re_stat;
r = sys_safecopyto(mp->m_source, mp->DL_GRANT, 0,
(vir_bytes) &stats, sizeof(stats));
r = sys_safecopyto(mp->m_source, mp->m_net_netdrv_dl_getstat_s.grant,
0, (vir_bytes) &stats, sizeof(stats));
if (r != OK)
panic("rl_getstat_s: sys_safecopyto failed: %d", r);

View file

@ -552,7 +552,7 @@ virtio_net_getstat(message *m)
reply.DL_COUNT = 0;
r = sys_safecopyto(m->m_source, m->DL_GRANT, 0,
r = sys_safecopyto(m->m_source, m->m_net_netdrv_dl_getstat_s.grant, 0,
(vir_bytes)&virtio_net_stats,
sizeof(virtio_net_stats));

View file

@ -828,6 +828,13 @@ typedef struct {
} mess_netdrv_net_dl_conf;
_ASSERT_MSG_SIZE(mess_netdrv_net_dl_conf);
typedef struct {
cp_grant_id_t grant;
uint8_t padding[52];
} mess_net_netdrv_dl_getstat_s;
_ASSERT_MSG_SIZE(mess_net_netdrv_dl_getstat_s);
typedef struct {
uid_t egid;
@ -1409,6 +1416,7 @@ typedef struct {
mess_lsys_vfs_mapdriver m_lsys_vfs_mapdriver;
mess_net_netdrv_dl_conf m_net_netdrv_dl_conf;
mess_net_netdrv_dl_getstat_s m_net_netdrv_dl_getstat_s;
mess_netdrv_net_dl_conf m_netdrv_net_dl_conf;

View file

@ -832,7 +832,7 @@ eth_port_t *eth_port;
message mess;
mess.m_type= DL_GETSTAT_S;
mess.DL_GRANT= eth_port->etp_osdep.etp_stat_gid;
mess.m_net_netdrv_dl_getstat_s.grant= eth_port->etp_osdep.etp_stat_gid;
assert(eth_port->etp_osdep.etp_state == OEPS_IDLE);