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 | |
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')
-rw-r--r-- | drivers/net/cxgb3/cxgb3_ioctl.h | 33 | ||||
-rw-r--r-- | drivers/net/cxgb3/cxgb3_main.c | 48 |
2 files changed, 15 insertions, 66 deletions
diff --git a/drivers/net/cxgb3/cxgb3_ioctl.h b/drivers/net/cxgb3/cxgb3_ioctl.h index a94281861a66..0a82fcddf2d8 100644 --- a/drivers/net/cxgb3/cxgb3_ioctl.h +++ b/drivers/net/cxgb3/cxgb3_ioctl.h | |||
@@ -36,28 +36,17 @@ | |||
36 | * Ioctl commands specific to this driver. | 36 | * Ioctl commands specific to this driver. |
37 | */ | 37 | */ |
38 | enum { | 38 | enum { |
39 | CHELSIO_SETREG = 1024, | 39 | CHELSIO_GETMTUTAB = 1029, |
40 | CHELSIO_GETREG, | 40 | CHELSIO_SETMTUTAB = 1030, |
41 | CHELSIO_SETTPI, | 41 | CHELSIO_SET_PM = 1032, |
42 | CHELSIO_GETTPI, | 42 | CHELSIO_GET_PM = 1033, |
43 | CHELSIO_GETMTUTAB, | 43 | CHELSIO_GET_MEM = 1038, |
44 | CHELSIO_SETMTUTAB, | 44 | CHELSIO_LOAD_FW = 1041, |
45 | CHELSIO_GETMTU, | 45 | CHELSIO_SET_TRACE_FILTER = 1044, |
46 | CHELSIO_SET_PM, | 46 | CHELSIO_SET_QSET_PARAMS = 1045, |
47 | CHELSIO_GET_PM, | 47 | CHELSIO_GET_QSET_PARAMS = 1046, |
48 | CHELSIO_GET_TCAM, | 48 | CHELSIO_SET_QSET_NUM = 1047, |
49 | CHELSIO_SET_TCAM, | 49 | CHELSIO_GET_QSET_NUM = 1048, |
50 | CHELSIO_GET_TCB, | ||
51 | CHELSIO_GET_MEM, | ||
52 | CHELSIO_LOAD_FW, | ||
53 | CHELSIO_GET_PROTO, | ||
54 | CHELSIO_SET_PROTO, | ||
55 | CHELSIO_SET_TRACE_FILTER, | ||
56 | CHELSIO_SET_QSET_PARAMS, | ||
57 | CHELSIO_GET_QSET_PARAMS, | ||
58 | CHELSIO_SET_QSET_NUM, | ||
59 | CHELSIO_GET_QSET_NUM, | ||
60 | CHELSIO_SET_PKTSCHED, | ||
61 | }; | 50 | }; |
62 | 51 | ||
63 | struct ch_reg { | 52 | struct ch_reg { |
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 | } |