Print this page
4431 igb support for I354
4616 igb has uninitialized kstats


   8  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
   9  * or http://www.opensolaris.org/os/licensing.
  10  * See the License for the specific language governing permissions
  11  * and limitations under the License.
  12  *
  13  * When distributing Covered Code, include this CDDL HEADER in each
  14  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  15  * If applicable, add the following below this CDDL HEADER, with the
  16  * fields enclosed by brackets "[]" replaced with your own identifying
  17  * information: Portions Copyright [yyyy] [name of copyright owner]
  18  *
  19  * CDDL HEADER END
  20  */
  21 
  22 /*
  23  * Copyright(c) 2007-2010 Intel Corporation. All rights reserved.
  24  */
  25 
  26 /*
  27  * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.

  28  */
  29 
  30 #ifndef _IGB_SW_H
  31 #define _IGB_SW_H
  32 
  33 #ifdef __cplusplus
  34 extern "C" {
  35 #endif
  36 
  37 #include <sys/types.h>
  38 #include <sys/conf.h>
  39 #include <sys/debug.h>
  40 #include <sys/stropts.h>
  41 #include <sys/stream.h>
  42 #include <sys/strsun.h>
  43 #include <sys/strlog.h>
  44 #include <sys/kmem.h>
  45 #include <sys/stat.h>
  46 #include <sys/kstat.h>
  47 #include <sys/modctl.h>


 631         kmutex_t                rx_pending_lock;
 632 
 633         boolean_t               watchdog_enable;
 634         boolean_t               watchdog_start;
 635         timeout_id_t            watchdog_tid;
 636 
 637         boolean_t               unicst_init;
 638         uint32_t                unicst_avail;
 639         uint32_t                unicst_total;
 640         igb_ether_addr_t        unicst_addr[MAX_NUM_UNICAST_ADDRESSES];
 641         uint32_t                mcast_count;
 642         uint32_t                mcast_alloc_count;
 643         uint32_t                mcast_max_num;
 644         struct ether_addr       *mcast_table;
 645 
 646         /*
 647          * Kstat definitions
 648          */
 649         kstat_t                 *igb_ks;
 650 




























 651         uint32_t                param_en_1000fdx_cap:1,
 652                                 param_en_1000hdx_cap:1,
 653                                 param_en_100t4_cap:1,
 654                                 param_en_100fdx_cap:1,
 655                                 param_en_100hdx_cap:1,
 656                                 param_en_10fdx_cap:1,
 657                                 param_en_10hdx_cap:1,
 658                                 param_1000fdx_cap:1,
 659                                 param_1000hdx_cap:1,
 660                                 param_100t4_cap:1,
 661                                 param_100fdx_cap:1,
 662                                 param_100hdx_cap:1,
 663                                 param_10fdx_cap:1,
 664                                 param_10hdx_cap:1,
 665                                 param_autoneg_cap:1,
 666                                 param_pause_cap:1,
 667                                 param_asym_pause_cap:1,
 668                                 param_rem_fault:1,
 669                                 param_adv_1000fdx_cap:1,
 670                                 param_adv_1000hdx_cap:1,


 684         uint32_t                param_lp_100fdx_cap:1,
 685                                 param_lp_100hdx_cap:1,
 686                                 param_lp_10fdx_cap:1,
 687                                 param_lp_10hdx_cap:1,
 688                                 param_lp_autoneg_cap:1,
 689                                 param_lp_pause_cap:1,
 690                                 param_lp_asym_pause_cap:1,
 691                                 param_lp_rem_fault:1,
 692                                 param_pad_to_32:24;
 693 
 694         /*
 695          * FMA capabilities
 696          */
 697         int                     fm_capabilities;
 698 
 699         ulong_t                 page_size;
 700 } igb_t;
 701 
 702 typedef struct igb_stat {
 703 
 704         kstat_named_t link_speed;       /* Link Speed */
 705         kstat_named_t reset_count;      /* Reset Count */
 706         kstat_named_t dout_sync;        /* DMA out of sync */
 707 #ifdef IGB_DEBUG
 708         kstat_named_t rx_frame_error;   /* Rx Error in Packet */
 709         kstat_named_t rx_cksum_error;   /* Rx Checksum Error */
 710         kstat_named_t rx_exceed_pkt;    /* Rx Exceed Max Pkt Count */
 711 
 712         kstat_named_t tx_overload;      /* Tx Desc Ring Overload */
 713         kstat_named_t tx_fail_no_tcb;   /* Tx Fail Freelist Empty */
 714         kstat_named_t tx_fail_no_tbd;   /* Tx Fail Desc Ring Empty */
 715         kstat_named_t tx_fail_dma_bind; /* Tx Fail DMA bind */
 716         kstat_named_t tx_reschedule;    /* Tx Reschedule */
 717 
 718         kstat_named_t gprc;     /* Good Packets Received Count */
 719         kstat_named_t gptc;     /* Good Packets Xmitted Count */
 720         kstat_named_t gor;      /* Good Octets Received Count */
 721         kstat_named_t got;      /* Good Octets Xmitd Count */
 722         kstat_named_t prc64;    /* Packets Received - 64b */
 723         kstat_named_t prc127;   /* Packets Received - 65-127b */
 724         kstat_named_t prc255;   /* Packets Received - 127-255b */
 725         kstat_named_t prc511;   /* Packets Received - 256-511b */
 726         kstat_named_t prc1023;  /* Packets Received - 511-1023b */
 727         kstat_named_t prc1522;  /* Packets Received - 1024-1522b */
 728         kstat_named_t ptc64;    /* Packets Xmitted (64b) */
 729         kstat_named_t ptc127;   /* Packets Xmitted (64-127b) */
 730         kstat_named_t ptc255;   /* Packets Xmitted (128-255b) */
 731         kstat_named_t ptc511;   /* Packets Xmitted (255-511b) */
 732         kstat_named_t ptc1023;  /* Packets Xmitted (512-1023b) */
 733         kstat_named_t ptc1522;  /* Packets Xmitted (1024-1522b */
 734 #endif
 735         kstat_named_t crcerrs;  /* CRC Error Count */
 736         kstat_named_t symerrs;  /* Symbol Error Count */
 737         kstat_named_t mpc;      /* Missed Packet Count */
 738         kstat_named_t scc;      /* Single Collision Count */
 739         kstat_named_t ecol;     /* Excessive Collision Count */
 740         kstat_named_t mcc;      /* Multiple Collision Count */
 741         kstat_named_t latecol;  /* Late Collision Count */
 742         kstat_named_t colc;     /* Collision Count */
 743         kstat_named_t dc;       /* Defer Count */
 744         kstat_named_t sec;      /* Sequence Error Count */
 745         kstat_named_t rlec;     /* Receive Length Error Count */
 746         kstat_named_t xonrxc;   /* XON Received Count */
 747         kstat_named_t xontxc;   /* XON Xmitted Count */
 748         kstat_named_t xoffrxc;  /* XOFF Received Count */
 749         kstat_named_t xofftxc;  /* Xoff Xmitted Count */
 750         kstat_named_t fcruc;    /* Unknown Flow Conrol Packet Rcvd Count */
 751         kstat_named_t bprc;     /* Broadcasts Pkts Received Count */
 752         kstat_named_t mprc;     /* Multicast Pkts Received Count */
 753         kstat_named_t rnbc;     /* Receive No Buffers Count */
 754         kstat_named_t ruc;      /* Receive Undersize Count */
 755         kstat_named_t rfc;      /* Receive Frag Count */
 756         kstat_named_t roc;      /* Receive Oversize Count */
 757         kstat_named_t rjc;      /* Receive Jabber Count */
 758         kstat_named_t tor;      /* Total Octets Recvd Count */
 759         kstat_named_t tot;      /* Total Octets Xmted Count */
 760         kstat_named_t tpr;      /* Total Packets Received */
 761         kstat_named_t tpt;      /* Total Packets Xmitted */
 762         kstat_named_t mptc;     /* Multicast Packets Xmited Count */
 763         kstat_named_t bptc;     /* Broadcast Packets Xmited Count */
 764         kstat_named_t algnerrc; /* Alignment Error count */
 765         kstat_named_t rxerrc;   /* Rx Error Count */
 766         kstat_named_t tncrs;    /* Transmit with no CRS */
 767         kstat_named_t cexterr;  /* Carrier Extension Error count */
 768         kstat_named_t tsctc;    /* TCP seg contexts xmit count */
 769         kstat_named_t tsctfc;   /* TCP seg contexts xmit fail count */
 770 } igb_stat_t;
 771 
 772 /*
 773  * Function prototypes in e1000_osdep.c
 774  */
 775 void e1000_write_pci_cfg(struct e1000_hw *, uint32_t, uint16_t *);
 776 void e1000_read_pci_cfg(struct e1000_hw *, uint32_t, uint16_t *);
 777 int32_t e1000_read_pcie_cap_reg(struct e1000_hw *, uint32_t, uint16_t *);
 778 int32_t e1000_write_pcie_cap_reg(struct e1000_hw *, uint32_t, uint16_t *);
 779 void e1000_rar_clear(struct e1000_hw *, uint32_t);
 780 void e1000_rar_set_vmdq(struct e1000_hw *, const uint8_t *, uint32_t,
 781     uint32_t, uint8_t);
 782 
 783 /*
 784  * Function prototypes in igb_buf.c
 785  */
 786 int igb_alloc_dma(igb_t *);
 787 void igb_free_dma(igb_t *);




   8  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
   9  * or http://www.opensolaris.org/os/licensing.
  10  * See the License for the specific language governing permissions
  11  * and limitations under the License.
  12  *
  13  * When distributing Covered Code, include this CDDL HEADER in each
  14  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  15  * If applicable, add the following below this CDDL HEADER, with the
  16  * fields enclosed by brackets "[]" replaced with your own identifying
  17  * information: Portions Copyright [yyyy] [name of copyright owner]
  18  *
  19  * CDDL HEADER END
  20  */
  21 
  22 /*
  23  * Copyright(c) 2007-2010 Intel Corporation. All rights reserved.
  24  */
  25 
  26 /*
  27  * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
  28  * Copyright 2014 Pluribus Networks Inc. 
  29  */
  30 
  31 #ifndef _IGB_SW_H
  32 #define _IGB_SW_H
  33 
  34 #ifdef __cplusplus
  35 extern "C" {
  36 #endif
  37 
  38 #include <sys/types.h>
  39 #include <sys/conf.h>
  40 #include <sys/debug.h>
  41 #include <sys/stropts.h>
  42 #include <sys/stream.h>
  43 #include <sys/strsun.h>
  44 #include <sys/strlog.h>
  45 #include <sys/kmem.h>
  46 #include <sys/stat.h>
  47 #include <sys/kstat.h>
  48 #include <sys/modctl.h>


 632         kmutex_t                rx_pending_lock;
 633 
 634         boolean_t               watchdog_enable;
 635         boolean_t               watchdog_start;
 636         timeout_id_t            watchdog_tid;
 637 
 638         boolean_t               unicst_init;
 639         uint32_t                unicst_avail;
 640         uint32_t                unicst_total;
 641         igb_ether_addr_t        unicst_addr[MAX_NUM_UNICAST_ADDRESSES];
 642         uint32_t                mcast_count;
 643         uint32_t                mcast_alloc_count;
 644         uint32_t                mcast_max_num;
 645         struct ether_addr       *mcast_table;
 646 
 647         /*
 648          * Kstat definitions
 649          */
 650         kstat_t                 *igb_ks;
 651 
 652         /*
 653          * Backing store for MAC stats.  These are reported via GLDv3, instead of
 654          * via our private kstat structure.
 655          */
 656         uint64_t                stat_tor;       /* rbytes */
 657         uint64_t                stat_tpr;       /* rpackets */
 658         uint64_t                stat_tot;       /* obytes */
 659         uint64_t                stat_tpt;       /* opackets */
 660         uint64_t                stat_colc;      /* collisions */
 661         uint64_t                stat_mcc;       /* multi colls */
 662         uint64_t                stat_scc;       /* single colls */
 663         uint64_t                stat_ecol;      /* excessive colls */
 664         uint64_t                stat_latecol;   /* late colls */
 665         uint64_t                stat_bptc;      /* xmit bcast */
 666         uint64_t                stat_mptc;      /* xmit bcast */
 667         uint64_t                stat_bprc;      /* recv bcast */
 668         uint64_t                stat_mprc;      /* recv mcast */
 669         uint64_t                stat_rnbc;      /* recv nobuf */
 670         uint64_t                stat_roc;       /* recv toolong */
 671         uint64_t                stat_sec;       /* sqe errors */
 672         uint64_t                stat_dc;        /* defer */
 673         uint64_t                stat_algnerrc;  /* align errors */
 674         uint64_t                stat_crcerrs;   /* crc errors */
 675         uint64_t                stat_cexterr;   /* carrier extension errors */
 676         uint64_t                stat_ruc;       /* recv tooshort */
 677         uint64_t                stat_rjc;       /* recv jabber */
 678         uint64_t                stat_rxerrc;    /* recv errors */
 679 
 680         uint32_t                param_en_1000fdx_cap:1,
 681                                 param_en_1000hdx_cap:1,
 682                                 param_en_100t4_cap:1,
 683                                 param_en_100fdx_cap:1,
 684                                 param_en_100hdx_cap:1,
 685                                 param_en_10fdx_cap:1,
 686                                 param_en_10hdx_cap:1,
 687                                 param_1000fdx_cap:1,
 688                                 param_1000hdx_cap:1,
 689                                 param_100t4_cap:1,
 690                                 param_100fdx_cap:1,
 691                                 param_100hdx_cap:1,
 692                                 param_10fdx_cap:1,
 693                                 param_10hdx_cap:1,
 694                                 param_autoneg_cap:1,
 695                                 param_pause_cap:1,
 696                                 param_asym_pause_cap:1,
 697                                 param_rem_fault:1,
 698                                 param_adv_1000fdx_cap:1,
 699                                 param_adv_1000hdx_cap:1,


 713         uint32_t                param_lp_100fdx_cap:1,
 714                                 param_lp_100hdx_cap:1,
 715                                 param_lp_10fdx_cap:1,
 716                                 param_lp_10hdx_cap:1,
 717                                 param_lp_autoneg_cap:1,
 718                                 param_lp_pause_cap:1,
 719                                 param_lp_asym_pause_cap:1,
 720                                 param_lp_rem_fault:1,
 721                                 param_pad_to_32:24;
 722 
 723         /*
 724          * FMA capabilities
 725          */
 726         int                     fm_capabilities;
 727 
 728         ulong_t                 page_size;
 729 } igb_t;
 730 
 731 typedef struct igb_stat {
 732 

 733         kstat_named_t reset_count;      /* Reset Count */
 734         kstat_named_t dout_sync;        /* DMA out of sync */
 735 #ifdef IGB_DEBUG
 736         kstat_named_t rx_frame_error;   /* Rx Error in Packet */
 737         kstat_named_t rx_cksum_error;   /* Rx Checksum Error */
 738         kstat_named_t rx_exceed_pkt;    /* Rx Exceed Max Pkt Count */
 739 
 740         kstat_named_t tx_overload;      /* Tx Desc Ring Overload */
 741         kstat_named_t tx_fail_no_tcb;   /* Tx Fail Freelist Empty */
 742         kstat_named_t tx_fail_no_tbd;   /* Tx Fail Desc Ring Empty */
 743         kstat_named_t tx_fail_dma_bind; /* Tx Fail DMA bind */
 744         kstat_named_t tx_reschedule;    /* Tx Reschedule */
 745 
 746         kstat_named_t gprc;     /* Good Packets Received Count */
 747         kstat_named_t gptc;     /* Good Packets Xmitted Count */
 748         kstat_named_t gor;      /* Good Octets Received Count */
 749         kstat_named_t got;      /* Good Octets Xmitd Count */
 750         kstat_named_t prc64;    /* Packets Received - 64b */
 751         kstat_named_t prc127;   /* Packets Received - 65-127b */
 752         kstat_named_t prc255;   /* Packets Received - 127-255b */
 753         kstat_named_t prc511;   /* Packets Received - 256-511b */
 754         kstat_named_t prc1023;  /* Packets Received - 511-1023b */
 755         kstat_named_t prc1522;  /* Packets Received - 1024-1522b */
 756         kstat_named_t ptc64;    /* Packets Xmitted (64b) */
 757         kstat_named_t ptc127;   /* Packets Xmitted (64-127b) */
 758         kstat_named_t ptc255;   /* Packets Xmitted (128-255b) */
 759         kstat_named_t ptc511;   /* Packets Xmitted (255-511b) */
 760         kstat_named_t ptc1023;  /* Packets Xmitted (512-1023b) */
 761         kstat_named_t ptc1522;  /* Packets Xmitted (1024-1522b */
 762 #endif

 763         kstat_named_t symerrs;  /* Symbol Error Count */
 764         kstat_named_t mpc;      /* Missed Packet Count */







 765         kstat_named_t rlec;     /* Receive Length Error Count */
 766         kstat_named_t xonrxc;   /* XON Received Count */
 767         kstat_named_t xontxc;   /* XON Xmitted Count */
 768         kstat_named_t xoffrxc;  /* XOFF Received Count */
 769         kstat_named_t xofftxc;  /* Xoff Xmitted Count */
 770         kstat_named_t fcruc;    /* Unknown Flow Conrol Packet Rcvd Count */




 771         kstat_named_t rfc;      /* Receive Frag Count */










 772         kstat_named_t tncrs;    /* Transmit with no CRS */

 773         kstat_named_t tsctc;    /* TCP seg contexts xmit count */
 774         kstat_named_t tsctfc;   /* TCP seg contexts xmit fail count */
 775 } igb_stat_t;
 776 
 777 /*
 778  * Function prototypes in e1000_osdep.c
 779  */
 780 void e1000_write_pci_cfg(struct e1000_hw *, uint32_t, uint16_t *);
 781 void e1000_read_pci_cfg(struct e1000_hw *, uint32_t, uint16_t *);
 782 int32_t e1000_read_pcie_cap_reg(struct e1000_hw *, uint32_t, uint16_t *);
 783 int32_t e1000_write_pcie_cap_reg(struct e1000_hw *, uint32_t, uint16_t *);
 784 void e1000_rar_clear(struct e1000_hw *, uint32_t);
 785 void e1000_rar_set_vmdq(struct e1000_hw *, const uint8_t *, uint32_t,
 786     uint32_t, uint8_t);
 787 
 788 /*
 789  * Function prototypes in igb_buf.c
 790  */
 791 int igb_alloc_dma(igb_t *);
 792 void igb_free_dma(igb_t *);