aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/libsas
diff options
context:
space:
mode:
authorFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2007-07-07 05:11:35 -0400
committerJames Bottomley <jejb@mulgrave.localdomain>2007-07-18 12:18:30 -0400
commit08547354c17a50a54906b7936d6ecb05ea39bedd (patch)
treeb03c1cc3058ea5b3659bd078efc6cad9ec7a535b /drivers/scsi/libsas
parentba1fc175cc6c0af7e78241e50160344f0f198282 (diff)
[SCSI] libsas: kill unused smp_portal code
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
Diffstat (limited to 'drivers/scsi/libsas')
-rw-r--r--drivers/scsi/libsas/sas_expander.c106
1 files changed, 0 insertions, 106 deletions
diff --git a/drivers/scsi/libsas/sas_expander.c b/drivers/scsi/libsas/sas_expander.c
index a81195354b9c..eca83e8d8c0d 100644
--- a/drivers/scsi/libsas/sas_expander.c
+++ b/drivers/scsi/libsas/sas_expander.c
@@ -37,14 +37,6 @@ static int sas_configure_phy(struct domain_device *dev, int phy_id,
37 u8 *sas_addr, int include); 37 u8 *sas_addr, int include);
38static int sas_disable_routing(struct domain_device *dev, u8 *sas_addr); 38static int sas_disable_routing(struct domain_device *dev, u8 *sas_addr);
39 39
40#if 0
41/* FIXME: smp needs to migrate into the sas class */
42static ssize_t smp_portal_read(struct kobject *, struct bin_attribute *,
43 char *, loff_t, size_t);
44static ssize_t smp_portal_write(struct kobject *, struct bin_attribute *,
45 char *, loff_t, size_t);
46#endif
47
48/* ---------- SMP task management ---------- */ 40/* ---------- SMP task management ---------- */
49 41
50static void smp_task_timedout(unsigned long _task) 42static void smp_task_timedout(unsigned long _task)
@@ -1415,30 +1407,6 @@ static int sas_disable_routing(struct domain_device *dev, u8 *sas_addr)
1415 return 0; 1407 return 0;
1416} 1408}
1417 1409
1418#if 0
1419#define SMP_BIN_ATTR_NAME "smp_portal"
1420
1421static void sas_ex_smp_hook(struct domain_device *dev)
1422{
1423 struct expander_device *ex_dev = &dev->ex_dev;
1424 struct bin_attribute *bin_attr = &ex_dev->smp_bin_attr;
1425
1426 memset(bin_attr, 0, sizeof(*bin_attr));
1427
1428 bin_attr->attr.name = SMP_BIN_ATTR_NAME;
1429 bin_attr->attr.mode = 0600;
1430
1431 bin_attr->size = 0;
1432 bin_attr->private = NULL;
1433 bin_attr->read = smp_portal_read;
1434 bin_attr->write= smp_portal_write;
1435 bin_attr->mmap = NULL;
1436
1437 ex_dev->smp_portal_pid = -1;
1438 init_MUTEX(&ex_dev->smp_sema);
1439}
1440#endif
1441
1442/** 1410/**
1443 * sas_discover_expander -- expander discovery 1411 * sas_discover_expander -- expander discovery
1444 * @ex: pointer to expander domain device 1412 * @ex: pointer to expander domain device
@@ -1900,80 +1868,6 @@ out:
1900 return res; 1868 return res;
1901} 1869}
1902 1870
1903#if 0
1904/* ---------- SMP portal ---------- */
1905
1906static ssize_t smp_portal_write(struct kobject *kobj,
1907 struct bin_attribute *bin_attr,
1908 char *buf, loff_t offs, size_t size)
1909{
1910 struct domain_device *dev = to_dom_device(kobj);
1911 struct expander_device *ex = &dev->ex_dev;
1912
1913 if (offs != 0)
1914 return -EFBIG;
1915 else if (size == 0)
1916 return 0;
1917
1918 down_interruptible(&ex->smp_sema);
1919 if (ex->smp_req)
1920 kfree(ex->smp_req);
1921 ex->smp_req = kzalloc(size, GFP_USER);
1922 if (!ex->smp_req) {
1923 up(&ex->smp_sema);
1924 return -ENOMEM;
1925 }
1926 memcpy(ex->smp_req, buf, size);
1927 ex->smp_req_size = size;
1928 ex->smp_portal_pid = current->pid;
1929 up(&ex->smp_sema);
1930
1931 return size;
1932}
1933
1934static ssize_t smp_portal_read(struct kobject *kobj,
1935 struct bin_attribute *bin_attr,
1936 char *buf, loff_t offs, size_t size)
1937{
1938 struct domain_device *dev = to_dom_device(kobj);
1939 struct expander_device *ex = &dev->ex_dev;
1940 u8 *smp_resp;
1941 int res = -EINVAL;
1942
1943 /* XXX: sysfs gives us an offset of 0x10 or 0x8 while in fact
1944 * it should be 0.
1945 */
1946
1947 down_interruptible(&ex->smp_sema);
1948 if (!ex->smp_req || ex->smp_portal_pid != current->pid)
1949 goto out;
1950
1951 res = 0;
1952 if (size == 0)
1953 goto out;
1954
1955 res = -ENOMEM;
1956 smp_resp = alloc_smp_resp(size);
1957 if (!smp_resp)
1958 goto out;
1959 res = smp_execute_task(dev, ex->smp_req, ex->smp_req_size,
1960 smp_resp, size);
1961 if (!res) {
1962 memcpy(buf, smp_resp, size);
1963 res = size;
1964 }
1965
1966 kfree(smp_resp);
1967out:
1968 kfree(ex->smp_req);
1969 ex->smp_req = NULL;
1970 ex->smp_req_size = 0;
1971 ex->smp_portal_pid = -1;
1972 up(&ex->smp_sema);
1973 return res;
1974}
1975#endif
1976
1977int sas_smp_handler(struct Scsi_Host *shost, struct sas_rphy *rphy, 1871int sas_smp_handler(struct Scsi_Host *shost, struct sas_rphy *rphy,
1978 struct request *req) 1872 struct request *req)
1979{ 1873{