Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/drv/uhci-hcd/hc.h

    r6ce42e85 r302a4b6  
    4848#include "transfer_list.h"
    4949
     50/** UHCI I/O registers layout */
    5051typedef struct uhci_regs {
     52        /** Command register, controls HC behaviour */
    5153        uint16_t usbcmd;
    5254#define UHCI_CMD_MAX_PACKET (1 << 7)
     
    5961#define UHCI_CMD_RUN_STOP  (1 << 0)
    6062
     63        /** Status register, 1 means interrupt is asserted (if enabled) */
    6164        uint16_t usbsts;
    6265#define UHCI_STATUS_HALTED (1 << 5)
     
    6669#define UHCI_STATUS_ERROR_INTERRUPT (1 << 1)
    6770#define UHCI_STATUS_INTERRUPT (1 << 0)
     71#define UHCI_STATUS_NM_INTERRUPTS \
     72    (UHCI_STATUS_PROCESS_ERROR | UHCI_STATUS_SYSTEM_ERROR)
    6873
     74        /** Interrupt enabled registers */
    6975        uint16_t usbintr;
    7076#define UHCI_INTR_SHORT_PACKET (1 << 3)
     
    7379#define UHCI_INTR_CRC (1 << 0)
    7480
     81        /** Register stores frame number used in SOF packet */
    7582        uint16_t frnum;
     83
     84        /** Pointer(physical) to the Frame List */
    7685        uint32_t flbaseadd;
     86
     87        /** SOF modification to match external timers */
    7788        uint8_t sofmod;
    7889} regs_t;
    7990
    8091#define UHCI_FRAME_LIST_COUNT 1024
    81 #define UHCI_CLEANER_TIMEOUT 10000
     92#define UHCI_INT_EMULATOR_TIMEOUT 10000
    8293#define UHCI_DEBUGER_TIMEOUT 5000000
    8394#define UHCI_ALLOWED_HW_FAIL 5
     95#define UHCI_NEEDED_IRQ_COMMANDS 5
    8496
     97/* Main HC driver structure */
    8598typedef struct hc {
     99        /** USB bus driver, devices and addresses */
    86100        usb_device_keeper_t manager;
     101        /** USB bus driver, endpoints */
    87102        usb_endpoint_manager_t ep_manager;
    88103
     104        /** Addresses of I/O registers */
    89105        regs_t *registers;
    90106
     107        /** Frame List contains 1024 link pointers */
    91108        link_pointer_t *frame_list;
    92109
     110        /** List and queue of interrupt transfers */
     111        transfer_list_t transfers_interrupt;
     112        /** List and queue of low speed control transfers */
     113        transfer_list_t transfers_control_slow;
     114        /** List and queue of full speed bulk transfers */
    93115        transfer_list_t transfers_bulk_full;
     116        /** List and queue of full speed control transfers */
    94117        transfer_list_t transfers_control_full;
    95         transfer_list_t transfers_control_slow;
    96         transfer_list_t transfers_interrupt;
    97118
     119        /** Pointer table to the above lists, helps during scheduling */
    98120        transfer_list_t *transfers[2][4];
    99121
     122        /** Code to be executed in kernel interrupt handler */
    100123        irq_code_t interrupt_code;
    101124
    102         fid_t cleaner;
    103         fid_t debug_checker;
     125        /** Commands that form interrupt code */
     126        irq_cmd_t interrupt_commands[UHCI_NEEDED_IRQ_COMMANDS];
     127
     128        /** Fibril periodically checking status register*/
     129        fid_t interrupt_emulator;
     130
     131        /** Indicator of hw interrupts availability */
    104132        bool hw_interrupts;
     133
     134        /** Number of hw failures detected. */
    105135        unsigned hw_failures;
    106 
    107         ddf_fun_t *ddf_instance;
    108136} hc_t;
    109137
Note: See TracChangeset for help on using the changeset viewer.