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 13 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
  * @v id		PCI ID
62
  * @v id		PCI ID
63
  * @ret rc		Return status code
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
 	struct undi_device *undi;
66
 	struct undi_device *undi;
68
 	struct undi_rom *undirom;
67
 	struct undi_rom *undirom;
69
 	int rc;
68
 	int rc;

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

192
 			     ( id->device != pci->device ) )
192
 			     ( id->device != pci->device ) )
193
 				continue;
193
 				continue;
194
 			pci->driver = driver;
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
 				DBGC ( pci, "......probe failed: %s\n",
198
 				DBGC ( pci, "......probe failed: %s\n",
199
 				       strerror ( rc ) );
199
 				       strerror ( rc ) );
200
 				continue;
200
 				continue;

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

2642
  * @v id		PCI ID
2642
  * @v id		PCI ID
2643
  * @ret rc		Return status code
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
 	struct arbel *arbel;
2646
 	struct arbel *arbel;
2648
 	struct ib_device *ibdev;
2647
 	struct ib_device *ibdev;
2649
 	struct arbelprm_init_hca init_hca;
2648
 	struct arbelprm_init_hca init_hca;

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

3332
  * @v id		PCI ID
3332
  * @v id		PCI ID
3333
  * @ret rc		Return status code
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
 	struct hermon *hermon;
3336
 	struct hermon *hermon;
3338
 	struct ib_device *ibdev;
3337
 	struct ib_device *ibdev;
3339
 	struct net_device *netdev;
3338
 	struct net_device *netdev;

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

2316
  * @v id		PCI ID
2316
  * @v id		PCI ID
2317
  * @ret rc		Return status code
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
 	struct ib_device *ibdev;
2320
 	struct ib_device *ibdev;
2322
 	struct linda *linda;
2321
 	struct linda *linda;
2323
 	struct QIB_7220_Revision revision;
2322
 	struct QIB_7220_Revision revision;

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

2281
  * @v id		PCI ID
2281
  * @v id		PCI ID
2282
  * @ret rc		Return status code
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
 	struct qib7322 *qib7322;
2285
 	struct qib7322 *qib7322;
2287
 	struct QIB_7322_Revision revision;
2286
 	struct QIB_7322_Revision revision;
2288
 	struct ib_device *ibdev;
2287
 	struct ib_device *ibdev;

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

865
  *
865
  *
866
  * @ret rc	Returns 0 on success, negative on failure
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
 	struct net_device *netdev;
871
 	struct net_device *netdev;

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

157
 /*
157
 /*
158
  * Prototypes - PCI stack related functions
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
 static void		ath5k_remove(struct pci_device *pdev);
161
 static void		ath5k_remove(struct pci_device *pdev);
163
 
162
 
164
 struct pci_driver ath5k_pci_driver __pci_driver = {
163
 struct pci_driver ath5k_pci_driver __pci_driver = {
284
 }
283
 }
285
 #endif
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
 	void *mem;
288
 	void *mem;
291
 	struct ath5k_softc *sc;
289
 	struct ath5k_softc *sc;
371
 	dev->netdev->dev = (struct device *)pdev;
369
 	dev->netdev->dev = (struct device *)pdev;
372
 
370
 
373
 	/* Initialize device */
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
 	if (ret)
373
 	if (ret)
376
 		goto err_free_hwinfo;
374
 		goto err_free_hwinfo;
377
 
375
 

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

1123
  * The OS initialization, configuring of the adapter private structure,
1123
  * The OS initialization, configuring of the adapter private structure,
1124
  * and a hardware reset occur.
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
 	struct net_device *netdev;
1128
 	struct net_device *netdev;
1130
 	struct atl1e_adapter *adapter = NULL;
1129
 	struct atl1e_adapter *adapter = NULL;

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

638
  * @v id	Matching entry in ID table
638
  * @v id	Matching entry in ID table
639
  * @ret rc	Return status code
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
 	struct net_device *netdev;
643
 	struct net_device *netdev;
644
 	struct b44_private *bp;
644
 	struct b44_private *bp;
694
 
694
 
695
 	b44_chip_reset(bp, B44_CHIP_RESET_FULL);
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
 	return 0;
701
 	return 0;
701
 }
702
 }

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

453
 static void b44_rx_refill ( struct b44_private *bp, u32 pending );
453
 static void b44_rx_refill ( struct b44_private *bp, u32 pending );
454
 static void b44_populate_rx_descriptor (struct b44_private *bp, u32 index);
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
 static void b44_remove ( struct pci_device *pci );
457
 static void b44_remove ( struct pci_device *pci );
459
 
458
 
460
 static int b44_open ( struct net_device *netdev );
459
 static int b44_open ( struct net_device *netdev );

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

458
 
458
 
459
 	BASE = pci->ioaddr;
459
 	BASE = pci->ioaddr;
460
 	printf("dmfe.c: Found %s Vendor=0x%hX Device=0x%hX\n",
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
 	/* Read Chip revision */
463
 	/* Read Chip revision */
464
 	pci_read_config_dword(pci, PCI_REVISION_ID, &dev_rev);
464
 	pci_read_config_dword(pci, PCI_REVISION_ID, &dev_rev);
489
 		nic->node_addr[i] = db->srom[20 + i];
489
 		nic->node_addr[i] = db->srom[20 + i];
490
 
490
 
491
 	/* Print out some hardware info */
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
 	/* Set the card as PCI Bus Master */
495
 	/* Set the card as PCI Bus Master */
495
 	adjust_pci_device(pci);
496
 	adjust_pci_device(pci);

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

121
                                     u8 *buffer, u16 length);
121
                                     u8 *buffer, u16 length);
122
 u32  e1000_translate_register_82542(u32 reg) __attribute__((weak));
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
 extern void e1000_remove(struct pci_device *pdev);
125
 extern void e1000_remove(struct pci_device *pdev);
127
 
126
 
128
 #endif
127
 #endif

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

689
  *
689
  *
690
  * @ret rc	Return status code
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
 	int i, err;
694
 	int i, err;
696
 	struct net_device *netdev;
695
 	struct net_device *netdev;

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

276
 extern void e1000e_init_function_pointers_ich8lan(struct e1000_hw *hw)
276
 extern void e1000e_init_function_pointers_ich8lan(struct e1000_hw *hw)
277
 						__attribute__((weak));
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
 extern void e1000e_remove(struct pci_device *pdev);
281
 extern void e1000e_remove(struct pci_device *pdev);
283
 
282
 

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

1005
  *
1005
  *
1006
  * @ret rc	Return status code
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
 	int i, err;
1010
 	int i, err;
1012
 	struct net_device *netdev;
1011
 	struct net_device *netdev;
1014
 	unsigned long mmio_start, mmio_len;
1013
 	unsigned long mmio_start, mmio_len;
1015
 	unsigned long flash_start, flash_len;
1014
 	unsigned long flash_start, flash_len;
1016
 	struct e1000_hw *hw;
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
 	DBGP ( "e1000_probe\n" );
1018
 	DBGP ( "e1000_probe\n" );
1020
 
1019
 

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

167
  * This function is called very early on, while iPXE is initializing.
167
  * This function is called very early on, while iPXE is initializing.
168
  * This is a iPXE PCI Device Driver API function.
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
 	struct net_device *netdev;
172
 	struct net_device *netdev;
174
 	struct ifec_private *priv;
173
 	struct ifec_private *priv;

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

171
 /**************************** Function prototypes ****************************/
171
 /**************************** Function prototypes ****************************/
172
 
172
 
173
 /* PCI device API prototypes */
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
 static void ifec_pci_remove ( struct pci_device *pci );
175
 static void ifec_pci_remove ( struct pci_device *pci );
176
 
176
 
177
 /* Network device API prototypes */
177
 /* Network device API prototypes */

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

4129
 }
4129
 }
4130
 
4130
 
4131
 static int
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
 	struct net_device *netdev;
4134
 	struct net_device *netdev;
4136
 	struct efab_nic *efab;
4135
 	struct efab_nic *efab;
4190
 			goto fail5;
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
 		   efab->is_asic ? "ASIC" : "FPGA",
4193
 		   efab->is_asic ? "ASIC" : "FPGA",
4195
 		   efab->phy_10g ? "10G" : "1G",
4194
 		   efab->phy_10g ? "10G" : "1G",
4196
 		   efab->pci_revision );
4195
 		   efab->pci_revision );

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

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

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

34
 
34
 
35
 #include "igb_api.h"
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
 extern void igb_remove ( struct pci_device *pdev );
38
 extern void igb_remove ( struct pci_device *pdev );
39
 
39
 
40
 struct igb_adapter;
40
 struct igb_adapter;

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

771
  *
771
  *
772
  * @ret rc	Return status code
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
 	int i, err;
776
 	int i, err;
778
 	struct net_device *netdev;
777
 	struct net_device *netdev;

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

779
  * The OS initialization, configuring of the adapter private structure,
779
  * The OS initialization, configuring of the adapter private structure,
780
  * and a hardware reset occur.
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
 	int err;
784
 	int err;
786
 	struct net_device *netdev;
785
 	struct net_device *netdev;

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

1175
  * @ret rc	Return status code
1175
  * @ret rc	Return status code
1176
  */
1176
  */
1177
 static int
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
 	struct net_device *netdev;
1180
 	struct net_device *netdev;
1181
 	struct jme_adapter *jme;
1181
 	struct jme_adapter *jme;

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

617
     nic->ioaddr = pci->ioaddr;
617
     nic->ioaddr = pci->ioaddr;
618
     nic->irqno = 0;
618
     nic->irqno = 0;
619
 
619
 
620
-    mtdx.nic_name = pci->driver_name;
620
+    mtdx.nic_name = pci->id->name;
621
     mtdx.dev_id = pci->device;
621
     mtdx.dev_id = pci->device;
622
     mtdx.ioaddr = nic->ioaddr;
622
     mtdx.ioaddr = nic->ioaddr;
623
 
623
 

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

94
 
94
 
95
 /* PCI driver entry points */
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
 static void	myri10ge_pci_remove ( struct pci_device* );
98
 static void	myri10ge_pci_remove ( struct pci_device* );
100
 
99
 
101
 /* Network device operations */
100
 /* Network device operations */
771
  * This function is called very early on, while iPXE is initializing.
770
  * This function is called very early on, while iPXE is initializing.
772
  * This is a iPXE PCI Device Driver API function.
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
 	static struct net_device_operations myri10ge_operations = {
775
 	static struct net_device_operations myri10ge_operations = {
778
 		.open     = myri10ge_net_open,
776
 		.open     = myri10ge_net_open,

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

83
 static int natsemi_spi_read_bit ( struct bit_basher *, unsigned int );
83
 static int natsemi_spi_read_bit ( struct bit_basher *, unsigned int );
84
 static void natsemi_spi_write_bit ( struct bit_basher *,unsigned int, unsigned long ); 
84
 static void natsemi_spi_write_bit ( struct bit_basher *,unsigned int, unsigned long ); 
85
 static void natsemi_init_eeprom ( struct natsemi_private * ); 
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
 static void natsemi_reset (struct net_device *netdev);
87
 static void natsemi_reset (struct net_device *netdev);
88
 static int natsemi_open (struct net_device *netdev);
88
 static int natsemi_open (struct net_device *netdev);
89
 static int natsemi_transmit (struct net_device *netdev, struct io_buffer *iobuf);
89
 static int natsemi_transmit (struct net_device *netdev, struct io_buffer *iobuf);
164
  * @v id	PCI ID
164
  * @v id	PCI ID
165
  * @ret rc	Return status code
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
 	struct net_device *netdev;
168
 	struct net_device *netdev;
170
 	struct natsemi_private *np = NULL;
169
 	struct natsemi_private *np = NULL;
171
 	uint8_t ll_addr_encoded[MAX_LL_ADDR_LEN];
170
 	uint8_t ll_addr_encoded[MAX_LL_ADDR_LEN];

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

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

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

1034
  * @ret rc	Return status code
1034
  * @ret rc	Return status code
1035
  **/
1035
  **/
1036
 static int
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
 	struct net_device *netdev;
1039
 	struct net_device *netdev;
1040
 	struct pcnet32_private *priv;
1040
 	struct pcnet32_private *priv;
1044
 	DBGP ( "pcnet32_probe\n" );
1044
 	DBGP ( "pcnet32_probe\n" );
1045
 
1045
 
1046
 	DBG ( "Found %s, vendor = %#04x, device = %#04x\n",
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
 	/* Allocate our private data */
1049
 	/* Allocate our private data */
1050
 	netdev = alloc_etherdev ( sizeof ( *priv ) );
1050
 	netdev = alloc_etherdev ( sizeof ( *priv ) );

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

2038
  * @v id		PCI ID
2038
  * @v id		PCI ID
2039
  * @ret rc		Return status code
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
 	struct net_device *netdev;
2042
 	struct net_device *netdev;
2044
 	struct phantom_nic *phantom;
2043
 	struct phantom_nic *phantom;
2045
 	struct settings *parent_settings;
2044
 	struct settings *parent_settings;

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

215
 /**************************************************************************
215
 /**************************************************************************
216
 PROBE - Look for an adapter, this routine's visible to the outside
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
 	struct net_device *netdev;
219
 	struct net_device *netdev;
221
 	struct pnic *pnic;
220
 	struct pnic *pnic;
222
 	uint16_t api_version;
221
 	uint16_t api_version;

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

2050
  * @ret rc	Return status code
2050
  * @ret rc	Return status code
2051
  **/
2051
  **/
2052
 static int
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
 	int i, rc;
2055
 	int i, rc;
2056
 	struct net_device *netdev;
2056
 	struct net_device *netdev;
2057
 	struct rtl8169_private *tp;
2057
 	struct rtl8169_private *tp;
2058
 	void *ioaddr;
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
 	DBGP ( "rtl8169_probe\n" );
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
 	DBG ( "cfg->intr_event = %#04x\n", cfg->intr_event );
2067
 	DBG ( "cfg->intr_event = %#04x\n", cfg->intr_event );
2067
 
2068
 

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

505
  * @v id	PCI ID
505
  * @v id	PCI ID
506
  * @ret rc	Return status code
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
 	struct net_device *netdev;
509
 	struct net_device *netdev;
511
 	struct rtl8139_nic *rtl;
510
 	struct rtl8139_nic *rtl;
512
 	int rc;
511
 	int rc;

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

649
 	.config = rtl818x_config,
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
 	struct net80211_device *dev;
654
 	struct net80211_device *dev;
656
 	struct rtl818x_priv *priv;
655
 	struct rtl818x_priv *priv;

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

47
 	PCI_ID (0x1039, 0x0968, "", "", 0),
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
 	return 0;
52
 	return 0;
54
 }
53
 }
1110
 	.irq = sis190_irq,
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
 	struct sis190_private *tp;
1114
 	struct sis190_private *tp;
1117
 	struct net_device *dev;
1115
 	struct net_device *dev;

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

2333
 	     dev->name, netdev_addr(dev));
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
 	struct net_device *dev, *dev1;
2338
 	struct net_device *dev, *dev1;
2340
 	struct skge_hw *hw;
2339
 	struct skge_hw *hw;

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

2264
 	.irq      = sky2_net_irq
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
 	struct net_device *dev;
2269
 	struct net_device *dev;
2271
 	struct sky2_hw *hw;
2270
 	struct sky2_hw *hw;

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

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

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

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

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

1191
 
1191
 
1192
     tp->vendor_id  = pci->vendor;
1192
     tp->vendor_id  = pci->vendor;
1193
     tp->dev_id     = pci->device;
1193
     tp->dev_id     = pci->device;
1194
-    tp->nic_name   = pci->driver_name;
1194
+    tp->nic_name   = pci->id->name;
1195
 
1195
 
1196
     tp->if_port = 0;
1196
     tp->if_port = 0;
1197
     tp->default_port = 0;
1197
     tp->default_port = 0;

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

675
 	struct mac_regs *regs;
675
 	struct mac_regs *regs;
676
 
676
 
677
 	printf("via-velocity.c: Found %s Vendor=0x%hX Device=0x%hX\n",
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
 	/* point to private storage */
680
 	/* point to private storage */
681
 	vptr = &vptx;
681
 	vptr = &vptx;
707
 	for (i = 0; i < 6; i++)
707
 	for (i = 0; i < 6; i++)
708
 		nic->node_addr[i] = readb(&regs->PAR[i]);
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
 	      (unsigned int) BASE );
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
 	 *      Mask out the options cannot be set to the chip
716
 	 *      Mask out the options cannot be set to the chip

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

344
  * @v id	PCI ID
344
  * @v id	PCI ID
345
  * @ret rc	Return status code
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
 	unsigned long ioaddr = pci->ioaddr;
348
 	unsigned long ioaddr = pci->ioaddr;
350
 	struct net_device *netdev;
349
 	struct net_device *netdev;
351
 	struct virtnet_nic *virtnet;
350
 	struct virtnet_nic *virtnet;

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

495
  *
495
  *
496
  */
496
  */
497
 static int
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
 	struct __vxge_hw_device  *hldev;
500
 	struct __vxge_hw_device  *hldev;
501
 	enum vxge_hw_status status;
501
 	enum vxge_hw_status status;

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

312
 	 * field.
312
 	 * field.
313
 	 */
313
 	 */
314
 	void *priv;
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
 /** A PCI driver */
319
 /** A PCI driver */
326
 	 * Probe device
326
 	 * Probe device
327
 	 *
327
 	 *
328
 	 * @v pci	PCI device
328
 	 * @v pci	PCI device
329
-	 * @v id	Matching entry in ID table
330
 	 * @ret rc	Return status code
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
 	 * Remove device
333
 	 * Remove device
336
 	 *
334
 	 *

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

85
 
85
 
86
 #define PCI_DRIVER(_name,_ids,_class) 					  \
86
 #define PCI_DRIVER(_name,_ids,_class) 					  \
87
 	static inline int						  \
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
 	static inline void						  \
89
 	static inline void						  \
91
 	_name ## _pci_legacy_remove ( struct pci_device *pci );		  \
90
 	_name ## _pci_legacy_remove ( struct pci_device *pci );		  \
92
 	struct pci_driver _name __pci_driver = {			  \
91
 	struct pci_driver _name __pci_driver = {			  \
211
 		_unsafe_disable ( nic, hwdev );				  \
210
 		_unsafe_disable ( nic, hwdev );				  \
212
 	}								  \
211
 	}								  \
213
 	static inline int						  \
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
 		return legacy_probe ( pci, legacy_pci_set_drvdata,	  \
214
 		return legacy_probe ( pci, legacy_pci_set_drvdata,	  \
217
 				      &pci->dev, _name ## _probe,	  \
215
 				      &pci->dev, _name ## _probe,	  \
218
 				      _name ## _disable );		  \
216
 				      _name ## _disable );		  \

Loading…
Cancel
Save