Skip to contentSkip to conversation

SCSI: export sas_hash_addr()

PATCH In review Jeff Garzik 2 participants 7 messages Sep 26, 2007 – Sep 30, 2007

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

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
index 9cd5abe..13c3d21 100644
@@ -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);
#1 lore raw
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

#2 lore raw
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

#3 lore raw
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

#4 lore raw
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 the domain_device (dev field of struct sas_task).

That's the destination. I need it for the source.

Jeff

#5 lore raw
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 the domain_device (dev field of struct sas_task).

That's the destination. I need it for the source.

Nevermind, I found it elsewhere. You can drop this patch.

Jeff

#6 lore raw
In reply to Jeff Garzik
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 the domain_device (dev field of struct sas_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