
8139too_ap.o:     file format elf32-tradbigmips

Disassembly of section .text:

00000000 <rtl8139_quick_reset>:
       0:	27bdffe0 	addiu	sp,sp,-32
       4:	afb20018 	sw	s2,24(sp)
       8:	afb10014 	sw	s1,20(sp)
       c:	afbf001c 	sw	ra,28(sp)
      10:	afb00010 	sw	s0,16(sp)
      14:	00809021 	move	s2,a0
      18:	00a08821 	move	s1,a1
	__bi_flags;

	a += nr >> 5;
	mask = 1 << (nr & 0x1f);
	__bi_save_and_cli(flags);
      1c:	40036000 	mfc0	v1,$12
      20:	00000000 	nop
      24:	34610001 	ori	at,v1,0x1
      28:	38210001 	xori	at,at,0x1
      2c:	40816000 	mtc0	at,$12
      30:	00000040 	sll	zero,zero,0x1
      34:	00000040 	sll	zero,zero,0x1
      38:	00000040 	sll	zero,zero,0x1
	*a |= mask;
      3c:	8e42002c 	lw	v0,44(s2)
      40:	00000000 	nop
      44:	34420001 	ori	v0,v0,0x1
      48:	ae42002c 	sw	v0,44(s2)
	__bi_restore_flags(flags);
      4c:	40016000 	mfc0	at,$12
      50:	30630001 	andi	v1,v1,0x1
      54:	34210001 	ori	at,at,0x1
      58:	38210001 	xori	at,at,0x1
      5c:	00611825 	or	v1,v1,at
      60:	40836000 	mtc0	v1,$12
	...
static void rtl8139_quick_reset(struct net_device *dev,struct rtl8139_private *tp, void *ioaddr)
{
	unsigned long flags;
	netif_stop_queue (dev);
	save_flags(flags);cli();
      70:	40106000 	mfc0	s0,$12
      74:	00000000 	nop

extern __inline__ void
__cli(void)
{
	__asm__ __volatile__(
      78:	40016000 	mfc0	at,$12
      7c:	00000000 	nop
      80:	34210001 	ori	at,at,0x1
      84:	38210001 	xori	at,at,0x1
      88:	40816000 	mtc0	at,$12
      8c:	00000040 	sll	zero,zero,0x1
      90:	00000040 	sll	zero,zero,0x1
      94:	00000040 	sll	zero,zero,0x1
	rtl8139_txrx_stop (tp);
      98:	0c000171 	jal	5c4 <rtl8139_txrx_stop>
      9c:	02202021 	move	a0,s1
    rtl8139_sw_free(tp);
      a0:	0c0000b3 	jal	2cc <rtl8139_sw_free>
      a4:	02202021 	move	a0,s1
    rtl8139_sw_init(tp);
      a8:	0c000049 	jal	124 <rtl8139_sw_init>
      ac:	02202021 	move	a0,s1
    rtl8139_hw_start (dev);
      b0:	0c000187 	jal	61c <rtl8139_hw_start>
      b4:	02402021 	move	a0,s2
	restore_flags(flags);
      b8:	40016000 	mfc0	at,$12
      bc:	32100001 	andi	s0,s0,0x1
      c0:	34210001 	ori	at,at,0x1
      c4:	38210001 	xori	at,at,0x1
      c8:	02018025 	or	s0,s0,at
      cc:	40906000 	mtc0	s0,$12
	...
      dc:	8fbf001c 	lw	ra,28(sp)
      e0:	8fb20018 	lw	s2,24(sp)
      e4:	8fb10014 	lw	s1,20(sp)
      e8:	8fb00010 	lw	s0,16(sp)
      ec:	03e00008 	jr	ra
      f0:	27bd0020 	addiu	sp,sp,32

000000f4 <SetOwnByNic>:
}
/* MII serial management: mostly bogus for now. */
/* Read and write the MII management registers using software-generated
   serial MDIO protocol.
   The maximum data clock rate is 2.5 Mhz.  The minimum timing is usually
   met by back-to-back PCI I/O cycles, but we insert a delay to avoid
   "overclocking" issues. */
#define MDIO_DIR		0x80
#define MDIO_DATA_OUT	0x04
#define MDIO_DATA_IN	0x02
#define MDIO_CLK		0x01
#define MDIO_WRITE0 (MDIO_DIR)
#define MDIO_WRITE1 (MDIO_DIR | MDIO_DATA_OUT)

#define mdio_delay()	readb(mdio_addr)



static void SetOwnByNic(unsigned int* header, int len, int own,int index)
{
	
	int tmp = (own | FIRSTSEG | LASTSEG | len) ;
      f4:	3c023000 	lui	v0,0x3000
      f8:	00c53025 	or	a2,a2,a1
      fc:	00c23025 	or	a2,a2,v0
	
	if ( index == NUM_DESC - 1)	
     100:	2402003f 	li	v0,63
     104:	10e20004 	beq	a3,v0,118 <SetOwnByNic+0x24>
     108:	00000000 	nop
		tmp |= ENDOFRING;
	
	*(volatile unsigned long *)header = tmp;
     10c:	ac860000 	sw	a2,0(a0)
     110:	03e00008 	jr	ra
     114:	00000000 	nop
     118:	3c024000 	lui	v0,0x4000
     11c:	08000043 	j	10c <SetOwnByNic+0x18>
     120:	00c23025 	or	a2,a2,v0

00000124 <rtl8139_sw_init>:
     124:	27bdffd8 	addiu	sp,sp,-40
     128:	afb20018 	sw	s2,24(sp)
     12c:	240501f0 	li	a1,496
     130:	00809021 	move	s2,a0
     134:	24041000 	li	a0,4096
     138:	afb40020 	sw	s4,32(sp)
     13c:	afb3001c 	sw	s3,28(sp)
     140:	afb10014 	sw	s1,20(sp)
     144:	afbf0024 	sw	ra,36(sp)
     148:	0c000000 	jal	0 <rtl8139_quick_reset>
     14c:	afb00010 	sw	s0,16(sp)
     150:	24430800 	addiu	v1,v0,2048
     154:	3c141fff 	lui	s4,0x1fff
     158:	ae4301a0 	sw	v1,416(s2)
     15c:	ae420090 	sw	v0,144(s2)
     160:	ae40008c 	sw	zero,140(s2)
     164:	00008821 	move	s1,zero
     168:	3694ffff 	ori	s4,s4,0xffff
     16c:	26530094 	addiu	s3,s2,148
     170:	8e420090 	lw	v0,144(s2)
     174:	00118100 	sll	s0,s1,0x4
     178:	02021021 	addu	v0,s0,v0
     17c:	ae600000 	sw	zero,0(s3)
     180:	24040650 	li	a0,1616
     184:	24050020 	li	a1,32
     188:	0c000000 	jal	0 <rtl8139_quick_reset>
     18c:	ac400000 	sw	zero,0(v0)
     190:	00402021 	move	a0,v0
     194:	02203821 	move	a3,s1
     198:	24050640 	li	a1,1600
     19c:	3c068000 	lui	a2,0x8000
     1a0:	10800009 	beqz	a0,1c8 <rtl8139_sw_init+0xa4>
     1a4:	26310001 	addiu	s1,s1,1
     1a8:	8c820080 	lw	v0,128(a0)
     1ac:	00000000 	nop
     1b0:	8c830084 	lw	v1,132(a0)
     1b4:	00000000 	nop
     1b8:	24420010 	addiu	v0,v0,16
     1bc:	24630010 	addiu	v1,v1,16
     1c0:	ac820080 	sw	v0,128(a0)
     1c4:	ac830084 	sw	v1,132(a0)
     1c8:	10800038 	beqz	a0,2ac <rtl8139_sw_init+0x188>
     1cc:	24020001 	li	v0,1
     1d0:	8c820080 	lw	v0,128(a0)
     1d4:	00000000 	nop
     1d8:	8c830084 	lw	v1,132(a0)
     1dc:	00000000 	nop
     1e0:	24420002 	addiu	v0,v0,2
     1e4:	24630002 	addiu	v1,v1,2
     1e8:	ac820080 	sw	v0,128(a0)
     1ec:	ac830084 	sw	v1,132(a0)
     1f0:	ae640000 	sw	a0,0(s3)
     1f4:	8c840080 	lw	a0,128(a0)
     1f8:	8e420090 	lw	v0,144(s2)
     1fc:	00942024 	and	a0,a0,s4
     200:	02021021 	addu	v0,s0,v0
     204:	ac440008 	sw	a0,8(v0)
     208:	8e430090 	lw	v1,144(s2)
     20c:	00000000 	nop
     210:	26730004 	addiu	s3,s3,4
     214:	02031821 	addu	v1,s0,v1
     218:	ac600004 	sw	zero,4(v1)
     21c:	8e420090 	lw	v0,144(s2)
     220:	00000000 	nop
     224:	02021021 	addu	v0,s0,v0
     228:	ac40000c 	sw	zero,12(v0)
     22c:	8e440090 	lw	a0,144(s2)
     230:	0c00003d 	jal	f4 <SetOwnByNic>
     234:	00902021 	addu	a0,a0,s0
     238:	2a220040 	slti	v0,s1,64
     23c:	1440ffcc 	bnez	v0,170 <rtl8139_sw_init+0x4c>
     240:	00000000 	nop
     244:	ae40019c 	sw	zero,412(s2)
     248:	00008821 	move	s1,zero
     24c:	ae400198 	sw	zero,408(s2)
     250:	8e4401a0 	lw	a0,416(s2)
     254:	00118100 	sll	s0,s1,0x4
     258:	00902021 	addu	a0,a0,s0
     25c:	02203821 	move	a3,s1
     260:	24050640 	li	a1,1600
     264:	0c00003d 	jal	f4 <SetOwnByNic>
     268:	00003021 	move	a2,zero
     26c:	8e4201a0 	lw	v0,416(s2)
     270:	00000000 	nop
     274:	26310001 	addiu	s1,s1,1
     278:	02021021 	addu	v0,s0,v0
     27c:	ac400004 	sw	zero,4(v0)
     280:	8e4301a0 	lw	v1,416(s2)
     284:	00000000 	nop
     288:	2a240040 	slti	a0,s1,64
     28c:	02031821 	addu	v1,s0,v1
     290:	ac60000c 	sw	zero,12(v1)
     294:	8e4201a0 	lw	v0,416(s2)
     298:	00000000 	nop
     29c:	02028021 	addu	s0,s0,v0
     2a0:	1480ffeb 	bnez	a0,250 <rtl8139_sw_init+0x12c>
     2a4:	ae000008 	sw	zero,8(s0)
     2a8:	00001021 	move	v0,zero
     2ac:	8fbf0024 	lw	ra,36(sp)
     2b0:	8fb40020 	lw	s4,32(sp)
     2b4:	8fb3001c 	lw	s3,28(sp)
     2b8:	8fb20018 	lw	s2,24(sp)
     2bc:	8fb10014 	lw	s1,20(sp)
     2c0:	8fb00010 	lw	s0,16(sp)
     2c4:	03e00008 	jr	ra
     2c8:	27bd0028 	addiu	sp,sp,40

000002cc <rtl8139_sw_free>:
     2cc:	27bdffd8 	addiu	sp,sp,-40
     2d0:	afb20018 	sw	s2,24(sp)
     2d4:	00809021 	move	s2,a0
     2d8:	afb40020 	sw	s4,32(sp)
     2dc:	afb3001c 	sw	s3,28(sp)
     2e0:	afb10014 	sw	s1,20(sp)
     2e4:	afb00010 	sw	s0,16(sp)
     2e8:	afbf0024 	sw	ra,36(sp)
     2ec:	00008021 	move	s0,zero
     2f0:	26530004 	addiu	s3,s2,4
     2f4:	24140001 	li	s4,1
     2f8:	26510094 	addiu	s1,s2,148
     2fc:	8e240000 	lw	a0,0(s1)
     300:	00000000 	nop
     304:	1080001e 	beqz	a0,380 <rtl8139_sw_free+0xb4>
     308:	00000000 	nop
     30c:	8c820070 	lw	v0,112(a0)
     310:	00000000 	nop
     314:	10540064 	beq	v0,s4,4a8 <rtl8139_sw_free+0x1dc>
     318:	00000000 	nop
     31c:	40036000 	mfc0	v1,$12
     320:	00000000 	nop
     324:	40016000 	mfc0	at,$12
     328:	00000000 	nop
     32c:	34210001 	ori	at,at,0x1
     330:	38210001 	xori	at,at,0x1
     334:	40816000 	mtc0	at,$12
     338:	00000040 	sll	zero,zero,0x1
     33c:	00000040 	sll	zero,zero,0x1
     340:	00000040 	sll	zero,zero,0x1
     344:	8c820070 	lw	v0,112(a0)
     348:	00000000 	nop
     34c:	2442ffff 	addiu	v0,v0,-1
     350:	ac820070 	sw	v0,112(a0)
     354:	40016000 	mfc0	at,$12
     358:	30630001 	andi	v1,v1,0x1
     35c:	34210001 	ori	at,at,0x1
     360:	38210001 	xori	at,at,0x1
     364:	00611825 	or	v1,v1,at
     368:	40836000 	mtc0	v1,$12
	...
     378:	1040004b 	beqz	v0,4a8 <rtl8139_sw_free+0x1dc>
     37c:	00000000 	nop
     380:	8e440090 	lw	a0,144(s2)
     384:	00101100 	sll	v0,s0,0x4
     388:	02003821 	move	a3,s0
     38c:	00822021 	addu	a0,a0,v0
     390:	24050640 	li	a1,1600
     394:	00003021 	move	a2,zero
     398:	0c00003d 	jal	f4 <SetOwnByNic>
     39c:	26100001 	addiu	s0,s0,1
     3a0:	2a020040 	slti	v0,s0,64
     3a4:	1440ffd5 	bnez	v0,2fc <rtl8139_sw_free+0x30>
     3a8:	26310004 	addiu	s1,s1,4
     3ac:	267101a0 	addiu	s1,s3,416
     3b0:	00008021 	move	s0,zero
     3b4:	24130001 	li	s3,1
     3b8:	8e240000 	lw	a0,0(s1)
     3bc:	00000000 	nop
     3c0:	1080001e 	beqz	a0,43c <rtl8139_sw_free+0x170>
     3c4:	00000000 	nop
     3c8:	8c820070 	lw	v0,112(a0)
     3cc:	00000000 	nop
     3d0:	10530031 	beq	v0,s3,498 <rtl8139_sw_free+0x1cc>
     3d4:	00000000 	nop
     3d8:	40036000 	mfc0	v1,$12
     3dc:	00000000 	nop
     3e0:	40016000 	mfc0	at,$12
     3e4:	00000000 	nop
     3e8:	34210001 	ori	at,at,0x1
     3ec:	38210001 	xori	at,at,0x1
     3f0:	40816000 	mtc0	at,$12
     3f4:	00000040 	sll	zero,zero,0x1
     3f8:	00000040 	sll	zero,zero,0x1
     3fc:	00000040 	sll	zero,zero,0x1
     400:	8c820070 	lw	v0,112(a0)
     404:	00000000 	nop
     408:	2442ffff 	addiu	v0,v0,-1
     40c:	ac820070 	sw	v0,112(a0)
     410:	40016000 	mfc0	at,$12
     414:	30630001 	andi	v1,v1,0x1
     418:	34210001 	ori	at,at,0x1
     41c:	38210001 	xori	at,at,0x1
     420:	00611825 	or	v1,v1,at
     424:	40836000 	mtc0	v1,$12
	...
     434:	10400018 	beqz	v0,498 <rtl8139_sw_free+0x1cc>
     438:	00000000 	nop
     43c:	8e4401a0 	lw	a0,416(s2)
     440:	00101100 	sll	v0,s0,0x4
     444:	02003821 	move	a3,s0
     448:	00822021 	addu	a0,a0,v0
     44c:	24050640 	li	a1,1600
     450:	00003021 	move	a2,zero
     454:	0c00003d 	jal	f4 <SetOwnByNic>
     458:	26100001 	addiu	s0,s0,1
     45c:	2a020040 	slti	v0,s0,64
     460:	1440ffd5 	bnez	v0,3b8 <rtl8139_sw_free+0xec>
     464:	26310004 	addiu	s1,s1,4
     468:	8e440090 	lw	a0,144(s2)
     46c:	0c000000 	jal	0 <rtl8139_quick_reset>
     470:	00000000 	nop
     474:	8fbf0024 	lw	ra,36(sp)
     478:	8fb40020 	lw	s4,32(sp)
     47c:	8fb3001c 	lw	s3,28(sp)
     480:	8fb20018 	lw	s2,24(sp)
     484:	8fb10014 	lw	s1,20(sp)
     488:	8fb00010 	lw	s0,16(sp)
     48c:	00001021 	move	v0,zero
     490:	03e00008 	jr	ra
     494:	27bd0028 	addiu	sp,sp,40
     498:	0c000000 	jal	0 <rtl8139_quick_reset>
     49c:	00000000 	nop
     4a0:	0800010f 	j	43c <rtl8139_sw_free+0x170>
     4a4:	00000000 	nop
     4a8:	0c000000 	jal	0 <rtl8139_quick_reset>
     4ac:	00000000 	nop
     4b0:	080000e0 	j	380 <rtl8139_sw_free+0xb4>
     4b4:	00000000 	nop

000004b8 <rtl8139_open>:
     4b8:	27bdffd8 	addiu	sp,sp,-40
     4bc:	afb1001c 	sw	s1,28(sp)
     4c0:	afbf0020 	sw	ra,32(sp)
     4c4:	00808821 	move	s1,a0
     4c8:	afb00018 	sw	s0,24(sp)
	

}


// The job of this sub-routine is to allocate sw buffer for all purpose
static int rtl8139_sw_init(struct rtl8139_private *tp)
{
	int i;
	unsigned char* page_ptr;
	struct sk_buff *skb_ptr;	
	
	page_ptr = kmalloc(PAGE_SIZE, GFP_KERNEL);

	// right now we have a 4096 bytes of free memory, allocate 2048 for rx/tx descriptors respectively

    //prom_printf("page_ptr=%08x\n", (unsigned int )page_ptr);	
	tp->rx_desc = (desc_t *) page_ptr;
	tp->tx_desc = (desc_t *)(page_ptr + (PAGE_SIZE >> 1));
	// initialize rx channel

	tp->cur_rx = 0;
	for (i=0; i< NUM_RX_DESC; i++)
	{
		tp->rx_desc[i].header = tp->rx_skb[i] =NULL;
		skb_ptr = dev_alloc_skb(RX_BUF_LEN);
		if (skb_ptr == NULL)
			return 1;
		skb_reserve(skb_ptr, 2);	// to make tcp/ip happy
		tp->rx_skb[i] = skb_ptr;
		tp->rx_desc[i].addr = Virtual2Physical((int)(skb_ptr->data)); 
		tp->rx_desc[i].tag = 0;
		tp->rx_desc[i].dummy = 0;
		SetOwnByNic(&(tp->rx_desc[i].header),RX_BUF_LEN ,OWNBYNIC ,i);
		//prom_printf("rx_skb[i].skb_ptr=%08x\n",(unsigned int)skb_ptr);
	}
	atomic_set (&tp->dirty_tx, 0);
	atomic_set (&tp->cur_tx, 0);
	for(i=0; i< NUM_TX_DESC; i++)
	{
		SetOwnByNic(&(tp->tx_desc[i].header),RX_BUF_LEN ,0 ,i);
		tp->tx_desc[i].tag=0;
		tp->tx_desc[i].dummy=0;
		tp->tx_desc[i].addr = 0;
	}

	return 0;
}


static int rtl8139_sw_free(struct rtl8139_private *tp)
{

	int i;
	// free rx channel
	for(i=0; i< NUM_RX_DESC; i++)
	{
		if (tp->rx_skb[i])	
			dev_kfree_skb (tp->rx_skb[i]);
		// Clear  Own By Nic
		SetOwnByNic(&(tp->rx_desc[i].header),RX_BUF_LEN ,0 ,i);
	}	
	// free tx channel
	for(i=0; i< NUM_TX_DESC; i++)
	{
#if 1	
	if (tp->tx_skb[i])
			dev_kfree_skb(tp->tx_skb[i]);
#endif
		// Clear Own By Nic
		SetOwnByNic(&(tp->tx_desc[i].header),RX_BUF_LEN ,0 ,i);
	}
	kfree(tp->rx_desc);
	return 0;
}

static int rtl8139_open (struct net_device *dev)
{
	struct rtl8139_private *tp = (struct rtl8139_private *) dev->priv;
	int retval;
	void *ioaddr = tp->mmio_addr;

	DPRINTK ("ENTER\n");

	MOD_INC_USE_COUNT;

	retval = request_irq (dev->irq, rtl8139_interrupt, SA_INTERRUPT, dev->name, dev);
     4cc:	8e240024 	lw	a0,36(s1)
     4d0:	3c050000 	lui	a1,0x0
     4d4:	24a514cc 	addiu	a1,a1,5324
     4d8:	afb10010 	sw	s1,16(sp)
     4dc:	3c062000 	lui	a2,0x2000
     4e0:	8e300064 	lw	s0,100(s1)
     4e4:	00000000 	nop
     4e8:	0c000000 	jal	0 <rtl8139_quick_reset>
     4ec:	02203821 	move	a3,s1
     4f0:	00401821 	move	v1,v0
	if (retval) {
     4f4:	10600006 	beqz	v1,510 <rtl8139_open+0x58>
     4f8:	02002021 	move	a0,s0
		DPRINTK ("EXIT, returning %d\n", retval);
		MOD_DEC_USE_COUNT;
		return retval;
	}

	//sw init
	if (rtl8139_sw_init(tp))
	{		
		printk("sw init %s error! no memory!\n",dev->name);
		return -ENOMEM;
	}
	

	tp->full_duplex = tp->duplex_lock;

	rtl8139_hw_start (dev);


	/* Set the timer to switch to check for link beat and perhaps switch
	   to an alternate media type. */
	init_timer (&tp->timer);
	tp->timer.expires = jiffies + 3;
	tp->timer.data = (unsigned long) dev;
	tp->timer.function = &rtl8139_timer;
	init_timer (&tp->rxtimer);
    tp->rxtimer.expires = jiffies + 10;
    tp->rxtimer.data = (unsigned long) dev;
    tp->rxtimer.function = &rtl8139_rxtimer;

	//add_timer (&tp->timer);

	DPRINTK ("EXIT, returning 0\n");
	return 0;
}
     4fc:	8fbf0020 	lw	ra,32(sp)
     500:	8fb1001c 	lw	s1,28(sp)
     504:	8fb00018 	lw	s0,24(sp)
     508:	03e00008 	jr	ra
     50c:	27bd0028 	addiu	sp,sp,40
     510:	0c000049 	jal	124 <rtl8139_sw_init>
     514:	00000000 	nop
     518:	3c067fff 	lui	a2,0x7fff
     51c:	34c6ffff 	ori	a2,a2,0xffff
     520:	02202821 	move	a1,s1
     524:	10400007 	beqz	v0,544 <rtl8139_open+0x8c>
     528:	02202021 	move	a0,s1
     52c:	3c040000 	lui	a0,0x0
     530:	248400ec 	addiu	a0,a0,236
     534:	0c000000 	jal	0 <rtl8139_quick_reset>
     538:	00000000 	nop
     53c:	0800013f 	j	4fc <rtl8139_open+0x44>
     540:	2402fff4 	li	v0,-12
     544:	8e0202a8 	lw	v0,680(s0)
     548:	00000000 	nop
     54c:	00021f82 	srl	v1,v0,0x1e
     550:	00031fc0 	sll	v1,v1,0x1f
     554:	00461024 	and	v0,v0,a2
     558:	00431025 	or	v0,v0,v1
     55c:	0c000187 	jal	61c <rtl8139_hw_start>
     560:	ae0202a8 	sw	v0,680(s0)
extern void it_real_fn(unsigned long);

static inline void init_timer(struct timer_list * timer)
{
	timer->list.next = timer->list.prev = NULL;
     564:	ae000064 	sw	zero,100(s0)
     568:	ae000060 	sw	zero,96(s0)
     56c:	3c020000 	lui	v0,0x0
     570:	8c420000 	lw	v0,0(v0)
     574:	00000000 	nop
     578:	3c030000 	lui	v1,0x0
     57c:	246307e8 	addiu	v1,v1,2024
     580:	24420003 	addiu	v0,v0,3
     584:	ae030070 	sw	v1,112(s0)
     588:	ae020068 	sw	v0,104(s0)
     58c:	ae11006c 	sw	s1,108(s0)
extern void it_real_fn(unsigned long);

static inline void init_timer(struct timer_list * timer)
{
	timer->list.next = timer->list.prev = NULL;
     590:	ae000078 	sw	zero,120(s0)
     594:	ae000074 	sw	zero,116(s0)
     598:	3c020000 	lui	v0,0x0
     59c:	8c420000 	lw	v0,0(v0)
     5a0:	00000000 	nop
     5a4:	3c030000 	lui	v1,0x0
     5a8:	246308c0 	addiu	v1,v1,2240
     5ac:	2442000a 	addiu	v0,v0,10
     5b0:	ae02007c 	sw	v0,124(s0)
     5b4:	ae030084 	sw	v1,132(s0)
     5b8:	ae110080 	sw	s1,128(s0)
     5bc:	0800013f 	j	4fc <rtl8139_open+0x44>
     5c0:	00001021 	move	v0,zero

000005c4 <rtl8139_txrx_stop>:

static void rtl8139_txrx_stop (struct rtl8139_private *tp)
{
	void *ioaddr = tp->mmio_addr;
     5c4:	8c820000 	lw	v0,0(a0)
     5c8:	00000000 	nop
}

static inline unsigned int inl(unsigned long port)
{
	return __ioswab32(*(volatile u32 *)(mips_io_port_base + port));
     5cc:	3c040000 	lui	a0,0x0
     5d0:	8c840000 	lw	a0,0(a0)
     5d4:	00000000 	nop
extern __inline__ void __udelay(unsigned long usecs, unsigned long lpj)
{
	unsigned long lo;

	usecs *= 0x00068db8;		/* 2**32 / (1000000 / HZ) */
     5d8:	3c03028f 	lui	v1,0x28f
}

static inline unsigned int inl(unsigned long port)
{
	return __ioswab32(*(volatile u32 *)(mips_io_port_base + port));
     5dc:	00822021 	addu	a0,a0,v0
     5e0:	8c850000 	lw	a1,0(a0)
     5e4:	00000000 	nop
extern __inline__ void __udelay(unsigned long usecs, unsigned long lpj)
{
	unsigned long lo;

	usecs *= 0x00068db8;		/* 2**32 / (1000000 / HZ) */
     5e8:	34635be0 	ori	v1,v1,0x5be0
 
	RTL_W32 (NIC_CNR1, (RTL_R32 (NIC_CNR1)) & ((~RxEnable) | (~TxEnable)) );
     5ec:	ac850000 	sw	a1,0(a0)
 * first constant multiplications gets optimized away if the delay is
 * a constant)
 */
extern __inline__ void __udelay(unsigned long usecs, unsigned long lpj)
{
     5f0:	3c020000 	lui	v0,0x0
     5f4:	8c420000 	lw	v0,0(v0)
     5f8:	00000000 	nop
	unsigned long lo;

	usecs *= 0x00068db8;		/* 2**32 / (1000000 / HZ) */
	__asm__("multu\t%2,%3"
     5fc:	00620019 	multu	v1,v0
     600:	00001810 	mfhi	v1
	...
     60c:	1460ffff 	bnez	v1,60c <rtl8139_txrx_stop+0x48>
     610:	2463ffff 	addiu	v1,v1,-1
	udelay (100);
     614:	03e00008 	jr	ra
     618:	00000000 	nop

0000061c <rtl8139_hw_start>:
     61c:	27bdffd8 	addiu	sp,sp,-40
     620:	afb3001c 	sw	s3,28(sp)
     624:	afbf0020 	sw	ra,32(sp)
     628:	afb20018 	sw	s2,24(sp)
     62c:	afb10014 	sw	s1,20(sp)
     630:	afb00010 	sw	s0,16(sp)
     634:	00809821 	move	s3,a0
} 

/* Start the hardware at open or resume. */
static void rtl8139_hw_start (struct net_device *dev)
{
	u32 i;
	struct rtl8139_private *tp = (struct rtl8139_private *) dev->priv;
     638:	8e720064 	lw	s2,100(s3)
     63c:	00000000 	nop
	void *ioaddr = tp->mmio_addr;
     640:	8e510000 	lw	s1,0(s2)
     644:	00000000 	nop

	DPRINTK ("ENTER\n");
	/* Stop txrx first */
	
	rtl8139_txrx_stop (tp);
     648:	0c000171 	jal	5c4 <rtl8139_txrx_stop>
     64c:	02402021 	move	a0,s2

	/* Soft reset the chip. */
	RTL_W32 (NIC_CNR1, (RTL_R32 (NIC_CNR1) | Reset));
     650:	3c080000 	lui	t0,0x0
     654:	8d080000 	lw	t0,0(t0)
     658:	3c050010 	lui	a1,0x10
     65c:	01112021 	addu	a0,t0,s1
}

static inline unsigned int inl(unsigned long port)
{
	return __ioswab32(*(volatile u32 *)(mips_io_port_base + port));
     660:	8c820000 	lw	v0,0(a0)
     664:	00000000 	nop

	/* Check that the chip has finished the reset. */
	for (i = 1000; i > 0; i--)
     668:	240603e8 	li	a2,1000
     66c:	00451025 	or	v0,v0,a1
     670:	ac820000 	sw	v0,0(a0)
}

static inline unsigned int inl(unsigned long port)
{
	return __ioswab32(*(volatile u32 *)(mips_io_port_base + port));
     674:	8c830000 	lw	v1,0(a0)
     678:	00000000 	nop
		if ((RTL_R32 (NIC_CNR1) & Reset) == 0)
     67c:	00651824 	and	v1,v1,a1
     680:	1060000a 	beqz	v1,6ac <rtl8139_hw_start+0x90>
     684:	01003821 	move	a3,t0
			break;
     688:	24c6ffff 	addiu	a2,a2,-1
     68c:	00f11021 	addu	v0,a3,s1
     690:	10c00006 	beqz	a2,6ac <rtl8139_hw_start+0x90>
     694:	3c030010 	lui	v1,0x10
}

static inline unsigned int inl(unsigned long port)
{
	return __ioswab32(*(volatile u32 *)(mips_io_port_base + port));
     698:	8c420000 	lw	v0,0(v0)
     69c:	00000000 	nop
     6a0:	00431024 	and	v0,v0,v1
     6a4:	1440fff9 	bnez	v0,68c <rtl8139_hw_start+0x70>
     6a8:	24c6ffff 	addiu	a2,a2,-1

	// force Reset bit to be 0
	RTL_W32 (NIC_CNR1, (RTL_R32 (NIC_CNR1)  & (~Reset)));
     6ac:	00f12821 	addu	a1,a3,s1
}

static inline unsigned int inl(unsigned long port)
{
	return __ioswab32(*(volatile u32 *)(mips_io_port_base + port));
     6b0:	8ca30000 	lw	v1,0(a1)
     6b4:	00000000 	nop
     6b8:	3c02ffef 	lui	v0,0xffef
     6bc:	3442ffff 	ori	v0,v0,0xffff
     6c0:	00621824 	and	v1,v1,v0


	// Force MII register to  reflect the current status of phy
	RTL_W32(NIC_MII, 0x210000);	
	RTL_W32(NIC_MII, 0x16000);
     6c4:	3c040001 	lui	a0,0x1
     6c8:	3c020021 	lui	v0,0x21
     6cc:	aca30000 	sw	v1,0(a1)
     6d0:	34846000 	ori	a0,a0,0x6000
     6d4:	aca20038 	sw	v0,56(a1)
	//RTL_W32(NIC_IMTR,0x12);	
	/* Restore our idea of the MAC address. */
	//RTL_W32_F (NIC_ID + 0, cpu_to_le32 (*(u32 *) (dev->dev_addr + 0)));
	//RTL_W32_F (NIC_ID + 0, (*(u32 *) (dev->dev_addr + 0)));

	if (ioaddr==0x2000)
     6d8:	24022000 	li	v0,8192
     6dc:	aca40038 	sw	a0,56(a1)
     6e0:	1222003c 	beq	s1,v0,7d4 <rtl8139_hw_start+0x1b8>
     6e4:	3c023326 	lui	v0,0x3326
	
		RTL_W32_F (NIC_ID + 0, 0x33221100);
	else
		RTL_W32_F (NIC_ID + 0, 0x33261100);
     6e8:	34421100 	ori	v0,v0,0x1100
     6ec:	aca20004 	sw	v0,4(a1)

	//RTL_W32_F (NIC_ID + 4, cpu_to_le32 (*(u32 *) (dev->dev_addr + 4)));
	//RTL_W32_F (NIC_ID + 4, (*(u32 *) (dev->dev_addr + 4)));
	RTL_W32_F (NIC_ID + 4, 0x00000044);
     6f0:	3c100000 	lui	s0,0x0
     6f4:	8e100000 	lw	s0,0(s0)
     6f8:	00000000 	nop

	
	/* Must enable Tx/Rx before setting transfer thresholds! */
	RTL_W32_F (NIC_CNR1, RxEnable | TxEnable );
     6fc:	3c03000c 	lui	v1,0xc
     700:	02118021 	addu	s0,s0,s1
     704:	24020044 	li	v0,68
     708:	ae020008 	sw	v0,8(s0)
     70c:	ae030000 	sw	v1,0(s0)
}

static inline unsigned int inl(unsigned long port)
{
	return __ioswab32(*(volatile u32 *)(mips_io_port_base + port));
     710:	8e040000 	lw	a0,0(s0)
     714:	00000000 	nop
	RTL_W32_F (NIC_CNR1, RTL_R32(NIC_CNR1) | rtl8139_trx_config); 
     718:	3c025000 	lui	v0,0x5000
     71c:	34422000 	ori	v0,v0,0x2000
     720:	00822025 	or	a0,a0,v0
     724:	ae040000 	sw	a0,0(s0)
			    

	rtl8139_set_rx_mode (dev);
     728:	0c000607 	jal	181c <rtl8139_set_rx_mode>
     72c:	02602021 	move	a0,s3

	// fill the base address of tx/rx descriptors!
	RTL_W32_F(NIC_TSAD,Virtual2Physical(tp->tx_desc));
     730:	8e4301a0 	lw	v1,416(s2)
     734:	3c041fff 	lui	a0,0x1fff
     738:	3484ffff 	ori	a0,a0,0xffff
     73c:	00641824 	and	v1,v1,a0
     740:	ae030014 	sw	v1,20(s0)
	RTL_W32_F(NIC_RSAD,Virtual2Physical(tp->rx_desc));
     744:	8e420090 	lw	v0,144(s2)
     748:	00000000 	nop

	tp->intr_mask = rtl8139_intr_mask;
     74c:	24030272 	li	v1,626
     750:	00441024 	and	v0,v0,a0
     754:	ae020018 	sw	v0,24(s0)
     758:	ae430088 	sw	v1,136(s2)
	/* Enable all known interrupts by setting the interrupt mask. */
	//RTL_W32_F (NIC_IMR, rtl8139_intr_mask);
	RTL_W32_F(NIC_IMR, tp->intr_mask);
     75c:	ae030020 	sw	v1,32(s0)
	RTL_W32(NIC_RXERR, 0x0);
     760:	ae000088 	sw	zero,136(s0)
	__bi_flags;

	a += nr >> 5;
	mask = 1 << (nr & 0x1f);
	__bi_save_and_cli(flags);
     764:	40046000 	mfc0	a0,$12
     768:	00000000 	nop
     76c:	34810001 	ori	at,a0,0x1
     770:	38210001 	xori	at,at,0x1
     774:	40816000 	mtc0	at,$12
     778:	00000040 	sll	zero,zero,0x1
     77c:	00000040 	sll	zero,zero,0x1
     780:	00000040 	sll	zero,zero,0x1
	*a &= ~mask;
     784:	8e62002c 	lw	v0,44(s3)
     788:	2403fffe 	li	v1,-2
     78c:	00431024 	and	v0,v0,v1
     790:	ae62002c 	sw	v0,44(s3)
	__bi_restore_flags(flags);
     794:	40016000 	mfc0	at,$12
     798:	30840001 	andi	a0,a0,0x1
     79c:	34210001 	ori	at,at,0x1
     7a0:	38210001 	xori	at,at,0x1
     7a4:	00812025 	or	a0,a0,at
     7a8:	40846000 	mtc0	a0,$12
	...
	netif_start_queue (dev);
     7b8:	8fbf0020 	lw	ra,32(sp)
     7bc:	8fb3001c 	lw	s3,28(sp)
     7c0:	8fb20018 	lw	s2,24(sp)
     7c4:	8fb10014 	lw	s1,20(sp)
     7c8:	8fb00010 	lw	s0,16(sp)
     7cc:	03e00008 	jr	ra
     7d0:	27bd0028 	addiu	sp,sp,40
     7d4:	3c023322 	lui	v0,0x3322
     7d8:	34421100 	ori	v0,v0,0x1100
     7dc:	ace22004 	sw	v0,8196(a3)
     7e0:	080001bc 	j	6f0 <rtl8139_hw_start+0xd4>
     7e4:	00000000 	nop

000007e8 <rtl8139_timer>:
     7e8:	27bdffe0 	addiu	sp,sp,-32
     7ec:	afb00010 	sw	s0,16(sp)
     7f0:	afbf0018 	sw	ra,24(sp)
     7f4:	00808021 	move	s0,a0
     7f8:	afb10014 	sw	s1,20(sp)

	DPRINTK ("EXIT\n");
}

static void rtl8139_timer (unsigned long data)
{
	unsigned long flags;
	struct net_device *dev = (struct net_device *)data;
	struct rtl8139_private *tp = (struct rtl8139_private *) dev->priv;
     7fc:	8e110064 	lw	s1,100(s0)
     800:	00000000 	nop
	int this_cpu = smp_processor_id();
 	// we should query to check if now the rx queue is okay for accepting
		//new skb
//	softnet_data[cpu].input_pkt_queue.qlen;
	get_sample_stats(this_cpu);
     804:	0c000000 	jal	0 <rtl8139_quick_reset>
     808:	00002021 	move	a0,zero
	if (softnet_data[this_cpu].cng_level != NET_RX_SUCCESS)
     80c:	3c020000 	lui	v0,0x0
     810:	8c420004 	lw	v0,4(v0)
     814:	00000000 	nop
     818:	3c040000 	lui	a0,0x0
     81c:	2484010c 	addiu	a0,a0,268
     820:	1040000d 	beqz	v0,858 <rtl8139_timer+0x70>
     824:	02002821 	move	a1,s0
	{
		printk("timer check shows still congested network traffic for %s\n"
     828:	0c000000 	jal	0 <rtl8139_quick_reset>
     82c:	00000000 	nop
			, dev->name);
		//add_timer(&tp->timer);
		mod_timer(&tp->timer, jiffies + 3);
     830:	3c050000 	lui	a1,0x0
     834:	8ca50000 	lw	a1,0(a1)
     838:	26240060 	addiu	a0,s1,96
     83c:	0c000000 	jal	0 <rtl8139_quick_reset>
     840:	24a50003 	addiu	a1,a1,3
     844:	8fbf0018 	lw	ra,24(sp)
     848:	8fb10014 	lw	s1,20(sp)
     84c:	8fb00010 	lw	s0,16(sp)
     850:	03e00008 	jr	ra
     854:	27bd0020 	addiu	sp,sp,32
	}else
	{
		printk("timer check success!\n");
     858:	3c040000 	lui	a0,0x0
     85c:	24840148 	addiu	a0,a0,328
     860:	0c000000 	jal	0 <rtl8139_quick_reset>
     864:	00000000 	nop
		save_flags(flags);cli();
     868:	40036000 	mfc0	v1,$12
     86c:	00000000 	nop

extern __inline__ void
__cli(void)
{
	__asm__ __volatile__(
     870:	40016000 	mfc0	at,$12
     874:	00000000 	nop
     878:	34210001 	ori	at,at,0x1
     87c:	38210001 	xori	at,at,0x1
     880:	40816000 	mtc0	at,$12
     884:	00000040 	sll	zero,zero,0x1
     888:	00000040 	sll	zero,zero,0x1
     88c:	00000040 	sll	zero,zero,0x1
		tp->netrxdrop = FALSE;
     890:	ae2002b0 	sw	zero,688(s1)
		restore_flags(flags);
     894:	40016000 	mfc0	at,$12
     898:	30630001 	andi	v1,v1,0x1
     89c:	34210001 	ori	at,at,0x1
     8a0:	38210001 	xori	at,at,0x1
     8a4:	00611825 	or	v1,v1,at
     8a8:	40836000 	mtc0	v1,$12
	...
     8b8:	08000211 	j	844 <rtl8139_timer+0x5c>
     8bc:	00000000 	nop

000008c0 <rtl8139_rxtimer>:
	}	  
}
// This is for the case where RxFFOv happens
// We have disabled RxInterrupt for a while
// Therefore, we should re-open it again 
static void rtl8139_rxtimer (unsigned long data)
{
    unsigned long flags;
    struct net_device *dev = (struct net_device *)data;
    struct rtl8139_private *tp = (struct rtl8139_private *) dev->priv;
     8c0:	8c850064 	lw	a1,100(a0)
     8c4:	00000000 	nop
	void *ioaddr = tp->mmio_addr;
     8c8:	8ca60000 	lw	a2,0(a1)
     8cc:	00000000 	nop
	save_flags(flags);cli();
     8d0:	40046000 	mfc0	a0,$12
     8d4:	00000000 	nop

extern __inline__ void
__cli(void)
{
	__asm__ __volatile__(
     8d8:	40016000 	mfc0	at,$12
     8dc:	00000000 	nop
     8e0:	34210001 	ori	at,at,0x1
     8e4:	38210001 	xori	at,at,0x1
     8e8:	40816000 	mtc0	at,$12
     8ec:	00000040 	sll	zero,zero,0x1
     8f0:	00000040 	sll	zero,zero,0x1
     8f4:	00000040 	sll	zero,zero,0x1
	tp->intr_mask |= (RxFFOvMask | RxDescUnMask);
     8f8:	8ca30088 	lw	v1,136(a1)
     8fc:	00000000 	nop
	RTL_W32_F(NIC_IMR, tp->intr_mask);
     900:	3c020000 	lui	v0,0x0
     904:	8c420000 	lw	v0,0(v0)
     908:	00000000 	nop
     90c:	34630018 	ori	v1,v1,0x18
     910:	00461021 	addu	v0,v0,a2
     914:	aca30088 	sw	v1,136(a1)
     918:	ac430020 	sw	v1,32(v0)
	restore_flags(flags);
     91c:	40016000 	mfc0	at,$12
     920:	30840001 	andi	a0,a0,0x1
     924:	34210001 	ori	at,at,0x1
     928:	38210001 	xori	at,at,0x1
     92c:	00812025 	or	a0,a0,at
     930:	40846000 	mtc0	a0,$12
	...
     940:	03e00008 	jr	ra
     944:	00000000 	nop

00000948 <rtl8139_tx_timeout>:
     948:	27bdffe8 	addiu	sp,sp,-24
     94c:	00802821 	move	a1,a0

}
static void rtl8139_tx_timeout (struct net_device *dev)
{

	printk("What ? tx_timeout ! on dev %s\n", dev->name);
     950:	3c040000 	lui	a0,0x0
     954:	24840160 	addiu	a0,a0,352
     958:	afbf0010 	sw	ra,16(sp)
     95c:	0c000000 	jal	0 <rtl8139_quick_reset>
     960:	00000000 	nop
     964:	8fbf0010 	lw	ra,16(sp)
     968:	00000000 	nop
     96c:	03e00008 	jr	ra
     970:	27bd0018 	addiu	sp,sp,24

00000974 <rtl8139_start_xmit>:
     974:	27bdffc0 	addiu	sp,sp,-64
     978:	afb60030 	sw	s6,48(sp)
     97c:	afb30024 	sw	s3,36(sp)
     980:	afbf003c 	sw	ra,60(sp)
     984:	afbe0038 	sw	s8,56(sp)
     988:	afb70034 	sw	s7,52(sp)
     98c:	afb5002c 	sw	s5,44(sp)
     990:	afb40028 	sw	s4,40(sp)
     994:	afb20020 	sw	s2,32(sp)
     998:	afb1001c 	sw	s1,28(sp)
     99c:	afb00018 	sw	s0,24(sp)
     9a0:	00a0b021 	move	s6,a1
#if 0
	struct rtl8139_private *tp = (struct rtl8139_private *) dev->priv;
	void *ioaddr = tp->mmio_addr;
	int i;
	unsigned long flags;

	DPRINTK ("%s: Transmit timeout, status %2.2x %4.4x "
		 "media %2.2x.\n", dev->name,
		 RTL_R8 (NIC_CNR1),
		 RTL_R16 (IntrStatus),
		 RTL_R8 (MediaStatus));

	/* Disable interrupts by clearing the interrupt mask. */
	RTL_W16 (NIC_IMR, 0x0000);

	/* Emit info to figure out what went wrong. */
	printk (KERN_DEBUG "%s: Tx queue start entry %d  dirty entry %d.\n",
		dev->name, atomic_read (&tp->cur_tx),
		atomic_read (&tp->dirty_tx));
	for (i = 0; i < NUM_TX_DESC; i++)
		printk (KERN_DEBUG "%s:  Tx descriptor %d is %8.8x.%s\n",
			dev->name, i, RTL_R32 (TxStatus0 + (i * 4)),
			i == atomic_read (&tp->dirty_tx) % NUM_TX_DESC ?
				" (queue head)" : "");

	spin_lock_irqsave (&tp->lock, flags);

	/* Stop a shared interrupt from scavenging while we are. */
	atomic_set (&tp->cur_tx, 0);
	atomic_set (&tp->dirty_tx, 0);

	/* Dump the unsent Tx packets. */
	for (i = 0; i < NUM_TX_DESC; i++) {
		struct ring_info *rp = &tp->tx_info[i];
		if (rp->mapping != 0) {
			pci_unmap_single (tp->pci_dev, rp->mapping,
					  rp->skb->len, PCI_DMA_TODEVICE);
			rp->mapping = 0;
		}
		if (rp->skb) {
			dev_kfree_skb (rp->skb);
			rp->skb = NULL;
			tp->stats.tx_dropped++;
		}
	}

	spin_unlock_irqrestore (&tp->lock, flags);

	/* ...and finally, reset everything */
	rtl8139_hw_start (dev);
#endif
}



static int rtl8139_start_xmit (struct sk_buff *skb, struct net_device *dev)
{
	unsigned long flags;
	int	txmit_count;
	int cur_tx, dirty_tx;
	unsigned int own;
	struct rtl8139_private *tp = (struct rtl8139_private *) dev->priv;
     9a4:	8ed10064 	lw	s1,100(s6)
     9a8:	00000000 	nop
     9ac:	00809821 	move	s3,a0
	void *ioaddr = tp->mmio_addr;
     9b0:	8e3e0000 	lw	s8,0(s1)
     9b4:	00000000 	nop

	save_flags(flags);cli();
     9b8:	40026000 	mfc0	v0,$12
     9bc:	00000000 	nop
     9c0:	afa20010 	sw	v0,16(sp)

extern __inline__ void
__cli(void)
{
	__asm__ __volatile__(
     9c4:	40016000 	mfc0	at,$12
     9c8:	00000000 	nop
     9cc:	34210001 	ori	at,at,0x1
     9d0:	38210001 	xori	at,at,0x1
     9d4:	40816000 	mtc0	at,$12
     9d8:	00000040 	sll	zero,zero,0x1
     9dc:	00000040 	sll	zero,zero,0x1
     9e0:	00000040 	sll	zero,zero,0x1
	cur_tx = atomic_read(&tp->cur_tx) & (NUM_TX_DESC - 1);
     9e4:	8e230198 	lw	v1,408(s1)
     9e8:	00000000 	nop
	dirty_tx = atomic_read(&tp->dirty_tx) & (NUM_TX_DESC - 1);
     9ec:	8e22019c 	lw	v0,412(s1)
     9f0:	00000000 	nop
     9f4:	3072003f 	andi	s2,v1,0x3f
	if (((cur_tx + 1) & (NUM_TX_DESC - 1)) == dirty_tx)
     9f8:	26570001 	addiu	s7,s2,1
     9fc:	02e21026 	xor	v0,s7,v0
     a00:	3042003f 	andi	v0,v0,0x3f
		txmit_count = 0;
	else
		txmit_count = 1;
	//if ((txmit_count=(CIRC_SPACE(cur_tx, dirty_tx, NUM_TX_DESC))))
	if (txmit_count)
     a04:	1040004d 	beqz	v0,b3c <rtl8139_start_xmit+0x1c8>
     a08:	00121080 	sll	v0,s2,0x2
	{
		// Great! we have free tx descriptors!
		own = OWNBYNIC;
		tp->tx_skb[cur_tx]=skb;
     a0c:	00511021 	addu	v0,v0,s1
     a10:	ac5301a4 	sw	s3,420(v0)
		*(volatile unsigned int *)(&(tp->tx_desc[cur_tx].addr)) = Virtual2Physical(skb->data);
     a14:	8e2401a0 	lw	a0,416(s1)
     a18:	8e630080 	lw	v1,128(s3)
     a1c:	3c021fff 	lui	v0,0x1fff
     a20:	3442ffff 	ori	v0,v0,0xffff
     a24:	0012a900 	sll	s5,s2,0x4
     a28:	00621824 	and	v1,v1,v0
     a2c:	02a42021 	addu	a0,s5,a0
     a30:	ac830008 	sw	v1,8(a0)
#if 0 
		if ((tp->tx_desc[cur_tx].header) & 0x80000000)
			printk("bug in start_xmit! cur_tx=%08x, dirty_tx=%08x\n",
			cur_tx, dirty_tx);
#endif 

#ifdef RTL8139AP_CHECKSUM_OFFLOAD
#if 1 
		if (skb->ip_summed == CHECKSUM_HW)	
     a34:	9265006b 	lbu	a1,107(s3)
     a38:	24020001 	li	v0,1
     a3c:	10a2002e 	beq	a1,v0,af8 <rtl8139_start_xmit+0x184>
     a40:	3c148000 	lui	s4,0x8000
#endif	
		{
		const struct iphdr *ip = skb->nh.iph;
				
				printk("tx offload,ip->protocol=%08x\n",ip->protocol);
				if ((ip->protocol == IPPROTO_TCP) ||
					(ip->protocol == IPPROTO_UDP)) {
				if (ip->protocol == IPPROTO_TCP)
					own |= 	(IpTxCsumEn) | (TcpTxCsumEn);
				else
					own |=  (IpTxCsumEn) | (UdpTxCsumEn);
				}				
		}
#endif
		SetOwnByNic(&(tp->tx_desc[cur_tx].header),skb->len ,own,cur_tx);
     a44:	8e2401a0 	lw	a0,416(s1)
     a48:	8e65005c 	lw	a1,92(s3)
     a4c:	00952021 	addu	a0,a0,s5
     a50:	02403821 	move	a3,s2
     a54:	0c00003d 	jal	f4 <SetOwnByNic>
     a58:	02803021 	move	a2,s4
	
		// Remember to Poll Tx Registers!!!
		RTL_W32( NIC_CNR1, RTL_R32(NIC_CNR1) |  TxDescFN); 
     a5c:	3c040000 	lui	a0,0x0
     a60:	8c840000 	lw	a0,0(a0)
     a64:	3c030100 	lui	v1,0x100
     a68:	009e2021 	addu	a0,a0,s8
}

static inline unsigned int inl(unsigned long port)
{
	return __ioswab32(*(volatile u32 *)(mips_io_port_base + port));
     a6c:	8c820000 	lw	v0,0(a0)
     a70:	00000000 	nop
		RTL_R32( NIC_CNR1); 
		dev->trans_start = jiffies;
		cur_tx++;
		cur_tx &= (NUM_TX_DESC - 1);
     a74:	32f2003f 	andi	s2,s7,0x3f
     a78:	00431025 	or	v0,v0,v1
     a7c:	ac820000 	sw	v0,0(a0)
}

static inline unsigned int inl(unsigned long port)
{
	return __ioswab32(*(volatile u32 *)(mips_io_port_base + port));
     a80:	8c830000 	lw	v1,0(a0)
     a84:	00000000 	nop
     a88:	3c020000 	lui	v0,0x0
     a8c:	8c420000 	lw	v0,0(v0)
     a90:	00000000 	nop
     a94:	aec2004c 	sw	v0,76(s6)
		atomic_set (&tp->cur_tx, cur_tx);
     a98:	ae320198 	sw	s2,408(s1)
	}
	else
	{
		// No more tx descriptors allowed!
		netif_stop_queue (dev);
		printk("stop_tx_queue!\n");
		if (skb)
			dev_kfree_skb(skb);	
		else
			printk("tx a null queue?\n");
	}
	/* Note: the chip doesn't have auto-pad! */

	restore_flags(flags);
     a9c:	8fa20010 	lw	v0,16(sp)
     aa0:	40016000 	mfc0	at,$12
     aa4:	30420001 	andi	v0,v0,0x1
     aa8:	34210001 	ori	at,at,0x1
     aac:	38210001 	xori	at,at,0x1
     ab0:	00411025 	or	v0,v0,at
     ab4:	40826000 	mtc0	v0,$12
	...
	return 0;
     ac4:	8fbf003c 	lw	ra,60(sp)
     ac8:	8fbe0038 	lw	s8,56(sp)
     acc:	8fb70034 	lw	s7,52(sp)
     ad0:	8fb60030 	lw	s6,48(sp)
     ad4:	8fb5002c 	lw	s5,44(sp)
     ad8:	8fb40028 	lw	s4,40(sp)
     adc:	8fb30024 	lw	s3,36(sp)
     ae0:	8fb20020 	lw	s2,32(sp)
     ae4:	8fb1001c 	lw	s1,28(sp)
     ae8:	8fb00018 	lw	s0,24(sp)
     aec:	00001021 	move	v0,zero
     af0:	03e00008 	jr	ra
     af4:	27bd0040 	addiu	sp,sp,64
     af8:	8e700020 	lw	s0,32(s3)
     afc:	00000000 	nop
     b00:	3c040000 	lui	a0,0x0
     b04:	24840180 	addiu	a0,a0,384
     b08:	92050009 	lbu	a1,9(s0)
     b0c:	0c000000 	jal	0 <rtl8139_quick_reset>
     b10:	00000000 	nop
     b14:	92030009 	lbu	v1,9(s0)
     b18:	24020006 	li	v0,6
     b1c:	10620005 	beq	v1,v0,b34 <rtl8139_start_xmit+0x1c0>
     b20:	24020011 	li	v0,17
     b24:	1462ffc7 	bne	v1,v0,a44 <rtl8139_start_xmit+0xd0>
     b28:	00000000 	nop
     b2c:	08000291 	j	a44 <rtl8139_start_xmit+0xd0>
     b30:	3c148006 	lui	s4,0x8006
     b34:	08000291 	j	a44 <rtl8139_start_xmit+0xd0>
     b38:	3c148005 	lui	s4,0x8005
	__bi_flags;

	a += nr >> 5;
	mask = 1 << (nr & 0x1f);
	__bi_save_and_cli(flags);
     b3c:	40036000 	mfc0	v1,$12
     b40:	00000000 	nop
     b44:	34610001 	ori	at,v1,0x1
     b48:	38210001 	xori	at,at,0x1
     b4c:	40816000 	mtc0	at,$12
     b50:	00000040 	sll	zero,zero,0x1
     b54:	00000040 	sll	zero,zero,0x1
     b58:	00000040 	sll	zero,zero,0x1
	*a |= mask;
     b5c:	8ec2002c 	lw	v0,44(s6)
     b60:	00000000 	nop
     b64:	34420001 	ori	v0,v0,0x1
     b68:	aec2002c 	sw	v0,44(s6)
	__bi_restore_flags(flags);
     b6c:	40016000 	mfc0	at,$12
     b70:	30630001 	andi	v1,v1,0x1
     b74:	34210001 	ori	at,at,0x1
     b78:	38210001 	xori	at,at,0x1
     b7c:	00611825 	or	v1,v1,at
     b80:	40836000 	mtc0	v1,$12
	...
     b90:	3c040000 	lui	a0,0x0
     b94:	248401a0 	addiu	a0,a0,416
     b98:	0c000000 	jal	0 <rtl8139_quick_reset>
     b9c:	00000000 	nop
     ba0:	12600022 	beqz	s3,c2c <rtl8139_start_xmit+0x2b8>
     ba4:	00000000 	nop
 */
 
static inline void kfree_skb(struct sk_buff *skb)
{
	if (atomic_read(&skb->users) == 1 || atomic_dec_and_test(&skb->users))
     ba8:	8e630070 	lw	v1,112(s3)
     bac:	24020001 	li	v0,1
     bb0:	1062001a 	beq	v1,v0,c1c <rtl8139_start_xmit+0x2a8>
     bb4:	00000000 	nop
extern __inline__ int atomic_sub_return(int i, atomic_t * v)
{
	int	temp, flags;

	save_flags(flags);
     bb8:	40036000 	mfc0	v1,$12
     bbc:	00000000 	nop

extern __inline__ void
__cli(void)
{
	__asm__ __volatile__(
     bc0:	40016000 	mfc0	at,$12
     bc4:	00000000 	nop
     bc8:	34210001 	ori	at,at,0x1
     bcc:	38210001 	xori	at,at,0x1
     bd0:	40816000 	mtc0	at,$12
     bd4:	00000040 	sll	zero,zero,0x1
     bd8:	00000040 	sll	zero,zero,0x1
     bdc:	00000040 	sll	zero,zero,0x1
	int	temp, flags;

	save_flags(flags);
	cli();
	temp = v->counter;
     be0:	8e620070 	lw	v0,112(s3)
     be4:	00000000 	nop
	temp -= i;
     be8:	2442ffff 	addiu	v0,v0,-1
	v->counter = temp;
     bec:	ae620070 	sw	v0,112(s3)
	restore_flags(flags);
     bf0:	40016000 	mfc0	at,$12
     bf4:	30630001 	andi	v1,v1,0x1
     bf8:	34210001 	ori	at,at,0x1
     bfc:	38210001 	xori	at,at,0x1
     c00:	00611825 	or	v1,v1,at
     c04:	40836000 	mtc0	v1,$12
	...
 */
 
static inline void kfree_skb(struct sk_buff *skb)
{
	if (atomic_read(&skb->users) == 1 || atomic_dec_and_test(&skb->users))
     c14:	1440ffa1 	bnez	v0,a9c <rtl8139_start_xmit+0x128>
     c18:	00000000 	nop
		__kfree_skb(skb);
     c1c:	0c000000 	jal	0 <rtl8139_quick_reset>
     c20:	02602021 	move	a0,s3
     c24:	080002a7 	j	a9c <rtl8139_start_xmit+0x128>
     c28:	00000000 	nop
     c2c:	3c040000 	lui	a0,0x0
     c30:	248401b0 	addiu	a0,a0,432
     c34:	0c000000 	jal	0 <rtl8139_quick_reset>
     c38:	00000000 	nop
     c3c:	080002a7 	j	a9c <rtl8139_start_xmit+0x128>
     c40:	00000000 	nop

00000c44 <rtl8139_tx_interrupt>:
     c44:	27bdffc0 	addiu	sp,sp,-64
     c48:	afb5002c 	sw	s5,44(sp)
     c4c:	0080a821 	move	s5,a0
     c50:	afb40028 	sw	s4,40(sp)
     c54:	afb00018 	sw	s0,24(sp)
     c58:	afbf0038 	sw	ra,56(sp)
     c5c:	afb70034 	sw	s7,52(sp)
     c60:	afb60030 	sw	s6,48(sp)
     c64:	afb30024 	sw	s3,36(sp)
     c68:	afb20020 	sw	s2,32(sp)
     c6c:	afb1001c 	sw	s1,28(sp)
     c70:	00a0a021 	move	s4,a1
}

// The purpose of this tx_interrupt:
// 1. Free the skb that has been sent.
// atomic increase dirty_tx;
static void rtl8139_tx_interrupt (struct net_device *dev,
					 struct rtl8139_private *tp,
					 void *ioaddr)
{
	unsigned int tx_header;
	unsigned int tx_header_addr;
	int tx_count,cur_tx,dirty_tx;
	assert (dev != NULL);
     c74:	12a00106 	beqz	s5,1090 <rtl8139_tx_interrupt+0x44c>
     c78:	00c08021 	move	s0,a2
	assert (tp != NULL);
     c7c:	128000f8 	beqz	s4,1060 <rtl8139_tx_interrupt+0x41c>
     c80:	24020340 	li	v0,832
	assert (ioaddr != NULL);
     c84:	120000ea 	beqz	s0,1030 <rtl8139_tx_interrupt+0x3ec>
     c88:	24020341 	li	v0,833

	// if we can make sure this handler occurred in ISR,
	// then we do'nt need to use atomic operation
	dirty_tx = atomic_read (&tp->dirty_tx);
     c8c:	8e92019c 	lw	s2,412(s4)
     c90:	00000000 	nop
	cur_tx = atomic_read (&tp->cur_tx);
     c94:	8e970198 	lw	s7,408(s4)
     c98:	00000000 	nop
	tx_count = CIRC_CNT(cur_tx, dirty_tx, NUM_TX_DESC);
     c9c:	02f21023 	subu	v0,s7,s2
     ca0:	3053003f 	andi	s3,v0,0x3f
	while ( tx_count-- )
     ca4:	2673ffff 	addiu	s3,s3,-1
     ca8:	2402ffff 	li	v0,-1
     cac:	12620009 	beq	s3,v0,cd4 <rtl8139_tx_interrupt+0x90>
     cb0:	00121900 	sll	v1,s2,0x4
	//while (1)
	{
		tx_header_addr=(unsigned int)(&(tp->tx_desc[dirty_tx].header)) | 0x20000000;
     cb4:	8e8201a0 	lw	v0,416(s4)
     cb8:	3c042000 	lui	a0,0x2000
     cbc:	00431021 	addu	v0,v0,v1
     cc0:	00441025 	or	v0,v0,a0

//		tx_header = *(volatile unsigned long *)(&(tp->tx_desc[dirty_tx].header));
	tx_header = *(volatile unsigned int *)(tx_header_addr);
     cc4:	8c440000 	lw	a0,0(v0)
     cc8:	00000000 	nop
	//prom_printf("tx_header_addr=%08x, tx_header=%08x\n",tx_header_addr,tx_header);
		
		if (tx_header & OWNBYNIC)
     ccc:	04810065 	bgez	a0,e64 <rtl8139_tx_interrupt+0x220>
     cd0:	26960004 	addiu	s6,s4,4
 * @addr: Address to start counting from
 */
extern __inline__ int test_bit(int nr, volatile void *addr)
{
	return ((1UL << (nr & 31)) & (((const unsigned int *) addr)[nr >> 5])) != 0;
     cd4:	8ea2002c 	lw	v0,44(s5)
     cd8:	00000000 	nop
     cdc:	30420001 	andi	v0,v0,0x1
			break; 
		if (tx_header & TXERR)
		{
			tp->stats.tx_errors++;
			if (tx_header & TXERR_OUTOFWIN)
				tp->stats.tx_window_errors++;
			if (tx_header & TXERR_LINKF)
				tp->stats.tx_carrier_errors++;
			if (tx_header & TXERR_COLLISION)
				tp->stats.collisions += (tx_header >> 16) & (0xf);		
		}
			if ((tp->tx_skb[dirty_tx])->next)
				printk("Non null?\n");
			//Free skb
			dev_kfree_skb_irq(tp->tx_skb[dirty_tx]);
			tp->tx_skb[dirty_tx]=NULL;
			dirty_tx++;dirty_tx &= (NUM_TX_DESC - 1);
	}
	
	if (netif_queue_stopped(dev) &&
	CIRC_SPACE(cur_tx, dirty_tx, NUM_TX_DESC))
     ce0:	10400054 	beqz	v0,e34 <rtl8139_tx_interrupt+0x1f0>
     ce4:	02571023 	subu	v0,s2,s7
     ce8:	2442ffff 	addiu	v0,v0,-1
     cec:	3042003f 	andi	v0,v0,0x3f
     cf0:	10400050 	beqz	v0,e34 <rtl8139_tx_interrupt+0x1f0>
     cf4:	00000000 	nop
	__bi_flags;

	a += nr >> 5;
	mask = 1 << (nr & 0x1f);
	__bi_save_and_cli(flags);
     cf8:	40056000 	mfc0	a1,$12
     cfc:	00000000 	nop
     d00:	34a10001 	ori	at,a1,0x1
     d04:	38210001 	xori	at,at,0x1
     d08:	40816000 	mtc0	at,$12
     d0c:	00000040 	sll	zero,zero,0x1
     d10:	00000040 	sll	zero,zero,0x1
     d14:	00000040 	sll	zero,zero,0x1
	retval = (mask & *a) != 0;
     d18:	8ea4002c 	lw	a0,44(s5)
     d1c:	00000000 	nop
	*a &= ~mask;
     d20:	8ea2002c 	lw	v0,44(s5)
     d24:	2403fffe 	li	v1,-2
     d28:	00431024 	and	v0,v0,v1
     d2c:	aea2002c 	sw	v0,44(s5)
     d30:	30840001 	andi	a0,a0,0x1
	__bi_restore_flags(flags);
     d34:	40016000 	mfc0	at,$12
     d38:	30a50001 	andi	a1,a1,0x1
     d3c:	34210001 	ori	at,at,0x1
     d40:	38210001 	xori	at,at,0x1
     d44:	00a12825 	or	a1,a1,at
     d48:	40856000 	mtc0	a1,$12
	...
}

static inline void netif_wake_queue(struct net_device *dev)
{
	if (test_and_clear_bit(__LINK_STATE_XOFF, &dev->state))
     d58:	10800036 	beqz	a0,e34 <rtl8139_tx_interrupt+0x1f0>
     d5c:	00000000 	nop
	__bi_flags;

	a += nr >> 5;
	mask = 1 << (nr & 0x1f);
	__bi_save_and_cli(flags);
     d60:	40046000 	mfc0	a0,$12
     d64:	00000000 	nop
     d68:	34810001 	ori	at,a0,0x1
     d6c:	38210001 	xori	at,at,0x1
     d70:	40816000 	mtc0	at,$12
     d74:	00000040 	sll	zero,zero,0x1
     d78:	00000040 	sll	zero,zero,0x1
     d7c:	00000040 	sll	zero,zero,0x1
	retval = (mask & *a) != 0;
     d80:	8ea3002c 	lw	v1,44(s5)
     d84:	00000000 	nop
	*a |= mask;
     d88:	8ea2002c 	lw	v0,44(s5)
     d8c:	00000000 	nop
     d90:	30630008 	andi	v1,v1,0x8
     d94:	34420008 	ori	v0,v0,0x8
     d98:	aea2002c 	sw	v0,44(s5)
     d9c:	0003182b 	sltu	v1,zero,v1
	__bi_restore_flags(flags);
     da0:	40016000 	mfc0	at,$12
     da4:	30840001 	andi	a0,a0,0x1
     da8:	34210001 	ori	at,at,0x1
     dac:	38210001 	xori	at,at,0x1
     db0:	00812025 	or	a0,a0,at
     db4:	40846000 	mtc0	a0,$12
	...
#define HAVE_NETIF_QUEUE

static inline void __netif_schedule(struct net_device *dev)
{
	if (!test_and_set_bit(__LINK_STATE_SCHED, &dev->state)) {
     dc4:	1460001b 	bnez	v1,e34 <rtl8139_tx_interrupt+0x1f0>
     dc8:	00000000 	nop
		unsigned long flags;
		int cpu = smp_processor_id();

		local_irq_save(flags);
     dcc:	40106000 	mfc0	s0,$12
     dd0:	00000000 	nop
     dd4:	36010001 	ori	at,s0,0x1
     dd8:	38210001 	xori	at,at,0x1
     ddc:	40816000 	mtc0	at,$12
     de0:	00000040 	sll	zero,zero,0x1
     de4:	00000040 	sll	zero,zero,0x1
     de8:	00000040 	sll	zero,zero,0x1
		dev->next_sched = softnet_data[cpu].output_queue;
     dec:	3c020000 	lui	v0,0x0
     df0:	8c420018 	lw	v0,24(v0)
     df4:	00000000 	nop
		softnet_data[cpu].output_queue = dev;
		cpu_raise_softirq(cpu, NET_TX_SOFTIRQ);
     df8:	00002021 	move	a0,zero
     dfc:	aea20038 	sw	v0,56(s5)
     e00:	3c010000 	lui	at,0x0
     e04:	ac350018 	sw	s5,24(at)
     e08:	0c000000 	jal	0 <rtl8139_quick_reset>
     e0c:	24050001 	li	a1,1
		local_irq_restore(flags);
     e10:	40016000 	mfc0	at,$12
     e14:	32100001 	andi	s0,s0,0x1
     e18:	34210001 	ori	at,at,0x1
     e1c:	38210001 	xori	at,at,0x1
     e20:	02018025 	or	s0,s0,at
     e24:	40906000 	mtc0	s0,$12
	...
		netif_wake_queue(dev);
	atomic_set (&tp->dirty_tx, dirty_tx);
     e34:	ae92019c 	sw	s2,412(s4)
     e38:	8fbf0038 	lw	ra,56(sp)
     e3c:	8fb70034 	lw	s7,52(sp)
     e40:	8fb60030 	lw	s6,48(sp)
     e44:	8fb5002c 	lw	s5,44(sp)
     e48:	8fb40028 	lw	s4,40(sp)
     e4c:	8fb30024 	lw	s3,36(sp)
     e50:	8fb20020 	lw	s2,32(sp)
     e54:	8fb1001c 	lw	s1,28(sp)
     e58:	8fb00018 	lw	s0,24(sp)
     e5c:	03e00008 	jr	ra
     e60:	27bd0040 	addiu	sp,sp,64
     e64:	3c020080 	lui	v0,0x80
     e68:	00821024 	and	v0,a0,v0
     e6c:	1040001b 	beqz	v0,edc <rtl8139_tx_interrupt+0x298>
     e70:	3c030040 	lui	v1,0x40
     e74:	8e820018 	lw	v0,24(s4)
     e78:	00000000 	nop
     e7c:	24420001 	addiu	v0,v0,1
     e80:	00831824 	and	v1,a0,v1
     e84:	10600005 	beqz	v1,e9c <rtl8139_tx_interrupt+0x258>
     e88:	ae820018 	sw	v0,24(s4)
     e8c:	8e820054 	lw	v0,84(s4)
     e90:	00000000 	nop
     e94:	24420001 	addiu	v0,v0,1
     e98:	ae820054 	sw	v0,84(s4)
     e9c:	3c020020 	lui	v0,0x20
     ea0:	00821024 	and	v0,a0,v0
     ea4:	10400006 	beqz	v0,ec0 <rtl8139_tx_interrupt+0x27c>
     ea8:	3c020010 	lui	v0,0x10
     eac:	8e820048 	lw	v0,72(s4)
     eb0:	00000000 	nop
     eb4:	24420001 	addiu	v0,v0,1
     eb8:	ae820048 	sw	v0,72(s4)
     ebc:	3c020010 	lui	v0,0x10
     ec0:	00821024 	and	v0,a0,v0
     ec4:	10400005 	beqz	v0,edc <rtl8139_tx_interrupt+0x298>
     ec8:	00041402 	srl	v0,a0,0x10
     ecc:	8e830028 	lw	v1,40(s4)
     ed0:	3042000f 	andi	v0,v0,0xf
     ed4:	00621821 	addu	v1,v1,v0
     ed8:	ae830028 	sw	v1,40(s4)
     edc:	00121080 	sll	v0,s2,0x2
     ee0:	244201a0 	addiu	v0,v0,416
     ee4:	02c28821 	addu	s1,s6,v0
     ee8:	8e260000 	lw	a2,0(s1)
     eec:	00000000 	nop
     ef0:	8cc20000 	lw	v0,0(a2)
     ef4:	00000000 	nop
     ef8:	10400007 	beqz	v0,f18 <rtl8139_tx_interrupt+0x2d4>
     efc:	00000000 	nop
     f00:	3c040000 	lui	a0,0x0
     f04:	248401c4 	addiu	a0,a0,452
     f08:	0c000000 	jal	0 <rtl8139_quick_reset>
     f0c:	00000000 	nop
     f10:	8e260000 	lw	a2,0(s1)
     f14:	00000000 	nop
extern __inline__ int atomic_sub_return(int i, atomic_t * v)
{
	int	temp, flags;

	save_flags(flags);
     f18:	40036000 	mfc0	v1,$12
     f1c:	00000000 	nop

extern __inline__ void
__cli(void)
{
	__asm__ __volatile__(
     f20:	40016000 	mfc0	at,$12
     f24:	00000000 	nop
     f28:	34210001 	ori	at,at,0x1
     f2c:	38210001 	xori	at,at,0x1
     f30:	40816000 	mtc0	at,$12
     f34:	00000040 	sll	zero,zero,0x1
     f38:	00000040 	sll	zero,zero,0x1
     f3c:	00000040 	sll	zero,zero,0x1
	int	temp, flags;

	save_flags(flags);
	cli();
	temp = v->counter;
     f40:	8cc20070 	lw	v0,112(a2)
     f44:	00000000 	nop
	temp -= i;
     f48:	2442ffff 	addiu	v0,v0,-1
	v->counter = temp;
     f4c:	acc20070 	sw	v0,112(a2)
	restore_flags(flags);
     f50:	40016000 	mfc0	at,$12
     f54:	30630001 	andi	v1,v1,0x1
     f58:	34210001 	ori	at,at,0x1
     f5c:	38210001 	xori	at,at,0x1
     f60:	00611825 	or	v1,v1,at
     f64:	40836000 	mtc0	v1,$12
	...
 * is executing from interrupt context.
 */
static inline void dev_kfree_skb_irq(struct sk_buff *skb)
{
	if (atomic_dec_and_test(&skb->users)) {
     f74:	10400012 	beqz	v0,fc0 <rtl8139_tx_interrupt+0x37c>
     f78:	00000000 	nop
     f7c:	26520001 	addiu	s2,s2,1
     f80:	2673ffff 	addiu	s3,s3,-1
     f84:	2402ffff 	li	v0,-1
     f88:	ae200000 	sw	zero,0(s1)
     f8c:	1262ff51 	beq	s3,v0,cd4 <rtl8139_tx_interrupt+0x90>
     f90:	3252003f 	andi	s2,s2,0x3f
     f94:	8e8201a0 	lw	v0,416(s4)
     f98:	00121900 	sll	v1,s2,0x4
     f9c:	3c042000 	lui	a0,0x2000
     fa0:	00431021 	addu	v0,v0,v1
     fa4:	00441025 	or	v0,v0,a0
     fa8:	8c440000 	lw	a0,0(v0)
     fac:	00000000 	nop
     fb0:	0480ff48 	bltz	a0,cd4 <rtl8139_tx_interrupt+0x90>
     fb4:	3c020080 	lui	v0,0x80
     fb8:	0800039b 	j	e6c <rtl8139_tx_interrupt+0x228>
     fbc:	00821024 	and	v0,a0,v0
	if (atomic_dec_and_test(&skb->users)) {
		int cpu =smp_processor_id();
		unsigned long flags;

		local_irq_save(flags);
     fc0:	40106000 	mfc0	s0,$12
     fc4:	00000000 	nop
     fc8:	36010001 	ori	at,s0,0x1
     fcc:	38210001 	xori	at,at,0x1
     fd0:	40816000 	mtc0	at,$12
     fd4:	00000040 	sll	zero,zero,0x1
     fd8:	00000040 	sll	zero,zero,0x1
     fdc:	00000040 	sll	zero,zero,0x1
		skb->next = softnet_data[cpu].completion_queue;
     fe0:	3c020000 	lui	v0,0x0
     fe4:	8c42001c 	lw	v0,28(v0)
     fe8:	00000000 	nop
		softnet_data[cpu].completion_queue = skb;
		cpu_raise_softirq(cpu, NET_TX_SOFTIRQ);
     fec:	00002021 	move	a0,zero
     ff0:	acc20000 	sw	v0,0(a2)
     ff4:	3c010000 	lui	at,0x0
     ff8:	ac26001c 	sw	a2,28(at)
     ffc:	0c000000 	jal	0 <rtl8139_quick_reset>
    1000:	24050001 	li	a1,1
		local_irq_restore(flags);
    1004:	40016000 	mfc0	at,$12
    1008:	32100001 	andi	s0,s0,0x1
    100c:	34210001 	ori	at,at,0x1
    1010:	38210001 	xori	at,at,0x1
    1014:	02018025 	or	s0,s0,at
    1018:	40906000 	mtc0	s0,$12
	...
    1028:	080003e0 	j	f80 <rtl8139_tx_interrupt+0x33c>
    102c:	26520001 	addiu	s2,s2,1
    1030:	3c040000 	lui	a0,0x0
    1034:	2484007c 	addiu	a0,a0,124
    1038:	3c050000 	lui	a1,0x0
    103c:	24a500a0 	addiu	a1,a1,160
    1040:	3c060000 	lui	a2,0x0
    1044:	24c600b0 	addiu	a2,a2,176
    1048:	3c070000 	lui	a3,0x0
    104c:	24e701d0 	addiu	a3,a3,464
    1050:	0c000000 	jal	0 <rtl8139_quick_reset>
    1054:	afa20010 	sw	v0,16(sp)
    1058:	08000323 	j	c8c <rtl8139_tx_interrupt+0x48>
    105c:	00000000 	nop
    1060:	3c040000 	lui	a0,0x0
    1064:	2484007c 	addiu	a0,a0,124
    1068:	3c050000 	lui	a1,0x0
    106c:	24a500e0 	addiu	a1,a1,224
    1070:	3c060000 	lui	a2,0x0
    1074:	24c600b0 	addiu	a2,a2,176
    1078:	3c070000 	lui	a3,0x0
    107c:	24e701d0 	addiu	a3,a3,464
    1080:	0c000000 	jal	0 <rtl8139_quick_reset>
    1084:	afa20010 	sw	v0,16(sp)
    1088:	08000321 	j	c84 <rtl8139_tx_interrupt+0x40>
    108c:	00000000 	nop
    1090:	2402033f 	li	v0,831
    1094:	3c040000 	lui	a0,0x0
    1098:	2484007c 	addiu	a0,a0,124
    109c:	3c050000 	lui	a1,0x0
    10a0:	24a500d4 	addiu	a1,a1,212
    10a4:	3c060000 	lui	a2,0x0
    10a8:	24c600b0 	addiu	a2,a2,176
    10ac:	3c070000 	lui	a3,0x0
    10b0:	24e701d0 	addiu	a3,a3,464
    10b4:	0c000000 	jal	0 <rtl8139_quick_reset>
    10b8:	afa20010 	sw	v0,16(sp)
    10bc:	0800031f 	j	c7c <rtl8139_tx_interrupt+0x38>
    10c0:	00000000 	nop

000010c4 <rtl8139_rx_interrupt>:
    10c4:	27bdffc0 	addiu	sp,sp,-64
    10c8:	afb60038 	sw	s6,56(sp)
    10cc:	afb50034 	sw	s5,52(sp)
    10d0:	afb3002c 	sw	s3,44(sp)
    10d4:	afb10024 	sw	s1,36(sp)
    10d8:	afbf003c 	sw	ra,60(sp)
    10dc:	afb40030 	sw	s4,48(sp)
    10e0:	afb20028 	sw	s2,40(sp)
    10e4:	afb00020 	sw	s0,32(sp)
    10e8:	00a09821 	move	s3,a1
}



/* The data sheet doesn't describe the Rx ring at all, so I'm guessing at the
   field alignments and semantics. */
static void rtl8139_rx_interrupt (struct net_device *dev,
				  struct rtl8139_private *tp, void *ioaddr)
{
	struct ethhdr *eth;
	int k,t,netreturn;
	volatile int cur_rx;
	unsigned int rxheader;
	struct sk_buff* skb_ptr; // skb_ptr is used for re-new the desc.
	struct sk_buff* rx_ptr;  // rx_ptr is used to post to os(network layer)
	unsigned int header_addr;
	unsigned int flush_cache;
	cur_rx = tp->cur_rx;
    10ec:	8e62008c 	lw	v0,140(s3)
    10f0:	00000000 	nop
	flush_cache=0;	
	for(k=0; k< MAX_RX_INTERRUPT_WORK; k++)
	{
		rx_ptr=(struct sk_buff *)0;
		
		// Check each descriptor's header, by using physical address
		header_addr = (unsigned int)(&(tp->rx_desc[cur_rx].header));
    10f4:	8e650090 	lw	a1,144(s3)
    10f8:	00000000 	nop
    10fc:	afa20018 	sw	v0,24(sp)
    1100:	8fa30018 	lw	v1,24(sp)
    1104:	00000000 	nop
		rxheader = *(volatile unsigned int *)(header_addr | 0x20000000);	
    1108:	3c022000 	lui	v0,0x2000
    110c:	00031900 	sll	v1,v1,0x4
    1110:	00a33821 	addu	a3,a1,v1
    1114:	00e21025 	or	v0,a3,v0
    1118:	8c500000 	lw	s0,0(v0)
    111c:	00000000 	nop
    1120:	0080a821 	move	s5,a0
    1124:	0000b021 	move	s6,zero
		if (rxheader & OWNBYNIC)
    1128:	0601000d 	bgez	s0,1160 <rtl8139_rx_interrupt+0x9c>
    112c:	00008821 	move	s1,zero
				break;
		
		if (rxheader & RXERR) 
		{
			printk("Rx ErrPkt on %s, rxheader=%08x,header_addr=%08x cur_rx=%08x \n", dev->name, rxheader,header_addr,cur_rx);
			// just ignore this pkt
			// re-use the descriptor
			skb_ptr = tp->rx_skb[cur_rx];
		}
		else if (tp->netrxdrop)
		//else if (softnet_data[0].input_pkt_queue.qlen >= 100)
		{
			skb_ptr = tp->rx_skb[cur_rx];
			//printk("qlen >=100, stop quing\n");
		}
		else if (((rxheader & RXLENMASK) - 4) > 1520)
		{
			printk("weired rxheader=%08x\n", rxheader);
		}
		else
		{
			rx_ptr = tp->rx_skb[cur_rx];
			rx_ptr->dev=dev;
			skb_ptr = dev_alloc_skb(RX_BUF_LEN);
			if (skb_ptr == NULL)
			{	
			
				printk("System out of skbuff for %s, k=%d\n",dev->name,k);
				break;
				skb_ptr = rx_ptr;
				rx_ptr = (struct sk_buff *)NULL;
			}
			else
			{
				skb_reserve(skb_ptr, 2);	// to make tcp/ip happy
				tp->rx_skb[cur_rx] = skb_ptr;
				skb_ptr->dev=dev;
			}
		}
			*(volatile unsigned long *)(&(tp->rx_desc[cur_rx].addr)) = Virtual2Physical((int)(skb_ptr->data)); 
			// Renew this descriptor
			SetOwnByNic(&(tp->rx_desc[cur_rx].header),RX_BUF_LEN ,OWNBYNIC ,cur_rx);
			cur_rx ++;
			cur_rx &= (NUM_RX_DESC - 1);
			
			if (rx_ptr)
			{
#ifdef RTL8139AP_CHECKSUM_OFFLOAD
        		if (rx_csum_ok(rxheader))
        		{
            	//printk("un-necessary\n");
            		rx_ptr->ip_summed = CHECKSUM_UNNECESSARY;
        		}
        		else
            		rx_ptr->ip_summed = CHECKSUM_NONE;
#endif
#if 0
        		rx_ptr->mac.raw=rx_ptr->data;
				eth= rx_ptr->mac.ethernet;
				if(*eth->h_dest&1)
    			{
        			if(memcmp(eth->h_dest,dev->broadcast, ETH_ALEN)==0)
            			rx_ptr->pkt_type=PACKET_BROADCAST;
        			else
            			rx_ptr->pkt_type=PACKET_MULTICAST;
    			}

    			else if(dev->flags&(IFF_PROMISC/*|IFF_ALLMULTI*/))
    			{
        			if(memcmp(eth->h_dest,dev->dev_addr, ETH_ALEN))
            		rx_ptr->pkt_type=PACKET_OTHERHOST;
    			}
#endif			
				skb_put (rx_ptr, (rxheader & RXLENMASK) - 4);
        		rx_ptr->protocol = eth_type_trans (rx_ptr, dev);
        		//if ((netreturn = netif_rx(rx_ptr)) >= NET_RX_CN_LOW)
        		if ((netreturn = netif_rx(rx_ptr)) == NET_RX_DROP)
        		{
      #if 1      	
					printk("NetIf =%08x , halting post skb to os \n",netreturn);
					tp->netrxdrop=TRUE;
        			//add_timer(&tp->timer);
					mod_timer(&tp->timer, jiffies + 3);
	  #endif	
				}
        		else
            		tp->netrxdrop=FALSE;
#if 0   
     		if (((rxheader & RXLENMASK) - 4) > flush_cache)
				flush_cache = ((rxheader & RXLENMASK) - 4);
			#if 0
			for(t=0; t<(((rxheader & RXLENMASK) - 4) >> 4);t++)
					*(unsigned long *)(((unsigned int)(rx_ptr->data) & (~3) | 0x20000000) + 16*t);
			#endif
#else
			//r3k_flush_dcache_range(0,0);	
#endif
				tp->stats.rx_bytes += (rxheader & RXLENMASK) - 4 ;
        		tp->stats.rx_packets++;			

			}
	}
#if 0
	if (tp->netrxdrop == TRUE)
	{
		printk("going to quick_reset %s\n",dev->name);
		rtl8139_quick_reset(dev,tp,ioaddr);
	}
#endif

#if 0	
	if (flush_cache)
		for(t=0; t<(flush_cache >> 4);t++)
                    *(unsigned long *)(((unsigned int)(rx_ptr->data) & (~3) | 0x20000000) + 16*t);
#endif
	tp->cur_rx = cur_rx;
    1130:	8fa20018 	lw	v0,24(sp)
    1134:	8fbf003c 	lw	ra,60(sp)
    1138:	ae62008c 	sw	v0,140(s3)
    113c:	8fb60038 	lw	s6,56(sp)
    1140:	8fb50034 	lw	s5,52(sp)
    1144:	8fb40030 	lw	s4,48(sp)
    1148:	8fb3002c 	lw	s3,44(sp)
    114c:	8fb20028 	lw	s2,40(sp)
    1150:	8fb10024 	lw	s1,36(sp)
    1154:	8fb00020 	lw	s0,32(sp)
    1158:	03e00008 	jr	ra
    115c:	27bd0040 	addiu	sp,sp,64
    1160:	3c020010 	lui	v0,0x10
    1164:	02021024 	and	v0,s0,v0
    1168:	10400093 	beqz	v0,13b8 <rtl8139_rx_interrupt+0x2f4>
    116c:	00000000 	nop
    1170:	8fa20018 	lw	v0,24(sp)
    1174:	02a02821 	move	a1,s5
    1178:	3c040000 	lui	a0,0x0
    117c:	248401e8 	addiu	a0,a0,488
    1180:	02003021 	move	a2,s0
    1184:	afa20010 	sw	v0,16(sp)
    1188:	0c000000 	jal	0 <rtl8139_quick_reset>
    118c:	00000000 	nop
    1190:	8fa30018 	lw	v1,24(sp)
    1194:	8e650090 	lw	a1,144(s3)
    1198:	00031880 	sll	v1,v1,0x2
    119c:	00731821 	addu	v1,v1,s3
    11a0:	8c720094 	lw	s2,148(v1)
    11a4:	00000000 	nop
    11a8:	8fa30018 	lw	v1,24(sp)
    11ac:	8e440080 	lw	a0,128(s2)
    11b0:	3c021fff 	lui	v0,0x1fff
    11b4:	3442ffff 	ori	v0,v0,0xffff
    11b8:	00031900 	sll	v1,v1,0x4
    11bc:	00651821 	addu	v1,v1,a1
    11c0:	00822024 	and	a0,a0,v0
    11c4:	ac640008 	sw	a0,8(v1)
    11c8:	8fa20018 	lw	v0,24(sp)
    11cc:	8e640090 	lw	a0,144(s3)
    11d0:	00021100 	sll	v0,v0,0x4
    11d4:	8fa70018 	lw	a3,24(sp)
    11d8:	00822021 	addu	a0,a0,v0
    11dc:	24050640 	li	a1,1600
    11e0:	0c00003d 	jal	f4 <SetOwnByNic>
    11e4:	3c068000 	lui	a2,0x8000
    11e8:	8fa20018 	lw	v0,24(sp)
    11ec:	00000000 	nop
    11f0:	24420001 	addiu	v0,v0,1
    11f4:	afa20018 	sw	v0,24(sp)
    11f8:	8fa30018 	lw	v1,24(sp)
    11fc:	00000000 	nop
    1200:	3063003f 	andi	v1,v1,0x3f
    1204:	afa30018 	sw	v1,24(sp)
    1208:	12200040 	beqz	s1,130c <rtl8139_rx_interrupt+0x248>
    120c:	00101402 	srl	v0,s0,0x10
    1210:	30440003 	andi	a0,v0,0x3
    1214:	24030003 	li	v1,3
    1218:	10830063 	beq	a0,v1,13a8 <rtl8139_rx_interrupt+0x2e4>
    121c:	32028000 	andi	v0,s0,0x8000
    1220:	24020001 	li	v0,1
    1224:	1082005c 	beq	a0,v0,1398 <rtl8139_rx_interrupt+0x2d4>
    1228:	32022000 	andi	v0,s0,0x2000
    122c:	24020002 	li	v0,2
    1230:	10820055 	beq	a0,v0,1388 <rtl8139_rx_interrupt+0x2c4>
    1234:	32024000 	andi	v0,s0,0x4000
    1238:	00001821 	move	v1,zero
    123c:	10600050 	beqz	v1,1380 <rtl8139_rx_interrupt+0x2bc>
    1240:	24020002 	li	v0,2
    1244:	a222006b 	sb	v0,107(s1)
}

static inline int skb_is_nonlinear(const struct sk_buff *skb)
{
	return skb->data_len;
    1248:	8e220060 	lw	v0,96(s1)
    124c:	00000000 	nop
    1250:	32141fff 	andi	s4,s0,0x1fff
 
static inline unsigned char *skb_put(struct sk_buff *skb, unsigned int len)
{
	unsigned char *tmp=skb->tail;
	SKB_LINEAR_ASSERT(skb);
    1254:	10400008 	beqz	v0,1278 <rtl8139_rx_interrupt+0x1b4>
    1258:	2690fffc 	addiu	s0,s4,-4
    125c:	3c040000 	lui	a0,0x0
    1260:	24840228 	addiu	a0,a0,552
    1264:	3c050000 	lui	a1,0x0
    1268:	24a50240 	addiu	a1,a1,576
    126c:	0c000000 	jal	0 <rtl8139_quick_reset>
    1270:	24060315 	li	a2,789
    1274:	ac000000 	sw	zero,0(zero)
	skb->tail+=len;
    1278:	8e220084 	lw	v0,132(s1)
    127c:	00000000 	nop
	skb->len+=len;
    1280:	8e23005c 	lw	v1,92(s1)
    1284:	00000000 	nop
	if(skb->tail>skb->end) {
    1288:	8e240088 	lw	a0,136(s1)
    128c:	00000000 	nop
    1290:	00501021 	addu	v0,v0,s0
    1294:	00701821 	addu	v1,v1,s0
    1298:	0082202b 	sltu	a0,a0,v0
    129c:	ae23005c 	sw	v1,92(s1)
    12a0:	10800006 	beqz	a0,12bc <rtl8139_rx_interrupt+0x1f8>
    12a4:	ae220084 	sw	v0,132(s1)
		skb_over_panic(skb, len, current_text_addr());
    12a8:	02002821 	move	a1,s0
    12ac:	3c060000 	lui	a2,0x0
    12b0:	24c612a8 	addiu	a2,a2,4776
    12b4:	0c000000 	jal	0 <rtl8139_quick_reset>
    12b8:	02202021 	move	a0,s1
    12bc:	02202021 	move	a0,s1
    12c0:	0c000000 	jal	0 <rtl8139_quick_reset>
    12c4:	02a02821 	move	a1,s5
    12c8:	a6220074 	sh	v0,116(s1)
    12cc:	0c000000 	jal	0 <rtl8139_quick_reset>
    12d0:	02202021 	move	a0,s1
    12d4:	00408021 	move	s0,v0
    12d8:	24020001 	li	v0,1
    12dc:	1202001c 	beq	s0,v0,1350 <rtl8139_rx_interrupt+0x28c>
    12e0:	00000000 	nop
    12e4:	ae6002b0 	sw	zero,688(s3)
    12e8:	8e62000c 	lw	v0,12(s3)
    12ec:	00000000 	nop
    12f0:	8e630004 	lw	v1,4(s3)
    12f4:	00000000 	nop
    12f8:	00541021 	addu	v0,v0,s4
    12fc:	2442fffc 	addiu	v0,v0,-4
    1300:	24630001 	addiu	v1,v1,1
    1304:	ae62000c 	sw	v0,12(s3)
    1308:	ae630004 	sw	v1,4(s3)
    130c:	26d60001 	addiu	s6,s6,1
    1310:	2ac2003a 	slti	v0,s6,58
    1314:	1040ff86 	beqz	v0,1130 <rtl8139_rx_interrupt+0x6c>
    1318:	00000000 	nop
    131c:	8fa20018 	lw	v0,24(sp)
    1320:	8e630090 	lw	v1,144(s3)
    1324:	00021100 	sll	v0,v0,0x4
    1328:	00602821 	move	a1,v1
    132c:	00623821 	addu	a3,v1,v0
    1330:	3c032000 	lui	v1,0x2000
    1334:	00e31825 	or	v1,a3,v1
    1338:	8c700000 	lw	s0,0(v1)
    133c:	00000000 	nop
    1340:	0600ff7b 	bltz	s0,1130 <rtl8139_rx_interrupt+0x6c>
    1344:	00008821 	move	s1,zero
    1348:	08000459 	j	1164 <rtl8139_rx_interrupt+0xa0>
    134c:	3c020010 	lui	v0,0x10
    1350:	3c040000 	lui	a0,0x0
    1354:	24840284 	addiu	a0,a0,644
    1358:	0c000000 	jal	0 <rtl8139_quick_reset>
    135c:	24050001 	li	a1,1
    1360:	ae7002b0 	sw	s0,688(s3)
    1364:	3c050000 	lui	a1,0x0
    1368:	8ca50000 	lw	a1,0(a1)
    136c:	26640060 	addiu	a0,s3,96
    1370:	0c000000 	jal	0 <rtl8139_quick_reset>
    1374:	24a50003 	addiu	a1,a1,3
    1378:	080004ba 	j	12e8 <rtl8139_rx_interrupt+0x224>
    137c:	00000000 	nop
    1380:	08000492 	j	1248 <rtl8139_rx_interrupt+0x184>
    1384:	a220006b 	sb	zero,107(s1)
    1388:	1440ffab 	bnez	v0,1238 <rtl8139_rx_interrupt+0x174>
    138c:	24030001 	li	v1,1
    1390:	0800048f 	j	123c <rtl8139_rx_interrupt+0x178>
    1394:	00000000 	nop
    1398:	1440ffa4 	bnez	v0,122c <rtl8139_rx_interrupt+0x168>
    139c:	24030001 	li	v1,1
    13a0:	0800048f 	j	123c <rtl8139_rx_interrupt+0x178>
    13a4:	00000000 	nop
    13a8:	1440ff9d 	bnez	v0,1220 <rtl8139_rx_interrupt+0x15c>
    13ac:	24030001 	li	v1,1
    13b0:	0800048f 	j	123c <rtl8139_rx_interrupt+0x178>
    13b4:	00000000 	nop
    13b8:	8e6202b0 	lw	v0,688(s3)
    13bc:	00000000 	nop
    13c0:	10400008 	beqz	v0,13e4 <rtl8139_rx_interrupt+0x320>
    13c4:	32021fff 	andi	v0,s0,0x1fff
    13c8:	8fa20018 	lw	v0,24(sp)
    13cc:	00000000 	nop
    13d0:	00021080 	sll	v0,v0,0x2
    13d4:	00531021 	addu	v0,v0,s3
    13d8:	8c520094 	lw	s2,148(v0)
    13dc:	0800046a 	j	11a8 <rtl8139_rx_interrupt+0xe4>
    13e0:	00000000 	nop
    13e4:	2442fffc 	addiu	v0,v0,-4
    13e8:	2c4205f1 	sltiu	v0,v0,1521
    13ec:	14400008 	bnez	v0,1410 <rtl8139_rx_interrupt+0x34c>
    13f0:	00000000 	nop
    13f4:	3c040000 	lui	a0,0x0
    13f8:	248402ac 	addiu	a0,a0,684
    13fc:	0c000000 	jal	0 <rtl8139_quick_reset>
    1400:	02002821 	move	a1,s0
    1404:	8e650090 	lw	a1,144(s3)
    1408:	0800046a 	j	11a8 <rtl8139_rx_interrupt+0xe4>
    140c:	00000000 	nop
    1410:	8fa20018 	lw	v0,24(sp)
    1414:	26740004 	addiu	s4,s3,4
    1418:	00021080 	sll	v0,v0,0x2
    141c:	00541021 	addu	v0,v0,s4
    1420:	8c510090 	lw	s1,144(v0)
    1424:	00000000 	nop
					      int gfp_mask)
{
	struct sk_buff *skb;

	skb = alloc_skb(length+16, gfp_mask);
    1428:	24040650 	li	a0,1616
    142c:	ae350018 	sw	s5,24(s1)
					      int gfp_mask)
{
	struct sk_buff *skb;

	skb = alloc_skb(length+16, gfp_mask);
    1430:	0c000000 	jal	0 <rtl8139_quick_reset>
    1434:	24050020 	li	a1,32
    1438:	00402021 	move	a0,v0
	if (skb)
    143c:	10800009 	beqz	a0,1464 <rtl8139_rx_interrupt+0x3a0>
    1440:	00809021 	move	s2,a0
    1444:	8c820080 	lw	v0,128(a0)
    1448:	00000000 	nop
    144c:	8c830084 	lw	v1,132(a0)
    1450:	00000000 	nop
    1454:	24420010 	addiu	v0,v0,16
    1458:	24630010 	addiu	v1,v1,16
    145c:	ac820080 	sw	v0,128(a0)
    1460:	ac830084 	sw	v1,132(a0)
    1464:	12400012 	beqz	s2,14b0 <rtl8139_rx_interrupt+0x3ec>
    1468:	00000000 	nop
 */

static inline void skb_reserve(struct sk_buff *skb, unsigned int len)
{
	skb->data+=len;
    146c:	8e420080 	lw	v0,128(s2)
    1470:	00000000 	nop
	skb->tail+=len;
    1474:	8e430084 	lw	v1,132(s2)
    1478:	00000000 	nop
    147c:	24420002 	addiu	v0,v0,2
    1480:	24630002 	addiu	v1,v1,2
    1484:	ae420080 	sw	v0,128(s2)
    1488:	ae430084 	sw	v1,132(s2)
    148c:	8fa20018 	lw	v0,24(sp)
    1490:	00000000 	nop
    1494:	00021080 	sll	v0,v0,0x2
    1498:	00541021 	addu	v0,v0,s4
    149c:	ac520090 	sw	s2,144(v0)
    14a0:	ae550018 	sw	s5,24(s2)
    14a4:	8e650090 	lw	a1,144(s3)
    14a8:	0800046a 	j	11a8 <rtl8139_rx_interrupt+0xe4>
    14ac:	00000000 	nop
    14b0:	3c040000 	lui	a0,0x0
    14b4:	248402c4 	addiu	a0,a0,708
    14b8:	02a02821 	move	a1,s5
    14bc:	0c000000 	jal	0 <rtl8139_quick_reset>
    14c0:	02c03021 	move	a2,s6
    14c4:	0800044c 	j	1130 <rtl8139_rx_interrupt+0x6c>
    14c8:	00000000 	nop

000014cc <rtl8139_interrupt>:
    14cc:	27bdffd8 	addiu	sp,sp,-40
    14d0:	afb40020 	sw	s4,32(sp)
    14d4:	afb3001c 	sw	s3,28(sp)
    14d8:	afbf0024 	sw	ra,36(sp)
    14dc:	afb20018 	sw	s2,24(sp)
    14e0:	afb10014 	sw	s1,20(sp)
    14e4:	afb00010 	sw	s0,16(sp)
    14e8:	00a09821 	move	s3,a1
}



/* The interrupt handler does all of the Rx thread work and cleans up
   after the Tx thread. */
static void rtl8139_interrupt (int irq, void *dev_instance,
			       struct pt_regs *regs)
{
	struct net_device *dev = (struct net_device *) dev_instance;
	struct rtl8139_private *tp = (struct rtl8139_private *) dev->priv;
    14ec:	8e710064 	lw	s1,100(s3)
    14f0:	00000000 	nop
}

static inline unsigned int inl(unsigned long port)
{
	return __ioswab32(*(volatile u32 *)(mips_io_port_base + port));
    14f4:	3c030000 	lui	v1,0x0
    14f8:	8c630000 	lw	v1,0(v1)
    14fc:	00000000 	nop
	void *ioaddr = tp->mmio_addr;
    1500:	8e320000 	lw	s2,0(s1)
    1504:	00000000 	nop
	int status = 0;  /* avoid bogus "uninit" warning */

	spin_lock (&tp->lock);

		status = RTL_R32 (NIC_ISR);

		RTL_W32_F (NIC_ISR,  status);
		status &= tp->intr_mask;
    1508:	3c040000 	lui	a0,0x0
    150c:	248402e8 	addiu	a0,a0,744
	return __ioswab16(*(volatile u16 *)(mips_io_port_base + port));
}

static inline unsigned int inl(unsigned long port)
{
    1510:	26420024 	addiu	v0,s2,36
	return __ioswab32(*(volatile u32 *)(mips_io_port_base + port));
    1514:	00621021 	addu	v0,v1,v0
    1518:	8c500000 	lw	s0,0(v0)
    151c:	00000000 	nop
    1520:	0072a021 	addu	s4,v1,s2
    1524:	ae900024 	sw	s0,36(s4)
    1528:	8e230088 	lw	v1,136(s1)
    152c:	00000000 	nop
    1530:	02038024 	and	s0,s0,v1
		/* Check uncommon events with one test. */
#if 0
		if (status & (RxErrStats))
			printk("RxErr on %s\n", dev->name);
#endif	
		if (status & (TxErrStats))
    1534:	32020080 	andi	v0,s0,0x80
    1538:	10400004 	beqz	v0,154c <rtl8139_interrupt+0x80>
    153c:	32020008 	andi	v0,s0,0x8
			printk("TxErr on %s\n", dev->name);
    1540:	0c000000 	jal	0 <rtl8139_quick_reset>
    1544:	00000000 	nop
	
		if (status & (RxDescUnStats))
    1548:	32020008 	andi	v0,s0,0x8
    154c:	3c040000 	lui	a0,0x0
    1550:	248402f8 	addiu	a0,a0,760
    1554:	10400003 	beqz	v0,1564 <rtl8139_interrupt+0x98>
    1558:	02602821 	move	a1,s3
			printk("RxDescUn on %s\n", dev->name);
    155c:	0c000000 	jal	0 <rtl8139_quick_reset>
    1560:	00000000 	nop
	
		if (status & (RxFFOvMask))
    1564:	32020010 	andi	v0,s0,0x10
    1568:	3c040000 	lui	a0,0x0
    156c:	24840308 	addiu	a0,a0,776
    1570:	1040000d 	beqz	v0,15a8 <rtl8139_interrupt+0xdc>
    1574:	02602821 	move	a1,s3
		{
			// Does this imply Lexra Bus is hardly occupied by NIC ?
			// Should we adjust burst length case by case?
			printk("RxFFOvStats on %s\n", dev->name);
    1578:	0c000000 	jal	0 <rtl8139_quick_reset>
    157c:	00000000 	nop
			// This is partially because of non-consistency of hardware and
			// software rx_cur mechanism. Try to reset hardware and software.
			//rtl8139_quick_reset(dev,tp,ioaddr);
			tp->intr_mask &= ~(RxFFOvMask | RxDescUnMask); 
    1580:	8e230088 	lw	v1,136(s1)
    1584:	2402ffe7 	li	v0,-25
    1588:	00621824 	and	v1,v1,v0
    158c:	ae230088 	sw	v1,136(s1)
			RTL_W32_F(NIC_IMR, tp->intr_mask);
    1590:	ae830020 	sw	v1,32(s4)
			mod_timer(&tp->rxtimer, jiffies + 5);
    1594:	3c050000 	lui	a1,0x0
    1598:	8ca50000 	lw	a1,0(a1)
    159c:	26240074 	addiu	a0,s1,116
    15a0:	0c000000 	jal	0 <rtl8139_quick_reset>
    15a4:	24a50005 	addiu	a1,a1,5
		}
#if 0 
		if (status & (RxOkStats |  RxDescUnStats | RxFFOvStats ))	/* Rx interrupt */
			rtl8139_rx_interrupt (dev, tp, ioaddr);

		if (status & (TxOkStats |  TxDescUnStats))
			rtl8139_tx_interrupt (dev, tp, ioaddr);
#else
			rtl8139_rx_interrupt (dev, tp, ioaddr);
    15a8:	02602021 	move	a0,s3
    15ac:	02202821 	move	a1,s1
    15b0:	0c000431 	jal	10c4 <rtl8139_rx_interrupt>
    15b4:	02403021 	move	a2,s2
            rtl8139_tx_interrupt (dev, tp, ioaddr);
    15b8:	02602021 	move	a0,s3
    15bc:	02202821 	move	a1,s1
    15c0:	0c000311 	jal	c44 <rtl8139_tx_interrupt>
    15c4:	02403021 	move	a2,s2
    15c8:	8fbf0024 	lw	ra,36(sp)
    15cc:	8fb40020 	lw	s4,32(sp)
    15d0:	8fb3001c 	lw	s3,28(sp)
    15d4:	8fb20018 	lw	s2,24(sp)
    15d8:	8fb10014 	lw	s1,20(sp)
    15dc:	8fb00010 	lw	s0,16(sp)
    15e0:	03e00008 	jr	ra
    15e4:	27bd0028 	addiu	sp,sp,40

000015e8 <rtl8139_close>:
    15e8:	27bdffe0 	addiu	sp,sp,-32
    15ec:	afb20018 	sw	s2,24(sp)
    15f0:	afbf001c 	sw	ra,28(sp)
    15f4:	afb10014 	sw	s1,20(sp)
    15f8:	afb00010 	sw	s0,16(sp)
    15fc:	00809021 	move	s2,a0
#endif

	spin_unlock (&tp->lock);
}


static int rtl8139_close (struct net_device *dev)
{
	struct rtl8139_private *tp = (struct rtl8139_private *) dev->priv;
    1600:	8e510064 	lw	s1,100(s2)
    1604:	00000000 	nop
	void *ioaddr = tp->mmio_addr;
    1608:	8e300000 	lw	s0,0(s1)
    160c:	00000000 	nop
	unsigned long flags;
	printk("before close, nr_free_pages=%08x\n", nr_free_pages());
    1610:	0c000000 	jal	0 <rtl8139_quick_reset>
    1614:	00000000 	nop
    1618:	3c040000 	lui	a0,0x0
    161c:	2484031c 	addiu	a0,a0,796
    1620:	0c000000 	jal	0 <rtl8139_quick_reset>
    1624:	00402821 	move	a1,v0
	__bi_flags;

	a += nr >> 5;
	mask = 1 << (nr & 0x1f);
	__bi_save_and_cli(flags);
    1628:	40036000 	mfc0	v1,$12
    162c:	00000000 	nop
    1630:	34610001 	ori	at,v1,0x1
    1634:	38210001 	xori	at,at,0x1
    1638:	40816000 	mtc0	at,$12
    163c:	00000040 	sll	zero,zero,0x1
    1640:	00000040 	sll	zero,zero,0x1
    1644:	00000040 	sll	zero,zero,0x1
	*a |= mask;
    1648:	8e42002c 	lw	v0,44(s2)
    164c:	00000000 	nop
    1650:	34420001 	ori	v0,v0,0x1
    1654:	ae42002c 	sw	v0,44(s2)
	__bi_restore_flags(flags);
    1658:	40016000 	mfc0	at,$12
    165c:	30630001 	andi	v1,v1,0x1
    1660:	34210001 	ori	at,at,0x1
    1664:	38210001 	xori	at,at,0x1
    1668:	00611825 	or	v1,v1,at
    166c:	40836000 	mtc0	v1,$12
	...
	DPRINTK ("ENTER\n");

	netif_stop_queue (dev);

	del_timer_sync (&tp->timer);
    167c:	0c000000 	jal	0 <rtl8139_quick_reset>
    1680:	26240060 	addiu	a0,s1,96

	spin_lock_irqsave (&tp->lock, flags);
    1684:	40056000 	mfc0	a1,$12
    1688:	00000000 	nop
    168c:	34a10001 	ori	at,a1,0x1
    1690:	38210001 	xori	at,at,0x1
    1694:	40816000 	mtc0	at,$12
    1698:	00000040 	sll	zero,zero,0x1
    169c:	00000040 	sll	zero,zero,0x1
    16a0:	00000040 	sll	zero,zero,0x1

	/* Disable interrupts by clearing the interrupt mask. */
	RTL_W32 (NIC_IMR, 0x0000);
    16a4:	3c040000 	lui	a0,0x0
    16a8:	8c840000 	lw	a0,0(a0)
    16ac:	00000000 	nop
	return __ioswab16(*(volatile u16 *)(mips_io_port_base + port));
}

static inline unsigned int inl(unsigned long port)
{
    16b0:	26020088 	addiu	v0,s0,136
    16b4:	00908021 	addu	s0,a0,s0
    16b8:	ae000020 	sw	zero,32(s0)
}

static inline unsigned int inl(unsigned long port)
{
	return __ioswab32(*(volatile u32 *)(mips_io_port_base + port));
    16bc:	8e030000 	lw	v1,0(s0)
    16c0:	00822021 	addu	a0,a0,v0

	/* Stop the chip's Tx and Rx DMA processes. */
	RTL_W32 (NIC_CNR1, (RTL_R32 (NIC_CNR1) & ((~RxEnable) | (~TxEnable))));
    16c4:	ae030000 	sw	v1,0(s0)
}

static inline unsigned int inl(unsigned long port)
{
	return __ioswab32(*(volatile u32 *)(mips_io_port_base + port));
    16c8:	8c820000 	lw	v0,0(a0)
    16cc:	00000000 	nop

	/* Update the error counts. */
	tp->stats.rx_missed_errors += (RTL_R32 (NIC_RXERR) & 0xffff);
    16d0:	8e230040 	lw	v1,64(s1)
    16d4:	3042ffff 	andi	v0,v0,0xffff
    16d8:	00621821 	addu	v1,v1,v0
    16dc:	ae230040 	sw	v1,64(s1)
	RTL_W32 (NIC_RXERR, 0);
    16e0:	ae000088 	sw	zero,136(s0)

	spin_unlock_irqrestore (&tp->lock, flags);
    16e4:	40016000 	mfc0	at,$12
    16e8:	30a50001 	andi	a1,a1,0x1
    16ec:	34210001 	ori	at,at,0x1
    16f0:	38210001 	xori	at,at,0x1
    16f4:	00a12825 	or	a1,a1,at
    16f8:	40856000 	mtc0	a1,$12
	...

	/* snooze for a small bit */
	if (current->need_resched)
    1708:	8f820014 	lw	v0,20(gp)
    170c:	00000000 	nop
    1710:	10400003 	beqz	v0,1720 <rtl8139_close+0x138>
    1714:	00000000 	nop
		schedule ();
    1718:	0c000000 	jal	0 <rtl8139_quick_reset>
    171c:	00000000 	nop

	free_irq (dev->irq, dev);
    1720:	8e440024 	lw	a0,36(s2)
    1724:	0c000000 	jal	0 <rtl8139_quick_reset>
    1728:	02402821 	move	a1,s2

	rtl8139_sw_free(tp);
    172c:	0c0000b3 	jal	2cc <rtl8139_sw_free>
    1730:	02202021 	move	a0,s1
	/* Green! Put the chip in low-power mode. */
	MOD_DEC_USE_COUNT;

	printk("after close, nr_free_pages=%08x\n", nr_free_pages());
    1734:	0c000000 	jal	0 <rtl8139_quick_reset>
    1738:	00000000 	nop
    173c:	3c040000 	lui	a0,0x0
    1740:	24840340 	addiu	a0,a0,832
    1744:	0c000000 	jal	0 <rtl8139_quick_reset>
    1748:	00402821 	move	a1,v0
	DPRINTK ("EXIT\n");
	return 0;
    174c:	8fbf001c 	lw	ra,28(sp)
    1750:	8fb20018 	lw	s2,24(sp)
    1754:	8fb10014 	lw	s1,20(sp)
    1758:	8fb00010 	lw	s0,16(sp)
    175c:	00001021 	move	v0,zero
    1760:	03e00008 	jr	ra
    1764:	27bd0020 	addiu	sp,sp,32

00001768 <mii_ioctl>:
}


static int mii_ioctl (struct net_device *dev, struct ifreq *rq, int cmd)
{
#if 0
	struct rtl8139_private *tp = (struct rtl8139_private *) dev->priv;
	u16 *data = (u16 *) & rq->ifr_data;
	unsigned long flags;
	int rc = 0;

	DPRINTK ("ENTER\n");

	switch (cmd) {
	case SIOCDEVPRIVATE:	/* Get the address of the PHY in use. */
		data[0] = tp->phys[0] & 0x3f;
		/* Fall Through */

	case SIOCDEVPRIVATE + 1:	/* Read the specified MII register. */
		spin_lock_irqsave (&tp->lock, flags);
		data[3] = mdio_read (dev, data[0], data[1] & 0x1f);
		spin_unlock_irqrestore (&tp->lock, flags);
		break;

	case SIOCDEVPRIVATE + 2:	/* Write the specified MII register */
		if (!capable (CAP_NET_ADMIN)) {
			rc = -EPERM;
			break;
		}

		spin_lock_irqsave (&tp->lock, flags);
		mdio_write (dev, data[0], data[1] & 0x1f, data[2]);
		spin_unlock_irqrestore (&tp->lock, flags);
		break;

	default:
		rc = -EOPNOTSUPP;
		break;
	}

	DPRINTK ("EXIT, returning %d\n", rc);
	return rc;
#endif
	return  -EOPNOTSUPP;
    1768:	03e00008 	jr	ra
    176c:	2402ff86 	li	v0,-122

00001770 <rtl8139_get_stats>:
 * @addr: Address to start counting from
 */
extern __inline__ int test_bit(int nr, volatile void *addr)
{
	return ((1UL << (nr & 31)) & (((const unsigned int *) addr)[nr >> 5])) != 0;
    1770:	8c82002c 	lw	v0,44(a0)
    1774:	00000000 	nop
}


static struct net_device_stats *rtl8139_get_stats (struct net_device *dev)
{
	struct rtl8139_private *tp = (struct rtl8139_private *) dev->priv;
    1778:	8c870064 	lw	a3,100(a0)
    177c:	00000000 	nop
 * @addr: Address to start counting from
 */
extern __inline__ int test_bit(int nr, volatile void *addr)
{
	return ((1UL << (nr & 31)) & (((const unsigned int *) addr)[nr >> 5])) != 0;
    1780:	00021042 	srl	v0,v0,0x1
    1784:	30420001 	andi	v0,v0,0x1
	void *ioaddr = tp->mmio_addr;
    1788:	8ce80000 	lw	t0,0(a3)
    178c:	00000000 	nop

	DPRINTK ("ENTER\n");

	assert (tp != NULL);

	if (netif_running(dev)) {
    1790:	1040001f 	beqz	v0,1810 <rtl8139_get_stats+0xa0>
    1794:	27bdffe8 	addiu	sp,sp,-24
		unsigned long flags;

		spin_lock_irqsave (&tp->lock, flags);
    1798:	40066000 	mfc0	a2,$12
    179c:	00000000 	nop
    17a0:	34c10001 	ori	at,a2,0x1
    17a4:	38210001 	xori	at,at,0x1
    17a8:	40816000 	mtc0	at,$12
    17ac:	00000040 	sll	zero,zero,0x1
    17b0:	00000040 	sll	zero,zero,0x1
    17b4:	00000040 	sll	zero,zero,0x1
}

static inline unsigned int inl(unsigned long port)
{
	return __ioswab32(*(volatile u32 *)(mips_io_port_base + port));
    17b8:	3c050000 	lui	a1,0x0
    17bc:	8ca50000 	lw	a1,0(a1)
    17c0:	00000000 	nop
    17c4:	25020088 	addiu	v0,t0,136
    17c8:	00a21021 	addu	v0,a1,v0
    17cc:	8c430000 	lw	v1,0(v0)
    17d0:	00000000 	nop

		tp->stats.rx_missed_errors += RTL_R32 (NIC_RXERR) & 0xffff;
    17d4:	8ce40040 	lw	a0,64(a3)
    17d8:	3063ffff 	andi	v1,v1,0xffff
    17dc:	00832021 	addu	a0,a0,v1
		RTL_W32 (NIC_RXERR, 0);
    17e0:	00a82821 	addu	a1,a1,t0
    17e4:	ace40040 	sw	a0,64(a3)
    17e8:	aca00088 	sw	zero,136(a1)

		spin_unlock_irqrestore (&tp->lock, flags);
    17ec:	40016000 	mfc0	at,$12
    17f0:	30c60001 	andi	a2,a2,0x1
    17f4:	34210001 	ori	at,at,0x1
    17f8:	38210001 	xori	at,at,0x1
    17fc:	00c13025 	or	a2,a2,at
    1800:	40866000 	mtc0	a2,$12
	...
	}

	DPRINTK ("EXIT\n");
	return &tp->stats;
    1810:	24e20004 	addiu	v0,a3,4
    1814:	03e00008 	jr	ra
    1818:	27bd0018 	addiu	sp,sp,24

0000181c <rtl8139_set_rx_mode>:
    181c:	27bdffe0 	addiu	sp,sp,-32
    1820:	afbf001c 	sw	ra,28(sp)
    1824:	afb00018 	sw	s0,24(sp)
    1828:	00806821 	move	t5,a0
}

/* Set or clear the multicast filter for this adaptor.
   This routine is not state sensitive and need not be SMP locked. */

static unsigned const ethernet_polynomial = 0x04c11db7U;
static inline u32 ether_crc (int length, unsigned char *data)
{
	int crc = -1;

	DPRINTK ("ENTER\n");

	while (--length >= 0) {
		unsigned char current_octet = *data++;
		int bit;
		for (bit = 0; bit < 8; bit++, current_octet >>= 1)
			crc = (crc << 1) ^
			    ((crc < 0) ^ (current_octet & 1) ?
			     ethernet_polynomial : 0);
	}

	DPRINTK ("EXIT\n");
	return crc;
}


static void rtl8139_set_rx_mode (struct net_device *dev)
{
	struct rtl8139_private *tp = (struct rtl8139_private *) dev->priv;
	void *ioaddr = tp->mmio_addr;
	u32 mc_filter[2];	/* Multicast hash filter */
	int i, rx_mode;
	u32 tmp;

	DPRINTK ("ENTER\n");
#if 0
	DPRINTK ("%s:   rtl8139_set_rx_mode(%4.4x) done -- Rx config %8.8x.\n",
			dev->name, dev->flags, RTL_R32 (RxConfig));
#endif
	/* Note: do not reorder, GCC is clever about common statements. */
	if (dev->flags & IFF_PROMISC) {
    182c:	95a40054 	lhu	a0,84(t5)
    1830:	00000000 	nop
    1834:	8da20064 	lw	v0,100(t5)
    1838:	00000000 	nop
    183c:	30830100 	andi	v1,a0,0x100
    1840:	8c500000 	lw	s0,0(v0)
    1844:	00000000 	nop
    1848:	10600036 	beqz	v1,1924 <rtl8139_set_rx_mode+0x108>
    184c:	00000000 	nop
		/* Unconditionally log net taps. */
		printk (KERN_NOTICE "%s: Promiscuous mode enabled.\n",
    1850:	3c040000 	lui	a0,0x0
    1854:	24840368 	addiu	a0,a0,872
    1858:	0c000000 	jal	0 <rtl8139_quick_reset>
    185c:	01a02821 	move	a1,t5
			dev->name);
		rx_mode = AB | AM | APM | AAP;
		mc_filter[1] = mc_filter[0] = 0xffffffff;
    1860:	2403ffff 	li	v1,-1
    1864:	240f00f0 	li	t7,240
    1868:	afa30014 	sw	v1,20(sp)
    186c:	afa30010 	sw	v1,16(sp)
	} else if ((dev->mc_count > multicast_filter_limit)
		   || (dev->flags & IFF_ALLMULTI)) {
		/* Too many to filter perfectly -- accept all multicasts. */
		rx_mode = AB | AM| APM;
		mc_filter[1] = mc_filter[0] = 0xffffffff;
	} else {
		struct dev_mc_list *mclist;
		rx_mode = AB | AM | APM;
		mc_filter[1] = mc_filter[0] = 0;
		for (i = 0, mclist = dev->mc_list; mclist && i < dev->mc_count;
		     i++, mclist = mclist->next)
			set_bit (ether_crc (ETH_ALEN, mclist->dmi_addr) >> 26,
				 mc_filter);
	}

	/* if called from irq handler, lock already acquired */
	if (!in_irq ())
    1870:	3c050000 	lui	a1,0x0
    1874:	24a50004 	addiu	a1,a1,4
    1878:	8ca20000 	lw	v0,0(a1)
    187c:	00000000 	nop
    1880:	1040001e 	beqz	v0,18fc <rtl8139_set_rx_mode+0xe0>
    1884:	00000000 	nop
		spin_lock_irq (&tp->lock);

	/* We can safely update without stopping the chip. */
	tmp = rtl8139_trx_config | rx_mode | TxEnable | RxEnable ; 
    1888:	3c02500c 	lui	v0,0x500c
	RTL_W32_F(NIC_CNR1, tmp);
    188c:	3c040000 	lui	a0,0x0
    1890:	8c840000 	lw	a0,0(a0)
    1894:	00000000 	nop
    1898:	34422000 	ori	v0,v0,0x2000
    189c:	00902021 	addu	a0,a0,s0
    18a0:	01e21025 	or	v0,t7,v0
    18a4:	ac820000 	sw	v0,0(a0)
	RTL_W32_F (NIC_MAR + 0, mc_filter[0]);
    18a8:	8fa30010 	lw	v1,16(sp)
    18ac:	00000000 	nop
    18b0:	ac83000c 	sw	v1,12(a0)
	RTL_W32_F (NIC_MAR + 4, mc_filter[1]);
    18b4:	8fa20014 	lw	v0,20(sp)
    18b8:	00000000 	nop
    18bc:	ac820010 	sw	v0,16(a0)

	if (!in_irq ())
    18c0:	8ca30000 	lw	v1,0(a1)
    18c4:	00000000 	nop
    18c8:	10600005 	beqz	v1,18e0 <rtl8139_set_rx_mode+0xc4>
    18cc:	00000000 	nop
		spin_unlock_irq (&tp->lock);
    18d0:	8fbf001c 	lw	ra,28(sp)
    18d4:	8fb00018 	lw	s0,24(sp)
    18d8:	03e00008 	jr	ra
    18dc:	27bd0020 	addiu	sp,sp,32

extern __inline__ void
__sti(void)
{
	__asm__ __volatile__(
    18e0:	40016000 	mfc0	at,$12
    18e4:	00000000 	nop
    18e8:	3421001f 	ori	at,at,0x1f
    18ec:	3821001e 	xori	at,at,0x1e
    18f0:	40816000 	mtc0	at,$12
    18f4:	08000634 	j	18d0 <rtl8139_set_rx_mode+0xb4>
    18f8:	00000000 	nop
		"__sti"
		: /* no outputs */
		: /* no inputs */
		: "memory");
}

/*
 * For cli() we have to insert nops to make sure that the new value
 * has actually arrived in the status register before the end of this
 * macro.
 * R4000/R4400 need three nops, the R4600 two nops and the R10000 needs
 * no nops at all.
 */
__asm__ (
	".macro\t__cli\n\t"
	".set\tpush\n\t"
	".set\tnoat\n\t"
	"mfc0\t$1,$12\n\t"
	"ori\t$1,1\n\t"
	"xori\t$1,1\n\t"
	".set\tnoreorder\n\t"
	"mtc0\t$1,$12\n\t"
	"sll\t$0, $0, 1\t\t\t# nop\n\t"
	"sll\t$0, $0, 1\t\t\t# nop\n\t"
	"sll\t$0, $0, 1\t\t\t# nop\n\t"
	".set\tpop\n\t"
	".endm");

extern __inline__ void
__cli(void)
{
	__asm__ __volatile__(
    18fc:	40016000 	mfc0	at,$12
    1900:	00000000 	nop
    1904:	34210001 	ori	at,at,0x1
    1908:	38210001 	xori	at,at,0x1
    190c:	40816000 	mtc0	at,$12
    1910:	00000040 	sll	zero,zero,0x1
    1914:	00000040 	sll	zero,zero,0x1
    1918:	00000040 	sll	zero,zero,0x1
    191c:	08000623 	j	188c <rtl8139_set_rx_mode+0x70>
    1920:	3c02500c 	lui	v0,0x500c
    1924:	8da30084 	lw	v1,132(t5)
    1928:	3c020000 	lui	v0,0x0
    192c:	8c420004 	lw	v0,4(v0)
    1930:	00000000 	nop
    1934:	0043102a 	slt	v0,v0,v1
    1938:	14400004 	bnez	v0,194c <rtl8139_set_rx_mode+0x130>
    193c:	2402ffff 	li	v0,-1
    1940:	30820200 	andi	v0,a0,0x200
    1944:	10400005 	beqz	v0,195c <rtl8139_set_rx_mode+0x140>
    1948:	2402ffff 	li	v0,-1
    194c:	240f00e0 	li	t7,224
    1950:	afa20014 	sw	v0,20(sp)
    1954:	0800061c 	j	1870 <rtl8139_set_rx_mode+0x54>
    1958:	afa20010 	sw	v0,16(sp)
    195c:	8dac0080 	lw	t4,128(t5)
    1960:	00000000 	nop
    1964:	240f00e0 	li	t7,224
    1968:	00007021 	move	t6,zero
    196c:	afa00010 	sw	zero,16(sp)
    1970:	afa00014 	sw	zero,20(sp)
    1974:	1180ffbe 	beqz	t4,1870 <rtl8139_set_rx_mode+0x54>
    1978:	00000000 	nop
    197c:	8da20084 	lw	v0,132(t5)
    1980:	00000000 	nop
    1984:	01c2102a 	slt	v0,t6,v0
    1988:	1040ffb9 	beqz	v0,1870 <rtl8139_set_rx_mode+0x54>
    198c:	3c0b04c1 	lui	t3,0x4c1
    1990:	25870004 	addiu	a3,t4,4
    1994:	2409ffff 	li	t1,-1
    1998:	240a0005 	li	t2,5
    199c:	356b1db7 	ori	t3,t3,0x1db7
    19a0:	90e60000 	lbu	a2,0(a3)
    19a4:	00000000 	nop
    19a8:	24080007 	li	t0,7
    19ac:	24e70001 	addiu	a3,a3,1
    19b0:	00092040 	sll	a0,t1,0x1
    19b4:	30c20001 	andi	v0,a2,0x1
    19b8:	008b2826 	xor	a1,a0,t3
    19bc:	0520002b 	bltz	t1,1a6c <rtl8139_set_rx_mode+0x250>
    19c0:	38430001 	xori	v1,v0,0x1
    19c4:	10400027 	beqz	v0,1a64 <rtl8139_set_rx_mode+0x248>
    19c8:	00000000 	nop
    19cc:	2508ffff 	addiu	t0,t0,-1
    19d0:	00a04821 	move	t1,a1
    19d4:	0501fff6 	bgez	t0,19b0 <rtl8139_set_rx_mode+0x194>
    19d8:	00063042 	srl	a2,a2,0x1
    19dc:	254affff 	addiu	t2,t2,-1
    19e0:	0541ffef 	bgez	t2,19a0 <rtl8139_set_rx_mode+0x184>
    19e4:	00052e82 	srl	a1,a1,0x1a
	int	mask;
	volatile int	*a = addr;
	__bi_flags;

	a += nr >> 5;
    19e8:	00051143 	sra	v0,a1,0x5
    19ec:	00021080 	sll	v0,v0,0x2
	mask = 1 << (nr & 0x1f);
    19f0:	30a5001f 	andi	a1,a1,0x1f
    19f4:	27a60010 	addiu	a2,sp,16
    19f8:	24040001 	li	a0,1
    19fc:	00c23021 	addu	a2,a2,v0
    1a00:	00a42004 	sllv	a0,a0,a1
	__bi_save_and_cli(flags);
    1a04:	40036000 	mfc0	v1,$12
    1a08:	00000000 	nop
    1a0c:	34610001 	ori	at,v1,0x1
    1a10:	38210001 	xori	at,at,0x1
    1a14:	40816000 	mtc0	at,$12
    1a18:	00000040 	sll	zero,zero,0x1
    1a1c:	00000040 	sll	zero,zero,0x1
    1a20:	00000040 	sll	zero,zero,0x1
	*a |= mask;
    1a24:	8cc20000 	lw	v0,0(a2)
    1a28:	00000000 	nop
    1a2c:	00441025 	or	v0,v0,a0
    1a30:	acc20000 	sw	v0,0(a2)
	__bi_restore_flags(flags);
    1a34:	40016000 	mfc0	at,$12
    1a38:	30630001 	andi	v1,v1,0x1
    1a3c:	34210001 	ori	at,at,0x1
    1a40:	38210001 	xori	at,at,0x1
    1a44:	00611825 	or	v1,v1,at
    1a48:	40836000 	mtc0	v1,$12
	...
    1a58:	8d8c0000 	lw	t4,0(t4)
    1a5c:	0800065d 	j	1974 <rtl8139_set_rx_mode+0x158>
    1a60:	25ce0001 	addiu	t6,t6,1
    1a64:	08000673 	j	19cc <rtl8139_set_rx_mode+0x1b0>
    1a68:	00802821 	move	a1,a0
    1a6c:	1460ffd7 	bnez	v1,19cc <rtl8139_set_rx_mode+0x1b0>
    1a70:	00000000 	nop
    1a74:	08000673 	j	19cc <rtl8139_set_rx_mode+0x1b0>
    1a78:	00802821 	move	a1,a0
    1a7c:	00000000 	nop
Disassembly of section .text.init:

00000000 <rtl8139_init_board>:
   0:	27bdffd8 	addiu	sp,sp,-40
   4:	afb3001c 	sw	s3,28(sp)
   8:	afb20018 	sw	s2,24(sp)
   c:	00a09821 	move	s3,a1
  10:	00c09021 	move	s2,a2
  14:	afb10014 	sw	s1,20(sp)
  18:	ae400000 	sw	zero,0(s2)
	__bi_flags;

	a += nr >> 5;
	mask = 1 << (nr & 0x1f);
	__bi_save_and_cli(flags);
  1c:	00808821 	move	s1,a0
  20:	ae600000 	sw	zero,0(s3)
  24:	00002021 	move	a0,zero
  28:	afb00010 	sw	s0,16(sp)
  2c:	afbf0020 	sw	ra,32(sp)
  30:	0c000000 	jal	0 <rtl8139_init_board>
  34:	240502b4 	li	a1,692
  38:	00408021 	move	s0,v0
	*a |= mask;
  3c:	1200004f 	beqz	s0,17c <rtl8139_init_board+0x17c>
  40:	24030011 	li	v1,17
  44:	8e040064 	lw	a0,100(s0)
  48:	00000000 	nop
	__bi_restore_flags(flags);
  4c:	00111080 	sll	v0,s1,0x2
  50:	24420022 	addiu	v0,v0,34
  54:	a08302ab 	sb	v1,683(a0)
  58:	a08202ac 	sb	v0,684(a0)
  5c:	24030033 	li	v1,51
  60:	24020044 	li	v0,68
  64:	a08302ad 	sb	v1,685(a0)
  68:	a08202ae 	sb	v0,686(a0)
  6c:	a08002aa 	sb	zero,682(a0)
  70:	a08002af 	sb	zero,687(a0)
  74:	848202aa 	lh	v0,682(a0)

extern __inline__ void
__cli(void)
{
	__asm__ __volatile__(
  78:	848302ac 	lh	v1,684(a0)
  7c:	848502ae 	lh	a1,686(a0)
  80:	a6020074 	sh	v0,116(s0)
  84:	a6030076 	sh	v1,118(s0)
  88:	a6050078 	sh	a1,120(s0)
  8c:	26060074 	addiu	a2,s0,116
  90:	00111300 	sll	v0,s1,0xc
  94:	3c040000 	lui	a0,0x0
  98:	24840008 	addiu	a0,a0,8
  9c:	02002821 	move	a1,s0
  a0:	0c000000 	jal	0 <rtl8139_init_board>
  a4:	24512000 	addiu	s1,v0,8192
  a8:	3c090000 	lui	t1,0x0
  ac:	8d290000 	lw	t1,0(t1)
  b0:	3c040010 	lui	a0,0x10
  b4:	01313821 	addu	a3,t1,s1
  b8:	8ce30000 	lw	v1,0(a3)
  bc:	00000000 	nop
  c0:	240803e8 	li	t0,1000
  c4:	00641825 	or	v1,v1,a0
  c8:	ace30000 	sw	v1,0(a3)
  cc:	8ce20000 	lw	v0,0(a3)
  d0:	00000000 	nop
  d4:	00441024 	and	v0,v0,a0
  d8:	10400026 	beqz	v0,174 <rtl8139_init_board+0x174>
  dc:	00e01821 	move	v1,a3
  e0:	3c060041 	lui	a2,0x41
  e4:	3c050000 	lui	a1,0x0
  e8:	8ca50000 	lw	a1,0(a1)
  ec:	01202021 	move	a0,t1
  f0:	34c68930 	ori	a2,a2,0x8930
  f4:	3c070010 	lui	a3,0x10
  f8:	00c50019 	multu	a2,a1
  fc:	00001010 	mfhi	v0
	...
 108:	1440ffff 	bnez	v0,108 <rtl8139_init_board+0x108>
 10c:	2442ffff 	addiu	v0,v0,-1
 110:	2508ffff 	addiu	t0,t0,-1
 114:	19000006 	blez	t0,130 <rtl8139_init_board+0x130>
 118:	00000000 	nop
 11c:	8c620000 	lw	v0,0(v1)
 120:	00000000 	nop
 124:	00471024 	and	v0,v0,a3
 128:	1440fff3 	bnez	v0,f8 <rtl8139_init_board+0xf8>
 12c:	00000000 	nop
 130:	00912021 	addu	a0,a0,s1
 134:	8c830000 	lw	v1,0(a0)
 138:	00000000 	nop
 13c:	3c02ffef 	lui	v0,0xffef
 140:	3442ffff 	ori	v0,v0,0xffff
 144:	00621824 	and	v1,v1,v0
 148:	ac830000 	sw	v1,0(a0)
 14c:	00001021 	move	v0,zero
 150:	ae510000 	sw	s1,0(s2)
 154:	ae700000 	sw	s0,0(s3)
 158:	8fbf0020 	lw	ra,32(sp)
 15c:	8fb3001c 	lw	s3,28(sp)
 160:	8fb20018 	lw	s2,24(sp)
 164:	8fb10014 	lw	s1,20(sp)
 168:	8fb00010 	lw	s0,16(sp)
 16c:	03e00008 	jr	ra
 170:	27bd0028 	addiu	sp,sp,40
 174:	0800004c 	j	130 <rtl8139_init_board+0x130>
 178:	01202021 	move	a0,t1
 17c:	3c040000 	lui	a0,0x0
 180:	2484002c 	addiu	a0,a0,44
 184:	0c000000 	jal	0 <rtl8139_init_board>
 188:	00000000 	nop
 18c:	08000056 	j	158 <rtl8139_init_board+0x158>
 190:	2402fff4 	li	v0,-12

00000194 <rtl8139_init_one>:
 194:	27bdffd0 	addiu	sp,sp,-48
 198:	27a50018 	addiu	a1,sp,24
 19c:	27a6001c 	addiu	a2,sp,28
 1a0:	afb10024 	sw	s1,36(sp)
 1a4:	afbf0028 	sw	ra,40(sp)
 1a8:	00808821 	move	s1,a0
 1ac:	afb00020 	sw	s0,32(sp)
 1b0:	afa00018 	sw	zero,24(sp)
 1b4:	0c000000 	jal	0 <rtl8139_init_board>
 1b8:	afa0001c 	sw	zero,28(sp)
 1bc:	00401821 	move	v1,v0
 1c0:	3c040000 	lui	a0,0x0
 1c4:	24840058 	addiu	a0,a0,88
 1c8:	0460005b 	bltz	v1,338 <rtl8139_init_one+0x1a4>
 1cc:	02202821 	move	a1,s1
 1d0:	3c020000 	lui	v0,0x0
 1d4:	8c420000 	lw	v0,0(v0)
 1d8:	8fa6001c 	lw	a2,28(sp)
 1dc:	00000000 	nop
 1e0:	00c23021 	addu	a2,a2,v0
 1e4:	8fa20018 	lw	v0,24(sp)
 1e8:	00000000 	nop
 1ec:	8c500064 	lw	s0,100(v0)
 1f0:	00000000 	nop
 1f4:	0c000000 	jal	0 <rtl8139_init_board>
 1f8:	00000000 	nop
 1fc:	8fa2001c 	lw	v0,28(sp)
 200:	00000000 	nop
 204:	3c040000 	lui	a0,0x0
 208:	2484007c 	addiu	a0,a0,124
 20c:	3c050000 	lui	a1,0x0
 210:	24a500a0 	addiu	a1,a1,160
 214:	3c060000 	lui	a2,0x0
 218:	24c600b0 	addiu	a2,a2,176
 21c:	3c070000 	lui	a3,0x0
 220:	24e700c0 	addiu	a3,a3,192
 224:	10400059 	beqz	v0,38c <rtl8139_init_one+0x1f8>
 228:	24020173 	li	v0,371
 22c:	8fa20018 	lw	v0,24(sp)
 230:	3c040000 	lui	a0,0x0
 234:	2484007c 	addiu	a0,a0,124
 238:	3c050000 	lui	a1,0x0
 23c:	24a500d4 	addiu	a1,a1,212
 240:	3c060000 	lui	a2,0x0
 244:	24c600b0 	addiu	a2,a2,176
 248:	3c070000 	lui	a3,0x0
 24c:	24e700c0 	addiu	a3,a3,192
 250:	1040004a 	beqz	v0,37c <rtl8139_init_one+0x1e8>
 254:	24020174 	li	v0,372
 258:	1200003c 	beqz	s0,34c <rtl8139_init_one+0x1b8>
 25c:	24020175 	li	v0,373
 260:	8fa30018 	lw	v1,24(sp)
 264:	3c040000 	lui	a0,0x0
 268:	248404b8 	addiu	a0,a0,1208
 26c:	ac6400e8 	sw	a0,232(v1)
 270:	8fa30018 	lw	v1,24(sp)
 274:	3c050000 	lui	a1,0x0
 278:	24a50974 	addiu	a1,a1,2420
 27c:	ac6500f0 	sw	a1,240(v1)
 280:	8fa30018 	lw	v1,24(sp)
 284:	3c040000 	lui	a0,0x0
 288:	248415e8 	addiu	a0,a0,5608
 28c:	ac6400ec 	sw	a0,236(v1)
 290:	8fa30018 	lw	v1,24(sp)
 294:	3c050000 	lui	a1,0x0
 298:	24a51770 	addiu	a1,a1,6000
 29c:	ac650044 	sw	a1,68(v1)
 2a0:	8fa30018 	lw	v1,24(sp)
 2a4:	3c040000 	lui	a0,0x0
 2a8:	2484181c 	addiu	a0,a0,6172
 2ac:	ac6400fc 	sw	a0,252(v1)
 2b0:	8fa30018 	lw	v1,24(sp)
 2b4:	3c050000 	lui	a1,0x0
 2b8:	24a51768 	addiu	a1,a1,5992
 2bc:	ac650104 	sw	a1,260(v1)
 2c0:	8fa30018 	lw	v1,24(sp)
 2c4:	3c040000 	lui	a0,0x0
 2c8:	24840948 	addiu	a0,a0,2376
 2cc:	ac640118 	sw	a0,280(v1)
 2d0:	8fa30018 	lw	v1,24(sp)
 2d4:	24050258 	li	a1,600
 2d8:	ac650090 	sw	a1,144(v1)
 2dc:	8fa40018 	lw	a0,24(sp)
 2e0:	26260005 	addiu	a2,s1,5
 2e4:	ac860024 	sw	a2,36(a0)
 2e8:	8fa5001c 	lw	a1,28(sp)
 2ec:	8fa30018 	lw	v1,24(sp)
 2f0:	00000000 	nop
 2f4:	00001021 	move	v0,zero
 2f8:	ac650020 	sw	a1,32(v1)
 2fc:	8fa40018 	lw	a0,24(sp)
 300:	00000000 	nop
 304:	8c8300dc 	lw	v1,220(a0)
 308:	00000000 	nop
 30c:	34630002 	ori	v1,v1,0x2
 310:	ac8300dc 	sw	v1,220(a0)
 314:	8fa30018 	lw	v1,24(sp)
 318:	00000000 	nop
 31c:	8fa5001c 	lw	a1,28(sp)
 320:	00000000 	nop
 324:	8c700064 	lw	s0,100(v1)
 328:	00000000 	nop
 32c:	24040020 	li	a0,32
 330:	a20402a4 	sb	a0,676(s0)
 334:	ae050000 	sw	a1,0(s0)
 338:	8fbf0028 	lw	ra,40(sp)
 33c:	8fb10024 	lw	s1,36(sp)
 340:	8fb00020 	lw	s0,32(sp)
 344:	03e00008 	jr	ra
 348:	27bd0030 	addiu	sp,sp,48
 34c:	3c040000 	lui	a0,0x0
 350:	2484007c 	addiu	a0,a0,124
 354:	3c050000 	lui	a1,0x0
 358:	24a500e0 	addiu	a1,a1,224
 35c:	3c060000 	lui	a2,0x0
 360:	24c600b0 	addiu	a2,a2,176
 364:	3c070000 	lui	a3,0x0
 368:	24e700c0 	addiu	a3,a3,192
 36c:	0c000000 	jal	0 <rtl8139_init_board>
 370:	afa20010 	sw	v0,16(sp)
 374:	08000098 	j	260 <rtl8139_init_one+0xcc>
 378:	00000000 	nop
 37c:	0c000000 	jal	0 <rtl8139_init_board>
 380:	afa20010 	sw	v0,16(sp)
 384:	08000096 	j	258 <rtl8139_init_one+0xc4>
 388:	00000000 	nop
 38c:	0c000000 	jal	0 <rtl8139_init_board>
 390:	afa20010 	sw	v0,16(sp)
 394:	0800008b 	j	22c <rtl8139_init_one+0x98>
 398:	00000000 	nop

0000039c <rtl8139_init_all>:
 39c:	27bdffe8 	addiu	sp,sp,-24
 3a0:	afbf0010 	sw	ra,16(sp)
 3a4:	0c000065 	jal	194 <rtl8139_init_one>
 3a8:	00002021 	move	a0,zero
 3ac:	0c000065 	jal	194 <rtl8139_init_one>
 3b0:	24040001 	li	a0,1
 3b4:	8fbf0010 	lw	ra,16(sp)
 3b8:	00000000 	nop
 3bc:	03e00008 	jr	ra
 3c0:	27bd0018 	addiu	sp,sp,24
