Changes in / [72cd53d:e913cc9] in mainline


Ignore:
Files:
3 added
2 deleted
28 edited

Legend:

Unmodified
Added
Removed
  • kernel/generic/include/proc/thread.h

    r72cd53d re913cc9  
    259259extern sysarg_t sys_thread_get_id(thread_id_t *);
    260260extern sysarg_t sys_thread_usleep(uint32_t);
    261 extern sysarg_t sys_thread_udelay(uint32_t);
    262261
    263262#endif
  • kernel/generic/include/syscall/syscall.h

    r72cd53d re913cc9  
    4444        SYS_THREAD_GET_ID,
    4545        SYS_THREAD_USLEEP,
    46         SYS_THREAD_UDELAY,
    4746       
    4847        SYS_TASK_GET_ID,
  • kernel/generic/src/proc/thread.c

    r72cd53d re913cc9  
    918918}
    919919
    920 sysarg_t sys_thread_udelay(uint32_t usec)
    921 {
    922         asm_delay_loop(usec * CPU->delay_loop_const);
    923         return 0;
    924 }
    925 
    926920/** @}
    927921 */
  • kernel/generic/src/syscall/syscall.c

    r72cd53d re913cc9  
    127127        (syshandler_t) sys_thread_get_id,
    128128        (syshandler_t) sys_thread_usleep,
    129         (syshandler_t) sys_thread_udelay,
    130129       
    131130        (syshandler_t) sys_task_get_id,
  • uspace/drv/ohci/batch.h

    r72cd53d re913cc9  
    2626 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
    2727 */
    28 /** @addtogroup drvusbohci
     28/** @addtogroup drvusbuhcihc
    2929 * @{
    3030 */
    3131/** @file
    32  * @brief OHCI driver USB transaction structure
     32 * @brief UHCI driver USB transaction structure
    3333 */
    34 #ifndef DRV_OHCI_BATCH_H
    35 #define DRV_OHCI_BATCH_H
     34#ifndef DRV_UHCI_BATCH_H
     35#define DRV_UHCI_BATCH_H
    3636
    3737#include <usbhc_iface.h>
  • uspace/drv/ohci/endpoint_list.h

    r72cd53d re913cc9  
    4141#include "utils/malloc32.h"
    4242
    43 typedef struct endpoint_list {
     43typedef struct endpoint_list
     44{
    4445        fibril_mutex_t guard;
    4546        ed_t *list_head;
  • uspace/drv/ohci/iface.h

    r72cd53d re913cc9  
    2626 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
    2727 */
     28
    2829/** @addtogroup drvusbohci
    2930 * @{
  • uspace/drv/ohci/ohci.h

    r72cd53d re913cc9  
    2626 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
    2727 */
     28
    2829/** @addtogroup drvusbohci
    2930 * @{
  • uspace/drv/ohci/ohci_regs.h

    r72cd53d re913cc9  
    2626 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
    2727 */
     28
    2829/** @addtogroup drvusbohcihc
    2930 * @{
  • uspace/drv/ohci/pci.h

    r72cd53d re913cc9  
    2626 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
    2727 */
     28
    2829/** @addtogroup drvusbohci
    2930 * @{
  • uspace/drv/ohci/root_hub.c

    r72cd53d re913cc9  
    4141#include "usb/classes/classes.h"
    4242#include "usb/devdrv.h"
    43 #include "ohci_regs.h"
    44 
    4543#include <usb/request.h>
    4644#include <usb/classes/hub.h>
     
    111109 */
    112110static const uint32_t hub_clear_feature_valid_mask =
    113     RHS_OCIC_FLAG |
    114     RHS_CLEAR_PORT_POWER;
     111    (1 << USB_HUB_FEATURE_C_HUB_LOCAL_POWER) |
     112(1 << USB_HUB_FEATURE_C_HUB_OVER_CURRENT);
    115113
    116114/**
     
    118116 */
    119117static const uint32_t hub_clear_feature_by_writing_one_mask =
    120    RHS_CLEAR_PORT_POWER;
    121    // 1 << USB_HUB_FEATURE_C_HUB_LOCAL_POWER;
     118    1 << USB_HUB_FEATURE_C_HUB_LOCAL_POWER;
    122119
    123120/**
     
    125122 */
    126123static const uint32_t hub_set_feature_valid_mask =
    127     RHS_LPSC_FLAG |
    128     RHS_OCIC_FLAG;
    129     //(1 << USB_HUB_FEATURE_C_HUB_OVER_CURRENT) |
    130     //(1 << USB_HUB_FEATURE_C_HUB_LOCAL_POWER);
     124    (1 << USB_HUB_FEATURE_C_HUB_OVER_CURRENT) |
     125(1 << USB_HUB_FEATURE_C_HUB_LOCAL_POWER);
    131126
    132127/**
     
    134129 */
    135130static const uint32_t hub_set_feature_direct_mask =
    136     RHS_SET_PORT_POWER;
    137     //(1 << USB_HUB_FEATURE_C_HUB_OVER_CURRENT);
     131    (1 << USB_HUB_FEATURE_C_HUB_OVER_CURRENT);
    138132
    139133/**
     
    141135 */
    142136static const uint32_t port_set_feature_valid_mask =
    143     RHPS_SET_PORT_ENABLE |
    144     RHPS_SET_PORT_SUSPEND |
    145     RHPS_SET_PORT_RESET |
    146     RHPS_SET_PORT_POWER;
     137    (1 << USB_HUB_FEATURE_PORT_ENABLE) |
     138(1 << USB_HUB_FEATURE_PORT_SUSPEND) |
     139(1 << USB_HUB_FEATURE_PORT_RESET) |
     140(1 << USB_HUB_FEATURE_PORT_POWER);
    147141
    148142/**
     
    150144 */
    151145static const uint32_t port_clear_feature_valid_mask =
    152     RHPS_CCS_FLAG |
    153     RHPS_SET_PORT_SUSPEND |
    154     RHPS_POCI_FLAG |
    155     RHPS_SET_PORT_POWER |
    156     RHPS_CSC_FLAG |
    157     RHPS_PESC_FLAG |
    158     RHPS_PSSC_FLAG |
    159     RHPS_OCIC_FLAG |
    160     RHPS_PRSC_FLAG;
    161 
    162 /*
    163 
    164146    (1 << USB_HUB_FEATURE_PORT_CONNECTION) |
    165     (1 << USB_HUB_FEATURE_PORT_SUSPEND) |
    166     (1 << USB_HUB_FEATURE_PORT_OVER_CURRENT) |
    167     (1 << USB_HUB_FEATURE_PORT_POWER) |
     147(1 << USB_HUB_FEATURE_PORT_SUSPEND) |
     148(1 << USB_HUB_FEATURE_PORT_OVER_CURRENT) |
     149(1 << USB_HUB_FEATURE_PORT_POWER) |
     150(1 << USB_HUB_FEATURE_C_PORT_CONNECTION) |
     151(1 << USB_HUB_FEATURE_C_PORT_ENABLE) |
     152(1 << USB_HUB_FEATURE_C_PORT_SUSPEND) |
     153(1 << USB_HUB_FEATURE_C_PORT_OVER_CURRENT) |
     154(1 << USB_HUB_FEATURE_C_PORT_RESET);
     155//note that USB_HUB_FEATURE_PORT_POWER bit is translated into
     156//USB_HUB_FEATURE_PORT_LOW_SPEED
     157
     158/**
     159 * bitmask with port status changes
     160 */
     161static const uint32_t port_status_change_mask =
    168162    (1 << USB_HUB_FEATURE_C_PORT_CONNECTION) |
    169     (1 << USB_HUB_FEATURE_C_PORT_ENABLE) |
    170     (1 << USB_HUB_FEATURE_C_PORT_SUSPEND) |
    171     (1 << USB_HUB_FEATURE_C_PORT_OVER_CURRENT) |
    172     (1 << USB_HUB_FEATURE_C_PORT_RESET);
    173  */
    174 //note that USB_HUB_FEATURE_PORT_POWER bit is translated into
    175 //USB_HUB_FEATURE_PORT_LOW_SPEED for port set feature request
    176 
    177 /**
    178  * bitmask with port status changes
    179  */
    180 static const uint32_t port_status_change_mask = RHPS_CHANGE_WC_MASK;
    181 /*    (1 << USB_HUB_FEATURE_C_PORT_CONNECTION) |
    182     (1 << USB_HUB_FEATURE_C_PORT_ENABLE) |
    183     (1 << USB_HUB_FEATURE_C_PORT_OVER_CURRENT) |
    184     (1 << USB_HUB_FEATURE_C_PORT_RESET) |
    185     (1 << USB_HUB_FEATURE_C_PORT_SUSPEND);
    186 */
     163(1 << USB_HUB_FEATURE_C_PORT_ENABLE) |
     164(1 << USB_HUB_FEATURE_C_PORT_OVER_CURRENT) |
     165(1 << USB_HUB_FEATURE_C_PORT_RESET) |
     166(1 << USB_HUB_FEATURE_C_PORT_SUSPEND);
     167
    187168
    188169static int create_serialized_hub_descriptor(rh_t *instance);
  • uspace/drv/ohci/root_hub.h

    r72cd53d re913cc9  
    2626 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
    2727 */
     28
    2829/** @addtogroup drvusbohci
    2930 * @{
  • uspace/drv/ohci/utils/malloc32.h

    r72cd53d re913cc9  
    2626 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
    2727 */
    28 /** @addtogroup drvusbohci
     28/** @addtogroup usb
    2929 * @{
    3030 */
    3131/** @file
    32  * @brief OHCI driver
     32 * @brief UHCI driver
    3333 */
    34 #ifndef DRV_OHCI_UTILS_MALLOC32_H
    35 #define DRV_OHCI_UTILS_MALLOC32_H
     34#ifndef DRV_UHCI_TRANSLATOR_H
     35#define DRV_UHCI_TRANSLATOR_H
    3636
    3737#include <assert.h>
     
    4040#include <mem.h>
    4141#include <as.h>
     42
     43#define UHCI_REQUIRED_PAGE_SIZE 4096
    4244
    4345/** Get physical address translation
     
    5961 *
    6062 * @param[in] size Size of the required memory space
    61  * @return Address of the aligned and big enough memory place, NULL on failure.
     63 * @return Address of the alligned and big enough memory place, NULL on failure.
    6264 */
    6365static inline void * malloc32(size_t size)
     
    7072static inline void free32(void *addr)
    7173        { if (addr) free(addr); }
     74/*----------------------------------------------------------------------------*/
     75/** Create 4KB page mapping
     76 *
     77 * @return Address of the mapped page, NULL on failure.
     78 */
     79static inline void * get_page(void)
     80{
     81        void * free_address = as_get_mappable_page(UHCI_REQUIRED_PAGE_SIZE);
     82        assert(free_address);
     83        if (free_address == 0)
     84                return NULL;
     85        void* ret =
     86          as_area_create(free_address, UHCI_REQUIRED_PAGE_SIZE,
     87                  AS_AREA_READ | AS_AREA_WRITE);
     88        if (ret != free_address)
     89                return NULL;
     90        return ret;
     91}
     92
    7293#endif
    7394/**
  • uspace/drv/uhci-hcd/batch.c

    r72cd53d re913cc9  
    7070 * @param[in] ep Communication target
    7171 * @param[in] buffer Data source/destination.
    72  * @param[in] buffer_size Size of the buffer.
     72 * @param[in] size Size of the buffer.
    7373 * @param[in] setup_buffer Setup data source (if not NULL)
    7474 * @param[in] setup_size Size of setup_buffer (should be always 8)
  • uspace/drv/uhci-hcd/hc.c

    r72cd53d re913cc9  
    6161 * @param[in] instance Memory place to initialize.
    6262 * @param[in] regs Address of I/O control registers.
    63  * @param[in] reg_size Size of I/O control registers.
    64  * @param[in] interrupts True if hw interrupts should be used.
     63 * @param[in] size Size of I/O control registers.
    6564 * @return Error code.
    6665 * @note Should be called only once on any structure.
  • uspace/drv/uhci-hcd/hc.h

    r72cd53d re913cc9  
    3333 * @brief UHCI host controller driver structure
    3434 */
    35 #ifndef DRV_UHCI_HC_H
    36 #define DRV_UHCI_HC_H
     35#ifndef DRV_UHCI_UHCI_HC_H
     36#define DRV_UHCI_UHCI_HC_H
    3737
    3838#include <fibril.h>
  • uspace/drv/uhci-hcd/hw_struct/link_pointer.h

    r72cd53d re913cc9  
    3232 * @brief UHCI driver
    3333 */
    34 #ifndef DRV_UHCI_HW_STRUCT_LINK_POINTER_H
    35 #define DRV_UHCI_HW_STRUCT_LINK_POINTER_H
     34#ifndef DRV_UHCI_LINK_POINTER_H
     35#define DRV_UHCI_LINK_POINTER_H
    3636
    3737/* UHCI link pointer, used by many data structures */
  • uspace/drv/uhci-hcd/hw_struct/queue_head.h

    r72cd53d re913cc9  
    2626 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
    2727 */
    28 /** @addtogroup drvusbuhcihc
     28/** @addtogroup drv usbuhcihc
    2929 * @{
    3030 */
     
    3232 * @brief UHCI driver
    3333 */
    34 #ifndef DRV_UHCI_HW_STRUCT_QH_H
    35 #define DRV_UHCI_HW_STRUCT_QH_H
     34#ifndef DRV_UHCI_QH_H
     35#define DRV_UHCI_QH_H
    3636#include <assert.h>
    3737
     
    6565 *
    6666 * @param[in] instance qh_t structure to use.
    67  * @param[in] next Address of the next queue.
     67 * @param[in] pa Physical address of the next queue head.
    6868 *
    6969 * Adds proper flag. If the pointer is NULL, sets next to terminal NULL.
     
    8181/** Set queue head element pointer
    8282 *
    83  * @param[in] instance qh_t structure to use.
    84  * @param[in] td Transfer descriptor to set as the first element.
     83 * @param[in] instance qh_t structure to initialize.
     84 * @param[in] pa Physical address of the TD structure.
    8585 *
    8686 * Adds proper flag. If the pointer is NULL, sets element to terminal NULL.
  • uspace/drv/uhci-hcd/hw_struct/transfer_descriptor.h

    r72cd53d re913cc9  
    3232 * @brief UHCI driver
    3333 */
    34 #ifndef DRV_UHCI_HW_STRUCT_TRANSFER_DESCRIPTOR_H
    35 #define DRV_UHCI_HW_STRUCT_TRANSFER_DESCRIPTOR_H
     34#ifndef DRV_UHCI_TRANSFER_DESCRIPTOR_H
     35#define DRV_UHCI_TRANSFER_DESCRIPTOR_H
    3636
    3737#include <mem.h>
  • uspace/drv/uhci-hcd/root_hub.h

    r72cd53d re913cc9  
    3333 * @brief UHCI driver
    3434 */
    35 #ifndef DRV_UHCI_RH_H
    36 #define DRV_UHCI_RH_H
     35#ifndef DRV_UHCI_UHCI_RH_H
     36#define DRV_UHCI_UHCI_RH_H
    3737
    3838#include <ddf/driver.h>
  • uspace/drv/uhci-hcd/uhci.c

    r72cd53d re913cc9  
    161161/** Initialize hc and rh DDF structures and their respective drivers.
    162162 *
     163 * @param[in] instance UHCI structure to use.
    163164 * @param[in] device DDF instance of the device to use.
    164165 *
     
    166167 *  - gets device's hw resources
    167168 *  - disables UHCI legacy support (PCI config space)
    168  *  - attempts to enable interrupts
     169 *  - asks for interrupt
    169170 *  - registers interrupt handler
    170171 */
  • uspace/drv/uhci-hcd/utils/malloc32.h

    r72cd53d re913cc9  
    2626 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
    2727 */
    28 /** @addtogroup drvusbuhci
     28/** @addtogroup usb
    2929 * @{
    3030 */
     
    3232 * @brief UHCI driver
    3333 */
    34 #ifndef DRV_UHCI_UTILS_MALLOC32_H
    35 #define DRV_UHCI_UTILS_MALLOC32_H
     34#ifndef DRV_UHCI_TRANSLATOR_H
     35#define DRV_UHCI_TRANSLATOR_H
    3636
    3737#include <assert.h>
  • uspace/drv/uhci-hcd/utils/slab.c

    r72cd53d re913cc9  
    2626 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
    2727 */
    28 /** @addtogroup drvusbuhcihc
     28/** @addtogroup usb
    2929 * @{
    3030 */
  • uspace/drv/uhci-hcd/utils/slab.h

    r72cd53d re913cc9  
    2626 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
    2727 */
    28 /** @addtogroup drvusbuhcihc
     28/** @addtogroup usb
    2929 * @{
    3030 */
     
    3232 * @brief UHCI driver
    3333 */
    34 #ifndef DRV_UHCI_UTILS_SLAB_H
    35 #define DRV_UHCI_UTILS_SLAB_H
     34#ifndef DRV_UHCI_SLAB_H
     35#define DRV_UHCI_SLAB_H
    3636
    3737#include <bool.h>
  • uspace/drv/uhci-rhd/port.c

    r72cd53d re913cc9  
    3636#include <errno.h>
    3737#include <str_error.h>
    38 #include <time.h>
    3938
    4039#include <usb/usb.h>    /* usb_address_t */
     
    6665 *
    6766 * @param[in] port Structure to use.
    68  * @param[in] val New register value.
     67 * @param[in] value New register value.
    6968 * @return Error code. (Always EOK)
    7069 */
     
    7877 *
    7978 * @param[in] port Memory structure to use.
    80  * @param[in] address Address of I/O register.
     79 * @param[in] addr Address of I/O register.
    8180 * @param[in] number Port number.
    8281 * @param[in] usec Polling interval.
     
    225224                uhci_port_write_status(port, port_status);
    226225                while (uhci_port_read_status(port) & STATUS_IN_RESET);
    227         }
    228         udelay(10);
     226                // TODO: find a better way to waste time (it should be less than
     227                // 10ms, if we reschedule it takes too much time (random
     228                // interrupts can be solved by multiple attempts).
     229                usb_log_debug2("%s: Reset Signal stop.\n", port->id_string);
     230        }
    229231        /* Enable the port. */
    230232        uhci_port_set_enabled(port, true);
  • uspace/drv/usbhub/usbhub.c

    r72cd53d re913cc9  
    7171
    7272static void usb_hub_process_global_interrupt(usb_hub_info_t * hub_info);
    73 
    74 static void usb_hub_polling_terminted_callback(usb_device_t * device,
    75     bool was_error, void * data);
    7673
    7774
     
    354351        rc = usb_device_auto_poll(hub_info->usb_device, 0,
    355352            hub_port_changes_callback, ((hub_info->port_count + 1) / 8) + 1,
    356             usb_hub_polling_terminted_callback, hub_info);
     353            NULL, hub_info);
    357354        if (rc != EOK) {
    358355                usb_log_error("Failed to create polling fibril: %s.\n",
     
    492489
    493490/**
    494  * callback called from hub polling fibril when the fibril terminates
    495  *
    496  * Should perform a cleanup - deletes hub_info.
    497  * @param device usb device afected
    498  * @param was_error indicates that the fibril is stoped due to an error
    499  * @param data pointer to usb_hub_info_t structure
    500  */
    501 static void usb_hub_polling_terminted_callback(usb_device_t * device,
    502     bool was_error, void * data){
    503         usb_hub_info_t * hub_info = data;
    504         if(!hub_info) return;
    505         free(hub_info->ports);
    506         free(hub_info);
    507 }
    508 
    509 
    510 
    511 
    512 /**
    513491 * @}
    514492 */
  • uspace/lib/c/generic/time.c

    r72cd53d re913cc9  
    207207}
    208208
    209 void udelay(useconds_t time)
    210 {
    211         (void) __SYSCALL1(SYS_THREAD_UDELAY, (sysarg_t) time);
    212 }
    213 
    214 
    215209/** Wait unconditionally for specified number of seconds
    216210 *
  • uspace/lib/c/include/sys/time.h

    r72cd53d re913cc9  
    6262extern int gettimeofday(struct timeval *tv, struct timezone *tz);
    6363
    64 extern void udelay(useconds_t);
    65 
    6664#endif
    6765
Note: See TracChangeset for help on using the changeset viewer.