Changes in / [e913cc9:72cd53d] in mainline
- Files:
-
- 2 added
- 3 deleted
- 28 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/generic/include/proc/thread.h
re913cc9 r72cd53d 259 259 extern sysarg_t sys_thread_get_id(thread_id_t *); 260 260 extern sysarg_t sys_thread_usleep(uint32_t); 261 extern sysarg_t sys_thread_udelay(uint32_t); 261 262 262 263 #endif -
kernel/generic/include/syscall/syscall.h
re913cc9 r72cd53d 44 44 SYS_THREAD_GET_ID, 45 45 SYS_THREAD_USLEEP, 46 SYS_THREAD_UDELAY, 46 47 47 48 SYS_TASK_GET_ID, -
kernel/generic/src/proc/thread.c
re913cc9 r72cd53d 918 918 } 919 919 920 sysarg_t sys_thread_udelay(uint32_t usec) 921 { 922 asm_delay_loop(usec * CPU->delay_loop_const); 923 return 0; 924 } 925 920 926 /** @} 921 927 */ -
kernel/generic/src/syscall/syscall.c
re913cc9 r72cd53d 127 127 (syshandler_t) sys_thread_get_id, 128 128 (syshandler_t) sys_thread_usleep, 129 (syshandler_t) sys_thread_udelay, 129 130 130 131 (syshandler_t) sys_task_get_id, -
uspace/drv/ohci/batch.h
re913cc9 r72cd53d 26 26 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 27 */ 28 /** @addtogroup drvusb uhcihc28 /** @addtogroup drvusbohci 29 29 * @{ 30 30 */ 31 31 /** @file 32 * @brief UHCI driver USB transaction structure32 * @brief OHCI driver USB transaction structure 33 33 */ 34 #ifndef DRV_ UHCI_BATCH_H35 #define DRV_ UHCI_BATCH_H34 #ifndef DRV_OHCI_BATCH_H 35 #define DRV_OHCI_BATCH_H 36 36 37 37 #include <usbhc_iface.h> -
uspace/drv/ohci/endpoint_list.h
re913cc9 r72cd53d 41 41 #include "utils/malloc32.h" 42 42 43 typedef struct endpoint_list 44 { 43 typedef struct endpoint_list { 45 44 fibril_mutex_t guard; 46 45 ed_t *list_head; -
uspace/drv/ohci/iface.h
re913cc9 r72cd53d 26 26 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 27 */ 28 29 28 /** @addtogroup drvusbohci 30 29 * @{ -
uspace/drv/ohci/ohci.h
re913cc9 r72cd53d 26 26 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 27 */ 28 29 28 /** @addtogroup drvusbohci 30 29 * @{ -
uspace/drv/ohci/ohci_regs.h
re913cc9 r72cd53d 26 26 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 27 */ 28 29 28 /** @addtogroup drvusbohcihc 30 29 * @{ -
uspace/drv/ohci/pci.h
re913cc9 r72cd53d 26 26 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 27 */ 28 29 28 /** @addtogroup drvusbohci 30 29 * @{ -
uspace/drv/ohci/root_hub.c
re913cc9 r72cd53d 41 41 #include "usb/classes/classes.h" 42 42 #include "usb/devdrv.h" 43 #include "ohci_regs.h" 44 43 45 #include <usb/request.h> 44 46 #include <usb/classes/hub.h> … … 109 111 */ 110 112 static const uint32_t hub_clear_feature_valid_mask = 111 (1 << USB_HUB_FEATURE_C_HUB_LOCAL_POWER)|112 (1 << USB_HUB_FEATURE_C_HUB_OVER_CURRENT);113 RHS_OCIC_FLAG | 114 RHS_CLEAR_PORT_POWER; 113 115 114 116 /** … … 116 118 */ 117 119 static const uint32_t hub_clear_feature_by_writing_one_mask = 118 1 << USB_HUB_FEATURE_C_HUB_LOCAL_POWER; 120 RHS_CLEAR_PORT_POWER; 121 // 1 << USB_HUB_FEATURE_C_HUB_LOCAL_POWER; 119 122 120 123 /** … … 122 125 */ 123 126 static const uint32_t hub_set_feature_valid_mask = 124 (1 << USB_HUB_FEATURE_C_HUB_OVER_CURRENT) | 125 (1 << USB_HUB_FEATURE_C_HUB_LOCAL_POWER); 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); 126 131 127 132 /** … … 129 134 */ 130 135 static const uint32_t hub_set_feature_direct_mask = 131 (1 << USB_HUB_FEATURE_C_HUB_OVER_CURRENT); 136 RHS_SET_PORT_POWER; 137 //(1 << USB_HUB_FEATURE_C_HUB_OVER_CURRENT); 132 138 133 139 /** … … 135 141 */ 136 142 static const uint32_t port_set_feature_valid_mask = 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);143 RHPS_SET_PORT_ENABLE | 144 RHPS_SET_PORT_SUSPEND | 145 RHPS_SET_PORT_RESET | 146 RHPS_SET_PORT_POWER; 141 147 142 148 /** … … 144 150 */ 145 151 static 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 146 164 (1 << USB_HUB_FEATURE_PORT_CONNECTION) | 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); 165 (1 << USB_HUB_FEATURE_PORT_SUSPEND) | 166 (1 << USB_HUB_FEATURE_PORT_OVER_CURRENT) | 167 (1 << USB_HUB_FEATURE_PORT_POWER) | 168 (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 */ 155 174 //note that USB_HUB_FEATURE_PORT_POWER bit is translated into 156 //USB_HUB_FEATURE_PORT_LOW_SPEED 175 //USB_HUB_FEATURE_PORT_LOW_SPEED for port set feature request 157 176 158 177 /** 159 178 * bitmask with port status changes 160 179 */ 161 static const uint32_t port_status_change_mask = 162 (1 << USB_HUB_FEATURE_C_PORT_CONNECTION) |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 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 */ 168 187 169 188 static int create_serialized_hub_descriptor(rh_t *instance); -
uspace/drv/ohci/root_hub.h
re913cc9 r72cd53d 26 26 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 27 */ 28 29 28 /** @addtogroup drvusbohci 30 29 * @{ -
uspace/drv/ohci/utils/malloc32.h
re913cc9 r72cd53d 26 26 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 27 */ 28 /** @addtogroup usb28 /** @addtogroup drvusbohci 29 29 * @{ 30 30 */ 31 31 /** @file 32 * @brief UHCI driver32 * @brief OHCI driver 33 33 */ 34 #ifndef DRV_ UHCI_TRANSLATOR_H35 #define DRV_ UHCI_TRANSLATOR_H34 #ifndef DRV_OHCI_UTILS_MALLOC32_H 35 #define DRV_OHCI_UTILS_MALLOC32_H 36 36 37 37 #include <assert.h> … … 40 40 #include <mem.h> 41 41 #include <as.h> 42 43 #define UHCI_REQUIRED_PAGE_SIZE 409644 42 45 43 /** Get physical address translation … … 61 59 * 62 60 * @param[in] size Size of the required memory space 63 * @return Address of the al ligned and big enough memory place, NULL on failure.61 * @return Address of the aligned and big enough memory place, NULL on failure. 64 62 */ 65 63 static inline void * malloc32(size_t size) … … 72 70 static inline void free32(void *addr) 73 71 { if (addr) free(addr); } 74 /*----------------------------------------------------------------------------*/75 /** Create 4KB page mapping76 *77 * @return Address of the mapped page, NULL on failure.78 */79 static 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 93 72 #endif 94 73 /** -
uspace/drv/uhci-hcd/batch.c
re913cc9 r72cd53d 70 70 * @param[in] ep Communication target 71 71 * @param[in] buffer Data source/destination. 72 * @param[in] size Size of the buffer.72 * @param[in] buffer_size Size of the buffer. 73 73 * @param[in] setup_buffer Setup data source (if not NULL) 74 74 * @param[in] setup_size Size of setup_buffer (should be always 8) -
uspace/drv/uhci-hcd/hc.c
re913cc9 r72cd53d 61 61 * @param[in] instance Memory place to initialize. 62 62 * @param[in] regs Address of I/O control registers. 63 * @param[in] size Size 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. 64 65 * @return Error code. 65 66 * @note Should be called only once on any structure. -
uspace/drv/uhci-hcd/hc.h
re913cc9 r72cd53d 33 33 * @brief UHCI host controller driver structure 34 34 */ 35 #ifndef DRV_UHCI_ UHCI_HC_H36 #define DRV_UHCI_ UHCI_HC_H35 #ifndef DRV_UHCI_HC_H 36 #define DRV_UHCI_HC_H 37 37 38 38 #include <fibril.h> -
uspace/drv/uhci-hcd/hw_struct/link_pointer.h
re913cc9 r72cd53d 32 32 * @brief UHCI driver 33 33 */ 34 #ifndef DRV_UHCI_ LINK_POINTER_H35 #define DRV_UHCI_ LINK_POINTER_H34 #ifndef DRV_UHCI_HW_STRUCT_LINK_POINTER_H 35 #define DRV_UHCI_HW_STRUCT_LINK_POINTER_H 36 36 37 37 /* UHCI link pointer, used by many data structures */ -
uspace/drv/uhci-hcd/hw_struct/queue_head.h
re913cc9 r72cd53d 26 26 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 27 */ 28 /** @addtogroup drv 28 /** @addtogroup drvusbuhcihc 29 29 * @{ 30 30 */ … … 32 32 * @brief UHCI driver 33 33 */ 34 #ifndef DRV_UHCI_ QH_H35 #define DRV_UHCI_ QH_H34 #ifndef DRV_UHCI_HW_STRUCT_QH_H 35 #define DRV_UHCI_HW_STRUCT_QH_H 36 36 #include <assert.h> 37 37 … … 65 65 * 66 66 * @param[in] instance qh_t structure to use. 67 * @param[in] pa Physical address of the next queue head.67 * @param[in] next Address of the next queue. 68 68 * 69 69 * Adds proper flag. If the pointer is NULL, sets next to terminal NULL. … … 81 81 /** Set queue head element pointer 82 82 * 83 * @param[in] instance qh_t structure to initialize.84 * @param[in] pa Physical address of the TD structure.83 * @param[in] instance qh_t structure to use. 84 * @param[in] td Transfer descriptor to set as the first element. 85 85 * 86 86 * Adds proper flag. If the pointer is NULL, sets element to terminal NULL. -
uspace/drv/uhci-hcd/hw_struct/transfer_descriptor.h
re913cc9 r72cd53d 32 32 * @brief UHCI driver 33 33 */ 34 #ifndef DRV_UHCI_ TRANSFER_DESCRIPTOR_H35 #define DRV_UHCI_ TRANSFER_DESCRIPTOR_H34 #ifndef DRV_UHCI_HW_STRUCT_TRANSFER_DESCRIPTOR_H 35 #define DRV_UHCI_HW_STRUCT_TRANSFER_DESCRIPTOR_H 36 36 37 37 #include <mem.h> -
uspace/drv/uhci-hcd/root_hub.h
re913cc9 r72cd53d 33 33 * @brief UHCI driver 34 34 */ 35 #ifndef DRV_UHCI_ UHCI_RH_H36 #define DRV_UHCI_ UHCI_RH_H35 #ifndef DRV_UHCI_RH_H 36 #define DRV_UHCI_RH_H 37 37 38 38 #include <ddf/driver.h> -
uspace/drv/uhci-hcd/uhci.c
re913cc9 r72cd53d 161 161 /** Initialize hc and rh DDF structures and their respective drivers. 162 162 * 163 * @param[in] instance UHCI structure to use.164 163 * @param[in] device DDF instance of the device to use. 165 164 * … … 167 166 * - gets device's hw resources 168 167 * - disables UHCI legacy support (PCI config space) 169 * - a sks for interrupt168 * - attempts to enable interrupts 170 169 * - registers interrupt handler 171 170 */ -
uspace/drv/uhci-hcd/utils/malloc32.h
re913cc9 r72cd53d 26 26 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 27 */ 28 /** @addtogroup usb28 /** @addtogroup drvusbuhci 29 29 * @{ 30 30 */ … … 32 32 * @brief UHCI driver 33 33 */ 34 #ifndef DRV_UHCI_ TRANSLATOR_H35 #define DRV_UHCI_ TRANSLATOR_H34 #ifndef DRV_UHCI_UTILS_MALLOC32_H 35 #define DRV_UHCI_UTILS_MALLOC32_H 36 36 37 37 #include <assert.h> -
uspace/drv/uhci-hcd/utils/slab.c
re913cc9 r72cd53d 26 26 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 27 */ 28 /** @addtogroup usb28 /** @addtogroup drvusbuhcihc 29 29 * @{ 30 30 */ -
uspace/drv/uhci-hcd/utils/slab.h
re913cc9 r72cd53d 26 26 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 27 */ 28 /** @addtogroup usb28 /** @addtogroup drvusbuhcihc 29 29 * @{ 30 30 */ … … 32 32 * @brief UHCI driver 33 33 */ 34 #ifndef DRV_UHCI_ SLAB_H35 #define DRV_UHCI_ SLAB_H34 #ifndef DRV_UHCI_UTILS_SLAB_H 35 #define DRV_UHCI_UTILS_SLAB_H 36 36 37 37 #include <bool.h> -
uspace/drv/uhci-rhd/port.c
re913cc9 r72cd53d 36 36 #include <errno.h> 37 37 #include <str_error.h> 38 #include <time.h> 38 39 39 40 #include <usb/usb.h> /* usb_address_t */ … … 65 66 * 66 67 * @param[in] port Structure to use. 67 * @param[in] val ueNew register value.68 * @param[in] val New register value. 68 69 * @return Error code. (Always EOK) 69 70 */ … … 77 78 * 78 79 * @param[in] port Memory structure to use. 79 * @param[in] addr Address of I/O register.80 * @param[in] address Address of I/O register. 80 81 * @param[in] number Port number. 81 82 * @param[in] usec Polling interval. … … 224 225 uhci_port_write_status(port, port_status); 225 226 while (uhci_port_read_status(port) & STATUS_IN_RESET); 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 } 227 } 228 udelay(10); 231 229 /* Enable the port. */ 232 230 uhci_port_set_enabled(port, true); -
uspace/drv/usbhub/usbhub.c
re913cc9 r72cd53d 71 71 72 72 static 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); 73 76 74 77 … … 351 354 rc = usb_device_auto_poll(hub_info->usb_device, 0, 352 355 hub_port_changes_callback, ((hub_info->port_count + 1) / 8) + 1, 353 NULL, hub_info);356 usb_hub_polling_terminted_callback, hub_info); 354 357 if (rc != EOK) { 355 358 usb_log_error("Failed to create polling fibril: %s.\n", … … 489 492 490 493 /** 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 /** 491 513 * @} 492 514 */ -
uspace/lib/c/generic/time.c
re913cc9 r72cd53d 207 207 } 208 208 209 void udelay(useconds_t time) 210 { 211 (void) __SYSCALL1(SYS_THREAD_UDELAY, (sysarg_t) time); 212 } 213 214 209 215 /** Wait unconditionally for specified number of seconds 210 216 * -
uspace/lib/c/include/sys/time.h
re913cc9 r72cd53d 62 62 extern int gettimeofday(struct timeval *tv, struct timezone *tz); 63 63 64 extern void udelay(useconds_t); 65 64 66 #endif 65 67
Note:
See TracChangeset
for help on using the changeset viewer.