Deal sensibly with more than 26 sg devices. It isn't a complete

solution.

Sponsored by:   Panasas
MFC after:	1 week
This commit is contained in:
Matt Jacob 2010-05-11 22:22:01 +00:00
parent 98332c8c71
commit cf454e30b6
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=207933

View File

@ -303,7 +303,12 @@ sgregister(struct cam_periph *periph, void *arg)
softc->dev = make_dev(&sg_cdevsw, periph->unit_number,
UID_ROOT, GID_OPERATOR, 0600, "%s%d",
periph->periph_name, periph->unit_number);
(void)make_dev_alias(softc->dev, "sg%c", 'a' + periph->unit_number);
if (periph->unit_number < 26) {
(void)make_dev_alias(softc->dev, "sg%c", periph->unit_number + 'a');
} else {
(void)make_dev_alias(softc->dev, "sg%c%c",
((periph->unit_number / 26) - 1) + 'a', periph->unit_number + 'a');
}
cam_periph_lock(periph);
softc->dev->si_drv1 = periph;