tag | line | file | source code |
adapter | 231 | drivers/net/3c505.c | #define GET_ASF() (get_status(adapter)&ASF_PCB_MASK) |
adapter | 232 | drivers/net/3c505.c | #define GET_STATUS() (get_status(adapter)) |
adapter | 234 | drivers/net/3c505.c | static int get_status (elp_device * adapter) |
adapter | 240 | drivers/net/3c505.c | stat1 = INB(adapter->io_addr+PORT_STATUS); |
adapter | 241 | drivers/net/3c505.c | } while (stat1 != INB(adapter->io_addr+PORT_STATUS) && jiffies < timeout); |
adapter | 247 | drivers/net/3c505.c | #define SET_HSF(hsf) (set_hsf(adapter,hsf)) |
adapter | 249 | drivers/net/3c505.c | static void set_hsf (elp_device * adapter, int hsf) |
adapter | 253 | drivers/net/3c505.c | OUTB((INB(adapter->io_addr+PORT_CONTROL)&(~HSF_PCB_MASK))|hsf, adapter->io_addr+PORT_CONTROL); |
adapter | 257 | drivers/net/3c505.c | #define WAIT_HCRE(toval) (wait_hcre(adapter,toval)) |
adapter | 259 | drivers/net/3c505.c | static int wait_hcre(elp_device * adapter, int toval) |
adapter | 263 | drivers/net/3c505.c | while(((INB(adapter->io_addr+PORT_STATUS)&STATUS_HCRE)==0) && |
adapter | 288 | drivers/net/3c505.c | static int send_pcb(elp_device * adapter, pcb_struct * pcb) |
adapter | 297 | drivers/net/3c505.c | CHECK_NULL(adapter); |
adapter | 312 | drivers/net/3c505.c | OUTB(pcb->command, (adapter->io_addr)+PORT_COMMAND); |
adapter | 316 | drivers/net/3c505.c | OUTB(pcb->length, (adapter->io_addr)+PORT_COMMAND); |
adapter | 321 | drivers/net/3c505.c | OUTB(pcb->data.raw[i], (adapter->io_addr)+PORT_COMMAND); |
adapter | 330 | drivers/net/3c505.c | OUTB(2+pcb->length, adapter->io_addr+PORT_COMMAND); |
adapter | 347 | drivers/net/3c505.c | printk("%s: PCB send was NAKed\n", adapter->name); |
adapter | 357 | drivers/net/3c505.c | printk("%s: NAK/timeout on send PCB\n", adapter->name); |
adapter | 359 | drivers/net/3c505.c | printk("%s: retry #%i on send PCB\n", adapter->name, retry); |
adapter | 378 | drivers/net/3c505.c | static int receive_pcb(elp_device * adapter, pcb_struct * pcb) |
adapter | 387 | drivers/net/3c505.c | CHECK_NULL(adapter); |
adapter | 397 | drivers/net/3c505.c | pcb->command = INB(adapter->io_addr+PORT_COMMAND); |
adapter | 406 | drivers/net/3c505.c | pcb->length = INB(adapter->io_addr+PORT_COMMAND); |
adapter | 419 | drivers/net/3c505.c | pcb->data.raw[i++] = INB(adapter->io_addr+PORT_COMMAND); |
adapter | 433 | drivers/net/3c505.c | printk("%s: mangled PCB received\n", adapter->name); |
adapter | 449 | drivers/net/3c505.c | static void adapter_hard_reset(elp_device * adapter) |
adapter | 454 | drivers/net/3c505.c | CHECK_NULL(adapter); |
adapter | 459 | drivers/net/3c505.c | OUTB(CONTROL_ATTN|CONTROL_FLSH, adapter->io_addr+PORT_CONTROL); |
adapter | 470 | drivers/net/3c505.c | OUTB(0, adapter->io_addr+PORT_CONTROL); |
adapter | 488 | drivers/net/3c505.c | static void adapter_reset(elp_device * adapter) |
adapter | 492 | drivers/net/3c505.c | CHECK_NULL(adapter); |
adapter | 495 | drivers/net/3c505.c | OUTB(CONTROL_ATTN|INB(adapter->io_addr+PORT_CONTROL), adapter->io_addr+PORT_CONTROL); |
adapter | 505 | drivers/net/3c505.c | OUTB(INB(adapter->io_addr+PORT_CONTROL)&~(CONTROL_ATTN), adapter->io_addr+PORT_CONTROL); |
adapter | 517 | drivers/net/3c505.c | static int start_receive(elp_device * adapter, pcb_struct * tx_pcb) |
adapter | 520 | drivers/net/3c505.c | CHECK_NULL(adapter); |
adapter | 524 | drivers/net/3c505.c | printk("%s: restarting receiver\n", adapter->name); |
adapter | 530 | drivers/net/3c505.c | return send_pcb(adapter, tx_pcb); |
adapter | 543 | drivers/net/3c505.c | elp_device * adapter, |
adapter | 563 | drivers/net/3c505.c | CHECK_NULL(adapter); |
adapter | 580 | drivers/net/3c505.c | OUTB(INB(adapter->io_addr+PORT_CONTROL)|CONTROL_DIR, adapter->io_addr+PORT_CONTROL); |
adapter | 588 | drivers/net/3c505.c | while ((INB(adapter->io_addr+PORT_STATUS)&STATUS_HRDY) == 0 && |
adapter | 594 | drivers/net/3c505.c | d = inw(adapter->io_addr+PORT_DATA); |
adapter | 596 | drivers/net/3c505.c | adapter->stats.rx_dropped++; |
adapter | 617 | drivers/net/3c505.c | while ((INB(adapter->io_addr+PORT_STATUS)&STATUS_HRDY) == 0 && |
adapter | 632 | drivers/net/3c505.c | *ptr = inw(adapter->io_addr+PORT_DATA); |
adapter | 658 | drivers/net/3c505.c | OUTB(INB(adapter->io_addr+PORT_CONTROL)&(~CONTROL_DIR), adapter->io_addr+PORT_CONTROL); |
adapter | 674 | drivers/net/3c505.c | elp_device * adapter; |
adapter | 697 | drivers/net/3c505.c | adapter = (elp_device *) dev->priv; |
adapter | 699 | drivers/net/3c505.c | CHECK_NULL(adapter); |
adapter | 715 | drivers/net/3c505.c | while ((INB(adapter->io_addr+PORT_STATUS)&STATUS_ACRF) != 0 && |
adapter | 718 | drivers/net/3c505.c | if (receive_pcb(adapter, &adapter->irx_pcb)) { |
adapter | 720 | drivers/net/3c505.c | switch (adapter->irx_pcb.command) { |
adapter | 726 | drivers/net/3c505.c | adapter->got[CMD_CONFIGURE_82586] = 1; |
adapter | 735 | drivers/net/3c505.c | adapter->got[CMD_CONFIGURE_ADAPTER_MEMORY] = 1; |
adapter | 738 | drivers/net/3c505.c | adapter->irx_pcb.data.failed?"failed":"succeeded"); |
adapter | 745 | drivers/net/3c505.c | adapter->got[CMD_LOAD_MULTICAST_LIST] = 1; |
adapter | 748 | drivers/net/3c505.c | adapter->irx_pcb.data.failed?"failed":"succeeded"); |
adapter | 755 | drivers/net/3c505.c | adapter->got[CMD_SET_STATION_ADDRESS] = 1; |
adapter | 758 | drivers/net/3c505.c | adapter->irx_pcb.data.failed?"failed":"succeeded"); |
adapter | 766 | drivers/net/3c505.c | adapter->stats.rx_packets += adapter->irx_pcb.data.netstat.tot_recv; |
adapter | 767 | drivers/net/3c505.c | adapter->stats.tx_packets += adapter->irx_pcb.data.netstat.tot_xmit; |
adapter | 768 | drivers/net/3c505.c | adapter->stats.rx_crc_errors += adapter->irx_pcb.data.netstat.err_CRC; |
adapter | 769 | drivers/net/3c505.c | adapter->stats.rx_frame_errors += adapter->irx_pcb.data.netstat.err_align; |
adapter | 770 | drivers/net/3c505.c | adapter->stats.rx_fifo_errors += adapter->irx_pcb.data.netstat.err_ovrrun; |
adapter | 771 | drivers/net/3c505.c | adapter->got[CMD_NETWORK_STATISTICS] = 1; |
adapter | 783 | drivers/net/3c505.c | len = adapter->irx_pcb.data.rcv_resp.pkt_len; |
adapter | 784 | drivers/net/3c505.c | dlen = adapter->irx_pcb.data.rcv_resp.buf_len; |
adapter | 785 | drivers/net/3c505.c | if (adapter->irx_pcb.data.rcv_resp.timeout != 0) { |
adapter | 790 | drivers/net/3c505.c | receive_packet(dev, adapter, dlen); |
adapter | 794 | drivers/net/3c505.c | if (dev->start && !start_receive(adapter, &adapter->itx_pcb)) |
adapter | 810 | drivers/net/3c505.c | if (adapter->irx_pcb.data.xmit_resp.c_stat != 0) |
adapter | 813 | drivers/net/3c505.c | dev->name, adapter->irx_pcb.data.xmit_resp.c_stat); |
adapter | 826 | drivers/net/3c505.c | printk("%s: unknown PCB received - %2.2x\n", dev->name, adapter->irx_pcb.command); |
adapter | 851 | drivers/net/3c505.c | elp_device * adapter = (elp_device *) dev->priv; |
adapter | 861 | drivers/net/3c505.c | if (adapter == NULL) { |
adapter | 869 | drivers/net/3c505.c | OUTB(0x00, adapter->io_addr+PORT_CONTROL); |
adapter | 874 | drivers/net/3c505.c | INB(adapter->io_addr+PORT_COMMAND); |
adapter | 900 | drivers/net/3c505.c | OUTB(CONTROL_CMDE, adapter->io_addr+PORT_CONTROL); |
adapter | 912 | drivers/net/3c505.c | adapter->tx_pcb.command = CMD_CONFIGURE_ADAPTER_MEMORY; |
adapter | 913 | drivers/net/3c505.c | adapter->tx_pcb.data.memconf.cmd_q = 10; |
adapter | 914 | drivers/net/3c505.c | adapter->tx_pcb.data.memconf.rcv_q = 20; |
adapter | 915 | drivers/net/3c505.c | adapter->tx_pcb.data.memconf.mcast = 10; |
adapter | 916 | drivers/net/3c505.c | adapter->tx_pcb.data.memconf.frame = 20; |
adapter | 917 | drivers/net/3c505.c | adapter->tx_pcb.data.memconf.rcv_b = 20; |
adapter | 918 | drivers/net/3c505.c | adapter->tx_pcb.data.memconf.progs = 0; |
adapter | 919 | drivers/net/3c505.c | adapter->tx_pcb.length = sizeof(struct Memconf); |
adapter | 920 | drivers/net/3c505.c | adapter->got[CMD_CONFIGURE_ADAPTER_MEMORY] = 0; |
adapter | 921 | drivers/net/3c505.c | if (!send_pcb(adapter, &adapter->tx_pcb)) |
adapter | 925 | drivers/net/3c505.c | while (adapter->got[CMD_CONFIGURE_ADAPTER_MEMORY] == 0 && jiffies < timeout) |
adapter | 937 | drivers/net/3c505.c | adapter->tx_pcb.command = CMD_CONFIGURE_82586; |
adapter | 938 | drivers/net/3c505.c | adapter->tx_pcb.data.configure = NO_LOOPBACK | RECV_BROAD; |
adapter | 939 | drivers/net/3c505.c | adapter->tx_pcb.length = 2; |
adapter | 940 | drivers/net/3c505.c | adapter->got[CMD_CONFIGURE_82586] = 0; |
adapter | 941 | drivers/net/3c505.c | if (!send_pcb(adapter, &adapter->tx_pcb)) |
adapter | 945 | drivers/net/3c505.c | while (adapter->got[CMD_CONFIGURE_82586] == 0 && jiffies < timeout) |
adapter | 954 | drivers/net/3c505.c | if (!start_receive(adapter, &adapter->tx_pcb)) |
adapter | 969 | drivers/net/3c505.c | static int send_packet (elp_device * adapter, unsigned char * ptr, int len) |
adapter | 979 | drivers/net/3c505.c | CHECK_NULL(adapter); |
adapter | 989 | drivers/net/3c505.c | adapter->tx_pcb.command = CMD_TRANSMIT_PACKET; |
adapter | 990 | drivers/net/3c505.c | adapter->tx_pcb.length = sizeof(struct Xmit_pkt); |
adapter | 991 | drivers/net/3c505.c | adapter->tx_pcb.data.xmit_pkt.buf_ofs = adapter->tx_pcb.data.xmit_pkt.buf_seg = 0; /* Unused */ |
adapter | 992 | drivers/net/3c505.c | adapter->tx_pcb.data.xmit_pkt.pkt_len = nlen; |
adapter | 993 | drivers/net/3c505.c | if (!send_pcb(adapter, &adapter->tx_pcb)) |
adapter | 1000 | drivers/net/3c505.c | OUTB(INB(adapter->io_addr+PORT_CONTROL)&(~CONTROL_DIR), adapter->io_addr+PORT_CONTROL); |
adapter | 1008 | drivers/net/3c505.c | while ((INB(adapter->io_addr+PORT_STATUS)&STATUS_HRDY) == 0 && jiffies < timeout) |
adapter | 1016 | drivers/net/3c505.c | outw(*(short *)ptr, adapter->io_addr+PORT_DATA); |
adapter | 1033 | drivers/net/3c505.c | elp_device * adapter = (elp_device *) dev->priv; |
adapter | 1076 | drivers/net/3c505.c | if ((INB(adapter->io_addr+PORT_STATUS)&STATUS_ACRF) != 0) |
adapter | 1078 | drivers/net/3c505.c | adapter_reset(adapter); |
adapter | 1086 | drivers/net/3c505.c | if (!send_packet(adapter, (unsigned char *)SKB_DATA, skb->len)) { |
adapter | 1130 | drivers/net/3c505.c | elp_device *adapter = (elp_device *) dev->priv; |
adapter | 1138 | drivers/net/3c505.c | return &adapter->stats; |
adapter | 1141 | drivers/net/3c505.c | adapter->tx_pcb.command = CMD_NETWORK_STATISTICS; |
adapter | 1142 | drivers/net/3c505.c | adapter->tx_pcb.length = 0; |
adapter | 1143 | drivers/net/3c505.c | adapter->got[CMD_NETWORK_STATISTICS] = 0; |
adapter | 1144 | drivers/net/3c505.c | if (!send_pcb(adapter, &adapter->tx_pcb)) |
adapter | 1149 | drivers/net/3c505.c | while (adapter->got[CMD_NETWORK_STATISTICS] == 0 && jiffies < timeout) |
adapter | 1153 | drivers/net/3c505.c | return &adapter->stats; |
adapter | 1158 | drivers/net/3c505.c | return &adapter->stats; |
adapter | 1170 | drivers/net/3c505.c | elp_device * adapter = (elp_device *) dev->priv; |
adapter | 1173 | drivers/net/3c505.c | CHECK_NULL(adapter); |
adapter | 1187 | drivers/net/3c505.c | OUTB(0x00, adapter->io_addr+PORT_CONTROL); |
adapter | 1224 | drivers/net/3c505.c | elp_device *adapter = (elp_device *) dev->priv; |
adapter | 1233 | drivers/net/3c505.c | adapter->tx_pcb.command = CMD_LOAD_MULTICAST_LIST; |
adapter | 1234 | drivers/net/3c505.c | adapter->tx_pcb.length = 6*num_addrs; |
adapter | 1236 | drivers/net/3c505.c | memcpy(adapter->tx_pcb.data.multicast[i], addrs+6*i,6); |
adapter | 1237 | drivers/net/3c505.c | adapter->got[CMD_LOAD_MULTICAST_LIST] = 0; |
adapter | 1238 | drivers/net/3c505.c | if (!send_pcb(adapter, &adapter->tx_pcb)) |
adapter | 1242 | drivers/net/3c505.c | while (adapter->got[CMD_LOAD_MULTICAST_LIST] == 0 && jiffies < timeout) |
adapter | 1249 | drivers/net/3c505.c | adapter->tx_pcb.data.configure = NO_LOOPBACK | RECV_BROAD | RECV_MULTI; |
adapter | 1251 | drivers/net/3c505.c | adapter->tx_pcb.data.configure = NO_LOOPBACK | RECV_BROAD; |
adapter | 1253 | drivers/net/3c505.c | adapter->tx_pcb.data.configure = NO_LOOPBACK | RECV_ALL; |
adapter | 1260 | drivers/net/3c505.c | adapter->tx_pcb.command = CMD_CONFIGURE_82586; |
adapter | 1261 | drivers/net/3c505.c | adapter->tx_pcb.length = 2; |
adapter | 1262 | drivers/net/3c505.c | adapter->got[CMD_CONFIGURE_82586] = 0; |
adapter | 1263 | drivers/net/3c505.c | if (!send_pcb(adapter, &adapter->tx_pcb)) |
adapter | 1267 | drivers/net/3c505.c | while (adapter->got[CMD_CONFIGURE_82586] == 0 && jiffies < timeout) |
adapter | 1283 | drivers/net/3c505.c | elp_device * adapter; |
adapter | 1322 | drivers/net/3c505.c | adapter = (elp_device *)(dev->priv = kmalloc(sizeof(elp_device), GFP_KERNEL)); |
adapter | 1323 | drivers/net/3c505.c | CHECK_NULL(adapter); |
adapter | 1324 | drivers/net/3c505.c | adapter->io_addr = dev->base_addr; |
adapter | 1325 | drivers/net/3c505.c | adapter->name = dev->name; |
adapter | 1326 | drivers/net/3c505.c | memset(&(adapter->stats), 0, sizeof(struct enet_statistics)); |
adapter | 1361 | drivers/net/3c505.c | adapter_hard_reset(adapter); |
adapter | 1363 | drivers/net/3c505.c | adapter_reset(adapter); |
adapter | 1462 | drivers/net/3c505.c | elp_device adapter; |
adapter | 1471 | drivers/net/3c505.c | adapter.io_addr = dev->base_addr = elp_autodetect(dev); |
adapter | 1472 | drivers/net/3c505.c | if ( !adapter.io_addr ) |
adapter | 1487 | drivers/net/3c505.c | adapter.tx_pcb.command = CMD_STATION_ADDRESS; |
adapter | 1488 | drivers/net/3c505.c | adapter.tx_pcb.length = 0; |
adapter | 1489 | drivers/net/3c505.c | if (!send_pcb (&adapter, &adapter.tx_pcb) || |
adapter | 1490 | drivers/net/3c505.c | !receive_pcb(&adapter, &adapter.rx_pcb) || |
adapter | 1491 | drivers/net/3c505.c | (adapter.rx_pcb.command != CMD_ADDRESS_RESPONSE) || |
adapter | 1492 | drivers/net/3c505.c | (adapter.rx_pcb.length != 6)) { |
adapter | 1528 | drivers/net/3c505.c | dev->dev_addr[i] = adapter.rx_pcb.data.eth_addr[i]; |