Here is an extract from the mthca_reset.c 
        /*
         * Reset the chip.  This is somewhat ugly because we have to
         * save off the PCI header before reset and then restore it
         * after the chip reboots.  We skip config space offsets 22
         * and 23 since those have a special meaning.
         *
         * To make matters worse, for Tavor (PCI-X HCA) we have to
         * find the associated bridge device and save off its PCI
         * header as well.
         */

        if (!(mdev->mthca_flags & MTHCA_FLAG_PCIE)) {
                /* Look for the bridge -- its device ID will be 2 more
                   than HCA's device ID. */
                while ((bridge = pci_get_device(mdev->pdev->vendor,
                                                mdev->pdev->device + 2,
                                                bridge)) != NULL) {
                        if (bridge->hdr_type    ==
PCI_HEADER_TYPE_BRIDGE &&
                            bridge->subordinate == mdev->pdev->bus) {
                                mthca_dbg(mdev, "Found bridge: %s\n",
                                          pci_name(bridge));
                                break;
                        }
                }

First,
Why do we check for not PCIE instead of PCIX?
Second, why while instead of if?

Most interesting, third,
Why is bridge device ID 2 more than HCA device ID?
What is this hack rely/depends on?
Can we find a device parent which should be a bridge instead?

Thanks,
Arkady


Arkady Kanevsky                     email: [EMAIL PROTECTED]
Network Appliance Inc.              phone: 781-768-5395
1601 Trapelo Rd. - Suite 16.        Fax: 781-895-1195
Waltham, MA 02451                   central phone: 781-768-5300
_______________________________________________
openib-general mailing list
[email protected]
http://openib.org/mailman/listinfo/openib-general

To unsubscribe, please visit http://openib.org/mailman/listinfo/openib-general

Reply via email to