1/*- 2 * Copyright (C) 2012 Emulex 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions are met: 7 * 8 * 1. Redistributions of source code must retain the above copyright notice, --- 22 unchanged lines hidden (view full) --- 31 * Contact Information: 32 * freebsd-drivers@emulex.com 33 * 34 * Emulex 35 * 3333 Susan Street 36 * Costa Mesa, CA 92626 37 */ 38 |
39/* $FreeBSD: head/sys/dev/oce/oce_if.h 231879 2012-02-17 13:55:17Z luigi $ */ |
40 |
41#include <sys/param.h> 42#include <sys/endian.h> 43#include <sys/module.h> 44#include <sys/kernel.h> 45#include <sys/bus.h> 46#include <sys/mbuf.h> 47#include <sys/rman.h> 48#include <sys/socket.h> --- 33 unchanged lines hidden (view full) --- 82#include <netinet/tcp.h> 83#include <netinet/sctp.h> 84#include <netinet/tcp_lro.h> 85 86#include <machine/bus.h> 87 88#include "oce_hw.h" 89 |
90/* OCE device driver module component revision informaiton */ 91#define COMPONENT_REVISION "4.2.127.0" |
92 |
93 |
94/* OCE devices supported by this driver */ 95#define PCI_VENDOR_EMULEX 0x10df /* Emulex */ 96#define PCI_VENDOR_SERVERENGINES 0x19a2 /* ServerEngines (BE) */ 97#define PCI_PRODUCT_BE2 0x0700 /* BE2 network adapter */ 98#define PCI_PRODUCT_BE3 0x0710 /* BE3 network adapter */ 99#define PCI_PRODUCT_XE201 0xe220 /* XE201 network adapter */ 100#define PCI_PRODUCT_XE201_VF 0xe228 /* XE201 with VF in Lancer */ 101 --- 5 unchanged lines hidden (view full) --- 107 108/* proportion Service Level Interface queues */ 109#define OCE_MAX_UNITS 2 110#define OCE_MAX_PPORT OCE_MAX_UNITS 111#define OCE_MAX_VPORT OCE_MAX_UNITS 112 113extern int mp_ncpus; /* system's total active cpu cores */ 114#define OCE_NCPUS mp_ncpus |
115 116/* This should be powers of 2. Like 2,4,8 & 16 */ 117#define OCE_MAX_RSS 4 /* TODO: 8*/ |
118#define OCE_LEGACY_MODE_RSS 4 /* For BE3 Legacy mode*/ 119 120#define OCE_MIN_RQ 1 121#define OCE_MIN_WQ 1 122 123#define OCE_MAX_RQ OCE_MAX_RSS + 1 /* one default queue */ 124#define OCE_MAX_WQ 8 125 --- 43 unchanged lines hidden (view full) --- 169/* Interface capabilities to enable by default (others set dynamically) */ 170#define OCE_CAPAB_ENABLE (MBX_RX_IFACE_FLAGS_BROADCAST | \ 171 MBX_RX_IFACE_FLAGS_UNTAGGED | \ 172 MBX_RX_IFACE_FLAGS_PASS_L3L4_ERR) 173 174#define OCE_IF_HWASSIST (CSUM_IP | CSUM_TCP | CSUM_UDP) 175#define OCE_IF_CAPABILITIES (IFCAP_VLAN_MTU | IFCAP_VLAN_HWTAGGING | \ 176 IFCAP_HWCSUM | IFCAP_VLAN_HWCSUM | \ |
177 IFCAP_JUMBO_MTU | IFCAP_VLAN_MTU) |
178#define OCE_IF_HWASSIST_NONE 0 179#define OCE_IF_CAPABILITIES_NONE 0 180 181 182#define ETH_ADDR_LEN 6 183#define MAX_VLANFILTER_SIZE 64 184#define MAX_VLANS 4096 185 --- 646 unchanged lines hidden (view full) --- 832 eventhandler_tag vlan_detach; 833 uint16_t vlans_added; 834 uint8_t vlan_tag[MAX_VLANS]; 835 /*stats */ 836 OCE_DMA_MEM stats_mem; 837 struct oce_drv_stats oce_stats_info; 838 struct callout timer; 839 int8_t be3_native; |
840 uint32_t pvid; |
841 842} OCE_SOFTC, *POCE_SOFTC; 843 844 845 846/************************************************** 847 * BUS memory read/write macros 848 * BE3: accesses three BAR spaces (CFG, CSR, DB) --- 75 unchanged lines hidden (view full) --- 924void oce_drain_rq_cq(struct oce_rq *rq); 925void oce_drain_wq_cq(struct oce_wq *wq); 926 927uint32_t oce_page_list(oce_ring_buffer_t *ring, struct phys_addr *pa_list); 928 929/*********************************************************** 930 * cleanup functions 931 ***********************************************************/ |
932void oce_stop_rx(POCE_SOFTC sc); 933void oce_intr_free(POCE_SOFTC sc); 934void oce_free_posted_rxbuf(struct oce_rq *rq); |
935#if defined(INET6) || defined(INET) 936void oce_free_lro(POCE_SOFTC sc); 937#endif |
938 939 940/************************************************************ 941 * Mailbox functions 942 ************************************************************/ 943int oce_fw_clean(POCE_SOFTC sc); 944int oce_reset_fun(POCE_SOFTC sc); 945int oce_mbox_init(POCE_SOFTC sc); 946int oce_mbox_dispatch(POCE_SOFTC sc, uint32_t tmo_sec); 947int oce_get_fw_version(POCE_SOFTC sc); |
948int oce_first_mcc_cmd(POCE_SOFTC sc); 949 |
950int oce_read_mac_addr(POCE_SOFTC sc, uint32_t if_id, uint8_t perm, 951 uint8_t type, struct mac_address_format *mac); 952int oce_get_fw_config(POCE_SOFTC sc); 953int oce_if_create(POCE_SOFTC sc, uint32_t cap_flags, uint32_t en_flags, 954 uint16_t vlan_tag, uint8_t *mac_addr, uint32_t *if_id); 955int oce_if_del(POCE_SOFTC sc, uint32_t if_id); 956int oce_config_vlan(POCE_SOFTC sc, uint32_t if_id, 957 struct normal_vlan *vtag_arr, uint8_t vtag_cnt, --- 121 unchanged lines hidden --- |