Changeset 1256a0a in mainline for uspace/drv/uhci-hcd
- Timestamp:
- 2011-02-01T00:08:46Z (15 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/fix-logger-deadlock, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 993a1e1
- Parents:
- 37ac7bb
- Location:
- uspace/drv/uhci-hcd
- Files:
-
- 3 added
- 1 deleted
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/uhci-hcd/Makefile
r37ac7bb r1256a0a 36 36 iface.c \ 37 37 main.c \ 38 root_hub/port.c \ 39 root_hub/port_status.c \ 40 root_hub/root_hub.c \ 38 root_hub.c \ 41 39 transfer_list.c \ 42 40 uhci.c \ -
uspace/drv/uhci-hcd/main.c
r37ac7bb r1256a0a 34 34 #include "iface.h" 35 35 #include "name.h" 36 #include "pci.h" 37 #include "root_hub.h" 36 38 #include "uhci.h" 37 39 … … 75 77 io_reg_base, io_reg_size, irq); 76 78 77 return uhci_init(device, (void*)io_reg_base, io_reg_size); 79 int ret = uhci_init(device, (void*)io_reg_base, io_reg_size); 80 81 if (ret != EOK) { 82 uhci_print_error("Failed to init uhci-hcd.\n"); 83 return ret; 84 } 85 device_t *rh; 86 ret = setup_root_hub(&rh, device); 87 88 if (ret != EOK) { 89 uhci_print_error("Failed to setup uhci root hub.\n"); 90 /* TODO: destroy uhci here */ 91 return ret; 92 } 93 94 ret = child_device_register(rh, device); 95 if (ret != EOK) { 96 uhci_print_error("Failed to register root hub.\n"); 97 /* TODO: destroy uhci here */ 98 return ret; 99 } 100 101 return EOK; 78 102 } 79 103 -
uspace/drv/uhci-hcd/name.h
r37ac7bb r1256a0a 32 32 * @brief UHCI driver 33 33 */ 34 #ifndef DRV_UHCI_ TD_NAME_H35 #define DRV_UHCI_ TD_NAME_H34 #ifndef DRV_UHCI_NAME_H 35 #define DRV_UHCI_NAME_H 36 36 37 37 #define NAME "uhci-hcd" -
uspace/drv/uhci-hcd/pci.c
r37ac7bb r1256a0a 34 34 * PCI related functions needed by the UHCI driver. 35 35 */ 36 #include " uhci.h"36 #include "pci.h" 37 37 #include <errno.h> 38 38 #include <assert.h> -
uspace/drv/uhci-hcd/uhci.c
r37ac7bb r1256a0a 51 51 uhci_print_verbose("Transfer lists initialized.\n"); 52 52 53 /* init root hub */54 ret = uhci_root_hub_init(&instance->root_hub, device,55 (char*)regs + UHCI_ROOT_HUB_PORT_REGISTERS_OFFSET);56 CHECK_RET_FREE_INSTANCE("Failed to initialize root hub driver.\n");57 53 58 54 uhci_print_verbose("Initializing frame list.\n"); 59 55 instance->frame_list = get_page(); 60 // memalign32(sizeof(link_pointer_t) * UHCI_FRAME_LIST_COUNT, 4096); 61 if (instance->frame_list == NULL) { 62 uhci_print_error("Failed to allocate frame list pointer.\n"); 63 uhci_root_hub_fini(&instance->root_hub); 64 free(instance); 65 return ENOMEM; 66 } 56 ret = instance ? EOK : ENOMEM; 57 CHECK_RET_FREE_INSTANCE("Failed to get frame list page.\n"); 67 58 68 59 /* initialize all frames to point to the first queue head */ -
uspace/drv/uhci-hcd/uhci.h
r37ac7bb r1256a0a 41 41 #include <usbhc_iface.h> 42 42 43 #include "root_hub/root_hub.h"44 43 #include "transfer_list.h" 45 44 … … 76 75 typedef struct uhci { 77 76 usb_address_keeping_t address_manager; 78 uhci_root_hub_t root_hub;79 77 volatile regs_t *registers; 80 78 … … 87 85 88 86 /* init uhci specifics in device.driver_data */ 89 int uhci_init( device_t *device, void *regs, size_t reg_size);87 int uhci_init(device_t *device, void *regs, size_t reg_size); 90 88 91 int uhci_destroy( device_t *device);89 int uhci_destroy(device_t *device); 92 90 93 91 int uhci_transfer( … … 102 100 void *arg ); 103 101 104 int pci_get_my_registers(device_t *, uintptr_t *, size_t *, int *);105 106 102 #endif 107 103 /**
Note:
See TracChangeset
for help on using the changeset viewer.
