msk(4) diff

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

msk(4) diff

Mark Kettenis
The register at the address of the sk(4) SK_EPROM1 register has a
completely different meaning on msk(4).  This diff gets rid of it and
some useless goo using its value.

Please test to make sure that this doesn't break anything.  Something
to watch out for are multiple phy's attaching.

Thanks,

Mark


Index: if_msk.c
===================================================================
RCS file: /cvs/src/sys/dev/pci/if_msk.c,v
retrieving revision 1.21
diff -u -p -r1.21 if_msk.c
--- if_msk.c 27 Sep 2006 02:27:04 -0000 1.21
+++ if_msk.c 15 Nov 2006 17:16:02 -0000
@@ -255,14 +255,6 @@ msk_marv_miibus_readreg(struct device *d
  u_int16_t val;
  int i;
 
- if (phy != 0 ||
-    (sc_if->sk_phytype != SK_PHYTYPE_MARV_COPPER &&
-     sc_if->sk_phytype != SK_PHYTYPE_MARV_FIBER)) {
- DPRINTFN(9, ("msk_marv_miibus_readreg (skip) phy=%d, reg=%#x\n",
-     phy, reg));
- return (0);
- }
-
         SK_YU_WRITE_2(sc_if, YUKON_SMICR, YU_SMICR_PHYAD(phy) |
       YU_SMICR_REGAD(reg) | YU_SMICR_OP_READ);
         
@@ -976,23 +968,6 @@ msk_attach(struct device *parent, struct
      "           tx_ramstart=%#x tx_ramend=%#x\n",
      sc_if->sk_rx_ramstart, sc_if->sk_rx_ramend,
      sc_if->sk_tx_ramstart, sc_if->sk_tx_ramend));
-
- /* Read and save PHY type */
- sc_if->sk_phytype = sk_win_read_1(sc, SK_EPROM1) & 0xF;
-
- /* Set PHY address */
- if ((sc_if->sk_phytype < SK_PHYTYPE_MARV_COPPER &&
-     sc->sk_pmd != 'L' && sc->sk_pmd != 'S')) {
- /* not initialized, punt */
- sc_if->sk_phytype = SK_PHYTYPE_MARV_COPPER;
-
- sc->sk_coppertype = 1;
- }
-
- sc_if->sk_phyaddr = SK_PHYADDR_MARV;
-
- if (!(sc->sk_coppertype))
- sc_if->sk_phytype = SK_PHYTYPE_MARV_FIBER;
 
  /* Allocate the descriptor queues. */
  if (bus_dmamem_alloc(sc->sc_dmatag, sizeof(struct msk_ring_data),
Index: if_mskvar.h
===================================================================
RCS file: /cvs/src/sys/dev/pci/if_mskvar.h,v
retrieving revision 1.1
diff -u -p -r1.1 if_mskvar.h
--- if_mskvar.h 16 Aug 2006 21:06:23 -0000 1.1
+++ if_mskvar.h 15 Nov 2006 17:16:02 -0000
@@ -220,8 +220,6 @@ struct sk_if_softc {
  u_int32_t sk_rx_ramend;
  u_int32_t sk_tx_ramstart;
  u_int32_t sk_tx_ramend;
- u_int8_t sk_phytype;
- int sk_phyaddr;
  int sk_cnt;
  int sk_link;
  struct timeout sk_tick_ch;