~vcs-imports/qemu/git

« back to all changes in this revision

Viewing changes to hw/usb-ohci.c

  • Committer: ths
  • Date: 2007-10-08 12:45:38 UTC
  • Revision ID: git-v1:450d4ff553af32fc9d83fef20d7106b0151526b8
CRIS disassembler, originally from binutils, by Edgar E. Iglesias.


git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3356 c046a42c-6fe2-441c-8c8c-71466251a162

Show diffs side-by-side

added added

removed removed

Lines of Context:
27
27
 *  o BIOS work to boot from USB storage
28
28
*/
29
29
 
30
 
#include "hw.h"
31
 
#include "qemu-timer.h"
32
 
#include "usb.h"
33
 
#include "pci.h"
34
 
#include "pxa.h"
 
30
#include "vl.h"
35
31
 
36
32
//#define DEBUG_OHCI
37
33
/* Dump packet contents.  */
38
34
//#define DEBUG_PACKET
39
 
//#define DEBUG_ISOCH
40
35
/* This causes frames to occur 1000x slower */
41
36
//#define OHCI_TIME_WARP 1
42
37
 
137
132
#define OHCI_ED_S         (1<<13)
138
133
#define OHCI_ED_K         (1<<14)
139
134
#define OHCI_ED_F         (1<<15)
140
 
#define OHCI_ED_MPS_SHIFT 16
141
 
#define OHCI_ED_MPS_MASK  (0x7ff<<OHCI_ED_MPS_SHIFT)
 
135
#define OHCI_ED_MPS_SHIFT 7
 
136
#define OHCI_ED_MPS_MASK  (0xf<<OHCI_ED_FA_SHIFT)
142
137
 
143
138
/* Flags in the head field of an Endpoint Desciptor.  */
144
139
#define OHCI_ED_H         1
157
152
#define OHCI_TD_CC_SHIFT  28
158
153
#define OHCI_TD_CC_MASK   (0xf<<OHCI_TD_CC_SHIFT)
159
154
 
160
 
/* Bitfields for the first word of an Isochronous Transfer Desciptor.  */
161
 
/* CC & DI - same as in the General Transfer Desciptor */
162
 
#define OHCI_TD_SF_SHIFT  0
163
 
#define OHCI_TD_SF_MASK   (0xffff<<OHCI_TD_SF_SHIFT)
164
 
#define OHCI_TD_FC_SHIFT  24
165
 
#define OHCI_TD_FC_MASK   (7<<OHCI_TD_FC_SHIFT)
166
 
 
167
 
/* Isochronous Transfer Desciptor - Offset / PacketStatusWord */
168
 
#define OHCI_TD_PSW_CC_SHIFT 12
169
 
#define OHCI_TD_PSW_CC_MASK  (0xf<<OHCI_TD_PSW_CC_SHIFT)
170
 
#define OHCI_TD_PSW_SIZE_SHIFT 0
171
 
#define OHCI_TD_PSW_SIZE_MASK  (0xfff<<OHCI_TD_PSW_SIZE_SHIFT)
172
 
 
173
 
#define OHCI_PAGE_MASK    0xfffff000
174
 
#define OHCI_OFFSET_MASK  0xfff
175
 
 
176
155
#define OHCI_DPTR_MASK    0xfffffff0
177
156
 
178
157
#define OHCI_BM(val, field) \
199
178
    uint32_t be;
200
179
};
201
180
 
202
 
/* Isochronous transfer descriptor */
203
 
struct ohci_iso_td {
204
 
    uint32_t flags;
205
 
    uint32_t bp;
206
 
    uint32_t next;
207
 
    uint32_t be;
208
 
    uint16_t offset[8];
209
 
};
210
 
 
211
181
#define USB_HZ                      12000000
212
182
 
213
183
/* OHCI Local stuff */
451
421
    return 1;
452
422
}
453
423
 
454
 
/* Get an array of words from main memory */
455
 
static inline int get_words(uint32_t addr, uint16_t *buf, int num)
456
 
{
457
 
    int i;
458
 
 
459
 
    for (i = 0; i < num; i++, buf++, addr += sizeof(*buf)) {
460
 
        cpu_physical_memory_rw(addr, (uint8_t *)buf, sizeof(*buf), 0);
461
 
        *buf = le16_to_cpu(*buf);
462
 
    }
463
 
 
464
 
    return 1;
465
 
}
466
 
 
467
 
/* Put an array of words in to main memory */
468
 
static inline int put_words(uint32_t addr, uint16_t *buf, int num)
469
 
{
470
 
    int i;
471
 
 
472
 
    for (i = 0; i < num; i++, buf++, addr += sizeof(*buf)) {
473
 
        uint16_t tmp = cpu_to_le16(*buf);
474
 
        cpu_physical_memory_rw(addr, (uint8_t *)&tmp, sizeof(tmp), 1);
475
 
    }
476
 
 
477
 
    return 1;
478
 
}
479
 
 
480
424
static inline int ohci_read_ed(uint32_t addr, struct ohci_ed *ed)
481
425
{
482
426
    return get_dwords(addr, (uint32_t *)ed, sizeof(*ed) >> 2);
487
431
    return get_dwords(addr, (uint32_t *)td, sizeof(*td) >> 2);
488
432
}
489
433
 
490
 
static inline int ohci_read_iso_td(uint32_t addr, struct ohci_iso_td *td)
491
 
{
492
 
    return (get_dwords(addr, (uint32_t *)td, 4) &&
493
 
            get_words(addr + 16, td->offset, 8));
494
 
}
495
 
 
496
434
static inline int ohci_put_ed(uint32_t addr, struct ohci_ed *ed)
497
435
{
498
436
    return put_dwords(addr, (uint32_t *)ed, sizeof(*ed) >> 2);
503
441
    return put_dwords(addr, (uint32_t *)td, sizeof(*td) >> 2);
504
442
}
505
443
 
506
 
static inline int ohci_put_iso_td(uint32_t addr, struct ohci_iso_td *td)
507
 
{
508
 
    return (put_dwords(addr, (uint32_t *)td, 4) &&
509
 
            put_words(addr + 16, td->offset, 8));
510
 
}
511
 
 
512
444
/* Read/Write the contents of a TD from/to main memory.  */
513
445
static void ohci_copy_td(struct ohci_td *td, uint8_t *buf, int len, int write)
514
446
{
527
459
    cpu_physical_memory_rw(ptr, buf, len - n, write);
528
460
}
529
461
 
530
 
/* Read/Write the contents of an ISO TD from/to main memory.  */
531
 
static void ohci_copy_iso_td(uint32_t start_addr, uint32_t end_addr,
532
 
                             uint8_t *buf, int len, int write)
533
 
{
534
 
    uint32_t ptr;
535
 
    uint32_t n;
536
 
 
537
 
    ptr = start_addr;
538
 
    n = 0x1000 - (ptr & 0xfff);
539
 
    if (n > len)
540
 
        n = len;
541
 
    cpu_physical_memory_rw(ptr, buf, n, write);
542
 
    if (n == len)
543
 
        return;
544
 
    ptr = end_addr & ~0xfffu;
545
 
    buf += n;
546
 
    cpu_physical_memory_rw(ptr, buf, len - n, write);
547
 
}
548
 
 
549
 
static void ohci_process_lists(OHCIState *ohci, int completion);
550
 
 
551
 
static void ohci_async_complete_packet(USBPacket *packet, void *opaque)
 
462
static void ohci_process_lists(OHCIState *ohci);
 
463
 
 
464
static void ohci_async_complete_packet(USBPacket * packet, void *opaque)
552
465
{
553
466
    OHCIState *ohci = opaque;
554
467
#ifdef DEBUG_PACKET
555
468
    dprintf("Async packet complete\n");
556
469
#endif
557
470
    ohci->async_complete = 1;
558
 
    ohci_process_lists(ohci, 1);
559
 
}
560
 
 
561
 
#define USUB(a, b) ((int16_t)((uint16_t)(a) - (uint16_t)(b)))
562
 
 
563
 
static int ohci_service_iso_td(OHCIState *ohci, struct ohci_ed *ed,
564
 
                               int completion)
565
 
{
566
 
    int dir;
567
 
    size_t len = 0;
568
 
    const char *str = NULL;
569
 
    int pid;
570
 
    int ret;
571
 
    int i;
572
 
    USBDevice *dev;
573
 
    struct ohci_iso_td iso_td;
574
 
    uint32_t addr;
575
 
    uint16_t starting_frame;
576
 
    int16_t relative_frame_number;
577
 
    int frame_count;
578
 
    uint32_t start_offset, next_offset, end_offset = 0;
579
 
    uint32_t start_addr, end_addr;
580
 
 
581
 
    addr = ed->head & OHCI_DPTR_MASK;
582
 
 
583
 
    if (!ohci_read_iso_td(addr, &iso_td)) {
584
 
        printf("usb-ohci: ISO_TD read error at %x\n", addr);
585
 
        return 0;
586
 
    }
587
 
 
588
 
    starting_frame = OHCI_BM(iso_td.flags, TD_SF);
589
 
    frame_count = OHCI_BM(iso_td.flags, TD_FC);
590
 
    relative_frame_number = USUB(ohci->frame_number, starting_frame); 
591
 
 
592
 
#ifdef DEBUG_ISOCH
593
 
    printf("--- ISO_TD ED head 0x%.8x tailp 0x%.8x\n"
594
 
           "0x%.8x 0x%.8x 0x%.8x 0x%.8x\n"
595
 
           "0x%.8x 0x%.8x 0x%.8x 0x%.8x\n"
596
 
           "0x%.8x 0x%.8x 0x%.8x 0x%.8x\n"
597
 
           "frame_number 0x%.8x starting_frame 0x%.8x\n"
598
 
           "frame_count  0x%.8x relative %d\n"
599
 
           "di 0x%.8x cc 0x%.8x\n",
600
 
           ed->head & OHCI_DPTR_MASK, ed->tail & OHCI_DPTR_MASK,
601
 
           iso_td.flags, iso_td.bp, iso_td.next, iso_td.be,
602
 
           iso_td.offset[0], iso_td.offset[1], iso_td.offset[2], iso_td.offset[3],
603
 
           iso_td.offset[4], iso_td.offset[5], iso_td.offset[6], iso_td.offset[7],
604
 
           ohci->frame_number, starting_frame, 
605
 
           frame_count, relative_frame_number,         
606
 
           OHCI_BM(iso_td.flags, TD_DI), OHCI_BM(iso_td.flags, TD_CC));
607
 
#endif
608
 
 
609
 
    if (relative_frame_number < 0) {
610
 
        dprintf("usb-ohci: ISO_TD R=%d < 0\n", relative_frame_number);
611
 
        return 1;
612
 
    } else if (relative_frame_number > frame_count) {
613
 
        /* ISO TD expired - retire the TD to the Done Queue and continue with
614
 
           the next ISO TD of the same ED */
615
 
        dprintf("usb-ohci: ISO_TD R=%d > FC=%d\n", relative_frame_number, 
616
 
               frame_count);
617
 
        OHCI_SET_BM(iso_td.flags, TD_CC, OHCI_CC_DATAOVERRUN);
618
 
        ed->head &= ~OHCI_DPTR_MASK;
619
 
        ed->head |= (iso_td.next & OHCI_DPTR_MASK);
620
 
        iso_td.next = ohci->done;
621
 
        ohci->done = addr;
622
 
        i = OHCI_BM(iso_td.flags, TD_DI);
623
 
        if (i < ohci->done_count)
624
 
            ohci->done_count = i;
625
 
        ohci_put_iso_td(addr, &iso_td);        
626
 
        return 0;
627
 
    }
628
 
 
629
 
    dir = OHCI_BM(ed->flags, ED_D);
630
 
    switch (dir) {
631
 
    case OHCI_TD_DIR_IN:
632
 
        str = "in";
633
 
        pid = USB_TOKEN_IN;
634
 
        break;
635
 
    case OHCI_TD_DIR_OUT:
636
 
        str = "out";
637
 
        pid = USB_TOKEN_OUT;
638
 
        break;
639
 
    case OHCI_TD_DIR_SETUP:
640
 
        str = "setup";
641
 
        pid = USB_TOKEN_SETUP;
642
 
        break;
643
 
    default:
644
 
        printf("usb-ohci: Bad direction %d\n", dir);
645
 
        return 1;
646
 
    }
647
 
 
648
 
    if (!iso_td.bp || !iso_td.be) {
649
 
        printf("usb-ohci: ISO_TD bp 0x%.8x be 0x%.8x\n", iso_td.bp, iso_td.be);
650
 
        return 1;
651
 
    }
652
 
 
653
 
    start_offset = iso_td.offset[relative_frame_number];
654
 
    next_offset = iso_td.offset[relative_frame_number + 1];
655
 
 
656
 
    if (!(OHCI_BM(start_offset, TD_PSW_CC) & 0xe) || 
657
 
        ((relative_frame_number < frame_count) && 
658
 
         !(OHCI_BM(next_offset, TD_PSW_CC) & 0xe))) {
659
 
        printf("usb-ohci: ISO_TD cc != not accessed 0x%.8x 0x%.8x\n",
660
 
               start_offset, next_offset);
661
 
        return 1;
662
 
    }
663
 
 
664
 
    if ((relative_frame_number < frame_count) && (start_offset > next_offset)) {
665
 
        printf("usb-ohci: ISO_TD start_offset=0x%.8x > next_offset=0x%.8x\n",
666
 
                start_offset, next_offset);
667
 
        return 1;
668
 
    }
669
 
 
670
 
    if ((start_offset & 0x1000) == 0) {
671
 
        start_addr = (iso_td.bp & OHCI_PAGE_MASK) |
672
 
            (start_offset & OHCI_OFFSET_MASK);
673
 
    } else {
674
 
        start_addr = (iso_td.be & OHCI_PAGE_MASK) |
675
 
            (start_offset & OHCI_OFFSET_MASK);
676
 
    }
677
 
 
678
 
    if (relative_frame_number < frame_count) {
679
 
        end_offset = next_offset - 1;
680
 
        if ((end_offset & 0x1000) == 0) {
681
 
            end_addr = (iso_td.bp & OHCI_PAGE_MASK) |
682
 
                (end_offset & OHCI_OFFSET_MASK);
683
 
        } else {
684
 
            end_addr = (iso_td.be & OHCI_PAGE_MASK) |
685
 
                (end_offset & OHCI_OFFSET_MASK);
686
 
        }
687
 
    } else {
688
 
        /* Last packet in the ISO TD */
689
 
        end_addr = iso_td.be;
690
 
    }
691
 
 
692
 
    if ((start_addr & OHCI_PAGE_MASK) != (end_addr & OHCI_PAGE_MASK)) {
693
 
        len = (end_addr & OHCI_OFFSET_MASK) + 0x1001
694
 
            - (start_addr & OHCI_OFFSET_MASK);
695
 
    } else {
696
 
        len = end_addr - start_addr + 1;
697
 
    }
698
 
 
699
 
    if (len && dir != OHCI_TD_DIR_IN) {
700
 
        ohci_copy_iso_td(start_addr, end_addr, ohci->usb_buf, len, 0);
701
 
    }
702
 
 
703
 
    if (completion) {
704
 
        ret = ohci->usb_packet.len;
705
 
    } else {
706
 
        ret = USB_RET_NODEV;
707
 
        for (i = 0; i < ohci->num_ports; i++) {
708
 
            dev = ohci->rhport[i].port.dev;
709
 
            if ((ohci->rhport[i].ctrl & OHCI_PORT_PES) == 0)
710
 
                continue;
711
 
            ohci->usb_packet.pid = pid;
712
 
            ohci->usb_packet.devaddr = OHCI_BM(ed->flags, ED_FA);
713
 
            ohci->usb_packet.devep = OHCI_BM(ed->flags, ED_EN);
714
 
            ohci->usb_packet.data = ohci->usb_buf;
715
 
            ohci->usb_packet.len = len;
716
 
            ohci->usb_packet.complete_cb = ohci_async_complete_packet;
717
 
            ohci->usb_packet.complete_opaque = ohci;
718
 
            ret = dev->handle_packet(dev, &ohci->usb_packet);
719
 
            if (ret != USB_RET_NODEV)
720
 
                break;
721
 
        }
722
 
    
723
 
        if (ret == USB_RET_ASYNC) {
724
 
            return 1;
725
 
        }
726
 
    }
727
 
 
728
 
#ifdef DEBUG_ISOCH
729
 
    printf("so 0x%.8x eo 0x%.8x\nsa 0x%.8x ea 0x%.8x\ndir %s len %zu ret %d\n",
730
 
           start_offset, end_offset, start_addr, end_addr, str, len, ret);
731
 
#endif
732
 
 
733
 
    /* Writeback */
734
 
    if (dir == OHCI_TD_DIR_IN && ret >= 0 && ret <= len) {
735
 
        /* IN transfer succeeded */
736
 
        ohci_copy_iso_td(start_addr, end_addr, ohci->usb_buf, ret, 1);
737
 
        OHCI_SET_BM(iso_td.offset[relative_frame_number], TD_PSW_CC,
738
 
                    OHCI_CC_NOERROR);
739
 
        OHCI_SET_BM(iso_td.offset[relative_frame_number], TD_PSW_SIZE, ret);
740
 
    } else if (dir == OHCI_TD_DIR_OUT && ret == len) {
741
 
        /* OUT transfer succeeded */
742
 
        OHCI_SET_BM(iso_td.offset[relative_frame_number], TD_PSW_CC,
743
 
                    OHCI_CC_NOERROR);
744
 
        OHCI_SET_BM(iso_td.offset[relative_frame_number], TD_PSW_SIZE, 0);
745
 
    } else {
746
 
        if (ret > (ssize_t) len) {
747
 
            printf("usb-ohci: DataOverrun %d > %zu\n", ret, len);
748
 
            OHCI_SET_BM(iso_td.offset[relative_frame_number], TD_PSW_CC,
749
 
                        OHCI_CC_DATAOVERRUN);
750
 
            OHCI_SET_BM(iso_td.offset[relative_frame_number], TD_PSW_SIZE,
751
 
                        len);
752
 
        } else if (ret >= 0) {
753
 
            printf("usb-ohci: DataUnderrun %d\n", ret);
754
 
            OHCI_SET_BM(iso_td.offset[relative_frame_number], TD_PSW_CC,
755
 
                        OHCI_CC_DATAUNDERRUN);
756
 
        } else {
757
 
            switch (ret) {
758
 
            case USB_RET_NODEV:
759
 
                OHCI_SET_BM(iso_td.offset[relative_frame_number], TD_PSW_CC,
760
 
                            OHCI_CC_DEVICENOTRESPONDING);
761
 
                OHCI_SET_BM(iso_td.offset[relative_frame_number], TD_PSW_SIZE,
762
 
                            0);
763
 
                break;
764
 
            case USB_RET_NAK:
765
 
            case USB_RET_STALL:
766
 
                printf("usb-ohci: got NAK/STALL %d\n", ret);
767
 
                OHCI_SET_BM(iso_td.offset[relative_frame_number], TD_PSW_CC,
768
 
                            OHCI_CC_STALL);
769
 
                OHCI_SET_BM(iso_td.offset[relative_frame_number], TD_PSW_SIZE,
770
 
                            0);
771
 
                break;
772
 
            default:
773
 
                printf("usb-ohci: Bad device response %d\n", ret);
774
 
                OHCI_SET_BM(iso_td.offset[relative_frame_number], TD_PSW_CC,
775
 
                            OHCI_CC_UNDEXPETEDPID);
776
 
                break;
777
 
            }
778
 
        }
779
 
    }
780
 
 
781
 
    if (relative_frame_number == frame_count) {
782
 
        /* Last data packet of ISO TD - retire the TD to the Done Queue */
783
 
        OHCI_SET_BM(iso_td.flags, TD_CC, OHCI_CC_NOERROR);
784
 
        ed->head &= ~OHCI_DPTR_MASK;
785
 
        ed->head |= (iso_td.next & OHCI_DPTR_MASK);
786
 
        iso_td.next = ohci->done;
787
 
        ohci->done = addr;
788
 
        i = OHCI_BM(iso_td.flags, TD_DI);
789
 
        if (i < ohci->done_count)
790
 
            ohci->done_count = i;
791
 
    }
792
 
    ohci_put_iso_td(addr, &iso_td);
793
 
    return 1;
 
471
    ohci_process_lists(ohci);
794
472
}
795
473
 
796
474
/* Service a transport descriptor.
800
478
{
801
479
    int dir;
802
480
    size_t len = 0;
803
 
    const char *str = NULL;
 
481
    char *str = NULL;
804
482
    int pid;
805
483
    int ret;
806
484
    int i;
869
547
    dprintf(" TD @ 0x%.8x %u bytes %s r=%d cbp=0x%.8x be=0x%.8x\n",
870
548
            addr, len, str, flag_r, td.cbp, td.be);
871
549
 
872
 
    if (len > 0 && dir != OHCI_TD_DIR_IN) {
 
550
    if (len >= 0 && dir != OHCI_TD_DIR_IN) {
873
551
        dprintf("  data:");
874
552
        for (i = 0; i < len; i++)
875
553
            printf(" %.2x", ohci->usb_buf[i]);
993
671
}
994
672
 
995
673
/* Service an endpoint list.  Returns nonzero if active TD were found.  */
996
 
static int ohci_service_ed_list(OHCIState *ohci, uint32_t head, int completion)
 
674
static int ohci_service_ed_list(OHCIState *ohci, uint32_t head)
997
675
{
998
676
    struct ohci_ed ed;
999
677
    uint32_t next_ed;
1024
702
            continue;
1025
703
        }
1026
704
 
 
705
        /* Skip isochronous endpoints.  */
 
706
        if (ed.flags & OHCI_ED_F)
 
707
          continue;
 
708
 
1027
709
        while ((ed.head & OHCI_DPTR_MASK) != ed.tail) {
1028
710
#ifdef DEBUG_PACKET
1029
711
            dprintf("ED @ 0x%.8x fa=%u en=%u d=%u s=%u k=%u f=%u mps=%u "
1037
719
#endif
1038
720
            active = 1;
1039
721
 
1040
 
            if ((ed.flags & OHCI_ED_F) == 0) {
1041
 
                if (ohci_service_td(ohci, &ed))
1042
 
                    break;
1043
 
            } else {
1044
 
                /* Handle isochronous endpoints */
1045
 
                if (ohci_service_iso_td(ohci, &ed, completion))
1046
 
                    break;
1047
 
            }
 
722
            if (ohci_service_td(ohci, &ed))
 
723
                break;
1048
724
        }
1049
725
 
1050
726
        ohci_put_ed(cur, &ed);
1062
738
}
1063
739
 
1064
740
/* Process Control and Bulk lists.  */
1065
 
static void ohci_process_lists(OHCIState *ohci, int completion)
 
741
static void ohci_process_lists(OHCIState *ohci)
1066
742
{
1067
743
    if ((ohci->ctl & OHCI_CTL_CLE) && (ohci->status & OHCI_STATUS_CLF)) {
1068
744
        if (ohci->ctrl_cur && ohci->ctrl_cur != ohci->ctrl_head)
1069
 
          dprintf("usb-ohci: head %x, cur %x\n",
1070
 
                          ohci->ctrl_head, ohci->ctrl_cur);
1071
 
        if (!ohci_service_ed_list(ohci, ohci->ctrl_head, completion)) {
 
745
          dprintf("usb-ohci: head %x, cur %x\n", ohci->ctrl_head, ohci->ctrl_cur);
 
746
        if (!ohci_service_ed_list(ohci, ohci->ctrl_head)) {
1072
747
            ohci->ctrl_cur = 0;
1073
748
            ohci->status &= ~OHCI_STATUS_CLF;
1074
749
        }
1075
750
    }
1076
751
 
1077
752
    if ((ohci->ctl & OHCI_CTL_BLE) && (ohci->status & OHCI_STATUS_BLF)) {
1078
 
        if (!ohci_service_ed_list(ohci, ohci->bulk_head, completion)) {
 
753
        if (!ohci_service_ed_list(ohci, ohci->bulk_head)) {
1079
754
            ohci->bulk_cur = 0;
1080
755
            ohci->status &= ~OHCI_STATUS_BLF;
1081
756
        }
1095
770
        int n;
1096
771
 
1097
772
        n = ohci->frame_number & 0x1f;
1098
 
        ohci_service_ed_list(ohci, le32_to_cpu(hcca.intr[n]), 0);
 
773
        ohci_service_ed_list(ohci, le32_to_cpu(hcca.intr[n]));
1099
774
    }
1100
775
 
1101
776
    /* Cancel all pending packets if either of the lists has been disabled.  */
1105
780
        ohci->async_td = 0;
1106
781
    }
1107
782
    ohci->old_ctl = ohci->ctl;
1108
 
    ohci_process_lists(ohci, 0);
 
783
    ohci_process_lists(ohci);
1109
784
 
1110
785
    /* Frame boundary, so do EOF stuf here */
1111
786
    ohci->frt = ohci->fit;
1531
1206
        ohci_set_frame_interval(ohci, val);
1532
1207
        break;
1533
1208
 
1534
 
    case 15: /* HcFmNumber */
1535
 
        break;
1536
 
 
1537
1209
    case 16: /* HcPeriodicStart */
1538
1210
        ohci->pstart = val & 0xffff;
1539
1211
        break;
1598
1270
    int i;
1599
1271
 
1600
1272
    if (usb_frame_time == 0) {
1601
 
#ifdef OHCI_TIME_WARP
 
1273
#if OHCI_TIME_WARP
1602
1274
        usb_frame_time = ticks_per_sec;
1603
1275
        usb_bit_time = muldiv64(1, ticks_per_sec, USB_HZ/1000);
1604
1276
#else