1/************************************************************************** 2 3Copyright (c) 2007-2008, 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 --- 14 unchanged lines hidden (view full) --- 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***************************************************************************/ 29 30#include <sys/cdefs.h> |
31__FBSDID("$FreeBSD: head/sys/dev/cxgb/cxgb_main.c 185157 2008-11-21 19:22:25Z gnn $"); |
32 33#include <sys/param.h> 34#include <sys/systm.h> 35#include <sys/kernel.h> 36#include <sys/bus.h> 37#include <sys/module.h> 38#include <sys/pciio.h> 39#include <sys/conf.h> --- 183 unchanged lines hidden (view full) --- 223SYSCTL_UINT(_hw_cxgb, OID_AUTO, force_fw_update, CTLFLAG_RDTUN, &force_fw_update, 0, 224 "update firmware even if up to date"); 225 226int cxgb_use_16k_clusters = 1; 227TUNABLE_INT("hw.cxgb.use_16k_clusters", &cxgb_use_16k_clusters); 228SYSCTL_UINT(_hw_cxgb, OID_AUTO, use_16k_clusters, CTLFLAG_RDTUN, 229 &cxgb_use_16k_clusters, 0, "use 16kB clusters for the jumbo queue "); 230 |
231/* 232 * Tune the size of the output queue. 233 */ 234int cxgb_snd_queue_len = IFQ_MAXLEN; 235TUNABLE_INT("hw.cxgb.snd_queue_len", &cxgb_snd_queue_len); 236SYSCTL_UINT(_hw_cxgb, OID_AUTO, snd_queue_len, CTLFLAG_RDTUN, 237 &cxgb_snd_queue_len, 0, "send queue size "); 238 239 |
240enum { 241 MAX_TXQ_ENTRIES = 16384, 242 MAX_CTRL_TXQ_ENTRIES = 1024, 243 MAX_RSPQ_ENTRIES = 16384, 244 MAX_RX_BUFFERS = 16384, 245 MAX_RX_JUMBO_BUFFERS = 16384, 246 MIN_TXQ_ENTRIES = 4, 247 MIN_CTRL_TXQ_ENTRIES = 4, --- 115 unchanged lines hidden (view full) --- 363 364 nports = ai->nports0 + ai->nports1; 365 if (nports == 1) 366 ports = "port"; 367 else 368 ports = "ports"; 369 370 snprintf(buf, sizeof(buf), "%s %sNIC, rev: %d nports: %d %s", |
371 ai->desc, is_offload(sc) ? "R" : "", 372 sc->params.rev, nports, ports); |
373 device_set_desc_copy(dev, buf); 374 return (BUS_PROBE_DEFAULT); 375} 376 377#define FW_FNAME "cxgb_t3fw" 378#define TPEEPROM_NAME "t3b_tp_eeprom" 379#define TPSRAM_NAME "t3b_protocol_sram" 380 --- 29 unchanged lines hidden (view full) --- 410 struct adapter *sc; 411 int i, error = 0; 412 uint32_t vers; 413 int port_qsets = 1; 414#ifdef MSI_SUPPORTED 415 int msi_needed, reg; 416#endif 417 int must_load = 0; |
418 char buf[80]; 419 |
420 sc = device_get_softc(dev); 421 sc->dev = dev; 422 sc->msi_count = 0; 423 ai = cxgb_get_adapter_info(dev); 424 425 /* 426 * XXX not really related but a recent addition 427 */ --- 196 unchanged lines hidden (view full) --- 624 error = t3_get_fw_version(sc, &vers); 625 if (error) 626 goto out; 627 628 snprintf(&sc->fw_version[0], sizeof(sc->fw_version), "%d.%d.%d", 629 G_FW_VERSION_MAJOR(vers), G_FW_VERSION_MINOR(vers), 630 G_FW_VERSION_MICRO(vers)); 631 |
632 snprintf(buf, sizeof(buf), "%s\t E/C: %s S/N: %s", 633 ai->desc, 634 sc->params.vpd.ec, sc->params.vpd.sn); 635 device_set_desc_copy(dev, buf); 636 |
637 device_printf(sc->dev, "Firmware Version %s\n", &sc->fw_version[0]); 638 callout_reset(&sc->cxgb_tick_ch, CXGB_TICKS(sc), cxgb_tick, sc); 639 t3_add_attach_sysctls(sc); 640out: 641 if (error) 642 cxgb_free(sc); 643 644 return (error); --- 300 unchanged lines hidden (view full) --- 945#ifdef IFNET_MULTIQUEUE 946 ifp->if_flags |= IFF_MULTIQ; 947 ifp->if_mq_start = cxgb_pcpu_start; 948#endif 949#endif 950 ifp->if_timer = 0; /* Disable ifnet watchdog */ 951 ifp->if_watchdog = NULL; 952 |
953 ifp->if_snd.ifq_drv_maxlen = cxgb_snd_queue_len; |
954 IFQ_SET_MAXLEN(&ifp->if_snd, ifp->if_snd.ifq_drv_maxlen); 955 IFQ_SET_READY(&ifp->if_snd); 956 957 ifp->if_hwassist = ifp->if_capabilities = ifp->if_capenable = 0; 958 ifp->if_capabilities |= CXGB_CAP; 959 ifp->if_capenable |= CXGB_CAP_ENABLE; 960 ifp->if_hwassist |= (CSUM_TCP | CSUM_UDP | CSUM_IP | CSUM_TSO); 961 /* --- 1886 unchanged lines hidden --- |