mirror of https://github.com/ipxe/ipxe.git
[device] Make driver name a generic device property
Signed-off-by: Michael Brown <mcb30@ipxe.org>pull/5/head
parent
6e6ecacebf
commit
fc7e2be617
|
@ -63,8 +63,8 @@ static int eisa_probe ( struct eisa_device *eisa ) {
|
||||||
ISA_PROD_ID ( eisa->prod_id ) )
|
ISA_PROD_ID ( eisa->prod_id ) )
|
||||||
continue;
|
continue;
|
||||||
eisa->driver = driver;
|
eisa->driver = driver;
|
||||||
eisa->driver_name = id->name;
|
eisa->dev.driver_name = id->name;
|
||||||
DBG ( "...using driver %s\n", eisa->driver_name );
|
DBG ( "...using driver %s\n", eisa->dev.driver_name );
|
||||||
if ( ( rc = driver->probe ( eisa, id ) ) != 0 ) {
|
if ( ( rc = driver->probe ( eisa, id ) ) != 0 ) {
|
||||||
DBG ( "......probe failed\n" );
|
DBG ( "......probe failed\n" );
|
||||||
continue;
|
continue;
|
||||||
|
|
|
@ -114,6 +114,7 @@ static int isabus_probe ( struct root_device *rootdev ) {
|
||||||
/* Add to device hierarchy */
|
/* Add to device hierarchy */
|
||||||
snprintf ( isa->dev.name, sizeof ( isa->dev.name ),
|
snprintf ( isa->dev.name, sizeof ( isa->dev.name ),
|
||||||
"ISA%04x", isa->ioaddr );
|
"ISA%04x", isa->ioaddr );
|
||||||
|
isa->dev.driver_name = driver->name;
|
||||||
isa->dev.desc.bus_type = BUS_TYPE_ISA;
|
isa->dev.desc.bus_type = BUS_TYPE_ISA;
|
||||||
isa->dev.desc.vendor = driver->vendor_id;
|
isa->dev.desc.vendor = driver->vendor_id;
|
||||||
isa->dev.desc.device = driver->prod_id;
|
isa->dev.desc.device = driver->prod_id;
|
||||||
|
|
|
@ -600,8 +600,8 @@ static int isapnp_probe ( struct isapnp_device *isapnp ) {
|
||||||
ISA_PROD_ID ( isapnp->prod_id ) )
|
ISA_PROD_ID ( isapnp->prod_id ) )
|
||||||
continue;
|
continue;
|
||||||
isapnp->driver = driver;
|
isapnp->driver = driver;
|
||||||
isapnp->driver_name = id->name;
|
isapnp->dev.driver_name = id->name;
|
||||||
DBG ( "...using driver %s\n", isapnp->driver_name );
|
DBG ( "...using driver %s\n", isapnp->dev.driver_name );
|
||||||
if ( ( rc = driver->probe ( isapnp, id ) ) != 0 ) {
|
if ( ( rc = driver->probe ( isapnp, id ) ) != 0 ) {
|
||||||
DBG ( "......probe failed\n" );
|
DBG ( "......probe failed\n" );
|
||||||
continue;
|
continue;
|
||||||
|
|
|
@ -44,8 +44,8 @@ static int mca_probe ( struct mca_device *mca ) {
|
||||||
if ( id->id != MCA_ID ( mca ) )
|
if ( id->id != MCA_ID ( mca ) )
|
||||||
continue;
|
continue;
|
||||||
mca->driver = driver;
|
mca->driver = driver;
|
||||||
mca->driver_name = id->name;
|
mca->dev.driver_name = id->name;
|
||||||
DBG ( "...using driver %s\n", mca->driver_name );
|
DBG ( "...using driver %s\n", mca->dev.driver_name );
|
||||||
if ( ( rc = driver->probe ( mca, id ) ) != 0 ) {
|
if ( ( rc = driver->probe ( mca, id ) ) != 0 ) {
|
||||||
DBG ( "......probe failed\n" );
|
DBG ( "......probe failed\n" );
|
||||||
continue;
|
continue;
|
||||||
|
|
|
@ -75,6 +75,7 @@ static int linux_probe(struct root_device *rootdev)
|
||||||
|
|
||||||
if (driver->probe(device, request) == 0) {
|
if (driver->probe(device, request) == 0) {
|
||||||
device->driver = driver;
|
device->driver = driver;
|
||||||
|
device->dev.driver_name = driver->name;
|
||||||
/* Driver handled the device so release ownership */
|
/* Driver handled the device so release ownership */
|
||||||
device = NULL;
|
device = NULL;
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -58,6 +58,8 @@ struct device_description {
|
||||||
struct device {
|
struct device {
|
||||||
/** Name */
|
/** Name */
|
||||||
char name[16];
|
char name[16];
|
||||||
|
/** Driver name */
|
||||||
|
const char *driver_name;
|
||||||
/** Device description */
|
/** Device description */
|
||||||
struct device_description desc;
|
struct device_description desc;
|
||||||
/** Devices on the same bus */
|
/** Devices on the same bus */
|
||||||
|
|
|
@ -54,8 +54,6 @@ struct eisa_device {
|
||||||
* this field.
|
* this field.
|
||||||
*/
|
*/
|
||||||
void *priv;
|
void *priv;
|
||||||
/** Driver name */
|
|
||||||
const char *driver_name;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/** An EISA driver */
|
/** An EISA driver */
|
||||||
|
|
|
@ -22,8 +22,6 @@ struct isa_device {
|
||||||
* this field.
|
* this field.
|
||||||
*/
|
*/
|
||||||
void *priv;
|
void *priv;
|
||||||
/** Driver name */
|
|
||||||
const char *driver_name;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
|
@ -198,8 +198,6 @@ struct isapnp_device {
|
||||||
* this field.
|
* this field.
|
||||||
*/
|
*/
|
||||||
void *priv;
|
void *priv;
|
||||||
/** Driver name */
|
|
||||||
const char *driver_name;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/** An ISAPnP driver */
|
/** An ISAPnP driver */
|
||||||
|
|
|
@ -50,8 +50,6 @@ struct mca_device {
|
||||||
* this field.
|
* this field.
|
||||||
*/
|
*/
|
||||||
void *priv;
|
void *priv;
|
||||||
/** Driver name */
|
|
||||||
const char *driver_name;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#define MCA_ID(mca) ( ( (mca)->pos[1] << 8 ) + (mca)->pos[0] )
|
#define MCA_ID(mca) ( ( (mca)->pos[1] << 8 ) + (mca)->pos[0] )
|
||||||
|
|
|
@ -410,6 +410,7 @@ static inline void pci_set_driver ( struct pci_device *pci,
|
||||||
struct pci_device_id *id ) {
|
struct pci_device_id *id ) {
|
||||||
pci->driver = driver;
|
pci->driver = driver;
|
||||||
pci->id = id;
|
pci->id = id;
|
||||||
|
pci->dev.driver_name = id->name;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -87,9 +87,10 @@ static void ifstat_errors ( struct net_device_stats *stats,
|
||||||
* @v netdev Network device
|
* @v netdev Network device
|
||||||
*/
|
*/
|
||||||
void ifstat ( struct net_device *netdev ) {
|
void ifstat ( struct net_device *netdev ) {
|
||||||
printf ( "%s: %s on %s (%s)\n"
|
printf ( "%s: %s using %s on %s (%s)\n"
|
||||||
" [Link:%s, TX:%d TXE:%d RX:%d RXE:%d]\n",
|
" [Link:%s, TX:%d TXE:%d RX:%d RXE:%d]\n",
|
||||||
netdev->name, netdev_addr ( netdev ), netdev->dev->name,
|
netdev->name, netdev_addr ( netdev ),
|
||||||
|
netdev->dev->driver_name, netdev->dev->name,
|
||||||
( netdev_is_open ( netdev ) ? "open" : "closed" ),
|
( netdev_is_open ( netdev ) ? "open" : "closed" ),
|
||||||
( netdev_link_ok ( netdev ) ? "up" : "down" ),
|
( netdev_link_ok ( netdev ) ? "up" : "down" ),
|
||||||
netdev->tx_stats.good, netdev->tx_stats.bad,
|
netdev->tx_stats.good, netdev->tx_stats.bad,
|
||||||
|
|
Loading…
Reference in New Issue