From 5c4f2fb9eee1f6c778efbc62efc58535609bca6c Mon Sep 17 00:00:00 2001 From: Sathya Perla Date: Tue, 6 Nov 2012 17:48:57 +0000 Subject: be2net: do not use sli_family to identify skyhawk-R chip SKYHAWK_FAMILY will not identify all revisions of the chip. Use device-id check (skyhawk_chip() macro) instead. Signed-off-by: Sathya Perla Signed-off-by: David S. Miller --- drivers/net/ethernet/emulex/benet/be_roce.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers/net/ethernet/emulex/benet/be_roce.c') diff --git a/drivers/net/ethernet/emulex/benet/be_roce.c b/drivers/net/ethernet/emulex/benet/be_roce.c index deecc44b3617..866900e88df9 100644 --- a/drivers/net/ethernet/emulex/benet/be_roce.c +++ b/drivers/net/ethernet/emulex/benet/be_roce.c @@ -47,7 +47,7 @@ static void _be_roce_dev_add(struct be_adapter *adapter) dev_info.dpp_unmapped_len = 0; } dev_info.pdev = adapter->pdev; - if (adapter->sli_family == SKYHAWK_SLI_FAMILY) + if (skyhawk_chip(adapter)) dev_info.db = adapter->db; else dev_info.db = adapter->roce_db.base; -- cgit v1.2.3 From dbf0f2a7998363bb89bd26a5f8579d1f58b58715 Mon Sep 17 00:00:00 2001 From: Sathya Perla Date: Tue, 6 Nov 2012 17:49:00 +0000 Subject: be2net: remove roce on lancer roce interface is suppored only on Skyhawk-R. Signed-off-by: Sathya Perla Signed-off-by: David S. Miller --- drivers/net/ethernet/emulex/benet/be.h | 12 ++---------- drivers/net/ethernet/emulex/benet/be_main.c | 16 +--------------- drivers/net/ethernet/emulex/benet/be_roce.c | 5 +---- 3 files changed, 4 insertions(+), 29 deletions(-) (limited to 'drivers/net/ethernet/emulex/benet/be_roce.c') diff --git a/drivers/net/ethernet/emulex/benet/be.h b/drivers/net/ethernet/emulex/benet/be.h index e391d5aa6eaa..472d98ea48e7 100644 --- a/drivers/net/ethernet/emulex/benet/be.h +++ b/drivers/net/ethernet/emulex/benet/be.h @@ -411,7 +411,6 @@ struct be_adapter { bool stats_cmd_sent; u32 if_type; struct { - u8 __iomem *base; /* Door Bell */ u32 size; u32 total_size; u64 io_addr; @@ -473,9 +472,8 @@ struct be_adapter { #define BEx_chip(adapter) (BE3_chip(adapter) || BE2_chip(adapter)) -#define be_roce_supported(adapter) ((adapter->if_type == SLI_INTF_TYPE_3 || \ - skyhawk_chip(adapter)) && \ - (adapter->function_mode & RDMA_ENABLED)) +#define be_roce_supported(adapter) (skyhawk_chip(adapter) && \ + (adapter->function_mode & RDMA_ENABLED)) extern const struct ethtool_ops be_ethtool_ops; @@ -650,12 +648,6 @@ static inline bool be_is_wol_excluded(struct be_adapter *adapter) } } -static inline bool be_type_2_3(struct be_adapter *adapter) -{ - return (adapter->if_type == SLI_INTF_TYPE_2 || - adapter->if_type == SLI_INTF_TYPE_3) ? true : false; -} - extern void be_cq_notify(struct be_adapter *adapter, u16 qid, bool arm, u16 num_popped); extern void be_link_status_update(struct be_adapter *adapter, u8 link_status); diff --git a/drivers/net/ethernet/emulex/benet/be_main.c b/drivers/net/ethernet/emulex/benet/be_main.c index 5c475cc333a4..b2c72b88af6d 100644 --- a/drivers/net/ethernet/emulex/benet/be_main.c +++ b/drivers/net/ethernet/emulex/benet/be_main.c @@ -3621,8 +3621,6 @@ static void be_unmap_pci_bars(struct be_adapter *adapter) { if (adapter->db) pci_iounmap(adapter->pdev, adapter->db); - if (adapter->roce_db.base) - pci_iounmap(adapter->pdev, adapter->roce_db.base); } static int db_bar(struct be_adapter *adapter) @@ -3635,19 +3633,7 @@ static int db_bar(struct be_adapter *adapter) static int be_roce_map_pci_bars(struct be_adapter *adapter) { - struct pci_dev *pdev = adapter->pdev; - u8 __iomem *addr; - - if (lancer_chip(adapter) && adapter->if_type == SLI_INTF_TYPE_3) { - addr = pci_iomap(pdev, 2, 0); - if (addr == NULL) - return -ENOMEM; - - adapter->roce_db.base = addr; - adapter->roce_db.io_addr = pci_resource_start(pdev, 2); - adapter->roce_db.size = 8192; - adapter->roce_db.total_size = pci_resource_len(pdev, 2); - } else if (skyhawk_chip(adapter)) { + if (skyhawk_chip(adapter)) { adapter->roce_db.size = 4096; adapter->roce_db.io_addr = pci_resource_start(adapter->pdev, db_bar(adapter)); diff --git a/drivers/net/ethernet/emulex/benet/be_roce.c b/drivers/net/ethernet/emulex/benet/be_roce.c index 866900e88df9..55d32aa0a093 100644 --- a/drivers/net/ethernet/emulex/benet/be_roce.c +++ b/drivers/net/ethernet/emulex/benet/be_roce.c @@ -47,10 +47,7 @@ static void _be_roce_dev_add(struct be_adapter *adapter) dev_info.dpp_unmapped_len = 0; } dev_info.pdev = adapter->pdev; - if (skyhawk_chip(adapter)) - dev_info.db = adapter->db; - else - dev_info.db = adapter->roce_db.base; + dev_info.db = adapter->db; dev_info.unmapped_db = adapter->roce_db.io_addr; dev_info.db_page_size = adapter->roce_db.size; dev_info.db_total_size = adapter->roce_db.total_size; -- cgit v1.2.3