Changeset 61bfc370 in mainline for uspace/srv/hw/netif


Ignore:
Timestamp:
2011-01-07T18:57:55Z (15 years ago)
Author:
Martin Decky <martin@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
e08a733
Parents:
7c34b28f
Message:
  • make measured_string and other network-related data types binary-safe
  • fix several network-related routines binary-safe (replace clearly suspicious use of str_lcmp() with bcmp())
  • rename spawn() to net_spawn()
Location:
uspace/srv/hw/netif/dp8390
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • uspace/srv/hw/netif/dp8390/dp8390.c

    r7c34b28f r61bfc370  
    550550                if ((length < ETH_MIN_PACK_SIZE) || (length > ETH_MAX_PACK_SIZE_TAGGED)) {
    551551                        printf("Packet with strange length arrived: %zu\n", length);
    552                         next= curr;
     552                        next = curr;
    553553                } else if ((next < dep->de_startpage) || (next >= dep->de_stoppage)) {
    554554                        printf("Strange next page\n");
    555                         next= curr;
     555                        next = curr;
    556556                } else if (header.dr_status & RSR_FO) {
    557557                        /*
  • uspace/srv/hw/netif/dp8390/dp8390_module.c

    r7c34b28f r61bfc370  
    213213                return rc;
    214214       
    215         address->value = (char *) (&((dpeth_t *) device->specific)->de_address);
     215        address->value = (uint8_t *) &((dpeth_t *) device->specific)->de_address;
    216216        address->length = sizeof(ether_addr_t);
    217217        return EOK;
  • uspace/srv/hw/netif/dp8390/dp8390_port.h

    r7c34b28f r61bfc370  
    4343#include <libarch/ddi.h>
    4444#include <sys/types.h>
    45 
    46 /** Compares two memory blocks.
    47  *  @param[in] first The first memory block.
    48  *  @param[in] second The second memory block.
    49  *  @param[in] size The blocks size in bytes.
    50  *  @returns 0 if equeal.
    51  *  @returns -1 if the first is greater than the second.
    52  *  @returns 1 if the second is greater than the first.
    53  */
    54 #define memcmp(first, second, size)  bcmp((char *) (first), (char *) (second), (size))
    5545
    5646/** Reads 1 byte.
  • uspace/srv/hw/netif/dp8390/ne2000.c

    r7c34b28f r61bfc370  
    241241                buf[i] = inb_ne(dep, NE_DATA);
    242242       
    243         return (memcmp(buf, pat, 4) == 0);
     243        return (bcmp(buf, pat, 4) == 0);
    244244}
    245245
     
    280280                *(uint16_t *)(buf + i) = inw_ne(dep, NE_DATA);
    281281       
    282         return (memcmp(buf, pat, 4) == 0);
     282        return (bcmp(buf, pat, 4) == 0);
    283283}
    284284
Note: See TracChangeset for help on using the changeset viewer.