hpsa.c (138125f74b254fd2e37b3d875faf8e0e8608299b) hpsa.c (cb17c1b69b175e3f7ae2ef53e384889cdbae5c0d)
1/*
2 * Disk Array driver for HP Smart Array SAS controllers
3 * Copyright 2016 Microsemi Corporation
4 * Copyright 2014-2015 PMC-Sierra, Inc.
5 * Copyright 2000,2009-2015 Hewlett-Packard Development Company, L.P.
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by

--- 6605 unchanged lines hidden (view full) ---

6614 return -EAGAIN;
6615 rc = hpsa_passthru_ioctl(h, &iocommand);
6616 atomic_inc(&h->passthru_cmds_avail);
6617 if (!rc && copy_to_user(argp, &iocommand, sizeof(iocommand)))
6618 rc = -EFAULT;
6619 return rc;
6620 }
6621 case CCISS_BIG_PASSTHRU: {
1/*
2 * Disk Array driver for HP Smart Array SAS controllers
3 * Copyright 2016 Microsemi Corporation
4 * Copyright 2014-2015 PMC-Sierra, Inc.
5 * Copyright 2000,2009-2015 Hewlett-Packard Development Company, L.P.
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by

--- 6605 unchanged lines hidden (view full) ---

6614 return -EAGAIN;
6615 rc = hpsa_passthru_ioctl(h, &iocommand);
6616 atomic_inc(&h->passthru_cmds_avail);
6617 if (!rc && copy_to_user(argp, &iocommand, sizeof(iocommand)))
6618 rc = -EFAULT;
6619 return rc;
6620 }
6621 case CCISS_BIG_PASSTHRU: {
6622 BIG_IOCTL_Command_struct *ioc;
6622 BIG_IOCTL_Command_struct ioc;
6623 if (!argp)
6624 return -EINVAL;
6623 if (!argp)
6624 return -EINVAL;
6625 if (copy_from_user(&ioc, argp, sizeof(ioc)))
6626 return -EFAULT;
6625 if (atomic_dec_if_positive(&h->passthru_cmds_avail) < 0)
6626 return -EAGAIN;
6627 if (atomic_dec_if_positive(&h->passthru_cmds_avail) < 0)
6628 return -EAGAIN;
6627 ioc = vmemdup_user(argp, sizeof(*ioc));
6628 if (IS_ERR(ioc)) {
6629 atomic_inc(&h->passthru_cmds_avail);
6630 return PTR_ERR(ioc);
6631 }
6632 rc = hpsa_big_passthru_ioctl(h, ioc);
6629 rc = hpsa_big_passthru_ioctl(h, &ioc);
6633 atomic_inc(&h->passthru_cmds_avail);
6630 atomic_inc(&h->passthru_cmds_avail);
6634 if (!rc && copy_to_user(argp, ioc, sizeof(*ioc)))
6631 if (!rc && copy_to_user(argp, &ioc, sizeof(ioc)))
6635 rc = -EFAULT;
6632 rc = -EFAULT;
6636 kvfree(ioc);
6637 return rc;
6638 }
6639 default:
6640 return -ENOTTY;
6641 }
6642}
6643
6644static void hpsa_send_host_reset(struct ctlr_info *h, u8 reset_type)

--- 3353 unchanged lines hidden ---
6633 return rc;
6634 }
6635 default:
6636 return -ENOTTY;
6637 }
6638}
6639
6640static void hpsa_send_host_reset(struct ctlr_info *h, u8 reset_type)

--- 3353 unchanged lines hidden ---