Counter part of mfi driver commit in mrsas

Switch from make_dev_alias to make_dev_alias_p since make_dev_alias_p can
gracefully fail if the /dev/megaraid_sas_ioctl_node symlink already exists.
This can happen if mfi(4) and mrsas(4) are both attached to cards and
providing Linux emulation support.  Let the first one win.  An equivalent
change has been done in mfi(4).  Extra credit would be to pass the
Linux emulation call to the other driver when appropriate.  This will
probably be a rare case and the user can manually change where the symlink
points to.

MFC after:  3 days
This commit is contained in:
Kashyap D Desai 2015-06-26 12:00:51 +00:00
parent 5b2490f890
commit 2f2163ab40
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=284873
2 changed files with 4 additions and 2 deletions

View File

@ -811,6 +811,7 @@ mrsas_attach(device_t dev)
{
struct mrsas_softc *sc = device_get_softc(dev);
uint32_t cmd, bar, error;
struct cdev *linux_dev;
/* Look up our softc and initialize its fields. */
sc->mrsas_dev = dev;
@ -870,7 +871,8 @@ mrsas_attach(device_t dev)
GID_OPERATOR, (S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP), "mrsas%u",
device_get_unit(dev));
if (device_get_unit(dev) == 0)
make_dev_alias(sc->mrsas_cdev, "megaraid_sas_ioctl_node");
make_dev_alias_p(MAKEDEV_CHECKNAME, &linux_dev, sc->mrsas_cdev,
"megaraid_sas_ioctl_node");
if (sc->mrsas_cdev)
sc->mrsas_cdev->si_drv1 = sc;

View File

@ -102,7 +102,7 @@ __FBSDID("$FreeBSD$");
*/
#define BYTE_ALIGNMENT 1
#define MRSAS_MAX_NAME_LENGTH 32
#define MRSAS_VERSION "06.707.04.03-fbsd"
#define MRSAS_VERSION "06.707.05.00-fbsd"
#define MRSAS_ULONG_MAX 0xFFFFFFFFFFFFFFFF
#define MRSAS_DEFAULT_TIMEOUT 0x14 /* Temporarily set */
#define DONE 0