Browse Source

Build under gpxe

tags/v0.9.3
Michael Brown 19 years ago
parent
commit
239579efcf
1 changed files with 15 additions and 17 deletions
  1. 15
    17
      src/drivers/net/etherfabric.c

+ 15
- 17
src/drivers/net/etherfabric.c View File

30
  **************************************************************************
30
  **************************************************************************
31
  */
31
  */
32
 
32
 
33
-#define DBG(...)
34
-
35
 #define EFAB_ASSERT(x)                                                        \
33
 #define EFAB_ASSERT(x)                                                        \
36
         do {                                                                  \
34
         do {                                                                  \
37
                 if ( ! (x) ) {                                                \
35
                 if ( ! (x) ) {                                                \
2923
 /**************************************************************************
2921
 /**************************************************************************
2924
 DISABLE - Turn off ethernet interface
2922
 DISABLE - Turn off ethernet interface
2925
 ***************************************************************************/
2923
 ***************************************************************************/
2926
-static void etherfabric_disable ( struct dev *dev ) {
2927
-	struct nic *nic = ( struct nic * ) dev;
2924
+static void etherfabric_disable ( struct nic *nic,
2925
+				  struct pci_device *pci __unused ) {
2928
 	struct efab_nic *efab = nic->priv_data;
2926
 	struct efab_nic *efab = nic->priv_data;
2929
 
2927
 
2930
 	efab->op->reset ( efab );
2928
 	efab->op->reset ( efab );
2954
 	return;
2952
 	return;
2955
 }
2953
 }
2956
 
2954
 
2955
+static struct nic_operations etherfabric_operations = {
2956
+	.connect	= dummy_connect,
2957
+	.poll		= etherfabric_poll,
2958
+	.transmit	= etherfabric_transmit,
2959
+	.irq		= etherfabric_irq,
2960
+};
2961
+
2957
 /**************************************************************************
2962
 /**************************************************************************
2958
 PROBE - Look for an adapter, this routine's visible to the outside
2963
 PROBE - Look for an adapter, this routine's visible to the outside
2959
 ***************************************************************************/
2964
 ***************************************************************************/
2970
 	memset ( &efab_buffers, 0, sizeof ( efab_buffers ) );
2975
 	memset ( &efab_buffers, 0, sizeof ( efab_buffers ) );
2971
 
2976
 
2972
 	/* Hook in appropriate operations table.  Do this early. */
2977
 	/* Hook in appropriate operations table.  Do this early. */
2973
-	if ( pci->dev_id == EF1002_DEVID ) {
2978
+	if ( pci->device_id == EF1002_DEVID ) {
2974
 		efab.op = &ef1002_operations;
2979
 		efab.op = &ef1002_operations;
2975
 	} else {
2980
 	} else {
2976
 		efab.op = &falcon_operations;
2981
 		efab.op = &falcon_operations;
3011
 	printf ( "Found EtherFabric %s NIC %!\n", pci->name, nic->node_addr );
3016
 	printf ( "Found EtherFabric %s NIC %!\n", pci->name, nic->node_addr );
3012
 
3017
 
3013
 	/* point to NIC specific routines */
3018
 	/* point to NIC specific routines */
3014
-	dev->disable  = etherfabric_disable;
3015
-	nic->poll     = etherfabric_poll;
3016
-	nic->transmit = etherfabric_transmit;
3017
-	nic->irq      = etherfabric_irq;
3019
+	nic->nic_op = &etherfabric_operations;
3018
 
3020
 
3019
 	return 1;
3021
 	return 1;
3020
 }
3022
 }
3024
 PCI_ROM(0x1924, 0x0703, "falcon", "EtherFabric Falcon"),
3026
 PCI_ROM(0x1924, 0x0703, "falcon", "EtherFabric Falcon"),
3025
 };
3027
 };
3026
 
3028
 
3027
-static struct pci_driver etherfabric_driver __pci_driver = {
3028
-	.type     = NIC_DRIVER,
3029
-	.name     = "EFAB",
3030
-	.probe    = etherfabric_probe,
3031
-	.ids      = etherfabric_nics,
3032
-	.id_count = sizeof(etherfabric_nics)/sizeof(etherfabric_nics[0]),
3033
-	.class    = 0,
3034
-};
3029
+PCI_DRIVER ( etherfabric_driver, etherfabric_nics, PCI_NO_CLASS );
3030
+
3031
+DRIVER ( "EFAB", nic_driver, pci_driver, etherfabric_driver,
3032
+	 etherfabric_probe, etherfabric_disable );
3035
 
3033
 
3036
 /*
3034
 /*
3037
  * Local variables:
3035
  * Local variables:

Loading…
Cancel
Save