Lines Matching refs:p

64 #define make32(ptr16) (p->memtop + (swab16((unsigned short) (ptr16))) )
65 #define make24(ptr32) (char *)swab32(( ((unsigned long) (ptr32)) - p->base))
66 #define make16(ptr32) (swab16((unsigned short) ((unsigned long)(ptr32) - (unsigned long) p->memtop …
101 if(!p->scb->cmd_cuc) break; \
104 …printk("%s: scb_cmd timed out: %04x,%04x .. disabling i82586!!\n",dev->name,p->scb->cmd_cuc,p->scb…
105 if(!p->reseted) { p->reseted = 1; sun3_reset586(); } } } }
109 if(!p->scb->cmd_ruc) break; \
112 …b_cmd (ruc) timed out: %04x,%04x .. disabling i82586!!\n",dev->name,p->scb->cmd_ruc,p->scb->rus); \
113 if(!p->reseted) { p->reseted = 1; sun3_reset586(); } } } }
209 struct priv *p = &pb; in check586() local
213 p->base = (unsigned long) dvma_btov(0); in check586()
214 p->memtop = (char *)dvma_btov((unsigned long)where); in check586()
215 p->scp = (struct scp_struct *)(p->base + SCP_DEFAULT_ADDRESS); in check586()
216 memset((char *)p->scp,0, sizeof(struct scp_struct)); in check586()
218 if(((char *)p->scp)[i]) in check586()
220 p->scp->sysbus = SYSBUSVAL; /* 1 = 8Bit-Bus, 0 = 16 Bit */ in check586()
221 if(p->scp->sysbus != SYSBUSVAL) in check586()
226 p->iscp = (struct iscp_struct *) iscp_addr; in check586()
227 memset((char *)p->iscp,0, sizeof(struct iscp_struct)); in check586()
229 p->scp->iscp = make24(p->iscp); in check586()
230 p->iscp->busy = 1; in check586()
236 if(p->iscp->busy) /* i82586 clears 'busy' after successful init */ in check586()
247 struct priv *p = netdev_priv(dev); in alloc586() local
252 p->scp = (struct scp_struct *) (p->base + SCP_DEFAULT_ADDRESS); in alloc586()
253 p->iscp = (struct iscp_struct *) dvma_btov(dev->mem_start); in alloc586()
254 p->scb = (struct scb_struct *) ((char *)p->iscp + sizeof(struct iscp_struct)); in alloc586()
256 memset((char *) p->iscp,0,sizeof(struct iscp_struct)); in alloc586()
257 memset((char *) p->scp ,0,sizeof(struct scp_struct)); in alloc586()
259 p->scp->iscp = make24(p->iscp); in alloc586()
260 p->scp->sysbus = SYSBUSVAL; in alloc586()
261 p->iscp->scb_offset = make16(p->scb); in alloc586()
262 p->iscp->scb_base = make24(dvma_btov(dev->mem_start)); in alloc586()
264 p->iscp->busy = 1; in alloc586()
270 if(p->iscp->busy) in alloc586()
273 p->reseted = 0; in alloc586()
275 memset((char *)p->scb,0,sizeof(struct scb_struct)); in alloc586()
408 struct priv *p = netdev_priv(dev); in init586() local
416 ptr = (void *) ((char *)p->scb + sizeof(struct scb_struct)); in init586()
433 int len = ((char *) p->iscp - (char *) ptr - 8) / 6; in init586()
443 p->scb->cbl_offset = make16(cfg_cmd); in init586()
444 p->scb->cmd_ruc = 0; in init586()
446 p->scb->cmd_cuc = CUC_START; /* cmd.-unit start */ in init586()
469 p->scb->cbl_offset = make16(ias_cmd); in init586()
471 p->scb->cmd_cuc = CUC_START; /* cmd.-unit start */ in init586()
492 p->scb->cbl_offset = make16(tdr_cmd); in init586()
493 p->scb->cmd_cuc = CUC_START; /* cmd.-unit start */ in init586()
507 p->scb->cmd_cuc = p->scb->cus & STAT_MASK; in init586()
541 p->scb->cbl_offset = make16(mc_cmd); in init586()
542 p->scb->cmd_cuc = CUC_START; in init586()
557 p->nop_cmds[i] = (struct nop_cmd_struct *)ptr; in init586()
558 p->nop_cmds[i]->cmd_cmd = swab16(CMD_NOP); in init586()
559 p->nop_cmds[i]->cmd_status = 0; in init586()
560 p->nop_cmds[i]->cmd_link = make16((p->nop_cmds[i])); in init586()
566 p->nop_cmds[i] = (struct nop_cmd_struct *)ptr; in init586()
567 p->nop_cmds[i]->cmd_cmd = swab16(CMD_NOP); in init586()
568 p->nop_cmds[i]->cmd_status = 0; in init586()
569 p->nop_cmds[i]->cmd_link = make16((p->nop_cmds[i])); in init586()
581 p->xmit_cmds[i] = (struct transmit_cmd_struct *)ptr; /*transmit cmd/buff 0*/ in init586()
583 p->xmit_cbuffs[i] = (char *)ptr; /* char-buffs */ in init586()
585 p->xmit_buffs[i] = (struct tbd_struct *)ptr; /* TBD */ in init586()
592 memset((char *)(p->xmit_cmds[i]) ,0, sizeof(struct transmit_cmd_struct)); in init586()
593 memset((char *)(p->xmit_buffs[i]),0, sizeof(struct tbd_struct)); in init586()
594 p->xmit_cmds[i]->cmd_link = make16(p->nop_cmds[(i+1)%NUM_XMIT_BUFFS]); in init586()
595 p->xmit_cmds[i]->cmd_status = swab16(STAT_COMPL); in init586()
596 p->xmit_cmds[i]->cmd_cmd = swab16(CMD_XMIT | CMD_INT); in init586()
597 p->xmit_cmds[i]->tbd_offset = make16((p->xmit_buffs[i])); in init586()
598 p->xmit_buffs[i]->next = 0xffff; in init586()
599 p->xmit_buffs[i]->buffer = make24((p->xmit_cbuffs[i])); in init586()
602 p->xmit_count = 0; in init586()
603 p->xmit_last = 0; in init586()
605 p->nop_point = 0; in init586()
612 p->scb->cbl_offset = make16(p->nop_cmds[0]); in init586()
613 p->scb->cmd_cuc = CUC_START; in init586()
617 p->xmit_cmds[0]->cmd_link = make16(p->xmit_cmds[0]); in init586()
618 p->xmit_cmds[0]->cmd_cmd = swab16(CMD_XMIT | CMD_SUSPEND | CMD_INT); in init586()
624 p->scb->cmd_cuc = p->scb->cus & STAT_MASK; in init586()
644 struct priv *p = netdev_priv(dev); in alloc_rfa() local
646 memset((char *) rfd,0,sizeof(struct rfd_struct)*(p->num_recv_buffs+rfdadd)); in alloc_rfa()
647 p->rfd_first = rfd; in alloc_rfa()
649 for(i = 0; i < (p->num_recv_buffs+rfdadd); i++) { in alloc_rfa()
650 rfd[i].next = make16(rfd + (i+1) % (p->num_recv_buffs+rfdadd) ); in alloc_rfa()
653 rfd[p->num_recv_buffs-1+rfdadd].last = RFD_SUSP; /* RU suspend */ in alloc_rfa()
655 ptr = (void *) (rfd + (p->num_recv_buffs + rfdadd) ); in alloc_rfa()
658 ptr = (void *) (rbd + p->num_recv_buffs); in alloc_rfa()
661 memset((char *) rbd,0,sizeof(struct rbd_struct)*(p->num_recv_buffs)); in alloc_rfa()
663 for(i=0;i<p->num_recv_buffs;i++) in alloc_rfa()
665 rbd[i].next = make16((rbd + (i+1) % p->num_recv_buffs)); in alloc_rfa()
671 p->rfd_top = p->rfd_first; in alloc_rfa()
672 p->rfd_last = p->rfd_first + (p->num_recv_buffs - 1 + rfdadd); in alloc_rfa()
674 p->scb->rfa_offset = make16(p->rfd_first); in alloc_rfa()
675 p->rfd_first->rbd_offset = make16(rbd); in alloc_rfa()
690 struct priv *p; in sun3_82586_interrupt() local
696 p = netdev_priv(dev); in sun3_82586_interrupt()
703 while((stat=p->scb->cus & STAT_MASK)) in sun3_82586_interrupt()
705 p->scb->cmd_cuc = stat; in sun3_82586_interrupt()
714 if(p->scb->rus & RU_SUSPEND) /* special case: RU_SUSPEND */ in sun3_82586_interrupt()
717 p->scb->cmd_ruc = RUC_RESUME; in sun3_82586_interrupt()
723 … printk("%s: Receiver-Unit went 'NOT READY': %04x/%02x.\n",dev->name,(int) stat,(int) p->scb->rus); in sun3_82586_interrupt()
735 …printk("%s: oops! CU has left active state. stat: %04x/%02x.\n",dev->name,(int) stat,(int) p->scb-… in sun3_82586_interrupt()
743 if(p->scb->cmd_cuc) /* timed out? */ in sun3_82586_interrupt()
766 struct priv *p = netdev_priv(dev); in sun3_82586_rcv_int() local
771 for(;(status = p->rfd_top->stat_high) & RFD_COMPL;) in sun3_82586_rcv_int()
773 rbd = (struct rbd_struct *) make32(p->rfd_top->rbd_offset); in sun3_82586_rcv_int()
786 skb_copy_to_linear_data(skb,(char *) p->base+swab32((unsigned long) rbd->buffer),totlen); in sun3_82586_rcv_int()
821 p->rfd_top->stat_high = 0; in sun3_82586_rcv_int()
822 p->rfd_top->last = RFD_SUSP; /* maybe exchange by RFD_LAST */ in sun3_82586_rcv_int()
823 p->rfd_top->rbd_offset = 0xffff; in sun3_82586_rcv_int()
824 p->rfd_last->last = 0; /* delete RFD_SUSP */ in sun3_82586_rcv_int()
825 p->rfd_last = p->rfd_top; in sun3_82586_rcv_int()
826 p->rfd_top = (struct rfd_struct *) make32(p->rfd_top->next); /* step to next RFD */ in sun3_82586_rcv_int()
827 p->scb->rfa_offset = make16(p->rfd_top); in sun3_82586_rcv_int()
836 p->scb->cmd_ruc = RUC_RESUME; in sun3_82586_rcv_int()
846 if(p->rfd_top->status) in sun3_82586_rcv_int()
859 volatile struct rfd_struct *rfds=p->rfd_top; in sun3_82586_rcv_int()
862 for(i=0;i< (p->num_recv_buffs+4);i++) in sun3_82586_rcv_int()
868 …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()
869 …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()
884 struct priv *p = netdev_priv(dev); in sun3_82586_rnr_int() local
889 p->scb->cmd_ruc = RUC_ABORT; /* usually the RU is in the 'no resource'-state .. abort it now. */ in sun3_82586_rnr_int()
893 alloc_rfa(dev,(char *)p->rfd_first); in sun3_82586_rnr_int()
897 printk("%s: Receive-Unit restarted. Status: %04x\n",dev->name,p->scb->rus); in sun3_82586_rnr_int()
908 struct priv *p = netdev_priv(dev); in sun3_82586_xmt_int() local
913 status = swab16(p->xmit_cmds[p->xmit_last]->cmd_status); in sun3_82586_xmt_int()
946 if( (++p->xmit_last) == NUM_XMIT_BUFFS) in sun3_82586_xmt_int()
947 p->xmit_last = 0; in sun3_82586_xmt_int()
958 struct priv *p = netdev_priv(dev); in startrecv586() local
962 p->scb->rfa_offset = make16(p->rfd_first); in startrecv586()
963 p->scb->cmd_ruc = RUC_START; in startrecv586()
970 struct priv *p = netdev_priv(dev); in sun3_82586_timeout() local
972 if(p->scb->cus & CU_ACTIVE) /* COMMAND-UNIT active? */ in sun3_82586_timeout()
977 …->name,(int)swab16(p->xmit_cmds[0]->cmd_status),(int)swab16(p->nop_cmds[0]->cmd_status),(int)swab1… in sun3_82586_timeout()
979 p->scb->cmd_cuc = CUC_ABORT; in sun3_82586_timeout()
982 p->scb->cbl_offset = make16(p->nop_cmds[p->nop_point]); in sun3_82586_timeout()
983 p->scb->cmd_cuc = CUC_START; in sun3_82586_timeout()
992 printk("%s: xmitter timed out, try to restart! stat: %02x\n",dev->name,p->scb->cus); in sun3_82586_timeout()
993 …printk("%s: command-stats: %04x %04x\n",dev->name,swab16(p->xmit_cmds[0]->cmd_status),swab16(p->xm… in sun3_82586_timeout()
1012 struct priv *p = netdev_priv(dev); in sun3_82586_send_packet() local
1023 if(test_and_set_bit(0,(void *) &p->lock)) { in sun3_82586_send_packet()
1032 memset((void *)p->xmit_cbuffs[p->xmit_count], 0, in sun3_82586_send_packet()
1036 skb_copy_from_linear_data(skb, (void *)p->xmit_cbuffs[p->xmit_count], skb->len); in sun3_82586_send_packet()
1042 if(p->scb->cus & CU_ACTIVE) in sun3_82586_send_packet()
1045 printk("%s: stat: %04x %04x\n",dev->name,p->scb->cus,swab16(p->xmit_cmds[0]->cmd_status)); in sun3_82586_send_packet()
1049 p->xmit_buffs[0]->size = swab16(TBD_LAST | len); in sun3_82586_send_packet()
1052 p->xmit_cmds[0]->cmd_status = 0; in sun3_82586_send_packet()
1054 if( (p->scb->cus & CU_STATUS) == CU_SUSPEND) in sun3_82586_send_packet()
1055 p->scb->cmd_cuc = CUC_RESUME; in sun3_82586_send_packet()
1058 p->scb->cbl_offset = make16(p->xmit_cmds[0]); in sun3_82586_send_packet()
1059 p->scb->cmd_cuc = CUC_START; in sun3_82586_send_packet()
1066 if( (p->scb->cus & CU_ACTIVE)) /* test it, because CU sometimes doesn't start immediately */ in sun3_82586_send_packet()
1068 if(p->xmit_cmds[0]->cmd_status) in sun3_82586_send_packet()
1074 next_nop = (p->nop_point + 1) & 0x1; in sun3_82586_send_packet()
1075 p->xmit_buffs[0]->size = swab16(TBD_LAST | len); in sun3_82586_send_packet()
1077 p->xmit_cmds[0]->cmd_link = p->nop_cmds[next_nop]->cmd_link in sun3_82586_send_packet()
1078 = make16((p->nop_cmds[next_nop])); in sun3_82586_send_packet()
1079 p->xmit_cmds[0]->cmd_status = p->nop_cmds[next_nop]->cmd_status = 0; in sun3_82586_send_packet()
1081 p->nop_cmds[p->nop_point]->cmd_link = make16((p->xmit_cmds[0])); in sun3_82586_send_packet()
1082 p->nop_point = next_nop; in sun3_82586_send_packet()
1086 p->xmit_buffs[p->xmit_count]->size = swab16(TBD_LAST | len); in sun3_82586_send_packet()
1087 if( (next_nop = p->xmit_count + 1) == NUM_XMIT_BUFFS ) in sun3_82586_send_packet()
1090 p->xmit_cmds[p->xmit_count]->cmd_status = 0; in sun3_82586_send_packet()
1092 p->nop_cmds[next_nop]->cmd_link = make16((p->nop_cmds[next_nop])); in sun3_82586_send_packet()
1093 p->nop_cmds[next_nop]->cmd_status = 0; in sun3_82586_send_packet()
1095 p->nop_cmds[p->xmit_count]->cmd_link = make16((p->xmit_cmds[p->xmit_count])); in sun3_82586_send_packet()
1096 p->xmit_count = next_nop; in sun3_82586_send_packet()
1101 if(p->xmit_count != p->xmit_last) in sun3_82586_send_packet()
1103 p->lock = 0; in sun3_82586_send_packet()
1118 struct priv *p = netdev_priv(dev); in sun3_82586_get_stats() local
1121 crc = swab16(p->scb->crc_errs); /* get error-statistic from the ni82586 */ in sun3_82586_get_stats()
1122 p->scb->crc_errs = 0; in sun3_82586_get_stats()
1123 aln = swab16(p->scb->aln_errs); in sun3_82586_get_stats()
1124 p->scb->aln_errs = 0; in sun3_82586_get_stats()
1125 rsc = swab16(p->scb->rsc_errs); in sun3_82586_get_stats()
1126 p->scb->rsc_errs = 0; in sun3_82586_get_stats()
1127 ovrn = swab16(p->scb->ovrn_errs); in sun3_82586_get_stats()
1128 p->scb->ovrn_errs = 0; in sun3_82586_get_stats()
1159 struct priv *p = netdev_priv(dev);
1163 p->scb->cmd_cuc = CUC_ABORT;
1173 p->scb->cbl_offset = make16(dump_cmd);
1174 p->scb->cmd_cuc = CUC_START;