44 static const u16_t sizeof_uip_ipaddr_t =
sizeof(
uip_ipaddr_t);
45 static const u16_t offset_tcpip_hdr_len = offsetof(
struct uip_tcpip_hdr, len);
46 static const u16_t offset_tcpip_hdr_srcipaddr = offsetof(
struct uip_tcpip_hdr, srcipaddr);
49 static void upper_layer_chksum() {
51 ;; ---------------------------------
52 ;;
static u16_t upper_layer_chksum(u8_t proto);
56 ;; ---------------------------------
65 ld ix, #_offset_tcpip_hdr_len
71 ;; DE = upper layer length
80 jr nc, _upper_layer_chksum_setlen2
82 _upper_layer_chksum_setlen2:
84 ;; bc = upper_leyer_len + proto
89 jr nc, _upper_layer_chksum_setlen3
91 _upper_layer_chksum_setlen3:
95 ld ix, #_offset_tcpip_hdr_srcipaddr
101 ld ix, #_sizeof_uip_ipaddr_t
110 call _uip_arch_chksum ; hl = sum
114 ;; de is still stacked
121 _upper_layer_chksum_call:
126 call _uip_arch_chksum
133 jr nz, _upper_layer_uip_htons
136 _upper_layer_uip_htons:
149 ;; ---------------------------------
154 ;; ---------------------------------
161 jp _upper_layer_chksum_call
171 ;; ---------------------------------
176 ;; ---------------------------------
177 ld c, #UIP_PROTO_ICMP6
178 jp _upper_layer_chksum
188 ;; ---------------------------------
193 ;; ---------------------------------
195 jp _upper_layer_chksum
205 ;; ---------------------------------
210 ;; ---------------------------------
212 jp _upper_layer_chksum