| 
				
			 | 
			
			
				
				@@ -195,12 +195,13 @@ enum dmfe_CR6_bits { 
			 | 
		
		
	
		
			
			| 
				195
			 | 
			
				195
			 | 
			
			
				
				 }; 
			 | 
		
		
	
		
			
			| 
				196
			 | 
			
				196
			 | 
			
			
				
				  
			 | 
		
		
	
		
			
			| 
				197
			 | 
			
				197
			 | 
			
			
				
				 /* Global variable declaration ----------------------------- */ 
			 | 
		
		
	
		
			
			| 
				198
			 | 
			
				
			 | 
			
			
				
				-static int dmfe_debug; 
			 | 
		
		
	
		
			
			| 
				
			 | 
			
				198
			 | 
			
			
				
				+static struct nic_operations dmfe_operations; 
			 | 
		
		
	
		
			
			| 
				
			 | 
			
				199
			 | 
			
			
				
				+static struct pci_driver dmfe_driver; 
			 | 
		
		
	
		
			
			| 
				
			 | 
			
				200
			 | 
			
			
				
				+ 
			 | 
		
		
	
		
			
			| 
				199
			 | 
			
				201
			 | 
			
			
				
				 static unsigned char dmfe_media_mode = DMFE_AUTO; 
			 | 
		
		
	
		
			
			| 
				200
			 | 
			
				202
			 | 
			
			
				
				 static u32 dmfe_cr6_user_set; 
			 | 
		
		
	
		
			
			| 
				201
			 | 
			
				203
			 | 
			
			
				
				  
			 | 
		
		
	
		
			
			| 
				202
			 | 
			
				204
			 | 
			
			
				
				 /* For module input parameter */ 
			 | 
		
		
	
		
			
			| 
				203
			 | 
			
				
			 | 
			
			
				
				-static int debug; 
			 | 
		
		
	
		
			
			| 
				204
			 | 
			
				205
			 | 
			
			
				
				 static u8 chkmode = 1; 
			 | 
		
		
	
		
			
			| 
				205
			 | 
			
				206
			 | 
			
			
				
				 static u8 HPNA_mode;		/* Default: Low Power/High Speed */ 
			 | 
		
		
	
		
			
			| 
				206
			 | 
			
				207
			 | 
			
			
				
				 static u8 HPNA_rx_cmd;		/* Default: Disable Rx remote command */ 
			 | 
		
		
	
	
		
			
			| 
				
			 | 
			
			
				
				@@ -245,8 +246,6 @@ static u16 phy_read(unsigned long, u8, u8, u32); 
			 | 
		
		
	
		
			
			| 
				245
			 | 
			
				246
			 | 
			
			
				
				 static void phy_write(unsigned long, u8, u8, u16, u32); 
			 | 
		
		
	
		
			
			| 
				246
			 | 
			
				247
			 | 
			
			
				
				 static void phy_write_1bit(unsigned long, u32); 
			 | 
		
		
	
		
			
			| 
				247
			 | 
			
				248
			 | 
			
			
				
				 static u16 phy_read_1bit(unsigned long); 
			 | 
		
		
	
		
			
			| 
				248
			 | 
			
				
			 | 
			
			
				
				-static u8 dmfe_sense_speed(struct nic *nic); 
			 | 
		
		
	
		
			
			| 
				249
			 | 
			
				
			 | 
			
			
				
				-static void dmfe_process_mode(struct nic *nic); 
			 | 
		
		
	
		
			
			| 
				250
			 | 
			
				249
			 | 
			
			
				
				 static void dmfe_set_phyxcer(struct nic *nic); 
			 | 
		
		
	
		
			
			| 
				251
			 | 
			
				250
			 | 
			
			
				
				  
			 | 
		
		
	
		
			
			| 
				252
			 | 
			
				251
			 | 
			
			
				
				 static void dmfe_parse_srom(struct nic *nic); 
			 | 
		
		
	
	
		
			
			| 
				
			 | 
			
			
				
				@@ -461,19 +460,20 @@ PROBE - Look for an adapter, this routine's visible to the outside 
			 | 
		
		
	
		
			
			| 
				461
			 | 
			
				460
			 | 
			
			
				
				 #define board_found 1 
			 | 
		
		
	
		
			
			| 
				462
			 | 
			
				461
			 | 
			
			
				
				 #define valid_link 0 
			 | 
		
		
	
		
			
			| 
				463
			 | 
			
				462
			 | 
			
			
				
				 static int dmfe_probe ( struct dev *dev ) { 
			 | 
		
		
	
		
			
			| 
				464
			 | 
			
				
			 | 
			
			
				
				- 
			 | 
		
		
	
		
			
			| 
				465
			 | 
			
				463
			 | 
			
			
				
				 	struct nic *nic = nic_device ( dev ); 
			 | 
		
		
	
		
			
			| 
				466
			 | 
			
				
			 | 
			
			
				
				- 
			 | 
		
		
	
		
			
			| 
				467
			 | 
			
				464
			 | 
			
			
				
				 	struct pci_device *pci = pci_device ( dev ); 
			 | 
		
		
	
		
			
			| 
				468
			 | 
			
				465
			 | 
			
			
				
				 	uint32_t dev_rev, pci_pmr; 
			 | 
		
		
	
		
			
			| 
				469
			 | 
			
				466
			 | 
			
			
				
				 	int i; 
			 | 
		
		
	
		
			
			| 
				470
			 | 
			
				467
			 | 
			
			
				
				  
			 | 
		
		
	
		
			
			| 
				
			 | 
			
				468
			 | 
			
			
				
				+	if ( ! find_pci_device ( pci, &dmfe_driver ) ) 
			 | 
		
		
	
		
			
			| 
				
			 | 
			
				469
			 | 
			
			
				
				+		return 0; 
			 | 
		
		
	
		
			
			| 
				
			 | 
			
				470
			 | 
			
			
				
				+ 
			 | 
		
		
	
		
			
			| 
				471
			 | 
			
				471
			 | 
			
			
				
				 	if (pci->ioaddr == 0) 
			 | 
		
		
	
		
			
			| 
				472
			 | 
			
				472
			 | 
			
			
				
				 		return 0; 
			 | 
		
		
	
		
			
			| 
				473
			 | 
			
				473
			 | 
			
			
				
				  
			 | 
		
		
	
		
			
			| 
				474
			 | 
			
				474
			 | 
			
			
				
				 	BASE = pci->ioaddr; 
			 | 
		
		
	
		
			
			| 
				475
			 | 
			
				475
			 | 
			
			
				
				 	printf("dmfe.c: Found %s Vendor=0x%hX Device=0x%hX\n", 
			 | 
		
		
	
		
			
			| 
				476
			 | 
			
				
			 | 
			
			
				
				-	       pci->name, pci->vendor, pci->dev_id); 
			 | 
		
		
	
		
			
			| 
				
			 | 
			
				476
			 | 
			
			
				
				+	       dev->name, pci->vendor, pci->dev_id); 
			 | 
		
		
	
		
			
			| 
				477
			 | 
			
				477
			 | 
			
			
				
				  
			 | 
		
		
	
		
			
			| 
				478
			 | 
			
				478
			 | 
			
			
				
				 	/* Read Chip revision */ 
			 | 
		
		
	
		
			
			| 
				479
			 | 
			
				479
			 | 
			
			
				
				 	pci_read_config_dword(pci, PCI_REVISION_ID, &dev_rev); 
			 | 
		
		
	
	
		
			
			| 
				
			 | 
			
			
				
				@@ -504,7 +504,7 @@ static int dmfe_probe ( struct dev *dev ) { 
			 | 
		
		
	
		
			
			| 
				504
			 | 
			
				504
			 | 
			
			
				
				 		nic->node_addr[i] = db->srom[20 + i]; 
			 | 
		
		
	
		
			
			| 
				505
			 | 
			
				505
			 | 
			
			
				
				  
			 | 
		
		
	
		
			
			| 
				506
			 | 
			
				506
			 | 
			
			
				
				 	/* Print out some hardware info */ 
			 | 
		
		
	
		
			
			| 
				507
			 | 
			
				
			 | 
			
			
				
				-	printf("%s: %! at ioaddr %hX\n", pci->name, nic->node_addr, BASE); 
			 | 
		
		
	
		
			
			| 
				
			 | 
			
				507
			 | 
			
			
				
				+	printf("%s: %! at ioaddr %hX\n", dev->name, nic->node_addr, BASE); 
			 | 
		
		
	
		
			
			| 
				508
			 | 
			
				508
			 | 
			
			
				
				  
			 | 
		
		
	
		
			
			| 
				509
			 | 
			
				509
			 | 
			
			
				
				 	/* Set the card as PCI Bus Master */ 
			 | 
		
		
	
		
			
			| 
				510
			 | 
			
				510
			 | 
			
			
				
				 	adjust_pci_device(pci); 
			 | 
		
		
	
	
		
			
			| 
				
			 | 
			
			
				
				@@ -515,14 +515,7 @@ static int dmfe_probe ( struct dev *dev ) { 
			 | 
		
		
	
		
			
			| 
				515
			 | 
			
				515
			 | 
			
			
				
				 	nic->ioaddr = pci->ioaddr; 
			 | 
		
		
	
		
			
			| 
				516
			 | 
			
				516
			 | 
			
			
				
				  
			 | 
		
		
	
		
			
			| 
				517
			 | 
			
				517
			 | 
			
			
				
				 	/* point to NIC specific routines */ 
			 | 
		
		
	
		
			
			| 
				518
			 | 
			
				
			 | 
			
			
				
				-static struct nic_operations dmfe_operations; 
			 | 
		
		
	
		
			
			| 
				519
			 | 
			
				
			 | 
			
			
				
				-static struct nic_operations dmfe_operations = { 
			 | 
		
		
	
		
			
			| 
				520
			 | 
			
				
			 | 
			
			
				
				-	.connect	= dummy_connect, 
			 | 
		
		
	
		
			
			| 
				521
			 | 
			
				
			 | 
			
			
				
				-	.poll		= dmfe_poll, 
			 | 
		
		
	
		
			
			| 
				522
			 | 
			
				
			 | 
			
			
				
				-	.transmit	= dmfe_transmit, 
			 | 
		
		
	
		
			
			| 
				523
			 | 
			
				
			 | 
			
			
				
				-	.irq		= dmfe_irq, 
			 | 
		
		
	
		
			
			| 
				524
			 | 
			
				
			 | 
			
			
				
				-	.disable	= dmfe_disable, 
			 | 
		
		
	
		
			
			| 
				525
			 | 
			
				
			 | 
			
			
				
				-};	nic->nic_op	= &dmfe_operations; 
			 | 
		
		
	
		
			
			| 
				
			 | 
			
				518
			 | 
			
			
				
				+	nic->nic_op	= &dmfe_operations; 
			 | 
		
		
	
		
			
			| 
				526
			 | 
			
				519
			 | 
			
			
				
				  
			 | 
		
		
	
		
			
			| 
				527
			 | 
			
				520
			 | 
			
			
				
				 	return 1; 
			 | 
		
		
	
		
			
			| 
				528
			 | 
			
				521
			 | 
			
			
				
				 } 
			 | 
		
		
	
	
		
			
			| 
				
			 | 
			
			
				
				@@ -551,7 +544,7 @@ static void dmfe_descriptor_init(struct nic *nic __unused, unsigned long ioaddr) 
			 | 
		
		
	
		
			
			| 
				551
			 | 
			
				544
			 | 
			
			
				
				 		txd[i].tdes1 = cpu_to_le32(0x81000000);	/* IC, chain */ 
			 | 
		
		
	
		
			
			| 
				552
			 | 
			
				545
			 | 
			
			
				
				 		txd[i].tdes2 = cpu_to_le32(virt_to_bus(&txb[i])); 
			 | 
		
		
	
		
			
			| 
				553
			 | 
			
				546
			 | 
			
			
				
				 		txd[i].tdes3 = cpu_to_le32(virt_to_bus(&txd[i + 1])); 
			 | 
		
		
	
		
			
			| 
				554
			 | 
			
				
			 | 
			
			
				
				-		txd[i].next_tx_desc = cpu_to_le32(&txd[i + 1]);	 
			 | 
		
		
	
		
			
			| 
				
			 | 
			
				547
			 | 
			
			
				
				+		txd[i].next_tx_desc = virt_to_le32desc(&txd[i + 1]);	 
			 | 
		
		
	
		
			
			| 
				555
			 | 
			
				548
			 | 
			
			
				
				 	} 
			 | 
		
		
	
		
			
			| 
				556
			 | 
			
				549
			 | 
			
			
				
				 	/* Mark the last entry as wrapping the ring */ 
			 | 
		
		
	
		
			
			| 
				557
			 | 
			
				550
			 | 
			
			
				
				 	txd[i - 1].tdes3 = virt_to_le32desc(&txd[0]); 
			 | 
		
		
	
	
		
			
			| 
				
			 | 
			
			
				
				@@ -565,7 +558,7 @@ static void dmfe_descriptor_init(struct nic *nic __unused, unsigned long ioaddr) 
			 | 
		
		
	
		
			
			| 
				565
			 | 
			
				558
			 | 
			
			
				
				 		rxd[i].rdes2 = 
			 | 
		
		
	
		
			
			| 
				566
			 | 
			
				559
			 | 
			
			
				
				 		    cpu_to_le32(virt_to_bus(&rxb[i * RX_ALLOC_SIZE])); 
			 | 
		
		
	
		
			
			| 
				567
			 | 
			
				560
			 | 
			
			
				
				 		rxd[i].rdes3 = cpu_to_le32(virt_to_bus(&rxd[i + 1])); 
			 | 
		
		
	
		
			
			| 
				568
			 | 
			
				
			 | 
			
			
				
				-		rxd[i].next_rx_desc = cpu_to_le32(&rxd[i + 1]); 
			 | 
		
		
	
		
			
			| 
				
			 | 
			
				561
			 | 
			
			
				
				+		rxd[i].next_rx_desc = virt_to_le32desc(&rxd[i + 1]); 
			 | 
		
		
	
		
			
			| 
				569
			 | 
			
				562
			 | 
			
			
				
				 	} 
			 | 
		
		
	
		
			
			| 
				570
			 | 
			
				563
			 | 
			
			
				
				 	/* Mark the last entry as wrapping the ring */ 
			 | 
		
		
	
		
			
			| 
				571
			 | 
			
				564
			 | 
			
			
				
				 	rxd[i - 1].rdes3 = cpu_to_le32(virt_to_bus(&rxd[0])); 
			 | 
		
		
	
	
		
			
			| 
				
			 | 
			
			
				
				@@ -722,6 +715,7 @@ static u16 read_srom_word(long ioaddr, int offset) 
			 | 
		
		
	
		
			
			| 
				722
			 | 
			
				715
			 | 
			
			
				
				  *	Auto sense the media mode 
			 | 
		
		
	
		
			
			| 
				723
			 | 
			
				716
			 | 
			
			
				
				  */ 
			 | 
		
		
	
		
			
			| 
				724
			 | 
			
				717
			 | 
			
			
				
				  
			 | 
		
		
	
		
			
			| 
				
			 | 
			
				718
			 | 
			
			
				
				+#if 0 /* not used */ 
			 | 
		
		
	
		
			
			| 
				725
			 | 
			
				719
			 | 
			
			
				
				 static u8 dmfe_sense_speed(struct nic *nic __unused) 
			 | 
		
		
	
		
			
			| 
				726
			 | 
			
				720
			 | 
			
			
				
				 { 
			 | 
		
		
	
		
			
			| 
				727
			 | 
			
				721
			 | 
			
			
				
				 	u8 ErrFlag = 0; 
			 | 
		
		
	
	
		
			
			| 
				
			 | 
			
			
				
				@@ -769,7 +763,7 @@ static u8 dmfe_sense_speed(struct nic *nic __unused) 
			 | 
		
		
	
		
			
			| 
				769
			 | 
			
				763
			 | 
			
			
				
				  
			 | 
		
		
	
		
			
			| 
				770
			 | 
			
				764
			 | 
			
			
				
				 	return ErrFlag; 
			 | 
		
		
	
		
			
			| 
				771
			 | 
			
				765
			 | 
			
			
				
				 } 
			 | 
		
		
	
		
			
			| 
				772
			 | 
			
				
			 | 
			
			
				
				- 
			 | 
		
		
	
		
			
			| 
				
			 | 
			
				766
			 | 
			
			
				
				+#endif 
			 | 
		
		
	
		
			
			| 
				773
			 | 
			
				767
			 | 
			
			
				
				  
			 | 
		
		
	
		
			
			| 
				774
			 | 
			
				768
			 | 
			
			
				
				 /* 
			 | 
		
		
	
		
			
			| 
				775
			 | 
			
				769
			 | 
			
			
				
				  *	Set 10/100 phyxcer capability 
			 | 
		
		
	
	
		
			
			| 
				
			 | 
			
			
				
				@@ -841,6 +835,7 @@ static void dmfe_set_phyxcer(struct nic *nic __unused) 
			 | 
		
		
	
		
			
			| 
				841
			 | 
			
				835
			 | 
			
			
				
				  *			N-way force capability with SWITCH 
			 | 
		
		
	
		
			
			| 
				842
			 | 
			
				836
			 | 
			
			
				
				  */ 
			 | 
		
		
	
		
			
			| 
				843
			 | 
			
				837
			 | 
			
			
				
				  
			 | 
		
		
	
		
			
			| 
				
			 | 
			
				838
			 | 
			
			
				
				+#if 0 /* not used */ 
			 | 
		
		
	
		
			
			| 
				844
			 | 
			
				839
			 | 
			
			
				
				 static void dmfe_process_mode(struct nic *nic __unused) 
			 | 
		
		
	
		
			
			| 
				845
			 | 
			
				840
			 | 
			
			
				
				 { 
			 | 
		
		
	
		
			
			| 
				846
			 | 
			
				841
			 | 
			
			
				
				 	u16 phy_reg; 
			 | 
		
		
	
	
		
			
			| 
				
			 | 
			
			
				
				@@ -890,7 +885,7 @@ static void dmfe_process_mode(struct nic *nic __unused) 
			 | 
		
		
	
		
			
			| 
				890
			 | 
			
				885
			 | 
			
			
				
				 		} 
			 | 
		
		
	
		
			
			| 
				891
			 | 
			
				886
			 | 
			
			
				
				 	} 
			 | 
		
		
	
		
			
			| 
				892
			 | 
			
				887
			 | 
			
			
				
				 } 
			 | 
		
		
	
		
			
			| 
				893
			 | 
			
				
			 | 
			
			
				
				- 
			 | 
		
		
	
		
			
			| 
				
			 | 
			
				888
			 | 
			
			
				
				+#endif 
			 | 
		
		
	
		
			
			| 
				894
			 | 
			
				889
			 | 
			
			
				
				  
			 | 
		
		
	
		
			
			| 
				895
			 | 
			
				890
			 | 
			
			
				
				 /* 
			 | 
		
		
	
		
			
			| 
				896
			 | 
			
				891
			 | 
			
			
				
				  *	Write a word to Phy register 
			 | 
		
		
	
	
		
			
			| 
				
			 | 
			
			
				
				@@ -1217,6 +1212,13 @@ static void dmfe_program_DM9802(struct nic *nic __unused) 
			 | 
		
		
	
		
			
			| 
				1217
			 | 
			
				1212
			 | 
			
			
				
				 	phy_write(BASE, db->phy_addr, 25, phy_reg, db->chip_id); 
			 | 
		
		
	
		
			
			| 
				1218
			 | 
			
				1213
			 | 
			
			
				
				 } 
			 | 
		
		
	
		
			
			| 
				1219
			 | 
			
				1214
			 | 
			
			
				
				  
			 | 
		
		
	
		
			
			| 
				
			 | 
			
				1215
			 | 
			
			
				
				+static struct nic_operations dmfe_operations = { 
			 | 
		
		
	
		
			
			| 
				
			 | 
			
				1216
			 | 
			
			
				
				+	.connect	= dummy_connect, 
			 | 
		
		
	
		
			
			| 
				
			 | 
			
				1217
			 | 
			
			
				
				+	.poll		= dmfe_poll, 
			 | 
		
		
	
		
			
			| 
				
			 | 
			
				1218
			 | 
			
			
				
				+	.transmit	= dmfe_transmit, 
			 | 
		
		
	
		
			
			| 
				
			 | 
			
				1219
			 | 
			
			
				
				+	.irq		= dmfe_irq, 
			 | 
		
		
	
		
			
			| 
				
			 | 
			
				1220
			 | 
			
			
				
				+	.disable	= dmfe_disable, 
			 | 
		
		
	
		
			
			| 
				
			 | 
			
				1221
			 | 
			
			
				
				+}; 
			 | 
		
		
	
		
			
			| 
				1220
			 | 
			
				1222
			 | 
			
			
				
				  
			 | 
		
		
	
		
			
			| 
				1221
			 | 
			
				1223
			 | 
			
			
				
				 static struct pci_id dmfe_nics[] = { 
			 | 
		
		
	
		
			
			| 
				1222
			 | 
			
				1224
			 | 
			
			
				
				 	PCI_ROM(0x1282, 0x9100, "dmfe9100", "Davicom 9100"), 
			 |