Re: [patch 02/18] sundance: PHY address form 0, only for device I D 0x0200 (IP100A) (20070605)
Dear Jeff: We found current sundance.c in kernel 2.6.22 is working fine for IP100A. We need not to modify following codes: - for (phy = 1; phy = 32 phy_idx MII_CNT; phy++) { + if (sundance_pci_tbl[np-chip_id].device == 0x0200) + phy = 0; + else + phy = 1; + for (; phy = 32 phy_idx MII_CNT; phy++) { Current code will find IP100A at 0 when phy was equ to 32. for (phy = 1; phy = 32 phy_idx MII_CNT; phy++) { int phyx = phy 0x1f; int mii_status = mdio_read(dev, phyx, MII_BMSR); if (mii_status != 0xmii_status != 0x) { np-phys[phy_idx++] = phyx; np-mii_if.advertising = mdio_read(dev, phyx, MII_ADVERTISE); if ((mii_status 0x0040) == 0) np-mii_preamble_required++; printk(KERN_INFO %s: MII PHY found at address %d, status 0x%4.4x advertising %4.4x.\n, dev-name, phyx, mii_status, np-mii_if.advertising); } } So, we hope you can drop this patch [patch 02/18] sundance: PHY address form 0, only for device I D 0x0200 (IP100A) (20070605) Thanks a lot! Best Regards, Jesse Huang -Original Message- From: Jeff Garzik [mailto:[EMAIL PROTECTED] Sent: Monday, September 03, 2007 6:43 PM To: ¶À«Ø¿³-Jesse Cc: [EMAIL PROTECTED]; netdev@vger.kernel.org Subject: Re: [patch 02/18] sundance: PHY address form 0, only for device I D 0x0200 (IP100A) (20070605) ¶À«Ø¿³-Jesse wrote: +++ a/drivers/net/sundance.c @@ -559,7 +559,11 @@ static int __devinit sundance_probe1 (st * It seems some phys doesn't deal well with address 0 being accessed * first, so leave address zero to the end of the loop (32 31). */ - for (phy = 1; phy = 32 phy_idx MII_CNT; phy++) { + if (sundance_pci_tbl[np-chip_id].device == 0x0200) + phy = 0; + else + phy = 1; + for (; phy = 32 phy_idx MII_CNT; phy++) { As I noted in the last email, this patch still has a bug: In the above loop code being modified, you need to change two things: 1) Initial loop value 2) Loop terminating condition Your patch only performs change #1. Jeff - 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] sundance: PHY address form 0, only for device ID 0x0200 (IP100A)
From: Jesse Huang [EMAIL PROTECTED] Change Logs: Search PHY address form 0, only for device ID 0x0200 (IP100A). Other device are from PHY address 1. Signed-off-by: Jesse Huang [EMAIL PROTECTED] --- drivers/net/sundance.c |4 +++- 1 files changed, 3 insertions(+), 1 deletions(-) 5724a72722dfc9cafbb8f273cb82dbf577bd9ad0 diff --git a/drivers/net/sundance.c b/drivers/net/sundance.c index e1f912d..914ab29 100644 --- a/drivers/net/sundance.c +++ b/drivers/net/sundance.c @@ -562,7 +562,9 @@ #endif * It seems some phys doesn't deal well with address 0 being accessed * first, so leave address zero to the end of the loop (32 31). */ - for (phy = 1; phy = 32 phy_idx MII_CNT; phy++) { + if(sundance_pci_tbl[np-chip_id].device == 0x0200) phy = 0; + else phy = 1; + for (; phy = 32 phy_idx MII_CNT; phy++) { int phyx = phy 0x1f; int mii_status = mdio_read(dev, phyx, MII_BMSR); if (mii_status != 0xmii_status != 0x) { -- 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] sundance: PHY address form 0, only for device ID 0x0200 (IP100A) (20070605)
From: Jesse Huang [EMAIL PROTECTED] Change Logs: Search PHY address form 0, only for device ID 0x0200 (IP100A). Other device are from PHY address 1. Signed-off-by: Jesse Huang [EMAIL PROTECTED] --- drivers/net/sundance.c |6 +- 1 files changed, 5 insertions(+), 1 deletions(-) a093fe5e3e7b9f58458171e481b5096cc1d3abfe diff --git a/drivers/net/sundance.c b/drivers/net/sundance.c index e1f912d..23d049d 100644 --- a/drivers/net/sundance.c +++ b/drivers/net/sundance.c @@ -562,7 +562,11 @@ #endif * It seems some phys doesn't deal well with address 0 being accessed * first, so leave address zero to the end of the loop (32 31). */ - for (phy = 1; phy = 32 phy_idx MII_CNT; phy++) { + if(sundance_pci_tbl[np-chip_id].device == 0x0200) + phy = 0; + else + phy = 1; + for (; phy = 32 phy_idx MII_CNT; phy++) { int phyx = phy 0x1f; int mii_status = mdio_read(dev, phyx, MII_BMSR); if (mii_status != 0xmii_status != 0x) { -- 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] sundance: PHY address form 0, only for device ID 0x0200 (IP100A) (20070605)
From: Jesse Huang [EMAIL PROTECTED] Change Logs: Search PHY address form 0, only for device ID 0x0200 (IP100A). Other device are from PHY address 1. Signed-off-by: Jesse Huang [EMAIL PROTECTED] --- drivers/net/sundance.c |6 +- 1 files changed, 5 insertions(+), 1 deletions(-) a093fe5e3e7b9f58458171e481b5096cc1d3abfe diff --git a/drivers/net/sundance.c b/drivers/net/sundance.c index e1f912d..23d049d 100644 --- a/drivers/net/sundance.c +++ b/drivers/net/sundance.c @@ -562,7 +562,11 @@ #endif * It seems some phys doesn't deal well with address 0 being accessed * first, so leave address zero to the end of the loop (32 31). */ - for (phy = 1; phy = 32 phy_idx MII_CNT; phy++) { + if(sundance_pci_tbl[np-chip_id].device == 0x0200) + phy = 0; + else + phy = 1; + for (; phy = 32 phy_idx MII_CNT; phy++) { int phyx = phy 0x1f; int mii_status = mdio_read(dev, phyx, MII_BMSR); if (mii_status != 0xmii_status != 0x) { -- 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
Re: How about current IP100A status? 10/31/2006
Dear Jeff: Thanks for your help. We are happy to see new version of our driver will be support in the new kernel. Best Regards, Jesse Huang - Original Message - From: Jeff Garzik [EMAIL PROTECTED] To: Jesse Huang [EMAIL PROTECTED] Cc: linux-kernel@vger.kernel.org; netdev@vger.kernel.org; [EMAIL PROTECTED] Sent: Thursday, November 02, 2006 1:21 PM Subject: Re: How about current IP100A status? 10/31/2006 Jesse Huang wrote: Dear All: How about current IP100A, sundance.c status? Should it be put into kernel or not? Is there any sentence should I need to modify? It's in my queue. We are in a bug fix-only cycle right now, so it has been a bit lower priority, but I will queue it for 2.6.20. Jeff - 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
How about current IP100A status? 10/31/2006
Dear All: How about current IP100A, sundance.c status? Should it be put into kernel or not? Is there any sentence should I need to modify? Thanks for your help! Jesse Huang - Original Message - From: Jesse Huang [EMAIL PROTECTED] To: linux-kernel@vger.kernel.org; netdev@vger.kernel.org; [EMAIL PROTECTED]; [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Sunday, October 15, 2006 3:57 AM Subject: [PATCH 5/5] Solve host error problem in low performance embeddedsystem when continune down and up. From: Jesse Huang [EMAIL PROTECTED] - 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 1/5] remove TxStartThresh and RxEarlyThresh
From: Jesse Huang [EMAIL PROTECTED] Change Logs: For patent issue need to remove TxStartThresh and RxEarlyThresh. This patent is cut-through patent. If use this function, Tx will start to transmit after few data be move in to Tx FIFO. We are not allow to use those function in DFE530/DFE550/DFE580/DL10050/IP100/IP100A. It will decrease a little performance. Signed-off-by: Jesse Huang [EMAIL PROTECTED] --- drivers/net/sundance.c |8 ++-- 1 files changed, 2 insertions(+), 6 deletions(-) 3751714e0fc36905c87a230172d9561c29321833 diff --git a/drivers/net/sundance.c b/drivers/net/sundance.c index 6b8f4ba..a5dd1c3 100755 --- a/drivers/net/sundance.c +++ b/drivers/net/sundance.c @@ -264,8 +264,6 @@ enum alta_offsets { ASICCtrl = 0x30, EEData = 0x34, EECtrl = 0x36, - TxStartThresh = 0x3c, - RxEarlyThresh = 0x3e, FlashAddr = 0x40, FlashData = 0x44, TxStatus = 0x46, @@ -,6 +1109,7 @@ static irqreturn_t intr_handler(int irq, int tx_cnt; int tx_status; int handled = 0; + int i; do { @@ -1153,17 +1152,14 @@ static irqreturn_t intr_handler(int irq, np-stats.tx_fifo_errors++; if (tx_status 0x02) np-stats.tx_window_errors++; + /* ** This reset has been verified on ** DFE-580TX boards ! [EMAIL PROTECTED] */ if (tx_status 0x10) { /* TxUnderrun */ - unsigned short txthreshold; - - txthreshold = ioread16 (ioaddr + TxStartThresh); /* Restart Tx FIFO and transmitter */ sundance_reset(dev, (NetworkReset|FIFOReset|TxReset) 16); - iowrite16 (txthreshold, ioaddr + TxStartThresh); /* No need to reset the Tx pointer here */ } /* Restart the Tx. */ -- 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 2/5] Fix TX Pause bug (reset_tx, intr_handler)
From: Jesse Huang [EMAIL PROTECTED] Change Logs: Fix TX Pause bug (reset_tx, intr_handler). When MaxCollisions occurred, need to re-enable Tx. But just after re-enable, MaxCollisions maybe occurred again and with TxStatusOverflow. This will cause driver can't check new MaxCollisions to re-enable Tx again, because TxStatusOverflow. For this reason, after re-enable Tx, we need to make sure Tx was actually enabled. Signed-off-by: Jesse Huang [EMAIL PROTECTED] --- drivers/net/sundance.c | 16 ++-- 1 files changed, 14 insertions(+), 2 deletions(-) e146d4c423de9c2e9d55fbf9c6b3abbee14ce9ac diff --git a/drivers/net/sundance.c b/drivers/net/sundance.c index a5dd1c3..11ca31e 100755 --- a/drivers/net/sundance.c +++ b/drivers/net/sundance.c @@ -1079,6 +1079,8 @@ reset_tx (struct net_device *dev) /* free all tx skbuff */ for (i = 0; i TX_RING_SIZE; i++) { + np-tx_ring[i].next_desc = 0; + skb = np-tx_skbuff[i]; if (skb) { pci_unmap_single(np-pci_dev, @@ -1094,6 +1096,10 @@ reset_tx (struct net_device *dev) } np-cur_tx = np-dirty_tx = 0; np-cur_task = 0; + + np-last_tx = 0; + iowrite8(127, ioaddr + TxDMAPollPeriod); + iowrite16 (StatsEnable | RxEnable | TxEnable, ioaddr + MACCtrl1); return 0; } @@ -1162,8 +1168,14 @@ static irqreturn_t intr_handler(int irq, sundance_reset(dev, (NetworkReset|FIFOReset|TxReset) 16); /* No need to reset the Tx pointer here */ } - /* Restart the Tx. */ - iowrite16 (TxEnable, ioaddr + MACCtrl1); + /* Restart the Tx. Need to make sure tx enabled */ + i = 10; + do { + iowrite16(ioread16(ioaddr + MACCtrl1) | TxEnable, ioaddr + MACCtrl1); + if (ioread16(ioaddr + MACCtrl1) TxEnabled) + break; + mdelay(1); + } while (--i); } /* Yup, this is a documentation bug. It cost me *hours*. */ iowrite16 (0, ioaddr + TxStatus); -- 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 4/5] Correct initial and close hardware step.
From: Jesse Huang [EMAIL PROTECTED] Change Logs: Correct initial and close hardware step. In some embedded system down and up IP100A will cause DMA crash. We add some for safe down and up IP100A. Signed-off-by: Jesse Huang [EMAIL PROTECTED] --- drivers/net/sundance.c |8 1 files changed, 8 insertions(+), 0 deletions(-) 1bbb3f6231fa1f52a9f61e299f22610d357f6041 diff --git a/drivers/net/sundance.c b/drivers/net/sundance.c index 679eda4..14b4933 100755 --- a/drivers/net/sundance.c +++ b/drivers/net/sundance.c @@ -789,6 +789,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??? */ @@ -833,6 +834,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)) @@ -1652,6 +1657,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 5/5] Solve host error problem in low performance embedded system when continune down and up.
From: Jesse Huang [EMAIL PROTECTED] Change Logs: Solve host error problem in low performance embedded system when continune down and up. It will cause IP100A DMA TargetAbort. So we need more safe process to up and down IP100A with wait hardware completely stop and software cur_tx/ dirty_tx/cur_task/last_tx be clear. Signed-off-by: Jesse Huang [EMAIL PROTECTED] --- drivers/net/sundance.c | 26 +++--- 1 files changed, 23 insertions(+), 3 deletions(-) c06c70e20a85facd640528ca66e0b579fc3ee745 diff --git a/drivers/net/sundance.c b/drivers/net/sundance.c index 14b4933..b4a6010 100755 --- a/drivers/net/sundance.c +++ b/drivers/net/sundance.c @@ -1643,6 +1643,14 @@ static int netdev_close(struct net_devic struct sk_buff *skb; int i; + /* Wait and kill tasklet */ + tasklet_kill(np-rx_tasklet); + tasklet_kill(np-tx_tasklet); + np-cur_tx = 0; + np-dirty_tx = 0; + np-cur_task = 0; + np-last_tx = 0; + netif_stop_queue(dev); if (netif_msg_ifdown(np)) { @@ -1663,9 +1671,20 @@ static int netdev_close(struct net_devic /* Stop the chip's Tx and Rx processes. */ iowrite16(TxDisable | RxDisable | StatsDisable, ioaddr + MACCtrl1); - /* Wait and kill tasklet */ - tasklet_kill(np-rx_tasklet); - tasklet_kill(np-tx_tasklet); + for (i = 2000; i 0; i--) { + if ((ioread32(ioaddr + DMACtrl) 0xC000) == 0) + break; + mdelay(1); + } + + iowrite16(GlobalReset | DMAReset | FIFOReset | NetworkReset, ioaddr +ASICCtrl + 2); + + for (i = 2000; i 0; i--) + { + if ((ioread16(ioaddr + ASICCtrl +2) ResetBusy) == 0) + break; + mdelay(1); + } #ifdef __i386__ if (netif_msg_hw(np)) { @@ -1703,6 +1722,7 @@ #endif /* __i386__ debugging only */ } } for (i = 0; i TX_RING_SIZE; i++) { + np-tx_ring[i].next_desc = 0; skb = np-tx_skbuff[i]; if (skb) { pci_unmap_single(np-pci_dev, -- 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
Re: What is current sundance.c status
Ok, I will generate those again with descriptions. Thank you! Best Regards, Jesse Huang. - Original Message - From: Andrew Morton [EMAIL PROTECTED] To: Jesse Huang [EMAIL PROTECTED] Cc: linux-kernel@vger.kernel.org; netdev@vger.kernel.org; [EMAIL PROTECTED] Sent: Thursday, October 12, 2006 10:55 AM Subject: Re: What is current sundance.c status On Thu, 12 Oct 2006 10:29:37 +0800 Jesse Huang [EMAIL PROTECTED] wrote: Would you tell me what is the current IP100A status? Should I re-generate patches again. Would it put into kernel or not? I'm sitting on a copy of them. I didn't send them to Jeff last time because: sundance-remove-txstartthresh-and-rxearlythresh.patch There's no description of what this patent issue is. sundance-fix-tx-pause-bug-reset_tx-intr_handler.patch There's no description of the bug which got fixed, nor how this patch fixes it. sundance-change-phy-address-search-from-phy=1-to-phy=0.patch There's a (small) possibility that this will break on hardware which _doesn't_ have a phy at address 0. sundance-correct-initial-and-close-hardware-step.patch There's no real description of the bug which is being fixed, nor of how this patch fixes it. sundance-solve-host-error-problem-in-low-performance-embedded.patch No description of what the host error problem is, nor of what causes it, nor of how this patch fixes it. So generally these patches are a bit worrying, and it is hard to gauge what their risk factor is. - 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 4/5] Correct initial and close hardware step.
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(-) 1bbb3f6231fa1f52a9f61e299f22610d357f6041 diff --git a/drivers/net/sundance.c b/drivers/net/sundance.c index 679eda4..14b4933 100755 --- a/drivers/net/sundance.c +++ b/drivers/net/sundance.c @@ -789,6 +789,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??? */ @@ -833,6 +834,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)) @@ -1652,6 +1657,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 5/5] Solve host error problem in low performance embedded system when continune down and up.
From: Jesse Huang [EMAIL PROTECTED] Change Logs: Solve host error problem in low performance embedded system when continune down and up. Signed-off-by: Jesse Huang [EMAIL PROTECTED] --- drivers/net/sundance.c | 26 +++--- 1 files changed, 23 insertions(+), 3 deletions(-) c06c70e20a85facd640528ca66e0b579fc3ee745 diff --git a/drivers/net/sundance.c b/drivers/net/sundance.c index 14b4933..b4a6010 100755 --- a/drivers/net/sundance.c +++ b/drivers/net/sundance.c @@ -1643,6 +1643,14 @@ static int netdev_close(struct net_devic struct sk_buff *skb; int i; + /* Wait and kill tasklet */ + tasklet_kill(np-rx_tasklet); + tasklet_kill(np-tx_tasklet); + np-cur_tx = 0; + np-dirty_tx = 0; + np-cur_task = 0; + np-last_tx = 0; + netif_stop_queue(dev); if (netif_msg_ifdown(np)) { @@ -1663,9 +1671,20 @@ static int netdev_close(struct net_devic /* Stop the chip's Tx and Rx processes. */ iowrite16(TxDisable | RxDisable | StatsDisable, ioaddr + MACCtrl1); - /* Wait and kill tasklet */ - tasklet_kill(np-rx_tasklet); - tasklet_kill(np-tx_tasklet); + for (i = 2000; i 0; i--) { + if ((ioread32(ioaddr + DMACtrl) 0xC000) == 0) + break; + mdelay(1); + } + + iowrite16(GlobalReset | DMAReset | FIFOReset | NetworkReset, ioaddr +ASICCtrl + 2); + + for (i = 2000; i 0; i--) + { + if ((ioread16(ioaddr + ASICCtrl +2) ResetBusy) == 0) + break; + mdelay(1); + } #ifdef __i386__ if (netif_msg_hw(np)) { @@ -1703,6 +1722,7 @@ #endif /* __i386__ debugging only */ } } for (i = 0; i TX_RING_SIZE; i++) { + np-tx_ring[i].next_desc = 0; skb = np-tx_skbuff[i]; if (skb) { pci_unmap_single(np-pci_dev, -- 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 2/5] Fix TX Pause bug (reset_tx, intr_handler)
From: Jesse Huang [EMAIL PROTECTED] Change Logs: Fix TX Pause bug (reset_tx, intr_handler) Signed-off-by: Jesse Huang [EMAIL PROTECTED] --- drivers/net/sundance.c | 16 ++-- 1 files changed, 14 insertions(+), 2 deletions(-) e146d4c423de9c2e9d55fbf9c6b3abbee14ce9ac diff --git a/drivers/net/sundance.c b/drivers/net/sundance.c index a5dd1c3..11ca31e 100755 --- a/drivers/net/sundance.c +++ b/drivers/net/sundance.c @@ -1079,6 +1079,8 @@ reset_tx (struct net_device *dev) /* free all tx skbuff */ for (i = 0; i TX_RING_SIZE; i++) { + np-tx_ring[i].next_desc = 0; + skb = np-tx_skbuff[i]; if (skb) { pci_unmap_single(np-pci_dev, @@ -1094,6 +1096,10 @@ reset_tx (struct net_device *dev) } np-cur_tx = np-dirty_tx = 0; np-cur_task = 0; + + np-last_tx = 0; + iowrite8(127, ioaddr + TxDMAPollPeriod); + iowrite16 (StatsEnable | RxEnable | TxEnable, ioaddr + MACCtrl1); return 0; } @@ -1162,8 +1168,14 @@ static irqreturn_t intr_handler(int irq, sundance_reset(dev, (NetworkReset|FIFOReset|TxReset) 16); /* No need to reset the Tx pointer here */ } - /* Restart the Tx. */ - iowrite16 (TxEnable, ioaddr + MACCtrl1); + /* Restart the Tx. Need to make sure tx enabled */ + i = 10; + do { + iowrite16(ioread16(ioaddr + MACCtrl1) | TxEnable, ioaddr + MACCtrl1); + if (ioread16(ioaddr + MACCtrl1) TxEnabled) + break; + mdelay(1); + } while (--i); } /* Yup, this is a documentation bug. It cost me *hours*. */ iowrite16 (0, ioaddr + TxStatus); -- 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
Re: [PATCH 1/5] remove TxStartThresh and RxEarlyThresh
Sorry, I had typed wrong word. It is because patent issue. Thnaks. - Original Message - From: Roland Dreier [EMAIL PROTECTED] To: Andrew Morton [EMAIL PROTECTED] Cc: Jesse Huang [EMAIL PROTECTED]; linux-kernel@vger.kernel.org; netdev@vger.kernel.org; [EMAIL PROTECTED] Sent: Monday, October 02, 2006 3:00 PM Subject: Re: [PATCH 1/5] remove TxStartThresh and RxEarlyThresh For pattern issue need to remove TxStartThresh and RxEarlyThresh. Please describe this issue more completely. What are the implications of simply removing this feature? Presumably that code was there for a reason.. Actually I think this patch needs to be handled delicately -- because based on earlier emails from Jesse (http://www.mail-archive.com/netdev@vger.kernel.org/msg22254.html), I am pretty sure that pattern is a typo for patent. So I guess the question is what exactly the patent covers and what the implications of having the current kernel code are. - R. - 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
Re: [PATCH 2/5] Fix TX Pause bug (reset_tx, intr_handler)
When TxUnderrun happen, driver will re-enable tx. But during this enable process, TxUnderrun maybe happen again. So driver need to make sure Tx was actually enabled. - Original Message - From: Andrew Morton [EMAIL PROTECTED] To: Jesse Huang [EMAIL PROTECTED] Cc: linux-kernel@vger.kernel.org; netdev@vger.kernel.org; [EMAIL PROTECTED] Sent: Monday, October 02, 2006 2:53 PM Subject: Re: [PATCH 2/5] Fix TX Pause bug (reset_tx, intr_handler) On Mon, 02 Oct 2006 14:24:36 -0400 Jesse Huang [EMAIL PROTECTED] wrote: Fix TX Pause bug (reset_tx, intr_handler) Please describe this bug more completely.How does this patch solve it? - 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
Re: [PATCH 5/5] Solve host error problem in low performance embedded system when continune down and up.
In some low performance embedded CPU, if continued to ifconfig up and down driver. It will cause host error. Driver need to make sure all counter is clear to zero, and hardware actually stop. - Original Message - From: Andrew Morton [EMAIL PROTECTED] To: Jesse Huang [EMAIL PROTECTED] Cc: linux-kernel@vger.kernel.org; netdev@vger.kernel.org; [EMAIL PROTECTED] Sent: Monday, October 02, 2006 2:51 PM Subject: Re: [PATCH 5/5] Solve host error problem in low performance embedded system when continune down and up. On Mon, 02 Oct 2006 14:26:36 -0400 Jesse Huang [EMAIL PROTECTED] wrote: Solve host error problem in low performance embedded system when continune down and up. I don't understand that. Please describe the actual problem which is being solved, as well as the means by which it was solved, thanks. - 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
Re: [PATCH] Restore the original TX FIFO overflow process.
Ok, I will generate new patch according to this. Thanks. - Original Message - From: Andrew Morton [EMAIL PROTECTED] To: Jesse Huang [EMAIL PROTECTED] Sent: Saturday, September 23, 2006 4:51 PM Subject: Re: [PATCH] Restore the original TX FIFO overflow process. On Sat, 23 Sep 2006 01:50:41 -0700 Andrew Morton [EMAIL PROTECTED] wrote: I suggest you send a complete new patch series against Jeff's latest tree. I'll send you a copy of that. attached. - 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] Restore the original TX FIFO overflow process.
From: Jesse Huang [EMAIL PROTECTED] Change Logs: - Restore the original TX FIFO overflow process. Signed-off-by: Jesse Huang [EMAIL PROTECTED] --- drivers/net/sundance.c | 45 +++-- 1 files changed, 27 insertions(+), 18 deletions(-) 7d8d60d6b1dbdbc36896148df1cc0242c037d838 diff --git a/drivers/net/sundance.c b/drivers/net/sundance.c index a253924..e68d325 100755 --- a/drivers/net/sundance.c +++ b/drivers/net/sundance.c @@ -21,8 +21,8 @@ */ #define DRV_NAME sundance -#define DRV_VERSION1.01+LK1.14 -#define DRV_RELDATE04-Aug-2006 +#define DRV_VERSION1.01+LK1.15 +#define DRV_RELDATE22-Sep-2006 /* The user-configurable values. @@ -1167,24 +1167,33 @@ static irqreturn_t intr_handler(int irq, if (tx_status 0x02) np-stats.tx_window_errors++; - /* FIFO ERROR need to be reset tx */ - if (tx_status 0x10) { /* Reset the Tx. */ - spin_lock(np-lock); - reset_tx(dev); - spin_unlock(np-lock); - } - if (tx_status 0x1e) { - /* need to make sure tx enabled */ - int i = 10; - do { - iowrite16(ioread16(ioaddr + MACCtrl1) | TxEnable, ioaddr + MACCtrl1); - if (ioread16(ioaddr + MACCtrl1) TxEnabled) - break; - mdelay(1); - } while (--i); + /* + ** This reset has been verified on + ** DFE-580TX boards ! [EMAIL PROTECTED] + */ + if (tx_status 0x10) { /* TxUnderrun */ + unsigned short txthreshold; + + txthreshold = ioread16 (ioaddr + TxStartThresh); + /* Restart Tx FIFO and transmitter */ + sundance_reset(dev, (NetworkReset|FIFOReset|TxReset) 16); + iowrite16 (txthreshold, ioaddr + TxStartThresh); + /* No need to reset the Tx pointer here */ } + /* Restart the Tx. */ + iowrite16 (TxEnable, ioaddr + MACCtrl1); } - + if (tx_status 0x1e) { + /* need to make sure tx enabled */ + int i = 10; + do { + iowrite16(ioread16(ioaddr + MACCtrl1) | TxEnable, ioaddr + MACCtrl1); + if (ioread16(ioaddr + MACCtrl1) TxEnabled) + break; + mdelay(1); + } while (--i); + } + iowrite16 (0, ioaddr + TxStatus); tx_status = ioread16 (ioaddr + TxStatus); if (tx_cnt 0) -- 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
Re: [PATCH 1/4] IP100A: Fix TX Pause bug (reset_tx, intr_handler)
Dear Philippe: (1)Because this is a patent issue, we are not allow to use it again, even it is in Data Sheet. (2)Ok, sorry for this, I will add it back. Should I resent those 4 patches? Or generate this as a new patch? Thanks very much! Best Regards, Jesse Huang. - Original Message - From: Philippe De Muyter [EMAIL PROTECTED] To: Jesse Huang [EMAIL PROTECTED] Cc: netdev@vger.kernel.org Sent: Monday, September 18, 2006 5:41 PM Subject: Re: [PATCH 1/4] IP100A: Fix TX Pause bug (reset_tx, intr_handler) On Mon, Sep 18, 2006 at 11:41:09AM +0800, Jesse Huang wrote: Dear Philippe: (1) We are not allow to support register TxStartThresh and, RxEarlyThresh, so we remove it. Could you develop ? - What do you mean by `We are not allow' - Is it specific to the IP100A chip ? Those register are documented in the Sundance Technology ST201 Data Sheet and when modified with fine-tuned values, they can have a real positive effect on the overall throughput on a loaded system. (2) Your consideration is right. But reset_tx is workaround for customer's embedded system, I don't have this enviroment now. I can't sure it will work fine if I removed this. On DFE-580TX boards, the reset_tx way did not work. The ports remained blocked until a power-cycle. I do not know if the TxUnderrun problem ever happened with earlier (one port) boards, so I doubt that the reset_tx way ever worked. Is was even commented as not being tested. On DFE-580TX boards, the current way has been verified by me and others to work, so please do not break it. Best regards Philippe Thanks you very mutch. Best Regards, Jesse Huang. - Original Message - From: Philippe De Muyter [EMAIL PROTECTED] To: Jesse Huang [EMAIL PROTECTED] Cc: netdev@vger.kernel.org Sent: Friday, September 15, 2006 7:44 PM Subject: Re: [PATCH 1/4] IP100A: Fix TX Pause bug (reset_tx, intr_handler) On Thu, Sep 14, 2006 at 12:58:30AM +, Jesse Huang wrote: [...] @@ -262,8 +262,6 @@ enum alta_offsets { ASICCtrl = 0x30, EEData = 0x34, EECtrl = 0x36, - TxStartThresh = 0x3c, - RxEarlyThresh = 0x3e, Why ? FlashAddr = 0x40, FlashData = 0x44, TxStatus = 0x46, [...] @@ -1156,29 +1160,29 @@ static irqreturn_t intr_handler(int irq, np-stats.tx_fifo_errors++; if (tx_status 0x02) np-stats.tx_window_errors++; - /* - ** This reset has been verified on - ** DFE-580TX boards ! [EMAIL PROTECTED] - */ - if (tx_status 0x10) { /* TxUnderrun */ - unsigned short txthreshold; - - txthreshold = ioread16 (ioaddr + TxStartThresh); - /* Restart Tx FIFO and transmitter */ - sundance_reset(dev, (NetworkReset|FIFOReset|TxReset) 16); - iowrite16 (txthreshold, ioaddr + TxStartThresh); - /* No need to reset the Tx pointer here */ + + /* FIFO ERROR need to be reset tx */ + if (tx_status 0x10) { /* Reset the Tx. */ + spin_lock(np-lock); + reset_tx(dev); + spin_unlock(np-lock); + } Just as the comments say, on DFE-580TX 4 port boards, where it is easy to reproduce TxUnderrun problems, just resetting on the chip the Tx FIFO and transmitter is enough. There is no need to call reset_tx, which discards all pending messages and frees all the skb's. It is also not necessary to reload the Tx pointer. Is it different with newer versions of the chip ? Philippe -- - 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
Re: [PATCH 1/4] IP100A: Fix TX Pause bug (reset_tx, intr_handler)
Dear Philippe: (1) We are not allow to support register TxStartThresh and, RxEarlyThresh, so we remove it. (2) Your consideration is right. But reset_tx is workaround for customer's embedded system, I don't have this enviroment now. I can't sure it will work fine if I removed this. Thanks you very mutch. Best Regards, Jesse Huang. - Original Message - From: Philippe De Muyter [EMAIL PROTECTED] To: Jesse Huang [EMAIL PROTECTED] Cc: netdev@vger.kernel.org Sent: Friday, September 15, 2006 7:44 PM Subject: Re: [PATCH 1/4] IP100A: Fix TX Pause bug (reset_tx, intr_handler) On Thu, Sep 14, 2006 at 12:58:30AM +, Jesse Huang wrote: [...] @@ -262,8 +262,6 @@ enum alta_offsets { ASICCtrl = 0x30, EEData = 0x34, EECtrl = 0x36, - TxStartThresh = 0x3c, - RxEarlyThresh = 0x3e, Why ? FlashAddr = 0x40, FlashData = 0x44, TxStatus = 0x46, [...] @@ -1156,29 +1160,29 @@ static irqreturn_t intr_handler(int irq, np-stats.tx_fifo_errors++; if (tx_status 0x02) np-stats.tx_window_errors++; - /* - ** This reset has been verified on - ** DFE-580TX boards ! [EMAIL PROTECTED] - */ - if (tx_status 0x10) { /* TxUnderrun */ - unsigned short txthreshold; - - txthreshold = ioread16 (ioaddr + TxStartThresh); - /* Restart Tx FIFO and transmitter */ - sundance_reset(dev, (NetworkReset|FIFOReset|TxReset) 16); - iowrite16 (txthreshold, ioaddr + TxStartThresh); - /* No need to reset the Tx pointer here */ + + /* FIFO ERROR need to be reset tx */ + if (tx_status 0x10) { /* Reset the Tx. */ + spin_lock(np-lock); + reset_tx(dev); + spin_unlock(np-lock); + } Just as the comments say, on DFE-580TX 4 port boards, where it is easy to reproduce TxUnderrun problems, just resetting on the chip the Tx FIFO and transmitter is enough. There is no need to call reset_tx, which discards all pending messages and frees all the skb's. It is also not necessary to reload the Tx pointer. Is it different with newer versions of the chip ? Philippe - 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
Re: What is current sundance.c status?
OK! I will resend my patchset. Thanks! Jesse - Original Message - From: Jeff Garzik [EMAIL PROTECTED] To: Jesse Huang [EMAIL PROTECTED] Cc: linux-kernel@vger.kernel.org; netdev@vger.kernel.org; [EMAIL PROTECTED] Sent: Wednesday, September 13, 2006 12:05 AM Subject: Re: What is current sundance.c status? Jesse Huang wrote: Dear Jeff: Would you tell me what is current sundance.c status which support IP100A? Are those patches update to current tree or not? Is there anything should I need to add to it and generate new patches? I think they disappeared from my queue somewhere :( Would you be kind enough to resend your patchset? Jeff - 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 1/4] IP100A: Fix TX Pause bug (reset_tx, intr_handler) 2006-08-24
From: Jesse Huang [EMAIL PROTECTED] Change Logs: - Fix TX Pause bug (reset_tx, intr_handler) Signed-off-by: Jesse Huang [EMAIL PROTECTED] --- drivers/net/sundance.c | 53 +++- 1 files changed, 30 insertions(+), 23 deletions(-) fb301c44641884efd60918054080f1ebc1d4f307 diff --git a/drivers/net/sundance.c b/drivers/net/sundance.c index ac17377..0b6028b 100755 --- a/drivers/net/sundance.c +++ b/drivers/net/sundance.c @@ -21,8 +21,8 @@ */ #define DRV_NAME sundance -#define DRV_VERSION1.1 -#define DRV_RELDATE27-Jun-2006 +#define DRV_VERSION1.2 +#define DRV_RELDATE03-Aug-2006 /* The user-configurable values. @@ -262,8 +262,6 @@ enum alta_offsets { ASICCtrl = 0x30, EEData = 0x34, EECtrl = 0x36, - TxStartThresh = 0x3c, - RxEarlyThresh = 0x3e, FlashAddr = 0x40, FlashData = 0x44, TxStatus = 0x46, @@ -1084,6 +1082,8 @@ reset_tx (struct net_device *dev) } /* free all tx skbuff */ for (i = 0; i TX_RING_SIZE; i++) { + np-tx_ring[i].next_desc = 0; + skb = np-tx_skbuff[i]; if (skb) { pci_unmap_single(np-pci_dev, @@ -1099,6 +1099,10 @@ reset_tx (struct net_device *dev) } np-cur_tx = np-dirty_tx = 0; np-cur_task = 0; + + np-last_tx = 0; + iowrite8(127, ioaddr + TxDMAPollPeriod); + iowrite16 (StatsEnable | RxEnable | TxEnable, ioaddr + MACCtrl1); return 0; } @@ -1156,29 +1160,29 @@ static irqreturn_t intr_handler(int irq, np-stats.tx_fifo_errors++; if (tx_status 0x02) np-stats.tx_window_errors++; - /* - ** This reset has been verified on - ** DFE-580TX boards ! [EMAIL PROTECTED] - */ - if (tx_status 0x10) { /* TxUnderrun */ - unsigned short txthreshold; - - txthreshold = ioread16 (ioaddr + TxStartThresh); - /* Restart Tx FIFO and transmitter */ - sundance_reset(dev, (NetworkReset|FIFOReset|TxReset) 16); - iowrite16 (txthreshold, ioaddr + TxStartThresh); - /* No need to reset the Tx pointer here */ + + /* FIFO ERROR need to be reset tx */ + if (tx_status 0x10) { /* Reset the Tx. */ + spin_lock(np-lock); + reset_tx(dev); + spin_unlock(np-lock); + } + if (tx_status 0x1e) { + /* need to make sure tx enabled */ + int i = 10; + do { + iowrite16(ioread16(ioaddr + MACCtrl1) | TxEnable, ioaddr + MACCtrl1); + if (ioread16(ioaddr + MACCtrl1) TxEnabled) + break; + mdelay(1); + } while (--i); } - /* Restart the Tx. */ - iowrite16 (TxEnable, ioaddr + MACCtrl1); } - /* Yup, this is a documentation bug. It cost me *hours*. */ + iowrite16 (0, ioaddr + TxStatus); - if (tx_cnt 0) { - iowrite32(5000, ioaddr + DownCounter); - break; - } tx_status = ioread16 (ioaddr + TxStatus); + if (tx_cnt 0) + break; } hw_frame_id = (tx_status 8) 0xff; } else { @@ -1244,6 +1248,9 @@ static irqreturn_t intr_handler(int irq, if (netif_msg_intr(np)) printk(KERN_DEBUG %s: exiting interrupt, status=%#4.4x.\n, dev-name, ioread16(ioaddr + IntrStatus)); + + iowrite32(5000, ioaddr + DownCounter); + return IRQ_RETVAL(handled
[PATCH 3/4] IP100A: Correct initial and close hardware step. 2006-08-24
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 4/4] IP100A: Solve host error problem in low performance embedded system when continune down and up. 2006-08-24
From: Jesse Huang [EMAIL PROTECTED] Change Logs: - Solve host error problem in low performance embedded system when continune down and up. Signed-off-by: Jesse Huang [EMAIL PROTECTED] --- drivers/net/sundance.c | 28 1 files changed, 24 insertions(+), 4 deletions(-) b7c2fba3fb7179d18c8b1c4af316c8a14d8ec1b8 diff --git a/drivers/net/sundance.c b/drivers/net/sundance.c index 04ad4d8..a253924 100755 --- a/drivers/net/sundance.c +++ b/drivers/net/sundance.c @@ -1076,7 +1076,7 @@ reset_tx (struct net_device *dev) struct sk_buff *skb; int i; int irq = in_interrupt(); - + /* Reset tx logic, TxListPtr will be cleaned */ iowrite16 (TxDisable, ioaddr + MACCtrl1); iowrite16 (TxReset | DMAReset | FIFOReset | NetworkReset, @@ -1647,6 +1647,14 @@ static int netdev_close(struct net_devic struct sk_buff *skb; int i; + /* Wait and kill tasklet */ + tasklet_kill(np-rx_tasklet); + tasklet_kill(np-tx_tasklet); + np-cur_tx = 0; + np-dirty_tx = 0; + np-cur_task = 0; + np-last_tx = 0; + netif_stop_queue(dev); if (netif_msg_ifdown(np)) { @@ -1667,9 +1675,20 @@ static int netdev_close(struct net_devic /* Stop the chip's Tx and Rx processes. */ iowrite16(TxDisable | RxDisable | StatsDisable, ioaddr + MACCtrl1); - /* Wait and kill tasklet */ - tasklet_kill(np-rx_tasklet); - tasklet_kill(np-tx_tasklet); + for (i = 2000; i 0; i--) { + if ((ioread32(ioaddr + DMACtrl) 0xC000) == 0) + break; + mdelay(1); + } + + iowrite16(GlobalReset | DMAReset | FIFOReset | NetworkReset, ioaddr +ASICCtrl + 2); + + for (i = 2000; i 0; i--) + { + if ((ioread16(ioaddr + ASICCtrl +2) ResetBusy) == 0) + break; + mdelay(1); + } #ifdef __i386__ if (netif_msg_hw(np)) { @@ -1707,6 +1726,7 @@ #endif /* __i386__ debugging only */ } } for (i = 0; i TX_RING_SIZE; i++) { + np-tx_ring[i].next_desc = 0; skb = np-tx_skbuff[i]; if (skb) { pci_unmap_single(np-pci_dev, -- 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
What is current sundance.c status?
Dear Jeff: Would you tell me what is current sundance.c status which support IP100A? Are those patches update to current tree or not? Is there anything should I need to add to it and generate new patches? Thank you very much. Best Regards, Jesse Huang - 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
Re: [PATCH] IP1000A: IC Plus update 2006-08-22
Hi Francois: In 0049-ip1000-switch-to-classical-tx_current-tx_dirty-ring-management.txt: The LastFreedTxBuff/LastTFDHoldAddr/LastTFDHoldCnt stuff in the xmit handler took care of the skb submitted by the upper layer when the ring was full, i.e. too late: the xmit handler now disables queueing (i.e. netif_stop_queue) when the whole Tx ring is completely full. The Tx irq handler does the required work to enable queuing again when some room is made. The remainder of the LastTFDHoldFoo (see ipg_nic_hard_start_xmit and ipg_nic_txfree) is moved to a tx_timeout handler where it imho belongs. It is better to Use tx_timeout than the original one. Thanks for that. Best Regards, Jesse Huang - Original Message - From: Francois Romieu [EMAIL PROTECTED] To: Jesse Huang [EMAIL PROTECTED] Cc: [EMAIL PROTECTED]; [EMAIL PROTECTED]; [EMAIL PROTECTED]; linux-kernel@vger.kernel.org; netdev@vger.kernel.org; [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Thursday, August 31, 2006 6:43 AM Subject: Re: [PATCH] IP1000A: IC Plus update 2006-08-22 Francois Romieu [EMAIL PROTECTED] : [...] Added: 0043-ip1000-use-the-new-IRQF_-constants-and-the-dma_-alloc-free-_coherent-AP I.txt 0044-ip1000-mixed-case-and-upper-case-removal.txt 0045-ip1000-add-ipg_-r-w-8-16-32-macros.txt Added: 0046-ip1000-kiss-TxBuffDMAhandle-goodbye.txt 0047-ip1000-kiss-RxBuffDMAhandle-goodbye.txt 0048-ip1000-turn-StationAddr-0-1-2-into-an-array.txt 0049-ip1000-switch-to-classical-tx_current-tx_dirty-ring-management.txt The previous branch for the driver at git://electric-eye.fr.zoreil.com/home/romieu/linux-2.6.git has been stored as 'netdev-ipg-20060831.old'. The current one is based on dc709bd and named 'ipg'. Nothing will be pushed tomorrow as I have some bugs to review in different drivers. -- Ueimor - 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
Re: [PATCH] IP1000A: IC Plus update 2006-08-22
It's Ok. Thanks for that. Jesse - Original Message - From: Francois Romieu [EMAIL PROTECTED] To: Jesse Huang [EMAIL PROTECTED] Cc: [EMAIL PROTECTED]; [EMAIL PROTECTED]; [EMAIL PROTECTED]; linux-kernel@vger.kernel.org; netdev@vger.kernel.org; [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Monday, August 28, 2006 6:08 AM Subject: Re: [PATCH] IP1000A: IC Plus update 2006-08-22 Francois Romieu [EMAIL PROTECTED] : Jesse Huang [EMAIL PROTECTED] : [...] Added: 0039-ip1000-cosmetic-in-ipg_interrupt_handler.txt 0040-ip1000-irq-handler-and-device-close-race.txt 0041-ip1000-schedule-the-host-error-recovery-to-user-context.txt 0042-ip1000-no-need-to-mask-a-constant-field-with-RSVD_MASK.txt Added: 0043-ip1000-use-the-new-IRQF_-constants-and-the-dma_-alloc-free-_coherent-AP I.txt 0044-ip1000-mixed-case-and-upper-case-removal.txt 0045-ip1000-add-ipg_-r-w-8-16-32-macros.txt The patches beyond 0043 are only available through HTTP. Since 0043 needs a recent enough kernel and the current driver has branched from an old release, I plan to rebase my branch. Does it raise any objection or remark ? -- Ueimor - 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 1/4] IP100A: Fix TX Pause bug (reset_tx, intr_handler) 2006-08-24
From: Jesse Huang [EMAIL PROTECTED] Change Logs: - Fix TX Pause bug (reset_tx, intr_handler) Signed-off-by: Jesse Huang [EMAIL PROTECTED] --- drivers/net/sundance.c | 53 +++- 1 files changed, 30 insertions(+), 23 deletions(-) fb301c44641884efd60918054080f1ebc1d4f307 diff --git a/drivers/net/sundance.c b/drivers/net/sundance.c index ac17377..0b6028b 100755 --- a/drivers/net/sundance.c +++ b/drivers/net/sundance.c @@ -21,8 +21,8 @@ */ #define DRV_NAME sundance -#define DRV_VERSION1.1 -#define DRV_RELDATE27-Jun-2006 +#define DRV_VERSION1.2 +#define DRV_RELDATE03-Aug-2006 /* The user-configurable values. @@ -262,8 +262,6 @@ enum alta_offsets { ASICCtrl = 0x30, EEData = 0x34, EECtrl = 0x36, - TxStartThresh = 0x3c, - RxEarlyThresh = 0x3e, FlashAddr = 0x40, FlashData = 0x44, TxStatus = 0x46, @@ -1084,6 +1082,8 @@ reset_tx (struct net_device *dev) } /* free all tx skbuff */ for (i = 0; i TX_RING_SIZE; i++) { + np-tx_ring[i].next_desc = 0; + skb = np-tx_skbuff[i]; if (skb) { pci_unmap_single(np-pci_dev, @@ -1099,6 +1099,10 @@ reset_tx (struct net_device *dev) } np-cur_tx = np-dirty_tx = 0; np-cur_task = 0; + + np-last_tx = 0; + iowrite8(127, ioaddr + TxDMAPollPeriod); + iowrite16 (StatsEnable | RxEnable | TxEnable, ioaddr + MACCtrl1); return 0; } @@ -1156,29 +1160,29 @@ static irqreturn_t intr_handler(int irq, np-stats.tx_fifo_errors++; if (tx_status 0x02) np-stats.tx_window_errors++; - /* - ** This reset has been verified on - ** DFE-580TX boards ! [EMAIL PROTECTED] - */ - if (tx_status 0x10) { /* TxUnderrun */ - unsigned short txthreshold; - - txthreshold = ioread16 (ioaddr + TxStartThresh); - /* Restart Tx FIFO and transmitter */ - sundance_reset(dev, (NetworkReset|FIFOReset|TxReset) 16); - iowrite16 (txthreshold, ioaddr + TxStartThresh); - /* No need to reset the Tx pointer here */ + + /* FIFO ERROR need to be reset tx */ + if (tx_status 0x10) { /* Reset the Tx. */ + spin_lock(np-lock); + reset_tx(dev); + spin_unlock(np-lock); + } + if (tx_status 0x1e) { + /* need to make sure tx enabled */ + int i = 10; + do { + iowrite16(ioread16(ioaddr + MACCtrl1) | TxEnable, ioaddr + MACCtrl1); + if (ioread16(ioaddr + MACCtrl1) TxEnabled) + break; + mdelay(1); + } while (--i); } - /* Restart the Tx. */ - iowrite16 (TxEnable, ioaddr + MACCtrl1); } - /* Yup, this is a documentation bug. It cost me *hours*. */ + iowrite16 (0, ioaddr + TxStatus); - if (tx_cnt 0) { - iowrite32(5000, ioaddr + DownCounter); - break; - } tx_status = ioread16 (ioaddr + TxStatus); + if (tx_cnt 0) + break; } hw_frame_id = (tx_status 8) 0xff; } else { @@ -1244,6 +1248,9 @@ static irqreturn_t intr_handler(int irq, if (netif_msg_intr(np)) printk(KERN_DEBUG %s: exiting interrupt, status=%#4.4x.\n, dev-name, ioread16(ioaddr + IntrStatus)); + + iowrite32(5000, ioaddr + DownCounter); + return IRQ_RETVAL(handled
[PATCH 4/4] IP100A: Solve host error problem in low performance embedded system when continune down and up. 2006-08-24
From: Jesse Huang [EMAIL PROTECTED] Change Logs: - Solve host error problem in low performance embedded system when continune down and up. Signed-off-by: Jesse Huang [EMAIL PROTECTED] --- drivers/net/sundance.c | 28 1 files changed, 24 insertions(+), 4 deletions(-) b7c2fba3fb7179d18c8b1c4af316c8a14d8ec1b8 diff --git a/drivers/net/sundance.c b/drivers/net/sundance.c index 04ad4d8..a253924 100755 --- a/drivers/net/sundance.c +++ b/drivers/net/sundance.c @@ -1076,7 +1076,7 @@ reset_tx (struct net_device *dev) struct sk_buff *skb; int i; int irq = in_interrupt(); - + /* Reset tx logic, TxListPtr will be cleaned */ iowrite16 (TxDisable, ioaddr + MACCtrl1); iowrite16 (TxReset | DMAReset | FIFOReset | NetworkReset, @@ -1647,6 +1647,14 @@ static int netdev_close(struct net_devic struct sk_buff *skb; int i; + /* Wait and kill tasklet */ + tasklet_kill(np-rx_tasklet); + tasklet_kill(np-tx_tasklet); + np-cur_tx = 0; + np-dirty_tx = 0; + np-cur_task = 0; + np-last_tx = 0; + netif_stop_queue(dev); if (netif_msg_ifdown(np)) { @@ -1667,9 +1675,20 @@ static int netdev_close(struct net_devic /* Stop the chip's Tx and Rx processes. */ iowrite16(TxDisable | RxDisable | StatsDisable, ioaddr + MACCtrl1); - /* Wait and kill tasklet */ - tasklet_kill(np-rx_tasklet); - tasklet_kill(np-tx_tasklet); + for (i = 2000; i 0; i--) { + if ((ioread32(ioaddr + DMACtrl) 0xC000) == 0) + break; + mdelay(1); + } + + iowrite16(GlobalReset | DMAReset | FIFOReset | NetworkReset, ioaddr +ASICCtrl + 2); + + for (i = 2000; i 0; i--) + { + if ((ioread16(ioaddr + ASICCtrl +2) ResetBusy) == 0) + break; + mdelay(1); + } #ifdef __i386__ if (netif_msg_hw(np)) { @@ -1707,6 +1726,7 @@ #endif /* __i386__ debugging only */ } } for (i = 0; i TX_RING_SIZE; i++) { + np-tx_ring[i].next_desc = 0; skb = np-tx_skbuff[i]; if (skb) { pci_unmap_single(np-pci_dev, -- 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
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
Re: [PATCH] IP1000A: IC Plus update 2006-08-22
Hi Francois: I am very appreciated what you do for IP1000A. I will follow those files. Thanks you very much! Best Regards, Jesse Huang - Original Message - From: Francois Romieu [EMAIL PROTECTED] To: Jesse Huang [EMAIL PROTECTED] Cc: [EMAIL PROTECTED]; [EMAIL PROTECTED]; [EMAIL PROTECTED]; linux-kernel@vger.kernel.org; netdev@vger.kernel.org; [EMAIL PROTECTED] Sent: Thursday, August 24, 2006 6:30 AM Subject: Re: [PATCH] IP1000A: IC Plus update 2006-08-22 Francois Romieu [EMAIL PROTECTED] : [...] Typo. It should be: http://www.fr.zoreil.com/linux/kernel/2.6.x/2.6.18-rc4/ip1000 Added 0038-ip1000-CodingStyle.txt. More local variables, more unsigned int, less MixedCase, ipg_nic_rx() fits in your favorite 80 cols console. -- Ueimor - 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
Re: [PATCH 4/4] IP100A: Solve host error problem in low performance embedded system when continune down and up.
Hi Randy: Sorry for the file path. I will regenerate with path a/drivers/net/sundance.c and re-submit again. Thanks for your help! Best Regards, Jesse Huang - Original Message - From: Randy.Dunlap [EMAIL PROTECTED] To: Jesse Huang [EMAIL PROTECTED] Cc: linux-kernel@vger.kernel.org; netdev@vger.kernel.org; [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Wednesday, August 23, 2006 12:05 AM Subject: Re: [PATCH 4/4] IP100A: Solve host error problem in low performance embedded system when continune down and up. On Tue, 22 Aug 2006 14:31:32 -0400 Jesse Huang wrote: From: Jesse Huang [EMAIL PROTECTED] Change Logs: - Solve host error problem in low performance embedded system when continune down and up. Signed-off-by: Jesse Huang [EMAIL PROTECTED] --- sundance.c | 30 +- 1 files changed, 25 insertions(+), 5 deletions(-) Full path/file names above and below, please. a88c635933a981dd4fca87e5b8ca9426c5c98013 diff --git a/sundance.c b/sundance.c index 424aebd..de55e0f 100755 --- a/sundance.c +++ b/sundance.c @@ -1647,6 +1647,14 @@ static int netdev_close(struct net_devic struct sk_buff *skb; int i; + /* Wait and kill tasklet */ + tasklet_kill(np-rx_tasklet); + tasklet_kill(np-tx_tasklet); + np-cur_tx = 0; + np-dirty_tx = 0; Use same indentation/whitespace as surrounding code. (tabs, not spaces) + np-cur_task = 0; + np-last_tx = 0; + netif_stop_queue(dev); if (netif_msg_ifdown(np)) { @@ -1667,9 +1675,20 @@ static int netdev_close(struct net_devic /* Stop the chip's Tx and Rx processes. */ iowrite16(TxDisable | RxDisable | StatsDisable, ioaddr + MACCtrl1); - /* Wait and kill tasklet */ - tasklet_kill(np-rx_tasklet); - tasklet_kill(np-tx_tasklet); +for (i = 2000; i 0; i--) { + if ((ioread32(ioaddr + DMACtrl) 0xC000) == 0) + break; + mdelay(1); +} + +iowrite16(GlobalReset | DMAReset | FIFOReset |NetworkReset, ioaddr +ASICCtrl + 2); + +for (i = 2000; i 0; i--) +{ + if ((ioread16(ioaddr + ASICCtrl +2) ResetBusy) == 0) + break; + mdelay(1); +} Same comment about indentation/whitespace. --- ~Randy - 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 1/4] IP100A: Fix TX Pause bug (reset_tx, intr_handler)
From: Jesse Huang [EMAIL PROTECTED] Change Logs: - Fix TX Pause bug (reset_tx, intr_handler) Signed-off-by: Jesse Huang [EMAIL PROTECTED] --- sundance.c | 53 ++--- 1 files changed, 30 insertions(+), 23 deletions(-) ba5de849a1160e56f83456ea059ea600029dfb43 diff --git a/sundance.c b/sundance.c index ac17377..0ef8f19 100755 --- a/sundance.c +++ b/sundance.c @@ -21,8 +21,8 @@ */ #define DRV_NAME sundance -#define DRV_VERSION1.1 -#define DRV_RELDATE27-Jun-2006 +#define DRV_VERSION1.2 +#define DRV_RELDATE03-Aug-2006 /* The user-configurable values. @@ -262,8 +262,6 @@ enum alta_offsets { ASICCtrl = 0x30, EEData = 0x34, EECtrl = 0x36, - TxStartThresh = 0x3c, - RxEarlyThresh = 0x3e, FlashAddr = 0x40, FlashData = 0x44, TxStatus = 0x46, @@ -1084,6 +1082,8 @@ reset_tx (struct net_device *dev) } /* free all tx skbuff */ for (i = 0; i TX_RING_SIZE; i++) { + np-tx_ring[i].next_desc = 0; + skb = np-tx_skbuff[i]; if (skb) { pci_unmap_single(np-pci_dev, @@ -1099,6 +1099,10 @@ reset_tx (struct net_device *dev) } np-cur_tx = np-dirty_tx = 0; np-cur_task = 0; + + np-last_tx=0; + iowrite8(127, ioaddr + TxDMAPollPeriod); + iowrite16 (StatsEnable | RxEnable | TxEnable, ioaddr + MACCtrl1); return 0; } @@ -1156,29 +1160,29 @@ static irqreturn_t intr_handler(int irq, np-stats.tx_fifo_errors++; if (tx_status 0x02) np-stats.tx_window_errors++; - /* - ** This reset has been verified on - ** DFE-580TX boards ! [EMAIL PROTECTED] - */ - if (tx_status 0x10) { /* TxUnderrun */ - unsigned short txthreshold; - - txthreshold = ioread16 (ioaddr + TxStartThresh); - /* Restart Tx FIFO and transmitter */ - sundance_reset(dev, (NetworkReset|FIFOReset|TxReset) 16); - iowrite16 (txthreshold, ioaddr + TxStartThresh); - /* No need to reset the Tx pointer here */ + + /* FIFO ERROR need to be reset tx */ + if (tx_status 0x10) { /* Reset the Tx. */ + spin_lock(np-lock); + reset_tx(dev); + spin_unlock(np-lock); + } + if (tx_status 0x1e) { + /* need to make sure tx enabled */ + int i = 10; + do { + iowrite16 (ioread16(ioaddr + MACCtrl1) | TxEnable, ioaddr + MACCtrl1); + if (ioread16(ioaddr + MACCtrl1) TxEnabled) + break; + mdelay(1); + } while (--i); } - /* Restart the Tx. */ - iowrite16 (TxEnable, ioaddr + MACCtrl1); } - /* Yup, this is a documentation bug. It cost me *hours*. */ + iowrite16 (0, ioaddr + TxStatus); - if (tx_cnt 0) { - iowrite32(5000, ioaddr + DownCounter); - break; - } tx_status = ioread16 (ioaddr + TxStatus); + if (tx_cnt 0) + break; } hw_frame_id = (tx_status 8) 0xff; } else { @@ -1244,6 +1248,9 @@ static irqreturn_t intr_handler(int irq, if (netif_msg_intr(np)) printk(KERN_DEBUG %s: exiting interrupt, status=%#4.4x.\n, dev-name, ioread16(ioaddr + IntrStatus)); + + iowrite32(5000, ioaddr + DownCounter
[PATCH 4/4] IP100A: Solve host error problem in low performance embedded system when continune down and up.
From: Jesse Huang [EMAIL PROTECTED] Change Logs: - Solve host error problem in low performance embedded system when continune down and up. Signed-off-by: Jesse Huang [EMAIL PROTECTED] --- sundance.c | 30 +- 1 files changed, 25 insertions(+), 5 deletions(-) a88c635933a981dd4fca87e5b8ca9426c5c98013 diff --git a/sundance.c b/sundance.c index 424aebd..de55e0f 100755 --- a/sundance.c +++ b/sundance.c @@ -831,7 +831,7 @@ #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); @@ -1076,7 +1076,7 @@ reset_tx (struct net_device *dev) struct sk_buff *skb; int i; int irq = in_interrupt(); - + /* Reset tx logic, TxListPtr will be cleaned */ iowrite16 (TxDisable, ioaddr + MACCtrl1); iowrite16 (TxReset | DMAReset | FIFOReset | NetworkReset, @@ -1647,6 +1647,14 @@ static int netdev_close(struct net_devic struct sk_buff *skb; int i; + /* Wait and kill tasklet */ + tasklet_kill(np-rx_tasklet); + tasklet_kill(np-tx_tasklet); + np-cur_tx = 0; + np-dirty_tx = 0; + np-cur_task = 0; + np-last_tx = 0; + netif_stop_queue(dev); if (netif_msg_ifdown(np)) { @@ -1667,9 +1675,20 @@ static int netdev_close(struct net_devic /* Stop the chip's Tx and Rx processes. */ iowrite16(TxDisable | RxDisable | StatsDisable, ioaddr + MACCtrl1); - /* Wait and kill tasklet */ - tasklet_kill(np-rx_tasklet); - tasklet_kill(np-tx_tasklet); +for (i = 2000; i 0; i--) { +if ((ioread32(ioaddr + DMACtrl) 0xC000) == 0) + break; +mdelay(1); +} + +iowrite16(GlobalReset | DMAReset | FIFOReset |NetworkReset, ioaddr +ASICCtrl + 2); + +for (i = 2000; i 0; i--) +{ +if ((ioread16(ioaddr + ASICCtrl +2) ResetBusy) == 0) + break; +mdelay(1); +} #ifdef __i386__ if (netif_msg_hw(np)) { @@ -1707,6 +1726,7 @@ #endif /* __i386__ debugging only */ } } for (i = 0; i TX_RING_SIZE; i++) { + np-tx_ring[i].next_desc = 0; skb = np-tx_skbuff[i]; if (skb) { pci_unmap_single(np-pci_dev, -- 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.
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
Re: [PATCH 6/6] IP100A Solve host error problem when in low performance embedded
Hi Jeff: (4) are you certain that DMACtrl should be read as a 32-bit register? In other code, you treat it as a 16-bit register. DMACtrl can read and write both in 16-bit and 32-bit. I will modify all of then as 32-bit. Thanks. Jesse - 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] IP1000A: IC Plus update
Dear All: I had regenerate this patch from: git://git.kernel.org/pub/scm/linux/kernel/git/penberg/netdev-ipg-2.6.git And, submit those modifications as one patch. From: Jesse Huang [EMAIL PROTECTED] Change Logs: - update maintainer information - remove some default phy params - remove threshold config from ipg_io_config - ip1000 ipg_config_autoneg rewrite - modify coding style of ipg_config_autoneg - Add IPG_AC_FIFO flag when Tx reset - For compatible at PCI 66MHz issue Signed-off-by: Jesse Huang [EMAIL PROTECTED] Thanks! Best Regards, Jesse Huang --- ipg.c | 394 +++-- ipg.h | 96 +--- 2 files changed, 92 insertions(+), 398 deletions(-) 8bd0325e52d2578c37cd251aeac2136f7cca9098 diff --git a/ipg.c b/ipg.c index 754ddb5..7c541c2 100644 --- a/ipg.c +++ b/ipg.c @@ -1,18 +1,26 @@ -/*PCI_DEVICE_ID_IP1000 +/* + * ipg.c: Device Driver for the IP1000 Gigabit Ethernet Adapter + * + * Copyright (C) 2003, 2006 IC Plus Corp. + * + * Original Author: * - * ipg.c + * Craig Rich + * Sundance Technology, Inc. + * 1485 Saratoga Avenue + * Suite 200 + * San Jose, CA 95129 + * 408 873 4117 + * www.sundanceti.com + * [EMAIL PROTECTED] * - * IC Plus IP1000 Gigabit Ethernet Adapter Linux Driver v2.01 - * by IC Plus Corp. 2003 + * Current Maintainer: * - * Craig Rich - * Sundance Technology, Inc. - * 1485 Saratoga Avenue - * Suite 200 - * San Jose, CA 95129 - * 408 873 4117 - * www.sundanceti.com - * [EMAIL PROTECTED] + * Sorbica Shieh. + * 10F, No.47, Lane 2, Kwang-Fu RD. + * Sec. 2, Hsin-Chu, Taiwan, R.O.C. + * http://www.icplus.com.tw + * [EMAIL PROTECTED] */ #include linux/crc32.h #include linux/ethtool.h @@ -476,26 +484,20 @@ static int ipg_config_autoneg(struct net { struct ipg_nic_private *sp = netdev_priv(dev); void __iomem *ioaddr = sp-ioaddr; + u8 phyctrl; u32 asicctrl; - u32 mac_ctl; - int phyaddr = 0; - u16 status = 0; - u16 advertisement; - u16 linkpartner_ability; - u16 gigadvertisement; - u16 giglinkpartner_ability; - u16 techabilities; int fiber; int gig; int fullduplex; int txflowcontrol; int rxflowcontrol; - u8 phyctrl; + long mac_ctrl_value; IPG_DEBUG_MSG(_config_autoneg\n); asicctrl = ioread32(ioaddr + ASIC_CTRL); - phyctrl = ioread8(ioaddr + PHY_CTRL); + phyctrl = ioread8(ioaddr + PHY_CTRL); + mac_ctrl_value = ioread32(ioaddr + MAC_CTRL); /* Set flags for use in resolving auto-negotation, assuming * non-1000Mbps, half duplex, no flow control. @@ -511,14 +513,13 @@ static int ipg_config_autoneg(struct net */ sp-tenmbpsmode = 0; - printk(Link speed = ); + printk(KERN_INFO Link speed = ); /* Determine actual speed of operation. */ switch (phyctrl IPG_PC_LINK_SPEED) { case IPG_PC_LINK_SPEED_10MBPS: printk(10Mbps.\n); - printk(KERN_INFO %s: 10Mbps operational mode enabled.\n, - dev-name); + printk(%s: 10Mbps operational mode enabled.\n,dev-name); sp-tenmbpsmode = 1; break; case IPG_PC_LINK_SPEED_100MBPS: @@ -530,283 +531,50 @@ static int ipg_config_autoneg(struct net break; default: printk(undefined!\n); - } - - fiber = ipg_sti_fiber_detect(dev); - - /* Determine if auto-negotiation resolution is necessary. -* First check for fiber based media 10/100 media. -*/ - if ((fiber == 1) - (asicctrl (IPG_AC_PHY_SPEED10 | IPG_AC_PHY_SPEED100))) { - printk(KERN_INFO - %s: Fiber based PHY, setting full duplex, no flow control.\n, - dev-name); - - mac_ctl = ioread32(ioaddr + MAC_CTRL); - mac_ctl |= IPG_MC_DUPLEX_SELECT_FD; - mac_ctl = ~IPG_MC_TX_FLOW_CONTROL_ENABLE; - mac_ctl = ~IPG_MC_RX_FLOW_CONTROL_ENABLE; - - iowrite32(IPG_MC_RSVD_MASK mac_ctl, ioaddr + MAC_CTRL); - return 0; } - /* Determine if PHY is auto-negotiation capable. */ - phyaddr = ipg_find_phyaddr(dev); - - if (phyaddr == -1) { - printk(KERN_INFO - %s: Error on read to GMII/MII Status register.\n, - dev-name); - return -EILSEQ; - } - sp-mii_if.phy_id = phyaddr; - - IPG_DEBUG_MSG(GMII/MII PHY address = %x\n, phyaddr); - - status = mdio_read(dev, phyaddr, MII_BMSR); - - printk(PHYStatus = %x \n, status); - if ((status BMSR_ANEGCAPABLE) == 0) { - printk(KERN_INFO - %s: Error PHY unable to perform auto-negotiation.\n, - dev-name); - return
Re: [PATCH 2/6] IP100A Fix Tx pause bug
- Original Message - From: Jeff Garzik [EMAIL PROTECTED] To: Jesse Huang [EMAIL PROTECTED] Cc: linux-kernel@vger.kernel.org; netdev@vger.kernel.org; [EMAIL PROTECTED] Sent: Friday, August 18, 2006 7:27 PM Subject: Re: [PATCH 2/6] IP100A Fix Tx pause bug (1) + iowrite8(127, ioaddr + TxDMAPollPeriod); + what does the value 127 represent? 127 is polling period of Tx DMA to watch if there any packet need to send. The 127 means 127*320ns. (2) DownCounter should not be written unconditionally. Consider shared interrupts, where sundance performs no work, and handled==0. DownCount is a the register that we can use for timer interrupt. When the value of DownCount from 1 count down to 0 , IP100A will issue an interrupt. - 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
Re: [PATCH] IP1000A: IC Plus update
Hi Randy: Thanks for your review. I will follow your suggestions. I used git-format-diff to generate this patch, should I use diffstat to instead of it? The old DefaultPhyParam table content a lot of furture hardware parameters. We are sure now that is not need for new version of IP1000A, so I remove those. Thanks for help. Jesse - Original Message - From: Randy.Dunlap [EMAIL PROTECTED] To: Jesse Huang [EMAIL PROTECTED] Cc: [EMAIL PROTECTED]; [EMAIL PROTECTED]; [EMAIL PROTECTED]; [EMAIL PROTECTED]; linux-kernel@vger.kernel.org; netdev@vger.kernel.org Sent: Tuesday, August 22, 2006 12:25 AM Subject: Re: [PATCH] IP1000A: IC Plus update On Mon, 21 Aug 2006 16:32:07 -0400 Jesse Huang wrote: Dear All: I had regenerate this patch from: git://git.kernel.org/pub/scm/linux/kernel/git/penberg/netdev-ipg-2.6.git And, submit those modifications as one patch. From: Jesse Huang [EMAIL PROTECTED] Change Logs: - update maintainer information - remove some default phy params - remove threshold config from ipg_io_config - ip1000 ipg_config_autoneg rewrite - modify coding style of ipg_config_autoneg - Add IPG_AC_FIFO flag when Tx reset - For compatible at PCI 66MHz issue Signed-off-by: Jesse Huang [EMAIL PROTECTED] --- ipg.c | 394 ++ +-- ipg.h | 96 +--- 2 files changed, 92 insertions(+), 398 deletions(-) Please use diffstat -p1 -w 70 for diffstat output so that we can see the full path/file names that are modified in the patch. 8bd0325e52d2578c37cd251aeac2136f7cca9098 diff --git a/ipg.c b/ipg.c index 754ddb5..7c541c2 100644 --- a/ipg.c +++ b/ipg.c Similar to the diffstat comment, the diff a b filenames should show the full path to the source file, e.g.: --- a/drivers/net/ipg.c +++ b/drivers/net/ipg.c @@ -511,14 +513,13 @@ static int ipg_config_autoneg(struct net */ sp-tenmbpsmode = 0; - printk(Link speed = ); + printk(KERN_INFO Link speed = ); /* Determine actual speed of operation. */ switch (phyctrl IPG_PC_LINK_SPEED) { case IPG_PC_LINK_SPEED_10MBPS: printk(10Mbps.\n); - printk(KERN_INFO %s: 10Mbps operational mode enabled.\n, -dev-name); + printk(%s: 10Mbps operational mode enabled. \n,dev-name); Space before dev-name. Why dropping the KERN_INFO here? The previous printk contains a newline character, so KERN_* is still valid. sp-tenmbpsmode = 1; break; case IPG_PC_LINK_SPEED_100MBPS: @@ -530,283 +531,50 @@ static int ipg_config_autoneg(struct net + /* Configure full duplex, and flow control. */ + if (fullduplex == 1) { + /* Configure IPG for full duplex operation. */ + printk(KERN_INFO setting full duplex, ); This series of printk calls needs some kind of device or driver identification. - if ((advertisement ADVERTISE_1000XFULL) == - (linkpartner_ability ADVERTISE_1000XFULL)) { - fullduplex = 1; + mac_ctrl_value |= IPG_MC_DUPLEX_SELECT_FD; - /* In 1000BASE-X using IPG's internal PCS - * layer, so write to the GMII duplex bit. - */ - bmcr |= ADVERTISE_1000HALF; // Typo ? + if (txflowcontrol == 1) { + printk(TX flow control); + mac_ctrl_value |= IPG_MC_TX_FLOW_CONTROL_ENABLE; } else { - fullduplex = 0; - - /* In 1000BASE-X using IPG's internal PCS - * layer, so write to the GMII duplex bit. - */ - bmcr = ~ADVERTISE_1000HALF; // Typo ? + printk(no TX flow control); + mac_ctrl_value = ~IPG_MC_TX_FLOW_CONTROL_ENABLE; } - mdio_write(dev, phyaddr, MII_BMCR, bmcr); - } + } else { + /* Configure IPG for half duplex operation. */ + printk(KERN_INFO setting half duplex, no TX flow control, no RX flow control.\n); Same here: needs device (preferably) or driver identification. - default: - txflowcontrol = 0; - rxflowcontrol = 0; - } + mac_ctrl_value = ~IPG_MC_DUPLEX_SELECT_FD ~IPG_MC_TX_FLOW_CONTROL_ENABLE ~IPG_MC_RX_FLOW_CONTROL_ENABLE; } @@ -1158,6 +916,7 @@ static void ipg_nic_txfree(struct net_de struct ipg_nic_private *sp = netdev_priv(dev); int NextToFree; int maxtfdcount; + long CurrentTxTFDPtr=(ioread32(ipg_ioaddr(dev) +TFD_LIST_PTR_0)-(long)sp-TFDListDMAhandle)/(long)sizeof(struct TFD); Space before and after '=' sign. @@ -1180,8 +939,10 @@ static void ipg_nic_txfree(struct net_de * If the TFDDone bit is set, free the associated * buffer. */ - if ((le64_to_cpu(sp-TFDList[NextToFree].TFC) - IPG_TFC_TFDDONE) (NextToFree != sp-CurrentTFD)) { + if((NextToFree != sp-CurrentTFD)(NextToFree! =CurrentTxTFDPtr)) Spaces before and after and != etc. (as in the former code). + { + //JesseAdd: setup TFDDONE for compatible issue. + sp-TFDList[NextToFree].TFC = cpu_to_le64 (sp-TFDList[NextToFree].TFC|IPG_TFC_TFDDONE); /* Free the transmit buffer. */ if (sp-TxBuff[NextToFree] != NULL) { pci_unmap_single(sp-pdev, @@ -1204,6 +965,15 @@ static void ipg_nic_txfree(struct net_de maxtfdcount--; } while (maxtfdcount != 0); + if(sp-LastTFDHoldCnt1000
[PATCH] IP1000A: IC Plus update 2006-08-22
Dear All: I had regenerate this patch from: git://git.kernel.org/pub/scm/linux/kernel/git/penberg/netdev-ipg-2.6.git And, submit those modifications as one patch. Add: Remove and add some whitespace From: Jesse Huang [EMAIL PROTECTED] Change Logs: - update maintainer information - remove some default phy params - remove threshold config from ipg_io_config - ip1000 ipg_config_autoneg rewrite - modify coding style of ipg_config_autoneg - Add IPG_AC_FIFO flag when Tx reset - For compatible at PCI 66MHz issue - Remove and add some whitespace Signed-off-by: Jesse Huang [EMAIL PROTECTED] --- ipg.c | 402 +++-- ipg.h | 94 --- 2 files changed, 93 insertions(+), 403 deletions(-) 0aeee0ba5c95281969bd8fbbd713e7f2ed5a3252 diff --git a/ipg.c b/ipg.c index 754ddb5..83334b0 100755 --- a/ipg.c +++ b/ipg.c @@ -1,18 +1,26 @@ -/*PCI_DEVICE_ID_IP1000 +/* + * ipg.c: Device Driver for the IP1000 Gigabit Ethernet Adapter + * + * Copyright (C) 2003, 2006 IC Plus Corp. + * + * Original Author: * - * ipg.c + * Craig Rich + * Sundance Technology, Inc. + * 1485 Saratoga Avenue + * Suite 200 + * San Jose, CA 95129 + * 408 873 4117 + * www.sundanceti.com + * [EMAIL PROTECTED] * - * IC Plus IP1000 Gigabit Ethernet Adapter Linux Driver v2.01 - * by IC Plus Corp. 2003 + * Current Maintainer: * - * Craig Rich - * Sundance Technology, Inc. - * 1485 Saratoga Avenue - * Suite 200 - * San Jose, CA 95129 - * 408 873 4117 - * www.sundanceti.com - * [EMAIL PROTECTED] + * Sorbica Shieh. + * 10F, No.47, Lane 2, Kwang-Fu RD. + * Sec. 2, Hsin-Chu, Taiwan, R.O.C. + * http://www.icplus.com.tw + * [EMAIL PROTECTED] */ #include linux/crc32.h #include linux/ethtool.h @@ -476,26 +484,20 @@ static int ipg_config_autoneg(struct net { struct ipg_nic_private *sp = netdev_priv(dev); void __iomem *ioaddr = sp-ioaddr; + u8 phyctrl; u32 asicctrl; - u32 mac_ctl; - int phyaddr = 0; - u16 status = 0; - u16 advertisement; - u16 linkpartner_ability; - u16 gigadvertisement; - u16 giglinkpartner_ability; - u16 techabilities; int fiber; int gig; int fullduplex; int txflowcontrol; int rxflowcontrol; - u8 phyctrl; + long mac_ctrl_value; IPG_DEBUG_MSG(_config_autoneg\n); asicctrl = ioread32(ioaddr + ASIC_CTRL); - phyctrl = ioread8(ioaddr + PHY_CTRL); + phyctrl = ioread8(ioaddr + PHY_CTRL); + mac_ctrl_value = ioread32(ioaddr + MAC_CTRL); /* Set flags for use in resolving auto-negotation, assuming * non-1000Mbps, half duplex, no flow control. @@ -511,14 +513,13 @@ static int ipg_config_autoneg(struct net */ sp-tenmbpsmode = 0; - printk(Link speed = ); + printk(KERN_INFO Link speed = ); /* Determine actual speed of operation. */ switch (phyctrl IPG_PC_LINK_SPEED) { case IPG_PC_LINK_SPEED_10MBPS: printk(10Mbps.\n); - printk(KERN_INFO %s: 10Mbps operational mode enabled.\n, - dev-name); + printk(KERN_INFO %s: 10Mbps operational mode enabled.\n, dev-name); sp-tenmbpsmode = 1; break; case IPG_PC_LINK_SPEED_100MBPS: @@ -530,283 +531,50 @@ static int ipg_config_autoneg(struct net break; default: printk(undefined!\n); - } - - fiber = ipg_sti_fiber_detect(dev); - - /* Determine if auto-negotiation resolution is necessary. -* First check for fiber based media 10/100 media. -*/ - if ((fiber == 1) - (asicctrl (IPG_AC_PHY_SPEED10 | IPG_AC_PHY_SPEED100))) { - printk(KERN_INFO - %s: Fiber based PHY, setting full duplex, no flow control.\n, - dev-name); - - mac_ctl = ioread32(ioaddr + MAC_CTRL); - mac_ctl |= IPG_MC_DUPLEX_SELECT_FD; - mac_ctl = ~IPG_MC_TX_FLOW_CONTROL_ENABLE; - mac_ctl = ~IPG_MC_RX_FLOW_CONTROL_ENABLE; - - iowrite32(IPG_MC_RSVD_MASK mac_ctl, ioaddr + MAC_CTRL); - return 0; } - /* Determine if PHY is auto-negotiation capable. */ - phyaddr = ipg_find_phyaddr(dev); - - if (phyaddr == -1) { - printk(KERN_INFO - %s: Error on read to GMII/MII Status register.\n, - dev-name); - return -EILSEQ; - } - sp-mii_if.phy_id = phyaddr; - - IPG_DEBUG_MSG(GMII/MII PHY address = %x\n, phyaddr); - - status = mdio_read(dev, phyaddr, MII_BMSR); - - printk(PHYStatus = %x \n, status); - if ((status BMSR_ANEGCAPABLE) == 0) { - printk(KERN_INFO - %s: Error PHY unable to perform auto-negotiation.\n
Re: [PATCH 5/7] ip1000: Modify coding style of ipg_config_autoneg()
Hi : Ok, I will remove the Mixed case variables. Thanks. Jesse - Original Message - From: Francois Romieu [EMAIL PROTECTED] To: Jesse Huang [EMAIL PROTECTED] Cc: [EMAIL PROTECTED]; [EMAIL PROTECTED]; [EMAIL PROTECTED]; linux-kernel@vger.kernel.org; netdev@vger.kernel.org; [EMAIL PROTECTED] Sent: Saturday, August 19, 2006 6:17 PM Subject: Re: [PATCH 5/7] ip1000: Modify coding style of ipg_config_autoneg() Jesse Huang [EMAIL PROTECTED] : From: Jesse Huang [EMAIL PROTECTED] This is only coding style modify for ipg_config_autoneg(). Thanks for the suggestion form Francois. Change Logs: Modify coding style of ipg_config_autoneg() --- drivers/net/ipg.c | 17 ++--- 1 files changed, 10 insertions(+), 7 deletions(-) 737498ca620437d8179e21be4d5220333066cbbd diff --git a/drivers/net/ipg.c b/drivers/net/ipg.c index f859107..be96f93 100644 --- a/drivers/net/ipg.c +++ b/drivers/net/ipg.c @@ -491,11 +491,13 @@ static int ipg_config_autoneg(struct net int fullduplex; int txflowcontrol; int rxflowcontrol; + long MacCtrlValue; Mixed case variables are not exactly welcome. -- Ueimor - 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
Re: [PATCH 1/6] IP100A, add end of pci id table
Hi Jeff: Ok, I see. I will resend all of the patches after I finish modify. Thanks. Jesse - Original Message - From: Jeff Garzik [EMAIL PROTECTED] To: Jesse Huang [EMAIL PROTECTED] Cc: linux-kernel@vger.kernel.org; netdev@vger.kernel.org; [EMAIL PROTECTED] Sent: Friday, August 18, 2006 7:09 PM Subject: Re: [PATCH 1/6] IP100A, add end of pci id table Jesse Huang wrote: Hi Jeff: Sorry for that. I will remove those. Am I need to resent all of those patch or send all in one patch? Normally, when I merged a patch, you will receive a one-word reply applied or merged. Or for a series of patches, applies patches 1-6. For this series of patches, you will need to resend the entire patchset, modified with the comments so far. It is quite normal for some patchsets to undergo several iterations before being merged, when engineering review highlights issues. Thanks and regards, Jeff - 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
Re: [PATCH 5/6] IP100A correct init and close step
Hi Jeff: (3)Yes, This is a bug, I will correct it. Thanks. (4)This will halt TxDMA and RxDMA, after that will let reseting safely. Should I add description in source code or in change log? Thanks! Jesse - Original Message - From: Jeff Garzik [EMAIL PROTECTED] To: Jesse Huang [EMAIL PROTECTED] Cc: linux-kernel@vger.kernel.org; netdev@vger.kernel.org; [EMAIL PROTECTED] Sent: Friday, August 18, 2006 7:12 PM Subject: Re: [PATCH 5/6] IP100A correct init and close step Jesse Huang wrote: Hi Jeff: (1)Should I change to : spin_lock_irqsave(np-lock,flags); reset_tx(dev); spin_lock_irqrestore(np-lock,flags); (2)I will remove date and author information out of source code comment. Correct. Also: (3) Use iowrite16(), not writew(). I just noticed this bug. iowrite16() will work for both MMIO and IO cycles, writew() only works for MMIO. (4) We need a description of why this change is needed. What does writing 0x500 to DMACtrl actually do? Why do we need to do this? Jeff - 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
Re: [PATCH 6/6] IP100A Solve host error problem when in low performance embedded
Hi Jeff: I will follow those suggestions. Thanks. Jesse - Original Message - From: Jeff Garzik [EMAIL PROTECTED] To: Jesse Huang [EMAIL PROTECTED] Cc: linux-kernel@vger.kernel.org; netdev@vger.kernel.org; [EMAIL PROTECTED] Sent: Friday, August 18, 2006 7:17 PM Subject: Re: [PATCH 6/6] IP100A Solve host error problem when in low performance embedded Jesse Huang wrote: From: Jesse Huang [EMAIL PROTECTED] Solve host error problem when in low performance embedded Change Logs: Solve host error problem when in low performance embedded --- drivers/net/sundance.c | 26 ++ 1 files changed, 22 insertions(+), 4 deletions(-) 78ff57ea887c19b7552342e990375f5e2bb10af9 diff --git a/drivers/net/sundance.c b/drivers/net/sundance.c index c7c22f0..94ba6ca 100755 --- a/drivers/net/sundance.c +++ b/drivers/net/sundance.c @@ -1075,7 +1075,7 @@ reset_tx (struct net_device *dev) struct sk_buff *skb; int i; int irq = in_interrupt(); - + tasklet_kill(np-tx_tasklet); NAK, it is a bug to call tasklet_kill() from inside an interrupt. @@ -1646,6 +1646,13 @@ static int netdev_close(struct net_devic struct sk_buff *skb; int i; + /* Wait and kill tasklet */ + tasklet_kill(np-rx_tasklet); + tasklet_kill(np-tx_tasklet); + np-cur_tx = np-dirty_tx = 0; fix source code indent + np-cur_task = 0; + np-last_tx=0; needs whitespace: s/=/ = / netif_stop_queue(dev); if (netif_msg_ifdown(np)) { @@ -1666,9 +1673,19 @@ static int netdev_close(struct net_devic /* Stop the chip's Tx and Rx processes. */ iowrite16(TxDisable | RxDisable | StatsDisable, ioaddr + MACCtrl1); - /* Wait and kill tasklet */ - tasklet_kill(np-rx_tasklet); - tasklet_kill(np-tx_tasklet); +for(i=2000;i 0;i--) { + if((readl(ioaddr + DMACtrl)0xC000) == 0)break; + mdelay(1); +} (1) fix indentation (2) add whitespace to 'for' loop (3) use ioread32(), not readl() (4) are you certain that DMACtrl should be read as a 32-bit register? In other code, you treat it as a 16-bit register. +writew(GlobalReset | DMAReset | FIFOReset |NetworkReset, ioaddr +ASICCtrl + 2); (5) use iowrite16() not writew() +for(i=2000;i 0;i--) +{ + if((readw(ioaddr + ASICCtrl +2)ResetBusy) == 0) + break; + mdelay(1); +} (6) fix indentation to match the rest of the driver (7) use ioread16(), not readw() (8) add whitespace to 'for' loop #ifdef __i386__ if (netif_msg_hw(np)) { @@ -1706,6 +1723,7 @@ #endif /* __i386__ debugging only */ } } for (i = 0; i TX_RING_SIZE; i++) { + np-tx_ring[i].next_desc=0; (9) add whitespace to assignment: s/=/ = / skb = np-tx_skbuff[i]; if (skb) { pci_unmap_single(np-pci_dev, - 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
Re: [PATCH 4/6] IP100A Change search phy addr start form 0
Hi Jeff: In IP100A, phy address is 0. Because IP100A is a single chip, the in chip phy address is 0. so, we must search phy address for 0. Jesse - Original Message - From: Jeff Garzik [EMAIL PROTECTED] To: Jesse Huang [EMAIL PROTECTED] Cc: linux-kernel@vger.kernel.org; netdev@vger.kernel.org; [EMAIL PROTECTED] Sent: Friday, August 18, 2006 7:20 PM Subject: Re: [PATCH 4/6] IP100A Change search phy addr start form 0 Jesse Huang wrote: From: Jesse Huang [EMAIL PROTECTED] Change search phy addr start form 0 Change Logs: Change search phy addr start form 0 --- drivers/net/sundance.c |5 +++-- 1 files changed, 3 insertions(+), 2 deletions(-) 212cd4ffa21a57300eae4254bf02e5b33b96f544 diff --git a/drivers/net/sundance.c b/drivers/net/sundance.c index 2bde1b3..f63871a 100755 --- a/drivers/net/sundance.c +++ b/drivers/net/sundance.c @@ -21,7 +21,7 @@ */ #define DRV_NAME sundance -#define DRV_VERSION 1.01+LK1.13 +#define DRV_VERSION 1.01+LK1.14 #define DRV_RELDATE 04-Aug-2006 @@ -559,8 +559,9 @@ #endif /* * It seems some phys doesn't deal well with address 0 being accessed * first, so leave address zero to the end of the loop (32 31). + * for IP100A the phy should start from 0 */ - for (phy = 1; phy = 32 phy_idx MII_CNT; phy++) { + for (phy = 0; phy = 32 phy_idx MII_CNT; phy++) { int phyx = phy 0x1f; int mii_status = mdio_read(dev, phyx, MII_BMSR); if (mii_status != 0xmii_status != 0x) { For IP100A, is the phy built into the chip? For a standard DP83840[A] phy, phy #0 is a ghost which mirrors another phy. For this reason, we scan phy #0 last. Does the above code not work? Jeff - 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
Re: [PATCH 5/6] IP100A correct init and close step
Hi Jeff: (1)Should I change to : spin_lock_irqsave(np-lock,flags); reset_tx(dev); spin_lock_irqrestore(np-lock,flags); (2)I will remove date and author information out of source code comment. - Original Message - From: Jeff Garzik [EMAIL PROTECTED] To: Jesse Huang [EMAIL PROTECTED] Cc: linux-kernel@vger.kernel.org; netdev@vger.kernel.org; [EMAIL PROTECTED] Sent: Thursday, August 17, 2006 10:51 PM Subject: Re: [PATCH 5/6] IP100A correct init and close step Jesse Huang wrote: From: Jesse Huang [EMAIL PROTECTED] correct init and close step Change Logs: correct init and close step --- drivers/net/sundance.c | 10 +- 1 files changed, 9 insertions(+), 1 deletions(-) b5e343a17f5d70d1cc9a4ba20d366bab355f64a6 diff --git a/drivers/net/sundance.c b/drivers/net/sundance.c index f63871a..c7c22f0 100755 --- a/drivers/net/sundance.c +++ b/drivers/net/sundance.c @@ -830,6 +830,11 @@ #endif iowrite8(0x01, ioaddr + DebugCtrl1); netif_start_queue(dev); + // 04/19/2005 Jesse fix for complete initial step + spin_lock(np-lock); + reset_tx(dev); + spin_unlock(np-lock); + NAK -- ineffective locking. If you need locking here, you must use spin_lock_irqsave() @@ -1654,7 +1659,10 @@ static int netdev_close(struct net_devic /* Disable interrupts by clearing the interrupt mask. */ iowrite16(0x, ioaddr + IntrEnable); - + + // 04/19/2005 Jesse fix for complete initial step + writew(0x500, ioaddr + DMACtrl); NAK: 1) date and author information is already present in the kernel changelog. It should not be present in the source code. 2) The comment (or patch description) fails to describe -why- this change is needed. It only described what is being changes, which is already obvious from reading the source code. - 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
Re: [PATCH 1/6] IP100A, add end of pci id table
Hi Alexey: I will remove that. Thanks for that. Jesse Huang - Original Message - From: Alexey Dobriyan [EMAIL PROTECTED] To: Jesse Huang [EMAIL PROTECTED] Cc: linux-kernel@vger.kernel.org; netdev@vger.kernel.org; [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Thursday, August 17, 2006 11:19 PM Subject: Re: [PATCH 1/6] IP100A, add end of pci id table On Thu, Aug 17, 2006 at 03:00:47PM -0400, Jesse Huang wrote: Add 0, and NULL, to sundance_pci_tbl and pci_id_table. @@ -212,7 +212,7 @@ static const struct pci_device_id sundan { 0x1186, 0x1002, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 4 }, { 0x13F0, 0x0201, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 5 }, { 0x13F0, 0x0200, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 6 }, - { } + { 0,} }; MODULE_DEVICE_TABLE(pci, sundance_pci_tbl); @@ -231,7 +231,7 @@ static const struct pci_id_info pci_id_t {D-Link DL10050-based FAST Ethernet Adapter}, {Sundance Technology Alta}, {IC Plus Corporation IP100A FAST Ethernet Adapter}, - { } /* terminate list. */ + { NULL,} /* terminate list. */ They are already properly terminated. You don't have to do anything. - 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
Re: [PATCH 2/7] ip1000: remove some default phy params
Hi David: Ok, I will add sign-off-by latter. Thanks for that. Jesse Huang - Original Message - From: David Gomez [EMAIL PROTECTED] To: Jesse Huang [EMAIL PROTECTED] Cc: [EMAIL PROTECTED]; [EMAIL PROTECTED]; [EMAIL PROTECTED]; [EMAIL PROTECTED]; linux-kernel@vger.kernel.org; netdev@vger.kernel.org Sent: Thursday, August 17, 2006 7:09 PM Subject: Re: [PATCH 2/7] ip1000: remove some default phy params Hi Jesse, On Aug 17 at 03:43:29, Jesse Huang wrote: From: Jesse Huang [EMAIL PROTECTED] remove some default phy params Change Logs: remove some default phy params First, thanks for finalling commiting this driver ;). But please resend the patches with Signed-off-by: line. I'm not much of a git hacker, but i think you can use 'git-applymbox' to put a signedoff line in your mbox-formatted patches. regards, -- David Gomez Jabber ID: [EMAIL PROTECTED] - 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 1/6] IP100A, add end of pci id table
From: Jesse Huang [EMAIL PROTECTED] Add 0, and NULL, to sundance_pci_tbl and pci_id_table. Change Logs: Add 0, and NULL, to sundance_pci_tbl and pci_id_table. --- drivers/net/sundance.c |8 1 files changed, 4 insertions(+), 4 deletions(-) 9ef94f8b85a0070e49bb1883a9f124be1711761d diff --git a/drivers/net/sundance.c b/drivers/net/sundance.c index ac17377..eb81d91 100755 --- a/drivers/net/sundance.c +++ b/drivers/net/sundance.c @@ -21,8 +21,8 @@ */ #define DRV_NAME sundance -#define DRV_VERSION1.1 -#define DRV_RELDATE27-Jun-2006 +#define DRV_VERSION1.2 +#define DRV_RELDATE03-Aug-2006 /* The user-configurable values. @@ -212,7 +212,7 @@ static const struct pci_device_id sundan { 0x1186, 0x1002, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 4 }, { 0x13F0, 0x0201, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 5 }, { 0x13F0, 0x0200, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 6 }, - { } + { 0,} }; MODULE_DEVICE_TABLE(pci, sundance_pci_tbl); @@ -231,7 +231,7 @@ static const struct pci_id_info pci_id_t {D-Link DL10050-based FAST Ethernet Adapter}, {Sundance Technology Alta}, {IC Plus Corporation IP100A FAST Ethernet Adapter}, - { } /* terminate list. */ + { NULL,}/* terminate list. */ }; /* This driver was written to use PCI memory space, however x86-oriented -- 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 2/6] IP100A Fix Tx pause bug
From: Jesse Huang [EMAIL PROTECTED] Fix Tx pause bug Change Logs: Fix Tx pause bug --- drivers/net/sundance.c | 49 +++- 1 files changed, 28 insertions(+), 21 deletions(-) 7e6bffe518096d89a9e7ee9b80f246b3ff442f2e diff --git a/drivers/net/sundance.c b/drivers/net/sundance.c index eb81d91..910ea17 100755 --- a/drivers/net/sundance.c +++ b/drivers/net/sundance.c @@ -262,8 +262,6 @@ enum alta_offsets { ASICCtrl = 0x30, EEData = 0x34, EECtrl = 0x36, - TxStartThresh = 0x3c, - RxEarlyThresh = 0x3e, FlashAddr = 0x40, FlashData = 0x44, TxStatus = 0x46, @@ -1084,6 +1082,8 @@ reset_tx (struct net_device *dev) } /* free all tx skbuff */ for (i = 0; i TX_RING_SIZE; i++) { + np-tx_ring[i].next_desc = 0; + skb = np-tx_skbuff[i]; if (skb) { pci_unmap_single(np-pci_dev, @@ -1099,6 +1099,10 @@ reset_tx (struct net_device *dev) } np-cur_tx = np-dirty_tx = 0; np-cur_task = 0; + + np-last_tx=0; + iowrite8(127, ioaddr + TxDMAPollPeriod); + iowrite16 (StatsEnable | RxEnable | TxEnable, ioaddr + MACCtrl1); return 0; } @@ -1156,29 +1160,29 @@ static irqreturn_t intr_handler(int irq, np-stats.tx_fifo_errors++; if (tx_status 0x02) np-stats.tx_window_errors++; - /* - ** This reset has been verified on - ** DFE-580TX boards ! [EMAIL PROTECTED] - */ - if (tx_status 0x10) { /* TxUnderrun */ - unsigned short txthreshold; - - txthreshold = ioread16 (ioaddr + TxStartThresh); - /* Restart Tx FIFO and transmitter */ - sundance_reset(dev, (NetworkReset|FIFOReset|TxReset) 16); - iowrite16 (txthreshold, ioaddr + TxStartThresh); - /* No need to reset the Tx pointer here */ + + /* FIFO ERROR need to be reset tx */ + if (tx_status 0x10) { /* Reset the Tx. */ + spin_lock(np-lock); + reset_tx(dev); + spin_unlock(np-lock); + } + if (tx_status 0x1e) { + /* need to make sure tx enabled */ + int i = 10; + do { + iowrite16 (ioread16(ioaddr + MACCtrl1) | TxEnable, ioaddr + MACCtrl1); + if (ioread16(ioaddr + MACCtrl1) TxEnabled) + break; + mdelay(1); + } while (--i); } - /* Restart the Tx. */ - iowrite16 (TxEnable, ioaddr + MACCtrl1); } - /* Yup, this is a documentation bug. It cost me *hours*. */ + iowrite16 (0, ioaddr + TxStatus); - if (tx_cnt 0) { - iowrite32(5000, ioaddr + DownCounter); - break; - } tx_status = ioread16 (ioaddr + TxStatus); + if (tx_cnt 0) + break; } hw_frame_id = (tx_status 8) 0xff; } else { @@ -1244,6 +1248,9 @@ static irqreturn_t intr_handler(int irq, if (netif_msg_intr(np)) printk(KERN_DEBUG %s: exiting interrupt, status=%#4.4x.\n, dev-name, ioread16(ioaddr + IntrStatus)); + + iowrite32(5000, ioaddr + DownCounter); + return IRQ_RETVAL(handled); } -- 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
[PATCH 3/6] IP100A Remove CONFIG_SUNDANCE_MMIO, mask of mapping address
From: Jesse Huang [EMAIL PROTECTED] Remove CONFIG_SUNDANCE_MMIO, mask of mapping address Change Logs: Remove CONFIG_SUNDANCE_MMIO, mask of mapping address --- drivers/net/sundance.c | 13 ++--- 1 files changed, 6 insertions(+), 7 deletions(-) dc932975858ae18801620d04212c516ced6920bd diff --git a/drivers/net/sundance.c b/drivers/net/sundance.c index 910ea17..2bde1b3 100755 --- a/drivers/net/sundance.c +++ b/drivers/net/sundance.c @@ -21,8 +21,8 @@ */ #define DRV_NAME sundance -#define DRV_VERSION1.2 -#define DRV_RELDATE03-Aug-2006 +#define DRV_VERSION1.01+LK1.13 +#define DRV_RELDATE04-Aug-2006 /* The user-configurable values. @@ -199,10 +199,6 @@ IVc. Errata */ -/* Work-around for Kendin chip bugs. */ -#ifndef CONFIG_SUNDANCE_MMIO -#define USE_IO_OPS 1 -#endif static const struct pci_device_id sundance_pci_tbl[] = { { 0x1186, 0x1002, 0x1186, 0x1002, 0, 0, 0 }, @@ -491,10 +487,13 @@ #endif if (pci_request_regions(pdev, DRV_NAME)) goto err_out_netdev; - ioaddr = pci_iomap(pdev, bar, netdev_io_size); + ioaddr =(void __iomem *) +((unsigned long)pci_iomap(pdev, bar, netdev_io_size) + 0xff80); if (!ioaddr) goto err_out_res; + for (i = 0; i 3; i++) ((u16 *)dev-dev_addr)[i] = le16_to_cpu(eeprom_read(ioaddr, i + EEPROM_SA_OFFSET)); -- 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 4/6] IP100A Change search phy addr start form 0
From: Jesse Huang [EMAIL PROTECTED] Change search phy addr start form 0 Change Logs: Change search phy addr start form 0 --- drivers/net/sundance.c |5 +++-- 1 files changed, 3 insertions(+), 2 deletions(-) 212cd4ffa21a57300eae4254bf02e5b33b96f544 diff --git a/drivers/net/sundance.c b/drivers/net/sundance.c index 2bde1b3..f63871a 100755 --- a/drivers/net/sundance.c +++ b/drivers/net/sundance.c @@ -21,7 +21,7 @@ */ #define DRV_NAME sundance -#define DRV_VERSION1.01+LK1.13 +#define DRV_VERSION1.01+LK1.14 #define DRV_RELDATE04-Aug-2006 @@ -559,8 +559,9 @@ #endif /* * It seems some phys doesn't deal well with address 0 being accessed * first, so leave address zero to the end of the loop (32 31). +* for IP100A the phy should start from 0 */ - for (phy = 1; phy = 32 phy_idx MII_CNT; phy++) { + for (phy = 0; phy = 32 phy_idx MII_CNT; phy++) { int phyx = phy 0x1f; int mii_status = mdio_read(dev, phyx, MII_BMSR); if (mii_status != 0xmii_status != 0x) { -- 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 5/6] IP100A correct init and close step
From: Jesse Huang [EMAIL PROTECTED] correct init and close step Change Logs: correct init and close step --- drivers/net/sundance.c | 10 +- 1 files changed, 9 insertions(+), 1 deletions(-) b5e343a17f5d70d1cc9a4ba20d366bab355f64a6 diff --git a/drivers/net/sundance.c b/drivers/net/sundance.c index f63871a..c7c22f0 100755 --- a/drivers/net/sundance.c +++ b/drivers/net/sundance.c @@ -830,6 +830,11 @@ #endif iowrite8(0x01, ioaddr + DebugCtrl1); netif_start_queue(dev); + // 04/19/2005 Jesse fix for complete initial step + spin_lock(np-lock); + reset_tx(dev); + spin_unlock(np-lock); + iowrite16 (StatsEnable | RxEnable | TxEnable, ioaddr + MACCtrl1); if (netif_msg_ifup(np)) @@ -1654,7 +1659,10 @@ static int netdev_close(struct net_devic /* Disable interrupts by clearing the interrupt mask. */ iowrite16(0x, ioaddr + IntrEnable); - + + // 04/19/2005 Jesse fix for complete initial step + writew(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 6/6] IP100A Solve host error problem when in low performance embedded
From: Jesse Huang [EMAIL PROTECTED] Solve host error problem when in low performance embedded Change Logs: Solve host error problem when in low performance embedded --- drivers/net/sundance.c | 26 ++ 1 files changed, 22 insertions(+), 4 deletions(-) 78ff57ea887c19b7552342e990375f5e2bb10af9 diff --git a/drivers/net/sundance.c b/drivers/net/sundance.c index c7c22f0..94ba6ca 100755 --- a/drivers/net/sundance.c +++ b/drivers/net/sundance.c @@ -1075,7 +1075,7 @@ reset_tx (struct net_device *dev) struct sk_buff *skb; int i; int irq = in_interrupt(); - + tasklet_kill(np-tx_tasklet); /* Reset tx logic, TxListPtr will be cleaned */ iowrite16 (TxDisable, ioaddr + MACCtrl1); iowrite16 (TxReset | DMAReset | FIFOReset | NetworkReset, @@ -1646,6 +1646,13 @@ static int netdev_close(struct net_devic struct sk_buff *skb; int i; + /* Wait and kill tasklet */ + tasklet_kill(np-rx_tasklet); + tasklet_kill(np-tx_tasklet); + np-cur_tx = np-dirty_tx = 0; + np-cur_task = 0; + np-last_tx=0; + netif_stop_queue(dev); if (netif_msg_ifdown(np)) { @@ -1666,9 +1673,19 @@ static int netdev_close(struct net_devic /* Stop the chip's Tx and Rx processes. */ iowrite16(TxDisable | RxDisable | StatsDisable, ioaddr + MACCtrl1); - /* Wait and kill tasklet */ - tasklet_kill(np-rx_tasklet); - tasklet_kill(np-tx_tasklet); +for(i=2000;i 0;i--) { + if((readl(ioaddr + DMACtrl)0xC000) == 0)break; + mdelay(1); +} + +writew(GlobalReset | DMAReset | FIFOReset |NetworkReset, ioaddr +ASICCtrl + 2); + +for(i=2000;i 0;i--) +{ + if((readw(ioaddr + ASICCtrl +2)ResetBusy) == 0) + break; + mdelay(1); +} #ifdef __i386__ if (netif_msg_hw(np)) { @@ -1706,6 +1723,7 @@ #endif /* __i386__ debugging only */ } } for (i = 0; i TX_RING_SIZE; i++) { + np-tx_ring[i].next_desc=0; skb = np-tx_skbuff[i]; if (skb) { pci_unmap_single(np-pci_dev, -- 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 1/7] ip1000: update maintainer information
From: Jesse Huang [EMAIL PROTECTED] update maintainer information Change Logs: update maintainer information --- drivers/net/ipg.c | 32 1 files changed, 20 insertions(+), 12 deletions(-) 11745492c8580b2e40764e7fcd6a7a35f28c7635 diff --git a/drivers/net/ipg.c b/drivers/net/ipg.c index 754ddb5..67bf552 100644 --- a/drivers/net/ipg.c +++ b/drivers/net/ipg.c @@ -1,18 +1,26 @@ -/*PCI_DEVICE_ID_IP1000 +/* + * ipg.c: Device Driver for the IP1000 Gigabit Ethernet Adapter + * + * Copyright (C) 2003, 2006 IC Plus Corp. + * + * Original Author: * - * ipg.c + * Craig Rich + * Sundance Technology, Inc. + * 1485 Saratoga Avenue + * Suite 200 + * San Jose, CA 95129 + * 408 873 4117 + * www.sundanceti.com + * [EMAIL PROTECTED] * - * IC Plus IP1000 Gigabit Ethernet Adapter Linux Driver v2.01 - * by IC Plus Corp. 2003 + * Current Maintainer: * - * Craig Rich - * Sundance Technology, Inc. - * 1485 Saratoga Avenue - * Suite 200 - * San Jose, CA 95129 - * 408 873 4117 - * www.sundanceti.com - * [EMAIL PROTECTED] + * Sorbica Shieh. + * 10F, No.47, Lane 2, Kwang-Fu RD. + * Sec. 2, Hsin-Chu, Taiwan, R.O.C. + * http://www.icplus.com.tw + * [EMAIL PROTECTED] */ #include linux/crc32.h #include linux/ethtool.h -- 1.3.2 - 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 6/7] ip1000: Add IPG_AC_FIFO flag when Tx reset
From: Jesse Huang [EMAIL PROTECTED] This is a bug when Tx underrun happen, Tx reset without IPG_AC_FIFO will cause Tx hold and can't transmit packet again. Change Logs: 1. Tx reset when Tx Under run will cause Tx fail 2. ipg_nic_txcleanup() add IPG_AC_FIFO when Tx reset --- drivers/net/ipg.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) 7e88cf9432ea466a76f7b26d11a280300c8735f2 diff --git a/drivers/net/ipg.c b/drivers/net/ipg.c index 56ffc80..ae22fa8 100644 --- a/drivers/net/ipg.c +++ b/drivers/net/ipg.c @@ -1036,7 +1036,7 @@ static void ipg_nic_txcleanup(struct net IPG_DEBUG_MSG(Transmitter underrun.\n); sp-stats.tx_fifo_errors++; ipg_reset(dev, IPG_AC_TX_RESET | - IPG_AC_DMA | IPG_AC_NETWORK); + IPG_AC_DMA | IPG_AC_NETWORK| IPG_AC_FIFO); /* Re-configure after DMA reset. */ if ((ipg_io_config(dev) 0) || -- 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 2/7] ip1000: remove some default phy params
From: Jesse Huang [EMAIL PROTECTED] remove some default phy params Change Logs: remove some default phy params --- drivers/net/ipg.h | 54 + 1 files changed, 1 insertions(+), 53 deletions(-) af38044af640ea6997ad6ced277e5f42f8307d8d diff --git a/drivers/net/ipg.h b/drivers/net/ipg.h index 58b1417..9f841d2 100644 --- a/drivers/net/ipg.h +++ b/drivers/net/ipg.h @@ -919,59 +919,7 @@ unsigned short DefaultPhyParam[] = { // 01/09/04 IP1000A v1-5 rev=0x41 (0x4100 | (07 * 4)), 31, 0x0001, 27, 0x01e0, 31, 0x0002, 27, 0xeb8e, 31, 0x, - 30, 0x005e, 9, 0x0700, - // 01/09/04 IP1000A v1-5 rev=0x42 - (0x4200 | (07 * 4)), 31, 0x0001, 27, 0x01e0, 31, 0x0002, 27, 0xeb8e, 31, - 0x, - 30, 0x005e, 9, 0x0700, - // 01/09/04 IP1000A v1-5 rev=0x43 - (0x4300 | (07 * 4)), 31, 0x0001, 27, 0x01e0, 31, 0x0002, 27, 0xeb8e, 31, - 0x, - 30, 0x005e, 9, 0x0700, - // 01/09/04 IP1000A v1-5 rev=0x44 - (0x4400 | (07 * 4)), 31, 0x0001, 27, 0x01e0, 31, 0x0002, 27, 0xeb8e, 31, - 0x, - 30, 0x005e, 9, 0x0700, - // 01/09/04 IP1000A v1-5 rev=0x45 - (0x4500 | (07 * 4)), 31, 0x0001, 27, 0x01e0, 31, 0x0002, 27, 0xeb8e, 31, - 0x, - 30, 0x005e, 9, 0x0700, - // 01/09/04 IP1000A v1-5 rev=0x46 - (0x4600 | (07 * 4)), 31, 0x0001, 27, 0x01e0, 31, 0x0002, 27, 0xeb8e, 31, - 0x, - 30, 0x005e, 9, 0x0700, - // 01/09/04 IP1000A v1-5 rev=0x47 - (0x4700 | (07 * 4)), 31, 0x0001, 27, 0x01e0, 31, 0x0002, 27, 0xeb8e, 31, - 0x, - 30, 0x005e, 9, 0x0700, - // 01/09/04 IP1000A v1-5 rev=0x48 - (0x4800 | (07 * 4)), 31, 0x0001, 27, 0x01e0, 31, 0x0002, 27, 0xeb8e, 31, - 0x, - 30, 0x005e, 9, 0x0700, - // 01/09/04 IP1000A v1-5 rev=0x49 - (0x4900 | (07 * 4)), 31, 0x0001, 27, 0x01e0, 31, 0x0002, 27, 0xeb8e, 31, - 0x, - 30, 0x005e, 9, 0x0700, - // 01/09/04 IP1000A v1-5 rev=0x4A - (0x4A00 | (07 * 4)), 31, 0x0001, 27, 0x01e0, 31, 0x0002, 27, 0xeb8e, 31, - 0x, - 30, 0x005e, 9, 0x0700, - // 01/09/04 IP1000A v1-5 rev=0x4B - (0x4B00 | (07 * 4)), 31, 0x0001, 27, 0x01e0, 31, 0x0002, 27, 0xeb8e, 31, - 0x, - 30, 0x005e, 9, 0x0700, - // 01/09/04 IP1000A v1-5 rev=0x4C - (0x4C00 | (07 * 4)), 31, 0x0001, 27, 0x01e0, 31, 0x0002, 27, 0xeb8e, 31, - 0x, - 30, 0x005e, 9, 0x0700, - // 01/09/04 IP1000A v1-5 rev=0x4D - (0x4D00 | (07 * 4)), 31, 0x0001, 27, 0x01e0, 31, 0x0002, 27, 0xeb8e, 31, - 0x, - 30, 0x005e, 9, 0x0700, - // 01/09/04 IP1000A v1-5 rev=0x4E - (0x4E00 | (07 * 4)), 31, 0x0001, 27, 0x01e0, 31, 0x0002, 27, 0xeb8e, 31, - 0x, - 30, 0x005e, 9, 0x0700, + 30, 0x005e, 9, 0x0700, 0x }; -- 1.3.2 - 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 4/7] ip1000: ipg_config_autoneg rewrite
From: Jesse Huang [EMAIL PROTECTED] ipg_config_autoneg rewrite Change Logs: ipg_config_autoneg rewrite --- drivers/net/ipg.c | 307 ++--- 1 files changed, 32 insertions(+), 275 deletions(-) c3f6df15430f9c05e19f36b8485b31110d52a091 diff --git a/drivers/net/ipg.c b/drivers/net/ipg.c index a996c45..f859107 100644 --- a/drivers/net/ipg.c +++ b/drivers/net/ipg.c @@ -484,26 +484,18 @@ static int ipg_config_autoneg(struct net { struct ipg_nic_private *sp = netdev_priv(dev); void __iomem *ioaddr = sp-ioaddr; + u8 phyctrl; u32 asicctrl; - u32 mac_ctl; - int phyaddr = 0; - u16 status = 0; - u16 advertisement; - u16 linkpartner_ability; - u16 gigadvertisement; - u16 giglinkpartner_ability; - u16 techabilities; int fiber; int gig; int fullduplex; int txflowcontrol; int rxflowcontrol; - u8 phyctrl; IPG_DEBUG_MSG(_config_autoneg\n); asicctrl = ioread32(ioaddr + ASIC_CTRL); - phyctrl = ioread8(ioaddr + PHY_CTRL); + phyctrl = ioread32(ioaddr + PHY_CTRL); /* Set flags for use in resolving auto-negotation, assuming * non-1000Mbps, half duplex, no flow control. @@ -519,14 +511,13 @@ static int ipg_config_autoneg(struct net */ sp-tenmbpsmode = 0; - printk(Link speed = ); + printk(KERN_INFO Link speed = ); /* Determine actual speed of operation. */ switch (phyctrl IPG_PC_LINK_SPEED) { case IPG_PC_LINK_SPEED_10MBPS: printk(10Mbps.\n); - printk(KERN_INFO %s: 10Mbps operational mode enabled.\n, - dev-name); + printk(%s: 10Mbps operational mode enabled.\n,dev-name); sp-tenmbpsmode = 1; break; case IPG_PC_LINK_SPEED_100MBPS: @@ -538,283 +529,49 @@ static int ipg_config_autoneg(struct net break; default: printk(undefined!\n); - } - - fiber = ipg_sti_fiber_detect(dev); - - /* Determine if auto-negotiation resolution is necessary. -* First check for fiber based media 10/100 media. -*/ - if ((fiber == 1) - (asicctrl (IPG_AC_PHY_SPEED10 | IPG_AC_PHY_SPEED100))) { - printk(KERN_INFO - %s: Fiber based PHY, setting full duplex, no flow control.\n, - dev-name); - - mac_ctl = ioread32(ioaddr + MAC_CTRL); - mac_ctl |= IPG_MC_DUPLEX_SELECT_FD; - mac_ctl = ~IPG_MC_TX_FLOW_CONTROL_ENABLE; - mac_ctl = ~IPG_MC_RX_FLOW_CONTROL_ENABLE; - - iowrite32(IPG_MC_RSVD_MASK mac_ctl, ioaddr + MAC_CTRL); - return 0; } - /* Determine if PHY is auto-negotiation capable. */ - phyaddr = ipg_find_phyaddr(dev); - - if (phyaddr == -1) { - printk(KERN_INFO - %s: Error on read to GMII/MII Status register.\n, - dev-name); - return -EILSEQ; - } - sp-mii_if.phy_id = phyaddr; - - IPG_DEBUG_MSG(GMII/MII PHY address = %x\n, phyaddr); - - status = mdio_read(dev, phyaddr, MII_BMSR); - - printk(PHYStatus = %x \n, status); - if ((status BMSR_ANEGCAPABLE) == 0) { - printk(KERN_INFO - %s: Error PHY unable to perform auto-negotiation.\n, - dev-name); - return -EILSEQ; - } - - advertisement = mdio_read(dev, phyaddr, MII_ADVERTISE); - linkpartner_ability = mdio_read(dev, phyaddr, MII_LPA); - - printk(PHYadvertisement=%x LinkPartner=%x \n, advertisement, - linkpartner_ability); - if ((advertisement == 0x) || (linkpartner_ability == 0x)) { - printk(KERN_INFO - %s: Error on read to GMII/MII registers 4 and/or 5.\n, - dev-name); - return -EILSEQ; + if (phyctrl IPG_PC_DUPLEX_STATUS) { + fullduplex = 1; + txflowcontrol = 1; + rxflowcontrol = 1; + } else { + fullduplex = 0; + txflowcontrol = 0; + rxflowcontrol = 0; } - fiber = ipg_tmi_fiber_detect(dev, phyaddr); - - /* Resolve full/half duplex if 1000BASE-X. */ - if ((gig == 1) (fiber == 1)) { - int bmcr; - /* -* Compare the full duplex bits in the GMII registers -* for the local device, and the link partner. If these -* bits are logic 1 in both registers, configure the -* IPG for full duplex operation. -*/ - bmcr = mdio_read(dev, phyaddr, MII_BMCR); + /* Configure full duplex, and flow control. */ + if (fullduplex == 1
[PATCH 3/7] ip1000: remove threshold config from ipg_io_config
From: Jesse Huang [EMAIL PROTECTED] remove threshold config from ipg_io_config Change Logs: remove threshold config from ipg_io_config --- drivers/net/ipg.c | 10 +- drivers/net/ipg.h | 38 -- 2 files changed, 1 insertions(+), 47 deletions(-) 28a5c5965399fa91d31420cf41b9e7c483f2f672 diff --git a/drivers/net/ipg.c b/drivers/net/ipg.c index 67bf552..a996c45 100644 --- a/drivers/net/ipg.c +++ b/drivers/net/ipg.c @@ -943,15 +943,7 @@ static int ipg_io_config(struct net_devi ipg_nic_set_multicast_list(dev); iowrite16(IPG_MAX_RXFRAME_SIZE, ioaddr + MAX_FRAME_SIZE); - iowrite16(IPG_RE_RSVD_MASK (IPG_RXEARLYTHRESH_VALUE), - ioaddr + RX_EARLY_THRESH); - iowrite32(IPG_TT_RSVD_MASK (IPG_TXSTARTTHRESH_VALUE), - ioaddr + TX_START_THRESH); - iowrite32((IPG_RI_RSVD_MASK - ((IPG_RI_RXFRAME_COUNT IPG_RXFRAME_COUNT) | - (IPG_RI_PRIORITY_THRESH (IPG_PRIORITY_THRESH 12)) | - (IPG_RI_RXDMAWAIT_TIME (IPG_RXDMAWAIT_TIME 16, - ioaddr + RX_DMA_INT_CTRL); + iowrite8(IPG_RP_RSVD_MASK (IPG_RXDMAPOLLPERIOD_VALUE), ioaddr + RX_DMA_POLL_PERIOD); iowrite8(IPG_RU_RSVD_MASK (IPG_RXDMAURGENTTHRESH_VALUE), diff --git a/drivers/net/ipg.h b/drivers/net/ipg.h index 9f841d2..818a677 100644 --- a/drivers/net/ipg.h +++ b/drivers/net/ipg.h @@ -80,14 +80,11 @@ enum ipg_regs { RX_DMA_BURST_THRESH = 0x24, RX_DMA_URGENT_THRESH= 0x25, RX_DMA_POLL_PERIOD = 0x26, - RX_DMA_INT_CTRL = 0x28, DEBUG_CTRL = 0x2c, ASIC_CTRL = 0x30, FIFO_CTRL = 0x38, // Unused - RX_EARLY_THRESH = 0x3a, FLOW_OFF_THRESH = 0x3c, FLOW_ON_THRESH = 0x3e, - TX_START_THRESH = 0x44, EEPROM_DATA = 0x48, EEPROM_CTRL = 0x4a, EXPROM_ADDR = 0x4c, // Unused @@ -324,12 +321,6 @@ #define IPG_RU_RSVD_MASK /* RxDMAPollPeriod */ #define IPG_RP_RSVD_MASK0xFF -/* TxStartThresh */ -#define IPG_TT_RSVD_MASK0x0FFF - -/* RxEarlyThresh */ -#define IPG_RE_RSVD_MASK0x07FF - /* ReceiveMode */ #define IPG_RM_RSVD_MASK0x3F #define IPG_RM_RECEIVEUNICAST 0x01 @@ -496,12 +487,6 @@ #define IPG_MC_RX_DISABLE #define IPG_MC_RX_ENABLED 0x2000 #define IPG_MC_PAUSED 0x4000 -/* RxDMAIntCtrl */ -#define IPG_RI_RSVD_MASK0x1CFF -#define IPG_RI_RXFRAME_COUNT0x00FF -#define IPG_RI_PRIORITY_THRESH 0x1C00 -#define IPG_RI_RXDMAWAIT_TIME 0x - /* * Tune */ @@ -662,32 +647,11 @@ #define IPG_MAXRFDPROCESS_COUNT 0x80 */ #defineIPG_MINUSEDRFDSTOFREE 0x80 -/* Specify priority threshhold for a RxDMAPriority interrupt. */ -#defineIPG_PRIORITY_THRESH 0x07 - -/* Specify the number of receive frames transferred via DMA - * before a RX interrupt is issued. - */ -#defineIPG_RXFRAME_COUNT 0x08 - /* specify the jumbo frame maximum size * per unit is 0x600 (the RxBuffer size that one RFD can carry) */ #define MAX_JUMBOSIZE 0x8 // max is 12K -/* Specify the maximum amount of time (in 64ns increments) to wait - * before issuing a RX interrupt if number of frames received - * is less than IPG_RXFRAME_COUNT. - * - * Value Time - * --- - * 0x3D09 ~1ms - * 0x061A ~100us - * 0x009C ~10us - * 0x000F ~1us - */ -#defineIPG_RXDMAWAIT_TIME 0x009C - /* Key register values loaded at driver start up. */ /* TXDMAPollPeriod is specified in 320ns increments. @@ -700,7 +664,6 @@ #define IPG_RXDMAWAIT_TIME 0x009C * 0xFF~82us */ #defineIPG_TXDMAPOLLPERIOD_VALUE 0x26 -#defineIPG_TXSTARTTHRESH_VALUE 0x0FFF /* TxDMAUrgentThresh specifies the minimum amount of * data in the transmit FIFO before asserting an @@ -737,7 +700,6 @@ #define IPG_TXDMABURSTTHRESH_VALUE 0x30 * 0xFF~82us */ #defineIPG_RXDMAPOLLPERIOD_VALUE 0x01 -#defineIPG_RXEARLYTHRESH_VALUE 0x07FF /* RxDMAUrgentThresh specifies the minimum amount of * free space within the receive FIFO before asserting -- 1.3.2 - 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 5/7] ip1000: Modify coding style of ipg_config_autoneg()
From: Jesse Huang [EMAIL PROTECTED] This is only coding style modify for ipg_config_autoneg(). Thanks for the suggestion form Francois. Change Logs: Modify coding style of ipg_config_autoneg() --- drivers/net/ipg.c | 17 ++--- 1 files changed, 10 insertions(+), 7 deletions(-) 737498ca620437d8179e21be4d5220333066cbbd diff --git a/drivers/net/ipg.c b/drivers/net/ipg.c index f859107..be96f93 100644 --- a/drivers/net/ipg.c +++ b/drivers/net/ipg.c @@ -491,11 +491,13 @@ static int ipg_config_autoneg(struct net int fullduplex; int txflowcontrol; int rxflowcontrol; + long MacCtrlValue; IPG_DEBUG_MSG(_config_autoneg\n); asicctrl = ioread32(ioaddr + ASIC_CTRL); - phyctrl = ioread32(ioaddr + PHY_CTRL); + phyctrl = ioread8(ioaddr + PHY_CTRL); + MacCtrlValue = ioread32(ioaddr + MAC_CTRL); /* Set flags for use in resolving auto-negotation, assuming * non-1000Mbps, half duplex, no flow control. @@ -547,22 +549,22 @@ static int ipg_config_autoneg(struct net /* Configure IPG for full duplex operation. */ printk(KERN_INFO setting full duplex, ); - iowrite32(ioread32(ioaddr + MAC_CTRL) | IPG_MC_DUPLEX_SELECT_FD, ioaddr + MAC_CTRL); + MacCtrlValue |= IPG_MC_DUPLEX_SELECT_FD; if (txflowcontrol == 1) { printk(TX flow control); - iowrite32(ioread32(ioaddr + MAC_CTRL) | IPG_MC_TX_FLOW_CONTROL_ENABLE, ioaddr + MAC_CTRL); + MacCtrlValue |= IPG_MC_TX_FLOW_CONTROL_ENABLE; } else { printk(no TX flow control); - iowrite32(ioread32(ioaddr + MAC_CTRL) ~IPG_MC_TX_FLOW_CONTROL_ENABLE, ioaddr + MAC_CTRL); + MacCtrlValue = ~IPG_MC_TX_FLOW_CONTROL_ENABLE; } if (rxflowcontrol == 1) { printk(, RX flow control.); - iowrite32(ioread32(ioaddr+MAC_CTRL) | IPG_MC_RX_FLOW_CONTROL_ENABLE, ioaddr + MAC_CTRL); + MacCtrlValue |= IPG_MC_RX_FLOW_CONTROL_ENABLE; } else { printk(, no RX flow control.); - iowrite32(ioread32(ioaddr+MAC_CTRL) ~IPG_MC_RX_FLOW_CONTROL_ENABLE, ioaddr + MAC_CTRL); + MacCtrlValue = MacCtrlValue ~IPG_MC_RX_FLOW_CONTROL_ENABLE; } printk(\n); @@ -570,8 +572,9 @@ static int ipg_config_autoneg(struct net /* Configure IPG for half duplex operation. */ printk(KERN_INFO setting half duplex, no TX flow control, no RX flow control.\n); - iowrite32(ioread32(ioaddr+MAC_CTRL) ~IPG_MC_DUPLEX_SELECT_FD ~IPG_MC_TX_FLOW_CONTROL_ENABLE ~IPG_MC_RX_FLOW_CONTROL_ENABLE, ioaddr + MAC_CTRL); + MacCtrlValue = ~IPG_MC_DUPLEX_SELECT_FD ~IPG_MC_TX_FLOW_CONTROL_ENABLE ~IPG_MC_RX_FLOW_CONTROL_ENABLE; } + iowrite32(MacCtrlValue , ioaddr+MAC_CTRL); return 0; } -- 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 7/7] ip1000: For compatible at PCI 66MHz issue
From: Jesse Huang [EMAIL PROTECTED] IP1000A on some motherboard when running at PCI 66MHz will cause transmit hold. I had change three functions to solve this problem. Sorry for lot of modify. Change Logs: For compatible at 66MHz issue rewrite init_tfdlist() rewrite ipg_nic_hard_start_xmit() rewrite ipg_nic_txfree() in ipg.h add: long LastTFDHoldAddr; int LastTFDHoldCnt; int ResetCurrentTFD; --- drivers/net/ipg.c | 40 +++- drivers/net/ipg.h |4 +++- 2 files changed, 34 insertions(+), 10 deletions(-) 152a32c3d36ec4ce1eee72429aa5956274bb0e6a diff --git a/drivers/net/ipg.c b/drivers/net/ipg.c index ae22fa8..8127f2c 100644 --- a/drivers/net/ipg.c +++ b/drivers/net/ipg.c @@ -886,10 +886,7 @@ static int init_tfdlist(struct net_devic IPG_DEBUG_MSG(_init_tfdlist\n); for (i = 0; i IPG_TFDLIST_LENGTH; i++) { - sp-TFDList[i].TFDNextPtr = cpu_to_le64(sp-TFDListDMAhandle + - ((sizeof(struct TFD)) * -((i + 1) % - IPG_TFDLIST_LENGTH))); + sp-TFDList[i].TFDNextPtr = 0; sp-TFDList[i].TFC = cpu_to_le64(IPG_TFC_TFDDONE); if (sp-TxBuff[i] != NULL) @@ -907,6 +904,7 @@ static int init_tfdlist(struct net_devic iowrite32((u32) (sp-TFDListDMAhandle), ioaddr + TFD_LIST_PTR_0); iowrite32(0x, ioaddr + TFD_LIST_PTR_1); + sp-ResetCurrentTFD=1; return 0; } @@ -919,6 +917,7 @@ static void ipg_nic_txfree(struct net_de struct ipg_nic_private *sp = netdev_priv(dev); int NextToFree; int maxtfdcount; + long CurrentTxTFDPtr=(ioread32(ipg_ioaddr(dev)+TFD_LIST_PTR_0)-(long)sp-TFDListDMAhandle)/(long)sizeof(struct TFD); IPG_DEBUG_MSG(_nic_txfree\n); @@ -941,8 +940,10 @@ static void ipg_nic_txfree(struct net_de * If the TFDDone bit is set, free the associated * buffer. */ - if ((le64_to_cpu(sp-TFDList[NextToFree].TFC) -IPG_TFC_TFDDONE) (NextToFree != sp-CurrentTFD)) { + if((NextToFree != sp-CurrentTFD)(NextToFree!=CurrentTxTFDPtr)) + { + //JesseAdd: setup TFDDONE for compatible issue. + sp-TFDList[NextToFree].TFC = cpu_to_le64(sp-TFDList[NextToFree].TFC|IPG_TFC_TFDDONE); /* Free the transmit buffer. */ if (sp-TxBuff[NextToFree] != NULL) { pci_unmap_single(sp-pdev, @@ -965,6 +966,15 @@ static void ipg_nic_txfree(struct net_de maxtfdcount--; } while (maxtfdcount != 0); + if(sp-LastTFDHoldCnt1000) { + sp-LastTFDHoldCnt=0; + ipg_reset(dev, IPG_AC_TX_RESET | IPG_AC_DMA | IPG_AC_NETWORK | IPG_AC_FIFO); + // Re-configure after DMA reset. + if ((ipg_io_config(dev) 0) ||(init_tfdlist(dev) 0)) { + printk(KERN_INFO%s: Error during re-configuration.\n,dev-name); + } + iowrite32(IPG_MC_RSVD_MASK (ioread32(ipg_ioaddr(dev) + MAC_CTRL) | IPG_MC_TX_ENABLE),ipg_ioaddr(dev) + MAC_CTRL); + } } /* @@ -2041,10 +2051,17 @@ static int ipg_nic_hard_start_xmit(struc * counter, modulus the length of the TFDList. */ NextTFD = (sp-CurrentTFD + 1) % IPG_TFDLIST_LENGTH; + if(sp-ResetCurrentTFD!=0) + { + sp-ResetCurrentTFD=0; + NextTFD=0; + } + /* Check for availability of next TFD. Reserve 1 for not become ring*/ + if (NextTFD == sp-LastFreedTxBuff) { + + if(sp-LastTFDHoldAddr==sp-CurrentTFD) sp-LastTFDHoldCnt++; + else {sp-LastTFDHoldAddr=sp-CurrentTFD;sp-LastTFDHoldCnt=0;} - /* Check for availability of next TFD. */ - if (!(le64_to_cpu(sp-TFDList[NextTFD].TFC) - IPG_TFC_TFDDONE) || (NextTFD == sp-LastFreedTxBuff)) { IPG_DEBUG_MSG(Next TFD not available.\n); /* Attempt to free any used TFDs. */ @@ -2058,8 +2075,11 @@ #ifdef IPG_DEBUG sp-TFDunavailCount++; #endif + iowrite32(IPG_DC_RSVD_MASK (IPG_DC_TX_DMA_POLL_NOW),ioaddr + DMA_CTRL); return -ENOMEM; } + + sp-TFDList[NextTFD].TFDNextPtr=0; sp-TxBuffDMAhandle[NextTFD].len = skb-len; sp-TxBuffDMAhandle[NextTFD].dmahandle = @@ -2151,6 +2171,8 @@ #endif * for transfer to the IPG. */ sp-TFDList[NextTFD].TFC = cpu_to_le64(~IPG_TFC_TFDDONE); + sp-TFDList[sp-CurrentTFD].TFDNextPtr=cpu_to_le64(sp-TFDListDMAhandle+ +sizeof(struct TFD)*NextTFD); /* Record frame transmit start time (jiffies = Linux
Re: [PATCH 1/7] ip1000: update maintainer information
Hi Pekka: OK, I will generate a patch from to your git. And add sign-off-by in the mail. Thanks for that. Jesse Huang - Original Message - From: Pekka Enberg [EMAIL PROTECTED] To: Jesse Huang [EMAIL PROTECTED] Cc: [EMAIL PROTECTED]; [EMAIL PROTECTED]; [EMAIL PROTECTED]; linux-kernel@vger.kernel.org; netdev@vger.kernel.org; [EMAIL PROTECTED] Sent: Thursday, August 17, 2006 4:26 PM Subject: Re: [PATCH 1/7] ip1000: update maintainer information The patches are missing signed-off-by so please resend. I am starting my vacation on friday so I suggest you send the whole driver as a patch for review at netdev@vger.kernel.org for inclusion. I can apply your patches to git://git.kernel.org/pub/scm/linux/kernel/git/penberg/netdev-ipg-2.6.git if you want, though. Only the first three patches apply and everything starting from ipg_config_autoneg rewrite' fail. Pekka - 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
Re: [PATCH 1/6] IP100A, add end of pci id table
Hi Jeff: Sorry for that. I will remove those. Am I need to resent all of those patch or send all in one patch? Jesse Huang. - Original Message - From: Jeff Garzik [EMAIL PROTECTED] To: Jesse Huang [EMAIL PROTECTED] Cc: linux-kernel@vger.kernel.org; netdev@vger.kernel.org; [EMAIL PROTECTED] Sent: Thursday, August 17, 2006 10:45 PM Subject: Re: [PATCH 1/6] IP100A, add end of pci id table Jesse Huang wrote: @@ -212,7 +212,7 @@ static const struct pci_device_id sundan { 0x1186, 0x1002, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 4 }, { 0x13F0, 0x0201, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 5 }, { 0x13F0, 0x0200, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 6 }, - { } + { 0,} }; MODULE_DEVICE_TABLE(pci, sundance_pci_tbl); @@ -231,7 +231,7 @@ static const struct pci_id_info pci_id_t {D-Link DL10050-based FAST Ethernet Adapter}, {Sundance Technology Alta}, {IC Plus Corporation IP100A FAST Ethernet Adapter}, - { } /* terminate list. */ + { NULL,} /* terminate list. */ NAK. An empty array element { } implies NULL. It is the kernel standard to prefer { } over an explicit initialization. Looks cleaner. Jeff - 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
Re: Hello, We had some patch need to submit for sundance.c
Hi Jeff: I will use sundance.c in this tree to generate patch files. Thanks for this information. Jesse - Original Message - From: Jeff Garzik [EMAIL PROTECTED] To: Jesse Huang [EMAIL PROTECTED] Cc: Francois Romieu [EMAIL PROTECTED]; linux-kernel@vger.kernel.org; netdev@vger.kernel.org; Andrew Morton [EMAIL PROTECTED] Sent: Thursday, August 10, 2006 7:23 PM Subject: Re: Hello, We had some patch need to submit for sundance.c Jesse Huang wrote: Dear All: We had some patch need to submit. Would you tell me where to get current sundance.c for myself to generate those patch files. Sorry, I only got this link: http://www.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=blob;h=f13b2a195c708fe32d8c53d05988875a51bd52e1;hb=1668b19f75cb949f930814a23b74201ad6f76a53;f=drivers/net/sundance.c You need to install the git software package, and then check out the upstream branch of git://git.kernel.org/pub/scm/linux/kernel/git/jgarzik/netdev-2.6.git Then provide patches against the drivers/net/sundance.c driver found there. git software download: http://www.kernel.org/pub/software/scm/git/ git overview: http://git.or.cz/ git tutorial: http://www.kernel.org/pub/software/scm/git/docs/tutorial.html git man pages: http://www.kernel.org/pub/software/scm/git/docs Thanks, Jeff - 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
Hello, We had some patch need to submit for sundance.c
Dear All: We had some patch need to submit. Would you tell me where to get current sundance.c for myself to generate those patch files. Sorry, I only got this link: http://www.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=blob;h=f13b2a195c708fe32d8c53d05988875a51bd52e1;hb=1668b19f75cb949f930814a23b74201ad6f76a53;f=drivers/net/sundance.c Thanks for everybody. Best Regards, Jesse Huang - Original Message - From: Francois Romieu [EMAIL PROTECTED] To: Jesse Huang [EMAIL PROTECTED] Cc: linux-kernel@vger.kernel.org; netdev@vger.kernel.org; Andrew Morton [EMAIL PROTECTED]; Jeff Garzik [EMAIL PROTECTED] Sent: Friday, July 28, 2006 3:07 AM Subject: Re: Hello, We have IP100A Linux driver need to submit to 2.6.x kernel Jesse Huang [EMAIL PROTECTED] : [...] I am IC Plus software engineer. We have IP100A 10/100 fast network adapter driver need to submit to Linux 2.6.x kernel. Please tell me who should I submit to. IP100A's device ID is 0x13f0 0200. You do not need to do anything: http://www.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=1668b19f75cb949f930814a23b74201ad6f76a53 As far as I have checked before forwarding Pedro Alejandro's patch, the out-of-tree IP100 driver exhibited no significant difference with the sundance driver. -- Ueimor - 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
Re: [PATCH] Create IP100A Driver
Dear Jeff: I had discuss with our peoples. We decided to use sundance.c to support IP100A. We will also update some bug fix to this driver. Thanks for your suggestion. Best Regards, Jesse Huang - Original Message - From: Jeff Garzik [EMAIL PROTECTED] To: Jesse Huang [EMAIL PROTECTED] Cc: John W. Linville [EMAIL PROTECTED]; linux-kernel@vger.kernel.org; netdev@vger.kernel.org; [EMAIL PROTECTED] Sent: Friday, July 28, 2006 6:14 PM Subject: Re: [PATCH] Create IP100A Driver Although it is occasionally OK to duplicate a driver, I do not see a compelling case with ip100a. The stronger case for a single codebase is won on the strengths of lower long-term maintenance costs, increased strength of review, doesn't break existing sundance driver uses, and re-use of existing testing benefits. If you feel strongly about not showing sundance to your users, you can always submit a one-line MODULE_ALIAS() change which permits users to load ip100a (really sundance.c). Using MODULE_ALIAS() seems quite reasonable, given that IC Plus appears to be taking the lead in future Sundance-like chip development. So, please resubmit as changes to the existing sundance.c. This is better for the standard Linux kernel engineering process. Thanks, Jeff - 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
Re: Hello, We have IP100A Linux driver need to submit to 2.6.x kernel
Hi Francois: Sorry, I don't know this patch before. IP100A is a new version of IP100 (sundance.c). I don't know what is you suggestion of IP100A driver? Should I... 1. Only updata sundance.c to support IP100A 2. Release ip100a.c which support ip100(sundance) to kernel 2.6.x and ask to remove sundance.c. 3. Release ip100a.c with sundance.c both to kernel 2.6.x We hope to use IP100a.c as our product driver, so 2. and 3. will better for IC Plus. But we will still follow your suggestion, if you feel 1. was better for kernel. Thanks! Jesse - Original Message - From: Francois Romieu [EMAIL PROTECTED] To: Jesse Huang [EMAIL PROTECTED] Cc: linux-kernel@vger.kernel.org; netdev@vger.kernel.org; Andrew Morton [EMAIL PROTECTED]; Jeff Garzik [EMAIL PROTECTED] Sent: Friday, July 28, 2006 3:07 AM Subject: Re: Hello, We have IP100A Linux driver need to submit to 2.6.x kernel Jesse Huang [EMAIL PROTECTED] : [...] I am IC Plus software engineer. We have IP100A 10/100 fast network adapter driver need to submit to Linux 2.6.x kernel. Please tell me who should I submit to. IP100A's device ID is 0x13f0 0200. You do not need to do anything: http://www.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=1668b19f75cb949f930814a23b74201ad6f76a53 As far as I have checked before forwarding Pedro Alejandro's patch, the out-of-tree IP100 driver exhibited no significant difference with the sundance driver. -- Ueimor - 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
Re: [PATCH] Create IP100A Driver
Hi John: I will try mutt or mail when i want to send next patch. Most different of ip100a.c and sundance.c are almost same only fix some bugs. The different of ip100a and ip100 is in phy. We can use one driver to support those two device, I want to know what is better for kernel: 1. Only updata sundance.c to support IP100A 2. Release ip100a.c which support ip100(sundance) to kernel 2.6.x and ask to remove sundance.c. 3. Release ip100a.c with sundance.c both to kernel 2.6.x We hope to use IP100a.c as our product driver, so 2. and 3. will better for IC Plus. But we will still follow your suggestion, if you feel 1. was better for kernel. Jesse - Original Message - From: John W. Linville [EMAIL PROTECTED] To: Jesse Huang [EMAIL PROTECTED] Cc: linux-kernel@vger.kernel.org; netdev@vger.kernel.org; [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Thursday, July 27, 2006 8:54 PM Subject: Re: [PATCH] Create IP100A Driver On Thu, Jul 27, 2006 at 03:54:25PM -0400, Jesse Huang wrote: From: Jesse Huang [EMAIL PROTECTED] This is the first version of IP100A Linux Driver. One general comment is that your patch is whitespace-damaged, undoubtedly mangled by your mailer. I would suggest that you use a text- or curses-based mailer (like mutt or even mail) for sending patches, but I'm sure there are graphical mailers that can be trained to not be too smart. +static struct pci_device_id ipf_pci_tbl[] __devinitdata = { + {0x1186, 0x1002, 0x1186, 0x1002, 0, 0, 0}, + {0x1186, 0x1002, 0x1186, 0x1003, 0, 0, 1}, + {0x1186, 0x1002, 0x1186, 0x1012, 0, 0, 2}, + {0x1186, 0x1002, 0x1186, 0x1040, 0, 0, 3}, + {0x1186, 0x1002, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 4}, + {0x13F0, 0x0201, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 5}, + {0x13F0, 0x0200, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 6}, + {0,} +}; This PCI ID table is identical to the one in the sundance driver. What advantage does this driver offer over sundance? Thanks, John -- John W. Linville [EMAIL PROTECTED] - 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
Re: [PATCH] Create IP100A Driver
Dear All: There are release note of ip100a.c, that is also different of ip100a.c and sundance.c: versiondescriptions -- [1.21] 1. Support for Mandrake10.x [2006/5/4] versiondescriptions -- [1.20] 1. Solve host error problem in alpha embedded system. [2005/12/9] versiondescriptions -- [1.19] 1. After 2.6.11, changed slot_name to pci_name(). [2005/8/3] versiondescriptions -- [1.18] 1. Modify driver for kernel after 2.6.10 [2005/5/6] versiondescriptions -- [1.17] 1. Fix host error when repeatly down/up IP100A [2005/4/20] versiondescriptions -- [1.16a] 1. Remove support for kernel 2.2.x in readme.txt [2005/4/15] versiondescriptions -- [1.16] 1. Support for kernel 2.6.x [2004/10/22] versiondescriptions -- [1.15b] 1. Change Makefile for Unresolved symbols. [2004/08/30]2. Remove depmod -a in readme.txt versiondescriptions -- [1.15a] 1. Updata Readme.txt. add #depmod -a [2004/08/27] versiondescriptions -- [1.15] 1. Mask MemBaseAddr and IOBaseAddr bit 0 to 6. [2004/08/18] 2. Updata Readme.txt section C to more detail. versiondescriptions -- [1.14a] 1. Add how to change speed in readme.txt [2004/08/18] versiondescriptions -- [1.14] 1. Fix parameter media for change speed function. [2004/08/17] versiondescriptions -- [1.13] 1. Fix LED BUG when IC run global reset. [2004/07/24] versiondescriptions -- [v1.12]1. Change Vendor from Sundance to IC Plus [2004/04/13] 2. Add Device ID 0200 version descriptions -- [v1.11]1. Create from sundance.c(dlh5x-1.10.tgz). [2004/04/08] 2. Start phy id scan at id 0. -- - Original Message - From: Neil Horman [EMAIL PROTECTED] To: John W. Linville [EMAIL PROTECTED] Cc: Jesse Huang [EMAIL PROTECTED]; linux-kernel@vger.kernel.org; netdev@vger.kernel.org; [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Thursday, July 27, 2006 9:06 PM Subject: Re: [PATCH] Create IP100A Driver On Thu, Jul 27, 2006 at 08:54:27AM -0400, John W. Linville wrote: On Thu, Jul 27, 2006 at 03:54:25PM -0400, Jesse Huang wrote: From: Jesse Huang [EMAIL PROTECTED] This is the first version of IP100A Linux Driver. One general comment is that your patch is whitespace-damaged, undoubtedly mangled by your mailer. I would suggest that you use a text- or curses-based mailer (like mutt or even mail) for sending patches, but I'm sure there are graphical mailers that can be trained to not be too smart. +static struct pci_device_id ipf_pci_tbl[] __devinitdata = { + {0x1186, 0x1002, 0x1186, 0x1002, 0, 0, 0}, + {0x1186, 0x1002, 0x1186, 0x1003, 0, 0, 1}, + {0x1186, 0x1002, 0x1186, 0x1012, 0, 0, 2}, + {0x1186, 0x1002, 0x1186, 0x1040, 0, 0, 3}, + {0x1186, 0x1002, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 4}, + {0x13F0, 0x0201, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 5}, + {0x13F0, 0x0200, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 6}, + {0,} +}; This PCI ID table is identical to the one in the sundance driver. What advantage does this driver offer over sundance? Thanks, John Having read Johns comment, I went back and looked again, and in fact the entire driver appears to be a copy of the sundance code. The most significant changes I can see is that the header includes were moved to ipf.h, and the non-standard data types (UINT/UCHAR/etc) were added. Regards Neil -- John W. Linville [EMAIL PROTECTED] - 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 -- /*** *Neil Horman *Software Engineer *gpg keyid: 1024D / 0x92A74FA1 - http://pgp.mit.edu