diff options
author | shemminger@osdl.org <shemminger@osdl.org> | 2005-11-24 01:00:54 -0500 |
---|---|---|
committer | Jeff Garzik <jgarzik@pobox.com> | 2005-12-01 02:22:52 -0500 |
commit | 35b8fcab1b293cadd54cdf9e9636cc576d2cad88 (patch) | |
tree | bdd203381a36fdeaba35329d4e713b3475685ecb /drivers/net/sk98lin | |
parent | 8f7a17d12a8cfd0ab4a50dded8390f6c44f1f205 (diff) |
[PATCH] sk98lin: remove /proc interface
Remove device specific proc interface. It doesn't handle
renames correctly; it ain't worth fixing.
Signed-off-by: Stephen Hemminger <shemminger@osdl.org>
Signed-off-by: Jeff Garzik <jgarzik@pobox.com>
Diffstat (limited to 'drivers/net/sk98lin')
-rw-r--r-- | drivers/net/sk98lin/Makefile | 3 | ||||
-rw-r--r-- | drivers/net/sk98lin/skge.c | 42 | ||||
-rw-r--r-- | drivers/net/sk98lin/skproc.c | 265 |
3 files changed, 2 insertions, 308 deletions
diff --git a/drivers/net/sk98lin/Makefile b/drivers/net/sk98lin/Makefile index 7653d6e33aa2..afd900d5d730 100644 --- a/drivers/net/sk98lin/Makefile +++ b/drivers/net/sk98lin/Makefile | |||
@@ -26,8 +26,7 @@ sk98lin-objs := \ | |||
26 | skrlmt.o \ | 26 | skrlmt.o \ |
27 | sktimer.o \ | 27 | sktimer.o \ |
28 | skvpd.o \ | 28 | skvpd.o \ |
29 | skxmac2.o \ | 29 | skxmac2.o |
30 | skproc.o | ||
31 | 30 | ||
32 | # DBGDEF = \ | 31 | # DBGDEF = \ |
33 | # -DDEBUG | 32 | # -DDEBUG |
diff --git a/drivers/net/sk98lin/skge.c b/drivers/net/sk98lin/skge.c index 8338d4972500..e3bdb5836001 100644 --- a/drivers/net/sk98lin/skge.c +++ b/drivers/net/sk98lin/skge.c | |||
@@ -110,7 +110,6 @@ | |||
110 | #include <linux/module.h> | 110 | #include <linux/module.h> |
111 | #include <linux/moduleparam.h> | 111 | #include <linux/moduleparam.h> |
112 | #include <linux/init.h> | 112 | #include <linux/init.h> |
113 | #include <linux/proc_fs.h> | ||
114 | #include <linux/dma-mapping.h> | 113 | #include <linux/dma-mapping.h> |
115 | #include <linux/ip.h> | 114 | #include <linux/ip.h> |
116 | 115 | ||
@@ -234,28 +233,6 @@ static int SkDrvDeInitAdapter(SK_AC *pAC, int devNbr); | |||
234 | * Extern Function Prototypes | 233 | * Extern Function Prototypes |
235 | * | 234 | * |
236 | ******************************************************************************/ | 235 | ******************************************************************************/ |
237 | static const char SKRootName[] = "net/sk98lin"; | ||
238 | static struct proc_dir_entry *pSkRootDir; | ||
239 | extern struct file_operations sk_proc_fops; | ||
240 | |||
241 | static inline void SkGeProcCreate(struct net_device *dev) | ||
242 | { | ||
243 | struct proc_dir_entry *pe; | ||
244 | |||
245 | if (pSkRootDir && | ||
246 | (pe = create_proc_entry(dev->name, S_IRUGO, pSkRootDir))) { | ||
247 | pe->proc_fops = &sk_proc_fops; | ||
248 | pe->data = dev; | ||
249 | pe->owner = THIS_MODULE; | ||
250 | } | ||
251 | } | ||
252 | |||
253 | static inline void SkGeProcRemove(struct net_device *dev) | ||
254 | { | ||
255 | if (pSkRootDir) | ||
256 | remove_proc_entry(dev->name, pSkRootDir); | ||
257 | } | ||
258 | |||
259 | extern void SkDimEnableModerationIfNeeded(SK_AC *pAC); | 236 | extern void SkDimEnableModerationIfNeeded(SK_AC *pAC); |
260 | extern void SkDimDisplayModerationSettings(SK_AC *pAC); | 237 | extern void SkDimDisplayModerationSettings(SK_AC *pAC); |
261 | extern void SkDimStartModerationTimer(SK_AC *pAC); | 238 | extern void SkDimStartModerationTimer(SK_AC *pAC); |
@@ -4898,8 +4875,6 @@ static int __devinit skge_probe_one(struct pci_dev *pdev, | |||
4898 | memcpy(&dev->dev_addr, &pAC->Addr.Net[0].CurrentMacAddress, 6); | 4875 | memcpy(&dev->dev_addr, &pAC->Addr.Net[0].CurrentMacAddress, 6); |
4899 | memcpy(dev->perm_addr, dev->dev_addr, dev->addr_len); | 4876 | memcpy(dev->perm_addr, dev->dev_addr, dev->addr_len); |
4900 | 4877 | ||
4901 | SkGeProcCreate(dev); | ||
4902 | |||
4903 | pNet->PortNr = 0; | 4878 | pNet->PortNr = 0; |
4904 | pNet->NetNr = 0; | 4879 | pNet->NetNr = 0; |
4905 | 4880 | ||
@@ -4947,7 +4922,6 @@ static int __devinit skge_probe_one(struct pci_dev *pdev, | |||
4947 | free_netdev(dev); | 4922 | free_netdev(dev); |
4948 | pAC->dev[1] = pAC->dev[0]; | 4923 | pAC->dev[1] = pAC->dev[0]; |
4949 | } else { | 4924 | } else { |
4950 | SkGeProcCreate(dev); | ||
4951 | memcpy(&dev->dev_addr, | 4925 | memcpy(&dev->dev_addr, |
4952 | &pAC->Addr.Net[1].CurrentMacAddress, 6); | 4926 | &pAC->Addr.Net[1].CurrentMacAddress, 6); |
4953 | memcpy(dev->perm_addr, dev->dev_addr, dev->addr_len); | 4927 | memcpy(dev->perm_addr, dev->dev_addr, dev->addr_len); |
@@ -4988,10 +4962,7 @@ static void __devexit skge_remove_one(struct pci_dev *pdev) | |||
4988 | SK_AC *pAC = pNet->pAC; | 4962 | SK_AC *pAC = pNet->pAC; |
4989 | struct net_device *otherdev = pAC->dev[1]; | 4963 | struct net_device *otherdev = pAC->dev[1]; |
4990 | 4964 | ||
4991 | SkGeProcRemove(dev); | ||
4992 | unregister_netdev(dev); | 4965 | unregister_netdev(dev); |
4993 | if (otherdev != dev) | ||
4994 | SkGeProcRemove(otherdev); | ||
4995 | 4966 | ||
4996 | SkGeYellowLED(pAC, pAC->IoBase, 0); | 4967 | SkGeYellowLED(pAC, pAC->IoBase, 0); |
4997 | 4968 | ||
@@ -5136,23 +5107,12 @@ static struct pci_driver skge_driver = { | |||
5136 | 5107 | ||
5137 | static int __init skge_init(void) | 5108 | static int __init skge_init(void) |
5138 | { | 5109 | { |
5139 | int error; | 5110 | return pci_module_init(&skge_driver); |
5140 | |||
5141 | pSkRootDir = proc_mkdir(SKRootName, NULL); | ||
5142 | if (pSkRootDir) | ||
5143 | pSkRootDir->owner = THIS_MODULE; | ||
5144 | |||
5145 | error = pci_register_driver(&skge_driver); | ||
5146 | if (error) | ||
5147 | remove_proc_entry(SKRootName, NULL); | ||
5148 | return error; | ||
5149 | } | 5111 | } |
5150 | 5112 | ||
5151 | static void __exit skge_exit(void) | 5113 | static void __exit skge_exit(void) |
5152 | { | 5114 | { |
5153 | pci_unregister_driver(&skge_driver); | 5115 | pci_unregister_driver(&skge_driver); |
5154 | remove_proc_entry(SKRootName, NULL); | ||
5155 | |||
5156 | } | 5116 | } |
5157 | 5117 | ||
5158 | module_init(skge_init); | 5118 | module_init(skge_init); |
diff --git a/drivers/net/sk98lin/skproc.c b/drivers/net/sk98lin/skproc.c deleted file mode 100644 index 5cece25c034e..000000000000 --- a/drivers/net/sk98lin/skproc.c +++ /dev/null | |||
@@ -1,265 +0,0 @@ | |||
1 | /****************************************************************************** | ||
2 | * | ||
3 | * Name: skproc.c | ||
4 | * Project: GEnesis, PCI Gigabit Ethernet Adapter | ||
5 | * Version: $Revision: 1.11 $ | ||
6 | * Date: $Date: 2003/12/11 16:03:57 $ | ||
7 | * Purpose: Funktions to display statictic data | ||
8 | * | ||
9 | ******************************************************************************/ | ||
10 | |||
11 | /****************************************************************************** | ||
12 | * | ||
13 | * (C)Copyright 1998-2002 SysKonnect GmbH. | ||
14 | * (C)Copyright 2002-2003 Marvell. | ||
15 | * | ||
16 | * This program is free software; you can redistribute it and/or modify | ||
17 | * it under the terms of the GNU General Public License as published by | ||
18 | * the Free Software Foundation; either version 2 of the License, or | ||
19 | * (at your option) any later version. | ||
20 | * | ||
21 | * Created 22-Nov-2000 | ||
22 | * Author: Mirko Lindner (mlindner@syskonnect.de) | ||
23 | * | ||
24 | * The information in this file is provided "AS IS" without warranty. | ||
25 | * | ||
26 | ******************************************************************************/ | ||
27 | #include <linux/proc_fs.h> | ||
28 | #include <linux/seq_file.h> | ||
29 | |||
30 | #include "h/skdrv1st.h" | ||
31 | #include "h/skdrv2nd.h" | ||
32 | #include "h/skversion.h" | ||
33 | |||
34 | static int sk_seq_show(struct seq_file *seq, void *v); | ||
35 | static int sk_proc_open(struct inode *inode, struct file *file); | ||
36 | |||
37 | struct file_operations sk_proc_fops = { | ||
38 | .owner = THIS_MODULE, | ||
39 | .open = sk_proc_open, | ||
40 | .read = seq_read, | ||
41 | .llseek = seq_lseek, | ||
42 | .release = single_release, | ||
43 | }; | ||
44 | |||
45 | |||
46 | /***************************************************************************** | ||
47 | * | ||
48 | * sk_seq_show - show proc information of a particular adapter | ||
49 | * | ||
50 | * Description: | ||
51 | * This function fills the proc entry with statistic data about | ||
52 | * the ethernet device. It invokes the generic sk_gen_browse() to | ||
53 | * print out all items one per one. | ||
54 | * | ||
55 | * Returns: 0 | ||
56 | * | ||
57 | */ | ||
58 | static int sk_seq_show(struct seq_file *seq, void *v) | ||
59 | { | ||
60 | struct net_device *dev = seq->private; | ||
61 | DEV_NET *pNet = netdev_priv(dev); | ||
62 | SK_AC *pAC = pNet->pAC; | ||
63 | SK_PNMI_STRUCT_DATA *pPnmiStruct = &pAC->PnmiStruct; | ||
64 | unsigned long Flags; | ||
65 | unsigned int Size; | ||
66 | char sens_msg[50]; | ||
67 | int t; | ||
68 | int i; | ||
69 | |||
70 | /* NetIndex in GetStruct is now required, zero is only dummy */ | ||
71 | for (t=pAC->GIni.GIMacsFound; t > 0; t--) { | ||
72 | if ((pAC->GIni.GIMacsFound == 2) && pAC->RlmtNets == 1) | ||
73 | t--; | ||
74 | |||
75 | spin_lock_irqsave(&pAC->SlowPathLock, Flags); | ||
76 | Size = SK_PNMI_STRUCT_SIZE; | ||
77 | #ifdef SK_DIAG_SUPPORT | ||
78 | if (pAC->BoardLevel == SK_INIT_DATA) { | ||
79 | SK_MEMCPY(&(pAC->PnmiStruct), &(pAC->PnmiBackup), sizeof(SK_PNMI_STRUCT_DATA)); | ||
80 | if (pAC->DiagModeActive == DIAG_NOTACTIVE) { | ||
81 | pAC->Pnmi.DiagAttached = SK_DIAG_IDLE; | ||
82 | } | ||
83 | } else { | ||
84 | SkPnmiGetStruct(pAC, pAC->IoBase, pPnmiStruct, &Size, t-1); | ||
85 | } | ||
86 | #else | ||
87 | SkPnmiGetStruct(pAC, pAC->IoBase, | ||
88 | pPnmiStruct, &Size, t-1); | ||
89 | #endif | ||
90 | spin_unlock_irqrestore(&pAC->SlowPathLock, Flags); | ||
91 | |||
92 | if (pAC->dev[t-1] == dev) { | ||
93 | SK_PNMI_STAT *pPnmiStat = &pPnmiStruct->Stat[0]; | ||
94 | |||
95 | seq_printf(seq, "\nDetailed statistic for device %s\n", | ||
96 | pAC->dev[t-1]->name); | ||
97 | seq_printf(seq, "=======================================\n"); | ||
98 | |||
99 | /* Board statistics */ | ||
100 | seq_printf(seq, "\nBoard statistics\n\n"); | ||
101 | seq_printf(seq, "Active Port %c\n", | ||
102 | 'A' + pAC->Rlmt.Net[t-1].Port[pAC->Rlmt. | ||
103 | Net[t-1].PrefPort]->PortNumber); | ||
104 | seq_printf(seq, "Preferred Port %c\n", | ||
105 | 'A' + pAC->Rlmt.Net[t-1].Port[pAC->Rlmt. | ||
106 | Net[t-1].PrefPort]->PortNumber); | ||
107 | |||
108 | seq_printf(seq, "Bus speed (MHz) %d\n", | ||
109 | pPnmiStruct->BusSpeed); | ||
110 | |||
111 | seq_printf(seq, "Bus width (Bit) %d\n", | ||
112 | pPnmiStruct->BusWidth); | ||
113 | seq_printf(seq, "Driver version %s\n", | ||
114 | VER_STRING); | ||
115 | seq_printf(seq, "Hardware revision v%d.%d\n", | ||
116 | (pAC->GIni.GIPciHwRev >> 4) & 0x0F, | ||
117 | pAC->GIni.GIPciHwRev & 0x0F); | ||
118 | |||
119 | /* Print sensor informations */ | ||
120 | for (i=0; i < pAC->I2c.MaxSens; i ++) { | ||
121 | /* Check type */ | ||
122 | switch (pAC->I2c.SenTable[i].SenType) { | ||
123 | case 1: | ||
124 | strcpy(sens_msg, pAC->I2c.SenTable[i].SenDesc); | ||
125 | strcat(sens_msg, " (C)"); | ||
126 | seq_printf(seq, "%-25s %d.%02d\n", | ||
127 | sens_msg, | ||
128 | pAC->I2c.SenTable[i].SenValue / 10, | ||
129 | pAC->I2c.SenTable[i].SenValue % 10); | ||
130 | |||
131 | strcpy(sens_msg, pAC->I2c.SenTable[i].SenDesc); | ||
132 | strcat(sens_msg, " (F)"); | ||
133 | seq_printf(seq, "%-25s %d.%02d\n", | ||
134 | sens_msg, | ||
135 | ((((pAC->I2c.SenTable[i].SenValue) | ||
136 | *10)*9)/5 + 3200)/100, | ||
137 | ((((pAC->I2c.SenTable[i].SenValue) | ||
138 | *10)*9)/5 + 3200) % 10); | ||
139 | break; | ||
140 | case 2: | ||
141 | strcpy(sens_msg, pAC->I2c.SenTable[i].SenDesc); | ||
142 | strcat(sens_msg, " (V)"); | ||
143 | seq_printf(seq, "%-25s %d.%03d\n", | ||
144 | sens_msg, | ||
145 | pAC->I2c.SenTable[i].SenValue / 1000, | ||
146 | pAC->I2c.SenTable[i].SenValue % 1000); | ||
147 | break; | ||
148 | case 3: | ||
149 | strcpy(sens_msg, pAC->I2c.SenTable[i].SenDesc); | ||
150 | strcat(sens_msg, " (rpm)"); | ||
151 | seq_printf(seq, "%-25s %d\n", | ||
152 | sens_msg, | ||
153 | pAC->I2c.SenTable[i].SenValue); | ||
154 | break; | ||
155 | default: | ||
156 | break; | ||
157 | } | ||
158 | } | ||
159 | |||
160 | /*Receive statistics */ | ||
161 | seq_printf(seq, "\nReceive statistics\n\n"); | ||
162 | |||
163 | seq_printf(seq, "Received bytes %Lu\n", | ||
164 | (unsigned long long) pPnmiStat->StatRxOctetsOkCts); | ||
165 | seq_printf(seq, "Received packets %Lu\n", | ||
166 | (unsigned long long) pPnmiStat->StatRxOkCts); | ||
167 | #if 0 | ||
168 | if (pAC->GIni.GP[0].PhyType == SK_PHY_XMAC && | ||
169 | pAC->HWRevision < 12) { | ||
170 | pPnmiStruct->InErrorsCts = pPnmiStruct->InErrorsCts - | ||
171 | pPnmiStat->StatRxShortsCts; | ||
172 | pPnmiStat->StatRxShortsCts = 0; | ||
173 | } | ||
174 | #endif | ||
175 | if (dev->mtu > 1500) | ||
176 | pPnmiStruct->InErrorsCts = pPnmiStruct->InErrorsCts - | ||
177 | pPnmiStat->StatRxTooLongCts; | ||
178 | |||
179 | seq_printf(seq, "Receive errors %Lu\n", | ||
180 | (unsigned long long) pPnmiStruct->InErrorsCts); | ||
181 | seq_printf(seq, "Receive dropped %Lu\n", | ||
182 | (unsigned long long) pPnmiStruct->RxNoBufCts); | ||
183 | seq_printf(seq, "Received multicast %Lu\n", | ||
184 | (unsigned long long) pPnmiStat->StatRxMulticastOkCts); | ||
185 | seq_printf(seq, "Receive error types\n"); | ||
186 | seq_printf(seq, " length %Lu\n", | ||
187 | (unsigned long long) pPnmiStat->StatRxRuntCts); | ||
188 | seq_printf(seq, " buffer overflow %Lu\n", | ||
189 | (unsigned long long) pPnmiStat->StatRxFifoOverflowCts); | ||
190 | seq_printf(seq, " bad crc %Lu\n", | ||
191 | (unsigned long long) pPnmiStat->StatRxFcsCts); | ||
192 | seq_printf(seq, " framing %Lu\n", | ||
193 | (unsigned long long) pPnmiStat->StatRxFramingCts); | ||
194 | seq_printf(seq, " missed frames %Lu\n", | ||
195 | (unsigned long long) pPnmiStat->StatRxMissedCts); | ||
196 | |||
197 | if (dev->mtu > 1500) | ||
198 | pPnmiStat->StatRxTooLongCts = 0; | ||
199 | |||
200 | seq_printf(seq, " too long %Lu\n", | ||
201 | (unsigned long long) pPnmiStat->StatRxTooLongCts); | ||
202 | seq_printf(seq, " carrier extension %Lu\n", | ||
203 | (unsigned long long) pPnmiStat->StatRxCextCts); | ||
204 | seq_printf(seq, " too short %Lu\n", | ||
205 | (unsigned long long) pPnmiStat->StatRxShortsCts); | ||
206 | seq_printf(seq, " symbol %Lu\n", | ||
207 | (unsigned long long) pPnmiStat->StatRxSymbolCts); | ||
208 | seq_printf(seq, " LLC MAC size %Lu\n", | ||
209 | (unsigned long long) pPnmiStat->StatRxIRLengthCts); | ||
210 | seq_printf(seq, " carrier event %Lu\n", | ||
211 | (unsigned long long) pPnmiStat->StatRxCarrierCts); | ||
212 | seq_printf(seq, " jabber %Lu\n", | ||
213 | (unsigned long long) pPnmiStat->StatRxJabberCts); | ||
214 | |||
215 | |||
216 | /*Transmit statistics */ | ||
217 | seq_printf(seq, "\nTransmit statistics\n\n"); | ||
218 | |||
219 | seq_printf(seq, "Transmited bytes %Lu\n", | ||
220 | (unsigned long long) pPnmiStat->StatTxOctetsOkCts); | ||
221 | seq_printf(seq, "Transmited packets %Lu\n", | ||
222 | (unsigned long long) pPnmiStat->StatTxOkCts); | ||
223 | seq_printf(seq, "Transmit errors %Lu\n", | ||
224 | (unsigned long long) pPnmiStat->StatTxSingleCollisionCts); | ||
225 | seq_printf(seq, "Transmit dropped %Lu\n", | ||
226 | (unsigned long long) pPnmiStruct->TxNoBufCts); | ||
227 | seq_printf(seq, "Transmit collisions %Lu\n", | ||
228 | (unsigned long long) pPnmiStat->StatTxSingleCollisionCts); | ||
229 | seq_printf(seq, "Transmit error types\n"); | ||
230 | seq_printf(seq, " excessive collision %ld\n", | ||
231 | pAC->stats.tx_aborted_errors); | ||
232 | seq_printf(seq, " carrier %Lu\n", | ||
233 | (unsigned long long) pPnmiStat->StatTxCarrierCts); | ||
234 | seq_printf(seq, " fifo underrun %Lu\n", | ||
235 | (unsigned long long) pPnmiStat->StatTxFifoUnderrunCts); | ||
236 | seq_printf(seq, " heartbeat %Lu\n", | ||
237 | (unsigned long long) pPnmiStat->StatTxCarrierCts); | ||
238 | seq_printf(seq, " window %ld\n", | ||
239 | pAC->stats.tx_window_errors); | ||
240 | |||
241 | } | ||
242 | } | ||
243 | return 0; | ||
244 | } | ||
245 | |||
246 | /***************************************************************************** | ||
247 | * | ||
248 | * sk_proc_open - register the show function when proc is open'ed | ||
249 | * | ||
250 | * Description: | ||
251 | * This function is called whenever a sk98lin proc file is queried. | ||
252 | * | ||
253 | * Returns: the return value of single_open() | ||
254 | * | ||
255 | */ | ||
256 | static int sk_proc_open(struct inode *inode, struct file *file) | ||
257 | { | ||
258 | return single_open(file, sk_seq_show, PDE(inode)->data); | ||
259 | } | ||
260 | |||
261 | /******************************************************************************* | ||
262 | * | ||
263 | * End of file | ||
264 | * | ||
265 | ******************************************************************************/ | ||