• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /netgear-WNDR4500v2-V1.0.0.60_1.0.38/src/linux/linux-2.6/drivers/char/ip2/

Lines Matching defs:pB

78 	i2eBordStrPtr pB = (i2eBordStrPtr)data;
80 iiSendPendingMail(pB);
84 // Function: iiSendPendingMail(pB)
93 iiSendPendingMail(i2eBordStrPtr pB)
95 if (pB->i2eOutMailWaiting && (!pB->i2eWaitingForEmptyFifo) )
97 if (iiTrySendMail(pB, pB->i2eOutMailWaiting))
104 pB->i2eWaitingForEmptyFifo |=
105 (pB->i2eOutMailWaiting & MB_OUT_STUFFED);
106 pB->i2eOutMailWaiting = 0;
107 pB->SendPendingRetry = 0;
116 if( ++pB->SendPendingRetry < 16 ) {
117 setup_timer(&pB->SendPendingTimer,
118 iiSendPendingMail_t, (unsigned long)pB);
119 mod_timer(&pB->SendPendingTimer, jiffies + 1);
128 // Function: i2InitChannels(pB, nChannels, pCh)
147 i2InitChannels ( i2eBordStrPtr pB, int nChannels, i2ChanStrPtr pCh)
152 if (pB->i2eValid != I2E_MAGIC) {
153 COMPLETE(pB, I2EE_BADMAGIC);
155 if (pB->i2eState != II_STATE_STDLOADED) {
156 COMPLETE(pB, I2EE_BADSTATE);
159 LOCK_INIT(&pB->read_fifo_spinlock);
160 LOCK_INIT(&pB->write_fifo_spinlock);
161 LOCK_INIT(&pB->Dbuf_spinlock);
162 LOCK_INIT(&pB->Bbuf_spinlock);
163 LOCK_INIT(&pB->Fbuf_spinlock);
167 pB->i2eChannelPtr = pCh;
168 pB->i2eChannelCnt = nChannels;
170 pB->i2Fbuf_strip = pB->i2Fbuf_stuff = 0;
171 pB->i2Dbuf_strip = pB->i2Dbuf_stuff = 0;
172 pB->i2Bbuf_strip = pB->i2Bbuf_stuff = 0;
174 pB->SendPendingRetry = 0;
178 for (index = stuffIndex = 0, ppCh = (i2ChanStrPtr *)(pB->i2Fbuf);
182 if ( !(pB->i2eChannelMap[index >> 4] & (1 << (index & 0xf)) ) ) {
191 if (pB->i2eGoodMap[index >> 4] & (1 << (index & 0xf)) ) {
196 pCh->pMyBord = pB; /* Back-pointer */
272 pB->i2Fbuf_stuff = stuffIndex;
273 COMPLETE(pB, I2EE_GOOD);
278 // Function: i2DeQueueNeeds(pB, type)
289 i2DeQueueNeeds(i2eBordStrPtr pB, int type)
300 WRITE_LOCK_IRQSAVE(&pB->Dbuf_spinlock,flags);
301 if ( pB->i2Dbuf_stuff != pB->i2Dbuf_strip)
303 queueIndex = pB->i2Dbuf_strip;
304 pCh = pB->i2Dbuf[queueIndex];
309 pB->i2Dbuf_strip = queueIndex;
312 WRITE_UNLOCK_IRQRESTORE(&pB->Dbuf_spinlock,flags);
317 WRITE_LOCK_IRQSAVE(&pB->Bbuf_spinlock,flags);
318 if (pB->i2Bbuf_stuff != pB->i2Bbuf_strip)
320 queueIndex = pB->i2Bbuf_strip;
321 pCh = pB->i2Bbuf[queueIndex];
326 pB->i2Bbuf_strip = queueIndex;
329 WRITE_UNLOCK_IRQRESTORE(&pB->Bbuf_spinlock,flags);
334 WRITE_LOCK_IRQSAVE(&pB->Fbuf_spinlock,flags);
335 if (pB->i2Fbuf_stuff != pB->i2Fbuf_strip)
337 queueIndex = pB->i2Fbuf_strip;
338 pCh = pB->i2Fbuf[queueIndex];
343 pB->i2Fbuf_strip = queueIndex;
346 WRITE_UNLOCK_IRQRESTORE(&pB->Fbuf_spinlock,flags);
356 // Function: i2QueueNeeds(pB, pCh, type)
367 i2QueueNeeds(i2eBordStrPtr pB, i2ChanStrPtr pCh, int type)
379 WRITE_LOCK_IRQSAVE(&pB->Dbuf_spinlock,flags);
383 queueIndex = pB->i2Dbuf_stuff;
384 pB->i2Dbuf[queueIndex++] = pCh;
387 pB->i2Dbuf_stuff = queueIndex;
389 WRITE_UNLOCK_IRQRESTORE(&pB->Dbuf_spinlock,flags);
394 WRITE_LOCK_IRQSAVE(&pB->Bbuf_spinlock,flags);
398 queueIndex = pB->i2Bbuf_stuff;
399 pB->i2Bbuf[queueIndex++] = pCh;
402 pB->i2Bbuf_stuff = queueIndex;
404 WRITE_UNLOCK_IRQRESTORE(&pB->Bbuf_spinlock,flags);
409 WRITE_LOCK_IRQSAVE(&pB->Fbuf_spinlock,flags);
413 queueIndex = pB->i2Fbuf_stuff;
414 pB->i2Fbuf[queueIndex++] = pCh;
417 pB->i2Fbuf_stuff = queueIndex;
419 WRITE_UNLOCK_IRQRESTORE(&pB->Fbuf_spinlock,flags);
464 i2eBordStrPtr pB;
485 pB = pCh->pMyBord;
488 if (pB->i2eValid != I2E_MAGIC || pB->i2eUsingIrq == IRQ_UNDEFINED) {
493 if (pB->i2eFatal) {
494 if ( pB->i2eFatalTrap ) {
495 (*(pB)->i2eFatalTrap)(pB);
576 serviceOutgoingFifo(pB); // Dump what we got
675 pB->debugInlineQueued++;
678 i2QueueNeeds(pB, pCh, NEED_INLINE);
685 pB->debugBypassQueued++;
688 i2QueueNeeds(pB, pCh, NEED_BYPASS);
714 i2eBordStrPtr pB;
722 pB = pCh->pMyBord;
915 i2eBordStrPtr pB;
932 pB = pCh->pMyBord;
937 if (pB->i2eFatal) {
938 if (pB->i2eFatalTrap) {
939 (*(pB)->i2eFatalTrap)(pB);
1015 amountToMove, pB->i2eFifoRemains,
1016 pB->i2eWaitingForEmptyFifo );
1020 i2QueueNeeds(pB, pCh, NEED_INLINE);
1022 if ( pB->i2eWaitingForEmptyFifo ) {
1047 else if ( pB->i2eFifoRemains < 32 && !pB->i2eTxMailEmpty ( pB ) )
1050 pB->i2eFifoRemains,
1051 pB->i2eTxMailEmpty );
1066 serviceOutgoingFifo(pB);
1070 pB->i2eFifoRemains,
1071 pB->i2eOutMailWaiting,
1072 pB->i2eWaitingForEmptyFifo );
1079 i2QueueNeeds(pB, pCh, NEED_INLINE);
1087 serviceOutgoingFifo( pB );
1185 i2eBordStrPtr pB;
1189 pB = pCh->pMyBord;
1192 if (pB->i2eFatal) {
1193 if (pB->i2eFatalTrap) {
1194 (*(pB)->i2eFatalTrap)(pB);
1214 serviceOutgoingFifo( pB );
1283 set_baud_params(i2eBordStrPtr pB)
1288 pCh = (i2ChanStrPtr *) pB->i2eChannelPtr;
1291 if (pB->channelBtypes.bid_value[i]) {
1292 if (BID_HAS_654(pB->channelBtypes.bid_value[i])) {
1312 // Function: i2StripFifo(pB)
1352 i2StripFifo(i2eBordStrPtr pB)
1366 while (HAS_INPUT(pB)) {
1370 WRITE_LOCK_IRQSAVE(&pB->read_fifo_spinlock,bflags);
1374 pB->i2eLeadoffWord[0] = iiReadWord(pB);
1376 switch(PTYPE_OF(pB->i2eLeadoffWord))
1379 pB->got_input = 1;
1383 channel = CHANNEL_OF(pB->i2eLeadoffWord); /* Store channel */
1384 count = iiReadWord(pB); /* Count is in the next word */
1391 pB->i2eFatal = 2;
1392 WRITE_UNLOCK_IRQRESTORE(&pB->read_fifo_spinlock,bflags);
1396 if ((channel >= pB->i2eChannelCnt) ||
1397 (NULL==(pCh = ((i2ChanStrPtr*)pB->i2eChannelPtr)[channel])))
1399 iiReadBuf(pB, junkBuffer, count);
1400 WRITE_UNLOCK_IRQRESTORE(&pB->read_fifo_spinlock,bflags);
1411 if(ID_OF(pB->i2eLeadoffWord) == ID_HOT_KEY)
1413 pCh->hotKeyIn = iiReadWord(pB) & 0xff;
1414 WRITE_UNLOCK_IRQRESTORE(&pB->read_fifo_spinlock,bflags);
1432 iiReadBuf(pB, &(pCh->Ibuf[stuffIndex]), amountToRead);
1457 iiReadBuf(pB, &(pCh->Ibuf[stuffIndex]), amountToRead);
1465 WRITE_UNLOCK_IRQRESTORE(&pB->read_fifo_spinlock,bflags);
1483 count = CMD_COUNT_OF(pB->i2eLeadoffWord);
1485 iiReadBuf(pB, cmdBuffer, count);
1487 WRITE_UNLOCK_IRQRESTORE(&pB->read_fifo_spinlock,bflags);
1498 if (channel < pB->i2eChannelCnt
1500 (pCh = (((i2ChanStrPtr*)pB->i2eChannelPtr)[channel])) != NULL
1629 i2QueueNeeds(pB, pCh, NEED_INLINE);
1661 pB->channelBtypes = *((bidStatPtr)pc);
1663 set_baud_params(pB);
1731 PTYPE_OF(pB->i2eLeadoffWord) );
1740 pB->i2eOutMailWaiting |= MB_IN_STRIPPED;
1745 // Function: i2Write2Fifo(pB,address,count)
1754 i2Write2Fifo(i2eBordStrPtr pB, unsigned char *source, int count,int reserve)
1758 WRITE_LOCK_IRQSAVE(&pB->write_fifo_spinlock,flags);
1759 if (!pB->i2eWaitingForEmptyFifo) {
1760 if (pB->i2eFifoRemains > (count+reserve)) {
1761 pB->i2eFifoRemains -= count;
1762 iiWriteBuf(pB, source, count);
1763 pB->i2eOutMailWaiting |= MB_OUT_STUFFED;
1767 WRITE_UNLOCK_IRQRESTORE(&pB->write_fifo_spinlock,flags);
1771 // Function: i2StuffFifoBypass(pB)
1781 i2StuffFifoBypass(i2eBordStrPtr pB)
1796 (NULL != (pCh = i2DeQueueNeeds(pB,NEED_BYPASS))))
1809 if ( 0 == i2Write2Fifo(pB, pRemove, paddedSize,0)) {
1811 i2QueueNeeds(pB, pCh, NEED_BYPASS); // Put back on queue
1818 pB->debugBypassCount++;
1841 // Function: i2StuffFifoFlow(pB)
1851 i2StuffFifoFlow(i2eBordStrPtr pB)
1857 pB->i2eFifoRemains, paddedSize );
1861 while ( (NULL != (pCh = i2DeQueueNeeds(pB,NEED_FLOW)))) {
1862 pB->debugFlowCount++;
1865 if ( 0 == i2Write2Fifo(pB,(unsigned char *)&(pCh->infl),paddedSize,0)) {
1878 // Function: i2StuffFifoInline(pB)
1888 i2StuffFifoInline(i2eBordStrPtr pB)
1902 ip2trace (ITRC_NO_PORT, ITRC_SICMD, ITRC_ENTER, 3, pB->i2eFifoRemains,
1903 pB->i2Dbuf_strip, pB->i2Dbuf_stuff );
1908 (NULL != (pCh = i2DeQueueNeeds(pB,NEED_INLINE))) )
1933 ip2trace (CHANN, ITRC_SICMD, 4, 2, pB->i2eFifoRemains, paddedSize );
1944 i2QueueNeeds(pB, pCh, NEED_CREDIT);
1949 && ( 0 == i2Write2Fifo(pB, pRemove, paddedSize, 128))) {
1952 i2QueueNeeds(pB, pCh, NEED_INLINE);
1958 pB->debugInlineCount++;
2002 ip2trace (ITRC_NO_PORT, ITRC_SICMD, ITRC_RETURN, 1,pB->i2Dbuf_strip);
2006 // Function: serviceOutgoingFifo(pB)
2019 serviceOutgoingFifo(i2eBordStrPtr pB)
2024 if ( ! pB->i2eWaitingForEmptyFifo )
2026 i2StuffFifoFlow(pB);
2027 i2StuffFifoBypass(pB);
2028 i2StuffFifoInline(pB);
2030 iiSendPendingMail(pB);
2035 // Function: i2ServiceBoard(pB)
2056 // No checking here of pB validity: after all, it shouldn't have been called by
2057 // the handler unless pB were on the list.
2060 i2ServiceBoard ( i2eBordStrPtr pB )
2067 if (NO_MAIL_HERE == ( inmail = pB->i2eStartMail ) ) {
2068 inmail = iiGetMail(pB);
2070 pB->i2eStartMail = NO_MAIL_HERE;
2078 pB->i2eFatal = 1;
2084 pB->i2eFifoInInts++;
2085 i2StripFifo(pB); /* There might be incoming packets */
2089 pB->i2eFifoOutInts++;
2090 WRITE_LOCK_IRQSAVE(&pB->write_fifo_spinlock,flags);
2091 pB->i2eFifoRemains = pB->i2eFifoSize;
2092 pB->i2eWaitingForEmptyFifo = 0;
2093 WRITE_UNLOCK_IRQRESTORE(&pB->write_fifo_spinlock,flags);
2095 ip2trace (ITRC_NO_PORT, ITRC_INTR, 30, 1, pB->i2eFifoRemains );
2098 serviceOutgoingFifo(pB);