|
@@ -495,7 +495,7 @@ static int nat_transmit ( struct net_device *netdev, struct io_buffer *iobuf ) {
|
495
|
495
|
* @v netdev Network device
|
496
|
496
|
* @v rx_quota Maximum number of packets to receive
|
497
|
497
|
*/
|
498
|
|
-static void nat_poll ( struct net_device *netdev, unsigned int rx_quota ) {
|
|
498
|
+static void nat_poll ( struct net_device *netdev) {
|
499
|
499
|
struct natsemi_nic *nat = netdev->priv;
|
500
|
500
|
unsigned int status;
|
501
|
501
|
unsigned int rx_status;
|
|
@@ -544,7 +544,7 @@ static void nat_poll ( struct net_device *netdev, unsigned int rx_quota ) {
|
544
|
544
|
/* Handle received packets
|
545
|
545
|
*/
|
546
|
546
|
rx_status=(unsigned int)nat->rx[nat->rx_cur].cmdsts;
|
547
|
|
- while (rx_quota && (rx_status & OWN)) {
|
|
547
|
+ while ((rx_status & OWN)) {
|
548
|
548
|
rx_len= (rx_status & DSIZE) - CRC_SIZE;
|
549
|
549
|
/*check for the corrupt packet
|
550
|
550
|
*/
|
|
@@ -565,7 +565,6 @@ static void nat_poll ( struct net_device *netdev, unsigned int rx_quota ) {
|
565
|
565
|
/* add to the receive queue.
|
566
|
566
|
*/
|
567
|
567
|
netdev_rx(netdev,rx_iob);
|
568
|
|
- rx_quota--;
|
569
|
568
|
}
|
570
|
569
|
nat->rx[nat->rx_cur].cmdsts = RX_BUF_SIZE;
|
571
|
570
|
nat->rx_cur=(nat->rx_cur+1) % NUM_RX_DESC;
|
|
@@ -620,6 +619,7 @@ static int nat_probe ( struct pci_device *pci,
|
620
|
619
|
uint8_t ll_addr_encoded[MAX_LL_ADDR_LEN];
|
621
|
620
|
uint8_t last=0;
|
622
|
621
|
uint8_t last1=0;
|
|
622
|
+ uint8_t prev_bytes[2];
|
623
|
623
|
|
624
|
624
|
/* Allocate net device
|
625
|
625
|
*/
|
|
@@ -641,10 +641,12 @@ static int nat_probe ( struct pci_device *pci,
|
641
|
641
|
*/
|
642
|
642
|
nat_reset ( nat );
|
643
|
643
|
nat_init_eeprom ( nat );
|
|
644
|
+ nvs_read ( &nat->eeprom.nvs, EE_MAC-1, prev_bytes, 1);
|
644
|
645
|
nvs_read ( &nat->eeprom.nvs, EE_MAC, ll_addr_encoded, ETH_ALEN );
|
645
|
646
|
/* decoding the MAC address read from NVS
|
646
|
647
|
* and save it in netdev->ll_addr
|
647
|
648
|
*/
|
|
649
|
+ last=prev_bytes[1]>>7;
|
648
|
650
|
for ( i = 0 ; i < ETH_ALEN ; i++) {
|
649
|
651
|
last1=ll_addr_encoded[i]>>7;
|
650
|
652
|
netdev->ll_addr[i]=ll_addr_encoded[i]<<1|last;
|