2003-05-04 18:33:23

by Martin Schlemmer

[permalink] [raw]
Subject: [2.5] Update sk98lin driver

Hi

I have a 3Com 3c940 gigabit LOM, that is basically a
SysKonnect chipset card. Here are later drivers that
do support it:

ftp://ftp.asus.com.tw/pub/ASUS/lan/3com/3c940/041_Linux.zip

The current one in the 2.5 tree was last updated for newer
chipsets in 2001, while the new was updated February this
year.

Anyhow, I got the new to compile, and fixed the few irqreturn_t
calls, and some other 2.5 changes I knew about.

Now the problem is that if I try to load it, I get this:

-----------------------------------------
sk98lin: Unknown symbol __udivdi3
-----------------------------------------

Meaning it linked with libgcc_s.so. Any ideas why ?

If you need the diff from above source, let me know. Else
if somebody more experienced is interested in porting it,
I will gladly test.


Thanks,

--

Martin Schlemmer




Attachments:
signature.asc (189.00 B)
This is a digitally signed message part

2003-05-04 18:41:39

by Christoph Hellwig

[permalink] [raw]
Subject: Re: [2.5] Update sk98lin driver

On Sun, May 04, 2003 at 08:44:07PM +0200, Martin Schlemmer wrote:
> Anyhow, I got the new to compile, and fixed the few irqreturn_t
> calls, and some other 2.5 changes I knew about.
>
> Now the problem is that if I try to load it, I get this:
>
> -----------------------------------------
> sk98lin: Unknown symbol __udivdi3
> -----------------------------------------
>
> Meaning it linked with libgcc_s.so. Any ideas why ?

Get rid of division on 64bit types in the driver.

2003-05-04 18:44:54

by Matti Aarnio

[permalink] [raw]
Subject: Re: [2.5] Update sk98lin driver

On Sun, May 04, 2003 at 08:44:07PM +0200, Martin Schlemmer wrote:
> Hi
>
> I have a 3Com 3c940 gigabit LOM, that is basically a
> SysKonnect chipset card. Here are later drivers that
> do support it:
> ftp://ftp.asus.com.tw/pub/ASUS/lan/3com/3c940/041_Linux.zip
...>
> Now the problem is that if I try to load it, I get this:
> -----------------------------------------
> sk98lin: Unknown symbol __udivdi3
> -----------------------------------------
> Meaning it linked with libgcc_s.so. Any ideas why ?

It wanted to. That is signature of 64 bit value
being divided by an abitrary non-power-of-two divider.

If there is a non-fast-path use for the division,
using do_div() macro. Originally for lib/vsprintf.c
from which you can deduce the usage.

If it is in fast-path, then the code needs serious
re-thought.

> If you need the diff from above source, let me know. Else
> if somebody more experienced is interested in porting it,
> I will gladly test.
> Thanks,
> --
> Martin Schlemmer

/Matti Aarnio

2003-05-04 19:24:29

by Martin Schlemmer

[permalink] [raw]
Subject: Re: [2.5] Update sk98lin driver

On Sun, 2003-05-04 at 20:57, Matti Aarnio wrote:

> > Now the problem is that if I try to load it, I get this:
> > -----------------------------------------
> > sk98lin: Unknown symbol __udivdi3
> > -----------------------------------------
> > Meaning it linked with libgcc_s.so. Any ideas why ?
>
> It wanted to. That is signature of 64 bit value
> being divided by an abitrary non-power-of-two divider.
>
> If there is a non-fast-path use for the division,
> using do_div() macro. Originally for lib/vsprintf.c
> from which you can deduce the usage.
>
> If it is in fast-path, then the code needs serious
> re-thought.
>

Bleh, never easy hey =)

And I am guessing just adding a __udivdi3 implementation like
some of the other archs is out of the question ?


--

Martin Schlemmer




Attachments:
signature.asc (189.00 B)
This is a digitally signed message part

2003-05-04 21:18:21

by Xose Vazquez Perez

[permalink] [raw]
Subject: Re:[2.5] Update sk98lin driver

Martin Schlemmer wrote:

>I have a 3Com 3c940 gigabit LOM, that is basically a
>SysKonnect chipset card. Here are later drivers that
>do support it:
>
> ftp://ftp.asus.com.tw/pub/ASUS/lan/3com/3c940/041_Linux.zip

latest drivers for SK-98xx and clones are 6.05 version.
patch for 2.4.20: http://www.syskonnect.de/syskonnect/support/driver/zip/sk98lin_2.4.20_patch.gz

regards,
--
Galiza nin perdoa nin esquence. Governo demision!

2003-05-04 21:36:47

by Andrew Morton

[permalink] [raw]
Subject: Re: [2.5] Update sk98lin driver

Martin Schlemmer <[email protected]> wrote:
>
> Hi
>
> I have a 3Com 3c940 gigabit LOM, that is basically a
> SysKonnect chipset card. Here are later drivers that
> do support it:
>
> ftp://ftp.asus.com.tw/pub/ASUS/lan/3com/3c940/041_Linux.zip
>
> The current one in the 2.5 tree was last updated for newer
> chipsets in 2001, while the new was updated February this
> year.
>
> Anyhow, I got the new to compile, and fixed the few irqreturn_t
> calls, and some other 2.5 changes I knew about.
>
> Now the problem is that if I try to load it, I get this:
>
> -----------------------------------------
> sk98lin: Unknown symbol __udivdi3
> -----------------------------------------
>
> Meaning it linked with libgcc_s.so. Any ideas why ?
>

This was the fix for the in-kernel driver, so it'll presumably
fix the updated driver.


diff -puN drivers/net/sk98lin/h/skgepnm2.h~sk98-build-fix drivers/net/sk98lin/h/skgepnm2.h
--- 25/drivers/net/sk98lin/h/skgepnm2.h~sk98-build-fix Thu Mar 6 16:18:07 2003
+++ 25-akpm/drivers/net/sk98lin/h/skgepnm2.h Thu Mar 6 16:18:07 2003
@@ -341,7 +341,7 @@ typedef struct s_PnmiStatAddr {
#if SK_TICKS_PER_SEC == 100
#define SK_PNMI_HUNDREDS_SEC(t) (t)
#else
-#define SK_PNMI_HUNDREDS_SEC(t) (((t) * 100) / (SK_TICKS_PER_SEC))
+#define SK_PNMI_HUNDREDS_SEC(t) ((((long)t) * 100) / (SK_TICKS_PER_SEC))
#endif

/*

_

2003-05-04 23:18:10

by Martin Schlemmer

[permalink] [raw]
Subject: Re: [2.5] Update sk98lin driver

On Sun, 2003-05-04 at 23:50, Andrew Morton wrote:

> > Now the problem is that if I try to load it, I get this:
> >
> > -----------------------------------------
> > sk98lin: Unknown symbol __udivdi3
> > -----------------------------------------
> >
> > Meaning it linked with libgcc_s.so. Any ideas why ?
> >
>
> This was the fix for the in-kernel driver, so it'll presumably
> fix the updated driver.
>
>
> diff -puN drivers/net/sk98lin/h/skgepnm2.h~sk98-build-fix drivers/net/sk98lin/h/skgepnm2.h
> --- 25/drivers/net/sk98lin/h/skgepnm2.h~sk98-build-fix Thu Mar 6 16:18:07 2003
> +++ 25-akpm/drivers/net/sk98lin/h/skgepnm2.h Thu Mar 6 16:18:07 2003
> @@ -341,7 +341,7 @@ typedef struct s_PnmiStatAddr {
> #if SK_TICKS_PER_SEC == 100
> #define SK_PNMI_HUNDREDS_SEC(t) (t)
> #else
> -#define SK_PNMI_HUNDREDS_SEC(t) (((t) * 100) / (SK_TICKS_PER_SEC))
> +#define SK_PNMI_HUNDREDS_SEC(t) ((((long)t) * 100) / (SK_TICKS_PER_SEC))
> #endif
>
> /*

Thanks, that fixed it =)


--

Martin Schlemmer




Attachments:
signature.asc (189.00 B)
This is a digitally signed message part

2003-05-04 23:45:18

by Martin Schlemmer

[permalink] [raw]
Subject: Re: Re:[2.5] Update sk98lin driver

On Sun, 2003-05-04 at 23:30, Xose Vazquez Perez wrote:
> Martin Schlemmer wrote:
>
> >I have a 3Com 3c940 gigabit LOM, that is basically a
> >SysKonnect chipset card. Here are later drivers that
> >do support it:
> >
> > ftp://ftp.asus.com.tw/pub/ASUS/lan/3com/3c940/041_Linux.zip
>
> latest drivers for SK-98xx and clones are 6.05 version.
> patch for 2.4.20: http://www.syskonnect.de/syskonnect/support/driver/zip/sk98lin_2.4.20_patch.gz
>

Ok, I updated it to 6.05, and can be found here:

ftp://ftp.puk.ac.za/incoming/sk98lin-update-2.5.68.patch.bz2

A few issues though:

1) Should MOD_INC_USE_COUNT and MOD_DEC_USE_COUNT just be removed?
I commented them for now.

2) What other changes should be done for 2.5 ?


Thanks,

--

Martin Schlemmer
Gentoo Linux Developer, Desktop/System Team Developer
Cape Town, South Africa



Attachments:
signature.asc (189.00 B)
This is a digitally signed message part

2003-05-05 00:37:55

by David Miller

[permalink] [raw]
Subject: Re: Re:[2.5] Update sk98lin driver

On Sun, 2003-05-04 at 16:56, Martin Schlemmer wrote:
> A few issues though:
>
> 1) Should MOD_INC_USE_COUNT and MOD_DEC_USE_COUNT just be removed?
> I commented them for now.

No. For the net device itself, make sure you do
SET_MODULE_OWNER() on the netdev before passing it
to register_netdevice().

For the procfs stuff you must make sure the appropriate
module refcounting is done for that mechanism.

Just deleteing MOD_{INC,DEC}_USE_COUNT blindly will result
in the module being broken.

--
David S. Miller <[email protected]>