summaryrefslogtreecommitdiff
path: root/nuttx/drivers
diff options
context:
space:
mode:
authorpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2007-11-02 23:05:53 +0000
committerpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2007-11-02 23:05:53 +0000
commit5dc79030987a04233b672933793c1d0182854160 (patch)
tree668a67f0a5fbd10824aee2f92174906e797c3279 /nuttx/drivers
parent8543ac1d6bb8568cba8a31a66f3c7d31a4323657 (diff)
downloadpx4-nuttx-5dc79030987a04233b672933793c1d0182854160.tar.gz
px4-nuttx-5dc79030987a04233b672933793c1d0182854160.tar.bz2
px4-nuttx-5dc79030987a04233b672933793c1d0182854160.zip
Changes for clean compile of DM90x0 driver on Neuros OSD
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@365 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'nuttx/drivers')
-rw-r--r--nuttx/drivers/net/dm90x0.c37
1 files changed, 30 insertions, 7 deletions
diff --git a/nuttx/drivers/net/dm90x0.c b/nuttx/drivers/net/dm90x0.c
index 5a8675bee..878664481 100644
--- a/nuttx/drivers/net/dm90x0.c
+++ b/nuttx/drivers/net/dm90x0.c
@@ -46,12 +46,15 @@
/* Force debug on for this file */
-#undef CONFIG_DEBUG
+#undef CONFIG_DEBUG
#define CONFIG_DEBUG 1
-#undef CONFIG_DEBUG_VERBOSE
+#undef CONFIG_DEBUG_VERBOSE
#define CONFIG_DEBUG_VERBOSE 1
-/* Only one hardware interface supported */
+/* Only one hardware interface supported at present (althought there are
+ * hooks throughout the design to that extending the support to multiple
+ * interfaces should not be that difficult)
+ */
#undef CONFIG_DM9X_NINTERFACES
#define CONFIG_DM9X_NINTERFACES 1
@@ -830,6 +833,15 @@ static int dm9x_uiptxpoll(struct dm9x_driver_s *dm9x)
{
uip_arp_out(&dm9x->dev);
dm9x_transmit(dm9x);
+
+ /* Check if there is room in the DM90x0 to hold another packet. In 100M mode,
+ * that can be 2 packets, otherwise it is a single packet.
+ */
+
+ if (dm9x->ntxpending > 1 || !dm9x->b100M)
+ {
+ return;
+ }
}
}
@@ -847,6 +859,15 @@ static int dm9x_uiptxpoll(struct dm9x_driver_s *dm9x)
{
uip_arp_out(&dm9x->dev);
dm9x_transmit(dm9x);
+
+ /* Check if there is room in the DM90x0 to hold another packet. In 100M mode,
+ * that can be 2 packets, otherwise it is a single packet.
+ */
+
+ if (dm9x->ntxpending > 1 || !dm9x->b100M)
+ {
+ return;
+ }
}
}
#endif /* CONFIG_NET_UDP */
@@ -1118,7 +1139,7 @@ static int dm9x_interrupt(int irq, FAR void *context)
for (i = 0; i < 200; i++)
{
- up_udelay(1000);
+ up_mdelay(1);
}
/* Set the new network speed */
@@ -1133,7 +1154,7 @@ static int dm9x_interrupt(int irq, FAR void *context)
}
break;
}
- up_udelay(1000);
+ up_mdelay(1);
}
dbg("delay: %d mS speed: %s\n", i, dm9x->b100M ? "100M" : "10M");
}
@@ -1255,7 +1276,9 @@ static void dm9x_polltimer(int argc, uint32 arg, ...)
putreg(DM9X_IMR, DM9X_IMRENABLE);
}
- /* Check if there is room in the TX FIFO to hold another packet */
+ /* Check if there is room in the DM90x0 to hold another packet. In 100M mode,
+ * that can be 2 packets, otherwise it is a single packet.
+ */
if (dm9x->ntxpending < 1 || (dm9x->b100M && dm9x->ntxpending < 2))
{
@@ -1561,7 +1584,7 @@ static void dm9x_reset(struct dm9x_driver_s *dm9x)
}
break;
}
- up_udelay(1000);
+ up_mdelay(1);
}
/* Restore previous register address */