Changeset 4cbb6e4 in mainline
- Timestamp:
- 2011-09-13T12:46:03Z (13 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 3a8370c
- Parents:
- a837544
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/usbhost/src/usb_endpoint_manager.c
ra837544 r4cbb6e4 45 45 static hash_index_t node_hash(unsigned long key[]) 46 46 { 47 hash_index_t hash = 0; 48 unsigned i = 0; 49 for (;i < MAX_KEYS; ++i) { 50 hash ^= key[i]; 51 } 52 hash %= BUCKET_COUNT; 53 return hash; 47 /* USB endpoints use 4 bits, thus ((key[0] << 4) | key[1]) 48 * produces unique value for every address.endpoint pair */ 49 return ((key[0] << 4) | key[1]) % BUCKET_COUNT; 54 50 } 55 51 /*----------------------------------------------------------------------------*/ … … 63 59 switch (keys) { 64 60 case 3: 65 match = match && (key[2] == node->ep->direction); 61 match = match && 62 ((key[2] == node->ep->direction) 63 || (node->ep->direction == USB_DIRECTION_BOTH)); 66 64 case 2: 67 65 match = match && (key[1] == (unsigned long)node->ep->endpoint);
Note:
See TracChangeset
for help on using the changeset viewer.