Browse Source

[pci] Make driver PCI ID a property of the PCI device

Signed-off-by: Michael Brown <mcb30@ipxe.org>
tags/v1.20.1
Michael Brown 14 years ago
parent
commit
5bde349e55
45 changed files with 77 additions and 107 deletions
  1. 1
    2
      src/arch/i386/drivers/net/undi.c
  2. 3
    3
      src/drivers/bus/pci.c
  3. 1
    2
      src/drivers/infiniband/arbel.c
  4. 1
    2
      src/drivers/infiniband/hermon.c
  5. 1
    2
      src/drivers/infiniband/linda.c
  6. 1
    2
      src/drivers/infiniband/qib7322.c
  7. 1
    2
      src/drivers/net/3c90x.c
  8. 3
    5
      src/drivers/net/ath5k/ath5k.c
  9. 1
    2
      src/drivers/net/atl1e.c
  10. 4
    3
      src/drivers/net/b44.c
  11. 1
    2
      src/drivers/net/b44.h
  12. 3
    2
      src/drivers/net/dmfe.c
  13. 1
    2
      src/drivers/net/e1000/e1000_api.h
  14. 1
    2
      src/drivers/net/e1000/e1000_main.c
  15. 1
    2
      src/drivers/net/e1000e/e1000e.h
  16. 2
    3
      src/drivers/net/e1000e/e1000e_main.c
  17. 1
    2
      src/drivers/net/eepro100.c
  18. 1
    1
      src/drivers/net/eepro100.h
  19. 2
    3
      src/drivers/net/etherfabric.c
  20. 3
    3
      src/drivers/net/forcedeth.c
  21. 1
    1
      src/drivers/net/igb/igb.h
  22. 1
    2
      src/drivers/net/igb/igb_main.c
  23. 1
    2
      src/drivers/net/igbvf/igbvf_main.c
  24. 1
    1
      src/drivers/net/jme.c
  25. 1
    1
      src/drivers/net/mtd80x.c
  26. 2
    4
      src/drivers/net/myri10ge.c
  27. 2
    3
      src/drivers/net/natsemi.c
  28. 3
    3
      src/drivers/net/ns83820.c
  29. 2
    2
      src/drivers/net/pcnet32.c
  30. 1
    2
      src/drivers/net/phantom/phantom.c
  31. 1
    2
      src/drivers/net/pnic.c
  32. 4
    3
      src/drivers/net/r8169.c
  33. 1
    2
      src/drivers/net/rtl8139.c
  34. 1
    2
      src/drivers/net/rtl818x/rtl818x.c
  35. 2
    4
      src/drivers/net/sis190.c
  36. 1
    2
      src/drivers/net/skge.c
  37. 1
    2
      src/drivers/net/sky2.c
  38. 4
    3
      src/drivers/net/sundance.c
  39. 3
    3
      src/drivers/net/tlan.c
  40. 1
    1
      src/drivers/net/tulip.c
  41. 3
    3
      src/drivers/net/via-velocity.c
  42. 1
    2
      src/drivers/net/virtio-net.c
  43. 1
    1
      src/drivers/net/vxge/vxge_main.c
  44. 3
    5
      src/include/ipxe/pci.h
  45. 2
    4
      src/include/nic.h

+ 1
- 2
src/arch/i386/drivers/net/undi.c View File

@@ -62,8 +62,7 @@ static struct undi_rom * undipci_find_rom ( struct pci_device *pci ) {
62 62
  * @v id		PCI ID
63 63
  * @ret rc		Return status code
64 64
  */
65
-static int undipci_probe ( struct pci_device *pci,
66
-			   const struct pci_device_id *id __unused ) {
65
+static int undipci_probe ( struct pci_device *pci ) {
67 66
 	struct undi_device *undi;
68 67
 	struct undi_rom *undirom;
69 68
 	int rc;

+ 3
- 3
src/drivers/bus/pci.c View File

@@ -192,9 +192,9 @@ static int pci_probe ( struct pci_device *pci ) {
192 192
 			     ( id->device != pci->device ) )
193 193
 				continue;
194 194
 			pci->driver = driver;
195
-			pci->driver_name = id->name;
196
-			DBGC ( pci, "...using driver %s\n", pci->driver_name );
197
-			if ( ( rc = driver->probe ( pci, id ) ) != 0 ) {
195
+			pci->id = id;
196
+			DBGC ( pci, "...using driver %s\n", pci->id->name );
197
+			if ( ( rc = driver->probe ( pci ) ) != 0 ) {
198 198
 				DBGC ( pci, "......probe failed: %s\n",
199 199
 				       strerror ( rc ) );
200 200
 				continue;

+ 1
- 2
src/drivers/infiniband/arbel.c View File

@@ -2642,8 +2642,7 @@ static int arbel_configure_special_qps ( struct arbel *arbel ) {
2642 2642
  * @v id		PCI ID
2643 2643
  * @ret rc		Return status code
2644 2644
  */
2645
-static int arbel_probe ( struct pci_device *pci,
2646
-			 const struct pci_device_id *id __unused ) {
2645
+static int arbel_probe ( struct pci_device *pci ) {
2647 2646
 	struct arbel *arbel;
2648 2647
 	struct ib_device *ibdev;
2649 2648
 	struct arbelprm_init_hca init_hca;

+ 1
- 2
src/drivers/infiniband/hermon.c View File

@@ -3332,8 +3332,7 @@ static void hermon_reset ( struct hermon *hermon,
3332 3332
  * @v id		PCI ID
3333 3333
  * @ret rc		Return status code
3334 3334
  */
3335
-static int hermon_probe ( struct pci_device *pci,
3336
-			  const struct pci_device_id *id __unused ) {
3335
+static int hermon_probe ( struct pci_device *pci ) {
3337 3336
 	struct hermon *hermon;
3338 3337
 	struct ib_device *ibdev;
3339 3338
 	struct net_device *netdev;

+ 1
- 2
src/drivers/infiniband/linda.c View File

@@ -2316,8 +2316,7 @@ static int linda_init_ib_serdes ( struct linda *linda ) {
2316 2316
  * @v id		PCI ID
2317 2317
  * @ret rc		Return status code
2318 2318
  */
2319
-static int linda_probe ( struct pci_device *pci,
2320
-			 const struct pci_device_id *id __unused ) {
2319
+static int linda_probe ( struct pci_device *pci ) {
2321 2320
 	struct ib_device *ibdev;
2322 2321
 	struct linda *linda;
2323 2322
 	struct QIB_7220_Revision revision;

+ 1
- 2
src/drivers/infiniband/qib7322.c View File

@@ -2281,8 +2281,7 @@ static void qib7322_reset ( struct qib7322 *qib7322, struct pci_device *pci ) {
2281 2281
  * @v id		PCI ID
2282 2282
  * @ret rc		Return status code
2283 2283
  */
2284
-static int qib7322_probe ( struct pci_device *pci,
2285
-			   const struct pci_device_id *id __unused ) {
2284
+static int qib7322_probe ( struct pci_device *pci ) {
2286 2285
 	struct qib7322 *qib7322;
2287 2286
 	struct QIB_7322_Revision revision;
2288 2287
 	struct ib_device *ibdev;

+ 1
- 2
src/drivers/net/3c90x.c View File

@@ -865,8 +865,7 @@ static struct net_device_operations a3c90x_operations = {
865 865
  *
866 866
  * @ret rc	Returns 0 on success, negative on failure
867 867
  */
868
-static int a3c90x_probe(struct pci_device *pci,
869
-			const struct pci_device_id *pci_id __unused)
868
+static int a3c90x_probe(struct pci_device *pci)
870 869
 {
871 870
 
872 871
 	struct net_device *netdev;

+ 3
- 5
src/drivers/net/ath5k/ath5k.c View File

@@ -157,8 +157,7 @@ static const struct {
157 157
 /*
158 158
  * Prototypes - PCI stack related functions
159 159
  */
160
-static int 		ath5k_probe(struct pci_device *pdev,
161
-				    const struct pci_device_id *id);
160
+static int 		ath5k_probe(struct pci_device *pdev);
162 161
 static void		ath5k_remove(struct pci_device *pdev);
163 162
 
164 163
 struct pci_driver ath5k_pci_driver __pci_driver = {
@@ -284,8 +283,7 @@ ath5k_chip_name(enum ath5k_srev_type type, u16 val)
284 283
 }
285 284
 #endif
286 285
 
287
-static int ath5k_probe(struct pci_device *pdev,
288
-		       const struct pci_device_id *id)
286
+static int ath5k_probe(struct pci_device *pdev)
289 287
 {
290 288
 	void *mem;
291 289
 	struct ath5k_softc *sc;
@@ -371,7 +369,7 @@ static int ath5k_probe(struct pci_device *pdev,
371 369
 	dev->netdev->dev = (struct device *)pdev;
372 370
 
373 371
 	/* Initialize device */
374
-	ret = ath5k_hw_attach(sc, id->driver_data, &sc->ah);
372
+	ret = ath5k_hw_attach(sc, pdev->id->driver_data, &sc->ah);
375 373
 	if (ret)
376 374
 		goto err_free_hwinfo;
377 375
 

+ 1
- 2
src/drivers/net/atl1e.c View File

@@ -1123,8 +1123,7 @@ static void atl1e_init_netdev(struct net_device *netdev, struct pci_device *pdev
1123 1123
  * The OS initialization, configuring of the adapter private structure,
1124 1124
  * and a hardware reset occur.
1125 1125
  */
1126
-static int atl1e_probe(struct pci_device *pdev,
1127
-		       const struct pci_device_id *ent __unused)
1126
+static int atl1e_probe(struct pci_device *pdev)
1128 1127
 {
1129 1128
 	struct net_device *netdev;
1130 1129
 	struct atl1e_adapter *adapter = NULL;

+ 4
- 3
src/drivers/net/b44.c View File

@@ -638,7 +638,7 @@ static void b44_set_rx_mode(struct net_device *netdev)
638 638
  * @v id	Matching entry in ID table
639 639
  * @ret rc	Return status code
640 640
  */
641
-static int b44_probe(struct pci_device *pci, const struct pci_device_id *id)
641
+static int b44_probe(struct pci_device *pci)
642 642
 {
643 643
 	struct net_device *netdev;
644 644
 	struct b44_private *bp;
@@ -694,8 +694,9 @@ static int b44_probe(struct pci_device *pci, const struct pci_device_id *id)
694 694
 
695 695
 	b44_chip_reset(bp, B44_CHIP_RESET_FULL);
696 696
 
697
-	DBG("b44 %s (%04x:%04x) regs=%p MAC=%s\n", id->name, id->vendor,
698
-	    id->device, bp->regs, eth_ntoa(netdev->ll_addr));
697
+	DBG("b44 %s (%04x:%04x) regs=%p MAC=%s\n", pci->id->name,
698
+	    pci->id->vendor, pci->id->device, bp->regs,
699
+	    eth_ntoa(netdev->ll_addr));
699 700
 
700 701
 	return 0;
701 702
 }

+ 1
- 2
src/drivers/net/b44.h View File

@@ -453,8 +453,7 @@ static void b44_free_rx_ring ( struct b44_private *bp );
453 453
 static void b44_rx_refill ( struct b44_private *bp, u32 pending );
454 454
 static void b44_populate_rx_descriptor (struct b44_private *bp, u32 index);
455 455
 
456
-static int b44_probe ( struct pci_device *pci,
457
-                       const struct pci_device_id *id );
456
+static int b44_probe ( struct pci_device *pci );
458 457
 static void b44_remove ( struct pci_device *pci );
459 458
 
460 459
 static int b44_open ( struct net_device *netdev );

+ 3
- 2
src/drivers/net/dmfe.c View File

@@ -458,7 +458,7 @@ static int dmfe_probe ( struct nic *nic, struct pci_device *pci ) {
458 458
 
459 459
 	BASE = pci->ioaddr;
460 460
 	printf("dmfe.c: Found %s Vendor=0x%hX Device=0x%hX\n",
461
-	       pci->driver_name, pci->vendor, pci->device);
461
+	       pci->id->name, pci->vendor, pci->device);
462 462
 
463 463
 	/* Read Chip revision */
464 464
 	pci_read_config_dword(pci, PCI_REVISION_ID, &dev_rev);
@@ -489,7 +489,8 @@ static int dmfe_probe ( struct nic *nic, struct pci_device *pci ) {
489 489
 		nic->node_addr[i] = db->srom[20 + i];
490 490
 
491 491
 	/* Print out some hardware info */
492
-	DBG ( "%s: %s at ioaddr %4.4lx\n", pci->driver_name, eth_ntoa ( nic->node_addr ), BASE );
492
+	DBG ( "%s: %s at ioaddr %4.4lx\n",
493
+	      pci->id->name, eth_ntoa ( nic->node_addr ), BASE );
493 494
 
494 495
 	/* Set the card as PCI Bus Master */
495 496
 	adjust_pci_device(pci);

+ 1
- 2
src/drivers/net/e1000/e1000_api.h View File

@@ -121,8 +121,7 @@ s32  e1000_mng_write_dhcp_info(struct e1000_hw * hw,
121 121
                                     u8 *buffer, u16 length);
122 122
 u32  e1000_translate_register_82542(u32 reg) __attribute__((weak));
123 123
 
124
-extern int e1000_probe(struct pci_device *pdev,
125
-		       const struct pci_device_id *id __unused);
124
+extern int e1000_probe(struct pci_device *pdev);
126 125
 extern void e1000_remove(struct pci_device *pdev);
127 126
 
128 127
 #endif

+ 1
- 2
src/drivers/net/e1000/e1000_main.c View File

@@ -689,8 +689,7 @@ static struct net_device_operations e1000_operations;
689 689
  *
690 690
  * @ret rc	Return status code
691 691
  **/
692
-int e1000_probe ( struct pci_device *pdev,
693
-	      const struct pci_device_id *id __unused )
692
+int e1000_probe ( struct pci_device *pdev )
694 693
 {
695 694
 	int i, err;
696 695
 	struct net_device *netdev;

+ 1
- 2
src/drivers/net/e1000e/e1000e.h View File

@@ -276,8 +276,7 @@ extern void e1000e_init_function_pointers_80003es2lan(struct e1000_hw *hw)
276 276
 extern void e1000e_init_function_pointers_ich8lan(struct e1000_hw *hw)
277 277
 						__attribute__((weak));
278 278
 
279
-extern int e1000e_probe(struct pci_device *pdev,
280
-		       const struct pci_device_id *id __unused);
279
+extern int e1000e_probe(struct pci_device *pdev);
281 280
 
282 281
 extern void e1000e_remove(struct pci_device *pdev);
283 282
 

+ 2
- 3
src/drivers/net/e1000e/e1000e_main.c View File

@@ -1005,8 +1005,7 @@ static struct net_device_operations e1000e_operations;
1005 1005
  *
1006 1006
  * @ret rc	Return status code
1007 1007
  **/
1008
-int e1000e_probe ( struct pci_device *pdev,
1009
-	      const struct pci_device_id *ent)
1008
+int e1000e_probe ( struct pci_device *pdev )
1010 1009
 {
1011 1010
 	int i, err;
1012 1011
 	struct net_device *netdev;
@@ -1014,7 +1013,7 @@ int e1000e_probe ( struct pci_device *pdev,
1014 1013
 	unsigned long mmio_start, mmio_len;
1015 1014
 	unsigned long flash_start, flash_len;
1016 1015
 	struct e1000_hw *hw;
1017
-	const struct e1000_info *ei = e1000_info_tbl[ent->driver_data];
1016
+	const struct e1000_info *ei = e1000_info_tbl[pdev->id->driver_data];
1018 1017
 
1019 1018
 	DBGP ( "e1000_probe\n" );
1020 1019
 

+ 1
- 2
src/drivers/net/eepro100.c View File

@@ -167,8 +167,7 @@ static struct net_device_operations ifec_operations = {
167 167
  * This function is called very early on, while iPXE is initializing.
168 168
  * This is a iPXE PCI Device Driver API function.
169 169
  */
170
-static int ifec_pci_probe ( struct pci_device *pci,
171
-                            const struct pci_device_id *id __unused )
170
+static int ifec_pci_probe ( struct pci_device *pci )
172 171
 {
173 172
 	struct net_device *netdev;
174 173
 	struct ifec_private *priv;

+ 1
- 1
src/drivers/net/eepro100.h View File

@@ -171,7 +171,7 @@ struct ifec_private {
171 171
 /**************************** Function prototypes ****************************/
172 172
 
173 173
 /* PCI device API prototypes */
174
-static int  ifec_pci_probe  ( struct pci_device*, const struct pci_device_id*);
174
+static int  ifec_pci_probe  ( struct pci_device *pci );
175 175
 static void ifec_pci_remove ( struct pci_device *pci );
176 176
 
177 177
 /* Network device API prototypes */

+ 2
- 3
src/drivers/net/etherfabric.c View File

@@ -4129,8 +4129,7 @@ efab_remove ( struct pci_device *pci )
4129 4129
 }
4130 4130
 
4131 4131
 static int
4132
-efab_probe ( struct pci_device *pci,
4133
-	     const struct pci_device_id *id )
4132
+efab_probe ( struct pci_device *pci )
4134 4133
 {
4135 4134
 	struct net_device *netdev;
4136 4135
 	struct efab_nic *efab;
@@ -4190,7 +4189,7 @@ efab_probe ( struct pci_device *pci,
4190 4189
 			goto fail5;
4191 4190
 	}
4192 4191
 
4193
-	EFAB_LOG ( "Found %s EtherFabric %s %s revision %d\n", id->name,
4192
+	EFAB_LOG ( "Found %s EtherFabric %s %s revision %d\n", pci->id->name,
4194 4193
 		   efab->is_asic ? "ASIC" : "FPGA",
4195 4194
 		   efab->phy_10g ? "10G" : "1G",
4196 4195
 		   efab->pci_revision );

+ 3
- 3
src/drivers/net/forcedeth.c View File

@@ -1796,7 +1796,7 @@ err_ioremap:
1796 1796
  * @ret rc	Return status code
1797 1797
  **/
1798 1798
 static int
1799
-forcedeth_probe ( struct pci_device *pdev, const struct pci_device_id *ent )
1799
+forcedeth_probe ( struct pci_device *pdev )
1800 1800
 {
1801 1801
 	struct net_device *netdev;
1802 1802
 	struct forcedeth_private *priv;
@@ -1806,7 +1806,7 @@ forcedeth_probe ( struct pci_device *pdev, const struct pci_device_id *ent )
1806 1806
 	DBGP ( "forcedeth_probe\n" );
1807 1807
 
1808 1808
 	DBG ( "Found %s, vendor = %#04x, device = %#04x\n",
1809
-		pdev->driver_name, ent->vendor, ent->device );
1809
+	      pdev->id->name, pdev->id->vendor, pdev->id->device );
1810 1810
 
1811 1811
 	/* Allocate our private data */
1812 1812
 	netdev = alloc_etherdev ( sizeof ( *priv ) );
@@ -1829,7 +1829,7 @@ forcedeth_probe ( struct pci_device *pdev, const struct pci_device_id *ent )
1829 1829
 	/* We'll need these set up for the rest of the routines */
1830 1830
 	priv->pci_dev = pdev;
1831 1831
 	priv->netdev = netdev;
1832
-	priv->driver_data = ent->driver_data;
1832
+	priv->driver_data = pdev->id->driver_data;
1833 1833
 
1834 1834
 	adjust_pci_device ( pdev );
1835 1835
 

+ 1
- 1
src/drivers/net/igb/igb.h View File

@@ -34,7 +34,7 @@ FILE_LICENCE ( GPL2_ONLY );
34 34
 
35 35
 #include "igb_api.h"
36 36
 
37
-extern int igb_probe ( struct pci_device *pdev, const struct pci_device_id *ent);
37
+extern int igb_probe ( struct pci_device *pdev );
38 38
 extern void igb_remove ( struct pci_device *pdev );
39 39
 
40 40
 struct igb_adapter;

+ 1
- 2
src/drivers/net/igb/igb_main.c View File

@@ -771,8 +771,7 @@ static struct net_device_operations igb_operations;
771 771
  *
772 772
  * @ret rc	Return status code
773 773
  **/
774
-int igb_probe ( struct pci_device *pdev,
775
-	      const struct pci_device_id *ent __unused)
774
+int igb_probe ( struct pci_device *pdev )
776 775
 {
777 776
 	int i, err;
778 777
 	struct net_device *netdev;

+ 1
- 2
src/drivers/net/igbvf/igbvf_main.c View File

@@ -779,8 +779,7 @@ void igbvf_get_hw_control ( struct igbvf_adapter *adapter )
779 779
  * The OS initialization, configuring of the adapter private structure,
780 780
  * and a hardware reset occur.
781 781
  **/
782
-int igbvf_probe ( struct pci_device *pdev,
783
-		  const struct pci_device_id *ent __unused )
782
+int igbvf_probe ( struct pci_device *pdev )
784 783
 {
785 784
 	int err;
786 785
 	struct net_device *netdev;

+ 1
- 1
src/drivers/net/jme.c View File

@@ -1175,7 +1175,7 @@ jme_load_macaddr(struct net_device *netdev)
1175 1175
  * @ret rc	Return status code
1176 1176
  */
1177 1177
 static int
1178
-jme_probe(struct pci_device *pci, const struct pci_device_id *id __unused)
1178
+jme_probe(struct pci_device *pci)
1179 1179
 {
1180 1180
 	struct net_device *netdev;
1181 1181
 	struct jme_adapter *jme;

+ 1
- 1
src/drivers/net/mtd80x.c View File

@@ -617,7 +617,7 @@ static int mtd_probe ( struct nic *nic, struct pci_device *pci ) {
617 617
     nic->ioaddr = pci->ioaddr;
618 618
     nic->irqno = 0;
619 619
 
620
-    mtdx.nic_name = pci->driver_name;
620
+    mtdx.nic_name = pci->id->name;
621 621
     mtdx.dev_id = pci->device;
622 622
     mtdx.ioaddr = nic->ioaddr;
623 623
 

+ 2
- 4
src/drivers/net/myri10ge.c View File

@@ -94,8 +94,7 @@ FILE_LICENCE ( GPL2_ONLY );
94 94
 
95 95
 /* PCI driver entry points */
96 96
 
97
-static int	myri10ge_pci_probe ( struct pci_device*,
98
-				     const struct pci_device_id* );
97
+static int	myri10ge_pci_probe ( struct pci_device* );
99 98
 static void	myri10ge_pci_remove ( struct pci_device* );
100 99
 
101 100
 /* Network device operations */
@@ -771,8 +770,7 @@ myri10ge_nv_fini ( struct myri10ge_private *priv )
771 770
  * This function is called very early on, while iPXE is initializing.
772 771
  * This is a iPXE PCI Device Driver API function.
773 772
  */
774
-static int myri10ge_pci_probe ( struct pci_device *pci,
775
-				const struct pci_device_id *id __unused )
773
+static int myri10ge_pci_probe ( struct pci_device *pci )
776 774
 {
777 775
 	static struct net_device_operations myri10ge_operations = {
778 776
 		.open     = myri10ge_net_open,

+ 2
- 3
src/drivers/net/natsemi.c View File

@@ -83,7 +83,7 @@ FILE_LICENCE ( GPL_ANY );
83 83
 static int natsemi_spi_read_bit ( struct bit_basher *, unsigned int );
84 84
 static void natsemi_spi_write_bit ( struct bit_basher *,unsigned int, unsigned long ); 
85 85
 static void natsemi_init_eeprom ( struct natsemi_private * ); 
86
-static int natsemi_probe (struct pci_device *pci, const struct pci_device_id *id);
86
+static int natsemi_probe (struct pci_device *pci);
87 87
 static void natsemi_reset (struct net_device *netdev);
88 88
 static int natsemi_open (struct net_device *netdev);
89 89
 static int natsemi_transmit (struct net_device *netdev, struct io_buffer *iobuf);
@@ -164,8 +164,7 @@ static void natsemi_init_eeprom ( struct natsemi_private *np ) {
164 164
  * @v id	PCI ID
165 165
  * @ret rc	Return status code
166 166
  */
167
-static int natsemi_probe (struct pci_device *pci,
168
-		       const struct pci_device_id *id __unused) {
167
+static int natsemi_probe (struct pci_device *pci) {
169 168
 	struct net_device *netdev;
170 169
 	struct natsemi_private *np = NULL;
171 170
 	uint8_t ll_addr_encoded[MAX_LL_ADDR_LEN];

+ 3
- 3
src/drivers/net/ns83820.c View File

@@ -824,7 +824,7 @@ static int ns83820_probe ( struct nic *nic, struct pci_device *pci ) {
824 824
 		return 0;
825 825
 
826 826
 	printf("ns83820.c: Found %s, vendor=0x%hX, device=0x%hX\n",
827
-	       pci->driver_name, pci->vendor, pci->device);
827
+	       pci->id->name, pci->vendor, pci->device);
828 828
 
829 829
 	/* point to private storage */
830 830
 	ns = &nsx;
@@ -862,12 +862,12 @@ static int ns83820_probe ( struct nic *nic, struct pci_device *pci ) {
862 862
 	ns->CFG_cache = readl(ns->base + CFG);
863 863
 
864 864
 	if ((ns->CFG_cache & CFG_PCI64_DET)) {
865
-		printf("%s: detected 64 bit PCI data bus.\n", pci->driver_name);
865
+		printf("%s: detected 64 bit PCI data bus.\n", pci->id->name);
866 866
 		/*dev->CFG_cache |= CFG_DATA64_EN; */
867 867
 		if (!(ns->CFG_cache & CFG_DATA64_EN))
868 868
 			printf
869 869
 			    ("%s: EEPROM did not enable 64 bit bus.  Disabled.\n",
870
-			     pci->driver_name);
870
+			     pci->id->name);
871 871
 	} else
872 872
 		ns->CFG_cache &= ~(CFG_DATA64_EN);
873 873
 

+ 2
- 2
src/drivers/net/pcnet32.c View File

@@ -1034,7 +1034,7 @@ static struct net_device_operations pcnet32_operations = {
1034 1034
  * @ret rc	Return status code
1035 1035
  **/
1036 1036
 static int
1037
-pcnet32_probe ( struct pci_device *pdev, const struct pci_device_id *ent )
1037
+pcnet32_probe ( struct pci_device *pdev )
1038 1038
 {
1039 1039
 	struct net_device *netdev;
1040 1040
 	struct pcnet32_private *priv;
@@ -1044,7 +1044,7 @@ pcnet32_probe ( struct pci_device *pdev, const struct pci_device_id *ent )
1044 1044
 	DBGP ( "pcnet32_probe\n" );
1045 1045
 
1046 1046
 	DBG ( "Found %s, vendor = %#04x, device = %#04x\n",
1047
-		pdev->driver_name, ent->vendor, ent->device );
1047
+		pdev->id->name, pdev->id->vendor, pdev->id->device );
1048 1048
 
1049 1049
 	/* Allocate our private data */
1050 1050
 	netdev = alloc_etherdev ( sizeof ( *priv ) );

+ 1
- 2
src/drivers/net/phantom/phantom.c View File

@@ -2038,8 +2038,7 @@ static int phantom_init_rcvpeg ( struct phantom_nic *phantom ) {
2038 2038
  * @v id		PCI ID
2039 2039
  * @ret rc		Return status code
2040 2040
  */
2041
-static int phantom_probe ( struct pci_device *pci,
2042
-			   const struct pci_device_id *id __unused ) {
2041
+static int phantom_probe ( struct pci_device *pci ) {
2043 2042
 	struct net_device *netdev;
2044 2043
 	struct phantom_nic *phantom;
2045 2044
 	struct settings *parent_settings;

+ 1
- 2
src/drivers/net/pnic.c View File

@@ -215,8 +215,7 @@ static void pnic_remove ( struct pci_device *pci ) {
215 215
 /**************************************************************************
216 216
 PROBE - Look for an adapter, this routine's visible to the outside
217 217
 ***************************************************************************/
218
-static int pnic_probe ( struct pci_device *pci,
219
-			const struct pci_device_id *id __unused ) {
218
+static int pnic_probe ( struct pci_device *pci ) {
220 219
 	struct net_device *netdev;
221 220
 	struct pnic *pnic;
222 221
 	uint16_t api_version;

+ 4
- 3
src/drivers/net/r8169.c View File

@@ -2050,18 +2050,19 @@ static struct net_device_operations rtl8169_operations = {
2050 2050
  * @ret rc	Return status code
2051 2051
  **/
2052 2052
 static int
2053
-rtl8169_probe ( struct pci_device *pdev, const struct pci_device_id *ent )
2053
+rtl8169_probe ( struct pci_device *pdev )
2054 2054
 {
2055 2055
 	int i, rc;
2056 2056
 	struct net_device *netdev;
2057 2057
 	struct rtl8169_private *tp;
2058 2058
 	void *ioaddr;
2059 2059
 
2060
-	const struct rtl_cfg_info *cfg = rtl_cfg_infos + ent->driver_data;
2060
+	const struct rtl_cfg_info *cfg = rtl_cfg_infos + pdev->id->driver_data;
2061 2061
 
2062 2062
 	DBGP ( "rtl8169_probe\n" );
2063 2063
 
2064
-	DBG ( "ent->vendor = %#04x, ent->device = %#04x\n", ent->vendor, ent->device );
2064
+	DBG ( "id->vendor = %#04x, id->device = %#04x\n",
2065
+	      pdev->id->vendor, pdev->id->device );
2065 2066
 
2066 2067
 	DBG ( "cfg->intr_event = %#04x\n", cfg->intr_event );
2067 2068
 

+ 1
- 2
src/drivers/net/rtl8139.c View File

@@ -505,8 +505,7 @@ static struct net_device_operations rtl_operations = {
505 505
  * @v id	PCI ID
506 506
  * @ret rc	Return status code
507 507
  */
508
-static int rtl_probe ( struct pci_device *pci,
509
-		       const struct pci_device_id *id __unused ) {
508
+static int rtl_probe ( struct pci_device *pci ) {
510 509
 	struct net_device *netdev;
511 510
 	struct rtl8139_nic *rtl;
512 511
 	int rc;

+ 1
- 2
src/drivers/net/rtl818x/rtl818x.c View File

@@ -649,8 +649,7 @@ struct net80211_device_operations rtl818x_operations = {
649 649
 	.config = rtl818x_config,
650 650
 };
651 651
 
652
-static int rtl818x_probe(struct pci_device *pdev,
653
-			 const struct pci_device_id *id __unused)
652
+static int rtl818x_probe(struct pci_device *pdev )
654 653
 {
655 654
 	struct net80211_device *dev;
656 655
 	struct rtl818x_priv *priv;

+ 2
- 4
src/drivers/net/sis190.c View File

@@ -47,8 +47,7 @@ static struct pci_device_id sis190_isa_bridge_tbl[] = {
47 47
 	PCI_ID (0x1039, 0x0968, "", "", 0),
48 48
 };
49 49
 
50
-static int sis190_isa_bridge_probe(struct pci_device *pdev __unused,
51
-				   const struct pci_device_id *ent __unused)
50
+static int sis190_isa_bridge_probe(struct pci_device *pdev __unused)
52 51
 {
53 52
 	return 0;
54 53
 }
@@ -1110,8 +1109,7 @@ static struct net_device_operations sis190_netdev_ops = {
1110 1109
 	.irq = sis190_irq,
1111 1110
 };
1112 1111
 
1113
-static int sis190_probe(struct pci_device *pdev,
1114
-			   const struct pci_device_id *ent __unused)
1112
+static int sis190_probe(struct pci_device *pdev)
1115 1113
 {
1116 1114
 	struct sis190_private *tp;
1117 1115
 	struct net_device *dev;

+ 1
- 2
src/drivers/net/skge.c View File

@@ -2333,8 +2333,7 @@ static void skge_show_addr(struct net_device *dev)
2333 2333
 	     dev->name, netdev_addr(dev));
2334 2334
 }
2335 2335
 
2336
-static int skge_probe(struct pci_device *pdev,
2337
-				const struct pci_device_id *ent __unused)
2336
+static int skge_probe(struct pci_device *pdev)
2338 2337
 {
2339 2338
 	struct net_device *dev, *dev1;
2340 2339
 	struct skge_hw *hw;

+ 1
- 2
src/drivers/net/sky2.c View File

@@ -2264,8 +2264,7 @@ static struct net_device_operations sky2_operations = {
2264 2264
 	.irq      = sky2_net_irq
2265 2265
 };
2266 2266
 
2267
-static int sky2_probe(struct pci_device *pdev,
2268
-		      const struct pci_device_id *ent __unused)
2267
+static int sky2_probe(struct pci_device *pdev)
2269 2268
 {
2270 2269
 	struct net_device *dev;
2271 2270
 	struct sky2_hw *hw;

+ 4
- 3
src/drivers/net/sundance.c View File

@@ -575,7 +575,7 @@ static int sundance_probe ( struct nic *nic, struct pci_device *pci ) {
575 575
 	/* BASE is used throughout to address the card */
576 576
 	BASE = pci->ioaddr;
577 577
 	printf(" sundance.c: Found %s Vendor=0x%hX Device=0x%hX\n",
578
-	       pci->driver_name, pci->vendor, pci->device);
578
+	       pci->id->name, pci->vendor, pci->device);
579 579
 
580 580
 	/* Get the MAC Address by reading the EEPROM */
581 581
 	for (i = 0; i < 3; i++) {
@@ -597,7 +597,7 @@ static int sundance_probe ( struct nic *nic, struct pci_device *pci ) {
597 597
 	/* point to private storage */
598 598
 	sdc = &sdx;
599 599
 
600
-	sdc->nic_name = pci->driver_name;
600
+	sdc->nic_name = pci->id->name;
601 601
 	sdc->mtu = mtu;
602 602
 
603 603
 	pci_read_config_byte(pci, PCI_REVISION_ID, &sdc->pci_rev_id);
@@ -605,7 +605,8 @@ static int sundance_probe ( struct nic *nic, struct pci_device *pci ) {
605 605
 	DBG ( "Device revision id: %hx\n", sdc->pci_rev_id );
606 606
 
607 607
 	/* Print out some hardware info */
608
-	DBG ( "%s: %s at ioaddr %hX, ", pci->driver_name, nic->node_addr, (unsigned int) BASE);
608
+	DBG ( "%s: %s at ioaddr %hX, ",
609
+	      pci->id->name, nic->node_addr, (unsigned int) BASE);
609 610
 
610 611
 	sdc->mii_preamble_required = 0;
611 612
 	if (1) {

+ 3
- 3
src/drivers/net/tlan.c View File

@@ -810,7 +810,7 @@ static int tlan_probe ( struct nic *nic, struct pci_device *pci ) {
810 810
 
811 811
 	priv->vendor_id = pci->vendor;
812 812
 	priv->dev_id = pci->device;
813
-	priv->nic_name = pci->driver_name;
813
+	priv->nic_name = pci->id->name;
814 814
 	priv->eoc = 0;
815 815
 
816 816
 	err = 0;
@@ -821,10 +821,10 @@ static int tlan_probe ( struct nic *nic, struct pci_device *pci ) {
821 821
 				       (u8 *) & nic->node_addr[i]);
822 822
 	if (err) {
823 823
   	    printf ( "TLAN: %s: Error reading MAC from eeprom: %d\n",
824
-		    pci->driver_name, err);
824
+		    pci->id->name, err);
825 825
 	} else {
826 826
 	    DBG ( "%s: %s at ioaddr %#lX, ", 
827
-		  pci->driver_name, eth_ntoa ( nic->node_addr ), pci->ioaddr );
827
+		  pci->id->name, eth_ntoa ( nic->node_addr ), pci->ioaddr );
828 828
 	}
829 829
 
830 830
 	priv->tlanRev = TLan_DioRead8(BASE, TLAN_DEF_REVISION);

+ 1
- 1
src/drivers/net/tulip.c View File

@@ -1191,7 +1191,7 @@ static int tulip_probe ( struct nic *nic, struct pci_device *pci ) {
1191 1191
 
1192 1192
     tp->vendor_id  = pci->vendor;
1193 1193
     tp->dev_id     = pci->device;
1194
-    tp->nic_name   = pci->driver_name;
1194
+    tp->nic_name   = pci->id->name;
1195 1195
 
1196 1196
     tp->if_port = 0;
1197 1197
     tp->default_port = 0;

+ 3
- 3
src/drivers/net/via-velocity.c View File

@@ -675,7 +675,7 @@ static int velocity_probe( struct nic *nic, struct pci_device *pci)
675 675
 	struct mac_regs *regs;
676 676
 
677 677
 	printf("via-velocity.c: Found %s Vendor=0x%hX Device=0x%hX\n",
678
-	       pci->driver_name, pci->vendor, pci->device);
678
+	       pci->id->name, pci->vendor, pci->device);
679 679
 
680 680
 	/* point to private storage */
681 681
 	vptr = &vptx;
@@ -707,10 +707,10 @@ static int velocity_probe( struct nic *nic, struct pci_device *pci)
707 707
 	for (i = 0; i < 6; i++)
708 708
 		nic->node_addr[i] = readb(&regs->PAR[i]);
709 709
 
710
-	DBG ( "%s: %s at ioaddr %#hX\n", pci->driver_name, eth_ntoa ( nic->node_addr ),
710
+	DBG ( "%s: %s at ioaddr %#hX\n", pci->id->name, eth_ntoa ( nic->node_addr ),
711 711
 	      (unsigned int) BASE );
712 712
 
713
-	velocity_get_options(&vptr->options, 0, pci->driver_name);
713
+	velocity_get_options(&vptr->options, 0, pci->id->name);
714 714
 
715 715
 	/* 
716 716
 	 *      Mask out the options cannot be set to the chip

+ 1
- 2
src/drivers/net/virtio-net.c View File

@@ -344,8 +344,7 @@ static struct net_device_operations virtnet_operations = {
344 344
  * @v id	PCI ID
345 345
  * @ret rc	Return status code
346 346
  */
347
-static int virtnet_probe ( struct pci_device *pci,
348
-			   const struct pci_device_id *id __unused ) {
347
+static int virtnet_probe ( struct pci_device *pci ) {
349 348
 	unsigned long ioaddr = pci->ioaddr;
350 349
 	struct net_device *netdev;
351 350
 	struct virtnet_nic *virtnet;

+ 1
- 1
src/drivers/net/vxge/vxge_main.c View File

@@ -495,7 +495,7 @@ vxge_device_unregister(struct __vxge_hw_device *hldev)
495 495
  *
496 496
  */
497 497
 static int
498
-vxge_probe(struct pci_device *pdev, const struct pci_device_id *id __unused)
498
+vxge_probe(struct pci_device *pdev)
499 499
 {
500 500
 	struct __vxge_hw_device  *hldev;
501 501
 	enum vxge_hw_status status;

+ 3
- 5
src/include/ipxe/pci.h View File

@@ -312,8 +312,8 @@ struct pci_device {
312 312
 	 * field.
313 313
 	 */
314 314
 	void *priv;
315
-	/** Driver name */
316
-	const char *driver_name;
315
+	/** Driver device ID */
316
+	struct pci_device_id *id;
317 317
 };
318 318
 
319 319
 /** A PCI driver */
@@ -326,11 +326,9 @@ struct pci_driver {
326 326
 	 * Probe device
327 327
 	 *
328 328
 	 * @v pci	PCI device
329
-	 * @v id	Matching entry in ID table
330 329
 	 * @ret rc	Return status code
331 330
 	 */
332
-	int ( * probe ) ( struct pci_device *pci,
333
-			  const struct pci_device_id *id );
331
+	int ( * probe ) ( struct pci_device *pci );
334 332
 	/**
335 333
 	 * Remove device
336 334
 	 *

+ 2
- 4
src/include/nic.h View File

@@ -85,8 +85,7 @@ void legacy_remove ( void *hwdev,
85 85
 
86 86
 #define PCI_DRIVER(_name,_ids,_class) 					  \
87 87
 	static inline int						  \
88
-	_name ## _pci_legacy_probe ( struct pci_device *pci,		  \
89
-				     const struct pci_device_id *id );	  \
88
+	_name ## _pci_legacy_probe ( struct pci_device *pci );		  \
90 89
 	static inline void						  \
91 90
 	_name ## _pci_legacy_remove ( struct pci_device *pci );		  \
92 91
 	struct pci_driver _name __pci_driver = {			  \
@@ -211,8 +210,7 @@ static inline void * legacy_isa_get_drvdata ( void *hwdev ) {
211 210
 		_unsafe_disable ( nic, hwdev );				  \
212 211
 	}								  \
213 212
 	static inline int						  \
214
-	_name ## _pci_legacy_probe ( struct pci_device *pci,		  \
215
-			    const struct pci_device_id *id __unused ) {	  \
213
+	_name ## _pci_legacy_probe ( struct pci_device *pci ) {		  \
216 214
 		return legacy_probe ( pci, legacy_pci_set_drvdata,	  \
217 215
 				      &pci->dev, _name ## _probe,	  \
218 216
 				      _name ## _disable );		  \

Loading…
Cancel
Save