Changeset 98abd40 in mainline for uspace/srv/net/ethip/atrans.c
- Timestamp:
- 2013-07-06T21:57:22Z (12 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- c8bb1633, cdc8a391
- Parents:
- b8e72fd1 (diff), 507c6f3 (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 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/net/ethip/atrans.c
rb8e72fd1 r98abd40 49 49 static FIBRIL_CONDVAR_INITIALIZE(atrans_cv); 50 50 51 static ethip_atrans_t *atrans_find( iplink_srv_addr_t *ip_addr)51 static ethip_atrans_t *atrans_find(addr32_t ip_addr) 52 52 { 53 53 list_foreach(atrans_list, link) { … … 55 55 ethip_atrans_t, atrans_list); 56 56 57 if (atrans->ip_addr .ipv4 == ip_addr->ipv4)57 if (atrans->ip_addr == ip_addr) 58 58 return atrans; 59 59 } … … 62 62 } 63 63 64 int atrans_add( iplink_srv_addr_t *ip_addr, mac48_addr_t *mac_addr)64 int atrans_add(addr32_t ip_addr, addr48_t mac_addr) 65 65 { 66 66 ethip_atrans_t *atrans; … … 71 71 return ENOMEM; 72 72 73 atrans->ip_addr = *ip_addr;74 a trans->mac_addr = *mac_addr;73 atrans->ip_addr = ip_addr; 74 addr48(mac_addr, atrans->mac_addr); 75 75 76 76 fibril_mutex_lock(&atrans_list_lock); … … 88 88 } 89 89 90 int atrans_remove( iplink_srv_addr_t *ip_addr)90 int atrans_remove(addr32_t ip_addr) 91 91 { 92 92 ethip_atrans_t *atrans; … … 106 106 } 107 107 108 int atrans_lookup( iplink_srv_addr_t *ip_addr, mac48_addr_t *mac_addr)108 int atrans_lookup(addr32_t ip_addr, addr48_t mac_addr) 109 109 { 110 ethip_atrans_t *atrans;111 112 110 fibril_mutex_lock(&atrans_list_lock); 113 atrans = atrans_find(ip_addr);111 ethip_atrans_t *atrans = atrans_find(ip_addr); 114 112 if (atrans == NULL) { 115 113 fibril_mutex_unlock(&atrans_list_lock); 116 114 return ENOENT; 117 115 } 118 116 119 117 fibril_mutex_unlock(&atrans_list_lock); 120 *mac_addr = atrans->mac_addr;118 addr48(atrans->mac_addr, mac_addr); 121 119 return EOK; 122 120 } … … 124 122 int atrans_wait_timeout(suseconds_t timeout) 125 123 { 126 int rc;127 128 124 fibril_mutex_lock(&atrans_list_lock); 129 rc = fibril_condvar_wait_timeout(&atrans_cv, &atrans_list_lock,125 int rc = fibril_condvar_wait_timeout(&atrans_cv, &atrans_list_lock, 130 126 timeout); 131 127 fibril_mutex_unlock(&atrans_list_lock); 132 128 133 129 return rc; 134 130 }
Note:
See TracChangeset
for help on using the changeset viewer.