E1000_TXD_CMD_IFCS | iob_len ( iobuf );
tx_curr_desc->upper.data = 0;
- DBG ( "TX fill: %ld tx_curr: %ld addr: %#08lx len: %d\n", adapter->tx_fill_ctr,
+ DBG ( "TX fill: %ld tx_curr: %ld addr: %#08lx len: %zd\n", adapter->tx_fill_ctr,
tx_curr, virt_to_bus ( iobuf->data ), iob_len ( iobuf ) );
/* Point to next free descriptor */
struct nic *nic = netdev->priv;
struct ethhdr *ethhdr;
- DBG ( "Transmitting %d bytes\n", iob_len ( iobuf ) );
+ DBG ( "Transmitting %zd bytes\n", iob_len ( iobuf ) );
iob_pad ( iobuf, ETH_ZLEN );
ethhdr = iobuf->data;
iob_pull ( iobuf, sizeof ( *ethhdr ) );
np->tx[np->tx_cur].bufptr = virt_to_bus (iobuf->data);
np->tx[np->tx_cur].cmdsts = iob_len (iobuf) | OWN;
- DBG ("TX id %d at %#08lx + %#08x\n", np->tx_cur,
+ DBG ("TX id %d at %#08lx + %#08zx\n", np->tx_cur,
virt_to_bus (&iobuf->data), iob_len (iobuf));
/* increment the circular buffer pointer to the next buffer location
iob_pad ( iobuf, ETH_ZLEN );
/* Add to TX ring */
- DBG ( "TX id %d at %lx+%x\n", rtl->tx.next,
+ DBG ( "TX id %d at %lx+%zx\n", rtl->tx.next,
virt_to_bus ( iobuf->data ), iob_len ( iobuf ) );
rtl->tx.iobuf[rtl->tx.next] = iobuf;
outl ( virt_to_bus ( iobuf->data ),
/* Compare data */
if ( memcmp ( data, read_data, len ) != 0 ) {
- DBG ( "NVS %p verification failed at %#04x+%d\n",
+ DBG ( "NVS %p verification failed at %#04x+%zd\n",
nvs, address, len );
return -EIO;
}
if ( ! eol )
eol = memchr ( cmdbuf, '\0', sizeof ( cmdbuf ) );
if ( ! eol ) {
- DBG ( "Script line too long (max %d bytes)\n",
+ DBG ( "Script line too long (max %zd bytes)\n",
sizeof ( cmdbuf ) );
rc = -ENOEXEC;
goto done;
option = find_dhcp_option_with_encap ( options, tag, &encapsulator );
if ( option ) {
old_len = dhcp_option_len ( option );
- DBG ( "Resizing DHCP option %s from length %d to %d in block "
+ DBG ( "Resizing DHCP option %s from length %d to %zd in block "
"%p\n", dhcp_tag_name (tag), option->len, len, options );
} else {
old_len = 0;
- DBG ( "Creating DHCP option %s (length %d) in block %p\n",
+ DBG ( "Creating DHCP option %s (length %zd) in block %p\n",
dhcp_tag_name ( tag ), len, options );
}
/* Sanity check */
if ( iob_len ( iobuf ) < sizeof ( *ethhdr ) ) {
- DBG ( "Ethernet packet too short (%d bytes)\n",
+ DBG ( "Ethernet packet too short (%zd bytes)\n",
iob_len ( iobuf ) );
free_iob ( iobuf );
return -EINVAL;
/* Sanity check */
if ( iob_len ( iobuf ) < sizeof ( *icmp6hdr ) ) {
- DBG ( "Packet too short (%d bytes)\n", iob_len ( iobuf ) );
+ DBG ( "Packet too short (%zd bytes)\n", iob_len ( iobuf ) );
free_iob ( iobuf );
return -EINVAL;
}
/* Sanity check the IPv4 header */
if ( iob_len ( iobuf ) < sizeof ( *iphdr ) ) {
- DBG ( "IPv4 packet too short at %d bytes (min %d bytes)\n",
+ DBG ( "IPv4 packet too short at %zd bytes (min %zd bytes)\n",
iob_len ( iobuf ), sizeof ( *iphdr ) );
goto err;
}
}
hdrlen = ( ( iphdr->verhdrlen & IP_MASK_HLEN ) * 4 );
if ( hdrlen < sizeof ( *iphdr ) ) {
- DBG ( "IPv4 header too short at %d bytes (min %d bytes)\n",
+ DBG ( "IPv4 header too short at %zd bytes (min %zd bytes)\n",
hdrlen, sizeof ( *iphdr ) );
goto err;
}
if ( hdrlen > iob_len ( iobuf ) ) {
- DBG ( "IPv4 header too long at %d bytes "
- "(packet is %d bytes)\n", hdrlen, iob_len ( iobuf ) );
+ DBG ( "IPv4 header too long at %zd bytes "
+ "(packet is %zd bytes)\n", hdrlen, iob_len ( iobuf ) );
goto err;
}
if ( ( csum = tcpip_chksum ( iphdr, hdrlen ) ) != 0 ) {
}
len = ntohs ( iphdr->len );
if ( len < hdrlen ) {
- DBG ( "IPv4 length too short at %d bytes "
- "(header is %d bytes)\n", len, hdrlen );
+ DBG ( "IPv4 length too short at %zd bytes "
+ "(header is %zd bytes)\n", len, hdrlen );
goto err;
}
if ( len > iob_len ( iobuf ) ) {
- DBG ( "IPv4 length too long at %d bytes "
- "(packet is %d bytes)\n", len, iob_len ( iobuf ) );
+ DBG ( "IPv4 length too long at %zd bytes "
+ "(packet is %zd bytes)\n", len, iob_len ( iobuf ) );
goto err;
}
/* Sanity check */
if ( iob_len ( iobuf ) < sizeof ( *ip6hdr ) ) {
- DBG ( "Packet too short (%d bytes)\n", iob_len ( iobuf ) );
+ DBG ( "Packet too short (%zd bytes)\n", iob_len ( iobuf ) );
goto drop;
}
}
ndp->state = state;
DBG ( "New neighbour cache entry (%d): IP6 %s => %s %s\n",
- ( ndp - ndp_table ) / sizeof ( *ndp ),
+ ( ndp - ndp_table ),
inet6_ntoa ( ndp->in6 ), netdev->ll_protocol->name,
netdev->ll_protocol->ntoa ( ndp->ll_addr ) );
}
/* Check if the entry was already created */
if ( ndp ) {
DBG ( "Awaiting neighbour advertisement (cache entry %d)\n",
- ( ( ndp - ndp_table ) / sizeof ( *ndp ) ) );
+ ( ndp - ndp_table ) );
/* For test */
// ndp->state = NDP_STATE_REACHABLE;
// memcpy ( ndp->ll_addr, netdev->ll_addr, 6 );
/* Sanity check */
if ( iob_len ( iobuf ) < sizeof ( *nadvert ) ) {
- DBG ( "Packet too short (%d bytes)\n", iob_len ( iobuf ) );
+ DBG ( "Packet too short (%zd bytes)\n", iob_len ( iobuf ) );
return -EINVAL;
}
tcphdr->csum = tcpip_chksum ( iobuf->data, iob_len ( iobuf ) );
/* Dump header */
- DBGC ( tcp, "TCP %p TX %d->%d %08lx..%08lx %08lx %4zd",
+ DBGC ( tcp, "TCP %p TX %d->%d %08lx..%08lx %08lx %4d",
tcp, ntohs ( tcphdr->src ), ntohs ( tcphdr->dest ),
ntohl ( tcphdr->seq ), ( ntohl ( tcphdr->seq ) ),
ntohl ( tcphdr->ack ), 0 );
struct tcp_header *tcphdr = iobuf->data;
struct tcp_connection *tcp;
struct tcp_options options;
- unsigned int hlen;
+ size_t hlen;
uint16_t csum;
uint32_t start_seq;
uint32_t seq;
/* Sanity check packet */
if ( iob_len ( iobuf ) < sizeof ( *tcphdr ) ) {
- DBG ( "TCP packet too short at %d bytes (min %d bytes)\n",
+ DBG ( "TCP packet too short at %zd bytes (min %zd bytes)\n",
iob_len ( iobuf ), sizeof ( *tcphdr ) );
rc = -EINVAL;
goto discard;
}
hlen = ( ( tcphdr->hlen & TCP_MASK_HLEN ) / 16 ) * 4;
if ( hlen < sizeof ( *tcphdr ) ) {
- DBG ( "TCP header too short at %d bytes (min %d bytes)\n",
+ DBG ( "TCP header too short at %zd bytes (min %zd bytes)\n",
hlen, sizeof ( *tcphdr ) );
rc = -EINVAL;
goto discard;
}
if ( hlen > iob_len ( iobuf ) ) {
- DBG ( "TCP header too long at %d bytes (max %d bytes)\n",
+ DBG ( "TCP header too long at %zd bytes (max %zd bytes)\n",
hlen, iob_len ( iobuf ) );
rc = -EINVAL;
goto discard;
command->cmdsn = htonl ( iscsi->cmdsn );
command->expstatsn = htonl ( iscsi->statsn + 1 );
memcpy ( &command->cdb, &iscsi->command->cdb, sizeof ( command->cdb ));
- DBGC ( iscsi, "iSCSI %p start " SCSI_CDB_FORMAT " %s %#x\n",
+ DBGC ( iscsi, "iSCSI %p start " SCSI_CDB_FORMAT " %s %#zx\n",
iscsi, SCSI_CDB_DATA ( command->cdb ),
( iscsi->command->data_in ? "in" : "out" ),
( iscsi->command->data_in ?
struct crypto_algorithm *pubkey = &crypto_null;
struct crypto_algorithm *cipher = &crypto_null;
struct crypto_algorithm *digest = &crypto_null;
- size_t key_len = 0;
+ unsigned int key_len = 0;
int rc;
switch ( cipher_suite ) {
udphdr->chksum = tcpip_chksum ( udphdr, len );
/* Dump debugging information */
- DBGC ( udp, "UDP %p TX %d->%d len %zd\n", udp,
+ DBGC ( udp, "UDP %p TX %d->%d len %d\n", udp,
ntohs ( udphdr->src ), ntohs ( udphdr->dest ),
ntohs ( udphdr->len ) );
/* Sanity check packet */
if ( iob_len ( iobuf ) < sizeof ( *udphdr ) ) {
- DBG ( "UDP packet too short at %d bytes (min %d bytes)\n",
+ DBG ( "UDP packet too short at %zd bytes (min %zd bytes)\n",
iob_len ( iobuf ), sizeof ( *udphdr ) );
rc = -EINVAL;
}
ulen = ntohs ( udphdr->len );
if ( ulen < sizeof ( *udphdr ) ) {
- DBG ( "UDP length too short at %d bytes "
- "(header is %d bytes)\n", ulen, sizeof ( *udphdr ) );
+ DBG ( "UDP length too short at %zd bytes "
+ "(header is %zd bytes)\n", ulen, sizeof ( *udphdr ) );
rc = -EINVAL;
goto done;
}
if ( ulen > iob_len ( iobuf ) ) {
- DBG ( "UDP length too long at %d bytes (packet is %d bytes)\n",
- ulen, iob_len ( iobuf ) );
+ DBG ( "UDP length too long at %zd bytes (packet is %zd "
+ "bytes)\n", ulen, iob_len ( iobuf ) );
rc = -EINVAL;
goto done;
}
iobuf = alloc_iob ( UDP_MAX_HLEN + len );
if ( ! iobuf ) {
- DBGC ( udp, "UDP %p cannot allocate buffer of length %d\n",
+ DBGC ( udp, "UDP %p cannot allocate buffer of length %zd\n",
udp, len );
return NULL;
}
/* Allocate empty options block of required size */
options = alloc_dhcp_options ( options_len );
if ( ! options ) {
- DBG ( "DHCP could not allocate %d-byte option block\n",
+ DBG ( "DHCP could not allocate %zd-byte option block\n",
options_len );
return NULL;
}