aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/block/cciss.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/block/cciss.c')
-rw-r--r--drivers/block/cciss.c27
1 files changed, 15 insertions, 12 deletions
diff --git a/drivers/block/cciss.c b/drivers/block/cciss.c
index e7b650b7f548..c47e601f601c 100644
--- a/drivers/block/cciss.c
+++ b/drivers/block/cciss.c
@@ -1357,6 +1357,20 @@ static int cciss_getbustypes(ctlr_info_t *h, void __user *argp)
1357 return 0; 1357 return 0;
1358} 1358}
1359 1359
1360static int cciss_getfirmver(ctlr_info_t *h, void __user *argp)
1361{
1362 FirmwareVer_type firmware;
1363
1364 if (!argp)
1365 return -EINVAL;
1366 memcpy(firmware, h->firm_ver, 4);
1367
1368 if (copy_to_user
1369 (argp, firmware, sizeof(FirmwareVer_type)))
1370 return -EFAULT;
1371 return 0;
1372}
1373
1360static int cciss_ioctl(struct block_device *bdev, fmode_t mode, 1374static int cciss_ioctl(struct block_device *bdev, fmode_t mode,
1361 unsigned int cmd, unsigned long arg) 1375 unsigned int cmd, unsigned long arg)
1362{ 1376{
@@ -1383,18 +1397,7 @@ static int cciss_ioctl(struct block_device *bdev, fmode_t mode,
1383 case CCISS_GETBUSTYPES: 1397 case CCISS_GETBUSTYPES:
1384 return cciss_getbustypes(h, argp); 1398 return cciss_getbustypes(h, argp);
1385 case CCISS_GETFIRMVER: 1399 case CCISS_GETFIRMVER:
1386 { 1400 return cciss_getfirmver(h, argp);
1387 FirmwareVer_type firmware;
1388
1389 if (!arg)
1390 return -EINVAL;
1391 memcpy(firmware, h->firm_ver, 4);
1392
1393 if (copy_to_user
1394 (argp, firmware, sizeof(FirmwareVer_type)))
1395 return -EFAULT;
1396 return 0;
1397 }
1398 case CCISS_GETDRIVVER: 1401 case CCISS_GETDRIVVER:
1399 { 1402 {
1400 DriverVer_type DriverVer = DRIVER_VERSION; 1403 DriverVer_type DriverVer = DRIVER_VERSION;