[PATCH 3/4] IP100A: Correct initial and close hardware step. 2006-08-24

2006-09-13 Thread Jesse Huang
From: Jesse Huang [EMAIL PROTECTED]

Change Logs:
   - Correct initial and close hardware step.

Signed-off-by: Jesse Huang [EMAIL PROTECTED]

---

 drivers/net/sundance.c |8 
 1 files changed, 8 insertions(+), 0 deletions(-)

419599b10f1253ccd7224bbd369924307e1e5bb6
diff --git a/drivers/net/sundance.c b/drivers/net/sundance.c
index dd41ee2..04ad4d8 100755
--- a/drivers/net/sundance.c
+++ b/drivers/net/sundance.c
@@ -787,6 +787,7 @@ static int netdev_open(struct net_device
 {
struct netdev_private *np = netdev_priv(dev);
void __iomem *ioaddr = np-base;
+   unsigned long flags;
int i;
 
/* Do we need to reset the chip??? */
@@ -831,6 +832,10 @@ #endif
iowrite8(0x01, ioaddr + DebugCtrl1);
netif_start_queue(dev);
 
+   spin_lock_irqsave(np-lock, flags);
+   reset_tx(dev);
+   spin_unlock_irqrestore(np-lock, flags);
+
iowrite16 (StatsEnable | RxEnable | TxEnable, ioaddr + MACCtrl1);
 
if (netif_msg_ifup(np))
@@ -1656,6 +1661,9 @@ static int netdev_close(struct net_devic
/* Disable interrupts by clearing the interrupt mask. */
iowrite16(0x, ioaddr + IntrEnable);
 
+   /* Disable Rx and Tx DMA for safely release resource */
+   iowrite32(0x500, ioaddr + DMACtrl);
+
/* Stop the chip's Tx and Rx processes. */
iowrite16(TxDisable | RxDisable | StatsDisable, ioaddr + MACCtrl1);
 
-- 
1.3.GIT



-
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 3/4] IP100A: Correct initial and close hardware step. 2006-08-24

2006-08-24 Thread Jesse Huang

From: Jesse Huang [EMAIL PROTECTED]

Change Logs:
   - Correct initial and close hardware step.

Signed-off-by: Jesse Huang [EMAIL PROTECTED]

---

 drivers/net/sundance.c |8 
 1 files changed, 8 insertions(+), 0 deletions(-)

419599b10f1253ccd7224bbd369924307e1e5bb6
diff --git a/drivers/net/sundance.c b/drivers/net/sundance.c
index dd41ee2..04ad4d8 100755
--- a/drivers/net/sundance.c
+++ b/drivers/net/sundance.c
@@ -787,6 +787,7 @@ static int netdev_open(struct net_device
 {
struct netdev_private *np = netdev_priv(dev);
void __iomem *ioaddr = np-base;
+   unsigned long flags;
int i;
 
/* Do we need to reset the chip??? */
@@ -831,6 +832,10 @@ #endif
iowrite8(0x01, ioaddr + DebugCtrl1);
netif_start_queue(dev);
 
+   spin_lock_irqsave(np-lock, flags);
+   reset_tx(dev);
+   spin_unlock_irqrestore(np-lock, flags);
+
iowrite16 (StatsEnable | RxEnable | TxEnable, ioaddr + MACCtrl1);
 
if (netif_msg_ifup(np))
@@ -1656,6 +1661,9 @@ static int netdev_close(struct net_devic
/* Disable interrupts by clearing the interrupt mask. */
iowrite16(0x, ioaddr + IntrEnable);
 
+   /* Disable Rx and Tx DMA for safely release resource */
+   iowrite32(0x500, ioaddr + DMACtrl);
+
/* Stop the chip's Tx and Rx processes. */
iowrite16(TxDisable | RxDisable | StatsDisable, ioaddr + MACCtrl1);
 
-- 
1.3.GIT



-
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 3/4] IP100A: Correct initial and close hardware step.

2006-08-22 Thread Jesse Huang
From: Jesse Huang [EMAIL PROTECTED]

Change Logs:
   - Correct initial and close hardware step.

Signed-off-by: Jesse Huang [EMAIL PROTECTED]

---

 sundance.c |   10 +-
 1 files changed, 9 insertions(+), 1 deletions(-)

ddfaae9a0f4bd37c155f21fb4779093eef059bf6
diff --git a/sundance.c b/sundance.c
index 259c42f..424aebd 100755
--- a/sundance.c
+++ b/sundance.c
@@ -787,6 +787,7 @@ static int netdev_open(struct net_device
 {
struct netdev_private *np = netdev_priv(dev);
void __iomem *ioaddr = np-base;
+   unsigned long flags;
int i;
 
/* Do we need to reset the chip??? */
@@ -830,6 +831,10 @@ #endif
if (np-pci_rev_id = 0x14)
iowrite8(0x01, ioaddr + DebugCtrl1);
netif_start_queue(dev);
+   
+   spin_lock_irqsave(np-lock,flags);
+   reset_tx(dev);
+   spin_unlock_irqrestore(np-lock,flags);
 
iowrite16 (StatsEnable | RxEnable | TxEnable, ioaddr + MACCtrl1);
 
@@ -1655,7 +1660,10 @@ static int netdev_close(struct net_devic
 
/* Disable interrupts by clearing the interrupt mask. */
iowrite16(0x, ioaddr + IntrEnable);
-
+   
+   /* Disable Rx and Tx DMA for safely release resource */
+   iowrite32(0x500, ioaddr + DMACtrl);
+   
/* Stop the chip's Tx and Rx processes. */
iowrite16(TxDisable | RxDisable | StatsDisable, ioaddr + MACCtrl1);
 
-- 
1.3.GIT



-
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html