diff options
author | Ron Mercer <ron.mercer@qlogic.com> | 2009-06-09 01:39:32 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-06-10 04:04:14 -0400 |
commit | e4552f51ceefcf51b79c5bf8dafc7abb4bb7657d (patch) | |
tree | e151217b00245847863e64f09286bc1d2735d7de /drivers/net/qlge/qlge.h | |
parent | 542512e4824c1cecc05478f279dccbde1d8bf97a (diff) |
qlge: Add support for varied pcie function numbers.
Currently we support only PCIe NIC functions zero and one, and FCoE
functions as 3 and 4. Future configurations can mix these up in any
fashion.
This patch removes the 0-1 dependancy and allows usage of any of the 4
functions. We also find the alternate NIC function (if exist) and
determine our port number based on the comparison of the two functions:
Lower function number gets first port, higher function gets second port.
Signed-off-by: Ron Mercer <ron.mercer@qlogic.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/qlge/qlge.h')
-rw-r--r-- | drivers/net/qlge/qlge.h | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/drivers/net/qlge/qlge.h b/drivers/net/qlge/qlge.h index 258ef449ea88..5eb52ca08980 100644 --- a/drivers/net/qlge/qlge.h +++ b/drivers/net/qlge/qlge.h | |||
@@ -65,6 +65,17 @@ | |||
65 | 65 | ||
66 | #define DB_PAGE_SIZE 4096 | 66 | #define DB_PAGE_SIZE 4096 |
67 | 67 | ||
68 | /* MPI test register definitions. This register | ||
69 | * is used for determining alternate NIC function's | ||
70 | * PCI->func number. | ||
71 | */ | ||
72 | enum { | ||
73 | MPI_TEST_FUNC_PORT_CFG = 0x1002, | ||
74 | MPI_TEST_NIC1_FUNC_SHIFT = 1, | ||
75 | MPI_TEST_NIC2_FUNC_SHIFT = 5, | ||
76 | MPI_TEST_NIC_FUNC_MASK = 0x00000007, | ||
77 | }; | ||
78 | |||
68 | /* | 79 | /* |
69 | * Processor Address Register (PROC_ADDR) bit definitions. | 80 | * Processor Address Register (PROC_ADDR) bit definitions. |
70 | */ | 81 | */ |
@@ -1432,6 +1443,8 @@ struct ql_adapter { | |||
1432 | u32 chip_rev_id; | 1443 | u32 chip_rev_id; |
1433 | u32 fw_rev_id; | 1444 | u32 fw_rev_id; |
1434 | u32 func; /* PCI function for this adapter */ | 1445 | u32 func; /* PCI function for this adapter */ |
1446 | u32 alt_func; /* PCI function for alternate adapter */ | ||
1447 | u32 port; /* Port number this adapter */ | ||
1435 | 1448 | ||
1436 | spinlock_t adapter_lock; | 1449 | spinlock_t adapter_lock; |
1437 | spinlock_t hw_lock; | 1450 | spinlock_t hw_lock; |
@@ -1581,6 +1594,7 @@ void ql_mpi_idc_work(struct work_struct *work); | |||
1581 | void ql_mpi_port_cfg_work(struct work_struct *work); | 1594 | void ql_mpi_port_cfg_work(struct work_struct *work); |
1582 | int ql_mb_get_fw_state(struct ql_adapter *qdev); | 1595 | int ql_mb_get_fw_state(struct ql_adapter *qdev); |
1583 | int ql_cam_route_initialize(struct ql_adapter *qdev); | 1596 | int ql_cam_route_initialize(struct ql_adapter *qdev); |
1597 | int ql_read_mpi_reg(struct ql_adapter *qdev, u32 reg, u32 *data); | ||
1584 | int ql_mb_about_fw(struct ql_adapter *qdev); | 1598 | int ql_mb_about_fw(struct ql_adapter *qdev); |
1585 | 1599 | ||
1586 | #if 1 | 1600 | #if 1 |