Browse Source

[golan] Do not assume all devices are identical

Remove the global variable shomron_nodnic_supported, since it may have
different values for different PCI devices.

Originally-fixed-by: Mohammed Taha <mohammedt@mellanox.com>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
tags/v1.20.1
Michael Brown 6 years ago
parent
commit
0778418e29
1 changed files with 2 additions and 5 deletions
  1. 2
    5
      src/drivers/infiniband/golan.c

+ 2
- 5
src/drivers/infiniband/golan.c View File

2586
 	.tx_uar_send_doorbell_fn = shomron_tx_uar_send_db,
2586
 	.tx_uar_send_doorbell_fn = shomron_tx_uar_send_db,
2587
 };
2587
 };
2588
 
2588
 
2589
-static int shomron_nodnic_supported = 0;
2590
-
2591
 static int shomron_nodnic_is_supported ( struct pci_device *pci ) {
2589
 static int shomron_nodnic_is_supported ( struct pci_device *pci ) {
2592
 	if ( DEVICE_IS_CIB ( pci->device ) )
2590
 	if ( DEVICE_IS_CIB ( pci->device ) )
2593
 		return 0;
2591
 		return 0;
2607
 		goto probe_done;
2605
 		goto probe_done;
2608
 	}
2606
 	}
2609
 
2607
 
2610
-	shomron_nodnic_supported = shomron_nodnic_is_supported ( pci );
2611
-	if ( shomron_nodnic_supported ) {
2608
+	if ( shomron_nodnic_is_supported ( pci ) ) {
2612
 		DBG ( "%s: Using NODNIC driver\n", __FUNCTION__ );
2609
 		DBG ( "%s: Using NODNIC driver\n", __FUNCTION__ );
2613
 		rc = flexboot_nodnic_probe ( pci, &shomron_nodnic_callbacks, NULL );
2610
 		rc = flexboot_nodnic_probe ( pci, &shomron_nodnic_callbacks, NULL );
2614
 	} else {
2611
 	} else {
2624
 static void golan_remove ( struct pci_device *pci ) {
2621
 static void golan_remove ( struct pci_device *pci ) {
2625
 	DBG ( "%s: start\n", __FUNCTION__ );
2622
 	DBG ( "%s: start\n", __FUNCTION__ );
2626
 
2623
 
2627
-	if ( ! shomron_nodnic_supported ) {
2624
+	if ( ! shomron_nodnic_is_supported ( pci ) ) {
2628
 		DBG ( "%s: Using normal driver remove\n", __FUNCTION__ );
2625
 		DBG ( "%s: Using normal driver remove\n", __FUNCTION__ );
2629
 		golan_remove_normal ( pci );
2626
 		golan_remove_normal ( pci );
2630
 		return;
2627
 		return;

Loading…
Cancel
Save