Просмотр исходного кода

interrupt in natsemi

tags/v0.9.3
Udayan Kumar 18 лет назад
Родитель
Сommit
5e91a38269
1 измененных файлов: 15 добавлений и 3 удалений
  1. 15
    3
      src/drivers/net/natsemi.c

+ 15
- 3
src/drivers/net/natsemi.c Просмотреть файл

@@ -445,7 +445,7 @@ static void nat_close ( struct net_device *netdev ) {
445 445
 		free_iob( nat->iobuf[i] );
446 446
 	}
447 447
 	/* disable interrupts */
448
-	outl(0,nat->ioaddr +IntrEnable);
448
+	outl(0,nat->ioaddr + IntrMask) ;
449 449
 }
450 450
 
451 451
 /** 
@@ -498,11 +498,21 @@ static void nat_poll ( struct net_device *netdev, unsigned int rx_quota ) {
498 498
 	struct natsemi_nic *nat = netdev->priv;
499 499
 	unsigned int status;
500 500
 	unsigned int rx_status;
501
+	unsigned int intr_status;
501 502
 	unsigned int rx_len;
502 503
 	struct io_buffer *rx_iob;
503 504
 	int i;
504 505
 	
506
+	outl(1,nat->ioaddr +IntrEnable);
507
+	/* read the interrupt register */
508
+	intr_status=inl(nat->ioaddr+IntrStatus);
509
+	if(!intr_status)
510
+	goto end;
511
+
505 512
 	/* check the status of packets given to card for transmission */	
513
+	DBG("Intr status %X\n",intr_status);
514
+
515
+
506 516
 	i=nat->tx_dirty;
507 517
 	while(i!=nat->tx_cur)
508 518
 	{
@@ -551,7 +561,7 @@ static void nat_poll ( struct net_device *netdev, unsigned int rx_quota ) {
551 561
 			rx_iob = alloc_iob(rx_len);
552 562
 			if(!rx_iob) 
553 563
 				/* leave packet for next call to poll*/
554
-				return;
564
+				goto end;
555 565
 			memcpy(iob_put(rx_iob,rx_len),
556 566
 					bus_to_virt(nat->rx[nat->rx_cur].bufptr),rx_len);
557 567
 
@@ -565,9 +575,11 @@ static void nat_poll ( struct net_device *netdev, unsigned int rx_quota ) {
565 575
 		rx_status=(unsigned int)nat->rx[nat->rx_cur].cmdsts; 
566 576
 	}
567 577
 
578
+end:
568 579
 
569 580
 	 /* re-enable the potentially idle receive state machine */
570
-	    outl(RxOn, nat->ioaddr + ChipCmd);	
581
+	outl(RxOn, nat->ioaddr + ChipCmd);	
582
+	outl(1,nat->ioaddr +IntrEnable);
571 583
 }				
572 584
 
573 585
 

Загрузка…
Отмена
Сохранить