Subject: [PATCH 13/15] ps3disk: Use region flags

From: Andre Heider <[email-masked]>
Date: Mon, 1 Aug 2011 22:03:04 +0200

Provide a set of default region flags and make them overwritable via
a module parameter array.
Set PS3_STORAGE_FLAG_SKIP_ACL for region 0, so it can be accessed
from the GameOS lpar.

Signed-off-by: Andre Heider <[email-masked]>
---
 drivers/block/ps3disk.c |   16 ++++++++++++++++
 1 files changed, 16 insertions(+), 0 deletions(-)

diff --git a/drivers/block/ps3disk.c b/drivers/block/ps3disk.c
index 30dae10..483806e 100644
--- a/drivers/block/ps3disk.c
+++ b/drivers/block/ps3disk.c
@@ -39,6 +39,19 @@
 #define PS3DISK_NAME		"ps3d%c%c"

+static unsigned int region_flags[] = {
+	PS3_STORAGE_FLAG_SKIP_ACL,		/* raw disk */
+	PS3_STORAGE_FLAG_DEFAULT,		/* core os */
+	PS3_STORAGE_FLAG_DEFAULT,		/* gameos pup */
+	PS3_STORAGE_FLAG_DEFAULT,		/* n/a */
+	PS3_STORAGE_FLAG_DEFAULT,		/* n/a */
+	PS3_STORAGE_FLAG_DEFAULT,		/* n/a */
+	PS3_STORAGE_FLAG_DEFAULT,		/* n/a */
+	PS3_STORAGE_FLAG_DEFAULT,		/* n/a */
+};
+module_param_array(region_flags, uint, NULL, S_IRUGO);
+MODULE_PARM_DESC(region_flags, "Region flags");
+
 struct ps3disk_private {
 	spinlock_t lock;		/* Request queue spinlock */
 	struct request_queue *queue;
@@ -453,6 +466,9 @@ static int __devinit ps3disk_probe(struct ps3_system_bus_device *_dev)
 		goto fail_free_priv;
 	}
 
+	for (region_idx = 0; region_idx < dev->num_regions; region_idx++)
+		dev->regions[region_idx].flags = region_flags[region_idx];
+
 	error = ps3stor_setup(dev, ps3disk_interrupt);
 	if (error)
 		goto fail_free_bounce;
-- 
1.7.5.4