Changeset 122b753 in mainline


Ignore:
Timestamp:
2011-01-06T17:23:58Z (13 years ago)
Author:
Martin Decky <martin@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
40559a96
Parents:
d3a0af7
Message:

more declutter

Location:
uspace/srv/hw/netif/dp8390
Files:
2 edited

Legend:

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

    rd3a0af7 r122b753  
    674674       
    675675//      if (!(dep->de_flags & DEF_READING))
    676 //              return EGENERIC;
     676//              return EINVAL;
    677677       
    678678        packet = netif_packet_get_1(length);
     
    771771        void *vir_user;
    772772        size_t ecount;
    773         int i, r;
     773        int i;
    774774        size_t bytes;
    775775        //uint8_t two_bytes[2];
     
    810810               
    811811                if (odd_byte) {
    812                         r = sys_vircopy(user_proc, D, vir_user,
    813                         //      SELF, D, (vir_bytes) &two_bytes[1], 1);
    814                                 SELF, D, &(((uint8_t *) &two_bytes)[1]), 1);
    815                        
    816                         if (r != EOK)
    817                                 fprintf(stderr, "DP8390: dp_pio16_user2nic: sys_vircopy failed\n");
     812                        memcpy(&(((uint8_t *) &two_bytes)[1]), vir_user, 1);
    818813                       
    819814                        //outw(dep->de_data_port, *(uint16_t *) two_bytes);
     
    841836                        assert(bytes == 1);
    842837                       
    843                         r = sys_vircopy(user_proc, D, vir_user,
    844                         //      SELF, D, (vir_bytes) &two_bytes[0], 1);
    845                                 SELF, D, &(((uint8_t *) &two_bytes)[0]), 1);
    846                        
    847                         if (r != EOK)
    848                                 fprintf(stderr, "DP8390: dp_pio16_user2nic: sys_vircopy failed\n");
     838                        memcpy(&(((uint8_t *) &two_bytes)[0]), vir_user, 1);
    849839                       
    850840                        count--;
     
    915905        void *vir_user;
    916906        size_t ecount;
    917         int i, r;
     907        int i;
    918908        size_t bytes;
    919909        //uint8_t two_bytes[2];
     
    953943               
    954944                if (odd_byte) {
    955                         //r= sys_vircopy(SELF, D, (vir_bytes)&two_bytes[1],
    956                         r= sys_vircopy(SELF, D, &(((uint8_t *) &two_bytes)[1]),
    957                             user_proc, D, vir_user, 1);
    958                         if (r != EOK)
    959                                 fprintf(stderr, "DP8390: dp_pio16_nic2user: sys_vircopy failed\n");
     945                        memcpy(vir_user, &(((uint8_t *) &two_bytes)[1]), 1);
    960946                       
    961947                        count--;
     
    983969                        //*(uint16_t *) two_bytes= inw(dep->de_data_port);
    984970                        two_bytes = inw(dep->de_data_port);
    985                         //r= sys_vircopy(SELF, D, (vir_bytes) &two_bytes[0],
    986                         r = sys_vircopy(SELF, D, &(((uint8_t *) &two_bytes)[0]),
    987                             user_proc, D, vir_user,  1);
    988                         if (r != EOK)
    989                                 fprintf(stderr, "DP8390: dp_pio16_nic2user: sys_vircopy failed\n");
     971                        memcpy(vir_user, &(((uint8_t *) &two_bytes)[0]), 1);
    990972                       
    991973                        count--;
  • uspace/srv/hw/netif/dp8390/dp8390_port.h

    rd3a0af7 r122b753  
    7878#define outw(port, value)  pio_write_16((ioport16_t *) (port), (value))
    7979
    80 /** Copies a memory block.
    81  *  @param proc The source process. Ignored parameter.
    82  *  @param src_s Ignored parameter.
    83  *  @param[in] src The source address.
    84  *  @param me The current proces. Ignored parameter.
    85  *  @param dst_s Ignored parameter.
    86  *  @param[in] dst The destination address.
    87  *  @param[in] bytes The block size in bytes.
    88  *  @returns EOK.
    89  */
    90 #define sys_vircopy(proc, src_s, src, me, dst_s, dst, bytes)    ({memcpy((void *)(dst), (void *)(src), (bytes)); EOK;})
    91 
    9280/** Reads a memory block byte by byte.
    9381 *  @param[in] port The address to be written.
     
    181169} eth_stat_t;
    182170
    183 /* errno.h */
    184 /** Generic error.
    185  */
    186 #define EGENERIC     EINVAL
    187 
    188171/* ether.h */
    189172/** Minimum Ethernet packet size in bytes.
    190173 */
    191 #define ETH_MIN_PACK_SIZE                 60
     174#define ETH_MIN_PACK_SIZE  60
    192175
    193176/** Maximum Ethernet packet size in bytes.
    194177 */
    195 #define ETH_MAX_PACK_SIZE_TAGGED        1518
     178#define ETH_MAX_PACK_SIZE_TAGGED  1518
    196179
    197180/** Ethernet address type definition.
    198181 */
    199 typedef struct ether_addr
    200 {
     182typedef struct ether_addr {
    201183        /** Address data.
    202184         */
Note: See TracChangeset for help on using the changeset viewer.