Deleted Added
full compact
cxgb_main.c (184714) cxgb_main.c (185157)
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>
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 184714 2008-11-06 10:17:57Z bz $");
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
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
231enum {
232 MAX_TXQ_ENTRIES = 16384,
233 MAX_CTRL_TXQ_ENTRIES = 1024,
234 MAX_RSPQ_ENTRIES = 16384,
235 MAX_RX_BUFFERS = 16384,
236 MAX_RX_JUMBO_BUFFERS = 16384,
237 MIN_TXQ_ENTRIES = 4,
238 MIN_CTRL_TXQ_ENTRIES = 4,

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

354
355 nports = ai->nports0 + ai->nports1;
356 if (nports == 1)
357 ports = "port";
358 else
359 ports = "ports";
360
361 snprintf(buf, sizeof(buf), "%s %sNIC, rev: %d nports: %d %s",
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",
362 ai->desc, is_offload(sc) ? "R" : "",
363 sc->params.rev, nports, ports);
371 ai->desc, is_offload(sc) ? "R" : "",
372 sc->params.rev, nports, ports);
364 device_set_desc_copy(dev, buf);
365 return (BUS_PROBE_DEFAULT);
366}
367
368#define FW_FNAME "cxgb_t3fw"
369#define TPEEPROM_NAME "t3b_tp_eeprom"
370#define TPSRAM_NAME "t3b_protocol_sram"
371

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

401 struct adapter *sc;
402 int i, error = 0;
403 uint32_t vers;
404 int port_qsets = 1;
405#ifdef MSI_SUPPORTED
406 int msi_needed, reg;
407#endif
408 int must_load = 0;
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
409 sc = device_get_softc(dev);
410 sc->dev = dev;
411 sc->msi_count = 0;
412 ai = cxgb_get_adapter_info(dev);
413
414 /*
415 * XXX not really related but a recent addition
416 */

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

613 error = t3_get_fw_version(sc, &vers);
614 if (error)
615 goto out;
616
617 snprintf(&sc->fw_version[0], sizeof(sc->fw_version), "%d.%d.%d",
618 G_FW_VERSION_MAJOR(vers), G_FW_VERSION_MINOR(vers),
619 G_FW_VERSION_MICRO(vers));
620
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
621 device_printf(sc->dev, "Firmware Version %s\n", &sc->fw_version[0]);
622 callout_reset(&sc->cxgb_tick_ch, CXGB_TICKS(sc), cxgb_tick, sc);
623 t3_add_attach_sysctls(sc);
624out:
625 if (error)
626 cxgb_free(sc);
627
628 return (error);

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

929#ifdef IFNET_MULTIQUEUE
930 ifp->if_flags |= IFF_MULTIQ;
931 ifp->if_mq_start = cxgb_pcpu_start;
932#endif
933#endif
934 ifp->if_timer = 0; /* Disable ifnet watchdog */
935 ifp->if_watchdog = NULL;
936
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
937 ifp->if_snd.ifq_drv_maxlen = IFQ_MAXLEN;
953 ifp->if_snd.ifq_drv_maxlen = cxgb_snd_queue_len;
938 IFQ_SET_MAXLEN(&ifp->if_snd, ifp->if_snd.ifq_drv_maxlen);
939 IFQ_SET_READY(&ifp->if_snd);
940
941 ifp->if_hwassist = ifp->if_capabilities = ifp->if_capenable = 0;
942 ifp->if_capabilities |= CXGB_CAP;
943 ifp->if_capenable |= CXGB_CAP_ENABLE;
944 ifp->if_hwassist |= (CSUM_TCP | CSUM_UDP | CSUM_IP | CSUM_TSO);
945 /*

--- 1886 unchanged lines hidden ---
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 ---