aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/block/cciss.c24
1 files changed, 13 insertions, 11 deletions
diff --git a/drivers/block/cciss.c b/drivers/block/cciss.c
index 8bbb1c81bf86..e716fc9e4b3e 100644
--- a/drivers/block/cciss.c
+++ b/drivers/block/cciss.c
@@ -1333,6 +1333,18 @@ static int cciss_setnodename(ctlr_info_t *h, void __user *argp)
1333 return 0; 1333 return 0;
1334} 1334}
1335 1335
1336static int cciss_getheartbeat(ctlr_info_t *h, void __user *argp)
1337{
1338 Heartbeat_type heartbeat;
1339
1340 if (!argp)
1341 return -EINVAL;
1342 heartbeat = readl(&h->cfgtable->HeartBeat);
1343 if (copy_to_user(argp, &heartbeat, sizeof(Heartbeat_type)))
1344 return -EFAULT;
1345 return 0;
1346}
1347
1336static int cciss_ioctl(struct block_device *bdev, fmode_t mode, 1348static int cciss_ioctl(struct block_device *bdev, fmode_t mode,
1337 unsigned int cmd, unsigned long arg) 1349 unsigned int cmd, unsigned long arg)
1338{ 1350{
@@ -1355,17 +1367,7 @@ static int cciss_ioctl(struct block_device *bdev, fmode_t mode,
1355 case CCISS_SETNODENAME: 1367 case CCISS_SETNODENAME:
1356 return cciss_setnodename(h, argp); 1368 return cciss_setnodename(h, argp);
1357 case CCISS_GETHEARTBEAT: 1369 case CCISS_GETHEARTBEAT:
1358 { 1370 return cciss_getheartbeat(h, argp);
1359 Heartbeat_type heartbeat;
1360
1361 if (!arg)
1362 return -EINVAL;
1363 heartbeat = readl(&h->cfgtable->HeartBeat);
1364 if (copy_to_user
1365 (argp, &heartbeat, sizeof(Heartbeat_type)))
1366 return -EFAULT;
1367 return 0;
1368 }
1369 case CCISS_GETBUSTYPES: 1371 case CCISS_GETBUSTYPES:
1370 { 1372 {
1371 BusTypes_type BusTypes; 1373 BusTypes_type BusTypes;