diff --git a/core/net/ipv4/uip-over-mesh.c b/core/net/ipv4/uip-over-mesh.c index 92c5dbfd4..e6709f1d4 100644 --- a/core/net/ipv4/uip-over-mesh.c +++ b/core/net/ipv4/uip-over-mesh.c @@ -262,8 +262,8 @@ uip_over_mesh_send(void) if(BUF->proto == UIP_PROTO_TCP) { #if NETSTACK_CONF_WITH_RIME packetbuf_set_attr(PACKETBUF_ATTR_ERELIABLE, 1); -#endif /* NETSTACK_CONF_WITH_RIME */ packetbuf_set_attr(PACKETBUF_ATTR_RELIABLE, 1); +#endif /* NETSTACK_CONF_WITH_RIME */ /* packetbuf_set_attr(PACKETBUF_ATTR_PACKET_TYPE, PACKETBUF_ATTR_PACKET_TYPE_STREAM);*/ } diff --git a/core/net/ipv6/sicslowpan.c b/core/net/ipv6/sicslowpan.c index 3be5a0f2a..320b5c5ba 100644 --- a/core/net/ipv6/sicslowpan.c +++ b/core/net/ipv6/sicslowpan.c @@ -1336,11 +1336,6 @@ send_packet(linkaddr_t *dest) packetbuf_set_addr(PACKETBUF_ADDR_SENDER,(void*)&uip_lladdr); #endif - /* Force acknowledge from sender (test hardware autoacks) */ -#if SICSLOWPAN_CONF_ACK_ALL - packetbuf_set_attr(PACKETBUF_ATTR_RELIABLE, 1); -#endif - /* Provide a callback function to receive the result of a packet transmission. */ NETSTACK_LLSEC.send(&packet_sent, NULL); diff --git a/core/net/mac/contikimac/contikimac.c b/core/net/mac/contikimac/contikimac.c index cdfffc13b..d5882845c 100644 --- a/core/net/mac/contikimac/contikimac.c +++ b/core/net/mac/contikimac/contikimac.c @@ -499,7 +499,6 @@ send_packet(mac_callback_t mac_callback, void *mac_callback_ptr, uint8_t got_strobe_ack = 0; int len; uint8_t is_broadcast = 0; - uint8_t is_reliable = 0; uint8_t is_known_receiver = 0; uint8_t collisions; int transmit_len; @@ -546,11 +545,6 @@ send_packet(mac_callback_t mac_callback, void *mac_callback_ptr, packetbuf_addr(PACKETBUF_ADDR_RECEIVER)->u8[1]); #endif /* NETSTACK_CONF_WITH_IPV6 */ } - is_reliable = packetbuf_attr(PACKETBUF_ATTR_RELIABLE) -#if NETSTACK_CONF_WITH_RIME - || packetbuf_attr(PACKETBUF_ATTR_ERELIABLE) -#endif /* NETSTACK_CONF_WITH_RIME */ - ; if(!packetbuf_attr(PACKETBUF_ATTR_IS_CREATED_AND_SECURED)) { packetbuf_set_attr(PACKETBUF_ATTR_MAC_ACK, 1); diff --git a/core/net/mac/cxmac/cxmac.c b/core/net/mac/cxmac/cxmac.c index ebf7651dd..857c67adb 100644 --- a/core/net/mac/cxmac/cxmac.c +++ b/core/net/mac/cxmac/cxmac.c @@ -453,8 +453,6 @@ send_packet(void) packetbuf_addr(PACKETBUF_ADDR_RECEIVER)->u8[1]); #endif /* NETSTACK_CONF_WITH_IPV6 */ } -/* is_reliable = packetbuf_attr(PACKETBUF_ATTR_RELIABLE) || - packetbuf_attr(PACKETBUF_ATTR_ERELIABLE);*/ len = NETSTACK_FRAMER.create(); strobe_len = len + sizeof(struct cxmac_hdr); if(len < 0 || strobe_len > (int)sizeof(strobe)) { @@ -624,8 +622,9 @@ send_packet(void) /* If we have received the strobe ACK, and we are sending a packet that will need an upper layer ACK (as signified by the PACKETBUF_ATTR_RELIABLE packet attribute), we keep the radio on. */ - if(got_strobe_ack && (packetbuf_attr(PACKETBUF_ATTR_RELIABLE) || + if(got_strobe_ack && ( #if NETSTACK_CONF_WITH_RIME + packetbuf_attr(PACKETBUF_ATTR_RELIABLE) || packetbuf_attr(PACKETBUF_ATTR_ERELIABLE) || #endif /* NETSTACK_CONF_WITH_RIME */ packetbuf_attr(PACKETBUF_ATTR_PACKET_TYPE) == diff --git a/core/net/mac/framer-802154.c b/core/net/mac/framer-802154.c index 03b091feb..67a61867a 100644 --- a/core/net/mac/framer-802154.c +++ b/core/net/mac/framer-802154.c @@ -242,7 +242,6 @@ parse(void) } packetbuf_set_addr(PACKETBUF_ADDR_SENDER, (linkaddr_t *)&frame.src_addr); packetbuf_set_attr(PACKETBUF_ATTR_PENDING, frame.fcf.frame_pending); - /* packetbuf_set_attr(PACKETBUF_ATTR_RELIABLE, frame.fcf.ack_required);*/ packetbuf_set_attr(PACKETBUF_ATTR_PACKET_ID, frame.seq); #if LLSEC802154_SECURITY_LEVEL diff --git a/core/net/mac/sicslowmac/sicslowmac.c b/core/net/mac/sicslowmac/sicslowmac.c index 9d88a6b78..09d77ae17 100644 --- a/core/net/mac/sicslowmac/sicslowmac.c +++ b/core/net/mac/sicslowmac/sicslowmac.c @@ -106,7 +106,9 @@ send_packet(mac_callback_t sent, void *ptr) params.fcf.frame_type = FRAME802154_DATAFRAME; params.fcf.security_enabled = 0; params.fcf.frame_pending = 0; +#if NETSTACK_CONF_WITH_RIME params.fcf.ack_required = packetbuf_attr(PACKETBUF_ATTR_RELIABLE); +#endif params.fcf.panid_compression = 0; /* Insert IEEE 802.15.4 (2003) version bit. */ diff --git a/core/net/packetbuf.h b/core/net/packetbuf.h index 008fa02fc..12bfd0fab 100644 --- a/core/net/packetbuf.h +++ b/core/net/packetbuf.h @@ -309,10 +309,10 @@ enum { PACKETBUF_ATTR_IS_CREATED_AND_SECURED, /* Scope 1 attributes: used between two neighbors only. */ - PACKETBUF_ATTR_RELIABLE, PACKETBUF_ATTR_PACKET_ID, PACKETBUF_ATTR_PACKET_TYPE, #if NETSTACK_CONF_WITH_RIME + PACKETBUF_ATTR_RELIABLE, PACKETBUF_ATTR_REXMIT, PACKETBUF_ATTR_MAX_REXMIT, PACKETBUF_ATTR_NUM_REXMIT, diff --git a/cpu/avr/radio/mac/sicslowmac.c b/cpu/avr/radio/mac/sicslowmac.c index 9a176277a..ea4616e39 100644 --- a/cpu/avr/radio/mac/sicslowmac.c +++ b/cpu/avr/radio/mac/sicslowmac.c @@ -409,7 +409,9 @@ sicslowmac_dataRequest(void) params.fcf.frameType = DATAFRAME; params.fcf.securityEnabled = false; params.fcf.framePending = false; +#if NETSTACK_CONF_WITH_RIME params.fcf.ackRequired = packetbuf_attr(PACKETBUF_ATTR_RELIABLE); +#endif params.fcf.panIdCompression = false; /* Insert IEEE 802.15.4 (2003) version bit. */ diff --git a/cpu/avr/radio/rf230bb/rf230bb.c b/cpu/avr/radio/rf230bb/rf230bb.c index e4181868c..aee2f6d29 100644 --- a/cpu/avr/radio/rf230bb/rf230bb.c +++ b/cpu/avr/radio/rf230bb/rf230bb.c @@ -1073,8 +1073,10 @@ rf230_transmit(unsigned short payload_len) if (tx_result==RADIO_TX_OK) { RIMESTATS_ADD(lltx); +#if NETSTACK_CONF_WITH_RIME if(packetbuf_attr(PACKETBUF_ATTR_RELIABLE)) RIMESTATS_ADD(ackrx); //ack was requested and received +#endif #if RF230_INSERTACK /* Not PAN broadcast to FFFF, and ACK was requested and received */ if (!((buffer[5]==0xff) && (buffer[6]==0xff)) && (buffer[0]&(1<<6))) diff --git a/examples/ipv6/slip-radio/no-framer.c b/examples/ipv6/slip-radio/no-framer.c index e3aed93b7..fbb749da8 100644 --- a/examples/ipv6/slip-radio/no-framer.c +++ b/examples/ipv6/slip-radio/no-framer.c @@ -109,7 +109,6 @@ parse(void) } packetbuf_set_addr(PACKETBUF_ADDR_SENDER, (linkaddr_t *)&frame.src_addr); packetbuf_set_attr(PACKETBUF_ATTR_PENDING, frame.fcf.frame_pending); - /* packetbuf_set_attr(PACKETBUF_ATTR_RELIABLE, frame.fcf.ack_required);*/ packetbuf_set_attr(PACKETBUF_ATTR_PACKET_ID, frame.seq); PRINTF("15.4-IN: %2X", frame.fcf.frame_type); diff --git a/platform/avr-atmega128rfa1/contiki-conf.h b/platform/avr-atmega128rfa1/contiki-conf.h index 47f5c6584..545f6a253 100644 --- a/platform/avr-atmega128rfa1/contiki-conf.h +++ b/platform/avr-atmega128rfa1/contiki-conf.h @@ -191,8 +191,6 @@ typedef unsigned short uip_stats_t; #define CHANNEL_802_15_4 26 /* AUTOACK receive mode gives better rssi measurements, even if ACK is never requested */ #define RF230_CONF_AUTOACK 1 -/* Request 802.15.4 ACK on all packets sent (else autoretry). This is primarily for testing. */ -#define SICSLOWPAN_CONF_ACK_ALL 0 /* 1 + Number of auto retry attempts 0-15 (0 implies don't use extended TX_ARET_ON mode) */ #define RF230_CONF_FRAME_RETRIES 2 /* Number of csma retry attempts 0-5 in extended tx mode (7 does immediate tx with no csma) */ diff --git a/platform/avr-raven/contiki-conf.h b/platform/avr-raven/contiki-conf.h index 40469aa21..2fe0d6099 100644 --- a/platform/avr-raven/contiki-conf.h +++ b/platform/avr-raven/contiki-conf.h @@ -206,8 +206,6 @@ typedef unsigned short uip_stats_t; #define RADIO_CONF_CALIBRATE_INTERVAL 256 /* AUTOACK receive mode gives better rssi measurements, even if ACK is never requested */ #define RF230_CONF_AUTOACK 1 -/* Request 802.15.4 ACK on all packets sent (else autoretry). This is primarily for testing. */ -#define SICSLOWPAN_CONF_ACK_ALL 0 /* Number of auto retry attempts+1, 1-16. Set zero to disable extended TX_ARET_ON mode with CCA) */ #define RF230_CONF_FRAME_RETRIES 3 /* Number of CSMA attempts 0-7. 802.15.4 2003 standard max is 5. */ diff --git a/platform/avr-ravenusb/contiki-conf.h b/platform/avr-ravenusb/contiki-conf.h index 03001d02a..1ebe6d718 100644 --- a/platform/avr-ravenusb/contiki-conf.h +++ b/platform/avr-ravenusb/contiki-conf.h @@ -284,9 +284,6 @@ typedef unsigned short uip_stats_t; #define RADIO_CONF_CALIBRATE_INTERVAL 256 /* AUTOACK receive mode gives better rssi measurements, even if ACK is never requested */ #define RF230_CONF_AUTOACK 1 -/* Request 802.15.4 ACK on all packets sent by sicslowpan.c (else autoretry) */ -/* Broadcasts will be duplicated by the retry count, since no one will ACK them! */ -#define SICSLOWPAN_CONF_ACK_ALL 0 /* 1 + Number of auto retry attempts 0-15 (0 implies don't use extended TX_ARET_ON mode with CCA) */ #define RF230_CONF_FRAME_RETRIES 2 /* CCA theshold energy -91 to -61 dBm (default -77). Set this smaller than the expected minimum rssi to avoid packet collisions */