Re: IP1000 gigabit nic driver

2006-05-03 Thread Andrew Morton
On Mon, 01 May 2006 12:31:40 +0300
Pekka Enberg [EMAIL PROTECTED] wrote:

 [PATCH] IP1000 Gigabit Ethernet device driver
 
 This is a cleaned up fork of the IP1000A device driver:
 
   http://www.icplus.com.tw/driver-pp-IP1000A.html

Please remember that to merge this we'll need a signed-off-by from the
original developers.  (That's not very gplish, but such is life).


-
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: IP1000 gigabit nic driver

2006-05-03 Thread Pekka J Enberg
On Wed, 3 May 2006, Andrew Morton wrote:
 Please remember that to merge this we'll need a signed-off-by from the
 original developers.  (That's not very gplish, but such is life).

OK. Lets see if we can track one of them developers down. I see Craig 
Rich's email (only email found in the original mail) is out of date so if 
anyone knows how to reach him, please let me know. Thanks!

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: IP1000 gigabit nic driver

2006-05-03 Thread David Vrabel
Pekka J Enberg wrote:
 On Wed, 3 May 2006, Andrew Morton wrote:
 Please remember that to merge this we'll need a signed-off-by from the
 original developers.  (That's not very gplish, but such is life).
 
 OK. Lets see if we can track one of them developers down. I see Craig 
 Rich's email (only email found in the original mail) is out of date so if 
 anyone knows how to reach him, please let me know. Thanks!

I think/guess that IC Plus bought out Sundance so you'd need to contact
someone at IC Plus.

David Vrabel
-
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: IP1000 gigabit nic driver

2006-05-01 Thread Pekka Enberg
On Mon, 2006-05-01 at 00:40 +0100, David Vrabel wrote:
 Thanks for doing this Pekka.  I've fixed up some stuff and given it some 
 brief testing on a 100BaseT network and it seems to work now.

Thanks! I merged your stuff and pushed out an updated patch.

Pekka

[PATCH] IP1000 Gigabit Ethernet device driver

This is a cleaned up fork of the IP1000A device driver:

  http://www.icplus.com.tw/driver-pp-IP1000A.html

Open issues:

  - ipg_probe() looks really fishy and doesn't handle all errors
(e.g. ioremap failing).
  - ipg_nic_do_ioctl() is playing games with user-space pointer.
We should use ethtool ioctl instead as suggested by Arjan.
  - something (PHY reset/auto negotiation?) takes 2-3 seconds and
appears to be done with interrupts disabled.

Changelog:

  - Kill 2.2 and 2.4 compatability macros
  - Use proper module API
  - Use proper PCI API
  - Use netdev_priv
  - Consolidate headers to one file
  - Use __iomem annotations
  - Use iomap instead of read/out for I/O
  - Remove obfuscating register access macros
  - Remove changelogs
  - Remove ether_crc_le() -- use crc32_le() instead.
  - No more nonsense with root_dev -- ipg_remove() now works.
  - Move PHY and MAC address initialization into the ipg_probe().  It was
previously filling in the MAC address on open which breaks some user
space.
  - Folded ipg_nic_init into ipg_probe since it was broke otherwise.

I don't have the hardware, so I don't know if I broke anything.
The patch is 128 KB in size, so I am not including it in this
mail. You can find the patch here:

  http://www.cs.helsinki.fi/u/penberg/linux/ip1000-driver.patch

Signed-off-by: David Vrabel [EMAIL PROTECTED]
Signed-off-by: Pekka Enberg [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: IP1000 gigabit nic driver

2006-05-01 Thread Pekka Enberg
On Mon, 2006-05-01 at 00:40 +0100, David Vrabel wrote:
 Still pending.  Also:
 
  - something (PHY reset/auto negotiation?) takes 2-3 seconds and
appears to be done with interrupts disabled.

Are you seeing this at module initialization? Does Sysrq-t show anything
useful?

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: IP1000 gigabit nic driver

2006-05-01 Thread David Vrabel

Lennert Buytenhek wrote:

On Mon, May 01, 2006 at 10:38:47PM +0200, Francois Romieu wrote:



-/* Minimum number of miliseconds used to toggle MDC clock during
+/* Minimum number of nanoseconds used to toggle MDC clock during
 * MII/GMII register access.
 */
-#define IPG_PC_PHYCTRLWAIT   0x01
+#defineIPG_PC_PHYCTRLWAIT_NS   200


I would have expected a cycle of 400 ns (p.72/77 of the datasheet)
for a 2.5 MHz clock. Why is it cut by a two factor ?



200 ns high + 200 ns low = 400 ns clock period?


Yes.

David
-
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: IP1000 gigabit nic driver

2006-04-30 Thread David Vrabel

Pekka Enberg wrote:

On Sat, 2006-04-29 at 14:21 +0200, David Gómez wrote:

I already had it modified, just needed to create the patch... Anyway,
have you submitted it to netdev?


On Sat, 2006-04-29 at 23:35 +0300, Pekka Enberg wrote:

No, I haven't. I don't have the hardware, so I can't test the driver.
Furthermore, there's plenty of stuff to fix before it's in any shape for
submission. If someone wants to give this patch a spin, I would love to
hear the results.


Thanks for doing this Pekka.  I've fixed up some stuff and given it some 
brief testing on a 100BaseT network and it seems to work now.



Subject: [PATCH] IP1000 Gigabit Ethernet device driver

This is a cleaned up fork of the IP1000A device driver:

  http://www.icplus.com.tw/driver-pp-IP1000A.html

Open issues include but are not limited to:

  - ipg_probe() looks really fishy and doesn't handle all errors
(e.g. ioremap failing).
  - ipg_nic_do_ioctl() is playing games with user-space pointer.
We should use ethtool ioctl instead as suggested by Arjan.


Still pending.  Also:

- something (PHY reset/auto negotiation?) takes 2-3 seconds and
  appears to be done with interrupts disabled.


  - For multiple devices, the driver uses a global root_dev and
ipg_remove() play some tricks which look fishy.


Killed this.  It was broke and ugly as hell.

Attached is patch with some more changes:

- Remove changelogs
- Remove ether_crc_le() -- use crc32_le() instead.
- No more nonsense with root_dev -- ipg_remove() now works.
- Move PHY and MAC address initialization into the ipg_probe().  It was
  previously filling in the MAC address on open which breaks some user
  space.
- Folded ipg_nic_init into ipg_probe since it was broke otherwise.

Signed-off-by: David Vrabel [EMAIL PROTECTED]
Index: linux-source-2.6.16/drivers/net/ipg.c
===
--- linux-source-2.6.16.orig/drivers/net/ipg.c  2006-04-30 22:26:05.788013667 
+0100
+++ linux-source-2.6.16/drivers/net/ipg.c   2006-05-01 00:23:28.358641581 
+0100
@@ -13,149 +13,14 @@
  * 408 873 4117
  * www.sundanceti.com
  * [EMAIL PROTECTED]
- *
- * Rev  Date Description
- * --
- * 0.1  11/8/99  Initial revision work begins.
- *
- * 0.2  11/12/99  Basic operation achieved, continuing work.
- *
- * 0.3  11/19/99  MAC Loop Back for sync problem testing.
- *
- * 0.4  12/22/99  ioctl for diagnotic program 'hunter' support.
- *
- * 0.5  4/13/00   Updates to
- *
- * 0.6  6/14/00   Slight correction to handling TFDDONE, and
- *preservation of PHYCTRL polarity bits.
- *
- * 0.7  7/27/00   Modifications to accomodate triple speed
- *autonegotiation. Also change to ioctl routine
- *to handle unknown PHY address.
- *
- * 0.8  8/11/00   Added change_mtu function.
- *
- * 0.9  8/15/00   Corrected autonegotiation resolution.
- *
- * 0.10 8/30/00   Changed constants to use IPG in place
- *of RIO. Also, removed most of debug
- *code in preparation for production release.
- *
- * 0.11 8/31/00   Utilize 64 bit data types where appropriate.
- *
- * 0.12 9/1/00Move some constants to include file and utilize
- *RxDMAInt register.
- *
- * 0.13 10/31/00  Several minor modifications to improve stability.
- *
- * 0.14 11/28/00  Added call to nic_tx_free if TFD not available.
- *
- * 0.15 12/5/00   Corrected problem with receive errors, always set
- *receive buffer address to NULL. Release RX buffers
- *on errors.
- *
- * 0.16 12/20/00  Corrected autoneg resolution issue, must detect
- *speed via PHYCTRL register. Also, perform only 1
- *loop in the nic_txcleanup routine.
- *
- * 0.17 2/7/01Changed all references of ST2021 to IPG.
- *When next TFD not available, return -ENOMEM instead
- *of 0. Removed references to RUBICON.
- *
- * 0.18 2/14/01   Corrected problem when unexpected jumbo frames are
- *received (now dropped properly.) Changed
- *DROP_ON_ERRORS breaking out Ethernet errors and
- *TCP/IP errors serparately. Corrected Gigabit
- *copper PAUSE autonegotiation.
- *
- * 0.19 2/22/01   Changed interrupt handling of RFD_LIST_END,
- *INT_REQUESTED, and RX_DMA_COMPLETE. Masked off
- *RMON statistics and unused MIB statistics.
- *Make sure *all* statistics are accounted for
- *(either masked or read in get_stats) to avoid
- *perpetual UpdateStats interrupt from causing
- *driver to crash.
- *
- * 0.20 3/2/01Corrected error in nic_stop. Need to set
- *TxBuff[] = NULL after freeing TxBuff and
- *RxBuff[] = NULL after freeing RxBuff.
- *
- * 0.21 3/5/01Correct 10/100Mbit PAUSE autonegotiation.
- *

Re: IP1000 gigabit nic driver

2006-04-29 Thread Arjan van de Ven
On Sat, 2006-04-29 at 13:29 +0300, Pekka Enberg wrote:
 On Fri, 28 Apr 2006, David Gómezz wrote:
   Ok, i could take care of that, and it's a good way of getting my hands
   dirty with kernel programming ;). David, if it's ok to you i'll do the
   cleanup thing.
 
 On Fri, 2006-04-28 at 14:59 +0300, Pekka J Enberg wrote:
  Here are some suggestions for coding style cleanups:
 
 [snip]
 
 I ended up doing most of them myself [1]. Sorry :-) Are the datasheets
 public by the way?


you want to nuke the ioctl btw and just use ethtool ioctl instead

-
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: IP1000 gigabit nic driver

2006-04-29 Thread David Gómez
Hi Pekka,

On Apr 29 at 01:29:26, Pekka Enberg wrote:
 I ended up doing most of them myself [1]. Sorry :-) Are the datasheets
 public by the way?

I already had it modified, just needed to create the patch... Anyway,
have you submitted it to netdev?

About the datasheets, i don't think so. The icplus  web page seems broken
except for the driver section. But maybe if asked they'll made public
the datasheets.

cheers,

-- 
David Gómez  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


Re: IP1000 gigabit nic driver

2006-04-29 Thread David Vrabel

Pekka Enberg wrote:


I ended up doing most of them myself [1]. Sorry :-) Are the datasheets
public by the way?


http://www.icplus.com.tw/Data/Datasheet/IP1000A-DS-R08-07052005.pdf


  1. http://www.cs.helsinki.fi/u/penberg/linux/ip1000-driver.patch

-
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: IP1000 gigabit nic driver

2006-04-28 Thread David Gómez
Hi Francois,

On Apr 27 at 08:56:27, Francois Romieu wrote:
 /me goes to http://www.icplus.com.tw/driver-pp-IP1000A.html
 
 $ unzip -c IP1000A-Linux-driver-v2.09f.zip | grep MODULE_LICENSE
 MODULE_LICENSE(GPL);

Thanks, i didn't notice it ;-)

 It's a bit bloaty but it does not seem too bad (not mergeable as
 is though). Do you volunteer to test random cra^W^W carefully
 engineered code on your computer to help the rework/merging process ?

Yes, i am. Send me all the the cra ;-), i'm ready to
test it.

cheers,

-- 
David Gómez  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


Re: IP1000 gigabit nic driver

2006-04-28 Thread David Gómez
Hi David,

On Apr 27 at 11:26:07, David Vrabel wrote:
 I finally got around to putting a 2nd NIC in my box that has one of this 
 chips and was going to start fixing the driver up and preparing it for 
 submission this weekend.

Great!

  Or I might try rewriting from scratch based on 
 the datasheet depending on how horrific the code looks on closer inspection.

For what i've seen, the code seems quite readable.

 Not got a whole lot of time to do this so no timescale for completion...

I could help. What things do you think need to be fixed before
submitting the driver?

cheers,

-- 
David Gómez  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


Re: IP1000 gigabit nic driver

2006-04-28 Thread Pekka Enberg
On 4/28/06, David Gómez [EMAIL PROTECTED] wrote:
 I could help. What things do you think need to be fixed before
 submitting the driver?

Needs some serious coding style cleanup and conversion to proper 2.6
APIs for starters.
-
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: IP1000 gigabit nic driver

2006-04-28 Thread David Gómez
Hi Pekka,

On Apr 28 at 01:58:04, Pekka Enberg wrote:
 Needs some serious coding style cleanup and conversion to proper 2.6
 APIs for starters.

Ok, i could take care of that, and it's a good way of getting my hands
dirty with kernel programming ;). David, if it's ok to you i'll do the
cleanup thing.

What about 2.4/2.2 code? It's supposed to stay for compatibility
or it should be removed before submitting?

cheers,

-- 
David Gómez  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


Re: IP1000 gigabit nic driver

2006-04-28 Thread Pekka J Enberg
On Apr 28 at 01:58:04, Pekka Enberg wrote:
  Needs some serious coding style cleanup and conversion to proper 2.6
  APIs for starters.

On Fri, 28 Apr 2006, David Gómezz wrote:
 Ok, i could take care of that, and it's a good way of getting my hands
 dirty with kernel programming ;). David, if it's ok to you i'll do the
 cleanup thing.
 
 What about 2.4/2.2 code? It's supposed to stay for compatibility
 or it should be removed before submitting?

It's preferred not to have compatability cruft for 2.6 patch submissions, 
so I'd say kill them.

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: IP1000 gigabit nic driver

2006-04-28 Thread Pekka J Enberg
Hi David,

On Fri, 28 Apr 2006, David Gómezz wrote:
 Ok, i could take care of that, and it's a good way of getting my hands
 dirty with kernel programming ;). David, if it's ok to you i'll do the
 cleanup thing.

Here are some suggestions for coding style cleanups:

  - Use Lindet for initial formatting
  - Kill use of LINUX_VERSION_CODE macro for compatability
  - Kill obfuscating macros. For example, IPG_DEV_KFREE_SKB and 
IPG_DEVICE_TYPE.
  - Move changelogs outside of source files
  - Convert kmalloc/memset to kzalloc and kcalloc
  - Remove redundant typecasts
  - Remove dead code
  - Use dev_{dbg,err,info,warn} for logging
  - Remove unnecessary curly braces
  - Use proper naming convention for things like Length and pPHYParam
  - Convert macro functions to static inline functions for type safety

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: IP1000 gigabit nic driver

2006-04-28 Thread Ingo Oeser
Hi David,

David Gómez wrote:
 On Apr 28 at 01:58:04, Pekka Enberg wrote:
  Needs some serious coding style cleanup and conversion to proper 2.6
  APIs for starters.
 
 Ok, i could take care of that, and it's a good way of getting my hands
 dirty with kernel programming ;). David, if it's ok to you i'll do the
 cleanup thing.

Have fun! Great that you do this.
 
 What about 2.4/2.2 code? It's supposed to stay for compatibility
 or it should be removed before submitting?

Usually it should be removed.

The way to remove 2.4/2.2. code is by reimplementation
of 2.6-APIs in seperate files and headers and not submitting
these into latest kernel. Keep these somewhere else 
(e.g. a project web site).

That way your drivers ALWAYS work with latest kernels
and you notice breakage of backward compatiblity quite easily.
If maintaining these parts becomes a pain with no gain, 
you can simply stop providing these yourself.

#ifdef KERNEL_VERSON stuff in submitted drivers
is generally not acceptable. Since it is hard to test these parts.

I ported some off-tree drivers from 2.2 to 2.4. using this technique
and it works good, reduces maintainence burden and keeps
your driver current to latest APIs automatically.


Regards

Ingo Oeser
-
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: IP1000 gigabit nic driver

2006-04-28 Thread David Gómez
Hi Pekka,

On Apr 28 at 02:59:01, Pekka J Enberg wrote:
 Here are some suggestions for coding style cleanups:

Couple of questions,

   - Use dev_{dbg,err,info,warn} for logging

Cannot, i need a struct device and most of the
there's only access to a struct net_device. Am i
missing something? 

   - Use proper naming convention for things like Length and pPHYParam

What's the convention for these names?

Thanks,

-- 
David Gómez  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


Re: IP1000 gigabit nic driver

2006-04-27 Thread Francois Romieu
David G??mez [EMAIL PROTECTED] :
[...]
 Does anybody in this list know why the IP1000 driver is not
 included in the kernel ?

Afaik the driver has never been submitted for inclusion.
At least not on netdev@vger.kernel.org (hint, hint).

[...]
 The card in question is:
 
 Sundance Technology Inc IC Plus IP1000
 
 and the driver can be found in sundance web, sources 

URL please ?

 included. I tried to contact the author but my email
 bounced.
 
 There's no LICENSE in the source, just copyrigth
 sentences in the .c files, so i'm not sure under
 which license it's distributed :-?.

/me goes to http://www.icplus.com.tw/driver-pp-IP1000A.html

$ unzip -c IP1000A-Linux-driver-v2.09f.zip | grep MODULE_LICENSE
MODULE_LICENSE(GPL);

It's a bit bloaty but it does not seem too bad (not mergeable as
is though). Do you volunteer to test random cra^W^W carefully
engineered code on your computer to help the rework/merging process ?

-- 
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: IP1000 gigabit nic driver

2006-04-27 Thread David Vrabel

Francois Romieu wrote:

David Gómez [EMAIL PROTECTED] :
[...]

Does anybody in this list know why the IP1000 driver is not
included in the kernel ?


Afaik the driver has never been submitted for inclusion.
At least not on netdev@vger.kernel.org (hint, hint).

[...]

The card in question is:

Sundance Technology Inc IC Plus IP1000

and the driver can be found in sundance web, sources 


URL please ?


included. I tried to contact the author but my email
bounced.

There's no LICENSE in the source, just copyrigth
sentences in the .c files, so i'm not sure under
which license it's distributed :-?.


/me goes to http://www.icplus.com.tw/driver-pp-IP1000A.html

$ unzip -c IP1000A-Linux-driver-v2.09f.zip | grep MODULE_LICENSE
MODULE_LICENSE(GPL);

It's a bit bloaty but it does not seem too bad (not mergeable as
is though). Do you volunteer to test random cra^W^W carefully
engineered code on your computer to help the rework/merging process ?


I finally got around to putting a 2nd NIC in my box that has one of this 
chips and was going to start fixing the driver up and preparing it for 
submission this weekend.  Or I might try rewriting from scratch based on 
the datasheet depending on how horrific the code looks on closer inspection.


Not got a whole lot of time to do this so no timescale for completion...

David Vrabel

-
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