diff options
| author | Bjoern A. Zeeb <bz@FreeBSD.org> | 2014-04-18 14:21:10 +0000 |
|---|---|---|
| committer | Bjoern A. Zeeb <bz@FreeBSD.org> | 2014-04-18 14:21:10 +0000 |
| commit | cb18b57c6d5e879df9acd7c13d9c09fc9c2110d2 (patch) | |
| tree | 7a32e27f5f854c71eccb54b749f8d2f4e9ded23c /sys/dev/netfpga10g | |
| parent | 491d5d0577cc1cd304effa59f952275c3d8e76fb (diff) | |
Notes
Diffstat (limited to 'sys/dev/netfpga10g')
| -rw-r--r-- | sys/dev/netfpga10g/nf10bmac/if_nf10bmac.c | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/sys/dev/netfpga10g/nf10bmac/if_nf10bmac.c b/sys/dev/netfpga10g/nf10bmac/if_nf10bmac.c index 9eef549a18fe..f6130b72937e 100644 --- a/sys/dev/netfpga10g/nf10bmac/if_nf10bmac.c +++ b/sys/dev/netfpga10g/nf10bmac/if_nf10bmac.c @@ -446,7 +446,25 @@ static int nf10bmac_reset(struct nf10bmac_softc *sc) { - /* Currently we cannot do anything. */ + /* + * If we do not have an ether address set, initialize to the same + * OUI as NetFPGA-10G Linux driver does (which luckily seems + * unallocated). We just change the NIC specific part from + * the slightly long "\0NF10C0" to "\0NFBSD". + * Oh and we keep the way of setting it from a string as they do. + * It's an amazing way to hide it. + * XXX-BZ If NetFPGA gets their own OUI we should fix this. + */ + if (sc->nf10bmac_eth_addr[0] == 0x00 && + sc->nf10bmac_eth_addr[1] == 0x00 && + sc->nf10bmac_eth_addr[2] == 0x00 && + sc->nf10bmac_eth_addr[3] == 0x00 && + sc->nf10bmac_eth_addr[4] == 0x00 && + sc->nf10bmac_eth_addr[5] == 0x00) { + memcpy(&sc->nf10bmac_eth_addr, "\0NFBSD", ETHER_ADDR_LEN); + sc->nf10bmac_eth_addr[5] += sc->nf10bmac_unit; + } + return (0); } |
