@@ -851,7 +851,7 @@ static int tb_dp_bandwidth_alloc_mode_enable(struct tb_tunnel *tunnel)
851
851
return 0 ;
852
852
}
853
853
854
- static int tb_dp_init (struct tb_tunnel * tunnel )
854
+ static int tb_dp_pre_activate (struct tb_tunnel * tunnel )
855
855
{
856
856
struct tb_port * in = tunnel -> src_port ;
857
857
struct tb_switch * sw = in -> sw ;
@@ -877,7 +877,7 @@ static int tb_dp_init(struct tb_tunnel *tunnel)
877
877
return tb_dp_bandwidth_alloc_mode_enable (tunnel );
878
878
}
879
879
880
- static void tb_dp_deinit (struct tb_tunnel * tunnel )
880
+ static void tb_dp_post_deactivate (struct tb_tunnel * tunnel )
881
881
{
882
882
struct tb_port * in = tunnel -> src_port ;
883
883
@@ -1368,9 +1368,9 @@ struct tb_tunnel *tb_tunnel_discover_dp(struct tb *tb, struct tb_port *in,
1368
1368
if (!tunnel )
1369
1369
return NULL ;
1370
1370
1371
- tunnel -> init = tb_dp_init ;
1372
- tunnel -> deinit = tb_dp_deinit ;
1371
+ tunnel -> pre_activate = tb_dp_pre_activate ;
1373
1372
tunnel -> activate = tb_dp_activate ;
1373
+ tunnel -> post_deactivate = tb_dp_post_deactivate ;
1374
1374
tunnel -> maximum_bandwidth = tb_dp_maximum_bandwidth ;
1375
1375
tunnel -> allocated_bandwidth = tb_dp_allocated_bandwidth ;
1376
1376
tunnel -> alloc_bandwidth = tb_dp_alloc_bandwidth ;
@@ -1464,9 +1464,9 @@ struct tb_tunnel *tb_tunnel_alloc_dp(struct tb *tb, struct tb_port *in,
1464
1464
if (!tunnel )
1465
1465
return NULL ;
1466
1466
1467
- tunnel -> init = tb_dp_init ;
1468
- tunnel -> deinit = tb_dp_deinit ;
1467
+ tunnel -> pre_activate = tb_dp_pre_activate ;
1469
1468
tunnel -> activate = tb_dp_activate ;
1469
+ tunnel -> post_deactivate = tb_dp_post_deactivate ;
1470
1470
tunnel -> maximum_bandwidth = tb_dp_maximum_bandwidth ;
1471
1471
tunnel -> allocated_bandwidth = tb_dp_allocated_bandwidth ;
1472
1472
tunnel -> alloc_bandwidth = tb_dp_alloc_bandwidth ;
@@ -1623,22 +1623,22 @@ static void tb_dma_release_credits(struct tb_path_hop *hop)
1623
1623
}
1624
1624
}
1625
1625
1626
- static void tb_dma_deinit_path (struct tb_path * path )
1626
+ static void tb_dma_destroy_path (struct tb_path * path )
1627
1627
{
1628
1628
struct tb_path_hop * hop ;
1629
1629
1630
1630
tb_path_for_each_hop (path , hop )
1631
1631
tb_dma_release_credits (hop );
1632
1632
}
1633
1633
1634
- static void tb_dma_deinit (struct tb_tunnel * tunnel )
1634
+ static void tb_dma_destroy (struct tb_tunnel * tunnel )
1635
1635
{
1636
1636
int i ;
1637
1637
1638
1638
for (i = 0 ; i < tunnel -> npaths ; i ++ ) {
1639
1639
if (!tunnel -> paths [i ])
1640
1640
continue ;
1641
- tb_dma_deinit_path (tunnel -> paths [i ]);
1641
+ tb_dma_destroy_path (tunnel -> paths [i ]);
1642
1642
}
1643
1643
}
1644
1644
@@ -1684,7 +1684,7 @@ struct tb_tunnel *tb_tunnel_alloc_dma(struct tb *tb, struct tb_port *nhi,
1684
1684
1685
1685
tunnel -> src_port = nhi ;
1686
1686
tunnel -> dst_port = dst ;
1687
- tunnel -> deinit = tb_dma_deinit ;
1687
+ tunnel -> destroy = tb_dma_destroy ;
1688
1688
1689
1689
credits = min_not_zero (dma_credits , nhi -> sw -> max_dma_credits );
1690
1690
@@ -1796,7 +1796,7 @@ static int tb_usb3_max_link_rate(struct tb_port *up, struct tb_port *down)
1796
1796
return min (up_max_rate , down_max_rate );
1797
1797
}
1798
1798
1799
- static int tb_usb3_init (struct tb_tunnel * tunnel )
1799
+ static int tb_usb3_pre_activate (struct tb_tunnel * tunnel )
1800
1800
{
1801
1801
tb_tunnel_dbg (tunnel , "allocating initial bandwidth %d/%d Mb/s\n" ,
1802
1802
tunnel -> allocated_up , tunnel -> allocated_down );
@@ -2027,7 +2027,7 @@ struct tb_tunnel *tb_tunnel_discover_usb3(struct tb *tb, struct tb_port *down,
2027
2027
tb_tunnel_dbg (tunnel , "currently allocated bandwidth %d/%d Mb/s\n" ,
2028
2028
tunnel -> allocated_up , tunnel -> allocated_down );
2029
2029
2030
- tunnel -> init = tb_usb3_init ;
2030
+ tunnel -> pre_activate = tb_usb3_pre_activate ;
2031
2031
tunnel -> consumed_bandwidth = tb_usb3_consumed_bandwidth ;
2032
2032
tunnel -> release_unused_bandwidth =
2033
2033
tb_usb3_release_unused_bandwidth ;
@@ -2116,7 +2116,7 @@ struct tb_tunnel *tb_tunnel_alloc_usb3(struct tb *tb, struct tb_port *up,
2116
2116
tunnel -> allocated_up = min (max_rate , max_up );
2117
2117
tunnel -> allocated_down = min (max_rate , max_down );
2118
2118
2119
- tunnel -> init = tb_usb3_init ;
2119
+ tunnel -> pre_activate = tb_usb3_pre_activate ;
2120
2120
tunnel -> consumed_bandwidth = tb_usb3_consumed_bandwidth ;
2121
2121
tunnel -> release_unused_bandwidth =
2122
2122
tb_usb3_release_unused_bandwidth ;
@@ -2140,8 +2140,8 @@ void tb_tunnel_free(struct tb_tunnel *tunnel)
2140
2140
if (!tunnel )
2141
2141
return ;
2142
2142
2143
- if (tunnel -> deinit )
2144
- tunnel -> deinit (tunnel );
2143
+ if (tunnel -> destroy )
2144
+ tunnel -> destroy (tunnel );
2145
2145
2146
2146
for (i = 0 ; i < tunnel -> npaths ; i ++ ) {
2147
2147
if (tunnel -> paths [i ])
@@ -2192,8 +2192,8 @@ int tb_tunnel_restart(struct tb_tunnel *tunnel)
2192
2192
}
2193
2193
}
2194
2194
2195
- if (tunnel -> init ) {
2196
- res = tunnel -> init (tunnel );
2195
+ if (tunnel -> pre_activate ) {
2196
+ res = tunnel -> pre_activate (tunnel );
2197
2197
if (res )
2198
2198
return res ;
2199
2199
}
@@ -2256,6 +2256,9 @@ void tb_tunnel_deactivate(struct tb_tunnel *tunnel)
2256
2256
if (tunnel -> paths [i ] && tunnel -> paths [i ]-> activated )
2257
2257
tb_path_deactivate (tunnel -> paths [i ]);
2258
2258
}
2259
+
2260
+ if (tunnel -> post_deactivate )
2261
+ tunnel -> post_deactivate (tunnel );
2259
2262
}
2260
2263
2261
2264
/**
0 commit comments