Changeset 37f0a29 in mainline
- Timestamp:
- 2011-01-06T18:24:32Z (14 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- b187536
- Parents:
- 096234b
- Location:
- uspace/srv/hw/netif/dp8390
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/hw/netif/dp8390/dp8390.c
r096234b r37f0a29 59 59 static void dp_pio16_nic2user(dpeth_t *dep, int nic_addr, void *buf, size_t offset, size_t size); 60 60 static void conf_hw(dpeth_t *dep); 61 static void reply(dpeth_t *dep, int err, int may_block);62 61 static void insb(port_t port, void *buf, size_t size); 63 62 static void insw(port_t port, void *buf, size_t size); … … 83 82 return EXDEV; 84 83 85 if (dep->de_mode == DEM_SINK) {86 // strncpy((char *) dep->de_address.ea_addr, "ZDP", 6);87 // dep->de_address.ea_addr[5] = port;88 // reply_mess.m_type = DL_CONF_REPLY;89 // reply_mess.m3_i1 = mp->DL_PORT;90 // reply_mess.m3_i2 = DE_PORT_NR;91 // *(ether_addr_t *) reply_mess.m3_ca1 = dep->de_address;92 // mess_reply(mp, &reply_mess);93 // return;94 return EOK;95 }96 97 84 assert(dep->de_mode == DEM_ENABLED); 98 85 assert(dep->de_flags & DEF_ENABLED); … … 123 110 void do_stop(dpeth_t *dep) 124 111 { 125 if ((dep->de_mode != DEM_SINK) 126 && (dep->de_mode == DEM_ENABLED) 112 if ((dep->de_mode == DEM_ENABLED) 127 113 && (dep->de_flags & DEF_ENABLED)) { 128 114 outb_reg0(dep, DP_CR, CR_STP | CR_DM_ABORT); … … 161 147 int sendq_head; 162 148 /* dpeth_t *dep; 163 149 164 150 port = mp->DL_PORT; 165 151 count = mp->DL_COUNT; … … 169 155 dep->de_client= mp->DL_PROC; 170 156 */ 171 if (dep->de_mode == DEM_SINK) {172 assert(!from_int);173 // dep->de_flags |= DEF_PACK_SEND;174 reply(dep, EOK, false);175 // return;176 return EOK;177 }178 157 179 158 assert(dep->de_mode == DEM_ENABLED); 180 assert(dep->de_flags & DEF_ENABLED);159 assert(dep->de_flags & DEF_ENABLED); 181 160 182 161 if ((dep->packet_queue) && (!from_int)) { … … 192 171 // dep->de_sendmsg= *mp; 193 172 // dep->de_flags |= DEF_SEND_AVAIL; 194 // reply(dep, EOK, false);195 173 // return; 196 174 // return queue_packet(dep, packet); … … 244 222 245 223 // dep->de_flags |= DEF_PACK_SEND; 246 247 /*248 * If the interrupt handler called, don't send a reply. The reply249 * will be sent after all interrupts are handled.250 */251 if (from_int)252 return EOK;253 254 reply(dep, EOK, false);255 256 assert(dep->de_mode == DEM_ENABLED);257 assert(dep->de_flags & DEF_ENABLED);258 224 259 225 return EOK; … … 540 506 * are delivered. 541 507 */ 542 printf("<reset>\n");543 508 dp_reset(dep); 544 509 } … … 692 657 } 693 658 694 dep->de_read_s = length;695 659 dep->de_flags |= DEF_PACK_RECV; 696 660 // dep->de_flags &= ~DEF_READING; … … 836 800 } 837 801 838 static void reply(dpeth_t *dep, int err, int may_block)839 {840 /* message reply;841 int status;842 int r;843 844 status = 0;845 if (dep->de_flags &DEF_PACK_SEND)846 status |= DL_PACK_SEND;847 848 if (dep->de_flags &DEF_PACK_RECV)849 status |= DL_PACK_RECV;850 851 reply.m_type = DL_TASK_REPLY;852 reply.DL_PORT = dep - de_table;853 reply.DL_PROC = dep->de_client;854 reply.DL_STAT = status | ((u32_t) err << 16);855 reply.DL_COUNT = dep->de_read_s;856 reply.DL_CLCK = 0; *//* Don't know */857 858 /* r = send(dep->de_client, &reply);859 if (r == ELOCKED && may_block) {860 printf("send locked\n");861 return;862 }863 864 if (r < 0)865 fprintf(stderr, "dp8390: send failed\n");866 867 */ dep->de_read_s = 0;868 // dep->de_flags &= ~(DEF_PACK_SEND | DEF_PACK_RECV);869 }870 871 802 static void insb(port_t port, void *buf, size_t size) 872 803 { -
uspace/srv/hw/netif/dp8390/dp8390.h
r096234b r37f0a29 286 286 int de_mode; 287 287 eth_stat_t de_stat; 288 size_t de_read_s; 289 // int de_client; 290 // message de_sendmsg; 291 dp_user2nicf_t de_user2nicf; 288 dp_user2nicf_t de_user2nicf; 292 289 dp_nic2userf_t de_nic2userf; 293 290 dp_getblock_t de_getblockf; … … 308 305 309 306 #define DEM_DISABLED 0x0 310 #define DEM_SINK 0x1311 307 #define DEM_ENABLED 0x2 312 308 -
uspace/srv/hw/netif/dp8390/dp8390_module.c
r096234b r37f0a29 301 301 302 302 packet = next; 303 } while (packet);303 } while (packet); 304 304 305 305 return EOK; -
uspace/srv/hw/netif/dp8390/ne2000.c
r096234b r37f0a29 145 145 dep->de_data_port= dep->de_base_port + NE_DATA; 146 146 if (dep->de_16bit) { 147 dep->de_ramsize = NE2000_SIZE;148 dep->de_offset_page = NE2000_START / DP_PAGESIZE;147 dep->de_ramsize = NE2000_SIZE; 148 dep->de_offset_page = NE2000_START / DP_PAGESIZE; 149 149 } else { 150 dep->de_ramsize = NE1000_SIZE;151 dep->de_offset_page = NE1000_START / DP_PAGESIZE;150 dep->de_ramsize = NE1000_SIZE; 151 dep->de_offset_page = NE1000_START / DP_PAGESIZE; 152 152 } 153 153 154 154 /* Allocate one send buffer (1.5KB) per 8KB of on board memory. */ 155 sendq_nr = dep->de_ramsize / 0x2000;155 sendq_nr = dep->de_ramsize / 0x2000; 156 156 157 157 if (sendq_nr < 1) … … 162 162 dep->de_sendq_nr = sendq_nr; 163 163 for (i = 0; i < sendq_nr; i++) 164 dep->de_sendq[i].sq_sendpage = dep->de_offset_page + i * SENDQ_PAGES;164 dep->de_sendq[i].sq_sendpage = dep->de_offset_page + i * SENDQ_PAGES; 165 165 166 166 dep->de_startpage = dep->de_offset_page + i * SENDQ_PAGES;
Note:
See TracChangeset
for help on using the changeset viewer.