提交 a7b56e9c 编写于 作者: B bernard.xiong

update dm9000a driver

git-svn-id: https://rt-thread.googlecode.com/svn/trunk@195 bbd45198-f89e-11dd-88c7-29a3b14d5316
上级 729a0f45
...@@ -175,12 +175,11 @@ void rt_dm9000_isr() ...@@ -175,12 +175,11 @@ void rt_dm9000_isr()
/* Received the coming packet */ /* Received the coming packet */
if (int_status & ISR_PRS) if (int_status & ISR_PRS)
{ {
rt_err_t result; /* disable receive interrupt */
dm9000_device.imr_all = IMR_PAR | IMR_PTM;
/* a frame has been received */ /* a frame has been received */
result = eth_device_ready(&(dm9000_device.parent)); eth_device_ready(&(dm9000_device.parent));
if (result != RT_EOK) rt_kprintf("eth notification failed\n");
RT_ASSERT(result == RT_EOK);
} }
/* Transmit Interrupt check */ /* Transmit Interrupt check */
...@@ -459,7 +458,7 @@ struct pbuf *rt_dm9000_rx(rt_device_t dev) ...@@ -459,7 +458,7 @@ struct pbuf *rt_dm9000_rx(rt_device_t dev)
rt_sem_take(&sem_lock, RT_WAITING_FOREVER); rt_sem_take(&sem_lock, RT_WAITING_FOREVER);
/* Check packet ready or not */ /* Check packet ready or not */
dm9000_io_read(DM9000_MRCMDX); /* Dummy read */ dm9000_io_read(DM9000_MRCMDX); /* Dummy read */
rxbyte = DM9000_inb(DM9000_DATA_BASE); /* Got most updated data */ rxbyte = DM9000_inb(DM9000_DATA_BASE); /* Got most updated data */
if (rxbyte) if (rxbyte)
{ {
...@@ -560,8 +559,9 @@ struct pbuf *rt_dm9000_rx(rt_device_t dev) ...@@ -560,8 +559,9 @@ struct pbuf *rt_dm9000_rx(rt_device_t dev)
} }
else else
{ {
/* restore interrupt */ /* restore receive interrupt */
// dm9000_io_write(DM9000_IMR, dm9000_device.imr_all); dm9000_device.imr_all = IMR_PAR | IMR_PTM | IMR_PRM;
dm9000_io_write(DM9000_IMR, dm9000_device.imr_all);
} }
/* unlock DM9000 device */ /* unlock DM9000 device */
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册