Lines Matching refs:p
66 #define make32(ptr16) (p->memtop + (swab16((unsigned short) (ptr16))) )
67 #define make24(ptr32) (char *)swab32(( ((unsigned long) (ptr32)) - p->base))
68 #define make16(ptr32) (swab16((unsigned short) ((unsigned long)(ptr32) - (unsigned long) p->memtop …
103 if(!p->scb->cmd_cuc) break; \
106 …printk("%s: scb_cmd timed out: %04x,%04x .. disabling i82586!!\n",dev->name,p->scb->cmd_cuc,p->scb…
107 if(!p->reseted) { p->reseted = 1; sun3_reset586(); } } } }
111 if(!p->scb->cmd_ruc) break; \
114 …b_cmd (ruc) timed out: %04x,%04x .. disabling i82586!!\n",dev->name,p->scb->cmd_ruc,p->scb->rus); \
115 if(!p->reseted) { p->reseted = 1; sun3_reset586(); } } } }
212 struct priv *p = &pb; in check586() local
216 p->base = (unsigned long) dvma_btov(0); in check586()
217 p->memtop = (char *)dvma_btov((unsigned long)where); in check586()
218 p->scp = (struct scp_struct *)(p->base + SCP_DEFAULT_ADDRESS); in check586()
219 memset((char *)p->scp,0, sizeof(struct scp_struct)); in check586()
221 if(((char *)p->scp)[i]) in check586()
223 p->scp->sysbus = SYSBUSVAL; /* 1 = 8Bit-Bus, 0 = 16 Bit */ in check586()
224 if(p->scp->sysbus != SYSBUSVAL) in check586()
229 p->iscp = (struct iscp_struct *) iscp_addr; in check586()
230 memset((char *)p->iscp,0, sizeof(struct iscp_struct)); in check586()
232 p->scp->iscp = make24(p->iscp); in check586()
233 p->iscp->busy = 1; in check586()
239 if(p->iscp->busy) /* i82586 clears 'busy' after successful init */ in check586()
250 struct priv *p = netdev_priv(dev); in alloc586() local
255 p->scp = (struct scp_struct *) (p->base + SCP_DEFAULT_ADDRESS); in alloc586()
256 p->iscp = (struct iscp_struct *) dvma_btov(dev->mem_start); in alloc586()
257 p->scb = (struct scb_struct *) ((char *)p->iscp + sizeof(struct iscp_struct)); in alloc586()
259 memset((char *) p->iscp,0,sizeof(struct iscp_struct)); in alloc586()
260 memset((char *) p->scp ,0,sizeof(struct scp_struct)); in alloc586()
262 p->scp->iscp = make24(p->iscp); in alloc586()
263 p->scp->sysbus = SYSBUSVAL; in alloc586()
264 p->iscp->scb_offset = make16(p->scb); in alloc586()
265 p->iscp->scb_base = make24(dvma_btov(dev->mem_start)); in alloc586()
267 p->iscp->busy = 1; in alloc586()
273 if(p->iscp->busy) in alloc586()
276 p->reseted = 0; in alloc586()
278 memset((char *)p->scb,0,sizeof(struct scb_struct)); in alloc586()
405 struct priv *p = netdev_priv(dev); in init586() local
413 ptr = (void *) ((char *)p->scb + sizeof(struct scb_struct)); in init586()
430 int len = ((char *) p->iscp - (char *) ptr - 8) / 6; in init586()
440 p->scb->cbl_offset = make16(cfg_cmd); in init586()
441 p->scb->cmd_ruc = 0; in init586()
443 p->scb->cmd_cuc = CUC_START; /* cmd.-unit start */ in init586()
466 p->scb->cbl_offset = make16(ias_cmd); in init586()
468 p->scb->cmd_cuc = CUC_START; /* cmd.-unit start */ in init586()
489 p->scb->cbl_offset = make16(tdr_cmd); in init586()
490 p->scb->cmd_cuc = CUC_START; /* cmd.-unit start */ in init586()
504 p->scb->cmd_cuc = p->scb->cus & STAT_MASK; in init586()
538 p->scb->cbl_offset = make16(mc_cmd); in init586()
539 p->scb->cmd_cuc = CUC_START; in init586()
554 p->nop_cmds[i] = (struct nop_cmd_struct *)ptr; in init586()
555 p->nop_cmds[i]->cmd_cmd = swab16(CMD_NOP); in init586()
556 p->nop_cmds[i]->cmd_status = 0; in init586()
557 p->nop_cmds[i]->cmd_link = make16((p->nop_cmds[i])); in init586()
563 p->nop_cmds[i] = (struct nop_cmd_struct *)ptr; in init586()
564 p->nop_cmds[i]->cmd_cmd = swab16(CMD_NOP); in init586()
565 p->nop_cmds[i]->cmd_status = 0; in init586()
566 p->nop_cmds[i]->cmd_link = make16((p->nop_cmds[i])); in init586()
578 p->xmit_cmds[i] = (struct transmit_cmd_struct *)ptr; /*transmit cmd/buff 0*/ in init586()
580 p->xmit_cbuffs[i] = (char *)ptr; /* char-buffs */ in init586()
582 p->xmit_buffs[i] = (struct tbd_struct *)ptr; /* TBD */ in init586()
589 memset((char *)(p->xmit_cmds[i]) ,0, sizeof(struct transmit_cmd_struct)); in init586()
590 memset((char *)(p->xmit_buffs[i]),0, sizeof(struct tbd_struct)); in init586()
591 p->xmit_cmds[i]->cmd_link = make16(p->nop_cmds[(i+1)%NUM_XMIT_BUFFS]); in init586()
592 p->xmit_cmds[i]->cmd_status = swab16(STAT_COMPL); in init586()
593 p->xmit_cmds[i]->cmd_cmd = swab16(CMD_XMIT | CMD_INT); in init586()
594 p->xmit_cmds[i]->tbd_offset = make16((p->xmit_buffs[i])); in init586()
595 p->xmit_buffs[i]->next = 0xffff; in init586()
596 p->xmit_buffs[i]->buffer = make24((p->xmit_cbuffs[i])); in init586()
599 p->xmit_count = 0; in init586()
600 p->xmit_last = 0; in init586()
602 p->nop_point = 0; in init586()
609 p->scb->cbl_offset = make16(p->nop_cmds[0]); in init586()
610 p->scb->cmd_cuc = CUC_START; in init586()
614 p->xmit_cmds[0]->cmd_link = make16(p->xmit_cmds[0]); in init586()
615 p->xmit_cmds[0]->cmd_cmd = swab16(CMD_XMIT | CMD_SUSPEND | CMD_INT); in init586()
621 p->scb->cmd_cuc = p->scb->cus & STAT_MASK; in init586()
641 struct priv *p = netdev_priv(dev); in alloc_rfa() local
643 memset((char *) rfd,0,sizeof(struct rfd_struct)*(p->num_recv_buffs+rfdadd)); in alloc_rfa()
644 p->rfd_first = rfd; in alloc_rfa()
646 for(i = 0; i < (p->num_recv_buffs+rfdadd); i++) { in alloc_rfa()
647 rfd[i].next = make16(rfd + (i+1) % (p->num_recv_buffs+rfdadd) ); in alloc_rfa()
650 rfd[p->num_recv_buffs-1+rfdadd].last = RFD_SUSP; /* RU suspend */ in alloc_rfa()
652 ptr = (void *) (rfd + (p->num_recv_buffs + rfdadd) ); in alloc_rfa()
655 ptr = (void *) (rbd + p->num_recv_buffs); in alloc_rfa()
658 memset((char *) rbd,0,sizeof(struct rbd_struct)*(p->num_recv_buffs)); in alloc_rfa()
660 for(i=0;i<p->num_recv_buffs;i++) in alloc_rfa()
662 rbd[i].next = make16((rbd + (i+1) % p->num_recv_buffs)); in alloc_rfa()
668 p->rfd_top = p->rfd_first; in alloc_rfa()
669 p->rfd_last = p->rfd_first + (p->num_recv_buffs - 1 + rfdadd); in alloc_rfa()
671 p->scb->rfa_offset = make16(p->rfd_first); in alloc_rfa()
672 p->rfd_first->rbd_offset = make16(rbd); in alloc_rfa()
687 struct priv *p; in sun3_82586_interrupt() local
693 p = netdev_priv(dev); in sun3_82586_interrupt()
700 while((stat=p->scb->cus & STAT_MASK)) in sun3_82586_interrupt()
702 p->scb->cmd_cuc = stat; in sun3_82586_interrupt()
711 if(p->scb->rus & RU_SUSPEND) /* special case: RU_SUSPEND */ in sun3_82586_interrupt()
714 p->scb->cmd_ruc = RUC_RESUME; in sun3_82586_interrupt()
720 … printk("%s: Receiver-Unit went 'NOT READY': %04x/%02x.\n",dev->name,(int) stat,(int) p->scb->rus); in sun3_82586_interrupt()
732 …printk("%s: oops! CU has left active state. stat: %04x/%02x.\n",dev->name,(int) stat,(int) p->scb-… in sun3_82586_interrupt()
740 if(p->scb->cmd_cuc) /* timed out? */ in sun3_82586_interrupt()
763 struct priv *p = netdev_priv(dev); in sun3_82586_rcv_int() local
768 for(;(status = p->rfd_top->stat_high) & RFD_COMPL;) in sun3_82586_rcv_int()
770 rbd = (struct rbd_struct *) make32(p->rfd_top->rbd_offset); in sun3_82586_rcv_int()
783 skb_copy_to_linear_data(skb,(char *) p->base+swab32((unsigned long) rbd->buffer),totlen); in sun3_82586_rcv_int()
818 p->rfd_top->stat_high = 0; in sun3_82586_rcv_int()
819 p->rfd_top->last = RFD_SUSP; /* maybe exchange by RFD_LAST */ in sun3_82586_rcv_int()
820 p->rfd_top->rbd_offset = 0xffff; in sun3_82586_rcv_int()
821 p->rfd_last->last = 0; /* delete RFD_SUSP */ in sun3_82586_rcv_int()
822 p->rfd_last = p->rfd_top; in sun3_82586_rcv_int()
823 p->rfd_top = (struct rfd_struct *) make32(p->rfd_top->next); /* step to next RFD */ in sun3_82586_rcv_int()
824 p->scb->rfa_offset = make16(p->rfd_top); in sun3_82586_rcv_int()
833 p->scb->cmd_ruc = RUC_RESUME; in sun3_82586_rcv_int()
843 if(p->rfd_top->status) in sun3_82586_rcv_int()
856 volatile struct rfd_struct *rfds=p->rfd_top; in sun3_82586_rcv_int()
859 for(i=0;i< (p->num_recv_buffs+4);i++) in sun3_82586_rcv_int()
865 …printk("\nerrs: %04x %04x stat: %04x\n",(int)p->scb->rsc_errs,(int)p->scb->ovrn_errs,(int)p->scb->… in sun3_82586_rcv_int()
866 …errs: %04x %04x rus: %02x, cus: %02x\n",(int)p->scb->rsc_errs,(int)p->scb->ovrn_errs,(int)p->scb->… in sun3_82586_rcv_int()
881 struct priv *p = netdev_priv(dev); in sun3_82586_rnr_int() local
886 p->scb->cmd_ruc = RUC_ABORT; /* usually the RU is in the 'no resource'-state .. abort it now. */ in sun3_82586_rnr_int()
890 alloc_rfa(dev,(char *)p->rfd_first); in sun3_82586_rnr_int()
894 printk("%s: Receive-Unit restarted. Status: %04x\n",dev->name,p->scb->rus); in sun3_82586_rnr_int()
905 struct priv *p = netdev_priv(dev); in sun3_82586_xmt_int() local
910 status = swab16(p->xmit_cmds[p->xmit_last]->cmd_status); in sun3_82586_xmt_int()
943 if( (++p->xmit_last) == NUM_XMIT_BUFFS) in sun3_82586_xmt_int()
944 p->xmit_last = 0; in sun3_82586_xmt_int()
955 struct priv *p = netdev_priv(dev); in startrecv586() local
959 p->scb->rfa_offset = make16(p->rfd_first); in startrecv586()
960 p->scb->cmd_ruc = RUC_START; in startrecv586()
967 struct priv *p = netdev_priv(dev); in sun3_82586_timeout() local
969 if(p->scb->cus & CU_ACTIVE) /* COMMAND-UNIT active? */ in sun3_82586_timeout()
974 …->name,(int)swab16(p->xmit_cmds[0]->cmd_status),(int)swab16(p->nop_cmds[0]->cmd_status),(int)swab1… in sun3_82586_timeout()
976 p->scb->cmd_cuc = CUC_ABORT; in sun3_82586_timeout()
979 p->scb->cbl_offset = make16(p->nop_cmds[p->nop_point]); in sun3_82586_timeout()
980 p->scb->cmd_cuc = CUC_START; in sun3_82586_timeout()
989 printk("%s: xmitter timed out, try to restart! stat: %02x\n",dev->name,p->scb->cus); in sun3_82586_timeout()
990 printk("%s: command-stats: %04x\n", dev->name, swab16(p->xmit_cmds[0]->cmd_status)); in sun3_82586_timeout()
1010 struct priv *p = netdev_priv(dev); in sun3_82586_send_packet() local
1022 if(test_and_set_bit(0,(void *) &p->lock)) { in sun3_82586_send_packet()
1031 memset((void *)p->xmit_cbuffs[p->xmit_count], 0, in sun3_82586_send_packet()
1035 skb_copy_from_linear_data(skb, (void *)p->xmit_cbuffs[p->xmit_count], skb->len); in sun3_82586_send_packet()
1041 if(p->scb->cus & CU_ACTIVE) in sun3_82586_send_packet()
1044 printk("%s: stat: %04x %04x\n",dev->name,p->scb->cus,swab16(p->xmit_cmds[0]->cmd_status)); in sun3_82586_send_packet()
1048 p->xmit_buffs[0]->size = swab16(TBD_LAST | len); in sun3_82586_send_packet()
1051 p->xmit_cmds[0]->cmd_status = 0; in sun3_82586_send_packet()
1053 if( (p->scb->cus & CU_STATUS) == CU_SUSPEND) in sun3_82586_send_packet()
1054 p->scb->cmd_cuc = CUC_RESUME; in sun3_82586_send_packet()
1057 p->scb->cbl_offset = make16(p->xmit_cmds[0]); in sun3_82586_send_packet()
1058 p->scb->cmd_cuc = CUC_START; in sun3_82586_send_packet()
1065 if( (p->scb->cus & CU_ACTIVE)) /* test it, because CU sometimes doesn't start immediately */ in sun3_82586_send_packet()
1067 if(p->xmit_cmds[0]->cmd_status) in sun3_82586_send_packet()
1073 next_nop = (p->nop_point + 1) & 0x1; in sun3_82586_send_packet()
1074 p->xmit_buffs[0]->size = swab16(TBD_LAST | len); in sun3_82586_send_packet()
1076 p->xmit_cmds[0]->cmd_link = p->nop_cmds[next_nop]->cmd_link in sun3_82586_send_packet()
1077 = make16((p->nop_cmds[next_nop])); in sun3_82586_send_packet()
1078 p->xmit_cmds[0]->cmd_status = p->nop_cmds[next_nop]->cmd_status = 0; in sun3_82586_send_packet()
1080 p->nop_cmds[p->nop_point]->cmd_link = make16((p->xmit_cmds[0])); in sun3_82586_send_packet()
1081 p->nop_point = next_nop; in sun3_82586_send_packet()
1085 p->xmit_buffs[p->xmit_count]->size = swab16(TBD_LAST | len); in sun3_82586_send_packet()
1086 if( (next_nop = p->xmit_count + 1) == NUM_XMIT_BUFFS ) in sun3_82586_send_packet()
1089 p->xmit_cmds[p->xmit_count]->cmd_status = 0; in sun3_82586_send_packet()
1091 p->nop_cmds[next_nop]->cmd_link = make16((p->nop_cmds[next_nop])); in sun3_82586_send_packet()
1092 p->nop_cmds[next_nop]->cmd_status = 0; in sun3_82586_send_packet()
1094 p->nop_cmds[p->xmit_count]->cmd_link = make16((p->xmit_cmds[p->xmit_count])); in sun3_82586_send_packet()
1095 p->xmit_count = next_nop; in sun3_82586_send_packet()
1100 if(p->xmit_count != p->xmit_last) in sun3_82586_send_packet()
1102 p->lock = 0; in sun3_82586_send_packet()
1117 struct priv *p = netdev_priv(dev); in sun3_82586_get_stats() local
1120 crc = swab16(p->scb->crc_errs); /* get error-statistic from the ni82586 */ in sun3_82586_get_stats()
1121 p->scb->crc_errs = 0; in sun3_82586_get_stats()
1122 aln = swab16(p->scb->aln_errs); in sun3_82586_get_stats()
1123 p->scb->aln_errs = 0; in sun3_82586_get_stats()
1124 rsc = swab16(p->scb->rsc_errs); in sun3_82586_get_stats()
1125 p->scb->rsc_errs = 0; in sun3_82586_get_stats()
1126 ovrn = swab16(p->scb->ovrn_errs); in sun3_82586_get_stats()
1127 p->scb->ovrn_errs = 0; in sun3_82586_get_stats()
1158 struct priv *p = netdev_priv(dev);
1162 p->scb->cmd_cuc = CUC_ABORT;
1172 p->scb->cbl_offset = make16(dump_cmd);
1173 p->scb->cmd_cuc = CUC_START;