Changeset 7fc092a in mainline for uspace/lib/usb/include/usb/usbmem.h
- Timestamp:
- 2011-01-27T22:09:29Z (13 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- db7ed07
- Parents:
- 9ee87f6 (diff), 6265a2b (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/lib/usb/include/usb/usbmem.h
r9ee87f6 r7fc092a 1 1 /* 2 * Copyright (c) 20 09 Lukas Mejdrech2 * Copyright (c) 2010 Matus Dekanek 3 3 * All rights reserved. 4 4 * … … 27 27 */ 28 28 29 /** @addtogroup arp 30 * @{ 29 #ifndef USBMEM_H 30 #define USBMEM_H 31 32 33 // group should be changed - this is not usb specific 34 /** @addtogroup usb 35 * @{ 31 36 */ 32 33 /** @file 34 * ARP protocol header. 35 * Based on the RFC 826. 37 /** @file definitions of special memory management, used mostly in usb stack 38 * 39 * USB HCD needs traslation between physical and virtual addresses. These 40 * functions implement such functionality. For each allocated virtual address 41 * the memory manager gets also it`s physical translation and remembers it. 42 * Addresses allocated byt this manager can be therefore translated from and to 43 * physical addresses. 44 * Typical use: 45 * void * address = mman_malloc(some_size); 46 * void * physical_address = mman_getPA(address); 47 * void * the_same_address = mman_getVA(physical_address); 48 * void * null_address = mman_getPA(non_existing_address); 49 * mman_free(address); 50 * // physical_address, adress and the_same_address are no longer valid here 51 * 52 * 53 * @note Addresses allocated by this memory manager should be as well 54 * deallocated byt it. 55 * 36 56 */ 37 38 #ifndef NET_ARP_HEADER_H_39 #define NET_ARP_HEADER_H_40 57 41 58 #include <sys/types.h> 42 59 43 /** Type definition of an ARP protocol header. 44 * @see arp_header 45 */ 46 typedef struct arp_header arp_header_t;60 extern void * mman_malloc( 61 size_t size, 62 size_t alignment, 63 unsigned long max_physical_address); 47 64 48 /** ARP protocol header. */ 49 struct arp_header { 50 /** 51 * Hardware type identifier. 52 * @see hardware.h 53 */ 54 uint16_t hardware; 55 56 /** Protocol identifier. */ 57 uint16_t protocol; 58 /** Hardware address length in bytes. */ 59 uint8_t hardware_length; 60 /** Protocol address length in bytes. */ 61 uint8_t protocol_length; 62 63 /** 64 * ARP packet type. 65 * @see arp_oc.h 66 */ 67 uint16_t operation; 68 } __attribute__ ((packed)); 65 extern void * mman_getVA(void * addr); 69 66 70 #endif 67 extern void * mman_getPA(void * addr); 68 69 extern void mman_free(void * addr); 70 71 72 73 74 71 75 72 76 /** @} 73 77 */ 78 79 80 #endif /* USBMEM_H */ 81
Note:
See TracChangeset
for help on using the changeset viewer.