Lines Matching +full:mac +full:- +full:phy

2  * Copyright (c) 2005-2008 Chelsio, Inc. All rights reserved.
14 * - Redistributions of source code must retain the above
18 * - Redistributions in binary form must reproduce the above
44 #define CH_ERR(adap, fmt, ...) dev_err(&adap->pdev->dev, fmt, ##__VA_ARGS__)
45 #define CH_WARN(adap, fmt, ...) dev_warn(&adap->pdev->dev, fmt, ##__VA_ARGS__)
46 #define CH_ALERT(adap, fmt, ...) dev_alert(&adap->pdev->dev, fmt, ##__VA_ARGS__)
53 if ((adapter)->msg_enable & NETIF_MSG_##category) \
54 dev_printk(KERN_##level, &adapter->pdev->dev, fmt, \
70 MAX_FRAME_SIZE = 10240, /* max MAC frame size, including header + FCS */
92 enum { /* adapter interrupt-maintained statistics */
151 #define WR_FLITS (TX_DESC_FLITS + 1 - SGE_NUM_GENBITS)
167 unsigned char phy_base_addr; /* MDIO PHY base address */
169 unsigned char gpio_intr[MAX_NPORTS]; /* GPIO PHY IRQ pins */
205 u64 tx_mac_internal_errs; /* # of internal MAC errors on Tx */
232 u64 rx_mac_internal_errs; /* # of internal MAC errors on Rx */
345 /* MC5 modes, these must be non-0 */
395 unsigned int chan_map; /* bitmap of in-use Tx channels */
396 unsigned int stats_update_period; /* MAC stats accumulation period */
453 return p->tcam_size; in t3_mc5_size()
467 return p->size; in t3_mc7_size()
492 /* PHY loopback direction */
498 /* PHY interrupt types */
505 /* PHY module types */
516 /* PHY operations */
518 int (*reset)(struct cphy *phy, int wait);
520 int (*intr_enable)(struct cphy *phy);
521 int (*intr_disable)(struct cphy *phy);
522 int (*intr_clear)(struct cphy *phy);
523 int (*intr_handler)(struct cphy *phy);
525 int (*autoneg_enable)(struct cphy *phy);
526 int (*autoneg_restart)(struct cphy *phy);
528 int (*advertise)(struct cphy *phy, unsigned int advertise_map);
529 int (*set_loopback)(struct cphy *phy, int mmd, int dir, int enable);
530 int (*set_speed_duplex)(struct cphy *phy, int speed, int duplex);
531 int (*get_link_status)(struct cphy *phy, int *link_ok, int *speed,
533 int (*power_down)(struct cphy *phy, int enable);
547 /* A PHY instance */
549 u8 modtype; /* PHY module type */
551 unsigned int caps; /* PHY capabilities */
553 const char *desc; /* PHY description */
554 unsigned long fifo_errors; /* FIFO over/under-flows */
555 const struct cphy_ops *ops; /* PHY operations */
561 static inline int t3_mdio_read(struct cphy *phy, int mmd, int reg, in t3_mdio_read() argument
564 int rc = phy->mdio.mdio_read(phy->mdio.dev, phy->mdio.prtad, mmd, reg); in t3_mdio_read()
565 *valp = (rc >= 0) ? rc : -1; in t3_mdio_read()
569 static inline int t3_mdio_write(struct cphy *phy, int mmd, int reg, in t3_mdio_write() argument
572 return phy->mdio.mdio_write(phy->mdio.dev, phy->mdio.prtad, mmd, in t3_mdio_write()
577 static inline void cphy_init(struct cphy *phy, struct adapter *adapter, in cphy_init() argument
582 phy->caps = caps; in cphy_init()
583 phy->adapter = adapter; in cphy_init()
584 phy->desc = desc; in cphy_init()
585 phy->ops = phy_ops; in cphy_init()
587 phy->mdio.prtad = phy_addr; in cphy_init()
588 phy->mdio.mmds = phy_ops->mmds; in cphy_init()
589 phy->mdio.mode_support = mdio_ops->mode_support; in cphy_init()
590 phy->mdio.mdio_read = mdio_ops->read; in cphy_init()
591 phy->mdio.mdio_write = mdio_ops->write; in cphy_init()
595 /* Accumulate MAC statistics every 180 seconds. For 1G we multiply by 10. */
599 ((reg_addr) + (idx) * (XGMAC0_1_BASE_ADDR - XGMAC0_0_BASE_ADDR))
613 for (iter = 0; iter < (adapter)->params.nports; ++iter)
615 #define adapter_info(adap) ((adap)->params.info)
619 return adapter_info(adap)->caps & SUPPORTED_AUI; in uses_xaui()
624 return adapter_info(adap)->caps & SUPPORTED_10000baseT_Full; in is_10G()
629 return adap->params.offload; in is_offload()
634 return adap->params.vpd.cclk / 1000; in core_ticks_per_usec()
639 return adap->params.pci.variant == PCI_VARIANT_PCIE; in is_pcie()
654 int t3_mdio_change_bits(struct cphy *phy, int mmd, int reg, unsigned int clear,
656 int t3_phy_reset(struct cphy *phy, int mmd, int wait);
657 int t3_phy_advertise(struct cphy *phy, unsigned int advert);
658 int t3_phy_advertise_fiber(struct cphy *phy, unsigned int advert);
659 int t3_set_phy_speed_duplex(struct cphy *phy, int speed, int duplex);
660 int t3_phy_lasi_intr_enable(struct cphy *phy);
661 int t3_phy_lasi_intr_disable(struct cphy *phy);
662 int t3_phy_lasi_intr_clear(struct cphy *phy);
663 int t3_phy_lasi_intr_handler(struct cphy *phy);
677 int t3_link_start(struct cphy *phy, struct cmac *mac, struct link_config *lc);
703 int t3_mac_reset(struct cmac *mac);
704 void t3b_pcs_reset(struct cmac *mac);
705 void t3_mac_disable_exact_filters(struct cmac *mac);
706 void t3_mac_enable_exact_filters(struct cmac *mac);
707 int t3_mac_enable(struct cmac *mac, int which);
708 int t3_mac_disable(struct cmac *mac, int which);
709 int t3_mac_set_mtu(struct cmac *mac, unsigned int mtu);
710 int t3_mac_set_rx_mode(struct cmac *mac, struct net_device *dev);
711 int t3_mac_set_address(struct cmac *mac, unsigned int idx, const u8 addr[6]);
712 int t3_mac_set_num_ucast(struct cmac *mac, int n);
713 const struct mac_stats *t3_mac_update_stats(struct cmac *mac);
714 int t3_mac_set_speed_duplex_fc(struct cmac *mac, int speed, int duplex, int fc);
715 int t3b2_mac_watchdog_task(struct cmac *mac);
755 int t3_vsc8211_phy_prep(struct cphy *phy, struct adapter *adapter,
757 int t3_ael1002_phy_prep(struct cphy *phy, struct adapter *adapter,
759 int t3_ael1006_phy_prep(struct cphy *phy, struct adapter *adapter,
761 int t3_ael2005_phy_prep(struct cphy *phy, struct adapter *adapter,
763 int t3_ael2020_phy_prep(struct cphy *phy, struct adapter *adapter,
765 int t3_qt2045_phy_prep(struct cphy *phy, struct adapter *adapter, int phy_addr,
767 int t3_xaui_direct_phy_prep(struct cphy *phy, struct adapter *adapter,
769 int t3_aq100x_phy_prep(struct cphy *phy, struct adapter *adapter,