Changeset 4e5c7ba in mainline for uspace/srv/net/nil/eth/eth.c
- Timestamp:
- 2010-11-18T22:36:12Z (14 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- f772bc55
- Parents:
- cb569e6
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/net/nil/eth/eth.c
rcb569e6 r4e5c7ba 178 178 { 179 179 int index; 180 eth_proto_ refproto;180 eth_proto_t *proto; 181 181 182 182 fibril_rwlock_read_lock(ð_globals.protos_lock); … … 286 286 size_t mtu) 287 287 { 288 eth_device_ refdevice;288 eth_device_t *device; 289 289 int index; 290 290 measured_string_t names[2] = { … … 301 301 size_t count = sizeof(names) / sizeof(measured_string_t); 302 302 char *data; 303 eth_proto_ refproto;303 eth_proto_t *proto; 304 304 int rc; 305 305 … … 342 342 343 343 /* Create a new device */ 344 device = (eth_device_ ref) malloc(sizeof(eth_device_t));344 device = (eth_device_t *) malloc(sizeof(eth_device_t)); 345 345 if (!device) 346 346 return ENOMEM; … … 434 434 * @returns NULL if the packet address length is not big enough. 435 435 */ 436 static eth_proto_ refeth_process_packet(int flags, packet_t packet)437 { 438 eth_header_snap_ refheader;436 static eth_proto_t *eth_process_packet(int flags, packet_t packet) 437 { 438 eth_header_snap_t *header; 439 439 size_t length; 440 440 eth_type_t type; 441 441 size_t prefix; 442 442 size_t suffix; 443 eth_fcs_ reffcs;443 eth_fcs_t *fcs; 444 444 uint8_t *data; 445 445 int rc; … … 454 454 455 455 data = packet_get_data(packet); 456 header = (eth_header_snap_ ref) data;456 header = (eth_header_snap_t *) data; 457 457 type = ntohs(header->header.ethertype); 458 458 … … 461 461 prefix = sizeof(eth_header_t); 462 462 suffix = 0; 463 fcs = (eth_fcs_ ref) data + length - sizeof(eth_fcs_t);463 fcs = (eth_fcs_t *) data + length - sizeof(eth_fcs_t); 464 464 length -= sizeof(eth_fcs_t); 465 465 } else if(type <= ETH_MAX_CONTENT) { … … 487 487 488 488 suffix = (type < ETH_MIN_CONTENT) ? ETH_MIN_CONTENT - type : 0U; 489 fcs = (eth_fcs_ ref) data + prefix + type + suffix;489 fcs = (eth_fcs_t *) data + prefix + type + suffix; 490 490 suffix += length - prefix - type; 491 491 length = prefix + type + suffix; … … 516 516 packet_t packet, services_t target) 517 517 { 518 eth_proto_ refproto;518 eth_proto_t *proto; 519 519 packet_t next; 520 eth_device_ refdevice;520 eth_device_t *device; 521 521 int flags; 522 522 … … 564 564 size_t *prefix, size_t *content, size_t *suffix) 565 565 { 566 eth_device_ refdevice;566 eth_device_t *device; 567 567 568 568 if (!addr_len || !prefix || !content || !suffix) … … 598 598 measured_string_ref *address) 599 599 { 600 eth_device_ refdevice;600 eth_device_t *device; 601 601 602 602 if (!address) … … 631 631 static int eth_register_message(services_t service, int phone) 632 632 { 633 eth_proto_ refproto;633 eth_proto_t *proto; 634 634 int protocol; 635 635 int index; … … 646 646 return EOK; 647 647 } else { 648 proto = (eth_proto_ ref) malloc(sizeof(eth_proto_t));648 proto = (eth_proto_t *) malloc(sizeof(eth_proto_t)); 649 649 if (!proto) { 650 650 fibril_rwlock_write_unlock(ð_globals.protos_lock); … … 688 688 size_t mtu) 689 689 { 690 eth_header_snap_ refheader;691 eth_header_lsap_ refheader_lsap;692 eth_header_ refheader_dix;693 eth_fcs_ reffcs;690 eth_header_snap_t *header; 691 eth_header_lsap_t *header_lsap; 692 eth_header_t *header_dix; 693 eth_fcs_t *fcs; 694 694 uint8_t *src; 695 695 uint8_t *dest; … … 697 697 int i; 698 698 void *padding; 699 eth_preamble_ refpreamble;699 eth_preamble_t *preamble; 700 700 701 701 i = packet_get_addr(packet, &src, &dest); … … 795 795 services_t sender) 796 796 { 797 eth_device_ refdevice;797 eth_device_t *device; 798 798 packet_t next; 799 799 packet_t tmp;
Note:
See TracChangeset
for help on using the changeset viewer.