
8139too_ap.o:     file format elf32-tradbigmips

Disassembly of section .text:

00000000 <rtl8139_quick_reset>:
       0:	27bdffe0 	addiu	sp,sp,-32
       4:	afbf001c 	sw	ra,28(sp)
       8:	afb20018 	sw	s2,24(sp)
       c:	afb10014 	sw	s1,20(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:	0c000173 	jal	5cc <rtl8139_txrx_stop>
      9c:	02202021 	move	a0,s1
    rtl8139_sw_free(tp);
      a0:	0c0000b7 	jal	2dc <rtl8139_sw_free>
      a4:	02202021 	move	a0,s1
    rtl8139_sw_init(tp);
      a8:	0c000047 	jal	11c <rtl8139_sw_init>
      ac:	02202021 	move	a0,s1
    rtl8139_hw_start (dev);
      b0:	0c000189 	jal	624 <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:	00c53025 	or	a2,a2,a1
      f8:	3c023000 	lui	v0,0x3000
      fc:	00c23025 	or	a2,a2,v0
	
	if ( index == NUM_DESC - 1)	
     100:	2402003f 	li	v0,63
     104:	14e20002 	bne	a3,v0,110 <SetOwnByNic+0x1c>
     108:	3c024000 	lui	v0,0x4000
		tmp |= ENDOFRING;
     10c:	00c23025 	or	a2,a2,v0
	
	*(volatile unsigned long *)header = tmp;
     110:	ac860000 	sw	a2,0(a0)
	

}
     114:	03e00008 	jr	ra
     118:	00000000 	nop

0000011c <rtl8139_sw_init>:
     11c:	27bdffd8 	addiu	sp,sp,-40
     120:	afbf0020 	sw	ra,32(sp)
     124:	afb3001c 	sw	s3,28(sp)
     128:	afb20018 	sw	s2,24(sp)
     12c:	afb10014 	sw	s1,20(sp)
     130:	afb00010 	sw	s0,16(sp)
     134:	00809021 	move	s2,a0
     138:	24041000 	li	a0,4096
     13c:	0c000000 	jal	0 <rtl8139_quick_reset>
     140:	240501f0 	li	a1,496
     144:	ae420090 	sw	v0,144(s2)
     148:	24420800 	addiu	v0,v0,2048
     14c:	ae4201a0 	sw	v0,416(s2)
     150:	ae40008c 	sw	zero,140(s2)
     154:	00008821 	move	s1,zero
     158:	26500004 	addiu	s0,s2,4
     15c:	3c131fff 	lui	s3,0x1fff
     160:	3673ffff 	ori	s3,s3,0xffff
     164:	8e420090 	lw	v0,144(s2)
     168:	00111900 	sll	v1,s1,0x4
     16c:	00621821 	addu	v1,v1,v0
     170:	00111080 	sll	v0,s1,0x2
     174:	00501021 	addu	v0,v0,s0
     178:	ac400090 	sw	zero,144(v0)
     17c:	ac600000 	sw	zero,0(v1)
     180:	24040650 	li	a0,1616
     184:	0c000000 	jal	0 <rtl8139_quick_reset>
     188:	24050020 	li	a1,32
     18c:	00401821 	move	v1,v0
     190:	10600009 	beqz	v1,1b8 <rtl8139_sw_init+0x9c>
     194:	00602821 	move	a1,v1
     198:	8c620080 	lw	v0,128(v1)
     19c:	00000000 	nop
     1a0:	24420010 	addiu	v0,v0,16
     1a4:	ac620080 	sw	v0,128(v1)
     1a8:	8c620084 	lw	v0,132(v1)
     1ac:	00000000 	nop
     1b0:	24420010 	addiu	v0,v0,16
     1b4:	ac620084 	sw	v0,132(v1)
     1b8:	10a00041 	beqz	a1,2c0 <rtl8139_sw_init+0x1a4>
     1bc:	24020001 	li	v0,1
     1c0:	8ca20080 	lw	v0,128(a1)
     1c4:	00000000 	nop
     1c8:	24420002 	addiu	v0,v0,2
     1cc:	aca20080 	sw	v0,128(a1)
     1d0:	8ca20084 	lw	v0,132(a1)
     1d4:	00000000 	nop
     1d8:	24420002 	addiu	v0,v0,2
     1dc:	aca20084 	sw	v0,132(a1)
     1e0:	00111080 	sll	v0,s1,0x2
     1e4:	00501021 	addu	v0,v0,s0
     1e8:	ac450090 	sw	a1,144(v0)
     1ec:	8e430090 	lw	v1,144(s2)
     1f0:	00112100 	sll	a0,s1,0x4
     1f4:	00831821 	addu	v1,a0,v1
     1f8:	8ca20080 	lw	v0,128(a1)
     1fc:	00000000 	nop
     200:	00531024 	and	v0,v0,s3
     204:	ac620008 	sw	v0,8(v1)
     208:	8e420090 	lw	v0,144(s2)
     20c:	00000000 	nop
     210:	00821021 	addu	v0,a0,v0
     214:	ac400004 	sw	zero,4(v0)
     218:	8e420090 	lw	v0,144(s2)
     21c:	00000000 	nop
     220:	00821021 	addu	v0,a0,v0
     224:	ac40000c 	sw	zero,12(v0)
     228:	8e420090 	lw	v0,144(s2)
     22c:	00000000 	nop
     230:	00822021 	addu	a0,a0,v0
     234:	24050640 	li	a1,1600
     238:	3c068000 	lui	a2,0x8000
     23c:	0c00003d 	jal	f4 <SetOwnByNic>
     240:	02203821 	move	a3,s1
     244:	26310001 	addiu	s1,s1,1
     248:	2a220040 	slti	v0,s1,64
     24c:	1440ffc5 	bnez	v0,164 <rtl8139_sw_init+0x48>
     250:	00000000 	nop
     254:	ae40019c 	sw	zero,412(s2)
     258:	ae400198 	sw	zero,408(s2)
     25c:	00008821 	move	s1,zero
     260:	00118100 	sll	s0,s1,0x4
     264:	8e4401a0 	lw	a0,416(s2)
     268:	00000000 	nop
     26c:	02042021 	addu	a0,s0,a0
     270:	24050640 	li	a1,1600
     274:	00003021 	move	a2,zero
     278:	0c00003d 	jal	f4 <SetOwnByNic>
     27c:	02203821 	move	a3,s1
     280:	8e4201a0 	lw	v0,416(s2)
     284:	00000000 	nop
     288:	02021021 	addu	v0,s0,v0
     28c:	ac400004 	sw	zero,4(v0)
     290:	8e4201a0 	lw	v0,416(s2)
     294:	00000000 	nop
     298:	02021021 	addu	v0,s0,v0
     29c:	ac40000c 	sw	zero,12(v0)
     2a0:	8e4201a0 	lw	v0,416(s2)
     2a4:	00000000 	nop
     2a8:	02028021 	addu	s0,s0,v0
     2ac:	26310001 	addiu	s1,s1,1
     2b0:	2a220040 	slti	v0,s1,64
     2b4:	1440ffea 	bnez	v0,260 <rtl8139_sw_init+0x144>
     2b8:	ae000008 	sw	zero,8(s0)
     2bc:	00001021 	move	v0,zero
     2c0:	8fbf0020 	lw	ra,32(sp)
     2c4:	8fb3001c 	lw	s3,28(sp)
     2c8:	8fb20018 	lw	s2,24(sp)
     2cc:	8fb10014 	lw	s1,20(sp)
     2d0:	8fb00010 	lw	s0,16(sp)
     2d4:	03e00008 	jr	ra
     2d8:	27bd0028 	addiu	sp,sp,40

000002dc <rtl8139_sw_free>:
     2dc:	27bdffd8 	addiu	sp,sp,-40
     2e0:	afbf0020 	sw	ra,32(sp)
     2e4:	afb3001c 	sw	s3,28(sp)
     2e8:	afb20018 	sw	s2,24(sp)
     2ec:	afb10014 	sw	s1,20(sp)
     2f0:	afb00010 	sw	s0,16(sp)
     2f4:	00808821 	move	s1,a0
     2f8:	00008021 	move	s0,zero
     2fc:	26320004 	addiu	s2,s1,4
     300:	24130001 	li	s3,1
     304:	00101080 	sll	v0,s0,0x2
     308:	00521021 	addu	v0,v0,s2
     30c:	8c440090 	lw	a0,144(v0)
     310:	00000000 	nop
     314:	10800020 	beqz	a0,398 <rtl8139_sw_free+0xbc>
     318:	00000000 	nop
     31c:	8c820070 	lw	v0,112(a0)
     320:	00000000 	nop
     324:	1053001a 	beq	v0,s3,390 <rtl8139_sw_free+0xb4>
     328:	00000000 	nop
     32c:	40036000 	mfc0	v1,$12
     330:	00000000 	nop
     334:	40016000 	mfc0	at,$12
     338:	00000000 	nop
     33c:	34210001 	ori	at,at,0x1
     340:	38210001 	xori	at,at,0x1
     344:	40816000 	mtc0	at,$12
     348:	00000040 	sll	zero,zero,0x1
     34c:	00000040 	sll	zero,zero,0x1
     350:	00000040 	sll	zero,zero,0x1
     354:	8c820070 	lw	v0,112(a0)
     358:	00000000 	nop
     35c:	2442ffff 	addiu	v0,v0,-1
     360:	ac820070 	sw	v0,112(a0)
     364:	40016000 	mfc0	at,$12
     368:	30630001 	andi	v1,v1,0x1
     36c:	34210001 	ori	at,at,0x1
     370:	38210001 	xori	at,at,0x1
     374:	00611825 	or	v1,v1,at
     378:	40836000 	mtc0	v1,$12
	...
     388:	14400003 	bnez	v0,398 <rtl8139_sw_free+0xbc>
     38c:	00000000 	nop
     390:	0c000000 	jal	0 <rtl8139_quick_reset>
     394:	00000000 	nop
     398:	00102100 	sll	a0,s0,0x4
     39c:	8e220090 	lw	v0,144(s1)
     3a0:	00000000 	nop
     3a4:	00822021 	addu	a0,a0,v0
     3a8:	24050640 	li	a1,1600
     3ac:	00003021 	move	a2,zero
     3b0:	0c00003d 	jal	f4 <SetOwnByNic>
     3b4:	02003821 	move	a3,s0
     3b8:	26100001 	addiu	s0,s0,1
     3bc:	2a020040 	slti	v0,s0,64
     3c0:	1440ffd1 	bnez	v0,308 <rtl8139_sw_free+0x2c>
     3c4:	00101080 	sll	v0,s0,0x2
     3c8:	00008021 	move	s0,zero
     3cc:	26320004 	addiu	s2,s1,4
     3d0:	24130001 	li	s3,1
     3d4:	00101080 	sll	v0,s0,0x2
     3d8:	00521021 	addu	v0,v0,s2
     3dc:	8c4401a0 	lw	a0,416(v0)
     3e0:	00000000 	nop
     3e4:	10800020 	beqz	a0,468 <rtl8139_sw_free+0x18c>
     3e8:	00000000 	nop
     3ec:	8c820070 	lw	v0,112(a0)
     3f0:	00000000 	nop
     3f4:	1053001a 	beq	v0,s3,460 <rtl8139_sw_free+0x184>
     3f8:	00000000 	nop
     3fc:	40036000 	mfc0	v1,$12
     400:	00000000 	nop
     404:	40016000 	mfc0	at,$12
     408:	00000000 	nop
     40c:	34210001 	ori	at,at,0x1
     410:	38210001 	xori	at,at,0x1
     414:	40816000 	mtc0	at,$12
     418:	00000040 	sll	zero,zero,0x1
     41c:	00000040 	sll	zero,zero,0x1
     420:	00000040 	sll	zero,zero,0x1
     424:	8c820070 	lw	v0,112(a0)
     428:	00000000 	nop
     42c:	2442ffff 	addiu	v0,v0,-1
     430:	ac820070 	sw	v0,112(a0)
     434:	40016000 	mfc0	at,$12
     438:	30630001 	andi	v1,v1,0x1
     43c:	34210001 	ori	at,at,0x1
     440:	38210001 	xori	at,at,0x1
     444:	00611825 	or	v1,v1,at
     448:	40836000 	mtc0	v1,$12
	...
     458:	14400003 	bnez	v0,468 <rtl8139_sw_free+0x18c>
     45c:	00000000 	nop
     460:	0c000000 	jal	0 <rtl8139_quick_reset>
     464:	00000000 	nop
     468:	00102100 	sll	a0,s0,0x4
     46c:	8e2201a0 	lw	v0,416(s1)
     470:	00000000 	nop
     474:	00822021 	addu	a0,a0,v0
     478:	24050640 	li	a1,1600
     47c:	00003021 	move	a2,zero
     480:	0c00003d 	jal	f4 <SetOwnByNic>
     484:	02003821 	move	a3,s0
     488:	26100001 	addiu	s0,s0,1
     48c:	2a020040 	slti	v0,s0,64
     490:	1440ffd1 	bnez	v0,3d8 <rtl8139_sw_free+0xfc>
     494:	00101080 	sll	v0,s0,0x2
     498:	8e240090 	lw	a0,144(s1)
     49c:	0c000000 	jal	0 <rtl8139_quick_reset>
     4a0:	00000000 	nop
     4a4:	00001021 	move	v0,zero
     4a8:	8fbf0020 	lw	ra,32(sp)
     4ac:	8fb3001c 	lw	s3,28(sp)
     4b0:	8fb20018 	lw	s2,24(sp)
     4b4:	8fb10014 	lw	s1,20(sp)
     4b8:	8fb00010 	lw	s0,16(sp)
     4bc:	03e00008 	jr	ra
     4c0:	27bd0028 	addiu	sp,sp,40

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


// 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;
     4d8:	8e300064 	lw	s0,100(s1)
     4dc:	00000000 	nop
	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);
     4e0:	afb10010 	sw	s1,16(sp)
     4e4:	8e240024 	lw	a0,36(s1)
     4e8:	3c050000 	lui	a1,0x0
     4ec:	24a5149c 	addiu	a1,a1,5276
     4f0:	3c062000 	lui	a2,0x2000
     4f4:	0c000000 	jal	0 <rtl8139_quick_reset>
     4f8:	02203821 	move	a3,s1
     4fc:	00401821 	move	v1,v0
	if (retval) {
     500:	1460002d 	bnez	v1,5b8 <rtl8139_open+0xf4>
     504:	00000000 	nop
		DPRINTK ("EXIT, returning %d\n", retval);
		MOD_DEC_USE_COUNT;
		return retval;
	}

	//sw init
	if (rtl8139_sw_init(tp))
     508:	0c000047 	jal	11c <rtl8139_sw_init>
     50c:	02002021 	move	a0,s0
     510:	10400007 	beqz	v0,530 <rtl8139_open+0x6c>
     514:	00000000 	nop
	{		
		printk("sw init %s error! no memory!\n",dev->name);
     518:	3c040000 	lui	a0,0x0
     51c:	248400ec 	addiu	a0,a0,236
     520:	0c000000 	jal	0 <rtl8139_quick_reset>
     524:	02202821 	move	a1,s1
		return -ENOMEM;
     528:	0800016e 	j	5b8 <rtl8139_open+0xf4>
     52c:	2402fff4 	li	v0,-12
	}
	

	tp->full_duplex = tp->duplex_lock;
     530:	8e0202a8 	lw	v0,680(s0)
     534:	00000000 	nop
     538:	00021f82 	srl	v1,v0,0x1e
     53c:	00031fc0 	sll	v1,v1,0x1f
     540:	3c047fff 	lui	a0,0x7fff
     544:	3484ffff 	ori	a0,a0,0xffff
     548:	00441024 	and	v0,v0,a0
     54c:	00431025 	or	v0,v0,v1
     550:	ae0202a8 	sw	v0,680(s0)

	rtl8139_hw_start (dev);
     554:	0c000189 	jal	624 <rtl8139_hw_start>
     558:	02202021 	move	a0,s1
extern void it_real_fn(unsigned long);

static inline void init_timer(struct timer_list * timer)
{
	timer->list.next = timer->list.prev = NULL;
     55c:	ae000064 	sw	zero,100(s0)
     560:	ae000060 	sw	zero,96(s0)


	/* 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;
     564:	3c020000 	lui	v0,0x0
     568:	8c420000 	lw	v0,0(v0)
     56c:	00000000 	nop
     570:	24420003 	addiu	v0,v0,3
     574:	ae020068 	sw	v0,104(s0)
	tp->timer.data = (unsigned long) dev;
     578:	ae11006c 	sw	s1,108(s0)
	tp->timer.function = &rtl8139_timer;
     57c:	3c020000 	lui	v0,0x0
     580:	24420808 	addiu	v0,v0,2056
     584:	ae020070 	sw	v0,112(s0)
extern void it_real_fn(unsigned long);

static inline void init_timer(struct timer_list * timer)
{
	timer->list.next = timer->list.prev = NULL;
     588:	ae000078 	sw	zero,120(s0)
     58c:	ae000074 	sw	zero,116(s0)
	init_timer (&tp->rxtimer);
    tp->rxtimer.expires = jiffies + 10;
     590:	3c020000 	lui	v0,0x0
     594:	8c420000 	lw	v0,0(v0)
     598:	00000000 	nop
     59c:	2442000a 	addiu	v0,v0,10
     5a0:	ae02007c 	sw	v0,124(s0)
    tp->rxtimer.data = (unsigned long) dev;
     5a4:	ae110080 	sw	s1,128(s0)
    tp->rxtimer.function = &rtl8139_rxtimer;
     5a8:	3c020000 	lui	v0,0x0
     5ac:	244208e0 	addiu	v0,v0,2272
     5b0:	ae020084 	sw	v0,132(s0)

	//add_timer (&tp->timer);

	DPRINTK ("EXIT, returning 0\n");
	return 0;
     5b4:	00001021 	move	v0,zero
}
     5b8:	8fbf0020 	lw	ra,32(sp)
     5bc:	8fb1001c 	lw	s1,28(sp)
     5c0:	8fb00018 	lw	s0,24(sp)
     5c4:	03e00008 	jr	ra
     5c8:	27bd0028 	addiu	sp,sp,40

000005cc <rtl8139_txrx_stop>:

static void rtl8139_txrx_stop (struct rtl8139_private *tp)
{
	void *ioaddr = tp->mmio_addr;
     5cc:	8c830000 	lw	v1,0(a0)
     5d0:	00000000 	nop
}

static inline unsigned int inl(unsigned long port)
{
	return __ioswab32(*(volatile u32 *)(mips_io_port_base + port));
     5d4:	3c020000 	lui	v0,0x0
     5d8:	8c420000 	lw	v0,0(v0)
     5dc:	00000000 	nop
     5e0:	00431021 	addu	v0,v0,v1
     5e4:	8c430000 	lw	v1,0(v0)
     5e8:	00000000 	nop
 
	RTL_W32 (NIC_CNR1, (RTL_R32 (NIC_CNR1)) & ((~RxEnable) | (~TxEnable)) );
     5ec:	ac430000 	sw	v1,0(v0)
 * first constant multiplications gets optimized away if the delay is
 * a constant)
 */
extern __inline__ void __udelay(unsigned long usecs, unsigned long lpj)
{
     5f0:	3c030000 	lui	v1,0x0
     5f4:	8c630000 	lw	v1,0(v1)
     5f8:	00000000 	nop
	unsigned long lo;

	usecs *= 0x00068db8;		/* 2**32 / (1000000 / HZ) */
     5fc:	3c02028f 	lui	v0,0x28f
     600:	34425be0 	ori	v0,v0,0x5be0
	__asm__("multu\t%2,%3"
     604:	00430019 	multu	v0,v1
     608:	00001010 	mfhi	v0
	...
     614:	1440ffff 	bnez	v0,614 <rtl8139_txrx_stop+0x48>
     618:	2442ffff 	addiu	v0,v0,-1
	udelay (100);
} 
     61c:	03e00008 	jr	ra
     620:	00000000 	nop

00000624 <rtl8139_hw_start>:
     624:	27bdffd8 	addiu	sp,sp,-40
     628:	afbf0020 	sw	ra,32(sp)
     62c:	afb3001c 	sw	s3,28(sp)
     630:	afb20018 	sw	s2,24(sp)
     634:	afb10014 	sw	s1,20(sp)
     638:	afb00010 	sw	s0,16(sp)
     63c:	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;
     640:	8e720064 	lw	s2,100(s3)
     644:	00000000 	nop
	void *ioaddr = tp->mmio_addr;
     648:	8e510000 	lw	s1,0(s2)
     64c:	00000000 	nop

	DPRINTK ("ENTER\n");
	/* Stop txrx first */
	
	rtl8139_txrx_stop (tp);
     650:	0c000173 	jal	5cc <rtl8139_txrx_stop>
     654:	02402021 	move	a0,s2

	/* Soft reset the chip. */
	RTL_W32 (NIC_CNR1, (RTL_R32 (NIC_CNR1) | Reset));
     658:	3c030000 	lui	v1,0x0
     65c:	8c630000 	lw	v1,0(v1)
     660:	00000000 	nop
     664:	00711821 	addu	v1,v1,s1
}

static inline unsigned int inl(unsigned long port)
{
	return __ioswab32(*(volatile u32 *)(mips_io_port_base + port));
     668:	8c620000 	lw	v0,0(v1)
     66c:	00000000 	nop
     670:	3c040010 	lui	a0,0x10
     674:	00441025 	or	v0,v0,a0
     678:	ac620000 	sw	v0,0(v1)

	/* Check that the chip has finished the reset. */
	for (i = 1000; i > 0; i--)
     67c:	240303e8 	li	v1,1000
     680:	3c020000 	lui	v0,0x0
     684:	8c420000 	lw	v0,0(v0)
     688:	00000000 	nop
     68c:	00512021 	addu	a0,v0,s1
     690:	3c050010 	lui	a1,0x10
}

static inline unsigned int inl(unsigned long port)
{
	return __ioswab32(*(volatile u32 *)(mips_io_port_base + port));
     694:	8c820000 	lw	v0,0(a0)
     698:	00000000 	nop
		if ((RTL_R32 (NIC_CNR1) & Reset) == 0)
     69c:	00451024 	and	v0,v0,a1
     6a0:	10400003 	beqz	v0,6b0 <rtl8139_hw_start+0x8c>
     6a4:	2463ffff 	addiu	v1,v1,-1
     6a8:	1460fffa 	bnez	v1,694 <rtl8139_hw_start+0x70>
     6ac:	00000000 	nop
			break;

	// force Reset bit to be 0
	RTL_W32 (NIC_CNR1, (RTL_R32 (NIC_CNR1)  & (~Reset)));
     6b0:	3c050000 	lui	a1,0x0
     6b4:	8ca50000 	lw	a1,0(a1)
     6b8:	00000000 	nop
     6bc:	00b12021 	addu	a0,a1,s1
}

static inline unsigned int inl(unsigned long port)
{
	return __ioswab32(*(volatile u32 *)(mips_io_port_base + port));
     6c0:	8c820000 	lw	v0,0(a0)
     6c4:	00000000 	nop
     6c8:	3c03ffef 	lui	v1,0xffef
     6cc:	3463ffff 	ori	v1,v1,0xffff
     6d0:	00431024 	and	v0,v0,v1
     6d4:	ac820000 	sw	v0,0(a0)


	// Force MII register to  reflect the current status of phy
	RTL_W32(NIC_MII, 0x210000);	
     6d8:	3c020021 	lui	v0,0x21
     6dc:	ac820038 	sw	v0,56(a0)
	RTL_W32(NIC_MII, 0x16000);
     6e0:	3c020001 	lui	v0,0x1
     6e4:	34426000 	ori	v0,v0,0x6000
     6e8:	ac820038 	sw	v0,56(a0)
	//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)
     6ec:	24022000 	li	v0,8192
     6f0:	16220006 	bne	s1,v0,70c <rtl8139_hw_start+0xe8>
     6f4:	3c033326 	lui	v1,0x3326
	
		RTL_W32_F (NIC_ID + 0, 0x33221100);
     6f8:	3c023322 	lui	v0,0x3322
     6fc:	34421100 	ori	v0,v0,0x1100
     700:	aca22004 	sw	v0,8196(a1)
     704:	080001c9 	j	724 <rtl8139_hw_start+0x100>
     708:	00000000 	nop
	else
		RTL_W32_F (NIC_ID + 0, 0x33261100);
     70c:	3c020000 	lui	v0,0x0
     710:	8c420000 	lw	v0,0(v0)
     714:	00000000 	nop
     718:	00511021 	addu	v0,v0,s1
     71c:	34631100 	ori	v1,v1,0x1100
     720:	ac430004 	sw	v1,4(v0)

	//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);
     724:	3c100000 	lui	s0,0x0
     728:	8e100000 	lw	s0,0(s0)
     72c:	00000000 	nop
     730:	02118021 	addu	s0,s0,s1
     734:	24020044 	li	v0,68
     738:	ae020008 	sw	v0,8(s0)

	
	/* Must enable Tx/Rx before setting transfer thresholds! */
	RTL_W32_F (NIC_CNR1, RxEnable | TxEnable );
     73c:	3c02000c 	lui	v0,0xc
     740:	ae020000 	sw	v0,0(s0)
}

static inline unsigned int inl(unsigned long port)
{
	return __ioswab32(*(volatile u32 *)(mips_io_port_base + port));
     744:	8e020000 	lw	v0,0(s0)
     748:	00000000 	nop
	RTL_W32_F (NIC_CNR1, RTL_R32(NIC_CNR1) | rtl8139_trx_config); 
     74c:	3c035000 	lui	v1,0x5000
     750:	34632000 	ori	v1,v1,0x2000
     754:	00431025 	or	v0,v0,v1
     758:	ae020000 	sw	v0,0(s0)
			    

	rtl8139_set_rx_mode (dev);
     75c:	0c000617 	jal	185c <rtl8139_set_rx_mode>
     760:	02602021 	move	a0,s3

	// fill the base address of tx/rx descriptors!
	RTL_W32_F(NIC_TSAD,Virtual2Physical(tp->tx_desc));
     764:	8e4201a0 	lw	v0,416(s2)
     768:	3c031fff 	lui	v1,0x1fff
     76c:	3463ffff 	ori	v1,v1,0xffff
     770:	00431024 	and	v0,v0,v1
     774:	ae020014 	sw	v0,20(s0)
	RTL_W32_F(NIC_RSAD,Virtual2Physical(tp->rx_desc));
     778:	8e420090 	lw	v0,144(s2)
     77c:	00000000 	nop
     780:	00431024 	and	v0,v0,v1
     784:	ae020018 	sw	v0,24(s0)

	tp->intr_mask = rtl8139_intr_mask;
     788:	24020272 	li	v0,626
     78c:	ae420088 	sw	v0,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);
     790:	ae020020 	sw	v0,32(s0)
	RTL_W32(NIC_RXERR, 0x0);
     794:	ae000088 	sw	zero,136(s0)
	__bi_flags;

	a += nr >> 5;
	mask = 1 << (nr & 0x1f);
	__bi_save_and_cli(flags);
     798:	40046000 	mfc0	a0,$12
     79c:	00000000 	nop
     7a0:	34810001 	ori	at,a0,0x1
     7a4:	38210001 	xori	at,at,0x1
     7a8:	40816000 	mtc0	at,$12
     7ac:	00000040 	sll	zero,zero,0x1
     7b0:	00000040 	sll	zero,zero,0x1
     7b4:	00000040 	sll	zero,zero,0x1
	*a &= ~mask;
     7b8:	8e62002c 	lw	v0,44(s3)
     7bc:	2403fffe 	li	v1,-2
     7c0:	00431024 	and	v0,v0,v1
     7c4:	ae62002c 	sw	v0,44(s3)
	__bi_restore_flags(flags);
     7c8:	40016000 	mfc0	at,$12
     7cc:	30840001 	andi	a0,a0,0x1
     7d0:	34210001 	ori	at,at,0x1
     7d4:	38210001 	xori	at,at,0x1
     7d8:	00812025 	or	a0,a0,at
     7dc:	40846000 	mtc0	a0,$12
	...
	netif_start_queue (dev);

	DPRINTK ("EXIT\n");
}
     7ec:	8fbf0020 	lw	ra,32(sp)
     7f0:	8fb3001c 	lw	s3,28(sp)
     7f4:	8fb20018 	lw	s2,24(sp)
     7f8:	8fb10014 	lw	s1,20(sp)
     7fc:	8fb00010 	lw	s0,16(sp)
     800:	03e00008 	jr	ra
     804:	27bd0028 	addiu	sp,sp,40

00000808 <rtl8139_timer>:
     808:	27bdffe0 	addiu	sp,sp,-32
     80c:	afbf0018 	sw	ra,24(sp)
     810:	afb10014 	sw	s1,20(sp)
     814:	afb00010 	sw	s0,16(sp)
     818:	00808821 	move	s1,a0

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;
     81c:	8e300064 	lw	s0,100(s1)
     820:	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);
     824:	0c000000 	jal	0 <rtl8139_quick_reset>
     828:	00002021 	move	a0,zero
	if (softnet_data[this_cpu].cng_level != NET_RX_SUCCESS)
     82c:	3c020000 	lui	v0,0x0
     830:	8c420004 	lw	v0,4(v0)
     834:	00000000 	nop
     838:	1040000c 	beqz	v0,86c <rtl8139_timer+0x64>
     83c:	00000000 	nop
	{
		printk("timer check shows still congested network traffic for %s\n"
     840:	3c040000 	lui	a0,0x0
     844:	2484010c 	addiu	a0,a0,268
     848:	0c000000 	jal	0 <rtl8139_quick_reset>
     84c:	02202821 	move	a1,s1
			, dev->name);
		//add_timer(&tp->timer);
		mod_timer(&tp->timer, jiffies + 3);
     850:	26040060 	addiu	a0,s0,96
     854:	3c050000 	lui	a1,0x0
     858:	8ca50000 	lw	a1,0(a1)
     85c:	0c000000 	jal	0 <rtl8139_quick_reset>
     860:	24a50003 	addiu	a1,a1,3
     864:	08000233 	j	8cc <rtl8139_timer+0xc4>
     868:	00000000 	nop
	}else
	{
		printk("timer check success!\n");
     86c:	3c040000 	lui	a0,0x0
     870:	24840148 	addiu	a0,a0,328
     874:	0c000000 	jal	0 <rtl8139_quick_reset>
     878:	00000000 	nop
		save_flags(flags);cli();
     87c:	40026000 	mfc0	v0,$12
     880:	00000000 	nop

extern __inline__ void
__cli(void)
{
	__asm__ __volatile__(
     884:	40016000 	mfc0	at,$12
     888:	00000000 	nop
     88c:	34210001 	ori	at,at,0x1
     890:	38210001 	xori	at,at,0x1
     894:	40816000 	mtc0	at,$12
     898:	00000040 	sll	zero,zero,0x1
     89c:	00000040 	sll	zero,zero,0x1
     8a0:	00000040 	sll	zero,zero,0x1
		tp->netrxdrop = FALSE;
     8a4:	ae0002b0 	sw	zero,688(s0)
		restore_flags(flags);
     8a8:	40016000 	mfc0	at,$12
     8ac:	30420001 	andi	v0,v0,0x1
     8b0:	34210001 	ori	at,at,0x1
     8b4:	38210001 	xori	at,at,0x1
     8b8:	00411025 	or	v0,v0,at
     8bc:	40826000 	mtc0	v0,$12
	...
	}	  
}
     8cc:	8fbf0018 	lw	ra,24(sp)
     8d0:	8fb10014 	lw	s1,20(sp)
     8d4:	8fb00010 	lw	s0,16(sp)
     8d8:	03e00008 	jr	ra
     8dc:	27bd0020 	addiu	sp,sp,32

000008e0 <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;
     8e0:	8c820064 	lw	v0,100(a0)
     8e4:	00000000 	nop
	void *ioaddr = tp->mmio_addr;
     8e8:	8c450000 	lw	a1,0(v0)
     8ec:	00000000 	nop
	save_flags(flags);cli();
     8f0:	40046000 	mfc0	a0,$12
     8f4:	00000000 	nop

extern __inline__ void
__cli(void)
{
	__asm__ __volatile__(
     8f8:	40016000 	mfc0	at,$12
     8fc:	00000000 	nop
     900:	34210001 	ori	at,at,0x1
     904:	38210001 	xori	at,at,0x1
     908:	40816000 	mtc0	at,$12
     90c:	00000040 	sll	zero,zero,0x1
     910:	00000040 	sll	zero,zero,0x1
     914:	00000040 	sll	zero,zero,0x1
	tp->intr_mask |= (RxFFOvMask | RxDescUnMask);
     918:	8c430088 	lw	v1,136(v0)
     91c:	00000000 	nop
     920:	34630018 	ori	v1,v1,0x18
     924:	ac430088 	sw	v1,136(v0)
	RTL_W32_F(NIC_IMR, tp->intr_mask);
     928:	3c020000 	lui	v0,0x0
     92c:	8c420000 	lw	v0,0(v0)
     930:	00000000 	nop
     934:	00451021 	addu	v0,v0,a1
     938:	ac430020 	sw	v1,32(v0)
	restore_flags(flags);
     93c:	40016000 	mfc0	at,$12
     940:	30840001 	andi	a0,a0,0x1
     944:	34210001 	ori	at,at,0x1
     948:	38210001 	xori	at,at,0x1
     94c:	00812025 	or	a0,a0,at
     950:	40846000 	mtc0	a0,$12
	...

}
     960:	03e00008 	jr	ra
     964:	00000000 	nop

00000968 <rtl8139_tx_timeout>:
     968:	27bdffe8 	addiu	sp,sp,-24
     96c:	afbf0010 	sw	ra,16(sp)
     970:	00802821 	move	a1,a0
static void rtl8139_tx_timeout (struct net_device *dev)
{

	printk("What ? tx_timeout ! on dev %s\n", dev->name);
     974:	3c040000 	lui	a0,0x0
     978:	24840160 	addiu	a0,a0,352
     97c:	0c000000 	jal	0 <rtl8139_quick_reset>
     980:	00000000 	nop
#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
}
     984:	8fbf0010 	lw	ra,16(sp)
     988:	00000000 	nop
     98c:	03e00008 	jr	ra
     990:	27bd0018 	addiu	sp,sp,24

00000994 <rtl8139_start_xmit>:
     994:	27bdffc8 	addiu	sp,sp,-56
     998:	afbf0030 	sw	ra,48(sp)
     99c:	afb7002c 	sw	s7,44(sp)
     9a0:	afb60028 	sw	s6,40(sp)
     9a4:	afb50024 	sw	s5,36(sp)
     9a8:	afb40020 	sw	s4,32(sp)
     9ac:	afb3001c 	sw	s3,28(sp)
     9b0:	afb20018 	sw	s2,24(sp)
     9b4:	afb10014 	sw	s1,20(sp)
     9b8:	afb00010 	sw	s0,16(sp)
     9bc:	00809821 	move	s3,a0
     9c0:	00a0a821 	move	s5,a1



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;
     9c4:	8eb20064 	lw	s2,100(s5)
     9c8:	00000000 	nop
	void *ioaddr = tp->mmio_addr;
     9cc:	8e560000 	lw	s6,0(s2)
     9d0:	00000000 	nop

	save_flags(flags);cli();
     9d4:	40176000 	mfc0	s7,$12
     9d8:	00000000 	nop

extern __inline__ void
__cli(void)
{
	__asm__ __volatile__(
     9dc:	40016000 	mfc0	at,$12
     9e0:	00000000 	nop
     9e4:	34210001 	ori	at,at,0x1
     9e8:	38210001 	xori	at,at,0x1
     9ec:	40816000 	mtc0	at,$12
     9f0:	00000040 	sll	zero,zero,0x1
     9f4:	00000040 	sll	zero,zero,0x1
     9f8:	00000040 	sll	zero,zero,0x1
	cur_tx = atomic_read(&tp->cur_tx) & (NUM_TX_DESC - 1);
     9fc:	8e420198 	lw	v0,408(s2)
     a00:	00000000 	nop
     a04:	3051003f 	andi	s1,v0,0x3f
	dirty_tx = atomic_read(&tp->dirty_tx) & (NUM_TX_DESC - 1);
     a08:	8e43019c 	lw	v1,412(s2)
     a0c:	00000000 	nop
	if (((cur_tx + 1) & (NUM_TX_DESC - 1)) == dirty_tx)
     a10:	26220001 	addiu	v0,s1,1
     a14:	00431026 	xor	v0,v0,v1
     a18:	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)
     a1c:	1040003c 	beqz	v0,b10 <rtl8139_start_xmit+0x17c>
     a20:	3c148000 	lui	s4,0x8000
	{
		// Great! we have free tx descriptors!
		own = OWNBYNIC;
		tp->tx_skb[cur_tx]=skb;
     a24:	00111080 	sll	v0,s1,0x2
     a28:	00521021 	addu	v0,v0,s2
     a2c:	ac5301a4 	sw	s3,420(v0)
		*(volatile unsigned int *)(&(tp->tx_desc[cur_tx].addr)) = Virtual2Physical(skb->data);
     a30:	8e4201a0 	lw	v0,416(s2)
     a34:	00112100 	sll	a0,s1,0x4
     a38:	00822021 	addu	a0,a0,v0
     a3c:	8e620080 	lw	v0,128(s3)
     a40:	3c031fff 	lui	v1,0x1fff
     a44:	3463ffff 	ori	v1,v1,0xffff
     a48:	00431024 	and	v0,v0,v1
     a4c:	ac820008 	sw	v0,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)	
     a50:	9263006b 	lbu	v1,107(s3)
     a54:	24020001 	li	v0,1
     a58:	14620012 	bne	v1,v0,aa4 <rtl8139_start_xmit+0x110>
     a5c:	00112100 	sll	a0,s1,0x4
#endif	
		{
		const struct iphdr *ip = skb->nh.iph;
     a60:	8e700020 	lw	s0,32(s3)
     a64:	00000000 	nop
				
				printk("tx offload,ip->protocol=%08x\n",ip->protocol);
     a68:	92050009 	lbu	a1,9(s0)
     a6c:	3c040000 	lui	a0,0x0
     a70:	24840180 	addiu	a0,a0,384
     a74:	0c000000 	jal	0 <rtl8139_quick_reset>
     a78:	00000000 	nop
				if ((ip->protocol == IPPROTO_TCP) ||
					(ip->protocol == IPPROTO_UDP)) {
     a7c:	92030009 	lbu	v1,9(s0)
     a80:	24020006 	li	v0,6
     a84:	10620005 	beq	v1,v0,a9c <rtl8139_start_xmit+0x108>
     a88:	3c020005 	lui	v0,0x5
     a8c:	24020011 	li	v0,17
     a90:	14620004 	bne	v1,v0,aa4 <rtl8139_start_xmit+0x110>
     a94:	00112100 	sll	a0,s1,0x4
				if (ip->protocol == IPPROTO_TCP)
     a98:	3c020006 	lui	v0,0x6
					own |= 	(IpTxCsumEn) | (TcpTxCsumEn);
				else
					own |=  (IpTxCsumEn) | (UdpTxCsumEn);
     a9c:	0282a025 	or	s4,s4,v0
				}				
		}
#endif
		SetOwnByNic(&(tp->tx_desc[cur_tx].header),skb->len ,own,cur_tx);
     aa0:	00112100 	sll	a0,s1,0x4
     aa4:	8e4201a0 	lw	v0,416(s2)
     aa8:	00000000 	nop
     aac:	00822021 	addu	a0,a0,v0
     ab0:	8e65005c 	lw	a1,92(s3)
     ab4:	02803021 	move	a2,s4
     ab8:	0c00003d 	jal	f4 <SetOwnByNic>
     abc:	02203821 	move	a3,s1
	
		// Remember to Poll Tx Registers!!!
		RTL_W32( NIC_CNR1, RTL_R32(NIC_CNR1) |  TxDescFN); 
     ac0:	3c030000 	lui	v1,0x0
     ac4:	8c630000 	lw	v1,0(v1)
     ac8:	00000000 	nop
     acc:	00761821 	addu	v1,v1,s6
}

static inline unsigned int inl(unsigned long port)
{
	return __ioswab32(*(volatile u32 *)(mips_io_port_base + port));
     ad0:	8c620000 	lw	v0,0(v1)
     ad4:	00000000 	nop
     ad8:	3c040100 	lui	a0,0x100
     adc:	00441025 	or	v0,v0,a0
     ae0:	ac620000 	sw	v0,0(v1)
}

static inline unsigned int inl(unsigned long port)
{
	return __ioswab32(*(volatile u32 *)(mips_io_port_base + port));
     ae4:	8c620000 	lw	v0,0(v1)
     ae8:	00000000 	nop
		RTL_R32( NIC_CNR1); 
		dev->trans_start = jiffies;
     aec:	3c020000 	lui	v0,0x0
     af0:	8c420000 	lw	v0,0(v0)
     af4:	00000000 	nop
     af8:	aea2004c 	sw	v0,76(s5)
		cur_tx++;
     afc:	26310001 	addiu	s1,s1,1
		cur_tx &= (NUM_TX_DESC - 1);
     b00:	3231003f 	andi	s1,s1,0x3f
		atomic_set (&tp->cur_tx, cur_tx);
     b04:	ae510198 	sw	s1,408(s2)
     b08:	08000304 	j	c10 <rtl8139_start_xmit+0x27c>
     b0c:	00000000 	nop
	__bi_flags;

	a += nr >> 5;
	mask = 1 << (nr & 0x1f);
	__bi_save_and_cli(flags);
     b10:	40036000 	mfc0	v1,$12
     b14:	00000000 	nop
     b18:	34610001 	ori	at,v1,0x1
     b1c:	38210001 	xori	at,at,0x1
     b20:	40816000 	mtc0	at,$12
     b24:	00000040 	sll	zero,zero,0x1
     b28:	00000040 	sll	zero,zero,0x1
     b2c:	00000040 	sll	zero,zero,0x1
	*a |= mask;
     b30:	8ea2002c 	lw	v0,44(s5)
     b34:	00000000 	nop
     b38:	34420001 	ori	v0,v0,0x1
     b3c:	aea2002c 	sw	v0,44(s5)
	__bi_restore_flags(flags);
     b40:	40016000 	mfc0	at,$12
     b44:	30630001 	andi	v1,v1,0x1
     b48:	34210001 	ori	at,at,0x1
     b4c:	38210001 	xori	at,at,0x1
     b50:	00611825 	or	v1,v1,at
     b54:	40836000 	mtc0	v1,$12
	...
	}
	else
	{
		// No more tx descriptors allowed!
		netif_stop_queue (dev);
		printk("stop_tx_queue!\n");
     b64:	3c040000 	lui	a0,0x0
     b68:	248401a0 	addiu	a0,a0,416
     b6c:	0c000000 	jal	0 <rtl8139_quick_reset>
     b70:	00000000 	nop
		if (skb)
     b74:	12600022 	beqz	s3,c00 <rtl8139_start_xmit+0x26c>
     b78:	00000000 	nop
 */
 
static inline void kfree_skb(struct sk_buff *skb)
{
	if (atomic_read(&skb->users) == 1 || atomic_dec_and_test(&skb->users))
     b7c:	8e630070 	lw	v1,112(s3)
     b80:	24020001 	li	v0,1
     b84:	1062001a 	beq	v1,v0,bf0 <rtl8139_start_xmit+0x25c>
     b88:	00000000 	nop
extern __inline__ int atomic_sub_return(int i, atomic_t * v)
{
	int	temp, flags;

	save_flags(flags);
     b8c:	40036000 	mfc0	v1,$12
     b90:	00000000 	nop

extern __inline__ void
__cli(void)
{
	__asm__ __volatile__(
     b94:	40016000 	mfc0	at,$12
     b98:	00000000 	nop
     b9c:	34210001 	ori	at,at,0x1
     ba0:	38210001 	xori	at,at,0x1
     ba4:	40816000 	mtc0	at,$12
     ba8:	00000040 	sll	zero,zero,0x1
     bac:	00000040 	sll	zero,zero,0x1
     bb0:	00000040 	sll	zero,zero,0x1
	int	temp, flags;

	save_flags(flags);
	cli();
	temp = v->counter;
     bb4:	8e620070 	lw	v0,112(s3)
     bb8:	00000000 	nop
	temp -= i;
     bbc:	2442ffff 	addiu	v0,v0,-1
	v->counter = temp;
     bc0:	ae620070 	sw	v0,112(s3)
	restore_flags(flags);
     bc4:	40016000 	mfc0	at,$12
     bc8:	30630001 	andi	v1,v1,0x1
     bcc:	34210001 	ori	at,at,0x1
     bd0:	38210001 	xori	at,at,0x1
     bd4:	00611825 	or	v1,v1,at
     bd8:	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))
     be8:	14400009 	bnez	v0,c10 <rtl8139_start_xmit+0x27c>
     bec:	00000000 	nop
		__kfree_skb(skb);
     bf0:	0c000000 	jal	0 <rtl8139_quick_reset>
     bf4:	02602021 	move	a0,s3
			dev_kfree_skb(skb);	
     bf8:	08000304 	j	c10 <rtl8139_start_xmit+0x27c>
     bfc:	00000000 	nop
		else
			printk("tx a null queue?\n");
     c00:	3c040000 	lui	a0,0x0
     c04:	248401b0 	addiu	a0,a0,432
     c08:	0c000000 	jal	0 <rtl8139_quick_reset>
     c0c:	00000000 	nop
	}
	/* Note: the chip doesn't have auto-pad! */

	restore_flags(flags);
     c10:	40016000 	mfc0	at,$12
     c14:	32f70001 	andi	s7,s7,0x1
     c18:	34210001 	ori	at,at,0x1
     c1c:	38210001 	xori	at,at,0x1
     c20:	02e1b825 	or	s7,s7,at
     c24:	40976000 	mtc0	s7,$12
	...
	return 0;
     c34:	00001021 	move	v0,zero
}
     c38:	8fbf0030 	lw	ra,48(sp)
     c3c:	8fb7002c 	lw	s7,44(sp)
     c40:	8fb60028 	lw	s6,40(sp)
     c44:	8fb50024 	lw	s5,36(sp)
     c48:	8fb40020 	lw	s4,32(sp)
     c4c:	8fb3001c 	lw	s3,28(sp)
     c50:	8fb20018 	lw	s2,24(sp)
     c54:	8fb10014 	lw	s1,20(sp)
     c58:	8fb00010 	lw	s0,16(sp)
     c5c:	03e00008 	jr	ra
     c60:	27bd0038 	addiu	sp,sp,56

00000c64 <rtl8139_tx_interrupt>:
     c64:	27bdffc8 	addiu	sp,sp,-56
     c68:	afbf0034 	sw	ra,52(sp)
     c6c:	afb60030 	sw	s6,48(sp)
     c70:	afb5002c 	sw	s5,44(sp)
     c74:	afb40028 	sw	s4,40(sp)
     c78:	afb30024 	sw	s3,36(sp)
     c7c:	afb20020 	sw	s2,32(sp)
     c80:	afb1001c 	sw	s1,28(sp)
     c84:	afb00018 	sw	s0,24(sp)
     c88:	0080a821 	move	s5,a0
     c8c:	00a09821 	move	s3,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);
     c90:	16a0000c 	bnez	s5,cc4 <rtl8139_tx_interrupt+0x60>
     c94:	00c08021 	move	s0,a2
     c98:	2402033f 	li	v0,831
     c9c:	3c040000 	lui	a0,0x0
     ca0:	2484007c 	addiu	a0,a0,124
     ca4:	3c050000 	lui	a1,0x0
     ca8:	24a500d4 	addiu	a1,a1,212
     cac:	3c060000 	lui	a2,0x0
     cb0:	24c600b0 	addiu	a2,a2,176
     cb4:	3c070000 	lui	a3,0x0
     cb8:	24e701c4 	addiu	a3,a3,452
     cbc:	0c000000 	jal	0 <rtl8139_quick_reset>
     cc0:	afa20010 	sw	v0,16(sp)
	assert (tp != NULL);
     cc4:	1660000b 	bnez	s3,cf4 <rtl8139_tx_interrupt+0x90>
     cc8:	24020340 	li	v0,832
     ccc:	3c040000 	lui	a0,0x0
     cd0:	2484007c 	addiu	a0,a0,124
     cd4:	3c050000 	lui	a1,0x0
     cd8:	24a500e0 	addiu	a1,a1,224
     cdc:	3c060000 	lui	a2,0x0
     ce0:	24c600b0 	addiu	a2,a2,176
     ce4:	3c070000 	lui	a3,0x0
     ce8:	24e701c4 	addiu	a3,a3,452
     cec:	0c000000 	jal	0 <rtl8139_quick_reset>
     cf0:	afa20010 	sw	v0,16(sp)
	assert (ioaddr != NULL);
     cf4:	1600000b 	bnez	s0,d24 <rtl8139_tx_interrupt+0xc0>
     cf8:	24020341 	li	v0,833
     cfc:	3c040000 	lui	a0,0x0
     d00:	2484007c 	addiu	a0,a0,124
     d04:	3c050000 	lui	a1,0x0
     d08:	24a500a0 	addiu	a1,a1,160
     d0c:	3c060000 	lui	a2,0x0
     d10:	24c600b0 	addiu	a2,a2,176
     d14:	3c070000 	lui	a3,0x0
     d18:	24e701c4 	addiu	a3,a3,452
     d1c:	0c000000 	jal	0 <rtl8139_quick_reset>
     d20:	afa20010 	sw	v0,16(sp)

	// 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);
     d24:	8e71019c 	lw	s1,412(s3)
     d28:	00000000 	nop
	cur_tx = atomic_read (&tp->cur_tx);
     d2c:	8e760198 	lw	s6,408(s3)
     d30:	00000000 	nop
	tx_count = CIRC_CNT(cur_tx, dirty_tx, NUM_TX_DESC);
     d34:	02d19023 	subu	s2,s6,s1
     d38:	3252003f 	andi	s2,s2,0x3f
	while ( tx_count-- )
     d3c:	2652ffff 	addiu	s2,s2,-1
     d40:	2402ffff 	li	v0,-1
     d44:	12420080 	beq	s2,v0,f48 <rtl8139_tx_interrupt+0x2e4>
     d48:	00111100 	sll	v0,s1,0x4
	//while (1)
	{
		tx_header_addr=(unsigned int)(&(tp->tx_desc[dirty_tx].header)) | 0x20000000;
     d4c:	8e6301a0 	lw	v1,416(s3)
     d50:	00000000 	nop
     d54:	00431021 	addu	v0,v0,v1
     d58:	3c032000 	lui	v1,0x2000
     d5c:	00431025 	or	v0,v0,v1

//		tx_header = *(volatile unsigned long *)(&(tp->tx_desc[dirty_tx].header));
	tx_header = *(volatile unsigned int *)(tx_header_addr);
     d60:	8c430000 	lw	v1,0(v0)
     d64:	00000000 	nop
	//prom_printf("tx_header_addr=%08x, tx_header=%08x\n",tx_header_addr,tx_header);
		
		if (tx_header & OWNBYNIC)
     d68:	04600077 	bltz	v1,f48 <rtl8139_tx_interrupt+0x2e4>
     d6c:	3c020080 	lui	v0,0x80
			break; 
     d70:	26740004 	addiu	s4,s3,4
		if (tx_header & TXERR)
     d74:	00621024 	and	v0,v1,v0
     d78:	1040001f 	beqz	v0,df8 <rtl8139_tx_interrupt+0x194>
     d7c:	00111080 	sll	v0,s1,0x2
		{
			tp->stats.tx_errors++;
     d80:	8e620018 	lw	v0,24(s3)
     d84:	00000000 	nop
     d88:	24420001 	addiu	v0,v0,1
     d8c:	ae620018 	sw	v0,24(s3)
			if (tx_header & TXERR_OUTOFWIN)
     d90:	3c020040 	lui	v0,0x40
     d94:	00621024 	and	v0,v1,v0
     d98:	10400006 	beqz	v0,db4 <rtl8139_tx_interrupt+0x150>
     d9c:	3c020020 	lui	v0,0x20
				tp->stats.tx_window_errors++;
     da0:	8e620054 	lw	v0,84(s3)
     da4:	00000000 	nop
     da8:	24420001 	addiu	v0,v0,1
     dac:	ae620054 	sw	v0,84(s3)
			if (tx_header & TXERR_LINKF)
     db0:	3c020020 	lui	v0,0x20
     db4:	00621024 	and	v0,v1,v0
     db8:	10400006 	beqz	v0,dd4 <rtl8139_tx_interrupt+0x170>
     dbc:	3c020010 	lui	v0,0x10
				tp->stats.tx_carrier_errors++;
     dc0:	8e620048 	lw	v0,72(s3)
     dc4:	00000000 	nop
     dc8:	24420001 	addiu	v0,v0,1
     dcc:	ae620048 	sw	v0,72(s3)
			if (tx_header & TXERR_COLLISION)
     dd0:	3c020010 	lui	v0,0x10
     dd4:	00621024 	and	v0,v1,v0
     dd8:	10400006 	beqz	v0,df4 <rtl8139_tx_interrupt+0x190>
     ddc:	00031402 	srl	v0,v1,0x10
				tp->stats.collisions += (tx_header >> 16) & (0xf);		
     de0:	3042000f 	andi	v0,v0,0xf
     de4:	8e630028 	lw	v1,40(s3)
     de8:	00000000 	nop
     dec:	00431021 	addu	v0,v0,v1
     df0:	ae620028 	sw	v0,40(s3)
		}
			if ((tp->tx_skb[dirty_tx])->next)
     df4:	00111080 	sll	v0,s1,0x2
     df8:	00541021 	addu	v0,v0,s4
     dfc:	8c4201a0 	lw	v0,416(v0)
     e00:	00000000 	nop
     e04:	8c420000 	lw	v0,0(v0)
     e08:	00000000 	nop
     e0c:	10400006 	beqz	v0,e28 <rtl8139_tx_interrupt+0x1c4>
     e10:	00111080 	sll	v0,s1,0x2
				printk("Non null?\n");
     e14:	3c040000 	lui	a0,0x0
     e18:	248401dc 	addiu	a0,a0,476
     e1c:	0c000000 	jal	0 <rtl8139_quick_reset>
     e20:	00000000 	nop
			//Free skb
			dev_kfree_skb_irq(tp->tx_skb[dirty_tx]);
     e24:	00111080 	sll	v0,s1,0x2
     e28:	00541021 	addu	v0,v0,s4
/* Use this variant when it is known for sure that it
 * is executing from interrupt context.
 */
static inline void dev_kfree_skb_irq(struct sk_buff *skb)
{
     e2c:	8c4401a0 	lw	a0,416(v0)
     e30:	00000000 	nop
extern __inline__ int atomic_sub_return(int i, atomic_t * v)
{
	int	temp, flags;

	save_flags(flags);
     e34:	40036000 	mfc0	v1,$12
     e38:	00000000 	nop

extern __inline__ void
__cli(void)
{
	__asm__ __volatile__(
     e3c:	40016000 	mfc0	at,$12
     e40:	00000000 	nop
     e44:	34210001 	ori	at,at,0x1
     e48:	38210001 	xori	at,at,0x1
     e4c:	40816000 	mtc0	at,$12
     e50:	00000040 	sll	zero,zero,0x1
     e54:	00000040 	sll	zero,zero,0x1
     e58:	00000040 	sll	zero,zero,0x1
	int	temp, flags;

	save_flags(flags);
	cli();
	temp = v->counter;
     e5c:	8c820070 	lw	v0,112(a0)
     e60:	00000000 	nop
	temp -= i;
     e64:	2442ffff 	addiu	v0,v0,-1
	v->counter = temp;
     e68:	ac820070 	sw	v0,112(a0)
	restore_flags(flags);
     e6c:	40016000 	mfc0	at,$12
     e70:	30630001 	andi	v1,v1,0x1
     e74:	34210001 	ori	at,at,0x1
     e78:	38210001 	xori	at,at,0x1
     e7c:	00611825 	or	v1,v1,at
     e80:	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)) {
     e90:	1440001c 	bnez	v0,f04 <rtl8139_tx_interrupt+0x2a0>
     e94:	00111080 	sll	v0,s1,0x2
		int cpu =smp_processor_id();
		unsigned long flags;

		local_irq_save(flags);
     e98:	40106000 	mfc0	s0,$12
     e9c:	00000000 	nop
     ea0:	36010001 	ori	at,s0,0x1
     ea4:	38210001 	xori	at,at,0x1
     ea8:	40816000 	mtc0	at,$12
     eac:	00000040 	sll	zero,zero,0x1
     eb0:	00000040 	sll	zero,zero,0x1
     eb4:	00000040 	sll	zero,zero,0x1
		skb->next = softnet_data[cpu].completion_queue;
     eb8:	3c020000 	lui	v0,0x0
     ebc:	8c42001c 	lw	v0,28(v0)
     ec0:	00000000 	nop
     ec4:	ac820000 	sw	v0,0(a0)
		softnet_data[cpu].completion_queue = skb;
     ec8:	3c010000 	lui	at,0x0
     ecc:	ac24001c 	sw	a0,28(at)
		cpu_raise_softirq(cpu, NET_TX_SOFTIRQ);
     ed0:	00002021 	move	a0,zero
     ed4:	0c000000 	jal	0 <rtl8139_quick_reset>
     ed8:	24050001 	li	a1,1
		local_irq_restore(flags);
     edc:	40016000 	mfc0	at,$12
     ee0:	32100001 	andi	s0,s0,0x1
     ee4:	34210001 	ori	at,at,0x1
     ee8:	38210001 	xori	at,at,0x1
     eec:	02018025 	or	s0,s0,at
     ef0:	40906000 	mtc0	s0,$12
	...
			tp->tx_skb[dirty_tx]=NULL;
     f00:	00111080 	sll	v0,s1,0x2
     f04:	00541021 	addu	v0,v0,s4
     f08:	ac4001a0 	sw	zero,416(v0)
			dirty_tx++;dirty_tx &= (NUM_TX_DESC - 1);
     f0c:	26310001 	addiu	s1,s1,1
     f10:	2652ffff 	addiu	s2,s2,-1
     f14:	2402ffff 	li	v0,-1
     f18:	1242000b 	beq	s2,v0,f48 <rtl8139_tx_interrupt+0x2e4>
     f1c:	3231003f 	andi	s1,s1,0x3f
     f20:	00111100 	sll	v0,s1,0x4
     f24:	8e6301a0 	lw	v1,416(s3)
     f28:	00000000 	nop
     f2c:	00431021 	addu	v0,v0,v1
     f30:	3c032000 	lui	v1,0x2000
     f34:	00431025 	or	v0,v0,v1
     f38:	8c430000 	lw	v1,0(v0)
     f3c:	00000000 	nop
     f40:	0461ff8c 	bgez	v1,d74 <rtl8139_tx_interrupt+0x110>
     f44:	3c020080 	lui	v0,0x80
 * @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;
     f48:	8ea2002c 	lw	v0,44(s5)
     f4c:	00000000 	nop
     f50:	30420001 	andi	v0,v0,0x1
	}
	
	if (netif_queue_stopped(dev) &&
	CIRC_SPACE(cur_tx, dirty_tx, NUM_TX_DESC))
     f54:	10400054 	beqz	v0,10a8 <rtl8139_tx_interrupt+0x444>
     f58:	02361023 	subu	v0,s1,s6
     f5c:	2442ffff 	addiu	v0,v0,-1
     f60:	3042003f 	andi	v0,v0,0x3f
     f64:	10400050 	beqz	v0,10a8 <rtl8139_tx_interrupt+0x444>
     f68:	00000000 	nop
	__bi_flags;

	a += nr >> 5;
	mask = 1 << (nr & 0x1f);
	__bi_save_and_cli(flags);
     f6c:	40056000 	mfc0	a1,$12
     f70:	00000000 	nop
     f74:	34a10001 	ori	at,a1,0x1
     f78:	38210001 	xori	at,at,0x1
     f7c:	40816000 	mtc0	at,$12
     f80:	00000040 	sll	zero,zero,0x1
     f84:	00000040 	sll	zero,zero,0x1
     f88:	00000040 	sll	zero,zero,0x1
	retval = (mask & *a) != 0;
     f8c:	8ea4002c 	lw	a0,44(s5)
     f90:	00000000 	nop
     f94:	30840001 	andi	a0,a0,0x1
	*a &= ~mask;
     f98:	8ea2002c 	lw	v0,44(s5)
     f9c:	2403fffe 	li	v1,-2
     fa0:	00431024 	and	v0,v0,v1
     fa4:	aea2002c 	sw	v0,44(s5)
	__bi_restore_flags(flags);
     fa8:	40016000 	mfc0	at,$12
     fac:	30a50001 	andi	a1,a1,0x1
     fb0:	34210001 	ori	at,at,0x1
     fb4:	38210001 	xori	at,at,0x1
     fb8:	00a12825 	or	a1,a1,at
     fbc:	40856000 	mtc0	a1,$12
	...
}

static inline void netif_wake_queue(struct net_device *dev)
{
	if (test_and_clear_bit(__LINK_STATE_XOFF, &dev->state))
     fcc:	10800036 	beqz	a0,10a8 <rtl8139_tx_interrupt+0x444>
     fd0:	00000000 	nop
	__bi_flags;

	a += nr >> 5;
	mask = 1 << (nr & 0x1f);
	__bi_save_and_cli(flags);
     fd4:	40046000 	mfc0	a0,$12
     fd8:	00000000 	nop
     fdc:	34810001 	ori	at,a0,0x1
     fe0:	38210001 	xori	at,at,0x1
     fe4:	40816000 	mtc0	at,$12
     fe8:	00000040 	sll	zero,zero,0x1
     fec:	00000040 	sll	zero,zero,0x1
     ff0:	00000040 	sll	zero,zero,0x1
	retval = (mask & *a) != 0;
     ff4:	8ea3002c 	lw	v1,44(s5)
     ff8:	00000000 	nop
     ffc:	30630008 	andi	v1,v1,0x8
    1000:	0003182b 	sltu	v1,zero,v1
	*a |= mask;
    1004:	8ea2002c 	lw	v0,44(s5)
    1008:	00000000 	nop
    100c:	34420008 	ori	v0,v0,0x8
    1010:	aea2002c 	sw	v0,44(s5)
	__bi_restore_flags(flags);
    1014:	40016000 	mfc0	at,$12
    1018:	30840001 	andi	a0,a0,0x1
    101c:	34210001 	ori	at,at,0x1
    1020:	38210001 	xori	at,at,0x1
    1024:	00812025 	or	a0,a0,at
    1028:	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)) {
    1038:	1460001b 	bnez	v1,10a8 <rtl8139_tx_interrupt+0x444>
    103c:	00000000 	nop
		unsigned long flags;
		int cpu = smp_processor_id();

		local_irq_save(flags);
    1040:	40106000 	mfc0	s0,$12
    1044:	00000000 	nop
    1048:	36010001 	ori	at,s0,0x1
    104c:	38210001 	xori	at,at,0x1
    1050:	40816000 	mtc0	at,$12
    1054:	00000040 	sll	zero,zero,0x1
    1058:	00000040 	sll	zero,zero,0x1
    105c:	00000040 	sll	zero,zero,0x1
		dev->next_sched = softnet_data[cpu].output_queue;
    1060:	3c020000 	lui	v0,0x0
    1064:	8c420018 	lw	v0,24(v0)
    1068:	00000000 	nop
    106c:	aea20038 	sw	v0,56(s5)
		softnet_data[cpu].output_queue = dev;
    1070:	3c010000 	lui	at,0x0
    1074:	ac350018 	sw	s5,24(at)
		cpu_raise_softirq(cpu, NET_TX_SOFTIRQ);
    1078:	00002021 	move	a0,zero
    107c:	0c000000 	jal	0 <rtl8139_quick_reset>
    1080:	24050001 	li	a1,1
		local_irq_restore(flags);
    1084:	40016000 	mfc0	at,$12
    1088:	32100001 	andi	s0,s0,0x1
    108c:	34210001 	ori	at,at,0x1
    1090:	38210001 	xori	at,at,0x1
    1094:	02018025 	or	s0,s0,at
    1098:	40906000 	mtc0	s0,$12
	...
		netif_wake_queue(dev);
	atomic_set (&tp->dirty_tx, dirty_tx);
    10a8:	ae71019c 	sw	s1,412(s3)
}
    10ac:	8fbf0034 	lw	ra,52(sp)
    10b0:	8fb60030 	lw	s6,48(sp)
    10b4:	8fb5002c 	lw	s5,44(sp)
    10b8:	8fb40028 	lw	s4,40(sp)
    10bc:	8fb30024 	lw	s3,36(sp)
    10c0:	8fb20020 	lw	s2,32(sp)
    10c4:	8fb1001c 	lw	s1,28(sp)
    10c8:	8fb00018 	lw	s0,24(sp)
    10cc:	03e00008 	jr	ra
    10d0:	27bd0038 	addiu	sp,sp,56

000010d4 <rtl8139_rx_interrupt>:
    10d4:	27bdffc0 	addiu	sp,sp,-64
    10d8:	afbf003c 	sw	ra,60(sp)
    10dc:	afb60038 	sw	s6,56(sp)
    10e0:	afb50034 	sw	s5,52(sp)
    10e4:	afb40030 	sw	s4,48(sp)
    10e8:	afb3002c 	sw	s3,44(sp)
    10ec:	afb20028 	sw	s2,40(sp)
    10f0:	afb10024 	sw	s1,36(sp)
    10f4:	afb00020 	sw	s0,32(sp)
    10f8:	0080a821 	move	s5,a0
    10fc:	00a0a021 	move	s4,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;
    1100:	8e82008c 	lw	v0,140(s4)
    1104:	00000000 	nop
    1108:	afa20018 	sw	v0,24(sp)
	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));
		rxheader = *(volatile unsigned int *)(header_addr | 0x20000000);	
		if (rxheader & OWNBYNIC)
    110c:	0800050d 	j	1434 <rtl8139_rx_interrupt+0x360>
    1110:	0000b021 	move	s6,zero
				break;
		
		if (rxheader & RXERR) 
    1114:	02221024 	and	v0,s1,v0
    1118:	1040000b 	beqz	v0,1148 <rtl8139_rx_interrupt+0x74>
    111c:	00000000 	nop
		{
			printk("Rx ErrPkt on %s, rxheader=%08x,header_addr=%08x cur_rx=%08x \n", dev->name, rxheader,header_addr,cur_rx);
    1120:	3c040000 	lui	a0,0x0
    1124:	248401e8 	addiu	a0,a0,488
    1128:	8fa20018 	lw	v0,24(sp)
    112c:	00000000 	nop
    1130:	afa20010 	sw	v0,16(sp)
    1134:	02a02821 	move	a1,s5
    1138:	0c000000 	jal	0 <rtl8139_quick_reset>
    113c:	02203021 	move	a2,s1
			// just ignore this pkt
			// re-use the descriptor
			skb_ptr = tp->rx_skb[cur_rx];
    1140:	08000456 	j	1158 <rtl8139_rx_interrupt+0x84>
    1144:	00000000 	nop
		}
		else if (tp->netrxdrop)
    1148:	8e8202b0 	lw	v0,688(s4)
    114c:	00000000 	nop
    1150:	10400008 	beqz	v0,1174 <rtl8139_rx_interrupt+0xa0>
    1154:	32221fff 	andi	v0,s1,0x1fff
		//else if (softnet_data[0].input_pkt_queue.qlen >= 100)
		{
			skb_ptr = tp->rx_skb[cur_rx];
    1158:	8fa20018 	lw	v0,24(sp)
    115c:	00000000 	nop
    1160:	00021080 	sll	v0,v0,0x2
    1164:	00541021 	addu	v0,v0,s4
    1168:	8c520094 	lw	s2,148(v0)
    116c:	08000492 	j	1248 <rtl8139_rx_interrupt+0x174>
    1170:	00000000 	nop
			//printk("qlen >=100, stop quing\n");
		}
		else if (((rxheader & RXLENMASK) - 4) > 1520)
    1174:	2442fffc 	addiu	v0,v0,-4
    1178:	2c4205f1 	sltiu	v0,v0,1521
    117c:	14400007 	bnez	v0,119c <rtl8139_rx_interrupt+0xc8>
    1180:	00000000 	nop
		{
			printk("weired rxheader=%08x\n", rxheader);
    1184:	3c040000 	lui	a0,0x0
    1188:	24840228 	addiu	a0,a0,552
    118c:	0c000000 	jal	0 <rtl8139_quick_reset>
    1190:	02202821 	move	a1,s1
    1194:	08000492 	j	1248 <rtl8139_rx_interrupt+0x174>
    1198:	00000000 	nop
		}
		else
		{
			rx_ptr = tp->rx_skb[cur_rx];
    119c:	8fa20018 	lw	v0,24(sp)
    11a0:	00000000 	nop
    11a4:	00021080 	sll	v0,v0,0x2
    11a8:	00541021 	addu	v0,v0,s4
    11ac:	8c530094 	lw	s3,148(v0)
    11b0:	00000000 	nop
			rx_ptr->dev=dev;
    11b4:	ae750018 	sw	s5,24(s3)
					      int gfp_mask)
{
	struct sk_buff *skb;

	skb = alloc_skb(length+16, gfp_mask);
    11b8:	24040650 	li	a0,1616
    11bc:	0c000000 	jal	0 <rtl8139_quick_reset>
    11c0:	24050020 	li	a1,32
    11c4:	00401821 	move	v1,v0
	if (skb)
    11c8:	10600009 	beqz	v1,11f0 <rtl8139_rx_interrupt+0x11c>
    11cc:	00609021 	move	s2,v1
    11d0:	8c620080 	lw	v0,128(v1)
    11d4:	00000000 	nop
    11d8:	24420010 	addiu	v0,v0,16
    11dc:	ac620080 	sw	v0,128(v1)
    11e0:	8c620084 	lw	v0,132(v1)
    11e4:	00000000 	nop
    11e8:	24420010 	addiu	v0,v0,16
    11ec:	ac620084 	sw	v0,132(v1)
			skb_ptr = dev_alloc_skb(RX_BUF_LEN);
			if (skb_ptr == NULL)
    11f0:	16400007 	bnez	s2,1210 <rtl8139_rx_interrupt+0x13c>
    11f4:	02a02821 	move	a1,s5
			{	
			
				printk("System out of skbuff for %s, k=%d\n",dev->name,k);
    11f8:	3c040000 	lui	a0,0x0
    11fc:	24840240 	addiu	a0,a0,576
    1200:	0c000000 	jal	0 <rtl8139_quick_reset>
    1204:	02c03021 	move	a2,s6
				break;
    1208:	0800051a 	j	1468 <rtl8139_rx_interrupt+0x394>
    120c:	00000000 	nop
 */

static inline void skb_reserve(struct sk_buff *skb, unsigned int len)
{
	skb->data+=len;
    1210:	8e420080 	lw	v0,128(s2)
    1214:	00000000 	nop
    1218:	24420002 	addiu	v0,v0,2
    121c:	ae420080 	sw	v0,128(s2)
	skb->tail+=len;
    1220:	8e420084 	lw	v0,132(s2)
    1224:	00000000 	nop
    1228:	24420002 	addiu	v0,v0,2
    122c:	ae420084 	sw	v0,132(s2)
				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;
    1230:	8fa20018 	lw	v0,24(sp)
    1234:	00000000 	nop
    1238:	00021080 	sll	v0,v0,0x2
    123c:	00541021 	addu	v0,v0,s4
    1240:	ac520094 	sw	s2,148(v0)
				skb_ptr->dev=dev;
    1244:	ae550018 	sw	s5,24(s2)
			}
		}
			*(volatile unsigned long *)(&(tp->rx_desc[cur_rx].addr)) = Virtual2Physical((int)(skb_ptr->data)); 
    1248:	8fa40018 	lw	a0,24(sp)
    124c:	8e820090 	lw	v0,144(s4)
    1250:	00042100 	sll	a0,a0,0x4
    1254:	00822021 	addu	a0,a0,v0
    1258:	8e420080 	lw	v0,128(s2)
    125c:	3c031fff 	lui	v1,0x1fff
    1260:	3463ffff 	ori	v1,v1,0xffff
    1264:	00431024 	and	v0,v0,v1
    1268:	ac820008 	sw	v0,8(a0)
			// Renew this descriptor
			SetOwnByNic(&(tp->rx_desc[cur_rx].header),RX_BUF_LEN ,OWNBYNIC ,cur_rx);
    126c:	8fa40018 	lw	a0,24(sp)
    1270:	00000000 	nop
    1274:	00042100 	sll	a0,a0,0x4
    1278:	8e820090 	lw	v0,144(s4)
    127c:	00000000 	nop
    1280:	00822021 	addu	a0,a0,v0
    1284:	24050640 	li	a1,1600
    1288:	3c068000 	lui	a2,0x8000
    128c:	8fa70018 	lw	a3,24(sp)
    1290:	0c00003d 	jal	f4 <SetOwnByNic>
    1294:	00000000 	nop
			cur_rx ++;
    1298:	8fa20018 	lw	v0,24(sp)
    129c:	00000000 	nop
    12a0:	24420001 	addiu	v0,v0,1
    12a4:	afa20018 	sw	v0,24(sp)
			cur_rx &= (NUM_RX_DESC - 1);
    12a8:	8fa20018 	lw	v0,24(sp)
    12ac:	00000000 	nop
    12b0:	3042003f 	andi	v0,v0,0x3f
    12b4:	afa20018 	sw	v0,24(sp)
			
			if (rx_ptr)
    12b8:	1260005a 	beqz	s3,1424 <rtl8139_rx_interrupt+0x350>
    12bc:	00111c02 	srl	v1,s1,0x10
    12c0:	30630003 	andi	v1,v1,0x3
    12c4:	24020003 	li	v0,3
    12c8:	14620005 	bne	v1,v0,12e0 <rtl8139_rx_interrupt+0x20c>
    12cc:	24020001 	li	v0,1
    12d0:	32228000 	andi	v0,s1,0x8000
    12d4:	1040000e 	beqz	v0,1310 <rtl8139_rx_interrupt+0x23c>
    12d8:	24040001 	li	a0,1
    12dc:	24020001 	li	v0,1
    12e0:	14620005 	bne	v1,v0,12f8 <rtl8139_rx_interrupt+0x224>
    12e4:	24020002 	li	v0,2
    12e8:	32222000 	andi	v0,s1,0x2000
    12ec:	10400008 	beqz	v0,1310 <rtl8139_rx_interrupt+0x23c>
    12f0:	24040001 	li	a0,1
    12f4:	24020002 	li	v0,2
    12f8:	14620005 	bne	v1,v0,1310 <rtl8139_rx_interrupt+0x23c>
    12fc:	00002021 	move	a0,zero
    1300:	32224000 	andi	v0,s1,0x4000
    1304:	10400002 	beqz	v0,1310 <rtl8139_rx_interrupt+0x23c>
    1308:	24040001 	li	a0,1
    130c:	00002021 	move	a0,zero
			{
#ifdef RTL8139AP_CHECKSUM_OFFLOAD
        		if (rx_csum_ok(rxheader))
    1310:	10800003 	beqz	a0,1320 <rtl8139_rx_interrupt+0x24c>
    1314:	24020002 	li	v0,2
        		{
            	//printk("un-necessary\n");
            		rx_ptr->ip_summed = CHECKSUM_UNNECESSARY;
    1318:	080004c9 	j	1324 <rtl8139_rx_interrupt+0x250>
    131c:	a262006b 	sb	v0,107(s3)
        		}
        		else
            		rx_ptr->ip_summed = CHECKSUM_NONE;
    1320:	a260006b 	sb	zero,107(s3)
#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);
    1324:	32221fff 	andi	v0,s1,0x1fff
    1328:	2450fffc 	addiu	s0,v0,-4
}

static inline int skb_is_nonlinear(const struct sk_buff *skb)
{
	return skb->data_len;
    132c:	8e620060 	lw	v0,96(s3)
    1330:	00000000 	nop
}

static inline int skb_headlen(const struct sk_buff *skb)
{
	return skb->len - skb->data_len;
}

#define SKB_PAGE_ASSERT(skb) do { if (skb_shinfo(skb)->nr_frags) BUG(); } while (0)
#define SKB_FRAG_ASSERT(skb) do { if (skb_shinfo(skb)->frag_list) BUG(); } while (0)
#define SKB_LINEAR_ASSERT(skb) do { if (skb_is_nonlinear(skb)) BUG(); } while (0)

/*
 *	Add data to an sk_buff
 */
 
static inline unsigned char *__skb_put(struct sk_buff *skb, unsigned int len)
{
	unsigned char *tmp=skb->tail;
	SKB_LINEAR_ASSERT(skb);
	skb->tail+=len;
	skb->len+=len;
	return tmp;
}

/**
 *	skb_put - add data to a buffer
 *	@skb: buffer to use 
 *	@len: amount of data to add
 *
 *	This function extends the used data area of the buffer. If this would
 *	exceed the total buffer size the kernel will panic. A pointer to the
 *	first byte of the extra data is returned.
 */
 
static inline unsigned char *skb_put(struct sk_buff *skb, unsigned int len)
{
	unsigned char *tmp=skb->tail;
	SKB_LINEAR_ASSERT(skb);
    1334:	10400008 	beqz	v0,1358 <rtl8139_rx_interrupt+0x284>
    1338:	00000000 	nop
    133c:	3c040000 	lui	a0,0x0
    1340:	24840264 	addiu	a0,a0,612
    1344:	3c050000 	lui	a1,0x0
    1348:	24a5027c 	addiu	a1,a1,636
    134c:	0c000000 	jal	0 <rtl8139_quick_reset>
    1350:	24060315 	li	a2,789
    1354:	ac000000 	sw	zero,0(zero)
	skb->tail+=len;
    1358:	8e620084 	lw	v0,132(s3)
    135c:	00000000 	nop
    1360:	02021021 	addu	v0,s0,v0
    1364:	ae620084 	sw	v0,132(s3)
	skb->len+=len;
    1368:	8e63005c 	lw	v1,92(s3)
    136c:	00000000 	nop
    1370:	02031821 	addu	v1,s0,v1
    1374:	ae63005c 	sw	v1,92(s3)
	if(skb->tail>skb->end) {
    1378:	8e630088 	lw	v1,136(s3)
    137c:	00000000 	nop
    1380:	0062182b 	sltu	v1,v1,v0
    1384:	10600006 	beqz	v1,13a0 <rtl8139_rx_interrupt+0x2cc>
    1388:	00000000 	nop
		skb_over_panic(skb, len, current_text_addr());
    138c:	02602021 	move	a0,s3
    1390:	3c060000 	lui	a2,0x0
    1394:	24c6138c 	addiu	a2,a2,5004
    1398:	0c000000 	jal	0 <rtl8139_quick_reset>
    139c:	02002821 	move	a1,s0
        		rx_ptr->protocol = eth_type_trans (rx_ptr, dev);
    13a0:	02602021 	move	a0,s3
    13a4:	0c000000 	jal	0 <rtl8139_quick_reset>
    13a8:	02a02821 	move	a1,s5
    13ac:	a6620074 	sh	v0,116(s3)
        		//if ((netreturn = netif_rx(rx_ptr)) >= NET_RX_CN_LOW)
        		if ((netreturn = netif_rx(rx_ptr)) == NET_RX_DROP)
    13b0:	0c000000 	jal	0 <rtl8139_quick_reset>
    13b4:	02602021 	move	a0,s3
    13b8:	00408021 	move	s0,v0
    13bc:	24020001 	li	v0,1
    13c0:	1602000d 	bne	s0,v0,13f8 <rtl8139_rx_interrupt+0x324>
    13c4:	00000000 	nop
        		{
      #if 1      	
					printk("NetIf =%08x , halting post skb to os \n",netreturn);
    13c8:	3c040000 	lui	a0,0x0
    13cc:	248402c0 	addiu	a0,a0,704
    13d0:	0c000000 	jal	0 <rtl8139_quick_reset>
    13d4:	24050001 	li	a1,1
					tp->netrxdrop=TRUE;
    13d8:	ae9002b0 	sw	s0,688(s4)
        			//add_timer(&tp->timer);
					mod_timer(&tp->timer, jiffies + 3);
    13dc:	26840060 	addiu	a0,s4,96
    13e0:	3c050000 	lui	a1,0x0
    13e4:	8ca50000 	lw	a1,0(a1)
    13e8:	0c000000 	jal	0 <rtl8139_quick_reset>
    13ec:	24a50003 	addiu	a1,a1,3
    13f0:	08000500 	j	1400 <rtl8139_rx_interrupt+0x32c>
    13f4:	32221fff 	andi	v0,s1,0x1fff
	  #endif	
				}
        		else
            		tp->netrxdrop=FALSE;
    13f8:	ae8002b0 	sw	zero,688(s4)
#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 ;
    13fc:	32221fff 	andi	v0,s1,0x1fff
    1400:	8e83000c 	lw	v1,12(s4)
    1404:	00000000 	nop
    1408:	00431021 	addu	v0,v0,v1
    140c:	2442fffc 	addiu	v0,v0,-4
    1410:	ae82000c 	sw	v0,12(s4)
        		tp->stats.rx_packets++;			
    1414:	8e820004 	lw	v0,4(s4)
    1418:	00000000 	nop
    141c:	24420001 	addiu	v0,v0,1
    1420:	ae820004 	sw	v0,4(s4)
    1424:	26d60001 	addiu	s6,s6,1
    1428:	2ac2003a 	slti	v0,s6,58
    142c:	1040000e 	beqz	v0,1468 <rtl8139_rx_interrupt+0x394>
    1430:	00000000 	nop
    1434:	00009821 	move	s3,zero
    1438:	8fa20018 	lw	v0,24(sp)
    143c:	00000000 	nop
    1440:	00021100 	sll	v0,v0,0x4
    1444:	8e830090 	lw	v1,144(s4)
    1448:	00000000 	nop
    144c:	00433821 	addu	a3,v0,v1
    1450:	3c022000 	lui	v0,0x2000
    1454:	00e21025 	or	v0,a3,v0
    1458:	8c510000 	lw	s1,0(v0)
    145c:	00000000 	nop
    1460:	0621ff2c 	bgez	s1,1114 <rtl8139_rx_interrupt+0x40>
    1464:	3c020010 	lui	v0,0x10

			}
	}
#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;
    1468:	8fa20018 	lw	v0,24(sp)
    146c:	00000000 	nop
    1470:	ae82008c 	sw	v0,140(s4)
}
    1474:	8fbf003c 	lw	ra,60(sp)
    1478:	8fb60038 	lw	s6,56(sp)
    147c:	8fb50034 	lw	s5,52(sp)
    1480:	8fb40030 	lw	s4,48(sp)
    1484:	8fb3002c 	lw	s3,44(sp)
    1488:	8fb20028 	lw	s2,40(sp)
    148c:	8fb10024 	lw	s1,36(sp)
    1490:	8fb00020 	lw	s0,32(sp)
    1494:	03e00008 	jr	ra
    1498:	27bd0040 	addiu	sp,sp,64

0000149c <rtl8139_interrupt>:
    149c:	27bdffd8 	addiu	sp,sp,-40
    14a0:	afbf0020 	sw	ra,32(sp)
    14a4:	afb3001c 	sw	s3,28(sp)
    14a8:	afb20018 	sw	s2,24(sp)
    14ac:	afb10014 	sw	s1,20(sp)
    14b0:	afb00010 	sw	s0,16(sp)
    14b4:	00a01021 	move	v0,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;
    14b8:	00409021 	move	s2,v0
	struct rtl8139_private *tp = (struct rtl8139_private *) dev->priv;
    14bc:	8e510064 	lw	s1,100(s2)
    14c0:	00000000 	nop
	void *ioaddr = tp->mmio_addr;
    14c4:	8e330000 	lw	s3,0(s1)
    14c8:	00000000 	nop
	return __ioswab16(*(volatile u16 *)(mips_io_port_base + port));
}

static inline unsigned int inl(unsigned long port)
{
    14cc:	26620024 	addiu	v0,s3,36
	return __ioswab32(*(volatile u32 *)(mips_io_port_base + port));
    14d0:	3c030000 	lui	v1,0x0
    14d4:	8c630000 	lw	v1,0(v1)
    14d8:	00000000 	nop
    14dc:	00621021 	addu	v0,v1,v0
    14e0:	8c500000 	lw	s0,0(v0)
    14e4:	00000000 	nop
	int status = 0;  /* avoid bogus "uninit" warning */

	spin_lock (&tp->lock);

		status = RTL_R32 (NIC_ISR);

		RTL_W32_F (NIC_ISR,  status);
    14e8:	00731821 	addu	v1,v1,s3
    14ec:	ac700024 	sw	s0,36(v1)
		status &= tp->intr_mask;
    14f0:	8e220088 	lw	v0,136(s1)
    14f4:	00000000 	nop
    14f8:	02028024 	and	s0,s0,v0
		/* Check uncommon events with one test. */
#if 0
		if (status & (RxErrStats))
			printk("RxErr on %s\n", dev->name);
#endif	
		if (status & (TxErrStats))
    14fc:	32020080 	andi	v0,s0,0x80
    1500:	10400006 	beqz	v0,151c <rtl8139_interrupt+0x80>
    1504:	32020008 	andi	v0,s0,0x8
			printk("TxErr on %s\n", dev->name);
    1508:	3c040000 	lui	a0,0x0
    150c:	248402e8 	addiu	a0,a0,744
    1510:	0c000000 	jal	0 <rtl8139_quick_reset>
    1514:	00000000 	nop
	
		if (status & (RxDescUnStats))
    1518:	32020008 	andi	v0,s0,0x8
    151c:	10400006 	beqz	v0,1538 <rtl8139_interrupt+0x9c>
    1520:	32020010 	andi	v0,s0,0x10
			printk("RxDescUn on %s\n", dev->name);
    1524:	3c040000 	lui	a0,0x0
    1528:	248402f8 	addiu	a0,a0,760
    152c:	0c000000 	jal	0 <rtl8139_quick_reset>
    1530:	02402821 	move	a1,s2
	
		if (status & (RxFFOvMask))
    1534:	32020010 	andi	v0,s0,0x10
    1538:	10400014 	beqz	v0,158c <rtl8139_interrupt+0xf0>
    153c:	02402021 	move	a0,s2
		{
			// 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);
    1540:	3c040000 	lui	a0,0x0
    1544:	24840308 	addiu	a0,a0,776
    1548:	0c000000 	jal	0 <rtl8139_quick_reset>
    154c:	02402821 	move	a1,s2
			// 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); 
    1550:	8e230088 	lw	v1,136(s1)
    1554:	2402ffe7 	li	v0,-25
    1558:	00621824 	and	v1,v1,v0
    155c:	ae230088 	sw	v1,136(s1)
			RTL_W32_F(NIC_IMR, tp->intr_mask);
    1560:	3c020000 	lui	v0,0x0
    1564:	8c420000 	lw	v0,0(v0)
    1568:	00000000 	nop
    156c:	00531021 	addu	v0,v0,s3
    1570:	ac430020 	sw	v1,32(v0)
			mod_timer(&tp->rxtimer, jiffies + 5);
    1574:	26240074 	addiu	a0,s1,116
    1578:	3c050000 	lui	a1,0x0
    157c:	8ca50000 	lw	a1,0(a1)
    1580:	0c000000 	jal	0 <rtl8139_quick_reset>
    1584:	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);
    1588:	02402021 	move	a0,s2
    158c:	02202821 	move	a1,s1
    1590:	0c000435 	jal	10d4 <rtl8139_rx_interrupt>
    1594:	02603021 	move	a2,s3
            rtl8139_tx_interrupt (dev, tp, ioaddr);
    1598:	02402021 	move	a0,s2
    159c:	02202821 	move	a1,s1
    15a0:	0c000319 	jal	c64 <rtl8139_tx_interrupt>
    15a4:	02603021 	move	a2,s3
#endif

	spin_unlock (&tp->lock);
}
    15a8:	8fbf0020 	lw	ra,32(sp)
    15ac:	8fb3001c 	lw	s3,28(sp)
    15b0:	8fb20018 	lw	s2,24(sp)
    15b4:	8fb10014 	lw	s1,20(sp)
    15b8:	8fb00010 	lw	s0,16(sp)
    15bc:	03e00008 	jr	ra
    15c0:	27bd0028 	addiu	sp,sp,40

000015c4 <rtl8139_close>:
    15c4:	27bdffe0 	addiu	sp,sp,-32
    15c8:	afbf001c 	sw	ra,28(sp)
    15cc:	afb20018 	sw	s2,24(sp)
    15d0:	afb10014 	sw	s1,20(sp)
    15d4:	afb00010 	sw	s0,16(sp)
    15d8:	00809021 	move	s2,a0


static int rtl8139_close (struct net_device *dev)
{
	struct rtl8139_private *tp = (struct rtl8139_private *) dev->priv;
    15dc:	8e510064 	lw	s1,100(s2)
    15e0:	00000000 	nop
	void *ioaddr = tp->mmio_addr;
    15e4:	8e300000 	lw	s0,0(s1)
    15e8:	00000000 	nop
	unsigned long flags;
	printk("before close, nr_free_pages=%08x\n", nr_free_pages());
    15ec:	0c000000 	jal	0 <rtl8139_quick_reset>
    15f0:	00000000 	nop
    15f4:	3c040000 	lui	a0,0x0
    15f8:	2484031c 	addiu	a0,a0,796
    15fc:	0c000000 	jal	0 <rtl8139_quick_reset>
    1600:	00402821 	move	a1,v0
	__bi_flags;

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

	netif_stop_queue (dev);

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

	spin_lock_irqsave (&tp->lock, flags);
    1660:	40056000 	mfc0	a1,$12
    1664:	00000000 	nop
    1668:	34a10001 	ori	at,a1,0x1
    166c:	38210001 	xori	at,at,0x1
    1670:	40816000 	mtc0	at,$12
    1674:	00000040 	sll	zero,zero,0x1
    1678:	00000040 	sll	zero,zero,0x1
    167c:	00000040 	sll	zero,zero,0x1

	/* Disable interrupts by clearing the interrupt mask. */
	RTL_W32 (NIC_IMR, 0x0000);
    1680:	3c030000 	lui	v1,0x0
    1684:	8c630000 	lw	v1,0(v1)
    1688:	00000000 	nop
    168c:	00702021 	addu	a0,v1,s0
    1690:	ac800020 	sw	zero,32(a0)
}

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

	/* Stop the chip's Tx and Rx DMA processes. */
	RTL_W32 (NIC_CNR1, (RTL_R32 (NIC_CNR1) & ((~RxEnable) | (~TxEnable))));
    169c:	ac820000 	sw	v0,0(a0)
	return __ioswab16(*(volatile u16 *)(mips_io_port_base + port));
}

static inline unsigned int inl(unsigned long port)
{
    16a0:	26100088 	addiu	s0,s0,136
	return __ioswab32(*(volatile u32 *)(mips_io_port_base + port));
    16a4:	00701821 	addu	v1,v1,s0
    16a8:	8c620000 	lw	v0,0(v1)
    16ac:	00000000 	nop

	/* Update the error counts. */
	tp->stats.rx_missed_errors += (RTL_R32 (NIC_RXERR) & 0xffff);
    16b0:	3042ffff 	andi	v0,v0,0xffff
    16b4:	8e230040 	lw	v1,64(s1)
    16b8:	00000000 	nop
    16bc:	00431021 	addu	v0,v0,v1
    16c0:	ae220040 	sw	v0,64(s1)
	RTL_W32 (NIC_RXERR, 0);
    16c4:	ac800088 	sw	zero,136(a0)

	spin_unlock_irqrestore (&tp->lock, flags);
    16c8:	40016000 	mfc0	at,$12
    16cc:	30a50001 	andi	a1,a1,0x1
    16d0:	34210001 	ori	at,at,0x1
    16d4:	38210001 	xori	at,at,0x1
    16d8:	00a12825 	or	a1,a1,at
    16dc:	40856000 	mtc0	a1,$12
	...

	/* snooze for a small bit */
	if (current->need_resched)
    16ec:	8f820014 	lw	v0,20(gp)
    16f0:	00000000 	nop
    16f4:	10400003 	beqz	v0,1704 <rtl8139_close+0x140>
    16f8:	00000000 	nop
		schedule ();
    16fc:	0c000000 	jal	0 <rtl8139_quick_reset>
    1700:	00000000 	nop

	free_irq (dev->irq, dev);
    1704:	8e440024 	lw	a0,36(s2)
    1708:	0c000000 	jal	0 <rtl8139_quick_reset>
    170c:	02402821 	move	a1,s2

	rtl8139_sw_free(tp);
    1710:	0c0000b7 	jal	2dc <rtl8139_sw_free>
    1714:	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());
    1718:	0c000000 	jal	0 <rtl8139_quick_reset>
    171c:	00000000 	nop
    1720:	3c040000 	lui	a0,0x0
    1724:	24840340 	addiu	a0,a0,832
    1728:	0c000000 	jal	0 <rtl8139_quick_reset>
    172c:	00402821 	move	a1,v0
	DPRINTK ("EXIT\n");
	return 0;
    1730:	00001021 	move	v0,zero
}
    1734:	8fbf001c 	lw	ra,28(sp)
    1738:	8fb20018 	lw	s2,24(sp)
    173c:	8fb10014 	lw	s1,20(sp)
    1740:	8fb00010 	lw	s0,16(sp)
    1744:	03e00008 	jr	ra
    1748:	27bd0020 	addiu	sp,sp,32

0000174c <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;
}
    174c:	03e00008 	jr	ra
    1750:	2402ff86 	li	v0,-122

00001754 <rtl8139_get_stats>:
    1754:	27bdffd8 	addiu	sp,sp,-40
    1758:	afbf0024 	sw	ra,36(sp)
    175c:	afb20020 	sw	s2,32(sp)
    1760:	afb1001c 	sw	s1,28(sp)
    1764:	afb00018 	sw	s0,24(sp)
    1768:	00809021 	move	s2,a0


static struct net_device_stats *rtl8139_get_stats (struct net_device *dev)
{
	struct rtl8139_private *tp = (struct rtl8139_private *) dev->priv;
    176c:	8e500064 	lw	s0,100(s2)
    1770:	00000000 	nop
	void *ioaddr = tp->mmio_addr;
    1774:	8e110000 	lw	s1,0(s0)
    1778:	00000000 	nop

	DPRINTK ("ENTER\n");

	assert (tp != NULL);
    177c:	1600000b 	bnez	s0,17ac <rtl8139_get_stats+0x58>
    1780:	2402048f 	li	v0,1167
    1784:	3c040000 	lui	a0,0x0
    1788:	2484007c 	addiu	a0,a0,124
    178c:	3c050000 	lui	a1,0x0
    1790:	24a500e0 	addiu	a1,a1,224
    1794:	3c060000 	lui	a2,0x0
    1798:	24c600b0 	addiu	a2,a2,176
    179c:	3c070000 	lui	a3,0x0
    17a0:	24e70364 	addiu	a3,a3,868
    17a4:	0c000000 	jal	0 <rtl8139_quick_reset>
    17a8:	afa20010 	sw	v0,16(sp)
 * @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;
    17ac:	8e42002c 	lw	v0,44(s2)
    17b0:	00000000 	nop
    17b4:	00021042 	srl	v0,v0,0x1
    17b8:	30420001 	andi	v0,v0,0x1

	if (netif_running(dev)) {
    17bc:	10400021 	beqz	v0,1844 <rtl8139_get_stats+0xf0>
    17c0:	26020004 	addiu	v0,s0,4
		unsigned long flags;

		spin_lock_irqsave (&tp->lock, flags);
    17c4:	40056000 	mfc0	a1,$12
    17c8:	00000000 	nop
    17cc:	34a10001 	ori	at,a1,0x1
    17d0:	38210001 	xori	at,at,0x1
    17d4:	40816000 	mtc0	at,$12
    17d8:	00000040 	sll	zero,zero,0x1
    17dc:	00000040 	sll	zero,zero,0x1
    17e0:	00000040 	sll	zero,zero,0x1
	return __ioswab16(*(volatile u16 *)(mips_io_port_base + port));
}

static inline unsigned int inl(unsigned long port)
{
    17e4:	26220088 	addiu	v0,s1,136
	return __ioswab32(*(volatile u32 *)(mips_io_port_base + port));
    17e8:	3c040000 	lui	a0,0x0
    17ec:	8c840000 	lw	a0,0(a0)
    17f0:	00000000 	nop
    17f4:	00821021 	addu	v0,a0,v0
    17f8:	8c420000 	lw	v0,0(v0)
    17fc:	00000000 	nop

		tp->stats.rx_missed_errors += RTL_R32 (NIC_RXERR) & 0xffff;
    1800:	3042ffff 	andi	v0,v0,0xffff
    1804:	8e030040 	lw	v1,64(s0)
    1808:	00000000 	nop
    180c:	00431021 	addu	v0,v0,v1
    1810:	ae020040 	sw	v0,64(s0)
		RTL_W32 (NIC_RXERR, 0);
    1814:	00912021 	addu	a0,a0,s1
    1818:	ac800088 	sw	zero,136(a0)

		spin_unlock_irqrestore (&tp->lock, flags);
    181c:	40016000 	mfc0	at,$12
    1820:	30a50001 	andi	a1,a1,0x1
    1824:	34210001 	ori	at,at,0x1
    1828:	38210001 	xori	at,at,0x1
    182c:	00a12825 	or	a1,a1,at
    1830:	40856000 	mtc0	a1,$12
	...
	}

	DPRINTK ("EXIT\n");
	return &tp->stats;
    1840:	26020004 	addiu	v0,s0,4
}
    1844:	8fbf0024 	lw	ra,36(sp)
    1848:	8fb20020 	lw	s2,32(sp)
    184c:	8fb1001c 	lw	s1,28(sp)
    1850:	8fb00018 	lw	s0,24(sp)
    1854:	03e00008 	jr	ra
    1858:	27bd0028 	addiu	sp,sp,40

0000185c <rtl8139_set_rx_mode>:
    185c:	27bdffe0 	addiu	sp,sp,-32
    1860:	afbf001c 	sw	ra,28(sp)
    1864:	afb00018 	sw	s0,24(sp)
    1868:	00805821 	move	t3,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;
    186c:	8d620064 	lw	v0,100(t3)
    1870:	00000000 	nop
	void *ioaddr = tp->mmio_addr;
    1874:	8c500000 	lw	s0,0(v0)
    1878:	00000000 	nop
	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) {
    187c:	95620054 	lhu	v0,84(t3)
    1880:	00000000 	nop
    1884:	30420100 	andi	v0,v0,0x100
    1888:	10400007 	beqz	v0,18a8 <rtl8139_set_rx_mode+0x4c>
    188c:	00000000 	nop
		/* Unconditionally log net taps. */
		printk (KERN_NOTICE "%s: Promiscuous mode enabled.\n",
    1890:	3c040000 	lui	a0,0x0
    1894:	2484037c 	addiu	a0,a0,892
    1898:	0c000000 	jal	0 <rtl8139_quick_reset>
    189c:	01602821 	move	a1,t3
			dev->name);
		rx_mode = AB | AM | APM | AAP;
		mc_filter[1] = mc_filter[0] = 0xffffffff;
    18a0:	08000636 	j	18d8 <rtl8139_set_rx_mode+0x7c>
    18a4:	240d00f0 	li	t5,240
	} else if ((dev->mc_count > multicast_filter_limit)
		   || (dev->flags & IFF_ALLMULTI)) {
    18a8:	8d630084 	lw	v1,132(t3)
    18ac:	3c020000 	lui	v0,0x0
    18b0:	8c420004 	lw	v0,4(v0)
    18b4:	00000000 	nop
    18b8:	0043102a 	slt	v0,v0,v1
    18bc:	14400006 	bnez	v0,18d8 <rtl8139_set_rx_mode+0x7c>
    18c0:	240d00e0 	li	t5,224
    18c4:	95620054 	lhu	v0,84(t3)
    18c8:	00000000 	nop
    18cc:	30420200 	andi	v0,v0,0x200
    18d0:	10400005 	beqz	v0,18e8 <rtl8139_set_rx_mode+0x8c>
    18d4:	00000000 	nop
		/* Too many to filter perfectly -- accept all multicasts. */
		rx_mode = AB | AM| APM;
		mc_filter[1] = mc_filter[0] = 0xffffffff;
    18d8:	2402ffff 	li	v0,-1
    18dc:	afa20010 	sw	v0,16(sp)
    18e0:	08000687 	j	1a1c <rtl8139_set_rx_mode+0x1c0>
    18e4:	afa20014 	sw	v0,20(sp)
	} else {
		struct dev_mc_list *mclist;
		rx_mode = AB | AM | APM;
		mc_filter[1] = mc_filter[0] = 0;
    18e8:	afa00010 	sw	zero,16(sp)
    18ec:	afa00014 	sw	zero,20(sp)
		for (i = 0, mclist = dev->mc_list; mclist && i < dev->mc_count;
    18f0:	8d690080 	lw	t1,128(t3)
    18f4:	00000000 	nop
    18f8:	11200048 	beqz	t1,1a1c <rtl8139_set_rx_mode+0x1c0>
    18fc:	00005021 	move	t2,zero
    1900:	8d620084 	lw	v0,132(t3)
    1904:	00000000 	nop
    1908:	0142102a 	slt	v0,t2,v0
    190c:	10400043 	beqz	v0,1a1c <rtl8139_set_rx_mode+0x1c0>
    1910:	00000000 	nop
    1914:	3c0c04c1 	lui	t4,0x4c1
    1918:	358c1db7 	ori	t4,t4,0x1db7
    191c:	27af0010 	addiu	t7,sp,16
    1920:	240e0001 	li	t6,1
    1924:	25260004 	addiu	a2,t1,4
    1928:	2405ffff 	li	a1,-1
    192c:	24080005 	li	t0,5
    1930:	90c40000 	lbu	a0,0(a2)
    1934:	24c60001 	addiu	a2,a2,1
    1938:	00003821 	move	a3,zero
    193c:	00051840 	sll	v1,a1,0x1
    1940:	04a10006 	bgez	a1,195c <rtl8139_set_rx_mode+0x100>
    1944:	30820001 	andi	v0,a0,0x1
    1948:	38420001 	xori	v0,v0,0x1
    194c:	14400005 	bnez	v0,1964 <rtl8139_set_rx_mode+0x108>
    1950:	00000000 	nop
    1954:	0800065c 	j	1970 <rtl8139_set_rx_mode+0x114>
    1958:	00601021 	move	v0,v1
    195c:	10400003 	beqz	v0,196c <rtl8139_set_rx_mode+0x110>
    1960:	00000000 	nop
    1964:	0800065c 	j	1970 <rtl8139_set_rx_mode+0x114>
    1968:	006c1026 	xor	v0,v1,t4
    196c:	00601021 	move	v0,v1
    1970:	00402821 	move	a1,v0
    1974:	24e70001 	addiu	a3,a3,1
    1978:	28e20008 	slti	v0,a3,8
    197c:	1440ffef 	bnez	v0,193c <rtl8139_set_rx_mode+0xe0>
    1980:	00042042 	srl	a0,a0,0x1
    1984:	2508ffff 	addiu	t0,t0,-1
    1988:	0501ffe9 	bgez	t0,1930 <rtl8139_set_rx_mode+0xd4>
    198c:	00051682 	srl	v0,a1,0x1a
	int	mask;
	volatile int	*a = addr;
	__bi_flags;

	a += nr >> 5;
    1990:	00022943 	sra	a1,v0,0x5
    1994:	00052880 	sll	a1,a1,0x2
    1998:	01e52821 	addu	a1,t7,a1
	mask = 1 << (nr & 0x1f);
    199c:	3042001f 	andi	v0,v0,0x1f
    19a0:	004e1004 	sllv	v0,t6,v0
	__bi_save_and_cli(flags);
    19a4:	40046000 	mfc0	a0,$12
    19a8:	00000000 	nop
    19ac:	34810001 	ori	at,a0,0x1
    19b0:	38210001 	xori	at,at,0x1
    19b4:	40816000 	mtc0	at,$12
    19b8:	00000040 	sll	zero,zero,0x1
    19bc:	00000040 	sll	zero,zero,0x1
    19c0:	00000040 	sll	zero,zero,0x1
	*a |= mask;
    19c4:	8ca30000 	lw	v1,0(a1)
    19c8:	00000000 	nop
    19cc:	00431025 	or	v0,v0,v1
    19d0:	aca20000 	sw	v0,0(a1)
	__bi_restore_flags(flags);
    19d4:	40016000 	mfc0	at,$12
    19d8:	30840001 	andi	a0,a0,0x1
    19dc:	34210001 	ori	at,at,0x1
    19e0:	38210001 	xori	at,at,0x1
    19e4:	00812025 	or	a0,a0,at
    19e8:	40846000 	mtc0	a0,$12
	...
    19f8:	8d290000 	lw	t1,0(t1)
    19fc:	00000000 	nop
    1a00:	11200006 	beqz	t1,1a1c <rtl8139_set_rx_mode+0x1c0>
    1a04:	254a0001 	addiu	t2,t2,1
    1a08:	8d620084 	lw	v0,132(t3)
    1a0c:	00000000 	nop
    1a10:	0142102a 	slt	v0,t2,v0
    1a14:	1440ffc3 	bnez	v0,1924 <rtl8139_set_rx_mode+0xc8>
    1a18:	00000000 	nop
		     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 ())
    1a1c:	3c020000 	lui	v0,0x0
    1a20:	8c420004 	lw	v0,4(v0)
    1a24:	00000000 	nop
    1a28:	1440000a 	bnez	v0,1a54 <rtl8139_set_rx_mode+0x1f8>
    1a2c:	3c02500c 	lui	v0,0x500c

extern __inline__ void
__cli(void)
{
	__asm__ __volatile__(
    1a30:	40016000 	mfc0	at,$12
    1a34:	00000000 	nop
    1a38:	34210001 	ori	at,at,0x1
    1a3c:	38210001 	xori	at,at,0x1
    1a40:	40816000 	mtc0	at,$12
    1a44:	00000040 	sll	zero,zero,0x1
    1a48:	00000040 	sll	zero,zero,0x1
    1a4c:	00000040 	sll	zero,zero,0x1
		spin_lock_irq (&tp->lock);

	/* We can safely update without stopping the chip. */
	tmp = rtl8139_trx_config | rx_mode | TxEnable | RxEnable ; 
    1a50:	3c02500c 	lui	v0,0x500c
    1a54:	34422000 	ori	v0,v0,0x2000
    1a58:	01a21025 	or	v0,t5,v0
	RTL_W32_F(NIC_CNR1, tmp);
    1a5c:	3c030000 	lui	v1,0x0
    1a60:	8c630000 	lw	v1,0(v1)
    1a64:	00000000 	nop
    1a68:	00701821 	addu	v1,v1,s0
    1a6c:	ac620000 	sw	v0,0(v1)
	RTL_W32_F (NIC_MAR + 0, mc_filter[0]);
    1a70:	8fa20010 	lw	v0,16(sp)
    1a74:	00000000 	nop
    1a78:	ac62000c 	sw	v0,12(v1)
	RTL_W32_F (NIC_MAR + 4, mc_filter[1]);
    1a7c:	8fa20014 	lw	v0,20(sp)
    1a80:	00000000 	nop
    1a84:	ac620010 	sw	v0,16(v1)

	if (!in_irq ())
    1a88:	3c020000 	lui	v0,0x0
    1a8c:	8c420004 	lw	v0,4(v0)
    1a90:	00000000 	nop
    1a94:	14400008 	bnez	v0,1ab8 <rtl8139_set_rx_mode+0x25c>
    1a98:	00000000 	nop

extern __inline__ void
__sti(void)
{
	__asm__ __volatile__(
    1a9c:	40016000 	mfc0	at,$12
    1aa0:	00000000 	nop
    1aa4:	3421001f 	ori	at,at,0x1f
    1aa8:	3821001e 	xori	at,at,0x1e
    1aac:	40816000 	mtc0	at,$12
	...
		spin_unlock_irq (&tp->lock);

	DPRINTK ("EXIT\n");
}
    1ab8:	8fbf001c 	lw	ra,28(sp)
    1abc:	8fb00018 	lw	s0,24(sp)
    1ac0:	03e00008 	jr	ra
    1ac4:	27bd0020 	addiu	sp,sp,32
	...
Disassembly of section .text.init:

00000000 <rtl8139_init_board>:
   0:	27bdffd8 	addiu	sp,sp,-40
   4:	afbf0020 	sw	ra,32(sp)
   8:	afb3001c 	sw	s3,28(sp)
   c:	afb20018 	sw	s2,24(sp)
  10:	afb10014 	sw	s1,20(sp)
  14:	afb00010 	sw	s0,16(sp)
  18:	00808021 	move	s0,a0
	__bi_flags;

	a += nr >> 5;
	mask = 1 << (nr & 0x1f);
	__bi_save_and_cli(flags);
  1c:	00a09821 	move	s3,a1
  20:	00c09021 	move	s2,a2
  24:	ae400000 	sw	zero,0(s2)
  28:	ae600000 	sw	zero,0(s3)
  2c:	00002021 	move	a0,zero
  30:	0c000000 	jal	0 <rtl8139_init_board>
  34:	240502b4 	li	a1,692
  38:	00408821 	move	s1,v0
	*a |= mask;
  3c:	16200007 	bnez	s1,5c <rtl8139_init_board+0x5c>
  40:	00000000 	nop
  44:	3c040000 	lui	a0,0x0
  48:	24840008 	addiu	a0,a0,8
	__bi_restore_flags(flags);
  4c:	0c000000 	jal	0 <rtl8139_init_board>
  50:	00000000 	nop
  54:	0800005c 	j	170 <rtl8139_init_board+0x170>
  58:	2402fff4 	li	v0,-12
  5c:	8e230064 	lw	v1,100(s1)
  60:	00000000 	nop
  64:	a06002aa 	sb	zero,682(v1)
  68:	24020011 	li	v0,17
  6c:	a06202ab 	sb	v0,683(v1)
  70:	00101080 	sll	v0,s0,0x2
  74:	24420022 	addiu	v0,v0,34

extern __inline__ void
__cli(void)
{
	__asm__ __volatile__(
  78:	a06202ac 	sb	v0,684(v1)
  7c:	24020033 	li	v0,51
  80:	a06202ad 	sb	v0,685(v1)
  84:	24020044 	li	v0,68
  88:	a06202ae 	sb	v0,686(v1)
  8c:	a06002af 	sb	zero,687(v1)
  90:	26260074 	addiu	a2,s1,116
  94:	846202aa 	lh	v0,682(v1)
  98:	846402ac 	lh	a0,684(v1)
  9c:	846502ae 	lh	a1,686(v1)
  a0:	a6220074 	sh	v0,116(s1)
  a4:	a6240076 	sh	a0,118(s1)
  a8:	a6250078 	sh	a1,120(s1)
  ac:	00101300 	sll	v0,s0,0xc
  b0:	24502000 	addiu	s0,v0,8192
  b4:	3c040000 	lui	a0,0x0
  b8:	24840034 	addiu	a0,a0,52
  bc:	0c000000 	jal	0 <rtl8139_init_board>
  c0:	02202821 	move	a1,s1
  c4:	3c030000 	lui	v1,0x0
  c8:	8c630000 	lw	v1,0(v1)
  cc:	00000000 	nop
  d0:	00701821 	addu	v1,v1,s0
  d4:	8c620000 	lw	v0,0(v1)
  d8:	00000000 	nop
  dc:	3c040010 	lui	a0,0x10
  e0:	00441025 	or	v0,v0,a0
  e4:	ac620000 	sw	v0,0(v1)
  e8:	240503e8 	li	a1,1000
  ec:	00603021 	move	a2,v1
  f0:	3c070010 	lui	a3,0x10
  f4:	3c030000 	lui	v1,0x0
  f8:	8c630000 	lw	v1,0(v1)
  fc:	3c040041 	lui	a0,0x41
 100:	34848930 	ori	a0,a0,0x8930
 104:	8cc20000 	lw	v0,0(a2)
 108:	00000000 	nop
 10c:	00471024 	and	v0,v0,a3
 110:	1040000a 	beqz	v0,13c <rtl8139_init_board+0x13c>
 114:	00000000 	nop
 118:	00830019 	multu	a0,v1
 11c:	00001010 	mfhi	v0
	...
 128:	1440ffff 	bnez	v0,128 <rtl8139_init_board+0x128>
 12c:	2442ffff 	addiu	v0,v0,-1
 130:	24a5ffff 	addiu	a1,a1,-1
 134:	1ca0fff3 	bgtz	a1,104 <rtl8139_init_board+0x104>
 138:	00000000 	nop
 13c:	3c020000 	lui	v0,0x0
 140:	8c420000 	lw	v0,0(v0)
 144:	00000000 	nop
 148:	00501021 	addu	v0,v0,s0
 14c:	8c430000 	lw	v1,0(v0)
 150:	00000000 	nop
 154:	3c04ffef 	lui	a0,0xffef
 158:	3484ffff 	ori	a0,a0,0xffff
 15c:	00641824 	and	v1,v1,a0
 160:	ac430000 	sw	v1,0(v0)
 164:	ae500000 	sw	s0,0(s2)
 168:	ae710000 	sw	s1,0(s3)
 16c:	00001021 	move	v0,zero
 170:	8fbf0020 	lw	ra,32(sp)
 174:	8fb3001c 	lw	s3,28(sp)
 178:	8fb20018 	lw	s2,24(sp)
 17c:	8fb10014 	lw	s1,20(sp)
 180:	8fb00010 	lw	s0,16(sp)
 184:	03e00008 	jr	ra
 188:	27bd0028 	addiu	sp,sp,40

0000018c <rtl8139_init_one>:
 18c:	27bdffd0 	addiu	sp,sp,-48
 190:	afbf0028 	sw	ra,40(sp)
 194:	afb10024 	sw	s1,36(sp)
 198:	afb00020 	sw	s0,32(sp)
 19c:	00808821 	move	s1,a0
 1a0:	afa00018 	sw	zero,24(sp)
 1a4:	afa0001c 	sw	zero,28(sp)
 1a8:	27a50018 	addiu	a1,sp,24
 1ac:	0c000000 	jal	0 <rtl8139_init_board>
 1b0:	27a6001c 	addiu	a2,sp,28
 1b4:	00401821 	move	v1,v0
 1b8:	04600075 	bltz	v1,390 <rtl8139_init_one+0x204>
 1bc:	00000000 	nop
 1c0:	8fa20018 	lw	v0,24(sp)
 1c4:	00000000 	nop
 1c8:	8c500064 	lw	s0,100(v0)
 1cc:	00000000 	nop
 1d0:	8fa6001c 	lw	a2,28(sp)
 1d4:	3c020000 	lui	v0,0x0
 1d8:	8c420000 	lw	v0,0(v0)
 1dc:	00000000 	nop
 1e0:	00c23021 	addu	a2,a2,v0
 1e4:	3c040000 	lui	a0,0x0
 1e8:	24840058 	addiu	a0,a0,88
 1ec:	0c000000 	jal	0 <rtl8139_init_board>
 1f0:	02202821 	move	a1,s1
 1f4:	8fa2001c 	lw	v0,28(sp)
 1f8:	00000000 	nop
 1fc:	1440000b 	bnez	v0,22c <rtl8139_init_one+0xa0>
 200:	24020173 	li	v0,371
 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:	0c000000 	jal	0 <rtl8139_init_board>
 228:	afa20010 	sw	v0,16(sp)
 22c:	8fa20018 	lw	v0,24(sp)
 230:	00000000 	nop
 234:	1440000b 	bnez	v0,264 <rtl8139_init_one+0xd8>
 238:	24020174 	li	v0,372
 23c:	3c040000 	lui	a0,0x0
 240:	2484007c 	addiu	a0,a0,124
 244:	3c050000 	lui	a1,0x0
 248:	24a500d4 	addiu	a1,a1,212
 24c:	3c060000 	lui	a2,0x0
 250:	24c600b0 	addiu	a2,a2,176
 254:	3c070000 	lui	a3,0x0
 258:	24e700c0 	addiu	a3,a3,192
 25c:	0c000000 	jal	0 <rtl8139_init_board>
 260:	afa20010 	sw	v0,16(sp)
 264:	1600000b 	bnez	s0,294 <rtl8139_init_one+0x108>
 268:	24020175 	li	v0,373
 26c:	3c040000 	lui	a0,0x0
 270:	2484007c 	addiu	a0,a0,124
 274:	3c050000 	lui	a1,0x0
 278:	24a500e0 	addiu	a1,a1,224
 27c:	3c060000 	lui	a2,0x0
 280:	24c600b0 	addiu	a2,a2,176
 284:	3c070000 	lui	a3,0x0
 288:	24e700c0 	addiu	a3,a3,192
 28c:	0c000000 	jal	0 <rtl8139_init_board>
 290:	afa20010 	sw	v0,16(sp)
 294:	3c030000 	lui	v1,0x0
 298:	246304c4 	addiu	v1,v1,1220
 29c:	8fa20018 	lw	v0,24(sp)
 2a0:	00000000 	nop
 2a4:	ac4300e8 	sw	v1,232(v0)
 2a8:	3c030000 	lui	v1,0x0
 2ac:	24630994 	addiu	v1,v1,2452
 2b0:	8fa20018 	lw	v0,24(sp)
 2b4:	00000000 	nop
 2b8:	ac4300f0 	sw	v1,240(v0)
 2bc:	3c030000 	lui	v1,0x0
 2c0:	246315c4 	addiu	v1,v1,5572
 2c4:	8fa20018 	lw	v0,24(sp)
 2c8:	00000000 	nop
 2cc:	ac4300ec 	sw	v1,236(v0)
 2d0:	3c030000 	lui	v1,0x0
 2d4:	24631754 	addiu	v1,v1,5972
 2d8:	8fa20018 	lw	v0,24(sp)
 2dc:	00000000 	nop
 2e0:	ac430044 	sw	v1,68(v0)
 2e4:	3c030000 	lui	v1,0x0
 2e8:	2463185c 	addiu	v1,v1,6236
 2ec:	8fa20018 	lw	v0,24(sp)
 2f0:	00000000 	nop
 2f4:	ac4300fc 	sw	v1,252(v0)
 2f8:	3c030000 	lui	v1,0x0
 2fc:	2463174c 	addiu	v1,v1,5964
 300:	8fa20018 	lw	v0,24(sp)
 304:	00000000 	nop
 308:	ac430104 	sw	v1,260(v0)
 30c:	3c030000 	lui	v1,0x0
 310:	24630968 	addiu	v1,v1,2408
 314:	8fa20018 	lw	v0,24(sp)
 318:	00000000 	nop
 31c:	ac430118 	sw	v1,280(v0)
 320:	24030258 	li	v1,600
 324:	8fa20018 	lw	v0,24(sp)
 328:	00000000 	nop
 32c:	ac430090 	sw	v1,144(v0)
 330:	26230005 	addiu	v1,s1,5
 334:	8fa20018 	lw	v0,24(sp)
 338:	00000000 	nop
 33c:	ac430024 	sw	v1,36(v0)
 340:	8fa3001c 	lw	v1,28(sp)
 344:	8fa20018 	lw	v0,24(sp)
 348:	00000000 	nop
 34c:	ac430020 	sw	v1,32(v0)
 350:	8fa30018 	lw	v1,24(sp)
 354:	00000000 	nop
 358:	8c6200dc 	lw	v0,220(v1)
 35c:	00000000 	nop
 360:	34420002 	ori	v0,v0,0x2
 364:	ac6200dc 	sw	v0,220(v1)
 368:	8fa20018 	lw	v0,24(sp)
 36c:	00000000 	nop
 370:	8c500064 	lw	s0,100(v0)
 374:	00000000 	nop
 378:	8fa2001c 	lw	v0,28(sp)
 37c:	00000000 	nop
 380:	ae020000 	sw	v0,0(s0)
 384:	24020020 	li	v0,32
 388:	a20202a4 	sb	v0,676(s0)
 38c:	00001021 	move	v0,zero
 390:	8fbf0028 	lw	ra,40(sp)
 394:	8fb10024 	lw	s1,36(sp)
 398:	8fb00020 	lw	s0,32(sp)
 39c:	03e00008 	jr	ra
 3a0:	27bd0030 	addiu	sp,sp,48

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