|
@@ -2159,6 +2159,8 @@ static int cxgb_extension_ioctl(struct net_device *dev, void __user *useraddr)
|
|
return -EPERM;
|
|
return -EPERM;
|
|
if (copy_from_user(&t, useraddr, sizeof(t)))
|
|
if (copy_from_user(&t, useraddr, sizeof(t)))
|
|
return -EFAULT;
|
|
return -EFAULT;
|
|
|
|
+ if (t.cmd != CHELSIO_SET_QSET_PARAMS)
|
|
|
|
+ return -EINVAL;
|
|
if (t.qset_idx >= SGE_QSETS)
|
|
if (t.qset_idx >= SGE_QSETS)
|
|
return -EINVAL;
|
|
return -EINVAL;
|
|
if (!in_range(t.intr_lat, 0, M_NEWTIMER) ||
|
|
if (!in_range(t.intr_lat, 0, M_NEWTIMER) ||
|
|
@@ -2258,6 +2260,9 @@ static int cxgb_extension_ioctl(struct net_device *dev, void __user *useraddr)
|
|
if (copy_from_user(&t, useraddr, sizeof(t)))
|
|
if (copy_from_user(&t, useraddr, sizeof(t)))
|
|
return -EFAULT;
|
|
return -EFAULT;
|
|
|
|
|
|
|
|
+ if (t.cmd != CHELSIO_GET_QSET_PARAMS)
|
|
|
|
+ return -EINVAL;
|
|
|
|
+
|
|
/* Display qsets for all ports when offload enabled */
|
|
/* Display qsets for all ports when offload enabled */
|
|
if (test_bit(OFFLOAD_DEVMAP_BIT, &adapter->open_device_map)) {
|
|
if (test_bit(OFFLOAD_DEVMAP_BIT, &adapter->open_device_map)) {
|
|
q1 = 0;
|
|
q1 = 0;
|
|
@@ -2303,6 +2308,8 @@ static int cxgb_extension_ioctl(struct net_device *dev, void __user *useraddr)
|
|
return -EBUSY;
|
|
return -EBUSY;
|
|
if (copy_from_user(&edata, useraddr, sizeof(edata)))
|
|
if (copy_from_user(&edata, useraddr, sizeof(edata)))
|
|
return -EFAULT;
|
|
return -EFAULT;
|
|
|
|
+ if (edata.cmd != CHELSIO_SET_QSET_NUM)
|
|
|
|
+ return -EINVAL;
|
|
if (edata.val < 1 ||
|
|
if (edata.val < 1 ||
|
|
(edata.val > 1 && !(adapter->flags & USING_MSIX)))
|
|
(edata.val > 1 && !(adapter->flags & USING_MSIX)))
|
|
return -EINVAL;
|
|
return -EINVAL;
|
|
@@ -2343,6 +2350,8 @@ static int cxgb_extension_ioctl(struct net_device *dev, void __user *useraddr)
|
|
return -EPERM;
|
|
return -EPERM;
|
|
if (copy_from_user(&t, useraddr, sizeof(t)))
|
|
if (copy_from_user(&t, useraddr, sizeof(t)))
|
|
return -EFAULT;
|
|
return -EFAULT;
|
|
|
|
+ if (t.cmd != CHELSIO_LOAD_FW)
|
|
|
|
+ return -EINVAL;
|
|
/* Check t.len sanity ? */
|
|
/* Check t.len sanity ? */
|
|
fw_data = memdup_user(useraddr + sizeof(t), t.len);
|
|
fw_data = memdup_user(useraddr + sizeof(t), t.len);
|
|
if (IS_ERR(fw_data))
|
|
if (IS_ERR(fw_data))
|
|
@@ -2366,6 +2375,8 @@ static int cxgb_extension_ioctl(struct net_device *dev, void __user *useraddr)
|
|
return -EBUSY;
|
|
return -EBUSY;
|
|
if (copy_from_user(&m, useraddr, sizeof(m)))
|
|
if (copy_from_user(&m, useraddr, sizeof(m)))
|
|
return -EFAULT;
|
|
return -EFAULT;
|
|
|
|
+ if (m.cmd != CHELSIO_SETMTUTAB)
|
|
|
|
+ return -EINVAL;
|
|
if (m.nmtus != NMTUS)
|
|
if (m.nmtus != NMTUS)
|
|
return -EINVAL;
|
|
return -EINVAL;
|
|
if (m.mtus[0] < 81) /* accommodate SACK */
|
|
if (m.mtus[0] < 81) /* accommodate SACK */
|
|
@@ -2407,6 +2418,8 @@ static int cxgb_extension_ioctl(struct net_device *dev, void __user *useraddr)
|
|
return -EBUSY;
|
|
return -EBUSY;
|
|
if (copy_from_user(&m, useraddr, sizeof(m)))
|
|
if (copy_from_user(&m, useraddr, sizeof(m)))
|
|
return -EFAULT;
|
|
return -EFAULT;
|
|
|
|
+ if (m.cmd != CHELSIO_SET_PM)
|
|
|
|
+ return -EINVAL;
|
|
if (!is_power_of_2(m.rx_pg_sz) ||
|
|
if (!is_power_of_2(m.rx_pg_sz) ||
|
|
!is_power_of_2(m.tx_pg_sz))
|
|
!is_power_of_2(m.tx_pg_sz))
|
|
return -EINVAL; /* not power of 2 */
|
|
return -EINVAL; /* not power of 2 */
|
|
@@ -2440,6 +2453,8 @@ static int cxgb_extension_ioctl(struct net_device *dev, void __user *useraddr)
|
|
return -EIO; /* need the memory controllers */
|
|
return -EIO; /* need the memory controllers */
|
|
if (copy_from_user(&t, useraddr, sizeof(t)))
|
|
if (copy_from_user(&t, useraddr, sizeof(t)))
|
|
return -EFAULT;
|
|
return -EFAULT;
|
|
|
|
+ if (t.cmd != CHELSIO_GET_MEM)
|
|
|
|
+ return -EINVAL;
|
|
if ((t.addr & 7) || (t.len & 7))
|
|
if ((t.addr & 7) || (t.len & 7))
|
|
return -EINVAL;
|
|
return -EINVAL;
|
|
if (t.mem_id == MEM_CM)
|
|
if (t.mem_id == MEM_CM)
|
|
@@ -2492,6 +2507,8 @@ static int cxgb_extension_ioctl(struct net_device *dev, void __user *useraddr)
|
|
return -EAGAIN;
|
|
return -EAGAIN;
|
|
if (copy_from_user(&t, useraddr, sizeof(t)))
|
|
if (copy_from_user(&t, useraddr, sizeof(t)))
|
|
return -EFAULT;
|
|
return -EFAULT;
|
|
|
|
+ if (t.cmd != CHELSIO_SET_TRACE_FILTER)
|
|
|
|
+ return -EINVAL;
|
|
|
|
|
|
tp = (const struct trace_params *)&t.sip;
|
|
tp = (const struct trace_params *)&t.sip;
|
|
if (t.config_tx)
|
|
if (t.config_tx)
|