adapter.h (309458) | adapter.h (309560) |
---|---|
1/*- 2 * Copyright (c) 2011 Chelsio Communications, Inc. 3 * All rights reserved. 4 * Written by: Navdeep Parhar <np@FreeBSD.org> 5 * 6 * Redistribution and use in source and binary forms, with or without 7 * modification, are permitted provided that the following conditions 8 * are met: --- 10 unchanged lines hidden (view full) --- 19 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 20 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 21 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 22 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 23 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 24 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 25 * SUCH DAMAGE. 26 * | 1/*- 2 * Copyright (c) 2011 Chelsio Communications, Inc. 3 * All rights reserved. 4 * Written by: Navdeep Parhar <np@FreeBSD.org> 5 * 6 * Redistribution and use in source and binary forms, with or without 7 * modification, are permitted provided that the following conditions 8 * are met: --- 10 unchanged lines hidden (view full) --- 19 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 20 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 21 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 22 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 23 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 24 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 25 * SUCH DAMAGE. 26 * |
27 * $FreeBSD: stable/11/sys/dev/cxgbe/adapter.h 309458 2016-12-03 01:04:59Z jhb $ | 27 * $FreeBSD: stable/11/sys/dev/cxgbe/adapter.h 309560 2016-12-05 20:43:25Z jhb $ |
28 * 29 */ 30 31#ifndef __T4_ADAPTER_H__ 32#define __T4_ADAPTER_H__ 33 34#include <sys/kernel.h> 35#include <sys/bus.h> --- 190 unchanged lines hidden (view full) --- 226 227 struct ifnet *ifp; 228 struct ifmedia media; 229 230 unsigned long flags; 231 int if_flags; 232 233 uint16_t *rss, *nm_rss; | 28 * 29 */ 30 31#ifndef __T4_ADAPTER_H__ 32#define __T4_ADAPTER_H__ 33 34#include <sys/kernel.h> 35#include <sys/bus.h> --- 190 unchanged lines hidden (view full) --- 226 227 struct ifnet *ifp; 228 struct ifmedia media; 229 230 unsigned long flags; 231 int if_flags; 232 233 uint16_t *rss, *nm_rss; |
234 int smt_idx; /* for convenience */ |
|
234 uint16_t viid; 235 int16_t xact_addr_filt;/* index of exact MAC address filter */ 236 uint16_t rss_size; /* size of VI's RSS table slice */ 237 uint16_t rss_base; /* start of VI's RSS table slice */ 238 239 eventhandler_tag vlan_c; 240 241 int nintr; --- 505 unchanged lines hidden (view full) --- 747 struct sge_eq **eqmap; /* eq->cntxt_id to eq mapping */ 748 749 int8_t safe_hwidx1; /* may not have room for metadata */ 750 int8_t safe_hwidx2; /* with room for metadata and maybe more */ 751 struct sw_zone_info sw_zone_info[SW_ZONE_SIZES]; 752 struct hw_buf_info hw_buf_info[SGE_FLBUF_SIZES]; 753}; 754 | 235 uint16_t viid; 236 int16_t xact_addr_filt;/* index of exact MAC address filter */ 237 uint16_t rss_size; /* size of VI's RSS table slice */ 238 uint16_t rss_base; /* start of VI's RSS table slice */ 239 240 eventhandler_tag vlan_c; 241 242 int nintr; --- 505 unchanged lines hidden (view full) --- 748 struct sge_eq **eqmap; /* eq->cntxt_id to eq mapping */ 749 750 int8_t safe_hwidx1; /* may not have room for metadata */ 751 int8_t safe_hwidx2; /* with room for metadata and maybe more */ 752 struct sw_zone_info sw_zone_info[SW_ZONE_SIZES]; 753 struct hw_buf_info hw_buf_info[SGE_FLBUF_SIZES]; 754}; 755 |
756struct devnames { 757 const char *nexus_name; 758 const char *ifnet_name; 759 const char *vi_ifnet_name; 760 const char *pf03_drv_name; 761 const char *vf_nexus_name; 762 const char *vf_ifnet_name; 763}; 764 |
|
755struct adapter { 756 SLIST_ENTRY(adapter) link; 757 device_t dev; 758 struct cdev *cdev; | 765struct adapter { 766 SLIST_ENTRY(adapter) link; 767 device_t dev; 768 struct cdev *cdev; |
769 const struct devnames *names; |
|
759 760 /* PCIe register resources */ 761 int regs_rid; 762 struct resource *regs_res; 763 int msix_rid; 764 struct resource *msix_res; 765 bus_space_handle_t bh; 766 bus_space_tag_t bt; --- 63 unchanged lines hidden (view full) --- 830 struct t4_virt_res vres; 831 832 uint16_t nbmcaps; 833 uint16_t linkcaps; 834 uint16_t switchcaps; 835 uint16_t niccaps; 836 uint16_t toecaps; 837 uint16_t rdmacaps; | 770 771 /* PCIe register resources */ 772 int regs_rid; 773 struct resource *regs_res; 774 int msix_rid; 775 struct resource *msix_res; 776 bus_space_handle_t bh; 777 bus_space_tag_t bt; --- 63 unchanged lines hidden (view full) --- 841 struct t4_virt_res vres; 842 843 uint16_t nbmcaps; 844 uint16_t linkcaps; 845 uint16_t switchcaps; 846 uint16_t niccaps; 847 uint16_t toecaps; 848 uint16_t rdmacaps; |
838 uint16_t tlscaps; | 849 uint16_t cryptocaps; |
839 uint16_t iscsicaps; 840 uint16_t fcoecaps; 841 842 struct sysctl_ctx_list ctx; /* from adapter_full_init to full_uninit */ 843 844 struct mtx sc_lock; 845 char lockname[16]; 846 --- 188 unchanged lines hidden (view full) --- 1035static inline bool 1036is_10G_port(const struct port_info *pi) 1037{ 1038 1039 return ((pi->link_cfg.supported & FW_PORT_CAP_SPEED_10G) != 0); 1040} 1041 1042static inline bool | 850 uint16_t iscsicaps; 851 uint16_t fcoecaps; 852 853 struct sysctl_ctx_list ctx; /* from adapter_full_init to full_uninit */ 854 855 struct mtx sc_lock; 856 char lockname[16]; 857 --- 188 unchanged lines hidden (view full) --- 1046static inline bool 1047is_10G_port(const struct port_info *pi) 1048{ 1049 1050 return ((pi->link_cfg.supported & FW_PORT_CAP_SPEED_10G) != 0); 1051} 1052 1053static inline bool |
1054is_25G_port(const struct port_info *pi) 1055{ 1056 1057 return ((pi->link_cfg.supported & FW_PORT_CAP_SPEED_25G) != 0); 1058} 1059 1060static inline bool |
|
1043is_40G_port(const struct port_info *pi) 1044{ 1045 1046 return ((pi->link_cfg.supported & FW_PORT_CAP_SPEED_40G) != 0); 1047} 1048 | 1061is_40G_port(const struct port_info *pi) 1062{ 1063 1064 return ((pi->link_cfg.supported & FW_PORT_CAP_SPEED_40G) != 0); 1065} 1066 |
1067static inline bool 1068is_100G_port(const struct port_info *pi) 1069{ 1070 1071 return ((pi->link_cfg.supported & FW_PORT_CAP_SPEED_100G) != 0); 1072} 1073 |
|
1049static inline int 1050port_top_speed(const struct port_info *pi) 1051{ 1052 1053 if (pi->link_cfg.supported & FW_PORT_CAP_SPEED_100G) 1054 return (100); 1055 if (pi->link_cfg.supported & FW_PORT_CAP_SPEED_40G) 1056 return (40); | 1074static inline int 1075port_top_speed(const struct port_info *pi) 1076{ 1077 1078 if (pi->link_cfg.supported & FW_PORT_CAP_SPEED_100G) 1079 return (100); 1080 if (pi->link_cfg.supported & FW_PORT_CAP_SPEED_40G) 1081 return (40); |
1082 if (pi->link_cfg.supported & FW_PORT_CAP_SPEED_25G) 1083 return (25); |
|
1057 if (pi->link_cfg.supported & FW_PORT_CAP_SPEED_10G) 1058 return (10); 1059 if (pi->link_cfg.supported & FW_PORT_CAP_SPEED_1G) 1060 return (1); 1061 1062 return (0); 1063} 1064 --- 31 unchanged lines hidden (view full) --- 1096extern device_method_t cxgbe_methods[]; 1097 1098int t4_os_find_pci_capability(struct adapter *, int); 1099int t4_os_pci_save_state(struct adapter *); 1100int t4_os_pci_restore_state(struct adapter *); 1101void t4_os_portmod_changed(const struct adapter *, int); 1102void t4_os_link_changed(struct adapter *, int, int, int); 1103void t4_iterate(void (*)(struct adapter *, void *), void *); | 1084 if (pi->link_cfg.supported & FW_PORT_CAP_SPEED_10G) 1085 return (10); 1086 if (pi->link_cfg.supported & FW_PORT_CAP_SPEED_1G) 1087 return (1); 1088 1089 return (0); 1090} 1091 --- 31 unchanged lines hidden (view full) --- 1123extern device_method_t cxgbe_methods[]; 1124 1125int t4_os_find_pci_capability(struct adapter *, int); 1126int t4_os_pci_save_state(struct adapter *); 1127int t4_os_pci_restore_state(struct adapter *); 1128void t4_os_portmod_changed(const struct adapter *, int); 1129void t4_os_link_changed(struct adapter *, int, int, int); 1130void t4_iterate(void (*)(struct adapter *, void *), void *); |
1131void t4_init_devnames(struct adapter *); |
|
1104void t4_add_adapter(struct adapter *); 1105int t4_detach_common(device_t); 1106int t4_filter_rpl(struct sge_iq *, const struct rss_header *, struct mbuf *); 1107int t4_map_bars_0_and_4(struct adapter *); 1108int t4_map_bar_2(struct adapter *); 1109int t4_set_sched_class(struct adapter *, struct t4_sched_params *); 1110int t4_set_sched_queue(struct adapter *, struct t4_sched_queue *); 1111int t4_setup_intr_handlers(struct adapter *); --- 96 unchanged lines hidden --- | 1132void t4_add_adapter(struct adapter *); 1133int t4_detach_common(device_t); 1134int t4_filter_rpl(struct sge_iq *, const struct rss_header *, struct mbuf *); 1135int t4_map_bars_0_and_4(struct adapter *); 1136int t4_map_bar_2(struct adapter *); 1137int t4_set_sched_class(struct adapter *, struct t4_sched_params *); 1138int t4_set_sched_queue(struct adapter *, struct t4_sched_queue *); 1139int t4_setup_intr_handlers(struct adapter *); --- 96 unchanged lines hidden --- |