diff options
author | Ralph Campbell <ralph.campbell@qlogic.com> | 2007-08-07 21:09:34 -0400 |
---|---|---|
committer | Roland Dreier <rolandd@cisco.com> | 2007-10-09 23:43:17 -0400 |
commit | 1793b4771d258c93ed86a6356c95cac418781fdd (patch) | |
tree | 4aaccda9ed17c33fd50e328b8c92e27d7fe906eb /drivers/infiniband | |
parent | 9bec3992312b8bb3aee71bd3b57d106a0a649479 (diff) |
IB/ipath: Remove unneeded code for ipathfs
The ipathfs file system is used to export binary data verses ASCII data
such as through /sys. This patch removes some unneeded files since the
data is available through other /sys files.
Signed-off-by: Ralph Campbell <ralph.campbell@qlogic.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
Diffstat (limited to 'drivers/infiniband')
-rw-r--r-- | drivers/infiniband/hw/ipath/ipath_fs.c | 187 |
1 files changed, 0 insertions, 187 deletions
diff --git a/drivers/infiniband/hw/ipath/ipath_fs.c b/drivers/infiniband/hw/ipath/ipath_fs.c index 2e689b974e1..262c25db05c 100644 --- a/drivers/infiniband/hw/ipath/ipath_fs.c +++ b/drivers/infiniband/hw/ipath/ipath_fs.c | |||
@@ -130,175 +130,6 @@ static const struct file_operations atomic_counters_ops = { | |||
130 | .read = atomic_counters_read, | 130 | .read = atomic_counters_read, |
131 | }; | 131 | }; |
132 | 132 | ||
133 | static ssize_t atomic_node_info_read(struct file *file, char __user *buf, | ||
134 | size_t count, loff_t *ppos) | ||
135 | { | ||
136 | u32 nodeinfo[10]; | ||
137 | struct ipath_devdata *dd; | ||
138 | u64 guid; | ||
139 | |||
140 | dd = file->f_path.dentry->d_inode->i_private; | ||
141 | |||
142 | guid = be64_to_cpu(dd->ipath_guid); | ||
143 | |||
144 | nodeinfo[0] = /* BaseVersion is SMA */ | ||
145 | /* ClassVersion is SMA */ | ||
146 | (1 << 8) /* NodeType */ | ||
147 | | (1 << 0); /* NumPorts */ | ||
148 | nodeinfo[1] = (u32) (guid >> 32); | ||
149 | nodeinfo[2] = (u32) (guid & 0xffffffff); | ||
150 | /* PortGUID == SystemImageGUID for us */ | ||
151 | nodeinfo[3] = nodeinfo[1]; | ||
152 | /* PortGUID == SystemImageGUID for us */ | ||
153 | nodeinfo[4] = nodeinfo[2]; | ||
154 | /* PortGUID == NodeGUID for us */ | ||
155 | nodeinfo[5] = nodeinfo[3]; | ||
156 | /* PortGUID == NodeGUID for us */ | ||
157 | nodeinfo[6] = nodeinfo[4]; | ||
158 | nodeinfo[7] = (4 << 16) /* we support 4 pkeys */ | ||
159 | | (dd->ipath_deviceid << 0); | ||
160 | /* our chip version as 16 bits major, 16 bits minor */ | ||
161 | nodeinfo[8] = dd->ipath_minrev | (dd->ipath_majrev << 16); | ||
162 | nodeinfo[9] = (dd->ipath_unit << 24) | (dd->ipath_vendorid << 0); | ||
163 | |||
164 | return simple_read_from_buffer(buf, count, ppos, nodeinfo, | ||
165 | sizeof nodeinfo); | ||
166 | } | ||
167 | |||
168 | static const struct file_operations atomic_node_info_ops = { | ||
169 | .read = atomic_node_info_read, | ||
170 | }; | ||
171 | |||
172 | static ssize_t atomic_port_info_read(struct file *file, char __user *buf, | ||
173 | size_t count, loff_t *ppos) | ||
174 | { | ||
175 | u32 portinfo[13]; | ||
176 | u32 tmp, tmp2; | ||
177 | struct ipath_devdata *dd; | ||
178 | |||
179 | dd = file->f_path.dentry->d_inode->i_private; | ||
180 | |||
181 | /* so we only initialize non-zero fields. */ | ||
182 | memset(portinfo, 0, sizeof portinfo); | ||
183 | |||
184 | /* | ||
185 | * Notimpl yet M_Key (64) | ||
186 | * Notimpl yet GID (64) | ||
187 | */ | ||
188 | |||
189 | portinfo[4] = (dd->ipath_lid << 16); | ||
190 | |||
191 | /* | ||
192 | * Notimpl yet SMLID. | ||
193 | * CapabilityMask is 0, we don't support any of these | ||
194 | * DiagCode is 0; we don't store any diag info for now Notimpl yet | ||
195 | * M_KeyLeasePeriod (we don't support M_Key) | ||
196 | */ | ||
197 | |||
198 | /* LocalPortNum is whichever port number they ask for */ | ||
199 | portinfo[7] = (dd->ipath_unit << 24) | ||
200 | /* LinkWidthEnabled */ | ||
201 | | (2 << 16) | ||
202 | /* LinkWidthSupported (really 2, but not IB valid) */ | ||
203 | | (3 << 8) | ||
204 | /* LinkWidthActive */ | ||
205 | | (2 << 0); | ||
206 | tmp = dd->ipath_lastibcstat & IPATH_IBSTATE_MASK; | ||
207 | tmp2 = 5; | ||
208 | if (tmp == IPATH_IBSTATE_INIT) | ||
209 | tmp = 2; | ||
210 | else if (tmp == IPATH_IBSTATE_ARM) | ||
211 | tmp = 3; | ||
212 | else if (tmp == IPATH_IBSTATE_ACTIVE) | ||
213 | tmp = 4; | ||
214 | else { | ||
215 | tmp = 0; /* down */ | ||
216 | tmp2 = tmp & 0xf; | ||
217 | } | ||
218 | |||
219 | portinfo[8] = (1 << 28) /* LinkSpeedSupported */ | ||
220 | | (tmp << 24) /* PortState */ | ||
221 | | (tmp2 << 20) /* PortPhysicalState */ | ||
222 | | (2 << 16) | ||
223 | |||
224 | /* LinkDownDefaultState */ | ||
225 | /* M_KeyProtectBits == 0 */ | ||
226 | /* NotImpl yet LMC == 0 (we can support all values) */ | ||
227 | | (1 << 4) /* LinkSpeedActive */ | ||
228 | | (1 << 0); /* LinkSpeedEnabled */ | ||
229 | switch (dd->ipath_ibmtu) { | ||
230 | case 4096: | ||
231 | tmp = 5; | ||
232 | break; | ||
233 | case 2048: | ||
234 | tmp = 4; | ||
235 | break; | ||
236 | case 1024: | ||
237 | tmp = 3; | ||
238 | break; | ||
239 | case 512: | ||
240 | tmp = 2; | ||
241 | break; | ||
242 | case 256: | ||
243 | tmp = 1; | ||
244 | break; | ||
245 | default: /* oops, something is wrong */ | ||
246 | ipath_dbg("Problem, ipath_ibmtu 0x%x not a valid IB MTU, " | ||
247 | "treat as 2048\n", dd->ipath_ibmtu); | ||
248 | tmp = 4; | ||
249 | break; | ||
250 | } | ||
251 | portinfo[9] = (tmp << 28) | ||
252 | /* NeighborMTU */ | ||
253 | /* Notimpl MasterSMSL */ | ||
254 | | (1 << 20) | ||
255 | |||
256 | /* VLCap */ | ||
257 | /* Notimpl InitType (actually, an SMA decision) */ | ||
258 | /* VLHighLimit is 0 (only one VL) */ | ||
259 | ; /* VLArbitrationHighCap is 0 (only one VL) */ | ||
260 | /* | ||
261 | * Note: the chips support a maximum MTU of 4096, but the driver | ||
262 | * hasn't implemented this feature yet, so set the maximum | ||
263 | * to 2048. | ||
264 | */ | ||
265 | portinfo[10] = /* VLArbitrationLowCap is 0 (only one VL) */ | ||
266 | /* InitTypeReply is SMA decision */ | ||
267 | (4 << 16) /* MTUCap 2048 */ | ||
268 | | (7 << 13) /* VLStallCount */ | ||
269 | | (0x1f << 8) /* HOQLife */ | ||
270 | | (1 << 4) | ||
271 | |||
272 | /* OperationalVLs 0 */ | ||
273 | /* PartitionEnforcementInbound */ | ||
274 | /* PartitionEnforcementOutbound not enforced */ | ||
275 | /* FilterRawinbound not enforced */ | ||
276 | ; /* FilterRawOutbound not enforced */ | ||
277 | /* M_KeyViolations are not counted by hardware, SMA can count */ | ||
278 | tmp = ipath_read_creg32(dd, dd->ipath_cregs->cr_errpkey); | ||
279 | /* P_KeyViolations are counted by hardware. */ | ||
280 | portinfo[11] = ((tmp & 0xffff) << 0); | ||
281 | portinfo[12] = | ||
282 | /* Q_KeyViolations are not counted by hardware */ | ||
283 | (1 << 8) | ||
284 | |||
285 | /* GUIDCap */ | ||
286 | /* SubnetTimeOut handled by SMA */ | ||
287 | /* RespTimeValue handled by SMA */ | ||
288 | ; | ||
289 | /* LocalPhyErrors are programmed to max */ | ||
290 | portinfo[12] |= (0xf << 20) | ||
291 | | (0xf << 16) /* OverRunErrors are programmed to max */ | ||
292 | ; | ||
293 | |||
294 | return simple_read_from_buffer(buf, count, ppos, portinfo, | ||
295 | sizeof portinfo); | ||
296 | } | ||
297 | |||
298 | static const struct file_operations atomic_port_info_ops = { | ||
299 | .read = atomic_port_info_read, | ||
300 | }; | ||
301 | |||
302 | static ssize_t flash_read(struct file *file, char __user *buf, | 133 | static ssize_t flash_read(struct file *file, char __user *buf, |
303 | size_t count, loff_t *ppos) | 134 | size_t count, loff_t *ppos) |
304 | { | 135 | { |
@@ -427,22 +258,6 @@ static int create_device_files(struct super_block *sb, | |||
427 | goto bail; | 258 | goto bail; |
428 | } | 259 | } |
429 | 260 | ||
430 | ret = create_file("node_info", S_IFREG|S_IRUGO, dir, &tmp, | ||
431 | &atomic_node_info_ops, dd); | ||
432 | if (ret) { | ||
433 | printk(KERN_ERR "create_file(%s/node_info) " | ||
434 | "failed: %d\n", unit, ret); | ||
435 | goto bail; | ||
436 | } | ||
437 | |||
438 | ret = create_file("port_info", S_IFREG|S_IRUGO, dir, &tmp, | ||
439 | &atomic_port_info_ops, dd); | ||
440 | if (ret) { | ||
441 | printk(KERN_ERR "create_file(%s/port_info) " | ||
442 | "failed: %d\n", unit, ret); | ||
443 | goto bail; | ||
444 | } | ||
445 | |||
446 | ret = create_file("flash", S_IFREG|S_IWUSR|S_IRUGO, dir, &tmp, | 261 | ret = create_file("flash", S_IFREG|S_IWUSR|S_IRUGO, dir, &tmp, |
447 | &flash_ops, dd); | 262 | &flash_ops, dd); |
448 | if (ret) { | 263 | if (ret) { |
@@ -508,8 +323,6 @@ static int remove_device_files(struct super_block *sb, | |||
508 | } | 323 | } |
509 | 324 | ||
510 | remove_file(dir, "flash"); | 325 | remove_file(dir, "flash"); |
511 | remove_file(dir, "port_info"); | ||
512 | remove_file(dir, "node_info"); | ||
513 | remove_file(dir, "atomic_counters"); | 326 | remove_file(dir, "atomic_counters"); |
514 | d_delete(dir); | 327 | d_delete(dir); |
515 | ret = simple_rmdir(root->d_inode, dir); | 328 | ret = simple_rmdir(root->d_inode, dir); |