diff options
author | Jonathan Gray <jsg@cvs.openbsd.org> | 2005-08-28 02:46:14 +0000 |
---|---|---|
committer | Jonathan Gray <jsg@cvs.openbsd.org> | 2005-08-28 02:46:14 +0000 |
commit | bcd34e4741dd6c386258fd1b3caa71dc4817f66d (patch) | |
tree | 09ac4122277327ac4757cca09276b911cac42ebe /sys/dev/usb | |
parent | 4dbbdd0b53308a2ff83bcc9a5017eef2340cae83 (diff) |
We have to do some extra hand holding on link state change
on the AX88178 because of the external PHY.
ok dlg@ deraadt@
Diffstat (limited to 'sys/dev/usb')
-rw-r--r-- | sys/dev/usb/if_axe.c | 20 | ||||
-rw-r--r-- | sys/dev/usb/if_axereg.h | 4 |
2 files changed, 18 insertions, 6 deletions
diff --git a/sys/dev/usb/if_axe.c b/sys/dev/usb/if_axe.c index 3f4151a8ee1..1193ec012dd 100644 --- a/sys/dev/usb/if_axe.c +++ b/sys/dev/usb/if_axe.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_axe.c,v 1.32 2005/08/12 11:56:16 jsg Exp $ */ +/* $OpenBSD: if_axe.c,v 1.33 2005/08/28 02:46:12 jsg Exp $ */ /* * Copyright (c) 1997, 1998, 1999, 2000-2003 @@ -330,9 +330,21 @@ axe_miibus_statchg(device_ptr_t dev) else val = 0; - if (sc->axe_flags & AX178) - val |= (AXE_178_MEDIA_RX_EN | AXE_178_MEDIA_MAGIC | - AXE_178_MEDIA_ENCK); + if (sc->axe_flags & AX178) { + val |= (AXE_178_MEDIA_RX_EN | AXE_178_MEDIA_MAGIC); + + switch (IFM_SUBTYPE(mii->mii_media_active)) { + case IFM_1000_T: + val |= AXE_178_MEDIA_GMII | AXE_178_MEDIA_ENCK; + break; + case IFM_100_TX: + val |= AXE_178_MEDIA_100TX; + break; + case IFM_10_T: + /* doesn't need to be handled */ + break; + } + } DPRINTF(("axe_miibus_statchg: val=0x%x\n", val)); err = axe_cmd(sc, AXE_CMD_WRITE_MEDIA, 0, val, NULL); diff --git a/sys/dev/usb/if_axereg.h b/sys/dev/usb/if_axereg.h index bed21d218ed..8da5de80066 100644 --- a/sys/dev/usb/if_axereg.h +++ b/sys/dev/usb/if_axereg.h @@ -1,4 +1,4 @@ -/* $OpenBSD: if_axereg.h,v 1.6 2005/08/10 23:17:46 jsg Exp $ */ +/* $OpenBSD: if_axereg.h,v 1.7 2005/08/28 02:46:13 jsg Exp $ */ /* * Copyright (c) 1997, 1998, 1999, 2000-2003 @@ -114,7 +114,7 @@ #define AXE_178_MEDIA_JUMBO_EN 0x0040 #define AXE_178_MEDIA_LTPF_ONLY 0x0080 #define AXE_178_MEDIA_RX_EN 0x0100 -#define AXE_178_MEDIA_PORT_SPEED 0x0200 +#define AXE_178_MEDIA_100TX 0x0200 #define AXE_178_MEDIA_SBP 0x0800 #define AXE_178_MEDIA_SUPERMAC 0x1000 |