Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
linux
Commits
2bf9da39
Commit
2bf9da39
authored
Jun 30, 2003
by
Greg Kroah-Hartman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[PATCH] USB: move ehci's sysfs files to the class device instead of the pci device.
parent
6ee56790
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
28 additions
and
23 deletions
+28
-23
drivers/usb/host/ehci-dbg.c
drivers/usb/host/ehci-dbg.c
+28
-23
No files found.
drivers/usb/host/ehci-dbg.c
View file @
2bf9da39
...
@@ -392,9 +392,10 @@ static void qh_lines (
...
@@ -392,9 +392,10 @@ static void qh_lines (
}
}
static
ssize_t
static
ssize_t
show_async
(
struct
device
*
dev
,
char
*
buf
)
show_async
(
struct
class_device
*
class_
dev
,
char
*
buf
)
{
{
struct
pci_dev
*
pdev
;
struct
usb_bus
*
bus
;
struct
usb_hcd
*
hcd
;
struct
ehci_hcd
*
ehci
;
struct
ehci_hcd
*
ehci
;
unsigned
long
flags
;
unsigned
long
flags
;
unsigned
temp
,
size
;
unsigned
temp
,
size
;
...
@@ -403,8 +404,9 @@ show_async (struct device *dev, char *buf)
...
@@ -403,8 +404,9 @@ show_async (struct device *dev, char *buf)
*
buf
=
0
;
*
buf
=
0
;
pdev
=
container_of
(
dev
,
struct
pci_dev
,
dev
);
bus
=
to_usb_bus
(
class_dev
);
ehci
=
container_of
(
pci_get_drvdata
(
pdev
),
struct
ehci_hcd
,
hcd
);
hcd
=
bus
->
hcpriv
;
ehci
=
hcd_to_ehci
(
hcd
);
next
=
buf
;
next
=
buf
;
size
=
PAGE_SIZE
;
size
=
PAGE_SIZE
;
...
@@ -427,14 +429,15 @@ show_async (struct device *dev, char *buf)
...
@@ -427,14 +429,15 @@ show_async (struct device *dev, char *buf)
return
strlen
(
buf
);
return
strlen
(
buf
);
}
}
static
DEVICE_ATTR
(
async
,
S_IRUGO
,
show_async
,
NULL
);
static
CLASS_
DEVICE_ATTR
(
async
,
S_IRUGO
,
show_async
,
NULL
);
#define DBG_SCHED_LIMIT 64
#define DBG_SCHED_LIMIT 64
static
ssize_t
static
ssize_t
show_periodic
(
struct
device
*
dev
,
char
*
buf
)
show_periodic
(
struct
class_device
*
class_
dev
,
char
*
buf
)
{
{
struct
pci_dev
*
pdev
;
struct
usb_bus
*
bus
;
struct
usb_hcd
*
hcd
;
struct
ehci_hcd
*
ehci
;
struct
ehci_hcd
*
ehci
;
unsigned
long
flags
;
unsigned
long
flags
;
union
ehci_shadow
p
,
*
seen
;
union
ehci_shadow
p
,
*
seen
;
...
@@ -446,8 +449,9 @@ show_periodic (struct device *dev, char *buf)
...
@@ -446,8 +449,9 @@ show_periodic (struct device *dev, char *buf)
return
0
;
return
0
;
seen_count
=
0
;
seen_count
=
0
;
pdev
=
container_of
(
dev
,
struct
pci_dev
,
dev
);
bus
=
to_usb_bus
(
class_dev
);
ehci
=
container_of
(
pci_get_drvdata
(
pdev
),
struct
ehci_hcd
,
hcd
);
hcd
=
bus
->
hcpriv
;
ehci
=
hcd_to_ehci
(
hcd
);
next
=
buf
;
next
=
buf
;
size
=
PAGE_SIZE
;
size
=
PAGE_SIZE
;
...
@@ -535,14 +539,15 @@ show_periodic (struct device *dev, char *buf)
...
@@ -535,14 +539,15 @@ show_periodic (struct device *dev, char *buf)
return
PAGE_SIZE
-
size
;
return
PAGE_SIZE
-
size
;
}
}
static
DEVICE_ATTR
(
periodic
,
S_IRUGO
,
show_periodic
,
NULL
);
static
CLASS_
DEVICE_ATTR
(
periodic
,
S_IRUGO
,
show_periodic
,
NULL
);
#undef DBG_SCHED_LIMIT
#undef DBG_SCHED_LIMIT
static
ssize_t
static
ssize_t
show_registers
(
struct
device
*
dev
,
char
*
buf
)
show_registers
(
struct
class_device
*
class_
dev
,
char
*
buf
)
{
{
struct
pci_dev
*
pdev
;
struct
usb_bus
*
bus
;
struct
usb_hcd
*
hcd
;
struct
ehci_hcd
*
ehci
;
struct
ehci_hcd
*
ehci
;
unsigned
long
flags
;
unsigned
long
flags
;
unsigned
temp
,
size
,
i
;
unsigned
temp
,
size
,
i
;
...
@@ -550,9 +555,9 @@ show_registers (struct device *dev, char *buf)
...
@@ -550,9 +555,9 @@ show_registers (struct device *dev, char *buf)
static
char
fmt
[]
=
"%*s
\n
"
;
static
char
fmt
[]
=
"%*s
\n
"
;
static
char
label
[]
=
""
;
static
char
label
[]
=
""
;
pdev
=
container_of
(
dev
,
struct
pci_dev
,
dev
);
bus
=
to_usb_bus
(
class_
dev
);
ehci
=
container_of
(
pci_get_drvdata
(
pdev
),
struct
ehci_hcd
,
hcd
)
;
hcd
=
bus
->
hcpriv
;
ehci
=
hcd_to_ehci
(
hcd
);
next
=
buf
;
next
=
buf
;
size
=
PAGE_SIZE
;
size
=
PAGE_SIZE
;
...
@@ -562,7 +567,7 @@ show_registers (struct device *dev, char *buf)
...
@@ -562,7 +567,7 @@ show_registers (struct device *dev, char *buf)
i
=
readw
(
&
ehci
->
caps
->
hci_version
);
i
=
readw
(
&
ehci
->
caps
->
hci_version
);
temp
=
snprintf
(
next
,
size
,
temp
=
snprintf
(
next
,
size
,
"%s
\n
EHCI %x.%02x, hcd state %d (driver "
DRIVER_VERSION
")
\n
"
,
"%s
\n
EHCI %x.%02x, hcd state %d (driver "
DRIVER_VERSION
")
\n
"
,
pdev
->
dev
.
name
,
hcd
->
pdev
->
dev
.
name
,
i
>>
8
,
i
&
0x0ff
,
ehci
->
hcd
.
state
);
i
>>
8
,
i
&
0x0ff
,
ehci
->
hcd
.
state
);
size
-=
temp
;
size
-=
temp
;
next
+=
temp
;
next
+=
temp
;
...
@@ -636,20 +641,20 @@ show_registers (struct device *dev, char *buf)
...
@@ -636,20 +641,20 @@ show_registers (struct device *dev, char *buf)
return
PAGE_SIZE
-
size
;
return
PAGE_SIZE
-
size
;
}
}
static
DEVICE_ATTR
(
registers
,
S_IRUGO
,
show_registers
,
NULL
);
static
CLASS_
DEVICE_ATTR
(
registers
,
S_IRUGO
,
show_registers
,
NULL
);
static
inline
void
create_debug_files
(
struct
ehci_hcd
*
bus
)
static
inline
void
create_debug_files
(
struct
ehci_hcd
*
bus
)
{
{
device_create_file
(
&
bus
->
hcd
.
pdev
->
dev
,
&
dev
_attr_async
);
class_device_create_file
(
&
bus
->
hcd
.
self
.
class_dev
,
&
class_device
_attr_async
);
device_create_file
(
&
bus
->
hcd
.
pdev
->
dev
,
&
dev
_attr_periodic
);
class_device_create_file
(
&
bus
->
hcd
.
self
.
class_dev
,
&
class_device
_attr_periodic
);
device_create_file
(
&
bus
->
hcd
.
pdev
->
dev
,
&
dev
_attr_registers
);
class_device_create_file
(
&
bus
->
hcd
.
self
.
class_dev
,
&
class_device
_attr_registers
);
}
}
static
inline
void
remove_debug_files
(
struct
ehci_hcd
*
bus
)
static
inline
void
remove_debug_files
(
struct
ehci_hcd
*
bus
)
{
{
device_remove_file
(
&
bus
->
hcd
.
pdev
->
dev
,
&
dev
_attr_async
);
class_device_remove_file
(
&
bus
->
hcd
.
self
.
class_dev
,
&
class_device
_attr_async
);
device_remove_file
(
&
bus
->
hcd
.
pdev
->
dev
,
&
dev
_attr_periodic
);
class_device_remove_file
(
&
bus
->
hcd
.
self
.
class_dev
,
&
class_device
_attr_periodic
);
device_remove_file
(
&
bus
->
hcd
.
pdev
->
dev
,
&
dev
_attr_registers
);
class_device_remove_file
(
&
bus
->
hcd
.
self
.
class_dev
,
&
class_device
_attr_registers
);
}
}
#endif
/* STUB_DEBUG_FILES */
#endif
/* STUB_DEBUG_FILES */
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment