Lines Matching refs:to
9 to a MAC layer, which communicates with the physical connection through a
12 cable), and provides a register interface to allow drivers to determine what
13 settings were chosen, and to configure what settings are allowed.
15 While these devices are distinct from the network devices, and conform to a
16 standard layout for the registers, it has been common practice to integrate
19 sometimes quite different) ethernet controllers connected to the same
20 management bus, it is difficult to ensure safe use of the bus.
30 Basically, this layer is meant to provide an interface to PHY devices which
31 allows network driver writers to write as little code as possible, while
36 Most network devices are connected to a PHY by means of a management bus.
38 In order to take advantage of the PAL, each bus interface needs to be
47 number. These functions are guaranteed not to be called from interrupt
48 time, so it is safe for them to block, waiting for an interrupt to signal
51 2) A reset function is optional. This is used to return the bus to an
56 mdiobus_register. Similarly, there's a remove function to undo all of
60 exit functions are used to register the driver.
68 Connecting to a PHY
70 Sometime during startup, the network driver needs to establish a connection
72 and drivers need to all have been loaded, so it is ready for the connection.
73 At this point, there are several ways to connect to the PHY:
82 allowing the network driver to react first to any changes before the PAL
86 manually calling functions to update status, and configure the PHY
91 If you choose option 1 (The hope is that every driver can, but to still be
92 useful to drivers that can't), connecting to the PHY is simple:
94 First, you need a function to react to changes in the link state. This
99 Next, you need to know the device name of the PHY connected to this device.
104 Now, to connect, just call this function:
108 phydev is a pointer to the phy_device structure which represents the PHY. If
110 pointer to your net_device. Once done, this function will have started the
116 PHY-specific flags should be set in phydev->dev_flags prior to the call
117 to phy_connect() such that the underlying PHY driver can check for flags
120 the PHY/controller, of which the PHY needs to be aware.
128 controller may be connected to a gigabit capable PHY, so you would need to
133 Lastly, once the controller is ready to handle network traffic, you call
135 PHY to connect to the network. If you want to handle your own interrupts,
136 just set phydev->irq to PHY_IGNORE_INTERRUPT before you call phy_start.
137 Similarly, if you don't want to use interrupts, set phydev->irq to PHY_POLL.
139 When you want to disconnect from the network (even if just briefly), you call
144 It is possible that the PAL's built-in state machine needs a little help to
146 register a helper function when connecting to the PHY, which will be called
147 every second before the state machine reacts to any changes. To do this, you
148 need to manually call phy_attach() and phy_prepare_link(), and then call
149 phy_start_machine() with the second argument set to point to your special
152 Currently there are no examples of how to use this functionality, and testing
161 phy_prepare_link(). This will mean that phydev->state is entirely yours to
163 might need to avoid them).
165 An effort has been made to make sure that useful functionality can be
168 However, again, no effort has been made so far to test running without the
181 A convenience function to print out the PHY status neatly.
192 Attaches a network device to a particular PHY, binding the PHY to a generic
203 Fills the phydev structure with up-to-date information about the current
215 machine if you write registers like BMCR, BMSR, ADVERTISE, etc. Best to
216 use this only to write registers which are not standard, and don't set off
224 many PHYs require a little hand-holding to get up-and-running.
229 features you want to support, then it may be best to not add
235 If you do need to write a PHY driver, the first thing to do is
238 UID (stored in registers 2 and 3), then comparing it to each
249 Next, you need to specify what features (speed, duplex, autoneg,
259 probe: Allocate phy->priv, optionally refuse to bind.
278 Of these, only config_aneg and read_status are required to be
280 preferred to use the generic phy driver's versions of these two
283 you only need to perform some actions before and after invoking
287 Feel free to look at the Marvell, Cicada, and Davicom drivers in
295 standardized by the IEEE. Most modern PHYs will be able to use
298 implemented in the PAL. This support uses the PAL to access MMD
308 special handling. For instance, to change where the PHY's clock input is,
309 or to add a delay to account for latency issues in the data path. In order
310 to support such contingencies, the PHY Layer allows platform code to register
311 fixups to be run when the PHY is brought up (or subsequently reset).
313 When the PHY Layer brings up a PHY it checks to see if there are any fixups
320 with the fixup. This function is passed a pointer to the phy_device of
337 The stubs set one of the two matching criteria, and set the other one to