Changeset eb522e8 in mainline for uspace/drv/usbhub/main.c
- Timestamp:
- 2011-06-01T08:43:42Z (14 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 8d6c1f1
- Parents:
- 9e2e715 (diff), e51a514 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - File:
-
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/usbhub/main.c
r9e2e715 reb522e8 1 1 /* 2 * Copyright (c) 20 08 Lukas Mejdrech2 * Copyright (c) 2010 Vojtech Horky 3 3 * All rights reserved. 4 4 * … … 27 27 */ 28 28 29 /** @addtogroup icmp29 /** @addtogroup drvusbhub 30 30 * @{ 31 31 */ 32 32 33 /** @file 34 * ICMP standalone module implementation. 35 * Contains skeleton module functions mapping. 36 * The functions are used by the module skeleton as module specific entry points. 37 * @see module.c 33 #include <ddf/driver.h> 34 #include <errno.h> 35 #include <async.h> 36 #include <stdio.h> 37 38 #include <usb/dev/driver.h> 39 #include <usb/classes/classes.h> 40 41 #include "usbhub.h" 42 #include "usbhub_private.h" 43 44 /** Hub status-change endpoint description. 45 * 46 * For more information see section 11.15.1 of USB 1.1 specification. 47 */ 48 static usb_endpoint_description_t hub_status_change_endpoint_description = { 49 .transfer_type = USB_TRANSFER_INTERRUPT, 50 .direction = USB_DIRECTION_IN, 51 .interface_class = USB_CLASS_HUB, 52 .interface_subclass = 0, 53 .interface_protocol = 0, 54 .flags = 0 55 }; 56 57 /** 58 * usb hub driver operations 59 * 60 * The most important one is add_device, which is set to usb_hub_add_device. 61 */ 62 static usb_driver_ops_t usb_hub_driver_ops = { 63 .add_device = usb_hub_add_device 64 }; 65 66 /** 67 * hub endpoints, excluding control endpoint 68 */ 69 static usb_endpoint_description_t *usb_hub_endpoints[] = { 70 &hub_status_change_endpoint_description, 71 NULL 72 }; 73 74 /** 75 * static usb hub driver information 76 */ 77 static usb_driver_t usb_hub_driver = { 78 .name = NAME, 79 .ops = &usb_hub_driver_ops, 80 .endpoints = usb_hub_endpoints 81 }; 82 83 84 int main(int argc, char *argv[]) 85 { 86 printf(NAME ": HelenOS USB hub driver.\n"); 87 88 usb_log_enable(USB_LOG_LEVEL_DEFAULT, NAME); 89 90 return usb_driver_main(&usb_hub_driver); 91 } 92 93 /** 94 * @} 38 95 */ 39 96 40 #include "icmp.h"41 #include "icmp_module.h"42 43 #include <async.h>44 #include <stdio.h>45 #include <errno.h>46 #include <ipc/ipc.h>47 #include <ipc/services.h>48 49 #include <net/modules.h>50 #include <net/packet.h>51 #include <net_interface.h>52 53 #include <tl_local.h>54 55 /** ICMP module global data. */56 extern icmp_globals_t icmp_globals;57 58 int tl_module_start_standalone(async_client_conn_t client_connection)59 {60 ipcarg_t phonehash;61 int rc;62 63 async_set_client_connection(client_connection);64 icmp_globals.net_phone = net_connect_module();65 if (icmp_globals.net_phone < 0)66 return icmp_globals.net_phone;67 68 rc = pm_init();69 if (rc != EOK)70 return rc;71 72 rc = icmp_initialize(client_connection);73 if (rc != EOK)74 goto out;75 76 rc = REGISTER_ME(SERVICE_ICMP, &phonehash);77 if (rc != EOK)78 goto out;79 80 async_manager();81 82 out:83 pm_destroy();84 return rc;85 }86 87 int tl_module_message_standalone(ipc_callid_t callid, ipc_call_t *call,88 ipc_call_t *answer, int *answer_count)89 {90 return icmp_message_standalone(callid, call, answer, answer_count);91 }92 93 /** @}94 */
Note:
See TracChangeset
for help on using the changeset viewer.