mpt(4): Fix an issue that caused the driver to attach to mfi(4) cards. v3.0.2
authorSascha Wildner <saw@online.de>
Tue, 20 Mar 2012 20:19:25 +0000 (21:19 +0100)
committerSascha Wildner <saw@online.de>
Tue, 20 Mar 2012 20:20:04 +0000 (21:20 +0100)
commit4aaae533fbf8d54a8ccd50b877095204643887a3
treee0115e0e6adfcce5b702609dea22e889a61ca461
parent11c31dd37634ab6ead36c9d3be598833454355f9
mpt(4): Fix an issue that caused the driver to attach to mfi(4) cards.

FreeBSD's commit message (r232411) explains it:

Fix a problem that was causing the mpt(4) driver to attach to MegaRAID
cards that should be handled by the mfi(4) driver.

The root of the problem is that the mpt(4) driver was masking off the
bottom bit of the PCI device ID when deciding which cards to attach to.

It appears that a number of the mpt(4) Fibre Channel cards had a LAN
variant whose PCI device ID was just one bit off from the FC card's device
ID.  The FC cards were even and the LAN cards were odd.

The problem was that this pattern wasn't carried over on the SAS and
parallel SCSI mpt(4) cards.  Luckily the SAS and parallel SCSI PCI device
IDs were either even numbers, or they would get masked to a supported
adjacent PCI device ID, and everything worked well.

Now LSI is using some of the odd-numbered PCI device IDs between the 3Gb
SAS device IDs for their new MegaRAID cards.  This is causing the mpt(4)
driver to attach to the RAID cards instead of the mfi(4) driver.

The solution is to stop masking off the bottom bit of the device ID, and
explicitly list the PCI device IDs of all supported cards.

This change should be a no-op for mpt(4) hardware.  The only intended
functional change is that for the 929X, the is_fc variable gets set.  It
wasn't being set previously, but needs to be because the 929X is a Fibre
Channel card.
sys/dev/disk/mpt/mpt_pci.c