mtp: Remember the first SLS this link is on
This commit is contained in:
parent
4c8ddb356c
commit
1ec2a749f0
|
@ -92,6 +92,7 @@ struct mtp_link {
|
||||||
|
|
||||||
int blocked;
|
int blocked;
|
||||||
|
|
||||||
|
int first_sls;
|
||||||
int link_no;
|
int link_no;
|
||||||
int sltm_pending;
|
int sltm_pending;
|
||||||
int was_up;
|
int was_up;
|
||||||
|
|
|
@ -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)
|
void mtp_link_set_init_slc(struct mtp_link_set *set)
|
||||||
{
|
{
|
||||||
struct mtp_link *link = NULL;
|
struct mtp_link *link = NULL, *tmp;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
|
llist_for_each_entry(tmp, &set->links, entry)
|
||||||
|
tmp->first_sls = 100;
|
||||||
|
|
||||||
|
|
||||||
for (i = 0; i < ARRAY_SIZE(set->slc); ++i) {
|
for (i = 0; i < ARRAY_SIZE(set->slc); ++i) {
|
||||||
link = find_next_link(set, link);
|
link = find_next_link(set, link);
|
||||||
set->slc[i] = link;
|
set->slc[i] = link;
|
||||||
|
|
||||||
|
if (link && i < link->first_sls)
|
||||||
|
link->first_sls = i;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Reference in New Issue