# Set nic speed, before it's started.

## tom!79

Hi all,

 in one of my old latops (HP nx9010 (DJ315A)) that now i use as (f)utility server, i have a problem with the integrate nic a "National Semiconductor Corporation DP83815 (MacPhyter) Ethernet Controller", this nic works only on 10Mbit (FD or HD is the same), if i set it at 100Mb or i leave it in autonegotiation,  don't work at all (isn't a gentoo bug, it never worked even in other os).

The faster solution that i have found is writing a script in /etc/local.d called eth0-10Mb.start with these 2 lines:

```

#!/bin/bash

mii-tool -F 10baseT-FD eth0

```

The problem with this workaround is that, this script is executed at the end of all startup scripts, so first that my latop is reachable again after a reboot must wait for about 3Min, as u can see from log:

```

[   25.136538] eth0: DSPCFG accepted after 0 usec.

[   25.474944] eth0: Autonegotiation advertising 0x5e1  partner 0x45e1.

[   25.474952] eth0: link up.

[   25.474963] eth0: Setting full-duplex based on negotiated link capability.

[   26.271240] eth0: Autonegotiation advertising 0x5e1  partner 0x00.

[   26.271248] eth0: link down.

[   27.897182] eth0: Autonegotiation advertising 0x5e1  partner 0x45e1.

[   27.897189] eth0: link up.

[   28.693562] eth0: Autonegotiation advertising 0x5e1  partner 0x00.

[   28.693568] eth0: link down.

[******]

[  200.678317] eth0: link down.

[  202.304250] eth0: Autonegotiation advertising 0x5e1  partner 0x45e1.

[  202.304257] eth0: link up.

[  203.031251] eth0: link down.

[  205.384334] eth0: link up.

```

Someone know if there's a way to setup the natsemi driver to start in a specific way, not in autonegotiation?

Or if there is a way to force 10Mbit somewhere in the boot process to be executed first of other init scripts?

Thaks for all future answers  :Wink: 

----------

## khayyam

tom ... 

You could add a 'preup()' to /etc/conf.d/net

```
preup() {

  if [ ${IFACE} = "eth0" ] ; then 

    mii-tool -F 10baseT-FD eth0

  fi 

  return 0

}
```

HTH & best ... khay

----------

## tom!79

Hi Khay,

yeah googling around I had found that workaround, it was my mistake not to mention it, I wanted to see if there was a way to fix things without changing the net init script. 

Maybe passing options to the module or anything, just that I have not found much information about it.

Ty anyway  :Wink: 

----------

