• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /netgear-R7000-V1.0.7.12_1.2.5/components/opensource/linux/linux-2.6.36/drivers/net/chelsio/

Lines Matching defs:cphy

4 #include "cphy.h"
17 static void mdio_set_bit(struct cphy *cphy, int reg, u32 bitval)
21 (void) simple_mdio_read(cphy, reg, &val);
22 (void) simple_mdio_write(cphy, reg, val | bitval);
28 static void mdio_clear_bit(struct cphy *cphy, int reg, u32 bitval)
32 (void) simple_mdio_read(cphy, reg, &val);
33 (void) simple_mdio_write(cphy, reg, val & ~bitval);
42 * PARAMS: cphy - Pointer to PHY instance data.
47 static int mv88e1xxx_reset(struct cphy *cphy, int wait)
52 mdio_set_bit(cphy, MII_BMCR, BMCR_RESET);
55 (void) simple_mdio_read(cphy, MII_BMCR, &ctl);
64 static int mv88e1xxx_interrupt_enable(struct cphy *cphy)
67 (void) simple_mdio_write(cphy, MV88E1XXX_INTERRUPT_ENABLE_REGISTER,
71 if (t1_is_asic(cphy->adapter)) {
74 t1_tpi_read(cphy->adapter, A_ELMER0_INT_ENABLE, &elmer);
76 if (is_T2(cphy->adapter))
78 t1_tpi_write(cphy->adapter, A_ELMER0_INT_ENABLE, elmer);
83 static int mv88e1xxx_interrupt_disable(struct cphy *cphy)
86 (void) simple_mdio_write(cphy, MV88E1XXX_INTERRUPT_ENABLE_REGISTER, 0);
89 if (t1_is_asic(cphy->adapter)) {
92 t1_tpi_read(cphy->adapter, A_ELMER0_INT_ENABLE, &elmer);
94 if (is_T2(cphy->adapter))
96 t1_tpi_write(cphy->adapter, A_ELMER0_INT_ENABLE, elmer);
101 static int mv88e1xxx_interrupt_clear(struct cphy *cphy)
106 (void) simple_mdio_read(cphy,
110 if (t1_is_asic(cphy->adapter)) {
111 t1_tpi_read(cphy->adapter, A_ELMER0_INT_CAUSE, &elmer);
113 if (is_T2(cphy->adapter))
115 t1_tpi_write(cphy->adapter, A_ELMER0_INT_CAUSE, elmer);
124 static int mv88e1xxx_set_speed_duplex(struct cphy *phy, int speed, int duplex)
147 static int mv88e1xxx_crossover_set(struct cphy *cphy, int crossover)
151 (void) simple_mdio_read(cphy,
155 (void) simple_mdio_write(cphy,
160 static int mv88e1xxx_autoneg_enable(struct cphy *cphy)
164 (void) mv88e1xxx_crossover_set(cphy, CROSSOVER_AUTO);
166 (void) simple_mdio_read(cphy, MII_BMCR, &ctl);
169 (void) simple_mdio_write(cphy, MII_BMCR, ctl);
173 static int mv88e1xxx_autoneg_disable(struct cphy *cphy)
181 (void) mv88e1xxx_crossover_set(cphy, CROSSOVER_MDI);
187 (void) simple_mdio_read(cphy, MII_BMCR, &ctl);
189 (void) simple_mdio_write(cphy, MII_BMCR, ctl | BMCR_ANRESTART);
193 static int mv88e1xxx_autoneg_restart(struct cphy *cphy)
195 mdio_set_bit(cphy, MII_BMCR, BMCR_ANRESTART);
199 static int mv88e1xxx_advertise(struct cphy *phy, unsigned int advertise_map)
231 static int mv88e1xxx_set_loopback(struct cphy *cphy, int on)
234 mdio_set_bit(cphy, MII_BMCR, BMCR_LOOPBACK);
236 mdio_clear_bit(cphy, MII_BMCR, BMCR_LOOPBACK);
240 static int mv88e1xxx_get_link_status(struct cphy *cphy, int *link_ok,
246 (void) simple_mdio_read(cphy,
273 static int mv88e1xxx_downshift_set(struct cphy *cphy, int downshift_enable)
277 (void) simple_mdio_read(cphy,
288 (void) simple_mdio_write(cphy,
293 static int mv88e1xxx_interrupt_handler(struct cphy *cphy)
304 (void) simple_mdio_read(cphy,
312 (void) simple_mdio_read(cphy,
316 cphy->state |= PHY_LINK_UP;
318 cphy->state &= ~PHY_LINK_UP;
319 if (cphy->state & PHY_AUTONEG_EN)
320 cphy->state &= ~PHY_AUTONEG_RDY;
326 cphy->state |= PHY_AUTONEG_RDY;
328 if ((cphy->state & (PHY_LINK_UP | PHY_AUTONEG_RDY)) ==
335 static void mv88e1xxx_destroy(struct cphy *cphy)
337 kfree(cphy);
356 static struct cphy *mv88e1xxx_phy_create(struct net_device *dev, int phy_addr,
360 struct cphy *cphy = kzalloc(sizeof(*cphy), GFP_KERNEL);
362 if (!cphy)
365 cphy_init(cphy, dev, phy_addr, &mv88e1xxx_ops, mdio_ops);
373 (void) simple_mdio_write(cphy,
375 (void) simple_mdio_write(cphy,
378 (void) mv88e1xxx_downshift_set(cphy, 1); /* Enable downshift */
382 (void) simple_mdio_write(cphy,
386 return cphy;