for (i= 0, dep= de_table; i<DE_PORT_NR; i++, dep++)
{
if (!dep->de_pci)
+ {
+ printf("pci: no pci for port %d\n", i);
continue;
+ }
if (((dep->de_pcibus | dep->de_pcidev |
dep->de_pcifunc) != 0) != h)
{
static void do_getstat(mp)
message *mp;
{
- int port;
+ int port, r;
dpeth_t *dep;
port = mp->DL_PORT;
{
put_userdata(mp->DL_PROC, (vir_bytes) mp->DL_ADDR,
(vir_bytes) sizeof(dep->de_stat), &dep->de_stat);
- reply(dep, OK, FALSE);
+
+ mp->m_type= DL_STAT_REPLY;
+ mp->DL_PORT= port;
+ mp->DL_STAT= OK;
+ r= send(mp->m_source, mp);
+ if (r != OK)
+ panic(__FILE__, "do_getstat: send failed: %d\n", r);
return;
}
assert(dep->de_mode == DEM_ENABLED);
put_userdata(mp->DL_PROC, (vir_bytes) mp->DL_ADDR,
(vir_bytes) sizeof(dep->de_stat), &dep->de_stat);
- reply(dep, OK, FALSE);
+
+ mp->m_type= DL_STAT_REPLY;
+ mp->DL_PORT= port;
+ mp->DL_STAT= OK;
+ r= send(mp->m_source, mp);
+ if (r != OK)
+ panic(__FILE__, "do_getstat: send failed: %d\n", r);
}
/*===========================================================================*
static void do_getstat_s(mp)
message *mp;
{
- int port;
+ int port, r;
dpeth_t *dep;
port = mp->DL_PORT;
{
put_userdata(mp->DL_PROC, (vir_bytes) mp->DL_ADDR,
(vir_bytes) sizeof(dep->de_stat), &dep->de_stat);
- reply(dep, OK, FALSE);
+
+ mp->m_type= DL_STAT_REPLY;
+ mp->DL_PORT= port;
+ mp->DL_STAT= OK;
+ r= send(mp->m_source, mp);
+ if (r != OK)
+ panic(__FILE__, "do_getstat: send failed: %d\n", r);
return;
}
assert(dep->de_mode == DEM_ENABLED);
put_userdata_s(mp->DL_PROC, mp->DL_GRANT,
sizeof(dep->de_stat), &dep->de_stat);
- reply(dep, OK, FALSE);
+
+ mp->m_type= DL_STAT_REPLY;
+ mp->DL_PORT= port;
+ mp->DL_STAT= OK;
+ r= send(mp->m_source, mp);
+ if (r != OK)
+ panic(__FILE__, "do_getstat: send failed: %d\n", r);
}
/*===========================================================================*
r= sys_inb(port, &value);
if (r != OK)
+ {
+ printf("inb failed for port 0x%x\n", port);
panic("DP8390","sys_inb failed", r);
+ }
return value;
}
};
_PROTOTYPE( static void rtl_init, (struct dpeth *dep) );
+#if 0
_PROTOTYPE( static u16_t get_ee_word, (dpeth_t *dep, int a) );
_PROTOTYPE( static void ee_wen, (dpeth_t *dep) );
_PROTOTYPE( static void set_ee_word, (dpeth_t *dep, int a, U16_t w) );
_PROTOTYPE( static void ee_wds, (dpeth_t *dep) );
+#endif
_PROTOTYPE( static void micro_delay, (unsigned long usecs) );
PUBLIC int rtl_probe(dep)
for(;;)
{
- for (i= 0; pcitab[i].vid != 0; i++)
+ for (i= 0; pcitab[i].vid != 0 || pcitab[i].did != 0; i++)
{
if (pcitab[i].vid != vid)
continue;
}
break;
}
- if (pcitab[i].vid != 0)
+ if (pcitab[i].vid != 0 || pcitab[i].did != 0)
break;
if (just_one)
printf("\n");
#endif
+#if 0
if (getenv("RTL8029MN"))
{
ee_wen(dep);
assert(get_ee_word(dep, 0x76/2) == 0x8029);
}
+#endif
}
+#if 0
static u16_t get_ee_word(dep, a)
dpeth_t *dep;
int a;
outb_reg3(dep, 1, 0x00); /* back to normal */
outb_reg0(dep, DP_CR, CR_PS_P0); /* back to bank 0 */
}
+#endif
static void micro_delay(unsigned long usecs)
{
* |DL_GETSTAT_S| port nr | proc nr | | | | grant |
* |------------|----------|---------|----------|---------|---------|---------|
* | DL_STOP | port_nr | | | | | |
- * |------------|----------|---------|----------|---------|---------|---------|
+ * |------------+----------+---------+----------+---------+---------+---------|
*
* The messages sent are:
*
* |DL_CONF_REPLY| port nr | last port | ethernet addr |
* |-------------+---------+-----------+---------------|
*
+ * m_type DL_PORT DL_STAT
+ * |------------|---------|-----------|
+ * |DL_STAT_REPL| port nr | err |
+ * |------------|---------|-----------|
+ *
+ *
* Created: Nov 2004 by Philip Homburg <philip@f-mnx.phicoh.com>
*/
mp->DL_PROC, D, (vir_bytes) mp->DL_ADDR, sizeof(stats));
if (r != OK)
panic(__FILE__,"fxp_getstat: sys_vircopy failed", r);
- reply(fp, OK, FALSE);
+
+ mp->m_type= DL_STAT_REPLY;
+ mp->DL_PORT= dl_port;
+ mp->DL_STAT= OK;
+ r= send(mp->m_source, mp);
+ if (r != OK)
+ panic(__FILE__, "fxp_getstat: send failed: %d\n", r);
}
sizeof(stats), D);
if (r != OK)
panic(__FILE__,"fxp_getstat_s: sys_safecopyto failed", r);
- reply(fp, OK, FALSE);
+
+ mp->m_type= DL_STAT_REPLY;
+ mp->DL_PORT= dl_port;
+ mp->DL_STAT= OK;
+ r= send(mp->m_source, mp);
+ if (r != OK)
+ panic(__FILE__, "fxp_getstat_s: send failed: %d\n", r);
}
static void do_getstat_s(mp)
message *mp;
{
- int port;
+ int r, port;
ether_card_t *ec;
port = mp->DL_PORT;
put_userdata_s(mp->DL_PROC, mp->DL_GRANT,
&ec->eth_stat, sizeof(ec->eth_stat));
- reply(ec, OK, FALSE);
+
+ mp->m_type= DL_STAT_REPLY;
+ mp->DL_PORT= port;
+ mp->DL_STAT= OK;
+ r= send(mp->m_source, mp);
+ if (r != OK)
+ panic(__FILE__, "do_getstat_s: send failed: %d\n", r);
}
/*===========================================================================*
*
* The messages sent are:
*
- * m-type DL_POR T DL_PROC DL_COUNT DL_STAT DL_CLCK
+ * m_type DL_PORT DL_PROC DL_COUNT DL_STAT DL_CLCK
* |------------|----------|---------|----------|---------|---------|
* |DL_TASK_REPL| port nr | proc nr | rd-count | err|stat| clock |
* |------------|----------|---------|----------|---------|---------|
*
* m_type m3_i1 m3_i2 m3_ca1
- * |------------+---------+-----------+---------------|
+ * |------------|---------|-----------|---------------|
* |DL_CONF_REPL| port nr | last port | ethernet addr |
* |------------|---------|-----------|---------------|
*
+ * m_type DL_PORT DL_STAT
+ * |------------|---------|-----------|
+ * |DL_STAT_REPL| port nr | err |
+ * |------------|---------|-----------|
+ *
* Created: Aug 2003 by Philip Homburg <philip@cs.vu.nl>
* Changes:
* Aug 15, 2004 sync alarms replace watchdogs timers (Jorrit N. Herder)
continue;
rl_outb(rep->re_base_port, RL_CR, 0);
}
- sys_exit(0);
+ exit(0);
}
/*===========================================================================*
rl_writev(&rep->re_tx_mess, TRUE /* from int */,
TRUE /* vectored */);
}
+ else if (rep->re_tx_mess.m_type == DL_WRITEV_S)
+ {
+ rl_writev_s(&rep->re_tx_mess, TRUE /* from int */);
+ }
else
{
assert(rep->re_tx_mess.m_type == DL_WRITE);
(vir_bytes) mp->DL_ADDR, sizeof(stats));
if (r != OK)
panic(__FILE__, "rl_getstat: sys_datacopy failed", r);
- reply(rep, OK, FALSE);
+
+ mp->m_type= DL_STAT_REPLY;
+ mp->DL_PORT= port;
+ mp->DL_STAT= OK;
+ r= send(mp->m_source, mp);
+ if (r != OK)
+ panic("RTL8139", "rl_getstat: send failed: %d\n", r);
}
/*===========================================================================*
(vir_bytes) &stats, sizeof(stats), D);
if (r != OK)
panic(__FILE__, "rl_getstat_s: sys_safecopyto failed", r);
- reply(rep, OK, FALSE);
+
+ mp->m_type= DL_STAT_REPLY;
+ mp->DL_PORT= port;
+ mp->DL_STAT= OK;
+ r= send(mp->m_source, mp);
+ if (r != OK)
+ panic("RTL8139", "rl_getstat_s: send failed: %d\n", r);
}