Changeset 122b753 in mainline for uspace/srv
- Timestamp:
 - 2011-01-06T17:23:58Z (15 years ago)
 - Branches:
 - lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
 - Children:
 - 40559a96
 - Parents:
 - d3a0af7
 - Location:
 - uspace/srv/hw/netif/dp8390
 - Files:
 - 
      
- 2 edited
 
- 
          
  dp8390.c (modified) (7 diffs)
 - 
          
  dp8390_port.h (modified) (2 diffs)
 
 
Legend:
- Unmodified
 - Added
 - Removed
 
- 
      
uspace/srv/hw/netif/dp8390/dp8390.c
rd3a0af7 r122b753 674 674 675 675 // if (!(dep->de_flags & DEF_READING)) 676 // return E GENERIC;676 // return EINVAL; 677 677 678 678 packet = netif_packet_get_1(length); … … 771 771 void *vir_user; 772 772 size_t ecount; 773 int i , r;773 int i; 774 774 size_t bytes; 775 775 //uint8_t two_bytes[2]; … … 810 810 811 811 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); 818 813 819 814 //outw(dep->de_data_port, *(uint16_t *) two_bytes); … … 841 836 assert(bytes == 1); 842 837 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); 849 839 850 840 count--; … … 915 905 void *vir_user; 916 906 size_t ecount; 917 int i , r;907 int i; 918 908 size_t bytes; 919 909 //uint8_t two_bytes[2]; … … 953 943 954 944 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); 960 946 961 947 count--; … … 983 969 //*(uint16_t *) two_bytes= inw(dep->de_data_port); 984 970 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); 990 972 991 973 count--;  - 
      
uspace/srv/hw/netif/dp8390/dp8390_port.h
rd3a0af7 r122b753 78 78 #define outw(port, value) pio_write_16((ioport16_t *) (port), (value)) 79 79 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 92 80 /** Reads a memory block byte by byte. 93 81 * @param[in] port The address to be written. … … 181 169 } eth_stat_t; 182 170 183 /* errno.h */184 /** Generic error.185 */186 #define EGENERIC EINVAL187 188 171 /* ether.h */ 189 172 /** Minimum Ethernet packet size in bytes. 190 173 */ 191 #define ETH_MIN_PACK_SIZE 60174 #define ETH_MIN_PACK_SIZE 60 192 175 193 176 /** Maximum Ethernet packet size in bytes. 194 177 */ 195 #define ETH_MAX_PACK_SIZE_TAGGED 1518178 #define ETH_MAX_PACK_SIZE_TAGGED 1518 196 179 197 180 /** Ethernet address type definition. 198 181 */ 199 typedef struct ether_addr 200 { 182 typedef struct ether_addr { 201 183 /** Address data. 202 184 */  
  Note:
 See   TracChangeset
 for help on using the changeset viewer.
  