Deleted Added
full compact
dev.c (273806) dev.c (297124)
1/*
2 * Copyright (c) 2006-2014 Chelsio, Inc. All rights reserved.
3 *
4 * This software is available to you under a choice of one of two
5 * licenses. You may choose to be licensed under the terms of the GNU
6 * General Public License (GPL) Version 2, available from the file
7 * COPYING in the main directory of this source tree, or the
8 * OpenIB.org BSD license below:

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

49
50/*
51 * Macros needed to support the PCI Device ID Table ...
52 */
53#define CH_PCI_DEVICE_ID_TABLE_DEFINE_BEGIN \
54 struct { \
55 unsigned vendor; \
56 unsigned device; \
1/*
2 * Copyright (c) 2006-2014 Chelsio, Inc. All rights reserved.
3 *
4 * This software is available to you under a choice of one of two
5 * licenses. You may choose to be licensed under the terms of the GNU
6 * General Public License (GPL) Version 2, available from the file
7 * COPYING in the main directory of this source tree, or the
8 * OpenIB.org BSD license below:

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

49
50/*
51 * Macros needed to support the PCI Device ID Table ...
52 */
53#define CH_PCI_DEVICE_ID_TABLE_DEFINE_BEGIN \
54 struct { \
55 unsigned vendor; \
56 unsigned device; \
57 unsigned chip_version; \
58 } hca_table[] = {
59
60#define CH_PCI_DEVICE_ID_FUNCTION \
61 0x4
62
63#define CH_PCI_ID_TABLE_ENTRY(__DeviceID) \
64 { \
65 .vendor = PCI_VENDOR_ID_CHELSIO, \
66 .device = (__DeviceID), \
57 } hca_table[] = {
58
59#define CH_PCI_DEVICE_ID_FUNCTION \
60 0x4
61
62#define CH_PCI_ID_TABLE_ENTRY(__DeviceID) \
63 { \
64 .vendor = PCI_VENDOR_ID_CHELSIO, \
65 .device = (__DeviceID), \
67 .chip_version = CHELSIO_PCI_ID_CHIP_VERSION(__DeviceID), \
68 }
69
70#define CH_PCI_DEVICE_ID_TABLE_DEFINE_END \
71 }
72
73#include "t4_chip_type.h"
74#include "t4_pci_id_tbl.h"
75

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

488 if (fw_min < FW_MIN) {
489 PDBG("libcxgb4: non-fatal firmware version mismatch. "
490 "Firmware minor number is %u and libcxgb4 needs %u.\n",
491 fw_maj, FW_MAJ);
492 fflush(stderr);
493 }
494
495 PDBG("%s found vendor %d device %d type %d\n",
66 }
67
68#define CH_PCI_DEVICE_ID_TABLE_DEFINE_END \
69 }
70
71#include "t4_chip_type.h"
72#include "t4_pci_id_tbl.h"
73

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

486 if (fw_min < FW_MIN) {
487 PDBG("libcxgb4: non-fatal firmware version mismatch. "
488 "Firmware minor number is %u and libcxgb4 needs %u.\n",
489 fw_maj, FW_MAJ);
490 fflush(stderr);
491 }
492
493 PDBG("%s found vendor %d device %d type %d\n",
496 __FUNCTION__, vendor, device, hca_table[i].chip_version);
494 __FUNCTION__, vendor, device,
495 CHELSIO_PCI_ID_CHIP_VERSION(hca_table[i].device));
497
498 dev = calloc(1, sizeof *dev);
499 if (!dev) {
500 return NULL;
501 }
502
503 pthread_spin_init(&dev->lock, PTHREAD_PROCESS_PRIVATE);
504 dev->ibv_dev.ops = c4iw_dev_ops;
496
497 dev = calloc(1, sizeof *dev);
498 if (!dev) {
499 return NULL;
500 }
501
502 pthread_spin_init(&dev->lock, PTHREAD_PROCESS_PRIVATE);
503 dev->ibv_dev.ops = c4iw_dev_ops;
505 dev->chip_version = hca_table[i].chip_version;
504 dev->chip_version = CHELSIO_PCI_ID_CHIP_VERSION(hca_table[i].device);
506 dev->abi_version = abi_version;
507
508 PDBG("%s device claimed\n", __FUNCTION__);
509 SLIST_INSERT_HEAD(&devices, dev, list);
510#ifdef STALL_DETECTION
511{
512 char *c = getenv("CXGB4_STALL_TIMEOUT");
513 if (c) {

--- 45 unchanged lines hidden ---
505 dev->abi_version = abi_version;
506
507 PDBG("%s device claimed\n", __FUNCTION__);
508 SLIST_INSERT_HEAD(&devices, dev, list);
509#ifdef STALL_DETECTION
510{
511 char *c = getenv("CXGB4_STALL_TIMEOUT");
512 if (c) {

--- 45 unchanged lines hidden ---