aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/host/isp116x.h
diff options
context:
space:
mode:
authorOlav Kongas <ok@artecdesign.ee>2005-11-03 10:38:14 -0500
committerGreg Kroah-Hartman <gregkh@suse.de>2006-01-04 16:48:29 -0500
commit959eea2191e8d74b16ef019b0f4bf875c14f4547 (patch)
treec535857225eec2a52ce18c162ed94c5f18427dee /drivers/usb/host/isp116x.h
parent535488fcf1e4b2331e1c4a1eb67ca09468c13507 (diff)
[PATCH] USB: isp116x-hcd: cleanup
The attached patch makes a cleanup of isp116x-hcd. Most of the volume of the patch comes from 2 sources: moving the code around to get rid of a few function prototypes and reworking register dumping functions/macros. Among other things, switched over from using procfs to debugfs. Cleanup. The following changes were made: - Rework register dumping code so it can be used for dumping to both syslog and debugfs. - Switch from procfs to debugfs.. - Die gracefully on Unrecoverable Error interrupt. - Fix memory leak in isp116x_urb_enqueue(), if HC happens to die in a narrow time window. - Fix a 'sparce' warning (unnecessary cast). - Report Devices Removable for root hub ports by default (was Devices Permanently Attached). - Move bus suspend/resume functions down in code to get rid of a few function prototypes. - A number of one-line cleanups. - Add an entry to MAINTAINERS. Signed-off-by: Olav Kongas <ok@artecdesign.ee> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> MAINTAINERS | 6 drivers/usb/host/isp116x-hcd.c | 429 ++++++++++++++++------------------------- drivers/usb/host/isp116x.h | 83 +++++-- 3 files changed, 230 insertions(+), 288 deletions(-)
Diffstat (limited to 'drivers/usb/host/isp116x.h')
-rw-r--r--drivers/usb/host/isp116x.h83
1 files changed, 54 insertions, 29 deletions
diff --git a/drivers/usb/host/isp116x.h b/drivers/usb/host/isp116x.h
index c6fec96785fe..a1b7c3813d3a 100644
--- a/drivers/usb/host/isp116x.h
+++ b/drivers/usb/host/isp116x.h
@@ -259,7 +259,7 @@ struct isp116x {
259 259
260 struct isp116x_platform_data *board; 260 struct isp116x_platform_data *board;
261 261
262 struct proc_dir_entry *pde; 262 struct dentry *dentry;
263 unsigned long stat1, stat2, stat4, stat8, stat16; 263 unsigned long stat1, stat2, stat4, stat8, stat16;
264 264
265 /* HC registers */ 265 /* HC registers */
@@ -450,7 +450,7 @@ static void isp116x_write_reg32(struct isp116x *isp116x, unsigned reg,
450 isp116x_write_data32(isp116x, (u32) val); 450 isp116x_write_data32(isp116x, (u32) val);
451} 451}
452 452
453#define isp116x_show_reg(d,r) { \ 453#define isp116x_show_reg_log(d,r,s) { \
454 if ((r) < 0x20) { \ 454 if ((r) < 0x20) { \
455 DBG("%-12s[%02x]: %08x\n", #r, \ 455 DBG("%-12s[%02x]: %08x\n", #r, \
456 r, isp116x_read_reg32(d, r)); \ 456 r, isp116x_read_reg32(d, r)); \
@@ -459,35 +459,60 @@ static void isp116x_write_reg32(struct isp116x *isp116x, unsigned reg,
459 r, isp116x_read_reg16(d, r)); \ 459 r, isp116x_read_reg16(d, r)); \
460 } \ 460 } \
461} 461}
462#define isp116x_show_reg_seq(d,r,s) { \
463 if ((r) < 0x20) { \
464 seq_printf(s, "%-12s[%02x]: %08x\n", #r, \
465 r, isp116x_read_reg32(d, r)); \
466 } else { \
467 seq_printf(s, "%-12s[%02x]: %04x\n", #r, \
468 r, isp116x_read_reg16(d, r)); \
469 } \
470}
462 471
463static inline void isp116x_show_regs(struct isp116x *isp116x) 472#define isp116x_show_regs(d,type,s) { \
473 isp116x_show_reg_##type(d, HCREVISION, s); \
474 isp116x_show_reg_##type(d, HCCONTROL, s); \
475 isp116x_show_reg_##type(d, HCCMDSTAT, s); \
476 isp116x_show_reg_##type(d, HCINTSTAT, s); \
477 isp116x_show_reg_##type(d, HCINTENB, s); \
478 isp116x_show_reg_##type(d, HCFMINTVL, s); \
479 isp116x_show_reg_##type(d, HCFMREM, s); \
480 isp116x_show_reg_##type(d, HCFMNUM, s); \
481 isp116x_show_reg_##type(d, HCLSTHRESH, s); \
482 isp116x_show_reg_##type(d, HCRHDESCA, s); \
483 isp116x_show_reg_##type(d, HCRHDESCB, s); \
484 isp116x_show_reg_##type(d, HCRHSTATUS, s); \
485 isp116x_show_reg_##type(d, HCRHPORT1, s); \
486 isp116x_show_reg_##type(d, HCRHPORT2, s); \
487 isp116x_show_reg_##type(d, HCHWCFG, s); \
488 isp116x_show_reg_##type(d, HCDMACFG, s); \
489 isp116x_show_reg_##type(d, HCXFERCTR, s); \
490 isp116x_show_reg_##type(d, HCuPINT, s); \
491 isp116x_show_reg_##type(d, HCuPINTENB, s); \
492 isp116x_show_reg_##type(d, HCCHIPID, s); \
493 isp116x_show_reg_##type(d, HCSCRATCH, s); \
494 isp116x_show_reg_##type(d, HCITLBUFLEN, s); \
495 isp116x_show_reg_##type(d, HCATLBUFLEN, s); \
496 isp116x_show_reg_##type(d, HCBUFSTAT, s); \
497 isp116x_show_reg_##type(d, HCRDITL0LEN, s); \
498 isp116x_show_reg_##type(d, HCRDITL1LEN, s); \
499}
500
501/*
502 Dump registers for debugfs.
503*/
504static inline void isp116x_show_regs_seq(struct isp116x *isp116x,
505 struct seq_file *s)
506{
507 isp116x_show_regs(isp116x, seq, s);
508}
509
510/*
511 Dump registers to syslog.
512*/
513static inline void isp116x_show_regs_log(struct isp116x *isp116x)
464{ 514{
465 isp116x_show_reg(isp116x, HCREVISION); 515 isp116x_show_regs(isp116x, log, NULL);
466 isp116x_show_reg(isp116x, HCCONTROL);
467 isp116x_show_reg(isp116x, HCCMDSTAT);
468 isp116x_show_reg(isp116x, HCINTSTAT);
469 isp116x_show_reg(isp116x, HCINTENB);
470 isp116x_show_reg(isp116x, HCFMINTVL);
471 isp116x_show_reg(isp116x, HCFMREM);
472 isp116x_show_reg(isp116x, HCFMNUM);
473 isp116x_show_reg(isp116x, HCLSTHRESH);
474 isp116x_show_reg(isp116x, HCRHDESCA);
475 isp116x_show_reg(isp116x, HCRHDESCB);
476 isp116x_show_reg(isp116x, HCRHSTATUS);
477 isp116x_show_reg(isp116x, HCRHPORT1);
478 isp116x_show_reg(isp116x, HCRHPORT2);
479 isp116x_show_reg(isp116x, HCHWCFG);
480 isp116x_show_reg(isp116x, HCDMACFG);
481 isp116x_show_reg(isp116x, HCXFERCTR);
482 isp116x_show_reg(isp116x, HCuPINT);
483 isp116x_show_reg(isp116x, HCuPINTENB);
484 isp116x_show_reg(isp116x, HCCHIPID);
485 isp116x_show_reg(isp116x, HCSCRATCH);
486 isp116x_show_reg(isp116x, HCITLBUFLEN);
487 isp116x_show_reg(isp116x, HCATLBUFLEN);
488 isp116x_show_reg(isp116x, HCBUFSTAT);
489 isp116x_show_reg(isp116x, HCRDITL0LEN);
490 isp116x_show_reg(isp116x, HCRDITL1LEN);
491} 516}
492 517
493#if defined(URB_TRACE) 518#if defined(URB_TRACE)