Lines Matching +full:1 +full:- +full:lane

1 // SPDX-License-Identifier: GPL-2.0-or-later
37 int lane, int device, int reg, u16 *val) in mv88e6390_serdes_read() argument
39 return mv88e6xxx_phy_read_c45(chip, lane, device, reg, val); in mv88e6390_serdes_read()
45 state->link = false; in mv88e6xxx_pcs_decode_state()
53 state->link = !!(status & MV88E6390_SGMII_PHY_STATUS_LINK); in mv88e6xxx_pcs_decode_state()
54 state->an_complete = !!(bmsr & BMSR_ANEGCOMPLETE); in mv88e6xxx_pcs_decode_state()
57 /* The Spped and Duplex Resolved register is 1 if AN is enabled in mv88e6xxx_pcs_decode_state()
61 state->duplex = status & in mv88e6xxx_pcs_decode_state()
66 state->pause |= MLO_PAUSE_TX; in mv88e6xxx_pcs_decode_state()
68 state->pause |= MLO_PAUSE_RX; in mv88e6xxx_pcs_decode_state()
72 if (state->interface == PHY_INTERFACE_MODE_2500BASEX) in mv88e6xxx_pcs_decode_state()
73 state->speed = SPEED_2500; in mv88e6xxx_pcs_decode_state()
75 state->speed = SPEED_1000; in mv88e6xxx_pcs_decode_state()
78 state->speed = SPEED_100; in mv88e6xxx_pcs_decode_state()
81 state->speed = SPEED_10; in mv88e6xxx_pcs_decode_state()
85 return -EINVAL; in mv88e6xxx_pcs_decode_state()
87 } else if (state->link && in mv88e6xxx_pcs_decode_state()
88 state->interface != PHY_INTERFACE_MODE_SGMII) { in mv88e6xxx_pcs_decode_state()
91 * and the PHY invoked the Auto-Negotiation Bypass feature and in mv88e6xxx_pcs_decode_state()
94 state->duplex = DUPLEX_FULL; in mv88e6xxx_pcs_decode_state()
95 if (state->interface == PHY_INTERFACE_MODE_2500BASEX) in mv88e6xxx_pcs_decode_state()
96 state->speed = SPEED_2500; in mv88e6xxx_pcs_decode_state()
98 state->speed = SPEED_1000; in mv88e6xxx_pcs_decode_state()
100 state->link = false; in mv88e6xxx_pcs_decode_state()
103 if (state->interface == PHY_INTERFACE_MODE_2500BASEX) in mv88e6xxx_pcs_decode_state()
104 mii_lpa_mod_linkmode_x(state->lp_advertising, lpa, in mv88e6xxx_pcs_decode_state()
106 else if (state->interface == PHY_INTERFACE_MODE_1000BASEX) in mv88e6xxx_pcs_decode_state()
107 mii_lpa_mod_linkmode_x(state->lp_advertising, lpa, in mv88e6xxx_pcs_decode_state()
147 memcpy(data + i * ETH_GSTRING_LEN, stat->string, in mv88e6352_serdes_get_strings()
160 err = mv88e6352_serdes_read(chip, stat->reg, &reg); in mv88e6352_serdes_get_stat()
162 dev_err(chip->dev, "failed to read statistic\n"); in mv88e6352_serdes_get_stat()
168 if (stat->sizeof_stat == 32) { in mv88e6352_serdes_get_stat()
169 err = mv88e6352_serdes_read(chip, stat->reg + 1, &reg); in mv88e6352_serdes_get_stat()
171 dev_err(chip->dev, "failed to read statistic\n"); in mv88e6352_serdes_get_stat()
183 struct mv88e6xxx_port *mv88e6xxx_port = &chip->ports[port]; in mv88e6352_serdes_get_stats()
193 ARRAY_SIZE(mv88e6xxx_port->serdes_stats)); in mv88e6352_serdes_get_stats()
198 mv88e6xxx_port->serdes_stats[i] += value; in mv88e6352_serdes_get_stats()
199 data[i] = mv88e6xxx_port->serdes_stats[i]; in mv88e6352_serdes_get_stats()
207 return irq_find_mapping(chip->g2_irq.domain, MV88E6352_SERDES_IRQ); in mv88e6352_serdes_irq_mapping()
243 u8 cmode = chip->ports[port].cmode; in mv88e6341_serdes_get_lane()
244 int lane = -ENODEV; in mv88e6341_serdes_get_lane() local
251 lane = MV88E6341_PORT5_LANE; in mv88e6341_serdes_get_lane()
255 return lane; in mv88e6341_serdes_get_lane()
260 u8 cmode = chip->ports[port].cmode; in mv88e6390_serdes_get_lane()
261 int lane = -ENODEV; in mv88e6390_serdes_get_lane() local
268 lane = MV88E6390_PORT9_LANE0; in mv88e6390_serdes_get_lane()
274 lane = MV88E6390_PORT10_LANE0; in mv88e6390_serdes_get_lane()
278 return lane; in mv88e6390_serdes_get_lane()
283 u8 cmode_port = chip->ports[port].cmode; in mv88e6390x_serdes_get_lane()
284 u8 cmode_port10 = chip->ports[10].cmode; in mv88e6390x_serdes_get_lane()
285 u8 cmode_port9 = chip->ports[9].cmode; in mv88e6390x_serdes_get_lane()
286 int lane = -ENODEV; in mv88e6390x_serdes_get_lane() local
294 lane = MV88E6390_PORT9_LANE1; in mv88e6390x_serdes_get_lane()
302 lane = MV88E6390_PORT9_LANE2; in mv88e6390x_serdes_get_lane()
310 lane = MV88E6390_PORT9_LANE3; in mv88e6390x_serdes_get_lane()
317 lane = MV88E6390_PORT10_LANE1; in mv88e6390x_serdes_get_lane()
325 lane = MV88E6390_PORT10_LANE2; in mv88e6390x_serdes_get_lane()
333 lane = MV88E6390_PORT10_LANE3; in mv88e6390x_serdes_get_lane()
341 lane = MV88E6390_PORT9_LANE0; in mv88e6390x_serdes_get_lane()
349 lane = MV88E6390_PORT10_LANE0; in mv88e6390x_serdes_get_lane()
353 return lane; in mv88e6390x_serdes_get_lane()
356 /* Only Ports 0, 9 and 10 have SERDES lanes. Return the SERDES lane address
357 * a port is using else Returns -ENODEV.
361 u8 cmode = chip->ports[port].cmode; in mv88e6393x_serdes_get_lane()
362 int lane = -ENODEV; in mv88e6393x_serdes_get_lane() local
365 return -EOPNOTSUPP; in mv88e6393x_serdes_get_lane()
373 lane = port; in mv88e6393x_serdes_get_lane()
375 return lane; in mv88e6393x_serdes_get_lane()
408 memcpy(data + i * ETH_GSTRING_LEN, stat->string, in mv88e6390_serdes_get_strings()
414 static uint64_t mv88e6390_serdes_get_stat(struct mv88e6xxx_chip *chip, int lane, in mv88e6390_serdes_get_stat() argument
421 err = mv88e6390_serdes_read(chip, lane, MDIO_MMD_PHYXS, in mv88e6390_serdes_get_stat()
422 stat->reg + i, &reg[i]); in mv88e6390_serdes_get_stat()
424 dev_err(chip->dev, "failed to read statistic\n"); in mv88e6390_serdes_get_stat()
429 return reg[0] | ((u64)reg[1] << 16) | ((u64)reg[2] << 32); in mv88e6390_serdes_get_stat()
436 int lane; in mv88e6390_serdes_get_stats() local
439 lane = mv88e6xxx_serdes_get_lane(chip, port); in mv88e6390_serdes_get_stats()
440 if (lane < 0) in mv88e6390_serdes_get_stats()
445 data[i] = mv88e6390_serdes_get_stat(chip, lane, stat); in mv88e6390_serdes_get_stats()
453 return irq_find_mapping(chip->g2_irq.domain, port); in mv88e6390_serdes_irq_mapping()
471 /* 10Gbase-X */
479 /* 10Gbase-R */
495 int lane; in mv88e6390_serdes_get_regs() local
500 lane = mv88e6xxx_serdes_get_lane(chip, port); in mv88e6390_serdes_get_regs()
501 if (lane < 0) in mv88e6390_serdes_get_regs()
505 err = mv88e6390_serdes_read(chip, lane, MDIO_MMD_PHYXS, in mv88e6390_serdes_get_regs()
538 return -EINVAL; in mv88e6352_serdes_set_tx_amplitude()