Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 62719
b: refs/heads/master
c: ba1fc17
h: refs/heads/master
i:
  62717: ddc520f
  62715: bfe0530
  62711: 07c8f3f
  62703: 40ff0c6
  62687: 49adc8d
  62655: ab0b4df
  62591: 8e466cf
  62463: 02837fb
v: v3
  • Loading branch information
FUJITA Tomonori authored and James Bottomley committed Jul 18, 2007
1 parent a5e7441 commit 4643896
Show file tree
Hide file tree
Showing 4 changed files with 52 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 7aa68e80bd481faae1234bc2a7e4bcc9348f98b4
refs/heads/master: ba1fc175cc6c0af7e78241e50160344f0f198282
48 changes: 48 additions & 0 deletions trunk/drivers/scsi/libsas/sas_expander.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
*/

#include <linux/scatterlist.h>
#include <linux/blkdev.h>

#include "sas_internal.h"

Expand Down Expand Up @@ -1972,3 +1973,50 @@ static ssize_t smp_portal_read(struct kobject *kobj,
return res;
}
#endif

int sas_smp_handler(struct Scsi_Host *shost, struct sas_rphy *rphy,
struct request *req)
{
struct domain_device *dev;
int ret, type = rphy->identify.device_type;
struct request *rsp = req->next_rq;

if (!rsp) {
printk("%s: space for a smp response is missing\n",
__FUNCTION__);
return -EINVAL;
}

/* seems aic94xx doesn't support */
if (!rphy) {
printk("%s: can we send a smp request to a host?\n",
__FUNCTION__);
return -EINVAL;
}

if (type != SAS_EDGE_EXPANDER_DEVICE &&
type != SAS_FANOUT_EXPANDER_DEVICE) {
printk("%s: can we send a smp request to a device?\n",
__FUNCTION__);
return -EINVAL;
}

dev = sas_find_dev_by_rphy(rphy);
if (!dev) {
printk("%s: fail to find a domain_device?\n", __FUNCTION__);
return -EINVAL;
}

/* do we need to support multiple segments? */
if (req->bio->bi_vcnt > 1 || rsp->bio->bi_vcnt > 1) {
printk("%s: multiple segments req %u %u, rsp %u %u\n",
__FUNCTION__, req->bio->bi_vcnt, req->data_len,
rsp->bio->bi_vcnt, rsp->data_len);
return -EINVAL;
}

ret = smp_execute_task(dev, bio_data(req->bio), req->data_len,
bio_data(rsp->bio), rsp->data_len);

return ret;
}
1 change: 1 addition & 0 deletions trunk/drivers/scsi/libsas/sas_init.c
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,7 @@ static struct sas_function_template sft = {
.phy_reset = sas_phy_reset,
.set_phy_speed = sas_set_phy_speed,
.get_linkerrors = sas_get_linkerrors,
.smp_handler = sas_smp_handler,
};

struct scsi_transport_template *
Expand Down
2 changes: 2 additions & 0 deletions trunk/include/scsi/libsas.h
Original file line number Diff line number Diff line change
Expand Up @@ -674,4 +674,6 @@ extern void sas_target_destroy(struct scsi_target *);
extern int sas_slave_alloc(struct scsi_device *);
extern int sas_ioctl(struct scsi_device *sdev, int cmd, void __user *arg);

extern int sas_smp_handler(struct Scsi_Host *shost, struct sas_rphy *rphy,
struct request *req);
#endif /* _SASLIB_H_ */

0 comments on commit 4643896

Please sign in to comment.