sdcard: Prepare virtio sdcard
authorSeokYeon Hwang <syeon.hwang@samsung.com>
Mon, 15 Apr 2013 13:58:58 +0000 (22:58 +0900)
committerSeokYeon Hwang <syeon.hwang@samsung.com>
Tue, 21 May 2013 05:05:52 +0000 (14:05 +0900)
For higher performance and mount support by Tizen system framework.

Change-Id: I05878ec01983c7dda65975f3135ebcf05442d788
Signed-off-by: SeokYeon Hwang <syeon.hwang@samsung.com>
drivers/block/virtio_blk.c
drivers/virtio/virtio.c

index 0d39f2f4294a3c2587e5c019e39904b3f8440fc2..257cd2884dbe1d6358687cb0691cbd9b68d20b8c 100644 (file)
@@ -471,7 +471,16 @@ static int __devinit virtblk_probe(struct virtio_device *vdev)
 
        q->queuedata = vblk;
 
+#ifdef CONFIG_MARU // for virtio sdcard...
+       if (index == 2) {
+               snprintf(vblk->disk->disk_name, DISK_NAME_LEN, "mmcblk0");
+       }
+       else {
+               virtblk_name_format("vd", index, vblk->disk->disk_name, DISK_NAME_LEN);
+       }
+#else
        virtblk_name_format("vd", index, vblk->disk->disk_name, DISK_NAME_LEN);
+#endif
 
        vblk->disk->major = major;
        vblk->disk->first_minor = index_to_minor(index);
index 984c501c258ffa8bc6f7ad1ad14be741494ba5ee..ba9979af7158a656bb6e2cb37986f164161d45ff 100644 (file)
@@ -47,12 +47,30 @@ static ssize_t features_show(struct device *_d,
        len += sprintf(buf+len, "\n");
        return len;
 }
+
+#ifdef CONFIG_MARU // for virtio sdcard...
+#include "linux/virtio_ids.h"
+static ssize_t type_show(struct device *_d,
+                            struct device_attribute *attr, char *buf)
+{
+       struct virtio_device *dev = container_of(_d, struct virtio_device, dev);
+
+    if (dev->id.device == VIRTIO_ID_BLOCK) {
+        //FIXME
+        return sprintf(buf, "SD\n");
+    }
+    return sprintf(buf, "0\n");
+}
+#endif
 static struct device_attribute virtio_dev_attrs[] = {
        __ATTR_RO(device),
        __ATTR_RO(vendor),
        __ATTR_RO(status),
        __ATTR_RO(modalias),
        __ATTR_RO(features),
+#ifdef CONFIG_MARU
+    __ATTR_RO(type),
+#endif
        __ATTR_NULL
 };