SCSI: export sas_hash_addr()
Subsystems (2)
PATCH 1/1 SCSI: export sas_hash_addr()
sas_hash_addr() is the spec-defined standard hashing function. Make it available to drivers that need it.
drivers/scsi/libsas/sas_init.c +1 -0
@@ -314,3 +314,4 @@ module_exit(sas_class_exit);EXPORT_SYMBOL_GPL (sas_register_ha);EXPORT_SYMBOL_GPL (sas_unregister_ha); +EXPORT_SYMBOL_GPL (sas_hash_addr);
Quoted 2 lines · Jeff Garzik
sas_hash_addr()is the spec-defined standard hashing function. Make it available to drivers that need it.
I'm not opposed in principle to exporting this, but I have a hard time understanding why a driver would need it.
The hashed address is a property of the constructed SAS frames, which is done in libsas. The driver shouldn't really be calculating its own hash instead of using what libsas provides ... or is this because the hashed self address isn't calculated by the HBA so it needs to be programmed or something?
James
Quoted 4 lines · James Bottomley
Quoted 2 lines · Jeff Garzik
sas_hash_addr()is the spec-defined standard hashing function. Make it available to drivers that need it.
Quoted 8 lines
I'm not opposed in principle to exporting this, but I have a hard time understanding why a driver would need it.
The hashed address is a property of the constructed SAS frames, which is done in libsas. The driver shouldn't really be calculating its own hash instead of using what libsas provides ... or is this because the hashed self address isn't calculated by the HBA so it needs to be programmed or something?
It is needed to build the SSP frame header.
If there is common code that does that, I will definitely use that, but do not see any such code.
Jeff
Quoted 14 lines · Jeff Garzik
Quoted 4 lines · James Bottomley
Quoted 2 lines · Jeff Garzik
sas_hash_addr()is the spec-defined standard hashing function. Make it available to drivers that need it.Quoted 8 lines
I'm not opposed in principle to exporting this, but I have a hard time understanding why a driver would need it.
The hashed address is a property of the constructed SAS frames, which is done in libsas. The driver shouldn't really be calculating its own hash instead of using what libsas provides ... or is this because the hashed self address isn't calculated by the HBA so it needs to be programmed or something?
Quoted 4 lines
It is needed to build the SSP frame header.
If there is common code that does that, I will definitely use that, but do not see any such code.
The way you're supposed to build the frame header is in lldd_execute_task(). Here, if you need the hashed address of the destination, you copy it out of the domain_device (dev field of struct sas_task).
James
Quoted 13 lines · James Bottomley
Quoted 12 lines · Jeff Garzik
Quoted 11 lines · James Bottomley
Quoted 2 lines · Jeff Garzik
sas_hash_addr()is the spec-defined standard hashing function. Make it available to drivers that need it.I'm not opposed in principle to exporting this, but I have a hard time understanding why a driver would need it.
The hashed address is a property of the constructed SAS frames, which is done in libsas. The driver shouldn't really be calculating its own hash instead of using what libsas provides ... or is this because the hashed self address isn't calculated by the HBA so it needs to be programmed or something?
Quoted 8 lines
Quoted 3 lines
It is needed to build the SSP frame header.
If there is common code that does that, I will definitely use that, but do not see any such code.
The way you're supposed to build the frame header is in
lldd_execute_task(). Here, if you need the hashed address of the destination, you copy it out of thedomain_device(dev field of structsas_task).
That's the destination. I need it for the source.
Jeff
Quoted 16 lines · Jeff Garzik
Quoted 15 lines · James Bottomley
Quoted 14 lines · Jeff Garzik
Quoted 11 lines · James Bottomley
Quoted 2 lines · Jeff Garzik
sas_hash_addr()is the spec-defined standard hashing function. Make it available to drivers that need it.I'm not opposed in principle to exporting this, but I have a hard time understanding why a driver would need it.
The hashed address is a property of the constructed SAS frames, which is done in libsas. The driver shouldn't really be calculating its own hash instead of using what libsas provides ... or is this because the hashed self address isn't calculated by the HBA so it needs to be programmed or something?
It is needed to build the SSP frame header.
Quoted 8 lines
Quoted 6 lines
Quoted 1 line
If there is common code that does that, I will definitely use that, but do not see any such code.
The way you're supposed to build the frame header is in
lldd_execute_task(). Here, if you need the hashed address of the destination, you copy it out of thedomain_device(dev field of structsas_task).That's the destination. I need it for the source.
Nevermind, I found it elsewhere. You can drop this patch.
Jeff
Quoted 19 lines · Jeff Garzik
Quoted 18 lines · James Bottomley
Quoted 16 lines · Jeff Garzik
Quoted 11 lines · James Bottomley
Quoted 2 lines · Jeff Garzik
sas_hash_addr()is the spec-defined standard hashing function. Make it available to drivers that need it.I'm not opposed in principle to exporting this, but I have a hard time understanding why a driver would need it.
The hashed address is a property of the constructed SAS frames, which is done in libsas. The driver shouldn't really be calculating its own hash instead of using what libsas provides ... or is this because the hashed self address isn't calculated by the HBA so it needs to be programmed or something?
It is needed to build the SSP frame header.
If there is common code that does that, I will definitely use that, but do not see any such code.
Quoted 6 lines
Quoted 4 lines
The way you're supposed to build the frame header is in
lldd_execute_task(). Here, if you need the hashed address of the destination, you copy it out of thedomain_device(dev field of structsas_task).That's the destination. I need it for the source.
The source should come from dev->port->ha->hashed_sas_addr ... traditionally it's just your sas_ha_struct that you passed into sas_register_ha. The register function fills in the hashed address and you can pick it out again.
James