diff options
author | Divy Le Ray <divy@chelsio.com> | 2007-02-24 19:43:56 -0500 |
---|---|---|
committer | Jeff Garzik <jeff@garzik.org> | 2007-02-27 04:27:12 -0500 |
commit | 1825494a7ec6c0fed0a7dfb1646e84402979743e (patch) | |
tree | be1f011efe86003b1fed7691ff6ea92c3bfcd70e /drivers/net/cxgb3/cxgb3_main.c | |
parent | 896392ef94dd7b9e66d1e836f98b57380452a280 (diff) |
cxgb3 - private ioctl cleanup
Clean up some private ioctls.
Signed-off-by: Divy Le Ray <divy@chelsio.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
Diffstat (limited to 'drivers/net/cxgb3/cxgb3_main.c')
-rw-r--r-- | drivers/net/cxgb3/cxgb3_main.c | 48 |
1 files changed, 4 insertions, 44 deletions
diff --git a/drivers/net/cxgb3/cxgb3_main.c b/drivers/net/cxgb3/cxgb3_main.c index 59f2b518c926..7ff834e45d6b 100644 --- a/drivers/net/cxgb3/cxgb3_main.c +++ b/drivers/net/cxgb3/cxgb3_main.c | |||
@@ -1552,32 +1552,6 @@ static int cxgb_extension_ioctl(struct net_device *dev, void __user *useraddr) | |||
1552 | return -EFAULT; | 1552 | return -EFAULT; |
1553 | 1553 | ||
1554 | switch (cmd) { | 1554 | switch (cmd) { |
1555 | case CHELSIO_SETREG:{ | ||
1556 | struct ch_reg edata; | ||
1557 | |||
1558 | if (!capable(CAP_NET_ADMIN)) | ||
1559 | return -EPERM; | ||
1560 | if (copy_from_user(&edata, useraddr, sizeof(edata))) | ||
1561 | return -EFAULT; | ||
1562 | if ((edata.addr & 3) != 0 | ||
1563 | || edata.addr >= adapter->mmio_len) | ||
1564 | return -EINVAL; | ||
1565 | writel(edata.val, adapter->regs + edata.addr); | ||
1566 | break; | ||
1567 | } | ||
1568 | case CHELSIO_GETREG:{ | ||
1569 | struct ch_reg edata; | ||
1570 | |||
1571 | if (copy_from_user(&edata, useraddr, sizeof(edata))) | ||
1572 | return -EFAULT; | ||
1573 | if ((edata.addr & 3) != 0 | ||
1574 | || edata.addr >= adapter->mmio_len) | ||
1575 | return -EINVAL; | ||
1576 | edata.val = readl(adapter->regs + edata.addr); | ||
1577 | if (copy_to_user(useraddr, &edata, sizeof(edata))) | ||
1578 | return -EFAULT; | ||
1579 | break; | ||
1580 | } | ||
1581 | case CHELSIO_SET_QSET_PARAMS:{ | 1555 | case CHELSIO_SET_QSET_PARAMS:{ |
1582 | int i; | 1556 | int i; |
1583 | struct qset_params *q; | 1557 | struct qset_params *q; |
@@ -1841,10 +1815,10 @@ static int cxgb_extension_ioctl(struct net_device *dev, void __user *useraddr) | |||
1841 | return -EINVAL; | 1815 | return -EINVAL; |
1842 | 1816 | ||
1843 | /* | 1817 | /* |
1844 | * Version scheme: | 1818 | * Version scheme: |
1845 | * bits 0..9: chip version | 1819 | * bits 0..9: chip version |
1846 | * bits 10..15: chip revision | 1820 | * bits 10..15: chip revision |
1847 | */ | 1821 | */ |
1848 | t.version = 3 | (adapter->params.rev << 10); | 1822 | t.version = 3 | (adapter->params.rev << 10); |
1849 | if (copy_to_user(useraddr, &t, sizeof(t))) | 1823 | if (copy_to_user(useraddr, &t, sizeof(t))) |
1850 | return -EFAULT; | 1824 | return -EFAULT; |
@@ -1893,20 +1867,6 @@ static int cxgb_extension_ioctl(struct net_device *dev, void __user *useraddr) | |||
1893 | t.trace_rx); | 1867 | t.trace_rx); |
1894 | break; | 1868 | break; |
1895 | } | 1869 | } |
1896 | case CHELSIO_SET_PKTSCHED:{ | ||
1897 | struct ch_pktsched_params p; | ||
1898 | |||
1899 | if (!capable(CAP_NET_ADMIN)) | ||
1900 | return -EPERM; | ||
1901 | if (!adapter->open_device_map) | ||
1902 | return -EAGAIN; /* uP and SGE must be running */ | ||
1903 | if (copy_from_user(&p, useraddr, sizeof(p))) | ||
1904 | return -EFAULT; | ||
1905 | send_pktsched_cmd(adapter, p.sched, p.idx, p.min, p.max, | ||
1906 | p.binding); | ||
1907 | break; | ||
1908 | |||
1909 | } | ||
1910 | default: | 1870 | default: |
1911 | return -EOPNOTSUPP; | 1871 | return -EOPNOTSUPP; |
1912 | } | 1872 | } |