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
b8984674
Commit
b8984674
authored
Feb 18, 2004
by
Ben Collins
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
IEEE1394(r1138): Cleanup nodemgr probe, and fix a bug with the driver update.
parent
6cb9b20a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
63 additions
and
69 deletions
+63
-69
drivers/ieee1394/nodemgr.c
drivers/ieee1394/nodemgr.c
+63
-69
No files found.
drivers/ieee1394/nodemgr.c
View file @
b8984674
...
...
@@ -327,7 +327,7 @@ static ssize_t fw_get_destroy(struct bus_type *bus, char *buf)
{
return
sprintf
(
buf
,
"You can destroy in_limbo nodes by writing their GUID to this file
\n
"
);
}
BUS_ATTR
(
destroy
,
S_IWU
GO
|
S_IRUGO
,
fw_get_destroy
,
fw_set_destroy
);
BUS_ATTR
(
destroy
,
S_IWU
SR
|
S_IRUGO
,
fw_get_destroy
,
fw_set_destroy
);
fw_attr
(
ne
,
struct
node_entry
,
capabilities
,
unsigned
int
,
"0x%06x
\n
"
)
...
...
@@ -1177,46 +1177,6 @@ static void nodemgr_node_scan_one(struct host_info *hi,
}
static
void
nodemgr_ud_update_pdrv
(
struct
unit_directory
*
ud
)
{
struct
device
*
dev
;
struct
hpsb_protocol_driver
*
pdrv
;
list_for_each_entry
(
dev
,
&
ud
->
device
.
children
,
node
)
nodemgr_ud_update_pdrv
(
container_of
(
dev
,
struct
unit_directory
,
device
));
pdrv
=
container_of
(
ud
->
device
.
driver
,
struct
hpsb_protocol_driver
,
driver
);
if
(
pdrv
->
update
)
pdrv
->
update
(
ud
);
}
static
void
nodemgr_probe_ne
(
struct
host_info
*
hi
,
struct
node_entry
*
ne
)
{
struct
device
*
dev
;
if
(
ne
->
host
!=
hi
->
host
||
ne
->
in_limbo
)
return
;
dev
=
get_device
(
&
ne
->
device
);
if
(
!
dev
)
return
;
if
(
ne
->
needs_probe
)
{
nodemgr_process_root_directory
(
hi
,
ne
);
}
else
{
struct
device
*
udev
;
/* Update unit_dirs with attached drivers */
list_for_each_entry
(
udev
,
&
dev
->
children
,
node
)
nodemgr_ud_update_pdrv
(
container_of
(
udev
,
struct
unit_directory
,
device
));
}
put_device
(
dev
);
}
static
void
nodemgr_node_scan
(
struct
host_info
*
hi
,
int
generation
)
{
int
count
;
...
...
@@ -1303,6 +1263,56 @@ static void nodemgr_resume_ne(struct node_entry *ne)
}
static
void
nodemgr_ud_update_pdrv
(
struct
unit_directory
*
ud
)
{
struct
device
*
dev
;
struct
hpsb_protocol_driver
*
pdrv
;
if
(
!
get_device
(
&
ud
->
device
))
return
;
list_for_each_entry
(
dev
,
&
ud
->
device
.
children
,
node
)
nodemgr_ud_update_pdrv
(
container_of
(
dev
,
struct
unit_directory
,
device
));
if
(
ud
->
device
.
driver
)
{
pdrv
=
container_of
(
ud
->
device
.
driver
,
struct
hpsb_protocol_driver
,
driver
);
if
(
pdrv
->
update
)
pdrv
->
update
(
ud
);
}
put_device
(
&
ud
->
device
);
}
static
void
nodemgr_probe_ne
(
struct
host_info
*
hi
,
struct
node_entry
*
ne
,
int
generation
)
{
struct
device
*
dev
,
*
udev
;
if
(
ne
->
host
!=
hi
->
host
||
ne
->
in_limbo
)
return
;
dev
=
get_device
(
&
ne
->
device
);
if
(
!
dev
)
return
;
/* If "needs_probe", then this is either a new or changed node we
* rescan totally. If the generation matches for an existing node
* (one that existed prior to the bus reset) we send update calls
* down to the drivers. Otherwise, this is a dead node and we
* suspend it. */
if
(
ne
->
needs_probe
)
nodemgr_process_root_directory
(
hi
,
ne
);
else
if
(
ne
->
generation
==
generation
)
list_for_each_entry
(
udev
,
&
dev
->
children
,
node
)
nodemgr_ud_update_pdrv
(
container_of
(
udev
,
struct
unit_directory
,
device
));
else
nodemgr_suspend_ne
(
ne
);
put_device
(
dev
);
}
static
void
nodemgr_node_probe
(
struct
host_info
*
hi
,
int
generation
)
{
struct
hpsb_host
*
host
=
hi
->
host
;
...
...
@@ -1315,7 +1325,7 @@ static void nodemgr_node_probe(struct host_info *hi, int generation)
* unit-directories. */
down_read
(
&
class
->
subsys
.
rwsem
);
list_for_each_entry
(
cdev
,
&
class
->
children
,
node
)
nodemgr_probe_ne
(
hi
,
container_of
(
cdev
,
struct
node_entry
,
class_dev
));
nodemgr_probe_ne
(
hi
,
container_of
(
cdev
,
struct
node_entry
,
class_dev
)
,
generation
);
up_read
(
&
class
->
subsys
.
rwsem
);
...
...
@@ -1324,34 +1334,18 @@ static void nodemgr_node_probe(struct host_info *hi, int generation)
* skip the clean up for now, since we could remove nodes that
* were still on the bus. The bus reset increased hi->reset_sem,
* so there's a bus scan pending which will do the clean up
* eventually. */
if
(
generation
==
get_hpsb_generation
(
host
))
{
struct
node_entry
*
ne
;
/* Suspend any devices that are no longer connected */
down_read
(
&
class
->
subsys
.
rwsem
);
list_for_each_entry
(
cdev
,
&
class
->
children
,
node
)
{
ne
=
container_of
(
cdev
,
struct
node_entry
,
class_dev
);
if
(
ne
->
in_limbo
||
ne
->
host
!=
host
)
continue
;
if
(
ne
->
generation
==
generation
)
continue
;
nodemgr_suspend_ne
(
ne
);
}
up_read
(
&
class
->
subsys
.
rwsem
);
/* Now let's tell the bus to rescan our devices. This may
* seem like overhead, but the driver-model core will only
* scan a device for a driver when either the device is
* added, or when a new driver is added. A bus reset is a
* good reason to rescan devices that were there before.
* For example, an sbp2 device may become available for
* login, if the host that held it was just removed. */
* eventually.
*
* Now let's tell the bus to rescan our devices. This may seem
* like overhead, but the driver-model core will only scan a
* device for a driver when either the device is added, or when a
* new driver is added. A bus reset is a good reason to rescan
* devices that were there before. For example, an sbp2 device
* may become available for login, if the host that held it was
* just removed. */
if
(
generation
==
get_hpsb_generation
(
host
))
bus_rescan_devices
(
&
ieee1394_bus_type
);
}
return
;
}
...
...
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