@@ -297,6 +297,7 @@ static void setup_sch_info(struct xhci_ep_ctx *ep_ctx,
297
297
CTX_TO_MAX_ESIT_PAYLOAD (le32_to_cpu (ep_ctx -> tx_info ));
298
298
299
299
sch_ep -> esit = get_esit (ep_ctx );
300
+ sch_ep -> num_esit = XHCI_MTK_MAX_ESIT / sch_ep -> esit ;
300
301
sch_ep -> ep_type = ep_type ;
301
302
sch_ep -> maxpkt = maxpkt ;
302
303
sch_ep -> offset = 0 ;
@@ -401,14 +402,12 @@ static void setup_sch_info(struct xhci_ep_ctx *ep_ctx,
401
402
static u32 get_max_bw (struct mu3h_sch_bw_info * sch_bw ,
402
403
struct mu3h_sch_ep_info * sch_ep , u32 offset )
403
404
{
404
- u32 num_esit ;
405
405
u32 max_bw = 0 ;
406
406
u32 bw ;
407
407
int i ;
408
408
int j ;
409
409
410
- num_esit = XHCI_MTK_MAX_ESIT / sch_ep -> esit ;
411
- for (i = 0 ; i < num_esit ; i ++ ) {
410
+ for (i = 0 ; i < sch_ep -> num_esit ; i ++ ) {
412
411
u32 base = offset + i * sch_ep -> esit ;
413
412
414
413
for (j = 0 ; j < sch_ep -> num_budget_microframes ; j ++ ) {
@@ -424,13 +423,11 @@ static u32 get_max_bw(struct mu3h_sch_bw_info *sch_bw,
424
423
static void update_bus_bw (struct mu3h_sch_bw_info * sch_bw ,
425
424
struct mu3h_sch_ep_info * sch_ep , bool used )
426
425
{
427
- u32 num_esit ;
428
426
u32 base ;
429
427
int i ;
430
428
int j ;
431
429
432
- num_esit = XHCI_MTK_MAX_ESIT / sch_ep -> esit ;
433
- for (i = 0 ; i < num_esit ; i ++ ) {
430
+ for (i = 0 ; i < sch_ep -> num_esit ; i ++ ) {
434
431
base = sch_ep -> offset + i * sch_ep -> esit ;
435
432
for (j = 0 ; j < sch_ep -> num_budget_microframes ; j ++ ) {
436
433
if (used )
@@ -446,12 +443,11 @@ static void update_bus_bw(struct mu3h_sch_bw_info *sch_bw,
446
443
static int check_fs_bus_bw (struct mu3h_sch_ep_info * sch_ep , int offset )
447
444
{
448
445
struct mu3h_sch_tt * tt = sch_ep -> sch_tt ;
449
- u32 num_esit , tmp ;
446
+ u32 tmp ;
450
447
int base ;
451
448
int i , j ;
452
449
453
- num_esit = XHCI_MTK_MAX_ESIT / sch_ep -> esit ;
454
- for (i = 0 ; i < num_esit ; i ++ ) {
450
+ for (i = 0 ; i < sch_ep -> num_esit ; i ++ ) {
455
451
base = offset + i * sch_ep -> esit ;
456
452
457
453
/*
@@ -533,12 +529,10 @@ static int check_sch_tt(struct mu3h_sch_ep_info *sch_ep, u32 offset)
533
529
static void update_sch_tt (struct mu3h_sch_ep_info * sch_ep , bool used )
534
530
{
535
531
struct mu3h_sch_tt * tt = sch_ep -> sch_tt ;
536
- u32 base , num_esit ;
532
+ u32 base ;
537
533
int i , j ;
538
534
539
- num_esit = XHCI_MTK_MAX_ESIT / sch_ep -> esit ;
540
-
541
- for (i = 0 ; i < num_esit ; i ++ ) {
535
+ for (i = 0 ; i < sch_ep -> num_esit ; i ++ ) {
542
536
base = sch_ep -> offset + i * sch_ep -> esit ;
543
537
544
538
for (j = 0 ; j < sch_ep -> num_budget_microframes ; j ++ )
0 commit comments