Changeset 8064c2f6 in mainline
- Timestamp:
- 2013-09-28T21:51:51Z (11 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 11a3b5f
- Parents:
- 8f1dd3b
- Location:
- uspace/drv/bus/usb/uhci
- Files:
-
- 17 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/bus/usb/uhci/hc.c
r8f1dd3b r8064c2f6 32 32 * @brief UHCI Host controller driver routines 33 33 */ 34 35 #include <adt/list.h> 36 #include <assert.h> 37 #include <async.h> 38 #include <ddi.h> 39 #include <device/hw_res_parsed.h> 40 #include <fibril.h> 34 41 #include <errno.h> 42 #include <macros.h> 43 #include <mem.h> 44 #include <stdlib.h> 35 45 #include <str_error.h> 36 #include <adt/list.h> 37 #include <ddi.h> 46 #include <sys/types.h> 38 47 39 48 #include <usb/debug.h> 40 49 #include <usb/usb.h> 41 50 51 #include "uhci_batch.h" 52 #include "utils/malloc32.h" 42 53 #include "hc.h" 43 #include "uhci_batch.h"44 54 45 55 #define UHCI_INTR_ALLOW_INTERRUPTS \ -
uspace/drv/bus/usb/uhci/hc.h
r8f1dd3b r8064c2f6 36 36 #define DRV_UHCI_HC_H 37 37 38 #include <ddf/interrupt.h>39 38 #include <device/hw_res_parsed.h> 40 39 #include <fibril.h> 41 40 #include <macros.h> 41 #include <stdbool.h> 42 #include <sys/types.h> 42 43 #include <usb/host/hcd.h> 44 #include <usb/host/usb_transfer_batch.h> 45 43 46 #include "uhci_rh.h" 44 45 47 #include "transfer_list.h" 48 #include "hw_struct/link_pointer.h" 46 49 47 50 /** UHCI I/O registers layout */ -
uspace/drv/bus/usb/uhci/hw_struct/link_pointer.h
r8f1dd3b r8064c2f6 35 35 #define DRV_UHCI_HW_STRUCT_LINK_POINTER_H 36 36 37 #include <sys/types.h> 38 37 39 /** UHCI link pointer, used by many data structures */ 38 40 typedef uint32_t link_pointer_t; -
uspace/drv/bus/usb/uhci/hw_struct/queue_head.h
r8f1dd3b r8064c2f6 34 34 #ifndef DRV_UHCI_HW_STRUCT_QH_H 35 35 #define DRV_UHCI_HW_STRUCT_QH_H 36 36 37 #include <assert.h> 38 #include <sys/types.h> 37 39 38 40 #include "link_pointer.h" -
uspace/drv/bus/usb/uhci/hw_struct/transfer_descriptor.c
r8f1dd3b r8064c2f6 32 32 * @brief UHCI driver 33 33 */ 34 35 #include <assert.h> 34 36 #include <errno.h> 37 35 38 #include <usb/debug.h> 39 #include <usb/usb.h> 36 40 41 #include "link_pointer.h" 37 42 #include "transfer_descriptor.h" 38 43 #include "../utils/malloc32.h" -
uspace/drv/bus/usb/uhci/hw_struct/transfer_descriptor.h
r8f1dd3b r8064c2f6 36 36 37 37 #include <assert.h> 38 #include <mem.h>39 38 #include <usb/usb.h> 39 #include <stdbool.h> 40 #include <sys/types.h> 40 41 41 42 #include "link_pointer.h" -
uspace/drv/bus/usb/uhci/main.c
r8f1dd3b r8064c2f6 32 32 * @brief UHCI driver initialization 33 33 */ 34 35 #include <assert.h> 34 36 #include <ddf/driver.h> 35 37 #include <errno.h> 38 #include <io/log.h> 39 #include <stdio.h> 36 40 #include <str_error.h> 37 38 41 #include <usb/debug.h> 39 42 -
uspace/drv/bus/usb/uhci/res.c
r8f1dd3b r8064c2f6 35 35 */ 36 36 37 #include <assert.h> 38 #include <ddf/driver.h> 39 #include <device/pci.h> 40 #include <devman.h> 37 41 #include <errno.h> 38 #include <assert.h>39 #include <devman.h>40 #include <device/hw_res_parsed.h>41 #include <device/pci.h>42 42 43 43 #include "res.h" -
uspace/drv/bus/usb/uhci/res.h
r8f1dd3b r8064c2f6 37 37 38 38 #include <ddf/driver.h> 39 #include <device/hw_res_parsed.h>40 39 41 40 int disable_legacy(ddf_dev_t *); -
uspace/drv/bus/usb/uhci/transfer_list.c
r8f1dd3b r8064c2f6 34 34 */ 35 35 36 #include <assert.h> 36 37 #include <errno.h> 38 #include <libarch/barrier.h> 39 #include <sys/types.h> 37 40 #include <usb/debug.h> 38 #include <libarch/barrier.h> 39 41 #include <usb/host/usb_transfer_batch.h> 42 43 #include "utils/malloc32.h" 44 #include "hw_struct/link_pointer.h" 40 45 #include "transfer_list.h" 41 46 -
uspace/drv/bus/usb/uhci/transfer_list.h
r8f1dd3b r8064c2f6 35 35 #define DRV_UHCI_TRANSFER_LIST_H 36 36 37 #include <adt/list.h> 37 38 #include <fibril_synch.h> 38 39 -
uspace/drv/bus/usb/uhci/uhci.c
r8f1dd3b r8064c2f6 34 34 */ 35 35 36 #include <assert.h> 37 #include <ddf/driver.h> 38 #include <ddf/interrupt.h> 39 #include <device/hw_res_parsed.h> 36 40 #include <errno.h> 41 #include <stdbool.h> 42 #include <stdlib.h> 37 43 #include <str_error.h> 38 #include <ddf/interrupt.h> 44 #include <sys/types.h> 45 39 46 #include <usb/debug.h> 47 #include <usb/usb.h> 48 #include <usb/host/ddf_helpers.h> 40 49 #include <usb/host/hcd.h> 41 #include <usb/host/ ddf_helpers.h>50 #include <usb/host/usb_bus.h> 42 51 43 52 #include "uhci.h" -
uspace/drv/bus/usb/uhci/uhci_batch.c
r8f1dd3b r8064c2f6 32 32 * @brief UHCI driver USB transfer structure 33 33 */ 34 35 #include <assert.h> 34 36 #include <errno.h> 35 #include <str_error.h>36 37 #include <macros.h> 38 #include <mem.h> 39 #include <stdlib.h> 37 40 38 41 #include <usb/usb.h> 39 42 #include <usb/debug.h> 43 #include <usb/host/endpoint.h> 40 44 41 45 #include "uhci_batch.h" 42 #include "transfer_list.h"43 46 #include "hw_struct/transfer_descriptor.h" 44 47 #include "utils/malloc32.h" -
uspace/drv/bus/usb/uhci/uhci_batch.h
r8f1dd3b r8064c2f6 35 35 #define DRV_UHCI_BATCH_H 36 36 37 #include <adt/list.h> 38 #include <assert.h> 39 #include <errno.h> 40 #include <stdbool.h> 41 #include <sys/types.h> 37 42 #include <usb/host/usb_transfer_batch.h> 38 #include <adt/list.h>39 43 40 44 #include "hw_struct/queue_head.h" -
uspace/drv/bus/usb/uhci/uhci_rh.c
r8f1dd3b r8064c2f6 28 28 29 29 #include <assert.h> 30 #include <async.h> 31 #include <ddi.h> 32 #include <errno.h> 30 33 #include <macros.h> 34 #include <mem.h> 35 #include <sys/time.h> 36 31 37 #include <usb/debug.h> 38 #include <usb/descriptor.h> 32 39 #include <usb/classes/hub.h> 33 #include <ddi.h> 40 #include <usb/request.h> 41 #include <usb/usb.h> 34 42 35 43 #include "uhci_rh.h" -
uspace/drv/bus/usb/uhci/uhci_rh.h
r8f1dd3b r8064c2f6 38 38 #include <usbvirt/virthub_base.h> 39 39 #include <usb/host/usb_transfer_batch.h> 40 #include <usb/usb.h> 41 42 #include <stdbool.h> 43 #include <sys/types.h> 40 44 41 45 /** Endpoint number for status change pipe. */ … … 63 67 static inline usb_address_t uhci_rh_get_address(uhci_rh_t *instance) 64 68 { 65 assert(instance);66 69 return virthub_base_get_address(&instance->base); 67 70 } -
uspace/drv/bus/usb/uhci/utils/malloc32.h
r8f1dd3b r8064c2f6 36 36 37 37 #include <as.h> 38 #include <assert.h>39 38 #include <ddi.h> 40 39 #include <errno.h> 41 40 #include <malloc.h> 42 #include <mem.h> 43 #include <unistd.h> 41 #include <sys/types.h> 44 42 45 #define UHCI_STR CUTURES_ALIGNMENT 1643 #define UHCI_STRUCTURES_ALIGNMENT 16 46 44 #define UHCI_REQUIRED_PAGE_SIZE 4096 47 45 … … 56 54 if (addr == NULL) 57 55 return 0; 58 56 59 57 uintptr_t result; 60 58 const int ret = as_get_physical_mapping(addr, &result); 61 59 if (ret != EOK) 62 60 return 0; 63 61 64 62 return result; 65 63 } … … 81 79 /* Calculate alignment to make sure the block won't cross page 82 80 * boundary */ 83 size_t alignment = UHCI_STR CUTURES_ALIGNMENT;81 size_t alignment = UHCI_STRUCTURES_ALIGNMENT; 84 82 while (alignment < size) 85 83 alignment *= 2; … … 104 102 uintptr_t phys; 105 103 void *address; 106 104 107 105 const int ret = dmamem_map_anonymous(UHCI_REQUIRED_PAGE_SIZE, 108 106 DMAMEM_4GiB, AS_AREA_READ | AS_AREA_WRITE, 0, &phys, 109 107 &address); 110 108 111 109 return ((ret == EOK) ? address : NULL); 112 110 }
Note:
See TracChangeset
for help on using the changeset viewer.