Changeset 49bd793b in mainline
- Timestamp:
- 2011-10-07T21:42:14Z (13 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 80099c19
- Parents:
- 00d7e1b
- Location:
- uspace
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/c/generic/net/packet.c
r00d7e1b r49bd793b 139 139 packet_t *pm_find(packet_id_t packet_id) 140 140 { 141 packet_t *packet;142 141 if (!packet_id) 143 142 return NULL; 144 143 145 144 fibril_rwlock_read_lock(&pm_globals.lock); 146 link_t *link = 147 hash_table_find(&pm_globals.packet_map, &packet_id); 145 146 unsigned long key = packet_id; 147 link_t *link = hash_table_find(&pm_globals.packet_map, &key); 148 149 packet_t *packet; 148 150 if (link != NULL) { 149 151 pm_entry_t *entry = … … 172 174 173 175 fibril_rwlock_write_lock(&pm_globals.lock); 174 pm_entry_t *entry = malloc(sizeof (pm_entry_t)); 176 177 pm_entry_t *entry = malloc(sizeof(pm_entry_t)); 175 178 if (entry == NULL) { 176 179 fibril_rwlock_write_unlock(&pm_globals.lock); … … 179 182 180 183 entry->packet = packet; 181 hash_table_insert(&pm_globals.packet_map, &packet->packet_id, 182 &entry->link); 184 185 unsigned long key = packet->packet_id; 186 hash_table_insert(&pm_globals.packet_map, &key, &entry->link); 187 183 188 fibril_rwlock_write_unlock(&pm_globals.lock); 189 184 190 return EOK; 185 191 } … … 195 201 196 202 fibril_rwlock_write_lock(&pm_globals.lock); 197 hash_table_remove(&pm_globals.packet_map, &packet->packet_id, 1); 203 204 unsigned long key = packet->packet_id; 205 hash_table_remove(&pm_globals.packet_map, &key, 1); 206 198 207 fibril_rwlock_write_unlock(&pm_globals.lock); 199 208 } -
uspace/lib/c/include/net/packet.h
r00d7e1b r49bd793b 38 38 #define LIBC_PACKET_H_ 39 39 40 #include <sys/types.h> 41 40 42 /** Packet identifier type. 41 43 * Value zero is used as an invalid identifier. 42 44 */ 43 typedef unsigned longpacket_id_t;45 typedef sysarg_t packet_id_t; 44 46 45 47 /** Type definition of the packet. … … 51 53 * @see packet_dimension 52 54 */ 53 typedef struct packet_dimension 55 typedef struct packet_dimension packet_dimension_t; 54 56 55 57 /** Packet dimension. */ -
uspace/lib/net/generic/packet_remote.c
r00d7e1b r49bd793b 115 115 116 116 *packet = pm_find(packet_id); 117 if ( !*packet) {117 if (*packet == NULL) { 118 118 async_exch_t *exch = async_exchange_begin(sess); 119 119 sysarg_t size; … … 130 130 } 131 131 132 if ((*packet )->next) {132 if ((*packet != NULL) && ((*packet)->next)) { 133 133 packet_t *next; 134 134 return packet_translate_remote(sess, &next, (*packet)->next); -
uspace/lib/nic/src/nic_driver.c
r00d7e1b r49bd793b 671 671 } 672 672 fibril_rwlock_write_unlock(&nic_data->stats_lock); 673 nil_received_msg(nic_data->nil_session, pid, nic_data->device_id);673 nil_received_msg(nic_data->nil_session, nic_data->device_id, pid); 674 674 } else { 675 675 switch (frame_type) { … … 703 703 nic_data->stats.receive_bytes += packet_get_data_length(packet); 704 704 fibril_rwlock_write_unlock(&nic_data->stats_lock); 705 706 nil_received_msg(nic_data->nil_session, packet_get_id(packet),707 nic_data->device_id);705 706 nil_received_msg(nic_data->nil_session, nic_data->device_id, 707 packet_get_id(packet)); 708 708 } 709 709 -
uspace/srv/net/nil/nildummy/nildummy.c
r00d7e1b r49bd793b 136 136 device->mtu = NET_DEFAULT_MTU; 137 137 138 printf("Device %d already exists :\tMTU\t= %zu\n", device->device_id,138 printf("Device %d already exists (mtu: %zu)\n", device->device_id, 139 139 device->mtu); 140 140 fibril_rwlock_write_unlock(&nildummy_globals.devices_lock); -
uspace/srv/net/tl/icmp/icmp.c
r00d7e1b r49bd793b 753 753 return rc; 754 754 755 rc = icmp_echo(icmp_id, icmp_seq, ICMP_GET_SIZE(*call), 755 rc = icmp_echo(icmp_id, icmp_seq, ICMP_GET_SIZE(*call), 756 756 ICMP_GET_TIMEOUT(*call), ICMP_GET_TTL(*call), 757 757 ICMP_GET_TOS(*call), ICMP_GET_DONT_FRAGMENT(*call), -
uspace/srv/net/tl/tcp/tcp.c
r00d7e1b r49bd793b 1651 1651 /* Sent packet? */ 1652 1652 packet = pq_find(socket_data->outgoing, sequence_number); 1653 printf("retransmit %lu\n", packet_get_id(packet));1654 1653 if (packet) { 1655 1654 pq_get_order(packet, NULL, &data_length); … … 1790 1789 1791 1790 /* Send the packet */ 1792 printf("connecting %lu\n", packet_get_id(packet));1793 1791 tcp_send_packets(socket_data->device_id, packet); 1794 1792
Note:
See TracChangeset
for help on using the changeset viewer.