|  | @@ -50,6 +50,9 @@ FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
 | 
		
	
		
			
			| 50 | 50 |   * addition to the UNDI driver, build e.g. "bin/undi.dsk".
 | 
		
	
		
			
			| 51 | 51 |   */
 | 
		
	
		
			
			| 52 | 52 |  
 | 
		
	
		
			
			|  | 53 | +/** UNDI root bus device */
 | 
		
	
		
			
			|  | 54 | +static struct device undibus_dev;
 | 
		
	
		
			
			|  | 55 | +
 | 
		
	
		
			
			| 53 | 56 |  /**
 | 
		
	
		
			
			| 54 | 57 |   * Probe UNDI root bus
 | 
		
	
		
			
			| 55 | 58 |   *
 | 
		
	
	
		
			
			|  | @@ -60,6 +63,7 @@ FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
 | 
		
	
		
			
			| 60 | 63 |   */
 | 
		
	
		
			
			| 61 | 64 |  static int undibus_probe ( struct root_device *rootdev ) {
 | 
		
	
		
			
			| 62 | 65 |  	struct undi_device *undi = &preloaded_undi;
 | 
		
	
		
			
			|  | 66 | +	struct device *dev = &undibus_dev;
 | 
		
	
		
			
			| 63 | 67 |  	int rc;
 | 
		
	
		
			
			| 64 | 68 |  
 | 
		
	
		
			
			| 65 | 69 |  	/* Check for a valie preloaded UNDI device */
 | 
		
	
	
		
			
			|  | @@ -69,34 +73,32 @@ static int undibus_probe ( struct root_device *rootdev ) {
 | 
		
	
		
			
			| 69 | 73 |  	}
 | 
		
	
		
			
			| 70 | 74 |  
 | 
		
	
		
			
			| 71 | 75 |  	/* Add to device hierarchy */
 | 
		
	
		
			
			| 72 |  | -	undi->dev.driver_name = "undionly";
 | 
		
	
		
			
			|  | 76 | +	dev->driver_name = "undionly";
 | 
		
	
		
			
			| 73 | 77 |  	if ( undi->pci_busdevfn != UNDI_NO_PCI_BUSDEVFN ) {
 | 
		
	
		
			
			| 74 |  | -		undi->dev.desc.bus_type = BUS_TYPE_PCI;
 | 
		
	
		
			
			| 75 |  | -		undi->dev.desc.location = undi->pci_busdevfn;
 | 
		
	
		
			
			| 76 |  | -		undi->dev.desc.vendor = undi->pci_vendor;
 | 
		
	
		
			
			| 77 |  | -		undi->dev.desc.device = undi->pci_device;
 | 
		
	
		
			
			| 78 |  | -		snprintf ( undi->dev.name, sizeof ( undi->dev.name ),
 | 
		
	
		
			
			| 79 |  | -			   "UNDI-PCI%02x:%02x.%x",
 | 
		
	
		
			
			| 80 |  | -			   PCI_BUS ( undi->pci_busdevfn ),
 | 
		
	
		
			
			|  | 78 | +		dev->desc.bus_type = BUS_TYPE_PCI;
 | 
		
	
		
			
			|  | 79 | +		dev->desc.location = undi->pci_busdevfn;
 | 
		
	
		
			
			|  | 80 | +		dev->desc.vendor = undi->pci_vendor;
 | 
		
	
		
			
			|  | 81 | +		dev->desc.device = undi->pci_device;
 | 
		
	
		
			
			|  | 82 | +		snprintf ( dev->name, sizeof ( dev->name ),
 | 
		
	
		
			
			|  | 83 | +			   "0000:%02x:%02x.%x", PCI_BUS ( undi->pci_busdevfn ),
 | 
		
	
		
			
			| 81 | 84 |  			   PCI_SLOT ( undi->pci_busdevfn ),
 | 
		
	
		
			
			| 82 | 85 |  			   PCI_FUNC ( undi->pci_busdevfn ) );
 | 
		
	
		
			
			| 83 | 86 |  	} else if ( undi->isapnp_csn != UNDI_NO_ISAPNP_CSN ) {
 | 
		
	
		
			
			| 84 |  | -		undi->dev.desc.bus_type = BUS_TYPE_ISAPNP;
 | 
		
	
		
			
			| 85 |  | -		snprintf ( undi->dev.name, sizeof ( undi->dev.name ),
 | 
		
	
		
			
			| 86 |  | -			   "UNDI-ISAPNP" );
 | 
		
	
		
			
			|  | 87 | +		dev->desc.bus_type = BUS_TYPE_ISAPNP;
 | 
		
	
		
			
			|  | 88 | +		snprintf ( dev->name, sizeof ( dev->name ), "ISAPNP" );
 | 
		
	
		
			
			| 87 | 89 |  	}
 | 
		
	
		
			
			| 88 |  | -	undi->dev.parent = &rootdev->dev;
 | 
		
	
		
			
			| 89 |  | -	list_add ( &undi->dev.siblings, &rootdev->dev.children);
 | 
		
	
		
			
			| 90 |  | -	INIT_LIST_HEAD ( &undi->dev.children );
 | 
		
	
		
			
			|  | 90 | +	dev->parent = &rootdev->dev;
 | 
		
	
		
			
			|  | 91 | +	list_add ( &dev->siblings, &rootdev->dev.children);
 | 
		
	
		
			
			|  | 92 | +	INIT_LIST_HEAD ( &dev->children );
 | 
		
	
		
			
			| 91 | 93 |  
 | 
		
	
		
			
			| 92 | 94 |  	/* Create network device */
 | 
		
	
		
			
			| 93 |  | -	if ( ( rc = undinet_probe ( undi ) ) != 0 )
 | 
		
	
		
			
			|  | 95 | +	if ( ( rc = undinet_probe ( undi, dev ) ) != 0 )
 | 
		
	
		
			
			| 94 | 96 |  		goto err;
 | 
		
	
		
			
			| 95 | 97 |  
 | 
		
	
		
			
			| 96 | 98 |  	return 0;
 | 
		
	
		
			
			| 97 | 99 |  
 | 
		
	
		
			
			| 98 | 100 |   err:
 | 
		
	
		
			
			| 99 |  | -	list_del ( &undi->dev.siblings );
 | 
		
	
		
			
			|  | 101 | +	list_del ( &dev->siblings );
 | 
		
	
		
			
			| 100 | 102 |  	return rc;
 | 
		
	
		
			
			| 101 | 103 |  }
 | 
		
	
		
			
			| 102 | 104 |  
 | 
		
	
	
		
			
			|  | @@ -107,9 +109,10 @@ static int undibus_probe ( struct root_device *rootdev ) {
 | 
		
	
		
			
			| 107 | 109 |   */
 | 
		
	
		
			
			| 108 | 110 |  static void undibus_remove ( struct root_device *rootdev __unused ) {
 | 
		
	
		
			
			| 109 | 111 |  	struct undi_device *undi = &preloaded_undi;
 | 
		
	
		
			
			|  | 112 | +	struct device *dev = &undibus_dev;
 | 
		
	
		
			
			| 110 | 113 |  
 | 
		
	
		
			
			| 111 | 114 |  	undinet_remove ( undi );
 | 
		
	
		
			
			| 112 |  | -	list_del ( &undi->dev.siblings );
 | 
		
	
		
			
			|  | 115 | +	list_del ( &dev->siblings );
 | 
		
	
		
			
			| 113 | 116 |  }
 | 
		
	
		
			
			| 114 | 117 |  
 | 
		
	
		
			
			| 115 | 118 |  /** UNDI bus root device driver */
 |