aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/infiniband/hw/nes/nes.c
diff options
context:
space:
mode:
authorChien Tung <ctung@neteffect.com>2008-09-30 17:49:44 -0400
committerRoland Dreier <rolandd@cisco.com>2008-09-30 17:49:44 -0400
commitfcb7ad31beda842804167f0645ca54660713bcd6 (patch)
tree9b8311500887491d74cff655593a102f77db38c1 /drivers/infiniband/hw/nes/nes.c
parent54c86a8c838301e8a619e454b686288578002300 (diff)
RDMA/nes: Add support for 4-port 1G HP blade card
Add support for NetEffect 4 port 1G HP blade card. The mapping between physical port and MAC is different from the standup card. Signed-off-by: Chien Tung <ctung@neteffect.com> Signed-off-by: Roland Dreier <rolandd@cisco.com>
Diffstat (limited to 'drivers/infiniband/hw/nes/nes.c')
-rw-r--r--drivers/infiniband/hw/nes/nes.c29
1 files changed, 24 insertions, 5 deletions
diff --git a/drivers/infiniband/hw/nes/nes.c b/drivers/infiniband/hw/nes/nes.c
index b0cab64e5e3d..a5396850680c 100644
--- a/drivers/infiniband/hw/nes/nes.c
+++ b/drivers/infiniband/hw/nes/nes.c
@@ -562,7 +562,26 @@ static int __devinit nes_probe(struct pci_dev *pcidev, const struct pci_device_i
562 nesdev->nesadapter->pd_config_base[PCI_FUNC(nesdev->pcidev->devfn)]; */ 562 nesdev->nesadapter->pd_config_base[PCI_FUNC(nesdev->pcidev->devfn)]; */
563 nesdev->base_doorbell_index = 1; 563 nesdev->base_doorbell_index = 1;
564 nesdev->doorbell_start = nesdev->nesadapter->doorbell_start; 564 nesdev->doorbell_start = nesdev->nesadapter->doorbell_start;
565 nesdev->mac_index = PCI_FUNC(nesdev->pcidev->devfn) % nesdev->nesadapter->port_count; 565 if (nesdev->nesadapter->phy_type[0] == NES_PHY_TYPE_PUMA_1G) {
566 switch (PCI_FUNC(nesdev->pcidev->devfn) %
567 nesdev->nesadapter->port_count) {
568 case 1:
569 nesdev->mac_index = 2;
570 break;
571 case 2:
572 nesdev->mac_index = 1;
573 break;
574 case 3:
575 nesdev->mac_index = 3;
576 break;
577 case 0:
578 default:
579 nesdev->mac_index = 0;
580 }
581 } else {
582 nesdev->mac_index = PCI_FUNC(nesdev->pcidev->devfn) %
583 nesdev->nesadapter->port_count;
584 }
566 585
567 tasklet_init(&nesdev->dpc_tasklet, nes_dpc, (unsigned long)nesdev); 586 tasklet_init(&nesdev->dpc_tasklet, nes_dpc, (unsigned long)nesdev);
568 587
@@ -581,7 +600,7 @@ static int __devinit nes_probe(struct pci_dev *pcidev, const struct pci_device_i
581 nesdev->int_req = (0x101 << PCI_FUNC(nesdev->pcidev->devfn)) | 600 nesdev->int_req = (0x101 << PCI_FUNC(nesdev->pcidev->devfn)) |
582 (1 << (PCI_FUNC(nesdev->pcidev->devfn)+16)); 601 (1 << (PCI_FUNC(nesdev->pcidev->devfn)+16));
583 if (PCI_FUNC(nesdev->pcidev->devfn) < 4) { 602 if (PCI_FUNC(nesdev->pcidev->devfn) < 4) {
584 nesdev->int_req |= (1 << (PCI_FUNC(nesdev->pcidev->devfn)+24)); 603 nesdev->int_req |= (1 << (PCI_FUNC(nesdev->mac_index)+24));
585 } 604 }
586 605
587 /* TODO: This really should be the first driver to load, not function 0 */ 606 /* TODO: This really should be the first driver to load, not function 0 */
@@ -772,14 +791,14 @@ static ssize_t nes_show_adapter(struct device_driver *ddp, char *buf)
772 791
773 list_for_each_entry(nesdev, &nes_dev_list, list) { 792 list_for_each_entry(nesdev, &nes_dev_list, list) {
774 if (i == ee_flsh_adapter) { 793 if (i == ee_flsh_adapter) {
775 devfn = nesdev->nesadapter->devfn; 794 devfn = nesdev->pcidev->devfn;
776 bus_number = nesdev->nesadapter->bus_number; 795 bus_number = nesdev->pcidev->bus->number;
777 break; 796 break;
778 } 797 }
779 i++; 798 i++;
780 } 799 }
781 800
782 return snprintf(buf, PAGE_SIZE, "%x:%x", bus_number, devfn); 801 return snprintf(buf, PAGE_SIZE, "%x:%x\n", bus_number, devfn);
783} 802}
784 803
785static ssize_t nes_store_adapter(struct device_driver *ddp, 804static ssize_t nes_store_adapter(struct device_driver *ddp,