Deleted Added
full compact
cxgb_common.h (172096) cxgb_common.h (176472)
1/**************************************************************************
2
3Copyright (c) 2007, Chelsio Inc.
4All rights reserved.
5
6Redistribution and use in source and binary forms, with or without
7modification, are permitted provided that the following conditions are met:
8

--- 11 unchanged lines hidden (view full) ---

20LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
21CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
22SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
23INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
24CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
25ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
26POSSIBILITY OF SUCH DAMAGE.
27
1/**************************************************************************
2
3Copyright (c) 2007, Chelsio Inc.
4All rights reserved.
5
6Redistribution and use in source and binary forms, with or without
7modification, are permitted provided that the following conditions are met:
8

--- 11 unchanged lines hidden (view full) ---

20LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
21CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
22SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
23INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
24CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
25ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
26POSSIBILITY OF SUCH DAMAGE.
27
28$FreeBSD: head/sys/dev/cxgb/common/cxgb_common.h 172096 2007-09-09 01:28:03Z kmacy $
28$FreeBSD: head/sys/dev/cxgb/common/cxgb_common.h 176472 2008-02-23 01:06:17Z kmacy $
29
30***************************************************************************/
31#ifndef __CHELSIO_COMMON_H
32#define __CHELSIO_COMMON_H
33
34#ifdef CONFIG_DEFINED
35#include <cxgb_osdep.h>
36#else

--- 56 unchanged lines hidden (view full) ---

93
94#define S_TP_VERSION_MICRO 0
95#define M_TP_VERSION_MICRO 0xFF
96#define V_TP_VERSION_MICRO(x) ((x) << S_TP_VERSION_MICRO)
97#define G_TP_VERSION_MICRO(x) \
98 (((x) >> S_TP_VERSION_MICRO) & M_TP_VERSION_MICRO)
99
100enum {
29
30***************************************************************************/
31#ifndef __CHELSIO_COMMON_H
32#define __CHELSIO_COMMON_H
33
34#ifdef CONFIG_DEFINED
35#include <cxgb_osdep.h>
36#else

--- 56 unchanged lines hidden (view full) ---

93
94#define S_TP_VERSION_MICRO 0
95#define M_TP_VERSION_MICRO 0xFF
96#define V_TP_VERSION_MICRO(x) ((x) << S_TP_VERSION_MICRO)
97#define G_TP_VERSION_MICRO(x) \
98 (((x) >> S_TP_VERSION_MICRO) & M_TP_VERSION_MICRO)
99
100enum {
101 FW_VERSION_MAJOR = 4,
102 FW_VERSION_MINOR = 7,
101 FW_VERSION_MAJOR = 5,
102 FW_VERSION_MINOR = 0,
103 FW_VERSION_MICRO = 0
104};
105
106enum {
107 SGE_QSETS = 8, /* # of SGE Tx/Rx/RspQ sets */
108 SGE_RXQ_PER_SET = 2, /* # of Rx queues per set */
109 SGE_TXQ_PER_SET = 3 /* # of Tx queues per set */
110};

--- 41 unchanged lines hidden (view full) ---

152 unsigned int gpio_out; /* GPIO output settings */
153 unsigned int gpio_intr; /* GPIO IRQ enable mask */
154 unsigned long caps; /* adapter capabilities */
155 const struct mdio_ops *mdio_ops; /* MDIO operations */
156 const char *desc; /* product description */
157};
158
159struct port_type_info {
103 FW_VERSION_MICRO = 0
104};
105
106enum {
107 SGE_QSETS = 8, /* # of SGE Tx/Rx/RspQ sets */
108 SGE_RXQ_PER_SET = 2, /* # of Rx queues per set */
109 SGE_TXQ_PER_SET = 3 /* # of Tx queues per set */
110};

--- 41 unchanged lines hidden (view full) ---

152 unsigned int gpio_out; /* GPIO output settings */
153 unsigned int gpio_intr; /* GPIO IRQ enable mask */
154 unsigned long caps; /* adapter capabilities */
155 const struct mdio_ops *mdio_ops; /* MDIO operations */
156 const char *desc; /* product description */
157};
158
159struct port_type_info {
160 void (*phy_prep)(struct cphy *phy, adapter_t *adapter, int phy_addr,
161 const struct mdio_ops *ops);
162 unsigned int caps;
163 const char *desc;
160 int (*phy_prep)(struct cphy *phy, adapter_t *adapter, int phy_addr,
161 const struct mdio_ops *ops);
162
163
164};
165
166struct mc5_stats {
167 unsigned long parity_err;
168 unsigned long active_rgn_full;
169 unsigned long nfa_srch_err;
170 unsigned long unknown_cmd;
171 unsigned long reqq_parity_err;

--- 331 unchanged lines hidden (view full) ---

503/* PHY interrupt types */
504enum {
505 cphy_cause_link_change = 1,
506 cphy_cause_fifo_error = 2
507};
508
509/* PHY operations */
510struct cphy_ops {
164};
165
166struct mc5_stats {
167 unsigned long parity_err;
168 unsigned long active_rgn_full;
169 unsigned long nfa_srch_err;
170 unsigned long unknown_cmd;
171 unsigned long reqq_parity_err;

--- 331 unchanged lines hidden (view full) ---

503/* PHY interrupt types */
504enum {
505 cphy_cause_link_change = 1,
506 cphy_cause_fifo_error = 2
507};
508
509/* PHY operations */
510struct cphy_ops {
511 void (*destroy)(struct cphy *phy);
512 int (*reset)(struct cphy *phy, int wait);
513
514 int (*intr_enable)(struct cphy *phy);
515 int (*intr_disable)(struct cphy *phy);
516 int (*intr_clear)(struct cphy *phy);
517 int (*intr_handler)(struct cphy *phy);
518
519 int (*autoneg_enable)(struct cphy *phy);

--- 5 unchanged lines hidden (view full) ---

525 int (*get_link_status)(struct cphy *phy, int *link_ok, int *speed,
526 int *duplex, int *fc);
527 int (*power_down)(struct cphy *phy, int enable);
528};
529
530/* A PHY instance */
531struct cphy {
532 int addr; /* PHY address */
511 int (*reset)(struct cphy *phy, int wait);
512
513 int (*intr_enable)(struct cphy *phy);
514 int (*intr_disable)(struct cphy *phy);
515 int (*intr_clear)(struct cphy *phy);
516 int (*intr_handler)(struct cphy *phy);
517
518 int (*autoneg_enable)(struct cphy *phy);

--- 5 unchanged lines hidden (view full) ---

524 int (*get_link_status)(struct cphy *phy, int *link_ok, int *speed,
525 int *duplex, int *fc);
526 int (*power_down)(struct cphy *phy, int enable);
527};
528
529/* A PHY instance */
530struct cphy {
531 int addr; /* PHY address */
532 unsigned int caps; /* PHY capabilities */
533 adapter_t *adapter; /* associated adapter */
533 adapter_t *adapter; /* associated adapter */
534 const char *desc; /* PHY description */
534 unsigned long fifo_errors; /* FIFO over/under-flows */
535 const struct cphy_ops *ops; /* PHY operations */
536 int (*mdio_read)(adapter_t *adapter, int phy_addr, int mmd_addr,
537 int reg_addr, unsigned int *val);
538 int (*mdio_write)(adapter_t *adapter, int phy_addr, int mmd_addr,
539 int reg_addr, unsigned int val);
540};
541

--- 8 unchanged lines hidden (view full) ---

550 unsigned int val)
551{
552 return phy->mdio_write(phy->adapter, phy->addr, mmd, reg, val);
553}
554
555/* Convenience initializer */
556static inline void cphy_init(struct cphy *phy, adapter_t *adapter,
557 int phy_addr, struct cphy_ops *phy_ops,
535 unsigned long fifo_errors; /* FIFO over/under-flows */
536 const struct cphy_ops *ops; /* PHY operations */
537 int (*mdio_read)(adapter_t *adapter, int phy_addr, int mmd_addr,
538 int reg_addr, unsigned int *val);
539 int (*mdio_write)(adapter_t *adapter, int phy_addr, int mmd_addr,
540 int reg_addr, unsigned int val);
541};
542

--- 8 unchanged lines hidden (view full) ---

551 unsigned int val)
552{
553 return phy->mdio_write(phy->adapter, phy->addr, mmd, reg, val);
554}
555
556/* Convenience initializer */
557static inline void cphy_init(struct cphy *phy, adapter_t *adapter,
558 int phy_addr, struct cphy_ops *phy_ops,
558 const struct mdio_ops *mdio_ops)
559 const struct mdio_ops *mdio_ops, unsigned int caps,
560 const char *desc)
559{
560 phy->adapter = adapter;
561 phy->addr = phy_addr;
561{
562 phy->adapter = adapter;
563 phy->addr = phy_addr;
564 phy->caps = caps;
565 phy->desc = desc;
562 phy->ops = phy_ops;
563 if (mdio_ops) {
564 phy->mdio_read = mdio_ops->read;
565 phy->mdio_write = mdio_ops->write;
566 }
567}
568
569/* Accumulate MAC statistics every 180 seconds. For 1G we multiply by 10. */

--- 92 unchanged lines hidden (view full) ---

662int t3_link_start(struct cphy *phy, struct cmac *mac, struct link_config *lc);
663const struct adapter_info *t3_get_adapter_info(unsigned int board_id);
664int t3_seeprom_read(adapter_t *adapter, u32 addr, u32 *data);
665int t3_seeprom_write(adapter_t *adapter, u32 addr, u32 data);
666int t3_seeprom_wp(adapter_t *adapter, int enable);
667int t3_read_flash(adapter_t *adapter, unsigned int addr, unsigned int nwords,
668 u32 *data, int byte_oriented);
669int t3_get_tp_version(adapter_t *adapter, u32 *vers);
566 phy->ops = phy_ops;
567 if (mdio_ops) {
568 phy->mdio_read = mdio_ops->read;
569 phy->mdio_write = mdio_ops->write;
570 }
571}
572
573/* Accumulate MAC statistics every 180 seconds. For 1G we multiply by 10. */

--- 92 unchanged lines hidden (view full) ---

666int t3_link_start(struct cphy *phy, struct cmac *mac, struct link_config *lc);
667const struct adapter_info *t3_get_adapter_info(unsigned int board_id);
668int t3_seeprom_read(adapter_t *adapter, u32 addr, u32 *data);
669int t3_seeprom_write(adapter_t *adapter, u32 addr, u32 data);
670int t3_seeprom_wp(adapter_t *adapter, int enable);
671int t3_read_flash(adapter_t *adapter, unsigned int addr, unsigned int nwords,
672 u32 *data, int byte_oriented);
673int t3_get_tp_version(adapter_t *adapter, u32 *vers);
670int t3_check_tpsram_version(adapter_t *adapter);
674int t3_check_tpsram_version(adapter_t *adapter, int *must_load);
671int t3_check_tpsram(adapter_t *adapter, const u8 *tp_ram, unsigned int size);
672int t3_load_fw(adapter_t *adapter, const const u8 *fw_data, unsigned int size);
675int t3_check_tpsram(adapter_t *adapter, const u8 *tp_ram, unsigned int size);
676int t3_load_fw(adapter_t *adapter, const const u8 *fw_data, unsigned int size);
677int t3_load_boot(adapter_t *adapter, u8 *boot_data, unsigned int size);
673int t3_get_fw_version(adapter_t *adapter, u32 *vers);
678int t3_get_fw_version(adapter_t *adapter, u32 *vers);
674int t3_check_fw_version(adapter_t *adapter);
679int t3_check_fw_version(adapter_t *adapter, int *must_load);
675int t3_init_hw(adapter_t *adapter, u32 fw_params);
676void mac_prep(struct cmac *mac, adapter_t *adapter, int index);
677void early_hw_init(adapter_t *adapter, const struct adapter_info *ai);
678int t3_prep_adapter(adapter_t *adapter, const struct adapter_info *ai, int reset);
679void t3_led_ready(adapter_t *adapter);
680void t3_fatal_err(adapter_t *adapter);
681void t3_set_vlan_accel(adapter_t *adapter, unsigned int ports, int on);
682void t3_enable_filters(adapter_t *adap);

--- 81 unchanged lines hidden (view full) ---

764int t3_elmr_blk_write(adapter_t *adap, int start, const u32 *vals, int n);
765int t3_elmr_blk_read(adapter_t *adap, int start, u32 *vals, int n);
766int t3_vsc7323_init(adapter_t *adap, int nports);
767int t3_vsc7323_set_speed_fc(adapter_t *adap, int speed, int fc, int port);
768int t3_vsc7323_set_mtu(adapter_t *adap, unsigned int mtu, int port);
769int t3_vsc7323_set_addr(adapter_t *adap, u8 addr[6], int port);
770int t3_vsc7323_enable(adapter_t *adap, int port, int which);
771int t3_vsc7323_disable(adapter_t *adap, int port, int which);
680int t3_init_hw(adapter_t *adapter, u32 fw_params);
681void mac_prep(struct cmac *mac, adapter_t *adapter, int index);
682void early_hw_init(adapter_t *adapter, const struct adapter_info *ai);
683int t3_prep_adapter(adapter_t *adapter, const struct adapter_info *ai, int reset);
684void t3_led_ready(adapter_t *adapter);
685void t3_fatal_err(adapter_t *adapter);
686void t3_set_vlan_accel(adapter_t *adapter, unsigned int ports, int on);
687void t3_enable_filters(adapter_t *adap);

--- 81 unchanged lines hidden (view full) ---

769int t3_elmr_blk_write(adapter_t *adap, int start, const u32 *vals, int n);
770int t3_elmr_blk_read(adapter_t *adap, int start, u32 *vals, int n);
771int t3_vsc7323_init(adapter_t *adap, int nports);
772int t3_vsc7323_set_speed_fc(adapter_t *adap, int speed, int fc, int port);
773int t3_vsc7323_set_mtu(adapter_t *adap, unsigned int mtu, int port);
774int t3_vsc7323_set_addr(adapter_t *adap, u8 addr[6], int port);
775int t3_vsc7323_enable(adapter_t *adap, int port, int which);
776int t3_vsc7323_disable(adapter_t *adap, int port, int which);
777
778int t3_phy_advertise_fiber(struct cphy *phy, unsigned int advert);
779
772const struct mac_stats *t3_vsc7323_update_stats(struct cmac *mac);
773
780const struct mac_stats *t3_vsc7323_update_stats(struct cmac *mac);
781
774void t3_mv88e1xxx_phy_prep(struct cphy *phy, adapter_t *adapter, int phy_addr,
782int t3_mv88e1xxx_phy_prep(struct cphy *phy, adapter_t *adapter, int phy_addr,
775 const struct mdio_ops *mdio_ops);
783 const struct mdio_ops *mdio_ops);
776void t3_vsc8211_phy_prep(struct cphy *phy, adapter_t *adapter, int phy_addr,
784int t3_vsc8211_phy_prep(struct cphy *phy, adapter_t *adapter, int phy_addr,
777 const struct mdio_ops *mdio_ops);
785 const struct mdio_ops *mdio_ops);
778void t3_ael1002_phy_prep(struct cphy *phy, adapter_t *adapter, int phy_addr,
786int t3_ael1002_phy_prep(struct cphy *phy, adapter_t *adapter, int phy_addr,
779 const struct mdio_ops *mdio_ops);
787 const struct mdio_ops *mdio_ops);
780void t3_ael1006_phy_prep(struct cphy *phy, adapter_t *adapter, int phy_addr,
788int t3_ael1006_phy_prep(struct cphy *phy, adapter_t *adapter, int phy_addr,
781 const struct mdio_ops *mdio_ops);
789 const struct mdio_ops *mdio_ops);
782void t3_qt2045_phy_prep(struct cphy *phy, adapter_t *adapter, int phy_addr,
790int t3_qt2045_phy_prep(struct cphy *phy, adapter_t *adapter, int phy_addr,
783 const struct mdio_ops *mdio_ops);
791 const struct mdio_ops *mdio_ops);
784void t3_xaui_direct_phy_prep(struct cphy *phy, adapter_t *adapter, int phy_addr,
792int t3_xaui_direct_phy_prep(struct cphy *phy, adapter_t *adapter, int phy_addr,
785 const struct mdio_ops *mdio_ops);
786#endif /* __CHELSIO_COMMON_H */
793 const struct mdio_ops *mdio_ops);
794#endif /* __CHELSIO_COMMON_H */