9
0
Fork 0

mtp: Remember the first SLS this link is on

This commit is contained in:
Holger Hans Peter Freyther 2011-01-25 13:24:06 +01:00
parent 4c8ddb356c
commit 1ec2a749f0
2 changed files with 8 additions and 1 deletions

View File

@ -92,6 +92,7 @@ struct mtp_link {
int blocked;
int first_sls;
int link_no;
int sltm_pending;
int was_up;

View File

@ -577,13 +577,19 @@ static struct mtp_link *find_next_link(struct mtp_link_set *set,
void mtp_link_set_init_slc(struct mtp_link_set *set)
{
struct mtp_link *link = NULL;
struct mtp_link *link = NULL, *tmp;
int i;
llist_for_each_entry(tmp, &set->links, entry)
tmp->first_sls = 100;
for (i = 0; i < ARRAY_SIZE(set->slc); ++i) {
link = find_next_link(set, link);
set->slc[i] = link;
if (link && i < link->first_sls)
link->first_sls = i;
}
}