aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/arm
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2013-03-31 04:42:22 -0400
committerAl Viro <viro@zeniv.linux.org.uk>2013-04-09 14:13:26 -0400
commit9d4e5c54a3b67cc0246afe0274ba028a85e79a10 (patch)
treed7dd41f27bff490da310d65a453a946a52d4090a /drivers/scsi/arm
parent6b3a8bbfd15ca86da496845890a48bee27b423e4 (diff)
fas216: switch to ->show_info()
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'drivers/scsi/arm')
-rw-r--r--drivers/scsi/arm/arxescsi.c40
-rw-r--r--drivers/scsi/arm/cumana_2.c43
-rw-r--r--drivers/scsi/arm/eesox.c42
-rw-r--r--drivers/scsi/arm/fas216.c31
-rw-r--r--drivers/scsi/arm/fas216.h6
-rw-r--r--drivers/scsi/arm/powertec.c29
6 files changed, 49 insertions, 142 deletions
diff --git a/drivers/scsi/arm/arxescsi.c b/drivers/scsi/arm/arxescsi.c
index 9274510294ac..32d23212de48 100644
--- a/drivers/scsi/arm/arxescsi.c
+++ b/drivers/scsi/arm/arxescsi.c
@@ -220,47 +220,21 @@ static const char *arxescsi_info(struct Scsi_Host *host)
220 return string; 220 return string;
221} 221}
222 222
223/*
224 * Function: int arxescsi_proc_info(char *buffer, char **start, off_t offset,
225 * int length, int host_no, int inout)
226 * Purpose : Return information about the driver to a user process accessing
227 * the /proc filesystem.
228 * Params : buffer - a buffer to write information to
229 * start - a pointer into this buffer set by this routine to the start
230 * of the required information.
231 * offset - offset into information that we have read up to.
232 * length - length of buffer
233 * host_no - host number to return information for
234 * inout - 0 for reading, 1 for writing.
235 * Returns : length of data written to buffer.
236 */
237static int 223static int
238arxescsi_proc_info(struct Scsi_Host *host, char *buffer, char **start, off_t offset, int length, 224arxescsi_show_info(struct seq_file *m, struct Scsi_Host *host)
239 int inout)
240{ 225{
241 struct arxescsi_info *info; 226 struct arxescsi_info *info;
242 char *p = buffer;
243 int pos;
244
245 info = (struct arxescsi_info *)host->hostdata; 227 info = (struct arxescsi_info *)host->hostdata;
246 if (inout == 1)
247 return -EINVAL;
248
249 p += sprintf(p, "ARXE 16-bit SCSI driver v%s\n", VERSION);
250 p += fas216_print_host(&info->info, p);
251 p += fas216_print_stats(&info->info, p);
252 p += fas216_print_devices(&info->info, p);
253
254 *start = buffer + offset;
255 pos = p - buffer - offset;
256 if (pos > length)
257 pos = length;
258 228
259 return pos; 229 seq_printf(m, "ARXE 16-bit SCSI driver v%s\n", VERSION);
230 fas216_print_host(&info->info, m);
231 fas216_print_stats(&info->info, m);
232 fas216_print_devices(&info->info, m);
233 return 0;
260} 234}
261 235
262static struct scsi_host_template arxescsi_template = { 236static struct scsi_host_template arxescsi_template = {
263 .proc_info = arxescsi_proc_info, 237 .show_info = arxescsi_show_info,
264 .name = "ARXE SCSI card", 238 .name = "ARXE SCSI card",
265 .info = arxescsi_info, 239 .info = arxescsi_info,
266 .queuecommand = fas216_noqueue_command, 240 .queuecommand = fas216_noqueue_command,
diff --git a/drivers/scsi/arm/cumana_2.c b/drivers/scsi/arm/cumana_2.c
index e3bae93c3c22..58915f29055b 100644
--- a/drivers/scsi/arm/cumana_2.c
+++ b/drivers/scsi/arm/cumana_2.c
@@ -337,50 +337,25 @@ cumanascsi_2_set_proc_info(struct Scsi_Host *host, char *buffer, int length)
337 return ret; 337 return ret;
338} 338}
339 339
340/* Prototype: int cumanascsi_2_proc_info(char *buffer, char **start, off_t offset, 340static int cumanascsi_2_show_info(struct seq_file *m, struct Scsi_Host *host)
341 * int length, int host_no, int inout)
342 * Purpose : Return information about the driver to a user process accessing
343 * the /proc filesystem.
344 * Params : buffer - a buffer to write information to
345 * start - a pointer into this buffer set by this routine to the start
346 * of the required information.
347 * offset - offset into information that we have read up to.
348 * length - length of buffer
349 * host_no - host number to return information for
350 * inout - 0 for reading, 1 for writing.
351 * Returns : length of data written to buffer.
352 */
353int cumanascsi_2_proc_info (struct Scsi_Host *host, char *buffer, char **start, off_t offset,
354 int length, int inout)
355{ 341{
356 struct cumanascsi2_info *info; 342 struct cumanascsi2_info *info;
357 char *p = buffer;
358 int pos;
359
360 if (inout == 1)
361 return cumanascsi_2_set_proc_info(host, buffer, length);
362
363 info = (struct cumanascsi2_info *)host->hostdata; 343 info = (struct cumanascsi2_info *)host->hostdata;
364 344
365 p += sprintf(p, "Cumana SCSI II driver v%s\n", VERSION); 345 seq_printf(m, "Cumana SCSI II driver v%s\n", VERSION);
366 p += fas216_print_host(&info->info, p); 346 fas216_print_host(&info->info, m);
367 p += sprintf(p, "Term : o%s\n", 347 seq_printf(m, "Term : o%s\n",
368 info->terms ? "n" : "ff"); 348 info->terms ? "n" : "ff");
369 349
370 p += fas216_print_stats(&info->info, p); 350 fas216_print_stats(&info->info, m);
371 p += fas216_print_devices(&info->info, p); 351 fas216_print_devices(&info->info, m);
372 352 return 0;
373 *start = buffer + offset;
374 pos = p - buffer - offset;
375 if (pos > length)
376 pos = length;
377
378 return pos;
379} 353}
380 354
381static struct scsi_host_template cumanascsi2_template = { 355static struct scsi_host_template cumanascsi2_template = {
382 .module = THIS_MODULE, 356 .module = THIS_MODULE,
383 .proc_info = cumanascsi_2_proc_info, 357 .show_info = cumanascsi_2_show_info,
358 .write_info = cumanascsi_2_set_proc_info,
384 .name = "Cumana SCSI II", 359 .name = "Cumana SCSI II",
385 .info = cumanascsi_2_info, 360 .info = cumanascsi_2_info,
386 .queuecommand = fas216_queue_command, 361 .queuecommand = fas216_queue_command,
diff --git a/drivers/scsi/arm/eesox.c b/drivers/scsi/arm/eesox.c
index 8e36908415ec..5bf3c0d134b4 100644
--- a/drivers/scsi/arm/eesox.c
+++ b/drivers/scsi/arm/eesox.c
@@ -422,45 +422,20 @@ eesoxscsi_set_proc_info(struct Scsi_Host *host, char *buffer, int length)
422 return ret; 422 return ret;
423} 423}
424 424
425/* Prototype: int eesoxscsi_proc_info(char *buffer, char **start, off_t offset, 425static int eesoxscsi_show_info(struct seq_file *m, struct Scsi_Host *host)
426 * int length, int host_no, int inout)
427 * Purpose : Return information about the driver to a user process accessing
428 * the /proc filesystem.
429 * Params : buffer - a buffer to write information to
430 * start - a pointer into this buffer set by this routine to the start
431 * of the required information.
432 * offset - offset into information that we have read up to.
433 * length - length of buffer
434 * host_no - host number to return information for
435 * inout - 0 for reading, 1 for writing.
436 * Returns : length of data written to buffer.
437 */
438int eesoxscsi_proc_info(struct Scsi_Host *host, char *buffer, char **start, off_t offset,
439 int length, int inout)
440{ 426{
441 struct eesoxscsi_info *info; 427 struct eesoxscsi_info *info;
442 char *p = buffer;
443 int pos;
444
445 if (inout == 1)
446 return eesoxscsi_set_proc_info(host, buffer, length);
447 428
448 info = (struct eesoxscsi_info *)host->hostdata; 429 info = (struct eesoxscsi_info *)host->hostdata;
449 430
450 p += sprintf(p, "EESOX SCSI driver v%s\n", VERSION); 431 seq_printf(m, "EESOX SCSI driver v%s\n", VERSION);
451 p += fas216_print_host(&info->info, p); 432 fas216_print_host(&info->info, m);
452 p += sprintf(p, "Term : o%s\n", 433 seq_printf(m, "Term : o%s\n",
453 info->control & EESOX_TERM_ENABLE ? "n" : "ff"); 434 info->control & EESOX_TERM_ENABLE ? "n" : "ff");
454 435
455 p += fas216_print_stats(&info->info, p); 436 fas216_print_stats(&info->info, m);
456 p += fas216_print_devices(&info->info, p); 437 fas216_print_devices(&info->info, m);
457 438 return 0;
458 *start = buffer + offset;
459 pos = p - buffer - offset;
460 if (pos > length)
461 pos = length;
462
463 return pos;
464} 439}
465 440
466static ssize_t eesoxscsi_show_term(struct device *dev, struct device_attribute *attr, char *buf) 441static ssize_t eesoxscsi_show_term(struct device *dev, struct device_attribute *attr, char *buf)
@@ -498,7 +473,8 @@ static DEVICE_ATTR(bus_term, S_IRUGO | S_IWUSR,
498 473
499static struct scsi_host_template eesox_template = { 474static struct scsi_host_template eesox_template = {
500 .module = THIS_MODULE, 475 .module = THIS_MODULE,
501 .proc_info = eesoxscsi_proc_info, 476 .show_info = eesoxscsi_show_info,
477 .write_info = eesoxscsi_set_proc_info,
502 .name = "EESOX SCSI", 478 .name = "EESOX SCSI",
503 .info = eesoxscsi_info, 479 .info = eesoxscsi_info,
504 .queuecommand = fas216_queue_command, 480 .queuecommand = fas216_queue_command,
diff --git a/drivers/scsi/arm/fas216.c b/drivers/scsi/arm/fas216.c
index 737554c37d9e..b46a6f6c0eb3 100644
--- a/drivers/scsi/arm/fas216.c
+++ b/drivers/scsi/arm/fas216.c
@@ -2958,9 +2958,9 @@ void fas216_release(struct Scsi_Host *host)
2958 queue_free(&info->queues.issue); 2958 queue_free(&info->queues.issue);
2959} 2959}
2960 2960
2961int fas216_print_host(FAS216_Info *info, char *buffer) 2961void fas216_print_host(FAS216_Info *info, struct seq_file *m)
2962{ 2962{
2963 return sprintf(buffer, 2963 seq_printf(m,
2964 "\n" 2964 "\n"
2965 "Chip : %s\n" 2965 "Chip : %s\n"
2966 " Address: 0x%p\n" 2966 " Address: 0x%p\n"
@@ -2970,11 +2970,9 @@ int fas216_print_host(FAS216_Info *info, char *buffer)
2970 info->scsi.irq, info->scsi.dma); 2970 info->scsi.irq, info->scsi.dma);
2971} 2971}
2972 2972
2973int fas216_print_stats(FAS216_Info *info, char *buffer) 2973void fas216_print_stats(FAS216_Info *info, struct seq_file *m)
2974{ 2974{
2975 char *p = buffer; 2975 seq_printf(m, "\n"
2976
2977 p += sprintf(p, "\n"
2978 "Command Statistics:\n" 2976 "Command Statistics:\n"
2979 " Queued : %u\n" 2977 " Queued : %u\n"
2980 " Issued : %u\n" 2978 " Issued : %u\n"
@@ -2991,38 +2989,33 @@ int fas216_print_stats(FAS216_Info *info, char *buffer)
2991 info->stats.writes, info->stats.miscs, 2989 info->stats.writes, info->stats.miscs,
2992 info->stats.disconnects, info->stats.aborts, 2990 info->stats.disconnects, info->stats.aborts,
2993 info->stats.bus_resets, info->stats.host_resets); 2991 info->stats.bus_resets, info->stats.host_resets);
2994
2995 return p - buffer;
2996} 2992}
2997 2993
2998int fas216_print_devices(FAS216_Info *info, char *buffer) 2994void fas216_print_devices(FAS216_Info *info, struct seq_file *m)
2999{ 2995{
3000 struct fas216_device *dev; 2996 struct fas216_device *dev;
3001 struct scsi_device *scd; 2997 struct scsi_device *scd;
3002 char *p = buffer;
3003 2998
3004 p += sprintf(p, "Device/Lun TaggedQ Parity Sync\n"); 2999 seq_printf(m, "Device/Lun TaggedQ Parity Sync\n");
3005 3000
3006 shost_for_each_device(scd, info->host) { 3001 shost_for_each_device(scd, info->host) {
3007 dev = &info->device[scd->id]; 3002 dev = &info->device[scd->id];
3008 p += sprintf(p, " %d/%d ", scd->id, scd->lun); 3003 seq_printf(m, " %d/%d ", scd->id, scd->lun);
3009 if (scd->tagged_supported) 3004 if (scd->tagged_supported)
3010 p += sprintf(p, "%3sabled(%3d) ", 3005 seq_printf(m, "%3sabled(%3d) ",
3011 scd->simple_tags ? "en" : "dis", 3006 scd->simple_tags ? "en" : "dis",
3012 scd->current_tag); 3007 scd->current_tag);
3013 else 3008 else
3014 p += sprintf(p, "unsupported "); 3009 seq_printf(m, "unsupported ");
3015 3010
3016 p += sprintf(p, "%3sabled ", dev->parity_enabled ? "en" : "dis"); 3011 seq_printf(m, "%3sabled ", dev->parity_enabled ? "en" : "dis");
3017 3012
3018 if (dev->sof) 3013 if (dev->sof)
3019 p += sprintf(p, "offset %d, %d ns\n", 3014 seq_printf(m, "offset %d, %d ns\n",
3020 dev->sof, dev->period * 4); 3015 dev->sof, dev->period * 4);
3021 else 3016 else
3022 p += sprintf(p, "async\n"); 3017 seq_printf(m, "async\n");
3023 } 3018 }
3024
3025 return p - buffer;
3026} 3019}
3027 3020
3028EXPORT_SYMBOL(fas216_init); 3021EXPORT_SYMBOL(fas216_init);
diff --git a/drivers/scsi/arm/fas216.h b/drivers/scsi/arm/fas216.h
index df2e1b3ddfe2..c57c16ef8193 100644
--- a/drivers/scsi/arm/fas216.h
+++ b/drivers/scsi/arm/fas216.h
@@ -358,9 +358,9 @@ extern void fas216_remove (struct Scsi_Host *instance);
358 */ 358 */
359extern void fas216_release (struct Scsi_Host *instance); 359extern void fas216_release (struct Scsi_Host *instance);
360 360
361extern int fas216_print_host(FAS216_Info *info, char *buffer); 361extern void fas216_print_host(FAS216_Info *info, struct seq_file *m);
362extern int fas216_print_stats(FAS216_Info *info, char *buffer); 362extern void fas216_print_stats(FAS216_Info *info, struct seq_file *m);
363extern int fas216_print_devices(FAS216_Info *info, char *buffer); 363extern void fas216_print_devices(FAS216_Info *info, struct seq_file *m);
364 364
365/* Function: int fas216_eh_abort(struct scsi_cmnd *SCpnt) 365/* Function: int fas216_eh_abort(struct scsi_cmnd *SCpnt)
366 * Purpose : abort this command 366 * Purpose : abort this command
diff --git a/drivers/scsi/arm/powertec.c b/drivers/scsi/arm/powertec.c
index 246600b93555..abc9593615e9 100644
--- a/drivers/scsi/arm/powertec.c
+++ b/drivers/scsi/arm/powertec.c
@@ -237,32 +237,20 @@ powertecscsi_set_proc_info(struct Scsi_Host *host, char *buffer, int length)
237 * inout - 0 for reading, 1 for writing. 237 * inout - 0 for reading, 1 for writing.
238 * Returns : length of data written to buffer. 238 * Returns : length of data written to buffer.
239 */ 239 */
240int powertecscsi_proc_info(struct Scsi_Host *host, char *buffer, char **start, off_t offset, 240static int powertecscsi_show_info(struct seq_file *m, struct Scsi_Host *host)
241 int length, int inout)
242{ 241{
243 struct powertec_info *info; 242 struct powertec_info *info;
244 char *p = buffer;
245 int pos;
246
247 if (inout == 1)
248 return powertecscsi_set_proc_info(host, buffer, length);
249 243
250 info = (struct powertec_info *)host->hostdata; 244 info = (struct powertec_info *)host->hostdata;
251 245
252 p += sprintf(p, "PowerTec SCSI driver v%s\n", VERSION); 246 seq_printf(m, "PowerTec SCSI driver v%s\n", VERSION);
253 p += fas216_print_host(&info->info, p); 247 fas216_print_host(&info->info, m);
254 p += sprintf(p, "Term : o%s\n", 248 seq_printf(m, "Term : o%s\n",
255 info->term_ctl ? "n" : "ff"); 249 info->term_ctl ? "n" : "ff");
256 250
257 p += fas216_print_stats(&info->info, p); 251 fas216_print_stats(&info->info, m);
258 p += fas216_print_devices(&info->info, p); 252 fas216_print_devices(&info->info, m);
259 253 return 0;
260 *start = buffer + offset;
261 pos = p - buffer - offset;
262 if (pos > length)
263 pos = length;
264
265 return pos;
266} 254}
267 255
268static ssize_t powertecscsi_show_term(struct device *dev, struct device_attribute *attr, char *buf) 256static ssize_t powertecscsi_show_term(struct device *dev, struct device_attribute *attr, char *buf)
@@ -291,7 +279,8 @@ static DEVICE_ATTR(bus_term, S_IRUGO | S_IWUSR,
291 279
292static struct scsi_host_template powertecscsi_template = { 280static struct scsi_host_template powertecscsi_template = {
293 .module = THIS_MODULE, 281 .module = THIS_MODULE,
294 .proc_info = powertecscsi_proc_info, 282 .show_info = powertecscsi_show_info,
283 .write_info = powertecscsi_set_proc_info,
295 .name = "PowerTec SCSI", 284 .name = "PowerTec SCSI",
296 .info = powertecscsi_info, 285 .info = powertecscsi_info,
297 .queuecommand = fas216_queue_command, 286 .queuecommand = fas216_queue_command,