Commit Graph

27 Commits

Author SHA1 Message Date
thorpej 424f7a1e65 Make PHY matching all table-driven. 2001-06-02 21:39:38 +00:00
thorpej 2128d9199a Enable frobbing the 1000baseT control register on Gig-E PHYs,
used for hard-wiring master mode, and for advertising the 1000baseT
media options during autonegotiation.
2001-05-31 18:44:48 +00:00
thorpej ea1aed7db2 Make the number of ticks between auto-negotiation tries PHY-specific,
and default every PHY to 5 seconds (what we used before).  If we find
Gig-E media on a PHY, bump it to 10 seconds, since it can take 5
seconds just to negotiate a Gig-E link.
2001-05-31 16:02:29 +00:00
drochner 002851041c re-enable mii_flags in attach args - I've found a use for it: tell the
PHY which support it that a fiber interface is present
2001-05-17 17:28:21 +00:00
thorpej d3a64bd0d8 Add code to recognize and set media on GMII (Gigabit MII) PHYs.
802.3 doens't specify ANAR or ANLPAR bits for GMII.  Need to
use PHY-specific registers for this, for now, which means we
need specific drivers for the Gigabit-capable PHYs (I think the
most common is the BCM5400).
2001-04-30 19:49:08 +00:00
augustss b728f196e9 Comment out some flag stuff that isn't used. Someone should take a look
at this.  There is something fishy with the mii code, the last argument to
mii_attach() is not being used in any meaningful way.
2001-04-13 11:14:55 +00:00
augustss 205b10ed17 Add a flag to mii_flags which will cause autonegotiation to use tsleep()
instead of callout.  This way adapters which need a process context for
PHY register access (e.g. USB adapters) have a chance.
2001-04-13 11:12:36 +00:00
drochner 9e8def737f Reading the IEEE specs shows that the bits have to be reversed when
mapping an OUI to the MII id registers.
Doing this in the MII_OUI() macro would be too complex, so put it into
a helper function and move the MII id register interpretation stuff
into miivar.h.
2001-03-28 14:13:06 +00:00
thorpej 49014bf59f Restructure the PHY entry points to use a structure of entry points
instead of discrete function pointers, and extend this to include
a "reset" entry point.  Make sure any PHY-specific reset routine is
always used, and provide one for the LXT-970 which disables MII
interrupts (as is done for a few other PHYs we have drivers for).
2000-07-04 03:28:59 +00:00
thorpej fc96443d15 New callout mechanism with two major improvements over the old
timeout()/untimeout() API:
- Clients supply callout handle storage, thus eliminating problems of
  resource allocation.
- Insertion and removal of callouts is constant time, important as
  this facility is used quite a lot in the kernel.

The old timeout()/untimeout() API has been removed from the kernel.
2000-03-23 07:01:25 +00:00
thorpej ad61d101be Factor out the tick handling code into a common function, and send
rt_ifmsg's when the link speed or link status changes.
2000-03-06 20:56:56 +00:00
thorpej 8923ca0b00 Make PHY drivers provide a pointer to their status routine, and add
a generic mii_phy_status() that calls back into the PHY.  It doesn't
do anything interesting yet, but it will soon.
2000-02-02 17:50:43 +00:00
thorpej eed75dbc26 Don't dry to diving MIIF_NOISOLATE in the PHY drivers. Instead, pass
flags down from the parent to child vi mii_attach().
2000-02-02 17:09:38 +00:00
thorpej 84dc99fdea Bring some order to the chaos which was the MII code function naming
"conventions".
2000-02-02 08:05:26 +00:00
thorpej c74e0a8db2 Add detachment support to the MII layer. 2000-01-27 16:44:30 +00:00
thorpej bca88a28c8 Add mii_down(), which is used by MAC drivers to inform PHYs that the
interface is now down.  PHYs use this to cancel pending asynchronous
operations.
1999-11-12 18:12:59 +00:00
thorpej bedeeb9896 Allow mii_phy_probe() to be called multiple times, and allow the caller
to specify either the PHY number or the PHY `offset' (1st, 2nd, 3rd, etc.)
to configure.
1999-11-04 00:22:07 +00:00
thorpej 8fc600c3b1 Clean up the code that adds media a little, and make media selection
table-driven in preparation for some other changes to be made.
1999-11-03 22:30:32 +00:00
thorpej 45a337e088 Add a PHY `offset' (e.g. "first PHY on bus, second PHY on bus, ...") to
the PHY's softc.
1999-09-25 00:10:13 +00:00
thorpej 83f9ab3c87 Implement asynchronous autonegotiation when driven by the MII tick
(one-second clock).  Prevents .5s delays every 5 seconds when the interface
is up but there is no link.  Fixes PR 7361.
1999-04-23 04:24:32 +00:00
thorpej 2b695df1dc Common code for media-from-bmcr. 1998-11-05 04:08:01 +00:00
thorpej 2a17544c19 Place the essentially common "ticks" and "active" members into the
mii_softc (generic phy goo), and just switch all of the PHY drivers
(except tlphy, which really does have special stuff) to use an mii_softc
instead of a private one.
1998-11-05 00:19:32 +00:00
thorpej f66039cbce Routines common between the Uknown PHY driver (forthcoming) and other
PHY drivers.  This file has ukphy_status(), which is what PHY drivers
should use if media detection is done by decoding NWay.
1998-11-04 23:59:51 +00:00
thorpej 51da8fc39f Factor out the common reset code. Use the NOISOLATE flags as appropriate
to prevent a PHY from being isolated in the event the MAC can't deal with
this.  (3Com 3c905B-TX, and Intel i82557).
1998-11-04 23:28:15 +00:00
thorpej b097394468 Factor out some common code from all the PHY drivers (autonegotiation, for
now.)
1998-11-04 23:07:15 +00:00
thorpej 844622de9c Define and use generic PHY read/write reg macros. 1998-11-04 22:15:40 +00:00
thorpej 3f8be46d4d Near complete rewrite of the MII layer to present an interface compatible
with BSDI's MII layer to device drivers.
1998-08-10 23:55:16 +00:00