@@ -2009,7 +2009,7 @@ static struct hpsa_scsi_dev_t *lookup_hpsa_scsi_dev(struct ctlr_info *h,
20092009
20102010static int hpsa_slave_alloc (struct scsi_device * sdev )
20112011{
2012- struct hpsa_scsi_dev_t * sd ;
2012+ struct hpsa_scsi_dev_t * sd = NULL ;
20132013 unsigned long flags ;
20142014 struct ctlr_info * h ;
20152015
@@ -2026,7 +2026,8 @@ static int hpsa_slave_alloc(struct scsi_device *sdev)
20262026 sd -> target = sdev_id (sdev );
20272027 sd -> lun = sdev -> lun ;
20282028 }
2029- } else
2029+ }
2030+ if (!sd )
20302031 sd = lookup_hpsa_scsi_dev (h , sdev_channel (sdev ),
20312032 sdev_id (sdev ), sdev -> lun );
20322033
@@ -3840,6 +3841,7 @@ static int hpsa_update_device_info(struct ctlr_info *h,
38403841 sizeof (this_device -> vendor ));
38413842 memcpy (this_device -> model , & inq_buff [16 ],
38423843 sizeof (this_device -> model ));
3844+ this_device -> rev = inq_buff [2 ];
38433845 memset (this_device -> device_id , 0 ,
38443846 sizeof (this_device -> device_id ));
38453847 if (hpsa_get_device_id (h , scsi3addr , this_device -> device_id , 8 ,
@@ -3929,10 +3931,14 @@ static void figure_bus_target_lun(struct ctlr_info *h,
39293931
39303932 if (!is_logical_dev_addr_mode (lunaddrbytes )) {
39313933 /* physical device, target and lun filled in later */
3932- if (is_hba_lunid (lunaddrbytes ))
3934+ if (is_hba_lunid (lunaddrbytes )) {
3935+ int bus = HPSA_HBA_BUS ;
3936+
3937+ if (!device -> rev )
3938+ bus = HPSA_LEGACY_HBA_BUS ;
39333939 hpsa_set_bus_target_lun (device ,
3934- HPSA_HBA_BUS , 0 , lunid & 0x3fff );
3935- else
3940+ bus , 0 , lunid & 0x3fff );
3941+ } else
39363942 /* defer target, lun assignment for physical devices */
39373943 hpsa_set_bus_target_lun (device ,
39383944 HPSA_PHYSICAL_DEVICE_BUS , -1 , -1 );
0 commit comments