Skip to content

Commit

Permalink
[PATCH] DM9000 - incorrect ioctl() handling
Browse files Browse the repository at this point in the history
The DM9000 driver is responding to ioctl() calls it should not be. This
can cause problems with the wireless tools incorrectly indentifying the
device as wireless capable, and crashing under certain operations.

This patch also moves the version printk() to the init call, so that
you only get it once for multiple devices, and to show it is loaded
if there are no defined dm9000s

Signed-off-by: Ben Dooks <ben-linux@fluff.org>
Signed-off-by: Jeff Garzik <jgarzik@pobox.com>
  • Loading branch information
Ben Dooks authored and Jeff Garzik committed Aug 18, 2005
1 parent 9ef9ac5 commit 2ae2d77
Showing 1 changed file with 2 additions and 13 deletions.
15 changes: 2 additions & 13 deletions drivers/net/dm9000.c
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,6 @@ static int dm9000_probe(struct device *);
static int dm9000_open(struct net_device *);
static int dm9000_start_xmit(struct sk_buff *, struct net_device *);
static int dm9000_stop(struct net_device *);
static int dm9000_do_ioctl(struct net_device *, struct ifreq *, int);


static void dm9000_timer(unsigned long);
Expand Down Expand Up @@ -391,8 +390,6 @@ dm9000_probe(struct device *dev)
int i;
u32 id_val;

printk(KERN_INFO "%s Ethernet Driver\n", CARDNAME);

/* Init network device */
ndev = alloc_etherdev(sizeof (struct board_info));
if (!ndev) {
Expand Down Expand Up @@ -547,7 +544,6 @@ dm9000_probe(struct device *dev)
ndev->stop = &dm9000_stop;
ndev->get_stats = &dm9000_get_stats;
ndev->set_multicast_list = &dm9000_hash_table;
ndev->do_ioctl = &dm9000_do_ioctl;

#ifdef DM9000_PROGRAM_EEPROM
program_eeprom(db);
Expand Down Expand Up @@ -851,15 +847,6 @@ dm9000_get_stats(struct net_device *dev)
return &db->stats;
}

/*
* Process the upper socket ioctl command
*/
static int
dm9000_do_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
{
PRINTK1("entering %s\n",__FUNCTION__);
return 0;
}

/*
* A periodic timer routine
Expand Down Expand Up @@ -1213,6 +1200,8 @@ static struct device_driver dm9000_driver = {
static int __init
dm9000_init(void)
{
printk(KERN_INFO "%s Ethernet Driver\n", CARDNAME);

return driver_register(&dm9000_driver); /* search board and register */
}

Expand Down

0 comments on commit 2ae2d77

Please sign in to comment.